From 13598615c7324d0de944d09127d8a4fdee338dbe Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 20 Aug 2024 14:24:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E6=9D=90=E9=80=89=E6=8B=A9=E4=B8=8D?= =?UTF-8?q?=E5=8C=BA=E5=88=86=E4=B8=8A=E4=B8=8B=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/choose-textbook/index.vue | 19 ++++++++---------- .../src/components/move-file/index.vue | 20 ++++++++----------- .../src/views/tool/components/lesson.vue | 17 ++++++++-------- 3 files changed, 24 insertions(+), 32 deletions(-) diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 3c2f6a5..69be80f 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -75,8 +75,7 @@ const curBookImg = ref('') const curBookPath = ref('') // 上册 const volumeOne = ref([]) -// 下册 -const volumeTwo = ref([]) + // 当前节点 const currentNode = reactive({ data:{} @@ -111,9 +110,11 @@ const getSubjectContent = async () => { //获取教材版本 await getSubject() //上册 - volumeOne.value = data.filter(item => item.level == 1 && item.semester == '上册') - //下册 - volumeTwo.value = data.filter(item => item.level == 1 && item.semester == '下册') + /** + * 不区分上下册 + * 2024/08/20调整 + */ + volumeOne.value = data.filter(item => item.level == 1) getTreeData() } @@ -132,12 +133,8 @@ const changeBook = ({ id, itemtitle, avartar, fileurl }) => { const getTreeData = () => { //数据过滤 let upData = transData(volumeOne.value) - let downData = transData(volumeTwo.value) - if(upData.length && downData.length){ - treeData.value = [...upData,...downData] - } - else if(upData.length || downData.length){ - treeData.value = upData.length ? upData : downData + if(upData.length){ + treeData.value = [...upData] } else{ treeData.value = [] diff --git a/src/renderer/src/components/move-file/index.vue b/src/renderer/src/components/move-file/index.vue index cb9d2b0..8e0a0bb 100644 --- a/src/renderer/src/components/move-file/index.vue +++ b/src/renderer/src/components/move-file/index.vue @@ -88,8 +88,6 @@ const curBookId = ref(-1) const curBookName = ref('') // 上册 const volumeOne = ref([]) -// 下册 -const volumeTwo = ref([]) // 当前节点 const currentNode = reactive({ data: {} @@ -127,9 +125,12 @@ const getSubjectContent = async () => { //获取教材版本 getSubject() //上册 - volumeOne.value = data.filter(item => item.level == 1 && item.semester == '上册') - //下册 - volumeTwo.value = data.filter(item => item.level == 1 && item.semester == '下册') + /** + * 不区分上下册 + * 2024/08/20调整 + */ + volumeOne.value = data.filter(item => item.level == 1) + getTreeData() } @@ -160,13 +161,8 @@ const isHaveUnit = (id) => { const getTreeData = () => { //数据过滤 let upData = transData(volumeOne.value) - let downData = transData(volumeTwo.value) - - if(upData.length && downData.length){ - treeData.value = [...upData,...downData] - } - else if(upData.length || downData.length){ - treeData.value = upData.length ? upData : downData + if(upData.length){ + treeData.value = [...upData] } else{ treeData.value = [] diff --git a/src/renderer/src/views/tool/components/lesson.vue b/src/renderer/src/views/tool/components/lesson.vue index 7ed1658..e6f7914 100644 --- a/src/renderer/src/views/tool/components/lesson.vue +++ b/src/renderer/src/views/tool/components/lesson.vue @@ -42,18 +42,17 @@ const getTreeData = () => { evaluationList.value = JSON.parse(localStorage.getItem('evaluationList')) //上册 - let volumeOne = evaluationList.value.filter(item => item.level == 1 && item.semester == '上册') - //下册 - let volumeTwo = evaluationList.value.filter(item => item.level == 1 && item.semester == '下册') + /** + * 不区分上下册 + * 2024/08/20调整 + */ + let volumeOne = evaluationList.value.filter(item => item.level == 1) + //数据过滤 let upData = transData(volumeOne) - let downData = transData(volumeTwo) - if(upData.length && downData.length){ - treeData.value = [...upData,...downData] - } - else if(upData.length || downData.length){ - treeData.value = upData.length ? upData : downData + if(upData.length){ + treeData.value = [...upData] } else{ treeData.value = [] -- 2.44.0.windows.1