Browse Source

监督端-通知修改

v6
zouyx 2 years ago
parent
commit
0e386f3614
  1. 140
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/notice/domain/Notice.java
  2. 47
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/NoticeMapper.xml
  3. 22
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/add.html
  4. 158
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/detail.html
  5. 22
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/edit.html
  6. 221
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/notice.html

140
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/notice/domain/Notice.java

@ -6,6 +6,9 @@ import com.zdxt.common.BaseDomain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* 通知公告表 sys_notice
*
@ -15,20 +18,39 @@ public class Notice extends BaseDomain
{
private static final long serialVersionUID = 1L;
/** 公告ID */
/** 通知ID */
private String noticeId;
/** 公告标题 */
/** 通知标题 */
private String noticeTitle;
/** 公告类型(1通知 2公告) */
private String noticeType;
/** 发布对象(0全部 1监督端 2执法端 3 企业端) */
private String objectType;
/** 公告内容 */
/** 通知内容 */
private String noticeContent;
/** 公告状态(0正常 1关闭) */
private String status;
/** 创建者id */
private String createBy;
/** 创建时间 */
private Date createTime;
/** 更新时间 */
private Date updateTime;
/** 更新者 */
private String updateBy;
/** 发布部门多个 */
private String bureauDeptIds;
/** 发布部门名称多个 */
private String bureauDeptNames;
/** 备注 */
private String remark;
/** 发布部门名称列表 */
private List<String> bureauDeptNameList;
private String beginTime;
private String endTime;
public String getNoticeId()
{
@ -52,14 +74,12 @@ public class Notice extends BaseDomain
return noticeTitle;
}
public void setNoticeType(String noticeType)
{
this.noticeType = noticeType;
public String getObjectType() {
return objectType;
}
public String getNoticeType()
{
return noticeType;
public void setObjectType(String objectType) {
this.objectType = objectType;
}
public void setNoticeContent(String noticeContent)
@ -82,19 +102,115 @@ public class Notice extends BaseDomain
return status;
}
@Override
public String getCreateBy() {
return createBy;
}
@Override
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
@Override
public Date getCreateTime() {
return createTime;
}
@Override
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public Date getUpdateTime() {
return updateTime;
}
@Override
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
@Override
public String getUpdateBy() {
return updateBy;
}
@Override
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public String getBureauDeptIds() {
return bureauDeptIds;
}
public void setBureauDeptIds(String bureauDeptIds) {
this.bureauDeptIds = bureauDeptIds;
}
public String getBureauDeptNames() {
return bureauDeptNames;
}
public void setBureauDeptNames(String bureauDeptNames) {
this.bureauDeptNames = bureauDeptNames;
}
@Override
public String getRemark() {
return remark;
}
@Override
public void setRemark(String remark) {
this.remark = remark;
}
public List<String> getBureauDeptNameList() {
return bureauDeptNameList;
}
public void setBureauDeptNameList(List<String> bureauDeptNameList) {
this.bureauDeptNameList = bureauDeptNameList;
}
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("noticeId", getNoticeId())
.append("noticeTitle", getNoticeTitle())
.append("noticeType", getNoticeType())
.append("objectType", getObjectType())
.append("noticeContent", getNoticeContent())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("bureauDeptIds",getBureauDeptIds())
.append("bureauDeptNames",getBureauDeptNames())
.append("remark", getRemark())
.append("bureauDeptNameList",getBureauDeptNameList())
.append("beginTime",getBeginTime())
.append("endTime",getEndTime())
.toString();
}
}

47
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/NoticeMapper.xml

