Browse Source

Merge remote-tracking branch 'origin/master'

user5 2 years ago
parent
commit
4547e75deb

+ 17 - 0
src/main/java/com/jeeplus/modules/sys/dao/HelpDao.java

@@ -0,0 +1,17 @@
+package com.jeeplus.modules.sys.dao;
+
+import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.annotation.MyBatisDao;
+import com.jeeplus.modules.sys.entity.Help;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 帮助管理Dao
+ */
+@MyBatisDao
+public interface HelpDao extends CrudDao<Help> {
+
+    List<String> getByParentMenuId(@Param("menuId") String menuId);
+}

+ 150 - 0
src/main/java/com/jeeplus/modules/sys/entity/Help.java

@@ -0,0 +1,150 @@
+package com.jeeplus.modules.sys.entity;
+
+import com.jeeplus.common.persistence.DataEntity;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 帮助管理Entity
+ * @TableName sys_help
+ */
+public class Help extends DataEntity<Help> {
+
+    public static final String SERIAL_BIZ = "1009";
+
+    /**
+     * 编号
+     */
+    private String number;
+
+    /**
+     * 菜单id
+     */
+    private String menuId;
+
+    /**
+     * 功能
+     */
+    private String features;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 关联菜单名称
+     */
+    private String menuName;
+
+    /**
+     * 菜单id集合
+     */
+    private List<String> menuIdList;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    public String getNumber() {
+        return number;
+    }
+
+    /**
+     * 编号
+     */
+    public void setNumber(String number) {
+        this.number = number;
+    }
+
+    /**
+     * 菜单id
+     */
+    @NotNull(message="关联菜单不能为空")
+    public String getMenuId() {
+        return menuId;
+    }
+
+    /**
+     * 菜单id
+     */
+    public void setMenuId(String menuId) {
+        this.menuId = menuId;
+    }
+
+    /**
+     * 功能
+     */
+    @NotNull(message = "功能不能为空")
+    @Length(min = 1, max = 255, message = "功能长度最大为 500")
+    public String getFeatures() {
+        return features;
+    }
+
+    /**
+     * 功能
+     */
+    public void setFeatures(String features) {
+        this.features = features;
+    }
+
+    /**
+     * 描述
+     */
+    @Length(min = 0, max = 500, message = "描述长度必须介于 0 和 500 之间")
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * 描述
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    /**
+     * 关联菜单名称
+     */
+    public String getMenuName() { return menuName; }
+
+    /**
+     * 关联菜单名称
+     */
+    public void setMenuName(String menuName) { this.menuName = menuName; }
+
+    /**
+     * 菜单id集合
+     */
+    public List<String> getMenuIdList() {
+        return menuIdList;
+    }
+
+    /**
+     * 菜单id集合
+     */
+    public void setMenuIdList(List<String> menuIdList) {
+        this.menuIdList = menuIdList;
+    }
+
+    public Help() {
+        super();
+    }
+
+    public Help(String id) {
+        super(id);
+    }
+
+    public Help(String id, String number, String menuId, String features, String description) {
+        super(id);
+        this.number = number;
+        this.menuId = menuId;
+        this.features = features;
+        this.description = description;
+    }
+}

+ 71 - 0
src/main/java/com/jeeplus/modules/sys/service/HelpService.java

@@ -0,0 +1,71 @@
+package com.jeeplus.modules.sys.service;
+
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.IdGen;
+import com.jeeplus.common.utils.MenuStatusEnum;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.iim.dao.MailBoxDao;
+import com.jeeplus.modules.iim.entity.MailBox;
+import com.jeeplus.modules.serialnum.service.SerialNumTplService;
+import com.jeeplus.modules.sys.dao.HelpDao;
+import com.jeeplus.modules.sys.entity.Help;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+@Service
+@Transactional(readOnly = true)
+public class HelpService extends CrudService<HelpDao, Help> {
+
+    @Autowired
+    private HelpDao helpDao;
+
+    @Autowired
+    private SerialNumTplService serialNumTplService;
+
+    /**
+     * 新增或修改
+     * @param help
+     */
+    @Transactional(readOnly = false, rollbackFor = Exception.class)
+    public void saveHelp(Help help) {
+        if (StringUtils.isBlank(help.getId())){
+            help.setNumber(serialNumTplService.genSerialNum(UserUtils.getUser().getCompany(), help.SERIAL_BIZ));
+            help.setId(IdGen.uuid());
+            help.preInsert();
+            dao.insert(help);
+        }else{
+            help.preUpdate();
+            dao.update(help);
+        }
+    }
+
+    /**
+     * 删除
+     * @param help
+     */
+    @Transactional(readOnly = false)
+    public void delete(Help help) {
+        dao.deleteByLogic(help);
+    }
+
+    public Page<Help> findList(Page<Help> page, Help help) {
+        help.setPage(page);
+        List<Help> helpList = helpDao.findList(help);
+        page.setList(helpList);
+        return page;
+    }
+
+    public List<String> getByParentMenuId(String menuId) {
+        List<String> byParentMenuId = helpDao.getByParentMenuId(menuId);
+        return byParentMenuId;
+    }
+
+}

