Commit df0fd2671ec81d8eaa9bfc68cc49a237bf7053c0

Authored by 潘钊
1 parent f1bd53e3

layer 2.2升级到2.4

Showing 61 changed files with 1939 additions and 665 deletions
src/main/java/com/bsth/StartCommand.java
... ... @@ -63,7 +63,7 @@ public class StartCommand implements CommandLineRunner{
63 63 * GPS实时数据更新 线程
64 64 * 每8秒和网关HTTP接口同步一次
65 65 */
66   - scheduler.scheduleWithFixedDelay(gpsRefreshThread, 0, 8, TimeUnit.SECONDS);
  66 + //scheduler.scheduleWithFixedDelay(gpsRefreshThread, 0, 8, TimeUnit.SECONDS);
67 67  
68 68 /**
69 69 * 每天 0点 抓取当天实际排班
... ... @@ -93,7 +93,7 @@ public class StartCommand implements CommandLineRunner{
93 93 * 每15秒从数据库抓取到离站信息和班次匹配
94 94 * (网关生成的到离站数据也是延迟批量入库,所以缩短该线程执行周期并不会提高 “实际到离站” 的实时性)
95 95 */
96   - //scheduler.scheduleWithFixedDelay(gpsArrivalStationThread, 5, 1200, TimeUnit.SECONDS);
  96 + //scheduler.scheduleWithFixedDelay(gpsArrivalStationThread, 35, 1200, TimeUnit.SECONDS);
97 97  
98 98 /**
99 99 * 首个调度指令下发(2分钟运行一次)
... ... @@ -106,7 +106,7 @@ public class StartCommand implements CommandLineRunner{
106 106 * 还车线程(2分钟运行一次)
107 107 * 将借出的车刷回原线路
108 108 */
109   - scheduler.scheduleWithFixedDelay(revertLineThread, 60 , 60 * 2 , TimeUnit.SECONDS);
  109 + //scheduler.scheduleWithFixedDelay(revertLineThread, 60 , 60 * 2 , TimeUnit.SECONDS);
110 110 } catch (Exception e) {
111 111 e.printStackTrace();
112 112 }
... ...
src/main/java/com/bsth/WebAppConfiguration.java
... ... @@ -15,7 +15,7 @@ import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry
15 15  
16 16 import com.bsth.filter.ResourceFilter;
17 17 import com.bsth.websocket.WebSocketHandshakeInterceptor;
18   -import com.bsth.websocket.handler.Directive80SocketHandler;
  18 +import com.bsth.websocket.handler.RealControlSocketHandler;
19 19  
20 20 @Configuration
21 21 @EnableWebSocket
... ... @@ -63,8 +63,8 @@ public class WebAppConfiguration extends WebMvcConfigurerAdapter implements WebS
63 63  
64 64 @Override
65 65 public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
66   - //驾驶员80指令上报
67   - registry.addHandler(new Directive80SocketHandler(), "/sockjs/directive80").addInterceptors(new WebSocketHandshakeInterceptor())
  66 + //线调webSocket
  67 + registry.addHandler(new RealControlSocketHandler(), "/sockjs/realcontrol").addInterceptors(new WebSocketHandshakeInterceptor())
68 68 .withSockJS();
69 69 }
70 70 }
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -20,188 +20,210 @@ import com.google.common.base.Splitter;
20 20  
21 21 @RestController
22 22 @RequestMapping("/realSchedule")
23   -public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long>{
  23 +public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> {
24 24  
25 25 @Autowired
26 26 ScheduleRealInfoService scheduleRealInfoService;
27   -
  27 +
28 28 @RequestMapping(value = "/lines")
29   - public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines){
  29 + public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) {
30 30 return scheduleRealInfoService.findByLines(lines);
31 31 }
32   -
  32 +
33 33 /**
34 34 *
35   - * @Title: registerLine
36   - * @Description: TODO(注册线路,后续才能收到数据推送)
37   - * @param @param lineCodes
38   - * @throws
  35 + * @Title: registerLine @Description: TODO(注册线路,后续才能收到数据推送) @param @param
  36 + * lineCodes @throws
39 37 */
40 38 @RequestMapping(value = "/registerLine", method = RequestMethod.POST)
41   - public int registerLine(@RequestParam String lineCodes){
  39 + public int registerLine(@RequestParam String lineCodes) {
42 40 List<String> list = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(lineCodes);
43 41 String userName = SecurityUtils.getCurrentUser().getUserName();
44   - //注销之前的绑定
45   - Collection<String> cs = CommonMapped.lineUserMap.values();
46   - for(String c : cs){
47   - if(c.equals(userName))
48   - cs.remove(c);
49   - }
50   - //重新绑定
51   - for(String line : list)
  42 + // 注销之前的绑定
  43 + for (String line : list)
  44 + CommonMapped.lineUserMap.get(Integer.parseInt(line)).remove(userName);
  45 + // 重新绑定
  46 + for (String line : list)
52 47 CommonMapped.lineUserMap.put(Integer.parseInt(line), userName);
53   -
  48 +
54 49 return 0;
55 50 }
56   -
  51 +
57 52 /**
58 53 *
59   - * @Title: outgoAdjust
60   - * @Description: TODO(待发调整)
61   - * @param @param id 主键
62   - * @param @param remarks 备注
63   - * @param @param dfsj 待发时间(HH:mm)
64   - * @throws
  54 + * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id
  55 + * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws
65 56 */
66 57 @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST)
67   - public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks,@RequestParam String dfsj){
  58 + public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks,
  59 + @RequestParam String dfsj) {
68 60 return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj);
69 61 }
70   -
  62 +
71 63 /**
72 64 *
73   - * @Title: destroy
74   - * @Description: TODO(销毁,烂班)
75   - * @param @param idsStr 要烂掉的班次ID ,分隔
76   - * @param @param spaceAdjust 自动调整后续间隔(1 是 -1 否)
77   - * @param @param remarks 备注
78   - * @param @param reason 理由
79   - * @param @param spaceNum 间隔(分钟)
80   - * @throws
  65 + * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID
  66 + * ,分隔 @param @param spaceAdjust 自动调整后续间隔(1 是 -1 否) @param @param remarks
  67 + * 备注 @param @param reason 理由 @param @param spaceNum 间隔(分钟) @throws
81 68 */
82 69 @RequestMapping(value = "/destroy", method = RequestMethod.POST)
83   - public Map<String, Object> destroy(@RequestParam String idsStr,@RequestParam int spaceAdjust,@RequestParam String remarks,@RequestParam String reason,@RequestParam int spaceNum){
  70 + public Map<String, Object> destroy(@RequestParam String idsStr, @RequestParam(defaultValue = "-1") int spaceAdjust,
  71 + @RequestParam String remarks, @RequestParam String reason, @RequestParam(defaultValue = "0") int spaceNum) {
84 72 return scheduleRealInfoService.destroy(idsStr, spaceAdjust, remarks, reason, spaceNum);
85 73 }
86   -
  74 +
87 75 /**
88 76 *
89   - * @Title: carDeviceMapp
90   - * @Description: TODO(获取车辆自编号和设备号对照,从缓存取)
91   - * @throws
  77 + * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws
92 78 */
93 79 @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET)
94   - public Map<String, String> carDeviceMapp(){
  80 + public Map<String, String> carDeviceMapp() {
95 81 return CommonMapped.vehicDeviceBiMap.inverse();
96 82 }
97   -
  83 +
98 84 /**
99 85 *
100   - * @Title: findPersionByLine
101   - * @Description: TODO(根据线路主键获取驾驶员)
102   - * @param @param lineId
103   - * @throws
  86 + * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param
  87 + * lineId @throws
104 88 */
105 89 @RequestMapping(value = "/driver", method = RequestMethod.GET)
106   - public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode){
  90 + public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) {
107 91 return scheduleRealInfoService.findDriverByLine(lineCode);
108 92 }
109   -
  93 +
110 94 /**
111 95 *
112   - * @Title: findPersionByLine
113   - * @Description: TODO(根据线路主键获取售票员)
114   - * @param @param lineId
115   - * @throws
  96 + * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param
  97 + * lineId @throws
116 98 */
117 99 @RequestMapping(value = "/conductor", method = RequestMethod.GET)
118   - public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode){
  100 + public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) {
119 101 return scheduleRealInfoService.findConductorByLine(lineCode);
120 102 }
121   -
  103 +
122 104 /**
123 105 *
124   - * @Title: findPersionByLine
125   - * @Description: TODO(根据线路主键获取车辆)
126   - * @param @param lineId
127   - * @throws
  106 + * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param
  107 + * lineId @throws
128 108 */
129 109 @RequestMapping(value = "/cars", method = RequestMethod.GET)
130   - public List<Map<String, String>> findCarByLine(@RequestParam String lineCode){
  110 + public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) {
131 111 return scheduleRealInfoService.findCarByLine(lineCode);
132 112 }
133   -
  113 +
134 114 /**
135 115 *
136   - * @Title: sreachNbbm
137   - * @Description: TODO(搜索车辆内部编码)
138   - * @throws
  116 + * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws
139 117 */
140 118 @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET)
141   - public List<Map<String, String>> sreachVehic(@RequestParam String nbbm){
  119 + public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) {
142 120 return scheduleRealInfoService.sreachVehic(nbbm);
143 121 }
144   -
  122 +
145 123 /**
146 124 *
147   - * @Title: adjust
148   - * @Description: TODO(调整人车)
149   - * @param @param id 班次ID
150   - * @param @param nbbm 内部编码
151   - * @param @param jsy 驾驶员
152   - * @param @param spy 售票员
153   - * @throws
  125 + * @Title: adjust @Description: TODO(调整人车) @param @param id
  126 + * 班次ID @param @param nbbm 内部编码 @param @param jsy 驾驶员 @param @param spy
  127 + * 售票员 @throws
154 128 */
155 129 @RequestMapping(value = "/adjust", method = RequestMethod.POST)
156   - public Map<String, Object> adjust(@RequestParam Long id
157   - , @RequestParam String nbbm
158   - , @RequestParam String jsy
159   - , @RequestParam String spy){
  130 + public Map<String, Object> adjust(@RequestParam Long id, @RequestParam String nbbm, @RequestParam String jsy,
  131 + @RequestParam String spy) {
160 132 return scheduleRealInfoService.adjust(id, nbbm, jsy, spy);
161 133 }
  134 +
  135 + /**
  136 + *
  137 + * @Title: realOutAdjust
  138 + * @Description: TODO(实发调整)
  139 + * @param @param id 班次ID
  140 + * @param @param fcsjActual 实际发车时间 HH:mm
  141 + * @param @param remarks 备注
  142 + * @throws
  143 + */
  144 + @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST)
  145 + public Map<String, Object> realOutAdjust(@RequestParam Long id, @RequestParam String fcsjActual,
  146 + @RequestParam String remarks) {
  147 + return scheduleRealInfoService.realOutAdjust(id, fcsjActual, remarks);
  148 + }
162 149  
163 150 /**
164 151 *
165   - * @Title: trustStatus
166   - * @Description: TODO(线路托管状态)
167   - * @param @param lineCodes 线路编码
  152 + * @Title: revokeDestroy
  153 + * @Description: TODO(撤销烂班)
  154 + * @param @param id
168 155 * @throws
169 156 */
170   - @RequestMapping(value = "/trustStatus")
171   - public Map<Integer, Integer> trustStatus(@RequestParam String lineCodes){
172   - return scheduleRealInfoService.trustStatus(lineCodes);
  157 + @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST)
  158 + public Map<String, Object> revokeDestroy(@RequestParam Long id){
  159 + return scheduleRealInfoService.revokeDestroy(id);
173 160 }
174 161  
175 162 /**
176 163 *
177   - * @Title: changeTrustStatus
178   - * @Description: TODO(切换线路托管状态)
179   - * @param @param lineCode 线路编码
180   - * @param @param status 托管状态
  164 + * @Title: revokeRealOutgo
  165 + * @Description: TODO(撤销实发)
  166 + * @param @param id
181 167 * @throws
182 168 */
  169 + @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST)
  170 + public Map<String, Object> revokeRealOutgo(@RequestParam Long id){
  171 + return scheduleRealInfoService.revokeRealOutgo(id);
  172 + }
  173 +
  174 + /**
  175 + *
  176 + * @Title: spaceAdjust
  177 + * @Description: TODO(间隔调整)
  178 + * @param @param ids 要调整的班次数组ID
  179 + * @param @param space 间隔
  180 + * @throws
  181 + */
  182 + @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST)
  183 + public Map<String, Object> spaceAdjust(Long[] ids, Integer space){
  184 + return scheduleRealInfoService.spaceAdjust(ids, space);
  185 + }
  186 +
  187 + /**
  188 + *
  189 + * @Title: trustStatus @Description: TODO(线路托管状态) @param @param lineCodes
  190 + * 线路编码 @throws
  191 + */
  192 + @RequestMapping(value = "/trustStatus")
  193 + public Map<Integer, Integer> trustStatus(@RequestParam String lineCodes) {
  194 + return scheduleRealInfoService.trustStatus(lineCodes);
  195 + }
  196 +
  197 + /**
  198 + *
  199 + * @Title: changeTrustStatus @Description: TODO(切换线路托管状态) @param @param
  200 + * lineCode 线路编码 @param @param status 托管状态 @throws
  201 + */
183 202 @RequestMapping(value = "/trustStatus/change", method = RequestMethod.POST)
184   - public int changeTrustStatus(@RequestParam Integer lineCode, @RequestParam Integer status){
  203 + public int changeTrustStatus(@RequestParam Integer lineCode, @RequestParam Integer status) {
185 204 ScheduleBuffer.trustMap.put(lineCode, status);
186 205 return 200;
187 206 }
188   -
189   - @RequestMapping(value="/queryUserInfo")
190   - public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line,@RequestParam String date){
  207 +
  208 + @RequestMapping(value = "/queryUserInfo")
  209 + public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, @RequestParam String date) {
191 210 return scheduleRealInfoService.queryUserInfo(line, date);
192 211 }
193   -
194   - @RequestMapping(value="/exportWaybill")
195   - public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName){
196   - return scheduleRealInfoService.exportWaybill(jName, clZbh,lpName);
  212 +
  213 + @RequestMapping(value = "/exportWaybill")
  214 + public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh,
  215 + @RequestParam String lpName) {
  216 + return scheduleRealInfoService.exportWaybill(jName, clZbh, lpName);
197 217 }
198   - @RequestMapping(value="/dailyInfo")
199   - public List<Map<String,Object>> dailyInfo(@RequestParam String line,@RequestParam String date){
  218 +
  219 + @RequestMapping(value = "/dailyInfo")
  220 + public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date) {
200 221 return scheduleRealInfoService.dailyInfo(line, date);
201 222 }
202   -
203   - @RequestMapping(value="/historyMessage")
204   - public List<ScheduleRealInfo> historyMessage(@RequestParam String line,@RequestParam String date,@RequestParam String code){
205   - return scheduleRealInfoService.historyMessage(line, date,code);
  223 +
  224 + @RequestMapping(value = "/historyMessage")
  225 + public List<ScheduleRealInfo> historyMessage(@RequestParam String line, @RequestParam String date,
  226 + @RequestParam String code) {
  227 + return scheduleRealInfoService.historyMessage(line, date, code);
206 228 }
207 229 }
... ...
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
... ... @@ -135,13 +135,19 @@ public class ScheduleRealInfo {
135 135 private Long dfsjT;
136 136  
137 137 /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */
138   - private Integer directiveState;
  138 + private Integer directiveState = -1;
  139 +
  140 + /** 起点站计划到达时间 */
  141 + private String qdzArrDateJH;
  142 +
  143 + /** 起点站实际到达时间 */
  144 + private String qdzArrDateSJ;
139 145  
140 146 public void addRemarks(String remark){
141 147 String newRem = this.getRemarks();
142 148 if(null == newRem)
143 149 newRem = "";
144   - newRem += remark;
  150 + newRem += remark + ";";
145 151 this.setRemarks(newRem);
146 152 }
147 153  
... ... @@ -465,10 +471,17 @@ public class ScheduleRealInfo {
465 471 this.dfsjT = dfsjT;
466 472 }
467 473  
  474 + public void setDfsjAll(Long dfsjT) {
  475 + this.dfsjT = dfsjT;
  476 + this.dfsj = sdfHHmm.format(new Date(this.dfsjT));
  477 + }
  478 +
468 479 @Transient
469 480 static SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd");
470 481 @Transient
471 482 static SimpleDateFormat sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  483 + @Transient
  484 + static SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH:mm");
472 485  
473 486 /**
474 487 * @throws ParseException
... ... @@ -503,4 +516,20 @@ public class ScheduleRealInfo {
503 516 public boolean equals(Object obj) {
504 517 return this.id.equals(((ScheduleRealInfo)obj).getId());
505 518 }
  519 +
  520 + public String getQdzArrDateJH() {
  521 + return qdzArrDateJH;
  522 + }
  523 +
  524 + public void setQdzArrDateJH(String qdzArrDateJH) {
  525 + this.qdzArrDateJH = qdzArrDateJH;
  526 + }
  527 +
  528 + public String getQdzArrDateSJ() {
  529 + return qdzArrDateSJ;
  530 + }
  531 +
  532 + public void setQdzArrDateSJ(String qdzArrDateSJ) {
  533 + this.qdzArrDateSJ = qdzArrDateSJ;
  534 + }
506 535 }
... ...
src/main/java/com/bsth/security/filter/LoginInterceptor.java
... ... @@ -18,6 +18,7 @@ import org.springframework.security.access.intercept.AbstractSecurityInterceptor
18 18 import org.springframework.security.core.Authentication;
19 19 import org.springframework.security.core.context.SecurityContextHolder;
20 20  
  21 +import com.alibaba.fastjson.JSON;
21 22 import com.bsth.common.Constants;
22 23 import com.bsth.common.ResponseCode;
23 24 import com.bsth.util.RequestUtils;
... ... @@ -52,7 +53,7 @@ public class LoginInterceptor extends AbstractSecurityInterceptor implements Fil
52 53 Map<String, Object> map = new HashMap<>();
53 54 map.put("status",
54 55 ResponseCode.NO_AUTHENTICATION);
55   - response.getWriter().print(map);
  56 + response.getWriter().print(JSON.toJSONString(map));
56 57 }
57 58 else
58 59 response.sendRedirect(Constants.LOGIN_PAGE);
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -68,4 +68,12 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
68 68  
69 69 Map<Integer, Integer> trustStatus(String lineCodes);
70 70  
  71 + Map<String, Object> realOutAdjust(Long id, String fcsjActual, String remarks);
  72 +
  73 + Map<String, Object> revokeDestroy(Long id);
  74 +
  75 + Map<String, Object> revokeRealOutgo(Long id);
  76 +
  77 + Map<String, Object> spaceAdjust(Long[] ids, Integer space);
  78 +
71 79 }
... ...
src/main/java/com/bsth/service/realcontrol/buffer/ScheduleBuffer.java
... ... @@ -6,6 +6,7 @@ import java.util.HashMap;
6 6 import java.util.LinkedList;
7 7 import java.util.List;
8 8 import java.util.Map;
  9 +import java.util.Set;
9 10  
10 11 import org.slf4j.Logger;
11 12 import org.slf4j.LoggerFactory;
... ... @@ -91,6 +92,11 @@ public class ScheduleBuffer {
91 92  
92 93 vehLinkedMap.get(zbh).add(schedul);
93 94 }
  95 +
  96 + //计算起点应到时间
  97 + Set<String> codes = schedulListMap.keySet();
  98 + for(String code : codes)
  99 + calcArrDateQd(code);
94 100 }catch(Exception e){
95 101 logger.error("缓存排班数据失败...", e);
96 102 return -1;
... ... @@ -125,7 +131,7 @@ public class ScheduleBuffer {
125 131 * @Title: finishSch
126 132 * @Description: TODO(完成一个班次)
127 133 * @param @param sch
128   - * @return ScheduleRealInfo 返回 下一个执行的班次
  134 + * @return ScheduleRealInfo 返回 下一个执行的班次
129 135 * @throws
130 136 */
131 137 public static ScheduleRealInfo finishSch(ScheduleRealInfo sch){
... ... @@ -144,8 +150,9 @@ public class ScheduleBuffer {
144 150 break;
145 151 }
146 152 }
147   -
148   - return list.getFirst();
  153 + ScheduleRealInfo next = list.getFirst();
  154 + next.setQdzArrDateSJ(sch.getZdsjActual());
  155 + return next;
149 156 }
150 157  
151 158 /**
... ... @@ -158,4 +165,46 @@ public class ScheduleBuffer {
158 165 public static int getFinishSchNo(String nbbm){
159 166 return finishLinkedMap.get(nbbm) == null ? 0 : finishLinkedMap.get(nbbm).size();
160 167 }
  168 +
  169 + /**
  170 + *
  171 + * @Title: calcArrDateQd
  172 + * @Description: TODO(计算计划起点时间)
  173 + * @throws
  174 + */
  175 + public static void calcArrDateQd(String lineCode){
  176 + List<ScheduleRealInfo> list = schedulListMap.get(lineCode);
  177 + //按车辆分组
  178 + ArrayListMultimap<String, ScheduleRealInfo> map = ArrayListMultimap.create();
  179 + for(ScheduleRealInfo sch : list){
  180 + map.put(sch.getClZbh(), sch);
  181 + }
  182 +
  183 + //链接班次
  184 + Set<String> set = map.keySet();
  185 + List<ScheduleRealInfo> subList;
  186 + int len;
  187 + ScheduleRealInfo prve, curr;
  188 + for(String k : set){
  189 + subList = map.get(k);
  190 + //排序
  191 + Collections.sort(subList, scheduleComparator);
  192 + len = subList.size();
  193 + if(len == 0)
  194 + continue;
  195 +
  196 + prve = subList.get(0);
  197 + for(int i = 1; i < len; i ++){
  198 + curr = subList.get(i);
  199 + if(prve.getZdzName().equals(curr.getQdzName()))
  200 + curr.setQdzArrDateJH(prve.getZdsj());
  201 +
  202 + prve = curr;
  203 + }
  204 + }
  205 + }
  206 +
  207 + public static ScheduleRealInfo findOne(Long id){
  208 + return pkSchedulMap.get(id);
  209 + }
161 210 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -4,6 +4,7 @@ import java.io.File;
4 4 import java.text.SimpleDateFormat;
5 5 import java.util.ArrayList;
6 6 import java.util.Collection;
  7 +import java.util.Collections;
