feat(功能用例): 脑图点用例,用例及下面所有的子节点都展开
This commit is contained in:
parent
5c917b68a7
commit
dd578a6633
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -251,8 +251,8 @@ export interface ReviewHistoryItem {
|
|||
|
||||
export interface ReviewerAndStatus {
|
||||
reviewerStatus: OptionItem[]; // 每个评审人最终的评审结果
|
||||
status: ReviewResult;
|
||||
caseId: string; // 用例评审最终结果
|
||||
status: ReviewResult; // 用例评审最终结果
|
||||
caseId: string;
|
||||
}
|
||||
|
||||
// 评审详情-用例列表项
|
||||
|
|
Loading…
Reference in New Issue