Quellcode durchsuchen

新增艺校-课程资源-网络资源单元需求
联动修改了个人中心等一系列的修改

Mr_pet vor 1 Jahr
Ursprung
Commit
9babaf056d

+ 1 - 0
src/pages/courseResourcesChapter.vue

@@ -117,6 +117,7 @@ import { user } from "@/store/user.js";
     },
     initSourceData() {
       this.kkID = this.$route.query.id;
+      this.searchKey = this.$route.query.filterText;
       let transObj = {
         token:user?.token,
         kk_id: this.kkID,

+ 30 - 19
src/pages/courseResourcesChapterList.vue

@@ -21,18 +21,10 @@
     <div class="common1280 chapterAll">
       <h4>课程章节</h4>
       <div class="unitAll">
-        <!-- <div class="unitPart" v-for="(item,index) in 2" :key="index">
-          <div class="UnitTitle">01单元</div>
-          <div class="UnitChapter">
-            <div class="singleUnitChapter">章节一</div>
-            <div class="singleUnitChapter">章节二</div>
-            <div class="singleUnitChapter">章节三</div>
-          </div>
-        </div> -->
-        <el-collapse class="unitAll" v-model="activeNames" @change="handleChange" accordion >
-          <el-collapse-item title="单元1" :name="index" v-for="(item,index) in 4" :key="index" @click="handleUnit(item)">
+        <el-collapse class="unitAll" v-model="activeNames"  accordion >
+          <el-collapse-item :title="item.name" :name="index" v-for="(item,index) in unitNames" :key="index" @click="handleUnit(item,index)">
             <div class="UnitChapter">
-            <div class="singleUnitChapter" v-for="(item,index) in 3" :key="index">章节{{ index }}</div>
+            <div class="singleUnitChapter" v-for="(item,secindex) in unitChapters[index]" :key="secindex" @click="toDetail(item)">{{ item.kf_name }}</div>
           </div>
           </el-collapse-item>
         
@@ -73,13 +65,16 @@ import { user } from "@/store/user.js";
       sourceListData: [],
       kkID:'',
       searchKey: '',
-      activeNames: ['1']
+      activeNames: ['1'],
+      unitNames: [],
+      unitChapters: [] // 用数组存储数据
 
     }
   },
   mounted() {
     this.initDetail();
     this.initSourceData();
+    this.initUnitDetail();
   },
   methods: {
     /**初始化详情数据*/
@@ -119,7 +114,7 @@ import { user } from "@/store/user.js";
     },
     initUnitDetail() {
       let transObj = {
-        kk_id:kkId,
+        kk_id:this.$route.query.id,
       }
       attribDetail(transObj)
         .then(res => {
@@ -151,13 +146,29 @@ import { user } from "@/store/user.js";
     searchBtn() {
       this.initSourceData();
     },
-    /**单元手风琴*/
-    handleChange(val) {
-      console.log(val);
-    },
     /**单元点击*/
-    handleUnit(item) {
-      console.log('item',item);
+    handleUnit(item,chapterIndex) {
+      this.kkID = this.$route.query.id;
+      let transObj = {
+        token:user?.token,
+        kk_id: this.kkID,
+        ka_attrib_level_1:item.id,
+      }
+      courseSourceList(transObj)
+        .then(res => {
+          if (res.code == "1") {
+            this.unitChapters[chapterIndex] = res.data.page_data;
+            // 触发响应式更新
+            this.$forceUpdate();
+          }
+        })
+        .catch(error => {
+          console.log(error)
+        });
+
+    },
+    toDetail(allItem) {
+      this.$router.push({ path: '/resourceChapter', query: { id: this.$route.query.id , filterText: allItem.kf_name } });
     },
 
   },

+ 23 - 1
src/pages/personal/components/MyCourse/kczy-zycreate.vue

@@ -80,6 +80,11 @@
               <el-option v-for="item in workData" :key="item.yzk_id" :label="item.yzk_name" :value="item.yzk_id" />
             </el-select>
           </el-form-item>
+          <el-form-item label="关联单元分类">
+            <el-select v-model="formline.ka_attrib_level_1" placeholder=" " size="large">
+              <el-option v-for="item in ClassificationData" :key="item.ka_id" :label="item. ka_name" :value="item.ka_id" />
+            </el-select>
+          </el-form-item>
           <el-form-item v-if="editId == ''">
             <el-checkbox class="read" v-model="isRead" label="已阅读并同意《课程上传协议》" size="large" />
           </el-form-item>
@@ -112,6 +117,7 @@ export default {
         kf_path: "",
         kf_name: "",
         yzk_id: "",
+        ka_attrib_level_1:"",//所属分类
       },
       rules: {
         kf_path: [{ required: true, message: '请上传源文件', trigger: 'submit' }],
@@ -131,6 +137,8 @@ export default {
       attachLoading: false,
       commitLoading: false,
       upload_loading: false,
+      ClassificationData: [],
+      
     }
   },
   components: { Picture, FolderOpened, MultiFileUpload },
@@ -264,6 +272,20 @@ export default {
         }
       })
     },
+    /**初始化分类*/
+    initClassification() {
+      let _this = this;
+      request({
+        url: '/kczy/attrib/details',
+        data: {
+          kk_id: this.$route.query.parentId
+        }
+      }).then(res => {
+        if (res.code == 1) {
+          _this.ClassificationData = res.data.details;
+        }
+      })
+    },
     submitForm(formName) {
       if (this.upload_loading) {
         this.$message.info('源文件上传中!')
@@ -319,7 +341,7 @@ export default {
   },
   created() {
     this.initWorkData();
-
+    this.initClassification();
     this.parentId = this.$route.query.parentId;
     this.editId = this.$route.query.id || "";
     let zyData = localStorage.getItem("zyData");