2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.w3.org/1999/xhtml" >
<head>
    <meta charset="utf-8" />
    <title th:text="${systemName}"></title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
    <link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/assets/css/style.css'}" />
    <link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/expand/css/bootstrap-extract.css'}" />
    <link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/assets/plugins/bootstrap-datepicker/old_datepaker/datepicker.css'}" />
    <link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/css/portlet.css'}" />
    <script th:src="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/portlet.js'}"></script>
    <!-- 表单样式  -->
    <script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/js/jquery.min.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/layer/layer.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/js/tether.min.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/js/bootstrap.min.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/plugins/bootstrap-datepicker/old_datepaker/bootstrap-datepicker.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/plugins/bootstrap-datepicker/old_datepaker/bootstrap-datepicker.zh-CN.min.js'}"></script>
    <link th:href="@{${pubzyWebRoot} + 'ext-4.2.1.883/resources/css/ext-all-neptune.css'}" rel="stylesheet" type="text/css" />
 
    <script th:src="@{${pubzyWebRoot} + 'ext-4.2.1.883/ext-all.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'ext-4.2.1.883/locale/ext-lang-zh_CN.js'}"></script>
    <script th:src="@{${pubzyWebRoot} + 'ext-4.2.1.883/PagingToolbar.js'}"></script>
 
    <script th:src="@{${pubzyWebRoot} + 'media/js/winPro.js'}"></script>
    <style>
        .x-grid-with-row-lines .x-grid-td {
            vertical-align: text-top;
        }
        .x-grid-view {
            overflow: hidden !important;
        }
        .x-body{
            overflow-x: hidden;
        }
        .DivHeight {
            height: 45px;
        }
 
        .form-horizontal .control-label {
            width: 70px;
        }
 
        [class*='span'] {
            margin-left: 0 !important;
        }
 
        .row-fluid [class*='span'] {
            margin-left: 0 !important;
        }
 
        .row {
            margin-left: 0;
            margin-right: 0;
        }
 
        .x-grid-row td,
        .x-grid-data-row td {
            border-right: 1px solid #E3E3E3;
        }
 
        .col-sm-12, .col-md-6, .col-lg-4, .col-xl-3 {
            padding-left: 0;
            padding-right: 0;
        }
 
        body {
            padding-bottom: 10px;
        }
 
        .x-grid-view{
            overflow:auto !important;
        }
    </style>
    <script  th:inline="javascript">
        var msg = [[${msg}]];
        $(function(){
            if(msg != "") {
                alert(msg);
            }
            $(".date-picker").datepicker({format: 'yyyy-mm-dd', language: 'zh-CN'}); //初始化时间控件
            var type = $(this).find("option:selected").attr("ZiDuanType");
            //如果是时间的话 input变成两个
            if(type=="时间"){
                $("#pubdateBegin").show();
                $("#pubdatefinish").show();
                $("#IntNumfinish").css("display", "none");
                $("#IntNumBegin").css("display", "none");
                $("#selcetZiDuanZhi").css("display", "none");
                $("#ZiDian").css("display", "none");
            }
            else {
                $("#pubdateBegin").css("display", "none");
                $("#pubdatefinish").css("display", "none");
                $("#IntNumfinish").css("display", "none");
                $("#IntNumBegin").css("display", "none");
                $("#selcetZiDuanZhi").show();
                $("#ZiDian").css("display", "none");
            }
            if(type=="整数"){
                $("#IntNumfinish").show();
                $("#IntNumBegin").show();
                $("#pubdateBegin").css("display", "none");
                $("#pubdatefinish").css("display", "none");
                $("#selcetZiDuanZhi").css("display", "none");
                $("#ZiDian").css("display", "none");
            }else {
                $("#pubdateBegin").css("display", "none");
                $("#pubdatefinish").css("display", "none");
                $("#IntNumfinish").css("display", "none");
                $("#IntNumBegin").css("display", "none");
                $("#selcetZiDuanZhi").show();
                $("#ZiDian").css("display", "none");
            }
 
            $("#ZiDian").change(function () {
                var type = $(this).find("option:selected").attr("ZiDuanType");
                var ZiDuanGeShi= $(this).find("option:selected").attr("ziduangeshi");
                //如果类型是整数 并且 字段关联了字典表
                if(type=="整数" && ZiDuanGeShi.indexOf("guanlianzidian")>0){
                    var values = $("#ZiDian").find("option:selected").val();
                    //将values赋值给 $("#IntNumfinish") $("#IntNumBegin")
                    $("#IntNumfinish").val(values);
                    $("#IntNumBegin").val(values);
                }else {
                    var values = $("#ZiDian").find("option:selected").val();
                    $("#selcetZiDuanZhi").val(values);
                }
            })
 
            $("#selcetZiDuan").change(function(){
                $("#ZiDian").html("");
                //切换一下 input框的内容就要被清除
                $("#selcetZiDuanZhi").val("");
                $("#pubdateBegin").val("");
                $("#pubdatefinish").val("");
                $("#IntNumfinish").val("");
                $("#IntNumBegin").val("");
                //获取自定义属性的值
                var type = $(this).find("option:selected").attr("ZiDuanType");
                var ZiDuanGeShi= $(this).find("option:selected").attr("ziduangeshi");
                //{"guanlianzidian":"ApplyStatus"}
                //如果是时间的话 input变成两个
                if(type=="时间"){
                    $("#pubdateBegin").show();
                    $("#pubdatefinish").show();
                    $("#IntNumfinish").css("display", "none");
                    $("#IntNumBegin").css("display", "none");
                    $("#selcetZiDuanZhi").css("display", "none");
 
                }else  if(type=="整数"){
                    $("#IntNumfinish").show();
                    $("#IntNumBegin").show();
                    $("#pubdateBegin").css("display", "none");
                    $("#pubdatefinish").css("display", "none");
                    $("#selcetZiDuanZhi").css("display", "none");
                }else {
                    $("#pubdateBegin").css("display", "none");
                    $("#pubdatefinish").css("display", "none");
                    $("#IntNumfinish").css("display", "none");
                    $("#IntNumBegin").css("display", "none");
                    $("#selcetZiDuanZhi").show();
                }
                if(ZiDuanGeShi.indexOf("guanlianzidian")>0){
                    var arr1=ZiDuanGeShi.split(":");
                    var arr2=arr1[1].replace("\"","").replace("\"","").replace("}","").trim();
                    $("#ZiDian").html("");
                    //获取字典表,然后循环
                    $.ajax({
                        type: "GET",
                        url: '/res/ZiYuan/DataType?type='+arr2,
                        success: function (result) {
                            var data= eval('[' + result + ']');
                            var html = "<option value=\"\">全部</option>";
                            for(var i = 0; i < data.length; i++){
                                html += "<option value=\""+data[i].key+"\">"+ data[i].value +"</option>";
                            }
                            $("#ZiDian").append(html);
                        }
                    });
                    $("#pubdateBegin").css("display", "none");
                    $("#pubdatefinish").css("display", "none");
                    $("#IntNumfinish").css("display", "none");
                    $("#IntNumBegin").css("display", "none");
                    $("#selcetZiDuanZhi").css("display", "none");
                    $("#ZiDian").show();
 
                }else if(ZiDuanGeShi.indexOf("SQLchaxun")>0){
                    var json= eval('(' + ZiDuanGeShi + ')');
                    var json2= eval(json.SQLchaxun[0]);
                    var resourceid=$("#resourceid").val();
                    $("#ZiDian").html("");
                    //获取字典表,然后循环
                    $.ajax({
                        type: "GET",
                        url: '/res/ZiYuan/SQLSource?SQLkey='+json2.SQLkey+'&SQLtext='+json2.SQLtext+'&SQLtable='+json2.SQLtable+'&resourceid='+resourceid,
                        success: function (result) {
                            var data= eval('[' + result + ']');
                            var html = "<option value=\"\">全部</option>";
                            for(var i = 0; i < data.length; i++){
                                html += "<option value=\""+data[i].key+"\">"+ data[i].value +"</option>";
                            }
                            $("#ZiDian").append(html);
                        }
                    });
                    $("#pubdateBegin").css("display", "none");
                    $("#pubdatefinish").css("display", "none");
                    $("#IntNumfinish").css("display", "none");
                    $("#IntNumBegin").css("display", "none");
                    $("#selcetZiDuanZhi").css("display", "none");
                    $("#ZiDian").show();
                }else {
                    $("#ZiDian").css("display", "none");
                }
 
 
            });
        });
 
        //查询事件
        function Search() {
            Ext.getCmp('gridexample').dockedItems.items[1].store.currentPage = 1;
            ZYMLZiYuanStore.load()
 
        }
 
        //查询区清除
        function Clear() {
            document.getElementById("SearchForm").reset();
            $("#ZiDian").html("");
        }
 
        //导出
        function Export() {
            GetSearchWhere("SearchForm");
            Ext.MessageBox.wait("正在进行导出,请稍后...", "操作提示", {
                interval: 100
            });
            formdata.PageSize = ZYMLZiYuanStore.pageSize;
            formdata.PageIndex = ZYMLZiYuanStore.currentPage;
            Ext.Ajax.request({
                url: '/res/ZiYuan/BaseLeftSourceShuJuExcel?resourceid='+resourceid,
                params: eval(formdata),
                success: function (response) {
                    Ext.MessageBox.hide();
                    //加载
                    window.open(response.responseText);
                }
            });
        }
    </script>
