Compare commits

...

2 Commits

1 changed files with 28 additions and 0 deletions

View File

@ -109,6 +109,19 @@ const emitChangeBook = async () => {
}, },
node: curData node: curData
} }
/**
* 临时用 后续删除 unitId
*/
let levelFirstId = null
let levelSecondId = null
if (curData.parentNode) {
levelFirstId = curData.parentNode.id
levelSecondId = curData.id
} else {
levelFirstId = curData.id
levelSecondId = ''
}
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
emit('changeBook', data) emit('changeBook', data)
} }
@ -187,6 +200,21 @@ const handleNodeClick = (data, node) => {
} }
localStorage.setItem('defaultExpandedKeys', parentNode ? JSON.stringify([parentNode.id]) : JSON.stringify([data.id])) localStorage.setItem('defaultExpandedKeys', parentNode ? JSON.stringify([parentNode.id]) : JSON.stringify([data.id]))
localStorage.setItem('curNode', JSON.stringify(nodeData)) localStorage.setItem('curNode', JSON.stringify(nodeData))
/**
* 临时用 后续删除 unitId
*/
let levelFirstId = null
let levelSecondId = null
if (nodeData.parentNode) {
levelFirstId = nodeData.parentNode.id
levelSecondId = nodeData.id
} else {
levelFirstId = nodeData.id
levelSecondId = ''
}
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
emit('nodeClick', curData) emit('nodeClick', curData)
} }