浏览代码

2019/12/06 18:01

jzdsh 5 年之前
父节点
当前提交
cee14c62a7

+ 49 - 0
src/main/java/com/yc/education/controller/admin/AdminNavbarController.java

@@ -0,0 +1,49 @@
+package com.yc.education.controller.admin;
+
+import com.github.pagehelper.PageInfo;
+import com.yc.education.model.AdminNavbar;
+import com.yc.education.service.IAdminNavbarService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.servlet.ModelAndView;
+
+import java.util.List;
+
+/**
+ * @ClassName AdminNavbarController
+ * @Description TODO
+ * @Author QuZhangJing
+ * @Date 2019/12/6 15:56
+ * @Version 1.0
+ */
+@Controller
+@RequestMapping("admin")
+public class AdminNavbarController {
+
+    @Autowired
+    private IAdminNavbarService  iAdminNavbarService;
+
+    @RequestMapping("adminNavbarList.html")
+    public ModelAndView adminNavbarList(
+            @RequestParam(defaultValue = "") String id,
+            @RequestParam(defaultValue = "") String name,
+            @RequestParam(defaultValue = "1")Integer pageNum,
+            @RequestParam(defaultValue = "10")Integer pageSize){
+        ModelAndView mav = new ModelAndView();
+        /*查询所有一级功能模块*/
+        List<AdminNavbar> listOneAdminNavbarInfo = iAdminNavbarService.listOneAdminNavbarInfo();
+        /*查询所有二级功能模块 */
+        List<AdminNavbar> listTwoAdminNavbarInfo  =  iAdminNavbarService.listTwoAdminNavbarInfo(id,name,pageNum,pageSize);
+
+        mav.addObject("pageInfo",new PageInfo<AdminNavbar>(listTwoAdminNavbarInfo));
+        mav.addObject("allOneAdminNavbarInfo",listOneAdminNavbarInfo);
+        mav.addObject("id",id);
+        mav.addObject("name",name);
+        mav.addObject("pageNum",pageNum);
+        mav.addObject("pageSize",pageSize);
+        return mav;
+    }
+
+}

+ 189 - 0
src/main/java/com/yc/education/controller/admin/AdminRoleController.java

