wzy
2021-04-01 d388e2788b7ef088d7cd40f901b0acdcec460bc3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!-- 本框架基本脚本和样式 -->
    <script type="text/javascript"
            th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script>
 
</head>
<body class=" container-fluid">
 
<div class="pd-10">
 
    <!-- 搜索框部分start -->
<!--    <div class="row form-head">-->
<!--        <div class="col-md-4 col-xs-12">-->
<!--            &lt;!&ndash; 功能按钮部分 &ndash;&gt;-->
<!--            <button onclick="myGrid.delItems('suId')" type="button"-->
<!--                    class="btn btn-danger btn-sm" matrix:btn="user-dels">-->
<!--                <i class="fa fa-trash"></i>批量删除-->
<!--            </button>-->
<!--            <button onclick="openAdd()" type="button"-->
<!--                    class="btn btn-success btn-sm" matrix:btn="user-add">-->
<!--                <i class="fa fa-plus"></i> 新增-->
<!--            </button>-->
<!--        </div>-->
<!--        <div class="col-md-8 col-xs-12">-->
<!--    </div>-->
    <div class="row">
        <!-- 数据表格部分 -->
        <table id="mgrid">
            <thead>
            <tr>
<!--                <th data-checkbox="true"></th>-->
                <th data-formatter="MGrid.indexfn" data-align="center"
                    data-width="43px">序号
                </th>
                <th data-field="uname" data-sortable="true">姓名</th>
                <th data-field="utel">手机号</th>
                <th data-field="uip">来源IP</th>
                <th data-field="uinfo1">收货地址</th>
                <th data-field="createTime" data-formatter="MGrid.getTime"
                    data-sortable="true">报名时间
                </th>
                <th data-field="uremark">个人信息</th>
<!--                <th data-align="center" data-field="suId"-->
<!--                    data-formatter="buidOperate">操作-->
<!--                </th>-->
            </tr>
            </thead>
        </table>
        <!-- 数据表格部分end -->
    </div>
</div>
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
<script type="text/javascript">
 
    //定义表格对象
    var myGrid;
 
    $(function () {
        //定义删除数据的路径
        var delPath = "";
        //使用权限标签控制路径是否显示在界面上
        delPath = basePath + "/admin/su/del";
        //初始化表格对象
        myGrid = MGrid.initGrid({
            //fixedColumns: true,
            //    fixedNumber: 1,
            url: basePath + "/activityRegistration/showList",//url数据加载地址,表格初始化后会自动去后台加载数据。
            delUrl: delPath
        });
 
        // 实现显示 隐藏列
        $(".bootstrap-table ul.dropdown-menu").find('input[data-field=' + 'suName'
            + ']').trigger("click");
        $(".bootstrap-table ul.dropdown-menu").blur(function () {
            alert(1);
        })
    });
 
    //构建操作栏的按钮
    function buidOperate(value, row, index) {
        var html = "";
        html += '<div class="btn-group"  >'
            + '<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown">'
            + '操作 <span class="caret"></span>' + '</button>'
            + '<ul class="dropdown-menu" role="menu">'
            + '<li><a href="javascript:void(0)" style="display:'
            + value
            + '"  onClick="openEdit(\''
            + value
            + '\')" title="编辑">编辑</a></li>'
            + '<li><a href="javascript:void(0)" style="display:'
            + value
            + '"  onClick="resetPassword(\''
            + value
            + '\')" title="密码重置">密码重置</a></li>'
            + '<li><a href="javascript:void(0)" style="display:'
            + value
            + '"  onClick="unlock(\''
            + value
            + '\')" title="解锁">解锁</a></li>'
            + '<li><a href="javascript:void(0)" onClick="lock(\''
            + value
            + '\')"  title="锁定">锁定</a></li>'
            + '<li><a href="javascript:void(0)" style="display:'
            + value
            + '" onClick="myGrid.delItem(\''
            + value
            + '\')" title="删除">删除</a></li>' + '</ul>' + '</div>'
        html += '';
        return html;
    }
 
    //打开添加界面
    function openAdd() {
        layer.open({
            type: 2,
            title: "添加管理员",
            maxmin: true,
            area: [MUI.SIZE_L, '500px'],
            content: [basePath + '/admin/su/editForm']
        });
    }
 
    //打开编辑界面
    function openEdit(id) {
        layer.open({
            type: 2,
            title: "编辑管理员",
            area: [MUI.SIZE_L, '500px'],
            maxmin: true,
            content: [basePath + '/admin/su/editForm?id=' + id]
        });
    }
 
    function resetPassword(id) {
        MTools.handleItem(basePath + '/admin/su/resetPassword?id=' + id,
            "确认要重置密码吗?");
    }
 
    function unlock(id) {
        MTools.handleItem(basePath + '/admin/su/accountLock/unlock/?id='
            + id, "确认要解锁账号吗?", function () {
            myGrid.serchData();
        });
 
    }
 
    function lock(id) {
        MTools.handleItem(
            basePath + '/admin/su/accountLock/lock/?id=' + id,
            "确认要锁定账号吗?", function () {
                myGrid.serchData();
            });
    }
</script>
</body>
</html>