Commit a66deb974be26111dc9a3250336f8c80a42d67fb

Authored by 徐烜
2 parents 23890d88 68cd3a2c

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

src/main/java/com/bsth/controller/realcontrol/RealChartsController.java
... ... @@ -3,6 +3,7 @@ package com.bsth.controller.realcontrol;
3 3 import com.bsth.service.realcontrol.RealChartsService;
4 4 import com.bsth.service.realcontrol.dto.CarOutRate;
5 5 import com.bsth.service.realcontrol.dto.DeviceOnlineRate;
  6 +import com.bsth.service.realcontrol.dto.ScheduleExecRate;
6 7 import com.bsth.service.realcontrol.dto.StratEndPunctualityRate;
7 8 import org.springframework.beans.factory.annotation.Autowired;
8 9 import org.springframework.web.bind.annotation.RequestMapping;
... ... @@ -32,13 +33,18 @@ public class RealChartsController {
32 33 return realChartsService.carOutRate(month, idx);
33 34 }
34 35  
35   - @RequestMapping("stratEndPunctualityRate")
  36 +/* @RequestMapping("stratEndPunctualityRate")
36 37 public List<StratEndPunctualityRate> stratEndPunctualityRate(@RequestParam String idx, @RequestParam String month){
37 38 return realChartsService.stratEndPunctualityRate(month, idx);
38   - }
  39 + }*/
39 40  
40 41 @RequestMapping("sePunctualityRateLine")
41 42 public List<StratEndPunctualityRate> sePunctualityRateLine(@RequestParam String idx, @RequestParam String month){
42 43 return realChartsService.sePunctualityRateLine(month, idx);
43 44 }
  45 +
  46 + @RequestMapping("scheduleExecRates")
  47 + public List<ScheduleExecRate> scheduleExecRates(@RequestParam String idx, @RequestParam String date){
  48 + return realChartsService.scheduleExecRates(date, idx);
  49 + }
44 50 }
... ...
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
... ... @@ -51,7 +51,7 @@ public class SchAttrCalculator {
51 51  
52 52  
53 53 if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){
54   - sch.setFcsjAll(sch.getFcsjT() + DAY_TIME);
  54 + sch.setFcsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsj()) + DAY_TIME);
55 55 }
56 56  
57 57 sch.setRealExecDate(fmtyyyyMMdd.print(sch.getFcsjT()));
... ...
src/main/java/com/bsth/service/realcontrol/RealChartsService.java
... ... @@ -2,6 +2,7 @@ package com.bsth.service.realcontrol;
2 2  
3 3 import com.bsth.service.realcontrol.dto.CarOutRate;
4 4 import com.bsth.service.realcontrol.dto.DeviceOnlineRate;
  5 +import com.bsth.service.realcontrol.dto.ScheduleExecRate;
5 6 import com.bsth.service.realcontrol.dto.StratEndPunctualityRate;
6 7  
7 8 import java.util.List;
... ... @@ -15,7 +16,9 @@ public interface RealChartsService {
15 16  
16 17 List<CarOutRate> carOutRate(String month, String idx);
17 18  
18   - List<StratEndPunctualityRate> stratEndPunctualityRate(String month, String idx);
  19 + /*List<StratEndPunctualityRate> stratEndPunctualityRate(String month, String idx);*/
19 20  
20 21 List<StratEndPunctualityRate> sePunctualityRateLine(String month, String idx);
  22 +
  23 + List<ScheduleExecRate> scheduleExecRates(String date, String idx);
21 24 }
... ...
src/main/java/com/bsth/service/realcontrol/dto/ScheduleExecRate.java 0 → 100644
  1 +package com.bsth.service.realcontrol.dto;
  2 +
  3 +/**
  4 + * 班次执行率DTO
  5 + * Created by panzhao on 2016/11/14.
  6 + */
  7 +public class ScheduleExecRate {
  8 +
  9 + private long id;
  10 + private String dfsj;
  11 + private String fcsjActual;
  12 + private String zdsj;
  13 + private String zdsjActual;
  14 + private int status;
  15 + private String lineCode;
  16 +
  17 + public long getId() {
  18 + return id;
  19 + }
  20 +
  21 + public void setId(long id) {
  22 + this.id = id;
  23 + }
  24 +
  25 + public String getDfsj() {
  26 + return dfsj;
  27 + }
  28 +
  29 + public void setDfsj(String dfsj) {
  30 + this.dfsj = dfsj;
  31 + }
  32 +
  33 + public String getFcsjActual() {
  34 + return fcsjActual;
  35 + }
  36 +
  37 + public void setFcsjActual(String fcsjActual) {
  38 + this.fcsjActual = fcsjActual;
  39 + }
  40 +
  41 + public String getZdsj() {
  42 + return zdsj;
  43 + }
  44 +
  45 + public void setZdsj(String zdsj) {
  46 + this.zdsj = zdsj;
  47 + }
  48 +
  49 + public String getZdsjActual() {
  50 + return zdsjActual;
  51 + }
  52 +
  53 + public void setZdsjActual(String zdsjActual) {
  54 + this.zdsjActual = zdsjActual;
  55 + }
  56 +
  57 + public int getStatus() {
  58 + return status;
  59 + }
  60 +
  61 + public void setStatus(int status) {
  62 + this.status = status;
  63 + }
  64 +
  65 + public String getLineCode() {
  66 + return lineCode;
  67 + }
  68 +
  69 + public void setLineCode(String lineCode) {
  70 + this.lineCode = lineCode;
  71 + }
  72 +}
