教学研究室-打开教材分析 #157

Merged
lyc merged 1 commits from lyc-dev into main 2024-08-26 14:39:57 +08:00
3 changed files with 10 additions and 3 deletions

View File

@ -10,7 +10,7 @@
class="flex" class="flex"
:style="{'color' : item.color}" :style="{'color' : item.color}"
:class="currentRoute === item.url ? 'active-li' : ''" :class="currentRoute === item.url ? 'active-li' : ''"
@click="handleOutLink(item.url,item.type)" @click="handleOutLink(item.url,item.type, item.name)"
> >
<i :class="item.img"></i> <i :class="item.img"></i>
<span class="text">{{ item.name }}</span> <span class="text">{{ item.name }}</span>
@ -57,6 +57,7 @@ import WindowTools from '@/components/window-tools/index.vue'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import routerStore from '@/store/modules/route' import routerStore from '@/store/modules/route'
import outLink from '@/utils/linkConfig' import outLink from '@/utils/linkConfig'
const routeHeader = routerStore() const routeHeader = routerStore()
const { ipcRenderer } = window.electron || {} const { ipcRenderer } = window.electron || {}
const userStore = useUserStore() const userStore = useUserStore()
@ -64,7 +65,7 @@ const router = useRouter()
const currentRoute = ref('') const currentRoute = ref('')
const dev_api = ref(import.meta.env.VITE_APP_BASE_API) const dev_api = ref(import.meta.env.VITE_APP_BASE_API)
const handleOutLink = (path, type) => { const handleOutLink = (path, type, name) => {
if (!path) return if (!path) return
if (type === 'hash') { if (type === 'hash') {
router.push(path) router.push(path)
@ -73,6 +74,11 @@ const handleOutLink = (path, type) => {
let configObj = outLink().getBaseData() let configObj = outLink().getBaseData()
let fullPath = configObj.fullPath + path let fullPath = configObj.fullPath + path
fullPath = fullPath.replaceAll('//', '/') 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', { ipcRenderer.send('openWindow', {
key: path, key: path,

View File

@ -422,7 +422,6 @@ export default {
this.uploadData.levelSecondId = cata[1] this.uploadData.levelSecondId = cata[1]
this.uploadData.levelThirdId = cata[2] this.uploadData.levelThirdId = cata[2]
this.uploadData.textbookId = data.textBook.curBookId this.uploadData.textbookId = data.textBook.curBookId
const toolStore = useToolState()
toolStore.curSubjectNode.data = data toolStore.curSubjectNode.data = data
toolStore.curSubjectNode.querySearch = this.uploadData toolStore.curSubjectNode.querySearch = this.uploadData
this.initHomeWork() this.initHomeWork()

View File

@ -70,6 +70,8 @@ const getData = (data) => {
levelSecondId levelSecondId
} }
sourceStore.handleQuery() sourceStore.handleQuery()
// ID
localStorage.setItem('unitId', JSON.stringify({ levelFirstId, levelSecondId}))
} }
const getDataOther = (data) => { const getDataOther = (data) => {
sourceStore.thirdQuery.chapterId = data.chapterId sourceStore.thirdQuery.chapterId = data.chapterId