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 (isset($data['pid'])) {
if ($data['pid'] == $id) { if ($data['pid'] == $id) {
return $this->json(1, '父不能是自己'); return $this->json(1, '父不能是自己');
} }
if ($data['pid'] == 0) { if ($data['pid'] == 0) {
return $this->json(1, '请选择父级权限组'); return $this->json(1, '请选择父级权限组');

View File

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

View File

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