123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <%@ 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;}
- </style>
- <script type="text/javascript">
- $(document).ready(function() {
-
- });
- function page(n,s){
- $("#pageNo").val(n);
- $("#pageSize").val(s);
- $("#searchForm").submit();
- return false;
- }
- </script>
- </head>
- <body>
- <ul class="nav nav-tabs">
- <li class="active"><a href="${ctx}/baike/cmBaikeHotSearch/">热搜词列表</a></li>
- <li><a href="${ctx}/baike/cmBaikeHotSearch/form">热搜词添加</a></li>
- </ul>
- <form:form id="searchForm" modelAttribute="cmBaikeHotSearch" action="${ctx}/baike/cmBaikeHotSearch/" 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}"/>
- <div class="ul-form">
- <label>ID:</label>
- <form:input path="id" htmlEscape="false" maxlength="8" class="input-medium digits"/>
- <label>热搜词:</label>
- <form:input path="keyWord" htmlEscape="false" maxlength="15" class="input-medium"/>
- <label>状态:</label>
- <form:select path="status" class="input-medium">
- <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="查询"/>
- <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort()" 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>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="${page.list}" var="cmBaikeHotSearch">
- <tr>
- <input class="check-item" type="hidden" id="saveSort${cmBaikeHotSearch.id}" value='${cmBaikeHotSearch.id}-${cmBaikeHotSearch.sort}'/>
- <td>
- ${cmBaikeHotSearch.id}
- </td>
- <td>
- ${cmBaikeHotSearch.keyWord}
- </td>
- <td>
- <input id="sort" name="sort" style="width:50px;" value="${cmBaikeHotSearch.sort}" onkeyup="onlynum(this)" onchange="changeSort(${cmBaikeHotSearch.id},this)">
- </td>
- <td>
- <c:if test="${cmBaikeHotSearch.status eq 1 }">
- <font color="green">已启用</font>
- <a href="javascript:void(0);" onclick="updateStatus(0,${cmBaikeHotSearch.id});" >
- 停用
- </a>
- </c:if>
- <c:if test="${cmBaikeHotSearch.status ne 1 }">
- <font color="red">已停用</font>
- <a href="javascript:void(0)" onclick="updateStatus(1,${cmBaikeHotSearch.id});">
- 启用
- </a>
- </c:if>
- </td>
- <td>
- <fmt:formatDate value="${cmBaikeHotSearch.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
- </td>
- <td>
- ${cmBaikeHotSearch.addUserName}
- </td>
- <td>
- <a href="${ctx}/baike/cmBaikeHotSearch/form?id=${cmBaikeHotSearch.id}">编辑</a>
- <a href="${ctx}/baike/cmBaikeHotSearch/delete?id=${cmBaikeHotSearch.id}" onclick="return confirmx('确认要删除该热搜词吗?', this.href)">删除</a>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <div class="pagination">${page}</div>
- <script>
- function updateStatus(status, hotSearchId) {
- var msg='确定启用该热搜词吗?';
- if(0==status) {
- msg = '确定停用该热搜词吗?';
- }
- top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
- if(v=='ok'){
- $.post("${ctx}/baike/cmBaikeHotSearch/updateStatus",{'status':status,'hotSearchId':hotSearchId}, function(data) {
- if(true==data.success){
- $.jBox.tip(data.msg, 'info');
- } else {
- $.jBox.tip(data.msg,'error');
- }
- setTimeout(function () {
- $("#searchForm").submit();
- },1000)
- },"JSON");//这里返回的类型有:json,html,xml,text
- }
- return;
- },{buttonsFocus:1,persistent: true});
- }
- //批量保存排序
- function batchSaveSort() {
- var items = new Array();
- var $items = $('.check-item');
- $items.each(function(){
- items.push($(this).val());
- });
- //保存批量排序
- $.post("${ctx}/baike/cmBaikeHotSearch/batchSaveSort?sortList="+items, function(data) {
- if(true==data.success){
- $.jBox.tip(data.msg, 'info');
- setTimeout(function () {
- $("#searchForm").submit();
- },200)
- } else {
- $.jBox.tip(data.msg,'error');
- }
- },"JSON");//这里返回的类型有:json,html,xml,text
- }
- //修改排序值
- function changeSort(id,sortThis) {
- var value = sortThis.value;
- $("#saveSort"+id).val(id+"-"+value);
- }
- </script>
- </body>
- </html>
|