1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
| layui.use(['form', 'table', 'element', 'upload','restClient'], function () {
var form = layui.form; var allHeight = $('.layui-body').height()-15; var offsetPercent = (allHeight-70)/allHeight allHeight *= offsetPercent; var halfHeight = allHeight/2; var lay_off_size = halfHeight $('.layui-upload-list').css('height', allHeight*0.994-$("#upload").height()); window.onresize = function(){ allHeight =$('.layui-body').height()-15; offsetPercent = (allHeight-70)/allHeight allHeight *= offsetPercent; halfHeight = allHeight/2; $('.layui-upload-list').css('height', allHeight*0.994-$("#upload").height());
table.reload('pic-mod-table', { height:halfHeight }); table.reload('task-pic-mod-table', { height:halfHeight }); table.reload('his-pic-mod-table', { height:halfHeight }); } table.on('row(pic-mod-table)', function (obj) { his_table_render(obj.data,halfHeight); }); var his_table_render = function (data,height) { table.render({ elem: '#his-pic-mod-table' , url: applicationUtil.gatewayURL + '/pssc-graph/graph/show-history' , where: data , page: true , response: { statusCode: 200 , countName: 'totalCount' , dataName: 'list' } , height: height , contentType: 'application/json' , method: 'post' , limit: 20 , align: 'center' , parseData: function (res) { return { "code": res.code, "msg": res.msg, "totalCount": res.data.totalCount, "list": res.data.list }; } , cols: [[ {field: 'id', title: '', fixed: 'left', type: 'numbers',width:'5%',align: 'center'} , {field: 'objId', title: '图模ID',width:'20%',align: 'center'} , {field: 'graphId', title: '图模标识',width:'20%',align: 'center'} , { field: 'graphName', title: '图模名称',width:'20%',align: 'center' ,templet: function (d) { return '<span style="color: #339A96;">' + d.graphName + '</span>' } } , {field: 'graphType', title: '图模类型',width:'8%',align: 'center'} , {field: 'createTime', title: '创建时间',width:'15%', sort: true,align: 'center'} , {field: 'graphVersion', title: '图模版本', width:'13%',sort: true,align: 'center'} ]] }); }
}
|