zyp vor 2 Wochen
Ursprung
Commit
488223f812
1 geänderte Dateien mit 37 neuen und 0 gelöschten Zeilen
  1. 37 0
      src/views/components/course/userCourseCatalogDetails.vue

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

@@ -288,6 +288,26 @@
             @keyup.enter.native="resourceList"
           />
         </el-form-item>
+        <el-form-item label="类型">
+          <el-select v-model="addBatchData.queryParams.typeId" @change="changeCateType" placeholder="请选择素材类型" clearable size="small">
+            <el-option
+              v-for="item in addBatchData.typeOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="子类型">
+          <el-select v-model="addBatchData.queryParams.typeSubId" placeholder="请选择素材子类型" clearable size="small">
+            <el-option
+              v-for="item in addBatchData.typeSubOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item>
           <el-button type="primary" icon="el-icon-search" size="mini" @click="resourceList">搜索</el-button>
         </el-form-item>
@@ -381,6 +401,7 @@ import VideoUpload from "@/components/VideoUpload/index.vue";
 import { listVideoResource } from '@/api/course/videoResource';
 import {getByIds} from "@/api/course/courseQuestionBank";
 import CourseWatchComment from "./courseWatchComment.vue";
+import { getCateListByPid, getCatePidList } from '@/api/course/userCourseCategory'
 
 export default {
     name: "userCourseCatalog",
@@ -851,11 +872,27 @@ export default {
       },
       openAdds(){
         this.addBatchData.open = true;
+        this.getRootTypeList();
         this.addBatchData.form = {
           courseId: this.courseId,
         };
         this.resourceList();
       },
+      getRootTypeList() {
+        getCatePidList().then(response => {
+          this.addBatchData.typeOptions = response.data
+        });
+      },
+      async changeCateType(val) {
+        this.addBatchData.queryParams.typeSubId = null
+        this.addBatchData.typeSubOptions = []
+        if (!val) {
+          return
+        }
+        await getCateListByPid(val).then(response => {
+          this.addBatchData.typeSubOptions = response.data
+        })
+      },
       resourceList(){
         this.addBatchData.loading = true;
         listVideoResource(this.addBatchData.queryParams).then(response => {