7 8 import java.util.Date;
8 9 import java.util.HashMap;
9 10 import java.util.Iterator;
... ... @@ -40,30 +41,30 @@ import com.google.common.collect.Lists;
40 41 import com.google.common.collect.Multimap;
41 42  
42 43 @Service
43   -public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInfo, Long> implements ScheduleRealInfoService{
  44 +public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInfo, Long>
  45 + implements ScheduleRealInfoService {
44 46  
45 47 @Autowired
46 48 ScheduleRealInfoRepository scheduleRealInfoRepository;
47   -
  49 +
48 50 @Autowired
49 51 EmployeeConfigInfoRepository employeeConfigInfoRepository;
50   -
  52 +
51 53 @Autowired
52 54 CarConfigInfoRepository carConfigInfoRepository;
53   -
  55 +
54 56 Logger logger = LoggerFactory.getLogger(this.getClass());
55   -
56   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd")
57   - , sdfMinute = new SimpleDateFormat("yyyy-MM-dd HH:mm")
58   - , sdfShort = new SimpleDateFormat("HH:mm");
59   -
  57 +
  58 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  59 + sdfMinute = new SimpleDateFormat("yyyy-MM-dd HH:mm"), sdfShort = new SimpleDateFormat("HH:mm");
  60 +
60 61 @Override
61 62 public Map<String, Collection<ScheduleRealInfo>> findByLines(String lines) {
62 63 List<String> lineList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(lines));
63   -
  64 +
64 65 Multimap<String, ScheduleRealInfo> mMap = ArrayListMultimap.create();
65   -
66   - for(String lineCode : lineList){
  66 +
  67 + for (String lineCode : lineList) {
67 68 mMap.putAll(lineCode, ScheduleBuffer.schedulListMap.get(lineCode));
68 69 }
69 70 return mMap.asMap();
... ... @@ -72,19 +73,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
72 73 @Override
73 74 public Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj) {
74 75 Map<String, Object> map = new HashMap<>();
75   - try{
76   -
  76 + try {
  77 +
77 78 ScheduleRealInfo schedule = ScheduleBuffer.pkSchedulMap.get(id);
78 79 schedule.setDfsjT(sdfMinute.parse(sdfMonth.format(new Date()) + " " + dfsj).getTime());
79 80 schedule.setDfsj(dfsj);
80   - schedule.addRemarks("[待发调整] " + remarks +";");
81   - //持久化到数据库
  81 + schedule.addRemarks(remarks + ";");
  82 + // 持久化到数据库
82 83 ScheduleBuffer.persistentList.add(schedule);
83   -
  84 +
84 85 map.put("status", ResponseCode.SUCCESS);
85 86 map.put("dfsj", dfsj);
86 87 map.put("remarks", schedule.getRemarks());
87   - }catch(Exception e){
  88 + } catch (Exception e) {
88 89 logger.error("", e);
89 90 map.put("status", ResponseCode.ERROR);
90 91 }
... ... @@ -92,88 +93,88 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
92 93 }
93 94  
94 95 @Override
95   - public Map<String, Object> destroy(String idsStr, int spaceAdjust, String remarks, String reason, int spaceNum) {
96   -
  96 + public Map<String, Object> destroy(String idsStr, int spaceAdjust, String remarks, String reason, int spaceNum) {
  97 +
97 98 Map<String, Object> map = new HashMap<>();
98 99 List<ScheduleRealInfo> rsList = new ArrayList<>();
99 100 map.put("list", rsList);
100   - try{
  101 + try {
101 102 List<String> idList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(idsStr));
102   -
  103 +
103 104 ScheduleRealInfo schedule = null;
104   - for(String id : idList){
  105 + for (String id : idList) {
105 106 schedule = ScheduleBuffer.pkSchedulMap.get(Long.parseLong(id));
106   - if(null != schedule){
  107 + if (null != schedule) {
107 108 schedule.setStatus(-1);
108   - schedule.setRemarks("计划烂班["+reason+"] " + remarks);
109   -
  109 + schedule.addRemarks(remarks);
  110 +
110 111 rsList.add(schedule);
111 112 }
112 113 }
113   -
114   - //调整间隔
115   - if(spaceAdjust == 1){
116   -
  114 +
  115 + // 调整间隔
  116 + if (spaceAdjust == 1) {
  117 +
117 118 ScheduleRealInfo first = ScheduleBuffer.pkSchedulMap.get(Long.parseLong(idList.get(0)));
118 119 String lineCode = first.getXlBm();
119 120 String upDown = first.getXlDir();
120   -
121   - List<ScheduleRealInfo> schList = ScheduleBuffer.schedulListMap.get(lineCode)
122   - ,dirList = new ArrayList<>();
123   - //筛选走向
124   - for(ScheduleRealInfo s : schList){
125   - if(s.getXlDir().equals(upDown)){
  121 +
  122 + List<ScheduleRealInfo> schList = ScheduleBuffer.schedulListMap.get(lineCode),
  123 + dirList = new ArrayList<>();
  124 + // 筛选走向
  125 + for (ScheduleRealInfo s : schList) {
  126 + if (s.getXlDir().equals(upDown)) {
126 127 dirList.add(s);
127 128 }
128 129 }
129   -
  130 +
130 131 int size = dirList.size();
131 132 Long st = null;
132 133 int diff = spaceNum * 60 * 1000;
133   - for(int i = 0; i < size; i ++){
  134 + for (int i = 0; i < size; i++) {
134 135 schedule = dirList.get(i);
135   -
136   - if(schedule.getId() == first.getId()){
137   - if(i == 0)
  136 +
  137 + if (schedule.getId() == first.getId()) {
  138 + if (i == 0)
138 139 st = schedule.getDfsjT() - diff;
139 140 else
140 141 st = dirList.get(i - 1).getDfsjT();
141 142 continue;
142 143 }
143   - if(null == st || schedule.getStatus() == -1)
  144 + if (null == st || schedule.getStatus() == -1)
144 145 continue;
145   -
  146 +
146 147 st = st + diff;
147 148 schedule.setDfsjT(st);
148 149 schedule.setDfsj(sdfShort.format(new Date(st)));
149   -
  150 +
150 151 ScheduleBuffer.persistentList.add(schedule);
151   - //将调整的班次返回给页面
  152 + // 将调整的班次返回给页面
152 153 rsList.add(schedule);
153 154 }
154 155 }
155   -
  156 +
156 157 map.put("status", ResponseCode.SUCCESS);
157   - }catch(Exception e){
  158 + } catch (Exception e) {
158 159 logger.error("", e);
159 160 map.put("status", ResponseCode.ERROR);
160 161 }
161 162 return map;
162 163 }
163 164  
164   - //线路id获取驾驶员
  165 + // 线路id获取驾驶员
165 166 @Override
166 167 public List<Map<String, String>> findDriverByLine(String lineCode) {
167 168 List<EmployeeConfigInfo> list = employeeConfigInfoRepository.findBylineCode(lineCode);
168   -
  169 +
169 170 List<Map<String, String>> rsList = new ArrayList<>();
170 171 Map<String, String> map = null;
171 172 Personnel driver = null;
172 173 String code = null;
173   -
174   - for(EmployeeConfigInfo employee : list){
  174 +
  175 + for (EmployeeConfigInfo employee : list) {
175 176 driver = employee.getJsy();
176   - if(driver != null){
  177 + if (driver != null) {
177 178 map = new HashMap<>();
178 179 code = driver.getJobCode();
179 180 map.put("id", code + "/" + driver.getPersonnelName());
... ... @@ -184,19 +185,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
184 185 return rsList;
185 186 }
186 187  
187   - //线路id获取售票员
  188 + // 线路id获取售票员
188 189 @Override
189 190 public List<Map<String, String>> findConductorByLine(String lineCode) {
190 191 List<EmployeeConfigInfo> list = employeeConfigInfoRepository.findBylineCode(lineCode);
191   -
  192 +
192 193 List<Map<String, String>> rsList = new ArrayList<>();
193 194 Map<String, String> map = null;
194 195 Personnel conductor = null;
195 196 String code = null;
196   -
197   - for(EmployeeConfigInfo employee : list){
  197 +
  198 + for (EmployeeConfigInfo employee : list) {
198 199 conductor = employee.getSpy();
199   - if(conductor != null){
  200 + if (conductor != null) {
200 201 code = conductor.getJobCode();
201 202 map = new HashMap<>();
202 203 map.put("id", code + "/" + conductor.getPersonnelName());
... ... @@ -209,17 +210,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
209 210  
210 211 @Override
211 212 public List<Map<String, String>> findCarByLine(String lineCode) {
212   -
  213 +
213 214 List<CarConfigInfo> list = carConfigInfoRepository.findBylineCode(lineCode);
214   -
  215 +
215 216 List<Map<String, String>> rsList = new ArrayList<>();
216 217 Map<String, String> map = null;
217 218 Cars car = null;
218 219 String code = null;
219   -
220   - for(CarConfigInfo cci : list){
  220 +
  221 + for (CarConfigInfo cci : list) {
221 222 car = cci.getCl();
222   - if(car != null){
  223 + if (car != null) {
223 224 code = car.getInsideCode();
224 225 map = new HashMap<>();
225 226 map.put("id", code);
... ... @@ -236,44 +237,44 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
236 237 @Override
237 238 public Map<String, Object> save(ScheduleRealInfo t) {
238 239 SysUser user = SecurityUtils.getCurrentUser();
239   -
  240 +
240 241 t.setScheduleDate(new Date());
241 242 t.setCreateBy(user);
242 243 t.syncTime();
243   -
  244 +
244 245 Map<String, Object> map = super.save(t);
245   -
246   - //加入缓存
  246 +
  247 + // 加入缓存
247 248 ScheduleBuffer.put(t);
248 249 return map;
249 250 }
250 251  
251 252 @Override
252 253 public List<Map<String, String>> sreachVehic(String nbbm) {
253   - //转大写
  254 + // 转大写
254 255 nbbm = nbbm.toUpperCase();
255   -
  256 +
256 257 List<Map<String, String>> list = new ArrayList<>();
257 258 Map<String, String> map;
258 259 Set<String> allSet = CommonMapped.vehicCompanyMap.keySet();
259   -
  260 +
260 261 Line line;
261   - for(String k : allSet){
262   - if(k.indexOf(nbbm) != -1){
263   - //所属线路
  262 + for (String k : allSet) {
  263 + if (k.indexOf(nbbm) != -1) {
  264 + // 所属线路
264 265 map = new HashMap<>();
265 266 line = CommonMapped.vehicLineMap.get(k);
266 267 map.put("id", k);
267 268 map.put("text", k);
268   - if(null != line){
  269 + if (null != line) {
269 270 map.put("lineName", line.getName());
270 271 map.put("lineCode", line.getLineCode());
271 272 }
272   -
  273 +
273 274 list.add(map);
274 275 }
275   -
276   - if(list.size() > 20)
  276 +
  277 + if (list.size() > 20)
277 278 break;
278 279 }
279 280 return list;
... ... @@ -281,29 +282,29 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
281 282  
282 283 @Override
283 284 public Map<String, Object> adjust(Long id, String nbbm, String jsy, String spy) {
284   - //班次
  285 + // 班次
285 286 ScheduleRealInfo schedule = ScheduleBuffer.pkSchedulMap.get(id);
286   -
287   - //换车
288   - if(!StringUtils.isBlank(nbbm)){
  287 +
  288 + // 换车
  289 + if (!StringUtils.isBlank(nbbm)) {
289 290 adjustCar(schedule, nbbm);
290 291 }
291   -
  292 +
292 293 List<String> tempArray;
293   - //换驾驶员
294   - if(!StringUtils.isBlank(jsy)){
  294 + // 换驾驶员
  295 + if (!StringUtils.isBlank(jsy)) {
295 296 tempArray = Splitter.on("/").splitToList(jsy);
296 297 adjustDriver(schedule, tempArray.get(0), tempArray.get(1));
297 298 }
298   -
299   - //换售票员
300   - if(!StringUtils.isBlank(spy)){
  299 +
  300 + // 换售票员
  301 + if (!StringUtils.isBlank(spy)) {
301 302 tempArray = Splitter.on("/").splitToList(spy);
302 303 adjustConductor(schedule, tempArray.get(0), tempArray.get(1));
303 304 }
304   -
  305 +
305 306 ScheduleBuffer.persistentList.add(schedule);
306   -
  307 +
307 308 Map<String, Object> map = new HashMap<>();
308 309 map.put("status", 200);
309 310 map.put("t", schedule);
... ... @@ -326,7 +327,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
326 327 schedule.setsGh(conductor);
327 328 schedule.setsName(conductorName);
328 329 }
329   -
  330 +
330 331 @Override
331 332 public List<ScheduleRealInfo> queryUserInfo(String line, String date) {
332 333 // TODO Auto-generated method stub
... ... @@ -337,50 +338,161 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
337 338 public List<ScheduleRealInfo> exportWaybill(String jName, String clZbh, String lpName) {
338 339 ReportUtils ee = new ReportUtils();
339 340 List<Iterator<?>> list = new ArrayList<Iterator<?>>();
340   - List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.exportWaybill(jName,clZbh,lpName);
  341 + List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.exportWaybill(jName, clZbh, lpName);
341 342 ScheduleRealInfo scheduleRealInfo = scheduleRealInfoRepository.findOne(scheduleRealInfos.get(0).getId());
342   -
343   - File source =new File("D:\\export\\source");
344   - File target =new File("D:\\export\\target");
345   - if (!source .exists() && !source .isDirectory()){
  343 +
  344 + File source = new File("D:\\export\\source");
  345 + File target = new File("D:\\export\\target");
  346 + if (!source.exists() && !source.isDirectory()) {
346 347 source.mkdirs();
347 348 }
348   - if (!target .exists() && !target .isDirectory()){
  349 + if (!target.exists() && !target.isDirectory()) {
349 350 target.mkdirs();
350 351 }
351   -
  352 +
352 353 list.add(scheduleRealInfos.iterator());
353   - ee.excelReplace(list, new Object[]{scheduleRealInfo}, "D:\\export\\source\\waybill.xls",
354   - "D:\\export\\target\\"+jName+".xls");
  354 + ee.excelReplace(list, new Object[] { scheduleRealInfo }, "D:\\export\\source\\waybill.xls",
  355 + "D:\\export\\target\\" + jName + ".xls");
355 356 return scheduleRealInfos;
356 357 }
357 358  
358 359 @Override
359 360 public List<Map<String, Object>> dailyInfo(String line, String date) {
360 361 // TODO Auto-generated method stub
361   - return scheduleRealInfoRepository.dailyInfo(line,date);
  362 + return scheduleRealInfoRepository.dailyInfo(line, date);
362 363 }
363 364  
364 365 @Override
365   - public List<ScheduleRealInfo> historyMessage(String line, String date,
366   - String code) {
  366 + public List<ScheduleRealInfo> historyMessage(String line, String date, String code) {
367 367 // TODO Auto-generated method stub
368   - return scheduleRealInfoRepository.historyMessage(line, date,code+"%");
  368 + return scheduleRealInfoRepository.historyMessage(line, date, code + "%");
369 369 }
370 370  
371 371 @Override
372 372 public Map<Integer, Integer> trustStatus(String lineStr) {
373 373 List<String> lineList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(lineStr));
374   -
  374 +
375 375 Map<Integer, Integer> map = new HashMap<>();
376 376 Integer code;
377   - for(String lineCode : lineList){
  377 + for (String lineCode : lineList) {
378 378 code = Integer.parseInt(lineCode);
379   - if(!ScheduleBuffer.trustMap.containsKey(lineCode))
  379 + if (!ScheduleBuffer.trustMap.containsKey(lineCode))
380 380 ScheduleBuffer.trustMap.put(code, 0);
381   -
  381 +
382 382 map.put(code, ScheduleBuffer.trustMap.get(code));
383 383 }
384 384 return map;
385 385 }
  386 +
  387 + @Override
  388 + public Map<String, Object> realOutAdjust(Long id, String fcsjActual, String remarks) {
  389 + Map<String, Object> rs = new HashMap<>();
  390 + try {
  391 + ScheduleRealInfo sch = ScheduleBuffer.findOne(id);
  392 + String rq = sdfMonth.format(sch.getScheduleDate());
  393 +
  394 + sch.setFcsjActualTime(sdfMinute.parse(rq + " " + fcsjActual).getTime());
  395 + sch.setFcsjActual(fcsjActual);
  396 + sch.addRemarks(remarks);
  397 +
  398 + ScheduleBuffer.persistentList.add(sch);
  399 + rs.put("status", ResponseCode.SUCCESS);
  400 + rs.put("t", sch);
  401 + } catch (Exception e) {
  402 + logger.error("", e);
  403 + rs.put("status", ResponseCode.ERROR);
  404 + }
  405 +
  406 + return rs;
  407 + }
  408 +
  409 + @Override
  410 + public Map<String, Object> revokeDestroy(Long id) {
  411 + Map<String, Object> rs = new HashMap<>();
  412 + try {
  413 + ScheduleRealInfo sch = ScheduleBuffer.findOne(id);
  414 + if (sch.getStatus() != -1) {
  415 + rs.put("status", ResponseCode.ERROR);
  416 + rs.put("msg", "未烂班,无法撤销!");
  417 + } else {
  418 + sch.setStatus(0);
  419 + rs.put("status", ResponseCode.SUCCESS);
  420 + rs.put("t", sch);
  421 +
  422 + // 将班次状态还原,并由子线程去匹配到离站
  423 + }
  424 + } catch (Exception e) {
  425 + logger.error("", e);
  426 + rs.put("status", ResponseCode.ERROR);
  427 + }
  428 + return rs;
  429 + }
  430 +
  431 + @Override
  432 + public Map<String, Object> revokeRealOutgo(Long id) {
  433 + Map<String, Object> rs = new HashMap<>();
  434 + try {
  435 + ScheduleRealInfo sch = ScheduleBuffer.findOne(id);
  436 + if (sch.getFcsjActual() == null) {
  437 + rs.put("status", ResponseCode.ERROR);
  438 + rs.put("msg", "无实发时间,无法撤销!");
  439 + } else {
  440 + sch.setStatus(0);
  441 + sch.setFcsjActual("");
  442 + sch.setFcsjActualTime(0L);
  443 + rs.put("status", ResponseCode.SUCCESS);
  444 + rs.put("t", sch);
  445 +
  446 + // 将班次状态还原,并由子线程去匹配到离站
  447 + }
  448 + } catch (Exception e) {
  449 + logger.error("", e);
  450 + rs.put("status", ResponseCode.ERROR);
  451 + }
  452 + return rs;
  453 + }
  454 +
  455 + @Override
  456 + public Map<String, Object> spaceAdjust(Long[] ids, Integer space) {
  457 +
  458 + List<ScheduleRealInfo> list = new ArrayList<>();
  459 + Map<String, Object> rs = new HashMap<>();
  460 + try {
  461 + ScheduleRealInfo sch;
  462 + for (Long id : ids) {
  463 + sch = ScheduleBuffer.findOne(id);
  464 + if (null != sch)
  465 + list.add(sch);
  466 + }
  467 +
  468 + int size = list.size();
  469 + if(size == 0){
  470 + rs.put("status", ResponseCode.ERROR);
  471 + }
  472 + else{
  473 + // 按发车时间排序
  474 + Collections.sort(list, new ScheduleBuffer.ScheduleComparator());
  475 +
  476 + // 以第一个待发时间为起点,调整间隔
  477 + Long st = list.get(0).getDfsjT()
  478 + ,plus = space * 60 * 1000L;
  479 +
  480 + for(int i = 1; i < size; i ++){
  481 + st += plus;
  482 + sch = list.get(i);
  483 + sch.setDfsjAll(st);
  484 +
  485 + ScheduleBuffer.persistentList.add(sch);
  486 + }
  487 +
  488 + rs.put("status", ResponseCode.SUCCESS);
  489 + rs.put("list", list);
  490 + }
  491 +
  492 + } catch (Exception e) {
  493 + logger.error("", e);
  494 + rs.put("status", ResponseCode.ERROR);
  495 + }
  496 + return rs;
  497 + }
386 498 }
... ...
src/main/java/com/bsth/vehicle/UpstreamEntrance.java
... ... @@ -12,7 +12,7 @@ import com.alibaba.fastjson.JSON;
12 12 import com.alibaba.fastjson.JSONObject;
13 13 import com.bsth.vehicle.directive.buffer.DirectiveBuffer;
14 14 import com.bsth.vehicle.directive.entity.DirectiveReply;
15   -import com.bsth.vehicle.directive.entity.DriverReport;
  15 +import com.bsth.vehicle.directive.entity.Directive80;
16 16  
17 17 /**
18 18 *
... ... @@ -46,11 +46,13 @@ public class UpstreamEntrance {
46 46 logger.error("NumberFormatException ,,,,一般是老数据,msgId太大");
47 47 }
48 48 }
49   - //80协议,驾驶员上报
  49 + //80协议
50 50 else if(jsonParam.getInteger("operCode") == 0X80){
51 51 try{
52   - DriverReport report = JSON.toJavaObject(jsonParam, DriverReport.class);
53   - directiveBuffer.jsyReport(report);
  52 + Directive80 report = JSON.toJavaObject(jsonParam, Directive80.class);
  53 + //驾驶员上报
  54 + if(report.getData().getOperCode2() == 0x26)
  55 + directiveBuffer.jsyReport(report);
54 56 }catch(Exception e){
55 57 logger.error("", e);
56 58 }
... ...
src/main/java/com/bsth/vehicle/directive/MsgIdGenerator.java
... ... @@ -10,7 +10,7 @@ package com.bsth.vehicle.directive;
10 10 */
11 11 public class MsgIdGenerator {
12 12  
13   - private static int msgId = 0;
  13 + private static int msgId = 1;
14 14  
15 15 public synchronized static int getMsgId(){
16 16 msgId ++;
... ...
src/main/java/com/bsth/vehicle/directive/buffer/DirectiveBuffer.java
... ... @@ -3,22 +3,26 @@ package com.bsth.vehicle.directive.buffer;
3 3 import java.util.HashMap;
4 4 import java.util.LinkedList;
5 5 import java.util.Map;
6   -import java.util.Set;
7 6  
8 7 import org.slf4j.Logger;
9 8 import org.slf4j.LoggerFactory;
10 9 import org.springframework.beans.factory.annotation.Autowired;
11 10 import org.springframework.stereotype.Component;
12 11  
  12 +import com.alibaba.fastjson.JSON;
13 13 import com.alibaba.fastjson.JSONObject;
  14 +import com.bsth.service.realcontrol.buffer.ScheduleBuffer;
14 15 import com.bsth.vehicle.common.CommonMapped;
15   -import com.bsth.vehicle.directive.entity.Directive;
  16 +import com.bsth.vehicle.directive.entity.Directive60;
16 17 import com.bsth.vehicle.directive.entity.DirectiveReply;
17   -import com.bsth.vehicle.directive.entity.DriverReport;
  18 +import com.bsth.vehicle.directive.entity.Directive80;
  19 +import com.bsth.vehicle.directive.entity.DirectiveC0;
  20 +import com.bsth.vehicle.directive.entity.DirectiveC0.DirectiveC0Data;
18 21 import com.bsth.vehicle.directive.entity.LineChange;
19   -import com.bsth.vehicle.directive.repository.DriverReportRepository;
  22 +import com.bsth.vehicle.directive.repository.Directive80Repository;
20 23 import com.bsth.vehicle.directive.repository.LineChangeRepository;
21   -import com.bsth.websocket.handler.Directive80SocketHandler;
  24 +import com.bsth.vehicle.directive.util.HttpUtils;
  25 +import com.bsth.websocket.handler.RealControlSocketHandler;
22 26 import com.google.common.collect.ArrayListMultimap;
23 27 import com.google.common.collect.Multimap;
24 28  
... ... @@ -36,15 +40,16 @@ public class DirectiveBuffer {
36 40 Logger logger = LoggerFactory.getLogger(this.getClass());
37 41  
38 42 @Autowired
39   - DriverReportRepository driverReportRepository;
  43 + Directive80Repository d80Repository;
40 44  
41 45 @Autowired
42 46 LineChangeRepository lineChangeRepository;
43 47  
  48 +
44 49 /**
45 50 * 等待入库的调度指令
46 51 */
47   - public static LinkedList<Directive> transientList;
  52 + public static LinkedList<Directive60> transientList;
48 53  
49 54 /**
50 55 * 等待确认的线路切换指令
... ... @@ -54,16 +59,16 @@ public class DirectiveBuffer {
54 59 /**
55 60 * 当日调度指令缓存
56 61 */
57   - private static Map<Integer, Directive> directiveMap;
  62 + private static Map<Integer, Directive60> directiveMap;
58 63  
59 64 /**
60 65 * 驾驶员上报数据
61 66 * {K: 线路编码}
62 67 */
63   - private static Multimap<Integer, DriverReport> reportMultiMap;
  68 + private static Multimap<Integer, Directive80> reportMultiMap;
64 69  
65 70 @Autowired
66   - Directive80SocketHandler directive80SocketHandler;
  71 + RealControlSocketHandler socketHandler;
67 72  
68 73 static{
69 74 transientList = new LinkedList<>();
... ... @@ -72,7 +77,7 @@ public class DirectiveBuffer {
72 77 changeMap = new HashMap<>();
73 78 }
74 79  
75   - public static void put(Directive directive){
  80 + public static void put(Directive60 directive){
76 81 directiveMap.put(directive.getMsgId(), directive);
77 82 }
78 83  
... ... @@ -89,7 +94,7 @@ public class DirectiveBuffer {
89 94 return;
90 95 }
91 96  
92   - Directive directive = directiveMap.get(msgId);
  97 + Directive60 directive = directiveMap.get(msgId);
93 98  
94 99 if(null == directive){
95 100 //无效的响应
... ... @@ -153,15 +158,51 @@ public class DirectiveBuffer {
153 158 * @Description: TODO(80 驾驶员上报)
154 159 * @throws
155 160 */
156   - public void jsyReport(DriverReport report){
  161 + public void jsyReport(Directive80 report){
  162 + //将托管的线路自动处理掉
  163 + Integer lineCode = report.getData().getLineId();
  164 + Integer status = ScheduleBuffer.trustMap.get(lineCode);
  165 + //请求代码
  166 + Short requestCode = report.getData().getRequestCode();
  167 + //托管
  168 + if(null == status || status == 0){
  169 + //自动处理出场请求
  170 + if(requestCode == 0xA3){
  171 + DirectiveC0 c0 = createC0(report, (short)0x06);
  172 + HttpUtils.postJson(JSON.toJSONString(c0));
  173 + report.setC0(c0);
  174 + d80Repository.save(report);
  175 + }
  176 + }
  177 +
157 178 //实时入库
158   - driverReportRepository.save(report);
159   - reportMultiMap.put(report.getData().getLineId(), report);
  179 + d80Repository.save(report);
  180 + reportMultiMap.put(lineCode, report);
160 181 //推送到页面
161   - Set<String> users = CommonMapped.lineUserMap.get(report.getData().getLineId());
162   - if(users == null || users.size() == 0)
163   - return;
  182 + report.getData().setNbbm(CommonMapped.vehicDeviceBiMap.get(report.getDeviceId()));
  183 + JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(report));
  184 + json.put("fn", "report80");
  185 + socketHandler.sendMessageToLine(lineCode, json.toJSONString());
  186 + }
  187 +
  188 + /**
  189 + *
  190 + * @Title: createC0
  191 + * @Description: TODO(生成C0数据)
  192 + * @param @param ack
  193 + * @throws
  194 + */
  195 + public DirectiveC0 createC0(Directive80 report, short ack){
  196 + DirectiveC0 c0 = new DirectiveC0();
  197 + c0.setDeviceId(report.getDeviceId());
  198 + c0.setTimestamp(report.getTimestamp());
  199 + c0.setOperCode((short)0xC0);
  200 +
  201 + DirectiveC0Data data = new DirectiveC0Data();
  202 + data.setOperCode2((short)0x86);
  203 + data.setRequestAck(ack);
164 204  
165   - directive80SocketHandler.sendMessageToUser(users, JSONObject.toJSONString(report));
  205 + c0.setData(data);
  206 + return c0;
166 207 }
167 208 }
... ...
src/main/java/com/bsth/vehicle/directive/controller/DirectiveController.java
... ... @@ -36,6 +36,18 @@ public class DirectiveController {
36 36  
37 37 /**
38 38 *
  39 + * @Title: send60Dispatch
  40 + * @Description: TODO(班次信息下发)
  41 + * @param @param id
  42 + * @throws
  43 + */
  44 + @RequestMapping(value = "/dispatch", method = RequestMethod.POST)
  45 + public int send60Dispatch(@RequestParam Long id){
  46 + return directiveService.send60Dispatch(id);
  47 + }
  48 +
  49 + /**
  50 + *
39 51 * @Title: lineChange
40 52 * @Description: TODO(切换线路)
41 53 * @param @param nbbm 车辆内部编码
... ... @@ -46,4 +58,17 @@ public class DirectiveController {
46 58 public int lineChange(@RequestParam String nbbm, @RequestParam Integer lineId){
47 59 return directiveService.lineChange(nbbm, lineId);
48 60 }
  61 +
  62 + /**
  63 + *
  64 + * @Title: upDownChange
  65 + * @Description: TODO(上下行切换)
  66 + * @param @param nbbm 车辆内部编码
  67 + * @param @param upDon
  68 + * @throws
  69 + */
  70 + @RequestMapping(value = "/upDownChange", method = RequestMethod.POST)
  71 + public int upDownChange(@RequestParam String nbbm, @RequestParam Integer upDown){
  72 + return directiveService.upDownChange(nbbm, upDown);
  73 + }
49 74 }
... ...
src/main/java/com/bsth/vehicle/directive/entity/Directive.java renamed to src/main/java/com/bsth/vehicle/directive/entity/Directive60.java
... ... @@ -21,7 +21,7 @@ import com.bsth.entity.realcontrol.ScheduleRealInfo;
21 21 */
22 22 @Entity
23 23 @Table(name = "bsth_v_directive_60")
24   -public class Directive {
  24 +public class Directive60 {
25 25  
26 26 @Id
27 27 @GeneratedValue
... ... @@ -99,7 +99,7 @@ public class Directive {
99 99 * 0x03表示运营状态指令(闹钟无效)
100 100 * 0x04表示其他指令
101 101 */
102   - private DispatchInstruct dispatchInstruct;
  102 + private Short dispatchInstruct;
103 103  
104 104 // 唯一标识
105 105 private int msgId;
... ... @@ -145,11 +145,11 @@ public class Directive {
145 145 this.instructType = instructType;
146 146 }
147 147  
148   - public DispatchInstruct getDispatchInstruct() {
  148 + public Short getDispatchInstruct() {
149 149 return dispatchInstruct;
150 150 }
151 151  
152   - public void setDispatchInstruct(DispatchInstruct dispatchInstruct) {
  152 + public void setDispatchInstruct(Short dispatchInstruct) {
153 153 this.dispatchInstruct = dispatchInstruct;
154 154 }
155 155  
... ...
src/main/java/com/bsth/vehicle/directive/entity/DriverReport.java renamed to src/main/java/com/bsth/vehicle/directive/entity/Directive80.java
... ... @@ -4,7 +4,12 @@ import javax.persistence.Embeddable;
4 4 import javax.persistence.Entity;
5 5 import javax.persistence.GeneratedValue;
6 6 import javax.persistence.Id;
  7 +import javax.persistence.NamedAttributeNode;
  8 +import javax.persistence.NamedEntityGraph;
  9 +import javax.persistence.NamedEntityGraphs;
  10 +import javax.persistence.OneToOne;
7 11 import javax.persistence.Table;
  12 +import javax.persistence.Transient;
8 13  
9 14 /**
10 15 *
... ... @@ -16,7 +21,12 @@ import javax.persistence.Table;
16 21 */
17 22 @Entity
18 23 @Table(name = "bsth_v_report_80")
19   -public class DriverReport {
  24 +@NamedEntityGraphs({
  25 + @NamedEntityGraph(name = "directive80_c0", attributeNodes = {
  26 + @NamedAttributeNode("c0")
  27 + })
  28 +})
  29 +public class Directive80 {
20 30  
21 31 @Id
22 32 @GeneratedValue
... ... @@ -33,15 +43,24 @@ public class DriverReport {
33 43 private Long timestamp;
34 44  
35 45 /**
36   - * 一级协议
  46 + * 一级协议 0xC0
37 47 */
38 48 private Short operCode;
39 49  
40 50 private DriverReportData data;
  51 +
  52 + /**
  53 + * c0 回复
  54 + */
  55 + @OneToOne
  56 + private DirectiveC0 c0;
41 57  
42 58 @Embeddable
43 59 public static class DriverReportData {
44 60  
  61 + /**
  62 + * 0x86
  63 + */
45 64 private Short operCode2;
46 65  
47 66 /**
... ... @@ -54,7 +73,13 @@ public class DriverReport {
54 73 * 线路编码
55 74 */
56 75 private Integer lineId;
57   -
  76 +
  77 + /**
  78 + * 车辆内部编码
  79 + */
  80 + @Transient
  81 + private String nbbm;
  82 +
58 83 public Short getOperCode2() {
59 84 return operCode2;
60 85 }
... ... @@ -78,6 +103,14 @@ public class DriverReport {
78 103 public void setLineId(Integer lineId) {
79 104 this.lineId = lineId;
80 105 }
  106 +
  107 + public String getNbbm() {
  108 + return nbbm;
  109 + }
  110 +
  111 + public void setNbbm(String nbbm) {
  112 + this.nbbm = nbbm;
  113 + }
81 114 }
82 115  
83 116 public Integer getId() {
... ... @@ -119,4 +152,12 @@ public class DriverReport {
119 152 public void setData(DriverReportData data) {
120 153 this.data = data;
121 154 }
  155 +
  156 + public DirectiveC0 getC0() {
  157 + return c0;
  158 + }
  159 +
  160 + public void setC0(DirectiveC0 c0) {
  161 + this.c0 = c0;
  162 + }
122 163 }
... ...
src/main/java/com/bsth/vehicle/directive/entity/DirectiveC0.java 0 → 100644
  1 +package com.bsth.vehicle.directive.entity;
  2 +
  3 +import javax.persistence.Embeddable;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.GeneratedValue;
  6 +import javax.persistence.Id;
  7 +import javax.persistence.OneToOne;
  8 +import javax.persistence.Table;
  9 +
  10 +/**
  11 + *
  12 + * @ClassName: DirectiveC0
  13 + * @Description: TODO(C0协议,回复驾驶员上报)
  14 + * @author PanZhao
  15 + * @date 2016年7月8日 上午10:19:23
  16 + *
  17 + */
  18 +@Entity
  19 +@Table(name = "bsth_v_C0")
  20 +public class DirectiveC0 {
  21 +
  22 + @Id
  23 + @GeneratedValue
  24 + private Integer id;
  25 +
  26 + /**
  27 + * 设备号
  28 + */
  29 + private String deviceId;
  30 +
  31 + /**
  32 + * 时间戳
  33 + */
  34 + private Long timestamp;
  35 +
  36 + /**
  37 + * 一级协议
  38 + */
  39 + private Short operCode;
  40 +
  41 + private DirectiveC0Data data;
  42 +
  43 + @Embeddable
  44 + public static class DirectiveC0Data {
  45 +
  46 + /**
  47 + * 二级协议
  48 + */
  49 + private Short operCode2;
  50 +
  51 + /**
  52 + * 请求应答字 0x06同意 0x15不同意
  53 + */
  54 + private Short requestAck;
  55 +
  56 + public Short getOperCode2() {
  57 + return operCode2;
  58 + }
  59 +
  60 + public void setOperCode2(Short operCode2) {
  61 + this.operCode2 = operCode2;
  62 + }
  63 +
  64 + public Short getRequestAck() {
  65 + return requestAck;
  66 + }
  67 +
  68 + public void setRequestAck(Short requestAck) {
  69 + this.requestAck = requestAck;
  70 + }
  71 + }
  72 +
  73 + public Integer getId() {
  74 + return id;
  75 + }
  76 +
  77 + public void setId(Integer id) {
  78 + this.id = id;
  79 + }
  80 +
  81 + public String getDeviceId() {
  82 + return deviceId;
  83 + }
  84 +
  85 + public void setDeviceId(String deviceId) {
  86 + this.deviceId = deviceId;
  87 + }
  88 +
  89 + public Long getTimestamp() {
  90 + return timestamp;
  91 + }
  92 +
  93 + public void setTimestamp(Long timestamp) {
  94 + this.timestamp = timestamp;
  95 + }
  96 +
  97 + public Short getOperCode() {
  98 + return operCode;
  99 + }
  100 +
  101 + public void setOperCode(Short operCode) {
  102 + this.operCode = operCode;
  103 + }
  104 +
  105 + public DirectiveC0Data getData() {
  106 + return data;
  107 + }
  108 +
  109 + public void setData(DirectiveC0Data data) {
  110 + this.data = data;
  111 + }
  112 +}
... ...
src/main/java/com/bsth/vehicle/directive/entity/DispatchInstruct.java deleted 100644 → 0
1   -package com.bsth.vehicle.directive.entity;
2   -
3   -/**
4   - *
5   - * @ClassName: DispatchInstruct
6   - * @Description: TODO(调度指令类型)
7   - * @author PanZhao
8   - * @date 2016年6月7日 下午2:15:10
9   - *
10   - */
11   -public enum DispatchInstruct {
12   - /**
13   - * 信息短语
14   - */
15   - PHRASE((byte) 0x00),
16   -
17   - /**
18   - * 取消上次指令+调度指令(闹钟有效)
19   - */
20   - CANCEL_AND_CLOCK_ON((byte) 0x01),
21   -
22   - /**
23   - * 调度指令(闹钟有效)
24   - */
25   - DISPATCH_CLOCK_ON((byte) 0x02),
26   -
27   - /**
28   - * 运营状态指令(闹钟无效)
29   - */
30   - OPERATE_CLOCK_OFF((byte) 0x03),
31   -
32   - /**
33   - * 其他
34   - */
35   - OTHER((byte) 0x04);
36   -
37   - private final byte value;
38   -
39   - DispatchInstruct(byte value) {
40   - this.value = value;
41   - }
42   -
43   - public byte getValue() {
44   - return value;
45   - }
46   -}
src/main/java/com/bsth/vehicle/directive/repository/DirectiveRepository.java renamed to src/main/java/com/bsth/vehicle/directive/repository/Directive60Repository.java
... ... @@ -3,9 +3,9 @@ package com.bsth.vehicle.directive.repository;
3 3 import org.springframework.stereotype.Repository;
4 4  
5 5 import com.bsth.repository.BaseRepository;
6   -import com.bsth.vehicle.directive.entity.Directive;
  6 +import com.bsth.vehicle.directive.entity.Directive60;
7 7  
8 8 @Repository
9   -public interface DirectiveRepository extends BaseRepository<Directive, Integer>{
  9 +public interface Directive60Repository extends BaseRepository<Directive60, Integer>{
10 10  
11 11 }
... ...
src/main/java/com/bsth/vehicle/directive/repository/Directive80Repository.java 0 → 100644
  1 +package com.bsth.vehicle.directive.repository;
  2 +
  3 +import org.springframework.data.domain.Page;
  4 +import org.springframework.data.domain.Pageable;
  5 +import org.springframework.data.jpa.domain.Specification;
  6 +import org.springframework.data.jpa.repository.EntityGraph;
  7 +import org.springframework.stereotype.Repository;
  8 +
  9 +import com.bsth.repository.BaseRepository;
  10 +import com.bsth.vehicle.directive.entity.Directive80;
  11 +
  12 +@Repository
  13 +public interface Directive80Repository extends BaseRepository<Directive80, Integer>{
  14 +
  15 + @EntityGraph(value = "directive80_c0", type = EntityGraph.EntityGraphType.FETCH)
  16 + @Override
  17 + Page<Directive80> findAll(Specification<Directive80> spec, Pageable pageable);
  18 +}
... ...
src/main/java/com/bsth/vehicle/directive/repository/DriverReportRepository.java renamed to src/main/java/com/bsth/vehicle/directive/repository/DirectiveC0Repository.java
... ... @@ -3,9 +3,9 @@ package com.bsth.vehicle.directive.repository;
3 3 import org.springframework.stereotype.Repository;
4 4  
5 5 import com.bsth.repository.BaseRepository;
6   -import com.bsth.vehicle.directive.entity.DriverReport;
  6 +import com.bsth.vehicle.directive.entity.DirectiveC0;
7 7  
8 8 @Repository
9   -public interface DriverReportRepository extends BaseRepository<DriverReport, Integer>{
  9 +public interface DirectiveC0Repository extends BaseRepository<DirectiveC0, Integer>{
10 10  
11 11 }
... ...
src/main/java/com/bsth/vehicle/directive/service/DirectiveService.java
... ... @@ -3,9 +3,9 @@ package com.bsth.vehicle.directive.service;
3 3  
4 4 import com.bsth.entity.realcontrol.ScheduleRealInfo;
5 5 import com.bsth.service.BaseService;
6   -import com.bsth.vehicle.directive.entity.Directive;
  6 +import com.bsth.vehicle.directive.entity.Directive60;
7 7  
8   -public interface DirectiveService extends BaseService<Directive, Integer>{
  8 +public interface DirectiveService extends BaseService<Directive60, Integer>{
9 9  
10 10 /**
11 11 *
... ... @@ -28,6 +28,15 @@ public interface DirectiveService extends BaseService&lt;Directive, Integer&gt;{
28 28 */
29 29 int send60Dispatch(ScheduleRealInfo sch, int finish);
30 30  
  31 + /**
  32 + *
  33 + * @Title: send60Dispatch
  34 + * @Description: TODO(调度指令下发)
  35 + * @param @param id 班次ID
  36 + * @throws
  37 + */
  38 + int send60Dispatch(Long id);
  39 +
31 40 //60营运指令
32 41 int send60Operation(String nbbm, int state, int upDown);
33 42  
... ... @@ -49,5 +58,5 @@ public interface DirectiveService extends BaseService&lt;Directive, Integer&gt;{
49 58 * @param @param upDonw 上下行 0 上行 1 下行
50 59 * @throws
51 60 */
52   - int upDownChange(String nbbm, Integer upDonw);
  61 + int upDownChange(String nbbm, Integer upDown);
53 62 }
... ...
src/main/java/com/bsth/vehicle/directive/service/DirectiveServiceImpl.java
1 1 package com.bsth.vehicle.directive.service;
2 2  
3   -import java.io.IOException;
4 3 import java.text.SimpleDateFormat;
5 4 import java.util.Date;
6 5 import java.util.HashMap;
7 6 import java.util.Map;
8 7  
9   -import org.apache.http.client.methods.CloseableHttpResponse;
10   -import org.apache.http.client.methods.HttpPost;
11   -import org.apache.http.entity.StringEntity;
12   -import org.apache.http.impl.client.CloseableHttpClient;
13   -import org.apache.http.impl.client.HttpClients;
14   -import org.apache.http.util.EntityUtils;
15 8 import org.slf4j.Logger;
16 9 import org.slf4j.LoggerFactory;
17 10 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -21,27 +14,29 @@ import com.alibaba.fastjson.JSON;
21 14 import com.alibaba.fastjson.JSONObject;
22 15 import com.bsth.entity.realcontrol.ScheduleRealInfo;
23 16 import com.bsth.service.impl.BaseServiceImpl;
  17 +import com.bsth.service.realcontrol.buffer.ScheduleBuffer;
24 18 import com.bsth.vehicle.common.CommonMapped;
25 19 import com.bsth.vehicle.directive.Consts;
26 20 import com.bsth.vehicle.directive.MsgIdGenerator;
27 21 import com.bsth.vehicle.directive.buffer.DirectiveBuffer;
28   -import com.bsth.vehicle.directive.entity.Directive;
29   -import com.bsth.vehicle.directive.entity.Directive.DirectiveData;
30   -import com.bsth.vehicle.directive.entity.DispatchInstruct;
  22 +import com.bsth.vehicle.directive.entity.Directive60;
  23 +import com.bsth.vehicle.directive.entity.Directive60.DirectiveData;
31 24 import com.bsth.vehicle.directive.entity.LineChange;
32 25 import com.bsth.vehicle.directive.entity.LineChange.LineChangeData;
33   -import com.bsth.vehicle.directive.repository.DirectiveRepository;
  26 +import com.bsth.vehicle.directive.repository.Directive60Repository;
34 27 import com.bsth.vehicle.directive.repository.LineChangeRepository;
  28 +import com.bsth.vehicle.directive.util.HttpUtils;
35 29 import com.bsth.vehicle.gpsdata.buffer.GpsRealDataBuffer;
36 30 import com.bsth.vehicle.gpsdata.entity.GpsRealData;
  31 +import com.bsth.websocket.handler.RealControlSocketHandler;
37 32  
38 33 @Service
39   -public class DirectiveServiceImpl extends BaseServiceImpl<Directive, Integer> implements DirectiveService{
  34 +public class DirectiveServiceImpl extends BaseServiceImpl<Directive60, Integer> implements DirectiveService{
40 35  
41 36 Logger logger = LoggerFactory.getLogger(this.getClass());
42 37  
43 38 @Autowired
44   - DirectiveRepository directiveRepository;
  39 + Directive60Repository directiveRepository;
45 40  
46 41 @Autowired
47 42 GpsRealDataBuffer gpsRealDataBuffer;
... ... @@ -49,18 +44,21 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
49 44 @Autowired
50 45 LineChangeRepository lineChangeRepository;
51 46  
  47 + @Autowired
  48 + RealControlSocketHandler socketHandler;
  49 +
52 50 SimpleDateFormat sdfHHmm = new SimpleDateFormat("HH点mm分");
53 51  
54   - static Long schDiff = 1000 * 60 * 6L;
  52 + static Long schDiff = 1000 * 60 * 30L;
55 53  
56 54 //城市代码
57 55 static final short cityCode = 22;
58 56  
59 57 @Override
60 58 public int send60Phrase(String nbbm, String text) {
61   - Directive directive = null;
  59 + Directive60 directive = null;
62 60 try {
63   - directive = create60Data(nbbm, text, DispatchInstruct.PHRASE);
  61 + directive = create60Data(nbbm, text, (short)0x00, null);
64 62 } catch (Exception e) {
65 63 logger.error("发送消息短语出现异常", e);
66 64 return -1;
... ... @@ -70,7 +68,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
70 68 return -1;
71 69  
72 70 //发送指令
73   - int code = postJson(JSON.toJSONString(directive));
  71 + int code = HttpUtils.postJson(JSON.toJSONString(directive));
74 72  
75 73 if(code == 0){
76 74 //添加到缓存,等待入库
... ... @@ -83,18 +81,18 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
83 81  
84 82 @Override
85 83 public int send60Dispatch(ScheduleRealInfo sch, int finish) {
86   - Directive directive = null;
  84 + Directive60 directive = null;
87 85 try {
88 86 //如果发车时间距当前时间较远,则不发送
89   - if(Math.abs(sch.getFcsjT() - System.currentTimeMillis()) > schDiff){
  87 + /*if(Math.abs(sch.getFcsjT() - System.currentTimeMillis()) > schDiff){
90 88 return 0;
91   - }
  89 + }*/
92 90  
93 91 String text = "已完成" + finish + "个班次,下一发车时间" + sdfHHmm.format(new Date(sch.getFcsjT()))
94 92 + ",由" + sch.getQdzName() + "发往" + sch.getZdzName();
95 93  
96 94 //目前使用短语协议下发调度指令
97   - directive = create60Data(sch.getClZbh(), text, DispatchInstruct.PHRASE);
  95 + directive = create60Data(sch.getClZbh(), text, (short)0x00, sch);
98 96 } catch (Exception e) {
99 97 logger.error("生成调度指令时出现异常", e);
100 98 return -1;
... ... @@ -104,7 +102,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
104 102 return -1;
105 103  
106 104 //发送指令
107   - int code = postJson(JSON.toJSONString(directive));
  105 + int code = HttpUtils.postJson(JSON.toJSONString(directive));
108 106  
109 107 if(code == 0){
110 108 sch.setDirectiveState(60);
... ... @@ -112,12 +110,37 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
112 110 directive.setDispatch(true);
113 111 directive.setSch(sch);
114 112 DirectiveBuffer.put(directive);
  113 +
  114 + //通知页面,消息已发出
  115 + sendDirectiveState(sch);
115 116 }else{
116 117 logger.error("send60Phrase error, code: " + code);
117 118 }
118 119 return code;
119 120 }
  121 +
  122 + /**
  123 + *
  124 + * @Title: sendDirectiveState
  125 + * @Description: TODO(向页面推送班次指令状态)
  126 + * @throws
  127 + */
  128 + public void sendDirectiveState(ScheduleRealInfo sch){
  129 + JSONObject json = new JSONObject();
  130 + json.put("fn", "directive");
  131 + json.put("t", sch);
  132 + socketHandler.sendMessageToLine(Integer.parseInt(sch.getXlBm()), json.toJSONString());
  133 + }
120 134  
  135 +
  136 + @Override
  137 + public int send60Dispatch(Long id) {
  138 + ScheduleRealInfo sch = ScheduleBuffer.findOne(id);
  139 + //车辆已完成班次
  140 + int finish = ScheduleBuffer.getFinishSchNo(sch.getClZbh());
  141 + return send60Dispatch(sch, finish);
  142 + }
  143 +
121 144 @Override
122 145 public int send60Operation(String nbbm, int state, int upDown) {
123 146 return 0;
... ... @@ -142,13 +165,13 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
142 165 change.setTimestamp(t);
143 166 change.setData(data);
144 167  
145   - int code = postJson(JSON.toJSONString(change));
  168 + int code = HttpUtils.postJson(JSON.toJSONString(change));
146 169 if(code == 0){
147 170 //入库
148 171 lineChangeRepository.save(change);
149 172 DirectiveBuffer.changeMap.put(deviceId + '_' + t , change);
150 173 //通知设备刷新线路文件,忽略结果
151   - postJson(createDeviceRefreshData(deviceId, lineId));
  174 + HttpUtils.postJson(createDeviceRefreshData(deviceId, lineId));
152 175 }else{
153 176 logger.error("send60Phrase error, code: " + code);
154 177 }
... ... @@ -156,7 +179,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
156 179 }
157 180  
158 181  
159   - public Directive create60Data(String nbbm, String text, DispatchInstruct dispatchInstruct){
  182 + public Directive60 create60Data(String nbbm, String text, Short dispatchInstruct, ScheduleRealInfo sch){
160 183 Long timestamp = System.currentTimeMillis();
161 184  
162 185 /*//向测试设备发送
... ... @@ -169,15 +192,26 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
169 192 logger.error("没有设备号对照的车辆:" + nbbm);
170 193 return null;
171 194 }
172   - GpsRealData gpsData = gpsRealDataBuffer.findOneByDeviceId(deviceId);
173   - if(null == gpsData){
174   - logger.error("没有找到gps对照,无法确认营运状态和上下行:" + nbbm);
175   - return null;
  195 + //上下行和营运状态
  196 + Integer upDown = null, state = null;
  197 + if(null == sch){
  198 + GpsRealData gpsData = gpsRealDataBuffer.findOneByDeviceId(deviceId);
  199 + if(null == gpsData){
  200 + logger.error("没有找到gps对照,无法确认营运状态和上下行:" + nbbm);
  201 + return null;
  202 + }
  203 + upDown = gpsData.getUpDown();
  204 + state = gpsData.getState();
  205 + }
  206 + else{
  207 + upDown = Integer.parseInt(sch.getXlDir());
  208 + state = 0;
176 209 }
177 210  
  211 +
178 212 int msgId = MsgIdGenerator.getMsgId();
179 213  
180   - Directive directive = new Directive();
  214 + Directive60 directive = new Directive60();
181 215 DirectiveData data = new DirectiveData();
182 216 //一级协议
183 217 directive.setOperCode((short) 0x60);
... ... @@ -195,7 +229,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
195 229 directive.setData(data);
196 230 long serviceState;
197 231 try{
198   - serviceState = Consts.SERVICE_STATE[gpsData.getUpDown()][gpsData.getState()];
  232 + serviceState = Consts.SERVICE_STATE[upDown][state];
199 233 }catch(IndexOutOfBoundsException e){
200 234 //未知营运状态的直接默认为上行非营运
201 235 serviceState = Consts.SERVICE_STATE[0][1];
... ... @@ -206,46 +240,14 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
206 240 return directive;
207 241 }
208 242  
209   - public int postJson(String jsonStr){
210   - logger.info("send : " + jsonStr);
211   -
212   - CloseableHttpClient httpClient = null;
213   - int code = -1;
214   - try{
215   - httpClient = HttpClients.createDefault();
216   -
217   - HttpPost post = new HttpPost(Consts.SEND_DIRECTIVE_URL);
218   -
219   - post.setEntity(new StringEntity(jsonStr, "utf-8"));
220   -
221   - CloseableHttpResponse response = httpClient.execute(post);
222   -
223   - JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity()));
224   - if(null != json && json.getInteger("errCode") == 0)
225   - code = 0;
226   - else
227   - logger.error("和网关http通讯失败,rs: " + json);
228   - }catch(Exception e){
229   - logger.error("", e);
230   - }finally {
231   - try {
232   - if(httpClient != null)
233   - httpClient.close();
234   - } catch (IOException e) {
235   - logger.error("", e);
236   - }
237   - }
238   - return code;
239   - }
240   -
241 243 @Override
242   - public int upDownChange(String nbbm, Integer upDonw) {
  244 + public int upDownChange(String nbbm, Integer upDown) {
243 245 //构造数据
244 246 String deviceId = CommonMapped.vehicDeviceBiMap.inverse().get(nbbm);
245 247 Short company = Short.parseShort(CommonMapped.vehicCompanyMap.get(nbbm));
246 248 Long timestamp = System.currentTimeMillis();
247 249 int msgId = MsgIdGenerator.getMsgId();
248   - Directive directive = new Directive();
  250 + Directive60 directive = new Directive60();
249 251 DirectiveData data = new DirectiveData();
250 252 //一级协议
251 253 directive.setOperCode((short) 0x60);
... ... @@ -256,22 +258,23 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;Directive, Integer&gt; im
256 258 directive.setMsgId(msgId);
257 259 //构造数据
258 260 data.setDeviceId(deviceId);
259   - data.setDispatchInstruct(DispatchInstruct.OPERATE_CLOCK_OFF);
  261 + data.setDispatchInstruct((short)0x03);
260 262 data.setTimestamp(timestamp);
261 263 data.setCompanyCode(company);
262 264 data.setMsgId(msgId);
  265 + data.setTxtContent(nbbm + "_" + upDown);
263 266 directive.setData(data);
264 267  
265 268 long serviceState;
266 269 try{
267   - serviceState = Consts.SERVICE_STATE[upDonw][0];
  270 + serviceState = Consts.SERVICE_STATE[upDown][0];
268 271 }catch(IndexOutOfBoundsException e){
269   - logger.error("upDonw: " + upDonw, e);
  272 + logger.error("upDonw: " + upDown, e);
270 273 return -1;
271 274 }
272 275 data.setServiceState(serviceState);
273 276  
274   - int code = postJson(JSON.toJSONString(directive));
  277 + int code = HttpUtils.postJson(JSON.toJSONString(directive));
275 278 if(code == 0){
276 279 //添加到缓存,等待入库
277 280 DirectiveBuffer.put(directive);
... ...
src/main/java/com/bsth/vehicle/directive/thread/DirectivePersistenceThread.java
... ... @@ -8,8 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired;
8 8 import org.springframework.stereotype.Component;
9 9  
10 10 import com.bsth.vehicle.directive.buffer.DirectiveBuffer;
11   -import com.bsth.vehicle.directive.entity.Directive;
12   -import com.bsth.vehicle.directive.repository.DirectiveRepository;
  11 +import com.bsth.vehicle.directive.entity.Directive60;
  12 +import com.bsth.vehicle.directive.repository.Directive60Repository;
13 13  
14 14 /**
15 15 *
... ... @@ -23,15 +23,15 @@ import com.bsth.vehicle.directive.repository.DirectiveRepository;
23 23 public class DirectivePersistenceThread extends Thread{
24 24  
25 25 @Autowired
26   - DirectiveRepository directiveRepository;
  26 + Directive60Repository directiveRepository;
27 27  
28 28 Logger logger = LoggerFactory.getLogger(this.getClass());
29 29  
30 30 @Override
31 31 public void run() {
32   - LinkedList<Directive> list = DirectiveBuffer.transientList;
  32 + LinkedList<Directive60> list = DirectiveBuffer.transientList;
33 33  
34   - Directive directive;
  34 + Directive60 directive;
35 35 for(int i = 0; i < 1000; i ++){
36 36 directive = list.poll();
37 37  
... ...
src/main/java/com/bsth/vehicle/directive/util/HttpUtils.java 0 → 100644
  1 +package com.bsth.vehicle.directive.util;
  2 +
  3 +import java.io.IOException;
  4 +
  5 +import org.apache.http.client.methods.CloseableHttpResponse;
  6 +import org.apache.http.client.methods.HttpPost;
  7 +import org.apache.http.entity.StringEntity;
  8 +import org.apache.http.impl.client.CloseableHttpClient;
  9 +import org.apache.http.impl.client.HttpClients;
  10 +import org.apache.http.util.EntityUtils;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +
  14 +import com.alibaba.fastjson.JSONObject;
  15 +import com.bsth.vehicle.directive.Consts;
  16 +
  17 +/**
  18 + *
  19 + * @ClassName: HttpUtils
  20 + * @Description: TODO(和网关HTTP通讯工具类)
  21 + * @author PanZhao
  22 + * @date 2016年7月8日 上午10:38:10
  23 + *
  24 + */
  25 +public class HttpUtils {
  26 +
  27 + static Logger logger = LoggerFactory.getLogger(HttpUtils.class);
  28 +
  29 + public static int postJson(String jsonStr){
  30 + logger.info("send : " + jsonStr);
  31 +
  32 + CloseableHttpClient httpClient = null;
  33 + int code = -1;
  34 + try{
  35 + httpClient = HttpClients.createDefault();
  36 +
  37 + HttpPost post = new HttpPost(Consts.SEND_DIRECTIVE_URL);
  38 +
  39 + post.setEntity(new StringEntity(jsonStr, "utf-8"));
  40 +
  41 + CloseableHttpResponse response = httpClient.execute(post);
  42 +
  43 + JSONObject json = JSONObject.parseObject(EntityUtils.toString(response.getEntity()));
  44 + if(null != json && json.getInteger("errCode") == 0)
  45 + code = 0;
  46 + else
  47 + logger.error("和网关http通讯失败,rs: " + json);
  48 + }catch(Exception e){
  49 + logger.error("", e);
  50 + }finally {
  51 + try {
  52 + if(httpClient != null)
  53 + httpClient.close();
  54 + } catch (IOException e) {
  55 + logger.error("", e);
  56 + }
  57 + }
  58 + return code;
  59 + }
  60 +}
... ...
src/main/java/com/bsth/vehicle/gpsdata/GpsArrivalStationThread.java
... ... @@ -7,6 +7,7 @@ import java.text.ParseException;
7 7 import java.text.SimpleDateFormat;
8 8 import java.util.ArrayList;
9 9 import java.util.Calendar;
  10 +import java.util.Date;
10 11 import java.util.Iterator;
11 12 import java.util.List;
12 13 import java.util.Set;
... ... @@ -16,6 +17,7 @@ import org.slf4j.LoggerFactory;
16 17 import org.springframework.beans.factory.annotation.Autowired;
17 18 import org.springframework.stereotype.Component;
18 19  
  20 +import com.alibaba.fastjson.JSONObject;
19 21 import com.bsth.entity.realcontrol.ScheduleRealInfo;
20 22 import com.bsth.service.realcontrol.buffer.ScheduleBuffer;
21 23 import com.bsth.util.DateUtils;
... ... @@ -23,6 +25,7 @@ import com.bsth.util.db.DBUtils_MS;
23 25 import com.bsth.vehicle.directive.service.DirectiveService;
24 26 import com.bsth.vehicle.gpsdata.buffer.GpsArrivalDataBuffer;
25 27 import com.bsth.vehicle.gpsdata.entity.ArrivalInfo;
  28 +import com.bsth.websocket.handler.RealControlSocketHandler;
26 29  
27 30 /**
28 31 *
... ... @@ -41,6 +44,9 @@ public class GpsArrivalStationThread extends Thread{
41 44 @Autowired
42 45 DirectiveService directiveService;
43 46  
  47 + @Autowired
  48 + RealControlSocketHandler socketHandler;
  49 +
44 50 private static int diff = 1000 * 60 * 20;
45 51  
46 52 @Override
... ... @@ -93,7 +99,7 @@ public class GpsArrivalStationThread extends Thread{
93 99 //匹配起点
94 100 matchStart(scInfo, arr);
95 101  
96   - //计划终点
  102 + //匹配终点
97 103 matchEnd(scInfo, arr);
98 104 }catch(Exception e){
99 105 e.printStackTrace();
... ... @@ -123,10 +129,26 @@ public class GpsArrivalStationThread extends Thread{
123 129 //班次状态改为正在执行
124 130 scInfo.setStatus(1);
125 131 ScheduleBuffer.persistentList.add(scInfo);
  132 + //推送到页面
  133 + sendFcsj(scInfo);
126 134 }
127 135 }
128 136  
129 137 /**
  138 + * @Title: sendFcsj
  139 + * @Description: TODO(推送发车信息)
  140 + * @param @param schedule 班次
  141 + * @throws
  142 + */
  143 + public void sendFcsj(ScheduleRealInfo schedule){
  144 + JSONObject json = new JSONObject();
  145 + json.put("fn", "faChe");
  146 + json.put("t", schedule);
  147 + json.put("dataStr", sdf.format(new Date()));
  148 + socketHandler.sendMessageToLine(Integer.parseInt(schedule.getXlBm()), json.toJSONString());
  149 + }
  150 +
  151 + /**
130 152 *
131 153 * @Title: matchEnd
132 154 * @Description: TODO(匹配终点 进站时间)
... ... @@ -148,11 +170,31 @@ public class GpsArrivalStationThread extends Thread{
148 170 //完成当前班次
149 171 ScheduleRealInfo nextSch = ScheduleBuffer.finishSch(scInfo);
150 172 //到达终点,发送下一班次的调度指令
151   - directiveService.send60Dispatch(nextSch, ScheduleBuffer.getFinishSchNo(nextSch.getClZbh()));
  173 + int finish = ScheduleBuffer.getFinishSchNo(nextSch.getClZbh());
  174 + directiveService.send60Dispatch(nextSch, finish);
  175 + //推送到页面
  176 + sendZdsj(scInfo, nextSch, finish);
152 177 }
153 178 }
154 179  
155 180 /**
  181 + * @Title: sendFcsj
  182 + * @Description: TODO(推送到达终点时间)
  183 + * @param @param schedule 班次
  184 + * @throws
  185 + */
  186 + public void sendZdsj(ScheduleRealInfo schedule,ScheduleRealInfo nextSch, int finish){
  187 + JSONObject json = new JSONObject();
  188 + json.put("fn", "zhongDian");
  189 + json.put("t", schedule);
  190 + json.put("nt", nextSch);
  191 + json.put("finish", finish);
  192 + json.put("dataStr", sdf.format(new Date()));
  193 +
  194 + socketHandler.sendMessageToLine(Integer.parseInt(schedule.getXlBm()), json.toJSONString());
  195 + }
  196 +
  197 + /**
156 198 * @throws ParseException
157 199 *
158 200 * @Title: loadData
... ... @@ -170,7 +212,7 @@ public class GpsArrivalStationThread extends Thread{
170 212 GpsArrivalDataBuffer.markTime = DateUtils.getTimesmorning() * 1000L;
171 213 }
172 214  
173   - String sql = "select * from bsth_c_arrival_info where weeks_year=? and create_date > ?";
  215 + String sql = "select * from bsth_c_arrival_info where weeks_year=? and create_date > ? order by ts";
174 216  
175 217 List<ArrivalInfo> list = new ArrayList<>();
176 218 Connection conn = null;
... ... @@ -179,8 +221,8 @@ public class GpsArrivalStationThread extends Thread{
179 221 try {
180 222 conn = DBUtils_MS.getConnection();
181 223 ps = conn.prepareStatement(sql);
182   - ps.setInt(1, weeks_year);
183   - ps.setLong(2, /*GpsArrivalDataBuffer.markTime*/1467099600000L);
  224 + ps.setInt(1, /*weeks_year*/28);
  225 + ps.setLong(2, /*GpsArrivalDataBuffer.markTime*/1467853749000L);
184 226  
185 227 Long t = System.currentTimeMillis();
186 228 rs = ps.executeQuery();
... ... @@ -215,7 +257,7 @@ public class GpsArrivalStationThread extends Thread{
215 257 Long t = System.currentTimeMillis();
216 258 for(ScheduleRealInfo sch : allList){
217 259 if(Math.abs(sch.getFcsjT() - t) < rang
218   - || Math.abs(sch.getZdsjT()) - t < rang){
  260 + || (sch.getZdsjT() != null && Math.abs(sch.getZdsjT()) - t < rang)){
219 261 subList.add(sch);
220 262 }
221 263 }
... ...
src/main/java/com/bsth/vehicle/gpsdata/buffer/GpsRealDataBuffer.java
... ... @@ -55,6 +55,10 @@ public class GpsRealDataBuffer {
55 55 return deviceGpsMap == null;
56 56 }
57 57  
  58 + static{
  59 + lineGpsMultimap = ArrayListMultimap.create();
  60 + }
  61 +
58 62 /**
59 63 *
60 64 * @Title: initBuffer
... ...
src/main/java/com/bsth/websocket/handler/Directive80SocketHandler.java renamed to src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
... ... @@ -12,6 +12,7 @@ import org.springframework.web.socket.WebSocketMessage;
12 12 import org.springframework.web.socket.WebSocketSession;
13 13  
14 14 import com.bsth.common.Constants;
  15 +import com.bsth.vehicle.common.CommonMapped;
15 16  
16 17 /**
17 18 * 驾驶员上报80指令推送
... ... @@ -19,7 +20,7 @@ import com.bsth.common.Constants;
19 20 * @author PanZhao
20 21 */
21 22 @Component
22   -public class Directive80SocketHandler implements WebSocketHandler {
  23 +public class RealControlSocketHandler implements WebSocketHandler {
23 24  
24 25 private static final ArrayList<WebSocketSession> users;
25 26  
... ... @@ -95,4 +96,29 @@ public class Directive80SocketHandler implements WebSocketHandler {
95 96 }
96 97 }
97 98 }
  99 +
  100 + /**
  101 + * 根据线路推送消息
  102 + *
  103 + * @param userId
  104 + * @param message
  105 + */
  106 + public synchronized void sendMessageToLine(Integer lineCode, String msg) {
  107 + Set<String> uids = CommonMapped.lineUserMap.get(lineCode);
  108 + if(null == uids || uids.size() == 0)
  109 + return;
  110 +
  111 + TextMessage message = new TextMessage(msg.getBytes());
  112 + for (WebSocketSession user : users) {
  113 + if (uids.contains(user.getAttributes().get(Constants.SESSION_USERNAME))) {
  114 + try {
  115 + if (user.isOpen()) {
  116 + user.sendMessage(message);
  117 + }
  118 + } catch (IOException e) {
  119 + e.printStackTrace();
  120 + }
  121 + }
  122 + }
  123 + }
98 124 }
... ...
src/main/resources/application.properties
... ... @@ -18,6 +18,11 @@ spring.datasource.max-active=100
18 18 spring.datasource.max-idle=8
19 19 spring.datasource.min-idle=8
20 20 spring.datasource.initial-size=5
  21 +
  22 +spring.datasource.test-on-borrow=true
  23 +spring.datasource.test-on-connect=true
  24 +spring.datasource.test-on-return=true
  25 +spring.datasource.test-while-idle=true
21 26 spring.datasource.validation-query=select 1
22 27  
23 28 spring.view.suffix=.html
... ...
src/main/resources/static/assets/js/common.js
... ... @@ -21,20 +21,26 @@ function removeConfirm(text, url, success) {
21 21  
22 22  
23 23 function successHandle(json, handle){
24   - if(!json.status){
  24 + var status = json.status;
  25 + if(status == 407){
  26 + alert('被注销的登录');
  27 + return;
  28 + }
  29 +
  30 + if(!status){
25 31 handle && handle(json);
26 32 return ;
27 33 }
28 34  
29   - if(json.status == 'ERROR')
30   - layer.alert(json.msg, {icon: 2, title: '操作失败'});
  35 + if(status == 'ERROR')
  36 + layer.alert(json.msg?json.msg:'未知异常', {icon: 2, title: '操作失败'});
31 37 else
32 38 handle && handle(json);
33 39 }
34 40  
35 41 function ajaxComplete(xhr, ts, succ){
36 42 if(ts == 'success'){
37   - successHandle(xhr.responseJSON, succ);
  43 + successHandle(JSON.parse(xhr.responseText), succ);
38 44 }
39 45 else if(ts == 'error'){
40 46 layer.alert(xhr.responseText, {icon: 2, title: '操作失败'});
... ... @@ -139,4 +145,49 @@ function createTreeData(arr){
139 145 }
140 146 }
141 147 return treeData;
  148 +}
  149 +
  150 +
  151 +function createVehSearch($e){
  152 + //车辆内部编码下拉搜索框
  153 + $e.select2({
  154 + placeholder: '搜索车辆...',
  155 + ajax: {
  156 + url: '/realSchedule/sreachVehic',
  157 + dataType: 'json',
  158 + delay: 150,
  159 + data: function(params){
  160 + return{nbbm: params.term};
  161 + },
  162 + processResults: function (data) {
  163 + return {
  164 + results: data
  165 + };
  166 + },
  167 + cache: true
  168 + },
  169 + templateResult: function(repo){
  170 + if (repo.loading) return repo.text;
  171 + var h = '<span>'+repo.text+'</span>';
  172 + h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');
  173 + return h;
  174 + },
  175 + escapeMarkup: function (markup) { return markup; },
  176 + minimumInputLength: 1,
  177 + templateSelection: function(repo){
  178 + return repo.text;
  179 + },
  180 + language: {
  181 + noResults: function(){
  182 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  183 + },
  184 + inputTooShort : function(e) {
  185 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  186 + },
  187 + searching : function() {
  188 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  189 + }
  190 + }
  191 + })
  192 + return $e;
142 193 }
143 194 \ No newline at end of file
... ...
src/main/resources/static/assets/plugins/layer-v2.2/doc/layer交流.url deleted 100644 → 0
1   -[{000214A0-0000-0000-C000-000000000046}]
2   -Prop3=19,2
3   -[InternetShortcut]
4   -URL=http://fly.layui.com/
5   -IDList=
6   -HotKey=0
7   -IconFile=F:\bd_xianxin\bayuanbao\www\favicon.ico
8   -IconIndex=0
src/main/resources/static/assets/plugins/layer-v2.2/doc/layer官网.url deleted 100644 → 0
1   -[{000214A0-0000-0000-C000-000000000046}]
2   -Prop3=19,2
3   -[InternetShortcut]
4   -URL=http://sentsin.com/jquery/layer/
5   -IDList=
6   -HotKey=0
src/main/resources/static/assets/plugins/layer-v2.2/layer/extend/layer.ext.js deleted 100644 → 0
1   -/*! layer弹层组件拓展类 */
2   -;!function(){layer.use("skin/layer.ext.css",function(){layer.layui_layer_extendlayerextjs=!0});var a=layer.cache||{},b=function(b){return a.skin?" "+a.skin+" "+a.skin+"-"+b:""};layer.prompt=function(a,c){a=a||{},"function"==typeof a&&(c=a);var d,e=2==a.formType?'<textarea class="layui-layer-input">'+(a.value||"")+"</textarea>":function(){return'<input type="'+(1==a.formType?"password":"text")+'" class="layui-layer-input" value="'+(a.value||"")+'">'}();return layer.open($.extend({btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:e,skin:"layui-layer-prompt"+b("prompt"),success:function(a){d=a.find(".layui-layer-input"),d.focus()},yes:function(b){var e=d.val();""===e?d.focus():e.length>(a.maxlength||500)?layer.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(a.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",d,{tips:1}):c&&c(e,b,d)}},a))},layer.tab=function(a){a=a||{};var c=a.tab||{};return layer.open($.extend({type:1,skin:"layui-layer-tab"+b("tab"),title:function(){var a=c.length,b=1,d="";if(a>0)for(d='<span class="layui-layer-tabnow">'+c[0].title+"</span>";a>b;b++)d+="<span>"+c[b].title+"</span>";return d}(),content:'<ul class="layui-layer-tabmain">'+function(){var a=c.length,b=1,d="";if(a>0)for(d='<li class="layui-layer-tabli xubox_tab_layer">'+(c[0].content||"no content")+"</li>";a>b;b++)d+='<li class="layui-layer-tabli">'+(c[b].content||"no content")+"</li>";return d}()+"</ul>",success:function(b){var c=b.find(".layui-layer-title").children(),d=b.find(".layui-layer-tabmain").children();c.on("mousedown",function(b){b.stopPropagation?b.stopPropagation():b.cancelBubble=!0;var c=$(this),e=c.index();c.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),d.eq(e).show().siblings().hide(),"function"==typeof a.change&&a.change(e)})}},a))},layer.photos=function(a,c,d){function e(a,b,c){var d=new Image;d.onload=function(){d.onload=null,b(d)},d.onerror=function(a){d.onerror=null,c(a)},d.src=a}var f={};if(a=a||{},a.photos){var g=a.photos.constructor===Object,h=g?a.photos:{},i=h.data||[],j=h.start||0;if(f.imgIndex=j+1,g){if(0===i.length)return layer.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var k=$(a.photos),l=function(){return i=[],k.find(a.img||"img").each(function(a){var b=$(this);i.push({alt:b.attr("alt"),pid:b.attr("layer-pid"),src:b.attr("layer-src")||b.attr("src"),thumb:b.attr("src")})}),arguments.callee}();if(0===i.length)return;if(c||k.on("click",a.img||"img",function(){var b=$(this),c=b.index();l(),layer.photos($.extend(a,{photos:{start:c,data:i,tab:a.tab},full:a.full}),!0)}),!c)return}f.imgprev=function(a){f.imgIndex--,f.imgIndex<1&&(f.imgIndex=i.length),f.tabimg(a)},f.imgnext=function(a,b){f.imgIndex++,f.imgIndex>i.length&&(f.imgIndex=1,b)||f.tabimg(a)},f.keyup=function(a){if(!f.end){var b=a.keyCode;a.preventDefault(),37===b?f.imgprev(!0):39===b?f.imgnext(!0):27===b&&layer.close(f.index)}},f.tabimg=function(b){i.length<=1||(h.start=f.imgIndex-1,layer.close(f.index),layer.photos(a,!0,b))},f.event=function(){f.bigimg.hover(function(){f.imgsee.show()},function(){f.imgsee.hide()}),f.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),f.imgprev()}),f.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),f.imgnext()}),$(document).on("keyup",f.keyup)},f.loadi=layer.load(1,{shade:"shade"in a?!1:.9,scrollbar:!1}),e(i[j].src,function(c){layer.close(f.loadi),f.index=layer.open($.extend({type:1,area:function(){var b=[c.width,c.height],d=[$(window).width()-100,$(window).height()-100];return!a.full&&b[0]>d[0]&&(b[0]=d[0],b[1]=b[0]*d[1]/b[0]),[b[0]+"px",b[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos"+b("photos"),content:'<div class="layui-layer-phimg"><img src="'+i[j].src+'" alt="'+(i[j].alt||"")+'" layer-pid="'+i[j].pid+'"><div class="layui-layer-imgsee">'+(i.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(d?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(i[j].alt||"")+"</a><em>"+f.imgIndex+"/"+i.length+"</em></span></div></div></div>",success:function(b,c){f.bigimg=b.find(".layui-layer-phimg"),f.imgsee=b.find(".layui-layer-imguide,.layui-layer-imgbar"),f.event(b),a.tab&&a.tab(i[j],b)},end:function(){f.end=!0,$(document).off("keyup",f.keyup)}},a))},function(){layer.close(f.loadi),layer.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["下一张","不看了"],yes:function(){i.length>1&&f.imgnext(!0,!0)}})})}}}();
3 0 \ No newline at end of file
src/main/resources/static/assets/plugins/layer-v2.2/layer/layer.js deleted 100644 → 0
1   -/*! layer-v2.2 弹层组件 License LGPL http://layer.layui.com/ By 贤心 */
2   -;!function(a,b){"use strict";var c,d,e={getPath:function(){var a=document.scripts,b=a[a.length-1],c=b.src;if(!b.getAttribute("merge"))return c.substring(0,c.lastIndexOf("/")+1)}(),enter:function(a){13===a.keyCode&&a.preventDefault()},config:{},end:{},btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"]},f={v:"2.2",ie6:!!a.ActiveXObject&&!a.XMLHttpRequest,index:0,path:e.getPath,config:function(a,b){var d=0;return a=a||{},f.cache=e.config=c.extend(e.config,a),f.path=e.config.path||f.path,"string"==typeof a.extend&&(a.extend=[a.extend]),f.use("skin/layer.css",a.extend&&a.extend.length>0?function g(){var c=a.extend;f.use(c[c[d]?d:d-1],d<c.length?function(){return++d,g}():b)}():b),this},use:function(a,b,d){var e=c("head")[0],a=a.replace(/\s/g,""),g=/\.css$/.test(a),h=document.createElement(g?"link":"script"),i="layui_layer_"+a.replace(/\.|\//g,"");return f.path?(g&&(h.rel="stylesheet"),h[g?"href":"src"]=/^http:\/\//.test(a)?a:f.path+a,h.id=i,c("#"+i)[0]||e.appendChild(h),function j(){(g?1989===parseInt(c("#"+i).css("width")):f[d||i])?function(){b&&b();try{g||e.removeChild(h)}catch(a){}}():setTimeout(j,100)}(),this):void 0},ready:function(a,b){var d="function"==typeof a;return d&&(b=a),f.config(c.extend(e.config,function(){return d?{}:{path:a}}()),b),this},alert:function(a,b,d){var e="function"==typeof b;return e&&(d=b),f.open(c.extend({content:a,yes:d},e?{}:b))},confirm:function(a,b,d,g){var h="function"==typeof b;return h&&(g=d,d=b),f.open(c.extend({content:a,btn:e.btn,yes:d,cancel:g},h?{}:b))},msg:function(a,d,g){var i="function"==typeof d,j=e.config.skin,k=(j?j+" "+j+"-msg":"")||"layui-layer-msg",l=h.anim.length-1;return i&&(g=d),f.open(c.extend({content:a,time:3e3,shade:!1,skin:k,title:!1,closeBtn:!1,btn:!1,end:g},i&&!e.config.skin?{skin:k+" layui-layer-hui",shift:l}:function(){return d=d||{},(-1===d.icon||d.icon===b&&!e.config.skin)&&(d.skin=k+" "+(d.skin||"layui-layer-hui")),d}()))},load:function(a,b){return f.open(c.extend({type:3,icon:a||0,shade:.01},b))},tips:function(a,b,d){return f.open(c.extend({type:4,content:[a,b],closeBtn:!1,time:3e3,shade:!1,maxWidth:210},d))}},g=function(a){var b=this;b.index=++f.index,b.config=c.extend({},b.config,e.config,a),b.creat()};g.pt=g.prototype;var h=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];h.anim=["layui-anim","layui-anim-01","layui-anim-02","layui-anim-03","layui-anim-04","layui-anim-05","layui-anim-06"],g.pt.config={type:0,shade:.3,fix:!0,move:h[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,shift:0,icon:-1,scrollbar:!0,tips:2},g.pt.vessel=function(a,b){var c=this,d=c.index,f=c.config,g=f.zIndex+d,i="object"==typeof f.title,j=f.maxmin&&(1===f.type||2===f.type),k=f.title?'<div class="layui-layer-title" style="'+(i?f.title[1]:"")+'">'+(i?f.title[0]:f.title)+"</div>":"";return f.zIndex=g,b([f.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+d+'" times="'+d+'" style="'+("z-index:"+(g-1)+"; background-color:"+(f.shade[1]||"#000")+"; opacity:"+(f.shade[0]||f.shade)+"; filter:alpha(opacity="+(100*f.shade[0]||100*f.shade)+");")+'"></div>':"",'<div class="'+h[0]+" "+(h.anim[f.shift]||"")+(" layui-layer-"+e.type[f.type])+(0!=f.type&&2!=f.type||f.shade?"":" layui-layer-border")+" "+(f.skin||"")+'" id="'+h[0]+d+'" type="'+e.type[f.type]+'" times="'+d+'" showtime="'+f.time+'" conType="'+(a?"object":"string")+'" style="z-index: '+g+"; width:"+f.area[0]+";height:"+f.area[1]+(f.fix?"":";position:absolute;")+'">'+(a&&2!=f.type?"":k)+'<div id="'+(f.id||"")+'" class="layui-layer-content'+(0==f.type&&-1!==f.icon?" layui-layer-padding":"")+(3==f.type?" layui-layer-loading"+f.icon:"")+'">'+(0==f.type&&-1!==f.icon?'<i class="layui-layer-ico layui-layer-ico'+f.icon+'"></i>':"")+(1==f.type&&a?"":f.content||"")+'</div><span class="layui-layer-setwin">'+function(){var a=j?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return f.closeBtn&&(a+='<a class="layui-layer-ico '+h[7]+" "+h[7]+(f.title?f.closeBtn:4==f.type?"1":"2")+'" href="javascript:;"></a>'),a}()+"</span>"+(f.btn?function(){var a="";"string"==typeof f.btn&&(f.btn=[f.btn]);for(var b=0,c=f.btn.length;c>b;b++)a+='<a class="'+h[6]+b+'">'+f.btn[b]+"</a>";return'<div class="'+h[6]+'">'+a+"</div>"}():"")+"</div>"],k),c},g.pt.creat=function(){var a=this,b=a.config,g=a.index,i=b.content,j="object"==typeof i;if(!c("#"+b.id)[0]){switch("string"==typeof b.area&&(b.area="auto"===b.area?["",""]:[b.area,""]),b.type){case 0:b.btn="btn"in b?b.btn:e.btn[0],f.closeAll("dialog");break;case 2:var i=b.content=j?b.content:[b.content||"http://layer.layui.com","auto"];b.content='<iframe scrolling="'+(b.content[1]||"auto")+'" allowtransparency="true" id="'+h[4]+g+'" name="'+h[4]+g+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+b.content[0]+'"></iframe>';break;case 3:b.title=!1,b.closeBtn=!1,-1===b.icon&&0===b.icon,f.closeAll("loading");break;case 4:j||(b.content=[b.content,"body"]),b.follow=b.content[1],b.content=b.content[0]+'<i class="layui-layer-TipsG"></i>',b.title=!1,b.fix=!1,b.tips="object"==typeof b.tips?b.tips:[b.tips,!0],b.tipsMore||f.closeAll("tips")}a.vessel(j,function(d,e){c("body").append(d[0]),j?function(){2==b.type||4==b.type?function(){c("body").append(d[1])}():function(){i.parents("."+h[0])[0]||(i.show().addClass("layui-layer-wrap").wrap(d[1]),c("#"+h[0]+g).find("."+h[5]).before(e))}()}():c("body").append(d[1]),a.layero=c("#"+h[0]+g),b.scrollbar||h.html.css("overflow","hidden").attr("layer-full",g)}).auto(g),2==b.type&&f.ie6&&a.layero.find("iframe").attr("src",i[0]),c(document).off("keydown",e.enter).on("keydown",e.enter),a.layero.on("keydown",function(a){c(document).off("keydown",e.enter)}),4==b.type?a.tips():a.offset(),b.fix&&d.on("resize",function(){a.offset(),(/^\d+%$/.test(b.area[0])||/^\d+%$/.test(b.area[1]))&&a.auto(g),4==b.type&&a.tips()}),b.time<=0||setTimeout(function(){f.close(a.index)},b.time),a.move().callback()}},g.pt.auto=function(a){function b(a){a=g.find(a),a.height(i[1]-j-k-2*(0|parseFloat(a.css("padding"))))}var e=this,f=e.config,g=c("#"+h[0]+a);""===f.area[0]&&f.maxWidth>0&&(/MSIE 7/.test(navigator.userAgent)&&f.btn&&g.width(g.innerWidth()),g.outerWidth()>f.maxWidth&&g.width(f.maxWidth));var i=[g.innerWidth(),g.innerHeight()],j=g.find(h[1]).outerHeight()||0,k=g.find("."+h[6]).outerHeight()||0;switch(f.type){case 2:b("iframe");break;default:""===f.area[1]?f.fix&&i[1]>=d.height()&&(i[1]=d.height(),b("."+h[5])):b("."+h[5])}return e},g.pt.offset=function(){var a=this,b=a.config,c=a.layero,e=[c.outerWidth(),c.outerHeight()],f="object"==typeof b.offset;a.offsetTop=(d.height()-e[1])/2,a.offsetLeft=(d.width()-e[0])/2,f?(a.offsetTop=b.offset[0],a.offsetLeft=b.offset[1]||a.offsetLeft):"auto"!==b.offset&&(a.offsetTop=b.offset,"rb"===b.offset&&(a.offsetTop=d.height()-e[1],a.offsetLeft=d.width()-e[0])),b.fix||(a.offsetTop=/%$/.test(a.offsetTop)?d.height()*parseFloat(a.offsetTop)/100:parseFloat(a.offsetTop),a.offsetLeft=/%$/.test(a.offsetLeft)?d.width()*parseFloat(a.offsetLeft)/100:parseFloat(a.offsetLeft),a.offsetTop+=d.scrollTop(),a.offsetLeft+=d.scrollLeft()),c.css({top:a.offsetTop,left:a.offsetLeft})},g.pt.tips=function(){var a=this,b=a.config,e=a.layero,f=[e.outerWidth(),e.outerHeight()],g=c(b.follow);g[0]||(g=c("body"));var i={width:g.outerWidth(),height:g.outerHeight(),top:g.offset().top,left:g.offset().left},j=e.find(".layui-layer-TipsG"),k=b.tips[0];b.tips[1]||j.remove(),i.autoLeft=function(){i.left+f[0]-d.width()>0?(i.tipLeft=i.left+i.width-f[0],j.css({right:12,left:"auto"})):i.tipLeft=i.left},i.where=[function(){i.autoLeft(),i.tipTop=i.top-f[1]-10,j.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",b.tips[1])},function(){i.tipLeft=i.left+i.width+10,i.tipTop=i.top,j.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",b.tips[1])},function(){i.autoLeft(),i.tipTop=i.top+i.height+10,j.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",b.tips[1])},function(){i.tipLeft=i.left-f[0]-10,i.tipTop=i.top,j.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",b.tips[1])}],i.where[k-1](),1===k?i.top-(d.scrollTop()+f[1]+16)<0&&i.where[2]():2===k?d.width()-(i.left+i.width+f[0]+16)>0||i.where[3]():3===k?i.top-d.scrollTop()+i.height+f[1]+16-d.height()>0&&i.where[0]():4===k&&f[0]+16-i.left>0&&i.where[1](),e.find("."+h[5]).css({"background-color":b.tips[1],"padding-right":b.closeBtn?"30px":""}),e.css({left:i.tipLeft,top:i.tipTop})},g.pt.move=function(){var a=this,b=a.config,e={setY:0,moveLayer:function(){var a=e.layero,b=parseInt(a.css("margin-left")),c=parseInt(e.move.css("left"));0===b||(c-=b),"fixed"!==a.css("position")&&(c-=a.parent().offset().left,e.setY=0),a.css({left:c,top:parseInt(e.move.css("top"))-e.setY})}},f=a.layero.find(b.move);return b.move&&f.attr("move","ok"),f.css({cursor:b.move?"move":"auto"}),c(b.move).on("mousedown",function(a){if(a.preventDefault(),"ok"===c(this).attr("move")){e.ismove=!0,e.layero=c(this).parents("."+h[0]);var f=e.layero.offset().left,g=e.layero.offset().top,i=e.layero.outerWidth()-6,j=e.layero.outerHeight()-6;c("#layui-layer-moves")[0]||c("body").append('<div id="layui-layer-moves" class="layui-layer-moves" style="left:'+f+"px; top:"+g+"px; width:"+i+"px; height:"+j+'px; z-index:2147483584"></div>'),e.move=c("#layui-layer-moves"),b.moveType&&e.move.css({visibility:"hidden"}),e.moveX=a.pageX-e.move.position().left,e.moveY=a.pageY-e.move.position().top,"fixed"!==e.layero.css("position")||(e.setY=d.scrollTop())}}),c(document).mousemove(function(a){if(e.ismove){var c=a.pageX-e.moveX,f=a.pageY-e.moveY;if(a.preventDefault(),!b.moveOut){e.setY=d.scrollTop();var g=d.width()-e.move.outerWidth(),h=e.setY;0>c&&(c=0),c>g&&(c=g),h>f&&(f=h),f>d.height()-e.move.outerHeight()+e.setY&&(f=d.height()-e.move.outerHeight()+e.setY)}e.move.css({left:c,top:f}),b.moveType&&e.moveLayer(),c=f=g=h=null}}).mouseup(function(){try{e.ismove&&(e.moveLayer(),e.move.remove(),b.moveEnd&&b.moveEnd()),e.ismove=!1}catch(a){e.ismove=!1}}),a},g.pt.callback=function(){function a(){var a=g.cancel&&g.cancel(b.index);a===!1||f.close(b.index)}var b=this,d=b.layero,g=b.config;b.openLayer(),g.success&&(2==g.type?d.find("iframe").on("load",function(){g.success(d,b.index)}):g.success(d,b.index)),f.ie6&&b.IE6(d),d.find("."+h[6]).children("a").on("click",function(){var e=c(this).index();g["btn"+(e+1)]&&g["btn"+(e+1)](b.index,d),0===e?g.yes?g.yes(b.index,d):f.close(b.index):1===e?a():g["btn"+(e+1)]||f.close(b.index)}),d.find("."+h[7]).on("click",a),g.shadeClose&&c("#layui-layer-shade"+b.index).on("click",function(){f.close(b.index)}),d.find(".layui-layer-min").on("click",function(){f.min(b.index,g),g.min&&g.min(d)}),d.find(".layui-layer-max").on("click",function(){c(this).hasClass("layui-layer-maxmin")?(f.restore(b.index),g.restore&&g.restore(d)):(f.full(b.index,g),g.full&&g.full(d))}),g.end&&(e.end[b.index]=g.end)},e.reselect=function(){c.each(c("select"),function(a,b){var d=c(this);d.parents("."+h[0])[0]||1==d.attr("layer")&&c("."+h[0]).length<1&&d.removeAttr("layer").show(),d=null})},g.pt.IE6=function(a){function b(){a.css({top:f+(e.config.fix?d.scrollTop():0)})}var e=this,f=a.offset().top;b(),d.scroll(b),c("select").each(function(a,b){var d=c(this);d.parents("."+h[0])[0]||"none"===d.css("display")||d.attr({layer:"1"}).hide(),d=null})},g.pt.openLayer=function(){var a=this;f.zIndex=a.config.zIndex,f.setTop=function(a){var b=function(){f.zIndex++,a.css("z-index",f.zIndex+1)};return f.zIndex=parseInt(a[0].style.zIndex),a.on("mousedown",b),f.zIndex}},e.record=function(a){var b=[a.outerWidth(),a.outerHeight(),a.position().top,a.position().left+parseFloat(a.css("margin-left"))];a.find(".layui-layer-max").addClass("layui-layer-maxmin"),a.attr({area:b})},e.rescollbar=function(a){h.html.attr("layer-full")==a&&(h.html[0].style.removeProperty?h.html[0].style.removeProperty("overflow"):h.html[0].style.removeAttribute("overflow"),h.html.removeAttr("layer-full"))},a.layer=f,f.getChildFrame=function(a,b){return b=b||c("."+h[4]).attr("times"),c("#"+h[0]+b).find("iframe").contents().find(a)},f.getFrameIndex=function(a){return c("#"+a).parents("."+h[4]).attr("times")},f.iframeAuto=function(a){if(a){var b=f.getChildFrame("html",a).outerHeight(),d=c("#"+h[0]+a),e=d.find(h[1]).outerHeight()||0,g=d.find("."+h[6]).outerHeight()||0;d.css({height:b+e+g}),d.find("iframe").css({height:b})}},f.iframeSrc=function(a,b){c("#"+h[0]+a).find("iframe").attr("src",b)},f.style=function(a,b){var d=c("#"+h[0]+a),f=d.attr("type"),g=d.find(h[1]).outerHeight()||0,i=d.find("."+h[6]).outerHeight()||0;(f===e.type[1]||f===e.type[2])&&(d.css(b),f===e.type[2]&&d.find("iframe").css({height:parseFloat(b.height)-g-i}))},f.min=function(a,b){var d=c("#"+h[0]+a),g=d.find(h[1]).outerHeight()||0;e.record(d),f.style(a,{width:180,height:g,overflow:"hidden"}),d.find(".layui-layer-min").hide(),"page"===d.attr("type")&&d.find(h[4]).hide(),e.rescollbar(a)},f.restore=function(a){var b=c("#"+h[0]+a),d=b.attr("area").split(",");b.attr("type");f.style(a,{width:parseFloat(d[0]),height:parseFloat(d[1]),top:parseFloat(d[2]),left:parseFloat(d[3]),overflow:"visible"}),b.find(".layui-layer-max").removeClass("layui-layer-maxmin"),b.find(".layui-layer-min").show(),"page"===b.attr("type")&&b.find(h[4]).show(),e.rescollbar(a)},f.full=function(a){var b,g=c("#"+h[0]+a);e.record(g),h.html.attr("layer-full")||h.html.css("overflow","hidden").attr("layer-full",a),clearTimeout(b),b=setTimeout(function(){var b="fixed"===g.css("position");f.style(a,{top:b?0:d.scrollTop(),left:b?0:d.scrollLeft(),width:d.width(),height:d.height()}),g.find(".layui-layer-min").hide()},100)},f.title=function(a,b){var d=c("#"+h[0]+(b||f.index)).find(h[1]);d.html(a)},f.close=function(a){var b=c("#"+h[0]+a),d=b.attr("type");if(b[0]){if(d===e.type[1]&&"object"===b.attr("conType")){b.children(":not(."+h[5]+")").remove();for(var g=0;2>g;g++)b.find(".layui-layer-wrap").unwrap().hide()}else{if(d===e.type[2])try{var i=c("#"+h[4]+a)[0];i.contentWindow.document.write(""),i.contentWindow.close(),b.find("."+h[5])[0].removeChild(i)}catch(j){}b[0].innerHTML="",b.remove()}c("#layui-layer-moves, #layui-layer-shade"+a).remove(),f.ie6&&e.reselect(),e.rescollbar(a),c(document).off("keydown",e.enter),"function"==typeof e.end[a]&&e.end[a](),delete e.end[a]}},f.closeAll=function(a){c.each(c("."+h[0]),function(){var b=c(this),d=a?b.attr("type")===a:1;d&&f.close(b.attr("times")),d=null})},e.run=function(){c=jQuery,d=c(a),h.html=c("html"),f.open=function(a){var b=new g(a);return b.index}},"function"==typeof define?define(function(){return e.run(),f}):function(){e.run(),f.use("skin/layer.css")}()}(window);
3 0 \ No newline at end of file
src/main/resources/static/assets/plugins/layer-v2.2/layer/skin/layer.css deleted 100644 → 0
1   -/*!
2   -
3   - @Name: layer's style
4   - @Author: 贤心
5   - @Blog: sentsin.com
6   -
7   - */*html{background-image:url(about:blank);background-attachment:fixed}html #layui_layer_skinlayercss{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{top:150px;left:50%;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;box-shadow:1px 1px 50px rgba(0,0,0,.3);border-radius:2px;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.3);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-moves{position:absolute;border:3px solid #666;border:3px solid rgba(0,0,0,.5);cursor:move;background-color:#fff;background-color:rgba(255,255,255,.3);filter:alpha(opacity=50)}.layui-layer-load{background:url(default/loading-0.gif) center center no-repeat #fff}.layui-layer-ico{background:url(default/icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layui-anim{-webkit-animation-name:bounceIn;animation-name:bounceIn}@-webkit-keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.03);transform:scale(1.03)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.03);-ms-transform:scale(1.03);transform:scale(1.03)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layui-anim-close{-webkit-animation-name:bounceOut;animation-name:bounceOut;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layui-anim-01{-webkit-animation-name:zoomInDown;animation-name:zoomInDown}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layui-anim-02{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}@-webkit-keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layui-anim-03{-webkit-animation-name:zoomInLeft;animation-name:zoomInLeft}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layui-anim-04{-webkit-animation-name:rollIn;animation-name:rollIn}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-anim-05{-webkit-animation-name:fadeIn;animation-name:fadeIn}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layui-anim-06{-webkit-animation-name:shake;animation-name:shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:#F8F8F8;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:0 -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 10px 12px;pointer-events:auto}.layui-layer-btn a{height:28px;line-height:28px;margin:0 6px;padding:0 15px;border:1px solid #dedede;background-color:#f1f1f1;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.7}.layui-layer-btn .layui-layer-btn0{border-color:#4898d5;background-color:#2e8ded;color:#fff}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;font-size:14px;overflow:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe .layui-layer-content{overflow:hidden}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(default/loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(default/loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(default/loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:5px 10px;font-size:12px;_float:left;border-radius:3px;box-shadow:1px 1px 3px rgba(0,0,0,.3);background-color:#F90;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#F90}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:1px;border-bottom-style:solid;border-bottom-color:#F90}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#BBB5B5;border:none}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}
8 0 \ No newline at end of file
src/main/resources/static/assets/plugins/layer-v2.2/layer/skin/layer.ext.css deleted 100644 → 0
1   -/*!
2   -
3   - @Name: layer拓展样式
4   - @Date: 2012.12.13
5   - @Author: 贤心
6   - @blog: sentsin.com
7   -
8   - */.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span{text-overflow:ellipsis;white-space:nowrap}.layui-layer-iconext{background:url(default/icon-ext.png) no-repeat}html #layui_layer_skinlayerextcss{display:none;position:absolute;width:1989px}.layui-layer-prompt .layui-layer-input{display:block;width:220px;height:30px;margin:0 auto;line-height:30px;padding:0 5px;border:1px solid #ccc;box-shadow:1px 1px 5px rgba(0,0,0,.1) inset;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;border-bottom:1px solid #ccc;background-color:#eee;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;cursor:default;overflow:hidden}.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{height:43px;border-left:1px solid #ccc;border-right:1px solid #ccc;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.xubox_tab_layer{display:block}.xubox_tabclose{position:absolute;right:10px;top:5px;cursor:pointer}.layui-layer-photos{-webkit-animation-duration:1s;animation-duration:1s}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}
9 0 \ No newline at end of file
src/main/resources/static/assets/plugins/layer-v2.4/demo.html 0 → 100644
  1 +<!doctype html>
  2 +<html>
  3 +<head>
  4 +<meta charset="utf-8">
  5 +<title>layer-更懂你的web弹窗解决方案</title>
  6 +<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
  7 +<script src="layer/layer.js"></script>
  8 +
  9 +<style>
  10 +html{background-color:#E3E3E3; font-size:14px; color:#000; font-family:'微软雅黑'}
  11 +a,a:hover{ text-decoration:none;}
  12 +pre{font-family:'微软雅黑'}
  13 +.box{padding:20px; background-color:#fff; margin:50px 100px; border-radius:5px;}
  14 +.box a{padding-right:15px;}
  15 +#about_hide{display:none}
  16 +.layer_text{background-color:#fff; padding:20px;}
  17 +.layer_text p{margin-bottom: 10px; text-indent: 2em; line-height: 23px;}
  18 +.button{display:inline-block; *display:inline; *zoom:1; line-height:30px; padding:0 20px; background-color:#56B4DC; color:#fff; font-size:14px; border-radius:3px; cursor:pointer; font-weight:normal;}
  19 +.photos-demo img{width:200px;}
  20 +</style>
  21 +</head>
  22 +<body>
  23 +<div class="box">
  24 +<pre>
  25 + @Name:layer-v<script>document.write(layer.v)</script> 弹层组件说明
  26 + @Author:贤心
  27 + @Site:<a href="http://layer.layui.com/?form=local" target="_blank">http://layer.layui.com</a>
  28 + @Github:<a href="https://github.com/sentsin/layer" target="_blank">https://github.com/sentsin/layer</a>
  29 +
  30 +
  31 +<strong>【注意事项】</strong>
  32 +一、使用时,请把文件夹layer整个放置在您站点的任何一个目录,只需引入layer.js即可,除jQuery外,其它文件无需再引入。
  33 +二、如果您的js引入是通过合并处理或者您不想采用layer自动获取的绝对路径,您可以通过layer.config()来配置(详见官网API页)
  34 +三、jQuery最低要求1.8
  35 +四、更多使用说明与演示,请参见layer官网。
  36 +五、请勿用于虚假诈骗、及违反我国法律的Web平台。这一点非常重要非常的重要!
  37 +六、layer遵循LGPL协议,将永久性提供无偿服务。版权最终解释权:贤心。
  38 +</pre>
  39 +</div>
  40 +
  41 +<div class="box">
  42 + <h2 style="padding-bottom:20px;">扩展模块:图片查看器(相册层)</h2>
  43 + <div id="photosDemo" class="photos-demo">
  44 + <!-- layer-src表示大图 layer-pid表示图片id src表示缩略图-->
  45 +
  46 + <img layer-src="http://static.oschina.net/uploads/space/2014/0516/012728_nAh8_1168184.jpg" layer-pid="" src="http://static.oschina.net/uploads/space/2014/0516/012728_nAh8_1168184.jpg" alt="layer宣传图">
  47 + <img layer-src="http://sentsin.qiniudn.com/sentsinmy5.jpg" layer-pid="" src="http://sentsin.qiniudn.com/sentsinmy5.jpg" alt="我入互联网这五年">
  48 + <img layer-src="" layer-pid="" src="http://sentsin.qiniudn.com/sentsin_39101a660cf4671b7ec297a74cc652c74152104f.jpg" alt="微摄影">
  49 + <img layer-src="http://sentsin.qiniudn.com/sentsinsan01.jpg" layer-pid="" src="http://sentsin.qiniudn.com/sentsinsan01.jpg" alt="三清山">
  50 + <img layer-src="http://ww2.sinaimg.cn/mw1024/5db11ff4jw1ehcyirr6quj20q00ex42w.jpg" layer-pid="" src="http://ww2.sinaimg.cn/mw1024/5db11ff4jw1ehcyirr6quj20q00ex42w.jpg" alt="国足">
  51 + </div>
  52 +
  53 +</div>
  54 +
  55 +
  56 +<div class="box" style="text-align:center">
  57 + <a href="http://layer.layui.com/?form=local" target="_blank">更多示例</a>
  58 + <a href="http://layer.layui.com/api.html" target="_blank">使用文档</a>
  59 + <a href="http://fly.layui.com" target="_blank" title="Fly">交流反馈</a>
  60 + <a href="javascript:;" id="about">关于</a>
  61 +</div>
  62 +
  63 +<script>
  64 +;!function(){
  65 +
  66 +//页面一打开就执行,放入ready是为了layer所需配件(css、扩展模块)加载完毕
  67 +layer.ready(function(){
  68 + //官网欢迎页
  69 + layer.open({
  70 + type: 2,
  71 + //skin: 'layui-layer-lan',
  72 + title: 'layer弹层组件',
  73 + fix: false,
  74 + shadeClose: true,
  75 + maxmin: true,
  76 + area: ['1000px', '500px'],
  77 + content: 'http://layer.layui.com/?form=local',
  78 + end: function(){
  79 + layer.tips('试试相册模块?', '#photosDemo', {tips: 1})
  80 + }
  81 + });
  82 +
  83 + //layer.msg('欢迎使用layer');
  84 +
  85 + //使用相册
  86 + layer.photos({
  87 + photos: '#photosDemo'
  88 + });
  89 +});
  90 +
  91 +//关于
  92 +$('#about').on('click', function(){
  93 + layer.alert(layer.v + ' - 贤心出品');
  94 +});
  95 +
  96 +}();
  97 +</script>
  98 +</body>
  99 +</html>
0 100 \ No newline at end of file
... ...
src/main/resources/static/assets/plugins/layer-v2.4/layer/layer.js 0 → 100644
  1 +/*! layer-v2.4 弹层组件 License LGPL http://layer.layui.com/ By 贤心 */
  2 +;!function(a,b){"use strict";var c,d,e={getPath:function(){var a=document.scripts,b=a[a.length-1],c=b.src;if(!b.getAttribute("merge"))return c.substring(0,c.lastIndexOf("/")+1)}(),enter:function(a){13===a.keyCode&&a.preventDefault()},config:{},end:{},btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],type:["dialog","page","iframe","loading","tips"]},f={v:"2.4",ie6:!!a.ActiveXObject&&!a.XMLHttpRequest,index:0,path:e.getPath,config:function(a,b){var d=0;return a=a||{},f.cache=e.config=c.extend(e.config,a),f.path=e.config.path||f.path,"string"==typeof a.extend&&(a.extend=[a.extend]),f.use("skin/layer.css",a.extend&&a.extend.length>0?function g(){var c=a.extend;f.use(c[c[d]?d:d-1],d<c.length?function(){return++d,g}():b)}():b),this},use:function(a,b,d){var e=c("head")[0],a=a.replace(/\s/g,""),g=/\.css$/.test(a),h=document.createElement(g?"link":"script"),i="layui_layer_"+a.replace(/\.|\//g,"");return f.path?(g&&(h.rel="stylesheet"),h[g?"href":"src"]=/^http:\/\//.test(a)?a:f.path+a,h.id=i,c("#"+i)[0]||e.appendChild(h),function j(){(g?1989===parseInt(c("#"+i).css("width")):f[d||i])?function(){b&&b();try{g||e.removeChild(h)}catch(a){}}():setTimeout(j,100)}(),this):void 0},ready:function(a,b){var d="function"==typeof a;return d&&(b=a),f.config(c.extend(e.config,function(){return d?{}:{path:a}}()),b),this},alert:function(a,b,d){var e="function"==typeof b;return e&&(d=b),f.open(c.extend({content:a,yes:d},e?{}:b))},confirm:function(a,b,d,g){var h="function"==typeof b;return h&&(g=d,d=b),f.open(c.extend({content:a,btn:e.btn,yes:d,btn2:g},h?{}:b))},msg:function(a,d,g){var i="function"==typeof d,j=e.config.skin,k=(j?j+" "+j+"-msg":"")||"layui-layer-msg",l=h.anim.length-1;return i&&(g=d),f.open(c.extend({content:a,time:3e3,shade:!1,skin:k,title:!1,closeBtn:!1,btn:!1,end:g},i&&!e.config.skin?{skin:k+" layui-layer-hui",shift:l}:function(){return d=d||{},(-1===d.icon||d.icon===b&&!e.config.skin)&&(d.skin=k+" "+(d.skin||"layui-layer-hui")),d}()))},load:function(a,b){return f.open(c.extend({type:3,icon:a||0,shade:.01},b))},tips:function(a,b,d){return f.open(c.extend({type:4,content:[a,b],closeBtn:!1,time:3e3,shade:!1,fix:!1,maxWidth:210},d))}},g=function(a){var b=this;b.index=++f.index,b.config=c.extend({},b.config,e.config,a),b.creat()};g.pt=g.prototype;var h=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];h.anim=["layer-anim","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],g.pt.config={type:0,shade:.3,fix:!0,move:h[1],title:"&#x4FE1;&#x606F;",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,shift:0,icon:-1,scrollbar:!0,tips:2},g.pt.vessel=function(a,b){var c=this,d=c.index,f=c.config,g=f.zIndex+d,i="object"==typeof f.title,j=f.maxmin&&(1===f.type||2===f.type),k=f.title?'<div class="layui-layer-title" style="'+(i?f.title[1]:"")+'">'+(i?f.title[0]:f.title)+"</div>":"";return f.zIndex=g,b([f.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+d+'" times="'+d+'" style="'+("z-index:"+(g-1)+"; background-color:"+(f.shade[1]||"#000")+"; opacity:"+(f.shade[0]||f.shade)+"; filter:alpha(opacity="+(100*f.shade[0]||100*f.shade)+");")+'"></div>':"",'<div class="'+h[0]+(" layui-layer-"+e.type[f.type])+(0!=f.type&&2!=f.type||f.shade?"":" layui-layer-border")+" "+(f.skin||"")+'" id="'+h[0]+d+'" type="'+e.type[f.type]+'" times="'+d+'" showtime="'+f.time+'" conType="'+(a?"object":"string")+'" style="z-index: '+g+"; width:"+f.area[0]+";height:"+f.area[1]+(f.fix?"":";position:absolute;")+'">'+(a&&2!=f.type?"":k)+'<div id="'+(f.id||"")+'" class="layui-layer-content'+(0==f.type&&-1!==f.icon?" layui-layer-padding":"")+(3==f.type?" layui-layer-loading"+f.icon:"")+'">'+(0==f.type&&-1!==f.icon?'<i class="layui-layer-ico layui-layer-ico'+f.icon+'"></i>':"")+(1==f.type&&a?"":f.content||"")+'</div><span class="layui-layer-setwin">'+function(){var a=j?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return f.closeBtn&&(a+='<a class="layui-layer-ico '+h[7]+" "+h[7]+(f.title?f.closeBtn:4==f.type?"1":"2")+'" href="javascript:;"></a>'),a}()+"</span>"+(f.btn?function(){var a="";"string"==typeof f.btn&&(f.btn=[f.btn]);for(var b=0,c=f.btn.length;c>b;b++)a+='<a class="'+h[6]+b+'">'+f.btn[b]+"</a>";return'<div class="'+h[6]+'">'+a+"</div>"}():"")+"</div>"],k),c},g.pt.creat=function(){var a=this,b=a.config,g=a.index,i=b.content,j="object"==typeof i;if(!c("#"+b.id)[0]){switch("string"==typeof b.area&&(b.area="auto"===b.area?["",""]:[b.area,""]),b.type){case 0:b.btn="btn"in b?b.btn:e.btn[0],f.closeAll("dialog");break;case 2:var i=b.content=j?b.content:[b.content||"http://layer.layui.com","auto"];b.content='<iframe scrolling="'+(b.content[1]||"auto")+'" allowtransparency="true" id="'+h[4]+g+'" name="'+h[4]+g+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+b.content[0]+'"></iframe>';break;case 3:b.title=!1,b.closeBtn=!1,-1===b.icon&&0===b.icon,f.closeAll("loading");break;case 4:j||(b.content=[b.content,"body"]),b.follow=b.content[1],b.content=b.content[0]+'<i class="layui-layer-TipsG"></i>',b.title=!1,b.tips="object"==typeof b.tips?b.tips:[b.tips,!0],b.tipsMore||f.closeAll("tips")}a.vessel(j,function(d,e){c("body").append(d[0]),j?function(){2==b.type||4==b.type?function(){c("body").append(d[1])}():function(){i.parents("."+h[0])[0]||(i.show().addClass("layui-layer-wrap").wrap(d[1]),c("#"+h[0]+g).find("."+h[5]).before(e))}()}():c("body").append(d[1]),a.layero=c("#"+h[0]+g),b.scrollbar||h.html.css("overflow","hidden").attr("layer-full",g)}).auto(g),2==b.type&&f.ie6&&a.layero.find("iframe").attr("src",i[0]),c(document).off("keydown",e.enter).on("keydown",e.enter),a.layero.on("keydown",function(a){c(document).off("keydown",e.enter)}),4==b.type?a.tips():a.offset(),b.fix&&d.on("resize",function(){a.offset(),(/^\d+%$/.test(b.area[0])||/^\d+%$/.test(b.area[1]))&&a.auto(g),4==b.type&&a.tips()}),b.time<=0||setTimeout(function(){f.close(a.index)},b.time),a.move().callback(),h.anim[b.shift]&&a.layero.addClass(h.anim[b.shift])}},g.pt.auto=function(a){function b(a){a=g.find(a),a.height(i[1]-j-k-2*(0|parseFloat(a.css("padding"))))}var e=this,f=e.config,g=c("#"+h[0]+a);""===f.area[0]&&f.maxWidth>0&&(/MSIE 7/.test(navigator.userAgent)&&f.btn&&g.width(g.innerWidth()),g.outerWidth()>f.maxWidth&&g.width(f.maxWidth));var i=[g.innerWidth(),g.innerHeight()],j=g.find(h[1]).outerHeight()||0,k=g.find("."+h[6]).outerHeight()||0;switch(f.type){case 2:b("iframe");break;default:""===f.area[1]?f.fix&&i[1]>=d.height()&&(i[1]=d.height(),b("."+h[5])):b("."+h[5])}return e},g.pt.offset=function(){var a=this,b=a.config,c=a.layero,e=[c.outerWidth(),c.outerHeight()],f="object"==typeof b.offset;a.offsetTop=(d.height()-e[1])/2,a.offsetLeft=(d.width()-e[0])/2,f?(a.offsetTop=b.offset[0],a.offsetLeft=b.offset[1]||a.offsetLeft):"auto"!==b.offset&&(a.offsetTop=b.offset,"rb"===b.offset&&(a.offsetTop=d.height()-e[1],a.offsetLeft=d.width()-e[0])),b.fix||(a.offsetTop=/%$/.test(a.offsetTop)?d.height()*parseFloat(a.offsetTop)/100:parseFloat(a.offsetTop),a.offsetLeft=/%$/.test(a.offsetLeft)?d.width()*parseFloat(a.offsetLeft)/100:parseFloat(a.offsetLeft),a.offsetTop+=d.scrollTop(),a.offsetLeft+=d.scrollLeft()),c.css({top:a.offsetTop,left:a.offsetLeft})},g.pt.tips=function(){var a=this,b=a.config,e=a.layero,f=[e.outerWidth(),e.outerHeight()],g=c(b.follow);g[0]||(g=c("body"));var i={width:g.outerWidth(),height:g.outerHeight(),top:g.offset().top,left:g.offset().left},j=e.find(".layui-layer-TipsG"),k=b.tips[0];b.tips[1]||j.remove(),i.autoLeft=function(){i.left+f[0]-d.width()>0?(i.tipLeft=i.left+i.width-f[0],j.css({right:12,left:"auto"})):i.tipLeft=i.left},i.where=[function(){i.autoLeft(),i.tipTop=i.top-f[1]-10,j.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",b.tips[1])},function(){i.tipLeft=i.left+i.width+10,i.tipTop=i.top,j.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",b.tips[1])},function(){i.autoLeft(),i.tipTop=i.top+i.height+10,j.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",b.tips[1])},function(){i.tipLeft=i.left-f[0]-10,i.tipTop=i.top,j.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",b.tips[1])}],i.where[k-1](),1===k?i.top-(d.scrollTop()+f[1]+16)<0&&i.where[2]():2===k?d.width()-(i.left+i.width+f[0]+16)>0||i.where[3]():3===k?i.top-d.scrollTop()+i.height+f[1]+16-d.height()>0&&i.where[0]():4===k&&f[0]+16-i.left>0&&i.where[1](),e.find("."+h[5]).css({"background-color":b.tips[1],"padding-right":b.closeBtn?"30px":""}),e.css({left:i.tipLeft-(b.fix?d.scrollLeft():0),top:i.tipTop-(b.fix?d.scrollTop():0)})},g.pt.move=function(){var a=this,b=a.config,e={setY:0,moveLayer:function(){var a=e.layero,b=parseInt(a.css("margin-left")),c=parseInt(e.move.css("left"));0===b||(c-=b),"fixed"!==a.css("position")&&(c-=a.parent().offset().left,e.setY=0),a.css({left:c,top:parseInt(e.move.css("top"))-e.setY})}},f=a.layero.find(b.move);return b.move&&f.attr("move","ok"),f.css({cursor:b.move?"move":"auto"}),c(b.move).on("mousedown",function(a){if(a.preventDefault(),"ok"===c(this).attr("move")){e.ismove=!0,e.layero=c(this).parents("."+h[0]);var f=e.layero.offset().left,g=e.layero.offset().top,i=e.layero.outerWidth()-6,j=e.layero.outerHeight()-6;c("#layui-layer-moves")[0]||c("body").append('<div id="layui-layer-moves" class="layui-layer-moves" style="left:'+f+"px; top:"+g+"px; width:"+i+"px; height:"+j+'px; z-index:2147483584"></div>'),e.move=c("#layui-layer-moves"),b.moveType&&e.move.css({visibility:"hidden"}),e.moveX=a.pageX-e.move.position().left,e.moveY=a.pageY-e.move.position().top,"fixed"!==e.layero.css("position")||(e.setY=d.scrollTop())}}),c(document).mousemove(function(a){if(e.ismove){var c=a.pageX-e.moveX,f=a.pageY-e.moveY;if(a.preventDefault(),!b.moveOut){e.setY=d.scrollTop();var g=d.width()-e.move.outerWidth(),h=e.setY;0>c&&(c=0),c>g&&(c=g),h>f&&(f=h),f>d.height()-e.move.outerHeight()+e.setY&&(f=d.height()-e.move.outerHeight()+e.setY)}e.move.css({left:c,top:f}),b.moveType&&e.moveLayer(),c=f=g=h=null}}).mouseup(function(){try{e.ismove&&(e.moveLayer(),e.move.remove(),b.moveEnd&&b.moveEnd()),e.ismove=!1}catch(a){e.ismove=!1}}),a},g.pt.callback=function(){function a(){var a=g.cancel&&g.cancel(b.index,d);a===!1||f.close(b.index)}var b=this,d=b.layero,g=b.config;b.openLayer(),g.success&&(2==g.type?d.find("iframe").on("load",function(){g.success(d,b.index)}):g.success(d,b.index)),f.ie6&&b.IE6(d),d.find("."+h[6]).children("a").on("click",function(){var a=c(this).index();if(0===a)g.yes?g.yes(b.index,d):g.btn1?g.btn1(b.index,d):f.close(b.index);else{var e=g["btn"+(a+1)]&&g["btn"+(a+1)](b.index,d);e===!1||f.close(b.index)}}),d.find("."+h[7]).on("click",a),g.shadeClose&&c("#layui-layer-shade"+b.index).on("click",function(){f.close(b.index)}),d.find(".layui-layer-min").on("click",function(){var a=g.min&&g.min(d);a===!1||f.min(b.index,g)}),d.find(".layui-layer-max").on("click",function(){c(this).hasClass("layui-layer-maxmin")?(f.restore(b.index),g.restore&&g.restore(d)):(f.full(b.index,g),setTimeout(function(){g.full&&g.full(d)},100))}),g.end&&(e.end[b.index]=g.end)},e.reselect=function(){c.each(c("select"),function(a,b){var d=c(this);d.parents("."+h[0])[0]||1==d.attr("layer")&&c("."+h[0]).length<1&&d.removeAttr("layer").show(),d=null})},g.pt.IE6=function(a){function b(){a.css({top:f+(e.config.fix?d.scrollTop():0)})}var e=this,f=a.offset().top;b(),d.scroll(b),c("select").each(function(a,b){var d=c(this);d.parents("."+h[0])[0]||"none"===d.css("display")||d.attr({layer:"1"}).hide(),d=null})},g.pt.openLayer=function(){var a=this;f.zIndex=a.config.zIndex,f.setTop=function(a){var b=function(){f.zIndex++,a.css("z-index",f.zIndex+1)};return f.zIndex=parseInt(a[0].style.zIndex),a.on("mousedown",b),f.zIndex}},e.record=function(a){var b=[a.width(),a.height(),a.position().top,a.position().left+parseFloat(a.css("margin-left"))];a.find(".layui-layer-max").addClass("layui-layer-maxmin"),a.attr({area:b})},e.rescollbar=function(a){h.html.attr("layer-full")==a&&(h.html[0].style.removeProperty?h.html[0].style.removeProperty("overflow"):h.html[0].style.removeAttribute("overflow"),h.html.removeAttr("layer-full"))},a.layer=f,f.getChildFrame=function(a,b){return b=b||c("."+h[4]).attr("times"),c("#"+h[0]+b).find("iframe").contents().find(a)},f.getFrameIndex=function(a){return c("#"+a).parents("."+h[4]).attr("times")},f.iframeAuto=function(a){if(a){var b=f.getChildFrame("html",a).outerHeight(),d=c("#"+h[0]+a),e=d.find(h[1]).outerHeight()||0,g=d.find("."+h[6]).outerHeight()||0;d.css({height:b+e+g}),d.find("iframe").css({height:b})}},f.iframeSrc=function(a,b){c("#"+h[0]+a).find("iframe").attr("src",b)},f.style=function(a,b){var d=c("#"+h[0]+a),f=d.attr("type"),g=d.find(h[1]).outerHeight()||0,i=d.find("."+h[6]).outerHeight()||0;(f===e.type[1]||f===e.type[2])&&(d.css(b),f===e.type[2]&&d.find("iframe").css({height:parseFloat(b.height)-g-i}))},f.min=function(a,b){var d=c("#"+h[0]+a),g=d.find(h[1]).outerHeight()||0;e.record(d),f.style(a,{width:180,height:g,overflow:"hidden"}),d.find(".layui-layer-min").hide(),"page"===d.attr("type")&&d.find(h[4]).hide(),e.rescollbar(a)},f.restore=function(a){var b=c("#"+h[0]+a),d=b.attr("area").split(",");b.attr("type");f.style(a,{width:parseFloat(d[0]),height:parseFloat(d[1]),top:parseFloat(d[2]),left:parseFloat(d[3]),overflow:"visible"}),b.find(".layui-layer-max").removeClass("layui-layer-maxmin"),b.find(".layui-layer-min").show(),"page"===b.attr("type")&&b.find(h[4]).show(),e.rescollbar(a)},f.full=function(a){var b,g=c("#"+h[0]+a);e.record(g),h.html.attr("layer-full")||h.html.css("overflow","hidden").attr("layer-full",a),clearTimeout(b),b=setTimeout(function(){var b="fixed"===g.css("position");f.style(a,{top:b?0:d.scrollTop(),left:b?0:d.scrollLeft(),width:d.width(),height:d.height()}),g.find(".layui-layer-min").hide()},100)},f.title=function(a,b){var d=c("#"+h[0]+(b||f.index)).find(h[1]);d.html(a)},f.close=function(a){var b=c("#"+h[0]+a),d=b.attr("type");if(b[0]){if(d===e.type[1]&&"object"===b.attr("conType")){b.children(":not(."+h[5]+")").remove();for(var g=0;2>g;g++)b.find(".layui-layer-wrap").unwrap().hide()}else{if(d===e.type[2])try{var i=c("#"+h[4]+a)[0];i.contentWindow.document.write(""),i.contentWindow.close(),b.find("."+h[5])[0].removeChild(i)}catch(j){}b[0].innerHTML="",b.remove()}c("#layui-layer-moves, #layui-layer-shade"+a).remove(),f.ie6&&e.reselect(),e.rescollbar(a),c(document).off("keydown",e.enter),"function"==typeof e.end[a]&&e.end[a](),delete e.end[a]}},f.closeAll=function(a){c.each(c("."+h[0]),function(){var b=c(this),d=a?b.attr("type")===a:1;d&&f.close(b.attr("times")),d=null})};var i=f.cache||{},j=function(a){return i.skin?" "+i.skin+" "+i.skin+"-"+a:""};f.prompt=function(a,b){a=a||{},"function"==typeof a&&(b=a);var d,e=2==a.formType?'<textarea class="layui-layer-input">'+(a.value||"")+"</textarea>":function(){return'<input type="'+(1==a.formType?"password":"text")+'" class="layui-layer-input" value="'+(a.value||"")+'">'}();return f.open(c.extend({btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:e,skin:"layui-layer-prompt"+j("prompt"),success:function(a){d=a.find(".layui-layer-input"),d.focus()},yes:function(c){var e=d.val();""===e?d.focus():e.length>(a.maxlength||500)?f.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(a.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",d,{tips:1}):b&&b(e,c,d)}},a))},f.tab=function(a){a=a||{};var b=a.tab||{};return f.open(c.extend({type:1,skin:"layui-layer-tab"+j("tab"),title:function(){var a=b.length,c=1,d="";if(a>0)for(d='<span class="layui-layer-tabnow">'+b[0].title+"</span>";a>c;c++)d+="<span>"+b[c].title+"</span>";return d}(),content:'<ul class="layui-layer-tabmain">'+function(){var a=b.length,c=1,d="";if(a>0)for(d='<li class="layui-layer-tabli xubox_tab_layer">'+(b[0].content||"no content")+"</li>";a>c;c++)d+='<li class="layui-layer-tabli">'+(b[c].content||"no content")+"</li>";return d}()+"</ul>",success:function(b){var d=b.find(".layui-layer-title").children(),e=b.find(".layui-layer-tabmain").children();d.on("mousedown",function(b){b.stopPropagation?b.stopPropagation():b.cancelBubble=!0;var d=c(this),f=d.index();d.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),e.eq(f).show().siblings().hide(),"function"==typeof a.change&&a.change(f)})}},a))},f.photos=function(b,d,e){function g(a,b,c){var d=new Image;return d.src=a,d.complete?b(d):(d.onload=function(){d.onload=null,b(d)},void(d.onerror=function(a){d.onerror=null,c(a)}))}var h={};if(b=b||{},b.photos){var i=b.photos.constructor===Object,k=i?b.photos:{},l=k.data||[],m=k.start||0;if(h.imgIndex=(0|m)+1,b.img=b.img||"img",i){if(0===l.length)return f.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var n=c(b.photos),o=function(){l=[],n.find(b.img).each(function(a){var b=c(this);b.attr("layer-index",a),l.push({alt:b.attr("alt"),pid:b.attr("layer-pid"),src:b.attr("layer-src")||b.attr("src"),thumb:b.attr("src")})})};if(o(),0===l.length)return;if(d||n.on("click",b.img,function(){var a=c(this),d=a.attr("layer-index");f.photos(c.extend(b,{photos:{start:d,data:l,tab:b.tab},full:b.full}),!0),o()}),!d)return}h.imgprev=function(a){h.imgIndex--,h.imgIndex<1&&(h.imgIndex=l.length),h.tabimg(a)},h.imgnext=function(a,b){h.imgIndex++,h.imgIndex>l.length&&(h.imgIndex=1,b)||h.tabimg(a)},h.keyup=function(a){if(!h.end){var b=a.keyCode;a.preventDefault(),37===b?h.imgprev(!0):39===b?h.imgnext(!0):27===b&&f.close(h.index)}},h.tabimg=function(a){l.length<=1||(k.start=h.imgIndex-1,f.close(h.index),f.photos(b,!0,a))},h.event=function(){h.bigimg.hover(function(){h.imgsee.show()},function(){h.imgsee.hide()}),h.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),h.imgprev()}),h.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),h.imgnext()}),c(document).on("keyup",h.keyup)},h.loadi=f.load(1,{shade:"shade"in b?!1:.9,scrollbar:!1}),g(l[m].src,function(d){f.close(h.loadi),h.index=f.open(c.extend({type:1,area:function(){var e=[d.width,d.height],f=[c(a).width()-50,c(a).height()-50];return!b.full&&e[0]>f[0]&&(e[0]=f[0],e[1]=e[0]*d.height/d.width),[e[0]+"px",e[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos"+j("photos"),content:'<div class="layui-layer-phimg"><img src="'+l[m].src+'" alt="'+(l[m].alt||"")+'" layer-pid="'+l[m].pid+'"><div class="layui-layer-imgsee">'+(l.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(e?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(l[m].alt||"")+"</a><em>"+h.imgIndex+"/"+l.length+"</em></span></div></div></div>",success:function(a,c){h.bigimg=a.find(".layui-layer-phimg"),h.imgsee=a.find(".layui-layer-imguide,.layui-layer-imgbar"),h.event(a),b.tab&&b.tab(l[m],a)},end:function(){h.end=!0,c(document).off("keyup",h.keyup)}},b))},function(){f.close(h.loadi),f.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["&#x4E0B;&#x4E00;&#x5F20;","&#x4E0D;&#x770B;&#x4E86;"],yes:function(){l.length>1&&h.imgnext(!0,!0)}})})}},e.run=function(){c=jQuery,d=c(a),h.html=c("html"),f.open=function(a){var b=new g(a);return b.index}},"function"==typeof define?define(function(){return e.run(),f}):function(){e.run(),f.use("skin/layer.css")}()}(window);
0 3 \ No newline at end of file
... ...
src/main/resources/static/assets/plugins/layer-v2.2/layer/skin/default/icon-ext.png renamed to src/main/resources/static/assets/plugins/layer-v2.4/layer/skin/default/icon-ext.png

5.77 KB

src/main/resources/static/assets/plugins/layer-v2.2/layer/skin/default/icon.png renamed to src/main/resources/static/assets/plugins/layer-v2.4/layer/skin/default/icon.png

11.2 KB

src/main/resources/static/assets/plugins/layer-v2.2/layer/skin/default/loading-0.gif renamed to src/main/resources/static/assets/plugins/layer-v2.4/layer/skin/default/loading-0.gif

5.66 KB

src/main/resources/static/assets/plugins/layer-v2.2/layer/skin/default/loading-1.gif renamed to src/main/resources/static/assets/plugins/layer-v2.4/layer/skin/default/loading-1.gif

701 Bytes

src/main/resources/static/assets/plugins/layer-v2.2/layer/skin/default/loading-2.gif renamed to src/main/resources/static/assets/plugins/layer-v2.4/layer/skin/default/loading-2.gif

1.75 KB

src/main/resources/static/assets/plugins/layer-v2.4/layer/skin/layer.css 0 → 100644
  1 +/*!
  2 +
  3 + @Name: layer's style
  4 + @Author: 贤心
  5 + @Blog: sentsin.com
  6 +
  7 + */.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap}*html{background-image:url(about:blank);background-attachment:fixed}html #layui_layer_skinlayercss{display:none;position:absolute;width:1989px}.layui-layer,.layui-layer-shade{position:fixed;_position:absolute;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;_height:expression(document.body.offsetHeight+"px")}.layui-layer{-webkit-overflow-scrolling:touch;top:150px;left:0;margin:0;padding:0;background-color:#fff;-webkit-background-clip:content;box-shadow:1px 1px 50px rgba(0,0,0,.3);border-radius:2px;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.3s;animation-duration:.3s}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #B2B2B2;border:1px solid rgba(0,0,0,.3);box-shadow:1px 1px 5px rgba(0,0,0,.2)}.layui-layer-moves{position:absolute;border:3px solid #666;border:3px solid rgba(0,0,0,.5);cursor:move;background-color:#fff;background-color:rgba(255,255,255,.3);filter:alpha(opacity=50)}.layui-layer-load{background:url(default/loading-0.gif) center center no-repeat #fff}.layui-layer-ico{background:url(default/icon.png) no-repeat}.layui-layer-btn a,.layui-layer-dialog .layui-layer-ico,.layui-layer-setwin a{display:inline-block;*display:inline;*zoom:1;vertical-align:top}@-webkit-keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceIn{0%{opacity:0;-webkit-transform:scale(.5);-ms-transform:scale(.5);transform:scale(.5)}100%{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim{-webkit-animation-name:bounceIn;animation-name:bounceIn}@-webkit-keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.03);transform:scale(1.03)}0%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounceOut{100%{opacity:0;-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7)}30%{-webkit-transform:scale(1.03);-ms-transform:scale(1.03);transform:scale(1.03)}0%{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}}.layer-anim-close{-webkit-animation-name:bounceOut;animation-name:bounceOut;-webkit-animation-duration:.2s;animation-duration:.2s}@-webkit-keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInDown{0%{opacity:0;-webkit-transform:scale(.1) translateY(-2000px);-ms-transform:scale(.1) translateY(-2000px);transform:scale(.1) translateY(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateY(60px);-ms-transform:scale(.475) translateY(60px);transform:scale(.475) translateY(60px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-01{-webkit-animation-name:zoomInDown;animation-name:zoomInDown}@-webkit-keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes fadeInUpBig{0%{opacity:0;-webkit-transform:translateY(2000px);-ms-transform:translateY(2000px);transform:translateY(2000px)}100%{opacity:1;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}}.layer-anim-02{-webkit-animation-name:fadeInUpBig;animation-name:fadeInUpBig}@-webkit-keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes zoomInLeft{0%{opacity:0;-webkit-transform:scale(.1) translateX(-2000px);-ms-transform:scale(.1) translateX(-2000px);transform:scale(.1) translateX(-2000px);-webkit-animation-timing-function:ease-in-out;animation-timing-function:ease-in-out}60%{opacity:1;-webkit-transform:scale(.475) translateX(48px);-ms-transform:scale(.475) translateX(48px);transform:scale(.475) translateX(48px);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.layer-anim-03{-webkit-animation-name:zoomInLeft;animation-name:zoomInLeft}@-webkit-keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}@keyframes rollIn{0%{opacity:0;-webkit-transform:translateX(-100%) rotate(-120deg);-ms-transform:translateX(-100%) rotate(-120deg);transform:translateX(-100%) rotate(-120deg)}100%{opacity:1;-webkit-transform:translateX(0) rotate(0);-ms-transform:translateX(0) rotate(0);transform:translateX(0) rotate(0)}}.layer-anim-04{-webkit-animation-name:rollIn;animation-name:rollIn}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layer-anim-05{-webkit-animation-name:fadeIn;animation-name:fadeIn}@-webkit-keyframes shake{0%,100%{-webkit-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);transform:translateX(10px)}}@keyframes shake{0%,100%{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}10%,30%,50%,70%,90%{-webkit-transform:translateX(-10px);-ms-transform:translateX(-10px);transform:translateX(-10px)}20%,40%,60%,80%{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px)}}.layer-anim-06{-webkit-animation-name:shake;animation-name:shake}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}.layui-layer-title{padding:0 80px 0 20px;height:42px;line-height:42px;border-bottom:1px solid #eee;font-size:14px;color:#333;overflow:hidden;background-color:#F8F8F8;border-radius:2px 2px 0 0}.layui-layer-setwin{position:absolute;right:15px;*right:0;top:15px;font-size:0;line-height:initial}.layui-layer-setwin a{position:relative;width:16px;height:16px;margin-left:10px;font-size:12px;_overflow:hidden}.layui-layer-setwin .layui-layer-min cite{position:absolute;width:14px;height:2px;left:0;top:50%;margin-top:-1px;background-color:#2E2D3C;cursor:pointer;_overflow:hidden}.layui-layer-setwin .layui-layer-min:hover cite{background-color:#2D93CA}.layui-layer-setwin .layui-layer-max{background-position:-32px -40px}.layui-layer-setwin .layui-layer-max:hover{background-position:-16px -40px}.layui-layer-setwin .layui-layer-maxmin{background-position:-65px -40px}.layui-layer-setwin .layui-layer-maxmin:hover{background-position:-49px -40px}.layui-layer-setwin .layui-layer-close1{background-position:0 -40px;cursor:pointer}.layui-layer-setwin .layui-layer-close1:hover{opacity:.7}.layui-layer-setwin .layui-layer-close2{position:absolute;right:-28px;top:-28px;width:30px;height:30px;margin-left:0;background-position:-149px -31px;*right:-18px;_display:none}.layui-layer-setwin .layui-layer-close2:hover{background-position:-180px -31px}.layui-layer-btn{text-align:right;padding:0 10px 12px;pointer-events:auto}.layui-layer-btn a{height:28px;line-height:28px;margin:0 6px;padding:0 15px;border:1px solid #dedede;background-color:#f1f1f1;color:#333;border-radius:2px;font-weight:400;cursor:pointer;text-decoration:none}.layui-layer-btn a:hover{opacity:.9;text-decoration:none}.layui-layer-btn a:active{opacity:.7}.layui-layer-btn .layui-layer-btn0{border-color:#4898d5;background-color:#2e8ded;color:#fff}.layui-layer-dialog{min-width:260px}.layui-layer-dialog .layui-layer-content{position:relative;padding:20px;line-height:24px;word-break:break-all;overflow:hidden;font-size:14px;overflow-x:hidden;overflow-y:auto}.layui-layer-dialog .layui-layer-content .layui-layer-ico{position:absolute;top:16px;left:15px;_left:-40px;width:30px;height:30px}.layui-layer-ico1{background-position:-30px 0}.layui-layer-ico2{background-position:-60px 0}.layui-layer-ico3{background-position:-90px 0}.layui-layer-ico4{background-position:-120px 0}.layui-layer-ico5{background-position:-150px 0}.layui-layer-ico6{background-position:-180px 0}.layui-layer-rim{border:6px solid #8D8D8D;border:6px solid rgba(0,0,0,.3);border-radius:5px;box-shadow:none}.layui-layer-msg{min-width:180px;border:1px solid #D3D4D3;box-shadow:none}.layui-layer-hui{min-width:100px;background-color:#000;filter:alpha(opacity=60);background-color:rgba(0,0,0,.6);color:#fff;border:none}.layui-layer-hui .layui-layer-content{padding:12px 25px;text-align:center}.layui-layer-dialog .layui-layer-padding{padding:20px 20px 20px 55px;text-align:left}.layui-layer-page .layui-layer-content{position:relative;overflow:auto}.layui-layer-iframe .layui-layer-btn,.layui-layer-page .layui-layer-btn{padding-top:10px}.layui-layer-nobg{background:0 0}.layui-layer-iframe .layui-layer-content{overflow:hidden}.layui-layer-iframe iframe{display:block;width:100%}.layui-layer-loading{border-radius:100%;background:0 0;box-shadow:none;border:none}.layui-layer-loading .layui-layer-content{width:60px;height:24px;background:url(default/loading-0.gif) no-repeat}.layui-layer-loading .layui-layer-loading1{width:37px;height:37px;background:url(default/loading-1.gif) no-repeat}.layui-layer-ico16,.layui-layer-loading .layui-layer-loading2{width:32px;height:32px;background:url(default/loading-2.gif) no-repeat}.layui-layer-tips{background:0 0;box-shadow:none;border:none}.layui-layer-tips .layui-layer-content{position:relative;line-height:22px;min-width:12px;padding:5px 10px;font-size:12px;_float:left;border-radius:3px;box-shadow:1px 1px 3px rgba(0,0,0,.3);background-color:#F90;color:#fff}.layui-layer-tips .layui-layer-close{right:-2px;top:-1px}.layui-layer-tips i.layui-layer-TipsG{position:absolute;width:0;height:0;border-width:8px;border-color:transparent;border-style:dashed;*overflow:hidden}.layui-layer-tips i.layui-layer-TipsB,.layui-layer-tips i.layui-layer-TipsT{left:5px;border-right-style:solid;border-right-color:#F90}.layui-layer-tips i.layui-layer-TipsT{bottom:-8px}.layui-layer-tips i.layui-layer-TipsB{top:-8px}.layui-layer-tips i.layui-layer-TipsL,.layui-layer-tips i.layui-layer-TipsR{top:1px;border-bottom-style:solid;border-bottom-color:#F90}.layui-layer-tips i.layui-layer-TipsR{left:-8px}.layui-layer-tips i.layui-layer-TipsL{right:-8px}.layui-layer-lan[type=dialog]{min-width:280px}.layui-layer-lan .layui-layer-title{background:#4476A7;color:#fff;border:none}.layui-layer-lan .layui-layer-btn{padding:10px;text-align:right;border-top:1px solid #E9E7E7}.layui-layer-lan .layui-layer-btn a{background:#BBB5B5;border:none}.layui-layer-lan .layui-layer-btn .layui-layer-btn1{background:#C9C5C5}.layui-layer-molv .layui-layer-title{background:#009f95;color:#fff;border:none}.layui-layer-molv .layui-layer-btn a{background:#009f95}.layui-layer-molv .layui-layer-btn .layui-layer-btn1{background:#92B8B1}.layui-layer-iconext{background:url(default/icon-ext.png) no-repeat}.layui-layer-prompt .layui-layer-input{display:block;width:220px;height:30px;margin:0 auto;line-height:30px;padding:0 5px;border:1px solid #ccc;box-shadow:1px 1px 5px rgba(0,0,0,.1) inset;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;border-bottom:1px solid #ccc;background-color:#eee;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;cursor:default;overflow:hidden}.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{height:43px;border-left:1px solid #ccc;border-right:1px solid #ccc;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.xubox_tab_layer{display:block}.xubox_tabclose{position:absolute;right:10px;top:5px;cursor:pointer}.layui-layer-photos{-webkit-animation-duration:1s;animation-duration:1s}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}
0 8 \ No newline at end of file
... ...
src/main/resources/static/assets/plugins/layer-v2.2/doc/jquery下载.url renamed to src/main/resources/static/assets/plugins/layer-v2.4/layim.url
1 1 [{000214A0-0000-0000-C000-000000000046}]
2 2 Prop3=19,2
3 3 [InternetShortcut]
4   -URL=http://code.jquery.com/jquery-1.9.1.min.js
  4 +URL=http://layim.layui.com/
5 5 IDList=
6 6 HotKey=0
... ...
src/main/resources/static/assets/plugins/layer-v2.2/更新日志.txt renamed to src/main/resources/static/assets/plugins/layer-v2.4/更新日志.txt
1 1  
2   -(2.x对1.9+版本无缝兼容,可直接全文件覆盖升级。)
  2 +(可直接全文件覆盖升级。)
  3 +
  4 +# v2.4(2016.07.03)
  5 +* 兼容jQuery3.0
  6 +* 优化tips,可支持配置参数fix(之前是强制fix: false),用于决定是固定的tips还是非固定的。
  7 +* min回调可通过return false来设定不执行默认最小化。
  8 +* 修复在移动端使用iframe,IOS下无法滑动的bug。
  9 +* 细节优化及样式微调
  10 +
  11 +【2.3】2016.05.18
  12 +1. 通过对使用频率的调查,将layer.ext.js(拓展模块)合并到了layer.js,即不用再通过layer.config来加载调用。
  13 +2. cancel回调不再对第二个按钮有效,只作为右上角关闭按钮触发。并且除yes回调外,所以按钮的回调都可以通过return false来设定不默认关闭。
  14 +3. 修复相册层,点击任意图片查看,弹出的并非当前图片的bug。
  15 +4. 修复相册层在移动端显示不佳的bug。
  16 +5. 修复msg、alert等对话框类型的弹层,在手机使用时未水平居中的bug。
  17 +
3 18  
4 19 【2.2】2016.03.18
5 20 > 增加参数id,用于控制弹层唯一标识。如不想重复弹出,可设置该值。
... ...
src/main/resources/static/index.html
... ... @@ -28,7 +28,7 @@
28 28 <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
29 29 <link href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
30 30 <!-- layer 弹层 插件 -->
31   -<link href="/assets/plugins/layer-v2.2/layer/skin/layer.css" rel="stylesheet" type="text/css" />
  31 +<link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" rel="stylesheet" type="text/css" />
32 32 <!-- iCheck 单选框和复选框 -->
33 33 <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" rel="stylesheet" type="text/css" />
34 34 <!-- 日期控件 -->
... ... @@ -262,7 +262,7 @@ tr.row-active td {
262 262 <!-- PJAX -->
263 263 <script src="/assets/plugins/jquery.pjax.js"></script>
264 264 <!-- layer 弹层 -->
265   -<script src="/assets/plugins/layer-v2.2/layer/layer.js" data-exclude=1></script>
  265 +<script src="/assets/plugins/layer-v2.4/layer/layer.js" data-exclude=1></script>
266 266 <!-- jquery.purl URL解析 -->
267 267 <script src="/assets/plugins/purl.js"></script>
268 268 <!-- jquery.serializejson JSON序列化插件 -->
... ...
src/main/resources/static/pages/control/line/child_pages/child_task.html
... ... @@ -445,7 +445,6 @@ $(function(){
445 445 var sch = rs.t;
446 446 //前端缓存更新
447 447 scheduleLineMap[param.xlBm][param.lpName].push(sch);
448   - _data.pushSchedule(sch);
449 448 //刷新表格
450 449 _alone.addScheduleToTable(sch);
451 450 //关闭弹出层
... ...
src/main/resources/static/pages/control/line/child_pages/vehicAndper_adjust.html
... ... @@ -284,45 +284,8 @@
284 284 }
285 285  
286 286 //车辆内部编码下拉搜索框
287   - $('#vehicSearchSelect').select2({
288   - ajax: {
289   - url: '/realSchedule/sreachVehic',
290   - dataType: 'json',
291   - delay: 150,
292   - data: function(params){
293   - return{nbbm: params.term};
294   - },
295   - processResults: function (data) {
296   - return {
297   - results: data
298   - };
299   - },
300   - cache: true
301   - },
302   - templateResult: function(repo){
303   - if (repo.loading) return repo.text;
304   - var h = '<span>'+repo.text+'</span>';
305   - h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');
306   - return h;
307   - },
308   - escapeMarkup: function (markup) { return markup; },
309   - minimumInputLength: 1,
310   - templateSelection: function(repo){
311   - return repo.text;
312   - },
313   - language: {
314   - noResults: function(){
315   - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
316   - },
317   - inputTooShort : function(e) {
318   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
319   - },
320   - searching : function() {
321   - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
322   - }
323   - }
324   - })
325   - .on('select2:select', function(e){
  287 + createVehSearch($('#vehicSearchSelect'));
  288 + $('#vehicSearchSelect').on('select2:select', function(e){
326 289 var lineCode = e.params.data.lineCode;
327 290 if(lineCode)
328 291 if(lineCode != lineSelect.val()){
... ...
src/main/resources/static/pages/control/line/css/lineControl.css
... ... @@ -848,38 +848,95 @@ height: 400px;
848 848 font-family: 华文黑体 微软雅黑
849 849 }
850 850  
851   -/*
852   - pb-table 宽度
853   -*/
854   -.pb-table tr td:nth-child(1){
  851 +/** 1600px 以上 */
  852 +@media (min-width : 1600px) {
  853 + .pb-table tr td:nth-child(1){
855 854 width: 50px;
  855 + }
  856 + .pb-table tr td:nth-child(2){
  857 + width: 55px;
  858 + }
  859 + .pb-table tr td:nth-child(3){
  860 + width: 86px;
  861 + }
  862 + .pb-table tr td:nth-child(4){
  863 + width: 10%;
  864 + }
  865 + .pb-table tr td:nth-child(5){
  866 + width: 15%;
  867 + }
  868 + .pb-table tr td:nth-child(6){
  869 + width: 13%;
  870 + }
  871 + .pb-table tr td:nth-child(7){
  872 + width: 10%;
  873 + }
  874 + .pb-table tr td:nth-child(8){
  875 + /* width: 15%; */
  876 + }
  877 + .pb-table tr td:nth-child(9){
  878 + width: 55px;
  879 + }
856 880 }
857   -.pb-table tr td:nth-child(2){
858   - width: 55px;
859   -}
860   -.pb-table tr td:nth-child(3){
861   - width: 76px;
862   -}
863   -.pb-table tr td:nth-child(4){
864   - width: 9%;
865   -}
866   -.pb-table tr td:nth-child(5){
867   - width: 15%;
868   -}
869   -.pb-table tr td:nth-child(6){
870   - width: 10%;
871   -}
872   -.pb-table tr td:nth-child(7){
873   - width: 10%;
874   -}
875   -.pb-table tr td:nth-child(8){
876   - /* width: 15%; */
  881 +
  882 +.pb-table.head tr td{
  883 + white-space: nowrap;
  884 + overflow: hidden;
  885 + text-overflow: ellipsis;
877 886 }
878   -.pb-table tr td:nth-child(9){
879   - width: 55px;
  887 +
  888 +/** 1600px 以下 */
  889 +@media (max-width : 1600px) {
  890 + .pb-table tr td:nth-child(1){
  891 + width: 40px;
  892 + }
  893 + .pb-table tr td:nth-child(2){
  894 + width: 55px;
  895 + }
  896 + .pb-table tr td:nth-child(3){
  897 + width: 76px;
  898 + }
  899 + .pb-table tr td:nth-child(4){
  900 + width: 9%;
  901 + }
  902 + .pb-table tr td:nth-child(5){
  903 + width: 15%;
  904 + }
  905 + .pb-table tr td:nth-child(6){
  906 + width: 15%;
  907 + }
  908 + .pb-table tr td:nth-child(7){
  909 + width: 10%;
  910 + }
  911 + .pb-table tr td:nth-child(8){
  912 + width: 15%;
  913 + }
880 914 }
881   -.pb-table tr td:nth-child(10){
882   - width: 47px;
  915 +
  916 +/** 1310px 以下 */
  917 +@media (max-width : 1310px) {
  918 + .pb-table tr td:nth-child(1){
  919 + width: 50px;
  920 + }
  921 + .pb-table tr td:nth-child(2){
  922 + width: 40px;
  923 + }
  924 + .pb-table tr td:nth-child(3){
  925 + width: 56px;
  926 + }
  927 + .pb-table tr td:nth-child(4){
  928 + width: 9%;
  929 + }
  930 + .pb-table tr td:nth-child(5){
  931 + width: 11%;
  932 + }
  933 + .pb-table tr td:nth-child(6){
  934 + width: 16%;
  935 + }
  936 +
  937 + .fcsj-diff{
  938 + display: none;
  939 + }
883 940 }
884 941  
885 942 .tab_line .panel-wrap ._panel ._body .pb-table a{
... ... @@ -915,7 +972,7 @@ height: 400px;
915 972 .pb-table tr td.active-menu {
916 973 border-left: 0;
917 974 border-right: 0;
918   - background: #2f81b9;
  975 + background: #3598dc;
919 976 color: white;
920 977 }
921 978  
... ... @@ -1037,26 +1094,28 @@ height: 400px;
1037 1094 }
1038 1095  
1039 1096 .log-item{
1040   - width: 96%;
  1097 + width: 96%;
1041 1098 margin: 2%;
1042 1099 border: 1px solid #e1e5ec;
1043 1100 box-shadow: 0 2px 5px 0 rgba(225, 229, 236, 0.2),0 2px 10px 0 rgba(225, 229, 236, 0.21);
1044 1101 background: #e1e5ec;
1045   - padding: 5px;
1046 1102 position: relative;
1047   - height: 55px;
  1103 + height: auto;
  1104 + padding: 10px 5px 30px;
1048 1105 }
1049 1106  
1050 1107 .log-item-text{
1051 1108 display: block;
1052 1109 font-size: 14px;
1053 1110 font-family: 微软雅黑;
  1111 + margin-top: 2px;
1054 1112 }
1055 1113  
1056 1114 .log-item-time{
1057 1115 position: absolute;
1058 1116 right: 4px;
1059 1117 bottom: 4px;
  1118 + color: #a6a6a6;
1060 1119 }
1061 1120  
1062 1121 .log-item-point{
... ... @@ -1477,7 +1536,7 @@ height: 400px;
1477 1536 }
1478 1537  
1479 1538 /** 小于1080p 的*/
1480   -@media ( max-width : 1610px) {
  1539 +@media ( max-width : 1500px) {
1481 1540 .hide-lt-1080{
1482 1541 display: none;
1483 1542 }
... ... @@ -1485,6 +1544,7 @@ height: 400px;
1485 1544  
1486 1545 .tab_line .panel-wrap ._panel ._body .pb-table a.remarks-popover{
1487 1546 color: gray;text-decoration: none;
  1547 + font-size: 12px;
1488 1548 }
1489 1549  
1490 1550 .form-custom hr{
... ... @@ -1863,3 +1923,175 @@ tr.adjust_tr_active td{
1863 1923 .select2-results__option--highlighted .select2-desc{
1864 1924 color: white;
1865 1925 }
  1926 +
  1927 +.popover-content{
  1928 + font-size: 13px;
  1929 + color: #dd4747;
  1930 +}
  1931 +
  1932 +.log-item.zhongdian {
  1933 +}
  1934 +
  1935 +span.log-item-handle a {
  1936 + font-size: 14px;
  1937 + font-family: 微软雅黑;
  1938 + margin: 0 2px;
  1939 +}
  1940 +
  1941 +.log-item.fache {
  1942 +}
  1943 +
  1944 +.in-badge, .out-badge {
  1945 + font-size: 13px;
  1946 + margin-left: 2px;
  1947 + padding: 2px 4px;
  1948 + border-radius: 5px !important;
  1949 + display: inline-block;
  1950 +}
  1951 +
  1952 +.out-badge{
  1953 + background: #59d8e3;
  1954 + color: white;
  1955 +}
  1956 +
  1957 +.in-badge {
  1958 + background: #b4b9be;
  1959 + color: white;
  1960 +}
  1961 +
  1962 +.in-badge:BEFORE{
  1963 + content: '进场'
  1964 +}
  1965 +
  1966 +.out-badge:BEFORE{
  1967 + content: '出场'
  1968 +}
  1969 +
  1970 +@media ( max-width : 1780px) {
  1971 + .in-badge:BEFORE{
  1972 + content: '进'
  1973 + }
  1974 +
  1975 + .out-badge:BEFORE{
  1976 + content: '出'
  1977 + }
  1978 +}
  1979 +
  1980 +.pb-table tr.selected{
  1981 + background-color: #a9a4a4 !important;
  1982 + color: #f2f3f3;
  1983 +
  1984 +}
  1985 +
  1986 +.pb-table tr.selected.next-sch{
  1987 + background-color: #3598dc !important;
  1988 + color: white;
  1989 +}
  1990 +
  1991 +.pb-table tr.selected.search{
  1992 + animation-delay:.5s;
  1993 +}
  1994 +
  1995 +.ctrl_f_search{
  1996 + padding: 9px;
  1997 +}
  1998 +
  1999 +.fcsj-diff{
  2000 + color: gray;
  2001 + margin-left: 3px;
  2002 +}
  2003 +
  2004 +/** 图例选中渐变色 */
  2005 +.pb-table tr td.tl-qrlb.active-menu{
  2006 + background: linear-gradient(to right, #3598dc 28%, #7B6B24 100%);
  2007 +}
  2008 +
  2009 +.pb-table tr td.tl-zzzx.active-menu{
  2010 + background: linear-gradient(to right, #3598dc 28%, #96F396 100%);
  2011 +}
  2012 +
  2013 +.pb-table tr td.tl-yzx.active-menu{
  2014 + background: linear-gradient(to right, #3598dc 28%, #c1ddf0 100%);
  2015 +}
  2016 +
  2017 +.pb-table tr td.tl-xxfc.active-menu{
  2018 + background: linear-gradient(to right, #3598dc 28%, #AE9CCE 100%);
  2019 +}
  2020 +
  2021 +.pb-table tr td.tl-xxsd.active-menu{
  2022 + background: linear-gradient(to right, #3598dc 28%, #DE815E 100%);
  2023 +}
  2024 +
  2025 +.pb-table tr td.tl-xxrd.active-menu{
  2026 + background: linear-gradient(to right, #3598dc 28%, #C1DDF0 100%);
  2027 +}
  2028 +
  2029 +.pb-table tr td.tl-wd.active-menu{
  2030 + background: linear-gradient(to right, #3598dc 28%, #efef90 100%);
  2031 +}
  2032 +
  2033 +
  2034 +.pb-table tr td.tl-zzzx.active-menu .fcsj-diff{
  2035 + color: #e5e5e5;
  2036 +}
  2037 +
  2038 +.active-menu .fcsj-diff{
  2039 + color: #cdcdcd;
  2040 +}
  2041 +
  2042 +.pb-table tr.active-line-no{
  2043 + background-color: #4d4d4d !important;
  2044 + color: white;
  2045 +}
  2046 +
  2047 +.tab_line .panel-wrap ._panel ._body .pb-table tr td.selected:nth-child(1){
  2048 + background: #4d4d4d;
  2049 + color: white;
  2050 +}
  2051 +
  2052 +.tab_line .panel-wrap ._panel ._body .pb-table tr._tr_active.active-line-no a{
  2053 + color: #afafaf;
  2054 +}
  2055 +
  2056 +.tab_line .pb-table tr._tr_active.active-line-no a.remarks-popover{
  2057 + color: #bebebe;
  2058 +}
  2059 +
  2060 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-qrlb{
  2061 + background: none;
  2062 + color: #ff796a;
  2063 +}
  2064 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-zzzx{
  2065 + background: none;
  2066 + color: #5ae35a;
  2067 +}
  2068 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-yzx{
  2069 + background: none;
  2070 + color: #80c8fa;
  2071 +}
  2072 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-xxfc{
  2073 + background: none;
  2074 + color: #a16dff;
  2075 +}
  2076 +
  2077 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-xxsd{
  2078 + background: none;
  2079 + color: #ffb193;
  2080 +}
  2081 +
  2082 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-xxrd{
  2083 + background: none;
  2084 + color: #5cb0e9;
  2085 +}
  2086 +
  2087 +.table-bordered>tbody>tr._tr_active.active-line-no>td{
  2088 + border: 1px solid #5f5f5f;
  2089 +}
  2090 +
  2091 +tr._tr_active.active-line-no .in-badge{
  2092 + background: #84898f;
  2093 +}
  2094 +
  2095 +tr._tr_active.active-line-no .out-badge{
  2096 + background: #67a3a8;
  2097 +}
1866 2098 \ No newline at end of file
... ...
src/main/resources/static/pages/control/line/index.html
... ... @@ -96,8 +96,8 @@
96 96 <span class="menu-text">计划烂班</span>
97 97 </button>
98 98 </li>
99   - <li class="menu-item disabled" >
100   - <button type="button" class="menu-btn">
  99 + <li class="menu-item" >
  100 + <button type="button" class="menu-btn" data-method="revokeDestroy">
101 101 <span class="menu-text">撤销烂班</span>
102 102 </button>
103 103 </li>
... ... @@ -106,14 +106,14 @@
106 106 <span class="menu-text">实发调整</span>
107 107 </button>
108 108 </li>
109   - <li class="menu-item disabled" >
110   - <button type="button" class="menu-btn">
  109 + <li class="menu-item" >
  110 + <button type="button" class="menu-btn" data-method="revokeRealOutgo">
111 111 <span class="menu-text">撤销实发</span>
112 112 </button>
113 113 </li>
114 114 <li class="menu-separator"></li>
115   - <li class="menu-item disabled" >
116   - <button type="button" class="menu-btn">
  115 + <li class="menu-item" >
  116 + <button type="button" class="menu-btn" data-multi=1 data-method="spaceAdjust">
117 117 <span class="menu-text">间隔调整</span>
118 118 </button>
119 119 </li>
... ... @@ -171,12 +171,13 @@
171 171 <script src="/pages/control/line/js/rightMenu.js"></script>
172 172 <script src="/pages/control/line/js/alone.js"></script>
173 173 <script src="/pages/control/line/js/main.js"></script>
174   -
  174 +<script src="/pages/control/line/js/console.js"></script>
  175 +<script src="/pages/control/line/js/keyboardListen.js"></script>
175 176 <script>
176 177  
177 178 var lineCodes = '' //全部线路编码字符串,由data.js初始化
178 179 , lineMap = {} //编码和线路详细对照,由data.js初始化;
179   -
  180 + ,animationend = 'webkitAnimationEnd animationend';
180 181 moment.locale('zh-cn');
181 182 $(function() {
182 183 //加载模板文件
... ... @@ -185,6 +186,7 @@ $(function() {
185 186 getTemp('temps/tooltip_tp.html');
186 187 getTemp('temps/alone_tp.html');
187 188 getTemp('temps/child_task_case_tp.html');
  189 + getTemp('temps/console.html');
188 190  
189 191 function getTemp(url){
190 192 $.get(url, function(template){
... ...
src/main/resources/static/pages/control/line/js/alone.js
... ... @@ -50,15 +50,33 @@ var _alone = (function(){
50 50 },
51 51 //刷新单个班次
52 52 refreshSchedule: function(schedule){
  53 + //更新 _data
  54 + _data.updateSchedule(schedule);
  55 + var tab = '#tab_line_' + schedule.xlBm;
53 56 //xlBm
54   - var $tr = $('tr[data-id='+schedule.id+']', '#tab_line_' + schedule.xlBm)
  57 + var $tr = $('tr[data-id='+schedule.id+']', tab)
55 58 ,newTr = template('alone_plan_table_temp', {list: [schedule]});
56 59  
57 60 $tr.replaceWith(newTr);
58 61 initRemarksPop();
  62 +
  63 + var type = schedule.xlDir==0?'up':'down';
  64 + calculateLineNo($('.pb-table[data-type='+type+']', tab)[0]);
  65 + },
  66 + //刷新多个班次,刷新完数据再统一计算行号
  67 + refreshScheduleArray: function(array){
  68 + if(!array || array.length == 0)
  69 + return;
  70 + $.each(array, function(){
  71 + aloneObject.refreshSchedule(this);
  72 + });
  73 + var table = $('tr[data-id='+array[0].id+']').parents('table')[0];
  74 + calculateLineNo(table);
59 75 },
60 76 //添加一个班次到表格
61 77 addScheduleToTable: function(schedule){
  78 + _data.pushSchedule(schedule);
  79 +
62 80 var upDown = schedule.xlDir==0?'up':'down';
63 81 var tab = $('#tab_line_' + schedule.xlBm);
64 82 //重新渲染表格
... ... @@ -80,12 +98,19 @@ var _alone = (function(){
80 98 calculateLineNo: calculateLineNo
81 99 }
82 100  
  101 + //实发时间单元格事件
  102 + $('.portlet-fullscreen').on('click', 'table.pb-table .sfsj-item', function(){
  103 +
  104 + });
  105 +
83 106 //计算行号
84 107 function calculateLineNo(table){
85 108 var rows = table.rows;
86 109 $.each(rows,function(i, r){
87 110 var cells = r.cells;
88 111 $(cells[0]).text(i + 1);
  112 +
  113 + $(r).data('no', (i + 1));
89 114 });
90 115 }
91 116  
... ...
src/main/resources/static/pages/control/line/js/console.js 0 → 100644
  1 +/** 信使操作 */
  2 +
  3 +$('.portlet-fullscreen').on('click', '.log-item-handle a.log-close', function(){
  4 + $(this).parents('.log-item').remove();
  5 +});
0 6 \ No newline at end of file
... ...
src/main/resources/static/pages/control/line/js/data.js
... ... @@ -23,11 +23,18 @@ var _data = (function(){
23 23 var lineLpMap = {};
24 24 //线路标准信息
25 25 var lineInformations = {};
  26 + //车辆和班次数组映射
  27 + var clSchMap = {};
26 28  
27 29 //车辆自编号和设备号对照
28 30 var carDeviceIdMapp = {};
29 31  
30 32 var dataObject = {
  33 + /*//班次发车
  34 + setFcsj: function(schId, fcsj, fcsjT){
  35 + schedules[schId].fcsjActual = fcsj;
  36 + schedules[schId].fcsjActualTime = fcsjT;
  37 + },*/
31 38 //根据线路和上下行获取计划排班
32 39 findSchByLine: function(xlbm, upDown){
33 40 var array = [];
... ... @@ -39,14 +46,23 @@ var _data = (function(){
39 46  
40 47 return array;
41 48 },
  49 + //根据车辆获取班次数组
  50 + findByCl: function(nbbm){
  51 + return clSchMap[nbbm];
  52 + },
42 53 //添加一个班次
43 54 pushSchedule: function(sch){
  55 + //附加信息
  56 + attachInfo(sch);
  57 + //加入缓存
44 58 scheduleList.push(sch);
45 59 schedules[sch.id] = sch;
46 60 lineLpMap[sch.xlBm][sch.lpName].push(sch);
47 61 },
48 62 //更新班次信息
49 63 updateSchedule: function(sch){
  64 + //附加信息
  65 + attachInfo(sch);
50 66 schedules[sch.id] = sch;
51 67 lineLpMap[sch.xlBm][sch.lpName].push(sch);
52 68 },
... ... @@ -105,24 +121,18 @@ var _data = (function(){
105 121 list = rs[lineCode];
106 122 lineLpMap[lineCode] = {};
107 123 $.each(list, function(){
108   - //发车时间 + 历时 = 终点时间
109   - if(this.bcsj){
110   - sm = moment(this.fcsjT);
111   - em = sm.add(this.bcsj, 'minutes');
112   - this.zdsj = em.format('HH:mm');
113   - //终点时间戳
114   - this.zdsjT = em.valueOf();
115   - }
116   -
  124 + attachInfo(this);
117 125 //缓存排班计划
118 126 schedules[this.id] = this;
119 127 scheduleList.push(this);
120   -
121 128 //构造 线路 ——> 路牌 ——> 班次 3层映射
122 129 if(!lineLpMap[lineCode][this.lpName])
123 130 lineLpMap[lineCode][this.lpName] = [];
124   -
125 131 lineLpMap[lineCode][this.lpName].push(this);
  132 + //车辆 ——> 班次数组
  133 + if(!clSchMap[this.clZbh])
  134 + clSchMap[this.clZbh] = [];
  135 + clSchMap[this.clZbh].push(this);
126 136 });
127 137  
128 138 //按发车时间排序
... ... @@ -178,6 +188,19 @@ var _data = (function(){
178 188 });
179 189 });
180 190  
  191 + function attachInfo(sch){
  192 + //实际发车误差值
  193 + if(sch.fcsjActualTime){
  194 + var diff = parseInt((sch.fcsjActualTime - sch.fcsjT) / 1000 / 60);
  195 + if(diff > 0)
  196 + sch.fcsj_diff = '( +' + diff + ' )';
  197 + else if(diff < 0)
  198 + sch.fcsj_diff = '( ' + diff + ' )';
  199 + else
  200 + sch.fcsj_diff = '';
  201 + }
  202 + }
  203 +
181 204 function refreshGpsProxy(){
182 205 refreshGps(function(add, up){
183 206 $('#tab_home,#tab_map #mapContainer').trigger('gps_refresh', [add, up]);
... ...
src/main/resources/static/pages/control/line/js/keyboardListen.js 0 → 100644
  1 +/** 键盘监听 */
  2 +
  3 +//禁止选中
  4 +$(document).on('selectstart','table.pb-table', function(event){
  5 + event = window.event||event;
  6 + event.returnValue = false;
  7 +});
  8 +
  9 +$(document.body).on('keydown', function(e){
  10 + if (e.keyCode == 70 && e.ctrlKey) {
  11 + if ( e && e.preventDefault )
  12 + e.preventDefault();
  13 + else
  14 + window.event.returnValue = false;
  15 +
  16 + //弹出搜索框
  17 + var index = layer.open({
  18 + type: 1,
  19 + area: '430px',
  20 + content: template('ctrl_f_search_temp', {}),
  21 + shift: -1,
  22 + title: '搜索',
  23 + closeBtn:2,
  24 + success: function(){
  25 + createVehSearch($('#ctrlFSearchSelect'))
  26 + .on('change', function(){
  27 + var array = _data.findByCl($(this).val());
  28 + if(!array || array.length == 0)
  29 + layer.msg('没有找到相关班次信息!');
  30 + else{
  31 + //定位到当前正在执行的班次
  32 + var sch;
  33 + $.each(array, function(){
  34 + if(this.status == 1)
  35 + sch = this;
  36 + });
  37 + if(!sch)
  38 + sch = array[0];
  39 +
  40 + var delay;
  41 + //当前选中的选项卡
  42 + var activeTab = $('#top-tabs-wrap ul li.active a');
  43 + if(activeTab.data('id') == sch.xlBm){
  44 + //搜索的班次就在当前页面
  45 + delay = 0;
  46 + }
  47 + else{
  48 + //切换选项卡
  49 + var tab = '#tab_line_' + sch.xlBm;
  50 + $('.nav-tabs li a[href='+tab+']').click();
  51 + delay = 400;
  52 + }
  53 +
  54 + setTimeout(function(){
  55 + $('.pb-table tr.selected').removeClass('selected');
  56 + var tr = $('tr[data-id='+sch.id+']', tab)
  57 + .addClass('selected search');
  58 +
  59 + var wrap = tr.parents('._body')
  60 + ,top = parseInt(tr.find('td[name=lineNo]').text()) * 37 - wrap.height() / 2;
  61 + wrap.slimScroll({ scrollTo: top + 'px' });
  62 +
  63 + //闪动
  64 + tr.addClass('animated flash').one('animationend', function(){
  65 + $(this).removeClass('animated flash');
  66 + });
  67 + }, delay);
  68 + }
  69 + }).select2("open");
  70 + }
  71 + });
  72 + }
  73 +});
0 74 \ No newline at end of file
... ...
src/main/resources/static/pages/control/line/js/main.js
... ... @@ -76,7 +76,7 @@ setTimeout(function(){
76 76 //生成头部选项卡
77 77 var topTabs = '', tabPanels = '';
78 78 $.each(_data.getLines(), function(i, line){
79   - topTabs += '<li ><a href="#tab_line_'+line.lineCode+'" data-toggle="tab" '+
  79 + topTabs += '<li ><a data-id="'+line.lineCode+'" href="#tab_line_'+line.lineCode+'" data-toggle="tab" '+
80 80 'aria-expanded="false"> '+line.name+'<span>(0,0 托管)</span> </a></li>';
81 81  
82 82 tabPanels += '<div class="tab-pane fade tab_line" data-id="'+line.lineCode+'" id="tab_line_'+line.lineCode+'"></div>';
... ...
src/main/resources/static/pages/control/line/js/rightMenu.js
... ... @@ -4,49 +4,159 @@
4 4 var _menu = (function() {
5 5  
6 6 $('#rightMenu .menu-item button').on('click', function(){
7   - var method = $(this).data('method')
8   - ,id = $('.pb-table tr td.active-menu').parent().data('id');
9   - if(!id){
10   - layer.alert('无法获取当前选中项', {icon: 2, title: '异常'});
  7 + var method = $(this).data('method');
  8 + //被激活的行
  9 + var activeTrs = $('.pb-table tr._tr_active');
  10 + if(activeTrs.length == 0){
  11 + layer.alert('没有选择班次!', {icon: 2, title: '异常'});
11 12 return;
12 13 }
13   - var schedul = _data.getSchedulById(id);
14   - if(!schedul){
15   - layer.alert('无法找到当前项对应的班次信息,请尝试刷新页面!', {icon: 2, title: '异常'});
16   - return;
  14 + if($(this).data('multi') == 1){
  15 + //多选操作
  16 + var idArray = [];
  17 + $.each(activeTrs, function(){idArray.push($(this).data('id'))});
  18 + menuObject[method](idArray);
  19 + }
  20 + else{
  21 + //单选操作
  22 + var schedul = _data.getSchedulById(activeTrs.data('id'));
  23 + if(!schedul){
  24 + layer.alert('无法找到当前项对应的班次信息,请尝试刷新页面!', {icon: 2, title: '异常'});
  25 + return;
  26 + }
  27 + menuObject[method](schedul);
17 28 }
18   -
19   - menuObject[method](schedul);
20 29 });
21 30  
  31 +
22 32 // 表格右键呼出菜单
23 33 var ac = 'active-menu'
24 34 ,items = '.pb-table.data tr td[name!=lineNo]';
25 35 $('.portlet-fullscreen').on('contextmenu', items,
26 36 function(e) {
27 37 e.preventDefault();
28   - $('.pb-table tr td.' + ac).removeClass(ac);
29 38 var item = $(this);
30   - item.addClass(ac);
31   -
  39 + if(!$(this).parent().hasClass('active-line-no')){
  40 + resetAllState();
  41 + item.addClass(ac);
  42 + item.parent().addClass('_tr_active');
  43 + }
  44 +
32 45 showMenu(e.pageX, e.pageY + 3);
33 46 $(document).one('click', function() {
34 47 $('#rightMenu').removeClass('show-menu');
35   - item.removeClass(ac);
  48 + //item.removeClass(ac);
36 49 });
37 50 })
38 51 // 点击选中
39 52 .on('click',items, function() {
40   - $('.pb-table tr td.' + ac).removeClass(ac);
  53 + resetAllState();
41 54 $(this).addClass(ac);
  55 +
  56 + var $ctr = $(this).parent();
  57 + //选中关联班次
  58 + selCognateSch($ctr);
  59 + $ctr.removeClass('selected');
42 60 });
43 61  
  62 + //点击序号
  63 + var nos = '.pb-table.data tr td[name=lineNo]', prveSelRow;
  64 + $('.portlet-fullscreen').on('click', nos, function(e){
  65 + var $tab = $(this).parents('table');
  66 + //当前表格是否存在选中项
  67 + var multiSel = $tab.find('tr._tr_active').length;
  68 + //按住了ctrl 或 shift
  69 + if((e.ctrlKey || e.shiftKey) && multiSel){
  70 + resetState();
  71 + //按住了shift 多选
  72 + if(e.shiftKey && prveSelRow){
  73 + var startNo = parseInt(prveSelRow.data('no'))
  74 + ,endNo = parseInt($(this).parent().data('no'));
  75 + selectRange(startNo, endNo, $tab[0]);
  76 + }
  77 + }
  78 + else
  79 + resetAllState();
  80 +
  81 + //选中一行
  82 + prveSelRow = selectOneRow(this);
  83 +
  84 + });
  85 +
  86 + function selectOneRow(firstCell){
  87 + return $(firstCell).addClass('selected').parent().addClass('_tr_active active-line-no');
  88 + }
  89 +
  90 + //选中关联班次
  91 + function selCognateSch($ctr){
  92 + //选中关联班次
  93 + var clnbbm = $ctr.find('td[data-name=clZbh]').text()
  94 + ,schId = $ctr.data('id')
  95 + ,sch = _data.getSchedulById(schId);
  96 +
  97 + var scroll = false;
  98 + $.each(_data.findByCl(clnbbm), function(){
  99 + if(scroll){
  100 + var nextTr = $('tr[data-id='+this.id+']');
  101 + //不在同一个table才定位,避免滚动当前table,丢失焦点
  102 + if(sch.xlDir != this.xlDir){
  103 + //定位到下一个班次
  104 + var wrap = nextTr.parents('._body')
  105 + ,top = parseInt(nextTr.find('td[name=lineNo]').text()) * 37 - wrap.height() / 2;
  106 + wrap.slimScroll({ scrollTo: top + 'px' });
  107 + }
  108 + scroll = false;
  109 + nextTr.addClass('next-sch');
  110 + }
  111 + $('.pb-table tr[data-id='+this.id+']').addClass('selected');
  112 + if(this.id == schId)
  113 + scroll = true;
  114 + });
  115 + }
  116 +
  117 + //还原状态
  118 + function resetState(){
  119 + $('.pb-table tr td.' + ac).removeClass(ac);
  120 + $('.pb-table tr.selected').removeClass('selected');
  121 + $('.pb-table tr.next-sch').removeClass('next-sch');
  122 + }
  123 + function resetAllState(){
  124 + $('.pb-table tr td.' + ac).removeClass(ac);
  125 + $('.pb-table tr.selected').removeClass('selected');
  126 + $('.pb-table tr._tr_active').removeClass('_tr_active active-line-no');
  127 + $('.pb-table tr.next-sch').removeClass('next-sch');
  128 + $('.pb-table.data tr td.selected[name=lineNo]').removeClass('selected');
  129 +
  130 + prveSelRow = null;
  131 + }
  132 +
  133 + //根据起止行号选中多行
  134 + function selectRange(s , e, table){
  135 + var rows = table.rows;
  136 + if(s > e){
  137 + //交换位置
  138 + s = s + e;
  139 + e = s - e;
  140 + s = s - e;
  141 + }
  142 +
  143 + var no;
  144 + $.each(rows, function(i, r){
  145 + no = parseInt($(r).data('no'));
  146 + if(no > s && no < e)
  147 + selectOneRow($(r).find('td[name=lineNo]')[0]);
  148 +
  149 + if(no > e)
  150 + return false;
  151 + });
  152 + }
  153 +
44 154 var menuObject = {
45 155 //待发调整
46 156 outgoAdjust: function(schedul){
47 157 var index = layer.open({
48 158 type: 1,
49   - area: ['630px', '545px'],
  159 + area: '630px',
50 160 maxmin: true,
51 161 content: template('outgo_adjust_body_temp', schedul),
52 162 shift: 5,
... ... @@ -101,6 +211,13 @@ var _menu = (function() {
101 211 $('button.confirm', f).on('click', function(){
102 212 f.submit();
103 213 });
  214 + //调整说明
  215 + $('select[name=reason]', f).on('change', function(){
  216 + var t = $(this).val();
  217 + if(!t) return;
  218 + var textarea = $('textarea[name=remarks]', f);
  219 + textarea.val(textarea.val() + t + ',');
  220 + });
104 221  
105 222 f.validate({
106 223 submitHandler : function(){
... ... @@ -128,16 +245,9 @@ var _menu = (function() {
128 245 params.idsStr = idsStr;
129 246 $post('/realSchedule/destroy', params, function(rs){
130 247 layer.close(index);
131   - $.each(rs.list, function(){
132   - var old = _data.getSchedulById(this.id);
133   - old.dfsj = this.dfsj;
134   - old.dfsjT = this.dfsjT;
135   - old.remarks = this.remarks;
136   - old.status = this.status;
137   - _alone.refreshSchedule(old);
138   - });
139   - layer.msg('调整间隔成功!');
140   - _alone.calculateLineNo($('tr[data-id='+schedul.id+']').parents('table')[0]);
  248 + //刷新数据
  249 + _alone.refreshScheduleArray(rs.list);
  250 + layer.msg('计划烂班成功!');
141 251 });
142 252 });
143 253 return false;
... ... @@ -148,7 +258,7 @@ var _menu = (function() {
148 258 },
149 259 //实发调整
150 260 realOutgoAdjust: function(schedul){
151   - layer.open({
  261 + var index = layer.open({
152 262 type: 1,
153 263 area: ['350px', '455px'],
154 264 maxmin: true,
... ... @@ -164,11 +274,82 @@ var _menu = (function() {
164 274 if(!$.trim(params.remarks)){
165 275 layer.msg('备注不能为空');return;
166 276 }
167   - alert('可以提交...');
  277 + layer.close(index);
  278 + $post('/realSchedule/realOutAdjust', params
  279 + ,function(rs){
  280 + if(rs.t){
  281 + layer.msg('实发调整成功!');
  282 + //更新前端数据
  283 + _alone.refreshSchedule(rs.t);
  284 + }
  285 + });
168 286 });
169 287 }
170 288 });
171 289 },
  290 + //撤销实发
  291 + revokeRealOutgo: function(schedul){
  292 + layer.confirm('确定要撤销实发?', {
  293 + btn : [ '撤销实发', '取消' ],
  294 + icon : 3,
  295 + shift :5,
  296 + }, function(){
  297 + $post('/realSchedule/revokeRealOutgo', {id: schedul.id}, function(rs){
  298 + if(rs.t){
  299 + layer.msg('撤销实发成功!');
  300 + //更新前端数据
  301 + _alone.refreshSchedule(rs.t);
  302 + }
  303 + });
  304 + });
  305 + },
  306 + //撤销烂班
  307 + revokeDestroy: function(schedul){
  308 + layer.confirm('确定要撤销烂班?', {
  309 + btn : [ '撤销烂班', '取消' ],
  310 + icon : 3,
  311 + shift :5,
  312 + }, function(){
  313 + $post('/realSchedule/revokeDestroy', {id: schedul.id}, function(rs){
  314 + if(rs.t){
  315 + layer.msg('撤销烂班成功!');
  316 + //更新前端数据
  317 + _alone.refreshSchedule(rs.t);
  318 + }
  319 + });
  320 + });
  321 + },
  322 + //间隔调整
  323 + spaceAdjust: function(idArray){
  324 + if(idArray && idArray.length == 1){
  325 + layer.msg('请选中多个班次!');
  326 + return;
  327 + }
  328 + layer.prompt({title: '请输入间隔(分钟)', formType: 0 , shift: 5
  329 + }, function(space){
  330 + if (!isNaN(space)) {
  331 + $.ajax({
  332 + url: '/realSchedule/spaceAdjust',
  333 + type: 'POST',
  334 + traditional: true,
  335 + data: {ids: idArray, space: space},
  336 + success:function(rs){
  337 + console.log(rs);
  338 + if(rs.status == 'SUCCESS'
  339 + || rs.status == 200){
  340 + //刷新数据
  341 + _alone.refreshScheduleArray(rs.list);
  342 + layer.msg('调整间隔成功!');
  343 + }
  344 + },
  345 + error: errorHandle
  346 + });
  347 +
  348 + } else
  349 + layer.alert('你必须输入一个数字!', {icon: 2, title: '操作失败'});
  350 +
  351 + });
  352 + },
172 353 //子任务
173 354 childTask: function(schedul){
174 355 var layIndex = layer.msg('加载中...', {icon: 16});
... ... @@ -223,7 +404,7 @@ var _menu = (function() {
223 404 //走短语下发
224 405 layer.close(index);
225 406 layer.msg('正在下发指令', {icon: 16});
226   - $.post('/directive/phrase', {nbbm: schedul.clZbh, text: text},
  407 + $.post('/directive/dispatch', {id: schedul.id},
227 408 function(code){
228 409 if(code == 0){
229 410 layer.msg('发送成功');
... ... @@ -256,5 +437,9 @@ var _menu = (function() {
256 437 .addClass('show-menu');
257 438 }
258 439  
  440 + function errorHandle(){
  441 + layer.alert('服务器出现异常!', {icon: 2, title: '操作失败'});
  442 + }
  443 +
259 444 return menuObject;
260 445 })();
261 446 \ No newline at end of file
... ...
src/main/resources/static/pages/control/line/js/webSocketHandle.js
1 1 /** web socket */
  2 +!function(){
  3 +var reqCodeMap = {0xA1: '请求恢复运营', 0xA2: '申请调档', 0xA3: '出场请求', 0xA5: '进场请求', 0xA7: '加油请求', 0x50: '车辆故障', 0x70: '路阻报告', 0x60: '事故报告', 0x11: '扣证纠纷', 0x12 : '报警'};
  4 +
  5 +
2 6 //将当前用户和线路绑定到后台
3   -$.post('/realSchedule/registerLine', {lineCodes: lineCodes}
4   -,function(rs){
5   - if(rs == 0){
6   - layer.msg('注册线路成功!');
7   - initWebSocket();
8   - }
9   -});
  7 +setTimeout(function(){
  8 + $.post('/realSchedule/registerLine', {lineCodes: lineCodes}
  9 + ,function(rs){
  10 + if(rs == 0){
  11 + layer.msg('注册线路成功!');
  12 + initWebSocket();
  13 + }
  14 + });
  15 +}, 500);
10 16  
11 17 //初始化webSocket
12   -var msg80Sock;
  18 +var msgSock;
13 19 var initWebSocket = function(){
14   - msg80Sock = new SockJS('/sockjs/directive80');
  20 + msgSock = new SockJS('/sockjs/realcontrol');
15 21  
16   - msg80Sock.onopen = function(e) {
17   - console.log('webSocket[msg80Sock] onopen');
  22 + msgSock.onopen = function(e) {
  23 + console.log('webSocket[realcontrol] onopen');
18 24 };
19   -
20 25 //接收消息
21   - msg80Sock.onmessage = function(e) {
  26 + msgSock.onmessage = function(e) {
22 27 try{
23   - console.log(e);
24 28 var jsonMsg = $.parseJSON(e.data);
25   - msg80Handle(jsonMsg);
  29 + msgHandle[jsonMsg.fn](jsonMsg);
26 30 }catch(e){
27 31 console.log(e);
28 32 }
29 33 };
30 34 };
31 35  
32   -//驾驶员80上报处理
33   -var msg80Handle = function(msg){
  36 +var msgHandle = {
  37 + //驾驶员80上报处理
  38 + report80: function(msg){
  39 + msg.dateStr = moment(msg.timestamp).format('HH:mm');
  40 + msg.text = reqCodeMap[msg.data.requestCode];
  41 +
  42 + appendLogItem('console_80_temp', msg, msg.data.lineId);
  43 + },
  44 + //车辆发出
  45 + faChe: function(msg){
  46 + //刷新数据
  47 + _alone.refreshSchedule(msg.t);
  48 + //信使
  49 + appendLogItem('console_fache_temp', msg, msg.t.xlBm);
  50 + },
  51 + //到达终点
  52 + zhongDian: function(msg){
  53 + //刷新数据
  54 + _alone.refreshSchedule(msg.t);
  55 + _alone.refreshSchedule(msg.nt);
  56 + //信使
  57 + appendLogItem('console_zhongdian_temp', msg, msg.t.xlBm);
  58 + },
  59 + //指令状态改变
  60 + directive: function(msg){
  61 + var sch = msg.t;
  62 + if(!sch)return;
  63 + var tab = '#tab_line_' + sch.xlBm;
  64 + //找到行
  65 + var $tr = $('tr[data-id='+sch.id+']', tab);
  66 + //更新指令状态
  67 + var clazz = '';
  68 + switch (sch.directiveState) {
  69 + case 60:
  70 + clazz = 'tl-xxfc';
  71 + break;
  72 +
  73 + case 100:
  74 + clazz = 'tl-xxsd';
  75 + break;
  76 +
  77 + case 200:
  78 + clazz = 'tl-xxrd';
  79 + break;
  80 + case 0:
  81 + //发送调度指令失败
  82 + break;
  83 + }
  84 + $tr.find('td[data-name=clZbh]').attr('class', clazz);
  85 + }
  86 +};
  87 +
  88 +
  89 +function appendLogItem(tempId, json, lineCode){
  90 + var htmlStr = template(tempId, json);
  91 +
  92 + var logWrap = $('.console-log .log-item-list', '#tab_line_' + lineCode);
  93 + logWrap.prepend(htmlStr);
34 94 }
  95 +
  96 +}();
... ...
src/main/resources/static/pages/control/line/temps/alone_tp.html
... ... @@ -20,7 +20,7 @@
20 20 <td>待发</td>
21 21 <td>实发</td>
22 22 <td class="hide-lt-1080">原因</td>
23   - <td>类型</td>
  23 + <!--<td>类型</td>-->
24 24 </tr>
25 25 </thead>
26 26 </table>
... ... @@ -52,7 +52,7 @@
52 52 <td>待发</td>
53 53 <td>实发</td>
54 54 <td class="hide-lt-1080">原因</td>
55   - <td>类型</td>
  55 + <!--<td>类型</td>-->
56 56 </tr>
57 57 </thead>
58 58 </table>
... ... @@ -90,43 +90,6 @@
90 90 <div class="_panel">
91 91 <div class="console-log">
92 92 <div class="log-item-list">
93   - <div class="log-item handle">
94   - <span class="log-item-text">Q4A-007 请求出场</span>
95   - <span class="log-item-time">11:29</span>
96   - <span class="log-item-point">成山路停车场</span>
97   - <span class="log-item-handle">
98   - <button type="button" class="btn blue btn-sm">同意</button>
99   - <button type="button" class="btn red btn-sm">不同意</button>
100   - </span>
101   - </div>
102   -
103   - <div class="log-item">
104   - <span class="log-item-text">Q4A-007 请求出场</span>
105   - <span class="log-item-time">11:29</span>
106   - <span class="log-item-point">成山路停车场</span>
107   - <span class="log-item-result">已同意</span>
108   - </div>
109   -
110   - <div class="log-item">
111   - <span class="log-item-text">Q4A-007 请求出场</span>
112   - <span class="log-item-time">11:29</span>
113   - <span class="log-item-point">成山路停车场</span>
114   - <span class="log-item-result">已同意</span>
115   - </div>
116   -
117   - <div class="log-item">
118   - <span class="log-item-text">Q4A-007 请求出场</span>
119   - <span class="log-item-time">11:29</span>
120   - <span class="log-item-point">成山路停车场</span>
121   - <span class="log-item-result">已同意</span>
122   - </div>
123   -
124   - <div class="log-item">
125   - <span class="log-item-text">Q4A-007 请求恢复营运</span>
126   - <span class="log-item-time">11:29</span>
127   - <span class="log-item-point">金桥路博山东路</span>
128   - <span class="log-item-result">已同意(已下发营运指令)</span>
129   - </div>
130 93 </div>
131 94 </div>
132 95 <div class="_panel_footer tg_tools" id="tgTools_{{lineCode}}" data-linecode="{{lineCode}}">
... ... @@ -149,23 +112,48 @@
149 112 <tr data-id={{item.id}}>
150 113 <td name="lineNo"></td>
151 114 <td data-name="lpName"><a href="javascript:;">{{item.lpName}}</a></td>
152   - <td data-name="clZbh">{{item.clZbh}}</td>
153   - <td data-name="zdsj">{{item.zdsj}}</td>
154   - <td></td>
155   - <td data-name="fcsj" data-time="{{item.fcsjT}}">{{item.fcsj}}</td>
  115 +
  116 +{{if item.directiveState == 60}}
  117 + <td data-name="clZbh" class="tl-xxfc">{{item.clZbh}}</td>
  118 +{{else if item.directiveState == 100}}
  119 + <td data-name="clZbh" class="tl-xxsd">{{item.clZbh}}</td>
  120 +{{else if item.directiveState == 200}}
  121 + <td data-name="clZbh" class="tl-xxrd">{{item.clZbh}}</td>
  122 +{{else}}
  123 + <td data-name="clZbh" >{{item.clZbh}}</td>
  124 +{{/if}}
  125 +
  126 + <td data-name="qdzArrDateJH">{{item.qdzArrDateJH}}</td>
  127 + <td data-name="qdzArrDateSJ">{{item.qdzArrDateSJ}}</td>
  128 + <td data-name="fcsj" data-time="{{item.fcsjT}}">
  129 + {{item.fcsj}}
  130 + {{if item.bcType == "out"}}
  131 + <span class="out-badge"></span>
  132 + {{else if item.bcType == "in"}}
  133 + <span class="in-badge"></span>
  134 + {{/if}}
  135 + </td>
156 136 <td data-name="dfsj" data-time="{{item.zdsjT}}">{{item.dfsj}}</td>
157 137  
158   - {{if item.status == -1}}
159   - <td class="tl-qrlb">烂班</td>
160   - {{else}}
161   - <td></td>
162   - {{/if}}
  138 +{{if item.status == -1}}
  139 + <td class="tl-qrlb sfsj-item">烂班</td>
  140 +
  141 +{{else if item.status == 2}}
  142 + <td data-name="sjfcsj" class="tl-yzx sfsj-item">{{item.fcsjActual == null?"?":item.fcsjActual}}<span class="fcsj-diff">{{item.fcsj_diff}}</span></td>
  143 +
  144 +{{else if item.status == 1}}
  145 + <td data-name="sjfcsj" class="tl-zzzx sfsj-item">{{item.fcsjActual}}<span class="fcsj-diff">{{item.fcsj_diff}}</span></td>
  146 +
  147 +{{else }}
  148 + <td data-name="sjfcsj" class="sfsj-item">{{item.fcsjActual}}<span class="fcsj-diff">{{item.fcsj_diff}}</span></td>
  149 +{{/if}}
  150 +
163 151 <td class="hide-lt-1080" data-name="remarks">
164   - {{if item.remarks != null}}
165   - <a class="remarks-popover" href="javascript:;" data-toggle="popover" data-content="{{item.remarks}}" >备注</a>
166   - {{/if}}
  152 + {{if item.remarks != null}}
  153 + <a class="remarks-popover" href="javascript:;" data-toggle="popover" data-content="{{item.remarks}}" >备注...</a>
  154 + {{/if}}
167 155 </td>
168   - <td><a href="javascript:;">主</a></td>
  156 + <!--<td><a href="javascript:;">主</a></td>-->
169 157 </tr>
170 158 {{/each}}
171 159 </script>
... ... @@ -284,6 +272,7 @@
284 272 </div>
285 273 </div>
286 274 </form>
  275 +<br>
287 276 </script>
288 277  
289 278 <!-- 计划烂班设置 -->
... ... @@ -317,6 +306,7 @@
317 306 <span class="item-label" style="width: 80px;line-height: 32px;">调整说明:</span>
318 307 <br>
319 308 <select class="form-control" style="width: 100%;" name="reason">
  309 + <option value="">请选择..</option>
320 310 <option value="配车">配车</option>
321 311 <option value="保养">保养</option>
322 312 <option value="故障">故障</option>
... ... @@ -345,7 +335,7 @@
345 335 <div class="item full" >
346 336 <label>
347 337 <div class="checker">
348   - <span><input type="checkbox" value=1 name="spaceAdjust" class="icheck-blue" checked></span></div> 自动调整后续班次间隔为
  338 + <span><input type="checkbox" value=1 name="spaceAdjust" class="icheck-blue" ></span></div> 自动调整后续班次间隔为
349 339 </label>
350 340 <input type="number" name="spaceNum" value=15 style="width: 50px;height: 30px;margin: 0 5px;" > 分钟
351 341 &nbsp;<i class="fa fa-question-circle" style="cursor: pointer;" data-toggle="tooltip" data-placement="left" title="当前首个烂班为起点,调整后续班次间隔"></i>
... ... @@ -363,6 +353,7 @@
363 353  
364 354 <script id="real_outgo_adjust_body_temp" type="text/html">
365 355 <form action="#" class="form-horizontal form-custom" id="realOutgoAdjust">
  356 + <input type="hidden" name="id" value={{id}}>
366 357 <div class="form-custom-row">
367 358 <div class="item full">
368 359 <span class="item-label" style="width: 80px;">车辆: </span>
... ...
src/main/resources/static/pages/control/line/temps/console.html 0 → 100644
  1 +<!-- 信使模板 -->
  2 +
  3 +
  4 +<!-- 80协议上报 -->
  5 +<script id="console_80_temp" type="text/html">
  6 +<div class="log-item handle">
  7 + <span class="log-item-text">{{data.nbbm}} {{text}}</span>
  8 + <span class="log-item-time">{{dateStr}}</span>
  9 + <span class="log-item-handle">
  10 + <button type="button" class="btn blue btn-sm">同意</button>
  11 + <button type="button" class="btn red btn-sm">不同意</button>
  12 + </span>
  13 +</div>
  14 +</script>
  15 +
  16 +<script id="console_fache_temp" type="text/html">
  17 +<div class="log-item fache">
  18 + <span class="log-item-text">{{t.fcsjActual}} {{t.clZbh}} 已由 {{t.qdzName}} 发出</span>
  19 + <span class="log-item-text">执行班次 {{t.fcsj}}</span>
  20 + <span class="log-item-time">{{dataStr}}</span>
  21 + <span class="log-item-handle">
  22 + <a href="javascript:;" class="font-blue-steel log-close">确定</a>
  23 + <a href="javascript:;" class="font-red">地图</a>
  24 + </span>
  25 +</div>
  26 +</script>
  27 +
  28 +<script id="console_zhongdian_temp" type="text/html">
  29 +<div class="log-item zhongdian">
  30 + <span class="log-item-text">{{t.zdsjActual}} {{t.clZbh}} 到达 {{t.zdzName}};已完成 {{finish}} 个班次;下一发车时间 {{nt.fcsj}};由{{nt.qdzName}} 发往 {{nt.zdzName}};应到{{nt.zdsj}}</span>
  31 + <span class="log-item-time">{{dataStr}}</span>
  32 + <span class="log-item-handle">
  33 + <a href="javascript:;" class="font-blue-steel log-close">确定</a>
  34 + <a href="javascript:;" class="font-red">地图</a>
  35 + </span>
  36 +</div>
  37 +</script>
0 38 \ No newline at end of file
... ...
src/main/resources/static/pages/control/line/temps/home_table_tp.html
1   -
2 1 <script id="home_table_temp" type="text/html">
3 2 {{each list as obj i}}
4 3 <tr>
5   - <td> {{obj.nbbm}} </td>
6   - <td>
  4 + <td style="width: 22%;"> {{obj.nbbm}} </td>
  5 + <td style="width: 17%;">
7 6 {{if obj.currSch != null}}
8 7 {{obj.currSch.lpName}}
9 8 {{else}}
10 9
11 10 {{/if}}
12 11 </td>
13   - <td class="col_hide_1680"> {{obj.speed}} </td>
14   - <td> 暂无 </td>
15   - <td>
  12 + <td style="width: 17%;"> {{obj.speed}} </td>
  13 + <td style="width: 22%;" > 暂无 </td>
  14 + <td style="width: 22%;" class="col_hide_1680">
16 15 {{if obj.nextSch != null}}
17 16 {{obj.nextSch.dfsj}}
18 17 {{else}}
... ...
src/main/resources/static/pages/control/line/temps/home_tp.html
... ... @@ -29,21 +29,13 @@
29 29 </div>
30 30 <table class="table table-striped table-bordered table-advance"
31 31 style="table-layout: fixed;">
32   - <colgroup>
33   - <col style="width: 22%;">
34   - <col style="width: 17%;">
35   - <col style="width: 17%;">
36   - <col style="width: 22%;">
37   - <col style="width: 22%;">
38   -
39   - </colgroup>
40 32 <thead>
41 33 <tr>
42   - <th>车辆编码</th>
43   - <th>路牌</th>
44   - <th>速度</th>
45   - <th class="col_hide_1680">终点时间</th>
46   - <th>下一班</th>
  34 + <th style="width: 22%;">车辆编码</th>
  35 + <th style="width: 17%;">路牌</th>
  36 + <th style="width: 17%;">速度</th>
  37 + <th style="width: 22%;">终点时间</th>
  38 + <th style="width: 22%;" class="col_hide_1680">下一班</th>
47 39 </tr>
48 40 </thead>
49 41 </table>
... ... @@ -51,13 +43,6 @@
51 43 <table
52 44 class="table table-striped table-bordered table-advance table-hover vehicDataTable"
53 45 style="table-layout: fixed;" id="tab_{{lineObj.lineCode}}_0">
54   - <colgroup>
55   - <col style="width: 22%;">
56   - <col style="width: 17%;">
57   - <col style="width: 17%;">
58   - <col style="width: 22%;">
59   - <col style="width: 22%;">
60   - </colgroup>
61 46 <tbody></tbody>
62 47 </table>
63 48 </div>
... ... @@ -90,20 +75,13 @@
90 75 </div>
91 76 <table class="table table-striped table-bordered table-advance"
92 77 style="table-layout: fixed;">
93   - <colgroup>
94   - <col style="width: 22%;">
95   - <col style="width: 17%;">
96   - <col style="width: 17%;">
97   - <col style="width: 22%;">
98   - <col style="width: 22%;">
99   - </colgroup>
100 78 <thead>
101 79 <tr>
102   - <th>车辆编码</th>
103   - <th>路牌</th>
104   - <th>速度</th>
105   - <th class="col_hide_1680">终点时间</th>
106   - <th>下一班</th>
  80 + <th style="width: 22%;">车辆编码</th>
  81 + <th style="width: 17%;">路牌</th>
  82 + <th style="width: 17%;">速度</th>
  83 + <th style="width: 22%;">终点时间</th>
  84 + <th style="width: 22%;" class="col_hide_1680">下一班</th>
107 85 </tr>
108 86 </thead>
109 87 </table>
... ... @@ -111,14 +89,6 @@
111 89 <table
112 90 class="table table-striped table-bordered table-advance table-hover vehicDataTable"
113 91 style="table-layout: fixed;" id="tab_{{lineObj.lineCode}}_1">
114   - <colgroup>
115   - <col style="width: 22%;">
116   - <col style="width: 17%;">
117   - <col style="width: 17%;">
118   - <col style="width: 22%;">
119   - <col style="width: 22%;">
120   -
121   - </colgroup>
122 92 <tbody>
123 93 </tbody>
124 94 </table>
... ... @@ -146,4 +116,10 @@
146 116 <span style="color: #17589E;margin-left: 40px;">已成功连接服务器</span>
147 117 </div>
148 118 </div>
  119 +</script>
  120 +
  121 +<script id="ctrl_f_search_temp" type="text/html">
  122 +<div class="ctrl_f_search">
  123 + <select class="form-control pd90" id="ctrlFSearchSelect" ></select>
  124 +</div>
149 125 </script>
150 126 \ No newline at end of file
... ...
src/main/resources/static/pages/mapmonitor/real/temps/vehicle.html
... ... @@ -15,7 +15,6 @@
15 15 <div class="vehicle-item offline" >
16 16 <div class="text">
17 17 <span class="goto-marker" data-deviceId="{{deviceId}}"><i class="fa fa-circle"></i> &nbsp;W1B-397</span>
18   - &nbsp;&nbsp;&nbsp;
19 18 已掉线10分钟
20 19 </div>
21 20 <div class="icon">
... ... @@ -32,7 +31,6 @@
32 31 <div class="vehicle-item online" >
33 32 <div class="text">
34 33 <span class="nbbm goto-marker" data-deviceId="{{gpsObj.deviceId}}"><i class="fa fa-circle"></i> &nbsp;{{gpsObj.nbbm}}</span>
35   - &nbsp;&nbsp;&nbsp;
36 34 <span style="font-size: 13px;">{{gpsObj.stationName}}</span>
37 35 </div>
38 36 <div class="icon">
... ...