Commit 5422875361fb5688c3c0a3f69710cf237091047e

Authored by lizhuojun
1 parent a82dfedb

线调更新

src/main/java/com/bsth/service/gps/GpsServiceImpl.java
... ... @@ -104,8 +104,8 @@ public class GpsServiceImpl implements GpsService {
104 104 int dayOfYear = sCal.get(Calendar.DAY_OF_YEAR);
105 105 /*
106 106 * if(dayOfYear != eCal.get(Calendar.DAY_OF_YEAR)){
107   - * System.out.println("暂时不支持跨天查询..."); return null; }
108   - */
  107 + * System.out.println("暂时不支持跨天查询..."); return null; }
  108 + */
109 109  
110 110 String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,STOP_NO from bsth_c_gps_info where days_year=? and device_id=? and ts > ? and ts < ?";
111 111 Connection conn = null;
... ... @@ -257,14 +257,14 @@ public class GpsServiceImpl implements GpsService {
257 257 Line cLine =lineRepository.findOne(Integer.valueOf(map_get_str( rs,"LINE_ID")));
258 258 Line nextLine =lineRepository.findOne(Integer.valueOf(map_get_str( dataList.get(index+1),"LINE_ID")));
259 259 if (cLine!=null&&nextLine!=null){
260   - Map<String,Object> LSmap=new HashMap<>();
261   - String name=cLine.getName();
262   - String NextName=nextLine.getName();
263   - LSmap.put("abnormalType","linesSwitch");
264   - LSmap.put("line_line",name+"-->"+NextName);
265   - LSmap.put("st",map_get_long(rs, "TS"));
266   - LSmap.put("et",index== dataList.size()-1?map_get_long(rs, "TS"):map_get_long( dataList.get(index+1), "TS"));
267   - lineSwitch.add(LSmap);
  260 + Map<String,Object> LSmap=new HashMap<>();
  261 + String name=cLine.getName();
  262 + String NextName=nextLine.getName();
  263 + LSmap.put("abnormalType","linesSwitch");
  264 + LSmap.put("line_line",name+"-->"+NextName);
  265 + LSmap.put("st",map_get_long(rs, "TS"));
  266 + LSmap.put("et",index== dataList.size()-1?map_get_long(rs, "TS"):map_get_long( dataList.get(index+1), "TS"));
  267 + lineSwitch.add(LSmap);
268 268 }
269 269 }
270 270 serviceState = map_get_long(rs, "SERVICE_STATE");
... ... @@ -282,7 +282,7 @@ public class GpsServiceImpl implements GpsService {
282 282 gpsNotValidMap=null;
283 283 }
284 284 }
285   - //continue;
  285 + //continue;
