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 | 3 | import com.bsth.data.LineConfigData; |
| 4 | 4 | import com.bsth.entity.realcontrol.LineConfig; |
| 5 | 5 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 6 | +import org.apache.commons.lang3.StringUtils; | |
| 6 | 7 | import org.joda.time.format.DateTimeFormat; |
| 7 | 8 | import org.joda.time.format.DateTimeFormatter; |
| 8 | 9 | import org.slf4j.Logger; |
| ... | ... | @@ -115,8 +116,11 @@ public class SchAttrCalculator { |
| 115 | 116 | ScheduleRealInfo prve = list.get(0), curr; |
| 116 | 117 | for(int i = 1; i < len; i ++){ |
| 117 | 118 | curr = list.get(i); |
| 118 | - if(prve.getZdzName().equals(curr.getQdzName())) | |
| 119 | + if(prve.getZdzName().equals(curr.getQdzName())){ | |
| 119 | 120 | curr.setQdzArrDateJH(prve.getZdsj()); |
| 121 | + if(StringUtils.isNotEmpty(prve.getZdsjActual()) && StringUtils.isEmpty(curr.getQdzArrDatesj())) | |
| 122 | + curr.setQdzArrDatesj(prve.getZdsjActual()); | |
| 123 | + } | |
| 120 | 124 | |
| 121 | 125 | prve = curr; |
| 122 | 126 | } | ... | ... |
src/main/resources/static/pages/forecast/sample/js/svg.js
src/main/resources/static/real_control_v2/css/line_schedule.css
| ... | ... | @@ -64,6 +64,9 @@ |
| 64 | 64 | .line_schedule .schedule-wrap h3 { |
| 65 | 65 | margin: 7px 0 5px; |
| 66 | 66 | text-indent: 5px; |
| 67 | + margin: 0; | |
| 68 | + height: 31px; | |
| 69 | + line-height: 31px; | |
| 67 | 70 | } |
| 68 | 71 | |
| 69 | 72 | .line_schedule .schedule-wrap.up h3 { |
| ... | ... | @@ -245,6 +248,7 @@ span.fcsj-diff { |
| 245 | 248 | .tl-yzx { |
| 246 | 249 | background: #c1ddf0; |
| 247 | 250 | border-top: 1px solid #ebebeb !important; |
| 251 | + color: #444; | |
| 248 | 252 | } |
| 249 | 253 | |
| 250 | 254 | .tl-xxfc{ |
| ... | ... | @@ -254,15 +258,18 @@ span.fcsj-diff { |
| 254 | 258 | |
| 255 | 259 | .tl-wd{ |
| 256 | 260 | background: #caca4f; |
| 261 | + color: #444; | |
| 257 | 262 | } |
| 258 | 263 | |
| 259 | 264 | .tl-xxsd{ |
| 260 | 265 | background: #e2de94; |
| 266 | + color: #444; | |
| 261 | 267 | } |
| 262 | 268 | |
| 263 | 269 | .tl-xxrd{ |
| 264 | 270 | background: #c1ddf0; |
| 265 | 271 | border-top: 1px solid #ebebeb !important; |
| 272 | + color: #444; | |
| 266 | 273 | } |
| 267 | 274 | |
| 268 | 275 | .tl-qrlb { |
| ... | ... | @@ -277,6 +284,7 @@ span.fcsj-diff { |
| 277 | 284 | |
| 278 | 285 | .tl-zzzx { |
| 279 | 286 | background: #96F396; |
| 287 | + color: #444; | |
| 280 | 288 | } |
| 281 | 289 | |
| 282 | 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 | 909 | .uk-modal-footer .ct-footer-left a{ |
| 902 | 910 | color: #6e6b6b; |
| 903 | 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 | 947 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| ... | ... | @@ -8,6 +8,22 @@ |
| 8 | 8 | 下行/{{line.endStationName}} |
| 9 | 9 | {{/if}} |
| 10 | 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 | 27 | <div class="search_sch_panel"> |
| 12 | 28 | <form class="uk-form" onsubmit="javascript:return false;"> |
| 13 | 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 | 15 | var lineCode=$(this).data('id') |
| 16 | 16 | ,svgWrap=$('.footer-chart .svg-wrap', this); |
| 17 | 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 | 20 | cb && cb(); |
| 23 | 21 | }); |
| 24 | 22 | }; |
| 25 | 23 | |
| 24 | + //图例icon tootip | |
| 26 | 25 | $(document).on('mouseenter', '.schedule-wrap i.uk-icon-question-circle', function() { |
| 27 | 26 | $(this).qtip({ |
| 28 | 27 | show: { |
| ... | ... | @@ -49,7 +48,7 @@ var gb_line_layout = (function() { |
| 49 | 48 | //destroy dom |
| 50 | 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 | 56 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| 1 | 1 | /** schedule table */ |
| 2 | 2 | |
| 3 | -var gb_schedule_table = (function() { | |
| 3 | +var gb_schedule_table = (function () { | |
| 4 | 4 | |
| 5 | 5 | var temps; |
| 6 | 6 | //线路分组的班次数据 |
| 7 | 7 | var line2Schedule = {}; |
| 8 | 8 | //车辆应发未发车辆数 |
| 9 | 9 | var car_yfwf_map = {}; |
| 10 | - var schedule_sort = function(s1, s2) { | |
| 10 | + var schedule_sort = function (s1, s2) { | |
| 11 | 11 | return s1.dfsjT - s2.dfsjT; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - var show = function(cb) { | |
| 14 | + var show = function (cb) { | |
| 15 | 15 | //从服务器获取班次数据 |
| 16 | 16 | $.get('/realSchedule/lines', { |
| 17 | 17 | lines: gb_data_basic.line_idx |
| 18 | - }, function(rs) { | |
| 18 | + }, function (rs) { | |
| 19 | 19 | for (var lineCode in rs) { |
| 20 | 20 | //排序 |
| 21 | 21 | rs[lineCode].sort(schedule_sort); |
| 22 | 22 | line2Schedule[lineCode] = {}; |
| 23 | 23 | //calc shift |
| 24 | - $.each(rs[lineCode], function() { | |
| 24 | + $.each(rs[lineCode], function () { | |
| 25 | 25 | calc_sch_real_shift(this); |
| 26 | 26 | line2Schedule[lineCode][this.id] = this; |
| 27 | 27 | }); |
| ... | ... | @@ -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 | 36 | ep.emit('temp', gb_common.compileTempByDom(dom, { |
| 37 | 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 | 43 | temps = temp; |
| 44 | 44 | var lineCode, dirData, htmlStr; |
| 45 | - $('#main-tab-content .line_schedule').each(function() { | |
| 45 | + $('#main-tab-content .line_schedule').each(function () { | |
| 46 | 46 | lineCode = $(this).data('id'); |
| 47 | 47 | if (arrayIsNull(data[lineCode])) |
| 48 | 48 | return true; |
| ... | ... | @@ -64,27 +64,30 @@ var gb_schedule_table = (function() { |
| 64 | 64 | gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init); |
| 65 | 65 | //dbclick event |
| 66 | 66 | gb_schedule_table_dbclick.init(); |
| 67 | - | |
| 67 | + //点击实发,show detail | |
| 68 | 68 | fcsjActualCellQtip(); |
| 69 | 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 | 78 | $(document).on('click', 'dd.fcsjActualCell', function () { |
| 76 | - var that=this; | |
| 79 | + var that = this; | |
| 77 | 80 | $(that).qtip({ |
| 78 | 81 | show: true, |
| 79 | 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 | 87 | return temps['sfsj_sch-detail-temp'](sch); |
| 85 | 88 | } |
| 86 | 89 | } |
| 87 | - ,style: { | |
| 90 | + , style: { | |
| 88 | 91 | classes: 'qtip-dark qtip-rounded qtip-shadow' |
| 89 | 92 | }, |
| 90 | 93 | hide: { |
| ... | ... | @@ -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 | 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 | 120 | if (sch.fcsjActualTime) { |
| 145 | 121 | var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60); |
| 146 | 122 | if (diff > 0) |
| ... | ... | @@ -150,22 +126,22 @@ var gb_schedule_table = (function() { |
| 150 | 126 | else |
| 151 | 127 | sch.fcsj_diff = ''; |
| 152 | 128 | } |
| 153 | - } | |
| 129 | + }; | |
| 154 | 130 | |
| 155 | 131 | function arrayIsNull(array) { |
| 156 | 132 | return !array || array.length == 0; |
| 157 | 133 | } |
| 158 | 134 | |
| 159 | - var findScheduleByLine = function(lineCode) { | |
| 135 | + var findScheduleByLine = function (lineCode) { | |
| 160 | 136 | return line2Schedule[lineCode]; |
| 161 | - } | |
| 137 | + }; | |
| 162 | 138 | |
| 163 | 139 | //新增一个班次,附带更新的班次 |
| 164 | - var insertSchedule = function(sch, upArr) { | |
| 140 | + var insertSchedule = function (sch, upArr) { | |
| 165 | 141 | line2Schedule[sch.xlBm][sch.id] = sch; |
| 166 | 142 | //update |
| 167 | 143 | if (isArray(upArr)) { |
| 168 | - $.each(upArr, function() { | |
| 144 | + $.each(upArr, function () { | |
| 169 | 145 | line2Schedule[this.xlBm][this.id] = this; |
| 170 | 146 | }); |
| 171 | 147 | } |
| ... | ... | @@ -188,10 +164,10 @@ var gb_schedule_table = (function() { |
| 188 | 164 | gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap')); |
| 189 | 165 | //定位到新添加的班次 |
| 190 | 166 | scroToDl(sch); |
| 191 | - } | |
| 167 | + }; | |
| 192 | 168 | |
| 193 | 169 | //删除一个班次 |
| 194 | - var deheteSchedule = function(sch) { | |
| 170 | + var deheteSchedule = function (sch) { | |
| 195 | 171 | sch = line2Schedule[sch.xlBm][sch.id]; |
| 196 | 172 | if (sch) { |
| 197 | 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 | 177 | reset_seq_no(dls); |
| 202 | 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 | 184 | if (!isArray(schArr)) |
| 209 | 185 | schArr = [schArr]; |
| 210 | 186 | |
| 211 | - $.each(schArr, function() { | |
| 187 | + $.each(schArr, function () { | |
| 212 | 188 | line2Schedule[this.xlBm][this.id] = this; |
| 213 | 189 | updateDom(this); |
| 214 | 190 | }); |
| 215 | - } | |
| 191 | + }; | |
| 216 | 192 | |
| 217 | 193 | //update dom |
| 218 | - var updateDom = function(sch) { | |
| 194 | + var updateDom = function (sch) { | |
| 219 | 195 | if (!sch) return; |
| 220 | 196 | var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); |
| 221 | 197 | var dds = $('dd', dl); |
| ... | ... | @@ -241,12 +217,12 @@ var gb_schedule_table = (function() { |
| 241 | 217 | $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); |
| 242 | 218 | else |
| 243 | 219 | $(dds[8]).html(''); |
| 244 | - } | |
| 220 | + }; | |
| 245 | 221 | |
| 246 | 222 | //拖拽选中... |
| 247 | 223 | var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no'; |
| 248 | 224 | var drag_strat; |
| 249 | - $(document).on('mousedown', seq_nos, function(e) { | |
| 225 | + $(document).on('mousedown', seq_nos, function (e) { | |
| 250 | 226 | if (e.button != 0) return; |
| 251 | 227 | var dl = $(this).parent(); |
| 252 | 228 | if (dl.hasClass('drag-active')) |
| ... | ... | @@ -255,9 +231,9 @@ var gb_schedule_table = (function() { |
| 255 | 231 | dl.addClass('drag-active'); |
| 256 | 232 | |
| 257 | 233 | drag_strat = parseInt($(this).text()) - 1; |
| 258 | - }).on('mouseup', function() { | |
| 234 | + }).on('mouseup', function () { | |
| 259 | 235 | drag_strat = null; |
| 260 | - }).on('mouseover', seq_nos, function() { | |
| 236 | + }).on('mouseover', seq_nos, function () { | |
| 261 | 237 | if (drag_strat != null) { |
| 262 | 238 | var e = parseInt($(this).text()), |
| 263 | 239 | dls = $(this).parents('.ct_table_body').find('dl'); |
| ... | ... | @@ -274,22 +250,22 @@ var gb_schedule_table = (function() { |
| 274 | 250 | $(dls[j]).addClass('drag-active'); |
| 275 | 251 | } |
| 276 | 252 | } |
| 277 | - }).on('click', seq_nos, function() { | |
| 253 | + }).on('click', seq_nos, function () { | |
| 278 | 254 | reset_relevance_active(this); |
| 279 | 255 | }); |
| 280 | 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 | 258 | reset_drag_active_all(this); |
| 283 | 259 | //选中相关班次 |
| 284 | 260 | var id = $(this).parent().data('id'), |
| 285 | 261 | contWrap = $(this).parents('li.line_schedule'), |
| 286 | 262 | lineCode = contWrap.data('id'), |
| 287 | 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 | 265 | return item.clZbh == sch.clZbh; |
| 290 | 266 | }).sort(schedule_sort), |
| 291 | 267 | nextSch, tempDL; |
| 292 | - $.each(schArr, function(i) { | |
| 268 | + $.each(schArr, function (i) { | |
| 293 | 269 | tempDL = $('dl[data-id=' + this.id + ']', contWrap); |
| 294 | 270 | tempDL.addClass('relevance-active'); |
| 295 | 271 | if (i < schArr.length - 1 && this.id == id) { |
| ... | ... | @@ -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 | 288 | reset_drag_active_all(this); |
| 313 | 289 | //选中路牌下相关班次 |
| 314 | 290 | var id = $(this).parent().data('id'), |
| 315 | 291 | contWrap = $(this).parents('li.line_schedule'), |
| 316 | 292 | lineCode = contWrap.data('id'), |
| 317 | 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 | 295 | return item.lpName == sch.lpName; |
| 320 | 296 | }).sort(schedule_sort); |
| 321 | - $.each(schArr, function(i) { | |
| 297 | + $.each(schArr, function (i) { | |
| 322 | 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 | 302 | }); |
| 327 | 303 | |
| 328 | 304 | //头部点击去掉选中光标 |
| 329 | - $(document).on('click', '.header-title', function() { | |
| 305 | + $(document).on('click', '.header-title', function () { | |
| 330 | 306 | // $(this).parents('.schedule-wrap').find('.relevance-active') |
| 331 | 307 | // .removeClass('relevance-active'); |
| 332 | 308 | reset_drag_active_all(this); |
| 333 | 309 | }); |
| 334 | 310 | |
| 335 | - var scroToDl = function(sch) { | |
| 311 | + var scroToDl = function (sch) { | |
| 336 | 312 | var dl = $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')), |
| 337 | 313 | cont = dl.parents('.ct_table_wrap'), |
| 338 | 314 | diff = cont.height() / 2; |
| ... | ... | @@ -341,43 +317,43 @@ var gb_schedule_table = (function() { |
| 341 | 317 | }, 500); |
| 342 | 318 | |
| 343 | 319 | return dl; |
| 344 | - } | |
| 320 | + }; | |
| 345 | 321 | |
| 346 | - var reset_drag_active_all = function(dd) { | |
| 322 | + var reset_drag_active_all = function (dd) { | |
| 347 | 323 | $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); |
| 348 | 324 | reset_relevance_active(dd); |
| 349 | - } | |
| 325 | + }; | |
| 350 | 326 | |
| 351 | - var reset_relevance_active = function(dd) { | |
| 327 | + var reset_relevance_active = function (dd) { | |
| 352 | 328 | $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity'); |
| 353 | - } | |
| 329 | + }; | |
| 354 | 330 | |
| 355 | 331 | |
| 356 | 332 | //计算应发未发数量 car_yfwf_map |
| 357 | - var calc_yfwf_num = function(lineCode) { | |
| 333 | + var calc_yfwf_num = function (lineCode) { | |
| 358 | 334 | |
| 359 | 335 | var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), |
| 360 | 336 | yfwf_num = 0, |
| 361 | 337 | t = new Date().valueOf(); |
| 362 | 338 | |
| 363 | - var carYfwfMap={}, nbbm; | |
| 364 | - $.each(schArr, function() { | |
| 339 | + var carYfwfMap = {}, nbbm; | |
| 340 | + $.each(schArr, function () { | |
| 365 | 341 | if (this.fcsjT > t) |
| 366 | 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 | 355 | $('#badge_yfwf_num_' + lineCode).text(yfwf_num); |
| 380 | - } | |
| 356 | + }; | |
| 381 | 357 | |
| 382 | 358 | return { |
| 383 | 359 | show: show, |
| ... | ... | @@ -387,7 +363,9 @@ var gb_schedule_table = (function() { |
| 387 | 363 | insertSchedule: insertSchedule, |
| 388 | 364 | schedule_sort: schedule_sort, |
| 389 | 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 | 369 | scroToDl: scroToDl, |
| 392 | 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 | 123 | <script src="/real_control_v2/js/home/line_panel.js"></script> |
| 124 | 124 | <script src="/real_control_v2/js/home/context_menu.js"></script> |
| 125 | 125 | <!-- line schedule js --> |
| 126 | + <script src="/real_control_v2/js/line_schedule/legend.js"></script> | |
| 126 | 127 | <script src="/real_control_v2/js/line_schedule/layout.js"></script> |
| 127 | 128 | <script src="/real_control_v2/js/line_schedule/sch_table.js"></script> |
| 128 | 129 | <script src="/real_control_v2/js/line_schedule/context_menu.js"></script> | ... | ... |