瀏覽代碼

新增视频删除重置操作

zhangjie 2 年之前
父節點
當前提交
351044afc6
共有 2 個文件被更改,包括 39 次插入7 次删除
  1. 7 0
      src/api/system.js
  2. 32 7
      src/features/system/VideoSaveManagement/VideoSaveManagement.vue

+ 7 - 0
src/api/system.js

@@ -60,3 +60,10 @@ export function deleteInvigilationVideo(examId) {
     { params: { examId } }
   );
 }
+export function resetInvigilationVideoStatus(examId) {
+  return httpApp.post(
+    "/api/admin/sys/video/status/reset",
+    {},
+    { params: { examId } }
+  );
+}

+ 32 - 7
src/features/system/VideoSaveManagement/VideoSaveManagement.vue

@@ -46,16 +46,18 @@
       <el-table-column width="120" label="存储时长">
         <span slot-scope="scope">{{ scope.row.saveTime }}天</span>
       </el-table-column>
-      <el-table-column width="100" label="状态">
+      <el-table-column width="70" label="状态">
         <span slot-scope="scope">{{
           scope.row.videoDelete ? "已删除" : "有效"
         }}</span>
       </el-table-column>
-      <el-table-column label="操作" width="160" fixed="right">
+      <el-table-column width="160" label="删除时间">
+        <span slot-scope="scope" v-if="scope.row.videoDelete">{{
+          scope.row.videoDeleteTime | datetimeFilter
+        }}</span>
+      </el-table-column>
+      <el-table-column label="操作" width="140" fixed="right">
         <div slot-scope="scope">
-          <span v-if="scope.row.videoDelete">{{
-            scope.row.videoDeleteTime | datetimeFilter
-          }}</span>
           <el-button
             v-if="!scope.row.videoDelete && scope.row.saveTime > 0"
             size="mini"
@@ -65,6 +67,14 @@
           >
             删除
           </el-button>
+          <el-button
+            v-if="scope.row.videoDelete"
+            size="mini"
+            type="danger"
+            plain
+            @click="toReset(scope.row)"
+            >重置删除状态</el-button
+          >
         </div>
       </el-table-column>
     </el-table>
@@ -88,6 +98,7 @@
 import {
   searchInvigilationVideo,
   deleteInvigilationVideo,
+  resetInvigilationVideoStatus,
 } from "../../../api/system";
 
 export default {
@@ -139,8 +150,6 @@ export default {
         `确定要删除当前考试的所有视频吗?`,
         "操作提醒",
         {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
           iconClass: "el-icon-warning",
           customClass: "el-message-box__error",
         }
@@ -152,6 +161,22 @@ export default {
       this.$message.success("操作成功!");
       this.searchForm();
     },
+    async toReset(row) {
+      const result = await this.$confirm(
+        `确定要重置当前考试的所有视频的删除状态吗?`,
+        "操作提醒",
+        {
+          iconClass: "el-icon-warning",
+          customClass: "el-message-box__error",
+        }
+      ).catch(() => {});
+
+      if (result !== "confirm") return;
+
+      await resetInvigilationVideoStatus(row.examId);
+      this.$message.success("操作成功!");
+      this.searchForm();
+    },
   },
 };
 </script>