多单位版国产化地质资料管理系统
py
2025-07-08 98dbfdb7bca2dbee6802421fbafb8c909b54a356
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
 
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
 
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>角色管理</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gte IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
 
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
 
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
 
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
 
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <style>
        html, body {
            height: 100%;
            width: 100%;
            overflow: hidden;
        }
    </style>
</head>
 
<div>
    <div class="pt-main-top clear">
        <div class="pt-nav">
            <span class="pt-title-icon">
                <i class="fa fa-vcard-o"></i>
            </span>
            <div class="pt-title">
                <div>
                    <h4>角色管理</h4>
                </div>
            </div>
        </div>
        <div class="pt-search">
            <p class="pt-retrieval">
                <input id="txtKeySearch" type="text" placeholder="请输入角色名进行搜索">
                <button id="btnKeySearch">
                    <i class="fa fa-search"></i>
                </button>
            </p>
            <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.ROLE.OPERATION.ADD">
                <button id="btnAdd" class="pt-btn pt-btn-primary">
                    <i class="fa fa-plus"></i>
                    新增
                </button>
            </shiro:hasPermission>
        </div>
    </div>
    <div class="pt-form-inline">
        <div id="right">
            <div class="pt-gjsearch" style="display:none;">
                <h5>高级搜索列表</h5>
                <div class="pt-search-list">
                    <div style="margin-bottom:16px">
                        <input name="project" id="project" style="width:100%; height:30px; line-height: 30px;"/>
                    </div>
                    <div style="margin-bottom:16px">
                        <input name="projectPeople" id="projectPeople"
                               style="width:100%; height:30px;line-height: 30px;"/>
                    </div>
                </div>
                <div style="text-align:center;padding:5px 0">
                    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()"
                       style="width:80px;background:#367fa9; color:#fff;">搜索</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()"
                       style="width:80px;background: #e7e7e7;">重置</a>
                </div>
            </div>
 
            <div>
                <table id="dg_role" style="width:100%;">
                </table>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //定义页面全局变量
    var NowSelectedRoleId = null;
 
    $(function () {
        var wh = $(window).height();
        var dgHeight = wh - 98;
        //初始化表格
        $('#dg_role').datagrid({
            url: 'management/role/getRoleList',
            fitColumns: true,
            striped: true,
            idField: "roleId",
            rownumbers: true,
            pagination: true,
            checkOnSelect: false,
            selectOnCheck: false,
            singleSelect: true,
            height: dgHeight,
            pageSize: 50,
            columns:
                [[
                    {
                        field: 'ck',
                        checkbox: true
                    },
                    {
                        field: 'roleName',
                        title: '角色名称',
                        width: 100,
                        sortable: true
                    },
                    {
                        field: 'displayName',
                        title: '显示名称',
                        width: 100,
                        sortable: true
                    },
                    {
                        field: 'isStatic',
                        title: '系统角色',
                        width: 100,
                        align: 'center',
                        formatter: function (value, row, index) {
                            return value == 1 ? "是" : "否";
                        }
                    },
                    {
                        field: 'isDefault',
                        title: '默认角色',
                        width: 100,
                        align: 'center',
                        formatter: function (value, row, index) {
                            return value == 1 ? "是" : "否";
                        }
                    },
                    {
                        field: 'createTime',
                        title: '创建时间',
                        width: 100
                    },
                    {
                        field: 'roleId',
                        title: '操作',
                        width: 100,
                        align: 'center',
                        formatter: function (value, row, index) {
                            var ret = "";
 
                            ret += '<a onclick=\'editRole("' + value + '");\' class="pt-color-success"><i class="fa fa-pencil" title="编辑"></i>'
                            <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.ROLE.OPERATION.USERSET">
                            ret += '<a onclick=\'editRoleUsers("' + value + '","' + row.displayName + '");\' class="pt-color-success"><i class="fa fa-user" title="用户设置"></i></a>'
                            </shiro:hasPermission>
                            <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.ROLE.OPERATION.DELETE">
                            <c:if test="${!enableThreeMember}">
                            if (row.isStatic == 0) {
                            </c:if>
                            <c:if test="${enableThreeMember}">
                            if (row.isStatic == 0 && row.roleName.indexOf('Admin_3Y')<0) {
                            </c:if>
                                ret += '<a onclick=\'deleteRole("' + value + '");\' class="pt-color-danger"><i class="fa fa-trash-o" title="删除"></i></a>';
                            }
 
                            </shiro:hasPermission>
 
                            return ret;
                        }
                    }
                ]]
        })
        ;
 
        new ResizeScroll({
            "id": ".right",
            "fun": function () {
                var wh = $(window).height();
                //$(".pt-form").height(wh-79-48);
                return (wh - 81 - 20);
            }
        });
 
        //绑定按钮事件
        //新增按钮事件
        $("#btnAdd").click(function () {
            editRole(0, NowSelectedRoleId);
        });
 
        //删除按钮事件
        $("#btnDelete").click(function () {
            //获取dg选中的数据行
            var checkRows = $("#dg_role").datagrid("getChecked");
            if (checkRows.length == 0) {
                wcp.message.info("请选择需要删除的角色!");
            } else {
                var ids = new Array();
                $.each(checkRows, function (index, value) {
                    ids.push(value.roleId);
                });
 
                deleteRoles(ids);
            }
        });
 
        //绑定关键字检索输入框回车事件
        $("#btnKeySearch").click(function () {
            SearchKey();
        });
 
        //关键字检索按钮事件
        $('#txtKeySearch').bind('keypress', function (event) {
            if (event.keyCode == "13") {
                SearchKey();
            }
        });
    })
 
    //关键字搜索方法
    function SearchKey() {
        var keyValue = $("#txtKeySearch").val();
        $('#dg_role').datagrid('load', {
            roleId: NowSelectedRoleId,
            searchText: keyValue
        });
    }
 
    //角色信息编辑方法
    function editRole(roleId) {
        var url = "management/role/editRole?roleId=" + roleId;
        var title = roleId == 0 ? "新增角色" : "编辑角色";
        top.layer.open({
            title: title,
            type: 2,
            area: ["800px", "600px"],
            fixed: false,
            maxmin: true,
            content: url,
            success: function (layero, index) {
                var body = window.top.layer.getChildFrame('body', index);
                var iframeWin = window.top[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象
 
                //将回调函数传给子页面
                iframeWin.params.callBack = refreshData;
            }
        });
    }
 
    function editRoleUsers(roleId, displayName) {
        var url = "management/role/editRoleUsers?roleId=" + roleId;
        var title = roleId == 0 ? "新增角色用户" : "编辑角色用户";
        top.layer.open({
            title: title,
            type: 2,
            area: ["800px", "600px"],
            fixed: false,
            maxmin: true,
            content: url,
            success: function (layero, index) {
                var body = window.top.layer.getChildFrame('body', index);
                var iframeWin = window.top[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象
 
                //将回调函数传给子页面
                iframeWin.params.callBack = refreshData;
            }
        });
    }
 
    //刷新表格数据
    function refreshData() {
        $('#dg_role').datagrid('reload');
    }
 
    //删除单个用户事件
    function deleteRole(roleId) {
        deleteRoles([roleId]);
    }
 
    //删除多个用户事件
    function deleteRoles(roleIds) {
        layer.confirm("确定要删除选择的角色吗?", {
            icon: 3,
            title: '提示'
        }, function (index) {
            wcp.ui.setBusy("body", wcp.ajax({
                url: "management/role/deleteRole",
                data: JSON.stringify(roleIds),
            }).done(function (result) {
                wcp.notify.success('删除成功!');
 
                //刷新数据
                refreshData();
            }));
 
            layer.close(index);
        });
    }
</script>
</html>