competition.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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}" th:value="${dict.dictValue}"></option>
  22. </select>
  23. </li>
  24. <li>
  25. <label>场地:</label>
  26. <input type="text" name="competitionPlace" template="请输入场地"/>
  27. </li>
  28. <li>
  29. <label>活动状态:</label>
  30. <select name="competitionState" th:with="type=${@dict.getType('competition_state')}">
  31. <option value="">所有</option>
  32. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  33. </select>
  34. </li>
  35. <li>
  36. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  37. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  38. </li>
  39. </ul>
  40. </div>
  41. </form>
  42. </div>
  43. <div class="btn-group-sm" id="toolbar" role="group">
  44. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:competition:add">
  45. <i class="fa fa-plus"></i> 添加
  46. </a>
  47. </div>
  48. <div class="col-sm-12 select-table table-striped">
  49. <table id="bootstrap-table"></table>
  50. </div>
  51. </div>
  52. </div>
  53. <th:block th:include="include :: footer" />
  54. <script th:inline="javascript">
  55. var publisFlag=[[${@permission.hasPermi('system:competiton:publish')}]]
  56. var editFlag = [[${@permission.hasPermi('system:competition:edit')}]];
  57. var removeFlag = [[${@permission.hasPermi('system:competition:remove')}]];
  58. var competitionTypeDatas = [[${@dict.getType('competition_type')}]];
  59. var competitionStateDatas = [[${@dict.getType('competition_state')}]];
  60. var prefix = ctx + "system/competition";
  61. $(function() {
  62. var options = {
  63. url: prefix + "/list",
  64. createUrl: prefix + "/add",
  65. updateUrl: prefix + "/edit/{id}",
  66. removeUrl: prefix + "/remove",
  67. publishUrl: prefix + "/publish",
  68. exportUrl: prefix + "/export",
  69. modalName: "赛事发布",
  70. columns: [{
  71. checkbox: true
  72. },
  73. {
  74. field: 'id',
  75. title: 'id',
  76. visible: false
  77. },
  78. {
  79. field: 'competitionTitle',
  80. title: '活动标题'
  81. },
  82. {
  83. field: 'competitionType',
  84. title: '活动类型',
  85. formatter: function(value, row, index) {
  86. return $.table.selectDictLabel(competitionTypeDatas, value);
  87. }
  88. },
  89. {
  90. field: 'personMax',
  91. title: '团队最大人数'
  92. },
  93. {
  94. field: 'teamMax',
  95. title: '最大团队数'
  96. },
  97. {
  98. field: 'competitionPlace',
  99. title: '场地'
  100. },
  101. {
  102. field: 'applyStartTime',
  103. title: '报名开始时间'
  104. },
  105. {
  106. field: 'applyEndTime',
  107. title: '报名结束时间'
  108. },
  109. {
  110. field: 'applyBeforeTime',
  111. title: '取消报名截至时间(活动开始前N小时可退款)'
  112. },
  113. {
  114. field: 'competitionMaximum',
  115. title: '活动上限人数'
  116. },
  117. {
  118. field: 'competitionExpense',
  119. title: '活动费用(每人)'
  120. },
  121. {
  122. field: 'competitionDetails',
  123. title: '活动详情'
  124. },
  125. {
  126. field: 'registrationNotes',
  127. title: '报名须知'
  128. },
  129. {
  130. field: 'competitionState',
  131. title: '活动状态',
  132. formatter: function(value, row, index) {
  133. return $.table.selectDictLabel(competitionStateDatas, value);
  134. }
  135. },
  136. {
  137. title: '操作',
  138. align: 'center',
  139. formatter: function(value, row, index) {
  140. var actions = [];
  141. if(row.competitionState === 'competiton_state_1'){
  142. 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> ')
  143. 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> ');
  144. 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>');
  145. }else{
  146. actions.push('<a class="btn btn-success btn-xs ' + publisFlag + '" href="javascript:void(0)" onclick="$.operate.close(\'' + row.id + '\')"><i class="fa fa-close"></i>关闭</a> ')
  147. }
  148. return actions.join('');
  149. }
  150. }]
  151. };
  152. $.table.init(options);
  153. });
  154. </script>
  155. </body>
  156. </html>