소스 검색

update views/admin

reghao 5 달 전
부모
커밋
508ab450bc

+ 1 - 1
src/api/file.js

@@ -16,7 +16,7 @@ export function getVideoCoverChannelInfo() {
 }
 
 export function getPhotoChannelInfo() {
-  return post(fileApi.ossServerApi + '/photo')
+  return post(fileApi.ossServerApi + '/image')
 }
 
 export function getVideoChannelInfo() {

+ 17 - 2
src/api/oss.js

@@ -1,4 +1,4 @@
-import { get, post } from '@/utils/request'
+import {get, post, postForm} from '@/utils/request'
 
 const ossApi = {
   getStoreList: '/api/oss/store/list',
@@ -6,9 +6,12 @@ const ossApi = {
   getStoreNodeKeyValue: '/api/oss/store/kv',
   getUserNodeList: '/api/oss/my/list',
   getUserNodeKeyValue: '/api/oss/my/kv',
+  addUserNode: '/api/oss/my/add',
   getUserKeyList: '/api/oss/key/list',
   resetUserKey: '/api/oss/key/regenerate',
-  getChannelList: '/api/oss/channel/list'
+  getChannelList: '/api/oss/channel/list',
+  getChannelAttr: '/api/oss/channel/attr',
+  addChannel: '/api/oss/channel/add'
 }
 
 export function getStoreList() {
@@ -31,6 +34,10 @@ export function getUserNodeKeyValue() {
   return get(ossApi.getUserNodeKeyValue)
 }
 
+export function addUserNode(payload) {
+  return postForm(ossApi.addUserNode, payload)
+}
+
 export function getUserKeyList() {
   return get(ossApi.getUserKeyList)
 }
@@ -42,3 +49,11 @@ export function resetUserKey() {
 export function getChannelList(userNodeId) {
   return get(ossApi.getChannelList + '?userNodeId=' + userNodeId)
 }
+
+export function getChannelAttr() {
+  return get(ossApi.getChannelAttr)
+}
+
+export function addChannel(payload) {
+  return post(ossApi.addChannel, payload)
+}

+ 8 - 1
src/api/video.js

@@ -2,6 +2,8 @@ import { get, post, delete0 } from '@/utils/request'
 
 const videoApi = {
   videoPostApi: '/api/content/post/video',
+  videoPostApi1: '/api/content/post/video/publish/post',
+  videoFileApi: '/api/content/post/video/publish/file',
   updateVideoScopeApi: '/api/content/post/video/update/scope',
   updateVideoStatusApi: '/api/content/post/video/update/status',
   updateVideoInfoApi: '/api/content/post/video/update/info',
@@ -30,9 +32,14 @@ const videoApi = {
 }
 
 // *********************************************************************************************************************
+// 添加视频文件
+export function addVideoFile(payload) {
+  return post(videoApi.videoFileApi, payload)
+}
+
 // 添加视频贴
 export function addVideoPost(video) {
-  return post(videoApi.videoPostApi, video)
+  return post(videoApi.videoPostApi1, video)
 }
 
 // 更新视频可见范围

+ 1 - 1
src/components/VideoPreviewPlayer.vue

@@ -68,7 +68,7 @@ export default {
         container: document.querySelector('#dplayer'),
         lang: 'zh-cn',
         screenshot: false,
-        autoplay: false,
+        autoplay: true,
         volume: 0.1,
         mutex: true,
         video: {

+ 0 - 1
src/views/admin/backend/AdminDubboService.vue

@@ -65,7 +65,6 @@
       </el-table>
     </el-main>
 
-    <!-- 修改视频可见范围对话框 -->
     <el-dialog
       append-to-body
       :visible.sync="showEditScopeDialog"

+ 0 - 1
src/views/admin/backend/AdminSpringCloudService.vue

@@ -54,7 +54,6 @@
       </el-table>
     </el-main>
 
-    <!-- 修改视频可见范围对话框 -->
     <el-dialog
       append-to-body
       :visible.sync="showServiceDialog"

+ 9 - 9
src/views/admin/oss/AdminStoreNode.vue

@@ -29,7 +29,7 @@
         />
         <el-table-column
           prop="total"
-          label="存储空间"
+          label="空间已用"
         >
           <template slot-scope="scope">
             <el-progress :percentage="scope.row.percent"></el-progress>
@@ -63,7 +63,6 @@
       </el-table>
     </el-main>
 
-    <!-- 修改视频可见范围对话框 -->
     <el-dialog
       append-to-body
       :visible.sync="showEditScopeDialog"
@@ -82,6 +81,10 @@
             label="No"
             type="index"
           />
+          <el-table-column
+            prop="storeDir"
+            label="存储目录"
+          />
           <el-table-column
             prop="fsType"
             label="文件系统"
@@ -90,13 +93,9 @@
             prop="volume"
             label="磁盘分区"
           />
-          <el-table-column
-            prop="storeDir"
-            label="存储目录"
-          />
           <el-table-column
             prop="total"
-            label="分区容量"
+            label="容量已用"
           >
             <template slot-scope="scope">
               <el-progress :percentage="scope.row.percent"></el-progress>
@@ -104,7 +103,7 @@
           </el-table-column>
           <el-table-column
             prop="totalInode"
-            label="inode 容量"
+            label="inode 已用"
           >
             <template slot-scope="scope">
               <el-progress :percentage="scope.row.percentInode"></el-progress>
@@ -139,7 +138,8 @@ export default {
       form: {
         videoId: null,
         scope: 1
-      }
+      },
+      selectedValue: null
     }
   },
   created() {

+ 4 - 4
src/views/admin/oss/AdminStoreObject.vue

@@ -65,14 +65,13 @@
       </el-table>
     </el-main>
 
-    <!-- 修改视频可见范围对话框 -->
     <el-dialog
       append-to-body
       :visible.sync="showEditScopeDialog"
       center
     >
       <div>
-        <h3>存储节点磁盘详情</h3>
+        <h3>详情</h3>
         <el-table
           :data="tableList"
           border
@@ -141,11 +140,12 @@ export default {
       form: {
         videoId: null,
         scope: 1
-      }
+      },
+      selectedValue: null
     }
   },
   created() {
-    document.title = '存储节点'
+    document.title = '我的节点'
     this.getData()
   },
   methods: {

+ 93 - 10
src/views/admin/oss/AdminUploadChannel.vue

@@ -3,7 +3,7 @@
     <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-button type="plain">我的节点</el-button>
         <el-select
           v-model="selectedValue"
           style="margin-left: 5px"
@@ -11,6 +11,7 @@
         >
           <el-option v-for="(item, index) in tableList" :key="index" :label="item.label" :value="item.value" />
         </el-select>
+        <el-button style="margin-left: 5px" type="plain" icon="el-icon-plus" @click="onAddChannel">添加</el-button>
       </el-row>
     </el-header>
     <el-main>
@@ -74,18 +75,74 @@
       </el-table>
     </el-main>
 
-    <!-- 修改视频可见范围对话框 -->
     <el-dialog
       append-to-body
-      :visible.sync="showEditScopeDialog"
-      width="30%"
+      :visible.sync="showAddChannelDialog"
       center
-    />
+    >
+      <div>
+        <el-form ref="myChannelForm" :model="myChannelForm">
+          <el-form-item label="通道前缀" label-width="120px" prop="domain">
+            <el-input
+              v-model="myChannelForm.channelPrefix"
+              placeholder="通道前缀"
+              style="margin-left: 5px;width: 220px"
+            />
+          </el-form-item>
+          <el-form-item label="对象类型" label-width="120px" prop="storeNodeId">
+            <el-select
+              v-model="myChannelForm.objectType"
+            >
+              <el-option
+                v-for="(item, index) in objectTypes"
+                :key="index"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="对象可见范围" label-width="120px" prop="storeNodeId">
+            <el-select
+              v-model="myChannelForm.scope"
+            >
+              <el-option
+                v-for="(item, index) in objectScopes"
+                :key="index"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="对象最大值" label-width="120px" prop="storeNodeId">
+            <el-select
+              v-model="myChannelForm.maxSize"
+            >
+              <el-option
+                v-for="(item, index) in sizeList"
+                :key="index"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-button
+            type="primary"
+            plain
+            size="small"
+            icon="el-icon-plus"
+            style="margin-left: 40px"
+            @click="addChannelWrapper"
+          >
+            添加
+          </el-button>
+        </el-form>
+      </div>
+    </el-dialog>
   </el-container>
 </template>
 
 <script>
-import { getChannelList, getUserNodeKeyValue } from '@/api/oss'
+import {addChannel, getChannelAttr, getChannelList, getUserNodeKeyValue} from '@/api/oss'
 
 export default {
   name: 'AdminUploadChannel',
@@ -101,10 +158,20 @@ export default {
       nextId: 0,
       tableList: [],
       // **********************************************************************
-      showEditScopeDialog: false,
+      showAddChannelDialog: false,
       form: {
         videoId: null,
         scope: 1
+      },
+      objectTypes: [],
+      objectScopes: [],
+      sizeList: [],
+      myChannelForm: {
+        channelPrefix: null,
+        maxSize: null,
+        objectType: null,
+        scope: null,
+        userNodeId: null
       }
     }
   },
@@ -114,11 +181,20 @@ export default {
   },
   methods: {
     getData() {
+      getChannelAttr().then(resp => {
+        if (resp.code === 0) {
+          this.objectTypes = resp.data.objectTypes
+          this.objectScopes = resp.data.objectScopes
+          this.sizeList = resp.data.sizeList
+        } else {
+          this.$message.error(resp.msg)
+        }
+      })
+
       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 => {
@@ -160,7 +236,7 @@ export default {
       })
     },
     onUpdateScope() {
-      this.showEditScopeDialog = false
+      this.showAddChannelDialog = false
     },
     onSelectChange() {
       if (this.selectedValue === null) {
@@ -179,7 +255,14 @@ export default {
     handleClose() {
     },
     onAddChannel() {
-      this.$message.info('add channel')
+      this.showAddChannelDialog = true
+    },
+    addChannelWrapper() {
+      this.showAddChannelDialog = false
+      this.myChannelForm.userNodeId = this.selectedValue
+      addChannel(this.myChannelForm).then(resp => {
+        this.$message.info(resp.msg)
+      })
     }
   }
 }

+ 84 - 4
src/views/admin/oss/AdminUserNode.vue

@@ -2,7 +2,7 @@
   <el-container>
     <el-header height="220">
       <h3>我的节点</h3>
-      <el-button type="text">添加节点</el-button>
+      <el-button type="text" @click="onAddNode">添加节点</el-button>
       <el-button type="text" @click="onShowKeyDialog">凭证列表</el-button>
     </el-header>
     <el-main>
@@ -57,7 +57,6 @@
       </el-table>
     </el-main>
 
-    <!-- 修改视频可见范围对话框 -->
     <el-dialog
       append-to-body
       :visible.sync="showKeyDialog"
@@ -100,11 +99,64 @@
         </el-table-column>
       </el-table>
     </el-dialog>
+    <el-dialog
+      append-to-body
+      :visible.sync="showNodeDialog"
+      center
+    >
+      <div>
+        <el-form ref="myNodeForm" :model="myNodeForm">
+          <el-form-item label="存储节点" label-width="120px" prop="storeNodeId">
+            <el-select
+              v-model="myNodeForm.storeNodeId"
+            >
+              <el-option
+                v-for="(item, index) in selectOptionList"
+                :key="index"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="域名" label-width="120px" prop="domain">
+            <el-input
+              v-model="myNodeForm.domain"
+              placeholder="域名"
+              style="margin-left: 5px;width: 220px"
+            />
+          </el-form-item>
+          <el-form-item label="referer" label-width="120px" prop="domain">
+            <el-input
+              v-model="myNodeForm.referer"
+              placeholder="referer"
+              style="margin-left: 5px;width: 220px"
+            />
+          </el-form-item>
+          <el-form-item label="SecretKey" label-width="120px" prop="domain">
+            <el-input
+              v-model="myNodeForm.secretKey"
+              placeholder="secretKey"
+              style="margin-left: 5px;width: 220px"
+            />
+          </el-form-item>
+          <el-button
+            type="primary"
+            plain
+            size="small"
+            icon="el-icon-plus"
+            style="margin-left: 40px"
+            @click="addUserNodeWrapper"
+          >
+            添加
+          </el-button>
+        </el-form>
+      </div>
+    </el-dialog>
   </el-container>
 </template>
 
 <script>
-import { getUserKeyList, getUserNodeList, resetUserKey } from '@/api/oss'
+import { addUserNode, getStoreNodeKeyValue, getUserKeyList, getUserNodeList, resetUserKey } from '@/api/oss'
 
 export default {
   name: 'AdminUserNode',
@@ -126,6 +178,12 @@ export default {
       form: {
         videoId: null,
         scope: 1
+      },
+      showNodeDialog: false,
+      selectOptionList: [],
+      myNodeForm: {
+        storeNodeId: null,
+        domain: null
       }
     }
   },
@@ -197,7 +255,29 @@ export default {
         }
       })
     },
-    handleClose() {
+    onAddNode() {
+      getStoreNodeKeyValue().then(resp => {
+        if (resp.code === 0) {
+          this.selectOptionList = resp.data
+          this.showNodeDialog = true
+          this.myNodeForm.storeNodeId = this.selectOptionList[0].value
+        } else {
+          this.$message.error(resp.msg)
+        }
+      }).catch(error => {
+        this.$message.error(error.message)
+      })
+    },
+    addUserNodeWrapper() {
+      this.showNodeDialog = false
+      addUserNode(this.myNodeForm).then(resp => {
+        console.log(resp)
+        this.$message.info(resp.msg)
+      }).catch(error => {
+        this.$message.error(error.message)
+      }).finally(() => {
+        this.$refs['myNodeForm'].resetFields()
+      })
     }
   }
 }

+ 47 - 1
src/views/admin/site/AdminCategory.vue

@@ -5,6 +5,7 @@
         <el-card class="box-card">
           <div slot="header" class="clearfix">
             <span>视频分区</span>
+            <el-button style="float: right; padding: 3px 0" type="text" @click="onAddCategory">添加</el-button>
           </div>
           <div class="text item">
             <el-tree
@@ -65,6 +66,39 @@
         </el-form>
       </el-row>
     </el-dialog>
+    <el-dialog
+      append-to-body
+      :visible.sync="addCategoryDialog"
+      width="30%"
+      center
+    >
+      <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px; text-align: center">
+        <el-form ref="form" :model="categoryForm" label-width="80px">
+          <el-form-item label="父分区" prop="pid">
+            <el-input
+              v-model="categoryForm.pid"
+              placeholder="父分区"
+            />
+          </el-form-item>
+          <el-form-item label="名字" prop="name">
+            <el-input
+              v-model="categoryForm.name"
+              placeholder="名字"
+            />
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              type="plain"
+              @click.native="addCategory"
+            >更新</el-button>
+            <el-button
+              type="plain"
+              @click.native="addCategoryDialog = false"
+            >取消</el-button>
+          </el-form-item>
+        </el-form>
+      </el-row>
+    </el-dialog>
   </el-row>
 </template>
 
@@ -91,6 +125,11 @@ export default {
       updateDialog: false,
       updateForm: {
         content: null
+      },
+      addCategoryDialog: false,
+      categoryForm: {
+        pid: null,
+        name: null
       }
     }
   },
@@ -140,8 +179,15 @@ export default {
       this.updateDialog = true
     },
     updateNotice() {
-      this.$message.info(this.updateForm.content)
       this.updateDialog = false
+      this.$message.info(this.updateForm.content)
+    },
+    onAddCategory() {
+      this.addCategoryDialog = true
+    },
+    addCategory() {
+      this.addCategoryDialog = false
+      this.$message.info('add category')
     }
   }
 }

