|
|
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
|
|
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
|
|
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
|
|
<%
|
|
|
String path = request.getContextPath();
|
|
|
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
|
|
|
|
|
|
%>
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<title>人事系统</title>
|
|
|
<meta name="renderer" content="webkit">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
|
|
|
<link rel="stylesheet" href="<%=basePath%>/css/xadmin.css">
|
|
|
<script src="<%=basePath%>/layui/layui.js" charset="utf-8"></script>
|
|
|
<script type="text/javascript" src="<%=basePath%>/js/xadmin.js"></script>
|
|
|
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
|
|
|
<!--[if lt IE 9]>
|
|
|
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
|
|
|
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
|
|
|
<![endif]-->
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="layui-fluid">
|
|
|
<div class="layui-row">
|
|
|
<form class="layui-form" name="dataForm" id="dataForm">
|
|
|
<input id="id" name="id" value="${notice.id}" hidden/>
|
|
|
<div class="layui-form-item">
|
|
|
<label for="name" class="layui-form-label">
|
|
|
<span class="x-red">*</span>公告名称:
|
|
|
</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="name" name="name" value="${notice.name}" required="" lay-verify="required|name" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
<label for="title" class="layui-form-label">
|
|
|
<span class="x-red">*</span>公告标题:
|
|
|
</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="text" id="title" name="title" value="${notice.title}" required="" lay-verify="required|title" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<div class="layui-form-item layui-form-text">
|
|
|
<label for="remark" class="layui-form-label">备注</label>
|
|
|
<div class="layui-input-block" style="width: 50%;">
|
|
|
<textarea placeholder="请用50个字内描述一下这篇公告" id="remark" name="remark" class="layui-textarea">${notice.remark}</textarea>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<span class="x-red">*</span><label for="remarkEditor" class="layui-form-label">公告内容</label>
|
|
|
<div class="layui-input-block" style="width: 50%; background-color: white">
|
|
|
<textarea id="remarkEditor" name="content" lay-verify="content" style="width: 50%;background-color: white" class="layui-textarea">${notice.content}</textarea>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="margin-left: 30%;margin-bottom: 10px">
|
|
|
<input type="button" lay-filter="submit" class="layui-btn" id ="submit" lay-submit="" value="确定"/>
|
|
|
<input type="button" class="layui-btn" id ="gb" value="关闭"/>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<script>layui.use(['form', 'layer','layedit'],
|
|
|
function() {
|
|
|
$ = layui.jquery;
|
|
|
var layedit = layui.layedit;
|
|
|
var form = layui.form,
|
|
|
layer = layui.layer;
|
|
|
var editIndex = layedit.build('remarkEditor', {
|
|
|
height: 250,
|
|
|
tool: ['face', '|', 'link', 'strong' ],
|
|
|
});
|
|
|
//自定义验证规则
|
|
|
form.verify({
|
|
|
name: function(value){
|
|
|
if(value.length <= 0){
|
|
|
return '公告名称不能为空';
|
|
|
return false;
|
|
|
|
|
|
}else if(value.length >=50){
|
|
|
return '公告名称不能超过50个字符';
|
|
|
return false;
|
|
|
}
|
|
|
},title: function(value) {
|
|
|
if (value.length <= 0) {
|
|
|
return '公告标题不能为空';
|
|
|
return false;
|
|
|
}else if(value.length >=250){
|
|
|
return '公告标题不能超过250个字符';
|
|
|
return false;
|
|
|
}
|
|
|
},content: function(value) {
|
|
|
value = $.trim(layedit.getContent(editIndex));
|
|
|
if (value == "") return "请输入内容";
|
|
|
layedit.sync(editIndex);
|
|
|
if (value.length >= 1999999) {
|
|
|
return '公告内容不能超过1999999个字符';
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//监听提交
|
|
|
form.on("submit(submit)", function (data) {
|
|
|
/*var data = $("#dataForm").serialize();*/
|
|
|
var data2 = data.field;
|
|
|
data2.content =layedit.getContent(editIndex);//获取富文本框内容
|
|
|
$.ajax({
|
|
|
"url":"<%=request.getContextPath()%>/notice/edit.do",
|
|
|
"data":data2,
|
|
|
"type":"post",
|
|
|
"dataType":"json",
|
|
|
"success":function(res){
|
|
|
//后台操作成功
|
|
|
if(res.code ==0){
|
|
|
layer.alert("修改成功!", {
|
|
|
icon: 6
|
|
|
},
|
|
|
function() {
|
|
|
//关闭当前frame
|
|
|
xadmin.close();
|
|
|
// 可以对父窗口进行刷新
|
|
|
xadmin.father_reload();
|
|
|
});
|
|
|
}else{
|
|
|
layer.alert(res.msg+",请联系系统管理人员!", {icon: 5});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
//监听关闭
|
|
|
$("#gb").on('click',function(){
|
|
|
window.close();
|
|
|
xadmin.close();
|
|
|
})
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
<script>
|
|
|
|
|
|
</script>
|
|
|
</body>
|
|
|
|
|
|
</html>
|