Commit 94caffdec30883394525d554733bb412fa813112

Authored by 王通
2 parents 10a5937e f1286ea3

Merge branch 'pudong' of http://192.168.168.201:8888/panzhaov5/bsth_control.git into pudong

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;
... ... @@ -250,21 +250,20 @@ public class GpsServiceImpl implements GpsService {
250 250 boolean isFirstNotValid=true;
251 251 boolean isFirstLonlatZero=true;
252 252 Map<String, Object> map = null;
  253 + int index=0;
253 254 for(Map<String, Object> rs : dataList){
254   - int index=dataList.indexOf(rs);
255 255 if (index< dataList.size()-1&&!map_get_str( rs,"LINE_ID").equals(map_get_str( dataList.get(index+1),"LINE_ID"))){
256   -
257 256 Line cLine =lineRepository.findOne(Integer.valueOf(map_get_str( rs,"LINE_ID")));
258 257 Line nextLine =lineRepository.findOne(Integer.valueOf(map_get_str( dataList.get(index+1),"LINE_ID")));
259 258 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);
  259 + Map<String,Object> LSmap=new HashMap<>();
  260 + String name=cLine.getName();
  261 + String NextName=nextLine.getName();
  262 + LSmap.put("abnormalType","linesSwitch");
  263 + LSmap.put("line_line",name+"-->"+NextName);
  264 + LSmap.put("st",map_get_long(rs, "TS"));
  265 + LSmap.put("et",index== dataList.size()-1?map_get_long(rs, "TS"):map_get_long( dataList.get(index+1), "TS"));
  266 + lineSwitch.add(LSmap);
268 267 }
269 268 }
270 269 serviceState = map_get_long(rs, "SERVICE_STATE");
... ... @@ -282,7 +281,7 @@ public class GpsServiceImpl implements GpsService {
282 281 gpsNotValidMap=null;
283 282 }
284 283 }
285   - //continue;
  284 + //continue;
