查看其他同院校其他专业列表

This commit is contained in:
zhouwentao 2026-01-24 17:41:16 +08:00
parent 57c6de808d
commit bb475734f6
2 changed files with 47 additions and 27 deletions

View File

@ -20,11 +20,13 @@ interface MajorDetail {
code: string code: string
name: string name: string
prob: number prob: number
batch: string
score: number // score: number //
diff: number // 线 diff: number // 线
plan: number // plan: number //
req: string // req: string //
tuition: string tuition: string
rulesEnrollProbability: string //
} }
// --- --- // --- ---
@ -256,42 +258,59 @@ async function openMajorModal(school: MajorItem) {
selectedMajorCodes.value = [] selectedMajorCodes.value = []
showSaveConfirm.value = false showSaveConfirm.value = false
// try {
// TODO: API const res = await getUserMajorList({
setTimeout(() => { schoolCode: school.schoolCode,
// Mock data for now batch: currentBatchTab.value,
modalMajors.value = [ page: 1,
{ size: 100 //
code: currentSchool.value!.majorCode, })
name: currentSchool.value!.majorName,
prob: currentSchool.value!.enrollProbability, if (res && res.list && res.list.items) {
score: currentSchool.value!.studentScore, modalMajors.value = res.list.items.map(m => ({
code: m.majorCode,
name: m.majorName,
prob: m.enrollProbability,
score: m.studentScore,
batch: m.batch != "高职高专" ? "本科": "高职高专",
rulesEnrollProbability: m.rulesEnrollProbability,
diff: 0, diff: 0,
plan: currentSchool.value!.planNum, plan: m.planNum,
req: currentSchool.value!.mainSubjects, req: m.mainSubjects,
tuition: currentSchool.value!.tuition, tuition: m.tuition,
}, enrollmentCode: m.enrollmentCode // 便
] }))
}
} catch (error) {
console.error('获取学校专业列表失败:', error)
} finally {
modalLoading.value = false modalLoading.value = false
}, 400) }
} }
// 2. / () // 2. / ()
function toggleMajor(major: MajorDetail) { function toggleMajor(major: any) {
const index = selectedMajorCodes.value.indexOf(major.code) if (!currentSchool.value) return
// : schoolCode_majorCode_enrollmentCode
const fullCode = `${currentSchool.value.schoolCode}_${major.code}_${major.enrollmentCode || currentSchool.value.enrollmentCode}`
const index = selectedMajorCodes.value.indexOf(fullCode)
if (index > -1) { if (index > -1) {
// //
selectedMajorCodes.value.splice(index, 1) selectedMajorCodes.value.splice(index, 1)
} }
else { else {
// //
selectedMajorCodes.value.push(major.code) selectedMajorCodes.value.push(fullCode)
} }
} }
// //
function getVolunteerBtnText(code: string) { function getVolunteerBtnText(major: any) {
const index = selectedMajorCodes.value.indexOf(code) if (!currentSchool.value) return '加入志愿单'
const fullCode = `${currentSchool.value.schoolCode}_${major.code}_${major.enrollmentCode || currentSchool.value.enrollmentCode}`
const index = selectedMajorCodes.value.indexOf(fullCode)
if (index > -1) { if (index > -1) {
return `志愿 ${index + 1}` return `志愿 ${index + 1}`
} }
@ -1209,10 +1228,10 @@ function deletePlan(planId: string) {
录取概率 录取概率
</th> </th>
<th class="px-6 py-3 text-center"> <th class="px-6 py-3 text-center">
24最低分 上次最低分
</th> </th>
<th class="px-6 py-3 text-center"> <th class="px-6 py-3 text-center">
24年线差 录取方式
</th> </th>
<th class="px-6 py-3 text-center"> <th class="px-6 py-3 text-center">
招生计划 招生计划
@ -1247,7 +1266,7 @@ function deletePlan(planId: string) {
</div> </div>
<div class="mt-1 flex gap-2 text-xs text-slate-500"> <div class="mt-1 flex gap-2 text-xs text-slate-500">
<span class="rounded bg-slate-100 px-1.5 py-0.5">{{ <span class="rounded bg-slate-100 px-1.5 py-0.5">{{
major.req major.batch
}}</span> }}</span>
<span class="rounded bg-slate-100 px-1.5 py-0.5">{{ <span class="rounded bg-slate-100 px-1.5 py-0.5">{{
major.tuition major.tuition
@ -1264,7 +1283,7 @@ function deletePlan(planId: string) {
{{ major.score }} {{ major.score }}
</td> </td>
<td class="px-6 py-4 text-center text-slate-500"> <td class="px-6 py-4 text-center text-slate-500">
{{ major.diff }} {{ major.rulesEnrollProbability }}
</td> </td>
<td class="px-6 py-4 text-center text-slate-500"> <td class="px-6 py-4 text-center text-slate-500">
{{ major.plan }} {{ major.plan }}
@ -1277,12 +1296,12 @@ function deletePlan(planId: string) {
<button <button
class="min-w-[90px] rounded-full px-3 py-1.5 text-xs font-medium transition-all duration-200" class="min-w-[90px] rounded-full px-3 py-1.5 text-xs font-medium transition-all duration-200"
:class="[ :class="[
selectedMajorCodes.includes(major.code) selectedMajorCodes.includes(`${currentSchool?.schoolCode}_${major.code}_${major.enrollmentCode || currentSchool?.enrollmentCode}`)
? 'bg-red-50 text-red-500 border border-red-200 hover:bg-red-100' // ? 'bg-red-50 text-red-500 border border-red-200 hover:bg-red-100' //
: 'bg-white text-blue-600 border border-blue-500 hover:bg-blue-50', // : 'bg-white text-blue-600 border border-blue-500 hover:bg-blue-50', //
]" @click="toggleMajor(major)" ]" @click="toggleMajor(major)"
> >
{{ getVolunteerBtnText(major.code) }} {{ getVolunteerBtnText(major) }}
</button> </button>
</td> </td>
</tr> </tr>

View File

@ -6,6 +6,7 @@ export interface UserMajorListRequest {
batch?: string batch?: string
batch2?: string batch2?: string
probability?: string probability?: string
schoolCode?: string
} }
export interface HistoryMajorEnroll { export interface HistoryMajorEnroll {