@@ -0,0 +1,189 @@
+package com.yc.education.controller.admin;
+
+import com.github.pagehelper.PageInfo;
+import com.yc.education.model.AdminRole;
+import com.yc.education.service.IAdminRoleService;
+import com.yc.education.util.AjaxMessage;
+import org.apache.commons.beanutils.BeanUtils;
+import org.aspectj.weaver.loadtime.Aj;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+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.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * @ClassName AdminRoleController
+ * @Description  角色管理
+ * @Author QuZhangJing
+ * @Date 2019/12/6 9:19
+ * @Version 1.0
+ */
+@Controller
+@RequestMapping("admin")
+public class AdminRoleController {
+
+    @Autowired
+    private IAdminRoleService  iAdminRoleService;
+
+    /**
+     * 角色查询
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @RequestMapping("adminRoleList.html")
+    private ModelAndView adminRoleList(
+            @RequestParam(defaultValue = "1")Integer pageNum,
+            @RequestParam(defaultValue = "10")Integer pageSize){
+
+        ModelAndView mav = new ModelAndView();
+
+        List<AdminRole>  listAdminRoleInfo  =  iAdminRoleService.listAdminRoleInfo(pageNum,pageSize);
+
+        mav.addObject("pageInfo",new PageInfo<AdminRole>(listAdminRoleInfo));
+        mav.addObject("pageNum",pageNum);
+        mav.addObject("pageSize",pageSize);
+        return mav;
+    }
+
+    /**
+     * 添加跳转
+     * @return
+     */
+    @RequestMapping("adminRoleAdd.html")
+    public ModelAndView adminRoleAdd(){
+
+        ModelAndView mav = new ModelAndView();
+
+        List<AdminRole> listAdminRoleInfo = iAdminRoleService.listAdminRoleInfo();
+        mav.addObject("adminRole",listAdminRoleInfo);
+        return mav;
+    }
+
+    /**
+     * 角色添加
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("adminRoleAdds.html")
+    public AjaxMessage<Object> adminRoleAdds(HttpServletRequest request){
+        AjaxMessage<Object> am = new AjaxMessage<>();
+        AdminRole adminRole = new AdminRole();
+        try {
+            BeanUtils.populate(adminRole,request.getParameterMap());
+            if (adminRole != null){
+
+                adminRole.setState("0");
+                int rows = iAdminRoleService.save(adminRole);
+                if (rows > 0 ){
+                    am.setIs(true);
+                    am.setMsg("添加成功");
+                    return am;
+                }else {
+                    am.setIs(false);
+                    am.setMsg("添加失败");
+                    return am;
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return am;
+    }
+
+    /**
+     * 修改跳转
+     * @param id
+     * @return
+     */
+    @RequestMapping("adminRoleUpdate.html")
+    public ModelAndView adminRoleUpdate(Integer id){
+
+        ModelAndView mav = new ModelAndView();
+        AdminRole adminRole = iAdminRoleService.selectByKey(id);
+        List<AdminRole> listAdminRoleInfo = iAdminRoleService.listAdminRoleInfo();//查询所有角色
+        mav.addObject("adminRoleList",listAdminRoleInfo);
+        mav.addObject("adminRole",adminRole);
+        return mav;
+    }
+
+    /**
+     * 修改实现
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("adminRoleUpdates.html")
+    public AjaxMessage<Object> adminRoleUpdates(HttpServletRequest request){
+        AjaxMessage<Object> am = new AjaxMessage<>();
+        AdminRole adminRole = new AdminRole();
+        try {
+            BeanUtils.populate(adminRole,request.getParameterMap());
+            if (adminRole != null){
+                int row = iAdminRoleService.updateNotNull(adminRole);
+                if (row > 0){
+                    am.setIs(true);
+                    am.setMsg("修改成功");
+                    return  am;
+                }else {
+                    am.setIs(false);
+                    am.setMsg("修改失败");
+                    return am;
+                }
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return am;
+    }
+
+    /**
+     * 禁用
+     * @param id
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("shutDownState.html")
+    public AjaxMessage<Object> shutDownState(Integer id){
+        AjaxMessage<Object> am = new AjaxMessage<>();
+        AdminRole adminRole = new AdminRole();
+        if (id != null){
+           adminRole.setId(id);
+           adminRole.setState("1");//将启用状态修改为禁用  0 启用  1 禁用
+           int row = iAdminRoleService.updateNotNull(adminRole);
+           if (row > 0 ){
+               am.setIs(true);
+               return am;
+             }
+           }
+        return am;
+    }
+
+    /**
+     * 启用
+     * @param id
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("startUpState.html")
+    public AjaxMessage<Object>  startUpState(Integer id){
+        AjaxMessage<Object> am = new AjaxMessage<>();
+        AdminRole adminRole = new AdminRole();
+        if (id != null){
+            adminRole.setId(id);
+            adminRole.setState("0");//将禁用状态改为启用  1 禁用  0启用
+            int row = iAdminRoleService.updateNotNull(adminRole);
+            if (row > 0 ){
+                am.setIs(true);
+                return am;
+            }
+        }
+        return am;
+    }
+}

+ 43 - 0
src/main/java/com/yc/education/controller/admin/AdminsManageController.java

@@ -260,5 +260,48 @@ public class AdminsManageController {
         }
       return am;
     }
+    /**
+     * 禁用
+     * @param id
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("shutDownUser.html")
+    public AjaxMessage<Object> shutDownUser(Integer id){
+        AjaxMessage<Object> am = new AjaxMessage<>();
+        Admins admins = new Admins();
+        if (id != null){
+            admins.setId(id);
+            admins.setState("0");//将启用状态修改为禁用 1 启用  0 禁用
+            int row = adminsService.updateNotNull(admins);
+            if (row > 0 ){
+                am.setIs(true);
+                return am;
+            }
+        }
+        return am;
+    }
+
+    /**
+     * 启用
+     * @param id
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("startUpUser.html")
+    public AjaxMessage<Object>  startUpUser(Integer id){
+        AjaxMessage<Object> am = new AjaxMessage<>();
+        Admins admins = new Admins();
+        if (id != null){
+            admins.setId(id);
+            admins.setState("1");//将禁用状态改为启用   0禁用  1启用
+            int row = adminsService.updateNotNull(admins);
+            if (row > 0 ){
+                am.setIs(true);
+                return am;
+            }
+        }
+        return am;
+    }
 
 }

+ 14 - 0
src/main/java/com/yc/education/mapper/AdminNavbarMapper.java

@@ -0,0 +1,14 @@
+package com.yc.education.mapper;
+
+import com.yc.education.model.AdminNavbar;
+import com.yc.education.util.MyMapper;
+import org.apache.ibatis.annotations.Param;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+public interface AdminNavbarMapper extends MyMapper<AdminNavbar> {
+    List<AdminNavbar> listOneAdminNavbarInfo();
+
+    List<AdminNavbar> listTwoAdminNavbarInfo(@Param("id") String id,@Param("name") String name);
+}

+ 11 - 0
src/main/java/com/yc/education/mapper/AdminRoleMapper.java

@@ -0,0 +1,11 @@
+package com.yc.education.mapper;
+
+import com.yc.education.model.AdminRole;
+import com.yc.education.util.MyMapper;
+import tk.mybatis.mapper.common.Mapper;
+
+import java.util.List;
+
+public interface AdminRoleMapper extends MyMapper<AdminRole> {
+    List<AdminRole> listAdminRoleInfo();
+}

+ 146 - 0
src/main/java/com/yc/education/model/AdminNavbar.java

@@ -0,0 +1,146 @@
+package com.yc.education.model;
+
+import javax.persistence.*;
+
+@Table(name = "admin_navbar")
+public class AdminNavbar {
+    /**
+     * 主键
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 导航名称
+     */
+    private String name;
+
+    /**
+     * 父节点
+     */
+    private String pid;
+
+    /**
+     * 链接
+     */
+    private String url;
+
+    /**
+     * 描述
+     */
+    private String discription;
+
+    /**
+     * (0用,1禁)
+     */
+    private String use;
+
+    /**
+     * 获取主键
+     *
+     * @return id - 主键
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * 设置主键
+     *
+     * @param id 主键
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取导航名称
+     *
+     * @return name - 导航名称
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * 设置导航名称
+     *
+     * @param name 导航名称
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    /**
+     * 获取父节点
+     *
+     * @return pid - 父节点
+     */
+    public String getPid() {
+        return pid;
+    }
+
+    /**
+     * 设置父节点
+     *
+     * @param pid 父节点
+     */
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
+    /**
+     * 获取链接
+     *
+     * @return url - 链接
+     */
+    public String getUrl() {
+        return url;
+    }
+
+    /**
+     * 设置链接
+     *
+     * @param url 链接
+     */
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    /**
+     * 获取描述
+     *
+     * @return discription - 描述
+     */
+    public String getDiscription() {
+        return discription;
+    }
+
+    /**
+     * 设置描述
+     *
+     * @param discription 描述
+     */
+    public void setDiscription(String discription) {
+        this.discription = discription;
+    }
+
+    /**
+     * 获取(0用,1禁)
+     *
+     * @return use - (0用,1禁)
+     */
+    public String getUse() {
+        return use;
+    }
+
+    /**
+     * 设置(0用,1禁)
+     *
+     * @param use (0用,1禁)
+     */
+    public void setUse(String use) {
+        this.use = use;
+    }
+}

+ 127 - 0
src/main/java/com/yc/education/model/AdminRole.java

@@ -0,0 +1,127 @@
+package com.yc.education.model;
+
+import javax.persistence.*;
+
+@Table(name = "admin_role")
+public class AdminRole {
+    /**
+     * 主键
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 角色名称
+     */
+    private String name;
+
+    /**
+     * 说明
+     */
+    @Column(name="roleName")
+    private String roleName;
+
+    /**
+     * 父节点
+     */
+    private String pid;
+
+    /**
+     * (0启用,1禁用)
+     */
+    private String state;
+
+    /**
+     * 描述
+     */
+    private String discription;
+
+    /**
+     * 获取主键
+     *
+     * @return id - 主键
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * 设置主键
+     *
+     * @param id 主键
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取角色名称
+     *
+     * @return name - 角色名称
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * 设置角色名称
+     *
+     * @param name 角色名称
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    /**
+     * 获取父节点
+     *
+     * @return pid - 父节点
+     */
+    public String getPid() {
+        return pid;
+    }
+
+    /**
+     * 设置父节点
+     *
+     * @param pid 父节点
+     */
+    public void setPid(String pid) {
+        this.pid = pid;
+    }
+
+    public String getRoleName() {
+        return roleName;
+    }
+
+    public void setRoleName(String roleName) {
+        this.roleName = roleName;
+    }
+
+    /**
+     * 获取描述
+     *
+     * @return discription - 描述
+     */
+    public String getDiscription() {
+        return discription;
+    }
+
+    /**
+     * 设置描述
+     *
+     * @param discription 描述
+     */
+    public void setDiscription(String discription) {
+        this.discription = discription;
+    }
+}

