ソースを参照

课程管理-添加按钮批量修改小节名称

luolinsong 3 日 前
コミット
d675436aee

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

@@ -57,6 +57,13 @@ export function batchUpdateRed(data) {
     data: data
   })
 }
+export function batchUpdateTitle(data) {
+  return request({
+    url: '/course/userCourseVideo/batchUpdateTitle',
+    method: 'post',
+    data: data
+  })
+}
 
 // 修改课堂视频
 export function updateUserCourseVideo(data) {

+ 54 - 0
src/views/components/course/userCourseCatalogDetails.vue

@@ -37,6 +37,10 @@
                    v-hasPermi="['course:userCourseVideo:updateRed']">修改红包</el-button>
       </el-col>
       <el-col :span="1.5">
+  <el-button type="primary" plain size="mini" @click="updateTitleOpen"
+             v-hasPermi="['course:userCourseVideo:updateTitle']">修改小节名称</el-button>
+</el-col>
+      <el-col :span="1.5">
         <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
                    v-hasPermi="['course:userCourseVideo:remove']">删除</el-button>
       </el-col>
@@ -331,6 +335,27 @@
         <el-button type="primary" @click="batchRedSave">确 定</el-button>
       </div>
     </el-dialog>
+    <el-dialog title="修改小节名称" :visible.sync="titleData.open" width="900px" append-to-body>
+  <el-table border v-loading="titleData.loading" :data="titleData.list" height="600px">
+    <el-table-column label="视频文件名称" align="center" show-overflow-tooltip prop="fileName">
+    </el-table-column>
+    <el-table-column label="视频时长" align="center" prop="duration">
+      <template slot-scope="{ row }">
+        {{ formatDuration(row.duration) }}
+      </template>
+    </el-table-column>
+    <el-table-column label="小节名称" align="center" prop="title">
+      <template slot-scope="scope">
+        <el-input class="el-input" v-model="scope.row.title" />
+      </template>
+    </el-table-column>
+    <el-table-column label="排序" align="center" prop="courseSort" />
+    <el-table-column label="上传时间" align="center" prop="createTime" />
+  </el-table>
+  <div slot="footer" class="dialog-footer">
+    <el-button type="primary" @click="batchTitleSave">确 定</el-button>
+  </div>
+</el-dialog>
     <el-dialog :title="commentDialog.title" :visible.sync="commentDialog.open" width="1000px" append-to-body
                :close-on-click-modal="false">
       <course-watch-comment ref="courseWatchComment" :courseId="commentDialog.courseId" :videoId="commentDialog.videoId"
@@ -351,6 +376,7 @@ import {
   updates,
   batchSaveVideo,
   batchUpdateRed,
+  batchUpdateTitle,
   updateUserCourseVideo
 } from "@/api/course/userCourseVideo";
 import QuestionBank from "@/views/course/courseQuestionBank/QuestionBank.vue";
@@ -434,6 +460,18 @@ export default {
         form: {
         }
       },
+      titleData: {
+      queryParams: {
+        pageNum: 1,
+        pageSize: 99999,
+        courseId: null,
+      },
+      list: [],
+      open: false,
+      loading: true,
+      form: {
+      }
+    },
       queryParams: {
         pageNum: 1,
         pageSize: 10,
@@ -1103,6 +1141,22 @@ export default {
         this.redData.loading = false;
       });
     },
+    updateTitleOpen() {
+  this.titleData.open = true;
+  this.titleData.loading = true;
+  this.titleData.queryParams.courseId = this.courseId;
+
+  getVideoListByCourseId(this.titleData.queryParams).then(response => {
+    this.titleData.list = response.rows;
+    this.titleData.loading = false;
+  });
+},
+    batchTitleSave() {
+      batchUpdateTitle(this.titleData.list).then(response => {
+        this.titleData.open = false;
+        this.getList();
+      })
+    },
     batchRedSave() {
       batchUpdateRed(this.redData.list).then(response => {
         this.redData.open = false;