Commit 8611b6e01fe8a91d6fb17747f820ce95c9ad5692

Authored by 徐烜
1 parent 79aff31e

1、按照临港公交需求,添加v4版本的动态时刻表生成,具体查看相关代码

src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
... ... @@ -476,13 +476,13 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
476 476  
477 477 // TODO
478 478 Map<String, Object> param = new HashMap<>();
479   - param.put("station.id_eq", null);
  479 + param.put("id_eq", null);
480 480 if (station1 == null) {
481   - param.put("station.id_eq", lpObjList.get(0).getStationRouteId1());
  481 + param.put("id_eq", lpObjList.get(0).getStationRouteId1());
482 482 station1 = ((List<StationRoute>) stationRouteService.list(param)).get(0);
483 483 }
484 484 if (station2 == null) {
485   - param.put("station.id_eq", lpObjList.get(0).getStationRouteId2());
  485 + param.put("id_eq", lpObjList.get(0).getStationRouteId2());
486 486 station2 = ((List<StationRoute>) stationRouteService.list(param)).get(0);
487 487 }
488 488  
... ... @@ -601,13 +601,13 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
601 601  
602 602 // TODO
603 603 Map<String, Object> param = new HashMap<>();
604   - param.put("station.id_eq", null);
  604 + param.put("id_eq", null);
605 605 if (station1 == null) {
606   - param.put("station.id_eq", lpObjList.get(0).getStationRouteId1());
  606 + param.put("id_eq", lpObjList.get(0).getStationRouteId1());
607 607 station1 = ((List<StationRoute>) stationRouteService.list(param)).get(0);
608 608 }
609 609 if (station2 == null) {
610   - param.put("station.id_eq", lpObjList.get(0).getStationRouteId2());
  610 + param.put("id_eq", lpObjList.get(0).getStationRouteId2());
611 611 station2 = ((List<StationRoute>) stationRouteService.list(param)).get(0);
612 612 }
613 613  
... ...
src/main/java/com/bsth/service/schedule/utils/DataToolsServiceImpl.java
... ... @@ -4,6 +4,7 @@ import com.bsth.service.schedule.exception.ScheduleException;
4 4 import com.google.common.io.Files;
5 5 import org.joda.time.DateTime;
6 6 import org.pentaho.di.core.KettleEnvironment;
  7 +import org.pentaho.di.core.encryption.Encr;
7 8 import org.pentaho.di.core.logging.KettleLogStore;
8 9 import org.pentaho.di.core.logging.LoggingBuffer;
9 10 import org.pentaho.di.core.logging.LoggingRegistry;
... ... @@ -285,4 +286,11 @@ public class DataToolsServiceImpl implements DataToolsService {
285 286 }
286 287 }
287 288  
  289 +
  290 + public static void main(String[] args) throws Exception {
  291 + KettleEnvironment.init();
  292 + String pwd = "SldHTA==";
  293 + String decryptPwd = Encr.decryptPassword(pwd);
  294 + System.out.println(Encr.encryptPassword("jwgl"));
  295 + }
288 296 }
... ...
src/main/resources/static/pages/base/timesmodel/add.html
... ... @@ -30,12 +30,12 @@
30 30 <div class="portlet light bordered" id="form-wizard-info">
31 31 <div class="portlet-title">
32 32 <div class="caption">
33   - <i class="icon-equalizer font-red-sunglo"></i>
  33 + <i class="icon-equalizer font-red-sunglo"></i>
34 34 <span class="caption-subject font-red-sunglo bold uppercase">添加参数
35 35 <span class="step-title"> 1 - 4 </span>
36 36 </span>
37 37 </div>
38   -
  38 +
39 39 <div class="actions">
40 40 <div class="btn-group btn-group-devided" data-toggle="buttons">
41 41 <a class="btn btn-circle blue openHaveSkb" href="javascript:;" data-pjax><i class="fa fa-check"></i> 排班诊断</a>
... ... @@ -80,20 +80,20 @@
80 80 </a>
81 81 </li>
82 82 </ul>
83   -
  83 +
84 84 <!-- 进度条 -->
85 85 <div id="bar" class="progress progress-striped" role="progressbar">
86 86 <div class="progress-bar progress-bar-success" style="width: 25%;"></div>
87 87 </div>
88   -
  88 +
89 89 <div class="tab-content">
90 90 <div class="alert alert-danger display-hide">
91 91 <button class="close" data-close="alert"></button>
92 92 您的输入有误,请检查下面的输入项
93 93 </div>
94 94 <div class="alert alert-success display-none">
95   - <button class="close" data-dismiss="alert"></button>
96   - 验证成功!
  95 + <button class="close" data-dismiss="alert"></button>
  96 + 验证成功!
97 97 </div>
98 98 <!-- 线路名称 -->
99 99 <div class="tab-pane active" id="tab1">
... ... @@ -152,11 +152,14 @@
152 152 <input type="radio" class="icheck" name="baseRes" value=2 > 发车间隔分析(旧:一步调整)
153 153 </label>
154 154 <label>
155   - <input type="radio" class="icheck" name="baseRes" value=3 checked> 发车间隔分析(新:增量调整-单向进场)
  155 + <input type="radio" class="icheck" name="baseRes" value=3 > 发车间隔分析(新:增量调整-单向进场)
156 156 </label>
157 157 <label>
158 158 <input type="radio" class="icheck" name="baseRes" value=0> 客流大数据分析
159 159 </label>
  160 + <label>
  161 + <input type="radio" class="icheck" name="baseRes" value=4 checked> 班型/发车间隔
  162 + </label>
160 163 </div>
161 164 </div>
162 165 </div>
... ... @@ -197,6 +200,11 @@
197 200 <!-- END FORM-->
198 201 </div>
199 202 </div>
  203 +
  204 +<!-- 自定义的参数组件 -->
  205 +<script type="text/javascript" src="/pages/base/timesmodel/tepms/components/stoptypeSelect.js"></script>
  206 +<script type="text/javascript" src="/pages/base/timesmodel/tepms/components/bxtypeSelect.js"></script>
  207 +
200 208 <script src="/pages/base/timesmodel/js/add-form-wizard.js"></script>
201 209 <script src="/pages/base/timesmodel/js/add-form-reload.js"></script>
202   -<script src="/pages/base/timesmodel/js/tagsinput.js"></script>
203 210 \ No newline at end of file
  211 +<script src="/pages/base/timesmodel/js/tagsinput.js"></script>
... ...
src/main/resources/static/pages/base/timesmodel/gantt.html
... ... @@ -141,7 +141,7 @@
141 141 <!-- actions 组件END -->
142 142 </div>
143 143 <!-- portlet-title组件END -->
144   -
  144 +
145 145 <!-- portlet-body组件START -->
146 146 <div class="portlet-body" id="scrllmouseEvent">
147 147 <!-- ganttSvgContainer SVG组件START -->
... ... @@ -162,6 +162,10 @@
162 162 </div>
163 163  
164 164  
  165 +<div id = "scheduleBuildInfo_V4">
  166 + <!-- 对应 /pages/base/timesmodel/js/v4/scheduleBuilder.component.js 组件 -->
  167 +</div>
  168 +
165 169 <!-- echarts4 -->
166 170 <script src="/metronic_v4.5.4/plugins/echarts4/echarts.min.js"></script>
167 171  
... ... @@ -202,7 +206,10 @@
202 206 <script src="/pages/base/timesmodel/js/v2_2/strategy/runtime/LinearRuntimeS1.js"></script>
203 207 <script src="/pages/base/timesmodel/js/v2_2/strategy/layovertime/LayoverTimeS1.js"></script>
204 208 <script src="/pages/base/timesmodel/js/v2/strategy/StrategyUtils.js"></script>
205   -<script src="/pages/base/timesmodel/js/v2_2/strategy/StrategyUtils.js"></script>
  209 +<script src="/pages/base/timesmodel/js/v4/strategy/StrategyUtils.js"></script>
  210 +
  211 +<!-- v4版本的时刻表生成组件 -->
  212 +<script src="/pages/base/timesmodel/js/v4/scheduleBuilder.component.js"></script>
206 213  
207 214 <script src="/pages/base/timesmodel/js/errorinfo.js"></script>
208 215 <script src="/pages/base/timesmodel/js/parameters.js"></script>
... ... @@ -225,4 +232,4 @@
225 232 <li><a href="javascript:dropdownMenuSetVenting('{{dataIndex}}');" id="setVenting">设为直放</a></li>
226 233 <li><a href="javascript:dropdownMenuSetMajor('{{dataIndex}}');" id="setMajor">设为放站</a></li>
227 234 </ul>
228   -</script>
229 235 \ No newline at end of file
  236 +</script>
... ...
src/main/resources/static/pages/base/timesmodel/js/add-form-wizard.js
... ... @@ -352,6 +352,8 @@ var SKBFormWizard = function() {
352 352 tempName = 'bctype_temp';
353 353 else if (n==2 || n==3)
354 354 tempName = 'fcjx_temp';
  355 + else if (n == 4)
  356 + tempName = 'run_headway_temp';
355 357 // 2、获参数详情模版html内容.
356 358 $.get('/pages/base/timesmodel/tepms/'+ tempName + '.html', function(html){
357 359 $('#tab3').append(html);
... ... @@ -459,7 +461,7 @@ var SKBFormWizard = function() {
459 461 // 返回参数详情模版.
460 462 return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
461 463 });
462   - }else if (n==2 || n==3) {
  464 + }else if (n==2 || n==3 || n == 4) {
463 465 // 更具站点路由版本获取起点终点站
464 466 var iversion = $('#lineVersionSelect').val();
465 467 $get('/stationroute/all',{'line.id_eq':lineId,'destroy_eq':0, 'versions_eq': iversion},function(result) {
... ... @@ -909,6 +911,8 @@ var SKBFormWizard = function() {
909 911 var displayConfirm = function() {
910 912 // 遍历表单元素下的tab4的class名称为form-control-static
911 913 $('#tab4 .form-control-static', form).each(function(){
  914 + console.log(form);
  915 +
912 916 var input = $('[name="'+$(this).attr("data-display")+'"]', form);// 定义input
913 917 if (input.is(":radio")) {
914 918 input = $('[name="'+$(this).attr("data-display")+'"]:checked', form);
... ... @@ -1107,6 +1111,47 @@ var SKBFormWizard = function() {
1107 1111 // TODO:发车间隔分析参数设置
1108 1112  
1109 1113 layer.close(i);
  1114 +
  1115 + } else if (baseRes == 4) { // 班型/发车间隔
  1116 + // 上下行首末班日期控件
  1117 + $('#startStationFirstTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  1118 + $('#startStationEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  1119 + $('#endStationFirstTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  1120 + $('#endStationEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  1121 +
  1122 + // 停车场下拉框控件
  1123 + gettccInfo(function(cd) {
  1124 + var options = '<option value="">请选择...</option><optgroup label="停车场">';
  1125 + var $_len = cd.length;
  1126 + if($_len>0) {
  1127 + $.each(cd, function(i, d){
  1128 + options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>';
  1129 + });
  1130 +
  1131 + }
  1132 + options += '</optgroup>';
  1133 + $('#carPark_id').html(options).select2();
  1134 + $('#carPark_id').select2("val",r.content[0].carPark);
  1135 + // 关闭弹出加载层
  1136 + layer.close(i);
  1137 + });
  1138 +
  1139 + // 早高峰晚高峰日期控件
  1140 + $('#earlyStartTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  1141 + $('#earlyEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  1142 + $('#lateStartTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  1143 + $('#lateEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  1144 +
  1145 + // 停站类型选择组件
  1146 + $('#stopType_com_id').stoptypeSelect(r.content[0]);
  1147 + // 班型选择组件
  1148 + $('#bxType_com_id').bxtypeSelect(r.content[0]);
  1149 +
  1150 + // TODO:还有其他参数
  1151 +
  1152 +
  1153 + layer.close(i);
  1154 +
1110 1155 }
1111 1156  
1112 1157 });
... ...
src/main/resources/static/pages/base/timesmodel/js/gantt.js
... ... @@ -39,7 +39,7 @@
39 39 offsetY : offsetY,
40 40 content :'<div class="tipsdscontinue"> <span>图例:</span> <div class="dscrp sx"></div><span>:上行</span> <div class="dscrp xx"></div> <span>:下行</span></br><div/></br>' +
41 41 '<div class="tipsdscontinue"> <span>该模块支持鼠标拖拽功能.</span> <div/>'
42   -
  42 +
43 43 });
44 44 $('.tipso-animation').tipso('show');
45 45 setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
... ... @@ -84,7 +84,11 @@
84 84 console.log(_paramObj);
85 85 map.clzs = InternalScheduleObj_v2_2.calcuClzx(_paramObj);
86 86 CSMap = getMaxCarAndStopSpace1(map);
87   - }
  87 + } else if (map.baseRes == '4') {
  88 + // 创建参数对象
  89 + _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); // TODO:暂时使用v2_1版本的方法,通用的,后续再放到v2_2版本中
  90 +
  91 + }
88 92  
89 93 // 定义时间参数.
90 94 var stopArray = getsj(map);
... ... @@ -107,7 +111,11 @@
107 111 Main_v2.exportDataConfig(data.aInternalLpObj);
108 112 } else if (map.baseRes == '3') { // 主站停站使用v2_2版本
109 113 data = Main_v2_2.BXPplaceClassesTime03(_paramObj, CSMap.maxCar);
110   - }
  114 + } else if (map.baseRes == '4') { // v4版本
  115 + var scheduleBuilder_v4_com = $('#scheduleBuildInfo_V4').scheduleBuilder_v4(_paramObj);
  116 + data = scheduleBuilder_v4_com.getGanttData();
  117 +
  118 + }
111 119  
112 120 }else {
113 121 var jsonA = JSON.parse(objD);
... ... @@ -147,9 +155,9 @@
147 155 // graph.addHistory();
148 156 // // 初始化右键菜单.
149 157 // contextInit(graph);
150   -
151 158  
152   - if (map.baseRes == '3' || map.baseRes == '1' || map.baseRes == '0') {
  159 +
  160 + if (map.baseRes == '4' || map.baseRes == '3' || map.baseRes == '1' || map.baseRes == '0') {
153 161 // 导入导出设置
154 162 // Main_v2_2.exportExcelConfig($_GlobalGraph.getDataArray);
155 163  
... ... @@ -192,19 +200,19 @@
192 200 return _rtnBcArray;
193 201 };
194 202 if (_paramObj == null)
195   - return
  203 + return;
196 204 Main_v2_2.exportExcelConfig(_paramObj, _dfun);
197 205 }
198 206  
199 207 // 关闭弹出层
200 208 layer.close(indexLoad);
201 209 },500);
202   -
  210 +
