多单位版国产化地质资料管理系统
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%@ 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 rel="stylesheet" href="static/plugins/jquery-steps/css/main.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/jquery-steps/css/jquery.steps.css" type="text/css">
    <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/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/ace/src-noconflict/ace.js" type="text/javascript"></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>
    <!-- wcp组件 -->
    <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>
    <script type="text/javascript" src="static/scripts/customResize.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>
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon">
                    <i class="fa fa-list-ul"></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.FLOW.CATEGORY.OPERATION.ADDFLOW">
                <button id="btnAdd" class="pt-btn pt-btn-primary">
                    <i class="fa fa-plus"></i>
                    添加
                </button>
                <a href="javascript:;" class="pt-btn pt-btn-info" onclick="enableSort(this)">
                    <i class="fa fa-retweet"></i>
                    排序
                </a>
            </shiro:hasPermission>
            <shiro:hasPermission name="SYS_MANAGE.FLOW.CATEGORY.OPERATION.DELETEFLOW">
                <button id="btnDelete" class="pt-btn pt-btn-danger">
                    <i class="fa fa-trash-o"></i>
                    删除
                </button>
            </shiro:hasPermission>
        </div>
    </div>
    <div class="pt-left-menu pt-tree" style="padding:0px 10px;">
        <div class="pt-left-tools">
            <shiro:hasPermission name="SYS_MANAGE.FLOW.CATEGORY.OPERATION.ADD">
                <button class="pt-btn pt-btn-primary" id="btnAddFlowCategory">
                    <i class="fa fa-plus"></i>
                    新增
                </button>
            </shiro:hasPermission>
            <shiro:hasPermission name="SYS_MANAGE.FLOW.CATEGORY.OPERATION.SAVE">
                <button class="pt-btn pt-btn-success" id="btnUpdateFlowCategory">
                    <i class="fa fa-pencil"></i>
                    修改
                </button>
            </shiro:hasPermission>
            <shiro:hasPermission name="SYS_MANAGE.FLOW.CATEGORY.OPERATION.DELETE">
                <button class="pt-btn pt-btn-danger" id="btnDeleteFlowCategory">
                    <i class="fa fa-trash-o"></i>
                    删除
                </button>
            </shiro:hasPermission>
        </div>
 
        <!--       <div class="easyui-panel" style="overflow-x:auto;">
            <h3 class="pt-tree-title">
                    流程分类
                    <i id="btnRefreshClassification" class="pull-right fa fa-refresh"></i>
            </h3>
            <ul id="ul_flowCategory"></ul>
        </div> -->
        <div class="easyui-panel" style="overflow-x:auto;">
            <h3 class="pt-tree-title">
                流程分类
                <i id="btnRefreshClassification" class="pull-right fa fa-refresh"></i>
            </h3>
            <ul id="ul_flowCategory"></ul>
        </div>
    </div>
    <div class="pt-right-main">
        <div id="right">
            <div id="div_table">
                <table id="dg_flowCategory_flowDefinition" style="width:100%;height:100%;">
                </table>
            </div>
        </div>
    </div>
    <!-- <div id="div_table">
        <table id="dg_flowCategory_flowDefinition" style="width:100%;height:100%;"></table>
    </div> -->
