From e70d6b05395c6fe0f4a626fad4aca93e7f5fa16d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Mon, 23 Sep 2024 09:15:39 +0800 Subject: [PATCH] =?UTF-8?q?unitid=20=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/choose-textbook/index.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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)