+ 107 - 0
src/main/java/com/jeeplus/modules/sys/web/HelpController.java

@@ -0,0 +1,107 @@
+package com.jeeplus.modules.sys.web;
+
+import com.jeeplus.common.config.Global;
+import com.jeeplus.common.json.AjaxJson;
+import com.jeeplus.common.persistence.Page;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.common.web.BaseController;
+import com.jeeplus.modules.iim.entity.MailBox;
+import com.jeeplus.modules.sys.entity.*;
+import com.jeeplus.modules.sys.service.HelpService;
+import com.jeeplus.modules.sys.service.SystemService;
+import com.jeeplus.modules.sys.utils.UserUtils;
+import org.apache.shiro.authz.annotation.Logical;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+@Controller
+@RequestMapping(value = "${adminPath}/sys/help")
+public class HelpController extends BaseController {
+
+    @Autowired
+    private HelpService helpService;
+
+    @Autowired
+    private SystemService systemService;
+
+    @RequiresPermissions("sys:help:list")
+    @RequestMapping(value = {""})
+    public String index(Help help, Model model) {
+        if (Objects.nonNull(help) && StringUtils.isNotBlank(help.getMenuId())) {
+            model.addAttribute("menuId", help.getMenuId());
+        }
+        return "modules/sys/helpIndex";
+    }
+
+    @RequiresPermissions("sys:help:list")
+    @RequestMapping(value = {"list"})
+    public String list(Help help, HttpServletRequest request, HttpServletResponse response, Model model) {
+        // 根据菜单id查询出此菜单的所有下级菜单
+        if (Objects.nonNull(help) && StringUtils.isNotBlank(help.getMenuId())) {
+            help.setMenuIdList(helpService.getByParentMenuId(help.getMenuId()));
+            model.addAttribute("menuId", help.getMenuId());
+        }
+        Page<Help> page = helpService.findList(new Page<Help>(request, response), help);
+        model.addAttribute("manager", UserUtils.isManager());
+        model.addAttribute("page", page);
+        return "modules/sys/helpList";
+    }
+
+    @RequiresPermissions(value={"sys:help:add","sys:help:edit"},logical=Logical.OR)
+    @RequestMapping(value = "save")
+    public String save(Help help, Model model, RedirectAttributes redirectAttributes) {
+        if(!beanValidator(model, help)) {
+            return form(help, model);
+        }
+        helpService.saveHelp(help);
+        addMessage(redirectAttributes, "保存成功");
+        return "redirect:" + Global.getAdminPath() + "/sys/help/?repage";
+    }
+
+    @RequiresPermissions(value={"sys:help:list","sys:help:add","sys:help:edit"},logical=Logical.OR)
+    @RequestMapping(value = "form")
+    public String form(Help help, Model model) {
+        if (Objects.nonNull(help)) {
+            if (StringUtils.isNotBlank(help.getId())) {
+                Help result = helpService.get(help.getId());
+                model.addAttribute("help", result);
+            } else if (StringUtils.isNotBlank(help.getMenuId())) {
+                Menu menu = systemService.getMenu(help.getMenuId());
+                if (Objects.nonNull(help)) {
+                    Help h = new Help();
+                    h.setMenuId(menu.getId());
+                    h.setMenuName(menu.getName());
+                    model.addAttribute("help", h);
+                }
+            }
+        }
+        return "modules/sys/helpForm";
+    }
+
+    @RequiresPermissions("sys:help:del")
+    @ResponseBody
+    @RequestMapping(value = "delete")
+    public AjaxJson delete(Help help, RedirectAttributes redirectAttributes,HttpServletRequest request, HttpServletResponse response) {
+        AjaxJson ajaxJson = new AjaxJson();
+        StringBuffer msg = new StringBuffer();
+        if (Objects.nonNull(help) && StringUtils.isNotBlank(help.getId())) {
+            helpService.delete(help);
+            msg.append("删除成功");
+        } else {
+            msg.append("删除失败");
+        }
+        ajaxJson.setMsg(msg.toString());
+        return ajaxJson;
+    }
+}

