add-input-function.js
3.78 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
/**
* 函数
*
* - - - - - - - 》 getCurrSelNode : 获取选中树节点数据函数
*
* - - - - - - - 》 resjtreeDate : 刷新树函数函数
*
* - - - - - - - 》 setFormInputValue : 新增站点参数集合赋值函数
*
* - - - - - - - 》 editSetStationParmas : 编辑站点参数集合赋值函数
*
* - - - - - - - 》 editSeteditStationParmasValue:编辑站点范围图形参数集合赋值函数
*
* - - - - - - - 》 lineNameIsHaveInterval : 系统规划时线路名称是否为区间
*
* - - - - - - - 》 systemLineStation:系统规划保存函数
*
* - - - - - - - 》 stationRevoke :撤销站点
*
* - - - - - - - 》 editLinePlan :编辑线路走向
*
* - - - - - - - 》 setFormValue :编辑站点设置表单元素值
*
* - - - - - - - 》 eachSectionList:路段折线百度坐标转WGS坐标
*/
var PublicFunctions = function () {
var PubFun = {
// 原百度坐标转WGS坐标
getFormPointEToWGS: function(points,callback) {
// 获取长度
var len = points.length;
(function(){
if (!arguments.callee.count) {
arguments.callee.count = 0;
}
arguments.callee.count++;
var index = parseInt(arguments.callee.count) - 1;
if (index >= len) {
callback && callback(points);
return;
}
var f = arguments.callee;
$.ajax({
url: 'http://api.zdoz.net/bd2wgs.aspx',
data: {lat: points[index].potion.lat , lng: points[index].potion.lng},
dataType: 'jsonp',
success: function(r){
if(r) {
points[index].WGSpotion = r;
}
f();
}
});
})();
},
/** @param points:中心点 ;gLonx:中心点WGS经度;gLaty:中心点WGS纬度;bPolygonGridValue:百度坐标点图形集合;gPolygonGridVlaue:WGS坐标点图形集合;shapesTypeValue:范围图形类型;radiusValue:圆半径 */
setFormInputValue: function(points,gLonx,gLaty,bPolygonGridValue,gPolygonGridVlaue,shapesTypeValue,radiusValue) {
// 百度地图经纬度坐标中心点
$('#bJwpointsInput').val(points);
// WGS经纬度
$('#gJwpointsInput').val(gLonx + ' ' + gLaty);
// 百度坐标点图形集合
$('#bPolygonGridInput').val(bPolygonGridValue);
// WGS坐标点图形集合
$('#gPolygonGridInput').val(gPolygonGridVlaue);
// 图形类型
$('#shapesTypeSelect').val(shapesTypeValue);
// 圆形半径
$('#radiusInput').val(radiusValue);
},
getLineAllInfo : function(cb) {
// 填充公司下拉框选择值
$get('/line/all', null, function(array){
return cb && cb(array);
});
},
getStationRouteInfo : function(lineCode,callback) {
$get('/stationroute/all',{'lineCode_eq':lineCode},function(result) {
callback && callback(result);
});
},
getStationCode : function(callback) {
$get('/station/getStationCode',null,function(stationCode) {
callback && callback(stationCode);
});
},
// 新增站点保存
stationSave : function(station,callback) {
$post('/station/stationSave',station,function(data) {
callback && callback(data);
});
}
}
return PubFun ;
}();