... ...
src/main/java/com/bsth/service/realcontrol/dto/StratEndPunctualityRate.java
... ... @@ -10,17 +10,17 @@ public class StratEndPunctualityRate {
10 10  
11 11 private String lineCode;
12 12  
13   - private String nbbm;
14   -
15 13 //首班时间 06:00/06:01
16 14 private String startTime;
17 15  
18 16 //末班时间 20:30/20:31
19 17 private String endTime;
20 18  
21   - //末班真实执行日期
22   - private String etRealExecDate;
  19 + //上下行
  20 + private int updown;
23 21  
  22 + //真实执行日期
  23 + private String etRealExecDate;
24 24  
25 25 public String getDateStr() {
26 26 return dateStr;
... ... @@ -38,14 +38,6 @@ public class StratEndPunctualityRate {
38 38 this.lineCode = lineCode;
39 39 }
40 40  
41   - public String getNbbm() {
42   - return nbbm;
43   - }
44   -
45   - public void setNbbm(String nbbm) {
46   - this.nbbm = nbbm;
47   - }
48   -
49 41 public String getStartTime() {
50 42 return startTime;
51 43 }
... ... @@ -62,6 +54,14 @@ public class StratEndPunctualityRate {
62 54 this.endTime = endTime;
63 55 }
64 56  
  57 + public int getUpdown() {
  58 + return updown;
  59 + }
  60 +
  61 + public void setUpdown(int updown) {
  62 + this.updown = updown;
  63 + }
  64 +
65 65 public String getEtRealExecDate() {
66 66 return etRealExecDate;
67 67 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/RealChartsServiceImpl.java
... ... @@ -4,10 +4,7 @@ import com.bsth.data.BasicData;
4 4 import com.bsth.data.LineConfigData;
5 5 import com.bsth.entity.realcontrol.LineConfig;
6 6 import com.bsth.service.realcontrol.RealChartsService;
7   -import com.bsth.service.realcontrol.dto.CarOutRate;
8   -import com.bsth.service.realcontrol.dto.DeviceOnlineRate;
9   -import com.bsth.service.realcontrol.dto.RealOnline;
10   -import com.bsth.service.realcontrol.dto.StratEndPunctualityRate;
  7 +import com.bsth.service.realcontrol.dto.*;
11 8 import com.bsth.util.db.DBUtils_MS;
12 9 import com.google.common.base.Splitter;
13 10 import org.apache.commons.lang3.StringUtils;
... ... @@ -37,7 +34,8 @@ public class RealChartsServiceImpl implements RealChartsService {
37 34 LineConfigData lineConfigData;
38 35  
39 36  
40   - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");
  37 + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd")
  38 + ,fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm");
41 39  
42 40 private final static long DAY_TIME = 1000 * 60 * 60 * 24L;
43 41 /**
... ... @@ -164,7 +162,7 @@ public class RealChartsServiceImpl implements RealChartsService {
164 162 * @param idx
165 163 * @return
166 164 */
167   - @Override
  165 +/* @Override
168 166 public List<StratEndPunctualityRate> stratEndPunctualityRate(String month, String idx) {
169 167 List<String> idArray = Splitter.on(",").splitToList(idx);
170 168 //拼接in语句
... ... @@ -208,7 +206,7 @@ public class RealChartsServiceImpl implements RealChartsService {
208 206 }
209 207 });
210 208 return list;
211   - }
  209 + }*/
212 210  
213 211 @Override
214 212 public List<StratEndPunctualityRate> sePunctualityRateLine(String month, String idx) {
... ... @@ -220,10 +218,7 @@ public class RealChartsServiceImpl implements RealChartsService {
220 218 }
221 219 inStr = " (" + inStr.substring(1) + ")";
222 220  
223   - String sql = "select SCHEDULE_DATE_STR,XL_BM, min(sj) as STARTDATE, max(sj) as ENDDATE " +
224   - "from (select SCHEDULE_DATE_STR,dfsj, concat_ws('/',dfsj, fcsj_actual) as sj,XL_BM from bsth_c_s_sp_info_real " +
225   - "where schedule_date_str like :month and bc_type='normal' and dfsj is not null and xl_bm in "+inStr+") t group by SCHEDULE_DATE_STR,XL_BM";
226   -
  221 + String sql = "select min(DFSJ) as STARTDATE,max(DFSJ) as ENDDATE,SCHEDULE_DATE_STR,XL_BM,XL_DIR,REAL_EXEC_DATE from (SELECT SCHEDULE_DATE_STR,concat_ws('_',concat_ws('/', dfsj, fcsj_actual),fcno) AS DFSJ,XL_BM,XL_DIR,REAL_EXEC_DATE FROM bsth_c_s_sp_info_real WHERE schedule_date_str LIKE :month AND bc_type = 'normal' AND dfsj IS NOT NULL AND xl_bm IN "+inStr+") t group by SCHEDULE_DATE_STR,XL_BM,XL_DIR,REAL_EXEC_DATE";
227 222 MapSqlParameterSource parameters = new MapSqlParameterSource();
228 223 parameters.addValue("month", month+"-%");
229 224  
... ... @@ -235,10 +230,11 @@ public class RealChartsServiceImpl implements RealChartsService {
235 230 obj.setDateStr(rs.getString("SCHEDULE_DATE_STR"));
236 231 obj.setStartTime(rs.getString("STARTDATE"));
237 232 obj.setEndTime(rs.getString("ENDDATE"));
238   - obj.setEtRealExecDate(obj.getDateStr());
  233 + obj.setUpdown(rs.getInt("XL_DIR"));
  234 + obj.setEtRealExecDate(rs.getString("REAL_EXEC_DATE"));
239 235  
240   - if(obj.getEndTime().length() == 11){
241   - //末班真实执行日期
  236 + if(obj.getEndTime().length() >= 11){
  237 + //末班真实执行日期,末班可能跨过12点。
242 238 LineConfig conf =lineConfigData.get(obj.getLineCode());
243 239 String fcsjActual=obj.getEndTime().split("/")[1];
244 240  
... ... @@ -247,7 +243,40 @@ public class RealChartsServiceImpl implements RealChartsService {
247 243 obj.setEtRealExecDate(fmtyyyyMMdd.print(fmtyyyyMMdd.parseMillis(obj.getEtRealExecDate()) + DAY_TIME));
248 244 }
249 245 }
  246 + return obj;
  247 + }
  248 + });
  249 + return list;
  250 + }
  251 +
  252 + @Override
  253 + public List<ScheduleExecRate> scheduleExecRates(String date, String idx) {
  254 + List<String> idArray = Splitter.on(",").splitToList(idx);
  255 + //拼接in语句
  256 + String inStr = "";
  257 + for (String code : idArray) {
  258 + inStr += (",'" + code+"'");
  259 + }
  260 + inStr = " (" + inStr.substring(1) + ")";
250 261  
  262 + String sql = "SELECT ID,DFSJ,FCSJ_ACTUAL,ZDSJ,ZDSJ_ACTUAL,`STATUS`,XL_BM FROM bsth_c_s_sp_info_real WHERE schedule_date_str=:date AND concat_ws('', real_exec_date, dfsj)<:cdate and xl_bm in "+inStr+" ORDER BY dfsj";
  263 +
  264 + MapSqlParameterSource parameters = new MapSqlParameterSource();
  265 + parameters.addValue("date", date);
  266 + parameters.addValue("cdate", fmtyyyyMMddHHmm.print(new Date().getTime()));
  267 +
  268 +
  269 + List<ScheduleExecRate> list = jdbcTemplate.query(sql, parameters, new RowMapper<ScheduleExecRate>() {
  270 + @Override
  271 + public ScheduleExecRate mapRow(ResultSet rs, int rowNum) throws SQLException {
  272 + ScheduleExecRate obj = new ScheduleExecRate();
  273 + obj.setId(rs.getLong("ID"));
  274 + obj.setDfsj(rs.getString("DFSJ"));
  275 + obj.setFcsjActual(rs.getString("FCSJ_ACTUAL"));
  276 + obj.setZdsj(rs.getString("ZDSJ"));
  277 + obj.setZdsjActual(rs.getString("ZDSJ_ACTUAL"));
  278 + obj.setStatus(rs.getInt("STATUS"));
  279 + obj.setLineCode(rs.getString("XL_BM"));
251 280 return obj;
252 281 }
253 282 });
... ...
src/main/resources/static/pages/control/lineallot/allot.html
... ... @@ -163,8 +163,8 @@
163 163 <a href="javascript:;" class="btn btn-lg blue gotoControl red" data-status=1>
164 164 <i class="fa fa-power-off"></i> 主调模式 </a>
165 165  
166   - <!-- <a href="javascript:;" id="monitor" class="btn btn-lg grey gotoControl" data-status=0>
167   - <i class="fa fa-tv"></i> 监控模式 </a> -->
  166 + <a href="javascript:;" id="monitor" class="btn btn-lg grey gotoControl" data-status=0>
  167 + <i class="fa fa-tv"></i> 监控模式 </a>
168 168 &nbsp;
169 169 <a href="javascript:;" id="resetBtn" style="left: 120px;color: #3598DC;">
170 170 <i class="fa fa-history"></i> 重置</a>
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -302,4 +302,4 @@ canvas.crosshair-layer {
302 302 li.map-panel{
303 303 height: 100%;
304 304 position: relative;
305   -}
  305 +}
306 306 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/css/north.css
1 1 .north {
2   - background: linear-gradient(to right, #082F4A, #125688, #0a3f64);
  2 + background: linear-gradient(to right ,#595959, #7b7b7b,#595959);
3 3 height: 120px;
4 4 position: relative;
  5 + transition: all .3s ease;
  6 +}
  7 +
  8 +.north.main {
  9 + background: linear-gradient(to right, #082F4A, #125688, #0a3f64);
  10 +}
  11 +
  12 +.north.scok-colse {
  13 + background: linear-gradient(to right, #924040, #ce6262, #924040) !important;
  14 +}
  15 +
  16 +.north.scok-colse:before {
  17 + content: "长连接被断开,你将无法收到服务器推送的发车、到站信息。请刷新页面以重建连接!";
  18 + position: absolute;
  19 + padding: 5px 10px 5px 14px;
  20 + background: #414141;
  21 + color: #f9f9f9;
  22 + border-radius: 20px 0 0 20px;
  23 + z-index: 5;
  24 + left: 270px;
  25 + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);
  26 + border: 1px solid #caaaaa;
  27 + font-size: 13px;
5 28 }
6 29  
7 30 .north .north-logo {
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/charts/s_e_punctuality_rate_line.html
... ... @@ -61,56 +61,46 @@
61 61 //实发准点率 -dfsj 待发时间戳(秒),sfsj 实发时间戳(秒)
62 62 function calcPunctuality(dfsj, sfsj){
63 63 var diff=(dfsj-sfsj)/60;
64   - var rs=0;
65 64 if(diff > 0){
66 65 if(diff <= 1)
67   - rs=1;
68   - else
69   - rs=(10 - (diff - 1)) / 10;
  66 + return true;
70 67 }
71 68 else{
72   - if(Math.abs(diff) < 3)
73   - rs=1;
74   - else
75   - rs=(10 - (Math.abs(diff) - 3)) / 10;
  69 + if(Math.abs(diff) <= 3)
  70 + return true;
76 71 }
77 72  
78   - return rs<0?0:rs;
  73 + return false;
79 74 }
80 75  
81 76 //计算准点率
82 77 function calcPunctualityRate(data){
83   - var line2Reate={}, seff, eeff, fs="YYYY-MM-DDHH:mm";
  78 + var line2Reate={}, eff, fs="YYYY-MM-DDHH:mm";
84 79 for(var lineCode in data){
85   - seff=0;
86   - eeff=0;
  80 + eff=0;
87 81 $.each(data[lineCode], function(){
88 82 //首班时间
89   - if(this.startTime.length == 11){
  83 + if(this.startTime.length >= 11){
90 84 var arr=this.startTime.split('/');
91   - var sDfsj=moment(this.etRealExecDate+arr[0], fs).format('X'),
92   - sSfsj=moment(this.etRealExecDate+arr[1], fs).format('X');
  85 + var dfsj=moment(this.etRealExecDate+arr[0], fs).format('X'),
  86 + sfsj=moment(this.etRealExecDate+arr[1], fs).format('X');
93 87  
94   - seff=calcPunctuality(sDfsj, sSfsj);
  88 + if(calcPunctuality(dfsj, sfsj))
  89 + eff+=25;
95 90 }
96   - else
97   - this.s_isPunctuality=-1;
  91 +
98 92 //末班时间
99   - if(this.endTime.length == 11){
  93 + if(this.endTime.length >= 11){
100 94 var arr=this.endTime.split('/');
101   - var eDfsj=moment(this.etRealExecDate+arr[0], fs).format('X'),
102   - eSfsj=moment(this.etRealExecDate+arr[1], fs).format('X');
  95 + var dfsj=moment(this.etRealExecDate+arr[0], fs).format('X'),
  96 + sfsj=moment(this.etRealExecDate+arr[1], fs).format('X');
103 97  
104   - eeff=calcPunctuality(eDfsj, eSfsj);
  98 + if(calcPunctuality(dfsj, sfsj))
  99 + eff+=25;
105 100 }
106   - else
107   - this.e_isPunctuality=-1;
108 101 });
109 102  
110   - line2Reate[lineCode]={
111   - seff: (seff*100).toFixed(2),
112   - eeff: (eeff*100).toFixed(2)
113   - };
  103 + line2Reate[lineCode]={eff: eff};
114 104 }
115 105  
116 106 return line2Reate;
... ... @@ -165,26 +155,17 @@
165 155 //lineCode再次分组,计算准点率
166 156 var line2Reate=calcPunctualityRate(gb_common.groupBy(groupList[date],'lineCode'));
167 157  
168   - sData=[], eData=[];
  158 + sData=[];
169 159 //subData=[];
170 160 $.each(lineCodeArr, function(i, code){
171 161 sData.push({
172   - value: line2Reate[code]?line2Reate[code].seff:0,
173   - date:date,
174   - lineCode: code
175   - });
176   -
177   - eData.push({
178   - value: line2Reate[code]?line2Reate[code].eeff:0,
  162 + value: line2Reate[code]?line2Reate[code].eff:0,
179 163 date:date,
180 164 lineCode: code
181 165 });
182 166 });
183 167  
184 168 data.push({
185   - legend: {
186   - data: ['首班', '末班']
187   - },
188 169 grid: {x: 30, x2: 5, height: 390, y: 94, y2: 50},
189 170 tooltip: {
190 171 'trigger': 'axis',
... ... @@ -206,21 +187,16 @@
206 187 },
207 188 title: {
208 189 text: date + '首末班次准点率',
209   - subtext: '线路首末班发车数据(快1慢3准点,差值每分钟降10点)'
  190 + subtext: '线路上下行首末班,4个班次,每个班次25%(快1慢3准点)'
210 191 },
211   - text: date + '发车率',
212 192 series: [{
213   - name: '首班',
  193 + name: '准点率',
214 194 type: 'bar',
215 195 data: sData
216   - },
217   - {
218   - name: '末班',
219   - type: 'bar',
220   - data: eData
221   - }]
  196 + }]
222 197 });
223 198 }
  199 + console.log(data);
224 200  
225 201 $('.load-panel', modal).hide();
226 202 $('#countBtn', modal).removeAttr('disabled');
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/charts/sch_exec_rate.html 0 → 100644
  1 +<div class="uk-modal" id="sch-exec-rate-modal">
  2 + <div class="uk-modal-dialog" style="width: 1200px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>班次执行率</h2></div>
  6 +
  7 + <div class="uk-panel uk-panel-box uk-panel-box-primary" style="margin-bottom: 10px;">
  8 + <form class="uk-form search-form">
  9 + <fieldset data-uk-margin>
  10 + <div class="uk-form-icon">
  11 + <i class="uk-icon-calendar"></i>
  12 + <input type="date" id="dateInput">
  13 + </div>
  14 + <button class="uk-button" id="countBtn">统计</button>
  15 + </fieldset>
  16 + </form>
  17 + </div>
  18 +
  19 + <div class="chart-wrap" style="height: 570px;">
  20 +
  21 + </div>
  22 +
  23 + <div class="load-panel">
  24 + <i class="uk-icon-spinner uk-icon-spin"></i>
  25 + 正在汇总数据
  26 + </div>
  27 + </div>
  28 +
  29 + <script>
  30 + (function () {
  31 +
  32 + var modal = '#sch-exec-rate-modal';
  33 + var chartObj;
  34 +
  35 + var option = {
  36 + color: ['#3398DB'],
  37 + tooltip: {
  38 + trigger: 'axis',
  39 + axisPointer: {
  40 + type: 'shadow'
  41 + }
  42 + },
  43 + grid: {
  44 + left: '3%',
  45 + right: '4%',
  46 + bottom: '3%',
  47 + containLabel: true
  48 + },
  49 + xAxis: [
  50 + {
  51 + type: 'category',
  52 + axisTick: {
  53 + alignWithLabel: true
  54 + }
  55 + }
  56 + ],
  57 + yAxis: [
  58 + {
  59 + type: 'value',
  60 + min: 0,
  61 + max: 100,
  62 + name: '执行率'
  63 + }
  64 + ],
  65 + series: [
  66 + {
  67 + name: '班次执行率',
  68 + type: 'bar',
  69 + barWidth: '60%'
  70 + }
  71 + ]
  72 + };
  73 +
  74 +
  75 + $(modal).on('init', function (e, data) {
  76 + //默认当天
  77 + var m = moment().format('YYYY-MM-DD');
  78 + $('#dateInput', modal).val(m);
  79 +
  80 + chartObj = echarts.init($('.chart-wrap', modal)[0]);
  81 + chartObj.on('click', chartObjClickHandler);
  82 + renderChart();
  83 +
  84 + });
  85 +
  86 +
  87 + $('#countBtn', modal).on('click', function () {
  88 + try {
  89 + renderChart();
  90 + } catch (e) {
  91 + console.log(e);
  92 + }
  93 + return false;
  94 + });
  95 +
  96 + //计算执行率
  97 + function calcSchExecRate(list) {
  98 + if (!list)
  99 + return 0;
  100 + var eff = 0;
  101 + $.each(list, function () {
  102 + if (this.status >= 1)
  103 + eff++;
  104 + });
  105 + return (eff / list.length * 100).toFixed(2);
  106 + }
  107 +
  108 + var renderData;
  109 +
  110 + function renderChart() {
  111 + //xAxis data
  112 + var xAxisData = [], lineCodeArr = [];
  113 + $.each(gb_data_basic.activeLines, function () {
  114 + xAxisData.push(this.name);
  115 + lineCodeArr.push(this.lineCode);
  116 + });
  117 + option.xAxis[0].data = xAxisData;
  118 +
  119 + $.get('/realCharts/scheduleExecRates', {
  120 + idx: gb_data_basic.line_idx,
  121 + date: $('#dateInput', modal).val()
  122 + }, function (rs) {
  123 + //console.log(rs);
  124 + //按线路分组
  125 + var groupData = gb_common.groupBy(rs, 'lineCode');
  126 +
  127 + renderData = groupData;
  128 + var data = [];
  129 +
  130 + for (var i = 0, code; code = lineCodeArr[i++];) {
  131 + //计算执行率
  132 + var eff = calcSchExecRate(groupData[code]);
  133 + data.push({value: eff, lineCode: code});
  134 + }
  135 +
  136 + option.series[0].data = data;
  137 + chartObj.setOption(option);
  138 + });
  139 + }
  140 +
  141 + function chartObjClickHandler(obj) {
  142 + if (obj.componentType != 'series' || obj.componentSubType != 'bar')
  143 + return;
  144 +
  145 + var list = renderData[obj.data.lineCode];
  146 + list = list.filter(function (obj) {
  147 + if(obj.status<1)
  148 + return 1;
  149 + else
  150 + return 0;
  151 + });
  152 +
  153 + $.get('/real_control_v2/fragments/north/nav/charts/sch_exec_rate_detail.html', function (htmlStr) {
  154 + $(document.body).append(htmlStr);
  155 + var detailModal = '#sch-exec-rate-detail-modal';
  156 + var elem = UIkit.modal(detailModal, {bgclose: true, modal: false}).show();
  157 + $(detailModal).trigger('init', {list: list});
  158 + })
  159 + }
  160 + })();
  161 + </script>
  162 +</div>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/charts/sch_exec_rate_detail.html 0 → 100644
  1 +<div class="uk-modal" id="sch-exec-rate-detail-modal">
  2 + <div class="uk-modal-dialog" style="width: 350px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div style="margin:5px 0 -18px;">
  5 + <table class="ct-fixed-table uk-table uk-table-hover">
  6 + <thead>
  7 + <tr>
  8 + <th style="width: 40%;">线路</th>
  9 + <th style="width: 30%;">待发</th>
  10 + <th style="width: 30%;">状态</th>
  11 + </tr>
  12 + </thead>
  13 + <tbody>
  14 + </tbody>
  15 + </table>
  16 + </div>
  17 + </div>
  18 +
  19 + <script id="sch-exec-rate-detail-table-temp" type="text/html">
  20 + {{each list as obj i}}
  21 + <tr>
  22 + <td>{{obj.lineName}}</td>
  23 + <td>{{obj.dfsj}}</td>
  24 + <td>
  25 + {{if obj.status==-1}}
  26 + <span style="color: red;">烂班</span>
  27 + {{else if obj.status==1}}
  28 + 正在执行
  29 + {{else if obj.status==2}}
  30 + 已执行
  31 + {{/if}}
  32 + </td>
  33 + </tr>
  34 + {{/each}}
  35 + </script>
  36 +
  37 + <script>
  38 + (function() {
  39 + var modal = '#sch-exec-rate-detail-modal';
  40 +
  41 + $(modal).on('init', function(e, data) {
  42 + var code2Name = gb_data_basic.lineCode2NameAll();
  43 + $.each(data.list, function(){
  44 + this.lineName=code2Name[this.lineCode];
  45 + });
  46 +
  47 + var tbodys=template('sch-exec-rate-detail-table-temp', {list: data.list});
  48 + $('table tbody', modal).html(tbodys);
  49 + });
  50 + })();
  51 + </script>
  52 +</div>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/charts/strat_end_punctuality_rate_dateil.html
... ... @@ -7,7 +7,7 @@
7 7 <tr>
8 8 <th style="width: 14%;">日期</th>
9 9 <th style="width: 14%;">线路</th>
10   - <th style="width: 14%;">车辆</th>
  10 + <th style="width: 14%;">上下行</th>
11 11 <th style="width: 23%;">首班</th>
12 12 <th style="width: 23%;">末班</th>
13 13 </tr>
... ... @@ -23,7 +23,13 @@
23 23 <tr>
24 24 <td>{{obj.dateStr}}</td>
25 25 <td>{{obj.lineName}}</td>
26   - <td>{{obj.nbbm}}</td>
  26 + <td>
  27 + {{if obj.updown==0}}
  28 + 上行
  29 + {{else if obj.updown==1}}
  30 + 下行
  31 + {{/if}}
  32 + </td>
27 33 <td>
28 34 {{obj.startTime}}
29 35 </td>
... ... @@ -44,15 +50,13 @@
44 50 var code2Name = gb_data_basic.lineCode2NameAll();
45 51 $.each(data.list, function(){
46 52 this.lineName=code2Name[this.lineCode];
  53 + if(this.startTime.indexOf('_'))
  54 + this.startTime=this.startTime.split('_')[0];
  55 + if(this.endTime.indexOf('_'))
  56 + this.endTime=this.endTime.split('_')[0];
47 57 });
48 58  
49   - /*data.list.sort(function(a, b){
50   - if(!a.firstOut)
51   - return -1;
52   - if(!b.firstOut)
53   - return 1;
54   - return a.firstOut.localeCompare(b.firstOut);
55   - });*/
  59 +
56 60  
57 61 var tbodys=template('s-e-punctuality-rate-dateil-table-temp', {list: data.list});
58 62 $('table tbody', modal).html(tbodys);
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/history_sch_maintain.html
1   -<div class="uk-modal" id="history-sch-maintain-modal">
2   - <div class="uk-modal-dialog" style="width: 1180px;">
3   - <a href="" class="uk-modal-close uk-close"></a>
4   - <h2>历史班次维护</h2>
5   -
6   - <div style="padding-left: 12px;margin: 20px 0">
7   - <ul class="uk-subnav uk-subnav-pill h-s-time">
8   - </ul>
9   - </div>
10   -
11   - <div style="padding-left: 12px;">
12   - <ul class="uk-subnav uk-subnav-pill h-s-line">
13   - </ul>
14   - </div>
15   -
16   - <div class="uk-panel uk-panel-box uk-panel-box-primary">
17   - <form class="uk-form search-form">
18   - <fieldset data-uk-margin>
19   - <span class="horizontal-field">上下行</span>
20   - <select name="xlDir_eq">
21   - <option value="">全部</option>
22   - <option value="0">上行</option>
23   - <option value="1">下行</option>
24   - </select>
25   - &nbsp;
26   - <span class="horizontal-field">车辆</span>
27   - <div class="uk-autocomplete uk-form autocomplete-cars">
28   - <input type="text" name="clZbh_like" placeholder="车辆自编号">
29   - </div>
30   - <span class="horizontal-field">驾驶员</span>
31   - <div class="uk-autocomplete uk-form autocomplete-jsy">
32   - <input type="text" name="jGh_like" placeholder="驾驶员">
33   - </div>
34   - <button class="uk-button">检索</button>
35   - </fieldset>
36   - </form>
37   - </div>
38   -
39   - <div class="ct_table_wrap ct_table_no_border history-sch-wrap" style="height: 510px;">
40   - <div class="ct_table history-sch-table">
41   - <div class="ct_table_head">
42   - <dl>
43   - <dt>车辆</dt>
44   - <dt>驾驶员</dt>
45   - <dt>起点</dt>
46   - <dt>终点</dt>
47   - <dt>计发</dt>
48   - <dt>待发</dt>
49   - <dt>实发</dt>
50   - <dt>终点时间</dt>
51   - <dt>备注</dt>
52   - </dl>
53   - </div>
54   - <div class="ct_table_body">
55   - </div>
56   - </div>
57   - </div>
58   - <div class="uk-modal-footer uk-text-right pagination-wrap">
59   - </div>
60   -
61   - <div class="load-panel">
62   - <i class="uk-icon-spinner uk-icon-spin"></i>
63   - 正在加载数据
64   - </div>
65   - </div>
66   -
67   - <script id="history-sch-maintain-table-temp" type="text/html">
68   - {{each list as sch i}}
69   - <dl data-id="{{sch.id}}">
70   - <dd>{{sch.clZbh}}</dd>
71   - <dd>{{sch.jGh}}/{{sch.jName}}</dd>
72   - <dd title="{{sch.qdzName}}">{{sch.qdzName}}</dd>
73   - <dd title="{{sch.zdzName}}">{{sch.zdzName}}</dd>
74   - <dd>{{sch.fcsj}}
75   - {{if sch.bcType == "out"}}
76   - <span class="uk-badge uk-badge-success">出场</span>
77   - {{else if sch.bcType == "in"}}
78   - <span class="uk-badge uk-badge-warning">进场</span>
79   - {{else if sch.bcType == "venting"}}
80   - <span class="uk-badge uk-badge-danger">直放</span>
81   - {{else if sch.bcType == "major"}}
82   - <span class="uk-badge uk-badge-danger">放站</span>
83   - {{/if}}
84   - {{if sch.sflj}}
85   - <span class="uk-badge uk-badge-danger">临加</span>
86   - {{/if}}
87   - {{if sch.cTasks.length > 0}}
88   - <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span>
89   - {{/if}}</dd>
90   - <dd>{{sch.dfsj}}</dd>
91   - <dd>{{sch.fcsjActual}}</dd>
92   - <dd>{{sch.zdsjActual}}</dd>
93   - <dd title="{{sch.remarks}}">{{sch.remarks}}</dd>
94   - </dl>
95   - {{/each}}
96   - </script>
97   -
98   - <script>
99   - (function () {
100   - var modal = '#history-sch-maintain-modal';
101   - $(modal).on('init', function (e, data) {
102   - $.get('/realSchedule/dateArray', function (rs) {
103   - //日期tab
104   - var tsStr = '';
105   - $.each(rs, function (i) {
106   - tsStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + '><a>' + this + '</a></li>';
107   - });
108   - $('.h-s-time', modal).html(tsStr);
109   -
110   - //线路tab
111   - var xlStr = '';
112   - $.each(gb_data_basic.activeLines, function (i) {
113   - xlStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + ' data-id="' + this.lineCode + '"><a>' + this.name + '</a></li>';
114   - });
115   - $('.h-s-line', modal).html(xlStr);
116   -
117   -
118   - jsQuery();
119   - });
120   - });
121   -
122   - $(modal).on('refresh', jsQuery);
123   -
124   - $(modal).on('click', '.h-s-time li,.h-s-line li', function () {
125   - if(loading)
126   - return;
127   - $(this).parent().find('li.uk-active').removeClass('uk-active');
128   - $(this).addClass('uk-active');
129   - jsQuery();
130   - });
131   -
132   - $('.search-form', modal).on('submit', function (e) {
133   - try {
134   - jsQuery();
135   - }catch(e){
136   - console.log(e);
137   - }
138   - return false;
139   - });
140   -
141   - var nbbmArray=[],jsyArray=[],loading;
142   - function jsQuery() {
143   - var data = $('.search-form', modal).serializeJSON();
144   - var rq = $('.h-s-time li.uk-active', modal).text(),
145   - lineCode = $('.h-s-line li.uk-active', modal).data('id');
146   - data.scheduleDateStr_eq = rq;
147   - data.xlBm_eq = lineCode;
148   - if(data.jGh_like.indexOf('/')!=-1){
149   - var jsy=data.jGh_like.split('/');
150   - data.jGh_like=jsy[0];
151   - data.jName_like=jsy[1];
152   - }
153   -
154   - $('.load-panel', modal).show();
155   - loading=true;
156   - $.get('/realSchedule/all', data, function (rs) {
157   - rs.sort(schedule_sort);
158   - var tbodyStr = template('history-sch-maintain-table-temp', {list: rs});
159   - $('.history-sch-table .ct_table_body', modal).html(tbodyStr);
160   -
161   - //可搜索的车辆自编号和驾驶员
162   - nbbmArray=[];
163   - jsyArray=[];
164   - $.each(rs, function () {
165   - nbbmArray.push({value: this.clZbh});
166   - jsyArray.push({value: this.jGh+'/'+this.jName,
167   - fullChars: pinyin.getFullChars(this.jName).toUpperCase(),
168   - camelChars: pinyin.getCamelChars(this.jName)});
169   - });
170   - //value
171   - nbbmArray=distinctByField(nbbmArray);
172   - jsyArray=distinctByField(jsyArray);
173   - $('.load-panel', modal).hide();
174   - loading=false;
175   -
176   - });
177   - }
178   -
179   - //nbbm autocomplete
180   - var carAutoCom=$('.autocomplete-cars', modal);
181   - UIkit.autocomplete(carAutoCom, {
182   - minLength: 1,
183   - delay: 50,
184   - source: function(release) {
185   - var q = $('input', carAutoCom).val().toUpperCase()
186   - ,rs = [],
187   - count = 0;
188   - $.each(nbbmArray, function () {
189   - if(this.value.indexOf(q) != -1){
190   - rs.push(this);
191   - count++;
192   - }
193   - });
194   - release && release(rs);
195   - }
196   - });
197   -
198   - //jsy autocomplete
199   - var jsyAutoCom=$('.autocomplete-jsy', modal);
200   - UIkit.autocomplete(jsyAutoCom, {
201   - minLength: 1,
202   - delay: 50,
203   - source: function(release) {
204   - var q = $('input', jsyAutoCom).val().toUpperCase()
205   - ,rs = [],
206   - count = 0;
207   -
208   - $.each(jsyArray, function() {
209   - if (this.value.indexOf(q) != -1 || this.fullChars.indexOf(q) != -1 || this.camelChars.indexOf(q) != -1){
210   - rs.push(this);
211   - count++;
212   - }
213   -
214   - if (count >= 10)
215   - return false;
216   - });
217   - release && release(rs);
218   - }
219   - });
220   -
221   - function schedule_sort(s1, s2) {
222   - return (s1.realExecDate+s1.dfsj).localeCompare(s2.realExecDate+s2.dfsj);
223   - }
224   -
225   - function distinctByField(arr, f){
226   - if(!f)
227   - f = 'value';
228   - var rs = {};
229   - $.each(arr, function () {
230   - rs[this[f]]=this;
231   - });
232   - return gb_common.get_vals(rs);
233   - }
234   -
235   - gb_ct_table.fixedHead($('.ct_table_wrap', modal));
236   -
237   - //班次点击
238   - $(modal).on('click contextmenu', '.history-sch-table .ct_table_body dl', function() {
239   - $(this).parent().find('.active').removeClass('active');
240   - $(this).addClass('active');
241   - });
242   -
243   - var callbackHandler={
244   - edit: function(id){
245   - open_modal('/real_control_v2/fragments/north/nav/history_sch/edit.html', {id: id, parentModal: modal}, {center: false,bgclose: false, modal: false});
246   - }
247   - }
248   -
249   - //右键菜单
250   - $.contextMenu({
251   - selector: modal+' .history-sch-table .ct_table_body dl',
252   - className: 'schedule-ct-menu',
253   - callback: function(key, options) {
254   - var id = $('.context-menu-active', modal).data('id');
255   - callbackHandler[key] && callbackHandler[key](id);
256   - },
257   - items: {
258   - 'edit': {
259   - name: '编辑'
260   - },
261   - 'child_task':{
262   - name: '子任务',
263   - disabled: true
264   - },
265   - 'add': {
266   - name: '新增',
267   - disabled: true
268   - },
269   - 'delete':{
270   - name: '删除',
271   - disabled: true
272   - }
273   - }
274   - });
275   - })();
276   - </script>
277   -</div>
  1 +<div class="uk-modal" id="history-sch-maintain-modal">
  2 + <div class="uk-modal-dialog" style="width: 1180px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <h2>历史班次维护</h2>
  5 +
  6 + <div style="padding-left: 12px;margin: 20px 0">
  7 + <ul class="uk-subnav uk-subnav-pill h-s-time">
  8 + </ul>
  9 + </div>
  10 +
  11 + <div style="padding-left: 12px;">
  12 + <ul class="uk-subnav uk-subnav-pill h-s-line">
  13 + </ul>
  14 + </div>
  15 +
  16 + <div class="uk-panel uk-panel-box uk-panel-box-primary">
  17 + <form class="uk-form search-form">
  18 + <fieldset data-uk-margin>
  19 + <span class="horizontal-field">上下行</span>
  20 + <select name="xlDir_eq">
  21 + <option value="">全部</option>
  22 + <option value="0">上行</option>
  23 + <option value="1">下行</option>
  24 + </select>
  25 + &nbsp;
  26 + <span class="horizontal-field">车辆</span>
  27 + <div class="uk-autocomplete uk-form autocomplete-cars">
  28 + <input type="text" name="clZbh_like" placeholder="车辆自编号">
  29 + </div>
  30 + <span class="horizontal-field">驾驶员</span>
  31 + <div class="uk-autocomplete uk-form autocomplete-jsy">
  32 + <input type="text" name="jGh_like" placeholder="驾驶员">
  33 + </div>
  34 + <button class="uk-button">检索</button>
  35 + </fieldset>
  36 + </form>
  37 + </div>
  38 +
  39 + <div class="ct_table_wrap ct_table_no_border history-sch-wrap" style="height: 510px;">
  40 + <div class="ct_table history-sch-table">
  41 + <div class="ct_table_head">
  42 + <dl>
  43 + <dt>车辆</dt>
  44 + <dt>驾驶员</dt>
  45 + <dt>起点</dt>
  46 + <dt>终点</dt>
  47 + <dt>计发</dt>
  48 + <dt>待发</dt>
  49 + <dt>实发</dt>
  50 + <dt>终点时间</dt>
  51 + <dt>备注</dt>
  52 + </dl>
  53 + </div>
  54 + <div class="ct_table_body">
  55 + </div>
  56 + </div>
  57 + </div>
  58 + <div class="uk-modal-footer uk-text-right pagination-wrap">
  59 + </div>
  60 +
  61 + <div class="load-panel">
  62 + <i class="uk-icon-spinner uk-icon-spin"></i>
  63 + 正在加载数据
  64 + </div>
  65 + </div>
  66 +
  67 + <script id="history-sch-maintain-table-temp" type="text/html">
  68 + {{each list as sch i}}
  69 + <dl data-id="{{sch.id}}">
  70 + <dd>{{sch.clZbh}}</dd>
  71 + <dd>{{sch.jGh}}/{{sch.jName}}</dd>
  72 + <dd title="{{sch.qdzName}}">{{sch.qdzName}}</dd>
  73 + <dd title="{{sch.zdzName}}">{{sch.zdzName}}</dd>
  74 + <dd>{{sch.fcsj}}
  75 + {{if sch.bcType == "out"}}
  76 + <span class="uk-badge uk-badge-success">出场</span>
  77 + {{else if sch.bcType == "in"}}
  78 + <span class="uk-badge uk-badge-warning">进场</span>
  79 + {{else if sch.bcType == "venting"}}
  80 + <span class="uk-badge uk-badge-danger">直放</span>
  81 + {{else if sch.bcType == "major"}}
  82 + <span class="uk-badge uk-badge-danger">放站</span>
  83 + {{/if}}
  84 + {{if sch.sflj}}
  85 + <span class="uk-badge uk-badge-danger">临加</span>
  86 + {{/if}}
  87 + {{if sch.cTasks.length > 0}}
  88 + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span>
  89 + {{/if}}</dd>
  90 + <dd>
  91 + {{sch.dfsj}}
  92 + {{if sch.status==-1}}
  93 + <span class="uk-badge uk-badge-danger">烂班</span>
  94 + {{/if}}
  95 + </dd>
  96 + <dd>{{sch.fcsjActual}}</dd>
  97 + <dd>{{sch.zdsjActual}}</dd>
  98 + <dd title="{{sch.remarks}}">{{sch.remarks}}</dd>
  99 + </dl>
  100 + {{/each}}
  101 + </script>
  102 +
  103 + <script>
  104 + (function () {
  105 + var modal = '#history-sch-maintain-modal';
  106 + $(modal).on('init', function (e, data) {
  107 + $.get('/realSchedule/dateArray', function (rs) {
  108 + //日期tab
  109 + var tsStr = '';
  110 + $.each(rs, function (i) {
  111 + tsStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + '><a>' + this + '</a></li>';
  112 + });
  113 + $('.h-s-time', modal).html(tsStr);
  114 +
  115 + //线路tab
  116 + var xlStr = '';
  117 + $.each(gb_data_basic.activeLines, function (i) {
  118 + xlStr += '<li ' + (i == 0 ? 'class="uk-active"' : '') + ' data-id="' + this.lineCode + '"><a>' + this.name + '</a></li>';
  119 + });
  120 + $('.h-s-line', modal).html(xlStr);
  121 +
  122 +
  123 + jsQuery();
  124 + });
  125 + });
  126 +
  127 + $(modal).on('refresh', jsQuery);
  128 +
  129 + $(modal).on('click', '.h-s-time li,.h-s-line li', function () {
  130 + if(loading)
  131 + return;
  132 + $(this).parent().find('li.uk-active').removeClass('uk-active');
  133 + $(this).addClass('uk-active');
  134 + jsQuery();
  135 + });
  136 +
  137 + $('.search-form', modal).on('submit', function (e) {
  138 + try {
  139 + jsQuery();
  140 + }catch(e){
  141 + console.log(e);
  142 + }
  143 + return false;
  144 + });
  145 +
  146 + var nbbmArray=[],jsyArray=[],loading;
  147 + function jsQuery() {
  148 + var data = $('.search-form', modal).serializeJSON();
  149 + var rq = $('.h-s-time li.uk-active', modal).text(),
  150 + lineCode = $('.h-s-line li.uk-active', modal).data('id');
  151 + data.scheduleDateStr_eq = rq;
  152 + data.xlBm_eq = lineCode;
  153 + if(data.jGh_like.indexOf('/')!=-1){
  154 + var jsy=data.jGh_like.split('/');
  155 + data.jGh_like=jsy[0];
  156 + data.jName_like=jsy[1];
  157 + }
  158 +
  159 + $('.load-panel', modal).show();
  160 + loading=true;
  161 + $.get('/realSchedule/all', data, function (rs) {
  162 + rs.sort(schedule_sort);
  163 + var tbodyStr = template('history-sch-maintain-table-temp', {list: rs});
  164 + $('.history-sch-table .ct_table_body', modal).html(tbodyStr);
  165 +
  166 + //可搜索的车辆自编号和驾驶员
  167 + nbbmArray=[];
  168 + jsyArray=[];
  169 + $.each(rs, function () {
  170 + nbbmArray.push({value: this.clZbh});
  171 + jsyArray.push({value: this.jGh+'/'+this.jName,
  172 + fullChars: pinyin.getFullChars(this.jName).toUpperCase(),
  173 + camelChars: pinyin.getCamelChars(this.jName)});
  174 + });
  175 + //value
  176 + nbbmArray=distinctByField(nbbmArray);
  177 + jsyArray=distinctByField(jsyArray);
  178 + $('.load-panel', modal).hide();
  179 + loading=false;
  180 +
  181 + });
  182 + }
  183 +
  184 + //nbbm autocomplete
  185 + var carAutoCom=$('.autocomplete-cars', modal);
  186 + UIkit.autocomplete(carAutoCom, {
  187 + minLength: 1,
  188 + delay: 50,
  189 + source: function(release) {
  190 + var q = $('input', carAutoCom).val().toUpperCase()
  191 + ,rs = [],
  192 + count = 0;
  193 + $.each(nbbmArray, function () {
  194 + if(this.value.indexOf(q) != -1){
  195 + rs.push(this);
  196 + count++;
  197 + }
  198 + });
  199 + release && release(rs);
  200 + }
  201 + });
  202 +
  203 + //jsy autocomplete
  204 + var jsyAutoCom=$('.autocomplete-jsy', modal);
  205 + UIkit.autocomplete(jsyAutoCom, {
  206 + minLength: 1,
  207 + delay: 50,
  208 + source: function(release) {
  209 + var q = $('input', jsyAutoCom).val().toUpperCase()
  210 + ,rs = [],
  211 + count = 0;
  212 +
  213 + $.each(jsyArray, function() {
  214 + if (this.value.indexOf(q) != -1 || this.fullChars.indexOf(q) != -1 || this.camelChars.indexOf(q) != -1){
  215 + rs.push(this);
  216 + count++;
  217 + }
  218 +
  219 + if (count >= 10)
  220 + return false;
  221 + });
  222 + release && release(rs);
  223 + }
  224 + });
  225 +
  226 + function schedule_sort(s1, s2) {
  227 + return (s1.realExecDate+s1.dfsj).localeCompare(s2.realExecDate+s2.dfsj);
  228 + }
  229 +
  230 + function distinctByField(arr, f){
  231 + if(!f)
  232 + f = 'value';
  233 + var rs = {};
  234 + $.each(arr, function () {
  235 + rs[this[f]]=this;
  236 + });
  237 + return gb_common.get_vals(rs);
  238 + }
  239 +
  240 + gb_ct_table.fixedHead($('.ct_table_wrap', modal));
  241 +
  242 + //班次点击
  243 + $(modal).on('click contextmenu', '.history-sch-table .ct_table_body dl', function() {
  244 + $(this).parent().find('.active').removeClass('active');
  245 + $(this).addClass('active');
  246 + });
  247 +
  248 + var callbackHandler={
  249 + edit: function(id){
  250 + open_modal('/real_control_v2/fragments/north/nav/history_sch/edit.html', {id: id, parentModal: modal}, {center: false,bgclose: false, modal: false});
  251 + }
  252 + }
  253 +
  254 + //右键菜单
  255 + $.contextMenu({
  256 + selector: modal+' .history-sch-table .ct_table_body dl',
  257 + className: 'schedule-ct-menu',
  258 + callback: function(key, options) {
  259 + var id = $('.context-menu-active', modal).data('id');
  260 + callbackHandler[key] && callbackHandler[key](id);
  261 + },
  262 + items: {
  263 + 'edit': {
  264 + name: '编辑'
  265 + },
  266 + 'child_task':{
  267 + name: '子任务',
  268 + disabled: true
  269 + },
  270 + 'add': {
  271 + name: '新增',
  272 + disabled: true
  273 + },
  274 + 'delete':{
  275 + name: '删除',
  276 + disabled: true
  277 + }
  278 + }
  279 + });
  280 + })();
  281 + </script>
  282 +</div>
278 283 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -195,7 +195,7 @@ var gb_schedule_table = (function() {
195 195 }).on('mouseup', function() {
196 196 drag_strat = null;
197 197 }).on('mouseover', seq_nos, function() {
198   - if (drag_strat) {
  198 + if (drag_strat != null) {
199 199 var e = parseInt($(this).text()),
200 200 dls = $(this).parents('.ct_table_body').find('dl');
201 201  
... ... @@ -276,6 +276,8 @@ var gb_schedule_table = (function() {
276 276 cont.animate({
277 277 scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - diff
278 278 }, 500);
  279 +
  280 + return dl;
279 281 }
280 282  
281 283 var reset_drag_active_all = function(dd) {
... ... @@ -322,6 +324,8 @@ var gb_schedule_table = (function() {
322 324 insertSchedule: insertSchedule,
323 325 schedule_sort: schedule_sort,
324 326 calc_yfwf_num: calc_yfwf_num,
325   - car_yfwf_map: function(lineCode){return car_yfwf_map[lineCode];}
  327 + car_yfwf_map: function(lineCode){return car_yfwf_map[lineCode];},
  328 + scroToDl: scroToDl,
  329 + reset_drag_active_all: reset_drag_active_all
326 330 };
327 331 })();
... ...
src/main/resources/static/real_control_v2/js/main.js
  1 +//主调和监控模式
  2 +var operationMode = window.localStorage.getItem('operationMode');
  3 +if(operationMode == 0){
  4 + $('body>.north').addClass('monitor');
  5 + $(document).on('ajaxSend', interceptPOST);
  6 +}
  7 +else
  8 + $('body>.north').addClass('main');
  9 +
  10 +//拦截POST请求
  11 +function interceptPOST(e, xhr, t){
  12 + if(t && (t.method == 'POST' || t.type == 'POST')){
  13 + console.log(e, xhr, t);
  14 + xhr.abort();
  15 + notify_err('监控模式!');
  16 + }
  17 +}
  18 +
1 19 /* main js */
2 20 var gb_main_ep = new EventProxy(),
3 21 res_load_ep = EventProxy.create('load_data_basic', 'load_tab', 'load_home_layout', 'load_home_line_panel', function() {
... ... @@ -159,4 +177,4 @@ var open_modal = function(pageUrl, data, opt) {
159 177 if (data)
160 178 $(id).trigger('init', data);
161 179 });
162   -}
  180 +};
... ...
src/main/resources/static/real_control_v2/js/north/toolbar.js
... ... @@ -65,6 +65,9 @@ var gb_northToolbar = (function() {
65 65 },
66 66 history_sch_maintain: function () {
67 67 open_modal('/real_control_v2/fragments/north/nav/history_sch_maintain.html', {}, {center: false,bgclose: false});
  68 + },
  69 + sch_exec_rate: function () {
  70 + open_modal('/real_control_v2/fragments/north/nav/charts/sch_exec_rate.html', {}, modal_opts);
68 71 }
69 72 }
70 73 })();
... ...
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
... ... @@ -33,10 +33,9 @@ var gb_sch_websocket = (function () {
33 33  
34 34 //断开
35 35 schSock.onclose = function (e) {
36   - alert('和服务器连接断开....');
37   - console.log('和服务器连接断开....');
38   - regListen();
39   -
  36 + //alert('和服务器连接断开, code:' + e.code);
  37 + console.log('和服务器连接断开....', e);
  38 + $('body>.north').addClass('scok-colse');
40 39 };
41 40  
42 41  
... ... @@ -175,7 +174,13 @@ var gb_sch_websocket = (function () {
175 174  
176 175 //42消息点击
177 176 $(document).on('click', '.sys-mailbox .sys-note-42', function () {
178   - alert($(this).data('id'));
  177 + var lineCode=$(this).parents('li.line_schedule').data('id')
  178 + ,id=$(this).data('id');
  179 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  180 + var dl = gb_schedule_table.scroToDl(sch);
  181 + //高亮
  182 + gb_schedule_table.reset_drag_active_all(dl);
  183 + dl.addClass('relevance-active intimity');
179 184 });
180 185  
181 186 //80同意
... ...