203 211 /**
204 212 * @description : (TODO) 根据客流数据分析各个时间段内的配车数、获取发车间隙与车辆数的最大值.
205   - *
  213 + *
206 214 * @param [map--表单参数;seMap--开始与结束时间字符串点].
207   - *
  215 + *
208 216 * @returns 返回一个分装时间段内的车辆数、发车间隙、车辆数的最大值集合.
209 217 * */
210 218 function getMaxCarAndStopSpace0(map,seMap) {
... ... @@ -215,27 +223,27 @@
215 223 {'type':'ee','num':parseInt(map.wgfpcs),'time':map.lateStartTime + '-' + map.lateEndTime}]);
216 224 return {'gattA':sortGattA,'stopSpace': Math.round(map.zzsj/sortGattA[sortGattA.length-1].num) ,'maxCar':getyArray(sortGattA)};
217 225 }
218   -
  226 +
219 227 /**
220 228 * @description : (TODO) 根据班型与人次得到发车间隙、车辆数的最大值.
221   - *
  229 + *
222 230 * @param [map--表单参数].
223   - *
  231 + *
224 232 * @returns 返回一个分装发车间隙、车辆数的最大值集合.
225 233 * */
226 234 function getMaxCarAndStopSpace1(map) {
227 235 return {'gattA':null,
228   - 'fcjx': {'gffcjx': Math.round(map.zzsj.gfzzsj/map.clzs) ,
  236 + 'fcjx': {'gffcjx': Math.round(map.zzsj.gfzzsj/map.clzs) ,
229 237 'dgfcjx': Math.round(map.zzsj.dgzzsj/map.clzs),
230 238 'dgmaxfcjx' : parseInt(map.dgmaxfcjx)},
231 239 'maxCar':BaseFun.getYAxisCarArray(parseInt(map.clzs))};
232 240 }
233   -
  241 +
234 242 /**
235 243 * @description : (TODO) 封装方向成对的数据集合.
236   - *
  244 + *
237 245 * @param [gatps--表单数据;dira--方向集合;bcTypeArr--班次类型集合]
238   - *
  246 + *
239 247 * @returns 返回一个封装方向成对的数据集合.
240 248 * */
241 249 function argsMap(gatps,dira,bcTypeArr,seMap) {
... ... @@ -278,46 +286,46 @@
278 286 'zzsj':gatps.zzsj// 周转时间.
279 287 };
280 288 }
281   -
  289 +
282 290 /**
283 291 * @description : (TODO) 获取周转时间.
284   - *
  292 + *
285 293 * @params [map--表单配置参数].
286   - *
  294 + *
287 295 * @return 返回一个周转时间.
288 296 * */
289 297 function getzzsj(map) {
290 298 // 一圈所用时间 (上行+下行+停歇时间)
291 299 return {
292   - 'gfzzsj': parseInt(map.earlyUpTime =='' ? map.upTravelTime : map.earlyUpTime) +
293   - parseInt(map.gfupStopTime) + parseInt(map.gfdownStopTime) +
  300 + 'gfzzsj': parseInt(map.earlyUpTime =='' ? map.upTravelTime : map.earlyUpTime) +
  301 + parseInt(map.gfupStopTime) + parseInt(map.gfdownStopTime) +
294 302 parseInt(map.earlyDownTime =='' ? map.downTravelTime : map.earlyDownTime ), // 高峰周转时间
295   - 'dgzzsj': parseInt(map.troughUpTime==''? map.upTravelTime : map.troughUpTime) +
296   - parseInt(map.dgupStopTime) + parseInt(map.dgdownStopTime) +
  303 + 'dgzzsj': parseInt(map.troughUpTime==''? map.upTravelTime : map.troughUpTime) +
  304 + parseInt(map.dgupStopTime) + parseInt(map.dgdownStopTime) +
297 305 parseInt(map.troughDownTime==''? map.downTravelTime: map.troughDownTime),// 低谷周转时间
298   - 'dgmaxzzsj' : parseInt(map.troughUpTime==''? map.upTravelTime : map.troughUpTime) +
299   - parseInt(map.dgmaxtzsj) + parseInt(map.dgmaxtzsj) +
  306 + 'dgmaxzzsj' : parseInt(map.troughUpTime==''? map.upTravelTime : map.troughUpTime) +
  307 + parseInt(map.dgmaxtzsj) + parseInt(map.dgmaxtzsj) +
300 308 parseInt(map.troughDownTime==''? map.downTravelTime: map.troughDownTime),// 低谷最大的周转时间
301 309 };
302 310 }
303   -
  311 +
304 312 /**
305 313 * @description : (TODO) 获取开始与结束时间字符串.
306   - *
  314 + *
307 315 * @param [map--表单配置参数]
308   - *
  316 + *
309 317 * @return 返回开始与结束时间字符串集合.
310 318 * */
311 319 function getStartAndEndDate(map) {
312 320 return {'s': map.linePlayType == '1' ? map.startStationFirstTime : getMinDate(map.startStationFirstTime,map.endStationFirstTime),
313 321 'e': map.linePlayType == '1' ? map.startStationEndTime : getMaxDate(map.startStationEndTime,map.endStationEndTime)}
314 322 }
315   -
  323 +
316 324 /**
317 325 * @description : (TODO) 获取最小时间.
318   - *
  326 + *
319 327 * @param [d1--时间1;d2--时间2]
320   - *
  328 + *
321 329 * @return 返回一个最小时间.
322 330 * */
323 331 function getMinDate(d1,d2) {
... ... @@ -328,12 +336,12 @@
328 336 str = d1;
329 337 return str;
330 338 }
331   -
  339 +
332 340 /**
333 341 * @description : (TODO) 字符串时间点转时间对象.
334   - *
  342 + *
335 343 * @param [t--字符串时间]
336   - *
  344 + *
337 345 * @return 返回一个时间对象.
338 346 * */
339 347 function strToTime(t) {
... ... @@ -345,12 +353,12 @@
345 353 }
346 354 return d;
347 355 }
348   -
  356 +
349 357 /**
350 358 * @description : (TODO) 获取最大时间.
351   - *
  359 + *
352 360 * @param [d1--时间1;d2--时间2]
353   - *
  361 + *
354 362 * @return 返回一个最大时间.
355 363 * */
356 364 function getMaxDate(d1,d2) {
... ... @@ -361,13 +369,13 @@
361 369 str = d2;
362 370 return str;
363 371 }
364   -
  372 +
365 373 /**
366 374 * @description : (TODO) 获取开始与结束时间对象.
367   - *
  375 + *
368 376 * @param [d--日期;str--时间点字符串]
369   - *
370   - * @return 返回一个开始与结束时间的集合对象.
  377 + *
  378 + * @return 返回一个开始与结束时间的集合对象.
371 379 * */
372 380 function getksjssj(d,str) {
373 381 var newDate = new Date();
... ... @@ -375,11 +383,11 @@
375 383 newDate = new Date(d.replace(/-/g,"/"));
376 384 }
377 385 var kssj = d3.time.hour.offset(BaseFun.getEndDate(
378   - newDate.getFullYear()+ "-" +
379   - (newDate.getMonth()+1) + "-" +
380   - newDate.getDate() + ' ' +
  386 + newDate.getFullYear()+ "-" +
  387 + (newDate.getMonth()+1) + "-" +
  388 + newDate.getDate() + ' ' +
381 389 str.split(':')[0] + ':00'),-1);
382   -
  390 +
383 391 var year = '' , month = '',dt = '';
384 392 if(newDate.getDate()+1>31)
385 393 dt = '01';
... ... @@ -389,7 +397,7 @@
389 397 month = '01';
390 398 else if(newDate.getDate()+1>31)
391 399 month = newDate.getMonth()+2;
392   - else
  400 + else
393 401 month = newDate.getMonth()+1;
394 402 if(newDate.getMonth()+1>12)
395 403 year = newDate.getFullYear()+1;
... ... @@ -398,12 +406,12 @@
398 406 var jssj = BaseFun.getEndDate(year + '-' + month + '-' + dt + ' ' + '00:00');
399 407 return {'kssj' : kssj, 'jssj' : jssj};
400 408 }
401   -
  409 +
402 410 /**
403 411 * @description : (TODO) 获取时间参数配置信息
404   - *
  412 + *
405 413 * @param [map--表单配置参数]
406   - *
  414 + *
407 415 * @returns 返回一个时间参数配置数据.
408 416 * */
409 417 function getsj(map) {
... ... @@ -432,26 +440,26 @@
432 440 'xxjclc':map.downInMileage==''? 0 : parseInt(map.downInMileage),// 下行进场里程.
433 441 'xxcclc':map.downOutMileage==''?0:parseInt(map.downOutMileage),// 下行出场里程.
434 442 'lbsj': map.lb==''? 0 : parseInt(map.lb) // 例保时间.
435   - }];
  443 + }];
436 444 }
437   -
  445 +
438 446 /**
439 447 * @description : (TODO) 获取方向代码.
440   - *
  448 + *
441 449 * @param [sx--上行;xx--下行].
442   - *
  450 + *
443 451 * @returns 返回一个方向集合对象.
444 452 * */
445 453 function getsxxDM(sx,xx) {
446 454 return [sx == null || sx == '' || typeof(sx)=='undefined' ? 'relationshipGraph-up' : sx,
447 455 xx == null || xx == '' || typeof(sx)=='undefined' ? 'relationshipGraph-down': xx];
448 456 }
449   -
  457 +
