fixedColumnForm.jsp 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. <%@include file="/webpage/include/summernote.jsp" %>
  8. <script type="text/javascript">
  9. $(document).ready(function () {
  10. <c:if test="${appBaseNews.oprType !=null && appBaseNews.oprType!=''}">
  11. $(".table.table-bordered").find("input,textarea,select").attr("disabled", "disabled");
  12. $("#coverButton").hide();
  13. $('#content').summernote({
  14. height: 300
  15. })
  16. $('#content').summernote('disable');
  17. </c:if>
  18. //富文本初始化
  19. $('#content').summernote({
  20. height: 300,
  21. lang: 'zh-CN',
  22. callbacks: {
  23. onChange: function (contents, $editable) {
  24. $("input[name='content']").val($('#content').summernote('code'));//取富文本的值
  25. }
  26. }
  27. });
  28. // 部门栏目二级联动
  29. $("#deptName").blur(function () {
  30. var deptId = $("#deptId").val();
  31. if (deptId != '') {
  32. $.ajax({
  33. type: "POST",
  34. url: "${ctx}/app/base/appBaseNav/getNav",
  35. data: {
  36. deptId: deptId
  37. },
  38. dataType: "json",
  39. success: function (data) {
  40. console.log(data);
  41. $("#navId").empty();
  42. $.each(data.rows, function (index, item) {
  43. $("#navId").append("<option value='" + item.id + "'>" + item.title + "</option>");
  44. });
  45. }
  46. });
  47. }
  48. });
  49. });
  50. function save() {
  51. var isValidate = jp.validateForm('#inputForm');//校验表单
  52. if (!isValidate) {
  53. return false;
  54. } else {
  55. jp.loading();
  56. jp.post("${ctx}/app/base/appBaseNews/saveFixedColumn", $('#inputForm').serialize(), function (data) {
  57. if (data.success) {
  58. jp.getParent().refresh();
  59. var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
  60. parent.layer.close(dialogIndex);
  61. jp.success(data.msg)
  62. } else {
  63. jp.error(data.msg);
  64. }
  65. })
  66. }
  67. }
  68. </script>
  69. </head>
  70. <body class="bg-white">
  71. <form:form id="inputForm" modelAttribute="appBaseNews" class="form-horizontal">
  72. <form:hidden path="id"/>
  73. <form:hidden path="typeId"/>
  74. <table class="table table-bordered">
  75. <tbody>
  76. <tr>
  77. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>标题:</label></td>
  78. <td class="width-35" colspan="3">
  79. <form:input path="title" htmlEscape="false" maxlength="100" class="form-control required"/>
  80. </td>
  81. </tr>
  82. <tr>
  83. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>所属党支部:</label></td>
  84. <td class="width-35">
  85. <c:choose>
  86. <c:when test="${admin}">
  87. <sys:treeselect id="dept" name="dept.id" value="${appBaseNews.dept.id}" labelName="dept.name"
  88. labelValue="${appBaseNews.dept.name}"
  89. title="所属党支部" url="/leader/org/leaderOrgNo/treeData" extId="${appBaseNews.id}"
  90. cssClass="form-control required" allowClear="true"/>
  91. </c:when>
  92. <c:otherwise>
  93. <input id="deptId" name="dept.id" type="hidden" value="${appBaseNews.dept.id}"/>
  94. <input id="dept" name="dept.name" class="form-control required" value="${appBaseNews.dept.name}"
  95. readonly>
  96. </c:otherwise>
  97. </c:choose>
  98. </td>
  99. <td class="width-15 active" rowspan="3"><label class="pull-right">图片:</label></td>
  100. <td class="width-35" rowspan="3">
  101. <c:choose>
  102. <c:when test="${appBaseNews.cover =='' ||appBaseNews.cover ==undefined}">
  103. </c:when>
  104. <c:otherwise>
  105. <img alt="image" src="${appBaseNews.cover}" height="150" width="250"/>
  106. </c:otherwise>
  107. </c:choose>
  108. <sys:fileUpload path="cover" value="${appBaseNews.cover}" uploadPath="/app/base/appBaseNews"
  109. type="image" fileNumLimit="1" fileSizeLimit="2048"/>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>栏目:</label></td>
  114. <td class="width-35">
  115. <c:if test="${appBaseNews.typeName =='支部负责人'}">
  116. <input id="navId" name="navId" type="hidden" value="100010001"/>
  117. </c:if>
  118. <c:if test="${appBaseNews.typeName =='支部党员'}">
  119. <input id="navId" name="navId" type="hidden" value="100010002"/>
  120. </c:if>
  121. <c:if test="${appBaseNews.typeName =='支部概况'}">
  122. <input id="navId" name="navId" type="hidden" value="100010003"/>
  123. </c:if>
  124. <c:if test="${appBaseNews.typeName =='支部历史'}">
  125. <input id="navId" name="navId" type="hidden" value="100010004"/>
  126. </c:if>
  127. <input id="typeName" name="typeName" class="form-control required" value="${appBaseNews.typeName}" readonly>
  128. <%--<form:select path="navId" cssClass="form-control m-b required">
  129. <form:options items="${navList}" itemLabel="title" itemValue="id" htmlEscape="false"/>
  130. </form:select>--%>
  131. </td>
  132. </tr>
  133. <tr>
  134. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>是否在首页中显示:</label></td>
  135. <td class="width-35">
  136. <form:radiobuttons path="display" items="${fns:getDictList('yes_no')}" itemLabel="label"
  137. itemValue="value" htmlEscape="false" class="i-checks required"/>
  138. </td>
  139. </tr>
  140. <tr>
  141. <td class="width-15 active"><label class="pull-right">内容:</label></td>
  142. <td class="width-35" colspan="3">
  143. <input type="hidden" name="content" value=" ${appBaseNews.content}"/>
  144. <div id="content">
  145. ${fns:unescapeHtml(appBaseNews.content)}
  146. </div>
  147. </td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. </form:form>
  152. </body>
  153. </html>