diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 3c4414d..afa567f 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -142,13 +142,19 @@ 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 + // 存在children 则为一级节点 + if(nodeData.children){ + // 为一级节点 + 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..d62793a 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 @@ -