450 458 /**
451 459 * @description : (TODO) 获取班次类型.
452   - *
  460 + *
453 461 * @param [bd--早例保;out--出场;normal--正常;cf--吃饭;in_--进场;lc--晚例保;major--放站;venting--直放;region--区间].
454   - *
  462 + *
455 463 * @returns 返回一个班次类型集合对象.
456 464 * */
457 465 function getbcType(bd,out,normal,cf,in_,lc,major,venting,region) {
... ... @@ -465,24 +473,24 @@
465 473 'venting': venting == null || venting == '' || typeof(venting)=='undefined' ? 'venting' : venting,
466 474 'region': region == null || region == '' || typeof(region)=='undefined' ? 'region' : region,};
467 475 }
468   -
  476 +
469 477 /**
470 478 * @description : (TODO) 获取车辆最大数值.
471   - *
  479 + *
472 480 * @param [arr-数组]
473   - *
  481 + *
474 482 * @returns 返回车辆数最大值.
475 483 * */
476 484 function getyArray(arr) {
477 485 // 获取车辆最大数,作为Y轴的值
478 486 return BaseFun.getYAxisCarArray(arr[arr.length-1].num);
479 487 }
480   -
  488 +
481 489 /**
482 490 * @description : (TODO) 验证参数是否为空.
483   - *
  491 + *
484 492 * @param [args--需要验证的参数]
485   - *
  493 + *
486 494 * @return 返回一个布尔值.
487 495 * */
488 496 function isNull(agrs) {
... ... @@ -491,12 +499,12 @@
491 499 tag = true;
492 500 return tag;
493 501 }
494   -
  502 +
495 503 /**
496 504 * @description : (TODO) 获取路牌编码.
497   - *
  505 + *
498 506 * @param [arr--路牌对象集合]
499   - *
  507 + *
500 508 * @return 返回一个路牌编码数组集合.
501 509 * */
502 510 function getylp(arr) {
... ... @@ -509,9 +517,9 @@
509 517 }
510 518 /**
511 519 * @description : (TODO) 获取甘特图参数配置信息.
512   - *
  520 + *
513 521 * @param [p--配置参数]
514   - *
  522 + *
515 523 * @return 返回甘特图的参数配置信息.
516 524 * */
517 525 function getGraphArgus(p) {
... ... @@ -558,10 +566,10 @@
558 566 };
559 567 return args;
560 568 }
561   -
  569 +
562 570 /**
563 571 * @descirption : (TODO) 初始化右击rect元素右键菜单栏.
564   - *
  572 + *
565 573 * @status OK.
566 574 * */
567 575 function contextInit(graph) {
... ... @@ -614,7 +622,7 @@
614 622 // 判断遍历的当前班次路牌是否与选中修改的班次路牌是否一致.
615 623 if(dtAll[t].lpNo == nodeContext.dqbcData.lpNo)
616 624 dqlpbc.push(dtAll[t]);
617   - else
  625 + else
618 626 qtlpbc.push(dtAll[t]);
619 627 }
620 628 // 首先除去进出场班次和早晚例保班次.定义进出出场和早晚例保班次数组、正常(包括正常、区间、直放、吃饭、放站)班次数组.
... ... @@ -625,7 +633,7 @@
625 633 dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.lc ||
626 634 dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.out)
627 635 jcclbbcA.push(dqlpbc[d]);
628   - else
  636 + else
629 637 normalA.push(dqlpbc[d]);
630 638 }
631 639 // 把当前路牌下的班次按发车序号顺序排序.
... ... @@ -767,7 +775,7 @@
767 775 }},
768 776 ]);
769 777 }
770   -
  778 +
771 779 function trimDir(graph,nodeContext,dqDir,tzDir) {
772 780 // 获取所有班次. 定义当前路牌下的所有班次、其他路牌下的班次.
773 781 var dtAll = graph.getDataArray(),dqlpbc = new Array,qtlpbc = new Array();
... ... @@ -776,7 +784,7 @@
776 784 // 判断遍历的当前班次路牌是否与选中修改的班次路牌是否一致.
777 785 if(dtAll[t].lpNo == nodeContext.dqbcData.lpNo)
778 786 dqlpbc.push(dtAll[t]);
779   - else
  787 + else
780 788 qtlpbc.push(dtAll[t]);
781 789 }
782 790 // 首先除去进出场班次和早晚例保班次.定义进出出场和早晚例保班次数组、正常(包括正常、区间、直放、吃饭、放站)班次数组.
... ... @@ -787,7 +795,7 @@
787 795 dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.lc ||
788 796 dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.out)
789 797 jcclbbcA.push(dqlpbc[d]);
790   - else
  798 + else
791 799 normalA.push(dqlpbc[d]);
792 800 }
793 801 // 修改当前路牌下的班次方向.
... ... @@ -807,9 +815,9 @@
807 815 // 记录当前操作.
808 816 graph.addHistory();
809 817 }
810   -
  818 +
811 819 function isType(bcType,graph,msg,inType,opr) {
812   - var tag = false ;
  820 + var tag = false ;
813 821 layer.closeAll();
814 822 if(bcType==graph.configuration.dataMap.bcTypeArr.bd) {
815 823 layer.msg('当前选择的班次是【早例保时间】不能'+ msg +'!');
... ... @@ -832,14 +840,14 @@
832 840 }
833 841 return tag;
834 842 }
835   -
  843 +
836 844 /**
837 845 * @description : (TODO) 左菜单操作成功状态反馈.
838   - *
  846 + *
839 847 * @param [msg--消息状态]
840 848 * */
841 849 function stateSuccess(msg) {
842 850 layer.closeAll();
843 851 layer.msg('操作成功!已【'+ msg + '】!');
844 852 }
845   -})();
846 853 \ No newline at end of file
  854 +})();
