save
This commit is contained in:
parent
5c9188a7ca
commit
58c0370eb4
@ -634,14 +634,14 @@ layui.use(["jquery", "xmSelect"], function() {
|
||||
layui.$.ajax({
|
||||
url: "$url",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#$id").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#$id",
|
||||
name: "$field",
|
||||
initValue: initValue,
|
||||
data: e.data, $options_string
|
||||
data: res.data, $options_string
|
||||
})
|
||||
}
|
||||
});
|
||||
|
@ -1058,10 +1058,10 @@ EOF;
|
||||
$.ajax({
|
||||
url: SELECT_API,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
|
||||
// 给表单初始化数据
|
||||
layui.each(e.data[0], function (key, value) {
|
||||
layui.each(res.data[0], function (key, value) {
|
||||
let obj = $('*[name="'+key+'"]');
|
||||
if (key === "password") {
|
||||
obj.attr("placeholder", "不更新密码请留空");
|
||||
|
@ -125,15 +125,15 @@
|
||||
});
|
||||
|
||||
// 字段 角色 roles
|
||||
layui.use(["jquery", "xmSelect"], function() {
|
||||
layui.use(["jquery", "xmSelect", "popup"], function() {
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/role/select?format=tree",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#roles").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
if (!top.Admin.Account.isSupperAdmin) {
|
||||
layui.each(e.data, function (k, v) {
|
||||
layui.each(res.data, function (k, v) {
|
||||
v.disabled = true;
|
||||
});
|
||||
}
|
||||
@ -141,11 +141,14 @@
|
||||
el: "#roles",
|
||||
name: "roles",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
layVerify: "required",
|
||||
tree: {"show":true, expandedKeys:true, strict:false},
|
||||
toolbar: {show:true, list:["ALL","CLEAR","REVERSE"]},
|
||||
})
|
||||
});
|
||||
if (res.code) {
|
||||
return layui.popup.failure(res.msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -101,10 +101,10 @@
|
||||
$.ajax({
|
||||
url: SELECT_API,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
|
||||
// 给表单初始化数据
|
||||
layui.each(e.data[0], function (key, value) {
|
||||
layui.each(res.data[0], function (key, value) {
|
||||
let obj = $('*[name="'+key+'"]');
|
||||
if (key === "password") {
|
||||
obj.attr("placeholder", "不更新密码请留空");
|
||||
@ -152,11 +152,11 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/role/select?format=tree",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#roles").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
if (!top.Admin.Account.isSupperAdmin) {
|
||||
layui.each(e.data, function (k, v) {
|
||||
layui.each(res.data, function (k, v) {
|
||||
v.disabled = true;
|
||||
});
|
||||
}
|
||||
@ -164,7 +164,7 @@
|
||||
el: "#roles",
|
||||
name: "roles",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
layVerify: "required",
|
||||
tree: {show: true, expandedKeys: true, strict: false},
|
||||
toolbar: {show: true, list: ["ALL","CLEAR","REVERSE"]},
|
||||
@ -173,6 +173,10 @@
|
||||
});
|
||||
});
|
||||
|
||||
if (res.code) {
|
||||
return layui.popup.failure(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -51,8 +51,8 @@
|
||||
$.ajax({
|
||||
url: SCHEMA_API,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
let cols = e.data;
|
||||
success: function (res) {
|
||||
let cols = res.data;
|
||||
layui.each(cols, function (k, v) {
|
||||
if (v.field === "installed") {
|
||||
cols[k].templet = "#install";
|
||||
|
@ -65,14 +65,14 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/role/rules?id=1",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#rules").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#rules",
|
||||
name: "rules",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
tree: {"show":true,expandedKeys:initValue},
|
||||
toolbar: {show:true,list:["ALL","CLEAR","REVERSE"]},
|
||||
})
|
||||
@ -85,7 +85,7 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/role/select?format=tree",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#pid").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
@ -93,7 +93,7 @@
|
||||
name: "pid",
|
||||
initValue: initValue,
|
||||
tips: "请选择",
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
value: "0",
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
|
@ -67,10 +67,10 @@
|
||||
$.ajax({
|
||||
url: SELECT_API,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
|
||||
// 给表单初始化数据
|
||||
layui.each(e.data[0], function (key, value) {
|
||||
layui.each(res.data[0], function (key, value) {
|
||||
let obj = $('*[name="'+key+'"]');
|
||||
if (key === "password") {
|
||||
obj.attr("placeholder", "不更新密码请留空");
|
||||
@ -87,16 +87,16 @@
|
||||
// 字段 权限 rules
|
||||
layui.use(["jquery", "xmSelect"], function() {
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/role/rules?id=" + e.data[0].pid,
|
||||
url: "/app/admin/role/rules?id=" + res.data[0].pid,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#rules").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#rules",
|
||||
name: "rules",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
tree: {"show":true,expandedKeys:initValue},
|
||||
toolbar: {show:true,list:["ALL","CLEAR","REVERSE"]},
|
||||
})
|
||||
@ -109,7 +109,7 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/role/select?format=tree",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#pid").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
@ -118,7 +118,7 @@
|
||||
initValue: initValue,
|
||||
tips: "请选择",
|
||||
toolbar: {show: true, list: ["CLEAR"]},
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
value: "0",
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
|
@ -107,7 +107,7 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/rule/select?format=tree&type=0,1",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#pid").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
@ -116,7 +116,7 @@
|
||||
initValue: initValue,
|
||||
tips: "无",
|
||||
toolbar: {show: true, list: ["CLEAR"]},
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
value: "0",
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
|
@ -100,10 +100,10 @@
|
||||
$.ajax({
|
||||
url: SELECT_API,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
|
||||
// 赋值表单
|
||||
layui.each(e.data[0], function (key, value) {
|
||||
layui.each(res.data[0], function (key, value) {
|
||||
let obj = $('*[name="'+key+'"]');
|
||||
if (key === "password") {
|
||||
obj.attr("placeholder", "不更新密码请留空");
|
||||
@ -131,7 +131,7 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/rule/select?format=tree&type=0,1",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#pid").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
@ -140,7 +140,7 @@
|
||||
initValue: initValue,
|
||||
tips: "无",
|
||||
toolbar: {show: true, list: ["CLEAR"]},
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
radio: true,
|
||||
|
@ -82,7 +82,7 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/rule/select?format=tree&type=0,1",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#pid").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
@ -90,7 +90,7 @@
|
||||
name: "pid",
|
||||
initValue: initValue,
|
||||
tips: "无",
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
toolbar: {show: true, list: ["CLEAR"]},
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
|
@ -48,8 +48,8 @@
|
||||
$.ajax({
|
||||
url: SELECT_API,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
layui.each(e.data[0], function (key, value) {
|
||||
success: function (res) {
|
||||
layui.each(res.data[0], function (key, value) {
|
||||
let obj = $('*[name="'+key+'"]');
|
||||
if (key === "password") {
|
||||
obj.attr("placeholder", "不更新密码请留空");
|
||||
|
@ -80,8 +80,8 @@
|
||||
$.ajax({
|
||||
url: SCHEMA_API,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
let forms = e.data.forms;
|
||||
success: function (res) {
|
||||
let forms = res.data.forms;
|
||||
let cols = [{
|
||||
type: "checkbox"
|
||||
}];
|
||||
|
@ -121,14 +121,14 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/dict/get/upload",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#category").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#category",
|
||||
name: "category",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
radio: true,
|
||||
|
@ -114,14 +114,14 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/dict/get/upload",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#category").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#category",
|
||||
name: "category",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
radio: true,
|
||||
|
@ -66,14 +66,14 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/dict/get/upload",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#category").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#category",
|
||||
name: "category",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
radio: true,
|
||||
|
@ -52,10 +52,10 @@
|
||||
$.ajax({
|
||||
url: SELECT_API,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
|
||||
// 给表单初始化数据
|
||||
layui.each(e.data[0], function (key, value) {
|
||||
layui.each(res.data[0], function (key, value) {
|
||||
let obj = $('*[name="'+key+'"]');
|
||||
if (typeof obj[0] === "undefined" || !obj[0].nodeName) return;
|
||||
obj.attr("value", value);
|
||||
@ -82,14 +82,14 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/dict/get/upload",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#category").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#category",
|
||||
name: "category",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
radio: true,
|
||||
|
@ -183,14 +183,14 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/dict/get/sex",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#sex").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#sex",
|
||||
name: "sex",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
radio: true,
|
||||
|
@ -163,14 +163,14 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/dict/get/sex",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#sex").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#sex",
|
||||
name: "sex",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
value: "1",
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
|
@ -165,10 +165,10 @@
|
||||
$.ajax({
|
||||
url: SELECT_API,
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
|
||||
// 给表单初始化数据
|
||||
layui.each(e.data[0], function (key, value) {
|
||||
layui.each(res.data[0], function (key, value) {
|
||||
let obj = $('*[name="'+key+'"]');
|
||||
if (key === "password") {
|
||||
obj.attr("placeholder", "不更新密码请留空");
|
||||
@ -187,14 +187,14 @@
|
||||
layui.$.ajax({
|
||||
url: "/app/admin/dict/get/sex",
|
||||
dataType: "json",
|
||||
success: function (e) {
|
||||
success: function (res) {
|
||||
let value = layui.$("#sex").attr("value");
|
||||
let initValue = value ? value.split(",") : [];
|
||||
layui.xmSelect.render({
|
||||
el: "#sex",
|
||||
name: "sex",
|
||||
initValue: initValue,
|
||||
data: e.data,
|
||||
data: res.data,
|
||||
model: {"icon":"hidden","label":{"type":"text"}},
|
||||
clickClose: true,
|
||||
radio: true,
|
||||
|
Loading…
Reference in New Issue
Block a user