|
|
@@ -0,0 +1,183 @@
|
|
|
+<template>
|
|
|
+ <el-container>
|
|
|
+ <el-header height="220">
|
|
|
+ <h3>上传通道</h3>
|
|
|
+ <el-row style="margin-top: 10px">
|
|
|
+ <el-button type="plain" icon="el-icon-plus" @click="onAddChannel">添加</el-button>
|
|
|
+ <el-select
|
|
|
+ v-model="selectedValue"
|
|
|
+ style="margin-left: 5px"
|
|
|
+ @change="onSelectChange"
|
|
|
+ >
|
|
|
+ <el-option v-for="(item, index) in tableList" :key="index" :label="item.label" :value="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-row>
|
|
|
+ </el-header>
|
|
|
+ <el-main>
|
|
|
+ <el-table
|
|
|
+ :data="dataList"
|
|
|
+ border
|
|
|
+ height="480"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ fixed="left"
|
|
|
+ label="No"
|
|
|
+ type="index"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="channelCode"
|
|
|
+ label="通道代码"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="prefix"
|
|
|
+ label="URL 前缀"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="maxSize"
|
|
|
+ label="可上传最大文件"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="fileType"
|
|
|
+ label="可上传文件类型"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="scope"
|
|
|
+ label="可见范围"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="enabled"
|
|
|
+ label="状态"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag v-if="scope.row.enabled" :type="'success'" disable-transitions>读写</el-tag>
|
|
|
+ <el-tag v-else :type="'warning'" disable-transitions>只读</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ fixed="right"
|
|
|
+ label="操作"
|
|
|
+ width="280"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ @click="handleEdit(scope.$index, scope.row)"
|
|
|
+ >禁用</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ @click="handleDelete(scope.$index, scope.row)"
|
|
|
+ >删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-main>
|
|
|
+
|
|
|
+ <!-- 修改视频可见范围对话框 -->
|
|
|
+ <el-dialog
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="showEditScopeDialog"
|
|
|
+ width="30%"
|
|
|
+ center
|
|
|
+ />
|
|
|
+ </el-container>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { getChannelList, getUserNodeKeyValue } from '@/api/oss'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'AdminUploadChannel',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ selectedValue: null,
|
|
|
+ // 屏幕宽度, 为了控制分页条的大小
|
|
|
+ screenWidth: document.body.clientWidth,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 12,
|
|
|
+ totalSize: 0,
|
|
|
+ dataList: [],
|
|
|
+ nextId: 0,
|
|
|
+ tableList: [],
|
|
|
+ // **********************************************************************
|
|
|
+ showEditScopeDialog: false,
|
|
|
+ form: {
|
|
|
+ videoId: null,
|
|
|
+ scope: 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ document.title = '上传通道'
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getData() {
|
|
|
+ this.tableList = []
|
|
|
+ getUserNodeKeyValue().then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.tableList = resp.data
|
|
|
+
|
|
|
+ this.selectedValue = this.tableList[0].value
|
|
|
+ this.dataList = []
|
|
|
+ getChannelList(this.selectedValue).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.dataList = resp.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onRefresh() {
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ handleCurrentChange(pageNumber) {
|
|
|
+ this.currentPage = pageNumber
|
|
|
+ this.getData()
|
|
|
+ // 回到顶部
|
|
|
+ scrollTo(0, 0)
|
|
|
+ },
|
|
|
+ handleEdit(index, row) {
|
|
|
+ this.$message.info('handleEdit')
|
|
|
+ },
|
|
|
+ handleDelete(index, row) {
|
|
|
+ this.$confirm('确定要删除 ' + row.title + '?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.$message.info('handleDelete')
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onUpdateScope() {
|
|
|
+ this.showEditScopeDialog = false
|
|
|
+ },
|
|
|
+ onSelectChange() {
|
|
|
+ if (this.selectedValue === null) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ this.dataList = []
|
|
|
+ getChannelList(this.selectedValue).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.dataList = resp.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ },
|
|
|
+ onAddChannel() {
|
|
|
+ this.$message.info('add channel')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style>
|
|
|
+</style>
|