... ...
src/main/resources/static/pages/base/timesmodel/js/v4/scheduleBuilder.component.js 0 → 100644
  1 +/**
  2 + * 时刻表生成v4版本。
  3 + * 基本逻辑如下:
  4 + * 1、使用各个时间段的平均发车间隔,首班车,末班车发车时间,计算上下行的发车班次
  5 + * 2、将上下行班次连接起来,这是一个VSP(vehicle schedule problem)问题
  6 + * 3、VSP问题求解,使用最简单的方法,不用最优化,只要覆盖所有的班次就可以了,TODO:以后有时间再尝试是哟AI求解器
  7 + */
  8 +(function ($jQuery) {
  9 + // 所有组件实例共用全局函数和对象
  10 + // TODO:全局对象
  11 + // ------------ 全局函数(如下)-------------- //
  12 +
  13 + /**
  14 + * 获取内部对象Builder
  15 + * @param _options 组件内部参数
  16 + * @param paramObjV2 v2版本的参数对象(参考:/pages/base/timesmodel/js/v2/ParameterObj.js)
  17 + * @private
  18 + */
  19 + var _getInternalBcObjectBuilder_ = function(_options, paramObjV2) {
  20 + var _block; // block编号,类似路牌
  21 + var _run; // run编号,对block runcut产生,目前暂时不用
  22 + var _tripTime; // 发车时间
  23 + var _runTime; // 行驶时间
  24 + var _arriveTime; // 到达时间
  25 + var _layOverTime; // 停站时间
  26 + var _isUp; // boolean 是否上行
  27 + var _tripType; // 班次类型(normal,in_,out, bd, lc, cf等)
  28 +
  29 + // TODO:还有其他参数
  30 +
  31 + return {
  32 + block: function(value) {
  33 + _block = value;
  34 + return this;
  35 + },
  36 + run: function(value) {
  37 + _run = value;
  38 + return this;
  39 + },
  40 + tripTime: function(value) {
  41 + _tripTime = value;
  42 + return this;
  43 + },
  44 + runTime: function(value) {
  45 + _runTime = value;
  46 + return this;
  47 + },
  48 + arriveTime: function(value) {
  49 + _arriveTime = value;
  50 + return this;
  51 + },
  52 + layOverTime: function(value) {
  53 + _layOverTime = value;
  54 + return this;
  55 + },
  56 + isUp: function(value) {
  57 + _isUp = value;
  58 + return this;
  59 + },
  60 + tripType: function(value) {
  61 + _tripType = value;
  62 + return this;
  63 + },
  64 +
  65 + build : function() {
  66 + // 返回InternalBcObj v2版本的班次对象(参考:/pages/base/timesmodel/js/v2/core/InternalBcObj.js)
  67 + return new InternalBcObj(
  68 + { getLpNo : function() { return _block;}, getLpName: function() { return "路牌" + _block; }},
  69 + {
  70 + bcType : _tripType, // 班次类型(normal,in_,out, bd, lc, cf等)
  71 + isUp : _isUp, // boolean是否上下行
  72 + fcno : 0, // 发车顺序号(block后确定)
  73 + fcTimeObj : _tripTime, // 发车时间对象
  74 + bclc : paramObjV2.calcuTravelLcNumber(_isUp, _tripType), // 班次里程
  75 + bcsj : _runTime, // 班次历时
  76 + arrtime : _arriveTime, // 到达时间对象
  77 + stoptime : _layOverTime, // 停站时间
  78 + tccid : _options.tccId, // 停车场id
  79 + ttinfoid : _options.ttInfoId, // 时刻表id
  80 + xl : _options.xlId, // 线路id
  81 + qdzid : _isUp ? _options.upQdzId : _options.downQdzId, // 起点站id
  82 + zdzid : _isUp ? _options.upZdzId : _options.downZdzId // 终点站id
  83 + });
  84 + }
  85 + };
  86 + };
  87 +
  88 + /**
  89 + * 打印数组。
  90 + * @param _array 数组
  91 + * @param logCallBackFun 数组元素的log值函数
  92 + * @private
  93 + */
  94 + var _LogArray = function(_array, logCallBackFun) {
  95 + var _logStrArray = [];
  96 + $jQuery.each(_array, function(index, item) {
  97 + _logStrArray.push(logCallBackFun(item));
  98 + });
  99 + console.log(_logStrArray);
  100 + };
  101 +
  102 + // 验证条件函数。
  103 + var _Asserts = function(condition, msg) {
  104 + if (!condition) {
  105 + throw msg;
  106 + }
  107 + };
  108 +
  109 + /**
  110 + * 重新计算组件内部用参数。
  111 + * @param _options 组件内部参数
  112 + * @param paramObjV2 v2版本的参数对象(看考:/pages/base/timesmodel/js/v2/ParameterObj.js)
  113 + */
  114 + var _calcuParameter = function(_options, paramObjV2) {
  115 + //--------------- 时刻表生成用参数(以下)-----------------//
  116 + // span of service 服务范围参数
  117 + _options.upDirFirstTripTime = paramObjV2.getUpFirstDTimeObj(); // 上行首班车时间(moment对象)
  118 + _options.upDirLastTripTime = paramObjV2.getUpLastDtimeObj(); // 上行末班车时间(moment对象)
  119 + _options.downDirFirstTripTime = paramObjV2.getDownFirstDTimeObj(); // 下行首班车时间(moment对象)
  120 + _options.downDirLastTripTime = paramObjV2.getDownLastDTimeObj(); // 下行末班车时间(moment对象)
  121 +
  122 + // headway 发车间隔参数
  123 + _options.mPeakStartTime = paramObjV2.getMPeakStartTimeObj(); // 早高峰开始时间(moment对象)
  124 + _options.mPeakEndTime = paramObjV2.getMPeakEndTimeObj(); // 早高峰结束时间(moment对象)
  125 + _options.ePeakStartTime = paramObjV2.getEPeakStartTimeObj(); // 晚高峰开始时间(moment对象)
  126 + _options.ePeakEndTime = paramObjV2.getEPeakEndTimeObj(); // 晚高峰结束时间(moment对象)
  127 + _options.mPeakMinHeadway = paramObjV2.getMPeakMinFcjx(); // 早高峰最小发车间隔(分钟,整数类型)
  128 + _options.mPeakMaxHeadway = paramObjV2.getMPeakMaxFcjx(); // 早高峰最大发车间隔(分钟,整数类型)
  129 + _options.ePeakMinHeadway = paramObjV2.getEPeakMinFcjx(); // 晚高峰最小发车间隔(分钟,整数类型)
  130 + _options.ePeakMaxHeadway = paramObjV2.getEPeakMaxFcjx(); // 晚高峰最大发车间隔(分钟,整数类型)
  131 + _options.lowMinHeadway = paramObjV2.getTroughMinFcjx(); // 低谷最小发车间隔(分钟,整数类型)
  132 + _options.lowMaxHeadway = paramObjV2.getTroughMaxFcjx(); // 低谷最大发车间隔(分钟,整数类型)
  133 +
  134 + // running time 行驶时间参数
  135 + _options.upMPeakRunningTime = paramObjV2.getUpMPeakTime(); // 上行早高峰行驶时间(分钟,整数类型)
  136 + _options.upEPeakRunningTime = paramObjV2.getUpEPeakTime(); // 上行晚高峰行驶时间(分钟,整数类型)
  137 + _options.upLowRunningTime = paramObjV2.getUpTroughTime(); // 上行低谷行驶时间(分钟,整数类型)
  138 + _options.downMPeakRunningTime = paramObjV2.getDownMPeakTime(); // 下行早高峰行驶时间(分钟,整数类型)
  139 + _options.downEPeakRunningTime = paramObjV2.getDownEPeakTime(); // 下行晚高峰行驶时间(分钟,整数类型)
  140 + _options.downLowRunningTime = paramObjV2.getDownTroughTime(); // 下行低谷行驶时间(分钟,整数类型)
  141 +
  142 + // layover time 停站时间参数
  143 + var _tempLayoverTimeRange = paramObjV2.calcuTripLayoverTimeRange(
  144 + _options.mPeakStartTime,
  145 + true,
  146 + _options.upMPeakRunningTime
  147 + );
  148 + _options.upMPeakMinLayoverTime = _tempLayoverTimeRange[0]; // 上行早高峰最小停站时间(分钟,整数类型)
  149 + _options.upMPeakMaxLayoverTime = _tempLayoverTimeRange[1]; // 上行早高峰最大停站时间(分钟,整数类型)
  150 +
  151 + _tempLayoverTimeRange = paramObjV2.calcuTripLayoverTimeRange(
  152 + _options.ePeakStartTime,
  153 + true,
  154 + _options.upEPeakRunningTime
  155 + );
  156 + _options.upEPeakMinLayoverTime = _tempLayoverTimeRange[0]; // 上行晚高峰最小停站时间(分钟,整数类型)
  157 + _options.upEPeakMaxLayoverTime = _tempLayoverTimeRange[1]; // 上行晚高峰最大停站时间(分钟,整数类型)
  158 +
  159 + _tempLayoverTimeRange = paramObjV2.calcuTripLayoverTimeRange(
  160 + _options.mPeakStartTime,
  161 + false,
  162 + _options.downMPeakRunningTime
  163 + );
  164 + _options.downMPeakMinLayoverTime = _tempLayoverTimeRange[0]; // 下行早高峰最小停站时间(分钟,整数类型)
  165 + _options.downMPeakMaxLayoverTime = _tempLayoverTimeRange[1]; // 下行早高峰最大停站时间(分钟,整数类型)
  166 +
  167 + _tempLayoverTimeRange = paramObjV2.calcuTripLayoverTimeRange(
  168 + _options.ePeakStartTime,
  169 + false,
  170 + _options.downEPeakRunningTime
  171 + );
  172 + _options.downEPeakMinLayoverTime = _tempLayoverTimeRange[0]; // 下行晚高峰最小停站时间(分钟,整数类型)
  173 + _options.downEPeakMaxLayoverTime = _tempLayoverTimeRange[1]; // 下行晚高峰最大停站时间(分钟,整数类型)
  174 +
  175 + _tempLayoverTimeRange = paramObjV2.calcuTripLayoverTimeRange(
  176 + paramObjV2.addMinute(_options.mPeakStartTime, -1),
  177 + true,
  178 + _options.upLowRunningTime
  179 + );
  180 + _options.upLowMinLayoverTime = _tempLayoverTimeRange[0]; // 上行低谷最小停站时间(分钟,整数类型)
  181 + _options.upLowMaxLayoverTime = _tempLayoverTimeRange[1]; // 上行低谷最大停站时间(分钟,整数类型)
  182 +
  183 + _tempLayoverTimeRange = paramObjV2.calcuTripLayoverTimeRange(
  184 + paramObjV2.addMinute(_options.mPeakStartTime, -1),
  185 + false,
  186 + _options.downLowRunningTime
  187 + );
  188 + _options.downLowMinLayoverTime = _tempLayoverTimeRange[0]; // 下行低谷最小停站时间(分钟,整数类型)
  189 + _options.downLowMaxLayoverTime = _tempLayoverTimeRange[1]; // 下行低谷最大停站时间(分钟,整数类型)
  190 +
  191 + // deadhead time 空驶时间参数
  192 + _options.upPullOutTime = paramObjV2.getUpOutTime(); // 上行出场时间(分钟,整数类型)
  193 + _options.downPullOutTime = paramObjV2.getDownOutTime(); // 下行出场时间(分钟,整数类型)
  194 + _options.upPullInTime = paramObjV2.getUpInTime(); // 上行进场时间(分钟,整数类型)
  195 + _options.downPullInTime = paramObjV2.getDownInTime(); // 下行进场时间(分钟,整数类型)
  196 +
  197 +
  198 + // TODO:还有其他参数
  199 +
  200 + //--------------- 时刻表生成用参数(以上)-----------------//
  201 +
  202 + //--------------- 时刻表关联参数(以下)---------------//
  203 + _options.xlId = paramObjV2.getXlId(); // 线路id
  204 + _options.ttInfoId = paramObjV2.getTTinfoId(); // 时刻表id
  205 + _options.tccId = paramObjV2.getTccId(); // 停车场id
  206 + _options.upQdzId = paramObjV2.getUpQdzObj().id; // 上行起点站id
  207 + _options.upZdzId = paramObjV2.getUpZdzObj().id; // 上行终点站id
  208 + _options.downQdzId = paramObjV2.getDownQdzObj().id; // 下行起点站id
  209 + _options.downZdzId = paramObjV2.getDownZdzObj().id; // 下行终点站id
  210 +
  211 + //--------------- 时刻表关联参数(以上)---------------//
  212 + };
  213 +
  214 + /**
  215 + * 将时间列表转换成 InternalBcObj v2版本的班次对象Array
  216 + * @param isUp 是否上行
  217 + * @param fcsjArray 发车时间列表(moment对象)
  218 + * @param _options 组件内部参数
  219 + * @param paramObjV2 v2版本的参数对象(看考:/pages/base/timesmodel/js/v2/ParameterObj.js)
  220 + * @return Array InternalBcObj v2版本的班次对象列表(参考:/pages/base/timesmodel/js/v2/core/InternalBcObj.js)
  221 + * @private
  222 + */
  223 + var _convertFcsjArrayToInternalBcObjv2Array = function(isUp, fcsjArray, _options, paramObjV2) {
  224 + var _rtn_array = [];
  225 +
  226 + $jQuery.each(fcsjArray, function(index, item) {
  227 + // 1、计算行驶时间,到达时间
  228 + var runTime;
  229 + var arriveTime;
  230 + if (paramObjV2.isMPeakBc(item)) {
  231 + runTime = isUp ? _options.upMPeakRunningTime : _options.downMPeakRunningTime;
  232 + } else if (paramObjV2.isEPeakBc(item)) {
  233 + runTime = isUp ? _options.upEPeakRunningTime : _options.downEPeakRunningTime;
  234 + } else {
  235 + runTime = isUp ? _options.upLowRunningTime : _options.downLowRunningTime;
  236 + }
  237 + arriveTime = paramObjV2.addMinute(item, runTime);
  238 +
  239 + // 2、计算停站时间(平均停站时间)
  240 + var layOverTime;
  241 + if (paramObjV2.isMPeakBc(arriveTime)) {
  242 + layOverTime = isUp ?
  243 + (Math.floor((_options.upMPeakMinLayoverTime + _options.upMPeakMaxLayoverTime) / 2)):
  244 + (Math.floor((_options.downMPeakMinLayoverTime + _options.downMPeakMaxLayoverTime) / 2));
  245 + } else if (paramObjV2.isEPeakBc(arriveTime)) {
  246 + layOverTime = isUp ?
  247 + (Math.floor((_options.upEPeakMinLayoverTime + _options.upEPeakMaxLayoverTime) / 2)):
  248 + (Math.floor((_options.downEPeakMinLayoverTime + _options.downEPeakMaxLayoverTime) / 2));
  249 + } else {
  250 + layOverTime = isUp ?
  251 + (Math.floor((_options.upLowMinLayoverTime + _options.upLowMaxLayoverTime) / 2)):
  252 + (Math.floor((_options.downLowMinLayoverTime + _options.downLowMaxLayoverTime) / 2));
  253 + }
  254 +
  255 + _rtn_array.push(_getInternalBcObjectBuilder_(_options, paramObjV2)
  256 + .tripTime(item)
  257 + .runTime(runTime)
  258 + .arriveTime(arriveTime)
  259 + .layOverTime(layOverTime)
  260 + .isUp(isUp)
  261 + .tripType("normal")
  262 + .build());
  263 + });
  264 + return _rtn_array;
  265 +
  266 + };
  267 +
  268 + /**
  269 + * 在指定列表中查找比指定班次大的最小班次。
  270 + * @param currentBcObj 指定班次(InternalBcObj v2版本的班次对象)
  271 + * @param isUpDir 是否上行
  272 + * @param bcObjArray 指定班次列表(从小到大,有序列表,InternalBcObj v2版本的班次对象列表)
  273 + * @param _options 组件内部参数
  274 + * @param paramObjV2 v2版本的参数对象(看考:/pages/base/timesmodel/js/v2/ParameterObj.js)
  275 + */
  276 + var _findCeilBcObj = function(currentBcObj, isUpDir, bcObjArray, _options, paramObjV2) {
  277 + // 当前班次的到达时间
  278 + var _arriveTime = currentBcObj._$_arrtime;
  279 + // 停站时间(平均停站时间)
  280 + // TODO:后面要考虑停驶时间
  281 + // TODO:以临港8路为例,暂时修正参与计算的停站时间(上行加10分钟,下行加80分钟,80分钟实际上是停驶,以后要作为单独项计算)
  282 + var _layOverTime = currentBcObj._$_stoptime;
  283 + if (isUpDir) {
  284 + _layOverTime = _layOverTime + 10;
  285 + } else {
  286 + _layOverTime = _layOverTime + 80;
  287 + }
  288 +
  289 + var _rtnBcObj = null;
  290 + $jQuery.each(bcObjArray, function(index, item) {
  291 + // TODO:这里的算法后面再优化
  292 + if (!item._$$_internal_lp_obj.getLpNo()) { // 没有被block
  293 + if (item._$_fcsjObj.isAfter(paramObjV2.addMinute(_arriveTime, _layOverTime))) {
  294 + _rtnBcObj = item;
  295 + return false;
  296 + }
  297 + }
  298 + });
  299 +
  300 + return _rtnBcObj;
  301 +
  302 + };
  303 +
  304 +
  305 + // TODO:还有其他全局函数
  306 +
  307 + // ------------ 全局函数(如上)-------------- //
  308 +
  309 +
  310 + /**
  311 + * 初始化组件。
  312 + * @param paramObj v2版本的ParameterObj对象。
  313 + */
  314 + $jQuery.fn.scheduleBuilder_v4 = function(paramObj) {
  315 + _Asserts(paramObj != null, "参数ParameterObj(v2版本)不能为空!");
  316 +
  317 + // 内部map对象
  318 + var _options = {
  319 + tempUrl : '/pages/base/timesmodel/js/v4/scheduleBuilder.tmpl.html', // 组件对应的模版文件url
  320 + // TODO:还有其他参数
  321 + };
  322 + // 计算参数
  323 + _calcuParameter(_options, paramObj);
  324 +
  325 + /**
  326 + * 计算发车时间列表v1。
  327 + * 1、计算当前班次的下一个班次时间(使用各个时间段的平均发车间隔,首班车,末班车发车时间)
  328 + * 2、重复操作1,直到下一个班次时间大于末班车发车时间
  329 + * 3、退出循环,使用末班车作为最后一个班次,计算与上一个班次的发车间隔
  330 + * 4、这里直接将最后一个班次删除,将倒数第二个班次改成末班车时间,这样会造成最后一般车发车间隔可能大于最大发车间隔(TODO:这个暂时不管了以后再说)
  331 + * @param firstTripTime 第一个班次时间(moment对象)
  332 + * @param lastTripTime 最后一个班次时间(moment对象)
  333 + * @return Array 时间从早到晚的发车时间列表(moment对象Array)
  334 + */
  335 + var _calcuFcsjArray_v1 = function (firstTripTime, lastTripTime) {
  336 + _Asserts(firstTripTime.isBefore(lastTripTime), "firstTripTime必须早于lastTripTime!");
  337 +
  338 + var _fcsjArray = [];
  339 + _fcsjArray.push(firstTripTime);
  340 +
  341 + // 按照,低谷->早高峰->低谷->晚高峰->低谷推进
  342 + var _previousTripTime = null;
  343 + var _nextTripTime = null;
  344 + do {
  345 + _previousTripTime = _fcsjArray[_fcsjArray.length - 1];
  346 +
  347 + if (paramObj.isMPeakBc(_previousTripTime)) { // 早高峰班次
  348 + _nextTripTime = paramObj.addMinute( // 使用平均发车间隔
  349 + _previousTripTime,
  350 + Math.floor((_options.mPeakMinHeadway + _options.mPeakMaxHeadway) / 2)
  351 + );
  352 + } else if (paramObj.isEPeakBc(_previousTripTime)) { // 晚高峰班次
  353 + _nextTripTime = paramObj.addMinute( // 使用平均发车间隔
  354 + _previousTripTime,
  355 + Math.floor((_options.ePeakMinHeadway + _options.ePeakMaxHeadway) / 2)
  356 + );
  357 + } else { // 低谷班次
  358 + _nextTripTime = paramObj.addMinute( // 使用平均发车间隔
  359 + _previousTripTime,
  360 + Math.floor((_options.lowMinHeadway + _options.lowMaxHeadway) / 2)
  361 + );
  362 + }
  363 + _fcsjArray.push(_nextTripTime);
  364 + } while (_nextTripTime.isBefore(lastTripTime));
  365 +
  366 + _fcsjArray.pop(); // 删除最后一个班次
  367 + _fcsjArray.pop(); // 删除倒数第二个班次
  368 + // 将末班车班次作为最后一个班次,倒数第二个发车间隔可能大于最大发车间隔
  369 + // TODO:程序暂时不自动修正,人工修正
  370 + _fcsjArray.push(lastTripTime);
  371 +
  372 + return _fcsjArray;
  373 + };
  374 +
  375 + /**
  376 + * 将上行下行班次连接起来(VSP问题)。
  377 + * @param upDirBcObjArray 上行班次列表(InternalBcObj v2版本的班次对象)
  378 + * @param downDirBcObjArray 下行班次列表(InternalBcObj v2版本的班次对象)
  379 + * @private
  380 + */
  381 + var _blockBcObjArray_v1 = function (upDirBcObjArray, downDirBcObjArray) {
  382 + var _rtn_blocks = [];
  383 +
  384 + // TODO:要求block至少覆盖上下行首班车,末班车,原来的时刻表不需要完全覆盖,其他优化暂时不考虑
  385 +
  386 + var _block_no; // block编号
  387 + var _block = []; // block班次列表
  388 + var _fcNo = 1; // 班次发车的顺序号
  389 + var _current_trip; // block的第一个班次
  390 + var _current_trip_isUpDir; // block第一个班次的方向
  391 +
  392 + $jQuery.each(upDirBcObjArray, function(index, item) {
  393 + if (item._$$_internal_lp_obj.getLpNo()) {
  394 + // 已经被block跳过
  395 + return true;
  396 + }
  397 +
  398 + _block_no = (function (_b_no) {return _b_no} (index + 1));
  399 + _block = [];
  400 + _fcNo = 1;
  401 + _current_trip = item;
  402 + _current_trip_isUpDir = true;
  403 +
  404 + while (_current_trip != null) {
  405 + _current_trip._$$_internal_lp_obj = { // 路牌对象
  406 + getLpNo : function() { return (function (_b_no) { return _b_no; } (index + 1)); },
  407 + getLpName: function() { return "路牌" + (function (_b_no) { return _b_no; } (index + 1)); }
  408 + };
  409 + _current_trip._$_fcno = _fcNo; // 发车顺序号
  410 + _block.push(_current_trip);
  411 +
  412 + _current_trip = _findCeilBcObj(
  413 + _current_trip,
  414 + _current_trip_isUpDir,
  415 + _current_trip_isUpDir ? downDirBcObjArray : upDirBcObjArray,
  416 + _options,
  417 + paramObj
  418 + );
  419 + _current_trip_isUpDir = !_current_trip_isUpDir;
  420 +
  421 + _fcNo ++;
  422 + }
  423 +
  424 + _rtn_blocks.push(_block);
  425 + });
  426 +
  427 + // 调试打印
  428 + $jQuery.each(_rtn_blocks, function(index, block) {
  429 + _LogArray(block, function(item) {
  430 + return item;
  431 + });
  432 + });
  433 +
  434 + return _rtn_blocks;
  435 + };
  436 +
  437 + /**
  438 + * 按照规则将block run cut。
  439 + * @param blockArray block列表(二维数组)
  440 + * @private
  441 + */
  442 + var _runcutBlockArray_v1 = function (blockArray) {
  443 + // TODO:
  444 +
  445 + };
  446 +
  447 +
  448 + // 插件的根dom,包含模版的dom元素,由使用插件的界面指定
  449 + var _rootDom = this[0];
  450 +
  451 + //--------------------- 内部模型数据(如下)-------------------//
  452 + var upDirFcsjArray = []; // 上行的发车时间列表(moment对象)
  453 + var downDirFcsjArray = []; // 下行的发车时间列表(moment对象)
  454 + var upDirBcObjArray = []; // 上行的发车时间列表(InternalBcObj v2版本的班次对象)
  455 + var downDirBcObjArray = []; // 下行的发车时间列表(InternalBcObj v2版本的班次对象)
  456 +
  457 + var blockArray = []; // VSP后的数据(最重要的数据)
  458 +
  459 + //--------------------- 内部模型数据(如上)-------------------//
  460 +
  461 + var com = this.each(function() {
  462 + // 渲染主组件
  463 + $jQuery.ajax({
  464 + url: _options.tempUrl,
  465 + type: 'GET',
  466 + async: false, // 同步的
  467 + success: function(html) {
  468 + var render = template.compile(html);
  469 + var htmlStr = render({});
  470 + $jQuery(_rootDom).html(htmlStr);
  471 + }
  472 + });
  473 +
  474 + // 1-1、计算上行,下行的发车时间列表
  475 + upDirFcsjArray = _calcuFcsjArray_v1(
  476 + _options.upDirFirstTripTime,
  477 + _options.upDirLastTripTime
  478 + );
  479 + downDirFcsjArray = _calcuFcsjArray_v1(
  480 + _options.downDirFirstTripTime,
  481 + _options.downDirLastTripTime
  482 + );
  483 + // 1-2、将上下时间列表转换成 InternalBcObj v2版本的班次对象Array
  484 + upDirBcObjArray = _convertFcsjArrayToInternalBcObjv2Array(true, upDirFcsjArray, _options, paramObj);
  485 + downDirBcObjArray = _convertFcsjArrayToInternalBcObjv2Array(false, downDirFcsjArray, _options, paramObj);
  486 +
  487 + // 调试打印
  488 + _LogArray(upDirBcObjArray, function(item) {
  489 + return item._$_fcsjObj.format("HH:mm");
  490 + });
  491 + _LogArray(downDirBcObjArray, function(item) {
  492 + return item._$_fcsjObj.format("HH:mm");
  493 + });
  494 +
  495 + // 2、将上下行班次block
  496 + blockArray = _blockBcObjArray_v1(upDirBcObjArray, downDirBcObjArray);
  497 +
  498 + // 3、run cut block
  499 + _runcutBlockArray_v1(blockArray);
  500 +
  501 + // TODO:可能还有更复杂的VSP计算,再议
  502 +
  503 + });
  504 +
  505 + // 输出组合后的显示用数据(gantt.js使用)
  506 + com.getGanttData = function() {
  507 + // TODO:测试后面要修正
  508 + var _temp_data = [];
  509 +
  510 + $jQuery.each(blockArray, function(index, block) {
  511 + $jQuery.each(block, function(index2, item) {
  512 + _temp_data.push(item.toGanttBcObj());
  513 + });
  514 + });
  515 +
  516 + return {'json':_temp_data,'bxrcgs':null};
  517 + };
  518 +
  519 + return com;
  520 + }
  521 +
  522 +} ($));
