将js代码架构改为app下渲染;

This commit is contained in:
2023-09-18 16:32:46 +08:00
parent 4d9434454e
commit ca729da0a9
86 changed files with 1572 additions and 719 deletions

View 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;
});
});