|
@@ -1,5 +1,5 @@
|
|
|
import {useProvidePaperBatchCondition} from "@/views/dz/papers/hooks/usePaperBatchCondition.js";
|
|
import {useProvidePaperBatchCondition} from "@/views/dz/papers/hooks/usePaperBatchCondition.js";
|
|
|
-import {getPaperExamTypes, getPaperMajors, getPaperUniversities} from "@/api/dz/papers.js";
|
|
|
|
|
|
|
+import {getPaperExamTypes, getPaperMajors, getPaperSubjects, getPaperUniversities} from "@/api/dz/papers.js";
|
|
|
import {createEventHook, injectLocal, provideLocal} from "@vueuse/core";
|
|
import {createEventHook, injectLocal, provideLocal} from "@vueuse/core";
|
|
|
|
|
|
|
|
const key = Symbol('PaperExactCondition')
|
|
const key = Symbol('PaperExactCondition')
|
|
@@ -30,19 +30,24 @@ export const useProvidePaperExactCondition = function (type) {
|
|
|
return _allMajors.value.filter(m => m.majorGroup == majorGroup.value)
|
|
return _allMajors.value.filter(m => m.majorGroup == majorGroup.value)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ const subjectId = ref('')
|
|
|
|
|
+ const subjectList = ref([])
|
|
|
|
|
+
|
|
|
const conditionArgs = computed(() => ({
|
|
const conditionArgs = computed(() => ({
|
|
|
buildType: toValue(buildType),
|
|
buildType: toValue(buildType),
|
|
|
batchId: toValue(batchId),
|
|
batchId: toValue(batchId),
|
|
|
examType: toValue(examType),
|
|
examType: toValue(examType),
|
|
|
universityId: toValue(universityId),
|
|
universityId: toValue(universityId),
|
|
|
majorGroup: toValue(majorGroup),
|
|
majorGroup: toValue(majorGroup),
|
|
|
- majorPlanId: toValue(majorPlanId)
|
|
|
|
|
|
|
+ majorPlanId: toValue(majorPlanId),
|
|
|
|
|
+ subjectId: toValue(subjectId)
|
|
|
}))
|
|
}))
|
|
|
const conditionData = computed(() => ({
|
|
const conditionData = computed(() => ({
|
|
|
examTypes: toValue(examTypes),
|
|
examTypes: toValue(examTypes),
|
|
|
universities: toValue(universities),
|
|
universities: toValue(universities),
|
|
|
majorGroups: toValue(majorGroups),
|
|
majorGroups: toValue(majorGroups),
|
|
|
- majors: toValue(majors)
|
|
|
|
|
|
|
+ majors: toValue(majors),
|
|
|
|
|
+ subjectList: toValue(subjectList)
|
|
|
}))
|
|
}))
|
|
|
const exactEvent = createEventHook()
|
|
const exactEvent = createEventHook()
|
|
|
const triggerExactEvent = async function (args) {
|
|
const triggerExactEvent = async function (args) {
|
|
@@ -62,9 +67,12 @@ export const useProvidePaperExactCondition = function (type) {
|
|
|
universityId.value = ''
|
|
universityId.value = ''
|
|
|
universities.value = []
|
|
universities.value = []
|
|
|
|
|
|
|
|
- if (!batchId) return
|
|
|
|
|
|
|
+ if (!batchId || !examType) return
|
|
|
const res = await getPaperUniversities({buildType, batchId, examType})
|
|
const res = await getPaperUniversities({buildType, batchId, examType})
|
|
|
universities.value = res.data
|
|
universities.value = res.data
|
|
|
|
|
+
|
|
|
|
|
+ const resSubject = await getPaperSubjects({buildType, batchId, examType})
|
|
|
|
|
+ subjectList.value = resSubject.data
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
watch([batchId, examType, universityId], async ([batchId, examType, universityId]) => {
|
|
watch([batchId, examType, universityId], async ([batchId, examType, universityId]) => {
|
|
@@ -107,7 +115,7 @@ export const useProvidePaperExactCondition = function (type) {
|
|
|
universityId, universities,
|
|
universityId, universities,
|
|
|
majorGroup, majorGroups,
|
|
majorGroup, majorGroups,
|
|
|
majorPlanId, majors,
|
|
majorPlanId, majors,
|
|
|
- conditionArgs, conditionData,
|
|
|
|
|
|
|
+ conditionArgs, conditionData, subjectList,
|
|
|
onConditionReady: exactEvent.on}
|
|
onConditionReady: exactEvent.on}
|
|
|
provideLocal(key, payload)
|
|
provideLocal(key, payload)
|
|
|
return payload
|
|
return payload
|