From 9aca625d33c72fb420e0e51a40888313f7e6f8a7 Mon Sep 17 00:00:00 2001 From: baiqi Date: Thu, 19 Sep 2024 17:50:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=84=91=E5=9B=BE):=20=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1046751 --user=白奇 【测试用例】脑图模式-用例内容富文本框仍展示标签 https://www.tapd.cn/55049933/s/1581595 --- .../business/ms-minders/caseReviewMinder/index.vue | 1 + .../business/ms-minders/featureCaseMinder/index.vue | 9 +++++++-- .../ms-minders/testPlanFeatureCaseMinder/index.vue | 1 + .../pure/ms-minder-editor/script/tool/utils.ts | 5 ++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue b/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue index 68678bf061..f9da9174f6 100644 --- a/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue +++ b/frontend/src/components/business/ms-minders/caseReviewMinder/index.vue @@ -296,6 +296,7 @@ const child = createNode( { ...(e.data as MinderJsonNodeData), + text: e.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '', resource: [ ...(statusTagMap[e.data?.status] ? [statusTagMap[e.data?.status]] : []), ...(e.data?.resource ?? []), diff --git a/frontend/src/components/business/ms-minders/featureCaseMinder/index.vue b/frontend/src/components/business/ms-minders/featureCaseMinder/index.vue index 4c1d33ffd9..daed798054 100644 --- a/frontend/src/components/business/ms-minders/featureCaseMinder/index.vue +++ b/frontend/src/components/business/ms-minders/featureCaseMinder/index.vue @@ -204,7 +204,7 @@ data: { ...e.data, id: e.id || e.data?.id || '', - text: e.name || e.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '', + text: e.name || e.data?.text || '', resource: props.modulesCount[e.id] !== undefined ? [moduleTag] : e.data?.resource, expandState: e.level === 0 ? 'expand' : 'collapse', count: props.modulesCount[e.id], @@ -445,6 +445,7 @@ const child = window.minder.createNode( { ...e.data, + text: e.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '', expandState: 'collapse', isNew: false, }, @@ -457,6 +458,7 @@ const grandChild = window.minder.createNode( { ...item.data, + text: item.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '', expandState: 'collapse', isNew: false, }, @@ -469,6 +471,7 @@ const greatGrandChild = window.minder.createNode( { ...subItem.data, + text: subItem.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '', expandState: 'collapse', isNew: false, }, @@ -542,6 +545,7 @@ const child = window.minder.createNode( { ...e.data, + text: e.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '', expandState: 'collapse', isNew: false, }, @@ -554,6 +558,7 @@ const grandChild = window.minder.createNode( { ...item.data, + text: item.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '', expandState: 'collapse', isNew: false, }, @@ -566,6 +571,7 @@ const greatGrandChild = window.minder.createNode( { ...subItem.data, + text: subItem.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '', expandState: 'collapse', isNew: false, }, @@ -578,7 +584,6 @@ window.minder.renderNodeBatch(grandChildren); }); node.expand(); - // node.renderTree(); if (node.children && node.children.length > 0) { waitingRenderNodes = waitingRenderNodes.concat(node.children); } diff --git a/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue b/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue index ef09a71980..9a4cb1504e 100644 --- a/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue +++ b/frontend/src/components/business/ms-minders/testPlanFeatureCaseMinder/index.vue @@ -407,6 +407,7 @@ const child = createNode( { ...(e.data as MinderJsonNodeData), + text: e.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '', resource: [ ...(executionResultMap[e.data?.status]?.statusText ? [executionResultMap[e.data?.status].statusText] diff --git a/frontend/src/components/pure/ms-minder-editor/script/tool/utils.ts b/frontend/src/components/pure/ms-minder-editor/script/tool/utils.ts index 442ed9ec85..27fd67eda5 100644 --- a/frontend/src/components/pure/ms-minder-editor/script/tool/utils.ts +++ b/frontend/src/components/pure/ms-minder-editor/script/tool/utils.ts @@ -225,7 +225,10 @@ export function createNode(data?: MinderJsonNodeData, parentNode?: MinderJsonNod export function renderSubNodes(parentNode: MinderJsonNode, children?: MinderJsonNode[]) { return ( children?.map((item: MinderJsonNode) => { - const grandChild = createNode(item.data, parentNode); + const grandChild = createNode( + { ...item.data, text: item.data?.text.replace(/<\/?p\b[^>]*>/gi, '') || '' } as MinderJsonNodeData, + parentNode + ); const greatGrandChildren = renderSubNodes(grandChild, item.children); window.minder.renderNodeBatch(greatGrandChildren); return grandChild;