... ...
src/main/resources/static/pages/base/timesmodel/js/v4/scheduleBuilder.tmpl.html 0 → 100644
  1 +<!-- 时刻表生成组件模版html -->
  2 +<div>
  3 + <!-- TODO:之后会把各种图表放到这里 -->
  4 +</div>
... ...
src/main/resources/static/pages/base/timesmodel/paramadd.html
... ... @@ -1052,4 +1052,4 @@
1052 1052  
1053 1053 });
1054 1054  
1055   -</script>
1056 1055 \ No newline at end of file
  1056 +</script>
... ...
src/main/resources/static/pages/base/timesmodel/tepms/components/bxtypeSelect.js 0 → 100644
  1 +/**
  2 + * 班型选择组件。
  3 + */
  4 +(function($jQuery) {
  5 +
  6 + /**
  7 + * 初始化组件。
  8 + * @param paramsMap 参数对象
  9 + */
  10 + $jQuery.fn.bxtypeSelect = function(paramsMap) {
  11 + // 内部参数对象
  12 + var _options = {
  13 + tempUrl: '/pages/base/timesmodel/tepms/components/bxtypeSelect.tmpl.html' // 组件对应的模版文件url
  14 + };
  15 +
  16 + // 合并参数对象到_options中
  17 + $jQuery.extend(_options, paramsMap);
  18 +
  19 + // 插件的根dom,包含模版的dom元素,由使用插件的界面指定
  20 + var _rootDom = this[0];
  21 +
  22 + // 内部班型工时对应
  23 + var _bxGsData = [
  24 + { type: '一休一', hours: 11.42 },
  25 + { type: '二休一', hours: 8.57 },
  26 + { type: '三休一', hours: 7.61 },
  27 + { type: '四休一', hours: 7.14 },
  28 + { type: '五休一', hours: 6.85 },
  29 + { type: '五休二', hours: 7.99 },
  30 + { type: '六休一', hours: 6.66 }
  31 + ];
  32 +
  33 +
  34 + var _tagsinput_beforeItemAdd_Fun = function(event) {
  35 + // TODO:这里可以做一些逻辑判定
  36 + };
  37 +
  38 + var _tagsinput_add_click_Fun = function(event) {
  39 + // 班型value,text
  40 + var bxValue = $jQuery(_rootDom).find(".row:eq(1) select option:selected").val();
  41 + var bxText = $jQuery(_rootDom).find(".row:eq(1) select option:selected").text();
  42 + if (!bxValue) {
  43 + layer.msg('请选择班型!');
  44 + return false;
  45 + }
  46 + // 工时
  47 + var hoursValue = $jQuery(_rootDom).find(".row:eq(2) input").val();
  48 + if (!hoursValue || hoursValue <= 0) {
  49 + layer.msg('请输入工时!');
  50 + return false;
  51 + }
  52 + // 人次
  53 + var rcValue = $jQuery(_rootDom).find(".row:eq(3) input").val();
  54 + if (!rcValue || rcValue <= 0) {
  55 + layer.msg('请输入人次!');
  56 + return false;
  57 + }
  58 +
  59 + $jQuery(_rootDom).find("input[name='bxgsrc']").tagsinput('add', {
  60 + "value": bxText + '/' + hoursValue + '/' + rcValue,
  61 + "text": bxText + '/' + hoursValue + '/' + rcValue,
  62 + "continent": bxText
  63 + });
  64 +
  65 + // $jQuery(_rootDom).find(".row:eq(1) select").val(0);
  66 + // $jQuery(_rootDom).find(".row:eq(2) input").val(0);
  67 + // $jQuery(_rootDom).find(".row:eq(3) input").val(0);
  68 +
  69 + };
  70 +
  71 + var _bxGsSelect_chanage_Fun = function(event) {
  72 + $jQuery(_rootDom).find(".row:eq(2) input").val($jQuery(event.target).val());
  73 + };
  74 +
  75 + // TODO:事件方法
  76 +
  77 +
  78 + var com = this.each(function() {
  79 + // 渲染主组件
  80 + $jQuery.ajax({
  81 + url: _options.tempUrl,
  82 + type: 'GET',
  83 + async: false, // 同步的
  84 + success: function(html) {
  85 + var render = template.compile(html);
  86 + var htmlStr = render({map : _options, bxGsData : _bxGsData});
  87 + $jQuery(_rootDom).html(htmlStr);
  88 + }
  89 + });
  90 + // 渲染tagsinput组件
  91 + $jQuery(this).find("input[name='bxgsrc']").tagsinput({
  92 + tagClass: function(item) {
  93 + switch (item.continent) {
  94 + case '一休一':
  95 + return 'label label-primary';
  96 + case '二休一':
  97 + return 'label label-danger label-important';
  98 + case '三休一':
  99 + return 'label label-purple';
  100 + case '四休一':
  101 + return 'label label-default';
  102 + case '五休一':
  103 + return 'label label-warning';
  104 + case '五休二':
  105 + return 'label label-success';
  106 + case '六休一':
  107 + return 'label label-info';
  108 + }
  109 + },
  110 + itemValue: 'value',
  111 + itemText: 'text'
  112 + });
  113 +
  114 + // 班型select 事件配置
  115 + $jQuery(this).find(".row:eq(1) select").on("change", _bxGsSelect_chanage_Fun);
  116 + // 添加按钮 事件配置
  117 + $jQuery(this).find(".row:eq(4) a").on("click", _tagsinput_add_click_Fun);
  118 +
  119 + });
  120 +
  121 + return com;
  122 +
  123 + };
  124 +
  125 +
  126 +} ($));
