configuration.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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. <p>弹框内容:</p>
  15. <input type="text" name="alertContent"/>
  16. </li>
  17. <li class="select-time">
  18. <p>弹框开始时间:</p>
  19. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="alertStartTime"/>
  20. </li>
  21. <li class="select-time">
  22. <p>弹框结束时间:</p>
  23. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="alertEndTime"/>
  24. </li>
  25. <li>
  26. <p>用户类型</p>
  27. <select name="userType" th:with="type=${@dict.getType('sys_lantern_permission')}">
  28. <option value="">所有</option>
  29. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  30. </select>
  31. </li>
  32. <li>
  33. <p>是否启动</p>
  34. <select name="alertStatus">
  35. <option value="">所有</option>
  36. <option value="0">未启动</option>
  37. <option value="1">启动</option>
  38. </select>
  39. </li>
  40. <li>
  41. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  42. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  43. </li>
  44. </ul>
  45. </div>
  46. </form>
  47. </div>
  48. <div class="btn-group-sm" id="toolbar" role="group">
  49. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:configuration:add">
  50. <i class="fa fa-plus"></i> 添加
  51. </a>
  52. <!--<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:configuration:edit">-->
  53. <!--<i class="fa fa-edit"></i> 修改-->
  54. <!--</a>-->
  55. <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:configuration:remove">-->
  56. <!--<i class="fa fa-remove"></i> 删除-->
  57. <!--</a>-->
  58. <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:configuration:export">-->
  59. <!--<i class="fa fa-download"></i> 导出-->
  60. <!--</a>-->
  61. </div>
  62. <div class="col-sm-12 select-table table-striped">
  63. <table id="bootstrap-table"></table>
  64. </div>
  65. </div>
  66. </div>
  67. <th:block th:include="include :: footer" />
  68. <script th:inline="javascript">
  69. var editFlag = [[${@permission.hasPermi('system:configuration:edit')}]];
  70. var removeFlag = [[${@permission.hasPermi('system:configuration:remove')}]];
  71. var prefix = ctx + "system/configuration";
  72. $(function() {
  73. var options = {
  74. url: prefix + "/list",
  75. createUrl: prefix + "/add",
  76. updateUrl: prefix + "/edit/{id}",
  77. removeUrl: prefix + "/remove",
  78. exportUrl: prefix + "/export",
  79. modalName: "弹框配置",
  80. columns: [
  81. {
  82. field : 'alertId',
  83. title : 'id',
  84. visible: false
  85. },
  86. {
  87. field : 'alertContent',
  88. title : '弹框内容',
  89. width : '200px',
  90. formatter: function(value, row, index) {
  91. return $.table.tooltip(value);
  92. }
  93. },
  94. {
  95. field : 'alertStartTime',
  96. title : '开始时间'
  97. },
  98. {
  99. field : 'alertEndTime',
  100. title : '结束时间'
  101. },
  102. {
  103. field : 'alertNum',
  104. title : '次数'
  105. },
  106. {
  107. field : 'orgName',
  108. title : '通知部门'
  109. },
  110. {
  111. field : 'userType',
  112. title : '用户类型',
  113. formatter: function(value, row, index) {
  114. if (value.indexOf('1') != -1 && value.indexOf('0') != -1){
  115. return '立邦人员、经销商';
  116. }
  117. if (value.indexOf('1') != -1 && value.indexOf('0') == -1) {
  118. return '经销商';
  119. }
  120. if (value.indexOf('1') == -1 && value.indexOf('0') != -1) {
  121. return '立邦人员';
  122. }
  123. }
  124. },
  125. {
  126. visible: editFlag == 'hidden' ? false : true,
  127. title: '是否启动',
  128. align: 'center',
  129. formatter: function (value, row, index) {
  130. return statusTools(row);
  131. }
  132. },
  133. {
  134. title: '操作',
  135. align: 'center',
  136. formatter: function(value, row, index) {
  137. var actions = [];
  138. if (row.alertStatus == 1) {
  139. actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>编辑</a> ');
  140. actions.push('<a class="btn btn-default btn-xs ' + removeFlag + '" href="javascript:void(0)"><i class="fa fa-remove"></i>删除</a>');
  141. } else {
  142. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.alertId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  143. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.alertId + '\')"><i class="fa fa-remove"></i>删除</a>');
  144. }
  145. return actions.join('');
  146. }
  147. }]
  148. };
  149. $.table.init(options);
  150. });
  151. /* 启动状态显示 */
  152. function statusTools(row) {
  153. if (row.alertStatus == 0) {
  154. return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.alertId + ',' + row.userType + ',' + row.salesLevel + ',' + row.orgCode + '\')"></i> ';
  155. } else {
  156. return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.alertId + ',' + row.userType + ',' + row.salesLevel + ',' + row.orgCode + '\')"></i> ';
  157. }
  158. }
  159. /* 停用 */
  160. function disable(row) {
  161. var arrayTingyong = row.split(',');
  162. $.modal.confirm("确认关闭该通知吗?", function() {
  163. $.operate.post(prefix + "/release", { "alertId": arrayTingyong[0], "alertStatus": 0, "userType": arrayTingyong[1], "salesLevel": arrayTingyong[2], "orgCode": arrayTingyong[3] });
  164. })
  165. }
  166. /* 启用 */
  167. function enable(row) {
  168. var arrayQiyong = row.split(',');
  169. $.modal.confirm("确认启用该通知吗?", function() {
  170. $.operate.post(prefix + "/release", { "alertId": arrayQiyong[0], "alertStatus": 1, "userType": arrayQiyong[1], "salesLevel": arrayQiyong[2], "orgCode": arrayQiyong[3] });
  171. })
  172. }
  173. </script>
  174. </body>
  175. </html>