@ -7,18 +7,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="Notice" id="NoticeResult">
<result property="noticeId" column="notice_id" />
<result property="noticeTitle" column="notice_title" />
<result property="noticeType" column="notice_type" />
<result property="objectType" column="object_type" />
<result property="noticeContent" column="notice_content" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="bureauDeptIds" column="bureau_dept_ids" />
<result property="bureauDeptNames" column="bureau_dept_names" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectNoticeVo">
select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark
select notice_id, notice_title, object_type, notice_content, status, create_by, create_time, update_by, update_time,bureau_dept_ids,bureau_dept_names,remark
from sys_notice
</sql>
@ -33,46 +35,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="noticeTitle != null and noticeTitle != ''">
AND notice_title like concat('%', #{noticeTitle}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
AND notice_type = #{noticeType}
<if test="objectType != null and objectType != ''">
AND object_type = #{objectType}
</if>
<if test="createBy != null and createBy != ''">
AND create_by like concat('%', #{createBy}, '%')
<if test="bureauDeptNames != null and bureauDeptNames != ''">
AND bureau_dept_names like concat('%', #{bureauDeptNames}, '%')
</if>
<if test="beginTime != null and beginTime != ''">
AND DATE_FORMAT(create_time,'%Y-%m-%d')>=#{beginTime}
</if>
<if test="endTime != null and endTime != ''">
AND #{endTime}>=DATE_FORMAT(create_time,'%Y-%m-%d')
</if>
</where>
</select>
<insert id="insertNotice" parameterType="Notice">
insert into sys_notice (
insert into sys_notice
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="noticeId != null and noticeId != '' ">notice_id, </if>
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
<if test="objectType != null and objectType != '' ">object_type, </if>
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
<if test="status != null and status != '' ">status, </if>
<if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time
)values(
create_time,
<if test="bureauDeptIds != null and bureauDeptIds != ''">bureau_dept_ids,</if>
<if test="bureauDeptNames != null and bureauDeptNames != ''">bureau_dept_names,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="noticeId != null and noticeId != '' ">#{noticeId}, </if>
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
<if test="objectType != null and objectType != ''">#{objectType}, </if>
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
<if test="status != null and status != ''">#{status}, </if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate()
)
sysdate(),
<if test="bureauDeptIds != null and bureauDeptIds != ''">#{bureauDeptIds},</if>
<if test="bureauDeptNames != null and bureauDeptNames != ''">#{bureauDeptNames},</if>
</trim>
</insert>
<update id="updateNotice" parameterType="Notice">
update sys_notice
<set>
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
<if test="objectType != null and objectType != ''">object_type = #{objectType}, </if>
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
<if test="status != null and status != ''">status = #{status}, </if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
<if test="remark != null and remark != ''">remark = #{remark},</if>
update_time = sysdate(),
<if test="bureauDeptIds != null and bureauDeptIds != ''">bureau_dept_ids = #{bureauDeptIds},</if>
<if test="bureauDeptNames != null and bureauDeptNames != ''">bureau_dept_names = #{bureauDeptNames},</if>
</set>
where notice_id = #{noticeId}
</update>

22
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/add.html

@ -9,21 +9,29 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-notice-add">
<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">
<input id="noticeTitle" name="noticeTitle" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告类型:</label>
<label class="col-sm-2 control-label is-required">发布部门:</label>
<div class="col-sm-10">
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
<input id="bureauDeptNames" name="bureauDeptNames" class="form-control" type="text">
</div>
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">注:多部门请用,分隔</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告内容:</label>
<label class="col-sm-2 control-label">发布对象:</label>
<div class="col-sm-10">
<select name="objectType" class="form-control m-b" th:with="type=${@dict.getType('object')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">通知内容:</label>
<div class="col-sm-10">
<input id="noticeContent" name="noticeContent" type="hidden">
<div class="summernote"></div>
@ -36,7 +44,7 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告状态:</label>
<label class="col-sm-2 control-label">发布状态:</label>
<div class="col-sm-10">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">

158
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/detail.html

@ -2,36 +2,73 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改通知公告')" />
<th:block th:include="include :: summernote-css" />
<th:block th:include="include :: summernote-css" />
<th:block th:include="include :: bootstrap-fileinput-css"/>
<style>
.kv-file-remove.btn.btn-sm.btn-kv.btn-default.btn-outline-secondary {
display: none !important;
}
.kv-file-zoom.btn.btn-sm.btn-kv.btn-default.btn-outline-secondary {
display: none !important;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-notice-edit" th:object="${notice}">
<input id="noticeId" name="noticeId" th:field="*{noticeId}" type="hidden">
<div class="form-group">
<label class="col-sm-2 control-label is-required">公告标题:</label>
<div class="col-sm-10">
<input id="noticeTitle" name="noticeTitle" th:field="*{noticeTitle}" class="form-control" type="text" readonly>
</div>
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-notice-edit" th:object="${notice}">
<input id="noticeId" name="noticeId" th:field="*{noticeId}" type="hidden">
<div class="form-group">
<label class="col-sm-2 control-label is-required">通知标题:</label>
<div class="col-sm-10">
<input id="noticeTitle" name="noticeTitle" th:field="*{noticeTitle}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">发布时间:</label>
<div class="col-sm-10">
<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">发布部门:</label>
<div class="col-sm-10">
<input id="bureauDeptNames" name="bureauDeptNames" th:field="*{bureauDeptNames}" class="form-control" type="text" disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">发布对象:</label>
<div class="col-sm-10">
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('object')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{objectType}"></option>
</select>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告类型:</label>
<div class="col-sm-10">
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{noticeType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告内容:</label>
<div class="col-sm-10">
<input id="noticeContent" name="noticeContent" th:field="*{noticeContent}" type="hidden">
<div id="editor" class="summernote"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">通知内容:</label>
<div class="col-sm-10">
<input id="noticeContent" name="noticeContent" th:field="*{noticeContent}" type="hidden" disabled>
<div id="editor" class="summernote"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">附件:</label>
<div class="col-sm-10">
<input id="fileinput" type="file" name="files" class="file-loading" multiple readonly/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">发布状态:</label>
<div class="col-sm-10">
<div class="radio-box" th:each="dict : ${@dict.getType('notice_status_type')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}" disabled>
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</form>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js" />
<th:block th:include="include :: summernote-js" />
<script type="text/javascript">
var prefix = ctx + "system/notice";
@ -52,7 +89,80 @@
$('#editor').summernote('code', content);
$('#editor').summernote('disable');
});
$(function (){
initFile();
document.getElementsByClassName("kv-file-remove btn btn-sm btn-kv btn-default btn-outline-secondary")
})
function initFile() {
$.ajax({
type: "POST",
url: prefix + "/queryFiles",
data: {"noticeId": $('#noticeId').val()},
dataType: 'json',
success: function (result) {
if (result.success == true) {
var filePreview = result.data.filePreview;
var preview = filePreview.previewRespDTOS;
if (preview != null) {
for (var i = 0; i < preview.length; i++) {
// 图片删除的地址
preview[i].url = prefix + "/removeFile"
}
}
$("#fileinput").fileinput({
'theme': 'explorer',
initialPreviewAsData: true,
dropZoneEnabled: true,
dropZoneTitle: "上传附件",
uploadUrl: prefix + "/editNoticeFile",
uploadAsync: false,//异步上传
enctype: 'multipart/form-data',
showClose: false,
showPreview: true,
showUpload: false,
// showBrowse: false,
previewFileIcon: '<i class="fas fa-file"></i>',
preferIconicPreview: true,
uploadExtraData: function () {
var sHTML = $('.summernote').summernote('code');
$("#noticeContent").val(sHTML);
var formData = $("#form-notice-edit").serialize();
formData = decodeURIComponent(formData, true);
var arr = formData.split("&");
var data = {};
for (var i=0; i<arr.length; i++) {
var item = arr[i].split('=');
var value = item[1].replace("+", " ");
data[item[0]] = value;
}
return data;
},
layoutTemplates: {
// actionDelete: ''//去掉删除按钮
// actionUpload: '' // 去掉上传按钮
},
initialPreview: filePreview.fileList == null ? [] : filePreview.fileList,
initialPreviewConfig: preview == null ? [] : preview
});
// 此事件仅在ajax上传且文件批量上传成功之后触发
$("#fileinput").on("filebatchuploadsuccess", function (event, data, previewId, index) {
if (data.response.code === 0) {
$.modal.close();
var parent = window.parent;
parent.$.modal.msgSuccess(data.response.message);
parent.$.table.refresh();
} else {
// 清理文件输入控件
$('#fileinput').fileinput('clear');
$.modal.msgError(data.message);
}
});
}
}
})
}
</script>
</body>
</html>

22
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/edit.html

@ -10,21 +10,29 @@
<form class="form-horizontal m" id="form-notice-edit" th:object="${notice}">
<input id="noticeId" name="noticeId" th:field="*{noticeId}" type="hidden">
<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">
<input id="noticeTitle" name="noticeTitle" th:field="*{noticeTitle}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告类型:</label>
<label class="col-sm-2 control-label is-required">发布部门:</label>
<div class="col-sm-10">
<input id="bureauDeptNames" name="bureauDeptNames" th:field="*{bureauDeptNames}" class="form-control" type="text">
</div>
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">注:多部门请用,分隔</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">发布对象:</label>
<div class="col-sm-10">
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('sys_notice_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{noticeType}"></option>
<select name="noticeType" class="form-control m-b" th:with="type=${@dict.getType('object')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{objectType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告内容:</label>
<label class="col-sm-2 control-label">通知内容:</label>
<div class="col-sm-10">
<input id="noticeContent" name="noticeContent" th:field="*{noticeContent}" type="hidden">
<div id="editor" class="summernote"></div>
@ -37,9 +45,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">公告状态:</label>
<label class="col-sm-2 control-label">发布状态:</label>
<div class="col-sm-10">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_notice_status')}">
<div class="radio-box" th:each="dict : ${@dict.getType('notice_status_type')}">
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>

221
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/system/notice/notice.html

@ -1,117 +1,126 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('通知公告列表')" />
<th:block th:include="include :: header('通知公告列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="notice-form">
<div class="select-list">
<ul>
<li>
公告标题:<input type="text" name="noticeTitle"/>
</li>
<li>
操作人员:<input type="text" name="createBy"/>
</li>
<li>
公告类型:<select name="noticeType" th:with="type=${@dict.getType('sys_notice_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-reset btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="notice-form">
<div class="select-list">
<ul>
<li>
通知标题:<input type="text" name="noticeTitle"/>
</li>
<li id="day" class="day" style="display: flex;">
<p>发布时间:</p>
<input type="text" class="time-input" id="beginTime" placeholder="开始时间" name="beginTime"
style="width: 100px"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"
style="width: 100px"/>
</li>
<li>
发布部门:<input type="text" name="bureauDeptNames"/>
</li>
<li>
发布对象:<select name="objectType" th:with="type=${@dict.getType('object')}" style="width: 100px">
<option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-success btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-reset btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="system:notice:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.editFull()" shiro:hasPermission="system:notice:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:notice:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="system:notice:add">
<i class="fa fa-plus"></i> 新增
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.editFull()"
shiro:hasPermission="system:notice:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="system:notice:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table>
</div>
</div>
<div class="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:notice:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:notice:remove')}]];
var types = [[${@dict.getType('sys_notice_type')}]];
var datas = [[${@dict.getType('sys_notice_status')}]];
var prefix = ctx + "system/notice";
</div>
<th:block th:include="zdxtInclude :: footer"/>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:notice:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:notice:remove')}]];
var types = [[${@dict.getType('object')}]];
var datas = [[${@dict.getType('notice_status_type')}]];
var prefix = ctx + "system/notice";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "公告",
columns: [{
checkbox: true
},
{
field : 'noticeId',
title : '序号'
},
{
field : 'noticeTitle',
title : '公告标题'
},
{
field: 'noticeType',
title: '公告类型',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(types, value);
}
},
{
field: 'status',
title: '状态',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(datas, value);
}
},
{
field : 'createBy',
title : '创建者'
},
{
field: 'createTime',
title: '创建时间',
sortable: true
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editFull(\'' + row.noticeId + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.noticeId + '\')"><i class="fa fa-remove"></i> 删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
$(function () {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "通知",
uniqueId:"noticeId",
columns: [{
checkbox: true
},
{
field: 'noticeTitle',
title: '通知标题'
},
{
field: 'createTime',
title: '发布时间',
// sortable: true
},
{
field: 'bureauDeptNames',
title: '发布部门',
},
{
field: 'objectType',
title: '发布对象',
align: 'center',
formatter: function (value, row, index) {
return $.table.selectDictLabel(types, value);
}
},
{
field: 'status',
title: '发布状态',
align: 'center',
formatter: function (value, row, index) {
return $.table.selectDictLabel(datas, value);
}
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
return '<span style="cursor: pointer;color: blue;" ONCLICK="openNoticeDetails(\'' + row.noticeId + '\')">' + '详情' + '</span>';
}
}]
};
$.table.init(options);
});
function openNoticeDetails(noticeId){
console.log(noticeId);
$.modal.openClose("通知公告详情", prefix + "/detail/" + noticeId);
}
</script>
</body>
</html>
Loading…
Cancel
Save