| | |
| | | |
| | | var insTb = table.render({ |
| | | elem: '#originTable', |
| | | url: baseUrl + '/host/list/auth', |
| | | url: baseUrl + '/item/list/auth', |
| | | height: 'full-100', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | request: { |
| | |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | toolbar: ['<p>', |
| | | /*toolbar: ['<p>', |
| | | '<button lay-event="add" class="layui-btn layui-btn-sm icon-btn"><i class="layui-icon"></i>添加</button> ', |
| | | '<button lay-event="edit" class="layui-btn layui-btn-sm layui-btn-warm 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(''), |
| | | '</p>'].join(''),*/ |
| | | defaultToolbar: [], |
| | | cols: [[ |
| | | {field: 'id', title: '编号', width: 70, align: 'center'}, |
| | |
| | | /* 表格搜索 */ |
| | | form.on('submit(originTbReset)', function (data) { |
| | | insTb.reload(); |
| | | insTb2.reload({where: {host_id: null}, page: {curr: 1}}); |
| | | insTb2.reload({where: {item_id: null}, page: {curr: 1}}); |
| | | return false; |
| | | }); |
| | | |
| | |
| | | table.on('row(originTable)', function (obj) { |
| | | selObj = obj; |
| | | obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click'); |
| | | insTb2.reload({where: {host_id: obj.data.id}, page: {curr: 1}}); |
| | | insTb2.reload({where: {item_id: obj.data.id}, page: {curr: 1}}); |
| | | }); |
| | | |
| | | /* 显示表单弹窗 */ |