eduColumnNewsForm.jsp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. function save() {
  17. var isValidate = jp.validateForm('#inputForm');//校验表单
  18. contents = editor.getContent();
  19. if(contents == ''){
  20. alert("内容不能为空!");
  21. return false;
  22. };
  23. $("#content").val(contents);
  24. if(!isValidate){
  25. return false;
  26. }else{
  27. jp.loading();
  28. jp.post("${ctx}/base/eduColumnNews/save",$('#inputForm').serialize(),function(data){
  29. if(data.success){
  30. jp.getParent().refresh();
  31. var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
  32. parent.layer.close(dialogIndex);
  33. jp.success(data.msg)
  34. }else{
  35. jp.error(data.msg);
  36. }
  37. })
  38. }
  39. }
  40. function preview(id){//预览
  41. jp.openViewDialog('预览', "${ctx}/base/eduColumnNews/form?isPreview=1&id=" + id, '800px', '550px');
  42. }
  43. </script>
  44. </head>
  45. <body class="bg-white">
  46. <form:form id="inputForm" modelAttribute="eduColumnNews" class="form-horizontal">
  47. <form:hidden path="id"/>
  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"><font color="red">*</font>栏目:</label></td>
  58. <td>
  59. <form:select path="columnId" class="form-control required">
  60. <form:option value="" label=""/>
  61. <form:options items="${columns}" itemLabel="title" itemValue="id" htmlEscape="false"/>
  62. </form:select>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>上传视频:</label></td>
  67. <td class="width-35">
  68. <sys:fileUpload path="url1" required="flase" value="${eduColumnNews.url1}" type="video" uploadPath="/base/eduColumnNews/video" />
  69. <a href="#" onclick="preview('${eduColumnNews.id}')">视频预览</a>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>封面:</label></td>
  74. <td>
  75. <c:choose>
  76. <c:when test="${eduColumnNews.oprType == null ||eduColumnNews.oprType == ''}">
  77. <sys:fileUpload path="cover" fileNumLimit="1" allowedExtensions="jpeg,jpg,png,bmp" value="${eduColumnNews.cover}" type="file" uploadPath="/base/eduColumnNews" required="required"/>
  78. </c:when>
  79. <c:otherwise>
  80. <img src="${eduColumnNews.cover}" width="230" height="100">
  81. </c:otherwise>
  82. </c:choose>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td class="width-15 active"><label class="pull-right">来源:</label></td>
  87. <td>
  88. <form:input path="source" htmlEscape="false" maxlength="50" class="form-control "/>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>内容:</label></td>
  93. <td>
  94. <div class="contents">
  95. <script id="container" name="content" type="text/plain">${fns:unescapeHtml(eduColumnNews.content)}</script>
  96. <script type="text/javascript">
  97. var editor = UE.getEditor('container');
  98. editor.ready(function() {
  99. editor.setHeight(310);
  100. });
  101. </script>
  102. </div>
  103. </td>
  104. </tr>
  105. </tbody>
  106. </table>
  107. </form:form>
  108. </body>
  109. </html>