Commit c46469b4 authored by daniel's avatar daniel

feat(func): 功能菜单+外面模块完善+上传改造

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