Commit 424d2ba5f936b9757636f7e4d4703a7919c5670f
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
13 changed files
with
177 additions
and
73 deletions
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
| ... | ... | @@ -56,9 +56,9 @@ public class GpsRealData implements CommandLineRunner { |
| 56 | 56 | public void run(String... arg0) throws Exception { |
| 57 | 57 | logger.info("gpsDataLoader,20,5"); |
| 58 | 58 | //定时从网关获取GPS数据 |
| 59 | - //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 15, TimeUnit.SECONDS); | |
| 59 | + //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS); | |
| 60 | 60 | //定时扫描掉离线 |
| 61 | - //Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 60, 20, TimeUnit.SECONDS); | |
| 61 | + //Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | ... | ... |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| ... | ... | @@ -28,7 +28,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI |
| 28 | 28 | @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)") |
| 29 | 29 | List<ScheduleRealInfo> queryUserInfo(String line,String date); |
| 30 | 30 | |
| 31 | - @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)") | |
| 31 | + @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName,s.sGh,s.sName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName,s.sGh,s.sName order by (lpName+1)") | |
| 32 | 32 | List<ScheduleRealInfo> queryUserInfo2(String line,String date); |
| 33 | 33 | |
| 34 | 34 | @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ") | ... | ... |
src/main/resources/application-dev.properties
| ... | ... | @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy |
| 8 | 8 | spring.jpa.database= MYSQL |
| 9 | 9 | spring.jpa.show-sql= false |
| 10 | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | -spring.datasource.url= jdbc:mysql://192.168.168.201/:3306/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 11 | +spring.datasource.url= jdbc:mysql://localhost:3306/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false | |
| 12 | 12 | spring.datasource.username= root |
| 13 | -spring.datasource.password= 123456 | |
| 13 | +spring.datasource.password= root | |
| 14 | 14 | #DATASOURCE |
| 15 | 15 | spring.datasource.max-active=100 |
| 16 | 16 | spring.datasource.max-idle=8 | ... | ... |
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| ... | ... | @@ -44,7 +44,7 @@ |
| 44 | 44 | </div> |
| 45 | 45 | <div class="portlet-body"> |
| 46 | 46 | <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;height: 400px"> |
| 47 | - <label>早高峰:6:31~8:30 晚高峰:16:01~18:00</label> | |
| 47 | + <label>日期:<span id="rqxs"></span> 早高峰:6:31~8:30 晚高峰:16:01~18:00</label> | |
| 48 | 48 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 49 | 49 | <thead> |
| 50 | 50 | <tr> |
| ... | ... | @@ -281,11 +281,37 @@ |
| 281 | 281 | var xlName = $("#select2-line-container").html(); |
| 282 | 282 | var date = $("#date").val(); |
| 283 | 283 | |
| 284 | + function getTime(list){ | |
| 285 | + $.each(list, function(i, obj) { | |
| 286 | + if(obj.zdsj != null && obj.zdsjActual != null ){ | |
| 287 | + var zdsjActual = (obj.zdsjActual).split(":"); | |
| 288 | + var zdsj = (obj.zdsj).split(":"); | |
| 289 | + if(zdsjActual[0]*60+Number(zdsjActual[1]) > zdsj[0]*60+Number(zdsj[1])){ | |
| 290 | + obj["slow"] = (zdsjActual[0]*60+Number(zdsjActual[1])) - (zdsj[0]*60+Number(zdsj[1])); | |
| 291 | + } | |
| 292 | + else if(zdsjActual[0]*60+Number(zdsjActual[1]) < zdsj[0]*60+Number(zdsj[1])){ | |
| 293 | + obj["fast"] = (zdsj[0]*60+Number(zdsj[1])) - (zdsjActual[0]*60+Number(zdsjActual[1])); | |
| 294 | + } | |
| 295 | + } | |
| 296 | + | |
| 297 | + if(obj.fcsj != null && obj.fcsjActual != null ){ | |
| 298 | + var fcsjActual = (obj.fcsjActual).split(":"); | |
| 299 | + var fcsj = (obj.fcsj).split(":"); | |
| 300 | + if(fcsjActual[0]*60+Number(fcsjActual[1]) > fcsj[0]*60+Number(fcsj[1])){ | |
| 301 | + obj["slow0"] = (fcsjActual[0]*60+Number(fcsjActual[1])) - (fcsj[0]*60+Number(fcsj[1])); | |
| 302 | + } | |
| 303 | + else if(fcsjActual[0]*60+Number(fcsjActual[1]) < fcsj[0]*60+Number(fcsj[1])){ | |
| 304 | + obj["fast0"] = (fcsj[0]*60+Number(fcsj[1])) - (fcsjActual[0]*60+Number(fcsjActual[1])); | |
| 305 | + } | |
| 306 | + } | |
| 307 | + }); | |
| 308 | + } | |
| 284 | 309 | //查询 |
| 285 | 310 | $("#query").on('click',function(){ |
| 286 | 311 | line = $("#line").val(); |
| 287 | 312 | xlName = $("#select2-line-container").html(); |
| 288 | 313 | date = $("#date").val(); |
| 314 | + $("#rqxs").html(date); | |
| 289 | 315 | if(date == null || date.length == 0){ |
| 290 | 316 | layer.msg("请选择时间"); |
| 291 | 317 | return; |
| ... | ... | @@ -297,10 +323,12 @@ |
| 297 | 323 | $('#forms .scheduleDaily_1').html(scheduleDaily_1); |
| 298 | 324 | }); |
| 299 | 325 | $.get('/realSchedule/queryUserInfo',{line:line,date:date,state:2,type:"query"},function(result){ |
| 326 | + console.log(result); | |
| 300 | 327 | var scheduleDaily_2 = template('scheduleDaily_2',{list:result}); |
| 301 | 328 | $('#forms .scheduleDaily_2').html(scheduleDaily_2); |
| 302 | 329 | }); |
| 303 | 330 | $.get('/realSchedule/realScheduleList',{line:line,date:date,type:"query"},function(result){ |
| 331 | + getTime(result); | |
| 304 | 332 | var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); |
| 305 | 333 | $('#forms .scheduleDaily_3').html(scheduleDaily_3); |
| 306 | 334 | }); |
| ... | ... | @@ -405,7 +433,12 @@ |
| 405 | 433 | <td colspan="2">{{obj[3]}}</td> |
| 406 | 434 | <td colspan="2">{{obj[2]}}</td> |
| 407 | 435 | <td>{{obj[1]}}/{{obj[4]}}</td> |
| 408 | - <td> </td> | |
| 436 | + <td>{{if obj[5] !=null}} | |
| 437 | + {{obj[5]}}/ | |
| 438 | + {{obj[6]}} | |
| 439 | + | |
| 440 | + {{/if}} | |
| 441 | + </td> | |
| 409 | 442 | <td> </td> |
| 410 | 443 | <td> </td> |
| 411 | 444 | {{if (i+1)%5 == 0}} |
| ... | ... | @@ -427,12 +460,12 @@ |
| 427 | 460 | <td colspan="2">{{obj.qdzName}}</td> |
| 428 | 461 | <td>{{obj.zdsj}}</td> |
| 429 | 462 | <td>{{obj.zdsjActual}}</td> |
| 430 | - <td> </td> | |
| 431 | - <td> </td> | |
| 463 | + <td>{{obj.fast}}</td> | |
| 464 | + <td>{{obj.slow}}</td> | |
| 432 | 465 | <td>{{obj.fcsj}}</td> |
| 433 | 466 | <td>{{obj.fcsjActual}}</td> |
| 434 | - <td> </td> | |
| 435 | - <td> </td> | |
| 467 | + <td>{{obj.fast0}}</td> | |
| 468 | + <td>{{obj.slow0}}</td> | |
| 436 | 469 | <td colspan="2">{{obj.remarks}}</td> |
| 437 | 470 | {{if (i+1)%3 == 0}} |
| 438 | 471 | <td> </td> | ... | ... |
src/main/resources/static/pages/forms/statement/waybill.html
| ... | ... | @@ -313,7 +313,10 @@ |
| 313 | 313 | <tr> |
| 314 | 314 | <td>{{obj.adjustExps}}</td> |
| 315 | 315 | <td>{{obj.jGh}}{{obj.jName}}</td> |
| 316 | - <td>{{obj.sGh}}{{obj.sName}}</td> | |
| 316 | + <td>{{if obj.sGh !=null}} | |
| 317 | + {{obj.sGh}}{{obj.sName}} | |
| 318 | + {{/if}} | |
| 319 | + </td> | |
| 317 | 320 | <td> </td> |
| 318 | 321 | <td>{{obj.qdzName}}</td> |
| 319 | 322 | <td>{{obj.zdzName}}</td> | ... | ... |
src/main/resources/static/pages/forms/statement/waybillQp.html
| ... | ... | @@ -308,7 +308,12 @@ |
| 308 | 308 | <td>{{i+1}}</td> |
| 309 | 309 | <td>{{obj.lpName}}</td> |
| 310 | 310 | <td>{{obj.jGh}}{{obj.jName}}</td> |
| 311 | - <td>{{obj.sGh}}{{obj.sName}}</td> | |
| 311 | + <td> | |
| 312 | + {{if obj.sGh !=null}} | |
| 313 | + {{obj.sGh}} | |
| 314 | + {{obj.sName}} | |
| 315 | + {{/if}} | |
| 316 | + </td> | |
| 312 | 317 | <td> </td> |
| 313 | 318 | <td>{{obj.qdzName}}</td> |
| 314 | 319 | <td>{{obj.zdzName}}</td> | ... | ... |
src/main/resources/static/real_control_v2/css/home.css
| ... | ... | @@ -61,7 +61,7 @@ |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | .home-gps-table { |
| 64 | - width: 620px; | |
| 64 | + width: 640px; | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | .home-gps-table small { |
| ... | ... | @@ -74,31 +74,35 @@ |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | .home-gps-table dl dt:nth-of-type(2), .home-gps-table dl dd:nth-of-type(2) { |
| 77 | - width: 8% | |
| 77 | + width: 7% | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | .home-gps-table dl dt:nth-of-type(3), .home-gps-table dl dd:nth-of-type(3) { |
| 81 | - width: 8% | |
| 81 | + width: 7% | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | .home-gps-table dl dt:nth-of-type(4), .home-gps-table dl dd:nth-of-type(4) { |
| 85 | - width: 8%; | |
| 85 | + width: 7% | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | .home-gps-table dl dt:nth-of-type(5), .home-gps-table dl dd:nth-of-type(5) { |
| 89 | - width: 17% | |
| 89 | + width: 7%; | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | .home-gps-table dl dt:nth-of-type(6), .home-gps-table dl dd:nth-of-type(6) { |
| 93 | - width: 17% | |
| 93 | + width: 16% | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | .home-gps-table dl dt:nth-of-type(7), .home-gps-table dl dd:nth-of-type(7) { |
| 97 | - width: 10% | |
| 97 | + width: 16% | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | .home-gps-table dl dt:nth-of-type(8), .home-gps-table dl dd:nth-of-type(8) { |
| 101 | - width: 16%; | |
| 101 | + width: 9% | |
| 102 | +} | |
| 103 | + | |
| 104 | +.home-gps-table dl dt:nth-of-type(9), .home-gps-table dl dd:nth-of-type(9) { | |
| 105 | + width: 15%; | |
| 102 | 106 | border-right: 0; |
| 103 | 107 | } |
| 104 | 108 | ... | ... |
src/main/resources/static/real_control_v2/css/main.css
| ... | ... | @@ -798,12 +798,12 @@ li.map-panel { |
| 798 | 798 | |
| 799 | 799 | |
| 800 | 800 | svg text.offline{ |
| 801 | - fill: #534e4e !important; | |
| 801 | + fill: #6f6a6a !important; | |
| 802 | 802 | } |
| 803 | 803 | |
| 804 | 804 | svg rect.offline{ |
| 805 | - stroke: #abaaaa !important; | |
| 806 | - fill: #b8b8b8 !important; | |
| 805 | + stroke: #dbdada !important; | |
| 806 | + fill: #dbdada !important; | |
| 807 | 807 | } |
| 808 | 808 | |
| 809 | 809 | .tooltip .tooltip-container .title a>.abnormal-text{ | ... | ... |
src/main/resources/static/real_control_v2/fragments/home/line_panel.html
| ... | ... | @@ -9,6 +9,7 @@ |
| 9 | 9 | <div class="ct_table_head"> |
| 10 | 10 | <dl> |
| 11 | 11 | <dt>车辆编码</dt> |
| 12 | + <dt>路牌</dt> | |
| 12 | 13 | <dt>速度</dt> |
| 13 | 14 | <dt>终点</dt> |
| 14 | 15 | <dt>状态</dt> |
| ... | ... | @@ -27,6 +28,7 @@ |
| 27 | 28 | <script id="home-gps-tbody-temp" type="text/html"> |
| 28 | 29 | <dl id="home_gps_{{deviceId}}" data-device-id="{{deviceId}}" {{if abnormalStatus=='offline'}}class="offline"{{/if}}> |
| 29 | 30 | <dd title="{{nbbm}}"><a>{{nbbm}}</a></dd> |
| 31 | + <dd></dd> | |
| 30 | 32 | <dd>{{speed}}</dd> |
| 31 | 33 | <dd>{{expectStopTime}}</dd> |
| 32 | 34 | <dd> | ... | ... |
src/main/resources/static/real_control_v2/fragments/home/tooltip.html
| 1 | 1 | <div> |
| 2 | 2 | <script id="tooltip_gps_temp" type="text/html"> |
| 3 | - <div class="tooltip" > | |
| 3 | + <div class="tooltip" data-id="{{deviceId}}"> | |
| 4 | 4 | <div class="tooltip-container"> |
| 5 | - <div class="title"> | |
| 6 | - <a href="javascript:;" data-for="station" class="tip_modal"> | |
| 7 | - {{nbbm}} | |
| 8 | - {{if abnormalStatus == 'outBounds'}} | |
| 5 | + | |
| 6 | + <div class="cont-text-panel"> | |
| 7 | + <div class="title"> | |
| 8 | + <a href="javascript:;" data-for="station" class="tip_modal"> | |
| 9 | + {{nbbm}} | |
| 10 | + {{if abnormalStatus == 'outBounds'}} | |
| 9 | 11 | <span class="abnormal-text">越界</span> |
| 10 | - {{else if abnormalStatus == 'overspeed'}} | |
| 12 | + {{else if abnormalStatus == 'overspeed'}} | |
| 11 | 13 | <span class="abnormal-text">超速</span> |
| 12 | - {{else if abnormalStatus == 'gps-offline'}} | |
| 14 | + {{else if abnormalStatus == 'gps-offline'}} | |
| 13 | 15 | <span class="abnormal-text">GPS掉线</span> |
| 14 | - {{else if abnormalStatus == 'offline'}} | |
| 16 | + {{else if abnormalStatus == 'offline'}} | |
| 15 | 17 | <span class="abnormal-text">已离线</span> |
| 16 | - {{/if}} | |
| 17 | - </a> | |
| 18 | - </div> | |
| 19 | - <div> | |
| 20 | - <span class="field">站点:</span>{{stationName}} | |
| 21 | - </div> | |
| 22 | - <!-- <div> | |
| 23 | - {{lineName}} -{{if upDown==0}}上行{{else}}下行{{/if}} | |
| 24 | - </div> --> | |
| 25 | - <div> | |
| 26 | - <span class="field">设备:</span>{{deviceId}} | |
| 18 | + {{/if}} | |
| 19 | + </a> | |
| 20 | + </div> | |
| 21 | + <div> | |
| 22 | + <span class="field">站点:</span>{{stationName}} | |
| 23 | + </div> | |
| 24 | + <!-- <div> | |
| 25 | + {{lineName}} -{{if upDown==0}}上行{{else}}下行{{/if}} | |
| 26 | + </div> --> | |
| 27 | + <div> | |
| 28 | + <span class="field">设备:</span>{{deviceId}} | |
| 29 | + </div> | |
| 30 | + <div> | |
| 31 | + <span class="field">坐标:</span>{{lon}} {{lat}} | |
| 32 | + </div> | |
| 33 | + <div> | |
| 34 | + <span class="field">速度:</span>{{speed}}</div> | |
| 35 | + <div> | |
| 36 | + <span class="field">时间:</span>{{dateStr}}</div> | |
| 37 | + {{if expectStopTime!=null}} | |
| 38 | + <div> | |
| 39 | + 预计 {{expectStopTime}} 分钟到达终点</div> | |
| 40 | + {{/if}} | |
| 27 | 41 | </div> |
| 28 | - <div> | |
| 29 | - <span class="field">坐标:</span>{{lon}} {{lat}} | |
| 30 | - </div> | |
| 31 | - <div> | |
| 32 | - <span class="field">速度:</span>{{speed}}</div> | |
| 33 | - <div> | |
| 34 | - <span class="field">时间:</span>{{dateStr}}</div> | |
| 35 | - {{if expectStopTime!=null}} | |
| 36 | - <div> | |
| 37 | - 预计 {{expectStopTime}} 分钟到达终点</div> | |
| 38 | - {{/if}} | |
| 42 | + | |
| 39 | 43 | <div class="tip_map_wrap"></div> |
| 40 | 44 | </div> |
| 41 | 45 | </div> |
| ... | ... | @@ -60,17 +64,30 @@ |
| 60 | 64 | <div style="color: #747272;"> |
| 61 | 65 | {{gps.dateStr}} |
| 62 | 66 | </div> |
| 63 | - <!--<div> | |
| 64 | - <span class="field">进站时间:</span>? | |
| 65 | - </div> | |
| 66 | - <div> | |
| 67 | - <span class="field">计划发出:</span>? | |
| 68 | - </div>--> | |
| 69 | - | |
| 70 | 67 | </div> |
| 71 | 68 | </div> |
| 72 | 69 | {{/each}} |
| 73 | 70 | </div> |
| 74 | 71 | <div class="tip_map_wrap multi"></div> |
| 75 | 72 | </script> |
| 73 | + | |
| 74 | + | |
| 75 | + <script id="tooltip_multi_gps_cont_temp" type="text/html"> | |
| 76 | + <div class="tooltip-container"> | |
| 77 | + <div class="title"> | |
| 78 | + <a href="javascript:;" data-for="station" class="tip_modal"> | |
| 79 | + {{nbbm}} | |
| 80 | + </a> | |
| 81 | + </div> | |
| 82 | + <div> | |
| 83 | + <span class="field">站点:</span>{{stationName}} | |
| 84 | + </div> | |
| 85 | + <div> | |
| 86 | + <span class="field">设备:</span>{{deviceId}} | |
| 87 | + </div> | |
| 88 | + <div style="color: #747272;"> | |
| 89 | + {{gps.dateStr}} | |
| 90 | + </div> | |
| 91 | + </div> | |
| 92 | + </script> | |
| 76 | 93 | </div> | ... | ... |
src/main/resources/static/real_control_v2/js/home/line_panel.js
| ... | ... | @@ -83,21 +83,23 @@ var gb_home_line_panel = (function() { |
| 83 | 83 | e.removeClass('offline'); |
| 84 | 84 | |
| 85 | 85 | var cells = e.find('dd'); |
| 86 | - $(cells[1]).text(t.speed); | |
| 87 | - $(cells[2]).html(t.expectStopTime == null ? '' : t.expectStopTime); | |
| 86 | + $(cells[2]).text(t.speed); | |
| 87 | + $(cells[3]).html(t.expectStopTime == null ? '' : t.expectStopTime); | |
| 88 | 88 | |
| 89 | 89 | //状态 |
| 90 | - $(cells[3]).html(temps['home-gps-abnormal-temp'](t)); | |
| 90 | + $(cells[4]).html(temps['home-gps-abnormal-temp'](t)); | |
| 91 | 91 | |
| 92 | 92 | if(!t.stationName) |
| 93 | 93 | t.stationName=''; |
| 94 | - $(cells[4]).text(t.stationName).attr('title', t.stationName); | |
| 94 | + $(cells[5]).text(t.stationName).attr('title', t.stationName); | |
| 95 | 95 | |
| 96 | 96 | //班次信息 |
| 97 | 97 | if(t.sch){ |
| 98 | - $(cells[5]).text(t.sch.zdzName); | |
| 99 | - $(cells[6]).text(t.sch.zdsj); | |
| 100 | - $(cells[7]).text(t.sch.jGh + '/' + t.sch.jName); | |
| 98 | + //console.log('t.sch', t.sch); | |
| 99 | + $(cells[1]).text(t.sch.lpName); | |
| 100 | + $(cells[6]).text(t.sch.zdzName); | |
| 101 | + $(cells[7]).text(t.sch.zdsj); | |
| 102 | + $(cells[8]).text(t.sch.jGh + '/' + t.sch.jName); | |
| 101 | 103 | } |
| 102 | 104 | }; |
| 103 | 105 | ... | ... |
src/main/resources/static/real_control_v2/js/utils/svg_chart.js
| ... | ... | @@ -268,8 +268,8 @@ var gb_svg_chart = (function () { |
| 268 | 268 | return true; |
| 269 | 269 | |
| 270 | 270 | abmStatus = this['abnormalStatus']; |
| 271 | + suffix = ''; | |
| 271 | 272 | if(abmStatus != 'offline'){ |
| 272 | - suffix = ''; | |
| 273 | 273 | this['abnormalClaszz'] = true; |
| 274 | 274 | if(abmStatus=='outBounds') |
| 275 | 275 | suffix = '界'; |
| ... | ... | @@ -294,6 +294,9 @@ var gb_svg_chart = (function () { |
| 294 | 294 | //聚合gps |
| 295 | 295 | marker_clusterer(this, lineCode); |
| 296 | 296 | }); |
| 297 | + | |
| 298 | + //刷新tooltip | |
| 299 | + gb_svg_tooltip.refresh(); | |
| 297 | 300 | }; |
| 298 | 301 | |
| 299 | 302 | var draw_gps = function (svg, data) { | ... | ... |
src/main/resources/static/real_control_v2/js/utils/svg_chart_tooltip.js
| ... | ... | @@ -28,7 +28,7 @@ var gb_svg_tooltip = (function () { |
| 28 | 28 | target: rect |
| 29 | 29 | }, |
| 30 | 30 | style: { |
| 31 | - classes: 'qtip-bootstrap' | |
| 31 | + classes: 'qtip-bootstrap qtip-gps-tooltip' | |
| 32 | 32 | }, |
| 33 | 33 | hide: { |
| 34 | 34 | fixed: true, |
| ... | ... | @@ -54,7 +54,7 @@ var gb_svg_tooltip = (function () { |
| 54 | 54 | var rect = $(this); |
| 55 | 55 | //console.log('111', rect,rect.attr('aria-describedby')); |
| 56 | 56 | /*if (rect.attr('aria-describedby')) |
| 57 | - return;*/ | |
| 57 | + return;*/ | |
| 58 | 58 | // var gps = gb_data_gps.findOne($(this).attr('_id').split('_')[1]); |
| 59 | 59 | |
| 60 | 60 | $('.qtip-multi-gps').qtip('destroy', true); |
| ... | ... | @@ -146,7 +146,7 @@ var gb_svg_tooltip = (function () { |
| 146 | 146 | }); |
| 147 | 147 | //draw line routes |
| 148 | 148 | gb_svg_map_util.drawLine(map, list[0]); |
| 149 | - } | |
| 149 | + }; | |
| 150 | 150 | |
| 151 | 151 | function searchByStop(list, stop) { |
| 152 | 152 | var rs = []; |
| ... | ... | @@ -168,7 +168,42 @@ var gb_svg_tooltip = (function () { |
| 168 | 168 | }); |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | + var refresh = function () { | |
| 172 | + //刷新展开的单个tooltip | |
| 173 | + $('.qtip-gps-tooltip .tooltip').each(function () { | |
| 174 | + var deviceId = $(this).data('id') | |
| 175 | + ,wrap = $(this).find('.cont-text-panel'); | |
| 176 | + if(deviceId) | |
| 177 | + gb_svg_tooltip.refreshTooltip(deviceId, wrap); | |
| 178 | + }); | |
| 179 | + | |
| 180 | + //刷新展开的聚合tooltip | |
| 181 | + $('.qtip-multi-gps .multi-tooltip').each(function () { | |
| 182 | + | |
| 183 | + }); | |
| 184 | + }; | |
| 185 | + | |
| 186 | + | |
| 187 | + /** | |
| 188 | + * 刷新单个tooltip | |
| 189 | + * @param deviceId | |
| 190 | + */ | |
| 191 | + var refreshTooltip = function (deviceId, wrap) { | |
| 192 | + var gps = gb_data_gps.findOne(deviceId); | |
| 193 | + | |
| 194 | + var cont = temps['tooltip_gps_temp'](gps); | |
| 195 | + var htmlStr = $(cont).find('.cont-text-panel').html(); | |
| 196 | + | |
| 197 | + $(wrap).html(htmlStr); | |
| 198 | + | |
| 199 | + //更新地图点位 | |
| 200 | + | |
| 201 | + //console.log('refreshTooltip htmlStr', htmlStr, wrap); | |
| 202 | + }; | |
| 203 | + | |
| 171 | 204 | return { |
| 172 | - update: updateFixedTip | |
| 205 | + update: updateFixedTip, | |
| 206 | + refresh: refresh, | |
| 207 | + refreshTooltip: refreshTooltip | |
| 173 | 208 | }; |
| 174 | 209 | })(); | ... | ... |