多单位版国产化地质资料管理系统
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
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 
<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>表单操作配置</title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
            
    <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>
 
<!--[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>
 
  </head>
  
  <body>
        <div title="操作配置" class="viewBody" style="padding:10px 20px;">
            <table id="t_operation"></table>
            <div id="operation_toolbar" class="clear">
                <div class="pull-right"> 
                    <a href="javascript:;" onclick="selectFormOperation();" class="pt-btn pt-btn-success">
                        <i class="fa fa-plus"></i>新增</a>  
                    <a onclick="deleteFormOperationClick();" class="pt-btn pt-btn-danger">
                        <i class="fa fa-trash-o"></i>删除                            
                    </a>
                    <a href="javascript:;" class="pt-btn pt-btn-info" onclick="enableSort(this,'t_operation')">
                        <i class="fa fa-retweet"></i>排序
                    </a> 
                    <a href="javascript:;" onclick='t_operation.datagrid("reload");' class="pt-btn pt-btn-purple">
                        <i class="fa fa-refresh"></i>刷新</a>
                </div>
            </div>
        </div> 
  </body>
  <script>
  var t_operation=null
   $(function () { 
   t_operation= $("#t_operation").datagrid({
           rownumbers: true,
            fitColumns: true,
            method: "get",
            checkOnSelect : false,
            selectOnCheck : false,
            url : 'config/form/getFormOperationByFormId?formId=${form.formId}',
            toolbar: "#operation_toolbar",
            emptyMsg: "没有找到匹配的记录",
            columns: [[
                { field : 'ck', checkbox : true}, 
                { field: 'displayName', title: '显示名称', width: 80 },
                { field: 'operationName', title: '操作名称'},   
                { field: 'createTime', title: '创建时间', width: 70},
                { field: 'lastModifyUserName', title: '创建人', width: 50},   
                {
                    field: 'id', title: '操作', width: 50, align: 'center', formatter: function (value, row, index) {
                        if (value) {
                            return '<a href="javadcript:;" onclick=\'deleteFormOperation("' + value + '");\' class="pt-color-danger"><i class="fa fa-trash-o" title="删除"></i></a>';
 
                        } else {
                            return "";
                        }
 
                    }
                }
            ]],
            onLoadSuccess: function (data) {
            }
        });
    });
    function deleteFormOperationClick()
    {
        //获取dg选中的数据行
        var checkRows = $("#t_operation").datagrid("getChecked");
        if (checkRows.length == 0) { 
            wcp.message.info("请选择需要删除的行!");
        } else {
            var ids = new Array();
            $.each(checkRows, function(index, value) {
                ids.push(value.id);
            }); 
            deleteFormOperations(ids);
        }
    }
    //删除单个表单事件
    function deleteFormOperation(id) { 
        deleteFormOperations([ id ]);
    }
    //删除表单事件
    function deleteFormOperations(ids) {  
        layer.confirm("确定要删除选择的操作吗?", {
            icon : 3,
            title : '提示'
        }, function(index) {
            wcp.ui.setBusy("body", wcp.ajax({
                url : "config/form/deleteFormOperation",
                data : JSON.stringify(ids),
            }).done(function(result) {
                wcp.notify.success('删除成功!');
                //刷新数据
                $('#t_operation').datagrid('reload');
            }));  
        });
    }
    //增加表单操作
    function selectFormOperation() {
        var formId='${form.formId}';
        var moduleId='${form.moduleId}'; 
        wcp.picker.selectOperation({
            title : "请选择操作",
            multiSelect : true,
            operationPosition :1,
            moduleId : moduleId,
            layerOpener : window
        },function(rows){            
            var operationIdList = new Array();
            $.each(rows, function(index, value) {
                operationIdList.push(value.operationId);
            });
            wcp.ui.setBusy("body", wcp.ajax({
                url : "config/form/saveFormOperation?formId="+formId,
                data:JSON.stringify(operationIdList),
                }).done(function(result) {                                                
                    top.wcp.notify.success("保存成功!");
                    //刷新数据
                    $('#t_operation').datagrid('reload'); 
                }));  
        });
    } 
    function enableSort(obj, tname) { 
        var oA = $(obj);
        var tip = $.trim(oA.text()); 
         if (tip == "排序") {
               oA.html('<i class="fa fa-retweet"></i>保存排序');
             t_operation.datagrid("enableDnd");
         } else {
             oA.html('<i class="fa fa-retweet"></i>排序');
             if (tip == "保存排序") {
                 //保存表格中排序 
                 saveSortNum(tname,'config/form/saveOperationSortNum?formId=${form.formId}');
             }
         }  
    }
    
    //保存列排序号
    function saveSortNum(dataGridId,postUrl)
    {
         var data = $('#'+dataGridId).datagrid('getRows');    
         var Ids_SortNums = new Array();
         $.each(data, function(i,row) {
             if(dataGridId=="t_operation")
             {
                 Ids_SortNums.push(row.operationId+"_"+(i+1));
             } 
         }); 
         wcp.ui.setBusy("body", wcp.ajax({
            url : postUrl,
            data : JSON.stringify(Ids_SortNums),
         }).done(function(result) { 
            $('#t_operation').datagrid('reload'); 
             top.wcp.notify.success("保存排序成功!");
         })); 
    }
  </script>
</html>