newPageHomeimageList.jsp 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  3. <html>
  4. <head>
  5. <title>新首页轮播图管理</title>
  6. <meta name="decorator" content="default"/>
  7. <style type="text/css">
  8. .table th {
  9. text-align: center;
  10. }
  11. .table td {
  12. text-align: center;
  13. }
  14. </style>
  15. <script type="text/javascript">
  16. $(document).ready(function () {
  17. });
  18. var changeSortNumber = [];
  19. function changeSort(id) {
  20. changeSortNumber.push(id);
  21. console.log("changeSortNumber------------>" + changeSortNumber);
  22. }
  23. var changeSorts = "";
  24. //批量保存排序
  25. function updateSortIndex() {
  26. for (let i = 0; i < changeSortNumber.length; i++) {
  27. var id = changeSortNumber[i];
  28. var sortNum = $("#sortNum" + id).val();
  29. changeSorts += id + '_' + sortNum + ',';
  30. }
  31. $.post("${ctx}/newhome/newPageHomeimage/updateSort", {'sortNums': changeSorts}, function (result) {
  32. $.jBox.tip(result.data, 'info');
  33. setTimeout(function () {
  34. $("#searchForm").submit();
  35. }, 500);
  36. })
  37. changeSortNumber = null;
  38. changeSorts = null;
  39. }
  40. function page(n, s) {
  41. $("#pageNo").val(n);
  42. $("#pageSize").val(s);
  43. $("#searchForm").submit();
  44. return false;
  45. }
  46. //PC端状态修改
  47. function updateEnabledStatus(status, ids) {
  48. var msg = '确定开启?';
  49. if ('0' == status) {
  50. msg = '确定停用?';
  51. }
  52. top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
  53. if (v == 'ok') {
  54. $.post("${ctx}/newhome/newPageHomeimage/updateEnabledStatus", {
  55. 'enabledStatus': status,
  56. 'ids': ids
  57. }, function (data) {
  58. if (true == data.success) {
  59. $.jBox.tip(data.msg, 'info');
  60. } else {
  61. $.jBox.tip(data.msg, 'error');
  62. }
  63. $("#searchForm").submit();
  64. }, "JSON");//这里返回的类型有:json,html,xml,text
  65. }
  66. return;
  67. }, {buttonsFocus: 1, persistent: true});
  68. }
  69. function onlynum(obj) {
  70. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  71. }
  72. //CRM端状态修改
  73. function updateCrmEnabledStatusByIds(status, ids) {
  74. var msg = '确定开启?';
  75. if ('0' == status) {
  76. msg = '确定停用?';
  77. }
  78. top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
  79. if (v == 'ok') {
  80. $.post("${ctx}/newhome/newPageHomeimage/updateCrmEnabledStatusByIds", {
  81. 'crmEnabledStatus': status,
  82. 'ids': ids
  83. }, function (data) {
  84. if (true == data.success) {
  85. $.jBox.tip(data.msg, 'info');
  86. } else {
  87. $.jBox.tip(data.msg, 'error');
  88. }
  89. $("#searchForm").submit();
  90. }, "JSON");//这里返回的类型有:json,html,xml,text
  91. }
  92. return;
  93. }, {buttonsFocus: 1, persistent: true});
  94. }
  95. </script>
  96. </head>
  97. <body>
  98. <ul class="nav nav-tabs">
  99. <li class="active"><a href="${ctx}/newhome/newPageHomeimage/">新首页轮播图列表</a></li>
  100. <shiro:hasPermission name="newhome:newPageHomeimage:edit">
  101. <li><a href="${ctx}/newhome/newPageHomeimage/form">新首页轮播图添加</a></li>
  102. </shiro:hasPermission>
  103. </ul>
  104. <form:form id="searchForm" modelAttribute="newPageHomeimage" action="${ctx}/newhome/newPageHomeimage/" method="post"
  105. class="breadcrumb form-search">
  106. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  107. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  108. <div class="ul-form">
  109. <label>ID:</label>
  110. <form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
  111. <label>标题:</label>
  112. <form:input path="title" htmlEscape="false" maxlength="40" class="input-small"/>
  113. <label>小程序端状态:</label>
  114. <form:select path="crmEnabledStatus" class="input-small">
  115. <form:option value="" label=" "/>
  116. <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
  117. htmlEscape="false"/>
  118. </form:select>
  119. <label>PC端状态:</label>
  120. <form:select path="wwwEnabledStatus" class="input-small">
  121. <form:option value="" label=" "/>
  122. <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value"
  123. htmlEscape="false"/>
  124. </form:select>
  125. <label>点击时间:</label>
  126. <form:input path="startPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageHomeimage.startPvCreateTime,'yyyy-MM-dd')}"
  127. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
  128. -
  129. <form:input path="endPvCreateTime" type="text" maxlength="20" class="input-mini Wdate" value="${fns:setDate(newPageHomeimage.endPvCreateTime,'yyyy-MM-dd')}"
  130. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
  131. &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
  132. <c:if test="${cmImage.flag eq 4}">
  133. <label style="float:right;">活动专区首页:<a href="${fns:getConfig('wwwServer')}cmpage/area.html"
  134. target="_blank">${fns:getConfig('wwwServer')}cmpage/area.html</a></label>
  135. </c:if>
  136. <input class="btn btn-primary" type="button" value="一键排序" onclick="updateSortIndex()"
  137. style="margin-left: 15px"/>
  138. <div class="clearfix"></div>
  139. </div>
  140. </form:form>
  141. <sys:message content="${message}"/>
  142. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  143. <thead>
  144. <tr>
  145. <th>ID</th>
  146. <th>标题</th>
  147. <th>图片</th>
  148. <th>链接</th>
  149. <th>排序</th>
  150. <th>点击量</th>
  151. <th>小程序端状态</th>
  152. <th>PC端状态</th>
  153. <th>创建时间</th>
  154. <shiro:hasPermission name="newhome:newPageHomeimage:edit">
  155. <th>操作</th>
  156. </shiro:hasPermission>
  157. </tr>
  158. </thead>
  159. <tbody>
  160. <c:forEach items="${page.list}" var="newPageHomeimage">
  161. <tr>
  162. <td>${newPageHomeimage.id}</td>
  163. <td>${newPageHomeimage.title}</td>
  164. <td><img style="width:120px;height: 80px;" src="${newPageHomeimage.image}"/></td>
  165. <td><a href="${newPageHomeimage.link}" target="_blank">${newPageHomeimage.link}</a></td>
  166. <td>
  167. <input id="sortNum${newPageHomeimage.id}" type="text" name="sort" style="width:50px;"
  168. value="${newPageHomeimage.sort}" onkeyup="onlynum(this)"
  169. onchange="changeSort(${newPageHomeimage.id})"/>
  170. </td>
  171. <td>${newPageHomeimage.count}</td>
  172. <td><shiro:hasPermission name="newhome:newPageHomeimage:edit">
  173. <c:if test="${newPageHomeimage.crmEnabledStatus eq 1 }">
  174. <a href="javascript:void(0);" onclick="updateCrmEnabledStatusByIds('0','${newPageHomeimage.id}');">
  175. <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
  176. </a>
  177. </c:if>
  178. <c:if test="${newPageHomeimage.crmEnabledStatus ne 1 }">
  179. <a href="javascript:void(0)" onclick="updateCrmEnabledStatusByIds('1','${newPageHomeimage.id}');">
  180. <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
  181. </a>
  182. </c:if>
  183. </shiro:hasPermission></td>
  184. <td><shiro:hasPermission name="newhome:newPageHomeimage:edit">
  185. <c:if test="${newPageHomeimage.wwwEnabledStatus eq 1 }">
  186. <a href="javascript:void(0);" onclick="updateEnabledStatus('0','${newPageHomeimage.id}');">
  187. <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
  188. </a>
  189. </c:if>
  190. <c:if test="${newPageHomeimage.wwwEnabledStatus ne 1 }">
  191. <a href="javascript:void(0)" onclick="updateEnabledStatus('1','${newPageHomeimage.id}');">
  192. <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
  193. </a>
  194. </c:if>
  195. </shiro:hasPermission></td>
  196. <td><fmt:formatDate value="${newPageHomeimage.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
  197. <shiro:hasPermission name="newhome:newPageHomeimage:edit">
  198. <td>
  199. <a href="${ctx}/newhome/newPageHomeimage/form?id=${newPageHomeimage.id}">编辑</a>
  200. <shiro:hasPermission name="newhome:newPageHomeimage:delete">
  201. <a href="${ctx}/newhome/newPageHomeimage/delete?id=${newPageHomeimage.id}"
  202. onclick="return confirmx('确认要删除该新首页轮播图吗?', this.href)">删除</a>
  203. </shiro:hasPermission>
  204. </td>
  205. </shiro:hasPermission>
  206. </tr>
  207. </c:forEach>
  208. </tbody>
  209. </table>
  210. <div class="pagination">${page}</div>
  211. </body>
  212. </html>