提交 b5300e74 作者: dingtalk_nnkplh

新闻增加背景颜色字段

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