feat(功能用例): 脑图点用例,用例及下面所有的子节点都展开

This commit is contained in:
teukkk 2024-07-12 18:24:08 +08:00 committed by Craftsman
parent 5c917b68a7
commit dd578a6633
4 changed files with 36 additions and 16 deletions

View File

@ -125,7 +125,11 @@
import MsEmpty from '@/components/pure/ms-empty/index.vue';
import MsMinderEditor from '@/components/pure/ms-minder-editor/minderEditor.vue';
import type { MinderJson, MinderJsonNode, MinderJsonNodeData } from '@/components/pure/ms-minder-editor/props';
import { setPriorityView } from '@/components/pure/ms-minder-editor/script/tool/utils';
import {
expendNodeAndChildren,
handleRenderNode,
setPriorityView,
} from '@/components/pure/ms-minder-editor/script/tool/utils';
import { MsFileItem } from '@/components/pure/ms-upload/types';
import Attachment from '@/components/business/ms-minders/featureCaseMinder/attachment.vue';
import ReviewCommentList from '@/views/case-management/caseManagementFeature/components/tabContent/tabComment/reviewCommentList.vue';
@ -278,18 +282,6 @@
}
}
/**
* 渲染其子节点
* @param node 对应节点
* @param renderNode 需要渲染的子节点
*/
function handleRenderNode(node: MinderJsonNode, renderNode: MinderJsonNode) {
if (!node.data) return;
window.minder.renderNodeBatch(renderNode);
node.layout();
node.data.isLoaded = true;
}
/**
* 创建节点
* @param data 节点数据
@ -625,6 +617,8 @@
if (extraVisible.value) {
toggleDetail(true);
}
//
expendNodeAndChildren(node);
} else if (data?.resource?.includes(moduleTag) && data.count > 0 && data.isLoaded !== true) {
//
await initNodeCases(node);

View File

@ -71,7 +71,7 @@
import MsButton from '@/components/pure/ms-button/index.vue';
import MsMinderEditor from '@/components/pure/ms-minder-editor/minderEditor.vue';
import type { MinderJson, MinderJsonNode, MinderJsonNodeData } from '@/components/pure/ms-minder-editor/props';
import { setPriorityView } from '@/components/pure/ms-minder-editor/script/tool/utils';
import { expendNodeAndChildren, setPriorityView } from '@/components/pure/ms-minder-editor/script/tool/utils';
import { MsFileItem } from '@/components/pure/ms-upload/types';
import attachment from './attachment.vue';
import baseInfo from './basInfo.vue';
@ -586,6 +586,8 @@
if (extraVisible.value) {
toggleDetail(true);
}
//
expendNodeAndChildren(node);
} else if (data?.resource?.includes(moduleTag) && data.count > 0 && data.isLoaded !== true) {
//
await initNodeCases(node);

View File

@ -157,3 +157,27 @@ export function isNodeInMinderView(node?: MinderJsonNode, nodePosition?: MinderN
}
return false;
}
/**
*
* @param node
* @param renderNode
*/
export function handleRenderNode(node: MinderJsonNode, renderNode: MinderJsonNode) {
if (!node.data) return;
window.minder.renderNodeBatch(renderNode);
node.layout();
node.data.isLoaded = true;
}
/**
*
* @param node
*/
export function expendNodeAndChildren(node: MinderJsonNode) {
if (node.children?.length) {
node.expand();
handleRenderNode(node, node.children);
node.children?.forEach((child) => expendNodeAndChildren(child));
}
}

View File

@ -251,8 +251,8 @@ export interface ReviewHistoryItem {
export interface ReviewerAndStatus {
reviewerStatus: OptionItem[]; // 每个评审人最终的评审结果
status: ReviewResult;
caseId: string; // 用例评审最终结果
status: ReviewResult; // 用例评审最终结果
caseId: string;
}
// 评审详情-用例列表项