configuration.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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. <style>
  6. .tableImage_s{
  7. border-radius:2px;
  8. width: 24px;
  9. height: 22px;
  10. }
  11. .tableImage_m{
  12. border-radius:2px;
  13. width: 36px;
  14. height: 30px;
  15. }
  16. .tableImage_l{
  17. border-radius:2px;
  18. width: 73px;
  19. height: 32px;
  20. }
  21. .preview-item{
  22. width: 100%;
  23. height: 100%;
  24. flex-direction: row;
  25. display: flex;
  26. justify-content: center;
  27. align-items: center;
  28. position: fixed;
  29. z-index: 100;
  30. background-color: rgba(0,0,0,0.7);
  31. }
  32. .preview-img{
  33. width: 300px;
  34. max-height: 400px;
  35. overflow-y: scroll;
  36. }
  37. </style>
  38. </head>
  39. <body class="gray-bg">
  40. <div class="container-div">
  41. <div id="previewImg" class="preview-item" onclick="closePreview()">
  42. <div class="preview-img">
  43. <img id="previewImage" src="" style="width: 100%;">
  44. </div>
  45. </div>
  46. <div class="row">
  47. <div class="col-sm-12 search-collapse">
  48. <form id="formId">
  49. <div class="select-list">
  50. <ul>
  51. <li>
  52. <p>弹框内容:</p>
  53. <input type="text" name="alertContent"/>
  54. </li>
  55. <li class="select-time">
  56. <p>弹框开始时间:</p>
  57. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="alertStartTime"/>
  58. </li>
  59. <li class="select-time">
  60. <p>弹框结束时间:</p>
  61. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="alertEndTime"/>
  62. </li>
  63. <li>
  64. <p>用户类型</p>
  65. <select name="userType" th:with="type=${@dict.getType('sys_lantern_permission')}">
  66. <option value="">所有</option>
  67. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  68. </select>
  69. </li>
  70. <li>
  71. <p>是否启动</p>
  72. <select name="alertStatus">
  73. <option value="">所有</option>
  74. <option value="0">未启动</option>
  75. <option value="1">启动</option>
  76. </select>
  77. </li>
  78. <li>
  79. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  80. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  81. </li>
  82. </ul>
  83. </div>
  84. </form>
  85. </div>
  86. <div class="btn-group-sm" id="toolbar" role="group">
  87. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:configuration:add">
  88. <i class="fa fa-plus"></i> 添加
  89. </a>
  90. </div>
  91. <div class="col-sm-12 select-table table-striped">
  92. <table id="bootstrap-table"></table>
  93. </div>
  94. </div>
  95. </div>
  96. <th:block th:include="include :: footer" />
  97. <script th:inline="javascript">
  98. var editFlag = [[${@permission.hasPermi('system:configuration:edit')}]];
  99. var removeFlag = [[${@permission.hasPermi('system:configuration:remove')}]];
  100. var prefix = ctx + "system/configuration";
  101. $(function() {
  102. $("#previewImg").hide();
  103. var options = {
  104. url: prefix + "/list",
  105. createUrl: prefix + "/add",
  106. updateUrl: prefix + "/edit/{id}",
  107. removeUrl: prefix + "/remove",
  108. exportUrl: prefix + "/export",
  109. modalName: "弹框配置",
  110. columns: [
  111. {
  112. field : 'alertId',
  113. title : 'id',
  114. visible: false
  115. },
  116. {
  117. field : 'alertTitle',
  118. title : '弹框标题'
  119. },
  120. {
  121. field : 'alertContent',
  122. title : '弹框内容',
  123. width : '200px',
  124. formatter: function(value, row, index) {
  125. return $.table.tooltip(value);
  126. }
  127. },
  128. {
  129. field : 'photoUrl',
  130. title : '弹框图片',
  131. width : '100px',
  132. formatter: function(value, row, index) {
  133. if (value != null){
  134. // return $.table.imageView(value,600,300,"tableImage_s img-view");
  135. var valueStr = value + '';
  136. console.log('url1',value);
  137. console.log('url2',valueStr);
  138. return '<img width="24" height="22" src="' + value + '" onclick="imgPreview(\'' + valueStr + '\')"/>'
  139. }
  140. }
  141. },
  142. {
  143. field : 'alertStartTime',
  144. title : '开始时间'
  145. },
  146. {
  147. field : 'alertEndTime',
  148. title : '结束时间'
  149. },
  150. {
  151. field : 'alertNum',
  152. title : '次数'
  153. },
  154. {
  155. field : 'orgName',
  156. title : '通知部门'
  157. },
  158. {
  159. field : 'userType',
  160. title : '用户类型',
  161. formatter: function(value, row, index) {
  162. if (value == 2){
  163. return '全部人员';
  164. } else {
  165. var userStr = '';
  166. if (value.indexOf('0') != -1){
  167. userStr += '立邦员工 ';
  168. }
  169. if (value.indexOf('1') != -1){
  170. userStr += '经销商 ';
  171. }
  172. if (value.indexOf('3') != -1){
  173. userStr += '服务商 ';
  174. }
  175. if (value.indexOf('4') != -1){
  176. userStr += '金牌店 ';
  177. }
  178. return userStr;
  179. }
  180. }
  181. },
  182. {
  183. visible: editFlag == 'hidden' ? false : true,
  184. title: '是否启动',
  185. align: 'center',
  186. formatter: function (value, row, index) {
  187. return statusTools(row);
  188. }
  189. },
  190. {
  191. title: '操作',
  192. align: 'center',
  193. formatter: function(value, row, index) {
  194. var actions = [];
  195. if (row.alertStatus == 1) {
  196. actions.push('<a class="btn btn-default btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-edit"></i>编辑</a> ');
  197. actions.push('<a class="btn btn-default btn-xs ' + removeFlag + '" href="javascript:void(0)"><i class="fa fa-remove"></i>删除</a>');
  198. } else {
  199. 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> ');
  200. 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>');
  201. }
  202. return actions.join('');
  203. }
  204. }]
  205. };
  206. $.table.init(options);
  207. });
  208. /* 启动状态显示 */
  209. function statusTools(row) {
  210. if (row.alertStatus == 0) {
  211. return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.alertId + '&' + row.userType + '&' + row.salesLevel + '&' + row.orgCode + '\')"></i> ';
  212. } else {
  213. return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.alertId + '&' + row.userType + '&' + row.salesLevel + '&' + row.orgCode + '\')"></i> ';
  214. }
  215. }
  216. /* 停用 */
  217. function disable(row) {
  218. var arrayTingyong = row.split('&');
  219. $.modal.confirm("确认关闭该通知吗?", function() {
  220. $.operate.post(prefix + "/release", { "alertId": arrayTingyong[0], "alertStatus": 0, "userType": arrayTingyong[1], "salesLevel": arrayTingyong[2], "orgCode": arrayTingyong[3] });
  221. })
  222. }
  223. /* 启用 */
  224. function enable(row) {
  225. var arrayQiyong = row.split('&');
  226. $.modal.confirm("确认启用该通知吗?", function() {
  227. $.operate.post(prefix + "/release", { "alertId": arrayQiyong[0], "alertStatus": 1, "userType": arrayQiyong[1], "salesLevel": arrayQiyong[2], "orgCode": arrayQiyong[3] });
  228. })
  229. }
  230. $("#previewImage").on('click',function (event) {
  231. event.stopPropagation();
  232. })
  233. function closePreview() {
  234. $("#previewImg").hide();
  235. }
  236. function imgPreview(url) {
  237. $("#previewImage").attr('src',url);
  238. $("#previewImg").show();
  239. }
  240. </script>
  241. </body>
  242. </html>