... ...
src/main/resources/static/pages/base/timesmodel/tepms/components/bxtypeSelect.tmpl.html 0 → 100644
  1 +<!-- 班型类型选择组件模版(template) -->
  2 +<div>
  3 + <div class="row" style="margin-left: 15px;">
  4 + <input type="text" value="" name="bxgsrc" style="display: none;">
  5 + </div>
  6 +
  7 + <div class="row" style="margin-top: 10px;">
  8 + <label class="control-label col-md-5">班型类型 :</label>
  9 + <div class="col-md-7">
  10 + <select class="form-control">
  11 + <option value="0">请选择类型...</option>
  12 + {{each bxGsData}}
  13 + <option value={{$value.hours}}>{{$value.type}}</option>
  14 + {{/each}}
  15 + </select>
  16 + </div>
  17 + </div>
  18 +
  19 + <div class="row" style="margin-top: 10px;">
  20 + <label class="control-label col-md-5">工时(小时) :</label>
  21 + <div class="col-md-7">
  22 + <input type="number" class="form-control" placeholder="请输入工时" min="1">
  23 + </div>
  24 + </div>
  25 +
  26 + <div class="row" style="margin-top: 10px;">
  27 + <label class="control-label col-md-5">人次 :</label>
  28 + <div class="col-md-7">
  29 + <input type="number" class="form-control" placeholder="请输入人次数" min="1">
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="row" style="margin-top: 10px;margin-left: 116px;">
  34 + <a href="javascript:" class="btn red">添加</a>
  35 + </div>
  36 +
  37 +</div>
... ...
src/main/resources/static/pages/base/timesmodel/tepms/components/stoptypeSelect.js 0 → 100644
  1 +/**
  2 + * 停站类型选择组件。
  3 + */
  4 +(function($jQuery) {
  5 +
  6 + /**
  7 + * 初始化组件。
  8 + * @param paramsMap 参数对象
  9 + */
  10 + $jQuery.fn.stoptypeSelect = function(paramsMap) {
  11 + // 内部参数对象
  12 + var _options = {
  13 + tempUrl: '/pages/base/timesmodel/tepms/components/stoptypeSelect.tmpl.html', // 组件对应的模版文件url
  14 + };
  15 +
  16 + // 合并参数对象到_options中
  17 + $jQuery.extend(_options, paramsMap);
  18 +
  19 + // 插件的根dom,包含模版的dom元素,由使用插件的界面指定
  20 + var _rootDom = this[0];
  21 +
  22 + var _tagsinput_beforeItemAdd_Fun = function(event) {
  23 + // TODO:这里可以做一些逻辑判定
  24 + };
  25 + var _tagsinput_add_click_Fun = function(event) {
  26 + var stt = $jQuery(_rootDom).find("input[name='stt']");
  27 + if (stt.val() || stt.val() !== "") {
  28 + return;
  29 + }
  30 +
  31 + var stoptype = $jQuery(_rootDom).find("select[name='stopType']").val();
  32 + var masterstop = $jQuery(_rootDom).find("select[name='masterStop']").val();
  33 + var masterstop_text = $jQuery(_rootDom).find("select[name='masterStop'] option:selected").text();
  34 +
  35 + if (stoptype && stoptype != "") {
  36 + if (stoptype == "0" && masterstop && masterstop != "") {
  37 + stt.tagsinput('add', {
  38 + "value": stoptype + '/' + masterstop,
  39 + "text": "主站停站" + "/" + masterstop_text
  40 + });
  41 + } else {
  42 + stt.tagsinput('add', {
  43 + "value": 1,
  44 + "text": "双向停站"
  45 + });
  46 + }
  47 + }
  48 + };
  49 +
  50 + var com = this.each(function() {
  51 + // 渲染主组件
  52 + $jQuery.ajax({
  53 + url: _options.tempUrl,
  54 + type: 'GET',
  55 + async: false, // 同步的
  56 + success: function(html) {
  57 + var render = template.compile(html);
  58 + var htmlStr = render({map : _options});
  59 + $jQuery(_rootDom).html(htmlStr);
  60 + }
  61 + });
  62 + // 渲染tagsinput组件
  63 + $jQuery(this).find("input[name='stt']").tagsinput({
  64 + tagClass: function(item) {
  65 + return 'label label-danger label-important';
  66 + },
  67 + itemValue: 'value',
  68 + itemText: 'text'
  69 + });
  70 +
  71 + $jQuery(this).find("input[name='stt']").on(
  72 + "beforeItemAdd", _tagsinput_beforeItemAdd_Fun);
  73 + $jQuery(this).find("a[name='stoptype_tagsinput_add']").on(
  74 + "click", _tagsinput_add_click_Fun);
  75 +
  76 +
  77 + });
  78 +
  79 + return com;
  80 + };
  81 +
  82 +
  83 +} ($));
... ...
src/main/resources/static/pages/base/timesmodel/tepms/components/stoptypeSelect.tmpl.html 0 → 100644
  1 +<!-- 停站类型选择组件模版(template) -->
  2 +<div>
  3 + <div class="row" style="margin-left: 15px;">
  4 + <input type="text" value="" name="stt" style="display: none;">
  5 + </div>
  6 +
  7 + <div class="row" style="margin-top: 10px;">
  8 + <label class="control-label col-md-4">停站类型:</label>
  9 + <div class="col-md-8">
  10 + <select name="stopType" class="form-control">
  11 + <option value="">-- 请选择停站类型 --</option>
  12 + <option value="0">主站停站</option>
  13 + <option value="1">双向停站</option>
  14 + </select>
  15 + </div>
  16 + </div>
  17 +
  18 + <div class="row" style="margin-top: 10px;">
  19 + <label class="control-label col-md-4">主站:</label>
  20 + <div class="col-md-8">
  21 + <select name="masterStop" class="form-control">
  22 + <option value="">请选择...</option>
  23 + <option value="0">{{map.line.startStationName}}</option>
  24 + <option value="1">{{map.line.endStationName}}</option>
  25 + </select>
  26 + </div>
  27 + </div>
  28 +
  29 + <div class="row" style="margin-top: 10px;margin-left: 116px;">
  30 + <a href="javascript:" class="btn red" name="stoptype_tagsinput_add">添加</a>
  31 + </div>
  32 +</div>
  33 +
