This commit is contained in:
walkor 2022-12-20 16:48:39 +08:00
parent f9b4394d20
commit 846be6eecc
2 changed files with 6 additions and 6 deletions

View File

@ -127,7 +127,7 @@
// 字段 角色 roles // 字段 角色 roles
layui.use(["jquery", "xmSelect"], function() { layui.use(["jquery", "xmSelect"], function() {
layui.$.ajax({ layui.$.ajax({
url: "/app/admin/role/select?format=select", url: "/app/admin/role/select?format=tree",
dataType: "json", dataType: "json",
success: function (e) { success: function (e) {
let value = layui.$("#roles").attr("value"); let value = layui.$("#roles").attr("value");
@ -136,9 +136,9 @@
el: "#roles", el: "#roles",
name: "roles", name: "roles",
initValue: initValue, initValue: initValue,
data: e.data, data: e.data,
tree: {"show":true}, tree: {"show":true, expandedKeys:true, strict:false},
toolbar: {"show":true,"list":["ALL","CLEAR","REVERSE"]}, toolbar: {show:true, list:["ALL","CLEAR","REVERSE"]},
}) })
} }
}); });

View File

@ -150,7 +150,7 @@
// 字段 角色 roles // 字段 角色 roles
layui.use(["jquery", "xmSelect"], function() { layui.use(["jquery", "xmSelect"], function() {
layui.$.ajax({ layui.$.ajax({
url: "/app/admin/role/select?format=select", url: "/app/admin/role/select?format=tree",
dataType: "json", dataType: "json",
success: function (e) { success: function (e) {
let value = layui.$("#roles").attr("value"); let value = layui.$("#roles").attr("value");
@ -160,7 +160,7 @@
name: "roles", name: "roles",
initValue: initValue, initValue: initValue,
data: e.data, data: e.data,
tree: {show: true, expandedKeys: initValue}, tree: {show: true, expandedKeys: initValue, strict: false},
toolbar: {show: true, list: ["ALL","CLEAR","REVERSE"]}, toolbar: {show: true, list: ["ALL","CLEAR","REVERSE"]},
}) })
} }