Commit 790e6c06 authored by xiaoye's avatar xiaoye

增加轮次搜索

parent 6c72db9f
...@@ -119,6 +119,15 @@ ...@@ -119,6 +119,15 @@
:is-full = 'true' :is-full = 'true'
title = '比赛' title = '比赛'
> >
<view id = 'round'>
<uni-number-box
v-model = 'match.round'
:min = '1'
:disabled = "tournament.this.status == 'Ready'"
></uni-number-box>
</view>
<transition name = 'switch'> <transition name = 'switch'>
<uni-list> <uni-list>
<uni-list-item <uni-list-item
...@@ -279,6 +288,7 @@ ...@@ -279,6 +288,7 @@
array : [] as Array<Match>, array : [] as Array<Match>,
total : 0, total : 0,
page : 1, page : 1,
round : 1
}); });
let participant = reactive({ let participant = reactive({
...@@ -341,7 +351,7 @@ ...@@ -341,7 +351,7 @@
const participants : AllParticipant = await Tabulator.Participant.FindALL(Mycard.token, {tournamentId : t.id}); const participants : AllParticipant = await Tabulator.Participant.FindALL(Mycard.token, {tournamentId : t.id});
participant.array = participants.participants; participant.array = participants.participants;
participant.total = participants.total; participant.total = participants.total;
const matchs = await Tabulator.Match.FindALL(Mycard.token, {tournamentId : t.id, statusIn : 'Running,Finished'}); const matchs = await Tabulator.Match.FindALL(Mycard.token, {tournamentId : t.id, statusIn : 'Running,Finished', round : match.round});
match.array = matchs.matchs; match.array = matchs.matchs;
match.total = matchs.total; match.total = matchs.total;
} else { } else {
...@@ -363,7 +373,7 @@ ...@@ -363,7 +373,7 @@
participant.array = participants.participants; participant.array = participants.participants;
participant.total = participants.total; participant.total = participants.total;
// @ts-ignore // @ts-ignore
const matchs : AllMatch = await Tabulator.Match.FindALL(Mycard.token, {tournamentId : tournament.this.id, statusIn : 'Running,Finished'}); const matchs : AllMatch = await Tabulator.Match.FindALL(Mycard.token, {tournamentId : tournament.this.id, statusIn : 'Running,Finished', round : match.round});
match.array = matchs.matchs; match.array = matchs.matchs;
match.total = matchs.total; match.total = matchs.total;
emitter.emit(tournamentReload, tournament.this) emitter.emit(tournamentReload, tournament.this)
...@@ -384,6 +394,13 @@ ...@@ -384,6 +394,13 @@
// @ts-ignore // @ts-ignore
emitter.off(updateTournament, participant.update); emitter.off(updateTournament, participant.update);
}); });
watch(() => { return match.round; }, async () : Promise<void> => {
// @ts-ignore
const matchs = await Tabulator.Match.FindALL(Mycard.token, {tournamentId : tournament.this.id, statusIn : 'Running,Finished', round : match.round});
match.array = matchs.matchs;
match.total = matchs.total;
})
</script> </script>
<style scoped lang = 'scss'> <style scoped lang = 'scss'>
......
.PageTournament { .PageTournament {
#PageTournament { #PageTournament {
#round {
display: flex;
}
.button_list { .button_list {
display: flex; display: flex;
.button { .button {
......
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