Commit 70616aef authored by daniel's avatar daniel

perf(公告模块优化): 公告模块优化

parent 5622bf4a
......@@ -33,5 +33,9 @@ public class News implements Serializable {
@JsonIgnore
private Date updateDate;
private String path;
private String appId;
private String lat;
private String lng;
private int openType;
}
\ No newline at end of file
......@@ -257,6 +257,7 @@
<select id="getCmptFromEnroll" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt">
select cmptName,date_format(startTime,'%Y-%m-%d %H:%i:%s') startTime,
date_format(ifnull(endTime,now()),'%Y-%m-%d %H:%i:%s') endTime,type as cmptType,
logo,
b.city as city,
b.province as province,
b.area as area,
......
......@@ -70,6 +70,7 @@ public class NewsController {
@ResponseBody
public Result save(News news) {
News newDb = newsService.save(news);
log.info("保存数据 ",newDb.toString());
return Result.success().setContent(newDb);
}
......
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html>
<head>
<title>资讯</title>
<!-- Bootstrap CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/font-awesome/css/font-awesome.min.css">
<!-- Fontastic Custom icon font-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/fontastic.css">
<!-- Google fonts - Poppins -->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/font-css.css">
<!-- theme stylesheet-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/style.default.css?v=<%=System.currentTimeMillis()%>" id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/juery-ui-1.12.css">
<!-- Favicon-->
<link rel="shortcut icon" href="https://img.geexek.com/files/home/favicon.ico">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/main.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/cmpt/setting.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet.css?v=<%=System.currentTimeMillis()%>"/>
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet_label.css"/>
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${ctxStatic}/leaflet/leaflet.js"></script>
<script type="text/javascript" src="${ctxStatic}/leaflet/label.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctxStatic}/layer/layer.js"></script>
<link rel="stylesheet" href="${ctxStatic}/layer/skin/layer.css">
<script src="https://enroll.geexek.com/js/ueditor/ueditor.config-zs.js?v=<%=System.currentTimeMillis()%>"></script>
<script src="https://enroll.geexek.com/js/ueditor/ueditor.all.js?v=<%=System.currentTimeMillis()%>"></script>
<script src="${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"></script>
<script src="${ctxStatic}/js/qikoo.js"></script>
<style>
.container {
position: relative
}
.data-title {
width: 100%;
height: 60px;
line-height: 60px;
display: flex;
margin-top: 30px;
}
.add {
width: 146px;
height: 40px;
background: #ce3939;
position: absolute;
right: 16px;
text-align: center;
line-height: 40px;
top: 0px;
cursor: pointer;
border-radius: 4px;
}
.data-title > span {
display: inline-block;
color: #9A9A9A;
font-size: 20px;
}
.item {
display: flex;
background: white;
align-items: center;
margin-bottom: 32px;
font-size: 20px;
color: #333;
box-shadow: 0px 0px 10px 0px rgba(238, 235, 235, 1);
border-radius: 4px;
}
.title {
padding-left: 40px;
font-size: 20px;
color: #333;
display: flex;
justify-content: center;
align-items: center;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.type {
line-height: 90px;
text-align: left;
}
.opt-text {
font-size: 14px;
color: rgba(153, 153, 153, 1);
height: 20px;
}
.del, .edit {
display: inline-block;
background-position: center;
background-size: 100%;
background-repeat: no-repeat;
margin-right: 8px;
}
.icon-edit {
width: 16px;
height: 18px;
background-image: url(/static/images/icons-edit.png);
transform: none;
display: inline-block;
background-position: center;
background-size: 100%;
background-repeat: no-repeat;
margin-right: 8px;
}
.icon-del {
width: 18px;
height: 18px;
background-image: url("/static/images/icon-delete.png");
display: inline-block;
background-position: center;
background-size: 100%;
background-repeat: no-repeat;
margin-right: 8px;
margin-top: -3px;
}
.opt {
height: 30px;
align-items: center;
cursor: pointer;
display: flex;
line-height: 24px;
}
.edit-container {
width: 860px;
height: 740px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 10px 0px rgba(238, 235, 235, 1);
border-radius: 4px;
display: flex;
flex-direction: column;
overflow-x: hidden;
padding: 20px 30px;
}
/*整体部分*/
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
/*滑动轨道*/
::-webkit-scrollbar-track {
border-radius: 0px;
background: none;
}
/*滑块*/
::-webkit-scrollbar-thumb {
border-radius: 5px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
background-color: rgba(255, 255, 255, .75)
}
/*滑块效果*/
::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
background-color: rgba(85, 85, 85, 0.4);
}
#edui1, #edui1_iframeholder {
width: 682px !important;
}
.title-area {
width: 680px;
height: 100px;
background: rgba(247, 247, 247, 1);
border-radius: 4px;
border: 1px solid rgba(238, 238, 238, 1);
}
.input-group{
display: block;
}
.input-group > label {
color: #333;
font-size: 20px;
float: left;
}
.cover {
width: 680px;
height: 232px;
background: rgba(247, 247, 247, 1);
border-radius: 4px;
border: 1px solid rgba(238, 238, 238, 1);
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
background-repeat: no-repeat;
background-position: center;
background-size: auto;
}
input, textarea {
outline: none;
padding: 5px;
}
.save {
width: 146px;
height: 50px;
background: rgba(206, 57, 57, 1);
border-radius: 4px;
text-align: center;
line-height: 50px;
color: white;
margin: 50px auto;
cursor: pointer;
}
.icon-back {
width: 15px;
height: 18px;
background-image: url("/static/images/icon_back.png");
background-size: 100%;
background-repeat: no-repeat;
margin-right: 5px;
}
.icon-cover {
width: 34px;
height: 34px;
background-image: url("/static/images/icon_cover.png");
background-size: 100%;
background-repeat: no-repeat;
}
.icon-add {
display: inline-block;
width: 16px;
height: 16px;
background-image: url("/static/images/icon-add.png");
background-repeat: no-repeat;
background-size: 100%;
margin-right: 10px;
}
input[type="radio"]:before {
content: "";
width: 19px;
height: 19px;
background: white;
position: absolute;
z-index: 1;
border-radius: 50%;
border: 1px solid #ce3939;
top: -2px;
left: -2px;
}
input[type="radio"] {
position: relative;
cursor: pointer;
top: -2px;
}
input[type="radio"]:checked:after {
content: "";
width: 13px;
height: 13px;
background: #ce3939;
z-index: 2;
border-radius: 50%;
top: 1px;
left: 1px;
display: block;
position: absolute;
}
.notice {
margin-left: 15px;
height: 40px;
font-size: 20px;
line-height: 40px;
}
.info {
margin-left: 23px;
height: 40px;
font-size: 20px;
line-height: 40px;
}
.edit-btn{
cursor: pointer;
display: flex;
align-items: center;
height: 30px;
width: 80px;
float: left;
margin-top: 3px;
}
.news-title{
font-size: 24px;
color: #333;
float: left;
margin-right: 25px;
}
.no-name{
color: #ABABAB;font-size: 24px;margin-right: 25px
}
</style>
</head>
<body style="background:rgba(246,246,246,1);">
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
<jsp:include page="../common/menu.jsp"></jsp:include>
<div class="container rght">
<span class="route-title-main news-title" style="font-size: 24px;color: #333">
<c:choose>
<c:when test="${empty setting}">
赛事公告
</c:when>
<c:when test="${empty setting.newsAlias}">
<span class="no-name">未命名</span>
</c:when>
<c:otherwise>
<span>${setting.newsAlias}</span>
</c:otherwise>
</c:choose>
</span>
<div style="cursor: pointer" class="edit-btn">
<span class="icon-edit" style="margin: 0px 6px;"></span>
<span class="opt-text" style="color:#ce3939;margin: 0px">编辑</span>
</div>
<div class="add">
<span class="icon-add"></span>
<span class="add-text" style="color: white">添加公告</span>
</div>
<div class="data-title">
<span style="flex: 12.3;">标题</span>
<span style="flex:2;text-align: left;visibility: hidden">类型</span>
<span style="flex:2">操作</span>
</div>
<c:forEach var="item" items="${list}">
<div class="item" data-id="${item.id}">
<span class="title" style="flex:11.6">${item.title}</span>
<span class="type" style="flex:2;visibility: hidden">${item.type == 1 ? '通知':'赛讯' }</span>
<div style="flex:2;display: flex;flex-direction: column">
<div class="opt edit">
<span class="icon-edit"></span>
<span class="opt-text" style="color:#ce3939;">编辑</span>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html>
<head>
<title>资讯</title>
<!-- Bootstrap CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/font-awesome/css/font-awesome.min.css">
<!-- Fontastic Custom icon font-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/fontastic.css">
<!-- Google fonts - Poppins -->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/font-css.css">
<!-- theme stylesheet-->
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/style.default.css?v=<%=System.currentTimeMillis()%>"
id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/juery-ui-1.12.css">
<!-- Favicon-->
<link rel="shortcut icon" href="https://img.geexek.com/files/home/favicon.ico">
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/main.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/cmpt/setting.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet"
href="${ctxStatic}/leaflet/css/leaflet.css?v=<%=System.currentTimeMillis()%>" />
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet_label.css" />
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="${ctxStatic}/leaflet/leaflet.js"></script>
<script type="text/javascript" src="${ctxStatic}/leaflet/label.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctxStatic}/layer/layer.js"></script>
<link rel="stylesheet" href="${ctxStatic}/layer/skin/layer.css">
<script
src="https://enroll.geexek.com/js/ueditor/ueditor.config-zs.js?v=<%=System.currentTimeMillis()%>"></script>
<script
src="https://enroll.geexek.com/js/ueditor/ueditor.all.js?v=<%=System.currentTimeMillis()%>"></script>
<script src="${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"></script>
<script src="${ctxStatic}/js/qikoo.js"></script>
<style>
.container {
position: relative
}
.hidden {
display: none !important;
}
.data-title {
width: 100%;
height: 60px;
line-height: 60px;
display: flex;
margin-top: 30px;
}
.add {
width: 146px;
height: 40px;
background: #ce3939;
position: absolute;
right: 16px;
text-align: center;
line-height: 40px;
top: 0px;
cursor: pointer;
border-radius: 4px;
}
.data-title>span {
display: inline-block;
color: #9A9A9A;
font-size: 20px;
}
.item {
display: flex;
background: white;
align-items: center;
margin-bottom: 32px;
font-size: 20px;
color: #333;
box-shadow: 0px 0px 10px 0px rgba(238, 235, 235, 1);
border-radius: 4px;
}
.title {
padding-left: 40px;
font-size: 20px;
color: #333;
display: flex;
justify-content: center;
align-items: center;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.type {
line-height: 90px;
text-align: left;
}
.opt-text {
font-size: 14px;
color: rgba(153, 153, 153, 1);
height: 20px;
}
.del,
.edit {
display: inline-block;
background-position: center;
background-size: 100%;
background-repeat: no-repeat;
margin-right: 8px;
}
.icon-edit {
width: 16px;
height: 18px;
background-image: url(/static/images/icons-edit.png);
transform: none;
display: inline-block;
background-position: center;
background-size: 100%;
background-repeat: no-repeat;
margin-right: 8px;
}
.icon-del {
width: 18px;
height: 18px;
background-image: url("/static/images/icon-delete.png");
display: inline-block;
background-position: center;
background-size: 100%;
background-repeat: no-repeat;
margin-right: 8px;
margin-top: -3px;
}
.opt {
height: 30px;
align-items: center;
cursor: pointer;
display: flex;
line-height: 24px;
}
.edit-container {
width: 860px;
height: 740px;
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 10px 0px rgba(238, 235, 235, 1);
border-radius: 4px;
display: flex;
flex-direction: column;
overflow-x: hidden;
padding: 20px 30px;
}
/*整体部分*/
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
/*滑动轨道*/
::-webkit-scrollbar-track {
border-radius: 0px;
background: none;
}
/*滑块*/
::-webkit-scrollbar-thumb {
border-radius: 5px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
background-color: rgba(255, 255, 255, .75)
}
/*滑块效果*/
::-webkit-scrollbar-thumb:hover {
border-radius: 5px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
background-color: rgba(85, 85, 85, 0.4);
}
#edui1,
#edui1_iframeholder {
width: 682px !important;
}
.title-area {
width: 680px;
height: 100px;
background: rgba(247, 247, 247, 1);
border-radius: 4px;
border: 1px solid rgba(238, 238, 238, 1);
}
.input-group {
display: block;
}
.input-group>label {
color: #333;
font-size: 20px;
float: left;
}
.cover {
width: 680px;
height: 232px;
background: rgba(247, 247, 247, 1);
border-radius: 4px;
border: 1px solid rgba(238, 238, 238, 1);
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
background-repeat: no-repeat;
background-position: center;
background-size: auto;
}
input,
textarea {
outline: none;
padding: 5px;
}
.save {
width: 146px;
height: 50px;
background: rgba(206, 57, 57, 1);
border-radius: 4px;
text-align: center;
line-height: 50px;
color: white;
margin: 50px auto;
cursor: pointer;
}
.icon-back {
width: 15px;
height: 18px;
background-image: url("/static/images/icon_back.png");
background-size: 100%;
background-repeat: no-repeat;
margin-right: 5px;
}
.icon-cover {
width: 34px;
height: 34px;
background-image: url("/static/images/icon_cover.png");
background-size: 100%;
background-repeat: no-repeat;
}
.icon-add {
display: inline-block;
width: 16px;
height: 16px;
background-image: url("/static/images/icon-add.png");
background-repeat: no-repeat;
background-size: 100%;
margin-right: 10px;
}
input[type="radio"]:before {
content: "";
width: 19px;
height: 19px;
background: white;
position: absolute;
z-index: 1;
border-radius: 50%;
border: 1px solid #ce3939;
top: -2px;
left: -2px;
}
input[type="radio"] {
position: relative;
cursor: pointer;
top: -2px;
}
input[type="radio"]:checked:after {
content: "";
width: 13px;
height: 13px;
background: #ce3939;
z-index: 2;
border-radius: 50%;
top: 1px;
left: 1px;
display: block;
position: absolute;
}
.notice {
margin-left: 15px;
height: 40px;
font-size: 20px;
line-height: 40px;
}
.info {
margin-left: 23px;
height: 40px;
font-size: 20px;
line-height: 40px;
}
.edit-btn {
cursor: pointer;
display: flex;
align-items: center;
height: 30px;
width: 80px;
float: left;
margin-top: 3px;
}
.news-title {
font-size: 24px;
color: #333;
float: left;
margin-right: 25px;
}
.no-name {
color: #ABABAB;
font-size: 24px;
margin-right: 25px
}
</style>
</head>
<body style="background:rgba(246,246,246,1);">
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
<jsp:include page="../common/menu.jsp"></jsp:include>
<div class="container rght">
<span class="route-title-main news-title" style="font-size: 24px;color: #333">
<c:choose>
<c:when test="${empty setting}">
赛事公告
</c:when>
<c:when test="${empty setting.newsAlias}">
<span class="no-name">未命名</span>
</c:when>
<c:otherwise>
<span>${setting.newsAlias}</span>
</c:otherwise>
</c:choose>
</span>
<div style="cursor: pointer" class="edit-btn">
<span class="icon-edit" style="margin: 0px 6px;"></span>
<span class="opt-text" style="color:#ce3939;margin: 0px">编辑</span>
</div>
<div class="add">
<span class="icon-add"></span>
<span class="add-text" style="color: white">添加公告</span>
</div>
<div class="data-title">
<span style="flex: 12.3;">标题</span>
<span style="flex:2;text-align: left;">类型</span>
<span style="flex:2">操作</span>
</div>
<c:forEach var="item" items="${list}">
<div class="item" data-id="${item.id}">
<span class="title" style="flex:11.6">${item.title}</span>
<span class="type" style="flex:2;">${typeDesc[item.openType]}</span>
<div style="flex:2;display: flex;flex-direction: column">
<div class="opt edit">
<span class="icon-edit"></span>
<span class="opt-text" style="color:#ce3939;">编辑</span>
</div>
<div class="opt del">
<span class="icon-del"></span>
<span class="opt-text">删除</span>
</div>
</div>
</div>
</c:forEach>
</div>
<div style="margin-left: 40px;margin-top: 40px; display: none" class="edit-context">
<div style="margin-bottom: 15px;margin-right: 10px;cursor: pointer" class="back"><span
class="icon-back"></span><span style="font-size: 20px;color: #333">返回</span></div>
<div class="edit-container">
<div class="input-group" style="height: 120px;margin-bottom: 10px;">
<label for="">标题 <span style="color: #ce3939">*</span></label>
<div>
<textarea style="float: right;" class="title-area" type="text" placeholder="标题"
id="title" cols="50" rows="10"></textarea>
</div>
</div>
<div class="input-group" style="height: 80px; align-items: center;display: none">
<label for=""
style="float: left;height: 80px;align-items: center;line-height: 80px;">类型 <span
style="color:#ce3939;">*</span></label>
<div style="float: left; margin-left: 57px;margin-top: 20px;">
<input type="radio" name="type" value="1" checked><span class="notice"
style="margin-right: 180px;">通知</span>
<input type="radio" name="type" value="2"><span class="info">赛讯</span>
</div>
</div>
<div class="input-group"
style="height: 80px; align-items: center;display: flex;flex-direction: row">
<span class="title-new">跳转类型</span><span style="color:#ce3939;">*</span></label>
<div class="label-box"
style="margin-left: 40px;margin-top: 20px;margin-bottom: 20px;">
<select id="openType">
<option value="0">文本</option>
<option value="1">h5</option>
<option value="2">小程序</option>
<option value="3">短连接</option>
<option value="4">内部页面</option>
<option value="5">文档</option>
<option value="6">图片</option>
<option value="7">地图</option>
</select>
</div>
</div>
<div class="input-group hidden" id="path-input" style="height: 120px;margin-bottom: 10px;">
<label for="">路径</label>
<div>
<textarea style="float: right;" class="title-area" type="text"
placeholder="外链填写后,优先展示外链信息公众号必选绑定小程序" id="path" cols="50"
rows="10"></textarea>
</div>
</div>
<div class="input-group hidden" id="appId-input"
style="height: 120px;margin-bottom: 10px;">
<label for="">appId</label>
<div>
<textarea style="float: right;" class="title-area" type="text"
placeholder="小程序appId" id="appId" cols="50" rows="10"></textarea>
</div>
</div>
<div class="input-group hidden" id="lat-input"
style="height: 120px;margin-bottom: 10px;">
<label for="">经度</label>
<div>
<textarea style="float: right;" class="title-area" type="text" placeholder="经度"
id="lat" cols="50" rows="10"></textarea>
</div>
</div>
<div class="input-group hidden" id="lng-input"
style="height: 120px;margin-bottom: 10px;">
<label for="">纬地</label>
<div>
<textarea style="float: right;" class="title-area" type="text" placeholder="维度"
id="lng" cols="50" rows="10"></textarea>
</div>
</div>
<div class="input-group" style="margin-top: 8px;margin-bottom: 30px;height: 240px">
<label id="file-cover">封面<br><span
style="font-size: 16px;color: #ce3939;margin-top: 20px">
<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">建议分辨<br>率710*242</span></span></label>
<div style="float: right;">
<div class="cover">
<span class="icon-cover"></span>
</div>
<input id="file" type="file" style="display: none" onchange="uploadFile(this)">
</div>
</div>
<div class="input-group" style="height: 120px;margin-bottom: 10px;">
<label for="">外链</label>
<div>
<textarea style="float: right;" class="title-area" type="text"
placeholder="外链填写后,优先展示外链信息公众号必选绑定小程序" id="linkUrl" cols="50"
rows="10"></textarea>
</div>
</div>
<div class="input-group">
<label for="">内容编辑 <span style="color:#ce3939">*</span></label>
<div id="container" style="float: right"></div>
</div>
<span id="save" class="save">保存</span>
</div>
</div>
<script src="${ctxStatic}/js/news.js"></script>
</div>
<div class="opt del">
<span class="icon-del"></span>
<span class="opt-text">删除</span>
<div class="item copy" style="display: none">
<span class="title" style="flex:11.6">${item.title}</span>
<%--<span class="type" style="flex:2">${item.type == 1 ? '通知':'赛训' }</span>--%>
<div style="flex:2;display: flex;flex-direction: column">
<div class="opt edit">
<span class="icon-edit"></span>
<span class="opt-text">编辑</span>
</div>
<div class="opt del">
<span class="icon-del"></span>
<span class="opt-text">删除</span>
</div>
</div>
</div>
</div>
</div>
</c:forEach>
</div>
<div style="margin-left: 40px;margin-top: 40px; display: none" class="edit-context">
<div style="margin-bottom: 15px;margin-right: 10px;cursor: pointer" class="back"><span class="icon-back"></span><span
style="font-size: 20px;color: #333">返回</span></div>
<div class="edit-container">
<div class="input-group" style="height: 120px">
<label for="">标题 <span style="color: #ce3939">*</span></label>
<div>
<textarea style="float: right;" class="title-area" type="text" placeholder="标题" id="title" cols="50" rows="10"></textarea>
</div>
</div>
<div class="input-group" style="height: 80px; align-items: center;display: none">
<label for="" style="float: left;height: 80px;align-items: center;line-height: 80px;">类型 <span style="color:#ce3939;">*</span></label>
<div style="float: left; margin-left: 57px;margin-top: 20px;">
<input type="radio" name="type" value="1" checked><span class="notice" style="margin-right: 180px;">通知</span>
<input type="radio" name="type" value="2"><span class="info">赛讯</span>
</div>
</div>
<div class="input-group" style="margin-top: 8px;margin-bottom: 30px;height: 240px">
<label id="file-cover">封面<br><span style="font-size: 16px;color: #ce3939;margin-top: 20px">
<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">建议分辨<br>率710*242</span></span></label>
<div style="float: right;">
<div class="cover">
<span class="icon-cover"></span>
<div class="edit-dialog">
<div style="height: 50px;">
<span style="font-size: 22px;color: #ce3939;">编辑</span>
</div>
<div>
<input id="newsAlias" type="text" placeholder="请输入名称">
</div>
<div style="display: flex; height: 37px;justify-content: center; align-items: center;">
<span class="zhu">注</span>
<span style="font-size: 16px;color: #ce3939;">公告名称最多10个字,如果不填写则小程序不显示公告名称,如下图所示</span>
</div>
<div style="text-align: right;margin-top: 30px;">
<span class="cancel">取消</span>
<span class="sure">确定</span>
</div>
<div style="padding: 30px 0px;">
<img width="450px" src="/static/images/demo.png" alt="">
</div>
</div>
<input id="file" type="file" style="display: none" onchange="uploadFile(this)">
</div>
</div>
<div class="input-group" style="height: 120px">
<label for="">外链</label>
<div>
<textarea style="float: right;" class="title-area" type="text" placeholder="外链填写后,优先展示外链信息公众号必选绑定小程序" id="linkUrl" cols="50" rows="10"></textarea>
</div>
</div>
<div class="input-group">
<label for="">内容编辑 <span style="color:#ce3939">*</span></label>
<div id="container" style="float: right"></div>
</div>
<span id="save" class="save">保存</span>
</div>
</div>
<script src="${ctxStatic}/js/news.js"></script>
</div>
<div class="item copy" style="display: none">
<span class="title" style="flex:11.6">${item.title}</span>
<%--<span class="type" style="flex:2">${item.type == 1 ? '通知':'赛训' }</span>--%>
<div style="flex:2;display: flex;flex-direction: column">
<div class="opt edit">
<span class="icon-edit"></span>
<span class="opt-text">编辑</span>
</div>
<div class="opt del">
<span class="icon-del"></span>
<span class="opt-text">删除</span>
</div>
</div>
</div>
<div class="edit-dialog">
<div style="height: 50px;">
<span style="font-size: 22px;color: #ce3939;">编辑</span>
</div>
<div>
<input id="newsAlias" type="text" placeholder="请输入名称">
</div>
<div style="display: flex; height: 37px;justify-content: center; align-items: center;">
<span class="zhu">注</span>
<span style="font-size: 16px;color: #ce3939;">公告名称最多10个字,如果不填写则小程序不显示公告名称,如下图所示</span>
</div>
<div style="text-align: right;margin-top: 30px;">
<span class="cancel">取消</span>
<span class="sure">确定</span>
</div>
<div style="padding: 30px 0px;">
<img width="450px" src="/static/images/demo.png" alt="">
</div>
</div>
<div class="edit-mask"></div>
<style>
.zhu{
height: 18px;
width: 19px;
background: #ce3939;
border-radius: 50%;
display: inline-block;
color: white;
font-size: 12px;
text-align: center;
line-height: 18px;
margin: 1px 3px 0px 0px;
}
.edit-mask{
width:1920px;
height:1069px;
background:rgba(246,246,246,1);
position: fixed;
width: 100%;
height: 100%;
z-index: 99;
background:rgba(0,0,0,1);
opacity:0.8;
left: 0px;
top: 0px;
display: none;
}
.sure{
width: 146px;
height: 42px;
background: rgba(206,57,57,1);
border-radius: 4px;
font-size: 20px;
color: rgba(255,255,255,1);
line-height: 42px;
text-align: center;
cursor: pointer;
}
.cancel{
width: 146px;
height: 42px;
background: rgba(148,148,148,1);
border-radius: 4px;
font-size: 20px;
color: rgba(255,255,255,1);
margin-right: 20px;
line-height: 42px;
text-align: center;
cursor: pointer;
}
.edit-dialog{
padding: 40px;
width:600px;
height:540px;
background:rgba(255,255,255,1);
border-radius:4px;
position: absolute;
top: 100px;
left: 50%;
margin-left: -300px ;
z-index: 100;
display: none;
}
.edit-dialog input{
width: 518px;
height: 50px;
background: rgba(247,247,247,1);
border-radius: 4px;
border: 1px solid rgba(229,229,229,1);
}
</style>
</body>
</html>
<div class="edit-mask"></div>
<style>
.zhu {
height: 18px;
width: 19px;
background: #ce3939;
border-radius: 50%;
display: inline-block;
color: white;
font-size: 12px;
text-align: center;
line-height: 18px;
margin: 1px 3px 0px 0px;
}
.edit-mask {
width: 1920px;
height: 1069px;
background: rgba(246, 246, 246, 1);
position: fixed;
width: 100%;
height: 100%;
z-index: 99;
background: rgba(0, 0, 0, 1);
opacity: 0.8;
left: 0px;
top: 0px;
display: none;
}
.sure {
width: 146px;
height: 42px;
background: rgba(206, 57, 57, 1);
border-radius: 4px;
font-size: 20px;
color: rgba(255, 255, 255, 1);
line-height: 42px;
text-align: center;
cursor: pointer;
}
.cancel {
width: 146px;
height: 42px;
background: rgba(148, 148, 148, 1);
border-radius: 4px;
font-size: 20px;
color: rgba(255, 255, 255, 1);
margin-right: 20px;
line-height: 42px;
text-align: center;
cursor: pointer;
}
.edit-dialog {
padding: 40px;
width: 600px;
height: 540px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
position: absolute;
top: 100px;
left: 50%;
margin-left: -300px;
z-index: 100;
display: none;
}
.edit-dialog input {
width: 518px;
height: 50px;
background: rgba(247, 247, 247, 1);
border-radius: 4px;
border: 1px solid rgba(229, 229, 229, 1);
}
</style>
</body>
</html>
\ No newline at end of file
......@@ -586,6 +586,10 @@
6: {
label: '图片',
placeholder: '请输入图片地址',
},
7: {
label: '地图',
placeholder: '请输入地址和经纬度',
}
},
typeOptions: [
......@@ -612,6 +616,10 @@
{
name: '图片',
value: 6,
},
{
name: '地图',
value: 7,
}
],
statusType: {
......
// 定义 typeDesc 映射
const typeDesc = {
0: {
label: '文本',
placeholder: '请输入文本内容',
},
1: {
label: '网页',
placeholder: '请输入网页地址',
},
2: {
label: '小程序',
placeholder: '请输入小程序地址',
},
3: {
label: '短连接',
placeholder: '请输入短连接地址',
},
4: {
label: '页面',
placeholder: '请输入页面地址',
},
5: {
label: '文档',
placeholder: '请输入文档地址',
},
6: {
label: '图片',
placeholder: '请输入图片地址',
},
7: {
label: '地图',
placeholder: '请输入地址和经纬度',
}
};
$(document).ready(function () {
editor = UE.getEditor('container');
......@@ -10,6 +45,12 @@ $(document).ready(function () {
}
let linkUrl = $('#linkUrl').val();
var content = editor.getContent();
// 新增字段
const openType = $('#openType').val();
const path = $('#path').val();
const lat = $('#lat').val();
const lng = $('#lng').val();
const appId = $('#appId').val();
if (!content) {
layer.alert("内容不能为空!");
return;
......@@ -19,29 +60,37 @@ $(document).ready(function () {
type: 'post',
data: {
linkUrl,
id: $('.edit-container').attr('data-id'), title: title, content: editor.getContent(), userId: 1,
cmptId: getCId(), cover: $('#file-cover').attr('data-src'), type: $('input[name="type"]:checked').val()
id: $('.edit-container').attr('data-id'),
title: title,
appId:appId,
content: editor.getContent(),
userId: 1,
cmptId: getCId(),
cover: $('#file-cover').attr('data-src'),
type: $('input[name="type"]:checked').val(),
// 新增的字段
openType: openType,
path: path,
lat: lat,
lng: lng
},
success: function (data) {
layer.msg('保存成功')
console.log(data);
$('.edit-container').attr('data-id', data.content.id);
var length = $('.container .item').length;
var copy = null;
if (length == 0) {
copy = $('.copy').clone().clone();
} else {
copy = $('.item').last().clone();
$('.item[data-id="' + data.content.id + '"]').remove();
}
$(copy).find('.title').text(data.content.title);
$(copy).find('.type').text(data.content.type == 1 ? '通知' : "赛训");
$(copy).attr('data-id', data.content.id);
$(copy).show()
$('.container').append($(copy));
window.location.reload();
// $('.edit-container').attr('data-id', data.content.id);
// var length = $('.container .item').length;
// var copy = null;
// if (length == 0) {
// copy = $('.copy').clone().clone();
// } else {
// copy = $('.item').last().clone();
// $('.item[data-id="' + data.content.id + '"]').remove();
// }
// $(copy).find('.title').text(data.content.title);
// $(copy).find('.type').text(data.content.type == 1 ? '通知' : "赛训");
// $(copy).attr('data-id', data.content.id);
// $(copy).show()
// $('.container').append($(copy));
}
})
});
......@@ -79,6 +128,7 @@ $(document).ready(function () {
function () {
delNews(id, function () {
obj.remove();
window.location.reload();
});
}, function () {
......@@ -102,12 +152,7 @@ $(document).ready(function () {
success:function (data) {
if(data.code == 200){
layer.msg('保存成功');
if($('#newsAlias').val() == '' || $('#newsAlias').val() == undefined){
$('.news-title').empty();
$('.news-title').append("<span class=\"no-name\">未命名</span>");
}else{
$('.news-title').text($('#newsAlias').val());
}
window.location.reload();
$('.edit-mask,.edit-dialog').fadeOut();
}
}
......@@ -119,7 +164,42 @@ $(document).ready(function () {
$('#newsAlias').val();
$('.edit-mask,.edit-dialog').fadeIn();
})
// 监听select选项
// 监听 openType 变化
$('#openType').change(function() {
const openType = $(this).val();
updateViews(openType);
});
});
// 显示/隐藏必要的参数
function updateViews(openType=0){
const desc = typeDesc[openType];
if (desc) {
// 修改 path 的 label 和 placeholder
$('#path').prev('label').text(desc.label);
$('#path').attr('placeholder', desc.placeholder);
if (openType == '0') { // 地图类型
$('#path-input').addClass('hidden');
} else {
$('#path-input').removeClass('hidden');
}
if (openType == '2') { // 地图类型
$('#appId-input').removeClass('hidden');
} else {
$('#appId-input').addClass('hidden');
}
// 根据类型显示/隐藏经纬度输入框
if (openType == '7') { // 地图类型
$('#lat-input').removeClass('hidden');
$('#lng-input').removeClass('hidden');
} else {
$('#lat-input').addClass('hidden');
$('#lng-input').addClass('hidden');
}
}
}
//文件上传处理
function uploadFile(obj) {
......@@ -167,12 +247,17 @@ function getNews(id) {
$('#title').val(data.content.title)
$('#linkUrl').val(data.content.linkUrl)
$('input[name="type"][value=' + data.content.type + ']').attr('checked', true)
$('#openType').val(data.content.openType);
$('#path').val(data.content.path);
$('#lat').val(data.content.lat);
$('#lng').val(data.content.lng);
$('#appId').val(data.content.appId);
updateViews(data.content.openType)
if (data.content.cover) {
$('.cover').css('background-image', "url(" + data.content.cover + ")")
$('.icon-cover').remove();
$('#file-cover').attr('data-src', data.content.cover)
}
editor.setContent(data.content.content)
}
layer.closeAll();
......
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