From e1204317b7d5e88268d19460162482c6234647c0 Mon Sep 17 00:00:00 2001 From: nisen Date: Fri, 27 Oct 2023 18:02:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E7=BC=93=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/course/ManageList.vue | 42 ++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/src/views/course/ManageList.vue b/src/views/course/ManageList.vue index 37f80101..542c5ef3 100644 --- a/src/views/course/ManageList.vue +++ b/src/views/course/ManageList.vue @@ -405,15 +405,51 @@ export default { this.getResOwnerTree().then(rs=>{ this.resOwnerListMap=rs; }); - this.getSysTypeTree().then(rs=>{ - this.sysTypeListMap=rs; - }) + // 取消全局课程分类 + // this.getSysTypeTree().then(rs=>{ + // this.sysTypeListMap=rs; + // }) + // 新增的获取内容分类 + this.getCourseList(); //已经加载tree的情况下,不需要再单独的加载一次 this.loadResOwners(); this.loadSysTypes(); }, methods: { + getCourseList(){ + // this.getSysTypeTree().then(rs => { + // this.sysTypeListMap = rs; + // console.log(rs,'您好啊好好'); + + // }); + apiType.tree(1).then(res=>{ + if(res.status === 200) { + sessionStorage.setItem('sysTypeTree',JSON.stringify(res.result)); + this.$store.commit('sysType/setSysTypeTree', res.result); + this.sysTypeListMap = res.result; + //转化为map放到状态中 + let map=new Map(); + res.result.forEach(item=>{ + map.set(item.id, item.name); + if(item.children && item.children!=''){ + item.children.forEach(child=>{ + map.set(child.id, child.name); + if(child.children && child.children!=''){ + child.children.forEach(last=>{ + map.set(last.id, last.name); + }) + } + }) + } + }); + this.$store.commit('sysType/setSysTypeMap', map); + } else { + // reject('资源归属获取失败!'); + } + }) + + }, showStudent(row){ //出现学员管理 window.parent.openSelectStu(row);