post.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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="post-form">
  11. <div class="select-list">
  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=${@dict.getType('sys_normal_disable')}">
  21. <option value="">所有</option>
  22. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  23. </select>
  24. </li>
  25. <li>
  26. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  27. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  28. </li>
  29. </ul>
  30. </div>
  31. </form>
  32. </div>
  33. <div class="btn-group-sm" id="toolbar" role="group">
  34. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:post:add">
  35. <i class="fa fa-plus"></i> 新增
  36. </a>
  37. <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:post:edit">
  38. <i class="fa fa-edit"></i> 修改
  39. </a>
  40. <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:post:remove">
  41. <i class="fa fa-remove"></i> 删除
  42. </a>
  43. <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:post:export">
  44. <i class="fa fa-download"></i> 导出
  45. </a>
  46. </div>
  47. <div class="col-sm-12 select-table table-striped">
  48. <table id="bootstrap-table"></table>
  49. </div>
  50. </div>
  51. </div>
  52. <th:block th:include="include :: footer" />
  53. <script th:inline="javascript">
  54. var editFlag = [[${@permission.hasPermi('system:post:edit')}]];
  55. var removeFlag = [[${@permission.hasPermi('system:post:remove')}]];
  56. var datas = [[${@dict.getType('sys_normal_disable')}]];
  57. var prefix = ctx + "system/post";
  58. $(function() {
  59. var options = {
  60. url: prefix + "/list",
  61. createUrl: prefix + "/add",
  62. updateUrl: prefix + "/edit/{id}",
  63. removeUrl: prefix + "/remove",
  64. exportUrl: prefix + "/export",
  65. sortName: "postSort",
  66. modalName: "岗位",
  67. columns: [{
  68. checkbox: true
  69. },
  70. {
  71. field: 'postId',
  72. title: '岗位编号'
  73. },
  74. {
  75. field: 'postCode',
  76. title: '岗位编码',
  77. sortable: true
  78. },
  79. {
  80. field: 'postName',
  81. title: '岗位名称',
  82. sortable: true
  83. },
  84. {
  85. field: 'postSort',
  86. title: '显示顺序',
  87. sortable: true
  88. },
  89. {
  90. field: 'status',
  91. title: '状态',
  92. align: 'center',
  93. formatter: function(value, row, index) {
  94. return $.table.selectDictLabel(datas, value);
  95. }
  96. },
  97. {
  98. field: 'createTime',
  99. title: '创建时间',
  100. sortable: true
  101. },
  102. {
  103. title: '操作',
  104. align: 'center',
  105. formatter: function(value, row, index) {
  106. var actions = [];
  107. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.postId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  108. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.postId + '\')"><i class="fa fa-remove"></i>删除</a>');
  109. return actions.join('');
  110. }
  111. }]
  112. };
  113. $.table.init(options);
  114. });
  115. </script>
  116. </body>
  117. </html>