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
4b5369f9
Commit
4b5369f9
authored
May 20, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
5b77ab4b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
212 additions
and
266 deletions
+212
-266
src/pages/drawer.vue
src/pages/drawer.vue
+170
-0
src/pages/main.vue
src/pages/main.vue
+24
-193
src/pages/tournament.vue
src/pages/tournament.vue
+0
-1
src/script/const.ts
src/script/const.ts
+4
-4
src/style/page.scss
src/style/page.scss
+14
-0
src/style/style.scss
src/style/style.scss
+0
-68
No files found.
src/pages/drawer.vue
0 → 100644
View file @
4b5369f9
<
template
>
<uni-card
class =
'Create'
>
<uni-easyinput
type =
'text'
placeholder =
'比赛名称'
v-model =
'create.name'
/>
<uni-easyinput
type =
'text'
placeholder =
'比赛描述'
v-model =
'create.description'
/>
<uni-data-select
placeholder =
'可见性'
v-model =
'create.visibility.select'
:localdata =
'create.visibility.range'
></uni-data-select>
<uni-data-select
placeholder =
'规则'
v-model =
'create.rule.select'
:localdata =
'create.rule.range'
></uni-data-select>
<view
v-show =
"create.rule.select == 'Swiss'"
>
<uni-easyinput
type =
'number'
placeholder =
'胜利分'
v-model =
'create.rule.settings.winScore'
/>
<uni-easyinput
type =
'number'
placeholder =
'平局分'
v-model =
'create.rule.settings.drawScore'
/>
<uni-easyinput
type =
'number'
placeholder =
'轮空分'
v-model =
'create.rule.settings.byeScore'
/>
</view>
<view
v-show =
"create.rule.select == 'SingleElimination'"
>
<checkbox-group
@
change =
'create.hasThirdPlaceMatch.select'
>
<label>
<checkbox
:checked =
'create.rule.settings.hasThirdPlaceMatch'
/>
季军赛
</label>
</checkbox-group>
</view>
<br>
<uni-card
id =
'collaborators'
title =
'协作者'
:is-full =
'true'
>
<uni-list>
<uni-list-chat
v-for =
'(i, v) in create.collaborators'
:avatarCircle =
'true'
:clickable =
true
:avatar =
'i.avatar'
:title =
'i.username'
:note =
"i.id >= 0 ? i.id.toString() : ''"
@
click =
'create.remove(v)'
>
<view>
<view
class =
'button'
>
<uni-icons
type =
'trash'
></uni-icons>
</view>
</view>
</uni-list-chat>
<uni-list-item>
<template
v-slot:header
>
<uni-forms>
<uni-forms-item
id =
'header'
>
<uni-easyinput
type =
'text'
placeholder =
'添加协作者'
v-model =
'create.collaborator'
/>
</uni-forms-item>
</uni-forms>
</
template
>
<
template
v-slot:footer
>
<view
id =
'footer'
>
<view
class =
'button'
:style =
"
{ '--color' : '#409eff' }"
@click = 'create.add()'
>
<uni-icons
type =
'personadd'
></uni-icons>
</view>
</view>
</
template
>
</uni-list-item>
</uni-list>
</uni-card>
<br>
<view
class =
'button'
@
click =
'create.update()'
>
<view>
<span>
创建
</span>
<uni-icons
type =
'calendar'
></uni-icons>
</view>
</view>
</uni-card>
</template>
<
script
setup
lang =
'ts'
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
,
onBeforeMount
,
watch
}
from
'
vue
'
;
import
{
TournamentFindObject
,
ruleSettings
,
UserObject
}
from
'
../script/type.ts
'
;
import
{
Tabulator
,
User
}
from
'
../script/post.ts
'
;
import
Mycard
from
'
../script/mycard.ts
'
;
import
emitter
from
'
../script/emitter.ts
'
import
{
updateTournament
,
tournamentInfo
,
tournamentReload
,
createOff
}
from
'
../script/const.ts
'
let
create
=
reactive
({
name
:
''
,
description
:
''
,
visibility
:
{
select
:
''
,
range
:
[
{
value
:
'
Public
'
,
text
:
'
公开
'
},
{
value
:
'
Internal
'
,
text
:
'
仅登陆可见
'
},
{
value
:
'
Private
'
,
text
:
'
私密
'
}
]
},
rule
:
{
select
:
''
,
settings
:
{
}
as
ruleSettings
,
range
:
[
{
value
:
'
SingleElimination
'
,
text
:
'
单淘
'
},
{
value
:
'
Swiss
'
,
text
:
'
瑞士轮
'
}
]
},
hasThirdPlaceMatch
:
{
select
:
(
e
)
=>
{
create
.
rule
.
settings
.
hasThirdPlaceMatch
=
e
.
detail
.
value
.
length
>
0
}
},
collaborator
:
''
,
collaborators
:
[]
as
Array
<
UserObject
>
,
clear
:
()
:
void
=>
{
create
.
name
=
''
;
create
.
description
=
''
;
create
.
visibility
.
select
=
''
;
create
.
rule
.
select
=
''
;
create
.
rule
.
settings
=
{}
as
ruleSettings
;
create
.
collaborators
=
[];
},
update
:
async
()
:
Promise
<
void
>
=>
{
if
(
create
.
visibility
.
select
==
''
)
// @ts-ignore
create
.
visibility
.
select
=
'
SingleElimination
'
;
const
collaborators
=
create
.
collaborators
.
map
(
user
=>
user
.
id
);
if
(
await
Tabulator
.
Tournament
.
Create
(
Mycard
.
token
,
{
name
:
create
.
name
,
description
:
create
.
description
,
rule
:
create
.
rule
.
select
,
ruleSettings
:
create
.
rule
.
settings
,
visibility
:
create
.
visibility
.
select
,
collaborators
:
collaborators
})
)
{
emitter
.
emit
(
createOff
);
create
.
clear
();
}
},
remove
:
(
v
:
number
)
:
void
=>
{
create
.
collaborators
.
splice
(
v
,
1
);
},
add
:
async
()
:
Promise
<
void
>
=>
{
try
{
if
(
create
.
collaborators
.
findIndex
(
i
=>
i
.
username
==
create
.
collaborator
)
>=
0
)
throw
new
Error
(
'
协作者已存在
'
);
const
i
=
await
User
.
Find
.
Name
(
create
.
collaborator
);
if
(
!
i
)
throw
new
Error
(
'
未搜索到此用户
'
);
if
(
Mycard
.
id
==
i
.
id
)
throw
new
Error
(
'
协作者不可以是比赛创建者
'
);
create
.
collaborators
.
push
(
i
);
}
catch
(
error
)
{
uni
.
showModal
({
title
:
'
添加失败
'
,
content
:
error
.
message
,
showCancel
:
false
});
}
finally
{
create
.
collaborator
=
''
;
}
}
});
</
script
>
\ No newline at end of file
src/pages/main.vue
View file @
4b5369f9
This diff is collapsed.
Click to expand it.
src/pages/tournament.vue
View file @
4b5369f9
...
@@ -500,7 +500,6 @@
...
@@ -500,7 +500,6 @@
<
/script
>
<
/script
>
<
style
scoped
lang
=
'
scss
'
>
<
style
scoped
lang
=
'
scss
'
>
@
import
'
../style/style.scss
'
;
@
import
'
../style/tournament.scss
'
;
@
import
'
../style/tournament.scss
'
;
@
import
'
../style/transition.scss
'
;
@
import
'
../style/transition.scss
'
;
<
/style>
<
/style>
\ No newline at end of file
src/script/const.ts
View file @
4b5369f9
const
selectTournament
=
'
selectTournament
'
;
const
updateTournament
=
'
updateTournament
'
;
const
updateTournament
=
'
updateTournament
'
;
const
tournamentInfo
=
'
tournamentInfo
'
;
const
tournamentInfo
=
'
tournamentInfo
'
;
const
tournamentExit
=
'
tournamentExit
'
;
const
tournamentReload
=
'
tournamentReload
'
;
const
tournamentReload
=
'
tournamentReload
'
const
createOff
=
'
createOff
'
;
export
{
export
{
updateTournament
,
updateTournament
,
tournamentInfo
,
tournamentInfo
,
tournamentReload
tournamentReload
,
createOff
};
};
\ No newline at end of file
src/style/page.scss
View file @
4b5369f9
...
@@ -67,4 +67,18 @@
...
@@ -67,4 +67,18 @@
cursor
:
pointer
;
cursor
:
pointer
;
}
}
}
}
button
{
background-color
:
white
;
color
:
#606266
;
border-radius
:
4px
;
white-space
:
nowrap
;
border
:
0
.02px
solid
#606266
;
transition
:
all
0
.3s
ease
;
&
:hover
{
color
:
#ecf5ff
;
background-color
:
#ecf5ff
;
border
:
0
.02px
solid
#409eff
;
}
}
}
}
src/style/style.scss
deleted
100644 → 0
View file @
5b77ab4b
$color
:
#606266
;
$background-color
:
white
;
$color-hover
:
#409eff
;
$background-color-hover
:
#ecf5ff
;
$font-size
:
1
.3vw
;
$font-family
:
Arial
,
sans-serif
;
select
,
input
,
textarea
{
font-family
:
$font-family
;
line-height
:
normal
;
font-size
:
$font-size
;
background-color
:
$background-color
;
color
:
$color
;
border
:
0
.02px
solid
$color
;
border-radius
:
8px
;
transition
:
all
0
.3s
ease
;
}
button
{
background-color
:
$background-color
;
color
:
$color
;
border-radius
:
4px
;
white-space
:
nowrap
;
border
:
0
.02px
solid
$color
;
transition
:
all
0
.3s
ease
;
&
:hover
{
color
:
$color-hover
;
background-color
:
$background-color-hover
;
border
:
0
.02px
solid
$color-hover
;
}
}
input
{
:focus
{
color
:
$color-hover
;
background-color
:
$background-color-hover
;
border
:
0
.02px
solid
$color-hover
;
}
}
select
{
&
:focus
{
color
:
$color-hover
;
border-color
:
$color-hover
;
}
}
textarea
{
:focus
{
color
:
$color-hover
;
background-color
:
$background-color-hover
;
}
}
ul
{
display
:
flex
;
list-style
:
none
;
gap
:
3%
;
font-size
:
$font-size
;
color
:
$color
;
font-family
:
$font-family
;
transition
:
all
0
.3s
ease
;
:hover
{
color
:
$color-hover
;
transform
:
scale
(
1
.2
);
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