Map_wev8.js
21 KB
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
if(typeof(MEC_NS) == 'undefined'){
MEC_NS = {};
}
MEC_NS.Map = function(type, id, mecJson){
this.type = type;
if(!id){
id = new UUID().toString();
}
this.id = id;
if(!mecJson){
mecJson = this.getDefaultMecJson();
}
this.mecJson = mecJson;
this.b_map = null;
};
/*获取id。 必需的方法*/
MEC_NS.Map.prototype.getID = function(){
return this.id;
};
MEC_NS.Map.prototype.runWhenPageOnLoad = function(){
this.afterDesignHtmlBuild();
};
/*获取设计的html, 页面上怎么显示控件完全依赖于此方法。 必需的方法*/
MEC_NS.Map.prototype.getDesignHtml = function(){
return getDesignHtml(this);
};
/*页面上显示控件完成后调用此方法,主要用于一些必须要使用js对页面进行后置操作时,无需要此方法可至空。 不必需的方法,有此方法系统自动调用*/
MEC_NS.Map.prototype.afterDesignHtmlBuild = function(){
var $con = $("#NMEC_" + this.id);
$con.children("div").attr("id", "mapContainer_" + this.id);
this.buildMap();
};
MEC_NS.Map.prototype.getBMapObj = function(){
if(!this.b_map){
var theId = this.id;
this.b_map = new BMap.Map("mapContainer_" + theId);
}
return this.b_map;
};
MEC_NS.Map.prototype.buildMap = function(){
var theId = this.id;
var b_map = new BMap.Map("mapContainer_" + theId);
b_map.clearOverlays(); //清除地图上所有覆盖物
var zoomLevel = Mec_FiexdUndefinedVal(this.mecJson["zoomLevel"], 15);
var searchCompleted = false;
var local = new BMap.LocalSearch(b_map, { //智能搜索
onSearchComplete: function(){
if (searchCompleted) { return; }
var results = local.getResults();
if (!results || results.getNumPois() <= 0) {
return console.error("地址没有解析到结果!");
}
searchCompleted = true;
if(local.getResults().getPoi(0).point){
var pp = local.getResults().getPoi(0).point; //获取第一个智能搜索的结果
b_map.centerAndZoom(pp, zoomLevel);
b_map.addOverlay(new BMap.Marker(pp)); //添加标注
}
else{
console.error("地址没有解析结果!");
}
}
});
if(this.mecJson.type == "1"){ //指定位置
if(this.mecJson.addrType == "1"){ //中文地址
local.search(this.mecJson.address);
}
else if(this.mecJson.addrType == "2"){ //坐标
var pointArr = this.mecJson.address.split(",");
if (pointArr.length != 2) {
return console.error("经纬度格式错误!");
}
var p = new BMap.Point(pointArr[0], pointArr[1]);
b_map.centerAndZoom(p, zoomLevel);
b_map.addOverlay(new BMap.Marker(p)); //添加标注
}
}
};
/*获取构建属性编辑窗体的html,添加和单击控件后会调用此方法,由此方法去构建属性编辑窗体。 必需的方法*/
MEC_NS.Map.prototype.getAttrDlgHtml = function(){
var styleL = "_style" + _userLanguage;
var tip = "", addrTip = "";
if(_userLanguage=="8"){
tip = "Note: if you fill in the name of the parameter, the page will get the value from the set parameter name when loading the map. If the parameter name is empty or the value obtained from the parameter name is empty, the contents of the above \"address\" column are used as the display address of the map.";
addrTip = "The address can be: 1. fixed address or coordinate; 2.get page parameters, such as {addr} 3. data set reference, such as {data.addr}.";
}else if(_userLanguage=="9"){
tip = "注:如填寫了參數名稱,則頁面在加載地圖時将從設置的參數名稱中獲取值作爲地圖的顯示地址。如果參數名稱爲空或者從參數名稱中獲取到的值爲空,則将使用上面\"地址\"欄中填寫的内容作爲地圖的顯示地址。";
addrTip = "該地址可以是: 1.固定地址或座標,如:上海市xx區xx路 2.獲取頁面參數,如:{addr} 3.數据集引用,如:{data.addr}";
}else{
tip = "注:如填写了参数名称,则页面在加载地图时将从设置的参数名称中获取值作为地图的显示地址。如果参数名称为空或者从参数名称中获取到的值为空,则将使用上面\"地址\"栏中填写的内容作为地图的显示地址。";
addrTip = "该地址可以是: 1. 固定地址或坐标,如:上海市xx区xx路 2. 获取页面参数,如:{addr} 3. 数据集引用, 如:{data.addr}";
}
var theId = this.id;
var htm = "<div id=\"MADM_"+theId+"\" style=\"padding-bottom: 10px;\">"
+ "<div class=\"title\">"+SystemEnv.getHtmlNoteName(4854)+"</div>"//中心点信息
+ "<div class=\"form-group\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control\">"+SystemEnv.getHtmlNoteName(4836)+"</span>" //取值类型:
+ "<span class=\"col-m-8 multi-checkbox\">"
+ "<span>"
+ "<input type=\"checkbox\" name=\"type_"+theId+"\" value=\"1\" onclick=\"MADMap_ChangeType(this, '"+theId+"');\"/><span class=\"cbboxLabel\">"+SystemEnv.getHtmlNoteName(4837)+"</span>" //指定地址
+ "</span>"
+ "<span>"
+ "<input type=\"checkbox\" name=\"type_"+theId+"\" value=\"2\" onclick=\"MADMap_ChangeType(this, '"+theId+"');\"/><span class=\"cbboxLabel\">"+SystemEnv.getHtmlNoteName(4838)+"</span>" //当前位置
+ "</span>"
+ "</span>"
+ "</div>"
+ "<div class=\"typeContent\" id=\"typeContent_"+theId+"_1\" style=\"display: none;\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control\" style=\"vertical-align: top;\">"+SystemEnv.getHtmlNoteName(4212)+"</span>" //地址:
+ "<div class=\"col-m-8\"><textarea class=\"area-control\" style=\"height:84px;\" id=\"address_"+theId+"\" placeholder=\""+addrTip+"\">"+this.mecJson["address"]+"</textarea></div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control\">"+SystemEnv.getHtmlNoteName(4839)+": </span>" //地址类型:
+ "<span class=\"col-m-8 multi-checkbox\">"
+ "<span>"
+ "<input type=\"checkbox\" name=\"addrType_"+theId+"\" value=\"1\" onclick=\"MADMap_ChangeAddrType(this, '"+theId+"');\"/><span class=\"cbboxLabel\">"+SystemEnv.getHtmlNoteName(4840)+"</span>" //中文地址
+ "</span>"
+ "<span>"
+ "<input type=\"checkbox\" name=\"addrType_"+theId+"\" value=\"2\" onclick=\"MADMap_ChangeAddrType(this, '"+theId+"');\"/><span class=\"cbboxLabel\">"+SystemEnv.getHtmlNoteName(4841)+"</span>" //坐标 (格式:经度,纬度)
+ "</span>"
+ "</span>"
+ "</div>"
+ "<div class=\"addrTypeContent\" id=\"addrTypeContent_"+theId+"_2\" style=\"display: none;\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control\">"+SystemEnv.getHtmlNoteName(4842)+"</span>" //坐标类型:
+ "<span class=\"col-m-8 multi-checkbox\">"
+ "<span>"
+ "<input type=\"checkbox\" name=\"coordinateType_"+theId+"\" value=\"1\"/><span class=\"cbboxLabel\">"+SystemEnv.getHtmlNoteName(4843)+"</span>" //高德/腾讯
+ "</span>"
+ "<span>"
+ "<input type=\"checkbox\" name=\"coordinateType_"+theId+"\" value=\"2\"/><span class=\"cbboxLabel\">"+SystemEnv.getHtmlNoteName(4844)+"</span>" //百度
+ "</span>"
+ "<span>"
+ "<input type=\"checkbox\" name=\"coordinateType_"+theId+"\" value=\"3\"/><span class=\"cbboxLabel\">GPS</span>"
+ "</span>"
+ "</span>"
+ "</div>"
+ "</div>"
+ "</div>"
+ "</div>"
+ "<div class=\"title\">"+SystemEnv.getHtmlNoteName(4845)+"</div>"//附加点信息
+ "<div class=\"form-group\">"
+ "<div class=\"mb-8\">"
+ "<div class=\"row title2\">"
+ "<div class=\"col-8\" style=\"padding-left:2px;vertical-align: bottom;\">"+SystemEnv.getHtmlNoteName(4846)+":</div>"//附加点SQL
+ "<div class=\"col-4\">"
+"<select class=\"form-control\" id=\"datasource_"+theId+"\">"
+"<option value=\"\">(local)</option>"
+"</select>"
+"</div>"
+ "</div>"
+ "<div style=\"position:relative;\">"
+ "<textarea id=\"additionalSql_"+theId+"\" class=\"area-control\" placeholder=\""+SystemEnv.getHtmlNoteName(4852)+"\"></textarea>"//请在此处输入查询附加点的SQL语句
+ "<div class=\"helper sqlhelper\" for=\"sql\">?</div>"
+ "</div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADM_BaseInfo_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4842)+"</span>" //坐标类型:
+ "<span class=\"col-m-8 multi-checkbox\">"
+ "<span>"
+ "<input type=\"checkbox\" name=\"additionalCoordinateType_"+theId+"\" value=\"1\"/><span class=\"cbboxLabel\">"+SystemEnv.getHtmlNoteName(4843)+"</span>" //高德/腾讯
+ "</span>"
+ "<span>"
+ "<input type=\"checkbox\" name=\"additionalCoordinateType_"+theId+"\" value=\"2\"/><span class=\"cbboxLabel\">"+SystemEnv.getHtmlNoteName(4844)+"</span>" //百度
+ "</span>"
+ "<span>"
+ "<input type=\"checkbox\" name=\"additionalCoordinateType_"+theId+"\" value=\"3\"/><span class=\"cbboxLabel\">GPS</span>"
+ "</span>"
+ "</span>"
+ "</div>"
+"<div class=\"row\">"
+"<span class=\"col-2 span-control MADM_BaseInfo_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4847)+"</span>" //显示名称
+"<div class=\"col pd-4\"><input type=\"checkbox\" id=\"isShowAdditionalPointName_"+theId+"\"/></div>"
+"</div>"
+ "<div class=\"row\" style=\"position:relative;\">"
+ "<span class=\"col-2 span-control MADM_BaseInfo_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4848)+":</span>" //范围
+ "<div class=\"col-m-8\">"
+"<input class=\"form-control\" id=\"additionalRadius_"+theId+"\" type=\"text\" placeholder=\""+SystemEnv.getHtmlNoteName(4851)+"\"/>"//如:500,单位:米,以此为半径筛选附加点
+"</div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADM_BaseInfo_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4849)+"</span>" //单击脚本:
+ "<span class=\"click-control mg-2 inline MADM_ClickBtn\" onclick=\"MADMap_writeValidateScript('"+theId+"')\">"
+ "<input id=\"additionalScript_"+theId+"\" type=\"hidden\" value=\"\"/>"
+ "<label class=\"mg-0 scriptTip\" id=\"scriptTip_"+theId+"\">"+SystemEnv.getHtmlNoteName(4850)+"</label>" //点击输入附加点单击脚本
+ "</span>"
+ "</div>"
+ "</div>"//附加点信息form-group end
+ "<div class=\"title\">"+SystemEnv.getHtmlNoteName(4654)+"</div>"//其他设置
+ "<div class=\"form-group\">"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADM_BaseInfo_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4213)+"</span>" //地图高度:
+ "<div class=\"col-m-8\"><input class=\"form-control\" id=\"height_"+theId+"\" type=\"text\" value=\""+this.mecJson["height"]+"\"/></div>"
+ "</div>"
+ "<div class=\"row\">"
+ "<span class=\"col-2 span-control MADM_BaseInfo_Label"+styleL+"\">"+SystemEnv.getHtmlNoteName(4214)+"</span>" //比例尺:
+ "<div class=\"col-m-8\"><select class=\"form-control\" id=\"zoomLevel_"+theId+"\">"
+ "<option value=\"18\">50m</option>"
+ "<option value=\"17\">100m</option>"
+ "<option value=\"16\">200m</option>"
+ "<option value=\"15\">500m</option>"
+ "<option value=\"14\">1km</option>"
+ "<option value=\"13\">2km</option>"
+ "<option value=\"12\">5km</option>"
+ "<option value=\"11\">10km</option>"
+ "<option value=\"10\">20km</option>"
+ "<option value=\"9\">25km</option>"
+ "<option value=\"8\">50km</option>"
+ "<option value=\"7\">100km</option>"
+ "<option value=\"6\">200km</option>"
+ "<option value=\"5\">500km</option>"
+ "<option value=\"4\">1000km</option>"
+ "<option value=\"3\">2000km</option>"
+ "</select></div>"
+ "</div>"
+ "<div class=\"tip-control\" style=\"display:none;\">"+tip+"</div>" //注:如填写了参数名称,则页面在加载地图时将从设置的参数名称中获取值作为地图的显示地址。如果参数名称为空或者从参数名称中获取到的值为空,则将使用上面\"地址\"栏中填写的内容作为地图的显示地址。
+ "</div>"
+ "<div class=\"bottom\">"
+ "<div class=\"save-btn\" onclick=\"refreshMecDesign('"+theId+"');\">"+SystemEnv.getHtmlNoteName(3451)+"</div>" //确定
+ "</div>"
+ "</div>";
htm += "<div class=\"MAD_Alert\">"+SystemEnv.getHtmlNoteName(4115)+"</div>"; //已生成到布局
return htm;
};
/*构建属性编辑窗体完成后调用此方法,主要用于一些必须要使用js对页面进行后置操作时,无需要此方法可至空。 不必需的方法,有此方法系统自动调用*/
MEC_NS.Map.prototype.afterAttrDlgBuild = function(){
var theId = this.id;
/*使用placeholder规避不能赋值的情况*/
var address = this.mecJson["address"];
var paramName = Mec_FiexdUndefinedVal(this.mecJson["paramName"]);
if(paramName != ""){
address = "{"+paramName+"}";
delete this.mecJson["paramName"]; //老数据
}
$("#address_" + theId).val(address);
var zoomLevel = Mec_FiexdUndefinedVal(this.mecJson["zoomLevel"], 15);
$("#zoomLevel_" + theId).val(zoomLevel);
var type = Mec_FiexdUndefinedVal(this.mecJson["type"], "1");
var $type = $("input[type='checkbox'][name='type_"+theId+"'][value='"+type+"']");
if($type.length > 0){
$type.checked();
}
var addrType = Mec_FiexdUndefinedVal(this.mecJson["addrType"], "1");
var $addrType = $("input[type='checkbox'][name='addrType_"+theId+"'][value='"+addrType+"']");
if($addrType.length > 0){
$addrType.checked();
}
var coordinateType = Mec_FiexdUndefinedVal(this.mecJson["coordinateType"], "2");
var $coordinateType = $("input[type='checkbox'][name='coordinateType_"+theId+"'][value='"+coordinateType+"']");
if($coordinateType.length > 0){
$coordinateType.checked();
}
var additionalCoordinateType = Mec_FiexdUndefinedVal(this.mecJson["additionalCoordinateType"], "2");
var $additionalCoordinateType = $("input[type='checkbox'][name='additionalCoordinateType_"+theId+"'][value='"+additionalCoordinateType+"']");
if($additionalCoordinateType.length > 0){
$additionalCoordinateType.checked();
}
var additionalSql = Mec_FiexdUndefinedVal(this.mecJson["additionalSql"]);
$("#additionalSql_" + theId).val(additionalSql);
//动态获取数据源的值,并给数据源添加HTML
var datasource = Mec_FiexdUndefinedVal(this.mecJson["datasource"]);
$("#datasource_" + theId).val(datasource);
MADMap_setDataSourceHTML(theId, datasource);
var additionalScript = Mec_FiexdUndefinedVal(this.mecJson["additionalScript"]);
MADMap_ChangeScriptTip(theId, additionalScript);
$("#additionalScript_"+theId)[0].value = additionalScript;
var isShowAdditionalPointName = Mec_FiexdUndefinedVal(this.mecJson["isShowAdditionalPointName"], "1");
if(isShowAdditionalPointName == "1"){
$("#isShowAdditionalPointName_"+theId).checked();
}
var additionalRadius = Mec_FiexdUndefinedVal(this.mecJson["additionalRadius"]);
$("#additionalRadius_" + theId).val(additionalRadius);
SL_ChangeStyle( $("#additionalScript_"+theId).parent(), additionalScript);
var $attrContainer = $("#MADM_"+theId);
$attrContainer.checkbox();
require(["modal"], function(modal) {
var sqlTip = "1、示例SQL</br>select id, '经度,纬度', '中文名' from table</br>2、SQL语句可使用变量:</br>用户:{curruser},部门:{currdept},日期:{currdate},时间:{currtime},分部:{currdeptsub},日期时间:{currdatetime}";
if(_userLanguage=="8"){
sqlTip = "1、SQL examples</br>select id,'lng,lat','label' from table</br>2、Available variables:</br>user: {curruser},department: {currdept},date: {currdate},time: {currtime},subcompany: {currdeptsub},datetime: {currdatetime}";
}else if(_userLanguage=="9"){
sqlTip = "1、示例SQL</br>select id,'經度,緯度','中文名' from table</br>2、SQL語句可使用變數:</br>用戶:{curruser},部門:{currdept},日期:{currdate},時間:{currtime},分部:{currdeptsub},日期時間:{ currdatetime}";
}
$(".helper", $attrContainer).on("click", function(e) {
modal.tips(sqlTip, $(this), {
area: ['250px', ''],
placement: "left"
});
e.stopPropagation();
});
$("body").on("click", function(e) {
var $target = $(e.target);
var layero = $target.parents(".layui-layer-tips");
if(layero.length) return;
modal.closeAll('tips');
});
});
};
/*获取JSON*/
MEC_NS.Map.prototype.getMecJson = function(){
var theId = this.id;
this.mecJson["id"] = theId;
this.mecJson["mectype"] = this.type;
var $attrContainer = $("#MADM_"+theId);
if($attrContainer.length > 0){
var height = $("#height_" + theId).val();
if($.trim(height) == ""){
height = "200";
}
this.mecJson["height"] = height;
this.mecJson["address"] = $("#address_" + theId).val();
this.mecJson["zoomLevel"] = $("#zoomLevel_" + theId).val();
this.mecJson["type"] = $("input[type='checkbox'][name='type_"+theId+"']:checked").val();
this.mecJson["addrType"] = $("input[type='checkbox'][name='addrType_"+theId+"']:checked").val();
this.mecJson["coordinateType"] = $("input[type='checkbox'][name='coordinateType_"+theId+"']:checked").val();
this.mecJson["datasource"] = $("#datasource_" + theId).val();
this.mecJson["additionalSql"] = $("#additionalSql_" + theId).val();
this.mecJson["isShowAdditionalPointName"] = $("#isShowAdditionalPointName_"+theId).is(':checked') ? "1" : "0";
this.mecJson["additionalCoordinateType"] = $("input[type='checkbox'][name='additionalCoordinateType_"+theId+"']:checked").val();
this.mecJson["additionalRadius"] = $("#additionalRadius_" + theId).val();
this.mecJson["additionalScript"] = $("#additionalScript_" + theId).val();
}
return this.mecJson;
};
MEC_NS.Map.prototype.getDefaultMecJson = function(){
var theId = this.id;
var defMecJson = {};
defMecJson["id"] = theId;
defMecJson["mectype"] = this.type;
defMecJson["height"] = "200";
defMecJson["address"] = "上海市浦东新区泛微网络科技有限公司";
defMecJson["zoomLevel"] = "15";
return defMecJson;
};
function MADMap_setDataSourceHTML(mec_id,val){
var $MADMap_DataSource = $("#datasource_" + mec_id);
var url = jionActionUrl("com.weaver.formmodel.mobile.servlet.MobileAppBaseAction", "action=getDataSource");
FormmodeUtil.doAjaxDataLoad(url, function(datas){
for(var i = 0; i < datas.length; i++){
var data = datas[i];
var pointid = data;
var selected = "";
if (pointid=="" || typeof(pointid)=="undefined") continue;
if (pointid == val) selected = "selected";
var dataSourceSelectHtml = "<option value=\""+pointid+"\" "+selected+">";
dataSourceSelectHtml += pointid;
dataSourceSelectHtml += "</option>";
$MADMap_DataSource.append(dataSourceSelectHtml);
}
});
}
function MADMap_ChangeType(cbObj, mec_id){
setTimeout(function(){ //checkbox用了插件,不延时checkbox的checked状态获取不准确
var objV = cbObj.value;
if(!cbObj.checked){
changeCheckboxStatus(cbObj, true);
return;
}else{
$("input[type='checkbox'][name='type_"+mec_id+"']").each(function(){
if(this.value != objV){
changeCheckboxStatus(this, false);
}
});
}
$("#MADM_"+mec_id+" .typeContent").hide();
$("#typeContent_" + mec_id + "_" + objV).show();
},100);
}
function MADMap_ChangeAddrType(cbObj, mec_id){
setTimeout(function(){ //checkbox用了插件,不延时checkbox的checked状态获取不准确
var objV = cbObj.value;
if(!cbObj.checked){
changeCheckboxStatus(cbObj, true);
return;
}else{
$("input[type='checkbox'][name='addrType_"+mec_id+"']").each(function(){
if(this.value != objV){
changeCheckboxStatus(this, false);
}
});
}
$("#MADM_"+mec_id+" .addrTypeContent").hide();
$("#addrTypeContent_" + mec_id + "_" + objV).show();
},100);
}
var MADMap_ScriptTip = "";
if(_userLanguage=="8"){
MADMap_ScriptTip = "/*You can use the variable pointData directly to obtain the map point information.*/\nvar billid = pointData.id;\n";
}else if(_userLanguage=="9"){
MADMap_ScriptTip = "/*可直接使用變量pointData獲取地圖點信息*/\nvar billid = pointData.id;\n" ;
}else{
MADMap_ScriptTip = "/*可直接使用变量pointData获取地图点信息*/\nvar billid = pointData.id;\n";
}
function MADMap_writeValidateScript(mec_id){
var $field = $("#additionalScript_" + mec_id);
var fieldV = $.trim($field.val());
if(fieldV == ""){
fieldV = MADMap_ScriptTip;
$field.val(fieldV);
}
SL_AddScriptToField($field, function(scriptCode){
MADMap_ChangeScriptTip(mec_id, scriptCode);
});
}
function MADMap_ChangeScriptTip(mec_id, scriptCode){
var $scriptTip = $("#scriptTip_" + mec_id);
scriptCode = $.trim(scriptCode);
if(scriptCode == ""){
$scriptTip.html(SystemEnv.getHtmlNoteName(4850)); //点击输入提交前验证脚本
}else{
$scriptTip.html(SystemEnv.getHtmlNoteName(4510)); //已设置
}
}