fix: 线差计算
parent
e736e160b0
commit
8d6f16d7e2
|
|
@ -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
Loading…
Reference in New Issue