+ 18 - 0
src/main/java/com/yc/education/service/IAdminNavbarService.java

@@ -0,0 +1,18 @@
+package com.yc.education.service;
+
+import com.yc.education.model.AdminNavbar;
+
+import java.util.List;
+
+/**
+ * @ClassName IAdminNavbarController
+ * @Description TODO
+ * @Author QuZhangJing
+ * @Date 2019/12/6 15:51
+ * @Version 1.0
+ */
+public interface IAdminNavbarService extends IService<AdminNavbar>{
+    List<AdminNavbar> listOneAdminNavbarInfo();
+
+    List<AdminNavbar> listTwoAdminNavbarInfo(String id, String name, Integer pageNum, Integer pageSize);
+}

+ 20 - 0
src/main/java/com/yc/education/service/IAdminRoleService.java

@@ -0,0 +1,20 @@
+package com.yc.education.service;
+
+import com.yc.education.model.AdminRole;
+
+import java.util.List;
+
+/**
+ * @ClassName IAdminRoleService
+ * @Description TODO
+ * @Author QuZhangJing
+ * @Date 2019/12/6 9:11
+ * @Version 1.0
+ */
+public interface IAdminRoleService extends IService<AdminRole> {
+    List<AdminRole> listAdminRoleInfo(Integer pageNum, Integer pageSize);
+
+    List<AdminRole> listAdminRoleInfo();
+
+    int saveNotNull(AdminRole adminRole);
+}

+ 46 - 0
src/main/java/com/yc/education/service/impl/AdminNavbarServiceImpl.java

