mirror of https://gitee.com/y_project/RuoYi.git
修改菜单及部门排序规则
parent
36738bca90
commit
9ce273c359
|
@ -233,13 +233,13 @@
|
||||||
}
|
}
|
||||||
// 缓存并格式化数据
|
// 缓存并格式化数据
|
||||||
var formatData = function(data) {
|
var formatData = function(data) {
|
||||||
var _root = options.rootIdValue ? options.rootIdValue : null
|
var _root = options.rootIdValue ? options.rootIdValue : null;
|
||||||
|
var firstCode = data[0][options.parentCode];
|
||||||
$.each(data, function(index, item) {
|
$.each(data, function(index, item) {
|
||||||
// 添加一个默认属性,用来判断当前节点有没有被显示
|
// 添加一个默认属性,用来判断当前节点有没有被显示
|
||||||
item.isShow = false;
|
item.isShow = false;
|
||||||
// 这里兼容几种常见Root节点写法
|
// 这里兼容几种常见Root节点写法
|
||||||
// 默认的几种判断
|
// 默认的几种判断
|
||||||
var firstCode = (0 == index ? item[options.parentCode] : '-');
|
|
||||||
var _defaultRootFlag = item[options.parentCode] == '0' ||
|
var _defaultRootFlag = item[options.parentCode] == '0' ||
|
||||||
item[options.parentCode] == 0 ||
|
item[options.parentCode] == 0 ||
|
||||||
item[options.parentCode] == null ||
|
item[options.parentCode] == null ||
|
||||||
|
|
|
@ -42,6 +42,12 @@ $(document).ready(function(){
|
||||||
var ip = /^(?:(?:2[0-4][0-9]\.)|(?:25[0-5]\.)|(?:1[0-9][0-9]\.)|(?:[1-9][0-9]\.)|(?:[0-9]\.)){3}(?:(?:2[0-4][0-9])|(?:25[0-5])|(?:1[0-9][0-9])|(?:[1-9][0-9])|(?:[0-9]))$/;
|
var ip = /^(?:(?:2[0-4][0-9]\.)|(?:25[0-5]\.)|(?:1[0-9][0-9]\.)|(?:[1-9][0-9]\.)|(?:[0-9]\.)){3}(?:(?:2[0-4][0-9])|(?:25[0-5])|(?:1[0-9][0-9])|(?:[1-9][0-9])|(?:[0-9]))$/;
|
||||||
return this.optional(element) || (ip).test(value);
|
return this.optional(element) || (ip).test(value);
|
||||||
},"IP地址格式示例127.0.0.1");
|
},"IP地址格式示例127.0.0.1");
|
||||||
|
jQuery.validator.addMethod("notEqual", function(value, element, param) {
|
||||||
|
return value != param;
|
||||||
|
}, $.validator.format("输入值不允许为{0}"));
|
||||||
|
jQuery.validator.addMethod("gt", function(value, element, param) {
|
||||||
|
return value > param;
|
||||||
|
}, $.validator.format("输入值必须大于{0}"));
|
||||||
//校验新旧密码是否相同
|
//校验新旧密码是否相同
|
||||||
jQuery.validator.addMethod("isdiff",function(){
|
jQuery.validator.addMethod("isdiff",function(){
|
||||||
var p1=$("#pwdOld").val();
|
var p1=$("#pwdOld").val();
|
||||||
|
|
|
@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${params.dataScope}
|
${params.dataScope}
|
||||||
order by d.order_num
|
order by d.parent_id, d.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||||
|
|
|
@ -35,19 +35,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||||
LEFT JOIN sys_role ro on ur.role_id = ro.role_id
|
LEFT JOIN sys_role ro on ur.role_id = ro.role_id
|
||||||
where ur.user_id = #{userId} and m.menu_type in ('M', 'C') and m.visible = 0 AND ro.status = 0
|
where ur.user_id = #{userId} and m.menu_type in ('M', 'C') and m.visible = 0 AND ro.status = 0
|
||||||
order by m.order_num
|
order by m.parent_id, m.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectMenuNormalAll" resultMap="SysMenuResult">
|
<select id="selectMenuNormalAll" resultMap="SysMenuResult">
|
||||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.url, m.perms, m.target, m.menu_type, m.icon, m.order_num, m.create_time
|
select distinct m.menu_id, m.parent_id, m.menu_name, m.url, m.perms, m.target, m.menu_type, m.icon, m.order_num, m.create_time
|
||||||
from sys_menu m
|
from sys_menu m
|
||||||
where m.menu_type in ('M', 'C') and m.visible = 0
|
where m.menu_type in ('M', 'C') and m.visible = 0
|
||||||
order by m.order_num
|
order by m.parent_id, m.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectMenuAll" resultMap="SysMenuResult">
|
<select id="selectMenuAll" resultMap="SysMenuResult">
|
||||||
<include refid="selectMenuVo"/>
|
<include refid="selectMenuVo"/>
|
||||||
order by order_num
|
order by m.parent_id, m.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPermsByUserId" parameterType="Long" resultType="String">
|
<select id="selectPermsByUserId" parameterType="Long" resultType="String">
|
||||||
|
@ -76,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND visible = #{visible}
|
AND visible = #{visible}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by order_num
|
order by parent_id, order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteMenuById" parameterType="Long">
|
<delete id="deleteMenuById" parameterType="Long">
|
||||||
|
|
Loading…
Reference in New Issue