+ 79 - 5
src/views/admin/site/AdminNotifyConfig.vue

@@ -1,10 +1,11 @@
 <template>
   <el-row>
     <el-row class="movie-list">
-      <el-col :md="18" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+      <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
         <el-card class="box-card">
           <div slot="header" class="clearfix">
-            <span>邮件通知配置</span>
+            <span>邮件通知</span>
+            <el-button style="float: right; padding: 3px 0" type="text" @click="onAddEmail">添加</el-button>
           </div>
           <div class="text item">
             <el-table
@@ -33,8 +34,52 @@
                 label="发送人"
               />
               <el-table-column
-                prop="defaultSender"
-                label="是否默认"
+                fixed="right"
+                label="操作"
+              >
+                <template slot-scope="scope">
+                  <el-button
+                    size="mini"
+                    @click="onApprove(scope.row)"
+                  >同意</el-button>
+                  <el-button
+                    size="mini"
+                    type="danger"
+                    @click="onDecline(scope.row)"
+                  >拒绝</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </el-card>
+      </el-col>
+      <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+        <el-card class="box-card">
+          <div slot="header" class="clearfix">
+            <span>webhook 通知</span>
+            <el-button style="float: right; padding: 3px 0" type="text" @click="onAddEmail">添加</el-button>
+          </div>
+          <div class="text item">
+            <el-table
+              :data="notifyConfigList"
+              border
+              style="width: 100%"
+            >
+              <el-table-column
+                prop="id"
+                label="ID"
+              />
+              <el-table-column
+                prop="name"
+                label="名字"
+              />
+              <el-table-column
+                prop="webhook"
+                label="Webhook"
+              />
+              <el-table-column
+                prop="sign"
+                label="签名"
               />
               <el-table-column
                 fixed="right"
