post.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org"
  3. xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  4. <meta charset="utf-8">
  5. <head th:include="include :: header"></head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 select-info">
  10. <form id="operlog-form">
  11. <div class="select-list gd">
  12. <ul>
  13. <li>
  14. 岗位编码:<input type="text" name="postCode"/>
  15. </li>
  16. <li>
  17. 岗位名称:<input type="text" name="postName"/>
  18. </li>
  19. <li>
  20. 岗位状态:<select name="status" th:with="type=${@dictService.selectDictData('sys_normal_disable')}">
  21. <option value="">所有</option>
  22. <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
  23. </select>
  24. </li>
  25. <li>
  26. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search($('form').attr('id'))"><i class="fa fa-search"></i>&nbsp;搜索</a>
  27. <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel($('form').attr('id'))"><i class="fa fa-download"></i>&nbsp;下载</a>
  28. </li>
  29. </ul>
  30. </div>
  31. </form>
  32. </div>
  33. <div class="btn-group hidden-xs" id="toolbar" role="group">
  34. <button class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="system:post:add">
  35. <i class="fa fa-plus"></i> 新增
  36. </button>
  37. <button class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="system:post:remove">
  38. <i class="fa fa-trash-o"></i> 删除
  39. </button>
  40. </div>
  41. <div class="col-sm-12 select-info table-striped">
  42. <table id="bootstrap-table" data-mobile-responsive="true"></table>
  43. </div>
  44. </div>
  45. </div>
  46. <div th:include="include :: footer"></div>
  47. <script th:inline="javascript">
  48. var editFlag = [[${@permissionService.hasPermi('system:post:edit')}]];
  49. var removeFlag = [[${@permissionService.hasPermi('system:post:remove')}]];
  50. var prefix = ctx + "system/post"
  51. $(function() {
  52. var options = {
  53. url: prefix + "/list",
  54. createUrl: prefix + "/add",
  55. updateUrl: prefix + "/edit/{id}",
  56. removeUrl: prefix + "/remove",
  57. exportUrl: prefix + "/export",
  58. sortName: "postSort",
  59. modalName: "岗位",
  60. search: false,
  61. showExport: false,
  62. columns: [{
  63. checkbox: true
  64. },
  65. {
  66. field: 'postId',
  67. title: '岗位编号'
  68. },
  69. {
  70. field: 'postCode',
  71. title: '岗位编码',
  72. sortable: true
  73. },
  74. {
  75. field: 'postName',
  76. title: '岗位名称',
  77. sortable: true
  78. },
  79. {
  80. field: 'postSort',
  81. title: '显示顺序',
  82. sortable: true
  83. },
  84. {
  85. field: 'status',
  86. title: '状态',
  87. align: 'center',
  88. formatter: function(value, row, index) {
  89. if (value == 0) {
  90. return '<span class="badge badge-primary">正常</span>';
  91. } else if (value == 1) {
  92. return '<span class="badge badge-danger">停用</span>';
  93. }
  94. }
  95. },
  96. {
  97. field: 'createDateTimeStr',
  98. title: '创建时间'
  99. },
  100. {
  101. title: '操作',
  102. align: 'center',
  103. formatter: function(value, row, index) {
  104. var actions = [];
  105. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.postId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  106. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.postId + '\')"><i class="fa fa-remove"></i>删除</a>');
  107. return actions.join('');
  108. }
  109. }]
  110. };
  111. $.table.init(options);
  112. });
  113. </script>
  114. </body>
  115. </html>