调整实训行为记录
This commit is contained in:
parent
5d413dba8c
commit
33a8eba1c7
@ -111,6 +111,7 @@ export default {
|
||||
break;
|
||||
}
|
||||
data = data.parent;
|
||||
if (!data) { break; }
|
||||
}
|
||||
if ( obj.type === 'Map') {
|
||||
this.mapId = obj.id;
|
||||
@ -181,6 +182,8 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
const checkId = localStore.get('trainingPlatformCheckId' + filterSelect + this.userId + this.project) || null;
|
||||
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
|
||||
checkId && this.findTree(this.treeList, checkId);
|
||||
!checkId && this.treeList && this.treeList.length && this.clickEvent(this.treeList[0], {data: this.treeList[0]});
|
||||
this.loading = false;
|
||||
});
|
||||
} catch (error) {
|
||||
@ -188,6 +191,19 @@ export default {
|
||||
this.$message.error(this.$t('error.refreshFailed'));
|
||||
}
|
||||
},
|
||||
/* 根据localstorage缓存的trainingPlatformCheckId跳转右侧显示页面 */
|
||||
findTree(treeList, checkId, data) {
|
||||
treeList && treeList.length && treeList.forEach(item =>{
|
||||
if (item.type === 'Map') {
|
||||
data = item;
|
||||
}
|
||||
if (checkId === item.key) {
|
||||
this.clickEvent(item, {data: data});
|
||||
} else {
|
||||
this.findTree(item.children, checkId, data);
|
||||
}
|
||||
});
|
||||
},
|
||||
nodeExpand(obj, node, ele) {
|
||||
const key = obj.id + obj.type;
|
||||
this.expandList = this.expandList.filter(item => item !== key);
|
||||
@ -200,6 +216,7 @@ export default {
|
||||
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList);
|
||||
},
|
||||
getExpandList(filterSelect) {
|
||||
this.expandList = [];
|
||||
let expand = localStore.get('trainIngPlatformExpandList' + filterSelect + this.userId + this.project);
|
||||
expand = expand ? (expand + '').split(',') : '';
|
||||
if (expand instanceof Array) {
|
||||
|
Loading…
Reference in New Issue
Block a user