diff --git a/src/pages/simulate.vue b/src/pages/simulate.vue index 759d6ca..fee7c29 100644 --- a/src/pages/simulate.vue +++ b/src/pages/simulate.vue @@ -4,7 +4,7 @@ import { onMounted, ref, watch } from 'vue' import { getUserMajorList, type MajorItem } from '~/service/api/major' // --- 类型定义 --- -type TabKey = 'all' | 'hard' | 'risky' | 'safe' | 'stable' | '本科' | '专科' +type TabKey = 'all' | 'hard' | 'risky' | 'safe' | 'stable' | '本科' | '专科' | '985/211/双一流' | '公办本科' | '民办本科' type PanelType = 'market' | 'my-volunteers' interface VolunteerTab { @@ -90,14 +90,40 @@ const myVolunteers = ref([ { id: '2025121427', name: '志愿2025121427', code: "1001", tags: ['手动'], probability: "80.5%", statusLabel: '保', calcScore: 450, diffScore: 250, majorName: '计算机科学与技术', requirements: '物化生', tuition: '', majorCode:'2003', planCount: 10, history: { '2025': {count: 10,minScore: 1,diff: 4,method: 'q'} } } ]) + +// 志愿Tab const volunteerCurrentTab = ref('本科') const volunteerTabs = [ { key: '本科', label: '本科', count: 1, max: 64 }, { key: '专科', label: '专科', count: 2, max: 64 }, ] as VolunteerTab[] -const currentTab = ref('stable') -const tabs = [ + +//============= Panel A 数据 + +// 批次Tab +const currentBatchTab = ref('本科') +const batchTabs = [ + { key: '本科提前', label: '本科提前批', count: 0 }, + { key: '本科', label: '本科批', count: 0 }, + { key: '高职高专', label: '高职批', count: 0 }, +] as VolunteerTab[] + +// 二级批次Tab +const currentBatch2Tab = ref('公办本科') +const batch2Tabs = [ + { key: '双一流', label: '985/211/双一流', count: 0 }, + { key: '公办本科', label: '公办本科', count: 0 }, + { key: '民办本科', label: '民办本科', count: 0 }, +] as VolunteerTab[] + + + + +// 概率Tab +const currentProbTab = ref('all') +const probTabs = [ + { key: 'all', label: '全部', count: 0 }, { key: 'safe', label: '可保底', count: 1 }, { key: 'stable', label: '较稳妥', count: 11 }, { key: 'risky', label: '可冲击', count: 11 }, @@ -106,7 +132,6 @@ const tabs = [ const oldYears = ref(['2025','2024','2023']) -// Panel A 列表数据 const schools = ref([]) const page = ref(1) const size = ref(10) @@ -126,6 +151,8 @@ const selectedMajorCodes = ref([]) // 存储已选的专业Code,数 const showSaveConfirm = ref(false) // 控制气泡确认框显示 const isSaving = ref(false) // 保存接口Loading状态 + +//============= Panel A 数据 // --- 辅助函数 --- function getProbabilityLabel(prob: number): string { if (prob >= 93) return '保' @@ -162,15 +189,17 @@ async function loadMore(reset = false) { try { // 映射 Tab 到 API 参数 let probability: string | undefined - if (currentTab.value === 'hard') probability = '难录取' - if (currentTab.value === 'risky') probability = '可冲击' - if (currentTab.value === 'stable') probability = '较稳妥' - if (currentTab.value === 'safe') probability = '可保底' - + if (currentProbTab.value === 'hard') probability = '难录取' + if (currentProbTab.value === 'risky') probability = '可冲击' + if (currentProbTab.value === 'stable') probability = '较稳妥' + if (currentProbTab.value === 'safe') probability = '可保底' + const res = await getUserMajorList({ page: page.value, size: size.value, - probability + probability, + batch: currentBatchTab.value, + batch2: currentBatch2Tab.value, }) console.warn(res) if (res && res.list && res.list.items) { @@ -179,8 +208,10 @@ async function loadMore(reset = false) { // 更新 Tabs 计数 if (res.list.probCount) { - tabs.forEach(tab => { - if (tab.key && res.list.probCount[tab.key] !== undefined) { + probTabs.forEach(tab => { + if (tab.key && tab.key == 'all'){ + tab.count = total.value + }else if (tab.key && res.list.probCount[tab.key] !== undefined) { tab.count = res.list.probCount[tab.key] } }) @@ -203,10 +234,20 @@ async function loadMore(reset = false) { } // 监听 Tab 切换,重新加载 -watch(currentTab, () => { +watch(currentBatchTab, () => { loadMore(true) }) +watch(currentBatch2Tab, () => { + loadMore(true) +}) + +watch(currentProbTab, () => { + loadMore(true) +}) + + + function handleScroll() { if (!scrollContainer.value) return @@ -525,7 +566,7 @@ function deletePlan(planId: string) { ========================================================== -->
-
+
@@ -533,19 +574,51 @@ function deletePlan(planId: string) {
+
+
+ +
+ +
+ +
+
+ +
+ diff --git a/src/service/api/major.ts b/src/service/api/major.ts index 3a0bc82..e65059c 100644 --- a/src/service/api/major.ts +++ b/src/service/api/major.ts @@ -4,6 +4,7 @@ export interface UserMajorListRequest { page?: number size?: number batch?: string + batch2?: string probability?: string }