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
482e86fa
Commit
482e86fa
authored
Jun 20, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c63eddcc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
16 deletions
+63
-16
src/pages/drawer/creator.vue
src/pages/drawer/creator.vue
+6
-1
src/pages/tournament.vue
src/pages/tournament.vue
+54
-12
src/script/tournament.ts
src/script/tournament.ts
+3
-3
No files found.
src/pages/drawer/creator.vue
View file @
482e86fa
...
@@ -217,7 +217,11 @@
...
@@ -217,7 +217,11 @@
create
.
collaborator
=
''
;
create
.
collaborator
=
''
;
}
}
},
},
fromSwiss
:
(
t
:
Tournament
)
:
void
=>
{
fromSwiss
:
(
obj
:
{
t
:
Tournament
,
value
:
number
})
:
void
=>
{
const
t
=
obj
.
t
;
create
.
collaborators
=
[];
create
.
collaborators
=
[];
t
.
collaborators
.
forEach
(
async
id
=>
{
t
.
collaborators
.
forEach
(
async
id
=>
{
const
i
=
await
User
.
Find
.
Id
(
id
);
const
i
=
await
User
.
Find
.
Id
(
id
);
...
@@ -231,6 +235,7 @@
...
@@ -231,6 +235,7 @@
create
.
import
.
id
=
t
.
id
;
create
.
import
.
id
=
t
.
id
;
create
.
name
=
t
.
name
;
create
.
name
=
t
.
name
;
create
.
description
=
t
.
description
;
create
.
description
=
t
.
description
;
create
.
import
.
count
=
obj
.
value
>
0
?
obj
.
value
:
undefined
;
}
}
});
});
...
...
src/pages/tournament.vue
View file @
482e86fa
...
@@ -70,13 +70,34 @@
...
@@ -70,13 +70,34 @@
:is-full =
'true'
:is-full =
'true'
:title =
'`参与者:$
{participant.total}`'
:title =
'`参与者:$
{participant.total}`'
>
>
<view
<view
id =
'round'
>
class =
'button'
<div>
id =
'newTournament'
前
@
click =
'tournament.new()'
<uni-number-box
v-show =
"tournament.this.rule == 'Swiss' && tournament.this.status == 'Finished'"
v-model =
'participant.copyValue'
>
:min =
'0'
新建单淘赛
:max =
'participant.array.length'
v-show =
"tournament.this.status == 'Finished'"
></uni-number-box>
名
</div>
<div>
<view
class =
'button'
@
click =
'tournament.operatorChk(participant.copy)'
v-show =
"tournament.this.status == 'Finished'"
>
复制排名
</view>
<view
class =
'button'
id =
'newTournament'
@
click =
'tournament.operatorChk(tournament.new)'
v-show =
"tournament.this.rule == 'Swiss' && tournament.this.status == 'Finished'"
>
新建单淘赛
</view>
</div>
</view>
</view>
<transition
name =
'switch'
>
<transition
name =
'switch'
>
<uni-list>
<uni-list>
...
@@ -189,7 +210,7 @@
...
@@ -189,7 +210,7 @@
<
/div
>
<
/div
>
<
div
>
<
div
>
<
view
class
=
'
button
'
@
click
=
'
() => { match.round = 0;
}
'
>
全部轮次
<
/view
>
<
view
class
=
'
button
'
@
click
=
'
() => { match.round = 0;
}
'
>
全部轮次
<
/view
>
<
view
class
=
'
button
'
@
click
=
'
tournament.
copy(
)
'
>
复制对战表
<
/view
>
<
view
class
=
'
button
'
@
click
=
'
tournament.
operatorChk(tournament.copy
)
'
>
复制对战表
<
/view
>
<
/div
>
<
/div
>
<
/view
>
<
/view
>
<
transition
name
=
'
switch
'
>
<
transition
name
=
'
switch
'
>
...
@@ -350,6 +371,7 @@
...
@@ -350,6 +371,7 @@
const
id
=
url
[
1
];
const
id
=
url
[
1
];
// @ts-ignore
// @ts-ignore
const
t
:
TournamentGet
=
await
Tabulator
.
Tournament
.
Find
(
Mycard
.
token
,
id
);
const
t
:
TournamentGet
=
await
Tabulator
.
Tournament
.
Find
(
Mycard
.
token
,
id
);
console
.
log
(
t
)
if
(
t
.
tournament
)
{
if
(
t
.
tournament
)
{
tournament
.
this
=
t
.
tournament
;
tournament
.
this
=
t
.
tournament
;
const
participants
=
t
.
participant
;
const
participants
=
t
.
participant
;
...
@@ -472,7 +494,10 @@
...
@@ -472,7 +494,10 @@
}
,
}
,
new
:
()
:
void
=>
{
new
:
()
:
void
=>
{
if
(
!
tournament
.
this
)
return
;
if
(
!
tournament
.
this
)
return
;
emitter
.
emit
(
Const
.
newTournament
,
tournament
.
this
);
emitter
.
emit
(
Const
.
newTournament
,
{
t
:
tournament
.
this
,
value
:
participant
.
copyValue
}
);
}
}
}
);
}
);
...
@@ -615,7 +640,25 @@
...
@@ -615,7 +640,25 @@
if
(
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
from
,
to
))
if
(
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
from
,
to
))
await
tournament
.
search
();
await
tournament
.
search
();
}
}
}
}
,
copy
:
()
:
void
=>
{
if
(
!
tournament
.
this
)
return
;
let
string
=
`<--- ${tournament.this.name
}
- [${tournament.this.rule == 'SingleElimination' ? '淘汰赛' : '瑞士轮'
}
]${tournament.this.ruleSettings.rounds ? `
[
$
{
tournament
.
this
.
ruleSettings
.
rounds
}轮
]
` : ''
}
[${tournament.this.count ?? 0
}
人] --->\n`
;
let
copyValue
=
participant
.
copyValue
;
if
(
copyValue
==
0
)
copyValue
=
participant
.
array
.
length
;
const
map
:
Map
<
number
,
string
>
=
new
Map
([
[
0
,
'
冠军
'
],
[
1
,
'
亚军
'
],
[
2
,
'
季军
'
],
[
3
,
'
殿军
'
],
]);
for
(
let
i
=
0
;
i
<
copyValue
;
i
++
)
{
let
p
=
participant
.
array
[
i
];
string
+=
`[${map.get(i) ?? `
第
$
{
i
+
1
}名
`
}
]${p.name
}
\n`
}
UniApp
.
copy
(
string
);
}
,
copyValue
:
0
}
);
}
);
let
page
=
reactive
({
let
page
=
reactive
({
...
@@ -645,6 +688,7 @@
...
@@ -645,6 +688,7 @@
}
).
exec
();
}
).
exec
();
page
.
loading
=
true
;
page
.
loading
=
true
;
participant
.
name
=
''
;
participant
.
name
=
''
;
participant
.
copyValue
=
0
;
if
(
await
tournament
.
search
())
{
if
(
await
tournament
.
search
())
{
if
(
match
.
round
>
match
.
maxRound
)
if
(
match
.
round
>
match
.
maxRound
)
match
.
round
=
match
.
maxRound
;
match
.
round
=
match
.
maxRound
;
...
@@ -653,8 +697,6 @@
...
@@ -653,8 +697,6 @@
page
.
height
=
0
;
page
.
height
=
0
;
}
else
}
else
UniApp
.
error
(
'
请重试或检查网络设置
'
,
'
刷新失败
'
);
UniApp
.
error
(
'
请重试或检查网络设置
'
,
'
刷新失败
'
);
}
,
}
,
clickClear
:
(
e
)
:
void
=>
{
clickClear
:
(
e
)
:
void
=>
{
let
element
=
e
.
target
;
let
element
=
e
.
target
;
...
...
src/script/tournament.ts
View file @
482e86fa
...
@@ -32,9 +32,9 @@ class Tournament {
...
@@ -32,9 +32,9 @@ class Tournament {
this
.
creator
=
obj
.
creator
;
this
.
creator
=
obj
.
creator
;
this
.
createdAt
=
new
Date
(
obj
.
createdAt
);
this
.
createdAt
=
new
Date
(
obj
.
createdAt
);
this
.
count
=
obj
.
participants
.
length
;
this
.
count
=
obj
.
participants
.
length
;
if
(
!
Number
.
isNaN
(
this
.
ruleSettings
.
winScore
))
this
.
ruleSettings
.
winScore
=
3
;
if
(
Number
.
isNaN
(
this
.
ruleSettings
.
winScore
))
this
.
ruleSettings
.
winScore
=
3
;
if
(
!
Number
.
isNaN
(
this
.
ruleSettings
.
drawScore
))
this
.
ruleSettings
.
drawScore
=
1
;
if
(
Number
.
isNaN
(
this
.
ruleSettings
.
drawScore
))
this
.
ruleSettings
.
drawScore
=
1
;
if
(
!
Number
.
isNaN
(
this
.
ruleSettings
.
byeScore
))
this
.
ruleSettings
.
byeScore
=
0
;
if
(
Number
.
isNaN
(
this
.
ruleSettings
.
byeScore
))
this
.
ruleSettings
.
byeScore
=
3
;
}
}
}
}
...
...
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