User.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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('添加','User_?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 width="75px">操作</th></tr>
  58. </thead>
  59. <tbody>
  60. {{range $index, $elem := .List}}
  61. <tr>
  62. <td>{{$elem.Admin_uuid}}</td>
  63. <td>{{$elem.Admin_name}}</td>
  64. <td>{{$elem.Admin_user}}</td>
  65. <td>
  66. {{range $index, $elemx := $.Power_List}}
  67. {{if eq $elem.Admin_power $elemx.Id }}
  68. {{$elemx.Power_name}}
  69. {{end}}
  70. {{end}}
  71. </td>
  72. <td>{{$elem.Admin_telephone}}</td>
  73. <td>{{$elem.Admin_mail}}</td>
  74. <td>
  75. {{if eq $elem.Admin_gender 0 }}
  76. 未知
  77. {{end}}
  78. {{if eq $elem.Admin_gender 1 }}
  79. {{end}}
  80. {{if eq $elem.Admin_gender 2 }}
  81. {{end}}
  82. </td>
  83. <td>{{$elem.Admin_text}}</td>
  84. <td>{{$elem.CreateTime}}</td>
  85. <td class="td-manage" >
  86. <div style="float: left">
  87. <a title="无钥匙登陆" style="color: #05a000" onclick="User_entry(this,'{{$elem.Admin_uuid}}');" href="javascript:;">
  88. <i class="layui-icon" style="margin-right: 4px">&#xe663;</i>无钥匙登陆</a>
  89. <a title="同步分类" style="color: #a03eff;" onclick="DeviceClass_Syn('{{$elem.Admin_uuid}}');" href="javascript:;">
  90. <i class="iconfont" style="margin-right: 4px">&#xe6b4;</i>同步分类</a>
  91. <a title="同步智慧大屏" style="color: #a03eff;" onclick="Panel_plan_Syn('{{$elem.Admin_uuid}}');" href="javascript:;">
  92. <i class="layui-icon" style="margin-right: 4px" >&#xe632;</i>同步智慧大屏</a>
  93. </div>
  94. <div style="float: left;margin-bottom: 8px">
  95. <a title="编辑" style="color: #008cff;" onclick="xadmin.open('编辑','User_?id={{$elem.Id}}&Admin_uuid={{$elem.Admin_uuid}}',500,600,false);" href="javascript:;">
  96. <i class="layui-icon" >&#xe63c;</i>编辑</a>
  97. <a title="删除" style="color: #ff3636" onclick="member_del(this,'{{$elem.Admin_uuid}}')" href="javascript:;">
  98. <i class="layui-icon">&#xe640;</i>删除</a>
  99. </div>
  100. </td>
  101. </tr>
  102. {{end}}
  103. </tbody>
  104. </table>
  105. </div>
  106. <div class="layui-card-body ">
  107. <div class="page">
  108. <div>
  109. {{range $index, $elem := .Pages}}
  110. {{if eq $elem.A 1}}
  111. <a class="prev" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">&lt;&lt;</a>
  112. {{end}}
  113. {{if eq $elem.A 2}}
  114. <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">{{$elem.V}}</a>
  115. {{end}}
  116. {{if eq $elem.A 3}}
  117. <span class="current">{{$elem.V}}</span>
  118. {{end}}
  119. {{if eq $elem.A 4}}
  120. <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">{{$elem.V}}</a>
  121. {{end}}
  122. {{if eq $elem.A 5}}
  123. <a class="next" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">&gt;&gt;</a>
  124. {{end}}
  125. {{end}}
  126. </div>
  127. Page:{{.Page}}-
  128. Page_size:{{.Page_size}}-
  129. cnt:{{.cnt}}
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. </body>
  137. <script>
  138. layui.use(['laydate', 'form'],
  139. function() {
  140. var laydate = layui.laydate;
  141. //执行一个laydate实例
  142. laydate.render({
  143. elem: '#start' //指定元素
  144. });
  145. //执行一个laydate实例
  146. laydate.render({
  147. elem: '#end' //指定元素
  148. });
  149. });
  150. /*用户-删除*/
  151. function member_del(obj, Admin_uuid) {
  152. layer.confirm('确认要删除吗?',
  153. function(index) {
  154. //发异步删除数据
  155. $(obj).parents("tr").remove();
  156. $.ajax({
  157. type: 'POST',
  158. url: 'User_Del',//发送请求
  159. data: {Admin_uuid:Admin_uuid},
  160. success: function(result) {
  161. console.log(result)
  162. if (result.Code == 200 ){
  163. layer.msg('已删除!', {
  164. icon: 1,
  165. time: 2000
  166. });
  167. window.location.reload();
  168. }else {
  169. layer.msg('删除失败!', {
  170. time: 2000
  171. });
  172. }
  173. }
  174. });
  175. });
  176. }
  177. /*用户-无钥匙进入*/
  178. function User_entry(obj, Admin_uuid) {
  179. layer.confirm('确认要 无钥匙进入 子账号吗?(确定后本账户将会退出登陆)',
  180. function(index) {
  181. $.ajax({
  182. type: 'POST',
  183. url: 'User_Entry',//发送请求
  184. data: {
  185. Admin_uuid:Admin_uuid
  186. },
  187. success: function(result) {
  188. console.log(result)
  189. if (result.Code == 200 ){
  190. window.parent.location.reload();
  191. }else {
  192. layer.msg('失败!', {
  193. time: 2000
  194. });
  195. }
  196. }
  197. });
  198. // window.open("/Index", "_blank");
  199. });
  200. }
  201. /*用户-无钥匙进入*/
  202. function DeviceClass_Syn(Admin_uuid) {
  203. layer.confirm('确认要 同步分类 子账号吗?',
  204. function(index) {
  205. var loading = layer.load(0, {
  206. shade: false,
  207. time: 99*1000
  208. });
  209. $.ajax({
  210. type: 'POST',
  211. url: '../Device/DeviceClass_Syn',//发送请求
  212. data: {
  213. Admin_uuid:Admin_uuid
  214. },
  215. success: function(result) {
  216. layer.close(loading)
  217. console.log(result)
  218. if (result.Code != 200) {
  219. layer.msg(result.Msg);
  220. return
  221. }
  222. layer.msg("成功同步传感器分类数量:"+result.Data);
  223. }
  224. });
  225. // window.open("/Index", "_blank");
  226. });
  227. }
  228. /*用户-无钥匙进入*/
  229. function Panel_plan_Syn(Admin_uuid) {
  230. layer.confirm('确认要 同步面板 子账号吗?',
  231. function(index) {
  232. var loading = layer.load(0, {
  233. shade: false,
  234. time: 99*1000
  235. });
  236. $.ajax({
  237. type: 'POST',
  238. url: '../User/Panel_plan_Syn',//发送请求
  239. data: {
  240. Admin_uuid:Admin_uuid
  241. },
  242. success: function(result) {
  243. layer.close(loading)
  244. console.log(result)
  245. if (result.Code != 200) {
  246. layer.msg(result.Msg);
  247. return
  248. }
  249. layer.msg("成功同步");
  250. }
  251. });
  252. // window.open("/Index", "_blank");
  253. });
  254. }
  255. </script>
  256. </html>