fix(脑图): 标签替换

--bug=1046751 --user=白奇 【测试用例】脑图模式-用例内容富文本框仍展示标签 https://www.tapd.cn/55049933/s/1581595
This commit is contained in:
baiqi 2024-09-19 17:50:44 +08:00 committed by Craftsman
parent 1dc14534e6
commit 9aca625d33
4 changed files with 13 additions and 3 deletions

View File

@ -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 ?? []),

View File

@ -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);
}

View File

@ -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]

View File

@ -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;