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) {
|
||||
return data.name === this.defaultLabel && data.level === 1;
|
||||
},
|
||||
|
|
|
@ -461,14 +461,7 @@ export default {
|
|||
},
|
||||
planStatus: {
|
||||
type: String
|
||||
},
|
||||
searchSelectNodeIds: {
|
||||
type: Array
|
||||
},
|
||||
searchSelect: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
editTestPlanTestCaseOrder() {
|
||||
|
@ -670,15 +663,9 @@ 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;
|
||||
}
|
||||
}
|
||||
this.condition.projectId = getCurrentProjectID();
|
||||
if (this.planId) {
|
||||
this.result = getTestPlanTestCase(this.currentPage, this.pageSize, this.condition)
|
||||
|
@ -762,7 +749,11 @@ export default {
|
|||
search() {
|
||||
this.currentPage = 1;
|
||||
this.$emit('search');
|
||||
if (!this.selectNodeIds || this.selectNodeIds.length < 1) {
|
||||
// 如果没有选中节点,则刷新列表
|
||||
// 如果选中了节点,刷新模块时,会触发列表刷新,这里就不刷新了
|
||||
this.initTableData();
|
||||
}
|
||||
},
|
||||
buildPagePath(path) {
|
||||
return path + "/" + this.currentPage + "/" + this.pageSize;
|
||||
|
|
|
@ -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,30 +182,7 @@ 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -225,7 +197,12 @@ export default {
|
|||
},
|
||||
setCurrentKey() {
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue