Forráskód Böngészése

采美百科分类

Aslee 3 éve
szülő
commit
e7d382e406

+ 20 - 0
src/main/java/com/caimei/modules/baike/dao/CmBaikeTypeDao.java

@@ -0,0 +1,20 @@
+package com.caimei.modules.baike.dao;
+
+import com.thinkgem.jeesite.common.persistence.CrudDao;
+import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
+import com.caimei.modules.baike.entity.CmBaikeType;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 采美百科分类管理DAO接口
+ * @author Aslee
+ * @version 2021-11-19
+ */
+@MyBatisDao
+public interface CmBaikeTypeDao extends CrudDao<CmBaikeType> {
+
+    void updateStatus(@Param("status") Integer status, @Param("typeId") Integer typeId);
+
+    void saveSort(@Param("sort") String sort, @Param("typeId") String typeId);
+	
+}

+ 91 - 0
src/main/java/com/caimei/modules/baike/entity/CmBaikeType.java

@@ -0,0 +1,91 @@
+package com.caimei.modules.baike.entity;
+
+import org.hibernate.validator.constraints.Length;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+/**
+ * 采美百科分类管理Entity
+ * @author Aslee
+ * @version 2021-11-19
+ */
+public class CmBaikeType extends DataEntity<CmBaikeType> {
+	
+	private static final long serialVersionUID = 1L;
+	private Integer typeSort;		// 分类类型:1产品,2仪器
+	private String name;		// 分类名称
+	private Integer sort;		// 排序
+	private Integer status;		// 状态:0停用,1启用
+	private Date addTime;		// 添加时间
+	private Integer addBy;		// 添加人
+
+	private String addUserName;		//添加人名称
+	
+	public CmBaikeType() {
+		super();
+	}
+
+	public CmBaikeType(String id){
+		super(id);
+	}
+
+	public Integer getTypeSort() {
+		return typeSort;
+	}
+
+	public void setTypeSort(Integer typeSort) {
+		this.typeSort = typeSort;
+	}
+	
+	@Length(min=0, max=30, message="分类名称长度必须介于 0 和 30 之间")
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	public Integer getSort() {
+		return sort;
+	}
+
+	public void setSort(Integer sort) {
+		this.sort = sort;
+	}
+	
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+	
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	public Date getAddTime() {
+		return addTime;
+	}
+
+	public void setAddTime(Date addTime) {
+		this.addTime = addTime;
+	}
+	
+	public Integer getAddBy() {
+		return addBy;
+	}
+
+	public void setAddBy(Integer addBy) {
+		this.addBy = addBy;
+	}
+
+	public String getAddUserName() {
+		return addUserName;
+	}
+
+	public void setAddUserName(String addUserName) {
+		this.addUserName = addUserName;
+	}
+}

+ 44 - 0
src/main/java/com/caimei/modules/baike/service/CmBaikeTypeService.java

@@ -0,0 +1,44 @@
+package com.caimei.modules.baike.service;
+
+import java.util.List;
+
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.service.CrudService;
+import com.caimei.modules.baike.entity.CmBaikeType;
+import com.caimei.modules.baike.dao.CmBaikeTypeDao;
+
+/**
+ * 采美百科分类管理Service
+ * @author Aslee
+ * @version 2021-11-19
+ */
+@Service
+@Transactional(readOnly = true)
+public class CmBaikeTypeService extends CrudService<CmBaikeTypeDao, CmBaikeType> {
+
+	public CmBaikeType get(String id) {
+		return super.get(id);
+	}
+	
+	public List<CmBaikeType> findList(CmBaikeType cmBaikeType) {
+		return super.findList(cmBaikeType);
+	}
+	
+	public Page<CmBaikeType> findPage(Page<CmBaikeType> page, CmBaikeType cmBaikeType) {
+		return super.findPage(page, cmBaikeType);
+	}
+	
+	@Transactional(readOnly = false)
+	public void save(CmBaikeType cmBaikeType) {
+		super.save(cmBaikeType);
+	}
+	
+	@Transactional(readOnly = false)
+	public void delete(CmBaikeType cmBaikeType) {
+		super.delete(cmBaikeType);
+	}
+	
+}

