mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-12 12:26:44 +08:00
修改课程分类缓存的问题
This commit is contained in:
@@ -405,15 +405,51 @@ export default {
|
|||||||
this.getResOwnerTree().then(rs=>{
|
this.getResOwnerTree().then(rs=>{
|
||||||
this.resOwnerListMap=rs;
|
this.resOwnerListMap=rs;
|
||||||
});
|
});
|
||||||
this.getSysTypeTree().then(rs=>{
|
// 取消全局课程分类
|
||||||
this.sysTypeListMap=rs;
|
// this.getSysTypeTree().then(rs=>{
|
||||||
})
|
// this.sysTypeListMap=rs;
|
||||||
|
// })
|
||||||
|
// 新增的获取内容分类
|
||||||
|
this.getCourseList();
|
||||||
//已经加载tree的情况下,不需要再单独的加载一次
|
//已经加载tree的情况下,不需要再单独的加载一次
|
||||||
this.loadResOwners();
|
this.loadResOwners();
|
||||||
this.loadSysTypes();
|
this.loadSysTypes();
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
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){
|
showStudent(row){
|
||||||
//出现学员管理
|
//出现学员管理
|
||||||
window.parent.openSelectStu(row);
|
window.parent.openSelectStu(row);
|
||||||
|
|||||||
Reference in New Issue
Block a user