Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
micro_app
gk
Commits
33d20340
Commit
33d20340
authored
Jul 24, 2025
by
daniel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(gunRule): 新增组别统计数
parent
e774f176
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
3 deletions
+36
-3
gunRule.jsp
src/main/webapp/WEB-INF/views/cmpt/gunRule.jsp
+36
-3
No files found.
src/main/webapp/WEB-INF/views/cmpt/gunRule.jsp
View file @
33d20340
...
@@ -140,8 +140,15 @@
...
@@ -140,8 +140,15 @@
<
/n-button
>
<
/n-button
>
<
/div
>
<
/div
>
<
div
v
-
for
=
"(item,index) in gunRules"
:
key
=
"item.value"
class
=
"flex rounded-sm cursor-pointer flex-row items-center gap-x-1"
>
<
div
v
-
for
=
"(item,index) in gunRules"
:
key
=
"item.value"
class
=
"flex rounded-sm cursor-pointer flex-row items-center gap-x-1"
>
<
span
class
=
"py-1 px-4 rounded-sm line-clamp-1 animate-fade-in"
:
class
=
"[ruleIndex===index?'bg-primary text-white':'']"
class
=
"flex-1"
@
click
=
"changeGunRule(index)"
>
{{
item
.
roadName
}}
<!--
<
span
class
=
"py-1 px-4 rounded-sm line-clamp-1 animate-fade-in"
:
class
=
"[ruleIndex===index?'bg-primary text-white':'']"
class
=
"flex-1"
@
click
=
"changeGunRule(index)"
>
<
/span
>
{{
item
.
roadName
}}
<
/span> --
>
<
n
-
tag
class
=
"flex-1"
round
:
bordered
=
"false"
@
click
=
"changeGunRule(index)"
:
type
=
"ruleIndex===index?'success':''"
>
{{
item
.
roadName
}}
<
/n-tag
>
<
n
-
tag
type
=
"success"
size
=
"small"
round
>
{{
item
.
totalApply
}}
/{{item.totalPlayer}
}
<
/n-tag
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"flex-1 flex flex-col gap-y-3"
>
<
div
class
=
"flex-1 flex flex-col gap-y-3"
>
...
@@ -205,6 +212,7 @@
...
@@ -205,6 +212,7 @@
label
-
placement
=
"left"
label
-
placement
=
"left"
label
-
width
=
"auto"
label
-
width
=
"auto"
size
=
"small"
size
=
"small"
:
disabled
=
"loading"
>
>
<
n
-
form
-
item
label
=
"组别名称"
path
=
"roadName"
>
<
n
-
form
-
item
label
=
"组别名称"
path
=
"roadName"
>
<
div
class
=
"flex flex-col"
>
<
div
class
=
"flex flex-col"
>
...
@@ -942,14 +950,39 @@
...
@@ -942,14 +950,39 @@
'Content-Type'
:
'application/json'
'Content-Type'
:
'application/json'
},
},
}).
then
(
res
=>
res
.
json
()))
}).
then
(
res
=>
res
.
json
()))
loading
.
value
=
false
loading
.
value
=
false
if
(
err
)
{
if
(
err
)
{
message
.
error
(
err
.
message
)
message
.
error
(
err
.
message
)
}
}
if
(
res
.
code
!==
200
)
return
message
.
error
(
res
.
message
)
if
(
res
.
code
!==
200
)
return
message
.
error
(
res
.
message
)
gunRules
.
value
=
res
.
data
.
map
(
v
=>
({
// 获取所有分组的名单总数
const
totalApplies
=
res
.
data
.
map
(
v
=>
v
.
details
.
reduce
((
detailPre
,
detailCur
)
=>
detailPre
+
detailCur
.
totalReservations
??
0
,
0
))
const
playerParams
=
{
cmptId
:
getCId
(),
roadName
:
gunRuleValue
.
value
.
roadName
,
current
:
pagination
.
page
,
size
:
pagination
.
pageSize
,
}
// 获取所有分组的名单总数
const
request
=
res
.
data
.
map
(
v
=>
fetch
(
ENROLL_PAGE
,
{
method
:
"POST"
,
headers
:
{
'Content-Type'
:
'application/json'
},
body
:
JSON
.
stringify
(
params
)
}).
then
(
res
=>
res
.
json
()))
let
allPlayersTotals
=
[]
await
Promise
.
all
(
request
).
then
(
list
=>
{
allPlayersTotals
=
list
.
map
(
v
=>
v
.
data
.
total
)
})
console
.
log
({
allPlayersTotals
,
totalApplies
})
// 统计数据组装
gunRules
.
value
=
res
.
data
.
map
((
v
,
index
)
=>
({
...
v
,
...
v
,
startTime
:
v
.
startTime
.
slice
(
0
,
-
2
),
startTime
:
v
.
startTime
.
slice
(
0
,
-
2
),
totalPlayer
:
allPlayersTotals
[
index
],
totalApply
:
totalApplies
[
index
]
}))
}))
if
(
res
.
data
.
length
)
{
if
(
res
.
data
.
length
)
{
changeGunRule
(
ruleIndex
.
value
===
-
1
?
0
:
ruleIndex
.
value
)
changeGunRule
(
ruleIndex
.
value
===
-
1
?
0
:
ruleIndex
.
value
)
...
...
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