fix(测试跟踪): 测试计划功能用例,选中模块,筛选后重置筛选,用例数显示错误

--bug=1032741 --user=陈建星 【测试跟踪】github#27478,最新版本:角色权限>>测试跟踪>>测试用例:不勾选【操作脑图】选项,当在测试跟踪>>功能测试,点击脑图查看测试用例时,报403。但是在升级前的版本(2.9版本之前的版本),用户权限都是一样的都没有【操作脑图】权限,大家都是可以用脑图的形式查看用例的 https://www.tapd.cn/55049933/s/1435196
This commit is contained in:
AgAngle 2023-11-10 17:51:27 +08:00 committed by 刘瑞斌
parent 2e55d11e80
commit 648988375a
3 changed files with 28 additions and 48 deletions

View File

@ -716,6 +716,18 @@ export default {
});
}
},
setCurrentKeyById(id) {
if (id) {
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(id);
let currentDate = this.$refs.tree.getCurrentNode();
if (currentDate) {
let currentNode = this.$refs.tree.getNode(currentDate);
this.handleNodeSelect(currentNode);
}
});
}
},
isDefault(data) {
return data.name === this.defaultLabel && data.level === 1;
},

View File

@ -461,14 +461,7 @@ export default {
},
planStatus: {
type: String
},
searchSelectNodeIds: {
type: Array
},
searchSelect: {
type: Boolean,
default: false
},
}
},
computed: {
editTestPlanTestCaseOrder() {
@ -670,14 +663,8 @@ export default {
this.status = 'all';
}
this.condition.nodeIds = [];
if (!this.searchSelect) {
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
this.condition.nodeIds = this.selectNodeIds;
}
} else {
if (this.searchSelectNodeIds && this.searchSelectNodeIds.length > 0) {
this.condition.nodeIds = this.searchSelectNodeIds;
}
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
this.condition.nodeIds = this.selectNodeIds;
}
this.condition.projectId = getCurrentProjectID();
if (this.planId) {
@ -762,7 +749,11 @@ export default {
search() {
this.currentPage = 1;
this.$emit('search');
this.initTableData();
if (!this.selectNodeIds || this.selectNodeIds.length < 1) {
//
//
this.initTableData();
}
},
buildPagePath(path) {
return path + "/" + this.currentPage + "/" + this.pageSize;

View File

@ -27,8 +27,6 @@
:plan-status="planStatus "
:clickType="clickType"
:select-node-ids="selectNodeIds"
:search-select-node-ids="searchSelectNodeIds"
:search-select.sync="searchSelect"
:version-enable="versionEnable"
@refresh="refresh"
@refreshTree="refreshTree"
@ -70,10 +68,11 @@ import TestPlanMinder from "@/business/common/minder/TestPlanMinder";
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
import TestPlanFunctionalRelevance from "@/business/plan/view/comonents/functional/TestPlanFunctionalRelevance";
import IsChangeConfirm from "metersphere-frontend/src/components/IsChangeConfirm";
import {openMinderConfirm, saveMinderConfirm} from "@/business/common/minder/minderUtils";
import {clearOtherTagAfterBatchTag, openMinderConfirm, saveMinderConfirm} from "@/business/common/minder/minderUtils";
import {getTestPlanCaseNodesByCaseFilter} from "@/api/testCase";
import {useStore} from "@/store";
import {testPlanTestCaseGet} from "@/api/remote/plan/test-plan-test-case";
import {setPriorityView} from "vue-minder-editor-plus/src/script/tool/utils";
export default {
name: "TestPlanFunctional",
@ -97,8 +96,6 @@ export default {
tmpActiveDom: null,
tmpPath: null,
currentNode: null,
searchSelectNodeIds: [],
searchSelect: false,
};
},
props: [
@ -147,7 +144,6 @@ export default {
},
clearSelectNode() {
this.selectNodeIds = [];
this.searchSelectNodeIds = [];
useStore().testPlanViewSelectNode = {};
},
initData() {
@ -163,7 +159,6 @@ export default {
this.selectNodeIds = nodeIds;
useStore().testPlanViewSelectNode = node;
this.currentNode = node;
this.searchSelect = false;
// node
if (this.$refs.testPlanTestCaseList) {
this.$refs.testPlanTestCaseList.currentPage = 1;
@ -187,33 +182,10 @@ export default {
this.loading = false;
this.treeNodes = r.data;
this.setCurrentKey();
this.$refs.testPlanTestCaseList.$nextTick(() => {
this.setSearchSelectNodeIds(r)
});
});
}
}
},
setSearchSelectNodeIds(treeNodes) {
this.searchSelectNodeIds = []
this.getChildNodeId(treeNodes.data[0], this.searchSelectNodeIds);
this.searchSelect = true;
},
getChildNodeId(rootNode, nodeIds) {
if (rootNode && this.currentNode) {
if (rootNode.id === this.currentNode.data.id) {
this.pushNode(rootNode, nodeIds);
} else {
if (rootNode.children) {
for (let i = 0; i < rootNode.children.length; i++) {
if (rootNode.children[i].id === this.currentNode.data.id) {
this.pushNode(rootNode.children[i], nodeIds)
}
}
}
}
}
},
pushNode(rootNode, nodeIds) {
//ID
nodeIds.push(rootNode.id);
@ -225,7 +197,12 @@ export default {
},
setCurrentKey() {
if (this.$refs.nodeTree) {
this.$refs.nodeTree.setCurrentKey(this.currentNode);
this.$refs.nodeTree.$nextTick(() => {
if (this.currentNode) {
// idnode使node
this.$refs.nodeTree.setCurrentKeyById(this.currentNode.data.id);
}
});
}
},
setCondition(data) {