eduNewsForm.jsp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. <style>
  8. .contents {
  9. width: 950px;
  10. }
  11. </style>
  12. <!-- SUMMERNOTE -->
  13. <%@include file="/webpage/include/ueditor.jsp" %>
  14. <script type="text/javascript">
  15. var contents = null;
  16. $(document).ready(function() {
  17. });
  18. function save() {
  19. var isValidate = jp.validateForm('#inputForm');//校验表单
  20. contents = editor.getContent();
  21. if(contents == ''){
  22. alert("内容不能为空!");
  23. return false;
  24. };
  25. $("#content").val(contents);
  26. if(!isValidate){
  27. return false;
  28. }else{
  29. jp.loading();
  30. jp.post("${ctx}/base/eduNews/save",$('#inputForm').serialize(),function(data){
  31. if(data.success){
  32. jp.getParent().refresh();
  33. var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
  34. parent.layer.close(dialogIndex);
  35. jp.success(data.msg)
  36. }else{
  37. jp.error(data.msg);
  38. }
  39. })
  40. }
  41. }
  42. </script>
  43. </head>
  44. <body class="bg-white">
  45. <form:form id="inputForm" modelAttribute="eduNews" class="form-horizontal">
  46. <form:hidden path="id"/>
  47. <form:hidden path="typeId" />
  48. <table class="table table-bordered">
  49. <tbody>
  50. <tr>
  51. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>标题:</label></td>
  52. <td >
  53. <form:input path="title" htmlEscape="false" maxlength="100" class="form-control required"/>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td class="width-15 active"><label class="pull-right">来源:</label></td>
  58. <td >
  59. <form:input path="source" htmlEscape="false" maxlength="50" class="form-control "/>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class="width-15 active" ><label class="pull-right"><font color="red">*</font>封面:</label></td>
  64. <td >
  65. <c:choose>
  66. <c:when test="${eduNews.oprType ==null || eduNews.oprType==''}">
  67. <sys:fileUpload path="cover" fileNumLimit="1" allowedExtensions="jpeg,jpg,png,bmp" value="${eduNews.cover}" uploadPath="/base/eduNews" type="images" required="required"/>
  68. </c:when>
  69. <c:otherwise>
  70. <img src="${eduNews.cover}" width="230" height="100">
  71. </c:otherwise>
  72. </c:choose>
  73. </td>
  74. <%-- <td class="width-15 active"><label class="pull-right"><font color="red">*</font>在轮播图中显示:</label></td>
  75. <td class="width-35">
  76. <form:radiobuttons path="display" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks required"/>
  77. </td>--%>
  78. </tr>
  79. <tr>
  80. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>内容:</label></td>
  81. <td >
  82. <!--<input type="hidden" name="content" value=" ${eduNews.content}"/> -->
  83. <div class="contents">
  84. <script id="container" name="content" type="text/plain">${fns:unescapeHtml(eduNews.content)}</script>
  85. <script type="text/javascript">
  86. var editor = UE.getEditor('container');
  87. editor.ready(function() {
  88. editor.setHeight(310);
  89. });
  90. </script>
  91. </div>
  92. </td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. </form:form>
  97. </body>
  98. </html>