Commit a0b466f3a720a816b2024b490cd2494ae13443d2
Merge branch 'minhang' into pudong
Showing
10 changed files
with
506 additions
and
190 deletions
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| ... | ... | @@ -358,6 +358,8 @@ public class InOutStationSignalHandle extends SignalHandle{ |
| 358 | 358 | //通知客户端 |
| 359 | 359 | sendUtils.sendZdsj(sch, lpNext, doneSum); |
| 360 | 360 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "到终点, 时间:" + sch.getZdsjActual()); |
| 361 | + //清除车辆误点调整监听 | |
| 362 | + LateAdjustHandle.remove(sch.getClZbh()); | |
| 361 | 363 | //准备执行下一个班次 |
| 362 | 364 | if (next != null) { |
| 363 | 365 | //将gps转换为下一个班次走向的站内信号 | ... | ... |
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
| ... | ... | @@ -117,6 +117,7 @@ public class LateAdjustHandle implements ApplicationContextAware{ |
| 117 | 117 | sch.setLateMinute(0); |
| 118 | 118 | sch.setDfAuto(false); |
| 119 | 119 | |
| 120 | + lateSchMap.remove(nbbm); | |
| 120 | 121 | logger.info("移除误点调整 nbbm -" + nbbm); |
| 121 | 122 | } |
| 122 | 123 | } |
| ... | ... | @@ -141,7 +142,7 @@ public class LateAdjustHandle implements ApplicationContextAware{ |
| 141 | 142 | //自动调整待发 到达时间 + 停靠时间 |
| 142 | 143 | long dt = Arith.addLong(gps.getTimestamp(), (sch.getLateMinute() * 60 * 1000)); |
| 143 | 144 | |
| 144 | - //超过2小时最大阈值,放弃 | |
| 145 | + //超过2小时最大阈值,放弃 -临时代码,待删除 | |
| 145 | 146 | if(Math.abs(dt - sch.getDfsjT()) > 1000 * 60 * 60 * 2){ |
| 146 | 147 | logger.info(sch.getClZbh() + " 超过误点调整阈值,放弃"); |
| 147 | 148 | } | ... | ... |
src/main/resources/static/pages/oil/list_ph.html
| ... | ... | @@ -5,9 +5,6 @@ |
| 5 | 5 | text-overflow: ellipsis; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | - #ylbtable .ps-scrollbar-y{ | |
| 9 | - min-height:100px; | |
| 10 | - } | |
| 11 | 8 | </style> |
| 12 | 9 | <div class="page-head"> |
| 13 | 10 | <div class="page-title"> |
| ... | ... | @@ -168,7 +165,7 @@ |
| 168 | 165 | </div> |
| 169 | 166 | </div> |
| 170 | 167 | |
| 171 | - <div id="ylbtable" class="portlet-body table-container " style="height: calc(100% - 200px);overflow: hidden;position: absolute;background: #fff;"> | |
| 168 | + <div id="ylbtable" class="portlet-body table-container " style="height: calc(100% + 100px);overflow: hidden;position: absolute;background: #fff;"> | |
| 172 | 169 | |
| 173 | 170 | <table |
| 174 | 171 | class="table table-striped table-bordered table-hover table-checkable" | ... | ... |
src/main/resources/static/pages/report/inoutstation/inoutstation.html
| ... | ... | @@ -70,7 +70,7 @@ |
| 70 | 70 | </div> |
| 71 | 71 | <div style="display: inline-block; margin-left: 5px;"> |
| 72 | 72 | <input class="btn btn-default" type="button" id="query" value="查询" /> |
| 73 | -<!-- <input class="btn btn-default" type="button" id="export" value="导出" /> --> | |
| 73 | + <input class="btn btn-default" type="button" id="export" value="导出" /> | |
| 74 | 74 | </div> |
| 75 | 75 | </div> |
| 76 | 76 | |
| ... | ... | @@ -127,9 +127,7 @@ |
| 127 | 127 | layer.msg("请选择方向"); |
| 128 | 128 | }else{ |
| 129 | 129 | $get('/report/queryStrinon',{line:line,zd:zdlx},function(result){ |
| 130 | - console.log(result); | |
| 131 | 130 | $get('/report/queryInOutStrtions',{line:line,date:date,zd:zdlx,lzsj:lzsj},function(result2){ |
| 132 | - console.log(result2); | |
| 133 | 131 | // /* getTime(result); */ |
| 134 | 132 | var ludan_ll_1 = template('ludan_ll_1',{lists:result,list:result2}); |
| 135 | 133 | // // 把渲染好的模版html文本追加到表格中 |
| ... | ... | @@ -172,19 +170,16 @@ |
| 172 | 170 | |
| 173 | 171 | |
| 174 | 172 | $("#export").on("click",function(){ |
| 175 | - var rq=$("#date").val(); | |
| 176 | - var line=$("#line").val(); | |
| 177 | - var nbbm=$("#nbbm").val(); | |
| 178 | - var fcsj=$("#fcsj_xx").val(); | |
| 179 | - var ddsj=$("#ddsj_xx").val(); | |
| 180 | - if(fcsj==""){ | |
| 181 | - layer.msg("没数据"); | |
| 182 | - }else{ | |
| 183 | - $get('/report/exportQueryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){ | |
| 184 | - window.open("/downloadFile/download?fileName=班次到离站"); | |
| 185 | - }); | |
| 186 | - } | |
| 187 | - | |
| 173 | + var curTbl = document.getElementById("forms"); | |
| 174 | + var oXL = new ActiveXObject("Excel.Application"); | |
| 175 | + var oWB = oXL.Workbooks.Add(); | |
| 176 | + var oSheet = oWB.ActiveSheet; | |
| 177 | + var sel = document.body.createTextRange(); | |
| 178 | + sel.moveToElementText(curTbl); | |
| 179 | + sel.select(); | |
| 180 | + sel.execCommand("Copy"); | |
| 181 | + oSheet.Paste(); | |
| 182 | + oXL.Visible = true; | |
| 188 | 183 | }); |
| 189 | 184 | |
| 190 | 185 | }); |
| ... | ... | @@ -193,8 +188,13 @@ |
| 193 | 188 | <script type="text/html" id="ludan_ll_1"> |
| 194 | 189 | {{each list as obj i}} |
| 195 | 190 | <tr> |
| 196 | - <td>{{obj.bc}}</td> | |
| 197 | - <td><label>{{obj.nbbm}}</label></td> | |
| 191 | + {{if i==0}} | |
| 192 | + <td>序号</td> | |
| 193 | + <td>内部编码</label></td> | |
| 194 | + {{else}} | |
| 195 | + <td>{{i}}</td> | |
| 196 | + <td><label>{{obj.nbbm}}</label></td> | |
| 197 | + {{/if}} | |
| 198 | 198 | {{each lists as o j}} |
| 199 | 199 | {{if i==0}} |
| 200 | 200 | <td> |
| ... | ... | @@ -206,8 +206,7 @@ |
| 206 | 206 | <td {{if obj[o.stationCode] =='y'}}style="color: red"{{/if}}> |
| 207 | 207 | {{if obj[(o.stationCode)+'in']!=''}} |
| 208 | 208 | <label> I {{obj[(o.stationCode)+'in']}}</label> |
| 209 | - {{/if}} | |
| 210 | - <br/> | |
| 209 | + {{/if}}<br/> | |
| 211 | 210 | {{if obj[(o.stationCode)+'out']!=''}} |
| 212 | 211 | <label> O{{obj[(o.stationCode)+'out']}}</label> |
| 213 | 212 | {{/if}} | ... | ... |
src/main/resources/static/pages/summary/fast_and_slow/data.html
0 → 100644
| 1 | +<div class="ct_data_body_wrap"> | |
| 2 | + <div class="uk-card uk-card-default uk-card-body ct_rq_left"> | |
| 3 | + <ul uk-scrollspy-nav="closest: li; scroll: true; offset: 100" | |
| 4 | + class="uk-nav uk-nav-default tm-nav uk-nav-parent-icon"> | |
| 5 | + <li class="uk-active"><a href="#table_20171010">2017-10-10</a></li> | |
| 6 | + <li><a href="#table_20171011">2017-10-11</a></li> | |
| 7 | + <li><a href="#table_20171012">2017-10-12</a></li> | |
| 8 | + <li><a href="#table_20171013">2017-10-13</a></li> | |
| 9 | + <li><a href="#table_20171014">2017-10-14</a></li> | |
| 10 | + <li><a href="#table_20171015">2017-10-15</a></li> | |
| 11 | + <li><a href="#table_20171016">2017-10-16</a></li> | |
| 12 | + </ul> | |
| 13 | + </div> | |
| 14 | + | |
| 15 | + <div class="uk-card uk-card-default uk-card-body ct_right_tables"> | |
| 16 | + <div id="table_20171010"> | |
| 17 | + <table> | |
| 18 | + | |
| 19 | + </table> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + | |
| 23 | + <script> | |
| 24 | + (function () { | |
| 25 | + var wrap = '.ct_data_body_wrap'; | |
| 26 | + | |
| 27 | + $(wrap).on('init', function (e, data) { | |
| 28 | + e.stopPropagation(); | |
| 29 | + console.log('data init'); | |
| 30 | + | |
| 31 | + }); | |
| 32 | + })(); | |
| 33 | + </script> | |
| 34 | +</div> | |
| 0 | 35 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/summary/fast_and_slow/f_a_s_wrap.html
0 → 100644
src/main/resources/static/pages/summary/fast_and_slow/main.html
0 → 100644
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh-cn"> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="UTF-8"> | |
| 6 | + <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/> | |
| 7 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" /> | |
| 8 | + <!-- flatpickr --> | |
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css"> | |
| 10 | + <style> | |
| 11 | + html,body{ | |
| 12 | + height: 100%; | |
| 13 | + } | |
| 14 | + .ct_page{ | |
| 15 | + padding: 25px 15px; | |
| 16 | + height: 100%; | |
| 17 | + height: calc(100% - 50px); | |
| 18 | + } | |
| 19 | + | |
| 20 | + .ct_cont{ | |
| 21 | + height: calc(100% - 35px); | |
| 22 | + } | |
| 23 | + | |
| 24 | + .ct_cont>div>div.uk-card{ | |
| 25 | + height: 99%; | |
| 26 | + } | |
| 27 | + | |
| 28 | + .loading{ | |
| 29 | + height: 100%; | |
| 30 | + text-align: center; | |
| 31 | + } | |
| 32 | + .loading .uk-spinner{ | |
| 33 | + margin-top: 200px; | |
| 34 | + } | |
| 35 | + .loading circle{ | |
| 36 | + stroke: red; | |
| 37 | + } | |
| 38 | + | |
| 39 | + .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{ | |
| 40 | + opacity: 0.6 !important; | |
| 41 | + padding: 0 !important; | |
| 42 | + } | |
| 43 | + | |
| 44 | + .ct_search_form_wrap{ | |
| 45 | + border-bottom: 1px solid #e5e5e5; | |
| 46 | + padding: 10px 0 25px 10px; | |
| 47 | + } | |
| 48 | + .ct_search_form_wrap .ct_field{ | |
| 49 | + display: inline-block; | |
| 50 | + margin: 0 5px; | |
| 51 | + } | |
| 52 | + | |
| 53 | + .ct_search_form_wrap .ct_field label{ | |
| 54 | + font-size: 14px; | |
| 55 | + } | |
| 56 | + | |
| 57 | + .ct_search_form_wrap .ct_field input[type=text]{ | |
| 58 | + width: 110px; | |
| 59 | + } | |
| 60 | + | |
| 61 | + .ct_search_form_wrap .ct_field select{ | |
| 62 | + width: auto; | |
| 63 | + min-width: 100px; | |
| 64 | + } | |
| 65 | + | |
| 66 | + .ct_search_form_wrap .uk-button{ | |
| 67 | + padding: 0 14px; | |
| 68 | + } | |
| 69 | + | |
| 70 | + .ct_search_form_wrap .uk-button i{ | |
| 71 | + vertical-align: middle; | |
| 72 | + margin-top: -2px; | |
| 73 | + margin-right: 7px; | |
| 74 | + } | |
| 75 | + | |
| 76 | + .ct_field.ct_field_bottom{ | |
| 77 | + vertical-align: bottom; | |
| 78 | + font-size: 12px; | |
| 79 | + margin-left: 0; | |
| 80 | + } | |
| 81 | + | |
| 82 | + .ct_cont_body{ | |
| 83 | + height: calc(100% - 88px); | |
| 84 | + width: 100%; | |
| 85 | + padding-top: 12px; | |
| 86 | + } | |
| 87 | + | |
| 88 | + .ct_data_body_wrap{ | |
| 89 | + height: 100%; | |
| 90 | + width: 100%; | |
| 91 | + } | |
| 92 | + | |
| 93 | + .ct_rq_left{ | |
| 94 | + width: 200px; | |
| 95 | + display: inline-block; | |
| 96 | + vertical-align: top; | |
| 97 | + height: 99%; | |
| 98 | + height: calc(100% - 5px); | |
| 99 | + } | |
| 100 | + | |
| 101 | + .ct_right_tables{ | |
| 102 | + width: calc(100% - 220px); | |
| 103 | + display: inline-block; | |
| 104 | + margin-left: 12px; | |
| 105 | + height: 99%; | |
| 106 | + height: calc(100% - 5px); | |
| 107 | + } | |
| 108 | + | |
| 109 | + .tm-nav>li a{ | |
| 110 | + position: relative; | |
| 111 | + font-size: 15px; | |
| 112 | + } | |
| 113 | + .tm-nav>li.uk-active>a:before { | |
| 114 | + content: ""; | |
| 115 | + position: absolute; | |
| 116 | + width: 15px; | |
| 117 | + border-top: 1px solid #1e87f0; | |
| 118 | + z-index: 9; | |
| 119 | + right: 60px; | |
| 120 | + top: 15px; | |
| 121 | + } | |
| 122 | + .uk-nav-default>li.uk-active>a { | |
| 123 | + color: #222; | |
| 124 | + } | |
| 125 | + </style> | |
| 126 | +</head> | |
| 127 | + | |
| 128 | +<body> | |
| 129 | +<div class="loading"> | |
| 130 | + <div uk-spinner></div> | |
| 131 | +</div> | |
| 132 | +<div class="ct_page" style="display: none;"> | |
| 133 | + <h3 class="uk-heading-line uk-heading-bullet"><span>快慢误点统计</span></h3> | |
| 134 | + <div class="ct_cont" > | |
| 135 | + <div class="ct_search_form_wrap"> | |
| 136 | + <form> | |
| 137 | + <div class="ct_field"> | |
| 138 | + <label>公司: | |
| 139 | + <select class="uk-select" name="companyId_eq"> | |
| 140 | + </select> | |
| 141 | + </label> | |
| 142 | + </div> | |
| 143 | + <div class="ct_field"> | |
| 144 | + <label>分公司: | |
| 145 | + <select class="uk-select" name="subCompanyId_eq"> | |
| 146 | + </select> | |
| 147 | + </label> | |
| 148 | + </div> | |
| 149 | + <div class="ct_field"> | |
| 150 | + <label>线路: | |
| 151 | + <select class="uk-select" name="lineCode_eq"> | |
| 152 | + </select> | |
| 153 | + </label> | |
| 154 | + </div> | |
| 155 | + <div class="ct_field"> | |
| 156 | + <label>日期范围: | |
| 157 | + <input class="uk-input" name="rq" style="width: 200px;"> | |
| 158 | + </label> | |
| 159 | + </div> | |
| 160 | + <div class="ct_field"> | |
| 161 | + <label><input class="uk-radio" type="radio" name="type" checked> 全部</label> | |
| 162 | + <label><input class="uk-radio" type="radio" name="type"> 快误</label> | |
| 163 | + <label><input class="uk-radio" type="radio" name="type"> 慢误</label> | |
| 164 | + </div> | |
| 165 | + <div class="ct_field"> | |
| 166 | + <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> | |
| 167 | + </div> | |
| 168 | + <div class="ct_field ct_field_bottom"> | |
| 169 | + <button class="uk-button uk-button-text" style="padding: 0 5px;">导出数据</button> | |
| 170 | + </div> | |
| 171 | + <div class="ct_field ct_field_bottom"> | |
| 172 | + <span uk-icon="icon: question" title="统计 “正常”、“区间”、“放站” 班次" uk-tooltip="pos: bottom"></span> | |
| 173 | + </div> | |
| 174 | + </form> | |
| 175 | + </div> | |
| 176 | + | |
| 177 | + <div class="ct_cont_body"> | |
| 178 | + </div> | |
| 179 | + </div> | |
| 180 | +</div> | |
| 181 | + | |
| 182 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | |
| 183 | +<script src="/assets/plugins/uk3.0/uikit.min.js"></script> | |
| 184 | +<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script> | |
| 185 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script> | |
| 186 | +<!-- EventProxy --> | |
| 187 | +<script src="/assets/js/eventproxy.js"></script> | |
| 188 | +<!-- art-template 模版引擎 --> | |
| 189 | +<script src="/assets/plugins/template.js"></script> | |
| 190 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 191 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 192 | +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | |
| 193 | +<!-- flatpickr --> | |
| 194 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" ></script> | |
| 195 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" ></script> | |
| 196 | +<script> | |
| 197 | + | |
| 198 | +(function () { | |
| 199 | + //var data_dom; | |
| 200 | + var f = $('form', ''); | |
| 201 | + var ep = EventProxy.create('query_comps', 'query_lines', function () { | |
| 202 | + $('[name=companyId_eq]', f).trigger('change');//公司change | |
| 203 | + //query(); | |
| 204 | + | |
| 205 | + $('.loading').remove(); | |
| 206 | + $('.ct_page').show(); | |
| 207 | + }); | |
| 208 | + | |
| 209 | + $.get('/pages/summary/fast_and_slow/data.html', function (rs) { | |
| 210 | + $('.ct_cont_body').html(rs); | |
| 211 | + }); | |
| 212 | + | |
| 213 | + //点击搜索按钮 | |
| 214 | + $('.search', f).on('click', function () { | |
| 215 | + $('.ct_data_body_wrap').trigger('init'); | |
| 216 | + }); | |
| 217 | + | |
| 218 | + //日期选择框 | |
| 219 | + var fs='YYYY-MM-DD' | |
| 220 | + , ets=moment().format(fs) | |
| 221 | + , sts=moment().subtract(7, 'days').format(fs); | |
| 222 | + flatpickr('.ct_search_form_wrap [name=rq]', { | |
| 223 | + mode: "range", dateFormat: "Y-m-d","locale": "zh", defaultDate: [sts, ets] | |
| 224 | + }); | |
| 225 | + var comps; | |
| 226 | + //构建公司级联下拉框 | |
| 227 | + $.get('/user/companyData', function (rs) { | |
| 228 | + comps = rs; | |
| 229 | + var opts = ''; | |
| 230 | + for(var i=0,obj;obj=comps[i++];){ | |
| 231 | + opts += '<option value="'+obj.companyCode+'">'+obj.companyName+'</option>'; | |
| 232 | + } | |
| 233 | + $('[name=companyId_eq]', f).html(opts); | |
| 234 | + ep.emit('query_comps'); | |
| 235 | + }); | |
| 236 | + var lineMapps; | |
| 237 | + //加载线路信息 | |
| 238 | + $.get('/line/all', {'destroy_eq': 0}, function (rs) { | |
| 239 | + rs.sort(function (a, b) { | |
| 240 | + return a.name.localeCompare(b.name); | |
| 241 | + }); | |
| 242 | + lineMapps={}; | |
| 243 | + var k; | |
| 244 | + $.each(rs, function () { | |
| 245 | + k = this.company+'_'+this.brancheCompany; | |
| 246 | + if(!lineMapps[k]) | |
| 247 | + lineMapps[k]=[]; | |
| 248 | + lineMapps[k].push(this); | |
| 249 | + }); | |
| 250 | + | |
| 251 | + ep.emit('query_lines'); | |
| 252 | + }); | |
| 253 | + | |
| 254 | + $('[name=companyId_eq]', f).on('change', function () { | |
| 255 | + var code = $(this).val(), subs=[]; | |
| 256 | + $.each(comps, function () { | |
| 257 | + if(this.companyCode==code) | |
| 258 | + subs=this.children; | |
| 259 | + }); | |
| 260 | + | |
| 261 | + var opts=''; | |
| 262 | + $.each(subs, function () { | |
| 263 | + opts += '<option value="'+this.code+'">'+this.name+'</option>'; | |
| 264 | + }); | |
| 265 | + $('[name=subCompanyId_eq]', f).html(opts).trigger('change'); | |
| 266 | + }); | |
| 267 | + | |
| 268 | + $('[name=subCompanyId_eq]', f).on('change', function () { | |
| 269 | + var k = $('[name=companyId_eq]', f).val() + '_' + $(this).val(); | |
| 270 | + var array = lineMapps[k]; | |
| 271 | + var opts = ''; | |
| 272 | + if(array){ | |
| 273 | + $.each(array, function () { | |
| 274 | + opts += '<option value="'+this.lineCode+'">'+this.name+'</option>'; | |
| 275 | + }); | |
| 276 | + } | |
| 277 | + $('[name=lineCode_eq]', f).html(opts); | |
| 278 | + }); | |
| 279 | +})(); | |
| 280 | +</script> | |
| 281 | +</body> | |
| 282 | +</html> | |
| 0 | 283 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/summary/work_hours/list.html
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | .ct_cont{ |
| 21 | - height: calc(100% - 41px); | |
| 21 | + height: calc(100% - 35px); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | .ct_cont>div>div.uk-card{ |
| ... | ... | @@ -122,7 +122,7 @@ |
| 122 | 122 | <div uk-spinner></div> |
| 123 | 123 | </div> |
| 124 | 124 | <div class="ct_page" style="display: none;"> |
| 125 | - <h2 class="uk-heading-line uk-heading-bullet"><span>工时统计</span></h2> | |
| 125 | + <h3 class="uk-heading-line uk-heading-bullet"><span>工时统计</span></h3> | |
| 126 | 126 | <div class="ct_cont" > |
| 127 | 127 | <div class="ct_search_form_wrap"> |
| 128 | 128 | <form> |
| ... | ... | @@ -141,7 +141,6 @@ |
| 141 | 141 | <div class="ct_field"> |
| 142 | 142 | <label>线路: |
| 143 | 143 | <select class="uk-select" name="lineCode_eq"> |
| 144 | - <option value="81101">航头4路</option> | |
| 145 | 144 | </select> |
| 146 | 145 | </label> |
| 147 | 146 | </div> |
| ... | ... | @@ -264,7 +263,7 @@ |
| 264 | 263 | |
| 265 | 264 | //日期选择器 |
| 266 | 265 | $('[name=rq_eq]', f).val('2017-10-10'); |
| 267 | - flatpickr('.ct_search_form_wrap [name=rq_eq]', {"locale": "zh", maxDate: '2017-10-10', minDate: '2017-07-01'}); | |
| 266 | + flatpickr('.ct_search_form_wrap [name=rq_eq]', {"locale": "zh", maxDate: '2017-10-16', minDate: '2017-07-01'}); | |
| 268 | 267 | |
| 269 | 268 | var comps; |
| 270 | 269 | //构建公司级联下拉框 | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_range_normal.html
| 1 | -<!-- 区间变全程 --> | |
| 2 | -<div class="add_range_2_normal"> | |
| 3 | - <div class="forms"></div> | |
| 4 | - | |
| 5 | - <div class="uk-modal-footer uk-text-right" style="margin-top: 5px;"> | |
| 6 | - <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 7 | - <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 8 | - </div> | |
| 9 | - <script> | |
| 10 | - (function () { | |
| 11 | - var wrap = '#add-sub-task-main-modal .add_range_2_normal', | |
| 12 | - sch,nextSch,f1,tf1,f2,tf2; | |
| 13 | - | |
| 14 | - $(wrap).on('init', function (e, data) { | |
| 15 | - e.stopPropagation(); | |
| 16 | - sch = data.sch; | |
| 17 | - nextSch = gb_schedule_table.getNextSch(sch); | |
| 18 | - | |
| 19 | - if(sch.bcType!='region'){ | |
| 20 | - $(wrap).html('<div class="err_panel">该模板只能应用区间班次!</div>'); | |
| 21 | - return; | |
| 22 | - } | |
| 23 | - f1 = addTaskForm(); | |
| 24 | - tf1 = addTaskForm().addClass('temp_service'); | |
| 25 | - changeField(f1, tf1); | |
| 26 | - | |
| 27 | - //返程也是区间 | |
| 28 | - if(nextSch.bcType=='region'){ | |
| 29 | - var u_d_input = '<input name="upDown" type="hidden" value="'+nextSch.xlDir+'">'; | |
| 30 | - tf1.after('<div class="range_2_normal_tt">返程</div>'); | |
| 31 | - tf2 = addTaskForm(u_d_input).addClass('temp_service'); | |
| 32 | - f2 = addTaskForm(u_d_input); | |
| 33 | - | |
| 34 | - changeField(f2, tf2); | |
| 35 | - } | |
| 36 | - | |
| 37 | - //设置默认值 | |
| 38 | - setDefaultVal(); | |
| 39 | - }); | |
| 40 | - | |
| 41 | - function addTaskForm(upDownInput) { | |
| 42 | - var htmlStr = template('sub-task-v2-form-temp', {sch: sch}); | |
| 43 | - var f = $(htmlStr); | |
| 44 | - $('.forms', wrap).append(f); | |
| 45 | - | |
| 46 | - if(upDownInput) | |
| 47 | - f.append(upDownInput); | |
| 48 | - //字典转换 | |
| 49 | - dictionaryUtils.transformDom($('.nt-dictionary', f)); | |
| 50 | - | |
| 51 | - //班次类型切换 | |
| 52 | - $('select[name=type2]', f).trigger('change'); | |
| 53 | - | |
| 54 | - f.formValidation({ | |
| 55 | - framework: 'uikit', | |
| 56 | - locale: 'zh_CN' | |
| 57 | - }).on('add_reason_field', function () { | |
| 58 | - $(this).formValidation('addField', 'reason'); | |
| 59 | - }); | |
| 60 | - | |
| 61 | - $f('type2', f).attr('disabled', 'disabled'); | |
| 62 | - return f; | |
| 63 | - } | |
| 64 | - | |
| 65 | - function $f(name, f) { | |
| 66 | - return $('[name=' + name + ']', f); | |
| 67 | - } | |
| 68 | - | |
| 69 | - function changeField(f, tf) { | |
| 70 | - $f('type1', tf).val('临加'); | |
| 71 | - $f('mileageType', tf).html('<option value="service">临加</option>'); | |
| 72 | - $f('destroy', f).parents('.uk-form-controls').hide(); | |
| 73 | - $f('destroy', tf).parents('.uk-form-controls').hide(); | |
| 74 | - } | |
| 75 | - | |
| 76 | - /** | |
| 77 | - * 设置默认值 | |
| 78 | - */ | |
| 79 | - function setDefaultVal() { | |
| 80 | - $f('startStation', f1).attr('disabled', 'disabled'); | |
| 81 | - $f('endStation', f1).val(sch.zdzCode).trigger('change').attr('disabled', 'disabled'); | |
| 82 | - $f('startStation', tf1).val(sch.zdzCode).trigger('change'); | |
| 83 | - | |
| 84 | - //tf1 startDate | |
| 85 | - $f('startDate', tf1).val($f('endDate', f1).val()).trigger('input'); | |
| 86 | - if(tf2){ | |
| 87 | - $('[sch_id_inp]', tf2).val(nextSch.id); | |
| 88 | - $f('endStation', tf2).val(nextSch.qdzCode).trigger('change'); | |
| 89 | - } | |
| 90 | - if(f2){ | |
| 91 | - $('[sch_id_inp]', f2).val(nextSch.id); | |
| 92 | - $f('endStation', f2).val(nextSch.zdzCode).attr('disabled', 'disabled'); | |
| 93 | - $f('startStation', f2).val(nextSch.qdzCode).trigger('change').attr('disabled', 'disabled'); | |
| 94 | - $f('mileage', f2).val(nextSch.jhlc); | |
| 95 | - $f('startDate', f2).val($f('endDate', tf2).val()).trigger('change'); | |
| 96 | - } | |
| 97 | - } | |
| 98 | - | |
| 99 | - /** | |
| 100 | - * 备注级联 | |
| 101 | - */ | |
| 102 | - $(wrap).on('input', '[name=remarks]', function () { | |
| 103 | - var nfs = $(this).parents('.sub_task_form_v2').nextAll('.sub_task_form_v2'); | |
| 104 | - $('[name=remarks]', nfs).val($(this).val()); | |
| 105 | - }); | |
| 106 | - | |
| 107 | - | |
| 108 | - //提交 | |
| 109 | - $('button[type=submit]', wrap).on('click', function () { | |
| 110 | - $(this).addClass('disabled').attr('disabled','disabled'); | |
| 111 | - dataArray = []; | |
| 112 | - $('form.sub_task_form_v2', wrap).data('valid', false) | |
| 113 | - .formValidation('validate'); | |
| 114 | - }); | |
| 115 | - | |
| 116 | - var dataArray = []; | |
| 117 | - $(wrap).on('success.form.fv', 'form.sub_task_form_v2', function (e) { | |
| 118 | - e.preventDefault(); | |
| 119 | - | |
| 120 | - dataArray.push($.extend($(this).serializeJSON(), gb_common.getDisabledVal(this))); | |
| 121 | - $(this).data('valid', true); | |
| 122 | - | |
| 123 | - if (allValidSuccess()) { | |
| 124 | - var i = 0; | |
| 125 | - (function () { | |
| 126 | - var f = arguments.callee; | |
| 127 | - if (i >= dataArray.length) { | |
| 128 | - UIkit.modal('#add-sub-task-main-modal').hide(); | |
| 129 | - $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); | |
| 130 | - return; | |
| 131 | - } | |
| 132 | - var data = dataArray[i]; | |
| 133 | - gb_common.$post('/childTask', data, function (rs) { | |
| 134 | - notify_succ('子任务添加成功'); | |
| 135 | - gb_schedule_table.updateSchedule(rs.t); | |
| 136 | - i++; | |
| 137 | - f(); | |
| 138 | - }); | |
| 139 | - })(); | |
| 140 | - } | |
| 141 | - }); | |
| 142 | - //校验不过 | |
| 143 | - $(wrap).on('err.field.fv','form.sub_task_form_v2', function () { | |
| 144 | - $('button[type=submit]', wrap).removeClass('disabled').removeAttr('disabled'); | |
| 145 | - }); | |
| 146 | - | |
| 147 | - function allValidSuccess() { | |
| 148 | - var flag = true; | |
| 149 | - $('form.sub_task_form_v2', wrap).each(function (i, f) { | |
| 150 | - if(!$(f).data('valid')){ | |
| 151 | - flag = false; | |
| 152 | - return false; | |
| 153 | - } | |
| 154 | - }); | |
| 155 | - return flag; | |
| 156 | - } | |
| 157 | - | |
| 158 | - })(); | |
| 159 | - </script> | |
| 1 | +<!-- 区间变全程 --> | |
| 2 | +<div class="add_range_2_normal"> | |
| 3 | + <div class="forms"></div> | |
| 4 | + | |
| 5 | + <div class="uk-modal-footer uk-text-right" style="margin-top: 5px;"> | |
| 6 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 7 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 8 | + </div> | |
| 9 | + <script> | |
| 10 | + (function () { | |
| 11 | + var wrap = '#add-sub-task-main-modal .add_range_2_normal', | |
| 12 | + sch,nextSch,f1,tf1,f2,tf2; | |
| 13 | + | |
| 14 | + $(wrap).on('init', function (e, data) { | |
| 15 | + e.stopPropagation(); | |
| 16 | + sch = data.sch; | |
| 17 | + nextSch = gb_schedule_table.getNextSch(sch); | |
| 18 | + | |
| 19 | + if(sch.bcType!='region'){ | |
| 20 | + $(wrap).html('<div class="err_panel">该模板只能应用区间班次!</div>'); | |
| 21 | + return; | |
| 22 | + } | |
| 23 | + f1 = addTaskForm(); | |
| 24 | + tf1 = addTaskForm().addClass('temp_service'); | |
| 25 | + changeField(f1, tf1); | |
| 26 | + | |
| 27 | + //返程也是区间 | |
| 28 | + if(nextSch.bcType=='region'){ | |
| 29 | + var u_d_input = '<input name="upDown" type="hidden" value="'+nextSch.xlDir+'">'; | |
| 30 | + tf1.after('<div class="range_2_normal_tt">返程</div>'); | |
| 31 | + tf2 = addTaskForm(u_d_input).addClass('temp_service'); | |
| 32 | + f2 = addTaskForm(u_d_input); | |
| 33 | + | |
| 34 | + changeField(f2, tf2); | |
| 35 | + } | |
| 36 | + | |
| 37 | + //设置默认值 | |
| 38 | + setDefaultVal(); | |
| 39 | + }); | |
| 40 | + | |
| 41 | + function addTaskForm(upDownInput) { | |
| 42 | + var htmlStr = template('sub-task-v2-form-temp', {sch: sch}); | |
| 43 | + var f = $(htmlStr); | |
| 44 | + $('.forms', wrap).append(f); | |
| 45 | + | |
| 46 | + if(upDownInput) | |
| 47 | + f.append(upDownInput); | |
| 48 | + //字典转换 | |
| 49 | + dictionaryUtils.transformDom($('.nt-dictionary', f)); | |
| 50 | + | |
| 51 | + //班次类型切换 | |
| 52 | + $('select[name=type2]', f).trigger('change'); | |
| 53 | + | |
| 54 | + f.formValidation({ | |
| 55 | + framework: 'uikit', | |
| 56 | + locale: 'zh_CN' | |
| 57 | + }).on('add_reason_field', function () { | |
| 58 | + $(this).formValidation('addField', 'reason'); | |
| 59 | + }); | |
| 60 | + | |
| 61 | + $f('type2', f).attr('disabled', 'disabled'); | |
| 62 | + return f; | |
| 63 | + } | |
| 64 | + | |
| 65 | + function $f(name, f) { | |
| 66 | + return $('[name=' + name + ']', f); | |
| 67 | + } | |
| 68 | + | |
| 69 | + function changeField(f, tf) { | |
| 70 | + $f('type1', tf).val('临加'); | |
| 71 | + $f('mileageType', tf).html('<option value="service">临加</option>'); | |
| 72 | + $f('destroy', f).parents('.uk-form-controls').hide(); | |
| 73 | + $f('destroy', tf).parents('.uk-form-controls').hide(); | |
| 74 | + } | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * 设置默认值 | |
| 78 | + */ | |
| 79 | + function setDefaultVal() { | |
| 80 | + $f('startStation', f1).attr('disabled', 'disabled'); | |
| 81 | + $f('endStation', f1).val(sch.zdzCode).trigger('change').attr('disabled', 'disabled'); | |
| 82 | + $f('startStation', tf1).val(sch.zdzCode).trigger('change'); | |
| 83 | + | |
| 84 | + //tf1 startDate | |
| 85 | + $f('startDate', tf1).val($f('endDate', f1).val()).trigger('input'); | |
| 86 | + if(tf2){ | |
| 87 | + $('[sch_id_inp]', tf2).val(nextSch.id); | |
| 88 | + $f('endStation', tf2).val(nextSch.qdzCode).trigger('change'); | |
| 89 | + } | |
| 90 | + if(f2){ | |
| 91 | + $('[sch_id_inp]', f2).val(nextSch.id); | |
| 92 | + $f('endStation', f2).val(nextSch.zdzCode).attr('disabled', 'disabled'); | |
| 93 | + $f('startStation', f2).val(nextSch.qdzCode).trigger('change').attr('disabled', 'disabled'); | |
| 94 | + $f('mileage', f2).val(nextSch.jhlc); | |
| 95 | + $f('startDate', f2).val($f('endDate', tf2).val()).trigger('change'); | |
| 96 | + } | |
| 97 | + } | |
| 98 | + | |
| 99 | + /** | |
| 100 | + * 备注级联 | |
| 101 | + */ | |
| 102 | + $(wrap).on('input', '[name=remarks]', function () { | |
| 103 | + var nfs = $(this).parents('.sub_task_form_v2').nextAll('.sub_task_form_v2'); | |
| 104 | + $('[name=remarks]', nfs).val($(this).val()); | |
| 105 | + }); | |
| 106 | + | |
| 107 | + | |
| 108 | + //提交 | |
| 109 | + $('button[type=submit]', wrap).on('click', function () { | |
| 110 | + $(this).addClass('disabled').attr('disabled','disabled'); | |
| 111 | + dataArray = []; | |
| 112 | + $('form.sub_task_form_v2', wrap).data('valid', false) | |
| 113 | + .formValidation('validate'); | |
| 114 | + }); | |
| 115 | + | |
| 116 | + var dataArray = []; | |
| 117 | + $(wrap).on('success.form.fv', 'form.sub_task_form_v2', function (e) { | |
| 118 | + e.preventDefault(); | |
| 119 | + | |
| 120 | + dataArray.push($.extend($(this).serializeJSON(), gb_common.getDisabledVal(this))); | |
| 121 | + $(this).data('valid', true); | |
| 122 | + | |
| 123 | + if (allValidSuccess()) { | |
| 124 | + var i = 0; | |
| 125 | + (function () { | |
| 126 | + var f = arguments.callee; | |
| 127 | + if (i >= dataArray.length) { | |
| 128 | + UIkit.modal('#add-sub-task-main-modal').hide(); | |
| 129 | + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); | |
| 130 | + return; | |
| 131 | + } | |
| 132 | + var data = dataArray[i]; | |
| 133 | + gb_common.$post('/childTask', data, function (rs) { | |
| 134 | + notify_succ('子任务添加成功'); | |
| 135 | + gb_schedule_table.updateSchedule(rs.t); | |
| 136 | + i++; | |
| 137 | + f(); | |
| 138 | + }); | |
| 139 | + })(); | |
| 140 | + } | |
| 141 | + }); | |
| 142 | + //校验不过 | |
| 143 | + $(wrap).on('err.field.fv','form.sub_task_form_v2', function () { | |
| 144 | + $('button[type=submit]', wrap).removeClass('disabled').removeAttr('disabled'); | |
| 145 | + }); | |
| 146 | + | |
| 147 | + function allValidSuccess() { | |
| 148 | + var flag = true; | |
| 149 | + $('form.sub_task_form_v2', wrap).each(function (i, f) { | |
| 150 | + if(!$(f).data('valid')){ | |
| 151 | + flag = false; | |
| 152 | + return false; | |
| 153 | + } | |
| 154 | + }); | |
| 155 | + return flag; | |
| 156 | + } | |
| 157 | + | |
| 158 | + })(); | |
| 159 | + </script> | |
| 160 | 160 | </div> |
| 161 | 161 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/utils/dispatch_pattern.js
| 1 | 1 | /** 调度模式 */ |
| 2 | 2 | |
| 3 | +//主调和监控模式 | |
| 4 | +var operationMode = window.localStorage.getItem('operationMode'); | |
| 3 | 5 | var gb_dp_initHttpIntercept = function () { |
| 4 | - //主调和监控模式 | |
| 5 | - var operationMode = window.localStorage.getItem('operationMode'); | |
| 6 | 6 | $(document).off('ajaxSend', interceptPOST); |
| 7 | 7 | $('body>.north').removeClass('monitor main'); |
| 8 | 8 | if (operationMode == 0) { | ... | ... |