fix: 线差计算

master
xjs 2025-06-11 14:09:58 +08:00
parent e736e160b0
commit 8d6f16d7e2
2 changed files with 83 additions and 52 deletions

View File

@ -0,0 +1,24 @@
import api from "@/api/customAxios";
export const useScore = (provinceCode:string, batchName:string, requireSubject:string) => {
const score = ref(0)
const minScore = ref(0)
const maxScore = ref(0)
api.get(`https://api.v3.ycymedu.com/api/busBatchBase/batch`,{ LocationCode: provinceCode, Course: requireSubject ?? '' },(resp:any)=>{
if (resp.code === 200) {
const _result = resp.result as { batches: any[]; maxScore: number; minScore: number }
if (_result.batches.length > 0) {
const _score = _result.batches.find((item) => item.batch === batchName)?.score || 0
score.value = _score
}
minScore.value = _result.minScore
maxScore.value = _result.maxScore
}
},(error:any)=>{
console.log(error);
})
return { score, minScore, maxScore }
}

File diff suppressed because one or more lines are too long