<!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 th:if="${projectId==null}">
                            <label>活动名称：</label>
                            <input type="text" name="title"/>
                        </li>
                        <li style="display:none">
                            <label>活动id：</label>
                            <input type="text" name="projectId" th:value="${projectId}"/>
                        </li>
                        <li>
                            <label>用户名称：</label>
                            <input type="text" name="name"/>
                        </li>
                        <li>
                            <label>申请组：</label>
                            <input type="text" name="team"/>
                        </li>
                        <li>
                            <label>分配组：</label>
                            <input type="text" name="teamAudit"/>
                        </li>
                        <li>
                            <label>手机号：</label>
                            <input type="text" name="phone"/>
                        </li>
                        <li>
                            <label>性别：</label>
                            <select name="sex">
                                <option value="-1">全部</option>
                                <option value="1">男</option>
                                <option value="2">女</option>
                            </select>
                        </li>
                        <li>
                            <label>审核状态：</label>
                            <select name="status">
                                <option value="-1">全部</option>
                                <option value="0">待审核</option>
                                <option value="1">通过审核</option>
                                <option value="2">未通过待审核</option>
                            </select>
                        </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>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.table.exportExcel()">
                                <i class="fa fa-download"></i> 导出
                            </a>
                        </li>
                    </ul>
                </div>
            </form>
        </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 prefix = ctx + "smile/volunteers";
    $(function () {
        var options = {
            url: prefix + "/list",
            updateUrl: prefix + "/details/{id}",
            // sortName: "sort",
            modalName: "审核志愿者",
            exportUrl: prefix + "/export",
            orderSc: "desc",
            orderItem: "created_at",
            columns: [{
                checkbox: true
            },
                {
                    field: 'mid',
                    title: '序号'
                },
                // {
                //     field: 'uid',
                //     title: '用户id'
                // },
                {
                    field: 'name',
                    title: '姓名'
                },
                {
                    field: 'img',
                    title: '头像',
                    formatter: function (value, row, index) {
                        return $.table.imageView(value, "300", "300");
                    }
                },
                {
                    field: 'sex',
                    title: '性别'
                },
                {
                    field: 'phone',
                    title: '手机号'
                },
                {
                    field: 'projectName',
                    title: '活动名称'
                },
                {
                    field: 'school',
                    title: '学校'
                },
                {
                    field: 'schoolAddress',
                    title: '学校地址'
                },
                {
                    field: 'team1',
                    title: '申请组1'
                },
                {
                    field: 'team2',
                    title: '申请组2'
                },
                {
                    field: 'team3',
                    title: '申请组3'
                },
                {
                    field: 'teamAudit',
                    title: '分配组'
                },
                {
                    field: 'status',
                    title: '状态'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-warning btn-xs " href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.mid + '\')"><i class="fa fa-remove"></i>管理</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
