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
d3e9eefb
Commit
d3e9eefb
authored
May 15, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
9f836d6b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
19 deletions
+58
-19
src/pages/main.vue
src/pages/main.vue
+6
-6
src/pages/tournament.vue
src/pages/tournament.vue
+37
-4
src/script/match.ts
src/script/match.ts
+0
-7
src/style/page.scss
src/style/page.scss
+2
-2
src/style/tournament.scss
src/style/tournament.scss
+13
-0
No files found.
src/pages/main.vue
View file @
d3e9eefb
...
...
@@ -2,7 +2,7 @@
<view
id =
'page'
>
<view
id =
'head'
>
<view>
<button
id =
'search_button'
class =
'
click'
@
click =
'page.show.search()'
>
<button
class =
'button
click'
@
click =
'page.show.search()'
>
<uni-icons
class =
'click'
:type =
"page.search ? 'left' : 'search'"
></uni-icons>
</button>
</view>
...
...
@@ -93,7 +93,7 @@
>
</uni-data-select>
<br>
<view
id =
'search_button'
class =
'
click'
@
click =
'search.on()'
>
<view
class =
'button
click'
@
click =
'search.on()'
>
<view
class =
'click'
>
<span
class =
'click'
>
搜索
</span>
<uni-icons
class =
'click'
type =
'search'
></uni-icons>
...
...
@@ -153,13 +153,13 @@
import
{
selectTournament
}
from
'
../script/const.ts
'
import
PageTournament
from
'
./tournament.vue
'
;
const
token
=
'
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Nzc3NjY4LCJpYXQiOjE3NDUzODcwNDksImV4cCI6MTc3NjkyMzA0OX0.pyyGtE_WjU8qtz1r2NKbe3jufsYW1PCk6wnczxuMHmM
'
let
page
=
reactive
({
user
:
false
,
search
:
false
,
menu
:
true
,
tournament
:
false
,
// menu : true,
// tournament : false,
menu
:
false
,
tournament
:
true
,
show
:
{
user
:
()
:
void
=>
{
page
.
user
=
!
page
.
user
;
...
...
src/pages/tournament.vue
View file @
d3e9eefb
<
template
>
<view
class =
'PageTournament'
>
<uni-card
<
!--
<
uni-card
v-if =
'tournament.tournament'
:is-full =
'true'
:title =
'tournament.tournament.name'
:sub-title =
'tournament.tournament.description'
:extra =
'tournament.tournament.createdAt.toLocaleDateString()'
>
>
-->
<uni-card>
<uni-forms>
<uni-forms-item>
<uni-easyinput
type =
'text'
placeholder =
'添加选手'
v-model =
'participant.name'
/>
</uni-forms-item>
<view
class =
'button'
@
click =
'participant.add()'
>
<uni-icons
type =
'personadd'
></uni-icons>
</view>
<!--
<view
class =
'button'
@
click =
'participant.add()'
>
<uni-icons
type =
'personadd'
></uni-icons>
</view>
-->
</uni-forms>
<br>
<uni-card
:is-full =
'true'
title =
'参与者'
...
...
@@ -32,12 +45,15 @@
>
<template
v-slot:header
>
{{
i
.
player1Id
}}
<br>
{{
i
.
player1Score
}}
</
template
>
<
template
v-slot:body
>
{{
i
.
player1Id
}}
</
template
>
<
template
v-slot:footer
>
{{
i
.
player2Id
}}
<br>
{{
i
.
player2Score
}}
</
template
>
</uni-list-item>
</uni-list>
...
...
@@ -66,6 +82,18 @@
}
});
let
participant
=
reactive
({
add
:
async
()
:
Promise
<
void
>
=>
{
// @ts-ignore
if
(
await
Tabulator
.
Participant
.
Create
(
Mycard
.
token
,
{
name
:
participant
.
name
,
tournamentId
:
tournament
.
tournament
.
id
}))
{
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
500
)));
// @ts-ignore
tournament
.
participants
=
await
Tabulator
.
Participant
.
FindALL
(
Mycard
.
token
,
{
tournamentId
:
tournament
.
tournament
.
id
});
}
},
name
:
''
});
onMounted
(()
=>
{
// @ts-ignore
emitter
.
on
(
selectTournament
,
tournament
.
get
);
...
...
@@ -75,4 +103,9 @@
// @ts-ignore
emitter
.
off
(
selectTournament
,
tournament
.
get
);
});
</
script
>
\ No newline at end of file
</
script
>
<
style
scoped
lang =
'scss'
>
@import
'../style/style.scss'
;
@import
'../style/tournament.scss'
;
</
style
>
\ No newline at end of file
src/script/match.ts
View file @
d3e9eefb
...
...
@@ -13,8 +13,6 @@ class Match {
player2Id
:
number
;
winnerId
:
number
;
childMatchId
:
number
;
player1
:
Participant
;
player2
:
Participant
;
constructor
(
obj
:
MatchObject
)
{
this
.
id
=
obj
.
id
;
...
...
@@ -29,11 +27,6 @@ class Match {
this
.
winnerId
=
obj
.
winnerId
;
this
.
childMatchId
=
obj
.
childMatchId
;
}
pushPlayer
=
(
t
:
Array
<
Participant
>
)
:
void
=>
{
this
.
player1
=
t
.
find
(
i
=>
i
.
id
==
this
.
player1Id
)
as
Participant
;
this
.
player2
=
t
.
find
(
i
=>
i
.
id
==
this
.
player2Id
)
as
Participant
;
};
}
...
...
src/style/page.scss
View file @
d3e9eefb
...
...
@@ -11,7 +11,7 @@
cursor
:
pointer
;
}
}
#search_
button
{
.
button
{
width
:
30%
;
}
}
...
...
@@ -45,7 +45,7 @@
width
:
var
(
--
size
);
height
:
80%
;
overflow-y
:
auto
;
#search_
button
{
.
button
{
border
:
1px
solid
#409eff
;
display
:
grid
;
justify-content
:
center
;
...
...
src/style/tournament.scss
0 → 100644
View file @
d3e9eefb
.PageTournament
{
:deep
(
.uni-forms
)
{
.button
{
border
:
1px
solid
#409eff
;
display
:
flex
;
width
:
10%
;
justify-content
:
center
;
&
:hover
{
cursor
:
pointer
;
}
}
}
}
\ No newline at end of file
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