config.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. <div id="element" class="row">
  16. <div class="col-sm-4">
  17. <select name="typeCd" class="type form-control m-b" data-first-title="请选择">
  18. <option value="">请选择</option>
  19. </select>
  20. </div>
  21. <div class="col-sm-4" style="margin-left: 40px">
  22. <select name="sceneTpCd" class="router form-control m-b" data-first-title="请选择">
  23. <option value="">请选择</option>
  24. </select>
  25. </div>
  26. </div>
  27. </li>
  28. <li>
  29. <label>内容:</label>
  30. <input type="text" name="content"/>
  31. </li>
  32. <li>
  33. <label>状态:</label>
  34. <select name="status" th:with="type=${@dict.getType('sys_normal_disable')}">
  35. <option value="">所有</option>
  36. <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
  37. th:value="${dict.dictValue}"></option>
  38. </select>
  39. </li>
  40. <li>
  41. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
  42. class="fa fa-search"></i>&nbsp;搜索</a>
  43. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
  44. class="fa fa-refresh"></i>&nbsp;重置</a>
  45. </li>
  46. </ul>
  47. </div>
  48. </form>
  49. </div>
  50. <div class="btn-group-sm" id="toolbar" role="group">
  51. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="opt:config:add">
  52. <i class="fa fa-plus"></i> 添加
  53. </a>
  54. <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="opt:config:edit">
  55. <i class="fa fa-edit"></i> 修改
  56. </a>
  57. <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
  58. shiro:hasPermission="opt:config:remove">
  59. <i class="fa fa-remove"></i> 删除
  60. </a>
  61. <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="opt:config:export">
  62. <i class="fa fa-download"></i> 导出
  63. </a>
  64. </div>
  65. <div class="col-sm-12 select-table table-striped">
  66. <table id="bootstrap-table"></table>
  67. </div>
  68. </div>
  69. </div>
  70. <th:block th:include="include :: footer"/>
  71. <th:block th:include="include :: jquery-cxselect-js"/>
  72. <script th:inline="javascript">
  73. // 直接返回获取
  74. var data = [[${data}]];
  75. $('#element').cxSelect({
  76. selects: ['type', 'router'],
  77. jsonValue: 'v',
  78. data: data
  79. });
  80. var editFlag = [[${@permission.hasPermi('opt:config:edit')}]];
  81. var removeFlag = [[${@permission.hasPermi('opt:config:remove')}]];
  82. var typeCdDatas = [[${@dict.getType('sys_tp_cd')}]];
  83. var sceneTpCdDatas = [[${@dict.getType('sys_tp_cd')}]];
  84. var statusDatas = [[${@dict.getType('sys_normal_disable')}]];
  85. var prefix = ctx + "opt/config";
  86. $(function () {
  87. var options = {
  88. url: prefix + "/list",
  89. createUrl: prefix + "/add",
  90. updateUrl: prefix + "/edit/{id}",
  91. removeUrl: prefix + "/remove",
  92. exportUrl: prefix + "/export",
  93. modalName: "系统配置",
  94. columns: [{
  95. checkbox: true
  96. },
  97. {
  98. field: 'confId',
  99. title: '配置ID',
  100. visible: false
  101. },
  102. {
  103. field: 'typeCd',
  104. title: '系统类型',
  105. formatter: function (value, row, index) {
  106. return $.table.selectDictLabel(typeCdDatas, value);
  107. }
  108. },
  109. {
  110. field: 'sceneTpNm',
  111. title: '场景类型'
  112. },
  113. {
  114. field: 'content',
  115. title: '内容'
  116. },
  117. {
  118. field: 'createBy',
  119. title: '创建人'
  120. },
  121. {
  122. field: 'createTime',
  123. title: '创建时间'
  124. },
  125. {
  126. field: 'updateBy',
  127. title: '修改人'
  128. },
  129. {
  130. field: 'updateTime',
  131. title: '修改时间'
  132. },
  133. {
  134. field: 'status',
  135. title: '状态',
  136. formatter: function (value, row, index) {
  137. return $.table.selectDictLabel(statusDatas, value);
  138. }
  139. },
  140. {
  141. title: '操作',
  142. align: 'center',
  143. formatter: function (value, row, index) {
  144. var actions = [];
  145. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.confId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  146. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.confId + '\')"><i class="fa fa-remove"></i>删除</a>');
  147. return actions.join('');
  148. }
  149. }]
  150. };
  151. $.table.init(options);
  152. });
  153. </script>
  154. </body>
  155. </html>