fix(测试跟踪): 测试计划功能用例,选中模块,筛选后重置筛选,用例数显示错误
--bug=1032741 --user=陈建星 【测试跟踪】github#27478,最新版本:角色权限>>测试跟踪>>测试用例:不勾选【操作脑图】选项,当在测试跟踪>>功能测试,点击脑图查看测试用例时,报403。但是在升级前的版本(2.9版本之前的版本),用户权限都是一样的都没有【操作脑图】权限,大家都是可以用脑图的形式查看用例的 https://www.tapd.cn/55049933/s/1435196
This commit is contained in:
parent
2e55d11e80
commit
648988375a
|
@ -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) {
|
isDefault(data) {
|
||||||
return data.name === this.defaultLabel && data.level === 1;
|
return data.name === this.defaultLabel && data.level === 1;
|
||||||
},
|
},
|
||||||
|
|
|
@ -461,14 +461,7 @@ export default {
|
||||||
},
|
},
|
||||||
planStatus: {
|
planStatus: {
|
||||||
type: String
|
type: String
|
||||||
},
|
}
|
||||||
searchSelectNodeIds: {
|
|
||||||
type: Array
|
|
||||||
},
|
|
||||||
searchSelect: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
editTestPlanTestCaseOrder() {
|
editTestPlanTestCaseOrder() {
|
||||||
|
@ -670,14 +663,8 @@ export default {
|
||||||
this.status = 'all';
|
this.status = 'all';
|
||||||
}
|
}
|
||||||
this.condition.nodeIds = [];
|
this.condition.nodeIds = [];
|
||||||
if (!this.searchSelect) {
|
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
|
||||||
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
|
this.condition.nodeIds = this.selectNodeIds;
|
||||||
this.condition.nodeIds = this.selectNodeIds;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this.searchSelectNodeIds && this.searchSelectNodeIds.length > 0) {
|
|
||||||
this.condition.nodeIds = this.searchSelectNodeIds;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.condition.projectId = getCurrentProjectID();
|
this.condition.projectId = getCurrentProjectID();
|
||||||
if (this.planId) {
|
if (this.planId) {
|
||||||
|
@ -762,7 +749,11 @@ export default {
|
||||||
search() {
|
search() {
|
||||||
this.currentPage = 1;
|
this.currentPage = 1;
|
||||||
this.$emit('search');
|
this.$emit('search');
|
||||||
this.initTableData();
|
if (!this.selectNodeIds || this.selectNodeIds.length < 1) {
|
||||||
|
// 如果没有选中节点,则刷新列表
|
||||||
|
// 如果选中了节点,刷新模块时,会触发列表刷新,这里就不刷新了
|
||||||
|
this.initTableData();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
buildPagePath(path) {
|
buildPagePath(path) {
|
||||||
return path + "/" + this.currentPage + "/" + this.pageSize;
|
return path + "/" + this.currentPage + "/" + this.pageSize;
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
:plan-status="planStatus "
|
:plan-status="planStatus "
|
||||||
:clickType="clickType"
|
:clickType="clickType"
|
||||||
:select-node-ids="selectNodeIds"
|
:select-node-ids="selectNodeIds"
|
||||||
:search-select-node-ids="searchSelectNodeIds"
|
|
||||||
:search-select.sync="searchSelect"
|
|
||||||
:version-enable="versionEnable"
|
:version-enable="versionEnable"
|
||||||
@refresh="refresh"
|
@refresh="refresh"
|
||||||
@refreshTree="refreshTree"
|
@refreshTree="refreshTree"
|
||||||
|
@ -70,10 +68,11 @@ import TestPlanMinder from "@/business/common/minder/TestPlanMinder";
|
||||||
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
|
import {getCurrentProjectID} from "metersphere-frontend/src/utils/token";
|
||||||
import TestPlanFunctionalRelevance from "@/business/plan/view/comonents/functional/TestPlanFunctionalRelevance";
|
import TestPlanFunctionalRelevance from "@/business/plan/view/comonents/functional/TestPlanFunctionalRelevance";
|
||||||
import IsChangeConfirm from "metersphere-frontend/src/components/IsChangeConfirm";
|
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 {getTestPlanCaseNodesByCaseFilter} from "@/api/testCase";
|
||||||
import {useStore} from "@/store";
|
import {useStore} from "@/store";
|
||||||
import {testPlanTestCaseGet} from "@/api/remote/plan/test-plan-test-case";
|
import {testPlanTestCaseGet} from "@/api/remote/plan/test-plan-test-case";
|
||||||
|
import {setPriorityView} from "vue-minder-editor-plus/src/script/tool/utils";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TestPlanFunctional",
|
name: "TestPlanFunctional",
|
||||||
|
@ -97,8 +96,6 @@ export default {
|
||||||
tmpActiveDom: null,
|
tmpActiveDom: null,
|
||||||
tmpPath: null,
|
tmpPath: null,
|
||||||
currentNode: null,
|
currentNode: null,
|
||||||
searchSelectNodeIds: [],
|
|
||||||
searchSelect: false,
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
|
@ -147,7 +144,6 @@ export default {
|
||||||
},
|
},
|
||||||
clearSelectNode() {
|
clearSelectNode() {
|
||||||
this.selectNodeIds = [];
|
this.selectNodeIds = [];
|
||||||
this.searchSelectNodeIds = [];
|
|
||||||
useStore().testPlanViewSelectNode = {};
|
useStore().testPlanViewSelectNode = {};
|
||||||
},
|
},
|
||||||
initData() {
|
initData() {
|
||||||
|
@ -163,7 +159,6 @@ export default {
|
||||||
this.selectNodeIds = nodeIds;
|
this.selectNodeIds = nodeIds;
|
||||||
useStore().testPlanViewSelectNode = node;
|
useStore().testPlanViewSelectNode = node;
|
||||||
this.currentNode = node;
|
this.currentNode = node;
|
||||||
this.searchSelect = false;
|
|
||||||
// 切换node后,重置分页数
|
// 切换node后,重置分页数
|
||||||
if (this.$refs.testPlanTestCaseList) {
|
if (this.$refs.testPlanTestCaseList) {
|
||||||
this.$refs.testPlanTestCaseList.currentPage = 1;
|
this.$refs.testPlanTestCaseList.currentPage = 1;
|
||||||
|
@ -187,33 +182,10 @@ export default {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.treeNodes = r.data;
|
this.treeNodes = r.data;
|
||||||
this.setCurrentKey();
|
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) {
|
pushNode(rootNode, nodeIds) {
|
||||||
//递归获取所有子节点ID
|
//递归获取所有子节点ID
|
||||||
nodeIds.push(rootNode.id);
|
nodeIds.push(rootNode.id);
|
||||||
|
@ -225,7 +197,12 @@ export default {
|
||||||
},
|
},
|
||||||
setCurrentKey() {
|
setCurrentKey() {
|
||||||
if (this.$refs.nodeTree) {
|
if (this.$refs.nodeTree) {
|
||||||
this.$refs.nodeTree.setCurrentKey(this.currentNode);
|
this.$refs.nodeTree.$nextTick(() => {
|
||||||
|
if (this.currentNode) {
|
||||||
|
// 这里传id,如果传node,可能会导致使用的是旧的node
|
||||||
|
this.$refs.nodeTree.setCurrentKeyById(this.currentNode.data.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setCondition(data) {
|
setCondition(data) {
|
||||||
|
|
Loading…
Reference in New Issue