ZhiYeJianKang/职业健康平台后端/target/dzzyb/webpage/modules/sys/workDynamicForm.jsp
2025-02-20 15:25:59 +08:00

155 lines
6.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@ 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">
var type=$("#type").val();
$('#filePathFileNm').attr("fncId",type);
var flag=${flag};//0为查看,1为编辑
var validateForm;
function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
if(validateForm.form()){
$("#contentStr").val($("#rich_contents").next().find(".note-editable").html());//取富文本的值
$("#inputForm").submit();
return true;
}
return false;
}
$(document).ready(function() {
var type=$("#type").val();
$('#dddType').val(type);
$('#entityId').val($("#id").val());
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: '#publishTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
event: 'focus' //响应事件。如果没有传入event,则按照默认的click
});
$("#filePathFilePath").attr("value","${filePathPath}");
$("#filePathFileName").attr("value","${filePathNm}");
$("#filePathFileNm").attr("value","${filePathPath}"+"${filePathNm}");
//富文本初始化
$('#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="workDynamic" action="${ctx}/sys/workdynamic/workDynamic/save" method="post" class="form-horizontal">
<form:hidden path="id" id="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-right"><font color="red">*</font>标题:</label></td>
<td class="width-35">
<form:input path="title" htmlEscape="false" maxlength="255" class="form-control required"/>
</td>
<td class="width-15 active"><label class="pull-right"><font color="red">*</font>发布人:</label></td>
<td class="width-35">
<form:input path="publisher" htmlEscape="false" readonly="true" maxlength="64" class="form-control required"/>
</td>
</tr>
<tr>
<td class="width-15 active"><label class="pull-right"><font color="red">*</font>发布时间:</label></td>
<td class="width-35">
<input id="publishTime" name="publishTime" type="text" maxlength="20" class="laydate-icon form-control layer-date required"
value="<fmt:formatDate value="${workDynamic.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
</td>
<td class="width-15 active"><label class="pull-right"><font color="red">*</font>类型:</label></td>
<td class="width-35">
<form:select id="type" path="publishType" class="form-control required" onchange="getType();">
<form:option value="" label="请选择发布类型"/>
<form:options items="${fns:getDictList('PUBLISH_TYPE')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
</form:select>
</td>
</tr>
<tr>
<td class="width-15 active"><label class="pull-right">内容:</label></td>
<td colspan="3" class="width-35">
<form:hidden path="contentStr"/>
<div id="rich_contents">
</div>
</td>
</tr>
<tr>
<td class="width-15 active"><label class="pull-right">备注信息:</label></td>
<td colspan="3" class="width-35">
<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="510" class="form-control "/>
</td>
</tr>
<tr>
<td class="width-15 active"><label class="pull-right">附件:</label></td>
<td class="width-35" colspan="3" id="fujian">
<form:hidden id="filePath" path="filePath" htmlEscape="false" maxlength="2000" class="form-control"/>
<c:if test="${flag eq '0'}">
<sys:webuploader_local prefixid = "filePath" inputwidth = "65%" inputDisabled = "none" btnUpDisplay ="none" btnDelDisplay="none" ftpfilepath="constctrl/child/"/>
</c:if>
<c:if test="${flag ne '0'}">
<sys:webuploader_local prefixid = "filePath" inputwidth = "65%" inputDisabled = "" btnUpDisplay ="block" ftpfilepath="constctrl/child/"/>
</c:if>
<p>说明:发布新闻时只能上传图片格式的附件(jpg,jpeg,png,bmp)</p>
</td>
</tr>
</tbody>
</table>
</form:form>
<script type="text/javascript">
function getType(){
var type=$("#type").val();
$('#dddType').val(type);
}/*/src/main/webapp/static/news*/
var type=$("#type").val();
</script>
<%--<img src="${ctxStatic}/news/file/pc首页.jpg"/>--%>
</body>
</html>