fix: 修复add-endpoint时project或module不选中问题

This commit is contained in:
陈劲松
2020-04-27 20:10:56 +08:00
parent 0db0160ba9
commit e596dfbcce
2 changed files with 5 additions and 8 deletions

View File

@@ -404,11 +404,8 @@
this.$get('project', {pageSize: -1, pageNo: 1}).then(response => { this.$get('project', {pageSize: -1, pageNo: 1}).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.projectList = response.data.list; this.projectList = response.data.list;
if (this.moduleList.length == 0) {
this.getModuleList(this.currentProject.id); this.getModuleList(this.currentProject.id);
} }
}
}); });
}, },
@@ -520,6 +517,7 @@
} }
} }
this.moduleList = response.data.list; this.moduleList = response.data.list;
console.info(this.moduleList)
} }
}); });
}, },
@@ -626,7 +624,7 @@
}, },
currentProject(n, o) { currentProject(n, o) {
this.endpointForm.projectId = n.id; this.endpointForm.projectId = n.id;
if(this.rightBox.show){ if(n.id != o.id){
this.getModuleList(n.id); this.getModuleList(n.id);
} }
}, },

View File

@@ -457,7 +457,6 @@
// } // }
}, },
detailProjectInfo:function(event,project){ detailProjectInfo:function(event,project){
console.log(event)
if(event){ if(event){
this.pageType='project' this.pageType='project'
if(project){ if(project){
@@ -468,6 +467,7 @@
// this.$refs.projectLeft.setActiveNames([]); // this.$refs.projectLeft.setActiveNames([]);
}else{ }else{
console.info(this.currentProject)
this.currentProjectTitle=this.currentProject.name+"-"+this.currentProject.id this.currentProjectTitle=this.currentProject.name+"-"+this.currentProject.id
} }
}, },
@@ -497,7 +497,6 @@
//左侧module列表选中切换 //左侧module列表选中切换
changeModule(module) { changeModule(module) {
this.currentModule = module; this.currentModule = module;
this.currentProject={};
this.endpointSearchLabel = {moduleId: ''}; this.endpointSearchLabel = {moduleId: ''};
this.$refs.projectSearch.clearSearch(); this.$refs.projectSearch.clearSearch();
this.showSubList = false; this.showSubList = false;
@@ -748,7 +747,7 @@
if (pageSize) { if (pageSize) {
this.endpointPageObj.pageSize = pageSize this.endpointPageObj.pageSize = pageSize
} }
this.detailProjectInfo(); //this.detailProjectInfo();
// setTimeout(()=>{ // setTimeout(()=>{
// this.getEndpointTableData(); // this.getEndpointTableData();
// }, 200); // }, 200);