mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-05 09:42:47 +08:00
实现view的扩展架构;调整think-view依赖;发布新版本
This commit is contained in:
32
extend/base/admin/view/system/auth/authorize.js
Normal file
32
extend/base/admin/view/system/auth/authorize.js
Normal file
@@ -0,0 +1,32 @@
|
||||
$(function () {
|
||||
var tree = layui.tree;
|
||||
|
||||
ua.request.get(
|
||||
{
|
||||
url: window.location.href,
|
||||
}, function (res) {
|
||||
res.data = res.data || [];
|
||||
tree.render({
|
||||
elem: '#node_ids',
|
||||
data: res.data,
|
||||
showCheckbox: true,
|
||||
id: 'nodeDataId',
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
ua.listen(function (data) {
|
||||
var checkedData = tree.getChecked('nodeDataId');
|
||||
var ids = [];
|
||||
$.each(checkedData, function (i, v) {
|
||||
ids.push(v.id);
|
||||
if (v.children !== undefined && v.children.length > 0) {
|
||||
$.each(v.children, function (ii, vv) {
|
||||
ids.push(vv.id);
|
||||
});
|
||||
}
|
||||
});
|
||||
data.node = JSON.stringify(ids);
|
||||
return data;
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user