Selaa lähdekoodia

口播视频审核功能迭代

lushixing 2 kuukautta sitten
vanhempi
commit
93c13ece39
3 muutettua tiedostoa jossa 82 lisäystä ja 11 poistoa
  1. 7 0
      src/api/video.js
  2. 3 2
      src/constants/index.js
  3. 72 9
      src/views/oral-video/index.vue

+ 7 - 0
src/api/video.js

@@ -38,3 +38,10 @@ export function addFashionShowVideo(data) {
     data
   })
 }
+export function editStatus(data) {
+  return request({
+    url: '/videoInfo/editStatus',
+    method: 'post',
+    data
+  })
+}

+ 3 - 2
src/constants/index.js

@@ -1,8 +1,9 @@
 // 审核状态
 export const auditStatus = [
   { value: 0, label: '待审核' },
-  { value: 1, label: '审核通过' },
-  { value: 2, label: '审核拒绝' }
+  { value: 1, label: '通过' },
+  { value: 2, label: '拒绝' },
+  { value: 3, label: '发布' }
 ];
 // 组织分类
 export const orgCategory = [

+ 72 - 9
src/views/oral-video/index.vue

@@ -12,6 +12,7 @@
             ></el-input>
           </el-form-item>
           <el-button type="primary" @click="handleFilter">搜索</el-button>
+          <el-button type="primary" @click="handleReview()">批量审核</el-button>
         </el-form>
       </div>
       <!-- <div class="filter-container-rt">
@@ -25,9 +26,13 @@
     </div>
 
     <div class="table-container">
-      <el-table  style="width: 100%" v-loading="listLoading" :key="tableKey" :data="list" row-key="id" stripe border fit
-        highlight-current-row>
-        <el-table-column label="序号" type="index" width="60" align="center" />
+      <el-table  style="width: 100%" v-loading="listLoading" :key="tableKey" :data="list" row-key="id" stripe border fit highlight-current-row @selection-change="handleSelectionChange">
+        <el-table-column
+          type="selection"
+          width="55"
+          align="center"
+        >
+        </el-table-column>
         <el-table-column label="视频ID" min-width="100" align="center" prop="id" />
 
         <el-table-column label="视频标题" min-width="150" align="center" prop="videoTitle" />
@@ -54,7 +59,7 @@
           <template slot-scope="scope">
             <span class="status-tag" :class="{
               'status-pending': scope.row.reviewStatus === 0,
-              'status-success': scope.row.reviewStatus === 1,
+              'status-success': scope.row.reviewStatus === 1 || scope.row.reviewStatus === 3,
               'status-error': scope.row.reviewStatus === 2
             }"></span>
             {{ getValueByKey(scope.row.reviewStatus, auditStatus) }}
@@ -63,7 +68,7 @@
 
         <el-table-column label="审核时间" min-width="100" align="center" prop="reviewTime" />
         <el-table-column label="审核人" min-width="100" align="center" prop="reviewer" />
-        <el-table-column label="发布状态" min-width="100" align="center" prop="publishStatus">
+        <!-- <el-table-column label="发布状态" min-width="100" align="center" prop="publishStatus">
           <template slot-scope="scope">
             <span class="status-tag" :class="{
               'status-pending': scope.row.publishStatus === 0,
@@ -72,7 +77,7 @@
             }"></span>
             {{ getValueByKey(scope.row.publishStatus, auditStatus) }}
           </template>
-        </el-table-column>
+        </el-table-column> -->
         <el-table-column label="发布时间" min-width="100" align="center" prop="publishTime" />
         <el-table-column label="发布人" min-width="100" align="center" prop="publisher" />
         <el-table-column label="关联话题" min-width="100" align="center" prop="hotWords" />
@@ -96,7 +101,7 @@
             {{ scope.row.downloadCount ? scope.row.downloadCount : '-' }}
           </template>
         </el-table-column>
-        <el-table-column label="操作" align="center" min-width="160"
+        <el-table-column label="操作" align="center" min-width="180"
           v-bind="device !== 'mobile' ? { fixed: 'right' } : {}">
           <template slot-scope="scope">
             <el-tooltip class="item" effect="dark" content="下载" placement="top">
@@ -108,6 +113,21 @@
             <el-tooltip class="item" effect="dark" content="播放" placement="top">
               <el-button type="success" size="mini" icon="el-icon-caret-right" circle @click="handlePlay(scope.row)" />
             </el-tooltip>
+            <el-tooltip
+              class="more"
+              effect="dark"
+              content="审核"
+              placement="top"
+              v-if="scope.row.reviewStatus == 0"
+            >
+              <el-button
+                type="primary"
+                size="mini"
+                icon="el-icon-s-claim"
+                circle
+                @click="handleReview(scope.row)"
+              />
+            </el-tooltip>
             <el-tooltip
               class="more"
               effect="dark"
@@ -122,7 +142,7 @@
                 @click="handleDelete(scope.row)"
               />
             </el-tooltip>
-            <el-tooltip class="more" style="margin: 10px 0 0 0;" effect="dark" content="更多操作" placement="top">
+            <el-tooltip class="more" style="margin: 10px 0 0 0;display: block;" effect="dark" content="更多操作" placement="top">
               <el-dropdown trigger="click" @command="command => handleAdvise(command, scope.row)">
                 <el-button size="mini" type="info" icon="el-icon-more" circle title="更多操作" />
                 <el-dropdown-menu class="dropdown-menu" slot="dropdown">
@@ -169,7 +189,7 @@ import changeTopic from "@/views/oral-video/component/changeTopic";
 import EditSuggestion from "@/components/Suggestion/editSuggestion";
 import SuggestionTable from "@/components/Suggestion/suggestionTable";
 
-import { fetchOralVideoList, deleteOralVideoList, addSuggestion } from "@/api/video";
+import { fetchOralVideoList, deleteOralVideoList, addSuggestion, editStatus } from "@/api/video";
 import downloadUtil from "@/utils/downloadUtil";
 import VideoPlayer from "@/components/VideoPlayer";
 import { mapGetters } from "vuex";
@@ -209,6 +229,7 @@ export default {
       currentVideoUrl: null,
       currentVideoTitle: null,
       currentVideo:{},
+      multipleSelection: []
     };
   },
   //页面创建的时候执行
@@ -217,6 +238,13 @@ export default {
   },
   methods: {
     getValueByKey,
+    /**
+     * 多选框操作
+     *@param val  {Array} 当前选中的内容
+     */
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
     getList() {
       this.listLoading = true;
       const params = {}
@@ -281,6 +309,41 @@ export default {
       this.currentVideoUrl = "";
       this.currentVideoTitle = "";
     },
+    handleReview(row) {
+      let ids = []
+      if (row) {
+        const { id } = row;
+        ids = [id]
+      } else {
+        if (this.multipleSelection.length) {
+          ids = this.multipleSelection.filter(acc => acc.reviewStatus === 0).map(acc => acc.id);
+        } else {
+          this.$message.error("至少选择一项未审核数据!");
+          return;
+        }
+      }
+      if (!ids.length) {
+        this.$message.error("至少选择一项未审核数据!");
+        return;
+      }
+      this.$confirm("确定要审核吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.listLoading = true;
+        editStatus({ids: ids}).then(() => {
+          this.listLoading = false;
+          this.getList();
+          this.$notify({
+            title: "成功",
+            message: "操作成功",
+            type: "success",
+            duration: 3000
+          });
+        });
+      });
+    },
     handleDelete(row) {
       //删除
       this.$confirm("是否删除该视频?", "提示", {