Demo:去除不必要的代码

This commit is contained in:
街角小林
2024-12-25 09:17:15 +08:00
parent 62e02ae956
commit d85210372d

View File

@@ -9,24 +9,6 @@ const SIMPLE_MIND_MAP_LOCAL_CONFIG = 'SIMPLE_MIND_MAP_LOCAL_CONFIG'
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: 王林
* @Date: 2021-08-01 10:10:49
@@ -65,7 +47,7 @@ export const storeData = data => {
} else {
originData = getData()
}
originData.root = copyMindMapTreeData({}, data)
originData.root = data
if (window.takeOverApp) {
mindMapData = originData
window.takeOverAppMethods.saveMindMapData(originData)