init.js
24.1 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
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
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
/*---------------------系统框架设计------------------------------*/
var map, layer,flashLayer,drawControlPQ ;
var pix,timer;
var grid; //查询结果表格控件
var gridManager; //查询结果表格控件管理对象
var CustomersData; //查询结果对象
var gischaxunvalue;
var row;
var col;
var textMarkers;
var chaxuntuceng;
var ctab=0;
var extent;
// 地图初始化函数
function init() {
pix = $("#tmpath").val() + "/gis/";
var slideNav = new OpenLayers.Control.TouchNavigation({
dragPanOptions : { //惯性滑动,
enableKinetic : { //enableKinetic,可以设为bool,也可设为object,设为object时,object会考到{<OpenLayers.Kinetic> 的构造函数中
deceleration : 0.0055
//地图滑动的速率
}
}
});
////初始化地图容器,确定地图文档范围,显示级数分辨力等
map = new OpenLayers.Map("map", {
//isAutoConfig: true,
// maxExtent : new OpenLayers.Bounds(-180,-90,180,90),
controls: [
new OpenLayers.Control.PanZoomBar(), //缩放面板的工具控件
new OpenLayers.Control.LayerSwitcher(), //图层切换控件
new OpenLayers.Control.Navigation(), //此控件处理伴随鼠标事件的地图浏览
new OpenLayers.Control.MousePosition(), //此控件显示鼠标移动时,所在点的地理坐标
new OpenLayers.Control.TouchNavigation({ //控制刷新地图时不用闪烁一次
dragPanOptions: {
enableKinetic: {
deceleration: true
}
}
})
]
});
//初始化图层,确定数据名称,地址等
//layer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", "地图文档11", {
/*layer = new Zondy.Map.TileLayer("MapGIS IGS MapDocLayer", actualSvrcfg.vecMapName, {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: true,
transitionEffect: "resize" //刷新地图时不用闪烁一次
});*/
//整个地图文档显示
layer = new Zondy.Map.Doc("MapGIS IGS MapDocLayer", actualSvrcfg.tileMapName, {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: true,
transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
//filters: "62:islogout!='1' AND islogout!='2',4:islogout!='1' AND islogout!='2',5:islogout!='1' AND islogout!='2',6:islogout!='1' AND islogout!='2',7:islogout!='1' AND islogout!='2',29:islogout!='1' AND islogout!='2',9:islogout!='1' AND islogout!='2'"
});
//分图层显示
ditulayer = new Zondy.Map.Layer("汉中市汉台区", [actualSvrcfg.DJZQ,actualSvrcfg.DJZQ], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: true
//transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
//filters: "1:islogout!='1' AND islogout!='2'"
});
cqlayer = new Zondy.Map.Layer("城区", [actualSvrcfg.CHENGQU], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false
//transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
//filters: "1:islogout!='1' AND islogout!='2'"
});
dblayer = new Zondy.Map.Layer("建设用地使用权(地表)", [actualSvrcfg.SHYQZD_DB], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false,
// transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
filters: "0:islogout!='1' AND islogout!='2'"
});
dslayer = new Zondy.Map.Layer("建设用地使用权(地上)", [actualSvrcfg.SHYQZD_DS], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false,
// transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
filters: "0:islogout!='1' AND islogout!='2'"
});
dxlayer = new Zondy.Map.Layer("建设用地使用权(地下)", [actualSvrcfg.SHYQZD_DX], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false,
//transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
filters: "0:islogout!='1' AND islogout!='2'"
});
gdlayer = new Zondy.Map.Layer("土地承包经营权(耕地)", [actualSvrcfg.CBJYQZD_GD], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false,
//transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
filters: "0:islogout!='1' AND islogout!='2'"
});
cdlayer = new Zondy.Map.Layer("土地承包经营权(草地)", [actualSvrcfg.CBJYQZD_CD], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false,
//transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
filters: "0:islogout!='1' AND islogout!='2'"
});
ldlayer = new Zondy.Map.Layer("土地承包经营权(林地)", [actualSvrcfg.CBJYQZD_LD], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false,
//transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
filters: "0:islogout!='1' AND islogout!='2'"
});
zjdlayer = new Zondy.Map.Layer("宅基地使用权宗地", [actualSvrcfg.ZJDGDBP], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false,
// transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
filters: "0:islogout!='1' AND islogout!='2'"
});
syqlayer = new Zondy.Map.Layer("所有权宗地", [actualSvrcfg.SYQZDGDBP], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false,
//transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
filters: "0:islogout!='1' AND islogout!='2'"
});
zrzlayer = new Zondy.Map.Layer("自然幢", [actualSvrcfg.ZRZ], {
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
isBaseLayer: false,
//transitionEffect: "resize" ,//刷新地图时不用闪烁一次
// filters: "21:islogout!='1',22:islogout!='1',23:islogout!='1' ,27:islogout!='1',28:islogout!='1',29:islogout!='1',35:islogout!='1'"
filters: "0:islogout!='1' AND islogout!='2'"
});
//给容器添加图层
//map.addLayers([ layer ]);
//地图文档显示
map.addLayers([layer]);
//分图层显示
//map.addLayers([ditulayer,syqlayer]);
//map.addLayers([ditulayer,cqlayer,dblayer,dslayer,dxlayer,gdlayer,ldlayer,cdlayer,syqlayer,zjdlayer,zrzlayer]);
//map.setCenter(new OpenLayers.LonLat(-3000000, 0), 1);
//map.setCenter(new OpenLayers.LonLat((405051+417239)/2+20000, (3657542+3667821)/2), 0);
//405050.3420840023,y=3667821.869731353
map.setCenter(new OpenLayers.LonLat((36405050.3420840023+36412505.1417875422)/2,(3657541.105763692+3667821.869731353)/2), 3);
flashLayer= new OpenLayers.Layer.Vector("flashLayer");
flashLayer.style={fillColor:"#D2691E",fillOpacity:0.8};
map.addLayer(flashLayer);
//规划线路查询
drawControlLQ = new OpenLayers.Control.DrawFeature(flashLayer, OpenLayers.Handler.Polygon);
drawControlLQ.featureAdded = callbackLQ;
map.addControl(drawControlLQ);
//交互点查询
drawControlPQ = new OpenLayers.Control.DrawFeature(flashLayer, OpenLayers.Handler.Point);
drawControlPQ.featureAdded = callbackPQ;
map.addControl(drawControlPQ);
//单击的标志位
startClick = 1;
initLogo();
initStartBtn();
initToolBar();
get_JSON();
//addtuxing();
deletetuxing();
}
function initStartBtn() {
var initStartFlag = 0;
// start按钮事件
$("#start").hide();
$("#startBtn").click(function() {
startClick = startFun(startClick);
if (initStartFlag == 0) {
initStartFlag = 1;
} else
return;
});
}
function addtuxing(){
$("#divIDadd").click(function(){
var zdhm=$("#divIDtextadd").val();
if(zdhm!="")
{
drawControlPQ.activate();
$('#addNO').window('close');
}
});
}
function deletetuxing(){
$("#divIDdelete").click(function(){
var zdhm=$("#divIDtextdelete").val();
$('#deleteNO').window('close');
//=================================
var queryStruct=new Zondy.Service.QueryFeatureStruct();
queryStruct.IncludeGeometry=true;
var queryParam=new Zondy.Service.QueryByLayerParameter(chaxuntuceng,{
// geometry: line,
resultFormat: "json",
struct:queryStruct,
// where : "ZDDM ='"+Tempaddm +"'"
});
var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
{
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
requestType:"POST"
});
queryService.query(querrydelete);
//====================================
});
}
function querrydelete(data){
var i;
if (data.TotalCount > 0) {
for(i=0;i<data.SFEleArray.length;i++)
{
if(data.SFEleArray[i].AttValue[3]==$("#divIDtextdelete").val())
{
flashLayer.removeAllFeatures();
$('#addNO').window('close');
$("#outputWin").window('close');
var editService = new Zondy.Service.EditDocFeature(actualSvrcfg.tileMapName,0, 0, { ip: actualSvrcfg.ip, port: actualSvrcfg.port});
editService.deletes(data.SFEleArray[i].FID, onSuccess);
i=data.SFEleArray.length;
}
}
}
}
function onSuccess(rlt) {
var result = rlt;
if (result) {
flashLayer.removeAllFeatures(); //清空之前闪烁的要素
alert("删除要素成功!");
} else {
alert("删除要素失败!");
}
}
/*function dianchaxun()
{
chaxuntuceng=selectTuCeng($("#querytucengtext").val());
$("#searchNO").window('close');
if(drawControlPQ){
drawControlPQ.activate();
}
}*/
function dianjichaxun(){
$("#searchNO").window('close');
$("#outputWin").window('close');
ctab=1;
chaxuntuceng=actualSvrcfg.TUCENG;
if(drawControlPQ){
drawControlPQ.activate();
drawControlLQ.deactivate();
}
}
function xianchaxun(){
$("#searchNO").window('close');
$("#outputWin").window('close');
ctab=0;
chaxuntuceng=actualSvrcfg.TUCENG;
if(drawControlLQ){
drawControlLQ.activate();
drawControlPQ.deactivate();
}
}
function callbackPQ(fea){
//alert("成功绘制一个点");
var point = new Zondy.Object.PointForQuery(fea.geometry.x, fea.geometry.y); //将点转换成中地的点
point.nearDis=1.5;
fea.destroy();
var queryStruct=new Zondy.Service.QueryFeatureStruct(
{
IncludeGeometry:true,
IncludeAttribute:true,
IncludeWebGraphic:false
});
var queryParam=new Zondy.Service.QueryByLayerParameter(chaxuntuceng,{
// geometry: line,
geometry: point,
resultFormat: "json",
struct:queryStruct
});
queryParam.recordNumber=1000;
var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
{
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
requestType:"POST"
});
queryService.query(querrySuccess);
}
/*
* 线查询回调
*/
function callbackLQ(feature){
//初始化查询结构对象,设置查询结构包含几何信息
var queryStruct = new Zondy.Service.QueryFeatureStruct();
//是否包含几何图形信息
queryStruct.IncludeGeometry = true;
//是否包含属性信息
queryStruct.IncludeAttribute = true;
//是否包含图形显示参数
queryStruct.IncludeWebGraphic = false;
//创建一个用于查询的矩形
var geomObj = new Zondy.Object.Polygon();
geomObj.setByOL(feature.geometry);
//指定查询规则
var rule = new Zondy.Service.QueryFeatureRule({
//是否将要素的可见性计算在内
EnableDisplayCondition: false,
//是否完全包含
MustInside: false,
//是否仅比较要素的外包矩形,来判定是否与几何约束图形有交集
CompareRectOnly: false,
//是否相交
Intersect: true
});
//实例化查询参数对象
var queryParam = new Zondy.Service.QueryByLayerParameter(chaxuntuceng, {
geometry: geomObj,
resultFormat: "json",
rule: rule,
struct: queryStruct
});
//设置查询要素数目
queryParam.recordNumber = 1000;
//实例化地图文档查询服务对象
var queryService = new Zondy.Service.QueryLayerFeature(queryParam, {
ip: actualSvrcfg.ip,
port: actualSvrcfg.port
});
//执行查询操作,querySuccess为查询回调函数
queryService.query(queryLineSuccess);
}
function selectTuCeng(ListTucengNO)
{
var tucengValue="";
switch(ListTucengNO)
{
case "jttdsyq":
tucengValue=actualSvrcfg.SYQZDGDBP;
break;
case "jsydsyqdb":
tucengValue=actualSvrcfg.SHYQZD_DB;
break;
case "jsydsyqds":
tucengValue=actualSvrcfg.SHYQZD_DS;
break;
case "jsydsyqdx":
tucengValue=actualSvrcfg.SHYQZD_DX;
break;
case "zjdsyq":
tucengValue=actualSvrcfg.ZJDGDBP;
break;
case "tdcbjyqgd":
tucengValue=actualSvrcfg.CBJYQZD_GD;
break;
case "tdcbjyqld":
tucengValue=actualSvrcfg.CBJYQZD_LD;
break;
case "tdcbjyqcd":
tucengValue=actualSvrcfg.CBJYQZD_CD;
break;
case "gynyd":
tucengValue=actualSvrcfg.NYDGDBP;
break;
case "ld":
tucengValue=actualSvrcfg.ZRZ;
break;
default:break;
}
return tucengValue;
}
function selectMapTuCeng(ListTuceng)
{
var tucengName="";
switch(ListTuceng)
{
case "A":
tucengName="jttdsyq";
break;
case "B":
tucengName="jssyqdb";
break;
case "S":
tucengName="jssyqds";
break;
case "X":
tucengName="jssyqdx";
break;
case "C":
tucengName="zjdsyq";
break;
case "N":
tucengName="gynyd";
break;
case "D":
tucengName="gd";
break;
case "E":
tucengName="ld";
break;
case "F":
tucengName="cd";
break;
case "J":
break;
default:break;
}
return tucengName;
}
function dingwei(tempid)
{
var queryStruct=new Zondy.Service.QueryFeatureStruct({
IncludeGeometry:true
});
var queryParam=new Zondy.Service.QueryByLayerParameter(chaxuntuceng,{
// geometry: line,
objectIds: tempid,
resultFormat: "json",
struct:queryStruct,
});
var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
{
ip: actualSvrcfg.ip, //IP地址
port: actualSvrcfg.port, //端口号
requestType:"POST"
});
queryService.query(flashFeature); //查询成功后的回调函数
}
function flashFeature(jsonObj) {
console.log(jsonObj);
flashLayer.removeAllFeatures(); //清空之前闪烁的要素
var format=new Zondy.Format.PolygonJSON();
var features = format.read(jsonObj); //将获取到的中地数据转换为OL数据
flashLayer.addFeatures(features);//将转换的点绘制图形
if (jsonObj.SFEleArray.length > 0) {
if (jsonObj.SFEleArray[0].bound) {
var pantoX = (jsonObj.SFEleArray[0].bound.xmin + jsonObj.SFEleArray[0].bound.xmax) / 2;
var pantoY = (jsonObj.SFEleArray[0].bound.ymin + jsonObj.SFEleArray[0].bound.ymax) / 2;
}
map.setCenter([pantoX, pantoY],actualSvrcfg.mapQueryjishu);
}
startFlash();
}
function out() {
var oObj = event.srcElement;
if(oObj.tagName.toLowerCase() == "td"){
var oTr = oObj.parentNode;
if(!oTr.tag) oTr.style.backgroundColor = "";
}
}
//鼠标移动到选择行上时的行变色
function over(){
var oObj = event.srcElement;
if(oObj.tagName.toLowerCase() == "td"){
var oTr = oObj.parentNode;
if(!oTr.tag) oTr.style.backgroundColor = "#E1E9FD";
}
}
//---------------------------------
//--------------------------------------
function soggleLayer(){
if (flashLayer!=null){
if(flashLayer.visibility){
flashLayer.setVisibility(false);
}
else{
flashLayer.setVisibility(true);
}
}
}
function startFlash()
{
if(timer!=null){
clearInterval(timer);//js的方法 清计时器
}
timer=setInterval(soggleLayer,500);
}
function initToolBar() {
var initsearchFlag = 0;
//放大
$("#toolbar ul").find('#zoomIn').click(zondy.setOperZoomIn);
//缩小
$("#toolbar ul").find('#zoomOut').click(zondy.setOperZoomOut);
//移动
//$("#toolbar ul").find('#pan').click(zondy.setOperDrag);变手图形
//复位
$("#toolbar ul").find('#restore').click(function() {
map.zoomToMaxExtent();
//zondy.setOperDrag();
//map.setCenter(new OpenLayers.LonLat(0, 0), 1);
//map.setCenter(new OpenLayers.LonLat((405051+417239)/2+7000, (3657542+3667821)/2), 1);
map.setCenter(new OpenLayers.LonLat((36405050.3420840023+36412505.1417875422)/2,(3657541.105763692+3667821.869731353)/2), 3);
clearInterval(timer);
drawControlPQ.deactivate();
flashLayer.removeAllFeatures();
flashLayer.setVisibility(false);
});
$("#toolbar ul").find('#search').click(function(){
ctab=0;
drawControlPQ.deactivate();
$('#searchNO').window('open');
$("#outputWin").window('close');
$("#PQdialog").window('close');
});
/*$("#toolbar ul").find('#clicksearch').click(function(){
//$('#addNO').window('open');
alert("该功能目前无效");
return;
});*/
$("#toolbar ul").find('#deletezongdi').click(function(){
//$('#deleteNO').window('open');
alert("该功能目前无效");
return;
});
}
function onPloySuccess(rlt) {
var result = rlt;
if (result) {
alert("添加区要素成功!");
// map.baseLayer.redraw(true);
} else {
alert("添加区要素失败!");
}
//drawControlPQ2.deactivate();
}
function initLogo() {
// logo显示隐藏事件
var logoClick = 0;
$("#logoBtn").click(function() {
if (logoClick == 0) {
$("#logoText").hide('drop', null, 500, null);
$(this).find(".logoBtn").attr("title", "显示标题");
logoClick = 1;
} else {
$("#logoText").show('drop', null, 500, null);
$(this).find(".logoBtn").attr("title", "隐藏标题");
logoClick = 0;
}
});
}
//start显示或隐藏函数
function startFun(clickNum) {
if (clickNum == 0) {
$("#start").show('explode', null, 500, null);
$("#startBtn").find(".operator").removeClass("opStart");
$("#startBtn").find(".operator").addClass("opDown");
return 1;
} else {
$("#start").hide('explode', null, 500, null);
$("#startBtn").find(".operator").removeClass("opDown");
$("#startBtn").find(".operator").addClass("opStart");
return 0;
}
}
//-----------------------------------
/*---------------------读取配置文件(json)创建功能插件标签---------*/
var toolID;
function get_JSON() {
$.ajax({
type: "GET",
url: pix + "$$framework$$.json?1",
dataType: "text",
success: function (data) {
var json = eval("(" + data + ")");
var tools = json.tools;
var len = tools.length;
var z = len/10;
for (var i = 0; i < len; i++) {
var divID;
if (i == 0 || i % 10 == 0) {
divID = "contPanel" + i / 10; //margin: 5px 10px 0px 0px;
var d = ' <div class="contPanel" id="' + divID + '" style="padding-top:15px;margin: 5px 10px 0px 0px; height: 222px; width: 443px;background-image:url(lib/img/menuBg/48.jpg);left: 0px;z-index:"'+z+'">';
if((i/10)>1){
d = '<div class="contPanel" id="' + divID + '" style="padding-top:15px;margin: 5px 10px 0px 0px; height: 222px; width: 443px;background-image:url(lib/img/menuBg/48.jpg);left: 443px;z-index:"'+z+'">';
}
$("#featured").append(d);
var s = $("#featured");
z--;
}
toolID = tools[i].id;
CreateUI(divID, tools[i].imgSrc, tools[i].imgFun, tools[i].name, tools[i].id);
//tools[i].js为插件js文件路径
if (tools[i].jsPage != "" && tools[i].jsPage != undefined) {
loadjscssfile(tools[i].jsPage, "js", toolID);
}
}
$('#featured').orbit({
bullets: true, // true or false to activate the bullet navigation
bulletThumbs: true, // thumbnails for the bullets
directionalNav: false,
timer: false,
animationSpeed: 500
});
}
});
}
////动态加载js文件
function loadjscssfile(path, filetype, id) {
var fileSrc = pix +'$$tools$$/' + id;
fileSrc += path;
fileSrc += "?toolId=" + id;
if (filetype == "js") { //判断文件类型
var fileref = document.createElement('script'); //创建标签
fileref.setAttribute("type", "text/javascript"); //定义属性type的值为text/javascript
fileref.setAttribute("src", fileSrc); //文件的地址
} else if (filetype == "css") { //判断文件类型
var fileref = document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", fileSrc);
}
if (typeof fileref != "undefined")
document.getElementsByTagName("head")[0].appendChild(fileref);
}
function CreateUI(divID, imgSrc, imgFun, name, id) {
var Menu = $("#" + divID);
var src = pix+'$$tools$$/' + id + imgSrc;
var plusDOM = '<div class="funRegion">';
plusDOM += '<img id="'+ id + '" style="width:48px;height:48px;" class="startMenu" src="'+src+'" /><br />';
plusDOM += name + '</div>';
Menu.append(plusDOM);
$("#" + id).click(function() {
CallWorkFlow(imgFun, "", id);
});
}
//jsfunction:插件是div层,调用的方法
//page:页面,调用的html
function CallWorkFlow(jsfunction, page, id) {
if (jsfunction != "") {
eval(jsfunction + '()');
} else {
page = pix+"$$tools$$/" + id + page; //add by lf :20130702
window.open(page);
}
}
function loadNETfile(path, filetype) {
var fileSrc = path;
if (filetype == "js") { //判断文件类型
var fileref = document.createElement('script'); //创建标签
fileref.setAttribute("type", "text/javascript"); //定义属性type的值为text/javascript
fileref.setAttribute("src", fileSrc); //文件的地址
} else if (filetype == "css") { //判断文件类型
var fileref = document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", fileSrc);
}
if (typeof fileref != "undefined")
document.getElementsByTagName("head")[0].appendChild(fileref);
}
//查询表格
//将查询返回的json对象在表格中显示,