+ 141 - 0
src/main/java/com/caimei/modules/baike/web/CmBaikeTypeController.java

@@ -0,0 +1,141 @@
+package com.caimei.modules.baike.web;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.caimei.modules.baike.dao.CmBaikeTypeDao;
+import com.google.common.collect.Maps;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import com.thinkgem.jeesite.common.config.Global;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import com.thinkgem.jeesite.common.utils.StringUtils;
+import com.caimei.modules.baike.entity.CmBaikeType;
+import com.caimei.modules.baike.service.CmBaikeTypeService;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static com.caimei.modules.newhome.web.NewPageQualitySupplierController.isInteger;
+
+/**
+ * 采美百科分类管理Controller
+ * @author Aslee
+ * @version 2021-11-19
+ */
+@Controller
+@RequestMapping(value = "${adminPath}/baike/cmBaikeType")
+public class CmBaikeTypeController extends BaseController {
+
+	@Autowired
+	private CmBaikeTypeService cmBaikeTypeService;
+
+	@Resource
+	private CmBaikeTypeDao cmBaikeTypeDao;
+	
+	@ModelAttribute
+	public CmBaikeType get(@RequestParam(required=false) String id) {
+		CmBaikeType entity = null;
+		if (StringUtils.isNotBlank(id)){
+			entity = cmBaikeTypeService.get(id);
+		}
+		if (entity == null){
+			entity = new CmBaikeType();
+		}
+		return entity;
+	}
+	
+	@RequestMapping(value = {"list", ""})
+	public String list(CmBaikeType cmBaikeType, HttpServletRequest request, HttpServletResponse response, Model model) {
+		Page<CmBaikeType> page = cmBaikeTypeService.findPage(new Page<CmBaikeType>(request, response), cmBaikeType); 
+		model.addAttribute("page", page);
+		return "modules/baike/cmBaikeTypeList";
+	}
+
+	@RequestMapping(value = "form")
+	public String form(CmBaikeType cmBaikeType, Model model) {
+		model.addAttribute("cmBaikeType", cmBaikeType);
+		return "modules/baike/cmBaikeTypeForm";
+	}
+
+	@RequestMapping(value = "save")
+	public String save(CmBaikeType cmBaikeType, Model model, RedirectAttributes redirectAttributes) {
+		if (!beanValidator(model, cmBaikeType)){
+			return form(cmBaikeType, model);
+		}
+		cmBaikeTypeService.save(cmBaikeType);
+		addMessage(redirectAttributes, "保存分类成功");
+		return "redirect:" + Global.getAdminPath() + "/baike/cmBaikeType/?repage&typeSort=" + cmBaikeType.getTypeSort();
+	}
+	
+	@RequestMapping(value = "delete")
+	public String delete(CmBaikeType cmBaikeType, RedirectAttributes redirectAttributes) {
+		cmBaikeTypeService.delete(cmBaikeType);
+		addMessage(redirectAttributes, "删除分类成功");
+		return "redirect:" + Global.getAdminPath() + "/baike/cmBaikeType/?repage&typeSort=" + cmBaikeType.getTypeSort();
+	}
+
+
+	@RequestMapping(value = "updateStatus")
+	@ResponseBody
+	public Map<String,Object> updateStatus(Integer status, Integer typeId) {
+		HashMap<String, Object> result = new HashMap<>(2);
+		cmBaikeTypeDao.updateStatus(status, typeId);
+		result.put("success", true);
+		result.put("msg", (status == 1 ? "启用" : "停用") + "分类成功");
+		return result;
+	}
+
+	/**
+	 * 批量更新排序值
+	 */
+	@RequestMapping(value = "batchSaveSort")
+	@ResponseBody
+	public Map<String, Object> batchSaveSort(String sortList) {
+		Map<String, Object> map = Maps.newLinkedHashMap();
+		try {
+			String[] newPageLists = sortList.split(",");
+			for (String list : newPageLists) {
+				String[] split = list.split("-");
+				if (split.length == 1 || split.length < 1) {
+					String id = split[0];
+					String sort = null;
+					cmBaikeTypeDao.saveSort(sort, id);
+				} else {
+					String id = split[0];
+					String sort = split[1];
+					if (isInteger(sort)) {
+						if (StringUtils.equals("0", sort)) {
+							map.put("success", false);
+							map.put("msg", "排序值只能填写大于等于1的整数");
+							return map;
+						}
+						cmBaikeTypeDao.saveSort(sort, id);
+					} else {
+						map.put("success", false);
+						map.put("msg", "排序值只能为数字");
+						return map;
+					}
+				}
+			}
+			map.put("success", true);
+			map.put("msg", "更新排序成功");
+			return map;
+		} catch (Exception e) {
+			map.put("success", false);
+			map.put("msg", "更新排序失败");
+			return map;
+		}
+	}
+
+}

