提交 b5300e74 作者: dingtalk_nnkplh

新闻增加背景颜色字段

上级 4515baeb
...@@ -78,9 +78,9 @@ spring: ...@@ -78,9 +78,9 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://39.105.118.63:3306/overseas_study?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://localhost:3307/overseas_study?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: ewglobal_cn username: overseas_study
password: F5pjz48sjbisaEwy password: EarthWisdom@329301
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
......
...@@ -79,8 +79,8 @@ spring: ...@@ -79,8 +79,8 @@ spring:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://39.105.118.63:3306/overseas_study?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://39.105.118.63:3306/overseas_study?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: ewglobal_cn username: overseas_study
password: F5pjz48sjbisaEwy password: EarthWisdom@329301
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
......
spring: spring:
profiles: profiles:
active: dev active: pro
\ No newline at end of file \ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<head> <head>
<th:block th:include="include :: header('新增新闻与活动')" /> <th:block th:include="include :: header('新增新闻与活动')" />
<th:block th:include="include :: bootstrap-fileinput-css" /> <th:block th:include="include :: bootstrap-fileinput-css" />
<script type="text/javascript" src="/js/jscolor.js"></script>
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
...@@ -47,6 +48,12 @@ ...@@ -47,6 +48,12 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">封面背景颜色:</label>
<div class="col-sm-8">
<input type="text" value="#FFFFFF" data-jscolor="{}" name="backgroundColor" id="backgroundColor">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">新闻内容:</label> <label class="col-sm-2 control-label is-required">新闻内容:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<script id="editor" name="newsContent" type="text/plain" style="height: 300px;"></script> <script id="editor" name="newsContent" type="text/plain" style="height: 300px;"></script>
...@@ -93,6 +100,7 @@ ...@@ -93,6 +100,7 @@
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
alert($("#backgroundColor").val());
var text = getContentTxt(); var text = getContentTxt();
if (text == '' || text.length == 0) { if (text == '' || text.length == 0) {
$.modal.alertWarning("请输入新闻内容!"); $.modal.alertWarning("请输入新闻内容!");
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<head> <head>
<th:block th:include="include :: header('修改新闻与活动')" /> <th:block th:include="include :: header('修改新闻与活动')" />
<th:block th:include="include :: bootstrap-fileinput-css" /> <th:block th:include="include :: bootstrap-fileinput-css" />
<script type="text/javascript" src="/js/jscolor.js"></script>
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
...@@ -20,6 +21,12 @@ ...@@ -20,6 +21,12 @@
<input name="newsSummary" th:field="*{newsSummary}" class="form-control" type="text" required> <input name="newsSummary" th:field="*{newsSummary}" class="form-control" type="text" required>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-2 control-label">封面背景颜色:</label>
<div class="col-sm-8">
<input type="text" data-jscolor="{}" th:field="*{backgroundColor}" id="backgroundColor">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label is-required">新闻内容:</label> <label class="col-sm-2 control-label is-required">新闻内容:</label>
<div class="col-sm-10"> <div class="col-sm-10">
......
...@@ -26,6 +26,8 @@ public class TbNews extends BaseEntity ...@@ -26,6 +26,8 @@ public class TbNews extends BaseEntity
@Excel(name = "新闻摘要") @Excel(name = "新闻摘要")
private String newsSummary; private String newsSummary;
private String backgroundColor;
/** 新闻内容 */ /** 新闻内容 */
@Excel(name = "新闻内容") @Excel(name = "新闻内容")
private String newsContent; private String newsContent;
...@@ -92,6 +94,14 @@ public class TbNews extends BaseEntity ...@@ -92,6 +94,14 @@ public class TbNews extends BaseEntity
this.newsSummary = newsSummary; this.newsSummary = newsSummary;
} }
public String getBackgroundColor() {
return backgroundColor;
}
public void setBackgroundColor(String backgroundColor) {
this.backgroundColor = backgroundColor;
}
public String getNewsContent() { public String getNewsContent() {
return newsContent; return newsContent;
} }
......
...@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -8,6 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="id" column="id" /> <result property="id" column="id" />
<result property="newsTitle" column="news_title" /> <result property="newsTitle" column="news_title" />
<result property="newsSummary" column="news_summary" /> <result property="newsSummary" column="news_summary" />
<result property="backgroundColor" column="background_color" />
<result property="newsContent" column="news_content" /> <result property="newsContent" column="news_content" />
<result property="newsCover" column="news_cover" /> <result property="newsCover" column="news_cover" />
<result property="status" column="status" /> <result property="status" column="status" />
...@@ -19,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -19,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTbNewsVo"> <sql id="selectTbNewsVo">
select id, news_title, news_summary, news_content, news_cover, status, creator, create_time, select id, news_title, news_summary, background_color,news_content, news_cover, status, creator, create_time,
modified_by, update_time, remark from tb_news modified_by, update_time, remark from tb_news
</sql> </sql>
...@@ -41,17 +42,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -41,17 +42,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
news_title,news_summary,news_content,news_cover,status, news_title,news_summary,news_content,news_cover,status,
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
creator,create_time creator,create_time,background_color
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="newsTitle != null and newsTitle != ''">#{newsTitle},</if> <if test="newsTitle != null and newsTitle != ''">#{newsTitle},</if>
<if test="newsSummary != null and newsSummary != '' ">#{newsSummary},</if> <if test="newsSummary != null and newsSummary != '' ">#{newsSummary},</if>
<if test="newsContent != null and newsContent != ''">#{newsContent},</if> <if test="newsContent != null and newsContent != ''">#{newsContent},</if>
<if test="newsCover != null and newsCover != ''">#{newsCover},</if> <if test="newsCover != null and newsCover != ''">#{newsCover},</if>
<if test="status != null">#{status},</if> #{status},
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="creator != null">#{creator},</if> #{creator},#{createTime},#{backgroundColor}
<if test="createTime != null">#{createTime},</if>
</trim> </trim>
</insert> </insert>
...@@ -66,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -66,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="modifiedBy != null">modified_by = #{modifiedBy},</if> <if test="modifiedBy != null">modified_by = #{modifiedBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="backgroundColor != null">background_color=#{backgroundColor},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
...@@ -81,4 +82,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -81,4 +82,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论