fix: 学校省份

master
xjs 2025-06-16 16:44:01 +08:00
parent 8d6f16d7e2
commit 237c50d5ff
3 changed files with 21 additions and 9 deletions

View File

@ -23,7 +23,7 @@
<div class="flex justify-between mb-[14rpx]">
<div class="flex justify-between flex-col gap-[6rpx]">
<span class="text-[32rpx] font-semibold">{{ college.unName }}</span>
<span class="text-[22rpx] text-[#505050]">{{ college.ownership }}·{{ college.educationCategory }}</span>
<span class="text-[22rpx] text-[#505050]">{{ college.province }}·{{ college.educationCategory }}</span>
<div class="text-[22rpx] text-[#8F959E] flex items-center">
<span class="truncate max-w-[450rpx]" v-show="college.features.length > 0">{{ college.features.slice(0, 3).join("/") }}/</span>
<span>排名{{ college.rank }}</span>
@ -47,7 +47,7 @@
<div :class="`transition-all duration-300 w-full ${isCollapsed ? 'max-h-[600rpx] overflow-y-auto':''}`" v-if="isCollapsed">
<virtual-list v-model="college.vItems" data-key="major" lock-axis="x" handle=".handle-major" chosen-class="choose-item" :keeps="10" class="max-h-[600rpx]">
<template v-slot:item="{ record, index }">
<MajorItem :collegeIndex="collegeIndex" :major="record" :major-index="index" :score="score" :year="2024" v-bind="$attrs" />
<MajorItem :collegeIndex="collegeIndex" :major="record" :major-index="index" :year="2024" v-bind="$attrs" :college="college"/>
</template>
</virtual-list>
</div>

View File

@ -64,6 +64,10 @@
type: Number,
default: 0,
},
lowscoreRank: {
type: Number,
default: -1,
},
});
const myDialogRef = useTemplateRef("myDialog")
@ -82,11 +86,16 @@
const recompileData = computed(() => {
if (!props.data) return [];
let _data = props.data.map((item: any, index) => {
item["rankDiff"] = rankDiff(index, item);
item["lineDiff"] = item["score"] - props.score;
return item;
});
let _data = props.data.map((item, index) => {
item['rankDiff'] =
props.lowscoreRank !== -1
? props.lowscoreRank === 0
? '--'
: item['rankLine'] - props.lowscoreRank
: rankDiff(index, item)
item['lineDiff'] = item['score'] - props.score
return item
})
return _data;
});

View File

@ -29,7 +29,7 @@
<div class="i-carbon-trash-can" @click="handleDelete"></div>
</div>
</div>
<DataTable :data="major.planItems" :score="score" />
<DataTable :data="major.planItems" :score="college.schoolScore" :lowscoreRank="college.schoolScoreLine"/>
</div>
</div>
</template>
@ -39,10 +39,13 @@ import DataTable from './DataTable.vue';
const props = defineProps<{
major: any;
score: number;
year: number;
majorIndex: number;
collegeIndex: number;
college:{
schoolScore:number;
schoolScoreLine:number
};
}>();
const emit = defineEmits([ "delete"]);