Parcourir la source

木易华康-批量上传视频自动选择分类题目

Long il y a 4 jours
Parent
commit
91c8ebd3a3
2 fichiers modifiés avec 28 ajouts et 3 suppressions
  1. 4 0
      .env.prod-myhk
  2. 24 3
      src/views/course/videoResource/index.vue

+ 4 - 0
.env.prod-myhk

@@ -26,6 +26,10 @@ VUE_APP_COS_REGION = ap-chongqing
 VUE_APP_VIDEO_LINE_1 = https://myhktcpv.ylrzcloud.com
 # 线路二地址
 VUE_APP_VIDEO_LINE_2 = https://myhkobs.ylrztop.com
+#火山云视频地址域名
+VUE_APP_VIDEO_URL = https://myhkvolcengine.ylrztop.com
+#火山云视频点播空间名
+VUE_APP_HSY_SPACE = myhk-2114522511
 
 # 开发环境配置
 ENV = 'production'

+ 24 - 3
src/views/course/videoResource/index.vue

@@ -550,7 +550,7 @@
           </el-form-item>
 
           <el-form-item label="子分类" prop="typeSubId" :rules="[{ required: true, message: '请选择子分类', trigger: 'blur' }]">
-            <el-select v-model="batchUploadForm.typeSubId" clearable placeholder="请选择子分类" style="width: 100%">
+            <el-select v-model="batchUploadForm.typeSubId" clearable placeholder="请选择子分类" style="width: 100%" @change="changeSubType">
               <el-option
                 v-for="item in subTypeList"
                 :key="item.dictValue"
@@ -560,7 +560,7 @@
             </el-select>
           </el-form-item>
 
-          <el-form-item label="关联题目" prop="projectIds" style="display: none">
+          <el-form-item label="关联题目" prop="projectIds" v-show="currentProject === 'myhk'">
             <el-select
               ref="customSelect"
               class="custom-select-class"
@@ -1168,6 +1168,9 @@ export default {
       }
       if (type === 3) {
         this.batchUploadForm.typeSubId = null
+        if (this.currentProject === 'myhk') {
+          this.batchUploadForm.projectIds = []
+        }
       }
       this.subTypeList = []
       if (!val) {
@@ -1177,6 +1180,25 @@ export default {
         this.subTypeList = response.data
       })
     },
+    changeSubType(val) {
+      if (this.currentProject !== 'myhk') {
+        return
+      }
+      this.projectShowList = []
+      this.batchUploadForm.projectIds = []
+      listCourseQuestionBank({questionSubType: val}).then(async response => {
+        const projectIds = response.rows.map(item => item.id)
+
+        // 如果存在关联项目,获取项目详情用于回显
+        if (projectIds && projectIds.length > 0) {
+          // 加载项目列表信息用于回显
+          await getByIds({ids: projectIds.join(',')}).then(reponse => {
+            this.projectShowList = reponse.data
+            this.batchUploadForm.projectIds = projectIds
+          });
+        }
+      })
+    },
     /** 预览视频 */
     handleVideoPreview(url) {
       this.videoPreviewVisible = true;
@@ -1732,7 +1754,6 @@ export default {
       if (this.currentProject === 'myhk') {
         this.batchUploadForm = {
           ...this.batchUploadForm,
-          projectIds: [],
           files: []
         };
       } else {