fix(测试计划): 执行脑图-用例的实际结果只更新不新增

This commit is contained in:
teukkk 2024-08-09 15:32:15 +08:00 committed by Craftsman
parent d44c59b80f
commit 97e38804a8
1 changed files with 7 additions and 15 deletions

View File

@ -543,21 +543,13 @@
//
const executeVisible = ref(false);
//
//
function updateCaseActualResultNode(node: MinderJsonNode, content: string) {
let actualResultNode;
actualResultNode = node.children?.find((item: MinderJsonNode) => item.data?.id === `actualResult-${node.data?.id}`);
if (actualResultNode) {
actualResultNode
.setData('resource', [actualResultTag])
.setData('text', content ?? '')
.render();
} else {
actualResultNode = createNode(
{ resource: [actualResultTag], text: content ?? '', id: `actualResult-${node.data?.id}` },
node
const actualResultNode = node.children?.find((item: MinderJsonNode) =>
item.data?.resource?.includes(actualResultTag)
);
handleRenderNode(node, [actualResultNode]);
if (actualResultNode) {
actualResultNode.setData('text', content ?? '').render();
}
}
// /
@ -567,7 +559,7 @@
if (resource?.includes(caseTag)) {
//
window.minder.execCommand('resource', [executionResultMap[status].statusText, caseTag]);
//
//
updateCaseActualResultNode(selectNode.value, content);
//
if (extraVisible.value && activeExtraKey.value === 'history') {
@ -638,7 +630,7 @@
function submitStepExecuteDone(status: string, content: string) {
//
caseNodeAboveSelectStep.value.setData('resource', [executionResultMap[status].statusText, caseTag]).render();
//
//
updateCaseActualResultNode(caseNodeAboveSelectStep.value, content);
//
caseNodeAboveSelectStep.value.children.forEach((child: MinderJsonNode) => {