| | |
| | | var organizationTree; |
| | | var selObj; |
| | | window.loadTree = function(condition){ |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/dept/user/tree/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | organizationTree = tree.render({ |
| | | elem: '#organizationTree', |
| | |
| | | onlyIconControl: true, |
| | | data: res.data, |
| | | click: function (obj) { |
| | | console.log(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}, |
| | | where: {[obj.data.key]: obj.data.id}, |
| | | page: {curr: 1} |
| | | }); |
| | | } |
| | |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | cellMinWidth: 100, |
| | | // cellMinWidth: 100, |
| | | height: 'full-148', |
| | | // size: 'sm', |
| | | skin: 'line', |