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
6656653b
Commit
6656653b
authored
Jun 02, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加自由交换顺序
parent
2b2711ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
28 deletions
+38
-28
src/pages/tournament.vue
src/pages/tournament.vue
+38
-28
No files found.
src/pages/tournament.vue
View file @
6656653b
<
template
>
<
template
>
<view
class =
'PageTournament'
>
<view
class =
'PageTournament'
>
<!--
<Drag
v-model =
'participant.array'
></Drag>
-->
<transition
name =
'switch'
>
<transition
name =
'switch'
>
<uni-card
<uni-card
id =
'PageTournament'
id =
'PageTournament'
...
@@ -85,20 +86,11 @@
...
@@ -85,20 +86,11 @@
<view
<view
class =
'button'
class =
'button'
id =
'deckbutton'
id =
'deckbutton'
:style =
"
{ '--color' : 'gray' }"
:style =
"
{ '--color' : participant.move.this === i ? '#409eff' : 'gray', 'background-color' : participant.move.this === i ? '#e6e6e6' : 'white'}"
v-show = '!i.quit'
@click = 'tournament.operatorChk(participant.drag.up, [i])'
>
<uni-icons
type =
'up'
></uni-icons>
</view>
<view
class =
'button'
id =
'deckbutton'
:style =
"
{ '--color' : 'gray' }"
v-show = '!i.quit'
v-show = '!i.quit'
@click = 'tournament.operatorChk(participant.
drag.down, [i
])'
@click = 'tournament.operatorChk(participant.
move.start, [i, $event
])'
>
>
<uni-icons
type =
'
down
'
></uni-icons>
<uni-icons
type =
'
settings
'
></uni-icons>
</view>
</view>
<view
<view
class =
'button'
class =
'button'
...
@@ -301,7 +293,7 @@
...
@@ -301,7 +293,7 @@
import
Const
from
'
../script/const.ts
'
import
Const
from
'
../script/const.ts
'
import
Mycard
from
'
../script/mycard.ts
'
;
import
Mycard
from
'
../script/mycard.ts
'
;
import
{
TournamentCreateObject
,
MatchUpdateObject
,
TournamentAParticipant
,
ParticipantUpdateObject
}
from
'
../script/type.ts
'
import
{
TournamentCreateObject
,
MatchUpdateObject
,
TournamentAParticipant
,
ParticipantUpdateObject
}
from
'
../script/type.ts
'
import
Drag
from
'
../script/drag/drag-list.vue
'
;
let
tournament
=
reactive
({
let
tournament
=
reactive
({
this
:
undefined
as
undefined
|
Tournament
,
this
:
undefined
as
undefined
|
Tournament
,
status
:
{
status
:
{
...
@@ -540,22 +532,39 @@
...
@@ -540,22 +532,39 @@
}
}
}
,
}
,
drag
:
{
drag
:
{
up
:
async
(
i
:
Participant
)
:
Promise
<
void
>
=>
{
console
.
log
(
'
up
'
)
}
,
const
v
=
participant
.
array
.
findIndex
(
p
=>
p
===
i
);
move
:
{
if
(
v
==
0
||
!
tournament
.
this
)
return
;
this
:
undefined
as
Participant
|
undefined
,
let
result
:
Boolean
;
start
:
(
i
:
Participant
,
e
:
TouchEvent
)
:
void
=>
{
if
(
v
==
1
)
const
on
=
()
:
void
=>
{
result
=
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
i
.
id
,
0
);
participant
.
move
.
this
=
i
;
else
}
;
result
=
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
i
.
id
,
participant
.
array
[
v
-
2
].
id
);
const
end
=
async
()
:
Promise
<
void
>
=>
{
if
(
result
)
const
v1
=
participant
.
array
.
findIndex
(
p
=>
{
return
p
===
i
;
}
);
const
v2
=
participant
.
array
.
findIndex
(
p
=>
{
return
p
===
participant
.
move
.
this
;
}
);
// const p = participant.array[v1];
// participant.array[v1] = participant.move.this as Participant;
// participant.array[v2] = p;
participant
.
move
.
this
=
undefined
;
if
(
v1
-
v2
!=
1
)
{
// @ts-ignore
if
(
await
participant
.
move
.
change
(
participant
.
array
[
v1
].
id
,
v2
>=
1
?
participant
.
array
[
v2
-
1
].
id
:
0
)
&&
await
participant
.
move
.
change
(
participant
.
array
[
v2
].
id
,
v1
>=
1
?
participant
.
array
[
v1
-
1
].
id
:
0
))
await
participant
.
search
();
await
participant
.
search
();
}
else
{
const
v
=
v1
>
v2
?
v1
:
v2
;
await
participant
.
move
.
down
(
participant
.
array
[
v
-
1
].
id
,
participant
.
array
[
v
].
id
);
}
}
;
participant
.
move
.
this
?
end
()
:
on
();
}
,
change
:
async
(
from
:
number
,
to
:
number
)
:
Promise
<
void
>
=>
{
// @ts-ignore
return
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
from
,
to
);
}
,
}
,
down
:
async
(
i
:
Participant
)
:
Promise
<
void
>
=>
{
down
:
async
(
from
:
number
,
to
:
number
)
:
Promise
<
void
>
=>
{
const
v
=
participant
.
array
.
findIndex
(
p
=>
p
===
i
);
// @ts-ignore
if
(
v
==
participant
.
array
.
length
-
1
||
!
tournament
.
this
)
return
;
if
(
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
from
,
to
))
if
(
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
i
.
id
,
participant
.
array
[
v
+
1
].
id
))
await
participant
.
search
();
await
participant
.
search
();
}
}
}
}
...
@@ -635,6 +644,7 @@
...
@@ -635,6 +644,7 @@
match
.
submit
.
chk
=
match
.
array
.
map
(
i
=>
[
i
.
player1Score
??
0
,
i
.
player2Score
??
0
]);
match
.
submit
.
chk
=
match
.
array
.
map
(
i
=>
[
i
.
player1Score
??
0
,
i
.
player2Score
??
0
]);
match
.
maxRound
=
match
.
array
.
find
(
i
=>
i
.
isThirdPlaceMatch
)?.
round
??
match
.
round
+
1
;
match
.
maxRound
=
match
.
array
.
find
(
i
=>
i
.
isThirdPlaceMatch
)?.
round
??
match
.
round
+
1
;
}
,
{
deep
:
true
}
);
}
,
{
deep
:
true
}
);
<
/script
>
<
/script
>
<
style
scoped
lang
=
'
scss
'
>
<
style
scoped
lang
=
'
scss
'
>
...
...
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