实训平台 左侧地图列表 点击展开代码调整

This commit is contained in:
joylink_cuiweidong 2020-08-14 14:33:19 +08:00
parent c41ebdf9e1
commit e5d2c71232

View File

@ -155,7 +155,7 @@ export default {
}, },
forTree(item) { forTree(item) {
item.children && item.children.forEach(childrenItem => { item.children && item.children.forEach(childrenItem => {
childrenItem.key = childrenItem.id + childrenItem.type; childrenItem.key = item.id + childrenItem.id + childrenItem.type;
if (childrenItem.children && childrenItem.children.length) { if (childrenItem.children && childrenItem.children.length) {
this.forTree(childrenItem); this.forTree(childrenItem);
} }
@ -207,13 +207,13 @@ export default {
}); });
}, },
nodeExpand(obj, node, ele) { nodeExpand(obj, node, ele) {
const key = obj.id + obj.type; const key = obj.key;
this.expandList = this.expandList.filter(item => item !== key); this.expandList = this.expandList.filter(item => item !== key);
this.expandList.push(key); this.expandList.push(key);
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList); localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList);
}, },
nodeCollapse(obj, node, ele) { nodeCollapse(obj, node, ele) {
const key = obj.id + obj.type; const key = obj.key;
this.expandList = this.expandList.filter(item => item !== key); this.expandList = this.expandList.filter(item => item !== key);
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList); localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList);
}, },