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
2b2711ae
Commit
2b2711ae
authored
May 29, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
0f07f6d3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
8 deletions
+57
-8
src/pages/tournament.vue
src/pages/tournament.vue
+55
-6
src/script/participant.ts
src/script/participant.ts
+1
-1
src/style/tournament.scss
src/style/tournament.scss
+1
-1
No files found.
src/pages/tournament.vue
View file @
2b2711ae
...
...
@@ -82,6 +82,24 @@
</
template
>
<
template
v-slot:footer
>
<view
id =
'footer'
>
<view
class =
'button'
id =
'deckbutton'
:style =
"
{ '--color' : 'gray' }"
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'
@click = 'tournament.operatorChk(participant.drag.down, [i])'
>
<uni-icons
type =
'down'
></uni-icons>
</view>
<view
class =
'button'
id =
'deckbutton'
...
...
@@ -102,7 +120,7 @@
<view
class =
'button'
:style =
"
{ '--color' : 'red' }"
@click = 'tournament.operatorChk(participant.del, [
v
])'
@click = 'tournament.operatorChk(participant.del, [
i
])'
v-show = '!i.quit'
>
<uni-icons
type =
'trash'
color =
'red'
></uni-icons>
...
...
@@ -375,9 +393,20 @@
}
,
upload
:
async
()
:
Promise
<
void
>
=>
{
const
f
=
async
(
res
:
UniApp
.
ChooseFileSuccessCallbackResult
)
:
Promise
<
void
>
=>
{
let
del_list
:
Array
<
Participant
>
=
[];
// @ts-ignore
res
.
tempFiles
.
forEach
(
i
=>
{
const
p
=
participant
.
array
.
filter
(
p
=>
p
.
name
==
i
.
name
.
replace
(
/
\.[^/
.
]
+$/
,
""
));
del_list
.
push
(...
p
);
}
);
// @ts-ignore
if
(
await
Tabulator
.
Tournament
.
UpdateYdk
(
Mycard
.
token
,
tournament
.
this
.
id
,
res
))
if
(
await
Tabulator
.
Tournament
.
UpdateYdk
(
Mycard
.
token
,
tournament
.
this
.
id
,
res
))
{
for
(
const
i
of
del_list
)
await
participant
.
del
(
i
);
await
participant
.
search
();
console
.
log
(
participant
.
array
)
}
}
;
await
UniApp
.
selectFile
([
'
.ydk
'
,
'
.txt
'
],
f
);
}
...
...
@@ -451,14 +480,14 @@
await
participant
.
search
();
}
}
,
del
:
async
(
v
:
number
)
:
Promise
<
void
>
=>
{
del
:
async
(
i
:
Participant
)
:
Promise
<
void
>
=>
{
const
del
=
async
()
:
Promise
<
boolean
>
=>
{
// @ts-ignore
return
await
Tabulator
.
Participant
.
Delete
(
Mycard
.
token
,
participant
.
array
[
v
]
.
id
);
return
await
Tabulator
.
Participant
.
Delete
(
Mycard
.
token
,
i
.
id
);
}
const
update
=
async
()
:
Promise
<
boolean
>
=>
{
return
await
Tabulator
.
Participant
.
Update
(
Mycard
.
token
,
participant
.
array
[
v
]
.
id
,
{
name
:
participant
.
array
[
v
]
.
name
,
return
await
Tabulator
.
Participant
.
Update
(
Mycard
.
token
,
i
.
id
,
{
name
:
i
.
name
,
quit
:
true
}
);
}
...
...
@@ -509,6 +538,26 @@
blob
:
i
.
Blob
()
}
)
}
}
,
drag
:
{
up
:
async
(
i
:
Participant
)
:
Promise
<
void
>
=>
{
console
.
log
(
'
up
'
)
const
v
=
participant
.
array
.
findIndex
(
p
=>
p
===
i
);
if
(
v
==
0
||
!
tournament
.
this
)
return
;
let
result
:
Boolean
;
if
(
v
==
1
)
result
=
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
i
.
id
,
0
);
else
result
=
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
i
.
id
,
participant
.
array
[
v
-
2
].
id
);
if
(
result
)
await
participant
.
search
();
}
,
down
:
async
(
i
:
Participant
)
:
Promise
<
void
>
=>
{
const
v
=
participant
.
array
.
findIndex
(
p
=>
p
===
i
);
if
(
v
==
participant
.
array
.
length
-
1
||
!
tournament
.
this
)
return
;
if
(
await
Tabulator
.
Tournament
.
Drag
(
Mycard
.
token
,
tournament
.
this
?.
id
,
i
.
id
,
participant
.
array
[
v
+
1
].
id
))
await
participant
.
search
();
}
}
}
);
...
...
src/script/participant.ts
View file @
2b2711ae
...
...
@@ -12,7 +12,7 @@ class Participant {
deck
:
YGOProDeck
|
undefined
;
constructor
(
obj
:
ParticipantObject
)
{
this
.
name
=
obj
.
name
;
this
.
name
=
new
TextDecoder
(
'
utf-8
'
).
decode
(
new
Uint8Array
([...
obj
.
name
].
map
(
c
=>
c
.
charCodeAt
(
0
))))
;
this
.
tournamentId
=
obj
.
tournamentId
;
this
.
id
=
obj
.
id
;
this
.
score
=
obj
.
score
;
...
...
src/style/tournament.scss
View file @
2b2711ae
...
...
@@ -63,7 +63,7 @@
justify-items
:
center
;
align-items
:
center
;
column-gap
:
10%
;
width
:
1
0%
;
width
:
2
0%
;
.button
{
border
:
0
.5px
solid
var
(
--
color
);
width
:
auto
;
...
...
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