map-ajax-getdata.js
2.73 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
/**
* MapGetAjaxData :ajax异步请求
*
* - - - - - -》 getSectionCacheList :获取路段列表
*
* - - - - - -》 getzdlyInfo :获取站点列表
*
* - - - - - -》 getLikeStationName :查询是否有已存在站点名称
*
* - - - - - -》 getStationCode:查询站点编码
*
* - - - - - -》 findCacheUpStationRouteCode:查询上一个缓存站点的序号
*
* - - - - - -》 findCacheUpSectionRouteCode:查询上一个缓存路段的序号
*
* - - - - - -》 stationCacheSave:新增缓存站点保存
*
* - - - - - -》 stationCacheUpdate:站点缓存更新
*
* - - - - - -》 sectionUpdate : 编辑线路走向保存
*
* - - - - - -》 getIdLineName:获取线路名称
*/
var MapGetAjaxData = function(){
var ajaxData = {
// 获取路段列表
getSectionCacheList : function(lineId,dir,callback) {
$get('/sectionroute/findCacheSection',{'lineId' : lineId , 'dir' : dir},function(resultdata) {
callback && callback(resultdata);
});
},
getzdlyInfo : function(params,callback) {
$get('/stationroute/cacheList',params,function(array) {
callback && callback(array);
});
},
// 查询是否有已存在站点名称
getLikeStationName : function (stationName,callback) {
$get('/station/all', {stationName_eq: stationName}, function(array){
callback && callback(array);
});
},
// 查询站点编码
getStationCode : function(callback) {
$get('/station/getStationCode',null,function(stationCode) {
if(stationCode>0) {
callback && callback(stationCode);
}
});
},
findCacheUpStationRouteCode : function(params,callback) {
$get('/stationroute/findCacheUpStationRouteCode',params,function(result) {
callback && callback(result);
});
},
findCacheUpSectionRouteCode : function(lineId,dir,sectionRouteCode,callback) {
$get('/sectionroute/findCacheUpSectionRouteCode',{'lineId' : lineId , 'direction' : dir, 'sectionRouteCode':sectionRouteCode},function(result) {
callback && callback(result);
});
},
// 新增缓存站点保存
stationCacheSave : function(station,callback) {
$post('/station/stationCacheSave',station,function(data) {
debugger
callback && callback(data);
});
},
// 缓存站点更新
stationCacheUpdate : function(station,callback) {
$post('/station/stationCacheUpdate',station,function(data) {
callback && callback(data);
});
},
// 获取线路名称
getIdLineName : function (id,callback) {
$get('/line/' + id ,null, function(result){
callback && callback(result);
});
},
}
return ajaxData;
}();