</div>
 
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //定义页面全局变量
    var NowSelectedflowCategoryId = null;
    var dg_flowCategory_flowDefinition = null;
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
    $(function () {
 
        //初始化部门树
        $("#ul_flowCategory").tree({
            method: "get",
            url: "config/flowCategory/listFlowCategoryByTree",
            animate: true,
            onBeforeLoad: function (node, param) {
                new ResizeScroll({
                    "id": "#ul_flowCategory",
                    fun: function () {
                        var wh = $(window).height();
                        //$("#ul_dept").height(wh-79-39);
                        return (wh - 79 - 60);
                    }
                });
 
                wcp.ui.setBusy("#ul_flowCategory");
            },
            onLoadSuccess: function (node, data) {
                wcp.ui.clearBusy("#ul_flowCategory");
                new ResizeScroll({
                    "id": "#ul_flowCategory",
                    "fun": function () {
                        var wh = $(window).height();
                        return (wh - 79 - 95);
                    }
                });
 
                //选中第一个元素
                if (data.length > 0) {
                    NowSelectedflowCategoryId = data[0].id;
                    var node = $('#ul_flowCategory').tree('find', NowSelectedflowCategoryId);
                    if (node != null) {
                        $('#ul_flowCategory').tree('select', node.target);
                        selectNode(node);
                    }
                }
            },
            onLoadError: function (args) {
                wcp.ui.clearBusy("#ul_flowCategory");
            },
            onClick: function (node) {
                selectNode(node);
            }
        })
 
        //初始化表格
        dg_flowCategory_flowDefinition = $('#dg_flowCategory_flowDefinition').datagrid({
            url: 'config/flowCategory/getFlowCategoryRelationList',
            idField: "id",
            rownumbers: true,
            fitColumns: true,
            method: "post",
            checkOnSelect: false,
            selectOnCheck: false,
            pagination: true,
            sortName: "sort_num",
            sortOrder: "desc",
            columns: [[
                {
                    field: 'ck',
                    checkbox: true
                },
                {
                    field: 'sortNum',
                    title: '序号',
                    width: 50,
                    align: 'center'
                },
                {
                    field: 'flowName',
                    title: '流程名称',
                    width: 100
                },
                // {
                //     field: 'flowState',
                //     title: '状态',
                //     width: 200,
                //     align: 'center',
                //     formatter: function (value) {
                //         return '<input class="btnState">';
                //     }
                // },
                {
                    field: 'id',
                    title: '操作',
                    width: 100,
                    align: 'center',
                    formatter: function (value, row, index) {
                        var str = "";
                        <shiro:hasPermission name="SYS_MANAGE.FLOW.CATEGORY.OPERATION.SAVELOW">
                        str = '<a onclick=\'designFlow("' + row.flowId + '");\' class="pt-color-success"><i class="fa fa-pencil" title="编辑"></i></a>';
                        </shiro:hasPermission>
                        <shiro:hasPermission name="SYS_MANAGE.FLOW.CATEGORY.OPERATION.DELETEFLOW">
                        str += '<a onclick=\'deleteFlowCategoryRelation("' + row.id + '");\' class="pt-color-danger"><i class="fa fa-trash-o" title="删除"></i></a>';
                        </shiro:hasPermission>
                        return str;
 
                    }
                }
            ]],
            onLoadSuccess: function (data) {
                // $.each(data.rows, function (index, elem) {
                //     $("table .btnState").eq(index).switchbutton({
                //         onText: "启用",
                //         offText: "关闭",
                //         checked: elem.flowState == 1,
                //         onChange: function (checked) {
                //             var flowState;
                //             var flowId = elem.flowId;
                //             if (checked) {
                //                 flowState = 1;
                //             } else {
                //                 flowState = 0;
                //             }
                //             wcp.ui.setBusy("body", wcp.ajax({
                //                 url: "config/flowDefinition/updateFlowState?flowId=" + flowId + "&flowState=" + flowState
                //             }).done(function (result) {
                //                 wcp.notify.success('修改成功!');
                //                 //刷新数据
                //                 //refreshData();
                //             }));
                //         }
                //     });
                //
                // })
 
            },
            onDrop: function (targetRow, sourceRow, point) {
                // var index = t_flow.datagrid("getRowIndex", sourceRow);
                // $("table .btnState").eq(index).switchbutton({
                //     onText: "开启",
                //     offText: "关闭",
                //     checked: sourceRow.flowState == 1,
                //     onChange: function (checked) {
                //         //方法
                //     }
                // });
            }
        });
 
        //绑定按钮事件
        //新增按钮事件
        $("#btnAdd").click(function () {
            addFlowCategory();
        });
 
        //删除按钮事件
        $("#btnDelete").click(function () {
            //获取dg选中的数据行
            var checkRows = $("#dg_flowCategory_flowDefinition").datagrid("getChecked");
            if (checkRows.length == 0) {
                layer.alert("请选择需要删除的流程!");
            } else {
                var ids = new Array();
                $.each(checkRows, function (index, value) {
                    ids.push(value.id);
                });
 
                deleteFlowCategoryRelations(ids);
            }
        });
 
        //绑定关键字检索输入框回车事件
        $("#btnKeySearch").click(function () {
            SearchKey();
        });
 
        //关键字检索按钮事件
        $('#txtKeySearch').bind('keypress', function (event) {
            if (event.keyCode == "13") {
                SearchKey();
            }
        });
 
        new CustomResize({
            "id": "div_table",
            "fun": computeHeight
        });
 
        //绑定按钮事件
        //新增按钮事件
        $("#btnAddFlowCategory").click(function () {
            editFlowCategory(0);
        });
 
        $("#btnUpdateFlowCategory").click(function () {
            var node = $('#ul_flowCategory').tree('getSelected');
            if (node == null) {
                wcp.message.info("请选择需要修改的流程分类!");
            } else {
                editFlowCategory(node.id);
            }
        });
        //删除按钮事件
        $("#btnDeleteFlowCategory").click(function () {
            var node = $('#ul_flowCategory').tree('getSelected');
            if (node == null) {
                wcp.message.info("请选择需要删除的流程分类!");
            } else {
 
                deleteFlowCategorys([node.id]);
            }
        });
    })
 
    function selectNode(node) {
        NowSelectedflowCategoryId = node.id;
        $('#dg_flowCategory_flowDefinition').datagrid('load', {
            flowCategoryId: NowSelectedflowCategoryId
        });
    }
 
    function computeHeight() {
        var wh = $(window).height();
        $("#div_table").height(wh - 89);
        $("#dg_flowCategory_flowDefinition").datagrid("resize");
    }
 
    //关键字搜索方法
    function SearchKey() {
        var keyValue = $("#txtKeySearch").val();
        $('#dg_flowCategory_flowDefinition').datagrid('load', {
            flowCategoryId: NowSelectedflowCategoryId,
            searchText: keyValue
        });
    }
 
    //新增
    function addFlowCategory() {
        var node = $('#ul_flowCategory').tree('getSelected');
        if (node == null) {
            wcp.message.info("请选择一个流程分类!");
        } else {
            var url = "config/flowCategory/addFlowCategoryIndex?flowCategoryId=" + node.id;
            var title = "流程信息";
            top.layer.open({
                title: title,
                type: 2,
                area: ["800px", "500px"],
                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 designFlow(flowId) {
        var url = "config/flowDefinition/designFlow?flowDefinitionId=" + flowId;
        window.open(url, "flowDesign");
    }
 
    //刷新表格数据
    function refreshData() {
        $('#dg_flowCategory_flowDefinition').datagrid('reload');
        //清除已经选择的数据
        $('#dg_flowCategory_flowDefinition').datagrid('clearSelections');
        $('#dg_flowCategory_flowDefinition').datagrid('clearChecked');
    }
 
    //删除单个流程事件
    function deleteFlowCategoryRelation(id) {
        //alert(id);
        deleteFlowCategoryRelations([id]);
    }
 
    //删除多个流程事件
    function deleteFlowCategoryRelations(ids) {
        layer.confirm("确定要删除选择的流程吗?", {
            icon: 3,
            title: '提示'
        }, function (index) {
            wcp.ui.setBusy("body", wcp.ajax({
                url: "config/flowCategory/deleteFlowCategoryRelations",
                data: JSON.stringify(ids),
            }).done(function (result) {
                wcp.notify.success('删除成功!');
 
                //刷新数据
                refreshData();
            }));
            layer.close(index);
        });
    }
 
    //流程分类信息编辑方法
    function editFlowCategory(flowCategoryId) {
        var url = "config/flowCategory/editFlowCategory?flowCategoryId=" + flowCategoryId;
        var title = flowCategoryId == 0 ? "新增流程分类" : "编辑流程分类";
        top.layer.open({
            title: title,
            type: 2,
            area: ["550px", "400px"],
            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 = refreshFlowCategoryTree;
            }
        });
    }
 
    //删除流程分类事件
    function deleteFlowCategorys(flowCategoryIds) {
        layer.confirm("确定要删除选择的流程分类吗?", {
            icon: 3,
            title: '提示'
        }, function (index) {
            wcp.ui.setBusy("body", wcp.ajax({
                url: "config/flowCategory/deleteFlowCategory",
                data: JSON.stringify(flowCategoryIds),
            }).done(function (result) {
                wcp.notify.success('删除成功!');
                //刷新数据
                refreshFlowCategoryTree();
            }));
 
            layer.close(index);
        });
    }
 
    //刷新流程树
    function refreshFlowCategoryTree() {
        $('#ul_flowCategory').tree('reload');
    }
 
    //排序
    function enableSort(obj) {
        var oA = $(obj);
        var tip = $.trim(oA.text());
        if (tip == "排序") {
            oA.html('<i class="fa fa-retweet"></i>保存排序');
            dg_flowCategory_flowDefinition.datagrid("enableDnd");
        } else {
            oA.html('<i class="fa fa-retweet"></i>排序');
            if (tip == "保存排序") {
                saveSortNum();
            }
        }
    }
 
    //保存列排序号
    function saveSortNum(dataGridId, postUrl) {
        var data = $('#dg_flowCategory_flowDefinition').datagrid('getRows');
        var Ids_SortNums = new Array();
        $.each(data, function (i, row) {
            Ids_SortNums.push(row.id + "_" + (i + 1));
        });
        wcp.ui.setBusy("body", wcp.ajax({
            url: 'config/flowCategory/saveFlowCategorySortNum',
            data: JSON.stringify(Ids_SortNums),
        }).done(function (result) {
            refreshData();
            top.wcp.notify.success("保存排序成功!");
        }));
    }
</script>
</html>