|
@@ -0,0 +1,222 @@
|
|
|
+<%@ 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: 60px;
|
|
|
+ background-color: white;
|
|
|
+ }
|
|
|
+ </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=${cmBaikeProduct.commodityType eq 1?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=1">产品</a></li>
|
|
|
+ <li class=${cmBaikeProduct.commodityType eq 2?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=2">仪器</a></li>
|
|
|
+ </ul>
|
|
|
+ <form:form id="searchForm" modelAttribute="cmBaikeProduct" action="${ctx}/baike/cmBaikeProduct/" method="post" class="breadcrumb form-search">
|
|
|
+ <form:hidden path="commodityType"/>
|
|
|
+ <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" class="input-medium"/>
|
|
|
+ <label>${commodityType}名称:</label>
|
|
|
+ <form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
|
|
|
+ <label>首页置顶:</label>
|
|
|
+ <form:select path="topFlag" class="input-medium">
|
|
|
+ <form:option value="" label="全部"/>
|
|
|
+ <form:option value="1" label="是"/>
|
|
|
+ <form:option value="0" label="否"/>
|
|
|
+ </form:select>
|
|
|
+ <label>${commodityType}分类:</label>
|
|
|
+ <form:select path="typeId" class="input-medium">
|
|
|
+ <form:option value="" label="全部"/>
|
|
|
+ <form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
|
|
|
+ </form:select>
|
|
|
+ <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="查询"/>
|
|
|
+ <a class="btn btn-primary" style="width: 50px" href="${ctx}/baike/cmBaikeProduct/form?commodityType=${cmBaikeProduct.commodityType}">添加</a>
|
|
|
+ <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>${commodityType}名称</th>
|
|
|
+ <th>${commodityType}分类</th>
|
|
|
+ <th>基础浏览量</th>
|
|
|
+ <th>实际浏览量</th>
|
|
|
+ <th>首页置顶位</th>
|
|
|
+ <th>发布时间</th>
|
|
|
+ <th>添加时间</th>
|
|
|
+ <th>状态</th>
|
|
|
+ <th>操作</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <c:forEach items="${page.list}" var="cmBaikeProduct" varStatus="index">
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ ${cmBaikeProduct.id}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ ${cmBaikeProduct.name}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ ${cmBaikeProduct.typeName}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ ${cmBaikeProduct.basePv}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ ${cmBaikeProduct.actualPv}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ ${cmBaikeProduct.topPosition eq 1?'第一位':cmBaikeProduct.topPosition eq 2?'第二位':cmBaikeProduct.topPosition eq 3?'第三位':''}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <fmt:formatDate value="${cmBaikeProduct.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <fmt:formatDate value="${cmBaikeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <c:if test="${cmBaikeProduct.status eq 1 }">
|
|
|
+ <font color="green">已启用</font>
|
|
|
+ <a href="javascript:void(0);" onclick="updateStatus(0,${cmBaikeProduct.id});" >
|
|
|
+ 停用
|
|
|
+ </a>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${cmBaikeProduct.status ne 1 }">
|
|
|
+ <font color="red">已停用</font>
|
|
|
+ <a href="javascript:void(0)" onclick="updateStatus(1,${cmBaikeProduct.id});">
|
|
|
+ 启用
|
|
|
+ </a>
|
|
|
+ </c:if>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <a target="_blank" href="${fns:getConfig('wwwServer')}encyclopedia/${cmBaikeProduct.commodityType eq 1?'product':'instrument'}-${cmBaikeProduct.id}.html">查看</a>
|
|
|
+ <a href="${ctx}/baike/cmBaikeProduct/form?id=${cmBaikeProduct.id}">编辑</a>
|
|
|
+ <a href="${ctx}/baike/cmBaikeProduct/delete?id=${cmBaikeProduct.id}" onclick="return confirmx('确认要删除该产品吗?', this.href)">删除</a>
|
|
|
+ <a onclick="showTopSelect(${index.index},'open')" href="javascript:void(0)">首页置顶</a>
|
|
|
+ <c:if test="${cmBaikeProduct.topPosition ne null}">
|
|
|
+ <a onclick="updateTopPosition('','${cmBaikeProduct.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',${cmBaikeProduct.id},'setTopPosition')" href="javascript:void(0)">置顶第一位</a></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td><a onclick="updateTopPosition('2',${cmBaikeProduct.id},'setTopPosition')" href="javascript:void(0)">置顶第二位</a></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td><a onclick="updateTopPosition('3',${cmBaikeProduct.id},'setTopPosition')" href="javascript:void(0)">置顶第三位</a></td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </c:forEach>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ <div class="pagination">${page}</div>
|
|
|
+<script type="text/javascript">
|
|
|
+ function updateStatus(status, productId) {
|
|
|
+ var commodityType = '${commodityType}'
|
|
|
+ var msg='确定启用该'+commodityType+'吗?';
|
|
|
+ if(0==status) {
|
|
|
+ msg = '确定停用该'+commodityType+'吗?';
|
|
|
+ }
|
|
|
+ top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
|
|
|
+ if(v=='ok'){
|
|
|
+ $.post("${ctx}/baike/cmBaikeProduct/updateStatus",{'status':status,'productId':productId}, function(data) {
|
|
|
+ if(true==data.success){
|
|
|
+ $.jBox.tip(data.msg, 'cmBaikeProduct');
|
|
|
+ } else {
|
|
|
+ $.jBox.tip(data.msg,'error');
|
|
|
+ }
|
|
|
+ setTimeout(function () {
|
|
|
+ $("#searchForm").submit();
|
|
|
+ },1000)
|
|
|
+ },"JSON");//这里返回的类型有:json,html,xml,text
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ },{buttonsFocus:1,persistent: true});
|
|
|
+ }
|
|
|
+
|
|
|
+ //展示置顶选项
|
|
|
+ function showTopSelect(index,status) {
|
|
|
+ if ('open' == status) {
|
|
|
+ document.getElementById("topSelect" + index).style.cssText = "display:block";
|
|
|
+ }else if ('close' == status) {
|
|
|
+ document.getElementById("topSelect" + index).style.cssText = "display:none";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //更新置顶
|
|
|
+ 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}/baike/cmBaikeProduct/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>
|
|
|
+</body>
|
|
|
+</html>
|