Commit cfef8d72d5e378ca4f3498996b3f5136e1082a6c

Authored by 潘钊
1 parent a74f9f1b

懒得写备注

src/main/java/com/bsth/controller/UserController.java
... ... @@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
14 14 import org.springframework.web.servlet.ModelAndView;
15 15  
16 16 import com.bsth.entity.sys.SysUser;
  17 +import com.bsth.security.util.SecurityUtils;
17 18  
18 19 @RestController
19 20 @RequestMapping("user")
... ... @@ -58,4 +59,9 @@ public class UserController extends BaseController<SysUser, Integer>{
58 59 }
59 60 return new ModelAndView("/");
60 61 }
  62 +
  63 + @RequestMapping("/currentUser")
  64 + public SysUser currentUser(){
  65 + return SecurityUtils.getCurrentUser();
  66 + }
61 67 }
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -186,6 +186,18 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo,
186 186  
187 187 /**
188 188 *
  189 + * @Title: schInfoFineTune
  190 + * @Description: TODO(发车信息微调)
  191 + * @param @param map
  192 + * @throws
  193 + */
  194 + @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST)
  195 + public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){
  196 + return scheduleRealInfoService.schInfoFineTune(map);
  197 + }
  198 +
  199 + /**
  200 + *
189 201 * @Title: trustStatus @Description: TODO(线路托管状态) @param @param lineCodes
190 202 * 线路编码 @throws
191 203 */
... ...
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
... ... @@ -544,4 +544,49 @@ public class ScheduleRealInfo {
544 544 this.sflj = sflj;
545 545 }
546 546  
  547 + /**
  548 + *
  549 + * @Title: setFcsjAll
  550 + * @Description: TODO(设置计划发车时间)
  551 + * @throws
  552 + */
  553 + public void setFcsjAll(String fcsj){
  554 + try {
  555 + this.fcsjT = sdfyyyyMMddHHmm.parse(sdfyyyyMMdd.format(this.scheduleDate) + " " + fcsj).getTime();
  556 + this.fcsj = fcsj;
  557 + } catch (ParseException e) {
  558 + e.printStackTrace();
  559 + }
  560 + }
  561 +
  562 + /**
  563 + *
  564 + * @Title: setFcsjActualAll
  565 + * @Description: TODO(设置实际发车时间)
  566 + * @throws
  567 + */
  568 + public void setFcsjActualAll(String fcsjActual){
  569 + try {
  570 + this.fcsjActualTime = sdfyyyyMMddHHmm.parse(sdfyyyyMMdd.format(this.scheduleDate) + " " + fcsjActual).getTime();
  571 + this.fcsjActual = fcsjActual;
  572 + } catch (ParseException e) {
  573 + e.printStackTrace();
  574 + }
  575 + }
  576 +
  577 + /**
  578 + *
  579 + * @Title: setFcsjActualAll
  580 + * @Description: TODO(设置实际终点时间)
  581 + * @throws
  582 + */
  583 + public void setZdsjActualAll(String zdsjActual){
  584 + try {
  585 + this.zdsjActualTime = sdfyyyyMMddHHmm.parse(sdfyyyyMMdd.format(this.scheduleDate) + " " + zdsjActual).getTime();
  586 + this.zdsjActual = zdsjActual;
  587 + } catch (ParseException e) {
  588 + e.printStackTrace();
  589 + }
  590 + }
  591 +
547 592 }
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -76,4 +76,6 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
76 76  
77 77 Map<String, Object> spaceAdjust(Long[] ids, Integer space);
78 78  
  79 + Map<String, Object> schInfoFineTune(Map<String, String> map);
  80 +
79 81 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -241,7 +241,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
241 241 t.setScheduleDate(new Date());
242 242 t.setCreateBy(user);
243 243 t.syncTime();
244   -
  244 + t.setSflj(true);
245 245 Map<String, Object> map = super.save(t);
246 246  
247 247 // 加入缓存
... ... @@ -473,8 +473,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
473 473 // 按发车时间排序
474 474 Collections.sort(list, new ScheduleBuffer.ScheduleComparator());
475 475  
476   - // 以第一个待发时间为起点,调整间隔
477   - Long st = list.get(0).getDfsjT()
  476 + // 以第一个实际发车/待发时间为起点,调整间隔
  477 + sch = list.get(0);
  478 + Long st = sch.getFcsjActualTime()==null?sch.getDfsjT():sch.getFcsjActualTime()
478 479 ,plus = space * 60 * 1000L;
479 480  
480 481 for(int i = 1; i < size; i ++){
... ... @@ -495,4 +496,51 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
495 496 }
496 497 return rs;
497 498 }
  499 +
  500 + @Override
  501 + public Map<String, Object> schInfoFineTune(Map<String, String> map) {
  502 + Map<String, Object> rs = new HashMap<>();
  503 + try {
  504 + Long id = Long.parseLong(map.get("id"));
  505 + //班次类型
  506 + String bcType = map.get("bcType");
  507 + //车辆自编号
  508 + String clZbh = map.get("clZbh");
  509 + //计划发车时间
  510 + String fcsj = map.get("fcsj");
  511 + //实际发车时间
  512 + String fcsjActual = map.get("fcsjActual");
  513 + //驾驶员
  514 + String[] jsy = map.get("jsy").split("/");
  515 + //售票员
  516 + String[] spy = map.get("spy").split("/");
  517 + //实际终点时间
  518 + String zdsjActual = map.get("zdsjActual");
  519 + //备注
  520 + String remarks = map.get("remarks");
  521 +
  522 + ScheduleRealInfo sch = ScheduleBuffer.findOne(id);
  523 + if(null != sch){
  524 + sch.setBcType(bcType);
  525 + sch.setClZbh(clZbh);
  526 + sch.setFcsjAll(fcsj);
  527 + sch.setFcsjActualAll(fcsjActual);
  528 + sch.setZdsjActualAll(zdsjActual);
  529 + sch.setjGh(jsy[0]);
  530 + sch.setjName(jsy[1]);
  531 + sch.setsGh(spy[0]);
  532 + sch.setsName(spy[1]);
  533 + sch.setRemarks(remarks);
  534 + }
  535 +
  536 + ScheduleBuffer.persistentList.add(sch);
  537 +
  538 + rs.put("status", ResponseCode.SUCCESS);
  539 + rs.put("t", sch);
  540 + } catch (Exception e) {
  541 + logger.error("", e);
  542 + rs.put("status", ResponseCode.ERROR);
  543 + }
  544 + return rs;
  545 + }
