eduVideoNewsForm.jsp 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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($("#cover").val()== ''){
  20. alert("请上传封面图片!");
  21. return false;
  22. };
  23. if(contents == ''){
  24. alert("内容不能为空!");
  25. return false;
  26. };
  27. $("#contents").val(contents);
  28. if(!isValidate){
  29. return false;
  30. }else{
  31. jp.loading();
  32. jp.post("${ctx}/base/eduVideoNews/save",$('#inputForm').serialize(),function(data){
  33. if(data.success){
  34. jp.getParent().refresh();
  35. var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
  36. parent.layer.close(dialogIndex);
  37. jp.success(data.msg)
  38. }else{
  39. jp.error(data.msg);
  40. }
  41. })
  42. }
  43. }
  44. function preview(id){//预览
  45. jp.openViewDialog('预览', "${ctx}/base/eduVideoNews/form?typeId=${eduVideoNews.typeId}&isPreview=1&id=" + id, '800px', '550px');
  46. }
  47. </script>
  48. </head>
  49. <body class="bg-white">
  50. <form:form id="inputForm" modelAttribute="eduVideoNews" class="form-horizontal">
  51. <form:hidden path="id"/>
  52. <form:hidden path="typeId"/>
  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" colspan="3">
  58. <form:input path="title" htmlEscape="false" class="form-control required"/>
  59. </td>
  60. </tr>
  61. <tr>
  62. <c:choose>
  63. <c:when test="${eduVideoNews.typeId !='2'}">
  64. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>上传视频:</label></td>
  65. <td class="width-35">
  66. <sys:fileUpload path="url1" required="required" value="${eduVideoNews.url1}" type="video" uploadPath="/base/eduVideoNews/video" />
  67. <a href="#" onclick="preview('${eduVideoNews.id}')">视频预览</a>
  68. </td>
  69. </c:when>
  70. <c:otherwise>
  71. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>直播源:</label></td>
  72. <td class="width-35">
  73. <form:input path="url1" htmlEscape="false" class="form-control required "/>
  74. </td>
  75. </c:otherwise>
  76. </c:choose>
  77. <td class="width-15 active" rowspan="2"><label class="pull-right"><font color="red">*</font>封面图片:</label></td>
  78. <td class="width-35" rowspan="2">
  79. <c:choose>
  80. <c:when test="${eduVideoNews.oprType ==null || eduVideoNews.oprType ==''}">
  81. <sys:fileUpload path="cover" fileNumLimit="1" allowedExtensions="jpeg,jpg,png,bmp" value="${eduVideoNews.cover}" type="images" uploadPath="/base/eduVideoNews/image" required="required"/>
  82. </c:when>
  83. <c:otherwise>
  84. <img src="${eduVideoNews.cover}" width="230" height="100">
  85. </c:otherwise>
  86. </c:choose>
  87. </td>
  88. </tr>
  89. <tr>
  90. <%--<td class="width-15 active"><label class="pull-right">视频路径:</label></td>
  91. <td class="width-35">
  92. <sys:fileUpload path="url2" value="${eduVideoNews.url2}" type="file" uploadPath="/base/eduVideoNews"/>
  93. </td>--%>
  94. <%--<td class="width-15 active"><label class="pull-right">视频路径:</label></td>
  95. <td class="width-35">
  96. <sys:fileUpload path="url3" value="${eduVideoNews.url3}" type="file" uploadPath="/base/eduVideoNews"/>
  97. </td>--%>
  98. <td class="width-15 active"><label class="pull-right">来源:</label></td>
  99. <td class="width-35">
  100. <form:input path="source" htmlEscape="false" class="form-control "/>
  101. </td>
  102. </tr>
  103. <%--<tr>
  104. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>是否推荐:</label></td>
  105. <td class="width-35">
  106. <form:radiobutton path="isTop" value="1" label="否"/>
  107. <form:radiobutton path="isTop" value="" label="是"/>
  108. </td>
  109. </tr>--%>
  110. <tr>
  111. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>积分:</label></td>
  112. <td class="width-35">
  113. <form:input path="score" htmlEscape="false" maxlength="10" min="0.1" class="form-control required number"/>
  114. </td>
  115. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>积分类型:</label></td>
  116. <td class="width-35">
  117. <form:radiobutton path="scoreType" value="1" label="进入得分"/>
  118. <form:radiobutton path="scoreType" value="2" label="观看得分"/>
  119. </td>
  120. </tr>
  121. <tr>
  122. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>内容:</label></td>
  123. <td class="width-35" colspan="3">
  124. <div class="contents">
  125. <script id="container" name="contents" type="text/plain">${fns:unescapeHtml(eduVideoNews.contents)}</script>
  126. <script type="text/javascript">
  127. var editor = UE.getEditor('container');
  128. editor.ready(function() {
  129. editor.setHeight(310);
  130. });
  131. </script>
  132. </div>
  133. </td>
  134. </tr>
  135. </tbody>
  136. </table>
  137. </form:form>
  138. </body>
  139. </html>