+ 73 - 4
src/main/java/com/jeeplus/modules/sys/web/MenuController.java

@@ -3,12 +3,14 @@
  */
 package com.jeeplus.modules.sys.web;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 import javax.servlet.http.HttpServletResponse;
 
+import com.jeeplus.common.utils.ObjectUtils;
+import com.jeeplus.modules.sys.entity.Office;
+import com.jeeplus.modules.sys.entity.Role;
 import org.apache.shiro.authz.annotation.Logical;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -195,7 +197,6 @@ public class MenuController extends BaseController {
 	/**
 	 * isShowHide是否显示隐藏菜单
 	 * @param extId
-	 * @param isShowHidden
 	 * @param response
 	 * @return
 	 */
@@ -220,4 +221,72 @@ public class MenuController extends BaseController {
 		}
 		return mapList;
 	}
+
+	/**
+	 * 帮助管理获取菜单数据
+	 */
+	@ResponseBody
+	@RequestMapping(value = "treeDataHelp")
+	public List<Map<String, Object>> treeDataHelp(@RequestParam(value = "selectName",required = false) String selectName) {
+		List<Map<String, Object>> mapList = Lists.newArrayList();
+		List<Menu> list = systemService.findAllMenu();
+		if (list == null || list.isEmpty()) {
+			return mapList;
+		}
+		List<String> likeIdList = new ArrayList<>();
+		List<String> likeParentIdList = new ArrayList<>();
+		if (StringUtils.isNotBlank(selectName)) {
+			// 通过contains实现根据selectName模糊查询菜单数据
+			List<Menu> getBySelectName = list.stream().filter(item -> {
+				if (!(StringUtils.isBlank(item.getHref()) && StringUtils.isNotBlank(item.getPermission()))) { // 排除掉按钮(链接为空并且权限不为空的菜单为按钮)
+					if (item.getName().contains(selectName)) {
+						return true;
+					}
+				}
+				return false;
+			}).collect(Collectors.toList());
+			if (getBySelectName != null && !getBySelectName.isEmpty()) {
+				// 取出菜单查询结果的全部id
+				List<String> ids = getBySelectName.stream().map(Menu::getId).collect(Collectors.toList());
+				likeIdList.addAll(ids);
+				// 取出菜单查询结果的全部父级id
+				getBySelectName.stream().forEach(item -> {
+					if (StringUtils.isNotBlank(item.getParentIds())) {
+						String[] split = item.getParentIds().split(",");
+						for (String s : split) {
+							likeParentIdList.add(s);
+						}
+					}
+				});
+			} else {
+				return mapList;
+			}
+		}
+		for (int i = 0; i < list.size(); i++) {
+			Menu e = list.get(i);
+			// 去除按钮(链接为空并且权限不为空的菜单为按钮)
+			// 菜单过滤:likeIdList不为空则进行菜单过滤
+			if (!(StringUtils.isBlank(e.getHref()) && StringUtils.isNotBlank(e.getPermission()))) {
+				if (likeIdList != null && !likeIdList.isEmpty()) {
+					// 判断‘当前菜单’以及‘当前菜单的父级菜单’是否在查询到的结果中(likeIdList、likeParentIdList)
+					boolean isContains = likeIdList.stream().anyMatch(id ->
+							e.getId().equals(id) || "0".equals(e.getParentId()) || e.getParentIds().contains("," + id + ",")
+					);
+					boolean isContainsParent = likeParentIdList.stream().anyMatch(id ->
+							e.getId().equals(id)
+					);
+					if (!isContains && !isContainsParent) {
+						continue;
+					}
+				}
+				Map<String, Object> map = Maps.newHashMap();
+				map.put("id", e.getId());
+				map.put("pIds", e.getParentIds());
+				map.put("pId", e.getParentId());
+				map.put("name", e.getName());
+				mapList.add(map);
+			}
+		}
+		return mapList;
+	}
 }

