123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- <%@ page import="com.thinkgem.jeesite.common.config.Global" %>
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
- <html>
- <head>
- <title>文章列表管理</title>
- <meta name="decorator" content="default"/>
- <style type="text/css">
- .table th{text-align: center;}
- .table td{text-align: center;}
- .topSelect{
- width: 80px;
- position: absolute;
- right: 50px;
- background-color: white;
- }
- </style>
- <% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
- <script type="text/javascript">
- $(document).ready(function() {
- show_title(16);
- });
- function page(n,s){
- $("#pageNo").val(n);
- $("#pageSize").val(s);
- $("#searchForm").submit();
- return false;
- }
- //状态修改
- function updateStatus(status,ids,type,enabledStatus){
- if('recommendStatus'==type){
- if('0'==enabledStatus){
- alert("请先把该文章改为启动状态!");
- }else{
- update(status,ids,type);
- }
- }else{
- update(status,ids,type);
- }
- }
- function update(status,ids,type){
- var msg='确定启用?';
- if('0'==status){
- msg='确定停用?';
- }
- top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
- if(v=='ok'){
- $.post("${ctx}/info/info/updateStatus",{'status':status,'ids':ids,'type':type}, function(data) {
- if(true==data.success){
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg,'error');
- }
- $("#searchForm").submit();
- },"JSON");//这里返回的类型有:json,html,xml,text
- }
- return;
- },{buttonsFocus:1,persistent: true});
- }
- function updateType(){
- var tabmode='${cookie.tabmode.value}';
- if(tabmode=='1'){
- addTabPage('修改分类项', '${ctx}/info/infoType');
- }else{
- location.href="${ctx}/info/infoType";
- }
- }
- /* //更新所有索引
- function updateAllIndex() {
- var submit = function (v, h, f) {
- if (v == true){
- $.post("${ctx}/info/info/updateAllIndex",null, function(data) {
- if(true==data.success){
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg,'error');
- }
- $("#searchForm").submit();
- },"JSON");//这里返回的类型有:json,html,xml,text
- }
- return true;// close
- };
- // 自定义按钮
- $.jBox.confirm("该操作将更新所有文章索引,约耗时10分钟!!请谨慎操作", "更新索引", submit, { buttons: { '确定': true, '取消': false} });
- }
- //更新单个索引
- function updateIndex(id){
- $.post("${ctx}/info/info/updateIndex",{'id':id}, function(data) {
- if(true==data.success){
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg,'error');
- }
- $("#searchForm").submit();
- },"JSON");//这里返回的类型有:json,html,xml,text
- }*/
- // 更新索引
- function updateIndex(id) {
- $.post("${caimeiCore}/commodity/search/index/update/article", {articleId: id}, function(res){
- $.jBox.tip(res.msg, 'info');
- });
- }
- function updateAllIndex(){
- var submit = function (v, h, f) {
- if (v == true){
- $.post("${caimeiCore}/commodity/search/index/article/all", function(res){
- $.jBox.tip(res.msg, 'info');
- });
- }
- return true;// close
- };
- // 自定义按钮
- $.jBox.confirm("该操作将更新所有商品索引,约耗时10分钟!!请谨慎操作", "更新索引", submit, { buttons: { '确定': true, '取消': false} });
- }
- //展示置顶选项
- function showTopSelect(index,status) {
- var homePageImage = $("#homePageImage" + index).text();
- if (homePageImage != "") {
- if ('open' == status) {
- document.getElementById("topSelect" + index).style.cssText = "display:block";
- }else if ('close' == status) {
- document.getElementById("topSelect" + index).style.cssText = "display:none";
- }
- }else {
- alertx("请先去编辑页面上传商城首页图再置顶")
- }
- }
- //更新置顶
- function updateTopPosition(topPosition,id,type) {
- var msg = '';
- if ('setTopPosition' == type) {
- msg = '确认置顶该文章吗?';
- //已有的置顶文章数量
- var topLength = ${topLength};
- if (topPosition - 1 > topLength) {
- var emptyPosition = topLength == 0 ? '一' : '二' ;
- msg = '由于当前没有第'+ emptyPosition +'位的置顶文章,将直接把该条文章置顶为第'+emptyPosition+'位';
- topPosition = topLength == 0 ? 1 : topLength == 1 ? 2 : topLength == 2 ? 3 : topLength == 3 ? 4 : 5;
- }
- }
- if ('clearTopPosition' == type) {
- msg = '确认清除该条数据的置顶位吗?清除后这条数据将不会在商城首页展示';
- }
- top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
- if (v == 'ok') {
- $.post("${ctx}/info/info/updateTopPosition", {
- 'topPosition': topPosition,
- 'id': id,
- 'type':type
- }, function (data) {
- if (true == data.success) {
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg, 'error');
- }
- setTimeout(function () {
- $("#searchForm").submit();
- },800)
- }, "JSON");//这里返回的类型有:json,html,xml,text
- }
- return;
- }, {buttonsFocus: 1, persistent: true});
- }
- </script>
- </head>
- <body>
- <ul class="nav nav-tabs">
- <li class="active"><a href="${ctx}/info/info/">文章列表</a></li>
- <shiro:hasPermission name="info:info:edit"><li><a href="${ctx}/info/info/form">文章添加</a></li></shiro:hasPermission>
- <shiro:hasPermission name="info:infoType:edit"><li><a href="javascript:void(0);" onclick="updateType();">修改分类项</a></li></shiro:hasPermission>
- </ul>
- <input type="button" class="btn btn-primary" value="更新全部搜索索引" onclick="updateAllIndex()" />
- <form:form id="searchForm" modelAttribute="info" action="${ctx}/info/info/" method="post" class="breadcrumb form-search">
- <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
- <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
- <form:hidden path="label"/>
- <div class="ul-form">
- <label>ID:</label>
- <form:input path="id" htmlEscape="false" maxlength="11" class="input-mini"/>
- <label>标题:</label>
- <form:input path="title" htmlEscape="false" maxlength="100" class="input-medium"/>
- <label>发布人:</label>
- <form:input path="publisher" htmlEscape="false" maxlength="50" class="input-medium"/>
- <label>发布时间:</label>
- <form:input path="startPubDate" type="text" maxlength="10" class="input-medium Wdate"
- value="${startPubDate}"
- onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
- 至
- <form:input path="endPubDate" type="text" maxlength="10" class="input-medium Wdate"
- value="${startPubDate}"
- onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
- <br> <br>
- <label>文章分类:</label>
- <form:select path="infoType.id" class="input-small">
- <form:option value="" label=" "/>
- <form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
- </form:select>
- <label>推荐状态:</label>
- <form:select path="recommendStatus" class="input-mini">
- <form:option value="" label=" "/>
- <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
- </form:select>
- <label>状态:</label>
- <form:select path="enabledStatus" class="input-mini">
- <form:option value="" label=" "/>
- <form:options items="${fns:getDictList('enabled_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
- </form:select>
- <label>首页置顶:</label>
- <form:select path="topFlag" class="input-mini">
- <form:option value="" label="全部"/>
- <form:option value="1" label="是"/>
- <form:option value="0" label="否"/>
- </form:select>
- <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
- <div class="clearfix"></div>
- </div>
- </form:form>
- <sys:message content="${message}"/>
- <table id="contentTable" class="table table-striped table-bordered table-condensed">
- <thead>
- <tr>
- <th>ID</th>
- <th>文章分类</th>
- <th>引导图</th>
- <th>文章标题</th>
- <th>文章标签</th>
- <th>发布人</th>
- <th>实际点赞</th>
- <th>基础阅读量</th>
- <th>实际阅读量</th>
- <th>首页置顶位</th>
- <%--<th>优先级</th>--%>
- <th>发布时间</th>
- <th>添加时间</th>
- <th>推荐状态</th>
- <th>状态</th>
- <shiro:hasPermission name="info:info:edit"><th>操作</th></shiro:hasPermission>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${page.list}" var="info" varStatus="index">
- <tr>
- <td>${info.id}</td>
- <td>
- ${info.infoType.name}
- </td>
- <td><img src="${info.guidanceImage}" width="100px;" height="100px;" style="width: 100px;height: 100px;"></td>
- <td class="comitted">
- ${info.title}
- </td>
- <td>
- ${info.label}
- </td>
- <td>
- ${info.publisher}
- </td>
- <td>${empty info.realPraise?0:(info.realPraise)}</td>
- <td>${empty info.basePv?0:(info.basePv)}</td>
- <td>${empty info.pv?0:(info.pv)}</td>
- <td>${info.topPosition}</td>
- <%--<td>${empty info.priorityIndex?0:(info.priorityIndex)}</td>--%>
- <td><fmt:formatDate value="${info.pubdate}" pattern="yyyy-MM-dd HH:mm"/></td>
- <td><fmt:formatDate value="${info.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
- <td>
- <c:if test="${info.recommendStatus eq 1 }">
- <a href="javascript:void(0);" onclick="updateStatus('0','${info.id}','recommendStatus','${info.enabledStatus}');" >
- <img alt="启用" src="/static/images/yes.gif" width="15px" border="none" title="启用">
- </a>
- </c:if>
- <c:if test="${info.recommendStatus ne 1 }">
- <a href="javascript:void(0)" onclick="updateStatus('1','${info.id}','recommendStatus','${info.enabledStatus}');">
- <img alt="停用" src="/static/images/no.gif" width="15px" border="none" title="停用">
- </a>
- </c:if>
- </td>
- <td>
- <c:if test="${info.enabledStatus eq 1 }">
- <font color="green">已发布</font>
- <a href="javascript:void(0)" onclick="updateStatus('0','${info.id}','enabledStatus','${info.enabledStatus}');" style="cursor: pointer">暂不发布
- </a>
- </c:if>
- <c:if test="${info.enabledStatus ne 1 }">
- <font color="red">暂不发布</font>
- <a href="javascript:void(0)" onclick="updateStatus('1','${info.id}','enabledStatus','${info.enabledStatus}');" style="cursor: pointer">发布
- </a>
- </c:if>
- </td>
- <td hidden>
- <label id="homePageImage${index.index}">${info.homePageImage}</label>
- </td>
- <shiro:hasPermission name="info:info:edit"><td style="width: 150px">
- <a href="${fns:getConfig('wwwServer')}info/detail-${info.id}-1.html" target="_blank">查看</a>
- <a href="${ctx}/info/info/form?id=${info.id}">编辑</a>
- <shiro:hasPermission name="info:info:delete">
- <a href="${ctx}/info/info/delete?id=${info.id}" onclick="return confirmx('确认要删除该文章列表吗?', this.href)">删除</a>
- </shiro:hasPermission>
- <a href="javascript:void(0);" onclick="updateIndex('${info.id}');">更新索引</a>
- <a onclick="showTopSelect(${index.index},'open')" href="javascript:void(0)">首页置顶</a>
- <c:if test="${info.topPosition ne null}">
- <a onclick="updateTopPosition('','${info.id}','clearTopPosition')" href="javascript:void(0)">清除置顶</a>
- </c:if>
- <div style="display: none" class="topSelect" id="topSelect${index.index}" onmouseleave="showTopSelect(${index.index},'close')">
- <table style="border: 2px solid #000000;" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td><a onclick="updateTopPosition('1',${info.id},'setTopPosition')" href="javascript:void(0)">置顶第一位</a></td>
- </tr>
- <tr>
- <td><a onclick="updateTopPosition('2',${info.id},'setTopPosition')" href="javascript:void(0)">置顶第二位</a></td>
- </tr>
- <tr>
- <td><a onclick="updateTopPosition('3',${info.id},'setTopPosition')" href="javascript:void(0)">置顶第三位</a></td>
- </tr>
- </tbody>
- </table>
- </div>
- </td></shiro:hasPermission>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <div class="pagination">${page}</div>
- </body>
- </html>
|