@@ -0,0 +1,46 @@
+package com.yc.education.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.yc.education.mapper.AdminNavbarMapper;
+import com.yc.education.model.AdminNavbar;
+import com.yc.education.service.IAdminNavbarService;
+import org.apache.tools.ant.taskdefs.Echo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @ClassName AdminNavbarServiceImpl
+ * @Description TODO
+ * @Author QuZhangJing
+ * @Date 2019/12/6 15:53
+ * @Version 1.0
+ */
+@Service
+public class AdminNavbarServiceImpl extends BaseService<AdminNavbar> implements IAdminNavbarService {
+
+    @Autowired
+    private AdminNavbarMapper mapper;
+
+    @Override
+    public List<AdminNavbar> listOneAdminNavbarInfo() {
+        try {
+            return  mapper.listOneAdminNavbarInfo();
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public List<AdminNavbar> listTwoAdminNavbarInfo(String id, String name, Integer pageNum, Integer pageSize) {
+        try {
+            PageHelper.startPage(pageNum,pageSize);
+            return  mapper.listTwoAdminNavbarInfo(id,name);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+}

+ 52 - 0
src/main/java/com/yc/education/service/impl/AdminRoleServiceImpl.java

@@ -0,0 +1,52 @@
+package com.yc.education.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.yc.education.mapper.AdminRoleMapper;
+import com.yc.education.model.AdminRole;
+import com.yc.education.service.IAdminRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @ClassName AdminRoleServiceImpl
+ * @Description TODO
+ * @Author QuZhangJing
+ * @Date 2019/12/6 9:12
+ * @Version 1.0
+ */
+@Service
+public class AdminRoleServiceImpl extends BaseService<AdminRole> implements IAdminRoleService {
+    @Autowired
+    private AdminRoleMapper mapper;
+
+
+    @Override
+    public List<AdminRole> listAdminRoleInfo(Integer pageNum, Integer pageSize) {
+        try {
+            PageHelper.startPage(pageNum,pageSize);
+            return  mapper.listAdminRoleInfo();
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public List<AdminRole> listAdminRoleInfo() {
+        try {
+            return  mapper.listAdminRoleInfo();
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public int saveNotNull(AdminRole adminRole) {
+        return mapper.insertSelective(adminRole);
+    }
+
+
+}

+ 35 - 0
src/main/resources/mapper/AdminNavbarMapper.xml

@@ -0,0 +1,35 @@
+<?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.yc.education.mapper.AdminNavbarMapper">
+  <resultMap id="BaseResultMap" type="com.yc.education.model.AdminNavbar">
+    <!--
+      WARNING - @mbggenerated
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="pid" jdbcType="VARCHAR" property="pid" />
+    <result column="url" jdbcType="VARCHAR" property="url" />
+    <result column="discription" jdbcType="VARCHAR" property="discription" />
+    <result column="use" jdbcType="CHAR" property="use" />
+  </resultMap>
+
+  <!--查询功能模块 一级功能-->
+  <select id="listOneAdminNavbarInfo" resultMap="BaseResultMap">
+    select * from admin_navbar  where pid = 0
+  </select>
+
+  <!--查询功能模块 二级功能-->
+  <select id="listTwoAdminNavbarInfo" resultMap="BaseResultMap">
+    select * from admin_navbar
+    <where>
+      pid != 0
+      <if test="id != null and id != ''">
+        and pid = #{id}
+      </if>
+      <if test="name != null and name != ''">
+        and name like concat ('%',#{name},'%')
+      </if>
+    </where>
+    order by id asc
+  </select>
+</mapper>

+ 18 - 0
src/main/resources/mapper/AdminRoleMapper.xml

@@ -0,0 +1,18 @@
+<?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.yc.education.mapper.AdminRoleMapper">
+  <resultMap id="BaseResultMap" type="com.yc.education.model.AdminRole">
+    <!--
+      WARNING - @mbggenerated
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="name" jdbcType="VARCHAR" property="name" />
+    <result column="roleName" jdbcType="VARCHAR" property="roleName" />
+    <result column="pid" jdbcType="VARCHAR" property="pid" />
+    <result column="state" jdbcType="CHAR" property="state" />
+    <result column="discription" jdbcType="VARCHAR" property="discription" />
+  </resultMap>
+  <select id="listAdminRoleInfo" resultMap="BaseResultMap">
+    select * from admin_role
+  </select>
+</mapper>

+ 264 - 0
src/main/webapp/WEB-INF/jsp/admin/adminNavbarList.jsp

@@ -0,0 +1,264 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>后台管理</title>
+
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui/css/H-ui.min.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/H-ui.admin.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/Hui-iconfont/1.0.8/iconfont.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/skin/default/skin.css" id="skin"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/style.css"/>
+    <link href="${pageContext.request.contextPath}/static/admin/css/page.css" rel="stylesheet" type="text/css"/>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/jquery/1.9.1/jquery.min.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/h-ui/js/H-ui.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/js/H-ui.admin.js"></script>
+</head>
+<body>
+<nav class="breadcrumb">
+    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 模块管理
+    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="page-container">
+<form action="adminsList.html" method="post" enctype="multipart/form-data">
+    <div class="text-c">
+
+        <input  type="text" name="name" id="searchName" value="" placeholder="名称"  style="width:250px" class="input-text">
+
+        <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+    </div>
+</form>
+<div class="page-container">
+    <div class="cl pd-5 bg-1 bk-gray mt-20">
+			<span class="l">
+				<a class="btn btn-primary radius"   onclick="adminNavbar_add('模块添加','adminNavbarAdd.html','1200','510')" ><i
+                        class="Hui-iconfont">&#xe600;</i> 模块添加</a>
+                <i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i>
+			</span>
+        <span class="r">共有数据:<strong>${pageInfo.total}</strong> 条</span>
+    </div>
+
+    <div class="mt-20">
+        <c:forEach items="${allOneAdminNavbarInfo}" var="one">
+            <a class="btn btn-primary radius" <c:if test="${one.id == id}">style="background-color:#0a6999"</c:if>  href="adminNavbarList.html?id=${one.id}" style="letter-spacing: 10px;">${one.name}</a>
+        </c:forEach>
+        <table class="table table-border table-bordered table-bg table-hover table-sort" style="table-layout:fixed">
+            <thead>
+            <tr class="text-c" >
+                <th width="100">ID</th>
+                <th width="120">模块名称</th>
+                <th width="120">链接路径</th>
+                <th width="120">功能描述</th>
+                <th width="150">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <c:forEach items="${pageInfo.list}" var="adminNavbar">
+                <tr class="text-c">
+                    <td class="text-l">
+                            ${adminNavbar.id}
+                    </td>
+
+                    <td class="text-l" >
+                            ${adminNavbar.name}
+                    </td>
+                    <td class="text-l" >
+                            ${adminNavbar.url}
+                    </td>
+
+                    <td class="text-l" title="${role.discription}">
+                        <div style="overflow: hidden;-o-text-overflow: ellipsis;
+                        text-overflow: ellipsis;white-space: nowrap;display: block"><%--将超出字体用....代替--%>
+                                ${adminNavbar.discription}
+                        </div>
+                    </td>
+
+                    <td class="f-14 td-manage">
+                        <c:if test="${role.state == 0}">
+                            <a style="text-decoration:none" class="ml-5" onclick="shutDown(${role.id})" title="禁用">
+                                <i class="Hui-iconfont" style="color: red;font-size: small">禁用</i></a>
+                        </c:if>
+                        <c:if test="${role.state == 1}">
+                            <a style="text-decoration:none" class="ml-5" onclick="startUp(${role.id})" title="启用">
+                                <i class="Hui-iconfont" style="color: green;font-size: small">启用</i></a>
+                        </c:if>
+
+                        <a style="text-decoration:none" class="ml-5" onclick="adminNavbar_update('模块修改','adminNavbarUpdate.html?id=${adminNavbar.id}','1200','510')" title="查看"><i
+                                class="Hui-iconfont">&#xe6df;</i></a>
+
+                    </td>
+                </tr>
+            </c:forEach>
+            </tbody>
+        </table>
+    </div>
+</div>
+
+    <div id="PageNum">
+        <section>
+            <div class="bd points-goods-list">
+                <ul class="pages">
+                    <select name="pageSize"  onchange="pageSizeChoose(this.value)" id="pageSize">
+                        <option value="5" <c:if test="${pageInfo.pageSize =='5'}">selected="selected"</c:if> >5</option>
+                        <option value="10" <c:if test="${pageInfo.pageSize == '10'}">selected="selected"</c:if>>10</option>
+                        <option value="30"<c:if test="${pageInfo.pageSize == '30'}">selected="selected"</c:if>>30</option>
+                        <option value="50"<c:if test="${pageInfo.pageSize == '50'}">selected="selected"</c:if>>50</option>
+                        <option value="100"<c:if test="${pageInfo.pageSize == '100'}">selected="selected"</c:if>>100</option>
+                    </select>
+                    <li><a href="adminNavbarList.html?id=${id}&name=${name}&pageNum=1&pageSize=${pageInfo.pageSize}">首页</a></li>
+                    <li class="prev"><a
+                            href="adminNavbarList.html?id=${id}&name=${name}&pageNum=${pageInfo.prePage}&pageSize=${pageInfo.pageSize}">上一页</a>
+                    </li>
+                    <c:forEach items="${pageInfo.navigatepageNums}" var="nav">
+                        <c:if test="${nav == pageInfo.pageNum}">
+                            <li><a href="adminNavbarList.html?id=${id}&name=${name}&pageNum=${nav}&pageSize=${pageInfo.pageSize}"
+                                   class="active">${nav}</a></li>
+                        </c:if>
+                        <c:if test="${nav != pageInfo.pageNum}">
+                            <li>
+                                <a href="adminNavbarList.html?id=${id}&name=${name}&pageNum=${nav}&pageSize=${pageInfo.pageSize}">${nav}</a>
+                            </li>
+                        </c:if>
+                    </c:forEach>
+                    <li class="next"><a
+                            href="adminNavbarList.html?id=${id}&name=${name}&pageNum=${pageInfo.nextPage}&pageSize=${pageInfo.pageSize}">下一页</a>
+                    </li>
+                    <li>
+                        <a href="adminNavbarList.html?id=${id}&name=${name}&pageNum=${pageInfo.pages }&pageSize=${pageInfo.pageSize}">末页</a>
+                    </li>
+                </ul>
+            </div>
+        </section>
+    </div>
+</div>
+</div>
+<script type="text/javascript">
+
+    /*角色添加*/
+    function adminNavbar_add(title,url,w,h) {
+        layer_show(title,url,w,h);
+    }
+    /*角色修改*/
+    function adminNavbar_update(title,url,w,h) {
+        layer_show(title,url,w,h);
+    }
+    /*角色禁用*/
+    function shutDown(idVal) {
+        var id = idVal;
+        $.ajax({
+            type:"POST",
+            url:"shutDownState.html",
+            data:{"id":id},
+            dataType:"json",
+            success:function (ajax) {
+                if (ajax.is){
+                    window.location.href="adminRoleList.html"
+                }
+            }
+
+        })
+    }
+    /*角色启用*/
+    function startUp(idVal) {
+        var id = idVal;
+        $.ajax({
+            type:"POST",
+            url:"startUpState.html",
+            data:{"id":id},
+            dataType:"json",
+            success:function (ajax) {
+                if (ajax.is){
+                    window.location.href="adminRoleList.html";
+                }
+            }
+        })
+    }
+    <%--每页条数选择--%>
+    function pageSizeChoose(pageSizeVal){
+        location.href="adminNavbarList.html?id=${id}&name=${name}pageSize="+pageSizeVal;
+    }
+    //全选与反选
+    $("#sltall").click(function () {
+        if ($(this).prop("checked")) {
+            $("[name='id']").prop("checked", true);//全选
+        } else {
+            $("[name='id']").prop("checked", false);//取消全选
+        }
+    });
+
+
+    function downs() {
+        var chkvalue = "";//定义一个数组
+        $("input[name='id']:checked").each(function () {
+            chkvalue += $(this).val() + ",";
+        });
+        window.location.href = "signexcels.html?chkvalue=" + chkvalue;
+    };
+
+    function del(id) {
+        layer.confirm('确认要删除吗?', function (index) {
+            $.post("activityNewsDel.html", {id: id}, function (data) {
+                if (data.is) {
+                    layer.alert(data.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                        window.location = window.location;
+                    });
+                } else {
+                    layer.msg(data.msg, {icon: 2, time: 1000});
+                }
+            }, "json");
+        });
+    }
+
+    $("#delete").click(function(){
+        //判断是否至少选择一项
+        var checkedNum =$("input[name='ck_pro']:checked").length;
+        if(checkedNum==0){
+            layer.msg("请至少选择一个!",{icon:2,time:1000});
+            return;
+        }
+        layer.confirm('确认要删除所选项吗?',function(index){
+            var checkList= new Array();
+            $("input[name='ck_pro']:checked").each(function(){
+                checkList.push($(this).val());
+            });
+            $.ajax({
+                type:"POST",
+                url:"activityNewsDel.html",
+                data:{
+                    "id":checkList.toString()
+                },
+                dataType:"json",
+                success:function(ajax){
+                    if(ajax.is){
+                        layer.alert(ajax.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                            window.location = window.location;
+                        });
+                        $(":checkbox").prop("checked", false);
+                    }else{
+                        layer.msg(ajax.msg,{icon:2,time:1000});
+                    }
+                }
+            })
+        })
+    });
+    $("#checked_all").click(function(){
+        $("input[name='ck_pro']").prop("checked",this.checked);
+
+    })
+</script>
+</body>
+</html>

+ 207 - 0
src/main/webapp/WEB-INF/jsp/admin/adminRoleAdd.jsp

@@ -0,0 +1,207 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%
+    String base = pageContext.getServletContext().getContextPath();
+%>
+<!--_meta 作为公共模版分离出去-->
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <script type="text/javascript">
+        window.UEDITOR_SERVER_URL = '<%=base%>';
+    </script>
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
+    <meta http-equiv="Cache-Control" content="no-siteapp"/>
+    <LINK rel="Bookmark" href="/favicon.ico">
+    <LINK rel="Shortcut Icon" href="/favicon.ico"/>
+
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui/css/H-ui.min.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/H-ui.admin.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/Hui-iconfont/1.0.8/iconfont.css"/>
+    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/admin/icheck/icheck.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/skin/default/skin.css" id="skin"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/style.css"/>
+
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/jquery/1.9.1/jquery.min.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/js/jquery.validate.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/js/validate-methods.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/js/messages_zh.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/icheck/jquery.icheck.min.js"></script>
+    <script src="${pageContext.request.contextPath}/static/admin/manage/js/WdatePicker.js"></script>
+
+    <script type="text/javascript">
+        $(function () {
+            $("#sub").click(function () {
+                var id = $("#id").val();
+                var explain = $("#roleName").val();
+                /*var discription = $("#discription").val();*/
+                if (id == null ||  id== '') {
+                    layer.msg("请选择父级角色~");
+                    return false;
+                }
+                if (explain == null || explain == '') {
+                    layer.msg("角色名称不能为空~");
+                    return false;
+                }
+               /* if (discription == null || discription == '') {
+                    layer.msg("角色名称不能为空~");
+                    return false;
+                }*/
+               var formData =  new FormData();
+               formData.append("pid",$("#id").val());//父类id
+               formData.append("roleName",$("#roleName").val());//角色名称
+               formData.append("discription",$("#discription").val());//描述
+
+                $.ajax({
+                    type:"POST",
+                    url:"adminRoleAdds.html",
+                    data:formData,
+                    dataType:"json",
+                    cache: false,
+                    async : false,
+                    processData: false,
+                    contentType: false,
+
+                    success:function (ajax) {
+                        if (ajax.is){
+                            layer.msg(ajax.msg);
+                            layer.alert(ajax.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                                var index = parent.layer.getFrameIndex(window.name);
+                                parent.layer.close(index);
+                            });
+                        }else {
+                            layer.msg(ajax.msg);
+                        }
+                    }
+                })
+
+            });
+        });
+    </script>
+
+    <title>管理员管理</title>
+</head>
+<body>
+<nav class="breadcrumb">
+    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span><a href="javascript:history.go(-1)" title="角色列表">角色列表</a><span class="c-gray en">&gt;</span> 添加
+    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container">
+    <form  class="form form-horizontal" id="subform">
+
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>父级角色:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <select name="pId" id="id" class="input-text" >
+                    <option value="">请选择</option>
+                    <c:forEach items="${adminRole}" var="role">
+                        <option value="${role.id}">${role.roleName}</option>
+                    </c:forEach>
+                </select>
+            </div>
+        </div>
+
+
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>角色名称:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="roleName" id="roleName">
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red"></span>描述:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <textarea name="discription" id="discription" cols="" rows="" class="textarea"></textarea>
+            </div>
+
+        </div>
+
+
+        <div class="row cl">
+            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-1">
+                <button type="button" class="btn btn-primary radius" id="sub" name="admin-role-save"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
+            </div>
+        </div>
+    </form>
+</article>
+
+<!--请在下方写此页面业务相关的脚本-->
+<!-- 百度文本编辑器   引用文件 -->
+<link href="<%=base%>/static/ue/themes/default/css/ueditor.css" type="text/css" rel="stylesheet">
+<script src="<%=base%>/static/ue/ueditor.config.js" type="text/javascript"></script>
+<script src="<%=base%>/static/ue/ueditor.all.js" type="text/javascript"></script>
+<script type="text/javascript" src="<%=base%>/static/ue/lang/zh-cn/zh-cn.js"></script>
+
+<!-- 百度文本编辑器   js -->
+<script type="text/javascript">
+    $(function () {
+        var ue = UE.getEditor('introduction', {
+            //关闭字数统计
+            wordCount: false,
+            toolbars: [['fullscreen', 'source', '|', 'undo', 'redo', '|',
+                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
+                'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
+                'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
+                'directionalityltr', 'directionalityrtl', 'indent', '|',
+                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
+                'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
+                'insertimage', 'emotion', 'insertvideo', 'attachment', 'map', 'template', 'background', '|',
+                'horizontal', 'date', 'time', 'spechars', 'wordimage', '|',
+                'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
+                'print', 'preview', 'searchreplace', 'help'
+            ]],
+            //关闭elementPath
+            elementPathEnabled: false,
+        });
+    });
+
+
+    var currentBrowserId;
+
+    function browserImage(targetId) {
+        currentBrowserId = targetId;
+        var weboxTemp = $.webox({
+            height: 600,
+            width: 1024,
+            bgvisibel: true,
+            title: '图片管理',
+            iframe: '<%=base%>/admin/image/imgbox.html?' + Math.random()
+        });
+    }
+
+    function setImagepath(imgPath) {
+        $('#' + currentBrowserId).val(imgPath);
+    }
+
+    function closeFrame() {
+        $('#locked .span').click();
+    }
+</script>
+
+
+<!--请在下方写此页面业务相关的脚本-->
+<script type="text/javascript">
+</script>
+<!--/请在上方写此页面业务相关的脚本-->
+</body>
+</html>

+ 248 - 0
src/main/webapp/WEB-INF/jsp/admin/adminRoleList.jsp

@@ -0,0 +1,248 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>后台管理</title>
+
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui/css/H-ui.min.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/H-ui.admin.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/Hui-iconfont/1.0.8/iconfont.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/skin/default/skin.css" id="skin"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/style.css"/>
+    <link href="${pageContext.request.contextPath}/static/admin/css/page.css" rel="stylesheet" type="text/css"/>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/jquery/1.9.1/jquery.min.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/h-ui/js/H-ui.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/js/H-ui.admin.js"></script>
+</head>
+<body>
+<nav class="breadcrumb">
+    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 角色列表
+    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="page-container">
+    <div class="cl pd-5 bg-1 bk-gray mt-20">
+			<span class="l">
+				<a class="btn btn-primary radius"   onclick="adminRole_add('角色添加','adminRoleAdd.html','1200','510')" ><i
+                        class="Hui-iconfont">&#xe600;</i> 添加角色</a>
+                <i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i>
+			</span>
+        <span class="r">共有数据:<strong>${pageInfo.total}</strong> 条</span>
+    </div>
+
+
+    <div class="mt-20">
+        <table class="table table-border table-bordered table-bg table-hover table-sort" style="table-layout:fixed">
+            <thead>
+            <tr class="text-c" >
+                <th width="100">ID</th>
+                <th width="120">角色名称</th>
+                <th width="120">角色描述</th>
+                <th width="150">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <c:forEach items="${pageInfo.list}" var="role">
+                <tr class="text-c">
+                    <td class="text-l">
+                            ${role.id}
+                    </td>
+
+                    <td class="text-l" >
+                            ${role.roleName}
+                    </td>
+
+                    <td class="text-l" title="${role.discription}">
+                        <div style="overflow: hidden;-o-text-overflow: ellipsis;
+                        text-overflow: ellipsis;white-space: nowrap;display: block"><%--将超出字体用....代替--%>
+                                ${role.discription}
+                        </div>
+                    </td>
+
+                    <td class="f-14 td-manage">
+                        <c:if test="${role.state == 0}">
+                            <a style="text-decoration:none" class="ml-5" onclick="shutDown(${role.id})" title="禁用">
+                                <i class="Hui-iconfont" style="color: red;font-size: small">禁用</i></a>
+                        </c:if>
+                        <c:if test="${role.state == 1}">
+                            <a style="text-decoration:none" class="ml-5" onclick="startUp(${role.id})" title="启用">
+                                <i class="Hui-iconfont" style="color: green;font-size: small">启用</i></a>
+                        </c:if>
+
+                        <a style="text-decoration:none" class="ml-5" onclick="adminRole_update('角色修改','adminRoleUpdate.html?id=${role.id}','1200','510')" title="查看"><i
+                                class="Hui-iconfont">&#xe6df;</i></a>
+
+                    </td>
+                </tr>
+            </c:forEach>
+            </tbody>
+        </table>
+    </div>
+
+    <div id="PageNum">
+        <section>
+            <div class="bd points-goods-list">
+                <ul class="pages">
+                    <select name="pageSize"  onchange="pageSizeChoose(this.value)" id="pageSize">
+                        <option value="5" <c:if test="${pageInfo.pageSize =='5'}">selected="selected"</c:if> >5</option>
+                        <option value="10" <c:if test="${pageInfo.pageSize == '10'}">selected="selected"</c:if>>10</option>
+                        <option value="30"<c:if test="${pageInfo.pageSize == '30'}">selected="selected"</c:if>>30</option>
+                        <option value="50"<c:if test="${pageInfo.pageSize == '50'}">selected="selected"</c:if>>50</option>
+                        <option value="100"<c:if test="${pageInfo.pageSize == '100'}">selected="selected"</c:if>>100</option>
+                    </select>
+                    <li><a href="adminRoleList.html?&pageNum=1&pageSize=${pageInfo.pageSize}">首页</a></li>
+                    <li class="prev"><a
+                            href="adminRoleList.html?&pageNum=${pageInfo.prePage}&pageSize=${pageInfo.pageSize}">上一页</a>
+                    </li>
+                    <c:forEach items="${pageInfo.navigatepageNums}" var="nav">
+                        <c:if test="${nav == pageInfo.pageNum}">
+                            <li><a href="adminRoleList.html?&pageNum=${nav}&pageSize=${pageInfo.pageSize}"
+                                   class="active">${nav}</a></li>
+                        </c:if>
+                        <c:if test="${nav != pageInfo.pageNum}">
+                            <li>
+                                <a href="adminRoleList.html?&pageNum=${nav}&pageSize=${pageInfo.pageSize}">${nav}</a>
+                            </li>
+                        </c:if>
+                    </c:forEach>
+                    <li class="next"><a
+                            href="adminRoleList.html?&pageNum=${pageInfo.nextPage}&pageSize=${pageInfo.pageSize}">下一页</a>
+                    </li>
+                    <li>
+                        <a href="adminRoleList.html?&pageNum=${pageInfo.pages }&pageSize=${pageInfo.pageSize}">末页</a>
+                    </li>
+                </ul>
+            </div>
+        </section>
+    </div>
+</div>
+</div>
+<script type="text/javascript">
+
+    /*角色添加*/
+    function adminRole_add(title,url,w,h) {
+        layer_show(title,url,w,h);
+    }
+    /*角色修改*/
+    function adminRole_update(title,url,w,h) {
+        layer_show(title,url,w,h);
+    }
+    /*角色禁用*/
+    function shutDown(idVal) {
+        var id = idVal;
+        $.ajax({
+            type:"POST",
+            url:"shutDownState.html",
+            data:{"id":id},
+            dataType:"json",
+            success:function (ajax) {
+                if (ajax.is){
+                    window.location.href="adminRoleList.html"
+                }
+            }
+
+        })
+    }
+    /*角色启用*/
+    function startUp(idVal) {
+        var id = idVal;
+        $.ajax({
+            type:"POST",
+            url:"startUpState.html",
+            data:{"id":id},
+            dataType:"json",
+            success:function (ajax) {
+                if (ajax.is){
+                    window.location.href="adminRoleList.html";
+                }
+            }
+        })
+    }
+    <%--每页条数选择--%>
+    function pageSizeChoose(pageSizeVal){
+        location.href="adminRoleList.html?pageSize="+pageSizeVal;
+    }
+    //全选与反选
+    $("#sltall").click(function () {
+        if ($(this).prop("checked")) {
+            $("[name='id']").prop("checked", true);//全选
+        } else {
+            $("[name='id']").prop("checked", false);//取消全选
+        }
+    });
+
+
+    function downs() {
+        var chkvalue = "";//定义一个数组
+        $("input[name='id']:checked").each(function () {
+            chkvalue += $(this).val() + ",";
+        });
+        window.location.href = "signexcels.html?chkvalue=" + chkvalue;
+    };
+
+    function del(id) {
+        layer.confirm('确认要删除吗?', function (index) {
+            $.post("activityNewsDel.html", {id: id}, function (data) {
+                if (data.is) {
+                    layer.alert(data.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                        window.location = window.location;
+                    });
+                } else {
+                    layer.msg(data.msg, {icon: 2, time: 1000});
+                }
+            }, "json");
+        });
+    }
+
+    $("#delete").click(function(){
+        //判断是否至少选择一项
+        var checkedNum =$("input[name='ck_pro']:checked").length;
+        if(checkedNum==0){
+            layer.msg("请至少选择一个!",{icon:2,time:1000});
+            return;
+        }
+        layer.confirm('确认要删除所选项吗?',function(index){
+            var checkList= new Array();
+            $("input[name='ck_pro']:checked").each(function(){
+                checkList.push($(this).val());
+            });
+            $.ajax({
+                type:"POST",
+                url:"activityNewsDel.html",
+                data:{
+                    "id":checkList.toString()
+                },
+                dataType:"json",
+                success:function(ajax){
+                    if(ajax.is){
+                        layer.alert(ajax.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                            window.location = window.location;
+                        });
+                        $(":checkbox").prop("checked", false);
+                    }else{
+                        layer.msg(ajax.msg,{icon:2,time:1000});
+                    }
+                }
+            })
+        })
+    });
+    $("#checked_all").click(function(){
+        $("input[name='ck_pro']").prop("checked",this.checked);
+
+    })
+</script>
+</body>
+</html>

+ 213 - 0
src/main/webapp/WEB-INF/jsp/admin/adminRoleUpdate.jsp

@@ -0,0 +1,213 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%
+    String base = pageContext.getServletContext().getContextPath();
+%>
+<!--_meta 作为公共模版分离出去-->
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <script type="text/javascript">
+        window.UEDITOR_SERVER_URL = '<%=base%>';
+    </script>
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
+    <meta http-equiv="Cache-Control" content="no-siteapp"/>
+    <LINK rel="Bookmark" href="/favicon.ico">
+    <LINK rel="Shortcut Icon" href="/favicon.ico"/>
+
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui/css/H-ui.min.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/H-ui.admin.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/Hui-iconfont/1.0.8/iconfont.css"/>
+    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/admin/icheck/icheck.css"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/skin/default/skin.css" id="skin"/>
+    <link rel="stylesheet" type="text/css"
+          href="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/css/style.css"/>
+
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/index/jquery/1.9.1/jquery.min.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/js/jquery.validate.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/js/validate-methods.js"></script>
+    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/js/messages_zh.min.js"></script>
+    <script type="text/javascript"
+            src="${pageContext.request.contextPath}/static/admin/icheck/jquery.icheck.min.js"></script>
+    <script src="${pageContext.request.contextPath}/static/admin/manage/js/WdatePicker.js"></script>
+
+    <script type="text/javascript">
+        $(function () {
+            $("#sub").click(function () {
+                var id = $("#id").val();
+                var explain = $("#roleName").val();
+                /*var discription = $("#discription").val();*/
+                if (id == null ||  id== '') {
+                    layer.msg("请选择父级角色~");
+                    return false;
+                }
+                if (explain == null || explain == '') {
+                    layer.msg("角色名称不能为空~");
+                    return false;
+                }
+               /* if (discription == null || discription == '') {
+                    layer.msg("角色名称不能为空~");
+                    return false;
+                }*/
+               var formData =  new FormData();
+                formData.append("id",$("#id").val());//父类id
+               formData.append("pid",$("#pid").val());//父类id
+               formData.append("roleName",$("#roleName").val());//角色名称
+               formData.append("discription",$("#discription").val());//描述
+
+                $.ajax({
+                    type:"POST",
+                    url:"adminRoleUpdates.html",
+                    data:formData,
+                    dataType:"json",
+                    cache: false,
+                    async : false,
+                    processData: false,
+                    contentType: false,
+
+                    success:function (ajax) {
+                        if (ajax.is){
+                            layer.msg(ajax.msg);
+                            layer.alert(ajax.msg, {skin: 'layui-layer-molv', closeBtn: 0, anim: 4}, function () {
+                                var index = parent.layer.getFrameIndex(window.name);
+                                parent.layer.close(index);
+                            });
+                        }else {
+                            layer.msg(ajax.msg);
+                        }
+                    }
+                })
+
+            });
+        });
+    </script>
+
+    <title>管理员管理</title>
+</head>
+<body>
+<nav class="breadcrumb">
+    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span><a href="javascript:history.go(-1)" title="角色列表">角色列表</a><span class="c-gray en">&gt;</span> 添加
+    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container">
+    <form  class="form form-horizontal" id="subform">
+
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>父级角色:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <select name="pId" id="pid" class="input-text" <c:if test="${adminRole.id == 1}">disabled</c:if> >
+                    <%--<option value="">请选择</option>--%>
+                    <c:if test="${adminRole.id==1}"><option value="0">没有父级角色</option></c:if>
+                    <c:forEach items="${adminRoleList}" var="role">
+                        <option value="${role.id}"<c:if test="${role.id == adminRole.pid}"> selected  </c:if>>
+                            <c:if test="${adminRole.id!=1}">${role.roleName}</c:if>
+                        </option>
+
+                    </c:forEach>
+                </select>
+            </div>
+        </div>
+
+
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red">*</span>角色名称:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <input type="text" class="input-text" name="roleName" id="roleName" value="${adminRole.roleName}">
+                <input type="text" class="input-text" hidden name="id" id="id" value="${adminRole.id}">
+            </div>
+        </div>
+
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-1"><span class="c-red"></span>描述:</label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <textarea name="discription" id="discription" cols="" rows="" class="textarea">${adminRole.discription}</textarea>
+            </div>
+
+        </div>
+
+
+        <div class="row cl">
+            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-1">
+                <button type="button" class="btn btn-primary radius" id="sub" name="admin-role-save"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
+            </div>
+        </div>
+    </form>
+</article>
+
+<!--请在下方写此页面业务相关的脚本-->
+<!-- 百度文本编辑器   引用文件 -->
+<link href="<%=base%>/static/ue/themes/default/css/ueditor.css" type="text/css" rel="stylesheet">
+<script src="<%=base%>/static/ue/ueditor.config.js" type="text/javascript"></script>
+<script src="<%=base%>/static/ue/ueditor.all.js" type="text/javascript"></script>
+<script type="text/javascript" src="<%=base%>/static/ue/lang/zh-cn/zh-cn.js"></script>
+
+<!-- 百度文本编辑器   js -->
+<script type="text/javascript">
+    $(function () {
+        var ue = UE.getEditor('introduction', {
+            //关闭字数统计
+            wordCount: false,
+            toolbars: [['fullscreen', 'source', '|', 'undo', 'redo', '|',
+                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
+                'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
+                'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
+                'directionalityltr', 'directionalityrtl', 'indent', '|',
+                'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
+                'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
+                'insertimage', 'emotion', 'insertvideo', 'attachment', 'map', 'template', 'background', '|',
+                'horizontal', 'date', 'time', 'spechars', 'wordimage', '|',
+                'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
+                'print', 'preview', 'searchreplace', 'help'
+            ]],
+            //关闭elementPath
+            elementPathEnabled: false,
+        });
+    });
+
+
+    var currentBrowserId;
+
+    function browserImage(targetId) {
+        currentBrowserId = targetId;
+        var weboxTemp = $.webox({
+            height: 600,
+            width: 1024,
+            bgvisibel: true,
+            title: '图片管理',
+            iframe: '<%=base%>/admin/image/imgbox.html?' + Math.random()
+        });
+    }
+
+    function setImagepath(imgPath) {
+        $('#' + currentBrowserId).val(imgPath);
+    }
+
+    function closeFrame() {
+        $('#locked .span').click();
+    }
+</script>
+
+
+<!--请在下方写此页面业务相关的脚本-->
+<script type="text/javascript">
+</script>
+<!--/请在上方写此页面业务相关的脚本-->
+</body>
+</html>

+ 39 - 1
src/main/webapp/WEB-INF/jsp/admin/adminsList.jsp

@@ -120,7 +120,14 @@
 
 
                                 <a style="text-decoration:none" class="ml-5"  onclick="admins_update('用户修改','adminsUpdate.html?id=${admin.id}','1200','510')" title="查看"><i class="Hui-iconfont">&#xe6df;</i></a>
-                                    <a href="#"><i style="color:green;">禁用</i></a>
+                                <c:if test="${admin.state == 0}">
+                                    <a style="text-decoration:none" class="ml-5" onclick="startUp(${admin.id})" title="启用">
+                                        <i class="Hui-iconfont" style="color: green;font-size: small">启用</i></a>
+                                </c:if>
+                                <c:if test="${admin.state == 1}">
+                                    <a style="text-decoration:none" class="ml-5" onclick="shutDown(${admin.id})" title="禁用">
+                                        <i class="Hui-iconfont" style="color: red;font-size: small">禁用</i></a>
+                                </c:if>
                             </td>
                         </tr>
                     </c:forEach>
@@ -233,6 +240,37 @@
         console.log(title);
         layer_show(title,url,w,h);
     }
+    /*用户禁用*/
+    function shutDown(idVal) {
+        var id = idVal;
+        $.ajax({
+            type:"POST",
+            url:"shutDownUser.html",
+            data:{"id":id},
+            dataType:"json",
+            success:function (ajax) {
+                if (ajax.is){
+                    window.location.href="adminsList.html"
+                }
+            }
+
+        })
+    }
+    /*用户启用*/
+    function startUp(idVal) {
+        var id = idVal;
+        $.ajax({
+            type:"POST",
+            url:"startUpUser.html",
+            data:{"id":id},
+            dataType:"json",
+            success:function (ajax) {
+                if (ajax.is){
+                    window.location.href="adminsList.html";
+                }
+            }
+        })
+    }
 
     //全选与反选
     $("#sltall").click(function () {

+ 5 - 2
src/main/webapp/WEB-INF/jsp/admin/index.jsp

@@ -74,11 +74,11 @@
 		<input runat="server" id="divScrollValue" type="hidden" value="" />
 		<div class="menu_dropdown bk_2">
 
-			<dl id="menu-article">
+			<%--<dl id="menu-article">
 				<a style="text-decoration: none;" data-href="password.html" data-title="修改密码" href="javascript:void(0)"><dt>
 					<i class="Hui-iconfont">&#xe623;</i>修改密码
 				</dt></a>
-			</dl>
+			</dl>--%>
 			<%--<dl id="menu-service">
 				<dt>
 					<i class="Hui-iconfont">&#xe692;</i>服务管理<i class="Hui-iconfont menu_dropdown-arrow">&#xe6d5;</i>
@@ -282,6 +282,9 @@
                         <li><a data-href="bannerList.html" data-title="广告位" href="javascript:void(0)">广告位</a></li>
 						<li><a data-href="bannerNumber.html" data-title="广告位数量" href="javascript:void(0)">系统设置</a></li>
                         <li><a data-href="adminsList.html" data-title="用户管理" href="javascript:void(0)">用户管理</a></li>
+						<li><a data-href="adminRoleList.html" data-title="角色管理" href="javascript:void(0)">角色管理</a></li>
+						<li> <a data-href="password.html" data-title="修改密码" href="javascript:void(0)">修改密码</a></li>
+						<li> <a data-href="adminNavbarList.html" data-title="模块管理" href="javascript:void(0)">模块管理</a></li>
 <%--                        <li><a data-href="bannerDetailList.html" data-title="banner详情" href="javascript:void(0)">banner详情开发中....</a></li>--%>
 
                     </ul>