post.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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="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-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:post:export"><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. <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="system:post:add">
  35. <i class="fa fa-plus"></i> 新增
  36. </a>
  37. <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.removeAll()" shiro:hasPermission="system:post:remove">
  38. <i class="fa fa-trash-o"></i> 删除
  39. </a>
  40. </div>
  41. <div class="col-sm-12 select-table 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 = [[${@permission.hasPermi('system:post:edit')}]];
  49. var removeFlag = [[${@permission.hasPermi('system:post:remove')}]];
  50. var datas = [[${@dict.getType('sys_normal_disable')}]];
  51. var prefix = ctx + "system/post"
  52. $(function() {
  53. var options = {
  54. url: prefix + "/list",
  55. createUrl: prefix + "/add",
  56. updateUrl: prefix + "/edit/{id}",
  57. removeUrl: prefix + "/remove",
  58. exportUrl: prefix + "/export",
  59. sortName: "postSort",
  60. modalName: "岗位",
  61. search: false,
  62. showExport: false,
  63. columns: [{
  64. checkbox: true
  65. },
  66. {
  67. field: 'postId',
  68. title: '岗位编号'
  69. },
  70. {
  71. field: 'postCode',
  72. title: '岗位编码',
  73. sortable: true
  74. },
  75. {
  76. field: 'postName',
  77. title: '岗位名称',
  78. sortable: true
  79. },
  80. {
  81. field: 'postSort',
  82. title: '显示顺序',
  83. sortable: true
  84. },
  85. {
  86. field: 'status',
  87. title: '状态',
  88. align: 'center',
  89. formatter: function(value, row, index) {
  90. return $.table.selectDictLabel(datas, value);
  91. }
  92. },
  93. {
  94. field: 'createTime',
  95. title: '创建时间',
  96. sortable: true
  97. },
  98. {
  99. title: '操作',
  100. align: 'center',
  101. formatter: function(value, row, index) {
  102. var actions = [];
  103. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.postId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  104. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.postId + '\')"><i class="fa fa-remove"></i>删除</a>');
  105. return actions.join('');
  106. }
  107. }]
  108. };
  109. $.table.init(options);
  110. });
  111. </script>
  112. </body>
  113. </html>