navInfoForm.jsp 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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/save",$('#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" labelValue="${appBaseNews.dept.name}"
  88. title="所属党支部" url="/leader/org/leaderOrgNo/treeData" extId="${appBaseNews.id}" cssClass="form-control required" allowClear="true"/>
  89. </c:when>
  90. <c:otherwise>
  91. <input id="deptId" name="dept.id" type="hidden" value="${appBaseNews.dept.id}"/>
  92. <input id="dept" name="dept.name" class="form-control required" value="${appBaseNews.dept.name}" readonly>
  93. </c:otherwise>
  94. </c:choose>
  95. </td>
  96. <td class="width-15 active" rowspan="3"><label class="pull-right">图片:</label></td>
  97. <td class="width-35" rowspan="3">
  98. <c:choose>
  99. <c:when test="${appBaseNews.cover =='' ||appBaseNews.cover ==undefined}">
  100. </c:when>
  101. <c:otherwise>
  102. <img alt="image" src="${appBaseNews.cover}" height="150" width="250"/>
  103. </c:otherwise>
  104. </c:choose>
  105. <sys:fileUpload path="cover" value="${appBaseNews.cover}" uploadPath="/app/base/appBaseNews"
  106. type="image" fileNumLimit="1" fileSizeLimit="2048" />
  107. </td>
  108. </tr>
  109. <tr>
  110. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>栏目:</label></td>
  111. <td class="width-35">
  112. <form:select path="navId" cssClass="form-control m-b required">
  113. <form:options items="${navList}" itemLabel="title" itemValue="id" htmlEscape="false"/>
  114. </form:select>
  115. </td>
  116. </tr>
  117. <tr>
  118. <td class="width-15 active"><label class="pull-right"><font color="red">*</font>是否在首页中显示:</label></td>
  119. <td class="width-35">
  120. <form:radiobuttons path="display" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks required"/>
  121. </td>
  122. </tr>
  123. <tr>
  124. <td class="width-15 active"><label class="pull-right">内容:</label></td>
  125. <td class="width-35" colspan="3">
  126. <input type="hidden" name="content" value=" ${appBaseNews.content}"/>
  127. <div id="content">
  128. ${fns:unescapeHtml(appBaseNews.content)}
  129. </div>
  130. </td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. </form:form>
  135. </body>
  136. </html>