+ 2 - 2
src/main/resources/mappings/modules/baike/CmBaikeHotSearchMapper.xml

@@ -43,7 +43,7 @@
 					<if test="dbName == 'mssql'">'%'+#{keyWord}+'%'</if>
 					<if test="dbName == 'mssql'">'%'+#{keyWord}+'%'</if>
 					<if test="dbName == 'mysql'">concat('%',#{keyWord},'%')</if>
 					<if test="dbName == 'mysql'">concat('%',#{keyWord},'%')</if>
 			</if>
 			</if>
-			<if test="status != null and status != ''">
+			<if test="status != null">
 				AND a.status = #{status}
 				AND a.status = #{status}
 			</if>
 			</if>
 		</where>
 		</where>
@@ -52,7 +52,7 @@
 				ORDER BY ${page.orderBy}
 				ORDER BY ${page.orderBy}
 			</when>
 			</when>
 			<otherwise>
 			<otherwise>
-				order by a.addTime desc
+				order by -sort desc, a.addTime desc
 			</otherwise>
 			</otherwise>
 		</choose>
 		</choose>
 	</select>
 	</select>

+ 117 - 0
src/main/resources/mappings/modules/baike/CmBaikeTypeMapper.xml

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei.modules.baike.dao.CmBaikeTypeDao">
+    
+	<sql id="cmBaikeTypeColumns">
+		a.id AS "id",
+		a.typeSort AS "typeSort",
+		a.name AS "name",
+		a.sort AS "sort",
+		a.status AS "status",
+		a.addTime AS "addTime",
+		a.addBy AS "addBy",
+		su.name as "addUserName"
+	</sql>
+	
+	<sql id="cmBaikeTypeJoins">
+		left join sys_user su on a.addBy = su.id
+	</sql>
+    
+	<select id="get" resultType="CmBaikeType">
+		SELECT 
+			<include refid="cmBaikeTypeColumns"/>
+		FROM cm_baike_type a
+		<include refid="cmBaikeTypeJoins"/>
+		WHERE a.id = #{id}
+	</select>
+	
+	<select id="findList" resultType="CmBaikeType">
+		SELECT 
+			<include refid="cmBaikeTypeColumns"/>
+		FROM cm_baike_type a
+		<include refid="cmBaikeTypeJoins"/>
+		<where>
+			
+			<if test="id != null and id != ''">
+				AND a.id = #{id}
+			</if>
+			<if test="name != null and name != ''">
+				AND a.name LIKE 
+					<if test="dbName == 'oracle'">'%'||#{name}||'%'</if>
+					<if test="dbName == 'mssql'">'%'+#{name}+'%'</if>
+					<if test="dbName == 'mysql'">concat('%',#{name},'%')</if>
+			</if>
+			<if test="status != null">
+				AND a.status = #{status}
+			</if>
+			<if test="typeSort != null">
+				and a.typeSort = #{typeSort}
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				order by -sort desc,a.addTime desc
+			</otherwise>
+		</choose>
+	</select>
+	
+	<select id="findAllList" resultType="CmBaikeType">
+		SELECT 
+			<include refid="cmBaikeTypeColumns"/>
+		FROM cm_baike_type a
+		<include refid="cmBaikeTypeJoins"/>
+		<where>
+			
+		</where>		
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+			</otherwise>
+		</choose>
+	</select>
+	
+	<insert id="insert" parameterType="CmBaikeType"  keyProperty="id" useGeneratedKeys="true">
+		INSERT INTO cm_baike_type(
+			typeSort,
+			name,
+			sort,
+			status,
+			addTime,
+			addBy
+		) VALUES (
+			#{typeSort},
+			#{name},
+			#{sort},
+			#{status},
+			NOW(),
+			#{createBy.id}
+		)
+	</insert>
+	
+	<update id="update">
+		UPDATE cm_baike_type SET 	
+			name = #{name},
+			sort = #{sort},
+			status = #{status}
+		WHERE id = #{id}
+	</update>
+	
+	<delete id="delete">
+		DELETE FROM cm_baike_type
+		WHERE id = #{id}
+	</delete>
+
+
+	<update id="updateStatus">
+		update cm_baike_type set status = #{status} where id = #{typeId}
+	</update>
+
+	<update id="saveSort">
+		update cm_baike_type set sort = #{sort} where id = #{typeId}
+	</update>
+</mapper>

+ 4 - 1
src/main/resources/mappings/modules/info/InfoMapper.xml

@@ -101,11 +101,14 @@
 			<if test="topPosition != null and topPosition != ''">
 			<if test="topPosition != null and topPosition != ''">
 				and topPosition = #{topPosition}
 				and topPosition = #{topPosition}
 			</if>
 			</if>
+			<if test="publishSource == null">
+				and publishSource = 1
+			</if>
 			<if test="publishSource != null">
 			<if test="publishSource != null">
 				and publishSource = #{publishSource}
 				and publishSource = #{publishSource}
 			</if>
 			</if>
 			<if test="auditStatus != null">
 			<if test="auditStatus != null">
-				and auditStatus = #{auditStatus}
+				and a.auditStatus = #{auditStatus}
 			</if>
 			</if>
 			<if test="shopName != null and shopName != ''">
 			<if test="shopName != null and shopName != ''">
 				AND s.name LIKE concat('%,',#{shopName},',%')
 				AND s.name LIKE concat('%,',#{shopName},',%')

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/baike/cmBaikeHotSearchList.jsp

@@ -30,7 +30,7 @@
 		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
 		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
 		<div class="ul-form">
 		<div class="ul-form">
 			 <label>ID:</label>
 			 <label>ID:</label>
-				<form:input path="id" htmlEscape="false" class="input-medium"/>
+				<form:input path="id" htmlEscape="false" maxlength="8" class="input-medium digits"/>
 			 <label>热搜词:</label>
 			 <label>热搜词:</label>
 				<form:input path="keyWord" htmlEscape="false" maxlength="15" class="input-medium"/>
 				<form:input path="keyWord" htmlEscape="false" maxlength="15" class="input-medium"/>
 			 <label>状态:</label>
 			 <label>状态:</label>
@@ -68,7 +68,7 @@
 					${cmBaikeHotSearch.keyWord}
 					${cmBaikeHotSearch.keyWord}
 				</td>
 				</td>
 				<td>
 				<td>
-					<input id="sort" name="sort" style="width:50px;" value="${cmBaikeHotSearch.sort}"  onkeyup="onlynum(this)"  onchange="changeSort(${cmHeheFloor.id},this)">
+					<input id="sort" name="sort" style="width:50px;" value="${cmBaikeHotSearch.sort}"  onkeyup="onlynum(this)"  onchange="changeSort(${cmBaikeHotSearch.id},this)">
 				</td>
 				</td>
 				<td>
 				<td>
 					<c:if test="${cmBaikeHotSearch.status eq 1 }">
 					<c:if test="${cmBaikeHotSearch.status eq 1 }">

+ 64 - 0
src/main/webapp/WEB-INF/views/modules/baike/cmBaikeTypeForm.jsp

@@ -0,0 +1,64 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>分类管理</title>
+	<meta name="decorator" content="default"/>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			//$("#name").focus();
+			$("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/baike/cmBaikeType/?typeSort=${cmBaikeType.typeSort}">${cmBaikeType.typeSort eq 1?'产品分类':'仪器分类'}</a></li>
+		<li class="active"><a href="${ctx}/baike/cmBaikeType/form?id=${cmBaikeType.id}&typeSort=${cmBaikeType.typeSort}">分类${not empty cmBaikeType.id?'编辑':'添加'}</a></li>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="cmBaikeType" action="${ctx}/baike/cmBaikeType/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="typeSort"/>
+		<sys:message content="${message}"/>		
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>分类名称:</label>
+			<div class="controls">
+				<form:input path="name" htmlEscape="false" maxlength="30" class="input-xlarge required"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label"><span class="help-inline"><font color="red">*</font> </span>排序:</label>
+			<div class="controls">
+				<form:input path="sort" htmlEscape="false" class="input-medium  digits required"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">状态:</label>
+			<div class="controls">
+				<form:select path="status" class="input-medium">
+					<form:option value="1" label="启用"/>
+					<form:option value="0" label="停用"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="form-actions">
+			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
+			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+		</div>
+	</form:form>
+</body>
+</html>

+ 155 - 0
src/main/webapp/WEB-INF/views/modules/baike/cmBaikeTypeList.jsp

@@ -0,0 +1,155 @@
+<%@ 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=${cmBaikeType.typeSort eq 1?"active":""}><a href="${ctx}/baike/cmBaikeType/?typeSort=1">产品分类</a></li>
+		<li class=${cmBaikeType.typeSort eq 2?"active":""}><a href="${ctx}/baike/cmBaikeType/?typeSort=2">仪器分类</a></li>
+	</ul>
+	<form:form id="searchForm" modelAttribute="cmBaikeType" action="${ctx}/baike/cmBaikeType/" method="post" class="breadcrumb form-search">
+		<form:hidden path="typeSort" />
+		<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 digits" maxlength="8"/>
+			 <label>分类名称:</label>
+				<form:input path="name" htmlEscape="false" maxlength="30" 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>
+			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
+			&nbsp;&nbsp;<input class="btn btn-primary" style="width: 50px"
+				   onclick="window.location='${ctx}/baike/cmBaikeType/form?typeSort=${cmBaikeType.typeSort}'" value="添加"/>
+			&nbsp;&nbsp;<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="cmBaikeType">
+			<tr>
+				<input class="check-item" type="hidden" id="saveSort${cmBaikeType.id}" value='${cmBaikeType.id}-${cmBaikeType.sort}'/>
+				<td>
+					${cmBaikeType.id}
+				</td>
+				<td>
+					${cmBaikeType.name}
+				</td>
+				<td>
+					<input id="sort" name="sort" style="width:50px;" value="${cmBaikeType.sort}"  onkeyup="onlynum(this)"  onchange="changeSort(${cmBaikeType.id},this)">
+				</td>
+				<td>
+					<c:if test="${cmBaikeType.status eq 1 }">
+						<font color="green">已启用</font>
+						<a href="javascript:void(0);" onclick="updateStatus(0,${cmBaikeType.id});" >
+							停用
+						</a>
+					</c:if>
+					<c:if test="${cmBaikeType.status ne 1 }">
+						<font color="red">已停用</font>
+						<a href="javascript:void(0)" onclick="updateStatus(1,${cmBaikeType.id});">
+							启用
+						</a>
+					</c:if>
+				</td>
+				<td>
+					<fmt:formatDate value="${cmBaikeType.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+				</td>
+				<td>
+					${cmBaikeType.addUserName}
+				</td>
+				<td>
+    				<a href="${ctx}/baike/cmBaikeType/form?id=${cmBaikeType.id}">编辑</a>
+					<a href="${ctx}/baike/cmBaikeType/delete?id=${cmBaikeType.id}" onclick="return confirmx('确认要删除该分类吗?', this.href)">删除</a>
+				</td>
+			</tr>
+		</c:forEach>
+		</tbody>
+	</table>
+	<div class="pagination">${page}</div>
+	<script>
+		function updateStatus(status, typeId) {
+			var msg='确定启用该热搜词吗?';
+			if(0==status) {
+				msg = '确定停用该热搜词吗?';
+			}
+			top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
+				if(v=='ok'){
+					$.post("${ctx}/baike/cmBaikeType/updateStatus",{'status':status,'typeId':typeId}, 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/cmBaikeType/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>