helpPageEdit.jsp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <%--
  2. Created by IntelliJ IDEA.
  3. User: Administrator
  4. Date: 2020/4/17
  5. Time: 14:43
  6. To change this template use File | Settings | File Templates.
  7. --%>
  8. <%--
  9. Created by IntelliJ IDEA.
  10. User: Administrator
  11. Date: 2020/4/17
  12. Time: 14:00
  13. To change this template use File | Settings | File Templates.
  14. --%>
  15. <%@ page import="com.thinkgem.jeesite.common.config.Global" %>
  16. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  17. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  18. <html>
  19. <head>
  20. <title>编辑帮助页</title>
  21. <meta name="decorator" content="default"/>
  22. <style>
  23. .red{color:red;}
  24. .blue{color:rgb(0, 100, 180);}
  25. #inputForm{max-width: 1200px;width: 100%;}
  26. #inputForm table{width:100%;line-height:18px;margin-bottom:50px;}
  27. #inputForm th,#inputForm td{ font-weight: normal; text-align: left; padding: 8px 5px; border-bottom: 1px solid rgb(238, 238, 238); }
  28. #inputForm th{width:15%;text-align:right;white-space:nowrap;font-weight:bold;}
  29. #inputForm td{width:35%;}
  30. #inputForm td input[type="text"]{width:320px;height:16px; line-height:16px; }
  31. #inputForm td input.short{width:120px;}
  32. #inputForm td b.line{margin:0 15px 0 20px;font-weight:normal}
  33. #allAreaInput {padding: 10px 0 0 100px;}
  34. #inputForm .item{line-height:28px;}
  35. #ladderPriceBox{border-top:1px solid rgb(238, 238, 238);margin-top:8px;padding-top:8px;}
  36. #ladderPriceBox>div {margin-bottom: 5px;}
  37. .priceIcon:before{content:'\2729';color: #aaa;font-size: 18px;font-style:normal;}
  38. .priceIcon.full:before{content:'\272E';color: #ffbd14;}
  39. </style>
  40. </head>
  41. <body>
  42. <ul class="nav nav-tabs">
  43. <li><a href="${ctx}/help/list">帮助页</a></li>
  44. <li class="active"><a href="${ctx}/help/form?id=${helppage.helpPageID}">编辑</a></li>
  45. </ul>
  46. <form:form id="inputForm" modelAttribute="helppage" action="${ctx}/help/save" method="post" class="form-horizontal">
  47. <form:hidden path="id"/>
  48. <sys:message content="${message}"/>
  49. <table border="0" cellspacing="0" cellpadding="0" width="100%">
  50. <tr>
  51. <th><span class="red">*</span>标题:</th>
  52. <td colspan="3">
  53. <form:input path="title" maxlength="20" class="input-small required"/>
  54. </td>
  55. </tr>
  56. <tr>
  57. <th><span class="red">*</span>帮助页信息类型:</th>
  58. <td colspan="3">
  59. <form:select path="helpPageTypeID" class="input-small required">
  60. <form:option value="" label="请选择"/>
  61. <c:forEach items="${typeList}" var="type">
  62. <form:option value="${type.id}" label="${type.typeName}"/>
  63. </c:forEach>
  64. </form:select>
  65. </td>
  66. </tr>
  67. <tr>
  68. <th><span class="red">*</span>在帮助中心左侧列表显示:</th>
  69. <td colspan="3">
  70. <input type="radio" name="showFlag" value="1" ${helppage.showFlag == "1" ? "checked" : ""} />是<b class="line">|</b>
  71. <input type="radio" name="showFlag" value="0" ${helppage.showFlag == "1" ? "" : "checked"} />否
  72. </td>
  73. </tr>
  74. <tr>
  75. <th>内容:</th>
  76. <td colspan="3">
  77. <!-- 富文本编辑器 -->
  78. <form:textarea path="content" class="input-xlarge hide"/>
  79. <div id="contentEditor">${helppage.content}</div>
  80. </td>
  81. </tr>
  82. <tr><td colspan="4" style="text-align:center;">
  83. <input id="btnSave" class="btn btn-primary" type="submit" value="保 存" onclick="checkInfo()"/>
  84. <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
  85. </td></tr>
  86. </table>
  87. </form:form>
  88. <!-- 富文本编辑器 -->
  89. <% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
  90. <script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
  91. <script type="text/javascript">
  92. //富文本框编辑
  93. function checkInfo(){
  94. // var content=CKEDITOR.instances.content.getData();
  95. var content = contentEditor.getData();
  96. $("#content").val(content);
  97. console.log(data);
  98. }
  99. $(document).ready(function() {
  100. //富文本框
  101. // CKEDITOR.replace('content');
  102. ClassicEditor.create(document.querySelector('#contentEditor'), {
  103. ckfinder: {
  104. uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
  105. }
  106. }).then(function(editor) {
  107. window.contentEditor = editor;
  108. }).catch(function(error){
  109. console.log(error);
  110. });
  111. // 提交
  112. $("#inputForm").validate({
  113. submitHandler: function(form){
  114. loading('正在提交,请稍等...');
  115. form.submit();
  116. },
  117. errorContainer: "#messageBox",
  118. errorPlacement: function(error, element) {
  119. $("#messageBox").text("输入有误,请先更正。");
  120. error.appendTo(element.parent());
  121. }
  122. });
  123. });
  124. </script>
  125. </body>
  126. </html>