136 lines
5.9 KiB
Plaintext
136 lines
5.9 KiB
Plaintext
<%@ page contentType="text/html;charset=UTF-8" %>
|
||
<%@ include file="/webpage/include/taglib.jsp"%>
|
||
<html>
|
||
<head>
|
||
<title>通知公告管理</title>
|
||
<meta name="decorator" content="default"/>
|
||
<link href="${ctxStatic}/summernote/summernote.css" rel="stylesheet">
|
||
<link href="${ctxStatic}/summernote/summernote-bs3.css" rel="stylesheet">
|
||
<script src="${ctxStatic}/summernote/summernote.min.js"></script>
|
||
<script src="${ctxStatic}/summernote/summernote-zh-CN.js"></script>
|
||
<script type="text/javascript">
|
||
/**
|
||
* 修复rich_contents内容区长度超长后返回页面无 [确定]、[关闭] 按钮
|
||
* doSubmit函数中加入rich_contentsLength长度校验,长度大于2000,alert并返回false
|
||
* by:丁旭东 2017-08-18
|
||
*/
|
||
var validateForm;
|
||
function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
|
||
if(validateForm.form()){
|
||
var rich_contentsLength = $("#rich_contents").next().find(".note-editable").html().length;
|
||
if ( rich_contentsLength >1677215){
|
||
$("#errorContents").html("<font color='red'><b>内容长度必须介于 0 和 2^24 之间</b></font>");
|
||
// layer.alert("内容长度必须介于 0 和 2000 之间");
|
||
return false;
|
||
}
|
||
$("#contentStr").val($("#rich_contents").next().find(".note-editable").html());//取富文本的值
|
||
$("#inputForm").submit();
|
||
return true;
|
||
}
|
||
|
||
return false;
|
||
}
|
||
$(document).ready(function() {
|
||
$("#filesFilePath").attr("value","${filesPath}");
|
||
$("#filesFileName").attr("value","${filesNm}");
|
||
$("#filesFileNm").attr("value","${filesPath}"+"${filesNm}");
|
||
validateForm = $("#inputForm").validate({
|
||
submitHandler: function(form){
|
||
loading('正在提交,请稍等...');
|
||
form.submit();
|
||
},
|
||
errorContainer: "#messageBox",
|
||
errorPlacement: function(error, element) {
|
||
$("#messageBox").text("输入有误,请先更正。");
|
||
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
||
error.appendTo(element.parent().parent());
|
||
} else {
|
||
error.insertAfter(element);
|
||
}
|
||
}
|
||
});
|
||
|
||
laydate({
|
||
elem: '#issueDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
|
||
event: 'focus' //响应事件。如果没有传入event,则按照默认的click
|
||
});
|
||
|
||
//富文本初始化
|
||
$('#rich_contents').summernote({
|
||
lang: 'zh-CN',
|
||
toolbar: [
|
||
['style', ['style']],
|
||
['font', ['bold', 'underline', 'clear']],
|
||
['fontname', ['fontname']],
|
||
['color', ['color']],
|
||
['para', ['ul', 'ol', 'paragraph']],
|
||
['table', ['table']],
|
||
['insert', ['link']],
|
||
['view', ['fullscreen', 'codeview', 'help']]
|
||
],
|
||
height:300,
|
||
maxHeight:300,
|
||
minHeight:300
|
||
});
|
||
|
||
$("#rich_contents").next().find(".note-editable").html( $("#contentStr").val());
|
||
|
||
$("#rich_contents").next().find(".note-editable").html( $("#rich_contents").next().find(".note-editable").text());
|
||
});
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<form:form id="inputForm" modelAttribute="notice" action="${ctx}/sys/notice/save?useUnicode=true&characterEncoding=utf-8" method="post" class="form-horizontal"><%--${ctx}/sys/notice/save--%>
|
||
<form:hidden path="id"/>
|
||
<sys:message content="${message}"/>
|
||
<table class="table table-bordered table-condensed dataTables-example dataTable no-footer">
|
||
<tbody>
|
||
<tr>
|
||
<td class="width-15 active"><label class="pull-left"><font color="red">*</font>标题:</label></td>
|
||
<td class="width-35">
|
||
<form:input path="title" htmlEscape="false" maxlength="100" class="form-control required"/>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="width-15 active"><label class="pull-left"><font color="red">*</font>发布人:</label></td>
|
||
<td class="width-35">
|
||
<form:input path="issuer" htmlEscape="false" maxlength="64" class="form-control required"/>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="width-15 active"><label class="pull-left"><font color="red">*</font>发布时间:</label></td>
|
||
<td class="width-35">
|
||
<input id="issueDate" name="issueDate" type="text" maxlength="20" class="laydate-icon form-control layer-date required"
|
||
value="<fmt:formatDate value="${notice.issueDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="width-15 active"><label class="pull-left">内容:</label></td>
|
||
<td class="width-35">
|
||
<%-- <form:textarea path="content" htmlEscape="false" rows="4" maxlength="2000" class="form-control "/>--%>
|
||
<form:hidden path="contentStr"/>
|
||
<span class="checkSpan" id="errorContents"></span>
|
||
<div id="rich_contents">
|
||
|
||
</div>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
|
||
<td class="width-15 active"><label class="pull-left">附件:</label></td>
|
||
<td class="width-35">
|
||
<form:hidden id="files" path="files" htmlEscape="false" maxlength="2000" class="form-control"/>
|
||
<c:if test="${viewType eq 'none'}">
|
||
<sys:webuploader prefixid = "files" inputwidth = "60%" inputDisabled = "" btnUpDisplay = "none" btnDelDisplay = "none" ftpfilepath="notice/"/>
|
||
</c:if>
|
||
<c:if test="${viewType eq 'block'}">
|
||
<sys:webuploader prefixid = "files" inputwidth = "60%" inputDisabled = "" btnUpDisplay = "block" btnDelDisplay = "block" ftpfilepath="notice/"/>
|
||
</c:if>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</form:form>
|
||
</body>
|
||
</html> |