This commit is contained in:
walkor 2022-12-19 15:03:34 +08:00
parent ddbe85c6c0
commit 5576a94f59
3 changed files with 15 additions and 7 deletions

View File

@ -75,7 +75,7 @@ class RoleController extends Crud
}
if (isset($data['pid'])) {
if ($data['pid'] == $id) {
return $this->json(1, '父不能是自己');
return $this->json(1, '父不能是自己');
}
if ($data['pid'] == 0) {
return $this->json(1, '请选择父级权限组');

View File

@ -72,7 +72,7 @@
el: "#rules",
name: "rules",
initValue: initValue,
data: e.data,
data: e.data,
tree: {"show":true,expandedKeys:initValue},
toolbar: {show:true,list:["ALL","CLEAR","REVERSE"]},
})
@ -80,7 +80,7 @@
});
});
// 字段 上级id pid
// 字段 父级 pid
layui.use(["jquery", "xmSelect"], function() {
layui.$.ajax({
url: "/app/admin/role/select?format=tree",
@ -92,10 +92,14 @@
el: "#pid",
name: "pid",
initValue: initValue,
data: e.data,
tips: "请选择",
toolbar: {show: true, list: ["CLEAR"]},
data: e.data,
value: "0",
model: {"icon":"hidden","label":{"type":"text"}},
clickClose: true,
radio: true,
tree: {show: true,"strict":false,"clickCheck":true,"clickExpand":false,expandedKeys:true},
})
}
});

View File

@ -96,7 +96,7 @@
el: "#rules",
name: "rules",
initValue: initValue,
data: e.data,
data: e.data,
tree: {"show":true,expandedKeys:initValue},
toolbar: {show:true,list:["ALL","CLEAR","REVERSE"]},
})
@ -104,7 +104,7 @@
});
});
// 字段 上级id pid
// 字段 父级角色组 pid
layui.use(["jquery", "xmSelect"], function() {
layui.$.ajax({
url: "/app/admin/role/select?format=tree",
@ -116,10 +116,14 @@
el: "#pid",
name: "pid",
initValue: initValue,
data: e.data,
tips: "请选择",
toolbar: {show: true, list: ["CLEAR"]},
data: e.data,
value: "0",
model: {"icon":"hidden","label":{"type":"text"}},
clickClose: true,
radio: true,
tree: {show: true,"strict":false,"clickCheck":true,"clickExpand":false,expandedKeys:true},
})
}
});