|
@@ -2,6 +2,7 @@ import { reactive, computed, watch, ref, unref, isRef, nextTick } from 'vue'
|
|
|
import useFetch from '@/hooks/useFetch'
|
|
|
import useMainStore from '@/store/main'
|
|
|
import { ExtractApiResponse } from '@/api/api'
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
import type { Ref } from 'vue'
|
|
|
|
|
|
export interface DataModel {
|
|
@@ -30,7 +31,9 @@ const useOptions = (
|
|
|
showAllLabel = true
|
|
|
) => {
|
|
|
const mainStore = useMainStore()
|
|
|
-
|
|
|
+ const route = useRoute()
|
|
|
+ const _subjectCode = (route.query?._subjectCode || '') as string
|
|
|
+ const _questionMainNumber = Number(route.query?._questionMainNumber || '')
|
|
|
const userInfo = computed(() => {
|
|
|
return mainStore?.myUserInfo
|
|
|
})
|
|
@@ -247,7 +250,7 @@ const useOptions = (
|
|
|
//如果是专家进来,则用户信息里的subjectCode是没值的,这种情况,给专家默认选择科目列表里的第一个科目
|
|
|
if (userInfo.value?.role === 'EXPERT' && !userInfo.value?.subjectCode) {
|
|
|
if (subjectList.value.length) {
|
|
|
- changeModelValue('subject')(subjectList.value[0].value)
|
|
|
+ changeModelValue('subject')(_subjectCode || subjectList.value[0].value)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -265,7 +268,7 @@ const useOptions = (
|
|
|
) {
|
|
|
if (mainQuestionList.value.length) {
|
|
|
const oldQuestionNumber = dataModel.question
|
|
|
- changeModelValue('question')(mainQuestionList.value[0].value)
|
|
|
+ changeModelValue('question')(_questionMainNumber || mainQuestionList.value[0].value)
|
|
|
if (oldQuestionNumber == mainQuestionList.value[0].value) {
|
|
|
//防止切换科目前的大题号和切换科目后的大题号相同,watch question监听不执行
|
|
|
watchQuestionHandle()
|