fix: 位次差计算

master
DavidMorgan 2026-04-18 10:57:34 +08:00
parent a3d913dadd
commit 9a622dd6e3
3 changed files with 1604 additions and 1913 deletions

File diff suppressed because it is too large Load Diff

View File

@ -81,7 +81,8 @@
]); ]);
const rankDiff = (index: number, item: any) => { const rankDiff = (index: number, item: any) => {
return index === props.data.length - 1 ? item["rankLine"] !== '--' && props.data[index + 1]["rankLine"] !== '--' ? item["rankLine"] - props.data[index + 1]["rankLine"] : '--' : '--'; if(typeof props.data[index + 1] === 'undefined') return '--';
return index === props.data.length - 1 ? item["rankLine"] !== '--' ? item["rankLine"] - props.data[index + 1]["rankLine"] : '--' : '--';
}; };
const recompileData = computed(() => { const recompileData = computed(() => {
@ -91,7 +92,9 @@
props.lowscoreRank !== -1 props.lowscoreRank !== -1
? props.lowscoreRank === 0 ? props.lowscoreRank === 0
? '--' ? '--'
: item['rankLine'] - props.lowscoreRank : item['rankLine'] != '--'
? item['rankLine'] - props.lowscoreRank
: '--'
: rankDiff(index, item) : rankDiff(index, item)
item['lineDiff'] = item['score'] !== '--' ? item['score'] - props.score : '--' item['lineDiff'] = item['score'] !== '--' ? item['score'] - props.score : '--'
return item return item

View File

@ -47,7 +47,6 @@ export default defineConfig({
}, },
server: { server: {
host: "localhost", host: "localhost",
port: 3001,
proxy:{ proxy:{
'/api':{ '/api':{
target:'http://192.168.31.149:5006', target:'http://192.168.31.149:5006',