From a0c704c48b5870bb05221e57d07f6b5a71bb281d Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期二, 13 九月 2022 09:51:42 +0800 Subject: [PATCH] # --- src/main/webapp/static/js/cstmr/cstmr.js | 37 ++++++++++++++++++++++++++++++++++++- 1 files changed, 36 insertions(+), 1 deletions(-) diff --git a/src/main/webapp/static/js/cstmr/cstmr.js b/src/main/webapp/static/js/cstmr/cstmr.js index 40c8070..3a934a6 100644 --- a/src/main/webapp/static/js/cstmr/cstmr.js +++ b/src/main/webapp/static/js/cstmr/cstmr.js @@ -5,7 +5,7 @@ }).extend({ dropdown: 'dropdown/dropdown', cascader: 'cascader/cascader', -}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'dropdown', 'element', 'cascader'], function(){ +}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'dropdown', 'element', 'cascader', 'tree'], function(){ var table = layui.table; var $ = layui.jquery; var layer = layui.layer; @@ -14,6 +14,41 @@ var admin = layui.admin; var xmSelect = layui.xmSelect; var cascader = layui.cascader; + var tree = layui.tree; + + // 鏍戝舰鍥� + var organizationTree; + window.loadTree = function(condition){ + $.ajax({ + url: baseUrl+"/tag/tree/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + 'condition': condition + }, + method: 'POST', + success: function (res) { + if (res.code === 200){ + organizationTree = tree.render({ + elem: '#organizationTree', + id: 'organizationTree', + onlyIconControl: true, + data: res.data, + click: function (obj) { + selObj = obj; + $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click'); + $(obj.elem).children('.layui-tree-entry').addClass('ew-tree-click'); + } + }); + treeData = res.data; + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg) + } + } + }) + } + loadTree(); // 鏁版嵁娓叉煋 tableIns = table.render({ -- Gitblit v1.9.1