Fix:修复富文本插件转换节点数据时没有处理节点概要的问题
This commit is contained in:
parent
7f0202e16e
commit
e2403ae433
@ -327,8 +327,8 @@ class RichText {
|
|||||||
list.forEach(node => {
|
list.forEach(node => {
|
||||||
this.mindMap.execCommand('SET_NODE_TEXT', node, html, true)
|
this.mindMap.execCommand('SET_NODE_TEXT', node, html, true)
|
||||||
// if (node.isGeneralization) {
|
// if (node.isGeneralization) {
|
||||||
// 概要节点
|
// 概要节点
|
||||||
// node.generalizationBelongNode.updateGeneralization()
|
// node.generalizationBelongNode.updateGeneralization()
|
||||||
// }
|
// }
|
||||||
this.mindMap.render()
|
this.mindMap.render()
|
||||||
})
|
})
|
||||||
@ -649,7 +649,18 @@ class RichText {
|
|||||||
if (node.data.richText) {
|
if (node.data.richText) {
|
||||||
node.data.richText = false
|
node.data.richText = false
|
||||||
node.data.text = getTextFromHtml(node.data.text)
|
node.data.text = getTextFromHtml(node.data.text)
|
||||||
// delete node.data.uid
|
}
|
||||||
|
// 概要
|
||||||
|
let generalization =
|
||||||
|
node.data && node.data.generalization ? node.data.generalization : []
|
||||||
|
generalization = Array.isArray(generalization)
|
||||||
|
? generalization
|
||||||
|
: [generalization]
|
||||||
|
if (generalization.length > 0) {
|
||||||
|
generalization.forEach(item => {
|
||||||
|
item.richText = false
|
||||||
|
item.text = getTextFromHtml(item.text)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
@ -670,6 +681,18 @@ class RichText {
|
|||||||
root.data.richText = true
|
root.data.richText = true
|
||||||
root.data.resetRichText = true
|
root.data.resetRichText = true
|
||||||
}
|
}
|
||||||
|
// 概要
|
||||||
|
let generalization =
|
||||||
|
root.data && root.data.generalization ? root.data.generalization : []
|
||||||
|
generalization = Array.isArray(generalization)
|
||||||
|
? generalization
|
||||||
|
: [generalization]
|
||||||
|
if (generalization.length > 0) {
|
||||||
|
generalization.forEach(item => {
|
||||||
|
item.richText = true
|
||||||
|
item.resetRichText = true
|
||||||
|
})
|
||||||
|
}
|
||||||
if (root.children && root.children.length > 0) {
|
if (root.children && root.children.length > 0) {
|
||||||
Array.from(root.children).forEach(item => {
|
Array.from(root.children).forEach(item => {
|
||||||
walk(item)
|
walk(item)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user