</head>
<script th:inline="javascript">
    var resourceid = [[${resourceid}]];
    var list = [[${list}]];
    var columns = [[${columns}]];
 
    /*]]>*/
</script>
<script src="/js/manage/databasetable.js"></script>
<body>
<div id="rapp">
    <input type="hidden" id="resourceid" th:value="${resourceid}"/>
    <div>
        <div class="panel panel-default">
            <div class="panel-heading">
                查询区
            </div>
            <div class="panel-body SearchBox">
                <form id="SearchForm">
                    <div class="row">
                        <div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 DivHeight">
                            <label class="control-label">字段:</label>
                            <div class="controls">
                                <select class="form-control col-sm-12" name="selcetZiDuan" onchange="" id="selcetZiDuan">
                                    <option >--选择字段--</option>
                                    <option th:each="item:${map}" th:value="${item.ZiDuanName}"
                                            th:text="${item.ZiDuanBieMing}"
                                            th:attr="ZiDuanType=${item.ZiDuanType},ZiDuanGeShi=${item.ZiDuanGeShi}">
                                    </option>
                                </select>
 
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 DivHeight">
                            <label class="control-label">字段值:</label>
                            <div class="controls">
                                <input type="text" class="form-control" id="selcetZiDuanZhi" name="selcetZiDuanZhi"  />
                                <input type="text" class="custom-form-control date-picker" readonly="readonly" id="pubdateBegin" name="pubdateBegin" style="width:49%; float: left"  />
                                <input type="text" class="custom-form-control date-picker" readonly="readonly" id="pubdatefinish" name="pubdatefinish" style="width:49%; float: right;" />
                                <input type="text" class="custom-form-control " id="IntNumBegin" name="IntNumBegin" style="width:49%; float: left"  />
                                <input type="text" class="custom-form-control " id="IntNumfinish" name="IntNumfinish" style="width:49%; float: right;" />
                                <select class="form-control col-sm-12" id="ZiDian">
 
                                </select>
                            </div>
                        </div>
 
                    </div>
 
                    <div class="row" style="display:block;">
                        <div style="float: right;padding-right: 0.75em;">
                            <a class="btn btn-primary-outline" onclick="Search();"><i class="fa fa-search"></i>&nbsp;查询</a>
                            <a class="btn btn-primary-outline" onclick="Clear();"><i class="fa fa-trash-o"></i>&nbsp;清除</a>
                            <a class="btn btn-primary-outline" onclick="Export();"><i class="fa fa-share-alt"></i>&nbsp;导出</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div id="grid" style="width: 100%"></div>
    </div>
</div>
</body>
</html>