From 8013b1c2ccaf4842f49fe69054e39a4003dd33c6 Mon Sep 17 00:00:00 2001 From: lyc Date: Sat, 14 Sep 2024 14:59:35 +0800 Subject: [PATCH 1/2] edit --- .../src/components/choose-textbook/index.vue | 29 ++++++++++++------- .../views/classTask/container/item-dialog.vue | 2 +- .../views/desktop/container/work-trend.vue | 16 +++++----- src/renderer/src/views/profile/userInfo.vue | 2 ++ 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 94b9e2b..7f3c178 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -104,11 +104,16 @@ const getSubjectContent = async () => { pageSize: 10000 } - let data; - const { rows } = await listEvaluation(params) - localStorage.setItem('evaluationList', JSON.stringify(rows)) - evaluationList.value = rows - data = rows + + if(localStorage.getItem('evaluationList')){ + evaluationList.value = JSON.parse(localStorage.getItem('evaluationList')) + } + else{ + const { rows } = await listEvaluation(params) + localStorage.setItem('evaluationList', JSON.stringify(rows)) + evaluationList.value = rows + } + treeLoading.value = false //获取教材版本 @@ -263,12 +268,16 @@ const transData = (data) => { //获取教材 const getSubject = async () => { + if(localStorage.getItem('subjectList')){ + subjectList.value = JSON.parse(localStorage.getItem('subjectList')) + } + else{ + const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 10000,orderby: 'orderidx asc', }) - const { rows } = await listEvaluation({ itemkey: "version", edusubject, edustage, pageSize: 10000,orderby: 'orderidx asc', }) - - // subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject) - subjectList.value = rows - localStorage.setItem('subjectList', JSON.stringify(subjectList.value)) + // subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject) + subjectList.value = rows + localStorage.setItem('subjectList', JSON.stringify(subjectList.value)) + } // 默认第一个 if(!subjectList.value.length) return diff --git a/src/renderer/src/views/classTask/container/item-dialog.vue b/src/renderer/src/views/classTask/container/item-dialog.vue index d18c6d3..053a7b5 100644 --- a/src/renderer/src/views/classTask/container/item-dialog.vue +++ b/src/renderer/src/views/classTask/container/item-dialog.vue @@ -10,7 +10,7 @@ destory-on-close :before-close="onBeforeClose" > -