Commit 4bfbe881ac19649df43649c6c08445bf6c451492

Authored by 徐烜
2 parents 49e77097 c22797cf

Update

Showing 88 changed files with 11333 additions and 2220 deletions
1 1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2   - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  2 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3 3  
4 4 <modelVersion>4.0.0</modelVersion>
5 5 <groupId>com.bsth</groupId>
... ... @@ -237,27 +237,33 @@
237 237 <version>1.13</version>
238 238 </dependency>
239 239  
240   - <dependency>
241   - <groupId>org.dbunit</groupId>
242   - <artifactId>dbunit</artifactId>
243   - <version>2.4.9</version>
244   - <scope>test</scope>
  240 + <dependency>
  241 + <groupId>org.dbunit</groupId>
  242 + <artifactId>dbunit</artifactId>
  243 + <version>2.4.9</version>
  244 + <scope>test</scope>
245 245  
246   - <exclusions>
247   - <exclusion>
248   - <groupId>org.slf4j</groupId>
249   - <artifactId>slf4j-api</artifactId>
250   - </exclusion>
251   - </exclusions>
252   - </dependency>
  246 + <exclusions>
  247 + <exclusion>
  248 + <groupId>org.slf4j</groupId>
  249 + <artifactId>slf4j-api</artifactId>
  250 + </exclusion>
  251 + </exclusions>
  252 + </dependency>
  253 +
  254 + <dependency>
  255 + <groupId>com.h2database</groupId>
  256 + <artifactId>h2</artifactId>
  257 + <version>1.2.132</version>
  258 + <scope>test</scope>
  259 + </dependency>
253 260  
254   - <dependency>
255   - <groupId>com.h2database</groupId>
256   - <artifactId>h2</artifactId>
257   - <version>1.2.132</version>
258   - <scope>test</scope>
259   - </dependency>
260 261  
  262 + <dependency>
  263 + <groupId>ojdbc</groupId>
  264 + <artifactId>ojdbc</artifactId>
  265 + <version>14</version>
  266 + </dependency>
261 267 </dependencies>
262 268  
263 269 <dependencyManagement>
... ...
src/main/java/com/bsth/controller/forms/ExportController.java
... ... @@ -28,6 +28,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading;
28 28 import com.bsth.entity.mcy_forms.Waybillday;
29 29 import com.bsth.service.forms.ExportService;
30 30 import com.bsth.service.forms.FormsService;
  31 +import com.bsth.util.Arith;
31 32 import com.bsth.util.ReportUtils;
32 33  
33 34 @RestController
... ... @@ -167,7 +168,7 @@ public class ExportController {
167 168 }
168 169  
169 170 // 路单数据报表
170   - @RequestMapping(value = "/singledataExport", method = RequestMethod.POST)
  171 + @RequestMapping(value = "/singledataExport", method = RequestMethod.GET)
171 172 public List<Map<String, Object>> singledataExport(@RequestParam Map<String, Object> map) {
172 173 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
173 174 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -213,12 +214,12 @@ public class ExportController {
213 214 }
214 215  
215 216 // 车辆加注
216   - @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.POST)
  217 + @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET)
217 218 public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) {
218 219 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
219 220 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
220 221 ReportUtils ee = new ReportUtils();
221   - List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("gsdmVehic").toString(),map.get("fgsdmVehic").toString(),map.get("line").toString(),
  222 + List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(),
222 223 map.get("data").toString());
223 224 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
224 225 int i = 1;
... ... @@ -252,7 +253,7 @@ public class ExportController {
252 253 }
253 254  
254 255 // 运营服务阶段报表
255   - @RequestMapping(value = "/operationserviceExport", method = RequestMethod.POST)
  256 + @RequestMapping(value = "/operationserviceExport", method = RequestMethod.GET)
256 257 public List<Map<String, Object>> operationserviceExport(@RequestParam Map<String, Object> map) {
257 258 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
258 259 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -558,17 +559,13 @@ public class ExportController {
558 559 List<Daily> allline = formsService.daily(map);
559 560  
560 561 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
561   - Float zgl=0f;
562   - Float ks=0f;
563   - Float yh=0f;
564   - Float bc=0f;
  562 + double zgl=0.0;
  563 + double ks=0.0;
  564 + double yh=0.0;
  565 + int bc=0;
565 566 Map<String, Object> m ;
566 567 for (Daily d : allline) {
567 568 m = new HashMap<String, Object>();
568   - zgl +=d.getZlc()==""?0f:Float.valueOf(d.getZlc());
569   - ks +=d.getJzl1()==""?0f:Float.valueOf(d.getJzl1());
570   - yh +=d.getYh()==""?0f:Float.valueOf(d.getYh());
571   - bc +=d.getBc()==""?0f:Float.valueOf(d.getBc());
572 569 m.put("zbh", d.getZbh());
573 570 m.put("jgh",d.getJgh());
574 571 m.put("jName", d.getjName());
... ... @@ -576,9 +573,13 @@ public class ExportController {
576 573 m.put("jzl1", d.getJzl1());
577 574 m.put("yh", d.getYh());
578 575 m.put("bc", d.getBc());
  576 + zgl =Arith.add(zgl, d.getZlc());
  577 + ks =Arith.add(ks, d.getJzl1());
  578 + yh =Arith.add(yh, d.getYh());
  579 + bc +=Integer.parseInt(d.getBc());
579 580  
580 581 resList.add(m);
581   - }
  582 + }
582 583  
583 584 m=new HashMap<String,Object>();
584 585 m.put("total_zgl", zgl);
... ...
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
... ... @@ -73,21 +73,20 @@ public class MCY_FormsController {
73 73 }
74 74  
75 75 // 路单数据
76   - @RequestMapping(value = "/singledata", method = RequestMethod.POST)
  76 + @RequestMapping(value = "/singledata", method = RequestMethod.GET)
77 77 public List<Singledata> singledata(@RequestParam Map<String, Object> map) {
78 78  
79 79 return formsService.singledata(map);
80 80 }
81 81  
82 82 // 车辆加注
83   - @RequestMapping(value = "/vehicleloading", method = RequestMethod.POST)
84   - public List<Vehicleloading> vehicleloading(@RequestParam String gsdmVehic, @RequestParam String fgsdmVehic,
85   - @RequestParam String line, @RequestParam String data) {
86   - return formsService.vehicleloading(gsdmVehic, fgsdmVehic, line, data);
  83 + @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET)
  84 + public List<Vehicleloading> vehicleloading(@RequestParam String line, @RequestParam String data) {
  85 + return formsService.vehicleloading(line, data);
87 86 }
88 87  
89 88 // 运营服务阶段报表
90   - @RequestMapping(value = "/operationservice", method = RequestMethod.POST)
  89 + @RequestMapping(value = "/operationservice", method = RequestMethod.GET)
91 90 public List<Operationservice> operationservice(@RequestParam Map<String, Object> map) {
92 91  
93 92 return formsService.operationservice(map);
... ...
src/main/java/com/bsth/controller/oil/YlbController.java
... ... @@ -238,9 +238,11 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
238 238 Map<String, Object> m = new HashMap<String, Object>();
239 239 m.put("rq", y.getRq());
240 240 m.put("gsname",y.getGsname() );
  241 + m.put("fgsname", y.getFgsname());
241 242 m.put("xlname", y.getXlname());
242 243 m.put("nbbm", y.getNbbm());
243 244 m.put("jsy", y.getJsy());
  245 + m.put("name", y.getName());
244 246 m.put("jzl", y.getJzl());
245 247 m.put("czlc", y.getCzlc());
246 248 m.put("jzlc", y.getJzlc());
... ...
src/main/java/com/bsth/controller/realcontrol/DataManagerController.java 0 → 100644
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.service.realcontrol.DataManagerService;
  4 +import org.apache.commons.lang3.StringEscapeUtils;
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestParam;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +
  10 +import java.util.Map;
  11 +
  12 +/**
  13 + * 数据管理,包括从老系统的数据迁移。新系统的数据校验等
  14 + * Created by panzhao on 2017/4/17.
  15 + */
  16 +@RestController
  17 +@RequestMapping("dataManager")
  18 +public class DataManagerController {
  19 +
  20 + @Autowired
  21 + DataManagerService dataManagerService;
  22 +
  23 + @RequestMapping("cars/old_now")
  24 + public Map<String, Object> carInfos(@RequestParam Integer lineId){
  25 + return dataManagerService.carInfos(lineId);
  26 + }
  27 +
  28 + @RequestMapping("car/updateDevices")
  29 + public Map<String, Object> updateDevices(@RequestParam String jsonStr){
  30 + jsonStr = StringEscapeUtils.unescapeHtml4(jsonStr);
  31 + return dataManagerService.updateDevices(jsonStr);
  32 + }
  33 +}
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -543,4 +543,25 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
543 543 rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR);
544 544 return rs;
545 545 }
  546 +
  547 + /**
  548 + * 误点调整
  549 + * @param idx
  550 + * @param minute
  551 + * @return
  552 + */
  553 + @RequestMapping(value = "lateAdjust", method = RequestMethod.POST)
  554 + public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){
  555 + return scheduleRealInfoService.lateAdjust(idx, minute);
  556 + }
  557 +
  558 + /**
  559 + * 获取所有应发未到的班次
  560 + * @param idx
  561 + * @return
  562 + */
  563 + @RequestMapping(value = "allLate2")
  564 + public List<ScheduleRealInfo> allLate2(@RequestParam String idx){
  565 + return scheduleRealInfoService.allLate2(idx);
  566 + }
546 567 }
... ...
src/main/java/com/bsth/controller/report/ReportController.java
1 1 package com.bsth.controller.report;
2 2  
  3 +import java.util.ArrayList;
3 4 import java.util.HashMap;
  5 +import java.util.Iterator;
4 6 import java.util.List;
5 7 import java.util.Map;
6 8  
... ... @@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
13 15 import com.bsth.entity.excep.ArrivalInfo;
14 16 import com.bsth.entity.realcontrol.ScheduleRealInfo;
15 17 import com.bsth.service.report.ReportService;
  18 +import com.bsth.util.ReportUtils;
16 19  
17 20 @RestController
18 21 @RequestMapping("report")
... ... @@ -31,12 +34,74 @@ public class ReportController {
31 34 @RequestParam String date,@RequestParam String fcsj,@RequestParam String ddsj){
32 35 return service.queryListZdxx(line,date,clzbh,fcsj,ddsj);
33 36 }
  37 +
  38 + @RequestMapping(value="/exportQueryListZdxx" ,method = RequestMethod.GET)
  39 + public List<Map<String, Object>> exportQueryListZdxx(@RequestParam String clzbh,@RequestParam String line,
  40 + @RequestParam String date,@RequestParam String fcsj,@RequestParam String ddsj){
  41 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  42 + ReportUtils ee = new ReportUtils();
  43 + List<ArrivalInfo> list=service.queryListZdxx(line,date,clzbh,fcsj,ddsj);
  44 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  45 + int i=1;
  46 + for (ArrivalInfo a:list ) {
  47 + Map<String, Object> m = new HashMap<String, Object>();
  48 + m.put("i", i);
  49 + m.put("mbbm", a.getNbbm());
  50 + m.put("stopName", a.getStopName());
  51 + m.put("jzsj", a.getJzsj());
  52 + m.put("czsj", a.getCzsj());
  53 + m.put("upDown", a.getUpDown()==0?"上行":"下行");
  54 + i++;
  55 + }
  56 +
  57 + try {
  58 + Map<String, Object> map=new HashMap<String, Object>();
  59 + listI.add(resList.iterator());
  60 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  61 + ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls",
  62 + path + "export/班次到离站.xls");
  63 + } catch (Exception e) {
  64 + e.printStackTrace();
  65 + }
  66 + return resList;
  67 + }
  68 +
34 69 @RequestMapping(value="/queryListClzd" ,method = RequestMethod.GET)
35 70 public List<ArrivalInfo> queryListClzd(@RequestParam String zd,@RequestParam String line,
36 71 @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){
37 72 return service.queryListClzd(line,zd,zdlx,fcsj,ddsj);
38 73 }
39 74  
  75 + @RequestMapping(value="/exportQueryListClzd" ,method = RequestMethod.GET)
  76 + public List<Map<String, Object>> exportQueryListClzd(@RequestParam String zd,@RequestParam String line,
  77 + @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){
  78 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  79 + ReportUtils ee = new ReportUtils();
  80 + List<ArrivalInfo> list=service.queryListClzd(line, zd, zdlx, fcsj, ddsj);
  81 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  82 + int i=1;
  83 + for (ArrivalInfo a:list ) {
  84 + Map<String, Object> m = new HashMap<String, Object>();
  85 + m.put("i", i);
  86 + m.put("nbbm", a.getNbbm());
  87 + m.put("stopName", a.getStopName());
  88 + m.put("jzsj", a.getJzsj());
  89 + m.put("czsj", a.getCzsj());
  90 + m.put("upDown", a.getUpDown()==0?"上行":"下行");
  91 + i++;
  92 + }
  93 +
  94 + try {
  95 + Map<String, Object> map=new HashMap<String, Object>();
  96 + listI.add(resList.iterator());
  97 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  98 + ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls",
  99 + path + "export/班次到离站.xls");
  100 + } catch (Exception e) {
  101 + e.printStackTrace();
  102 + }
  103 + return resList;
  104 + }
40 105 @RequestMapping(value = "/sreachZd", method = RequestMethod.GET)
41 106 public List<Map<String, String>> sreachPersonnel(@RequestParam String line,@RequestParam int zdlx,@RequestParam String zd) {
42 107 return service.sreachZd(line,zdlx, zd);
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -332,7 +332,8 @@ public class BasicData implements CommandLineRunner {
332 332 }
333 333  
334 334 perTempMap.put(jobCode, p);
335   - allPersonMap.put(jobCode, p.getPersonnelName());
  335 +
  336 + allPersonMap.put(jobCode.substring(jobCode.indexOf("-")+1), p.getPersonnelName());
336 337 }
337 338  
338 339 jsyMap = jsyTempMap;
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
... ... @@ -8,6 +8,7 @@ import com.bsth.data.gpsdata.arrival.utils.ScheduleSignalState;
8 8 import com.bsth.data.gpsdata.arrival.utils.SignalSchPlanMatcher;
9 9 import com.bsth.data.schedule.DayOfSchedule;
10 10 import com.bsth.data.schedule.ScheduleComparator;
  11 +import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
11 12 import com.bsth.entity.realcontrol.LineConfig;
12 13 import com.bsth.entity.realcontrol.ScheduleRealInfo;
13 14 import com.bsth.service.directive.DirectiveService;
... ... @@ -145,6 +146,9 @@ public class InOutStationSignalHandle extends SignalHandle{
145 146 //持久化
146 147 dayOfSchedule.save(sch);
147 148  
  149 + //清理应发未发标记
  150 + LateAdjustHandle.remove(sch);
  151 +
148 152 if(sch.getBcType().equals("out")){
149 153 //出场时,切换成营运状态
150 154 directiveService.send60Operation(sch.getClZbh(), 0, Integer.parseInt(sch.getXlDir()), null, "出场@系统");
... ... @@ -242,6 +246,10 @@ public class InOutStationSignalHandle extends SignalHandle{
242 246 long rsT = lineConfigData.applyIn(sch, gps.getTimestamp());
243 247  
244 248 sch.setZdsjActualAll(rsT);
  249 +
  250 + //通知误点停靠程序,有车辆到站
  251 + LateAdjustHandle.carArrive(gps);
  252 +
245 253 //已完成班次数
246 254 int doneSum = dayOfSchedule.doneSum(sch.getClZbh());
247 255 ScheduleRealInfo next = dayOfSchedule.next(sch);
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -10,6 +10,7 @@ import com.bsth.data.LineConfigData;
10 10 import com.bsth.data.directive.DirectivesPstThread;
11 11 import com.bsth.data.gpsdata.GpsRealData;
12 12 import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
  13 +import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
13 14 import com.bsth.data.schedule.thread.*;
14 15 import com.bsth.entity.realcontrol.LineConfig;
15 16 import com.bsth.entity.realcontrol.ScheduleRealInfo;
... ... @@ -153,10 +154,10 @@ public class DayOfSchedule implements CommandLineRunner {
153 154 diff += (1000 * 60 * 60 * 24);
154 155  
155 156 logger.info(diff / 1000 / 60 + "分钟之后提交到运管处");
156   - //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  157 + //Application.mainServices.scheduleAtFixedRate(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
157 158  
158 159 //计算油、公里加注
159   - Application.mainServices.scheduleWithFixedDelay(calcOilThread, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  160 + Application.mainServices.scheduleAtFixedRate(calcOilThread, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
160 161  
161 162 //指令持久化线程
162 163 Application.mainServices.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS);
... ... @@ -386,6 +387,11 @@ public class DayOfSchedule implements CommandLineRunner {
386 387 sch.setLate(false);
387 388 }
388 389  
  390 + //售票员为空设置为""字符串
  391 + if(StringUtils.isEmpty(sch.getsGh())){
  392 + sch.setsGh("");
  393 + sch.setsName("");
  394 + }
389 395 sch.setJhlcOrig(sch.getJhlc());
390 396 //保留备注
391 397 if(StringUtils.isNotEmpty(sch.getRemark()))
... ...
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
1   -package com.bsth.data.schedule.late_adjust;
2   -
3   -/**
4   - * 误点调整处理程序
5   - * Created by panzhao on 2017/4/16.
6   - */
7   -public class LateAdjustHandle {
8   -
9   -}
  1 +
  2 +package com.bsth.data.schedule.late_adjust;
  3 +
  4 +import com.bsth.data.LineConfigData;
  5 +import com.bsth.data.gpsdata.GpsEntity;
  6 +import com.bsth.entity.realcontrol.LineConfig;
  7 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  8 +import com.bsth.websocket.handler.SendUtils;
  9 +import org.slf4j.Logger;
  10 +import org.slf4j.LoggerFactory;
  11 +import org.springframework.beans.BeansException;
  12 +import org.springframework.context.ApplicationContext;
  13 +import org.springframework.context.ApplicationContextAware;
  14 +import org.springframework.stereotype.Component;
  15 +
  16 +import java.util.Collection;
  17 +import java.util.HashMap;
  18 +import java.util.Map;
  19 +
  20 +/**
  21 + * 误点自动调整待发 处理程序
  22 + *
  23 + * 注意 :这里的误点是指应发未到
  24 + * Created by panzhao on 2017/4/16.
  25 + */
  26 +@Component
  27 +public class LateAdjustHandle implements ApplicationContextAware{
  28 +
  29 + static LineConfigData lineConfigData;
  30 + static SendUtils sendUtils;
  31 +
  32 + static Logger logger = LoggerFactory.getLogger(LateAdjustHandle.class);
  33 +
  34 + /**
  35 + * 应发未到车辆 和 班次
  36 + */
  37 + private static Map<String, ScheduleRealInfo> lateSchMap;
  38 +
  39 +
  40 + static {
  41 + lateSchMap = new HashMap<>();
  42 + }
  43 +
  44 + /**
  45 + * 新增一个误点班次
  46 + * @param sch
  47 + */
  48 + public static void putLate(ScheduleRealInfo sch){
  49 + try {
  50 + //线路配置
  51 + LineConfig config = lineConfigData.get(sch.getXlBm());
  52 + if(sch.getLateMinute() == 0){
  53 + if(config.isEnableYjtk()){
  54 + sch.setLateMinute(sch.getXlDir().equals("0")?config.getUpStopMinute():config.getDownStopMinute());
  55 + }
  56 + else
  57 + return;
  58 + }
  59 +
  60 + if(sch.getDfsj().compareTo(config.getYjtkStart()) > 0
  61 + && sch.getDfsj().compareTo(config.getYjtkEnd()) <= 0){
  62 +
  63 + ScheduleRealInfo cancel = null;
  64 + //之前存在误点班次没有发出
  65 + ScheduleRealInfo old = lateSchMap.get(sch.getClZbh());
  66 + if(old != null && old.getDfsjT() < sch.getDfsjT()){
  67 + remove(old);
  68 + cancel = old;
  69 + logger.info("【应发未到】old 班次 " + old.getId() + " -被覆盖!");
  70 + }
  71 +
  72 + lateSchMap.put(sch.getClZbh(), sch);
  73 + //通知客户端
  74 + sch.setLate2(true);
  75 + sendUtils.sendAutoWdtz(sch, cancel);
  76 +
  77 + logger.info("【应发未到】班次 " + sch.getClZbh() + " -" + sch.getDfsj() + " -id: " + sch.getId() + " -加入误点调整!");
  78 + }
  79 + }catch (Exception e){
  80 + logger.error("", e);
  81 + }
  82 + }
  83 +
  84 +
  85 + /**
  86 + * 获取所有应发未到的班次
  87 + * @return
  88 + */
  89 + public static Collection<ScheduleRealInfo> allLateSch(){
  90 + return lateSchMap.values();
  91 + }
  92 +
  93 + public static void remove(ScheduleRealInfo sch){
  94 + try {
  95 + if(lateSchMap.get(sch.getClZbh()) == sch){
  96 + lateSchMap.remove(sch.getClZbh());
  97 + sch.setLate2(false);
  98 + sch.setLateMinute(0);
  99 + }
  100 + }catch (Exception e){
  101 + logger.error("", e);
  102 + }
  103 + }
  104 +
  105 + /**
  106 + * 车辆到站
  107 + * @param gps
  108 + */
  109 + public static void carArrive(GpsEntity gps){
  110 + try{
  111 + if(gps.getInstation() != 1)
  112 + return;
  113 +
  114 + ScheduleRealInfo sch = lateSchMap.get(gps.getNbbm());
  115 + if(sch == null)
  116 + return;
  117 +
  118 + //进的是班次起点
  119 + if(gps.getStopNo().equals(sch.getQdzCode())
  120 + && sch.getLateMinute() > 0){
  121 + //自动调整待发 到达时间 + 停靠时间
  122 + long dt = gps.getTimestamp() + (Long.parseLong(String.valueOf(sch.getLateMinute() * 60 * 1000)));
  123 + sch.setDfsjAll(dt);
  124 + sch.setDfAuto(true);
  125 +
  126 + lateSchMap.remove(sch.getClZbh());
  127 + logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt);
  128 + }
  129 + }catch (Exception e){
  130 + logger.error("", e);
  131 + }
  132 + }
  133 +
  134 + @Override
  135 + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  136 + lineConfigData = applicationContext.getBean(LineConfigData.class);
  137 + sendUtils = applicationContext.getBean(SendUtils.class);
  138 + }
  139 +}
10 140 \ No newline at end of file
... ...
src/main/java/com/bsth/data/schedule/thread/ScheduleLateThread.java renamed to src/main/java/com/bsth/data/schedule/late_adjust/ScheduleLateThread.java
1   -package com.bsth.data.schedule.thread;
  1 +package com.bsth.data.schedule.late_adjust;
2 2  
3 3  
4   -import java.util.ArrayList;
5   -import java.util.Collections;
6   -import java.util.Comparator;
7   -import java.util.List;
8   -
9   -import org.springframework.beans.factory.annotation.Autowired;
10   -import org.springframework.stereotype.Component;
11   -
12 4 import com.bsth.data.schedule.DayOfSchedule;
13 5 import com.bsth.data.schedule.ScheduleComparator;
14 6 import com.bsth.entity.realcontrol.ScheduleRealInfo;
15 7 import com.bsth.websocket.handler.SendUtils;
  8 +import org.apache.commons.lang3.StringUtils;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Component;
  11 +
  12 +import java.util.ArrayList;
  13 +import java.util.Collections;
  14 +import java.util.Comparator;
  15 +import java.util.List;
16 16  
17 17 /**
18   - *
19   - * @ClassName: ScheduleLateThread
20   - * @Description: TODO(班次误点扫描线程)
21   - * @author PanZhao
  18 + *
  19 + * @ClassName: ScheduleLateThread
  20 + * @Description: TODO(班次误点扫描线程)
  21 + * @author PanZhao
22 22 * @date 2016年8月31日 下午3:09:02
23 23 *
24 24 */
... ... @@ -27,29 +27,39 @@ public class ScheduleLateThread extends Thread{
27 27  
28 28 @Autowired
29 29 DayOfSchedule dayOfSchedule;
30   -
  30 +
31 31 @Autowired
32 32 SendUtils sendUtils;
33   -
  33 +
34 34 private static Comparator<ScheduleRealInfo> cpm = new ScheduleComparator.FCSJ();
35   -
  35 +
36 36 @Override
37 37 public void run() {
38 38 List<ScheduleRealInfo> all = new ArrayList<>(dayOfSchedule.findAll());
39 39 Collections.sort(all, cpm);
40   -
  40 +
41 41 long t = System.currentTimeMillis();
42 42 int size = all.size();
43   -
  43 +
44 44 ScheduleRealInfo sch;
45 45 for(int i = 0; i < size; i ++){
46 46 sch = all.get(i);
47   - if(sch.getDfsjT() > t)
  47 + if(sch.getDfsjT() > t || sch.isLate())
48 48 break;
49   -
50   - if(sch.isLate() == false
51   - && sch.getStatus() == 0
  49 +
  50 + if(sch.getStatus() == 0
52 51 && sch.getFcsjActual() == null){
  52 +
  53 + //检查应发未到 当前班次无起点到达时间
  54 + if(StringUtils.isEmpty(sch.getQdzArrDateSJ())){
  55 + ScheduleRealInfo prev = dayOfSchedule.prev(sch);
  56 + //上一个班次也没有实际终点到达时间
  57 + if(prev != null && StringUtils.isEmpty(prev.getZdsjActual())){
  58 + //进入误点调整程序
  59 + LateAdjustHandle.putLate(sch);
  60 + }
  61 + }
  62 +
53 63 //应发未发
54 64 sch.setLate(true);
55 65 //通知客户端
... ... @@ -57,4 +67,4 @@ public class ScheduleLateThread extends Thread{
57 67 }
58 68 }
59 69 }
60   -}
  70 +}
61 71 \ No newline at end of file
... ...
src/main/java/com/bsth/entity/mcy_forms/Operationservice.java
... ... @@ -3,7 +3,7 @@ package com.bsth.entity.mcy_forms;
3 3 public class Operationservice {
4 4  
5 5 private String xlName;//线路
6   -
  6 + private String xlBm;//线路编码
7 7 private String jzl;//加注量
8 8  
9 9 private String xhl;//消耗量
... ... @@ -81,6 +81,14 @@ public class Operationservice {
81 81 public void setSjbc(String sjbc) {
82 82 this.sjbc = sjbc;
83 83 }
  84 +
  85 + public String getXlBm() {
  86 + return xlBm;
  87 + }
  88 +
  89 + public void setXlBm(String xlBm) {
  90 + this.xlBm = xlBm;
  91 + }
84 92  
85 93  
86 94 }
... ...
src/main/java/com/bsth/entity/oil/Ylb.java
... ... @@ -63,6 +63,11 @@ public class Ylb {
63 63 @Transient
64 64 private String gsname;
65 65  
  66 + @Transient
  67 + private String fgsname;
  68 +
  69 + @Transient
  70 + private String name;
66 71  
67 72 public Integer getId() {
68 73 return id;
... ... @@ -299,6 +304,22 @@ public class Ylb {
299 304 }
300 305  
301 306  
  307 + public String getFgsname() {
  308 + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.ssgsdm);
  309 + }
  310 +
  311 + public void setFgsname(String fgsname) {
  312 + this.fgsname = fgsname;
  313 + }
  314 +
  315 + public String getName() {
  316 + return BasicData.allPerson.get(this.jsy);
  317 + }
  318 +
  319 + public void setName(String name) {
  320 + this.name = name;
  321 + }
  322 +
302 323  
303 324  
304 325  
... ...
src/main/java/com/bsth/entity/realcontrol/LineConfig.java
... ... @@ -82,7 +82,9 @@ public class LineConfig {
82 82 * 应急停靠
83 83 */
84 84 private boolean enableYjtk;
  85 + /** HH:mm */
85 86 private String yjtkStart;
  87 + /** HH:mm */
86 88 private String yjtkEnd;
87 89 private int upStopMinute;
88 90 private int downStopMinute;
... ...
src/main/java/com/bsth/entity/realcontrol/OilStationSociety.java
... ... @@ -21,6 +21,11 @@ public class OilStationSociety {
21 21 private String stationName;
22 22  
23 23 /**
  24 + * 加油站编码(为空则默认社会加油站)
  25 + */
  26 + private String stationCode;
  27 +
  28 + /**
24 29 * 上行进场距离
25 30 */
26 31 private Double upInMile;
... ... @@ -137,4 +142,12 @@ public class OilStationSociety {
137 142 public void setDownOutTime(int downOutTime) {
138 143 this.downOutTime = downOutTime;
139 144 }
  145 +
  146 + public String getStationCode() {
  147 + return stationCode;
  148 + }
  149 +
  150 + public void setStationCode(String stationCode) {
  151 + this.stationCode = stationCode;
  152 + }
140 153 }
... ...
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
... ... @@ -139,10 +139,17 @@ public class ScheduleRealInfo {
139 139 /** 是否是临加班次 */
140 140 private boolean sflj;
141 141  
142   - /** 是否误点*/
  142 + /** 是否误点 (应发未发)*/
143 143 @Transient
144 144 private boolean late;
145 145  
  146 + /** 是否误点 (应发未到) */
  147 + @Transient
  148 + private boolean late2;
  149 + /** 误点停靠时间 */
  150 + @Transient
  151 + private float lateMinute;
  152 +
146 153 /** 备注*/
147 154 private String remarks;
148 155  
... ... @@ -887,4 +894,20 @@ public class ScheduleRealInfo {
887 894 public void setRemark(String remark) {
888 895 this.remark = remark;
889 896 }
  897 +
  898 + public float getLateMinute() {
  899 + return lateMinute;
  900 + }
  901 +
  902 + public void setLateMinute(float lateMinute) {
  903 + this.lateMinute = lateMinute;
  904 + }
  905 +
  906 + public boolean isLate2() {
  907 + return late2;
  908 + }
  909 +
  910 + public void setLate2(boolean late2) {
  911 + this.late2 = late2;
  912 + }
890 913 }
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -151,18 +151,19 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
151 151  
152 152 //按照时间段统计
153 153 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
154   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') and gsBm like %?4% and fgsBm like %?5% order by s.xlBm")
  154 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and gsBm like %?4% and fgsBm like %?5% order by s.xlBm")
155 155 List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm);
156 156  
157 157 //按照时间段统计
158 158 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
159   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm")
  159 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 order by s.xlBm")
160 160 List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2);
161 161 //月报表
162 162 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
163 163 @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 order by s.xlBm")
164 164 List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2);
165 165  
  166 +
166 167 @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY clZbh,fcsj")
167 168 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm);
168 169  
... ...
src/main/java/com/bsth/service/excep/impl/OfflineServiceImpl.java
... ... @@ -56,7 +56,7 @@ public class OfflineServiceImpl implements OfflineService {
56 56 Object date=map.get("date");
57 57  
58 58 if(line!=null){
59   - sql +=" and line like'%"+line.toString()+"%'";
  59 + sql +=" and line like'%"+line.toString().trim()+"%'";
60 60 }
61 61  
62 62 if(nbbm!=null){
... ... @@ -131,6 +131,7 @@ public class OfflineServiceImpl implements OfflineService {
131 131 @SuppressWarnings("unchecked")
132 132 public PageObject <Offline> Pagequery(Map<String, Object> map) {
133 133 // TODO Auto-generated method stub
  134 +
134 135 String sql="select count(*) record from bsth_c_offline where 1=1 ";
135 136  
136 137 Object line=map.get("line");
... ... @@ -140,7 +141,7 @@ public class OfflineServiceImpl implements OfflineService {
140 141 Object date=map.get("date");
141 142  
142 143 if(line!=null){
143   - sql +=" and line like'%"+line.toString()+"%'";
  144 + sql +=" and line like'%"+line.toString().trim()+"%'";
144 145 }
145 146  
146 147 if(nbbm!=null){
... ... @@ -194,10 +195,9 @@ public class OfflineServiceImpl implements OfflineService {
194 195 Date datess = new Date(d1);
195 196 String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
196 197 String sk=new SimpleDateFormat("HH:mm").format(datess);
197   - String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
198   - + " real_exec_date='"+dates+"' ";
199   -// + "and fcsj_actual > '"+sk+"' ";
200   -// + "and '"+sk+"' <dfsj";
  198 + String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj"
  199 + + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  200 + + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ;
201 201 List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
202 202 new RowMapper<ScheduleRealInfo>(){
203 203 @Override
... ... @@ -208,20 +208,15 @@ public class OfflineServiceImpl implements OfflineService {
208 208 s.setLpName(rs.getString("lp_name"));
209 209 return s;
210 210 }
211   - });
212   - if(pbb.size()>0){
213   - list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
214   - list.get(i).setLpname(pbb.get(0).getLpName());
215   -
216   - }
217   -
  211 + });
  212 + if(pbb.size()>0){
  213 + list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName());
  214 + list.get(i).setLpname(pbb.get(0).getLpName());
  215 + }
218 216 }
  217 +
219 218 PageObject<Offline> pageObject = pageHelper.getPageObject();
220   -// for (int i = 0; i < list.size(); i++) {
221   -// if(list.get(i).getLpname()!=null){
222 219 pageObject.setDataList(list);
223   -// }
224   -// }
225 220  
226 221 return pageObject;
227 222 }
... ...
src/main/java/com/bsth/service/excep/impl/OutboundServiceImpl.java
... ... @@ -43,7 +43,7 @@ public class OutboundServiceImpl implements OutboundService{
43 43 Object updown=map.get("updown");
44 44 Object date=map.get("date");
45 45 if(line!=null){
46   - sql +=" and line like'%"+line.toString()+"%'";
  46 + sql +=" and line like'%"+line.toString().trim()+"%'";
47 47 }
48 48  
49 49 if(nbbm!=null){
... ... @@ -105,7 +105,7 @@ public class OutboundServiceImpl implements OutboundService{
105 105 outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp())));
106 106 outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString()));
107 107 outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString()));
108   - outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());
  108 +// outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString());
109 109 list.add(outbound);
110 110 }
111 111 return list;
... ... @@ -120,7 +120,7 @@ public class OutboundServiceImpl implements OutboundService{
120 120 Object updown=map.get("updown");
121 121 Object date=map.get("date");
122 122 if(line!=null){
123   - sql +=" and line like '%"+line.toString()+"%'";
  123 + sql +=" and line like '%"+line.toString().trim()+"%'";
124 124  
125 125 }
126 126  
... ... @@ -174,10 +174,9 @@ public class OutboundServiceImpl implements OutboundService{
174 174 Date datess = new Date(d1);
175 175 String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
176 176 String sk=new SimpleDateFormat("HH:mm").format(datess);
177   - String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
178   - + " real_exec_date='"+dates+"' ";
179   -// + "and fcsj_actual > '"+sk+"' ";
180   -// + "and '"+sk+"' <dfsj";
  177 + String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj"
  178 + + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  179 + + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ;
181 180 List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
182 181 new RowMapper<ScheduleRealInfo>(){
183 182 @Override
... ...
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
... ... @@ -46,7 +46,7 @@ public class SpeedingServiceImpl implements SpeedingService {
46 46 Object date=map.get("date");
47 47  
48 48 if(line!=null){
49   - sql +=" and line like'%"+line.toString()+"%'";
  49 + sql +=" and line like'%"+line.toString().trim()+"%'";
50 50 }
51 51  
52 52 if(nbbm!=null){
... ... @@ -125,7 +125,7 @@ public class SpeedingServiceImpl implements SpeedingService {
125 125 Object date=map.get("date");
126 126  
127 127 if(line!=null){
128   - sql +=" and line like'%"+line.toString()+"%'";
  128 + sql +=" and line like'%"+line.toString().trim()+"%'";
129 129 }
130 130  
131 131 if(nbbm!=null){
... ... @@ -177,10 +177,9 @@ public class SpeedingServiceImpl implements SpeedingService {
177 177 Date datess = new Date(d1);
178 178 String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess);
179 179 String sk=new SimpleDateFormat("HH:mm").format(datess);
180   - String sqlPbb="select * from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
181   - + " real_exec_date='"+dates+"' ";
182   -// + "and fcsj_actual > '"+sk+"' ";
183   -// + "and '"+sk+"' <dfsj";
  180 + String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj"
  181 + + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and"
  182 + + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ;
184 183 List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb,
185 184 new RowMapper<ScheduleRealInfo>(){
186 185 @Override
... ...
src/main/java/com/bsth/service/forms/FormsService.java
... ... @@ -31,7 +31,7 @@ public interface FormsService {
31 31  
32 32 public List<Singledata> singledata(Map<String, Object> map);
33 33  
34   - public List<Vehicleloading> vehicleloading(String gsdmVehic,String fgsdmVehic,String line,String data);
  34 + public List<Vehicleloading> vehicleloading(String line,String data);
35 35  
36 36 public List<Operationservice> operationservice(Map<String, Object> map);
37 37  
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -25,7 +25,9 @@ import com.bsth.entity.mcy_forms.Singledata;
25 25 import com.bsth.entity.mcy_forms.Turnoutrate;
26 26 import com.bsth.entity.mcy_forms.Vehicleloading;
27 27 import com.bsth.entity.mcy_forms.Waybillday;
  28 +import com.bsth.entity.oil.Ylb;
28 29 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  30 +import com.bsth.repository.oil.YlbRepository;
29 31 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
30 32 import com.bsth.data.BasicData;
31 33 import com.bsth.entity.mcy_forms.Allline;
... ... @@ -55,6 +57,9 @@ public class FormsServiceImpl implements FormsService {
55 57  
56 58 @Autowired
57 59 CulateMileageService culateMileageService;
  60 +
  61 + @Autowired
  62 + YlbRepository ylbRepository;
58 63  
59 64 // 行车路单日报表
60 65 @Override
... ... @@ -219,13 +224,11 @@ public class FormsServiceImpl implements FormsService {
219 224 // if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){
220 225 // sList.add(s);
221 226 // }
222   -
223 227 if(empnames.equals("驾驶员")){
224   - if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){
  228 + if(d.getJgh().equals(s.getjGh())){
225 229 sList.add(s);
226 230 }
227 231 }else if(empnames.equals("售票员")){
228   -// shif.setjName(arg0.getString("s_name")==null ? "":arg0.getString("s_name"));
229 232 String sgh=s.getsGh()==null?"":s.getsGh();
230 233 if(d.getSgh().equals(sgh) && d.getZbh().equals(s.getClZbh())){
231 234 sList.add(s);
... ... @@ -244,16 +247,17 @@ public class FormsServiceImpl implements FormsService {
244 247 double ljgl=culateMileageService.culateLjgl(sList);
245 248 double sjgl=culateMileageService.culateSjgl(sList);
246 249 double zyygl=Arith.add(ljgl, sjgl);
247   - double cjbc=culateMileageService.culateLbbc(sList);
248   - double Ljbc=culateMileageService.culateLjbc(sList,"");
  250 + int cjbc=culateMileageService.culateLbbc(sList);
  251 + int ljbc=culateMileageService.culateLjbc(sList,"");
  252 + int sjbc=culateMileageService.culateSjbc(sList, "");
249 253 double cjgl=culateMileageService.culateLbgl(sList);
250 254 double zjgl=culateMileageService.culateLjgl(sList);
251 255 d.setEmptMileage(String.valueOf(zksgl));//空驶公里
252 256 d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里
253   - d.setSjbc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, "")));
  257 + d.setSjbc(String.valueOf(sjbc+ljbc));
254 258 d.setJhlc(String.valueOf(zyygl));//运营里程
255 259 d.setCjbc(String.valueOf(cjbc));//抽检班次
256   - d.setLjbc(String.valueOf(Ljbc));//增加班次
  260 + d.setLjbc(String.valueOf(ljbc));//增加班次
257 261 d.setRemMileage(String.valueOf(cjgl));//抽检里程
258 262 d.setAddMileage(String.valueOf(zjgl));//增加里程
259 263  
... ... @@ -330,22 +334,23 @@ public class FormsServiceImpl implements FormsService {
330 334 double zyygl=Arith.add(ljgl, sjgl);
331 335 double jhgl=culateMileageService.culateJhgl(sList);
332 336 double cjgl=culateMileageService.culateLbgl(sList);
333   - double jhbc =culateMileageService.culateJhbc(sList,"");
334   - double cjbc=culateMileageService.culateLbbc(sList);
335   - double Ljbc=culateMileageService.culateLjbc(sList,"");
  337 + int jhbc =culateMileageService.culateJhbc(sList,"");
  338 + int cjbc=culateMileageService.culateLbbc(sList);
  339 + int ljbc=culateMileageService.culateLjbc(sList,"");
  340 + int sjbc=culateMileageService.culateSjbc(sList, "");
336 341 double zjgl=culateMileageService.culateLjgl(sList);
337 342 d.setEmptMileage(String.valueOf(zksgl));//空驶公里
338 343 d.setTotalm(String.valueOf(Arith.add(zksgl, zyygl)));//总公里
339   - d.setSjbc(String.valueOf(culateMileageService.culateSjbc(sList, "")+culateMileageService.culateLjbc(sList, "")));
  344 + d.setSjbc(String.valueOf(sjbc+ljbc));
340 345 d.setJhlc(String.valueOf(jhgl));//计划里程
341 346 d.setYygl(String.valueOf(zyygl));//运营公里
342 347 d.setSjjhlc(String.valueOf(sjgl));//实际计划里程
343 348 d.setRemMileage(String.valueOf(cjgl));//抽减里程
344 349 d.setJhbc(String.valueOf(jhbc));//计划班次
345 350 d.setCjbc(String.valueOf(cjbc));//抽检班次
346   - d.setLjbc(String.valueOf(Ljbc));//增加班次
  351 + d.setLjbc(String.valueOf(ljbc));//增加班次
347 352 d.setAddMileage(String.valueOf(zjgl));//增加公里
348   - d.setSjjhbc(String.valueOf(culateMileageService.culateSjbc(sList, "")));//实际计划班次
  353 + d.setSjjhbc(String.valueOf(sjbc));//实际计划班次
349 354 }
350 355 return list;
351 356 }
... ... @@ -417,7 +422,19 @@ public class FormsServiceImpl implements FormsService {
417 422 // 路单数据
418 423 @Override
419 424 public List<Singledata> singledata(Map<String, Object> map) {
420   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  425 +
  426 + String gsdm="";
  427 + if(map.get("gsdmSing")!=null){
  428 + gsdm=map.get("gsdmSing").toString();
  429 + }
  430 + String fgsdm="";
  431 + if(map.get("fgsdmSing")!=null){
  432 + fgsdm=map.get("fgsdmSing").toString();
  433 + }
  434 +
  435 + String xlbm=map.get("line").toString().trim();
  436 +
  437 + /*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
421 438 SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy年MM月dd日");
422 439 Date d = null;
423 440 Date d1 = null;
... ... @@ -429,60 +446,92 @@ public class FormsServiceImpl implements FormsService {
429 446 e.printStackTrace();
430 447 }
431 448 String rq2 = sdf1.format(d);
432   - String rq3 = sdf1.format(d1);
  449 + String rq3 = sdf1.format(d1);*/
433 450  
434   - rq = rq2 + "-" + rq3;
  451 +// rq = rq2 + "-" + rq3;
435 452 startDate = map.get("startDate").toString();
436   - endDate = map.get("endDate").toString();
437   - String sql = "select t.*,y.yh,y.jzl from ("
438   - + " select r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
439   - + " from bsth_c_s_sp_info_real r where r.schedule_date_str "
440   - + " BETWEEN '"+startDate+"' and '"+endDate+"' and r.xl_bm='"+map.get("line").toString()+"' "
441   - + " AND r.gs_bm is not null and r.gs_bm='"+map.get("gsdmSing").toString()+"' "
442   - + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"' "
443   - + " group by r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm) t "
444   - + " LEFT JOIN (select a.nbbm,a.jsy,SUM(a.yh) as yh,SUM(a.jzl) as jzl "
445   - + " from bsth_c_ylb a where a.rq BETWEEN '"+startDate+"' and '"+endDate+"'and "
446   - + " a.ssgsdm='"+map.get("gsdmSing").toString()+"' and a.fgsdm='"+map.get("fgsdmSing").toString()+"' "
447   - + "group by a.nbbm,a.jsy) y"
448   - + " on y.nbbm=t.cl_zbh and y.jsy= t.j_gh";
  453 +// endDate = map.get("endDate").toString();
  454 +// String sql = "select t.*,y.yh,y.jzl from ("
  455 +// + " select r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
  456 +// + " from bsth_c_s_sp_info_real r where r.schedule_date_str "
  457 +// + " BETWEEN '"+startDate+"' and '"+endDate+"' and r.xl_bm='"+map.get("line").toString()+"' "
  458 +// + " AND r.gs_bm is not null and r.gs_bm='"+map.get("gsdmSing").toString()+"' "
  459 +// + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"' "
  460 +// + " group by r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm) t "
  461 +// + " LEFT JOIN (select a.nbbm,a.jsy,SUM(a.yh) as yh,SUM(a.jzl) as jzl "
  462 +// + " from bsth_c_ylb a where a.rq BETWEEN '"+startDate+"' and '"+endDate+"'and "
  463 +// + " a.ssgsdm='"+map.get("gsdmSing").toString()+"' and a.fgsdm='"+map.get("fgsdmSing").toString()+"' "
  464 +// + "group by a.nbbm,a.jsy) y"
  465 +// + " on y.nbbm=t.cl_zbh and y.jsy= t.j_gh";
449 466  
  467 + String sql="select r.s_gh,r.s_name, "
  468 + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
  469 + + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+startDate+"'";
  470 + if(xlbm.equals("")){
  471 + sql +="and r.gs_bm='"+gsdm+"' "
  472 + + " and r.fgs_bm='"+fgsdm+"'";
  473 + }else{
  474 + sql += " and r.xl_bm = '"+xlbm+"'";
  475 + }
  476 + sql += " group by r.s_gh,r.s_name,"
  477 + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm";
  478 +
450 479 List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
451 480 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
452 481 @Override
453 482 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
454 483 Singledata sin = new Singledata();
455   - sin.setrQ(rq);
456   - sin.setgS(arg0.getString("gs_bm"));
  484 + sin.setrQ(startDate);
457 485 sin.setxL(arg0.getString("xl_name"));
458 486 sin.setClzbh(arg0.getString("cl_zbh"));
459 487 sin.setJsy(arg0.getString("j_gh"));
460 488 sin.setjName(arg0.getString("j_name"));
461   - sin.setHyl(arg0.getString("YH"));
462   - sin.setJzl(arg0.getString("JZL"));
463   - // sin.setJzl(arg0.getString(""));//非营业性用油
464   - sin.setJhjl(arg0.getString("JZL"));
  489 + sin.setSgh(arg0.getString("s_gh"));
  490 + sin.setsName(arg0.getString("s_name"));
  491 + sin.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm")));
465 492  
466 493 return sin;
467 494 }
468 495 });
469   - DecimalFormat df = new DecimalFormat("0.00");
470   - for(int i=0;i<list.size();i++){
471   -
472   - Singledata si=list.get(i);
473   - si.setgS(BasicData.businessCodeNameMap.get(si.getgS()));
474   - si.setJzl(df.format(Double.parseDouble(si.getJzl())));
475   - si.setHyl(df.format(Double.parseDouble(si.getHyl())));
476   - Map<String, Object> maps = new HashMap<>();
477   - maps = commonService.findKMBC1(si.getjName(),si.getClzbh(), startDate,
478   - endDate);
479   - //sin.setjName(maps.get("j_name") == null ? "" : maps.get("j_name").toString());
480   - si.setSgh(maps.get("s_gh") == null ? "" : maps.get("s_gh").toString());
481   - si.setsName(maps.get("s_name") == null ? "" : maps.get("s_name").toString());
482   - si.setJhlc(maps.get("yygl") == null ? "" : maps.get("yygl").toString());
483   - si.setEmptMileage(maps.get("ksgl") == null ? "" : maps.get("ksgl").toString());
484   - si.setJhjl(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString());
485 496  
  497 + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm");
  498 + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(xlbm, startDate);
  499 + for (int i = 0; i < list.size(); i++) {
  500 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  501 + Singledata sin=list.get(i);
  502 + String jsy=sin.getJsy();
  503 + String clzbh=sin.getClzbh();
  504 + for (int j = 0; j < listReal.size(); j++) {
  505 + ScheduleRealInfo s=listReal.get(j);
  506 + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)){
  507 + newList.add(s);
  508 + }
  509 + }
  510 +
  511 + double jhgl=culateMileageService.culateJhgl(newList);
  512 + double yygl=culateMileageService.culateSjgl(newList);
  513 + double ljgl=culateMileageService.culateLjgl(newList);
  514 + double ksgl=culateMileageService.culateKsgl(newList);
  515 + double jcgl=culateMileageService.culateJccgl(newList);
  516 + double zyygl=Arith.add(yygl, ljgl);
  517 + double zksgl=Arith.add(ksgl, jcgl);
  518 + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
  519 + sin.setEmptMileage(String.valueOf(zksgl));
  520 + sin.setJhjl(String.valueOf(jhgl));
  521 + double yhl=0.0;
  522 + double jzl=0.0;
  523 + double fyy=0.0;
  524 + for (int j = 0; j < listYlb.size(); j++) {
  525 + Ylb y=listYlb.get(j);
  526 + if(y.getJsy().equals(jsy) && y.getNbbm().equals(clzbh)){
  527 + yhl=Arith.add(yhl, y.getYh()==null?0:y.getYh());
  528 + jzl=Arith.add(jzl, y.getJzl()==null?0:y.getJzl());
  529 + fyy=Arith.add(fyy, y.getSh()==null?0:y.getSh());
  530 + }
  531 + }
  532 + sin.setHyl(String.valueOf(yhl));
  533 + sin.setJzl(String.valueOf(jzl));
  534 + sin.setUnyyyl(String.valueOf(fyy));
486 535 }
487 536 return list;
488 537 }
... ... @@ -490,105 +539,174 @@ public class FormsServiceImpl implements FormsService {
490 539 // 运营服务阶段报表
491 540 @Override
492 541 public List<Operationservice> operationservice(Map<String, Object> map) {
493   -
494   - String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
495   - + " FROM bsth_c_s_sp_info_real r "
496   - // + "LEFT JOIN bsth_c_s_sp_info_real r on r.cl_zbh=y.NBBM"
497   - + " left join bsth_c_ylb y ON r.cl_zbh = y.nbbm "
498   - + " where 1=1 ";
499   - if(map.get("startDate").toString()!=""){
500   - sql+=" and to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') ";
501   - }
502 542  
503   - if(map.get("endDate").toString()!=""){
504   - sql+=" and to_days('" + map.get("endDate").toString() + "') ";
505   - }
506   - sql+=" and r.xl_bm='" + map.get("line").toString() + "'" ;
507   - sql+=" and r.bc_type not in('in','out')";
508   - if(map.get("gsdmOperat").toString()!=""){
509   - sql+=" and r.gs_bm='"+map.get("gsdmOperat").toString()+"'";
510   - }
511   - if(map.get("fgsdmOperat").toString()!=""){
512   - sql+=" and r.fgs_bm='"+map.get("fgsdmOperat").toString()+"'";
513   - }
514   - sql += " AND r.gs_bm is not null";
515   - sql += " GROUP BY r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name";
516   - startDate = map.get("startDate").toString();
517   - endDate = map.get("endDate").toString();
518   - List<Operationservice> list = jdbcTemplate.query(sql, new RowMapper<Operationservice>() {
519   -
520   - @Override
521   - public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException {
522   - Operationservice op = new Operationservice();
523   - op.setXlName(arg0.getString("xl_name"));
524   - op.setJzl(arg0.getString("JZL"));
525   - op.setXhl(arg0.getString("YH"));
526   - op.setClzbh(arg0.getString("cl_zbh"));
527   - op.setJname(arg0.getString("j_name"));
  543 + String xlbm=map.get("line").toString().trim();
  544 + String gsdm="";
  545 + if(map.get("gsdmOperat")!=null){
  546 + gsdm=map.get("gsdmOperat").toString();
  547 + }
  548 + String fgsdm="";
  549 + if(map.get("fgsdmOperat")!=null){
  550 + fgsdm=map.get("fgsdmOperat").toString();
  551 + }
  552 + startDate=map.get("startDate").toString();
  553 + endDate =map.get("endDate").toString();
  554 + String sql="select r.xl_bm"
  555 + + " from bsth_c_s_sp_info_real r where"
  556 + + " r.schedule_date_str BETWEEN '"+startDate+"' and '"+endDate+"'";
  557 + if(xlbm.equals("")){
  558 + sql +="and r.gs_bm='"+gsdm+"' "
  559 + + " and r.fgs_bm='"+fgsdm+"'";
  560 + }else{
  561 + sql += " and r.xl_bm = '"+xlbm+"'";
  562 + }
  563 + sql += " group by r.xl_bm";
  564 +
  565 +
  566 + List<Operationservice> list= jdbcTemplate.query(sql, new RowMapper<Operationservice>() {
  567 + @Override
  568 + public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException {
  569 + Operationservice ve = new Operationservice();
  570 + ve.setXlBm(arg0.getString("xl_bm"));
  571 + return ve;
  572 + }
  573 + });
  574 +
  575 + String ylbSql=" select * from bsth_c_ylb where rq BETWEEN '"+startDate+"' and '"+endDate+"'";
  576 + if(xlbm.equals("")){
  577 + ylbSql +="and ssgsdm='"+gsdm+"' "
  578 + + " and fgsdm='"+fgsdm+"'";
  579 + }else{
  580 + ylbSql += " and xlbm = '"+xlbm+"'";
  581 + }
  582 + List<Ylb> ylbList= jdbcTemplate.query(ylbSql, new RowMapper<Ylb>() {
  583 + @Override
  584 + public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException {
  585 + Ylb y = new Ylb();
  586 + y.setXlbm(arg0.getString("xlbm"));
  587 + y.setJzl(arg0.getDouble("jzl"));
  588 + y.setYh(arg0.getDouble("yh"));
  589 + return y;
  590 + }
  591 + });
  592 + List<ScheduleRealInfo> listReal;
  593 + if(xlbm.equals("")){
  594 + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj(xlbm, startDate, endDate, gsdm, fgsdm);
  595 + }else{
  596 + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj2(xlbm, startDate, endDate);
  597 + }
  598 +
  599 + for (int i = 0; i < list.size(); i++) {
  600 + Operationservice o=list.get(i);
  601 + String line=o.getXlBm();
  602 + String xlname=BasicData.lineCode2NameMap.get(line);
  603 + o.setXlName(xlname);
  604 +
  605 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  606 + for (int j = 0; j < listReal.size(); j++) {
  607 + ScheduleRealInfo s=listReal.get(j);
  608 + if(s.getXlBm().equals(line)){
  609 + newList.add(s);
  610 + }
  611 + }
  612 +
  613 + int sjbc=culateMileageService.culateSjbc(newList,"");
  614 + int ljbc=culateMileageService.culateLjbc(newList,"");
  615 + double ksgl=culateMileageService.culateKsgl(newList);
  616 + double jccgl=culateMileageService.culateJccgl(newList);
  617 +
  618 + double sjgl=culateMileageService.culateSjgl(newList);
  619 + double ljgl=culateMileageService.culateLjgl(newList);
528 620  
529   - return op;
  621 + o.setEmptMileage(String.valueOf(Arith.add(ksgl, jccgl)));
  622 + o.setXsgl(String.valueOf(Arith.add(sjgl, ljgl)));
  623 + o.setSjbc(String.valueOf(sjbc+ljbc));
  624 +
  625 + double jzl=0.0;
  626 + double xhl=0.0;
  627 + for (int j = 0; j < ylbList.size(); j++) {
  628 + Ylb t=ylbList.get(j);
  629 + if(t.getXlbm().equals(line)){
  630 + jzl=Arith.add(jzl, t.getJzl());
  631 + xhl=Arith.add(xhl, t.getYh());
  632 + }
  633 + }
  634 +
  635 + o.setJzl(String.valueOf(jzl));
  636 + o.setXhl(String.valueOf(xhl));
530 637 }
531   - });
532   -
533   - for(int i=0;i<list.size();i++){
534   - Operationservice o=list.get(i);
535   - Map<String, Object> maps = new HashMap<>();
536   - maps = commonService.findKMBC1(o.getJname(), o.getClzbh(), startDate,
537   - endDate);
538   - o.setXsgl(maps.get("jhlc").toString() == null ? "" : maps.get("jhlc").toString());
539   - o.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString());
540   - o.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());
541   - }
542 638 return list;
543 639 }
544 640  
545 641  
546 642 // 车辆加注
547 643 @Override
548   - public List<Vehicleloading> vehicleloading(String gsdmVehic,String fgsdmVehic,String line, String date) {
549   -
550   - String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
551   - + " FROM bsth_c_s_sp_info_real r "
552   - + " INNER join ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH from bsth_c_ylb y "
553   - + " where to_days(y.RQ)=to_days('" + date + "') and y.XLBM= '" + line + "' GROUP BY y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH) y "
554   - + " on r.cl_zbh=y.nbbm "
555   - + " where to_days(r.schedule_date_str)=to_days('" + date + "')"
556   - + " and r.xl_bm='" + line + "' "
557   - + " AND r.gs_bm is not null"
558   - + " and r.bc_type not in('in','out')";
559   - if(gsdmVehic.toString()!=""){
560   - sql+=" and r.gs_bm='"+gsdmVehic+"'";
561   - }
562   - if(fgsdmVehic.toString()!=""){
563   - sql+=" and r.fgs_bm='"+fgsdmVehic +"'";
564   - }
565   - sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_name,y.YH,y.JZL,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
  644 + public List<Vehicleloading> vehicleloading(String line, String date) {
  645 +
  646 + String sql="select r.s_gh,r.s_name, "
  647 + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
  648 + + " from bsth_c_s_sp_info_real r where r.schedule_date_str = '"+date+"' "
  649 + + " and r.xl_bm = '"+line+"' group by r.s_gh,r.s_name,"
  650 + + " r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm";
  651 +
566 652 List<Vehicleloading> list = jdbcTemplate.query(sql, new RowMapper<Vehicleloading>() {
567 653 @Override
568 654 public Vehicleloading mapRow(ResultSet arg0, int arg1) throws SQLException {
569 655 Vehicleloading ve = new Vehicleloading();
570   - ve.setrQ(arg0.getString("schedule_date_str"));
571   - ve.setgS(arg0.getString("gs_name"));
  656 + ve.setgS(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs_bm")+"_"+arg0.getString("gs_bm")));
572 657 ve.setxL(arg0.getString("xl_name"));
573 658 ve.setClzbh(arg0.getString("cl_zbh"));
574   - ve.setJzl(arg0.getString("JZL"));
575   - ve.setHyl(arg0.getString("YH"));
576   - // ve.setLs(arg0.getString("").toString());//尿素
577 659 ve.setJgh(arg0.getString("j_gh").toString());
578 660 return ve;
579 661 }
580 662 });
581 663  
582   - for(int i=0;i<list.size();i++){
583   - Vehicleloading v=list.get(i);
584   - Map<String, Object> maps = new HashMap<>();
585   - maps = commonService.findKMBC2(v.getJgh(), v.getClzbh(),
586   - v.getrQ());
587   - v.setJhlc(maps.get("jhlc") == null ? "" : maps.get("jhlc").toString());
588   - v.setJhbc(maps.get("jhbc").toString() == null ? "" : maps.get("jhbc").toString());// 计划班次
589   - v.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString());// 实际班次
590   - }
591 664  
  665 + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, "", "", line, "", "xlbm");
  666 + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
  667 + for (int i = 0; i < list.size(); i++) {
  668 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  669 + Vehicleloading sin=list.get(i);
  670 + sin.setrQ(date);
  671 + String jsy=sin.getJgh();
  672 + String clzbh=sin.getClzbh();
  673 + for (int j = 0; j < listReal.size(); j++) {
  674 + ScheduleRealInfo s=listReal.get(j);
  675 + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)){
  676 + newList.add(s);
  677 + }
  678 + }
  679 +
  680 + int jhbc=culateMileageService.culateJhbc(newList, "");
  681 + int sjbc=culateMileageService.culateSjbc(newList, "");
  682 + int ljbc=culateMileageService.culateLjbc(newList, "");
  683 + double yygl=culateMileageService.culateSjgl(newList);
  684 + double ljgl=culateMileageService.culateLjgl(newList);
  685 + double ksgl=culateMileageService.culateKsgl(newList);
  686 + double jcgl=culateMileageService.culateJccgl(newList);
  687 + double zyygl=Arith.add(yygl, ljgl);
  688 + double zksgl=Arith.add(ksgl, jcgl);
  689 + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
  690 + sin.setJhbc(String.valueOf(jhbc));
  691 + sin.setSjbc(String.valueOf(sjbc+ljbc));
  692 + double yhl=0.0;
  693 + double jzl=0.0;
  694 + double fyy=0.0;
  695 + double ns=0.0;
  696 + for (int j = 0; j < listYlb.size(); j++) {
  697 + Ylb y=listYlb.get(j);
  698 + if(y.getJsy().equals(jsy) && y.getNbbm().equals(clzbh)){
  699 + yhl=Arith.add(yhl, y.getYh()==null?0:y.getYh());
  700 + jzl=Arith.add(jzl, y.getJzl()==null?0:y.getJzl());
  701 + fyy=Arith.add(fyy, y.getSh()==null?0:y.getSh());
  702 + ns =Arith.add(ns, y.getNs()==null?0:y.getNs());
  703 + }
  704 + }
  705 + sin.setHyl(String.valueOf(yhl));
  706 + sin.setJzl(String.valueOf(jzl));
  707 + sin.setUnyyyl(String.valueOf(fyy));
  708 + sin.setLs(String.valueOf(ns));
  709 + }
592 710 return list;
593 711 }
594 712  
... ... @@ -816,7 +934,7 @@ public class FormsServiceImpl implements FormsService {
816 934 }
817 935  
818 936 String fgsbm="";
819   - if(map.get("fgsdmDaily").toString()!=null){
  937 + if(map.get("fgsdmDaily")!=null){
820 938 fgsbm=map.get("fgsdmDaily").toString();
821 939 }
822 940  
... ... @@ -853,6 +971,12 @@ public class FormsServiceImpl implements FormsService {
853 971 for(int i=0;i<list.size();i++){
854 972 sList =new ArrayList<ScheduleRealInfo>();
855 973 Daily d=list.get(i);
  974 + if(d.getYh()==null){
  975 + d.setYh("0");
  976 + }else{
  977 + if(d.getYh().equals(""))
  978 + d.setYh("0");
  979 + }
856 980 for (int j = 0; j < lists.size(); j++) {
857 981 ScheduleRealInfo s=lists.get(j);
858 982 if(d.getJgh().equals(s.getjGh()) && d.getZbh().equals(s.getClZbh())){
... ...
src/main/java/com/bsth/service/realcontrol/DataManagerService.java 0 → 100644
  1 +package com.bsth.service.realcontrol;
  2 +
  3 +import java.util.Map;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/4/18.
  7 + */
  8 +public interface DataManagerService {
  9 +
  10 + Map<String, Object> carInfos(Integer lineId);
  11 +
  12 + Map<String,Object> updateDevices(String jsonStr);
  13 +}
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -161,4 +161,8 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
161 161 void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type);
162 162  
163 163 Map<String,Object> revokeRealArrive(Long id);
  164 +
  165 + Map<String,Object> lateAdjust(String idx, float minute);
  166 +
  167 + List<ScheduleRealInfo> allLate2(String idx);
164 168 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/DataManagerServiceImpl.java 0 → 100644
  1 +package com.bsth.service.realcontrol.impl;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.common.ResponseCode;
  6 +import com.bsth.data.BasicData;
  7 +import com.bsth.entity.Cars;
  8 +import com.bsth.repository.CarsRepository;
  9 +import com.bsth.service.realcontrol.DataManagerService;
  10 +import com.bsth.util.db.DBUtils_oldSystem;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.jdbc.core.JdbcTemplate;
  15 +import org.springframework.stereotype.Service;
  16 +
  17 +import java.util.ArrayList;
  18 +import java.util.HashMap;
  19 +import java.util.List;
  20 +import java.util.Map;
  21 +
  22 +/**
  23 + * Created by panzhao on 2017/4/18.
  24 + */
  25 +@Service
  26 +public class DataManagerServiceImpl implements DataManagerService{
  27 +
  28 + @Autowired
  29 + CarsRepository carsRepository;
  30 +
  31 + @Autowired
  32 + JdbcTemplate controlJdbcTemp;
  33 +
  34 + @Autowired
  35 + BasicData.BasicDataLoader dataLoader;
  36 +
  37 + Logger logger = LoggerFactory.getLogger(this.getClass());
  38 +
  39 + @Override
  40 + public Map<String, Object> carInfos(Integer lineId) {
  41 +
  42 + Map<String, Object> rs = new HashMap<>();
  43 + try {
  44 + List<Map<String, String>> nowData = new ArrayList<>();
  45 + List<Map<String, String>> oldData = new ArrayList<>();
  46 + Map<String, String> map;
  47 +
  48 + //查询新系统车辆信息
  49 + List<Cars> list = carsRepository.findCarsByLineId(lineId);
  50 + for(Cars c : list){
  51 + map = new HashMap<>();
  52 + map.put("nbbm", c.getInsideCode());
  53 + map.put("device", c.getEquipmentCode());
  54 + nowData.add(map);
  55 + }
  56 +
  57 + //获取老系统数据
  58 + JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_oldSystem.getDataSource());
  59 + List<Map<String, Object>> oyList = jdbcTemplate.queryForList("select NBBM,SBBH from JJWGPS_T_CLXXB t where xlbm=?", BasicData.lineId2CodeMap.get(lineId));
  60 + for(Map<String, Object> tempMap : oyList){
  61 + map = new HashMap<>();
  62 + map.put("nbbm", tempMap.get("NBBM").toString());
  63 + map.put("device", tempMap.get("SBBH").toString());
  64 + oldData.add(map);
  65 + }
  66 +
  67 + rs.put("status", ResponseCode.SUCCESS);
  68 + rs.put("nows", nowData);
  69 + rs.put("olds", oldData);
  70 + }catch (Exception e){
  71 + logger.error("", e);
  72 + rs.put("status", ResponseCode.ERROR);
  73 + rs.put("msg", e.getMessage());
  74 + }
  75 +
  76 + return rs;
  77 + }
  78 +
  79 + /**
  80 + * 更新设备号
  81 + * @param jsonStr
  82 + * @return
  83 + */
  84 + @Override
  85 + public Map<String, Object> updateDevices(String jsonStr) {
  86 + Map<String, Object> rs = new HashMap<>();
  87 + try {
  88 + int count=0;
  89 + JSONArray array = JSONArray.parseArray(jsonStr);
  90 + JSONObject jObj;
  91 + for(int i = 0; i < array.size(); i ++){
  92 + jObj = array.getJSONObject(i);
  93 + count += controlJdbcTemp.update("update bsth_c_cars set equipment_code=? where inside_code=?"
  94 + , jObj.getString("device"), jObj.getString("nbbm"));
  95 + }
  96 +
  97 + //刷新缓存
  98 + dataLoader.loadDeviceInfo();
  99 + rs.put("status", ResponseCode.SUCCESS);
  100 + rs.put("count", count);
  101 + }catch (Exception e){
  102 + logger.error("", e);
  103 + rs.put("status", ResponseCode.ERROR);
  104 + rs.put("msg", e.getMessage());
  105 + }
  106 + return rs;
  107 + }
  108 +}
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -3,6 +3,7 @@ package com.bsth.service.realcontrol.impl;
3 3 import com.alibaba.fastjson.JSON;
4 4 import com.alibaba.fastjson.JSONArray;
5 5 import com.alibaba.fastjson.JSONObject;
  6 +import com.alibaba.fastjson.support.odps.udf.CodecCheck.A;
6 7 import com.bsth.common.Constants;
7 8 import com.bsth.common.ResponseCode;
8 9 import com.bsth.controller.realcontrol.dto.ChangePersonCar;
... ... @@ -13,6 +14,7 @@ import com.bsth.data.LineConfigData;
13 14 import com.bsth.data.schedule.DayOfSchedule;
14 15 import com.bsth.data.schedule.SchAttrCalculator;
15 16 import com.bsth.data.schedule.ScheduleComparator;
  17 +import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
16 18 import com.bsth.entity.Cars;
17 19 import com.bsth.entity.Line;
18 20 import com.bsth.entity.Personnel;
... ... @@ -176,6 +178,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
176 178 schedule.setDfsjAll(dfsj);
177 179 schedule.addRemarks(remarks);
178 180  
  181 + //取消应发未到标记
  182 + if(schedule.isLate2()){
  183 + schedule.setLate2(false);
  184 + LateAdjustHandle.remove(schedule);
  185 + }
  186 +
179 187 List<ScheduleRealInfo> ts = new ArrayList<>();
180 188 ts.add(schedule);
181 189 //调整终点时间和下一个班次的应到时间
... ... @@ -510,7 +518,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
510 518 + " from bsth_c_s_sp_info_real s "
511 519 + " where s.xl_Bm = '" + line + "' and DATE_FORMAT(s.schedule_Date,'%Y-%m-%d') ='" + date + "' "
512 520 + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name"
513   - + " order by (" + state + "),schedule_date_str,fcsj " + type;
  521 + + " order by (" + state + "),dateStr,fcsj " + type;
514 522 List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan,
515 523 new RowMapper<ScheduleRealInfo>() {
516 524 @Override
... ... @@ -826,9 +834,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
826 834 sch.setFcsjActualAll(fcsjActual);
827 835 sch.addRemarks(remarks);
828 836 sch.calcStatus();
  837 + if(sch.isLate2()){
  838 + //取消应发未到标记
  839 + sch.setLate2(false);
  840 + LateAdjustHandle.remove(sch);
  841 + }
829 842  
830 843 dayOfSchedule.save(sch);
831   - //scheduleRealInfoRepository.save(sch);
832 844  
833 845 ts.add(sch);
834 846  
... ... @@ -1015,8 +1027,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1015 1027 t = fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + fcsjActual);
1016 1028  
1017 1029 //调整实发
1018   - if (!fcsjActual.equals(sch.getFcsjActual()))
  1030 + if (!fcsjActual.equals(sch.getFcsjActual())){
1019 1031 sch.setFcsjActualAll(t);
  1032 +
  1033 + //取消应发未到标记
  1034 + if(sch.isLate2()){
  1035 + sch.setLate2(false);
  1036 + LateAdjustHandle.remove(sch);
  1037 + }
  1038 + }
1020 1039 } else {
1021 1040 //撤销实发
1022 1041 if (sch.getFcsjActual() != null)
... ... @@ -1107,6 +1126,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1107 1126 //重新计算是否误点
1108 1127 schedule.reCalcLate();
1109 1128  
  1129 + //取消应发未到标记
  1130 + if(schedule.isLate2()){
  1131 + schedule.setLate2(false);
  1132 + LateAdjustHandle.remove(schedule);
  1133 + }
1110 1134 dayOfSchedule.save(schedule);
1111 1135 }
1112 1136  
... ... @@ -1403,7 +1427,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1403 1427 lists.add(s);
1404 1428 }
1405 1429 }
1406   - double ksgl=culateService.culateKsgl(lists);
  1430 + double ksgl=culateService.culateKsgl(list);
1407 1431 double sjgl=culateService.culateSjgl(lists);
1408 1432 double jccgl=culateService.culateJccgl(lists);
1409 1433 double ljgl=culateService.culateLjgl(lists);
... ... @@ -1646,9 +1670,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1646 1670 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
1647 1671 Map<String, Object> map = new HashMap<String, Object>();
1648 1672 map.put("xlName", xlName);
1649   - map.put("jhlc", culateService.culateJhgl(lists));
  1673 + double jhlc=culateService.culateJhgl(lists);
  1674 + map.put("jhlc",jhlc);
1650 1675 map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));
1651   - map.put("ssgl", culateService.culateLbgl(lists));
  1676 + double lbgl=culateService.culateLbgl(lists);
  1677 + map.put("ssgl", lbgl);
1652 1678 map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻"));
1653 1679 map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢"));
1654 1680 map.put("ssgl_gz", culateService.culateCJLC(lists, "故障"));
... ... @@ -1665,7 +1691,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1665 1691 double ssgl_qt=culateService.culateCJLC(lists, "其他");
1666 1692 map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
1667 1693 map.put("ssbc", culateService.culateLbbc(lists));
1668   - map.put("ljgl", culateService.culateLjgl(lists));
  1694 + double ljgl=culateService.culateLjgl(lists);
  1695 + map.put("ljgl", ljgl);
1669 1696 map.put("jhbc", culateService.culateJhbc(lists,""));
1670 1697 map.put("jhbc_m", culateService.culateJhbc(lists, "zgf"));
1671 1698 map.put("jhbc_a", culateService.culateJhbc(lists, "wgf"));
... ... @@ -1685,6 +1712,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1685 1712 map.put("djg_m", 0);
1686 1713 map.put("djg_a", 0);
1687 1714 map.put("djg_time", 0);
  1715 + map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl));
1688 1716 lMap.add(map);
1689 1717 return lMap;
1690 1718 }
... ... @@ -2238,8 +2266,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2238 2266 public final Map<String, Object> staticTj(List<ScheduleRealInfo> lists){
2239 2267 Map<String, Object> map = new HashMap<String, Object>();
2240 2268 map.put("xlName", lists.get(0).getXlName());
2241   - map.put("jhlc", culateService.culateJhgl(lists));
2242   - map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));
  2269 + double jhyygl=culateService.culateJhgl(lists);//计划营运公里
  2270 + double jhjcclc= culateService.culateJhJccgl(lists);//计划进出场公里(计划空驶公里)
  2271 + map.put("jhlc", jhyygl);
  2272 + map.put("jcclc", jhjcclc);
  2273 + map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
  2274 +
  2275 + double ljgl= culateService.culateLjgl(lists);
  2276 + double sjyygl= culateService.culateSjgl(lists);
  2277 + double zyygl= Arith.add(sjyygl,ljgl);
  2278 +
  2279 + double sjjccgl=culateService.culateJccgl(lists);
  2280 + double sjksgl=culateService.culateKsgl(lists);
  2281 + double zksgl=Arith.add(sjjccgl, sjksgl);
  2282 + map.put("sjzgl", Arith.add(zyygl, zksgl));
  2283 + map.put("sjgl",zyygl);
  2284 + map.put("sjksgl", zksgl);
  2285 +
2243 2286 map.put("ssgl", culateService.culateLbgl(lists));
2244 2287 map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻"));
2245 2288 map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢"));
... ... @@ -2253,7 +2296,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2253 2296 map.put("ssgl_yw", culateService.culateCJLC(lists, "援外"));
2254 2297 map.put("ssgl_other", culateService.culateCJLC(lists, "其他"));
2255 2298 map.put("ssbc", culateService.culateLbbc(lists));
2256   - map.put("ljgl", culateService.culateLjgl(lists));
  2299 + map.put("ljgl", ljgl);
2257 2300 map.put("jhbc", culateService.culateJhbc(lists,""));
2258 2301 map.put("jhbc_m", culateService.culateJhbc(lists, "zgf"));
2259 2302 map.put("jhbc_a", culateService.culateJhbc(lists, "wgf"));
... ... @@ -2316,8 +2359,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2316 2359  
2317 2360 Map<String, Object> map = new HashMap<String, Object>();
2318 2361 map.put("xlName", "合计");
2319   - map.put("jhlc", culateService.culateJhgl(list));
2320   - map.put("sjgl", Arith.add(culateService.culateSjgl(list),culateService.culateLjgl(list)));
  2362 + double jhyygl=culateService.culateJhgl(list);//计划营运公里
  2363 + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  2364 + map.put("jhlc", jhyygl);
  2365 + map.put("jcclc", jhjcclc);
  2366 + map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
  2367 +
  2368 + double ljgl= culateService.culateLjgl(list);
  2369 + double sjyygl= culateService.culateSjgl(list);
  2370 + double zyygl= Arith.add(sjyygl,ljgl);
  2371 +
  2372 + double sjjccgl=culateService.culateJccgl(list);
  2373 + double sjksgl=culateService.culateKsgl(list);
  2374 + double zksgl=Arith.add(sjjccgl, sjksgl);
  2375 + map.put("sjzgl", Arith.add(zyygl, zksgl));
  2376 + map.put("sjgl",zyygl);
  2377 + map.put("sjksgl", zksgl);
2321 2378 map.put("ssgl", culateService.culateLbgl(list));
2322 2379 map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
2323 2380 map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
... ... @@ -2331,7 +2388,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2331 2388 map.put("ssgl_yw", culateService.culateCJLC(list, "援外"));
2332 2389 map.put("ssgl_other", culateService.culateCJLC(list, "其他"));
2333 2390 map.put("ssbc", culateService.culateLbbc(list));
2334   - map.put("ljgl", culateService.culateLjgl(list));
  2391 + map.put("ljgl", ljgl);
2335 2392 map.put("jhbc", culateService.culateJhbc(list,""));
2336 2393 map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
2337 2394 map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
... ... @@ -2506,7 +2563,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2506 2563 list.add(t);
2507 2564 }
2508 2565  
2509   - List<ScheduleRealInfo> listInfo2 = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
  2566 + List<ScheduleRealInfo> listInfo2 = scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date);
2510 2567 List<ScheduleRealInfo> xList = new ArrayList<ScheduleRealInfo>();
2511 2568 List<ScheduleRealInfo> yList = new ArrayList<ScheduleRealInfo>();
2512 2569 List<ScheduleRealInfo> zList = new ArrayList<ScheduleRealInfo>();
... ... @@ -4093,4 +4150,53 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4093 4150 }
4094 4151 return rs;
4095 4152 }
  4153 +
  4154 + @Override
  4155 + public Map<String, Object> lateAdjust(String idx, float minute) {
  4156 + Map<String, Object> rs = new HashMap<>();
  4157 + try {
  4158 + int count = 0;
  4159 + List<ScheduleRealInfo> list = new ArrayList<>();
  4160 + List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx);
  4161 +
  4162 + ScheduleRealInfo sch;
  4163 + for(String id : ids){
  4164 + sch = dayOfSchedule.get(Long.parseLong(id));
  4165 + if(sch != null && sch.getStatus() == 0){
  4166 + if(minute > 0){
  4167 + sch.setLateMinute(minute);
  4168 + }
  4169 + else if(minute == 0){
  4170 + LateAdjustHandle.remove(sch);
  4171 + }
  4172 + count ++;
  4173 + list.add(sch);
  4174 + }
  4175 + }
  4176 +
  4177 + rs.put("status", ResponseCode.SUCCESS);
  4178 + rs.put("count", count);
  4179 + rs.put("ts", list);
  4180 + }catch (Exception e){
  4181 + logger.error("", e);
  4182 + rs.put("status", ResponseCode.ERROR);
  4183 + rs.put("msg", e.getMessage());
  4184 + }
  4185 +
  4186 + return rs;
  4187 + }
  4188 +
  4189 + @Override
  4190 + public List<ScheduleRealInfo> allLate2(String idx) {
  4191 + List<ScheduleRealInfo> rs = new ArrayList<>();
  4192 + List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx);
  4193 +
  4194 + Collection<ScheduleRealInfo> all = LateAdjustHandle.allLateSch();
  4195 + for(ScheduleRealInfo sch : all){
  4196 + if(ids.indexOf(sch.getXlBm()) != -1){
  4197 + rs.add(sch);
  4198 + }
  4199 + }
  4200 + return rs;
  4201 + }
4096 4202 }
4097 4203 \ No newline at end of file
... ...
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
1 1 package com.bsth.service.report.impl;
2 2  
3 3 import java.util.ArrayList;
  4 +import java.util.Collections;
4 5 import java.util.HashMap;
5 6 import java.util.Iterator;
6 7 import java.util.List;
... ... @@ -14,6 +15,7 @@ import com.bsth.entity.realcontrol.ChildTaskPlan;
14 15 import com.bsth.entity.realcontrol.ScheduleRealInfo;
15 16 import com.bsth.service.report.CulateMileageService;
16 17 import com.bsth.util.Arith;
  18 +import com.bsth.util.ComparableJob;
17 19  
18 20 @Service
19 21 public class CulateMileageServiceImpl implements CulateMileageService{
... ... @@ -25,6 +27,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
25 27 @Override
26 28 public List<Map<String, Object>> jobFwqk(List<ScheduleRealInfo> lists) {
27 29 // TODO Auto-generated method stub
  30 + String[] lblxs = {"配车", "保养","故障","肇事","路阻","纠纷","缺人","客稀","缺车","气候","援外","吊慢","抽减","其他" };
28 31 List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
29 32 for (int i = 0; i < lists.size(); i++) {
30 33 ScheduleRealInfo scheduleRealInfo = lists.get(i);
... ... @@ -47,7 +50,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
47 50 newMap.put("dz", scheduleRealInfo.getQdzName());
48 51 newMap.put("sj", scheduleRealInfo.getFcsj());
49 52 newMap.put("lbbc", 1);
50   - newMap.put("lblc", scheduleRealInfo.getJhlcOrig());
  53 + newMap.put("lblc", scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig());
51 54 newMap.put("jyqp", scheduleRealInfo.getRealMileage());
52 55 list.add(newMap);
53 56 }
... ... @@ -71,7 +74,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
71 74 newMap.put("dz", childTaskPlan.getStartStationName());
72 75 newMap.put("sj", childTaskPlan.getStartDate());
73 76 newMap.put("lbbc", 0);
74   - newMap.put("lblc", childTaskPlan.getMileage());
  77 + newMap.put("lblc", childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage());
75 78 newMap.put("jyqp", scheduleRealInfo.getRealMileage());
76 79 list.add(newMap);
77 80  
... ... @@ -80,7 +83,33 @@ public class CulateMileageServiceImpl implements CulateMileageService{
80 83 }
81 84 }
82 85 }
83   - return list;
  86 + List<Map<String, Object>> listNew=new ArrayList<Map<String,Object>>();
  87 + for (int i = 0; i < lblxs.length; i++) {
  88 + String lx=lblxs[i];
  89 + double lblc=0.0;
  90 + int lbbc=0;
  91 + for (int j = 0; j < list.size(); j++) {
  92 + Map<String, Object> m1=list.get(j);
  93 + m1.put("lx", 0);
  94 + listNew.add(m1);
  95 + if(lx.equals(m1.get("nr").toString())){
  96 + lblc =Arith.add(lblc,Double.parseDouble(m1.get("lblc").toString()));
  97 + lbbc += Integer.parseInt(m1.get("lbbc").toString());
  98 + }
  99 + }
  100 + Map<String, Object> newMap = new HashMap<String, Object>();
  101 + newMap.put("lx", 1);
  102 + newMap.put("nr", lx);
  103 + newMap.put("lp", "小计");
  104 + newMap.put("nbbm", "少驶公里");
  105 + newMap.put("dz", lbbc);
  106 + newMap.put("sj", "少驶公里");
  107 + newMap.put("lblc", lblc);
  108 + listNew.add(newMap);
  109 +
  110 + }
  111 + Collections.sort(listNew, new ComparableJob());
  112 + return listNew;
84 113 }
85 114  
86 115 @Override
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -8,6 +8,7 @@ import java.text.ParseException;
8 8 import java.text.SimpleDateFormat;
9 9 import java.util.ArrayList;
10 10 import java.util.Calendar;
  11 +import java.util.Collections;
11 12 import java.util.Date;
12 13 import java.util.HashMap;
13 14 import java.util.Iterator;
... ... @@ -38,6 +39,7 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
38 39 import com.bsth.service.report.CulateMileageService;
39 40 import com.bsth.service.report.ReportService;
40 41 import com.bsth.util.Arith;
  42 +import com.bsth.util.ComparableJob;
41 43 import com.bsth.util.db.DBUtils_MS;
42 44  
43 45 @Service
... ... @@ -179,10 +181,10 @@ public class ReportServiceImpl implements ReportService{
179 181 try {
180 182 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
181 183 SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
182   - Long date1=simpleDateFormat.parse(fcsj+" 00:00:00").getTime();
183   - Long date2=simpleDateFormat.parse(ddsj+" 23:59:59").getTime();
184   - Date dates1=simpleDateFormat.parse(fcsj+" 00:00:00");
185   - Date dates2=simpleDateFormat.parse(ddsj+" 00:00:00");
  184 + Long date1=simpleDateFormat.parse(fcsj+":00").getTime();
  185 + Long date2=simpleDateFormat.parse(ddsj+":00").getTime();
  186 + Date dates1=simpleDateFormat.parse(fcsj+":00");
  187 + Date dates2=simpleDateFormat.parse(ddsj+":00");
186 188 List<ArrivalInfo> lists=load2(line,date1,date2,dates1,dates2,zd,zdlx);
187 189  
188 190 for(int i=0;i<lists.size();i++){
... ... @@ -1150,6 +1152,7 @@ public class ReportServiceImpl implements ReportService{
1150 1152 @Override
1151 1153 public List<Map<String, Object>> jobFwqk(Map<String, Object> map) {
1152 1154 // TODO Auto-generated method stub
  1155 + String[] lblxs = {"配车", "保养","故障","肇事","路阻","纠纷","缺人","客稀","缺车","气候","援外","吊慢","抽减","其他" };
1153 1156 String line=map.get("line").toString();
1154 1157 String date=map.get("date").toString();
1155 1158 map.put("bcType", "normal");
... ... @@ -1179,7 +1182,7 @@ public class ReportServiceImpl implements ReportService{
1179 1182 newMap.put("sj", scheduleRealInfo.getFcsj());
1180 1183 newMap.put("lbbc", 1);
1181 1184 newMap.put("lblc", scheduleRealInfo.getJhlcOrig());
1182   - newMap.put("jyqp", scheduleRealInfo.getRealMileage());
  1185 + newMap.put("jyqp", scheduleRealInfo.getRemarks());
1183 1186 list.add(newMap);
1184 1187 }
1185 1188  
... ... @@ -1205,7 +1208,7 @@ public class ReportServiceImpl implements ReportService{
1205 1208 newMap.put("sj", childTaskPlan.getStartDate());
1206 1209 newMap.put("lbbc", 0);
1207 1210 newMap.put("lblc", childTaskPlan.getMileage());
1208   - newMap.put("jyqp", scheduleRealInfo.getRealMileage());
  1211 + newMap.put("jyqp", childTaskPlan.getRemarks());
1209 1212 list.add(newMap);
1210 1213  
1211 1214 }
... ... @@ -1213,7 +1216,36 @@ public class ReportServiceImpl implements ReportService{
1213 1216 }
1214 1217 }
1215 1218 }
1216   - return list;
  1219 + List<Map<String, Object>> listNew=new ArrayList<Map<String,Object>>();
  1220 + for (int i = 0; i < lblxs.length; i++) {
  1221 + String lx=lblxs[i];
  1222 + double lblc=0.0;
  1223 + int lbbc=0;
  1224 + for (int j = 0; j < list.size(); j++) {
  1225 + Map<String, Object> m1=list.get(j);
  1226 + if(lx.equals(m1.get("nr").toString())){
  1227 + m1.put("lx", 0);
  1228 + listNew.add(m1);
  1229 + lblc =Arith.add(lblc,Double.parseDouble(m1.get("lblc").toString()));
  1230 + lbbc += Integer.parseInt(m1.get("lbbc").toString());
  1231 + }
  1232 + }
  1233 + if(lblc>0){
  1234 + Map<String, Object> newMap = new HashMap<String, Object>();
  1235 + newMap.put("lx", 1);
  1236 + newMap.put("nr", lx);
  1237 + newMap.put("lp", "小计");
  1238 + newMap.put("nbbm", "少驶班次");
  1239 + newMap.put("jgh", lbbc);
  1240 + newMap.put("sj", "少驶公里");
  1241 + newMap.put("lblc", lblc);
  1242 + listNew.add(newMap);
  1243 + }
  1244 +
  1245 +
  1246 + }
  1247 + Collections.sort(listNew, new ComparableJob());
  1248 + return listNew;
1217 1249 }
1218 1250  
1219 1251 //统计临加班次详细信息
... ...
src/main/java/com/bsth/util/ComparableJob.java 0 → 100644
  1 +package com.bsth.util;
  2 +
  3 +import java.util.Comparator;
  4 +import java.util.Map;
  5 +
  6 +
  7 +public class ComparableJob implements Comparator<Map<String, Object>>{
  8 +
  9 + @Override
  10 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  11 + // TODO Auto-generated method stub
  12 + return o1.get("nr").toString().compareTo(o2.get("nr").toString());
  13 + }
  14 +
  15 +}
... ...
src/main/java/com/bsth/util/db/BaseDao_MS.java deleted 100644 → 0
1   -package com.bsth.util.db;
2   -
3   -
4   -import org.apache.commons.lang3.CharUtils;
5   -import org.apache.commons.lang3.StringUtils;
6   -import org.slf4j.Logger;
7   -import org.slf4j.LoggerFactory;
8   -
9   -
10   -/**
11   - *
12   - * @ClassName: BaseDao
13   - * @author PanZhao
14   - * @param <T>
15   - * @date 2016年6月27日 上午10:33:12
16   - *
17   - */
18   -public class BaseDao_MS {
19   -
20   - static Logger logger = LoggerFactory.getLogger(BaseDao_MS.class);
21   -
22   - /**
23   - *
24   - * @Title: propertyToField
25   - * @Description: TODO(java转数据库字段名)
26   - * @param @param property
27   - * @throws
28   - */
29   - public static String propertyToField(String property) {
30   - if (null == property) {
31   - return "";
32   - }
33   - char[] chars = property.toCharArray();
34   - StringBuffer sb = new StringBuffer();
35   - for (char c : chars) {
36   - if (CharUtils.isAsciiAlphaUpper(c)) {
37   - sb.append("_" + StringUtils.lowerCase(CharUtils.toString(c)));
38   - } else {
39   - sb.append(c);
40   - }
41   - }
42   - return sb.toString();
43   - }
44   -}
src/main/java/com/bsth/util/db/DBUtils_MS.java
1 1 package com.bsth.util.db;
2 2  
  3 +import com.mchange.v2.c3p0.DataSources;
  4 +import org.apache.log4j.Logger;
  5 +
  6 +import javax.sql.DataSource;
3 7 import java.io.FileNotFoundException;
4 8 import java.io.IOException;
5 9 import java.sql.Connection;
... ... @@ -10,15 +14,8 @@ import java.util.HashMap;
10 14 import java.util.Map;
11 15 import java.util.Properties;
12 16  
13   -import javax.sql.DataSource;
14   -
15   -import org.apache.log4j.Logger;
16   -import org.springframework.stereotype.Component;
17   -
18   -import com.mchange.v2.c3p0.DataSources;
19   -
20 17 /**
21   - * 808GPS SQL Server数据库连接工具类
  18 + * 网关ms库连接池
22 19 * @author PanZhao
23 20 *
24 21 */
... ...
src/main/java/com/bsth/util/db/DBUtils_oldSystem.java 0 → 100644
  1 +package com.bsth.util.db;
  2 +
  3 +import com.mchange.v2.c3p0.DataSources;
  4 +import org.apache.log4j.Logger;
  5 +
  6 +import javax.sql.DataSource;
  7 +import java.sql.Connection;
  8 +import java.sql.ResultSet;
  9 +import java.sql.SQLException;
  10 +import java.sql.Statement;
  11 +import java.util.HashMap;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 老系统数据库连接池(保持少量的连接,不会对老系统有什么影响)
  16 + * @author PanZhao
  17 + *
  18 + */
  19 +//@Component
  20 +public class DBUtils_oldSystem {
  21 +
  22 + private static String url = null;
  23 +
  24 + private static String username = null;
  25 +
  26 + private static String pwd = null;
  27 +
  28 + private static DataSource ds_pooled;
  29 +
  30 + static Logger logger = Logger.getLogger(DBUtils_oldSystem.class);
  31 +
  32 + static {
  33 +
  34 + try {
  35 + // 1. 加载驱动类
  36 + Class.forName("oracle.jdbc.driver.OracleDriver");
  37 +
  38 + url = "jdbc:oracle:thin:@10.10.200.225:1521:orcl";
  39 + username = "jjwgps";
  40 + pwd = "jjwgps";
  41 +
  42 + // 设置连接数据库的配置信息
  43 + DataSource ds_unpooled = DataSources.unpooledDataSource(url,
  44 + username, pwd);
  45 +
  46 + Map<String, Object> pool_conf = new HashMap<String, Object>();
  47 + // 设置最大连接数
  48 + pool_conf.put("maxPoolSize", 5);
  49 +
  50 + pool_conf.put("testConnectionOnCheckout", false);
  51 + //异步检测连接的有效性
  52 + pool_conf.put("testConnectionOnCheckin", true);
  53 + //10分钟检测一次
  54 + pool_conf.put("idleConnectionTestPeriod", 60 * 10);
  55 + ds_pooled = DataSources.pooledDataSource(ds_unpooled, pool_conf);
  56 + } catch (ClassNotFoundException e) {
  57 + logger.error(e.toString());
  58 + e.printStackTrace();
  59 + } catch (SQLException e) {
  60 + logger.error("初始化老系统连接池失败,非正式环境请忽略这个问题!");
  61 + logger.error(e.toString());
  62 + e.printStackTrace();
  63 + }
  64 + }
  65 +
  66 + /**
  67 + * 获取连接对象
  68 + */
  69 + public static Connection getConnection() throws SQLException {
  70 + return ds_pooled.getConnection();
  71 + }
  72 +
  73 + /**
  74 + * 释放连接池资源
  75 + */
  76 + public static void clearup() {
  77 + if (ds_pooled != null) {
  78 + try {
  79 + DataSources.destroy(ds_pooled);
  80 + } catch (SQLException e) {
  81 + logger.error(e.toString());
  82 + e.printStackTrace();
  83 + }
  84 + }
  85 + }
  86 +
  87 + /**
  88 + * 资源关闭
  89 + *
  90 + * @param rs
  91 + * @param stmt
  92 + * @param conn
  93 + */
  94 + public static void close(ResultSet rs, Statement stmt, Connection conn) {
  95 + if (rs != null) {
  96 + try {
  97 + rs.close();
  98 + } catch (SQLException e) {
  99 + logger.error(e.toString());
  100 + e.printStackTrace();
  101 + }
  102 + }
  103 +
  104 + if (stmt != null) {
  105 + try {
  106 + stmt.close();
  107 + } catch (SQLException e) {
  108 + logger.error(e.toString());
  109 + e.printStackTrace();
  110 + }
  111 + }
  112 +
  113 + if (conn != null) {
  114 + try {
  115 + conn.close();
  116 + } catch (SQLException e) {
  117 + logger.error(e.toString());
  118 + e.printStackTrace();
  119 + }
  120 + }
  121 + }
  122 +
  123 + public static DataSource getDataSource(){
  124 + return ds_pooled;
  125 + }
  126 +}
... ...
src/main/java/com/bsth/websocket/handler/SendUtils.java
... ... @@ -176,7 +176,7 @@ public class SendUtils{
176 176 public void deviceOffline(GpsEntity gps){
177 177 Map<String, Object> map = new HashMap<>();
178 178 map.put("fn", "deviceOffline");
179   - map.put("gps", gps);;
  179 + map.put("gps", gps);
180 180 ObjectMapper mapper = new ObjectMapper();
181 181  
182 182 try {
... ... @@ -199,4 +199,26 @@ public class SendUtils{
199 199 logger.error("", e);
200 200 }
201 201 }
  202 +
  203 + /**
  204 + * 通知客户端,开始进行误点调整
  205 + * @param sch
  206 + */
  207 + public void sendAutoWdtz(ScheduleRealInfo sch, ScheduleRealInfo cancel){
  208 + Map<String, Object> map = new HashMap<>();
  209 + map.put("fn", "auto_wdtz");
  210 + map.put("id", sch.getId());
  211 + if(cancel != null)
  212 + map.put("cancelId", cancel.getId());
  213 + map.put("lineCode", sch.getXlBm());
  214 + map.put("minute", sch.getLateMinute());
  215 + ObjectMapper mapper = new ObjectMapper();
  216 +
  217 + try {
  218 + socketHandler.sendMessageToLine(sch.getXlBm() ,mapper.writeValueAsString(map));
  219 +
  220 + } catch (JsonProcessingException e) {
  221 + logger.error("", e);
  222 + }
  223 + }
202 224 }
... ...
src/main/resources/datatools/ktrs/carsDataInput.ktr
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<transformation>
3   - <info>
4   - <name>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x5165;</name>
5   - <description>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x5165;</description>
6   - <extended_description>&#x8f66;&#x8f86;&#x57fa;&#x7840;&#x4fe1;&#x606f;</extended_description>
7   - <trans_version/>
8   - <trans_type>Normal</trans_type>
9   - <trans_status>0</trans_status>
10   - <directory>&#x2f;</directory>
11   - <parameters>
12   - <parameter>
13   - <name>erroroutputdir</name>
14   - <default_value/>
15   - <description>ktr step&#x914d;&#x7f6e;&#x7684;&#x9519;&#x8bef;&#x8f93;&#x51fa;&#x76ee;&#x5f55;</description>
16   - </parameter>
17   - <parameter>
18   - <name>filepath</name>
19   - <default_value/>
20   - <description>&#x5f85;&#x5904;&#x7406;&#x5bfc;&#x5165;&#x7684;excel&#x6587;&#x4ef6;</description>
21   - </parameter>
22   - </parameters>
23   - <log>
24   -<trans-log-table><connection/>
25   -<schema/>
26   -<table/>
27   -<size_limit_lines/>
28   -<interval/>
29   -<timeout_days/>
30   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table>
31   -<perf-log-table><connection/>
32   -<schema/>
33   -<table/>
34   -<interval/>
35   -<timeout_days/>
36   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
37   -<channel-log-table><connection/>
38   -<schema/>
39   -<table/>
40   -<timeout_days/>
41   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
42   -<step-log-table><connection/>
43   -<schema/>
44   -<table/>
45   -<timeout_days/>
46   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
47   -<metrics-log-table><connection/>
48   -<schema/>
49   -<table/>
50   -<timeout_days/>
51   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table>
52   - </log>
53   - <maxdate>
54   - <connection/>
55   - <table/>
56   - <field/>
57   - <offset>0.0</offset>
58   - <maxdiff>0.0</maxdiff>
59   - </maxdate>
60   - <size_rowset>10000</size_rowset>
61   - <sleep_time_empty>50</sleep_time_empty>
62   - <sleep_time_full>50</sleep_time_full>
63   - <unique_connections>N</unique_connections>
64   - <feedback_shown>Y</feedback_shown>
65   - <feedback_size>50000</feedback_size>
66   - <using_thread_priorities>Y</using_thread_priorities>
67   - <shared_objects_file/>
68   - <capture_step_performance>N</capture_step_performance>
69   - <step_performance_capturing_delay>1000</step_performance_capturing_delay>
70   - <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
71   - <dependencies>
72   - </dependencies>
73   - <partitionschemas>
74   - </partitionschemas>
75   - <slaveservers>
76   - </slaveservers>
77   - <clusterschemas>
78   - </clusterschemas>
79   - <created_user>-</created_user>
80   - <created_date>2016&#x2f;06&#x2f;23 17&#x3a;44&#x3a;46.781</created_date>
81   - <modified_user>-</modified_user>
82   - <modified_date>2016&#x2f;06&#x2f;23 17&#x3a;44&#x3a;46.781</modified_date>
83   - <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>
84   - <is_key_private>N</is_key_private>
85   - </info>
86   - <notepads>
87   - </notepads>
88   - <connection>
89   - <name>192.168.168.1_jwgl_dw</name>
90   - <server>192.168.168.1</server>
91   - <type>ORACLE</type>
92   - <access>Native</access>
93   - <database>orcl</database>
94   - <port>1521</port>
95   - <username>jwgl_dw</username>
96   - <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>
97   - <servername/>
98   - <data_tablespace/>
99   - <index_tablespace/>
100   - <attributes>
101   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
102   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
103   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
104   - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
105   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
106   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
107   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
108   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
109   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
110   - </attributes>
111   - </connection>
112   - <connection>
113   - <name>bus_control_variable</name>
114   - <server>&#x24;&#x7b;v_db_ip&#x7d;</server>
115   - <type>MYSQL</type>
116   - <access>Native</access>
117   - <database>&#x24;&#x7b;v_db_dname&#x7d;</database>
118   - <port>3306</port>
119   - <username>&#x24;&#x7b;v_db_uname&#x7d;</username>
120   - <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>
121   - <servername/>
122   - <data_tablespace/>
123   - <index_tablespace/>
124   - <attributes>
125   - <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
126   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
127   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
128   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
129   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
130   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
131   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
132   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
133   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
134   - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
135   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
136   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
137   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
138   - </attributes>
139   - </connection>
140   - <connection>
141   - <name>bus_control_&#x516c;&#x53f8;_201</name>
142   - <server>localhost</server>
143   - <type>MYSQL</type>
144   - <access>Native</access>
145   - <database>control</database>
146   - <port>3306</port>
147   - <username>root</username>
148   - <password>Encrypted </password>
149   - <servername/>
150   - <data_tablespace/>
151   - <index_tablespace/>
152   - <attributes>
153   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
154   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
155   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
156   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
157   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
158   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
159   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
160   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
161   - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
162   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
163   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
164   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
165   - </attributes>
166   - </connection>
167   - <connection>
168   - <name>bus_control_&#x672c;&#x673a;</name>
169   - <server>localhost</server>
170   - <type>MYSQL</type>
171   - <access>Native</access>
172   - <database>control</database>
173   - <port>3306</port>
174   - <username>root</username>
175   - <password>Encrypted </password>
176   - <servername/>
177   - <data_tablespace/>
178   - <index_tablespace/>
179   - <attributes>
180   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
181   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
182   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
183   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
184   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
185   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
186   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
187   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
188   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
189   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
190   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
191   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
192   - </attributes>
193   - </connection>
194   - <connection>
195   - <name>xlab_mysql_youle</name>
196   - <server>101.231.124.8</server>
197   - <type>MYSQL</type>
198   - <access>Native</access>
199   - <database>xlab_youle</database>
200   - <port>45687</port>
201   - <username>xlab-youle</username>
202   - <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>
203   - <servername/>
204   - <data_tablespace/>
205   - <index_tablespace/>
206   - <attributes>
207   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
208   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
209   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
210   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
211   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
212   - <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>
213   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
214   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
215   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
216   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
217   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
218   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
219   - </attributes>
220   - </connection>
221   - <connection>
222   - <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>
223   - <server>localhost</server>
224   - <type>MYSQL</type>
225   - <access>Native</access>
226   - <database>xlab_youle</database>
227   - <port>3306</port>
228   - <username>root</username>
229   - <password>Encrypted </password>
230   - <servername/>
231   - <data_tablespace/>
232   - <index_tablespace/>
233   - <attributes>
234   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
235   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
236   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
237   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
238   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
239   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
240   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
241   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
242   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
243   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
244   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
245   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
246   - </attributes>
247   - </connection>
248   - <connection>
249   - <name>xlab_youle</name>
250   - <server/>
251   - <type>MYSQL</type>
252   - <access>JNDI</access>
253   - <database>xlab_youle</database>
254   - <port>1521</port>
255   - <username/>
256   - <password>Encrypted </password>
257   - <servername/>
258   - <data_tablespace/>
259   - <index_tablespace/>
260   - <attributes>
261   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
262   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
263   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
264   - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
265   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
266   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
267   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
268   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
269   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
270   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
271   - </attributes>
272   - </connection>
273   - <order>
274   - <hop> <from>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</from><to>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</to><enabled>Y</enabled> </hop>
275   - <hop> <from>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_cars 2</from><to>&#x9519;&#x8bef;&#x8f93;&#x51fa; 2</to><enabled>Y</enabled> </hop>
276   - <hop> <from>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_cars 2</to><enabled>Y</enabled> </hop>
277   - </order>
278   - <step>
279   - <name>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</name>
280   - <type>ExcelInput</type>
281   - <description/>
282   - <distribute>Y</distribute>
283   - <custom_distribution/>
284   - <copies>1</copies>
285   - <partitioning>
286   - <method>none</method>
287   - <schema_name/>
288   - </partitioning>
289   - <header>Y</header>
290   - <noempty>Y</noempty>
291   - <stoponempty>N</stoponempty>
292   - <filefield/>
293   - <sheetfield/>
294   - <sheetrownumfield/>
295   - <rownumfield/>
296   - <sheetfield/>
297   - <filefield/>
298   - <limit>0</limit>
299   - <encoding/>
300   - <add_to_result_filenames>Y</add_to_result_filenames>
301   - <accept_filenames>Y</accept_filenames>
302   - <accept_field>filepath_</accept_field>
303   - <accept_stepname>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</accept_stepname>
304   - <file>
305   - <name/>
306   - <filemask/>
307   - <exclude_filemask/>
308   - <file_required>N</file_required>
309   - <include_subfolders>N</include_subfolders>
310   - </file>
311   - <fields>
312   - <field>
313   - <name>&#x8f66;&#x724c;&#x53f7;</name>
314   - <type>String</type>
315   - <length>-1</length>
316   - <precision>-1</precision>
317   - <trim_type>none</trim_type>
318   - <repeat>N</repeat>
319   - <format/>
320   - <currency/>
321   - <decimal/>
322   - <group/>
323   - </field>
324   - <field>
325   - <name>&#x8f66;&#x8f86;&#x7f16;&#x7801;</name>
326   - <type>String</type>
327   - <length>-1</length>
328   - <precision>-1</precision>
329   - <trim_type>none</trim_type>
330   - <repeat>N</repeat>
331   - <format/>
332   - <currency/>
333   - <decimal/>
334   - <group/>
335   - </field>
336   - <field>
337   - <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
338   - <type>String</type>
339   - <length>-1</length>
340   - <precision>-1</precision>
341   - <trim_type>none</trim_type>
342   - <repeat>N</repeat>
343   - <format/>
344   - <currency/>
345   - <decimal/>
346   - <group/>
347   - </field>
348   - <field>
349   - <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;</name>
350   - <type>String</type>
351   - <length>-1</length>
352   - <precision>-1</precision>
353   - <trim_type>none</trim_type>
354   - <repeat>N</repeat>
355   - <format/>
356   - <currency/>
357   - <decimal/>
358   - <group/>
359   - </field>
360   - <field>
361   - <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
362   - <type>String</type>
363   - <length>-1</length>
364   - <precision>-1</precision>
365   - <trim_type>none</trim_type>
366   - <repeat>N</repeat>
367   - <format/>
368   - <currency/>
369   - <decimal/>
370   - <group/>
371   - </field>
372   - <field>
373   - <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</name>
374   - <type>String</type>
375   - <length>-1</length>
376   - <precision>-1</precision>
377   - <trim_type>none</trim_type>
378   - <repeat>N</repeat>
379   - <format/>
380   - <currency/>
381   - <decimal/>
382   - <group/>
383   - </field>
384   - <field>
385   - <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
386   - <type>String</type>
387   - <length>-1</length>
388   - <precision>-1</precision>
389   - <trim_type>none</trim_type>
390   - <repeat>N</repeat>
391   - <format/>
392   - <currency/>
393   - <decimal/>
394   - <group/>
395   - </field>
396   - <field>
397   - <name>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</name>
398   - <type>String</type>
399   - <length>-1</length>
400   - <precision>-1</precision>
401   - <trim_type>none</trim_type>
402   - <repeat>N</repeat>
403   - <format/>
404   - <currency/>
405   - <decimal/>
406   - <group/>
407   - </field>
408   - <field>
409   - <name>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</name>
410   - <type>String</type>
411   - <length>-1</length>
412   - <precision>-1</precision>
413   - <trim_type>none</trim_type>
414   - <repeat>N</repeat>
415   - <format/>
416   - <currency/>
417   - <decimal/>
418   - <group/>
419   - </field>
420   - </fields>
421   - <sheets>
422   - <sheet>
423   - <name>&#x5de5;&#x4f5c;&#x8868;1</name>
424   - <startrow>0</startrow>
425   - <startcol>0</startcol>
426   - </sheet>
427   - </sheets>
428   - <strict_types>N</strict_types>
429   - <error_ignored>N</error_ignored>
430   - <error_line_skipped>N</error_line_skipped>
431   - <bad_line_files_destination_directory/>
432   - <bad_line_files_extension>warning</bad_line_files_extension>
433   - <error_line_files_destination_directory/>
434   - <error_line_files_extension>error</error_line_files_extension>
435   - <line_number_files_destination_directory/>
436   - <line_number_files_extension>line</line_number_files_extension>
437   - <shortFileFieldName/>
438   - <pathFieldName/>
439   - <hiddenFieldName/>
440   - <lastModificationTimeFieldName/>
441   - <uriNameFieldName/>
442   - <rootUriNameFieldName/>
443   - <extensionFieldName/>
444   - <sizeFieldName/>
445   - <spreadsheet_type>JXL</spreadsheet_type>
446   - <cluster_schema/>
447   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
448   - <xloc>131</xloc>
449   - <yloc>58</yloc>
450   - <draw>Y</draw>
451   - </GUI>
452   - </step>
453   -
454   - <step>
455   - <name>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_cars 2</name>
456   - <type>InsertUpdate</type>
457   - <description/>
458   - <distribute>Y</distribute>
459   - <custom_distribution/>
460   - <copies>1</copies>
461   - <partitioning>
462   - <method>none</method>
463   - <schema_name/>
464   - </partitioning>
465   - <connection>bus_control_variable</connection>
466   - <commit>1000</commit>
467   - <update_bypassed>N</update_bypassed>
468   - <lookup>
469   - <schema/>
470   - <table>bsth_c_cars</table>
471   - <key>
472   - <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
473   - <field>inside_code</field>
474   - <condition>&#x3d;</condition>
475   - <name2/>
476   - </key>
477   - <value>
478   - <name>car_gride</name>
479   - <rename>&#x8f66;&#x724c;&#x53f7;</rename>
480   - <update>Y</update>
481   - </value>
482   - <value>
483   - <name>car_code</name>
484   - <rename>&#x8f66;&#x8f86;&#x7f16;&#x7801;</rename>
485   - <update>Y</update>
486   - </value>
487   - <value>
488   - <name>inside_code</name>
489   - <rename>&#x5185;&#x90e8;&#x7f16;&#x7801;</rename>
490   - <update>Y</update>
491   - </value>
492   - <value>
493   - <name>company</name>
494   - <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;</rename>
495   - <update>Y</update>
496   - </value>
497   - <value>
498   - <name>business_code</name>
499   - <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</rename>
500   - <update>Y</update>
501   - </value>
502   - <value>
503   - <name>branche_company</name>
504   - <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</rename>
505   - <update>Y</update>
506   - </value>
507   - <value>
508   - <name>branche_company_code</name>
509   - <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</rename>
510   - <update>Y</update>
511   - </value>
512   - <value>
513   - <name>supplier_name</name>
514   - <rename>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</rename>
515   - <update>Y</update>
516   - </value>
517   - <value>
518   - <name>equipment_code</name>
519   - <rename>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</rename>
520   - <update>Y</update>
521   - </value>
522   - </lookup>
523   - <cluster_schema/>
524   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
525   - <xloc>516</xloc>
526   - <yloc>138</yloc>
527   - <draw>Y</draw>
528   - </GUI>
529   - </step>
530   -
531   - <step>
532   - <name>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</name>
533   - <type>GetVariable</type>
534   - <description/>
535   - <distribute>Y</distribute>
536   - <custom_distribution/>
537   - <copies>1</copies>
538   - <partitioning>
539   - <method>none</method>
540   - <schema_name/>
541   - </partitioning>
542   - <fields>
543   - <field>
544   - <name>filepath_</name>
545   - <variable>&#x24;&#x7b;filepath&#x7d;</variable>
546   - <type>String</type>
547   - <format/>
548   - <currency/>
549   - <decimal/>
550   - <group/>
551   - <length>-1</length>
552   - <precision>-1</precision>
553   - <trim_type>none</trim_type>
554   - </field>
555   - <field>
556   - <name>erroroutputdir_</name>
557   - <variable>&#x24;&#x7b;erroroutputdir&#x7d;</variable>
558   - <type>String</type>
559   - <format/>
560   - <currency/>
561   - <decimal/>
562   - <group/>
563   - <length>-1</length>
564   - <precision>-1</precision>
565   - <trim_type>none</trim_type>
566   - </field>
567   - </fields>
568   - <cluster_schema/>
569   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
570   - <xloc>134</xloc>
571   - <yloc>183</yloc>
572   - <draw>Y</draw>
573   - </GUI>
574   - </step>
575   -
576   - <step>
577   - <name>&#x9519;&#x8bef;&#x8f93;&#x51fa; 2</name>
578   - <type>ExcelOutput</type>
579   - <description/>
580   - <distribute>Y</distribute>
581   - <custom_distribution/>
582   - <copies>1</copies>
583   - <partitioning>
584   - <method>none</method>
585   - <schema_name/>
586   - </partitioning>
587   - <header>Y</header>
588   - <footer>N</footer>
589   - <encoding/>
590   - <append>N</append>
591   - <add_to_result_filenames>Y</add_to_result_filenames>
592   - <file>
593   - <name>&#x24;&#x7b;erroroutputdir&#x7d;&#x2f;&#x8f66;&#x8f86;&#x57fa;&#x7840;&#x4fe1;&#x606f;_&#x9519;&#x8bef;</name>
594   - <extention>xls</extention>
595   - <do_not_open_newfile_init>N</do_not_open_newfile_init>
596   - <create_parent_folder>N</create_parent_folder>
597   - <split>N</split>
598   - <add_date>N</add_date>
599   - <add_time>N</add_time>
600   - <SpecifyFormat>N</SpecifyFormat>
601   - <date_time_format/>
602   - <sheetname>Sheet1</sheetname>
603   - <autosizecolums>N</autosizecolums>
604   - <nullisblank>N</nullisblank>
605   - <protect_sheet>N</protect_sheet>
606   - <password>Encrypted </password>
607   - <splitevery>0</splitevery>
608   - <usetempfiles>N</usetempfiles>
609   - <tempdirectory/>
610   - </file>
611   - <template>
612   - <enabled>N</enabled>
613   - <append>N</append>
614   - <filename>template.xls</filename>
615   - </template>
616   - <fields>
617   - <field>
618   - <name>&#x8f66;&#x724c;&#x53f7;</name>
619   - <type>String</type>
620   - <format/>
621   - </field>
622   - <field>
623   - <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
624   - <type>String</type>
625   - <format/>
626   - </field>
627   - <field>
628   - <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;</name>
629   - <type>String</type>
630   - <format/>
631   - </field>
632   - <field>
633   - <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
634   - <type>String</type>
635   - <format/>
636   - </field>
637   - <field>
638   - <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</name>
639   - <type>String</type>
640   - <format/>
641   - </field>
642   - <field>
643   - <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
644   - <type>String</type>
645   - <format/>
646   - </field>
647   - <field>
648   - <name>&#x4f9b;&#x5e94;&#x5546;&#x540d;&#x79f0;</name>
649   - <type>String</type>
650   - <format/>
651   - </field>
652   - <field>
653   - <name>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</name>
654   - <type>String</type>
655   - <format/>
656   - </field>
657   - <field>
658   - <name>error_count</name>
659   - <type>Integer</type>
660   - <format/>
661   - </field>
662   - <field>
663   - <name>error_desc</name>
664   - <type>String</type>
665   - <format/>
666   - </field>
667   - <field>
668   - <name>error_column1</name>
669   - <type>String</type>
670   - <format/>
671   - </field>
672   - <field>
673   - <name>error_column2</name>
674   - <type>String</type>
675   - <format/>
676   - </field>
677   - </fields>
678   - <custom>
679   - <header_font_name>arial</header_font_name>
680   - <header_font_size>10</header_font_size>
681   - <header_font_bold>N</header_font_bold>
682   - <header_font_italic>N</header_font_italic>
683   - <header_font_underline>no</header_font_underline>
684   - <header_font_orientation>horizontal</header_font_orientation>
685   - <header_font_color>black</header_font_color>
686   - <header_background_color>none</header_background_color>
687   - <header_row_height>255</header_row_height>
688   - <header_alignment>left</header_alignment>
689   - <header_image/>
690   - <row_font_name>arial</row_font_name>
691   - <row_font_size>10</row_font_size>
692   - <row_font_color>black</row_font_color>
693   - <row_background_color>none</row_background_color>
694   - </custom>
695   - <cluster_schema/>
696   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
697   - <xloc>328</xloc>
698   - <yloc>140</yloc>
699   - <draw>Y</draw>
700   - </GUI>
701   - </step>
702   -
703   - <step_error_handling>
704   - <error>
705   - <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_cars 2</source_step>
706   - <target_step>&#x9519;&#x8bef;&#x8f93;&#x51fa; 2</target_step>
707   - <is_enabled>Y</is_enabled>
708   - <nr_valuename>error_count</nr_valuename>
709   - <descriptions_valuename>error_desc</descriptions_valuename>
710   - <fields_valuename>error_column1</fields_valuename>
711   - <codes_valuename>error_column2</codes_valuename>
712   - <max_errors/>
713   - <max_pct_errors/>
714   - <min_pct_rows/>
715   - </error>
716   - </step_error_handling>
717   - <slave-step-copy-partition-distribution>
718   -</slave-step-copy-partition-distribution>
719   - <slave_transformation>N</slave_transformation>
720   -
721   -</transformation>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<transformation>
  3 + <info>
  4 + <name>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x5165;</name>
  5 + <description>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x5165;</description>
  6 + <extended_description>&#x8f66;&#x8f86;&#x57fa;&#x7840;&#x4fe1;&#x606f;</extended_description>
  7 + <trans_version/>
  8 + <trans_type>Normal</trans_type>
  9 + <trans_status>0</trans_status>
  10 + <directory>&#x2f;</directory>
  11 + <parameters>
  12 + <parameter>
  13 + <name>erroroutputdir</name>
  14 + <default_value/>
  15 + <description>ktr step&#x914d;&#x7f6e;&#x7684;&#x9519;&#x8bef;&#x8f93;&#x51fa;&#x76ee;&#x5f55;</description>
  16 + </parameter>
  17 + <parameter>
  18 + <name>filepath</name>
  19 + <default_value/>
  20 + <description>&#x5f85;&#x5904;&#x7406;&#x5bfc;&#x5165;&#x7684;excel&#x6587;&#x4ef6;</description>
  21 + </parameter>
  22 + </parameters>
  23 + <log>
  24 +<trans-log-table><connection/>
  25 +<schema/>
  26 +<table/>
  27 +<size_limit_lines/>
  28 +<interval/>
  29 +<timeout_days/>
  30 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table>
  31 +<perf-log-table><connection/>
  32 +<schema/>
  33 +<table/>
  34 +<interval/>
  35 +<timeout_days/>
  36 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
  37 +<channel-log-table><connection/>
  38 +<schema/>
  39 +<table/>
  40 +<timeout_days/>
  41 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
  42 +<step-log-table><connection/>
  43 +<schema/>
  44 +<table/>
  45 +<timeout_days/>
  46 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
  47 +<metrics-log-table><connection/>
  48 +<schema/>
  49 +<table/>
  50 +<timeout_days/>
  51 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table>
  52 + </log>
  53 + <maxdate>
  54 + <connection/>
  55 + <table/>
  56 + <field/>
  57 + <offset>0.0</offset>
  58 + <maxdiff>0.0</maxdiff>
  59 + </maxdate>
  60 + <size_rowset>10000</size_rowset>
  61 + <sleep_time_empty>50</sleep_time_empty>
  62 + <sleep_time_full>50</sleep_time_full>
  63 + <unique_connections>N</unique_connections>
  64 + <feedback_shown>Y</feedback_shown>
  65 + <feedback_size>50000</feedback_size>
  66 + <using_thread_priorities>Y</using_thread_priorities>
  67 + <shared_objects_file/>
  68 + <capture_step_performance>N</capture_step_performance>
  69 + <step_performance_capturing_delay>1000</step_performance_capturing_delay>
  70 + <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
  71 + <dependencies>
  72 + </dependencies>
  73 + <partitionschemas>
  74 + </partitionschemas>
  75 + <slaveservers>
  76 + </slaveservers>
  77 + <clusterschemas>
  78 + </clusterschemas>
  79 + <created_user>-</created_user>
  80 + <created_date>2016&#x2f;06&#x2f;23 17&#x3a;44&#x3a;46.781</created_date>
  81 + <modified_user>-</modified_user>
  82 + <modified_date>2016&#x2f;06&#x2f;23 17&#x3a;44&#x3a;46.781</modified_date>
  83 + <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>
  84 + <is_key_private>N</is_key_private>
  85 + </info>
  86 + <notepads>
  87 + </notepads>
  88 + <connection>
  89 + <name>192.168.168.1_jwgl_dw</name>
  90 + <server>192.168.168.1</server>
  91 + <type>ORACLE</type>
  92 + <access>Native</access>
  93 + <database>orcl</database>
  94 + <port>1521</port>
  95 + <username>jwgl_dw</username>
  96 + <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>
  97 + <servername/>
  98 + <data_tablespace/>
  99 + <index_tablespace/>
  100 + <attributes>
  101 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  102 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  103 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  104 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  105 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  106 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  107 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  108 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  109 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  110 + </attributes>
  111 + </connection>
  112 + <connection>
  113 + <name>bus_control_variable</name>
  114 + <server>&#x24;&#x7b;v_db_ip&#x7d;</server>
  115 + <type>MYSQL</type>
  116 + <access>Native</access>
  117 + <database>&#x24;&#x7b;v_db_dname&#x7d;</database>
  118 + <port>3306</port>
  119 + <username>&#x24;&#x7b;v_db_uname&#x7d;</username>
  120 + <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>
  121 + <servername/>
  122 + <data_tablespace/>
  123 + <index_tablespace/>
  124 + <attributes>
  125 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
  126 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  127 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  128 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  129 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  130 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  131 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  132 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  133 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  134 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  135 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  136 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  137 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  138 + </attributes>
  139 + </connection>
  140 + <connection>
  141 + <name>bus_control_&#x516c;&#x53f8;_201</name>
  142 + <server>localhost</server>
  143 + <type>MYSQL</type>
  144 + <access>Native</access>
  145 + <database>control</database>
  146 + <port>3306</port>
  147 + <username>root</username>
  148 + <password>Encrypted </password>
  149 + <servername/>
  150 + <data_tablespace/>
  151 + <index_tablespace/>
  152 + <attributes>
  153 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  154 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  155 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  156 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  157 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  158 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  159 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  160 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  161 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  162 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  163 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  164 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  165 + </attributes>
  166 + </connection>
  167 + <connection>
  168 + <name>bus_control_&#x672c;&#x673a;</name>
  169 + <server>localhost</server>
  170 + <type>MYSQL</type>
  171 + <access>Native</access>
  172 + <database>control</database>
  173 + <port>3306</port>
  174 + <username>root</username>
  175 + <password>Encrypted </password>
  176 + <servername/>
  177 + <data_tablespace/>
  178 + <index_tablespace/>
  179 + <attributes>
  180 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  181 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  182 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  183 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  184 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  185 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  186 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  187 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  188 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  189 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  190 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  191 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  192 + </attributes>
  193 + </connection>
  194 + <connection>
  195 + <name>xlab_mysql_youle</name>
  196 + <server>101.231.124.8</server>
  197 + <type>MYSQL</type>
  198 + <access>Native</access>
  199 + <database>xlab_youle</database>
  200 + <port>45687</port>
  201 + <username>xlab-youle</username>
  202 + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>
  203 + <servername/>
  204 + <data_tablespace/>
  205 + <index_tablespace/>
  206 + <attributes>
  207 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  208 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  209 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  210 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  211 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  212 + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>
  213 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  214 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  215 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  216 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  217 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  218 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  219 + </attributes>
  220 + </connection>
  221 + <connection>
  222 + <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>
  223 + <server>localhost</server>
  224 + <type>MYSQL</type>
  225 + <access>Native</access>
  226 + <database>xlab_youle</database>
  227 + <port>3306</port>
  228 + <username>root</username>
  229 + <password>Encrypted </password>
  230 + <servername/>
  231 + <data_tablespace/>
  232 + <index_tablespace/>
  233 + <attributes>
  234 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  235 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  236 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  237 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  238 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  239 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  240 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  241 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  242 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  243 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  244 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  245 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  246 + </attributes>
  247 + </connection>
  248 + <connection>
  249 + <name>xlab_youle</name>
  250 + <server/>
  251 + <type>MYSQL</type>
  252 + <access>JNDI</access>
  253 + <database>xlab_youle</database>
  254 + <port>1521</port>
  255 + <username/>
  256 + <password>Encrypted </password>
  257 + <servername/>
  258 + <data_tablespace/>
  259 + <index_tablespace/>
  260 + <attributes>
  261 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  262 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  263 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  264 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  265 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  266 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  267 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  268 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  269 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  270 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  271 + </attributes>
  272 + </connection>
  273 + <order>
  274 + <hop> <from>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</from><to>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</to><enabled>Y</enabled> </hop>
  275 + <hop> <from>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_cars 2</from><to>&#x9519;&#x8bef;&#x8f93;&#x51fa; 2</to><enabled>Y</enabled> </hop>
  276 + <hop> <from>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_cars 2</to><enabled>Y</enabled> </hop>
  277 + </order>
  278 + <step>
  279 + <name>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</name>
  280 + <type>ExcelInput</type>
  281 + <description/>
  282 + <distribute>Y</distribute>
  283 + <custom_distribution/>
  284 + <copies>1</copies>
  285 + <partitioning>
  286 + <method>none</method>
  287 + <schema_name/>
  288 + </partitioning>
  289 + <header>Y</header>
  290 + <noempty>Y</noempty>
  291 + <stoponempty>N</stoponempty>
  292 + <filefield/>
  293 + <sheetfield/>
  294 + <sheetrownumfield/>
  295 + <rownumfield/>
  296 + <sheetfield/>
  297 + <filefield/>
  298 + <limit>0</limit>
  299 + <encoding/>
  300 + <add_to_result_filenames>Y</add_to_result_filenames>
  301 + <accept_filenames>Y</accept_filenames>
  302 + <accept_field>filepath_</accept_field>
  303 + <accept_stepname>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</accept_stepname>
  304 + <file>
  305 + <name/>
  306 + <filemask/>
  307 + <exclude_filemask/>
  308 + <file_required>N</file_required>
  309 + <include_subfolders>N</include_subfolders>
  310 + </file>
  311 + <fields>
  312 + <field>
  313 + <name>&#x8f66;&#x724c;&#x53f7;</name>
  314 + <type>String</type>
  315 + <length>-1</length>
  316 + <precision>-1</precision>
  317 + <trim_type>none</trim_type>
  318 + <repeat>N</repeat>
  319 + <format/>
  320 + <currency/>
  321 + <decimal/>
  322 + <group/>
  323 + </field>
  324 + <field>
  325 + <name>&#x8f66;&#x8f86;&#x7f16;&#x7801;</name>
  326 + <type>String</type>
  327 + <length>-1</length>
  328 + <precision>-1</precision>
  329 + <trim_type>none</trim_type>
  330 + <repeat>N</repeat>
  331 + <format/>
  332 + <currency/>
  333 + <decimal/>
  334 + <group/>
  335 + </field>
  336 + <field>
  337 + <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
  338 + <type>String</type>
  339 + <length>-1</length>
  340 + <precision>-1</precision>
  341 + <trim_type>none</trim_type>
  342 + <repeat>N</repeat>
  343 + <format/>
  344 + <currency/>
  345 + <decimal/>
  346 + <group/>
  347 + </field>
  348 + <field>
  349 + <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;</name>
  350 + <type>String</type>
  351 + <length>-1</length>
  352 + <precision>-1</precision>
  353 + <trim_type>none</trim_type>
  354 + <repeat>N</repeat>
  355 + <format/>
  356 + <currency/>
  357 + <decimal/>
  358 + <group/>
  359 + </field>
  360 + <field>
  361 + <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
  362 + <type>String</type>
  363 + <length>-1</length>
  364 + <precision>-1</precision>
  365 + <trim_type>none</trim_type>
  366 + <repeat>N</repeat>
  367 + <format/>
  368 + <currency/>
  369 + <decimal/>
  370 + <group/>
  371 + </field>
  372 + <field>
  373 + <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</name>
  374 + <type>String</type>
  375 + <length>-1</length>
  376 + <precision>-1</precision>
  377 + <trim_type>none</trim_type>
  378 + <repeat>N</repeat>
  379 + <format/>
  380 + <currency/>
  381 + <decimal/>
  382 + <group/>
  383 + </field>
  384 + <field>
  385 + <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
  386 + <type>String</type>
  387 + <length>-1</length>
  388 + <precision>-1</precision>
  389 + <trim_type>none</trim_type>
  390 + <repeat>N</repeat>
  391 + <format/>
  392 + <currency/>
  393 + <decimal/>
  394 + <group/>
  395 + </field>
  396 + <field>
  397 + <name>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</name>
  398 + <type>String</type>
  399 + <length>-1</length>
  400 + <precision>-1</precision>
  401 + <trim_type>none</trim_type>
  402 + <repeat>N</repeat>
  403 + <format/>
  404 + <currency/>
  405 + <decimal/>
  406 + <group/>
  407 + </field>
  408 + <field>
  409 + <name>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</name>
  410 + <type>String</type>
  411 + <length>-1</length>
  412 + <precision>-1</precision>
  413 + <trim_type>none</trim_type>
  414 + <repeat>N</repeat>
  415 + <format/>
  416 + <currency/>
  417 + <decimal/>
  418 + <group/>
  419 + </field>
  420 + </fields>
  421 + <sheets>
  422 + <sheet>
  423 + <name>&#x5de5;&#x4f5c;&#x8868;1</name>
  424 + <startrow>0</startrow>
  425 + <startcol>0</startcol>
  426 + </sheet>
  427 + </sheets>
  428 + <strict_types>N</strict_types>
  429 + <error_ignored>N</error_ignored>
  430 + <error_line_skipped>N</error_line_skipped>
  431 + <bad_line_files_destination_directory/>
  432 + <bad_line_files_extension>warning</bad_line_files_extension>
  433 + <error_line_files_destination_directory/>
  434 + <error_line_files_extension>error</error_line_files_extension>
  435 + <line_number_files_destination_directory/>
  436 + <line_number_files_extension>line</line_number_files_extension>
  437 + <shortFileFieldName/>
  438 + <pathFieldName/>
  439 + <hiddenFieldName/>
  440 + <lastModificationTimeFieldName/>
  441 + <uriNameFieldName/>
  442 + <rootUriNameFieldName/>
  443 + <extensionFieldName/>
  444 + <sizeFieldName/>
  445 + <spreadsheet_type>JXL</spreadsheet_type>
  446 + <cluster_schema/>
  447 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  448 + <xloc>131</xloc>
  449 + <yloc>58</yloc>
  450 + <draw>Y</draw>
  451 + </GUI>
  452 + </step>
  453 +
  454 + <step>
  455 + <name>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_cars 2</name>
  456 + <type>InsertUpdate</type>
  457 + <description/>
  458 + <distribute>Y</distribute>
  459 + <custom_distribution/>
  460 + <copies>1</copies>
  461 + <partitioning>
  462 + <method>none</method>
  463 + <schema_name/>
  464 + </partitioning>
  465 + <connection>bus_control_variable</connection>
  466 + <commit>1000</commit>
  467 + <update_bypassed>N</update_bypassed>
  468 + <lookup>
  469 + <schema/>
  470 + <table>bsth_c_cars</table>
  471 + <key>
  472 + <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
  473 + <field>inside_code</field>
  474 + <condition>&#x3d;</condition>
  475 + <name2/>
  476 + </key>
  477 + <value>
  478 + <name>car_gride</name>
  479 + <rename>&#x8f66;&#x724c;&#x53f7;</rename>
  480 + <update>Y</update>
  481 + </value>
  482 + <value>
  483 + <name>car_code</name>
  484 + <rename>&#x8f66;&#x8f86;&#x7f16;&#x7801;</rename>
  485 + <update>Y</update>
  486 + </value>
  487 + <value>
  488 + <name>inside_code</name>
  489 + <rename>&#x5185;&#x90e8;&#x7f16;&#x7801;</rename>
  490 + <update>Y</update>
  491 + </value>
  492 + <value>
  493 + <name>company</name>
  494 + <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;</rename>
  495 + <update>Y</update>
  496 + </value>
  497 + <value>
  498 + <name>business_code</name>
  499 + <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</rename>
  500 + <update>Y</update>
  501 + </value>
  502 + <value>
  503 + <name>branche_company</name>
  504 + <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</rename>
  505 + <update>Y</update>
  506 + </value>
  507 + <value>
  508 + <name>branche_company_code</name>
  509 + <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</rename>
  510 + <update>Y</update>
  511 + </value>
  512 + <value>
  513 + <name>supplier_name</name>
  514 + <rename>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</rename>
  515 + <update>Y</update>
  516 + </value>
  517 + <value>
  518 + <name>equipment_code</name>
  519 + <rename>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</rename>
  520 + <update>Y</update>
  521 + </value>
  522 + </lookup>
  523 + <cluster_schema/>
  524 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  525 + <xloc>516</xloc>
  526 + <yloc>138</yloc>
  527 + <draw>Y</draw>
  528 + </GUI>
  529 + </step>
  530 +
  531 + <step>
  532 + <name>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</name>
  533 + <type>GetVariable</type>
  534 + <description/>
  535 + <distribute>Y</distribute>
  536 + <custom_distribution/>
  537 + <copies>1</copies>
  538 + <partitioning>
  539 + <method>none</method>
  540 + <schema_name/>
  541 + </partitioning>
  542 + <fields>
  543 + <field>
  544 + <name>filepath_</name>
  545 + <variable>&#x24;&#x7b;filepath&#x7d;</variable>
  546 + <type>String</type>
  547 + <format/>
  548 + <currency/>
  549 + <decimal/>
  550 + <group/>
  551 + <length>-1</length>
  552 + <precision>-1</precision>
  553 + <trim_type>none</trim_type>
  554 + </field>
  555 + <field>
  556 + <name>erroroutputdir_</name>
  557 + <variable>&#x24;&#x7b;erroroutputdir&#x7d;</variable>
  558 + <type>String</type>
  559 + <format/>
  560 + <currency/>
  561 + <decimal/>
  562 + <group/>
  563 + <length>-1</length>
  564 + <precision>-1</precision>
  565 + <trim_type>none</trim_type>
  566 + </field>
  567 + </fields>
  568 + <cluster_schema/>
  569 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  570 + <xloc>134</xloc>
  571 + <yloc>183</yloc>
  572 + <draw>Y</draw>
  573 + </GUI>
  574 + </step>
  575 +
  576 + <step>
  577 + <name>&#x9519;&#x8bef;&#x8f93;&#x51fa; 2</name>
  578 + <type>ExcelOutput</type>
  579 + <description/>
  580 + <distribute>Y</distribute>
  581 + <custom_distribution/>
  582 + <copies>1</copies>
  583 + <partitioning>
  584 + <method>none</method>
  585 + <schema_name/>
  586 + </partitioning>
  587 + <header>Y</header>
  588 + <footer>N</footer>
  589 + <encoding/>
  590 + <append>N</append>
  591 + <add_to_result_filenames>Y</add_to_result_filenames>
  592 + <file>
  593 + <name>&#x24;&#x7b;erroroutputdir&#x7d;&#x2f;&#x8f66;&#x8f86;&#x57fa;&#x7840;&#x4fe1;&#x606f;_&#x9519;&#x8bef;</name>
  594 + <extention>xls</extention>
  595 + <do_not_open_newfile_init>N</do_not_open_newfile_init>
  596 + <create_parent_folder>N</create_parent_folder>
  597 + <split>N</split>
  598 + <add_date>N</add_date>
  599 + <add_time>N</add_time>
  600 + <SpecifyFormat>N</SpecifyFormat>
  601 + <date_time_format/>
  602 + <sheetname>Sheet1</sheetname>
  603 + <autosizecolums>N</autosizecolums>
  604 + <nullisblank>N</nullisblank>
  605 + <protect_sheet>N</protect_sheet>
  606 + <password>Encrypted </password>
  607 + <splitevery>0</splitevery>
  608 + <usetempfiles>N</usetempfiles>
  609 + <tempdirectory/>
  610 + </file>
  611 + <template>
  612 + <enabled>N</enabled>
  613 + <append>N</append>
  614 + <filename>template.xls</filename>
  615 + </template>
  616 + <fields>
  617 + <field>
  618 + <name>&#x8f66;&#x724c;&#x53f7;</name>
  619 + <type>String</type>
  620 + <format/>
  621 + </field>
  622 + <field>
  623 + <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
  624 + <type>String</type>
  625 + <format/>
  626 + </field>
  627 + <field>
  628 + <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;</name>
  629 + <type>String</type>
  630 + <format/>
  631 + </field>
  632 + <field>
  633 + <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
  634 + <type>String</type>
  635 + <format/>
  636 + </field>
  637 + <field>
  638 + <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</name>
  639 + <type>String</type>
  640 + <format/>
  641 + </field>
  642 + <field>
  643 + <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
  644 + <type>String</type>
  645 + <format/>
  646 + </field>
  647 + <field>
  648 + <name>&#x4f9b;&#x5e94;&#x5546;&#x540d;&#x79f0;</name>
  649 + <type>String</type>
  650 + <format/>
  651 + </field>
  652 + <field>
  653 + <name>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</name>
  654 + <type>String</type>
  655 + <format/>
  656 + </field>
  657 + <field>
  658 + <name>error_count</name>
  659 + <type>Integer</type>
  660 + <format/>
  661 + </field>
  662 + <field>
  663 + <name>error_desc</name>
  664 + <type>String</type>
  665 + <format/>
  666 + </field>
  667 + <field>
  668 + <name>error_column1</name>
  669 + <type>String</type>
  670 + <format/>
  671 + </field>
  672 + <field>
  673 + <name>error_column2</name>
  674 + <type>String</type>
  675 + <format/>
  676 + </field>
  677 + </fields>
  678 + <custom>
  679 + <header_font_name>arial</header_font_name>
  680 + <header_font_size>10</header_font_size>
  681 + <header_font_bold>N</header_font_bold>
  682 + <header_font_italic>N</header_font_italic>
  683 + <header_font_underline>no</header_font_underline>
  684 + <header_font_orientation>horizontal</header_font_orientation>
  685 + <header_font_color>black</header_font_color>
  686 + <header_background_color>none</header_background_color>
  687 + <header_row_height>255</header_row_height>
  688 + <header_alignment>left</header_alignment>
  689 + <header_image/>
  690 + <row_font_name>arial</row_font_name>
  691 + <row_font_size>10</row_font_size>
  692 + <row_font_color>black</row_font_color>
  693 + <row_background_color>none</row_background_color>
  694 + </custom>
  695 + <cluster_schema/>
  696 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  697 + <xloc>328</xloc>
  698 + <yloc>140</yloc>
  699 + <draw>Y</draw>
  700 + </GUI>
  701 + </step>
  702 +
  703 + <step_error_handling>
  704 + <error>
  705 + <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_cars 2</source_step>
  706 + <target_step>&#x9519;&#x8bef;&#x8f93;&#x51fa; 2</target_step>
  707 + <is_enabled>Y</is_enabled>
  708 + <nr_valuename>error_count</nr_valuename>
  709 + <descriptions_valuename>error_desc</descriptions_valuename>
  710 + <fields_valuename>error_column1</fields_valuename>
  711 + <codes_valuename>error_column2</codes_valuename>
  712 + <max_errors/>
  713 + <max_pct_errors/>
  714 + <min_pct_rows/>
  715 + </error>
  716 + </step_error_handling>
  717 + <slave-step-copy-partition-distribution>
  718 +</slave-step-copy-partition-distribution>
  719 + <slave_transformation>N</slave_transformation>
  720 +
  721 +</transformation>
... ...
src/main/resources/datatools/ktrs/carsDataOutput.ktr
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<transformation>
3   - <info>
4   - <name>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x51fa;</name>
5   - <description>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x51fa;</description>
6   - <extended_description>&#x8f66;&#x8f86;&#x57fa;&#x7840;&#x4fe1;&#x606f;</extended_description>
7   - <trans_version/>
8   - <trans_type>Normal</trans_type>
9   - <trans_status>0</trans_status>
10   - <directory>&#x2f;</directory>
11   - <parameters>
12   - <parameter>
13   - <name>filepath</name>
14   - <default_value/>
15   - <description>excel&#x6587;&#x4ef6;&#x8def;&#x5f84;</description>
16   - </parameter>
17   - </parameters>
18   - <log>
19   -<trans-log-table><connection/>
20   -<schema/>
21   -<table/>
22   -<size_limit_lines/>
23   -<interval/>
24   -<timeout_days/>
25   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table>
26   -<perf-log-table><connection/>
27   -<schema/>
28   -<table/>
29   -<interval/>
30   -<timeout_days/>
31   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
32   -<channel-log-table><connection/>
33   -<schema/>
34   -<table/>
35   -<timeout_days/>
36   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
37   -<step-log-table><connection/>
38   -<schema/>
39   -<table/>
40   -<timeout_days/>
41   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
42   -<metrics-log-table><connection/>
43   -<schema/>
44   -<table/>
45   -<timeout_days/>
46   -<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table>
47   - </log>
48   - <maxdate>
49   - <connection/>
50   - <table/>
51   - <field/>
52   - <offset>0.0</offset>
53   - <maxdiff>0.0</maxdiff>
54   - </maxdate>
55   - <size_rowset>10000</size_rowset>
56   - <sleep_time_empty>50</sleep_time_empty>
57   - <sleep_time_full>50</sleep_time_full>
58   - <unique_connections>N</unique_connections>
59   - <feedback_shown>Y</feedback_shown>
60   - <feedback_size>50000</feedback_size>
61   - <using_thread_priorities>Y</using_thread_priorities>
62   - <shared_objects_file/>
63   - <capture_step_performance>N</capture_step_performance>
64   - <step_performance_capturing_delay>1000</step_performance_capturing_delay>
65   - <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
66   - <dependencies>
67   - </dependencies>
68   - <partitionschemas>
69   - </partitionschemas>
70   - <slaveservers>
71   - </slaveservers>
72   - <clusterschemas>
73   - </clusterschemas>
74   - <created_user>-</created_user>
75   - <created_date>2016&#x2f;08&#x2f;05 16&#x3a;42&#x3a;22.753</created_date>
76   - <modified_user>-</modified_user>
77   - <modified_date>2016&#x2f;08&#x2f;05 16&#x3a;42&#x3a;22.753</modified_date>
78   - <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>
79   - <is_key_private>N</is_key_private>
80   - </info>
81   - <notepads>
82   - </notepads>
83   - <connection>
84   - <name>192.168.168.1_jwgl_dw</name>
85   - <server>192.168.168.1</server>
86   - <type>ORACLE</type>
87   - <access>Native</access>
88   - <database>orcl</database>
89   - <port>1521</port>
90   - <username>jwgl_dw</username>
91   - <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>
92   - <servername/>
93   - <data_tablespace/>
94   - <index_tablespace/>
95   - <attributes>
96   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
97   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
98   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
99   - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
100   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
101   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
102   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
103   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
104   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
105   - </attributes>
106   - </connection>
107   - <connection>
108   - <name>bus_control_variable</name>
109   - <server>&#x24;&#x7b;v_db_ip&#x7d;</server>
110   - <type>MYSQL</type>
111   - <access>Native</access>
112   - <database>&#x24;&#x7b;v_db_dname&#x7d;</database>
113   - <port>3306</port>
114   - <username>&#x24;&#x7b;v_db_uname&#x7d;</username>
115   - <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>
116   - <servername/>
117   - <data_tablespace/>
118   - <index_tablespace/>
119   - <attributes>
120   - <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
121   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
122   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
123   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
124   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
125   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
126   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
127   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
128   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
129   - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
130   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
131   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
132   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
133   - </attributes>
134   - </connection>
135   - <connection>
136   - <name>bus_control_&#x516c;&#x53f8;_201</name>
137   - <server>localhost</server>
138   - <type>MYSQL</type>
139   - <access>Native</access>
140   - <database>control</database>
141   - <port>3306</port>
142   - <username>root</username>
143   - <password>Encrypted </password>
144   - <servername/>
145   - <data_tablespace/>
146   - <index_tablespace/>
147   - <attributes>
148   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
149   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
150   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
151   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
152   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
153   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
154   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
155   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
156   - <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
157   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
158   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
159   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
160   - </attributes>
161   - </connection>
162   - <connection>
163   - <name>bus_control_&#x672c;&#x673a;</name>
164   - <server>localhost</server>
165   - <type>MYSQL</type>
166   - <access>Native</access>
167   - <database>control</database>
168   - <port>3306</port>
169   - <username>root</username>
170   - <password>Encrypted </password>
171   - <servername/>
172   - <data_tablespace/>
173   - <index_tablespace/>
174   - <attributes>
175   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
176   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
177   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
178   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
179   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
180   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
181   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
182   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
183   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
184   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
185   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
186   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
187   - </attributes>
188   - </connection>
189   - <connection>
190   - <name>xlab_mysql_youle</name>
191   - <server>101.231.124.8</server>
192   - <type>MYSQL</type>
193   - <access>Native</access>
194   - <database>xlab_youle</database>
195   - <port>45687</port>
196   - <username>xlab-youle</username>
197   - <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>
198   - <servername/>
199   - <data_tablespace/>
200   - <index_tablespace/>
201   - <attributes>
202   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
203   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
204   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
205   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
206   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
207   - <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>
208   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
209   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
210   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
211   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
212   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
213   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
214   - </attributes>
215   - </connection>
216   - <connection>
217   - <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>
218   - <server>localhost</server>
219   - <type>MYSQL</type>
220   - <access>Native</access>
221   - <database>xlab_youle</database>
222   - <port>3306</port>
223   - <username>root</username>
224   - <password>Encrypted </password>
225   - <servername/>
226   - <data_tablespace/>
227   - <index_tablespace/>
228   - <attributes>
229   - <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
230   - <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
231   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
232   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
233   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
234   - <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
235   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
236   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
237   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
238   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
239   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
240   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
241   - </attributes>
242   - </connection>
243   - <connection>
244   - <name>xlab_youle</name>
245   - <server/>
246   - <type>MYSQL</type>
247   - <access>JNDI</access>
248   - <database>xlab_youle</database>
249   - <port>1521</port>
250   - <username/>
251   - <password>Encrypted </password>
252   - <servername/>
253   - <data_tablespace/>
254   - <index_tablespace/>
255   - <attributes>
256   - <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
257   - <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
258   - <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
259   - <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
260   - <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
261   - <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
262   - <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
263   - <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
264   - <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
265   - <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
266   - </attributes>
267   - </connection>
268   - <order>
269   - <hop> <from>&#x8868;&#x8f93;&#x5165;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop>
270   - <hop> <from>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</from><to>Excel&#x8f93;&#x51fa;</to><enabled>Y</enabled> </hop>
271   - </order>
272   - <step>
273   - <name>Excel&#x8f93;&#x51fa;</name>
274   - <type>ExcelOutput</type>
275   - <description/>
276   - <distribute>Y</distribute>
277   - <custom_distribution/>
278   - <copies>1</copies>
279   - <partitioning>
280   - <method>none</method>
281   - <schema_name/>
282   - </partitioning>
283   - <header>Y</header>
284   - <footer>N</footer>
285   - <encoding/>
286   - <append>N</append>
287   - <add_to_result_filenames>Y</add_to_result_filenames>
288   - <file>
289   - <name>&#x24;&#x7b;filepath&#x7d;</name>
290   - <extention/>
291   - <do_not_open_newfile_init>N</do_not_open_newfile_init>
292   - <create_parent_folder>N</create_parent_folder>
293   - <split>N</split>
294   - <add_date>N</add_date>
295   - <add_time>N</add_time>
296   - <SpecifyFormat>N</SpecifyFormat>
297   - <date_time_format>yyyyMMddHHmmss</date_time_format>
298   - <sheetname>&#x5de5;&#x4f5c;&#x8868;1</sheetname>
299   - <autosizecolums>N</autosizecolums>
300   - <nullisblank>N</nullisblank>
301   - <protect_sheet>N</protect_sheet>
302   - <password>Encrypted </password>
303   - <splitevery>0</splitevery>
304   - <usetempfiles>N</usetempfiles>
305   - <tempdirectory/>
306   - </file>
307   - <template>
308   - <enabled>N</enabled>
309   - <append>N</append>
310   - <filename>template.xls</filename>
311   - </template>
312   - <fields>
313   - <field>
314   - <name>&#x8f66;&#x724c;&#x53f7;</name>
315   - <type>String</type>
316   - <format/>
317   - </field>
318   - <field>
319   - <name>&#x8f66;&#x8f86;&#x7f16;&#x7801;</name>
320   - <type>String</type>
321   - <format/>
322   - </field>
323   - <field>
324   - <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
325   - <type>String</type>
326   - <format/>
327   - </field>
328   - <field>
329   - <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;</name>
330   - <type>String</type>
331   - <format/>
332   - </field>
333   - <field>
334   - <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
335   - <type>String</type>
336   - <format/>
337   - </field>
338   - <field>
339   - <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</name>
340   - <type>String</type>
341   - <format/>
342   - </field>
343   - <field>
344   - <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
345   - <type>String</type>
346   - <format/>
347   - </field>
348   - <field>
349   - <name>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</name>
350   - <type>String</type>
351   - <format/>
352   - </field>
353   - <field>
354   - <name>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</name>
355   - <type>String</type>
356   - <format/>
357   - </field>
358   - </fields>
359   - <custom>
360   - <header_font_name>arial</header_font_name>
361   - <header_font_size>10</header_font_size>
362   - <header_font_bold>N</header_font_bold>
363   - <header_font_italic>N</header_font_italic>
364   - <header_font_underline>no</header_font_underline>
365   - <header_font_orientation>horizontal</header_font_orientation>
366   - <header_font_color>black</header_font_color>
367   - <header_background_color>none</header_background_color>
368   - <header_row_height>255</header_row_height>
369   - <header_alignment>left</header_alignment>
370   - <header_image/>
371   - <row_font_name>arial</row_font_name>
372   - <row_font_size>10</row_font_size>
373   - <row_font_color>black</row_font_color>
374   - <row_background_color>none</row_background_color>
375   - </custom>
376   - <cluster_schema/>
377   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
378   - <xloc>282</xloc>
379   - <yloc>169</yloc>
380   - <draw>Y</draw>
381   - </GUI>
382   - </step>
383   -
384   - <step>
385   - <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
386   - <type>SelectValues</type>
387   - <description/>
388   - <distribute>Y</distribute>
389   - <custom_distribution/>
390   - <copies>1</copies>
391   - <partitioning>
392   - <method>none</method>
393   - <schema_name/>
394   - </partitioning>
395   - <fields> <field> <name>car_plate</name>
396   - <rename>&#x8f66;&#x724c;&#x53f7;</rename>
397   - <length>-2</length>
398   - <precision>-2</precision>
399   - </field> <field> <name>car_code</name>
400   - <rename>&#x8f66;&#x8f86;&#x7f16;&#x7801;</rename>
401   - <length>-2</length>
402   - <precision>-2</precision>
403   - </field> <field> <name>inside_code</name>
404   - <rename>&#x5185;&#x90e8;&#x7f16;&#x7801;</rename>
405   - <length>-2</length>
406   - <precision>-2</precision>
407   - </field> <field> <name>company</name>
408   - <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;</rename>
409   - <length>-2</length>
410   - <precision>-2</precision>
411   - </field> <field> <name>business_code</name>
412   - <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</rename>
413   - <length>-2</length>
414   - <precision>-2</precision>
415   - </field> <field> <name>branche_company</name>
416   - <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</rename>
417   - <length>-2</length>
418   - <precision>-2</precision>
419   - </field> <field> <name>branche_company_code</name>
420   - <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</rename>
421   - <length>-2</length>
422   - <precision>-2</precision>
423   - </field> <field> <name>supplier_name</name>
424   - <rename>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</rename>
425   - <length>-2</length>
426   - <precision>-2</precision>
427   - </field> <field> <name>equipment_code</name>
428   - <rename>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</rename>
429   - <length>-2</length>
430   - <precision>-2</precision>
431   - </field> <select_unspecified>N</select_unspecified>
432   - </fields> <cluster_schema/>
433   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
434   - <xloc>280</xloc>
435   - <yloc>67</yloc>
436   - <draw>Y</draw>
437   - </GUI>
438   - </step>
439   -
440   - <step>
441   - <name>&#x8868;&#x8f93;&#x5165;</name>
442   - <type>TableInput</type>
443   - <description/>
444   - <distribute>Y</distribute>
445   - <custom_distribution/>
446   - <copies>1</copies>
447   - <partitioning>
448   - <method>none</method>
449   - <schema_name/>
450   - </partitioning>
451   - <connection>bus_control_variable</connection>
452   - <sql>SELECT &#x2a; FROM bsth_c_cars&#x3b;</sql>
453   - <limit>0</limit>
454   - <lookup/>
455   - <execute_each_row>N</execute_each_row>
456   - <variables_active>N</variables_active>
457   - <lazy_conversion_active>N</lazy_conversion_active>
458   - <cluster_schema/>
459   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
460   - <xloc>105</xloc>
461   - <yloc>67</yloc>
462   - <draw>Y</draw>
463   - </GUI>
464   - </step>
465   -
466   - <step_error_handling>
467   - </step_error_handling>
468   - <slave-step-copy-partition-distribution>
469   -</slave-step-copy-partition-distribution>
470   - <slave_transformation>N</slave_transformation>
471   -
472   -</transformation>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<transformation>
  3 + <info>
  4 + <name>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x51fa;</name>
  5 + <description>&#x8f66;&#x8f86;&#x4fe1;&#x606f;&#x5bfc;&#x51fa;</description>
  6 + <extended_description>&#x8f66;&#x8f86;&#x57fa;&#x7840;&#x4fe1;&#x606f;</extended_description>
  7 + <trans_version/>
  8 + <trans_type>Normal</trans_type>
  9 + <trans_status>0</trans_status>
  10 + <directory>&#x2f;</directory>
  11 + <parameters>
  12 + <parameter>
  13 + <name>filepath</name>
  14 + <default_value/>
  15 + <description>excel&#x6587;&#x4ef6;&#x8def;&#x5f84;</description>
  16 + </parameter>
  17 + </parameters>
  18 + <log>
  19 +<trans-log-table><connection/>
  20 +<schema/>
  21 +<table/>
  22 +<size_limit_lines/>
  23 +<interval/>
  24 +<timeout_days/>
  25 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table>
  26 +<perf-log-table><connection/>
  27 +<schema/>
  28 +<table/>
  29 +<interval/>
  30 +<timeout_days/>
  31 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
  32 +<channel-log-table><connection/>
  33 +<schema/>
  34 +<table/>
  35 +<timeout_days/>
  36 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
  37 +<step-log-table><connection/>
  38 +<schema/>
  39 +<table/>
  40 +<timeout_days/>
  41 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
  42 +<metrics-log-table><connection/>
  43 +<schema/>
  44 +<table/>
  45 +<timeout_days/>
  46 +<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table>
  47 + </log>
  48 + <maxdate>
  49 + <connection/>
  50 + <table/>
  51 + <field/>
  52 + <offset>0.0</offset>
  53 + <maxdiff>0.0</maxdiff>
  54 + </maxdate>
  55 + <size_rowset>10000</size_rowset>
  56 + <sleep_time_empty>50</sleep_time_empty>
  57 + <sleep_time_full>50</sleep_time_full>
  58 + <unique_connections>N</unique_connections>
  59 + <feedback_shown>Y</feedback_shown>
  60 + <feedback_size>50000</feedback_size>
  61 + <using_thread_priorities>Y</using_thread_priorities>
  62 + <shared_objects_file/>
  63 + <capture_step_performance>N</capture_step_performance>
  64 + <step_performance_capturing_delay>1000</step_performance_capturing_delay>
  65 + <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
  66 + <dependencies>
  67 + </dependencies>
  68 + <partitionschemas>
  69 + </partitionschemas>
  70 + <slaveservers>
  71 + </slaveservers>
  72 + <clusterschemas>
  73 + </clusterschemas>
  74 + <created_user>-</created_user>
  75 + <created_date>2016&#x2f;08&#x2f;05 16&#x3a;42&#x3a;22.753</created_date>
  76 + <modified_user>-</modified_user>
  77 + <modified_date>2016&#x2f;08&#x2f;05 16&#x3a;42&#x3a;22.753</modified_date>
  78 + <key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA&#x3d;</key_for_session_key>
  79 + <is_key_private>N</is_key_private>
  80 + </info>
  81 + <notepads>
  82 + </notepads>
  83 + <connection>
  84 + <name>192.168.168.1_jwgl_dw</name>
  85 + <server>192.168.168.1</server>
  86 + <type>ORACLE</type>
  87 + <access>Native</access>
  88 + <database>orcl</database>
  89 + <port>1521</port>
  90 + <username>jwgl_dw</username>
  91 + <password>Encrypted 2be98afc86aa7f2e4cb13b977d2adabcd</password>
  92 + <servername/>
  93 + <data_tablespace/>
  94 + <index_tablespace/>
  95 + <attributes>
  96 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  97 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  98 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  99 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  100 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  101 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  102 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  103 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  104 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  105 + </attributes>
  106 + </connection>
  107 + <connection>
  108 + <name>bus_control_variable</name>
  109 + <server>&#x24;&#x7b;v_db_ip&#x7d;</server>
  110 + <type>MYSQL</type>
  111 + <access>Native</access>
  112 + <database>&#x24;&#x7b;v_db_dname&#x7d;</database>
  113 + <port>3306</port>
  114 + <username>&#x24;&#x7b;v_db_uname&#x7d;</username>
  115 + <password>&#x24;&#x7b;v_db_pwd&#x7d;</password>
  116 + <servername/>
  117 + <data_tablespace/>
  118 + <index_tablespace/>
  119 + <attributes>
  120 + <attribute><code>EXTRA_OPTION_MYSQL.characterEncoding</code><attribute>utf8</attribute></attribute>
  121 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  122 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  123 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  124 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  125 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  126 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  127 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  128 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  129 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  130 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  131 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  132 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  133 + </attributes>
  134 + </connection>
  135 + <connection>
  136 + <name>bus_control_&#x516c;&#x53f8;_201</name>
  137 + <server>localhost</server>
  138 + <type>MYSQL</type>
  139 + <access>Native</access>
  140 + <database>control</database>
  141 + <port>3306</port>
  142 + <username>root</username>
  143 + <password>Encrypted </password>
  144 + <servername/>
  145 + <data_tablespace/>
  146 + <index_tablespace/>
  147 + <attributes>
  148 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  149 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  150 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  151 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  152 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  153 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  154 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  155 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  156 + <attribute><code>STREAM_RESULTS</code><attribute>N</attribute></attribute>
  157 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  158 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  159 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  160 + </attributes>
  161 + </connection>
  162 + <connection>
  163 + <name>bus_control_&#x672c;&#x673a;</name>
  164 + <server>localhost</server>
  165 + <type>MYSQL</type>
  166 + <access>Native</access>
  167 + <database>control</database>
  168 + <port>3306</port>
  169 + <username>root</username>
  170 + <password>Encrypted </password>
  171 + <servername/>
  172 + <data_tablespace/>
  173 + <index_tablespace/>
  174 + <attributes>
  175 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  176 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  177 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  178 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  179 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  180 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  181 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  182 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  183 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  184 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  185 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  186 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  187 + </attributes>
  188 + </connection>
  189 + <connection>
  190 + <name>xlab_mysql_youle</name>
  191 + <server>101.231.124.8</server>
  192 + <type>MYSQL</type>
  193 + <access>Native</access>
  194 + <database>xlab_youle</database>
  195 + <port>45687</port>
  196 + <username>xlab-youle</username>
  197 + <password>Encrypted 2be98afc86aa78a88aa1be369d187a3df</password>
  198 + <servername/>
  199 + <data_tablespace/>
  200 + <index_tablespace/>
  201 + <attributes>
  202 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  203 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  204 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  205 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  206 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  207 + <attribute><code>PORT_NUMBER</code><attribute>45687</attribute></attribute>
  208 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  209 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  210 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  211 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  212 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  213 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  214 + </attributes>
  215 + </connection>
  216 + <connection>
  217 + <name>xlab_mysql_youle&#xff08;&#x672c;&#x673a;&#xff09;</name>
  218 + <server>localhost</server>
  219 + <type>MYSQL</type>
  220 + <access>Native</access>
  221 + <database>xlab_youle</database>
  222 + <port>3306</port>
  223 + <username>root</username>
  224 + <password>Encrypted </password>
  225 + <servername/>
  226 + <data_tablespace/>
  227 + <index_tablespace/>
  228 + <attributes>
  229 + <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
  230 + <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
  231 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  232 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  233 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  234 + <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
  235 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  236 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  237 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  238 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
  239 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>N</attribute></attribute>
  240 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  241 + </attributes>
  242 + </connection>
  243 + <connection>
  244 + <name>xlab_youle</name>
  245 + <server/>
  246 + <type>MYSQL</type>
  247 + <access>JNDI</access>
  248 + <database>xlab_youle</database>
  249 + <port>1521</port>
  250 + <username/>
  251 + <password>Encrypted </password>
  252 + <servername/>
  253 + <data_tablespace/>
  254 + <index_tablespace/>
  255 + <attributes>
  256 + <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
  257 + <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
  258 + <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
  259 + <attribute><code>PORT_NUMBER</code><attribute>1521</attribute></attribute>
  260 + <attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
  261 + <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
  262 + <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
  263 + <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
  264 + <attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
  265 + <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
  266 + </attributes>
  267 + </connection>
  268 + <order>
  269 + <hop> <from>&#x8868;&#x8f93;&#x5165;</from><to>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</to><enabled>Y</enabled> </hop>
  270 + <hop> <from>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</from><to>Excel&#x8f93;&#x51fa;</to><enabled>Y</enabled> </hop>
  271 + </order>
  272 + <step>
  273 + <name>Excel&#x8f93;&#x51fa;</name>
  274 + <type>ExcelOutput</type>
  275 + <description/>
  276 + <distribute>Y</distribute>
  277 + <custom_distribution/>
  278 + <copies>1</copies>
  279 + <partitioning>
  280 + <method>none</method>
  281 + <schema_name/>
  282 + </partitioning>
  283 + <header>Y</header>
  284 + <footer>N</footer>
  285 + <encoding/>
  286 + <append>N</append>
  287 + <add_to_result_filenames>Y</add_to_result_filenames>
  288 + <file>
  289 + <name>&#x24;&#x7b;filepath&#x7d;</name>
  290 + <extention/>
  291 + <do_not_open_newfile_init>N</do_not_open_newfile_init>
  292 + <create_parent_folder>N</create_parent_folder>
  293 + <split>N</split>
  294 + <add_date>N</add_date>
  295 + <add_time>N</add_time>
  296 + <SpecifyFormat>N</SpecifyFormat>
  297 + <date_time_format>yyyyMMddHHmmss</date_time_format>
  298 + <sheetname>&#x5de5;&#x4f5c;&#x8868;1</sheetname>
  299 + <autosizecolums>N</autosizecolums>
  300 + <nullisblank>N</nullisblank>
  301 + <protect_sheet>N</protect_sheet>
  302 + <password>Encrypted </password>
  303 + <splitevery>0</splitevery>
  304 + <usetempfiles>N</usetempfiles>
  305 + <tempdirectory/>
  306 + </file>
  307 + <template>
  308 + <enabled>N</enabled>
  309 + <append>N</append>
  310 + <filename>template.xls</filename>
  311 + </template>
  312 + <fields>
  313 + <field>
  314 + <name>&#x8f66;&#x724c;&#x53f7;</name>
  315 + <type>String</type>
  316 + <format/>
  317 + </field>
  318 + <field>
  319 + <name>&#x8f66;&#x8f86;&#x7f16;&#x7801;</name>
  320 + <type>String</type>
  321 + <format/>
  322 + </field>
  323 + <field>
  324 + <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
  325 + <type>String</type>
  326 + <format/>
  327 + </field>
  328 + <field>
  329 + <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;</name>
  330 + <type>String</type>
  331 + <format/>
  332 + </field>
  333 + <field>
  334 + <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
  335 + <type>String</type>
  336 + <format/>
  337 + </field>
  338 + <field>
  339 + <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</name>
  340 + <type>String</type>
  341 + <format/>
  342 + </field>
  343 + <field>
  344 + <name>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
  345 + <type>String</type>
  346 + <format/>
  347 + </field>
  348 + <field>
  349 + <name>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</name>
  350 + <type>String</type>
  351 + <format/>
  352 + </field>
  353 + <field>
  354 + <name>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</name>
  355 + <type>String</type>
  356 + <format/>
  357 + </field>
  358 + </fields>
  359 + <custom>
  360 + <header_font_name>arial</header_font_name>
  361 + <header_font_size>10</header_font_size>
  362 + <header_font_bold>N</header_font_bold>
  363 + <header_font_italic>N</header_font_italic>
  364 + <header_font_underline>no</header_font_underline>
  365 + <header_font_orientation>horizontal</header_font_orientation>
  366 + <header_font_color>black</header_font_color>
  367 + <header_background_color>none</header_background_color>
  368 + <header_row_height>255</header_row_height>
  369 + <header_alignment>left</header_alignment>
  370 + <header_image/>
  371 + <row_font_name>arial</row_font_name>
  372 + <row_font_size>10</row_font_size>
  373 + <row_font_color>black</row_font_color>
  374 + <row_background_color>none</row_background_color>
  375 + </custom>
  376 + <cluster_schema/>
  377 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  378 + <xloc>282</xloc>
  379 + <yloc>169</yloc>
  380 + <draw>Y</draw>
  381 + </GUI>
  382 + </step>
  383 +
  384 + <step>
  385 + <name>&#x5b57;&#x6bb5;&#x9009;&#x62e9;</name>
  386 + <type>SelectValues</type>
  387 + <description/>
  388 + <distribute>Y</distribute>
  389 + <custom_distribution/>
  390 + <copies>1</copies>
  391 + <partitioning>
  392 + <method>none</method>
  393 + <schema_name/>
  394 + </partitioning>
  395 + <fields> <field> <name>car_plate</name>
  396 + <rename>&#x8f66;&#x724c;&#x53f7;</rename>
  397 + <length>-2</length>
  398 + <precision>-2</precision>
  399 + </field> <field> <name>car_code</name>
  400 + <rename>&#x8f66;&#x8f86;&#x7f16;&#x7801;</rename>
  401 + <length>-2</length>
  402 + <precision>-2</precision>
  403 + </field> <field> <name>inside_code</name>
  404 + <rename>&#x5185;&#x90e8;&#x7f16;&#x7801;</rename>
  405 + <length>-2</length>
  406 + <precision>-2</precision>
  407 + </field> <field> <name>company</name>
  408 + <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;</rename>
  409 + <length>-2</length>
  410 + <precision>-2</precision>
  411 + </field> <field> <name>business_code</name>
  412 + <rename>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</rename>
  413 + <length>-2</length>
  414 + <precision>-2</precision>
  415 + </field> <field> <name>branche_company</name>
  416 + <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;</rename>
  417 + <length>-2</length>
  418 + <precision>-2</precision>
  419 + </field> <field> <name>branche_company_code</name>
  420 + <rename>&#x6240;&#x5c5e;&#x5206;&#x516c;&#x53f8;&#x4ee3;&#x7801;</rename>
  421 + <length>-2</length>
  422 + <precision>-2</precision>
  423 + </field> <field> <name>supplier_name</name>
  424 + <rename>&#x8bbe;&#x5907;&#x4f9b;&#x5e94;&#x5382;&#x5546;</rename>
  425 + <length>-2</length>
  426 + <precision>-2</precision>
  427 + </field> <field> <name>equipment_code</name>
  428 + <rename>&#x8bbe;&#x5907;&#x7ec8;&#x7aef;&#x53f7;</rename>
  429 + <length>-2</length>
  430 + <precision>-2</precision>
  431 + </field> <select_unspecified>N</select_unspecified>
  432 + </fields> <cluster_schema/>
  433 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  434 + <xloc>280</xloc>
  435 + <yloc>67</yloc>
  436 + <draw>Y</draw>
  437 + </GUI>
  438 + </step>
  439 +
  440 + <step>
  441 + <name>&#x8868;&#x8f93;&#x5165;</name>
  442 + <type>TableInput</type>
  443 + <description/>
  444 + <distribute>Y</distribute>
  445 + <custom_distribution/>
  446 + <copies>1</copies>
  447 + <partitioning>
  448 + <method>none</method>
  449 + <schema_name/>
  450 + </partitioning>
  451 + <connection>bus_control_variable</connection>
  452 + <sql>SELECT &#x2a; FROM bsth_c_cars&#x3b;</sql>
  453 + <limit>0</limit>
  454 + <lookup/>
  455 + <execute_each_row>N</execute_each_row>
  456 + <variables_active>N</variables_active>
  457 + <lazy_conversion_active>N</lazy_conversion_active>
  458 + <cluster_schema/>
  459 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  460 + <xloc>105</xloc>
  461 + <yloc>67</yloc>
  462 + <draw>Y</draw>
  463 + </GUI>
  464 + </step>
  465 +
  466 + <step_error_handling>
  467 + </step_error_handling>
  468 + <slave-step-copy-partition-distribution>
  469 +</slave-step-copy-partition-distribution>
  470 + <slave_transformation>N</slave_transformation>
  471 +
  472 +</transformation>
... ...
src/main/resources/fatso/handle_real_ctl.js
1   -/**
2   - * 处理线调文件
3   - */
4   -var fs = require('fs')
5   - , cheerio = require('cheerio')
6   - , minifier = require('./minifier')
7   - , crypto = require("crypto")
8   - , CleanCSS = require('clean-css')
9   - , UglifyJS = require("uglify-js");
10   -;
11   -
12   -//不参与的目录
13   -var pName = 'bsth_control'
14   - , path = process.cwd()
15   - //根目录
16   - , root = path.substr(0, path.indexOf('\\src\\main'))
17   - , workspace = root.substr(0, root.indexOf('\\' + pName))
18   - //临时目录
19   - , dest = (workspace + '\\' + pName + '@fatso_copy').replace(/\//g, '\\')
20   - , _static = '\\src\\main\\resources\\static';
21   -
22   -
23   -var mainFile = dest + _static + '\\real_control_v2\\main.html';
24   -var mapFile = dest + _static + '\\real_control_v2\\mapmonitor\\real.html';
25   -var realCtl = {
26   - /**
27   - * 处理线调首页
28   - */
29   - handleMain: function (cb) {
30   - //读取文件
31   - var data = fs.readFileSync(mainFile, 'utf-8')
32   - , $ = cheerio.load(data);
33   -
34   - handleCss($, function () {
35   - handleJs($, mainFile, cb);
36   - });
37   - },
38   - /**
39   - * 处理地图模块
40   - * @param cb
41   - */
42   - handleMap: function (cb) {
43   - //读取文件
44   - var data = fs.readFileSync(mapFile, 'utf-8')
45   - , $ = cheerio.load(data);
46   -
47   - handleCss($, function () {
48   - handleJs($, mapFile, cb);
49   - });
50   - }
51   -};
52   -
53   -/**
54   - * 处理css
55   - * @type {any}
56   - */
57   -var handleCss = function ($, cb) {
58   - var cssArray = $('link[rel=stylesheet][merge]');
59   - //按 merge 值分组
60   - var cssMap = {}, mergeName;
61   - for (var i = 0, c; c = cssArray[i++];) {
62   - mergeName = $(c).attr('merge');
63   - if (!cssMap[mergeName])
64   - cssMap[mergeName] = [];
65   - cssMap[mergeName].push(dest + _static + $(c).attr('href'));
66   - //remove
67   - $(c).remove();
68   - }
69   - //按 merge 合并压缩css
70   - var ks = get_keys(cssMap), index = 0;
71   - (function () {
72   - if (index >= ks.length) {
73   - cb && cb();
74   - return;
75   - }
76   - var k = ks[index];
77   - index++;
78   - var f = arguments.callee;
79   - //合并css
80   - new CleanCSS().minify(cssMap[k], function (error, out) {
81   - var data = out.styles;
82   - var fName = (k + '_' + md5(data)) + '.css';
83   - //写入 assets css 目录下
84   - var descFile = dest + _static + '\\real_control_v2\\assets\\css\\' + fName;
85   - fs.open(descFile, 'a', function (err, fd) {
86   -
87   - fs.write(fd, data, function () {
88   - var tag = '<link rel="stylesheet" href="/real_control_v2/assets/css/' + fName + '"/>';
89   - if ($('head').length > 0)
90   - $('head').append(tag);
91   - else {
92   - if($('link').length > 0)
93   - $('link').last().before(tag);
94   - else
95   - $('div').first().before(tag);
96   - }
97   - console.log(k + ' css', '结束,下一个');
98   - f();
99   - });
100   - });
101   - });
102   - })();
103   -};
104   -
105   -/**
106   - * 处理js
107   - */
108   -var handleJs = function ($, file, cb) {
109   - var scriptArray = $('script[merge]');
110   - //按 merge 值分组
111   - var jsMap = {}, mergeName;
112   - for (var i = 0, s; s = scriptArray[i++];) {
113   - mergeName = $(s).attr('merge');
114   - if (!jsMap[mergeName])
115   - jsMap[mergeName] = [];
116   - jsMap[mergeName].push(dest + _static + $(s).attr('src'));
117   - //remove
118   - $(s).remove();
119   - }
120   -
121   - //按 merge 合并压缩js
122   - var ks = get_keys(jsMap), index = 0;
123   - (function () {
124   - if (index >= ks.length) {
125   - write(file, $.html());
126   - console.log(file + ' 结束'.green);
127   - cb && cb();
128   - return;
129   - }
130   - var k = ks[index];
131   - index++;
132   - var f = arguments.callee;
133   - //合并压缩js
134   - var result = UglifyJS.minify(jsMap[k]);
135   - var data = result.code;
136   - var fName = (k + '_' + md5(data)) + '.js';
137   - //写入 assets js 目录下
138   - var descFile = dest + _static + '\\real_control_v2\\assets\\js\\' + fName;
139   - fs.open(descFile, 'a', function (err, fd) {
140   -
141   - fs.write(fd, data, function () {
142   - var tag = '<script src="/real_control_v2/assets/js/' + fName + '"></script>';
143   - if ($('body').length > 0)
144   - $('body').append(tag);
145   - else {
146   - //没有body 就写在尾部
147   - $('*').last().after(tag);
148   - }
149   - console.log(k + ' js', '结束,下一个');
150   - f();
151   - });
152   - });
153   - })();
154   -};
155   -
156   -var get_keys = function (json) {
157   - var array = [];
158   - for (var key in json) {
159   - array.push(key);
160   - }
161   - return array;
162   -};
163   -
164   -function md5(text) {
165   - return crypto.createHash("md5").update(text).digest("hex");
166   -}
167   -
168   -function write(file, text) {
169   - fs.writeFile(file, text, function (err) {
170   - if (err) {
171   - console.log(err.toString().red);
172   - process.exit();
173   - }
174   - console.log(file.green);
175   - });
176   -}
177   -
  1 +/**
  2 + * 处理线调文件
  3 + */
  4 +var fs = require('fs')
  5 + , cheerio = require('cheerio')
  6 + , minifier = require('./minifier')
  7 + , crypto = require("crypto")
  8 + , CleanCSS = require('clean-css')
  9 + , UglifyJS = require("uglify-js");
  10 +;
  11 +
  12 +//不参与的目录
  13 +var pName = 'bsth_control'
  14 + , path = process.cwd()
  15 + //根目录
  16 + , root = path.substr(0, path.indexOf('\\src\\main'))
  17 + , workspace = root.substr(0, root.indexOf('\\' + pName))
  18 + //临时目录
  19 + , dest = (workspace + '\\' + pName + '@fatso_copy').replace(/\//g, '\\')
  20 + , _static = '\\src\\main\\resources\\static';
  21 +
  22 +
  23 +var mainFile = dest + _static + '\\real_control_v2\\main.html';
  24 +var mapFile = dest + _static + '\\real_control_v2\\mapmonitor\\real.html';
  25 +var realCtl = {
  26 + /**
  27 + * 处理线调首页
  28 + */
  29 + handleMain: function (cb) {
  30 + //读取文件
  31 + var data = fs.readFileSync(mainFile, 'utf-8')
  32 + , $ = cheerio.load(data);
  33 +
  34 + handleCss($, function () {
  35 + handleJs($, mainFile, cb);
  36 + });
  37 + },
  38 + /**
  39 + * 处理地图模块
  40 + * @param cb
  41 + */
  42 + handleMap: function (cb) {
  43 + //读取文件
  44 + var data = fs.readFileSync(mapFile, 'utf-8')
  45 + , $ = cheerio.load(data);
  46 +
  47 + handleCss($, function () {
  48 + handleJs($, mapFile, cb);
  49 + });
  50 + }
  51 +};
  52 +
  53 +/**
  54 + * 处理css
  55 + * @type {any}
  56 + */
  57 +var handleCss = function ($, cb) {
  58 + var cssArray = $('link[rel=stylesheet][merge]');
  59 + //按 merge 值分组
  60 + var cssMap = {}, mergeName;
  61 + for (var i = 0, c; c = cssArray[i++];) {
  62 + mergeName = $(c).attr('merge');
  63 + if (!cssMap[mergeName])
  64 + cssMap[mergeName] = [];
  65 + cssMap[mergeName].push(dest + _static + $(c).attr('href'));
  66 + //remove
  67 + $(c).remove();
  68 + }
  69 + //按 merge 合并压缩css
  70 + var ks = get_keys(cssMap), index = 0;
  71 + (function () {
  72 + if (index >= ks.length) {
  73 + cb && cb();
  74 + return;
  75 + }
  76 + var k = ks[index];
  77 + index++;
  78 + var f = arguments.callee;
  79 + //合并css
  80 + new CleanCSS().minify(cssMap[k], function (error, out) {
  81 + var data = out.styles;
  82 + var fName = (k + '_' + md5(data)) + '.css';
  83 + //写入 assets css 目录下
  84 + var descFile = dest + _static + '\\real_control_v2\\assets\\css\\' + fName;
  85 + fs.open(descFile, 'a', function (err, fd) {
  86 +
  87 + fs.write(fd, data, function () {
  88 + var tag = '<link rel="stylesheet" href="/real_control_v2/assets/css/' + fName + '"/>';
  89 + if ($('head').length > 0)
  90 + $('head').append(tag);
  91 + else {
  92 + if($('link').length > 0)
  93 + $('link').last().before(tag);
  94 + else
  95 + $('div').first().before(tag);
  96 + }
  97 + console.log(k + ' css', '结束,下一个');
  98 + f();
  99 + });
  100 + });
  101 + });
  102 + })();
  103 +};
  104 +
  105 +/**
  106 + * 处理js
  107 + */
  108 +var handleJs = function ($, file, cb) {
  109 + var scriptArray = $('script[merge]');
  110 + //按 merge 值分组
  111 + var jsMap = {}, mergeName;
  112 + for (var i = 0, s; s = scriptArray[i++];) {
  113 + mergeName = $(s).attr('merge');
  114 + if (!jsMap[mergeName])
  115 + jsMap[mergeName] = [];
  116 + jsMap[mergeName].push(dest + _static + $(s).attr('src'));
  117 + //remove
  118 + $(s).remove();
  119 + }
  120 +
  121 + //按 merge 合并压缩js
  122 + var ks = get_keys(jsMap), index = 0;
  123 + (function () {
  124 + if (index >= ks.length) {
  125 + write(file, $.html());
  126 + console.log(file + ' 结束'.green);
  127 + cb && cb();
  128 + return;
  129 + }
  130 + var k = ks[index];
  131 + index++;
  132 + var f = arguments.callee;
  133 + //合并压缩js
  134 + var result = UglifyJS.minify(jsMap[k]);
  135 + var data = result.code;
  136 + var fName = (k + '_' + md5(data)) + '.js';
  137 + //写入 assets js 目录下
  138 + var descFile = dest + _static + '\\real_control_v2\\assets\\js\\' + fName;
  139 + fs.open(descFile, 'a', function (err, fd) {
  140 +
  141 + fs.write(fd, data, function () {
  142 + var tag = '<script src="/real_control_v2/assets/js/' + fName + '"></script>';
  143 + if ($('body').length > 0)
  144 + $('body').append(tag);
  145 + else {
  146 + //没有body 就写在尾部
  147 + $('*').last().after(tag);
  148 + }
  149 + console.log(k + ' js', '结束,下一个');
  150 + f();
  151 + });
  152 + });
  153 + })();
  154 +};
  155 +
  156 +var get_keys = function (json) {
  157 + var array = [];
  158 + for (var key in json) {
  159 + array.push(key);
  160 + }
  161 + return array;
  162 +};
  163 +
  164 +function md5(text) {
  165 + return crypto.createHash("md5").update(text).digest("hex");
  166 +}
  167 +
  168 +function write(file, text) {
  169 + fs.writeFile(file, text, function (err) {
  170 + if (err) {
  171 + console.log(err.toString().red);
  172 + process.exit();
  173 + }
  174 + console.log(file.green);
  175 + });
  176 +}
  177 +
178 178 module.exports = realCtl;
179 179 \ No newline at end of file
... ...
src/main/resources/static/assets/js/common.js
... ... @@ -204,6 +204,6 @@ function createVehSearch($e){
204 204 return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
205 205 }
206 206 }
207   - })
  207 + });
208 208 return $e;
209 209 }
... ...
src/main/resources/static/pages/forms/mould/inoutstation.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/list.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/operationservice.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/statisticsDaily_.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/vehicleloading.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -92,8 +92,7 @@
92 92  
93 93 <script>
94 94 $(function(){
95   - var reqCodeMap = {"0xA1": '请求恢复运营', "0xA2": '申请调档', "0xA3": '出场请求', "0xA5": '进场请求', "0xA7": '加油请求', "0x50": '车辆故障', "0x70": '路阻报告', "0x60": '事故报告', "0x11": '扣证纠纷', "0x12" : '报警'};
96   - var fage=false;
  95 +
97 96 // 关闭左侧栏
98 97 if (!$('body').hasClass('page-sidebar-closed'))
99 98 $('.menu-toggler.sidebar-toggler').click();
... ... @@ -102,6 +101,7 @@
102 101 format : 'YYYY-MM-DD',
103 102 locale : 'zh-cn'
104 103 });
  104 + var fage=false;
105 105 var xlList;
106 106 var obj = [];
107 107  
... ...
src/main/resources/static/pages/forms/statement/jobSummary.html
... ... @@ -277,6 +277,27 @@
277 277 initPinYinSelect2('#line',data,'');
278 278  
279 279 }) */
  280 +
  281 + jQuery.fn.rowspan = function(colIdx) { //封装的一个JQuery小插件
  282 + return this.each(function(){
  283 + var that;
  284 + $('tr', this).each(function(row) {
  285 + $('td:eq('+colIdx+')', this).filter(':visible').each(function(col) {
  286 + if (that!=null && $(this).html() == $(that).html()) {
  287 + rowspan = $(that).attr("rowSpan");
  288 + if (rowspan == undefined) {
  289 + $(that).attr("rowSpan",1);
  290 + rowspan = $(that).attr("rowSpan"); }
  291 + rowspan = Number(rowspan)+1;
  292 + $(that).attr("rowSpan",rowspan);
  293 + $(this).hide();
  294 + } else {
  295 + that = this;
  296 + }
  297 + });
  298 + });
  299 + });
  300 + }
280 301 $("#query").on("click",function(){
281 302 var line=$("#line").val();;
282 303 var lineName=$(".select2-selection__rendered").html();
... ... @@ -292,6 +313,11 @@
292 313 var list_lbqk = template('list_lbqk',{list:result});
293 314 // 把渲染好的模版html文本追加到表格中
294 315 $('#forms .list_lbqk').html(list_lbqk);
  316 + $('#forms .list_lbqk').rowspan(0);
  317 + $('#forms .list_lbqk').rowspan(1);
  318 + $('#forms .list_lbqk').rowspan(2);
  319 + $('#forms .list_lbqk').rowspan(3);
  320 +
295 321 })
296 322  
297 323 $get('/report/jobLjqk',{line:line,date:date},function(result){
... ... @@ -328,13 +354,19 @@
328 354 <td>{{obj.nr}}</td>
329 355 <td>{{obj.lp}}</td>
330 356 <td>{{obj.nbbm}}</td>
331   - <td>{{obj.jgh}}</td>
  357 + <td {{if obj.lx ==1}} colspan="2" {{/if}}>{{obj.jgh}}</td>
  358 + {{if obj.lx ==0}}
332 359 <td>{{obj.dz}}</td>
333   - <td>{{obj.sj}}</td>
  360 + {{/if}}
  361 + <td {{if obj.lx ==1}} colspan="3" {{/if}}>{{obj.sj}}</td>
  362 + {{if obj.lx ==0}}
334 363 <td>&nbsp;</td>
335 364 <td>{{obj.lbbc}}</td>
336   - <td>{{obj.lblc}}</td>
  365 + {{/if}}
  366 + <td {{if obj.lx ==1}} colspan="2" {{/if}}>{{obj.lblc}}</td>
  367 + {{if obj.lx ==0}}
337 368 <td>{{obj.jyqp}}</td>
  369 + {{/if}}
338 370 </tr>
339 371 {{/each}}
340 372 {{if list.length == 0}}
... ...
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -65,6 +65,7 @@ letter-spacing: 20px;
65 65 <div class="portlet-body">
66 66 <div class="table-container" id="ddrbBody" style="margin-top: 10px;overflow:auto;min-width: 906px">
67 67 <label>日期:<span id="rqxs"></span>&nbsp;&nbsp;&nbsp;&nbsp;早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
  68 + <br/><label>计划+临加-少驶=<span id="jls"></span>&nbsp;&nbsp;计算机实驶:<span id="jsjss"></span></label>
68 69 <table class="table table-bordered table-hover table-checkable" id="forms">
69 70 <thead>
70 71 <tr>
... ... @@ -409,6 +410,8 @@ letter-spacing: 20px;
409 410 $("#export").removeAttr("disabled");
410 411 $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"query"},function(result){
411 412 var scheduleDaily_1 = template('scheduleDaily_1',{list:result});
  413 + $("#jls").html(result[0].jls);
  414 + $("#jsjss").html(result[0].sjgl);
412 415 $('#forms .scheduleDaily_1').html(scheduleDaily_1);
413 416 });
414 417 $.get('/realSchedule/queryUserInfo',{line:line,date:date,state:2,type:"query"},function(result){
... ...
src/main/resources/static/pages/forms/statement/statisticsDaily.html
... ... @@ -14,6 +14,16 @@
14 14  
15 15 .table > tbody + tbody {
16 16 border-top: 1px solid; }
  17 +
  18 + #forms > thead > tr> td >span{
  19 + width: 5px;
  20 + word-wrap: break-word;
  21 + letter-spacing: 20px;
  22 + }
  23 +
  24 + #forms > thead > tr> td >label{
  25 + word-break: keep-all;white-space:nowrap;
  26 + }
17 27 </style>
18 28  
19 29 <div class="page-head">
... ... @@ -55,64 +65,70 @@
55 65 </form>
56 66 </div>
57 67 <div class="portlet-body">
58   - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  68 + <div class="table-container" id="ddrbBody" style="margin-top: 10px;overflow:auto;min-width: 906px">
59 69 <label>早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
60 70 <table class="table table-bordered table-hover table-checkable" id="forms">
61 71 <thead>
62 72 <tr>
63   - <th colspan="36">线路运营情况统计日报</th>
  73 + <th colspan="44">线路调度日报</th>
64 74 </tr>
65 75 <tr>
66   - <td rowspan="3">路线别</td>
67   - <td colspan="15">全日营运里程(公里)</td>
  76 + <td rowspan="3"><span >路线名</span></td>
  77 + <td colspan="20">全日营运里程(公里)</td>
68 78 <td colspan="15">全日营运班次</td>
69   - <td colspan="5">大间隔情况</td>
  79 + <td colspan="9">大间隔情况</td>
70 80 </tr>
71 81 <tr>
72   - <td rowspan="2">计划</td>
73   - <td rowspan="2">实驶</td>
74   - <td rowspan="2">少驶</td>
  82 + <td rowspan="2"><label>计划总</label>
  83 + <label>公里</label></td>
  84 + <td rowspan="2"><label>计划营</label><label>运公里</label></td>
  85 + <td rowspan="2"><label>计划空</label><label>驶公里</label></td>
  86 + <td rowspan="2"><label>实际</label><label>总公里</label></td>
  87 + <td rowspan="2"><label>实际营</label><label>运公里</label></td>
  88 + <td rowspan="2"><label>实际空</label><label>驶公里</label></td>
  89 + <td rowspan="2"><span>少驶公里</span></td>
  90 + <td rowspan="2"><span>少驶班次</span></td>
75 91 <td colspan="11">少驶原因(公里)</td>
76   - <td rowspan="2">临加公里</td>
  92 + <td rowspan="2"><span >临加公里</span></td>
77 93 <td colspan="3">计划班次</td>
78 94 <td colspan="3">实际班次</td>
79 95 <td colspan="3">临加班次</td>
80 96 <td colspan="3">放站班次</td>
81 97 <td colspan="3">调头班次</td>
82 98 <td colspan="3">发生次数</td>
83   - <td rowspan="2">最大间隔时间(秒)</td>
84   - <td rowspan="2">原因</td>
  99 + <td rowspan="2">最大间隔时间(分)</td>
  100 + <td rowspan="2">原因</td>
85 101 </tr>
86 102 <tr>
87   - <td width="31px">路阻</td>
88   - <td>吊慢</td>
89   - <td>故障</td>
90   - <td>纠纷</td>
91   - <td>肇事</td>
92   - <td>缺人</td>
93   - <td>缺车</td>
94   - <td>客稀</td>
95   - <td>气候</td>
96   - <td>援外</td>
97   - <td>其他</td>
98   - <td>全日</td>
99   - <td>早高峰</td>
100   - <td>晚高峰</td>
101   - <td>全日</td>
102   - <td>早高峰</td>
103   - <td>晚高峰</td>
104   - <td>全日</td>
105   - <td>早高峰</td>
106   - <td>晚高峰</td>
107   - <td>全日</td>
108   - <td>早高峰</td>
109   - <td>晚高峰</td>
110   - <td>全日</td>
111   - <td>早高峰</td>
112   - <td>晚高峰</td>
113   - <td>全日</td>
114   - <td>早高峰</td>
115   - <td>晚高峰</td>
  103 + <td><span >路阻</span></td>
  104 + <td><span>吊慢</span></td>
  105 + <td><span >故障</span></td>
  106 + <td><span >纠纷</span></td>
  107 + <td><span >肇事</span></td>
  108 + <td><span>缺人</span></td>
  109 + <td><span>缺车</span></td>
  110 + <td><span >客稀</span></td>
  111 + <td><span>气候</span></td>
  112 + <td><span>援外</span></td>
  113 + <td><span>其他</span></td>
  114 + <td><span>全日</span></td>
  115 + <td><span>早高峰</span></td>
  116 + <td><span>晚高峰</span></td>
  117 + <td><span>全日</span></td>
  118 + <td><span>早高峰</span></td>
  119 + <td><span>晚高峰</span></td>
  120 + <td><span>全日</span></td>
  121 + <td><span>早高峰</span></td>
  122 + <td><span>晚高峰</span></td>
  123 + <td><span>全日</span></td>
  124 + <td><span>早高峰</span></td>
  125 + <td><span>晚高峰</span></td>
  126 + <td><span>全日</span></td>
  127 + <td><span>早高峰</span></td>
  128 + <td><span>晚高峰</span></td>
  129 + <td><span>全日</span></td>
  130 + <td><span>早高峰</span></td>
  131 + <td><span>晚高峰</span></td>
116 132 </tr>
117 133 </thead>
118 134 <tbody class="statisticsDaily">
... ... @@ -269,7 +285,7 @@
269 285 }
270 286  
271 287 });
272   -
  288 + $("#ddrbBody").height($(window).height()-280);
273 289 $("#export").on("click",function(){
274 290 var params = {};
275 291 params['gsdm'] = gsdm;
... ... @@ -290,9 +306,14 @@
290 306 {{each list as obj i}}
291 307 <tr>
292 308 <td>{{obj.xlName}}</td>
  309 + <td>{{obj.jhzlc}}</td>
293 310 <td>{{obj.jhlc}}</td>
  311 + <td>{{obj.jcclc}}</td>
  312 + <td>{{obj.sjzgl}}</td>
294 313 <td>{{obj.sjgl}}</td>
  314 + <td>{{obj.sjksgl}}</td>
295 315 <td>{{obj.ssgl}}</td>
  316 + <td>{{obj.ssbc}}</td>
296 317 <td>{{obj.ssgl_lz}}</td>
297 318 <td>{{obj.ssgl_dm}}</td>
298 319 <td>{{obj.ssgl_gz}}</td>
... ... @@ -329,7 +350,7 @@
329 350 {{/each}}
330 351 {{if list.length == 0}}
331 352 <tr>
332   - <td colspan="36"><h6 class="muted">没有找到相关数据</h6></td>
  353 + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td>
333 354 </tr>
334 355 {{/if}}
335 356 </script>
336 357 \ No newline at end of file
... ...
src/main/resources/static/pages/mforms/operationservices/operationservice.html
... ... @@ -42,19 +42,20 @@
42 42 class="form-control" name="subCompany" id="fgsdmOperat"
43 43 style="width: 140px;"></select>
44 44 </div>
45   - <div style="display: inline-block;">
  45 + <div style="margin-top: 2px"></div>
  46 + <div style="display: inline-block;margin-left: 33px;">
46 47 <span class="item-label" style="width: 80px;">线路: </span> <select
47   - class="form-control" name="line" id="line" style="width: 180px;"></select>
  48 + class="form-control" name="line" id="line" style="width: 140px;"></select>
48 49 </div>
49 50 <div style="display: inline-block; margin-left: 15px;">
50 51 <span class="item-label" style="width: 80px;">开始时间: </span> <input
51 52 class="form-control" type="text" id="startDate"
52   - style="width: 120px;" />
  53 + style="width: 140px;" />
53 54 </div>
54 55 <div style="display: inline-block; margin-left: 15px;">
55 56 <span class="item-label" style="width: 80px;">结束时间: </span> <input
56 57 class="form-control" type="text" id="endDate"
57   - style="width: 120px;" />
  58 + style="width: 140px;" />
58 59 </div>
59 60 <div style="display: inline-block; margin-left: 15px">
60 61 <span class="item-label" style="width: 150px;">统计: </span>
... ... @@ -102,69 +103,95 @@
102 103 format : 'YYYY-MM-DD',
103 104 locale : 'zh-cn'
104 105 });
  106 +
  107 + var d = new Date();
  108 + var year = d.getFullYear();
  109 + var month = d.getMonth() + 1;
  110 + var day = d.getDate();
  111 + if(month < 10)
  112 + month = "0" + month;
  113 + if(day < 10)
  114 + day = "0" + day;
  115 + $("#startDate").val(year + "-" + month + "-" + day);
  116 + $("#endDate").val(year + "-" + month + "-" + day);
105 117  
106   - $.get('/basic/lineCode2Name', function(result) {
107   - var data = [];
108   -
109   - for ( var code in result) {
110   - data.push({
111   - id : code,
112   - text : result[code]
113   - });
114   - }
115   - initPinYinSelect2('#line', data, '');
116   -
117   - })
118   -
  118 + var fage=false;
  119 + var xlList;
119 120 var obj = [];
120   - $.get('/user/companyData', function(result) {
121   - obj = result;
122   - var options = '';
123   - for (var i = 0; i < obj.length; i++) {
124   - options += '<option value="'+obj[i].companyCode+'">'
125   - + obj[i].companyName + '</option>';
126   - }
127   -
128   - if (obj.length == 0) {
129   - $("#gsdmDiv_operat").css('display', 'none');
130   - $('#fgsdmDiv_operat').css('display', 'none');
131   - } else if (obj.length == 1) {
132   - $("#gsdmDiv_operat").css('display', 'none');
133   - if (obj[0].children.length == 1 || obj[0].children.length == 0)
134   - $('#fgsdmDiv_operat').css('display', 'none');
135   - }
136   - $('#gsdmOperat').html(options);
137   - updateCompany();
138   - });
139   -
140   - $("#gsdmOperat").on("change", updateCompany);
141   - function updateCompany() {
  121 +
  122 +
  123 + $.get('/report/lineList',function(result){
  124 + xlList=result;
  125 + $.get('/user/companyData', function(result){
  126 + obj = result;
  127 + var options = '';
  128 + for(var i = 0; i < obj.length; i++){
  129 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  130 + }
  131 +
  132 + if(obj.length ==0){
  133 + $("#gsdmDiv_operat").css('display','none');
  134 + }else if(obj.length ==1){
  135 + $("#gsdmDiv_operat").css('display','none');
  136 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  137 + $('#fgsdmDiv_operat').css('display','none');
  138 + }
  139 + $('#gsdmOperat').html(options);
  140 + updateCompany();
  141 + });
  142 + })
  143 + $("#gsdmOperat").on("change",updateCompany);
  144 + function updateCompany(){
142 145 var company = $('#gsdmOperat').val();
143 146 var options = '';
144   - for (var i = 0; i < obj.length; i++) {
145   - if (obj[i].companyCode == company) {
  147 + for(var i = 0; i < obj.length; i++){
  148 + if(obj[i].companyCode == company){
146 149 var children = obj[i].children;
147   - for (var j = 0; j < children.length; j++) {
148   - options += '<option value="'+children[j].code+'">'
149   - + children[j].name + '</option>';
  150 + for(var j = 0; j < children.length; j++){
  151 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
150 152 }
151 153 }
152 154 }
153 155 $('#fgsdmOperat').html(options);
  156 + initXl();
154 157 }
155 158  
156   - $.get('/basic/lineCode2Name', function(result) {
157   - var data = [];
158   -
159   - for ( var code in result) {
160   - data.push({
161   - id : code,
162   - text : result[code]
163   - });
  159 + /* $.get('/basic/lineCode2Name',function(result){
  160 + var data=[];
  161 +
  162 + for(var code in result){
  163 + data.push({id: code, text: result[code]});
164 164 }
165   - initPinYinSelect2('#line', data, '');
166   -
167   - })
  165 + initPinYinSelect2('#line',data,'');
  166 +
  167 + }) */
  168 +
  169 + $("#fgsdmOperat").on("change",initXl);
  170 + function initXl(){
  171 + var data=[];
  172 + data.push({id: " ", text: "请选择"});
  173 + if(fage){
  174 + $("#line").select2("destroy").html('');
  175 + }
  176 + var fgs=$('#fgsdmOperat').val();
  177 + var gs=$('#gsdmOperat').val();
  178 + for(var i=0;i<xlList.length;i++){
  179 + if(gs!=""){
  180 + if(fgs!=""){
  181 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  182 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  183 + }
  184 + }else{
  185 + if(xlList[i]["gsbm"]==gs){
  186 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  187 + }
  188 + }
  189 + }
  190 + }
  191 + initPinYinSelect2('#line',data,'');
  192 + fage=true;
  193 + }
  194 +
168 195  
169 196 $("#query").on(
170 197 "click",
... ... @@ -175,7 +202,7 @@
175 202 var lpName = $("#lpName").val();
176 203 var gsdmOperat = $("#gsdmOperat").val();
177 204 var fgsdmOperat = $("#fgsdmOperat").val();
178   - $post("/mcy_forms/operationservice", {
  205 + $get("/mcy_forms/operationservice", {
179 206 gsdmOperat : gsdmOperat,
180 207 fgsdmOperat : fgsdmOperat,
181 208 line : line,
... ... @@ -212,7 +239,7 @@
212 239 endDate=$("#endDate").val();
213 240 gsdmOperat=$("#gsdmOperat").val();
214 241 fgsdmOperat=$("#fgsdmOperat").val();
215   - $post('/mcy_export/operationserviceExport',{gsdmOperat:gsdmOperat,fgsdmOperat:fgsdmOperat,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
  242 + $get('/mcy_export/operationserviceExport',{gsdmOperat:gsdmOperat,fgsdmOperat:fgsdmOperat,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
216 243 window.open("/downloadFile/download?fileName=运营服务阶段报表"+moment(startDate).format("YYYYMMDD"));
217 244 });
218 245 });
... ...
src/main/resources/static/pages/mforms/shifdays/shifday.html
... ... @@ -71,7 +71,7 @@
71 71 <th>车辆</th>
72 72 <th>计划里程</th>
73 73 <th>实际计划里程</th>
74   - <th>运营</th>
  74 + <th>运营里程</th>
75 75 <th>空驶里程</th>
76 76 <th>抽减里程</th>
77 77 <th>增加里程</th>
... ...
src/main/resources/static/pages/mforms/singledatas/singledata.html
... ... @@ -37,18 +37,14 @@
37 37 <select class="form-control" name="subCompany" id="fgsdmSing" style="width: 140px;"></select>
38 38 </div>
39 39 <div style="display: inline-block;">
40   - <span class="item-label" style="width: 80px;">线路: </span>
41   - <select class="form-control" name="line" id="line" style="width: 136px;"></select>
  40 + <span class="item-label" style="width: 80px;">&nbsp;线路: </span>
  41 + <select class="form-control" name="line" id="line" style="width: 140px;"></select>
42 42 </div>
43   - <div style="margin-top: 10px"></div>
44 43 <div style="display: inline-block;margin-left: 15px;">
45   - <span class="item-label" style="width: 80px;">开始时间: </span>
46   - <input class="form-control" type="text" id="startDate" style="width: 120px;"/>
47   - </div>
48   - <div style="display: inline-block;margin-left: 15px;">
49   - <span class="item-label" style="width: 80px;">结束时间: </span>
50   - <input class="form-control" type="text" id="endDate" style="width: 120px;"/>
  44 + <span class="item-label" style="width: 140px;">时间: </span>
  45 + <input class="form-control" type="text" id="startDate" style="width: 140px;"/>
51 46 </div>
  47 +
52 48 <div style="display: inline-block;margin-left: 15px">
53 49 <span class="item-label" style="width: 150px;">统计: </span>
54 50 </div>
... ... @@ -101,26 +97,31 @@
101 97 locale : 'zh-cn'
102 98 });
103 99  
  100 + var fage=false;
  101 + var xlList;
104 102 var obj = [];
105   - $.get('/user/companyData', function(result){
106   - obj = result;
107   - var options = '';
108   - for(var i = 0; i < obj.length; i++){
109   - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
110   - }
111   -
112   - if(obj.length ==0){
113   - $("#gsdmDiv_sing").css('display','none');
114   - $('#fgsdmDiv_sing').css('display','none');
115   - }else if(obj.length ==1){
116   - $("#gsdmDiv_sing").css('display','none');
117   - if(obj[0].children.length == 1 || obj[0].children.length ==0)
118   - $('#fgsdmDiv_sing').css('display','none');
119   - }
120   - $('#gsdmSing').html(options);
121   - updateCompany();
122   - });
123   -
  103 +
  104 +
  105 + $.get('/report/lineList',function(result){
  106 + xlList=result;
  107 + $.get('/user/companyData', function(result){
  108 + obj = result;
  109 + var options = '';
  110 + for(var i = 0; i < obj.length; i++){
  111 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  112 + }
  113 +
  114 + if(obj.length ==0){
  115 + $("#gsdmDiv_sing").css('display','none');
  116 + }else if(obj.length ==1){
  117 + $("#gsdmDiv_sing").css('display','none');
  118 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  119 + $('#fgsdmDiv_sing').css('display','none');
  120 + }
  121 + $('#gsdmSing').html(options);
  122 + updateCompany();
  123 + });
  124 + })
124 125 $("#gsdmSing").on("change",updateCompany);
125 126 function updateCompany(){
126 127 var company = $('#gsdmSing').val();
... ... @@ -134,10 +135,10 @@
134 135 }
135 136 }
136 137 $('#fgsdmSing').html(options);
  138 + initXl();
137 139 }
138 140  
139   -
140   - $.get('/basic/lineCode2Name',function(result){
  141 + /* $.get('/basic/lineCode2Name',function(result){
141 142 var data=[];
142 143  
143 144 for(var code in result){
... ... @@ -145,19 +146,41 @@
145 146 }
146 147 initPinYinSelect2('#line',data,'');
147 148  
148   - })
  149 + }) */
  150 +
  151 + $("#fgsdmSing").on("change",initXl);
  152 + function initXl(){
  153 + var data=[];
  154 + if(fage){
  155 + $("#line").select2("destroy").html('');
  156 + }
  157 + var fgs=$('#fgsdmSing').val();
  158 + var gs=$('#gsdmSing').val();
  159 + for(var i=0;i<xlList.length;i++){
  160 + if(gs!=""){
  161 + if(fgs!=""){
  162 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  163 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  164 + }
  165 + }else{
  166 + if(xlList[i]["gsbm"]==gs){
  167 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  168 + }
  169 + }
  170 + }
  171 + }
  172 + initPinYinSelect2('#line',data,'');
  173 + fage=true;
  174 + }
149 175  
150 176  
151 177 $("#query").on("click",function(){
152 178 var line = $("#line").val();
153 179 var startDate = $("#startDate").val();
154   - var endDate = $("#endDate").val();
155 180 var lpName = $("#lpName").val();
156 181 var gsdmSing = $("#gsdmSing").val();
157   - var fgsdmSing = $("#fgsdmSing").val();
158   - $post("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,endDate:endDate ,lpName:lpName},function(result){
159   - $("#sDate").text(startDate);
160   - $("#eDate").text(endDate);
  182 + var fgsdmSing = $("#fgsdmSing").val(); var params = {};
  183 + $get("/mcy_forms/singledata",{ gsdmSing:gsdmSing,fgsdmSing:fgsdmSing, line:line,startDate:startDate,lpName:lpName},function(result){
161 184 var temp = {};
162 185 var today_account = 0;
163 186 temp["line"] = $("#line").text();
... ... @@ -181,7 +204,7 @@
181 204 var lpName = $("#lpName").val();
182 205 var gsdmSing = $("#gsdmSing").val();
183 206 var fgsdmSing = $("#fgsdmSing").val();
184   - $post('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
  207 + $get('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
185 208 window.open("/downloadFile/download?fileName=路单数据"+moment(startDate).format("YYYYMMDD"));
186 209 });
187 210 });
... ... @@ -203,7 +226,7 @@
203 226 <td>{{obj.emptMileage}}</td>
204 227 <td>{{obj.hyl}}</td>
205 228 <td>{{obj.jzl}}</td>
206   - <td> </td>
  229 + <td>{{obj.unyyyl}}</td>
207 230 <td>{{obj.jhjl}}</td>
208 231 </tr>
209 232 {{/each}}
... ...
src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
... ... @@ -64,7 +64,7 @@
64 64 <th>耗油量(不含非营业性用油)</th>
65 65 <th>尿素</th>
66 66 <th>实际公里(含空放公里)</th>
67   - <th>非业性用油</th>
  67 + <th>非业性用油</th>
68 68 <th>计划班次</th>
69 69 <th>实际班次</th>
70 70 </tr>
... ... @@ -89,26 +89,31 @@
89 89 format : 'YYYY-MM-DD',
90 90 locale : 'zh-cn'
91 91 });
  92 + var fage=false;
  93 + var xlList;
  94 + var obj = [];
92 95  
93   - $.get('/user/companyData', function(result){
94   - obj = result;
95   - var options = '';
96   - for(var i = 0; i < obj.length; i++){
97   - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
98   - }
99   -
100   - if(obj.length ==0){
101   - $("#gsdmDiv_vehic").css('display','none');
102   - $('#fgsdmDiv_vehic').css('display','none');
103   - }else if(obj.length ==1){
104   - $("#gsdmDiv_vehic").css('display','none');
105   - if(obj[0].children.length == 1 || obj[0].children.length ==0)
106   - $('#fgsdmDiv_vehic').css('display','none');
107   - }
108   - $('#gsdmVehic').html(options);
109   - updateCompany();
110   - });
111   -
  96 +
  97 + $.get('/report/lineList',function(result){
  98 + xlList=result;
  99 + $.get('/user/companyData', function(result){
  100 + obj = result;
  101 + var options = '';
  102 + for(var i = 0; i < obj.length; i++){
  103 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  104 + }
  105 +
  106 + if(obj.length ==0){
  107 + $("#gsdmDiv_vehic").css('display','none');
  108 + }else if(obj.length ==1){
  109 + $("#gsdmDiv_vehic").css('display','none');
  110 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  111 + $('#fgsdmDiv_vehic').css('display','none');
  112 + }
  113 + $('#gsdmVehic').html(options);
  114 + updateCompany();
  115 + });
  116 + })
112 117 $("#gsdmVehic").on("change",updateCompany);
113 118 function updateCompany(){
114 119 var company = $('#gsdmVehic').val();
... ... @@ -122,9 +127,10 @@
122 127 }
123 128 }
124 129 $('#fgsdmVehic').html(options);
  130 + initXl();
125 131 }
126   -
127   - $.get('/basic/lineCode2Name',function(result){
  132 +
  133 + /* $.get('/basic/lineCode2Name',function(result){
128 134 var data=[];
129 135  
130 136 for(var code in result){
... ... @@ -132,9 +138,33 @@
132 138 }
133 139 initPinYinSelect2('#line',data,'');
134 140  
135   - })
  141 + }) */
  142 +
  143 + $("#fgsdmVehic").on("change",initXl);
  144 + function initXl(){
  145 + var data=[];
  146 + if(fage){
  147 + $("#line").select2("destroy").html('');
  148 + }
  149 + var fgs=$('#fgsdmVehic').val();
  150 + var gs=$('#gsdmVehic').val();
  151 + for(var i=0;i<xlList.length;i++){
  152 + if(gs!=""){
  153 + if(fgs!=""){
  154 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  155 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  156 + }
  157 + }else{
  158 + if(xlList[i]["gsbm"]==gs){
  159 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  160 + }
  161 + }
  162 + }
  163 + }
  164 + initPinYinSelect2('#line',data,'');
  165 + fage=true;
  166 + }
136 167  
137   -
138 168 var line ;
139 169 var date ;
140 170 var gsdmVehic ;
... ... @@ -142,9 +172,9 @@
142 172 $("#query").on("click",function(){
143 173 line = $("#line").val();
144 174 date = $("#date").val();
145   - gsdmVehic = $("#gsdmVehic").val();
146   - fgsdmVehic = $("#fgsdmVehic").val();
147   - $post('/mcy_forms/vehicleloading',{line:line,data:date, gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic},function(result){
  175 +// gsdmVehic = $("#gsdmVehic").val();
  176 +// fgsdmVehic = $("#fgsdmVehic").val();
  177 + $get('/mcy_forms/vehicleloading',{line:line,data:date},function(result){
148 178 // 把数据填充到模版中
149 179 var tbodyHtml = template('vehicleloading',{list:result});
150 180 // 把渲染好的模版html文本追加到表格中
... ... @@ -157,7 +187,7 @@
157 187 date = $("#date").val();
158 188 gsdmVehic = $("#gsdmVehic").val();
159 189 fgsdmVehic = $("#fgsdmVehic").val();
160   - $post('/mcy_export/vehicleloadingExport',{line:line,data:date,gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic,type:'export'},function(result){
  190 + $get('/mcy_export/vehicleloadingExport',{line:line,data:date,gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic,type:'export'},function(result){
161 191 window.open("/downloadFile/download?fileName=车辆加注"+moment(date).format("YYYYMMDD"));
162 192 });
163 193 });
... ... @@ -173,9 +203,9 @@
173 203 <td>{{obj.clzbh}}</td>
174 204 <td>{{obj.jzl}}</td>
175 205 <td>{{obj.hyl}}</td>
176   - <td> </td>
  206 + <td>{{obj.ls}}</td>
177 207 <td>{{obj.jhlc}}</td>
178   - <td> </td>
  208 + <td>{{obj.unyyyl}}</td>
179 209 <td>{{obj.jhbc}}</td>
180 210 <td>{{obj.sjbc}}</td>
181 211 </tr>
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -199,7 +199,7 @@
199 199 {{obj.rq}}
200 200 </td>
201 201 <td>
202   - {{obj.gsname}}
  202 + {{obj.fgsname}}
203 203 </td>
204 204 <td>
205 205 {{obj.xlname}}
... ...
src/main/resources/static/pages/report/inoutstation.html
... ... @@ -76,8 +76,9 @@
76 76 </div>
77 77 <div class="form-group" style="display: inline-block;margin-left: 15px;">
78 78 <input class="btn btn-default" type="button" id="query" value="查询"/>
  79 + <input class="btn btn-default" type="button" id="export" value="导出"/>
79 80 <input class="btn btn-default" type="button" style="display: none;" id="query2" value="查询"/>
80   -<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
  81 + <input class="btn btn-default" type="button" id="export2" style="display: none;" value="导出"/>
81 82 <!-- <input class="btn btn-default" type="button" id="print" value="打印"/> -->
82 83 <!-- <input class="btn btn-default" type="button" id="exportMore" value="批量导出"/> -->
83 84 </div>
... ... @@ -103,9 +104,12 @@
103 104 </tbody>
104 105 </table>
105 106 </div>
106   - <div>
107   - <span style="font-size: 20px" class="item-label" id="dlzmx"> </span>
108   -
  107 + <div >
  108 + <span style="font-size: 20px" class="item-label" id="dlzmx">
  109 + 到离站详细 &nbsp;待查询
  110 + </span>
  111 + <input id="fcsj_xx" type="hidden" value="">
  112 + <input id="ddsj_xx" type="hidden" value="">
109 113 </div>
110 114 <div style="margin-top: 20px; " id="forms1Div">
111 115 <table class="table table-bordered table-checkable" id="forms1">
... ... @@ -148,13 +152,19 @@
148 152 $("#formsDiv").css('display','inline-block');
149 153 $("#query2").css('display','none');
150 154 $("#query").css('display','inline-block');
  155 + $("#export2").css('display','none');
  156 + $("#export").css('display','inline-block');
151 157  
152 158 }else{
  159 + $("#fcsj_xx").val("");
  160 + $("#ddsj_xx").val("");
153 161 $("#clzdDiv").css('display','inline-block');
154 162 $("#bczxDiv").css('display','none');
155 163 $("#formsDiv").css('display','none');
156 164 $("#query").css('display','none');
157 165 $("#query2").css('display','inline-block');
  166 + $("#export").css('display','none');
  167 + $("#export2").css('display','inline-block');
158 168 }
159 169 });
160 170  
... ... @@ -168,12 +178,12 @@
168 178 });
169 179  
170 180 $("#date1").datetimepicker({
171   - format : 'YYYY-MM-DD',
  181 + format : 'YYYY-MM-DD HH:mm',
172 182 locale : 'zh-cn'
173 183 });
174 184  
175 185 $("#date2").datetimepicker({
176   - format : 'YYYY-MM-DD',
  186 + format : 'YYYY-MM-DD HH:mm',
177 187 locale : 'zh-cn'
178 188 });
179 189  
... ... @@ -282,16 +292,6 @@
282 292  
283 293 var params = new Array();
284 294 var jName = '';
285   -
286   -// $("#export").on("click",function(){
287   -// if(params.length < 1){
288   -// return;
289   -// }
290   -// $post('/realSchedule/exportWaybill',{jName:jName,clZbh:params[1],lpName:params[2],date:date},function(result){
291   -// window.open("/downloadFile/download?fileName="+jName);
292   -// });
293   -// });
294   -
295 295 // $("#print").click(function(){
296 296 // $("#printArea").printArea();
297 297 // });
... ... @@ -385,6 +385,8 @@
385 385 var rqmc="日期: "+rq;
386 386 var bcmc="班次: "+fcsj+"-"+ddsj;
387 387 $("#dlzmx").html("到离站详细 "+xlmc+" "+clmc+" "+rqmc+" "+bcmc);
  388 + $("#fcsj_xx").val(fcsj);
  389 + $("#ddsj_xx").val(ddsj);
388 390 var ludan_ll_1 = template('ludan_ll_1',{list:result});
389 391 // 把渲染好的模版html文本追加到表格中
390 392 $('#forms1 .ludan_ll_1').html(ludan_ll_1);
... ... @@ -472,6 +474,44 @@
472 474 }
473 475 })
474 476  
  477 +
  478 +
  479 + $("#export").on("click",function(){
  480 + var rq=$("#date").val();
  481 + var line=$("#line").val();
  482 + var nbbm=$("#nbbm").val();
  483 + var fcsj=$("#fcsj_xx").val();
  484 + var ddsj=$("#ddsj_xx").val();
  485 + if(fcsj==""){
  486 + layer.msg("没数据");
  487 + }else{
  488 + $get('/report/exportQueryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){
  489 + window.open("/downloadFile/download?fileName=班次到离站");
  490 + });
  491 + }
  492 +
  493 + });
  494 +
  495 + $("#export2").on("click",function(){
  496 + var date1=$("#date1").val();
  497 + var date2=$("#date2").val();
  498 + var line=$("#line").val();
  499 + var zdlx=$("#zdlx").val();
  500 + var zd=$("#zd").val();
  501 + if(date1=="" || date1==null){
  502 + layer.msg("请选择时间");
  503 + }else if( line=="" || line==null){
  504 + layer.msg("请选择线路");
  505 + }else if(date2 ==null || date2==""){
  506 + layer.msg("请选择时间");
  507 + }else if(zdlx=="" || zdlx==null){
  508 + layer.msg("请选择方向");
  509 + }else{
  510 + $get('/report/exportQueryListClzd',{zd:zd,zdlx:zdlx,line:line,fcsj:date1,ddsj:date2},function(result){
  511 + window.open("/downloadFile/download?fileName=班次到离站");
  512 + });
  513 + }
  514 + });
475 515  
476 516 });
477 517  
... ...
src/main/resources/static/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css 0 → 100644
  1 +/* perfect-scrollbar v0.6.16 */
  2 +.ps-container {
  3 + -ms-touch-action: auto;
  4 + touch-action: auto;
  5 + overflow: hidden !important;
  6 + -ms-overflow-style: none; }
  7 + @supports (-ms-overflow-style: none) {
  8 + .ps-container {
  9 + overflow: auto !important; } }
  10 + @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  11 + .ps-container {
  12 + overflow: auto !important; } }
  13 + .ps-container.ps-active-x > .ps-scrollbar-x-rail,
  14 + .ps-container.ps-active-y > .ps-scrollbar-y-rail {
  15 + display: block;
  16 + background-color: transparent; }
  17 + .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
  18 + background-color: #eee;
  19 + opacity: 0.9; }
  20 + .ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
  21 + background-color: #999;
  22 + height: 11px; }
  23 + .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
  24 + background-color: #eee;
  25 + opacity: 0.9; }
  26 + .ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
  27 + background-color: #999;
  28 + width: 11px; }
  29 + .ps-container > .ps-scrollbar-x-rail {
  30 + display: none;
  31 + position: absolute;
  32 + /* please don't change 'position' */
  33 + opacity: 0;
  34 + -webkit-transition: background-color .2s linear, opacity .2s linear;
  35 + -o-transition: background-color .2s linear, opacity .2s linear;
  36 + -moz-transition: background-color .2s linear, opacity .2s linear;
  37 + transition: background-color .2s linear, opacity .2s linear;
  38 + bottom: 0px;
  39 + /* there must be 'bottom' for ps-scrollbar-x-rail */
  40 + height: 15px; }
  41 + .ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x {
  42 + position: absolute;
  43 + /* please don't change 'position' */
  44 + background-color: #aaa;
  45 + -webkit-border-radius: 6px;
  46 + -moz-border-radius: 6px;
  47 + border-radius: 6px;
  48 + -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
  49 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
  50 + -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
  51 + -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
  52 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
  53 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
  54 + bottom: 2px;
  55 + /* there must be 'bottom' for ps-scrollbar-x */
  56 + height: 6px; }
  57 + .ps-container > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x, .ps-container > .ps-scrollbar-x-rail:active > .ps-scrollbar-x {
  58 + height: 11px; }
  59 + .ps-container > .ps-scrollbar-y-rail {
  60 + display: none;
  61 + position: absolute;
  62 + /* please don't change 'position' */
  63 + opacity: 0;
  64 + -webkit-transition: background-color .2s linear, opacity .2s linear;
  65 + -o-transition: background-color .2s linear, opacity .2s linear;
  66 + -moz-transition: background-color .2s linear, opacity .2s linear;
  67 + transition: background-color .2s linear, opacity .2s linear;
  68 + right: 0;
  69 + /* there must be 'right' for ps-scrollbar-y-rail */
  70 + width: 15px; }
  71 + .ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y {
  72 + position: absolute;
  73 + /* please don't change 'position' */
  74 + background-color: #aaa;
  75 + -webkit-border-radius: 6px;
  76 + -moz-border-radius: 6px;
  77 + border-radius: 6px;
  78 + -webkit-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
  79 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, -webkit-border-radius .2s ease-in-out;
  80 + -o-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
  81 + -moz-transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
  82 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out;
  83 + transition: background-color .2s linear, height .2s linear, width .2s ease-in-out, border-radius .2s ease-in-out, -webkit-border-radius .2s ease-in-out, -moz-border-radius .2s ease-in-out;
  84 + right: 2px;
  85 + /* there must be 'right' for ps-scrollbar-y */
  86 + width: 6px; }
  87 + .ps-container > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y, .ps-container > .ps-scrollbar-y-rail:active > .ps-scrollbar-y {
  88 + width: 11px; }
  89 + .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
  90 + background-color: #eee;
  91 + opacity: 0.9; }
  92 + .ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
  93 + background-color: #999;
  94 + height: 11px; }
  95 + .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
  96 + background-color: #eee;
  97 + opacity: 0.9; }
  98 + .ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
  99 + background-color: #999;
  100 + width: 11px; }
  101 + .ps-container:hover > .ps-scrollbar-x-rail,
  102 + .ps-container:hover > .ps-scrollbar-y-rail {
  103 + opacity: 0.6; }
  104 + .ps-container:hover > .ps-scrollbar-x-rail:hover {
  105 + background-color: #eee;
  106 + opacity: 0.9; }
  107 + .ps-container:hover > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x {
  108 + background-color: #999; }
  109 + .ps-container:hover > .ps-scrollbar-y-rail:hover {
  110 + background-color: #eee;
  111 + opacity: 0.9; }
  112 + .ps-container:hover > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y {
  113 + background-color: #999; }
... ...
src/main/resources/static/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js 0 → 100644
  1 +/* perfect-scrollbar v0.6.16 */
  2 +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  3 +'use strict';
  4 +
  5 +var ps = require('../main');
  6 +var psInstances = require('../plugin/instances');
  7 +
  8 +function mountJQuery(jQuery) {
  9 + jQuery.fn.perfectScrollbar = function (settingOrCommand) {
  10 + return this.each(function () {
  11 + if (typeof settingOrCommand === 'object' ||
  12 + typeof settingOrCommand === 'undefined') {
  13 + // If it's an object or none, initialize.
  14 + var settings = settingOrCommand;
  15 +
  16 + if (!psInstances.get(this)) {
  17 + ps.initialize(this, settings);
  18 + }
  19 + } else {
  20 + // Unless, it may be a command.
  21 + var command = settingOrCommand;
  22 +
  23 + if (command === 'update') {
  24 + ps.update(this);
  25 + } else if (command === 'destroy') {
  26 + ps.destroy(this);
  27 + }
  28 + }
  29 + });
  30 + };
  31 +}
  32 +
  33 +if (typeof define === 'function' && define.amd) {
  34 + // AMD. Register as an anonymous module.
  35 + define(['jquery'], mountJQuery);
  36 +} else {
  37 + var jq = window.jQuery ? window.jQuery : window.$;
  38 + if (typeof jq !== 'undefined') {
  39 + mountJQuery(jq);
  40 + }
  41 +}
  42 +
  43 +module.exports = mountJQuery;
  44 +
  45 +},{"../main":7,"../plugin/instances":18}],2:[function(require,module,exports){
  46 +'use strict';
  47 +
  48 +function oldAdd(element, className) {
  49 + var classes = element.className.split(' ');
  50 + if (classes.indexOf(className) < 0) {
  51 + classes.push(className);
  52 + }
  53 + element.className = classes.join(' ');
  54 +}
  55 +
  56 +function oldRemove(element, className) {
  57 + var classes = element.className.split(' ');
  58 + var idx = classes.indexOf(className);
  59 + if (idx >= 0) {
  60 + classes.splice(idx, 1);
  61 + }
  62 + element.className = classes.join(' ');
  63 +}
  64 +
  65 +exports.add = function (element, className) {
  66 + if (element.classList) {
  67 + element.classList.add(className);
  68 + } else {
  69 + oldAdd(element, className);
  70 + }
  71 +};
  72 +
  73 +exports.remove = function (element, className) {
  74 + if (element.classList) {
  75 + element.classList.remove(className);
  76 + } else {
  77 + oldRemove(element, className);
  78 + }
  79 +};
  80 +
  81 +exports.list = function (element) {
  82 + if (element.classList) {
  83 + return Array.prototype.slice.apply(element.classList);
  84 + } else {
  85 + return element.className.split(' ');
  86 + }
  87 +};
  88 +
  89 +},{}],3:[function(require,module,exports){
  90 +'use strict';
  91 +
  92 +var DOM = {};
  93 +
  94 +DOM.e = function (tagName, className) {
  95 + var element = document.createElement(tagName);
  96 + element.className = className;
  97 + return element;
  98 +};
  99 +
  100 +DOM.appendTo = function (child, parent) {
  101 + parent.appendChild(child);
  102 + return child;
  103 +};
  104 +
  105 +function cssGet(element, styleName) {
  106 + return window.getComputedStyle(element)[styleName];
  107 +}
  108 +
  109 +function cssSet(element, styleName, styleValue) {
  110 + if (typeof styleValue === 'number') {
  111 + styleValue = styleValue.toString() + 'px';
  112 + }
  113 + element.style[styleName] = styleValue;
  114 + return element;
  115 +}
  116 +
  117 +function cssMultiSet(element, obj) {
  118 + for (var key in obj) {
  119 + var val = obj[key];
  120 + if (typeof val === 'number') {
  121 + val = val.toString() + 'px';
  122 + }
  123 + element.style[key] = val;
  124 + }
  125 + return element;
  126 +}
  127 +
  128 +DOM.css = function (element, styleNameOrObject, styleValue) {
  129 + if (typeof styleNameOrObject === 'object') {
  130 + // multiple set with object
  131 + return cssMultiSet(element, styleNameOrObject);
  132 + } else {
  133 + if (typeof styleValue === 'undefined') {
  134 + return cssGet(element, styleNameOrObject);
  135 + } else {
  136 + return cssSet(element, styleNameOrObject, styleValue);
  137 + }
  138 + }
  139 +};
  140 +
  141 +DOM.matches = function (element, query) {
  142 + if (typeof element.matches !== 'undefined') {
  143 + return element.matches(query);
  144 + } else {
  145 + if (typeof element.matchesSelector !== 'undefined') {
  146 + return element.matchesSelector(query);
  147 + } else if (typeof element.webkitMatchesSelector !== 'undefined') {
  148 + return element.webkitMatchesSelector(query);
  149 + } else if (typeof element.mozMatchesSelector !== 'undefined') {
  150 + return element.mozMatchesSelector(query);
  151 + } else if (typeof element.msMatchesSelector !== 'undefined') {
  152 + return element.msMatchesSelector(query);
  153 + }
  154 + }
  155 +};
  156 +
  157 +DOM.remove = function (element) {
  158 + if (typeof element.remove !== 'undefined') {
  159 + element.remove();
  160 + } else {
  161 + if (element.parentNode) {
  162 + element.parentNode.removeChild(element);
  163 + }
  164 + }
  165 +};
  166 +
  167 +DOM.queryChildren = function (element, selector) {
  168 + return Array.prototype.filter.call(element.childNodes, function (child) {
  169 + return DOM.matches(child, selector);
  170 + });
  171 +};
  172 +
  173 +module.exports = DOM;
  174 +
  175 +},{}],4:[function(require,module,exports){
  176 +'use strict';
  177 +
  178 +var EventElement = function (element) {
  179 + this.element = element;
  180 + this.events = {};
  181 +};
  182 +
  183 +EventElement.prototype.bind = function (eventName, handler) {
  184 + if (typeof this.events[eventName] === 'undefined') {
  185 + this.events[eventName] = [];
  186 + }
  187 + this.events[eventName].push(handler);
  188 + this.element.addEventListener(eventName, handler, false);
  189 +};
  190 +
  191 +EventElement.prototype.unbind = function (eventName, handler) {
  192 + var isHandlerProvided = (typeof handler !== 'undefined');
  193 + this.events[eventName] = this.events[eventName].filter(function (hdlr) {
  194 + if (isHandlerProvided && hdlr !== handler) {
  195 + return true;
  196 + }
  197 + this.element.removeEventListener(eventName, hdlr, false);
  198 + return false;
  199 + }, this);
  200 +};
  201 +
  202 +EventElement.prototype.unbindAll = function () {
  203 + for (var name in this.events) {
  204 + this.unbind(name);
  205 + }
  206 +};
  207 +
  208 +var EventManager = function () {
  209 + this.eventElements = [];
  210 +};
  211 +
  212 +EventManager.prototype.eventElement = function (element) {
  213 + var ee = this.eventElements.filter(function (eventElement) {
  214 + return eventElement.element === element;
  215 + })[0];
  216 + if (typeof ee === 'undefined') {
  217 + ee = new EventElement(element);
  218 + this.eventElements.push(ee);
  219 + }
  220 + return ee;
  221 +};
  222 +
  223 +EventManager.prototype.bind = function (element, eventName, handler) {
  224 + this.eventElement(element).bind(eventName, handler);
  225 +};
  226 +
  227 +EventManager.prototype.unbind = function (element, eventName, handler) {
  228 + this.eventElement(element).unbind(eventName, handler);
  229 +};
  230 +
  231 +EventManager.prototype.unbindAll = function () {
  232 + for (var i = 0; i < this.eventElements.length; i++) {
  233 + this.eventElements[i].unbindAll();
  234 + }
  235 +};
  236 +
  237 +EventManager.prototype.once = function (element, eventName, handler) {
  238 + var ee = this.eventElement(element);
  239 + var onceHandler = function (e) {
  240 + ee.unbind(eventName, onceHandler);
  241 + handler(e);
  242 + };
  243 + ee.bind(eventName, onceHandler);
  244 +};
  245 +
  246 +module.exports = EventManager;
  247 +
  248 +},{}],5:[function(require,module,exports){
  249 +'use strict';
  250 +
  251 +module.exports = (function () {
  252 + function s4() {
  253 + return Math.floor((1 + Math.random()) * 0x10000)
  254 + .toString(16)
  255 + .substring(1);
  256 + }
  257 + return function () {
  258 + return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
  259 + s4() + '-' + s4() + s4() + s4();
  260 + };
  261 +})();
  262 +
  263 +},{}],6:[function(require,module,exports){
  264 +'use strict';
  265 +
  266 +var cls = require('./class');
  267 +var dom = require('./dom');
  268 +
  269 +var toInt = exports.toInt = function (x) {
  270 + return parseInt(x, 10) || 0;
  271 +};
  272 +
  273 +var clone = exports.clone = function (obj) {
  274 + if (!obj) {
  275 + return null;
  276 + } else if (obj.constructor === Array) {
  277 + return obj.map(clone);
  278 + } else if (typeof obj === 'object') {
  279 + var result = {};
  280 + for (var key in obj) {
  281 + result[key] = clone(obj[key]);
  282 + }
  283 + return result;
  284 + } else {
  285 + return obj;
  286 + }
  287 +};
  288 +
  289 +exports.extend = function (original, source) {
  290 + var result = clone(original);
  291 + for (var key in source) {
  292 + result[key] = clone(source[key]);
  293 + }
  294 + return result;
  295 +};
  296 +
  297 +exports.isEditable = function (el) {
  298 + return dom.matches(el, "input,[contenteditable]") ||
  299 + dom.matches(el, "select,[contenteditable]") ||
  300 + dom.matches(el, "textarea,[contenteditable]") ||
  301 + dom.matches(el, "button,[contenteditable]");
  302 +};
  303 +
  304 +exports.removePsClasses = function (element) {
  305 + var clsList = cls.list(element);
  306 + for (var i = 0; i < clsList.length; i++) {
  307 + var className = clsList[i];
  308 + if (className.indexOf('ps-') === 0) {
  309 + cls.remove(element, className);
  310 + }
  311 + }
  312 +};
  313 +
  314 +exports.outerWidth = function (element) {
  315 + return toInt(dom.css(element, 'width')) +
  316 + toInt(dom.css(element, 'paddingLeft')) +
  317 + toInt(dom.css(element, 'paddingRight')) +
  318 + toInt(dom.css(element, 'borderLeftWidth')) +
  319 + toInt(dom.css(element, 'borderRightWidth'));
  320 +};
  321 +
  322 +exports.startScrolling = function (element, axis) {
  323 + cls.add(element, 'ps-in-scrolling');
  324 + if (typeof axis !== 'undefined') {
  325 + cls.add(element, 'ps-' + axis);
  326 + } else {
  327 + cls.add(element, 'ps-x');
  328 + cls.add(element, 'ps-y');
  329 + }
  330 +};
  331 +
  332 +exports.stopScrolling = function (element, axis) {
  333 + cls.remove(element, 'ps-in-scrolling');
  334 + if (typeof axis !== 'undefined') {
  335 + cls.remove(element, 'ps-' + axis);
  336 + } else {
  337 + cls.remove(element, 'ps-x');
  338 + cls.remove(element, 'ps-y');
  339 + }
  340 +};
  341 +
  342 +exports.env = {
  343 + isWebKit: 'WebkitAppearance' in document.documentElement.style,
  344 + supportsTouch: (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch),
  345 + supportsIePointer: window.navigator.msMaxTouchPoints !== null
  346 +};
  347 +
  348 +},{"./class":2,"./dom":3}],7:[function(require,module,exports){
  349 +'use strict';
  350 +
  351 +var destroy = require('./plugin/destroy');
  352 +var initialize = require('./plugin/initialize');
  353 +var update = require('./plugin/update');
  354 +
  355 +module.exports = {
  356 + initialize: initialize,
  357 + update: update,
  358 + destroy: destroy
  359 +};
  360 +
  361 +},{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":21}],8:[function(require,module,exports){
  362 +'use strict';
  363 +
  364 +module.exports = {
  365 + handlers: ['click-rail', 'drag-scrollbar', 'keyboard', 'wheel', 'touch'],
  366 + maxScrollbarLength: null,
  367 + minScrollbarLength: null,
  368 + scrollXMarginOffset: 0,
  369 + scrollYMarginOffset: 0,
  370 + suppressScrollX: false,
  371 + suppressScrollY: false,
  372 + swipePropagation: true,
  373 + useBothWheelAxes: false,
  374 + wheelPropagation: false,
  375 + wheelSpeed: 1,
  376 + theme: 'default'
  377 +};
  378 +
  379 +},{}],9:[function(require,module,exports){
  380 +'use strict';
  381 +
  382 +var _ = require('../lib/helper');
  383 +var dom = require('../lib/dom');
  384 +var instances = require('./instances');
  385 +
  386 +module.exports = function (element) {
  387 + var i = instances.get(element);
  388 +
  389 + if (!i) {
  390 + return;
  391 + }
  392 +
  393 + i.event.unbindAll();
  394 + dom.remove(i.scrollbarX);
  395 + dom.remove(i.scrollbarY);
  396 + dom.remove(i.scrollbarXRail);
  397 + dom.remove(i.scrollbarYRail);
  398 + _.removePsClasses(element);
  399 +
  400 + instances.remove(element);
  401 +};
  402 +
  403 +},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(require,module,exports){
  404 +'use strict';
  405 +
  406 +var instances = require('../instances');
  407 +var updateGeometry = require('../update-geometry');
  408 +var updateScroll = require('../update-scroll');
  409 +
  410 +function bindClickRailHandler(element, i) {
  411 + function pageOffset(el) {
  412 + return el.getBoundingClientRect();
  413 + }
  414 + var stopPropagation = function (e) { e.stopPropagation(); };
  415 +
  416 + i.event.bind(i.scrollbarY, 'click', stopPropagation);
  417 + i.event.bind(i.scrollbarYRail, 'click', function (e) {
  418 + var positionTop = e.pageY - window.pageYOffset - pageOffset(i.scrollbarYRail).top;
  419 + var direction = positionTop > i.scrollbarYTop ? 1 : -1;
  420 +
  421 + updateScroll(element, 'top', element.scrollTop + direction * i.containerHeight);
  422 + updateGeometry(element);
  423 +
  424 + e.stopPropagation();
  425 + });
  426 +
  427 + i.event.bind(i.scrollbarX, 'click', stopPropagation);
  428 + i.event.bind(i.scrollbarXRail, 'click', function (e) {
  429 + var positionLeft = e.pageX - window.pageXOffset - pageOffset(i.scrollbarXRail).left;
  430 + var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
  431 +
  432 + updateScroll(element, 'left', element.scrollLeft + direction * i.containerWidth);
  433 + updateGeometry(element);
  434 +
  435 + e.stopPropagation();
  436 + });
  437 +}
  438 +
  439 +module.exports = function (element) {
  440 + var i = instances.get(element);
  441 + bindClickRailHandler(element, i);
  442 +};
  443 +
  444 +},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(require,module,exports){
  445 +'use strict';
  446 +
  447 +var _ = require('../../lib/helper');
  448 +var dom = require('../../lib/dom');
  449 +var instances = require('../instances');
  450 +var updateGeometry = require('../update-geometry');
  451 +var updateScroll = require('../update-scroll');
  452 +
  453 +function bindMouseScrollXHandler(element, i) {
  454 + var currentLeft = null;
  455 + var currentPageX = null;
  456 +
  457 + function updateScrollLeft(deltaX) {
  458 + var newLeft = currentLeft + (deltaX * i.railXRatio);
  459 + var maxLeft = Math.max(0, i.scrollbarXRail.getBoundingClientRect().left) + (i.railXRatio * (i.railXWidth - i.scrollbarXWidth));
  460 +
  461 + if (newLeft < 0) {
  462 + i.scrollbarXLeft = 0;
  463 + } else if (newLeft > maxLeft) {
  464 + i.scrollbarXLeft = maxLeft;
  465 + } else {
  466 + i.scrollbarXLeft = newLeft;
  467 + }
  468 +
  469 + var scrollLeft = _.toInt(i.scrollbarXLeft * (i.contentWidth - i.containerWidth) / (i.containerWidth - (i.railXRatio * i.scrollbarXWidth))) - i.negativeScrollAdjustment;
  470 + updateScroll(element, 'left', scrollLeft);
  471 + }
  472 +
  473 + var mouseMoveHandler = function (e) {
  474 + updateScrollLeft(e.pageX - currentPageX);
  475 + updateGeometry(element);
  476 + e.stopPropagation();
  477 + e.preventDefault();
  478 + };
  479 +
  480 + var mouseUpHandler = function () {
  481 + _.stopScrolling(element, 'x');
  482 + i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
  483 + };
  484 +
  485 + i.event.bind(i.scrollbarX, 'mousedown', function (e) {
  486 + currentPageX = e.pageX;
  487 + currentLeft = _.toInt(dom.css(i.scrollbarX, 'left')) * i.railXRatio;
  488 + _.startScrolling(element, 'x');
  489 +
  490 + i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
  491 + i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
  492 +
  493 + e.stopPropagation();
  494 + e.preventDefault();
  495 + });
  496 +}
  497 +
  498 +function bindMouseScrollYHandler(element, i) {
  499 + var currentTop = null;
  500 + var currentPageY = null;
  501 +
  502 + function updateScrollTop(deltaY) {
  503 + var newTop = currentTop + (deltaY * i.railYRatio);
  504 + var maxTop = Math.max(0, i.scrollbarYRail.getBoundingClientRect().top) + (i.railYRatio * (i.railYHeight - i.scrollbarYHeight));
  505 +
  506 + if (newTop < 0) {
  507 + i.scrollbarYTop = 0;
  508 + } else if (newTop > maxTop) {
  509 + i.scrollbarYTop = maxTop;
  510 + } else {
  511 + i.scrollbarYTop = newTop;
  512 + }
  513 +
  514 + var scrollTop = _.toInt(i.scrollbarYTop * (i.contentHeight - i.containerHeight) / (i.containerHeight - (i.railYRatio * i.scrollbarYHeight)));
  515 + updateScroll(element, 'top', scrollTop);
  516 + }
  517 +
  518 + var mouseMoveHandler = function (e) {
  519 + updateScrollTop(e.pageY - currentPageY);
  520 + updateGeometry(element);
  521 + e.stopPropagation();
  522 + e.preventDefault();
  523 + };
  524 +
  525 + var mouseUpHandler = function () {
  526 + _.stopScrolling(element, 'y');
  527 + i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
  528 + };
  529 +
  530 + i.event.bind(i.scrollbarY, 'mousedown', function (e) {
  531 + currentPageY = e.pageY;
  532 + currentTop = _.toInt(dom.css(i.scrollbarY, 'top')) * i.railYRatio;
  533 + _.startScrolling(element, 'y');
  534 +
  535 + i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
  536 + i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
  537 +
  538 + e.stopPropagation();
  539 + e.preventDefault();
  540 + });
  541 +}
  542 +
  543 +module.exports = function (element) {
  544 + var i = instances.get(element);
  545 + bindMouseScrollXHandler(element, i);
  546 + bindMouseScrollYHandler(element, i);
  547 +};
  548 +
  549 +},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(require,module,exports){
  550 +'use strict';
  551 +
  552 +var _ = require('../../lib/helper');
  553 +var dom = require('../../lib/dom');
  554 +var instances = require('../instances');
  555 +var updateGeometry = require('../update-geometry');
  556 +var updateScroll = require('../update-scroll');
  557 +
  558 +function bindKeyboardHandler(element, i) {
  559 + var hovered = false;
  560 + i.event.bind(element, 'mouseenter', function () {
  561 + hovered = true;
  562 + });
  563 + i.event.bind(element, 'mouseleave', function () {
  564 + hovered = false;
  565 + });
  566 +
  567 + var shouldPrevent = false;
  568 + function shouldPreventDefault(deltaX, deltaY) {
  569 + var scrollTop = element.scrollTop;
  570 + if (deltaX === 0) {
  571 + if (!i.scrollbarYActive) {
  572 + return false;
  573 + }
  574 + if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) {
  575 + return !i.settings.wheelPropagation;
  576 + }
  577 + }
  578 +
  579 + var scrollLeft = element.scrollLeft;
  580 + if (deltaY === 0) {
  581 + if (!i.scrollbarXActive) {
  582 + return false;
  583 + }
  584 + if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) {
  585 + return !i.settings.wheelPropagation;
  586 + }
  587 + }
  588 + return true;
  589 + }
  590 +
  591 + i.event.bind(i.ownerDocument, 'keydown', function (e) {
  592 + if ((e.isDefaultPrevented && e.isDefaultPrevented()) || e.defaultPrevented) {
  593 + return;
  594 + }
  595 +
  596 + var focused = dom.matches(i.scrollbarX, ':focus') ||
  597 + dom.matches(i.scrollbarY, ':focus');
  598 +
  599 + if (!hovered && !focused) {
  600 + return;
  601 + }
  602 +
  603 + var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement;
  604 + if (activeElement) {
  605 + if (activeElement.tagName === 'IFRAME') {
  606 + activeElement = activeElement.contentDocument.activeElement;
  607 + } else {
  608 + // go deeper if element is a webcomponent
  609 + while (activeElement.shadowRoot) {
  610 + activeElement = activeElement.shadowRoot.activeElement;
  611 + }
  612 + }
  613 + if (_.isEditable(activeElement)) {
  614 + return;
  615 + }
  616 + }
  617 +
  618 + var deltaX = 0;
  619 + var deltaY = 0;
  620 +
  621 + switch (e.which) {
  622 + case 37: // left
  623 + if (e.metaKey) {
  624 + deltaX = -i.contentWidth;
  625 + } else if (e.altKey) {
  626 + deltaX = -i.containerWidth;
  627 + } else {
  628 + deltaX = -30;
  629 + }
  630 + break;
  631 + case 38: // up
  632 + if (e.metaKey) {
  633 + deltaY = i.contentHeight;
  634 + } else if (e.altKey) {
  635 + deltaY = i.containerHeight;
  636 + } else {
  637 + deltaY = 30;
  638 + }
  639 + break;
  640 + case 39: // right
  641 + if (e.metaKey) {
  642 + deltaX = i.contentWidth;
  643 + } else if (e.altKey) {
  644 + deltaX = i.containerWidth;
  645 + } else {
  646 + deltaX = 30;
  647 + }
  648 + break;
  649 + case 40: // down
  650 + if (e.metaKey) {
  651 + deltaY = -i.contentHeight;
  652 + } else if (e.altKey) {
  653 + deltaY = -i.containerHeight;
  654 + } else {
  655 + deltaY = -30;
  656 + }
  657 + break;
  658 + case 33: // page up
  659 + deltaY = 90;
  660 + break;
  661 + case 32: // space bar
  662 + if (e.shiftKey) {
  663 + deltaY = 90;
  664 + } else {
  665 + deltaY = -90;
  666 + }
  667 + break;
  668 + case 34: // page down
  669 + deltaY = -90;
  670 + break;
  671 + case 35: // end
  672 + if (e.ctrlKey) {
  673 + deltaY = -i.contentHeight;
  674 + } else {
  675 + deltaY = -i.containerHeight;
  676 + }
  677 + break;
  678 + case 36: // home
  679 + if (e.ctrlKey) {
  680 + deltaY = element.scrollTop;
  681 + } else {
  682 + deltaY = i.containerHeight;
  683 + }
  684 + break;
  685 + default:
  686 + return;
  687 + }
  688 +
  689 + updateScroll(element, 'top', element.scrollTop - deltaY);
  690 + updateScroll(element, 'left', element.scrollLeft + deltaX);
  691 + updateGeometry(element);
  692 +
  693 + shouldPrevent = shouldPreventDefault(deltaX, deltaY);
  694 + if (shouldPrevent) {
  695 + e.preventDefault();
  696 + }
  697 + });
  698 +}
  699 +
  700 +module.exports = function (element) {
  701 + var i = instances.get(element);
  702 + bindKeyboardHandler(element, i);
  703 +};
  704 +
  705 +},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(require,module,exports){
  706 +'use strict';
  707 +
  708 +var instances = require('../instances');
  709 +var updateGeometry = require('../update-geometry');
  710 +var updateScroll = require('../update-scroll');
  711 +
  712 +function bindMouseWheelHandler(element, i) {
  713 + var shouldPrevent = false;
  714 +
  715 + function shouldPreventDefault(deltaX, deltaY) {
  716 + var scrollTop = element.scrollTop;
  717 + if (deltaX === 0) {
  718 + if (!i.scrollbarYActive) {
  719 + return false;
  720 + }
  721 + if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0)) {
  722 + return !i.settings.wheelPropagation;
  723 + }
  724 + }
  725 +
  726 + var scrollLeft = element.scrollLeft;
  727 + if (deltaY === 0) {
  728 + if (!i.scrollbarXActive) {
  729 + return false;
  730 + }
  731 + if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0)) {
  732 + return !i.settings.wheelPropagation;
  733 + }
  734 + }
  735 + return true;
  736 + }
  737 +
  738 + function getDeltaFromEvent(e) {
  739 + var deltaX = e.deltaX;
  740 + var deltaY = -1 * e.deltaY;
  741 +
  742 + if (typeof deltaX === "undefined" || typeof deltaY === "undefined") {
  743 + // OS X Safari
  744 + deltaX = -1 * e.wheelDeltaX / 6;
  745 + deltaY = e.wheelDeltaY / 6;
  746 + }
  747 +
  748 + if (e.deltaMode && e.deltaMode === 1) {
  749 + // Firefox in deltaMode 1: Line scrolling
  750 + deltaX *= 10;
  751 + deltaY *= 10;
  752 + }
  753 +
  754 + if (deltaX !== deltaX && deltaY !== deltaY/* NaN checks */) {
  755 + // IE in some mouse drivers
  756 + deltaX = 0;
  757 + deltaY = e.wheelDelta;
  758 + }
  759 +
  760 + if (e.shiftKey) {
  761 + // reverse axis with shift key
  762 + return [-deltaY, -deltaX];
  763 + }
  764 + return [deltaX, deltaY];
  765 + }
  766 +
  767 + function shouldBeConsumedByChild(deltaX, deltaY) {
  768 + var child = element.querySelector('textarea:hover, select[multiple]:hover, .ps-child:hover');
  769 + if (child) {
  770 + if (!window.getComputedStyle(child).overflow.match(/(scroll|auto)/)) {
  771 + // if not scrollable
  772 + return false;
  773 + }
  774 +
  775 + var maxScrollTop = child.scrollHeight - child.clientHeight;
  776 + if (maxScrollTop > 0) {
  777 + if (!(child.scrollTop === 0 && deltaY > 0) && !(child.scrollTop === maxScrollTop && deltaY < 0)) {
  778 + return true;
  779 + }
  780 + }
  781 + var maxScrollLeft = child.scrollLeft - child.clientWidth;
  782 + if (maxScrollLeft > 0) {
  783 + if (!(child.scrollLeft === 0 && deltaX < 0) && !(child.scrollLeft === maxScrollLeft && deltaX > 0)) {
  784 + return true;
  785 + }
  786 + }
  787 + }
  788 + return false;
  789 + }
  790 +
  791 + function mousewheelHandler(e) {
  792 + var delta = getDeltaFromEvent(e);
  793 +
  794 + var deltaX = delta[0];
  795 + var deltaY = delta[1];
  796 +
  797 + if (shouldBeConsumedByChild(deltaX, deltaY)) {
  798 + return;
  799 + }
  800 +
  801 + shouldPrevent = false;
  802 + if (!i.settings.useBothWheelAxes) {
  803 + // deltaX will only be used for horizontal scrolling and deltaY will
  804 + // only be used for vertical scrolling - this is the default
  805 + updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed));
  806 + updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed));
  807 + } else if (i.scrollbarYActive && !i.scrollbarXActive) {
  808 + // only vertical scrollbar is active and useBothWheelAxes option is
  809 + // active, so let's scroll vertical bar using both mouse wheel axes
  810 + if (deltaY) {
  811 + updateScroll(element, 'top', element.scrollTop - (deltaY * i.settings.wheelSpeed));
  812 + } else {
  813 + updateScroll(element, 'top', element.scrollTop + (deltaX * i.settings.wheelSpeed));
  814 + }
  815 + shouldPrevent = true;
  816 + } else if (i.scrollbarXActive && !i.scrollbarYActive) {
  817 + // useBothWheelAxes and only horizontal bar is active, so use both
  818 + // wheel axes for horizontal bar
  819 + if (deltaX) {
  820 + updateScroll(element, 'left', element.scrollLeft + (deltaX * i.settings.wheelSpeed));
  821 + } else {
  822 + updateScroll(element, 'left', element.scrollLeft - (deltaY * i.settings.wheelSpeed));
  823 + }
  824 + shouldPrevent = true;
  825 + }
  826 +
  827 + updateGeometry(element);
  828 +
  829 + shouldPrevent = (shouldPrevent || shouldPreventDefault(deltaX, deltaY));
  830 + if (shouldPrevent) {
  831 + e.stopPropagation();
  832 + e.preventDefault();
  833 + }
  834 + }
  835 +
  836 + if (typeof window.onwheel !== "undefined") {
  837 + i.event.bind(element, 'wheel', mousewheelHandler);
  838 + } else if (typeof window.onmousewheel !== "undefined") {
  839 + i.event.bind(element, 'mousewheel', mousewheelHandler);
  840 + }
  841 +}
  842 +
  843 +module.exports = function (element) {
  844 + var i = instances.get(element);
  845 + bindMouseWheelHandler(element, i);
  846 +};
  847 +
  848 +},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(require,module,exports){
  849 +'use strict';
  850 +
  851 +var instances = require('../instances');
  852 +var updateGeometry = require('../update-geometry');
  853 +
  854 +function bindNativeScrollHandler(element, i) {
  855 + i.event.bind(element, 'scroll', function () {
  856 + updateGeometry(element);
  857 + });
  858 +}
  859 +
  860 +module.exports = function (element) {
  861 + var i = instances.get(element);
  862 + bindNativeScrollHandler(element, i);
  863 +};
  864 +
  865 +},{"../instances":18,"../update-geometry":19}],15:[function(require,module,exports){
  866 +'use strict';
  867 +
  868 +var _ = require('../../lib/helper');
  869 +var instances = require('../instances');
  870 +var updateGeometry = require('../update-geometry');
  871 +var updateScroll = require('../update-scroll');
  872 +
  873 +function bindSelectionHandler(element, i) {
  874 + function getRangeNode() {
  875 + var selection = window.getSelection ? window.getSelection() :
  876 + document.getSelection ? document.getSelection() : '';
  877 + if (selection.toString().length === 0) {
  878 + return null;
  879 + } else {
  880 + return selection.getRangeAt(0).commonAncestorContainer;
  881 + }
  882 + }
  883 +
  884 + var scrollingLoop = null;
  885 + var scrollDiff = {top: 0, left: 0};
  886 + function startScrolling() {
  887 + if (!scrollingLoop) {
  888 + scrollingLoop = setInterval(function () {
  889 + if (!instances.get(element)) {
  890 + clearInterval(scrollingLoop);
  891 + return;
  892 + }
  893 +
  894 + updateScroll(element, 'top', element.scrollTop + scrollDiff.top);
  895 + updateScroll(element, 'left', element.scrollLeft + scrollDiff.left);
  896 + updateGeometry(element);
  897 + }, 50); // every .1 sec
  898 + }
  899 + }
  900 + function stopScrolling() {
  901 + if (scrollingLoop) {
  902 + clearInterval(scrollingLoop);
  903 + scrollingLoop = null;
  904 + }
  905 + _.stopScrolling(element);
  906 + }
  907 +
  908 + var isSelected = false;
  909 + i.event.bind(i.ownerDocument, 'selectionchange', function () {
  910 + if (element.contains(getRangeNode())) {
  911 + isSelected = true;
  912 + } else {
  913 + isSelected = false;
  914 + stopScrolling();
  915 + }
  916 + });
  917 + i.event.bind(window, 'mouseup', function () {
  918 + if (isSelected) {
  919 + isSelected = false;
  920 + stopScrolling();
  921 + }
  922 + });
  923 + i.event.bind(window, 'keyup', function () {
  924 + if (isSelected) {
  925 + isSelected = false;
  926 + stopScrolling();
  927 + }
  928 + });
  929 +
  930 + i.event.bind(window, 'mousemove', function (e) {
  931 + if (isSelected) {
  932 + var mousePosition = {x: e.pageX, y: e.pageY};
  933 + var containerGeometry = {
  934 + left: element.offsetLeft,
  935 + right: element.offsetLeft + element.offsetWidth,
  936 + top: element.offsetTop,
  937 + bottom: element.offsetTop + element.offsetHeight
  938 + };
  939 +
  940 + if (mousePosition.x < containerGeometry.left + 3) {
  941 + scrollDiff.left = -5;
  942 + _.startScrolling(element, 'x');
  943 + } else if (mousePosition.x > containerGeometry.right - 3) {
  944 + scrollDiff.left = 5;
  945 + _.startScrolling(element, 'x');
  946 + } else {
  947 + scrollDiff.left = 0;
  948 + }
  949 +
  950 + if (mousePosition.y < containerGeometry.top + 3) {
  951 + if (containerGeometry.top + 3 - mousePosition.y < 5) {
  952 + scrollDiff.top = -5;
  953 + } else {
  954 + scrollDiff.top = -20;
  955 + }
  956 + _.startScrolling(element, 'y');
  957 + } else if (mousePosition.y > containerGeometry.bottom - 3) {
  958 + if (mousePosition.y - containerGeometry.bottom + 3 < 5) {
  959 + scrollDiff.top = 5;
  960 + } else {
  961 + scrollDiff.top = 20;
  962 + }
  963 + _.startScrolling(element, 'y');
  964 + } else {
  965 + scrollDiff.top = 0;
  966 + }
  967 +
  968 + if (scrollDiff.top === 0 && scrollDiff.left === 0) {
  969 + stopScrolling();
  970 + } else {
  971 + startScrolling();
  972 + }
  973 + }
  974 + });
  975 +}
  976 +
  977 +module.exports = function (element) {
  978 + var i = instances.get(element);
  979 + bindSelectionHandler(element, i);
  980 +};
  981 +
  982 +},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(require,module,exports){
  983 +'use strict';
  984 +
  985 +var _ = require('../../lib/helper');
  986 +var instances = require('../instances');
  987 +var updateGeometry = require('../update-geometry');
  988 +var updateScroll = require('../update-scroll');
  989 +
  990 +function bindTouchHandler(element, i, supportsTouch, supportsIePointer) {
  991 + function shouldPreventDefault(deltaX, deltaY) {
  992 + var scrollTop = element.scrollTop;
  993 + var scrollLeft = element.scrollLeft;
  994 + var magnitudeX = Math.abs(deltaX);
  995 + var magnitudeY = Math.abs(deltaY);
  996 +
  997 + if (magnitudeY > magnitudeX) {
  998 + // user is perhaps trying to swipe up/down the page
  999 +
  1000 + if (((deltaY < 0) && (scrollTop === i.contentHeight - i.containerHeight)) ||
  1001 + ((deltaY > 0) && (scrollTop === 0))) {
  1002 + return !i.settings.swipePropagation;
  1003 + }
  1004 + } else if (magnitudeX > magnitudeY) {
  1005 + // user is perhaps trying to swipe left/right across the page
  1006 +
  1007 + if (((deltaX < 0) && (scrollLeft === i.contentWidth - i.containerWidth)) ||
  1008 + ((deltaX > 0) && (scrollLeft === 0))) {
  1009 + return !i.settings.swipePropagation;
  1010 + }
  1011 + }
  1012 +
  1013 + return true;
  1014 + }
  1015 +
  1016 + function applyTouchMove(differenceX, differenceY) {
  1017 + updateScroll(element, 'top', element.scrollTop - differenceY);
  1018 + updateScroll(element, 'left', element.scrollLeft - differenceX);
  1019 +
  1020 + updateGeometry(element);
  1021 + }
  1022 +
  1023 + var startOffset = {};
  1024 + var startTime = 0;
  1025 + var speed = {};
  1026 + var easingLoop = null;
  1027 + var inGlobalTouch = false;
  1028 + var inLocalTouch = false;
  1029 +
  1030 + function globalTouchStart() {
  1031 + inGlobalTouch = true;
  1032 + }
  1033 + function globalTouchEnd() {
  1034 + inGlobalTouch = false;
  1035 + }
  1036 +
  1037 + function getTouch(e) {
  1038 + if (e.targetTouches) {
  1039 + return e.targetTouches[0];
  1040 + } else {
  1041 + // Maybe IE pointer
  1042 + return e;
  1043 + }
  1044 + }
  1045 + function shouldHandle(e) {
  1046 + if (e.targetTouches && e.targetTouches.length === 1) {
  1047 + return true;
  1048 + }
  1049 + if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
  1050 + return true;
  1051 + }
  1052 + return false;
  1053 + }
  1054 + function touchStart(e) {
  1055 + if (shouldHandle(e)) {
  1056 + inLocalTouch = true;
  1057 +
  1058 + var touch = getTouch(e);
  1059 +
  1060 + startOffset.pageX = touch.pageX;
  1061 + startOffset.pageY = touch.pageY;
  1062 +
  1063 + startTime = (new Date()).getTime();
  1064 +
  1065 + if (easingLoop !== null) {
  1066 + clearInterval(easingLoop);
  1067 + }
  1068 +
  1069 + e.stopPropagation();
  1070 + }
  1071 + }
  1072 + function touchMove(e) {
  1073 + if (!inLocalTouch && i.settings.swipePropagation) {
  1074 + touchStart(e);
  1075 + }
  1076 + if (!inGlobalTouch && inLocalTouch && shouldHandle(e)) {
  1077 + var touch = getTouch(e);
  1078 +
  1079 + var currentOffset = {pageX: touch.pageX, pageY: touch.pageY};
  1080 +
  1081 + var differenceX = currentOffset.pageX - startOffset.pageX;
  1082 + var differenceY = currentOffset.pageY - startOffset.pageY;
  1083 +
  1084 + applyTouchMove(differenceX, differenceY);
  1085 + startOffset = currentOffset;
  1086 +
  1087 + var currentTime = (new Date()).getTime();
  1088 +
  1089 + var timeGap = currentTime - startTime;
  1090 + if (timeGap > 0) {
  1091 + speed.x = differenceX / timeGap;
  1092 + speed.y = differenceY / timeGap;
  1093 + startTime = currentTime;
  1094 + }
  1095 +
  1096 + if (shouldPreventDefault(differenceX, differenceY)) {
  1097 + e.stopPropagation();
  1098 + e.preventDefault();
  1099 + }
  1100 + }
  1101 + }
  1102 + function touchEnd() {
  1103 + if (!inGlobalTouch && inLocalTouch) {
  1104 + inLocalTouch = false;
  1105 +
  1106 + clearInterval(easingLoop);
  1107 + easingLoop = setInterval(function () {
  1108 + if (!instances.get(element)) {
  1109 + clearInterval(easingLoop);
  1110 + return;
  1111 + }
  1112 +
  1113 + if (!speed.x && !speed.y) {
  1114 + clearInterval(easingLoop);
  1115 + return;
  1116 + }
  1117 +
  1118 + if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
  1119 + clearInterval(easingLoop);
  1120 + return;
  1121 + }
  1122 +
  1123 + applyTouchMove(speed.x * 30, speed.y * 30);
  1124 +
  1125 + speed.x *= 0.8;
  1126 + speed.y *= 0.8;
  1127 + }, 10);
  1128 + }
  1129 + }
  1130 +
  1131 + if (supportsTouch) {
  1132 + i.event.bind(window, 'touchstart', globalTouchStart);
  1133 + i.event.bind(window, 'touchend', globalTouchEnd);
  1134 + i.event.bind(element, 'touchstart', touchStart);
  1135 + i.event.bind(element, 'touchmove', touchMove);
  1136 + i.event.bind(element, 'touchend', touchEnd);
  1137 + } else if (supportsIePointer) {
  1138 + if (window.PointerEvent) {
  1139 + i.event.bind(window, 'pointerdown', globalTouchStart);
  1140 + i.event.bind(window, 'pointerup', globalTouchEnd);
  1141 + i.event.bind(element, 'pointerdown', touchStart);
  1142 + i.event.bind(element, 'pointermove', touchMove);
  1143 + i.event.bind(element, 'pointerup', touchEnd);
  1144 + } else if (window.MSPointerEvent) {
  1145 + i.event.bind(window, 'MSPointerDown', globalTouchStart);
  1146 + i.event.bind(window, 'MSPointerUp', globalTouchEnd);
  1147 + i.event.bind(element, 'MSPointerDown', touchStart);
  1148 + i.event.bind(element, 'MSPointerMove', touchMove);
  1149 + i.event.bind(element, 'MSPointerUp', touchEnd);
  1150 + }
  1151 + }
  1152 +}
  1153 +
  1154 +module.exports = function (element) {
  1155 + if (!_.env.supportsTouch && !_.env.supportsIePointer) {
  1156 + return;
  1157 + }
  1158 +
  1159 + var i = instances.get(element);
  1160 + bindTouchHandler(element, i, _.env.supportsTouch, _.env.supportsIePointer);
  1161 +};
  1162 +
  1163 +},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(require,module,exports){
  1164 +'use strict';
  1165 +
  1166 +var _ = require('../lib/helper');
  1167 +var cls = require('../lib/class');
  1168 +var instances = require('./instances');
  1169 +var updateGeometry = require('./update-geometry');
  1170 +
  1171 +// Handlers
  1172 +var handlers = {
  1173 + 'click-rail': require('./handler/click-rail'),
  1174 + 'drag-scrollbar': require('./handler/drag-scrollbar'),
  1175 + 'keyboard': require('./handler/keyboard'),
  1176 + 'wheel': require('./handler/mouse-wheel'),
  1177 + 'touch': require('./handler/touch'),
  1178 + 'selection': require('./handler/selection')
  1179 +};
  1180 +var nativeScrollHandler = require('./handler/native-scroll');
  1181 +
  1182 +module.exports = function (element, userSettings) {
  1183 + userSettings = typeof userSettings === 'object' ? userSettings : {};
  1184 +
  1185 + cls.add(element, 'ps-container');
  1186 +
  1187 + // Create a plugin instance.
  1188 + var i = instances.add(element);
  1189 +
  1190 + i.settings = _.extend(i.settings, userSettings);
  1191 + cls.add(element, 'ps-theme-' + i.settings.theme);
  1192 +
  1193 + i.settings.handlers.forEach(function (handlerName) {
  1194 + handlers[handlerName](element);
  1195 + });
  1196 +
  1197 + nativeScrollHandler(element);
  1198 +
  1199 + updateGeometry(element);
  1200 +};
  1201 +
  1202 +},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(require,module,exports){
  1203 +'use strict';
  1204 +
  1205 +var _ = require('../lib/helper');
  1206 +var cls = require('../lib/class');
  1207 +var defaultSettings = require('./default-setting');
  1208 +var dom = require('../lib/dom');
  1209 +var EventManager = require('../lib/event-manager');
  1210 +var guid = require('../lib/guid');
  1211 +
  1212 +var instances = {};
  1213 +
  1214 +function Instance(element) {
  1215 + var i = this;
  1216 +
  1217 + i.settings = _.clone(defaultSettings);
  1218 + i.containerWidth = null;
  1219 + i.containerHeight = null;
  1220 + i.contentWidth = null;
  1221 + i.contentHeight = null;
  1222 +
  1223 + i.isRtl = dom.css(element, 'direction') === "rtl";
  1224 + i.isNegativeScroll = (function () {
  1225 + var originalScrollLeft = element.scrollLeft;
  1226 + var result = null;
  1227 + element.scrollLeft = -1;
  1228 + result = element.scrollLeft < 0;
  1229 + element.scrollLeft = originalScrollLeft;
  1230 + return result;
  1231 + })();
  1232 + i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0;
  1233 + i.event = new EventManager();
  1234 + i.ownerDocument = element.ownerDocument || document;
  1235 +
  1236 + function focus() {
  1237 + cls.add(element, 'ps-focus');
  1238 + }
  1239 +
  1240 + function blur() {
  1241 + cls.remove(element, 'ps-focus');
  1242 + }
  1243 +
  1244 + i.scrollbarXRail = dom.appendTo(dom.e('div', 'ps-scrollbar-x-rail'), element);
  1245 + i.scrollbarX = dom.appendTo(dom.e('div', 'ps-scrollbar-x'), i.scrollbarXRail);
  1246 + i.scrollbarX.setAttribute('tabindex', 0);
  1247 + i.event.bind(i.scrollbarX, 'focus', focus);
  1248 + i.event.bind(i.scrollbarX, 'blur', blur);
  1249 + i.scrollbarXActive = null;
  1250 + i.scrollbarXWidth = null;
  1251 + i.scrollbarXLeft = null;
  1252 + i.scrollbarXBottom = _.toInt(dom.css(i.scrollbarXRail, 'bottom'));
  1253 + i.isScrollbarXUsingBottom = i.scrollbarXBottom === i.scrollbarXBottom; // !isNaN
  1254 + i.scrollbarXTop = i.isScrollbarXUsingBottom ? null : _.toInt(dom.css(i.scrollbarXRail, 'top'));
  1255 + i.railBorderXWidth = _.toInt(dom.css(i.scrollbarXRail, 'borderLeftWidth')) + _.toInt(dom.css(i.scrollbarXRail, 'borderRightWidth'));
  1256 + // Set rail to display:block to calculate margins
  1257 + dom.css(i.scrollbarXRail, 'display', 'block');
  1258 + i.railXMarginWidth = _.toInt(dom.css(i.scrollbarXRail, 'marginLeft')) + _.toInt(dom.css(i.scrollbarXRail, 'marginRight'));
  1259 + dom.css(i.scrollbarXRail, 'display', '');
  1260 + i.railXWidth = null;
  1261 + i.railXRatio = null;
  1262 +
  1263 + i.scrollbarYRail = dom.appendTo(dom.e('div', 'ps-scrollbar-y-rail'), element);
  1264 + i.scrollbarY = dom.appendTo(dom.e('div', 'ps-scrollbar-y'), i.scrollbarYRail);
  1265 + i.scrollbarY.setAttribute('tabindex', 0);
  1266 + i.event.bind(i.scrollbarY, 'focus', focus);
  1267 + i.event.bind(i.scrollbarY, 'blur', blur);
  1268 + i.scrollbarYActive = null;
  1269 + i.scrollbarYHeight = null;
  1270 + i.scrollbarYTop = null;
  1271 + i.scrollbarYRight = _.toInt(dom.css(i.scrollbarYRail, 'right'));
  1272 + i.isScrollbarYUsingRight = i.scrollbarYRight === i.scrollbarYRight; // !isNaN
  1273 + i.scrollbarYLeft = i.isScrollbarYUsingRight ? null : _.toInt(dom.css(i.scrollbarYRail, 'left'));
  1274 + i.scrollbarYOuterWidth = i.isRtl ? _.outerWidth(i.scrollbarY) : null;
  1275 + i.railBorderYWidth = _.toInt(dom.css(i.scrollbarYRail, 'borderTopWidth')) + _.toInt(dom.css(i.scrollbarYRail, 'borderBottomWidth'));
  1276 + dom.css(i.scrollbarYRail, 'display', 'block');
  1277 + i.railYMarginHeight = _.toInt(dom.css(i.scrollbarYRail, 'marginTop')) + _.toInt(dom.css(i.scrollbarYRail, 'marginBottom'));
  1278 + dom.css(i.scrollbarYRail, 'display', '');
  1279 + i.railYHeight = null;
  1280 + i.railYRatio = null;
  1281 +}
  1282 +
  1283 +function getId(element) {
  1284 + return element.getAttribute('data-ps-id');
  1285 +}
  1286 +
  1287 +function setId(element, id) {
  1288 + element.setAttribute('data-ps-id', id);
  1289 +}
  1290 +
  1291 +function removeId(element) {
  1292 + element.removeAttribute('data-ps-id');
  1293 +}
  1294 +
  1295 +exports.add = function (element) {
  1296 + var newId = guid();
  1297 + setId(element, newId);
  1298 + instances[newId] = new Instance(element);
  1299 + return instances[newId];
  1300 +};
  1301 +
  1302 +exports.remove = function (element) {
  1303 + delete instances[getId(element)];
  1304 + removeId(element);
  1305 +};
  1306 +
  1307 +exports.get = function (element) {
  1308 + return instances[getId(element)];
  1309 +};
  1310 +
  1311 +},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(require,module,exports){
  1312 +'use strict';
  1313 +
  1314 +var _ = require('../lib/helper');
  1315 +var cls = require('../lib/class');
  1316 +var dom = require('../lib/dom');
  1317 +var instances = require('./instances');
  1318 +var updateScroll = require('./update-scroll');
  1319 +
  1320 +function getThumbSize(i, thumbSize) {
  1321 + if (i.settings.minScrollbarLength) {
  1322 + thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
  1323 + }
  1324 + if (i.settings.maxScrollbarLength) {
  1325 + thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
  1326 + }
  1327 + return thumbSize;
  1328 +}
  1329 +
  1330 +function updateCss(element, i) {
  1331 + var xRailOffset = {width: i.railXWidth};
  1332 + if (i.isRtl) {
  1333 + xRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth;
  1334 + } else {
  1335 + xRailOffset.left = element.scrollLeft;
  1336 + }
  1337 + if (i.isScrollbarXUsingBottom) {
  1338 + xRailOffset.bottom = i.scrollbarXBottom - element.scrollTop;
  1339 + } else {
  1340 + xRailOffset.top = i.scrollbarXTop + element.scrollTop;
  1341 + }
  1342 + dom.css(i.scrollbarXRail, xRailOffset);
  1343 +
  1344 + var yRailOffset = {top: element.scrollTop, height: i.railYHeight};
  1345 + if (i.isScrollbarYUsingRight) {
  1346 + if (i.isRtl) {
  1347 + yRailOffset.right = i.contentWidth - (i.negativeScrollAdjustment + element.scrollLeft) - i.scrollbarYRight - i.scrollbarYOuterWidth;
  1348 + } else {
  1349 + yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
  1350 + }
  1351 + } else {
  1352 + if (i.isRtl) {
  1353 + yRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth * 2 - i.contentWidth - i.scrollbarYLeft - i.scrollbarYOuterWidth;
  1354 + } else {
  1355 + yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
  1356 + }
  1357 + }
  1358 + dom.css(i.scrollbarYRail, yRailOffset);
  1359 +
  1360 + dom.css(i.scrollbarX, {left: i.scrollbarXLeft, width: i.scrollbarXWidth - i.railBorderXWidth});
  1361 + dom.css(i.scrollbarY, {top: i.scrollbarYTop, height: i.scrollbarYHeight - i.railBorderYWidth});
  1362 +}
  1363 +
  1364 +module.exports = function (element) {
  1365 + var i = instances.get(element);
  1366 +
  1367 + i.containerWidth = element.clientWidth;
  1368 + i.containerHeight = element.clientHeight;
  1369 + i.contentWidth = element.scrollWidth;
  1370 + i.contentHeight = element.scrollHeight;
  1371 +
  1372 + var existingRails;
  1373 + if (!element.contains(i.scrollbarXRail)) {
  1374 + existingRails = dom.queryChildren(element, '.ps-scrollbar-x-rail');
  1375 + if (existingRails.length > 0) {
  1376 + existingRails.forEach(function (rail) {
  1377 + dom.remove(rail);
  1378 + });
  1379 + }
  1380 + dom.appendTo(i.scrollbarXRail, element);
  1381 + }
  1382 + if (!element.contains(i.scrollbarYRail)) {
  1383 + existingRails = dom.queryChildren(element, '.ps-scrollbar-y-rail');
  1384 + if (existingRails.length > 0) {
  1385 + existingRails.forEach(function (rail) {
  1386 + dom.remove(rail);
  1387 + });
  1388 + }
  1389 + dom.appendTo(i.scrollbarYRail, element);
  1390 + }
  1391 +
  1392 + if (!i.settings.suppressScrollX && i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth) {
  1393 + i.scrollbarXActive = true;
  1394 + i.railXWidth = i.containerWidth - i.railXMarginWidth;
  1395 + i.railXRatio = i.containerWidth / i.railXWidth;
  1396 + i.scrollbarXWidth = getThumbSize(i, _.toInt(i.railXWidth * i.containerWidth / i.contentWidth));
  1397 + i.scrollbarXLeft = _.toInt((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth) / (i.contentWidth - i.containerWidth));
  1398 + } else {
  1399 + i.scrollbarXActive = false;
  1400 + }
  1401 +
  1402 + if (!i.settings.suppressScrollY && i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight) {
  1403 + i.scrollbarYActive = true;
  1404 + i.railYHeight = i.containerHeight - i.railYMarginHeight;
  1405 + i.railYRatio = i.containerHeight / i.railYHeight;
  1406 + i.scrollbarYHeight = getThumbSize(i, _.toInt(i.railYHeight * i.containerHeight / i.contentHeight));
  1407 + i.scrollbarYTop = _.toInt(element.scrollTop * (i.railYHeight - i.scrollbarYHeight) / (i.contentHeight - i.containerHeight));
  1408 + } else {
  1409 + i.scrollbarYActive = false;
  1410 + }
  1411 +
  1412 + if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
  1413 + i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
  1414 + }
  1415 + if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
  1416 + i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
  1417 + }
  1418 +
  1419 + updateCss(element, i);
  1420 +
  1421 + if (i.scrollbarXActive) {
  1422 + cls.add(element, 'ps-active-x');
  1423 + } else {
  1424 + cls.remove(element, 'ps-active-x');
  1425 + i.scrollbarXWidth = 0;
  1426 + i.scrollbarXLeft = 0;
  1427 + updateScroll(element, 'left', 0);
  1428 + }
  1429 + if (i.scrollbarYActive) {
  1430 + cls.add(element, 'ps-active-y');
  1431 + } else {
  1432 + cls.remove(element, 'ps-active-y');
  1433 + i.scrollbarYHeight = 0;
  1434 + i.scrollbarYTop = 0;
  1435 + updateScroll(element, 'top', 0);
  1436 + }
  1437 +};
  1438 +
  1439 +},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(require,module,exports){
  1440 +'use strict';
  1441 +
  1442 +var instances = require('./instances');
  1443 +
  1444 +var lastTop;
  1445 +var lastLeft;
  1446 +
  1447 +var createDOMEvent = function (name) {
  1448 + var event = document.createEvent("Event");
  1449 + event.initEvent(name, true, true);
  1450 + return event;
  1451 +};
  1452 +
  1453 +module.exports = function (element, axis, value) {
  1454 + if (typeof element === 'undefined') {
  1455 + throw 'You must provide an element to the update-scroll function';
  1456 + }
  1457 +
  1458 + if (typeof axis === 'undefined') {
  1459 + throw 'You must provide an axis to the update-scroll function';
  1460 + }
  1461 +
  1462 + if (typeof value === 'undefined') {
  1463 + throw 'You must provide a value to the update-scroll function';
  1464 + }
  1465 +
  1466 + if (axis === 'top' && value <= 0) {
  1467 + element.scrollTop = value = 0; // don't allow negative scroll
  1468 + element.dispatchEvent(createDOMEvent('ps-y-reach-start'));
  1469 + }
  1470 +
  1471 + if (axis === 'left' && value <= 0) {
  1472 + element.scrollLeft = value = 0; // don't allow negative scroll
  1473 + element.dispatchEvent(createDOMEvent('ps-x-reach-start'));
  1474 + }
  1475 +
  1476 + var i = instances.get(element);
  1477 +
  1478 + if (axis === 'top' && value >= i.contentHeight - i.containerHeight) {
  1479 + // don't allow scroll past container
  1480 + value = i.contentHeight - i.containerHeight;
  1481 + if (value - element.scrollTop <= 1) {
  1482 + // mitigates rounding errors on non-subpixel scroll values
  1483 + value = element.scrollTop;
  1484 + } else {
  1485 + element.scrollTop = value;
  1486 + }
  1487 + element.dispatchEvent(createDOMEvent('ps-y-reach-end'));
  1488 + }
  1489 +
  1490 + if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
  1491 + // don't allow scroll past container
  1492 + value = i.contentWidth - i.containerWidth;
  1493 + if (value - element.scrollLeft <= 1) {
  1494 + // mitigates rounding errors on non-subpixel scroll values
  1495 + value = element.scrollLeft;
  1496 + } else {
  1497 + element.scrollLeft = value;
  1498 + }
  1499 + element.dispatchEvent(createDOMEvent('ps-x-reach-end'));
  1500 + }
  1501 +
  1502 + if (!lastTop) {
  1503 + lastTop = element.scrollTop;
  1504 + }
  1505 +
  1506 + if (!lastLeft) {
  1507 + lastLeft = element.scrollLeft;
  1508 + }
  1509 +
  1510 + if (axis === 'top' && value < lastTop) {
  1511 + element.dispatchEvent(createDOMEvent('ps-scroll-up'));
  1512 + }
  1513 +
  1514 + if (axis === 'top' && value > lastTop) {
  1515 + element.dispatchEvent(createDOMEvent('ps-scroll-down'));
  1516 + }
  1517 +
  1518 + if (axis === 'left' && value < lastLeft) {
  1519 + element.dispatchEvent(createDOMEvent('ps-scroll-left'));
  1520 + }
  1521 +
  1522 + if (axis === 'left' && value > lastLeft) {
  1523 + element.dispatchEvent(createDOMEvent('ps-scroll-right'));
  1524 + }
  1525 +
  1526 + if (axis === 'top') {
  1527 + element.scrollTop = lastTop = value;
  1528 + element.dispatchEvent(createDOMEvent('ps-scroll-y'));
  1529 + }
  1530 +
  1531 + if (axis === 'left') {
  1532 + element.scrollLeft = lastLeft = value;
  1533 + element.dispatchEvent(createDOMEvent('ps-scroll-x'));
  1534 + }
  1535 +
  1536 +};
  1537 +
  1538 +},{"./instances":18}],21:[function(require,module,exports){
  1539 +'use strict';
  1540 +
  1541 +var _ = require('../lib/helper');
  1542 +var dom = require('../lib/dom');
  1543 +var instances = require('./instances');
  1544 +var updateGeometry = require('./update-geometry');
  1545 +var updateScroll = require('./update-scroll');
  1546 +
  1547 +module.exports = function (element) {
  1548 + var i = instances.get(element);
  1549 +
  1550 + if (!i) {
  1551 + return;
  1552 + }
  1553 +
  1554 + // Recalcuate negative scrollLeft adjustment
  1555 + i.negativeScrollAdjustment = i.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0;
  1556 +
  1557 + // Recalculate rail margins
  1558 + dom.css(i.scrollbarXRail, 'display', 'block');
  1559 + dom.css(i.scrollbarYRail, 'display', 'block');
  1560 + i.railXMarginWidth = _.toInt(dom.css(i.scrollbarXRail, 'marginLeft')) + _.toInt(dom.css(i.scrollbarXRail, 'marginRight'));
  1561 + i.railYMarginHeight = _.toInt(dom.css(i.scrollbarYRail, 'marginTop')) + _.toInt(dom.css(i.scrollbarYRail, 'marginBottom'));
  1562 +
  1563 + // Hide scrollbars not to affect scrollWidth and scrollHeight
  1564 + dom.css(i.scrollbarXRail, 'display', 'none');
  1565 + dom.css(i.scrollbarYRail, 'display', 'none');
  1566 +
  1567 + updateGeometry(element);
  1568 +
  1569 + // Update top/left scroll to trigger events
  1570 + updateScroll(element, 'top', element.scrollTop);
  1571 + updateScroll(element, 'left', element.scrollLeft);
  1572 +
  1573 + dom.css(i.scrollbarXRail, 'display', '');
  1574 + dom.css(i.scrollbarYRail, 'display', '');
  1575 +};
  1576 +
  1577 +},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19,"./update-scroll":20}]},{},[1]);
... ...
src/main/resources/static/real_control_v2/assets/plugins/sockjs-client/sockjs.js 0 → 100644
  1 +/* sockjs-client v1.1.2 | http://sockjs.org | MIT license */
  2 +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.SockJS = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  3 +(function (global){
  4 +'use strict';
  5 +
  6 +var transportList = require('./transport-list');
  7 +
  8 +module.exports = require('./main')(transportList);
  9 +
  10 +// TODO can't get rid of this until all servers do
  11 +if ('_sockjs_onload' in global) {
  12 + setTimeout(global._sockjs_onload, 1);
  13 +}
  14 +
  15 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  16 +
  17 +},{"./main":14,"./transport-list":16}],2:[function(require,module,exports){
  18 +'use strict';
  19 +
  20 +var inherits = require('inherits')
  21 + , Event = require('./event')
  22 + ;
  23 +
  24 +function CloseEvent() {
  25 + Event.call(this);
  26 + this.initEvent('close', false, false);
  27 + this.wasClean = false;
  28 + this.code = 0;
  29 + this.reason = '';
  30 +}
  31 +
  32 +inherits(CloseEvent, Event);
  33 +
  34 +module.exports = CloseEvent;
  35 +
  36 +},{"./event":4,"inherits":56}],3:[function(require,module,exports){
  37 +'use strict';
  38 +
  39 +var inherits = require('inherits')
  40 + , EventTarget = require('./eventtarget')
  41 + ;
  42 +
  43 +function EventEmitter() {
  44 + EventTarget.call(this);
  45 +}
  46 +
  47 +inherits(EventEmitter, EventTarget);
  48 +
  49 +EventEmitter.prototype.removeAllListeners = function(type) {
  50 + if (type) {
  51 + delete this._listeners[type];
  52 + } else {
  53 + this._listeners = {};
  54 + }
  55 +};
  56 +
  57 +EventEmitter.prototype.once = function(type, listener) {
  58 + var self = this
  59 + , fired = false;
  60 +
  61 + function g() {
  62 + self.removeListener(type, g);
  63 +
  64 + if (!fired) {
  65 + fired = true;
  66 + listener.apply(this, arguments);
  67 + }
  68 + }
  69 +
  70 + this.on(type, g);
  71 +};
  72 +
  73 +EventEmitter.prototype.emit = function() {
  74 + var type = arguments[0];
  75 + var listeners = this._listeners[type];
  76 + if (!listeners) {
  77 + return;
  78 + }
  79 + // equivalent of Array.prototype.slice.call(arguments, 1);
  80 + var l = arguments.length;
  81 + var args = new Array(l - 1);
  82 + for (var ai = 1; ai < l; ai++) {
  83 + args[ai - 1] = arguments[ai];
  84 + }
  85 + for (var i = 0; i < listeners.length; i++) {
  86 + listeners[i].apply(this, args);
  87 + }
  88 +};
  89 +
  90 +EventEmitter.prototype.on = EventEmitter.prototype.addListener = EventTarget.prototype.addEventListener;
  91 +EventEmitter.prototype.removeListener = EventTarget.prototype.removeEventListener;
  92 +
  93 +module.exports.EventEmitter = EventEmitter;
  94 +
  95 +},{"./eventtarget":5,"inherits":56}],4:[function(require,module,exports){
  96 +'use strict';
  97 +
  98 +function Event(eventType) {
  99 + this.type = eventType;
  100 +}
  101 +
  102 +Event.prototype.initEvent = function(eventType, canBubble, cancelable) {
  103 + this.type = eventType;
  104 + this.bubbles = canBubble;
  105 + this.cancelable = cancelable;
  106 + this.timeStamp = +new Date();
  107 + return this;
  108 +};
  109 +
  110 +Event.prototype.stopPropagation = function() {};
  111 +Event.prototype.preventDefault = function() {};
  112 +
  113 +Event.CAPTURING_PHASE = 1;
  114 +Event.AT_TARGET = 2;
  115 +Event.BUBBLING_PHASE = 3;
  116 +
  117 +module.exports = Event;
  118 +
  119 +},{}],5:[function(require,module,exports){
  120 +'use strict';
  121 +
  122 +/* Simplified implementation of DOM2 EventTarget.
  123 + * http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget
  124 + */
  125 +
  126 +function EventTarget() {
  127 + this._listeners = {};
  128 +}
  129 +
  130 +EventTarget.prototype.addEventListener = function(eventType, listener) {
  131 + if (!(eventType in this._listeners)) {
  132 + this._listeners[eventType] = [];
  133 + }
  134 + var arr = this._listeners[eventType];
  135 + // #4
  136 + if (arr.indexOf(listener) === -1) {
  137 + // Make a copy so as not to interfere with a current dispatchEvent.
  138 + arr = arr.concat([listener]);
  139 + }
  140 + this._listeners[eventType] = arr;
  141 +};
  142 +
  143 +EventTarget.prototype.removeEventListener = function(eventType, listener) {
  144 + var arr = this._listeners[eventType];
  145 + if (!arr) {
  146 + return;
  147 + }
  148 + var idx = arr.indexOf(listener);
  149 + if (idx !== -1) {
  150 + if (arr.length > 1) {
  151 + // Make a copy so as not to interfere with a current dispatchEvent.
  152 + this._listeners[eventType] = arr.slice(0, idx).concat(arr.slice(idx + 1));
  153 + } else {
  154 + delete this._listeners[eventType];
  155 + }
  156 + return;
  157 + }
  158 +};
  159 +
  160 +EventTarget.prototype.dispatchEvent = function() {
  161 + var event = arguments[0];
  162 + var t = event.type;
  163 + // equivalent of Array.prototype.slice.call(arguments, 0);
  164 + var args = arguments.length === 1 ? [event] : Array.apply(null, arguments);
  165 + // TODO: This doesn't match the real behavior; per spec, onfoo get
  166 + // their place in line from the /first/ time they're set from
  167 + // non-null. Although WebKit bumps it to the end every time it's
  168 + // set.
  169 + if (this['on' + t]) {
  170 + this['on' + t].apply(this, args);
  171 + }
  172 + if (t in this._listeners) {
  173 + // Grab a reference to the listeners list. removeEventListener may alter the list.
  174 + var listeners = this._listeners[t];
  175 + for (var i = 0; i < listeners.length; i++) {
  176 + listeners[i].apply(this, args);
  177 + }
  178 + }
  179 +};
  180 +
  181 +module.exports = EventTarget;
  182 +
  183 +},{}],6:[function(require,module,exports){
  184 +'use strict';
  185 +
  186 +var inherits = require('inherits')
  187 + , Event = require('./event')
  188 + ;
  189 +
  190 +function TransportMessageEvent(data) {
  191 + Event.call(this);
  192 + this.initEvent('message', false, false);
  193 + this.data = data;
  194 +}
  195 +
  196 +inherits(TransportMessageEvent, Event);
  197 +
  198 +module.exports = TransportMessageEvent;
  199 +
  200 +},{"./event":4,"inherits":56}],7:[function(require,module,exports){
  201 +'use strict';
  202 +
  203 +var JSON3 = require('json3')
  204 + , iframeUtils = require('./utils/iframe')
  205 + ;
  206 +
  207 +function FacadeJS(transport) {
  208 + this._transport = transport;
  209 + transport.on('message', this._transportMessage.bind(this));
  210 + transport.on('close', this._transportClose.bind(this));
  211 +}
  212 +
  213 +FacadeJS.prototype._transportClose = function(code, reason) {
  214 + iframeUtils.postMessage('c', JSON3.stringify([code, reason]));
  215 +};
  216 +FacadeJS.prototype._transportMessage = function(frame) {
  217 + iframeUtils.postMessage('t', frame);
  218 +};
  219 +FacadeJS.prototype._send = function(data) {
  220 + this._transport.send(data);
  221 +};
  222 +FacadeJS.prototype._close = function() {
  223 + this._transport.close();
  224 + this._transport.removeAllListeners();
  225 +};
  226 +
  227 +module.exports = FacadeJS;
  228 +
  229 +},{"./utils/iframe":47,"json3":57}],8:[function(require,module,exports){
  230 +(function (process){
  231 +'use strict';
  232 +
  233 +var urlUtils = require('./utils/url')
  234 + , eventUtils = require('./utils/event')
  235 + , JSON3 = require('json3')
  236 + , FacadeJS = require('./facade')
  237 + , InfoIframeReceiver = require('./info-iframe-receiver')
  238 + , iframeUtils = require('./utils/iframe')
  239 + , loc = require('./location')
  240 + ;
  241 +
  242 +var debug = function() {};
  243 +if (process.env.NODE_ENV !== 'production') {
  244 + debug = require('debug')('sockjs-client:iframe-bootstrap');
  245 +}
  246 +
  247 +module.exports = function(SockJS, availableTransports) {
  248 + var transportMap = {};
  249 + availableTransports.forEach(function(at) {
  250 + if (at.facadeTransport) {
  251 + transportMap[at.facadeTransport.transportName] = at.facadeTransport;
  252 + }
  253 + });
  254 +
  255 + // hard-coded for the info iframe
  256 + // TODO see if we can make this more dynamic
  257 + transportMap[InfoIframeReceiver.transportName] = InfoIframeReceiver;
  258 + var parentOrigin;
  259 +
  260 + /* eslint-disable camelcase */
  261 + SockJS.bootstrap_iframe = function() {
  262 + /* eslint-enable camelcase */
  263 + var facade;
  264 + iframeUtils.currentWindowId = loc.hash.slice(1);
  265 + var onMessage = function(e) {
  266 + if (e.source !== parent) {
  267 + return;
  268 + }
  269 + if (typeof parentOrigin === 'undefined') {
  270 + parentOrigin = e.origin;
  271 + }
  272 + if (e.origin !== parentOrigin) {
  273 + return;
  274 + }
  275 +
  276 + var iframeMessage;
  277 + try {
  278 + iframeMessage = JSON3.parse(e.data);
  279 + } catch (ignored) {
  280 + debug('bad json', e.data);
  281 + return;
  282 + }
  283 +
  284 + if (iframeMessage.windowId !== iframeUtils.currentWindowId) {
  285 + return;
  286 + }
  287 + switch (iframeMessage.type) {
  288 + case 's':
  289 + var p;
  290 + try {
  291 + p = JSON3.parse(iframeMessage.data);
  292 + } catch (ignored) {
  293 + debug('bad json', iframeMessage.data);
  294 + break;
  295 + }
  296 + var version = p[0];
  297 + var transport = p[1];
  298 + var transUrl = p[2];
  299 + var baseUrl = p[3];
  300 + debug(version, transport, transUrl, baseUrl);
  301 + // change this to semver logic
  302 + if (version !== SockJS.version) {
  303 + throw new Error('Incompatible SockJS! Main site uses:' +
  304 + ' "' + version + '", the iframe:' +
  305 + ' "' + SockJS.version + '".');
  306 + }
  307 +
  308 + if (!urlUtils.isOriginEqual(transUrl, loc.href) ||
  309 + !urlUtils.isOriginEqual(baseUrl, loc.href)) {
  310 + throw new Error('Can\'t connect to different domain from within an ' +
  311 + 'iframe. (' + loc.href + ', ' + transUrl + ', ' + baseUrl + ')');
  312 + }
  313 + facade = new FacadeJS(new transportMap[transport](transUrl, baseUrl));
  314 + break;
  315 + case 'm':
  316 + facade._send(iframeMessage.data);
  317 + break;
  318 + case 'c':
  319 + if (facade) {
  320 + facade._close();
  321 + }
  322 + facade = null;
  323 + break;
  324 + }
  325 + };
  326 +
  327 + eventUtils.attachEvent('message', onMessage);
  328 +
  329 + // Start
  330 + iframeUtils.postMessage('s');
  331 + };
  332 +};
  333 +
  334 +}).call(this,{ env: {} })
  335 +
  336 +},{"./facade":7,"./info-iframe-receiver":10,"./location":13,"./utils/event":46,"./utils/iframe":47,"./utils/url":52,"debug":54,"json3":57}],9:[function(require,module,exports){
  337 +(function (process){
  338 +'use strict';
  339 +
  340 +var EventEmitter = require('events').EventEmitter
  341 + , inherits = require('inherits')
  342 + , JSON3 = require('json3')
  343 + , objectUtils = require('./utils/object')
  344 + ;
  345 +
  346 +var debug = function() {};
  347 +if (process.env.NODE_ENV !== 'production') {
  348 + debug = require('debug')('sockjs-client:info-ajax');
  349 +}
  350 +
  351 +function InfoAjax(url, AjaxObject) {
  352 + EventEmitter.call(this);
  353 +
  354 + var self = this;
  355 + var t0 = +new Date();
  356 + this.xo = new AjaxObject('GET', url);
  357 +
  358 + this.xo.once('finish', function(status, text) {
  359 + var info, rtt;
  360 + if (status === 200) {
  361 + rtt = (+new Date()) - t0;
  362 + if (text) {
  363 + try {
  364 + info = JSON3.parse(text);
  365 + } catch (e) {
  366 + debug('bad json', text);
  367 + }
  368 + }
  369 +
  370 + if (!objectUtils.isObject(info)) {
  371 + info = {};
  372 + }
  373 + }
  374 + self.emit('finish', info, rtt);
  375 + self.removeAllListeners();
  376 + });
  377 +}
  378 +
  379 +inherits(InfoAjax, EventEmitter);
  380 +
  381 +InfoAjax.prototype.close = function() {
  382 + this.removeAllListeners();
  383 + this.xo.close();
  384 +};
  385 +
  386 +module.exports = InfoAjax;
  387 +
  388 +}).call(this,{ env: {} })
  389 +
  390 +},{"./utils/object":49,"debug":54,"events":3,"inherits":56,"json3":57}],10:[function(require,module,exports){
  391 +'use strict';
  392 +
  393 +var inherits = require('inherits')
  394 + , EventEmitter = require('events').EventEmitter
  395 + , JSON3 = require('json3')
  396 + , XHRLocalObject = require('./transport/sender/xhr-local')
  397 + , InfoAjax = require('./info-ajax')
  398 + ;
  399 +
  400 +function InfoReceiverIframe(transUrl) {
  401 + var self = this;
  402 + EventEmitter.call(this);
  403 +
  404 + this.ir = new InfoAjax(transUrl, XHRLocalObject);
  405 + this.ir.once('finish', function(info, rtt) {
  406 + self.ir = null;
  407 + self.emit('message', JSON3.stringify([info, rtt]));
  408 + });
  409 +}
  410 +
  411 +inherits(InfoReceiverIframe, EventEmitter);
  412 +
  413 +InfoReceiverIframe.transportName = 'iframe-info-receiver';
  414 +
  415 +InfoReceiverIframe.prototype.close = function() {
  416 + if (this.ir) {
  417 + this.ir.close();
  418 + this.ir = null;
  419 + }
  420 + this.removeAllListeners();
  421 +};
  422 +
  423 +module.exports = InfoReceiverIframe;
  424 +
  425 +},{"./info-ajax":9,"./transport/sender/xhr-local":37,"events":3,"inherits":56,"json3":57}],11:[function(require,module,exports){
  426 +(function (process,global){
  427 +'use strict';
  428 +
  429 +var EventEmitter = require('events').EventEmitter
  430 + , inherits = require('inherits')
  431 + , JSON3 = require('json3')
  432 + , utils = require('./utils/event')
  433 + , IframeTransport = require('./transport/iframe')
  434 + , InfoReceiverIframe = require('./info-iframe-receiver')
  435 + ;
  436 +
  437 +var debug = function() {};
  438 +if (process.env.NODE_ENV !== 'production') {
  439 + debug = require('debug')('sockjs-client:info-iframe');
  440 +}
  441 +
  442 +function InfoIframe(baseUrl, url) {
  443 + var self = this;
  444 + EventEmitter.call(this);
  445 +
  446 + var go = function() {
  447 + var ifr = self.ifr = new IframeTransport(InfoReceiverIframe.transportName, url, baseUrl);
  448 +
  449 + ifr.once('message', function(msg) {
  450 + if (msg) {
  451 + var d;
  452 + try {
  453 + d = JSON3.parse(msg);
  454 + } catch (e) {
  455 + debug('bad json', msg);
  456 + self.emit('finish');
  457 + self.close();
  458 + return;
  459 + }
  460 +
  461 + var info = d[0], rtt = d[1];
  462 + self.emit('finish', info, rtt);
  463 + }
  464 + self.close();
  465 + });
  466 +
  467 + ifr.once('close', function() {
  468 + self.emit('finish');
  469 + self.close();
  470 + });
  471 + };
  472 +
  473 + // TODO this seems the same as the 'needBody' from transports
  474 + if (!global.document.body) {
  475 + utils.attachEvent('load', go);
  476 + } else {
  477 + go();
  478 + }
  479 +}
  480 +
  481 +inherits(InfoIframe, EventEmitter);
  482 +
  483 +InfoIframe.enabled = function() {
  484 + return IframeTransport.enabled();
  485 +};
  486 +
  487 +InfoIframe.prototype.close = function() {
  488 + if (this.ifr) {
  489 + this.ifr.close();
  490 + }
  491 + this.removeAllListeners();
  492 + this.ifr = null;
  493 +};
  494 +
  495 +module.exports = InfoIframe;
  496 +
  497 +}).call(this,{ env: {} },typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  498 +
  499 +},{"./info-iframe-receiver":10,"./transport/iframe":22,"./utils/event":46,"debug":54,"events":3,"inherits":56,"json3":57}],12:[function(require,module,exports){
  500 +(function (process){
  501 +'use strict';
  502 +
  503 +var EventEmitter = require('events').EventEmitter
  504 + , inherits = require('inherits')
  505 + , urlUtils = require('./utils/url')
  506 + , XDR = require('./transport/sender/xdr')
  507 + , XHRCors = require('./transport/sender/xhr-cors')
  508 + , XHRLocal = require('./transport/sender/xhr-local')
  509 + , XHRFake = require('./transport/sender/xhr-fake')
  510 + , InfoIframe = require('./info-iframe')
  511 + , InfoAjax = require('./info-ajax')
  512 + ;
  513 +
  514 +var debug = function() {};
  515 +if (process.env.NODE_ENV !== 'production') {
  516 + debug = require('debug')('sockjs-client:info-receiver');
  517 +}
  518 +
  519 +function InfoReceiver(baseUrl, urlInfo) {
  520 + debug(baseUrl);
  521 + var self = this;
  522 + EventEmitter.call(this);
  523 +
  524 + setTimeout(function() {
  525 + self.doXhr(baseUrl, urlInfo);
  526 + }, 0);
  527 +}
  528 +
  529 +inherits(InfoReceiver, EventEmitter);
  530 +
  531 +// TODO this is currently ignoring the list of available transports and the whitelist
  532 +
  533 +InfoReceiver._getReceiver = function(baseUrl, url, urlInfo) {
  534 + // determine method of CORS support (if needed)
  535 + if (urlInfo.sameOrigin) {
  536 + return new InfoAjax(url, XHRLocal);
  537 + }
  538 + if (XHRCors.enabled) {
  539 + return new InfoAjax(url, XHRCors);
  540 + }
  541 + if (XDR.enabled && urlInfo.sameScheme) {
  542 + return new InfoAjax(url, XDR);
  543 + }
  544 + if (InfoIframe.enabled()) {
  545 + return new InfoIframe(baseUrl, url);
  546 + }
  547 + return new InfoAjax(url, XHRFake);
  548 +};
  549 +
  550 +InfoReceiver.prototype.doXhr = function(baseUrl, urlInfo) {
  551 + var self = this
  552 + , url = urlUtils.addPath(baseUrl, '/info')
  553 + ;
  554 + debug('doXhr', url);
  555 +
  556 + this.xo = InfoReceiver._getReceiver(baseUrl, url, urlInfo);
  557 +
  558 + this.timeoutRef = setTimeout(function() {
  559 + debug('timeout');
  560 + self._cleanup(false);
  561 + self.emit('finish');
  562 + }, InfoReceiver.timeout);
  563 +
  564 + this.xo.once('finish', function(info, rtt) {
  565 + debug('finish', info, rtt);
  566 + self._cleanup(true);
  567 + self.emit('finish', info, rtt);
  568 + });
  569 +};
  570 +
  571 +InfoReceiver.prototype._cleanup = function(wasClean) {
  572 + debug('_cleanup');
  573 + clearTimeout(this.timeoutRef);
  574 + this.timeoutRef = null;
  575 + if (!wasClean && this.xo) {
  576 + this.xo.close();
  577 + }
  578 + this.xo = null;
  579 +};
  580 +
  581 +InfoReceiver.prototype.close = function() {
  582 + debug('close');
  583 + this.removeAllListeners();
  584 + this._cleanup(false);
  585 +};
  586 +
  587 +InfoReceiver.timeout = 8000;
  588 +
  589 +module.exports = InfoReceiver;
  590 +
  591 +}).call(this,{ env: {} })
  592 +
  593 +},{"./info-ajax":9,"./info-iframe":11,"./transport/sender/xdr":34,"./transport/sender/xhr-cors":35,"./transport/sender/xhr-fake":36,"./transport/sender/xhr-local":37,"./utils/url":52,"debug":54,"events":3,"inherits":56}],13:[function(require,module,exports){
  594 +(function (global){
  595 +'use strict';
  596 +
  597 +module.exports = global.location || {
  598 + origin: 'http://localhost:80'
  599 +, protocol: 'http'
  600 +, host: 'localhost'
  601 +, port: 80
  602 +, href: 'http://localhost/'
  603 +, hash: ''
  604 +};
  605 +
  606 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  607 +
  608 +},{}],14:[function(require,module,exports){
  609 +(function (process,global){
  610 +'use strict';
  611 +
  612 +require('./shims');
  613 +
  614 +var URL = require('url-parse')
  615 + , inherits = require('inherits')
  616 + , JSON3 = require('json3')
  617 + , random = require('./utils/random')
  618 + , escape = require('./utils/escape')
  619 + , urlUtils = require('./utils/url')
  620 + , eventUtils = require('./utils/event')
  621 + , transport = require('./utils/transport')
  622 + , objectUtils = require('./utils/object')
  623 + , browser = require('./utils/browser')
  624 + , log = require('./utils/log')
  625 + , Event = require('./event/event')
  626 + , EventTarget = require('./event/eventtarget')
  627 + , loc = require('./location')
  628 + , CloseEvent = require('./event/close')
  629 + , TransportMessageEvent = require('./event/trans-message')
  630 + , InfoReceiver = require('./info-receiver')
  631 + ;
  632 +
  633 +var debug = function() {};
  634 +if (process.env.NODE_ENV !== 'production') {
  635 + debug = require('debug')('sockjs-client:main');
  636 +}
  637 +
  638 +var transports;
  639 +
  640 +// follow constructor steps defined at http://dev.w3.org/html5/websockets/#the-websocket-interface
  641 +function SockJS(url, protocols, options) {
  642 + if (!(this instanceof SockJS)) {
  643 + return new SockJS(url, protocols, options);
  644 + }
  645 + if (arguments.length < 1) {
  646 + throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");
  647 + }
  648 + EventTarget.call(this);
  649 +
  650 + this.readyState = SockJS.CONNECTING;
  651 + this.extensions = '';
  652 + this.protocol = '';
  653 +
  654 + // non-standard extension
  655 + options = options || {};
  656 + if (options.protocols_whitelist) {
  657 + log.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead.");
  658 + }
  659 + this._transportsWhitelist = options.transports;
  660 + this._transportOptions = options.transportOptions || {};
  661 +
  662 + var sessionId = options.sessionId || 8;
  663 + if (typeof sessionId === 'function') {
  664 + this._generateSessionId = sessionId;
  665 + } else if (typeof sessionId === 'number') {
  666 + this._generateSessionId = function() {
  667 + return random.string(sessionId);
  668 + };
  669 + } else {
  670 + throw new TypeError('If sessionId is used in the options, it needs to be a number or a function.');
  671 + }
  672 +
  673 + this._server = options.server || random.numberString(1000);
  674 +
  675 + // Step 1 of WS spec - parse and validate the url. Issue #8
  676 + var parsedUrl = new URL(url);
  677 + if (!parsedUrl.host || !parsedUrl.protocol) {
  678 + throw new SyntaxError("The URL '" + url + "' is invalid");
  679 + } else if (parsedUrl.hash) {
  680 + throw new SyntaxError('The URL must not contain a fragment');
  681 + } else if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
  682 + throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '" + parsedUrl.protocol + "' is not allowed.");
  683 + }
  684 +
  685 + var secure = parsedUrl.protocol === 'https:';
  686 + // Step 2 - don't allow secure origin with an insecure protocol
  687 + if (loc.protocol === 'https' && !secure) {
  688 + throw new Error('SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS');
  689 + }
  690 +
  691 + // Step 3 - check port access - no need here
  692 + // Step 4 - parse protocols argument
  693 + if (!protocols) {
  694 + protocols = [];
  695 + } else if (!Array.isArray(protocols)) {
  696 + protocols = [protocols];
  697 + }
  698 +
  699 + // Step 5 - check protocols argument
  700 + var sortedProtocols = protocols.sort();
  701 + sortedProtocols.forEach(function(proto, i) {
  702 + if (!proto) {
  703 + throw new SyntaxError("The protocols entry '" + proto + "' is invalid.");
  704 + }
  705 + if (i < (sortedProtocols.length - 1) && proto === sortedProtocols[i + 1]) {
  706 + throw new SyntaxError("The protocols entry '" + proto + "' is duplicated.");
  707 + }
  708 + });
  709 +
  710 + // Step 6 - convert origin
  711 + var o = urlUtils.getOrigin(loc.href);
  712 + this._origin = o ? o.toLowerCase() : null;
  713 +
  714 + // remove the trailing slash
  715 + parsedUrl.set('pathname', parsedUrl.pathname.replace(/\/+$/, ''));
  716 +
  717 + // store the sanitized url
  718 + this.url = parsedUrl.href;
  719 + debug('using url', this.url);
  720 +
  721 + // Step 7 - start connection in background
  722 + // obtain server info
  723 + // http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html#section-26
  724 + this._urlInfo = {
  725 + nullOrigin: !browser.hasDomain()
  726 + , sameOrigin: urlUtils.isOriginEqual(this.url, loc.href)
  727 + , sameScheme: urlUtils.isSchemeEqual(this.url, loc.href)
  728 + };
  729 +
  730 + this._ir = new InfoReceiver(this.url, this._urlInfo);
  731 + this._ir.once('finish', this._receiveInfo.bind(this));
  732 +}
  733 +
  734 +inherits(SockJS, EventTarget);
  735 +
  736 +function userSetCode(code) {
  737 + return code === 1000 || (code >= 3000 && code <= 4999);
  738 +}
  739 +
  740 +SockJS.prototype.close = function(code, reason) {
  741 + // Step 1
  742 + if (code && !userSetCode(code)) {
  743 + throw new Error('InvalidAccessError: Invalid code');
  744 + }
  745 + // Step 2.4 states the max is 123 bytes, but we are just checking length
  746 + if (reason && reason.length > 123) {
  747 + throw new SyntaxError('reason argument has an invalid length');
  748 + }
  749 +
  750 + // Step 3.1
  751 + if (this.readyState === SockJS.CLOSING || this.readyState === SockJS.CLOSED) {
  752 + return;
  753 + }
  754 +
  755 + // TODO look at docs to determine how to set this
  756 + var wasClean = true;
  757 + this._close(code || 1000, reason || 'Normal closure', wasClean);
  758 +};
  759 +
  760 +SockJS.prototype.send = function(data) {
  761 + // #13 - convert anything non-string to string
  762 + // TODO this currently turns objects into [object Object]
  763 + if (typeof data !== 'string') {
  764 + data = '' + data;
  765 + }
  766 + if (this.readyState === SockJS.CONNECTING) {
  767 + throw new Error('InvalidStateError: The connection has not been established yet');
  768 + }
  769 + if (this.readyState !== SockJS.OPEN) {
  770 + return;
  771 + }
  772 + this._transport.send(escape.quote(data));
  773 +};
  774 +
  775 +SockJS.version = require('./version');
  776 +
  777 +SockJS.CONNECTING = 0;
  778 +SockJS.OPEN = 1;
  779 +SockJS.CLOSING = 2;
  780 +SockJS.CLOSED = 3;
  781 +
  782 +SockJS.prototype._receiveInfo = function(info, rtt) {
  783 + debug('_receiveInfo', rtt);
  784 + this._ir = null;
  785 + if (!info) {
  786 + this._close(1002, 'Cannot connect to server');
  787 + return;
  788 + }
  789 +
  790 + // establish a round-trip timeout (RTO) based on the
  791 + // round-trip time (RTT)
  792 + this._rto = this.countRTO(rtt);
  793 + // allow server to override url used for the actual transport
  794 + this._transUrl = info.base_url ? info.base_url : this.url;
  795 + info = objectUtils.extend(info, this._urlInfo);
  796 + debug('info', info);
  797 + // determine list of desired and supported transports
  798 + var enabledTransports = transports.filterToEnabled(this._transportsWhitelist, info);
  799 + this._transports = enabledTransports.main;
  800 + debug(this._transports.length + ' enabled transports');
  801 +
  802 + this._connect();
  803 +};
  804 +
  805 +SockJS.prototype._connect = function() {
  806 + for (var Transport = this._transports.shift(); Transport; Transport = this._transports.shift()) {
  807 + debug('attempt', Transport.transportName);
  808 + if (Transport.needBody) {
  809 + if (!global.document.body ||
  810 + (typeof global.document.readyState !== 'undefined' &&
  811 + global.document.readyState !== 'complete' &&
  812 + global.document.readyState !== 'interactive')) {
  813 + debug('waiting for body');
  814 + this._transports.unshift(Transport);
  815 + eventUtils.attachEvent('load', this._connect.bind(this));
  816 + return;
  817 + }
  818 + }
  819 +
  820 + // calculate timeout based on RTO and round trips. Default to 5s
  821 + var timeoutMs = (this._rto * Transport.roundTrips) || 5000;
  822 + this._transportTimeoutId = setTimeout(this._transportTimeout.bind(this), timeoutMs);
  823 + debug('using timeout', timeoutMs);
  824 +
  825 + var transportUrl = urlUtils.addPath(this._transUrl, '/' + this._server + '/' + this._generateSessionId());
  826 + var options = this._transportOptions[Transport.transportName];
  827 + debug('transport url', transportUrl);
  828 + var transportObj = new Transport(transportUrl, this._transUrl, options);
  829 + transportObj.on('message', this._transportMessage.bind(this));
  830 + transportObj.once('close', this._transportClose.bind(this));
  831 + transportObj.transportName = Transport.transportName;
  832 + this._transport = transportObj;
  833 +
  834 + return;
  835 + }
  836 + this._close(2000, 'All transports failed', false);
  837 +};
  838 +
  839 +SockJS.prototype._transportTimeout = function() {
  840 + debug('_transportTimeout');
  841 + if (this.readyState === SockJS.CONNECTING) {
  842 + this._transportClose(2007, 'Transport timed out');
  843 + }
  844 +};
  845 +
  846 +SockJS.prototype._transportMessage = function(msg) {
  847 + debug('_transportMessage', msg);
  848 + var self = this
  849 + , type = msg.slice(0, 1)
  850 + , content = msg.slice(1)
  851 + , payload
  852 + ;
  853 +
  854 + // first check for messages that don't need a payload
  855 + switch (type) {
  856 + case 'o':
  857 + this._open();
  858 + return;
  859 + case 'h':
  860 + this.dispatchEvent(new Event('heartbeat'));
  861 + debug('heartbeat', this.transport);
  862 + return;
  863 + }
  864 +
  865 + if (content) {
  866 + try {
  867 + payload = JSON3.parse(content);
  868 + } catch (e) {
  869 + debug('bad json', content);
  870 + }
  871 + }
  872 +
  873 + if (typeof payload === 'undefined') {
  874 + debug('empty payload', content);
  875 + return;
  876 + }
  877 +
  878 + switch (type) {
  879 + case 'a':
  880 + if (Array.isArray(payload)) {
  881 + payload.forEach(function(p) {
  882 + debug('message', self.transport, p);
  883 + self.dispatchEvent(new TransportMessageEvent(p));
  884 + });
  885 + }
  886 + break;
  887 + case 'm':
  888 + debug('message', this.transport, payload);
  889 + this.dispatchEvent(new TransportMessageEvent(payload));
  890 + break;
  891 + case 'c':
  892 + if (Array.isArray(payload) && payload.length === 2) {
  893 + this._close(payload[0], payload[1], true);
  894 + }
  895 + break;
  896 + }
  897 +};
  898 +
  899 +SockJS.prototype._transportClose = function(code, reason) {
  900 + debug('_transportClose', this.transport, code, reason);
  901 + if (this._transport) {
  902 + this._transport.removeAllListeners();
  903 + this._transport = null;
  904 + this.transport = null;
  905 + }
  906 +
  907 + if (!userSetCode(code) && code !== 2000 && this.readyState === SockJS.CONNECTING) {
  908 + this._connect();
  909 + return;
  910 + }
  911 +
  912 + this._close(code, reason);
  913 +};
  914 +
  915 +SockJS.prototype._open = function() {
  916 + debug('_open', this._transport.transportName, this.readyState);
  917 + if (this.readyState === SockJS.CONNECTING) {
  918 + if (this._transportTimeoutId) {
  919 + clearTimeout(this._transportTimeoutId);
  920 + this._transportTimeoutId = null;
  921 + }
  922 + this.readyState = SockJS.OPEN;
  923 + this.transport = this._transport.transportName;
  924 + this.dispatchEvent(new Event('open'));
  925 + debug('connected', this.transport);
  926 + } else {
  927 + // The server might have been restarted, and lost track of our
  928 + // connection.
  929 + this._close(1006, 'Server lost session');
  930 + }
  931 +};
  932 +
  933 +SockJS.prototype._close = function(code, reason, wasClean) {
  934 + debug('_close', this.transport, code, reason, wasClean, this.readyState);
  935 + var forceFail = false;
  936 +
  937 + if (this._ir) {
  938 + forceFail = true;
  939 + this._ir.close();
  940 + this._ir = null;
  941 + }
  942 + if (this._transport) {
  943 + this._transport.close();
  944 + this._transport = null;
  945 + this.transport = null;
  946 + }
  947 +
  948 + if (this.readyState === SockJS.CLOSED) {
  949 + throw new Error('InvalidStateError: SockJS has already been closed');
  950 + }
  951 +
  952 + this.readyState = SockJS.CLOSING;
  953 + setTimeout(function() {
  954 + this.readyState = SockJS.CLOSED;
  955 +
  956 + if (forceFail) {
  957 + this.dispatchEvent(new Event('error'));
  958 + }
  959 +
  960 + var e = new CloseEvent('close');
  961 + e.wasClean = wasClean || false;
  962 + e.code = code || 1000;
  963 + e.reason = reason;
  964 +
  965 + this.dispatchEvent(e);
  966 + this.onmessage = this.onclose = this.onerror = null;
  967 + debug('disconnected');
  968 + }.bind(this), 0);
  969 +};
  970 +
  971 +// See: http://www.erg.abdn.ac.uk/~gerrit/dccp/notes/ccid2/rto_estimator/
  972 +// and RFC 2988.
  973 +SockJS.prototype.countRTO = function(rtt) {
  974 + // In a local environment, when using IE8/9 and the `jsonp-polling`
  975 + // transport the time needed to establish a connection (the time that pass
  976 + // from the opening of the transport to the call of `_dispatchOpen`) is
  977 + // around 200msec (the lower bound used in the article above) and this
  978 + // causes spurious timeouts. For this reason we calculate a value slightly
  979 + // larger than that used in the article.
  980 + if (rtt > 100) {
  981 + return 4 * rtt; // rto > 400msec
  982 + }
  983 + return 300 + rtt; // 300msec < rto <= 400msec
  984 +};
  985 +
  986 +module.exports = function(availableTransports) {
  987 + transports = transport(availableTransports);
  988 + require('./iframe-bootstrap')(SockJS, availableTransports);
  989 + return SockJS;
  990 +};
  991 +
  992 +}).call(this,{ env: {} },typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  993 +
  994 +},{"./event/close":2,"./event/event":4,"./event/eventtarget":5,"./event/trans-message":6,"./iframe-bootstrap":8,"./info-receiver":12,"./location":13,"./shims":15,"./utils/browser":44,"./utils/escape":45,"./utils/event":46,"./utils/log":48,"./utils/object":49,"./utils/random":50,"./utils/transport":51,"./utils/url":52,"./version":53,"debug":54,"inherits":56,"json3":57,"url-parse":61}],15:[function(require,module,exports){
  995 +/* eslint-disable */
  996 +/* jscs: disable */
  997 +'use strict';
  998 +
  999 +// pulled specific shims from https://github.com/es-shims/es5-shim
  1000 +
  1001 +var ArrayPrototype = Array.prototype;
  1002 +var ObjectPrototype = Object.prototype;
  1003 +var FunctionPrototype = Function.prototype;
  1004 +var StringPrototype = String.prototype;
  1005 +var array_slice = ArrayPrototype.slice;
  1006 +
  1007 +var _toString = ObjectPrototype.toString;
  1008 +var isFunction = function (val) {
  1009 + return ObjectPrototype.toString.call(val) === '[object Function]';
  1010 +};
  1011 +var isArray = function isArray(obj) {
  1012 + return _toString.call(obj) === '[object Array]';
  1013 +};
  1014 +var isString = function isString(obj) {
  1015 + return _toString.call(obj) === '[object String]';
  1016 +};
  1017 +
  1018 +var supportsDescriptors = Object.defineProperty && (function () {
  1019 + try {
  1020 + Object.defineProperty({}, 'x', {});
  1021 + return true;
  1022 + } catch (e) { /* this is ES3 */
  1023 + return false;
  1024 + }
  1025 +}());
  1026 +
  1027 +// Define configurable, writable and non-enumerable props
  1028 +// if they don't exist.
  1029 +var defineProperty;
  1030 +if (supportsDescriptors) {
  1031 + defineProperty = function (object, name, method, forceAssign) {
  1032 + if (!forceAssign && (name in object)) { return; }
  1033 + Object.defineProperty(object, name, {
  1034 + configurable: true,
  1035 + enumerable: false,
  1036 + writable: true,
  1037 + value: method
  1038 + });
  1039 + };
  1040 +} else {
  1041 + defineProperty = function (object, name, method, forceAssign) {
  1042 + if (!forceAssign && (name in object)) { return; }
  1043 + object[name] = method;
  1044 + };
  1045 +}
  1046 +var defineProperties = function (object, map, forceAssign) {
  1047 + for (var name in map) {
  1048 + if (ObjectPrototype.hasOwnProperty.call(map, name)) {
  1049 + defineProperty(object, name, map[name], forceAssign);
  1050 + }
  1051 + }
  1052 +};
  1053 +
  1054 +var toObject = function (o) {
  1055 + if (o == null) { // this matches both null and undefined
  1056 + throw new TypeError("can't convert " + o + ' to object');
  1057 + }
  1058 + return Object(o);
  1059 +};
  1060 +
  1061 +//
  1062 +// Util
  1063 +// ======
  1064 +//
  1065 +
  1066 +// ES5 9.4
  1067 +// http://es5.github.com/#x9.4
  1068 +// http://jsperf.com/to-integer
  1069 +
  1070 +function toInteger(num) {
  1071 + var n = +num;
  1072 + if (n !== n) { // isNaN
  1073 + n = 0;
  1074 + } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
  1075 + n = (n > 0 || -1) * Math.floor(Math.abs(n));
  1076 + }
  1077 + return n;
  1078 +}
  1079 +
  1080 +function ToUint32(x) {
  1081 + return x >>> 0;
  1082 +}
  1083 +
  1084 +//
  1085 +// Function
  1086 +// ========
  1087 +//
  1088 +
  1089 +// ES-5 15.3.4.5
  1090 +// http://es5.github.com/#x15.3.4.5
  1091 +
  1092 +function Empty() {}
  1093 +
  1094 +defineProperties(FunctionPrototype, {
  1095 + bind: function bind(that) { // .length is 1
  1096 + // 1. Let Target be the this value.
  1097 + var target = this;
  1098 + // 2. If IsCallable(Target) is false, throw a TypeError exception.
  1099 + if (!isFunction(target)) {
  1100 + throw new TypeError('Function.prototype.bind called on incompatible ' + target);
  1101 + }
  1102 + // 3. Let A be a new (possibly empty) internal list of all of the
  1103 + // argument values provided after thisArg (arg1, arg2 etc), in order.
  1104 + // XXX slicedArgs will stand in for "A" if used
  1105 + var args = array_slice.call(arguments, 1); // for normal call
  1106 + // 4. Let F be a new native ECMAScript object.
  1107 + // 11. Set the [[Prototype]] internal property of F to the standard
  1108 + // built-in Function prototype object as specified in 15.3.3.1.
  1109 + // 12. Set the [[Call]] internal property of F as described in
  1110 + // 15.3.4.5.1.
  1111 + // 13. Set the [[Construct]] internal property of F as described in
  1112 + // 15.3.4.5.2.
  1113 + // 14. Set the [[HasInstance]] internal property of F as described in
  1114 + // 15.3.4.5.3.
  1115 + var binder = function () {
  1116 +
  1117 + if (this instanceof bound) {
  1118 + // 15.3.4.5.2 [[Construct]]
  1119 + // When the [[Construct]] internal method of a function object,
  1120 + // F that was created using the bind function is called with a
  1121 + // list of arguments ExtraArgs, the following steps are taken:
  1122 + // 1. Let target be the value of F's [[TargetFunction]]
  1123 + // internal property.
  1124 + // 2. If target has no [[Construct]] internal method, a
  1125 + // TypeError exception is thrown.
  1126 + // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
  1127 + // property.
  1128 + // 4. Let args be a new list containing the same values as the
  1129 + // list boundArgs in the same order followed by the same
  1130 + // values as the list ExtraArgs in the same order.
  1131 + // 5. Return the result of calling the [[Construct]] internal
  1132 + // method of target providing args as the arguments.
  1133 +
  1134 + var result = target.apply(
  1135 + this,
  1136 + args.concat(array_slice.call(arguments))
  1137 + );
  1138 + if (Object(result) === result) {
  1139 + return result;
  1140 + }
  1141 + return this;
  1142 +
  1143 + } else {
  1144 + // 15.3.4.5.1 [[Call]]
  1145 + // When the [[Call]] internal method of a function object, F,
  1146 + // which was created using the bind function is called with a
  1147 + // this value and a list of arguments ExtraArgs, the following
  1148 + // steps are taken:
  1149 + // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
  1150 + // property.
  1151 + // 2. Let boundThis be the value of F's [[BoundThis]] internal
  1152 + // property.
  1153 + // 3. Let target be the value of F's [[TargetFunction]] internal
  1154 + // property.
  1155 + // 4. Let args be a new list containing the same values as the
  1156 + // list boundArgs in the same order followed by the same
  1157 + // values as the list ExtraArgs in the same order.
  1158 + // 5. Return the result of calling the [[Call]] internal method
  1159 + // of target providing boundThis as the this value and
  1160 + // providing args as the arguments.
  1161 +
  1162 + // equiv: target.call(this, ...boundArgs, ...args)
  1163 + return target.apply(
  1164 + that,
  1165 + args.concat(array_slice.call(arguments))
  1166 + );
  1167 +
  1168 + }
  1169 +
  1170 + };
  1171 +
  1172 + // 15. If the [[Class]] internal property of Target is "Function", then
  1173 + // a. Let L be the length property of Target minus the length of A.
  1174 + // b. Set the length own property of F to either 0 or L, whichever is
  1175 + // larger.
  1176 + // 16. Else set the length own property of F to 0.
  1177 +
  1178 + var boundLength = Math.max(0, target.length - args.length);
  1179 +
  1180 + // 17. Set the attributes of the length own property of F to the values
  1181 + // specified in 15.3.5.1.
  1182 + var boundArgs = [];
  1183 + for (var i = 0; i < boundLength; i++) {
  1184 + boundArgs.push('$' + i);
  1185 + }
  1186 +
  1187 + // XXX Build a dynamic function with desired amount of arguments is the only
  1188 + // way to set the length property of a function.
  1189 + // In environments where Content Security Policies enabled (Chrome extensions,
  1190 + // for ex.) all use of eval or Function costructor throws an exception.
  1191 + // However in all of these environments Function.prototype.bind exists
  1192 + // and so this code will never be executed.
  1193 + var bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this, arguments); }')(binder);
  1194 +
  1195 + if (target.prototype) {
  1196 + Empty.prototype = target.prototype;
  1197 + bound.prototype = new Empty();
  1198 + // Clean up dangling references.
  1199 + Empty.prototype = null;
  1200 + }
  1201 +
  1202 + // TODO
  1203 + // 18. Set the [[Extensible]] internal property of F to true.
  1204 +
  1205 + // TODO
  1206 + // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
  1207 + // 20. Call the [[DefineOwnProperty]] internal method of F with
  1208 + // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
  1209 + // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
  1210 + // false.
  1211 + // 21. Call the [[DefineOwnProperty]] internal method of F with
  1212 + // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
  1213 + // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
  1214 + // and false.
  1215 +
  1216 + // TODO
  1217 + // NOTE Function objects created using Function.prototype.bind do not
  1218 + // have a prototype property or the [[Code]], [[FormalParameters]], and
  1219 + // [[Scope]] internal properties.
  1220 + // XXX can't delete prototype in pure-js.
  1221 +
  1222 + // 22. Return F.
  1223 + return bound;
  1224 + }
  1225 +});
  1226 +
  1227 +//
  1228 +// Array
  1229 +// =====
  1230 +//
  1231 +
  1232 +// ES5 15.4.3.2
  1233 +// http://es5.github.com/#x15.4.3.2
  1234 +// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
  1235 +defineProperties(Array, { isArray: isArray });
  1236 +
  1237 +
  1238 +var boxedString = Object('a');
  1239 +var splitString = boxedString[0] !== 'a' || !(0 in boxedString);
  1240 +
  1241 +var properlyBoxesContext = function properlyBoxed(method) {
  1242 + // Check node 0.6.21 bug where third parameter is not boxed
  1243 + var properlyBoxesNonStrict = true;
  1244 + var properlyBoxesStrict = true;
  1245 + if (method) {
  1246 + method.call('foo', function (_, __, context) {
  1247 + if (typeof context !== 'object') { properlyBoxesNonStrict = false; }
  1248 + });
  1249 +
  1250 + method.call([1], function () {
  1251 + 'use strict';
  1252 + properlyBoxesStrict = typeof this === 'string';
  1253 + }, 'x');
  1254 + }
  1255 + return !!method && properlyBoxesNonStrict && properlyBoxesStrict;
  1256 +};
  1257 +
  1258 +defineProperties(ArrayPrototype, {
  1259 + forEach: function forEach(fun /*, thisp*/) {
  1260 + var object = toObject(this),
  1261 + self = splitString && isString(this) ? this.split('') : object,
  1262 + thisp = arguments[1],
  1263 + i = -1,
  1264 + length = self.length >>> 0;
  1265 +
  1266 + // If no callback function or if callback is not a callable function
  1267 + if (!isFunction(fun)) {
  1268 + throw new TypeError(); // TODO message
  1269 + }
  1270 +
  1271 + while (++i < length) {
  1272 + if (i in self) {
  1273 + // Invoke the callback function with call, passing arguments:
  1274 + // context, property value, property key, thisArg object
  1275 + // context
  1276 + fun.call(thisp, self[i], i, object);
  1277 + }
  1278 + }
  1279 + }
  1280 +}, !properlyBoxesContext(ArrayPrototype.forEach));
  1281 +
  1282 +// ES5 15.4.4.14
  1283 +// http://es5.github.com/#x15.4.4.14
  1284 +// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
  1285 +var hasFirefox2IndexOfBug = Array.prototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
  1286 +defineProperties(ArrayPrototype, {
  1287 + indexOf: function indexOf(sought /*, fromIndex */ ) {
  1288 + var self = splitString && isString(this) ? this.split('') : toObject(this),
  1289 + length = self.length >>> 0;
  1290 +
  1291 + if (!length) {
  1292 + return -1;
  1293 + }
  1294 +
  1295 + var i = 0;
  1296 + if (arguments.length > 1) {
  1297 + i = toInteger(arguments[1]);
  1298 + }
  1299 +
  1300 + // handle negative indices
  1301 + i = i >= 0 ? i : Math.max(0, length + i);
  1302 + for (; i < length; i++) {
  1303 + if (i in self && self[i] === sought) {
  1304 + return i;
  1305 + }
  1306 + }
  1307 + return -1;
  1308 + }
  1309 +}, hasFirefox2IndexOfBug);
  1310 +
  1311 +//
  1312 +// String
  1313 +// ======
  1314 +//
  1315 +
  1316 +// ES5 15.5.4.14
  1317 +// http://es5.github.com/#x15.5.4.14
  1318 +
  1319 +// [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
  1320 +// Many browsers do not split properly with regular expressions or they
  1321 +// do not perform the split correctly under obscure conditions.
  1322 +// See http://blog.stevenlevithan.com/archives/cross-browser-split
  1323 +// I've tested in many browsers and this seems to cover the deviant ones:
  1324 +// 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
  1325 +// '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
  1326 +// 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
  1327 +// [undefined, "t", undefined, "e", ...]
  1328 +// ''.split(/.?/) should be [], not [""]
  1329 +// '.'.split(/()()/) should be ["."], not ["", "", "."]
  1330 +
  1331 +var string_split = StringPrototype.split;
  1332 +if (
  1333 + 'ab'.split(/(?:ab)*/).length !== 2 ||
  1334 + '.'.split(/(.?)(.?)/).length !== 4 ||
  1335 + 'tesst'.split(/(s)*/)[1] === 't' ||
  1336 + 'test'.split(/(?:)/, -1).length !== 4 ||
  1337 + ''.split(/.?/).length ||
  1338 + '.'.split(/()()/).length > 1
  1339 +) {
  1340 + (function () {
  1341 + var compliantExecNpcg = /()??/.exec('')[1] === void 0; // NPCG: nonparticipating capturing group
  1342 +
  1343 + StringPrototype.split = function (separator, limit) {
  1344 + var string = this;
  1345 + if (separator === void 0 && limit === 0) {
  1346 + return [];
  1347 + }
  1348 +
  1349 + // If `separator` is not a regex, use native split
  1350 + if (_toString.call(separator) !== '[object RegExp]') {
  1351 + return string_split.call(this, separator, limit);
  1352 + }
  1353 +
  1354 + var output = [],
  1355 + flags = (separator.ignoreCase ? 'i' : '') +
  1356 + (separator.multiline ? 'm' : '') +
  1357 + (separator.extended ? 'x' : '') + // Proposed for ES6
  1358 + (separator.sticky ? 'y' : ''), // Firefox 3+
  1359 + lastLastIndex = 0,
  1360 + // Make `global` and avoid `lastIndex` issues by working with a copy
  1361 + separator2, match, lastIndex, lastLength;
  1362 + separator = new RegExp(separator.source, flags + 'g');
  1363 + string += ''; // Type-convert
  1364 + if (!compliantExecNpcg) {
  1365 + // Doesn't need flags gy, but they don't hurt
  1366 + separator2 = new RegExp('^' + separator.source + '$(?!\\s)', flags);
  1367 + }
  1368 + /* Values for `limit`, per the spec:
  1369 + * If undefined: 4294967295 // Math.pow(2, 32) - 1
  1370 + * If 0, Infinity, or NaN: 0
  1371 + * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
  1372 + * If negative number: 4294967296 - Math.floor(Math.abs(limit))
  1373 + * If other: Type-convert, then use the above rules
  1374 + */
  1375 + limit = limit === void 0 ?
  1376 + -1 >>> 0 : // Math.pow(2, 32) - 1
  1377 + ToUint32(limit);
  1378 + while (match = separator.exec(string)) {
  1379 + // `separator.lastIndex` is not reliable cross-browser
  1380 + lastIndex = match.index + match[0].length;
  1381 + if (lastIndex > lastLastIndex) {
  1382 + output.push(string.slice(lastLastIndex, match.index));
  1383 + // Fix browsers whose `exec` methods don't consistently return `undefined` for
  1384 + // nonparticipating capturing groups
  1385 + if (!compliantExecNpcg && match.length > 1) {
  1386 + match[0].replace(separator2, function () {
  1387 + for (var i = 1; i < arguments.length - 2; i++) {
  1388 + if (arguments[i] === void 0) {
  1389 + match[i] = void 0;
  1390 + }
  1391 + }
  1392 + });
  1393 + }
  1394 + if (match.length > 1 && match.index < string.length) {
  1395 + ArrayPrototype.push.apply(output, match.slice(1));
  1396 + }
  1397 + lastLength = match[0].length;
  1398 + lastLastIndex = lastIndex;
  1399 + if (output.length >= limit) {
  1400 + break;
  1401 + }
  1402 + }
  1403 + if (separator.lastIndex === match.index) {
  1404 + separator.lastIndex++; // Avoid an infinite loop
  1405 + }
  1406 + }
  1407 + if (lastLastIndex === string.length) {
  1408 + if (lastLength || !separator.test('')) {
  1409 + output.push('');
  1410 + }
  1411 + } else {
  1412 + output.push(string.slice(lastLastIndex));
  1413 + }
  1414 + return output.length > limit ? output.slice(0, limit) : output;
  1415 + };
  1416 + }());
  1417 +
  1418 +// [bugfix, chrome]
  1419 +// If separator is undefined, then the result array contains just one String,
  1420 +// which is the this value (converted to a String). If limit is not undefined,
  1421 +// then the output array is truncated so that it contains no more than limit
  1422 +// elements.
  1423 +// "0".split(undefined, 0) -> []
  1424 +} else if ('0'.split(void 0, 0).length) {
  1425 + StringPrototype.split = function split(separator, limit) {
  1426 + if (separator === void 0 && limit === 0) { return []; }
  1427 + return string_split.call(this, separator, limit);
  1428 + };
  1429 +}
  1430 +
  1431 +// ECMA-262, 3rd B.2.3
  1432 +// Not an ECMAScript standard, although ECMAScript 3rd Edition has a
  1433 +// non-normative section suggesting uniform semantics and it should be
  1434 +// normalized across all browsers
  1435 +// [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
  1436 +var string_substr = StringPrototype.substr;
  1437 +var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';
  1438 +defineProperties(StringPrototype, {
  1439 + substr: function substr(start, length) {
  1440 + return string_substr.call(
  1441 + this,
  1442 + start < 0 ? ((start = this.length + start) < 0 ? 0 : start) : start,
  1443 + length
  1444 + );
  1445 + }
  1446 +}, hasNegativeSubstrBug);
  1447 +
  1448 +},{}],16:[function(require,module,exports){
  1449 +'use strict';
  1450 +
  1451 +module.exports = [
  1452 + // streaming transports
  1453 + require('./transport/websocket')
  1454 +, require('./transport/xhr-streaming')
  1455 +, require('./transport/xdr-streaming')
  1456 +, require('./transport/eventsource')
  1457 +, require('./transport/lib/iframe-wrap')(require('./transport/eventsource'))
  1458 +
  1459 + // polling transports
  1460 +, require('./transport/htmlfile')
  1461 +, require('./transport/lib/iframe-wrap')(require('./transport/htmlfile'))
  1462 +, require('./transport/xhr-polling')
  1463 +, require('./transport/xdr-polling')
  1464 +, require('./transport/lib/iframe-wrap')(require('./transport/xhr-polling'))
  1465 +, require('./transport/jsonp-polling')
  1466 +];
  1467 +
  1468 +},{"./transport/eventsource":20,"./transport/htmlfile":21,"./transport/jsonp-polling":23,"./transport/lib/iframe-wrap":26,"./transport/websocket":38,"./transport/xdr-polling":39,"./transport/xdr-streaming":40,"./transport/xhr-polling":41,"./transport/xhr-streaming":42}],17:[function(require,module,exports){
  1469 +(function (process,global){
  1470 +'use strict';
  1471 +
  1472 +var EventEmitter = require('events').EventEmitter
  1473 + , inherits = require('inherits')
  1474 + , utils = require('../../utils/event')
  1475 + , urlUtils = require('../../utils/url')
  1476 + , XHR = global.XMLHttpRequest
  1477 + ;
  1478 +
  1479 +var debug = function() {};
  1480 +if (process.env.NODE_ENV !== 'production') {
  1481 + debug = require('debug')('sockjs-client:browser:xhr');
  1482 +}
  1483 +
  1484 +function AbstractXHRObject(method, url, payload, opts) {
  1485 + debug(method, url);
  1486 + var self = this;
  1487 + EventEmitter.call(this);
  1488 +
  1489 + setTimeout(function () {
  1490 + self._start(method, url, payload, opts);
  1491 + }, 0);
  1492 +}
  1493 +
  1494 +inherits(AbstractXHRObject, EventEmitter);
  1495 +
  1496 +AbstractXHRObject.prototype._start = function(method, url, payload, opts) {
  1497 + var self = this;
  1498 +
  1499 + try {
  1500 + this.xhr = new XHR();
  1501 + } catch (x) {
  1502 + // intentionally empty
  1503 + }
  1504 +
  1505 + if (!this.xhr) {
  1506 + debug('no xhr');
  1507 + this.emit('finish', 0, 'no xhr support');
  1508 + this._cleanup();
  1509 + return;
  1510 + }
  1511 +
  1512 + // several browsers cache POSTs
  1513 + url = urlUtils.addQuery(url, 't=' + (+new Date()));
  1514 +
  1515 + // Explorer tends to keep connection open, even after the
  1516 + // tab gets closed: http://bugs.jquery.com/ticket/5280
  1517 + this.unloadRef = utils.unloadAdd(function() {
  1518 + debug('unload cleanup');
  1519 + self._cleanup(true);
  1520 + });
  1521 + try {
  1522 + this.xhr.open(method, url, true);
  1523 + if (this.timeout && 'timeout' in this.xhr) {
  1524 + this.xhr.timeout = this.timeout;
  1525 + this.xhr.ontimeout = function() {
  1526 + debug('xhr timeout');
  1527 + self.emit('finish', 0, '');
  1528 + self._cleanup(false);
  1529 + };
  1530 + }
  1531 + } catch (e) {
  1532 + debug('exception', e);
  1533 + // IE raises an exception on wrong port.
  1534 + this.emit('finish', 0, '');
  1535 + this._cleanup(false);
  1536 + return;
  1537 + }
  1538 +
  1539 + if ((!opts || !opts.noCredentials) && AbstractXHRObject.supportsCORS) {
  1540 + debug('withCredentials');
  1541 + // Mozilla docs says https://developer.mozilla.org/en/XMLHttpRequest :
  1542 + // "This never affects same-site requests."
  1543 +
  1544 + this.xhr.withCredentials = 'true';
  1545 + }
  1546 + if (opts && opts.headers) {
  1547 + for (var key in opts.headers) {
  1548 + this.xhr.setRequestHeader(key, opts.headers[key]);
  1549 + }
  1550 + }
  1551 +
  1552 + this.xhr.onreadystatechange = function() {
  1553 + if (self.xhr) {
  1554 + var x = self.xhr;
  1555 + var text, status;
  1556 + debug('readyState', x.readyState);
  1557 + switch (x.readyState) {
  1558 + case 3:
  1559 + // IE doesn't like peeking into responseText or status
  1560 + // on Microsoft.XMLHTTP and readystate=3
  1561 + try {
  1562 + status = x.status;
  1563 + text = x.responseText;
  1564 + } catch (e) {
  1565 + // intentionally empty
  1566 + }
  1567 + debug('status', status);
  1568 + // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450
  1569 + if (status === 1223) {
  1570 + status = 204;
  1571 + }
  1572 +
  1573 + // IE does return readystate == 3 for 404 answers.
  1574 + if (status === 200 && text && text.length > 0) {
  1575 + debug('chunk');
  1576 + self.emit('chunk', status, text);
  1577 + }
  1578 + break;
  1579 + case 4:
  1580 + status = x.status;
  1581 + debug('status', status);
  1582 + // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450
  1583 + if (status === 1223) {
  1584 + status = 204;
  1585 + }
  1586 + // IE returns this for a bad port
  1587 + // http://msdn.microsoft.com/en-us/library/windows/desktop/aa383770(v=vs.85).aspx
  1588 + if (status === 12005 || status === 12029) {
  1589 + status = 0;
  1590 + }
  1591 +
  1592 + debug('finish', status, x.responseText);
  1593 + self.emit('finish', status, x.responseText);
  1594 + self._cleanup(false);
  1595 + break;
  1596 + }
  1597 + }
  1598 + };
  1599 +
  1600 + try {
  1601 + self.xhr.send(payload);
  1602 + } catch (e) {
  1603 + self.emit('finish', 0, '');
  1604 + self._cleanup(false);
  1605 + }
  1606 +};
  1607 +
  1608 +AbstractXHRObject.prototype._cleanup = function(abort) {
  1609 + debug('cleanup');
  1610 + if (!this.xhr) {
  1611 + return;
  1612 + }
  1613 + this.removeAllListeners();
  1614 + utils.unloadDel(this.unloadRef);
  1615 +
  1616 + // IE needs this field to be a function
  1617 + this.xhr.onreadystatechange = function() {};
  1618 + if (this.xhr.ontimeout) {
  1619 + this.xhr.ontimeout = null;
  1620 + }
  1621 +
  1622 + if (abort) {
  1623 + try {
  1624 + this.xhr.abort();
  1625 + } catch (x) {
  1626 + // intentionally empty
  1627 + }
  1628 + }
  1629 + this.unloadRef = this.xhr = null;
  1630 +};
  1631 +
  1632 +AbstractXHRObject.prototype.close = function() {
  1633 + debug('close');
  1634 + this._cleanup(true);
  1635 +};
  1636 +
  1637 +AbstractXHRObject.enabled = !!XHR;
  1638 +// override XMLHttpRequest for IE6/7
  1639 +// obfuscate to avoid firewalls
  1640 +var axo = ['Active'].concat('Object').join('X');
  1641 +if (!AbstractXHRObject.enabled && (axo in global)) {
  1642 + debug('overriding xmlhttprequest');
  1643 + XHR = function() {
  1644 + try {
  1645 + return new global[axo]('Microsoft.XMLHTTP');
  1646 + } catch (e) {
  1647 + return null;
  1648 + }
  1649 + };
  1650 + AbstractXHRObject.enabled = !!new XHR();
  1651 +}
  1652 +
  1653 +var cors = false;
  1654 +try {
  1655 + cors = 'withCredentials' in new XHR();
  1656 +} catch (ignored) {
  1657 + // intentionally empty
  1658 +}
  1659 +
  1660 +AbstractXHRObject.supportsCORS = cors;
  1661 +
  1662 +module.exports = AbstractXHRObject;
  1663 +
  1664 +}).call(this,{ env: {} },typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  1665 +
  1666 +},{"../../utils/event":46,"../../utils/url":52,"debug":54,"events":3,"inherits":56}],18:[function(require,module,exports){
  1667 +(function (global){
  1668 +module.exports = global.EventSource;
  1669 +
  1670 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  1671 +
  1672 +},{}],19:[function(require,module,exports){
  1673 +(function (global){
  1674 +'use strict';
  1675 +
  1676 +var Driver = global.WebSocket || global.MozWebSocket;
  1677 +if (Driver) {
  1678 + module.exports = function WebSocketBrowserDriver(url) {
  1679 + return new Driver(url);
  1680 + };
  1681 +} else {
  1682 + module.exports = undefined;
  1683 +}
  1684 +
  1685 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  1686 +
  1687 +},{}],20:[function(require,module,exports){
  1688 +'use strict';
  1689 +
  1690 +var inherits = require('inherits')
  1691 + , AjaxBasedTransport = require('./lib/ajax-based')
  1692 + , EventSourceReceiver = require('./receiver/eventsource')
  1693 + , XHRCorsObject = require('./sender/xhr-cors')
  1694 + , EventSourceDriver = require('eventsource')
  1695 + ;
  1696 +
  1697 +function EventSourceTransport(transUrl) {
  1698 + if (!EventSourceTransport.enabled()) {
  1699 + throw new Error('Transport created when disabled');
  1700 + }
  1701 +
  1702 + AjaxBasedTransport.call(this, transUrl, '/eventsource', EventSourceReceiver, XHRCorsObject);
  1703 +}
  1704 +
  1705 +inherits(EventSourceTransport, AjaxBasedTransport);
  1706 +
  1707 +EventSourceTransport.enabled = function() {
  1708 + return !!EventSourceDriver;
  1709 +};
  1710 +
  1711 +EventSourceTransport.transportName = 'eventsource';
  1712 +EventSourceTransport.roundTrips = 2;
  1713 +
  1714 +module.exports = EventSourceTransport;
  1715 +
  1716 +},{"./lib/ajax-based":24,"./receiver/eventsource":29,"./sender/xhr-cors":35,"eventsource":18,"inherits":56}],21:[function(require,module,exports){
  1717 +'use strict';
  1718 +
  1719 +var inherits = require('inherits')
  1720 + , HtmlfileReceiver = require('./receiver/htmlfile')
  1721 + , XHRLocalObject = require('./sender/xhr-local')
  1722 + , AjaxBasedTransport = require('./lib/ajax-based')
  1723 + ;
  1724 +
  1725 +function HtmlFileTransport(transUrl) {
  1726 + if (!HtmlfileReceiver.enabled) {
  1727 + throw new Error('Transport created when disabled');
  1728 + }
  1729 + AjaxBasedTransport.call(this, transUrl, '/htmlfile', HtmlfileReceiver, XHRLocalObject);
  1730 +}
  1731 +
  1732 +inherits(HtmlFileTransport, AjaxBasedTransport);
  1733 +
  1734 +HtmlFileTransport.enabled = function(info) {
  1735 + return HtmlfileReceiver.enabled && info.sameOrigin;
  1736 +};
  1737 +
  1738 +HtmlFileTransport.transportName = 'htmlfile';
  1739 +HtmlFileTransport.roundTrips = 2;
  1740 +
  1741 +module.exports = HtmlFileTransport;
  1742 +
  1743 +},{"./lib/ajax-based":24,"./receiver/htmlfile":30,"./sender/xhr-local":37,"inherits":56}],22:[function(require,module,exports){
  1744 +(function (process){
  1745 +'use strict';
  1746 +
  1747 +// Few cool transports do work only for same-origin. In order to make
  1748 +// them work cross-domain we shall use iframe, served from the
  1749 +// remote domain. New browsers have capabilities to communicate with
  1750 +// cross domain iframe using postMessage(). In IE it was implemented
  1751 +// from IE 8+, but of course, IE got some details wrong:
  1752 +// http://msdn.microsoft.com/en-us/library/cc197015(v=VS.85).aspx
  1753 +// http://stevesouders.com/misc/test-postmessage.php
  1754 +
  1755 +var inherits = require('inherits')
  1756 + , JSON3 = require('json3')
  1757 + , EventEmitter = require('events').EventEmitter
  1758 + , version = require('../version')
  1759 + , urlUtils = require('../utils/url')
  1760 + , iframeUtils = require('../utils/iframe')
  1761 + , eventUtils = require('../utils/event')
  1762 + , random = require('../utils/random')
  1763 + ;
  1764 +
  1765 +var debug = function() {};
  1766 +if (process.env.NODE_ENV !== 'production') {
  1767 + debug = require('debug')('sockjs-client:transport:iframe');
  1768 +}
  1769 +
  1770 +function IframeTransport(transport, transUrl, baseUrl) {
  1771 + if (!IframeTransport.enabled()) {
  1772 + throw new Error('Transport created when disabled');
  1773 + }
  1774 + EventEmitter.call(this);
  1775 +
  1776 + var self = this;
  1777 + this.origin = urlUtils.getOrigin(baseUrl);
  1778 + this.baseUrl = baseUrl;
  1779 + this.transUrl = transUrl;
  1780 + this.transport = transport;
  1781 + this.windowId = random.string(8);
  1782 +
  1783 + var iframeUrl = urlUtils.addPath(baseUrl, '/iframe.html') + '#' + this.windowId;
  1784 + debug(transport, transUrl, iframeUrl);
  1785 +
  1786 + this.iframeObj = iframeUtils.createIframe(iframeUrl, function(r) {
  1787 + debug('err callback');
  1788 + self.emit('close', 1006, 'Unable to load an iframe (' + r + ')');
  1789 + self.close();
  1790 + });
  1791 +
  1792 + this.onmessageCallback = this._message.bind(this);
  1793 + eventUtils.attachEvent('message', this.onmessageCallback);
  1794 +}
  1795 +
  1796 +inherits(IframeTransport, EventEmitter);
  1797 +
  1798 +IframeTransport.prototype.close = function() {
  1799 + debug('close');
  1800 + this.removeAllListeners();
  1801 + if (this.iframeObj) {
  1802 + eventUtils.detachEvent('message', this.onmessageCallback);
  1803 + try {
  1804 + // When the iframe is not loaded, IE raises an exception
  1805 + // on 'contentWindow'.
  1806 + this.postMessage('c');
  1807 + } catch (x) {
  1808 + // intentionally empty
  1809 + }
  1810 + this.iframeObj.cleanup();
  1811 + this.iframeObj = null;
  1812 + this.onmessageCallback = this.iframeObj = null;
  1813 + }
  1814 +};
  1815 +
  1816 +IframeTransport.prototype._message = function(e) {
  1817 + debug('message', e.data);
  1818 + if (!urlUtils.isOriginEqual(e.origin, this.origin)) {
  1819 + debug('not same origin', e.origin, this.origin);
  1820 + return;
  1821 + }
  1822 +
  1823 + var iframeMessage;
  1824 + try {
  1825 + iframeMessage = JSON3.parse(e.data);
  1826 + } catch (ignored) {
  1827 + debug('bad json', e.data);
  1828 + return;
  1829 + }
  1830 +
  1831 + if (iframeMessage.windowId !== this.windowId) {
  1832 + debug('mismatched window id', iframeMessage.windowId, this.windowId);
  1833 + return;
  1834 + }
  1835 +
  1836 + switch (iframeMessage.type) {
  1837 + case 's':
  1838 + this.iframeObj.loaded();
  1839 + // window global dependency
  1840 + this.postMessage('s', JSON3.stringify([
  1841 + version
  1842 + , this.transport
  1843 + , this.transUrl
  1844 + , this.baseUrl
  1845 + ]));
  1846 + break;
  1847 + case 't':
  1848 + this.emit('message', iframeMessage.data);
  1849 + break;
  1850 + case 'c':
  1851 + var cdata;
  1852 + try {
  1853 + cdata = JSON3.parse(iframeMessage.data);
  1854 + } catch (ignored) {
  1855 + debug('bad json', iframeMessage.data);
  1856 + return;
  1857 + }
  1858 + this.emit('close', cdata[0], cdata[1]);
  1859 + this.close();
  1860 + break;
  1861 + }
  1862 +};
  1863 +
  1864 +IframeTransport.prototype.postMessage = function(type, data) {
  1865 + debug('postMessage', type, data);
  1866 + this.iframeObj.post(JSON3.stringify({
  1867 + windowId: this.windowId
  1868 + , type: type
  1869 + , data: data || ''
  1870 + }), this.origin);
  1871 +};
  1872 +
  1873 +IframeTransport.prototype.send = function(message) {
  1874 + debug('send', message);
  1875 + this.postMessage('m', message);
  1876 +};
  1877 +
  1878 +IframeTransport.enabled = function() {
  1879 + return iframeUtils.iframeEnabled;
  1880 +};
  1881 +
  1882 +IframeTransport.transportName = 'iframe';
  1883 +IframeTransport.roundTrips = 2;
  1884 +
  1885 +module.exports = IframeTransport;
  1886 +
  1887 +}).call(this,{ env: {} })
  1888 +
  1889 +},{"../utils/event":46,"../utils/iframe":47,"../utils/random":50,"../utils/url":52,"../version":53,"debug":54,"events":3,"inherits":56,"json3":57}],23:[function(require,module,exports){
  1890 +(function (global){
  1891 +'use strict';
  1892 +
  1893 +// The simplest and most robust transport, using the well-know cross
  1894 +// domain hack - JSONP. This transport is quite inefficient - one
  1895 +// message could use up to one http request. But at least it works almost
  1896 +// everywhere.
  1897 +// Known limitations:
  1898 +// o you will get a spinning cursor
  1899 +// o for Konqueror a dumb timer is needed to detect errors
  1900 +
  1901 +var inherits = require('inherits')
  1902 + , SenderReceiver = require('./lib/sender-receiver')
  1903 + , JsonpReceiver = require('./receiver/jsonp')
  1904 + , jsonpSender = require('./sender/jsonp')
  1905 + ;
  1906 +
  1907 +function JsonPTransport(transUrl) {
  1908 + if (!JsonPTransport.enabled()) {
  1909 + throw new Error('Transport created when disabled');
  1910 + }
  1911 + SenderReceiver.call(this, transUrl, '/jsonp', jsonpSender, JsonpReceiver);
  1912 +}
  1913 +
  1914 +inherits(JsonPTransport, SenderReceiver);
  1915 +
  1916 +JsonPTransport.enabled = function() {
  1917 + return !!global.document;
  1918 +};
  1919 +
  1920 +JsonPTransport.transportName = 'jsonp-polling';
  1921 +JsonPTransport.roundTrips = 1;
  1922 +JsonPTransport.needBody = true;
  1923 +
  1924 +module.exports = JsonPTransport;
  1925 +
  1926 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  1927 +
  1928 +},{"./lib/sender-receiver":28,"./receiver/jsonp":31,"./sender/jsonp":33,"inherits":56}],24:[function(require,module,exports){
  1929 +(function (process){
  1930 +'use strict';
  1931 +
  1932 +var inherits = require('inherits')
  1933 + , urlUtils = require('../../utils/url')
  1934 + , SenderReceiver = require('./sender-receiver')
  1935 + ;
  1936 +
  1937 +var debug = function() {};
  1938 +if (process.env.NODE_ENV !== 'production') {
  1939 + debug = require('debug')('sockjs-client:ajax-based');
  1940 +}
  1941 +
  1942 +function createAjaxSender(AjaxObject) {
  1943 + return function(url, payload, callback) {
  1944 + debug('create ajax sender', url, payload);
  1945 + var opt = {};
  1946 + if (typeof payload === 'string') {
  1947 + opt.headers = {'Content-type': 'text/plain'};
  1948 + }
  1949 + var ajaxUrl = urlUtils.addPath(url, '/xhr_send');
  1950 + var xo = new AjaxObject('POST', ajaxUrl, payload, opt);
  1951 + xo.once('finish', function(status) {
  1952 + debug('finish', status);
  1953 + xo = null;
  1954 +
  1955 + if (status !== 200 && status !== 204) {
  1956 + return callback(new Error('http status ' + status));
  1957 + }
  1958 + callback();
  1959 + });
  1960 + return function() {
  1961 + debug('abort');
  1962 + xo.close();
  1963 + xo = null;
  1964 +
  1965 + var err = new Error('Aborted');
  1966 + err.code = 1000;
  1967 + callback(err);
  1968 + };
  1969 + };
  1970 +}
  1971 +
  1972 +function AjaxBasedTransport(transUrl, urlSuffix, Receiver, AjaxObject) {
  1973 + SenderReceiver.call(this, transUrl, urlSuffix, createAjaxSender(AjaxObject), Receiver, AjaxObject);
  1974 +}
  1975 +
  1976 +inherits(AjaxBasedTransport, SenderReceiver);
  1977 +
  1978 +module.exports = AjaxBasedTransport;
  1979 +
  1980 +}).call(this,{ env: {} })
  1981 +
  1982 +},{"../../utils/url":52,"./sender-receiver":28,"debug":54,"inherits":56}],25:[function(require,module,exports){
  1983 +(function (process){
  1984 +'use strict';
  1985 +
  1986 +var inherits = require('inherits')
  1987 + , EventEmitter = require('events').EventEmitter
  1988 + ;
  1989 +
  1990 +var debug = function() {};
  1991 +if (process.env.NODE_ENV !== 'production') {
  1992 + debug = require('debug')('sockjs-client:buffered-sender');
  1993 +}
  1994 +
  1995 +function BufferedSender(url, sender) {
  1996 + debug(url);
  1997 + EventEmitter.call(this);
  1998 + this.sendBuffer = [];
  1999 + this.sender = sender;
  2000 + this.url = url;
  2001 +}
  2002 +
  2003 +inherits(BufferedSender, EventEmitter);
  2004 +
  2005 +BufferedSender.prototype.send = function(message) {
  2006 + debug('send', message);
  2007 + this.sendBuffer.push(message);
  2008 + if (!this.sendStop) {
  2009 + this.sendSchedule();
  2010 + }
  2011 +};
  2012 +
  2013 +// For polling transports in a situation when in the message callback,
  2014 +// new message is being send. If the sending connection was started
  2015 +// before receiving one, it is possible to saturate the network and
  2016 +// timeout due to the lack of receiving socket. To avoid that we delay
  2017 +// sending messages by some small time, in order to let receiving
  2018 +// connection be started beforehand. This is only a halfmeasure and
  2019 +// does not fix the big problem, but it does make the tests go more
  2020 +// stable on slow networks.
  2021 +BufferedSender.prototype.sendScheduleWait = function() {
  2022 + debug('sendScheduleWait');
  2023 + var self = this;
  2024 + var tref;
  2025 + this.sendStop = function() {
  2026 + debug('sendStop');
  2027 + self.sendStop = null;
  2028 + clearTimeout(tref);
  2029 + };
  2030 + tref = setTimeout(function() {
  2031 + debug('timeout');
  2032 + self.sendStop = null;
  2033 + self.sendSchedule();
  2034 + }, 25);
  2035 +};
  2036 +
  2037 +BufferedSender.prototype.sendSchedule = function() {
  2038 + debug('sendSchedule', this.sendBuffer.length);
  2039 + var self = this;
  2040 + if (this.sendBuffer.length > 0) {
  2041 + var payload = '[' + this.sendBuffer.join(',') + ']';
  2042 + this.sendStop = this.sender(this.url, payload, function(err) {
  2043 + self.sendStop = null;
  2044 + if (err) {
  2045 + debug('error', err);
  2046 + self.emit('close', err.code || 1006, 'Sending error: ' + err);
  2047 + self.close();
  2048 + } else {
  2049 + self.sendScheduleWait();
  2050 + }
  2051 + });
  2052 + this.sendBuffer = [];
  2053 + }
  2054 +};
  2055 +
  2056 +BufferedSender.prototype._cleanup = function() {
  2057 + debug('_cleanup');
  2058 + this.removeAllListeners();
  2059 +};
  2060 +
  2061 +BufferedSender.prototype.close = function() {
  2062 + debug('close');
  2063 + this._cleanup();
  2064 + if (this.sendStop) {
  2065 + this.sendStop();
  2066 + this.sendStop = null;
  2067 + }
  2068 +};
  2069 +
  2070 +module.exports = BufferedSender;
  2071 +
  2072 +}).call(this,{ env: {} })
  2073 +
  2074 +},{"debug":54,"events":3,"inherits":56}],26:[function(require,module,exports){
  2075 +(function (global){
  2076 +'use strict';
  2077 +
  2078 +var inherits = require('inherits')
  2079 + , IframeTransport = require('../iframe')
  2080 + , objectUtils = require('../../utils/object')
  2081 + ;
  2082 +
  2083 +module.exports = function(transport) {
  2084 +
  2085 + function IframeWrapTransport(transUrl, baseUrl) {
  2086 + IframeTransport.call(this, transport.transportName, transUrl, baseUrl);
  2087 + }
  2088 +
  2089 + inherits(IframeWrapTransport, IframeTransport);
  2090 +
  2091 + IframeWrapTransport.enabled = function(url, info) {
  2092 + if (!global.document) {
  2093 + return false;
  2094 + }
  2095 +
  2096 + var iframeInfo = objectUtils.extend({}, info);
  2097 + iframeInfo.sameOrigin = true;
  2098 + return transport.enabled(iframeInfo) && IframeTransport.enabled();
  2099 + };
  2100 +
  2101 + IframeWrapTransport.transportName = 'iframe-' + transport.transportName;
  2102 + IframeWrapTransport.needBody = true;
  2103 + IframeWrapTransport.roundTrips = IframeTransport.roundTrips + transport.roundTrips - 1; // html, javascript (2) + transport - no CORS (1)
  2104 +
  2105 + IframeWrapTransport.facadeTransport = transport;
  2106 +
  2107 + return IframeWrapTransport;
  2108 +};
  2109 +
  2110 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  2111 +
  2112 +},{"../../utils/object":49,"../iframe":22,"inherits":56}],27:[function(require,module,exports){
  2113 +(function (process){
  2114 +'use strict';
  2115 +
  2116 +var inherits = require('inherits')
  2117 + , EventEmitter = require('events').EventEmitter
  2118 + ;
  2119 +
  2120 +var debug = function() {};
  2121 +if (process.env.NODE_ENV !== 'production') {
  2122 + debug = require('debug')('sockjs-client:polling');
  2123 +}
  2124 +
  2125 +function Polling(Receiver, receiveUrl, AjaxObject) {
  2126 + debug(receiveUrl);
  2127 + EventEmitter.call(this);
  2128 + this.Receiver = Receiver;
  2129 + this.receiveUrl = receiveUrl;
  2130 + this.AjaxObject = AjaxObject;
  2131 + this._scheduleReceiver();
  2132 +}
  2133 +
  2134 +inherits(Polling, EventEmitter);
  2135 +
  2136 +Polling.prototype._scheduleReceiver = function() {
  2137 + debug('_scheduleReceiver');
  2138 + var self = this;
  2139 + var poll = this.poll = new this.Receiver(this.receiveUrl, this.AjaxObject);
  2140 +
  2141 + poll.on('message', function(msg) {
  2142 + debug('message', msg);
  2143 + self.emit('message', msg);
  2144 + });
  2145 +
  2146 + poll.once('close', function(code, reason) {
  2147 + debug('close', code, reason, self.pollIsClosing);
  2148 + self.poll = poll = null;
  2149 +
  2150 + if (!self.pollIsClosing) {
  2151 + if (reason === 'network') {
  2152 + self._scheduleReceiver();
  2153 + } else {
  2154 + self.emit('close', code || 1006, reason);
  2155 + self.removeAllListeners();
  2156 + }
  2157 + }
  2158 + });
  2159 +};
  2160 +
  2161 +Polling.prototype.abort = function() {
  2162 + debug('abort');
  2163 + this.removeAllListeners();
  2164 + this.pollIsClosing = true;
  2165 + if (this.poll) {
  2166 + this.poll.abort();
  2167 + }
  2168 +};
  2169 +
  2170 +module.exports = Polling;
  2171 +
  2172 +}).call(this,{ env: {} })
  2173 +
  2174 +},{"debug":54,"events":3,"inherits":56}],28:[function(require,module,exports){
  2175 +(function (process){
  2176 +'use strict';
  2177 +
  2178 +var inherits = require('inherits')
  2179 + , urlUtils = require('../../utils/url')
  2180 + , BufferedSender = require('./buffered-sender')
  2181 + , Polling = require('./polling')
  2182 + ;
  2183 +
  2184 +var debug = function() {};
  2185 +if (process.env.NODE_ENV !== 'production') {
  2186 + debug = require('debug')('sockjs-client:sender-receiver');
  2187 +}
  2188 +
  2189 +function SenderReceiver(transUrl, urlSuffix, senderFunc, Receiver, AjaxObject) {
  2190 + var pollUrl = urlUtils.addPath(transUrl, urlSuffix);
  2191 + debug(pollUrl);
  2192 + var self = this;
  2193 + BufferedSender.call(this, transUrl, senderFunc);
  2194 +
  2195 + this.poll = new Polling(Receiver, pollUrl, AjaxObject);
  2196 + this.poll.on('message', function(msg) {
  2197 + debug('poll message', msg);
  2198 + self.emit('message', msg);
  2199 + });
  2200 + this.poll.once('close', function(code, reason) {
  2201 + debug('poll close', code, reason);
  2202 + self.poll = null;
  2203 + self.emit('close', code, reason);
  2204 + self.close();
  2205 + });
  2206 +}
  2207 +
  2208 +inherits(SenderReceiver, BufferedSender);
  2209 +
  2210 +SenderReceiver.prototype.close = function() {
  2211 + BufferedSender.prototype.close.call(this);
  2212 + debug('close');
  2213 + this.removeAllListeners();
  2214 + if (this.poll) {
  2215 + this.poll.abort();
  2216 + this.poll = null;
  2217 + }
  2218 +};
  2219 +
  2220 +module.exports = SenderReceiver;
  2221 +
  2222 +}).call(this,{ env: {} })
  2223 +
  2224 +},{"../../utils/url":52,"./buffered-sender":25,"./polling":27,"debug":54,"inherits":56}],29:[function(require,module,exports){
  2225 +(function (process){
  2226 +'use strict';
  2227 +
  2228 +var inherits = require('inherits')
  2229 + , EventEmitter = require('events').EventEmitter
  2230 + , EventSourceDriver = require('eventsource')
  2231 + ;
  2232 +
  2233 +var debug = function() {};
  2234 +if (process.env.NODE_ENV !== 'production') {
  2235 + debug = require('debug')('sockjs-client:receiver:eventsource');
  2236 +}
  2237 +
  2238 +function EventSourceReceiver(url) {
  2239 + debug(url);
  2240 + EventEmitter.call(this);
  2241 +
  2242 + var self = this;
  2243 + var es = this.es = new EventSourceDriver(url);
  2244 + es.onmessage = function(e) {
  2245 + debug('message', e.data);
  2246 + self.emit('message', decodeURI(e.data));
  2247 + };
  2248 + es.onerror = function(e) {
  2249 + debug('error', es.readyState, e);
  2250 + // ES on reconnection has readyState = 0 or 1.
  2251 + // on network error it's CLOSED = 2
  2252 + var reason = (es.readyState !== 2 ? 'network' : 'permanent');
  2253 + self._cleanup();
  2254 + self._close(reason);
  2255 + };
  2256 +}
  2257 +
  2258 +inherits(EventSourceReceiver, EventEmitter);
  2259 +
  2260 +EventSourceReceiver.prototype.abort = function() {
  2261 + debug('abort');
  2262 + this._cleanup();
  2263 + this._close('user');
  2264 +};
  2265 +
  2266 +EventSourceReceiver.prototype._cleanup = function() {
  2267 + debug('cleanup');
  2268 + var es = this.es;
  2269 + if (es) {
  2270 + es.onmessage = es.onerror = null;
  2271 + es.close();
  2272 + this.es = null;
  2273 + }
  2274 +};
  2275 +
  2276 +EventSourceReceiver.prototype._close = function(reason) {
  2277 + debug('close', reason);
  2278 + var self = this;
  2279 + // Safari and chrome < 15 crash if we close window before
  2280 + // waiting for ES cleanup. See:
  2281 + // https://code.google.com/p/chromium/issues/detail?id=89155
  2282 + setTimeout(function() {
  2283 + self.emit('close', null, reason);
  2284 + self.removeAllListeners();
  2285 + }, 200);
  2286 +};
  2287 +
  2288 +module.exports = EventSourceReceiver;
  2289 +
  2290 +}).call(this,{ env: {} })
  2291 +
  2292 +},{"debug":54,"events":3,"eventsource":18,"inherits":56}],30:[function(require,module,exports){
  2293 +(function (process,global){
  2294 +'use strict';
  2295 +
  2296 +var inherits = require('inherits')
  2297 + , iframeUtils = require('../../utils/iframe')
  2298 + , urlUtils = require('../../utils/url')
  2299 + , EventEmitter = require('events').EventEmitter
  2300 + , random = require('../../utils/random')
  2301 + ;
  2302 +
  2303 +var debug = function() {};
  2304 +if (process.env.NODE_ENV !== 'production') {
  2305 + debug = require('debug')('sockjs-client:receiver:htmlfile');
  2306 +}
  2307 +
  2308 +function HtmlfileReceiver(url) {
  2309 + debug(url);
  2310 + EventEmitter.call(this);
  2311 + var self = this;
  2312 + iframeUtils.polluteGlobalNamespace();
  2313 +
  2314 + this.id = 'a' + random.string(6);
  2315 + url = urlUtils.addQuery(url, 'c=' + decodeURIComponent(iframeUtils.WPrefix + '.' + this.id));
  2316 +
  2317 + debug('using htmlfile', HtmlfileReceiver.htmlfileEnabled);
  2318 + var constructFunc = HtmlfileReceiver.htmlfileEnabled ?
  2319 + iframeUtils.createHtmlfile : iframeUtils.createIframe;
  2320 +
  2321 + global[iframeUtils.WPrefix][this.id] = {
  2322 + start: function() {
  2323 + debug('start');
  2324 + self.iframeObj.loaded();
  2325 + }
  2326 + , message: function(data) {
  2327 + debug('message', data);
  2328 + self.emit('message', data);
  2329 + }
  2330 + , stop: function() {
  2331 + debug('stop');
  2332 + self._cleanup();
  2333 + self._close('network');
  2334 + }
  2335 + };
  2336 + this.iframeObj = constructFunc(url, function() {
  2337 + debug('callback');
  2338 + self._cleanup();
  2339 + self._close('permanent');
  2340 + });
  2341 +}
  2342 +
  2343 +inherits(HtmlfileReceiver, EventEmitter);
  2344 +
  2345 +HtmlfileReceiver.prototype.abort = function() {
  2346 + debug('abort');
  2347 + this._cleanup();
  2348 + this._close('user');
  2349 +};
  2350 +
  2351 +HtmlfileReceiver.prototype._cleanup = function() {
  2352 + debug('_cleanup');
  2353 + if (this.iframeObj) {
  2354 + this.iframeObj.cleanup();
  2355 + this.iframeObj = null;
  2356 + }
  2357 + delete global[iframeUtils.WPrefix][this.id];
  2358 +};
  2359 +
  2360 +HtmlfileReceiver.prototype._close = function(reason) {
  2361 + debug('_close', reason);
  2362 + this.emit('close', null, reason);
  2363 + this.removeAllListeners();
  2364 +};
  2365 +
  2366 +HtmlfileReceiver.htmlfileEnabled = false;
  2367 +
  2368 +// obfuscate to avoid firewalls
  2369 +var axo = ['Active'].concat('Object').join('X');
  2370 +if (axo in global) {
  2371 + try {
  2372 + HtmlfileReceiver.htmlfileEnabled = !!new global[axo]('htmlfile');
  2373 + } catch (x) {
  2374 + // intentionally empty
  2375 + }
  2376 +}
  2377 +
  2378 +HtmlfileReceiver.enabled = HtmlfileReceiver.htmlfileEnabled || iframeUtils.iframeEnabled;
  2379 +
  2380 +module.exports = HtmlfileReceiver;
  2381 +
  2382 +}).call(this,{ env: {} },typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  2383 +
  2384 +},{"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,"debug":54,"events":3,"inherits":56}],31:[function(require,module,exports){
  2385 +(function (process,global){
  2386 +'use strict';
  2387 +
  2388 +var utils = require('../../utils/iframe')
  2389 + , random = require('../../utils/random')
  2390 + , browser = require('../../utils/browser')
  2391 + , urlUtils = require('../../utils/url')
  2392 + , inherits = require('inherits')
  2393 + , EventEmitter = require('events').EventEmitter
  2394 + ;
  2395 +
  2396 +var debug = function() {};
  2397 +if (process.env.NODE_ENV !== 'production') {
  2398 + debug = require('debug')('sockjs-client:receiver:jsonp');
  2399 +}
  2400 +
  2401 +function JsonpReceiver(url) {
  2402 + debug(url);
  2403 + var self = this;
  2404 + EventEmitter.call(this);
  2405 +
  2406 + utils.polluteGlobalNamespace();
  2407 +
  2408 + this.id = 'a' + random.string(6);
  2409 + var urlWithId = urlUtils.addQuery(url, 'c=' + encodeURIComponent(utils.WPrefix + '.' + this.id));
  2410 +
  2411 + global[utils.WPrefix][this.id] = this._callback.bind(this);
  2412 + this._createScript(urlWithId);
  2413 +
  2414 + // Fallback mostly for Konqueror - stupid timer, 35 seconds shall be plenty.
  2415 + this.timeoutId = setTimeout(function() {
  2416 + debug('timeout');
  2417 + self._abort(new Error('JSONP script loaded abnormally (timeout)'));
  2418 + }, JsonpReceiver.timeout);
  2419 +}
  2420 +
  2421 +inherits(JsonpReceiver, EventEmitter);
  2422 +
  2423 +JsonpReceiver.prototype.abort = function() {
  2424 + debug('abort');
  2425 + if (global[utils.WPrefix][this.id]) {
  2426 + var err = new Error('JSONP user aborted read');
  2427 + err.code = 1000;
  2428 + this._abort(err);
  2429 + }
  2430 +};
  2431 +
  2432 +JsonpReceiver.timeout = 35000;
  2433 +JsonpReceiver.scriptErrorTimeout = 1000;
  2434 +
  2435 +JsonpReceiver.prototype._callback = function(data) {
  2436 + debug('_callback', data);
  2437 + this._cleanup();
  2438 +
  2439 + if (this.aborting) {
  2440 + return;
  2441 + }
  2442 +
  2443 + if (data) {
  2444 + debug('message', data);
  2445 + this.emit('message', data);
  2446 + }
  2447 + this.emit('close', null, 'network');
  2448 + this.removeAllListeners();
  2449 +};
  2450 +
  2451 +JsonpReceiver.prototype._abort = function(err) {
  2452 + debug('_abort', err);
  2453 + this._cleanup();
  2454 + this.aborting = true;
  2455 + this.emit('close', err.code, err.message);
  2456 + this.removeAllListeners();
  2457 +};
  2458 +
  2459 +JsonpReceiver.prototype._cleanup = function() {
  2460 + debug('_cleanup');
  2461 + clearTimeout(this.timeoutId);
  2462 + if (this.script2) {
  2463 + this.script2.parentNode.removeChild(this.script2);
  2464 + this.script2 = null;
  2465 + }
  2466 + if (this.script) {
  2467 + var script = this.script;
  2468 + // Unfortunately, you can't really abort script loading of
  2469 + // the script.
  2470 + script.parentNode.removeChild(script);
  2471 + script.onreadystatechange = script.onerror =
  2472 + script.onload = script.onclick = null;
  2473 + this.script = null;
  2474 + }
  2475 + delete global[utils.WPrefix][this.id];
  2476 +};
  2477 +
  2478 +JsonpReceiver.prototype._scriptError = function() {
  2479 + debug('_scriptError');
  2480 + var self = this;
  2481 + if (this.errorTimer) {
  2482 + return;
  2483 + }
  2484 +
  2485 + this.errorTimer = setTimeout(function() {
  2486 + if (!self.loadedOkay) {
  2487 + self._abort(new Error('JSONP script loaded abnormally (onerror)'));
  2488 + }
  2489 + }, JsonpReceiver.scriptErrorTimeout);
  2490 +};
  2491 +
  2492 +JsonpReceiver.prototype._createScript = function(url) {
  2493 + debug('_createScript', url);
  2494 + var self = this;
  2495 + var script = this.script = global.document.createElement('script');
  2496 + var script2; // Opera synchronous load trick.
  2497 +
  2498 + script.id = 'a' + random.string(8);
  2499 + script.src = url;
  2500 + script.type = 'text/javascript';
  2501 + script.charset = 'UTF-8';
  2502 + script.onerror = this._scriptError.bind(this);
  2503 + script.onload = function() {
  2504 + debug('onload');
  2505 + self._abort(new Error('JSONP script loaded abnormally (onload)'));
  2506 + };
  2507 +
  2508 + // IE9 fires 'error' event after onreadystatechange or before, in random order.
  2509 + // Use loadedOkay to determine if actually errored
  2510 + script.onreadystatechange = function() {
  2511 + debug('onreadystatechange', script.readyState);
  2512 + if (/loaded|closed/.test(script.readyState)) {
  2513 + if (script && script.htmlFor && script.onclick) {
  2514 + self.loadedOkay = true;
  2515 + try {
  2516 + // In IE, actually execute the script.
  2517 + script.onclick();
  2518 + } catch (x) {
  2519 + // intentionally empty
  2520 + }
  2521 + }
  2522 + if (script) {
  2523 + self._abort(new Error('JSONP script loaded abnormally (onreadystatechange)'));
  2524 + }
  2525 + }
  2526 + };
  2527 + // IE: event/htmlFor/onclick trick.
  2528 + // One can't rely on proper order for onreadystatechange. In order to
  2529 + // make sure, set a 'htmlFor' and 'event' properties, so that
  2530 + // script code will be installed as 'onclick' handler for the
  2531 + // script object. Later, onreadystatechange, manually execute this
  2532 + // code. FF and Chrome doesn't work with 'event' and 'htmlFor'
  2533 + // set. For reference see:
  2534 + // http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.html
  2535 + // Also, read on that about script ordering:
  2536 + // http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order
  2537 + if (typeof script.async === 'undefined' && global.document.attachEvent) {
  2538 + // According to mozilla docs, in recent browsers script.async defaults
  2539 + // to 'true', so we may use it to detect a good browser:
  2540 + // https://developer.mozilla.org/en/HTML/Element/script
  2541 + if (!browser.isOpera()) {
  2542 + // Naively assume we're in IE
  2543 + try {
  2544 + script.htmlFor = script.id;
  2545 + script.event = 'onclick';
  2546 + } catch (x) {
  2547 + // intentionally empty
  2548 + }
  2549 + script.async = true;
  2550 + } else {
  2551 + // Opera, second sync script hack
  2552 + script2 = this.script2 = global.document.createElement('script');
  2553 + script2.text = "try{var a = document.getElementById('" + script.id + "'); if(a)a.onerror();}catch(x){};";
  2554 + script.async = script2.async = false;
  2555 + }
  2556 + }
  2557 + if (typeof script.async !== 'undefined') {
  2558 + script.async = true;
  2559 + }
  2560 +
  2561 + var head = global.document.getElementsByTagName('head')[0];
  2562 + head.insertBefore(script, head.firstChild);
  2563 + if (script2) {
  2564 + head.insertBefore(script2, head.firstChild);
  2565 + }
  2566 +};
  2567 +
  2568 +module.exports = JsonpReceiver;
  2569 +
  2570 +}).call(this,{ env: {} },typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  2571 +
  2572 +},{"../../utils/browser":44,"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,"debug":54,"events":3,"inherits":56}],32:[function(require,module,exports){
  2573 +(function (process){
  2574 +'use strict';
  2575 +
  2576 +var inherits = require('inherits')
  2577 + , EventEmitter = require('events').EventEmitter
  2578 + ;
  2579 +
  2580 +var debug = function() {};
  2581 +if (process.env.NODE_ENV !== 'production') {
  2582 + debug = require('debug')('sockjs-client:receiver:xhr');
  2583 +}
  2584 +
  2585 +function XhrReceiver(url, AjaxObject) {
  2586 + debug(url);
  2587 + EventEmitter.call(this);
  2588 + var self = this;
  2589 +
  2590 + this.bufferPosition = 0;
  2591 +
  2592 + this.xo = new AjaxObject('POST', url, null);
  2593 + this.xo.on('chunk', this._chunkHandler.bind(this));
  2594 + this.xo.once('finish', function(status, text) {
  2595 + debug('finish', status, text);
  2596 + self._chunkHandler(status, text);
  2597 + self.xo = null;
  2598 + var reason = status === 200 ? 'network' : 'permanent';
  2599 + debug('close', reason);
  2600 + self.emit('close', null, reason);
  2601 + self._cleanup();
  2602 + });
  2603 +}
  2604 +
  2605 +inherits(XhrReceiver, EventEmitter);
  2606 +
  2607 +XhrReceiver.prototype._chunkHandler = function(status, text) {
  2608 + debug('_chunkHandler', status);
  2609 + if (status !== 200 || !text) {
  2610 + return;
  2611 + }
  2612 +
  2613 + for (var idx = -1; ; this.bufferPosition += idx + 1) {
  2614 + var buf = text.slice(this.bufferPosition);
  2615 + idx = buf.indexOf('\n');
  2616 + if (idx === -1) {
  2617 + break;
  2618 + }
  2619 + var msg = buf.slice(0, idx);
  2620 + if (msg) {
  2621 + debug('message', msg);
  2622 + this.emit('message', msg);
  2623 + }
  2624 + }
  2625 +};
  2626 +
  2627 +XhrReceiver.prototype._cleanup = function() {
  2628 + debug('_cleanup');
  2629 + this.removeAllListeners();
  2630 +};
  2631 +
  2632 +XhrReceiver.prototype.abort = function() {
  2633 + debug('abort');
  2634 + if (this.xo) {
  2635 + this.xo.close();
  2636 + debug('close');
  2637 + this.emit('close', null, 'user');
  2638 + this.xo = null;
  2639 + }
  2640 + this._cleanup();
  2641 +};
  2642 +
  2643 +module.exports = XhrReceiver;
  2644 +
  2645 +}).call(this,{ env: {} })
  2646 +
  2647 +},{"debug":54,"events":3,"inherits":56}],33:[function(require,module,exports){
  2648 +(function (process,global){
  2649 +'use strict';
  2650 +
  2651 +var random = require('../../utils/random')
  2652 + , urlUtils = require('../../utils/url')
  2653 + ;
  2654 +
  2655 +var debug = function() {};
  2656 +if (process.env.NODE_ENV !== 'production') {
  2657 + debug = require('debug')('sockjs-client:sender:jsonp');
  2658 +}
  2659 +
  2660 +var form, area;
  2661 +
  2662 +function createIframe(id) {
  2663 + debug('createIframe', id);
  2664 + try {
  2665 + // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
  2666 + return global.document.createElement('<iframe name="' + id + '">');
  2667 + } catch (x) {
  2668 + var iframe = global.document.createElement('iframe');
  2669 + iframe.name = id;
  2670 + return iframe;
  2671 + }
  2672 +}
  2673 +
  2674 +function createForm() {
  2675 + debug('createForm');
  2676 + form = global.document.createElement('form');
  2677 + form.style.display = 'none';
  2678 + form.style.position = 'absolute';
  2679 + form.method = 'POST';
  2680 + form.enctype = 'application/x-www-form-urlencoded';
  2681 + form.acceptCharset = 'UTF-8';
  2682 +
  2683 + area = global.document.createElement('textarea');
  2684 + area.name = 'd';
  2685 + form.appendChild(area);
  2686 +
  2687 + global.document.body.appendChild(form);
  2688 +}
  2689 +
  2690 +module.exports = function(url, payload, callback) {
  2691 + debug(url, payload);
  2692 + if (!form) {
  2693 + createForm();
  2694 + }
  2695 + var id = 'a' + random.string(8);
  2696 + form.target = id;
  2697 + form.action = urlUtils.addQuery(urlUtils.addPath(url, '/jsonp_send'), 'i=' + id);
  2698 +
  2699 + var iframe = createIframe(id);
  2700 + iframe.id = id;
  2701 + iframe.style.display = 'none';
  2702 + form.appendChild(iframe);
  2703 +
  2704 + try {
  2705 + area.value = payload;
  2706 + } catch (e) {
  2707 + // seriously broken browsers get here
  2708 + }
  2709 + form.submit();
  2710 +
  2711 + var completed = function(err) {
  2712 + debug('completed', id, err);
  2713 + if (!iframe.onerror) {
  2714 + return;
  2715 + }
  2716 + iframe.onreadystatechange = iframe.onerror = iframe.onload = null;
  2717 + // Opera mini doesn't like if we GC iframe
  2718 + // immediately, thus this timeout.
  2719 + setTimeout(function() {
  2720 + debug('cleaning up', id);
  2721 + iframe.parentNode.removeChild(iframe);
  2722 + iframe = null;
  2723 + }, 500);
  2724 + area.value = '';
  2725 + // It is not possible to detect if the iframe succeeded or
  2726 + // failed to submit our form.
  2727 + callback(err);
  2728 + };
  2729 + iframe.onerror = function() {
  2730 + debug('onerror', id);
  2731 + completed();
  2732 + };
  2733 + iframe.onload = function() {
  2734 + debug('onload', id);
  2735 + completed();
  2736 + };
  2737 + iframe.onreadystatechange = function(e) {
  2738 + debug('onreadystatechange', id, iframe.readyState, e);
  2739 + if (iframe.readyState === 'complete') {
  2740 + completed();
  2741 + }
  2742 + };
  2743 + return function() {
  2744 + debug('aborted', id);
  2745 + completed(new Error('Aborted'));
  2746 + };
  2747 +};
  2748 +
  2749 +}).call(this,{ env: {} },typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  2750 +
  2751 +},{"../../utils/random":50,"../../utils/url":52,"debug":54}],34:[function(require,module,exports){
  2752 +(function (process,global){
  2753 +'use strict';
  2754 +
  2755 +var EventEmitter = require('events').EventEmitter
  2756 + , inherits = require('inherits')
  2757 + , eventUtils = require('../../utils/event')
  2758 + , browser = require('../../utils/browser')
  2759 + , urlUtils = require('../../utils/url')
  2760 + ;
  2761 +
  2762 +var debug = function() {};
  2763 +if (process.env.NODE_ENV !== 'production') {
  2764 + debug = require('debug')('sockjs-client:sender:xdr');
  2765 +}
  2766 +
  2767 +// References:
  2768 +// http://ajaxian.com/archives/100-line-ajax-wrapper
  2769 +// http://msdn.microsoft.com/en-us/library/cc288060(v=VS.85).aspx
  2770 +
  2771 +function XDRObject(method, url, payload) {
  2772 + debug(method, url);
  2773 + var self = this;
  2774 + EventEmitter.call(this);
  2775 +
  2776 + setTimeout(function() {
  2777 + self._start(method, url, payload);
  2778 + }, 0);
  2779 +}
  2780 +
  2781 +inherits(XDRObject, EventEmitter);
  2782 +
  2783 +XDRObject.prototype._start = function(method, url, payload) {
  2784 + debug('_start');
  2785 + var self = this;
  2786 + var xdr = new global.XDomainRequest();
  2787 + // IE caches even POSTs
  2788 + url = urlUtils.addQuery(url, 't=' + (+new Date()));
  2789 +
  2790 + xdr.onerror = function() {
  2791 + debug('onerror');
  2792 + self._error();
  2793 + };
  2794 + xdr.ontimeout = function() {
  2795 + debug('ontimeout');
  2796 + self._error();
  2797 + };
  2798 + xdr.onprogress = function() {
  2799 + debug('progress', xdr.responseText);
  2800 + self.emit('chunk', 200, xdr.responseText);
  2801 + };
  2802 + xdr.onload = function() {
  2803 + debug('load');
  2804 + self.emit('finish', 200, xdr.responseText);
  2805 + self._cleanup(false);
  2806 + };
  2807 + this.xdr = xdr;
  2808 + this.unloadRef = eventUtils.unloadAdd(function() {
  2809 + self._cleanup(true);
  2810 + });
  2811 + try {
  2812 + // Fails with AccessDenied if port number is bogus
  2813 + this.xdr.open(method, url);
  2814 + if (this.timeout) {
  2815 + this.xdr.timeout = this.timeout;
  2816 + }
  2817 + this.xdr.send(payload);
  2818 + } catch (x) {
  2819 + this._error();
  2820 + }
  2821 +};
  2822 +
  2823 +XDRObject.prototype._error = function() {
  2824 + this.emit('finish', 0, '');
  2825 + this._cleanup(false);
  2826 +};
  2827 +
  2828 +XDRObject.prototype._cleanup = function(abort) {
  2829 + debug('cleanup', abort);
  2830 + if (!this.xdr) {
  2831 + return;
  2832 + }
  2833 + this.removeAllListeners();
  2834 + eventUtils.unloadDel(this.unloadRef);
  2835 +
  2836 + this.xdr.ontimeout = this.xdr.onerror = this.xdr.onprogress = this.xdr.onload = null;
  2837 + if (abort) {
  2838 + try {
  2839 + this.xdr.abort();
  2840 + } catch (x) {
  2841 + // intentionally empty
  2842 + }
  2843 + }
  2844 + this.unloadRef = this.xdr = null;
  2845 +};
  2846 +
  2847 +XDRObject.prototype.close = function() {
  2848 + debug('close');
  2849 + this._cleanup(true);
  2850 +};
  2851 +
  2852 +// IE 8/9 if the request target uses the same scheme - #79
  2853 +XDRObject.enabled = !!(global.XDomainRequest && browser.hasDomain());
  2854 +
  2855 +module.exports = XDRObject;
  2856 +
  2857 +}).call(this,{ env: {} },typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  2858 +
  2859 +},{"../../utils/browser":44,"../../utils/event":46,"../../utils/url":52,"debug":54,"events":3,"inherits":56}],35:[function(require,module,exports){
  2860 +'use strict';
  2861 +
  2862 +var inherits = require('inherits')
  2863 + , XhrDriver = require('../driver/xhr')
  2864 + ;
  2865 +
  2866 +function XHRCorsObject(method, url, payload, opts) {
  2867 + XhrDriver.call(this, method, url, payload, opts);
  2868 +}
  2869 +
  2870 +inherits(XHRCorsObject, XhrDriver);
  2871 +
  2872 +XHRCorsObject.enabled = XhrDriver.enabled && XhrDriver.supportsCORS;
  2873 +
  2874 +module.exports = XHRCorsObject;
  2875 +
  2876 +},{"../driver/xhr":17,"inherits":56}],36:[function(require,module,exports){
  2877 +'use strict';
  2878 +
  2879 +var EventEmitter = require('events').EventEmitter
  2880 + , inherits = require('inherits')
  2881 + ;
  2882 +
  2883 +function XHRFake(/* method, url, payload, opts */) {
  2884 + var self = this;
  2885 + EventEmitter.call(this);
  2886 +
  2887 + this.to = setTimeout(function() {
  2888 + self.emit('finish', 200, '{}');
  2889 + }, XHRFake.timeout);
  2890 +}
  2891 +
  2892 +inherits(XHRFake, EventEmitter);
  2893 +
  2894 +XHRFake.prototype.close = function() {
  2895 + clearTimeout(this.to);
  2896 +};
  2897 +
  2898 +XHRFake.timeout = 2000;
  2899 +
  2900 +module.exports = XHRFake;
  2901 +
  2902 +},{"events":3,"inherits":56}],37:[function(require,module,exports){
  2903 +'use strict';
  2904 +
  2905 +var inherits = require('inherits')
  2906 + , XhrDriver = require('../driver/xhr')
  2907 + ;
  2908 +
  2909 +function XHRLocalObject(method, url, payload /*, opts */) {
  2910 + XhrDriver.call(this, method, url, payload, {
  2911 + noCredentials: true
  2912 + });
  2913 +}
  2914 +
  2915 +inherits(XHRLocalObject, XhrDriver);
  2916 +
  2917 +XHRLocalObject.enabled = XhrDriver.enabled;
  2918 +
  2919 +module.exports = XHRLocalObject;
  2920 +
  2921 +},{"../driver/xhr":17,"inherits":56}],38:[function(require,module,exports){
  2922 +(function (process){
  2923 +'use strict';
  2924 +
  2925 +var utils = require('../utils/event')
  2926 + , urlUtils = require('../utils/url')
  2927 + , inherits = require('inherits')
  2928 + , EventEmitter = require('events').EventEmitter
  2929 + , WebsocketDriver = require('./driver/websocket')
  2930 + ;
  2931 +
  2932 +var debug = function() {};
  2933 +if (process.env.NODE_ENV !== 'production') {
  2934 + debug = require('debug')('sockjs-client:websocket');
  2935 +}
  2936 +
  2937 +function WebSocketTransport(transUrl, ignore, options) {
  2938 + if (!WebSocketTransport.enabled()) {
  2939 + throw new Error('Transport created when disabled');
  2940 + }
  2941 +
  2942 + EventEmitter.call(this);
  2943 + debug('constructor', transUrl);
  2944 +
  2945 + var self = this;
  2946 + var url = urlUtils.addPath(transUrl, '/websocket');
  2947 + if (url.slice(0, 5) === 'https') {
  2948 + url = 'wss' + url.slice(5);
  2949 + } else {
  2950 + url = 'ws' + url.slice(4);
  2951 + }
  2952 + this.url = url;
  2953 +
  2954 + this.ws = new WebsocketDriver(this.url, [], options);
  2955 + this.ws.onmessage = function(e) {
  2956 + debug('message event', e.data);
  2957 + self.emit('message', e.data);
  2958 + };
  2959 + // Firefox has an interesting bug. If a websocket connection is
  2960 + // created after onunload, it stays alive even when user
  2961 + // navigates away from the page. In such situation let's lie -
  2962 + // let's not open the ws connection at all. See:
  2963 + // https://github.com/sockjs/sockjs-client/issues/28
  2964 + // https://bugzilla.mozilla.org/show_bug.cgi?id=696085
  2965 + this.unloadRef = utils.unloadAdd(function() {
  2966 + debug('unload');
  2967 + self.ws.close();
  2968 + });
  2969 + this.ws.onclose = function(e) {
  2970 + debug('close event', e.code, e.reason);
  2971 + self.emit('close', e.code, e.reason);
  2972 + self._cleanup();
  2973 + };
  2974 + this.ws.onerror = function(e) {
  2975 + debug('error event', e);
  2976 + self.emit('close', 1006, 'WebSocket connection broken');
  2977 + self._cleanup();
  2978 + };
  2979 +}
  2980 +
  2981 +inherits(WebSocketTransport, EventEmitter);
  2982 +
  2983 +WebSocketTransport.prototype.send = function(data) {
  2984 + var msg = '[' + data + ']';
  2985 + debug('send', msg);
  2986 + this.ws.send(msg);
  2987 +};
  2988 +
  2989 +WebSocketTransport.prototype.close = function() {
  2990 + debug('close');
  2991 + var ws = this.ws;
  2992 + this._cleanup();
  2993 + if (ws) {
  2994 + ws.close();
  2995 + }
  2996 +};
  2997 +
  2998 +WebSocketTransport.prototype._cleanup = function() {
  2999 + debug('_cleanup');
  3000 + var ws = this.ws;
  3001 + if (ws) {
  3002 + ws.onmessage = ws.onclose = ws.onerror = null;
  3003 + }
  3004 + utils.unloadDel(this.unloadRef);
  3005 + this.unloadRef = this.ws = null;
  3006 + this.removeAllListeners();
  3007 +};
  3008 +
  3009 +WebSocketTransport.enabled = function() {
  3010 + debug('enabled');
  3011 + return !!WebsocketDriver;
  3012 +};
  3013 +WebSocketTransport.transportName = 'websocket';
  3014 +
  3015 +// In theory, ws should require 1 round trip. But in chrome, this is
  3016 +// not very stable over SSL. Most likely a ws connection requires a
  3017 +// separate SSL connection, in which case 2 round trips are an
  3018 +// absolute minumum.
  3019 +WebSocketTransport.roundTrips = 2;
  3020 +
  3021 +module.exports = WebSocketTransport;
  3022 +
  3023 +}).call(this,{ env: {} })
  3024 +
  3025 +},{"../utils/event":46,"../utils/url":52,"./driver/websocket":19,"debug":54,"events":3,"inherits":56}],39:[function(require,module,exports){
  3026 +'use strict';
  3027 +
  3028 +var inherits = require('inherits')
  3029 + , AjaxBasedTransport = require('./lib/ajax-based')
  3030 + , XdrStreamingTransport = require('./xdr-streaming')
  3031 + , XhrReceiver = require('./receiver/xhr')
  3032 + , XDRObject = require('./sender/xdr')
  3033 + ;
  3034 +
  3035 +function XdrPollingTransport(transUrl) {
  3036 + if (!XDRObject.enabled) {
  3037 + throw new Error('Transport created when disabled');
  3038 + }
  3039 + AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XDRObject);
  3040 +}
  3041 +
  3042 +inherits(XdrPollingTransport, AjaxBasedTransport);
  3043 +
  3044 +XdrPollingTransport.enabled = XdrStreamingTransport.enabled;
  3045 +XdrPollingTransport.transportName = 'xdr-polling';
  3046 +XdrPollingTransport.roundTrips = 2; // preflight, ajax
  3047 +
  3048 +module.exports = XdrPollingTransport;
  3049 +
  3050 +},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,"./xdr-streaming":40,"inherits":56}],40:[function(require,module,exports){
  3051 +'use strict';
  3052 +
  3053 +var inherits = require('inherits')
  3054 + , AjaxBasedTransport = require('./lib/ajax-based')
  3055 + , XhrReceiver = require('./receiver/xhr')
  3056 + , XDRObject = require('./sender/xdr')
  3057 + ;
  3058 +
  3059 +// According to:
  3060 +// http://stackoverflow.com/questions/1641507/detect-browser-support-for-cross-domain-xmlhttprequests
  3061 +// http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/
  3062 +
  3063 +function XdrStreamingTransport(transUrl) {
  3064 + if (!XDRObject.enabled) {
  3065 + throw new Error('Transport created when disabled');
  3066 + }
  3067 + AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XDRObject);
  3068 +}
  3069 +
  3070 +inherits(XdrStreamingTransport, AjaxBasedTransport);
  3071 +
  3072 +XdrStreamingTransport.enabled = function(info) {
  3073 + if (info.cookie_needed || info.nullOrigin) {
  3074 + return false;
  3075 + }
  3076 + return XDRObject.enabled && info.sameScheme;
  3077 +};
  3078 +
  3079 +XdrStreamingTransport.transportName = 'xdr-streaming';
  3080 +XdrStreamingTransport.roundTrips = 2; // preflight, ajax
  3081 +
  3082 +module.exports = XdrStreamingTransport;
  3083 +
  3084 +},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,"inherits":56}],41:[function(require,module,exports){
  3085 +'use strict';
  3086 +
  3087 +var inherits = require('inherits')
  3088 + , AjaxBasedTransport = require('./lib/ajax-based')
  3089 + , XhrReceiver = require('./receiver/xhr')
  3090 + , XHRCorsObject = require('./sender/xhr-cors')
  3091 + , XHRLocalObject = require('./sender/xhr-local')
  3092 + ;
  3093 +
  3094 +function XhrPollingTransport(transUrl) {
  3095 + if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) {
  3096 + throw new Error('Transport created when disabled');
  3097 + }
  3098 + AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XHRCorsObject);
  3099 +}
  3100 +
  3101 +inherits(XhrPollingTransport, AjaxBasedTransport);
  3102 +
  3103 +XhrPollingTransport.enabled = function(info) {
  3104 + if (info.nullOrigin) {
  3105 + return false;
  3106 + }
  3107 +
  3108 + if (XHRLocalObject.enabled && info.sameOrigin) {
  3109 + return true;
  3110 + }
  3111 + return XHRCorsObject.enabled;
  3112 +};
  3113 +
  3114 +XhrPollingTransport.transportName = 'xhr-polling';
  3115 +XhrPollingTransport.roundTrips = 2; // preflight, ajax
  3116 +
  3117 +module.exports = XhrPollingTransport;
  3118 +
  3119 +},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,"inherits":56}],42:[function(require,module,exports){
  3120 +(function (global){
  3121 +'use strict';
  3122 +
  3123 +var inherits = require('inherits')
  3124 + , AjaxBasedTransport = require('./lib/ajax-based')
  3125 + , XhrReceiver = require('./receiver/xhr')
  3126 + , XHRCorsObject = require('./sender/xhr-cors')
  3127 + , XHRLocalObject = require('./sender/xhr-local')
  3128 + , browser = require('../utils/browser')
  3129 + ;
  3130 +
  3131 +function XhrStreamingTransport(transUrl) {
  3132 + if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) {
  3133 + throw new Error('Transport created when disabled');
  3134 + }
  3135 + AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XHRCorsObject);
  3136 +}
  3137 +
  3138 +inherits(XhrStreamingTransport, AjaxBasedTransport);
  3139 +
  3140 +XhrStreamingTransport.enabled = function(info) {
  3141 + if (info.nullOrigin) {
  3142 + return false;
  3143 + }
  3144 + // Opera doesn't support xhr-streaming #60
  3145 + // But it might be able to #92
  3146 + if (browser.isOpera()) {
  3147 + return false;
  3148 + }
  3149 +
  3150 + return XHRCorsObject.enabled;
  3151 +};
  3152 +
  3153 +XhrStreamingTransport.transportName = 'xhr-streaming';
  3154 +XhrStreamingTransport.roundTrips = 2; // preflight, ajax
  3155 +
  3156 +// Safari gets confused when a streaming ajax request is started
  3157 +// before onload. This causes the load indicator to spin indefinetely.
  3158 +// Only require body when used in a browser
  3159 +XhrStreamingTransport.needBody = !!global.document;
  3160 +
  3161 +module.exports = XhrStreamingTransport;
  3162 +
  3163 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3164 +
  3165 +},{"../utils/browser":44,"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,"inherits":56}],43:[function(require,module,exports){
  3166 +(function (global){
  3167 +'use strict';
  3168 +
  3169 +if (global.crypto && global.crypto.getRandomValues) {
  3170 + module.exports.randomBytes = function(length) {
  3171 + var bytes = new Uint8Array(length);
  3172 + global.crypto.getRandomValues(bytes);
  3173 + return bytes;
  3174 + };
  3175 +} else {
  3176 + module.exports.randomBytes = function(length) {
  3177 + var bytes = new Array(length);
  3178 + for (var i = 0; i < length; i++) {
  3179 + bytes[i] = Math.floor(Math.random() * 256);
  3180 + }
  3181 + return bytes;
  3182 + };
  3183 +}
  3184 +
  3185 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3186 +
  3187 +},{}],44:[function(require,module,exports){
  3188 +(function (global){
  3189 +'use strict';
  3190 +
  3191 +module.exports = {
  3192 + isOpera: function() {
  3193 + return global.navigator &&
  3194 + /opera/i.test(global.navigator.userAgent);
  3195 + }
  3196 +
  3197 +, isKonqueror: function() {
  3198 + return global.navigator &&
  3199 + /konqueror/i.test(global.navigator.userAgent);
  3200 + }
  3201 +
  3202 + // #187 wrap document.domain in try/catch because of WP8 from file:///
  3203 +, hasDomain: function () {
  3204 + // non-browser client always has a domain
  3205 + if (!global.document) {
  3206 + return true;
  3207 + }
  3208 +
  3209 + try {
  3210 + return !!global.document.domain;
  3211 + } catch (e) {
  3212 + return false;
  3213 + }
  3214 + }
  3215 +};
  3216 +
  3217 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3218 +
  3219 +},{}],45:[function(require,module,exports){
  3220 +'use strict';
  3221 +
  3222 +var JSON3 = require('json3');
  3223 +
  3224 +// Some extra characters that Chrome gets wrong, and substitutes with
  3225 +// something else on the wire.
  3226 +// eslint-disable-next-line no-control-regex
  3227 +var extraEscapable = /[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g
  3228 + , extraLookup;
  3229 +
  3230 +// This may be quite slow, so let's delay until user actually uses bad
  3231 +// characters.
  3232 +var unrollLookup = function(escapable) {
  3233 + var i;
  3234 + var unrolled = {};
  3235 + var c = [];
  3236 + for (i = 0; i < 65536; i++) {
  3237 + c.push( String.fromCharCode(i) );
  3238 + }
  3239 + escapable.lastIndex = 0;
  3240 + c.join('').replace(escapable, function(a) {
  3241 + unrolled[ a ] = '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
  3242 + return '';
  3243 + });
  3244 + escapable.lastIndex = 0;
  3245 + return unrolled;
  3246 +};
  3247 +
  3248 +// Quote string, also taking care of unicode characters that browsers
  3249 +// often break. Especially, take care of unicode surrogates:
  3250 +// http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Surrogates
  3251 +module.exports = {
  3252 + quote: function(string) {
  3253 + var quoted = JSON3.stringify(string);
  3254 +
  3255 + // In most cases this should be very fast and good enough.
  3256 + extraEscapable.lastIndex = 0;
  3257 + if (!extraEscapable.test(quoted)) {
  3258 + return quoted;
  3259 + }
  3260 +
  3261 + if (!extraLookup) {
  3262 + extraLookup = unrollLookup(extraEscapable);
  3263 + }
  3264 +
  3265 + return quoted.replace(extraEscapable, function(a) {
  3266 + return extraLookup[a];
  3267 + });
  3268 + }
  3269 +};
  3270 +
  3271 +},{"json3":57}],46:[function(require,module,exports){
  3272 +(function (global){
  3273 +'use strict';
  3274 +
  3275 +var random = require('./random');
  3276 +
  3277 +var onUnload = {}
  3278 + , afterUnload = false
  3279 + // detect google chrome packaged apps because they don't allow the 'unload' event
  3280 + , isChromePackagedApp = global.chrome && global.chrome.app && global.chrome.app.runtime
  3281 + ;
  3282 +
  3283 +module.exports = {
  3284 + attachEvent: function(event, listener) {
  3285 + if (typeof global.addEventListener !== 'undefined') {
  3286 + global.addEventListener(event, listener, false);
  3287 + } else if (global.document && global.attachEvent) {
  3288 + // IE quirks.
  3289 + // According to: http://stevesouders.com/misc/test-postmessage.php
  3290 + // the message gets delivered only to 'document', not 'window'.
  3291 + global.document.attachEvent('on' + event, listener);
  3292 + // I get 'window' for ie8.
  3293 + global.attachEvent('on' + event, listener);
  3294 + }
  3295 + }
  3296 +
  3297 +, detachEvent: function(event, listener) {
  3298 + if (typeof global.addEventListener !== 'undefined') {
  3299 + global.removeEventListener(event, listener, false);
  3300 + } else if (global.document && global.detachEvent) {
  3301 + global.document.detachEvent('on' + event, listener);
  3302 + global.detachEvent('on' + event, listener);
  3303 + }
  3304 + }
  3305 +
  3306 +, unloadAdd: function(listener) {
  3307 + if (isChromePackagedApp) {
  3308 + return null;
  3309 + }
  3310 +
  3311 + var ref = random.string(8);
  3312 + onUnload[ref] = listener;
  3313 + if (afterUnload) {
  3314 + setTimeout(this.triggerUnloadCallbacks, 0);
  3315 + }
  3316 + return ref;
  3317 + }
  3318 +
  3319 +, unloadDel: function(ref) {
  3320 + if (ref in onUnload) {
  3321 + delete onUnload[ref];
  3322 + }
  3323 + }
  3324 +
  3325 +, triggerUnloadCallbacks: function() {
  3326 + for (var ref in onUnload) {
  3327 + onUnload[ref]();
  3328 + delete onUnload[ref];
  3329 + }
  3330 + }
  3331 +};
  3332 +
  3333 +var unloadTriggered = function() {
  3334 + if (afterUnload) {
  3335 + return;
  3336 + }
  3337 + afterUnload = true;
  3338 + module.exports.triggerUnloadCallbacks();
  3339 +};
  3340 +
  3341 +// 'unload' alone is not reliable in opera within an iframe, but we
  3342 +// can't use `beforeunload` as IE fires it on javascript: links.
  3343 +if (!isChromePackagedApp) {
  3344 + module.exports.attachEvent('unload', unloadTriggered);
  3345 +}
  3346 +
  3347 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3348 +
  3349 +},{"./random":50}],47:[function(require,module,exports){
  3350 +(function (process,global){
  3351 +'use strict';
  3352 +
  3353 +var eventUtils = require('./event')
  3354 + , JSON3 = require('json3')
  3355 + , browser = require('./browser')
  3356 + ;
  3357 +
  3358 +var debug = function() {};
  3359 +if (process.env.NODE_ENV !== 'production') {
  3360 + debug = require('debug')('sockjs-client:utils:iframe');
  3361 +}
  3362 +
  3363 +module.exports = {
  3364 + WPrefix: '_jp'
  3365 +, currentWindowId: null
  3366 +
  3367 +, polluteGlobalNamespace: function() {
  3368 + if (!(module.exports.WPrefix in global)) {
  3369 + global[module.exports.WPrefix] = {};
  3370 + }
  3371 + }
  3372 +
  3373 +, postMessage: function(type, data) {
  3374 + if (global.parent !== global) {
  3375 + global.parent.postMessage(JSON3.stringify({
  3376 + windowId: module.exports.currentWindowId
  3377 + , type: type
  3378 + , data: data || ''
  3379 + }), '*');
  3380 + } else {
  3381 + debug('Cannot postMessage, no parent window.', type, data);
  3382 + }
  3383 + }
  3384 +
  3385 +, createIframe: function(iframeUrl, errorCallback) {
  3386 + var iframe = global.document.createElement('iframe');
  3387 + var tref, unloadRef;
  3388 + var unattach = function() {
  3389 + debug('unattach');
  3390 + clearTimeout(tref);
  3391 + // Explorer had problems with that.
  3392 + try {
  3393 + iframe.onload = null;
  3394 + } catch (x) {
  3395 + // intentionally empty
  3396 + }
  3397 + iframe.onerror = null;
  3398 + };
  3399 + var cleanup = function() {
  3400 + debug('cleanup');
  3401 + if (iframe) {
  3402 + unattach();
  3403 + // This timeout makes chrome fire onbeforeunload event
  3404 + // within iframe. Without the timeout it goes straight to
  3405 + // onunload.
  3406 + setTimeout(function() {
  3407 + if (iframe) {
  3408 + iframe.parentNode.removeChild(iframe);
  3409 + }
  3410 + iframe = null;
  3411 + }, 0);
  3412 + eventUtils.unloadDel(unloadRef);
  3413 + }
  3414 + };
  3415 + var onerror = function(err) {
  3416 + debug('onerror', err);
  3417 + if (iframe) {
  3418 + cleanup();
  3419 + errorCallback(err);
  3420 + }
  3421 + };
  3422 + var post = function(msg, origin) {
  3423 + debug('post', msg, origin);
  3424 + try {
  3425 + // When the iframe is not loaded, IE raises an exception
  3426 + // on 'contentWindow'.
  3427 + setTimeout(function() {
  3428 + if (iframe && iframe.contentWindow) {
  3429 + iframe.contentWindow.postMessage(msg, origin);
  3430 + }
  3431 + }, 0);
  3432 + } catch (x) {
  3433 + // intentionally empty
  3434 + }
  3435 + };
  3436 +
  3437 + iframe.src = iframeUrl;
  3438 + iframe.style.display = 'none';
  3439 + iframe.style.position = 'absolute';
  3440 + iframe.onerror = function() {
  3441 + onerror('onerror');
  3442 + };
  3443 + iframe.onload = function() {
  3444 + debug('onload');
  3445 + // `onload` is triggered before scripts on the iframe are
  3446 + // executed. Give it few seconds to actually load stuff.
  3447 + clearTimeout(tref);
  3448 + tref = setTimeout(function() {
  3449 + onerror('onload timeout');
  3450 + }, 2000);
  3451 + };
  3452 + global.document.body.appendChild(iframe);
  3453 + tref = setTimeout(function() {
  3454 + onerror('timeout');
  3455 + }, 15000);
  3456 + unloadRef = eventUtils.unloadAdd(cleanup);
  3457 + return {
  3458 + post: post
  3459 + , cleanup: cleanup
  3460 + , loaded: unattach
  3461 + };
  3462 + }
  3463 +
  3464 +/* eslint no-undef: "off", new-cap: "off" */
  3465 +, createHtmlfile: function(iframeUrl, errorCallback) {
  3466 + var axo = ['Active'].concat('Object').join('X');
  3467 + var doc = new global[axo]('htmlfile');
  3468 + var tref, unloadRef;
  3469 + var iframe;
  3470 + var unattach = function() {
  3471 + clearTimeout(tref);
  3472 + iframe.onerror = null;
  3473 + };
  3474 + var cleanup = function() {
  3475 + if (doc) {
  3476 + unattach();
  3477 + eventUtils.unloadDel(unloadRef);
  3478 + iframe.parentNode.removeChild(iframe);
  3479 + iframe = doc = null;
  3480 + CollectGarbage();
  3481 + }
  3482 + };
  3483 + var onerror = function(r) {
  3484 + debug('onerror', r);
  3485 + if (doc) {
  3486 + cleanup();
  3487 + errorCallback(r);
  3488 + }
  3489 + };
  3490 + var post = function(msg, origin) {
  3491 + try {
  3492 + // When the iframe is not loaded, IE raises an exception
  3493 + // on 'contentWindow'.
  3494 + setTimeout(function() {
  3495 + if (iframe && iframe.contentWindow) {
  3496 + iframe.contentWindow.postMessage(msg, origin);
  3497 + }
  3498 + }, 0);
  3499 + } catch (x) {
  3500 + // intentionally empty
  3501 + }
  3502 + };
  3503 +
  3504 + doc.open();
  3505 + doc.write('<html><s' + 'cript>' +
  3506 + 'document.domain="' + global.document.domain + '";' +
  3507 + '</s' + 'cript></html>');
  3508 + doc.close();
  3509 + doc.parentWindow[module.exports.WPrefix] = global[module.exports.WPrefix];
  3510 + var c = doc.createElement('div');
  3511 + doc.body.appendChild(c);
  3512 + iframe = doc.createElement('iframe');
  3513 + c.appendChild(iframe);
  3514 + iframe.src = iframeUrl;
  3515 + iframe.onerror = function() {
  3516 + onerror('onerror');
  3517 + };
  3518 + tref = setTimeout(function() {
  3519 + onerror('timeout');
  3520 + }, 15000);
  3521 + unloadRef = eventUtils.unloadAdd(cleanup);
  3522 + return {
  3523 + post: post
  3524 + , cleanup: cleanup
  3525 + , loaded: unattach
  3526 + };
  3527 + }
  3528 +};
  3529 +
  3530 +module.exports.iframeEnabled = false;
  3531 +if (global.document) {
  3532 + // postMessage misbehaves in konqueror 4.6.5 - the messages are delivered with
  3533 + // huge delay, or not at all.
  3534 + module.exports.iframeEnabled = (typeof global.postMessage === 'function' ||
  3535 + typeof global.postMessage === 'object') && (!browser.isKonqueror());
  3536 +}
  3537 +
  3538 +}).call(this,{ env: {} },typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3539 +
  3540 +},{"./browser":44,"./event":46,"debug":54,"json3":57}],48:[function(require,module,exports){
  3541 +(function (global){
  3542 +'use strict';
  3543 +
  3544 +var logObject = {};
  3545 +['log', 'debug', 'warn'].forEach(function (level) {
  3546 + var levelExists;
  3547 +
  3548 + try {
  3549 + levelExists = global.console && global.console[level] && global.console[level].apply;
  3550 + } catch(e) {
  3551 + // do nothing
  3552 + }
  3553 +
  3554 + logObject[level] = levelExists ? function () {
  3555 + return global.console[level].apply(global.console, arguments);
  3556 + } : (level === 'log' ? function () {} : logObject.log);
  3557 +});
  3558 +
  3559 +module.exports = logObject;
  3560 +
  3561 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  3562 +
  3563 +},{}],49:[function(require,module,exports){
  3564 +'use strict';
  3565 +
  3566 +module.exports = {
  3567 + isObject: function(obj) {
  3568 + var type = typeof obj;
  3569 + return type === 'function' || type === 'object' && !!obj;
  3570 + }
  3571 +
  3572 +, extend: function(obj) {
  3573 + if (!this.isObject(obj)) {
  3574 + return obj;
  3575 + }
  3576 + var source, prop;
  3577 + for (var i = 1, length = arguments.length; i < length; i++) {
  3578 + source = arguments[i];
  3579 + for (prop in source) {
  3580 + if (Object.prototype.hasOwnProperty.call(source, prop)) {
  3581 + obj[prop] = source[prop];
  3582 + }
  3583 + }
  3584 + }
  3585 + return obj;
  3586 + }
  3587 +};
  3588 +
  3589 +},{}],50:[function(require,module,exports){
  3590 +'use strict';
  3591 +
  3592 +/* global crypto:true */
  3593 +var crypto = require('crypto');
  3594 +
  3595 +// This string has length 32, a power of 2, so the modulus doesn't introduce a
  3596 +// bias.
  3597 +var _randomStringChars = 'abcdefghijklmnopqrstuvwxyz012345';
  3598 +module.exports = {
  3599 + string: function(length) {
  3600 + var max = _randomStringChars.length;
  3601 + var bytes = crypto.randomBytes(length);
  3602 + var ret = [];
  3603 + for (var i = 0; i < length; i++) {
  3604 + ret.push(_randomStringChars.substr(bytes[i] % max, 1));
  3605 + }
  3606 + return ret.join('');
  3607 + }
  3608 +
  3609 +, number: function(max) {
  3610 + return Math.floor(Math.random() * max);
  3611 + }
  3612 +
  3613 +, numberString: function(max) {
  3614 + var t = ('' + (max - 1)).length;
  3615 + var p = new Array(t + 1).join('0');
  3616 + return (p + this.number(max)).slice(-t);
  3617 + }
  3618 +};
  3619 +
  3620 +},{"crypto":43}],51:[function(require,module,exports){
  3621 +(function (process){
  3622 +'use strict';
  3623 +
  3624 +var debug = function() {};
  3625 +if (process.env.NODE_ENV !== 'production') {
  3626 + debug = require('debug')('sockjs-client:utils:transport');
  3627 +}
  3628 +
  3629 +module.exports = function(availableTransports) {
  3630 + return {
  3631 + filterToEnabled: function(transportsWhitelist, info) {
  3632 + var transports = {
  3633 + main: []
  3634 + , facade: []
  3635 + };
  3636 + if (!transportsWhitelist) {
  3637 + transportsWhitelist = [];
  3638 + } else if (typeof transportsWhitelist === 'string') {
  3639 + transportsWhitelist = [transportsWhitelist];
  3640 + }
  3641 +
  3642 + availableTransports.forEach(function(trans) {
  3643 + if (!trans) {
  3644 + return;
  3645 + }
  3646 +
  3647 + if (trans.transportName === 'websocket' && info.websocket === false) {
  3648 + debug('disabled from server', 'websocket');
  3649 + return;
  3650 + }
  3651 +
  3652 + if (transportsWhitelist.length &&
  3653 + transportsWhitelist.indexOf(trans.transportName) === -1) {
  3654 + debug('not in whitelist', trans.transportName);
  3655 + return;
  3656 + }
  3657 +
  3658 + if (trans.enabled(info)) {
  3659 + debug('enabled', trans.transportName);
  3660 + transports.main.push(trans);
  3661 + if (trans.facadeTransport) {
  3662 + transports.facade.push(trans.facadeTransport);
  3663 + }
  3664 + } else {
  3665 + debug('disabled', trans.transportName);
  3666 + }
  3667 + });
  3668 + return transports;
  3669 + }
  3670 + };
  3671 +};
  3672 +
  3673 +}).call(this,{ env: {} })
  3674 +
  3675 +},{"debug":54}],52:[function(require,module,exports){
  3676 +(function (process){
  3677 +'use strict';
  3678 +
  3679 +var URL = require('url-parse');
  3680 +
  3681 +var debug = function() {};
  3682 +if (process.env.NODE_ENV !== 'production') {
  3683 + debug = require('debug')('sockjs-client:utils:url');
  3684 +}
  3685 +
  3686 +module.exports = {
  3687 + getOrigin: function(url) {
  3688 + if (!url) {
  3689 + return null;
  3690 + }
  3691 +
  3692 + var p = new URL(url);
  3693 + if (p.protocol === 'file:') {
  3694 + return null;
  3695 + }
  3696 +
  3697 + var port = p.port;
  3698 + if (!port) {
  3699 + port = (p.protocol === 'https:') ? '443' : '80';
  3700 + }
  3701 +
  3702 + return p.protocol + '//' + p.hostname + ':' + port;
  3703 + }
  3704 +
  3705 +, isOriginEqual: function(a, b) {
  3706 + var res = this.getOrigin(a) === this.getOrigin(b);
  3707 + debug('same', a, b, res);
  3708 + return res;
  3709 + }
  3710 +
  3711 +, isSchemeEqual: function(a, b) {
  3712 + return (a.split(':')[0] === b.split(':')[0]);
  3713 + }
  3714 +
  3715 +, addPath: function (url, path) {
  3716 + var qs = url.split('?');
  3717 + return qs[0] + path + (qs[1] ? '?' + qs[1] : '');
  3718 + }
  3719 +
  3720 +, addQuery: function (url, q) {
  3721 + return url + (url.indexOf('?') === -1 ? ('?' + q) : ('&' + q));
  3722 + }
  3723 +};
  3724 +
  3725 +}).call(this,{ env: {} })
  3726 +
  3727 +},{"debug":54,"url-parse":61}],53:[function(require,module,exports){
  3728 +module.exports = '1.1.2';
  3729 +
  3730 +},{}],54:[function(require,module,exports){
  3731 +(function (process){
  3732 +/**
  3733 + * This is the web browser implementation of `debug()`.
  3734 + *
  3735 + * Expose `debug()` as the module.
  3736 + */
  3737 +
  3738 +exports = module.exports = require('./debug');
  3739 +exports.log = log;
  3740 +exports.formatArgs = formatArgs;
  3741 +exports.save = save;
  3742 +exports.load = load;
  3743 +exports.useColors = useColors;
  3744 +exports.storage = 'undefined' != typeof chrome
  3745 + && 'undefined' != typeof chrome.storage
  3746 + ? chrome.storage.local
  3747 + : localstorage();
  3748 +
  3749 +/**
  3750 + * Colors.
  3751 + */
  3752 +
  3753 +exports.colors = [
  3754 + 'lightseagreen',
  3755 + 'forestgreen',
  3756 + 'goldenrod',
  3757 + 'dodgerblue',
  3758 + 'darkorchid',
  3759 + 'crimson'
  3760 +];
  3761 +
  3762 +/**
  3763 + * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  3764 + * and the Firebug extension (any Firefox version) are known
  3765 + * to support "%c" CSS customizations.
  3766 + *
  3767 + * TODO: add a `localStorage` variable to explicitly enable/disable colors
  3768 + */
  3769 +
  3770 +function useColors() {
  3771 + // NB: In an Electron preload script, document will be defined but not fully
  3772 + // initialized. Since we know we're in Chrome, we'll just detect this case
  3773 + // explicitly
  3774 + if (typeof window !== 'undefined' && window && typeof window.process !== 'undefined' && window.process.type === 'renderer') {
  3775 + return true;
  3776 + }
  3777 +
  3778 + // is webkit? http://stackoverflow.com/a/16459606/376773
  3779 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  3780 + return (typeof document !== 'undefined' && document && 'WebkitAppearance' in document.documentElement.style) ||
  3781 + // is firebug? http://stackoverflow.com/a/398120/376773
  3782 + (typeof window !== 'undefined' && window && window.console && (console.firebug || (console.exception && console.table))) ||
  3783 + // is firefox >= v31?
  3784 + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  3785 + (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  3786 + // double check webkit in userAgent just in case we are in a worker
  3787 + (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  3788 +}
  3789 +
  3790 +/**
  3791 + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  3792 + */
  3793 +
  3794 +exports.formatters.j = function(v) {
  3795 + try {
  3796 + return JSON.stringify(v);
  3797 + } catch (err) {
  3798 + return '[UnexpectedJSONParseError]: ' + err.message;
  3799 + }
  3800 +};
  3801 +
  3802 +
  3803 +/**
  3804 + * Colorize log arguments if enabled.
  3805 + *
  3806 + * @api public
  3807 + */
  3808 +
  3809 +function formatArgs(args) {
  3810 + var useColors = this.useColors;
  3811 +
  3812 + args[0] = (useColors ? '%c' : '')
  3813 + + this.namespace
  3814 + + (useColors ? ' %c' : ' ')
  3815 + + args[0]
  3816 + + (useColors ? '%c ' : ' ')
  3817 + + '+' + exports.humanize(this.diff);
  3818 +
  3819 + if (!useColors) return;
  3820 +
  3821 + var c = 'color: ' + this.color;
  3822 + args.splice(1, 0, c, 'color: inherit')
  3823 +
  3824 + // the final "%c" is somewhat tricky, because there could be other
  3825 + // arguments passed either before or after the %c, so we need to
  3826 + // figure out the correct index to insert the CSS into
  3827 + var index = 0;
  3828 + var lastC = 0;
  3829 + args[0].replace(/%[a-zA-Z%]/g, function(match) {
  3830 + if ('%%' === match) return;
  3831 + index++;
  3832 + if ('%c' === match) {
  3833 + // we only are interested in the *last* %c
  3834 + // (the user may have provided their own)
  3835 + lastC = index;
  3836 + }
  3837 + });
  3838 +
  3839 + args.splice(lastC, 0, c);
  3840 +}
  3841 +
  3842 +/**
  3843 + * Invokes `console.log()` when available.
  3844 + * No-op when `console.log` is not a "function".
  3845 + *
  3846 + * @api public
  3847 + */
  3848 +
  3849 +function log() {
  3850 + // this hackery is required for IE8/9, where
  3851 + // the `console.log` function doesn't have 'apply'
  3852 + return 'object' === typeof console
  3853 + && console.log
  3854 + && Function.prototype.apply.call(console.log, console, arguments);
  3855 +}
  3856 +
  3857 +/**
  3858 + * Save `namespaces`.
  3859 + *
  3860 + * @param {String} namespaces
  3861 + * @api private
  3862 + */
  3863 +
  3864 +function save(namespaces) {
  3865 + try {
  3866 + if (null == namespaces) {
  3867 + exports.storage.removeItem('debug');
  3868 + } else {
  3869 + exports.storage.debug = namespaces;
  3870 + }
  3871 + } catch(e) {}
  3872 +}
  3873 +
  3874 +/**
  3875 + * Load `namespaces`.
  3876 + *
  3877 + * @return {String} returns the previously persisted debug modes
  3878 + * @api private
  3879 + */
  3880 +
  3881 +function load() {
  3882 + try {
  3883 + return exports.storage.debug;
  3884 + } catch(e) {}
  3885 +
  3886 + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  3887 + if (typeof process !== 'undefined' && 'env' in process) {
  3888 + return process.env.DEBUG;
  3889 + }
  3890 +}
  3891 +
  3892 +/**
  3893 + * Enable namespaces listed in `localStorage.debug` initially.
  3894 + */
  3895 +
  3896 +exports.enable(load());
  3897 +
  3898 +/**
  3899 + * Localstorage attempts to return the localstorage.
  3900 + *
  3901 + * This is necessary because safari throws
  3902 + * when a user disables cookies/localstorage
  3903 + * and you attempt to access it.
  3904 + *
  3905 + * @return {LocalStorage}
  3906 + * @api private
  3907 + */
  3908 +
  3909 +function localstorage() {
  3910 + try {
  3911 + return window.localStorage;
  3912 + } catch (e) {}
  3913 +}
  3914 +
  3915 +}).call(this,{ env: {} })
  3916 +
  3917 +},{"./debug":55}],55:[function(require,module,exports){
  3918 +
  3919 +/**
  3920 + * This is the common logic for both the Node.js and web browser
  3921 + * implementations of `debug()`.
  3922 + *
  3923 + * Expose `debug()` as the module.
  3924 + */
  3925 +
  3926 +exports = module.exports = createDebug.debug = createDebug.default = createDebug;
  3927 +exports.coerce = coerce;
  3928 +exports.disable = disable;
  3929 +exports.enable = enable;
  3930 +exports.enabled = enabled;
  3931 +exports.humanize = require('ms');
  3932 +
  3933 +/**
  3934 + * The currently active debug mode names, and names to skip.
  3935 + */
  3936 +
  3937 +exports.names = [];
  3938 +exports.skips = [];
  3939 +
  3940 +/**
  3941 + * Map of special "%n" handling functions, for the debug "format" argument.
  3942 + *
  3943 + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  3944 + */
  3945 +
  3946 +exports.formatters = {};
  3947 +
  3948 +/**
  3949 + * Previous log timestamp.
  3950 + */
  3951 +
  3952 +var prevTime;
  3953 +
  3954 +/**
  3955 + * Select a color.
  3956 + * @param {String} namespace
  3957 + * @return {Number}
  3958 + * @api private
  3959 + */
  3960 +
  3961 +function selectColor(namespace) {
  3962 + var hash = 0, i;
  3963 +
  3964 + for (i in namespace) {
  3965 + hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  3966 + hash |= 0; // Convert to 32bit integer
  3967 + }
  3968 +
  3969 + return exports.colors[Math.abs(hash) % exports.colors.length];
  3970 +}
  3971 +
  3972 +/**
  3973 + * Create a debugger with the given `namespace`.
  3974 + *
  3975 + * @param {String} namespace
  3976 + * @return {Function}
  3977 + * @api public
  3978 + */
  3979 +
  3980 +function createDebug(namespace) {
  3981 +
  3982 + function debug() {
  3983 + // disabled?
  3984 + if (!debug.enabled) return;
  3985 +
  3986 + var self = debug;
  3987 +
  3988 + // set `diff` timestamp
  3989 + var curr = +new Date();
  3990 + var ms = curr - (prevTime || curr);
  3991 + self.diff = ms;
  3992 + self.prev = prevTime;
  3993 + self.curr = curr;
  3994 + prevTime = curr;
  3995 +
  3996 + // turn the `arguments` into a proper Array
  3997 + var args = new Array(arguments.length);
  3998 + for (var i = 0; i < args.length; i++) {
  3999 + args[i] = arguments[i];
  4000 + }
  4001 +
  4002 + args[0] = exports.coerce(args[0]);
  4003 +
  4004 + if ('string' !== typeof args[0]) {
  4005 + // anything else let's inspect with %O
  4006 + args.unshift('%O');
  4007 + }
  4008 +
  4009 + // apply any `formatters` transformations
  4010 + var index = 0;
  4011 + args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
  4012 + // if we encounter an escaped % then don't increase the array index
  4013 + if (match === '%%') return match;
  4014 + index++;
  4015 + var formatter = exports.formatters[format];
  4016 + if ('function' === typeof formatter) {
  4017 + var val = args[index];
  4018 + match = formatter.call(self, val);
  4019 +
  4020 + // now we need to remove `args[index]` since it's inlined in the `format`
  4021 + args.splice(index, 1);
  4022 + index--;
  4023 + }
  4024 + return match;
  4025 + });
  4026 +
  4027 + // apply env-specific formatting (colors, etc.)
  4028 + exports.formatArgs.call(self, args);
  4029 +
  4030 + var logFn = debug.log || exports.log || console.log.bind(console);
  4031 + logFn.apply(self, args);
  4032 + }
  4033 +
  4034 + debug.namespace = namespace;
  4035 + debug.enabled = exports.enabled(namespace);
  4036 + debug.useColors = exports.useColors();
  4037 + debug.color = selectColor(namespace);
  4038 +
  4039 + // env-specific initialization logic for debug instances
  4040 + if ('function' === typeof exports.init) {
  4041 + exports.init(debug);
  4042 + }
  4043 +
  4044 + return debug;
  4045 +}
  4046 +
  4047 +/**
  4048 + * Enables a debug mode by namespaces. This can include modes
  4049 + * separated by a colon and wildcards.
  4050 + *
  4051 + * @param {String} namespaces
  4052 + * @api public
  4053 + */
  4054 +
  4055 +function enable(namespaces) {
  4056 + exports.save(namespaces);
  4057 +
  4058 + var split = (namespaces || '').split(/[\s,]+/);
  4059 + var len = split.length;
  4060 +
  4061 + for (var i = 0; i < len; i++) {
  4062 + if (!split[i]) continue; // ignore empty strings
  4063 + namespaces = split[i].replace(/\*/g, '.*?');
  4064 + if (namespaces[0] === '-') {
  4065 + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  4066 + } else {
  4067 + exports.names.push(new RegExp('^' + namespaces + '$'));
  4068 + }
  4069 + }
  4070 +}
  4071 +
  4072 +/**
  4073 + * Disable debug output.
  4074 + *
  4075 + * @api public
  4076 + */
  4077 +
  4078 +function disable() {
  4079 + exports.enable('');
  4080 +}
  4081 +
  4082 +/**
  4083 + * Returns true if the given mode name is enabled, false otherwise.
  4084 + *
  4085 + * @param {String} name
  4086 + * @return {Boolean}
  4087 + * @api public
  4088 + */
  4089 +
  4090 +function enabled(name) {
  4091 + var i, len;
  4092 + for (i = 0, len = exports.skips.length; i < len; i++) {
  4093 + if (exports.skips[i].test(name)) {
  4094 + return false;
  4095 + }
  4096 + }
  4097 + for (i = 0, len = exports.names.length; i < len; i++) {
  4098 + if (exports.names[i].test(name)) {
  4099 + return true;
  4100 + }
  4101 + }
  4102 + return false;
  4103 +}
  4104 +
  4105 +/**
  4106 + * Coerce `val`.
  4107 + *
  4108 + * @param {Mixed} val
  4109 + * @return {Mixed}
  4110 + * @api private
  4111 + */
  4112 +
  4113 +function coerce(val) {
  4114 + if (val instanceof Error) return val.stack || val.message;
  4115 + return val;
  4116 +}
  4117 +
  4118 +},{"ms":58}],56:[function(require,module,exports){
  4119 +if (typeof Object.create === 'function') {
  4120 + // implementation from standard node.js 'util' module
  4121 + module.exports = function inherits(ctor, superCtor) {
  4122 + ctor.super_ = superCtor
  4123 + ctor.prototype = Object.create(superCtor.prototype, {
  4124 + constructor: {
  4125 + value: ctor,
  4126 + enumerable: false,
  4127 + writable: true,
  4128 + configurable: true
  4129 + }
  4130 + });
  4131 + };
  4132 +} else {
  4133 + // old school shim for old browsers
  4134 + module.exports = function inherits(ctor, superCtor) {
  4135 + ctor.super_ = superCtor
  4136 + var TempCtor = function () {}
  4137 + TempCtor.prototype = superCtor.prototype
  4138 + ctor.prototype = new TempCtor()
  4139 + ctor.prototype.constructor = ctor
  4140 + }
  4141 +}
  4142 +
  4143 +},{}],57:[function(require,module,exports){
  4144 +(function (global){
  4145 +/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
  4146 +;(function () {
  4147 + // Detect the `define` function exposed by asynchronous module loaders. The
  4148 + // strict `define` check is necessary for compatibility with `r.js`.
  4149 + var isLoader = typeof define === "function" && define.amd;
  4150 +
  4151 + // A set of types used to distinguish objects from primitives.
  4152 + var objectTypes = {
  4153 + "function": true,
  4154 + "object": true
  4155 + };
  4156 +
  4157 + // Detect the `exports` object exposed by CommonJS implementations.
  4158 + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
  4159 +
  4160 + // Use the `global` object exposed by Node (including Browserify via
  4161 + // `insert-module-globals`), Narwhal, and Ringo as the default context,
  4162 + // and the `window` object in browsers. Rhino exports a `global` function
  4163 + // instead.
  4164 + var root = objectTypes[typeof window] && window || this,
  4165 + freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == "object" && global;
  4166 +
  4167 + if (freeGlobal && (freeGlobal["global"] === freeGlobal || freeGlobal["window"] === freeGlobal || freeGlobal["self"] === freeGlobal)) {
  4168 + root = freeGlobal;
  4169 + }
  4170 +
  4171 + // Public: Initializes JSON 3 using the given `context` object, attaching the
  4172 + // `stringify` and `parse` functions to the specified `exports` object.
  4173 + function runInContext(context, exports) {
  4174 + context || (context = root["Object"]());
  4175 + exports || (exports = root["Object"]());
  4176 +
  4177 + // Native constructor aliases.
  4178 + var Number = context["Number"] || root["Number"],
  4179 + String = context["String"] || root["String"],
  4180 + Object = context["Object"] || root["Object"],
  4181 + Date = context["Date"] || root["Date"],
  4182 + SyntaxError = context["SyntaxError"] || root["SyntaxError"],
  4183 + TypeError = context["TypeError"] || root["TypeError"],
  4184 + Math = context["Math"] || root["Math"],
  4185 + nativeJSON = context["JSON"] || root["JSON"];
  4186 +
  4187 + // Delegate to the native `stringify` and `parse` implementations.
  4188 + if (typeof nativeJSON == "object" && nativeJSON) {
  4189 + exports.stringify = nativeJSON.stringify;
  4190 + exports.parse = nativeJSON.parse;
  4191 + }
  4192 +
  4193 + // Convenience aliases.
  4194 + var objectProto = Object.prototype,
  4195 + getClass = objectProto.toString,
  4196 + isProperty, forEach, undef;
  4197 +
  4198 + // Test the `Date#getUTC*` methods. Based on work by @Yaffle.
  4199 + var isExtended = new Date(-3509827334573292);
  4200 + try {
  4201 + // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical
  4202 + // results for certain dates in Opera >= 10.53.
  4203 + isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&
  4204 + // Safari < 2.0.2 stores the internal millisecond time value correctly,
  4205 + // but clips the values returned by the date methods to the range of
  4206 + // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).
  4207 + isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;
  4208 + } catch (exception) {}
  4209 +
  4210 + // Internal: Determines whether the native `JSON.stringify` and `parse`
  4211 + // implementations are spec-compliant. Based on work by Ken Snyder.
  4212 + function has(name) {
  4213 + if (has[name] !== undef) {
  4214 + // Return cached feature test result.
  4215 + return has[name];
  4216 + }
  4217 + var isSupported;
  4218 + if (name == "bug-string-char-index") {
  4219 + // IE <= 7 doesn't support accessing string characters using square
  4220 + // bracket notation. IE 8 only supports this for primitives.
  4221 + isSupported = "a"[0] != "a";
  4222 + } else if (name == "json") {
  4223 + // Indicates whether both `JSON.stringify` and `JSON.parse` are
  4224 + // supported.
  4225 + isSupported = has("json-stringify") && has("json-parse");
  4226 + } else {
  4227 + var value, serialized = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
  4228 + // Test `JSON.stringify`.
  4229 + if (name == "json-stringify") {
  4230 + var stringify = exports.stringify, stringifySupported = typeof stringify == "function" && isExtended;
  4231 + if (stringifySupported) {
  4232 + // A test function object with a custom `toJSON` method.
  4233 + (value = function () {
  4234 + return 1;
  4235 + }).toJSON = value;
  4236 + try {
  4237 + stringifySupported =
  4238 + // Firefox 3.1b1 and b2 serialize string, number, and boolean
  4239 + // primitives as object literals.
  4240 + stringify(0) === "0" &&
  4241 + // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object
  4242 + // literals.
  4243 + stringify(new Number()) === "0" &&
  4244 + stringify(new String()) == '""' &&
  4245 + // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or
  4246 + // does not define a canonical JSON representation (this applies to
  4247 + // objects with `toJSON` properties as well, *unless* they are nested
  4248 + // within an object or array).
  4249 + stringify(getClass) === undef &&
  4250 + // IE 8 serializes `undefined` as `"undefined"`. Safari <= 5.1.7 and
  4251 + // FF 3.1b3 pass this test.
  4252 + stringify(undef) === undef &&
  4253 + // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,
  4254 + // respectively, if the value is omitted entirely.
  4255 + stringify() === undef &&
  4256 + // FF 3.1b1, 2 throw an error if the given value is not a number,
  4257 + // string, array, object, Boolean, or `null` literal. This applies to
  4258 + // objects with custom `toJSON` methods as well, unless they are nested
  4259 + // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`
  4260 + // methods entirely.
  4261 + stringify(value) === "1" &&
  4262 + stringify([value]) == "[1]" &&
  4263 + // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of
  4264 + // `"[null]"`.
  4265 + stringify([undef]) == "[null]" &&
  4266 + // YUI 3.0.0b1 fails to serialize `null` literals.
  4267 + stringify(null) == "null" &&
  4268 + // FF 3.1b1, 2 halts serialization if an array contains a function:
  4269 + // `[1, true, getClass, 1]` serializes as "[1,true,],". FF 3.1b3
  4270 + // elides non-JSON values from objects and arrays, unless they
  4271 + // define custom `toJSON` methods.
  4272 + stringify([undef, getClass, null]) == "[null,null,null]" &&
  4273 + // Simple serialization test. FF 3.1b1 uses Unicode escape sequences
  4274 + // where character escape codes are expected (e.g., `\b` => `\u0008`).
  4275 + stringify({ "a": [value, true, false, null, "\x00\b\n\f\r\t"] }) == serialized &&
  4276 + // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.
  4277 + stringify(null, value) === "1" &&
  4278 + stringify([1, 2], null, 1) == "[\n 1,\n 2\n]" &&
  4279 + // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly
  4280 + // serialize extended years.
  4281 + stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"' &&
  4282 + // The milliseconds are optional in ES 5, but required in 5.1.
  4283 + stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"' &&
  4284 + // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative
  4285 + // four-digit years instead of six-digit years. Credits: @Yaffle.
  4286 + stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' &&
  4287 + // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond
  4288 + // values less than 1000. Credits: @Yaffle.
  4289 + stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"';
  4290 + } catch (exception) {
  4291 + stringifySupported = false;
  4292 + }
  4293 + }
  4294 + isSupported = stringifySupported;
  4295 + }
  4296 + // Test `JSON.parse`.
  4297 + if (name == "json-parse") {
  4298 + var parse = exports.parse;
  4299 + if (typeof parse == "function") {
  4300 + try {
  4301 + // FF 3.1b1, b2 will throw an exception if a bare literal is provided.
  4302 + // Conforming implementations should also coerce the initial argument to
  4303 + // a string prior to parsing.
  4304 + if (parse("0") === 0 && !parse(false)) {
  4305 + // Simple parsing test.
  4306 + value = parse(serialized);
  4307 + var parseSupported = value["a"].length == 5 && value["a"][0] === 1;
  4308 + if (parseSupported) {
  4309 + try {
  4310 + // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.
  4311 + parseSupported = !parse('"\t"');
  4312 + } catch (exception) {}
  4313 + if (parseSupported) {
  4314 + try {
  4315 + // FF 4.0 and 4.0.1 allow leading `+` signs and leading
  4316 + // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow
  4317 + // certain octal literals.
  4318 + parseSupported = parse("01") !== 1;
  4319 + } catch (exception) {}
  4320 + }
  4321 + if (parseSupported) {
  4322 + try {
  4323 + // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal
  4324 + // points. These environments, along with FF 3.1b1 and 2,
  4325 + // also allow trailing commas in JSON objects and arrays.
  4326 + parseSupported = parse("1.") !== 1;
  4327 + } catch (exception) {}
  4328 + }
  4329 + }
  4330 + }
  4331 + } catch (exception) {
  4332 + parseSupported = false;
  4333 + }
  4334 + }
  4335 + isSupported = parseSupported;
  4336 + }
  4337 + }
  4338 + return has[name] = !!isSupported;
  4339 + }
  4340 +
  4341 + if (!has("json")) {
  4342 + // Common `[[Class]]` name aliases.
  4343 + var functionClass = "[object Function]",
  4344 + dateClass = "[object Date]",
  4345 + numberClass = "[object Number]",
  4346 + stringClass = "[object String]",
  4347 + arrayClass = "[object Array]",
  4348 + booleanClass = "[object Boolean]";
  4349 +
  4350 + // Detect incomplete support for accessing string characters by index.
  4351 + var charIndexBuggy = has("bug-string-char-index");
  4352 +
  4353 + // Define additional utility methods if the `Date` methods are buggy.
  4354 + if (!isExtended) {
  4355 + var floor = Math.floor;
  4356 + // A mapping between the months of the year and the number of days between
  4357 + // January 1st and the first of the respective month.
  4358 + var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
  4359 + // Internal: Calculates the number of days between the Unix epoch and the
  4360 + // first day of the given month.
  4361 + var getDay = function (year, month) {
  4362 + return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);
  4363 + };
  4364 + }
  4365 +
  4366 + // Internal: Determines if a property is a direct property of the given
  4367 + // object. Delegates to the native `Object#hasOwnProperty` method.
  4368 + if (!(isProperty = objectProto.hasOwnProperty)) {
  4369 + isProperty = function (property) {
  4370 + var members = {}, constructor;
  4371 + if ((members.__proto__ = null, members.__proto__ = {
  4372 + // The *proto* property cannot be set multiple times in recent
  4373 + // versions of Firefox and SeaMonkey.
  4374 + "toString": 1
  4375 + }, members).toString != getClass) {
  4376 + // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but
  4377 + // supports the mutable *proto* property.
  4378 + isProperty = function (property) {
  4379 + // Capture and break the object's prototype chain (see section 8.6.2
  4380 + // of the ES 5.1 spec). The parenthesized expression prevents an
  4381 + // unsafe transformation by the Closure Compiler.
  4382 + var original = this.__proto__, result = property in (this.__proto__ = null, this);
  4383 + // Restore the original prototype chain.
  4384 + this.__proto__ = original;
  4385 + return result;
  4386 + };
  4387 + } else {
  4388 + // Capture a reference to the top-level `Object` constructor.
  4389 + constructor = members.constructor;
  4390 + // Use the `constructor` property to simulate `Object#hasOwnProperty` in
  4391 + // other environments.
  4392 + isProperty = function (property) {
  4393 + var parent = (this.constructor || constructor).prototype;
  4394 + return property in this && !(property in parent && this[property] === parent[property]);
  4395 + };
  4396 + }
  4397 + members = null;
  4398 + return isProperty.call(this, property);
  4399 + };
  4400 + }
  4401 +
  4402 + // Internal: Normalizes the `for...in` iteration algorithm across
  4403 + // environments. Each enumerated key is yielded to a `callback` function.
  4404 + forEach = function (object, callback) {
  4405 + var size = 0, Properties, members, property;
  4406 +
  4407 + // Tests for bugs in the current environment's `for...in` algorithm. The
  4408 + // `valueOf` property inherits the non-enumerable flag from
  4409 + // `Object.prototype` in older versions of IE, Netscape, and Mozilla.
  4410 + (Properties = function () {
  4411 + this.valueOf = 0;
  4412 + }).prototype.valueOf = 0;
  4413 +
  4414 + // Iterate over a new instance of the `Properties` class.
  4415 + members = new Properties();
  4416 + for (property in members) {
  4417 + // Ignore all properties inherited from `Object.prototype`.
  4418 + if (isProperty.call(members, property)) {
  4419 + size++;
  4420 + }
  4421 + }
  4422 + Properties = members = null;
  4423 +
  4424 + // Normalize the iteration algorithm.
  4425 + if (!size) {
  4426 + // A list of non-enumerable properties inherited from `Object.prototype`.
  4427 + members = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"];
  4428 + // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable
  4429 + // properties.
  4430 + forEach = function (object, callback) {
  4431 + var isFunction = getClass.call(object) == functionClass, property, length;
  4432 + var hasProperty = !isFunction && typeof object.constructor != "function" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;
  4433 + for (property in object) {
  4434 + // Gecko <= 1.0 enumerates the `prototype` property of functions under
  4435 + // certain conditions; IE does not.
  4436 + if (!(isFunction && property == "prototype") && hasProperty.call(object, property)) {
  4437 + callback(property);
  4438 + }
  4439 + }
  4440 + // Manually invoke the callback for each non-enumerable property.
  4441 + for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));
  4442 + };
  4443 + } else if (size == 2) {
  4444 + // Safari <= 2.0.4 enumerates shadowed properties twice.
  4445 + forEach = function (object, callback) {
  4446 + // Create a set of iterated properties.
  4447 + var members = {}, isFunction = getClass.call(object) == functionClass, property;
  4448 + for (property in object) {
  4449 + // Store each property name to prevent double enumeration. The
  4450 + // `prototype` property of functions is not enumerated due to cross-
  4451 + // environment inconsistencies.
  4452 + if (!(isFunction && property == "prototype") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {
  4453 + callback(property);
  4454 + }
  4455 + }
  4456 + };
  4457 + } else {
  4458 + // No bugs detected; use the standard `for...in` algorithm.
  4459 + forEach = function (object, callback) {
  4460 + var isFunction = getClass.call(object) == functionClass, property, isConstructor;
  4461 + for (property in object) {
  4462 + if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) {
  4463 + callback(property);
  4464 + }
  4465 + }
  4466 + // Manually invoke the callback for the `constructor` property due to
  4467 + // cross-environment inconsistencies.
  4468 + if (isConstructor || isProperty.call(object, (property = "constructor"))) {
  4469 + callback(property);
  4470 + }
  4471 + };
  4472 + }
  4473 + return forEach(object, callback);
  4474 + };
  4475 +
  4476 + // Public: Serializes a JavaScript `value` as a JSON string. The optional
  4477 + // `filter` argument may specify either a function that alters how object and
  4478 + // array members are serialized, or an array of strings and numbers that
  4479 + // indicates which properties should be serialized. The optional `width`
  4480 + // argument may be either a string or number that specifies the indentation
  4481 + // level of the output.
  4482 + if (!has("json-stringify")) {
  4483 + // Internal: A map of control characters and their escaped equivalents.
  4484 + var Escapes = {
  4485 + 92: "\\\\",
  4486 + 34: '\\"',
  4487 + 8: "\\b",
  4488 + 12: "\\f",
  4489 + 10: "\\n",
  4490 + 13: "\\r",
  4491 + 9: "\\t"
  4492 + };
  4493 +
  4494 + // Internal: Converts `value` into a zero-padded string such that its
  4495 + // length is at least equal to `width`. The `width` must be <= 6.
  4496 + var leadingZeroes = "000000";
  4497 + var toPaddedString = function (width, value) {
  4498 + // The `|| 0` expression is necessary to work around a bug in
  4499 + // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`.
  4500 + return (leadingZeroes + (value || 0)).slice(-width);
  4501 + };
  4502 +
  4503 + // Internal: Double-quotes a string `value`, replacing all ASCII control
  4504 + // characters (characters with code unit values between 0 and 31) with
  4505 + // their escaped equivalents. This is an implementation of the
  4506 + // `Quote(value)` operation defined in ES 5.1 section 15.12.3.
  4507 + var unicodePrefix = "\\u00";
  4508 + var quote = function (value) {
  4509 + var result = '"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10;
  4510 + var symbols = useCharIndex && (charIndexBuggy ? value.split("") : value);
  4511 + for (; index < length; index++) {
  4512 + var charCode = value.charCodeAt(index);
  4513 + // If the character is a control character, append its Unicode or
  4514 + // shorthand escape sequence; otherwise, append the character as-is.
  4515 + switch (charCode) {
  4516 + case 8: case 9: case 10: case 12: case 13: case 34: case 92:
  4517 + result += Escapes[charCode];
  4518 + break;
  4519 + default:
  4520 + if (charCode < 32) {
  4521 + result += unicodePrefix + toPaddedString(2, charCode.toString(16));
  4522 + break;
  4523 + }
  4524 + result += useCharIndex ? symbols[index] : value.charAt(index);
  4525 + }
  4526 + }
  4527 + return result + '"';
  4528 + };
  4529 +
  4530 + // Internal: Recursively serializes an object. Implements the
  4531 + // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.
  4532 + var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {
  4533 + var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;
  4534 + try {
  4535 + // Necessary for host object support.
  4536 + value = object[property];
  4537 + } catch (exception) {}
  4538 + if (typeof value == "object" && value) {
  4539 + className = getClass.call(value);
  4540 + if (className == dateClass && !isProperty.call(value, "toJSON")) {
  4541 + if (value > -1 / 0 && value < 1 / 0) {
  4542 + // Dates are serialized according to the `Date#toJSON` method
  4543 + // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15
  4544 + // for the ISO 8601 date time string format.
  4545 + if (getDay) {
  4546 + // Manually compute the year, month, date, hours, minutes,
  4547 + // seconds, and milliseconds if the `getUTC*` methods are
  4548 + // buggy. Adapted from @Yaffle's `date-shim` project.
  4549 + date = floor(value / 864e5);
  4550 + for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);
  4551 + for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);
  4552 + date = 1 + date - getDay(year, month);
  4553 + // The `time` value specifies the time within the day (see ES
  4554 + // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used
  4555 + // to compute `A modulo B`, as the `%` operator does not
  4556 + // correspond to the `modulo` operation for negative numbers.
  4557 + time = (value % 864e5 + 864e5) % 864e5;
  4558 + // The hours, minutes, seconds, and milliseconds are obtained by
  4559 + // decomposing the time within the day. See section 15.9.1.10.
  4560 + hours = floor(time / 36e5) % 24;
  4561 + minutes = floor(time / 6e4) % 60;
  4562 + seconds = floor(time / 1e3) % 60;
  4563 + milliseconds = time % 1e3;
  4564 + } else {
  4565 + year = value.getUTCFullYear();
  4566 + month = value.getUTCMonth();
  4567 + date = value.getUTCDate();
  4568 + hours = value.getUTCHours();
  4569 + minutes = value.getUTCMinutes();
  4570 + seconds = value.getUTCSeconds();
  4571 + milliseconds = value.getUTCMilliseconds();
  4572 + }
  4573 + // Serialize extended years correctly.
  4574 + value = (year <= 0 || year >= 1e4 ? (year < 0 ? "-" : "+") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +
  4575 + "-" + toPaddedString(2, month + 1) + "-" + toPaddedString(2, date) +
  4576 + // Months, dates, hours, minutes, and seconds should have two
  4577 + // digits; milliseconds should have three.
  4578 + "T" + toPaddedString(2, hours) + ":" + toPaddedString(2, minutes) + ":" + toPaddedString(2, seconds) +
  4579 + // Milliseconds are optional in ES 5.0, but required in 5.1.
  4580 + "." + toPaddedString(3, milliseconds) + "Z";
  4581 + } else {
  4582 + value = null;
  4583 + }
  4584 + } else if (typeof value.toJSON == "function" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, "toJSON"))) {
  4585 + // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the
  4586 + // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3
  4587 + // ignores all `toJSON` methods on these objects unless they are
  4588 + // defined directly on an instance.
  4589 + value = value.toJSON(property);
  4590 + }
  4591 + }
  4592 + if (callback) {
  4593 + // If a replacement function was provided, call it to obtain the value
  4594 + // for serialization.
  4595 + value = callback.call(object, property, value);
  4596 + }
  4597 + if (value === null) {
  4598 + return "null";
  4599 + }
  4600 + className = getClass.call(value);
  4601 + if (className == booleanClass) {
  4602 + // Booleans are represented literally.
  4603 + return "" + value;
  4604 + } else if (className == numberClass) {
  4605 + // JSON numbers must be finite. `Infinity` and `NaN` are serialized as
  4606 + // `"null"`.
  4607 + return value > -1 / 0 && value < 1 / 0 ? "" + value : "null";
  4608 + } else if (className == stringClass) {
  4609 + // Strings are double-quoted and escaped.
  4610 + return quote("" + value);
  4611 + }
  4612 + // Recursively serialize objects and arrays.
  4613 + if (typeof value == "object") {
  4614 + // Check for cyclic structures. This is a linear search; performance
  4615 + // is inversely proportional to the number of unique nested objects.
  4616 + for (length = stack.length; length--;) {
  4617 + if (stack[length] === value) {
  4618 + // Cyclic structures cannot be serialized by `JSON.stringify`.
  4619 + throw TypeError();
  4620 + }
  4621 + }
  4622 + // Add the object to the stack of traversed objects.
  4623 + stack.push(value);
  4624 + results = [];
  4625 + // Save the current indentation level and indent one additional level.
  4626 + prefix = indentation;
  4627 + indentation += whitespace;
  4628 + if (className == arrayClass) {
  4629 + // Recursively serialize array elements.
  4630 + for (index = 0, length = value.length; index < length; index++) {
  4631 + element = serialize(index, value, callback, properties, whitespace, indentation, stack);
  4632 + results.push(element === undef ? "null" : element);
  4633 + }
  4634 + result = results.length ? (whitespace ? "[\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.join(",") + "]")) : "[]";
  4635 + } else {
  4636 + // Recursively serialize object members. Members are selected from
  4637 + // either a user-specified list of property names, or the object
  4638 + // itself.
  4639 + forEach(properties || value, function (property) {
  4640 + var element = serialize(property, value, callback, properties, whitespace, indentation, stack);
  4641 + if (element !== undef) {
  4642 + // According to ES 5.1 section 15.12.3: "If `gap` {whitespace}
  4643 + // is not the empty string, let `member` {quote(property) + ":"}
  4644 + // be the concatenation of `member` and the `space` character."
  4645 + // The "`space` character" refers to the literal space
  4646 + // character, not the `space` {width} argument provided to
  4647 + // `JSON.stringify`.
  4648 + results.push(quote(property) + ":" + (whitespace ? " " : "") + element);
  4649 + }
  4650 + });
  4651 + result = results.length ? (whitespace ? "{\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.join(",") + "}")) : "{}";
  4652 + }
  4653 + // Remove the object from the traversed object stack.
  4654 + stack.pop();
  4655 + return result;
  4656 + }
  4657 + };
  4658 +
  4659 + // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.
  4660 + exports.stringify = function (source, filter, width) {
  4661 + var whitespace, callback, properties, className;
  4662 + if (objectTypes[typeof filter] && filter) {
  4663 + if ((className = getClass.call(filter)) == functionClass) {
  4664 + callback = filter;
  4665 + } else if (className == arrayClass) {
  4666 + // Convert the property names array into a makeshift set.
  4667 + properties = {};
  4668 + for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));
  4669 + }
  4670 + }
  4671 + if (width) {
  4672 + if ((className = getClass.call(width)) == numberClass) {
  4673 + // Convert the `width` to an integer and create a string containing
  4674 + // `width` number of space characters.
  4675 + if ((width -= width % 1) > 0) {
  4676 + for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " ");
  4677 + }
  4678 + } else if (className == stringClass) {
  4679 + whitespace = width.length <= 10 ? width : width.slice(0, 10);
  4680 + }
  4681 + }
  4682 + // Opera <= 7.54u2 discards the values associated with empty string keys
  4683 + // (`""`) only if they are used directly within an object member list
  4684 + // (e.g., `!("" in { "": 1})`).
  4685 + return serialize("", (value = {}, value[""] = source, value), callback, properties, whitespace, "", []);
  4686 + };
  4687 + }
  4688 +
  4689 + // Public: Parses a JSON source string.
  4690 + if (!has("json-parse")) {
  4691 + var fromCharCode = String.fromCharCode;
  4692 +
  4693 + // Internal: A map of escaped control characters and their unescaped
  4694 + // equivalents.
  4695 + var Unescapes = {
  4696 + 92: "\\",
  4697 + 34: '"',
  4698 + 47: "/",
  4699 + 98: "\b",
  4700 + 116: "\t",
  4701 + 110: "\n",
  4702 + 102: "\f",
  4703 + 114: "\r"
  4704 + };
  4705 +
  4706 + // Internal: Stores the parser state.
  4707 + var Index, Source;
  4708 +
  4709 + // Internal: Resets the parser state and throws a `SyntaxError`.
  4710 + var abort = function () {
  4711 + Index = Source = null;
  4712 + throw SyntaxError();
  4713 + };
  4714 +
  4715 + // Internal: Returns the next token, or `"$"` if the parser has reached
  4716 + // the end of the source string. A token may be a string, number, `null`
  4717 + // literal, or Boolean literal.
  4718 + var lex = function () {
  4719 + var source = Source, length = source.length, value, begin, position, isSigned, charCode;
  4720 + while (Index < length) {
  4721 + charCode = source.charCodeAt(Index);
  4722 + switch (charCode) {
  4723 + case 9: case 10: case 13: case 32:
  4724 + // Skip whitespace tokens, including tabs, carriage returns, line
  4725 + // feeds, and space characters.
  4726 + Index++;
  4727 + break;
  4728 + case 123: case 125: case 91: case 93: case 58: case 44:
  4729 + // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at
  4730 + // the current position.
  4731 + value = charIndexBuggy ? source.charAt(Index) : source[Index];
  4732 + Index++;
  4733 + return value;
  4734 + case 34:
  4735 + // `"` delimits a JSON string; advance to the next character and
  4736 + // begin parsing the string. String tokens are prefixed with the
  4737 + // sentinel `@` character to distinguish them from punctuators and
  4738 + // end-of-string tokens.
  4739 + for (value = "@", Index++; Index < length;) {
  4740 + charCode = source.charCodeAt(Index);
  4741 + if (charCode < 32) {
  4742 + // Unescaped ASCII control characters (those with a code unit
  4743 + // less than the space character) are not permitted.
  4744 + abort();
  4745 + } else if (charCode == 92) {
  4746 + // A reverse solidus (`\`) marks the beginning of an escaped
  4747 + // control character (including `"`, `\`, and `/`) or Unicode
  4748 + // escape sequence.
  4749 + charCode = source.charCodeAt(++Index);
  4750 + switch (charCode) {
  4751 + case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:
  4752 + // Revive escaped control characters.
  4753 + value += Unescapes[charCode];
  4754 + Index++;
  4755 + break;
  4756 + case 117:
  4757 + // `\u` marks the beginning of a Unicode escape sequence.
  4758 + // Advance to the first character and validate the
  4759 + // four-digit code point.
  4760 + begin = ++Index;
  4761 + for (position = Index + 4; Index < position; Index++) {
  4762 + charCode = source.charCodeAt(Index);
  4763 + // A valid sequence comprises four hexdigits (case-
  4764 + // insensitive) that form a single hexadecimal value.
  4765 + if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {
  4766 + // Invalid Unicode escape sequence.
  4767 + abort();
  4768 + }
  4769 + }
  4770 + // Revive the escaped character.
  4771 + value += fromCharCode("0x" + source.slice(begin, Index));
  4772 + break;
  4773 + default:
  4774 + // Invalid escape sequence.
  4775 + abort();
  4776 + }
  4777 + } else {
  4778 + if (charCode == 34) {
  4779 + // An unescaped double-quote character marks the end of the
  4780 + // string.
  4781 + break;
  4782 + }
  4783 + charCode = source.charCodeAt(Index);
  4784 + begin = Index;
  4785 + // Optimize for the common case where a string is valid.
  4786 + while (charCode >= 32 && charCode != 92 && charCode != 34) {
  4787 + charCode = source.charCodeAt(++Index);
  4788 + }
  4789 + // Append the string as-is.
  4790 + value += source.slice(begin, Index);
  4791 + }
  4792 + }
  4793 + if (source.charCodeAt(Index) == 34) {
  4794 + // Advance to the next character and return the revived string.
  4795 + Index++;
  4796 + return value;
  4797 + }
  4798 + // Unterminated string.
  4799 + abort();
  4800 + default:
  4801 + // Parse numbers and literals.
  4802 + begin = Index;
  4803 + // Advance past the negative sign, if one is specified.
  4804 + if (charCode == 45) {
  4805 + isSigned = true;
  4806 + charCode = source.charCodeAt(++Index);
  4807 + }
  4808 + // Parse an integer or floating-point value.
  4809 + if (charCode >= 48 && charCode <= 57) {
  4810 + // Leading zeroes are interpreted as octal literals.
  4811 + if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {
  4812 + // Illegal octal literal.
  4813 + abort();
  4814 + }
  4815 + isSigned = false;
  4816 + // Parse the integer component.
  4817 + for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);
  4818 + // Floats cannot contain a leading decimal point; however, this
  4819 + // case is already accounted for by the parser.
  4820 + if (source.charCodeAt(Index) == 46) {
  4821 + position = ++Index;
  4822 + // Parse the decimal component.
  4823 + for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
  4824 + if (position == Index) {
  4825 + // Illegal trailing decimal.
  4826 + abort();
  4827 + }
  4828 + Index = position;
  4829 + }
  4830 + // Parse exponents. The `e` denoting the exponent is
  4831 + // case-insensitive.
  4832 + charCode = source.charCodeAt(Index);
  4833 + if (charCode == 101 || charCode == 69) {
  4834 + charCode = source.charCodeAt(++Index);
  4835 + // Skip past the sign following the exponent, if one is
  4836 + // specified.
  4837 + if (charCode == 43 || charCode == 45) {
  4838 + Index++;
  4839 + }
  4840 + // Parse the exponential component.
  4841 + for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
  4842 + if (position == Index) {
  4843 + // Illegal empty exponent.
  4844 + abort();
  4845 + }
  4846 + Index = position;
  4847 + }
  4848 + // Coerce the parsed value to a JavaScript number.
  4849 + return +source.slice(begin, Index);
  4850 + }
  4851 + // A negative sign may only precede numbers.
  4852 + if (isSigned) {
  4853 + abort();
  4854 + }
  4855 + // `true`, `false`, and `null` literals.
  4856 + if (source.slice(Index, Index + 4) == "true") {
  4857 + Index += 4;
  4858 + return true;
  4859 + } else if (source.slice(Index, Index + 5) == "false") {
  4860 + Index += 5;
  4861 + return false;
  4862 + } else if (source.slice(Index, Index + 4) == "null") {
  4863 + Index += 4;
  4864 + return null;
  4865 + }
  4866 + // Unrecognized token.
  4867 + abort();
  4868 + }
  4869 + }
  4870 + // Return the sentinel `$` character if the parser has reached the end
  4871 + // of the source string.
  4872 + return "$";
  4873 + };
  4874 +
  4875 + // Internal: Parses a JSON `value` token.
  4876 + var get = function (value) {
  4877 + var results, hasMembers;
  4878 + if (value == "$") {
  4879 + // Unexpected end of input.
  4880 + abort();
  4881 + }
  4882 + if (typeof value == "string") {
  4883 + if ((charIndexBuggy ? value.charAt(0) : value[0]) == "@") {
  4884 + // Remove the sentinel `@` character.
  4885 + return value.slice(1);
  4886 + }
  4887 + // Parse object and array literals.
  4888 + if (value == "[") {
  4889 + // Parses a JSON array, returning a new JavaScript array.
  4890 + results = [];
  4891 + for (;; hasMembers || (hasMembers = true)) {
  4892 + value = lex();
  4893 + // A closing square bracket marks the end of the array literal.
  4894 + if (value == "]") {
  4895 + break;
  4896 + }
  4897 + // If the array literal contains elements, the current token
  4898 + // should be a comma separating the previous element from the
  4899 + // next.
  4900 + if (hasMembers) {
  4901 + if (value == ",") {
  4902 + value = lex();
  4903 + if (value == "]") {
  4904 + // Unexpected trailing `,` in array literal.
  4905 + abort();
  4906 + }
  4907 + } else {
  4908 + // A `,` must separate each array element.
  4909 + abort();
  4910 + }
  4911 + }
  4912 + // Elisions and leading commas are not permitted.
  4913 + if (value == ",") {
  4914 + abort();
  4915 + }
  4916 + results.push(get(value));
  4917 + }
  4918 + return results;
  4919 + } else if (value == "{") {
  4920 + // Parses a JSON object, returning a new JavaScript object.
  4921 + results = {};
  4922 + for (;; hasMembers || (hasMembers = true)) {
  4923 + value = lex();
  4924 + // A closing curly brace marks the end of the object literal.
  4925 + if (value == "}") {
  4926 + break;
  4927 + }
  4928 + // If the object literal contains members, the current token
  4929 + // should be a comma separator.
  4930 + if (hasMembers) {
  4931 + if (value == ",") {
  4932 + value = lex();
  4933 + if (value == "}") {
  4934 + // Unexpected trailing `,` in object literal.
  4935 + abort();
  4936 + }
  4937 + } else {
  4938 + // A `,` must separate each object member.
  4939 + abort();
  4940 + }
  4941 + }
  4942 + // Leading commas are not permitted, object property names must be
  4943 + // double-quoted strings, and a `:` must separate each property
  4944 + // name and value.
  4945 + if (value == "," || typeof value != "string" || (charIndexBuggy ? value.charAt(0) : value[0]) != "@" || lex() != ":") {
  4946 + abort();
  4947 + }
  4948 + results[value.slice(1)] = get(lex());
  4949 + }
  4950 + return results;
  4951 + }
  4952 + // Unexpected token encountered.
  4953 + abort();
  4954 + }
  4955 + return value;
  4956 + };
  4957 +
  4958 + // Internal: Updates a traversed object member.
  4959 + var update = function (source, property, callback) {
  4960 + var element = walk(source, property, callback);
  4961 + if (element === undef) {
  4962 + delete source[property];
  4963 + } else {
  4964 + source[property] = element;
  4965 + }
  4966 + };
  4967 +
  4968 + // Internal: Recursively traverses a parsed JSON object, invoking the
  4969 + // `callback` function for each value. This is an implementation of the
  4970 + // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.
  4971 + var walk = function (source, property, callback) {
  4972 + var value = source[property], length;
  4973 + if (typeof value == "object" && value) {
  4974 + // `forEach` can't be used to traverse an array in Opera <= 8.54
  4975 + // because its `Object#hasOwnProperty` implementation returns `false`
  4976 + // for array indices (e.g., `![1, 2, 3].hasOwnProperty("0")`).
  4977 + if (getClass.call(value) == arrayClass) {
  4978 + for (length = value.length; length--;) {
  4979 + update(value, length, callback);
  4980 + }
  4981 + } else {
  4982 + forEach(value, function (property) {
  4983 + update(value, property, callback);
  4984 + });
  4985 + }
  4986 + }
  4987 + return callback.call(source, property, value);
  4988 + };
  4989 +
  4990 + // Public: `JSON.parse`. See ES 5.1 section 15.12.2.
  4991 + exports.parse = function (source, callback) {
  4992 + var result, value;
  4993 + Index = 0;
  4994 + Source = "" + source;
  4995 + result = get(lex());
  4996 + // If a JSON string contains multiple tokens, it is invalid.
  4997 + if (lex() != "$") {
  4998 + abort();
  4999 + }
  5000 + // Reset the parser state.
  5001 + Index = Source = null;
  5002 + return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[""] = result, value), "", callback) : result;
  5003 + };
  5004 + }
  5005 + }
  5006 +
  5007 + exports["runInContext"] = runInContext;
  5008 + return exports;
  5009 + }
  5010 +
  5011 + if (freeExports && !isLoader) {
  5012 + // Export for CommonJS environments.
  5013 + runInContext(root, freeExports);
  5014 + } else {
  5015 + // Export for web browsers and JavaScript engines.
  5016 + var nativeJSON = root.JSON,
  5017 + previousJSON = root["JSON3"],
  5018 + isRestored = false;
  5019 +
  5020 + var JSON3 = runInContext(root, (root["JSON3"] = {
  5021 + // Public: Restores the original value of the global `JSON` object and
  5022 + // returns a reference to the `JSON3` object.
  5023 + "noConflict": function () {
  5024 + if (!isRestored) {
  5025 + isRestored = true;
  5026 + root.JSON = nativeJSON;
  5027 + root["JSON3"] = previousJSON;
  5028 + nativeJSON = previousJSON = null;
  5029 + }
  5030 + return JSON3;
  5031 + }
  5032 + }));
  5033 +
  5034 + root.JSON = {
  5035 + "parse": JSON3.parse,
  5036 + "stringify": JSON3.stringify
  5037 + };
  5038 + }
  5039 +
  5040 + // Export for asynchronous module loaders.
  5041 + if (isLoader) {
  5042 + define(function () {
  5043 + return JSON3;
  5044 + });
  5045 + }
  5046 +}).call(this);
  5047 +
  5048 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  5049 +
  5050 +},{}],58:[function(require,module,exports){
  5051 +/**
  5052 + * Helpers.
  5053 + */
  5054 +
  5055 +var s = 1000
  5056 +var m = s * 60
  5057 +var h = m * 60
  5058 +var d = h * 24
  5059 +var y = d * 365.25
  5060 +
  5061 +/**
  5062 + * Parse or format the given `val`.
  5063 + *
  5064 + * Options:
  5065 + *
  5066 + * - `long` verbose formatting [false]
  5067 + *
  5068 + * @param {String|Number} val
  5069 + * @param {Object} options
  5070 + * @throws {Error} throw an error if val is not a non-empty string or a number
  5071 + * @return {String|Number}
  5072 + * @api public
  5073 + */
  5074 +
  5075 +module.exports = function (val, options) {
  5076 + options = options || {}
  5077 + var type = typeof val
  5078 + if (type === 'string' && val.length > 0) {
  5079 + return parse(val)
  5080 + } else if (type === 'number' && isNaN(val) === false) {
  5081 + return options.long ?
  5082 + fmtLong(val) :
  5083 + fmtShort(val)
  5084 + }
  5085 + throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val))
  5086 +}
  5087 +
  5088 +/**
  5089 + * Parse the given `str` and return milliseconds.
  5090 + *
  5091 + * @param {String} str
  5092 + * @return {Number}
  5093 + * @api private
  5094 + */
  5095 +
  5096 +function parse(str) {
  5097 + str = String(str)
  5098 + if (str.length > 10000) {
  5099 + return
  5100 + }
  5101 + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str)
  5102 + if (!match) {
  5103 + return
  5104 + }
  5105 + var n = parseFloat(match[1])
  5106 + var type = (match[2] || 'ms').toLowerCase()
  5107 + switch (type) {
  5108 + case 'years':
  5109 + case 'year':
  5110 + case 'yrs':
  5111 + case 'yr':
  5112 + case 'y':
  5113 + return n * y
  5114 + case 'days':
  5115 + case 'day':
  5116 + case 'd':
  5117 + return n * d
  5118 + case 'hours':
  5119 + case 'hour':
  5120 + case 'hrs':
  5121 + case 'hr':
  5122 + case 'h':
  5123 + return n * h
  5124 + case 'minutes':
  5125 + case 'minute':
  5126 + case 'mins':
  5127 + case 'min':
  5128 + case 'm':
  5129 + return n * m
  5130 + case 'seconds':
  5131 + case 'second':
  5132 + case 'secs':
  5133 + case 'sec':
  5134 + case 's':
  5135 + return n * s
  5136 + case 'milliseconds':
  5137 + case 'millisecond':
  5138 + case 'msecs':
  5139 + case 'msec':
  5140 + case 'ms':
  5141 + return n
  5142 + default:
  5143 + return undefined
  5144 + }
  5145 +}
  5146 +
  5147 +/**
  5148 + * Short format for `ms`.
  5149 + *
  5150 + * @param {Number} ms
  5151 + * @return {String}
  5152 + * @api private
  5153 + */
  5154 +
  5155 +function fmtShort(ms) {
  5156 + if (ms >= d) {
  5157 + return Math.round(ms / d) + 'd'
  5158 + }
  5159 + if (ms >= h) {
  5160 + return Math.round(ms / h) + 'h'
  5161 + }
  5162 + if (ms >= m) {
  5163 + return Math.round(ms / m) + 'm'
  5164 + }
  5165 + if (ms >= s) {
  5166 + return Math.round(ms / s) + 's'
  5167 + }
  5168 + return ms + 'ms'
  5169 +}
  5170 +
  5171 +/**
  5172 + * Long format for `ms`.
  5173 + *
  5174 + * @param {Number} ms
  5175 + * @return {String}
  5176 + * @api private
  5177 + */
  5178 +
  5179 +function fmtLong(ms) {
  5180 + return plural(ms, d, 'day') ||
  5181 + plural(ms, h, 'hour') ||
  5182 + plural(ms, m, 'minute') ||
  5183 + plural(ms, s, 'second') ||
  5184 + ms + ' ms'
  5185 +}
  5186 +
  5187 +/**
  5188 + * Pluralization helper.
  5189 + */
  5190 +
  5191 +function plural(ms, n, name) {
  5192 + if (ms < n) {
  5193 + return
  5194 + }
  5195 + if (ms < n * 1.5) {
  5196 + return Math.floor(ms / n) + ' ' + name
  5197 + }
  5198 + return Math.ceil(ms / n) + ' ' + name + 's'
  5199 +}
  5200 +
  5201 +},{}],59:[function(require,module,exports){
  5202 +'use strict';
  5203 +
  5204 +var has = Object.prototype.hasOwnProperty;
  5205 +
  5206 +/**
  5207 + * Simple query string parser.
  5208 + *
  5209 + * @param {String} query The query string that needs to be parsed.
  5210 + * @returns {Object}
  5211 + * @api public
  5212 + */
  5213 +function querystring(query) {
  5214 + var parser = /([^=?&]+)=?([^&]*)/g
  5215 + , result = {}
  5216 + , part;
  5217 +
  5218 + //
  5219 + // Little nifty parsing hack, leverage the fact that RegExp.exec increments
  5220 + // the lastIndex property so we can continue executing this loop until we've
  5221 + // parsed all results.
  5222 + //
  5223 + for (;
  5224 + part = parser.exec(query);
  5225 + result[decodeURIComponent(part[1])] = decodeURIComponent(part[2])
  5226 + );
  5227 +
  5228 + return result;
  5229 +}
  5230 +
  5231 +/**
  5232 + * Transform a query string to an object.
  5233 + *
  5234 + * @param {Object} obj Object that should be transformed.
  5235 + * @param {String} prefix Optional prefix.
  5236 + * @returns {String}
  5237 + * @api public
  5238 + */
  5239 +function querystringify(obj, prefix) {
  5240 + prefix = prefix || '';
  5241 +
  5242 + var pairs = [];
  5243 +
  5244 + //
  5245 + // Optionally prefix with a '?' if needed
  5246 + //
  5247 + if ('string' !== typeof prefix) prefix = '?';
  5248 +
  5249 + for (var key in obj) {
  5250 + if (has.call(obj, key)) {
  5251 + pairs.push(encodeURIComponent(key) +'='+ encodeURIComponent(obj[key]));
  5252 + }
  5253 + }
  5254 +
  5255 + return pairs.length ? prefix + pairs.join('&') : '';
  5256 +}
  5257 +
  5258 +//
  5259 +// Expose the module.
  5260 +//
  5261 +exports.stringify = querystringify;
  5262 +exports.parse = querystring;
  5263 +
  5264 +},{}],60:[function(require,module,exports){
  5265 +'use strict';
  5266 +
  5267 +/**
  5268 + * Check if we're required to add a port number.
  5269 + *
  5270 + * @see https://url.spec.whatwg.org/#default-port
  5271 + * @param {Number|String} port Port number we need to check
  5272 + * @param {String} protocol Protocol we need to check against.
  5273 + * @returns {Boolean} Is it a default port for the given protocol
  5274 + * @api private
  5275 + */
  5276 +module.exports = function required(port, protocol) {
  5277 + protocol = protocol.split(':')[0];
  5278 + port = +port;
  5279 +
  5280 + if (!port) return false;
  5281 +
  5282 + switch (protocol) {
  5283 + case 'http':
  5284 + case 'ws':
  5285 + return port !== 80;
  5286 +
  5287 + case 'https':
  5288 + case 'wss':
  5289 + return port !== 443;
  5290 +
  5291 + case 'ftp':
  5292 + return port !== 21;
  5293 +
  5294 + case 'gopher':
  5295 + return port !== 70;
  5296 +
  5297 + case 'file':
  5298 + return false;
  5299 + }
  5300 +
  5301 + return port !== 0;
  5302 +};
  5303 +
  5304 +},{}],61:[function(require,module,exports){
  5305 +'use strict';
  5306 +
  5307 +var required = require('requires-port')
  5308 + , lolcation = require('./lolcation')
  5309 + , qs = require('querystringify')
  5310 + , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i;
  5311 +
  5312 +/**
  5313 + * These are the parse rules for the URL parser, it informs the parser
  5314 + * about:
  5315 + *
  5316 + * 0. The char it Needs to parse, if it's a string it should be done using
  5317 + * indexOf, RegExp using exec and NaN means set as current value.
  5318 + * 1. The property we should set when parsing this value.
  5319 + * 2. Indication if it's backwards or forward parsing, when set as number it's
  5320 + * the value of extra chars that should be split off.
  5321 + * 3. Inherit from location if non existing in the parser.
  5322 + * 4. `toLowerCase` the resulting value.
  5323 + */
  5324 +var rules = [
  5325 + ['#', 'hash'], // Extract from the back.
  5326 + ['?', 'query'], // Extract from the back.
  5327 + ['/', 'pathname'], // Extract from the back.
  5328 + ['@', 'auth', 1], // Extract from the front.
  5329 + [NaN, 'host', undefined, 1, 1], // Set left over value.
  5330 + [/:(\d+)$/, 'port', undefined, 1], // RegExp the back.
  5331 + [NaN, 'hostname', undefined, 1, 1] // Set left over.
  5332 +];
  5333 +
  5334 +/**
  5335 + * @typedef ProtocolExtract
  5336 + * @type Object
  5337 + * @property {String} protocol Protocol matched in the URL, in lowercase.
  5338 + * @property {Boolean} slashes `true` if protocol is followed by "//", else `false`.
  5339 + * @property {String} rest Rest of the URL that is not part of the protocol.
  5340 + */
  5341 +
  5342 +/**
  5343 + * Extract protocol information from a URL with/without double slash ("//").
  5344 + *
  5345 + * @param {String} address URL we want to extract from.
  5346 + * @return {ProtocolExtract} Extracted information.
  5347 + * @api private
  5348 + */
  5349 +function extractProtocol(address) {
  5350 + var match = protocolre.exec(address);
  5351 +
  5352 + return {
  5353 + protocol: match[1] ? match[1].toLowerCase() : '',
  5354 + slashes: !!match[2],
  5355 + rest: match[3]
  5356 + };
  5357 +}
  5358 +
  5359 +/**
  5360 + * Resolve a relative URL pathname against a base URL pathname.
  5361 + *
  5362 + * @param {String} relative Pathname of the relative URL.
  5363 + * @param {String} base Pathname of the base URL.
  5364 + * @return {String} Resolved pathname.
  5365 + * @api private
  5366 + */
  5367 +function resolve(relative, base) {
  5368 + var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))
  5369 + , i = path.length
  5370 + , last = path[i - 1]
  5371 + , unshift = false
  5372 + , up = 0;
  5373 +
  5374 + while (i--) {
  5375 + if (path[i] === '.') {
  5376 + path.splice(i, 1);
  5377 + } else if (path[i] === '..') {
  5378 + path.splice(i, 1);
  5379 + up++;
  5380 + } else if (up) {
  5381 + if (i === 0) unshift = true;
  5382 + path.splice(i, 1);
  5383 + up--;
  5384 + }
  5385 + }
  5386 +
  5387 + if (unshift) path.unshift('');
  5388 + if (last === '.' || last === '..') path.push('');
  5389 +
  5390 + return path.join('/');
  5391 +}
  5392 +
  5393 +/**
  5394 + * The actual URL instance. Instead of returning an object we've opted-in to
  5395 + * create an actual constructor as it's much more memory efficient and
  5396 + * faster and it pleases my OCD.
  5397 + *
  5398 + * @constructor
  5399 + * @param {String} address URL we want to parse.
  5400 + * @param {Object|String} location Location defaults for relative paths.
  5401 + * @param {Boolean|Function} parser Parser for the query string.
  5402 + * @api public
  5403 + */
  5404 +function URL(address, location, parser) {
  5405 + if (!(this instanceof URL)) {
  5406 + return new URL(address, location, parser);
  5407 + }
  5408 +
  5409 + var relative, extracted, parse, instruction, index, key
  5410 + , instructions = rules.slice()
  5411 + , type = typeof location
  5412 + , url = this
  5413 + , i = 0;
  5414 +
  5415 + //
  5416 + // The following if statements allows this module two have compatibility with
  5417 + // 2 different API:
  5418 + //
  5419 + // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments
  5420 + // where the boolean indicates that the query string should also be parsed.
  5421 + //
  5422 + // 2. The `URL` interface of the browser which accepts a URL, object as
  5423 + // arguments. The supplied object will be used as default values / fall-back
  5424 + // for relative paths.
  5425 + //
  5426 + if ('object' !== type && 'string' !== type) {
  5427 + parser = location;
  5428 + location = null;
  5429 + }
  5430 +
  5431 + if (parser && 'function' !== typeof parser) parser = qs.parse;
  5432 +
  5433 + location = lolcation(location);
  5434 +
  5435 + //
  5436 + // Extract protocol information before running the instructions.
  5437 + //
  5438 + extracted = extractProtocol(address || '');
  5439 + relative = !extracted.protocol && !extracted.slashes;
  5440 + url.slashes = extracted.slashes || relative && location.slashes;
  5441 + url.protocol = extracted.protocol || location.protocol || '';
  5442 + address = extracted.rest;
  5443 +
  5444 + //
  5445 + // When the authority component is absent the URL starts with a path
  5446 + // component.
  5447 + //
  5448 + if (!extracted.slashes) instructions[2] = [/(.*)/, 'pathname'];
  5449 +
  5450 + for (; i < instructions.length; i++) {
  5451 + instruction = instructions[i];
  5452 + parse = instruction[0];
  5453 + key = instruction[1];
  5454 +
  5455 + if (parse !== parse) {
  5456 + url[key] = address;
  5457 + } else if ('string' === typeof parse) {
  5458 + if (~(index = address.indexOf(parse))) {
  5459 + if ('number' === typeof instruction[2]) {
  5460 + url[key] = address.slice(0, index);
  5461 + address = address.slice(index + instruction[2]);
  5462 + } else {
  5463 + url[key] = address.slice(index);
  5464 + address = address.slice(0, index);
  5465 + }
  5466 + }
  5467 + } else if (index = parse.exec(address)) {
  5468 + url[key] = index[1];
  5469 + address = address.slice(0, index.index);
  5470 + }
  5471 +
  5472 + url[key] = url[key] || (
  5473 + relative && instruction[3] ? location[key] || '' : ''
  5474 + );
  5475 +
  5476 + //
  5477 + // Hostname, host and protocol should be lowercased so they can be used to
  5478 + // create a proper `origin`.
  5479 + //
  5480 + if (instruction[4]) url[key] = url[key].toLowerCase();
  5481 + }
  5482 +
  5483 + //
  5484 + // Also parse the supplied query string in to an object. If we're supplied
  5485 + // with a custom parser as function use that instead of the default build-in
  5486 + // parser.
  5487 + //
  5488 + if (parser) url.query = parser(url.query);
  5489 +
  5490 + //
  5491 + // If the URL is relative, resolve the pathname against the base URL.
  5492 + //
  5493 + if (
  5494 + relative
  5495 + && location.slashes
  5496 + && url.pathname.charAt(0) !== '/'
  5497 + && (url.pathname !== '' || location.pathname !== '')
  5498 + ) {
  5499 + url.pathname = resolve(url.pathname, location.pathname);
  5500 + }
  5501 +
  5502 + //
  5503 + // We should not add port numbers if they are already the default port number
  5504 + // for a given protocol. As the host also contains the port number we're going
  5505 + // override it with the hostname which contains no port number.
  5506 + //
  5507 + if (!required(url.port, url.protocol)) {
  5508 + url.host = url.hostname;
  5509 + url.port = '';
  5510 + }
  5511 +
  5512 + //
  5513 + // Parse down the `auth` for the username and password.
  5514 + //
  5515 + url.username = url.password = '';
  5516 + if (url.auth) {
  5517 + instruction = url.auth.split(':');
  5518 + url.username = instruction[0] || '';
  5519 + url.password = instruction[1] || '';
  5520 + }
  5521 +
  5522 + url.origin = url.protocol && url.host && url.protocol !== 'file:'
  5523 + ? url.protocol +'//'+ url.host
  5524 + : 'null';
  5525 +
  5526 + //
  5527 + // The href is just the compiled result.
  5528 + //
  5529 + url.href = url.toString();
  5530 +}
  5531 +
  5532 +/**
  5533 + * This is convenience method for changing properties in the URL instance to
  5534 + * insure that they all propagate correctly.
  5535 + *
  5536 + * @param {String} part Property we need to adjust.
  5537 + * @param {Mixed} value The newly assigned value.
  5538 + * @param {Boolean|Function} fn When setting the query, it will be the function
  5539 + * used to parse the query.
  5540 + * When setting the protocol, double slash will be
  5541 + * removed from the final url if it is true.
  5542 + * @returns {URL}
  5543 + * @api public
  5544 + */
  5545 +URL.prototype.set = function set(part, value, fn) {
  5546 + var url = this;
  5547 +
  5548 + switch (part) {
  5549 + case 'query':
  5550 + if ('string' === typeof value && value.length) {
  5551 + value = (fn || qs.parse)(value);
  5552 + }
  5553 +
  5554 + url[part] = value;
  5555 + break;
  5556 +
  5557 + case 'port':
  5558 + url[part] = value;
  5559 +
  5560 + if (!required(value, url.protocol)) {
  5561 + url.host = url.hostname;
  5562 + url[part] = '';
  5563 + } else if (value) {
  5564 + url.host = url.hostname +':'+ value;
  5565 + }
  5566 +
  5567 + break;
  5568 +
  5569 + case 'hostname':
  5570 + url[part] = value;
  5571 +
  5572 + if (url.port) value += ':'+ url.port;
  5573 + url.host = value;
  5574 + break;
  5575 +
  5576 + case 'host':
  5577 + url[part] = value;
  5578 +
  5579 + if (/:\d+$/.test(value)) {
  5580 + value = value.split(':');
  5581 + url.port = value.pop();
  5582 + url.hostname = value.join(':');
  5583 + } else {
  5584 + url.hostname = value;
  5585 + url.port = '';
  5586 + }
  5587 +
  5588 + break;
  5589 +
  5590 + case 'protocol':
  5591 + url.protocol = value.toLowerCase();
  5592 + url.slashes = !fn;
  5593 + break;
  5594 +
  5595 + case 'pathname':
  5596 + url.pathname = value.length && value.charAt(0) !== '/' ? '/' + value : value;
  5597 +
  5598 + break;
  5599 +
  5600 + default:
  5601 + url[part] = value;
  5602 + }
  5603 +
  5604 + for (var i = 0; i < rules.length; i++) {
  5605 + var ins = rules[i];
  5606 +
  5607 + if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
  5608 + }
  5609 +
  5610 + url.origin = url.protocol && url.host && url.protocol !== 'file:'
  5611 + ? url.protocol +'//'+ url.host
  5612 + : 'null';
  5613 +
  5614 + url.href = url.toString();
  5615 +
  5616 + return url;
  5617 +};
  5618 +
  5619 +/**
  5620 + * Transform the properties back in to a valid and full URL string.
  5621 + *
  5622 + * @param {Function} stringify Optional query stringify function.
  5623 + * @returns {String}
  5624 + * @api public
  5625 + */
  5626 +URL.prototype.toString = function toString(stringify) {
  5627 + if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;
  5628 +
  5629 + var query
  5630 + , url = this
  5631 + , protocol = url.protocol;
  5632 +
  5633 + if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
  5634 +
  5635 + var result = protocol + (url.slashes ? '//' : '');
  5636 +
  5637 + if (url.username) {
  5638 + result += url.username;
  5639 + if (url.password) result += ':'+ url.password;
  5640 + result += '@';
  5641 + }
  5642 +
  5643 + result += url.host + url.pathname;
  5644 +
  5645 + query = 'object' === typeof url.query ? stringify(url.query) : url.query;
  5646 + if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;
  5647 +
  5648 + if (url.hash) result += url.hash;
  5649 +
  5650 + return result;
  5651 +};
  5652 +
  5653 +//
  5654 +// Expose the URL parser and some additional properties that might be useful for
  5655 +// others or testing.
  5656 +//
  5657 +URL.extractProtocol = extractProtocol;
  5658 +URL.location = lolcation;
  5659 +URL.qs = qs;
  5660 +
  5661 +module.exports = URL;
  5662 +
  5663 +},{"./lolcation":62,"querystringify":59,"requires-port":60}],62:[function(require,module,exports){
  5664 +(function (global){
  5665 +'use strict';
  5666 +
  5667 +var slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//;
  5668 +
  5669 +/**
  5670 + * These properties should not be copied or inherited from. This is only needed
  5671 + * for all non blob URL's as a blob URL does not include a hash, only the
  5672 + * origin.
  5673 + *
  5674 + * @type {Object}
  5675 + * @private
  5676 + */
  5677 +var ignore = { hash: 1, query: 1 }
  5678 + , URL;
  5679 +
  5680 +/**
  5681 + * The location object differs when your code is loaded through a normal page,
  5682 + * Worker or through a worker using a blob. And with the blobble begins the
  5683 + * trouble as the location object will contain the URL of the blob, not the
  5684 + * location of the page where our code is loaded in. The actual origin is
  5685 + * encoded in the `pathname` so we can thankfully generate a good "default"
  5686 + * location from it so we can generate proper relative URL's again.
  5687 + *
  5688 + * @param {Object|String} loc Optional default location object.
  5689 + * @returns {Object} lolcation object.
  5690 + * @api public
  5691 + */
  5692 +module.exports = function lolcation(loc) {
  5693 + loc = loc || global.location || {};
  5694 + URL = URL || require('./');
  5695 +
  5696 + var finaldestination = {}
  5697 + , type = typeof loc
  5698 + , key;
  5699 +
  5700 + if ('blob:' === loc.protocol) {
  5701 + finaldestination = new URL(unescape(loc.pathname), {});
  5702 + } else if ('string' === type) {
  5703 + finaldestination = new URL(loc, {});
  5704 + for (key in ignore) delete finaldestination[key];
  5705 + } else if ('object' === type) {
  5706 + for (key in loc) {
  5707 + if (key in ignore) continue;
  5708 + finaldestination[key] = loc[key];
  5709 + }
  5710 +
  5711 + if (finaldestination.slashes === undefined) {
  5712 + finaldestination.slashes = slashes.test(loc.href);
  5713 + }
  5714 + }
  5715 +
  5716 + return finaldestination;
  5717 +};
  5718 +
  5719 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  5720 +
  5721 +},{"./":61}]},{},[1])(1)
  5722 +});
  5723 +
  5724 +
  5725 +//# sourceMappingURL=sockjs.js.map
... ...
src/main/resources/static/real_control_v2/assets/plugins/sockjs-client/sockjs.min.js 0 → 100644
  1 +/* sockjs-client v1.1.2 | http://sockjs.org | MIT license */
  2 +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.SockJS=t()}}(function(){var t;return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){(function(n){"use strict";var r=t("./transport-list");e.exports=t("./main")(r),"_sockjs_onload"in n&&setTimeout(n._sockjs_onload,1)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./main":14,"./transport-list":16}],2:[function(t,e,n){"use strict";function r(){o.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}var i=t("inherits"),o=t("./event");i(r,o),e.exports=r},{"./event":4,inherits:54}],3:[function(t,e,n){"use strict";function r(){o.call(this)}var i=t("inherits"),o=t("./eventtarget");i(r,o),r.prototype.removeAllListeners=function(t){t?delete this._listeners[t]:this._listeners={}},r.prototype.once=function(t,e){function n(){r.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}var r=this,i=!1;this.on(t,n)},r.prototype.emit=function(){var t=arguments[0],e=this._listeners[t];if(e){for(var n=arguments.length,r=new Array(n-1),i=1;i<n;i++)r[i-1]=arguments[i];for(var o=0;o<e.length;o++)e[o].apply(this,r)}},r.prototype.on=r.prototype.addListener=o.prototype.addEventListener,r.prototype.removeListener=o.prototype.removeEventListener,e.exports.EventEmitter=r},{"./eventtarget":5,inherits:54}],4:[function(t,e,n){"use strict";function r(t){this.type=t}r.prototype.initEvent=function(t,e,n){return this.type=t,this.bubbles=e,this.cancelable=n,this.timeStamp=+new Date,this},r.prototype.stopPropagation=function(){},r.prototype.preventDefault=function(){},r.CAPTURING_PHASE=1,r.AT_TARGET=2,r.BUBBLING_PHASE=3,e.exports=r},{}],5:[function(t,e,n){"use strict";function r(){this._listeners={}}r.prototype.addEventListener=function(t,e){t in this._listeners||(this._listeners[t]=[]);var n=this._listeners[t];n.indexOf(e)===-1&&(n=n.concat([e])),this._listeners[t]=n},r.prototype.removeEventListener=function(t,e){var n=this._listeners[t];if(n){var r=n.indexOf(e);return r!==-1?void(n.length>1?this._listeners[t]=n.slice(0,r).concat(n.slice(r+1)):delete this._listeners[t]):void 0}},r.prototype.dispatchEvent=function(){var t=arguments[0],e=t.type,n=1===arguments.length?[t]:Array.apply(null,arguments);if(this["on"+e]&&this["on"+e].apply(this,n),e in this._listeners)for(var r=this._listeners[e],i=0;i<r.length;i++)r[i].apply(this,n)},e.exports=r},{}],6:[function(t,e,n){"use strict";function r(t){o.call(this),this.initEvent("message",!1,!1),this.data=t}var i=t("inherits"),o=t("./event");i(r,o),e.exports=r},{"./event":4,inherits:54}],7:[function(t,e,n){"use strict";function r(t){this._transport=t,t.on("message",this._transportMessage.bind(this)),t.on("close",this._transportClose.bind(this))}var i=t("json3"),o=t("./utils/iframe");r.prototype._transportClose=function(t,e){o.postMessage("c",i.stringify([t,e]))},r.prototype._transportMessage=function(t){o.postMessage("t",t)},r.prototype._send=function(t){this._transport.send(t)},r.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},e.exports=r},{"./utils/iframe":47,json3:55}],8:[function(t,e,n){"use strict";var r=t("./utils/url"),i=t("./utils/event"),o=t("json3"),s=t("./facade"),a=t("./info-iframe-receiver"),l=t("./utils/iframe"),u=t("./location");e.exports=function(t,e){var n={};e.forEach(function(t){t.facadeTransport&&(n[t.facadeTransport.transportName]=t.facadeTransport)}),n[a.transportName]=a;var c;t.bootstrap_iframe=function(){var e;l.currentWindowId=u.hash.slice(1);var a=function(i){if(i.source===parent&&("undefined"==typeof c&&(c=i.origin),i.origin===c)){var a;try{a=o.parse(i.data)}catch(t){return}if(a.windowId===l.currentWindowId)switch(a.type){case"s":var f;try{f=o.parse(a.data)}catch(t){break}var h=f[0],d=f[1],p=f[2],v=f[3];if(h!==t.version)throw new Error('Incompatible SockJS! Main site uses: "'+h+'", the iframe: "'+t.version+'".');if(!r.isOriginEqual(p,u.href)||!r.isOriginEqual(v,u.href))throw new Error("Can't connect to different domain from within an iframe. ("+u.href+", "+p+", "+v+")");e=new s(new n[d](p,v));break;case"m":e._send(a.data);break;case"c":e&&e._close(),e=null}}};i.attachEvent("message",a),l.postMessage("s")}}},{"./facade":7,"./info-iframe-receiver":10,"./location":13,"./utils/event":46,"./utils/iframe":47,"./utils/url":52,debug:void 0,json3:55}],9:[function(t,e,n){"use strict";function r(t,e){i.call(this);var n=this,r=+new Date;this.xo=new e("GET",t),this.xo.once("finish",function(t,e){var i,o;if(200===t){if(o=+new Date-r,e)try{i=s.parse(e)}catch(t){}a.isObject(i)||(i={})}n.emit("finish",i,o),n.removeAllListeners()})}var i=t("events").EventEmitter,o=t("inherits"),s=t("json3"),a=t("./utils/object");o(r,i),r.prototype.close=function(){this.removeAllListeners(),this.xo.close()},e.exports=r},{"./utils/object":49,debug:void 0,events:3,inherits:54,json3:55}],10:[function(t,e,n){"use strict";function r(t){var e=this;o.call(this),this.ir=new l(t,a),this.ir.once("finish",function(t,n){e.ir=null,e.emit("message",s.stringify([t,n]))})}var i=t("inherits"),o=t("events").EventEmitter,s=t("json3"),a=t("./transport/sender/xhr-local"),l=t("./info-ajax");i(r,o),r.transportName="iframe-info-receiver",r.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},e.exports=r},{"./info-ajax":9,"./transport/sender/xhr-local":37,events:3,inherits:54,json3:55}],11:[function(t,e,n){(function(n){"use strict";function r(t,e){var r=this;i.call(this);var o=function(){var n=r.ifr=new l(u.transportName,e,t);n.once("message",function(t){if(t){var e;try{e=s.parse(t)}catch(t){return r.emit("finish"),void r.close()}var n=e[0],i=e[1];r.emit("finish",n,i)}r.close()}),n.once("close",function(){r.emit("finish"),r.close()})};n.document.body?o():a.attachEvent("load",o)}var i=t("events").EventEmitter,o=t("inherits"),s=t("json3"),a=t("./utils/event"),l=t("./transport/iframe"),u=t("./info-iframe-receiver");o(r,i),r.enabled=function(){return l.enabled()},r.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./info-iframe-receiver":10,"./transport/iframe":22,"./utils/event":46,debug:void 0,events:3,inherits:54,json3:55}],12:[function(t,e,n){"use strict";function r(t,e){var n=this;i.call(this),setTimeout(function(){n.doXhr(t,e)},0)}var i=t("events").EventEmitter,o=t("inherits"),s=t("./utils/url"),a=t("./transport/sender/xdr"),l=t("./transport/sender/xhr-cors"),u=t("./transport/sender/xhr-local"),c=t("./transport/sender/xhr-fake"),f=t("./info-iframe"),h=t("./info-ajax");o(r,i),r._getReceiver=function(t,e,n){return n.sameOrigin?new h(e,u):l.enabled?new h(e,l):a.enabled&&n.sameScheme?new h(e,a):f.enabled()?new f(t,e):new h(e,c)},r.prototype.doXhr=function(t,e){var n=this,i=s.addPath(t,"/info");this.xo=r._getReceiver(t,i,e),this.timeoutRef=setTimeout(function(){n._cleanup(!1),n.emit("finish")},r.timeout),this.xo.once("finish",function(t,e){n._cleanup(!0),n.emit("finish",t,e)})},r.prototype._cleanup=function(t){clearTimeout(this.timeoutRef),this.timeoutRef=null,!t&&this.xo&&this.xo.close(),this.xo=null},r.prototype.close=function(){this.removeAllListeners(),this._cleanup(!1)},r.timeout=8e3,e.exports=r},{"./info-ajax":9,"./info-iframe":11,"./transport/sender/xdr":34,"./transport/sender/xhr-cors":35,"./transport/sender/xhr-fake":36,"./transport/sender/xhr-local":37,"./utils/url":52,debug:void 0,events:3,inherits:54}],13:[function(t,e,n){(function(t){"use strict";e.exports=t.location||{origin:"http://localhost:80",protocol:"http",host:"localhost",port:80,href:"http://localhost/",hash:""}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(t,e,n){(function(n){"use strict";function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");y.call(this),this.readyState=r.CONNECTING,this.extensions="",this.protocol="",n=n||{},n.protocols_whitelist&&m.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=n.transports,this._transportOptions=n.transportOptions||{};var i=n.sessionId||8;if("function"==typeof i)this._generateSessionId=i;else{if("number"!=typeof i)throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._generateSessionId=function(){return u.string(i)}}this._server=n.server||u.numberString(1e3);var o=new s(t);if(!o.host||!o.protocol)throw new SyntaxError("The URL '"+t+"' is invalid");if(o.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==o.protocol&&"https:"!==o.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+o.protocol+"' is not allowed.");var a="https:"===o.protocol;if("https"===g.protocol&&!a)throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");e?Array.isArray(e)||(e=[e]):e=[];var l=e.sort();l.forEach(function(t,e){if(!t)throw new SyntaxError("The protocols entry '"+t+"' is invalid.");if(e<l.length-1&&t===l[e+1])throw new SyntaxError("The protocols entry '"+t+"' is duplicated.")});var c=f.getOrigin(g.href);this._origin=c?c.toLowerCase():null,o.set("pathname",o.pathname.replace(/\/+$/,"")),this.url=o.href,this._urlInfo={nullOrigin:!v.hasDomain(),sameOrigin:f.isOriginEqual(this.url,g.href),sameScheme:f.isSchemeEqual(this.url,g.href)},this._ir=new _(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function i(t){return 1e3===t||t>=3e3&&t<=4999}t("./shims");var o,s=t("url-parse"),a=t("inherits"),l=t("json3"),u=t("./utils/random"),c=t("./utils/escape"),f=t("./utils/url"),h=t("./utils/event"),d=t("./utils/transport"),p=t("./utils/object"),v=t("./utils/browser"),m=t("./utils/log"),b=t("./event/event"),y=t("./event/eventtarget"),g=t("./location"),w=t("./event/close"),x=t("./event/trans-message"),_=t("./info-receiver");a(r,y),r.prototype.close=function(t,e){if(t&&!i(t))throw new Error("InvalidAccessError: Invalid code");if(e&&e.length>123)throw new SyntaxError("reason argument has an invalid length");if(this.readyState!==r.CLOSING&&this.readyState!==r.CLOSED){var n=!0;this._close(t||1e3,e||"Normal closure",n)}},r.prototype.send=function(t){if("string"!=typeof t&&(t=""+t),this.readyState===r.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===r.OPEN&&this._transport.send(c.quote(t))},r.version=t("./version"),r.CONNECTING=0,r.OPEN=1,r.CLOSING=2,r.CLOSED=3,r.prototype._receiveInfo=function(t,e){if(this._ir=null,!t)return void this._close(1002,"Cannot connect to server");this._rto=this.countRTO(e),this._transUrl=t.base_url?t.base_url:this.url,t=p.extend(t,this._urlInfo);var n=o.filterToEnabled(this._transportsWhitelist,t);this._transports=n.main,this._connect()},r.prototype._connect=function(){for(var t=this._transports.shift();t;t=this._transports.shift()){if(t.needBody&&(!n.document.body||"undefined"!=typeof n.document.readyState&&"complete"!==n.document.readyState&&"interactive"!==n.document.readyState))return this._transports.unshift(t),void h.attachEvent("load",this._connect.bind(this));var e=this._rto*t.roundTrips||5e3;this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),e);var r=f.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),i=this._transportOptions[t.transportName],o=new t(r,this._transUrl,i);return o.on("message",this._transportMessage.bind(this)),o.once("close",this._transportClose.bind(this)),o.transportName=t.transportName,void(this._transport=o)}this._close(2e3,"All transports failed",!1)},r.prototype._transportTimeout=function(){this.readyState===r.CONNECTING&&this._transportClose(2007,"Transport timed out")},r.prototype._transportMessage=function(t){var e,n=this,r=t.slice(0,1),i=t.slice(1);switch(r){case"o":return void this._open();case"h":return void this.dispatchEvent(new b("heartbeat"))}if(i)try{e=l.parse(i)}catch(t){}if("undefined"!=typeof e)switch(r){case"a":Array.isArray(e)&&e.forEach(function(t){n.dispatchEvent(new x(t))});break;case"m":this.dispatchEvent(new x(e));break;case"c":Array.isArray(e)&&2===e.length&&this._close(e[0],e[1],!0)}},r.prototype._transportClose=function(t,e){return this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),i(t)||2e3===t||this.readyState!==r.CONNECTING?void this._close(t,e):void this._connect()},r.prototype._open=function(){this.readyState===r.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=r.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new b("open"))):this._close(1006,"Server lost session")},r.prototype._close=function(t,e,n){var i=!1;if(this._ir&&(i=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===r.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=r.CLOSING,setTimeout(function(){this.readyState=r.CLOSED,i&&this.dispatchEvent(new b("error"));var o=new w("close");o.wasClean=n||!1,o.code=t||1e3,o.reason=e,this.dispatchEvent(o),this.onmessage=this.onclose=this.onerror=null}.bind(this),0)},r.prototype.countRTO=function(t){return t>100?4*t:300+t},e.exports=function(e){return o=d(e),t("./iframe-bootstrap")(r,e),r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./event/close":2,"./event/event":4,"./event/eventtarget":5,"./event/trans-message":6,"./iframe-bootstrap":8,"./info-receiver":12,"./location":13,"./shims":15,"./utils/browser":44,"./utils/escape":45,"./utils/event":46,"./utils/log":48,"./utils/object":49,"./utils/random":50,"./utils/transport":51,"./utils/url":52,"./version":53,debug:void 0,inherits:54,json3:55,"url-parse":58}],15:[function(t,e,n){"use strict";function r(t){var e=+t;return e!==e?e=0:0!==e&&e!==1/0&&e!==-(1/0)&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}function i(t){return t>>>0}function o(){}var s,a=Array.prototype,l=Object.prototype,u=Function.prototype,c=String.prototype,f=a.slice,h=l.toString,d=function(t){return"[object Function]"===l.toString.call(t)},p=function(t){return"[object Array]"===h.call(t)},v=function(t){return"[object String]"===h.call(t)},m=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}();s=m?function(t,e,n,r){!r&&e in t||Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(t,e,n,r){!r&&e in t||(t[e]=n)};var b=function(t,e,n){for(var r in e)l.hasOwnProperty.call(e,r)&&s(t,r,e[r],n)},y=function(t){if(null==t)throw new TypeError("can't convert "+t+" to object");return Object(t)};b(u,{bind:function(t){var e=this;if(!d(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n=f.call(arguments,1),r=function(){if(this instanceof l){var r=e.apply(this,n.concat(f.call(arguments)));return Object(r)===r?r:this}return e.apply(t,n.concat(f.call(arguments)))},i=Math.max(0,e.length-n.length),s=[],a=0;a<i;a++)s.push("$"+a);var l=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this, arguments); }")(r);return e.prototype&&(o.prototype=e.prototype,l.prototype=new o,o.prototype=null),l}}),b(Array,{isArray:p});var g=Object("a"),w="a"!==g[0]||!(0 in g),x=function(t){var e=!0,n=!0;return t&&(t.call("foo",function(t,n,r){"object"!=typeof r&&(e=!1)}),t.call([1],function(){n="string"==typeof this},"x")),!!t&&e&&n};b(a,{forEach:function(t){var e=y(this),n=w&&v(this)?this.split(""):e,r=arguments[1],i=-1,o=n.length>>>0;if(!d(t))throw new TypeError;for(;++i<o;)i in n&&t.call(r,n[i],i,e)}},!x(a.forEach));var _=Array.prototype.indexOf&&[0,1].indexOf(1,2)!==-1;b(a,{indexOf:function(t){var e=w&&v(this)?this.split(""):y(this),n=e.length>>>0;if(!n)return-1;var i=0;for(arguments.length>1&&(i=r(arguments[1])),i=i>=0?i:Math.max(0,n+i);i<n;i++)if(i in e&&e[i]===t)return i;return-1}},_);var E=c.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?!function(){var t=void 0===/()??/.exec("")[1];c.split=function(e,n){var r=this;if(void 0===e&&0===n)return[];if("[object RegExp]"!==h.call(e))return E.call(this,e,n);var o,s,l,u,c=[],f=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),d=0;for(e=new RegExp(e.source,f+"g"),r+="",t||(o=new RegExp("^"+e.source+"$(?!\\s)",f)),n=void 0===n?-1>>>0:i(n);(s=e.exec(r))&&(l=s.index+s[0].length,!(l>d&&(c.push(r.slice(d,s.index)),!t&&s.length>1&&s[0].replace(o,function(){for(var t=1;t<arguments.length-2;t++)void 0===arguments[t]&&(s[t]=void 0)}),s.length>1&&s.index<r.length&&a.push.apply(c,s.slice(1)),u=s[0].length,d=l,c.length>=n)));)e.lastIndex===s.index&&e.lastIndex++;return d===r.length?!u&&e.test("")||c.push(""):c.push(r.slice(d)),c.length>n?c.slice(0,n):c}}():"0".split(void 0,0).length&&(c.split=function(t,e){return void 0===t&&0===e?[]:E.call(this,t,e)});var j=c.substr,T="".substr&&"b"!=="0b".substr(-1);b(c,{substr:function(t,e){return j.call(this,t<0&&(t=this.length+t)<0?0:t,e)}},T)},{}],16:[function(t,e,n){"use strict";e.exports=[t("./transport/websocket"),t("./transport/xhr-streaming"),t("./transport/xdr-streaming"),t("./transport/eventsource"),t("./transport/lib/iframe-wrap")(t("./transport/eventsource")),t("./transport/htmlfile"),t("./transport/lib/iframe-wrap")(t("./transport/htmlfile")),t("./transport/xhr-polling"),t("./transport/xdr-polling"),t("./transport/lib/iframe-wrap")(t("./transport/xhr-polling")),t("./transport/jsonp-polling")]},{"./transport/eventsource":20,"./transport/htmlfile":21,"./transport/jsonp-polling":23,"./transport/lib/iframe-wrap":26,"./transport/websocket":38,"./transport/xdr-polling":39,"./transport/xdr-streaming":40,"./transport/xhr-polling":41,"./transport/xhr-streaming":42}],17:[function(t,e,n){(function(n){"use strict";function r(t,e,n,r){var o=this;i.call(this),setTimeout(function(){o._start(t,e,n,r)},0)}var i=t("events").EventEmitter,o=t("inherits"),s=t("../../utils/event"),a=t("../../utils/url"),l=n.XMLHttpRequest;o(r,i),r.prototype._start=function(t,e,n,i){var o=this;try{this.xhr=new l}catch(t){}if(!this.xhr)return this.emit("finish",0,"no xhr support"),void this._cleanup();e=a.addQuery(e,"t="+ +new Date),this.unloadRef=s.unloadAdd(function(){o._cleanup(!0)});try{this.xhr.open(t,e,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){o.emit("finish",0,""),o._cleanup(!1)})}catch(t){return this.emit("finish",0,""),void this._cleanup(!1)}if(i&&i.noCredentials||!r.supportsCORS||(this.xhr.withCredentials="true"),i&&i.headers)for(var u in i.headers)this.xhr.setRequestHeader(u,i.headers[u]);this.xhr.onreadystatechange=function(){if(o.xhr){var t,e,n=o.xhr;switch(n.readyState){case 3:try{e=n.status,t=n.responseText}catch(t){}1223===e&&(e=204),200===e&&t&&t.length>0&&o.emit("chunk",e,t);break;case 4:e=n.status,1223===e&&(e=204),12005!==e&&12029!==e||(e=0),o.emit("finish",e,n.responseText),o._cleanup(!1)}}};try{o.xhr.send(n)}catch(t){o.emit("finish",0,""),o._cleanup(!1)}},r.prototype._cleanup=function(t){if(this.xhr){if(this.removeAllListeners(),s.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),t)try{this.xhr.abort()}catch(t){}this.unloadRef=this.xhr=null}},r.prototype.close=function(){this._cleanup(!0)},r.enabled=!!l;var u=["Active"].concat("Object").join("X");!r.enabled&&u in n&&(l=function(){try{return new n[u]("Microsoft.XMLHTTP")}catch(t){return null}},r.enabled=!!new l);var c=!1;try{c="withCredentials"in new l}catch(t){}r.supportsCORS=c,e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/event":46,"../../utils/url":52,debug:void 0,events:3,inherits:54}],18:[function(t,e,n){(function(t){e.exports=t.EventSource}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(t,e,n){(function(t){"use strict";var n=t.WebSocket||t.MozWebSocket;n?e.exports=function(t){return new n(t)}:e.exports=void 0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(t,e,n){"use strict";function r(t){if(!r.enabled())throw new Error("Transport created when disabled");o.call(this,t,"/eventsource",s,a)}var i=t("inherits"),o=t("./lib/ajax-based"),s=t("./receiver/eventsource"),a=t("./sender/xhr-cors"),l=t("eventsource");i(r,o),r.enabled=function(){return!!l},r.transportName="eventsource",r.roundTrips=2,e.exports=r},{"./lib/ajax-based":24,"./receiver/eventsource":29,"./sender/xhr-cors":35,eventsource:18,inherits:54}],21:[function(t,e,n){"use strict";function r(t){if(!o.enabled)throw new Error("Transport created when disabled");a.call(this,t,"/htmlfile",o,s)}var i=t("inherits"),o=t("./receiver/htmlfile"),s=t("./sender/xhr-local"),a=t("./lib/ajax-based");i(r,a),r.enabled=function(t){return o.enabled&&t.sameOrigin},r.transportName="htmlfile",r.roundTrips=2,e.exports=r},{"./lib/ajax-based":24,"./receiver/htmlfile":30,"./sender/xhr-local":37,inherits:54}],22:[function(t,e,n){"use strict";function r(t,e,n){if(!r.enabled())throw new Error("Transport created when disabled");s.call(this);var i=this;this.origin=l.getOrigin(n),this.baseUrl=n,this.transUrl=e,this.transport=t,this.windowId=f.string(8);var o=l.addPath(n,"/iframe.html")+"#"+this.windowId;this.iframeObj=u.createIframe(o,function(t){i.emit("close",1006,"Unable to load an iframe ("+t+")"),i.close()}),this.onmessageCallback=this._message.bind(this),c.attachEvent("message",this.onmessageCallback)}var i=t("inherits"),o=t("json3"),s=t("events").EventEmitter,a=t("../version"),l=t("../utils/url"),u=t("../utils/iframe"),c=t("../utils/event"),f=t("../utils/random");i(r,s),r.prototype.close=function(){if(this.removeAllListeners(),this.iframeObj){c.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(t){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},r.prototype._message=function(t){if(l.isOriginEqual(t.origin,this.origin)){var e;try{e=o.parse(t.data)}catch(t){return}if(e.windowId===this.windowId)switch(e.type){case"s":this.iframeObj.loaded(),this.postMessage("s",o.stringify([a,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",e.data);break;case"c":var n;try{n=o.parse(e.data)}catch(t){return}this.emit("close",n[0],n[1]),this.close()}}},r.prototype.postMessage=function(t,e){this.iframeObj.post(o.stringify({windowId:this.windowId,type:t,data:e||""}),this.origin)},r.prototype.send=function(t){this.postMessage("m",t)},r.enabled=function(){return u.iframeEnabled},r.transportName="iframe",r.roundTrips=2,e.exports=r},{"../utils/event":46,"../utils/iframe":47,"../utils/random":50,"../utils/url":52,"../version":53,debug:void 0,events:3,inherits:54,json3:55}],23:[function(t,e,n){(function(n){"use strict";function r(t){if(!r.enabled())throw new Error("Transport created when disabled");o.call(this,t,"/jsonp",a,s)}var i=t("inherits"),o=t("./lib/sender-receiver"),s=t("./receiver/jsonp"),a=t("./sender/jsonp");i(r,o),r.enabled=function(){return!!n.document},r.transportName="jsonp-polling",r.roundTrips=1,r.needBody=!0,e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/sender-receiver":28,"./receiver/jsonp":31,"./sender/jsonp":33,inherits:54}],24:[function(t,e,n){"use strict";function r(t){return function(e,n,r){var i={};"string"==typeof n&&(i.headers={"Content-type":"text/plain"});var o=s.addPath(e,"/xhr_send"),a=new t("POST",o,n,i);return a.once("finish",function(t){return a=null,200!==t&&204!==t?r(new Error("http status "+t)):void r()}),function(){a.close(),a=null;var t=new Error("Aborted");t.code=1e3,r(t)}}}function i(t,e,n,i){a.call(this,t,e,r(i),n,i)}var o=t("inherits"),s=t("../../utils/url"),a=t("./sender-receiver");o(i,a),e.exports=i},{"../../utils/url":52,"./sender-receiver":28,debug:void 0,inherits:54}],25:[function(t,e,n){"use strict";function r(t,e){o.call(this),this.sendBuffer=[],this.sender=e,this.url=t}var i=t("inherits"),o=t("events").EventEmitter;i(r,o),r.prototype.send=function(t){this.sendBuffer.push(t),this.sendStop||this.sendSchedule()},r.prototype.sendScheduleWait=function(){var t,e=this;this.sendStop=function(){e.sendStop=null,clearTimeout(t)},t=setTimeout(function(){e.sendStop=null,e.sendSchedule()},25)},r.prototype.sendSchedule=function(){var t=this;if(this.sendBuffer.length>0){var e="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,e,function(e){t.sendStop=null,e?(t.emit("close",e.code||1006,"Sending error: "+e),t.close()):t.sendScheduleWait()}),this.sendBuffer=[]}},r.prototype._cleanup=function(){this.removeAllListeners()},r.prototype.close=function(){this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},e.exports=r},{debug:void 0,events:3,inherits:54}],26:[function(t,e,n){(function(n){"use strict";var r=t("inherits"),i=t("../iframe"),o=t("../../utils/object");e.exports=function(t){function e(e,n){i.call(this,t.transportName,e,n)}return r(e,i),e.enabled=function(e,r){if(!n.document)return!1;var s=o.extend({},r);return s.sameOrigin=!0,t.enabled(s)&&i.enabled()},e.transportName="iframe-"+t.transportName,e.needBody=!0,e.roundTrips=i.roundTrips+t.roundTrips-1,e.facadeTransport=t,e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/object":49,"../iframe":22,inherits:54}],27:[function(t,e,n){"use strict";function r(t,e,n){o.call(this),this.Receiver=t,this.receiveUrl=e,this.AjaxObject=n,this._scheduleReceiver()}var i=t("inherits"),o=t("events").EventEmitter;i(r,o),r.prototype._scheduleReceiver=function(){var t=this,e=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);e.on("message",function(e){t.emit("message",e)}),e.once("close",function(n,r){t.poll=e=null,t.pollIsClosing||("network"===r?t._scheduleReceiver():(t.emit("close",n||1006,r),t.removeAllListeners()))})},r.prototype.abort=function(){this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},e.exports=r},{debug:void 0,events:3,inherits:54}],28:[function(t,e,n){"use strict";function r(t,e,n,r,i){var l=o.addPath(t,e),u=this;s.call(this,t,n),this.poll=new a(r,l,i),this.poll.on("message",function(t){u.emit("message",t)}),this.poll.once("close",function(t,e){u.poll=null,u.emit("close",t,e),u.close()})}var i=t("inherits"),o=t("../../utils/url"),s=t("./buffered-sender"),a=t("./polling");i(r,s),r.prototype.close=function(){s.prototype.close.call(this),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},e.exports=r},{"../../utils/url":52,"./buffered-sender":25,"./polling":27,debug:void 0,inherits:54}],29:[function(t,e,n){"use strict";function r(t){o.call(this);var e=this,n=this.es=new s(t);n.onmessage=function(t){e.emit("message",decodeURI(t.data))},n.onerror=function(t){var r=2!==n.readyState?"network":"permanent";e._cleanup(),e._close(r)}}var i=t("inherits"),o=t("events").EventEmitter,s=t("eventsource");i(r,o),r.prototype.abort=function(){this._cleanup(),this._close("user")},r.prototype._cleanup=function(){var t=this.es;t&&(t.onmessage=t.onerror=null,t.close(),this.es=null)},r.prototype._close=function(t){var e=this;setTimeout(function(){e.emit("close",null,t),e.removeAllListeners()},200)},e.exports=r},{debug:void 0,events:3,eventsource:18,inherits:54}],30:[function(t,e,n){(function(n){"use strict";function r(t){a.call(this);var e=this;o.polluteGlobalNamespace(),this.id="a"+l.string(6),t=s.addQuery(t,"c="+decodeURIComponent(o.WPrefix+"."+this.id));var i=r.htmlfileEnabled?o.createHtmlfile:o.createIframe;n[o.WPrefix][this.id]={start:function(){e.iframeObj.loaded()},message:function(t){e.emit("message",t)},stop:function(){e._cleanup(),e._close("network")}},this.iframeObj=i(t,function(){e._cleanup(),e._close("permanent")})}var i=t("inherits"),o=t("../../utils/iframe"),s=t("../../utils/url"),a=t("events").EventEmitter,l=t("../../utils/random");i(r,a),r.prototype.abort=function(){this._cleanup(),this._close("user")},r.prototype._cleanup=function(){this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete n[o.WPrefix][this.id]},r.prototype._close=function(t){this.emit("close",null,t),this.removeAllListeners()},r.htmlfileEnabled=!1;var u=["Active"].concat("Object").join("X");if(u in n)try{r.htmlfileEnabled=!!new n[u]("htmlfile")}catch(t){}r.enabled=r.htmlfileEnabled||o.iframeEnabled,e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,debug:void 0,events:3,inherits:54}],31:[function(t,e,n){(function(n){"use strict";function r(t){var e=this;u.call(this),i.polluteGlobalNamespace(),this.id="a"+o.string(6);var s=a.addQuery(t,"c="+encodeURIComponent(i.WPrefix+"."+this.id));n[i.WPrefix][this.id]=this._callback.bind(this),this._createScript(s),this.timeoutId=setTimeout(function(){e._abort(new Error("JSONP script loaded abnormally (timeout)"))},r.timeout)}var i=t("../../utils/iframe"),o=t("../../utils/random"),s=t("../../utils/browser"),a=t("../../utils/url"),l=t("inherits"),u=t("events").EventEmitter;l(r,u),r.prototype.abort=function(){if(n[i.WPrefix][this.id]){var t=new Error("JSONP user aborted read");t.code=1e3,this._abort(t)}},r.timeout=35e3,r.scriptErrorTimeout=1e3,r.prototype._callback=function(t){this._cleanup(),this.aborting||(t&&this.emit("message",t),this.emit("close",null,"network"),this.removeAllListeners())},r.prototype._abort=function(t){this._cleanup(),this.aborting=!0,this.emit("close",t.code,t.message),this.removeAllListeners()},r.prototype._cleanup=function(){if(clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var t=this.script;t.parentNode.removeChild(t),t.onreadystatechange=t.onerror=t.onload=t.onclick=null,this.script=null}delete n[i.WPrefix][this.id]},r.prototype._scriptError=function(){var t=this;this.errorTimer||(this.errorTimer=setTimeout(function(){t.loadedOkay||t._abort(new Error("JSONP script loaded abnormally (onerror)"))},r.scriptErrorTimeout))},r.prototype._createScript=function(t){var e,r=this,i=this.script=n.document.createElement("script");if(i.id="a"+o.string(8),i.src=t,i.type="text/javascript",i.charset="UTF-8",i.onerror=this._scriptError.bind(this),i.onload=function(){r._abort(new Error("JSONP script loaded abnormally (onload)"))},i.onreadystatechange=function(){if(/loaded|closed/.test(i.readyState)){if(i&&i.htmlFor&&i.onclick){r.loadedOkay=!0;try{i.onclick()}catch(t){}}i&&r._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},"undefined"==typeof i.async&&n.document.attachEvent)if(s.isOpera())e=this.script2=n.document.createElement("script"),e.text="try{var a = document.getElementById('"+i.id+"'); if(a)a.onerror();}catch(x){};",
  3 +i.async=e.async=!1;else{try{i.htmlFor=i.id,i.event="onclick"}catch(t){}i.async=!0}"undefined"!=typeof i.async&&(i.async=!0);var a=n.document.getElementsByTagName("head")[0];a.insertBefore(i,a.firstChild),e&&a.insertBefore(e,a.firstChild)},e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,debug:void 0,events:3,inherits:54}],32:[function(t,e,n){"use strict";function r(t,e){o.call(this);var n=this;this.bufferPosition=0,this.xo=new e("POST",t,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(t,e){n._chunkHandler(t,e),n.xo=null;var r=200===t?"network":"permanent";n.emit("close",null,r),n._cleanup()})}var i=t("inherits"),o=t("events").EventEmitter;i(r,o),r.prototype._chunkHandler=function(t,e){if(200===t&&e)for(var n=-1;;this.bufferPosition+=n+1){var r=e.slice(this.bufferPosition);if(n=r.indexOf("\n"),n===-1)break;var i=r.slice(0,n);i&&this.emit("message",i)}},r.prototype._cleanup=function(){this.removeAllListeners()},r.prototype.abort=function(){this.xo&&(this.xo.close(),this.emit("close",null,"user"),this.xo=null),this._cleanup()},e.exports=r},{debug:void 0,events:3,inherits:54}],33:[function(t,e,n){(function(n){"use strict";function r(t){try{return n.document.createElement('<iframe name="'+t+'">')}catch(r){var e=n.document.createElement("iframe");return e.name=t,e}}function i(){o=n.document.createElement("form"),o.style.display="none",o.style.position="absolute",o.method="POST",o.enctype="application/x-www-form-urlencoded",o.acceptCharset="UTF-8",s=n.document.createElement("textarea"),s.name="d",o.appendChild(s),n.document.body.appendChild(o)}var o,s,a=t("../../utils/random"),l=t("../../utils/url");e.exports=function(t,e,n){o||i();var u="a"+a.string(8);o.target=u,o.action=l.addQuery(l.addPath(t,"/jsonp_send"),"i="+u);var c=r(u);c.id=u,c.style.display="none",o.appendChild(c);try{s.value=e}catch(t){}o.submit();var f=function(t){c.onerror&&(c.onreadystatechange=c.onerror=c.onload=null,setTimeout(function(){c.parentNode.removeChild(c),c=null},500),s.value="",n(t))};return c.onerror=function(){f()},c.onload=function(){f()},c.onreadystatechange=function(t){"complete"===c.readyState&&f()},function(){f(new Error("Aborted"))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/random":50,"../../utils/url":52,debug:void 0}],34:[function(t,e,n){(function(n){"use strict";function r(t,e,n){var r=this;i.call(this),setTimeout(function(){r._start(t,e,n)},0)}var i=t("events").EventEmitter,o=t("inherits"),s=t("../../utils/event"),a=t("../../utils/browser"),l=t("../../utils/url");o(r,i),r.prototype._start=function(t,e,r){var i=this,o=new n.XDomainRequest;e=l.addQuery(e,"t="+ +new Date),o.onerror=function(){i._error()},o.ontimeout=function(){i._error()},o.onprogress=function(){i.emit("chunk",200,o.responseText)},o.onload=function(){i.emit("finish",200,o.responseText),i._cleanup(!1)},this.xdr=o,this.unloadRef=s.unloadAdd(function(){i._cleanup(!0)});try{this.xdr.open(t,e),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(r)}catch(t){this._error()}},r.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},r.prototype._cleanup=function(t){if(this.xdr){if(this.removeAllListeners(),s.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,t)try{this.xdr.abort()}catch(t){}this.unloadRef=this.xdr=null}},r.prototype.close=function(){this._cleanup(!0)},r.enabled=!(!n.XDomainRequest||!a.hasDomain()),e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/event":46,"../../utils/url":52,debug:void 0,events:3,inherits:54}],35:[function(t,e,n){"use strict";function r(t,e,n,r){o.call(this,t,e,n,r)}var i=t("inherits"),o=t("../driver/xhr");i(r,o),r.enabled=o.enabled&&o.supportsCORS,e.exports=r},{"../driver/xhr":17,inherits:54}],36:[function(t,e,n){"use strict";function r(){var t=this;i.call(this),this.to=setTimeout(function(){t.emit("finish",200,"{}")},r.timeout)}var i=t("events").EventEmitter,o=t("inherits");o(r,i),r.prototype.close=function(){clearTimeout(this.to)},r.timeout=2e3,e.exports=r},{events:3,inherits:54}],37:[function(t,e,n){"use strict";function r(t,e,n){o.call(this,t,e,n,{noCredentials:!0})}var i=t("inherits"),o=t("../driver/xhr");i(r,o),r.enabled=o.enabled,e.exports=r},{"../driver/xhr":17,inherits:54}],38:[function(t,e,n){"use strict";function r(t,e,n){if(!r.enabled())throw new Error("Transport created when disabled");a.call(this);var s=this,u=o.addPath(t,"/websocket");u="https"===u.slice(0,5)?"wss"+u.slice(5):"ws"+u.slice(4),this.url=u,this.ws=new l(this.url,[],n),this.ws.onmessage=function(t){s.emit("message",t.data)},this.unloadRef=i.unloadAdd(function(){s.ws.close()}),this.ws.onclose=function(t){s.emit("close",t.code,t.reason),s._cleanup()},this.ws.onerror=function(t){s.emit("close",1006,"WebSocket connection broken"),s._cleanup()}}var i=t("../utils/event"),o=t("../utils/url"),s=t("inherits"),a=t("events").EventEmitter,l=t("./driver/websocket");s(r,a),r.prototype.send=function(t){var e="["+t+"]";this.ws.send(e)},r.prototype.close=function(){var t=this.ws;this._cleanup(),t&&t.close()},r.prototype._cleanup=function(){var t=this.ws;t&&(t.onmessage=t.onclose=t.onerror=null),i.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},r.enabled=function(){return!!l},r.transportName="websocket",r.roundTrips=2,e.exports=r},{"../utils/event":46,"../utils/url":52,"./driver/websocket":19,debug:void 0,events:3,inherits:54}],39:[function(t,e,n){"use strict";function r(t){if(!l.enabled)throw new Error("Transport created when disabled");o.call(this,t,"/xhr",a,l)}var i=t("inherits"),o=t("./lib/ajax-based"),s=t("./xdr-streaming"),a=t("./receiver/xhr"),l=t("./sender/xdr");i(r,o),r.enabled=s.enabled,r.transportName="xdr-polling",r.roundTrips=2,e.exports=r},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,"./xdr-streaming":40,inherits:54}],40:[function(t,e,n){"use strict";function r(t){if(!a.enabled)throw new Error("Transport created when disabled");o.call(this,t,"/xhr_streaming",s,a)}var i=t("inherits"),o=t("./lib/ajax-based"),s=t("./receiver/xhr"),a=t("./sender/xdr");i(r,o),r.enabled=function(t){return!t.cookie_needed&&!t.nullOrigin&&(a.enabled&&t.sameScheme)},r.transportName="xdr-streaming",r.roundTrips=2,e.exports=r},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,inherits:54}],41:[function(t,e,n){"use strict";function r(t){if(!l.enabled&&!a.enabled)throw new Error("Transport created when disabled");o.call(this,t,"/xhr",s,a)}var i=t("inherits"),o=t("./lib/ajax-based"),s=t("./receiver/xhr"),a=t("./sender/xhr-cors"),l=t("./sender/xhr-local");i(r,o),r.enabled=function(t){return!t.nullOrigin&&(!(!l.enabled||!t.sameOrigin)||a.enabled)},r.transportName="xhr-polling",r.roundTrips=2,e.exports=r},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,inherits:54}],42:[function(t,e,n){(function(n){"use strict";function r(t){if(!l.enabled&&!a.enabled)throw new Error("Transport created when disabled");o.call(this,t,"/xhr_streaming",s,a)}var i=t("inherits"),o=t("./lib/ajax-based"),s=t("./receiver/xhr"),a=t("./sender/xhr-cors"),l=t("./sender/xhr-local"),u=t("../utils/browser");i(r,o),r.enabled=function(t){return!t.nullOrigin&&(!u.isOpera()&&a.enabled)},r.transportName="xhr-streaming",r.roundTrips=2,r.needBody=!!n.document,e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/browser":44,"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,inherits:54}],43:[function(t,e,n){(function(t){"use strict";t.crypto&&t.crypto.getRandomValues?e.exports.randomBytes=function(e){var n=new Uint8Array(e);return t.crypto.getRandomValues(n),n}:e.exports.randomBytes=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=Math.floor(256*Math.random());return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],44:[function(t,e,n){(function(t){"use strict";e.exports={isOpera:function(){return t.navigator&&/opera/i.test(t.navigator.userAgent)},isKonqueror:function(){return t.navigator&&/konqueror/i.test(t.navigator.userAgent)},hasDomain:function(){if(!t.document)return!0;try{return!!t.document.domain}catch(t){return!1}}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(t,e,n){"use strict";var r,i=t("json3"),o=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g,s=function(t){var e,n={},r=[];for(e=0;e<65536;e++)r.push(String.fromCharCode(e));return t.lastIndex=0,r.join("").replace(t,function(t){return n[t]="\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4),""}),t.lastIndex=0,n};e.exports={quote:function(t){var e=i.stringify(t);return o.lastIndex=0,o.test(e)?(r||(r=s(o)),e.replace(o,function(t){return r[t]})):e}}},{json3:55}],46:[function(t,e,n){(function(n){"use strict";var r=t("./random"),i={},o=!1,s=n.chrome&&n.chrome.app&&n.chrome.app.runtime;e.exports={attachEvent:function(t,e){"undefined"!=typeof n.addEventListener?n.addEventListener(t,e,!1):n.document&&n.attachEvent&&(n.document.attachEvent("on"+t,e),n.attachEvent("on"+t,e))},detachEvent:function(t,e){"undefined"!=typeof n.addEventListener?n.removeEventListener(t,e,!1):n.document&&n.detachEvent&&(n.document.detachEvent("on"+t,e),n.detachEvent("on"+t,e))},unloadAdd:function(t){if(s)return null;var e=r.string(8);return i[e]=t,o&&setTimeout(this.triggerUnloadCallbacks,0),e},unloadDel:function(t){t in i&&delete i[t]},triggerUnloadCallbacks:function(){for(var t in i)i[t](),delete i[t]}};var a=function(){o||(o=!0,e.exports.triggerUnloadCallbacks())};s||e.exports.attachEvent("unload",a)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./random":50}],47:[function(t,e,n){(function(n){"use strict";var r=t("./event"),i=t("json3"),o=t("./browser");e.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){e.exports.WPrefix in n||(n[e.exports.WPrefix]={})},postMessage:function(t,r){n.parent!==n&&n.parent.postMessage(i.stringify({windowId:e.exports.currentWindowId,type:t,data:r||""}),"*")},createIframe:function(t,e){var i,o,s=n.document.createElement("iframe"),a=function(){clearTimeout(i);try{s.onload=null}catch(t){}s.onerror=null},l=function(){s&&(a(),setTimeout(function(){s&&s.parentNode.removeChild(s),s=null},0),r.unloadDel(o))},u=function(t){s&&(l(),e(t))},c=function(t,e){try{setTimeout(function(){s&&s.contentWindow&&s.contentWindow.postMessage(t,e)},0)}catch(t){}};return s.src=t,s.style.display="none",s.style.position="absolute",s.onerror=function(){u("onerror")},s.onload=function(){clearTimeout(i),i=setTimeout(function(){u("onload timeout")},2e3)},n.document.body.appendChild(s),i=setTimeout(function(){u("timeout")},15e3),o=r.unloadAdd(l),{post:c,cleanup:l,loaded:a}},createHtmlfile:function(t,i){var o,s,a,l=["Active"].concat("Object").join("X"),u=new n[l]("htmlfile"),c=function(){clearTimeout(o),a.onerror=null},f=function(){u&&(c(),r.unloadDel(s),a.parentNode.removeChild(a),a=u=null,CollectGarbage())},h=function(t){u&&(f(),i(t))},d=function(t,e){try{setTimeout(function(){a&&a.contentWindow&&a.contentWindow.postMessage(t,e)},0)}catch(t){}};u.open(),u.write('<html><script>document.domain="'+n.document.domain+'";</script></html>'),u.close(),u.parentWindow[e.exports.WPrefix]=n[e.exports.WPrefix];var p=u.createElement("div");return u.body.appendChild(p),a=u.createElement("iframe"),p.appendChild(a),a.src=t,a.onerror=function(){h("onerror")},o=setTimeout(function(){h("timeout")},15e3),s=r.unloadAdd(f),{post:d,cleanup:f,loaded:c}}},e.exports.iframeEnabled=!1,n.document&&(e.exports.iframeEnabled=("function"==typeof n.postMessage||"object"==typeof n.postMessage)&&!o.isKonqueror())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./browser":44,"./event":46,debug:void 0,json3:55}],48:[function(t,e,n){(function(t){"use strict";var n={};["log","debug","warn"].forEach(function(e){var r;try{r=t.console&&t.console[e]&&t.console[e].apply}catch(t){}n[e]=r?function(){return t.console[e].apply(t.console,arguments)}:"log"===e?function(){}:n.log}),e.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],49:[function(t,e,n){"use strict";e.exports={isObject:function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},extend:function(t){if(!this.isObject(t))return t;for(var e,n,r=1,i=arguments.length;r<i;r++){e=arguments[r];for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t}}},{}],50:[function(t,e,n){"use strict";var r=t("crypto"),i="abcdefghijklmnopqrstuvwxyz012345";e.exports={string:function(t){for(var e=i.length,n=r.randomBytes(t),o=[],s=0;s<t;s++)o.push(i.substr(n[s]%e,1));return o.join("")},number:function(t){return Math.floor(Math.random()*t)},numberString:function(t){var e=(""+(t-1)).length,n=new Array(e+1).join("0");return(n+this.number(t)).slice(-e)}}},{crypto:43}],51:[function(t,e,n){"use strict";e.exports=function(t){return{filterToEnabled:function(e,n){var r={main:[],facade:[]};return e?"string"==typeof e&&(e=[e]):e=[],t.forEach(function(t){t&&("websocket"===t.transportName&&n.websocket===!1||e.length&&e.indexOf(t.transportName)===-1||t.enabled(n)&&(r.main.push(t),t.facadeTransport&&r.facade.push(t.facadeTransport)))}),r}}}},{debug:void 0}],52:[function(t,e,n){"use strict";var r=t("url-parse");e.exports={getOrigin:function(t){if(!t)return null;var e=new r(t);if("file:"===e.protocol)return null;var n=e.port;return n||(n="https:"===e.protocol?"443":"80"),e.protocol+"//"+e.hostname+":"+n},isOriginEqual:function(t,e){var n=this.getOrigin(t)===this.getOrigin(e);return n},isSchemeEqual:function(t,e){return t.split(":")[0]===e.split(":")[0]},addPath:function(t,e){var n=t.split("?");return n[0]+e+(n[1]?"?"+n[1]:"")},addQuery:function(t,e){return t+(t.indexOf("?")===-1?"?"+e:"&"+e)}}},{debug:void 0,"url-parse":58}],53:[function(t,e,n){e.exports="1.1.2"},{}],54:[function(t,e,n){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],55:[function(e,n,r){(function(e){(function(){function i(t,e){function n(t){if(n[t]!==m)return n[t];var i;if("bug-string-char-index"==t)i="a"!="a"[0];else if("json"==t)i=n("json-stringify")&&n("json-parse");else{var s,a='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==t){var l=e.stringify,c="function"==typeof l&&g;if(c){(s=function(){return 1}).toJSON=s;try{c="0"===l(0)&&"0"===l(new r)&&'""'==l(new o)&&l(y)===m&&l(m)===m&&l()===m&&"1"===l(s)&&"[1]"==l([s])&&"[null]"==l([m])&&"null"==l(null)&&"[null,null,null]"==l([m,y,null])&&l({a:[s,!0,!1,null,"\0\b\n\f\r\t"]})==a&&"1"===l(null,s)&&"[\n 1,\n 2\n]"==l([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==l(new u((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==l(new u(864e13))&&'"-000001-01-01T00:00:00.000Z"'==l(new u((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==l(new u((-1)))}catch(t){c=!1}}i=c}if("json-parse"==t){var f=e.parse;if("function"==typeof f)try{if(0===f("0")&&!f(!1)){s=f(a);var h=5==s.a.length&&1===s.a[0];if(h){try{h=!f('"\t"')}catch(t){}if(h)try{h=1!==f("01")}catch(t){}if(h)try{h=1!==f("1.")}catch(t){}}}}catch(t){h=!1}i=h}}return n[t]=!!i}t||(t=l.Object()),e||(e=l.Object());var r=t.Number||l.Number,o=t.String||l.String,a=t.Object||l.Object,u=t.Date||l.Date,c=t.SyntaxError||l.SyntaxError,f=t.TypeError||l.TypeError,h=t.Math||l.Math,d=t.JSON||l.JSON;"object"==typeof d&&d&&(e.stringify=d.stringify,e.parse=d.parse);var p,v,m,b=a.prototype,y=b.toString,g=new u((-0xc782b5b800cec));try{g=g.getUTCFullYear()==-109252&&0===g.getUTCMonth()&&1===g.getUTCDate()&&10==g.getUTCHours()&&37==g.getUTCMinutes()&&6==g.getUTCSeconds()&&708==g.getUTCMilliseconds()}catch(t){}if(!n("json")){var w="[object Function]",x="[object Date]",_="[object Number]",E="[object String]",j="[object Array]",T="[object Boolean]",S=n("bug-string-char-index");if(!g)var O=h.floor,C=[0,31,59,90,120,151,181,212,243,273,304,334],A=function(t,e){return C[e]+365*(t-1970)+O((t-1969+(e=+(e>1)))/4)-O((t-1901+e)/100)+O((t-1601+e)/400)};if((p=b.hasOwnProperty)||(p=function(t){var e,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=y?p=function(t){var e=this.__proto__,n=t in(this.__proto__=null,this);return this.__proto__=e,n}:(e=n.constructor,p=function(t){var n=(this.constructor||e).prototype;return t in this&&!(t in n&&this[t]===n[t])}),n=null,p.call(this,t)}),v=function(t,e){var n,r,i,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(i in r)p.call(r,i)&&o++;return n=r=null,o?v=2==o?function(t,e){var n,r={},i=y.call(t)==w;for(n in t)i&&"prototype"==n||p.call(r,n)||!(r[n]=1)||!p.call(t,n)||e(n)}:function(t,e){var n,r,i=y.call(t)==w;for(n in t)i&&"prototype"==n||!p.call(t,n)||(r="constructor"===n)||e(n);(r||p.call(t,n="constructor"))&&e(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],v=function(t,e){var n,i,o=y.call(t)==w,a=!o&&"function"!=typeof t.constructor&&s[typeof t.hasOwnProperty]&&t.hasOwnProperty||p;for(n in t)o&&"prototype"==n||!a.call(t,n)||e(n);for(i=r.length;n=r[--i];a.call(t,n)&&e(n));}),v(t,e)},!n("json-stringify")){var N={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},k="000000",I=function(t,e){return(k+(e||0)).slice(-t)},P="\\u00",L=function(t){for(var e='"',n=0,r=t.length,i=!S||r>10,o=i&&(S?t.split(""):t);n<r;n++){var s=t.charCodeAt(n);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:e+=N[s];break;default:if(s<32){e+=P+I(2,s.toString(16));break}e+=i?o[n]:t.charAt(n)}}return e+'"'},R=function(t,e,n,r,i,o,s){var a,l,u,c,h,d,b,g,w,S,C,N,k,P,U,M;try{a=e[t]}catch(t){}if("object"==typeof a&&a)if(l=y.call(a),l!=x||p.call(a,"toJSON"))"function"==typeof a.toJSON&&(l!=_&&l!=E&&l!=j||p.call(a,"toJSON"))&&(a=a.toJSON(t));else if(a>-1/0&&a<1/0){if(A){for(h=O(a/864e5),u=O(h/365.2425)+1970-1;A(u+1,0)<=h;u++);for(c=O((h-A(u,0))/30.42);A(u,c+1)<=h;c++);h=1+h-A(u,c),d=(a%864e5+864e5)%864e5,b=O(d/36e5)%24,g=O(d/6e4)%60,w=O(d/1e3)%60,S=d%1e3}else u=a.getUTCFullYear(),c=a.getUTCMonth(),h=a.getUTCDate(),b=a.getUTCHours(),g=a.getUTCMinutes(),w=a.getUTCSeconds(),S=a.getUTCMilliseconds();a=(u<=0||u>=1e4?(u<0?"-":"+")+I(6,u<0?-u:u):I(4,u))+"-"+I(2,c+1)+"-"+I(2,h)+"T"+I(2,b)+":"+I(2,g)+":"+I(2,w)+"."+I(3,S)+"Z"}else a=null;if(n&&(a=n.call(e,t,a)),null===a)return"null";if(l=y.call(a),l==T)return""+a;if(l==_)return a>-1/0&&a<1/0?""+a:"null";if(l==E)return L(""+a);if("object"==typeof a){for(P=s.length;P--;)if(s[P]===a)throw f();if(s.push(a),C=[],U=o,o+=i,l==j){for(k=0,P=a.length;k<P;k++)N=R(k,a,n,r,i,o,s),C.push(N===m?"null":N);M=C.length?i?"[\n"+o+C.join(",\n"+o)+"\n"+U+"]":"["+C.join(",")+"]":"[]"}else v(r||a,function(t){var e=R(t,a,n,r,i,o,s);e!==m&&C.push(L(t)+":"+(i?" ":"")+e)}),M=C.length?i?"{\n"+o+C.join(",\n"+o)+"\n"+U+"}":"{"+C.join(",")+"}":"{}";return s.pop(),M}};e.stringify=function(t,e,n){var r,i,o,a;if(s[typeof e]&&e)if((a=y.call(e))==w)i=e;else if(a==j){o={};for(var l,u=0,c=e.length;u<c;l=e[u++],a=y.call(l),(a==E||a==_)&&(o[l]=1));}if(n)if((a=y.call(n))==_){if((n-=n%1)>0)for(r="",n>10&&(n=10);r.length<n;r+=" ");}else a==E&&(r=n.length<=10?n:n.slice(0,10));return R("",(l={},l[""]=t,l),i,o,r,"",[])}}if(!n("json-parse")){var U,M,q=o.fromCharCode,D={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},W=function(){throw U=M=null,c()},J=function(){for(var t,e,n,r,i,o=M,s=o.length;U<s;)switch(i=o.charCodeAt(U)){case 9:case 10:case 13:case 32:U++;break;case 123:case 125:case 91:case 93:case 58:case 44:return t=S?o.charAt(U):o[U],U++,t;case 34:for(t="@",U++;U<s;)if(i=o.charCodeAt(U),i<32)W();else if(92==i)switch(i=o.charCodeAt(++U)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:t+=D[i],U++;break;case 117:for(e=++U,n=U+4;U<n;U++)i=o.charCodeAt(U),i>=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||W();t+=q("0x"+o.slice(e,U));break;default:W()}else{if(34==i)break;for(i=o.charCodeAt(U),e=U;i>=32&&92!=i&&34!=i;)i=o.charCodeAt(++U);t+=o.slice(e,U)}if(34==o.charCodeAt(U))return U++,t;W();default:if(e=U,45==i&&(r=!0,i=o.charCodeAt(++U)),i>=48&&i<=57){for(48==i&&(i=o.charCodeAt(U+1),i>=48&&i<=57)&&W(),r=!1;U<s&&(i=o.charCodeAt(U),i>=48&&i<=57);U++);if(46==o.charCodeAt(U)){for(n=++U;n<s&&(i=o.charCodeAt(n),i>=48&&i<=57);n++);n==U&&W(),U=n}if(i=o.charCodeAt(U),101==i||69==i){for(i=o.charCodeAt(++U),43!=i&&45!=i||U++,n=U;n<s&&(i=o.charCodeAt(n),i>=48&&i<=57);n++);n==U&&W(),U=n}return+o.slice(e,U)}if(r&&W(),"true"==o.slice(U,U+4))return U+=4,!0;if("false"==o.slice(U,U+5))return U+=5,!1;if("null"==o.slice(U,U+4))return U+=4,null;W()}return"$"},B=function(t){var e,n;if("$"==t&&W(),"string"==typeof t){if("@"==(S?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(e=[];t=J(),"]"!=t;n||(n=!0))n&&(","==t?(t=J(),"]"==t&&W()):W()),","==t&&W(),e.push(B(t));return e}if("{"==t){for(e={};t=J(),"}"!=t;n||(n=!0))n&&(","==t?(t=J(),"}"==t&&W()):W()),","!=t&&"string"==typeof t&&"@"==(S?t.charAt(0):t[0])&&":"==J()||W(),e[t.slice(1)]=B(J());return e}W()}return t},G=function(t,e,n){var r=F(t,e,n);r===m?delete t[e]:t[e]=r},F=function(t,e,n){var r,i=t[e];if("object"==typeof i&&i)if(y.call(i)==j)for(r=i.length;r--;)G(i,r,n);else v(i,function(t){G(i,t,n)});return n.call(t,e,i)};e.parse=function(t,e){var n,r;return U=0,M=""+t,n=B(J()),"$"!=J()&&W(),U=M=null,e&&y.call(e)==w?F((r={},r[""]=n,r),"",e):n}}}return e.runInContext=i,e}var o="function"==typeof t&&t.amd,s={function:!0,object:!0},a=s[typeof r]&&r&&!r.nodeType&&r,l=s[typeof window]&&window||this,u=a&&s[typeof n]&&n&&!n.nodeType&&"object"==typeof e&&e;if(!u||u.global!==u&&u.window!==u&&u.self!==u||(l=u),a&&!o)i(l,a);else{var c=l.JSON,f=l.JSON3,h=!1,d=i(l,l.JSON3={noConflict:function(){return h||(h=!0,l.JSON=c,l.JSON3=f,c=f=null),d}});l.JSON={parse:d.parse,stringify:d.stringify}}o&&t(function(){return d})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],56:[function(t,e,n){"use strict";function r(t){for(var e,n=/([^=?&]+)=?([^&]*)/g,r={};e=n.exec(t);r[decodeURIComponent(e[1])]=decodeURIComponent(e[2]));return r}function i(t,e){e=e||"";var n=[];"string"!=typeof e&&(e="?");for(var r in t)o.call(t,r)&&n.push(encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return n.length?e+n.join("&"):""}var o=Object.prototype.hasOwnProperty;n.stringify=i,n.parse=r},{}],57:[function(t,e,n){"use strict";e.exports=function(t,e){if(e=e.split(":")[0],t=+t,!t)return!1;switch(e){case"http":case"ws":return 80!==t;case"https":case"wss":return 443!==t;case"ftp":return 21!==t;case"gopher":return 70!==t;case"file":return!1}return 0!==t}},{}],58:[function(t,e,n){"use strict";function r(t){var e=u.exec(t);return{protocol:e[1]?e[1].toLowerCase():"",slashes:!!e[2],rest:e[3]}}function i(t,e){for(var n=(e||"/").split("/").slice(0,-1).concat(t.split("/")),r=n.length,i=n[r-1],o=!1,s=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),s++):s&&(0===r&&(o=!0),n.splice(r,1),s--);return o&&n.unshift(""),"."!==i&&".."!==i||n.push(""),n.join("/")}function o(t,e,n){if(!(this instanceof o))return new o(t,e,n);var u,f,h,d,p,v,m=c.slice(),b=typeof e,y=this,g=0;for("object"!==b&&"string"!==b&&(n=e,e=null),n&&"function"!=typeof n&&(n=l.parse),e=a(e),f=r(t||""),u=!f.protocol&&!f.slashes,y.slashes=f.slashes||u&&e.slashes,y.protocol=f.protocol||e.protocol||"",t=f.rest,f.slashes||(m[2]=[/(.*)/,"pathname"]);g<m.length;g++)d=m[g],h=d[0],v=d[1],h!==h?y[v]=t:"string"==typeof h?~(p=t.indexOf(h))&&("number"==typeof d[2]?(y[v]=t.slice(0,p),t=t.slice(p+d[2])):(y[v]=t.slice(p),t=t.slice(0,p))):(p=h.exec(t))&&(y[v]=p[1],t=t.slice(0,p.index)),y[v]=y[v]||(u&&d[3]?e[v]||"":""),d[4]&&(y[v]=y[v].toLowerCase());n&&(y.query=n(y.query)),u&&e.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==e.pathname)&&(y.pathname=i(y.pathname,e.pathname)),s(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(d=y.auth.split(":"),y.username=d[0]||"",y.password=d[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}var s=t("requires-port"),a=t("./lolcation"),l=t("querystringify"),u=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,c=[["#","hash"],["?","query"],["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]];o.prototype.set=function(t,e,n){var r=this;switch(t){case"query":"string"==typeof e&&e.length&&(e=(n||l.parse)(e)),r[t]=e;break;case"port":r[t]=e,s(e,r.protocol)?e&&(r.host=r.hostname+":"+e):(r.host=r.hostname,r[t]="");break;case"hostname":r[t]=e,r.port&&(e+=":"+r.port),r.host=e;break;case"host":r[t]=e,/:\d+$/.test(e)?(e=e.split(":"),r.port=e.pop(),r.hostname=e.join(":")):(r.hostname=e,r.port="");break;case"protocol":r.protocol=e.toLowerCase(),r.slashes=!n;break;case"pathname":r.pathname=e.length&&"/"!==e.charAt(0)?"/"+e:e;break;default:r[t]=e}for(var i=0;i<c.length;i++){var o=c[i];o[4]&&(r[o[1]]=r[o[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r},o.prototype.toString=function(t){t&&"function"==typeof t||(t=l.stringify);var e,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var i=r+(n.slashes?"//":"");return n.username&&(i+=n.username,n.password&&(i+=":"+n.password),i+="@"),i+=n.host+n.pathname,e="object"==typeof n.query?t(n.query):n.query,e&&(i+="?"!==e.charAt(0)?"?"+e:e),n.hash&&(i+=n.hash),i},o.extractProtocol=r,o.location=a,o.qs=l,e.exports=o},{"./lolcation":59,querystringify:56,"requires-port":57}],59:[function(t,e,n){(function(n){"use strict";var r,i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,o={hash:1,query:1};e.exports=function(e){e=e||n.location||{},r=r||t("./");var s,a={},l=typeof e;if("blob:"===e.protocol)a=new r(unescape(e.pathname),{});else if("string"===l){a=new r(e,{});for(s in o)delete a[s]}else if("object"===l){for(s in e)s in o||(a[s]=e[s]);void 0===a.slashes&&(a.slashes=i.test(e.href))}return a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./":58}]},{},[1])(1)});
  4 +//# sourceMappingURL=sockjs.min.js.map
... ...
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css 0 → 100644
  1 +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
  2 +[data-uk-sticky].uk-active{z-index:980;box-sizing:border-box;-webkit-backface-visibility:hidden}[data-uk-sticky][class*=uk-animation-]{-webkit-animation-duration:.2s;animation-duration:.2s}[data-uk-sticky].uk-animation-reverse{-webkit-animation-duration:.2s;animation-duration:.2s}
0 3 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js 0 → 100644
  1 +/*! UIkit 2.27.1 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
  2 +!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(){var i=arguments.length?arguments:n;if(i.length&&!(e.scrollTop()<0))for(var o,a,r,h,p=e.scrollTop(),c=s.height(),l=e.height(),m=c-l,d=p>m?m-p:0,u=0;u<i.length;u++)if(h=i[u],h.element.is(":visible")&&!h.animate){if(h.check()){if(h.top<0?o=0:(r=h.element.outerHeight(),o=c-r-h.top-h.options.bottom-p-d,o=0>o?o+h.top:h.top),h.boundary&&h.boundary.length){var f=h.boundary.offset().top;a=h.boundtoparent?c-(f+h.boundary.outerHeight())+parseInt(h.boundary.css("padding-bottom")):c-f,o=p+r>c-a-(h.top<0?0:h.top)?c-a-(p+r):o}if(h.currentTop!=o){if(h.element.css({position:"fixed",top:o,width:h.getWidthFrom.length?h.getWidthFrom.width():h.element.width()}),!h.init&&(h.element.addClass(h.options.clsinit),location.hash&&p>0&&h.options.target)){var g=t.$(location.hash);g.length&&setTimeout(function(t,i){return function(){i.element.width();var e=t.offset(),s=e.top+t.outerHeight(),n=i.element.offset(),o=i.element.outerHeight(),a=n.top+o;n.top<s&&e.top<a&&(p=e.top-o-i.options.target,window.scrollTo(0,p))}}(g,h),0)}h.element.addClass(h.options.clsactive).removeClass(h.options.clsinactive),h.element.trigger("active.uk.sticky"),h.element.css("margin",""),h.options.animation&&h.init&&!t.Utils.isInView(h.wrapper)&&h.element.addClass(h.options.animation),h.currentTop=o}}else null!==h.currentTop&&h.reset();h.init=!0}}var e=t.$win,s=t.$doc,n=[],o=1;return t.component("sticky",{defaults:{top:0,bottom:0,animation:"",clsinit:"uk-sticky-init",clsactive:"uk-active",clsinactive:"",getWidthFrom:"",showup:!1,boundary:!1,media:!1,target:!1,disabled:!1},boot:function(){t.$doc.on("scrolling.uk.document",function(t,e){e&&e.dir&&(o=e.dir.y,i())}),t.$win.on("resize orientationchange",t.Utils.debounce(function(){if(n.length){for(var t=0;t<n.length;t++)n[t].reset(!0),n[t].self.computeWrapper();i()}},100)),t.ready(function(e){setTimeout(function(){t.$("[data-uk-sticky]",e).each(function(){var i=t.$(this);i.data("sticky")||t.sticky(i,t.Utils.options(i.attr("data-uk-sticky")))}),i()},0)})},init:function(){var i,a=this.options.boundary;this.wrapper=this.element.wrap('<div class="uk-sticky-placeholder"></div>').parent(),this.computeWrapper(),this.wrapper.css({"margin-top":this.element.css("margin-top"),"margin-bottom":this.element.css("margin-bottom"),"margin-left":this.element.css("margin-left"),"margin-right":this.element.css("margin-right")}),this.element.css("margin",0),a&&(a===!0||"!"===a[0]?(a=a===!0?this.wrapper.parent():this.wrapper.closest(a.substr(1)),i=!0):"string"==typeof a&&(a=t.$(a))),this.sticky={self:this,options:this.options,element:this.element,currentTop:null,wrapper:this.wrapper,init:!1,getWidthFrom:t.$(this.options.getWidthFrom||this.wrapper),boundary:a,boundtoparent:i,top:0,calcTop:function(){var i=this.options.top;if(this.options.top&&"string"==typeof this.options.top)if(this.options.top.match(/^(-|)(\d+)vh$/))i=window.innerHeight*parseInt(this.options.top,10)/100;else{var e=t.$(this.options.top).first();e.length&&e.is(":visible")&&(i=-1*(e.offset().top+e.outerHeight()-this.wrapper.offset().top))}this.top=i},reset:function(i){this.calcTop();var e=function(){this.element.css({position:"",top:"",width:"",left:"",margin:"0"}),this.element.removeClass([this.options.animation,"uk-animation-reverse",this.options.clsactive].join(" ")),this.element.addClass(this.options.clsinactive),this.element.trigger("inactive.uk.sticky"),this.currentTop=null,this.animate=!1}.bind(this);!i&&this.options.animation&&t.support.animation&&!t.Utils.isInView(this.wrapper)?(this.animate=!0,this.element.removeClass(this.options.animation).one(t.support.animation.end,function(){e()}).width(),this.element.addClass(this.options.animation+" uk-animation-reverse")):e()},check:function(){if(this.options.disabled)return!1;if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidth<this.options.media)return!1;break;case"string":if(window.matchMedia&&!window.matchMedia(this.options.media).matches)return!1}var i=e.scrollTop(),n=s.height(),a=n-window.innerHeight,r=i>a?a-i:0,h=this.wrapper.offset().top,p=h-this.top-r,c=i>=p;return c&&this.options.showup&&(1==o&&(c=!1),-1==o&&!this.element.hasClass(this.options.clsactive)&&t.Utils.isInView(this.wrapper)&&(c=!1)),c}},this.sticky.calcTop(),n.push(this.sticky)},update:function(){i(this.sticky)},enable:function(){this.options.disabled=!1,this.update()},disable:function(t){this.options.disabled=!0,this.sticky.reset(t)},computeWrapper:function(){this.wrapper.css({height:-1==["absolute","fixed"].indexOf(this.element.css("position"))?this.element.outerHeight():"","float":"none"!=this.element.css("float")?this.element.css("float"):""}),"fixed"==this.element.css("position")&&this.element.css({width:this.sticky.getWidthFrom.length?this.sticky.getWidthFrom.width():this.element.width()})}}),t.sticky});
0 3 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/css/main.css
1   -/* ^_^ baidu map hide logo */
2 1  
  2 +.ps-container > .ps-scrollbar-y-rail{
  3 + z-index: 1 !important;
  4 +}
  5 +
  6 +.ps-container > .ps-scrollbar-x-rail,
  7 +.ps-container > .ps-scrollbar-y-rail {
  8 + opacity: 0.6 !important;
  9 + padding: 0 !important;
  10 +}
  11 +/* ^_^ baidu map hide logo */
3 12 .anchorBL, .anchorBL, .amap-logo, .amap-copyright {
4 13 display: none;
5 14 }
... ... @@ -952,9 +961,6 @@ option.oil_station_opt{
952 961 .safe_driv_pop .title{
953 962 }
954 963  
955   -/*.safe_driv_pop i.uk-icon-times-circle{
956   - margin-right: 5px;
957   -}*/
958 964 .safe_driv_pop .desc{
959 965 display: block;
960 966 font-size: 12px;
... ... @@ -963,20 +969,93 @@ option.oil_station_opt{
963 969 margin-right: 5px;
964 970 }
965 971  
966   -/*.safe_driv_pop .detail_content{
  972 +/** 嵌入表单modal滚动条样式 */
  973 +#formFragmentModal::-webkit-scrollbar {
  974 + width: 10px;
  975 + background-color: #F5F5F5;
  976 +}
  977 +#formFragmentModal::-webkit-scrollbar-thumb {
  978 + background-color: #000000;
  979 +}
  980 +#formFragmentModal::-webkit-scrollbar-track {
  981 + border: 0;
  982 + background-color: #F5F5F5;
  983 + border-radius: 0;
  984 +}
  985 +
  986 +#formFragmentModal::-webkit-scrollbar-thumb{
  987 + border: 5px solid rgb(226, 122, 122);
  988 +}
  989 +
  990 +#schedule-addsch_oil-modal select{
  991 + height: 30px !important;
  992 +}
  993 +
  994 +#oil_station-modal .input_clear_icon{
  995 + position: absolute;
  996 + top: 6px;
  997 + right: 108px;
  998 + color: #f75757;
  999 + height: 18px;
  1000 + line-height: 18px;
  1001 + border-radius: 7px;
  1002 + font-size: 16px;
967 1003 display: none;
  1004 + cursor: pointer;
  1005 +}
  1006 +
  1007 +#oil_station-modal .input_clear_icon:hover{
  1008 + color: #de2020;
968 1009 }
969 1010  
970   -.safe_driv_pop.open .detail_content{
  1011 +#oil_station-modal .input_clear_icon:before{
971 1012 display: block;
972   - background: rgb(255, 255, 255);
973   - height: 200px;
974   - margin: 7px 0;
975   - border-radius: 5px;
976   - color: #000000;
  1013 + font-family: FontAwesome;
  1014 + content: "\f057";
977 1015 }
978 1016  
979   -.safe_driv_pop.open .desc{
980   - display: none;
981   -}*/
982   -/** 安全驾驶相关css结束 */
983 1017 \ No newline at end of file
  1018 +#oil_station-modal input.readonly{
  1019 + background: #dddddd;
  1020 +}
  1021 +
  1022 +
  1023 +.ct_tags{
  1024 + margin-bottom: 12px;
  1025 +}
  1026 +
  1027 +.ct_tags>span{
  1028 + padding: 3px 7px;
  1029 + background: #e8e8e8;
  1030 + color: #3a3939;
  1031 + cursor: pointer;
  1032 + margin-right: 5px;
  1033 +}
  1034 +
  1035 +.ct_tags>span.active{
  1036 + background: #62a9e1;
  1037 + color: white;
  1038 + box-shadow: 0 0 4px rgba(0, 0, 0, 0.35);
  1039 +}
  1040 +
  1041 +.ct_tags>span.active:before{
  1042 + content: "\f00c";
  1043 + font-family: FontAwesome;
  1044 + margin-right: 2px;
  1045 + font-size: 13px;
  1046 +}
  1047 +
  1048 +.ct_tags>span:hover{
  1049 + box-shadow: 0 0 4px rgba(0,0,0,.3);
  1050 +}
  1051 +
  1052 +span.late-badge {
  1053 + height: 20px;
  1054 + line-height: 20px;
  1055 + margin-top: 8px;
  1056 + color: grey;
  1057 + margin-left: 2px;
  1058 +}
  1059 +
  1060 +dl.intimity span.late-badge{
  1061 + color: #fbfbfb;
  1062 +}
984 1063 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/css/north.css
... ... @@ -18,7 +18,7 @@
18 18 }
19 19  
20 20 .north.scok-colse:before {
21   - content: "长连接被断开,你将无法收到服务器推送的发车、到站信息。请刷新页面以重建连接!";
  21 + content: "长连接被断开,你将无法收到服务器推送的发车、到站信息。尝试重连.....";
22 22 position: absolute;
23 23 padding: 5px 10px 5px 14px;
24 24 background: #414141;
... ... @@ -31,6 +31,10 @@
31 31 font-size: 13px;
32 32 }
33 33  
  34 +.north.scok-colse.re_conn_error:before{
  35 + content: '多次重连都无法和服务器建立连接,我已经放弃重连。你可以稍后刷新页面自行尝试!';
  36 +}
  37 +
34 38 .north .north-logo {
35 39 font-family: "Open Sans", sans-serif;
36 40 color: #fff;
... ... @@ -39,7 +43,7 @@
39 43 }
40 44  
41 45 .north-toolbar {
42   - width: 645px;
  46 + width: auto;
43 47 position: absolute;
44 48 right: 10px;
45 49 }
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/jhlb.html
... ... @@ -78,7 +78,7 @@
78 78 <div class="uk-form-row">
79 79 <label class="uk-form-label" >调整说明</label>
80 80 <div class="uk-form-controls">
81   - <select name="adjustExps">
  81 + <select name="adjustExps" required>
82 82 <option value="">请选择..</option>
83 83 {{each adjustExps as exp i}}
84 84 <option value="{{exp}}">{{exp}}</option>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
... ... @@ -57,7 +57,7 @@
57 57 <a id="addChildTaskBtn" data-uk-tooltip title="添加子任务"><i
58 58 class="uk-icon-plus"></i> </a>
59 59 </h3>
60   - <div class="ct_table_wrap ct_table_no_border" style="height: 142px;">
  60 + <div class="ct_table_wrap ct_table_no_border sub_task_table_wrap" style="height: 142px;">
61 61 <div class="ct_table sub-task-table">
62 62 <div class="ct_table_head">
63 63 <dl>
... ... @@ -159,8 +159,11 @@
159 159  
160 160 $(modal).on('init', function (e, data) {
161 161 e.stopPropagation();
162   - sch = data.sch;
  162 + //初始化滚动条
  163 + $('.main-schedule-wrap', modal).perfectScrollbar({suppressScrollX: true});
  164 + $('.sub_task_table_wrap', modal).perfectScrollbar({suppressScrollX: true});
163 165  
  166 + sch = data.sch;
164 167 f = $('.search-form', modal);
165 168 //线路下拉框
166 169 var opts = '';
... ... @@ -192,6 +195,8 @@
192 195 list: list
193 196 });
194 197 $(m_t_body, modal).html(htmlBody);
  198 + //更新主任务滚动条高度
  199 + $('.main-schedule-wrap', modal).perfectScrollbar('update');
195 200 $(s_t_body, modal).empty();
196 201 });
197 202 //班次点击
... ... @@ -252,6 +257,8 @@
252 257 sch.cTasks.sort(sub_task_sort);
253 258 htmlStr = template('sub_task-table-temp', {list: sch.cTasks});
254 259 tbody.html(htmlStr);
  260 + //更新子任务滚动条高度
  261 + $('.sub_task_table_wrap', modal).perfectScrollbar('update');
255 262 //字典转换
256 263 dictionaryUtils.transformDom($('.nt-dictionary', tbody));
257 264  
... ... @@ -421,7 +428,7 @@
421 428 name: "添加子任务",
422 429 items: {
423 430 'add_oil':{
424   - name: '加油'
  431 + name: '空驶进出场'
425 432 },
426 433 'add_sub_task_in': {
427 434 name: '进场'
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_inpark.html
... ... @@ -319,6 +319,9 @@
319 319 f();
320 320 }
321 321 else{
  322 + //营运子任务不写备注
  323 + if(data.mileageType == 'service' && !data.destroy)
  324 + data.remarks = '';
322 325 gb_common.$post('/childTask', data, function (rs) {
323 326 notify_succ('子任务添加成功');
324 327 gb_schedule_table.updateSchedule(rs.t);
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_oil.html
1 1 <div class="uk-modal ct-form-modal ct_move_modal" id="schedule-addsch_oil-modal">
2   - <div class="uk-modal-dialog" style="width: 1201px;">
  2 + <div class="uk-modal-dialog" style="width: 1101px;">
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 4 <div class="uk-modal-header">
5   - <h2>加油</h2></div>
  5 + <h2>空驶进出场</h2></div>
6 6  
7 7 <div class="uk-grid">
8 8 <div class="uk-width-1-3">
9   - <form class="uk-form uk-form-horizontal ">
  9 + <form class="uk-form uk-form-horizontal c_task_form">
10 10 <input type="hidden" name="type1" value="正常">
11 11 <input type="hidden" name="type2" value="1">
12 12 <input type="hidden" name="mileageType" value="service">
... ... @@ -53,7 +53,7 @@
53 53 </div>
54 54  
55 55 <div class="uk-width-1-3">
56   - <form class="uk-form uk-form-horizontal">
  56 + <form class="uk-form uk-form-horizontal c_task_form">
57 57 <input type="hidden" name="type1" value="临加">
58 58 <input type="hidden" name="type2" value="2">
59 59 <input type="hidden" name="mileageType" value="empty">
... ... @@ -102,7 +102,7 @@
102 102 </div>
103 103  
104 104 <div class="uk-width-1-3">
105   - <form class="uk-form uk-form-horizontal">
  105 + <form class="uk-form uk-form-horizontal c_task_form">
106 106 <input type="hidden" name="type1" value="临加">
107 107 <input type="hidden" name="type2" value="3">
108 108 <input type="hidden" name="mileageType" value="empty">
... ... @@ -149,6 +149,20 @@
149 149 </div>
150 150 </form>
151 151 </div>
  152 +
  153 + <div class="uk-width-1-1" style="margin-top: 20px;">
  154 + <hr style="border-top: 1px dashed #ddd;">
  155 + </div>
  156 + <div class="uk-width-2-3 uk-push-1-3" style="margin-top: 10px;">
  157 +
  158 + <div class="ct_tags inout_reason_tags">
  159 + <span>加油</span>
  160 + <span>维修</span>
  161 + </div>
  162 + <form class="uk-form">
  163 + <textarea placeholder="备注,必填" style="width: 100%;height: 70px;" id="globalRemarks"></textarea>
  164 + </form>
  165 + </div>
152 166 </div>
153 167 <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;">
154 168 <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span>
... ... @@ -211,13 +225,15 @@
211 225 oilStation = rs;
212 226 if(oilStation){
213 227 htmlStr = '<a><i class="uk-icon-product-hunt"></i> '+oilStation.stationName+'</a>';
  228 + if(oilStation.stationCode)
  229 + oilId = oilStation.stationCode;
214 230  
215 231 var opt = '<option value="'+oilId+'" class="oil_station_opt">'+oilStation.stationName+'</option>';
216 232 $('[name=endStation]', jcForm).prepend(opt).val(oilId).change();
217 233 $('[name=startStation]', ccForm).prepend(opt).val(oilId).change();
218 234 }
219 235 else
220   - htmlStr = '<a>为'+sch.xlName+'绑定一个社会加油站</a>';
  236 + htmlStr = '<a>为'+sch.xlName+'绑定一个停车场</a>';
221 237  
222 238 $('.bind_gas_station_panel', modal).html(htmlStr);
223 239 $('.bind_gas_station_panel a', modal).on('click', function () {
... ... @@ -229,7 +245,7 @@
229 245 });
230 246  
231 247 var dataArray = [];
232   - var fs = $('form', modal).formValidation({
  248 + var fs = $('form.c_task_form', modal).formValidation({
233 249 framework: 'uikit',
234 250 locale: 'zh_CN'
235 251 });
... ... @@ -238,7 +254,7 @@
238 254 if($(this).is(':hidden'))
239 255 return;
240 256 dataArray.push($.extend($(this).serializeJSON(), getDisabledVal(this)
241   - , {remarks: '加油', 'schedule.id': sch.id}));
  257 + , {remarks: $('#globalRemarks', modal).val(), 'schedule.id': sch.id}));
242 258 $(this).data('valid', true);
243 259  
244 260 if(allValidSuccess()){
... ... @@ -257,6 +273,9 @@
257 273 f();
258 274 }
259 275 else{
  276 + //营运子任务不写备注
  277 + if(data.mileageType == 'service' && !data.destroy)
  278 + data.remarks = '';
260 279 gb_common.$post('/childTask', data, function (rs) {
261 280 notify_succ('子任务添加成功');
262 281 gb_schedule_table.updateSchedule(rs.t);
... ... @@ -275,6 +294,13 @@
275 294  
276 295 //submit
277 296 $('#submitChildTaskBtn', modal).on('click', function () {
  297 + //备注
  298 + var rems = $('#globalRemarks', modal).val();
  299 + if($.trim(rems) == ''){
  300 + notify_err('你必须填写备注!');
  301 + return;
  302 + }
  303 +
278 304 //空驶的进场终点名称
279 305 if(!oilStation || $('[name=endStation]', jcForm).val() != oilId)
280 306 $('[name=endStationName]', jcForm).val('');
... ... @@ -309,7 +335,7 @@
309 335  
310 336 function allValidSuccess() {
311 337 var flag = true;
312   - $('form:visible', modal).each(function (i, f) {
  338 + $('form.c_task_form:visible', modal).each(function (i, f) {
313 339 if(!$(f).data('valid')){
314 340 flag = false;
315 341 return false;
... ... @@ -410,6 +436,20 @@
410 436 var ets = moment(st, 'HH:mm').add(data.time, 'minute').format('HH:mm');
411 437 $('[name=endDate]', ccForm).val(ets);
412 438 }
  439 +
  440 + //tags 点击
  441 + $('.inout_reason_tags>span', modal).on('click', function () {
  442 + if($(this).hasClass('active')){
  443 + $(this).removeClass('active');
  444 + return;
  445 + }
  446 +
  447 + var e = $('#globalRemarks', modal);
  448 + e.val(e.val() + $(this).text() + ',');
  449 +
  450 + $('.inout_reason_tags>span.active', modal).removeClass('active');
  451 + $(this).addClass('active');
  452 + });
413 453 })();
414 454 </script>
415 455 </div>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/oil_station.html
... ... @@ -2,7 +2,7 @@
2 2 <div class="uk-modal-dialog" style="width: 450px;">
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 4 <div class="uk-modal-header">
5   - <h2>社会加油站</h2></div>
  5 + <h2>绑定停车场(里程/历时)</h2></div>
6 6  
7 7 <form class="uk-form uk-form-horizontal " style="margin-bottom: 0 !important;">
8 8 <div class="uk-form-row">
... ... @@ -13,9 +13,18 @@
13 13 </div>
14 14 </div>
15 15 <div class="uk-form-row">
16   - <label class="uk-form-label">加油站名称</label>
  16 + <label class="uk-form-label">停车场名称</label>
17 17 <div class="uk-form-icon">
18   - <input type="text" name="stationName" value="社会加油站" required>
  18 + <input type="text" name="stationName" required style="width: calc(100% - 99px);margin-right: 5px;">
  19 + <span class="input_clear_icon"></span>
  20 + <div class="uk-button-dropdown" data-uk-dropdown>
  21 + <a>选择停车场 <i class="uk-icon-angle-down"></i></a>
  22 + <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;">
  23 + <ul class="uk-nav uk-nav-dropdown parks_list">
  24 + </ul>
  25 + </div>
  26 + </div>
  27 +
19 28 </div>
20 29 </div>
21 30 <div class="uk-form-row">
... ... @@ -83,14 +92,19 @@
83 92 </form>
84 93 </div>
85 94  
86   - <script id="" type="text/html">
87   -
  95 + <script id="park_list_dropdown-temp" type="text/html">
  96 + {{each list as p i}}
  97 + <li data-code="{{p.code}}" data-name="{{p.name}}"><a>{{p.name}}</a></li>
  98 + {{if i == 0}}
  99 + <li class="uk-nav-divider"></li>
  100 + {{/if}}
  101 + {{/each}}
88 102 </script>
89 103  
90 104 <script>
91 105 (function () {
92 106 var modal = '#oil_station-modal',
93   - sch, oilStation;
  107 + sch, oilStation, information;
94 108  
95 109 var cognates = {
96 110 'upInMile': 'upOutMile',
... ... @@ -111,10 +125,12 @@
111 125 $('form [name=lineCode]', modal).val(sch.xlBm);
112 126  
113 127 //submit
114   - var f = $('form', modal).formValidation(gb_form_validation_opts);
  128 + var f = $('form', modal).formValidation({framework: 'uikit', locale: 'zh_CN'});
115 129 f.on('success.form.fv', function(e) {
116 130 e.preventDefault();
117 131 var data = $(this).serializeJSON();
  132 + if(parkCode)
  133 + data.stationCode = parkCode;
118 134  
119 135 gb_common.$post('/oilStation', data, function (rs) {
120 136 notify_succ('添加成功!');
... ... @@ -126,8 +142,27 @@
126 142 $('form input', modal).on('input', function () {
127 143 var name = $(this).attr('name');
128 144 if(cognates[name]){
129   - $('form [name='+cognates[name]+']', modal).val($(this).val());
  145 + $('form [name='+cognates[name]+']', modal).val($(this).val()).trigger('input');
  146 + }
  147 + });
  148 +
  149 + //线路标准
  150 + information = gb_data_basic.getLineInformation(sch.xlBm);
  151 + //查询停车场
  152 + $.get('/basic/parks', function (rs) {
  153 + var parks = [], index;
  154 + for(var code in rs){
  155 + parks.push({code: code, name: rs[code]});
  156 + if(code == information.carPark)
  157 + index = parks.length - 1;
130 158 }
  159 +
  160 + //将线路标准停车场排在第一个
  161 + parks[index] = parks.splice(0, 1 , parks[index])[0];
  162 + var htmlStr = template('park_list_dropdown-temp', {list: parks});
  163 + $('.parks_list', modal).html(htmlStr);
  164 + //选择停车场
  165 + $('.parks_list>li', modal).on('click', selectPark);
131 166 });
132 167 });
133 168  
... ... @@ -136,10 +171,63 @@
136 171 return;
137 172 $('form input', modal).each(function () {
138 173 var name = $(this).attr('name');
139   - if(obj[name])
  174 + if(obj[name] != null)
140 175 $(this).val(obj[name]);
141 176 });
142 177 }
  178 +
  179 + var parkCode;
  180 + function selectPark() {
  181 + var code = $(this).data('code');
  182 + var name = $(this).data('name');
  183 +
  184 + //选择的是线路标准停车场
  185 + if(code == information.carPark){
  186 + //起点进场里程
  187 + $('[name=upInMile]', modal).val(information.upInMileage).trigger('input');
  188 + //起点进场时间
  189 + $('[name=upInTime]', modal).val(information.upInTimer).trigger('input');
  190 + //终点进场里程
  191 + $('[name=downInMile]', modal).val(information.downOutMileage).trigger('input');
  192 + //终点进场时间
  193 + $('[name=downInTime]', modal).val(information.downInTimer).trigger('input');
  194 +
  195 + //起点出场里程
  196 + $('[name=upOutMile]', modal).val(information.upOutMileage).trigger('input');
  197 + //起点出场时间
  198 + $('[name=upOutTime]', modal).val(information.upOutTimer).trigger('input');
  199 + //终点出场里程
  200 + $('[name=downOutMile]', modal).val(information.downOutMileage).trigger('input');
  201 + //终点出场时间
  202 + $('[name=downOutTime]', modal).val(information.downOutTimer).trigger('input');
  203 + }
  204 + else
  205 + clearInputs();
  206 +
  207 + $('[name=stationName]', modal).val(name).addClass('readonly').attr('readonly', 'readonly');
  208 + $('.input_clear_icon', modal).show();
  209 + //记录停车场编码
  210 + parkCode = code;
  211 + }
  212 +
  213 + $('.input_clear_icon', modal).on('click', function () {
  214 + $(this).hide();
  215 + parkCode = null;
  216 + $('[name=stationName]', modal).val('').removeClass('readonly').removeAttr('readonly');
  217 +
  218 + clearInputs();
  219 + });
  220 +
  221 + function clearInputs() {
  222 + $('[name=upInMile]', modal).val('').trigger('input');
  223 + $('[name=upInTime]', modal).val('').trigger('input');
  224 + $('[name=downInMile]', modal).val('').trigger('input');
  225 + $('[name=downInTime]', modal).val('').trigger('input');
  226 + $('[name=upOutMile]', modal).val('').trigger('input');
  227 + $('[name=upOutTime]', modal).val('').trigger('input');
  228 + $('[name=downOutMile]', modal).val('').trigger('input');
  229 + $('[name=downOutTime]', modal).val('').trigger('input');
  230 + }
143 231 })();
144 232 </script>
145 233 </div>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
... ... @@ -122,6 +122,8 @@
122 122 e.stopPropagation();
123 123 sch = data.sch;
124 124  
  125 + //滚动条
  126 + $('.tzrc-table-wrap', modal).perfectScrollbar();
125 127 //线路下拉框
126 128 var opts = '';
127 129 $.each(gb_data_basic.activeLines, function () {
... ... @@ -146,6 +148,8 @@
146 148 list: list
147 149 });
148 150 $('.sch-tzrc-table .ct_table_body', modal).html(htmlBody);
  151 + //更新滚动条高度
  152 + $('.tzrc-table-wrap', modal).perfectScrollbar('update');
149 153 });
150 154  
151 155 $(modal).on('click', '.sch-tzrc-table .ct_table_body dl input[type=checkbox]', function () {
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
... ... @@ -84,6 +84,9 @@
84 84 </dd>
85 85 <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}">
86 86 {{sch.dfsj}}
  87 + {{if sch.late2}}
  88 + <span class="late-badge">?+{{sch.lateMinute}}</span>
  89 + {{/if}}
87 90 </dd>
88 91 <dd data-uk-observe class="
89 92 {{if sch.status==-1}}
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/curr_date_schedule.html
... ... @@ -83,7 +83,10 @@
83 83 }
84 84  
85 85 #curr-date-schedule-modal .line_list_ul li.active{
86   - background: #93d1ff;
  86 + background: #009dd8;
  87 + color: #fff;
  88 + box-shadow: inset 0 2px 4px rgba(0,0,0,.2);
  89 + text-shadow: 0 -1px 0 rgba(0,0,0,.2);
87 90 }
88 91 </style>
89 92  
... ... @@ -98,7 +101,7 @@
98 101 </ul>
99 102 </div>
100 103 <div class="uk-width-medium-9-10">
101   - <div class="ct_table_wrap" style="height: 460px;">
  104 + <div class="ct_table_wrap" style="height: 520px;">
102 105 <div class="ct_table curr-schedule-table">
103 106 <div class="ct_table_head">
104 107 <dl>
... ... @@ -192,6 +195,10 @@
192 195  
193 196 //默认点击第一个
194 197 $('.line_list_ul li:eq(0)', modal).trigger('click');
  198 + //滚动条
  199 + $('.ct_table_wrap', modal).perfectScrollbar();
  200 + //固定头部
  201 + gb_ct_table.fixedHead($('.ct_table_wrap', modal));
195 202 });
196 203  
197 204 $(modal).on('click', '.line_list_ul li', function () {
... ... @@ -203,7 +210,6 @@
203 210 var query = function (lineCode) {
204 211 $.get('/realSchedule/currSchedulePlanByLineCode', {lineCode: lineCode}, function (rs) {
205 212  
206   -
207 213 var data=[];
208 214 //先按路牌分组
209 215 var lpMapData = gb_common.groupBy(rs, 'lpName');
... ... @@ -214,6 +220,9 @@
214 220  
215 221 var htmlStr = template('curr_schedule_list-temp', {list: data});
216 222 $('.ct_table_body', modal).html(htmlStr);
  223 +
  224 + //更新滚动条
  225 + $('.ct_table_wrap', modal).perfectScrollbar('update');
217 226 });
218 227 };
219 228  
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/dataManager/cars_move.html 0 → 100644
  1 +<div class="uk-modal ct_move_modal" id="data_manager_car_move-modal">
  2 + <div class="uk-modal-dialog" style="width: 1100px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>车辆设备数据迁移</h2></div>
  6 +
  7 + <div class="uk-alert uk-alert-warning">
  8 + 1、新老系统的车辆清单均基于线路配车,你必须保证新老系统的线路配车是一致的。<br>
  9 + 2、只更新车辆当前的设备号,不同步历史的设备变迁记录。
  10 + </div>
  11 + <div class="uk-grid">
  12 + <div class="uk-width-1-5">
  13 + <ul class="uk-nav uk-nav-side line_list" >
  14 + </ul>
  15 + </div>
  16 + <div class="uk-width-4-5 uk-grid table-wrap" id="carDataTables" style="height: 450px;overflow: auto;position: relative;">
  17 + <div class="uk-width-1-2">
  18 + <div>
  19 + <table class="uk-table uk-table-hover nowTable">
  20 + <caption style="color: #2795ed;" >新系统数据</caption>
  21 + <thead>
  22 + <tr>
  23 + <th>车辆自编号</th>
  24 + <th>设备编号</th>
  25 + </tr>
  26 + </thead>
  27 + <tbody>
  28 + </tbody>
  29 + </table>
  30 + </div>
  31 + </div>
  32 + <div class="uk-width-1-2">
  33 + <div>
  34 + <table class="uk-table uk-table-hover oldTable">
  35 + <caption >老系统数据</caption>
  36 + <thead>
  37 + <tr>
  38 + <th>车辆自编号</th>
  39 + <th>设备编号</th>
  40 + </tr>
  41 + </thead>
  42 + <tbody>
  43 + </tbody>
  44 + </table>
  45 + </div>
  46 + </div>
  47 + </div>
  48 + </div>
  49 +
  50 + <div class="uk-modal-footer uk-text-right">
  51 + <em style="margin-right: 15px;">设备号不同的车辆数:<span id="diffCount"></span></em>
  52 + <button type="button" class="uk-button uk-modal-close">取消</button>
  53 + <button type="button" class="uk-button uk-button-primary" id="synchroDevicesBtn">更新设备号有差异的数据</button>
  54 + </div>
  55 + </div>
  56 +
  57 + <script id="data_manager_car_move-table-temp" type="text/html">
  58 + {{each list as car i}}
  59 + <tr data-nbbm="{{car.nbbm}}" data-device="{{car.device}}" {{if car.flag=='now_non-existent'}}style="color:red;"{{/if}}>
  60 + <td>{{car.nbbm}}</td>
  61 + <td {{if car.flag=='device_unequal'}}style="color:red;"{{/if}}>{{car.device}}</td>
  62 + </tr>
  63 + {{/each}}
  64 + </script>
  65 +
  66 + <script>
  67 + (function() {
  68 + var modal = '#data_manager_car_move-modal',
  69 + $ul = $('.line_list', modal),
  70 + nowArray, oldArray;
  71 +
  72 + $(modal).on('init', function(e, data) {
  73 + e.stopPropagation();
  74 +
  75 + //左侧线路list
  76 + var lis = '';
  77 + $.each(gb_data_basic.activeLines, function () {
  78 + lis += '<li data-id="'+this.id+'"><a>'+this.name+'</a></li>';
  79 + });
  80 + $ul.html(lis);
  81 +
  82 + //线路点击事件
  83 + $('li', $ul).on('click', function () {
  84 + if(loading)
  85 + return;
  86 + $('li.uk-active', $ul).removeClass('uk-active');
  87 + $(this).addClass('uk-active');
  88 + //加载车辆数据
  89 + queryCarInfo($(this).data('id'));
  90 + });
  91 +
  92 + //初始化滚动条
  93 + $('.table-wrap', modal).perfectScrollbar({suppressScrollX: true});
  94 +
  95 + //默认点击第一条线路
  96 + $('li:eq(0)', $ul).trigger('click');
  97 + });
  98 +
  99 + /**
  100 + * 加载车辆数据
  101 + * @param lineCode
  102 + */
  103 + var loading, deviceUnequalCount;
  104 + function queryCarInfo(lineId) {
  105 + loading = true;
  106 + deviceUnequalCount = 0;
  107 + gb_common.$get('/dataManager/cars/old_now', {lineId: lineId}, function (rs) {
  108 + console.log('数据迁移 -车辆数据', rs);
  109 + nowArray = rs.nows;
  110 + oldArray = rs.olds;
  111 + $.each(rs.olds, function () {
  112 + var car = searchDevices(rs.nows, this.nbbm);
  113 + if(!car)
  114 + this.flag = 'now_non-existent';//在新系统不存在的车辆
  115 + else if(car.device != this.device){
  116 + car.flag = 'device_unequal';
  117 + deviceUnequalCount ++;
  118 + }
  119 + });
  120 +
  121 + //按新系统数据车辆自编号排序
  122 + rs.nows.sort(function (a, b) {
  123 + return a.nbbm.localeCompare(b.nbbm);
  124 + });
  125 +
  126 + //老系统数据对应新系统顺序,多的放后面
  127 + var ks = {};
  128 + $.each(rs.nows, function (i) {
  129 + ks[this.nbbm] = i;
  130 + });
  131 + rs.olds.sort(function (a, b) {
  132 + return ks[a.nbbm] - ks[b.nbbm];
  133 + });
  134 +
  135 + //渲染新系统表格
  136 + var htmlStr = template('data_manager_car_move-table-temp', {list: rs.nows});
  137 + $('.nowTable tbody', modal).html(htmlStr);
  138 +
  139 + //渲染老系统表格
  140 + var htmlStr = template('data_manager_car_move-table-temp', {list: rs.olds});
  141 + $('.oldTable tbody', modal).html(htmlStr);
  142 +
  143 + //更新滚动条高度
  144 + $('.table-wrap', modal).perfectScrollbar('update');
  145 + $('#diffCount', modal).text(deviceUnequalCount);
  146 + if(deviceUnequalCount==0)
  147 + $('#synchroDevicesBtn', modal).attr('disabled', 'disabled');
  148 + else
  149 + $('#synchroDevicesBtn', modal).removeAttr('disabled');
  150 + loading = false;
  151 + });
  152 + }
  153 +
  154 + function searchDevices(array, nbbm) {
  155 + for(var i =0,item; item=array[i++];){
  156 + if(item.nbbm == nbbm)
  157 + return item;
  158 + }
  159 + }
  160 +
  161 + /**
  162 + * 同步数据
  163 + */
  164 + $('#synchroDevicesBtn', modal).on('click', function () {
  165 + $(this).attr('disabled', 'disabled');
  166 + var data = [];
  167 + $.each(oldArray, function () {
  168 + var car = searchDevices(nowArray, this.nbbm);
  169 + if(car.device != this.device){
  170 + data.push({
  171 + nbbm: this.nbbm,
  172 + device: this.device
  173 + });
  174 + }
  175 + });
  176 +
  177 + gb_common.$post('/dataManager/car/updateDevices', {jsonStr: JSON.stringify(data)}, function (rs) {
  178 + notify_succ('成功更新' + rs.count + '辆车的设备号!');
  179 + //$(this).removeAttr('disabled');
  180 + //刷新表格
  181 + queryCarInfo($('li.uk-active', $ul).data('id'));
  182 + });
  183 + });
  184 + })();
  185 + </script>
  186 +</div>
0 187 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/dataManager/dataMoveAndVerification.html 0 → 100644
  1 +<div class="uk-modal" id="data-move-verification-modal">
  2 + <div class="uk-modal-dialog" style="width: 650px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <h2>数据迁移和校验</h2>
  5 +
  6 + <div class="uk-grid" data-uk-grid-margin>
  7 + <div class="uk-width-medium-1-3">
  8 + <a class="uk-panel uk-panel-hover detail_panel" data-href="/real_control_v2/fragments/north/nav/dataManager/cars_move.html">
  9 + <h3 class="uk-panel-title">车辆数据</h3>
  10 + 对照老系统的车辆设备信息,并增量更新到新系统
  11 + </a>
  12 + </div>
  13 + <div class="uk-width-medium-1-3">
  14 + <a class="uk-panel uk-panel-hover" >
  15 + <h3 class="uk-panel-title">人员数据</h3>
  16 + 对照老系统的人员信息,并增量更新到新系统 <code>不可用</code>
  17 + </a>
  18 + </div>
  19 + <div class="uk-width-medium-1-3">
  20 + <a class="uk-panel uk-panel-hover">
  21 + <h3 class="uk-panel-title">路单数据</h3>
  22 + 将老系统指定日期的路单同步到新系统,全量覆盖 <code>不可用</code>
  23 + </a>
  24 + </div>
  25 + </div>
  26 +
  27 + </div>
  28 +
  29 +
  30 + <script>
  31 + (function () {
  32 + var modal = '#data-move-verification-modal';
  33 + $(modal).on('init', function (e, data) {
  34 + e.stopPropagation();
  35 +
  36 + $('.detail_panel', modal).on('click', function () {
  37 + var href = $(this).data('href');
  38 + if(!href)
  39 + return;
  40 +
  41 + open_modal(href, {}, {center: false, bgclose: false, modal: false});
  42 + });
  43 + });
  44 + })();
  45 + </script>
  46 +</div>
0 47 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config.html
1 1 <div id="nav-line_config-modal" class="uk-modal">
2   - <div class="uk-modal-dialog uk-modal-dialog-blank">
  2 + <div class="uk-modal-dialog uk-modal-dialog-blank" style="overflow: hidden;">
3 3 <button class="uk-modal-close uk-close" type="button"></button>
4 4 <div class="uk-grid uk-flex-middle" data-uk-grid-margin>
5 5 <div class="uk-width-medium-1-6 uk-height-viewport line-config-tree" data-uk-observe>
... ... @@ -37,6 +37,8 @@
37 37 var modal = '#nav-line_config-modal',
38 38 lineConfig, activeCode;
39 39  
  40 + //初始化滚动条
  41 + $('.right-container', modal).perfectScrollbar({suppressScrollX: true});
40 42 /**
41 43 * 手风琴拨动
42 44 */
... ... @@ -79,6 +81,11 @@
79 81  
80 82 loadConfigEntity();
81 83 loadBufferConfig();
  84 +
  85 + setTimeout(function () {
  86 + //更新滚动条高度
  87 + $('.right-container', modal).perfectScrollbar('update');
  88 + }, 500);
82 89 });
83 90 };
84 91  
... ...
src/main/resources/static/real_control_v2/fragments/north/tabs.html
... ... @@ -4,7 +4,7 @@
4 4 <li class="uk-active" ><a>主页</a></li>
5 5 <li id="north_tabs_map_btn"><a>地图</a></li>
6 6 {{each list as line i}}
7   - <li class="tab-line"><a>{{line.name}}(<span id="badge_untreated_num_{{line.lineCode}}">0</span>, <span id="badge_yfwf_num_{{line.lineCode}}">0</span>)</a></li>
  7 + <li class="tab-line" data-code="{{line.lineCode}}"><a>{{line.name}}(<span id="badge_untreated_num_{{line.lineCode}}">0</span>, <span id="badge_yfwf_num_{{line.lineCode}}">0</span>)</a></li>
8 8 {{/each}}
9 9 </ul>
10 10 </script>
... ...
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
... ... @@ -26,6 +26,15 @@
26 26 "id": 1.4,
27 27 "text": "历史班次维护",
28 28 "event": "history_sch_maintain"
  29 + },
  30 + {
  31 + "id": 1.5,
  32 + "divider": true
  33 + },
  34 + {
  35 + "id": 1.6,
  36 + "text": "数据迁移和校验工具",
  37 + "event": "data_move_and_verification"
29 38 }
30 39 ],
31 40 [
... ...
src/main/resources/static/real_control_v2/js/forms/wrap.html
... ... @@ -16,7 +16,6 @@
16 16 <link href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css"
17 17 rel="stylesheet" type="text/css"/>
18 18  
19   -
20 19 <!-- jQuery -->
21 20 <script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
22 21 <script src="/assets/plugins/pinyin.js"></script>
... ...
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
... ... @@ -183,6 +183,46 @@ var gb_schedule_context_menu = (function () {
183 183 open_modal(folder + '/sub_task/add_sub_task_oil.html', {
184 184 sch: sch
185 185 }, modal_opts);
  186 + },
  187 + wdtz: function (sch) {
  188 + this.multi_wdtz(sch);
  189 + },
  190 + multi_wdtz: function (schArray) {
  191 + if (!isArray(schArray))
  192 + schArray = [schArray];
  193 +
  194 + var idx='', minute=0;
  195 + $.each(schArray, function () {
  196 + if(this.fcsjActual && this.status != 0){
  197 + return true;
  198 + }
  199 + else
  200 + idx += (this.id + ',');
  201 + minute = this.lateMinute;
  202 + });
  203 +
  204 + if(!idx || idx==''){
  205 + notify_err('没有需要调整的班次!');
  206 + return;
  207 + }
  208 +
  209 + var elem = UIkit.modal.prompt('请输入误点停靠时间(分钟)', minute, function (newValue) {
  210 + if (!isNaN(newValue) && newValue >= 0) {
  211 + gb_common.$post_arr('/realSchedule/lateAdjust', {idx: idx, minute: newValue}, function (rs) {
  212 + console.log('误点调整rs', rs);
  213 + if(rs.ts){
  214 + gb_schedule_table.updateSchedule(rs.ts);
  215 + notify_succ('成功为' + rs.count + '个班次设置误点停靠时间');
  216 + }
  217 + });
  218 + } else
  219 + notify_err('不合理的停靠时间!');
  220 + }, {
  221 + labels: {
  222 + Ok: '确定调整',
  223 + Cancel: '取消'
  224 + }
  225 + });
186 226 }
187 227 };
188 228  
... ... @@ -228,7 +268,7 @@ var gb_schedule_context_menu = (function () {
228 268 name: '...',
229 269 items: {
230 270 'add_oil': {
231   - name: '(子任务)加油'
  271 + name: '(子任务)空驶进出场'
232 272 },
233 273 'add_sub_task_in': {
234 274 name: '(子任务)进场'
... ... @@ -248,6 +288,9 @@ var gb_schedule_context_menu = (function () {
248 288 'zlcf': {
249 289 name: '指令重发'
250 290 },
  291 + 'wdtz': {
  292 + name: '误点调整'
  293 + },
251 294 'sep3': '---------',
252 295 'lp_change': {
253 296 name: '路牌对调'
... ... @@ -280,6 +323,9 @@ var gb_schedule_context_menu = (function () {
280 323 },
281 324 'multi_tzrc': {
282 325 name: '调整人车'
  326 + },
  327 + 'multi_wdtz': {
  328 + name: '误点调整'
283 329 }
284 330 }
285 331 });
... ...
src/main/resources/static/real_control_v2/js/line_schedule/dbclick.js
... ... @@ -8,7 +8,10 @@ var gb_schedule_table_dbclick = (function() {
8 8 id = $(input).parents('dl').data('id');
9 9  
10 10 if (val == '' || $dd.attr('dbclick-val') == val) {
11   - $dd.html($dd.attr('dbclick-val'));
  11 + var lineCode = $(input).parents('li.line_schedule').data('id');
  12 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  13 + var dfHtmlStr = $dd.attr('dbclick-val') + (sch.late2?'<span class="late-badge">?+'+sch.lateMinute+'</span>':'');
  14 + $dd.html(dfHtmlStr);
12 15 return;
13 16 }
14 17 else {
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -82,7 +82,8 @@ var gb_schedule_table = (function () {
82 82 list: dirData[upDown]
83 83 });
84 84  
85   - $('.schedule-wrap .card-panel:eq(' + upDown + ')', this).html(htmlStr);
  85 + $('.schedule-wrap .card-panel:eq(' + upDown + ')', this)
  86 + .html(htmlStr);
86 87 }
87 88  
88 89 //标记车辆最后一个班次
... ... @@ -91,6 +92,8 @@ var gb_schedule_table = (function () {
91 92 gb_sch_legend.init(this);
92 93 });
93 94 var content = $('.line_schedule .ct_table_wrap');
  95 + //初始化滚动条
  96 + content.perfectScrollbar({suppressScrollX: true});
94 97 //fixed table head
95 98 gb_ct_table.fixedHead(content);
96 99 //enable sort
... ... @@ -213,7 +216,7 @@ var gb_schedule_table = (function () {
213 216 //计算应发未发
214 217 calc_yfwf_num(lineCode);
215 218 //重新固定表头
216   - gb_ct_table.fixedHead($('.line_schedule .ct_table_wrap', tabCont));
  219 + gb_ct_table.fixedHead($('.schedule-wrap .ct_table_wrap', tabCont));
217 220  
218 221 //重新初始化排序
219 222 gb_ct_table.enableSort($('.ct_table', tabCont), reset_seq_no, gb_schedule_table_dbclick.init);
... ... @@ -221,6 +224,8 @@ var gb_schedule_table = (function () {
221 224 gb_schedule_table_dbclick.init();
222 225 //重新初始化双击实发发车信息微调
223 226 gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell', tabCont));
  227 + //滚动条
  228 + $('.schedule-wrap .ct_table_wrap', tabCont).perfectScrollbar({suppressScrollX: true});
224 229 }
225 230 };
226 231  
... ... @@ -266,19 +271,22 @@ var gb_schedule_table = (function () {
266 271 }
267 272 };
268 273  
269   - //更新班次
  274 + /**
  275 + * 更新班次
  276 + * @param schArr
  277 + */
270 278 var updateSchedule = function (schArr) {
271 279  
272 280 if (!isArray(schArr))
273 281 schArr = [schArr];
274 282  
275   - var tMaps = {};
  283 + //var tMaps = {};
276 284 $.each(schArr, function () {
277 285 try {
278 286 line2Schedule[this.xlBm][this.id] = this;
279 287 updateDom(this);
280 288 //线路_车辆 过滤重复数据
281   - tMaps[this.xlBm + '_' + this.clZbh] = 1;
  289 + //tMaps[this.xlBm + '_' + this.clZbh] = 1;
282 290 }catch(e){}
283 291 });
284 292  
... ... @@ -290,6 +298,19 @@ var gb_schedule_table = (function () {
290 298 }*/
291 299 };
292 300  
  301 +
  302 + /**
  303 + * 更新班次 -只更新数据,不更新dom
  304 + * @param schArr
  305 + */
  306 + var updateData = function (schArr) {
  307 + if (!isArray(schArr))
  308 + schArr = [schArr];
  309 + $.each(schArr, function () {
  310 + line2Schedule[this.xlBm][this.id] = this;
  311 + });
  312 + };
  313 +
293 314 //update dom
294 315 var updateDom = function (sch) {
295 316 if (!sch) return;
... ... @@ -307,7 +328,9 @@ var gb_schedule_table = (function () {
307 328  
308 329 //计发时间
309 330 $(dds[5]).replaceWith(temps['line-schedule-fcsj-temp'](sch));
310   - $(dds[6]).attr('data-sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(sch.dfsj);
  331 + //待发时间
  332 + var dfHtmlStr = sch.dfsj + (sch.late2?'<span class="late-badge">?+'+sch.lateMinute+'</span>':'');
  333 + $(dds[6]).attr('data-sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(dfHtmlStr);
311 334  
312 335 //实发时间
313 336 calc_sch_real_shift(sch);
... ... @@ -556,10 +579,33 @@ var gb_schedule_table = (function () {
556 579 })();
557 580 };
558 581  
  582 + /**
  583 + * 显示误点停靠时间标记
  584 + * @param id
  585 + * @param minute
  586 + */
  587 + var showLateBadge = function (lineCode, id, minute) {
  588 + var dfCell = cancelLateBadge(lineCode, id);
  589 + $(dfCell).append('<span class="late-badge">?+5</span>');
  590 + };
  591 +
  592 + /**
  593 + * 取消误点标记
  594 + * @param lineCode
  595 + * @param id
  596 + */
  597 + var cancelLateBadge = function (lineCode, id) {
  598 + var $dl = getDl({id: id, xlBm: lineCode});
  599 + var dfCell = $dl.find('dd')[6];
  600 + $('.late-badge',dfCell).remove();
  601 + return dfCell;
  602 + };
  603 +
559 604 return {
560 605 show: show,
561 606 findScheduleByLine: findScheduleByLine,
562 607 updateSchedule: updateSchedule,
  608 + updateData: updateData,
563 609 deheteSchedule: deheteSchedule,
564 610 insertSchedule: insertSchedule,
565 611 schedule_sort: schedule_sort,
... ... @@ -572,6 +618,8 @@ var gb_schedule_table = (function () {
572 618 getDl: getDl,
573 619 getNextSch: getNextSch,
574 620 addRemarks: addRemarks,
575   - reLoadAndRefresh: reLoadAndRefresh
  621 + reLoadAndRefresh: reLoadAndRefresh,
  622 + showLateBadge: showLateBadge,
  623 + cancelLateBadge: cancelLateBadge
576 624 };
577 625 })();
... ...
src/main/resources/static/real_control_v2/js/main.js
... ... @@ -49,7 +49,7 @@ var gb_main_ep = new EventProxy(),
49 49 $('li.map-panel', '#main-tab-content').load('/real_control_v2/mapmonitor/real.html');
50 50 }, 1000);
51 51 //弹出更新说明
52   - //showUpdateDescription();
  52 + showUpdateDescription();
53 53 });
54 54  
55 55 function g_emit(id) {
... ... @@ -171,8 +171,8 @@ var disabled_submit_btn = function (form) {
171 171 function showUpdateDescription() {
172 172 //更新说明
173 173 var updateDescription = {
174   - date: '2017-01-07',
175   - text: '<h5>1、出场子任务开放使用。</h5><h5>2、班次直放调整后可再次修改班次类型。</h5><h5>3、双击实发,可打开发车信息微调,发车信息微调界面可以直接烂班。</h5><h5>4、主页模拟图可以省略、重命名站点。</h5>'
  174 + date: '2017-04-19',
  175 + text: '<h5>加油子任务改为空驶进出场子任务</h5><h5>计划烂班时调整说明必填</h5><h5>连接断开(横幅变红)后会自动尝试重连</h5><h5>误点调整功能加入,线上测试一天,20号再用</h5>'
176 176 };
177 177  
178 178 var storage = window.localStorage
... ...
src/main/resources/static/real_control_v2/js/north/tabs.js
... ... @@ -24,6 +24,15 @@ var gb_tabs = (function() {
24 24 }
25 25 });
26 26  
  27 + //班次选项卡第一次点击,更新滚动条高度
  28 + $('.north-tabs .uk-tab li.tab-line').one('click', function(e){
  29 + var code = $(this).data('code');
  30 + setTimeout(function () {
  31 + $('.main-container .line_schedule[data-id='+code+'] .schedule-wrap .ct_table_wrap')
  32 + .perfectScrollbar('update');
  33 + }, 200);
  34 + });
  35 +
27 36 cb && cb();
28 37 });
29 38 };
... ...
src/main/resources/static/real_control_v2/js/north/toolbar.js
... ... @@ -42,7 +42,7 @@ var gb_northToolbar = (function () {
42 42 //exit
43 43 $('.north .north-toolbar .exit-system').on('click', function () {
44 44 //关闭websocket 连接
45   - gb_sch_websocket.sock.close();
  45 + gb_sch_websocket.sock().close();
46 46 window.location.href = '/pages/control/lineallot/allot.html';
47 47 });
48 48 });
... ... @@ -191,6 +191,9 @@ var gb_northToolbar = (function () {
191 191 },
192 192 safe_driving: function () {
193 193 open_modal('/real_control_v2/fragments/north/nav/safeDriving.html', {}, modal_opts);
  194 + },
  195 + data_move_and_verification: function () {
  196 + open_modal('/real_control_v2/fragments/north/nav/dataManager/dataMoveAndVerification.html', {}, modal_opts);
194 197 }
195 198 };
196 199  
... ...
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
... ... @@ -5,22 +5,52 @@ var gb_sch_websocket = (function () {
5 5 temps = gb_common.compileTempByDom(dom);
6 6 });
7 7  
8   - var schSock = new SockJS('/sockjs/realcontrol');
  8 + var schSock = null;
  9 + var recInterval = null;
  10 + var reConnSpace = 1500;//重连间隔
  11 + var reConnCount; //重连次数
  12 + var maxReConn = 10; //最多重连次数
  13 + var new_conn = function () {
  14 + schSock = new SockJS('/sockjs/realcontrol');
  15 + schSock.onopen = function (e) {
  16 + reConnCount = 1;
  17 + clearInterval(recInterval);
  18 + console.log('webSocket[realcontrol] onopen');
  19 + $('body>.north').removeClass('scok-colse');
  20 + setTimeout(regListen, 500);
  21 + };
9 22  
10   - schSock.onopen = function (e) {
11   - console.log('webSocket[realcontrol] onopen');
12   - setTimeout(regListen, 500);
13   - };
14   - //接收消息
15   - schSock.onmessage = function (e) {
16   - try {
17   - var jsonMsg = $.parseJSON(e.data);
18   - msgHandle[jsonMsg.fn](jsonMsg);
19   - } catch (e) {
20   - console.log(e, e.data);
21   - }
  23 + //接收消息
  24 + schSock.onmessage = function (e) {
  25 + try {
  26 + var jsonMsg = $.parseJSON(e.data);
  27 + msgHandle[jsonMsg.fn](jsonMsg);
  28 + } catch (e) {
  29 + console.log(e, e.data);
  30 + }
  31 + };
  32 +
  33 + //断开
  34 + schSock.onclose = function (e) {
  35 + console.log('和服务器连接断开....', e);
  36 + $('body>.north').addClass('scok-colse');
  37 + //1.5秒后重新连接
  38 + recInterval = setTimeout(function () {
  39 + reConnCount++;
  40 + if(reConnCount > maxReConn){
  41 + $('body>.north').addClass('re_conn_error');
  42 + clearInterval(recInterval);
  43 + return;
  44 + }
  45 + new_conn();
  46 + }, reConnSpace * reConnCount);
  47 +
  48 + };
22 49 };
23 50  
  51 + //初始化websocket连接
  52 + new_conn();
  53 +
24 54 function regListen() {
25 55 //注册线路监听
26 56 var data = {
... ... @@ -31,14 +61,6 @@ var gb_sch_websocket = (function () {
31 61 console.log('regListen....', data);
32 62 }
33 63  
34   - //断开
35   - schSock.onclose = function (e) {
36   - //alert('和服务器连接断开, code:' + e.code);
37   - console.log('和服务器连接断开....', e);
38   - $('body>.north').addClass('scok-colse');
39   - };
40   -
41   -
42 64 /**
43 65 * 计算未处理消息
44 66 */
... ... @@ -73,6 +95,20 @@ var gb_sch_websocket = (function () {
73 95 var safeDriv = function (msg) {
74 96 gb_safe_driv.pop(msg.t);
75 97 };
  98 +
  99 + /**
  100 + * 自动误点调整
  101 + * @param msg
  102 + */
  103 + var autoWdtz = function (msg) {
  104 + var schId = msg.id;
  105 + var minute = msg.minute;
  106 + var lineCode = msg.lineCode;
  107 + gb_schedule_table.showLateBadge(lineCode, schId, minute);
  108 + if(msg['cancelId']){
  109 + gb_schedule_table.cancelLateBadge(lineCode, msg['cancelId']);
  110 + }
  111 + };
76 112  
77 113 var waitRemoves = [];
78 114 //车辆发出
... ... @@ -155,7 +191,8 @@ var gb_sch_websocket = (function () {
155 191 directive: directiveStatus,
156 192 signal_state: signalState,
157 193 deviceOffline: deviceOffline,
158   - safeDriv: safeDriv
  194 + safeDriv: safeDriv,
  195 + auto_wdtz: autoWdtz
159 196 };
160 197  
161 198 function currentSecond() {
... ... @@ -256,6 +293,8 @@ var gb_sch_websocket = (function () {
256 293 }
257 294  
258 295 return {
259   - sock: schSock
  296 + sock: function () {
  297 + return schSock;
  298 + }
260 299 };
261 300 })();
... ...
src/main/resources/static/real_control_v2/main.html
... ... @@ -12,6 +12,7 @@
12 12 href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/>
13 13 <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" merge="plugins"/>
14 14 <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" merge="plugins"/>
  15 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" merge="plugins"/>
15 16  
16 17 <!-- main style -->
17 18 <link rel="stylesheet" href="/real_control_v2/css/main.css" />
... ... @@ -35,6 +36,8 @@
35 36 <link rel="stylesheet" href="/real_control_v2/css/pace.css" merge="plugins"/>
36 37  
37 38 <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/>
  39 + <!-- perfect-scrollbar style -->
  40 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/>
38 41 </head>
39 42  
40 43 <body>
... ... @@ -105,6 +108,8 @@
105 108 <script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script>
106 109 <!-- moment.js 日期处理类库 -->
107 110 <script src="/assets/plugins/moment-with-locales.js"></script>
  111 +<!-- perfect-scrollbar -->
  112 +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script>
108 113 <!-- common js -->
109 114 <script src="/real_control_v2/js/common.js"></script>
110 115 <!-- art-template 模版引擎 -->
... ... @@ -124,6 +129,8 @@
124 129 <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" merge="uikit_js"></script>
125 130 <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/timepicker.min.js" merge="uikit_js"></script>
126 131 <script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/lightbox.min.js" merge="uikit_js"></script>
  132 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script>
  133 +
127 134  
128 135 <!-- jquery contextMenu -->
129 136 <script src="/real_control_v2/assets/js/jquery.contextMenu.min.js" merge="plugins"></script>
... ... @@ -169,7 +176,7 @@
169 176 <!-- 字典相关 -->
170 177 <script src="/assets/js/dictionary.js" merge="custom_js"></script>
171 178 <!-- websocket -->
172   -<script src="/assets/js/sockjs.min.js"></script>
  179 +<script src="/real_control_v2/assets/plugins/sockjs-client/sockjs.min.js"></script>
173 180 <script src="/real_control_v2/js/websocket/sch_websocket.js" merge="custom_js"></script>
174 181 <!-- tts -->
175 182 <script src="/real_control_v2/js/utils/tts.js" merge="custom_js"></script>
... ...
src/test/java/com/bsth/service/schedule/rules/SchedulePlan1Test.java
1   -package com.bsth.service.schedule.rules;
2   -
3   -import com.bsth.service.schedule.BaseTest;
4   -import org.dbunit.database.DatabaseConnection;
5   -import org.dbunit.database.IDatabaseConnection;
6   -import org.dbunit.dataset.IDataSet;
7   -import org.dbunit.dataset.xml.FlatXmlDataSetBuilder;
8   -import org.dbunit.operation.DatabaseOperation;
9   -import org.junit.After;
10   -import org.junit.Before;
11   -import org.junit.Test;
12   -import org.slf4j.Logger;
13   -import org.slf4j.LoggerFactory;
14   -import org.springframework.beans.factory.annotation.Autowired;
15   -import org.springframework.core.io.ClassPathResource;
16   -import org.springframework.core.io.Resource;
17   -
18   -import javax.sql.DataSource;
19   -
20   -/**
21   - * 排班计划测试(手工排班测试)。
22   - */
23   -public class SchedulePlan1Test extends BaseTest {
24   - /** 日志记录器 */
25   - private static final Logger logger = LoggerFactory.getLogger(SchedulePlan1Test.class);
26   -
27   - @Autowired
28   - private DataSource dataSource;
29   -
30   - /**
31   - * 初始化数据。
32   - */
33   - @Before
34   - public void initData() throws Exception {
35   - logger.info("载入数据......");
36   -
37   - // 获取数据库连接
38   - IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection());
39   - // 获取Dbunit数据源
40   - Resource res = new ClassPathResource("testdata/d2.xml");
41   - FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder();
42   - flatXmlDataSetBuilder.setColumnSensing(false);
43   - flatXmlDataSetBuilder.setCaseSensitiveTableNames(false);
44   - IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream());
45   -
46   - // 载入数据
47   - DatabaseOperation.CLEAN_INSERT.execute(iDatabaseConnection, iDataSet);
48   - }
49   -
50   - /**
51   - * 清除数据。
52   - */
53   - @After
54   - public void destoryData() throws Exception {
55   - logger.info("清除数据......");
56   - // 获取数据库连接
57   - IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection());
58   - // 获取Dbunit数据源
59   - Resource res = new ClassPathResource("testdata/d2.xml");
60   - FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder();
61   - flatXmlDataSetBuilder.setColumnSensing(false);
62   - flatXmlDataSetBuilder.setCaseSensitiveTableNames(false);
63   - IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream());
64   -
65   - // 清除数据
66   - DatabaseOperation.DELETE_ALL.execute(iDatabaseConnection, iDataSet);
67   - }
68   -
69   -
70   - @Test
71   - public void t1() {
72   -
73   - }
74   -
75   -
76   -
77   -
78   -
79   -
80   -
81   -
82   -
83   -
84   -
85   -
86   -
87   -
88   -
89   -
90   -
91   -
92   -
93   -
94   -}
  1 +package com.bsth.service.schedule.rules;
  2 +
  3 +import com.bsth.service.schedule.BaseTest;
  4 +import org.dbunit.database.DatabaseConnection;
  5 +import org.dbunit.database.IDatabaseConnection;
  6 +import org.dbunit.dataset.IDataSet;
  7 +import org.dbunit.dataset.xml.FlatXmlDataSetBuilder;
  8 +import org.dbunit.operation.DatabaseOperation;
  9 +import org.junit.After;
  10 +import org.junit.Before;
  11 +import org.junit.Test;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.core.io.ClassPathResource;
  16 +import org.springframework.core.io.Resource;
  17 +
  18 +import javax.sql.DataSource;
  19 +
  20 +/**
  21 + * 排班计划测试(手工排班测试)。
  22 + */
  23 +public class SchedulePlan1Test extends BaseTest {
  24 + /** 日志记录器 */
  25 + private static final Logger logger = LoggerFactory.getLogger(SchedulePlan1Test.class);
  26 +
  27 + @Autowired
  28 + private DataSource dataSource;
  29 +
  30 + /**
  31 + * 初始化数据。
  32 + */
  33 + @Before
  34 + public void initData() throws Exception {
  35 + logger.info("载入数据......");
  36 +
  37 + // 获取数据库连接
  38 + IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection());
  39 + // 获取Dbunit数据源
  40 + Resource res = new ClassPathResource("testdata/d2.xml");
  41 + FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder();
  42 + flatXmlDataSetBuilder.setColumnSensing(false);
  43 + flatXmlDataSetBuilder.setCaseSensitiveTableNames(false);
  44 + IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream());
  45 +
  46 + // 载入数据
  47 + DatabaseOperation.CLEAN_INSERT.execute(iDatabaseConnection, iDataSet);
  48 + }
  49 +
  50 + /**
  51 + * 清除数据。
  52 + */
  53 + @After
  54 + public void destoryData() throws Exception {
  55 + logger.info("清除数据......");
  56 + // 获取数据库连接
  57 + IDatabaseConnection iDatabaseConnection = new DatabaseConnection(dataSource.getConnection());
  58 + // 获取Dbunit数据源
  59 + Resource res = new ClassPathResource("testdata/d2.xml");
  60 + FlatXmlDataSetBuilder flatXmlDataSetBuilder = new FlatXmlDataSetBuilder();
  61 + flatXmlDataSetBuilder.setColumnSensing(false);
  62 + flatXmlDataSetBuilder.setCaseSensitiveTableNames(false);
  63 + IDataSet iDataSet = flatXmlDataSetBuilder.build(res.getInputStream());
  64 +
  65 + // 清除数据
  66 + DatabaseOperation.DELETE_ALL.execute(iDatabaseConnection, iDataSet);
  67 + }
  68 +
  69 +
  70 + @Test
  71 + public void t1() {
  72 +
  73 + }
  74 +
  75 +
  76 +
  77 +
  78 +
  79 +
  80 +
  81 +
  82 +
  83 +
  84 +
  85 +
  86 +
  87 +
  88 +
  89 +
  90 +
  91 +
  92 +
  93 +
  94 +}
... ...
src/test/java/com/bsth/service/schedule/rules/SchedulePlan2Test.java
1   -package com.bsth.service.schedule.rules;
2   -
3   -/**
4   - * 时刻表测试(自动排班测试)。
5   - */
6   -public class SchedulePlan2Test {
7   - // TODO:
8   -}
  1 +package com.bsth.service.schedule.rules;
  2 +
  3 +/**
  4 + * 时刻表测试(自动排班测试)。
  5 + */
  6 +public class SchedulePlan2Test {
  7 + // TODO:
  8 +}
... ...
src/test/resources/testdata/new.txt
... ... @@ -3,5 +3,4 @@
3 3 3、时刻表管理,导入时刻表xls做严格数据判定,时刻表明细修改提供跟方便的图形化修改方式
4 4 4、排班计划管理,提供每次排班的操作信息,时间段,所使用的时刻表,可以查看具体的排班明细(细化到班次)
5 5 生成排班时,提供详细的时刻表统计信息,提供两种排班模式(历史排班优先,规则优先)
6   -5、调度值勤日报,列出每天的基于线路,路牌的排班统计,可以更换车辆,人员
7   - 此功能从排班计划中抽取出来,单独列出,供调派人员使用
8 6 \ No newline at end of file
  7 +5、调度值勤日报,列出每天的基于线路,路牌的排班统计,可以更换车辆,人员
9 8 \ No newline at end of file
... ...
src/test/resources/testdata/test1.txt
1   -select * from jwgl_f_t_clxh_workflow_detail a where a.ID_LYSYLB = 36;
2   -
3   -select sum(amount - tl_amount) from jwgl_f_t_clxh_workflow_detail
4   -where
5   -to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD')
6   -and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD')
7   -
8   -select * from JWGL_D_T_LYSYLB
9   -
10   -
11   -select
12   -statdateid statdate
13   -, ssjc gs
14   -, xl xl
15   -, zbh cl
16   -, b.SYLB1 || '-' || b.SYLB2 as lylb
17   -, (sum(amount) - sum(tl_amount)) ch
18   -from JWGL_F_T_CLXH_WORKFLOW_DETAIL a, JWGL_D_T_LYSYLB b
19   -where
20   -to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD')
21   -and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD')
22   -and a.ID_LYSYLB = b.ID(+)
23   -group by
24   -statdateid
25   -, ssjc
26   -, xl
27   -, zbh
28   -, b.SYLB1 || '-' || b.SYLB2
29   -
30   --- part1
31   -
32   -select sum(ch) from
33   -(
34   -select
35   -statdateid statdate
36   -, ssjc gs
37   -, xl xl
38   -, zbh cl
39   -, b.SYLB1 || '-' || b.SYLB2 as lylb
40   -, (sum(amount) - sum(tl_amount)) ch
41   -from JWGL_F_T_CLXH_WORKFLOW_DETAIL a, JWGL_D_T_LYSYLB b
42   -where
43   -to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD')
44   -and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD')
45   -and a.ID_LYSYLB = b.ID(+)
46   -group by
47   -statdateid
48   -, ssjc
49   -, xl
50   -, zbh
51   -, b.SYLB1 || '-' || b.SYLB2
52   -)
53   -where lylb in (
54   -'路救-路救',
55   -'小修-小修机工',
56   -'专项-安检',
57   -'专项-节检',
58   -'专项-水箱',
59   -'专项-电瓶',
60   -'小修-小修电工',
61   -'专项-电并',
62   -'小修-小修车身',
63   -'专项-镗固',
64   -'保养-一级保养',
65   -'小修-发动机',
66   -'专项-轮胎',
67   -'分摊-轮胎',
68   -'专项-润滑油',
69   -'总成-差变速',
70   -'总成-大泵',
71   -'总成-小总成',
72   -'总成-发动机',
73   -'保养-二级保养',
74   -'保养-三级保养',
75   -'整修-整修',
76   -'空调-保外',
77   -'空调-保内',
78   -'事故-事故'
79   -)
80   -
81   --- part2
82   -
83   -select sum(ch) from
84   -(
85   -select
86   -statdateid statdate
87   -, ssjc gs
88   -, xl xl
89   -, zbh cl
90   -, b.SYLB1 || '-' || b.SYLB2 as lylb
91   -, (sum(amount) - sum(tl_amount)) ch
92   -from JWGL_F_T_CLXH_WORKFLOW_DETAIL a, JWGL_D_T_LYSYLB b
93   -where
94   -to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD')
95   -and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD')
96   -and a.ID_LYSYLB = b.ID(+)
97   -group by
98   -statdateid
99   -, ssjc
100   -, xl
101   -, zbh
102   -, b.SYLB1 || '-' || b.SYLB2
103   -)
104   -where lylb in(
105   -'分摊-镗固',
106   -'专项-机油',
107   -'分摊-机油',
108   -'总成-其它',
109   -'分摊-工具',
110   -'分摊-辅助料',
111   -'分摊-设备',
112   -'车间经费-车间经费'
113   -)
114   -
115   -
116   -
117   -
118   -
119   -
120   -
121   -
122   -
123   -
124   -
125   -
126   -
127   -
128   -
129   -
130   -
131   -
132   -
  1 +select * from jwgl_f_t_clxh_workflow_detail a where a.ID_LYSYLB = 36;
  2 +
  3 +select sum(amount - tl_amount) from jwgl_f_t_clxh_workflow_detail
  4 +where
  5 +to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD')
  6 +and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD')
  7 +
  8 +select * from JWGL_D_T_LYSYLB
  9 +
  10 +-- all xh
  11 +
  12 +select
  13 +statdateid statdate
  14 +, ssjc gs
  15 +, xl xl
  16 +, zbh cl
  17 +, b.SYLB1 || '-' || b.SYLB2 as lylb
  18 +, (sum(amount) - sum(tl_amount)) ch
  19 +from JWGL_F_T_CLXH_WORKFLOW_DETAIL a, JWGL_D_T_LYSYLB b
  20 +where
  21 +to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD')
  22 +and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD')
  23 +and a.ID_LYSYLB = b.ID(+)
  24 +group by
  25 +statdateid
  26 +, ssjc
  27 +, xl
  28 +, zbh
  29 +, b.SYLB1 || '-' || b.SYLB2
  30 +
  31 +-- part1
  32 +
  33 +select sum(ch) from
  34 +(
  35 +select
  36 +statdateid statdate
  37 +, ssjc gs
  38 +, xl xl
  39 +, zbh cl
  40 +, b.SYLB1 || '-' || b.SYLB2 as lylb
  41 +, (sum(amount) - sum(tl_amount)) ch
  42 +from JWGL_F_T_CLXH_WORKFLOW_DETAIL a, JWGL_D_T_LYSYLB b
  43 +where
  44 +to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD')
  45 +and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD')
  46 +and a.ID_LYSYLB = b.ID(+)
  47 +group by
  48 +statdateid
  49 +, ssjc
  50 +, xl
  51 +, zbh
  52 +, b.SYLB1 || '-' || b.SYLB2
  53 +)
  54 +where lylb in (
  55 +'路救-路救',
  56 +'小修-小修机工',
  57 +'专项-安检',
  58 +'专项-节检',
  59 +'专项-水箱',
  60 +'专项-电瓶',
  61 +'小修-小修电工',
  62 +'专项-电并',
  63 +'小修-小修车身',
  64 +'专项-镗固',
  65 +'保养-一级保养',
  66 +'小修-发动机',
  67 +'专项-轮胎',
  68 +'分摊-轮胎',
  69 +'专项-润滑油',
  70 +'总成-差变速',
  71 +'总成-大泵',
  72 +'总成-小总成',
  73 +'总成-发动机',
  74 +'保养-二级保养',
  75 +'保养-三级保养',
  76 +'整修-整修',
  77 +'空调-保外',
  78 +'空调-保内',
  79 +'事故-事故'
  80 +)
  81 +
  82 +-- part2
  83 +
  84 +select sum(ch) from
  85 +(
  86 +select
  87 +statdateid statdate
  88 +, ssjc gs
  89 +, xl xl
  90 +, zbh cl
  91 +, b.SYLB1 || '-' || b.SYLB2 as lylb
  92 +, (sum(amount) - sum(tl_amount)) ch
  93 +from JWGL_F_T_CLXH_WORKFLOW_DETAIL a, JWGL_D_T_LYSYLB b
  94 +where
  95 +to_date(statdateid, 'YYYYMMDD') >= to_date('20170301', 'YYYYMMDD')
  96 +and to_date(statdateid, 'YYYYMMDD') <= to_date('20170331', 'YYYYMMDD')
  97 +and a.ID_LYSYLB = b.ID(+)
  98 +group by
  99 +statdateid
  100 +, ssjc
  101 +, xl
  102 +, zbh
  103 +, b.SYLB1 || '-' || b.SYLB2
  104 +)
  105 +where lylb in(
  106 +'分摊-镗固',
  107 +'专项-机油',
  108 +'分摊-机油',
  109 +'总成-其它',
  110 +'分摊-工具',
  111 +'分摊-辅助料',
  112 +'分摊-设备',
  113 +'车间经费-车间经费'
  114 +)
  115 +
  116 +
  117 +
  118 +
  119 +
  120 +
  121 +
  122 +
  123 +
  124 +
  125 +
  126 +
  127 +
  128 +
  129 +
  130 +
  131 +
  132 +
  133 +
... ...
src/test/resources/testdata/test2.txt
1   -
2   -select * from JWGL_FR_T_CH_REPORT_DATA1;
3   -
4   -select * from JWGL_FR_T_CH_REPORT_DATA2;
5   -
6   --- sum part1
7   -
8   -select
9   -(
10   -sum(lj_lj) + sum(xx_xxjg) + sum(xx_xxdg) + sum(zx_db) + sum(xx_xxcs) + sum(zx_tg) + sum(by_b1) +
11   -sum(nvl(future_bx, 0)) + sum(xx_fdj) + sum(zx_lt) + sum(zx_rhy) + sum(zc_cbx) + sum(zc_db) + sum(zc_xzc) +
12   -sum(zc_fdj) + sum(by_b2) + sum(by_b3) + sum(nvl(future_wx_db, 0)) + sum(nvl(future_wxfy, 0)) + sum(nvl(future_ktwx, 0)) + sum(nvl(future_sx, 0)) +
13   -sum(nvl(future_dp, 0)) + sum(zx_zx) + sum(kt_bw) + sum(sg_sg)
14   -) as part1
15   -from JWGL_FR_T_CH_REPORT_DATA1
16   -where
17   -statdate >= to_date('20170301', 'YYYYMMDD')
18   -and statdate <= to_date('20170331', 'YYYYMMDD')
19   -
20   --- sum part2
21   -
22   -select
23   -(
24   -sum(zx_tg) + sum(jy) + sum(qt) + sum(zcfl) + sum(gj) + sum(sb) + sum(cjjf)
25   -) as part2
26   -from JWGL_FR_T_CH_REPORT_DATA2
  1 +
  2 +select * from JWGL_FR_T_CH_REPORT_DATA1;
  3 +
  4 +select * from JWGL_FR_T_CH_REPORT_DATA2;
  5 +
  6 +-- sum part1
  7 +
  8 +select
  9 +(
  10 +sum(lj_lj) + sum(xx_xxjg) + sum(xx_xxdg) + sum(zx_db) + sum(xx_xxcs) + sum(zx_tg) + sum(by_b1) +
  11 +sum(nvl(future_bx, 0)) + sum(xx_fdj) + sum(zx_lt) + sum(zx_rhy) + sum(zc_cbx) + sum(zc_db) + sum(zc_xzc) +
  12 +sum(zc_fdj) + sum(by_b2) + sum(by_b3) + sum(nvl(future_wx_db, 0)) + sum(nvl(future_wxfy, 0)) + sum(nvl(future_ktwx, 0)) + sum(nvl(future_sx, 0)) +
  13 +sum(nvl(future_dp, 0)) + sum(zx_zx) + sum(kt_bw) + sum(sg_sg)
  14 +) as part1
  15 +from JWGL_FR_T_CH_REPORT_DATA1
  16 +where
  17 +statdate >= to_date('20170301', 'YYYYMMDD')
  18 +and statdate <= to_date('20170331', 'YYYYMMDD')
  19 +
  20 +-- sum part2
  21 +
  22 +select
  23 +(
  24 +sum(zx_tg) + sum(jy) + sum(qt) + sum(zcfl) + sum(gj) + sum(sb) + sum(cjjf)
  25 +) as part2
  26 +from JWGL_FR_T_CH_REPORT_DATA2
27 27 where statdate = to_date('20170331', 'YYYYMMDD')
28 28 \ No newline at end of file
... ...