feat(测试计划): 执行脑图-用例的实际结果也可以执行

This commit is contained in:
teukkk 2024-08-21 17:20:35 +08:00 committed by 刘瑞斌
parent 3bee8d9ddb
commit 3dc9184cb6

View File

@ -554,14 +554,18 @@
actualResultNode.setData('text', content ?? '').render();
}
}
// /
function isActualResultNode(node: MinderJsonNode) {
return node.data?.resource?.includes(actualResultTag) && node.parent?.data?.resource?.includes(caseTag);
}
// //
function handleExecuteDone(status: LastExecuteResults, content: string) {
const node = window.minder.getSelectedNode();
const curSelectNode = window.minder.getSelectedNode();
const node = isActualResultNode(curSelectNode) ? curSelectNode.parent : curSelectNode;
executeVisible.value = false;
const resource = node.data?.resource;
if (resource?.includes(caseTag)) {
//
window.minder.execCommand('resource', [executionResultMap[status].statusText, caseTag]);
node.setData('resource', [executionResultMap[status].statusText, caseTag]).render();
//
updateCaseActualResultNode(node, content);
//
@ -751,9 +755,9 @@
setPriorityView(true, 'P');
return;
}
selectNode.value = node;
selectNode.value = isActualResultNode(node) ? node.parent : node;
// :
// :
if (
node.data?.resource?.includes(caseTag) ||
(node.data?.resource?.includes(moduleTag) &&
@ -762,6 +766,8 @@
) {
canShowFloatMenu.value = true;
setMoreMenuOtherOperationList(node);
} else if (isActualResultNode(node) && props.canEdit && hasAnyPermission(['PROJECT_TEST_PLAN:READ+EXECUTE'])) {
canShowFloatMenu.value = true;
} else {
canShowFloatMenu.value = false;
}
@ -776,12 +782,12 @@
if (caseNodeAboveSelectStep.value?.data?.id) {
getStepData(caseNodeAboveSelectStep.value.data.id);
stepExecuteModelVisible.value = true;
return;
}
return;
}
//
if (node.data?.resource?.includes(caseTag) && !hasOperationPermission.value) {
//
if ((node.data?.resource?.includes(caseTag) && !hasOperationPermission.value) || isActualResultNode(node)) {
canShowMoreMenu.value = false;
} else {
canShowMoreMenu.value = true;