Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tabulator-another-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
tabulator-another-web
Commits
9d194e19
Commit
9d194e19
authored
Jun 24, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update searcher in tournament
parent
7f023636
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
51 deletions
+75
-51
src/pages/matchTree.vue
src/pages/matchTree.vue
+6
-6
src/pages/tournament.vue
src/pages/tournament.vue
+47
-35
src/script/match.ts
src/script/match.ts
+21
-9
src/script/participant.ts
src/script/participant.ts
+1
-1
No files found.
src/pages/matchTree.vue
View file @
9d194e19
...
...
@@ -65,14 +65,14 @@
id
:
i
.
id
,
next
:
i
.
childMatchId
,
player1
:
{
id
:
i
.
player1
Id
?
i
.
player1I
d
.
toString
()
:
''
,
name
:
i
.
player1
Id
?
getName
(
i
.
player1I
d
)
:
''
,
winner
:
i
.
winnerId
?
i
.
player1
I
d
==
i
.
winnerId
:
undefined
id
:
i
.
player1
.
id
?
i
.
player1
.
i
d
.
toString
()
:
''
,
name
:
i
.
player1
.
id
?
getName
(
i
.
player1
.
i
d
)
:
''
,
winner
:
i
.
winnerId
?
i
.
player1
.
i
d
==
i
.
winnerId
:
undefined
},
player2
:
{
id
:
i
.
player2
Id
?
i
.
player2I
d
.
toString
()
:
''
,
name
:
i
.
player2
Id
?
getName
(
i
.
player2I
d
)
:
''
,
winner
:
i
.
winnerId
?
i
.
player2
I
d
==
i
.
winnerId
:
undefined
id
:
i
.
player2
.
id
?
i
.
player2
.
i
d
.
toString
()
:
''
,
name
:
i
.
player2
.
id
?
getName
(
i
.
player2
.
i
d
)
:
''
,
winner
:
i
.
winnerId
?
i
.
player2
.
i
d
==
i
.
winnerId
:
undefined
}
});
});
...
...
src/pages/tournament.vue
View file @
9d194e19
...
...
@@ -97,6 +97,9 @@
</view>
</div>
</view>
<view>
<uni-easyinput
type =
'text'
placeholder =
'搜索选手'
v-model =
'searcher.participant'
></uni-easyinput>
</view>
<transition
name =
'switch'
>
<uni-list>
<uni-list-item
...
...
@@ -105,9 +108,9 @@
>
</uni-list-item>
<uni-list-item
v-for =
'(i, v) in participant.array.slice((participant.page - 1) * 20, participant.page * 20)'
:title =
"i.score && match.array.findIndex(m => (m.status == 'Finished' || m.status == 'Abandoned') && (m.player1
Id == i.id || m.player2I
d == i.id)) > -1 ? `胜平负:$
{i.score.win + i.score.bye}-${i.score.draw}-${i.score.lose}` : ''"
:note = "i.score
&&
match.array.findIndex(m => (m.status == 'Finished' || m.status == 'Abandoned')
&&
(m.player1
Id == i.id || m.player2I
d == i.id)) > -1 ? `分数:${i.score.score}\n小分:${i.score.tieBreaker}` : ''"
v-for =
'(i, v) in participant.array.
filter(i => searcher.filterParticipant(i)).
slice((participant.page - 1) * 20, participant.page * 20)'
:title =
"i.score && match.array.findIndex(m => (m.status == 'Finished' || m.status == 'Abandoned') && (m.player1
.id == i.id || m.player2.i
d == i.id)) > -1 ? `胜平负:$
{i.score.win + i.score.bye}-${i.score.draw}-${i.score.lose}` : ''"
:note = "i.score
&&
match.array.findIndex(m => (m.status == 'Finished' || m.status == 'Abandoned')
&&
(m.player1
.id == i.id || m.player2.i
d == i.id)) > -1 ? `分数:${i.score.score}\n小分:${i.score.tieBreaker}` : ''"
:clickable = true
>
<template
v-slot:header
>
...
...
@@ -191,7 +194,7 @@
:
current
=
'
participant.page
'
v
-
model
=
'
participant.page
'
pageSize
=
20
:
total
=
'
participant.total
'
:
total
=
'
searcher.participant ? participant.array.filter(i => searcher.filterParticipant(i)).length :
participant.total
'
>
<
/uni-pagination
>
<
/uni-card
>
...
...
@@ -219,6 +222,9 @@
<
view
class
=
'
button
'
@
click
=
'
tournament.operatorChk(tournament.copy)
'
>
复制对战表
<
/view
>
<
/div
>
<
/view
>
<
view
>
<
uni
-
easyinput
type
=
'
text
'
placeholder
=
'
搜索比赛
'
v
-
model
=
'
searcher.match
'
><
/uni-easyinput
>
<
/view
>
<
transition
name
=
'
switch
'
>
<
uni
-
list
>
<
uni
-
list
-
item
...
...
@@ -227,7 +233,7 @@
>
<
/uni-list-item
>
<
view
v
-
for
=
'
i in
(match.round == 0) ? match.array.slice((match.page - 1) * 20, match.page * 20) : match.array.filter(m => m.round == match.round
).slice((match.page - 1) * 20, match.page * 20)
'
v
-
for
=
'
i in
match.array.filter(i => searcher.filterMatch(i)
).slice((match.page - 1) * 20, match.page * 20)
'
>
<
view
class
=
'
match
'
...
...
@@ -237,7 +243,7 @@
<
uni
-
easyinput
:
clearable
=
'
false
'
type
=
'
number
'
:
placeholder
=
'
participant.array.find(p => p.id == i.player1Id)?
.name
'
:
placeholder
=
'
i.player1
.name
'
v
-
model
=
'
match.submit.chk[match.array.findIndex(m => m === i)][0]
'
:
disabled
=
"
i.status != 'Running'
"
><
/uni-easyinput
>
...
...
@@ -247,7 +253,7 @@
<
uni
-
easyinput
:
clearable
=
'
false
'
type
=
'
number
'
:
placeholder
=
'
participant.array.find(p => p.id == i.player2Id)?
.name
'
:
placeholder
=
'
i.player2
.name
'
v
-
model
=
'
match.submit.chk[match.array.findIndex(m => m === i)][1]
'
:
disabled
=
"
i.status != 'Running'
"
><
/uni-easyinput
>
...
...
@@ -263,22 +269,18 @@
<
view
id
=
'
body
'
>
<
view
id
=
'
left
'
>
<
span
:
class
=
"
{ 'winner': i.winnerId == i.player1
I
d
}
"
>
{{
participant
.
array
.
find
(
p
=>
p
.
id
==
i
.
player1Id
)?
.
name
}}
<
/span
>
:
class
=
"
{ 'winner': i.winnerId == i.player1
.i
d
}
"
>
{{
i
.
player1
.
name
}}
<
/span
>
<
br
>
<
span
v
-
if
=
'
// @ts-ignore
participant.array.find(p => p.id == i.player1Id) && participant.array.find(p => p.id == i.player1Id).score
'
>
<
span
v
-
if
=
'
participant.array.find(p => p.id == i.player1.id)?.score
'
>
{{
`${
// @ts-ignore
participant.array.find(p => p.id == i.player1
Id)?.score.win + participant.array.find(p => p.id == i.player1I
d)?.score.bye
participant.array.find(p => p.id == i.player1
.id)?.score.win + participant.array.find(p => p.id == i.player1.i
d)?.score.bye
}
-${
participant.array.find(p => p.id == i.player1
I
d)?.score.draw
participant.array.find(p => p.id == i.player1
.i
d)?.score.draw
}
-${
participant.array.find(p => p.id == i.player1
I
d)?.score.lose
participant.array.find(p => p.id == i.player1
.i
d)?.score.lose
}
`
}}
<
/span
>
...
...
@@ -291,21 +293,18 @@
<
/view
>
<
view
id
=
'
right
'
>
<
span
:
class
=
"
{ 'winner': i.winnerId == i.player2
I
d
}
"
>
{{
participant
.
array
.
find
(
p
=>
p
.
id
==
i
.
player2Id
)?
.
name
}}
<
/span
>
:
class
=
"
{ 'winner': i.winnerId == i.player2
.i
d
}
"
>
{{
i
.
player2
.
name
}}
<
/span
>
<
br
>
<
span
v
-
if
=
'
// @ts-ignore
participant.array.find(p => p.id == i.player2Id) && participant.array.find(p => p.id == i.player2Id).score
'
>
<
span
v
-
if
=
'
participant.array.find(p => p.id == i.player2.id)?.score
'
>
{{
`${
// @ts-ignore
participant.array.find(p => p.id == i.player2
Id)?.score.win + participant.array.find(p => p.id == i.player2I
d)?.score.bye
participant.array.find(p => p.id == i.player2
.id)?.score.win + participant.array.find(p => p.id == i.player2.i
d)?.score.bye
}
-${
participant.array.find(p => p.id == i.player2
I
d)?.score.draw
participant.array.find(p => p.id == i.player2
.i
d)?.score.draw
}
-${
participant.array.find(p => p.id == i.player2
I
d)?.score.lose
participant.array.find(p => p.id == i.player2
.i
d)?.score.lose
}
`
}}
<
/span
>
...
...
@@ -325,7 +324,7 @@
:
current
=
'
match.page
'
v
-
model
=
'
match.page
'
pageSize
=
20
:
total
=
'
(match.round == 0) ? match.total : match.array.filter(m => m.round == match.round
).length
'
:
total
=
'
match.array.filter(i => searcher.filterMatch(i)
).length
'
>
<
/uni-pagination
>
<
/uni-card
>
...
...
@@ -486,11 +485,11 @@
if
(
match
.
round
>
0
&&
match
.
round
!=
round
)
continue
;
string
+=
`---------------------------------------------\n第[ ${round
}
]轮对决战况表\n---------------------------------------------\n`
match
.
array
.
filter
(
i
=>
i
.
round
==
round
).
forEach
((
i
,
v
)
=>
{
if
(
i
.
player1
Id
||
i
.
player2I
d
)
{
if
(
i
.
player1
.
id
||
i
.
player2
.
i
d
)
{
string
+=
`[${v + 1
}
]组\n`
;
string
+=
`\t[选手A][${
participant.array.find(p => p.id == i.player1Id)?
.name ?? ''
}
]\n`
;
string
+=
`\t[比 分][${i.status == 'Finished' ? `
$
{
i
.
player1
Score
}
:
$
{
i
.
player2S
core
}
` : 'VS'
}
]\n`
;
string
+=
`\t[选手B][${
participant.array.find(p => p.id == i.player2Id)?
.name ?? ''
}
]\n`
;
string
+=
`\t[选手A][${
i.player1
.name ?? ''
}
]\n`
;
string
+=
`\t[比 分][${i.status == 'Finished' ? `
$
{
i
.
player1
.
score
}
:
$
{
i
.
player2
.
s
core
}
` : 'VS'
}
]\n`
;
string
+=
`\t[选手B][${
i.player2
.name ?? ''
}
]\n`
;
}
}
);
}
...
...
@@ -524,7 +523,7 @@
show
:
(
i
:
Match
)
:
void
=>
{
match
.
submit
.
page
=
match
.
submit
.
page
===
i
?
undefined
:
i
;
if
(
!
match
.
submit
.
page
)
match
.
submit
.
chk
=
match
.
array
.
map
(
i
=>
[
i
.
player1
Score
??
0
,
i
.
player2S
core
??
0
]);
match
.
submit
.
chk
=
match
.
array
.
map
(
i
=>
[
i
.
player1
.
score
??
0
,
i
.
player2
.
s
core
??
0
]);
}
,
on
:
async
(
i
:
Match
)
:
Promise
<
void
>
=>
{
const
v
=
match
.
array
.
findIndex
(
m
=>
m
===
i
);
...
...
@@ -532,7 +531,7 @@
case
'
Running
'
:
const
player1
:
number
=
match
.
submit
.
chk
[
v
][
0
]
??
0
;
const
player2
:
number
=
match
.
submit
.
chk
[
v
][
1
]
??
0
;
const
id
:
null
|
number
=
player1
>
player2
?
i
.
player1
Id
:
player1
==
player2
?
null
:
i
.
player2Id
const
id
:
null
|
number
=
player1
>
player2
?
i
.
player1
.
id
:
player1
==
player2
?
null
:
i
.
player2
.
id
;
// @ts-ignore
if
(
await
Tabulator
.
Match
.
Update
(
Mycard
.
token
,
i
.
id
,
{
player1Score
:
player1
,
...
...
@@ -718,13 +717,26 @@
element
=
element
.
parentElement
;
}
match
.
submit
.
page
=
undefined
;
match
.
submit
.
chk
=
match
.
array
.
map
(
i
=>
[
i
.
player1
Score
??
0
,
i
.
player2S
core
??
0
]);
match
.
submit
.
chk
=
match
.
array
.
map
(
i
=>
[
i
.
player1
.
score
??
0
,
i
.
player2
.
s
core
??
0
]);
}
,
copyUrl
:
()
=>
{
UniApp
.
copy
(
`${window.location.href.split('/?')[0]
}
`
);
}
}
);
let
searcher
=
reactive
({
participant
:
''
,
match
:
''
,
filterMatch
:
(
i
:
Match
)
:
boolean
=>
{
if
((
i
.
round
!=
match
.
round
&&
match
.
round
!=
0
)
||
(
i
.
status
==
'
Abandoned
'
&&
!
i
.
player1
.
name
||
!
i
.
player2
.
name
))
return
false
;
return
searcher
.
match
?
i
.
player1
.
name
.
toUpperCase
().
includes
(
searcher
.
match
.
toUpperCase
())
||
i
.
player2
.
name
.
toUpperCase
().
includes
(
searcher
.
match
.
toUpperCase
())
:
true
;
}
,
filterParticipant
:
(
i
:
Participant
)
:
boolean
=>
{
return
searcher
.
participant
?
i
.
name
.
toUpperCase
().
includes
(
searcher
.
participant
.
toUpperCase
())
:
true
;
}
}
);
let
creator
=
reactive
({
name
:
''
,
avatar
:
''
...
...
@@ -755,7 +767,7 @@
}
);
watch
(()
=>
{
return
match
.
array
;
}
,
async
()
:
Promise
<
void
>
=>
{
match
.
submit
.
chk
=
match
.
array
.
map
(
i
=>
[
i
.
player1
Score
??
0
,
i
.
player2S
core
??
0
]);
match
.
submit
.
chk
=
match
.
array
.
map
(
i
=>
[
i
.
player1
.
score
??
0
,
i
.
player2
.
s
core
??
0
]);
if
(
match
.
array
.
length
>
0
)
match
.
maxRound
=
match
.
array
.
reduce
((
a
,
b
)
=>
(
a
.
round
>
b
.
round
)
?
a
:
b
)?.
round
??
0
;
else
match
.
maxRound
=
0
;
...
...
src/script/match.ts
View file @
9d194e19
import
{
MatchObject
}
from
'
./type.ts
'
;
import
Participant
from
'
./participant.ts
'
import
Participant
from
'
./participant.ts
'
;
interface
player
{
id
:
number
;
score
:
number
;
name
:
string
;
}
class
Match
{
id
:
number
;
...
...
@@ -7,10 +13,8 @@ class Match {
round
:
number
;
isThirdPlaceMatch
:
boolean
;
status
:
string
;
player1Score
:
number
;
player2Score
:
number
;
player1Id
:
number
;
player2Id
:
number
;
player1
:
player
;
player2
:
player
;
winnerId
:
number
|
null
;
childMatchId
:
number
;
...
...
@@ -20,10 +24,18 @@ class Match {
this
.
round
=
obj
.
round
;
this
.
isThirdPlaceMatch
=
obj
.
isThirdPlaceMatch
;
this
.
status
=
obj
.
status
;
this
.
player1Id
=
obj
.
player1Id
;
this
.
player2Id
=
obj
.
player2Id
;
this
.
player1Score
=
obj
.
player1Score
;
this
.
player2Score
=
obj
.
player2Score
;
const
name1
=
obj
.
player1
?.
name
.
split
(
'
+
'
)
??
[];
this
.
player1
=
{
id
:
obj
.
player1Id
,
name
:
(
name1
.
length
==
2
&&
!
Number
.
isNaN
(
name1
[
0
])
&&
name1
[
0
].
length
>
3
)
?
name1
[
1
]
:
obj
.
player1
?.
name
??
''
,
score
:
obj
.
player1Score
};
const
name2
=
obj
.
player2
?.
name
.
split
(
'
+
'
)
??
[];
this
.
player2
=
{
id
:
obj
.
player2Id
,
name
:
(
name2
.
length
==
2
&&
!
Number
.
isNaN
(
name2
[
0
])
&&
name2
[
0
].
length
>
3
)
?
name2
[
1
]
:
obj
.
player2
?.
name
??
''
,
score
:
obj
.
player2Score
};
this
.
winnerId
=
obj
.
winnerId
as
number
|
null
;
this
.
childMatchId
=
obj
.
childMatchId
;
}
...
...
src/script/participant.ts
View file @
9d194e19
...
...
@@ -12,7 +12,7 @@ class Participant {
deck
:
YGOProDeck
|
undefined
;
constructor
(
obj
:
ParticipantObject
)
{
const
name
=
obj
.
name
.
split
(
'
+
'
)
const
name
=
obj
.
name
.
split
(
'
+
'
)
;
this
.
name
=
(
name
.
length
==
2
&&
!
Number
.
isNaN
(
name
[
0
])
&&
name
[
0
].
length
>
3
)
?
name
[
1
]
:
obj
.
name
;
this
.
tournamentId
=
obj
.
tournamentId
;
this
.
id
=
obj
.
id
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment