<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('告警列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>告警名称：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <label>告警级别：</label>
                                <input type="text" name="alarmlevel"/>
                            </li>
                            <li>
                                <label>告警类型：</label>
                                <select name="alarmtype">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>设备类型：</label>
                                <select name="devietype">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>建筑：</label>
                                <input type="text" name="build"/>
                            </li>
                            <li>
                                <label>楼层：</label>
                                <input type="text" name="floor"/>
                            </li>
                            <li>
                                <label>告警位置x：</label>
                                <input type="text" name="x"/>
                            </li>
                            <li>
                                <label>告警位置y：</label>
                                <input type="text" name="y"/>
                            </li>
                            <li>
                                <label>z：</label>
                                <input type="text" name="z"/>
                            </li>
                            <li>
                                <label>设备id：</label>
                                <input type="text" name="deviceid"/>
                            </li>
                            <li>
                                <label>处理状态：</label>
                                <select name="status">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>发生地点：</label>
                                <input type="text" name="address"/>
                            </li>
                            <li>
                                <label>确认时间：</label>
                                <input type="text" name="confirmtime"/>
                            </li>
                            <li>
                                <label>告警时间：</label>
                                <input type="text" name="atime"/>
                            </li>
                            <li>
                                <label>处置人：</label>
                                <input type="text" name="hanlder"/>
                            </li>
                            <li>
                                <label>处置时间：</label>
                                <input type="text" name="handtime"/>
                            </li>
                            <li>
                                <label>位置类型：</label>
                                <select name="positiontype">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <label>大分类：</label>
                                <input type="text" name="sortId"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="zhny:alarm:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="zhny:alarm:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="zhny:alarm:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="zhny:alarm:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('zhny:alarm:edit')}]];
        var removeFlag = [[${@permission.hasPermi('zhny:alarm:remove')}]];
        var prefix = ctx + "zhny/alarm";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "告警",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'name',
                    title: '告警名称'
                },
                {
                    field: 'alarmlevel',
                    title: '告警级别'
                },
                {
                    field: 'alarmtype',
                    title: '告警类型'
                },
                {
                    field: 'devietype',
                    title: '设备类型'
                },
                {
                    field: 'build',
                    title: '建筑'
                },
                {
                    field: 'floor',
                    title: '楼层'
                },
                {
                    field: 'x',
                    title: '告警位置x'
                },
                {
                    field: 'y',
                    title: '告警位置y'
                },
                {
                    field: 'z',
                    title: 'z'
                },
                {
                    field: 'deviceid',
                    title: '设备id'
                },
                {
                    field: 'description',
                    title: '告警描述'
                },
                {
                    field: 'status',
                    title: '处理状态'
                },
                {
                    field: 'address',
                    title: '发生地点'
                },
                {
                    field: 'confirmtime',
                    title: '确认时间'
                },
                {
                    field: 'imgurl',
                    title: '图片链接'
                },
                {
                    field: 'atime',
                    title: '告警时间'
                },
                {
                    field: 'hanlder',
                    title: '处置人'
                },
                {
                    field: 'handtime',
                    title: '处置时间'
                },
                {
                    field: 'comment',
                    title: '处理信息'
                },
                {
                    field: 'positiontype',
                    title: '位置类型'
                },
                {
                    field: 'sortId',
                    title: '大分类'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>