286 285  
287 286 map = new HashMap<>();
288 287 lon = map_get_float(rs, "LON");
... ... @@ -337,48 +336,52 @@ public class GpsServiceImpl implements GpsService {
337 336 //路段编码
338 337 map.put("section_code", map_get_str(rs,"SECTION_CODE"));
339 338 list.add(map);
  339 + index++;
340 340 }
341 341  
342 342 if (lineSet.size()>0){
343   - for (String s : lineSet) {
344   - int lineId=Integer.parseInt(s);
345   - List<LineVersions> lvs=lineVersionsRepository.findBylineId(lineId);
346 343 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);
  344 + for (String s : lineSet) {
  345 + int lineId=Integer.parseInt(s);
  346 + List<LineVersions> lvs=lineVersionsRepository.findBylineId(lineId);
  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("line",s);
  356 + vMap.put("version",lv.getVersions());
  357 + vMap.put("vtime","all");
  358 + }else if(sd<st&&et>ed&&st<ed){
  359 + vMap.put("line",s);
  360 + vMap.put("version",lv.getVersions());
  361 + vMap.put("endTime",lv.getEndDate().getTime());
  362 + vMap.put("abnormalType","versionSwitch");
  363 + vMap.put("startTime",st);
  364 + vMap.put("st",lv.getEndDate().getTime());
  365 + qt=lv.getEndDate().getTime();
  366 + }else if(st<sd&&et<ed&&sd<et){
  367 + vMap.put("line",s);
  368 + vMap.put("version",lv.getVersions());
  369 + vMap.put("startTime",lv.getStartDate().getTime());
  370 + vMap.put("endTime",et);
  371 + }
  372 + if (!vMap.isEmpty()) {
  373 + vlist.add(vMap);
  374 + }
370 375 }
371 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 384 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   -
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/control/lineallot_v2/main.html
... ... @@ -511,8 +511,7 @@
511 511 if (rs) {
512 512 for(var lineCode in rs)
513 513 storage.setItem(lineCode + '_route', JSON.stringify(rs[lineCode]));
514   -
515   - eq.emit('cache_route');
  514 + //eq.emit('cache_route');
516 515 }
517 516 });
518 517 $.get('/realMap/findRouteByLine', {idx: idx}, function (rs) {
... ...
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,24 @@
188 189 * 播放
189 190 */
190 191 $('.top-btn-list .play', rightWrap).on('click', function () {
191   - if(toolsDisabled())
  192 + debugger
  193 + if (toolsDisabled())
192 194 return;
193   - if(!$(this).hasClass('pause')){
  195 + if (!$(this).hasClass('pause')) {
194 196 //第一次点击播放,清除一下
195   - if(play_before_flag){
  197 + if (play_before_flag) {
196 198 reset();
197 199 play_before_flag = false;
198 200 }
199 201 $(this).addClass('pause');
200   - if(index>=gpsArray.length-1){
  202 + if (index >= gpsArray.length - 1) {
201 203 goto(0);
202 204 }
203 205 gb_playback_v3_leftpanel.destoryScrollbar();
204 206 play();
205 207 fixedToCenter();
206 208 }
207   - else{
  209 + else {
208 210 gb_playback_v3_leftpanel.createScrollbar();
209 211 $(this).removeClass('pause');
210 212 pause();
... ... @@ -223,17 +225,17 @@
223 225 toCenterTimer = null;
224 226 };
225 227 var runTimer
226   - , playSpeed = parseInt($('.speed_form input[checked]').val());
  228 + , playSpeed = parseInt($('.speed_form input[checked]').val());
227 229 var index = 0;
228 230 var play = function () {
229   - if(!run()){
  231 + if (!run()) {
230 232 runTimer = setTimeout(play, 1000 / playSpeed);
231 233 }
232 234 };
233 235  
234 236 var fixedTime = $('.ui-slider-tip-fixed', rightWrap);
235 237 var run = function () {
236   - if(index == gpsArray.length){
  238 + if (index == gpsArray.length) {
237 239 index--;
238 240 $('.top-btn-list .play', rightWrap).removeClass('pause');
239 241 pause();
... ... @@ -249,7 +251,7 @@
249 251  
250 252 printTrailTable(gps, index);//输出轨迹信息
251 253 printArrivalTable(gps, index);//输出到离站信息
252   - index ++;
  254 + index++;
253 255 };
254 256  
255 257 var updateProgress = function (gps, i) {
... ... @@ -263,8 +265,8 @@
263 265 var toCenterTimer;
264 266 var fixedToCenter = function () {
265 267 toCenterTimer = setInterval(function () {
266   - var markerIsVisible = BMapLib.GeoUtils.isPointInRect(gpsMarker.getPosition(),map.getBounds());
267   - if(!markerIsVisible){
  268 + var markerIsVisible = BMapLib.GeoUtils.isPointInRect(gpsMarker.getPosition(), map.getBounds());
  269 + if (!markerIsVisible) {
268 270 map.panTo(gpsMarker.getPosition());
269 271 }
270 272 }, 500);
... ... @@ -276,11 +278,11 @@
276 278 */
277 279 var gpsMarker;
278 280 var xlPolyline = {};
279   - var circleFirstStop=0;
280   - var circlePrevStop=0;
281   - var circleLine=false;
282   - var drawCarMarker = function (gps,lineVersion) {
283   - if(!gpsMarker){
  281 + var circleFirstStop = 0;
  282 + var circlePrevStop = 0;
  283 + var circleLine = false;
  284 + var drawCarMarker = function (gps, lineVersion) {
  285 + if (!gpsMarker) {
284 286 gpsMarker = new BMap.Marker(new BMap.Point(gps.bd_lon, gps.bd_lat));
285 287 var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
286 288 gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
... ... @@ -289,48 +291,49 @@
289 291 //居中
290 292 map.panTo(gpsMarker.getPosition());
291 293 }
292   - else{
  294 + else {
293 295 gpsMarker.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat));
294 296 var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
295 297 gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
296 298 }
297   - if (gps.lineId!=xlPolyline.lineId) {
298   - circleLine=queryIsCircle(gps.lineId,gps.nbbm,gps.timestamp,gps.stopNo);
  299 + if (gps.lineId != xlPolyline.lineId) {
  300 + circleLine = queryIsCircle(gps.lineId, gps.nbbm, gps.timestamp, gps.stopNo);
299 301 }
300 302 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);
  303 + circleFirstStop = gps.stopNo;
  304 + circleLine = circleLine && circlePrevStop != circleFirstStop ? true : false;
  305 + circlePrevStop = gps.stopNo;
  306 + if (autoChange && (gps.lineId != xlPolyline.lineId || gps.upDown != xlPolyline.upDown || circleLine) || xlPolyline.lineVersion != lineVersion) {
  307 + drawXlPolyline(gps.lineId, gps.upDown, lineVersion);
306 308 }
307 309 }
308 310  
309 311 var bform = $('.buffer_area_form', rightWrap);
310   - var autoChange=true;
311   - function drawXlPolyline(lineCode, upDown,lineVersion) {
312   - if(upDown!=0 && upDown!=1){
  312 + var autoChange = true;
  313 +
  314 + function drawXlPolyline(lineCode, upDown, lineVersion) {
  315 + if (upDown != 0 && upDown != 1) {
313 316 //upDown = xlPolyline.upDown?xlPolyline.upDown:0;
314 317 return;
315 318 }
316 319  
317 320 clearXlPolyline();
318 321 //绘制路段
319   - drawRoadPolyline(lineCode, upDown,lineVersion);
  322 + drawRoadPolyline(lineCode, upDown, lineVersion);
320 323 //绘制站点
321   - if($('input[name=drawPoint]', bform)[0].checked)
322   - drawStationMarkers(lineCode, upDown,lineVersion);
  324 + if ($('input[name=drawPoint]', bform)[0].checked)
  325 + drawStationMarkers(lineCode, upDown, lineVersion);
323 326 //绘制缓冲区
324   - if($('input[name=drawBuffArea]', bform)[0].checked)
325   - drawBuffArea(lineCode, upDown,lineVersion);
  327 + if ($('input[name=drawBuffArea]', bform)[0].checked)
  328 + drawBuffArea(lineCode, upDown, lineVersion);
326 329 //绘制站点名称
327   - if($('input[name=stationName]', bform)[0].checked)
328   - drawNameMarkers(lineCode, upDown,lineVersion);
  330 + if ($('input[name=stationName]', bform)[0].checked)
  331 + drawNameMarkers(lineCode, upDown, lineVersion);
329 332  
330 333 xlPolyline.lineId = lineCode;
331 334 xlPolyline.upDown = upDown;
332 335 xlPolyline.lineVersion = lineVersion;
333   - currentVersion =lineVersion;
  336 + currentVersion = lineVersion;
334 337 }
335 338  
336 339 var storage = window.localStorage;
... ... @@ -338,17 +341,21 @@
338 341 var stations;//站点
339 342 var parks;//停车场
340 343  
341   - function drawRoadPolyline(lineCode, upDown,lineVersion) {
  344 + function drawRoadPolyline(lineCode, upDown, lineVersion) {
342 345 //从localStorage获取路段
343   - routes = JSON.parse(storage.getItem(lineCode+"_"+lineVersion + '_route'));
344   - if(!routes){
  346 + if (lineVersion==0)
  347 + routes = JSON.parse(storage.getItem(lineCode + '_route'));
  348 + else
  349 + routes = JSON.parse(storage.getItem(lineCode + "_" + lineVersion + '_route'));
  350 + if (!routes) {
345 351 var name = gb_data_basic.lineCode2NameAll()[lineCode];
346 352 notify_err("缺少" + name + "的路段信息,请选择" + name + "进入线调");
347 353 return;
348 354 }
349 355 routes = [routes['up_bd'], routes['down_bd']];
350 356 var colour = gb_map_config.getConfig().section.color;
351   - var plConfig = {strokeWeight: 12, strokeColor: upDown?colour.down:colour.up, strokeOpacity: .4}, pos,polyline,pls=[];
  357 + var plConfig = {strokeWeight: 12, strokeColor: upDown ? colour.down : colour.up, strokeOpacity: .4}, pos,
  358 + polyline, pls = [];
352 359 $.each(routes[upDown], function (i, item) {
353 360 pos = [];
354 361 $.each(item.split(','), function () {
... ... @@ -362,82 +369,90 @@
362 369 xlPolyline.polylines = pls;
363 370 }
364 371  
365   - function drawStationMarkers(lineCode, upDown,lineVersion) {
366   - if(!lineCode)return;
  372 + function drawStationMarkers(lineCode, upDown, lineVersion) {
  373 + if (!lineCode) return;
367 374 //从地图模块获取站点数据
368 375 stations = gb_map_spatial_data.getStationArray(lineCode);
369   - if(!stations){
  376 + if (!stations) {
370 377 var name = gb_data_basic.lineCode2NameAll()[lineCode];
371 378 notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");
372 379 return;
373 380 }
374 381  
375   - var array = stations[upDown], psm, zdMarkers=[];
  382 + var array = stations[upDown], psm, zdMarkers = [];
376 383 $.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);
  384 + if (this.versions == lineVersion||lineVersion==0) {
  385 +
  386 + //坐标转换
  387 + var coord = TransGPS.wgsToBD(this.lat, this.lon);
  388 + this.bd_lat = coord.lat;
  389 + this.bd_lon = coord.lng;
  390 + psm = new BMap.Marker(new BMap.Point(this.bd_lon, this.bd_lat));
  391 + psm.setTitle(this.stationName);
  392 + map.addOverlay(psm);
  393 + psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12)));
  394 + zdMarkers.push(psm);
388 395 }
389 396 });
390   - xlPolyline.zdMarkers=zdMarkers;
  397 + xlPolyline.zdMarkers = zdMarkers;
391 398 }
392 399  
393   - function drawBuffArea(lineCode, upDown,lineVersion) {
394   - if(!lineCode)return;
  400 + function drawBuffArea(lineCode, upDown, lineVersion) {
  401 + if (!lineCode) return;
395 402 stations = gb_map_spatial_data.getStationArray(lineCode);
396   - if(!stations){
  403 + if (!stations) {
397 404 var name = gb_data_basic.lineCode2NameAll()[lineCode];
398 405 notify_err("缺少" + name + "的缓冲区信息,请选择" + name + "进入线调");
399 406 return;
400 407 }
401 408  
402   - var array = stations[upDown], obj, buffs=[];
  409 + var array = stations[upDown], obj, buffs = [];
403 410 $.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);
  411 + if (this.versions == lineVersion||lineVersion==0) {
  412 + if (this.shapesType == 'r')
  413 + obj = drawCircle(new BMap.Point(this.bd_lon, this.bd_lat), this.radius);
  414 + else if (this.shapesType == 'd')
  415 + obj = drawPolygon(this);
  416 +
  417 + if (obj)
  418 + buffs.push(obj);
412 419 }
413 420 });
414 421  
415 422 xlPolyline.buffs = buffs;
416 423 }
417 424  
418   - function drawNameMarkers(lineCode, upDown,lineVersion) {
419   - if(!lineCode)return;
  425 + function drawNameMarkers(lineCode, upDown, lineVersion) {
  426 + if (!lineCode) return;
420 427 //从地图模块获取站点数据
421 428 stations = gb_map_spatial_data.getStationArray(lineCode);
422   - if(!stations){
  429 + if (!stations) {
423 430 var name = gb_data_basic.lineCode2NameAll()[lineCode];
424 431 notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");
425 432 return;
426 433 }
427 434  
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=[];
  435 + var style = {
  436 + backgroundColor: "rgba(255, 255, 255, 0.69)",
  437 + color: "black",
  438 + borderColor: "black",
  439 + fontSize: "12px",
  440 + height: "16px",
  441 + lineHeight: "16px",
  442 + fontFamily: "微软雅黑"
  443 + }
  444 + var array = stations[upDown], tMarkers = [];
430 445 $.each(array, function () {
431   - if (this.versions==lineVersion) {
  446 + if (this.versions == lineVersion||lineVersion==0) {
432 447  
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);
  448 + var width = this.stationName.length * 12;
  449 + var label = new BMap.Label(this.stationName, {
  450 + position: new BMap.Point(this.bd_lon, this.bd_lat),
  451 + offset: new BMap.Size(-(width / 2), -27)
  452 + });
  453 + label.setStyle(style);
  454 + map.addOverlay(label);
  455 + tMarkers.push(label);
441 456 }
442 457 });
443 458  
... ... @@ -460,13 +475,13 @@
460 475 xlPolyline.tMarkers = [];
461 476 //清除轨迹线
462 477 clearOverlayArray(trailPolylineArray);
463   - trailPolylineArray=[];
464   - trailPolyline=null;
465   - trailArray=[];
  478 + trailPolylineArray = [];
  479 + trailPolyline = null;
  480 + trailArray = [];
466 481 }
467 482  
468 483 function clearOverlayArray(array) {
469   - if(!array || !isArray(array))
  484 + if (!array || !isArray(array))
470 485 return;
471 486 $.each(array, function () {
472 487 map.removeOverlay(this);
... ... @@ -474,33 +489,34 @@
474 489 }
475 490  
476 491 //更新轨迹线条
477   - var trailArray=[], trailPolyline,trailPolylineArray=[];
  492 + var trailArray = [], trailPolyline, trailPolylineArray = [];
  493 +
478 494 function updateTrailLine(gps, i) {
479 495 trailArray.push(gpsMarker.getPosition());
480   - if(!trailPolyline){
  496 + if (!trailPolyline) {
481 497 trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 2, strokeColor: '#000000'});
482 498 map.addOverlay(trailPolyline);
483 499 }
484   - else{
  500 + else {
485 501 trailPolyline.setPath(trailArray);
486 502 }
487 503 trailPolylineArray.push(trailPolyline);
488 504 //最多记录4000个点位轨迹线条
489   - if(trailArray.length > 4000)
  505 + if (trailArray.length > 4000)
490 506 trailArray = trailArray.slice(trailArray.length - 4000);
491 507 }
492 508  
493 509 var trailTbody = leftWrap + ' .trail-info-table .ct_table_body',
494   - trailWrap = leftWrap + ' .trail-info-wrap' , trailPrve;
  510 + trailWrap = leftWrap + ' .trail-info-wrap', trailPrve;
495 511 var printTrailTable = function (gps, i) {
496   - if(i == 0)
  512 + if (i == 0)
497 513 $(trailTbody).html('');
498 514  
499 515 var code = gps['section_code'];
500 516 if (!trailPrve || code != trailPrve['section_code']) {
501 517 $(trailTbody).append(template('pbv3_trail_tbody-temp', {array: [gps]}));
502 518 }
503   - else{
  519 + else {
504 520 var dds = $(trailTbody).find('dl[data-code=' + code + ']').last().find('dd');
505 521 $(dds[0]).text(gps.timeStr);
506 522 $(dds[1]).text(gps.speed);
... ... @@ -511,31 +527,31 @@
511 527  
512 528  
513 529 var arrivalWrap = leftWrap + ' .inout_table_wrap',
514   - arivalTbody = arrivalWrap + ' .ct_table_body';
  530 + arivalTbody = arrivalWrap + ' .ct_table_body';
515 531  
516   - var inoutIndex=0, inoutLen, _item;
  532 + var inoutIndex = 0, inoutLen, _item;
517 533 var printArrivalTable = function (gps, i) {
518   - if(inoutIndex == 0)
  534 + if (inoutIndex == 0)
519 535 $(arivalTbody).html('');
520 536  
521 537 var $dl;
522   - for(var j = inoutIndex; j < inoutLen; j++){
  538 + for (var j = inoutIndex; j < inoutLen; j++) {
523 539 _item = arrivalData[j];
524   - $dl = $(arivalTbody).find('dl[data-id='+_item.id+']');
525   - if(gps.ts >= _item.in_ts && $dl.length==0){
  540 + $dl = $(arivalTbody).find('dl[data-id=' + _item.id + ']');
  541 + if (gps.ts >= _item.in_ts && $dl.length == 0) {
526 542 $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));
527 543 inoutIndex = j;
528 544 }
529 545  
530   - if(gps.ts >= _item.out_ts){
  546 + if (gps.ts >= _item.out_ts) {
531 547 var dds = $dl.find('dd');
532   - if($dl.length==0)
  548 + if ($dl.length == 0)
533 549 $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));
534 550 else
535 551 $(dds[2]).text(_item.out_time_str);
536 552 inoutIndex = j;
537 553 }
538   - else if(!_item.out_ts && gps.ts >= _item.in_ts){
  554 + else if (!_item.out_ts && gps.ts >= _item.in_ts) {
539 555 inoutIndex = j;
540 556 }
541 557 else {
... ... @@ -560,16 +576,16 @@
560 576 return polygon;
561 577 };
562 578  
563   - var transMultiWGSToBd = function(obj) {
564   - if(!obj._gPoints)
  579 + var transMultiWGSToBd = function (obj) {
  580 + if (!obj._gPoints)
565 581 return;
566   - var bdPoints = [],coord;
  582 + var bdPoints = [], coord;
567 583 $.each(obj._gPoints, function () {
568 584 coord = TransGPS.wgsToBD(this.lat, this.lng);
569 585 bdPoints.push(new BMap.Point(coord.lng, coord.lat));
570 586 });
571 587  
572   - obj.bdPoints=bdPoints;
  588 + obj.bdPoints = bdPoints;
573 589 };
574 590  
575 591 /**
... ... @@ -577,30 +593,30 @@
577 593 */
578 594 $('.buffer_area_form input', rightWrap).on('click', function () {
579 595 var name = $(this).attr('name'),
580   - lineCode = xlPolyline.lineId,
581   - upDown = xlPolyline.upDown;
582   - linesVersion = xlPolyline.lineVersion;
583   - switch (name){
  596 + lineCode = xlPolyline.lineId,
  597 + upDown = xlPolyline.upDown;
  598 + linesVersion = xlPolyline.lineVersion;
  599 + switch (name) {
584 600 case 'stationName':
585 601 //清除站点名称
586 602 clearOverlayArray(xlPolyline.tMarkers);
587 603 xlPolyline.tMarkers = [];
588   - if(this.checked)
589   - drawNameMarkers(lineCode, upDown,linesVersion);
  604 + if (this.checked)
  605 + drawNameMarkers(lineCode, upDown, linesVersion);
590 606 break;
591 607 case 'drawBuffArea':
592 608 //清除缓冲区
593 609 clearOverlayArray(xlPolyline.buffs);
594 610 xlPolyline.buffs = [];
595   - if(this.checked)
596   - drawBuffArea(lineCode, upDown,linesVersion);
  611 + if (this.checked)
  612 + drawBuffArea(lineCode, upDown, linesVersion);
597 613 break;
598 614 case 'drawPoint':
599 615 //清除站点
600 616 clearOverlayArray(xlPolyline.zdMarkers);
601 617 xlPolyline.zdMarkers = [];
602   - if(this.checked)
603   - drawStationMarkers(lineCode, upDown,linesVersion);
  618 + if (this.checked)
  619 + drawStationMarkers(lineCode, upDown, linesVersion);
604 620 break;
605 621 }
606 622 });
... ... @@ -615,9 +631,9 @@
615 631 return;
616 632  
617 633 var isrun;
618   - if(runTimer){
  634 + if (runTimer) {
619 635 pause();
620   - isrun=true;
  636 + isrun = true;
621 637 }
622 638  
623 639 var gps = gpsArray[ei];
... ... @@ -629,7 +645,7 @@
629 645 //更新轨迹线条
630 646 trailArray = [];
631 647 var i = 0;
632   - if(ei > 1000)
  648 + if (ei > 1000)
633 649 i = ei - 1000;
634 650 for (; i < ei; i++)
635 651 trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
... ... @@ -641,7 +657,7 @@
641 657 //更新到离站表格
642 658 //重新定位 inoutIndex
643 659 $.each(arrivalData, function (i, obj) {
644   - if(gps.ts<this.in_ts || gps.ts<this.out_ts){
  660 + if (gps.ts < this.in_ts || gps.ts < this.out_ts) {
645 661 inoutIndex = i;
646 662 return false;
647 663 }
... ... @@ -651,7 +667,7 @@
651 667 map.panTo(gpsMarker.getPosition());
652 668  
653 669 index = ei + 1;
654   - if(isrun){
  670 + if (isrun) {
655 671 play();
656 672 fixedToCenter();
657 673 }
... ... @@ -668,31 +684,40 @@
668 684 //更新轨迹线条
669 685 trailArray = [];
670 686 var i = 0;
671   - if(ei > 1000)
  687 + if (ei > 1000)
672 688 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);
  689 + // for (; i < ei; i++)
  690 + // trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
  691 + // updateTrailLine(gpsArray[ei], ei);
676 692  
677 693 //居中
678 694 map.panTo(gpsMarker.getPosition());
679 695 }
680   - function getLineVersionAnddrawCarMarker(gps){
681   - if(lineVersionList.length>0){
  696 +
  697 + function getLineVersionAnddrawCarMarker(gps) {
  698 + if (lineVersionList.length > 0) {
  699 + var isNotLine=0
682 700 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点位
  701 + if(lineVersionList[i].line!=gps.lineId)
  702 + isNotLine++;
  703 + if (lineVersionList[i]&&lineVersionList[i].line==gps.lineId&&(lineVersionList[i].endTime && lineVersionList[i].endTime > gps.timestamp&&lineVersionList[i].startTime && lineVersionList[i].startTime < gps.timestamp||lineVersionList[i].vtime && lineVersionList[i].vtime == 'all')) {
  704 + drawCarMarker(gps, lineVersionList[i].version);//更新GPS点位
  705 + }else if(lineVersionList[i].length == 0){
  706 + drawCarMarker(gps, 0);//除非线路没有版本信息
685 707 }
686 708 }
687   - }else {
688   - drawCarMarker(gps,0);//除非线路没有版本信息
  709 + if(isNotLine==lineVersionList.length){
  710 + drawCarMarker(gps, 0);//除非线路没有正确的版本信息
  711 + }
  712 + } else {
  713 + drawCarMarker(gps, 0);//除非线路没有版本信息
689 714 }
690 715 }
691 716  
692 717 /**
693 718 * 初始化停车场下拉菜单
694 719 */
695   - var parkPolygons={};
  720 + var parkPolygons = {};
696 721 (function (lineCode) {
697 722 //从地图模块获取停车场数据
698 723 var parks = gb_map_spatial_data.carparkArray();
... ... @@ -702,8 +727,8 @@
702 727  
703 728 console.log('parksparks', parks);
704 729 //拼音映射
705   - var searchData=[];
706   - for(var i=0,p;p=parks[i++];){
  730 + var searchData = [];
  731 + for (var i = 0, p; p = parks[i++];) {
707 732 searchData.push({
708 733 code: p.parkCode,
709 734 name: p.parkName,
... ... @@ -715,15 +740,15 @@
715 740 var listWrap = $('.buffer_area_form .parks_list', rightWrap);
716 741 $('.park_list_search_input', rightWrap).on('input', function () {
717 742 var v = $(this).val();
718   - if(!v){
  743 + if (!v) {
719 744 $('li', listWrap).show();
720 745 return;
721 746 }
722 747 v = v.toUpperCase();
723 748 $('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();
  749 + for (var i = 0, obj; obj = searchData[i++];) {
  750 + if (obj.name.indexOf(v) != -1 || obj.fullChars.indexOf(v) != -1 || obj.camelChars.indexOf(v) != -1)
  751 + $('li[data-code="' + obj.code + '"]', listWrap).show();
727 752 }
728 753 });
729 754  
... ... @@ -731,10 +756,13 @@
731 756 $('.buffer_area_form .parks_list>li', rightWrap).on('click', function () {
732 757 var code = $(this).data('code');
733 758  
734   - if(!parkPolygons[code]){
  759 + if (!parkPolygons[code]) {
735 760 var park;
736 761 $.each(parks, function () {
737   - if(this.parkCode==code){park = this;return false;}
  762 + if (this.parkCode == code) {
  763 + park = this;
  764 + return false;
  765 + }
738 766 });
739 767  
740 768 transMultiWGSToBd(park);
... ... @@ -743,13 +771,21 @@
743 771 parkPolygons[code] = polygon;
744 772 //中心点
745 773 var ts = park.gCenterPoint.split(' ')
746   - ,coord = TransGPS.wgsToBD(parseFloat(ts[1]), parseFloat(ts[0]));
  774 + , coord = TransGPS.wgsToBD(parseFloat(ts[1]), parseFloat(ts[0]));
747 775 polygon._centerPoint = new BMap.Point(coord.lng, coord.lat);
748 776 //绘制名称label
749   - var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "red", borderColor: "red", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
  777 + var style = {
  778 + backgroundColor: "rgba(255, 255, 255, 0.69)",
  779 + color: "red",
  780 + borderColor: "red",
  781 + fontSize: "12px",
  782 + height: "16px",
  783 + lineHeight: "16px",
  784 + fontFamily: "微软雅黑"
  785 + }
750 786 var width = park.parkName.length * 12;
751 787 var label = new BMap.Label(park.parkName, {
752   - position:polygon._centerPoint,
  788 + position: polygon._centerPoint,
753 789 offset: new BMap.Size(-(width / 2), -27)
754 790 });
755 791 label.setStyle(style);
... ... @@ -757,16 +793,16 @@
757 793 }
758 794  
759 795 //定位到polygon
760   - var polygon=parkPolygons[code];
  796 + var polygon = parkPolygons[code];
761 797 map.panTo(polygon._centerPoint);
762 798 });
763 799 })();
764 800  
765 801 //初始化线路地图下拉菜单
766 802 (function () {
767   - var opts='';
  803 + var opts = '';
768 804 $.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>';
  805 + 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 806 });
771 807 $('.base_line_list', rightWrap).html(opts);
772 808  
... ... @@ -775,7 +811,7 @@
775 811 var code = $(this).data('code');
776 812 var updown = $(this).data('dir');
777 813 autoChange = false;
778   - drawXlPolyline(code, updown,currentVersion);
  814 + drawXlPolyline(code, updown, currentVersion);
779 815 });
780 816 })();
781 817  
... ... @@ -783,9 +819,9 @@
783 819 function formData() {
784 820 var fs = 'YYYY-MM-DD HH:mm';
785 821 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'));
  822 + nbbm = $('[name=nbbm]', f).val(),
  823 + st = parseInt(moment($('[name=startTime]', f).val(), fs).format('X')),
  824 + et = parseInt(moment($('[name=endTime]', f).val(), fs).format('X'));
789 825  
790 826 return {
791 827 nbbm: nbbm,
... ... @@ -797,52 +833,48 @@
797 833 //轨迹
798 834 $('.export-excel', rightWrap).on('click', function () {
799 835 var d = formData();
800   - window.open('/gps/history_v3/excel/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  836 + window.open('/gps/history_v3/excel/' + d.nbbm + "?st=" + d.st + "&et=" + d.et);
801 837 });
802 838 //异常信息
803 839 $('.export-excel-abnormal', rightWrap).on('click', function () {
804 840 var d = formData();
805   - window.open('/gps/history_v3/excel_abnormal/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  841 + window.open('/gps/history_v3/excel_abnormal/' + d.nbbm + "?st=" + d.st + "&et=" + d.et);
806 842 });
807 843 //到离站
808 844 $('.export-excel-arrival', rightWrap).on('click', function () {
809 845 var d = formData();
810   - window.open('/gps/history_v3/excel_arrival/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  846 + window.open('/gps/history_v3/excel_arrival/' + d.nbbm + "?st=" + d.st + "&et=" + d.et);
811 847 });
812   - function queryIsCircle(line,nbbm,ts,qdzCode){
813   - var lineInfo=0;
  848 +
  849 + function queryIsCircle(line, nbbm, ts, qdzCode) {
  850 + var lineInfo = 0;
814 851 $.ajax({
815 852 url: "/line/findById", //请求地址
816 853 type: "Get",
817   - async:false,
  854 + async: false,
818 855 //请求方式
819   - data: { id : line}, //请求参数
  856 + data: {id: line}, //请求参数
820 857 success: function (result) {
821 858 lineInfo = result.linePlayType;
822 859 }
823 860 });
824   - if (lineInfo!=1)
  861 + if (lineInfo != 1)
825 862 return false;
826   - var stops=0;
827   - if (lineInfo==1) {
  863 + var stops = 0;
  864 + if (lineInfo == 1) {
828 865 $.ajax({
829 866 url: "/realSchedule/isCircleQdz", //请求地址
830 867 type: "POST",
831   - async:false,
  868 + async: false,
832 869 //请求方式
833   - data: { line : line,nbbm:nbbm,ts:ts,qdzCode:qdzCode}, //请求参数
  870 + data: {line: line, nbbm: nbbm, ts: ts, qdzCode: qdzCode}, //请求参数
834 871  
835 872 success: function (result) {
836 873 stops = result.isExist;
837 874 }
838 875 });
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 876 }
845   - if (stops>0)
  877 + if (stops > 0)
846 878 return true;
847 879 return false;
848 880 }
... ...