Commit 97e44ad579f419f19797edb40dfade0b04ff6a94
1 parent
05743b50
弹框修改
Showing
6 changed files
with
96 additions
and
40 deletions
src/main/java/com/bsth/data/zndd/OutEntrance.java
| ... | ... | @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Value; |
| 21 | 21 | import org.springframework.web.bind.annotation.*; |
| 22 | 22 | import java.io.*; |
| 23 | 23 | import java.text.SimpleDateFormat; |
| 24 | +import java.time.Duration; | |
| 24 | 25 | import java.time.LocalTime; |
| 25 | 26 | import java.time.format.DateTimeFormatter; |
| 26 | 27 | import java.util.*; |
| ... | ... | @@ -170,11 +171,15 @@ public class OutEntrance { |
| 170 | 171 | } |
| 171 | 172 | }); |
| 172 | 173 | ScheduleRealInfo schedule = null; |
| 174 | + ScheduleRealInfo schedule2 = null; | |
| 173 | 175 | for (int i1 = 0; i1 < sl.size(); i1++) {//最近的已发车班次 |
| 174 | 176 | ScheduleRealInfo scheduleRealInfo=sl.get(i1); |
| 175 | 177 | LocalTime fcsj=LocalTime.parse(scheduleRealInfo.getFcsj(),dateTimeFormatter); |
| 176 | - if((scheduleRealInfo.getBcType().equals("normal")||scheduleRealInfo.getBcType().equals("region")) &&scheduleRealInfo.getXlDir().equals(dir) && fcsj.isAfter(localTime)){ | |
| 177 | - schedule =sl.get(i1-1);; | |
| 178 | + if(fcsj.isAfter(localTime)){ | |
| 179 | + schedule =sl.get(i1-1); | |
| 180 | + if(i1<sl.size()){ | |
| 181 | + schedule2 =sl.get(i1); | |
| 182 | + } | |
| 178 | 183 | break; |
| 179 | 184 | } |
| 180 | 185 | } |
| ... | ... | @@ -185,6 +190,14 @@ public class OutEntrance { |
| 185 | 190 | m.put("rq",localTime.format(dateTimeFormatter)); //检测到时间 |
| 186 | 191 | m.put("ids",AutomaticSch.UUID()); |
| 187 | 192 | m.put("type","KLYJ"); |
| 193 | + LocalTime fcsj = LocalTime.parse(schedule2.getDfsj(),DateTimeFormatter.ofPattern("HH:mm")); | |
| 194 | + LocalTime now = LocalTime.now(); | |
| 195 | + if(Duration.between(now,fcsj).toMinutes()==0){ | |
| 196 | + m.put("msg","下一个班次即将发车"); | |
| 197 | + }else { | |
| 198 | + m.put("msg","下一个班次预计还有"+ Duration.between(now,fcsj).toMinutes() +"分钟发车"); | |
| 199 | + } | |
| 200 | + | |
| 188 | 201 | sendUtils.klyj(m); |
| 189 | 202 | } |
| 190 | 203 | ... | ... |
src/main/resources/static/real_control_v2/js/stationcf/klyj.js
| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | * 站点催发 |
| 3 | 3 | */ |
| 4 | 4 | var gb_klyj = (function () { |
| 5 | - var $wrap = $('.multi_plat_msg_pop_klyj'); | |
| 6 | - var max = 1; | |
| 5 | + var $wrap = $('.multi_plat_msg_pop_zndd'); | |
| 6 | + var max = 3; | |
| 7 | 7 | var dataMap = new Map(); |
| 8 | 8 | var popcf = function (data) { |
| 9 | 9 | dataMap.set(data.uuid,data); |
| ... | ... | @@ -12,9 +12,11 @@ var gb_klyj = (function () { |
| 12 | 12 | var stm = moment(data.instructionsTime); |
| 13 | 13 | data.timeStr = stm.format('HH时mm分ss秒'); |
| 14 | 14 | var htmlStr = template('klyj_plat_msg_template', data); |
| 15 | - var items = $wrap.find('.multi_plat_msg_pops'), len = items.length; | |
| 16 | - if (len >= max) | |
| 17 | - return | |
| 15 | + var items = $wrap.find('.multi_plat_config'), len = items.length; | |
| 16 | + if (len >= max){ | |
| 17 | + $wrap.find('.multi_plat_config:lt(' + (len - max) + ')').remove(); | |
| 18 | + } | |
| 19 | + | |
| 18 | 20 | |
| 19 | 21 | var $modal = $('#schedule-addsch-modal'); |
| 20 | 22 | if (!$modal.hasClass('uk-open')) { |
| ... | ... | @@ -37,11 +39,29 @@ var gb_klyj = (function () { |
| 37 | 39 | }); |
| 38 | 40 | |
| 39 | 41 | var close = true; //关闭弹出框的时候不弹出 |
| 40 | - $wrap.on('click', '.multi_plat_msg_pops .msg-times', function () { | |
| 42 | + $wrap.on('click', '.multi_plat_config .msg-times', function () { | |
| 41 | 43 | $(this).parent().parent().remove(); |
| 42 | 44 | /*if (close) close = false*/ |
| 43 | 45 | }); |
| 44 | 46 | |
| 47 | + $wrap.on('click', '.images', function () { | |
| 48 | + var image = $(this).data('image'); | |
| 49 | + var imgHtml = "<img src='" + image + "' style='width: " + 600 + "px;height:" + 300 + "px'/>"; | |
| 50 | + layer.open({ | |
| 51 | + type: 1, | |
| 52 | + offset: 'auto', | |
| 53 | + area: [600 + 'px', 300 + 'px'], | |
| 54 | + shadeClose: true,//点击外围关闭弹窗 | |
| 55 | + scrollbar: true,//不现实滚动条 | |
| 56 | + title: false, //不显示标题 | |
| 57 | + content: imgHtml, //捕获的元素,注意:最好该指定的元素要存放在body最外层,否则可能被其它的相对元素所影响 | |
| 58 | + cancel: function () { | |
| 59 | + | |
| 60 | + } | |
| 61 | + }) | |
| 62 | + | |
| 63 | + }); | |
| 64 | + | |
| 45 | 65 | return { |
| 46 | 66 | popcf: popcf |
| 47 | 67 | } | ... | ... |
src/main/resources/static/real_control_v2/js/stationcf/stationcf.js
| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | * 站点催发 |
| 3 | 3 | */ |
| 4 | 4 | var gb_stationcf = (function () { |
| 5 | - var $wrap = $('.multi_plat_msg_pop_cf'); | |
| 6 | - var max = 5; | |
| 5 | + var $wrap = $('.multi_plat_msg_pop_zndd'); | |
| 6 | + var max = 3; | |
| 7 | 7 | |
| 8 | 8 | var popcf = function (data) { |
| 9 | 9 | //时间格式化 |
| ... | ... | @@ -16,9 +16,9 @@ var gb_stationcf = (function () { |
| 16 | 16 | /* gb_svg_chart.people(data.lineCode,stopNo,data.num,data.image);*/ |
| 17 | 17 | |
| 18 | 18 | var htmlStr = template('cf_plat_msg_template', data); |
| 19 | - var items = $wrap.find('.multi_plat_msg_pops'), len = items.length; | |
| 19 | + var items = $wrap.find('.multi_plat_config'), len = items.length; | |
| 20 | 20 | if (len >= max) |
| 21 | - $wrap.find('.multi_plat_msg_pops:lt(' + (len - max) + ')').remove(); | |
| 21 | + $wrap.find('.multi_plat_config:lt(' + (len - max) + ')').remove(); | |
| 22 | 22 | |
| 23 | 23 | $wrap.append(htmlStr); |
| 24 | 24 | }; |
| ... | ... | @@ -49,7 +49,7 @@ var gb_stationcf = (function () { |
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | 51 | var close = true; //关闭弹出框的时候不弹出 |
| 52 | - $wrap.on('click', '.multi_plat_msg_pops .msg-times', function () { | |
| 52 | + $wrap.on('click', '.multi_plat_config .msg-times', function () { | |
| 53 | 53 | $(this).parent().parent().remove(); |
| 54 | 54 | /*if (close) close = false*/ |
| 55 | 55 | }); | ... | ... |
src/main/resources/static/real_control_v2/js/zndd/data_zndd.js
| 1 | 1 | var gb_dataZndd = (function (){ |
| 2 | 2 | |
| 3 | - var max = 1; | |
| 3 | + var max = 3; | |
| 4 | 4 | var $pop =$('.multi_plat_msg_pop_zndd'); |
| 5 | 5 | |
| 6 | 6 | var codes = { |
| ... | ... | @@ -356,9 +356,11 @@ var gb_dataZndd = (function (){ |
| 356 | 356 | } |
| 357 | 357 | });*/ |
| 358 | 358 | } else if (type == "KLYJ"){ |
| 359 | - open_modal("/real_control_v2/zndd/type/dkl.html", { | |
| 360 | - data: data | |
| 361 | - }, {center: true, bgclose: false, modal: true}); | |
| 359 | + if(!$('#schedule-addsch-modal').hasClass('uk-open')){ | |
| 360 | + open_modal("/real_control_v2/zndd/type/dkl.html", { | |
| 361 | + data: data | |
| 362 | + }, {center: true, bgclose: false, modal: true}); | |
| 363 | + } | |
| 362 | 364 | } |
| 363 | 365 | } |
| 364 | 366 | function checkTime(i){ //将0-9的数字前面加上0,例1变为01 | ... | ... |
src/main/resources/static/real_control_v2/main.html
| ... | ... | @@ -260,18 +260,25 @@ |
| 260 | 260 | </div> |
| 261 | 261 | </script> |
| 262 | 262 | <div class="multi_plat_msg_pop_cf" ></div> |
| 263 | -<script id="cf_plat_msg_template" type="text/html"> | |
| 264 | - <div class="multi_plat_msg_pops uk-animation-slide-bottom" data-type="{{type}}" > | |
| 265 | - <div> | |
| 266 | - <div class="msg-times" style="cursor: pointer;" >x</div> | |
| 267 | - <span class="reminder">催发</span> | |
| 268 | - <span class="tests">{{lineName}}</span> | |
| 269 | - <span class="tests">{{stationName}}——{{dir == 0 ? '上行':'下行'}}</span> | |
| 270 | - <span class="tests">站点人数 {{num}}</span> | |
| 271 | - <span class="time">催发时间:{{timeStr}}</span> | |
| 263 | + | |
| 264 | +<script id="cf_plat_msg_template" type="text/html"> | |
| 265 | + <div class="multi_plat_config" data-type="{{type}}"> | |
| 266 | + <div class="msg-popup warning-color"> | |
| 267 | + <div class="msg-times" style="cursor: pointer;">×</div> | |
| 268 | + <div class="centerSpace msg-title" style="color: red"> | |
| 269 | + 催发 | |
| 270 | + </div> | |
| 271 | + <div class="popup-msg-content"> | |
| 272 | + <span>{{lineName}} {{dir == 0 ? '上行':'下行'}} {{stationName}}</span> | |
| 273 | + </div> | |
| 274 | + <div class="popup-msg-content"> | |
| 275 | + <span>站点人数 {{num}} 催发时间 {{timeStr}}</span> | |
| 276 | + </div> | |
| 277 | + <div class="popup-msg-contents" > | |
| 278 | + <button class="uk-button uk-button-primary all" data-call="{{calleeId}}" data-ip="{{dir}}" value="{{dir}}">拨打站台电话</button> | |
| 279 | + <button class="uk-button uk-button-primary images" data-image="{{image}}" value="{{dir}}">查看图片</button> | |
| 280 | + </div> | |
| 272 | 281 | </div> |
| 273 | - <button class="all uk-button uk-modal-close" class="title" data-call="{{calleeId}}" data-ip="{{dir}}" value="{{dir}}">拨打站台电话</button> | |
| 274 | - <button class="images uk-button uk-modal-close" data-image="{{image}}" value="{{dir}}">查看图片</button> | |
| 275 | 282 | </div> |
| 276 | 283 | </script> |
| 277 | 284 | <!-- #### 智能调度 start ### --> |
| ... | ... | @@ -309,19 +316,25 @@ |
| 309 | 316 | </div> |
| 310 | 317 | |
| 311 | 318 | <div class="multi_plat_msg_pop_klyj" ></div> |
| 312 | -<script id="klyj_plat_msg_template" type="text/html"> | |
| 313 | - <div class="multi_plat_msg_pops uk-animation-slide-bottom " data-type="{{type}}" data-uuid="{{uuid}}" > | |
| 319 | +<script id="klyj_plat_msg_template" type="text/html"> | |
| 320 | + <div class="multi_plat_config" data-type="{{type}}" data-uuid="{{uuid}}"> | |
| 314 | 321 | <div id ={{uuid}} class="timer"></div> |
| 315 | - <div> | |
| 316 | - <div class="msg-times" style="cursor: pointer;" >x</div> | |
| 317 | - <span class="reminder">大客流预警</span> | |
| 318 | - <span class="tests">{{lineName}}</span> | |
| 319 | - <span class="tests">{{stationName}}——{{dir == 0 ? '上行':'下行'}}</span> | |
| 320 | - <span class="tests">站点人数 {{num}}</span> | |
| 321 | - <span class="time">预警时间:{{timeStr}}</span> | |
| 322 | + <div class="msg-popup warning-color"> | |
| 323 | + <div class="msg-times" style="cursor: pointer;">×</div> | |
| 324 | + <div class="centerSpace msg-title" style="color: red"> | |
| 325 | + 大客流预警 | |
| 326 | + </div> | |
| 327 | + <div class="popup-msg-content"> | |
| 328 | + <span>{{lineName}} {{dir == 0 ? '上行':'下行'}} {{stationName}}</span> | |
| 329 | + </div> | |
| 330 | + <div class="popup-msg-content"> | |
| 331 | + <span>站点人数 {{num}} 预警时间 {{timeStr}}</span> | |
| 332 | + </div> | |
| 333 | + <div class="popup-msg-contents" > | |
| 334 | + <button class="uk-button uk-button-primary images" data-image="{{image}}" value="{{dir}}">查看图片</button> | |
| 335 | + <button class="uk-button uk-button-primary ljbc" data-uuid="{{uuid}}" data-linecode="{{sch.xlBm}}" data-id="{{sch.id}}">临加班次</button> | |
| 336 | + </div> | |
| 322 | 337 | </div> |
| 323 | - <button class="images uk-button uk-modal-close" data-image="{{image}}" value="{{dir}}">查看图片</button> | |
| 324 | - <button class="ljbc uk-button uk-modal-close" data-uuid="{{uuid}}" data-linecode="{{sch.xlBm}}" data-id="{{sch.id}}">临加班次</button> | |
| 325 | 338 | </div> |
| 326 | 339 | </script> |
| 327 | 340 | ... | ... |
src/main/resources/static/real_control_v2/zndd/type/dkl.html
| ... | ... | @@ -118,6 +118,8 @@ |
| 118 | 118 | |
| 119 | 119 | $.post('/logZndd/thissch/'+sch.sch.id, function(res) { |
| 120 | 120 | //to and fro |
| 121 | + res.zdsjActual = moment(new Date().getTime() +(1000 * 60 *5)).format("HH:mm"); | |
| 122 | + res.zdsj = moment(new Date().getTime() + (1000 * 60 * 5)).format("HH:mm"); | |
| 121 | 123 | $('.toAndFroCont', modal).html(st_doms.two_way_dom) |
| 122 | 124 | .trigger('init', {sch: res, submitFun: submit_temp_schedule_form, stationRoutes: stationRoutes}); |
| 123 | 125 | |
| ... | ... | @@ -494,7 +496,6 @@ |
| 494 | 496 | </div> |
| 495 | 497 | </div> |
| 496 | 498 | </div> |
| 497 | - | |
| 498 | 499 | <div class="uk-grid"> |
| 499 | 500 | <div class="uk-width-2-2"> |
| 500 | 501 | <div class="uk-form-row"> |
| ... | ... | @@ -502,6 +503,13 @@ |
| 502 | 503 | </div> |
| 503 | 504 | </div> |
| 504 | 505 | </div> |
| 506 | + <div class="uk-grid"> | |
| 507 | + <div class="uk-width-4-2"> | |
| 508 | + <div class="uk-form-row"> | |
| 509 | + <label class="uk-form-labels" ><h3>{{msg}}</h3></label> | |
| 510 | + </div> | |
| 511 | + </div> | |
| 512 | + </div> | |
| 505 | 513 | </div> |
| 506 | 514 | </script> |
| 507 | 515 | ... | ... |