fix: 专业分数线

master
xjs 2025-06-13 11:13:26 +08:00
parent 63403342ba
commit 15a611d29a
2 changed files with 15 additions and 2 deletions

View File

@ -50,7 +50,11 @@
{{ checkActive(major) ? '已填报' : '填报' }}
</view>
</view>
<DataTable :data="major.items" :score="score" />
<DataTable
:data="major.items"
:score="college.lowScore"
:lowscoreRank="college.lowscoreRank"
/>
</view>
</view>
</template>

View File

@ -92,6 +92,10 @@ const props = defineProps({
type: Number,
default: 0,
},
lowscoreRank: {
type: Number,
default: -1,
},
})
const title = ref('')
@ -138,7 +142,12 @@ const rankDiff = (index: number, item) => {
const recompileData = computed(() => {
if (!props.data) return []
let _data = props.data.map((item, index) => {
item['rankDiff'] = rankDiff(index, item)
item['rankDiff'] =
props.lowscoreRank !== -1
? props.lowscoreRank === 0
? '--'
: item['rankLine'] - props.lowscoreRank
: rankDiff(index, item)
item['lineDiff'] = item['score'] - props.score
return item
})