zxb.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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="role-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 周星礼物类型:<select name="type" th:with="type=${@dict.getType('week_star_gift_type')}">
  15. <option value="">所有</option>
  16. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  17. </select>
  18. </li>
  19. <li>
  20. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  21. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  22. </li>
  23. </ul>
  24. </div>
  25. </form>
  26. </div>
  27. <div class="btn-group-sm" id="toolbar" role="group">
  28. <a class="btn btn-success" onclick="add()" shiro:hasPermission="activity:zxb:add">
  29. <i class="fa fa-plus"></i> 新增
  30. </a>
  31. </div>
  32. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  33. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  34. </div>
  35. </div>
  36. </div>
  37. <th:block th:include="include :: footer" />
  38. <script th:inline="javascript">
  39. var editFlag = [[${@permission.hasPermi('activity:zxb:edit')}]];
  40. var removeFlag = [[${@permission.hasPermi('activity:zxb:del')}]];
  41. var weekStarGiftType = [[${@dict.getType('week_star_gift_type')}]];
  42. var commonType = [[${@dict.getType('common_type')}]];
  43. var prefix = ctx + "activity/zxb";
  44. $(function() {
  45. var options = {
  46. url: prefix + "/list",
  47. createUrl: prefix + "/add",
  48. updateUrl: prefix + "/edit/{id}",
  49. removeUrl: prefix + "/remove",
  50. modalName: "周星礼物",
  51. height: $(window).height()-120,
  52. columns: [
  53. {
  54. field: 'id',
  55. title: 'ID'
  56. },
  57. {
  58. field: 'giftId',
  59. title: '礼物ID'
  60. },
  61. {
  62. field: 'giftName',
  63. title: '礼物名称',
  64. align : 'center'
  65. },
  66. {
  67. field: 'seq',
  68. title: '排序',
  69. align : 'center'
  70. },
  71. {
  72. field: 'type',
  73. title: '礼物类型',
  74. align : 'center',
  75. formatter: function(value, row, index) {
  76. return $.table.selectDictLabel(weekStarGiftType, value);
  77. }
  78. },
  79. {
  80. field: 'status',
  81. title: '状态',
  82. align: 'center',
  83. formatter: function(value, row, index) {
  84. return $.table.selectDictLabel(commonType, value);
  85. }
  86. },
  87. {
  88. field: 'createTime',
  89. title: '创建时间',
  90. align : 'center'
  91. },
  92. {
  93. field: 'adminName',
  94. title: '操作人',
  95. align : 'center'
  96. },
  97. {
  98. title: '操作',
  99. align: 'center',
  100. formatter: function(value, row, index) {
  101. var actions = [];
  102. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
  103. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="remove(\'' + row.id + '\')"><i class="fa fa-remove"></i> 删除</a>');
  104. return actions.join('');
  105. }
  106. }]
  107. };
  108. $.table.init(options);
  109. });
  110. function add(){
  111. var url = prefix + "/add";
  112. $.modal.open("新增周星信息",url,'800','400');
  113. }
  114. function edit(id){
  115. var url = prefix + "/edit/" + id;
  116. $.modal.open("编辑周星信息",url,'800','400');
  117. }
  118. function remove(id) {
  119. $.modal.confirm("确认要删除该周星礼物记录吗?", function() {
  120. $.operate.post(prefix + "/del?ids=" + id);
  121. });
  122. }
  123. </script>
  124. </body>
  125. </html>