From 78839ec83b089ed91ad00585748e78f1c724e570 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 16 九月 2022 08:46:28 +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..f12dc04 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+"/dept/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