<!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="userId"/>
                            </li>
                            <li>
                                <label>查询时间：</label>
                                <input type="text" class="time-input" id="startTime" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" placeholder="开始时间" name="params[beginTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" data-type="datetime" data-format="yyyy-MM-dd HH:mm:ss" placeholder="结束时间" name="params[endTime]"/>
                            </li>
                            <li>
                                <label>查询类型：</label>
                                <select name="queryType" th:with="type=${@dict.getType('query_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>查询状态：</label>
                                <select name="qryStatus" th:with="type=${@dict.getType('query_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>型号名称：</label>
                                <select id="modelId" name="modelId">
                                    <option value="">所有</option>
                                    <option th:each="item : ${modelList}" th:text="${item.modelName}" th:value="${item.id}"></option>
                                </select>

                            </li>
                            <li>
                                <label>序列号：</label>
                                <input type="text" name="serialNo"/>
                            </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-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:query: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('business:query:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:query:remove')}]];
        var queryTypeDatas = [[${@dict.getType('query_type')}]];
        var qryStatusDatas = [[${@dict.getType('query_status')}]];
        var prefix = ctx + "business/query";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "查询履历",
                columns: [
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'userId',
                    title: '查询用户'
                },
                {
                    field: 'userName',
                    title: '用户名称'
                },
                {
                    field: 'qryTime',
                    title: '查询时间'
                },
                {
                    field: 'queryType',
                    title: '查询类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(queryTypeDatas, value);
                    }
                },
                {
                    field: 'qryStatus',
                    title: '查询状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(qryStatusDatas, value);
                    }
                },
                {
                    field: 'modelName',
                    title: '型号名称'
                },
                {
                    field: 'serialNo',
                    title: '序列号'
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>