多单位版国产化地质资料管理系统
zs
2025-12-18 4f0d9bde31a80f6279e26466250da7716eec627f
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
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro"%>
<%
    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>
<link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
<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/scripts/customResize.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>
<body class="pt-tree">
    <div class="pt-wrap margin-lr" style="height:100%;">
        <div class="pt-main-top clear">
            <div class="pt-nav">
                <span class="pt-title-icon">
                    <i class="fa fa-cubes"></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_CONFIG.MODULE.OPERATION.ADD">
                    <button id="btnImport" class="pt-btn pt-btn-primary">
                        <i class="fa fa-plus"></i>
                        导入
                    </button>
                    <button id="btnAdd" class="pt-btn pt-btn-primary">
                        <i class="fa fa-plus"></i>
                        新增
                    </button>
                </shiro:hasPermission>
            </div>
        </div>
        <div id="div_table">
            <table id="dg_module" style="width:100%; height:100%;"></table>
        </div>
    </div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    $(function() {
 
        //初始化表格
        $('#dg_module').treegrid({
            url : 'config/module/getModuleListByTreeGrid',
            fitColumns : true,
            striped : true,
            idField : "moduleId",
            treeField : 'moduleName',
            rownumbers : true,
            checkOnSelect : false,
            selectOnCheck : false,
            singleSelect : true,
            columns : [ [
                {
                    field : 'ck',
                    checkbox : true
                },
                {
                    field : 'moduleName',
                    title : '模块名称',
                    width : 300,
                },
                {
                    field : 'moduleType',
                    title : '模块类型',
                    width : 100,
                    align : 'center',
                    formatter : function(value) {
                        var ret = "";
                        switch (value) {
                        case 0:
                            ret = "普通模块";
                            break;
                        case 1:
                            ret = "中心模块";
                            break;
                        case 2:
                            ret = "";
                            break;
                        case 3:
                            ret = "";
                            break;
                        default:
                            ret = "普通模块";
                            break;
                        }
                        return ret;
                    }
                },
                {
                    field : 'createUserName',
                    title : '创建人',
                    width : 100,
                    align : 'center'
                },
                {
                    field : 'createTime',
                    title : '创建时间',
                    width : 150,
                    align : 'center'
                },
                {
                    field : 'description',
                    title : '模块描述',
                    width : 150,
                    align : 'center'
                },
                {
                    field : 'moduleId',
                    title : '操作',
                    width : 100,
                    align : 'center',
                    formatter : function(value, row, index) {
                        var ret = "";
                        <shiro:hasPermission name="SYS_CONFIG.MODULE.OPERATION.SAVE">
                        ret += ' <a onclick=\'editModule("' + value + '");\' class="pt-color-success"><i class="fa fa-pencil" title="编辑"></i></a>';
                        </shiro:hasPermission>
                        <shiro:hasPermission name="SYS_CONFIG.MODULE.OPERATION.CONFIG">
                        if (row.moduleType != 1) {
                            ret += '<a onclick=\'configModule("' + value + '","' + row.moduleName + '");\' class="pt-color-primary"><i class="fa fa-gears" title="模块配置"></i></a>';
                        }
                        </shiro:hasPermission>
                        <shiro:hasPermission name="SYS_CONFIG.MODULE.OPERATION.DELETE">
                        ret += '<a onclick=\'deleteModule("' + value + '");\' class="pt-color-danger"><i class="fa fa-trash-o" title="删除"></i></a>';
                        </shiro:hasPermission>
                        return ret;
                    }
                }
            ] ]
        });
 
 
        //         new ResizeScroll({
        //             "id" : ".pt-right-main",
        //             "fun" : function() {
        //                 var wh = $(window).height();
        //                 //$(".pt-form").height(wh-79-48);
        //                 return (wh - 81 - 20);
        //             }
        //         });
 
        //绑定按钮事件
        //新增按钮事件
        $("#btnAdd").click(function() {
            editModule(0);
        });
        $("#btnImport").click(function() {
            var url = "config/module/importConfigDataView";
            var title = "模块数据导入";
            top.layer.open({
                title : title,
                type : 2,
                area : [ "900px", "600px" ],
                fixed : false,
                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;
                }
            });
        });
 
        //绑定关键字检索输入框回车事件
        $("#btnKeySearch").click(function() {
            SearchKey();
        });
 
        //关键字检索按钮事件
        $('#txtKeySearch').bind('keypress', function(event) {
            if (event.keyCode == "13") {
                SearchKey();
            }
        });
 
        new CustomResize({
            "id" : "div_table",
            "fun" : computeHeight
        });
    })
 
    function computeHeight() {
        var wh = $(window).height();
        $("#div_table").height(wh - 86);
        $("#dg_module").datagrid("resize");
    }
 
    //关键字搜索方法
    function SearchKey() {
        var keyValue = $("#txtKeySearch").val();
        $('#dg_module').treegrid('load', {
            searchText : keyValue
        });
    }
 
    //新增模块
    function editModule(moduleId) {
        var url = "config/module/editModule?moduleId=" + moduleId;
        var title = "新增模块";
        top.layer.open({
            title : title,
            type : 2,
            area : [ "700px", "600px" ],
            fixed : false,
            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 configModule(moduleId, moduleName) {
        var url = "config/module/configModule?moduleId=" + moduleId;
        top.addPanel(url, moduleName + "模块配置");
    }
 
    //刷新表格数据
    function refreshData() {
        $('#dg_module').treegrid('reload');
        //清除已经选择的数据
        $('#dg_module').treegrid('clearSelections');
        $('#dg_module').treegrid('clearChecked');
    }
 
    //删除单个模块事件
    function deleteModule(moduleId) {
        deleteModules([ moduleId ]);
    }
 
    //删除多个模块事件
    function deleteModules(moduleIds) {
        layer.confirm("确定要删除选择的模块吗?", {
            icon : 3,
            title : '提示'
        }, function(index) {
            wcp.ui.setBusy("body", wcp.ajax({
                url : "config/module/deleteModule",
                data : JSON.stringify(moduleIds),
            }).done(function(result) {
                wcp.notify.success('删除成功!');
 
                //刷新数据
                refreshData();
            }));
 
            layer.close(index);
        });
    }
</script>
</html>