Commit 51e1e4f0fb212cb6fab68b232e124eba64edf85a
1 parent
61930b9f
update
Showing
9 changed files
with
192 additions
and
96 deletions
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
| @@ -3,6 +3,7 @@ package com.bsth.data.schedule; | @@ -3,6 +3,7 @@ package com.bsth.data.schedule; | ||
| 3 | import com.bsth.data.LineConfigData; | 3 | import com.bsth.data.LineConfigData; |
| 4 | import com.bsth.entity.realcontrol.LineConfig; | 4 | import com.bsth.entity.realcontrol.LineConfig; |
| 5 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 5 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 6 | +import org.apache.commons.lang3.StringUtils; | ||
| 6 | import org.joda.time.format.DateTimeFormat; | 7 | import org.joda.time.format.DateTimeFormat; |
| 7 | import org.joda.time.format.DateTimeFormatter; | 8 | import org.joda.time.format.DateTimeFormatter; |
| 8 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| @@ -115,8 +116,11 @@ public class SchAttrCalculator { | @@ -115,8 +116,11 @@ public class SchAttrCalculator { | ||
| 115 | ScheduleRealInfo prve = list.get(0), curr; | 116 | ScheduleRealInfo prve = list.get(0), curr; |
| 116 | for(int i = 1; i < len; i ++){ | 117 | for(int i = 1; i < len; i ++){ |
| 117 | curr = list.get(i); | 118 | curr = list.get(i); |
| 118 | - if(prve.getZdzName().equals(curr.getQdzName())) | 119 | + if(prve.getZdzName().equals(curr.getQdzName())){ |
| 119 | curr.setQdzArrDateJH(prve.getZdsj()); | 120 | curr.setQdzArrDateJH(prve.getZdsj()); |
| 121 | + if(StringUtils.isNotEmpty(prve.getZdsjActual()) && StringUtils.isEmpty(curr.getQdzArrDatesj())) | ||
| 122 | + curr.setQdzArrDatesj(prve.getZdsjActual()); | ||
| 123 | + } | ||
| 120 | 124 | ||
| 121 | prve = curr; | 125 | prve = curr; |
| 122 | } | 126 | } |
src/main/resources/static/pages/forecast/sample/js/svg.js
| @@ -218,6 +218,8 @@ var sampleSvg = (function(){ | @@ -218,6 +218,8 @@ var sampleSvg = (function(){ | ||
| 218 | 218 | ||
| 219 | //分析path d 路径中间点 | 219 | //分析path d 路径中间点 |
| 220 | function analysePath(d){ | 220 | function analysePath(d){ |
| 221 | + if(!d) | ||
| 222 | + return [-100, -100]; | ||
| 221 | d = d.replace('M', ''); | 223 | d = d.replace('M', ''); |
| 222 | var sp = d.split('L')[0].split(',') | 224 | var sp = d.split('L')[0].split(',') |
| 223 | ,ep = d.split('L')[1].split(',') | 225 | ,ep = d.split('L')[1].split(',') |
src/main/resources/static/real_control_v2/css/line_schedule.css
| @@ -64,6 +64,9 @@ | @@ -64,6 +64,9 @@ | ||
| 64 | .line_schedule .schedule-wrap h3 { | 64 | .line_schedule .schedule-wrap h3 { |
| 65 | margin: 7px 0 5px; | 65 | margin: 7px 0 5px; |
| 66 | text-indent: 5px; | 66 | text-indent: 5px; |
| 67 | + margin: 0; | ||
| 68 | + height: 31px; | ||
| 69 | + line-height: 31px; | ||
| 67 | } | 70 | } |
| 68 | 71 | ||
| 69 | .line_schedule .schedule-wrap.up h3 { | 72 | .line_schedule .schedule-wrap.up h3 { |
| @@ -245,6 +248,7 @@ span.fcsj-diff { | @@ -245,6 +248,7 @@ span.fcsj-diff { | ||
| 245 | .tl-yzx { | 248 | .tl-yzx { |
| 246 | background: #c1ddf0; | 249 | background: #c1ddf0; |
| 247 | border-top: 1px solid #ebebeb !important; | 250 | border-top: 1px solid #ebebeb !important; |
| 251 | + color: #444; | ||
| 248 | } | 252 | } |
| 249 | 253 | ||
| 250 | .tl-xxfc{ | 254 | .tl-xxfc{ |
| @@ -254,15 +258,18 @@ span.fcsj-diff { | @@ -254,15 +258,18 @@ span.fcsj-diff { | ||
| 254 | 258 | ||
| 255 | .tl-wd{ | 259 | .tl-wd{ |
| 256 | background: #caca4f; | 260 | background: #caca4f; |
| 261 | + color: #444; | ||
| 257 | } | 262 | } |
| 258 | 263 | ||
| 259 | .tl-xxsd{ | 264 | .tl-xxsd{ |
| 260 | background: #e2de94; | 265 | background: #e2de94; |
| 266 | + color: #444; | ||
| 261 | } | 267 | } |
| 262 | 268 | ||
| 263 | .tl-xxrd{ | 269 | .tl-xxrd{ |
| 264 | background: #c1ddf0; | 270 | background: #c1ddf0; |
| 265 | border-top: 1px solid #ebebeb !important; | 271 | border-top: 1px solid #ebebeb !important; |
| 272 | + color: #444; | ||
| 266 | } | 273 | } |
| 267 | 274 | ||
| 268 | .tl-qrlb { | 275 | .tl-qrlb { |
| @@ -277,6 +284,7 @@ span.fcsj-diff { | @@ -277,6 +284,7 @@ span.fcsj-diff { | ||
| 277 | 284 | ||
| 278 | .tl-zzzx { | 285 | .tl-zzzx { |
| 279 | background: #96F396; | 286 | background: #96F396; |
| 287 | + color: #444; | ||
| 280 | } | 288 | } |
| 281 | 289 | ||
| 282 | .ct_table>.ct_table_body dl:hover dd.tl-yzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-yzx, .ct_table>.ct_table_body dl:hover dd.tl-zzzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-zzzx { | 290 | .ct_table>.ct_table_body dl:hover dd.tl-yzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-yzx, .ct_table>.ct_table_body dl:hover dd.tl-zzzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-zzzx { |
| @@ -901,4 +909,38 @@ input.i-cbox[type=checkbox]{ | @@ -901,4 +909,38 @@ input.i-cbox[type=checkbox]{ | ||
| 901 | .uk-modal-footer .ct-footer-left a{ | 909 | .uk-modal-footer .ct-footer-left a{ |
| 902 | color: #6e6b6b; | 910 | color: #6e6b6b; |
| 903 | margin-right: 5px; | 911 | margin-right: 5px; |
| 912 | +} | ||
| 913 | + | ||
| 914 | +.fixed_legend{ | ||
| 915 | + font-size: 12px; | ||
| 916 | + display: none; | ||
| 917 | + height: 28px; | ||
| 918 | + border-radius: 4px; | ||
| 919 | + background: #efeeee; | ||
| 920 | + padding-bottom: .5px; | ||
| 921 | + margin-left: 10px; | ||
| 922 | + padding-right: 8px; | ||
| 923 | +} | ||
| 924 | +.fixed_legend>div{ | ||
| 925 | + height: 100%; | ||
| 926 | +} | ||
| 927 | +.fixed_legend span{ | ||
| 928 | + padding: 4px 4px; | ||
| 929 | + border-radius: 2px; | ||
| 930 | + margin-right: 5px; | ||
| 931 | + font-size: 12px; | ||
| 932 | +} | ||
| 933 | + | ||
| 934 | +.fixed_legend span:last-child{ | ||
| 935 | + margin-right: 0px; | ||
| 936 | +} | ||
| 937 | + | ||
| 938 | +/*.fixed_legend i{ | ||
| 939 | + font-size: 16px; | ||
| 940 | + vertical-align: middle; | ||
| 941 | + margin: -3px 3px 0 0; | ||
| 942 | +}*/ | ||
| 943 | + | ||
| 944 | +.fixed_legend .tl-qrlb::before{ | ||
| 945 | + font-size: 12px; | ||
| 904 | } | 946 | } |
| 905 | \ No newline at end of file | 947 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
| @@ -322,8 +322,7 @@ | @@ -322,8 +322,7 @@ | ||
| 322 | name: "添加子任务", | 322 | name: "添加子任务", |
| 323 | items: { | 323 | items: { |
| 324 | 'add_sub_task_in': { | 324 | 'add_sub_task_in': { |
| 325 | - name: '回场', | ||
| 326 | - disabled: true | 325 | + name: '回场' |
| 327 | }, | 326 | }, |
| 328 | 'add_sub_task_out': { | 327 | 'add_sub_task_out': { |
| 329 | name: '出场', | 328 | name: '出场', |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| @@ -8,6 +8,22 @@ | @@ -8,6 +8,22 @@ | ||
| 8 | 下行/{{line.endStationName}} | 8 | 下行/{{line.endStationName}} |
| 9 | {{/if}} | 9 | {{/if}} |
| 10 | <i class="uk-icon-question-circle" ></i> | 10 | <i class="uk-icon-question-circle" ></i> |
| 11 | + <div class="fixed_legend"> | ||
| 12 | + <div> | ||
| 13 | + <!--<i class="uk-icon-angle-right" ></i>--> | ||
| 14 | + <span class="tl-xxfc">消息发出</span> | ||
| 15 | + <span class="tl-xxsd">消息收到</span> | ||
| 16 | + <span class="tl-xxrd">消息阅读</span> | ||
| 17 | + | ||
| 18 | + <span class="tl-wd">误点</span> | ||
| 19 | + <span class="tl-zzzx">正在执行</span> | ||
| 20 | + <span class="tl-qrlb"></span> | ||
| 21 | + <span class="tl-yzx">已执行</span> | ||
| 22 | + <a> | ||
| 23 | + <i class="uk-icon-angle-double-up fixed_legend_close"></i> | ||
| 24 | + </a> | ||
| 25 | + </div> | ||
| 26 | + </div> | ||
| 11 | <div class="search_sch_panel"> | 27 | <div class="search_sch_panel"> |
| 12 | <form class="uk-form" onsubmit="javascript:return false;"> | 28 | <form class="uk-form" onsubmit="javascript:return false;"> |
| 13 | <div class="uk-autocomplete sch-search-autocom"> | 29 | <div class="uk-autocomplete sch-search-autocom"> |
src/main/resources/static/real_control_v2/js/line_schedule/layout.js
| @@ -15,14 +15,13 @@ var gb_line_layout = (function() { | @@ -15,14 +15,13 @@ var gb_line_layout = (function() { | ||
| 15 | var lineCode=$(this).data('id') | 15 | var lineCode=$(this).data('id') |
| 16 | ,svgWrap=$('.footer-chart .svg-wrap', this); | 16 | ,svgWrap=$('.footer-chart .svg-wrap', this); |
| 17 | gb_svg_chart.draw_line(lineCode, svgWrap); | 17 | gb_svg_chart.draw_line(lineCode, svgWrap); |
| 18 | - //console.log('gb_line_layout...', this); | ||
| 19 | - //$('.footer-chart .svg-wrap', this) | ||
| 20 | }); | 18 | }); |
| 21 | 19 | ||
| 22 | cb && cb(); | 20 | cb && cb(); |
| 23 | }); | 21 | }); |
| 24 | }; | 22 | }; |
| 25 | 23 | ||
| 24 | + //图例icon tootip | ||
| 26 | $(document).on('mouseenter', '.schedule-wrap i.uk-icon-question-circle', function() { | 25 | $(document).on('mouseenter', '.schedule-wrap i.uk-icon-question-circle', function() { |
| 27 | $(this).qtip({ | 26 | $(this).qtip({ |
| 28 | show: { | 27 | show: { |
| @@ -49,7 +48,7 @@ var gb_line_layout = (function() { | @@ -49,7 +48,7 @@ var gb_line_layout = (function() { | ||
| 49 | //destroy dom | 48 | //destroy dom |
| 50 | $(this).qtip('destroy', true); | 49 | $(this).qtip('destroy', true); |
| 51 | } | 50 | } |
| 52 | - }// max-width: 335px; | 51 | + } |
| 53 | }); | 52 | }); |
| 54 | }); | 53 | }); |
| 55 | 54 |
src/main/resources/static/real_control_v2/js/line_schedule/legend.js
0 → 100644
| 1 | +/* 图例相关 */ | ||
| 2 | + | ||
| 3 | +var gb_sch_legend = (function () { | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + var animationend = 'webkitAnimationEnd animationend'; | ||
| 7 | + var initLegend = function () { | ||
| 8 | + //双击展开 | ||
| 9 | + $('.schedule-wrap i.uk-icon-question-circle').dblclick(openLegend); | ||
| 10 | + | ||
| 11 | + //关闭事件 | ||
| 12 | + $('.schedule-wrap .fixed_legend_close').on('click', function () { | ||
| 13 | + //隐藏 fixed_legend | ||
| 14 | + $('.schedule-wrap .fixed_legend').each(function () { | ||
| 15 | + var anim = 'uk-animation-slide-top uk-animation-reverse'; | ||
| 16 | + if (!$(this).parents('.header-title').is(':hidden')) { | ||
| 17 | + $(this).addClass(anim).one(animationend, function () { | ||
| 18 | + var icon=$(this).removeClass(anim).hide().parents('.header-title').find('.uk-icon-question-circle'); | ||
| 19 | + | ||
| 20 | + icon.addClass('uk-animation-slide-top').show().one(animationend, function () { | ||
| 21 | + $(this).removeClass('uk-animation-slide-top'); | ||
| 22 | + }); | ||
| 23 | + }); | ||
| 24 | + } | ||
| 25 | + else { | ||
| 26 | + $(this).hide().parents('.header-title').find('.uk-icon-question-circle').show(); | ||
| 27 | + } | ||
| 28 | + }); | ||
| 29 | + }); | ||
| 30 | + }; | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + //展开图例 | ||
| 34 | + var openLegend = function () { | ||
| 35 | + $('.qtip.sch-tl-tip').qtip('destroy', true); | ||
| 36 | + | ||
| 37 | + //隐藏ICON | ||
| 38 | + $('.schedule-wrap i.uk-icon-question-circle').hide(); | ||
| 39 | + | ||
| 40 | + var anim = 'uk-animation-slide-top'; | ||
| 41 | + //显示 fixed_legend | ||
| 42 | + $('.schedule-wrap .fixed_legend').each(function () { | ||
| 43 | + if (!$(this).parents('.header-title').is(':hidden')) { | ||
| 44 | + $(this).addClass(anim).one('webkitAnimationEnd animationend', function () { | ||
| 45 | + $(this).removeClass(anim); | ||
| 46 | + }); | ||
| 47 | + } | ||
| 48 | + }); | ||
| 49 | + $('.schedule-wrap .fixed_legend').css('display', 'inline-block'); | ||
| 50 | + }; | ||
| 51 | + | ||
| 52 | + return { | ||
| 53 | + init: initLegend | ||
| 54 | + }; | ||
| 55 | +})(); | ||
| 0 | \ No newline at end of file | 56 | \ No newline at end of file |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| 1 | /** schedule table */ | 1 | /** schedule table */ |
| 2 | 2 | ||
| 3 | -var gb_schedule_table = (function() { | 3 | +var gb_schedule_table = (function () { |
| 4 | 4 | ||
| 5 | var temps; | 5 | var temps; |
| 6 | //线路分组的班次数据 | 6 | //线路分组的班次数据 |
| 7 | var line2Schedule = {}; | 7 | var line2Schedule = {}; |
| 8 | //车辆应发未发车辆数 | 8 | //车辆应发未发车辆数 |
| 9 | var car_yfwf_map = {}; | 9 | var car_yfwf_map = {}; |
| 10 | - var schedule_sort = function(s1, s2) { | 10 | + var schedule_sort = function (s1, s2) { |
| 11 | return s1.dfsjT - s2.dfsjT; | 11 | return s1.dfsjT - s2.dfsjT; |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | - var show = function(cb) { | 14 | + var show = function (cb) { |
| 15 | //从服务器获取班次数据 | 15 | //从服务器获取班次数据 |
| 16 | $.get('/realSchedule/lines', { | 16 | $.get('/realSchedule/lines', { |
| 17 | lines: gb_data_basic.line_idx | 17 | lines: gb_data_basic.line_idx |
| 18 | - }, function(rs) { | 18 | + }, function (rs) { |
| 19 | for (var lineCode in rs) { | 19 | for (var lineCode in rs) { |
| 20 | //排序 | 20 | //排序 |
| 21 | rs[lineCode].sort(schedule_sort); | 21 | rs[lineCode].sort(schedule_sort); |
| 22 | line2Schedule[lineCode] = {}; | 22 | line2Schedule[lineCode] = {}; |
| 23 | //calc shift | 23 | //calc shift |
| 24 | - $.each(rs[lineCode], function() { | 24 | + $.each(rs[lineCode], function () { |
| 25 | calc_sch_real_shift(this); | 25 | calc_sch_real_shift(this); |
| 26 | line2Schedule[lineCode][this.id] = this; | 26 | line2Schedule[lineCode][this.id] = this; |
| 27 | }); | 27 | }); |
| @@ -32,17 +32,17 @@ var gb_schedule_table = (function() { | @@ -32,17 +32,17 @@ var gb_schedule_table = (function() { | ||
| 32 | }); | 32 | }); |
| 33 | 33 | ||
| 34 | //加载班次表格渲染模板 | 34 | //加载班次表格渲染模板 |
| 35 | - $.get('/real_control_v2/fragments/line_schedule/sch_table.html', function(dom) { | 35 | + $.get('/real_control_v2/fragments/line_schedule/sch_table.html', function (dom) { |
| 36 | ep.emit('temp', gb_common.compileTempByDom(dom, { | 36 | ep.emit('temp', gb_common.compileTempByDom(dom, { |
| 37 | compress: true | 37 | compress: true |
| 38 | })); | 38 | })); |
| 39 | }); | 39 | }); |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | - var ep = EventProxy.create("data", "temp", function(data, temp) { | 42 | + var ep = EventProxy.create("data", "temp", function (data, temp) { |
| 43 | temps = temp; | 43 | temps = temp; |
| 44 | var lineCode, dirData, htmlStr; | 44 | var lineCode, dirData, htmlStr; |
| 45 | - $('#main-tab-content .line_schedule').each(function() { | 45 | + $('#main-tab-content .line_schedule').each(function () { |
| 46 | lineCode = $(this).data('id'); | 46 | lineCode = $(this).data('id'); |
| 47 | if (arrayIsNull(data[lineCode])) | 47 | if (arrayIsNull(data[lineCode])) |
| 48 | return true; | 48 | return true; |
| @@ -64,27 +64,30 @@ var gb_schedule_table = (function() { | @@ -64,27 +64,30 @@ var gb_schedule_table = (function() { | ||
| 64 | gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init); | 64 | gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init); |
| 65 | //dbclick event | 65 | //dbclick event |
| 66 | gb_schedule_table_dbclick.init(); | 66 | gb_schedule_table_dbclick.init(); |
| 67 | - | 67 | + //点击实发,show detail |
| 68 | fcsjActualCellQtip(); | 68 | fcsjActualCellQtip(); |
| 69 | cb && cb(); | 69 | cb && cb(); |
| 70 | + | ||
| 71 | + //图例相关 | ||
| 72 | + gb_sch_legend.init(); | ||
| 70 | }); | 73 | }); |
| 71 | }; | 74 | }; |
| 72 | 75 | ||
| 73 | - function fcsjActualCellQtip(){ | 76 | + function fcsjActualCellQtip() { |
| 74 | //单击实发单元格显示详细信息 | 77 | //单击实发单元格显示详细信息 |
| 75 | $(document).on('click', 'dd.fcsjActualCell', function () { | 78 | $(document).on('click', 'dd.fcsjActualCell', function () { |
| 76 | - var that=this; | 79 | + var that = this; |
| 77 | $(that).qtip({ | 80 | $(that).qtip({ |
| 78 | show: true, | 81 | show: true, |
| 79 | content: { | 82 | content: { |
| 80 | - text: function(e) { | ||
| 81 | - var lineCode=$(that).parents('li.line_schedule').data('id') | ||
| 82 | - ,id=$(that).parents('dl').data('id') | ||
| 83 | - ,sch=line2Schedule[lineCode][id]; | 83 | + text: function (e) { |
| 84 | + var lineCode = $(that).parents('li.line_schedule').data('id') | ||
| 85 | + , id = $(that).parents('dl').data('id') | ||
| 86 | + , sch = line2Schedule[lineCode][id]; | ||
| 84 | return temps['sfsj_sch-detail-temp'](sch); | 87 | return temps['sfsj_sch-detail-temp'](sch); |
| 85 | } | 88 | } |
| 86 | } | 89 | } |
| 87 | - ,style: { | 90 | + , style: { |
| 88 | classes: 'qtip-dark qtip-rounded qtip-shadow' | 91 | classes: 'qtip-dark qtip-rounded qtip-shadow' |
| 89 | }, | 92 | }, |
| 90 | hide: { | 93 | hide: { |
| @@ -103,44 +106,17 @@ var gb_schedule_table = (function() { | @@ -103,44 +106,17 @@ var gb_schedule_table = (function() { | ||
| 103 | } | 106 | } |
| 104 | }); | 107 | }); |
| 105 | }); | 108 | }); |
| 106 | -/* $('dd.fcsjActualCell').qtip({ | ||
| 107 | - show: 'click', | ||
| 108 | - content: { | ||
| 109 | - text: function(e) { | ||
| 110 | - var lineCode=$(e.target).parents('li.line_schedule').data('id') | ||
| 111 | - ,id=$(e.target).parents('dl').data('id') | ||
| 112 | - ,sch=line2Schedule[lineCode][id]; | ||
| 113 | - return temps['sfsj_sch-detail-temp'](sch); | ||
| 114 | - } | ||
| 115 | - } | ||
| 116 | - ,style: { | ||
| 117 | - classes: 'qtip-dark qtip-rounded qtip-shadow' | ||
| 118 | - }, | ||
| 119 | - hide: { | ||
| 120 | - fixed: true, | ||
| 121 | - delay: 300 | ||
| 122 | - }, | ||
| 123 | - position: { | ||
| 124 | - my: 'center left', | ||
| 125 | - at: 'center right' | ||
| 126 | - }, | ||
| 127 | - events: { | ||
| 128 | - hidden: function (event, api) { | ||
| 129 | - $(this).qtip('destroy', true); | ||
| 130 | - } | ||
| 131 | - } | ||
| 132 | - });*/ | ||
| 133 | } | 109 | } |
| 134 | 110 | ||
| 135 | //重置序号 | 111 | //重置序号 |
| 136 | - var reset_seq_no = function(dls) { | ||
| 137 | - dls.each(function(i, dl) { | 112 | + var reset_seq_no = function (dls) { |
| 113 | + dls.each(function (i, dl) { | ||
| 138 | $('dd:eq(0)', dl).text(i + 1); | 114 | $('dd:eq(0)', dl).text(i + 1); |
| 139 | }); | 115 | }); |
| 140 | - } | 116 | + }; |
| 141 | 117 | ||
| 142 | //计算实发时间差值 | 118 | //计算实发时间差值 |
| 143 | - var calc_sch_real_shift = function(sch) { | 119 | + var calc_sch_real_shift = function (sch) { |
| 144 | if (sch.fcsjActualTime) { | 120 | if (sch.fcsjActualTime) { |
| 145 | var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60); | 121 | var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60); |
| 146 | if (diff > 0) | 122 | if (diff > 0) |
| @@ -150,22 +126,22 @@ var gb_schedule_table = (function() { | @@ -150,22 +126,22 @@ var gb_schedule_table = (function() { | ||
| 150 | else | 126 | else |
| 151 | sch.fcsj_diff = ''; | 127 | sch.fcsj_diff = ''; |
| 152 | } | 128 | } |
| 153 | - } | 129 | + }; |
| 154 | 130 | ||
| 155 | function arrayIsNull(array) { | 131 | function arrayIsNull(array) { |
| 156 | return !array || array.length == 0; | 132 | return !array || array.length == 0; |
| 157 | } | 133 | } |
| 158 | 134 | ||
| 159 | - var findScheduleByLine = function(lineCode) { | 135 | + var findScheduleByLine = function (lineCode) { |
| 160 | return line2Schedule[lineCode]; | 136 | return line2Schedule[lineCode]; |
| 161 | - } | 137 | + }; |
| 162 | 138 | ||
| 163 | //新增一个班次,附带更新的班次 | 139 | //新增一个班次,附带更新的班次 |
| 164 | - var insertSchedule = function(sch, upArr) { | 140 | + var insertSchedule = function (sch, upArr) { |
| 165 | line2Schedule[sch.xlBm][sch.id] = sch; | 141 | line2Schedule[sch.xlBm][sch.id] = sch; |
| 166 | //update | 142 | //update |
| 167 | if (isArray(upArr)) { | 143 | if (isArray(upArr)) { |
| 168 | - $.each(upArr, function() { | 144 | + $.each(upArr, function () { |
| 169 | line2Schedule[this.xlBm][this.id] = this; | 145 | line2Schedule[this.xlBm][this.id] = this; |
| 170 | }); | 146 | }); |
| 171 | } | 147 | } |
| @@ -188,10 +164,10 @@ var gb_schedule_table = (function() { | @@ -188,10 +164,10 @@ var gb_schedule_table = (function() { | ||
| 188 | gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap')); | 164 | gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap')); |
| 189 | //定位到新添加的班次 | 165 | //定位到新添加的班次 |
| 190 | scroToDl(sch); | 166 | scroToDl(sch); |
| 191 | - } | 167 | + }; |
| 192 | 168 | ||
| 193 | //删除一个班次 | 169 | //删除一个班次 |
| 194 | - var deheteSchedule = function(sch) { | 170 | + var deheteSchedule = function (sch) { |
| 195 | sch = line2Schedule[sch.xlBm][sch.id]; | 171 | sch = line2Schedule[sch.xlBm][sch.id]; |
| 196 | if (sch) { | 172 | if (sch) { |
| 197 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'), | 173 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'), |
| @@ -201,21 +177,21 @@ var gb_schedule_table = (function() { | @@ -201,21 +177,21 @@ var gb_schedule_table = (function() { | ||
| 201 | reset_seq_no(dls); | 177 | reset_seq_no(dls); |
| 202 | calc_yfwf_num(sch.xlBm); | 178 | calc_yfwf_num(sch.xlBm); |
| 203 | } | 179 | } |
| 204 | - } | 180 | + }; |
| 205 | 181 | ||
| 206 | //更新班次 | 182 | //更新班次 |
| 207 | - var updateSchedule = function(schArr) { | 183 | + var updateSchedule = function (schArr) { |
| 208 | if (!isArray(schArr)) | 184 | if (!isArray(schArr)) |
| 209 | schArr = [schArr]; | 185 | schArr = [schArr]; |
| 210 | 186 | ||
| 211 | - $.each(schArr, function() { | 187 | + $.each(schArr, function () { |
| 212 | line2Schedule[this.xlBm][this.id] = this; | 188 | line2Schedule[this.xlBm][this.id] = this; |
| 213 | updateDom(this); | 189 | updateDom(this); |
| 214 | }); | 190 | }); |
| 215 | - } | 191 | + }; |
| 216 | 192 | ||
| 217 | //update dom | 193 | //update dom |
| 218 | - var updateDom = function(sch) { | 194 | + var updateDom = function (sch) { |
| 219 | if (!sch) return; | 195 | if (!sch) return; |
| 220 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); | 196 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); |
| 221 | var dds = $('dd', dl); | 197 | var dds = $('dd', dl); |
| @@ -241,12 +217,12 @@ var gb_schedule_table = (function() { | @@ -241,12 +217,12 @@ var gb_schedule_table = (function() { | ||
| 241 | $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); | 217 | $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); |
| 242 | else | 218 | else |
| 243 | $(dds[8]).html(''); | 219 | $(dds[8]).html(''); |
| 244 | - } | 220 | + }; |
| 245 | 221 | ||
| 246 | //拖拽选中... | 222 | //拖拽选中... |
| 247 | var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no'; | 223 | var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no'; |
| 248 | var drag_strat; | 224 | var drag_strat; |
| 249 | - $(document).on('mousedown', seq_nos, function(e) { | 225 | + $(document).on('mousedown', seq_nos, function (e) { |
| 250 | if (e.button != 0) return; | 226 | if (e.button != 0) return; |
| 251 | var dl = $(this).parent(); | 227 | var dl = $(this).parent(); |
| 252 | if (dl.hasClass('drag-active')) | 228 | if (dl.hasClass('drag-active')) |
| @@ -255,9 +231,9 @@ var gb_schedule_table = (function() { | @@ -255,9 +231,9 @@ var gb_schedule_table = (function() { | ||
| 255 | dl.addClass('drag-active'); | 231 | dl.addClass('drag-active'); |
| 256 | 232 | ||
| 257 | drag_strat = parseInt($(this).text()) - 1; | 233 | drag_strat = parseInt($(this).text()) - 1; |
| 258 | - }).on('mouseup', function() { | 234 | + }).on('mouseup', function () { |
| 259 | drag_strat = null; | 235 | drag_strat = null; |
| 260 | - }).on('mouseover', seq_nos, function() { | 236 | + }).on('mouseover', seq_nos, function () { |
| 261 | if (drag_strat != null) { | 237 | if (drag_strat != null) { |
| 262 | var e = parseInt($(this).text()), | 238 | var e = parseInt($(this).text()), |
| 263 | dls = $(this).parents('.ct_table_body').find('dl'); | 239 | dls = $(this).parents('.ct_table_body').find('dl'); |
| @@ -274,22 +250,22 @@ var gb_schedule_table = (function() { | @@ -274,22 +250,22 @@ var gb_schedule_table = (function() { | ||
| 274 | $(dls[j]).addClass('drag-active'); | 250 | $(dls[j]).addClass('drag-active'); |
| 275 | } | 251 | } |
| 276 | } | 252 | } |
| 277 | - }).on('click', seq_nos, function() { | 253 | + }).on('click', seq_nos, function () { |
| 278 | reset_relevance_active(this); | 254 | reset_relevance_active(this); |
| 279 | }); | 255 | }); |
| 280 | //非seq_no 单元格点击 | 256 | //非seq_no 单元格点击 |
| 281 | - $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function() { | 257 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function () { |
| 282 | reset_drag_active_all(this); | 258 | reset_drag_active_all(this); |
| 283 | //选中相关班次 | 259 | //选中相关班次 |
| 284 | var id = $(this).parent().data('id'), | 260 | var id = $(this).parent().data('id'), |
| 285 | contWrap = $(this).parents('li.line_schedule'), | 261 | contWrap = $(this).parents('li.line_schedule'), |
| 286 | lineCode = contWrap.data('id'), | 262 | lineCode = contWrap.data('id'), |
| 287 | sch = line2Schedule[lineCode][id], | 263 | sch = line2Schedule[lineCode][id], |
| 288 | - schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function(item) { | 264 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { |
| 289 | return item.clZbh == sch.clZbh; | 265 | return item.clZbh == sch.clZbh; |
| 290 | }).sort(schedule_sort), | 266 | }).sort(schedule_sort), |
| 291 | nextSch, tempDL; | 267 | nextSch, tempDL; |
| 292 | - $.each(schArr, function(i) { | 268 | + $.each(schArr, function (i) { |
| 293 | tempDL = $('dl[data-id=' + this.id + ']', contWrap); | 269 | tempDL = $('dl[data-id=' + this.id + ']', contWrap); |
| 294 | tempDL.addClass('relevance-active'); | 270 | tempDL.addClass('relevance-active'); |
| 295 | if (i < schArr.length - 1 && this.id == id) { | 271 | if (i < schArr.length - 1 && this.id == id) { |
| @@ -308,17 +284,17 @@ var gb_schedule_table = (function() { | @@ -308,17 +284,17 @@ var gb_schedule_table = (function() { | ||
| 308 | }); | 284 | }); |
| 309 | 285 | ||
| 310 | //路牌点击 | 286 | //路牌点击 |
| 311 | - $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function() { | 287 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function () { |
| 312 | reset_drag_active_all(this); | 288 | reset_drag_active_all(this); |
| 313 | //选中路牌下相关班次 | 289 | //选中路牌下相关班次 |
| 314 | var id = $(this).parent().data('id'), | 290 | var id = $(this).parent().data('id'), |
| 315 | contWrap = $(this).parents('li.line_schedule'), | 291 | contWrap = $(this).parents('li.line_schedule'), |
| 316 | lineCode = contWrap.data('id'), | 292 | lineCode = contWrap.data('id'), |
| 317 | sch = line2Schedule[lineCode][id], | 293 | sch = line2Schedule[lineCode][id], |
| 318 | - schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function(item) { | 294 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { |
| 319 | return item.lpName == sch.lpName; | 295 | return item.lpName == sch.lpName; |
| 320 | }).sort(schedule_sort); | 296 | }).sort(schedule_sort); |
| 321 | - $.each(schArr, function(i) { | 297 | + $.each(schArr, function (i) { |
| 322 | $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active intimity'); | 298 | $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active intimity'); |
| 323 | }); | 299 | }); |
| 324 | 300 | ||
| @@ -326,13 +302,13 @@ var gb_schedule_table = (function() { | @@ -326,13 +302,13 @@ var gb_schedule_table = (function() { | ||
| 326 | }); | 302 | }); |
| 327 | 303 | ||
| 328 | //头部点击去掉选中光标 | 304 | //头部点击去掉选中光标 |
| 329 | - $(document).on('click', '.header-title', function() { | 305 | + $(document).on('click', '.header-title', function () { |
| 330 | // $(this).parents('.schedule-wrap').find('.relevance-active') | 306 | // $(this).parents('.schedule-wrap').find('.relevance-active') |
| 331 | // .removeClass('relevance-active'); | 307 | // .removeClass('relevance-active'); |
| 332 | reset_drag_active_all(this); | 308 | reset_drag_active_all(this); |
| 333 | }); | 309 | }); |
| 334 | 310 | ||
| 335 | - var scroToDl = function(sch) { | 311 | + var scroToDl = function (sch) { |
| 336 | var dl = $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')), | 312 | var dl = $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')), |
| 337 | cont = dl.parents('.ct_table_wrap'), | 313 | cont = dl.parents('.ct_table_wrap'), |
| 338 | diff = cont.height() / 2; | 314 | diff = cont.height() / 2; |
| @@ -341,43 +317,43 @@ var gb_schedule_table = (function() { | @@ -341,43 +317,43 @@ var gb_schedule_table = (function() { | ||
| 341 | }, 500); | 317 | }, 500); |
| 342 | 318 | ||
| 343 | return dl; | 319 | return dl; |
| 344 | - } | 320 | + }; |
| 345 | 321 | ||
| 346 | - var reset_drag_active_all = function(dd) { | 322 | + var reset_drag_active_all = function (dd) { |
| 347 | $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); | 323 | $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); |
| 348 | reset_relevance_active(dd); | 324 | reset_relevance_active(dd); |
| 349 | - } | 325 | + }; |
| 350 | 326 | ||
| 351 | - var reset_relevance_active = function(dd) { | 327 | + var reset_relevance_active = function (dd) { |
| 352 | $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity'); | 328 | $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity'); |
| 353 | - } | 329 | + }; |
| 354 | 330 | ||
| 355 | 331 | ||
| 356 | //计算应发未发数量 car_yfwf_map | 332 | //计算应发未发数量 car_yfwf_map |
| 357 | - var calc_yfwf_num = function(lineCode) { | 333 | + var calc_yfwf_num = function (lineCode) { |
| 358 | 334 | ||
| 359 | var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), | 335 | var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), |
| 360 | yfwf_num = 0, | 336 | yfwf_num = 0, |
| 361 | t = new Date().valueOf(); | 337 | t = new Date().valueOf(); |
| 362 | 338 | ||
| 363 | - var carYfwfMap={}, nbbm; | ||
| 364 | - $.each(schArr, function() { | 339 | + var carYfwfMap = {}, nbbm; |
| 340 | + $.each(schArr, function () { | ||
| 365 | if (this.fcsjT > t) | 341 | if (this.fcsjT > t) |
| 366 | return false; | 342 | return false; |
| 367 | 343 | ||
| 368 | - if (this.fcsjActual == null && this.fcsjActualTime == null && this.status != -1){ | ||
| 369 | - yfwf_num++; | ||
| 370 | - nbbm=this.clZbh; | ||
| 371 | - if(carYfwfMap[nbbm]) | ||
| 372 | - carYfwfMap[nbbm]++; | ||
| 373 | - else | ||
| 374 | - carYfwfMap[nbbm]=1; | 344 | + if (this.fcsjActual == null && this.fcsjActualTime == null && this.status != -1) { |
| 345 | + yfwf_num++; | ||
| 346 | + nbbm = this.clZbh; | ||
| 347 | + if (carYfwfMap[nbbm]) | ||
| 348 | + carYfwfMap[nbbm]++; | ||
| 349 | + else | ||
| 350 | + carYfwfMap[nbbm] = 1; | ||
| 375 | } | 351 | } |
| 376 | }); | 352 | }); |
| 377 | - car_yfwf_map[lineCode]=carYfwfMap; | 353 | + car_yfwf_map[lineCode] = carYfwfMap; |
| 378 | 354 | ||
| 379 | $('#badge_yfwf_num_' + lineCode).text(yfwf_num); | 355 | $('#badge_yfwf_num_' + lineCode).text(yfwf_num); |
| 380 | - } | 356 | + }; |
| 381 | 357 | ||
| 382 | return { | 358 | return { |
| 383 | show: show, | 359 | show: show, |
| @@ -387,7 +363,9 @@ var gb_schedule_table = (function() { | @@ -387,7 +363,9 @@ var gb_schedule_table = (function() { | ||
| 387 | insertSchedule: insertSchedule, | 363 | insertSchedule: insertSchedule, |
| 388 | schedule_sort: schedule_sort, | 364 | schedule_sort: schedule_sort, |
| 389 | calc_yfwf_num: calc_yfwf_num, | 365 | calc_yfwf_num: calc_yfwf_num, |
| 390 | - car_yfwf_map: function(lineCode){return car_yfwf_map[lineCode];}, | 366 | + car_yfwf_map: function (lineCode) { |
| 367 | + return car_yfwf_map[lineCode]; | ||
| 368 | + }, | ||
| 391 | scroToDl: scroToDl, | 369 | scroToDl: scroToDl, |
| 392 | reset_drag_active_all: reset_drag_active_all | 370 | reset_drag_active_all: reset_drag_active_all |
| 393 | }; | 371 | }; |
src/main/resources/static/real_control_v2/main.html
| @@ -123,6 +123,7 @@ | @@ -123,6 +123,7 @@ | ||
| 123 | <script src="/real_control_v2/js/home/line_panel.js"></script> | 123 | <script src="/real_control_v2/js/home/line_panel.js"></script> |
| 124 | <script src="/real_control_v2/js/home/context_menu.js"></script> | 124 | <script src="/real_control_v2/js/home/context_menu.js"></script> |
| 125 | <!-- line schedule js --> | 125 | <!-- line schedule js --> |
| 126 | + <script src="/real_control_v2/js/line_schedule/legend.js"></script> | ||
| 126 | <script src="/real_control_v2/js/line_schedule/layout.js"></script> | 127 | <script src="/real_control_v2/js/line_schedule/layout.js"></script> |
| 127 | <script src="/real_control_v2/js/line_schedule/sch_table.js"></script> | 128 | <script src="/real_control_v2/js/line_schedule/sch_table.js"></script> |
| 128 | <script src="/real_control_v2/js/line_schedule/context_menu.js"></script> | 129 | <script src="/real_control_v2/js/line_schedule/context_menu.js"></script> |