competition.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('赛事发布列表')"/>
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="formId">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. <label>活动标题:</label>
  15. <input type="text" name="competitionTitle" data-template="请输入活动标题"/>
  16. </li>
  17. <li>
  18. <label>活动类型:</label>
  19. <select name="competitionType" th:with="type=${@dict.getType('competition_type')}">
  20. <option value="">所有</option>
  21. <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
  22. th:value="${dict.dictValue}"></option>
  23. </select>
  24. </li>
  25. <li>
  26. <label>场地:</label>
  27. <input type="text" name="competitionPlace" template="请输入场地"/>
  28. </li>
  29. <li>
  30. <label>活动状态:</label>
  31. <select name="competitionState" th:with="type=${@dict.getType('competition_state')}">
  32. <option value="">所有</option>
  33. <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
  34. th:value="${dict.dictValue}"></option>
  35. </select>
  36. </li>
  37. <li>
  38. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
  39. class="fa fa-search"></i>&nbsp;搜索</a>
  40. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
  41. class="fa fa-refresh"></i>&nbsp;重置</a>
  42. </li>
  43. </ul>
  44. </div>
  45. </form>
  46. </div>
  47. <div class="btn-group-sm" id="toolbar" role="group">
  48. <a class="btn btn-success" onclick="$.operate.addToSet()" shiro:hasPermission="system:competition:add">
  49. <i class="fa fa-plus"></i> 新增
  50. </a>
  51. </div>
  52. <div class="col-sm-12 select-table table-striped">
  53. <table id="bootstrap-table"></table>
  54. </div>
  55. </div>
  56. </div>
  57. <th:block th:include="include :: footer"/>
  58. <script th:inline="javascript">
  59. var publisFlag = [[${@permission.hasPermi('system:competiton:publish')}]]
  60. var editFlag = [[${@permission.hasPermi('system:competition:edit')}]];
  61. var removeFlag = [[${@permission.hasPermi('system:competition:remove')}]];
  62. var competitionTypeDatas = [[${@dict.getType('competition_type')}]];
  63. var competitionStateDatas = [[${@dict.getType('competition_state')}]];
  64. var prefix = ctx + "competition";
  65. $(function () {
  66. var options = {
  67. url: prefix + "/list",
  68. createUrl: prefix + "/add",
  69. updateUrl: prefix + "/edit/{id}",
  70. removeUrl: prefix + "/remove",
  71. publishUrl: prefix + "/publish",
  72. exportUrl: prefix + "/export",
  73. modalName: "赛事",
  74. columns: [
  75. /* {
  76. checkbox: false
  77. },*/
  78. {
  79. field: 'id',
  80. title: 'id',
  81. visible: false
  82. },
  83. {
  84. field: 'competitionTitle',
  85. title: '赛事标题'
  86. },
  87. {
  88. field: 'competitionType',
  89. title: '赛事类型',
  90. formatter: function (value, row, index) {
  91. return $.table.selectDictLabel(competitionTypeDatas, value);
  92. }
  93. },
  94. {
  95. field: 'teamMax',
  96. title: '最大人数/团队数'
  97. },
  98. {
  99. field: 'competitionPlace',
  100. title: '场地'
  101. },
  102. {
  103. field: 'applyStartTime',
  104. title: '赛事开始时间'
  105. },
  106. {
  107. field: 'applyEndTime',
  108. title: '赛事结束时间'
  109. },
  110. {
  111. field: 'applyBeforeTime',
  112. title: '取消报名截至时间',
  113. formatter: function (value, row, index) {
  114. return "赛事开始前"+value+"小时";
  115. }
  116. },
  117. {
  118. field: 'competitionExpense',
  119. title: '报名费用'
  120. },{
  121. field: 'viewingTicket',
  122. title: '观看费用'
  123. },
  124. {
  125. field: 'competitionState',
  126. title: '赛事状态',
  127. formatter: function (value, row, index) {
  128. return $.table.selectDictLabel(competitionStateDatas, value);
  129. }
  130. },
  131. {
  132. title: '操作',
  133. align: 'center',
  134. formatter: function (value, row, index) {
  135. var actions = [];
  136. if (row.competitionState === 'competiton_state_1') {
  137. 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> ')
  138. 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> ');
  139. 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>');
  140. } else if(row.competitionState === 'competiton_state_4'){
  141. }else {
  142. 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> ')
  143. }
  144. return actions.join('');
  145. }
  146. }]
  147. };
  148. $.table.init(options);
  149. });
  150. function closeCompetition(id){
  151. alert(id);
  152. $.ajax({
  153. url: prefix + "/close",
  154. type: "GET",
  155. data: {id:id},
  156. success: function(res){
  157. alert(res)
  158. },
  159. error: function(err){
  160. alert(err)
  161. }
  162. })
  163. }
  164. </script>
  165. </body>
  166. </html>