498 546 }
... ...
src/main/java/com/bsth/vehicle/directive/service/DirectiveServiceImpl.java
... ... @@ -281,7 +281,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive60, Integer&gt;
281 281 }else{
282 282 logger.error("send60 upDownChange error, code: " + code);
283 283 }
284   - return 0;
  284 + return code;
285 285 }
286 286  
287 287 /**
... ...
src/main/java/com/bsth/vehicle/directive/util/HttpUtils.java
... ... @@ -2,6 +2,7 @@ package com.bsth.vehicle.directive.util;
2 2  
3 3 import java.io.IOException;
4 4  
  5 +import org.apache.http.client.config.RequestConfig;
5 6 import org.apache.http.client.methods.CloseableHttpResponse;
6 7 import org.apache.http.client.methods.HttpPost;
7 8 import org.apache.http.entity.StringEntity;
... ... @@ -34,8 +35,15 @@ public class HttpUtils {
34 35 try{
35 36 httpClient = HttpClients.createDefault();
36 37  
  38 + //超时时间
  39 + RequestConfig requestConfig = RequestConfig.custom()
  40 + .setConnectTimeout(3000).setConnectionRequestTimeout(1000)
  41 + .setSocketTimeout(3000).build();
  42 +
37 43 HttpPost post = new HttpPost(Consts.SEND_DIRECTIVE_URL);
38 44  
  45 + post.setConfig(requestConfig);
  46 +
39 47 post.setEntity(new StringEntity(jsonStr, "utf-8"));
40 48  
41 49 CloseableHttpResponse response = httpClient.execute(post);
... ...
src/main/resources/static/assets/img/logo_text.png 0 → 100644

14.7 KB

src/main/resources/static/assets/js/common.js
... ... @@ -114,7 +114,7 @@ function initPinYinSelect2(selector, data, cb){
114 114 })
115 115 });
116 116  
117   - cb && cb();
  117 + cb && cb($(selector));
118 118 });
119 119  
120 120 return $(selector);
... ...
src/main/resources/static/index.html
... ... @@ -108,6 +108,17 @@ tr.row-active td {
108 108 .page-content.active{
109 109 display: block !important;
110 110 }
  111 +
  112 +.page-header.navbar .page-logo {
  113 + width: 335px;
  114 +}
  115 +
  116 +.page-header.navbar .page-logo .logo-default {
  117 + margin: 0;
  118 +}
  119 +.page-header.navbar .top-menu .navbar-nav>li.dropdown.open .dropdown-toggle {
  120 + background-color: #284a99;
  121 +}
111 122 </style>
112 123  
113 124 <!-- ocLazyLoading载入文件的位置 -->
... ... @@ -115,28 +126,18 @@ tr.row-active td {
115 126  
116 127 </head>
117 128 <body class="page-container-bg-solid page-header-fixed page-sidebar-closed-hide-logo page-sidebar-fixed">
118   - <div class="page-header navbar navbar-fixed-top">
  129 + <div class="page-header navbar navbar-fixed-top" style="background: #23438e;">
119 130 <div class="page-header-inner ">
120 131 <!-- LOGO -->
121 132 <div class="page-logo">
122 133 <a href="index.html">
123   - <img src="" alt="logo" class="logo-default" /> </a>
  134 + <img src="/assets/img/logo_text.png" alt="logo" class="logo-default" /> </a>
124 135 <div class="menu-toggler sidebar-toggler">
125 136 </div>
126 137 </div>
127 138 <!-- END LOGO -->
128 139 <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse"> </a>
129 140 <div class="page-top">
130   - <form class="search-form" action="page_general_search_2.html" method="GET">
131   - <div class="input-group">
132   - <input type="text" class="form-control input-sm" placeholder="Search..." name="query">
133   - <span class="input-group-btn">
134   - <a href="javascript:;" class="btn submit">
135   - <i class="fa fa-search"></i>
136   - </a>
137   - </span>
138   - </div>
139   - </form>
140 141 <div class="top-menu">
141 142 <ul class="nav navbar-nav pull-right">
142 143 <!-- 信息通知区 -->
... ... @@ -158,7 +159,7 @@ tr.row-active td {
158 159 </li>
159 160 <li class="dropdown dropdown-user dropdown-dark">
160 161 <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
161   - <span class="username username-hide-on-mobile" style="vertical-align: middle;">潘钊 <i class="fa fa-user"></i></span>
  162 + <span id="indexTopUName" class="username username-hide-on-mobile" style="vertical-align: middle;"> <i class="fa fa-user"></i></span>
162 163 </a>
163 164 <ul class="dropdown-menu dropdown-menu-default">
164 165 <li>
... ... @@ -301,12 +302,12 @@ tr.row-active td {
301 302 <!-- angularJS相关库 -->
302 303 <!-- 这个是基于angularjs 1.4.10修改的版本,主要是修改了history控制部分,用于兼容route和pjax的同时操作history的冲突 -->
303 304 <script src="/assets/js/angular.js" data-autocephaly=1></script>
304   -<script src="/assets/bower_components/angular-resource/angular-resource.min.js" data-autocephaly=1></script>
305   -<script src="/assets/bower_components/angular-sanitize/angular-sanitize.min.js" data-autocephaly=1></script>
306   -<script src="/assets/bower_components/angular-touch/angular-touch.min.js" data-autocephaly=1></script>
307   -<script src="/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js" data-autocephaly=1></script>
308   -<script src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" data-autocephaly=1></script>
309   -<script src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" data-autocephaly=1></script>
  305 +<script src="/assets/bower_components/angular-resource/angular-resource.min.js" data-exclude=1></script>
  306 +<script src="/assets/bower_components/angular-sanitize/angular-sanitize.min.js" data-exclude=1></script>
  307 +<script src="/assets/bower_components/angular-touch/angular-touch.min.js" data-exclude=1></script>
  308 +<script src="/assets/bower_components/angular-ui-router/release/angular-ui-router.min.js" data-exclude=1></script>
  309 +<script src="/assets/bower_components/oclazyload/dist/ocLazyLoad.min.js" data-exclude=1></script>
  310 +<script src="/assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js" data-exclude=1></script>
310 311 <!-- schedule计划调度AngularJS模块主JS -->
311 312 <script src="/pages/scheduleApp/module/main.js" data-exclude=1></script>
312 313  
... ... @@ -320,6 +321,10 @@ var pjaxContainer = &#39;#pjax-container&#39;
320 321 ,angJsContainer = '#route-container';
321 322  
322 323 $(function(){
  324 + $.get('/user/currentUser', function(user){
  325 + $('#indexTopUName').text(user.userName);
  326 + });
  327 +
323 328 //带 data-pjax 的链接由pjax加载
324 329 $(document).pjax('a[data-pjax]', pjaxContainer);
325 330  
... ...
src/main/resources/static/pages/control/line/css/lineControl.css
  1 +.load-anim{
  2 + position: fixed;z-index: 9999999;width: 100%;height: 100%;
  3 + background: rgba(8, 47, 74, 0.89);top: 0;left: 0;
  4 +}
  5 +.load-anim .loader{
  6 + margin: auto !important;
  7 + position: absolute;
  8 + top: 0;
  9 + left: 0;
  10 + bottom: 0;
  11 + right: 0;
  12 +}
  13 +
  14 +
  15 +.load8 .loader {
  16 + font-size: 10px;
  17 + text-indent: -9999em;
  18 + border-top: 1.1em solid rgba(255, 255, 255, 0.2);
  19 + border-right: 1.1em solid rgba(255, 255, 255, 0.2);
  20 + border-bottom: 1.1em solid rgba(255, 255, 255, 0.2);
  21 + border-left: 1.1em solid #ffffff;
  22 + -webkit-animation: load8 1.1s infinite linear;
  23 + animation: load8 1.1s infinite linear;
  24 +}
  25 +.load8 .loader,
  26 +.load8 .loader:after {
  27 + border-radius: 50% !important;
  28 + width: 8em;
  29 + height: 8em;
  30 +}
  31 +@-webkit-keyframes load8 {
  32 + 0% {
  33 + -webkit-transform: rotate(0deg);
  34 + transform: rotate(0deg);
  35 + }
  36 + 100% {
  37 + -webkit-transform: rotate(360deg);
  38 + transform: rotate(360deg);
  39 + }
  40 +}
  41 +@keyframes load8 {
  42 + 0% {
  43 + -webkit-transform: rotate(0deg);
  44 + transform: rotate(0deg);
  45 + }
  46 + 100% {
  47 + -webkit-transform: rotate(360deg);
  48 + transform: rotate(360deg);
  49 + }
  50 +}
  51 +
  52 +
1 53 label {
2 54 max-width: none;
3 55 }
... ... @@ -220,7 +272,7 @@ body{
220 272 }
221 273  
222 274 .card_wrap{
223   - height: 268px;
  275 + min-height: 268px;
224 276 text-align: center;
225 277 }
226 278  
... ... @@ -425,7 +477,7 @@ body{
425 477  
426 478 .station_text{
427 479 writing-mode: tb;
428   - letter-spacing: -2.6px;
  480 + /* letter-spacing: -2.6px; */
