From a310eabeb950b292cc80046f0d758fc7c58c65bc Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 16 九月 2022 12:09:23 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/cstmr/cstmr.js | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 51 insertions(+), 3 deletions(-)
diff --git a/src/main/webapp/static/js/cstmr/cstmr.js b/src/main/webapp/static/js/cstmr/cstmr.js
index 40c8070..c2cac53 100644
--- a/src/main/webapp/static/js/cstmr/cstmr.js
+++ b/src/main/webapp/static/js/cstmr/cstmr.js
@@ -3,9 +3,8 @@
layui.config({
base: baseUrl + "/static/layui/lay/modules/"
}).extend({
- dropdown: 'dropdown/dropdown',
cascader: 'cascader/cascader',
-}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'dropdown', 'element', 'cascader'], function(){
+}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function(){
var table = layui.table;
var $ = layui.jquery;
var layer = layui.layer;
@@ -14,6 +13,55 @@
var admin = layui.admin;
var xmSelect = layui.xmSelect;
var cascader = layui.cascader;
+ var tree = layui.tree;
+ var dropdown = layui.dropdown;
+
+ dropdown.render({
+ elem: '#slrassa'
+ ,content: ['<div id="organizationTree" style="height: calc(100vh - 525px);border: none"></div>'].join('')
+ ,style: 'width: 370px; height: 500px; padding: 0 15px; box-shadow: 1px 1px 30px rgb(0 0 0 / 12%);'
+ ,ready: function(){
+ loadTree();
+ }
+ });
+
+ // 鏍戝舰鍥�
+ var organizationTree;
+ var selObj;
+ window.loadTree = function(condition){
+ $.ajax({
+ url: baseUrl+"/dept/user/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');
+ tableIns.reload({
+ where: {dept_id: obj.data.id},
+ page: {curr: 1}
+ });
+ }
+ });
+ treeData = res.data;
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ } else {
+ layer.msg(res.msg)
+ }
+ }
+ })
+ }
// 鏁版嵁娓叉煋
tableIns = table.render({
@@ -24,7 +72,7 @@
limit: 15,
limits: [15, 30, 50, 100, 200, 500],
cellMinWidth: 100,
- height: 'full-145',
+ height: 'full-148',
// size: 'sm',
skin: 'line',
cols: [[
--
Gitblit v1.9.1