diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 3c4414d..781b86b 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -142,13 +142,18 @@ const handleNodeClick = (data) => { //增加一个label 之前取的label nodeData.label = nodeData.itemtitle - // 父级节点 如果当前是一级节点 父级则为null - let parent = { - id: nodeData.parentid, - label: nodeData.parenttitle, - itemtitle: nodeData.parenttitle - } - const parentNode = nodeData.parentid ? parent : null + let parentNode + // 父级id == rootid 说明当前节点为一级节点 + if(nodeData.parentid == nodeData.rootid){ + parentNode = null + } + else{ + parentNode = { + id: nodeData.parentid, + label: nodeData.parenttitle, + itemtitle: nodeData.parenttitle + } + } nodeData.parentNode = parentNode let curData = { textBook: { diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index 98a5b8d..ffcb56c 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -26,52 +26,52 @@ -
- - +
+ +
@@ -83,7 +83,7 @@