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
c46469b4
Commit
c46469b4
authored
Jun 13, 2025
by
daniel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(func): 功能菜单+外面模块完善+上传改造
parent
9afd7b78
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1337 additions
and
1015 deletions
+1337
-1015
Func.java
src/main/java/com/dlbridge/jadp/plugins/cmpt/bean/Func.java
+13
-3
CmptSettingMapper.xml
...bridge/jadp/plugins/cmpt/dao/mapper/CmptSettingMapper.xml
+47
-13
CmptSetting.java
...com/dlbridge/jadp/plugins/cmpt/dao/model/CmptSetting.java
+28
-3
ResourcesController.java
...m/dlbridge/jadp/plugins/cmpt/web/ResourcesController.java
+2
-0
SureLetterController.java
.../dlbridge/jadp/plugins/cmpt/web/SureLetterController.java
+2
-5
cmptSetting.jsp
src/main/webapp/WEB-INF/views/cmpt/cmptSetting.jsp
+304
-249
module.jsp
src/main/webapp/WEB-INF/views/cmpt/module.jsp
+7
-8
outter-link.jsp
src/main/webapp/WEB-INF/views/cmpt/outter-link.jsp
+682
-519
service.jsp
src/main/webapp/WEB-INF/views/cmpt/service.jsp
+13
-20
swiper.jsp
src/main/webapp/WEB-INF/views/cmpt/swiper.jsp
+8
-7
menu.jsp
src/main/webapp/WEB-INF/views/common/menu.jsp
+1
-2
banner.js
src/main/webapp/static/js/banner.js
+27
-29
cmptManual.js
src/main/webapp/static/js/cmptManual.js
+10
-19
cmptSetting.js
src/main/webapp/static/js/cmptSetting.js
+76
-17
index.js
src/main/webapp/static/js/index.js
+17
-17
news.js
src/main/webapp/static/js/news.js
+25
-27
road-new.js
src/main/webapp/static/js/road-new.js
+75
-77
No files found.
src/main/java/com/dlbridge/jadp/plugins/cmpt/bean/Func.java
View file @
c46469b4
package
com
.
dlbridge
.
jadp
.
plugins
.
cmpt
.
bean
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.Date
;
@Setter
@Getter
@ApiModel
(
value
=
"功能模块"
,
description
=
"功能模板"
)
...
...
@@ -25,7 +28,6 @@ public class Func {
private
String
appId
;
private
String
url
;
private
Integer
type
;
@ApiModelProperty
(
value
=
"可见性"
)
...
...
@@ -37,14 +39,22 @@ public class Func {
private
Integer
status
;
private
String
style
;
//
打开方式配置(0 默认
1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
//
类型配置(0文本
1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
private
Integer
openType
;
// 图标
private
String
icon
;
// 小程序路径,图片路径,文档路径,短连接路径,页面路径
private
String
path
;
// 模块失效时间
private
String
deadTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
deadTime
;
// 模块开始时间
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
// 是否需要开启有效时间
private
Integer
needTime
;
// 富文本
private
String
content
;
}
src/main/java/com/dlbridge/jadp/plugins/cmpt/dao/mapper/CmptSettingMapper.xml
View file @
c46469b4
...
...
@@ -40,7 +40,9 @@
del_flag AS "delFlag",
icon,
dead_time AS deadTime,
open_type AS openType
open_type AS openType,
start_time AS startTime,
need_time AS needTime
FROM `gk_cmptsetting`
WHERE cmptid = #{cmptId} order by seq
</select>
...
...
@@ -114,15 +116,23 @@
<if
test=
"func.url != null"
>
url = #{func.url},
</if>
<if
test=
"func.openType != null"
>
open_type = #{func.openType},
</if>
<if
test=
"func.icon != null"
>
icon = #{func.icon}
icon = #{func.icon}
,
</if>
<if
test=
"func.deadTime != null"
>
dead_time = #{func.deadTime}
dead_time = #{func.deadTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"func.content != null"
>
content = #{func.content},
</if>
<if
test=
"func.needTime != null"
>
need_time = #{func.needTime},
</if>
<if
test=
"func.startTime != null"
>
start_time = #{func.startTime,jdbcType=TIMESTAMP}
</if>
</set>
WHERE id = #{func.id}
...
...
@@ -143,7 +153,10 @@
url,
open_type,
icon,
dead_time)
dead_time,
content,
need_time,
start_time)
VALUES (#{func.id},
#{func.cmptId},
#{func.nameWeb},
...
...
@@ -159,7 +172,10 @@
#{func.url},
#{func.openType},
#{func.icon},
#{func.deadTime})
now(),
#{func.content},
#{func.needTime},
now())
</insert>
<update
id=
"updateById"
>
...
...
@@ -176,8 +192,17 @@
<if
test=
"openType != null"
>
open_type = #{openType},
</if>
<if
test=
"deadTime != null"
>
dead_time = #{deadTime}
<if
test=
"func.deadTime != null"
>
dead_time = #{func.deadTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"func.startTime != null"
>
start_time = #{func.startTime,jdbcType=TIMESTAMP}
</if>
<if
test=
"needTime != null"
>
need_time = #{needTime},
</if>
<if
test=
"content != null"
>
content = #{content}
</if>
create_by = #{createBy},
create_date = #{createDate},
...
...
@@ -202,14 +227,23 @@
open_type = #{openType},
</if>
<if
test=
"deadTime != null"
>
dead_time = #{deadTime}
dead_time = #{deadTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"startTime!= null"
>
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"needTime!= null"
>
need_time = #{needTime},
</if>
<if
test=
"content!= null"
>
content = #{content},
</if>
update_date = now()
WHERE cmptId=#{setting.cmptId} and type = #{setting.type} and del_flag = 0
</update>
<select
id=
"queryFuncs"
resultType=
"com.dlbridge.jadp.plugins.cmpt.bean.Func"
>
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,`status`,icon,open_type openType,dead_time deadTime
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,`status`,icon,open_type openType,dead_time deadTime
,start_time startTime,need_time needTime
from gk_cmptsetting
where cmptid = #{cmptId} and visibility=1 and del_flag=0 and status>0
order by seq
...
...
@@ -217,7 +251,7 @@
</select>
<select
id=
"queryAllFuncs"
resultType=
"com.dlbridge.jadp.plugins.cmpt.bean.Func"
>
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,`status`,icon,open_type openType,dead_time deadTime
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,`status`,icon,open_type openType,dead_time deadTime
,start_time startTime,need_time needTime
from gk_cmptsetting
where cmptid = #{cmptId} and visibility=1 and del_flag=0 and status=1
order by seq
...
...
@@ -271,7 +305,7 @@
</select>
<select
id=
"queryAllThirdMicros"
resultType=
"com.dlbridge.jadp.plugins.cmpt.bean.Func"
>
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,icon,open_type openType,dead_time deadTime
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,icon,open_type openType,dead_time deadTime
,start_time startTime,need_time needTime
from gk_cmptsetting
where cmptid = #{cmptId} and type=19
</select>
...
...
@@ -280,7 +314,7 @@
delete from gk_cmptsetting where id = #{id}
</delete>
<select
id=
"getFuncById"
resultType=
"com.dlbridge.jadp.plugins.cmpt.bean.Func"
>
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,icon,open_type openType,dead_time deadTime
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,icon,open_type openType,dead_time deadTime
,start_time startTime,need_time needTime
from gk_cmptsetting
where id=#{id}
</select>
...
...
src/main/java/com/dlbridge/jadp/plugins/cmpt/dao/model/CmptSetting.java
View file @
c46469b4
package
com
.
dlbridge
.
jadp
.
plugins
.
cmpt
.
dao
.
model
;
import
com.dlbridge.jadp.common.persistence.JaapRecord
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.util.Date
;
public
class
CmptSetting
extends
JaapRecord
<
CmptSetting
>
{
...
...
@@ -22,13 +25,35 @@ public class CmptSetting extends JaapRecord<CmptSetting> {
// 图标
private
String
icon
;
// 模块失效时间
private
String
deadTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
deadTime
;
// 模块开始时间
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
startTime
;
// 是否需要开启有效时间
private
Integer
needTime
;
public
Date
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
public
Integer
getNeedTime
()
{
return
needTime
;
}
public
void
setNeedTime
(
Integer
needTime
)
{
this
.
needTime
=
needTime
;
}
public
String
getDeadTime
()
{
public
Date
getDeadTime
()
{
return
deadTime
;
}
public
void
setDeadTime
(
String
deadTime
)
{
public
void
setDeadTime
(
Date
deadTime
)
{
this
.
deadTime
=
deadTime
;
}
...
...
src/main/java/com/dlbridge/jadp/plugins/cmpt/web/ResourcesController.java
View file @
c46469b4
...
...
@@ -108,6 +108,8 @@ public class ResourcesController {
response
.
addHeader
(
"Content-Disposition"
,
"attachment; filename=qrcode.jpg"
);
JSONObject
obj
=
new
JSONObject
();
obj
.
put
(
"scene"
,
"raceId="
+
cmptid
);
// 修改为小程序页面路径 by 2025-06-12
obj
.
put
(
"page"
,
"pages/race/raceHome"
);
obj
.
put
(
"width"
,
"1280"
);
String
partnerId
=
cmptService
.
getPartnerId
(
cmptid
);
try
{
...
...
src/main/java/com/dlbridge/jadp/plugins/cmpt/web/SureLetterController.java
View file @
c46469b4
...
...
@@ -8,10 +8,7 @@ import com.dlbridge.jadp.plugins.cmpt.service.CmptSettingService;
import
com.neusoft.www.utils.web.Result
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.servlet.ModelAndView
;
import
springfox.documentation.annotations.ApiIgnore
;
...
...
@@ -58,7 +55,7 @@ public class SureLetterController {
@RequestMapping
(
"/updateName"
)
@ResponseBody
public
Result
updateName
(
Func
func
)
{
public
Result
updateName
(
@RequestBody
Func
func
)
{
cmptSettingService
.
saveOrUpdate
(
func
);
return
Result
.
success
().
setContent
(
1
);
}
...
...
src/main/webapp/WEB-INF/views/cmpt/cmptSetting.jsp
View file @
c46469b4
<%@ 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=
"ctxStatic"
value=
"
${
pageContext
.
request
.
contextPath
}
/static"
/>
<c:set
var=
"jaaproot"
value=
"
${
pageContext
.
request
.
contextPath
}
"
/>
<!doctype html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<meta
name=
"robots"
content=
"all,follow"
>
<title>
功能管理
</title>
<!-- Bootstrap CSS-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css"
>
<!-- Font Awesome CSS-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/vendor/font-awesome/css/font-awesome.min.css"
>
<!-- Fontastic Custom icon font-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/fontastic.css"
>
<!-- Google fonts - Poppins -->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/font-css.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
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/juery-ui-1.12.css"
>
<!-- Favicon-->
<link
rel=
"shortcut icon"
href=
"https://img.geexek.com/files/home/favicon.ico"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/custom.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/main.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/setting.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<script
src=
"${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"
></script>
<script
src=
"${ctxStatic}/newdermon/js/jquery-ui.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"${ctxStatic}/layer/layer.js"
></script>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/layer/skin/layer.css"
>
<script
src=
"${ctxStatic}/js/cmptSetting.js?
<%=
System
.
currentTimeMillis
()
%>
"
></script>
<style>
.tip-one
{
width
:
21px
;
height
:
21px
;
border-radius
:
50%
;
background
:
#ce3939
;
color
:
white
;
display
:
inline-block
;
font-size
:
12px
;
text-align
:
center
;
line-height
:
21px
;
}
.tip-txt
{
font-size
:
16px
;
color
:
rgba
(
206
,
57
,
57
,
1
);
}
.tip
{
margin-bottom
:
35px
;
}
.arrow
{
position
:
absolute
;
right
:
9px
;
top
:
1px
;
width
:
48px
;
}
.t-i-x
{
display
:
flex
!important
;
width
:
100%
;
height
:
60px
;
padding
:
4%
!important
;
margin-top
:
-16px
!important
;
}
.t-i-1
{
flex
:
2
;
height
:
60px
;
}
.t-i-2
{
flex
:
7
;
font-size
:
13px
;
height
:
60px
;
margin-top
:
-14px
;
padding
:
0px
7px
;
text-align
:
left
;
}
.tip-1
{
width
:
14px
;
height
:
14px
;
font-size
:
9px
;
line-height
:
14px
;
background
:
#F45F13
;
}
</style>
</head>
<body>
<jsp:include
page=
"../common/header.jsp"
></jsp:include>
<div
class=
"page-content d-flex align-items-stretch main-body"
>
<!-- Side Navbar -->
<jsp:include
page=
"../common/menu.jsp"
></jsp:include>
<!-- right是右边容器 直接将wzm-content放入到您的容器中即可 不需要right -->
<div
class=
"rght"
>
<div
class=
"wzm-content"
>
<p
style=
"font-size: 24px;color: #333333;"
>
位置固定功能
</p>
<div
class=
"fixed"
style=
"height: 320px;"
>
<div
class=
"wzm-content-item yellow"
style=
"width: 434px"
>
<div
class=
"t"
>
<div
class=
"content"
>
<div
class=
"t-i t-i-x"
style=
"width: 100%;"
>
<span
class=
"t-i-1"
>
手机绑定
</span>
<span
class=
"t-i-2"
><span
class=
"tip-one tip-1"
>
注
</span>
请在完成计时名单导入后启用此功能,启用此功能后,才能启用仅能向选手开发的功能:我的成绩、我的相册、联系救援、签到检录、路线导入
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.mobile == 1?'checked':'unchecked'}"
data-attr=
"mobile"
>
<span
class=
"txt"
>
${setting.mobile == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
<div
class=
"wzm-content-item blue"
>
<div
class=
"t"
>
<div
class=
"content"
>
<div
class=
"t-i"
>
<span>
比赛倒计时
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.countDown == 1?'checked':'unchecked'}"
data-attr=
"countDown"
>
<span
class=
"txt"
>
${setting.countDown == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
<div
class=
"wzm-content-item light-blue"
data-id=
""
>
<div
class=
"t"
>
<div
class=
"content"
>
<div
class=
"t-i"
>
<span>
赛事公告
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.news == 1?'checked':'unchecked'}"
data-attr=
"news"
>
<span
class=
"txt"
>
${setting.news == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
<div
class=
"wzm-content-item yellow"
data-id=
""
>
<div
class=
"t"
>
<div
class=
"content"
>
<img
src=
"/static/images/arrow.png"
alt=
""
class=
"arrow"
>
<div
class=
"t-i"
>
<span>
赛事广告
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.banner == 1?'checked':'unchecked'}"
data-attr=
"banner"
>
<span
class=
"txt"
>
${setting.banner == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
<div
class=
"wzm-content-item blue"
data-id=
""
>
<div
class=
"t"
>
<div
class=
"content"
>
<img
src=
"/static/images/arrow.png"
alt=
""
class=
"arrow"
>
<div
class=
"t-i"
>
<span>
赛事客服
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.customer == 1?'checked':'unchecked'}"
data-attr=
"customer"
>
<span
class=
"txt"
>
${setting.customer == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
</div>
<p
style=
"font-size: 24px;color: #333333;"
>
可排序功能
</p>
<div
class=
"sort"
id=
"sortable"
style=
"clear: both;"
>
<div
class=
"tip"
>
<span
class=
"tip-one"
>
注
</span>
<span
class=
"tip-txt"
>
下列功能可通过拖拽进行排序,直接影响本赛事小程序的功能列表顺序
</span>
</div>
<c:forEach
var=
"func"
items=
"
${
funcs
}
"
>
<div
class=
"wzm-content-item ${func.style}"
data-id=
"${func.id}"
>
<div
class=
"t"
>
<div
class=
"content"
>
<c:if
test=
"
${
func
.
type
==
3
||
func
.
type
==
4
||
func
.
type
==
6
||
func
.
type
==
7
||
func
.
type
==
8
||
func
.
type
==
9
}
"
>
<img
src=
"/static/images/arrow.png"
alt=
""
class=
"arrow"
>
</c:if>
<div
class=
"t-i"
>
<span>
${func.name}
</span>
<%@ 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=
"ctxStatic"
value=
"
${
pageContext
.
request
.
contextPath
}
/static"
/>
<c:set
var=
"jaaproot"
value=
"
${
pageContext
.
request
.
contextPath
}
"
/>
<!doctype html>
<html>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<meta
name=
"robots"
content=
"all,follow"
>
<title>
功能管理
</title>
<!-- Bootstrap CSS-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css"
>
<!-- Font Awesome CSS-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/vendor/font-awesome/css/font-awesome.min.css"
>
<!-- Fontastic Custom icon font-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/fontastic.css"
>
<!-- Google fonts - Poppins -->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/font-css.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
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/juery-ui-1.12.css"
>
<!-- Favicon-->
<link
rel=
"shortcut icon"
href=
"https://img.geexek.com/files/home/favicon.ico"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/custom.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/main.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/setting.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<script
src=
"${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"
></script>
<script
src=
"${ctxStatic}/newdermon/js/jquery-ui.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"${ctxStatic}/layer/layer.js"
></script>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/layer/skin/layer.css"
>
<script
src=
"${ctxStatic}/js/cmptSetting.js?
<%=
System
.
currentTimeMillis
()
%>
"
></script>
<style>
.form-group
{
margin-bottom
:
15px
;
}
.layui-layer-title
{
color
:
white
;
}
.layui-layer-btn
{
color
:
white
;
}
.form-group
label
{
display
:
block
;
margin-bottom
:
5px
;
}
.Wdate
{
width
:
100%
;
padding
:
15px
;
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
}
.tip-one
{
width
:
21px
;
height
:
21px
;
border-radius
:
50%
;
background
:
#ce3939
;
color
:
white
;
display
:
inline-block
;
font-size
:
12px
;
text-align
:
center
;
line-height
:
21px
;
}
.tip-txt
{
font-size
:
16px
;
color
:
rgba
(
206
,
57
,
57
,
1
);
}
.tip
{
margin-bottom
:
35px
;
}
.arrow
{
position
:
absolute
;
right
:
9px
;
top
:
1px
;
width
:
48px
;
}
.t-i-x
{
display
:
flex
!important
;
width
:
100%
;
height
:
60px
;
padding
:
4%
!important
;
margin-top
:
-16px
!important
;
}
.t-i-1
{
flex
:
2
;
height
:
60px
;
}
.t-i-2
{
flex
:
7
;
font-size
:
13px
;
height
:
60px
;
margin-top
:
-14px
;
padding
:
0px
7px
;
text-align
:
left
;
}
.tip-1
{
width
:
14px
;
height
:
14px
;
font-size
:
9px
;
line-height
:
14px
;
background
:
#F45F13
;
}
</style>
</head>
<body>
<jsp:include
page=
"../common/header.jsp"
></jsp:include>
<div
class=
"page-content d-flex align-items-stretch main-body"
>
<!-- Side Navbar -->
<jsp:include
page=
"../common/menu.jsp"
></jsp:include>
<!-- right是右边容器 直接将wzm-content放入到您的容器中即可 不需要right -->
<div
class=
"rght"
>
<div
class=
"wzm-content"
>
<p
style=
"font-size: 24px;color: #333333;"
>
位置固定功能
</p>
<div
class=
"fixed"
style=
"height: 320px;"
>
<div
class=
"wzm-content-item yellow"
style=
"width: 434px"
>
<div
class=
"t"
>
<div
class=
"content"
>
<div
class=
"t-i t-i-x"
style=
"width: 100%;"
>
<span
class=
"t-i-1"
>
手机绑定
</span>
<span
class=
"t-i-2"
><span
class=
"tip-one tip-1"
>
注
</span>
请在完成计时名单导入后启用此功能,启用此功能后,才能启用仅能向选手开发的功能:我的成绩、我的相册、联系救援、签到检录、路线导入
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.mobile == 1?'checked':'unchecked'}"
data-attr=
"mobile"
>
<span
class=
"txt"
>
${setting.mobile == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
<div
class=
"wzm-content-item blue"
>
<div
class=
"t"
>
<div
class=
"content"
>
<div
class=
"t-i"
>
<span>
比赛倒计时
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.countDown == 1?'checked':'unchecked'}"
data-attr=
"countDown"
>
<span
class=
"txt"
>
${setting.countDown ==
1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
<div
class=
"wzm-content-item light-blue"
data-id=
""
>
<div
class=
"t"
>
<div
class=
"content"
>
<div
class=
"t-i"
>
<span>
赛事公告
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.news == 1?'checked':'unchecked'}"
data-attr=
"news"
>
<span
class=
"txt"
>
${setting.news == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
<div
class=
"wzm-content-item yellow"
data-id=
""
>
<div
class=
"t"
>
<div
class=
"content"
>
<img
src=
"/static/images/arrow.png"
alt=
""
class=
"arrow"
>
<div
class=
"t-i"
>
<span>
赛事广告
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.banner == 1?'checked':'unchecked'}"
data-attr=
"banner"
>
<span
class=
"txt"
>
${setting.banner == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
<div
class=
"wzm-content-item blue"
data-id=
""
>
<div
class=
"t"
>
<div
class=
"content"
>
<img
src=
"/static/images/arrow.png"
alt=
""
class=
"arrow"
>
<div
class=
"t-i"
>
<span>
赛事客服
</span>
</div>
</div>
</div>
<div
class=
"b"
>
<div
class=
"radio status ${setting.customer == 1?'checked':'unchecked'}"
data-attr=
"customer"
>
<span
class=
"txt"
>
${setting.customer == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
</div>
<p
style=
"font-size: 24px;color: #333333;"
>
可排序功能
</p>
<div
class=
"sort"
id=
"sortable"
style=
"clear: both;"
>
<div
class=
"tip"
>
<span
class=
"tip-one"
>
注
</span>
<span
class=
"tip-txt"
>
下列功能可通过拖拽进行排序,直接影响本赛事小程序的功能列表顺序
</span>
</div>
<c:forEach
var=
"func"
items=
"
${
funcs
}
"
>
<div
class=
"wzm-content-item ${func.style}"
data-id=
"${func.id}"
>
<div
class=
"t"
>
<div
class=
"content"
>
<c:if
test=
"
${
func
.
type
==
3
||
func
.
type
==
4
||
func
.
type
==
6
||
func
.
type
==
7
||
func
.
type
==
8
||
func
.
type
==
9
}
"
>
<img
src=
"/static/images/arrow.png"
alt=
""
class=
"arrow"
>
</c:if>
<div
class=
"t-i"
>
<span>
${func.name}
</span>
</div>
</div>
</div>
<div
data-status=
"${func.status}"
class=
"public ${func.status == 2 ? 'disabled':''} ${func.type == 11 ? 'disabled':''}"
>
<input
class=
"check-box"
type=
"checkbox"
${
func
.
status=
=1
?
'
checked
'
:func
.
status=
=2?'disabled':''}
${
func
.
type=
=11
?
'
disabled
'
:
''}
>
<span
class=
"public-text"
>
公开
</span>
</div>
<div
class=
"b"
>
<div
class=
"radio ${func.visibility == 1 ? 'checked':'unchecked'} status"
data-type=
"${func.type}"
data-visibility=
"${func.visibility}"
>
<span
class=
"txt"
>
${func.visibility ==
1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
</c:forEach>
</div>
</div>
</div>
</div>
</div>
</div>
<div
data-status=
"${func.status}"
class=
"public ${func.status == 2 ? 'disabled':''} ${func.type == 11 ? 'disabled':''}"
>
<input
class=
"check-box"
type=
"checkbox"
${
func
.
status =
=
1
?
'
checked
'
:func
.
status =
=
2
?'
disabled
'
:
''}
${
func
.
type =
=
11
?
'
disabled
'
:
''}
>
<span
class=
"public-text"
>
公开
</span>
</div>
<div
class=
"b"
>
<div
class=
"radio ${func.visibility == 1 ? 'checked':'unchecked'} status"
data-type=
"${func.type}"
data-visibility=
"${func.visibility}"
>
<span
class=
"txt"
>
${func.visibility == 1?'启动':'未启动'}
</span>
<span
class=
"dot"
></span>
</div>
</div>
</div>
</c:forEach>
</div>
</div>
</div>
</div>
<input
type=
"hidden"
id=
"autoscore"
value=
"${setting.switchScoreReview}"
>
</body>
<!-- JavaScript files-->
<script
src=
"${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"
></script>
<script
src=
"${ctxStatic}/newdermon/vendor/bootstrap/js/bootstrap.min.js"
></script>
<script
src=
"${ctxStatic}/newdermon/vendor/jquery.cookie/jquery.cookie.js"
></script>
<script
src=
"${ctxStatic}/newdermon/vendor/jquery-validation/jquery.validate.min.js"
></script>
<!-- Main File-->
<script
src=
"${ctxStatic}/newdermon/js/front.js"
></script>
<script
type=
"text/javascript"
>
var
ctx
=
'${ctx}'
,
ctxStatic
=
'${ctxStatic}'
;
</script>
</html>
\ No newline at end of file
<input
type=
"hidden"
id=
"autoscore"
value=
"${setting.switchScoreReview}"
>
</body>
<!-- JavaScript files-->
<script
src=
"${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"
></script>
<script
src=
"${ctxStatic}/newdermon/vendor/bootstrap/js/bootstrap.min.js"
></script>
<script
src=
"${ctxStatic}/newdermon/vendor/jquery.cookie/jquery.cookie.js"
></script>
<script
src=
"${ctxStatic}/newdermon/vendor/jquery-validation/jquery.validate.min.js"
></script>
<!-- Main File-->
<script
src=
"${ctxStatic}/newdermon/js/front.js"
></script>
<script
type=
"text/javascript"
>
var
ctx
=
'${ctx}'
,
ctxStatic
=
'${ctxStatic}'
;
</script>
<script
src=
"${ctxStatic}/My97DatePicker/WdatePicker.js"
type=
"text/javascript"
></script>
<script
type=
"text/javascript"
>
// 将Java对象转换为JSON字符串
let
cmptFuncs
=
JSON
.
parse
(
'${fns:toJson(funcs)}'
);
// console.log({ cmptFuncs })
</script>
</html>
\ No newline at end of file
src/main/webapp/WEB-INF/views/cmpt/module.jsp
View file @
c46469b4
...
...
@@ -396,6 +396,7 @@
</div>
<script
src=
"${ctxStatic}/vue/vue.js"
></script>
<script>
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/module'
+
'&cmptId='
+
getCId
()
var
app
=
new
Vue
({
el
:
'#module'
,
data
:
{
...
...
@@ -553,19 +554,19 @@
},
//文件上传处理
uploadFile
(
obj
)
{
logoF
ile
=
obj
.
target
.
files
[
0
];
if
(
logoFile
.
type
&&
logoF
ile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
f
ile
=
obj
.
target
.
files
[
0
];
if
(
logoFile
.
type
&&
f
ile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
return
layer
.
msg
(
'请上传图片'
,
{
icon
:
5
})
}
var
reads
=
new
FileReader
();
reads
.
readAsDataURL
(
logoF
ile
);
reads
.
readAsDataURL
(
f
ile
);
reads
.
onload
=
function
()
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"
uploadImg"
,
logoFile
);
formData
.
append
(
"
file"
,
formData
);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
url
:
uploadUrl
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
...
...
@@ -573,9 +574,7 @@
success
:
function
(
res
)
{
if
(
res
.
code
==
"1"
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
app
.
$data
.
module
.
icon
=
res
.
result
}
else
{
console
.
log
(
res
);
app
.
$data
.
module
.
icon
=
res
.
content
}
},
beforeSend
:
()
=>
{
...
...
src/main/webapp/WEB-INF/views/cmpt/outter-link.jsp
View file @
c46469b4
<%@ page
language=
"java"
contentType=
"text/html; charset=utf-8"
pageEncoding=
"utf-8"
%>
<%@ include
file=
"/WEB-INF/views/include/taglib.jsp"
%>
<%@ taglib
prefix=
"fn"
uri=
"http://java.sun.com/jsp/jstl/functions"
%>
<%@ taglib
prefix=
"fmt"
uri=
"http://java.sun.com/jsp/jstl/fmt"
%>
<!doctype html>
<html>
<head>
<title>
外部链接
</title>
<!-- Bootstrap CSS-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css"
>
<!-- Font Awesome CSS-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/vendor/font-awesome/css/font-awesome.min.css"
>
<!-- Fontastic Custom icon font-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/fontastic.css"
>
<!-- Google fonts - Poppins -->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/font-css.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
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/juery-ui-1.12.css"
>
<!-- Favicon-->
<link
rel=
"shortcut icon"
href=
"https://img.geexek.com/files/home/favicon.ico"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/custom.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/main.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/setting.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/leaflet/css/leaflet.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
/>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/leaflet/css/leaflet_label.css"
/>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/road.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
/>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/road-new.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
/>
<script
src=
"${ctxStatic}/My97DatePicker/WdatePicker.js"
type=
"text/javascript"
></script>
<script
src=
"${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"${ctxStatic}/layer/layer.js"
></script>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/layer/skin/layer.css"
>
<link
rel=
"stylesheet"
href=
"/static/cmpt/score.css?
<%=
System
.
currentTimeMillis
()
%>
"
>
<style>
.submit
{
display
:
inline-block
;
width
:
120px
;
height
:
45px
;
text-align
:
center
;
line-height
:
45px
;
color
:
white
;
background
:
#ce3939
;
border-radius
:
4px
;
letter-spacing
:
1px
;
cursor
:
pointer
;
font-size
:
16px
;
}
.label-box
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
}
label
{
/* width: auto; */
/* width: 200px; */
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
}
.cover
{
width
:
100%
;
height
:
100px
;
background
:
rgba
(
247
,
247
,
247
,
1
);
border-radius
:
4px
;
border
:
1px
solid
rgba
(
238
,
238
,
238
,
1
);
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.cover-img
{
width
:
300px
;
cursor
:
pointer
;
background-repeat
:
no-repeat
;
background-position
:
center
;
background-size
:
cover
;
height
:
300px
;
}
.rule-field
tbody
tr
td
{
height
:
auto
!important
;
font-size
:
16px
!important
;
line-height
:
1.2
!important
;
}
.icon-cover
{
width
:
34px
;
height
:
34px
;
background-image
:
url("/static/images/icon_cover.png")
;
background-size
:
100%
;
background-repeat
:
no-repeat
;
}
.cancel
{
width
:
120px
;
height
:
45px
;
background
:
#949494
;
border-radius
:
4px
;
font-size
:
16px
;
color
:
#FFFFFF
;
line-height
:
45px
;
text-align
:
center
;
margin-right
:
20px
;
}
.dialog
label
input
{
width
:
20px
!important
;
height
:
20px
!important
;
margin
:
0
10px
!important
;
}
.input
{
width
:
100%
;
height
:
40px
!important
;
line-height
:
40px
!important
;
border
:
2px
solid
#F4F4F4
;
border-radius
:
4px
;
margin-right
:
30px
;
margin-left
:
0px
;
padding-left
:
12px
;
background
:
rgba
(
247
,
247
,
247
,
1
);
border-radius
:
4px
;
border
:
1px
solid
rgba
(
229
,
229
,
229
,
1
);
}
.title
{
font-size
:
24px
;
width
:
300px
;
font-weight
:
500
;
color
:
rgba
(
51
,
51
,
51
,
1
);
}
.title-new
{
font-size
:
20px
;
color
:
rgba
(
51
,
51
,
51
,
1
);
margin-right
:
15px
;
width
:
80px
;
}
.section
{
display
:
flex
;
background
:
rgba
(
255
,
255
,
255
,
1
);
border-radius
:
4px
;
flex-direction
:
column
;
}
.func
{
display
:
flex
;
flex-direction
:
column
;
padding
:
5px
0
;
/*height: 90px;*/
}
.tip
{
font-size
:
16px
;
color
:
rgba
(
51
,
51
,
51
,
1
);
position
:
absolute
;
right
:
45px
;
top
:
10px
;
}
.road-notice
{
top
:
16px
;
height
:
15px
;
width
:
15px
;
}
.road-notice-txt
{
color
:
rgb
(
206
,
57
,
57
);
font-size
:
16px
;
/*width: 430px;*/
display
:
inline-block
;
}
.saveDiv
{
display
:
flex
;
justify-content
:
flex-end
;
margin
:
30px
20px
;
}
</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
class=
"rght"
id=
"letter"
>
<div
class=
"section"
>
<h3
class=
"title"
>
外链功能
</h3>
<div
class=
"add-btn"
@
click=
"switchDialog"
>
<span>
+
</span>
<span>
添加外链项
</span>
</div>
</div>
<div
style=
"margin-top: -10px;margin-bottom: 50px"
>
<table
style=
"width: 100%"
class=
"rule-field"
>
<colgroup>
<col
style=
"width:25%"
>
<col
style=
"width:10%"
>
<col
style=
"width:10%"
>
<col
style=
"width:35%"
>
<col
style=
"width:20%"
>
</colgroup>
<thead>
<tr>
<th
style=
"text-align: center"
>
功能名称
</th>
<th
style=
"text-align: center"
>
图标
</th>
<th
style=
"text-align: center"
>
类型
</th>
<th
style=
"text-align: center"
>
外部链接
</th>
<th
style=
"text-align: center"
>
操作
</th>
</tr>
</thead>
<tbody>
<tr
v-if=
""
v-for=
"item in list"
:data-id=
"item.id"
>
<td
class=
"name"
v-text=
"item.nameWeb"
style=
"text-align: center"
></td>
<td
style=
"text-align: center"
>
<span
v-if=
"!item.icon"
>
未设置
</span>
<img
v-else
:src=
"item.icon"
style=
"width:80px;height:80px;object-fit:cover;"
/>
</td>
<td
style=
"text-align: center"
>
<span
v-if=
"item.openType"
v-text=
"typeDesc[item.openType].label"
></span>
<span
v-else
>
未设置
</span>
</td>
<td
style=
"text-align: left;position: relative;"
>
<span
v-text=
"item.appId"
></span>
</td>
<td
style=
"text-align: center"
>
<div
style=
"display: flex;flex-direction: row;align-items: center;width:100%;justify-content: space-around;"
>
<div
class=
"opt edit.opt"
@
click=
"edit(item.id)"
>
<span
class=
"icon-edit"
></span><span
class=
"edit"
>
编辑
</span>
<%@ include
file=
"/WEB-INF/views/include/taglib.jsp"
%>
<%@ taglib
prefix=
"fn"
uri=
"http://java.sun.com/jsp/jstl/functions"
%>
<%@ taglib
prefix=
"fmt"
uri=
"http://java.sun.com/jsp/jstl/fmt"
%>
<!doctype html>
<html>
<head>
<title>
外部链接
</title>
<!-- Bootstrap CSS-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css"
>
<!-- Font Awesome CSS-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/vendor/font-awesome/css/font-awesome.min.css"
>
<!-- Fontastic Custom icon font-->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/fontastic.css"
>
<!-- Google fonts - Poppins -->
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/font-css.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
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/juery-ui-1.12.css"
>
<!-- Favicon-->
<link
rel=
"shortcut icon"
href=
"https://img.geexek.com/files/home/favicon.ico"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/custom.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/main.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/setting.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/road.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
/>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/road-new.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
/>
<script
src=
"https://enroll.geexek.com/js/ueditor/ueditor.config-zs.js?v=
<%=
System
.
currentTimeMillis
()
%>
"
></script>
<script
src=
"https://enroll.geexek.com/js/ueditor/ueditor.all.js?v=
<%=
System
.
currentTimeMillis
()
%>
"
></script>
<script
src=
"${ctxStatic}/My97DatePicker/WdatePicker.js"
type=
"text/javascript"
></script>
<script
src=
"${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"
></script>
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"${ctxStatic}/layer/layer.js"
></script>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/layer/skin/layer.css"
>
<link
rel=
"stylesheet"
href=
"/static/cmpt/score.css?
<%=
System
.
currentTimeMillis
()
%>
"
>
<style>
.submit
{
display
:
inline-block
;
width
:
120px
;
height
:
45px
;
text-align
:
center
;
line-height
:
45px
;
color
:
white
;
background
:
#ce3939
;
border-radius
:
4px
;
letter-spacing
:
1px
;
cursor
:
pointer
;
font-size
:
16px
;
}
.edui-default
.edui-editor
{
width
:
auto
!important
;
}
.label-box
{
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
}
label
{
/* width: auto; */
/* width: 200px; */
display
:
flex
;
flex-direction
:
row
;
align-items
:
center
;
}
.cover
{
width
:
100%
;
height
:
100px
;
background
:
rgba
(
247
,
247
,
247
,
1
);
border-radius
:
4px
;
border
:
1px
solid
rgba
(
238
,
238
,
238
,
1
);
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
.cover-img
{
width
:
300px
;
cursor
:
pointer
;
background-repeat
:
no-repeat
;
background-position
:
center
;
background-size
:
cover
;
height
:
300px
;
}
.rule-field
tbody
tr
td
{
height
:
auto
!important
;
font-size
:
16px
!important
;
line-height
:
1.2
!important
;
}
.icon-cover
{
width
:
34px
;
height
:
34px
;
background-image
:
url("/static/images/icon_cover.png")
;
background-size
:
100%
;
background-repeat
:
no-repeat
;
}
.cancel
{
width
:
120px
;
height
:
45px
;
background
:
#949494
;
border-radius
:
4px
;
font-size
:
16px
;
color
:
#FFFFFF
;
line-height
:
45px
;
text-align
:
center
;
margin-right
:
20px
;
}
.dialog
label
input
{
width
:
20px
!important
;
height
:
20px
!important
;
margin
:
0
10px
!important
;
}
.input
{
width
:
100%
;
height
:
40px
!important
;
line-height
:
40px
!important
;
border
:
2px
solid
#F4F4F4
;
border-radius
:
4px
;
margin-right
:
30px
;
margin-left
:
0px
;
padding-left
:
12px
;
background
:
rgba
(
247
,
247
,
247
,
1
);
border-radius
:
4px
;
border
:
1px
solid
rgba
(
229
,
229
,
229
,
1
);
}
.title
{
font-size
:
24px
;
width
:
300px
;
font-weight
:
500
;
color
:
rgba
(
51
,
51
,
51
,
1
);
}
.title-new
{
font-size
:
20px
;
color
:
rgba
(
51
,
51
,
51
,
1
);
margin-right
:
15px
;
width
:
80px
;
}
.section
{
display
:
flex
;
background
:
rgba
(
255
,
255
,
255
,
1
);
border-radius
:
4px
;
flex-direction
:
column
;
}
.func
{
display
:
flex
;
flex-direction
:
column
;
padding
:
5px
0
;
/*height: 90px;*/
}
.tip
{
font-size
:
16px
;
color
:
rgba
(
51
,
51
,
51
,
1
);
position
:
absolute
;
right
:
45px
;
top
:
10px
;
}
.road-notice
{
top
:
16px
;
height
:
15px
;
width
:
15px
;
}
.road-notice-txt
{
color
:
rgb
(
206
,
57
,
57
);
font-size
:
16px
;
/*width: 430px;*/
display
:
inline-block
;
}
.saveDiv
{
display
:
flex
;
justify-content
:
flex-end
;
margin
:
30px
20px
;
}
</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
class=
"rght"
id=
"letter"
>
<div
class=
"section"
>
<h3
class=
"title"
>
外链功能
</h3>
<div
class=
"add-btn"
@
click=
"addOutLink"
>
<span>
+
</span>
<span>
添加外链项
</span>
</div>
</div>
<div
style=
"margin-top: -10px;margin-bottom: 50px"
>
<table
style=
"width: 100%"
class=
"rule-field"
>
<colgroup>
<col
style=
"width:25%"
>
<col
style=
"width:10%"
>
<col
style=
"width:10%"
>
<col
style=
"width:35%"
>
<col
style=
"width:20%"
>
</colgroup>
<thead>
<tr>
<th
style=
"text-align: center"
>
功能名称
</th>
<th
style=
"text-align: center"
>
图标
</th>
<th
style=
"text-align: center"
>
类型
</th>
<th
style=
"text-align: center"
>
外部链接
</th>
<th
style=
"text-align: center"
>
操作
</th>
</tr>
</thead>
<tbody>
<tr
v-if=
""
v-for=
"item in list"
:data-id=
"item.id"
>
<td
class=
"name"
v-text=
"item.nameWeb"
style=
"text-align: center"
></td>
<td
style=
"text-align: center"
>
<span
v-if=
"!item.icon"
>
未设置
</span>
<img
v-else
:src=
"item.icon"
style=
"width:80px;height:80px;object-fit:cover;"
/>
</td>
<td
style=
"text-align: center"
>
<span
v-if=
"item.openType"
v-text=
"typeDesc[item.openType].label"
></span>
<span
v-else
>
未设置
</span>
</td>
<td
style=
"text-align: left;position: relative;"
>
<span
v-text=
"item.appId"
></span>
</td>
<td
style=
"text-align: center"
>
<div
style=
"display: flex;flex-direction: row;align-items: center;width:100%;justify-content: space-around;"
>
<div
class=
"opt edit.opt"
@
click=
"edit(item.id)"
>
<span
class=
"icon-edit"
></span><span
class=
"edit"
>
编辑
</span>
</div>
<div
class=
"opt del"
style=
"display: flex"
@
click=
"del(item.id)"
>
<span
class=
"icon-del"
></span><span
class=
"del"
>
删除
</span>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div
class=
"dialog"
v-show=
"dialog"
style=
"width: 710px ;height: auto;padding-bottom:10px;z-index: 99;"
>
<div>
<span
class=
"title"
style=
"margin-bottom: 10px;color: #CE3939"
>
外链功能设置
</span>
</div>
<div
class=
"func"
>
<div
style=
"position: relative;"
>
<span
class=
"title-new"
>
功能名称
</span>
<span
class=
"road-notice"
></span>
<span
class=
"road-notice-txt"
>
此名称用于展示给选手,只能使用中文,且不能超过10个字。
</span>
</div>
<div
style=
"position: relative;"
>
<input
@
input=
"count"
class=
"input"
type=
"text"
v-model=
"letter.nameWeb"
placeholder=
"请输入功能名称,最多10个字符"
>
<span
class=
"tip"
>
{{letter.nameWeb.length}}/10
</span>
</div>
</div>
<!-- 类型 (type) -->
<div
class=
"func"
>
<span
class=
"title-new"
style=
"width:auto;display: flex;align-items: baseline;"
>
<span
style=
"flex-shrink: 0;"
>
类型
</span>
<span
style=
"font-size: 12px;display: inline-block;border-radius: 50%;height: 18px;width: 18px;background: #ce3939;color: white;text-align: center;margin-left: 10px;"
>
注
</span>
<span
class=
"road-notice-txt"
style=
"display: flex;height:auto;"
>
{{typeDesc[letter.openType].desc}}
</span>
</span>
<div
class=
"label-box"
>
<label
v-for=
"item in typeOptions"
:key=
"item.value"
>
<input
type=
"radio"
v-model=
"letter.openType"
:value=
"item.value"
>
{{item.name}}
</label>
</div>
</div>
<div
class=
"func"
>
<span
class=
"title-new"
>
图标
</span>
<span
style=
"font-size: 16px;color: #ce3939;margin:10px 0;"
>
<span
style=
"font-size: 12px;display: inline-block;border-radius: 50%;height: 18px;width: 18px;background: #ce3939;color: white;text-align: center;"
>
注
</span>
<span
style=
"display: inline"
>
建议分辨率80*80
</span>
</span>
<div>
<label
for=
"icon"
>
<div
v-if=
"!letter.icon"
class=
"cover"
>
<span
class=
"icon-cover"
></span>
</div>
<img
v-else
class=
"cover cover-img"
:src=
"letter.icon"
/>
</label>
<input
id=
"icon"
type=
"file"
style=
"display: none"
@
change=
"uploadIconFile"
>
</div>
</div>
<div
class=
"func"
>
<span
class=
"title-new"
>
有效期
</span>
<div
class=
"label-box"
>
<label>
<input
type=
"radio"
v-model=
"letter.needTime"
value=
"0"
>
关闭
</label>
<label>
<input
type=
"radio"
v-model=
"letter.needTime"
value=
"1"
>
开启
</label>
</div>
</div>
<div
class=
"func"
v-if=
"letter.needTime == 1"
>
<span
class=
"title-new"
>
开始时间
</span>
<div
style=
"position: relative;width: 400px"
>
<input
class=
"input"
type=
"text"
v-model=
"letter.startTime"
@
click=
"openStartTimePicker"
placeholder=
"请选择开始时间"
>
</div>
</div>
<div
class=
"func"
v-if=
"letter.needTime == 1"
>
<span
class=
"title-new"
>
结束时间
</span>
<div
style=
"position: relative;width: 400px"
>
<input
class=
"input"
type=
"text"
v-model=
"letter.deadTime"
@
click=
"openDeadTimePicker"
placeholder=
"请选择结束时间"
>
</div>
</div>
<div
class=
"func"
v-if=
"letter.openType == 2"
>
<span
class=
"title-new"
>
APP ID
</span>
<div
style=
"position: relative;width: 400px"
>
<input
class=
"input"
type=
"text"
v-model=
"letter.appId"
placeholder=
"请输入目标小程序的ID"
>
</div>
<div
style=
"position: relative;width: 440px"
>
</span>
</div>
</div>
<div
class=
"func"
v-if=
"letter.openType != 0&&![5,6].includes(letter.openType)"
>
<span
class=
"title-new"
>
{{typeDesc[letter.openType].label}}
</span>
<div
style=
"position: relative;width: 400px"
>
<input
class=
"input"
type=
"text"
v-model=
"letter.url"
:placeholder=
"typeDesc[letter.openType].placeholder"
>
</div>
</div>
<div
class=
"func"
v-if=
"[5,6].includes(letter.openType)"
>
<span
class=
"title-new"
>
{{typeDesc[letter.openType].label}}
</span>
<div>
<label
for=
"url"
>
<div
v-if=
"!letter.url"
class=
"cover"
>
<span
class=
"icon-cover"
></span>
</div>
<span
v-else
>
{{letter.url}}
</span>
</label>
<input
id=
"url"
type=
"file"
style=
"display: none"
@
change=
"uploadFile"
>
</div>
</div>
<div
class=
"func"
v-show=
"letter.openType == 0"
>
<span
class=
"title-new"
>
内容
</span>
<div
id=
"container"
></div>
</div>
<div
class=
"saveDiv"
>
<span
v-on:click=
"cancel"
class=
"cancel"
>
取消
</span>
<span
v-on:click=
"save"
class=
"submit"
>
保存
</span>
</div>
</div>
<div
class=
"opt del"
style=
"display: flex"
@
click=
"del(item.id)"
>
<span
class=
"icon-del"
></span><span
class=
"del"
>
删除
</span>
<div
v-show=
"dialog"
style=
"position: fixed;height: 100%;width: 100%;background: black;z-index: 10;opacity: 0.5;top:0px;left:0px"
>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div
class=
"dialog"
v-show=
"dialog"
style=
"width: 710px ;height: auto;padding-bottom:10px;z-index: 99;"
>
<div>
<span
class=
"title"
style=
"margin-bottom: 10px;color: #CE3939"
>
外链功能设置
</span>
</div>
<div
class=
"func"
>
<div
style=
"position: relative;"
>
<span
class=
"title-new"
>
功能名称
</span>
<span
class=
"road-notice"
></span>
<span
class=
"road-notice-txt"
>
此名称用于展示给选手,只能使用中文,且不能超过10个字。
</span>
</div>
<div
style=
"position: relative;"
>
<input
@
input=
"count"
class=
"input"
type=
"text"
v-model=
"letter.nameWeb"
placeholder=
"请输入功能名称,最多10个字符"
>
<span
class=
"tip"
>
{{letter.nameWeb.length}}/10
</span>
</div>
</div>
<!-- 类型 (type) -->
<div
class=
"func"
>
<span
class=
"title-new"
>
类型
</span>
<div
class=
"label-box"
>
<label
v-for=
"item in typeOptions"
:key=
"item.value"
>
<input
type=
"radio"
v-model=
"letter.openType"
:value=
"item.value"
>
{{item.name}}
</label>
</div>
</div>
<div
class=
"func"
>
<span
class=
"title-new"
>
图标
</span>
<span
style=
"font-size: 16px;color: #ce3939;margin:10px 0;"
>
<span
style=
"font-size: 12px;display: inline-block;border-radius: 50%;height: 18px;width: 18px;background: #ce3939;color: white;text-align: center;"
>
注
</span>
<span
style=
"display: inline"
>
建议分辨率80*80
</span>
</span>
<div>
<label
for=
"icon"
>
<div
v-if=
"!letter.icon"
class=
"cover"
>
<span
class=
"icon-cover"
></span>
</div>
<img
v-else
class=
"cover cover-img"
:src=
"letter.icon"
/>
</label>
<input
id=
"icon"
type=
"file"
style=
"display: none"
@
change=
"uploadIconFile"
>
</div>
</div>
<div
class=
"func"
>
<span
class=
"title-new"
>
APP ID
</span>
<div
style=
"position: relative;width: 400px"
>
<input
class=
"input"
type=
"text"
v-model=
"letter.appId"
placeholder=
"请输入目标小程序的ID"
>
</div>
<div
style=
"position: relative;width: 440px"
>
</span>
</div>
</div>
<div
class=
"func"
>
<span
class=
"title-new"
>
{{typeDesc[letter.openType].label}}
</span>
<div
style=
"position: relative;width: 400px"
>
<input
class=
"input"
type=
"text"
v-model=
"letter.url"
:placeholder=
"typeDesc[letter.openType].placeholder"
>
</div>
</div>
<div
class=
"saveDiv"
>
<span
v-on:click=
"cancel"
class=
"cancel"
>
取消
</span>
<span
v-on:click=
"save"
class=
"submit"
>
保存
</span>
</div>
</div>
<div
v-show=
"dialog"
style=
"position: fixed;height: 100%;width: 100%;background: black;z-index: 10;opacity: 0.5;top:0px;left:0px"
>
</div>
</div>
<script
src=
"${ctxStatic}/vue/vue.js"
></script>
<script>
var
customerV
=
new
Vue
({
el
:
'#letter'
,
data
:
{
letter
:
{
id
:
''
,
nameWeb
:
''
,
cmptId
:
getCId
(),
icon
:
''
,
openType
:
1
,
appId
:
''
,
path
:
''
},
list
:
[],
dialog
:
false
,
// 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
typeDesc
:
{
1
:
{
label
:
'网页'
,
placeholder
:
'请输入网页地址'
,
},
2
:
{
label
:
'小程序'
,
placeholder
:
'请输入小程序地址'
,
},
3
:
{
label
:
'短链接'
,
placeholder
:
'请输入短链接地址'
,
},
4
:
{
label
:
'页面'
,
placeholder
:
'请输入页面地址'
,
},
5
:
{
label
:
'文档'
,
placeholder
:
'请输入文档地址'
,
},
6
:
{
label
:
'图片'
,
placeholder
:
'请输入图片地址'
,
},
7
:
{
label
:
'经纬度'
,
placeholder
:
'请输入图片地址'
,
}
},
typeOptions
:
[
{
name
:
'H5'
,
value
:
1
,
},
{
name
:
'小程序'
,
value
:
2
,
},
{
name
:
'短链接'
,
value
:
3
,
},
{
name
:
'内部页面'
,
value
:
4
,
},
{
name
:
'文档'
,
value
:
5
,
},
{
name
:
'图片'
,
value
:
6
,
},
{
name
:
'地图'
,
value
:
7
,
}
],
},
methods
:
{
switchDialog
:
function
()
{
customerV
.
$data
.
letter
.
nameWeb
=
""
;
customerV
.
$data
.
letter
.
id
=
""
;
customerV
.
$data
.
letter
.
appId
=
""
;
customerV
.
$data
.
letter
.
url
=
""
;
customerV
.
$data
.
letter
.
path
=
""
;
customerV
.
$data
.
letter
.
openType
=
1
;
customerV
.
$data
.
letter
.
icon
=
""
;
customerV
.
$data
.
dialog
=
!
customerV
.
$data
.
dialog
;
},
count
:
function
()
{
if
(
customerV
.
$data
.
letter
.
nameWeb
.
length
>
10
)
{
customerV
.
$data
.
letter
.
nameWeb
=
customerV
.
$data
.
letter
.
nameWeb
.
substr
(
0
,
10
)
}
},
edit
:
function
(
id
)
{
customerV
.
getFunc
(
id
);
},
del
:
function
(
id
)
{
layer
.
confirm
(
"确认要删除吗?"
,
function
()
{
$
.
ajax
({
url
:
'/gk/sure-letter/delFunc/'
+
id
,
beforeSend
:
function
()
{
var
index
=
layer
.
load
()
setTimeout
(
function
()
{
layer
.
close
(
index
);
},
1500
)
},
success
:
function
(
data
)
{
layer
.
msg
(
'删除成功!'
);
customerV
.
queryAll
();
}
});
});
},
save
:
function
()
{
if
(
customerV
.
$data
.
letter
.
nameWeb
.
length
==
0
)
{
layer
.
msg
(
"功能名称不能为空!"
,
{
icon
:
5
,
duration
:
1500
});
return
;
}
if
(
customerV
.
$data
.
letter
.
appId
.
length
==
0
)
{
layer
.
msg
(
"AppId不能为空!"
,
{
icon
:
5
,
duration
:
1500
});
return
;
}
$
.
ajax
({
url
:
'/gk/sure-letter/updateName'
,
data
:
customerV
.
$data
.
letter
,
type
:
'post'
,
beforeSend
:
function
()
{
var
index
=
layer
.
load
()
setTimeout
(
function
()
{
layer
.
close
(
index
);
},
1500
)
},
success
:
function
(
data
)
{
layer
.
msg
(
'保存成功!'
);
customerV
.
$data
.
dialog
=
false
;
customerV
.
queryAll
();
}
})
},
cancel
:
function
()
{
customerV
.
$data
.
dialog
=
false
;
},
queryAll
:
function
()
{
if
(
getCId
())
{
$
.
ajax
({
url
:
'/gk/sure-letter/queryAllThirdMicros?cmptId='
+
getCId
(),
success
:
function
(
data
)
{
customerV
.
$data
.
list
=
data
.
content
;
}
})
}
},
getFunc
:
function
(
id
)
{
$
.
ajax
({
url
:
'/gk/sure-letter/getFunc/'
+
id
,
success
:
function
(
data
)
{
if
(
data
.
content
)
{
customerV
.
$data
.
letter
=
data
.
content
;
customerV
.
$data
.
dialog
=
true
;
}
}
});
},
//文件上传处理
uploadIconFile
(
obj
)
{
logoFile
=
obj
.
target
.
files
[
0
];
if
(
logoFile
.
type
&&
logoFile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
return
layer
.
msg
(
'请上传图片'
,
{
icon
:
5
})
}
var
reads
=
new
FileReader
();
reads
.
readAsDataURL
(
logoFile
);
reads
.
onload
=
function
()
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"uploadImg"
,
logoFile
);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
success
:
function
(
res
)
{
if
(
res
.
code
==
"1"
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
customerV
.
$data
.
letter
.
icon
=
res
.
result
}
else
{
console
.
log
(
res
);
<script
src=
"${ctxStatic}/vue/vue.js"
></script>
<script>
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/outer-link'
+
'&cmptId='
+
getCId
()
const
app
=
new
Vue
({
el
:
'#letter'
,
data
:
{
editor
:
null
,
// 富文本编辑器
letter
:
{
id
:
''
,
nameWeb
:
''
,
cmptId
:
getCId
(),
icon
:
''
,
openType
:
1
,
appId
:
''
,
path
:
''
,
content
:
''
,
needTime
:
0
,
startTime
:
null
,
deadTime
:
null
,
},
list
:
[],
dialog
:
false
,
// 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
typeDesc
:
{
0
:
{
label
:
'文本'
,
placeholder
:
'请输入文本内容'
,
desc
:
'富文本内容'
,
},
1
:
{
label
:
'网页'
,
placeholder
:
'请输入网页地址'
,
desc
:
'网址必须是赛客内部网址,如果是公众号文章,需要将赛客比赛助手绑定到对应的公众号'
,
},
2
:
{
label
:
'小程序'
,
placeholder
:
'请输入小程序地址'
,
desc
:
'小程序跳转需要填跳转路径和appId'
,
},
3
:
{
label
:
'短链接'
,
placeholder
:
'请输入短链接地址'
,
desc
:
'短链接指的是微信小程序的短连接'
,
},
4
:
{
label
:
'页面'
,
placeholder
:
'请输入页面地址'
,
desc
:
'页面指的是赛客比赛助手的页面,如pages/race/raceHome'
,
},
5
:
{
label
:
'文档'
,
placeholder
:
'请输入文档地址'
,
desc
:
'直接上传文档即可(.pdf,.docx)'
,
},
6
:
{
label
:
'图片'
,
placeholder
:
'请输入图片地址'
,
desc
:
'直接上传对应的图片即可(png,jpg,jpeg)'
,
},
7
:
{
label
:
'经纬度'
,
placeholder
:
'请输入经纬度,逗号隔开'
,
desc
:
'请输入文本内容'
,
}
},
typeOptions
:
[
{
name
:
'文本'
,
value
:
0
},
{
name
:
'H5'
,
value
:
1
,
},
{
name
:
'小程序'
,
value
:
2
,
},
{
name
:
'短链接'
,
value
:
3
,
},
{
name
:
'内部页面'
,
value
:
4
,
},
{
name
:
'文档'
,
value
:
5
,
},
{
name
:
'图片'
,
value
:
6
,
},
{
name
:
'地图'
,
value
:
7
,
}
],
},
mounted
()
{
const
editor
=
UE
.
getEditor
(
'container'
);
this
.
editor
=
editor
this
.
queryAll
()
},
methods
:
{
// 日期选择
openStartTimePicker
:
function
()
{
WdatePicker
({
dateFmt
:
'yyyy-MM-dd HH:mm:ss'
,
onpicked
:
(
dp
)
=>
{
this
.
letter
.
startTime
=
dp
.
cal
.
getNewDateStr
();
}
});
},
openDeadTimePicker
:
function
()
{
WdatePicker
({
dateFmt
:
'yyyy-MM-dd HH:mm:ss'
,
onpicked
:
(
dp
)
=>
{
this
.
letter
.
deadTime
=
dp
.
cal
.
getNewDateStr
();
}
});
},
// 打开弹框
addOutLink
:
function
()
{
this
.
letter
.
nameWeb
=
""
;
this
.
letter
.
id
=
""
;
this
.
letter
.
appId
=
""
;
this
.
letter
.
url
=
""
;
this
.
letter
.
path
=
""
;
this
.
letter
.
openType
=
1
;
this
.
letter
.
icon
=
""
;
this
.
letter
.
content
=
""
this
.
letter
.
needTime
=
0
;
this
.
letter
.
startTime
=
null
;
this
.
letter
.
deadTime
=
null
;
this
.
dialog
=
!
this
.
dialog
;
},
count
:
function
()
{
if
(
this
.
letter
.
nameWeb
.
length
>
10
)
{
this
.
letter
.
nameWeb
=
this
.
letter
.
nameWeb
.
substr
(
0
,
10
)
}
},
edit
:
function
(
id
)
{
$
.
ajax
({
url
:
'/gk/sure-letter/getFunc/'
+
id
,
success
:
(
data
)
=>
{
if
(
data
.
content
)
{
this
.
letter
=
data
.
content
;
this
.
editor
.
setContent
(
data
.
content
.
content
??
''
)
this
.
dialog
=
true
;
}
}
});
},
del
:
function
(
id
)
{
layer
.
confirm
(
"确认要删除吗?"
,
function
()
{
$
.
ajax
({
url
:
'/gk/sure-letter/delFunc/'
+
id
,
beforeSend
:
function
()
{
var
index
=
layer
.
load
()
setTimeout
(
function
()
{
layer
.
close
(
index
);
},
1500
)
},
success
:
(
data
)
=>
{
layer
.
msg
(
'删除成功!'
);
app
.
queryAll
();
}
});
});
},
save
:
function
()
{
if
(
this
.
letter
.
nameWeb
.
length
==
0
)
{
layer
.
msg
(
"功能名称不能为空!"
,
{
icon
:
5
,
duration
:
1500
});
return
;
}
if
(
!
this
.
letter
.
appId
&&
this
.
letter
.
openType
==
2
)
{
layer
.
msg
(
"AppId不能为空!"
,
{
icon
:
5
,
duration
:
1500
});
return
;
}
if
(
this
.
letter
.
type
==
0
)
{
this
.
letter
.
content
=
this
.
editor
.
getContent
();
}
if
(
this
.
letter
.
needTime
&&
!
this
.
letter
.
startTime
)
{
layer
.
msg
(
"请设置有效期的开始时间"
,
{
icon
:
5
,
duration
:
1500
});
return
;
}
$
.
ajax
({
url
:
'/gk/sure-letter/updateName'
,
data
:
JSON
.
stringify
(
this
.
letter
),
contentType
:
'application/json'
,
type
:
'post'
,
beforeSend
:
function
()
{
var
index
=
layer
.
load
()
setTimeout
(
function
()
{
layer
.
close
(
index
);
},
1500
)
},
success
:
(
data
)
=>
{
layer
.
msg
(
'保存成功!'
);
this
.
dialog
=
false
;
this
.
queryAll
();
}
})
},
cancel
:
function
()
{
this
.
dialog
=
false
;
},
queryAll
:
function
()
{
if
(
getCId
())
{
$
.
ajax
({
url
:
'/gk/sure-letter/queryAllThirdMicros?cmptId='
+
getCId
(),
success
:
(
data
)
=>
{
this
.
list
=
data
.
content
;
}
})
}
},
//文件上传处理
uploadIconFile
(
obj
)
{
file
=
obj
.
target
.
files
[
0
];
if
(
file
.
type
&&
file
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
return
layer
.
msg
(
'请上传图片'
,
{
icon
:
5
})
}
var
reads
=
new
FileReader
();
reads
.
readAsDataURL
(
file
);
reads
.
onload
=
function
()
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"file"
,
file
);
$
.
ajax
({
url
:
uploadUrl
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
success
:
(
res
)
=>
{
if
(
res
.
code
==
200
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
app
.
$data
.
letter
.
icon
=
res
.
content
}
},
beforeSend
:
()
=>
{
layer
.
load
()
},
complete
:
()
=>
{
layer
.
closeAll
()
},
})
};
},
//文件上传处理
uploadFile
(
obj
)
{
file
=
obj
.
target
.
files
[
0
];
if
(
this
.
letter
.
openType
===
6
&&
file
.
type
&&
file
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
return
layer
.
msg
(
'请上传图片'
,
{
icon
:
5
})
}
if
(
this
.
letter
.
openType
===
5
&&
file
.
type
&&
(
file
.
type
.
indexOf
(
".pdf"
)
===
-
1
||
file
.
type
.
indexOf
(
".doc"
)
===
-
1
))
{
return
layer
.
msg
(
'请上传 pdf或doc文档'
,
{
icon
:
5
})
}
var
reads
=
new
FileReader
();
reads
.
readAsDataURL
(
file
);
reads
.
onload
=
function
()
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"file"
,
file
);
$
.
ajax
({
url
:
uploadUrl
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
success
:
(
res
)
=>
{
if
(
res
.
code
==
200
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
app
.
$data
.
letter
.
url
=
res
.
content
}
},
beforeSend
:
()
=>
{
layer
.
load
()
},
complete
:
()
=>
{
layer
.
closeAll
()
},
})
};
}
}
},
beforeSend
:
()
=>
{
layer
.
load
()
},
complete
:
()
=>
{
layer
.
closeAll
()
},
})
};
}
}
});
customerV
.
queryAll
();
</script>
</body>
</html>
});
</script>
</body>
</html>
\ No newline at end of file
src/main/webapp/WEB-INF/views/cmpt/service.jsp
View file @
c46469b4
...
...
@@ -32,9 +32,6 @@
<link
rel=
"stylesheet"
href=
"${ctxStatic}/newdermon/css/main.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/cmpt/setting.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/leaflet/css/leaflet.css?v=
<%=
System
.
currentTimeMillis
()
%>
"
/>
<link
rel=
"stylesheet"
href=
"${ctxStatic}/leaflet/css/leaflet_label.css"
/>
<script
src=
"${ctxStatic}/My97DatePicker/WdatePicker.js"
type=
"text/javascript"
></script>
<script
src=
"${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"
></script>
...
...
@@ -524,6 +521,7 @@
</div>
<script
src=
"${ctxStatic}/vue/vue.js"
></script>
<script>
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/service'
+
'&cmptId='
+
getCId
()
var
app
=
new
Vue
({
el
:
'#service'
,
data
:
{
...
...
@@ -880,19 +878,19 @@
},
//文件上传处理
uploadFile
(
obj
)
{
logoF
ile
=
obj
.
target
.
files
[
0
];
if
(
logoFile
.
type
&&
logoF
ile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
f
ile
=
obj
.
target
.
files
[
0
];
if
(
file
.
type
&&
f
ile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
return
layer
.
msg
(
'请上传图片'
,
{
icon
:
5
})
}
var
reads
=
new
FileReader
();
reads
.
readAsDataURL
(
logoF
ile
);
reads
.
readAsDataURL
(
f
ile
);
reads
.
onload
=
function
()
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"
uploadImg"
,
logoF
ile
);
formData
.
append
(
"
file"
,
f
ile
);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
url
:
uploadUrl
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
...
...
@@ -901,10 +899,7 @@
console
.
log
({
res
});
if
(
res
.
code
==
"1"
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
app
.
$data
.
service
.
imgUrl
=
res
.
result
console
.
log
(
app
.
$data
.
service
.
imgUrl
)
}
else
{
console
.
log
(
res
);
app
.
$data
.
service
.
imgUrl
=
res
.
content
}
},
beforeSend
:
()
=>
{
...
...
@@ -918,19 +913,19 @@
},
//文件上传处理
uploadIconFile
(
obj
)
{
logoF
ile
=
obj
.
target
.
files
[
0
];
if
(
logoFile
.
type
&&
logoF
ile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
f
ile
=
obj
.
target
.
files
[
0
];
if
(
file
.
type
&&
f
ile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
return
layer
.
msg
(
'请上传图片'
,
{
icon
:
5
})
}
var
reads
=
new
FileReader
();
reads
.
readAsDataURL
(
logoF
ile
);
reads
.
readAsDataURL
(
f
ile
);
reads
.
onload
=
function
()
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"
uploadImg"
,
logoF
ile
);
formData
.
append
(
"
file"
,
f
ile
);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
url
:
uploadUrl
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
...
...
@@ -938,9 +933,7 @@
success
:
function
(
res
)
{
if
(
res
.
code
==
"1"
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
app
.
$data
.
service
.
iconUrl
=
res
.
result
}
else
{
console
.
log
(
res
);
app
.
$data
.
service
.
iconUrl
=
res
.
content
}
},
beforeSend
:
()
=>
{
...
...
src/main/webapp/WEB-INF/views/cmpt/swiper.jsp
View file @
c46469b4
...
...
@@ -433,6 +433,7 @@
</div>
<script
src=
"${ctxStatic}/vue/vue.js"
></script>
<script>
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/swiper'
+
'&cmptId='
+
getCId
()
var
app
=
new
Vue
({
el
:
'#swiper'
,
data
:
{
...
...
@@ -609,7 +610,7 @@
}
setTimeout
(()
=>
{
layer
.
closeAll
()
},
1500
)
},
1500
)
},
complete
:
()
=>
{
...
...
@@ -641,19 +642,19 @@
},
//文件上传处理
uploadFile
(
obj
)
{
logoF
ile
=
obj
.
target
.
files
[
0
];
if
(
logoFile
.
type
&&
logoF
ile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
f
ile
=
obj
.
target
.
files
[
0
];
if
(
file
.
type
&&
f
ile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
return
layer
.
msg
(
'请上传图片'
,
{
icon
:
5
})
}
var
reads
=
new
FileReader
();
reads
.
readAsDataURL
(
logoF
ile
);
reads
.
readAsDataURL
(
f
ile
);
reads
.
onload
=
function
()
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"
uploadImg"
,
logoF
ile
);
formData
.
append
(
"
file"
,
f
ile
);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
url
:
uploadUrl
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
...
...
@@ -661,7 +662,7 @@
success
:
function
(
res
)
{
if
(
res
.
code
==
"1"
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
app
.
$data
.
service
.
imgUrl
=
res
.
resul
t
app
.
$data
.
service
.
imgUrl
=
res
.
conten
t
}
},
beforeSend
:
()
=>
{
...
...
src/main/webapp/WEB-INF/views/common/menu.jsp
View file @
c46469b4
...
...
@@ -341,7 +341,7 @@
<span
class=
"menu-txt"
>
分类管理
</span>
</a>
</li>
<li
class=
"swiper menu-sub-item"
>
<li
class=
"swiper menu-sub-item"
>
<a
href=
"/gk/swiper/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}×tamp=${timestamp}&sign=${sign}"
>
<span
class=
"left-arrow"
></span>
...
...
@@ -415,7 +415,6 @@
var
done
=
false
;
for
(
var
i
in
classes
)
{
if
(
url
.
indexOf
(
classes
[
i
])
>
-
1
)
{
console
.
log
(
classes
[
i
])
document
.
getElementsByClassName
(
classes
[
i
])[
0
].
classList
.
add
(
'active'
);
if
(
classes
[
i
]
!=
'cmptSetting'
)
{
let
classesStr
=
document
.
getElementsByClassName
(
classes
[
i
])[
0
].
parentNode
.
parentNode
.
firstElementChild
.
classList
;
...
...
src/main/webapp/static/js/banner.js
View file @
c46469b4
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/banner'
+
'&cmptId='
+
getCId
()
$
(
document
).
ready
(
function
()
{
$
(
'.addTempalte'
).
click
(
function
()
{
var
length
=
$
(
'#sortable .banner-item'
).
length
;
if
(
length
>=
5
)
{
if
(
length
>=
5
)
{
layer
.
msg
(
'图片最多只能上传五张'
)
return
;
return
;
}
$
(
'.template .pic'
).
trigger
(
'click'
);
});
$
(
'body'
).
on
(
'click'
,
'.save'
,
function
()
{
$
(
'body'
).
on
(
'click'
,
'.save'
,
function
()
{
var
obj
=
$
(
this
).
parents
(
'.banner-item'
);
$
.
ajax
({
url
:
'/gk/banner/saveOrUpdate'
,
type
:
'post'
,
data
:
{
url
:
obj
.
find
(
'input'
).
attr
(
'data-file-url'
),
cmptId
:
getCmptId
()
},
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
$
(
obj
).
attr
(
'data-id'
,
data
.
content
.
id
)
url
:
'/gk/banner/saveOrUpdate'
,
type
:
'post'
,
data
:
{
url
:
obj
.
find
(
'input'
).
attr
(
'data-file-url'
),
cmptId
:
getCmptId
()
},
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
$
(
obj
).
attr
(
'data-id'
,
data
.
content
.
id
)
}
}
})
...
...
@@ -31,14 +32,14 @@ $(document).ready(function () {
sort
(
sortIds
.
join
(
","
));
}
});
$
(
'body'
).
on
(
'click'
,
'.delOpt'
,
function
()
{
$
(
'body'
).
on
(
'click'
,
'.delOpt'
,
function
()
{
var
obj
=
$
(
this
);
qikoo
.
dialog
.
confirm
(
'确认要删除?'
,
function
()
{
$
.
ajax
({
url
:
'/gk/banner/del/'
+
obj
.
parents
(
".banner-item"
).
attr
(
"data-id"
),
type
:
'get'
,
success
:
function
(
data
)
{
url
:
'/gk/banner/del/'
+
obj
.
parents
(
".banner-item"
).
attr
(
"data-id"
),
type
:
'get'
,
success
:
function
(
data
)
{
obj
.
parents
(
'.banner-item'
).
remove
();
}
})
...
...
@@ -52,36 +53,33 @@ $(document).ready(function () {
function
uploadFile
(
obj
)
{
var
reads
=
new
FileReader
();
logoF
ile
=
obj
.
files
[
0
];
f
ile
=
obj
.
files
[
0
];
var
dataId
=
$
(
obj
).
parent
().
parent
().
attr
(
'data-id'
);
reads
.
readAsDataURL
(
logoF
ile
);
reads
.
readAsDataURL
(
f
ile
);
reads
.
onload
=
function
(
e
)
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"
uploadImg"
,
logoF
ile
);
formData
.
append
(
"
file"
,
f
ile
);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
url
:
uploadUrl
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
success
:
function
(
res
)
{
console
.
log
(
res
);
if
(
res
.
code
==
"1"
)
{
var
template
=
$
(
'.template'
).
clone
().
clone
();
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
$
(
template
).
find
(
'input'
).
attr
(
'data-file-name'
,
logoF
ile
.
name
);
$
(
template
).
find
(
'input'
).
attr
(
'data-file-url'
,
res
.
resul
t
);
$
(
template
).
find
(
'input'
).
attr
(
'data-file-size'
,
logoF
ile
.
size
/
1024
);
$
(
template
).
find
(
'.banner-img'
).
attr
(
'src'
,
res
.
resul
t
);
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
$
(
template
).
find
(
'input'
).
attr
(
'data-file-name'
,
f
ile
.
name
);
$
(
template
).
find
(
'input'
).
attr
(
'data-file-url'
,
res
.
conten
t
);
$
(
template
).
find
(
'input'
).
attr
(
'data-file-size'
,
f
ile
.
size
/
1024
);
$
(
template
).
find
(
'.banner-img'
).
attr
(
'src'
,
res
.
conten
t
);
$
(
template
).
appendTo
(
$
(
'.equip-container-new'
))
$
(
template
).
removeClass
(
'template'
)
$
(
template
).
show
();
$
(
template
).
find
(
'.save'
).
trigger
(
'click'
);
$
(
template
).
find
(
'.save'
).
remove
();
}
else
{
console
.
log
(
res
);
}
}
})
...
...
@@ -90,13 +88,13 @@ function uploadFile(obj) {
function
sort
(
ids
)
{
$
.
ajax
({
url
:
'/gk/banner/order'
,
data
:
{
ids
:
ids
},
success
:
function
(
data
)
{
url
:
'/gk/banner/order'
,
data
:
{
ids
:
ids
},
success
:
function
(
data
)
{
console
.
log
(
data
);
}
})
}
function
del
()
{
}
\ No newline at end of file
src/main/webapp/static/js/cmptManual.js
View file @
c46469b4
//文件上传处理
var
obj
=
null
;
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/manual'
+
'&cmptId='
+
getCId
()
function
changeImg
(
e
)
{
let
reads
=
new
FileReader
();
reads
.
readAsDataURL
(
$
(
e
).
get
(
0
).
files
[
0
]);
if
(
$
(
e
).
get
(
0
).
files
[
0
].
size
/
1000
>
500
)
{
layer
.
alert
(
'上传的图片文件不能超过500KB。'
,
{
icon
:
5
});
layer
.
alert
(
'上传的图片文件不能超过500KB。'
,
{
icon
:
5
});
return
;
}
reads
.
onload
=
function
(
ee
)
{
...
...
@@ -13,29 +13,26 @@ function changeImg(e) {
image
.
src
=
ee
.
target
.
result
;
image
.
onload
=
function
()
{
if
(
this
.
width
>
this
.
height
)
{
layer
.
alert
(
"请上传竖图!"
,
{
icon
:
5
});
layer
.
alert
(
"请上传竖图!"
,
{
icon
:
5
});
return
;
}
else
{
var
img
=
$
(
e
).
prev
().
get
(
0
);
var
formData
=
new
FormData
();
formData
.
append
(
"
uploadImg
"
,
$
(
e
).
get
(
0
).
files
[
0
]);
formData
.
append
(
"
file
"
,
$
(
e
).
get
(
0
).
files
[
0
]);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
url
:
uploadUrl
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
success
:
function
(
res
)
{
console
.
log
(
res
);
if
(
res
.
code
==
"1"
)
{
// 获取返回URL
img
.
src
=
res
.
result
;
$
(
img
).
parent
().
attr
(
'data-file'
,
res
.
resul
t
);
img
.
src
=
res
.
content
$
(
img
).
parent
().
attr
(
'data-file'
,
res
.
conten
t
);
setTimeout
(
function
()
{
$
(
img
).
removeClass
(
'add'
);
},
500
)
}
else
{
console
.
log
(
res
);
}
}
})
...
...
@@ -61,11 +58,8 @@ $(function () {
url
:
'/gk/cmpt/manual/delManual?id='
+
id
,
/*接口域名地址*/
success
:
function
(
res
)
{
parent
.
remove
();
console
.
log
(
res
);
if
(
res
.
code
==
"1"
)
{
layer
.
msg
(
'保存成功'
,
{
icon
:
1
,
time
:
1500
});
}
else
{
console
.
log
(
res
);
layer
.
msg
(
'保存成功'
,
{
icon
:
1
,
time
:
1500
});
}
}
});
...
...
@@ -92,7 +86,7 @@ $(function () {
let
filedata
=
parent
.
find
(
'.file'
).
attr
(
'data-file'
);
if
(
!
filedata
||
!
catalogPhotoURL
)
{
layer
.
msg
(
'请选择上传的文件'
,
{
icon
:
1
,
time
:
1500
});
layer
.
msg
(
'请选择上传的文件'
,
{
icon
:
1
,
time
:
1500
});
return
;
}
...
...
@@ -107,14 +101,11 @@ $(function () {
contentType
:
'application/json'
,
processData
:
false
,
success
:
function
(
res
)
{
console
.
log
(
res
);
if
(
res
.
code
==
200
)
{
layer
.
msg
(
'保存成功'
,
{
icon
:
1
,
time
:
1500
});
layer
.
msg
(
'保存成功'
,
{
icon
:
1
,
time
:
1500
});
if
(
!
id
)
{
parent
.
find
(
'.manualId'
).
val
(
res
.
id
);
}
}
else
{
console
.
log
(
res
);
}
}
});
...
...
src/main/webapp/static/js/cmptSetting.js
View file @
c46469b4
$
(
function
()
{
// 检查是否有修改banner的权限
$
(
function
()
{
...
...
@@ -40,13 +41,13 @@ $(function () {
data
:
param
,
success
:
function
(
data
)
{
console
.
log
(
data
);
if
(
data
.
code
==
-
201
)
{
window
.
location
.
href
=
"/gk/banner/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
}
else
if
(
data
.
code
==
-
301
)
{
window
.
location
.
href
=
"/gk/customer/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
}
else
if
(
data
.
code
==
-
401
)
{
if
(
data
.
code
==
-
201
)
{
window
.
location
.
href
=
"/gk/banner/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
}
else
if
(
data
.
code
==
-
301
)
{
window
.
location
.
href
=
"/gk/customer/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
}
else
if
(
data
.
code
==
-
401
)
{
layer
.
msg
(
"还没设置公告!"
)
window
.
location
.
href
=
"/gk/news/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
window
.
location
.
href
=
"/gk/news/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
}
}
})
...
...
@@ -67,7 +68,7 @@ $(function () {
if
(
param
.
visibility
==
1
)
{
$
.
ajax
({
url
:
'/gk/cmpt/cmptSetting/check'
,
data
:
{
'cmptId'
:
getCmptId
(),
"type"
:
type
},
data
:
{
'cmptId'
:
getCmptId
(),
"type"
:
type
},
async
:
false
,
success
:
function
(
data
)
{
if
(
data
.
code
==
-
1
)
{
...
...
@@ -85,18 +86,18 @@ $(function () {
layer
.
alert
(
"要启用此功能,需要先上传比赛路线"
);
}
else
if
(
type
==
11
)
{
layer
.
alert
(
"要启用此功能,需要先联系管理员通过赛事审核"
);
}
else
if
(
type
==
12
){
}
else
if
(
type
==
12
)
{
layer
.
alert
(
"要启用此功能,请先在计时管理页面完成名单导入"
);
}
else
if
(
type
==
15
)
{
}
else
if
(
type
==
15
)
{
layer
.
alert
(
"要启用此功能,请先导入路线,且路线上至少有2个标注点"
);
setTimeout
(
function
()
{
window
.
location
.
href
=
"/gk/road/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
},
3000
)
}
else
if
(
type
==
16
){
window
.
location
.
href
=
"/gk/road/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
},
3000
)
}
else
if
(
type
==
16
)
{
layer
.
alert
(
"要启用此功能,请先导入路线,且路线上至少有2个标注点"
);
setTimeout
(
function
()
{
window
.
location
.
href
=
"/gk/road/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
},
3000
)
window
.
location
.
href
=
"/gk/road/index/"
+
getCmptId
()
+
"?"
+
window
.
location
.
search
;
},
3000
)
}
}
else
{
...
...
@@ -115,8 +116,8 @@ $(function () {
}
}
})
}
else
if
(
type
==
15
||
type
==
12
||
type
==
16
)
{
if
(
$
(
'#autoscore'
).
val
()
!=
'1'
)
{
}
else
if
(
type
==
15
||
type
==
12
||
type
==
16
)
{
if
(
$
(
'#autoscore'
).
val
()
!=
'1'
)
{
layer
.
msg
(
"建议启动自动成绩审核,无需组委会操作,选手可以在提交成绩后马上查看完赛证书"
);
}
...
...
@@ -157,7 +158,7 @@ $(function () {
let
status
=
$
(
this
).
parents
(
'.public'
).
attr
(
'data-status'
);
if
(
status
==
2
)
return
;
let
id
=
$
(
this
).
parents
(
'.public'
).
parents
(
'.wzm-content-item'
).
attr
(
'data-id'
);
let
param
=
{
id
:
id
};
let
param
=
{
id
:
id
};
if
(
status
==
1
)
{
param
.
status
=
0
;
}
else
{
...
...
@@ -166,6 +167,9 @@ $(function () {
editSettingStatus
(
param
);
})
initEvent
()
});
function
sort
(
param
)
{
...
...
@@ -191,3 +195,58 @@ function editSettingStatus(param) {
}
})
}
// 初始化事件
function
initEvent
()
{
// 为需要设置有效期的元素添加点击事件
$
(
'.wzm-content-item'
).
on
(
'dblclick'
,
function
()
{
let
id
=
$
(
this
).
data
(
'id'
)
const
func
=
cmptFuncs
.
find
(
v
=>
v
.
id
==
id
);
if
(
func
?.
needTime
)
{
showTimeSetting
(
func
);
}
});
}
function
showTimeSetting
(
func
)
{
const
index
=
layer
.
open
({
type
:
1
,
title
:
'设置有效期'
,
content
:
`
<div style="padding:20px;">
<div class="form-group">
<label>开始时间</label>
<input type="text" class="form-control Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="startTime" value="
${
func
?.
startTime
||
''
}
">
</div>
<div class="
form
-
group
">
<label>结束时间</label>
<input type="
text
" class="
form
-
control
Wdate
" onclick="
WdatePicker
({
dateFmt
:
'yyyy-MM-dd HH:mm:ss'
})
" id="
endTime
" value="
$
{
func
?.
deadTime
||
''
}
">
</div>
</div>
`,
btn: ['确定', '取消'],
yes: () => {
let loadIndex = 0
var startTime = $('#startTime').val();
var deadTime = $('#endTime').val();
$.ajax({
url: '/gk/sure-letter/updateName',
data: JSON.stringify({
startTime,
deadTime,
id: func.id
}),
contentType: 'application/json',
type: 'post',
beforeSend: function () {
loadIndex = layer.load()
},
success: () => {
layer.close(loadIndex);
layer.msg('有效期设置成功', () => { layer.close(index) });
}
})
}
});
}
\ No newline at end of file
src/main/webapp/static/js/index.js
View file @
c46469b4
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/cmptLogo'
+
'&cmptId='
+
getCId
()
$
(
function
()
{
$
(
'#cmptBgColorInput'
).
bind
(
'keyup'
,
function
()
{
...
...
@@ -30,28 +33,28 @@ $(function () {
let
detailStyle
=
$
(
'#detailStyle'
).
val
();
let
isShowTab
=
$
(
'#isShowInput'
).
val
();
let
cmptId
=
getCId
();
if
(
bg
.
length
!=
6
)
{
if
(
bg
.
length
!=
6
)
{
layer
.
msg
(
'请输入6位合法字符!'
);
return
;
return
;
}
const
param
=
{
detailStyle
:
detailStyle
??
'style-1'
,
detailStyle
:
detailStyle
??
'style-1'
,
cmptId
,
logo
,
cmptbgColor
:
"#"
+
bg
,
cmptbgColor
:
"#"
+
bg
,
isShowTab
};
$
.
ajax
({
url
:
'/gk/cmpt/saveCmpt'
,
data
:
JSON
.
stringify
(
param
),
contentType
:
"application/json"
,
contentType
:
"application/json"
,
type
:
'post'
,
success
:
function
(
data
)
{
if
(
data
.
status
)
{
window
.
location
.
reload
();
layer
.
msg
(
'保存成功'
,
{
icon
:
1
,
time
:
1500
});
layer
.
msg
(
'保存成功'
,
{
icon
:
1
,
time
:
1500
});
}
else
{
layer
.
msg
(
'保存失败'
,
{
icon
:
5
,
time
:
1500
});
layer
.
msg
(
'保存失败'
,
{
icon
:
5
,
time
:
1500
});
}
}
})
...
...
@@ -60,7 +63,7 @@ $(function () {
$
(
'#download'
).
click
(
function
()
{
$
.
ajax
({
url
:
"/gk/cmpt/getCmpt"
,
data
:
{
'cmptId'
:
getCmptId
()
},
data
:
{
'cmptId'
:
getCmptId
()
},
success
:
function
(
data
)
{
if
(
data
.
content
&&
data
.
content
.
logo
)
{
window
.
open
(
window
.
location
.
origin
+
"/img/download/"
+
getCmptId
())
...
...
@@ -128,11 +131,11 @@ function changeLogoImg(imgDomNName, inputDomName, top, left, width, height) {
var
reads
=
new
FileReader
();
logoFile
=
document
.
getElementById
(
inputDomName
).
files
[
0
];
if
(
logoFile
.
fileSize
/
1000
>
500
)
{
layer
.
msg
(
'上传的图片文件不能超过500KB。'
,
{
icon
:
5
,
time
:
1500
});
layer
.
msg
(
'上传的图片文件不能超过500KB。'
,
{
icon
:
5
,
time
:
1500
});
return
;
}
if
(
logoFile
.
size
/
1000
>
500
)
{
layer
.
alert
(
'上传的图片文件不能超过500KB。'
,
{
icon
:
5
});
layer
.
alert
(
'上传的图片文件不能超过500KB。'
,
{
icon
:
5
});
return
;
}
reads
.
readAsDataURL
(
logoFile
);
...
...
@@ -143,24 +146,21 @@ function changeLogoImg(imgDomNName, inputDomName, top, left, width, height) {
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"
uploadImg
"
,
logoFile
);
formData
.
append
(
"
file
"
,
logoFile
);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
url
:
uploadUrl
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
success
:
function
(
res
)
{
console
.
log
(
res
);
if
(
res
.
code
==
"1"
)
{
// 获取返回URL
document
.
getElementById
(
imgDomNName
).
src
=
res
.
resul
t
;
document
.
getElementById
(
imgDomNName
).
src
=
res
.
conten
t
;
$
(
'.logo-div'
).
css
(
'background'
,
'none'
);
$
(
"[name='hdcmptLogo']"
).
val
(
res
.
resul
t
);
$
(
"[name='hdcmptLogo']"
).
val
(
res
.
conten
t
);
$
(
"#cmptLogoSpan"
).
html
(
"已上传"
);
$
(
'#cmptLogo'
).
addClass
(
'cmpt-logo'
);
$
(
'#cmptLogo'
).
removeClass
(
"logo"
);
}
else
{
console
.
log
(
res
);
}
}
})
...
...
src/main/webapp/static/js/news.js
View file @
c46469b4
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/news'
+
'&cmptId='
+
getCId
()
// 定义 typeDesc 映射
const
typeDesc
=
{
0
:
{
...
...
@@ -59,11 +60,11 @@ $(document).ready(function () {
url
:
"/gk/news/save"
,
type
:
'post'
,
contentType
:
'application/json'
,
data
:
JSON
.
stringify
({
data
:
JSON
.
stringify
({
linkUrl
,
id
:
$
(
'.edit-container'
).
attr
(
'data-id'
),
title
:
title
,
appId
:
appId
,
appId
:
appId
,
content
:
editor
.
getContent
(),
userId
:
getUId
(),
cmptId
:
getCId
(),
...
...
@@ -72,8 +73,8 @@ $(document).ready(function () {
// 新增的字段
openType
:
openType
,
path
:
path
,
lat
:
lat
??
0
,
lng
:
lng
??
0
lat
:
lat
??
0
,
lng
:
lng
??
0
}),
success
:
function
(
data
)
{
layer
.
msg
(
'保存成功'
)
...
...
@@ -142,16 +143,16 @@ $(document).ready(function () {
$
(
'.sure'
).
click
(
function
()
{
var
val
=
$
(
'#newsAlias'
).
val
();
if
(
val
.
length
>
10
)
{
if
(
val
.
length
>
10
)
{
layer
.
msg
(
"不能超过10个字"
);
return
;
return
;
}
$
.
ajax
({
url
:
'/setting/update'
,
type
:
"post"
,
data
:
{
cmptId
:
getCmptId
(),
newsAlias
:
val
},
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
url
:
'/setting/update'
,
type
:
"post"
,
data
:
{
cmptId
:
getCmptId
(),
newsAlias
:
val
},
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
layer
.
msg
(
'保存成功'
);
window
.
location
.
reload
();
$
(
'.edit-mask,.edit-dialog'
).
fadeOut
();
...
...
@@ -161,20 +162,20 @@ $(document).ready(function () {
});
$
(
'.edit-btn'
).
click
(
function
()
{
var
text
=
$
.
trim
(
$
(
'.news-title span'
).
text
())
==
'未命名'
?
$
.
trim
(
$
(
'.news-title'
).
text
())
:
''
;
var
text
=
$
.
trim
(
$
(
'.news-title span'
).
text
())
==
'未命名'
?
$
.
trim
(
$
(
'.news-title'
).
text
())
:
''
;
$
(
'#newsAlias'
).
val
();
$
(
'.edit-mask,.edit-dialog'
).
fadeIn
();
})
// 监听select选项
// 监听 openType 变化
$
(
'#openType'
).
change
(
function
()
{
$
(
'#openType'
).
change
(
function
()
{
const
openType
=
$
(
this
).
val
();
updateViews
(
openType
);
});
});
// 显示/隐藏必要的参数
function
updateViews
(
openType
=
0
)
{
function
updateViews
(
openType
=
0
)
{
const
desc
=
typeDesc
[
openType
];
if
(
desc
)
{
// 修改 path 的 label 和 placeholder
...
...
@@ -205,33 +206,30 @@ function updateViews(openType=0){
//文件上传处理
function
uploadFile
(
obj
)
{
var
reads
=
new
FileReader
();
logoF
ile
=
obj
.
files
[
0
];
if
(
logoFile
.
type
&&
logoFile
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
layer
.
msg
(
'请上传图片'
,
{
icon
:
5
})
f
ile
=
obj
.
files
[
0
];
if
(
file
.
type
&&
file
.
type
.
indexOf
(
"image"
)
==
-
1
)
{
layer
.
msg
(
'请上传图片'
,
{
icon
:
5
})
return
;
}
reads
.
readAsDataURL
(
logoF
ile
);
reads
.
readAsDataURL
(
f
ile
);
reads
.
onload
=
function
(
e
)
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"
uploadImg"
,
logoF
ile
);
formData
.
append
(
"
file"
,
f
ile
);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
url
:
uploadFile
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
success
:
function
(
res
)
{
console
.
log
(
res
);
if
(
res
.
code
==
"1"
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
$
(
'#file-cover'
).
attr
(
'data-src'
,
res
.
resul
t
);
$
(
'#file-cover'
).
attr
(
'data-src'
,
res
.
resul
t
);
$
(
'.cover'
).
css
(
'background-image'
,
'url('
+
res
.
resul
t
+
')'
)
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
$
(
'#file-cover'
).
attr
(
'data-src'
,
res
.
conten
t
);
$
(
'#file-cover'
).
attr
(
'data-src'
,
res
.
conten
t
);
$
(
'.cover'
).
css
(
'background-image'
,
'url('
+
res
.
conten
t
+
')'
)
$
(
'.icon-cover'
).
remove
();
}
else
{
console
.
log
(
res
);
}
}
})
...
...
src/main/webapp/static/js/road-new.js
View file @
c46469b4
const
uploadUrl
=
'/api-common/v1/upload?folder='
+
'gk/cmptLogo'
+
'&cmptId='
+
getCId
()
var
layers
=
[];
$
(
document
).
ready
(
function
()
{
$
(
'body'
).
on
(
'click'
,
'.addTempalte'
,
function
()
{
...
...
@@ -12,16 +13,16 @@ $(document).ready(function () {
var
obj
=
$
(
this
).
parents
(
'.equip-item'
)
$
.
ajax
({
url
:
'/gk/road/del'
,
data
:
{
roadId
:
id
},
data
:
{
roadId
:
id
},
type
:
'post'
,
success
:
function
(
data
)
{
if
(
data
.
status
)
{
obj
.
remove
();
}
else
{
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
}
},
error
:
function
()
{
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
}
})
...
...
@@ -36,16 +37,16 @@ $(document).ready(function () {
var
param
=
[];
var
flag
=
true
;
var
timerCount
=
0
;
$
.
each
(
$
(
'.markers-edit .marker'
),
function
(
i
,
e
)
{
$
.
each
(
$
(
'.markers-edit .marker'
),
function
(
i
,
e
)
{
var
obj
=
{};
obj
.
checkpointId
=
$
(
e
).
attr
(
'data-checkpointid'
);
obj
.
distance
=
$
(
e
).
find
(
'input[type=number]'
).
val
();
obj
.
isTime
=
$
(
e
).
find
(
'input[type=checkbox]'
).
get
(
0
).
checked
;
obj
.
name
=
$
(
e
).
find
(
'input[type=text]'
).
val
();
if
(
obj
.
isTime
)
timerCount
++
;
if
(
obj
.
isTime
&&
!
obj
.
distance
&&
obj
.
distance
<=
0
)
{
if
(
obj
.
isTime
)
timerCount
++
;
if
(
obj
.
isTime
&&
!
obj
.
distance
&&
obj
.
distance
<=
0
)
{
flag
=
false
;
layer
.
msg
(
'请用计时点的里程,为必填项,请填入合法数据'
,
{
icon
:
5
});
layer
.
msg
(
'请用计时点的里程,为必填项,请填入合法数据'
,
{
icon
:
5
});
console
.
log
(
obj
)
return
true
;
}
...
...
@@ -53,23 +54,23 @@ $(document).ready(function () {
param
.
push
(
obj
);
})
if
(
timerCount
<
2
)
{
layer
.
msg
(
'保存用于计时的打卡点不能少于两个!'
,
{
icon
:
5
});
return
;
if
(
timerCount
<
2
)
{
layer
.
msg
(
'保存用于计时的打卡点不能少于两个!'
,
{
icon
:
5
});
return
;
}
if
(
flag
)
{
if
(
flag
)
{
$
.
ajax
({
url
:
'/gk/road/saveCheckPoint'
,
type
:
'post'
,
contentType
:
'application/json'
,
contentType
:
'application/json'
,
data
:
JSON
.
stringify
(
param
),
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
layer
.
msg
(
'保存成功'
,
{
icon
:
1
,
time
:
1500
});
if
(
data
.
code
==
200
)
{
layer
.
msg
(
'保存成功'
,
{
icon
:
1
,
time
:
1500
});
getPath
(
$
(
"#roadId"
).
val
(),
$
(
"#pahtId"
).
val
());
}
},
error
:
function
()
{
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
}
})
}
...
...
@@ -98,7 +99,7 @@ $(document).ready(function () {
$
(
'#gpsName'
).
text
(
fileName
);
$
(
'#pathName'
).
val
(
pathName
);
if
(
!
name
)
{
layer
.
msg
(
'请填写项目名称再进行编辑'
,
{
icon
:
3
,
time
:
1500
});
layer
.
msg
(
'请填写项目名称再进行编辑'
,
{
icon
:
3
,
time
:
1500
});
return
;
}
if
(
id
)
{
...
...
@@ -139,7 +140,7 @@ $(document).ready(function () {
var
name
=
parent
.
attr
(
'data-name'
);
$
(
'#roadName'
).
text
(
name
);
if
(
!
name
)
{
layer
.
msg
(
'请填写项目名称再进行编辑'
,
{
icon
:
3
,
time
:
1500
});
layer
.
msg
(
'请填写项目名称再进行编辑'
,
{
icon
:
3
,
time
:
1500
});
return
;
}
if
(
id
)
{
...
...
@@ -160,30 +161,30 @@ $(document).ready(function () {
function
()
{
$
.
ajax
({
url
:
'/gk/road/delGpsPath'
,
data
:
{
pathId
:
pathId
},
data
:
{
pathId
:
pathId
},
type
:
'post'
,
success
:
function
(
data
)
{
if
(
data
.
status
)
{
parent
.
remove
();
layer
.
msg
(
'删除成功!'
);
}
else
{
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
}
},
error
:
function
()
{
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
layer
.
msg
(
'操作失败'
,
{
icon
:
5
,
time
:
1500
});
}
});
});
});
$
(
'body'
).
on
(
'click'
,
'.map-data .edit'
,
function
()
{
$
(
'body'
).
on
(
'click'
,
'.map-data .edit'
,
function
()
{
$
(
this
).
hide
();
$
(
'.save'
).
fadeIn
();
$
(
'.cancel'
).
fadeIn
();
$
(
'.markers'
).
fadeOut
();
$
(
'.markers-edit'
).
fadeIn
();
});
$
(
'body'
).
on
(
'click'
,
'.map-data .cancel'
,
function
()
{
$
(
'body'
).
on
(
'click'
,
'.map-data .cancel'
,
function
()
{
$
(
'.save'
).
hide
();
$
(
'.cancel'
).
hide
();
$
(
'.markers'
).
fadeIn
();
...
...
@@ -203,46 +204,43 @@ $(document).ready(function () {
//文件上传处理
function
uploadFile
(
obj
)
{
var
reads
=
new
FileReader
();
logoF
ile
=
obj
.
files
[
0
];
f
ile
=
obj
.
files
[
0
];
var
dataId
=
$
(
obj
).
parent
().
parent
().
parent
().
attr
(
'data-id'
);
var
pathId
=
$
(
obj
).
parent
().
parent
().
parent
().
attr
(
'data-path-id'
);
var
pathName
=
$
(
'#pathName'
).
val
();
if
(
pathName
==
''
)
{
if
(
pathName
==
''
)
{
layer
.
msg
(
'请输入路线名称!'
);
return
false
;
}
var
suffix
=
logoFile
.
name
.
substr
(
logoFile
.
name
.
lastIndexOf
(
"."
)
+
1
);
if
(
"gpx"
!=
suffix
&&
"kml"
!=
suffix
)
{
var
suffix
=
file
.
name
.
substr
(
file
.
name
.
lastIndexOf
(
"."
)
+
1
);
if
(
"gpx"
!=
suffix
&&
"kml"
!=
suffix
)
{
layer
.
msg
(
'文件格式不正确!'
);
return
false
;
}
reads
.
readAsDataURL
(
logoF
ile
);
reads
.
readAsDataURL
(
f
ile
);
reads
.
onload
=
function
(
e
)
{
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var
formData
=
new
FormData
();
formData
.
append
(
"
uploadImg"
,
logoF
ile
);
formData
.
append
(
"
file"
,
f
ile
);
$
.
ajax
({
url
:
'https://event.geexek.com/upload/file.do'
,
/*接口域名地址*/
url
:
uploadFile
,
/*接口域名地址*/
type
:
'post'
,
data
:
formData
,
contentType
:
false
,
processData
:
false
,
success
:
function
(
res
)
{
console
.
log
(
res
);
if
(
res
.
code
==
"1"
)
{
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-name'
,
logoF
ile
.
name
);
layer
.
msg
(
'上传成功'
,
{
icon
:
1
,
time
:
1500
});
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-name'
,
f
ile
.
name
);
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-url'
,
res
.
result
);
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-size'
,
logoF
ile
.
size
/
1024
);
$
(
'#gpsName'
).
text
(
logoF
ile
.
name
);
saveRoad
(
dataId
,
pathId
,
pathName
,
logoFile
.
name
,
res
.
result
,
logoF
ile
.
size
/
1024
);
$
(
'.equip-item[data-id='
+
dataId
+
']'
).
attr
(
'data-file-size'
,
f
ile
.
size
/
1024
);
$
(
'#gpsName'
).
text
(
f
ile
.
name
);
saveRoad
(
dataId
,
pathId
,
pathName
,
file
.
name
,
res
.
content
,
f
ile
.
size
/
1024
);
clearLayers
()
loadGps
(
res
.
resul
t
);
loadGps
(
res
.
conten
t
);
// $('.equip-item[data-id='+dataId+']').find('.edit-new').trigger('click');
$
(
'#route-file'
).
val
(
''
);
}
else
{
console
.
log
(
res
);
}
}
})
...
...
@@ -251,7 +249,7 @@ function uploadFile(obj) {
function
loadGps
(
fileurl
)
{
$
.
ajax
({
url
:
'/gk/road/gps/'
+
$
(
'.map-container'
).
attr
(
'data-id'
),
url
:
'/gk/road/gps/'
+
$
(
'.map-container'
).
attr
(
'data-id'
),
success
:
function
(
data
)
{
console
.
log
(
data
);
createPath
(
data
.
content
);
...
...
@@ -316,7 +314,7 @@ var map = {
}).
setView
([
39.90923
,
116.397428
],
4
);
var
osmUrl
=
'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
;
var
osm
=
new
L
.
TileLayer
(
osmUrl
,
{
minZoom
:
1
,
maxZoom
:
18
});
var
osm
=
new
L
.
TileLayer
(
osmUrl
,
{
minZoom
:
1
,
maxZoom
:
18
});
//map.instance.addLayer(osm);
var
baseLayers
=
{
...
...
@@ -326,15 +324,15 @@ var map = {
};
//地图类型
L
.
control
.
layers
(
baseLayers
,
null
,
{
position
:
'topright'
}).
addTo
(
map
.
instance
);
L
.
control
.
scale
({
position
:
'bottomright'
,
imperial
:
false
}).
addTo
(
map
.
instance
);
L
.
control
.
zoom
({
position
:
"bottomright"
}).
addTo
(
map
.
instance
);
L
.
control
.
layers
(
baseLayers
,
null
,
{
position
:
'topright'
}).
addTo
(
map
.
instance
);
L
.
control
.
scale
({
position
:
'bottomright'
,
imperial
:
false
}).
addTo
(
map
.
instance
);
L
.
control
.
zoom
({
position
:
"bottomright"
}).
addTo
(
map
.
instance
);
}
}
function
createPath
(
pathObj
)
{
var
lineArr
=
new
Array
();
//经纬度坐标数组
var
center
=
[
39.911836
,
116.399095
];
var
center
=
[
39.911836
,
116.399095
];
var
points
=
JSON
.
parse
(
pathObj
.
points
);
var
mid
=
Math
.
ceil
(
points
.
tracePoint
.
length
/
2
);
...
...
@@ -346,7 +344,7 @@ function createPath(pathObj) {
});
var
polyline
=
L
.
polyline
(
lineArr
,
{
stroke
:
true
,
fill
:
false
,
color
:
'red'
,
lineCap
:
'none'
,
weight
:
6
});
var
polyline
=
L
.
polyline
(
lineArr
,
{
stroke
:
true
,
fill
:
false
,
color
:
'red'
,
lineCap
:
'none'
,
weight
:
6
});
layers
.
push
(
polyline
);
polyline
.
addTo
(
map
.
instance
);
map
.
instance
.
setView
(
center
);
...
...
@@ -376,16 +374,16 @@ function getPath(roadId, pathId) {
function
getPlaceMakers
(
roadId
,
pathId
)
{
$
.
ajax
({
url
:
'/gk/road//getCheckPoints/'
+
roadId
+
'?pathId='
+
pathId
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
url
:
'/gk/road//getCheckPoints/'
+
roadId
+
'?pathId='
+
pathId
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
$
(
'.markers .marker'
).
remove
();
$
(
'.markers-edit .marker'
).
remove
();
// 智能步道
$
(
"#editCpDisBtn"
).
css
(
"display"
,
"none"
);
$
(
"#editCpDisBtn"
).
css
(
"display"
,
"none"
);
var
editCpDisHtml
=
""
;
if
(
data
.
content
.
length
==
0
)
{
if
(
data
.
content
.
length
==
0
)
{
layer
.
msg
(
"没有标记点,请导入有标记点的路线,以免影响您的后续使用!"
);
return
}
...
...
@@ -397,25 +395,25 @@ function getPlaceMakers(roadId, pathId) {
var
marker
=
L
.
marker
([
Number
(
e
.
latitude
),
Number
(
e
.
longitude
)]).
setIcon
(
myIcon1
);
marker
.
addTo
(
map
.
instance
);
layers
.
push
(
marker
);
$
(
'.markers'
).
append
(
'<div data-checkpointId="'
+
e
.
checkpointId
+
'" class="marker"><label for="" class="marker-name">'
+
e
.
name
+
'</label>
\
n'
+
(
e
.
isTime
?
' <span class="marker-tip">用作计时点</span>'
:
''
)
+
$
(
'.markers'
).
append
(
'<div data-checkpointId="'
+
e
.
checkpointId
+
'" class="marker"><label for="" class="marker-name">'
+
e
.
name
+
'</label>
\
n'
+
(
e
.
isTime
?
' <span class="marker-tip">用作计时点</span>'
:
''
)
+
'</div>'
);
$
(
'.markers-edit'
).
append
(
'<div data-checkpointId="'
+
e
.
checkpointId
+
'" class="marker">'
+
'<input data-before="'
+
e
.
name
+
'" type="text" value="'
+
e
.
name
+
'">'
+
'<input type="number" value="'
+
((
e
.
distance
===
''
||
e
.
distance
==
null
)?
"0"
:
Number
(
e
.
distance
/
1000
).
toFixed
(
3
))
+
'" placeholder="单位:KM">'
+
'<input type="checkbox" '
+
(
e
.
isTime
?
"checked=checked"
:
""
)
+
'></div>'
);
$
(
'.markers-edit'
).
append
(
'<div data-checkpointId="'
+
e
.
checkpointId
+
'" class="marker">'
+
'<input data-before="'
+
e
.
name
+
'" type="text" value="'
+
e
.
name
+
'">'
+
'<input type="number" value="'
+
((
e
.
distance
===
''
||
e
.
distance
==
null
)
?
"0"
:
Number
(
e
.
distance
/
1000
).
toFixed
(
3
))
+
'" placeholder="单位:KM">'
+
'<input type="checkbox" '
+
(
e
.
isTime
?
"checked=checked"
:
""
)
+
'></div>'
);
for
(
let
j
=
0
;
j
<
data
.
content
.
length
;
j
++
)
{
if
(
j
==
i
)
{
if
(
j
==
i
)
{
continue
;
}
else
{
editCpDisHtml
+=
'<div class="editCpDis-box" road-id="'
+
roadId
+
'" path-id="'
+
pathId
+
'">'
+
}
else
{
editCpDisHtml
+=
'<div class="editCpDis-box" road-id="'
+
roadId
+
'" path-id="'
+
pathId
+
'">'
+
' <div class="dis-name">'
+
e
.
name
+
'-'
+
data
.
content
[
j
].
name
+
e
.
name
+
'-'
+
data
.
content
[
j
].
name
+
' </div>'
+
' <div class="dis-input">'
+
' <input type="number" name="'
+
e
.
checkpointId
+
'-'
+
data
.
content
[
j
].
checkpointId
+
'" placeholder="单位:KM" step="0.1" class="form-control"/>'
+
' <input type="number" name="'
+
e
.
checkpointId
+
'-'
+
data
.
content
[
j
].
checkpointId
+
'" placeholder="单位:KM" step="0.1" class="form-control"/>'
+
' </div>'
+
' </div>'
;
}
...
...
@@ -432,26 +430,26 @@ function getPlaceMakers(roadId, pathId) {
// 查询智能步道数据
function
initCpDis
(
initHtml
,
roadId
,
pathId
)
{
$
.
ajax
({
url
:
'/gk/road/getCpDis/'
+
roadId
+
'/'
+
pathId
,
success
:
function
(
data
)
{
url
:
'/gk/road/getCpDis/'
+
roadId
+
'/'
+
pathId
,
success
:
function
(
data
)
{
debugger
;
if
(
data
.
code
==
200
)
{
if
(
data
.
content
.
length
<=
0
)
{
// 无数据,初始化
$
(
"#editCpDisBtn"
).
css
(
"display"
,
"inline-block"
);
if
(
data
.
code
==
200
)
{
if
(
data
.
content
.
length
<=
0
)
{
// 无数据,初始化
$
(
"#editCpDisBtn"
).
css
(
"display"
,
"inline-block"
);
$
(
"#editCpDis-list"
).
html
(
initHtml
);
}
else
{
var
editCpDisHtml
=
""
;
$
.
each
(
data
.
content
,
function
(
i
,
e
)
{
editCpDisHtml
+=
'<div class="editCpDis-box" road-id="'
+
roadId
+
'" path-id="'
+
pathId
+
'">'
+
editCpDisHtml
+=
'<div class="editCpDis-box" road-id="'
+
roadId
+
'" path-id="'
+
pathId
+
'">'
+
' <div class="dis-name">'
+
e
.
disPointName
+
e
.
disPointName
+
' </div>'
+
' <div class="dis-input">'
+
' <input type="number" name="'
+
e
.
disPoint
+
'" placeholder="单位:KM" step="0.1" class="form-control" value="'
+
((
e
.
distance
===
''
||
e
.
distance
==
null
)?
"0"
:
Number
(
e
.
distance
/
1000
).
toFixed
(
3
))
+
'"/>'
+
' <input type="number" name="'
+
e
.
disPoint
+
'" placeholder="单位:KM" step="0.1" class="form-control" value="'
+
((
e
.
distance
===
''
||
e
.
distance
==
null
)
?
"0"
:
Number
(
e
.
distance
/
1000
).
toFixed
(
3
))
+
'"/>'
+
' </div>'
+
' </div>'
;
});
$
(
"#editCpDisBtn"
).
css
(
"display"
,
"inline-block"
);
$
(
"#editCpDisBtn"
).
css
(
"display"
,
"inline-block"
);
$
(
"#editCpDis-list"
).
html
(
editCpDisHtml
);
}
}
...
...
@@ -464,26 +462,26 @@ function saveCpDis() {
// 封装数据
var
arr
=
[];
var
cmptId
=
getCmptId
();
$
.
each
(
$
(
".editCpDis-box"
),
function
(
index
,
item
)
{
$
.
each
(
$
(
".editCpDis-box"
),
function
(
index
,
item
)
{
var
roadId
=
$
(
item
).
attr
(
"road-id"
);
var
pathId
=
$
(
item
).
attr
(
"path-id"
);
var
disPoint
=
$
(
item
).
find
(
"input"
).
attr
(
'name'
);
var
distance
=
$
(
item
).
find
(
"input"
).
val
()
?
$
(
item
).
find
(
"input"
).
val
():
0
;
var
obj
=
{
cmptId
:
cmptId
,
roadId
:
roadId
,
pathId
:
pathId
,
disPoint
:
disPoint
,
distance
:
distance
*
1000
};
var
distance
=
$
(
item
).
find
(
"input"
).
val
()
?
$
(
item
).
find
(
"input"
).
val
()
:
0
;
var
obj
=
{
cmptId
:
cmptId
,
roadId
:
roadId
,
pathId
:
pathId
,
disPoint
:
disPoint
,
distance
:
distance
*
1000
};
arr
.
push
(
obj
);
})
if
(
arr
.
length
<=
0
)
{
if
(
arr
.
length
<=
0
)
{
layer
.
msg
(
"没有标记点,请导入有标记点的路线,以免影响您的后续使用!"
);
return
}
$
.
ajax
({
url
:
'/gk/road/saveCpDis'
,
url
:
'/gk/road/saveCpDis'
,
contentType
:
'application/json;charset=UTF-8'
,
method
:
'post'
,
data
:
JSON
.
stringify
(
arr
),
traditional
:
true
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
layer
.
msg
(
"保存成功"
);
$
(
"#editCpDis"
).
modal
(
"hide"
);
}
else
{
...
...
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