Commit 9097042340124d1061afda3d159cd295ea4a8156

Authored by youxiw2000
1 parent 353ddaa7

1

src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
1   -/**
2   - * GetAjaxData :ajax异步请求
3   - *
4   - * - - - - - -》 collectionSave :系统规划保存请求
5   - *
6   - * - - - - - -》 getStation :树数据获取
7   - *
8   - * - - - - - -》 getStationRoutePoint :查询线路某方向下所有站点的中心百度坐标
9   - *
10   - * - - - - - -》 getLikeStationName :查询是否有已存在站点名称
11   - *
12   - * - - - - - -》 getStationCode:查询站点编码
13   - *
14   - * - - - - - -》 stationSave:新增站点保存
15   - *
16   - * - - - - - -》 stationUpdate:站点更新
17   - *
18   - * - - - - - -》 stationRouteIsDestroy:撤销站点
19   - *
20   - * - - - - - -》 sectionUpdate : 编辑线路走向保存
21   - *
22   - * - - - - - -》 sectionSave : 生成线路走向
23   - *
24   - * - - - - - -》 getIdLineName:获取线路名称
25   - *
26   - * - - - - - -》 getSectionRouteInfo:查询路段信息
27   - */
28   -
29   -var GetAjaxData = function(){
30   -
31   - var ajaxData = {
32   -
33   - // 系统规划保存请求
34   - collectionSave : function (params,callback) {
35   -
36   - $post('/station/collectionSave',params,function(rd) {
37   -
38   - callback && callback(rd);
39   -
40   - });
41   -
42   - },
43   -
44   - // 树数据获取
45   - getStation : function(id_,dir_,version,callback) {
46   - var treeDateJson = [];
47   - $get('/stationroute/findStations',{'line.id_eq' : id_ , 'directions_eq' : dir_,'version':version},function(resultdata) {
48   - treeDateJson = createTreeData(resultdata);
49   - callback && callback(treeDateJson);
50   - });
51   - // $.ajax({
52   - // type: "GET",
53   - // async:false,
54   - // url: '/stationroute/findStations',
55   - // data: {'line.id_eq' : id_ , 'directions_eq' : dir_},
56   - // success: function(resultdata){
57   - // treeDateJson = createTreeData(resultdata);
58   - // callback && callback(treeDateJson);
59   - // }
60   - // });
61   - },
62   - getzdlyInfo : function(params,callback) {
63   - $get('/stationroute/all_ls',params,function(result) {
64   - callback && callback(result);
65   - });
66   - },
67   - // 查询线路某方向下所有站点的中心百度坐标
68   - getStationRoutePoint : function(id_,dir_,version,callback) {
69   - $get('/stationroute/getStationRouteList',{lineId:id_,direction:dir_,version:version},function(result) {
70   - callback && callback(result);
71   - });
72   - },
73   -
74   - // 查询是否有已存在站点名称
75   - getLikeStationName : function (stationName,callback) {
76   - $get('/station/all', {stationName_eq: stationName}, function(array){
77   - callback && callback(array);
78   - });
79   - },
80   -
81   - // 查询站点编码
82   - getStationCode : function(callback) {
83   - $get('/station/getStationCode',null,function(stationCode) {
84   - if(stationCode>0) {
85   - callback && callback(stationCode);
86   - }
87   - });
88   - },
89   - // 查询路段编码
90   - getSectionCode : function(callback) {
91   - $get('/section/getSectionCode',null,function(sectionCode) {
92   - callback && callback(sectionCode);
93   - });
94   - },
95   - getAllLineVersions:function(lineId,callback){
96   - $get('/lineVersions/findAllHistroyLineVersionsById',{lineId:lineId},function(result) {
97   - callback && callback(result);
98   - });
99   - },
100   - findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) {
101   - $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) {
102   - callback && callback(result);
103   - });
104   - },
105   - findUpSectionRouteCode : function(lineId,diraction,sectionRouteCode,callback) {
106   - $get('/sectionroute/findUpSectionRouteCode',{lineId:lineId,direction:diraction,sectionRouteCode:sectionRouteCode},function(result) {
107   - callback && callback(result);
108   - });
109   - },
110   - // 新增站点保存
111   - stationSave : function(station,callback) {
112   - $post('/station/stationSave',station,function(data) {
113   - callback && callback(data);
114   - });
115   - },
116   - // 站点更新
117   - stationUpdate : function(station,callback) {
118   - $post('/station/stationUpdate',station,function(data) {
119   - callback && callback(data);
120   - });
121   - },
122   -
123   - // 撤销站点
124   - stationRouteIsDestroy : function(stationRoute,callback) {
125   - $post('/stationroute/stationRouteIsDestroy',stationRoute,function(data) {
126   - callback && callback(data);
127   - })
128   -
129   - },
130   -
131   - // 编辑线路走向保存
132   - sectionUpdate:function(section,callback) {
133   - $post('/section/sectionUpdate',section,function(data) {
134   - callback && callback(data);
135   - })
136   - },
137   - // 生成线路走向
138   - sectionSave:function(section,callback){
139   - $post('/section/sectionSave',section,function(data) {
140   - callback && callback(data);
141   - })
142   - },
143   -
144   - // 获取线路名称
145   - getIdLineName : function (id,callback) {
146   - $get('/line/' + id ,null, function(result){
147   - callback && callback(result);
148   - });
149   - },
150   - // 查询外部行业编码是否有更新
151   - getLineMatchStationIsUpdate : function (id,callback) {
152   - $get('/line/getLineMatchStationIsUpdate' ,{"id":id}, function(result){
153   - callback && callback(result);
154   - });
155   - },
156   - // 查询外部行业编码是否有更新
157   - matchIndustryCode : function (lineId,callback) {
158   - $post('/stationroute/matchIndustryCode' ,{"lineId":lineId}, function(result){
159   - callback && callback(result);
160   - });
161   - },
162   -
163   - // 查询站点信息
164   - getStationRouteInfo : function(lineId,direction,callback) {
165   - $get('/stationroute/all',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) {
166   - callback && callback(resultdata);
167   - });
168   - },
169   -
170   - // 查询路段信息
171   - getSectionRouteInfo : function(lineId,direction,version,callback) {
172   - debugger;
173   - if(!callback){
174   - callback = version;
175   - version = $("#versions").val();
176   - }
177   -
178   - $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction,'version':version},function(resultdata) {
179   - callback && callback(resultdata);
180   - });
181   - },
182   - // 根据ID查询路段信息.
183   - getSectionRouteInfoById : function(sectionRouteId,callback){
184   - $get('/sectionroute/findSectionRouteInfoFormId',{'id':sectionRouteId},function(r) {
185   - return callback && callback(r);
186   - });
187   - },
188   -
189   - // 手动规划线路保存
190   - manualSave : function(params,callback) {
191   -
192   - // 保存
193   - $post('/station/manualSave',params,function(rd) {
194   -
195   - callback && callback(rd);
196   -
197   - });
198   -
199   - }
200   - };
201   - return ajaxData;
202   -
  1 +/**
  2 + * GetAjaxData :ajax异步请求
  3 + *
  4 + * - - - - - -》 collectionSave :系统规划保存请求
  5 + *
  6 + * - - - - - -》 getStation :树数据获取
  7 + *
  8 + * - - - - - -》 getStationRoutePoint :查询线路某方向下所有站点的中心百度坐标
  9 + *
  10 + * - - - - - -》 getLikeStationName :查询是否有已存在站点名称
  11 + *
  12 + * - - - - - -》 getStationCode:查询站点编码
  13 + *
  14 + * - - - - - -》 stationSave:新增站点保存
  15 + *
  16 + * - - - - - -》 stationUpdate:站点更新
  17 + *
  18 + * - - - - - -》 stationRouteIsDestroy:撤销站点
  19 + *
  20 + * - - - - - -》 sectionUpdate : 编辑线路走向保存
  21 + *
  22 + * - - - - - -》 sectionSave : 生成线路走向
  23 + *
  24 + * - - - - - -》 getIdLineName:获取线路名称
  25 + *
  26 + * - - - - - -》 getSectionRouteInfo:查询路段信息
  27 + */
  28 +
  29 +var GetAjaxData = function(){
  30 +
  31 + var ajaxData = {
  32 +
  33 + // 系统规划保存请求
  34 + collectionSave : function (params,callback) {
  35 +
  36 + $post('/station/collectionSave',params,function(rd) {
  37 +
  38 + callback && callback(rd);
  39 +
  40 + });
  41 +
  42 + },
  43 +
  44 + // 树数据获取
  45 + getStation : function(id_,dir_,version,callback) {
  46 + var treeDateJson = [];
  47 + $get('/stationroute/findStations',{'line.id_eq' : id_ , 'directions_eq' : dir_,'version':version},function(resultdata) {
  48 + treeDateJson = createTreeData(resultdata);
  49 + callback && callback(treeDateJson);
  50 + });
  51 + // $.ajax({
  52 + // type: "GET",
  53 + // async:false,
  54 + // url: '/stationroute/findStations',
  55 + // data: {'line.id_eq' : id_ , 'directions_eq' : dir_},
  56 + // success: function(resultdata){
  57 + // treeDateJson = createTreeData(resultdata);
  58 + // callback && callback(treeDateJson);
  59 + // }
  60 + // });
  61 + },
  62 + getzdlyInfo : function(params,callback) {
  63 + $get('/stationroute/all_ls',params,function(result) {
  64 + callback && callback(result);
  65 + });
  66 + },
  67 + // 查询线路某方向下所有站点的中心百度坐标
  68 + getStationRoutePoint : function(id_,dir_,version,callback) {
  69 + $get('/stationroute/getStationRouteList',{lineId:id_,direction:dir_,version:version},function(result) {
  70 + callback && callback(result);
  71 + });
  72 + },
  73 +
  74 + // 查询是否有已存在站点名称
  75 + getLikeStationName : function (stationName,callback) {
  76 + $get('/station/all', {stationName_eq: stationName}, function(array){
  77 + callback && callback(array);
  78 + });
  79 + },
  80 +
  81 + // 查询站点编码
  82 + getStationCode : function(callback) {
  83 + $get('/station/getStationCode',null,function(stationCode) {
  84 + if(stationCode>0) {
  85 + callback && callback(stationCode);
  86 + }
  87 + });
  88 + },
  89 + // 查询路段编码
  90 + getSectionCode : function(callback) {
  91 + $get('/section/getSectionCode',null,function(sectionCode) {
  92 + callback && callback(sectionCode);
  93 + });
  94 + },
  95 + getAllLineVersions:function(lineId,callback){
  96 + $get('/lineVersions/findAllHistroyLineVersionsById',{lineId:lineId},function(result) {
  97 + callback && callback(result);
  98 + });
  99 + },
  100 + findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) {
  101 + $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode,version:version},function(result) {
  102 + callback && callback(result);
  103 + });
  104 + },
  105 + findUpSectionRouteCode : function(lineId,diraction,sectionRouteCode,callback) {
  106 + $get('/sectionroute/findUpSectionRouteCode',{lineId:lineId,direction:diraction,sectionRouteCode:sectionRouteCode,version:version},function(result) {
  107 + callback && callback(result);
  108 + });
  109 + },
  110 + // 新增站点保存
  111 + stationSave : function(station,callback) {
  112 + $post('/station/stationSave',station,function(data) {
  113 + callback && callback(data);
  114 + });
  115 + },
  116 + // 站点更新
  117 + stationUpdate : function(station,callback) {
  118 + $post('/station/stationUpdate',station,function(data) {
  119 + callback && callback(data);
  120 + });
  121 + },
  122 +
  123 + // 撤销站点
  124 + stationRouteIsDestroy : function(stationRoute,callback) {
  125 + $post('/stationroute/stationRouteIsDestroy',stationRoute,function(data) {
  126 + callback && callback(data);
  127 + })
  128 +
  129 + },
  130 +
  131 + // 编辑线路走向保存
  132 + sectionUpdate:function(section,callback) {
  133 + $post('/section/sectionUpdate',section,function(data) {
  134 + callback && callback(data);
  135 + })
  136 + },
  137 + // 生成线路走向
  138 + sectionSave:function(section,callback){
  139 + $post('/section/sectionSave',section,function(data) {
  140 + callback && callback(data);
  141 + })
  142 + },
  143 +
  144 + // 获取线路名称
  145 + getIdLineName : function (id,callback) {
  146 + $get('/line/' + id ,null, function(result){
  147 + callback && callback(result);
  148 + });
  149 + },
  150 + // 查询外部行业编码是否有更新
  151 + getLineMatchStationIsUpdate : function (id,callback) {
  152 + $get('/line/getLineMatchStationIsUpdate' ,{"id":id}, function(result){
  153 + callback && callback(result);
  154 + });
  155 + },
  156 + // 查询外部行业编码是否有更新
  157 + matchIndustryCode : function (lineId,callback) {
  158 + $post('/stationroute/matchIndustryCode' ,{"lineId":lineId}, function(result){
  159 + callback && callback(result);
  160 + });
  161 + },
  162 +
  163 + // 查询站点信息
  164 + getStationRouteInfo : function(lineId,direction,callback) {
  165 + $get('/stationroute/all',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) {
  166 + callback && callback(resultdata);
  167 + });
  168 + },
  169 +
  170 + // 查询路段信息
  171 + getSectionRouteInfo : function(lineId,direction,version,callback) {
  172 + debugger;
  173 + if(!callback){
  174 + callback = version;
  175 + version = $("#versions").val();
  176 + }
  177 +
  178 + $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction,'version':version},function(resultdata) {
  179 + callback && callback(resultdata);
  180 + });
  181 + },
  182 + // 根据ID查询路段信息.
  183 + getSectionRouteInfoById : function(sectionRouteId,callback){
  184 + $get('/sectionroute/findSectionRouteInfoFormId',{'id':sectionRouteId},function(r) {
  185 + return callback && callback(r);
  186 + });
  187 + },
  188 +
  189 + // 手动规划线路保存
  190 + manualSave : function(params,callback) {
  191 +
  192 + // 保存
  193 + $post('/station/manualSave',params,function(rd) {
  194 +
  195 + callback && callback(rd);
  196 +
  197 + });
  198 +
  199 + }
  200 + };
  201 + return ajaxData;
  202 +
203 203 }();
204 204 \ No newline at end of file
... ...