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
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
<form class="form-horizontal" id="ywjcform" method="post" xmlns:th="http://www.w3.org/1999/xhtml">
    <div class="portlet box ltblue">
        <div class="portlet-title">
            业务集成信息
            <div class="caption">
                <i class="fa fa-reorder"></i>
            </div>
            <div class="tools">
                <a class="collapse" onclick="portlet_body_ShowOrHide(this);"></a>
            </div>
        </div>
        <div class="portlet-body">
            <div class="row">
                <div class="col-sm-12">
                    <div class="control-group">
                        <label class="control-label">服务地址<span style="color: red;">*</span></label>
                        <div class="controls input-icon">
                            <input  style="width:89%" id="serverurl" name="serverurl" class="form-control col-sm-11"  required=""/>
                            <span class="input-warning tooltips" data-original-title="">
                                <i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">集成类型<span style="color: red;">*</span></label>
                        <div class="controls input-icon">
                            <select id="integratetype" name="integratetype" class="form-control col-sm-9" onchange="Change(this);" required="">
                                <option value="">-- 请选择 --</option>
                                <option th:selected="(${Res_ExtIntegrate.integratetype}=='页面集成')?'true':'false'"  value="页面集成">页面集成</option>
                                <option th:selected="(${Res_ExtIntegrate.integratetype}=='数据集成')?'true':'false'"  value="数据集成">数据集成</option>
                            </select>
                            <span class="input-warning tooltips" data-original-title="">
                                <i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
                            </span>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6" name="YeMianJiChengMode" style="display: none;">
                    <div class="control-group">
                        <div class="control-group">
                            <label class="control-label">页面展示模式</label>
                            <div class="controls input-icon">
                                <select id="showmodel" name="showmodel" class="form-control col-sm-9">
                                    <option value="">-- 请选择 --</option>
                                    <option th:selected="(${Res_ExtIntegrate.showmodel}=='Iframe区块')?'true':'false'"  value="Iframe区块">Iframe区块</option>
                                    <option th:selected="(${Res_ExtIntegrate.showmodel}=='侧边栏')?'true':'false'"  value="侧边栏">侧边栏</option>
                                    <option th:selected="(${Res_ExtIntegrate.showmodel}=='弹出页面')?'true':'false'"  value="弹出页面">弹出页面</option>
                                </select>
                                <span class="input-warning tooltips" data-original-title="">
                                <i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
                            </span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6" name="YeMianJiChengMode" style="display: none;">
                    <div class="control-group">
                        <label class="control-label">分辨率(宽X高)</label>
                        <div class="controls input-icon">
                            <input id="resolutionBen" style="width: 36.12%;" name="resolutionBen" th:value="${resolutionBen}" class="form-control" value="" olnynum="true" />
                            X
                            <input id="resolutionEnd" style="width: 36.12%;" name="resolutionEnd" th:value="${resolutionEnd}" class="form-control" value="" olnynum="true" />
                        </div>
                    </div>
                </div>
                <div class="col-sm-12" name="YeMianJiChengMode" style="display: none;">
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls input-icon">
                            <span style="color:red;">建议分辨率(平台门户面板):宽度为 321、652、983、1314 像素,高度为 200、442 像素</span>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6" name="ShuJuJiCheng" style="display: none;">
                    <div class="control-group">
                        <label class="control-label">关联业务图层</label>
                        <div class="controls input-icon">
                            <input th:value="${Res_ExtIntegrate.reflayerid}" type="hidden" id="reflayerid" name="reflayerid" />
                            <input th:value="${reflayername}" type="text" id="reflayername" name="reflayername" readonly="readonly" class="form-control col-sm-8" />
                            <a class="btn" style="background-color: #e5e5e5;vertical-align:baseline !important;color: black;" title='选择关联业务图层' id="btnSelectGlbzt" onclick="reflayer();">...</a>
                            <span class="input-warning tooltips" data-original-title="">
                                <i class="icon-warning-sign" style="display: none;margin-left:34px"></i>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row" name="ShuJuJiCheng" style="display: none;">
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">地图设置</label>
                        <div class="controls input-icon">
                            <input type="hidden" th:value="${Res_ExtIntegrate.refbasemapid}" id="refbasemapid" name="refbasemapid" />
                            <input th:value="${baseMapLayerName}" id="baseMapLayerName" name="baseMapLayerName" type="text" class="form-control col-sm-6" disabled="disabled" style="padding: 0.3rem 0.7rem;" />
                            <button type="button" class="btn btn-primary" onclick="sheZhi();" style="vertical-align:baseline;">设置</button>
                            <button type="button" class="btn btn-primary" onclick="diTuClear();" style="vertical-align:baseline;">清除</button>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">业务图层关联字段</label>
                        <div class="controls input-icon">
                            <select id="reflayerfield" name="reflayerfield" class="form-control col-sm-9">
                                <option value="">-- 请选择 --</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row" name="ShuJuJiCheng" style="display: none;">
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">渲染方式</label>
                        <div class="controls input-icon">
                            <select id="rendermode" name="rendermode" class="form-control col-sm-9">
                                <option value="">-- 请选择 --</option>
                                <option th:selected="(${Res_ExtIntegrate.rendermode}=='统计图')?'true':'false'"  value="统计图">统计图</option>
                                <option th:selected="(${Res_ExtIntegrate.rendermode}=='统计表')?'true':'false'"  value="统计表">统计表</option>
                                <option th:selected="(${Res_ExtIntegrate.rendermode}=='图层渲染')?'true':'false'"  value="图层渲染">图层渲染</option>
                                <option th:selected="(${Res_ExtIntegrate.rendermode}=='图层标注')?'true':'false'"  value="图层标注">图层标注</option>
                            </select>
                            <span class="input-warning tooltips" data-original-title="">
                                <i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row" style="display: none;">
                <div class="col-sm-12">
                    <div class="control-group">
                        <label class="control-label">图层渲染样式</label>
                        <div class="controls input-icon">
                            <textarea th:text="${Res_ExtIntegrate.layerjosnclass}" id="layerjosnclass" name="layerjosnclass" class="form-control col-sm-11" rows="3" cols="70" style="height: 70px;" ></textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row TongJiTu">
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">宽</label>
                        <div class="controls">
                            <input th:value="${Res_ExtIntegrate.chartwidth}" type="text" disabled="true" id="chartwidth1" class="form-control col-sm-9"/>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="control-group">
                        <label class="control-label">高</label>
                        <div class="controls">
                            <input th:value="${Res_ExtIntegrate.chartheight}" type="text" disabled="true" id="chartheight1" class="form-control col-sm-9">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row TongJiTu">
                <div class="col-sm-12">
                    <div class="control-group">
                        <label class="control-label">模型</label>
                        <div class="controls">
                            <textarea th:text="${Res_ExtIntegrate.chartmodel}" disabled="true" id="chartmodel1" class="form-control col-sm-11"
                                      style="height: 285px;width: 89%;"></textarea>
                            <br /><br />
                            <button class="btn btn-primary" id="setChartBtn" onclick="setChartModal();"style="vertical-align:baseline;height: 34px;display:none;" type="button">统计图风格配置
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<script th:inline="javascript">
    $(function () {
        var isSetChart = [[${isSetChart}]];
        var serverUrl = [[${serverUrl}]];
        cheackForm("ywjcform");
        /*<![CDATA[*/
        var integratetype = [[${Res_ExtIntegrate.integratetype}]];
        if (integratetype == "页面集成") {
            $('div[name=YeMianJiChengMode]').css('display', '');
            $('div[name=ShuJuJiCheng]').css('display', 'none');
            $(".TongJiTu").hide();
        } else if (integratetype == "数据集成") {
            $('div[name=YeMianJiChengMode]').css('display', 'none');
            $('div[name=ShuJuJiCheng]').css('display', '');
        }
 
        var reflayerid = $("#reflayerid").val();
        var reflayerfield = [[${Res_ExtIntegrate.Reflayerfield}]];
        if(reflayerid != "") {
            getGLTCFiled(reflayerid, reflayerfield);
        }
        /*]]>*/
        $("#rendermode").change(function(){
            if(serverUrl != "") {
                if ($(this).val() == "统计图") {
                    $("#setChartBtn").show();
                    $(".TongJiTu").show();
                } else {
                    $("#setChartBtn").hide();
                    $(".TongJiTu").hide();
                }
            }
        });
        if(isSetChart == '1'){
            $("#setChartBtn").show();
        }
        else {
            $(".TongJiTu").hide();
        }
        $("#serverurl").val(decodeURI(serverUrl));
    });
 
    // //显示模型信息
    // function showChartMoal() {
    //     if ($("#serverurl").val() == '') {
    //         return false;
    //     }
    //     $(".TongJiTu").show();
    //     $.ajax({
    //         url: '/res/resExtIntegrate/getChartInfo',
    //         type: 'GET',
    //         dataType: 'text',
    //         data: {
    //             resourceid: resMainInfoId,
    //             serverurl: $("#serverurl").val()
    //         },
    //         timeout: 5000,
    //         cache: false,
    //         success: function (urlResult) {
    //             var urlList = eval("(" + urlResult + ")");
    //             if (urlList != null) {
    //                 $("#chartwidth1").val(urlList.width != null ? urlList.width : "");
    //                 $("#chartheight1").val(urlList.height != null ? urlList.height : "");
    //                 $("#chartmodel1").val(urlList.model != null ? JSON.stringify(urlList.model) : "");
    //             }
    //         },
    //         error: function (e) {
    //             console.log(e)
    //         }
    //     })
    // }
 
    //底图设置弹框
    function sheZhi() {
        //弹出一个页面层
        layer.open({
            type: 2,
            title: '地图设置',
            shadeClose: true,
            shade: false,
            maxmin: false, //开启最大化最小化按钮
            area: ['600px', '500px'],
            content: '/res/ResManage/ResRegister/BaseMapSelect?isNotOnlyBaseMap=yes'
        });
    }
 
    //关联业务图层弹框
    function reflayer() {
        //弹出一个页面层
        layer.open({
            type: 2,
            title: '关联业务图层',
            shadeClose: true,
            shade: false,
            maxmin: false, //开启最大化最小化按钮
            area: ['600px', '500px'],
            content: '/res/ResManage/ResRegister/BusinessLayerSelect'
        });
    }
 
    function diTuClear() {
        $("#refbasemapid").val("");
        $("#baseMapLayerName").val("");
    }
    //获取关联业务图层图层字段列表
    function getGLTCFiled(id, reflayerfield) {
        $.ajax({
            url: "/res/resExtIntegrate/getGLTCFiled?ResourceId=" + id,
            type: 'get',
            success: function(result) {
                var data = eval(result);
                var optionList = "<option value=''>-- 请选择 --</option>";
                for(var i = 0; i < data.length; i++) {
                    if(reflayerfield != "" && reflayerfield == data[i].name) {
                        optionList += "<option value='" + data[i].name + "' selected>" + data[i].alias + "</option>";
                    } else {
                        optionList += "<option value='" + data[i].name + "'>" + data[i].alias + "</option>";
                    }
                }
                $("#reflayerfield").html(optionList);
            },
            error: function(e) {
                alert(e.message);
            }
        });
    }
 
    /*<![CDATA[*/
    //集成类型切换
    function Change(obj) {
        if ($(obj).val() == "页面集成") {
            $('div[name=YeMianJiChengMode]').css('display', '');
            $('div[name=ShuJuJiCheng]').css('display', 'none');
            $(".TongJiTu").hide();
        } else if ($(obj).val() == "数据集成") {
            $('div[name=YeMianJiChengMode]').css('display', 'none');
            $('div[name=ShuJuJiCheng]').css('display', '');
        }
    }
    /*]]>*/
    // //打开设置模型
    // function setChartModal(){
    //     if($("#serverurl").val() == ''){
    //         alert("请填写服务地址再设置!");
    //         return false;
    //     }
    //     $.ajax({
    //         url:'/res/resExtIntegrate/getChartInfo',
    //         type:'GET',
    //         dataType:'text',
    //         data:{
    //             resourceid:resMainInfoId,
    //             serverurl:$("#serverurl").val()
    //         },
    //         timeout:5000,
    //         cache:false,
    //         success:function (urlResult) {
    //             if(urlResult!=null){
    //                 layer.open({
    //                     type: 1,
    //                     title: '模型设置',
    //                     shadeClose: false,
    //                     area: ['600px', '550px'],
    //                     content: jQuery("#setChartDiv")
    //                 });
    //                 var urlList = eval("("+urlResult+")");
    //                 if(urlList != null){
    //                     $("#chartwidth").val(urlList.width != null ? urlList.width :"");
    //                     $("#chartheight").val(urlList.height != null ? urlList.height :"");
    //                     $("#chartmodel").val(urlList.model != null ? JSON.stringify(urlList.model):"");
    //                 }
    //             }
    //         },
    //         error:function (e) {
    //             console.log(e)
    //         }
    //     })
    // }
 
    // //保存模型
    // function saveSetChart(){
    //     validNum($("#chartwidth").val());
    //     validNum($("#chartheight").val());
    //     $('#modalform').ajaxSubmit({
    //         url: '/res/resExtIntegrate/updateChartInfo',
    //         type: 'post',
    //         dataType: 'json',
    //         data: {'resourceid':resMainInfoId},
    //         success: function (data) {
    //             if(data == "1") {
    //                 alert("保存成功!");
    //                 closeLayer();
    //             } else  {
    //                 alert("保存失败!");
    //             }
    //         },
    //         error: function (e) {
    //             alert(e.message);
    //         }
    //     });
    // }
 
    //关闭Layer
    function closeLayer(){
        $(".layui-layer-close1").click();
        showChartMoal();
    }
 
    //验证数字
    function validNum(str){
        if(str != null && str != ''){
            var reg = new RegExp("^[0-9]*$");
            if(!reg.test(str)){
                alert("请输入数字!");
                return false;
            }
        }
    }
</script>