From 944d94a202bc83d3c3f1dae9ad4ed6c79ca43765 Mon Sep 17 00:00:00 2001 From: qinqing <775435633@qq.com> Date: Mon, 14 Oct 2024 16:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=88=A4=E5=AE=9A=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/textbookAnalysis/index.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/views/textbookAnalysis/index.vue b/src/renderer/src/views/textbookAnalysis/index.vue index 58f8252..e93ab0e 100644 --- a/src/renderer/src/views/textbookAnalysis/index.vue +++ b/src/renderer/src/views/textbookAnalysis/index.vue @@ -253,10 +253,11 @@ const getAllSubject = async () => { } }) bookList.value = dataList - const { id, rootid } = sessionStore.get('subject.curNode') - if(id && rootid){ - const idx = dataList.findIndex(item => item.id === id && item.rootid === rootid) - let filePath = import.meta.env.VITE_APP_RES_FILE_PATH; + const session = sessionStore.get('subject.curNode') + console.log('session',session); + let filePath = import.meta.env.VITE_APP_RES_FILE_PATH; + if(session.rootid){ + const idx = dataList.findIndex(item => item.id === session.rootid) if(idx > -1){ bookInfo.value = {...dataList[idx]} filePath += dataList[idx].fileurl.replace('.txt','.pdf') @@ -265,9 +266,10 @@ const getAllSubject = async () => { filePath += dataList[0].fileurl.replace('.txt','.pdf') } await loadPdfAnimation(filePath) + }else{ + bookInfo.value = {...dataList[0]} + filePath += dataList[0].fileurl.replace('.txt','.pdf') } - - } const bookChange = async (item, idx) => { booksel.value = idx