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
0f07f6d3
Commit
0f07f6d3
authored
May 28, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打乱选手
parent
25ca965e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
src/pages/tournament.vue
src/pages/tournament.vue
+16
-0
src/script/post.ts
src/script/post.ts
+41
-0
No files found.
src/pages/tournament.vue
View file @
0f07f6d3
...
@@ -39,6 +39,10 @@
...
@@ -39,6 +39,10 @@
<span>
重置
</span>
<span>
重置
</span>
<uni-icons
type =
'loop'
></uni-icons>
<uni-icons
type =
'loop'
></uni-icons>
</view>
</view>
<view
class =
'button click'
@
click =
'tournament.operatorChk(tournament.shuffle)'
>
<span>
打乱
</span>
<uni-icons
type =
'loop'
></uni-icons>
</view>
<view
class =
'button click'
@
click =
'tournament.operatorChk(tournament.upload)'
>
<view
class =
'button click'
@
click =
'tournament.operatorChk(tournament.upload)'
>
<span>
上传
</span>
<span>
上传
</span>
<uni-icons
type =
'cloud-upload'
></uni-icons>
<uni-icons
type =
'cloud-upload'
></uni-icons>
...
@@ -347,6 +351,18 @@
...
@@ -347,6 +351,18 @@
}
}
}
);
}
);
}
,
}
,
shuffle
:
()
:
void
=>
{
if
(
tournament
.
this
?.
status
!=
'
Ready
'
)
return
;
uni
.
showModal
({
title
:
'
确认要打乱次序吗?
'
,
success
:
async
(
res
:
UniApp
.
ShowModalRes
)
:
Promise
<
void
>
=>
{
if
(
!
res
.
confirm
)
return
;
// @ts-ignore
if
(
await
Tabulator
.
Tournament
.
Shuffle
(
Mycard
.
token
,
tournament
.
this
.
id
))
participant
.
search
();
}
}
);
}
,
operatorChk
:
(
f
:
Function
,
para
:
Array
<
any
>
=
[])
:
void
=>
{
operatorChk
:
(
f
:
Function
,
para
:
Array
<
any
>
=
[])
:
void
=>
{
if
(
Mycard
.
id
>=
0
&&
(
Mycard
.
id
==
tournament
.
this
?.
creator
||
tournament
.
this
?.
collaborators
.
includes
(
Mycard
.
id
)))
if
(
Mycard
.
id
>=
0
&&
(
Mycard
.
id
==
tournament
.
this
?.
creator
||
tournament
.
this
?.
collaborators
.
includes
(
Mycard
.
id
)))
f
(...
para
);
f
(...
para
);
...
...
src/script/post.ts
View file @
0f07f6d3
...
@@ -257,6 +257,47 @@ class TabulatorAPI {
...
@@ -257,6 +257,47 @@ class TabulatorAPI {
console
.
error
(
error
);
console
.
error
(
error
);
return
false
;
return
false
;
}
}
},
Shuffle
:
async
(
token
:
string
,
id
:
number
)
:
Promise
<
Boolean
>
=>
{
let
response
:
{
data
:
{
success
:
boolean
;
}
};
try
{
response
=
await
this
.
url
.
post
(
`/api/tournament/
${
id
}
/shuffle-participants`
,
{},
{
headers
:
{
'
x-user-token
'
:
token
}
});
return
response
.
data
.
success
;
}
catch
(
error
)
{
console
.
error
(
error
);
return
false
;
}
},
Drag
:
async
(
token
:
string
,
id
:
number
,
from
:
number
,
to
:
number
)
:
Promise
<
Boolean
>
=>
{
let
response
:
{
data
:
{
success
:
boolean
;
}
};
try
{
response
=
await
this
.
url
.
post
(
`/api/tournament/
${
id
}
/drag-participant`
,
{
draggingParticipantId
:
from
,
placeAfterParticipantId
:
to
},
{
headers
:
{
'
x-user-token
'
:
token
}
});
return
response
.
data
.
success
;
}
catch
(
error
)
{
console
.
error
(
error
);
return
false
;
}
}
}
}
}
Participant
=
{
Participant
=
{
...
...
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