... ...
src/main/resources/static/pages/base/timesmodel/tepms/run_headway_temp.html 0 → 100644
  1 +<!--
  2 + 1、一个run表示一个班型,代表需要一个人员执行
  3 + 2、多个run也可由一个人执行
  4 + 3、headway表示发车间隔
  5 + -->
  6 +<script type="text/html" id = "run_headway_temp">
  7 + <div class="form-group">
  8 + <div class="col-md-6">
  9 + <label class="control-label col-md-5">
  10 + <span class="required"> * </span> 上行首班时间 :
  11 + </label>
  12 + <div class="col-md-5">
  13 + <input type="text" class="form-control" name="startStationFirstTime" value="{{map.line.startStationFirstTime}}" id="startStationFirstTime_id"
  14 + placeholder="请输入起始站首班时间">
  15 + </div>
  16 + </div>
  17 + <div class="col-md-6">
  18 + <label class="control-label col-md-5">
  19 + <span class="required"> * </span> 上行末班时间 :
  20 + </label>
  21 + <div class="col-md-5">
  22 + <input type="text" class="form-control" name="startStationEndTime" value="{{map.line.startStationEndTime}}" id="startStationEndTime_id"
  23 + placeholder="请输入起始站末班时间">
  24 + </div>
  25 + </div>
  26 + </div>
  27 +
  28 + <div class="form-group">
  29 + <div class="col-md-6">
  30 + <label class="control-label col-md-5">
  31 + <span class="required"> * </span> 下行首班时间 :
  32 + </label>
  33 + <div class="col-md-5">
  34 + <input type="text" class="form-control" name="endStationFirstTime" value="{{map.line.endStationFirstTime}}" id="endStationFirstTime_id"
  35 + placeholder="请输入终点站首班时间">
  36 + </div>
  37 + </div>
  38 + <div class="col-md-6">
  39 + <label class="control-label col-md-5">
  40 + <span class="required"> * </span> 下行末班时间 :
  41 + </label>
  42 + <div class="col-md-5">
  43 + <input type="text" class="form-control" name="endStationEndTime" value="{{map.line.endStationEndTime}}" id="endStationEndTime_id"
  44 + placeholder="请输入终点站末班时间">
  45 + </div>
  46 + </div>
  47 + </div>
  48 +
  49 + <div class="form-group">
  50 + <div class="col-md-6">
  51 + <label class="control-label col-md-5">上行出场时间 :
  52 + </label>
  53 + <div class="col-md-5">
  54 + <input type="text" class="form-control" name="upOutTimer" value="{{map.upOutTimer}}" id="upOutTimer_id"
  55 + placeholder="请输入上行出场时间">
  56 + </div>
  57 + </div>
  58 + <div class="col-md-6">
  59 + <label class="control-label col-md-5">上行进场时间 :
  60 + </label>
  61 + <div class="col-md-5">
  62 + <input type="text" class="form-control" name="upInTimer" value="{{map.upInTimer}}" id="upInTimer_id"
  63 + placeholder="请输入上行进场时间">
  64 + </div>
  65 + </div>
  66 + </div>
  67 +
  68 + <div class="form-group">
  69 + <div class="col-md-6">
  70 + <label class="control-label col-md-5">下行出场时间 :
  71 + </label>
  72 + <div class="col-md-5">
  73 + <input type="text" class="form-control" name="downOutTimer" value="{{map.downOutTimer}}" id="downOutTimer_id"
  74 + placeholder="请输入下行出场时间">
  75 + </div>
  76 + </div>
  77 + <div class="col-md-6">
  78 + <label class="control-label col-md-5">下行进场时间 :
  79 + </label>
  80 + <div class="col-md-5">
  81 + <input type="text" class="form-control" name="downInTimer" value="{{map.downInTimer}}" id="downInTimer_id"
  82 + placeholder="请输入下行进场时间">
  83 + </div>
  84 + </div>
  85 + </div>
  86 +
  87 + <div class="form-group">
  88 + <div class="col-md-6">
  89 + <label class="control-label col-md-5">早晚例行保养 :</label>
  90 + <div class="col-md-5">
  91 + <input type="text" class="form-control" name="lb" value="{{map.lb}}" id="lb_id"
  92 + placeholder="请输入早晚例行保养">
  93 + </div>
  94 + </div>
  95 + <div class="col-md-6">
  96 + <label class="control-label col-md-5">
  97 + <span class="required"> * </span> 停车场 :
  98 + </label>
  99 + <div class="col-md-5">
  100 + <select name="carPark" class="form-control" id="carPark_id" style="width:100%"></select>
  101 + </div>
  102 + </div>
  103 + </div>
  104 +
  105 + <div class="form-group">
  106 + <div class="col-md-6">
  107 + <label class="control-label col-md-5">
  108 + <span class="required"> * </span> 早高峰开始时间 :
  109 + </label>
  110 + <div class="col-md-5">
  111 + <input type="text" class="form-control" name="earlyStartTime" value="{{map.earlyStartTime}}" id="earlyStartTime_id"
  112 + placeholder="请输入早高峰开始时间">
  113 + </div>
  114 + </div>
  115 + <div class="col-md-6">
  116 + <label class="control-label col-md-5">
  117 + <span class="required"> * </span> 早高峰结束时间 :
  118 + </label>
  119 + <div class="col-md-5">
  120 + <input type="text" class="form-control" name="earlyEndTime" value="{{map.earlyEndTime}}" id="earlyEndTime_id"
  121 + placeholder="请输入早高峰结束时间">
  122 + </div>
  123 + </div>
  124 + </div>
  125 +
  126 + <div class="form-group">
  127 + <div class="col-md-6">
  128 + <label class="control-label col-md-5">
  129 + <span class="required"> * </span> 晚高峰开始时间 :
  130 + </label>
  131 + <div class="col-md-5">
  132 + <input type="text" class="form-control" name="lateStartTime" value="{{map.lateStartTime}}" id="lateStartTime_id"
  133 + placeholder="请输入晚高峰开始时间">
  134 + </div>
  135 + </div>
  136 + <div class="col-md-6">
  137 + <label class="control-label col-md-5">
  138 + <span class="required"> * </span> 晚高峰结束时间 :
  139 + </label>
  140 + <div class="col-md-5">
  141 + <input type="text" class="form-control" name="lateEndTime" value="{{map.lateEndTime}}" id="lateEndTime_id"
  142 + placeholder="请输入晚高峰结束时间">
  143 + </div>
  144 + </div>
  145 + </div>
  146 +
  147 + <div class="form-group">
  148 + <div class="col-md-6">
  149 + <label class="control-label col-md-5">早高峰上行时间 :</label>
  150 + <div class="col-md-5">
  151 + <input type="text" class="form-control" name="earlyUpTime" value="{{map.upTravelTime}}" id="earlyUpTime_id"
  152 + placeholder="请输入早高峰上行时间">
  153 + </div>
  154 + </div>
  155 + <div class="col-md-6">
  156 + <label class="control-label col-md-5">早高峰下行时间 :</label>
  157 + <div class="col-md-5">
  158 + <input type="text" class="form-control" name="earlyDownTime" value="{{map.downTravelTime}}" id="earlyDownTime_id"
  159 + placeholder="请输入早高峰下行时间">
  160 + </div>
  161 + </div>
  162 + </div>
  163 +
  164 + <div class="form-group">
  165 + <div class="col-md-6">
  166 + <label class="control-label col-md-5">晚高峰上行时间 :</label>
  167 + <div class="col-md-5">
  168 + <input type="text" class="form-control" name="lateUpTime" value="{{map.upTravelTime}}" id="lateUpTime_id"
  169 + placeholder="请输入晚高峰上行时间">
  170 + </div>
  171 + </div>
  172 + <div class="col-md-6">
  173 + <label class="control-label col-md-5">晚高峰下行时间 :</label>
  174 + <div class="col-md-5">
  175 + <input type="text" class="form-control" name="lateDownTime" value="{{map.downTravelTime}}" id="lateDownTime_id"
  176 + placeholder="请输入晚高峰下行时间">
  177 + </div>
  178 + </div>
  179 + </div>
  180 +
  181 + <div class="form-group">
  182 + <div class="col-md-6">
  183 + <label class="control-label col-md-5">低谷上行时间 :</label>
  184 + <div class="col-md-5">
  185 + <input type="text" class="form-control" name="troughUpTime" value="{{map.upTravelTime}}" id="troughUpTime_id"
  186 + placeholder="请输入低谷上行时间">
  187 + </div>
  188 + </div>
  189 + <div class="col-md-6">
  190 + <label class="control-label col-md-5">低谷下行时间 :</label>
  191 + <div class="col-md-5">
  192 + <input type="text" class="form-control" name="troughDownTime" value="{{map.downTravelTime}}" id="troughDownTime_id"
  193 + placeholder="请输入低谷下行时间">
  194 + </div>
  195 + </div>
  196 + </div>
  197 +
  198 + <div class="form-group">
  199 + <div class="col-md-6">
  200 + <label class="control-label col-md-5"><span class="required"> * </span>早高峰发车间隔 :</label>
  201 + <div class="col-md-3" style="padding-right: 0px;">
  202 + <input type="text" class="form-control" value="15" name="zgffcjxmin" id="zgffcjxmin_id"
  203 + placeholder="最小间隔">
  204 + </div>
  205 + <div class="col-md-1" style="padding-top: 10px; font-size: 85%;">至</div>
  206 + <div class="col-md-3" style="padding-left: 0px;">
  207 + <input type="text" class="form-control" value="20" name="zgffcjxmax" id="zgffcjxmax_id"
  208 + placeholder="最大间隔">
  209 + </div>
  210 + </div>
  211 + <div class="col-md-6">
  212 + <label class="control-label col-md-5">吃饭地点 :</label>
  213 + <div class="col-md-5">
  214 + <select type="text" class="form-control" name="cfdd" id="cfdd_id">
  215 + <option value="">请选择...</option>
  216 + <option value="0">{{map.line.startStationName}}</option>
  217 + <option value="1">{{map.line.endStationName}}</option>
  218 + <option value="allYes">起终点站都可以</option>
  219 + </select>
  220 + </div>
  221 + </div>
  222 + </div>
  223 +
  224 + <div class="form-group">
  225 + <div class="col-md-6">
  226 + <label class="control-label col-md-5"><span class="required"> * </span>晚高峰发车间隔 :</label>
  227 + <div class="col-md-3" style="padding-right: 0px;">
  228 + <input type="text" class="form-control" value="15" name="wffcjxmin" id="wffcjxmin_id"
  229 + placeholder="最小间隔">
  230 + </div>
  231 + <div class="col-md-1" style="padding-top: 10px; font-size: 85%;">至</div>
  232 + <div class="col-md-3" style="padding-left: 0px;">
  233 + <input type="text" class="form-control" value="20" name="wffcjxmax" id="wffcjxmax_id"
  234 + placeholder="最大间隔">
  235 + </div>
  236 + </div>
  237 + <div class="col-md-6">
  238 + <label class="control-label col-md-5">工作餐午餐时间 :</label>
  239 + <div class="col-md-5">
  240 + <input type="text" class="form-control" name="workeLunch" value="{{map.workeLunch}}" id="workeLunch_id"
  241 + placeholder="请输入工作餐午餐时间">
  242 + </div>
  243 + </div>
  244 + </div>
  245 +
  246 + <div class="form-group">
  247 + <div class="col-md-6">
  248 + <label class="control-label col-md-5"><span class="required"> * </span>低谷发车间隔 :</label>
  249 + <div class="col-md-3" style="padding-right: 0px;">
  250 + <input type="text" class="form-control" value="20" name="dgfcjxmin" id="dgfcjxmin_id"
  251 + placeholder="最小间隔">
  252 + </div>
  253 + <div class="col-md-1" style="padding-top: 10px; font-size: 85%;">至</div>
  254 + <div class="col-md-3" style="padding-left: 0px;">
  255 + <input type="text" class="form-control" value="25" name="dgfcjxmax" id="dgfcjxmax_id"
  256 + placeholder="最大间隔">
  257 + </div>
  258 + </div>
  259 + <div class="col-md-6">
  260 + <label class="control-label col-md-5">工作餐晚餐时间 :</label>
  261 + <div class="col-md-5">
  262 + <input type="text" class="form-control" name="workeDinner" value="{{map.workeDinner}}" id="workeDinner_id"
  263 + placeholder="请输入工作餐晚餐时间">
  264 + </div>
  265 + </div>
  266 + </div>
  267 +
  268 + <div class="form-group">
  269 + <div class="col-md-6">
  270 + <label class="control-label col-md-5"><span class="required"> * </span>建议加班路牌数 :</label>
  271 + <div class="col-md-5">
  272 + <input type="text" class="form-control" value="0" name="jbclcount" id="jbclcount_id"
  273 + placeholder="为0表示是周末时刻表">
  274 + </div>
  275 + </div>
  276 + <div class="col-md-6">
  277 + <label class="control-label col-md-5">
  278 + <span class="required"> * </span> 建议高峰配车数 :</label>
  279 + <div class="col-md-5">
  280 + <input type="text" class="form-control" value="1" placeholder="车辆数" name="gfjypcs" id="gfjypcsInput" min="1">
  281 + </div>
  282 + </div>
  283 + </div>
  284 +
  285 + <div class="form-group">
  286 + <div class="col-md-6">
  287 + <label class="control-label col-md-5"><span class="required"> * </span>班型/工时/人次 :</label>
  288 + <div class="col-md-5 tagsDiv" id="bxType_com_id">
  289 + </div>
  290 + </div>
  291 + <div class="col-md-6">
  292 + <label class="control-label col-md-5"><span class="required"> * </span>停站类型 :</label>
  293 + <div class="col-md-5 tagsDiv" id="stopType_com_id">
  294 + </div>
  295 + </div>
  296 + </div>
  297 +
  298 +
  299 +
  300 + <!-- TODO:还有其他参数 -->
  301 +
  302 + <!-- 隐藏字段-时间 -->
  303 + <!-- 上下行行驶时间 -->
  304 + <input type="hidden" name="upTravelTime" value="{{map.upTravelTime}}" id="upTravelTime_id"/>
  305 + <input type="hidden" name="downTravelTime" value="{{map.downTravelTime}}" id="downTravelTime_id"/>
  306 + <!-- 隐藏字段-里程 -->
  307 + <!-- 上下行行驶里程 -->
  308 + <input type="hidden" name="upMileage" value="{{map.upMileage}}" id="upMileage_id"/>
  309 + <input type="hidden" name="downMileage" value="{{map.downMileage}}" id="downMileage_id"/>
  310 + <!-- 上下行进场出场里程 -->
  311 + <input type="hidden" name="upInMileage" value="{{map.upInMileage}}" id="upInMileage_id"/>
  312 + <input type="hidden" name="downInMileage" value="{{map.downInMileage}}" id="downInMileage_id"/>
  313 + <input type="hidden" name="upOutMileage" value="{{map.upOutMileage}}" id="upOutMileage_id"/>
  314 + <input type="hidden" name="downOutMileage" value="{{map.downOutMileage}}" id="downOutMileage_id"/>
  315 +
  316 +
  317 +</script>
  318 +
  319 +<script type="text/html" id="run_headway_temp_config">
  320 + <h4 class="form-section"> 时刻表与线路名称 </h4>
  321 + <div class="form-group">
  322 + <div class="col-md-6">
  323 + <label class="control-label col-md-5"> 时刻表名称 : </label>
  324 + <div class="col-md-7">
  325 + <p class="form-control-static" data-display="skbName"> </p>
  326 + </div>
  327 + </div>
  328 + <div class="col-md-6">
  329 + <label class="control-label col-md-5"> 线路名称 :</label>
  330 + <div class="col-md-4">
  331 + <p class="form-control-static" data-display="lineName"> </p>
  332 + </div>
  333 + </div>
  334 + </div>
  335 + <h4 class="form-section"> 参数详情 </h4>
  336 +
  337 + <div class="form-group">
  338 + <div class="col-md-6">
  339 + <label class="control-label col-md-5">
  340 + <span class="required"> * </span> 上行首班时间 :
  341 + </label>
  342 + <div class="col-md-4">
  343 + <p class="form-control-static" data-display="startStationFirstTime"> </p>
  344 + </div>
  345 + </div>
  346 + <div class="col-md-6">
  347 + <label class="control-label col-md-5">
  348 + <span class="required"> * </span> 上行末班时间 :
  349 + </label>
  350 + <div class="col-md-4">
  351 + <p class="form-control-static" data-display="startStationEndTime"> </p>
  352 + </div>
  353 + </div>
  354 + </div>
  355 +
  356 + <div class="form-group">
  357 + <div class="col-md-6">
  358 + <label class="control-label col-md-5">
  359 + <span class="required"> * </span> 下行首班时间 :
  360 + </label>
  361 + <div class="col-md-4">
  362 + <p class="form-control-static" data-display="endStationFirstTime"> </p>
  363 + </div>
  364 + </div>
  365 + <div class="col-md-6">
  366 + <label class="control-label col-md-5">
  367 + <span class="required"> * </span> 下行末班时间 :
  368 + </label>
  369 + <div class="col-md-4">
  370 + <p class="form-control-static" data-display="endStationEndTime"> </p>
  371 + </div>
  372 + </div>
  373 + </div>
  374 +
  375 + <div class="form-group">
  376 + <div class="col-md-6">
  377 + <label class="control-label col-md-5">上行出场时间 :
  378 + </label>
  379 + <div class="col-md-5">
  380 + <p class="form-control-static" data-display="upOutTimer"> </p>
  381 + </div>
  382 + </div>
  383 + <div class="col-md-6">
  384 + <label class="control-label col-md-5">上行进场时间 :
  385 + </label>
  386 + <div class="col-md-5">
  387 + <p class="form-control-static" data-display="upInTimer"> </p>
  388 + </div>
  389 + </div>
  390 + </div>
  391 +
  392 + <div class="form-group">
  393 + <div class="col-md-6">
  394 + <label class="control-label col-md-5">下行出场时间 :
  395 + </label>
  396 + <div class="col-md-5">
  397 + <p class="form-control-static" data-display="downOutTimer"> </p>
  398 + </div>
  399 + </div>
  400 + <div class="col-md-6">
  401 + <label class="control-label col-md-5">下行进场时间 :
  402 + </label>
  403 + <div class="col-md-5">
  404 + <p class="form-control-static" data-display="downInTimer"> </p>
  405 + </div>
  406 + </div>
  407 + </div>
  408 +
  409 + <div class="form-group">
  410 + <div class="col-md-6">
  411 + <label class="control-label col-md-5">早晚例行保养 :</label>
  412 + <div class="col-md-4">
  413 + <p class="form-control-static" data-display="lb"> </p>
  414 + </div>
  415 + </div>
  416 + <div class="col-md-6">
  417 + <label class="control-label col-md-5">停车场 :</label>
  418 + <div class="col-md-7">
  419 + <p class="form-control-static" data-display="carPark"> </p>
  420 + </div>
  421 + </div>
  422 + </div>
  423 +
  424 + <div class="form-group">
  425 + <div class="col-md-6">
  426 + <label class="control-label col-md-5">
  427 + <span class="required"> * </span> 早高峰开始时间 :
  428 + </label>
  429 + <div class="col-md-4">
  430 + <p class="form-control-static" data-display="earlyStartTime"> </p>
  431 + </div>
  432 + </div>
  433 + <div class="col-md-6">
  434 + <label class="control-label col-md-5">
  435 + <span class="required"> * </span> 早高峰结束时间 :
  436 + </label>
  437 + <div class="col-md-4">
  438 + <p class="form-control-static" data-display="earlyEndTime"> </p>
  439 + </div>
  440 + </div>
  441 + </div>
  442 +
  443 + <div class="form-group">
  444 + <div class="col-md-6">
  445 + <label class="control-label col-md-5">
  446 + <span class="required"> * </span> 晚高峰开始时间 :
  447 + </label>
  448 + <div class="col-md-4">
  449 + <p class="form-control-static" data-display="lateStartTime"> </p>
  450 + </div>
  451 + </div>
  452 + <div class="col-md-6">
  453 + <label class="control-label col-md-5">
  454 + <span class="required"> * </span> 晚高峰结束时间 :
  455 + </label>
  456 + <div class="col-md-4">
  457 + <p class="form-control-static" data-display="lateEndTime"> </p>
  458 + </div>
  459 + </div>
  460 + </div>
  461 +
  462 + <div class="form-group">
  463 + <div class="col-md-6">
  464 + <label class="control-label col-md-5">早高峰上行时间 :</label>
  465 + <div class="col-md-5">
  466 + <p class="form-control-static" data-display="earlyUpTime"> </p>
  467 + </div>
  468 + </div>
  469 + <div class="col-md-6">
  470 + <label class="control-label col-md-5">早高峰下行时间 :</label>
  471 + <div class="col-md-5">
  472 + <p class="form-control-static" data-display="earlyDownTime"> </p>
  473 + </div>
  474 + </div>
  475 + </div>
  476 +
  477 + <div class="form-group">
  478 + <div class="col-md-6">
  479 + <label class="control-label col-md-5">晚高峰上行时间 :</label>
  480 + <div class="col-md-5">
  481 + <p class="form-control-static" data-display="lateUpTime"> </p>
  482 + </div>
  483 + </div>
  484 + <div class="col-md-6">
  485 + <label class="control-label col-md-5">晚高峰下行时间 :</label>
  486 + <div class="col-md-5">
  487 + <p class="form-control-static" data-display="lateDownTime"> </p>
  488 + </div>
  489 + </div>
  490 + </div>
  491 +
  492 + <div class="form-group">
  493 + <div class="col-md-6">
  494 + <label class="control-label col-md-5">低谷上行时间 :</label>
  495 + <div class="col-md-5">
  496 + <p class="form-control-static" data-display="troughUpTime"> </p>
  497 + </div>
  498 + </div>
  499 + <div class="col-md-6">
  500 + <label class="control-label col-md-5">低谷下行时间 :</label>
  501 + <div class="col-md-5">
  502 + <p class="form-control-static" data-display="troughDownTime"> </p>
  503 + </div>
  504 + </div>
  505 + </div>
  506 +
  507 + <div class="form-group">
  508 + <div class="col-md-6">
  509 + <label class="control-label col-md-5">早高峰最小发车间隔 :</label>
  510 + <div class="col-md-4">
  511 + <p class="form-control-static" data-display="zgffcjxmin"> </p>
  512 + </div>
  513 + </div>
  514 + <div class="col-md-6">
  515 + <label class="control-label col-md-5">早高峰最大发车间隔 :</label>
  516 + <div class="col-md-4">
  517 + <p class="form-control-static" data-display="zgffcjxmax"> </p>
  518 + </div>
  519 + </div>
  520 + </div>
  521 +
  522 + <div class="form-group">
  523 + <div class="col-md-6">
  524 + <label class="control-label col-md-5">晚高峰最小发车间隔 :</label>
  525 + <div class="col-md-4">
  526 + <p class="form-control-static" data-display="wffcjxmin"> </p>
  527 + </div>
  528 + </div>
  529 + <div class="col-md-6">
  530 + <label class="control-label col-md-5">晚高峰最大发车间隔 :</label>
  531 + <div class="col-md-4">
  532 + <p class="form-control-static" data-display="wffcjxmax"> </p>
  533 + </div>
  534 + </div>
  535 + </div>
  536 +
  537 + <div class="form-group">
  538 + <div class="col-md-6">
  539 + <label class="control-label col-md-5">低谷最小发车间隔 :</label>
  540 + <div class="col-md-4">
  541 + <p class="form-control-static" data-display="dgfcjxmin"> </p>
  542 + </div>
  543 + </div>
  544 + <div class="col-md-6">
  545 + <label class="control-label col-md-5">低谷最大发车间隔 :</label>
  546 + <div class="col-md-4">
  547 + <p class="form-control-static" data-display="dgfcjxmax"> </p>
  548 + </div>
  549 + </div>
  550 + </div>
  551 +
  552 + <div class="form-group">
  553 + <div class="col-md-6">
  554 + <label class="control-label col-md-5">吃饭地点 :</label>
  555 + <div class="col-md-7">
  556 + <p class="form-control-static" data-display="cfdd"> </p>
  557 + </div>
  558 + </div>
  559 + </div>
  560 +
  561 + <div class="form-group">
  562 + <div class="col-md-6">
  563 + <label class="control-label col-md-5"> 工作餐午餐时间 : </label>
  564 + <div class="col-md-4">
  565 + <p class="form-control-static" data-display="workeLunch"> </p>
  566 + </div>
  567 + </div>
  568 + <div class="col-md-6">
  569 + <label class="control-label col-md-5"> 工作餐晚餐时间 : </label>
  570 + <div class="col-md-4">
  571 + <p class="form-control-static" data-display="workeDinner"> </p>
  572 + </div>
  573 + </div>
  574 + </div>
  575 +
  576 + <div class="form-group">
  577 + <div class="col-md-6">
  578 + <label class="control-label col-md-5"><span class="required"> * </span>建议加班路牌数 :</label>
  579 + <div class="col-md-5">
  580 + <p class="form-control-static" data-display="jbclcount"> </p>
  581 + </div>
  582 + </div>
  583 + <div class="col-md-6">
  584 + <label class="control-label col-md-5">
  585 + <span class="required"> * </span> 建议高峰配车数 :</label>
  586 + <div class="col-md-5">
  587 + <p class="form-control-static" data-display="gfjypcs"> </p>
  588 + </div>
  589 + </div>
  590 + </div>
  591 +
  592 + <div class="form-group">
  593 + <div class="col-md-6">
  594 + <label class="control-label col-md-5">
  595 + <span class="required"> * </span> 班型/工时/人次 :
  596 + </label>
  597 + <div class="col-md-4">
  598 + <p class="form-control-static" data-display="bxgsrc"> </p>
  599 + </div>
  600 + </div>
  601 + <div class="col-md-6">
  602 + <label class="control-label col-md-5">
  603 + <span class="required"> * </span> 停站类型 :
  604 + </label>
  605 + <div class="col-md-4">
  606 + <p class="form-control-static" data-display="stt"> </p>
  607 + </div>
  608 + </div>
  609 +
  610 + </div>
  611 +
  612 +
  613 +
  614 +
  615 + <!-- TODO:还有其他预览参数 -->
  616 +
  617 +
  618 +</script>
... ...