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
faf8744b
Commit
faf8744b
authored
May 19, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
60fa8bc0
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
166 additions
and
43 deletions
+166
-43
src/pages/main.vue
src/pages/main.vue
+146
-25
src/pages/tournament.vue
src/pages/tournament.vue
+5
-6
src/script/post.ts
src/script/post.ts
+8
-3
src/script/type.ts
src/script/type.ts
+6
-9
src/style/page.scss
src/style/page.scss
+1
-0
No files found.
src/pages/main.vue
View file @
faf8744b
This diff is collapsed.
Click to expand it.
src/pages/tournament.vue
View file @
faf8744b
...
...
@@ -127,7 +127,6 @@
</uni-list-item>
<uni-list-item
v-for =
'(i, v) in match.array'
v-show =
'participant.array.findIndex(p => p.id == i.player1Id) >= 0'
:clickable =
true
>
<
template
v-slot:header
>
...
...
@@ -181,7 +180,7 @@
tournamentReload
}
from
'
../script/const.ts
'
import
Mycard
from
'
../script/mycard.ts
'
;
import
{
AllParticipant
,
AllMatch
,
Tournament
Upd
ateObject
}
from
'
../script/type.ts
'
import
{
AllParticipant
,
AllMatch
,
Tournament
Cre
ateObject
}
from
'
../script/type.ts
'
let
tournament
=
reactive
({
this
:
undefined
as
undefined
|
Tournament
,
...
...
@@ -241,7 +240,7 @@
if
(
!
res
.
confirm
)
return
;
// @ts-ignore
if
(
await
Tabulator
.
Tournament
.
Delete
(
Mycard
.
token
,
tournament
.
this
.
id
))
page
.
reload
();
page
.
clear
();
}
}
);
}
,
...
...
@@ -290,7 +289,7 @@
participant
.
total
=
participants
.
total
;
}
}
,
update
:
async
(
Data
:
Tournament
Upd
ateObject
)
:
Promise
<
void
>
=>
{
update
:
async
(
Data
:
Tournament
Cre
ateObject
)
:
Promise
<
void
>
=>
{
// @ts-ignore
if
(
await
Tabulator
.
Tournament
.
Update
(
Mycard
.
token
,
tournament
.
this
.
id
,
Data
))
page
.
reload
();
...
...
@@ -317,7 +316,7 @@
const
participants
:
AllParticipant
=
await
Tabulator
.
Participant
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
t
.
id
}
);
participant
.
array
=
participants
.
participants
;
participant
.
total
=
participants
.
total
;
const
matchs
=
await
Tabulator
.
Match
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
t
.
id
}
);
const
matchs
=
await
Tabulator
.
Match
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
t
.
id
,
statusIn
:
'
Running,Finished
'
}
);
match
.
array
=
matchs
.
matchs
;
match
.
total
=
matchs
.
total
;
}
,
...
...
@@ -336,7 +335,7 @@
participant
.
array
=
participants
.
participants
;
participant
.
total
=
participants
.
total
;
// @ts-ignore
const
matchs
:
AllMatch
=
await
Tabulator
.
Match
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
tournament
.
this
.
id
}
);
const
matchs
:
AllMatch
=
await
Tabulator
.
Match
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
tournament
.
this
.
id
,
statusIn
:
'
Running,Finished
'
}
);
match
.
array
=
matchs
.
matchs
;
match
.
total
=
matchs
.
total
;
emitter
.
emit
(
tournamentReload
,
tournament
.
this
)
...
...
src/script/post.ts
View file @
faf8744b
...
...
@@ -6,7 +6,6 @@ import ApiKey from '../script/apikey.ts';
import
{
TournamentObject
,
TournamentCreateObject
,
TournamentUpdateObject
,
TournamentFindObject
,
MatchObject
,
MatchUpdateObject
,
...
...
@@ -48,6 +47,11 @@ class TabulatorAPI {
return
response
.
data
.
data
.
id
;
}
catch
(
error
)
{
uni
.
showModal
({
title
:
'
创建失败
'
,
content
:
error
.
message
,
showCancel
:
false
})
console
.
error
(
error
);
return
-
1
;
}
...
...
@@ -136,7 +140,7 @@ class TabulatorAPI {
};
}
},
Update
:
async
(
token
:
string
,
id
:
number
,
Data
:
Tournament
Upd
ateObject
)
:
Promise
<
boolean
>
=>
{
Update
:
async
(
token
:
string
,
id
:
number
,
Data
:
Tournament
Cre
ateObject
)
:
Promise
<
boolean
>
=>
{
let
response
:
{
data
:
{
success
:
boolean
;
...
...
@@ -400,7 +404,8 @@ class TabulatorAPI {
player2Id
:
obj
.
player2Id
,
player2Score
:
obj
.
player2Score
,
winnerId
:
obj
.
winnerId
,
childMatchId
:
obj
.
childMatchId
childMatchId
:
obj
.
childMatchId
,
statusIn
:
obj
.
statusIn
},
headers
:
{
'
x-user-token
'
:
token
...
...
src/script/type.ts
View file @
faf8744b
...
...
@@ -16,6 +16,7 @@ interface MatchFindObject {
player2Score
?:
number
;
winnerId
?:
number
;
childMatchId
?:
number
;
statusIn
?:
string
}
interface
MatchUpdateObject
{
...
...
@@ -40,13 +41,6 @@ interface MatchObject extends MatchUpdateObject {
parentMatches
?:
MatchObject
;
}
interface
TournamentUpdateObject
{
name
:
string
;
description
:
string
;
visibility
:
string
;
collaborators
:
Array
<
number
>
;
}
interface
ruleSettings
{
rounds
:
number
;
winScore
:
number
;
...
...
@@ -55,7 +49,11 @@ interface ruleSettings {
hasThirdPlaceMatch
:
boolean
;
}
interface
TournamentCreateObject
extends
TournamentUpdateObject
{
interface
TournamentCreateObject
{
name
:
string
;
description
:
string
;
visibility
:
string
;
collaborators
:
Array
<
number
>
;
rule
:
string
;
ruleSettings
:
ruleSettings
;
}
...
...
@@ -152,7 +150,6 @@ export {
Score
,
TournamentObject
,
TournamentCreateObject
,
TournamentUpdateObject
,
TournamentFindObject
,
MatchObject
,
MatchUpdateObject
,
...
...
src/style/page.scss
View file @
faf8744b
...
...
@@ -52,6 +52,7 @@
justify-items
:
center
;
align-items
:
center
;
&
:hover
{
background-color
:
#e6e6e6
;
cursor
:
pointer
;
}
}
...
...
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