@@ -57,6 +102,28 @@
         </el-card>
       </el-col>
     </el-row>
+    <el-row class="movie-list">
+      <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+        <el-card class="box-card">
+          <div slot="header" class="clearfix">
+            <span>通知配置</span>
+            <el-button style="float: right; padding: 3px 0" type="text" @click="onAddEmail">添加</el-button>
+          </div>
+          <div class="text item">
+            <el-form ref="form" :model="notifyConfig" label-width="120px">
+              <el-form-item label="邮件通知">
+                <el-input v-model="notifyConfig.email" style="width: 70%; padding-right: 10px" readonly />
+                <el-button size="mini" type="info" @click="showUpdateDialog(1)">更新</el-button>
+              </el-form-item>
+              <el-form-item label="webhook 通知">
+                <el-input v-model="notifyConfig.webhook" style="width: 70%; padding-right: 10px" readonly />
+                <el-button size="mini" type="info" @click="showUpdateDialog(1)">更新</el-button>
+              </el-form-item>
+            </el-form>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
 
     <el-dialog
       append-to-body
@@ -111,6 +178,10 @@ export default {
         captchaCode: null,
         channel: 1,
         plat: 2
+      },
+      notifyConfig: {
+        email: '163mail',
+        webhook: 'dingWebhook'
       }
     }
   },
