Demo:去除不必要的代码
This commit is contained in:
parent
62e02ae956
commit
d85210372d
@ -9,24 +9,6 @@ const SIMPLE_MIND_MAP_LOCAL_CONFIG = 'SIMPLE_MIND_MAP_LOCAL_CONFIG'
|
|||||||
|
|
||||||
let mindMapData = null
|
let mindMapData = null
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: 王林
|
|
||||||
* @Date: 2021-08-02 22:36:48
|
|
||||||
* @Desc: 克隆思维导图数据,去除激活状态
|
|
||||||
*/
|
|
||||||
const copyMindMapTreeData = (tree, root) => {
|
|
||||||
if (!root) return null
|
|
||||||
tree.data = simpleDeepClone(root.data)
|
|
||||||
// tree.data.isActive = false
|
|
||||||
tree.children = []
|
|
||||||
if (root.children && root.children.length > 0) {
|
|
||||||
root.children.forEach((item, index) => {
|
|
||||||
tree.children[index] = copyMindMapTreeData({}, item)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return tree
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: 王林
|
* @Author: 王林
|
||||||
* @Date: 2021-08-01 10:10:49
|
* @Date: 2021-08-01 10:10:49
|
||||||
@ -65,7 +47,7 @@ export const storeData = data => {
|
|||||||
} else {
|
} else {
|
||||||
originData = getData()
|
originData = getData()
|
||||||
}
|
}
|
||||||
originData.root = copyMindMapTreeData({}, data)
|
originData.root = data
|
||||||
if (window.takeOverApp) {
|
if (window.takeOverApp) {
|
||||||
mindMapData = originData
|
mindMapData = originData
|
||||||
window.takeOverAppMethods.saveMindMapData(originData)
|
window.takeOverAppMethods.saveMindMapData(originData)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user