<!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" name="userUrl"/>
                            </li>
                            <li>
                                <label>任务名称：</label>
                                <input type="text" name="title"/>
                            </li>
                            <li>
                                <label>状态：</label>
                                <input type="text" name="state"/>
                            </li>
                            <li>
                                <label>有效日期：</label>
                                <input type="text" class="time-input" placeholder="请选择有效日期" name="validTime"/>
                            </li>
                            <li>
                                <label>地区id：</label>
                                <input type="text" name="areaId"/>
                            </li>
                            <li>
                                <label>地区名称：</label>
                                <input type="text" name="areaName"/>
                            </li>
                            <li>
                                <label>开始：</label>
                                <input type="text" name="startPrice"/>
                            </li>
                            <li>
                                <label>结束：</label>
                                <input type="text" name="endPrice"/>
                            </li>
                            <li>
                                <label>联系人：</label>
                                <input type="text" name="userName"/>
                            </li>
                            <li>
                                <label>联系电话：</label>
                                <input type="text" name="phone"/>
                            </li>
                            <li>
                                <label>查看次数：</label>
                                <input type="text" name="look"/>
                            </li>
                            <li>
                                <label>收藏次数：</label>
                                <input type="text" name="storeNumber"/>
                            </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="business:reward:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="business:reward:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:reward:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:reward: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:reward:edit')}]];
        var removeFlag = [[${@permission.hasPermi('business:reward:remove')}]];
        var prefix = ctx + "business/reward";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "我的悬赏",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'rewardId',
                    title: '${comment}',
                    visible: false
                },
                {
                    field: 'userId',
                    title: '用户主键'
                },
                {
                    field: 'userUrl',
                    title: '用户图像'
                },
                {
                    field: 'type',
                    title: '悬赏类型，0是需求，1供应'
                },
                {
                    field: 'title',
                    title: '任务名称'
                },
                {
                    field: 'state',
                    title: '状态'
                },
                {
                    field: 'rewardDesc',
                    title: '任务说明'
                },
                {
                    field: 'validTime',
                    title: '有效日期'
                },
                {
                    field: 'areaId',
                    title: '地区id'
                },
                {
                    field: 'areaName',
                    title: '地区名称'
                },
                {
                    field: 'payType',
                    title: '悬赏方式，0位无悬赏，1位按金额，2为按比例'
                },
                {
                    field: 'startPrice',
                    title: '开始'
                },
                {
                    field: 'endPrice',
                    title: '结束'
                },
                {
                    field: 'userName',
                    title: '联系人'
                },
                {
                    field: 'phone',
                    title: '联系电话'
                },
                {
                    field: 'look',
                    title: '查看次数'
                },
                {
                    field: 'storeNumber',
                    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.rewardId + '\')"><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.rewardId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>