@@ -131,7 +202,7 @@ export default {
       })
     },
     // ****************************************************************************************************************
-    onUpdate() {
+    onAddEmail() {
       this.updateDialog = false
     },
     updateUserEmail() {
@@ -143,6 +214,9 @@ export default {
     },
     onDecline(row) {
       this.$message.info('拒绝充值' + row.chargeId)
+    },
+    showUpdateDialog() {
+      this.$message.info('update notify')
     }
   }
 }

+ 0 - 1
src/views/mall/MyProduct.vue

@@ -124,7 +124,6 @@
         <el-button type="primary" @click="publishVideoDiaglog = false">关 闭</el-button>
       </span>
     </el-dialog>
-    <!-- 修改视频可见范围对话框 -->
     <el-dialog
       append-to-body
       :visible.sync="showEditScopeDialog"

+ 2 - 1
src/views/post/VideoPost.vue

@@ -202,7 +202,6 @@
         <el-button type="text" @click="publishVideoDiaglog = false">取 消</el-button>
       </span>
     </el-dialog>
-    <!-- 修改视频可见范围对话框 -->
     <el-dialog
       append-to-body
       :visible.sync="showEditScopeDialog"
@@ -383,6 +382,8 @@ export default {
       this.$message.info(this.queryInfo)
     },
     handleClose() {
+      // this.publishVideoDiaglog = false
+      this.$message.info('点击底部取消按钮关闭')
     },
     onVideoPublish(videoForm) {
       this.publishVideoDiaglog = false

+ 48 - 38
src/views/post/VideoPostPublish.vue

@@ -1,7 +1,7 @@
 <template>
   <el-row class="movie-list">
     <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
-      <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
+      <el-col :md="18" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
         <el-card class="box-card">
           <div slot="header" class="clearfix">
             <span>上传视频文件</span>
@@ -27,13 +27,15 @@
           </div>
         </el-card>
       </el-col>
+    </el-row>
+    <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
       <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
         <el-card class="box-card">
           <div slot="header" class="clearfix">
             <span>上传视频封面</span>
           </div>
           <div class="text item">
-            <el-tooltip class="item" effect="dark" content="点击上传图片" placement="top-end">
+            <el-tooltip class="item" effect="dark" content="点击上传视频封面" placement="top-end">
               <el-upload
                 class="avatar-uploader"
                 :action="imgOssUrl"
@@ -53,8 +55,6 @@
           </div>
         </el-card>
       </el-col>
-    </el-row>
-    <el-row style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
       <el-col :md="12" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
         <el-card class="box-card">
           <div slot="header" class="clearfix">
@@ -62,15 +62,15 @@
             <el-button style="float: right; padding: 3px 0" type="text" @click="onSubmit">发布</el-button>
           </div>
           <div class="text item">
-            <el-form ref="form" :model="form" label-width="80px">
+            <el-form ref="videoPostForm" :model="videoPostForm" label-width="80px">
               <el-form-item label="标题">
-                <el-input v-model="form.title" style="padding-right: 1px" placeholder="标题不能超过 50 个字符" />
+                <el-input v-model="videoPostForm.title" style="padding-right: 1px" placeholder="标题不能超过 50 个字符" />
               </el-form-item>
               <el-form-item label="描述">
-                <el-input v-model="form.description" type="textarea" autosize style="padding-right: 1px;" />
+                <el-input v-model="videoPostForm.description" type="textarea" autosize style="padding-right: 1px;" />
               </el-form-item>
               <el-form-item label="分区">
-                <el-select v-model="form.categoryPid" placeholder="请选择分区" @change="getCategory">
+                <el-select v-model="videoPostForm.categoryPid" placeholder="请选择分区" @change="getCategory">
                   <el-option
                     v-for="item in pCategoryList"
                     :key="item.value"
@@ -78,7 +78,7 @@
                     :value="item.value"
                   />
                 </el-select>
-                <el-select v-model="form.categoryId" placeholder="请选择子分区">
+                <el-select v-model="videoPostForm.categoryId" placeholder="请选择子分区">
                   <el-option
                     v-for="item in categoryList"
                     :key="item.value"
@@ -88,12 +88,12 @@
                 </el-select>
               </el-form-item>
               <el-form-item label="标签">
-                <el-select v-model="form.tags" style="padding-right: 1px" placeholder="输入标签,用回车添加" clearable multiple filterable allow-create default-first-option @change="getRecommendTags">
+                <el-select v-model="videoPostForm.tags" style="padding-right: 1px" placeholder="输入标签,用回车添加" clearable multiple filterable allow-create default-first-option @change="getRecommendTags">
                   <el-option v-for="item in rcmdTags" :key="item.value" :label="item.label" :value="item.label" />
                 </el-select>
               </el-form-item>
               <el-form-item label="可见范围">
-                <el-select v-model="form.scope" placeholder="选择稿件的可见范围">
+                <el-select v-model="videoPostForm.scope" placeholder="选择稿件的可见范围">
                   <el-option label="本人可见" value="1" />
                   <el-option label="所有人可见" value="2" />
                   <el-option label="VIP 可见" value="3" />
@@ -116,7 +116,7 @@
 </template>
 
 <script>
-import { videoRegion } from '@/api/video'
+import { addVideoFile, videoRegion } from '@/api/video'
 import { getVideoChannelInfo, getVideoCoverChannelInfo } from '@/api/file'
 import { hashFile } from '@/utils/functions'
 
@@ -150,11 +150,11 @@ export default {
       rcmdTags: [
         /* { label: "知识点1" }*/
       ],
-      form: {
-        videoFileId: null,
-        channelCode: 0,
+      videoChannelCode: 0,
+      videoPostForm: {
+        videoId: null,
         coverFileId: null,
-        coverChannelId: 0,
+        coverChannelCode: 0,
         title: null,
         description: null,
         categoryPid: null,
@@ -170,7 +170,8 @@ export default {
     getVideoChannelInfo().then(res => {
       if (res.code === 0) {
         const resData = res.data
-        this.form.channelCode = resData.channelCode
+        this.videoChannelCode = resData.channelCode
+        this.videoPostForm.channelCode = resData.channelCode
         this.options = {
           target: resData.ossUrl,
           // 分块大小 10MB
@@ -219,7 +220,7 @@ export default {
     getVideoCoverChannelInfo().then(res => {
       if (res.code === 0) {
         const resData = res.data
-        this.form.coverChannelId = resData.channelCode
+        this.videoPostForm.coverChannelCode = resData.channelCode
         this.imgData.channelCode = resData.channelCode
         this.imgOssUrl = resData.ossUrl
         this.imgHeaders.Authorization = 'Bearer ' + resData.token
@@ -274,12 +275,21 @@ export default {
       const res = JSON.parse(response)
       if (res.code === 0) {
         const resData = res.data
-        this.form.videoFileId = resData.uploadId
-        this.$notify({
-          title: '提示',
-          message: '视频已上传',
-          type: 'warning',
-          duration: 3000
+        const videoFileForm = {
+          videoFileId: resData.uploadId,
+          channelCode: this.videoChannelCode,
+          filename: file.file.name
+        }
+        addVideoFile(videoFileForm).then(resp => {
+          if (resp.code === 0) {
+            this.videoPostForm.videoId = resp.data
+            this.$notify({
+              title: '提示',
+              message: '视频已上传',
+              type: 'warning',
+              duration: 3000
+            })
+          }
         })
       } else {
         this.$notify({
@@ -326,9 +336,9 @@ export default {
         // 视频视频分辨率
         const videoWidth = videoElem.videoWidth
         const videoHeight = videoElem.videoHeight
-        this.form.width = videoWidth
-        this.form.height = videoHeight
-        this.form.duration = videoElem.duration
+        this.videoPostForm.width = videoWidth
+        this.videoPostForm.height = videoHeight
+        this.videoPostForm.duration = videoElem.duration
 
         videoElem.pause()
         // 设置画布尺寸
@@ -374,7 +384,7 @@ export default {
             if (json.code === 0) {
               this.coverUrl = URL.createObjectURL(coverFile)
               const resData = json.data
-              this.form.coverFileId = resData.uploadId
+              this.videoPostForm.coverFileId = resData.uploadId
             } else {
               this.$notify({
                 title: '提示',
@@ -407,7 +417,7 @@ export default {
       if (res.code === 0) {
         const resData = res.data
         this.coverUrl = URL.createObjectURL(file.raw)
-        this.form.coverFileId = resData.uploadId
+        this.videoPostForm.coverFileId = resData.uploadId
       } else {
         this.$notify({
           title: '提示',
@@ -430,10 +440,10 @@ export default {
     // ****************************************************************************************************************
     setTitle(title) {
       if (title.length > 50) {
-        this.form.title = title.substring(0, 50)
-        this.form.description = title
+        this.videoPostForm.title = title.substring(0, 50)
+        this.videoPostForm.description = title
       } else {
-        this.form.title = title
+        this.videoPostForm.title = title
       }
     },
     getVideoCategory() {
@@ -477,7 +487,7 @@ export default {
       }
     },
     onSubmit() {
-      if (!this.form.videoFileId) {
+      if (!this.videoPostForm.videoId) {
         this.$notify({
           title: '提示',
           message: '你还没有上传视频',
@@ -488,7 +498,7 @@ export default {
         return
       }
 
-      if (!this.form.coverFileId) {
+      if (!this.videoPostForm.coverFileId) {
         this.$notify({
           title: '提示',
           message: '你还没有上传视频封面',
@@ -499,7 +509,7 @@ export default {
         return
       }
 
-      if (this.form.title === '' || this.form.categoryId === -1) {
+      if (this.videoPostForm.title === '' || this.videoPostForm.categoryId === -1) {
         this.$notify({
           title: '提示',
           message: '分区和稿件标题不能为空',
@@ -510,7 +520,7 @@ export default {
         return
       }
 
-      if (this.form.tags.length === 0 || this.form.tags.length > 10) {
+      if (this.videoPostForm.tags.length === 0 || this.videoPostForm.tags.length > 10) {
         this.$notify({
           title: '提示',
           message: '标签最少 1 个, 最多 10 个',
@@ -522,7 +532,7 @@ export default {
       }
 
       if (this.scheduledPubDate !== null) {
-        this.form.scheduledTime = Date.parse(this.scheduledPubDate)
+        this.videoPostForm.scheduledTime = Date.parse(this.scheduledPubDate)
         /* this.$notify({
           title: '提示',
           message: '定时发布的时间必须在当前时间之后',
@@ -530,7 +540,7 @@ export default {
           duration: 3000
         })*/
       }
-      this.$emit('video-publish', this.form)
+      this.$emit('video-publish', this.videoPostForm)
     }
   }
 }

+ 0 - 1
src/views/user/AdminUserList.vue

@@ -125,7 +125,6 @@
       />
     </el-main>
 
-    <!-- 修改视频可见范围对话框 -->
     <el-dialog
       append-to-body
       :visible.sync="showEditScopeDialog"