286 286  
287 287 map = new HashMap<>();
288 288 lon = map_get_float(rs, "LON");
... ... @@ -340,45 +340,48 @@ public class GpsServiceImpl implements GpsService {
340 340 }
341 341  
342 342 if (lineSet.size()>0){
  343 + List listvs=new ArrayList();
343 344 for (String s : lineSet) {
344   - int lineId=Integer.parseInt(s);
345   - List<LineVersions> lvs=lineVersionsRepository.findBylineId(lineId);
346   - List<Map<String,Object>> vlist=new ArrayList<>();
347   - Map<String,Object> vMap;
348   - Long qt=0L;
349   - if (lvs!=null&&!lvs.isEmpty()){
350   - for (LineVersions lv : lvs) {
351   - vMap=new HashMap();
352   - Long sd=lv.getStartDate().getTime();
353   - Long ed=lv.getEndDate().getTime();
354   - if (sd<st&&et<ed){
355   - vMap.put("version",lv.getVersions());
356   - vMap.put("vtime","all");
357   - vlist.add(vMap);
358   - }else if(sd<st&&et>ed&&st<ed){
359   - vMap.put("version",lv.getVersions());
360   - vMap.put("endTime",lv.getEndDate().getTime());
361   - vMap.put("abnormalType","versionSwitch");
362   - vMap.put("st",lv.getEndDate().getTime());
363   - //vMap.put("et",lvs.indexOf(lv)==lvs.size()-1?lv.getEndDate().getTime():lvs.get(lvs.indexOf(lv)+1).getStartDate().getTime());
364   - qt=lv.getEndDate().getTime();
365   - vlist.add(vMap);
366   - }else if(st<sd&&et<ed&&sd<et){
367   - vMap.put("version",lv.getVersions());
368   - vMap.put("startTime",lv.getStartDate().getTime());
369   - vlist.add(vMap);
  345 + int lineId=Integer.parseInt(s);
  346 + List<LineVersions> lvs=lineVersionsRepository.findBylineId(lineId);
  347 + List<Map<String,Object>> vlist=new ArrayList<>();
  348 + Map<String,Object> vMap;
  349 + Long qt=0L;
  350 + if (lvs!=null&&!lvs.isEmpty()){
  351 + for (LineVersions lv : lvs) {
  352 + vMap=new HashMap();
  353 + Long sd=lv.getStartDate().getTime();
  354 + Long ed=lv.getEndDate().getTime();
  355 + if (sd<st&&et<ed){
  356 + vMap.put("version",lv.getVersions());
  357 + vMap.put("vtime","all");
  358 + vlist.add(vMap);
  359 + }else if(sd<st&&et>ed&&st<ed){
  360 + vMap.put("version",lv.getVersions());
  361 + vMap.put("endTime",lv.getEndDate().getTime());
  362 + vMap.put("abnormalType","versionSwitch");
  363 + vMap.put("st",lv.getEndDate().getTime());
  364 + //vMap.put("et",lvs.indexOf(lv)==lvs.size()-1?lv.getEndDate().getTime():lvs.get(lvs.indexOf(lv)+1).getStartDate().getTime());
  365 + qt=lv.getEndDate().getTime();
  366 + vlist.add(vMap);
  367 + }else if(st<sd&&et<ed&&sd<et){
  368 + vMap.put("version",lv.getVersions());
  369 + vMap.put("startTime",lv.getStartDate().getTime());
  370 + vlist.add(vMap);
  371 + }
370 372 }
371 373 }
  374 + if (vlist.size()>0){
  375 + listvs.add(vlist);
  376 + }
  377 + if (vlist.size()>1){
  378 + Map<String,Object> VSmap=new HashMap<>();
  379 + VSmap.put("abnormalType","vserionSwitch");
  380 + VSmap.put("st",qt);
  381 + versionSwitchList.add(VSmap);
  382 + }
372 383 }
373   - rsMap.put("lineVerson",vlist);
374   - if (vlist.size()>1){
375   - Map<String,Object> VSmap=new HashMap<>();
376   - VSmap.put("abnormalType","vserionSwitch");
377   - VSmap.put("st",qt);
378   - versionSwitchList.add(VSmap);
379   - }
380   - }
381   -
  384 + rsMap.put("lineVerson",listvs);
382 385 }
383 386 // 按时间排序
384 387 Collections.sort(list, new Comparator<Map<String, Object>>() {
... ... @@ -1293,12 +1296,12 @@ public class GpsServiceImpl implements GpsService {
1293 1296 public Map<String, Object> Pagequery(Map<String, Object> map) {
1294 1297 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1295 1298 Integer totalDays = 0;//数据跨越天数
1296   - try {
1297   - totalDays = (int) ((sdf.parse(map.get("endDate").toString()+" 23:59:59").getTime()-sdf.parse(map.get("startDate").toString()+" 00:00:00").getTime()+1)/(3600*24*1000))+1;
1298   - } catch (ParseException e) {
1299   - e.printStackTrace();
1300   - }//总页数
1301   - map.put("totalDays",totalDays);
  1299 + try {
  1300 + totalDays = (int) ((sdf.parse(map.get("endDate").toString()+" 23:59:59").getTime()-sdf.parse(map.get("startDate").toString()+" 00:00:00").getTime()+1)/(3600*24*1000))+1;
  1301 + } catch (ParseException e) {
  1302 + e.printStackTrace();
  1303 + }//总页数
  1304 + map.put("totalDays",totalDays);
1302 1305 List<GpsSpeed> list=findAll(map);
1303 1306 List<GpsSpeed> listResult = new ArrayList<GpsSpeed>();
1304 1307 int curPage = 0;//页码
... ... @@ -1340,22 +1343,22 @@ public class GpsServiceImpl implements GpsService {
1340 1343 }
1341 1344 }
1342 1345 if(listResult.size()>0){
1343   - Iterator<GpsSpeed> speedIt = listResult.iterator();
1344   - while(speedIt.hasNext()){
1345   - GpsSpeed GpsSpeed = speedIt.next();
1346   - if(GpsSpeed.getEndtimestamp()-GpsSpeed.getTimestamp()<=1000){
1347   - speedIt.remove();
1348   - }
1349   - }
  1346 + Iterator<GpsSpeed> speedIt = listResult.iterator();
  1347 + while(speedIt.hasNext()){
  1348 + GpsSpeed GpsSpeed = speedIt.next();
  1349 + if(GpsSpeed.getEndtimestamp()-GpsSpeed.getTimestamp()<=1000){
  1350 + speedIt.remove();
  1351 + }
  1352 + }
1350 1353 }
1351 1354 }
1352   - if(map.get("curPage") == null || map.get("curPage").equals("0")){
1353   - curPage = 0;
1354   - }else{
1355   - curPage = Integer.parseInt((String) map.get("curPage"));
1356   - }
1357   - Integer totalPage = totalDays;
1358   - pageData = listResult.size();//每页的记录条数就是当前页查出的全部数据。
  1355 + if(map.get("curPage") == null || map.get("curPage").equals("0")){
  1356 + curPage = 0;
  1357 + }else{
  1358 + curPage = Integer.parseInt((String) map.get("curPage"));
  1359 + }
  1360 + Integer totalPage = totalDays;
  1361 + pageData = listResult.size();//每页的记录条数就是当前页查出的全部数据。
1359 1362 Map<String,Object> paramMap = new HashMap<String,Object>();
1360 1363 paramMap.put("totalPage", totalPage);
1361 1364 paramMap.put("page", curPage);
... ... @@ -1461,10 +1464,10 @@ public class GpsServiceImpl implements GpsService {
1461 1464 Integer totalDays = Integer.valueOf(map.get("totalDays").toString());
1462 1465 Integer curPage = 0;//页码
1463 1466 if(map.get("curPage") == null || map.get("curPage").equals("0")){
1464   - curPage = 0;
1465   - }else{
1466   - curPage = Integer.parseInt((String) map.get("curPage"));
1467   - }
  1467 + curPage = 0;
  1468 + }else{
  1469 + curPage = Integer.parseInt((String) map.get("curPage"));
  1470 + }
1468 1471  
1469 1472 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1470 1473 if(line!=null){
... ...
src/main/resources/static/pages/permission/authorize_all/user_auth.html
... ... @@ -261,7 +261,6 @@
261 261 }
262 262  
263 263 function render_auth_menus() {
264   - debugger
265 264 var excludeArray = [], event;
266 265 if (xd_auth && xd_auth.excludeMenus)
267 266 excludeArray = xd_auth.excludeMenus.split(',');
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
... ... @@ -451,7 +451,10 @@
451 451 var sch = getActiveSch();
452 452 if (!sch)
453 453 return notify_err('无法获取到主任务信息!');
454   -
  454 + if ($('body').find('#add-sub-task-main-modal').length>0) {
  455 + layer.msg('已存在正在添加的子任务.');
  456 + return;
  457 + }
455 458 open_modal(folder + '/sub_task_v2/main.html', {
456 459 sch: sch
457 460 }, modal_opts);
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/main.html
1 1 <div class="uk-modal ct_move_modal" id="add-sub-task-main-modal">
2 2 <div class="uk-modal-dialog" style="width: 1100px;">
3 3 <a href="" class="uk-modal-close uk-close" style="position: relative;"></a>
4   - <a style="position: absolute; right: 40px;top: 8px;text-decoration-line: none;" id="min_a" >—</a>
  4 + <a style="position: absolute; right: 40px;top: 8px;text-decoration-line: none; color:#CDCDCD;font-weight:900; " id="min_a" >━</a>
5 5 <div class="uk-modal-header">
6 6 <h2>添加子任务</h2></div>
7 7  
8 8 <div class="uk-grid uk-grid-small">
9 9 <div class="uk-width-2-10">
10   - <ul data-uk-switcher="{connect:'#tempScheduleContent',swiping:false}" class="uk-nav uk-nav-side left_tabs_lg">
  10 + <ul data-uk-switcher="{connect:'#tempScheduleContentChild',swiping:false}" class="uk-nav uk-nav-side left_tabs_lg">
11 11 <li name="normal"><a>1、子任务</a></li>
12 12 <li name="in_out"><a>2、进出场</a></li>
13 13 <li name="range_turn"><a>3、区间调头</a></li>
... ... @@ -15,7 +15,7 @@
15 15 </ul>
16 16 </div>
17 17 <div class="uk-width-8-10">
18   - <ul id="tempScheduleContent" class="uk-switcher">
  18 + <ul id="tempScheduleContentChild" class="uk-switcher">
19 19 <li class="tab_cont normalCont"></li>
20 20 <li class="tab_cont inOutCont"></li>
21 21 <li class="tab_cont rangeTurnCont"></li>
... ... @@ -282,7 +282,7 @@
282 282 re_count = true;
283 283 var that=this;
284 284 setTimeout(function () {
285   - var fs = $('#tempScheduleContent li.uk-active form.sub_task_form_v2', modal);
  285 + var fs = $('#tempScheduleContentChild li.uk-active form.sub_task_form_v2', modal);
286 286 var s=0,e=0,d=0,mileage;
287 287 $.each(fs, function () {
288 288 mileage = parseFloat($f('mileage',this).val());
... ... @@ -677,7 +677,6 @@
677 677 return array;
678 678 }
679 679 var schData={};
680   - var addChildModel='';
681 680 $('#min_a').click(function () {
682 681 $('#add-sub-task-main-modal').hide();
683 682  
... ...
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
... ... @@ -284,7 +284,7 @@ var gb_schedule_context_menu = (function () {
284 284 }
285 285 open_modal(folder + '/sub_task_v2/main.html', {
286 286 sch: sch
287   - }, modal_opts);
  287 + }, {center: false, bgclose: false, modal: false});
288 288 },
289 289 wxsb: function (sch) {
290 290 open_modal(folder + '/wxsb.html', {
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -370,7 +370,11 @@ var gb_schedule_table = (function () {
370 370 $(dds[4]).text(sch.qdzArrDatesj ? sch.qdzArrDatesj : '');
371 371  
372 372 //计发时间
373   - $(dds[5]).replaceWith(temps['line-schedule-fcsj-temp'](sch));
  373 + var d5html = temps['line-schedule-fcsj-temp'](sch);
  374 + if (sch.lpChange == 1) {
  375 + d5html = d5html.replace('</dd>', '') + '<span class="uk-badge uk-badge-success out">换</span>' + '</dd>';
  376 + }
  377 + $(dds[5]).replaceWith(d5html);
374 378 //待发时间
375 379 var dfHtmlStr = sch.dfsj + (sch.late2?'<span class="late-badge">?+'+sch.lateMinute+'</span>':'');
376 380 $(dds[6]).attr('data-sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(dfHtmlStr);
... ... @@ -385,10 +389,6 @@ var gb_schedule_table = (function () {
385 389 $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>');
386 390 else
387 391 $(dds[8]).html('');
388   - if (sch.lpChange==1) {
389   - var d8html=$(dds[5]).html();
390   - $(dds[5]).html(d8html+'<span class="uk-badge uk-badge-success out">换</span>');
391   - }
392 392  
393 393 //信号状态标记
394 394 gb_signal_state.marker_sch(sch);
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/left.html
... ... @@ -459,6 +459,7 @@
459 459 function fillAbnormalTable(){
460 460 var array = [];
461 461 for(var i = 0; i < arguments.length; i ++){
  462 + if(arguments[i]!=null)
462 463 array = array.concat(arguments[i]);
463 464 }
464 465 var i=null;
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v3/right.html
... ... @@ -62,7 +62,7 @@
62 62 </div>
63 63 <span class="ui-slider-tip"></span>
64 64 <span class="ui-slider-tip-fixed"></span>
65   - <div class="ct-progress-bar" >
  65 + <div class="ct-progress-bar">
66 66 <div class="scale"></div>
67 67 </div>
68 68 </div>
... ... @@ -91,9 +91,9 @@
91 91 gpsArray = data.list;
92 92 arrivalData = data.arrivalData;
93 93 inoutLen = arrivalData.length;
94   - lineVersionList=data.lineVerson;
  94 + lineVersionList = data.lineVerson;
95 95  
96   - if(!gpsArray || gpsArray.length==0)
  96 + if (!gpsArray || gpsArray.length == 0)
97 97 return;
98 98 step = progress.width() / gpsArray.length;
99 99 //激活工具栏
... ... @@ -103,39 +103,39 @@
103 103  
104 104 /**
105 105 * 默认显示完整的地图轨迹
106   - */
107   - try{
  106 + */
  107 + try {
108 108 play_before_goto(gpsArray.length - 1);
109   - }catch (e){
  109 + } catch (e) {
110 110 console.log(e);
111 111 }
112   - play_before_flag=true;
  112 + play_before_flag = true;
113 113 });
114 114  
115 115  
116 116 function reset() {
117 117 pause();
118 118 $('.top-btn-list .play', rightWrap).removeClass('pause');
119   - index=0;
120   - inoutIndex=0;
  119 + index = 0;
  120 + inoutIndex = 0;
121 121 clearXlPolyline();
122   - xlPolyline={};
  122 + xlPolyline = {};
123 123 scale.css('width', 0);
124 124 fixedTime.css('left', 0).css('visibility', 'hidden');
125   - trailArray=[];
126   - gpsMarker=null;
127   - trailPolyline=null;
  125 + trailArray = [];
  126 + gpsMarker = null;
  127 + trailPolyline = null;
128 128 map.clearOverlays();
129   - parkPolygons={};
130   - autoChange=true;
  129 + parkPolygons = {};
  130 + autoChange = true;
131 131 }
132 132  
133   - function replaceSymbol(s){
134   - return s.replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),'').replace(new RegExp(/ /g),'');
  133 + function replaceSymbol(s) {
  134 + return s.replace(new RegExp(/-/g), '').replace(new RegExp(/:/g), '').replace(new RegExp(/ /g), '');
135 135 }
136 136  
137 137 progress.mousemove(function (e) {
138   - if(!gpsArray || gpsArray.length==0)
  138 + if (!gpsArray || gpsArray.length == 0)
139 139 return;
140 140 var x = e.offsetX; //外面板的margin-left:-3px;
141 141 var i = parseInt(x / step);
... ... @@ -158,6 +158,7 @@
158 158 }, 700);
159 159  
160 160 var map;
  161 +
161 162 function initMap() {
162 163 //初始化地图
163 164 map = new BMap.Map(mapWrap[0]);
... ... @@ -174,12 +175,12 @@
174 175 e.stopPropagation();
175 176 map.enableAutoResize();
176 177  
177   - if(!gpsArray || gpsArray.length==0)
  178 + if (!gpsArray || gpsArray.length == 0)
178 179 return;
179 180 //重新计算进度条
180 181 step = progress.width() / gpsArray.length;
181 182 scale.css('width', step * index);
182   - if(fixedTime.css('visibility')=='visible'){
  183 + if (fixedTime.css('visibility') == 'visible') {
183 184 fixedTime.text(moment(gpsArray[index].timestamp).format('HH:mm.ss')).css('left', step * index - 27);
184 185 }
185 186 }).on('close', reset);
... ... @@ -188,23 +189,23 @@
188 189 * 播放
189 190 */
190 191 $('.top-btn-list .play', rightWrap).on('click', function () {
191   - if(toolsDisabled())
  192 + if (toolsDisabled())
192 193 return;
193   - if(!$(this).hasClass('pause')){
  194 + if (!$(this).hasClass('pause')) {
194 195 //第一次点击播放,清除一下
195   - if(play_before_flag){
  196 + if (play_before_flag) {
196 197 reset();
197 198 play_before_flag = false;
198 199 }
199 200 $(this).addClass('pause');
200   - if(index>=gpsArray.length-1){
  201 + if (index >= gpsArray.length - 1) {
201 202 goto(0);
202 203 }
203 204 gb_playback_v3_leftpanel.destoryScrollbar();
204 205 play();
205 206 fixedToCenter();
206 207 }
207   - else{
  208 + else {
208 209 gb_playback_v3_leftpanel.createScrollbar();
209 210 $(this).removeClass('pause');
210 211 pause();
... ... @@ -223,17 +224,17 @@
223 224 toCenterTimer = null;
224 225 };
225 226 var runTimer
226   - , playSpeed = parseInt($('.speed_form input[checked]').val());
  227 + , playSpeed = parseInt($('.speed_form input[checked]').val());
227 228 var index = 0;
228 229 var play = function () {
229   - if(!run()){
  230 + if (!run()) {
230 231 runTimer = setTimeout(play, 1000 / playSpeed);
231 232 }
232 233 };
233 234  
234 235 var fixedTime = $('.ui-slider-tip-fixed', rightWrap);
235 236 var run = function () {
236   - if(index == gpsArray.length){
  237 + if (index == gpsArray.length) {
237 238 index--;
238 239 $('.top-btn-list .play', rightWrap).removeClass('pause');
239 240 pause();
... ... @@ -249,7 +250,7 @@
249 250  
250 251 printTrailTable(gps, index);//输出轨迹信息
251 252 printArrivalTable(gps, index);//输出到离站信息
252   - index ++;
  253 + index++;
253 254 };
254 255  
255 256 var updateProgress = function (gps, i) {
... ... @@ -263,8 +264,8 @@
263 264 var toCenterTimer;
264 265 var fixedToCenter = function () {
265 266 toCenterTimer = setInterval(function () {
266   - var markerIsVisible = BMapLib.GeoUtils.isPointInRect(gpsMarker.getPosition(),map.getBounds());
267   - if(!markerIsVisible){
  267 + var markerIsVisible = BMapLib.GeoUtils.isPointInRect(gpsMarker.getPosition(), map.getBounds());
  268 + if (!markerIsVisible) {
268 269 map.panTo(gpsMarker.getPosition());
269 270 }
270 271 }, 500);
... ... @@ -276,11 +277,11 @@
276 277 */
277 278 var gpsMarker;
278 279 var xlPolyline = {};
279   - var circleFirstStop=0;
280   - var circlePrevStop=0;
281   - var circleLine=false;
282   - var drawCarMarker = function (gps,lineVersion) {
283   - if(!gpsMarker){
  280 + var circleFirstStop = 0;
  281 + var circlePrevStop = 0;
  282 + var circleLine = false;
  283 + var drawCarMarker = function (gps, lineVersion) {
  284 + if (!gpsMarker) {
284 285 gpsMarker = new BMap.Marker(new BMap.Point(gps.bd_lon, gps.bd_lat));
285 286 var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
286 287 gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
... ... @@ -289,48 +290,49 @@
289 290 //居中
290 291 map.panTo(gpsMarker.getPosition());
291 292 }
292   - else{
  293 + else {
293 294 gpsMarker.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat));
294 295 var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
295 296 gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
296 297 }
297   - if (gps.lineId!=xlPolyline.lineId) {
298   - circleLine=queryIsCircle(gps.lineId,gps.nbbm,gps.timestamp,gps.stopNo);
  298 + if (gps.lineId != xlPolyline.lineId) {
  299 + circleLine = queryIsCircle(gps.lineId, gps.nbbm, gps.timestamp, gps.stopNo);
299 300 }
300 301 if (circleLine)
301   - circleFirstStop=gps.stopNo;
302   - circleLine=circleLine&&circlePrevStop!=circleFirstStop?true:false;
303   - circlePrevStop=gps.stopNo;
304   - if(autoChange && (gps.lineId!=xlPolyline.lineId || gps.upDown!=xlPolyline.upDown||circleLine)||xlPolyline.lineVersion != lineVersion){
305   - drawXlPolyline(gps.lineId, gps.upDown,lineVersion);
  302 + circleFirstStop = gps.stopNo;
  303 + circleLine = circleLine && circlePrevStop != circleFirstStop ? true : false;
  304 + circlePrevStop = gps.stopNo;
  305 + if (autoChange && (gps.lineId != xlPolyline.lineId || gps.upDown != xlPolyline.upDown || circleLine) || xlPolyline.lineVersion != lineVersion) {
  306 + drawXlPolyline(gps.lineId, gps.upDown, lineVersion);
306 307 }
307 308 }
308 309  
309 310 var bform = $('.buffer_area_form', rightWrap);
310   - var autoChange=true;
311   - function drawXlPolyline(lineCode, upDown,lineVersion) {
312   - if(upDown!=0 && upDown!=1){
  311 + var autoChange = true;
  312 +
  313 + function drawXlPolyline(lineCode, upDown, lineVersion) {
  314 + if (upDown != 0 && upDown != 1) {
313 315 //upDown = xlPolyline.upDown?xlPolyline.upDown:0;
314 316 return;
315 317 }
316 318  
317 319 clearXlPolyline();
318 320 //绘制路段
319   - drawRoadPolyline(lineCode, upDown,lineVersion);
  321 + drawRoadPolyline(lineCode, upDown, lineVersion);
320 322 //绘制站点
321   - if($('input[name=drawPoint]', bform)[0].checked)
322   - drawStationMarkers(lineCode, upDown,lineVersion);
  323 + if ($('input[name=drawPoint]', bform)[0].checked)
  324 + drawStationMarkers(lineCode, upDown, lineVersion);
323 325 //绘制缓冲区
324   - if($('input[name=drawBuffArea]', bform)[0].checked)
325   - drawBuffArea(lineCode, upDown,lineVersion);
  326 + if ($('input[name=drawBuffArea]', bform)[0].checked)
  327 + drawBuffArea(lineCode, upDown, lineVersion);
326 328 //绘制站点名称
327   - if($('input[name=stationName]', bform)[0].checked)
328   - drawNameMarkers(lineCode, upDown,lineVersion);
  329 + if ($('input[name=stationName]', bform)[0].checked)
  330 + drawNameMarkers(lineCode, upDown, lineVersion);
329 331  
330 332 xlPolyline.lineId = lineCode;
331 333 xlPolyline.upDown = upDown;
332 334 xlPolyline.lineVersion = lineVersion;
333   - currentVersion =lineVersion;
  335 + currentVersion = lineVersion;
334 336 }
335 337  
336 338 var storage = window.localStorage;
... ... @@ -338,17 +340,18 @@
338 340 var stations;//站点
339 341 var parks;//停车场
340 342  
341   - function drawRoadPolyline(lineCode, upDown,lineVersion) {
  343 + function drawRoadPolyline(lineCode, upDown, lineVersion) {
342 344 //从localStorage获取路段
343   - routes = JSON.parse(storage.getItem(lineCode+"_"+lineVersion + '_route'));
344   - if(!routes){
  345 + routes = JSON.parse(storage.getItem(lineCode + "_" + lineVersion + '_route'));
  346 + if (!routes) {
345 347 var name = gb_data_basic.lineCode2NameAll()[lineCode];
346 348 notify_err("缺少" + name + "的路段信息,请选择" + name + "进入线调");
347 349 return;
348 350 }
349 351 routes = [routes['up_bd'], routes['down_bd']];
350 352 var colour = gb_map_config.getConfig().section.color;
351   - var plConfig = {strokeWeight: 12, strokeColor: upDown?colour.down:colour.up, strokeOpacity: .4}, pos,polyline,pls=[];
  353 + var plConfig = {strokeWeight: 12, strokeColor: upDown ? colour.down : colour.up, strokeOpacity: .4}, pos,
  354 + polyline, pls = [];
352 355 $.each(routes[upDown], function (i, item) {
353 356 pos = [];
354 357 $.each(item.split(','), function () {
... ... @@ -362,82 +365,90 @@
362 365 xlPolyline.polylines = pls;
363 366 }
364 367  
365   - function drawStationMarkers(lineCode, upDown,lineVersion) {
366   - if(!lineCode)return;
  368 + function drawStationMarkers(lineCode, upDown, lineVersion) {
  369 + if (!lineCode) return;
367 370 //从地图模块获取站点数据
368 371 stations = gb_map_spatial_data.getStationArray(lineCode);
369   - if(!stations){
  372 + if (!stations) {
370 373 var name = gb_data_basic.lineCode2NameAll()[lineCode];
371 374 notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");
372 375 return;
373 376 }
374 377  
375   - var array = stations[upDown], psm, zdMarkers=[];
  378 + var array = stations[upDown], psm, zdMarkers = [];
376 379 $.each(array, function () {
377   - if(this.versions==lineVersion){
378   -
379   - //坐标转换
380   - var coord = TransGPS.wgsToBD(this.lat, this.lon);
381   - this.bd_lat = coord.lat;
382   - this.bd_lon = coord.lng;
383   - psm = new BMap.Marker(new BMap.Point(this.bd_lon, this.bd_lat));
384   - psm.setTitle(this.stationName);
385   - map.addOverlay(psm);
386   - psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12)));
387   - zdMarkers.push(psm);
  380 + if (this.versions == lineVersion) {
  381 +
  382 + //坐标转换
  383 + var coord = TransGPS.wgsToBD(this.lat, this.lon);
  384 + this.bd_lat = coord.lat;
  385 + this.bd_lon = coord.lng;
  386 + psm = new BMap.Marker(new BMap.Point(this.bd_lon, this.bd_lat));
  387 + psm.setTitle(this.stationName);
  388 + map.addOverlay(psm);
  389 + psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12)));
  390 + zdMarkers.push(psm);
388 391 }
389 392 });
390   - xlPolyline.zdMarkers=zdMarkers;
  393 + xlPolyline.zdMarkers = zdMarkers;
391 394 }
392 395  
393   - function drawBuffArea(lineCode, upDown,lineVersion) {
394   - if(!lineCode)return;
  396 + function drawBuffArea(lineCode, upDown, lineVersion) {
  397 + if (!lineCode) return;
395 398 stations = gb_map_spatial_data.getStationArray(lineCode);
396   - if(!stations){
  399 + if (!stations) {
397 400 var name = gb_data_basic.lineCode2NameAll()[lineCode];
398 401 notify_err("缺少" + name + "的缓冲区信息,请选择" + name + "进入线调");
399 402 return;
400 403 }
401 404  
402   - var array = stations[upDown], obj, buffs=[];
  405 + var array = stations[upDown], obj, buffs = [];
403 406 $.each(array, function () {
404   - if(this.versions==lineVersion){
405   - if(this.shapesType=='r')
406   - obj = drawCircle(new BMap.Point(this.bd_lon, this.bd_lat), this.radius);
407   - else if(this.shapesType=='d')
408   - obj = drawPolygon(this);
409   -
410   - if(obj)
411   - buffs.push(obj);
  407 + if (this.versions == lineVersion) {
  408 + if (this.shapesType == 'r')
  409 + obj = drawCircle(new BMap.Point(this.bd_lon, this.bd_lat), this.radius);
  410 + else if (this.shapesType == 'd')
  411 + obj = drawPolygon(this);
  412 +
  413 + if (obj)
  414 + buffs.push(obj);
412 415 }
413 416 });
414 417  
415 418 xlPolyline.buffs = buffs;
416 419 }
417 420  
418   - function drawNameMarkers(lineCode, upDown,lineVersion) {
419   - if(!lineCode)return;
  421 + function drawNameMarkers(lineCode, upDown, lineVersion) {
  422 + if (!lineCode) return;
420 423 //从地图模块获取站点数据
421 424 stations = gb_map_spatial_data.getStationArray(lineCode);
422   - if(!stations){
  425 + if (!stations) {
423 426 var name = gb_data_basic.lineCode2NameAll()[lineCode];
424 427 notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");
425 428 return;
426 429 }
427 430  
428   - var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "black", borderColor: "black", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
429   - var array = stations[upDown], tMarkers=[];
  431 + var style = {
  432 + backgroundColor: "rgba(255, 255, 255, 0.69)",
  433 + color: "black",
  434 + borderColor: "black",
  435 + fontSize: "12px",
  436 + height: "16px",
  437 + lineHeight: "16px",
  438 + fontFamily: "微软雅黑"
  439 + }
  440 + var array = stations[upDown], tMarkers = [];
430 441 $.each(array, function () {
431   - if (this.versions==lineVersion) {
  442 + if (this.versions == lineVersion) {
432 443  
433   - var width = this.stationName.length * 12;
434   - var label = new BMap.Label(this.stationName, {
435   - position:new BMap.Point(this.bd_lon, this.bd_lat),
436   - offset: new BMap.Size(-(width / 2), -27)
437   - });
438   - label.setStyle(style);
439   - map.addOverlay(label);
440   - tMarkers.push(label);
  444 + var width = this.stationName.length * 12;
  445 + var label = new BMap.Label(this.stationName, {
  446 + position: new BMap.Point(this.bd_lon, this.bd_lat),
  447 + offset: new BMap.Size(-(width / 2), -27)
  448 + });
  449 + label.setStyle(style);
  450 + map.addOverlay(label);
  451 + tMarkers.push(label);
441 452 }
442 453 });
443 454  
... ... @@ -460,13 +471,13 @@
460 471 xlPolyline.tMarkers = [];
461 472 //清除轨迹线
462 473 clearOverlayArray(trailPolylineArray);
463   - trailPolylineArray=[];
464   - trailPolyline=null;
465   - trailArray=[];
  474 + trailPolylineArray = [];
  475 + trailPolyline = null;
  476 + trailArray = [];
466 477 }
467 478  
468 479 function clearOverlayArray(array) {
469   - if(!array || !isArray(array))
  480 + if (!array || !isArray(array))
470 481 return;
471 482 $.each(array, function () {
472 483 map.removeOverlay(this);
... ... @@ -474,33 +485,34 @@
474 485 }
475 486  
476 487 //更新轨迹线条
477   - var trailArray=[], trailPolyline,trailPolylineArray=[];
  488 + var trailArray = [], trailPolyline, trailPolylineArray = [];
  489 +
478 490 function updateTrailLine(gps, i) {
479 491 trailArray.push(gpsMarker.getPosition());
480   - if(!trailPolyline){
  492 + if (!trailPolyline) {
481 493 trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 2, strokeColor: '#000000'});
482 494 map.addOverlay(trailPolyline);
483 495 }
484   - else{
  496 + else {
485 497 trailPolyline.setPath(trailArray);
486 498 }
487 499 trailPolylineArray.push(trailPolyline);
488 500 //最多记录4000个点位轨迹线条
489   - if(trailArray.length > 4000)
  501 + if (trailArray.length > 4000)
490 502 trailArray = trailArray.slice(trailArray.length - 4000);
491 503 }
492 504  
493 505 var trailTbody = leftWrap + ' .trail-info-table .ct_table_body',
494   - trailWrap = leftWrap + ' .trail-info-wrap' , trailPrve;
  506 + trailWrap = leftWrap + ' .trail-info-wrap', trailPrve;
495 507 var printTrailTable = function (gps, i) {
496   - if(i == 0)
  508 + if (i == 0)
497 509 $(trailTbody).html('');
498 510  
499 511 var code = gps['section_code'];
500 512 if (!trailPrve || code != trailPrve['section_code']) {
501 513 $(trailTbody).append(template('pbv3_trail_tbody-temp', {array: [gps]}));
502 514 }
503   - else{
  515 + else {
504 516 var dds = $(trailTbody).find('dl[data-code=' + code + ']').last().find('dd');
505 517 $(dds[0]).text(gps.timeStr);
506 518 $(dds[1]).text(gps.speed);
... ... @@ -511,31 +523,31 @@
511 523  
512 524  
513 525 var arrivalWrap = leftWrap + ' .inout_table_wrap',
514   - arivalTbody = arrivalWrap + ' .ct_table_body';
  526 + arivalTbody = arrivalWrap + ' .ct_table_body';
515 527  
516   - var inoutIndex=0, inoutLen, _item;
  528 + var inoutIndex = 0, inoutLen, _item;
517 529 var printArrivalTable = function (gps, i) {
518   - if(inoutIndex == 0)
  530 + if (inoutIndex == 0)
519 531 $(arivalTbody).html('');
520 532  
521 533 var $dl;
522   - for(var j = inoutIndex; j < inoutLen; j++){
  534 + for (var j = inoutIndex; j < inoutLen; j++) {
523 535 _item = arrivalData[j];
524   - $dl = $(arivalTbody).find('dl[data-id='+_item.id+']');
525   - if(gps.ts >= _item.in_ts && $dl.length==0){
  536 + $dl = $(arivalTbody).find('dl[data-id=' + _item.id + ']');
  537 + if (gps.ts >= _item.in_ts && $dl.length == 0) {
526 538 $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));
527 539 inoutIndex = j;
528 540 }
529 541  
530   - if(gps.ts >= _item.out_ts){
  542 + if (gps.ts >= _item.out_ts) {
531 543 var dds = $dl.find('dd');
532   - if($dl.length==0)
  544 + if ($dl.length == 0)
533 545 $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));
534 546 else
535 547 $(dds[2]).text(_item.out_time_str);
536 548 inoutIndex = j;
537 549 }
538   - else if(!_item.out_ts && gps.ts >= _item.in_ts){
  550 + else if (!_item.out_ts && gps.ts >= _item.in_ts) {
539 551 inoutIndex = j;
540 552 }
541 553 else {
... ... @@ -560,16 +572,16 @@
560 572 return polygon;
561 573 };
562 574  
563   - var transMultiWGSToBd = function(obj) {
564   - if(!obj._gPoints)
  575 + var transMultiWGSToBd = function (obj) {
  576 + if (!obj._gPoints)
565 577 return;
566   - var bdPoints = [],coord;
  578 + var bdPoints = [], coord;
567 579 $.each(obj._gPoints, function () {
568 580 coord = TransGPS.wgsToBD(this.lat, this.lng);
569 581 bdPoints.push(new BMap.Point(coord.lng, coord.lat));
570 582 });
571 583  
572   - obj.bdPoints=bdPoints;
  584 + obj.bdPoints = bdPoints;
573 585 };
574 586  
575 587 /**
... ... @@ -577,30 +589,30 @@
577 589 */
578 590 $('.buffer_area_form input', rightWrap).on('click', function () {
579 591 var name = $(this).attr('name'),
580   - lineCode = xlPolyline.lineId,
581   - upDown = xlPolyline.upDown;
582   - linesVersion = xlPolyline.lineVersion;
583   - switch (name){
  592 + lineCode = xlPolyline.lineId,
  593 + upDown = xlPolyline.upDown;
  594 + linesVersion = xlPolyline.lineVersion;
  595 + switch (name) {
584 596 case 'stationName':
585 597 //清除站点名称
586 598 clearOverlayArray(xlPolyline.tMarkers);
587 599 xlPolyline.tMarkers = [];
588   - if(this.checked)
589   - drawNameMarkers(lineCode, upDown,linesVersion);
  600 + if (this.checked)
  601 + drawNameMarkers(lineCode, upDown, linesVersion);
590 602 break;
591 603 case 'drawBuffArea':
592 604 //清除缓冲区
593 605 clearOverlayArray(xlPolyline.buffs);
594 606 xlPolyline.buffs = [];
595   - if(this.checked)
596   - drawBuffArea(lineCode, upDown,linesVersion);
  607 + if (this.checked)
  608 + drawBuffArea(lineCode, upDown, linesVersion);
597 609 break;
598 610 case 'drawPoint':
599 611 //清除站点
600 612 clearOverlayArray(xlPolyline.zdMarkers);
601 613 xlPolyline.zdMarkers = [];
602   - if(this.checked)
603   - drawStationMarkers(lineCode, upDown,linesVersion);
  614 + if (this.checked)
  615 + drawStationMarkers(lineCode, upDown, linesVersion);
604 616 break;
605 617 }
606 618 });
... ... @@ -615,9 +627,9 @@
615 627 return;
616 628  
617 629 var isrun;
618   - if(runTimer){
  630 + if (runTimer) {
619 631 pause();
620   - isrun=true;
  632 + isrun = true;
621 633 }
622 634  
623 635 var gps = gpsArray[ei];
... ... @@ -629,7 +641,7 @@
629 641 //更新轨迹线条
630 642 trailArray = [];
631 643 var i = 0;
632   - if(ei > 1000)
  644 + if (ei > 1000)
633 645 i = ei - 1000;
634 646 for (; i < ei; i++)
635 647 trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
... ... @@ -641,7 +653,7 @@
641 653 //更新到离站表格
642 654 //重新定位 inoutIndex
643 655 $.each(arrivalData, function (i, obj) {
644   - if(gps.ts<this.in_ts || gps.ts<this.out_ts){
  656 + if (gps.ts < this.in_ts || gps.ts < this.out_ts) {
645 657 inoutIndex = i;
646 658 return false;
647 659 }
... ... @@ -651,7 +663,7 @@
651 663 map.panTo(gpsMarker.getPosition());
652 664  
653 665 index = ei + 1;
654   - if(isrun){
  666 + if (isrun) {
655 667 play();
656 668 fixedToCenter();
657 669 }
... ... @@ -668,31 +680,38 @@
668 680 //更新轨迹线条
669 681 trailArray = [];
670 682 var i = 0;
671   - if(ei > 1000)
  683 + if (ei > 1000)
672 684 i = ei - 1000;
673   - // for (; i < ei; i++)
674   - // trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
675   - // updateTrailLine(gpsArray[ei], ei);
  685 + // for (; i < ei; i++)
  686 + // trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
  687 + // updateTrailLine(gpsArray[ei], ei);
676 688  
677 689 //居中
678 690 map.panTo(gpsMarker.getPosition());
679 691 }
680   - function getLineVersionAnddrawCarMarker(gps){
681   - if(lineVersionList.length>0){
  692 +
  693 + function getLineVersionAnddrawCarMarker(gps) {
  694 + if (lineVersionList.length > 0) {
682 695 for (var i = 0; i < lineVersionList.length; i++) {
683   - if ((lineVersionList[i].endTime&&lineVersionList[i].endTime>gps.timestamp)||(lineVersionList[i].startTime&&lineVersionList[i].startTime<gps.timestamp)||(lineVersionList[i].vtime&&lineVersionList[i].vtime=='all')) {
684   - drawCarMarker(gps,lineVersionList[i].version);//更新GPS点位
  696 + if (lineVersionList[i].length > 0) {
  697 + for (var j = 0; j < lineVersionList[i].length; j++) {
  698 + if ((lineVersionList[i][j].endTime && lineVersionList[i][j].endTime > gps.timestamp) || (lineVersionList[i][j].startTime && lineVersionList[i][j].startTime < gps.timestamp) || (lineVersionList[i][j].vtime && lineVersionList[i][j].vtime == 'all')) {
  699 + drawCarMarker(gps, lineVersionList[i][j].version);//更新GPS点位
  700 + }
  701 + }
  702 +
  703 +
685 704 }
686 705 }
687   - }else {
688   - drawCarMarker(gps,0);//除非线路没有版本信息
  706 + } else {
  707 + drawCarMarker(gps, 0);//除非线路没有版本信息
689 708 }
690 709 }
691 710  
692 711 /**
693 712 * 初始化停车场下拉菜单
694 713 */
695   - var parkPolygons={};
  714 + var parkPolygons = {};
696 715 (function (lineCode) {
697 716 //从地图模块获取停车场数据
698 717 var parks = gb_map_spatial_data.carparkArray();
... ... @@ -702,8 +721,8 @@
702 721  
703 722 console.log('parksparks', parks);
704 723 //拼音映射
705   - var searchData=[];
706   - for(var i=0,p;p=parks[i++];){
  724 + var searchData = [];
  725 + for (var i = 0, p; p = parks[i++];) {
707 726 searchData.push({
708 727 code: p.parkCode,
709 728 name: p.parkName,
... ... @@ -715,15 +734,15 @@
715 734 var listWrap = $('.buffer_area_form .parks_list', rightWrap);
716 735 $('.park_list_search_input', rightWrap).on('input', function () {
717 736 var v = $(this).val();
718   - if(!v){
  737 + if (!v) {
719 738 $('li', listWrap).show();
720 739 return;
721 740 }
722 741 v = v.toUpperCase();
723 742 $('li', listWrap).hide();
724   - for(var i=0,obj;obj=searchData[i++];){
725   - if(obj.name.indexOf(v)!=-1 || obj.fullChars.indexOf(v)!=-1 || obj.camelChars.indexOf(v)!=-1)
726   - $('li[data-code="'+obj.code+'"]', listWrap).show();
  743 + for (var i = 0, obj; obj = searchData[i++];) {
  744 + if (obj.name.indexOf(v) != -1 || obj.fullChars.indexOf(v) != -1 || obj.camelChars.indexOf(v) != -1)
  745 + $('li[data-code="' + obj.code + '"]', listWrap).show();
727 746 }
728 747 });
729 748  
... ... @@ -731,10 +750,13 @@
731 750 $('.buffer_area_form .parks_list>li', rightWrap).on('click', function () {
732 751 var code = $(this).data('code');
733 752  
734   - if(!parkPolygons[code]){
  753 + if (!parkPolygons[code]) {
735 754 var park;
736 755 $.each(parks, function () {
737   - if(this.parkCode==code){park = this;return false;}
  756 + if (this.parkCode == code) {
  757 + park = this;
  758 + return false;
  759 + }
738 760 });
739 761  
740 762 transMultiWGSToBd(park);
... ... @@ -743,13 +765,21 @@
743 765 parkPolygons[code] = polygon;
744 766 //中心点
745 767 var ts = park.gCenterPoint.split(' ')
746   - ,coord = TransGPS.wgsToBD(parseFloat(ts[1]), parseFloat(ts[0]));
  768 + , coord = TransGPS.wgsToBD(parseFloat(ts[1]), parseFloat(ts[0]));
747 769 polygon._centerPoint = new BMap.Point(coord.lng, coord.lat);
748 770 //绘制名称label
749   - var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "red", borderColor: "red", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
  771 + var style = {
  772 + backgroundColor: "rgba(255, 255, 255, 0.69)",
  773 + color: "red",
  774 + borderColor: "red",
  775 + fontSize: "12px",
  776 + height: "16px",
  777 + lineHeight: "16px",
  778 + fontFamily: "微软雅黑"
  779 + }
750 780 var width = park.parkName.length * 12;
751 781 var label = new BMap.Label(park.parkName, {
752   - position:polygon._centerPoint,
  782 + position: polygon._centerPoint,
753 783 offset: new BMap.Size(-(width / 2), -27)
754 784 });
755 785 label.setStyle(style);
... ... @@ -757,16 +787,16 @@
757 787 }
758 788  
759 789 //定位到polygon
760   - var polygon=parkPolygons[code];
  790 + var polygon = parkPolygons[code];
761 791 map.panTo(polygon._centerPoint);
762 792 });
763 793 })();
764 794  
765 795 //初始化线路地图下拉菜单
766 796 (function () {
767   - var opts='';
  797 + var opts = '';
768 798 $.each(gb_data_basic.activeLines, function () {
769   - opts+='<li data-code="'+this.lineCode+'" data-dir="0"><a>'+this.name+'上行</a></li><li data-code="'+this.lineCode+'" data-dir="1"><a>'+this.name+'下行</a></li>';
  799 + opts += '<li data-code="' + this.lineCode + '" data-dir="0"><a>' + this.name + '上行</a></li><li data-code="' + this.lineCode + '" data-dir="1"><a>' + this.name + '下行</a></li>';
770 800 });
771 801 $('.base_line_list', rightWrap).html(opts);
772 802  
... ... @@ -775,7 +805,7 @@
775 805 var code = $(this).data('code');
776 806 var updown = $(this).data('dir');
777 807 autoChange = false;
778   - drawXlPolyline(code, updown,currentVersion);
  808 + drawXlPolyline(code, updown, currentVersion);
779 809 });
780 810 })();
781 811  
... ... @@ -783,9 +813,9 @@
783 813 function formData() {
784 814 var fs = 'YYYY-MM-DD HH:mm';
785 815 var f = $('.play-back-form form', leftWrap),
786   - nbbm = $('[name=nbbm]',f).val(),
787   - st = parseInt(moment($('[name=startTime]',f).val(), fs).format('X')),
788   - et = parseInt(moment($('[name=endTime]',f).val(), fs).format('X'));
  816 + nbbm = $('[name=nbbm]', f).val(),
  817 + st = parseInt(moment($('[name=startTime]', f).val(), fs).format('X')),
  818 + et = parseInt(moment($('[name=endTime]', f).val(), fs).format('X'));
789 819  
790 820 return {
791 821 nbbm: nbbm,
... ... @@ -797,52 +827,48 @@
797 827 //轨迹
798 828 $('.export-excel', rightWrap).on('click', function () {
799 829 var d = formData();
800   - window.open('/gps/history_v3/excel/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  830 + window.open('/gps/history_v3/excel/' + d.nbbm + "?st=" + d.st + "&et=" + d.et);
801 831 });
802 832 //异常信息
803 833 $('.export-excel-abnormal', rightWrap).on('click', function () {
804 834 var d = formData();
805   - window.open('/gps/history_v3/excel_abnormal/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  835 + window.open('/gps/history_v3/excel_abnormal/' + d.nbbm + "?st=" + d.st + "&et=" + d.et);
806 836 });
807 837 //到离站
808 838 $('.export-excel-arrival', rightWrap).on('click', function () {
809 839 var d = formData();
810   - window.open('/gps/history_v3/excel_arrival/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  840 + window.open('/gps/history_v3/excel_arrival/' + d.nbbm + "?st=" + d.st + "&et=" + d.et);
811 841 });
812   - function queryIsCircle(line,nbbm,ts,qdzCode){
813   - var lineInfo=0;
  842 +
  843 + function queryIsCircle(line, nbbm, ts, qdzCode) {
  844 + var lineInfo = 0;
814 845 $.ajax({
815 846 url: "/line/findById", //请求地址
816 847 type: "Get",
817   - async:false,
  848 + async: false,
818 849 //请求方式
819   - data: { id : line}, //请求参数
  850 + data: {id: line}, //请求参数
820 851 success: function (result) {
821 852 lineInfo = result.linePlayType;
822 853 }
823 854 });
824   - if (lineInfo!=1)
  855 + if (lineInfo != 1)
825 856 return false;
826   - var stops=0;
827   - if (lineInfo==1) {
  857 + var stops = 0;
  858 + if (lineInfo == 1) {
828 859 $.ajax({
829 860 url: "/realSchedule/isCircleQdz", //请求地址
830 861 type: "POST",
831   - async:false,
  862 + async: false,
832 863 //请求方式
833   - data: { line : line,nbbm:nbbm,ts:ts,qdzCode:qdzCode}, //请求参数
  864 + data: {line: line, nbbm: nbbm, ts: ts, qdzCode: qdzCode}, //请求参数
834 865  
835 866 success: function (result) {
836 867 stops = result.isExist;
837 868 }
838 869 });
839   - // $.ajaxSettings.async = false;
840   - // gb_common.$get('/gps/isCircleQdz',{line : line,nbbm:nbbm,ts:ts,qdzCode:qdzCode},function(result){
841   - // stops = result.isCircleQdz;
842   - // })
843   - // $.ajaxSettings.async = true;
844 870 }
845   - if (stops>0)
  871 + if (stops > 0)
846 872 return true;
847 873 return false;
848 874 }
... ...