Commit d994fb19 authored by daniel's avatar daniel

perf(cmpt): 优化公告+外链

parent 8dd08610
......@@ -35,7 +35,7 @@ public class News implements Serializable {
private String path;
private String appId;
private String lat;
private String lng;
private Double lat;
private Double lng;
private int openType;
}
\ No newline at end of file
......@@ -37,5 +37,12 @@ public class Func {
private Integer status;
private String style;
// 打开方式配置(0 默认 1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
private Integer openType;
// 图标
private String icon;
// 小程序路径,图片路径,文档路径,短连接路径,页面路径
private String path;
}
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dlbridge.jadp.plugins.cmpt.dao.mapper.CmptSettingMapper">
<select id="getCmptSettingById" resultType="CmptSetting">
<select id="getCmptSettingById" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.CmptSetting">
SELECT
id,
cmptid as cmptId,
......@@ -15,13 +15,15 @@
create_date AS "createDate",
update_by AS "updateBy",
update_date AS "updateDate",
del_flag AS "delFlag"
del_flag AS "delFlag",
icon,
open_type AS openType
FROM gk_cmptsetting a
WHERE a.id = #{id}
and a.del_flag = '0'
</select>
<select id="queryCmptSettingsByCmptId" resultType="CmptSetting">
<select id="queryCmptSettingsByCmptId" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.CmptSetting">
SELECT
id,
cmptid as cmptId,
......@@ -34,7 +36,9 @@
create_date AS "createDate",
update_by AS "updateBy",
update_date AS "updateDate",
del_flag AS "delFlag"
del_flag AS "delFlag",
icon,
open_type AS openType
FROM `gk_cmptsetting`
WHERE cmptid = #{cmptId} order by seq
</select>
......@@ -42,7 +46,9 @@
<select id="queryHomePageSettingByCmptId" resultType="java.util.HashMap" parameterType="java.lang.String">
SELECT
id,
type
type,
icon,
open_type AS openType
FROM `gk_cmptsetting`
WHERE 1 = 1
AND visibility = 1
......@@ -63,7 +69,9 @@
style,
seq,
create_date,
del_flag
del_flag,
icon,
open_type
) VALUES (
#{id},
#{cmptId},
......@@ -75,7 +83,9 @@
#{style},
#{seq},
now(),
0
0,
#{icon},
#{openType}
)
</insert>
......@@ -98,7 +108,14 @@
app_id = #{func.appId},
</if>
<if test="func.url != null">
url = #{func.url}
url = #{func.url},
</if>
<if test="func.openType != null">
open_type = #{func.openType},
</if>
<if test="func.icon != null">
icon = #{func.icon}
</if>
</set>
WHERE id = #{func.id}
......@@ -117,7 +134,9 @@
create_date,
del_flag,
app_id,
url
url,
open_type,
icon
) VALUES (
#{func.id},
#{func.cmptId},
......@@ -131,7 +150,9 @@
now(),
0,
#{func.appId},
#{func.url}
#{func.url},
#{func.openType},
#{func.icon}
)
</insert>
......@@ -143,7 +164,12 @@
<if test="status != null and status >=0">
status = #{status},
</if>
<if test="icon != null">
icon = #{icon},
</if>
<if test="openType != null">
open_type = #{openType},
</if>
create_by = #{createBy},
create_date = #{createDate},
update_by = #{updateBy},
......@@ -160,12 +186,18 @@
<if test="setting.status != null and setting.status >=0">
status = #{setting.status},
</if>
<if test="icon != null">
icon = #{icon},
</if>
<if test="openType != null">
open_type = #{openType},
</if>
update_date = now()
WHERE cmptId=#{setting.cmptId} and type = #{setting.type} and del_flag = 0
</update>
<select id="queryFuncs" resultType="com.dlbridge.jadp.plugins.cmpt.bean.Func">
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,`status`
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,`status`,icon,open_type openType
from gk_cmptsetting
where cmptid = #{cmptId} and visibility=1 and del_flag=0 and status>0
order by seq
......@@ -173,7 +205,7 @@
</select>
<select id="queryAllFuncs" resultType="com.dlbridge.jadp.plugins.cmpt.bean.Func">
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,`status`
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,`status`,icon,open_type openType
from gk_cmptsetting
where cmptid = #{cmptId} and visibility=1 and del_flag=0 and status=1
order by seq
......@@ -208,7 +240,7 @@
</collection>
</resultMap>
<select id="queryAllCmptSetting" resultMap="cmptSettingMap">
select cmptid,name cmpt_name,type cmpt_type
select cmptid,name cmpt_name,type cmpt_type,icon,open_type openType
from gk_cmptsetting
</select>
......@@ -220,14 +252,14 @@
</select>
<select id="getCmptSettingsByCmptIdAndType" resultType="com.dlbridge.jadp.plugins.cmpt.bean.Func">
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,icon,open_type openType
from gk_cmptsetting
where cmptid = #{cmptId} and type=#{type}
limit 1
</select>
<select id="queryAllThirdMicros" resultType="com.dlbridge.jadp.plugins.cmpt.bean.Func">
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,icon,open_type openType
from gk_cmptsetting
where cmptid = #{cmptId} and type=19
</select>
......@@ -236,7 +268,7 @@
delete from gk_cmptsetting where id = #{id}
</delete>
<select id="getFuncById" resultType="com.dlbridge.jadp.plugins.cmpt.bean.Func">
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb
select id,cmptid cmptId,name,type,visibility,seq,app_id appId,url,name_web nameWeb,icon,open_type openType
from gk_cmptsetting
where id=#{id}
</select>
......
......@@ -17,6 +17,28 @@ public class CmptSetting extends JaapRecord<CmptSetting> {
private int status;
private String updateById;
// 打开方式配置(0 默认 1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
private Integer openType;
// 图标
private String icon;
public Integer getOpenType() {
return openType;
}
public void setOpenType(Integer openType) {
this.openType = openType;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public String getNameWeb() {
return nameWeb;
}
......
......@@ -10,10 +10,7 @@ import com.dlbridge.jadp.plugins.cmpt.service.FuncSettingService;
import com.neusoft.www.utils.web.Result;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
......@@ -66,11 +63,11 @@ public class NewsController {
}
}
@RequestMapping(value = "/save", method = RequestMethod.POST)
@PostMapping(value = "/save")
@ResponseBody
public Result save(News news) {
public Result save(@RequestBody News news) {
log.info("保存数据 {}",news.toString());
News newDb = newsService.save(news);
log.info("保存数据 ",newDb.toString());
return Result.success().setContent(newDb);
}
......
......@@ -434,7 +434,7 @@
<option value="0">文本</option>
<option value="1">h5</option>
<option value="2">小程序</option>
<option value="3">短连接</option>
<option value="3">短链接</option>
<option value="4">内部页面</option>
<option value="5">文档</option>
<option value="6">图片</option>
......
......@@ -15,7 +15,8 @@
<!-- 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">
<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">
......@@ -35,7 +36,7 @@
<link rel="stylesheet" href="/static/cmpt/score.css?<%=System.currentTimeMillis()%>">
<style>
.submit{
.submit {
display: inline-block;
width: 120px;
height: 45px;
......@@ -48,7 +49,56 @@
cursor: pointer;
font-size: 16px;
}
.cancel{
.label-box {
display: flex;
flex-direction: row;
align-items: center;
}
label {
/* width: auto; */
/* width: 200px; */
display: flex;
flex-direction: row;
align-items: center;
}
.cover {
width: 100%;
height: 100px;
background: rgba(247, 247, 247, 1);
border-radius: 4px;
border: 1px solid rgba(238, 238, 238, 1);
display: flex;
justify-content: center;
align-items: center;
}
.cover-img {
width: 300px;
cursor: pointer;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
height: 300px;
}
.rule-field tbody tr td {
height: auto !important;
font-size: 16px !important;
line-height: 1.2 !important;
}
.icon-cover {
width: 34px;
height: 34px;
background-image: url("/static/images/icon_cover.png");
background-size: 100%;
background-repeat: no-repeat;
}
.cancel {
width: 120px;
height: 45px;
background: #949494;
......@@ -59,62 +109,76 @@
text-align: center;
margin-right: 20px;
}
.input{
width:377px;
height: 40px!important;
line-height: 40px!important;;
.dialog label input {
width: 20px !important;
height: 20px !important;
margin: 0 10px !important;
}
.input {
width: 100%;
height: 40px !important;
line-height: 40px !important;
border: 2px solid #F4F4F4;
border-radius:4px;
border-radius: 4px;
margin-right: 30px;
margin-left: 0px;
padding-left: 12px;
background:rgba(247,247,247,1);
border-radius:4px;
border:1px solid rgba(229,229,229,1);
background: rgba(247, 247, 247, 1);
border-radius: 4px;
border: 1px solid rgba(229, 229, 229, 1);
}
.title{
font-size:24px;
.title {
font-size: 24px;
width: 300px;
font-weight: 500;
color: rgba(51,51,51,1);
color: rgba(51, 51, 51, 1);
}
.title-new{
font-size:20px;
color:rgba(51,51,51,1);
.title-new {
font-size: 20px;
color: rgba(51, 51, 51, 1);
margin-right: 15px;
width: 80px;
}
.section{
.section {
display: flex;
background: rgba(255,255,255,1);
background: rgba(255, 255, 255, 1);
border-radius: 4px;
flex-direction: column;
}
.func{
.func {
display: flex;
flex-direction: column;
height: 90px;
padding: 5px 0;
/*height: 90px;*/
}
.tip{
.tip {
font-size: 16px;
color: rgba(51,51,51,1);
color: rgba(51, 51, 51, 1);
position: absolute;
right: 45px;
top: 10px;
}
.road-notice{
.road-notice {
top: 16px;
height: 15px;
width: 15px;
}
.road-notice-txt{
.road-notice-txt {
color: rgb(206, 57, 57);
font-size: 16px;
width: 430px;
/*width: 430px;*/
display: inline-block;
}
.saveDiv{
.saveDiv {
display: flex;
justify-content: flex-end;
margin: 30px 20px;
......@@ -129,7 +193,7 @@
<div class="rght" id="letter">
<div class="section">
<h3 class="title">外链功能</h3>
<div class="add-btn" @click="switchDialog" >
<div class="add-btn" @click="switchDialog">
<span>+</span>
<span>添加外链项</span>
</div>
......@@ -138,27 +202,40 @@
<div style="margin-top: -10px;margin-bottom: 50px">
<table style="width: 100%" class="rule-field">
<colgroup>
<col width="40%">
<col width="40%">
<col width="20%">
<col style="width:25%">
<col style="width:10%">
<col style="width:10%">
<col style="width:35%">
<col style="width:20%">
</colgroup>
<thead>
<tr>
<th style="padding-left: 25px">功能名称</th>
<th style="text-align: left">外部链接ID</th>
<th style="text-align: center">功能名称</th>
<th style="text-align: center">图标</th>
<th style="text-align: center">类型</th>
<th style="text-align: center">外部链接</th>
<th style="text-align: center">操作</th>
</tr>
</thead>
<tbody>
<tr v-if="" v-for="item in list" :data-id="item.id">
<td class="name" v-text="item.nameWeb"></td>
<td class="name" v-text="item.nameWeb" style="text-align: center"></td>
<td style="text-align: center">
<span v-if="!item.icon">未设置</span>
<img v-else :src="item.icon"
style="width:80px;height:80px;object-fit:cover;" />
</td>
<td style="text-align: center">
<span v-if="item.openType" v-text="typeOptions[item.openType].name"></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>
<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>
......@@ -171,7 +248,7 @@
</tbody>
</table>
</div>
<div class="dialog" v-show="dialog" style="width: 710px ;height: 460px;z-index: 99;">
<div class="dialog" v-show="dialog" style="width: 710px ;height: 680px;z-index: 99;">
<div>
<span class="title" style="margin-bottom: 10px;color: #CE3939">外链功能设置</span>
</div>
......@@ -179,32 +256,58 @@
<div style="position: relative;">
<span class="title-new">功能名称</span>
<span class="road-notice"></span> <span class="road-notice-txt">此名称用于展示给选手,只能使用中文,且不能超过10个字。</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个字符">
<input @input="count" class="input" type="text" v-model="letter.nameWeb"
placeholder="请输入功能名称,最多10个字符">
<span class="tip">{{letter.nameWeb.length}}/10</span>
</div>
</div>
<!-- 类型 (type) -->
<div class="func">
<span class="title-new">类型</span>
<div class="label-box">
<label v-for="item in typeOptions" :key="item.value">
<input type="radio" v-model="letter.openType" :value="item.value">
{{item.name}}
</label>
</div>
</div>
<div class="func">
<span class="title-new">图标</span>
<span style="font-size: 16px;color: #ce3939;margin:10px 0;">
<span
style="font-size: 12px;display: inline-block;border-radius: 50%;height: 18px;width: 18px;background: #ce3939;color: white;text-align: center;">注</span>
<span style="display: inline">建议分辨率80*80</span>
</span>
<div>
<label for="icon">
<div v-if="!letter.icon" class="cover">
<span class="icon-cover"></span>
</div>
<img v-else class="cover cover-img" :src="letter.icon"/>
</label>
<input id="icon" type="file" style="display: none"
@change="uploadIconFile">
</div>
</div>
<div class="func">
<span class="title-new">APP ID</span>
<div style="position: relative;width: 400px">
<input class="input" type="text" v-model="letter.appId" placeholder="请输入目标小程序的ID">
</div>
<div style="position: relative;width: 440px">
</span>
</span>
</div>
</div>
<div class="func">
<span class="title-new" style="line-height: 20px;">
<span>PATH</span>
<br>
<span style="font-size:14px;color: #999">(选填)</span>
</span>
<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="请输入目标页面的达到路径">
<input class="input" type="text" v-model="letter.url"
:placeholder="typeDesc[letter.openType].placeholder">
</div>
<div style="position: relative;width: 440px"></div>
</div>
<div class="saveDiv">
<span v-on:click="cancel" class="cancel">取消</span>
......@@ -212,102 +315,196 @@
</div>
</div>
<div v-show="dialog" style="position: fixed;height: 100%;width: 100%;background: black;z-index: 10;opacity: 0.5;top:0px;left:0px">
<div v-show="dialog"
style="position: fixed;height: 100%;width: 100%;background: black;z-index: 10;opacity: 0.5;top:0px;left:0px">
</div>
</div>
<script src="${ctxStatic}/vue/vue.js"></script>
<script src="${ctxStatic}/vue/vue.js"></script>
<script>
var customerV = new Vue({
el : '#letter',
data : {
letter : {id:'',nameWeb:'',cmptId:getCId()},
list:[],
dialog:false
el: '#letter',
data: {
letter: {id: '', nameWeb: '', cmptId: getCId(), icon: '', openType: 1, appId: '', path: ''},
list: [],
dialog: false,
// 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
typeDesc: {
1: {
label: '网页',
placeholder: '请输入网页地址',
},
2: {
label: '小程序',
placeholder: '请输入小程序地址',
},
3: {
label: '短链接',
placeholder: '请输入短链接地址',
},
4: {
label: '页面',
placeholder: '请输入页面地址',
},
5: {
label: '文档',
placeholder: '请输入文档地址',
},
6: {
label: '图片',
placeholder: '请输入图片地址',
}
},
typeOptions: [
{
name: 'H5',
value: 1,
},
{
name: '小程序',
value: 2,
},
{
name: '短链接',
value: 3,
},
{
name: '内部页面',
value: 4,
},
{
name: '文档',
value: 5,
},
{
name: '图片',
value: 6,
}
],
},
methods:{
switchDialog : function(){
methods: {
switchDialog: function () {
customerV.$data.letter.nameWeb = "";
customerV.$data.letter.id="";
customerV.$data.letter.appId="";
customerV.$data.letter.url="";
customerV.$data.letter.id = "";
customerV.$data.letter.appId = "";
customerV.$data.letter.url = "";
customerV.$data.letter.path = "";
customerV.$data.letter.openType = 1;
customerV.$data.letter.icon = 1;
customerV.$data.dialog = !customerV.$data.dialog;
},
count:function(){
if(customerV.$data.letter.nameWeb.length > 10){
customerV.$data.letter.nameWeb = customerV.$data.letter.nameWeb.substr(0,10)
count: function () {
if (customerV.$data.letter.nameWeb.length > 10) {
customerV.$data.letter.nameWeb = customerV.$data.letter.nameWeb.substr(0, 10)
}
},
edit:function(id){
edit: function (id) {
customerV.getFunc(id);
},
del:function(id){
layer.confirm("确认要删除吗?",function () {
del: function (id) {
layer.confirm("确认要删除吗?", function () {
$.ajax({
url : '/gk/sure-letter/delFunc/'+id,
beforeSend:function(){
url: '/gk/sure-letter/delFunc/' + id,
beforeSend: function () {
var index = layer.load()
setTimeout(function () {
layer.close(index);
},1500)
}, 1500)
},
success:function (data) {
success: function (data) {
layer.msg('删除成功!');
customerV.queryAll();
}
});
});
},
save : function () {
if(customerV.$data.letter.nameWeb.length == 0){
layer.msg("功能名称不能为空!",{icon:5,duration:1500});
return ;
save: function () {
if (customerV.$data.letter.nameWeb.length == 0) {
layer.msg("功能名称不能为空!", {icon: 5, duration: 1500});
return;
}
if(customerV.$data.letter.appId.length == 0){
layer.msg("AppId不能为空!",{icon:5,duration:1500});
return ;
if (customerV.$data.letter.appId.length == 0) {
layer.msg("AppId不能为空!", {icon: 5, duration: 1500});
return;
}
$.ajax({
url : '/gk/sure-letter/updateName',
data : customerV.$data.letter,
type:'post',
beforeSend:function(){
url: '/gk/sure-letter/updateName',
data: customerV.$data.letter,
type: 'post',
beforeSend: function () {
var index = layer.load()
setTimeout(function () {
layer.close(index);
},1500)
}, 1500)
},
success:function (data) {
success: function (data) {
layer.msg('保存成功!');
customerV.$data.dialog = false;
customerV.queryAll();
}
})
},
cancel:function(){
cancel: function () {
customerV.$data.dialog = false;
},
queryAll:function(){
if(getCId()){
queryAll: function () {
if (getCId()) {
$.ajax({
url : '/gk/sure-letter/queryAllThirdMicros?cmptId='+getCId(),
success:function (data) {
url: '/gk/sure-letter/queryAllThirdMicros?cmptId=' + getCId(),
success: function (data) {
customerV.$data.list = data.content;
}
})
}
},
getFunc : function (id){
getFunc: function (id) {
$.ajax({
url : '/gk/sure-letter/getFunc/'+id,
success:function (data) {
if(data.content){
url: '/gk/sure-letter/getFunc/' + id,
success: function (data) {
if (data.content) {
customerV.$data.letter = data.content;
customerV.$data.dialog = true;
}
}
});
},
//文件上传处理
uploadIconFile(obj) {
logoFile = obj.target.files[0];
if (logoFile.type && logoFile.type.indexOf("image") == -1) {
return layer.msg('请上传图片', { icon: 5 })
}
var reads = new FileReader();
reads.readAsDataURL(logoFile);
reads.onload = function () {
//将处理完的图片文件上传到阿里云服务器
//上传LOGO图片
var formData = new FormData();
formData.append("uploadImg", logoFile);
$.ajax({
url: 'https://event.geexek.com/upload/file.do', /*接口域名地址*/
type: 'post',
data: formData,
contentType: false,
processData: false,
success: function (res) {
if (res.code == "1") {
layer.msg('上传成功', { icon: 1, time: 1500 });
customerV.$data.letter.icon = res.result
} else {
console.log(res);
}
},
beforeSend: () => {
layer.load()
},
complete: () => {
layer.closeAll()
},
})
};
}
}
});
......
......@@ -535,7 +535,7 @@
"id": null,
"userId": getUId(), // 用户id
"cmptId": getCId(), // 赛事id
"type": 4, // 类型配置(1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png 7 定位)
"type": 4, // 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png 7 定位)
"moduleId": null, //
"title": null, // 标题
"address": null, // 地址
......@@ -561,7 +561,7 @@
moduleOptions: {},
modules: [],
// 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
// 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
typeDesc: {
1: {
label: '网页',
......@@ -572,8 +572,8 @@
placeholder: '请输入小程序地址',
},
3: {
label: '短连接',
placeholder: '请输入短连接地址',
label: '短链接',
placeholder: '请输入短链接地址',
},
4: {
label: '页面',
......@@ -602,7 +602,7 @@
value: 2,
},
{
name: '短连接',
name: '短链接',
value: 3,
},
{
......
......@@ -58,22 +58,23 @@ $(document).ready(function () {
$.ajax({
url: "/gk/news/save",
type: 'post',
data: {
contentType: 'application/json',
data: JSON.stringify({
linkUrl,
id: $('.edit-container').attr('data-id'),
title: title,
appId:appId,
content: editor.getContent(),
userId: 1,
userId: getUId(),
cmptId: getCId(),
cover: $('#file-cover').attr('data-src'),
type: $('input[name="type"]:checked').val(),
// 新增的字段
openType: openType,
path: path,
lat: lat,
lng: lng
},
lat: lat??0,
lng: lng??0
}),
success: function (data) {
layer.msg('保存成功')
window.location.reload();
......@@ -273,6 +274,11 @@ function clearInput() {
$($('input[name="type"]')[0]).attr('checked', "checked")
$('.cover').css('background-image', '')
editor.setContent('');
$('#openType').val(0);
$('#path').val("");
$('#lat').val("");
$('#lng').val("");
$('#appId').val("");
}
function delNews(id, callback) {
......
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