pretty.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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:pretty 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. 靓号:<input type="text" name="erBanNo" placeholder="请输入靓号"/>
  15. </li>
  16. <li>
  17. 状态:<select name="status" th:with="type=${@dict.getType('use_type')}">
  18. <option value="">所有</option>
  19. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  20. </select>
  21. </li>
  22. <li class="select-time">
  23. <label>创建时间: </label>
  24. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginDate]"/>
  25. <span>-</span>
  26. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endDate]"/>
  27. </li>
  28. <li>
  29. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  30. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  31. </li>
  32. </ul>
  33. </div>
  34. </form>
  35. </div>
  36. <div class="btn-group-sm" id="toolbar" role="group">
  37. <a class="btn btn-success" onclick="add()" shiro:hasPermission="users:pretty:add">
  38. <i class="fa fa-plus"></i> 新增
  39. </a>
  40. </div>
  41. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  42. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  43. </div>
  44. </div>
  45. </div>
  46. <th:pretty th:include="include :: footer" />
  47. <script th:inline="javascript">
  48. var bindFlag = [[${@permission.hasPermi('users:pretty:bind')}]];
  49. var untiedFlag = [[${@permission.hasPermi('users:pretty:untied')}]];
  50. var useStatus = [[${@dict.getType('use_type')}]];
  51. var prettyErBanNoType = [[${@dict.getType('pretty_erban_no_type')}]];
  52. var prefix = ctx + "users/pretty";
  53. $(function() {
  54. var options = {
  55. url: prefix + "/list",
  56. createUrl: prefix + "/add",
  57. modalName: "靓号",
  58. height: 600,
  59. columns: [
  60. {
  61. field: 'prettyErbanNo',
  62. title: '靓号'
  63. },
  64. {
  65. field: 'useStatus',
  66. title: '类型',
  67. align : 'center',
  68. formatter: function(value, row, index) {
  69. return $.table.selectDictLabel(prettyErBanNoType, value);
  70. }
  71. },
  72. {
  73. field: 'status',
  74. title: '状态',
  75. align : 'center',
  76. formatter: function(value, row, index) {
  77. return $.table.selectDictLabel(useStatus, value);
  78. }
  79. },
  80. {
  81. field: 'seq',
  82. title: '排序',
  83. align : 'center'
  84. },
  85. {
  86. field: 'erbanNo',
  87. title: '原卿卿号',
  88. align : 'center'
  89. },
  90. {
  91. field: 'uid',
  92. title: 'uid',
  93. align : 'center'
  94. },
  95. {
  96. field: 'nick',
  97. title: '昵称',
  98. align : 'center'
  99. },
  100. {
  101. field: 'createTime',
  102. title: '创建时间',
  103. align : 'center'
  104. },
  105. {
  106. title: '操作',
  107. align: 'center',
  108. formatter: function(value, row, index) {
  109. var actions = [];
  110. var key = row.prettyErbanNo;
  111. var erBanNo = row.erbanNo;
  112. if(row.status == 1){
  113. if(erBanNo != null && row.status == 1){
  114. actions.push('<a class="btn btn-success btn-xs ' + untiedFlag + '" href="javascript:void(0)" onclick="untied(\'' + key + '\')"><i class="fa fa-minus-circle"></i> 解绑</a> ');
  115. }
  116. if(erBanNo != null && row.status == 2){
  117. actions.push('<a class="btn btn-success btn-xs ' + bindFlag + '" href="javascript:void(0)" onclick="bind(\'' +key + '\',\'' + erBanNo + '\')"><i class="fa fa-minus-circle"></i> 绑定</a> ');
  118. }
  119. }
  120. return actions.join('');
  121. }
  122. }]
  123. };
  124. $.table.init(options);
  125. });
  126. function bind(prettyErbanNo,erBanNo){
  127. $.modal.confirm("确认要将"+prettyErbanNo+"该靓号绑定到"+erBanNo+"用户中吗?", function() {
  128. $.operate.post(prefix + "/bind?prettyErBanNo=" + prettyErbanNo + "&erBanNo=" + erBanNo);
  129. })
  130. }
  131. function untied(prettyErbanNo){
  132. $.modal.confirm("确认要解绑该用户靓号吗?", function() {
  133. $.operate.post(prefix + "/untied?prettyErBanNo=" + prettyErbanNo);
  134. })
  135. }
  136. function add() {
  137. $.modal.open("添加靓号", prefix + "/add",900,400);
  138. }
  139. </script>
  140. </body>
  141. </html>