+ 197 - 0
src/main/resources/mappings/modules/sys/HelpMapper.xml

@@ -0,0 +1,197 @@
+<?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.jeeplus.modules.sys.dao.HelpDao">
+
+    <resultMap id="BaseResultMap" type="com.jeeplus.modules.sys.entity.Help">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="createBy.id" column="create_by" jdbcType="VARCHAR"/>
+            <result property="createDate" column="create_date" jdbcType="TIMESTAMP"/>
+            <result property="updateBy.id" column="update_by" jdbcType="VARCHAR"/>
+            <result property="updateDate" column="update_date" jdbcType="TIMESTAMP"/>
+            <result property="remarks" column="remarks" jdbcType="VARCHAR"/>
+            <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
+            <result property="number" column="number" jdbcType="VARCHAR"/>
+            <result property="menuId" column="menu_id" jdbcType="VARCHAR"/>
+            <result property="features" column="features" jdbcType="VARCHAR"/>
+            <result property="description" column="description" jdbcType="VARCHAR"/>
+            <result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        sh.id,
+        sh.create_by,
+        sh.create_date,
+        sh.update_by,
+        sh.update_date,
+        sh.remarks,
+        sh.del_flag,
+        sh.number,
+        sh.menu_id,
+        sh.features,
+        sh.description
+    </sql>
+
+    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jeeplus.modules.sys.entity.Help" useGeneratedKeys="true">
+        insert into sys_help
+        (id,
+        create_by,
+        create_date,
+        update_by,
+        update_date,
+        remarks,
+        del_flag,
+        number,
+        menu_id,
+        features,
+        description)
+        values
+        (#{id,jdbcType=VARCHAR},
+        #{createBy.id,jdbcType=VARCHAR},
+        #{createDate,jdbcType=TIMESTAMP},
+        #{updateBy.id,jdbcType=VARCHAR},
+        #{updateDate,jdbcType=TIMESTAMP},
+        #{remarks,jdbcType=VARCHAR},
+        #{delFlag,jdbcType=CHAR},
+        #{number,jdbcType=VARCHAR},
+        #{menuId,jdbcType=VARCHAR},
+        #{features,jdbcType=VARCHAR},
+        #{description,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jeeplus.modules.sys.entity.Help" useGeneratedKeys="true">
+        insert into sys_help
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                <if test="id != null">id,</if>
+                <if test="createBy != null">create_by,</if>
+                <if test="createDate != null">create_date,</if>
+                <if test="updateBy != null">update_by,</if>
+                <if test="updateDate != null">update_date,</if>
+                <if test="remarks != null">remarks,</if>
+                <if test="delFlag != null">del_flag,</if>
+                <if test="number != null">number,</if>
+                <if test="menuId != null">menu_id,</if>
+                <if test="features != null">features,</if>
+                <if test="description != null">description,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="id != null"> #{id,jdbcType=VARCHAR},</if>
+                <if test="createBy.id != null"> #{createBy.id,jdbcType=VARCHAR},</if>
+                <if test="createDate != null"> #{createDate,jdbcType=TIMESTAMP},</if>
+                <if test="updateBy.id != null"> #{updateBy.id,jdbcType=VARCHAR},</if>
+                <if test="updateDate != null"> #{updateDate,jdbcType=TIMESTAMP},</if>
+                <if test="remarks != null"> #{remarks,jdbcType=VARCHAR},</if>
+                <if test="delFlag != null"> #{delFlag,jdbcType=CHAR},</if>
+                <if test="number != null"> #{number,jdbcType=VARCHAR},</if>
+                <if test="menuId != null"> #{menuId,jdbcType=VARCHAR},</if>
+                <if test="features != null"> #{features,jdbcType=VARCHAR},</if>
+                <if test="description != null"> #{description,jdbcType=VARCHAR},</if>
+        </trim>
+    </insert>
+    <update id="update" parameterType="com.jeeplus.modules.sys.entity.Help">
+        update sys_help
+        <set>
+                <if test="createBy != null and createBy.id != null and createBy.id != ''">
+                    create_by = #{createBy.id,jdbcType=VARCHAR},
+                </if>
+                <if test="createDate != null">
+                    create_date = #{createDate,jdbcType=TIMESTAMP},
+                </if>
+                <if test="updateBy != null and updateBy.id != null and updateBy.id != ''">
+                    update_by = #{updateBy.id,jdbcType=VARCHAR},
+                </if>
+                <if test="updateDate != null">
+                    update_date = #{updateDate,jdbcType=TIMESTAMP},
+                </if>
+                <if test="remarks != null">
+                    remarks = #{remarks,jdbcType=VARCHAR},
+                </if>
+                <if test="delFlag != null">
+                    del_flag = #{delFlag,jdbcType=CHAR},
+                </if>
+                <if test="number != null">
+                    number = #{number,jdbcType=VARCHAR},
+                </if>
+                <if test="menuId != null">
+                    menu_id = #{menuId,jdbcType=VARCHAR},
+                </if>
+                <if test="features != null">
+                    features = #{features,jdbcType=VARCHAR},
+                </if>
+                <if test="description != null">
+                    description = #{description,jdbcType=VARCHAR},
+                </if>
+        </set>
+        where
+            id = #{id,jdbcType=VARCHAR}
+    </update>
+
+    <update id="updateById" parameterType="com.jeeplus.modules.sys.entity.Help">
+        update sys_help
+        set 
+            create_by =  #{createBy.id,jdbcType=VARCHAR},
+            create_date =  #{createDate,jdbcType=TIMESTAMP},
+            update_by =  #{updateBy.id,jdbcType=VARCHAR},
+            update_date =  #{updateDate,jdbcType=TIMESTAMP},
+            remarks =  #{remarks,jdbcType=VARCHAR},
+            del_flag =  #{delFlag,jdbcType=CHAR},
+            number =  #{number,jdbcType=VARCHAR},
+            menu_id =  #{menuId,jdbcType=VARCHAR},
+            features =  #{features,jdbcType=VARCHAR},
+            description =  #{description,jdbcType=VARCHAR}
+        where
+            id = #{id,jdbcType=VARCHAR}
+    </update>
+
+    <select id="get" resultMap="BaseResultMap" >
+        SELECT
+            <include refid="Base_Column_List"/>,
+            sm.name as menu_name
+        FROM sys_help sh
+        LEFT JOIN sys_menu sm on sm.id = sh.menu_id and sm.del_flag = '0'
+        WHERE sh.id = #{id}
+    </select>
+
+    <select id="findList" resultMap="BaseResultMap" >
+        SELECT
+            <include refid="Base_Column_List"/>,
+            sm.name as menu_name
+        FROM sys_help sh
+        LEFT JOIN sys_menu sm on sm.id = sh.menu_id and sm.del_flag = '0'
+        <where>
+            sh.del_flag = #{DEL_FLAG_NORMAL}
+            <if test="id != null and id != ''">
+                and sh.id = #{id}
+            </if>
+            <if test="number != null and number != ''">
+                AND sh.number LIKE concat('%',#{number},'%')
+            </if>
+            <if test="features != null and features != ''">
+                AND sh.features LIKE concat('%',#{features},'%')
+            </if>
+            <if test="description != null and description != ''">
+                AND sh.description LIKE concat('%',#{description},'%')
+            </if>
+            <if test="menuIdList != null and menuIdList.size > 0">
+                and sh.menu_id in
+                <foreach collection="menuIdList" index="index" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        ORDER BY sh.create_date desc
+    </select>
+
+    <!--逻辑删除-->
+    <update id="deleteByLogic" parameterType="com.jeeplus.modules.sys.entity.Help">
+		UPDATE sys_help SET
+			del_flag = #{DEL_FLAG_DELETE}
+		WHERE id = #{id}
+	</update>
+
+    <select id="getByParentMenuId" resultType="string" parameterType="string">
+        select
+            sm.id
+        from sys_menu sm
+        where sm.del_flag = '0'
+        and (sm.parent_ids like CONCAT('%,',#{menuId},',%') or sm.id = #{menuId})
+    </select>
+</mapper>

+ 101 - 0
src/main/webapp/webpage/modules/sys/helpForm.jsp

@@ -0,0 +1,101 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>帮助管理</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <%@include file="/webpage/include/treeview.jsp" %>
+    <style>
+        .form-horizontal{
+            width: 85%;
+        }
+        .form-group{
+            margin-left: 10%;
+            padding-top:18px;
+        }
+        .lw9 .layui-item .layui-form-label{
+            width: 80px;
+        }
+    </style>
+    <script type="text/javascript">
+        var validateForm;
+        function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
+            if(validateForm.form()){
+                loading('正在提交,请稍等...');
+                $("#inputForm").submit();
+                return true;
+            }
+            return false;
+        }
+        $(document).ready(function(){
+            layui.use(['form', 'layer'], function () {
+                var form = layui.form;
+            });
+            // $("#features").focus();
+            validateForm= $("#inputForm").validate({
+                rules: {
+                    enname: {remote: "${ctx}/sys/role/checkEnname?oldEnname=" + encodeURIComponent("${role.enname}")}
+                },
+                messages: {
+                    enname: {remote: "英文名已存在"}
+                },
+                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>
+<div class="single-form">
+    <div class="container" style="display:flex;width:85%;margin-left:10%;">
+        <form:form id="inputForm" modelAttribute="help" autocomplete="off" action="${ctx}/sys/help/save" method="post" class="form-horizontal layui-form" >
+            <form:hidden path="id"/>
+            <sys:message content="${message}"/>
+
+            <div class="form-group layui-row first lw9">
+                <div class="form-group-label"><h2>帮助信息</h2></div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label"><span class="require-item">*</span>关联菜单:</label>
+                    <div class="layui-input-block with-icon">
+                        <sys:treeselect id="menu" name="menuId" value="${help.menuId}" labelName="menuName" labelValue="${help.menuName}"
+                                        cssStyle="background-color:#fff"  title="菜单" url="/sys/menu/treeDataHelp" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">编号:</label>
+                    <div class="layui-input-block">
+                        <form:input path="number" placeholder="编号自动生成" htmlEscape="false" readonly="true" class="form-control layui-input"/>
+                    </div>
+                </div>
+
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label"><span class="require-item">*</span>功能:</label>
+                    <div class="layui-input-block">
+                        <form:input placeholder="请输入功能" path="features" htmlEscape="false" maxlength="200" class="form-control required layui-input"/>
+                    </div>
+                </div>
+                <div class="layui-item layui-col-sm12 with-textarea">
+                    <label class="layui-form-label">描述:</label>
+                    <div class="layui-input-block">
+                        <form:textarea placeholder="请输入描述" style="resize:none;" path="description" htmlEscape="false" rows="4" maxlength="450" class="form-control "/>
+                    </div>
+                </div>
+            </div>
+        </form:form>
+    </div>
+</div>
+</body>
+</html>

+ 97 - 0
src/main/webapp/webpage/modules/sys/helpIndex.jsp

@@ -0,0 +1,97 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>帮助管理</title>
+	<meta name="decorator" content="default"/>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<style type="text/css">
+		.ztree {overflow:auto;margin:0;_margin-top:10px;padding:10px 0 0 10px;}
+	</style>
+	<script type="text/javascript">
+        function refresh(){//刷新
+
+            window.location="${ctx}/sys/help/";
+        }
+	</script>
+	<style>
+		body{
+			background-color:transparent;
+			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+			color:#ffffff;
+			background-color:rgba(255,255,255,0);
+			height:100%;
+		}
+	</style>
+</head>
+<body>
+<div class="wrapper wrapper-content full-width" id="divId">
+	<sys:message content="${message}"/>
+	<div id="content" class="pr full-height full-width">
+
+		<div id="left"  class="contentShadow fl contents">
+			<div class="ztreeContainer">
+				<div id="ztree" class="ztree leftBox-content"></div>
+			</div>
+		</div>
+
+
+		<div id="right"  class="fl contents">
+			<div class="layui-row contentShadow full-height tran-bg">
+					<iframe id="helpContent" name="helpContent" src="${ctx}/sys/help/list" width="100%" height="100%" frameborder="0"></iframe>
+			</div>
+		</div>
+	</div>
+</div>
+	<script type="text/javascript">
+        function addDiyDom(treeId, treeNode) {
+            var spaceWidth = 15;
+            var switchObj = $("#" + treeNode.tId + "_switch"),
+                icoObj = $("#" + treeNode.tId + "_ico");
+            switchObj.remove();
+            icoObj.before(switchObj);
+
+            if (treeNode.level > 0) {
+                var spaceStr = "<span style='display: inline-block;width:" + (spaceWidth * treeNode.level)+ "px'></span>";
+                switchObj.before(spaceStr);
+            }
+        }
+
+
+        var setting = {data:{simpleData:{enable:true,idKey:"id",pIdKey:"pId",rootPId:'0'}},
+            callback:{onClick:function(event, treeId, treeNode){
+                var id = treeNode.id == '0' ? '' :treeNode.id;
+                $('#helpContent').attr("src","${ctx}/sys/help/list?menuId="+id);
+            }
+            }
+            ,view:{
+                showLine: false,
+                showIcon: false,
+                addDiyDom: addDiyDom
+            }
+        };
+
+        function refreshTree(){
+            $.getJSON("${ctx}/sys/menu/treeDataHelp?"+ Math.random(),function(data){
+                $.fn.zTree.init($("#ztree"), setting, data).expandAll(true);
+                closeSubChilds();
+            });
+        }
+        refreshTree();
+
+        function closeSubChilds() {
+            var secondLevel = $('#ztree').children().children().eq(1).children();
+            var slists = secondLevel.find('a.level1').find('.level1');
+            var arr = [];
+            for (var i = 0, length = slists.length; i < length; i++) {
+                arr.push(slists[i]);
+                $(arr[i].parentNode.nextSibling).css('display','none');
+                arr[i].click(function(){
+                    arr[i].removeClass("noline_close").addClass('noline_open');
+                })
+            }
+            secondLevel.find('a.level1').children().eq(1).removeClass("noline_open").addClass('noline_close');
+        }
+	</script>
+</body>
+</html>

+ 184 - 0
src/main/webapp/webpage/modules/sys/helpList.jsp

@@ -0,0 +1,184 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+    <title>帮助管理</title>
+    <meta name="decorator" content="default"/>
+    <style>
+        body{
+            background-color:transparent;
+            filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
+            color:#ffffff;
+            background-color:rgba(255,255,255,0);
+            height:100%;
+        }
+
+    </style>
+    <script type="text/javascript">
+        // 确认对话框
+        function confirmx(mess, href){
+            console.log(href)
+            top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
+                //do something
+                if (typeof href == 'function') {
+                    href();
+                }else{
+                    resetTip(); //loading();
+                    $.ajax({
+                        url:href,
+                        data:$('#searchForm').serialize(),
+                        type:"post",
+                        dataType: "json",
+                        success:function(data){
+                            if(data.success){
+                                parent.layer.msg(data.msg,{icon:1});
+                            }else {
+                                parent.layer.msg(data.msg,{icon:2});
+                            }
+                            parent.refreshTree();
+                            location = "${ctx}/sys/help/list";
+                        }
+                    });
+                }
+                top.layer.close(index);
+            });
+            return false;
+        }
+    </script>
+</head>
+<body>
+<div class="wrapper wrapper-content">
+    <sys:message content="${message}"/>
+    <div class="layui-row">
+        <div class="full-width fl">
+            <div class="contentShadow shadowB layui-row" id="queryDiv">
+                <form:form id="searchForm" modelAttribute="help" action="${ctx}/sys/help/list" method="post" class="form-inline">
+                    <input id="menuId" name="menuId" type="hidden" value="${menuId}"/>
+                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
+                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
+                    <table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
+
+                    <div class="commonQuery">
+                        <div class="layui-item query athird">
+                            <label class="layui-form-label">编号:</label>
+                            <div class="layui-input-block with-icon">
+                                <form:input path="number" value="${help.number}"  htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+                            </div>
+                        </div>
+                        <div class="layui-item query athird">
+                            <label class="layui-form-label">功能:</label>
+                            <div class="layui-input-block with-icon">
+                                <form:input path="features" value="${help.features}"  htmlEscape="false" maxlength="64"  class=" form-control layui-input"/>
+                            </div>
+                        </div>
+                        <div class="layui-item query athird">
+                            <label class="layui-form-label">描述:</label>
+                            <div class="layui-input-block with-icon">
+                                <form:input path="description" value="${help.description}"  htmlEscape="false" maxlength="128"  class=" form-control layui-input"/>
+                            </div>
+                        </div>
+
+                        <div class="layui-item athird fr">
+                            <div class="input-group">
+                                <div class="layui-btn-group search-spacing">
+                                    <button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
+                                    <button id="searchReset" class="layui-btn layui-btn-sm " onclick="resetSearch()">重置</button>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </form:form>
+            </div>
+        </div>
+
+        <div class="contentShadow shadowT full-width fl">
+            <div class="layui-form contentDetails">
+                <div class="nav-btns">
+                    <div class="layui-btn-group" style="margin-left: 15px;">
+                        <shiro:hasPermission name="sys:help:add">
+                            <table:addRow url="${ctx}/sys/help/form?menuId=${menuId}" title="帮助"></table:addRow><!-- 增加按钮 -->
+                        </shiro:hasPermission>
+                        <button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
+                    </div>
+                    <div style="clear: both;"></div>
+                </div>
+                <table class="oa-table layui-table" id="contentTable"></table>
+
+                <!-- 分页代码 -->
+                <table:page page="${page}"></table:page>
+                <div style="clear: both;"></div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
+<script>
+    layui.use('table', function(){
+        layui.table.render({
+            limit:${ page.pageSize }
+            ,elem: '#contentTable'
+            ,page: false
+            ,cols: [[
+                // {checkbox: true, fixed: true},
+                {field:'index',align:'center',  width:40,title: '序号'}
+                ,{field:'number',align:'center', title: '编码', width:100,templet:function(d){
+                        var xml = "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看帮助详情', '${ctx}/sys/help/form?id=" + d.id + "&view=view','95%','95%')\">" +
+                            "<span title=" + d.number + ">" + d.number + "</span></a>";
+                        return xml;
+                    }}
+                ,{field:'menuName',align:'center', title: '关联菜单', width:200,templet:function(d){
+                        return "<span title='"+ d.menuName +"'>" + d.menuName + "</span>";
+                    }}
+                ,{field:'features', align:'center',title: '功能', width :200,templet:function(d){
+                        return "<span title='"+ d.features +"'>" + d.features + "</span>";
+                    }}
+                ,{field:'description', align:'center',title: '描述', minWidth :200,templet:function(d){
+                        return "<span title='"+ d.description +"'>" + d.description + "</span>";
+                    }}
+                ,{field:'op',align:'center',title:"操作",width:100,templet:function(d){
+                        ////对操作进行初始化
+                        var xml = "<div class=\"layui-btn-group\">";
+                        if(d.candelete1 != undefined && d.candelete1 == "1")
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"openDialog('修改帮助信息', '${ctx}/sys/help/form?id="+ d.id +"','95%','95%')\" class=\"layui-btn layui-btn-xs layui-bg-green\" > 修改</a>";
+                        if(d.candelete2 != undefined && d.candelete2 == "1")
+                            xml +="<a href=\"javascript:void(0)\" onclick=\"return confirmx('确认要删除吗?', '${ctx}/sys/help/delete?id=" + d.id +"')\"   class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
+                        xml+="</div>";
+                        return xml;
+                    }}
+            ]]
+            ,data: [
+                <c:if test="${ not empty page.list}">
+                <c:forEach items="${page.list}" var="help" varStatus="index">
+                <c:if test="${index.index != 0}">,</c:if>
+                {
+                    "index":"${index.index+1}"
+                    ,"id":"${help.id}"
+                    ,"number":"${help.number}"
+                    ,"menuName":"${help.menuName}"
+                    ,"features":"${help.features}"
+                    ,"description":"${help.description}"
+                    <shiro:hasPermission name="sys:role:edit">
+                    ,"candelete1":"1"
+                    </shiro:hasPermission>
+                    <shiro:hasPermission name="sys:role:del">
+                    ,"candelete2":"1"
+                    </shiro:hasPermission>
+                }
+                </c:forEach>
+                </c:if>
+            ]
+            // ,even: true
+            // ,height: 315
+        });
+    })
+    resizeListTable();
+</script>
+<script>
+    $("a").on("click",addLinkVisied);
+    resizeListWindow3();
+    $(window).resize(function(){
+        resizeListWindow3();
+    });
+</script>
+</body>
+</html>