123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- <!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="competitionTitle" data-template="请输入活动标题"/>
- </li>
- <li>
- <label>活动类型:</label>
- <select name="competitionType" th:with="type=${@dict.getType('competition_type')}">
- <option value="">所有</option>
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
- th:value="${dict.dictValue}"></option>
- </select>
- </li>
- <li>
- <label>场地:</label>
- <input type="text" name="competitionPlace" template="请输入场地"/>
- </li>
- <li>
- <label>活动状态:</label>
- <select name="competitionState" th:with="type=${@dict.getType('competition_state')}">
- <option value="">所有</option>
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
- th:value="${dict.dictValue}"></option>
- </select>
- </li>
- <li>
- <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
- class="fa fa-search"></i> 搜索</a>
- <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
- class="fa fa-refresh"></i> 重置</a>
- </li>
- </ul>
- </div>
- </form>
- </div>
- <div class="btn-group-sm" id="toolbar" role="group">
- <a class="btn btn-success" onclick="$.operate.addToSet()" shiro:hasPermission="system:competition:add">
- <i class="fa fa-plus"></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 publisFlag = [[${@permission.hasPermi('system:competiton:publish')}]]
- var editFlag = [[${@permission.hasPermi('system:competition:edit')}]];
- var removeFlag = [[${@permission.hasPermi('system:competition:remove')}]];
- var competitionTypeDatas = [[${@dict.getType('competition_type')}]];
- var competitionStateDatas = [[${@dict.getType('competition_state')}]];
- var prefix = ctx + "competition";
- $(function () {
- var options = {
- url: prefix + "/list",
- createUrl: prefix + "/add",
- updateUrl: prefix + "/edit/{id}",
- removeUrl: prefix + "/remove",
- publishUrl: prefix + "/publish",
- exportUrl: prefix + "/export",
- modalName: "赛事",
- columns: [
- /* {
- checkbox: false
- },*/
- {
- field: 'id',
- title: 'id',
- visible: false
- },
- {
- field: 'competitionTitle',
- title: '赛事标题'
- },
- {
- field: 'competitionType',
- title: '赛事类型',
- formatter: function (value, row, index) {
- return $.table.selectDictLabel(competitionTypeDatas, value);
- }
- },
- {
- field: 'teamMax',
- title: '最大人数/团队数'
- },
- {
- field: 'competitionPlace',
- title: '场地'
- },
- {
- field: 'applyStartTime',
- title: '赛事开始时间'
- },
- {
- field: 'applyEndTime',
- title: '赛事结束时间'
- },
- {
- field: 'applyBeforeTime',
- title: '取消报名截至时间',
- formatter: function (value, row, index) {
- return "赛事开始前"+value+"小时";
- }
- },
- {
- field: 'competitionExpense',
- title: '报名费用'
- },{
- field: 'viewingTicket',
- title: '观看费用'
- },
- {
- field: 'competitionState',
- title: '赛事状态',
- formatter: function (value, row, index) {
- return $.table.selectDictLabel(competitionStateDatas, value);
- }
- },
- {
- title: '操作',
- align: 'center',
- formatter: function (value, row, index) {
- var actions = [];
- if (row.competitionState === 'competiton_state_1') {
- actions.push('<a class="btn btn-success btn-xs ' + publisFlag + '" href="javascript:void(0)" onclick="$.operate.publish(\'' + row.id + '\', \'' + row.competitionTitle + '\')"><i class="fa fa-edit"></i>发布</a> ')
- 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>');
- } else if(row.competitionState === 'competiton_state_4'){
- }else {
- actions.push('<a class="btn btn-success btn-xs ' + publisFlag + '" href="javascript:void(0)" onclick="closeCompetition(\'' + row.id + '\')"><i class="fa fa-close"></i>关闭</a> ')
- }
- return actions.join('');
- }
- }]
- };
- $.table.init(options);
- });
- function closeCompetition(id){
- alert(id);
- $.ajax({
- url: prefix + "/close",
- type: "GET",
- data: {id:id},
- success: function(res){
- alert(res)
- },
- error: function(err){
- alert(err)
- }
- })
- }
- </script>
- </body>
- </html>
|