section-ajax-getdata.js
1.2 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
/**
* GetAjaxData :ajax异步请求
*
*/
var GetAjaxData = function(){
var ajaxData = {
getStationRouteInfo : function(sectionId,callback){
$get('/sectionroute/findSectionRouteInfoFormId',{id:sectionId},function(r) {
return callback && callback(r);
});
},
getStation : function(id_,dir_,callback) {
var treeDateJson = [];
$get('/stationroute/findStations',{'line.id_eq' : id_ , 'directions_eq' : dir_},function(resultdata) {
treeDateJson = createTreeData(resultdata);
callback && callback(treeDateJson);
});
},
findUpStationRouteCode : function(lineId,diraction,sectionRouteCode,callback) {
$get('/sectionroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,sectionRouteCode:sectionRouteCode},function(result) {
callback && callback(result);
});
},
// 编辑线路走向保存
sectionUpdate:function(section,callback) {
$post('/section/sectionUpdate',section,function(data) {
callback && callback(data);
})
}
}
return ajaxData;
}();