Feat:去掉异步渲染节点的逻辑

This commit is contained in:
wanglin2 2023-08-09 09:08:45 +08:00
parent d707329526
commit dc8efbe3ef

View File

@ -1,6 +1,5 @@
import Style from './Style' import Style from './Style'
import Shape from './Shape' import Shape from './Shape'
import { asyncRun, nodeToHTML } from '../../../utils'
import { G, Rect, ForeignObject, SVG } from '@svgdotjs/svg.js' import { G, Rect, ForeignObject, SVG } from '@svgdotjs/svg.js'
import nodeGeneralizationMethods from './nodeGeneralization' import nodeGeneralizationMethods from './nodeGeneralization'
import nodeExpandBtnMethods from './nodeExpandBtn' import nodeExpandBtnMethods from './nodeExpandBtn'
@ -559,18 +558,14 @@ class Node {
this.nodeData.data.expand !== false this.nodeData.data.expand !== false
) { ) {
let index = 0 let index = 0
asyncRun( this.children.forEach(item => {
this.children.map(item => {
return () => {
item.render(() => { item.render(() => {
index++ index++
if (index >= this.children.length) { if (index >= this.children.length) {
callback() callback()
} }
}) })
}
}) })
)
} else { } else {
callback() callback()
} }
@ -592,13 +587,9 @@ class Node {
this.removeLine() this.removeLine()
// 子节点 // 子节点
if (this.children && this.children.length) { if (this.children && this.children.length) {
asyncRun( this.children.forEach(item => {
this.children.map(item => {
return () => {
item.remove() item.remove()
}
}) })
)
} }
} }
@ -624,13 +615,9 @@ class Node {
} }
// 子节点 // 子节点
if (this.children && this.children.length) { if (this.children && this.children.length) {
asyncRun( this.children.forEach(item => {
this.children.map(item => {
return () => {
item.hide() item.hide()
}
}) })
)
} }
} }
@ -650,13 +637,9 @@ class Node {
} }
// 子节点 // 子节点
if (this.children && this.children.length) { if (this.children && this.children.length) {
asyncRun( this.children.forEach(item => {
this.children.map(item => {
return () => {
item.show() item.show()
}
}) })
)
} }
} }