| | |
| | | var treeTable = layui.treeTable; |
| | | var xmSelect = layui.xmSelect; |
| | | |
| | | tableRender = function() { |
| | | var tableIdx = treeTable.render({ |
| | | elem: '#tag', |
| | | url: baseUrl+'/tag/list/auth', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | height: 'full-200', |
| | | toolbar: ['<p>', |
| | | '<button lay-event="add" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon"></i>添加</button> ', |
| | | '<button lay-event="del" class="layui-btn layui-btn-sm layui-btn-danger icon-btn"><i class="layui-icon"></i>删除</button>', |
| | | '</p>'].join(''), |
| | | tree: { |
| | | iconIndex: 1, // 折叠图标显示在第几列 |
| | | isPidData: true, // 是否是id、pid形式数据 |
| | | idName: 'id', // id字段名称 |
| | | pidName: 'parentId' // pid字段名称 |
| | | }, |
| | | toolbar: 'default', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'name', align: 'left',title: '名称'} |
| | | ,{field: 'uuid', align: 'center',title: '编号'} |
| | | ,{field: 'name', align: 'center',title: '名称'} |
| | | // ,{field: 'parentId', align: 'center',title: '父级'} |
| | | ,{field: 'parentName', align: 'center',title: '父级名称'} |
| | | // ,{field: 'path', align: 'center',title: '关联路径'} |
| | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | done: function (data) { |
| | | console.log(data) |
| | | tableIdx.expandAll(); |
| | | // $(".ew-tree-table .ew-tree-table-tool .ew-tree-table-tool-item").css("display", "none"); |
| | | // limit() |
| | | } |
| | | }); |
| | | |
| | | } |
| | | tableRender(); |
| | | |
| | | |
| | | // 头部工具栏点击事件 |