appConsultationForm.jsp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/webpage/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>党建资讯管理</title>
  6. <meta name="decorator" content="ani"/>
  7. <!-- SUMMERNOTE -->
  8. <%@include file="/webpage/include/summernote.jsp" %>
  9. <script type="text/javascript">
  10. $(document).ready(function() {
  11. <c:if test="${mode=='view'}">
  12. $(".table.table-bordered").find("input,textarea,select").attr("disabled", "disabled");
  13. $(".table.table-bordered").find("input[type=checkbox]").attr("disabled","disabled");
  14. $('#content').summernote({
  15. height: 300
  16. })
  17. $('#content').summernote('disable');
  18. </c:if>
  19. //富文本初始化
  20. $('#content').summernote({
  21. height: 300,
  22. lang: 'zh-CN',
  23. callbacks: {
  24. onChange: function(contents, $editable) {
  25. $("input[name='content']").val($('#content').summernote('code'));//取富文本的值
  26. }
  27. }
  28. });
  29. });
  30. function save() {
  31. var isValidate = jp.validateForm('#inputForm');//校验表单
  32. if(!isValidate){
  33. return false;
  34. }else{
  35. jp.loading();
  36. jp.post("${ctx}/app/news/appConsultation/save",$('#inputForm').serialize(),function(data){
  37. if(data.success){
  38. jp.getParent().refresh();
  39. var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
  40. parent.layer.close(dialogIndex);
  41. jp.success(data.msg)
  42. }else{
  43. jp.error(data.msg);
  44. }
  45. })
  46. }
  47. }
  48. </script>
  49. </head>
  50. <body class="bg-white">
  51. <form:form id="inputForm" modelAttribute="appConsultation" class="form-horizontal">
  52. <form:hidden path="id"/>
  53. <table class="table table-bordered">
  54. <tbody>
  55. <tr>
  56. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>资讯类别:</label></td>
  57. <td class="width-35">
  58. <form:select path="typeId" class="form-control required">
  59. <form:option value="" label=""/>
  60. <form:options items="${typeList}" itemLabel="title" itemValue="id" htmlEscape="false"/>
  61. </form:select>
  62. </td>
  63. <td class="width-15 active" rowspan="3"><label class="pull-right">资讯图片:</label></td>
  64. <td class="width-35" rowspan="3">
  65. <c:choose>
  66. <c:when test="${appConsultation.cover =='' ||appConsultation.cover ==undefined}">
  67. </c:when>
  68. <c:otherwise>
  69. <img alt="image" src="${appConsultation.cover}" height="150" width="250"/>
  70. </c:otherwise>
  71. </c:choose>
  72. <c:if test="${mode != 'view'}">
  73. <sys:fileUpload path="cover" value="${appConsultation.cover}" uploadPath="/app/news/appConsultation"
  74. type="image" fileNumLimit="1" fileSizeLimit="2048" />
  75. </c:if>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td class="width-15 active"><label class="pull-right">资讯来源:</label></td>
  80. <td class="width-35">
  81. <form:input path="newsResource" htmlEscape="false" maxlength="50" class="form-control "/>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td class="width-15 active"><label class="pull-right">首页显示:</label></td>
  86. <td class="width-35">
  87. <form:radiobuttons path="display" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks required"/>
  88. </td>
  89. </tr>
  90. <tr>
  91. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>资讯标题:</label></td>
  92. <td class="width-35" colspan="3">
  93. <form:input path="title" htmlEscape="false" maxlength="100" class="form-control required"/>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td class="width-15 active"><label class="pull-right">资讯内容:</label></td>
  98. <td class="width-35" colspan="3">
  99. <input type="hidden" name="content" value=" ${appConsultation.content}"/>
  100. <div id="content">
  101. ${fns:unescapeHtml(appConsultation.content)}
  102. </div>
  103. </td>
  104. </tr>
  105. </tbody>
  106. </table>
  107. </form:form>
  108. </body>
  109. </html>