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
1ca11816
Commit
1ca11816
authored
Jul 20, 2025
by
daniel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(gunRule): 发枪预约
parent
6d8b3496
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
911 additions
and
11 deletions
+911
-11
GunRolueController.java
...om/dlbridge/jadp/plugins/cmpt/web/GunRolueController.java
+33
-0
feedback.jsp
src/main/webapp/WEB-INF/views/cmpt/feedback.jsp
+2
-5
gunRule.jsp
src/main/webapp/WEB-INF/views/cmpt/gunRule.jsp
+863
-0
markNoRule.jsp
src/main/webapp/WEB-INF/views/cmpt/markNoRule.jsp
+5
-5
menu.jsp
src/main/webapp/WEB-INF/views/common/menu.jsp
+8
-1
No files found.
src/main/java/com/dlbridge/jadp/plugins/cmpt/web/GunRolueController.java
0 → 100644
View file @
1ca11816
package
com
.
dlbridge
.
jadp
.
plugins
.
cmpt
.
web
;
import
com.dlbridge.jadp.common.interceptor.PageView
;
import
com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt
;
import
com.dlbridge.jadp.plugins.cmpt.service.CmptService
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.servlet.ModelAndView
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.annotation.Resource
;
@RequestMapping
(
value
=
"/gk/gunRule/"
)
@RestController
@ApiIgnore
@Log4j2
public
class
GunRolueController
{
@Resource
private
CmptService
cmptService
;
@RequestMapping
(
"index/{cmptId}"
)
@PageView
public
ModelAndView
index
(
@PathVariable
(
"cmptId"
)
Integer
cmptId
,
ModelAndView
mv
)
{
Cmpt
cmpt
=
cmptService
.
queryCmptBycmptId
(
cmptId
);
mv
.
setViewName
(
"cmpt/gunRule"
);
mv
.
addObject
(
"cmpt"
,
cmpt
);
return
mv
;
}
}
src/main/webapp/WEB-INF/views/cmpt/feedback.jsp
View file @
1ca11816
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<head>
<head>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
后台管理系统
</title>
<title>
赛事反馈
</title>
<!-- ... 保留原有的 Vue 引入 ... -->
<!-- ... 保留原有的 Vue 引入 ... -->
<script
src=
"https://unpkg.com/vue@3/dist/vue.global.prod.js"
></script>
<script
src=
"https://unpkg.com/vue@3/dist/vue.global.prod.js"
></script>
<!-- 添加 Naive UI 的引入 -->
<!-- 添加 Naive UI 的引入 -->
...
@@ -104,12 +104,9 @@
...
@@ -104,12 +104,9 @@
<
/n-tabs
>
<
/n-tabs
>
<
/div
>
<
/div
>
<
div
class
=
"ml-auto"
><
n
-
input
v
-
model
:
value
=
"keyword"
placeholder
=
"请输入搜索内容"
/><
/div
>
<
div
class
=
"ml-auto"
><
n
-
input
v
-
model
:
value
=
"keyword"
placeholder
=
"请输入搜索内容"
/><
/div
>
<
n
-
button
type
=
"primary"
>
<
n
-
button
type
=
"primary"
@
click
=
"getFeedBacks"
>
搜索
搜索
<
/n-button
>
<
/n-button
>
<
n
-
button
type
=
"primary"
@
click
=
"addFeedBack"
>
新增测试
<
/n-button
>
<
/div
>
<
/div
>
<
/n-card
>
<
/n-card
>
<!--
搜索框
-->
<!--
搜索框
-->
...
...
src/main/webapp/WEB-INF/views/cmpt/gunRule.jsp
0 → 100644
View file @
1ca11816
<%@ page
language=
"java"
contentType=
"text/html; charset=utf-8"
pageEncoding=
"utf-8"
%>
<%@ taglib
prefix=
"c"
uri=
"http://java.sun.com/jsp/jstl/core"
%>
<%@ taglib
prefix=
"form"
uri=
"http://www.springframework.org/tags/form"
%>
<%@ taglib
prefix=
"fmt"
uri=
"http://java.sun.com/jsp/jstl/fmt"
%>
<%@ taglib
prefix=
"fn"
uri=
"http://java.sun.com/jsp/jstl/functions"
%>
<%@ taglib
prefix=
"fns"
uri=
"/WEB-INF/tlds/fns.tld"
%>
<%@ taglib
prefix=
"fnc"
uri=
"/WEB-INF/tlds/fnc.tld"
%>
<c:set
var=
"ctx"
value=
"
${
pageContext
.
request
.
contextPath
}${
fns:
getAdminPath
()
}
"
/>
<c:set
var=
"path"
value=
"
${
pageContext
.
request
.
contextPath
}${
fns:
getPath
()
}
"
/>
<c:set
var=
"jaaproot"
value=
"
${
pageContext
.
request
.
contextPath
}
"
/>
<c:set
var=
"ctxStatic"
value=
"
${
pageContext
.
request
.
contextPath
}
/static"
/>
<!DOCTYPE html>
<html>
<head>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
预约发枪
</title>
<!-- ... 保留原有的 Vue 引入 ... -->
<script
src=
"https://unpkg.com/vue@3/dist/vue.global.prod.js"
></script>
<!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 -->
<script
src=
"https://unpkg.com/naive-ui"
></script>
<!-- <script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script> -->
<script
type=
"module"
src=
"https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"
></script>
<script
nomodule
src=
"https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"
></script>
<!-- Favicon-->
<link
rel=
"shortcut icon"
href=
"https://img.geexek.com/files/home/favicon.ico"
>
<!-- 自定义css -->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/css/base.css"
>
<!-- Bootstrap CSS-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css"
>
<!-- theme stylesheet-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/style.default.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
id=
"theme-stylesheet"
>
<!-- Custom stylesheet - for your changes-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/custom.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<!-- Favicon-->
<link
rel=
"shortcut icon"
href=
"https://img.geexek.com/files/home/favicon.ico"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/setting.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<script
src=
" ${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"
></script>
<style>
#app
{
padding
:
0
20px
20px
20px
;
}
.layout
{
min-height
:
100vh
;
}
.carousel-img
{
width
:
100%
;
height
:
240px
;
object-fit
:
cover
;
}
[
v-cloak
]
{
display
:
none
;
}
.n-message
.n-message__icon
>*
{
position
:
absolute
;
left
:
0
;
top
:
-5px
!important
;
right
:
0
;
bottom
:
0
;
}
.n-dialog__icon
>*
{
position
:
absolute
;
left
:
0
;
top
:
-2px
!important
;
right
:
0
;
bottom
:
0
;
}
.light-green
{
height
:
108px
;
background-color
:
rgba
(
0
,
128
,
0
,
0.12
);
}
.green
{
height
:
108px
;
background-color
:
rgba
(
0
,
128
,
0
,
0.24
);
}
/* Quill编辑器样式 */
#editor
{
height
:
200px
;
background
:
#fff
;
}
.ql-toolbar
{
border-radius
:
4px
4px
0
0
;
background
:
#f5f5f5
;
}
.ql-container
{
border-radius
:
0
0
4px
4px
;
}
</style>
</head>
<body>
<jsp:include
page=
"../common/header.jsp"
></jsp:include>
<div
class=
"page-content d-flex align-items-stretch main-body"
>
<jsp:include
page=
"../common/menu.jsp"
></jsp:include>
<div
id=
"app"
class=
"flex-1"
v-cloak
>
<n-config-provider
:locale=
"locale"
:date-locale=
"dateLocale"
>
<n-modal-provider>
<n-message-provider>
<n-notification-provider>
<my-app></my-app>
</n-notification-provider>
</n-message-provider>
</n-modal-provider>
</n-config-provider>
</div>
</div>
<script
type=
"text/x-template"
id=
"my-app"
>
<
n
-
space
vertical
>
<!--
搜索框
-->
<
div
class
=
"w-full flex flex-row items-start gap-x-3"
>
<
div
class
=
"bg-white flex flex-col gap-y-2 p-3"
style
=
"min-width:250px;max-width:300px;"
>
<
div
class
=
"flex flex-row items-center justify-between w-full gap-x-2"
>
<
h4
>
组别列表
<
/h4
>
<
n
-
button
v
-
if
=
"activeMenu==menuOptions[0].value"
type
=
"primary"
size
=
"small"
@
click
=
"onAddGunRule"
>
新增
<
/n-button
>
<
/div
>
<
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
>
<
/div
>
<
/div
>
<
div
class
=
"flex-1 flex flex-col gap-y-2"
>
<
n
-
card
:
bordered
=
"false"
>
<
div
class
=
"w-full flex flex-row items-center gap-x-2"
>
<
div
style
=
"width: 200px"
>
<
n
-
tabs
type
=
"segment"
@
update
:
value
=
"updateMenu"
:
value
=
"activeMenu"
animated
pane
-
style
=
"padding:0;"
>
<
n
-
tab
-
pane
v
-
for
=
"item in menuOptions"
:
name
=
"item.value"
:
tab
=
"item.name"
><
/n-tab-pane
>
<
/n-tabs
>
<
/div
>
<
div
class
=
"ml-auto"
v
-
if
=
"activeMenu!=menuOptions[0].value"
><
n
-
input
v
-
model
:
value
=
"keyword"
placeholder
=
"请输入搜索内容"
/><
/div
>
<
n
-
button
type
=
"primary"
v
-
if
=
"activeMenu!=menuOptions[0].value"
>
搜索
<
/n-button
>
<
/div
>
<
/n-card
>
<!--
顶部的搜索框
-->
<
n
-
card
title
=
"组别信息"
:
bordered
=
"false"
v
-
if
=
"activeMenu==menuOptions[0].value"
>
<
n
-
form
ref
=
"gunRuleRef"
:
model
=
"gunRuleValue"
:
rules
=
"gunRuleRules"
label
-
placement
=
"left"
label
-
width
=
"auto"
size
=
"small"
>
<
n
-
form
-
item
label
=
"组别名称"
path
=
"roadName"
>
<
n
-
input
v
-
model
:
value
=
"gunRuleValue.roadName"
placeholder
=
"请输入组别名称"
/>
<
/n-form-item
>
<
n
-
form
-
item
label
=
"出发日期"
path
=
"startTime"
>
<
n
-
date
-
picker
value
-
format
=
"yyyy-MM-dd"
date
-
format
=
"yyyy-MM-dd"
:
value
=
"gunRuleValue.startTime"
type
=
"date"
clearable
@
update
:
formatted
-
value
=
"updateFormattedValue"
/>
<
/n-form-item
>
<
n
-
form
-
item
label
=
"关门时间"
path
=
"closeTime"
>
<
n
-
input
-
number
:
min
=
"1"
:
max
=
"200"
v
-
model
:
value
=
"gunRuleValue.closeTime"
placeholder
=
"请输入关门时间"
>
<
template
#
suffix
>
小时
<
/template
>
<
/n-input-number
>
<
/n-form-item
>
<
/n-form
>
<
/n-card
>
<
n
-
card
title
=
"枪次规则"
:
bordered
=
"false"
v
-
if
=
"gunRuleValue.roadName&&activeMenu==menuOptions[0].value"
>
<
template
#
header
-
extra
>
<
n
-
button
type
=
'primary'
:
loading
=
"loading"
@
click
=
"addWave"
>
新增
<
/n-button
>
<
/template
>
<
n
-
data
-
table
size
=
"small"
:
columns
=
"waveColumns"
:
loading
=
"loading"
:
data
=
"gunRuleValue.waves"
:
pagination
=
"false"
:
bordered
=
"false"
/>
<
/n-card
>
<
n
-
card
title
=
"人员列表"
:
bordered
=
"false"
v
-
if
=
"activeMenu!=menuOptions[0].value"
>
<
template
#
header
-
extra
>
<
n
-
space
>
<
n
-
button
type
=
"error"
>
清空名单
<
/n-button
>
<
n
-
button
type
=
"primary"
>
导入名单
<
/n-button
>
<
/n-space
>
<
/template
>
<
n
-
data
-
table
:
columns
=
"columns"
:
loading
=
"loading"
:
data
=
"players"
:
pagination
=
"pagination"
:
bordered
=
"false"
@
update
:
page
=
"handlePageChange"
/>
<
/n-card
>
<
div
class
=
"flex flex-row items-center gap-x-2 w-full"
v
-
if
=
"activeMenu==menuOptions[0].value"
>
<
div
class
=
"flex-1"
>
<
n
-
button
:
loading
=
"loading"
:
block
=
"true"
@
click
=
"submit"
type
=
"primary"
>
保存规则
<
/n-button
>
<
/div
>
<
div
class
=
"flex-1"
v
-
if
=
"gunRuleValue.id"
>
<
n
-
button
:
loading
=
"loading"
:
block
=
"true"
@
click
=
"showDeleteModal=true"
type
=
"error"
>
删除规则
<
/n-button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
n
-
modal
v
-
model
:
show
=
"showDeleteModal"
preset
=
"dialog"
title
=
"确认"
content
=
"你确定要删除该规则吗?"
positive
-
text
=
"确认"
negative
-
text
=
"算了"
@
positive
-
click
=
"deleteGunRule"
/>
<
n
-
modal
:
mask
-
closable
=
"false"
:
loading
=
"loading"
style
=
"width: 400px"
title
=
"编辑选手"
preset
=
"card"
draggable
v
-
model
:
show
=
"showPlayerModal"
>
<
n
-
form
ref
=
"playerFormRef"
:
model
=
"playerFormValue"
:
rules
=
"playerRules"
size
=
"small"
label
-
placement
=
"left"
label
-
width
=
"auto"
>
<
n
-
form
-
item
label
=
"姓名"
path
=
"name"
>
<
n
-
input
v
-
model
:
value
=
"playerFormValue.name"
placeholder
=
"请输入姓名"
/>
<
/n-form-item
>
<
n
-
form
-
item
label
=
"参赛号"
path
=
"markNo"
>
<
n
-
input
v
-
model
:
value
=
"playerFormValue.markNo"
placeholder
=
"请输入参赛号"
/>
<
/n-form-item
>
<
n
-
form
-
item
label
=
"枪次"
path
=
"gunNo"
>
<
n
-
select
:
options
=
"gunRuleValue.waves.map(v=>({label:v.name,value:v.name}))"
v
-
model
:
value
=
"playerFormValue.gunNo"
><
/n-select
>
<
/n-form-item
>
<
/n-form
>
<
template
#
footer
>
<
div
class
=
"flex gap-x-2 flex-row items-center"
>
<
n
-
button
class
=
"flex-1"
:
loading
=
"loading"
@
click
=
"onPlayerModalCancel"
>
取消
<
/n-button
>
<
n
-
button
class
=
"flex-1"
:
loading
=
"loading"
type
=
'primary'
@
click
=
"onPlayerSubmit"
>
保存
<
/n-button
>
<
/div
>
<
/template
>
<
/n-modal
>
<
/n-space
>
</script>
<script>
// 枚举class
class
SuperEnum
{
constructor
(
param
)
{
const
keyObj
=
{};
const
valueObj
=
{};
const
nameObj
=
{};
if
(
!
Array
.
isArray
(
param
))
{
throw
new
TypeError
(
'param is not an array!'
);
}
param
.
forEach
((
element
)
=>
{
if
(
!
element
.
key
||
!
element
.
name
)
{
return
;
}
// 使用对象存储键值对,方便快速查找
keyObj
[
element
.
key
]
=
element
;
valueObj
[
element
.
value
]
=
element
;
nameObj
[
element
.
name
]
=
element
;
// 动态添加属性
this
[
element
.
key
]
=
element
;
this
[
element
.
name
]
=
element
;
if
(
element
.
key
!==
element
.
value
)
{
this
[
element
.
value
]
=
element
;
}
});
// 保存源数组
this
.
data
=
param
;
this
.
keyObj
=
keyObj
;
this
.
valueObj
=
valueObj
;
this
.
nameObj
=
nameObj
;
// 防止被修改
Object
.
freeze
(
this
);
}
getColorByKey
(
key
)
{
const
prop
=
this
.
keyOf
(
key
);
if
(
!
prop
)
{
const
error
=
new
Error
(
'No enum constant'
);
error
.
code
=
'ENUM_NOT_FOUND'
;
throw
error
;
}
return
prop
.
color
;
}
getData
()
{
return
this
.
data
;
}
getKeyByName
(
name
)
{
const
prop
=
this
.
nameOf
(
name
);
if
(
!
prop
)
{
const
error
=
new
Error
(
'No enum constant'
);
error
.
code
=
'ENUM_NOT_FOUND'
;
throw
error
;
}
return
prop
.
key
;
}
getNameByKey
(
key
)
{
const
prop
=
this
.
keyOf
(
key
);
if
(
!
prop
)
{
const
error
=
new
Error
(
'No enum constant'
);
error
.
code
=
'ENUM_NOT_FOUND'
;
throw
error
;
}
return
prop
.
name
;
}
getNameByValue
(
value
)
{
const
prop
=
this
.
valueOf
(
value
);
if
(
!
prop
)
{
const
error
=
new
Error
(
'No enum constant'
);
error
.
code
=
'ENUM_NOT_FOUND'
;
throw
error
;
}
return
prop
.
name
;
}
getValueByKey
(
key
)
{
const
prop
=
this
.
keyOf
(
key
);
if
(
!
prop
)
{
const
error
=
new
Error
(
'No enum constant'
);
error
.
code
=
'ENUM_NOT_FOUND'
;
throw
error
;
}
return
prop
.
value
;
}
getValueByName
(
name
)
{
const
prop
=
this
.
nameOf
(
name
);
if
(
!
prop
)
{
const
error
=
new
Error
(
'No enum constant'
);
error
.
code
=
'ENUM_NOT_FOUND'
;
throw
error
;
}
return
prop
.
value
;
}
keyOf
(
key
)
{
return
this
.
keyObj
[
key
];
}
nameOf
(
name
)
{
return
this
.
nameObj
[
name
];
}
valueOf
(
value
)
{
return
this
.
valueObj
[
value
];
}
}
// to 方法,封装try catch
const
to
=
async
(
promise
,
errorExt
,
)
=>
{
try
{
const
data
=
await
promise
const
result
=
[
null
,
data
]
return
result
}
catch
(
error
)
{
if
(
errorExt
)
{
const
parsedError
=
Object
.
assign
({},
error
,
errorExt
)
return
[
parsedError
,
undefined
]
}
return
[
error
,
undefined
]
}
}
</script>
<script>
const
{
createApp
,
defineComponent
,
onBeforeUnmount
,
reactive
,
ref
,
onMounted
,
h
}
=
Vue
;
const
{
useMessage
,
useNotification
,
dateZhCN
,
NButton
,
NTag
,
zhCN
,
NSpace
,
NImageGroup
,
NImage
,
NText
,
NInputNumber
,
NSelect
,
NInput
,
NDatePicker
}
=
naive
const
uploadUrl
=
window
.
location
.
origin
+
'/api-common/v1/upload?folder=gk/markNoRule'
+
'&cmptId='
+
getCId
()
const
downloadWeChatImgUrl
=
window
.
location
.
origin
+
'/api-common/v1/download-wechat-image'
// 添加全局 loading 指令
const
ECC_BASE_URL
=
"https://ecc.geexek.com"
const
SAVE_OR_UPDATE
=
ECC_BASE_URL
+
"/api-pick/v1/save-or-update"
const
RULE_LIST
=
ECC_BASE_URL
+
"/api-pick/v1/rule-list?"
const
DELETE_RULE
=
ECC_BASE_URL
+
"/api-pick/v1/delete-rule?"
// 发枪的map
const
NO_MAP
=
{
0
:
"第一枪"
,
1
:
"第二枪"
,
2
:
"第三枪"
,
3
:
"第四枪"
,
4
:
"第五枪"
,
5
:
"第六枪"
,
6
:
"第七枪"
,
7
:
"第八枪"
,
8
:
"第九枪"
,
9
:
"第十枪"
,
10
:
"第十一枪"
,
}
const
MyApp
=
defineComponent
({
name
:
'MyApp'
,
template
:
'#my-app'
,
setup
()
{
const
message
=
useMessage
()
const
notification
=
useNotification
()
const
loading
=
ref
(
false
)
/***---------------- 人员弹框 start -----------------*/
// 选手弹框
const
showPlayerModal
=
ref
(
false
)
// 选手弹框ref
const
playerFormRef
=
ref
()
// 编辑选手的信息
const
playerFormValue
=
ref
({
name
:
''
,
mobile
:
''
,
gunNo
:
''
,
roadName
:
''
,
})
// 规则
const
playerRules
=
{
name
:
{
required
:
true
,
message
:
'请输入姓名'
,
},
markNo
:
{
required
:
true
,
message
:
'请输入参赛号'
,
},
gunNo
:
{
required
:
true
,
message
:
'请输入枪次'
,
},
}
// 取消选手编辑
const
onPlayerModalCancel
=
()
=>
{
showPlayerModal
.
value
=
false
}
// 保存选手
const
onPlayerSubmit
=
async
(
e
)
=>
{
e
.
preventDefault
()
gunRuleRef
.
value
?.
validate
(
async
(
errors
)
=>
{
if
(
errors
)
return
message
.
error
(
'请检查表单是否填写完整'
)
// 保存
onPlayerModalCancel
()
})
// const [err,data]=await to(validate(playerFormValue.value,playerRules))
// if(err){
// message.error(err.message)
// return
// }
// showPlayerModal.value=false
}
/***---------------- 人员弹框 end -----------------*/
/***---------------- 人员列表 start -----------------*/
const
keyword
=
ref
(
''
)
// 分页
const
pagination
=
ref
({
pageSize
:
20
,
page
:
1
})
// seg
const
menuOptions
=
[
{
name
:
'发枪规则'
,
value
:
'gunRule'
},
{
name
:
'选手列表'
,
value
:
'players'
},
]
// 人员列表
const
players
=
ref
([
{
name
:
'张三'
,
markNo
:
'13888888888'
,
gunNo
:
'第一枪'
,
roadName
:
'A组'
,
},
{
name
:
'李四'
,
markNo
:
'13999999999'
,
gunNo
:
'第二枪'
,
roadName
:
'B组'
,
},
{
name
:
'王五'
,
markNo
:
'14000000000'
,
gunNo
:
'第三枪'
,
roadName
:
'C组'
,
},
{
name
:
'赵六'
,
markNo
:
'14111111111'
,
gunNo
:
'第四枪'
,
roadName
:
'D组'
,
},
{
name
:
'周七'
,
markNo
:
'14222222222'
,
gunNo
:
'第五枪'
,
roadName
:
'E组'
,
},
])
const
columns
=
[
{
title
:
'姓名'
,
key
:
'name'
,
},
{
title
:
'参赛号'
,
key
:
'markNo'
,
},
{
title
:
'枪次'
,
key
:
'gunNo'
,
},
{
title
:
'组别'
,
key
:
'roadName'
,
},
{
title
:
'操作'
,
key
:
'action'
,
width
:
90
,
align
:
'center'
,
render
:
(
row
)
=>
{
// 两个按钮,一个 编辑 一个 删除
return
h
(
NSpace
,
{},
[
h
(
NButton
,
{
type
:
'primary'
,
size
:
'small'
,
onClick
:
()
=>
{
// 编辑
playerFormValue
.
value
=
row
showPlayerModal
.
value
=
true
}
},
'编辑'
),
])
}
},
]
// 当前选中的菜单
const
activeMenu
=
ref
(
menuOptions
[
0
].
value
)
// 更新菜单
const
updateMenu
=
(
value
)
=>
{
activeMenu
.
value
=
value
}
// 分页切换
const
handlePageChange
=
(
page
)
=>
{
pagination
.
value
.
page
=
page
getFeedBacks
()
}
/***---------------- 人员列表 end -----------------*/
/***---------------- 发枪规则 start -----------------*/
const
gunRuleRef
=
ref
(
null
)
const
gunRules
=
ref
([])
// 规则初始化
const
initialValue
=
{
createTime
:
undefined
,
// 组别开始时间
roadName
:
""
,
// 组别名
waves
:
[],
// 枪次
id
:
undefined
,
closeTime
:
undefined
// 关门时间
}
// 选号规则
const
gunRuleValue
=
ref
(
initialValue
)
// 当前操作的规则索引
const
ruleIndex
=
ref
(
0
)
// 删除确认弹窗
const
showDeleteModal
=
ref
(
false
)
// 号码簿规则校验
const
gunRuleRules
=
{
roadName
:
{
required
:
true
,
message
:
'请输入规则名称'
,
trigger
:
'blur'
},
startTime
:
{
required
:
true
,
message
:
'请输入规则描述'
,
trigger
:
'blur'
},
closeTime
:
{
required
:
true
,
message
:
'请输入选号长度'
,
trigger
:
'blur'
,
type
:
'number'
,
}
}
// 分类切换,刷新table
const
changeGunRule
=
(
index
)
=>
{
ruleIndex
.
value
=
index
gunRuleValue
.
value
=
gunRules
.
value
[
index
]
// todo 获取名单
}
// 获取分枪组别列表
const
getGunRules
=
async
()
=>
{
const
params
=
{
cmptId
:
getCId
()
}
// loading.value = true;
// // 发起请求
// const [err, res] = await to(fetch(RULE_LIST + new URLSearchParams(params).toString(), {
// method: "GET",
// headers: {
// 'Content-Type': 'application/json'
// }
// }).then(res => res.json()))
// loading.value = false
// if (err) {
// message.error(err.message)
// }
// if (res.code === 200) {
// gunRules.value = res.data
// if (res.data.length) {
// changeGunRule(ruleIndex.value === -1 ? 0 : ruleIndex.value)
// if (quillEditor.value && gunRuleValue.value.description) {
// quillEditor.value.root.innerHTML = gunRuleValue.value.description;
// }
// } else {
// gunRuleValue.value = initialValue
// }
// } else {
// message.error(res.msg)
// }
}
// 提交
const
submit
=
(
e
)
=>
{
e
.
preventDefault
()
gunRuleRef
.
value
?.
validate
(
async
(
errors
)
=>
{
if
(
errors
)
return
message
.
error
(
'请检查表单是否填写完整'
)
// 使用fetch发起请求
const
params
=
{
...
gunRuleValue
.
value
,
gtCmptId
:
getCId
(),
}
loading
.
value
=
true
// 发起请求
// const [err, data] = await to(fetch(SAVE_OR_UPDATE, {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify(params)
// }).then(res => res.json()))
gunRules
.
value
.
push
({
...
params
,
id
:
gunRules
.
value
.
length
+
1
})
loading
.
value
=
false
messageReactive
.
destroy
()
message
.
success
(
'操作成功'
)
// if (data.code === 200) {
// message.success('操作成功')
// getGunRules()
// } else {
// message.error(data.message)
// }
})
}
// 日期处理
const
updateFormattedValue
=
(
val
)
=>
{
console
.
log
({
val
})
gunRuleValue
.
value
.
startTime
=
val
}
// 新增规则
const
onAddGunRule
=
()
=>
{
gunRuleValue
.
value
=
initialValue
ruleIndex
.
value
=
-
1
}
// 删除规则
const
deleteGunRule
=
async
()
=>
{
loading
.
value
=
true
const
messageReactive
=
message
.
loading
(
'删除中...'
,
{
duration
:
0
})
// 发起请求
const
[
err
,
data
]
=
await
to
(
fetch
(
DELETE_RULE
+
'ruleId='
+
gunRuleValue
.
value
.
id
,
{
method
:
'POST'
,
headers
:
{
'Content-Type'
:
'application/json'
},
}).
then
(
res
=>
res
.
json
()))
loading
.
value
=
false
messageReactive
.
destroy
()
if
(
data
.
code
===
200
)
{
message
.
success
(
'操作成功'
)
getGunRules
()
}
else
{
message
.
error
(
data
.
message
)
}
}
/***---------------- 号码簿规则 end-----------------*/
/***---------------- 枪次表 start-----------------*/
const
waveColumns
=
[
{
title
:
'枪次'
,
key
:
'name'
,
align
:
'center'
,
width
:
100
,
render
(
row
,
index
)
{
return
h
(
NInput
,
{
value
:
row
.
name
,
onUpdateValue
(
v
)
{
gunRuleValue
.
value
.
waves
[
index
].
name
=
v
}
})
}
},
{
title
:
'发枪时间'
,
key
:
'startTime'
,
align
:
'center'
,
render
(
row
,
index
)
{
return
h
(
NDatePicker
,
{
formattedValue
:
row
.
startTime
,
valueFormat
:
"yyyy-MM-dd HH:mm:ss"
,
dateFormat
:
"yyyy-MM-dd HH:mm:ss"
,
type
:
"datetime"
,
clearable
:
true
,
updateFormatValue
(
_
,
formatValue
)
{
gunRuleValue
.
value
.
waves
[
index
].
startTime
=
formatValue
}
})
}
},
{
title
:
'结束时间'
,
key
:
'endTime'
,
align
:
'center'
,
render
(
row
,
index
)
{
return
h
(
NDatePicker
,
{
formattedValue
:
row
.
endTime
,
valueFormat
:
"yyyy-MM-dd HH:mm:ss"
,
dateFormat
:
"yyyy-MM-dd HH:mm:ss"
,
type
:
"datetime"
,
clearable
:
true
,
updateFormatValue
(
_
,
formatValue
)
{
gunRuleValue
.
value
.
waves
[
index
].
endTime
=
formatValue
}
})
}
},
{
title
:
'人数'
,
key
:
'total'
,
align
:
'center'
,
width
:
150
,
render
(
row
,
index
)
{
return
h
(
NInputNumber
,
{
value
:
row
.
total
,
min
:
1
,
onUpdateValue
(
v
)
{
gunRuleValue
.
value
.
waves
[
index
].
total
=
v
}
})
}
},
{
title
:
'操作'
,
key
:
'actions'
,
width
:
50
,
align
:
'center'
,
render
:
(
row
,
index
)
=>
{
return
h
(
NButton
,
{
type
:
'error'
,
size
:
'small'
,
onClick
:
()
=>
{
gunRuleValue
.
value
.
waves
.
splice
(
index
,
1
)
}
},
'删除'
)
}
}
]
// 新增枪次
const
addWave
=
()
=>
{
let
index
=
gunRuleValue
.
value
.
waves
.
length
gunRuleValue
.
value
.
waves
.
push
({
id
:
undefined
,
name
:
NO_MAP
[
index
],
startTime
:
undefined
,
endTime
:
undefined
,
total
:
undefined
,
})
}
/***---------------- 枪次表 end-----------------*/
// 页面加载
onMounted
(()
=>
{
// getGunRules()
})
return
{
// 编辑弹框
showPlayerModal
,
playerFormRef
,
playerFormValue
,
playerRules
,
onPlayerModalCancel
,
onPlayerSubmit
,
// 人员列表
keyword
,
pagination
,
handlePageChange
,
columns
,
players
,
// 枪次表相关
waveColumns
,
addWave
,
// 发枪规则
gunRules
,
ruleIndex
,
changeGunRule
,
gunRuleValue
,
gunRuleRef
,
gunRuleRules
,
submit
,
onAddGunRule
,
deleteGunRule
,
showDeleteModal
,
updateFormattedValue
,
// 公共数据
loading
,
menuOptions
,
activeMenu
,
updateMenu
,
}
}
})
const
app
=
Vue
.
createApp
({
setup
()
{
return
{
locale
:
zhCN
,
dateLocale
:
dateZhCN
}
}
})
app
.
component
(
'my-app'
,
MyApp
)
app
.
use
(
naive
)
app
.
mount
(
'#app'
)
</script>
</body>
</html>
\ No newline at end of file
src/main/webapp/WEB-INF/views/cmpt/markNoRule.jsp
View file @
1ca11816
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<head>
<head>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
后台管理系统
</title>
<title>
自选号规则
</title>
<!-- ... 保留原有的 Vue 引入 ... -->
<!-- ... 保留原有的 Vue 引入 ... -->
<script
src=
"https://unpkg.com/vue@3/dist/vue.global.prod.js"
></script>
<script
src=
"https://unpkg.com/vue@3/dist/vue.global.prod.js"
></script>
<!-- 添加 Naive UI 的引入 -->
<!-- 添加 Naive UI 的引入 -->
...
@@ -618,7 +618,7 @@
...
@@ -618,7 +618,7 @@
// 新增规则
// 新增规则
const
onAddMarkNoRule
=
()
=>
{
const
onAddMarkNoRule
=
()
=>
{
markNoRuleValue
.
value
=
initialValue
markNoRuleValue
.
value
=
initialValue
ruleIndex
=
-
1
ruleIndex
.
value
=
-
1
}
}
// 删除规则
// 删除规则
const
deleteMarkNoRule
=
async
()
=>
{
const
deleteMarkNoRule
=
async
()
=>
{
...
@@ -661,13 +661,13 @@
...
@@ -661,13 +661,13 @@
min
:
1
,
min
:
1
,
max
:
100
,
max
:
100
,
onUpdateValue
(
v
)
{
onUpdateValue
(
v
)
{
data
.
value
[
index
].
waveNumber
=
v
markNoRuleValue
.
value
[
index
].
waveNumber
=
v
}
}
})
})
}
}
},
},
{
{
title
:
'最快
配速
'
,
title
:
'最快
成绩
'
,
key
:
'scoreFrom'
,
key
:
'scoreFrom'
,
align
:
'center'
,
align
:
'center'
,
render
(
row
,
index
)
{
render
(
row
,
index
)
{
...
@@ -681,7 +681,7 @@
...
@@ -681,7 +681,7 @@
}
}
},
},
{
{
title
:
'最慢
配速
'
,
title
:
'最慢
成绩
'
,
key
:
'scoreTo'
,
key
:
'scoreTo'
,
align
:
'center'
,
align
:
'center'
,
render
(
row
,
index
)
{
render
(
row
,
index
)
{
...
...
src/main/webapp/WEB-INF/views/common/menu.jsp
View file @
1ca11816
...
@@ -383,6 +383,13 @@
...
@@ -383,6 +383,13 @@
<span
class=
"menu-txt"
>
赛事反馈
</span>
<span
class=
"menu-txt"
>
赛事反馈
</span>
</a>
</a>
</li>
</li>
<li
class=
"gunRule menu-sub-item"
>
<a
href=
"/gk/gunRule/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}×tamp=${timestamp}&sign=${sign}"
>
<span
class=
"left-arrow"
></span>
<span
class=
"menu-txt"
>
发枪预约
</span>
</a>
</li>
</ul>
</ul>
</li>
</li>
</ul>
</ul>
...
@@ -445,7 +452,7 @@
...
@@ -445,7 +452,7 @@
var
classes
=
[
'cmptSetting'
,
'nameList'
,
'manual'
,
'contact'
,
'manage'
,
var
classes
=
[
'cmptSetting'
,
'nameList'
,
'manual'
,
'contact'
,
'manage'
,
'route'
,
'road'
,
'equip'
,
'photo'
,
'news'
,
'cert'
,
'data'
,
'route'
,
'road'
,
'equip'
,
'photo'
,
'news'
,
'cert'
,
'data'
,
'banner'
,
'score'
,
'auto'
,
'scan'
,
'review'
,
'customer'
,
'rule'
,
'banner'
,
'score'
,
'auto'
,
'scan'
,
'review'
,
'customer'
,
'rule'
,
'outter-link'
,
'sure-letter'
,
'rankSetting'
,
'service'
,
"module"
,
"swiper"
,
"bag"
,
"invoice"
,
"markNoSelect"
,
"feedback"
,
"markNoRule"
];
'outter-link'
,
'sure-letter'
,
'rankSetting'
,
'service'
,
"module"
,
"swiper"
,
"bag"
,
"invoice"
,
"markNoSelect"
,
"feedback"
,
"markNoRule"
,
"gunRule"
];
let
url
=
document
.
location
.
href
;
let
url
=
document
.
location
.
href
;
var
done
=
false
;
var
done
=
false
;
for
(
var
i
in
classes
)
{
for
(
var
i
in
classes
)
{
...
...
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