Admin.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!DOCTYPE html>
  2. <html class="x-admin-sm">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="renderer" content="webkit">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
  8. <link rel="shortcut icon" href="https://osscold.baozhida.cn/favicon.ico">
  9. <link rel="bookmark" href="https://osscold.baozhida.cn/favicon.ico">
  10. <link rel="stylesheet" href="https://osscold.baozhida.cn/css/font.css">
  11. <link rel="stylesheet" href="https://osscold.baozhida.cn/css/xadmin.css">
  12. <script src="https://osscold.baozhida.cn/lib/layui/layui.js" charset="utf-8"></script>
  13. <script type="text/javascript" src="https://osscold.baozhida.cn/js/xadmin.js"></script>
  14. </head>
  15. <body>
  16. <div class="x-nav">
  17. <span class="layui-breadcrumb">
  18. <a href="">首页</a>
  19. <a><cite>宝智达</cite></a>
  20. </span>
  21. <a class="layui-btn layui-btn-normal" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
  22. <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
  23. </a>
  24. </div>
  25. <div class="layui-fluid">
  26. <div class="layui-row layui-col-space15">
  27. <div class="layui-col-md12">
  28. <div class="layui-card">
  29. <div class="layui-card-body ">
  30. <form class="layui-form layui-col-space5">
  31. <div class="layui-input-inline layui-show-xs-block">
  32. <input value="{{.Name}}" type="text" name="Name" placeholder="请输入 名称" autocomplete="off" class="layui-input"></div>
  33. <div class="layui-input-inline layui-show-xs-block">
  34. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">
  35. <i class="layui-icon">&#xe615;</i></button>
  36. </div>
  37. </form>
  38. </div>
  39. <div class="layui-card-header">
  40. <!-- <button class="layui-btn layui-btn-danger" onclick="delAll()">-->
  41. <!-- <i class="layui-icon"></i>批量删除</button>-->
  42. <button class="layui-btn layui-btn-normal" onclick="xadmin.open('添加','Admin_?id=0',500,600,false);">
  43. <i class="layui-icon"></i>添加</button></div>
  44. <div class="layui-card-body ">
  45. <table class="layui-table layui-form">
  46. <thead>
  47. <tr>
  48. <th>编号</th>
  49. <th>名称</th>
  50. <th>账号</th>
  51. <th>权限</th>
  52. <th>电话</th>
  53. <th>邮箱</th>
  54. <th>性别</th>
  55. <th>备注</th>
  56. <th>创建时间</th>
  57. <th>操作</th>
  58. </tr>
  59. </thead>
  60. <tbody>
  61. {{range $index, $elem := .List}}
  62. <tr>
  63. <td>{{$elem.Admin_uuid}}</td>
  64. <td>{{$elem.Admin_name}}</td>
  65. <td>{{$elem.Admin_user}}</td>
  66. <td>
  67. {{range $index, $elemx := $.Power_List}}
  68. {{if eq $elem.Admin_power $elemx.Id }}
  69. {{$elemx.Power_name}}
  70. {{end}}
  71. {{end}}
  72. </td>
  73. <td>{{$elem.Admin_telephone}}</td>
  74. <td>{{$elem.Admin_mail}}</td>
  75. <td>
  76. {{if eq $elem.Admin_gender 0 }}
  77. 未知
  78. {{end}}
  79. {{if eq $elem.Admin_gender 1 }}
  80. {{end}}
  81. {{if eq $elem.Admin_gender 2 }}
  82. {{end}}
  83. </td>
  84. <td>{{$elem.Admin_text}}</td>
  85. <td>{{$elem.CreateTime}}</td>
  86. <td class="td-manage">
  87. <a title="编辑" onclick="xadmin.open('编辑','Admin_?id={{$elem.Id}}&Admin_uuid={{$elem.Admin_uuid}}',500,600,false);" href="javascript:;">
  88. <i class="layui-icon">&#xe63c;</i></a>
  89. <a title="删除" onclick="member_del(this,'{{$elem.Admin_uuid}}')" href="javascript:;">
  90. <i class="layui-icon">&#xe640;</i></a>
  91. </td>
  92. </tr>
  93. {{end}}
  94. </tbody>
  95. </table>
  96. </div>
  97. <div class="layui-card-body ">
  98. <div class="page">
  99. <div>
  100. {{range $index, $elem := .Pages}}
  101. {{if eq $elem.A 1}}
  102. <a class="prev" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">&lt;&lt;</a>
  103. {{end}}
  104. {{if eq $elem.A 2}}
  105. <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">{{$elem.V}}</a>
  106. {{end}}
  107. {{if eq $elem.A 3}}
  108. <span class="current">{{$elem.V}}</span>
  109. {{end}}
  110. {{if eq $elem.A 4}}
  111. <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">{{$elem.V}}</a>
  112. {{end}}
  113. {{if eq $elem.A 5}}
  114. <a class="next" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">&gt;&gt;</a>
  115. {{end}}
  116. {{end}}
  117. </div>
  118. Page:{{.Page}}-
  119. Page_size:{{.Page_size}}-
  120. cnt:{{.cnt}}
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </body>
  128. <script>
  129. layui.use(['laydate', 'form'],
  130. function() {
  131. var laydate = layui.laydate;
  132. //执行一个laydate实例
  133. laydate.render({
  134. elem: '#start' //指定元素
  135. });
  136. //执行一个laydate实例
  137. laydate.render({
  138. elem: '#end' //指定元素
  139. });
  140. });
  141. /*用户-删除*/
  142. function member_del(obj, Admin_uuid) {
  143. layer.confirm('确认要删除吗?',
  144. function(index) {
  145. //发异步删除数据
  146. $(obj).parents("tr").remove();
  147. $.ajax({
  148. type: 'POST',
  149. url: 'Admin_Del',//发送请求
  150. data: {Admin_uuid:Admin_uuid},
  151. success: function(result) {
  152. console.log(result)
  153. if (result.Code == 200 ){
  154. layer.msg('已删除!', {
  155. icon: 1,
  156. time: 2000
  157. });
  158. window.location.reload();
  159. }else {
  160. layer.msg('删除失败!', {
  161. time: 2000
  162. });
  163. }
  164. }
  165. });
  166. });
  167. }
  168. </script>
  169. </html>