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

This commit is contained in:
teukkk 2024-08-21 17:20:35 +08:00 committed by 刘瑞斌
parent 3bee8d9ddb
commit 3dc9184cb6
1 changed files with 14 additions and 8 deletions

View File

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