mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-09 19:42:47 +08:00
getDataBrage支持多级嵌套取值
This commit is contained in:
@@ -2270,7 +2270,7 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
|
|||||||
return defaultValue;
|
return defaultValue;
|
||||||
},
|
},
|
||||||
dataBrage: null,
|
dataBrage: null,
|
||||||
getDataBrage(name, defaultValue) {
|
getDataBrage(keys, defaultValue) {
|
||||||
if (this.dataBrage == null) {
|
if (this.dataBrage == null) {
|
||||||
this.dataBrage = JSON.parse($('#data-brage').text());
|
this.dataBrage = JSON.parse($('#data-brage').text());
|
||||||
}
|
}
|
||||||
@@ -2279,11 +2279,12 @@ define(["jquery", "tableSelect", "ckeditor", 'miniTheme', 'tableData', 'citypick
|
|||||||
defaultValue = undefined;
|
defaultValue = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof this.dataBrage[name] == 'undefined') {
|
return (
|
||||||
return defaultValue;
|
(!Array.isArray(keys)
|
||||||
}
|
? keys.replace(/\[/g, '.').replace(/\]/g, '').split('.')
|
||||||
|
: keys
|
||||||
return this.dataBrage[name];
|
).reduce((o, k) => (o || {})[k], this.dataBrage) || defaultVal
|
||||||
|
);
|
||||||
|
|
||||||
},
|
},
|
||||||
getExtGroupName(ext) {
|
getExtGroupName(ext) {
|
||||||
|
|||||||
Reference in New Issue
Block a user