fe1ce0ffab2b8480d8bdbd0624451fa5.php 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <?php /*a:2:{s:67:"D:\phpstudy_pro\WWW\caiping\app\acctconnect\view\connect\index.html";i:1723541257;s:65:"D:\phpstudy_pro\WWW\caiping\app\acctconnect\view\common\base.html";i:1723541257;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
  9. <link rel="mobile-prefetch" href=""/>
  10. <title><?php echo get_system_config('web','admin_title'); ?></title>
  11. <meta name="keywords" content="<?php echo get_system_config('web','keywords'); ?>"/>
  12. <meta name="description" content="<?php echo get_system_config('web','desc'); ?>"/>
  13. <link rel="stylesheet" href="/static/assets/gougu/css/gougu.css?v=<?php echo get_system_config('web','version'); ?>" media="all">
  14. </head>
  15. <body class="main-body">
  16. <!-- 主体 -->
  17. <div class="p-3">
  18. <table class="layui-hide" id="admin" lay-filter="admin"></table>
  19. </div>
  20. <script type="text/html" id="thumb">
  21. <img src="{{d.thumb}}" width="30" height="30" />
  22. </script>
  23. <script type="text/html" id="status">
  24. <i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
  25. </script>
  26. <script type="text/html" id="toolbarDemo">
  27. <div class="layui-btn-container">
  28. <span class="layui-btn layui-btn-sm add-user">+ 添加关联账号</span>
  29. </div>
  30. </script>
  31. <script type="text/html" id="barDemo">
  32. <div class="layui-btn-group">
  33. <span class="layui-btn layui-btn-xs layui-btn-normal" lay-event="view">详情</span>
  34. <span class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</span>
  35. </div>
  36. </script>
  37. <!-- /主体 -->
  38. <!-- 底部 -->
  39. <!-- /底部 -->
  40. <!-- 脚本 -->
  41. <script>
  42. const moduleInit = ['tool'];
  43. function gouguInit() {
  44. var table = layui.table, tool = layui.tool, form = layui.form;
  45. var allcount;
  46. layui.pageTable = table.render({
  47. elem: '#admin',
  48. title: '管理员列表',
  49. toolbar: '#toolbarDemo',
  50. url: '/acctconnect/connect/index', //数据接口
  51. page: true, //开启分页
  52. limit: 20,
  53. parseData: function(res) { // 数据解析回调函数
  54. // 在这里可以获取数据总数
  55. allcount = res.count;
  56. return {
  57. code: res.code, // 数据状态码
  58. msg: res.msg, // 状态信息
  59. count: res.count, // 数据总数
  60. data: res.data // 当前页数据
  61. };
  62. },
  63. cols: [
  64. [
  65. {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
  66. templet: function(d){
  67. return allcount - (d.LAY_NUM-1);
  68. }
  69. },
  70. {
  71. field: 'username',
  72. title: '登录账号',
  73. width: 120,
  74. templet:function(d){
  75. var html = "";
  76. html = '<a class="side-a" lay-event="read">' + d.username + '</a>';
  77. return '<div style="text-align:left">' + html + '</div>'
  78. }
  79. },
  80. {
  81. field: 'thumb',
  82. title: '头像',
  83. toolbar: '#thumb',
  84. align: 'center',
  85. width: 60
  86. },
  87. {
  88. field: 'nickname',
  89. title: '用户名',
  90. width: 120
  91. },
  92. {
  93. field: 'groupName',
  94. title: '权限角色'
  95. },
  96. {
  97. field: 'department_title',
  98. title: '所属单位',
  99. width: 200
  100. },
  101. {
  102. field: 'login_num',
  103. title: '累计登录',
  104. align: 'center',
  105. width: 80
  106. },
  107. {
  108. field: 'last_login_time',
  109. title: '最后登录时间',
  110. align: 'center',
  111. width: 142
  112. },
  113. {
  114. field: 'last_login_ip',
  115. title: '最后登录IP',
  116. width: 130
  117. },
  118. {
  119. field: 'status',
  120. title: '状态',
  121. toolbar: '#status',
  122. align: 'center',
  123. width: 60
  124. },
  125. {
  126. field: 'right',
  127. fixed: 'right',
  128. title: '操作',
  129. toolbar: '#barDemo',
  130. width: 132,
  131. align: 'center'
  132. }
  133. ]
  134. ]
  135. });
  136. //表头工具栏事件
  137. $('body').on('click','.add-user', function () {
  138. tool.side("/acctconnect/connect/add");
  139. return;
  140. });
  141. //监听行工具事件
  142. table.on('tool(admin)', function (obj) {
  143. var data = obj.data;
  144. if (obj.event === 'view') {
  145. tool.side('/acctconnect/connect/view?id='+data.id);
  146. return;
  147. }else if(obj.event === 'read'){
  148. layer.confirm('您确定要切换到该账户吗?',{
  149. icon: 3,
  150. title: '提示'
  151. }, function(index){
  152. $.ajax({
  153. url: "/acctconnect/connect/switchLogin?id=" + data.id,
  154. data: $('#gougu-login').serialize(),
  155. type: 'post',
  156. async: false,
  157. success: function (res) {
  158. layer.tips(res.msg, '#login-submit');
  159. if (res.code === 0) {
  160. setTimeout(function () {
  161. // parent.document.location.reload();
  162. parent.document.location.href = "<?php echo url('/admin/index'); ?>";
  163. }, 1500);
  164. } else {
  165. $('[alt="captcha"]').click();
  166. }
  167. }
  168. })
  169. layer.close(index);
  170. });
  171. }else if (obj.event === 'del') {
  172. layer.confirm('您确定要删除该账户', {
  173. icon: 3,
  174. title: '提示'
  175. }, function (index) {
  176. let callback = function (e) {
  177. layer.msg(e.msg);
  178. if (e.code == 0) {
  179. obj.del();
  180. }
  181. }
  182. tool.delete("/acctconnect/connect/delete", { id: data.id }, callback);
  183. layer.close(index);
  184. });
  185. }
  186. });
  187. //监听搜索提交
  188. form.on('submit(webform)', function (data) {
  189. layui.pageTable.reload({
  190. where: {
  191. keywords: data.field.keywords
  192. },
  193. page: {
  194. curr: 1
  195. }
  196. });
  197. return false;
  198. });
  199. }
  200. </script>
  201. <!-- /脚本 -->
  202. <!-- <script src="/static/assets/layui/layui.js"></script> -->
  203. <script src="/static/assets/layui/layui.js"></script>
  204. <script src="/static/assets/third_party/echart/echarts.min.js"></script>
  205. <script src="/static/assets/gougu/gouguInit.js"></script>
  206. <!-- 统计代码 -->
  207. <!-- /统计代码 -->
  208. </body>
  209. </html>