Procházet zdrojové kódy

木易华康-课程小节批量下架

Long před 22 hodinami
rodič
revize
041165c5e4

+ 8 - 0
src/api/course/userCourseVideo.js

@@ -136,4 +136,12 @@ export function getChooseCourseVideoList(query) {
   })
 }
 
+// 下架课堂视频
+export function batchDownUserCourseVideo(videoId) {
+  return request({
+    url: '/course/userCourseVideo/batchDown/' + videoId,
+    method: 'post'
+  })
+}
+
 

+ 21 - 1
src/views/components/course/userCourseCatalogDetails.vue

@@ -49,6 +49,11 @@
                    v-hasPermi="['course:userCourseVideo:sync']">同步模板数据
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" plain icon="el-icon-edit" size="mini" :disabled="multiple" @click="handleDown"
+                   v-hasPermi="['course:userCourseVideo:batchDown']">批量下架
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-table border v-loading="loading" :data="userCourseVideoList" @selection-change="handleSelectionChange">
@@ -483,7 +488,7 @@ import {
   sortCourseVideo,
   updates,
   updateUserCourseVideo,
-  syncTemplate
+  syncTemplate, batchDownUserCourseVideo
 } from '@/api/course/userCourseVideo'
 // import {syncTemplate} from '@/api/course/userCourse'
 import QuestionBank from "@/views/course/courseQuestionBank/QuestionBank.vue";
@@ -1295,6 +1300,21 @@ export default {
         }
       });
     },
+    /** 下架 **/
+    handleDown() {
+      const videoIds = this.ids;
+      this.$confirm('是否确认下架视频编号为"' + videoIds + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return batchDownUserCourseVideo(videoIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("下架成功");
+      }).catch(() => {
+      });
+    },
 
   }
 }