123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- <?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;}*/ ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
-
- <link rel="mobile-prefetch" href=""/>
- <title><?php echo get_system_config('web','admin_title'); ?></title>
- <meta name="keywords" content="<?php echo get_system_config('web','keywords'); ?>"/>
- <meta name="description" content="<?php echo get_system_config('web','desc'); ?>"/>
- <link rel="stylesheet" href="/static/assets/gougu/css/gougu.css?v=<?php echo get_system_config('web','version'); ?>" media="all">
- </head>
- <body class="main-body">
- <!-- 主体 -->
-
- <div class="p-3">
- <table class="layui-hide" id="admin" lay-filter="admin"></table>
- </div>
- <script type="text/html" id="thumb">
- <img src="{{d.thumb}}" width="30" height="30" />
- </script>
- <script type="text/html" id="status">
- <i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
- </script>
- <script type="text/html" id="toolbarDemo">
- <div class="layui-btn-container">
- <span class="layui-btn layui-btn-sm add-user">+ 添加关联账号</span>
- </div>
- </script>
- <script type="text/html" id="barDemo">
- <div class="layui-btn-group">
- <span class="layui-btn layui-btn-xs layui-btn-normal" lay-event="view">详情</span>
- <span class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</span>
- </div>
- </script>
- <!-- /主体 -->
- <!-- 底部 -->
-
- <!-- /底部 -->
-
- <!-- 脚本 -->
-
- <script>
- const moduleInit = ['tool'];
- function gouguInit() {
- var table = layui.table, tool = layui.tool, form = layui.form;
- var allcount;
- layui.pageTable = table.render({
- elem: '#admin',
- title: '管理员列表',
- toolbar: '#toolbarDemo',
- url: '/acctconnect/connect/index', //数据接口
- page: true, //开启分页
- limit: 20,
- parseData: function(res) { // 数据解析回调函数
- // 在这里可以获取数据总数
- allcount = res.count;
- return {
- code: res.code, // 数据状态码
- msg: res.msg, // 状态信息
- count: res.count, // 数据总数
- data: res.data // 当前页数据
- };
- },
- cols: [
- [
- {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
- templet: function(d){
- return allcount - (d.LAY_NUM-1);
- }
- },
- {
- field: 'username',
- title: '登录账号',
- width: 120,
- templet:function(d){
- var html = "";
- html = '<a class="side-a" lay-event="read">' + d.username + '</a>';
- return '<div style="text-align:left">' + html + '</div>'
- }
- },
- {
- field: 'thumb',
- title: '头像',
- toolbar: '#thumb',
- align: 'center',
- width: 60
- },
- {
- field: 'nickname',
- title: '用户名',
- width: 120
- },
- {
- field: 'groupName',
- title: '权限角色'
- },
-
- {
- field: 'department_title',
- title: '所属单位',
- width: 200
- },
-
- {
- field: 'login_num',
- title: '累计登录',
- align: 'center',
- width: 80
- },
- {
- field: 'last_login_time',
- title: '最后登录时间',
- align: 'center',
- width: 142
- },
- {
- field: 'last_login_ip',
- title: '最后登录IP',
- width: 130
- },
- {
- field: 'status',
- title: '状态',
- toolbar: '#status',
- align: 'center',
- width: 60
- },
- {
- field: 'right',
- fixed: 'right',
- title: '操作',
- toolbar: '#barDemo',
- width: 132,
- align: 'center'
- }
- ]
- ]
- });
- //表头工具栏事件
- $('body').on('click','.add-user', function () {
- tool.side("/acctconnect/connect/add");
- return;
- });
- //监听行工具事件
- table.on('tool(admin)', function (obj) {
- var data = obj.data;
- if (obj.event === 'view') {
- tool.side('/acctconnect/connect/view?id='+data.id);
- return;
- }else if(obj.event === 'read'){
- layer.confirm('您确定要切换到该账户吗?',{
- icon: 3,
- title: '提示'
- }, function(index){
- $.ajax({
- url: "/acctconnect/connect/switchLogin?id=" + data.id,
- data: $('#gougu-login').serialize(),
- type: 'post',
- async: false,
- success: function (res) {
- layer.tips(res.msg, '#login-submit');
- if (res.code === 0) {
- setTimeout(function () {
- // parent.document.location.reload();
- parent.document.location.href = "<?php echo url('/admin/index'); ?>";
- }, 1500);
- } else {
- $('[alt="captcha"]').click();
- }
- }
- })
- layer.close(index);
- });
- }else if (obj.event === 'del') {
- layer.confirm('您确定要删除该账户', {
- icon: 3,
- title: '提示'
- }, function (index) {
- let callback = function (e) {
- layer.msg(e.msg);
- if (e.code == 0) {
- obj.del();
- }
- }
- tool.delete("/acctconnect/connect/delete", { id: data.id }, callback);
- layer.close(index);
- });
- }
- });
- //监听搜索提交
- form.on('submit(webform)', function (data) {
- layui.pageTable.reload({
- where: {
- keywords: data.field.keywords
- },
- page: {
- curr: 1
- }
- });
- return false;
- });
- }
- </script>
- <!-- /脚本 -->
-
- <!-- <script src="/static/assets/layui/layui.js"></script> -->
- <script src="/static/assets/layui/layui.js"></script>
- <script src="/static/assets/third_party/echart/echarts.min.js"></script>
- <script src="/static/assets/gougu/gouguInit.js"></script>
-
- <!-- 统计代码 -->
-
- <!-- /统计代码 -->
- </body>
- </html>
|