429 481 }
430 482  
431 483 .station_text:hover{
... ... @@ -877,6 +929,10 @@ height: 400px;
877 929 .pb-table tr td:nth-child(9){
878 930 width: 55px;
879 931 }
  932 +
  933 + .station_text {
  934 + letter-spacing: -2.6px;
  935 + }
880 936 }
881 937  
882 938 .pb-table.head tr td{
... ... @@ -911,6 +967,14 @@ height: 400px;
911 967 .pb-table tr td:nth-child(8){
912 968 width: 15%;
913 969 }
  970 +
  971 + .card_wrap .col-lg-2 .table td{
  972 + font-size: 12px;
  973 + }
  974 +
  975 + .station_text {
  976 + letter-spacing: 1px;
  977 + }
914 978 }
915 979  
916 980 /** 1310px 以下 */
... ... @@ -946,6 +1010,9 @@ height: 400px;
946 1010  
947 1011 .table.pb-table>tbody>tr>td{
948 1012 line-height: 1.43257;
  1013 + white-space: nowrap;
  1014 + overflow: hidden;
  1015 + text-overflow: ellipsis;
949 1016 }
950 1017  
951 1018 .pic-panel{
... ... @@ -2094,4 +2161,29 @@ tr._tr_active.active-line-no .in-badge{
2094 2161  
2095 2162 tr._tr_active.active-line-no .out-badge{
2096 2163 background: #67a3a8;
2097   -}
2098 2164 \ No newline at end of file
  2165 +}
  2166 +
  2167 +.sfsj-sch-detail{
  2168 + list-style: none;
  2169 + padding: 3px;
  2170 + /* color: black; */
  2171 + font-family: 微软雅黑;
  2172 +}
  2173 +.sfsj-sch-detail li{
  2174 + font-size: 14px;
  2175 + margin: 6px 4px;
  2176 +}
  2177 +
  2178 +.sfsj-sch-detail li span{
  2179 + display: inline-block;
  2180 + width: 75px;
  2181 + text-align: right;
  2182 + /* color: #818181; */
  2183 +}
  2184 +
  2185 +.vehicDataTable a{
  2186 + text-decoration: underline;
  2187 + color: black;
  2188 +}
  2189 +
  2190 +
... ...
src/main/resources/static/pages/control/line/index.html
1 1 <link href="css/lineControl.css" rel="stylesheet" type="text/css" />
2 2 <link href="/metronic_v4.5.4/css/animate.min.css" rel="stylesheet" type="text/css" />
3 3  
  4 +<!-- 初始load动画 -->
  5 +<div class="load-anim load8" >
  6 +<div class="loader">Loading...</div>
  7 +</div>
  8 +
4 9 <div class="portlet light portlet-fullscreen" style="transition: all .5s ease;padding: 0;" oncontextmenu=self.event.returnValue=false>
  10 +
5 11 <div class="portlet-title" style="padding: 17px 20px 0px 20px;border-bottom: none;margin-bottom: 0;background: linear-gradient(to right ,#082F4A, #125688,#0a3f64);padding-bottom: 5px;">
6 12 <div class="caption col_hide_1280" style="color: #FFF;">
7 13 <i class="fa fa-life-ring" style="font-size: 22px;color: #FFF;"></i> <span
8   - class="caption-subject bold" style="font-size: 24px;">线路调度系统</span>
  14 + class="caption-subject bold" style="font-size: 24px;">闵行公交线路调度系统</span>
9 15 </div>
10 16 <div class="col_hide_1440" style="color: white;font-size: 18px;position: absolute;right: 25px;top: 75px;">
11   - panzhao,在线!
  17 + <span class="top_username"></span>,在线!
12 18 </div>
13 19 <div class="actions col_hide_1280" >
14 20 <div class="btn-group">
... ... @@ -84,6 +90,7 @@
84 90 </div>
85 91 <div id="tooltipShade" class="animated fadeIn"></div>
86 92  
  93 +<!-- 线路调度右键菜单 -->
87 94 <menu class="menu" id="rightMenu">
88 95 <li class="menu-item" >
89 96 <button type="button" class="menu-btn" data-method="outgoAdjust">
... ... @@ -122,6 +129,11 @@
122 129 <span class="menu-text">误点调整</span>
123 130 </button>
124 131 </li>
  132 + <li class="menu-item" >
  133 + <button type="button" class="menu-btn" data-method="schInfoFineTune">
  134 + <span class="menu-text">发车信息微调</span>
  135 + </button>
  136 + </li>
125 137 <li class="menu-separator"></li>
126 138 <li class="menu-item" >
127 139 <button type="button" class="menu-btn" data-method="childTask">
... ... @@ -137,13 +149,6 @@
137 149 </button>
138 150 </li>
139 151 <li class="menu-separator"></li>
140   -<!-- <li class="menu-item" >
141   - <button type="button" class="menu-btn" data-method="temporaryAdd">
142   - <i class="fa fa-plus"></i>
143   - <span class="menu-text">临加班次</span>
144   - </button>
145   - </li> -->
146   - <li class="menu-separator"></li>
147 152 <li class="menu-item" >
148 153 <button type="button" class="menu-btn" data-method="vehicAndPerAdjust">
149 154 <i class="fa fa-retweet"></i>
... ... @@ -158,6 +163,37 @@
158 163 </button>
159 164 </li>
160 165 </menu>
  166 +<!-- 主页右键菜单 -->
  167 +<menu class="menu" id="homeMenu">
  168 + <li class="menu-item disabled" id="menu-linename">
  169 + <button type="button" class="menu-btn">
  170 + <span class="menu-text">--- W2B-102 ---</span>
  171 + </button>
  172 + </li>
  173 + <li class="menu-item" >
  174 + <button type="button" class="menu-btn" data-method="sendPhrase">
  175 + <span class="menu-text">发送消息短语</span>
  176 + </button>
  177 + </li>
  178 + <li class="menu-separator"></li>
  179 + <li class="menu-item submenu">
  180 + <button type="button" class="menu-btn">
  181 + <span class="menu-text">车辆状态发送</span>
  182 + </button>
  183 + <menu class="menu">
  184 + <li class="menu-item">
  185 + <button type="button" class="menu-btn" data-method="changeUp">
  186 + <span class="menu-text">上行营运</span>
  187 + </button>
  188 + </li>
  189 + <li class="menu-item">
  190 + <button type="button" class="menu-btn" data-method="changeDown">
  191 + <span class="menu-text">下行营运</span>
  192 + </button>
  193 + </li>
  194 + </menu>
  195 + </li>
  196 +</menu>
161 197  
162 198 </div>
163 199 <div id="temps"></div>
... ... @@ -169,6 +205,7 @@
169 205 <script src="/pages/control/line/js/drawSvg.js"></script>
170 206 <script src="/pages/control/line/js/data.js"></script>
171 207 <script src="/pages/control/line/js/rightMenu.js"></script>
  208 +<script src="/pages/control/line/js/homeMenu.js"></script>
172 209 <script src="/pages/control/line/js/alone.js"></script>
173 210 <script src="/pages/control/line/js/main.js"></script>
174 211 <script src="/pages/control/line/js/console.js"></script>
... ... @@ -179,10 +216,16 @@ var lineCodes = &#39;&#39; //全部线路编码字符串,由data.js初始化
179 216 , lineMap = {} //编码和线路详细对照,由data.js初始化;
180 217 ,animationend = 'webkitAnimationEnd animationend';
181 218 moment.locale('zh-cn');
  219 +
  220 +var cUser;
  221 +//当前用户
  222 +$.get('/user/currentUser', function(user){
  223 + cUser = user;
  224 + $('.portlet-fullscreen .top_username').text(cUser.userName);
  225 +});
182 226 $(function() {
183 227 //加载模板文件
184 228 getTemp('temps/home_tp.html');
185   - getTemp('temps/home_table_tp.html');
186 229 getTemp('temps/tooltip_tp.html');
187 230 getTemp('temps/alone_tp.html');
188 231 getTemp('temps/child_task_case_tp.html');
... ...
src/main/resources/static/pages/control/line/js/alone.js
... ... @@ -98,11 +98,6 @@ var _alone = (function(){
98 98 calculateLineNo: calculateLineNo
99 99 }
100 100  
101   - //实发时间单元格事件
102   - $('.portlet-fullscreen').on('click', 'table.pb-table .sfsj-item', function(){
103   -
104   - });
105   -
106 101 //计算行号
107 102 function calculateLineNo(table){
108 103 var rows = table.rows;
... ... @@ -162,13 +157,22 @@ var _alone = (function(){
162 157 var tgTools = $('#tgTools_' + line);
163 158  
164 159 tgTools.html(tgHtml[status]).data('status', status);
  160 + var array = $('#top-tabs-wrap a[data-id='+line+'] span zz');
  161 +
165 162 if(status == 0){
166 163 //托管Question
167 164 $('.tgQuestion', tgTools).popover(tgPopoverOps);
168 165 tgTools.removeClass('hand');
  166 +
  167 + $(array[2]).text('托管');
169 168 }
170   - else
  169 + else{
171 170 tgTools.addClass('hand');
  171 + $(array[2]).text('');
  172 + }
  173 +
  174 + //tab 头改变
  175 +
172 176 }
173 177  
174 178 function initRemarksPop(){
... ...
src/main/resources/static/pages/control/line/js/drawSvg.js
... ... @@ -49,6 +49,10 @@ var drawSvg = (function(){
49 49 svg = drawSvgObject.init(lineId, data, container, w, 80);
50 50 //线路编码 和 首页SVG对照
51 51 homeSvgMapp[lineId] = svg;
  52 + //双击事件
  53 + $(svg[0]).dblclick(function(){
  54 + $('#top-tabs-wrap .nav-tabs a[data-id='+this.id+']').click();
  55 + });
52 56 },
53 57 initAloneSvg: function(lineId, data, container){
54 58 var w = $(document).width(),
... ... @@ -371,5 +375,8 @@ var drawSvg = (function(){
371 375 }
372 376 }
373 377  
  378 + //双击svg切换
  379 + //$('.line_chart svg').
  380 +
374 381 return drawSvgObject;
375 382 })();
... ...
src/main/resources/static/pages/control/line/js/homeMenu.js 0 → 100644
  1 +var _home_menu = (function(){
  2 +
  3 + $('#homeMenu .menu-item button').on('click', function(){
  4 + var method = $(this).data('method');
  5 + if(!method)return;
  6 + var nbbm = $('.vehicDataTable tr._home_tr_active').data('nbbm');
  7 +
  8 + if(!nbbm){
  9 + layer.alert('无法获取车辆自编号,请尝试刷新页面!', {icon: 2, title: '异常'});
  10 + return;
  11 + }
  12 + menuObject[method](nbbm);
  13 + });
  14 +
  15 + //右键事件
  16 + $('.portlet-fullscreen').on('contextmenu', '.vehicDataTable tr td', function(e){
  17 + e.preventDefault();
  18 + $('.vehicDataTable tr._home_tr_active').removeClass('_home_tr_active');
  19 + $(this).parent().addClass('_home_tr_active');
  20 + showMenu(e.pageX, e.pageY + 3);
  21 + $(document).one('click', function() {
  22 + $('#homeMenu').removeClass('show-menu');
  23 + });
  24 + });
  25 +
  26 +
  27 + function showMenu(x, y) {
  28 + var menu = $('#homeMenu'),
  29 + docWidth = $(document).width(), docHeight = $(document).height(),
  30 + menuHeight = menu.height(),
  31 + menuWidth = menu.width(),
  32 + offset = 12;
  33 + /* 边界 */
  34 + if (y > (docHeight - menuHeight)) {
  35 + y = docHeight - menuHeight - offset;
  36 + }
  37 +
  38 + if (x > (docWidth - (menuWidth * 2))) {
  39 + x = docWidth - (menuWidth * 2) - offset;
  40 + }
  41 +
  42 + menu.css('left', x + 'px')
  43 + .css('top', y + 'px')
  44 + .addClass('show-menu');
  45 + }
  46 +
  47 + var menuObject = {
  48 + //发送消息短语
  49 + sendPhrase: function(nbbm){
  50 + layer.prompt({title: '请输入短语信息', formType: 2 , shift: 5
  51 + }, function(space){
  52 + $.post('/directive/phrase', {nbbm: nbbm, text: space}, function(rs){
  53 + if(rs == 0)
  54 + layer.msg('发送成功!');
  55 + else
  56 + layer.alert('发送短语信息失败!', {icon: 2, title: '操作失败'});
  57 + });
  58 + });
  59 + },
  60 + //上行营运
  61 + changeUp: function(nbbm){
  62 + $.post('/directive/upDownChange', {nbbm: nbbm, upDown: 0}, function(rs){
  63 + if(rs == 0)
  64 + layer.msg('发送指令成功!');
  65 + else
  66 + layer.alert('发送指令失败!', {icon: 2, title: '操作失败'});
  67 + });
  68 + },
  69 + //下行营运
  70 + changeDown: function(nbbm){
  71 + $.post('/directive/upDownChange', {nbbm: nbbm, upDown: 1}, function(rs){
  72 + if(rs == 0)
  73 + layer.msg('发送指令成功!');
  74 + else
  75 + layer.alert('发送指令失败!', {icon: 2, title: '操作失败'});
  76 + });
  77 + }
  78 + }
  79 +})();
  80 +
... ...
src/main/resources/static/pages/control/line/js/keyboardListen.js
1 1 /** 键盘监听 */
2 2  
3 3 //禁止选中
4   -$(document).on('selectstart','table.pb-table', function(event){
  4 +$(document).on('selectstart','table.pb-table,svg', function(event){
5 5 event = window.event||event;
6 6 event.returnValue = false;
7 7 });
... ...
src/main/resources/static/pages/control/line/js/main.js
... ... @@ -36,6 +36,10 @@
36 36 var homeHtmlStr = template('line_control_home_temp', {tabList: tabData});
37 37  
38 38 $('#tab_home').html(homeHtmlStr);
  39 + //计算高度 40 页脚
  40 + var ah = $('#top-tabs-wrap .tab-content').height() - 40 - 5;
  41 + console.log(ah);
  42 + $('.card_wrap').css('height', ah / 3);
39 43  
40 44 //滚动条
41 45 $('.card_wrap .table_wrap').slimscroll({
... ... @@ -61,6 +65,7 @@
61 65  
62 66 //按线路分组
63 67 var listMap = groupByLine(addList);
  68 + console.log('listMap', listMap);
64 69 for(var key in listMap){
65 70 var htmlStr = template('home_table_temp', {list: listMap[key]});
66 71 $('#tab_' + key).find('tbody').html(htmlStr);
... ... @@ -69,16 +74,15 @@
69 74 }
70 75 });
71 76  
72   -
73 77 setTimeout(function(){
  78 + //打开GPS定时刷新
74 79 _data.startRefreshGpsTimer();
75   - }, 300);
76   - /* setTimeout(function(){
77   - homeObject.refreshGps(function(add, update){
78   - //将新增的点画到模拟图上
79   - drawSvg.drawVehicle(add);
80   - });
81   - }, 300);*/
  80 +
  81 + setTimeout(function(){
  82 + //去掉loading
  83 + $('.load-anim').fadeOut();
  84 + }, 500);
  85 + }, 400);
82 86  
83 87 }
84 88 }
... ... @@ -88,7 +92,7 @@ setTimeout(function(){
88 92 var topTabs = '', tabPanels = '';
89 93 $.each(_data.getLines(), function(i, line){
90 94 topTabs += '<li ><a data-id="'+line.lineCode+'" href="#tab_line_'+line.lineCode+'" data-toggle="tab" '+
91   - 'aria-expanded="false"> '+line.name+'<span>(0,0 托管)</span> </a></li>';
  95 + 'aria-expanded="false"> '+line.name+'<span>(<zz>0</zz>,<zz>0</zz> <zz>托管</zz>)</span> </a></li>';
92 96  
93 97 tabPanels += '<div class="tab-pane fade tab_line" data-id="'+line.lineCode+'" id="tab_line_'+line.lineCode+'"></div>';
94 98  
... ...
src/main/resources/static/pages/control/line/js/rightMenu.js
... ... @@ -87,6 +87,21 @@ var _menu = (function() {
87 87 return $(firstCell).addClass('selected').parent().addClass('_tr_active active-line-no');
88 88 }
89 89  
  90 + //实发时间单元格事件
  91 + var layerTip;
  92 + $('.portlet-fullscreen').on('click', 'table.pb-table .sfsj-item', function(){
  93 + var id = $(this).parent().data('id');
  94 + var sch = _data.getSchedulById(id);
  95 +
  96 + layerTip = layer.tips(template('sfsj_sch-detail-temp', sch), this, {
  97 + tips: [2, '#709d94'],shift:5, time: 5000
  98 + });
  99 + });
  100 +
  101 + $('.portlet-fullscreen').on('dbclick', 'table.pb-table .sfsj-item', function(){
  102 + alert(11);
  103 + });
  104 +
90 105 //选中关联班次
91 106 function selCognateSch($ctr){
92 107 //选中关联班次
... ... @@ -119,6 +134,10 @@ var _menu = (function() {
119 134 $('.pb-table tr td.' + ac).removeClass(ac);
120 135 $('.pb-table tr.selected').removeClass('selected');
121 136 $('.pb-table tr.next-sch').removeClass('next-sch');
  137 + if(layerTip){
  138 + layer.close(layerTip);
  139 + layerTip = null;
  140 + }
122 141 }
123 142 function resetAllState(){
124 143 $('.pb-table tr td.' + ac).removeClass(ac);
... ... @@ -128,6 +147,10 @@ var _menu = (function() {
128 147 $('.pb-table.data tr td.selected[name=lineNo]').removeClass('selected');
129 148  
130 149 prveSelRow = null;
  150 + if(layerTip){
  151 + layer.close(layerTip);
  152 + layerTip = null;
  153 + }
131 154 }
132 155  
133 156 //根据起止行号选中多行
... ... @@ -163,14 +186,34 @@ var _menu = (function() {
163 186 title: '待发调整',
164 187 success: function(){
165 188 dictionaryUtils.transformDom($('#outgoAdjustForm .nt-dictionary'));
  189 + //驾驶员
  190 + $.get('/realSchedule/driver', {lineCode: schedul.xlBm}, function(rs){
  191 + initPinYinSelect2('#outgoAdjustForm select[name=jsy]', rs, function(that){
  192 + //默认选中
  193 + that.val(schedul.jGh + '/' + schedul.jName).change();
  194 + });
  195 + });
  196 + //售票员
  197 + $.get('/realSchedule/conductor', {lineCode: schedul.xlBm}, function(rs){
  198 + initPinYinSelect2('#outgoAdjustForm select[name=spy]' , rs, function(that){
  199 + //默认选中
  200 + that.val(schedul.sGh + '/' + schedul.sName).change();
  201 + });
  202 + });
  203 + //车辆
  204 + $.get('/realSchedule/cars', {lineCode: schedul.xlBm}, function(rs){
  205 + $('#outgoAdjustForm select[name=clZbh]').select2({data: rs}).val(schedul.clZbh).change();
  206 + });
  207 +
166 208 $('#outgoAdjustForm button.confirm').one('click', function(){
  209 +
167 210 var params = $('#outgoAdjustForm').serializeJSON();
168 211 $post('/realSchedule/outgoAdjust', params, function(rs){
169 212 layer.close(index);
170   - layer.msg('调整成功!');
171 213 schedul.dfsj = rs.dfsj;
172 214 schedul.remarks = rs.remarks;
173 215 _alone.refreshSchedule(schedul);
  216 + layer.msg('调整成功!');
174 217 });
175 218 });
176 219 }
... ... @@ -413,6 +456,64 @@ var _menu = (function() {
413 456 layer.alert('发送调度指令失败', {icon: 2, title: '操作失败'});
414 457 });
415 458 });
  459 + },
  460 + //发车信息微调
  461 + schInfoFineTune: function(schedul){
  462 + var index = layer.open({
  463 + type: 1,
  464 + area: '630px',
  465 + maxmin: true,
  466 + content: template('schinfo_fine_tune_temp', schedul),
  467 + shift: 5,
  468 + title: '发车信息微调',
  469 + success: function(){
  470 + var ntds = $('#schinfoFineTune .nt-dictionary');
  471 + dictionaryUtils.transformDom(ntds);
  472 + //驾驶员
  473 + $.get('/realSchedule/driver', {lineCode: schedul.xlBm}, function(rs){
  474 + initPinYinSelect2('#schinfoFineTune select[name=jsy]', rs, function(that){
  475 + //默认选中
  476 + that.val(schedul.jGh + '/' + schedul.jName).change();
  477 + });
  478 +
  479 + });
  480 + //售票员
  481 + $.get('/realSchedule/conductor', {lineCode: schedul.xlBm}, function(rs){
  482 + initPinYinSelect2('#schinfoFineTune select[name=spy]' , rs, function(rs){
  483 + initPinYinSelect2('#outgoAdjustForm select[name=spy]' , rs, function(that){
  484 + //默认选中
  485 + that.val(schedul.sGh + '/' + schedul.sName).change();
  486 + });
  487 + });
  488 + });
  489 + //车辆
  490 + $.get('/realSchedule/cars', {lineCode: schedul.xlBm}, function(rs){
  491 + $('#schinfoFineTune select[name=clZbh]').select2({data: rs}).val(schedul.clZbh).change();
  492 + });
  493 +
  494 +
  495 + //调整说明
  496 + $('#schinfoFineTune select[name=reason]').on('change', function(){
  497 + var t = $(this).val();
  498 + if(!t) return;
  499 + var textarea = $('#schinfoFineTune textarea[name=remarks]');
  500 + textarea.val(textarea.val() + t + ',');
  501 + });
  502 + //确定
  503 + $('#schinfoFineTune button.confirm').on('click', function(){
  504 + var params = $('form#schinfoFineTune').serializeJSON();
  505 + if(!$.trim(params.fcsj)){
  506 + layer.msg('计发时间不能为空!');
  507 + return;
  508 + }
  509 + $post('/realSchedule/schInfoFineTune', params, function(rs){
  510 + layer.close(index);
  511 + if(rs.t)
  512 + _alone.refreshSchedule(rs.t);
  513 + });
  514 + });
  515 + }
  516 + });
416 517 }
417 518 }
418 519  
... ...
src/main/resources/static/pages/control/line/js/webSocketHandle.js
... ... @@ -8,7 +8,7 @@ setTimeout(function(){
8 8 $.post('/realSchedule/registerLine', {lineCodes: lineCodes}
9 9 ,function(rs){
10 10 if(rs == 0){
11   - layer.msg('注册线路成功!');
  11 + console.log('注册线路成功!');
12 12 initWebSocket();
13 13 }
14 14 });
... ...
src/main/resources/static/pages/control/line/temps/alone_tp.html
... ... @@ -212,7 +212,7 @@
212 212 <div class="form-custom-row">
213 213 <div class="item">
214 214 <span class="item-label" style="width: 80px;">班次类型:</span>
215   - <input class="form-control nt-dictionary" disabled data-code={{bcType}} data-group=ScheduleType>
  215 + <select class="form-control nt-dictionary" data-code={{bcType}} data-group=ScheduleType></select>
216 216 </div>
217 217 </div>
218 218 <div class="form-custom-row">
... ... @@ -236,7 +236,7 @@
236 236 <div class="form-custom-row">
237 237 <div class="item">
238 238 <span class="item-label" style="width: 80px;">车辆编码: </span>
239   - <input class="form-control" disabled value="{{clZbh}}" name="clZbh">
  239 + <select class="form-control" value="{{clZbh}}" name="clZbh"></select>
240 240 </div>
241 241 <div class="item">
242 242 <span class="item-label" style="width: 80px;">路&nbsp;牌: </span>
... ... @@ -258,11 +258,11 @@
258 258 <div class="form-custom-row">
259 259 <div class="item">
260 260 <span class="item-label" style="width: 80px;">驾驶员: </span>
261   - <input class="form-control" disabled value="{{jName}}" name="jName">
  261 + <select class="form-control" value="{{jName}}" name="jsy"></select>
262 262 </div>
263 263 <div class="item">
264 264 <span class="item-label" style="width: 80px;">售票员: </span>
265   - <input class="form-control" disabled value="{{sName}}" name="sName">
  265 + <select class="form-control" value="{{sName}}" name="spy"></select>
266 266 </div>
267 267 </div>
268 268 <hr>
... ... @@ -351,6 +351,105 @@
351 351 </form>
352 352 </script>
353 353  
  354 +<!-- 发车信息微调 -->
  355 +<script id="schinfo_fine_tune_temp" type="text/html">
  356 +<form action="#" class="form-horizontal form-custom" id="schinfoFineTune">
  357 + <input value={{id}} type="hidden" name="id">
  358 + <div class="form-body">
  359 + <div class="form-custom-row">
  360 + <div class="item">
  361 + <span class="item-label" style="width: 80px;">发车站点: </span>
  362 + <input class="form-control" disabled value="{{qdzName}}" name="qdzName">
  363 + </div>
  364 + <div class="item">
  365 + <span class="item-label" style="width: 80px;">结束站点: </span>
  366 + <input class="form-control" disabled value="{{zdzName}}" name="zdzName">
  367 + </div>
  368 + </div>
  369 +
  370 + <div class="form-custom-row">
  371 + <div class="item">
  372 + <span class="item-label" style="width: 80px;">车辆编码: </span>
  373 + <select class="form-control" value="{{clZbh}}" name="clZbh"></select>
  374 + </div>
  375 + <div class="item">
  376 + <span class="item-label" style="width: 80px;">路&nbsp;牌: </span>
  377 + <input class="form-control" disabled value="{{lpName}}" name="lpName">
  378 + </div>
  379 + </div>
  380 +
  381 + <div class="form-custom-row">
  382 + <div class="item">
  383 + <span class="item-label" style="width: 80px;">驾驶员: </span>
  384 + <select class="form-control" value="{{jName}}" name="jsy"></select>
  385 + </div>
  386 + <div class="item">
  387 + <span class="item-label" style="width: 80px;">售票员: </span>
  388 + <select class="form-control" value="{{sName}}" name="spy"></select>
  389 + </div>
  390 + </div>
  391 +
  392 + <div class="form-custom-row">
  393 + <div class="item">
  394 + <span class="item-label" style="width: 80px;">计发时刻: </span>
  395 + <input type="time" class="form-control" value="{{fcsj}}" name="fcsj">
  396 + </div>
  397 + <div class="item">
  398 + <span class="item-label" style="width: 80px;">实际时刻: </span>
  399 + <input type="time" class="form-control" value="{{fcsjActual}}" name="fcsjActual">
  400 + </div>
  401 + </div>
  402 +
  403 + <div class="form-custom-row">
  404 + <div class="item">
  405 + <span class="item-label" style="width: 80px;">到达时刻: </span>
  406 + <input type="time" class="form-control" value="{{zdsjActual}}" name="zdsjActual">
  407 + </div>
  408 + <div class="item">
  409 + <span class="item-label" style="width: 80px;">班次类型: </span>
  410 + <select type="text" class="form-control nt-dictionary" data-group="ScheduleType" data-code="{{bcType}}" name="bcType"></select>
  411 + </div>
  412 + </div>
  413 +
  414 + <div class="form-custom-row">
  415 + <div class="item full">
  416 + <span class="item-label" style="width: 80px;">调整说明: </span><br>
  417 + <select class="form-control" style="width: 100%;margin-top: 4px;" name="reason">
  418 + <option value="">请选择..</option>
  419 + <option value="配车">配车</option>
  420 + <option value="保养">保养</option>
  421 + <option value="故障">故障</option>
  422 + <option value="肇事">肇事</option>
  423 + <option value="路阻">路阻</option>
  424 + <option value="纠纷">纠纷</option>
  425 + <option value="缺人">缺人</option>
  426 + <option value="客稀">客稀</option>
  427 + <option value="缺车">缺车</option>
  428 + <option value="气候">气候</option>
  429 + <option value="援外">援外</option>
  430 + <option value="吊慢">吊慢</option>
  431 + <option value="抽减">抽减</option>
  432 + <option value="其他">其他</option>
  433 + </select>
  434 + </div>
  435 + </div>
  436 +
  437 + <div class="form-custom-row">
  438 + <div class="item full">
  439 + <textarea class="form-control" rows="4" placeholder="备注" name="remarks">{{remarks}}</textarea>
  440 + </div>
  441 + </div>
  442 +
  443 + <hr>
  444 + <div class="form-custom-footer">
  445 + <button type="button" class="btn blue-madison confirm"> <i class="fa fa-check"></i> &nbsp;&nbsp;确&nbsp;&nbsp;定 </button>
  446 + <button type="button" class="btn layui-layer-close"> 取消 </button>
  447 + </div>
  448 + </div>
  449 +</form>
  450 +<br>
  451 +</script>
  452 +
354 453 <script id="real_outgo_adjust_body_temp" type="text/html">
355 454 <form action="#" class="form-horizontal form-custom" id="realOutgoAdjust">
356 455 <input type="hidden" name="id" value={{id}}>
... ... @@ -396,4 +495,18 @@
396 495 <button type="button" class="btn layui-layer-close"> 取消 </button>
397 496 </div>
398 497 </form>
399   -</script>
400 498 \ No newline at end of file
  499 +</script>
  500 +
  501 +<script id="sfsj_sch-detail-temp" type="text/html">
  502 +<ul class="sfsj-sch-detail">
  503 + <li><span>路牌名:</span>{{lpName}}</li>
  504 + <li><span>车辆编码:</span>{{clZbh}}</li>
  505 + <li><span>计发时刻:</span>{{fcsj}}</li>
  506 + <li><span>实发时刻:</span>{{fcsjActual}}</li>
  507 + <li><span>计达时刻:</span>{{zdsj}}</li>
  508 + <li><span>实达时刻:</span>{{zdsjActual}}</li>
  509 + <li><span>驾驶员:</span>{{jName}}</li>
  510 + <li><span>售票员:</span>{{sName}}</li>
  511 + <li><span>终点站:</span>{{zdzName}}</li>
  512 +</ul>
  513 +</script>
... ...
src/main/resources/static/pages/control/line/temps/home_table_tp.html deleted 100644 → 0
1   -<script id="home_table_temp" type="text/html">
2   -{{each list as obj i}}
3   -<tr>
4   - <td style="width: 22%;"> {{obj.nbbm}} </td>
5   - <td style="width: 17%;">
6   - {{if obj.currSch != null}}
7   - {{obj.currSch.lpName}}
8   - {{else}}
9   - 无
10   - {{/if}}
11   - </td>
12   - <td style="width: 17%;"> {{obj.speed}} </td>
13   - <td style="width: 22%;" > 暂无 </td>
14   - <td style="width: 22%;" class="col_hide_1680">
15   -{{if obj.nextSch != null}}
16   - {{obj.nextSch.dfsj}}
17   -{{else}}
18   - 无
19   -{{/if}}
20   - </td>
21   -</tr>
22   -{{/each}}
23   -</script>
24 0 \ No newline at end of file
src/main/resources/static/pages/control/line/temps/home_tp.html
... ... @@ -43,7 +43,8 @@
43 43 <table
44 44 class="table table-striped table-bordered table-advance table-hover vehicDataTable"
45 45 style="table-layout: fixed;" id="tab_{{lineObj.lineCode}}_0">
46   - <tbody></tbody>
  46 + <tbody>
  47 + </tbody>
47 48 </table>
48 49 </div>
49 50 </div>
... ... @@ -118,6 +119,30 @@
118 119 </div>
119 120 </script>
120 121  
  122 +<script id="home_table_temp" type="text/html">
  123 +{{each list as obj i}}
  124 +<tr data-nbbm="{{obj.nbbm}}">
  125 + <td style="width: 22%;"> {{obj.nbbm}} </td>
  126 + <td style="width: 17%;">
  127 + {{if obj.currSch != null}}
  128 + {{obj.currSch.lpName}}
  129 + {{else}}
  130 + 无
  131 + {{/if}}
  132 + </td>
  133 + <td style="width: 17%;"> {{obj.speed}} </td>
  134 + <td style="width: 22%;" > 暂无 </td>
  135 + <td style="width: 22%;" class="col_hide_1680">
  136 +{{if obj.nextSch != null}}
  137 + {{obj.nextSch.dfsj}}
  138 +{{else}}
  139 + 无
  140 +{{/if}}
  141 + </td>
  142 +</tr>
  143 +{{/each}}
  144 +</script>
  145 +
121 146 <script id="ctrl_f_search_temp" type="text/html">
122 147 <div class="ctrl_f_search">
123 148 <select class="form-control pd90" id="ctrlFSearchSelect" ></select>
... ...