/** layui-v2.5.6 MIT License By https://www.layui.com */ layui.define("form", function(e) { "use strict"; var i = layui.$, // 获取layui的$对象 a = layui.form, // 获取layui的form模块 n = layui.layer, // 获取layui的layer模块 t = "tree", // 树形结构的模块名称 r = { config: {}, index: layui[t] ? layui[t].index + 1e4 : 0, // 设置唯一的树形组件索引 set: function(e) { var a = this; return a.config = i.extend({}, a.config, e), a; // 合并配置项 }, on: function(e, i) { return layui.onevent.call(this, t, e, i); // 绑定事件 } }, l = function() { var e = this, i = e.config, a = i.id || e.index; return l.that[a] = e, l.config[a] = i, { config: i, reload: function(i) { e.reload.call(e, i); }, getChecked: function() { return e.getChecked.call(e); }, setChecked: function(i) { return e.setChecked.call(e, i); } }; }, c = "layui-hide", // 隐藏样式 d = "layui-disabled", // 禁用样式 s = "layui-tree-set", // 树节点容器 o = "layui-tree-iconClick", // 树节点点击图标 h = "layui-icon-addition", // 加号图标 u = "layui-icon-subtraction", // 减号图标 p = "layui-tree-entry", // 树节点条目 f = "layui-tree-main", // 树节点主容器 y = "layui-tree-txt", // 树节点文本 v = "layui-tree-pack", // 树节点包裹容器 C = "layui-tree-spread", // 树节点展开样式 k = "layui-tree-setLineShort", // 树节点短线样式 m = "layui-tree-showLine", // 显示树节点连接线 x = "layui-tree-lineExtend", // 树节点连接线延伸样式 // 构造函数 b = function(e) { var a = this; a.index = ++r.index; a.config = i.extend({}, a.config, r.config, e); a.render(); // 渲染树形组件 }; b.prototype.config = { data: [], // 树节点数据 showCheckbox: !1, // 是否显示复选框 showLine: !0, // 是否显示连线 accordion: !1, // 是否开启手风琴模式 onlyIconControl: !1, // 是否仅通过点击图标控制展开收缩 isJump: !1, // 是否跳转链接 edit: !1, // 是否允许编辑操作 text: { defaultNodeName: "未命名", // 默认节点名称 none: "无数据" // 无数据时显示的文本 } }; // 重新加载树形组件 b.prototype.reload = function(e) { var a = this; layui.each(e, function(e, i) { i.constructor === Array && delete a.config[e]; // 清除旧的配置项 }); a.config = i.extend(!0, {}, a.config, e); // 更新配置项 a.render(); // 重新渲染 }; // 渲染树形组件 b.prototype.render = function() { var e = this, a = e.config; e.checkids = []; var n = i('
'); e.tree(n); // 构建树形结构 var t = a.elem = i(a.elem); if (t[0]) { if (e.key = a.id || e.index, e.elem = n, e.elemNone = i('