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
19c0c0a9
Commit
19c0c0a9
authored
May 19, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
9e159479
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
121 additions
and
28 deletions
+121
-28
src/pages/main.vue
src/pages/main.vue
+52
-23
src/pages/tournament.vue
src/pages/tournament.vue
+1
-1
src/script/post.ts
src/script/post.ts
+51
-2
src/script/type.ts
src/script/type.ts
+8
-1
src/style/page.scss
src/style/page.scss
+8
-0
src/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue
...dules/uni-list/components/uni-list-chat/uni-list-chat.vue
+1
-1
No files found.
src/pages/main.vue
View file @
19c0c0a9
...
@@ -149,6 +149,29 @@
...
@@ -149,6 +149,29 @@
</checkbox-group>
</checkbox-group>
</view>
</view>
<br>
<br>
<uni-card
id =
'collaborators'
title =
'协作者'
:is-full =
'true'
>
<uni-list>
<uni-list-chat
v-for =
'(i, v) in tournament.collaborators'
:avatarCircle =
'true'
:clickable =
true
:avatar =
'i.avatar'
:title =
'i.username'
:note =
"i.id >= 0 ? i.id.toString() : ''"
>
<view>
<view
class =
'button'
>
<uni-icons
type =
'trash'
></uni-icons>
</view>
</view>
</uni-list-chat>
</uni-list>
</uni-card>
<br>
<view
class =
'button'
@
click =
'tournament.update()'
>
<view
class =
'button'
@
click =
'tournament.update()'
>
<view>
<view>
<span>
设置
</span>
<span>
设置
</span>
...
@@ -178,7 +201,6 @@
...
@@ -178,7 +201,6 @@
:localdata =
'tournament.rule.range'
:localdata =
'tournament.rule.range'
></uni-data-select>
></uni-data-select>
<view
v-show =
"create.rule.select == 'Swiss'"
>
<view
v-show =
"create.rule.select == 'Swiss'"
>
<!--
<uni-easyinput
type =
'number'
placeholder =
'轮数'
v-model =
'create.rule.settings.rounds'
/>
-->
<uni-easyinput
type =
'number'
placeholder =
'胜利分'
v-model =
'create.rule.settings.winScore'
/>
<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.drawScore'
/>
<uni-easyinput
type =
'number'
placeholder =
'轮空分'
v-model =
'create.rule.settings.byeScore'
/>
<uni-easyinput
type =
'number'
placeholder =
'轮空分'
v-model =
'create.rule.settings.byeScore'
/>
...
@@ -239,9 +261,9 @@
...
@@ -239,9 +261,9 @@
</
template
>
</
template
>
<
script
setup
lang =
'ts'
>
<
script
setup
lang =
'ts'
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
,
onBeforeMount
,
watch
}
from
'
vue
'
;
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
,
onBeforeMount
,
watch
}
from
'
vue
'
;
import
{
TournamentFindObject
,
TournamentCreateObject
,
ruleSettings
}
from
'
../script/type.ts
'
;
import
{
TournamentFindObject
,
TournamentCreateObject
,
ruleSettings
,
UserObject
}
from
'
../script/type.ts
'
;
import
Uniapp
from
'
../script/uniapp.ts
'
;
import
Uniapp
from
'
../script/uniapp.ts
'
;
import
Tabulator
from
'
../script/post.ts
'
;
import
{
Tabulator
,
User
}
from
'
../script/post.ts
'
;
import
Tournament
from
'
../script/tournament.ts
'
;
import
Tournament
from
'
../script/tournament.ts
'
;
import
ApiKey
from
'
../script/apikey.ts
'
;
import
ApiKey
from
'
../script/apikey.ts
'
;
import
Mycard
from
'
../script/mycard.ts
'
;
import
Mycard
from
'
../script/mycard.ts
'
;
...
@@ -400,8 +422,8 @@
...
@@ -400,8 +422,8 @@
tournament
.
rule
.
settings
.
hasThirdPlaceMatch
=
e
.
detail
.
value
.
length
>
0
tournament
.
rule
.
settings
.
hasThirdPlaceMatch
=
e
.
detail
.
value
.
length
>
0
}
}
},
},
collaborators
:
[]
as
Array
<
number
>
,
collaborators
:
[]
as
Array
<
UserObject
>
,
init
:
(
t
:
Tournament
)
:
void
=>
{
init
:
async
(
t
:
Tournament
)
:
Promise
<
void
>
=>
{
if
(
!
t
)
return
;
if
(
!
t
)
return
;
tournament
.
this
=
t
;
tournament
.
this
=
t
;
tournament
.
name
=
t
.
name
;
tournament
.
name
=
t
.
name
;
...
@@ -409,7 +431,12 @@
...
@@ -409,7 +431,12 @@
tournament
.
visibility
.
select
=
t
.
visibility
;
tournament
.
visibility
.
select
=
t
.
visibility
;
tournament
.
rule
.
select
=
t
.
rule
;
tournament
.
rule
.
select
=
t
.
rule
;
tournament
.
rule
.
settings
=
Object
.
assign
({},
t
.
ruleSettings
);
tournament
.
rule
.
settings
=
Object
.
assign
({},
t
.
ruleSettings
);
tournament
.
collaborators
=
t
.
collaborators
;
let
collaborators
:
Array
<
UserObject
>
=
[];
for
(
const
id
of
t
.
collaborators
)
{
const
i
=
tournament
.
collaborators
.
find
(
i
=>
i
.
id
==
id
)
??
await
User
.
Find
.
Id
(
id
);
if
(
i
)
collaborators
.
push
(
i
);
}
tournament
.
collaborators
=
collaborators
;
},
},
clear
:
()
:
void
=>
{
clear
:
()
:
void
=>
{
tournament
.
this
=
undefined
;
tournament
.
this
=
undefined
;
...
@@ -424,11 +451,13 @@
...
@@ -424,11 +451,13 @@
if
(
tournament
.
visibility
.
select
==
''
)
if
(
tournament
.
visibility
.
select
==
''
)
// @ts-ignore
// @ts-ignore
tournament
.
visibility
.
select
=
tournament
.
this
.
visibility
;
tournament
.
visibility
.
select
=
tournament
.
this
.
visibility
;
const
collaborators
=
tournament
.
collaborators
.
map
(
user
=>
user
.
id
);
emitter
.
emit
(
updateTournament
,
{
emitter
.
emit
(
updateTournament
,
{
name
:
tournament
.
name
,
name
:
tournament
.
name
,
description
:
tournament
.
description
,
description
:
tournament
.
description
,
visibility
:
tournament
.
visibility
.
select
,
visibility
:
tournament
.
visibility
.
select
,
collaborators
:
tournament
.
collaborators
,
collaborators
:
collaborators
,
rule
:
tournament
.
rule
.
select
,
rule
:
tournament
.
rule
.
select
,
ruleSettings
:
tournament
.
rule
.
settings
ruleSettings
:
tournament
.
rule
.
settings
}
as
TournamentCreateObject
);
}
as
TournamentCreateObject
);
...
@@ -483,22 +512,22 @@
...
@@ -483,22 +512,22 @@
});
});
const
test
=
async
()
=>
{
const
test
=
async
()
=>
{
let
response
=
await
Tabulator
.
Tournament
.
Create
(
Mycard
.
token
,
{
//
let response = await Tabulator.Tournament.Create(Mycard.token, {
name
:
"
test
"
,
//
name: "test",
description
:
"
暂无介绍。
"
,
//
description: "暂无介绍。",
rule
:
"
SingleElimination
"
,
//
rule: "SingleElimination",
ruleSettings
:
{
//
ruleSettings: {
rounds
:
0
,
//
rounds: 0,
winScore
:
0
,
//
winScore: 0,
drawScore
:
0
,
//
drawScore: 0,
byeScore
:
0
,
//
byeScore: 0,
hasThirdPlaceMatch
:
true
//
hasThirdPlaceMatch: true
},
//
},
visibility
:
"
Public
"
,
//
visibility: "Public",
collaborators
:
[
//
collaborators: [
1
//
1
]
//
]
});
//
});
// await Tabulator.Tournament.Delete(token, 3);
// await Tabulator.Tournament.Delete(token, 3);
// await Tabulator.Tournament.FindALL(token, {});
// await Tabulator.Tournament.FindALL(token, {});
// await Tabulator.Tournament.Update(token, 3, {
// await Tabulator.Tournament.Update(token, 3, {
...
...
src/pages/tournament.vue
View file @
19c0c0a9
...
@@ -208,7 +208,7 @@
...
@@ -208,7 +208,7 @@
<
script
setup
lang
=
'
ts
'
>
<
script
setup
lang
=
'
ts
'
>
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
,
onBeforeMount
,
watch
}
from
'
vue
'
;
import
{
ref
,
reactive
,
onMounted
,
onUnmounted
,
onBeforeMount
,
watch
}
from
'
vue
'
;
import
emitter
from
'
../script/emitter.ts
'
import
emitter
from
'
../script/emitter.ts
'
import
Tabulator
from
'
../script/post.ts
'
;
import
{
Tabulator
,
User
}
from
'
../script/post.ts
'
;
import
Tournament
from
'
../script/tournament.ts
'
;
import
Tournament
from
'
../script/tournament.ts
'
;
import
Participant
from
'
../script/participant.ts
'
;
import
Participant
from
'
../script/participant.ts
'
;
import
Match
from
'
../script/match.ts
'
;
import
Match
from
'
../script/match.ts
'
;
...
...
src/script/post.ts
View file @
19c0c0a9
...
@@ -19,7 +19,8 @@ import {
...
@@ -19,7 +19,8 @@ import {
ApiKeyFindObject
,
ApiKeyFindObject
,
AllTournament
,
AllTournament
,
AllParticipant
,
AllParticipant
,
AllMatch
AllMatch
,
UserObject
}
from
'
./type.ts
'
}
from
'
./type.ts
'
class
TabulatorAPI
{
class
TabulatorAPI
{
...
@@ -558,6 +559,54 @@ class TabulatorAPI {
...
@@ -558,6 +559,54 @@ class TabulatorAPI {
}
}
}
}
class
Users
{
url
:
AxiosInstance
;
constructor
(
url
:
string
)
{
this
.
url
=
axios
.
create
({
baseURL
:
url
});
}
Find
=
{
Name
:
async
(
name
:
string
)
:
Promise
<
UserObject
|
undefined
>
=>
{
let
response
:
{
data
:
{
user
:
UserObject
;
};
};
try
{
response
=
await
this
.
url
.
get
(
`users/
${
encodeURIComponent
(
name
)}
.json`
);
return
response
.
data
.
user
;
}
catch
(
error
)
{
console
.
error
(
error
);
return
undefined
;
}
},
Id
:
async
(
id
:
number
)
:
Promise
<
UserObject
|
undefined
>
=>
{
let
response
:
{
data
:
{
user
:
UserObject
;
};
};
try
{
response
=
await
this
.
url
.
get
(
`users/_id_
${
id
}
.json`
);
return
response
.
data
.
user
;
}
catch
(
error
)
{
console
.
error
(
error
);
return
undefined
;
}
}
}
}
const
User
=
new
Users
(
'
https://sapi.moecube.com:444/accounts
'
)
const
Tabulator
=
new
TabulatorAPI
(
'
https://api-tabulator-dev.moecube.com
'
);
const
Tabulator
=
new
TabulatorAPI
(
'
https://api-tabulator-dev.moecube.com
'
);
export
default
Tabulator
;
export
{
\ No newline at end of file
Tabulator
,
User
};
\ No newline at end of file
src/script/type.ts
View file @
19c0c0a9
...
@@ -146,6 +146,12 @@ interface AllMatch extends All {
...
@@ -146,6 +146,12 @@ interface AllMatch extends All {
matchs
:
Array
<
Match
>
;
matchs
:
Array
<
Match
>
;
}
}
interface
UserObject
{
avatar
:
string
id
:
777668
username
:
string
}
export
{
export
{
Score
,
Score
,
TournamentObject
,
TournamentObject
,
...
@@ -164,5 +170,6 @@ export {
...
@@ -164,5 +170,6 @@ export {
AllTournament
,
AllTournament
,
AllParticipant
,
AllParticipant
,
AllMatch
,
AllMatch
,
ruleSettings
ruleSettings
,
UserObject
}
}
\ No newline at end of file
src/style/page.scss
View file @
19c0c0a9
...
@@ -45,6 +45,14 @@
...
@@ -45,6 +45,14 @@
width
:
var
(
--
size
);
width
:
var
(
--
size
);
height
:
80%
;
height
:
80%
;
overflow-y
:
auto
;
overflow-y
:
auto
;
#collaborators
{
overflow-y
:
auto
;
overflow-x
:
auto
;
height
:
40vh
;
:deep
(
.uni-list-chat
)
{
width
:
200%
;
}
}
.button
{
.button
{
border
:
1px
solid
#409eff
;
border
:
1px
solid
#409eff
;
display
:
grid
;
display
:
grid
;
...
...
src/uni_modules/uni-list/components/uni-list-chat/uni-list-chat.vue
View file @
19c0c0a9
...
@@ -309,7 +309,7 @@
...
@@ -309,7 +309,7 @@
// }
// }
.uni-list-chat--hover
{
.uni-list-chat--hover
{
background-color
:
$hover
;
//
background-color: $hover;
}
}
.uni-list--border
{
.uni-list--border
{
...
...
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