fix(接口测试): 修复模块树切换错误的缺陷

--bug=1025701 --user=王孝刚 【接口测试】场景列表和回收站切换-模块树切换错误
https://www.tapd.cn/55049933/s/1369029
This commit is contained in:
wxg0103 2023-05-05 20:19:11 +08:00 committed by fit2-zhao
parent 15ba756a7c
commit c952c69852
2 changed files with 10 additions and 12 deletions

View File

@ -312,10 +312,13 @@ export default {
addTab(tab) {
this.trashEnable = tab.name === 'trash';
if (tab.name === 'default') {
this.$refs.apiScenarioList.condition = {};
this.trashEnable = false;
this.$refs.nodeTree.list(this.projectId);
} else if (tab.name === 'trash') {
this.trashEnable = true;
this.$refs.apiTrashScenarioList.search();
this.$refs.nodeTree.list(this.projectId, tab.name);
this.$refs.nodeTree.list(this.projectId);
}
if (!this.projectId) {
this.$warning(this.$t('commons.check_project_tip'));
@ -619,7 +622,6 @@ export default {
if (targetName === 'trash') {
this.selectNodeIds = [];
this.trashEnable = false;
this.$refs.nodeTree.list(this.projectId);
} else {
let message = '';
this.tabs.forEach((tab) => {

View File

@ -156,17 +156,9 @@ export default {
'condition.filterText'() {
this.filter();
},
'condition.trashEnable'() {
this.param = {};
this.$emit('enableTrash', this.condition.trashEnable);
},
relevanceProjectId() {
this.list();
},
isTrashData() {
this.condition.trashEnable = this.isTrashData;
this.param = {};
},
},
created() {
this.$EventBus.$on('scenarioConditionBus', (param) => {
@ -195,12 +187,13 @@ export default {
filter() {
this.$refs.nodeTree.filter(this.condition.filterText);
},
list(projectId, targetName) {
list(projectId) {
if (this.isRelevanceModel) {
this.result = getModuleByRelevanceProjectId(this.relevanceProjectId).then((response) => {
this.setData(response);
});
} else if (this.isTrashData && targetName === 'trash') {
} else if (this.isTrashData) {
this.result = postModuleByTrash(projectId ? projectId : this.projectId, this.param).then((response) => {
this.setData(response);
});
@ -352,9 +345,12 @@ export default {
enableTrash() {
this.condition.trashEnable = true;
this.param.trashEnable = true;
this.param.name = '';
this.param.combine = {};
this.result = postModuleByTrash(this.projectId, this.param).then((response) => {
this.setData(response);
});
this.$emit('enableTrash', this.condition.trashEnable);
},
removeModuleId(nodeIds) {
if (localStorage.getItem('scenarioModule') && localStorage.getItem('scenarioModule') === nodeIds[0]) {