From 144da0ace908223bb4bdffa1e5231fabf0c7e57d Mon Sep 17 00:00:00 2001 From: lyc Date: Mon, 26 Aug 2024 14:34:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=AD=A6=E7=A0=94=E7=A9=B6=E5=AE=A4-?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=95=99=E6=9D=90=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/layout/components/Header.vue | 10 ++++++++-- src/renderer/src/views/prepare/index.vue | 1 - src/renderer/src/views/resource/index.vue | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/layout/components/Header.vue b/src/renderer/src/layout/components/Header.vue index 7f5ecea..e7a4e04 100644 --- a/src/renderer/src/layout/components/Header.vue +++ b/src/renderer/src/layout/components/Header.vue @@ -10,7 +10,7 @@ class="flex" :style="{'color' : item.color}" :class="currentRoute === item.url ? 'active-li' : ''" - @click="handleOutLink(item.url,item.type)" + @click="handleOutLink(item.url,item.type, item.name)" > {{ item.name }} @@ -57,6 +57,7 @@ import WindowTools from '@/components/window-tools/index.vue' import useUserStore from '@/store/modules/user' import routerStore from '@/store/modules/route' import outLink from '@/utils/linkConfig' + const routeHeader = routerStore() const { ipcRenderer } = window.electron || {} const userStore = useUserStore() @@ -64,7 +65,7 @@ const router = useRouter() const currentRoute = ref('') const dev_api = ref(import.meta.env.VITE_APP_BASE_API) -const handleOutLink = (path, type) => { +const handleOutLink = (path, type, name) => { if (!path) return if (type === 'hash') { router.push(path) @@ -73,6 +74,11 @@ const handleOutLink = (path, type) => { let configObj = outLink().getBaseData() let fullPath = configObj.fullPath + path fullPath = fullPath.replaceAll('//', '/') + const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId')) + let unitId = levelSecondId ? levelSecondId :levelFirstId + if(name == '教材分析' || name == '高考研究'){ + fullPath += `?unitId=${unitId}` + } // 通知主进程 ipcRenderer.send('openWindow', { key: path, diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index 9ecdac4..9b2992d 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -422,7 +422,6 @@ export default { this.uploadData.levelSecondId = cata[1] this.uploadData.levelThirdId = cata[2] this.uploadData.textbookId = data.textBook.curBookId - const toolStore = useToolState() toolStore.curSubjectNode.data = data toolStore.curSubjectNode.querySearch = this.uploadData this.initHomeWork() diff --git a/src/renderer/src/views/resource/index.vue b/src/renderer/src/views/resource/index.vue index 5629cd2..326f9cb 100644 --- a/src/renderer/src/views/resource/index.vue +++ b/src/renderer/src/views/resource/index.vue @@ -70,6 +70,8 @@ const getData = (data) => { levelSecondId } sourceStore.handleQuery() + // 头部 教材分析打开外部链接需要当前章节ID + localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId})) } const getDataOther = (data) => { sourceStore.thirdQuery.chapterId = data.chapterId -- 2.44.0.windows.1