Commit b032a553 authored by xiaoye's avatar xiaoye

减少不必要的请求

parent f53fde14
Pipeline #39012 passed with stages
in 3 minutes and 7 seconds
......@@ -29,27 +29,27 @@
</view>
<br>
<view v-show = 'operatorChk()'>
<view class = 'button click' @click = 'emit.on()'>
<view class = 'button' @click = 'emit.on()'>
<span>{{ `切换状态:${status.text.get(tournament.this.status)}` }}</span>
<uni-icons type = 'circle-filled' :color = 'status.color.get(tournament.this.status)'></uni-icons>
</view>
<view class = 'button click' @click = 'emit.reset()'>
<view class = 'button' @click = 'emit.reset()'>
<span>重置比赛</span>
<uni-icons type = 'loop'></uni-icons>
</view>
<view class = 'button click' @click = 'emit.shuffle()'>
<view class = 'button' @click = 'emit.shuffle()'>
<span>打乱选手</span>
<uni-icons type = 'auth'></uni-icons>
</view>
<view class = 'button click' @click = 'emit.upload()'>
<view class = 'button' @click = 'emit.upload()'>
<span>上传选手</span>
<uni-icons type = 'cloud-upload'></uni-icons>
</view>
<view class = 'button click' @click = 'emit.empty()'>
<view class = 'button' @click = 'emit.empty()'>
<span>清空选手</span>
<uni-icons type = 'spinner-cycle' color = 'red'></uni-icons>
</view>
<view class = 'button click' @click = 'emit.del()'>
<view class = 'button' @click = 'emit.del()'>
<span>删除比赛</span>
<uni-icons type = 'trash' color = 'red'></uni-icons>
</view>
......@@ -85,7 +85,7 @@
</uni-forms>
</template>
<template v-slot:footer>
<view id = 'footer'>
<view id = 'footer'>
<view
class = 'button'
:style = "{ '--color' : '#409eff' }"
......
......@@ -458,15 +458,16 @@
let del_list : Array<Participant> = [];
// @ts-ignore
res.tempFiles.forEach(i => {
const name = i.name.replace(/\.[^/.]+$/, "");
const p = participant.array.filter(p => p.baseName == name || p.name == name);
const fileName = i.name.replace(/\.[^/.]+$/, "");
const name = fileName.split(/[\+\uFF0B]/);
const p = participant.array.filter(p => p.name == ((name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : fileName));
del_list.push(...p);
});
// @ts-ignore
if (await Tabulator.Tournament.UpdateYdk(Mycard.token, tournament.this.id, res)) {
for (const i of del_list)
await participant.del(i);
await Tabulator.Participant.Delete(Mycard.token, i.id);
await tournament.search();
}
};
......
......@@ -5,7 +5,6 @@ import { Base64 } from 'js-base64';
class Participant {
id : number;
name : string;
baseName : string;
qq : string | undefined;
quit : boolean;
tournamentId : number;
......@@ -16,7 +15,6 @@ class Participant {
constructor(obj: ParticipantObject) {
const name = obj.name.split(/[\+\uFF0B]/);
this.name = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[1] : obj.name;
this.baseName = obj.name;
this.qq = (name.length == 2 && !Number.isNaN(name[0]) && name[0].length > 3) ? name[0] : undefined;
this.tournamentId = obj.tournamentId;
this.id = obj.id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment