Browse Source

Merge branch 'bjcz_his_scrm' of http://1.14.104.71:10880/root/ylrz_his_scrm_adminUI into bjcz_his_scrm

xw 1 day ago
parent
commit
81e903ca2d

+ 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) {

+ 63 - 1
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>
@@ -225,6 +229,9 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <el-dialog :title="questionBank.title" :visible.sync="questionBank.open" width="1000px" append-to-body @close="handleQuestionBankClose">
+      <question-bank ref="questionBank" @questionBankResult="questionBankResult" @close="handleQuestionBankClose"></question-bank>
+    </el-dialog>
     <el-dialog :title="title" :visible.sync="updateBatchData.open" width="1000px" append-to-body>
       <el-form ref="form" :model="updateBatchData.form" label-width="110px">
         <el-form-item label="看课时间" prop="timeRange">
@@ -328,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"
@@ -348,6 +376,7 @@ import {
   updates,
   batchSaveVideo,
   batchUpdateRed,
+  batchUpdateTitle,
   updateUserCourseVideo
 } from "@/api/course/userCourseVideo";
 import QuestionBank from "@/views/course/courseQuestionBank/QuestionBank.vue";
@@ -431,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,
@@ -575,7 +616,6 @@ export default {
 
     //选择结果
     questionBankResult(val) {
-
       // 确保 questionBankList 是数组
       this.form.questionBankList = this.form.questionBankList || [];
 
@@ -590,6 +630,9 @@ export default {
         message: '添加成功',
         type: 'success'
       });
+
+      // 选择题目后关闭课题选择对话框
+      this.questionBank.open = false;
     },
 
     //删除课题
@@ -1098,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;
@@ -1111,6 +1170,9 @@ export default {
       this.commentDialog.title = `查看评论 - ${row.title}`;
       this.commentDialog.open = true;
     },
+    handleQuestionBankClose() {
+      this.questionBank.open = false;
+    },
   }
 }
 </script>

+ 2 - 0
src/views/course/courseQuestionBank/QuestionBank.vue

@@ -308,6 +308,8 @@ export default {
     //选择此课
     chooseQuestion(val){
       this.$emit('questionBankResult',val)
+      // 关闭当前页面/弹窗
+      this.$emit('close')
     },
     //题目类型发生变化
     changeType(){

+ 13 - 2
src/views/course/userCoursePeriod/index.vue

@@ -2101,8 +2101,19 @@ export default {
 
     /** 初始化当前训练营期数列表 */
     initCurrentCampPeriods() {
-      this.currentCampPeriods = [...(this.periodList || [])];
-    },
+  // 对当前营期列表按照创建时间倒序排序(最新的在前面)
+  this.currentCampPeriods = [...(this.periodList || [])].sort((a, b) => {
+    // 如果没有创建时间,按原始顺序
+    if (!a.createTime || !b.createTime) return 0;
+
+    // 将时间字符串转换为时间戳进行比较
+    const timeA = new Date(a.createTime).getTime();
+    const timeB = new Date(b.createTime).getTime();
+
+    // 按创建时间倒序排列(最新的在前面)
+    return timeB - timeA;
+  });
+},
 
     /** 处理创建方式变更 */
     async handlePeriodTypeChange(value) {

+ 19 - 1
src/views/course/videoResource/index.vue

@@ -401,7 +401,7 @@
             {{ scope.$index + 1 }}
           </template>
         </el-table-column>
-        <el-table-column label="素材名称" align="center" prop="resourceName" min-width="120" />
+        <el-table-column label="素材名称" align="center" prop="resourceName" min-width="120" sortable :sort-method="sortByNumberAfterDi"/>
         <el-table-column label="文件名称" align="center" prop="fileName" min-width="120" />
         <el-table-column label="分类" align="center" min-width="100">
           <template slot-scope="scope">
@@ -960,6 +960,24 @@ export default {
     this.getList();
   },
   methods: {
+     sortByPureNumbers(a, b) {
+  const extractFirstNumber = (str) => {
+    if (!str) return 999999;
+    // 使用更具体的匹配
+    const match = str.match(/(\d+)/);
+    if (match) {
+      const fullNumber = match[1];
+      console.log('提取完整数字:', fullNumber);
+      return parseInt(fullNumber, 10);
+    }
+    return 999999;
+  };
+
+  const numA = extractFirstNumber(a.resourceName);
+  const numB = extractFirstNumber(b.resourceName);
+
+  return numA - numB;
+},
     /** 将数字索引转换为字母序号 (0->A, 1->B, 等) */
     convertToLetter(index) {
       // 确保索引是数字