多单位版国产化地质资料管理系统
zhai
2025-12-18 3c6f6c1e3016e38146a4c46be6e7b625c35591f2
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
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<%@ 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%>">
    <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/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.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>
 
    <!-- 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>
 
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .combobox-group {
            clear: both;
        }
 
        .combobox-gitem {
            float: left;
            padding-right: 10px;
        }
    </style>
 
</head>
 
<body class="pt-tree">
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon">
                    <i class="fa fa-share-alt"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>流程信息</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formFlow" method="post">
            <div class="ptbody">
                <table style="width: 100%;">
                    <tr>
                        <td class="tbtitle">
                            <em class="pt-color-danger">*</em> 流程名称:
                        </td>
                        <td>
                            <input id="flowName" name="flowName" class="easyui-textbox" type="text"
                                   data-options="required:true" style="width:100%" value="${flowDefinition.flowName}"/>
                            <input type="hidden" id="flowId" name="flowId" value="${flowDefinition.flowId}">
                            <input type="hidden" id="moduleId" name="moduleId" value="${flowDefinition.moduleId}">
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">
                            <em class="pt-color-danger">*</em> 流程表单:
                        </td>
                        <td>
                            <select name="formId" id="formId" style="width:100%;"></select>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">
                            <em class="pt-color-danger">*</em> 流程标题:
                        </td>
                        <td>
                            <input id="flowTitleExpression" name="flowTitleExpression" class="easyui-textbox"
                                   type="text" value="${flowDefinition.flowTitleExpression}"
                                   data-options="required:true, buttonText:'选择字段',prompt:'',onClickButton:selectColumn"
                                   style="width:100%;"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">
                            编制单位字段:
                        </td>
                        <td>
                            <input id="createUnit" name="createUnit" class="easyui-textbox" type="text"
                                   value="${flowDefinition.createUnit}"
                                   data-options="buttonText:'选择字段',prompt:'',onClickButton:selectColumn"
                                   style="width:100%;"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">
                            文件代码字段:
                        </td>
                        <td>
                            <input id="fileCode" name="fileCode" class="easyui-textbox" type="text"
                                   value="${flowDefinition.fileCode}"
                                   data-options="buttonText:'选择字段',prompt:'',onClickButton:selectColumn"
                                   style="width:100%;"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">
                            紧急程度代码字段:
                        </td>
                        <td>
                            <input id="emergencyDegreeCode" name="emergencyDegreeCode" class="easyui-textbox" type="text"
                                   value="${flowDefinition.emergencyDegreeCode}"
                                   data-options="buttonText:'选择字段',prompt:'',onClickButton:selectColumn"
                                   style="width:100%;"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">流程类型:</td>
                        <td>
                            <select id="flowType" name="flowType" class="easyui-combobox" style="width:100%;"
                                    data-options="editable:false,panelHeight:'auto'">
                                <option value="0" selected="selected">电脑端</option>
                                <option value="1">手机端</option>
                                <option value="2">电脑端+手机端</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">
                            流程图标:
                        </td>
                        <td>
                            <input id="flowIcon" name="flowIcon" value="${flowDefinition.flowIcon}"
                                   class="easyui-textbox" type="text"
                                   data-options="editable:false,buttonText:'选择图标',prompt:'',onClickButton:selectIcon"
                                   style="width:100%;"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">
                            流程样式:
                        </td>
                        <td>
                            <input id="flowCss" name="flowCss" class="easyui-textbox" type="text"
                                   style="width:100%" value="${flowDefinition.flowCss}"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">流程状态:</td>
                        <td>
                            <input type="hidden" id="flowState" name="flowState" value="${flowDefinition.flowState}"/>
                            <input id="flowStateText" class="easyui-switchbutton"
                                   data-options="onText:'启用',offText:'关闭',onChange:flowStateTextChange"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">流程描述:</td>
                        <td>
                            <input id="flowDescription" name="flowDescription" class="easyui-textbox" type="text"
                                   class="easyui-textbox" data-options="multiline:true" style="height:120px;width:100%"
                                   value="${flowDefinition.flowDescription}"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">
                            流程终止监听器:
                        </td>
                        <td>
                            <input id="flowTerminationListener" name="flowTerminationListener" class="easyui-textbox"
                                   type="text" value="${flowDefinition.flowTerminationListener}"
                                   style="width:100%;"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">是否使用权限:</td>
                        <td>
                            <input type="hidden" id="enablePermission" name="enablePermission"/>
                            <input id="enablePermissionText" class="easyui-switchbutton"
                                   data-options="onText:'是',offText:'否',onChange:isPermissionChange"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">权限名称:</td>
                        <td>
                            <input id="permissionName" name="permissionName" class="easyui-textbox" type="text"
                                   value="${flowDefinition.permissionName }"
                                   data-options="editable:false,buttonText:'生成',prompt:'',onClickButton:function(){generatePermission();}"
                                   style="width:85%;"/>
                            <a id="permission_but" class="pt-btn pt-btn-default">选择权限</a>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
        <div class="pt-form-btn">
            <div class="form-group">
                <button id="btnSave" class="pt-btn pt-btn-primary">保存</button>
                <button id="btnClose" class="pt-btn pt-btn-default">关闭</button>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null,
        callBackParams: null
    };
 
    $(function () {
        initFlowCss();
        <c:if test="${flowDefinition.flowType!=null}">
        $('#flowType').combobox('setValue', '${flowDefinition.flowType}');
        </c:if>
 
        $('#formId').combobox({
            url: 'config/form/getFormListForSelect?moduleId=' + $("#moduleId").val(),
            valueField: 'formId',
            textField: 'formName',
            editable: false,
            panelHeight: 'auto',
            onLoadSuccess: function () {
                $('#formId').combobox('setValue', '${flowDefinition.formId}');
            }
        });
 
        if ($("#flowState").val() == "1") {
            $('#flowStateText').switchbutton("check");
        } else {
            $('#flowStateText').switchbutton("uncheck");
        }
 
        //判断权限名称是否可编写
        if (${flowDefinition.enablePermission}) {
            $("#permissionName").textbox("enable");
            $('#enablePermissionText').switchbutton("check");
            $("#enablePermission").val("true");
        } else {
            $('#enablePermissionText').switchbutton("uncheck");
            $("#permissionName").textbox("disable");
            $("#enablePermission").val("false");
        }
        $("#permission_but").click(function () {
            selectPermission();
        });
 
        $("#btnSave").click(function () {
            saveFlow();
        });
 
 
        $("#btnClose").click(function () {
            closeWindow();
        });
 
        new ResizeScroll({
            "id": ".ptbody",
            "fun": function () {
                var wh = $(window).height();
                return (wh - 79 - 52);
            }
        });
    });
 
    //选择权限
    function selectPermission() {
        //usedParentId = $("#parentId").combotree("getValue");
        var enablePermission = $("#enablePermission").val();
        var flowId = $("flowDefinition.flowId");
        if (enablePermission != 0 && (flowId == null || flowId == 0)) {
            wcp.picker.selectPermission({
                title: "请选择权限",
                multiSelect: false,
                nameElement: "permissionName",
                layerOpener: window
            });
        }
    }
 
    function flowStateTextChange(checked) {
        if (checked) {
            $("#flowState").val(1);
        } else {
            $("#flowState").val(0);
        }
    }
 
    //判断权限名称是否填写
    function isPermissionChange(checked) {
        $("#enablePermission").val(checked);
        if (checked) {
            $("#permissionName").textbox("enable");
        } else {
            $("#permissionName").textbox("disable");
        }
    }
 
    function saveFlow() {
        //验证表单信息
        var isValid = $('#formFlow').form('validate');
        if (!isValid) {
            wcp.notify.warn('表单验证有误,请检查表单输入项!');
            return false;
        }
 
        var obj = $("#formFlow").serializeObject();
 
        wcp.ui.setBusy("body", wcp.ajax({
            url: "config/flowDefinition/saveFlow",
            data: JSON.stringify(obj),
        }).done(function (result) {
            //判断是否需要执行回调函数
            if (params.callBack) {
                if (params.callBackParams) {
                    params.callBack(params.callBackParams);
                } else {
                    params.callBack();
                }
            }
 
            //关闭窗口
            closeWindow();
 
            top.wcp.notify.success("保存成功!");
        }));
    }
 
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
 
    // ===========================流程图标/流程样式/编制单位字段/文件代码字段=====================================
    /***************************
     * 选择图标
     *
     */
    function selectIcon() {
        wcp.picker.selectIcon({
            title: "请选择图标",
            nameElement: "flowIcon",
            layerOpener: window
        });
    }
 
    /***************************
     * 初始化流程样式
     *
     */
    function initFlowCss() {
        $("#flowCss").combobox({
            valueField: 'id',
            textField: 'text',
            data: [
                {
                    id: 'pt-color-0',
                    text: '淡绿色'
                },
                {
                    id: 'pt-color-1',
                    text: '杏仁色'
                },
                {
                    id: 'pt-color-2',
                    text: '浅粉红'
                },
                {
                    id: 'pt-color-3',
                    text: '淡黄色'
                },
                {
                    id: 'pt-color-4',
                    text: '淡蓝色'
                },
                {
                    id: 'pt-color-5',
                    text: '淡紫色'
                },
                {
                    id: 'pt-color-6',
                    text: '靛蓝色'
                },
                {
                    id: 'pt-color-7',
                    text: '淡红色'
                },
                {
                    id: 'pt-color-8',
                    text: '紫色'
                },
                {
                    id: 'pt-color-9',
                    text: '黄色'
                },
                {
                    id: 'pt-color-10',
                    text: '蓝色'
                },
                {
                    id: 'pt-color-11',
                    text: '绿色'
                },
                {
                    id: 'pt-color-12',
                    text: '蓝色'
                },
                {
                    id: 'pt-color-13',
                    text: '草绿色'
                },
                {
                    id: 'pt-color-14',
                    text: '兰花紫'
                },
                {
                    id: 'pt-color-15',
                    text: '橘黄色'
                },
                {
                    id: 'pt-color-16',
                    text: '淡紫色'
                },
                {
                    id: 'pt-color-17',
                    text: '青色'
                },
                {
                    id: 'pt-color-18',
                    text: '小麦色'
                }
            ]
        });
    }
 
    /***************************
     * 选择字段
     *
     */
    function selectColumn() {
        var idSelector = this.id;
        var multiSelect = false;
        if (idSelector == "flowTitleExpression") {
            multiSelect = true;
        }
        wcp.picker.selectTableColumn({
            title: "请选择字段",
            moduleId: '${flowDefinition.moduleId}',
            multiSelect: multiSelect,
            layerOpener: window
        }, function (rows) {
            var value = convertColumn(rows);
            // console.log(rows);
            // switch (idSelector) {
            //     case "flowTitleExpression":
            //         value = convertColumn(rows);
            //         break;
            //     case "createUnit":
            //         value = rows[0].columnName;
            //         break;
            //     case "fileCode":
            //         value = rows[0].columnName;
            //         break;
            //     default:
            //         break;
            // }
            $("#" + idSelector).textbox("setValue", value);
        });
    }
 
    /***************************
     * 转换为表达式
     *
     */
    function convertColumn(rows) {
        var result = "";
        $.each(rows, function (index, value) {
            result += ("$" + "{" + value.columnName + "}");
        })
        return result;
    }
</script>
</html>