layui.extend({
	admin: '{/}../../static/js/admin'
});
layui.use(['table', 'jquery','form', 'admin','laydate'], function() {
	var table = layui.table,
		$ = layui.jquery,
		form = layui.form,
		laydate = layui.laydate,
		admin = layui.admin;
		//执行一个laydate实例
		laydate.render({
			elem: '#start' //指定元素
		});
		laydate.render({
			elem:'#end'
		});
	// 报警记录
	table.render({
		elem: '#articleList',
		cellMinWidth: 80,
		cols: [
			[{
				type: 'checkbox'
			}, {
				field: 'id',title: 'ID',sort: true
			}, {
				field: 'title',title: '标题',templet: '#usernameTpl'
			}, {
				field: 'date',title: '发布时间',sort: true
			}, {
				field: 'category',title: '状态',sort: true
			}, {
				field: 'sort',title: '排序',sort: true
			}, {
				field: 'operate',title: '操作',toolbar: '#operateTpl',unresize: true
			}]
		],
		data: [{
			"id": "1",
			"title": "WeAdmin的第一个版本在不断地抽空完善学习中",
			"date": "2018-02-03",
			"category": "未解决",
			"sort": "1",
		}, {
			"id": "2",
			"title": "WeAdmin的测试数据一二三四五六七",
			"date": "2018-02-03",
			"category": "已解决",
			"sort": "1",
		}],
		event: true,
		page: true
	});
	// 报警解决记录
	table.render({
		elem: '#SolveList',
		cellMinWidth: 80,
		cols: [
			[{
				type: 'checkbox'
			}, {
				field: 'id',title: 'ID',sort: true
			}, {
				field: 'title',title: '标题',templet: '#usernameTpl'
			}, {
				field: 'date',title: '发布时间',sort: true
			}, {
				field: 'category',title: '状态',sort: true
			}, {
				field: 'sort',title: '排序',sort: true
			}, {
				field: 'operate',title: '操作',toolbar: '#operateTpl',unresize: true
			}]
		],
		data: [{
			"id": "1",
			"title": "WeAdmin的第一个版本在不断地抽空完善学习中",
			"date": "2018-02-03",
			"category": "已解决",
			"sort": "1",
		}, {
			"id": "2",
			"title": "WeAdmin的测试数据一二三四五六七",
			"date": "2018-02-03",
			"category": "已解决",
			"sort": "1",
		}],
		event: true,
		page: true
	});
	/*
	 *数据表格中form表单元素是动态插入,所以需要更新渲染下
	 * */
	$(function(){
		form.render();
	});
});