fix: 功能用例导入后没刷新列表

--bug=1013043 --user=陈建星 【测试跟踪】导入用例后 全部用例没有直接显示,需要刷新才显示 https://www.tapd.cn/55049933/s/1165597
This commit is contained in:
chenjianxing 2022-05-26 19:26:41 +08:00 committed by jianxing
parent ed64629c08
commit 2379312ef3
2 changed files with 21 additions and 34 deletions

View File

@ -109,7 +109,7 @@
:project-id="projectId"
:condition="condition"
v-if="activeDom === 'right'"
@refresh="refreshTable"
@refresh="refreshAll"
ref="minder"/>
</ms-tab-button>
</el-tab-pane>
@ -123,7 +123,7 @@
<test-case-edit
:currentTestCaseInfo="item.testCaseInfo"
:version-enable="versionEnable"
@refresh="refreshTable"
@refresh="refreshAll"
@caseEdit="handleCaseCreateOrEdit($event,'edit')"
@caseCreate="handleCaseCreateOrEdit($event,'add')"
@checkout="checkout($event, item)"
@ -141,7 +141,7 @@
<test-case-edit-show
:currentTestCaseInfo="item.testCaseInfo"
:version-enable="versionEnable"
@refresh="refreshTable"
@refresh="refreshAll"
@caseEdit="handleCaseCreateOrEdit($event,'edit')"
@caseCreate="handleCaseCreateOrEdit($event,'add')"
:read-only="testCaseReadOnly"
@ -535,13 +535,6 @@ export default {
this.publicEnable = false;
this.activeName = "default";
},
refreshTable(data) {
if (this.$refs.testCaseList) {
this.$refs.testCaseList.initTableData();
}
this.$refs.nodeTree.list();
this.setTable(data);
},
increase(id) {
this.$refs.nodeTree.increase(id);
},
@ -615,9 +608,11 @@ export default {
this.testCaseReadOnly = true;
},
refresh(data) {
this.$store.commit('setTestCaseSelectNode', {});
this.$store.commit('setTestCaseSelectNodeIds', []);
this.refreshTable(data);
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
this.$store.commit('setTestCaseSelectNode', {});
this.$store.commit('setTestCaseSelectNodeIds', []);
}
this.refreshAll(data);
},
setTable(data) {
if (data) {
@ -630,24 +625,12 @@ export default {
}
}
},
refreshAll() {
this.$refs.nodeTree.list();
},
openRecentTestCaseEditDialog(caseId) {
if (caseId) {
// this.getProjectByCaseId(caseId);
this.$get('/test/case/get/' + caseId, response => {
if (response.data) {
/*
this.$refs.testCaseEditDialog.open(response.data);
*/
}
});
} else {
/*
this.$refs.testCaseEditDialog.open();
*/
refreshAll(data) {
if (this.$refs.testCaseList) {
this.$refs.testCaseList.initTableData();
}
this.$refs.nodeTree.list();
this.setTable(data);
},
setTreeNodes(data) {
this.treeNodes = data;

View File

@ -512,6 +512,9 @@ export default {
selectNodeIds() {
return this.$store.state.testCaseSelectNodeIds;
},
selectNode() {
return this.$store.state.testCaseSelectNode;
},
moduleOptions() {
return this.$store.state.testCaseModuleOptions;
},
@ -712,20 +715,21 @@ export default {
initTableData() {
this.condition.planId = "";
this.condition.nodeIds = [];
//initCondition(this.condition);
initCondition(this.condition, this.condition.selectAll);
this.condition.orders = getLastTableSortField(this.tableHeaderKey);
this.condition.versionId = this.currentVersion || null;
this.enableOrderDrag = this.condition.orders.length > 0 ? false : true;
if (this.planId) {
// param.planId = this.planId;
this.condition.planId = this.planId;
}
if (!this.trashEnable && !this.publicEnable) {
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
// param.nodeIds = this.selectNodeIds;
this.condition.nodeIds = this.selectNodeIds;
if (!this.selectNode || this.selectNode.data.id !== 'root') {
// root
this.condition.nodeIds = this.selectNodeIds;
}
}
}
this.getData();