diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 5b5cf59..adc0fe3 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -360,6 +360,19 @@ const handleNodeClick = (data, node) => { localStorage.setItem('defaultExpandedKeys', nodeData.parentNode ? JSON.stringify([parentNode.id]) : JSON.stringify([data.id])) localStorage.setItem('currentNodeId', JSON.stringify(data.id)) + //#region 保存当前章节单元节点信息 + let levelSecondId = curData.node.id + let levelFirstId + if (curData.node.parentNode) { + levelFirstId = curData.node.parentNode.id + } else { + levelFirstId = curData.node.id + levelSecondId = '' + } + console.log('levelFirstId---', levelFirstId) + console.log('levelSecondId---', levelSecondId) + localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId})) + //#endregion emit('nodeClick', curData)