infoList.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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. <html>
  5. <head>
  6. <title>文章列表管理</title>
  7. <meta name="decorator" content="default"/>
  8. <style type="text/css">
  9. .table th{text-align: center;}
  10. .table td{text-align: center;}
  11. .topSelect{
  12. width: 80px;
  13. position: absolute;
  14. right: 50px;
  15. background-color: white;
  16. }
  17. </style>
  18. <% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
  19. <script type="text/javascript">
  20. $(document).ready(function() {
  21. show_title(16);
  22. });
  23. function page(n,s){
  24. $("#pageNo").val(n);
  25. $("#pageSize").val(s);
  26. $("#searchForm").submit();
  27. return false;
  28. }
  29. //状态修改
  30. function updateStatus(status,ids,type,enabledStatus){
  31. if('recommendStatus'==type){
  32. if('0'==enabledStatus){
  33. alert("请先把该文章改为启动状态!");
  34. }else{
  35. update(status,ids,type);
  36. }
  37. }else{
  38. update(status,ids,type);
  39. }
  40. }
  41. function update(status,ids,type){
  42. var msg='确定启用?';
  43. if('0'==status){
  44. msg='确定停用?';
  45. }
  46. top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
  47. if(v=='ok'){
  48. $.post("${ctx}/info/info/updateStatus",{'status':status,'ids':ids,'type':type}, function(data) {
  49. if(true==data.success){
  50. $.jBox.tip(data.msg, 'info');
  51. } else {
  52. $.jBox.tip(data.msg,'error');
  53. }
  54. $("#searchForm").submit();
  55. },"JSON");//这里返回的类型有:json,html,xml,text
  56. }
  57. return;
  58. },{buttonsFocus:1,persistent: true});
  59. }
  60. function updateType(){
  61. var tabmode='${cookie.tabmode.value}';
  62. if(tabmode=='1'){
  63. addTabPage('修改分类项', '${ctx}/info/infoType');
  64. }else{
  65. location.href="${ctx}/info/infoType";
  66. }
  67. }
  68. /* //更新所有索引
  69. function updateAllIndex() {
  70. var submit = function (v, h, f) {
  71. if (v == true){
  72. $.post("${ctx}/info/info/updateAllIndex",null, function(data) {
  73. if(true==data.success){
  74. $.jBox.tip(data.msg, 'info');
  75. } else {
  76. $.jBox.tip(data.msg,'error');
  77. }
  78. $("#searchForm").submit();
  79. },"JSON");//这里返回的类型有:json,html,xml,text
  80. }
  81. return true;// close
  82. };
  83. // 自定义按钮
  84. $.jBox.confirm("该操作将更新所有文章索引,约耗时10分钟!!请谨慎操作", "更新索引", submit, { buttons: { '确定': true, '取消': false} });
  85. }
  86. //更新单个索引
  87. function updateIndex(id){
  88. $.post("${ctx}/info/info/updateIndex",{'id':id}, function(data) {
  89. if(true==data.success){
  90. $.jBox.tip(data.msg, 'info');
  91. } else {
  92. $.jBox.tip(data.msg,'error');
  93. }
  94. $("#searchForm").submit();
  95. },"JSON");//这里返回的类型有:json,html,xml,text
  96. }*/
  97. // 更新索引
  98. function updateIndex(id) {
  99. $.post("${caimeiCore}/commodity/search/index/update/article", {articleId: id}, function(res){
  100. $.jBox.tip(res.msg, 'info');
  101. });
  102. }
  103. function updateAllIndex(){
  104. var submit = function (v, h, f) {
  105. if (v == true){
  106. $.post("${caimeiCore}/commodity/search/index/article/all", function(res){
  107. $.jBox.tip(res.msg, 'info');
  108. });
  109. }
  110. return true;// close
  111. };
  112. // 自定义按钮
  113. $.jBox.confirm("该操作将更新所有商品索引,约耗时10分钟!!请谨慎操作", "更新索引", submit, { buttons: { '确定': true, '取消': false} });
  114. }
  115. //展示置顶选项
  116. function showTopSelect(index,status) {
  117. var homePageImage = $("#homePageImage" + index).text();
  118. if (homePageImage != "") {
  119. if ('open' == status) {
  120. document.getElementById("topSelect" + index).style.cssText = "display:block";
  121. }else if ('close' == status) {
  122. document.getElementById("topSelect" + index).style.cssText = "display:none";
  123. }
  124. }else {
  125. alertx("请先去编辑页面上传商城首页图再置顶")
  126. }
  127. }
  128. //更新置顶
  129. function updateTopPosition(topPosition,id,type) {
  130. var msg = '';
  131. if ('setTopPosition' == type) {
  132. msg = '确认置顶该文章吗?';
  133. //已有的置顶文章数量
  134. var topLength = ${topLength};
  135. if (topPosition - 1 > topLength) {
  136. var emptyPosition = topLength == 0 ? '一' : '二' ;
  137. msg = '由于当前没有第'+ emptyPosition +'位的置顶文章,将直接把该条文章置顶为第'+emptyPosition+'位';
  138. topPosition = topLength == 0 ? 1 : topLength == 1 ? 2 : topLength == 2 ? 3 : topLength == 3 ? 4 : 5;
  139. }
  140. }
  141. if ('clearTopPosition' == type) {
  142. msg = '确认清除该条数据的置顶位吗?清除后这条数据将不会在商城首页展示';
  143. }
  144. top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
  145. if (v == 'ok') {
  146. $.post("${ctx}/info/info/updateTopPosition", {
  147. 'topPosition': topPosition,
  148. 'id': id,
  149. 'type':type
  150. }, function (data) {
  151. if (true == data.success) {
  152. $.jBox.tip(data.msg, 'info');
  153. } else {
  154. $.jBox.tip(data.msg, 'error');
  155. }
  156. setTimeout(function () {
  157. $("#searchForm").submit();
  158. },800)
  159. }, "JSON");//这里返回的类型有:json,html,xml,text
  160. }
  161. return;
  162. }, {buttonsFocus: 1, persistent: true});
  163. }
  164. </script>
  165. </head>
  166. <body>
  167. <ul class="nav nav-tabs">
  168. <li class="active"><a href="${ctx}/info/info/">文章列表</a></li>
  169. <shiro:hasPermission name="info:info:edit"><li><a href="${ctx}/info/info/form">文章添加</a></li></shiro:hasPermission>
  170. <shiro:hasPermission name="info:infoType:edit"><li><a href="javascript:void(0);" onclick="updateType();">修改分类项</a></li></shiro:hasPermission>
  171. </ul>
  172. <input type="button" class="btn btn-primary" value="更新全部搜索索引" onclick="updateAllIndex()" />
  173. <form:form id="searchForm" modelAttribute="info" action="${ctx}/info/info/" method="post" class="breadcrumb form-search">
  174. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  175. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  176. <form:hidden path="label"/>
  177. <div class="ul-form">
  178. <label>ID:</label>
  179. <form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
  180. <label>标题:</label>
  181. <form:input path="title" htmlEscape="false" maxlength="100" class="input-medium"/>
  182. <label>发布人:</label>
  183. <form:input path="publisher" htmlEscape="false" maxlength="50" class="input-medium"/>
  184. <label>发布时间:</label>
  185. <form:input path="startPubDate" type="text" maxlength="10" class="input-medium Wdate"
  186. value="${startPubDate}"
  187. onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
  188. <form:input path="endPubDate" type="text" maxlength="10" class="input-medium Wdate"
  189. value="${startPubDate}"
  190. onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
  191. <br> <br>
  192. <label>文章分类:</label>
  193. <form:select path="infoType.id" class="input-small">
  194. <form:option value="" label=" "/>
  195. <form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
  196. </form:select>
  197. <label>推荐状态:</label>
  198. <form:select path="recommendStatus" class="input-mini">
  199. <form:option value="" label=" "/>
  200. <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  201. </form:select>
  202. <label>状态:</label>
  203. <form:select path="enabledStatus" class="input-mini">
  204. <form:option value="" label=" "/>
  205. <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  206. </form:select>
  207. <label>首页置顶:</label>
  208. <form:select path="topFlag" class="input-mini">
  209. <form:option value="" label="全部"/>
  210. <form:option value="1" label="是"/>
  211. <form:option value="0" label="否"/>
  212. </form:select>
  213. &nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
  214. <div class="clearfix"></div>
  215. </div>
  216. </form:form>
  217. <sys:message content="${message}"/>
  218. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  219. <thead>
  220. <tr>
  221. <th>ID</th>
  222. <th>文章分类</th>
  223. <th>引导图</th>
  224. <th>文章标题</th>
  225. <th>文章标签</th>
  226. <th>发布人</th>
  227. <th>实际点赞</th>
  228. <th>基础阅读量</th>
  229. <th>实际阅读量</th>
  230. <th>首页置顶位</th>
  231. <%--<th>优先级</th>--%>
  232. <th>发布时间</th>
  233. <th>添加时间</th>
  234. <th>推荐状态</th>
  235. <th>状态</th>
  236. <shiro:hasPermission name="info:info:edit"><th>操作</th></shiro:hasPermission>
  237. </tr>
  238. </thead>
  239. <tbody>
  240. <c:forEach items="${page.list}" var="info" varStatus="index">
  241. <tr>
  242. <td>${info.id}</td>
  243. <td>
  244. ${info.infoType.name}
  245. </td>
  246. <td><img src="${info.guidanceImage}" width="100px;" height="100px;" style="width: 100px;height: 100px;"></td>
  247. <td class="comitted">
  248. ${info.title}
  249. </td>
  250. <td>
  251. ${info.label}
  252. </td>
  253. <td>
  254. ${info.publisher}
  255. </td>
  256. <td>${empty info.realPraise?0:(info.realPraise)}</td>
  257. <td>${empty info.basePv?0:(info.basePv)}</td>
  258. <td>${empty info.pv?0:(info.pv)}</td>
  259. <td>${info.topPosition}</td>
  260. <%--<td>${empty info.priorityIndex?0:(info.priorityIndex)}</td>--%>
  261. <td><fmt:formatDate value="${info.pubdate}" pattern="yyyy-MM-dd HH:mm"/></td>
  262. <td><fmt:formatDate value="${info.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
  263. <td>
  264. <c:if test="${info.recommendStatus eq 1 }">
  265. <a href="javascript:void(0);" onclick="updateStatus('0','${info.id}','recommendStatus','${info.enabledStatus}');" >
  266. <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
  267. </a>
  268. </c:if>
  269. <c:if test="${info.recommendStatus ne 1 }">
  270. <a href="javascript:void(0)" onclick="updateStatus('1','${info.id}','recommendStatus','${info.enabledStatus}');">
  271. <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
  272. </a>
  273. </c:if>
  274. </td>
  275. <td>
  276. <c:if test="${info.enabledStatus eq 1 }">
  277. <font color="green">已发布</font>
  278. <a href="javascript:void(0)" onclick="updateStatus('0','${info.id}','enabledStatus','${info.enabledStatus}');" style="cursor: pointer">暂不发布
  279. </a>
  280. </c:if>
  281. <c:if test="${info.enabledStatus ne 1 }">
  282. <font color="red">暂不发布</font>
  283. <a href="javascript:void(0)" onclick="updateStatus('1','${info.id}','enabledStatus','${info.enabledStatus}');" style="cursor: pointer">发布
  284. </a>
  285. </c:if>
  286. </td>
  287. <td hidden>
  288. <label id="homePageImage${index.index}">${info.homePageImage}</label>
  289. </td>
  290. <shiro:hasPermission name="info:info:edit"><td style="width: 150px">
  291. <a href="${fns:getConfig('wwwServer')}info/detail-${info.id}-1.html" target="_blank">查看</a>
  292. <a href="${ctx}/info/info/form?id=${info.id}">编辑</a>
  293. <shiro:hasPermission name="info:info:delete">
  294. <a href="${ctx}/info/info/delete?id=${info.id}" onclick="return confirmx('确认要删除该文章列表吗?', this.href)">删除</a>
  295. </shiro:hasPermission>
  296. <a href="javascript:void(0);" onclick="updateIndex('${info.id}');">更新索引</a>
  297. <a onclick="showTopSelect(${index.index},'open')" href="javascript:void(0)">首页置顶</a>
  298. <c:if test="${info.topPosition ne null}">
  299. <a onclick="updateTopPosition('','${info.id}','clearTopPosition')" href="javascript:void(0)">清除置顶</a>
  300. </c:if>
  301. <div style="display: none" class="topSelect" id="topSelect${index.index}" onmouseleave="showTopSelect(${index.index},'close')">
  302. <table style="border: 2px solid #000000;" cellpadding="0" cellspacing="0">
  303. <tbody>
  304. <tr>
  305. <td><a onclick="updateTopPosition('1',${info.id},'setTopPosition')" href="javascript:void(0)">置顶第一位</a></td>
  306. </tr>
  307. <tr>
  308. <td><a onclick="updateTopPosition('2',${info.id},'setTopPosition')" href="javascript:void(0)">置顶第二位</a></td>
  309. </tr>
  310. <tr>
  311. <td><a onclick="updateTopPosition('3',${info.id},'setTopPosition')" href="javascript:void(0)">置顶第三位</a></td>
  312. </tr>
  313. </tbody>
  314. </table>
  315. </div>
  316. </td></shiro:hasPermission>
  317. </tr>
  318. </c:forEach>
  319. </tbody>
  320. </table>
  321. <div class="pagination">${page}</div>
  322. </body>
  323. </html>