cmPageList.jsp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <%@ page import="com.thinkgem.jeesite.common.config.Global" %>
  2. <%@ page contentType="text/html;charset=UTF-8" %>
  3. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  4. <% request.setAttribute("caimeiSpi", Global.getConfig("caimei.spi"));%>
  5. <html>
  6. <head>
  7. <title>网页列表</title>
  8. <meta name="decorator" content="default"/>
  9. <style type="text/css">
  10. .table th{text-align: center;}
  11. .table td{text-align: center;}
  12. .jbox span.jbox-icon {top: auto !important;}
  13. </style>
  14. <script type="text/javascript">
  15. $(document).ready(function() {
  16. show_title(16);
  17. });
  18. function page(n,s){
  19. $("#pageNo").val(n);
  20. $("#pageSize").val(s);
  21. $("#searchForm").submit();
  22. return false;
  23. }
  24. //状态修改
  25. function updateEnabledStatus(status,ids){
  26. var msg='确定开启?';
  27. if('0'==status){
  28. msg='确定停用?';
  29. }
  30. top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
  31. if(v=='ok'){
  32. $.post("${ctx}/cmpage/cmPage/updateEnabledStatus",{'enabledStatus':status,'ids':ids}, function(data) {
  33. if(true==data.success){
  34. $.jBox.tip(data.msg, 'info');
  35. } else {
  36. $.jBox.tip(data.msg,'error');
  37. }
  38. $("#searchForm").submit();
  39. },"JSON");//这里返回的类型有:json,html,xml,text
  40. }
  41. return;
  42. },{buttonsFocus:1,persistent: true});
  43. }
  44. function openwin() {
  45. var submit = function (v, h, f) {
  46. if ('1' == v ){
  47. location.href="${ctx}/cmpage/cmPage/form?&flag=21";
  48. }
  49. else if ('2' == v){
  50. location.href="${ctx}/cmpage/cmPage/form?&flag=22";
  51. }else if('4' == v){
  52. location.href="${ctx}/cmpage/cmPage/form?&flag=24";
  53. }else if('5' == v){
  54. location.href="${ctx}/cmpage/cmPage/form?&flag=25";
  55. }else if('6' == v){
  56. //活动专题
  57. location.href="${ctx}/cmpage/cmPage/form?&flag=26";
  58. }
  59. return true;// close
  60. };
  61. // 自定义按钮
  62. $.jBox.confirm("请选择需要新增的页面!!!", "新增网页", submit, { buttons: { '项目详情页面': 1, '二级列表页面': 2,'自由页面':4,'分类详情':5,'活动专题':6} });
  63. }
  64. //更新单个索引
  65. function updateIndex(id){
  66. /*$.post("${ctx}/cmpage/cmPage/updateIndex",{'id':id}, function(data) {
  67. if(true==data.success){
  68. $.jBox.tip(data.msg, 'info');
  69. } else {
  70. $.jBox.tip(data.msg,'error');
  71. }
  72. $("#searchForm").submit();
  73. },"JSON");//这里返回的类型有:json,html,xml,text*/
  74. $.post("${caimeiSpi}/search/manage/update/equipment", {eid: id}, function(res){
  75. $.jBox.tip(res.msg, 'info');
  76. $("#searchForm").submit();
  77. });
  78. }
  79. //更新所有索引
  80. function updateAllIndex() {
  81. var submit = function (v, h, f) {
  82. if (v == true){
  83. /*$.post("${ctx}/cmpage/cmPage/updateAllIndex",null, 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. $.post("${caimeiSpi}/search/manage/update/equipment/all", function(res){
  93. $.jBox.tip(res.msg, 'info');
  94. $("#searchForm").submit();
  95. });
  96. }
  97. return true;// close
  98. };
  99. // 自定义按钮
  100. $.jBox.confirm("该操作将更新所有项目索引,约耗时10分钟!!请谨慎操作", "更新索引", submit, { buttons: { '确定': true, '取消': false} });
  101. }
  102. </script>
  103. </head>
  104. <body>
  105. <ul class="nav nav-tabs">
  106. <li class="active"><a href="${ctx}/cmpage/cmPage/?flag=2">网页列表</a></li>
  107. </ul>
  108. <div class="" style="margin: 0 0 10px 10px;">
  109. <table style="float: right;width: 40%;" border="1">
  110. <tr>
  111. <div class="ul-form">
  112. <table style="float: right;width: 40%;" border="1">
  113. <label><font style="font-weight:bold;">网页使用说明</font></label></br>
  114. <label>【项目详情】适用于:仪器分期/项目合作等 详情页</label></br>
  115. <label>【二级列表】适用于:大项目/正品联盟/仪器分期等 二级列表页面</label></br>
  116. <label>【自由页面】适用于:自由页面</label></br>
  117. <label>【分类详情】适用于:产品和仪器两个大分类的详情页</label></br>
  118. <label>【活动专题】适用于:展会/商城详情页</label>
  119. &nbsp&nbsp&nbsp&nbsp&nbsp<input type="button" class="btn btn-primary" value="新增页面" onclick="openwin()" />
  120. </table>
  121. <br>
  122. <input type="button" class="btn btn-primary" value="更新项目详情搜索索引" onclick="updateAllIndex()" />
  123. </div>
  124. </tr>
  125. </table>
  126. </div>
  127. <form:form id="searchForm" modelAttribute="cmPage" action="${ctx}/cmpage/cmPage/?flag=2" method="post" class="breadcrumb form-search">
  128. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  129. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  130. <div class="ul-form">
  131. <label>ID:</label>
  132. <form:input path="id" htmlEscape="false" maxlength="11" class="input-medium"/>
  133. <label>类型:</label>
  134. <form:select path="type" class="input-medium">
  135. <form:option value="" label=" "/>
  136. <form:option value="1" label="二级列表"/>
  137. <form:option value="2" label="项目详情"/>
  138. <form:option value="4" label="自由页面"/>
  139. <form:option value="5" label="分类详情"/>
  140. <form:option value="6" label="活动专题"/>
  141. </form:select>
  142. <label>标题:</label>
  143. <form:input path="title" htmlEscape="false" maxlength="50" class="input-medium"/>
  144. <label>状态:</label>
  145. <form:select path="enabledStatus" class="input-medium">
  146. <form:option value="" label=" "/>
  147. <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  148. </form:select>
  149. &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
  150. <div class="clearfix"></div>
  151. </div>
  152. </form:form>
  153. <sys:message content="${message}"/>
  154. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  155. <thead>
  156. <tr>
  157. <th>网页ID</th>
  158. <th>网页类型</th>
  159. <th>网页标题</th>
  160. <th>首层图片</th>
  161. <th>网址</th>
  162. <th>状态</th>
  163. <th>创建时间</th>
  164. <shiro:hasPermission name="cmpage:cmPage:edit"><th>操作</th></shiro:hasPermission>
  165. </tr>
  166. </thead>
  167. <tbody>
  168. <c:forEach items="${page.list}" var="cmPage">
  169. <tr>
  170. <td>
  171. ${cmPage.id}
  172. </a></td>
  173. <td>
  174. ${fns:getDictLabel(cmPage.type, 'webPage_type', '')}
  175. </td>
  176. <td>
  177. ${cmPage.title}
  178. </td>
  179. <td> <c:if test="${cmPage.type ne 4 && cmPage.type ne 5}"><img src="${cmPage.headImage}" style="width: 160px;height: 100px;"> </c:if></td>
  180. <td>
  181. <a href="${fns:getConfig('wwwServer')}cmpage/info-${cmPage.type}-${cmPage.id}.html" target="_blank">${fns:getConfig('wwwServer')}cmpage/info-${cmPage.type}-${cmPage.id}.html</a>
  182. </td>
  183. <td>
  184. <shiro:hasPermission name="cmpage:cmPage:edit">
  185. <c:if test="${cmPage.enabledStatus eq 1 }">
  186. <a href="javascript:void(0);" onclick="updateEnabledStatus('0','${cmPage.id}');" >
  187. <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
  188. </a>
  189. </c:if>
  190. <c:if test="${cmPage.enabledStatus ne 1 }">
  191. <a href="javascript:void(0)" onclick="updateEnabledStatus('1','${cmPage.id}');">
  192. <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
  193. </a>
  194. </c:if>
  195. </shiro:hasPermission>
  196. </td>
  197. <td>
  198. <fmt:formatDate value="${cmPage.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
  199. </td>
  200. <shiro:hasPermission name="cmpage:cmPage:edit"><td>
  201. <c:if test="${cmPage.type eq 2 }">
  202. <a href="javascript:void(0);" onclick="updateIndex('${cmPage.id}');">更新项目详情索引</a>
  203. </c:if>
  204. <a href="${ctx}/cmpage/cmPage/form?id=${cmPage.id}&type=${cmPage.type}">编辑</a>
  205. <c:if test="${cmPage.type ne 4}">
  206. <a href="${ctx}/cmpage/cmPageCentre/?pageId=${cmPage.id}&type=${cmPage.type}">商品楼层</a>
  207. </c:if>
  208. <c:if test="${cmPage.enabledStatus ne 1 }">
  209. <shiro:hasPermission name="cmpage:cmPage:delete">
  210. <a href="${ctx}/cmpage/cmPage/delete?id=${cmPage.id}&flag=2" onclick="return confirmx('确认要删除该网页列表吗?', this.href)">删除</a>
  211. </shiro:hasPermission>
  212. </c:if>
  213. </td></shiro:hasPermission>
  214. </tr>
  215. </c:forEach>
  216. </tbody>
  217. </table>
  218. <div class="pagination">${page}</div>
  219. </body>
  220. </html>