<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>推送记录</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
	<link rel="stylesheet" href="../css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
	<div class="layuimini-main">
		<table class="layui-hide" id="forwardParaTableId" lay-filter="forwardParaTableFilter"></table>
	</div>

</div>
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script th:inline="none">
    layui.use(['form', 'table'], function () {
        var $ = layui.$,
            form = layui.form,
            table = layui.table;

		/**
		 **   推送参数组
		 **/
		table.render({
		    elem: '#forwardParaTableId',
		    url: '/fwd/records',
		    toolbar: '#toolbarTable',
			defaultToolbar: ['filter'],
			cols: [[
				{field: 'project_id', title: '项目号', sort: true},
				{field: 'devicenum', title: '推送设备数'},
				{field: 'deviceid', title: '设备号'},
				{field: 'starttime', title: '起始时间', templet: "<div>{{layui.util.toDateString(d.starttime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
				{field: 'endtime', title: '结束时间', templet: "<div>{{layui.util.toDateString(d.endtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
				{field: 'fwd_group_id', title: '推送组'},
				{field: 'state', title: '状态',templet: '#stateTrans'}
			]],
		    limit: 10,
		    page: true,
		    skin: 'line'
		});

    });

</script>
<script type="text/html" id="stateTrans">
	{{#  if(d.state == 0){ }}
	<span>推送完成</span>
	{{# } else if(d.state == 2){ }}
	<span>补传中</span>
	{{# } else if(d.state == 3){ }}
	<span>补传完成</span>
	{{# } else if(d.state == -1){ }}
	<span>推送失败</span>
	{{# } else { }}
	<span >等待</span>
	{{#  } }}
</script>

</body>
</html>