<!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('客户列表')" />
    <th:block th:include="include :: layout-latest-css" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="gray-bg">

<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="user-form">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p th:utext="#{adam.user.page.email}"></p>：<input type="text" name="email"/>
                            </li>
                            <li>
                                <p th:utext="#{adam.user.page.phone}"></p>：<input type="text" name="userPhoneNumber"/>
                            </li>
                            <li>
                                <p th:utext="#{adam.user.page.role}"></p>：
                                <select name="role">
                                    <option value=""><p th:utext="#{admin.page.common.all}"></p></option>
                                    <option th:text="ADMIN" th:value="ADMIN"></option>
                                    <option th:text="COMMON" th:value="COMMON"></option>
                                </select>
                            </li>
<!--                            <li>-->
<!--                                <p th:utext="#{adam.user.userStatus}"></p>：-->
<!--                                <select name="active">-->
<!--                                    <option value="0"><p th:utext="#{adam.user.userStatus.all}"></p></option>-->
<!--                                    <option th:text="#{adam.user.userStatus.active}" th:value="1"></option>-->
<!--                                    <option th:text="#{adam.user.userStatus.inactive}" th:value="2"></option>-->
<!--                                </select>-->
<!--                            </li>-->
                            <li class="select-time">
                                <label><p th:utext="#{admin.page.common.createTime}"></p>： </label>
                                <input type="text" class="time-input" id="startTime" th:placeholder="#{admin.page.common.startTime}" name="createdTimeStart"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" th:placeholder="#{admin.page.common.endTime}" name="createdTimeEnd"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;<p th:utext="#{admin.page.common.search}"></p></a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<p th:utext="#{admin.page.common.reset}"></p></a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
    var resetPwdFlag = [[${@permission.hasPermi('system:user:resetPwd')}]];
    var prefix = ctx + "adam/user";

    $(function() {
        var panehHidden = false;
        if ($(this).width() < 769) {
            panehHidden = true;
        }
        $('body').layout({ initClosed: panehHidden, west__size: 185 });
        queryUserList();
    });

    function queryUserList() {
        var options = {
            url: prefix + "/list",
            sortName: "createTime",
            sortOrder: "desc",
            modalName: "用户",
            columns: [{
                checkbox: false
            },
                {
                    field: 'firstName',
                    title: [[#{adam.user.list.firstName}]]
                },
                {
                    field: 'lastName',
                    title: [[#{adam.user.list.lastName}]],
                    sortable: true
                },
                {
                    field: 'jobTitle',
                    title: [[#{adam.user.list.jobTitle}]]
                },
                {
                    field: 'email',
                    title: [[#{adam.user.list.email}]]
                },
                {
                    field: 'comId',
                    title: [[#{adam.user.list.comId}]]
                },
                {
                    field: 'role',
                    title: [[#{adam.user.list.role}]]
                },
                {
                    field: 'telephone',
                    title: [[#{adam.user.list.telephone}]]
                },
                {
                    field: 'createTime',
                    title: [[#{admin.system.user.list.createTime}]],
                    sortable: true,
                    formatter: function(value) {
                        return value;
                    }
                }]
        };
        $.table.init(options);
    }

    $('#btnExpand').click(function() {
        $._tree.expandAll(true);
        $(this).hide();
        $('#btnCollapse').show();
    });

    $('#btnCollapse').click(function() {
        $._tree.expandAll(false);
        $(this).hide();
        $('#btnExpand').show();
    });


</script>
</body>
</html>
