refactor(测试跟踪): 功能用例批量编辑刷新后保留之前选择的模块

--bug=1014311 --user=陈建星 【测试跟踪】测试计划功能用例选中某一模块,批量更改用例属性后,未选中该模块 https://www.tapd.cn/55049933/s/1189515
This commit is contained in:
chenjianxing 2022-06-23 17:20:51 +08:00 committed by jianxing
parent 876716c35f
commit 2e4f6561b5
3 changed files with 19 additions and 14 deletions

View File

@ -990,8 +990,7 @@ export default {
},
refresh() {
this.$refs.table.clear();
this.condition.selectAll = false;
this.$emit('refresh');
this.$emit('refreshAll');
},
refreshAll() {
this.$refs.table.clear();

View File

@ -631,13 +631,9 @@ export default {
this.$refs.testPlanTestCaseEdit.openTestCaseEdit(row, this.tableData);
},
refresh() {
this.condition = {components: TEST_PLAN_TEST_CASE_CONFIGS};
this.$refs.table.clear();
this.$emit('refresh');
},
breadcrumbRefresh() {
this.showMyTestCase = false;
this.refresh();
this.search();
this.$emit('refreshTree');
},
refreshTableAndPlan() {
if (this.$refs.tableHeader) {
@ -683,8 +679,7 @@ export default {
if (action === 'confirm') {
let param = buildBatchParam(this, this.$refs.table.selectIds);
this.$post('/test/plan/case/batch/delete', param, () => {
this.$refs.table.clear();
this.$emit("refresh");
this.refresh();
this.$success(this.$t('test_track.cancel_relevance_success'));
});
}
@ -694,7 +689,7 @@ export default {
_handleDelete(testCase) {
let testCaseId = testCase.id;
this.result = this.$post('/test/plan/case/delete/' + testCaseId, {}, () => {
this.$emit("refresh");
this.refresh();
this.$success(this.$t('test_track.cancel_relevance_success'));
});
},
@ -738,11 +733,10 @@ export default {
}
param.ids = this.$refs.table.selectIds;
this.$post('/test/plan/case/batch/edit', param, () => {
this.$refs.table.clear();
this.status = '';
this.$post('/test/plan/edit/status/' + this.planId);
this.$success(this.$t('commons.save_success'));
this.$emit('refresh');
this.refresh();
});
},
handleBatchEdit() {

View File

@ -25,6 +25,7 @@
v-if="activeDom === 'left'"
@openTestCaseRelevanceDialog="openTestCaseRelevanceDialog"
@refresh="refresh"
@refreshTree="refreshTree"
@setCondition="setCondition"
:plan-id="planId"
:plan-status="planStatus "
@ -90,7 +91,8 @@ export default {
selectNode: {},
condition: {},
tmpActiveDom: null,
tmpPath: null
tmpPath: null,
currentNode: null
};
},
props: [
@ -128,6 +130,9 @@ export default {
this.$refs.testCaseRelevance.search();
this.getNodeTreeByPlanId();
},
refreshTree() {
this.getNodeTreeByPlanId();
},
clearSelectNode() {
this.selectNodeIds = [];
this.$store.commit('setTestPlanViewSelectNode', {});
@ -141,6 +146,7 @@ export default {
nodeChange(node, nodeIds, pNodes) {
this.selectNodeIds = nodeIds;
this.$store.commit('setTestPlanViewSelectNode', node);
this.currentNode = node;
// node
if (this.$refs.testPlanTestCaseList) {
this.$refs.testPlanTestCaseList.currentPage = 1;
@ -155,9 +161,15 @@ export default {
}
this.result = this.$get(url, response => {
this.treeNodes = response.data;
this.setCurrentKey();
});
}
},
setCurrentKey() {
if (this.$refs.nodeTree) {
this.$refs.nodeTree.setCurrentKey(this.currentNode);
}
},
setCondition(data) {
this.condition = data;
},