Commit a8b0de859dbd9f230f6b69986aa3131dad0dbc75

Authored by 潘钊
2 parents 9789dd4f c113ed18

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

Showing 53 changed files with 12134 additions and 691 deletions
src/main/java/com/bsth/controller/oil/CwjyController.java
... ... @@ -58,7 +58,7 @@ public class CwjyController extends BaseController<Cwjy, Integer>{
58 58 * @throws
59 59 */
60 60 @RequestMapping(value="/savejzl",method = RequestMethod.POST)
61   - public Map<String, Object> savejzl(Map<String, Object> map){
  61 + public Map<String, Object> savejzl(@RequestParam Map<String, Object> map){
62 62 Map<String, Object> maps=new HashMap<>();
63 63 try {
64 64 maps = service.savejzl(map);
... ...
src/main/java/com/bsth/controller/oil/DlbController.java
1 1 package com.bsth.controller.oil;
2 2  
  3 +import java.util.HashMap;
3 4 import java.util.List;
4 5 import java.util.Map;
5 6  
... ... @@ -70,11 +71,17 @@ public class DlbController extends BaseController&lt;Dlb, Integer&gt;{
70 71 List<String> list = Splitter.on(",").trimResults().splitToList(order);
71 72 return baseService.list(map, new PageRequest(page, size, new Sort(d, list)));
72 73 }
  74 + @RequestMapping(value = "/dlbList",method = RequestMethod.GET)
  75 + public List<Dlb> dlbList(@RequestParam Map<String, Object> map){
  76 + List<Dlb> list=service.listDlb(map);
  77 + return list;
  78 + }
  79 +
  80 +
73 81  
74 82 @RequestMapping(value = "/obtain",method = RequestMethod.GET)
75 83 public Map<String, Object> obtain(@RequestParam Map<String, Object> map){
76 84 Map<String, Object> list=service.obtain(map);
77   - System.out.println();
78 85 return list;
79 86 }
80 87  
... ... @@ -99,4 +106,22 @@ public class DlbController extends BaseController&lt;Dlb, Integer&gt;{
99 106 Map<String, Object> list=service.checkDl(map);
100 107 return list;
101 108 }
  109 +
  110 + @RequestMapping(value = "/sumYlb",method = RequestMethod.GET)
  111 + public Map<String, Object> sumYlb(@RequestParam Map<String, Object> map){
  112 + Map<String, Object> list=service.sumYlb(map);
  113 + return list;
  114 + }
  115 +
  116 + @RequestMapping(value = "/saveDlbList",method = RequestMethod.POST)
  117 + public Map<String, Object> saveDlbList(@RequestParam Map<String, Object> map){
  118 + Map<String, Object> list=new HashMap<String, Object>();
  119 + try {
  120 + list = service.saveDlbList(map);
  121 + } catch (Exception e) {
  122 + // TODO Auto-generated catch block
  123 + e.printStackTrace();
  124 + }
  125 + return list;
  126 + }
102 127 }
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -68,6 +68,8 @@ public class BasicData implements CommandLineRunner {
68 68 public static Map<String, Personnel> jsyMap;
69 69 //售票员工号 和 personnel 对象映射
70 70 public static Map<String, Personnel> spyMap;
  71 + //所以员工和personnerl 对象映射
  72 + public static Map<String, Personnel> perMap;
71 73 //全量员工 工号和姓名对照
72 74 public static Map<String, String> allPerson;
73 75  
... ... @@ -310,7 +312,7 @@ public class BasicData implements CommandLineRunner {
310 312 public void loadPersonnelInfo() {
311 313 Iterator<Personnel> iterator = personnelRepository.findAll().iterator();
312 314  
313   - Map<String, Personnel> jsyTempMap = new HashMap<>(), spyTempMap = new HashMap<>();
  315 + Map<String, Personnel> jsyTempMap = new HashMap<>(), spyTempMap = new HashMap<>(),perTempMap=new HashMap<>();
314 316 Map<String, String> allPersonMap = new HashMap<>();
315 317  
316 318 Personnel p;
... ... @@ -328,13 +330,15 @@ public class BasicData implements CommandLineRunner {
328 330 else if (p.getPosts().equals("2"))
329 331 spyTempMap.put(jobCode, p);
330 332 }
331   -
  333 +
  334 + perTempMap.put(jobCode, p);
332 335 allPersonMap.put(jobCode, p.getPersonnelName());
333 336 }
334 337  
335 338 jsyMap = jsyTempMap;
336 339 spyMap = spyTempMap;
337 340 allPerson = allPersonMap;
  341 + perMap = perTempMap;
338 342 }
339 343 }
340 344 }
... ...
src/main/java/com/bsth/entity/oil/Dlb.java
... ... @@ -55,7 +55,7 @@ public class Dlb {
55 55 private Date edittime;
56 56 private Date createtime;
57 57 private int nylx;
58   - //进场顺序(根据最先出场和最后进场来关联车辆的存量)
  58 + //进场顺序(根据最先出场和最后进场来关联车辆的存量)
59 59 private int jcsx;
60 60  
61 61 @Transient
... ...
src/main/java/com/bsth/entity/schedule/SchedulePlan.java
... ... @@ -41,6 +41,13 @@ public class SchedulePlan extends BEntity {
41 41 /** 使用的时刻表id列表(用逗号连接) */
42 42 private String ttInfoIds;
43 43  
  44 + /** 是否 排班计划优先 */
  45 + private Boolean isHistoryPlanFirst;
  46 +
  47 + /** 每次排班的结果数据(错误,正确提示都在这里) */
  48 + @Column(length = 2000)
  49 + private String planResult;
  50 +
44 51 @JsonIgnore
45 52 /** 使用中间表的一对多关联 明细信息 */
46 53 @OneToMany(mappedBy = "schedulePlan", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
... ... @@ -101,4 +108,20 @@ public class SchedulePlan extends BEntity {
101 108 public void setTtInfoIds(String ttInfoIds) {
102 109 this.ttInfoIds = ttInfoIds;
103 110 }
  111 +
  112 + public Boolean getIsHistoryPlanFirst() {
  113 + return isHistoryPlanFirst;
  114 + }
  115 +
  116 + public void setIsHistoryPlanFirst(Boolean isHistoryPlanFirst) {
  117 + this.isHistoryPlanFirst = isHistoryPlanFirst;
  118 + }
  119 +
  120 + public String getPlanResult() {
  121 + return planResult;
  122 + }
  123 +
  124 + public void setPlanResult(String planResult) {
  125 + this.planResult = planResult;
  126 + }
104 127 }
... ...
src/main/java/com/bsth/repository/oil/DlbRepository.java
... ... @@ -34,4 +34,72 @@ public interface DlbRepository extends BaseRepository&lt;Dlb, Integer&gt;{
34 34 @Query(value="SELECT * FROM bsth_c_dlb where to_days(?)=to_days(rq)",nativeQuery=true)
35 35 List<Dlb> obtainDl(String rq);
36 36  
  37 + @Query(value="select s from Dlb s "
  38 + + " where to_days(?1)=to_days(s.rq) "
  39 + + " and s.ssgsdm like %?2% "
  40 + + " and s.fgsdm like %?3%"
  41 + + " and s.xlbm like %?4% "
  42 + + " and s.nbbm in ?5 order by nbbm,jcsx")
  43 + List<Dlb> listDlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
  44 +
  45 +
  46 + /**
  47 + *
  48 + * @param nbbm
  49 + * @param rq
  50 + * @param xlbm
  51 + * @return
  52 + */
  53 + @Transactional
  54 + @Modifying
  55 + @Query(value="select nbbm,count(nbbm) from bsth_c_dlb where to_days(?1)=to_days(rq) and "
  56 + + " ssgsdm like %?2% "
  57 + + " and fgsdm like %?3%"
  58 + + " and xlbm like %?4% and nbbm like %?5% "
  59 + + " group by nbbm,rq,ssgsdm,fgsdm,xlbm",nativeQuery=true)
  60 + List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm);
  61 +
  62 + @Transactional
  63 + @Modifying
  64 + @Query(value="select nbbm,sum(cdl*100) as cdl ,sum(zlc*100) as zlc from bsth_c_dlb where to_days(?1)=to_days(rq) and "
  65 + + " ssgsdm like %?2% "
  66 + + " and fgsdm like %?3%"
  67 + + " and xlbm like %?4% and nbbm like %?5% "
  68 + + " group by nbbm,rq,ssgsdm,fgsdm,xlbm",nativeQuery=true)
  69 + List<Object[]> checkNbmmDl(String rq, String gsbm,String fgsbm,String xlbm,String nbbm);
  70 +
  71 +
  72 +
  73 + @Query(value="select cdl,hd,sh from Dlb s "
  74 + + " where to_days(?1)=to_days(s.rq) "
  75 + + " and s.ssgsdm like %?2% "
  76 + + " and s.fgsdm like %?3%"
  77 + + " and s.xlbm like %?4% "
  78 + + " and s.nbbm in ?5 ")
  79 + List<Object[]> sumDlb(String rq, String gsbm,String fgsbm,String xlbm,List<String> listNbbm);
  80 +
  81 + @Transactional
  82 + @Modifying
  83 + @Query(value="select ifnull(cdl,0),ifnull(hd,0),ifnull(sh,0) from bsth_c_dlb "
  84 + + " where to_days(?1)=to_days(rq) "
  85 + + " and ssgsdm like %?2% "
  86 + + " and fgsdm like %?3%"
  87 + + " and xlbm like %?4% "
  88 + + " and nbbm like %?5%",nativeQuery=true)
  89 + List<Object[]> sumDlb2(String rq, String gsbm,String fgsbm,String xlbm,String nbbm);
  90 +
  91 +
  92 + @Transactional
  93 + @Modifying
  94 + @Query(value="UPDATE bsth_c_dlb SET " +
  95 + " czcd= ?2,"+
  96 + " jzcd = ?3, " +
  97 + " hd = ?4,"+
  98 + " sh = ?5," +
  99 + " shyy = ?6," +
  100 + " yhlx = ?7"+
  101 + " WHERE id = ?1", nativeQuery=true)
  102 + public void dlbUpdate(Integer id,double czcd,double jzcd,double hd, double sh,String shyy,int yhlx);
  103 +
  104 +
37 105 }
... ...
src/main/java/com/bsth/repository/schedule/TTInfoDetailRepository.java
... ... @@ -51,5 +51,7 @@ public interface TTInfoDetailRepository extends BaseRepository&lt;TTInfoDetail, Lon
51 51 @Query(value = "delete from TTInfoDetail t where t.ttinfo.id = ?1")
52 52 void deleteByTtinfoIdWithModify(Long ttinfoid);
53 53  
54   -
  54 + @Modifying
  55 + @Query(value = "delete from TTInfoDetail t where t.xl.id=?1 and t.ttinfo.id = ?2")
  56 + void deltidc(int xl , Long ttinfoid );
55 57 }
... ...
src/main/java/com/bsth/service/oil/DlbService.java
1 1 package com.bsth.service.oil;
2 2  
  3 +import java.util.List;
3 4 import java.util.Map;
4 5  
5 6 import com.bsth.entity.oil.Dlb;
... ... @@ -11,4 +12,10 @@ public interface DlbService extends BaseService&lt;Dlb, Integer&gt;{
11 12 Map<String, Object> sort(Map<String, Object> map);
12 13  
13 14 Map<String, Object> checkDl(Map<String, Object> map);
  15 +
  16 + List<Dlb> listDlb(Map<String, Object> map);
  17 +
  18 + Map<String, Object> sumYlb(Map<String, Object> map);
  19 +
  20 + Map<String, Object> saveDlbList(Map<String, Object> map) throws Exception;
14 21 }
... ...
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
... ... @@ -227,6 +227,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
227 227 String jsy=jsonObject.getString("jsy");
228 228 double jzl=jsonObject.getDoubleValue("jzl");
229 229 String stationid=jsonObject.getString("stationid");
  230 + String nbbm=jsonObject.getString("nbbm");
230 231 int nylx=jsonObject.getIntValue("nylx");
231 232 String jyggh=jsonObject.getString("jyggh");
232 233 String bz=jsonObject.getString("bz");
... ... @@ -238,19 +239,25 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
238 239 y.setStationid(stationid);
239 240 y.setJyggh(jyggh);
240 241 y.setBz(bz);
241   - y.setCreatetime(date);
  242 + y.setCreatetime(new Date());
  243 + y.setYyrq(date);
242 244 ylxxbRepository.save(y);
243 245 }else{
244   - y=new Ylxxb();
245   - y.setGsdm(gsbm);
246   - y.setJsy(jsy);
247   - y.setJzl(jzl);
248   - y.setStationid(stationid);
249   - y.setJyggh(jyggh);
250   - y.setBz(bz);
251   - y.setCreatetime(date);
252   - y.setJylx(1);
253   - ylxxbRepository.save(y);
  246 + if(jsy!="" && jzl>0){
  247 + y=new Ylxxb();
  248 + y.setGsdm(gsbm);
  249 + y.setJsy(jsy);
  250 + y.setNbbm(nbbm);
  251 + y.setJzl(jzl);
  252 + y.setStationid(stationid);
  253 + y.setJyggh(jyggh);
  254 + y.setBz(bz);
  255 + y.setCreatetime(new Date());
  256 + y.setYyrq(date);
  257 + y.setJylx(1);
  258 + y.setNylx(0);
  259 + ylxxbRepository.save(y);
  260 + }
254 261 }
255 262 }
256 263 map.put("status", ResponseCode.SUCCESS);
... ... @@ -297,7 +304,7 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
297 304 t.setNylx(rs.getInt("nylx"));
298 305 t.setYj(rs.getDouble("yj"));
299 306 t.setBz(rs.getString("bz"));
300   - t.setJsy(rs.getString("ldgh"));
  307 + t.setLdgh(rs.getString("ldgh"));
301 308 return t;
302 309 }
303 310 });
... ...
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
... ... @@ -14,6 +14,7 @@ import java.util.Map;
14 14  
15 15 import javax.transaction.Transactional;
16 16  
  17 +import org.apache.commons.lang3.StringEscapeUtils;
17 18 import org.slf4j.Logger;
18 19 import org.slf4j.LoggerFactory;
19 20 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -22,6 +23,8 @@ import org.springframework.data.domain.Sort.Direction;
22 23 import org.springframework.jdbc.core.JdbcTemplate;
23 24 import org.springframework.stereotype.Service;
24 25  
  26 +import com.alibaba.fastjson.JSONArray;
  27 +import com.alibaba.fastjson.JSONObject;
25 28 import com.bsth.common.ResponseCode;
26 29 import com.bsth.entity.Cars;
27 30 import com.bsth.entity.oil.Cdl;
... ... @@ -41,6 +44,7 @@ import com.bsth.repository.oil.YlxxbRepository;
41 44 import com.bsth.service.impl.BaseServiceImpl;
42 45 import com.bsth.service.oil.DlbService;
43 46 import com.bsth.service.realcontrol.ScheduleRealInfoService;
  47 +import com.bsth.util.Arith;
44 48  
45 49 @Service
46 50 public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbService{
... ... @@ -129,6 +133,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
129 133 }
130 134 try {
131 135 //当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量
  136 + Double jzl=0.0;
132 137 if(map.get("seqNumber").toString().equals("1")){
133 138 boolean fage=true;
134 139 for (int i = 0; i < dlListBe.size(); i++) {
... ... @@ -143,7 +148,7 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
143 148 for (int y = 0; y < cdyList.size(); y++) {
144 149 Cdl cdl=cdyList.get(y);
145 150 if(map.get("clZbh").toString().equals(cdl.getNbbm())){
146   - t.setCzcd(cdl.getClcd());
  151 + t.setCzcd(cdl.getClcd()==null?0:cdl.getClcd());
147 152 fage=false;
148 153 break;
149 154 }
... ... @@ -152,9 +157,17 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
152 157 if(fage){
153 158 t.setCzcd(0.0);
154 159 }
  160 +
  161 + //手动导入没有驾驶员工号
  162 + for (int i = 0; i < jdlList.size(); i++) {
  163 + Jdl jdl=jdlList.get(i);
  164 + if(map.get("clZbh").toString().equals(jdl.getNbbm()) ){
  165 + jzl+=jdl.getJdl();
  166 + }
  167 + }
155 168 }
156 169  
157   - Double jzl=0.0;
  170 +
158 171 //把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断)
159 172 for(int j=0;j<ylxxList.size();j++){
160 173 Ylxxb ylxxb= ylxxList.get(j);
... ... @@ -163,24 +176,22 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
163 176 }
164 177 }
165 178  
166   - //手动导入没有驾驶员工号
167   - for (int i = 0; i < jdlList.size(); i++) {
168   - Jdl jdl=jdlList.get(i);
169   - if(map.get("clZbh").toString().equals(jdl.getNbbm()) ){
170   - jzl+=jdl.getJdl();
171   - }
172   - }
173 179 t.setCdl(jzl);
174   - t.setJzcd(t.getCzcd());
  180 + if(type.equals("add")){
  181 + t.setHd(jzl);
  182 + t.setJzcd(t.getCzcd());
  183 + }
  184 +
175 185 t.setNbbm(map.get("clZbh").toString());
176 186 t.setJsy(map.get("jGh")==null?"":map.get("jGh").toString());
177 187 t.setZlc(map.get("totalKilometers")==null?0.0:Double.parseDouble(df.format(Double.parseDouble(map.get("totalKilometers").toString()))));
178 188 t.setXlbm(map.get("xlBm")==null?"":map.get("xlBm").toString());
179   - t.setHd(jzl);
180 189 t.setJcsx(Integer.parseInt(map.get("seqNumber").toString()));
181 190 t.setSsgsdm(map.get("company")==null?"":map.get("company").toString());
182 191 t.setFgsdm(map.get("bCompany")==null?"":map.get("bCompany").toString());
  192 + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
183 193 t.setRq(sdf.parse(rq));
  194 + t.setCreatetime(new Date());
184 195 /*if(type.equals("add")){
185 196 addList.add(t);
186 197 }else{
... ... @@ -314,4 +325,224 @@ public class DlbServiceImpl extends BaseServiceImpl&lt;Dlb,Integer&gt; implements DlbS
314 325  
315 326 return newMap;
316 327 }
  328 +
  329 + @Override
  330 + public List<Dlb> listDlb(Map<String, Object> map) {
  331 + // TODO Auto-generated method stub
  332 + List<Dlb> listDlb=new ArrayList<Dlb>();
  333 + List<String> stringList=new ArrayList<String>();
  334 + String rq=map.get("rq").toString();
  335 + String gsbm=map.get("ssgsdm_like").toString();
  336 + String fgsbm=map.get("fgsdm_like").toString();
  337 + String xlbm=map.get("xlbm_like").toString().trim();
  338 + String nbbm=map.get("nbbm_eq").toString();
  339 + String sxtj=map.get("sxtj").toString();
  340 +
  341 + if(nbbm.trim()!=""){
  342 + stringList.add(nbbm);
  343 + listDlb=repository.listDlb(rq, gsbm, fgsbm, xlbm, stringList);
  344 + }else{
  345 + //全部
  346 + if(sxtj.equals("0")){
  347 + List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm);
  348 + for (int i = 0; i < objectLists.size(); i++) {
  349 + String clbm=objectLists.get(i)[0].toString();
  350 + stringList.add(clbm);
  351 + }
  352 + if(stringList.size()>0){
  353 + listDlb=repository.listDlb(rq, gsbm, fgsbm, xlbm, stringList);
  354 + }
  355 + }else{
  356 + List<Object[]> objectLists;
  357 + if(sxtj.equals("3")){
  358 + //有加油没里程
  359 + objectLists=repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm);
  360 + for (int i = 0; i < objectLists.size(); i++) {
  361 + String clbm=objectLists.get(i)[0].toString();
  362 + double jzl=Double.parseDouble(objectLists.get(i)[1].toString());
  363 + double zlc=Double.parseDouble(objectLists.get(i)[2].toString());
  364 + if(jzl>0 && zlc<=0){
  365 + stringList.add(clbm);
  366 + }
  367 +
  368 + }
  369 +
  370 + }else if(sxtj.equals("4")){
  371 + //有里程没加油
  372 + objectLists=repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm);
  373 + for (int i = 0; i < objectLists.size(); i++) {
  374 + String clbm=objectLists.get(i)[0].toString();
  375 + double jzl=Double.parseDouble(objectLists.get(i)[1].toString());
  376 + double zlc=Double.parseDouble(objectLists.get(i)[2].toString());
  377 + if(zlc>0 && jzl<=0){
  378 + stringList.add(clbm);
  379 + }
  380 +
  381 + }
  382 + }else{
  383 + objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm);
  384 + for (int i = 0; i < objectLists.size(); i++) {
  385 + String clbm=objectLists.get(i)[0].toString();
  386 + int cs=Integer.parseInt(objectLists.get(i)[1].toString());
  387 + //一车一单
  388 + if(sxtj.equals("1")){
  389 + if(cs==1){
  390 + stringList.add(clbm);
  391 + }
  392 + }
  393 + //一车多单
  394 + if(sxtj.equals("2")){
  395 + if(cs>1){
  396 + stringList.add(clbm);
  397 + }
  398 + }
  399 + }
  400 + }
  401 +
  402 + if(stringList.size()>0){
  403 + listDlb=repository.listDlb(rq, gsbm, fgsbm, xlbm, stringList);
  404 + }
  405 + }
  406 + }
  407 +
  408 + return listDlb;
  409 + }
  410 +
  411 + @Override
  412 + public Map<String, Object> sumYlb(Map<String, Object> map) {
  413 + // TODO Auto-generated method stub
  414 + List<String> stringList = new ArrayList<String>();
  415 + String rq = map.get("rq").toString();
  416 + String gsbm = map.get("ssgsdm_like").toString();
  417 + String fgsbm = map.get("fgsdm_like").toString();
  418 + String xlbm = map.get("xlbm_like").toString().trim();
  419 + String nbbm = map.get("nbbm_eq").toString();
  420 + String sxtj = map.get("sxtj").toString();
  421 + if (nbbm.trim() != "") {
  422 + stringList.add(nbbm);
  423 + } else {
  424 + if (!sxtj.equals("0")) {
  425 + List<Object[]> objectLists;
  426 + if (sxtj.equals("3")) {
  427 + // 有加油没里程
  428 + objectLists = repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm);
  429 + for (int i = 0; i < objectLists.size(); i++) {
  430 + String clbm = objectLists.get(i)[0].toString();
  431 + double jzl = Double.parseDouble(objectLists.get(i)[1].toString());
  432 + double zlc = Double.parseDouble(objectLists.get(i)[2].toString());
  433 + if (jzl > 0 && zlc <= 0) {
  434 + stringList.add(clbm);
  435 + }
  436 +
  437 + }
  438 +
  439 + } else if (sxtj.equals("4")) {
  440 + // 有里程没加油
  441 + objectLists = repository.checkNbmmDl(rq, gsbm, fgsbm, xlbm, nbbm);
  442 + for (int i = 0; i < objectLists.size(); i++) {
  443 + String clbm = objectLists.get(i)[0].toString();
  444 + double jzl = Double.parseDouble(objectLists.get(i)[1].toString());
  445 + double zlc = Double.parseDouble(objectLists.get(i)[2].toString());
  446 + if (zlc > 0 && jzl <= 0) {
  447 + stringList.add(clbm);
  448 + }
  449 +
  450 + }
  451 + } else {
  452 + objectLists = repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm, nbbm);
  453 + for (int i = 0; i < objectLists.size(); i++) {
  454 + String clbm = objectLists.get(i)[0].toString();
  455 + int cs = Integer.parseInt(objectLists.get(i)[1].toString());
  456 + // 一车一单
  457 +
  458 + if (sxtj.equals("1")) {
  459 + if (cs == 1) {
  460 + stringList.add(clbm);
  461 + }
  462 + }
  463 + // 一车多单
  464 + if (sxtj.equals("2")) {
  465 + if (cs > 1) {
  466 + stringList.add(clbm);
  467 + }
  468 + }
  469 + }
  470 + }
  471 + }
  472 + }
  473 + List<Object[]> sumYlbList = new ArrayList<Object[]>();
  474 + if (sxtj.equals("0")) {
  475 + sumYlbList = repository.sumDlb2(rq, gsbm, fgsbm, xlbm, nbbm);
  476 + } else {
  477 + if (stringList.size() > 0) {
  478 +
  479 + // String strings[]=new String[stringList.size()];
  480 + // for(int i=0;i<stringList.size();i++){
  481 + // strings[i]=stringList.get(i);
  482 + // }
  483 + sumYlbList = repository.sumDlb(rq, gsbm, fgsbm, xlbm, stringList);
  484 + }
  485 +// else {
  486 +// sumYlbList = repository.sumDlb2(rq, gsbm, fgsbm, xlbm, nbbm);
  487 +// }
  488 + }
  489 + Double jzl = 0.0, yh = 0.0, sh = 0.0;
  490 + for (int i = 0; i < sumYlbList.size(); i++) {
  491 + jzl = Arith.add(jzl, Double.valueOf(sumYlbList.get(i)[0].toString()));
  492 + yh = Arith.add(yh, Double.valueOf(sumYlbList.get(i)[1].toString()));
  493 + sh = Arith.add(sh, Double.valueOf(sumYlbList.get(i)[2].toString()));
  494 + }
  495 +
  496 + Map<String, Object> sumMap = new HashMap<String, Object>();
  497 + sumMap.put("jzl", jzl);
  498 + sumMap.put("yh", yh);
  499 + sumMap.put("sh", sh);
  500 + return sumMap;
  501 + }
  502 +
  503 +
  504 + @Transactional
  505 + @Override
  506 + public Map<String, Object> saveDlbList(Map<String, Object> map) throws Exception {
  507 + // TODO Auto-generated method stub
  508 + Map<String, Object> newMap=new HashMap<String,Object>();
  509 + try{
  510 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
  511 + String json =StringEscapeUtils.unescapeHtml4(map.get("dlbList").toString());
  512 + JSONArray jsonArray=JSONArray.parseArray(json);
  513 + JSONObject jsonObject;
  514 + // 获取车辆存油信息
  515 +// List<Cyl> cylList = cylRepository.obtainCyl("","");
  516 + for (int i = 0; i < jsonArray.size(); i++) {
  517 +// Ylb t=new Ylb();
  518 + jsonObject=jsonArray.getJSONObject(i);
  519 + double czcd = jsonObject.getDoubleValue("czcd");
  520 + double cdl =jsonObject.getDoubleValue("cdl");
  521 + double jzcd =jsonObject.getDoubleValue("jzcd");
  522 + double sh =jsonObject.getDoubleValue("sh");
  523 + String shyy =jsonObject.getString("shyy");
  524 + double hd = jsonObject.getDoubleValue("hd");
  525 + int yhlx =jsonObject.getIntValue("yhlx");
  526 + Integer id =jsonObject.getInteger("id");
  527 +// String nbbm =jsonObject.getString("nbbm");
  528 +// String rq=jsonObject.getString("rq");
  529 + repository.dlbUpdate(id, czcd, jzcd, hd, sh, shyy, yhlx);
  530 + /*for (int z = 0; z < cylList.size(); z++) {
  531 + Cyl cyl = cylList.get(z);
  532 + if (nbbm.equals(cyl.getNbbm())) {
  533 + cyl.setCyl(jzyl);
  534 + cyl.setUpdatetime(sdf.parse(rq));
  535 + break;
  536 + }
  537 + cylRepository.save(cyl);
  538 + }*/
  539 + }
  540 + newMap.put("status", ResponseCode.SUCCESS);
  541 + }catch(Exception e){
  542 + newMap.put("status", ResponseCode.ERROR);
  543 + logger.error("save erro.", e);
  544 + throw e;
  545 + }
  546 + return newMap;
  547 + }
317 548 }
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -831,22 +831,50 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
831 831 stringList.add(nbbm);
832 832 }else{
833 833 if(!sxtj.equals("0")){
834   - List<Object[]> objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm);
835   - for (int i = 0; i < objectLists.size(); i++) {
836   - String clbm=objectLists.get(i)[0].toString();
837   - int cs=Integer.parseInt(objectLists.get(i)[1].toString());
838   - //一车一单
839   -
840   - if(sxtj.equals("1")){
841   - if(cs==1){
  834 + List<Object[]> objectLists;
  835 + if(sxtj.equals("3")){
  836 + //有加油没里程
  837 + objectLists=repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm);
  838 + for (int i = 0; i < objectLists.size(); i++) {
  839 + String clbm=objectLists.get(i)[0].toString();
  840 + double jzl=Double.parseDouble(objectLists.get(i)[1].toString());
  841 + double zlc=Double.parseDouble(objectLists.get(i)[2].toString());
  842 + if(jzl>0 && zlc<=0){
842 843 stringList.add(clbm);
843 844 }
  845 +
844 846 }
845   - //一车多单
846   - if(sxtj.equals("2")){
847   - if(cs>1){
  847 +
  848 + }else if(sxtj.equals("4")){
  849 + //有里程没加油
  850 + objectLists=repository.checkNbmmYl(rq, gsbm, fgsbm, xlbm, nbbm);
  851 + for (int i = 0; i < objectLists.size(); i++) {
  852 + String clbm=objectLists.get(i)[0].toString();
  853 + double jzl=Double.parseDouble(objectLists.get(i)[1].toString());
  854 + double zlc=Double.parseDouble(objectLists.get(i)[2].toString());
  855 + if(zlc>0 && jzl<=0){
848 856 stringList.add(clbm);
849 857 }
  858 +
  859 + }
  860 + }else{
  861 + objectLists=repository.checkNbmmNum(rq, gsbm, fgsbm, xlbm,nbbm);
  862 + for (int i = 0; i < objectLists.size(); i++) {
  863 + String clbm=objectLists.get(i)[0].toString();
  864 + int cs=Integer.parseInt(objectLists.get(i)[1].toString());
  865 + //一车一单
  866 +
  867 + if(sxtj.equals("1")){
  868 + if(cs==1){
  869 + stringList.add(clbm);
  870 + }
  871 + }
  872 + //一车多单
  873 + if(sxtj.equals("2")){
  874 + if(cs>1){
  875 + stringList.add(clbm);
  876 + }
  877 + }
850 878 }
851 879 }
852 880 }
... ... @@ -862,9 +890,10 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
862 890 // strings[i]=stringList.get(i);
863 891 // }
864 892 sumYlbList=repository.sumYlb(rq, gsbm, fgsbm, xlbm, stringList);
865   - }else{
866   - sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm, nbbm);
867 893 }
  894 +// else{
  895 +// sumYlbList=repository.sumYlb2(rq, gsbm, fgsbm, xlbm, nbbm);
  896 +// }
868 897  
869 898 }
870 899  
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -3686,15 +3686,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3686 3686 @Override
3687 3687 public Map<String, Object> findKMBCQp(String clZbh, String date, String line) {
3688 3688 // TODO Auto-generated method stub
3689   - List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill2(clZbh, date, line);
  3689 + List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill2(clZbh, date, line);
3690 3690 DecimalFormat format = new DecimalFormat("0.00");
3691 3691 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
3692 3692 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
3693   - int jhbc = 0, cjbc = 0, ljbc = 0;
3694   - double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0,ljjcclc=0;
3695   - float addMileage = 0l, remMileage = 0l, addgl = 0, remgl = 0;
  3693 + int jhbc = 0, cjbc = 0, ljbc = 0,sjbc=0;
  3694 + double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0,ljjcclc=0,jhjcclc=0;
  3695 + double addMileage = 0, remMileage = 0, addgl = 0, remgl = 0;
3696 3696 Map<String, Object> map = new HashMap<String, Object>();
3697   - for (ScheduleRealInfo scheduleRealInfo : list) {
  3697 + /* for (ScheduleRealInfo scheduleRealInfo : list) {
3698 3698 if (scheduleRealInfo != null) {
3699 3699 //计划里程(主任务过滤掉临加班次),
3700 3700 //烂班里程(主任务烂班),
... ... @@ -3773,20 +3773,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3773 3773 addgl += sj - jh;
3774 3774 }
3775 3775 }
3776   - }
3777   - map.put("jhlc", format.format(jhlc + jcclc));
3778   - map.put("yygljh", format.format(jhlc));
3779   - map.put("ssgl", format.format(remMileage));
3780   - map.put("ksgl", format.format(ksgl));
3781   - map.put("yyglsj", format.format(yygl));
  3776 + }*/
  3777 + jhlc=culateMieageService.culateJhgl(lists);
  3778 + jcclc=culateMieageService.culateJccgl(lists);
  3779 + jhjcclc=culateMieageService.culateJhJccgl(lists);
  3780 + remMileage=culateMieageService.culateLbgl(lists);
  3781 + ksgl=culateMieageService.culateKsgl(lists);
  3782 + yygl=culateMieageService.culateSjgl(lists);
  3783 + jhbc=culateMieageService.culateJhbc(lists, "");
  3784 + addMileage=culateMieageService.culateLjgl(lists);
  3785 + cjbc=culateMieageService.culateLbbc(lists);
  3786 + sjbc=culateMieageService.culateSjbc(lists, "");
  3787 + ljbc=culateMieageService.culateLjbc(lists, "");
  3788 + double zyygl=Arith.add(yygl,addMileage);
  3789 + double zksgl=Arith.add(ksgl, jcclc);
  3790 + map.put("jhlc", Arith.add(jhlc , jhjcclc));
  3791 + map.put("yygljh", jhlc);
  3792 + map.put("ssgl", remMileage);
  3793 + map.put("ksgl", ksgl);
  3794 + map.put("yyglsj", Arith.add(yygl,addMileage));
  3795 + map.put("jcclc", jcclc);
3782 3796 map.put("jhbc", jhbc);
3783   - map.put("jcclc", format.format(jcclc+ljjcclc));
3784   -
3785   - map.put("ljgl", format.format(addMileage));
  3797 + map.put("ljgl",addMileage);
3786 3798 map.put("ssbc", cjbc);
3787   - map.put("ysgl", format.format(yygl));
3788   - map.put("sjbc", jhbc - cjbc + ljbc);
3789   - map.put("zgl", format.format(yygl + ksgl + jcclc+ljjcclc));
  3799 + map.put("ysgl", Arith.add(yygl,addMileage));
  3800 + map.put("sjbc",sjbc);
  3801 + map.put("zgl", Arith.add(zyygl, zksgl));
3790 3802 map.put("ljbc", ljbc);
3791 3803  
3792 3804 return map;
... ... @@ -3881,11 +3893,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3881 3893 String zdp = "", zwdp = "", wdp = "";
3882 3894 String zdpT = "", zwdpT = "", wdpT = "";
3883 3895  
3884   - List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:00", fcrq + "23:59");
  3896 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
3885 3897 try {
3886   - Long fcsj1 = sdf.parse(fcrq + " 03:00").getTime();
  3898 + Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
3887 3899 Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
3888   - Long fcsj3 = sdf.parse(fcrq + " 22:00").getTime();
  3900 + Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
3889 3901 for (int i = 0; i < list.size(); i++) {
3890 3902 DutyEmployee t = list.get(i);
3891 3903 Long ts = t.getTs();
... ...
src/main/java/com/bsth/service/report/CulateMileageService.java
... ... @@ -24,6 +24,8 @@ public interface CulateMileageService {
24 24 double culateKsgl(List<ScheduleRealInfo> lists);
25 25 double culateJccgl(List<ScheduleRealInfo> lists);
26 26  
  27 + double culateJhJccgl(List<ScheduleRealInfo> lists);
  28 +
27 29 double culateCJLC(List<ScheduleRealInfo> lists,String item);
28 30  
29 31 int culateFzbc(List<ScheduleRealInfo> lists,String item);
... ...
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
... ... @@ -92,7 +92,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
92 92 if (!isInOut(scheduleRealInfo)) {
93 93 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
94 94 if(childTaskPlans.isEmpty()){
95   - if(scheduleRealInfo.getStatus() == -1){
  95 + if(scheduleRealInfo.isDestroy()){
96 96 zlblc=Arith.add(zlblc,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig());
97 97 }else{
98 98 double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
... ... @@ -198,11 +198,14 @@ public class CulateMileageServiceImpl implements CulateMileageService{
198 198 if(scheduleRealInfo.isSflj()){
199 199 ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
200 200 }else{
201   - double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
202   - double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
203   - double zjlc=Arith.sub(jhlc, jhlcOrig);
204   - if(zjlc>0){
205   - ljgl=Arith.add(zjlc, ljgl);
  201 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  202 + if(!childTaskPlans.isEmpty()){
  203 + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  204 + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
  205 + double zjlc=Arith.sub(jhlc, jhlcOrig);
  206 + if(zjlc>0){
  207 + ljgl=Arith.add(zjlc, ljgl);
  208 + }
206 209 }
207 210 }
208 211 }
... ... @@ -309,9 +312,15 @@ public class CulateMileageServiceImpl implements CulateMileageService{
309 312 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
310 313 if(!scheduleRealInfo.isSflj()){
311 314 if(childTaskPlans.isEmpty()){
312   - if(scheduleRealInfo.getStatus() != -1){
313   - double jggl=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
314   - sjgl=Arith.add(sjgl,jggl);
  315 + if(!scheduleRealInfo.isDestroy()){
  316 + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
  317 + double jhlc=scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  318 + if(jhlc-jhlcOrig>0){
  319 + sjgl=Arith.add(sjgl,jhlcOrig);
  320 + }else{
  321 + sjgl=Arith.add(sjgl,jhlc);
  322 + }
  323 +
315 324 }
316 325 }else{
317 326 Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
... ... @@ -457,7 +466,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
457 466 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
458 467 if(childTaskPlans.isEmpty()){
459 468 if(!scheduleRealInfo.isDestroy())
460   - jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig());
  469 + jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
461 470 }else{
462 471 Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
463 472 while (it.hasNext()) {
... ... @@ -475,6 +484,27 @@ public class CulateMileageServiceImpl implements CulateMileageService{
475 484 return jcclc;
476 485 }
477 486  
  487 + @Override
  488 + public double culateJhJccgl(List<ScheduleRealInfo> lists) {
  489 + // TODO Auto-generated method stub
  490 + double jcclc =0;
  491 + for (int i = 0; i < lists.size(); i++) {
  492 + ScheduleRealInfo scheduleRealInfo=lists.get(i);
  493 + if(!scheduleRealInfo.isSflj()){
  494 + if (scheduleRealInfo.getBcType().equals("in")
  495 + || scheduleRealInfo.getBcType().equals("out")) {
  496 + double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
  497 + if(jhlcOrig-scheduleRealInfo.getJhlc()>0){
  498 + jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig());
  499 + }else{
  500 + jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
  501 + }
  502 + }
  503 + }
  504 + }
  505 + return jcclc;
  506 + }
  507 +
478 508 public static boolean isInOut(ScheduleRealInfo s){
479 509 boolean fage=false;
480 510 if(s.getBcType().equals("in")){
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -1397,30 +1397,28 @@ public class ReportServiceImpl implements ReportService{
1397 1397 List<Map<String, String>> list = new ArrayList<Map<String, String>>();
1398 1398 Map<String, String> map;
1399 1399 // Set<String> allSet = BasicData.nbbm2CompanyCodeMap.keySet();
1400   - Set<String> allJsy = BasicData.jsyMap.keySet();
  1400 + Set<String> allJsy = BasicData.perMap.keySet();
1401 1401  
1402 1402 Personnel per;
1403 1403 for (String k : allJsy) {
1404 1404 if (k.indexOf(jsy) != -1) {
1405   - // 所属线路
1406   - boolean fage=true;
1407 1405 map = new HashMap<>();
1408   - per = BasicData.jsyMap.get(k);
1409   - String rygsdm= per.getCompanyCode();
1410   -
1411   - map.put("id", k);
1412   - map.put("text", k+"/"+per.getPersonnelName());
1413   -
1414   - if(!gsbm.equals("")){
1415   - if(!rygsdm.equals(gsbm)){
1416   - fage=false;
1417   - }
1418   - }
1419   -
1420   - if(fage){
1421   - list.add(map);
  1406 + // 通过人员查找公司
  1407 + per = BasicData.perMap.get(k);
  1408 + String rygsdm="";
  1409 + if(null != per){
  1410 + if(per.getCompanyCode()!=null){
  1411 + rygsdm = per.getCompanyCode();
  1412 + }
  1413 + String jboCode=per.getJobCode().substring(per.getJobCode().indexOf("-")+1);
  1414 + map.put("id", jboCode);
  1415 + map.put("text", jboCode+"/"+per.getPersonnelName());
  1416 + if(!gsbm.equals("")){
  1417 + if(rygsdm.equals(gsbm)){
  1418 + list.add(map);
  1419 + }
  1420 + }
1422 1421 }
1423   -
1424 1422 }
1425 1423  
1426 1424 if (list.size() > 20)
... ...
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
... ... @@ -15,6 +15,7 @@ import com.bsth.repository.StationRepository;
15 15 import com.bsth.repository.schedule.GuideboardInfoRepository;
16 16 import com.bsth.repository.schedule.TTInfoDetailRepository;
17 17 import com.bsth.repository.schedule.TTInfoRepository;
  18 +import com.bsth.repository.sys.SysUserRepository;
18 19 import com.bsth.service.CarParkService;
19 20 import com.bsth.service.LineInformationService;
20 21 import com.bsth.service.StationRouteService;
... ... @@ -37,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
37 38 import org.springframework.beans.factory.annotation.Qualifier;
38 39 import org.springframework.boot.context.properties.EnableConfigurationProperties;
39 40 import org.springframework.stereotype.Service;
  41 +import org.springframework.transaction.annotation.Transactional;
40 42 import org.springframework.util.CollectionUtils;
41 43  
42 44 import java.io.File;
... ... @@ -76,6 +78,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
76 78 @Autowired
77 79 private CarParkRepository carParkRepository;
78 80 @Autowired
  81 + private SysUserRepository sysUserRepository;
  82 + @Autowired
79 83 private GuideboardInfoRepository guideboardInfoRepository;
80 84 @Autowired
81 85 @Qualifier(value = "dataToolsServiceImpl")
... ... @@ -533,14 +537,29 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
533 537 public List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId) {
534 538 return ttInfoDetailRepository.findBcdetails(xlId, ttinfoId, lpId);
535 539 }
536   -
537   - @Override
  540 +
  541 + /**
  542 + * @description : (TODO) 时刻表明细模型数据保存.
  543 + *
  544 + * @param : [map]
  545 + *
  546 + * @return : 返回保存操作后的状态.
  547 + *
  548 + * @exception : 处理所有抛出来的异常.
  549 + * */
  550 + @Transactional
538 551 public Map<String, Object> skbDetailMxSave(Map<String, Object> map) {
539 552 Map<String, Object> rs_m = new HashMap<String,Object>();
540 553 try {
  554 + // 1、获取数据.
541 555 String d = map.get("d") == null ? null : map.get("d").toString();
  556 + //boolean b = map.get("istidc") ==null ? false : Boolean.parseBoolean(map.get("istidc").toString());
  557 + Long ttinfoid = map.get("skb") ==null ? null : Long.parseLong(map.get("skb").toString());
  558 + Integer xlid = map.get("xl") ==null ? null : Integer.parseInt(map.get("xl").toString());
  559 + if(xlid !=null && ttinfoid !=null)
  560 + ttInfoDetailRepository.deltidc(xlid,ttinfoid);
542 561 if(d!=null)
543   - ttInfoDetailRepository.save(jsonArrayToListEntity(d));
  562 + ttInfoDetailRepository.save(jsonArrayToListEntity(d));// 2、保存.
544 563 } catch (Exception e) {
545 564 e.printStackTrace();
546 565 rs_m.put("status", ResponseCode.ERROR);
... ... @@ -549,68 +568,153 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
549 568 return rs_m;
550 569 }
551 570  
  571 + /**
  572 + * @description : (TODO) json班次数据转list班次.
  573 + *
  574 + * @param : [jsonStr--班次json字符串]
  575 + *
  576 + * @return :返回一个list分装的班次数据.
  577 + *
  578 + * @status : OK.
  579 + * */
552 580 public List<TTInfoDetail> jsonArrayToListEntity(String jsonStr) throws Exception {
  581 + // 1、创建list分装的时刻表明细实体对象数据.
553 582 List<TTInfoDetail> listTd = new ArrayList<TTInfoDetail>();
  583 + // 2、json字符串转json数组.
554 584 JSONArray jsonArray = JSONArray.parseArray(jsonStr);
  585 + // 3、json数组转list分装的时刻表明细实体对象数据.
555 586 for(int i =0; i<jsonArray.size();i++) {
556 587 JSONObject jsonObj = jsonArray.getJSONObject(i);
557   - if(jsonObj.getString("bcType").equals("bd") || jsonObj.getString("bcType").equals("lc") || jsonObj.getString("bcType").equals("cf"))
558   - continue;
559 588 listTd.add(objToEntity(jsonObj));
560 589 }
561 590 return listTd;
562 591 }
563 592  
  593 + /**
  594 + * @description : (TODO) 班次map对象转实体对象.
  595 + *
  596 + * @param : [obj-班次map对象].
  597 + *
  598 + * @return : 返回一个班次实体对象.
  599 + *
  600 + * @exception 异常暂先抛出去.
  601 + * */
564 602 public TTInfoDetail objToEntity(JSONObject obj) throws Exception {
  603 + // 1、创建班次实体对象.
565 604 TTInfoDetail td = new TTInfoDetail();
  605 + // 2、获取线路id键值,并查询出该线路的实体对象.
566 606 Line xl = lineRepository.findOne(Integer.parseInt(obj.getString("xl")));
  607 + // 3、设置线路.
567 608 td.setXl(xl);
  609 + // 4、设置时刻表.
568 610 td.setTtinfo(obj.getString("ttinfo") == null ? null : infoRepository.findOne(Long.parseLong(obj.getString("ttinfo"))));
569   - td.setLp(getLp(xl,obj.getString("lp"),Integer.parseInt(obj.getString("lp")),obj.getString("lpType")));
570   - td.setFcno(Integer.parseInt(obj.getString("fcno")));
  611 + // 5、设置路牌.
  612 + td.setLp(obj.getString("lp") == null ? getLp(xl,obj.getString("lpName"),Integer.parseInt(obj.getString("lpNo")),obj.getString("lpType")) :
  613 + guideboardInfoRepository.findOne(Long.parseLong(obj.getString("lp"))));
  614 + // 6、设置发车序号.
  615 + td.setFcno(obj.getString("fcno") == null ? null : Integer.parseInt(obj.getString("fcno")));
  616 + // 7、设置线路方向
571 617 td.setXlDir(dirToCod(obj.get("xlDir").toString()));
572   - td.setQdz( obj.getString("qdz") ==null? null : staRepository.findOne(Integer.parseInt(obj.getString("qdz"))));
  618 + // 8、设置起始站.
  619 + td.setQdz(obj.getString("qdz") ==null? null : staRepository.findOne(Integer.parseInt(obj.getString("qdz"))));
  620 + // 9、设置终点站.
573 621 td.setZdz(obj.getString("zdz") ==null ? null :staRepository.findOne(Integer.parseInt(obj.getString("zdz"))));
574   - td.setTcc(carParkRepository.findOne(Integer.parseInt(obj.getString("tcc"))));
575   - td.setFcsj(obj.getString("fcsj"));
576   - td.setBcs(Integer.parseInt(obj.getString("bcs")));
577   - td.setJhlc(Double.parseDouble(obj.getString("jhlc")));
578   - td.setBcsj(Integer.parseInt(obj.getString("bcsj")));
579   - td.setBcType(obj.getString("bcType"));
580   - td.setIsFB(false);
581   - td.setIsSwitchXl(false);
582   - td.setSwitchXl(null);
583   - td.setSwitchXlDesc(null);
584   - td.setRemark(null);
585   - td.setCreateBy(null);
586   - td.setUpdateBy(null);
  622 + // 10、设置停车场.
  623 + td.setTcc(obj.getString("tcc") == null ? null : carParkRepository.findOne(Integer.parseInt(obj.getString("tcc"))));
  624 + // 11、设置发车时间.
  625 + td.setFcsj(obj.getString("fcsj")==null ? null : obj.getString("fcsj"));
  626 + // 12、设置班次序号.
  627 + td.setBcs(obj.getString("bcs") == null ? null : Integer.parseInt(obj.getString("bcs")));
  628 + // 13、设置计划里程.
  629 + td.setJhlc(obj.getString("jhlc")==null ? null : Double.parseDouble(obj.getString("jhlc")));
  630 + // 14、设置班次历时.
  631 + td.setBcsj(obj.getString("bcsj") == null ? null : Integer.parseInt(obj.getString("bcsj")));
  632 + // 15、设置班次类型.
  633 + td.setBcType(obj.getString("bcType")==null ? null : obj.getString("bcType"));
  634 + // 16、设置是否分班.
  635 + td.setIsFB(obj.getString("isfb") ==null ? null : intToBit(Integer.parseInt(obj.getString("isfb"))));
  636 + // 17、设置是否切换线路.
  637 + td.setIsSwitchXl(obj.getString("isSwitchXl") ==null ? null : intToBit(Integer.parseInt(obj.getString("isSwitchXl"))));
  638 + // 18、设置切换线路.
  639 + td.setSwitchXl(obj.getString("witchXl") ==null? null : lineRepository.findOne(Integer.parseInt(obj.getString("witchXl"))));
  640 + td.setSwitchXlDesc(obj.getString("switchXlDesc")==null ? null : obj.getString("switchXlDesc"));
  641 + // 19、设置说明描述
  642 + td.setRemark(obj.getString("remark")== null ? null : obj.getString("remark"));
  643 + // 20、设置创建人.
  644 + td.setCreateBy(obj.getString("createBy") == null ? null : sysUserRepository.findOne(Integer.parseInt(obj.getString("remark"))));
  645 + // 21、设置修改人.
  646 + td.setUpdateBy(obj.getString("updateBy") == null ? null : sysUserRepository.findOne(Integer.parseInt(obj.getString("updateBy"))));
  647 + // 22、返回实体对象.
587 648 return td;
588 649 }
589 650  
  651 + /**
  652 + * @description : (TODO) int转boolean类型.
  653 + *
  654 + * @param : [value--int类型的数值]
  655 + *
  656 + * @return : 返回一个布尔类型值.
  657 + * */
  658 + public Boolean intToBit(int value) {
  659 + Boolean tag = null;
  660 + if(value==0)
  661 + tag = false;
  662 + else if(value ==1)
  663 + tag = true;
  664 + return tag;
  665 + }
  666 +
  667 + /**
  668 + * @description : (TODO) 获取路牌.
  669 + *
  670 + * @param [xl--线路,name--路牌名称,code--路牌编码,lpType--路牌类型]
  671 + *
  672 + * @return 返回路牌.
  673 + * */
590 674 public GuideboardInfo getLp(Line xl,String name, int code, String lpType) throws Exception {
  675 + // 1、创建路牌实体对象.
591 676 GuideboardInfo entity = new GuideboardInfo();
  677 + // 2、验证是否存在该路牌.如果数据库存在,则使用已有的.否则保存一块新的路牌.
592 678 List<GuideboardInfo> lgi = guideboardInfoRepository.validateLp(xl, name, code,lpType);
593 679 if(lgi.size()>0) {
594 680 entity = lgi.get(0);
595 681 }else{
  682 + // 1、设置线路.
596 683 entity.setXl(xl);
  684 + // 2、设置路牌编码.
597 685 entity.setLpNo(code);
  686 + // 3、设置路牌名称.
598 687 entity.setLpName(name);
  688 + // 4、设置路牌类型.
599 689 entity.setLpType(lpType);
  690 + // 5、标记是否已删除.
600 691 entity.setIsCancel(false);
  692 + // 6、设置创建人.
601 693 entity.setCreateBy(null);
  694 + // 7、设置修改人.
602 695 entity.setUpdateBy(null);
  696 + // 8、保存路牌.
603 697 guideboardInfoRepository.save(entity);
604 698 }
  699 + // 9、返回路牌.
605 700 return entity;
606 701 }
607 702  
  703 + /**
  704 + * @description : (TODO) 线路方向转代码.
  705 + *
  706 + * @param : [str--方向字符串]
  707 + *
  708 + * @return 返回方向代码.
  709 + *
  710 + * @exception : 异常暂先抛出.
  711 + * */
608 712 public String dirToCod(String str) throws Exception {
609 713 String c = "";
610 714 if(str.equals("relationshipGraph-up"))
611   - c = "0";
  715 + c = "0";// 上行.
612 716 else if(str.equals("relationshipGraph-down"))
613   - c = "1";
  717 + c = "1";// 下行.
614 718 return c;
615 719 }
616 720 }
... ...
src/main/java/com/bsth/service/schedule/rules/ttinfo/MinRuleQyrqFunction.java
... ... @@ -21,6 +21,7 @@ public class MinRuleQyrqFunction implements AccumulateFunction {
21 21  
22 22 protected static class MinRuleQyrqData implements Externalizable {
23 23 public DateTime min;
  24 + public DateTime maxMin = new DateTime(2014,1,1,0,0); // 最大的最小值,比它小的不计算
24 25  
25 26 public MinRuleQyrqData() {}
26 27  
... ... @@ -42,7 +43,7 @@ public class MinRuleQyrqFunction implements AccumulateFunction {
42 43  
43 44 @Override
44 45 public void init(Serializable context) throws Exception {
45   - // TODO:
  46 + MinRuleQyrqData minRuleQyrqData = (MinRuleQyrqData) context;
46 47 }
47 48  
48 49 @Override
... ... @@ -50,11 +51,14 @@ public class MinRuleQyrqFunction implements AccumulateFunction {
50 51 MinRuleQyrqData minRuleQyrqData = (MinRuleQyrqData) context;
51 52 ScheduleRule_input scheduleRule_input = (ScheduleRule_input) value;
52 53  
53   - if (minRuleQyrqData.min == null) {
54   - minRuleQyrqData.min = scheduleRule_input.getQyrq();
55   - } else if (scheduleRule_input.getQyrq().isBefore(minRuleQyrqData.min)) {
56   - minRuleQyrqData.min = scheduleRule_input.getQyrq();
  54 + if (scheduleRule_input.getQyrq().isAfter(minRuleQyrqData.maxMin)) {
  55 + if (minRuleQyrqData.min == null) {
  56 + minRuleQyrqData.min = scheduleRule_input.getQyrq();
  57 + } else if (scheduleRule_input.getQyrq().isBefore(minRuleQyrqData.min)) {
  58 + minRuleQyrqData.min = scheduleRule_input.getQyrq();
  59 + }
57 60 }
  61 +
58 62 }
59 63  
60 64 @Override
... ...
src/main/resources/application-dev.properties
... ... @@ -8,9 +8,12 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 8 spring.jpa.database= MYSQL
9 9 spring.jpa.show-sql= true
10 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11   -spring.datasource.url= jdbc:mysql://127.0.0.1:3306/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  11 +spring.datasource.url= jdbc:mysql://localhost/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 12 spring.datasource.username= root
13   -spring.datasource.password=
  13 +spring.datasource.password= root123
  14 +#spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  15 +#spring.datasource.username= root
  16 +#spring.datasource.password= root
14 17 #DATASOURCE
15 18 spring.datasource.max-active=100
16 19 spring.datasource.max-idle=8
... ... @@ -26,7 +29,7 @@ spring.datasource.validation-query=select 1
26 29 ##
27 30 #222.66.0.204:5555
28 31 ##\u5B9E\u65F6gps
29   -http.gps.real.url= http://192.168.168.201:9090/transport_server/rtgps/
  32 +http.gps.real.url= http://180.168.57.114:7474/transport_server/rtgps/
30 33 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/
31 34 ##\u6D88\u606F\u4E0B\u53D1
32 35 http.send.directive = http://192.168.168.201:9090/transport_server/message/
33 36 \ No newline at end of file
... ...
src/main/resources/datatools/ktrs/carsDataInput.ktr
... ... @@ -433,12 +433,6 @@
433 433 <schema/>
434 434 <table>bsth_c_cars</table>
435 435 <key>
436   - <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
437   - <field>business_code</field>
438   - <condition>&#x3d;</condition>
439   - <name2/>
440   - </key>
441   - <key>
442 436 <name>&#x5185;&#x90e8;&#x7f16;&#x7801;</name>
443 437 <field>inside_code</field>
444 438 <condition>&#x3d;</condition>
... ... @@ -689,3 +683,4 @@
689 683 <slave_transformation>N</slave_transformation>
690 684  
691 685 </transformation>
  686 +
... ...
src/main/resources/datatools/ktrs/employeesDataInput.ktr
... ... @@ -254,6 +254,36 @@
254 254 <hop> <from>JavaScript&#x4ee3;&#x7801;</from><to>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_personnel</to><enabled>Y</enabled> </hop>
255 255 </order>
256 256 <step>
  257 + <name>JavaScript&#x4ee3;&#x7801;</name>
  258 + <type>ScriptValueMod</type>
  259 + <description/>
  260 + <distribute>Y</distribute>
  261 + <custom_distribution/>
  262 + <copies>1</copies>
  263 + <partitioning>
  264 + <method>none</method>
  265 + <schema_name/>
  266 + </partitioning>
  267 + <compatible>N</compatible>
  268 + <optimizationLevel>9</optimizationLevel>
  269 + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
  270 + <jsScript_name>Script 1</jsScript_name>
  271 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var gh_calcu &#x3d; &#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801; &#x2b; &#x22;-&#x22; &#x2b; &#x5de5;&#x53f7;&#x3b;</jsScript_script>
  272 + </jsScript> </jsScripts> <fields> <field> <name>gh_calcu</name>
  273 + <rename>gh_calcu</rename>
  274 + <type>String</type>
  275 + <length>-1</length>
  276 + <precision>-1</precision>
  277 + <replace>N</replace>
  278 + </field> </fields> <cluster_schema/>
  279 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  280 + <xloc>362</xloc>
  281 + <yloc>190</yloc>
  282 + <draw>Y</draw>
  283 + </GUI>
  284 + </step>
  285 +
  286 + <step>
257 287 <name>&#x539f;&#x59cb;&#x7cfb;&#x7edf;&#x5bfc;&#x51fa;&#x7684;Excel&#x8f93;&#x5165;</name>
258 288 <type>ExcelInput</type>
259 289 <description/>
... ... @@ -411,12 +441,6 @@
411 441 <schema/>
412 442 <table>bsth_c_personnel</table>
413 443 <key>
414   - <name>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</name>
415   - <field>company_code</field>
416   - <condition>&#x3d;</condition>
417   - <name2/>
418   - </key>
419   - <key>
420 444 <name>gh_calcu</name>
421 445 <field>job_code</field>
422 446 <condition>&#x3d;</condition>
... ... @@ -462,6 +486,92 @@
462 486 </step>
463 487  
464 488 <step>
  489 + <name>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</name>
  490 + <type>GetVariable</type>
  491 + <description/>
  492 + <distribute>Y</distribute>
  493 + <custom_distribution/>
  494 + <copies>1</copies>
  495 + <partitioning>
  496 + <method>none</method>
  497 + <schema_name/>
  498 + </partitioning>
  499 + <fields>
  500 + <field>
  501 + <name>filepath_</name>
  502 + <variable>&#x24;&#x7b;filepath&#x7d;</variable>
  503 + <type>String</type>
  504 + <format/>
  505 + <currency/>
  506 + <decimal/>
  507 + <group/>
  508 + <length>-1</length>
  509 + <precision>-1</precision>
  510 + <trim_type>none</trim_type>
  511 + </field>
  512 + <field>
  513 + <name>erroroutputdir_</name>
  514 + <variable>&#x24;&#x7b;erroroutputdir&#x7d;</variable>
  515 + <type>String</type>
  516 + <format/>
  517 + <currency/>
  518 + <decimal/>
  519 + <group/>
  520 + <length>-1</length>
  521 + <precision>-1</precision>
  522 + <trim_type>none</trim_type>
  523 + </field>
  524 + </fields>
  525 + <cluster_schema/>
  526 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  527 + <xloc>90</xloc>
  528 + <yloc>148</yloc>
  529 + <draw>Y</draw>
  530 + </GUI>
  531 + </step>
  532 +
  533 + <step>
  534 + <name>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</name>
  535 + <type>FilterRows</type>
  536 + <description/>
  537 + <distribute>Y</distribute>
  538 + <custom_distribution/>
  539 + <copies>1</copies>
  540 + <partitioning>
  541 + <method>none</method>
  542 + <schema_name/>
  543 + </partitioning>
  544 +<send_true_to/>
  545 +<send_false_to/>
  546 + <compare>
  547 +<condition>
  548 + <negated>N</negated>
  549 + <conditions>
  550 + <condition>
  551 + <negated>N</negated>
  552 + <leftvalue>&#x5de5;&#x53f7;</leftvalue>
  553 + <function>IS NOT NULL</function>
  554 + <rightvalue/>
  555 + </condition>
  556 + <condition>
  557 + <negated>N</negated>
  558 + <operator>AND</operator>
  559 + <leftvalue>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</leftvalue>
  560 + <function>IS NOT NULL</function>
  561 + <rightvalue/>
  562 + </condition>
  563 + </conditions>
  564 + </condition>
  565 + </compare>
  566 + <cluster_schema/>
  567 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  568 + <xloc>358</xloc>
  569 + <yloc>57</yloc>
  570 + <draw>Y</draw>
  571 + </GUI>
  572 + </step>
  573 +
  574 + <step>
465 575 <name>&#x9519;&#x8bef;&#x8f93;&#x51fa;</name>
466 576 <type>ExcelOutput</type>
467 577 <description/>
... ... @@ -583,122 +693,6 @@
583 693 </GUI>
584 694 </step>
585 695  
586   - <step>
587   - <name>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</name>
588   - <type>GetVariable</type>
589   - <description/>
590   - <distribute>Y</distribute>
591   - <custom_distribution/>
592   - <copies>1</copies>
593   - <partitioning>
594   - <method>none</method>
595   - <schema_name/>
596   - </partitioning>
597   - <fields>
598   - <field>
599   - <name>filepath_</name>
600   - <variable>&#x24;&#x7b;filepath&#x7d;</variable>
601   - <type>String</type>
602   - <format/>
603   - <currency/>
604   - <decimal/>
605   - <group/>
606   - <length>-1</length>
607   - <precision>-1</precision>
608   - <trim_type>none</trim_type>
609   - </field>
610   - <field>
611   - <name>erroroutputdir_</name>
612   - <variable>&#x24;&#x7b;erroroutputdir&#x7d;</variable>
613   - <type>String</type>
614   - <format/>
615   - <currency/>
616   - <decimal/>
617   - <group/>
618   - <length>-1</length>
619   - <precision>-1</precision>
620   - <trim_type>none</trim_type>
621   - </field>
622   - </fields>
623   - <cluster_schema/>
624   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
625   - <xloc>90</xloc>
626   - <yloc>148</yloc>
627   - <draw>Y</draw>
628   - </GUI>
629   - </step>
630   -
631   - <step>
632   - <name>&#x8fc7;&#x6ee4;&#x8bb0;&#x5f55;</name>
633   - <type>FilterRows</type>
634   - <description/>
635   - <distribute>Y</distribute>
636   - <custom_distribution/>
637   - <copies>1</copies>
638   - <partitioning>
639   - <method>none</method>
640   - <schema_name/>
641   - </partitioning>
642   -<send_true_to/>
643   -<send_false_to/>
644   - <compare>
645   -<condition>
646   - <negated>N</negated>
647   - <conditions>
648   - <condition>
649   - <negated>N</negated>
650   - <leftvalue>&#x5de5;&#x53f7;</leftvalue>
651   - <function>IS NOT NULL</function>
652   - <rightvalue/>
653   - </condition>
654   - <condition>
655   - <negated>N</negated>
656   - <operator>AND</operator>
657   - <leftvalue>&#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801;</leftvalue>
658   - <function>IS NOT NULL</function>
659   - <rightvalue/>
660   - </condition>
661   - </conditions>
662   - </condition>
663   - </compare>
664   - <cluster_schema/>
665   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
666   - <xloc>358</xloc>
667   - <yloc>57</yloc>
668   - <draw>Y</draw>
669   - </GUI>
670   - </step>
671   -
672   - <step>
673   - <name>JavaScript&#x4ee3;&#x7801;</name>
674   - <type>ScriptValueMod</type>
675   - <description/>
676   - <distribute>Y</distribute>
677   - <custom_distribution/>
678   - <copies>1</copies>
679   - <partitioning>
680   - <method>none</method>
681   - <schema_name/>
682   - </partitioning>
683   - <compatible>N</compatible>
684   - <optimizationLevel>9</optimizationLevel>
685   - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
686   - <jsScript_name>Script 1</jsScript_name>
687   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var gh_calcu &#x3d; &#x6240;&#x5c5e;&#x516c;&#x53f8;&#x4ee3;&#x7801; &#x2b; &#x22;-&#x22; &#x2b; &#x5de5;&#x53f7;&#x3b;</jsScript_script>
688   - </jsScript> </jsScripts> <fields> <field> <name>gh_calcu</name>
689   - <rename>gh_calcu</rename>
690   - <type>String</type>
691   - <length>-1</length>
692   - <precision>-1</precision>
693   - <replace>N</replace>
694   - </field> </fields> <cluster_schema/>
695   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
696   - <xloc>362</xloc>
697   - <yloc>190</yloc>
698   - <draw>Y</draw>
699   - </GUI>
700   - </step>
701   -
702 696 <step_error_handling>
703 697 <error>
704 698 <source_step>&#x63d2;&#x5165;&#x2f;&#x66f4;&#x65b0;bsth_c_personnel</source_step>
... ... @@ -718,3 +712,4 @@
718 712 <slave_transformation>N</slave_transformation>
719 713  
720 714 </transformation>
  715 +
... ...
src/main/resources/datatools/ktrs/scheduleRuleDataInput.ktr
... ... @@ -1091,12 +1091,6 @@
1091 1091 <condition>&#x3d;</condition>
1092 1092 <name2/>
1093 1093 </key>
1094   - <key>
1095   - <name>&#x8def;&#x724c;&#x8303;&#x56f4;</name>
1096   - <field>lp_names</field>
1097   - <condition>&#x3d;</condition>
1098   - <name2/>
1099   - </key>
1100 1094 <value>
1101 1095 <name>xl</name>
1102 1096 <rename>xlid</rename>
... ...
src/main/resources/rules/shiftloop.drl renamed to src/main/resources/rules/legacy/shiftloop.drl
src/main/resources/rules/shiftloop_fb.drl renamed to src/main/resources/rules/legacy/shiftloop_fb.drl
src/main/resources/rules/shiftloop_fb_2.drl
... ... @@ -131,8 +131,10 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot;
131 131 fromDate.isBefore(toDate) || fromDate.isEqual(toDate),
132 132 $fromDate : fromDate,
133 133 $toDate : toDate,
134   - $xlId: xlId
  134 + $xlId: xlId,
  135 + $self: schedulePlan
135 136 )
  137 + eval($self.getIsHistoryPlanFirst() == true) // 是否使用历史排班标识
136 138 $sprr: SchedulePlanRuleResult() from schedulePlanRuleResultRepository.findLastByXl($xlId, $fromDate.toDate())
137 139  
138 140 then
... ...
src/main/resources/static/index.html
... ... @@ -196,7 +196,7 @@ tr.row-active td {
196 196 <!-- LOGO -->
197 197 <div class="page-logo">
198 198 <a href="index.html" class="logo-default logo-default-text">
199   - 闵行公交调度系统 </a>
  199 + 浦东公交调度系统 </a>
200 200 <div class="menu-toggler sidebar-toggler"></div>
201 201 </div>
202 202 <!-- END LOGO -->
... ...
src/main/resources/static/login.html
... ... @@ -181,7 +181,7 @@
181 181 <div class="wrapper ng-scope">
182 182 <div id="loginPanel" class="dialog dialog-shadow">
183 183 <br>
184   - <h3 class="logo-text">闵行公交调度系统</h3>
  184 + <h3 class="logo-text">浦东公交调度系统</h3>
185 185 <hr>
186 186 <form style="padding: 0px 35px;">
187 187 <div class="form-group" style="margin-bottom: 0">
... ...
src/main/resources/static/pages/base/line/js/line-list-table.js
... ... @@ -22,117 +22,127 @@
22 22  
23 23 $('#destroy').val(0);
24 24  
25   - /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */
26   - loadTableDate({'destroy_eq':0},true);
  25 + function initConpanySelect2(cb) {
  26 + /** 填充公司下拉框选择值 */
  27 + $get('/business/all', {upCode_eq: '88'}, function(array){
  28 + return cb && cb(array);
  29 + });
  30 + }
  31 +
  32 + function getComp(cb) {
  33 + $.get('/user/companyData',null,function(rs) {
  34 + return cb && cb(rs);
  35 + });
  36 + }
  37 +
  38 + initConpanySelect2(function(array) {
  39 + // 公司下拉options属性值
  40 + var options = '<option value="">请选择...</option>';
  41 + // 遍历array
  42 + $.each(array, function(i,d){
  43 + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
  44 +
  45 + });
  46 + // 填充公司下拉框options
  47 + $('#companySelect').html(options)
  48 + /** 闵行没下属公司,这里暂时注释公司值改变事件 */
  49 + //$('#companySelect').html(options).on('change', setbrancheCompanySelectOptions);
  50 +
  51 + /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */
  52 + loadTableDate({'destroy_eq':0},true);
  53 + });
27 54  
28 55 /** 重置按钮事件 */
29 56 $('tr.filter .filter-cancel').on('click',function() {
30   -
31 57 // 清空搜索框值
32 58 $('tr.filter input,select').val('').change();
33   -
34 59 /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */
35 60 loadTableDate(null,true);
36 61 });
37 62  
38 63 /** 搜索按钮事件 */
39 64 $('tr.filter .filter-submit').on('click',function(){
40   -
41 65 var params = getParams();
42   -
43 66 page = 0;
44   -
45 67 /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */
46 68 loadTableDate(params,true);
47 69 });
48 70  
49 71 function getParams() {
50   -
51 72 // cells 集合返回表格中所有(列)单元格的一个数组
52 73 var cells = $('tr.filter')[0].cells;
53   -
54 74 // 搜索参数集合
55 75 var params = {};
56   -
57 76 // 搜索字段名称
58 77 var name;
59   -
60 78 // 遍历cells数组
61 79 $.each(cells, function(i, cell){
62   -
63 80 // 获取第i列的input或者select集合
64 81 var items = $('input,select', cell);
65   -
66 82 // 遍历items集合
67 83 for(var j = 0, item; item = items[j++];){
68   -
69 84 // 获取字段名称
70 85 name = $(item).attr('name');
71   -
72 86 if(name){
73   -
74 87 // 赋取相对应的值
75 88 params[name] = $(item).val();
76   -
77 89 }
78 90 }
79 91 });
80   -
81 92 return params;
82   -
83 93 }
84 94  
85 95 /** 表格数据分页加载事件 @param:<param : 查询参数;isPon : 是否重新分页> */
86 96 function loadTableDate(param,isPon){
87   -
88 97 // 搜索参数
89 98 var params = {};
90   -
91 99 if(param) {
92   -
93 100 params = param;
94   -
95 101 }
96   -
97 102 // 排序(按更新时间)
98 103 params['order'] = 'id';
99   -
100 104 // 记录当前页数
101 105 params['page'] = page;
102   -
103 106 // 弹出正在加载层
104 107 var i = layer.load(2);
105   -
106   - // 异步请求获取表格数据
107   - $.get('/line',params,function(result){
108   -
109   - // 添加序号
110   - result.content.page = page;
111   -
112   - // 把数据填充到模版中
113   - var tbodyHtml = template('line_list_temp',{list:result.content});
114   -
115   - // 把渲染好的模版html文本追加到表格中
116   - $('#datatable_line tbody').html(tbodyHtml);
117   -
118   - // 制定复选框
119   - $('#datatable_line tbody').find('.icheck').iCheck(icheckOptions);
120   -
121   - // 复选框改变事件
122   - $('#datatable_line tbody').find('.icheck').on('ifChanged', iCheckChange);
123   -
124   - // 是重新分页且返回数据长度大于0
125   - if(isPon && result.content.length > 0){
126   -
127   - // 重新分页
128   - initPag = true;
129   -
130   - // 分页栏
131   - showPagination(result);
  108 + getComp(function(rs) {
  109 + if(rs.length>0) {
  110 + var compA = new Array();
  111 + for(var c = 0 ; c<rs.length;c++) {
  112 + var comC = rs[c].companyCode;
  113 + var child = rs[c].children;
  114 + if(child.length>0) {
  115 + for(var d = 0 ;d< child.length;d++) {
  116 + compA.push(comC + '_' + child[d].code);
  117 + }
  118 + }else {
  119 + compA.push(comC);
  120 + }
  121 + }
  122 + params.cgsbm_in = compA.toString();
132 123 }
133   -
134   - // 关闭弹出加载层
135   - layer.close(i);
  124 + // 异步请求获取表格数据
  125 + $.get('/line',params,function(result){
  126 + // 添加序号
  127 + result.content.page = page;
  128 + // 把数据填充到模版中
  129 + var tbodyHtml = template('line_list_temp',{list:result.content});
  130 + // 把渲染好的模版html文本追加到表格中
  131 + $('#datatable_line tbody').html(tbodyHtml);
  132 + // 制定复选框
  133 + $('#datatable_line tbody').find('.icheck').iCheck(icheckOptions);
  134 + // 复选框改变事件
  135 + $('#datatable_line tbody').find('.icheck').on('ifChanged', iCheckChange);
  136 + // 是重新分页且返回数据长度大于0
  137 + if(isPon && result.content.length > 0){
  138 + // 重新分页
  139 + initPag = true;
  140 + // 分页栏
  141 + showPagination(result);
  142 + }
  143 + // 关闭弹出加载层
  144 + layer.close(i);
  145 + });
136 146 });
137 147 }
138 148  
... ... @@ -201,27 +211,6 @@
201 211 });
202 212 }
203 213  
204   - /** 填充公司下拉框选择值 */
205   - $get('/business/all', {upCode_eq: '88'}, function(array){
206   -
207   - // 公司下拉options属性值
208   - var options = '<option value="">请选择...</option>';
209   -
210   - // 遍历array
211   - $.each(array, function(i,d){
212   -
213   - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
214   -
215   - });
216   -
217   - // 填充公司下拉框options
218   - $('#companySelect').html(options)
219   -
220   - /** 闵行没下属公司,这里暂时注释公司值改变事件 */
221   - //$('#companySelect').html(options).on('change', setbrancheCompanySelectOptions);
222   -
223   - });
224   -
225 214 /** 填充分公司下拉框。--- 闵行没下属公司,这里暂时注释*/
226 215 /* setbrancheCompanySelectOptions();*/
227 216  
... ... @@ -267,85 +256,55 @@
267 256 var len_ = array.length;
268 257  
269 258 if(len_>0) {
270   -
271 259 $.each(array, function(i, g){
272 260  
273 261 /*opGroup += '<option value="'+ g.id + '_' + g.lineCode +'">'+g.name+'</option>';*/
274 262 opGroup += '<option value="'+ g.name +'">'+g.name+'</option>';
275 263  
276 264 });
277   -
278 265 }
279   -
280 266 opGroup += '</optgroup>';
281   -
282 267 $('#lineSelect').html(opGroup).select2();
283   -
284 268 });
285 269  
286 270  
287 271 /** 生成行单,这里暂时只做了单选生成。 */
288 272 $('#datatable_ajax_tools #createUsingSingle').on('click', function() {
289   -
290 273 // 获取选中行
291 274 var arrChk = $("input[type='checkbox']:checked");
292   -
293 275 var len = arrChk.length;
294   -
295 276 // 选中行ID与线路名称
296 277 var id = '', lineName = '';
297   -
298 278 if(len>1) {
299   -
300 279 // 弹出添加成功提示消息
301 280 layer.msg('存在多选,请只选中一行!');
302   -
303 281 return ;
304   -
305 282 }else if(len==0) {
306   -
307 283 // 弹出添加成功提示消息
308 284 layer.msg('请选中一条线路!');
309   -
310 285 return ;
311   -
312 286 }else {
313   -
314 287 id = arrChk.data('id');
315   -
316 288 lineName = arrChk.val();
317   -
318 289 // 请求参数
319 290 var params = {lineId:id};
320   -
321 291 // 弹出正在加载层
322 292 var index = layer.load(0);
323   -
324 293 /** 生成线路行单 @pararm:<params:请求参数> */
325 294 $post('/stationroute/usingSingle',params,function(data) {
326   -
327 295 // 关闭弹出框
328 296 layer.close(index);
329   -
330 297 if(data.status=='SUCCESS') {
331   -
332 298 // 弹出添加成功提示消息
333 299 layer.msg('生成线路【'+ lineName +'】路单文件成功!');
334   -
335 300 }else if(data.status=='ERROR'){
336   -
337 301 // 弹出添加成功提示消息
338 302 layer.msg('生成线路【'+ lineName +'】路单文件失败!');
339   -
340 303 }else if(data.status=='NOTDATA') {
341   -
342 304 // 弹出添加成功提示消息
343 305 layer.msg('系统无线路【'+ lineName +'】的站点与路段信息!');
344   -
345 306 }
346   -
347 307 });
348   -
349 308 }
350 309 });
351 310 })();
352 311 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/add.html 0 → 100644
  1 +<style>
  2 +.form-control:focus {
  3 + border-color: #53ced9;
  4 +}
  5 +.tagsDiv {
  6 + border: 1px solid #c2cad8;
  7 + margin-left: 50px;
  8 + padding: 4px 15px 4px 15px;
  9 + width: 69%;
  10 +}
  11 +</style>
  12 +
  13 +<!-- 片段标题 START -->
  14 +<div class="page-head">
  15 + <div class="page-title">
  16 + <h1>时刻表明细制作建模</h1>
  17 + </div>
  18 +</div>
  19 +<!-- 片段标题 END -->
  20 +
  21 +
  22 +<!-- 线路信息导航栏组件 START -->
  23 +<ul class="page-breadcrumb breadcrumb">
  24 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  25 + <li><span class="active">运营计划管理</span> <i class="fa fa-circle"></i></li>
  26 + <li><span class="active">时刻表明细制作建模</span></li>
  27 +</ul>
  28 +<!-- 线路信息导航栏组件 END -->
  29 +
  30 +
  31 +<div class="portlet light bordered" id="form-wizard-info">
  32 + <div class="portlet-title">
  33 + <div class="caption">
  34 + <i class="icon-equalizer font-red-sunglo"></i>
  35 + <span class="caption-subject font-red-sunglo bold uppercase">添加参数
  36 + <span class="step-title"> 1 - 4 </span>
  37 + </span>
  38 + </div>
  39 +
  40 + <div class="actions">
  41 + <div class="btn-group btn-group-devided" data-toggle="buttons">
  42 + <a class="btn btn-circle default" href="/pages/base/timesmodel/index.html" style="float: right;padding: 4px 23px;" data-pjax=""><i class="fa fa-reply"></i> 退出</a>
  43 + </div>
  44 + </div>
  45 + </div>
  46 + <div class="portlet-body form">
  47 +
  48 + <!-- START FORM 表单容器 -->
  49 + <form class="form-horizontal" id="submit_argus_form" action="/" method="POST" novalidate="novalidate">
  50 + <div class="form-wizard">
  51 + <div class="form-body">
  52 + <ul class="nav nav-pills nav-justified steps">
  53 + <li class="active">
  54 + <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true">
  55 + <span class="number"> 1 </span>
  56 + <span class="desc">
  57 + <i class="fa fa-check"></i> 选择时刻表 </span>
  58 + </a>
  59 + </li>
  60 + <li>
  61 + <a href="#tab2" data-toggle="tab" class="step">
  62 + <span class="number"> 2 </span>
  63 + <span class="desc">
  64 + <i class="fa fa-check"></i> 获取参数方式 </span>
  65 + </a>
  66 + </li>
  67 + <li>
  68 + <a href="#tab3" data-toggle="tab" class="step active">
  69 + <span class="number"> 3 </span>
  70 + <span class="desc">
  71 + <i class="fa fa-check"></i> 参数详情 </span>
  72 + </a>
  73 + </li>
  74 + <li>
  75 + <a href="#tab4" data-toggle="tab" class="step">
  76 + <span class="number"> 4 </span>
  77 + <span class="desc">
  78 + <i class="fa fa-check"></i> 确认 </span>
  79 + </a>
  80 + </li>
  81 + </ul>
  82 +
  83 + <!-- 进度条 -->
  84 + <div id="bar" class="progress progress-striped" role="progressbar">
  85 + <div class="progress-bar progress-bar-success" style="width: 25%;"></div>
  86 + </div>
  87 +
  88 + <div class="tab-content">
  89 + <div class="alert alert-danger display-hide">
  90 + <button class="close" data-close="alert"></button>
  91 + 您的输入有误,请检查下面的输入项
  92 + </div>
  93 + <div class="alert alert-success display-none">
  94 + <button class="close" data-dismiss="alert"></button>
  95 + 验证成功!
  96 + </div>
  97 +
  98 + <!-- 线路名称 -->
  99 + <div class="tab-pane active" id="tab1">
  100 + <h3 class="block"> 选择时刻表 </h3>
  101 + <!-- 表单分组组件 form-group START -->
  102 + <div class="form-group">
  103 + <!-- 时刻表名称 (* 必填项) START -->
  104 + <div class="col-md-6">
  105 + <label class="control-label col-md-5">
  106 + <span class="required"> * </span> 时刻表名称&nbsp;:
  107 + </label>
  108 + <div class="col-md-6">
  109 + <select name="skbName" class="form-control input-medium" id="skbNameSelect"></select>
  110 + </div>
  111 + </div>
  112 + <!-- 时刻表名称 (* 必填项) END -->
  113 + <!-- 线路名称 (* 必填项) START -->
  114 + <div class="col-md-6">
  115 + <label class="control-label col-md-5">
  116 + <span class="required"> * </span> 线路名称&nbsp;:
  117 + </label>
  118 + <div class="col-md-6">
  119 + <select name="lineName" class="form-control input-medium" id="lineSelect"></select>
  120 + </div>
  121 + </div>
  122 + <!-- 线路名称 (* 必填项) END -->
  123 + </div>
  124 + <!-- 表单分组组件 form-group END -->
  125 + </div>
  126 + <!-- 获取参数 -->
  127 + <div class="tab-pane" id="tab2">
  128 + <h3 class="block"> 获取参数方式 </h3>
  129 + <!-- 获取参数 -->
  130 + <div class="form-group">
  131 + <label class="col-md-3 control-label"> <span class="required"> * </span> 获取参数方式:</label>
  132 + <div class="col-md-9">
  133 + <div class="icheck-list">
  134 + <label >
  135 + <input type="radio" class="icheck" name="baseRes" value=1 > 手动输入
  136 + </label>
  137 + <label>
  138 + <input type="radio" class="icheck" name="baseRes" value=0 checked> 客流大数据分析
  139 + </label>
  140 + </div>
  141 + </div>
  142 + </div>
  143 + <!-- 客容总量 -->
  144 + <div class="form-group" id="krlGroup">
  145 + <label class="col-md-3 control-label"><span class="required"> * </span>客容总量&nbsp;&nbsp;:</label>
  146 + <div class="col-md-9">
  147 + <input type="text" class="form-control input-medium" name="krl" id="krlInput" placeholder="客容总量">
  148 + </div>
  149 + </div>
  150 + </div>
  151 + <!-- 参数详情 -->
  152 + <div class="tab-pane" id="tab3">
  153 + <h3 class="block"> 参数详情 </h3>
  154 + </div>
  155 + <!-- 确定提交资料信息 -->
  156 + <div class="tab-pane" id="tab4">
  157 + <h3 class="block"> 确认您提交的参数信息 </h3>
  158 + </div>
  159 + </div>
  160 + </div>
  161 + <div class="form-actions">
  162 + <div class="row">
  163 + <div class="col-md-offset-3 col-md-9">
  164 + <a href="javascript:;" class="btn default button-previous disabled" style="display: none;">
  165 + <i class="fa fa-angle-left"></i> 返回 </a>
  166 + <a href="javascript:;" class="btn btn-outline green button-next"> 下一步
  167 + <i class="fa fa-angle-right"></i>
  168 + </a>
  169 + <a href="javascript:;" class="btn green button-submit" style="display: none;"> 生成时刻模型
  170 + <i class="fa fa-check"></i>
  171 + </a>
  172 + </div>
  173 + </div>
  174 + </div>
  175 + </div>
  176 + </form>
  177 + <!-- END FORM-->
  178 + </div>
  179 +</div>
  180 +<script src="/pages/base/timesmodel/js/add-form-wizard.js"></script>
  181 +<script src="/pages/base/timesmodel/js/add-form-reload.js"></script>
  182 +<script src="/pages/base/timesmodel/js/tagsinput.js"></script>
0 183 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/bctz.html 0 → 100644
  1 +<!-- 调整班次 -->
  2 +<div class="modal fade" id="tzbc_mobal" tabindex="-1" role="basic" aria-hidden="true">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  7 + <h4 class="modal-title">调整班次</h4>
  8 + </div>
  9 + <div class="modal-body">
  10 + <form class="form-horizontal" action="/" method="post" id="tzbcForm" role="form">
  11 + <!-- alert-danger 组件START -->
  12 + <div class="alert alert-danger display-hide" id="tzbcAlert">
  13 + <button class="close" data-close="alert"></button>
  14 + 您的输入有误,请检查下面的输入项
  15 + </div>
  16 + <div class="portlet-body">
  17 + <div class="table-container" style="margin-top: 10px">
  18 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_bctz">
  19 + <thead>
  20 + <tr role="row" class="heading">
  21 + <th width="33%">路牌</th>
  22 + <th width="33%">当前班次数</th>
  23 + <th width="33%">调整班次数</th>
  24 + </tr>
  25 + </thead>
  26 + <tbody></tbody>
  27 + </table>
  28 + </div>
  29 + </div>
  30 + </form>
  31 + </div>
  32 + <div class="modal-footer">
  33 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  34 + <button type="button" class="btn btn-primary" id="tzbcnext">确定</button>
  35 + </div>
  36 + </div>
  37 + </div>
  38 +</div>
  39 +<script type="text/html" id="bctz_temp">
  40 +{{each list as obj i }}
  41 + <tr role="row" class="filter">
  42 + <td>
  43 + <input type="text" readonly class="form-control form-filter input-sm" name="lpname_{{i+1}}" value="{{obj.lpNo}}">
  44 + </td>
  45 + <td>
  46 + <input type="text" readonly class="form-control form-filter input-sm" name="dqbc_{{i+1}}" value="{{obj.bcs}}">
  47 + </td>
  48 + <td>
  49 + <input type="number" class="form-control form-filter input-sm" name="{{i+1}}" value="{{obj.bcs}}">
  50 + </td>
  51 + </tr>
  52 +{{/each}}
  53 +{{if list.length == 0}}
  54 + <tr>
  55 + <td colspan=3><h6 class="muted">没有找到相关数据</h6></td>
  56 + </tr>
  57 + {{/if}}
  58 +</script>
  59 +<script type="text/javascript">
  60 +$('#tzbc_mobal').on('tzbcMobal.show', function(e,obj,cardata,bf){
  61 + setTimeout(function(){
  62 + // 加载延迟200毫秒显示mobal
  63 + $('#tzbc_mobal').modal({show : true,backdrop: 'static', keyboard: false});
  64 + },200);
  65 + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
  66 + $('#tzbc_mobal').on('show.bs.modal', function () {
  67 + // 把数据填充到模版中
  68 + var tbodyHtml = template('bctz_temp',{list:cardata});
  69 + // 把渲染好的模版html文本追加到表格中
  70 + $('#datatable_bctz tbody').html(tbodyHtml);
  71 + });
  72 + // 获取表单元素
  73 + var form = $('#tzbcForm');
  74 + // 错误提示元素
  75 + var tzbcAlert = $('#tzbcAlert', form);
  76 + // 下一步点击事件
  77 + $('#tzbcnext').on('click', function() {
  78 + form.submit();// 表单提交
  79 + });
  80 + // 表单验证
  81 + form.validate({
  82 + errorElement : 'span',
  83 + errorClass : 'help-block help-block-error',
  84 + focusInvalid : false,
  85 + rules : {
  86 + },
  87 + invalidHandler : function(event, validator) {
  88 + tzbcAlert.show();
  89 + App.scrollTo(reladplusname, -200);
  90 + },
  91 + highlight : function(element) {
  92 + $(element).closest('.form-group').addClass('has-error');
  93 + },
  94 + unhighlight : function(element) {
  95 + $(element).closest('.form-group').removeClass('has-error');
  96 + },
  97 + success : function(label) {
  98 + label.closest('.form-group').removeClass('has-error');
  99 + },
  100 + submitHandler : function(f) {
  101 + // 1、 获取表单内容,并序列化
  102 + var params = form.serializeJSON();
  103 + // 2、 调整路牌对应的班次总数
  104 + updFormParams(params);
  105 + // 3、调整班次.并重新给定班次序号和发车序号.再确定首末班车时间.最后渲染数据
  106 + obj.data(bf.tzsmbcsj(bf.setbcsAndfcno(tzbcDate()),
  107 + obj.configuration.dataMap.smbcsjArr,
  108 + obj.configuration.dataMap.ccsjArr,
  109 + obj.configuration.dataMap.cclcArr,
  110 + obj.configuration.dataMap.qdzArr,
  111 + obj.configuration.dataMap.lbsj));
  112 + // 3、记录早操.并保存历史班次数据
  113 + obj.addHistory();
  114 + // 5、隐藏错误提示
  115 + tzbcAlert.hide();
  116 + // 6、隐藏 reladplus_mobal 弹出层
  117 + $('#tzbc_mobal').modal('hide');
  118 + }
  119 + });
  120 +
  121 + /**
  122 + * @description : (TODO) 调整路牌对应的班次总数.
  123 + *
  124 + * ❀ 根据路牌对应班次的数值,把路牌对应的当前班次总数修改成调整后的班次总数,并转为数值类型以及把空值转为0.
  125 + *
  126 + * @params : [p--表单序列化对象].
  127 + */
  128 + function updFormParams(p) {
  129 + for(var i= 0;i<cardata.length;i++) {
  130 + if(p[i+1] != undefined) {
  131 + if(p[i+1]=='')
  132 + cardata[i].tzbc = 0;
  133 + else
  134 + cardata[i].tzbc = parseInt(p[i+1]);
  135 + }
  136 + }
  137 + }
  138 +
  139 + /**
  140 + * @description : (TODO)调整班次.
  141 + *
  142 + * @return : 返回一个数组.这里返回的是一个调整完班次数后的数组.
  143 + */
  144 + function tzbcDate() {
  145 + // 1、获取当前所有的班次数.
  146 + var dr = obj.getDataArray(),
  147 + result = new Array();// 定义返回数组对象.
  148 + // 2、遍历路牌对应的班次总数.
  149 + for(var i = 0 ; i<cardata.length;i++) {
  150 + var zcbcsz = new Array(),// 定义当前路牌下的正常班次数组.
  151 + zwlbbcsz = new Array(),// 定义当前路牌下的早晚例保、吃饭班次数组.
  152 + jccbcs = 0,// 进出场班次数.这个值是为了计算总班次数时除去时间为空的班次
  153 + jccbcsz = new Array();// 定义当前路牌下的进出场班次数组.
  154 + // 3、遍历当前所有的班次数.
  155 + for(var j = 0 ;j<dr.length;j++) {
  156 + // 4、判断当前遍历的班次是否属于当前路牌对应的班次数组对象.
  157 + if(cardata[i].lpNo == dr[j].parent && dr[j].bcsj>0 ){
  158 + // 5、把当前班次添加到上序定义的不同班次数组中.
  159 + if(dr[j].bcType =='bd' || dr[j].bcType=='lc' || dr[j].bcType =='cf')
  160 + zwlbbcsz.push(dr[j]);// 添加到早晚例保、吃饭班次数组中.
  161 + else if(dr[j].bcType=='in' || dr[j].bcType =='out')
  162 + jccbcs++;
  163 + else
  164 + zcbcsz.push(dr[j]);// 添加到正常班次数组.
  165 + }
  166 + if(cardata[i].lpNo == dr[j].parent && (dr[j].bcType=='in' || dr[j].bcType =='out')) {
  167 + jccbcsz.push(dr[j]);// 添加到进出场班次数组中.
  168 + }
  169 + }
  170 + // 6、调整班次
  171 + result = result.concat(tcbcgz(bf.pxarr(zcbcsz),cardata[i].tzbc,zwlbbcsz,bf.pxarr(jccbcsz),jccbcs,cardata[i]));
  172 + }
  173 + return result;
  174 + }
  175 +
  176 + /**
  177 + * @description : (TODO)
  178 + *
  179 + * @params : [ar-- 当前路牌下的正常班次数组;num--当前路牌对应的班次总数;qa--当前路牌下的早晚例保、吃饭班次数组,ja--当前路牌下的进出场班次数组]
  180 + *
  181 + * @return : 返回一个数组.这里返回一个根据班次总数调整过车班次数组
  182 + */
  183 + function tcbcgz(ar,num,qa,ja,jccbcs,cara) {
  184 + var rsbcA = new Array();
  185 + if(ar.length>0) {
  186 + var ra_ = new Array();
  187 + var _dx = num-jccbcs;// 班次总数值 - 进出时间大于零的班次 = 正常班次数
  188 + var lastbcsjStr = ar[ar.length-1].ARRIVALTIME;// 标记调整班次之前最后一个班次的达到时间
  189 + var fcno_ = Math.abs(ar.length+jccbcs-num),// 调整班次差
  190 + tempS = '';// 标记调整班次是添加还是剔除[jq--剔除;add--添加]
  191 + var fxdm = bf.dirDmToIndex(ar[ar.length-1].xlDir);// 标记调整班次之前最后一个班次的方向
  192 + // 如果调整班次差是成对的,那么方向一致.否则改变方向
  193 + if(fcno_%2!=0)
  194 + fxdm = bf.getfx(1,fxdm);// 改变方向
  195 + // 如果当前路牌的班次总数大于等于调整后的班次总数则截取班次,反之添加班次
  196 + if(ar.length>=_dx) {
  197 + ra_ = ar.splice(0,_dx);// 截取班次数(这里从下标0开始截取到 对应的班次总数值)
  198 + tempS = 'jq';
  199 + }else if(ar.length<_dx) {
  200 + var tzsj_ = obj.configuration.stopAraay[0].tzjx,sh = ar[ar.length-1];
  201 + var startTime = new Date();
  202 + var strArray = sh.ARRIVALTIME.split(':');
  203 + startTime.setHours(parseInt(strArray[0]));
  204 + startTime.setMinutes(parseInt(strArray[1]) + tzsj_);
  205 + bf.addbc(obj,sh,startTime,tzsj_,sh.fcno + 1,ar,_dx - ar.length);
  206 + ra_ = ar;
  207 + tempS = 'add';
  208 + }
  209 + rsbcA = tzsj(ra_,qa,ja,lastbcsjStr,fcno_,tempS,fxdm);
  210 + }else if(ar.length==0) {
  211 + rsbcA = bf.addlpbc(obj,bf,cara.lpNo,num);
  212 + }
  213 + return rsbcA;
  214 + }
  215 +
  216 + /**
  217 + * @description : (TODO) 调整时间
  218 + *
  219 + * @params : [a1-- 当前路牌下的正常班次数组;a2--当前路牌下的早晚例保、吃饭班次数组;a3--当前路牌下的进出场班次数组]
  220 + *
  221 + * @return : 返回一个数组.这里返回的是一个调整时间后的班次数组
  222 + */
  223 + function tzsj(a1,a2,a3,sjstr,fcno_,tempS,fxdm) {
  224 + return a1.concat(jsjclc(a1[a1.length-1].ARRIVALTIME,a2,a3,sjstr,fcno_,tempS,fxdm));
  225 + }
  226 +
  227 + /**
  228 + * @description : (TODO)调整进出场、离场班次
  229 + *
  230 + * @params : [st--当前路牌最后一个班次的到达时间;ar--当前路牌下的早晚例保、吃饭班次数组,pa--当前路牌下的进出场班次数组]
  231 + *
  232 + * @return
  233 + */
  234 + function jsjclc(st,ar,pa,sjstr,fcno_,tempS,fxdm) {
  235 + console.log('{' + tempS + '......}')
  236 + // 1、修改进出场班次.
  237 + for(var p = 0;p<pa.length;p++) {
  238 + // A)、如果当前班次的发车时间等于 在没有调整班次总数之前的最后一个班次的到达时间,则这个班次是在没有调整班次之前的那个进场班次
  239 + if(pa[p].fcsj == sjstr && pa[p].bcType =='in') {
  240 + pa[p].fcsj = st;
  241 + pa[p].bcsj = obj.configuration.dataMap.ccsjArr[fxdm];
  242 + pa[p].xlDir = obj.configuration.dataMap.dira[fxdm];
  243 + var _s = bf.getDateTime(st);
  244 + var _tt = new Date(_s);
  245 + _tt.setMinutes(_tt.getMinutes()+pa[p].bcsj);
  246 + var ddsjStr = bf.getTimeStr(_tt);
  247 + pa[p].ARRIVALTIME = ddsjStr;
  248 + if(tempS =='add')
  249 + pa[p].fcno = pa[p].fcno+fcno_;
  250 + else if(tempS =='jq')
  251 + pa[p].fcno = pa[p].fcno-fcno_;
  252 + }
  253 + // B)、剔除掉 当前班次的到达时间大于调整班次过后最后一个班次到达时间的班次
  254 + if((bf.getDateTime(pa[p].ARRIVALTIME)-bf.getDateTime(st))/60000 > pa[p].bcsj) {
  255 + console.log('{' + pa[p].lpNo + '----' + pa[p].ARRIVALTIME + '----' + st + '}');
  256 + console.log('修改进出场班次时...该班次的到达时间大于了最后一个班次的到达时间,应该剔除掉!');
  257 + pa.splice(p,1);
  258 + }
  259 + }
  260 + // 2、修改晚例保班次.
  261 + for(var i = 0 ; i<ar.length;i++) {
  262 + // A)、修改离场班次属性值
  263 + if(ar[i].bcType=='lc') {
  264 + ar[i].fcsj = ddsjStr;
  265 + ar[i].xlDir = obj.configuration.dataMap.dira[fxdm];
  266 + var _lcs = bf.getDateTime(ddsjStr);
  267 + var _lctt = new Date(_lcs);
  268 + _lctt.setMinutes(_lctt.getMinutes()+ar[i].bcsj);
  269 + ar[i].ARRIVALTIME = bf.getTimeStr(_lctt);
  270 + if(tempS =='add')
  271 + ar[i].fcno = ar[i].fcno+fcno_;
  272 + else if(tempS =='jq')
  273 + ar[i].fcno = ar[i].fcno-fcno_;
  274 + }
  275 + // B)、剔除掉 当前班次的到达时间大于调整班次过后最后一个班次到达时间的班次
  276 + if(bf.getDateTime(ar[i].ARRIVALTIME)>bf.getDateTime(st) && ar[i].bcType!='lc') {
  277 + console.log('{' + ar[i].lpNo + '----' + ar[i].ARRIVALTIME + '----' + st + '}')
  278 + console.log('修改晚例保班次时...该班次的到达时间大于了最后一个班次的到达时间,应该剔除掉!');
  279 + ar.splice(i,1);
  280 + }
  281 + }
  282 + // 3、合并进出场、例保班次,并返回.
  283 + return pa.concat(ar);
  284 + }
  285 +});
  286 +</script>
0 287 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/css/d3.relationshipgraph.min.css 0 → 100644
  1 +.relationshipGraph-block{stroke:#F7F7F7;stroke-width:1px;pointer-events:all}.relationshipGraph-block:hover{cursor:pointer}.relationshipGraph-Text{font-family:Helvetica,sans-serif;font-size:10pt;fill:#323232}.relationshipGraph-measurement{font-family:Helvetica,sans-serif;font-size:13px;position:absolute;width:auto;height:auto;left:-100%;top:-100%}.relationshipGraph-tip{font-weight:700;font-family:Helvetica,sans-serif;font-size:9pt;line-height:1;padding:12px;background:#323232;color:#e7e7e7;border-radius:6px;z-index:50;max-width:350px;max-height:300px}.relationshipGraph-tip:after{display:inline-block;font-size:15px;width:100%;height:5px;color:#323232;content:"\25B6";position:absolute}.relationshipGraph-tip.n:after{content:"\25BC";margin:-1px 0 0;top:100%;left:12px;text-align:center}.relationshipGraph-tip.e{margin-left:15px}.relationshipGraph-tip.e:after{content:"\25C0";margin:-2px 0 0;top:50%;left:-11px}.relationshipGraph-tip.s{margin-top:15px}.relationshipGraph-tip.s:after{content:"\25B2";margin:0 0 1px;top:-12px;left:12px;text-align:center}.relationshipGraph-tip.w:after{content:"\25B6";margin:-4px 0 0 -1px;top:50%;left:100%}
0 2 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/css/index.css 0 → 100644
  1 +body {
  2 + overflow: hidden;
  3 +}
  4 +
  5 +.relationshipGraph-tip {
  6 + border-radius: 6px !important;
  7 + background: #192838 !important;
  8 + width: 160px !important;
  9 + color: #12cada !important;
  10 + z-index: 100000 !important;
  11 +}
  12 +
  13 +.relationshipGraph-tip:after {
  14 + color: #192838 !important;
  15 +}
  16 +
  17 +.relationshipGraph-tip table tr td{
  18 + padding: 3px;
  19 +}
  20 +
  21 +.rect-cover,.rect-cover-statis {
  22 + fill: rgba(255, 255, 255, 0);
  23 +}
  24 +
  25 +.case_rect{
  26 + fill: rgba(255, 255, 255, 0.2);
  27 + stroke:#0099CC;
  28 + stroke-width: 4px;
  29 + rx: 5px;
  30 + ry: 5px;
  31 +}
  32 +
  33 +.c_close {
  34 + fill: #f7466b;
  35 + opacity: 0.5 ;
  36 +}
  37 +
  38 +.c_close_so {
  39 + fill:rgb(253, 253, 253);
  40 +}
  41 +
  42 +.c_close_line_r,.c_close_line_l {
  43 + stroke:#f7466b;
  44 + opacity: 0.5 ;
  45 + stroke-width:2;
  46 +}
  47 +
  48 +.c_close_cover,.r_left_cover,.r_right_cover,.r_center_cover {
  49 + fill:rgba(253,253,253,0);
  50 +}
  51 +
  52 +.test_r_center,.test_r_left,.test_r_right {
  53 + fill:#0099CC
  54 +}
  55 +
  56 +.test_r_center_solid,.test_r_left_solid,.test_r_right_solid {
  57 + fill:#0099CC
  58 +}
  59 +
  60 +.test_r_center_so, .test_r_left_so,.test_r_right_so{
  61 + fill:rgb(253, 253, 253);
  62 +}
  63 +
  64 +
  65 +text.caseactive {
  66 + fill: #03e1fd;
  67 +}
  68 +
  69 +
  70 +text.alert-danger {
  71 + /* transform: scale(0.5,1); */
  72 + font-weight: bolder;
  73 + fill: #f9a3a9;
  74 +}
  75 +
  76 +.relationshipGraph-up {
  77 + /* fill: #2c5c7f; */
  78 + /* fill: #304459; */
  79 + fill: #233f5d;
  80 + stroke: #ffffff;
  81 + stroke-width: 1px;
  82 + pointer-events: all;
  83 + cursor: default;
  84 + rx:4;
  85 + ry:4;
  86 +}
  87 +
  88 +.relationshipGraph-up-text,.relationshipGraph-down-text {
  89 + /* transform: scale(0.5,1); */
  90 + font-weight: bolder;
  91 + fill: #ffffff;
  92 +}
  93 +
  94 +.relationshipGraph-up-circle-text,.relationshipGraph-down-circle-text {
  95 + font-weight: bolder;
  96 + fill: #2ab4c0;
  97 +}
  98 +
  99 +.relationshipGraph-up-circle,.relationshipGraph-down-circle {
  100 + /* stroke: #2ab4c0; */
  101 + stroke: #17a8ee;
  102 + stroke-width: 2px;
  103 + fill: #ffffff;
  104 +}
  105 +
  106 +.relationshipGraph-down {
  107 + /* fill: #666; */
  108 + /* fill: #3b414e; */
  109 + fill: #31394a;
  110 + cursor: default;
  111 + stroke: #ffffff
  112 + stroke-width: 1px;
  113 + pointer-events: all;
  114 + rx:4;
  115 + ry:4
  116 +}
  117 +
  118 +
  119 +.ganttSvgContainer {
  120 + height: 400px;
  121 + overflow: auto;
  122 + position: relative;
  123 +}
  124 +
  125 +.svg-chart {
  126 + font-family: Arial, sans-serif;
  127 + font-size: 12px;
  128 +}
  129 +
  130 +#ganttSvg {
  131 + width: 100%;
  132 + margin: 10px 0px 0px 10px;
  133 +}
  134 +
  135 +
  136 +.rect_shift, .rect_Whours {
  137 + /* fill:#225369; */
  138 + fill : #093144;
  139 + stroke-width: 0.5;
  140 +}
  141 +
  142 +.statis_text {
  143 + fill:#eee;
  144 + /* transform: scale(0.4,0.5); */
  145 + font-weight: bold;
  146 +}
  147 +
  148 +.axis path,.axis line,.down path,.down line,.up path,.up line {
  149 + fill: none;
  150 + stroke: #304152;
  151 + shape-rendering: crispEdges;
  152 + opacity: 0.5;
  153 + stroke-width: 1;
  154 +}
  155 +
  156 +::selection {
  157 + background:rgba(255, 255, 255, 0);
  158 +}
... ...
src/main/resources/static/pages/base/timesmodel/edit-detail.html 0 → 100644
  1 +<div class="modal fade" id="editDetail_mobal" tabindex="-1" role="basic" aria-hidden="true">
  2 + <div class="modal-dialog" style="margin-left: 400px;">
  3 + <div class="modal-content" style="width: 900px;">
  4 + <div class="modal-header">
  5 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  6 + <h4 class="modal-title">修改</h4>
  7 + </div>
  8 + <div class="modal-body">
  9 + <form class="form-horizontal" action="/" method="post" id="editDetail" role="form">
  10 + <!-- alert-danger 组件START -->
  11 + <div class="alert alert-danger display-hide" id="reladplusname">
  12 + <button class="close" data-close="alert"></button>
  13 + 您的输入有误,请检查下面的输入项
  14 + </div>
  15 + <!-- 表单分组组件 form-group START -->
  16 + <div class="form-group">
  17 + <!-- 时刻表名称 (* 必填项) START -->
  18 + <div class="col-md-6">
  19 + <label class="control-label col-md-6">
  20 + <span class="required"> * </span> 时刻表名称:
  21 + </label>
  22 + <div class="col-md-6">
  23 + <input type="text" class="form-control" name="xkbName" id="xkbNameInput" readonly placeholder="时刻表名称">
  24 + </div>
  25 + </div>
  26 + <!-- 时刻表名称 (* 必填项) END -->
  27 +
  28 + <!-- 发车顺序号 (* 必填项) START -->
  29 + <div class="col-md-6">
  30 + <label class="control-label col-md-6">
  31 + <span class="required"> * </span> 发车顺序号:
  32 + </label>
  33 + <div class="col-md-6">
  34 + <input type="text" class="form-control" name="fcno" id="fcnoInput" readonly placeholder="发车顺序号">
  35 + </div>
  36 + </div>
  37 + <!-- 发车顺序号 (* 必填项) END -->
  38 + </div>
  39 + <!-- 表单分组组件 form-group END -->
  40 + <!-- 表单分组组件 form-group START -->
  41 + <div class="form-group">
  42 + <!-- 线路 (* 必填项) START -->
  43 + <div class="col-md-6">
  44 + <label class="control-label col-md-6">
  45 + <span class="required"> * </span> 线路&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  46 + </label>
  47 + <div class="col-md-6">
  48 + <input type="text" class="form-control" name="xl" id="xlInput" readonly placeholder="线路">
  49 + </div>
  50 + </div>
  51 + <!-- 线路 (* 必填项) END -->
  52 +
  53 + <!-- 路牌 (* 必填项) START -->
  54 + <div class="col-md-6">
  55 + <label class="control-label col-md-6">
  56 + <span class="required"> * </span> 路牌&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  57 + </label>
  58 + <div class="col-md-6">
  59 + <input type="text" class="form-control" name="lp" id="lpInput" readonly placeholder="路牌">
  60 + </div>
  61 + </div>
  62 + <!-- 路牌 (* 必填项) END -->
  63 + </div>
  64 + <!-- 表单分组组件 form-group END -->
  65 +
  66 + <!-- 表单分组组件 form-group START -->
  67 + <div class="form-group">
  68 + <!-- 对应班次数 (* 必填项) START -->
  69 + <div class="col-md-6">
  70 + <label class="control-label col-md-6">
  71 + <span class="required"> * </span> 对应班次数:
  72 + </label>
  73 + <div class="col-md-6">
  74 + <input type="text" class="form-control" name="bcs" id="bcsInput" readonly placeholder="对应班次数">
  75 + </div>
  76 + </div>
  77 + <!-- 对应班次数 (* 必填项) END -->
  78 +
  79 + <!-- 方向 (* 必填项) START -->
  80 + <div class="col-md-6">
  81 + <label class="control-label col-md-6">
  82 + <span class="required"> * </span> 方向&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  83 + </label>
  84 + <div class="col-md-6">
  85 + <!-- <input type="text" class="form-control" name="dic" id="dicInput" placeholder="方向"> -->
  86 + <select name="xlDir" class="form-control" id="xlDirInput">
  87 + <option value="">-- 请选择方向 --</option>
  88 + <option value="relationshipGraph-up">上行</option>
  89 + <option value="relationshipGraph-down">下行</option>
  90 + </select>
  91 + </div>
  92 + </div>
  93 + <!-- 方向 (* 必填项) END -->
  94 +
  95 + </div>
  96 + <!-- 表单分组组件 form-group END -->
  97 +
  98 + <!-- 表单分组组件 form-group START -->
  99 + <div class="form-group">
  100 + <!-- 起点站 (* 必填项) START -->
  101 + <div class="col-md-6">
  102 + <label class="control-label col-md-6">
  103 + <span class="required"> * </span> 起点站&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  104 + </label>
  105 + <div class="col-md-6">
  106 + <!-- <input type="text" class="form-control" name="qdz" id="qdzInput" placeholder="起点站"> -->
  107 + <select name="qdz" class="form-control" style="width:100%" id="qdzInput"></select>
  108 + </div>
  109 + </div>
  110 + <!-- 起点站 (* 必填项) END -->
  111 +
  112 + <!-- 终点站 (* 必填项) START -->
  113 + <div class="col-md-6">
  114 + <label class="control-label col-md-6">
  115 + <span class="required"> * </span> 终点站&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  116 + </label>
  117 + <div class="col-md-6">
  118 + <!-- <input type="text" class="form-control" name="zdz" id="zdzInput" placeholder="终点站"> -->
  119 + <select name="zdz" class="form-control" style="width:100%" id="zdzInput"></select>
  120 + </div>
  121 + </div>
  122 + <!-- 终点站 (* 必填项) END -->
  123 + </div>
  124 + <!-- 表单分组组件 form-group END -->
  125 +
  126 + <!-- 表单分组组件 form-group START -->
  127 + <div class="form-group">
  128 + <!-- 发车时间 (* 必填项) START -->
  129 + <div class="col-md-6">
  130 + <label class="control-label col-md-6">
  131 + <span class="required"> * </span> 发车时间&nbsp;&nbsp;&nbsp;:
  132 + </label>
  133 + <div class="col-md-6">
  134 + <input type="text" class="form-control" name="fcsj" id="fcsjInput" placeholder="发车时间">
  135 + </div>
  136 + </div>
  137 + <!-- 发车时间 (* 必填项) END -->
  138 +
  139 + <!-- 班次类型 (* 必填项) START -->
  140 + <div class="col-md-6">
  141 + <label class="control-label col-md-6">
  142 + <span class="required"> * </span> 班次类型&nbsp;&nbsp;&nbsp;:
  143 + </label>
  144 + <div class="col-md-6">
  145 + <!-- <input type="text" class="form-control" name="bcType" id="bcTypeInput" placeholder="班次类型"> -->
  146 + <select name="bcType" class="form-control" id="bcTypeInput">
  147 + <option value="">-- 请选择类型 --</option>
  148 + <option value="bd">早例保</option>
  149 + <option value="out">出场</option>
  150 + <option value="normal">正常</option>
  151 + <option value="cf">吃饭</option>
  152 + <option value="in">进场</option>
  153 + <option value="lc">晚例保</option>
  154 + <option value="major">放大站</option>
  155 + <option value="venting">直放</option>
  156 + <option value="region">区间</option>
  157 + </select>
  158 + </div>
  159 + </div>
  160 + <!-- 班次类型 (* 必填项) END -->
  161 + </div>
  162 + <!-- 表单分组组件 form-group END -->
  163 +
  164 + <!-- 表单分组组件 form-group START -->
  165 + <div class="form-group">
  166 + <!-- 班次历时 (* 必填项) START -->
  167 + <div class="col-md-6">
  168 + <label class="control-label col-md-6">
  169 + <span class="required"> * </span> 班次历时&nbsp;&nbsp;&nbsp;:
  170 + </label>
  171 + <div class="col-md-6">
  172 + <input type="text" class="form-control" name="bcsj" id="bcsjInput" placeholder="班次历时">
  173 + </div>
  174 + </div>
  175 + <!-- 班次历时 (* 必填项) END -->
  176 + <!-- 计划里程 (* 必填项) START -->
  177 + <div class="col-md-6">
  178 + <label class="control-label col-md-6">
  179 + <span class="required"> * </span> 计划里程&nbsp;&nbsp;&nbsp;:
  180 + </label>
  181 + <div class="col-md-6">
  182 + <input type="text" class="form-control" name="jhlc" id="jhlcInput" placeholder="计划里程">
  183 + </div>
  184 + </div>
  185 + <!-- 计划里程 (* 必填项) END -->
  186 + </div>
  187 + <!-- 表单分组组件 form-group END -->
  188 +
  189 + <!-- 表单分组组件 form-group START -->
  190 + <div class="form-group">
  191 + <!-- 是否分班 START (因为options值基本固定,所以在页面固定。【以后可以根具需求修改成使用字典表实现】) -->
  192 + <div class="form-group">
  193 +
  194 + </div>
  195 + <div class="col-md-6">
  196 + <label class="control-label col-md-6">
  197 + <span class="required"> * </span> 是否分班&nbsp;&nbsp;&nbsp;:
  198 + </label>
  199 + <div class="col-md-6">
  200 + <select name="isfb" class="form-control" id="isfbSelect">
  201 + <option value="">-- 请选择类型 --</option>
  202 + <option value=0>否</option>
  203 + <option value=1>是</option>
  204 + </select>
  205 + </div>
  206 + </div>
  207 + <!-- 是否分班 END -->
  208 +
  209 + <!-- 备注 (* 必填项) START -->
  210 + <div class="col-md-6">
  211 + <label class="control-label col-md-6">
  212 + 备注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
  213 + </label>
  214 + <div class="col-md-6">
  215 + <input type="text" class="form-control" name="bz" id="bzInput" placeholder="备注">
  216 + </div>
  217 + </div>
  218 + <!-- 班次历时 (* 必填项) END -->
  219 + </div>
  220 + <!-- 表单分组组件 form-group END -->
  221 + </form>
  222 + </div>
  223 + <div class="modal-footer">
  224 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  225 + <button type="button" class="btn btn-primary" id="editDetailnext">确定</button>
  226 + </div>
  227 + </div>
  228 + </div>
  229 +</div>
  230 +<script type="text/javascript">
  231 +/**
  232 + * @params [obj--甘特图对象;d--当前修改班次对象数据]
  233 + */
  234 +$('#editDetail_mobal').on('editDetailMobal.show', function(e,obj,nodeContext,bf,map){
  235 + // 定义当前班次数据.
  236 + var dqbcData = nodeContext.dqbcData;
  237 + var ddbcminztjx = isUpdsgbctzsj(dqbcData.bcType) || isUpdsgbctzsj(nodeContext.nextData.bcType) ? dqbcData.STOPTIME : obj.configuration.dataMap.minztjx,lastminztjx = 0;
  238 + if(typeof(nodeContext.lastData) !='undefined')
  239 + lastminztjx = isUpdsgbctzsj(nodeContext.lastData.bcType) || isUpdsgbctzsj(dqbcData.bcType) ? nodeContext.lastData.STOPTIME : obj.configuration.dataMap.minztjx;
  240 + // 延迟250毫秒执行.
  241 + setTimeout(function(){
  242 + // 加载显示mobal
  243 + $('#editDetail_mobal').modal({show : true,backdrop: 'static', keyboard: false});
  244 + },250);
  245 + // 定义该线路方向下的起终点站.(防止随意修改起终点站.保证与该线路下的站点路由的起终点站一致.) [下标0--代表上行;下标1--代表下行].
  246 + var lineDirStoEStation = new Array();
  247 + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
  248 + $('#editDetail_mobal').on('show.bs.modal', function () {
  249 + // 初始化发车时间的input为日期时间.
  250 + $('#fcsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  251 + // 根据时刻表ID获取时刻表名称.
  252 + skbIdToName(dqbcData.ttinfo,function(skbName){
  253 + // 获取时刻表名称对应的元素并设值.
  254 + $('#xkbNameInput').val(skbName);
  255 + // 初始化起终点站的select为select2.
  256 + initZdSelect(dqbcData.xl,function() {
  257 + $("#qdzInput").select2("val", dqbcData.qdz);
  258 + $("#zdzInput").select2("val", dqbcData.zdz);
  259 + xlIdToName(dqbcData.xl,function(xlName) {
  260 + // 设值标题文本.
  261 + $('.modal-title').text(skbName +
  262 + '(' + skbName +'时刻表)时刻表明细信息->路牌'+
  263 + dqbcData.lpName +
  264 + '->发车顺序号'+
  265 + dqbcData.fcno +
  266 + '->班次修改');
  267 + // 设值线路名称.
  268 + $('#xlInput').val(xlName);
  269 + // 设值表单值.
  270 + setFormValue();
  271 + });
  272 + })
  273 + });
  274 + });
  275 + // 获取表单元素
  276 + var form = $('#editDetail');
  277 + // 错误提示元素
  278 + var reladplusname = $('#reladplusname', form);
  279 + // 表单提交
  280 + $('#editDetailnext').on('click', function() {form.submit();});
  281 + // 表单验证.
  282 + form.validate({
  283 + errorElement : 'span',
  284 + errorClass : 'help-block help-block-error',
  285 + focusInvalid : false,
  286 + rules : {
  287 + // 时刻表.必填项.
  288 + 'xkbName' : {required : true,},
  289 + // 发车序号. 必填项 必须为整数.
  290 + 'fcno' : {required : true,number : true,digits : true},
  291 + // 线路.必填项.
  292 + 'xl' : {required : true,},
  293 + // 路牌.必填项.
  294 + 'lp' : {required : true,},
  295 + // 班次数. 必填项 必须为整数.
  296 + 'bcs' : {required : true,number : true,digits : true},
  297 + // 方向.必填项.
  298 + 'xlDir' : {required : true,},
  299 + // 起点站.必填项.
  300 + // 'qdz' : {required : true},
  301 + // 终点站.必填项.
  302 + // 'zdz' : {required : true},
  303 + // 发车时间.必填项.
  304 + 'fcsj' : {required : true,isFcsj : true},
  305 + // 班次类型.必填项.
  306 + 'bcType' : {required : true,},
  307 + // 班次时间.必填项.
  308 + 'bcsj' : {required : true,number : true,digits : true,isBcsj : true},
  309 + // 计划里程.必填项.
  310 + 'jhlc' : {required : true,number : true,digits : true},
  311 + // 是否分班.必填项.
  312 + 'isfb' : {required : true,},
  313 + },
  314 + invalidHandler : function(event, validator) {
  315 + reladplusname.show();
  316 + App.scrollTo(reladplusname, -200);
  317 + },
  318 + highlight : function(element) {
  319 + $(element).closest('.form-group').addClass('has-error');
  320 + },
  321 + unhighlight : function(element) {
  322 + $(element).closest('.form-group').removeClass('has-error');
  323 + },
  324 + success : function(label) {
  325 + label.closest('.form-group').removeClass('has-error');
  326 + },
  327 + submitHandler : function(f) {
  328 + // 获取表单字段值并序列化.
  329 + var params = form.serializeJSON();
  330 + // 验证表单数据中方向下的起终点站与数据库中站点路由中的起终点站是否一直.
  331 + var vd = validateDirSToEStation(params);
  332 + if(vd.tag) {
  333 + // 表单提交.
  334 + submit();
  335 + }else {
  336 + // 修改起点站.
  337 + params.qdz = vd.dirStoE.qdz;
  338 + // 修改终点站.
  339 + params.zdz = vd.dirStoE.zdz;
  340 + // 弹出选择框;确认则提交;取消则返回.
  341 + layer.confirm('您选择的线路【'+params.xl+'】' + vd.depict, {
  342 + btn : [ '确认提示并提交', '取消' ]
  343 + }, submit);
  344 + }
  345 +
  346 + // 表单提交.
  347 + function submit() {
  348 + // 隐藏错误提示.
  349 + reladplusname.hide();
  350 + // 隐藏 reladplus_mobal 弹出层.
  351 + $('#editDetail_mobal').modal('hide');
  352 + // 关闭弹出层.
  353 + layer.closeAll();
  354 + var data = new Array();
  355 + // 判断.如果是例保时间或者吃饭时间.则不进行修改.
  356 + if(!isdqbcDatalbfc(dqbcData.bcType)) {
  357 + // 判断如果方向修改了.则调整方向.
  358 + if(dqbcData.xlDir !== params.xlDir)
  359 + data = changeDir(dqbcData.xlDir,params.xlDir);
  360 + else
  361 + data = obj.getDataArray();
  362 + // 修改班次对应属性值.
  363 + changeValue(params);
  364 + }else {
  365 + dqbcData.bz = params.bz;
  366 + data = obj.getDataArray();
  367 + }
  368 + // 重新绘制图形.
  369 + obj.data(data);
  370 + // 记录操作.
  371 + obj.addHistory();
  372 + }
  373 + }
  374 + });
  375 +
  376 + /**
  377 + * @description : (TODO) 监听班型值改变事件.这里的值改变会影响起终点站的输入.
  378 + *
  379 + * @status OK.
  380 + **/
  381 + $('#bcTypeInput').on('change',function() {
  382 + isDisabled($(this).val());
  383 + });
  384 +
  385 + // 验证班次时间
  386 + $.validator.addMethod('isBcsj', function(value,element) {
  387 + // 定义上个班次的到达时间.下个班次的发车时间.返回值.
  388 + /* var sgbcddsj = bf.getDateTime(nodeContext.lastData.ARRIVALTIME) , xxbcfcsj = bf.getDateTime(nodeContext.nextData.fcsj),tag = true; */
  389 + var sgbcddsj = bf.getDateTime(nodeContext.lastData.ARRIVALTIME) ,
  390 + xxbcfcsj = isUpdsgbctzsj(dqbcData.bcType) ? bf.getDateTime(dqbcData.ARRIVALTIME) : bf.getDateTime(nodeContext.nextData.fcsj),
  391 + tag = true;
  392 + // 修改上个班次的到达时间.
  393 + sgbcddsj.setMinutes(sgbcddsj.getMinutes() + lastminztjx);
  394 + // 修改下个班次的到达时间.
  395 + xxbcfcsj.setMinutes(xxbcfcsj.getMinutes() - ddbcminztjx);
  396 + // 获取班次时间.
  397 + var bcsj = $('#bcsjInput').val();
  398 + bcsj = bcsj==''? 0 : parseInt(bcsj);
  399 + // 判断.
  400 + if(bcsj> parseInt((xxbcfcsj-sgbcddsj)/60000))
  401 + tag =false;
  402 + return tag;
  403 + },function(){
  404 + // 定义上个班次的到达时间.下个班次的发车时间.
  405 + /* var sgbcddsj = bf.getDateTime(nodeContext.lastData.ARRIVALTIME) , xxbcfcsj = bf.getDateTime(nodeContext.nextData.fcsj); */
  406 + var sgbcddsj = bf.getDateTime(nodeContext.lastData.ARRIVALTIME) ,
  407 + xxbcfcsj = isUpdsgbctzsj(dqbcData.bcType) ? bf.getDateTime(dqbcData.ARRIVALTIME) : bf.getDateTime(nodeContext.nextData.fcsj);
  408 + // 修改上个班次的到达时间.
  409 + sgbcddsj.setMinutes(sgbcddsj.getMinutes() + lastminztjx);
  410 + // 修改下个班次的到达时间.
  411 + xxbcfcsj.setMinutes(xxbcfcsj.getMinutes() - ddbcminztjx);
  412 + // 返回提示内容.
  413 + return '最大班次时间【' + parseInt((xxbcfcsj-sgbcddsj)/60000) + '】';
  414 + });
  415 +
  416 + // 发车时间验证.
  417 + $.validator.addMethod('isFcsj', function(value,element) {
  418 + if(isdqbcDatalbfc(dqbcData.bcType))
  419 + return true;
  420 + // 获取表单填写的发车时间以及返回值.
  421 + var fcsjStr = $('#fcsjInput').val(),bcsj = $('#bcsjInput').val(),tag = true;
  422 + // 判断是否为空.
  423 + if(fcsjStr == '')
  424 + return false;
  425 + // 定义发车时间对象.
  426 + var fcsj = bf.getDateTime(fcsjStr);
  427 + // 定义到达时间对象.
  428 + var ddsj = bf.getDateTime(fcsjStr);
  429 + // 修改到达时间分钟数.
  430 + ddsj.setMinutes(ddsj.getMinutes() + (bcsj==''? 0 : parseInt(bcsj)));
  431 + // 定义上个班次的到达时间对象.
  432 + var sgbcddsj = bf.getDateTime(nodeContext.lastData.ARRIVALTIME);
  433 + // 定义下个班次的发车时间对象.
  434 + var xxbcfcsj = isUpdsgbctzsj(dqbcData.bcType) ? bf.getDateTime(dqbcData.ARRIVALTIME) : bf.getDateTime(nodeContext.nextData.fcsj);
  435 + // 判断当前修改的班次的发车时间是否在上一个班次的到达时间 与下个一个班次的发车时间 之间 ,并且上下班次相隔停站时间大于等于最小停站时间.
  436 + if( parseInt((fcsj - sgbcddsj) / 60000) < lastminztjx ||
  437 + parseInt((xxbcfcsj - ddsj) / 60000) < ddbcminztjx)
  438 + tag = false;
  439 + return tag;
  440 + }, function() {
  441 + // 定义验证发车时间验证提示内容.上个班次的到达时间.下个班次的发车时间.班次时间.
  442 + /* var fcsjVdStr = '发车时间【',sgbcddsj = bf.getDateTime(nodeContext.lastData.ARRIVALTIME),
  443 + xxbcfcsj = bf.getDateTime(nodeContext.nextData.fcsj),bcsj = $('#bcsjInput').val(); */
  444 + var fcsjVdStr = '发车时间【',sgbcddsj = bf.getDateTime(nodeContext.lastData.ARRIVALTIME),
  445 + xxbcfcsj = isUpdsgbctzsj(dqbcData.bcType) ? bf.getDateTime(dqbcData.ARRIVALTIME) : bf.getDateTime(nodeContext.nextData.fcsj),
  446 + bcsj = $('#bcsjInput').val();
  447 + bcsj = bcsj ==''?0:parseInt(bcsj);
  448 + // 修改上个班次的到达时间.这里相当于上个班次 与 当前班次的最小停站时间.
  449 + sgbcddsj.setMinutes(sgbcddsj.getMinutes() + lastminztjx);
  450 + // 修改下个班次的发车时间.这里相当于当前班次与下一个班次的最小停站时间.
  451 + xxbcfcsj.setMinutes(xxbcfcsj.getMinutes() - ddbcminztjx - bcsj);
  452 + fcsjVdStr = fcsjVdStr + bf.getTimeStr(sgbcddsj) + '~' + bf.getTimeStr(xxbcfcsj)+'】';
  453 + return fcsjVdStr;
  454 + });
  455 +
  456 + /**
  457 + * @description : (TODO) 验证表单数据中方向下的起终点站与数据库中站点路由中的起终点站是否一直.
  458 + *
  459 + * @param [f--表单数据].
  460 + *
  461 + * @status OK.
  462 + **/
  463 + function validateDirSToEStation(f) {
  464 + if(isdqbcDatalbfc(dqbcData.bcType) ||
  465 + dqbcData.bcType == obj.configuration.dataMap.bcTypeArr.in_||
  466 + dqbcData.bcType == obj.configuration.dataMap.bcTypeArr.out)
  467 + return {'tag':true};
  468 + // 定义返回状态值;方向下的正确的起终点;提示信息.
  469 + var tag = false,dirStoE = null,depict = '';
  470 + // 遍历.
  471 + for(var i = 0; i<lineDirStoEStation.length;i++) {
  472 + // 判断方向一致.
  473 + if(lineDirStoEStation[i].dir==f.xlDir) {
  474 + // 判断起终点站id
  475 + if(lineDirStoEStation[i].qdz==f.qdz && lineDirStoEStation[i].zdz==f.zdz) {
  476 + tag = true;
  477 + }else {
  478 + // 赋值方向下的正确的起终点.
  479 + dirStoE = lineDirStoEStation[i];
  480 + // 定义错误、正确的提示信息.所选择方向文本内容.
  481 + var zderrorStr = '',zdrightStr = '',dirStr = $("#xlDirInput").find("option:selected").text();
  482 + // 判断起点站是否一致.
  483 + if(lineDirStoEStation[i].qdz != f.qdz){
  484 + zdrightStr = zdrightStr + '【起点站: '+ lineDirStoEStation[i].qdz + '】' + lineDirStoEStation[i].qdzname;
  485 + zderrorStr = zderrorStr + '【起点站:' + f.qdz + '】' + $("#qdzInput").select2('data')[0].text;
  486 + // 判断终点站是否一致.
  487 + }else if(lineDirStoEStation[i].zdz != f.zdz) {
  488 + zdrightStr = zdrightStr + '【终点站:' + lineDirStoEStation[i].zdz +'】' + lineDirStoEStation[i].zdzname;
  489 + zderrorStr = zderrorStr + '【终点站:' + f.zdz + '】' + $("#zdzInput").select2('data')[0].text;
  490 + }
  491 + // 赋值提示信息.
  492 + depict = '方向【' + dirStr +'】的' +
  493 + zderrorStr +'与站点路由'+ zdrightStr +'不一致!自动顺延为如下:<br>' + dirStr + ':'+ zdrightStr;
  494 + }
  495 + }
  496 + }
  497 + return {'tag':tag,'depict':depict,'dirStoE':dirStoE};
  498 + }
  499 +
  500 + /**
  501 + * @description (TODO) 修改对应班次.
  502 + *
  503 + * @param [f--表单的字段值].
  504 + *
  505 + * @status OK.
  506 + */
  507 + function changeValue(f) {
  508 + // 修改方向.
  509 + dqbcData.xlDir = f.xlDir;
  510 + // 修改起点站.
  511 + dqbcData.qdz = f.qdz;
  512 + // 修改终点站.
  513 + dqbcData.zdz = f.zdz;
  514 + // 修改发车时间.
  515 + dqbcData.fcsj = f.fcsj;
  516 + // 修改计划里程.
  517 + dqbcData.jhlc = parseInt(f.jhlc);
  518 + // 修改班次时间.
  519 + dqbcData.bcsj = parseInt(f.bcsj);
  520 + if(dqbcData.bcType != obj.configuration.dataMap.bcTypeArr.in_&&
  521 + dqbcData.bcType != obj.configuration.dataMap.bcTypeArr.out) {
  522 + // 修改班次班次类型.
  523 + dqbcData.bcType = f.bcType;
  524 + // 修改是否分班.
  525 + dqbcData.isfb = parseInt(f.isfb);
  526 + }
  527 + // 修改备注.
  528 + dqbcData.bz = f.bz;
  529 + // 创建发车时间对象.
  530 + var ddsj = bf.getDateTime(f.fcsj);
  531 + // 计算当前班次与上一个班次之间的停站间隙.
  532 + var lastStopTime = parseInt((ddsj - bf.getDateTime(nodeContext.lastData.ARRIVALTIME))/60000)
  533 + // 修改到达时间分钟数.这里成为了当前班次的到达时间对象.
  534 + ddsj.setMinutes(ddsj.getMinutes() + parseInt(f.bcsj));
  535 + // 修改当前班次的到达时间.
  536 + dqbcData.ARRIVALTIME = bf.getTimeStr(ddsj);
  537 + // 修改当前班次的停站时间.
  538 + dqbcData.STOPTIME = parseInt((bf.getDateTime(nodeContext.nextData.fcsj) - ddsj)/60000);
  539 + // 修改上一个班次停站时间.
  540 + nodeContext.lastData.STOPTIME = lastStopTime;
  541 + }
  542 +
  543 + function changeDir(dqDir,tzDir) {
  544 + // 获取所有班次. 定义当前路牌下的所有班次、其他路牌下的班次.
  545 + var dtAll = obj.getDataArray(),dqlpbc = new Array,qtlpbc = new Array();
  546 + // 遍历分割班次.
  547 + for(var t = 0 ; t< dtAll.length; t++) {
  548 + // 判断遍历的当前班次路牌是否与选中修改的班次路牌是否一致.
  549 + if(dtAll[t].lpNo == dqbcData.lpNo)
  550 + dqlpbc.push(dtAll[t]);
  551 + else
  552 + qtlpbc.push(dtAll[t]);
  553 + }
  554 + // 首先除去进出场班次和早晚例保班次.定义进出出场和早晚例保班次数组、正常(包括正常、区间、直放、吃饭、放站)班次数组.
  555 + var jcclbbcA = Array(),normalA = new Array();
  556 + for(var d = 0 ; d < dqlpbc.length; d++) {
  557 + if(dqlpbc[d].bcType==obj.configuration.dataMap.bcTypeArr.bd ||
  558 + dqlpbc[d].bcType==obj.configuration.dataMap.bcTypeArr.in_||
  559 + dqlpbc[d].bcType==obj.configuration.dataMap.bcTypeArr.lc ||
  560 + dqlpbc[d].bcType==obj.configuration.dataMap.bcTypeArr.out)
  561 + jcclbbcA.push(dqlpbc[d]);
  562 + else
  563 + normalA.push(dqlpbc[d]);
  564 + }
  565 + // 修改当前路牌下的班次方向.
  566 + for(var r = 0; r<normalA.length;r++) {
  567 + // 修改方向.
  568 + if(normalA[r].xlDir == dqDir) {
  569 + normalA[r].xlDir = tzDir;
  570 + }else if(normalA[r].xlDir == tzDir) {
  571 + normalA[r].xlDir = dqDir;
  572 + }
  573 + }
  574 + // 把当前路牌下的班次按发车序号顺序排序.
  575 + normalA.sort(function(a,b){return a.fcno-b.fcno});
  576 + // 先添加进出场班次和早晚例保班次-->然后合并其他班次-->然后重置发车序号和班次数-->根据数据重新渲染视图.
  577 + return bf.setbcsAndfcno(qtlpbc.concat(bf.addjclbbc(normalA,obj.configuration.dataMap,obj.configuration.stopAraay[0].lbsj,map)));
  578 + }
  579 +
  580 + /**
  581 + * @description : (TODO) 判断班次类型是否为 早晚例保时间、进出场班次、吃饭时间.
  582 + *
  583 + *
  584 + * @return 返回一个布尔值.
  585 + */
  586 + function isUpdsgbctzsj(bcType) {
  587 + var tag = false ;
  588 + if(bcType == obj.configuration.dataMap.bcTypeArr.bd ||
  589 + bcType == obj.configuration.dataMap.bcTypeArr.out ||
  590 + bcType == obj.configuration.dataMap.bcTypeArr.cf ||
  591 + bcType == obj.configuration.dataMap.bcTypeArr.in_ ||
  592 + bcType == obj.configuration.dataMap.bcTypeArr.lc)
  593 + tag = true;
  594 + return tag;
  595 + }
  596 +
  597 + /**
  598 + * @description : (TODO) 判断当前班次是否为 早晚例保、吃饭班次.
  599 + *
  600 + * @return 返回一个布尔值.
  601 + *
  602 + * @status OK.
  603 + */
  604 + function isdqbcDatalbfc(bcType) {
  605 + var tag = false ;
  606 + if(bcType == obj.configuration.dataMap.bcTypeArr.bd ||
  607 + bcType == obj.configuration.dataMap.bcTypeArr.cf ||
  608 + bcType == obj.configuration.dataMap.bcTypeArr.lc)
  609 + tag = true;
  610 + return tag;
  611 + }
  612 +
  613 + /**
  614 + * @description : (TODO) get请求根据时刻表idqbcData获取时刻表信息详情.
  615 + *
  616 + * @param [id--时刻表id;cb--回调函数].
  617 + *
  618 + * @return cb 回调函数.
  619 + **/
  620 + function skbIdToName(id,cb) {
  621 + $get('/tic_ec/' + parseInt(id) ,null, function(result){
  622 + return cb && cb(result.data.name);
  623 + });
  624 + }
  625 +
  626 + /**
  627 + * @description : (TODO) get请求根据线路id获取线路信息详情.
  628 + *
  629 + * @param [id--线路id;cb--回调函数].
  630 + *
  631 + * @return cb 回调函数.
  632 + **/
  633 + function xlIdToName(id,cb) {
  634 + $get('/line/' + id ,null, function(result){
  635 + cb && cb(result.name);
  636 + });
  637 + }
  638 +
  639 + /**
  640 + * @description : (TODO) 初始化起终点站下拉框.
  641 + *
  642 + * @param [xlid--线路id;cb--回调函数].
  643 + *
  644 + * @stauts cb 回调函数.
  645 + **/
  646 + function initZdSelect(xlid,cb) {
  647 + // get请求根据线路id、站点类型获取该线路下的起终点(包括上下行).
  648 + $get('/stationroute/all', {'line.id_eq':xlid,'stationMark_notLike':'Z'}, function(rs){
  649 + // 定义下拉框option.
  650 + var ticGroup = '<option value="">请选择...</option>';
  651 + // 定义上行optgroup.
  652 + var upGroup = '<optgroup label="上行">';
  653 + // 定义下行optgroup.
  654 + var downGroup = '<optgroup label="下行">';
  655 + // 返回数据长度.
  656 + var len = rs.length;
  657 + // 如果长度大于零.
  658 + if(len>0) {
  659 + // 定义上下行的起终点站ID与名称.
  660 + var upqdzId = '' , upqdzname = '' , upzdzId = '' , upzdzname = '' ,
  661 + downqdzId = '' , downqdzname = '' , downzdzId = '' ,downzdzname = '';
  662 + // 遍历.
  663 + $.each(rs, function(r, s){
  664 + // 定义站点类型.
  665 + var zdType = '';
  666 + // 判断方向.并赋予对应的optgroup.
  667 + if(s.directions == 0) {
  668 + // 判断站点类型.并赋予对应的字符值.
  669 + if(s.stationMark == 'B' ) {
  670 + zdType = ' (起点站)';
  671 + upqdzId = upqdzId + s.station.id;
  672 + upqdzname = upqdzname + s.station.stationName + zdType;
  673 + }else if(s.stationMark == 'E' ) {
  674 + zdType = ' (终点站)';
  675 + upzdzId = upzdzId + s.station.id;
  676 + upzdzname = upzdzname + s.station.stationName + zdType;
  677 + }
  678 + upGroup += '<option value="'+ s.station.id + '">' + s.station.stationName + zdType + '</option>';
  679 + }else if(s.directions==1) {
  680 + // 判断站点类型.并赋予对应的字符值.
  681 + if(s.stationMark == 'B' ) {
  682 + zdType = ' (起点站)';
  683 + downqdzId = downqdzId + s.station.id;
  684 + downqdzname = downqdzname + s.station.stationName + zdType;
  685 + }else if(s.stationMark == 'E' ) {
  686 + zdType = ' (终点站)';
  687 + downzdzId = downzdzId + s.station.id;
  688 + downzdzname = downzdzname + s.station.stationName + zdType;
  689 + }
  690 + downGroup += '<option value="'+ s.station.id + '">' + s.station.stationName + zdType +'</option>';
  691 + }
  692 + lineDirStoEStation[0] = {'dir' :'relationshipGraph-up' ,'qdz' :upqdzId, 'zdz' : upzdzId,'qdzname':upqdzname,'zdzname':upzdzname};
  693 + lineDirStoEStation[1] = {'dir' :'relationshipGraph-down', 'qdz' :downqdzId, 'zdz' :downzdzId,'qdzname':downqdzname,'zdzname':downzdzname};
  694 + });
  695 + }
  696 + upGroup += '</optgroup>';
  697 + downGroup += '</optgroup>';
  698 + ticGroup = ticGroup + upGroup + downGroup;
  699 + // 初始化起点站select2.
  700 + $('#qdzInput').html(ticGroup).select2();
  701 + // 初始化终点站select2.
  702 + $('#zdzInput').html(ticGroup).select2();
  703 + // 返回回调函数.
  704 + return cb && cb();
  705 + });
  706 + }
  707 + /**
  708 + * @description : (TODO) 设值表单字段值.
  709 + *
  710 + * @param [f--班次对象]
  711 + *
  712 + * @status OK.
  713 + **/
  714 + function setFormValue() {
  715 + // 设值路牌名称.
  716 + $('#lpInput').val(dqbcData.lpName);
  717 + // 设值班次序号.
  718 + $('#fcnoInput').val(dqbcData.fcno);
  719 + // 设值方向.
  720 + $('#xlDirInput').val(dqbcData.xlDir);
  721 + // 设值发车时间.
  722 + $('#fcsjInput').val(dqbcData.fcsj);
  723 + // 设值班次序号.
  724 + $('#bcsInput').val(dqbcData.bcs);
  725 + // 计划里程.
  726 + $('#jhlcInput').val(dqbcData.jhlc);
  727 + // 设值班次历时.
  728 + $('#bcsjInput').val(dqbcData.bcsj);
  729 + // 设值班次类型.
  730 + $('#bcTypeInput').val(dqbcData.bcType);
  731 + // 设值备注。
  732 + $('#bzInput').val(dqbcData.bz);
  733 + // 设值是否分班.
  734 + $('#isfbSelect').val(dqbcData.isfb);
  735 + isDisabled(dqbcData.bcType);
  736 + if(dqbcData.bcType == obj.configuration.dataMap.bcTypeArr.in_||
  737 + dqbcData.bcType == obj.configuration.dataMap.bcTypeArr.out) {
  738 + $("#bcTypeInput").attr("disabled", true);
  739 + $("#isfbSelect").attr("disabled", true);
  740 + }
  741 +
  742 + }
  743 +
  744 + /**
  745 + * @description : (TODO) 根据班次类型是否把起终点设置为disabled.
  746 + *
  747 + * @params [bcType--班次类型]
  748 + **/
  749 + function isDisabled(bcType) {
  750 + if(isdqbcDatalbfc(bcType)) {
  751 + $("#xlDirInput").attr("disabled", true);
  752 + $("#qdzInput").prop("disabled", true);
  753 + $("#zdzInput").prop("disabled", true);
  754 + $("#fcsjInput").attr("disabled", true);
  755 + $("#bcTypeInput").attr("disabled", true);
  756 + $("#bcsjInput").attr("disabled", true);
  757 + $("#jhlcInput").attr("disabled", true);
  758 + $("#isfbSelect").attr("disabled", true);
  759 + /* $("#qdzInput").select2("val", '');
  760 + $("#zdzInput").select2("val", ''); */
  761 + }else {
  762 + $("#qdzInput").prop("disabled", false);
  763 + $("#zdzInput").prop("disabled", false);
  764 + }
  765 + }
  766 +});
  767 +</script>
0 768 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/gantt.html 0 → 100644
  1 +<link type="text/css" href="/pages/base/timesmodel/js/ContextJS/css/context.standalone.css" rel="stylesheet"/>
  2 +<link type="text/css" href="/pages/base/timesmodel/css/d3.relationshipgraph.min.css" rel="stylesheet"/>
  3 +<link type="text/css" href="/pages/base/timesmodel/css/index.css" rel="stylesheet"/>
  4 +<!-- 片段标题 START -->
  5 +<div class="page-head">
  6 + <div class="page-title">
  7 + <h1>时刻表明细模型</h1>
  8 + </div>
  9 +</div>
  10 +<!-- 片段标题 END -->
  11 +
  12 +<!-- 线路信息导航栏组件 START -->
  13 +<ul class="page-breadcrumb breadcrumb">
  14 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  15 + <li><span class="active">运营计划管理</span> <i class="fa fa-circle"></i></li>
  16 + <li><span class="active">时刻表明细模型</span></li>
  17 +</ul>
  18 +<!-- 线路信息导航栏组件 END -->
  19 +
  20 +<!-- row 组件START -->
  21 +<div class="row">
  22 +
  23 + <!-- col-md-12 组件START -->
  24 + <div class="col-md-12">
  25 +
  26 + <!-- portlet 组件START -->
  27 + <div class="portlet light porttlet-fit bordered">
  28 +
  29 + <!-- portlet-title组件START -->
  30 + <div class="portlet-title">
  31 +
  32 + <!-- caption 组件START -->
  33 + <div class="caption">
  34 + <i class="fa fa-database font-dark"></i>
  35 + <span class="caption-subject font-dark sbold uppercase">时刻表明细模型</span>
  36 + </div>
  37 + <!-- caption 组件END -->
  38 + <div class="tools" style="margin-left: 20px;margin-top: -10px;">
  39 + <a href="" class="fullscreen" data-original-title="" title="" style="text-decoration: none;"> </a>
  40 + </div>
  41 + <!-- actions 组件START -->
  42 + <div class="actions">
  43 + <div class="btn-group btn-group-devided checkbtn" data-toggle="buttons">
  44 + <a class="btn btn-circle blue checkAdd" href="javascript:;" data-pjax><i class="fa fa-check"></i> 保存数据</a>
  45 + </div>
  46 + <div class="btn-group checkbtn">
  47 + <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown" aria-expanded="false">
  48 + <i class="fa fa-cog"></i>
  49 + <span>系统工具</span>
  50 + <i class="fa fa-angle-down"></i>
  51 + </a>
  52 + <ul class="dropdown-menu pull-right">
  53 + <li>
  54 + <a href="javascript:;" class="tool-action revoke">
  55 + <i class="fa fa-reply"></i>&nbsp;撤&nbsp;&nbsp;销
  56 + </a>
  57 + </li>
  58 + <li>
  59 + <a href="javascript:" class="tool-action recover">
  60 + <i class="fa fa-share"></i>&nbsp;恢&nbsp;&nbsp;复
  61 + </a>
  62 + </li>
  63 + <li>
  64 + <a href="javascript:" class="tool-action reladelete">
  65 + <i class="fa fa-close"></i>&nbsp;批量删除
  66 + </a>
  67 + </li>
  68 + <li>
  69 + <a href="javascript:" class="tool-action reladplus">
  70 + <i class="fa fa-plus"></i>&nbsp;添加班次
  71 + </a>
  72 + </li>
  73 + <li>
  74 + <a href="javascript:" class="tool-action addlp">
  75 + <i class="fa fa-plus"></i>&nbsp;添加路牌
  76 + </a>
  77 + </li>
  78 + <li>
  79 + <a href="javascript:" class="tool-action updownread">
  80 + <i class="fa fa-arrows-h"></i>&nbsp;均匀发车
  81 + </a>
  82 + </li>
  83 + <li>
  84 + <a href="javascript:" class="tool-action aboutread">
  85 + <i class="fa fa-arrows-v"></i>&nbsp;调整班次
  86 + </a>
  87 + </li>
  88 + </ul>
  89 + </div>
  90 + </div>
  91 + <!-- actions 组件END -->
  92 + </div>
  93 + <!-- portlet-title组件END -->
  94 +
  95 + <!-- portlet-body组件START -->
  96 + <div class="portlet-body">
  97 + <!-- ganttSvgContainer SVG组件START -->
  98 + <div class="ganttSvgContainer">
  99 + <div id="ganttSvg"></div>
  100 + </div>
  101 + <!-- ganttSvgContainer SVG组件END -->
  102 + </div>
  103 + <!-- portlet-body组件END -->
  104 + </div>
  105 + <!-- portlet 组件END -->
  106 + </div>
  107 + <!-- col-md-12 组件END -->
  108 +</div>
  109 +<!-- row 组件END -->
  110 +<script src="/pages/base/timesmodel/js/ContextJS/js/context.js"></script>
  111 +<script src="/pages/base/timesmodel/js/base-fun.js"></script>
  112 +<script src="/pages/base/timesmodel/js/d3.relationshipgraph.js"></script>
  113 +<script src="/pages/base/timesmodel/js/gantt.js"></script>
0 114 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/index.html 0 → 100644
  1 +<!-- 片段标题 START -->
  2 +<div class="page-head">
  3 + <div class="page-title">
  4 + <h1>时刻表制作模型</h1>
  5 + </div>
  6 +</div>
  7 +<!-- 片段标题 END -->
  8 +
  9 +<!-- 线路信息导航栏组件 START -->
  10 +<ul class="page-breadcrumb breadcrumb">
  11 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  12 + <li><span class="active">运营计划管理</span> <i class="fa fa-circle"></i></li>
  13 + <li><span class="active">时刻表制作模型</span></li>
  14 +</ul>
  15 +<!-- 线路信息导航栏组件 END -->
  16 +
  17 +<!-- row 组件START -->
  18 +<div class="row">
  19 +
  20 + <!-- col-md-12 组件START -->
  21 + <div class="col-md-12">
  22 +
  23 + <!-- portlet 组件START -->
  24 + <div class="portlet light porttlet-fit bordered">
  25 +
  26 + <!-- portlet-title组件START -->
  27 + <div class="portlet-title">
  28 +
  29 + <!-- caption 组件START -->
  30 + <div class="caption">
  31 + <i class="fa fa-database font-dark"></i>
  32 + <span class="caption-subject font-dark sbold uppercase">时刻表制作模型</span>
  33 + </div>
  34 +
  35 + <!-- actions 组件START -->
  36 + <div class="actions">
  37 + <div class="btn-group btn-group-devided plusbtn" data-toggle="buttons">
  38 + <a class="btn btn-circle blue add-moble-args" href="add.html?no=0" data-pjax><i class="fa fa-plus"></i> 添加模型</a>
  39 + </div>
  40 + </div>
  41 + <!-- actions 组件END -->
  42 + </div>
  43 + <!-- portlet-title组件END -->
  44 +
  45 + <!-- portlet-body组件START -->
  46 + <div class="portlet-body">
  47 + <!-- text-info 组件START -->
  48 + <div class="text-info" style="text-align: center;line-height: 200px;">
  49 + <i class="fa fa-info"></i> 请先添加时刻表模型参数!
  50 + </div>
  51 + <!-- text-info 组件END -->
  52 + </div>
  53 + <!-- portlet-body组件END -->
  54 + </div>
  55 + <!-- portlet 组件END -->
  56 + </div>
  57 + <!-- col-md-12 组件END -->
  58 +</div>
  59 +<!-- row 组件END -->
0 60 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/ContextJS/css/context.standalone.css 0 → 100644
  1 +/**
  2 + * ContextJS Styles
  3 + * For use WITHOUT Twitters Bootstrap CSS
  4 + */
  5 +
  6 +.nav-header {
  7 + display: block;
  8 + padding: 3px 15px;
  9 + font-size: 11px;
  10 + font-weight: bold;
  11 + line-height: 20px;
  12 + color: #999;
  13 + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  14 + text-transform: uppercase;
  15 +}
  16 +.dropdown-menu {
  17 + position: absolute;
  18 + top: 100%;
  19 + left: 0;
  20 + /* z-index: 1000; */
  21 + z-index: 100000 !important;
  22 + display: none;
  23 + float: left;
  24 + min-width: 160px;
  25 + padding: 5px 0;
  26 + margin: 2px 0 0;
  27 + list-style: none;
  28 + background-color: #ffffff;
  29 + border: 1px solid #ccc;
  30 + border: 1px solid rgba(0, 0, 0, 0.2);
  31 + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  32 + font-size: 14px;
  33 + *border-right-width: 2px;
  34 + *border-bottom-width: 2px;
  35 + -webkit-border-radius: 6px;
  36 + -moz-border-radius: 6px;
  37 + border-radius: 6px;
  38 + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  39 + -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  40 + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  41 + -webkit-background-clip: padding-box;
  42 + -moz-background-clip: padding;
  43 + background-clip: padding-box;
  44 + text-align:left;
  45 +}
  46 +.dropdown-menu.pull-right {
  47 + right: 0;
  48 + left: auto;
  49 +}
  50 +.dropdown-menu .divider {
  51 + *width: 100%;
  52 + height: 1px;
  53 + margin: 9px 1px;
  54 + *margin: -5px 0 5px;
  55 + overflow: hidden;
  56 + background-color: #e5e5e5;
  57 + border-bottom: 1px solid #ffffff;
  58 +}
  59 +.dropdown-menu a {
  60 + display: block;
  61 + padding: 3px 20px;
  62 + clear: both;
  63 + font-weight: normal;
  64 + line-height: 20px;
  65 + color: #333333;
  66 + white-space: nowrap;
  67 + text-decoration: none;
  68 +}
  69 +.dropdown-menu li > a:hover, .dropdown-menu li > a:focus, .dropdown-submenu:hover > a {
  70 + color: #ffffff;
  71 + text-decoration: none;
  72 + background-color: #0088cc;
  73 + background-color: #0081c2;
  74 + background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
  75 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
  76 + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
  77 + background-image: -o-linear-gradient(top, #0088cc, #0077b3);
  78 + background-image: linear-gradient(to bottom, #0088cc, #0077b3);
  79 + background-repeat: repeat-x;
  80 + filter: progid: dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
  81 +}
  82 +.dropdown-menu .active > a, .dropdown-menu .active > a:hover {
  83 + color: #ffffff;
  84 + text-decoration: none;
  85 + background-color: #0088cc;
  86 + background-color: #0081c2;
  87 + background-image: linear-gradient(to bottom, #0088cc, #0077b3);
  88 + background-image: -moz-linear-gradient(top, #0088cc, #0077b3);
  89 + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));
  90 + background-image: -webkit-linear-gradient(top, #0088cc, #0077b3);
  91 + background-image: -o-linear-gradient(top, #0088cc, #0077b3);
  92 + background-repeat: repeat-x;
  93 + outline: 0;
  94 + filter: progid
  95 + : dximagetransform.microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);
  96 +}
  97 +.dropdown-menu .disabled > a, .dropdown-menu .disabled > a:hover {
  98 + color: #999999;
  99 +}
  100 +.dropdown-menu .disabled > a:hover {
  101 + text-decoration: none;
  102 + cursor: default;
  103 + background-color: transparent;
  104 +}
  105 +.open {
  106 + *z-index: 1000;
  107 +}
  108 +.open > .dropdown-menu {
  109 + display: block;
  110 +}
  111 +.pull-right > .dropdown-menu {
  112 + right: 0;
  113 + left: auto;
  114 +}
  115 +.dropup .caret, .navbar-fixed-bottom .dropdown .caret {
  116 + border-top: 0;
  117 + border-bottom: 4px solid #000000;
  118 + content: "\2191";
  119 +}
  120 +.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu {
  121 + top: auto;
  122 + bottom: 100%;
  123 + margin-bottom: 1px;
  124 +}
  125 +.dropdown-submenu {
  126 + position: relative;
  127 +}
  128 +.dropdown-submenu > .dropdown-menu {
  129 + top: 0;
  130 + left: 100%;
  131 + margin-top: -6px;
  132 + margin-left: -1px;
  133 + -webkit-border-radius: 0 6px 6px 6px;
  134 + -moz-border-radius: 0 6px 6px 6px;
  135 + border-radius: 0 6px 6px 6px;
  136 +}
  137 +.dropdown-submenu > .dropdown-menu.drop-left{
  138 + left:-100%;
  139 +}
  140 +.dropdown-submenu:hover .dropdown-menu {
  141 + display: block;
  142 +}
  143 +.dropdown-submenu > a:after {
  144 + display: block;
  145 + float: right;
  146 + width: 0;
  147 + height: 0;
  148 + margin-top: 5px;
  149 + margin-right: -10px;
  150 + border-color: transparent;
  151 + border-left-color: #cccccc;
  152 + border-style: solid;
  153 + border-width: 5px 0 5px 5px;
  154 + content: " ";
  155 +}
  156 +.dropdown-submenu:hover > a:after {
  157 + border-left-color: #ffffff;
  158 +}
  159 +.dropdown .dropdown-menu .nav-header {
  160 + padding-right: 20px;
  161 + padding-left: 20px;
  162 +}
  163 +/**
  164 + * Context Styles
  165 + */
  166 +
  167 +.dropdown-context .nav-header {
  168 + cursor: default;
  169 +}
  170 +.dropdown-context:before, .dropdown-context-up:before {
  171 + position: absolute;
  172 + top: -7px;
  173 + left: 9px;
  174 + display: inline-block;
  175 + border-right: 7px solid transparent;
  176 + border-bottom: 7px solid #ccc;
  177 + border-left: 7px solid transparent;
  178 + border-bottom-color: rgba(0, 0, 0, 0.2);
  179 + content: '';
  180 +}
  181 +.dropdown-context:after, .dropdown-context-up:after {
  182 + position: absolute;
  183 + top: -6px;
  184 + left: 10px;
  185 + display: inline-block;
  186 + border-right: 6px solid transparent;
  187 + border-bottom: 6px solid #ffffff;
  188 + border-left: 6px solid transparent;
  189 + content: '';
  190 +}
  191 +.dropdown-context-up:before, .dropdown-context-up:after {
  192 + top: auto;
  193 + bottom: -7px;
  194 + z-index: 9999;
  195 +}
  196 +.dropdown-context-up:before {
  197 + border-right: 7px solid transparent;
  198 + border-top: 7px solid #ccc;
  199 + border-bottom: none;
  200 + border-left: 7px solid transparent;
  201 +}
  202 +.dropdown-context-up:after {
  203 + border-right: 6px solid transparent;
  204 + border-top: 6px solid #ffffff;
  205 + border-left: 6px solid transparent;
  206 + border-bottom: none;
  207 +}
  208 +.dropdown-context-sub:before, .dropdown-context-sub:after {
  209 + display: none;
  210 +}
  211 +.dropdown-context .dropdown-submenu:hover .dropdown-menu {
  212 + display: none;
  213 +}
  214 +.dropdown-context .dropdown-submenu:hover > .dropdown-menu {
  215 + display: block;
  216 +}
  217 +
  218 +.compressed-context a{
  219 + padding-left: 14px;
  220 + padding-top: 0;
  221 + padding-bottom: 0;
  222 + font-size: 13px;
  223 + }
  224 +.compressed-context .divider{
  225 + margin: 5px 1px;
  226 + }
  227 +.compressed-context .nav-header{
  228 + padding:1px 13px;
  229 + }
... ...
src/main/resources/static/pages/base/timesmodel/js/ContextJS/css/demo.css 0 → 100644
  1 +
  2 +a, a:visited{
  3 + color:#333
  4 + }
  5 +::selection{
  6 + background:transparent;
  7 + }
  8 +-moz-::selection{
  9 + background:transparent;
  10 + }
  11 +h1, h2, h4{
  12 + font-family: 'Rokkitt', serif;
  13 + font-weight:100;
  14 + font-size:72px;
  15 + }
  16 + h1{
  17 + text-align:center;
  18 + }
  19 + h2{
  20 + font-size:36px;
  21 + margin-bottom:0;
  22 + }
  23 + h4{
  24 + font-size:30px;
  25 + text-align:center;
  26 + }
  27 + h4 a{
  28 + text-decoration:none;
  29 + }
  30 +h3{
  31 + font-family: 'Rokkitt', serif;
  32 + margin-bottom: 0;
  33 + border-bottom: 1px solid #DDD;
  34 + -webkit-box-shadow: 0 1px 0 white;
  35 + -moz-box-shadow: 0 1px 0 white;
  36 + box-shadow: 0 1px 0 white;
  37 + margin-top: 20px;
  38 + }
  39 + #download{
  40 + background: #fefefe;
  41 + width: 500px;
  42 + margin: 0 auto;
  43 + padding: 20px;
  44 + -webkit-border-radius: 5px;
  45 + -moz-border-radius: 5px;
  46 + border-radius: 5px;
  47 + border: 1px solid rgba(0,0,0,0.2);
  48 + }
  49 +
  50 + .description{
  51 + text-align:left;
  52 + width:540px;
  53 + margin:0 auto;
  54 + padding:20px;
  55 + }
  56 +
  57 + pre{
  58 + background: #333;
  59 + overflow: auto;
  60 + padding: 10px;
  61 + color: #fefefe;
  62 + text-shadow: 0 1px 2px #000;
  63 + -webkit-box-shadow: 0 1px 0 #fff, 0 1px 2px #000 inset;
  64 + -moz-box-shadow: 0 1px 0 #fff, 0 1px 2px #000 inset;
  65 + box-shadow: 0 1px 0 #fff, 0 1px 2px #000 inset;
  66 + }
  67 +
  68 + .dropdown-menu{
  69 + text-shadow:none;
  70 + }
  71 +
  72 +
  73 + table{
  74 + font-size:12px;
  75 + border-collapse:collapse;
  76 + background:#fefefe;
  77 + border: 1px solid rgba(0,0,0,0.2);
  78 + font-family:monospace;
  79 + }
  80 + table th:last-child{
  81 + width:175px;
  82 + }
  83 +
  84 + table th, table td:last-child{
  85 + font-family:arial;
  86 + }
  87 +
  88 + .me-codesta{
  89 + display: block;
  90 + margin: 0 auto;
  91 + }
  92 +
  93 + .amp{
  94 + font-family:Baskerville,'Goudy Bookletter 1911',Palatino,'Book Antiqua',serif;
  95 + font-style:italic;
  96 + }
  97 + .finale{
  98 + position:relative;
  99 + height:150px;
  100 + }
  101 + .finale h1{
  102 + position:absolute;
  103 + width:100%;
  104 + -webkit-transition: opacity 0.2s linear;
  105 + -moz-transition: opacity 0.2s linear;
  106 + -o-transition: opacity 0.2s linear;
  107 + transition: opacity 0.2s linear;
  108 + }
  109 + .finale .toggle{
  110 + opacity:0;
  111 + }
  112 +
  113 + #donate{
  114 + display:none;
  115 + }
  116 + .thanks{
  117 + width:500px;
  118 + margin:30px auto;
  119 + }
  120 + a#download{
  121 + display:block;
  122 + text-decoration:none;
  123 + }
... ...
src/main/resources/static/pages/base/timesmodel/js/ContextJS/js/context.js 0 → 100644
  1 +/*
  2 + * @description (TODO) Context.js 右键菜单栏轻量级修订版.
  3 + *
  4 + * 》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》
  5 + * http://lab.jakiestfu.com/contextjs/ API说明文档.
  6 + * 《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《《
  7 + *
  8 + */
  9 +
  10 +var context = context || (function () {
  11 +
  12 + // 标记是否在创建右键菜单栏.作用与rect元素的拖炸事件.
  13 + var isContext = false;
  14 +
  15 + // 设置插件的配置参数信息.
  16 + var options = {
  17 + fadeSpeed: 100,// 上下文菜单淡入的速度(以毫秒为单位)
  18 + filter: function ($obj) {
  19 + // 每个完成的列表元素将通过以进行额外修改的功能。
  20 + },
  21 + above: 'auto',// 如果设置为“自动”,如果下面没有足够的空间,菜单将显示为“下拉”。设置为true将使菜单默认为“弹出”。
  22 + preventDoubleContext: true,// 如果设置为true,则基于浏览器的上下文菜单将无法在contextjs菜单上使用。
  23 + compress: false // 如果设置为true,则上下文菜单将具有较少的填充,使它们(希望)更不引人注目
  24 + };
  25 +
  26 + /**
  27 + * @description : (TODO) 初始化
  28 + *
  29 + * @param [opts--配置参数]
  30 + * */
  31 + function initialize(opts) {
  32 + // 修改options配置参数.
  33 + options = $.extend({}, options, opts);
  34 + // 监听htmlclick事件.
  35 + $(document).on('click', 'html', function () {
  36 + // 使用淡出效果来隐藏一个菜单栏.
  37 + $('.dropdown-context').fadeOut(options.fadeSpeed, function(){
  38 + $('.dropdown-context').css({display:''}).find('.drop-left').removeClass('drop-left');
  39 + d3.selectAll('.selected').classed({'selected':false});
  40 + setisContext(false);
  41 + });
  42 + });
  43 + // 判断.如果设置为true,则基于浏览器的上下文菜单将无法在contextjs菜单上使用。
  44 + if(options.preventDoubleContext){
  45 + $(document).on('contextmenu', '.dropdown-context', function (e) {
  46 + e.preventDefault();
  47 + });
  48 + }
  49 + // 当鼠标指针进入(穿过)元素时.
  50 + $(document).on('mouseenter', '.dropdown-submenu', function(){
  51 + var $sub = $(this).find('.dropdown-context-sub:first'),
  52 + subWidth = $sub.width(),
  53 + subLeft = $sub.offset().left,
  54 + collision = (subWidth+subLeft) > window.innerWidth;
  55 + if(collision){
  56 + $sub.addClass('drop-left');
  57 + }
  58 + });
  59 +
  60 + }
  61 +
  62 + /**
  63 + * @description : (TODO) 更新配置参数.
  64 + *
  65 + * @status OK.
  66 + * */
  67 + function updateOptions(opts){
  68 + // 重新赋值options.
  69 + options = $.extend({}, options, opts);
  70 + }
  71 +
  72 + /**
  73 + * @description : (TODO) 创建加载菜单栏.
  74 + *
  75 + * @param [data--菜单栏内容;id--菜单栏父容器ID值;subMenu--menu字符串值]
  76 + *
  77 + * @returns 返回菜单栏元素对象.
  78 + * */
  79 + function buildMenu(data, id, subMenu) {
  80 + // 判断subMenu是否为空或者undefined,如果为空则默认赋值一个空字符串.否则使用本身.
  81 + var subClass = (subMenu) ? ' dropdown-context-sub' : '',
  82 + compressed = options.compress ? ' compressed-context' : '',// 如果设置为true,则上下文菜单将具有较少的填充,使它们(希望)更不引人注目.
  83 + $menu = $('<ul class="dropdown-menu dropdown-context' + subClass + compressed+'" id="dropdown-' + id + '"></ul>');// 获取菜单栏元素对象.
  84 + var i = 0, linkTarget = '';
  85 + for(i; i<data.length; i++) {
  86 + // 是否使用分割线.
  87 + if (typeof data[i].divider !== 'undefined') {
  88 + $menu.append('<li class="divider"></li>');
  89 + // 是否有标题.
  90 + } else if (typeof data[i].header !== 'undefined') {
  91 + $menu.append('<li class="nav-header">' + data[i].header + '</li>');
  92 + } else {
  93 + // 是否有超链接的URL.
  94 + if (typeof data[i].href == 'undefined') {
  95 + data[i].href = '#';
  96 + }
  97 + // 是否打开新标签页.
  98 + if (typeof data[i].target !== 'undefined') {
  99 + linkTarget = ' target="'+data[i].target+'"';
  100 + }
  101 + // 是否有子菜单.
  102 + if (typeof data[i].subMenu !== 'undefined') {
  103 + $sub = ('<li class="dropdown-submenu"><a tabindex="-1" href="' + data[i].href + '">' + data[i].text + '</a></li>');
  104 + } else {
  105 + $sub = $('<li><a tabindex="-1" href="' + data[i].href + '"'+linkTarget+'>' + data[i].text + '</a></li>');
  106 + }
  107 + // 是否有自定义的action方法.如果有则给该a标签元素监听click事件.
  108 + if (typeof data[i].action !== 'undefined') {
  109 + var actiond = new Date(),
  110 + actionID = 'event-' + actiond.getTime() * Math.floor(Math.random()*100000),
  111 + eventAction = data[i].action;
  112 + $sub.find('a').attr('id', actionID);
  113 + $('#' + actionID).addClass('context-event');
  114 + $(document).on('click', '#' + actionID, eventAction);
  115 + }
  116 + // 添加元素,做为当前元素的子元素.
  117 + $menu.append($sub);
  118 + // 追加子菜单.
  119 + if (typeof data[i].subMenu != 'undefined') {
  120 + var subMenuData = buildMenu(data[i].subMenu, id, true);
  121 + $menu.find('li:last').append(subMenuData);
  122 + }
  123 + }
  124 + // 每个完成的列表元素将通过以进行额外修改的功能。
  125 + if (typeof options.filter == 'function') {
  126 + options.filter($menu.find('li:last'));
  127 + }
  128 + }
  129 + return $menu;
  130 + }
  131 +
  132 + /**
  133 + * @description : (TODO) 鼠标右键rect元素创建菜单栏.
  134 + *
  135 + * @param [selector--右键创建菜单栏元素;data--菜单栏内容]
  136 + *
  137 + * @status OK.
  138 + * */
  139 + function addContext(selector, data) {
  140 + // 获取时间的毫秒数来作为唯一ID.
  141 + var d = new Date(),
  142 + id = d.getTime(),
  143 + $menu = buildMenu(data, id);
  144 + // 添加右键菜单HTML内容.
  145 + $('.ganttSvgContainer').append($menu);
  146 + /**
  147 + * @description : (TODO) 监听contextmenu事件.
  148 + *
  149 + * @status OK.
  150 + * */
  151 + $(document).on('contextmenu', selector, function (e) {
  152 + // 获取右键rect元素的数据属性.
  153 + var $dt = d3.select(this).data()[0];
  154 + // 判断.如果右键点击的是统计值的rect元素,则结束.否则继续往下执行.
  155 + if($dt.bcType=='tjz')
  156 + return;
  157 + setisContext(true);
  158 + // 去除除本次鼠标右键点击选择的rect元素之外的 所有鼠标右键点击过的rect元素.
  159 + d3.selectAll('.selected').classed({'selected':false});
  160 + // 给当前rect元素添加标记选择.
  161 + d3.select(this).classed({'selected':true});
  162 + // 阻止元素发生默认的行为(例如,当点击提交按钮时阻止对表单的提交;点击a标记的URL时阻止打开链接等等.).
  163 + e.preventDefault();
  164 + // 阻止事件冒泡.不再派发事件.阻止把事件分派到其他节点。
  165 + e.stopPropagation();
  166 + // 隐藏元素.
  167 + $('.dropdown-context:not(.dropdown-context-sub)').hide();
  168 + // 选择元素.
  169 + $dd = $('#dropdown-' + id);
  170 + // 判断. 根据插件配置的参数值.设置为true将使菜单默认为“弹出”。
  171 + if (typeof options.above == 'boolean' && options.above) {
  172 + $dd.addClass('dropdown-context-up').css({
  173 + top: e.pageY - 20 - $('#dropdown-' + id).height(),
  174 + left: e.pageX - 13
  175 + }).fadeIn(options.fadeSpeed);
  176 + // 如果设置为“自动”,如果下面没有足够的空间,菜单将显示为“下拉”。
  177 + } else if (typeof options.above == 'string' && options.above == 'auto') {
  178 + // 删除样式.
  179 + $dd.removeClass('dropdown-context-up');
  180 + // 计算高度.
  181 + var autoH = $dd.height() + 12;
  182 + // 计算宽度.
  183 + var autoW = $dd.width() + 12;
  184 + // 获取元素.
  185 + var container = $('.ganttSvgContainer'), scrollTo = $(this);
  186 + // 修改元素的位置属性值.
  187 + $dd.css({
  188 + top: e.offsetY + 10,
  189 + left: e.offsetX - 13
  190 + }).fadeIn(options.fadeSpeed);
  191 + // 判断.如果鼠标指针的位置(相对于文档的左边缘)的Y + 右键菜单栏高度 大于 了svg父容器的高度,则移动浏览器垂直滚动条位置.
  192 + if ((e.pageY + autoH) > $('.ganttSvgContainer').height()) {
  193 + container.animate({ scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop()});
  194 + }
  195 + // 判断.如果鼠标指针的位置(相对于文档的左边缘)的X + 右键菜单栏宽度 大于了最大宽度 ,则移动浏览器水平滚动条位置.
  196 + if ((e.pageX + autoW) > 1529) {
  197 + container.animate({scrollLeft: e.offsetX + autoW - $('.ganttSvgContainer').width() + 20});
  198 + }
  199 + // 判断.如果鼠标指针的位置(相对于文档的左边缘)的X 小于了最小宽度 ,则移动浏览器水平滚动条位置.
  200 + if (e.pageX < 300) {
  201 + container.animate({ scrollLeft: e.offsetX - 20});
  202 + }
  203 + }
  204 + });
  205 + }
  206 +
  207 + /**
  208 + * @description : (TODO) 销毁右键菜单栏.
  209 + *
  210 + * @status OK.
  211 + * */
  212 + function destroyContext(selector) {
  213 + $(document).off('contextmenu', selector).off('click', '.context-event');
  214 + }
  215 +
  216 + function setisContext(boolean) {
  217 + isContext = boolean;
  218 + }
  219 +
  220 + function getisContext() {
  221 + return isContext;
  222 + }
  223 +
  224 + // 返回context对象.
  225 + return {
  226 + init: initialize,
  227 + settings: updateOptions,
  228 + attach: addContext,
  229 + destroy: destroyContext,
  230 + getisContext:getisContext,
  231 + setisContext:setisContext
  232 + };
  233 +})();
0 234 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/add-form-reload.js 0 → 100644
  1 +(function(){
  2 + // 关闭左侧栏
  3 + if (!$('body').hasClass('page-sidebar-closed')) {
  4 + $('.menu-toggler.sidebar-toggler').click();
  5 + }
  6 + setTimeout(function(){
  7 + SKBFormWizard.init();
  8 + // 获取参数ID
  9 + var skbId = parseInt($.url().param('no'));
  10 + $get('/tic_ec/all', null, function(rs){
  11 + var ticGroup = '<option value="">请选择...</option><optgroup label="时刻表名称">';
  12 + if(rs.status =='SUCCESS') {
  13 + $.each(rs.data, function(r, s){
  14 + ticGroup += '<option value="'+ s.id + '">' + s.name+'</option>';
  15 + });
  16 + ticGroup += '</optgroup>';
  17 + }
  18 + $('#skbNameSelect').html(ticGroup).select2().on('change', setLineValue);
  19 + if(skbId>0)
  20 + $("#skbNameSelect").select2("val", skbId);
  21 + });
  22 + function setLineValue() {
  23 + if( skbId == parseInt($("#skbNameSelect").val()))
  24 + return;
  25 + if($('#skbNameSelect').val() == '') {
  26 + $("#lineSelect").select2("val", '');
  27 + }else {
  28 + skbId = parseInt($("#skbNameSelect").val());
  29 + setLine();
  30 + }
  31 + }
  32 + // 填充公司下拉框选择值
  33 + $get('/line/all', null, function(array){
  34 + var opGroup = '<option value="">请选择...</option><optgroup label="线路">';
  35 + var len_ = array.length;
  36 + if(len_>0) {
  37 + $.each(array, function(i, g){
  38 + opGroup += '<option value="'+ g.id + '_' + g.lineCode + '_' + g.name + '">'+g.name+'</option>';
  39 + });
  40 + }
  41 + opGroup += '</optgroup>';
  42 + $('#lineSelect').html(opGroup).select2();
  43 + // $("#lineSelect").prop("disabled", true);
  44 + if(skbId>0)
  45 + setLine();
  46 + });
  47 + function setLine(){
  48 + $get('/tic_ec/' + skbId ,null, function(d){
  49 + if(d.status=='SUCCESS') {
  50 + $("#lineSelect").select2("val", d.data.xl.id + '_' + d.data.xl.lineCode + '_' + d.data.xl.name);
  51 + }
  52 + });
  53 + }
  54 + // 提交
  55 + $('.button-submit').on('click',function() {
  56 + // 获取表单
  57 + var formSubm = $('#submit_argus_form');
  58 + formSubm.submit();
  59 + });
  60 + }, 50);
  61 +})();
0 62 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/add-form-wizard.js 0 → 100644
  1 +
  2 +/**
  3 + * 表单的导航向导、验证、提交
  4 + *
  5 + */
  6 +
  7 +var SKBFormWizard = function() {
  8 + var getLineInfo = function(lineId,cb) {
  9 + // 根据线路标准ID查询详情
  10 + $get('/lineInformation',{'line.id_eq':lineId},function(result) {
  11 + return cb && cb(result);
  12 + });
  13 + }
  14 + var gettccInfo = function (cb) {
  15 + $get('/carpark/all',null, function(cd){
  16 + return cb && cb(cd);
  17 + });
  18 + }
  19 +
  20 + var getDateTime = function(time) {
  21 + var dateTime = new Date();
  22 + if(time !=null && time !='' && typeof(time) !='undefined') {
  23 + dateTime = new Date(Date.parse(time.replace(/-/g, "/")));
  24 + }
  25 + return dateTime;
  26 + }
  27 +
  28 +
  29 + function getsjdArr(map) {
  30 + var seMap = getStartAndEndDate(map);
  31 + return [{'num':0,'time':seMap.s + '-' + map.earlyStartTime},
  32 + {'num':0,'time':map.earlyStartTime + '-' + map.earlyEndTime},
  33 + {'num':0,'time':map.earlyEndTime + '-' + map.lateStartTime},
  34 + {'num':0,'time':map.lateStartTime + '-' + map.lateEndTime},
  35 + {'num':0,'time':map.lateEndTime + '-' + seMap.e}];
  36 + }
  37 +
  38 + function getStartAndEndDate(map) {
  39 + return {'s':getMinDate(map.line.startStationFirstTime,map.line.endStationFirstTime),
  40 + 'e':getMaxDate(map.line.startStationEndTime,map.line.endStationEndTime)}
  41 + }
  42 +
  43 + function getMinDate(d1,d2) {
  44 + var str = '';
  45 + if(strToTime(d1)>strToTime(d2))
  46 + str = d2;
  47 + else
  48 + str = d1;
  49 + return str;
  50 + }
  51 +
  52 + function strToTime(t) {
  53 + var d = new Date();
  54 + if(t) {
  55 + var _str = t.split(':');
  56 + d.setHours(parseInt(_str[0]));
  57 + d.setMinutes(parseInt(_str[1]));
  58 + }
  59 + return d;
  60 + }
  61 +
  62 + function getMaxDate(d1,d2) {
  63 + var str = '';
  64 + if(strToTime(d1)>strToTime(d2))
  65 + str = d1;
  66 + else
  67 + str = d2;
  68 + return str;
  69 + }
  70 +
  71 + function issjd(st,ed,sj) {
  72 + var tag = false;
  73 + if(sj<=ed && sj>=st)
  74 + tag = true;
  75 + return tag;
  76 + }
  77 +
  78 + var getHtmlTemp = function(n,map,lineId,krl,cb) {
  79 + var zzsj = parseInt(map.upTravelTime) + 10*2 + parseInt(map.downTravelTime);
  80 + var tempName = '';
  81 + var date = new Date(),
  82 + rq = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + (date.getDate()-3);
  83 + var startDateTime = rq + ' ' + '00:00';
  84 + var endDateTime = rq + ' ' + '23:59';
  85 + var params = {'xlid':'10773','startDateTime':startDateTime,'endDateTime':endDateTime,'zzsj':zzsj};
  86 + if(n==0) {
  87 + tempName = 'carnum_temp';
  88 + }else if(n==1) {
  89 + tempName = 'bctype_temp';
  90 + }
  91 + $.get('/pages/base/timesmodel/tepms/'+ tempName + '.html', function(html){
  92 + $('#tab3').append(html);
  93 + map.lb = 15;
  94 + map.workeLunch = 20;
  95 + map.workeDinner = 20;
  96 + map.mixstopTime = 3;
  97 + map.maxstopTime = 20;
  98 + map.stopTime = 10;
  99 + if(n==0) {
  100 + getJSONP("http://139.196.13.237:8080/bsth-busfareflow-gj/Crlcxb/selectsjbctgl.do",params,function(json){
  101 + console.log(json);
  102 + var sjdArr = getsjdArr(map),krlInt = parseInt(krl);
  103 + for(var s = 0 ; s<sjdArr.length;s++) {
  104 + var strA = sjdArr[s].time.split('-');
  105 + var st = getDateTime(rq + ' ' + strA[0]),et = getDateTime(rq + ' ' + strA[1]),num = 0;
  106 + for(var j = 0 ; j < json.length; j ++) {
  107 + var dqsj = getDateTime(json[j].sj);
  108 + if(issjd(st,et,dqsj)) {
  109 + num = num + Math.ceil(parseInt(json[j].tgl)/krlInt);
  110 + }
  111 + }
  112 + sjdArr[s].num = num;
  113 + }
  114 + /*map.zgfbeforepcs = sjdArr[0].num;
  115 + map.zgfpcs = sjdArr[1].num;
  116 + map.gfzjpcs = sjdArr[2].num;
  117 + map.wgfpcs = sjdArr[3].num;
  118 + map.wgfafterpcs = sjdArr[4].num;*/
  119 + map.zgfbeforepcs = 3;
  120 + map.zgfpcs = 10;
  121 + map.gfzjpcs = 8;
  122 + map.wgfpcs = 10;
  123 + map.wgfafterpcs = 5;
  124 +
  125 + return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
  126 + });
  127 + }else if(n==1) {
  128 + return cb && cb ({'forminput':template(tempName,{map:map}),'datadisplay': template(tempName +'config',{map:null})});
  129 + }
  130 + });
  131 + }
  132 + var getCarNumber = function (param,cb) {
  133 + $post('url',param,function(data) {
  134 + return cb && cb(data);
  135 + })
  136 + }
  137 + return {
  138 + // 启动初始化向导导航
  139 + init : function() {
  140 + if(!jQuery().bootstrapWizard) {return;}
  141 + var form = $('#submit_argus_form');// 表单
  142 + var error = $('.alert-danger',form);// 表单异常
  143 + var success = $('.alert-success',form);// 表单成功
  144 + /** 表单验证 */
  145 + form.validate({
  146 + errorElement : 'span',// 错误提示元素span对象
  147 + errorClass : 'help-block help-block-error',// 错误提示元素class名称
  148 + focusInvalid : true,// 验证错误获取焦点
  149 + /** 需要验证的表单元素 */
  150 + rules : {
  151 + 'skbName' : {required : true,},// 时刻表名称,必填项.
  152 + 'lineName' : {required : true,},// 线路名称,必填项.
  153 + 'krl' : {isBaseRes : true,number : true,digits : true,},// 客容量,当选择为客流方式时必填项、整数
  154 + 'startStationFirstTime' : {required : true}, // 起始站首班时间,必填项.
  155 + 'startStationEndTime' : {required : true}, // 起始站末班时间 ,必填项.
  156 + 'endStationFirstTime' : {required : true}, // 终点站首班时间 ,必填项.
  157 + 'endStationFirstTime' : {required : true}, // 终点站末班时间 ,必填项.
  158 + 'endStationEndTime' : {required : true}, // 终点站末班时间,必填项.
  159 + 'earlyStartTime' : {required : true},// 早高峰开始时间,必填项 .
  160 + 'earlyEndTime' : {required : true},// 早高峰结束时间,必填项 .
  161 + 'lateStartTime' : {required : true},// 晚高峰开始时间,必填项 .
  162 + 'lateEndTime' : {required : true},// 晚高峰结束时间,必填项.
  163 + 'zgfbeforepcs' : {required : true,number : true,digits : true},// 早高峰前车辆数,必填项、必须为整数.
  164 + 'zgfpcs' : {required : true,number : true,digits : true},// 早高峰车辆数,必填项、必须为整数.
  165 + 'wgfafterpcs' : {required : true,number : true,digits : true},// 晚高峰后车俩数,必填项、必须为整数.
  166 + 'wgfpcs' : {required : true,number : true,digits : true},// 晚高峰车俩数,必填项、必须为整数.
  167 + 'gfzjpcs' : {required : true,number : true,digits : true},// 高峰中间车辆数,必填项、必须为整数.
  168 + 'upTravelTime' : {required : true,number : true},// 上行行驶时间,必填项、必须为整数.
  169 + 'downTravelTime' : {required : true,number : true},// 下行行驶时间,必填项、必须为整数.
  170 + 'upMileage' : {required : true,number : true},// 上行行驶里程,必填项、必须为整数.
  171 + 'downMileage' : {required : true,number : true},// 下行行驶里程,必填项、必须为整数.
  172 + 'stopTime' : {required : true,number : true,digits : true},// 停站间隙,必填项、必须为整数.
  173 + 'maxstopTime' : {required : true,number : true,digits : true},// 最大停站间隙,必填项、必须为整数.
  174 + 'mixstopTime' : {required : true,number : true,digits : true},// 最小停站间隙,必填项、必须为整数.
  175 + 'earlyUpTime' : {number : true},// 早高峰上行时间,必须为数字.
  176 + 'earlyDownTime' : {number : true},// 早高峰下行时间,必须为数字.
  177 + 'lateUpTime' : {number : true},// 晚高峰上行时间,必须为数字.
  178 + 'lateDownTime' : {number : true},// 晚高峰下行时间,必须为数字.
  179 + 'troughUpTime' : {number : true},// 低谷上行时间,必须为数字.
  180 + 'troughDownTime' : {number : true},// 低谷下行时间,必须为数字.
  181 + 'qjUpTime' : {number : true},// 区间上行时间,必须为数字.
  182 + 'qjDownTime' : {number : true},// 区间下行时间,必须为数字.
  183 + 'kfsj' : {number : true,digits : true},// 空放行驶时间,必须为数字.
  184 + 'workeLunch' : {number : true},// 工作餐午餐时间,必须为数字.
  185 + 'workeDinner' : {number : true},// 工作餐晚餐时间,必须为数字.
  186 + 'upInTimer' : {number : true},// 上行进场时间,必须为数字.
  187 + 'upOutTimer' : {number : true},// 上行出场时间,必须为数字.
  188 + 'downInTimer' : {number : true},// 下行进场时间,必须为数字.
  189 + 'downOutTimer' : {number : true},// 下行出场时间,必须为数字.
  190 + 'upInMileage' : {number : true},// 上行进场里程,必须为数字.
  191 + 'upOutMileage' : {number : true},// 上行出场里程,必须为数字.
  192 + 'downInMileage' : {number : true},// 下行进场里程,必须为数字.
  193 + 'downOutMileage' : {number : true},// 下行出场里程,必须为数字.
  194 + 'lb' : {number : true},// 早晚例行保养,必须为数字.
  195 + 'clzs':{required : true,number : true,digits : true},// 车辆总数,必填项、必须为整数.
  196 + 'bxrc' : {required : true},// 早晚例行保养,必须为数字.
  197 + },
  198 +
  199 + /**
  200 + * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。
  201 + *
  202 + * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator)
  203 + */
  204 + invalidHandler : function(event, validator) {
  205 + error.show();// 显示表单未通过提示信息
  206 + App.scrollTo(error, -200);// 把提示信息放到指定的位置。
  207 + },
  208 +
  209 + /**
  210 + * 类型:Callback。
  211 + *
  212 + * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。
  213 + */
  214 + highlight : function(element) {
  215 + $(element).closest('.form-group').addClass('has-error');// 添加errorClass("has-error")到表单元素
  216 + },
  217 +
  218 + /**
  219 + * 类型:Callback。
  220 + *
  221 + * 默认:移除errorClass("has-error")。与highlight操作相反
  222 + */
  223 + unhighlight : function(element) {
  224 + $(element).closest('.form-group').removeClass('has-error');// 移除errorClass("has-error")
  225 + },
  226 +
  227 + /**
  228 + * 类型:String,Callback。
  229 + *
  230 + * 如果指定它,当验证通过时显示一个消息。
  231 + *
  232 + * 如果是String类型的,则添加该样式到标签中;
  233 + *
  234 + * 如果是一个回调函数,则将标签作为其唯一的参数。
  235 + */
  236 + success : function(label) {
  237 + label.closest('.form-group').removeClass('has-error');// 当验证通过时,移除errorClass("has-error")
  238 + },
  239 +
  240 + /**
  241 + * 类型:Callback。
  242 + *
  243 + * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form
  244 + */
  245 + submitHandler : function(f) {
  246 + var storage = window.localStorage;
  247 + var argus = form.serializeJSON();
  248 + $get('/stationroute/all',{'line.id_eq':argus.lineName.split('_')[0]},function(result) {
  249 + if(result) {
  250 + var upB ='',upE='',downB='',downE='';
  251 + for(var r = 0 ; r<result.length;r++) {
  252 + if(result[r].directions==0 && result[r].stationMark =='B')
  253 + upB = result[r].station.id;
  254 + if(result[r].directions==0 && result[r].stationMark =='E')
  255 + upE = result[r].station.id;
  256 + if(result[r].directions==1 && result[r].stationMark =='B')
  257 + downB = result[r].station.id;
  258 + if(result[r].directions==1 && result[r].stationMark =='E')
  259 + downE = result[r].station.id;
  260 + }
  261 + argus.up_s = upB + '_' + upE;
  262 + argus.down_s = downB + '_' + downE;
  263 + $get('/carpark/all',{'parkCode_eq':argus.tcc},function(cp) {
  264 + var tcc_id = '';
  265 + if(cp) {
  266 + tcc_id = cp[0].id;
  267 + }
  268 + argus.tcc_id = tcc_id;
  269 + argus.skbmc = $('#skbNameSelect').select2('data')[0].text;
  270 + argus.xlmc = $('#lineSelect').select2('data')[0].text;
  271 + $get('/tidc/all',{'ttinfo.id_eq':parseInt(argus.skbName)},function(data) {
  272 + if(data.status=='SUCCESS' && data.data.length>0) {
  273 + argus.istidc = 1;
  274 + layer.confirm('系统已存在该时刻表【'+
  275 + $("#skbNameSelect").select2("data")[0].text +
  276 + '】明细,是否使用已有数据渲染模型?', {
  277 + btn: ['确定并使用','取消并继续'] //按钮
  278 + }, function(){
  279 + layer.closeAll();
  280 + submit(JSON.stringify(gsData(data.data)),argus);
  281 + }, function(){
  282 + submit(null,argus);
  283 + });
  284 + }else {
  285 + argus.istidc = 0;
  286 + submit(null,argus);
  287 + }
  288 + });
  289 + });
  290 + }else {
  291 + layer.msg('系统不存在该线路的上、下行起终点站!');
  292 + }
  293 + });
  294 + function submit(p,argus) {
  295 + storage.setItem("Gantt_AgursData",JSON.stringify(argus));
  296 + storage.setItem('isDoDate',p);
  297 + loadPage('gantt.html');
  298 + }
  299 + }
  300 + });
  301 + function gsData(d) {
  302 + var resultD = new Array();
  303 + for(var i =0;i<d.length;i++) {
  304 + var obj = {};
  305 + var ddsj = getddsj(d[i].fcsj,d[i].bcsj);
  306 + obj.bcType = d[i].bcType;//班次类型
  307 + obj.bcs = d[i].bcs;// 班次数
  308 + obj.bcsj = d[i].bcsj;// 班次时间
  309 + obj.fcno = d[i].fcno;// 发车序号
  310 + obj.fcsj = d[i].fcsj;//发车时间
  311 + obj.ARRIVALTIME = ddsj//到达时间
  312 + obj.jhlc = d[i].jhlc;//计划里程
  313 + obj.lp = d[i].lp==null ? null : d[i].lp.id;//路牌id
  314 + obj.lpType = d[i].lp==null ? null : d[i].lp.lpType;//路牌类型
  315 + obj.parent = d[i].lp.lpName;// 路牌名称
  316 + obj.lpNo = d[i].lp.lpNo;//路牌编码
  317 + obj.tcc = d[i].tcc==null ? null : d[i].tcc.id;//停车场id
  318 + obj.ttinfo = d[i].ttinfo==null ? null : d[i].ttinfo.id;//时刻表id
  319 + obj.xl = d[i].xl==null ? null : d[i].xl.id;//线路id
  320 + obj.xlDir = dmToDh(d[i].xlDir);// 方向【0:relationshipGraph-up 上行;1:relationshipGraph-down 下行】
  321 + obj.qdz = d[i].qdz==null ? null : d[i].qdz.id;// 起点站id
  322 + obj.zdz = d[i].zdz==null ? null : d[i].zdz.id;//终点站id
  323 + obj.isfb = isfbTodm(d[i].isFB);//是否分班【0:false;1:true】
  324 + obj.isSwitchXl = isSwitchXlTodm(d[i].isSwitchXl);// 是否切换线路【0:false;1:true】
  325 + obj.STOPTIME = gettzsj(d[i],d,ddsj);
  326 + resultD.push(obj);
  327 + }
  328 + console.log(resultD);
  329 + return resultD;
  330 + }
  331 + function gettzsj(o,d,sj) {
  332 + var tzsj = 0;
  333 + for(var i = 0 ;i<d.length;i++) {
  334 + if(o.lp.lpNo == d[i].lp.lpNo && o.lp.id == d[i].lp.id) {
  335 + if(d[i].fcno - o.fcno ==1){
  336 + tzsj = (strToTime(d[i].fcsj) -strToTime(sj)) / 60000;
  337 + continue;
  338 + }
  339 +
  340 + }
  341 + }
  342 + return tzsj;
  343 + }
  344 +
  345 + function isSwitchXlTodm(d) {
  346 + var rstr = 0;
  347 + if(d)
  348 + rstr = 1;
  349 + return rstr;
  350 + }
  351 +
  352 + function isfbTodm(b) {
  353 + var rstr = 0;
  354 + if(b)
  355 + rstr = 1;
  356 + return rstr;
  357 + }
  358 +
  359 + function getddsj(tStr,bcsj) {
  360 + var rt = '';
  361 + var date = new Date();
  362 + var _str = tStr.split(':');
  363 + date.setHours(parseInt(_str[0]));
  364 + date.setMinutes(parseInt(_str[1]) + bcsj);
  365 + return getTimeStr(date);
  366 + }
  367 +
  368 + var strToTime = function(t) {
  369 + var d = new Date;
  370 + if(t) {
  371 + var _str = t.split(':');
  372 + d.setHours(parseInt(_str[0]));
  373 + d.setMinutes(parseInt(_str[1]));
  374 + }
  375 + return d;
  376 + }
  377 +
  378 + function getTimeStr(t) {
  379 + var _str = '';
  380 + if(t) {
  381 + _str = ((t.getHours()<10? '0' + t.getHours() : t.getHours()) == '00' ? '24' :(t.getHours()<10? '0' + t.getHours() : t.getHours()))
  382 + +':'
  383 + +(t.getMinutes()<10? '0' + t.getMinutes() : t.getMinutes());
  384 + }
  385 + return _str;
  386 + }
  387 +
  388 + function dmToDh(t) {
  389 + var reslStr = '';
  390 + if(t=='0')
  391 + reslStr = 'relationshipGraph-up';
  392 + else if(t=='1')
  393 + reslStr = 'relationshipGraph-down';
  394 + return reslStr;
  395 + }
  396 +
  397 + $.validator.addMethod("isBaseRes", function(value,element) {
  398 + var tag = true;
  399 + var baseChecked = $('#submit_argus_form input[name="baseRes"]:checked').val();
  400 + if(baseChecked == '0' && $('#krlInput').val()== '')
  401 + tag = false;
  402 + return tag;
  403 + }, '客流大数据分析,客流总量为必填项!');
  404 +
  405 + $('input:radio[name="baseRes"]').on('change',function(v) {
  406 + if($(this).val()=='1')
  407 + $('#krlGroup').hide();
  408 + else if($(this).val()=='0')
  409 + $('#krlGroup').show();
  410 + });
  411 +
  412 + // 确认提交信息
  413 + var displayConfirm = function() {
  414 + // 遍历表单元素下的tab4的class名称为form-control-static
  415 + $('#tab4 .form-control-static', form).each(function(){
  416 + var input = $('[name="'+$(this).attr("data-display")+'"]', form);// 定义input
  417 + if (input.is(":radio")) {
  418 + input = $('[name="'+$(this).attr("data-display")+'"]:checked', form);
  419 + }
  420 + if (input.is(":text") || input.is("textarea")) {
  421 + $(this).html(input.val());
  422 + } else if (input.is("select")) {
  423 + $(this).html(input.find('option:selected').text());
  424 + } else if (input.is(":radio") && input.is(":checked")) {
  425 + $(this).html(input.attr("data-title"));
  426 + } else if ($(this).attr("data-display") == 'payment[]') {
  427 + var payment = [];
  428 + $('[name="payment[]"]:checked', form).each(function(){
  429 + payment.push($(this).attr('data-title'));
  430 + });
  431 + $(this).html(payment.join("<br>"));
  432 + }
  433 + });
  434 + }
  435 +
  436 + /** 按钮点击时触发 */
  437 + var handleTitle = function(tab, navigation, index) {
  438 + var total = navigation.find('li').length;// 定义导航条标签个数
  439 + var current = index + 1;// 当前标签页
  440 + $('.step-title', $('#form-wizard-info')).text((index + 1) + ' - ' + total); // 设置向导标题
  441 + jQuery('li', $('#form-wizard-info')).removeClass("done"); // 删除"done"样式
  442 + var li_list = navigation.find('li');// 获取导航标签元素集合
  443 + for (var i = 0; i < index; i++) {
  444 + jQuery(li_list[i]).addClass("done");// 追加done样式
  445 + }
  446 + /** 如果为第一步隐藏返回按钮,否则显示返回按钮. */
  447 + if (current == 1) {
  448 + $('#submit_argus_form').find('.button-previous').hide();// 隐藏返回按钮
  449 + } else {
  450 + $('#submit_argus_form').find('.button-previous').show();// 显示返回按钮
  451 + }
  452 +
  453 + /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */
  454 + if (current >= total) {
  455 + $('#submit_argus_form').find('.button-next').hide();// 隐藏下一步按钮
  456 + $('#submit_argus_form').find('.button-submit').show();// 显示提交按钮
  457 + displayConfirm(); // 确认提交信息
  458 + } else {
  459 + $('#submit_argus_form').find('.button-next').show();// 显示下一步按钮
  460 + $('#submit_argus_form').find('.button-submit').hide();// 隐藏提交按钮
  461 + }
  462 + App.scrollTo($('.page-title'));// 移动到指定位置
  463 + }
  464 +
  465 + // 表单导航向导插件
  466 + $('#submit_argus_form').bootstrapWizard({
  467 + 'nextSelector': '.button-next',// 下一步元素选择器
  468 + 'previousSelector': '.button-previous',// 返回元素选择器
  469 + /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */
  470 + onTabClick: function (tab, navigation, index, clickedIndex) {
  471 + return false;
  472 + success.hide();
  473 + error.hide();
  474 + if (form.valid() == false) {
  475 + return false;
  476 + }
  477 + handleTitle(tab, navigation, clickedIndex);
  478 + },
  479 + /** 下一步按钮被单击时触发, 返回移动到下一个步骤. */
  480 + onNext: function (tab, navigation, index) {
  481 + success.hide();
  482 + error.hide();
  483 + if (form.valid() == false) {
  484 + return false;
  485 + }
  486 + if(index==1) {
  487 + if($('#krlInput').val() == '')
  488 + $('#krlInput').val(50);
  489 + }else if(index == 2) {
  490 + var baseRes = $('#submit_argus_form input[name="baseRes"]:checked').val(),
  491 + lineId = $('#lineSelect').val().split('_')[0],
  492 + krl = $('#krlInput').val();
  493 + getLineInfo(lineId,function(r) {
  494 + getHtmlTemp(baseRes,r.content[0],lineId,krl,function(htlMap) {
  495 + $('#tab3').html(htlMap.forminput);
  496 + $('#tab4').html(htlMap.datadisplay);
  497 + if(baseRes==1)
  498 + ComponentsBootstrapTagsinput.init();
  499 + // 日期控件
  500 + $('#qdzsbsjInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  501 + $('#endServiceTimeInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  502 + $('#morningPeakStartInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  503 + $('#morningPeakEndInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  504 + $('#eveningPeakStartInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  505 + $('#eveningPeakEndInput').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
  506 + gettccInfo(function(cd) {
  507 + var options = '<option value="">请选择...</option><optgroup label="停车场">';
  508 + var $_len = cd.length;
  509 + if($_len>0) {
  510 + $.each(cd, function(i, d){
  511 + options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>';
  512 + });
  513 +
  514 + }
  515 + options += '</optgroup>';
  516 + $('#carParkSelect').html(options).select2();
  517 + $('#carParkSelect').select2("val",r.content[0].carPark);
  518 + });
  519 + });
  520 + });
  521 + }
  522 + handleTitle(tab, navigation, index);
  523 + },
  524 + /** 上一步按钮被单击时触发,返回移动到前一个步骤 */
  525 + onPrevious: function (tab, navigation, index) {
  526 + success.hide();
  527 + error.hide();
  528 + handleTitle(tab, navigation, index);
  529 + },
  530 + /** 显示选项卡内容 */
  531 + onTabShow: function (tab, navigation, index) {
  532 + var total = navigation.find('li').length;
  533 + var current = index + 1;
  534 + var $percent = (current / total) * 100;
  535 + $('#submit_argus_form').find('.progress-bar').css({
  536 + width: $percent + '%'
  537 + });
  538 +
  539 + }
  540 +
  541 + });
  542 + // 初始化第一步隐藏返回按钮
  543 + $('#submit_argus_form').find('.button-previous').hide();
  544 + }
  545 + }
  546 + function getJSONP(url, data, cb) {
  547 + $.ajax({
  548 + url : url,
  549 + type : "GET",
  550 + dataType : 'jsonp',
  551 + jsonp : 'jsoncallback',
  552 + data : data,
  553 + success : cb
  554 + });
  555 + }
  556 +
  557 +}();
... ...
src/main/resources/static/pages/base/timesmodel/js/base-fun.js 0 → 100644
  1 +var BaseFun = function() {
  2 + var baseF = {
  3 + /**
  4 + * @discription : (TODO) 确定元素顺序。在javascript中,使用sort排序,如果这个参数被省略,那么元素将按照 ASCII 字符顺序进行升序排列。
  5 + *
  6 + * @params : [v1--数值1;v2--数值2]
  7 + *
  8 + * @return : ⊙ 负值,如果所传递的第一个参数比第二个参数小。
  9 + *
  10 + *  ⊙ 零,如果两个参数相等。
  11 + *
  12 + *  ⊙ 正值,如果第一个参数比第二个参数大。
  13 + **/
  14 + compare : function (v1,v2) {
  15 + if(v1>v2)
  16 + return 1;
  17 + else if(v1<v2)
  18 + return -1;
  19 + else
  20 + return 0;
  21 + },
  22 + /**
  23 + * @discription : (TODO) 对不同时段的车辆数进行顺序排序
  24 + *
  25 + * @params : 需要排序的数组对象
  26 + *
  27 + * @return : 返回一个具有一定顺序的数组对象。这里是返回的是在不同时段车辆数顺序的数组对象
  28 + *
  29 + **/
  30 + sortGattDate :function(gattDate) {
  31 + var array = new Array();//一定顺序的零时数组
  32 + var len = gattDate.length;
  33 + for(var i =0;i<len;i++) {
  34 + if(array.indexOf(gattDate[i].num)<0)
  35 + array.push(gattDate[i].num);
  36 + }
  37 + array.sort(baseF.compare);//排序(顺序)。如果compare这个参数被省略,那么元素将按照 ASCII 字符顺序进行升序排列。
  38 + var sortGattArray = new Array();
  39 + /** 给参数数组进行顺序排序 */
  40 + for(var k =0;k<array.length;k++) {
  41 + var index = array[k];
  42 + for(var x=0;x<gattDate.length;x++) {
  43 + if(index==gattDate[x].num)
  44 + sortGattArray.push({"type":gattDate[x].type,"num":gattDate[x].num,"time":gattDate[x].time});
  45 + }
  46 + }
  47 + return sortGattArray;
  48 + },
  49 + /**
  50 + * @discription : (TODO)获取车辆总数
  51 + *
  52 + * @params:len {Number}
  53 + *
  54 + * @return : 返回一个数组对象。这里返回的是一个封装好的路牌对象属性值
  55 + *
  56 + **/
  57 + getYAxisCarArray : function (len) {
  58 + var array = new Array();
  59 + if(len>0) {
  60 + for(var y = 0; y<len; y++) {
  61 + array.push({lp:null,lpNo:y+1,lpName:y+1,lpType:'普通路牌'});//添加一个路牌对象
  62 + };
  63 + }
  64 + return array;
  65 + },
  66 + /**
  67 + * @discription : (TODO)获取日期
  68 + *
  69 + * @params : 具有一定日期格式的字符串
  70 + *
  71 + * @return : 返回一个中国标准时间对象
  72 + **/
  73 + getEndDate :function(date) {
  74 + var lastEndDate = Date.now();
  75 + if (date) {
  76 + var str = date.replace(/-/g,"/");
  77 + lastEndDate = new Date(str);
  78 + }
  79 + // Wed Oct 26 2016 00:00:00 GMT+0800 (中国标准时间)
  80 + return lastEndDate;
  81 + },
  82 + /**
  83 + * @discription : (TODO)获取吃饭时间
  84 + *
  85 + * @params : [h--小时数值;m--分钟数值]
  86 + *
  87 + * @return : 返回一个中国标准时间对象
  88 + **/
  89 + getCFDate : function(h,m) {
  90 + var $_date = new Date();
  91 + $_date.setHours(h);
  92 + $_date.setMinutes(m);
  93 + return $_date;
  94 + },
  95 + /**
  96 + * @discription : (TODO)判断上下行出场
  97 + *
  98 + * @params : [t--当前车辆首班发车时间;qdzsbsj--起点站首班时间;zdzsbsj--终点站首班时间]
  99 + *
  100 + * @return : 返回出场结果。 [0--上行出场;1--下行出场]
  101 + **/
  102 + issxclOrxxcl : function(t,qdzsbsj,zdzsbsj) {
  103 + var qsj = baseF.getDateTime(qdzsbsj),
  104 + zsj = baseF.getDateTime(zdzsbsj),
  105 + cjxx = 0;// 默认是上行出场。 [0--上行出场;1--下行出场]
  106 + if(qsj>zsj) {
  107 + if(t<qsj)
  108 + cjxx = 1;
  109 + }else if(qsj<zsj) {
  110 + if(t<zsj)
  111 + cjxx = 1;
  112 + }
  113 + return cjxx;
  114 + },
  115 + /**
  116 + * @discription : (TODO)获取默认出场方向
  117 + *
  118 + * @params : 起终点站的首末班车时间
  119 + *
  120 + * @return : 返回方向结果. [0--上;1--下;2--未知].
  121 + *
  122 + **/
  123 + getdefaultDir : function(list) {
  124 + var qszsbsj = baseF.getDateTime(list[0].kssj);
  125 + zdzsbsj = baseF.getDateTime(list[1].kssj);
  126 + if(qszsbsj>zdzsbsj)
  127 + return 1;
  128 + else if(qszsbsj<zdzsbsj) {
  129 + return 0;
  130 + } else {
  131 + return 2;
  132 + }
  133 + },
  134 +
  135 + /**
  136 + * @discription : (TODO) 封装成对存在(上、下[进出场里程、进出场时间、行驶时间、行驶里程、早晚餐]、午、晚餐时间)数组对象
  137 + *
  138 + * @params : [v1--成对的第一个值;v2--成对的第二个值]
  139 + *
  140 + * @return : 返回数组值。这里返回的是成对存在(上、下[进出场里程、进出场时间、行驶时间、行驶里程、早晚餐]、午、晚餐时间)数组对象.
  141 + *
  142 + * [下标0代表成对的第一个值意--下标1代表成对的第二个值意]
  143 + **/
  144 + formatPairing : function(v1,v2) {
  145 + v1 = v1 == '' ? 0 : parseInt(v1);
  146 + v2 = v2 == ''? 0 : parseInt(v2) ;
  147 + return [v1,v2];
  148 + },
  149 + /**
  150 + * @discription : (TODO)封装起终点站成数组对象
  151 + *
  152 + * @params : [zd1--站点1;zd2--站点2]
  153 + *
  154 + * @return : 返回一个数组。这里返回的是一个起终点站数组对象。[下标0代表上--下标1代表下]
  155 + **/
  156 + qzdz : function(zd1,zd2) {
  157 + return [zd1,zd2];
  158 + },
  159 + /**
  160 + * @discription : (TODO) 获取班次方向
  161 + *
  162 + * @params : [fxtag--临时数值;cc--当前方向下标]
  163 + *
  164 + * @return : 返回一个数值。该数值代表方向下标
  165 + **/
  166 + getfx : function(fxtag,cc) {
  167 + var index = cc;
  168 + if(fxtag>0) {
  169 + if(cc==0)
  170 + index = 1;
  171 + else if(cc==1)
  172 + index = 0;
  173 + }
  174 + return index;
  175 + },
  176 + /**
  177 + * @discription : (TODO) 判断是否为最后一个班次
  178 + *
  179 + * @params : [t1--当前计算时间;t2--结束时间;tzsj--停站时间;bcsj--班次历时]
  180 + *
  181 + * @return : 返回一个布尔值。
  182 + **/
  183 + isLastbc : function(t1,t2,tzsj,bcsj) {
  184 + var data = new Date(t1);
  185 + data.setMinutes(data.getMinutes() + bcsj + tzsj);
  186 + var tag = false;
  187 + if(data>=t2)
  188 + tag = true;
  189 + return tag;
  190 + },
  191 + /**
  192 + * @discription : (TODO) 封装起终点站首末班车时间对成数组
  193 + *
  194 + * @params : [被封装的参数值]
  195 + *
  196 + * @return : 返回一个数组对象。这里返回的是起终点站首末班车时间对成数组。[下标0代表起始站的首末班车时间;下标1代表终点站的首末班车时间]
  197 + **/
  198 + formatksjssj : function(gp) {
  199 + return [{'kssj':gp.startStationFirstTime,'jssj':gp.startStationEndTime},{'kssj':gp.endStationFirstTime,'jssj':gp.endStationEndTime}];
  200 + },
  201 + /**
  202 + * @discription : (TODO) 获取结束时间格式字符串
  203 + *
  204 + * @params : [type--时间段类型;smbcsj--起终点站的首末班车时间对数组;tstr--时间段默认的结束时间格式字符串;index--下标]
  205 + *
  206 + * @return : 返回一个字符串。这里返回的是一个结束时间格式字符串。
  207 + **/
  208 + getEndStrt : function(type,smbcsj,tstr,index) {
  209 + if(type=='sm' || type=='et')
  210 + tstr = smbcsj[index].jssj;
  211 + return tstr;
  212 + },
  213 + /**
  214 + * @discription : (TODO) 封装一个时间段
  215 + *
  216 + * @pararms : []
  217 + *
  218 + * @return : 返回一个时间段。这里返回的是一个高峰时间段
  219 + *
  220 + **/
  221 + getsd : function(st,ed) {
  222 + return [{'st':st,'ed':ed}];
  223 + },
  224 + /**
  225 + * @discription : (TODO) 获取行驶时间
  226 + *
  227 + * @parmas : [zg--早高峰时间段;wg--晚高峰时间段;sj--当前时间;pc--平常行驶时间;gf--高峰行驶时间;dir--方向]
  228 + *
  229 + * @return : 返回一个数值。这里返回的是行驶时间数值
  230 + *
  231 + * */
  232 + getxssj : function(zg,wg,sj,pc,gf,dir) {
  233 + var xxsj = 0;
  234 + if(baseF.isgfsjd(zg[0].st,zg[0].ed,sj) || baseF.isgfsjd(wg[0].st,wg[0].ed,sj))
  235 + xxsj = gf[dir];
  236 + else
  237 + xxsj = pc[dir];
  238 + return xxsj;
  239 + },
  240 + /**
  241 + * @discription : (TODO) 比较一个时间是否在某个时间段内
  242 + *
  243 + * @params : [st--开始时间;ed--结束时间;sj--当前时间]
  244 + *
  245 + * @return : 返回一个布尔值。这里判断一个时间是否在高峰时间段
  246 + *
  247 + **/
  248 + isgfsjd : function(st,ed,sj) {
  249 + var tag = false;
  250 + if((sj<=ed || (sj-st)/60000<5 ) && (sj>=st || (st-sj)/60000<5))
  251 + tag = true;
  252 + return tag;
  253 + },
  254 + /**
  255 + * @discription : (TODO) 根据客流数据排列班次时刻数据.
  256 + *
  257 + * @params : [slotArray--不同时段的车辆数数组对象;ma--排列明细的参数属性值;ca--车辆数组对象;gatps--表单参数对象].
  258 + *
  259 + * @return : 返回一个具有一定数据格式的json数组。这里返回的是一个时刻表明细json数组.
  260 + **/
  261 + KLplaceClassesTime : function(slotArray,ma,ca,gatps,sd,dataMap) {
  262 + var jsonArray = new Array(),// 返回的json数组对象.
  263 + cutCarArra = baseF.getCutCarArray_(ca,baseF.getArithmetic(slotArray)),// 获取不同时段的车辆数并分配予车辆.
  264 + lbsj = gatps.lb=='' ? 0:parseInt(gatps.lb);
  265 + var xhNo = 1;
  266 + for(var c = 0;c<cutCarArra.length;c++) {
  267 + var carArray = cutCarArra[c].car,time = cutCarArra[c].time.split('-'),
  268 + type =cutCarArra[c].type;
  269 + for(var a =0;a<carArray.length;a++) {
  270 + var _mmstartTime = baseF.getDateTime(gatps.earlyStartTime);// 获取早高峰开始时间点,并转为时间对象.
  271 + var tempTime = new Date(_mmstartTime.setMinutes(_mmstartTime.getMinutes()-(ca.length-parseInt(carArray[a].lpNo))*ma[0].fcjx));
  272 + var cctag = baseF.getdefaultDir(dataMap.smbcsjArr);// 获取出场类型 [0--上行出场;1--下行出场]
  273 + var kssj = baseF.getDateTime(time[0]); // 获取该时段的开始时间点,并转为时间对象.
  274 + var sjAndDir = baseF.getBeganTime(tempTime,kssj,type, ma,dataMap.zgfsjd,dataMap.wgfsjd,dataMap.pcxssjArr,dataMap.gfxxsjArr,cctag);// 计算当前路牌第一个首班时间点.
  275 + kssj = sjAndDir.d1;
  276 + cctag = sjAndDir.dir;
  277 + var endTime = baseF.getDateTime(
  278 + baseF.getEndStrt(type,dataMap.smbcsjArr,time[1],cctag));// 获取该时段的结束时间点,并转为时间对象.
  279 + var $_cfn = 0,$_cfw = 0;
  280 + if(type !='ee') {
  281 + jsonArray.push(baseF.getbcObj(
  282 + kssj,dataMap.ccsjArr[cctag],carArray[a],dataMap.bcTypeArr.bd,
  283 + dataMap.dira[cctag],xhNo++,0,gatps,0,null,null,null,0,lbsj));// 早行例保班次
  284 + }
  285 + jsonArray.push(baseF.getbcObj(
  286 + kssj,dataMap.ccsjArr[cctag],carArray[a],dataMap.bcTypeArr.out,
  287 + dataMap.dira[cctag],xhNo++,dataMap.cclcArr[cctag],gatps,0,dataMap.qdzArr[cctag],null,null,0,0));// 出场班次
  288 + var fxTagDm = 0;
  289 + while(kssj<=endTime) {
  290 + cctag = baseF.getfx(fxTagDm,cctag);
  291 + fxTagDm = 1;
  292 + if(kssj> new Date (baseF.getCFDate(10,30)) &&
  293 + kssj<new Date (baseF.getCFDate(12,0)) && $_cfn<1 ) {
  294 + $_cfn++;
  295 + jsonArray.push(baseF.getbcObj(
  296 + kssj,dataMap.zwcArr[0],carArray[a],dataMap.bcTypeArr.cf,
  297 + dataMap.dira[cctag],xhNo++,0,gatps,0,null,null,null,0,0));// 午餐班次
  298 + }else if(kssj> new Date (baseF.getCFDate(18,30)) &&
  299 + kssj<new Date (baseF.getCFDate(20,0)) && $_cfw<1 ) {
  300 + $_cfw++;
  301 + jsonArray.push(baseF.getbcObj(
  302 + kssj,dataMap.zwcArr[1],carArray[a],dataMap.bcTypeArr.cf,
  303 + dataMap.dira[cctag],xhNo++,0,gatps,0,null,null,null,0,0));// 晚餐班次
  304 + }
  305 + var _xxsj = baseF.getxssj(dataMap.zgfsjd,dataMap.wgfsjd,kssj,dataMap.pcxssjArr,dataMap.gfxxsjArr,cctag);// 获取行驶时间
  306 + var tzsj = baseF.isLastbc(kssj,endTime,ma[0].tzjx,_xxsj) ? 0 : ma[0].tzjx;
  307 + jsonArray.push(baseF.getbcObj(
  308 + kssj,_xxsj,carArray[a],dataMap.bcTypeArr.normal,
  309 + dataMap.dira[cctag],xhNo++,dataMap.pcxslcArr[cctag],gatps,0,
  310 + dataMap.qdzArr[cctag],dataMap.zdzArr[cctag],null,tzsj,0));// 正常班次
  311 + kssj = new Date(kssj.setMinutes(kssj.getMinutes() + ma[0].tzjx));
  312 + }
  313 + kssj = new Date(kssj.setMinutes(kssj.getMinutes() - ma[0].tzjx));
  314 + jsonArray.push(baseF.getbcObj(kssj,dataMap.jcsjArr[cctag],carArray[a],
  315 + dataMap.bcTypeArr.in_,dataMap.dira[cctag],xhNo++,dataMap.jclcArr[cctag],gatps,0,dataMap.qdzArr[cctag],null,null,0,0));// 进场班次
  316 + if(type !='mm') {
  317 + jsonArray.push(baseF.getbcObj(kssj,dataMap.jcsjArr[cctag],carArray[a],
  318 + dataMap.bcTypeArr.lc,dataMap.dira[cctag],xhNo++,0,gatps,0,null,null,null,0,lbsj));// 晚班例保班次
  319 + }
  320 + }
  321 + }
  322 + return {'json':baseF.tzsmbcsj(baseF.setbcsAndfcno(jsonArray),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,lbsj),
  323 + 'bxrcgs':null};
  324 + },
  325 +
  326 + /**
  327 + * @description : (TODO) 根据班型人次与车辆总数排列班次时刻数据.
  328 + *
  329 + * @param [saa--数据配置参数;cara--路牌数组;map--表单配置参数;dataMap--方向成对的数据集合].
  330 + *
  331 + * @return 返回一个具有一定数据格式的json数组。这里返回的是一个时刻表明细json数组.
  332 + * */
  333 + BXPplaceClassesTime : function(saa,cara,map,seMap,dataMap) {
  334 + // console.log(saa , cara , map, seMap ,dataMap);
  335 + /**
  336 + * 获取每个路牌下的从第一个班次的发车时间点到最后的结束时间点下所有的班次.
  337 + *
  338 + * 规则 :
  339 + *
  340 + * ✿ 以早高峰开始时间点起,从最后一个路牌开始,每个相邻路牌的第一个班次发车时间相隔为发车间隙.
  341 + *
  342 + * ✿ 每个路牌从第一个班次起往后加上该班次的行驶时间和停站时间 得到下一个班次的发车时间.以此类推.
  343 + *
  344 + * */
  345 + var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap);
  346 + // 切割班型人次.
  347 + var list = baseF.splitBxRc(map.bxrc);
  348 + /*var list ={'data': [{'hoursV':11.42,'minueV':"11:25",'rs':8,'type':"一工一休"},
  349 + {'hoursV':8.57,'minueV':"6:40",'rs':5,'type':"二工一休"},
  350 + {'hoursV':6.85,'minueV':"6:51",'rs':5,'type':"五工一休"}],'rsa':[8,5,5]};*/
  351 + // 把班型人次按照规则合理的分配到不同的路牌上.
  352 + baseF.getRankRule(list,cara,seMap);
  353 + var bxrclist = list.data;
  354 + var rs = new Array(),bxrcgs= new Array();
  355 + // 遍历已分配好路牌的班型人次数组.
  356 + for(var x = 0 ; x < bxrclist.length; x++) {
  357 + // 定义当前班型人次下的路牌数组.
  358 + var cla = bxrclist[x].sslp;
  359 + // 定义当前班型人次下的工时.
  360 + var hoursV = bxrclist[x].hoursV;
  361 + // 遍历路牌
  362 + for(var s = 0 ; s < cla.length; s++) {
  363 + // 获取路牌编号.
  364 + var lpNo = cla[s].lpNo;
  365 + // 定义路牌下的所有班次.
  366 + var lpbc = new Array();
  367 + bxrcgs.push({'lpNo':lpNo,'hoursV':hoursV,'type':bxrclist[x].type});
  368 + // 遍历班次数.
  369 + for(var i =0 ; i <jsonArray.length; i++) {
  370 + // 判断当期遍历的班次是否属于当前的路牌.
  371 + if(jsonArray[i].lpNo == lpNo)
  372 + lpbc.push(jsonArray[i]);
  373 + }
  374 + // 按照发车序号顺序排序.
  375 + lpbc.sort(function(a,b){return a.fcno-b.fcno});
  376 + // 调整班次数.也就是说调整工时.
  377 + baseF.tzlpgs(lpbc,hoursV,map,dataMap,lpNo,saa);
  378 + // baseF.addjclbbc(lpbc,dataMap,saa[0].lbsj,map)
  379 + rs = rs.concat(lpbc);
  380 + }
  381 + }
  382 + var jar = baseF.tzsmbcsj(baseF.setbcsAndfcno(rs),dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj);
  383 + var resultJA = new Array();
  384 + for(var m = 0 ; m < cara.length; m++) {
  385 + // 获取路牌编号.
  386 + var lpNo_ = cara[m].lpNo;
  387 + // 定义路牌下的所有班次.
  388 + var lpbc_ = new Array();
  389 + // 遍历班次数.
  390 + for(var j =0 ; j <jar.length; j++) {
  391 + // 判断当期遍历的班次是否属于当前的路牌.
  392 + if(jar[j].lpNo == lpNo_)
  393 + lpbc_.push(jar[j]);
  394 + }
  395 + // 按照发车序号顺序排序.
  396 + lpbc_.sort(function(a,b){return a.fcno-b.fcno});
  397 + resultJA = resultJA.concat(baseF.addjclbbc(lpbc_,dataMap,saa[0].lbsj,map));
  398 + }
  399 + return {'json':baseF.setbcsAndfcno(resultJA),'bxrcgs':bxrcgs};
  400 + },
  401 +
  402 + /**
  403 + * @description : (TODO) 添加进出场班次、早晚例保班次.
  404 + *
  405 + * @param [bc--路牌下的所有班次;dataMap--参数信息;lbsj--例保时间]
  406 + *
  407 + */
  408 + addjclbbc : function(bc,dataMap,lbsj,gatps) {
  409 + bc[bc.length-1].STOPTIME = 0;
  410 + var result = new Array();
  411 + var fcno = 0,dxfno = 0,stas = false;
  412 + for(var b = 0 ; b < bc.length;b++) {
  413 + var fxdm = baseF.dirDmToIndex(bc[b].xlDir);
  414 + var car = {'lp':bc[b].lp, 'lpNo':bc[b].lpNo, 'lpName':bc[b].lpName, 'lpType':bc[b].lpType};
  415 + if(b==0) {
  416 + var dqbcfcsj = baseF.getDateTime(bc[b].fcsj);
  417 + result.push(baseF.getbcObj(
  418 + dqbcfcsj,dataMap.ccsjArr[fxdm],car,dataMap.bcTypeArr.bd,
  419 + dataMap.dira[fxdm],1,0,gatps,0,null,null,null,0,lbsj));// 早行例保班次
  420 + result.push(baseF.getbcObj(
  421 + dqbcfcsj,dataMap.ccsjArr[fxdm],car,dataMap.bcTypeArr.out,
  422 + dataMap.dira[fxdm],2,dataMap.cclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 出场班次
  423 + fcno ++;
  424 + }else if(b > 0 && b < bc.length-1){
  425 + var jcbckssj = baseF.getDateTime(bc[b].ARRIVALTIME)
  426 + var ccbckssj = baseF.getDateTime(bc[b+1].fcsj)
  427 + var dx = parseInt((ccbckssj - jcbckssj)/60000);
  428 + if(dx>30) {
  429 + //console.log(bc[b].fcno);
  430 + var fcno_ = bc[b].fcno + 2;
  431 + stas = true;
  432 + // console.log(bc[b],bc[b+1],b);
  433 + result.push(baseF.getbcObj(
  434 + jcbckssj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.in_,
  435 + dataMap.dira[fxdm],fcno_++,dataMap.jclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 进场班次
  436 + var ccfx = baseF.dirDmToIndex(bc[b+1].xlDir);
  437 + result.push(baseF.getbcObj(
  438 + ccbckssj,dataMap.ccsjArr[ccfx],car,dataMap.bcTypeArr.out,
  439 + dataMap.dira[ccfx],fcno_++,dataMap.cclcArr[ccfx],gatps,0,dataMap.qdzArr[ccfx],null,null,0,0));// 出场班次
  440 + }
  441 + }else if(b==bc.length-1){
  442 + var fcno_ = dxfno + 2;
  443 + var qdbcddsj = baseF.getDateTime(bc[b].ARRIVALTIME);
  444 + result.push(baseF.getbcObj(
  445 + qdbcddsj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.in_,
  446 + dataMap.dira[fxdm],fcno_++,dataMap.jclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 进场班次
  447 + result.push(baseF.getbcObj(
  448 + qdbcddsj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.lc,
  449 + dataMap.dira[fxdm],fcno_++,0,gatps,0,null,null,null,0,lbsj));// 晚班例保班次
  450 + }
  451 + dxfno = bc[b].fcno + fcno;
  452 + bc[b].fcno = dxfno;
  453 + if(stas) {
  454 + fcno ++;
  455 + stas = false;
  456 + }
  457 + result.push(bc[b]);
  458 + }
  459 +
  460 + return result;
  461 + },
  462 +
  463 +
  464 + /**
  465 + * @description : (TODO) 调整某路牌下的工时.
  466 + *
  467 + * @param [arr--当前路牌下的班次数组;gs--当前路牌的总工时;dataMap--参数信息;lpNo--路牌编码;saa--参数信息]
  468 + *
  469 + * */
  470 + tzlpgs : function(arr,gs,map,dataMap,lpNo,saa) {
  471 + // 定义当前路牌的进场时间、早晚例保时间.
  472 + var jczwsj = saa[0].lbsj*2 + dataMap.ccsjArr[baseF.dirDmToIndex(arr[0].xlDir)] +
  473 + dataMap.jcsjArr[baseF.dirDmToIndex(arr[arr.length-1].xlDir)];
  474 + // 定义开始、结束时间.
  475 + var st = null , ed = null;
  476 + // 根据路牌编码依次轮流取高峰之间和晚高峰之后的时间段.
  477 + if(lpNo%2!=0) {
  478 + st = dataMap.gfzjsjd[0].st;
  479 + ed = dataMap.gfzjsjd[0].ed;
  480 + }else {
  481 + st = dataMap.wgfzhsjd[0].st;
  482 + ed = dataMap.wgfzhsjd[0].ed;
  483 + }
  484 + // 定义路牌总工时.第一次切高峰之间和晚高峰之后的班次.
  485 + var lpdqzgs = parseFloat(((baseF.getlpzgs(arr) + jczwsj)/60).toFixed(2));
  486 + // 判断总工时是否大于班型对应的工时.
  487 + if(lpdqzgs>gs) {
  488 + // 定义相差值.
  489 + var dx = parseFloat((lpdqzgs - gs).toFixed(2));
  490 + // 定义圈数.
  491 + var qs = Math.round(dx*60/70);
  492 + for(var t = 0 ; t<arr.length;t++) {
  493 + // 得到当前路牌下的发车时间.
  494 + var dqbcfcsj = baseF.getDateTime(arr[t].fcsj);
  495 + // 判断时间范围.
  496 + if(dqbcfcsj>st && dqbcfcsj<ed) {
  497 + arr[t-1].STOPTIME = 0;
  498 + // 切割.
  499 + arr.splice(t,qs*2);
  500 + break;
  501 + }
  502 + }
  503 + // 再次计算总工时.第二次切早高峰之前的班次.
  504 + lpdqzgs = parseFloat(((baseF.getlpzgs(arr) + jczwsj)/60).toFixed(2));
  505 + // 判断差值是否在一个小时范围内.
  506 + if( lpdqzgs - gs > 1) {
  507 + // 遍历
  508 + for(var z = 0 ; z<arr.length;z++) {
  509 + // 得到当前路牌下的发车时间.
  510 + var dqbcfcsj = baseF.getDateTime(arr[z].fcsj);
  511 + // 判断时间范围.
  512 + if(dqbcfcsj>dataMap.zgfzqsjd[0].st && dqbcfcsj<dataMap.zgfzqsjd[0].ed) {
  513 + arr.splice(z,1);
  514 + z--;
  515 + }
  516 + }
  517 + }
  518 + // 再次计算总工时.第三次切高峰之间的班次.
  519 + lpdqzgs = parseFloat(((baseF.getlpzgs(arr) + jczwsj)/60).toFixed(2));
  520 + if( lpdqzgs - gs > 1) {
  521 + var dx_ = parseFloat((lpdqzgs - gs).toFixed(2));
  522 + var qs_ = Math.round(dx_*60/70);
  523 + for(var i = 0 ; i<arr.length;i++) {
  524 + var dqbcfcsj = baseF.getDateTime(arr[i].fcsj);
  525 + if(dqbcfcsj>dataMap.gfzjsjd[0].st && dqbcfcsj<dataMap.gfzjsjd[0].ed) {
  526 + arr[i-1].STOPTIME = 0;
  527 + arr.splice(i,qs_*2);
  528 + break;
  529 + }
  530 + }
  531 + }
  532 + }
  533 + },
  534 +
  535 + /**
  536 + *
  537 + *
  538 + * */
  539 + getlpzgs : function(list) {
  540 + var num = 0;
  541 + for(var i = 0 ; i<list.length; i++) {
  542 + num = num + list[i].bcsj + list[i].STOPTIME;
  543 + }
  544 + return num;
  545 + },
  546 +
  547 + /**
  548 + * @description : (TODO) 根据班型人次获取每个路牌下的工时.把班型人次按照规则合理的分配到不同的路牌上.
  549 + *
  550 + * @param [list--班型人次数据;clzs--路牌数组;seMap--参数信息]
  551 + *
  552 + * @return 返回一个每个路牌下对应的总工时.
  553 + * */
  554 + getRankRule : function(list,clzs,seMap) {
  555 + // 定义班型人次数据的长度.路牌数组长度.
  556 + var bxgs = list.data.length,clzslen = clzs.length;
  557 +
  558 + /**
  559 + * 分配规则:获取总人数与车辆数的关系.返回值[-1-- 总人数小与车辆总数; 0--总人数等于车辆数; 1--总人数大与车辆数]
  560 + *
  561 + * ✿ ① 当返回值为-1时:则总人数小于车辆数. 相当于人少车辆多.
  562 + *
  563 + * ✿ ② 当返回值为0时: 则总人数等于车辆数. 相当于人和车均匀.
  564 + *
  565 + * ✿ ③ 当返回值为1时: 则总人数大于车辆数. 相当于人多车辆少.
  566 + *
  567 + *
  568 + * */
  569 + switch(baseF.isrcNumEqualCarNum(list.rsa,clzslen)){
  570 + case -1:
  571 + break;
  572 + case 0:
  573 + // 判断.班型人次是否为一种还是多种情况.
  574 + if(bxgs==1) {
  575 + // 当只为一种情况时.这所有路牌都为一个班型.
  576 + list.data[0].sslp = clzs;
  577 + }else if(bxgs>=2) {
  578 + // 当有2种或者2种以上的班型人次组合时.需要合理的分配.
  579 + baseF.fprclp(bxgs,list,clzs);
  580 + }
  581 + break;
  582 + case 1:
  583 + // 定义最大工时值.
  584 + var maxhoursV = parseFloat((((baseF.getDateTime(seMap.e) - baseF.getDateTime(seMap.s))/60000)/60).toFixed(2));
  585 + // 定义总人数.
  586 + var rsdx = 0 ;
  587 + for(var n = 0 ; n < list.rsa.length;n++) {
  588 + rsdx =rsdx + list.rsa[n];
  589 + }
  590 + // 定义总人数与车辆的差值.
  591 + var _rcDx = rsdx - clzslen;
  592 + // 定义班型人次组合对象.
  593 + var zhHoursA = new Array();
  594 + for(var b = 0 ; b<bxgs;b++) {
  595 + var dqhours = list.data[b].hoursV;
  596 + for(var a = b ; a<bxgs; a++) {
  597 + var pphours = list.data[a].hoursV;
  598 + var zhnum = pphours+dqhours;
  599 + if(zhnum>maxhoursV)
  600 + continue;
  601 + else if(zhnum<maxhoursV) {
  602 + zhHoursA.push({'bx1':list.data[b].type,'bx2':list.data[a].type,'countGs':zhnum});
  603 + }
  604 +
  605 + }
  606 + }
  607 + // 按照工时倒序排序.
  608 + zhHoursA.sort(function(a,b){return b.countGs-a.countGs});
  609 + var bxppA = zhHoursA[0],clp = null,dlp = null,pqobj = new Array(),bxpprc= new Array();
  610 + for(var m = 0 ; m<list.data.length;m++) {
  611 + if(list.data[m].type==bxppA.bx1 || list.data[m].type==bxppA.bx2) {
  612 + bxpprc.push(list.data[m].rs);
  613 + var czDx = list.data[m].rs - _rcDx;
  614 + if(czDx<0) {
  615 + var djbctype = null,absInt = Math.abs(czDx);
  616 + if(list.data[m].type==bxppA.bx1)
  617 + djbctype = bxppA.bx2;
  618 + else if(list.data[m].type==bxppA.bx2)
  619 + djbctype = bxppA.bx1;
  620 + var bqbc = zhHoursA[1];
  621 + for(var k = 0 ; k<bxgs ; k++) {
  622 + if(list.data[k].type == djbctype)
  623 + list.data[k].rs = list.data[k].rs + Math.abs(czDx);
  624 + if(list.data[k].type==bqbc.bx1 || list.data[k].type==bqbc.bx2) {
  625 + if(bqbc.bx1==bqbc.bx2)
  626 + list.data[k].rs = list.data[k].rs - absInt*2;
  627 + else if(bqbc.bx1!=bqbc.bx2)
  628 + list.data[k].rs = list.data[k].rs - absInt;
  629 + }
  630 + }
  631 + pqobj.push({'type':bqbc.bx1 + '</br></br>' + bqbc.bx2 ,'minueV':bqbc.countGs,'rs':absInt});
  632 + }
  633 + czDx = czDx < 0 ? 0:czDx;
  634 + list.data[m].rs = czDx;
  635 + if(list.data[m].rs<=0) {
  636 + list.data.splice(m,1);
  637 + m--;
  638 + }
  639 + }
  640 + }
  641 + list.data.push({'type':bxppA.bx1 + '</br></br>' + bxppA.bx2 ,
  642 + 'minueV' : bxppA.countGs,
  643 + 'rs':Math.min.apply(null, bxpprc) <_rcDx ? Math.min.apply(null, bxpprc) : _rcDx});
  644 + if(pqobj.length>0)
  645 + list.data.push(pqobj[0]);
  646 + list.data.sort(function(a,b){return b.rs-a.rs});
  647 + baseF.fprclp(list.data.length,list,clzs);
  648 + break;
  649 + default:
  650 + console.log('数据格式错误...');
  651 + }
  652 + },
  653 +
  654 + /**
  655 + * @description (TODO) 把班型人次合理的分配到不同的路牌上.
  656 + *
  657 + * @param [bxgs--班型人次数组长度;list--班型人次数组集合;clzs--路牌数组]
  658 + *
  659 + * @return 返回一个把路牌合理的分配到班型人次下组成的数据集合.
  660 + * */
  661 + fprclp : function(bxgs,list,clzs) {
  662 + // 定义总人数.
  663 + var dxcount = 0;
  664 + for(var t = 1 ; t<bxgs ; t++) {
  665 + dxcount = dxcount + list.data[t].rs;
  666 + }
  667 + // 最多人次与总人次的比例.
  668 + var blnum = Math.round(list.data[0].rs/dxcount);
  669 + var rs = new Array();
  670 + // 遍历
  671 + for(var r = 0 ; r<bxgs ;r++) {
  672 + // 得到没有分配出去的路牌.
  673 + var dxa = baseF.chaji_array(clzs,rs);
  674 + // 定义当前人次数.
  675 + var rsnum = list.data[r].rs;
  676 + // 定义记录当前分割路牌的次数下标.分配到班型人次下的路牌数组.
  677 + var index = 0,sslp = new Array();
  678 + // 当前人次所有占比例.
  679 + var tempint = parseInt(rsnum/blnum);
  680 + // 判断如果比例小1 则为当前人次数.
  681 + blnum = tempint <=1 ? rsnum : blnum;
  682 + // 判断当前班型人次数组下标值.如果为倒数第二个或者之前
  683 + if(r<bxgs-1) {
  684 + // 遍历
  685 + for(var c = 0 ; c<tempint;c++) {
  686 + // 创建新的没有分配出去的路牌数组.
  687 + var temp = dxa.concat();
  688 + // 创建切割路牌数组.
  689 + var tagA = new Array();
  690 + // 判断切割的下标值是否小于等于路牌数组的倒数第二个或者之前.
  691 + if(index<=dxa.length-blnum) {
  692 + tagA = temp.splice(index,blnum);
  693 + }else {
  694 + tagA = temp.splice(dxa.length-blnum,blnum);
  695 + }
  696 + // 组合切割路牌数组.赋值给已分配出去的路牌.
  697 + rs = rs.concat(tagA);
  698 + // 赋值给分配到班型人次下的路牌数组.
  699 + sslp = sslp.concat(tagA);
  700 + // 记录切割下标.
  701 + index = index + 1 + blnum;
  702 + }
  703 + // 分配到班型人次下的路牌数组.
  704 + list.data[r].sslp = sslp;
  705 + }else {
  706 + list.data[r].sslp = dxa;
  707 + }
  708 + }
  709 + },
  710 +
  711 + getMaxgys : function(v1,v2) {
  712 + var temp=v1;
  713 + while (v1!=0){
  714 + temp=v2%v1;
  715 + v2=v1;
  716 + v1=temp;
  717 + }
  718 + return v2;
  719 + },
  720 +
  721 + /**
  722 + * @description : (TODO) 判断人次总数与车辆总数的关系.
  723 + *
  724 + * @param
  725 + *
  726 + * @return 返回一个布尔
  727 + * */
  728 + isrcNumEqualCarNum : function(sra,clcount) {
  729 + var count = 0,tag = null;
  730 + for(var r = 0 ; r < sra.length; r++) {
  731 + count = count + sra[r];
  732 + }
  733 + if(count==clcount)
  734 + tag = 0;
  735 + else if(count<clcount)
  736 + tag = -1;
  737 + else if(count>clcount)
  738 + tag = 1;
  739 + return tag;
  740 + },
  741 +
  742 + plgfbc : function(saa , cara , map, seMap ,dataMap) {
  743 + var len = cara.length,rs = new Array();
  744 + var lbsj = map.lb=='' ? 0:parseInt(map.lb);
  745 + for(var c = 0 ; c<len ; c++) {
  746 + // 铺出所有的班次
  747 + var _mmstartTime = baseF.getDateTime(map.earlyStartTime);// 获取早高峰开始时间点,并转为时间对象.
  748 + var tempTime = new Date(_mmstartTime.setMinutes(_mmstartTime.getMinutes()-(len - cara[c].lpNo)*saa[0].fcjx));
  749 + var kssj = dataMap.zgfsjd[0].st;
  750 + var cctag = baseF.getdefaultDir(dataMap.smbcsjArr);// 获取出场类型 [0--上行出场;1--下行出场]
  751 + var sjAndDir = baseF.getBeganTime(tempTime,kssj,null, saa,dataMap.zgfsjd,dataMap.wgfsjd,dataMap.pcxssjArr,dataMap.gfxxsjArr,cctag);// 计算当前路牌第一个首班时间点.
  752 + kssj = sjAndDir.d1;
  753 + cctag = sjAndDir.dir;
  754 + var endTime = baseF.getDateTime(seMap.e),fxTagDm = 0 , xhNo = 3,$_cfn = 0,$_cfw = 0;
  755 + while(kssj<=endTime) {
  756 + cctag = baseF.getfx(fxTagDm,cctag);
  757 + fxTagDm = 1;
  758 + if(kssj> new Date (baseF.getCFDate(10,30)) &&
  759 + kssj<new Date (baseF.getCFDate(12,0)) && $_cfn<1 ) {
  760 + $_cfn++;
  761 + rs.push(baseF.getbcObj(
  762 + kssj,dataMap.zwcArr[0],cara[c],dataMap.bcTypeArr.cf,
  763 + dataMap.dira[cctag],xhNo++,0,map,0,null,null,null,0,0));// 午餐班次
  764 + }else if(kssj> new Date (baseF.getCFDate(18,30)) &&
  765 + kssj<new Date (baseF.getCFDate(20,0)) && $_cfw<1 ) {
  766 + $_cfw++;
  767 + rs.push(baseF.getbcObj(
  768 + kssj,dataMap.zwcArr[1],cara[c],dataMap.bcTypeArr.cf,
  769 + dataMap.dira[cctag],xhNo++,0,map,0,null,null,null,0,0));// 晚餐班次
  770 + }
  771 + var _xxsj = baseF.getxssj(dataMap.zgfsjd,dataMap.wgfsjd,kssj,dataMap.pcxssjArr,dataMap.gfxxsjArr,cctag);// 获取行驶时间
  772 + var tzsj = baseF.isLastbc(kssj,endTime,saa[0].tzjx,_xxsj) ? 0 : saa[0].tzjx;
  773 + rs.push(baseF.getbcObj(
  774 + kssj,_xxsj,cara[c],dataMap.bcTypeArr.normal,
  775 + dataMap.dira[cctag],xhNo++,dataMap.pcxslcArr[cctag],map,0,
  776 + dataMap.qdzArr[cctag],dataMap.zdzArr[cctag],null,tzsj,0));// 正常班次
  777 + kssj = new Date(kssj.setMinutes(kssj.getMinutes() + saa[0].tzjx));
  778 + }
  779 + }
  780 + return rs;
  781 + },
  782 +
  783 + getGfData : function (type, saa , cara , map, seMap ,dataMap,len,car) {
  784 + var _mmstartTime = null,kssj = null,end = null ,result = new Array(),fxTagDm = 0 , xhNo = 0;
  785 + if(type == 'mm') {
  786 + _mmstartTime = baseF.getDateTime(map.earlyStartTime);// 获取早高峰开始时间点,并转为时间对象.
  787 + kssj = dataMap.zgfsjd[0].st; // 获取该时段的开始时间点,并转为时间对象.
  788 + end = dataMap.zgfsjd[0].ed;
  789 + }else if(type == 'ee'){
  790 + _mmstartTime = baseF.getDateTime(map.lateStartTime);// 获取晚高峰开始时间点,并转为时间对象.
  791 + kssj = dataMap.wgfsjd[0].st; // 获取该时段的开始时间点,并转为时间对象.
  792 + end = dataMap.wgfsjd[0].ed;
  793 + }
  794 + var tempTime = new Date(_mmstartTime.setMinutes(_mmstartTime.getMinutes()-(len - car.lpNo)*saa[0].fcjx));
  795 + var cctag = baseF.getdefaultDir(dataMap.smbcsjArr);// 获取出场类型 [0--上行出场;1--下行出场]
  796 + var sjAndDir = baseF.getBeganTime(tempTime,kssj,type, saa,dataMap.zgfsjd,dataMap.wgfsjd,dataMap.pcxssjArr,dataMap.gfxxsjArr,cctag);// 计算当前路牌第一个首班时间点.
  797 + kssj = sjAndDir.d1;
  798 + cctag = sjAndDir.dir;
  799 + while(kssj<=end) {
  800 + cctag = baseF.getfx(fxTagDm,cctag);
  801 + fxTagDm = 1;
  802 + var _xxsj = dataMap.gfxxsjArr[cctag];// 获取行驶时间
  803 + var tzsj = baseF.isLastbc(kssj,end,saa[0].tzjx,_xxsj) ? 0 : saa[0].tzjx;
  804 + result.push(baseF.getbcObj(
  805 + kssj,_xxsj,car,dataMap.bcTypeArr.normal,
  806 + dataMap.dira[cctag],xhNo++,dataMap.pcxslcArr[cctag],map,0,
  807 + dataMap.qdzArr[cctag],dataMap.zdzArr[cctag],null,tzsj,0));// 正常班次
  808 + kssj = new Date(kssj.setMinutes(kssj.getMinutes() + saa[0].tzjx));
  809 + }
  810 + return result;
  811 + },
  812 +
  813 + splitBxRc : function(str) {
  814 + var list = new Array(),rsa = new Array();;
  815 + var gsgd = baseF.getBxLs();
  816 + var bxrcAr = str.split(',');
  817 + for(var s = 0 ; s< bxrcAr.length;s++) {
  818 + var s1a = bxrcAr[s].split('/');
  819 + var rs = parseInt(s1a[1]);
  820 + var gsgdIndex = 0,hoursV = 0.0,minueV='' ;
  821 + for(var g = 0 ; g < gsgd.length; g++) {
  822 + if(gsgd[g].type == s1a[0]) {
  823 + gsgdIndex = g;
  824 + hoursV = gsgd[g].hoursV;
  825 + minueV = gsgd[g].minueV;
  826 + }
  827 + }
  828 + list.push({'type':s1a[0],
  829 + 'rs':rs,
  830 + 'hoursV':hoursV,
  831 + 'minueV':minueV});
  832 + rsa.push(rs);
  833 + }
  834 + return {'data':list.sort(function(a,b){return b.rs-a.rs}),'rsa':rsa.sort().reverse()};
  835 + },
  836 +
  837 + /**
  838 + * @description : (TODO) 定义工时规定.
  839 + *
  840 + * @return 返回一个工时规定数组集合.
  841 + * */
  842 + getBxLs : function() {
  843 + return [{'type':'六工一休','hoursV':6.66, 'minueV':'6:40'},
  844 + {'type':'五工一休','hoursV':6.85, 'minueV':'6:51'},
  845 + {'type':'四工一休','hoursV':7.14, 'minueV':'7:08'},
  846 + {'type':'三工一休','hoursV':7.61, 'minueV':'7:37'},
  847 + {'type':'二工一休','hoursV':8.57, 'minueV':'8:34'},
  848 + {'type':'一工一休','hoursV':11.42, 'minueV':'11:25'},
  849 + {'type':'五工二休','hoursV':7.99, 'minueV':'8:00'},
  850 + {'type':'无工休', 'hoursV':5.43, 'minueV':'5:43'}];
  851 + },
  852 + setbcsAndfcno : function(listA) {
  853 + /*var array = new Array();
  854 + var len = listA.length;
  855 + for(var i =0;i<len;i++) {
  856 + if(array.indexOf(listA[i].lpNo)<0)
  857 + array.push(listA[i].lpNo);
  858 + }
  859 + array.sort(baseF.compare);
  860 + console.log(array);
  861 + var sortGattArray = new Array();
  862 + for(var k =0;k<array.length;k++) {
  863 + var index = array[k];
  864 + var temp = new Array();
  865 + for(var x=0;x<listA.length;x++) {
  866 + if(index==listA[x].lpNo)
  867 + temp.push(listA[x]);
  868 + }
  869 + var lpbc = baseF.sortDirArray(temp);
  870 + for(var p = 0 ;p<lpbc.length;p++) {
  871 + lpbc[p].fcno = (p+1);
  872 + }
  873 + sortGattArray = sortGattArray.concat(lpbc);
  874 + }
  875 + for(var b = 0 ; b <sortGattArray.length;b++) {
  876 + sortGattArray[b].bcs = (b+1);
  877 + }
  878 + return sortGattArray;*/
  879 + var array = new Array();
  880 + var len = listA.length;
  881 + for(var i =0;i<len;i++) {
  882 + if(array.indexOf(listA[i].lpNo)<0)
  883 + array.push(listA[i].lpNo);
  884 + }
  885 + array.sort(baseF.compare);
  886 + var sortGattArray = new Array();
  887 + for(var k =0;k<array.length;k++) {
  888 + var index = array[k];
  889 + var temp = new Array();
  890 + for(var x=0;x<listA.length;x++) {
  891 + if(index==listA[x].lpNo)
  892 + temp.push(listA[x]);
  893 + }
  894 + sortGattArray = sortGattArray.concat(baseF.pxarr(temp));
  895 + }
  896 + var bcs = 1,fcno_=1,temp = sortGattArray[0].lpNo;
  897 + for(var p =0;p<len;p++) {
  898 + sortGattArray[p].bcs = bcs;
  899 + bcs++;
  900 + if(temp==sortGattArray[p].lpNo){
  901 + sortGattArray[p].fcno = fcno_;
  902 + fcno_++;
  903 + }else {
  904 + fcno_ = 1;
  905 + temp = sortGattArray[p].lpNo;
  906 + sortGattArray[p].fcno = fcno_;
  907 + fcno_++;
  908 + }
  909 + }
  910 + return sortGattArray;
  911 + },
  912 + /**
  913 + * @discription : (TODO) 调整首末班车时间点
  914 + *
  915 + * @params : [list--时刻表明细数组;smbcsj--首末班车时间]
  916 + *
  917 + * @return : 返回一个数组对象。这里返回的是时刻表明细数据
  918 + **/
  919 + tzsmbcsj : function(list,smbcsj,sj,cl,zd,lbsj) {
  920 + var _obj = baseF.getsxAndxxbc(list);
  921 + baseF.tcbc(_obj.sxbc,smbcsj[0].kssj,smbcsj[0].jssj);// 剔除上行不在时间范围内的班次
  922 + baseF.tcbc(_obj.xxbc,smbcsj[1].kssj,smbcsj[1].jssj);// 剔除下行不在时间范围内的班次
  923 + baseF.dzsmsj(_obj.sxbc,smbcsj[0].kssj,smbcsj[0].jssj,_obj.xxbc);// 调整上行首末班车时间
  924 + baseF.dzsmsj(_obj.xxbc,smbcsj[1].kssj,smbcsj[1].jssj,_obj.sxbc);// 调整下行首末班车时间
  925 + baseF.tzqtbc(_obj.sxbc,_obj.qt,sj,cl,zd,lbsj);
  926 + baseF.tzqtbc(_obj.xxbc,_obj.qt,sj,cl,zd,lbsj);
  927 + return _obj.sxbc.concat(_obj.xxbc).concat(_obj.qt);
  928 + },
  929 + tcbc : function(ar,kssj,jssj) {
  930 + for(var s = 0 ; s<ar.length;s++) {
  931 + if(baseF.isDelete(baseF.getDateTime(kssj),
  932 + baseF.getDateTime(jssj),
  933 + baseF.getDateTime(ar[s].fcsj))) {
  934 + ar.splice(s, 1);
  935 + }
  936 + }
  937 + },
  938 + dzsmsj : function(ar,kssj,jssj,list) {
  939 + var array = baseF.getsjArr(ar);
  940 + if(baseF.getTimeStr(new Date(Math.min.apply(null, array))) != kssj) {
  941 + baseF.upfcsj(ar,baseF.getTimeStr(new Date(Math.min.apply(null, array))),kssj,'before',list);
  942 + }
  943 + if(baseF.getTimeStr(new Date(Math.max.apply(null, array))) != jssj) {
  944 + baseF.upfcsj(ar,baseF.getTimeStr(new Date(Math.max.apply(null, array))),jssj,'later',list);
  945 + }
  946 + },
  947 + upfcsj : function(ar,str,sj,temp,list) {
  948 + for(var r = 0 ;r<ar.length;r++) {
  949 + if(ar[r].fcsj == str) {
  950 + ar[r].fcsj = sj;
  951 + var startTime = baseF.getDateTime(sj);
  952 + ar[r].ARRIVALTIME = baseF.getTimeStr(new Date(startTime.setMinutes(startTime.getMinutes()+ar[r].bcsj)));
  953 + if(temp=='before') {
  954 + var _dx = baseF.gettzsj(list,ar[r].bcs+1,ar[r].lpNo,ar[r].ARRIVALTIME,temp);
  955 + ar[r].STOPTIME = _dx;
  956 + }else if(temp=='later')
  957 + baseF.gettzsj(list,ar[r].bcs-1,ar[r].lpNo,ar[r].fcsj,temp);
  958 + }
  959 + }
  960 + },
  961 + gettzsj : function(list,bcs,lpNo,sj,temp) {
  962 + var _dx = 0;
  963 + for(var t = 0;t<list.length;t++) {
  964 + if(list[t].lpNo==lpNo && list[t].bcs == bcs) {
  965 + if(temp=='before') {
  966 + _dx = (baseF.getDateTime(list[t].fcsj) - baseF.getDateTime(sj))/60000;
  967 + }else if(temp=='later'){
  968 + _dx = (baseF.getDateTime(sj) - baseF.getDateTime(list[t].ARRIVALTIME))/60000;
  969 + list[t].STOPTIME = _dx;
  970 + }
  971 + }
  972 + }
  973 + return _dx;
  974 + },
  975 +
  976 + getsjArr : function(ar) {
  977 + var tempArray = new Array();
  978 + for(var j = 0 ; j<ar.length;j++) {
  979 + var newDate = new Date();
  980 + var strArray = ar[j].fcsj.split(':');
  981 + newDate.setHours(strArray[0]);
  982 + newDate.setMinutes(strArray[1]);
  983 + tempArray.push(newDate.getTime());
  984 + }
  985 + return tempArray;
  986 + },
  987 +
  988 + tzqtbc : function(list,qt,sj,cl,zd,lbsj) {
  989 + var array = baseF.getsjArr(list);
  990 + for(var i =0 ; i<list.length;i++ ) {
  991 + if(list[i].fcsj == baseF.getTimeStr(new Date(Math.min.apply(null, array)))) {
  992 + baseF.updjcbc(qt,list[i],sj,cl,zd,lbsj,'ccbc');
  993 + }else if(list[i].fcsj == baseF.getTimeStr(new Date(Math.max.apply(null, array)))) {
  994 + baseF.updjcbc(qt,list[i],sj,cl,zd,lbsj,'jcbc');
  995 + }
  996 + }
  997 + },
  998 +
  999 + updjcbc : function(ar,obj,sj,cl,zd,lbsj,lx) {
  1000 + var cctag = baseF.dirDmToIndex(obj.xlDir);
  1001 + for(var r = 0; r<ar.length;r++) {
  1002 + if(lx=='ccbc') {
  1003 + if(ar[r].lpNo == obj.lpNo && ar[r].fcno <obj.fcno) {
  1004 + var startTime = baseF.getDateTime(obj.fcsj);
  1005 + if(ar[r].bcType=='out') {
  1006 + ar[r].bcsj = sj[cctag];
  1007 + ar[r].fcsj = baseF.getTimeStr(new Date(startTime.setMinutes(startTime.getMinutes()-sj[cctag])));
  1008 + ar[r].ARRIVALTIME = obj.fcsj;
  1009 + ar[r].qdz = zd[zd];
  1010 + ar[r].jhlc = cl[cctag];
  1011 + }else if(ar[r].bcType =='bd') {
  1012 + ar[r].ARRIVALTIME = baseF.getTimeStr(new Date(startTime.setMinutes(startTime.getMinutes()-sj[cctag])));
  1013 + ar[r].fcsj = baseF.getTimeStr(new Date(startTime.setMinutes(startTime.getMinutes()-lbsj)));
  1014 + }
  1015 + ar[r].xlDir = obj.xlDir;
  1016 + }
  1017 + }else if(lx=='jcbc') {
  1018 + if(ar[r].lpNo == obj.lpNo && ar[r].fcno > obj.fcno) {
  1019 + var startTime = baseF.getDateTime(obj.ARRIVALTIME);
  1020 + if(ar[r].bcType=='in') {
  1021 + ar[r].bcsj = sj[cctag];
  1022 + ar[r].fcsj = obj.ARRIVALTIME ;
  1023 + ar[r].ARRIVALTIME = baseF.getTimeStr(new Date(startTime.setMinutes(startTime.getMinutes()+sj[cctag])));
  1024 + ar[r].qdz = zd[zd];
  1025 + ar[r].jhlc = cl[cctag];
  1026 + }else if(ar[r].bcType =='lc') {
  1027 + ar[r].fcsj = baseF.getTimeStr(new Date(startTime.setMinutes(startTime.getMinutes()+sj[cctag])));
  1028 + ar[r].ARRIVALTIME = baseF.getTimeStr(new Date(startTime.setMinutes(startTime.getMinutes()+lbsj)));
  1029 + }
  1030 + ar[r].xlDir = obj.xlDir;
  1031 + }
  1032 + }
  1033 + }
  1034 + },
  1035 +
  1036 + dirDmToIndex : function (str) {
  1037 + if(str == 'relationshipGraph-up')
  1038 + return 0;
  1039 + else if(str == 'relationshipGraph-down')
  1040 + return 1;
  1041 + },
  1042 +
  1043 + isDelete : function(t1,t2,t) {
  1044 + var tag = false;
  1045 + if(t<t1 || t>t2)
  1046 + tag = true;
  1047 + return tag;
  1048 + },
  1049 +
  1050 + getsxAndxxbc : function(json) {
  1051 + var upArray = new Array(),downArray = new Array(),qt = new Array();
  1052 + for(var j = 0 ; j< json.length ; j++) {
  1053 + if(json[j].bcType=='normal' || json[j].bcType=='region') {
  1054 + if(json[j].xlDir == 'relationshipGraph-up')
  1055 + upArray.push(json[j]);
  1056 + else if(json[j].xlDir == 'relationshipGraph-down')
  1057 + downArray.push(json[j]);
  1058 + }else {
  1059 + qt.push(json[j]);
  1060 + }
  1061 + }
  1062 + return {'sxbc' : upArray,'xxbc' : downArray,'qt': qt};
  1063 + },
  1064 + /**
  1065 + * @description : (TODO) 在同一块路牌下,根据发车序号进行顺序排序
  1066 + *
  1067 + * @params : [a1--需要排序的数组]
  1068 + *
  1069 + * @return : 返回一个数组.这里返回的是一个在同一块路牌下,根据发车序号排好顺序的班次数组
  1070 + **/
  1071 + pxarr : function (a1) {
  1072 + var array = new Array();
  1073 + var len = a1.length;
  1074 + for(var i =0;i<len;i++) {
  1075 + if(array.indexOf(a1[i].fcno)<0)
  1076 + array.push(a1[i].fcno);
  1077 + }
  1078 + array.sort(baseF.compare);
  1079 + var sortGattArray = new Array();
  1080 + for(var k =0;k<array.length;k++) {
  1081 + var index = array[k];
  1082 + for(var x=0;x<a1.length;x++) {
  1083 + if(index==a1[x].fcno)
  1084 + sortGattArray.push(a1[x]);
  1085 + }
  1086 + }
  1087 + return sortGattArray;
  1088 + },
  1089 + addbc : function(obj,lastObj,kssj,tzsj,xhNo,jsonArray,num) {
  1090 + var cctag = baseF.dirDmToIndex(lastObj.xlDir);
  1091 + var carArray = {'lp':lastObj.lp,'lpNo':lastObj.lpNo,'lpName':lastObj.lpName,'lpType':lastObj.lpType};
  1092 + var ags = {'tcc_id':lastObj.tcc,'skbName':lastObj.ttinfo,'lineName':lastObj.xl+'_'};
  1093 + for(var t = 0 ; t<num;t++){
  1094 + cctag = baseF.getfx(1,cctag);
  1095 + var _xxsj = baseF.getxssj(obj.configuration.dataMap.zgfsjd,
  1096 + obj.configuration.dataMap.wgfsjd,
  1097 + kssj,
  1098 + obj.configuration.dataMap.pcxssjArr,
  1099 + obj.configuration.dataMap.gfxxsjArr,cctag);// 获取行驶时间
  1100 + var temptzsj = t == num-1 ? 0 : tzsj;
  1101 + jsonArray.push(baseF.getbcObj( kssj,
  1102 + _xxsj,
  1103 + carArray,
  1104 + 'normal',
  1105 + obj.configuration.dataMap.dira[cctag],
  1106 + xhNo++,
  1107 + obj.configuration.dataMap.pcxslcArr[cctag],
  1108 + ags,0,
  1109 + obj.configuration.dataMap.qdzArr[cctag],
  1110 + obj.configuration.dataMap.zdzArr[cctag],
  1111 + null,temptzsj,0));
  1112 + // kssj = new Date(kssj.setMinutes(kssj.getMinutes() + temptzsj));
  1113 + kssj.setMinutes(kssj.getMinutes() + temptzsj)
  1114 + }
  1115 + lastObj.STOPTIME = 10;
  1116 + },
  1117 +
  1118 + /**
  1119 + * @description : (TODO) 获取某个路牌下的最后一个班次对象
  1120 + *
  1121 + * @params : [$_jsonD--班次数组;carName--路牌名称]
  1122 + *
  1123 + * @return : 返回一个map结构的Object对象.这里返回的是某个路牌下的最后一个班次对象
  1124 + */
  1125 + getLastTime : function ($_jsonD,carName) {
  1126 + var $_len =$_jsonD.length,tempArray = new Array(),$_data = new Array(),result = new Array();
  1127 + for(var j = 0 ; j<$_len;j++) {
  1128 + if($_jsonD[j].lpNo == carName && $_jsonD[j].bcType =='normal') {
  1129 + var newDate = new Date();
  1130 + var strArray = $_jsonD[j].ARRIVALTIME.split(':');
  1131 + newDate.setHours(strArray[0]);
  1132 + newDate.setMinutes(strArray[1]);
  1133 + tempArray.push(newDate.getTime());
  1134 + $_data.push($_jsonD[j]);
  1135 + }
  1136 + }
  1137 + var strTime = baseF.getTimeStr(new Date(Math.max.apply(null, tempArray)));
  1138 + for(var i = 0 ; i<$_data.length;i++) {
  1139 + if(strTime == $_data[i].ARRIVALTIME && carName == $_data[i].parent) {
  1140 + result.push($_data[i]);
  1141 + continue;
  1142 + }
  1143 +
  1144 + }
  1145 + return result;
  1146 + },
  1147 +
  1148 + getlpFirstSj : function(arr,lpNo) {
  1149 + var dqlpbc = new Array();
  1150 + for(var a = 0 ; a < arr.length; a++) {
  1151 + if(arr[a].lpNo == lpNo && arr[a].bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.normal)
  1152 + dqlpbc.push(arr[a]);
  1153 + }
  1154 + dqlpbc.sort(function(a,b){return a.fcno-b.fcno});
  1155 + return dqlpbc.length>0 ? baseF.getDateTime(dqlpbc[0].fcsj) : $_GlobalGraph.configuration.dataMap.zgfsjd[0];
  1156 + },
  1157 +
  1158 + addlpbc : function(obj,bf,theCar,numqs) {
  1159 + var car = new Object(),xhNo = 1,dqlpbc = new Array();
  1160 + for(var t =0 ; t< obj.configuration.taskTypes.length;t++) {
  1161 + if(obj.configuration.taskTypes[t].lpNo == theCar)
  1162 + car = obj.configuration.taskTypes[t];
  1163 + }
  1164 + // console.log(obj.configuration);
  1165 + var _mmstartTime = new Date(obj.configuration.dataMap.zgfsjd[0].st);
  1166 + var tempTime = new Date(_mmstartTime.setMinutes(_mmstartTime.getMinutes()-
  1167 + ((parseInt(obj.configuration.dataMap.map.clzs)-parseInt(theCar)))*obj.configuration.stopAraay[0].fcjx));
  1168 + var cctag = bf.getdefaultDir(obj.configuration.dataMap.smbcsjArr);// 获取出场类型 [0--上行出场;1--下行出场]
  1169 + var kssj = new Date(obj.configuration.dataMap.zgfsjd[0].st); // 获取该时段的开始时间点,并转为时间对象.
  1170 + var sjAndDir = bf.getBeganTime(tempTime,kssj,null,
  1171 + obj.configuration.stopAraay,
  1172 + obj.configuration.dataMap.zgfsjd,
  1173 + obj.configuration.dataMap.wgfsjd,
  1174 + obj.configuration.dataMap.pcxssjArr,
  1175 + obj.configuration.dataMap.gfxxsjArr,cctag);// 计算当前路牌第一个首班时间点.
  1176 + kssj = sjAndDir.d1;
  1177 + cctag = sjAndDir.dir;
  1178 + dqlpbc.push(bf.getbcObj(
  1179 + kssj,obj.configuration.dataMap.ccsjArr[cctag],
  1180 + car,obj.configuration.dataMap.bcTypeArr.bd,
  1181 + obj.configuration.dataMap.dira[cctag],xhNo++,0,
  1182 + obj.configuration.dataMap.map,0,null,null,null,0,obj.configuration.stopAraay[0].lbsj));// 早行例保班次
  1183 + dqlpbc.push(bf.getbcObj(
  1184 + kssj,obj.configuration.dataMap.ccsjArr[cctag],
  1185 + car,obj.configuration.dataMap.bcTypeArr.out,
  1186 + obj.configuration.dataMap.dira[cctag],xhNo++,
  1187 + obj.configuration.dataMap.cclcArr[cctag],
  1188 + obj.configuration.dataMap.map,0,
  1189 + obj.configuration.dataMap.qdzArr[cctag],null,null,0,0));// 出场班次
  1190 + var fxTagDm = 0;
  1191 + for(var i = 0 ; i<numqs;i++) {
  1192 + cctag = bf.getfx(fxTagDm,cctag);
  1193 + fxTagDm = 1;
  1194 + var _xxsj = bf.getxssj(obj.configuration.dataMap.zgfsjd,
  1195 + obj.configuration.dataMap.wgfsjd,kssj,
  1196 + obj.configuration.dataMap.pcxssjArr,
  1197 + obj.configuration.dataMap.gfxxsjArr,cctag);// 获取行驶时间
  1198 + var tzsj = i==(numqs-1) ? 0 : obj.configuration.stopAraay[0].tzjx;
  1199 + dqlpbc.push(bf.getbcObj(
  1200 + kssj,_xxsj,car,obj.configuration.dataMap.bcTypeArr.normal,
  1201 + obj.configuration.dataMap.dira[cctag],xhNo++,
  1202 + obj.configuration.dataMap.pcxslcArr[cctag],obj.configuration.dataMap.map,0,
  1203 + obj.configuration.dataMap.qdzArr[cctag],obj.configuration.dataMap.zdzArr[cctag],null,tzsj,0));// 正常班次
  1204 + kssj = new Date(kssj.setMinutes(kssj.getMinutes() + obj.configuration.stopAraay[0].tzjx));
  1205 + }
  1206 + return dqlpbc;
  1207 + },
  1208 +
  1209 + getDirBc : function(arr,dir) {
  1210 + var upArr = new Array(),downArr = new Array(),qt = new Array();
  1211 + for(var a =0;a<arr.length;a++) {
  1212 + if(arr[a].xlDir == dir[0] && arr[a].bcType=='normal') {
  1213 + upArr.push(arr[a]);
  1214 + }else if(arr[a].xlDir == dir[1] && arr[a].bcType=='normal') {
  1215 + downArr.push(arr[a]);
  1216 + }else {
  1217 + qt.push(arr[a]);
  1218 + }
  1219 + }
  1220 + // debugger;
  1221 + var tempup = baseF.sortDirArray(upArr);
  1222 + var tempdown = baseF.sortDirArray(downArr);
  1223 + return {'upArr':tempup,'downArr':tempdown,'qt':qt};
  1224 + },
  1225 +
  1226 + /**
  1227 + * @description : (TODO) 把班次数组按发车时间进行排序.
  1228 + *
  1229 + * @param [arr--需要进行按时间排序的班次数组]
  1230 + *
  1231 + * @return 返回一个按时间顺序排序的班次数组.
  1232 + *
  1233 + * @status OK.
  1234 + * */
  1235 + sortDirArray : function(arr) {
  1236 + ///debugger;
  1237 + //console.log(arr.length);
  1238 + var list = new Array(),tempArray = new Array();
  1239 + for(var a =0;a<arr.length;a++) {
  1240 + var long_ = baseF.getDateTime(arr[a].fcsj).getTime();
  1241 + if(tempArray.indexOf(long_)<0)
  1242 + tempArray.push(long_);
  1243 + }
  1244 + tempArray.sort(baseF.compare);
  1245 + for(var t = 0;t<tempArray.length;t++) {
  1246 + var strTime = baseF.getTimeStr(new Date(tempArray[t]));
  1247 + for(var d = 0 ;d<arr.length;d++) {
  1248 + if(strTime == arr[d].fcsj)
  1249 + list.push(arr[d]);
  1250 + }
  1251 + }
  1252 + //debugger;
  1253 + //console.log(list.length);
  1254 + return list;
  1255 + },
  1256 + /**
  1257 + * @description : (TODO) 均匀发车间隙
  1258 + *
  1259 + * @params : [arr--某个方向下的班次数组;dir--方向;zzsj--周转时间]
  1260 + *
  1261 + * @return : 返回一个数组.这里返回的是调整过后 发车间距均匀的班次数组
  1262 + **/
  1263 + jhfcjx : function(bcArr,dir,zzsj,dataMap) {
  1264 + // debugger;
  1265 + console.log(bcArr.length);
  1266 + //console.log('调整' + dir + '发车间隙...');
  1267 + // 1、定义某个方向下的首末班次时间结点.
  1268 + var kssj = baseF.getDateTime(bcArr[0].fcsj),// 开始时间.
  1269 + jssj = baseF.getDateTime(bcArr[bcArr.length-1].fcsj);// 结束时间.
  1270 + // list = new Array()
  1271 + //console.log('{jssj:' + kssj + '------jssj:' + jssj + '}');
  1272 + // 2、从首班车时间开始,每次以一个周转时间段为结点.调整这个时间段内的班次发车间隙.
  1273 + while(kssj<=jssj) {
  1274 + // 2.1、定义一个在一个时间上加上周转时间后的一个时间点.
  1275 + var temp = new Date();
  1276 + temp.setHours(kssj.getHours());
  1277 + temp.setMinutes(kssj.getMinutes()+zzsj);
  1278 + // console.log('{' + kssj + '------' + temp + '}');
  1279 + // 2.2、获取这个时间内的班次数组.
  1280 + var sjdbcArr = baseF.getObjRegion(kssj,temp,bcArr);
  1281 + var len_ = sjdbcArr.length, bcCount = baseF.getlpNum(sjdbcArr);// 定长度
  1282 + // 2.3、根据在这个时间段内的班次数,得到路牌数.并计算发车间隙.[发车间隙 = 周转时间 / 一个周转时间内的车辆数].
  1283 + var _fcjx = parseInt(Math.ceil(zzsj/bcCount));
  1284 + //console.log('{' + kssj + '------' + temp + '},----' + _fcjx + '---' + bcCount);
  1285 + if(bcCount==0)
  1286 + return;
  1287 + var fcnosj = new Date(kssj);
  1288 + // 2.4、调整班次
  1289 + //debugger;
  1290 + for(var l = 0 ;l<bcArr.length-1;l++) {
  1291 + var _t = baseF.getDateTime(bcArr[l].fcsj);
  1292 + if(_t>temp )
  1293 + continue;
  1294 + if(_t>=kssj && _t<=temp) {
  1295 + /*if(parseInt((baseF.getDateTime(bcArr[l+1].fcsj) - baseF.getDateTime(bcArr[l].fcsj))/60000) ==_fcjx)
  1296 + continue;*/
  1297 + bcArr[l].fcsj = baseF.getTimeStr(fcnosj);
  1298 + var _xxsj = baseF.getxssj(dataMap.zgfsjd,
  1299 + dataMap.wgfsjd,fcnosj,dataMap.pcxssjArr,
  1300 + dataMap.gfxxsjArr,baseF.dirDmToIndex(bcArr[l].xlDir));// 获取行驶时间
  1301 + bcArr[l].bcsj = _xxsj;
  1302 + var ddsj = new Date();
  1303 + ddsj.setHours(fcnosj.getHours());
  1304 + ddsj.setMinutes(fcnosj.getMinutes()+_xxsj);
  1305 + bcArr[l].ARRIVALTIME = baseF.getTimeStr(ddsj);
  1306 + fcnosj.setMinutes(fcnosj.getMinutes() + _fcjx);
  1307 + }
  1308 + /*if(l<1) {
  1309 + fcsjStr = sjdbcArr[l].fcsj;
  1310 + continue;
  1311 + }else {
  1312 + var fcsj = baseF.getDateTime(fcsjStr);
  1313 + var ddsj = new Date();
  1314 + ddsj.setHours(fcsj.getHours());
  1315 + ddsj.setMinutes(fcsj.getMinutes()+_fcjx);
  1316 + sjdbcArr[l].fcsj = baseF.getTimeStr(ddsj);
  1317 + var _xxsj = baseF.getxssj(dataMap.zgfsjd,
  1318 + dataMap.wgfsjd,ddsj,dataMap.pcxssjArr,
  1319 + dataMap.gfxxsjArr,baseF.dirDmToIndex(sjdbcArr[l].xlDir));// 获取行驶时间
  1320 + sjdbcArr[l].bcsj = _xxsj;
  1321 + ddsj.setMinutes(ddsj.getMinutes()+sjdbcArr[l].bcsj);
  1322 + sjdbcArr[l].ARRIVALTIME = baseF.getTimeStr(ddsj);
  1323 + fcsjStr = sjdbcArr[l].fcsj;
  1324 + }*/
  1325 + }
  1326 + // list = list.concat(sjdbcArr);
  1327 + // 2.5、调整完毕后,进入下个周转时间.
  1328 + kssj = new Date(kssj.setMinutes(kssj.getMinutes() + zzsj));
  1329 + }
  1330 + console.log(bcArr.length);
  1331 + return bcArr;
  1332 + },
  1333 + /**
  1334 + * @description : (TODO) 调整停站间隙
  1335 + *
  1336 + * @params : [arr--班次数组;lparr--路牌数组;dataMap--参数配置信息]
  1337 + *
  1338 + * @return : 返回一个数组.这里返回的是一个调整停站间隙完毕的班次数组.
  1339 + **/
  1340 + tztzsj : function(arr,lparr,dataMap) {},
  1341 + tztzsj01 : function(arr,lparr,dataMap) {
  1342 + var list = new Array();
  1343 + // 遍历路牌数组.
  1344 + for(var p = 0 ; p < lparr.length ; p++) {
  1345 + /*if(p!=0)
  1346 + continue;*/
  1347 + var lpNo = lparr[p],tempA = new Array();
  1348 + // 获取当前路牌下的所有班次.
  1349 + for(var r = 0 ; r < arr.length ; r++) {
  1350 + if(arr[r].lpNo == lpNo)
  1351 + tempA.push(arr[r]);
  1352 + }
  1353 + // 给当前路牌下的所有班次 按照发车序号进行顺序排序.
  1354 + tempA.sort(function(a,b){return a.fcno-b.fcno});
  1355 + for(var t = 0 ; t < tempA.length-1 ; t++) {
  1356 + // 2.1.1、 定义下个班次的发车时间
  1357 + var xgbcfcsj = baseF.getDateTime(tempA[t+1].fcsj);
  1358 + // 2.1.2、 定义当前班次的到达时间
  1359 + var dqbcddsj = baseF.getDateTime(tempA[t].ARRIVALTIME);
  1360 + // 2.1.3、 计算从下个班次的发车时间 到 当前班次的到达时间 中间隔多长时间.等同于 当前班次的停站时间 = 下个班次的发车时间 - 当前班次的到达时间
  1361 + var dx = parseInt((xgbcfcsj.getTime()-dqbcddsj.getTime())/60000);
  1362 + var mintzsj = 0;
  1363 + if(dx<=22 && dx >= dataMap.minztjx)
  1364 + mintzsj = dx;
  1365 + else if(dx < dataMap.minztjx)
  1366 + mintzsj = dataMap.minztjx;
  1367 + else if(dx>22) {
  1368 + tempA[t].STOPTIME = mintzsj;
  1369 + continue;
  1370 + }
  1371 + baseF.updbc(tempA[t],tempA[t+1],dqbcddsj,dataMap,true,null,null == 'cf' ? 0 : mintzsj);
  1372 + }
  1373 + // 2.2、把调整完毕的班次进行合并,并放入到新的数组.
  1374 + list = list.concat(tempA);
  1375 + }
  1376 + return list;
  1377 + },
  1378 + updbc : function(dqbc,xgbc,dqbcddsj,dataMap,tagb,type,tzsj) {
  1379 + dqbc.STOPTIME = tzsj;// 修改当前班次停站时间
  1380 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + tzsj);
  1381 + xgbc.fcsj = baseF.getTimeStr(dqbcddsj);// 修改下个班次的发车时间
  1382 + var _xxsj = xgbc.bcsj;
  1383 + /*if(!tagb && type=='cf') {
  1384 + _xxsj = baseF.getxssj(dataMap.zgfsjd,
  1385 + dataMap.wgfsjd,dqbcddsj,dataMap.pcxssjArr,
  1386 + dataMap.gfxxsjArr,baseF.dirDmToIndex(xgbc.xlDir));// 获取行驶时间
  1387 + }*/
  1388 + xgbc.bcsj = _xxsj;
  1389 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + _xxsj);
  1390 + xgbc.ARRIVALTIME = baseF.getTimeStr(dqbcddsj);// 修改下个班次的到达时间
  1391 + },
  1392 + getObjRegion : function(t1,t2,arr) {
  1393 + var _r = new Array();
  1394 + for(var p= 0; p<arr.length ; p++) {
  1395 + var _t = baseF.getDateTime(arr[p].fcsj);
  1396 + if(_t >= t1 && _t <= t2)
  1397 + _r.push(arr[p]);
  1398 + }
  1399 + /*return baseF.sortDirArray(_r);*/
  1400 + return _r.sort(function(a,b){return a.fcno-b.fcno});
  1401 + },
  1402 +
  1403 + getlpNum : function(arr) {
  1404 + var array = new Array();
  1405 + for(var r = 0 ; r < arr.length ; r++) {
  1406 + if(array.indexOf(arr[r].lpNo)<0)
  1407 + array.push(arr[r].lpNo);
  1408 + }
  1409 + return (array.length-1);
  1410 + },
  1411 + /**
  1412 + * @description : (TODO)更新进场与离场班次
  1413 + *
  1414 + * @params : [a--班次数组;t--开始时间;s--配置参数信息,c--当前路牌;o--该路牌下最后一个班次对象;no--序号]
  1415 + *
  1416 + * @return : 返回一个数组.这里返回的是一个已更新进场与离场班次的 班次数组
  1417 + */
  1418 + upd_Array : function (a,t,s,c,o,no) {
  1419 + for(var i= 0 ; i<a.length;i++) {
  1420 + // 1、判断是否为进场班次
  1421 + if(a[i].bcType == 'in' && a[i].parent == c && a[i].fcsj == o.ARRIVALTIME) {
  1422 + var startTime_in = new Date(t);
  1423 + a[i].fcsj = baseF.getTimeStr(startTime_in);
  1424 + startTime_in = new Date(startTime_in.setMinutes(startTime_in.getMinutes()+ s.jcsjArr[baseF.dirDmToIndex(o.xlDir)] ));
  1425 + a[i].ARRIVALTIME = baseF.getTimeStr(startTime_in);
  1426 + a[i].fcno = no+1;
  1427 + // 2、判断是否为离场班次
  1428 + }else if(a[i].bcType == 'lc' && a[i].parent == c ) {
  1429 + var startTime_lc = new Date(t);
  1430 + startTime_lc = new Date(startTime_lc.setMinutes(startTime_lc.getMinutes()+ s.jcsjArr[baseF.dirDmToIndex(o.xlDir)] ));
  1431 + a[i].fcsj = baseF.getTimeStr(startTime_in);
  1432 + startTime_lc = new Date(startTime_lc.setMinutes(startTime_lc.getMinutes()+s.lbsj));
  1433 + a[i].ARRIVALTIME = baseF.getTimeStr(startTime_in);
  1434 + a[i].fcno = no+2;
  1435 + }
  1436 + }
  1437 + return a;
  1438 + },
  1439 + /**
  1440 + * @discription : (TODO) 封装班次属性值
  1441 + *
  1442 + * @params : [t--起始时间;bcsj--班次历时;c--lp对象属性值;type--类型]
  1443 + *
  1444 + * @params : [dir--方向;bcs--序号;jhlc--计划里程;gatps--表单参数对象]
  1445 + *
  1446 + * @params : [isfb--是否分班;qdz--起点站;zdz--终点站;isSwitchXl--是否切割线路;st--停站时间]
  1447 + *
  1448 + * @return : 返回班次对象属性值
  1449 + *
  1450 + */
  1451 + getbcObj : function(t,bcsj,c,type,dir,xh,jhlc,gatps,isfb,qdz,zdz,isSwitchXl,st,lbsj) {
  1452 + var obj = {};
  1453 + obj.parent = c.lpNo;
  1454 + obj.lpNo = c.lpNo;
  1455 + obj.lp = c.lp;
  1456 + obj.lpName = c.lpName;
  1457 + obj.lpType = c.lpType;
  1458 + obj.bcType = type;
  1459 + obj.xlDir = dir;
  1460 + obj.fcno = xh;
  1461 + obj.jhlc = jhlc;// 计划里程
  1462 + obj.tcc = gatps.tcc_id;// 停车场id
  1463 + obj.ttinfo = gatps.skbName;// 时刻表id
  1464 + obj.xl = gatps.lineName.split('_')[0];// 线路id
  1465 + obj.isfb = isfb;
  1466 + obj.qdz = qdz;
  1467 + obj.zdz = zdz;
  1468 + obj.isSwitchXl = isSwitchXl;
  1469 + obj.STOPTIME = st;
  1470 + obj.bz = null;
  1471 + var startTime = null;
  1472 + if(type == 'bd' || type == 'out' || type == 'in' || type == 'lc')
  1473 + startTime = new Date(t);
  1474 + else
  1475 + startTime = t;
  1476 + if(type=='bd' || type=='lc' )
  1477 + obj.bcsj = lbsj;
  1478 + else
  1479 + obj.bcsj = bcsj;
  1480 + if(type=='bd') {
  1481 + startTime = new Date(startTime.setMinutes(startTime.getMinutes()-bcsj));
  1482 + obj.ARRIVALTIME = baseF.getTimeStr(startTime);
  1483 + startTime = new Date(startTime.setMinutes(startTime.getMinutes()-lbsj));
  1484 + obj.fcsj = baseF.getTimeStr(startTime);
  1485 + }else if(type=='out') {
  1486 + obj.ARRIVALTIME = baseF.getTimeStr(startTime);
  1487 + startTime = new Date(startTime.setMinutes(startTime.getMinutes()-bcsj));
  1488 + obj.fcsj = baseF.getTimeStr(startTime);
  1489 + }else if(type =='cf') {
  1490 + obj.fcsj = baseF.getTimeStr(startTime);
  1491 + startTime = new Date(startTime.setMinutes(startTime.getMinutes()+bcsj));
  1492 + obj.ARRIVALTIME = baseF.getTimeStr(startTime);
  1493 + }else if(type=='lc') {
  1494 + startTime = new Date(startTime.setMinutes(startTime.getMinutes()+bcsj));
  1495 + obj.fcsj = baseF.getTimeStr(startTime);
  1496 + startTime = new Date(startTime.setMinutes(startTime.getMinutes()+lbsj));
  1497 + obj.ARRIVALTIME = baseF.getTimeStr(startTime);
  1498 + }else if(type=='in') {
  1499 + obj.fcsj = baseF.getTimeStr(startTime);
  1500 + startTime = new Date(startTime.setMinutes(startTime.getMinutes()+bcsj));
  1501 + obj.ARRIVALTIME = baseF.getTimeStr(startTime);
  1502 + }else if(type=='normal') {
  1503 + obj.fcsj = baseF.getTimeStr(startTime);
  1504 + startTime = new Date(startTime.setMinutes(startTime.getMinutes()+bcsj));
  1505 + obj.ARRIVALTIME = baseF.getTimeStr(startTime);
  1506 + }
  1507 + return obj;
  1508 + },
  1509 + /**
  1510 + * @discription : (TODO) 获取时间格式[00:00]
  1511 + *
  1512 + * @params : [time--时间对象]
  1513 + *
  1514 + * @return : 返回字符串。这里返回的是一个时间格式的字符串
  1515 + **/
  1516 + getTimeStr : function(startTime) {
  1517 + return ((startTime.getHours()<10? '0' + startTime.getHours() : startTime.getHours()) == '00' ? '24' :(startTime.getHours()<10? '0' + startTime.getHours() : startTime.getHours()))
  1518 + +':'
  1519 + +(startTime.getMinutes()<10? '0' + startTime.getMinutes() : startTime.getMinutes());
  1520 + },
  1521 + /**
  1522 + * @discription : (TODO)获取开始时间
  1523 + *
  1524 + * @params : [d1--零界时间点;d2--该时段开始时间点;type--时间段类型;countTime--周转时间数值;stopTime--停站时间数值]
  1525 + *
  1526 + * @return : 返回一个中国标准时间对象。这里返回的是每一个路牌的第一个开始时间点
  1527 + **/
  1528 + getBeganTime : function(d1,d2,type,list,zg,wa,pc,gf,dir) {
  1529 + if(type=='ee') {
  1530 + var cf = 0;
  1531 + while(d1<d2) {
  1532 + dir = baseF.getfx(1,dir);
  1533 + var dx = baseF.getxssj(zg,wa,d1,pc,gf,dir) + list[0].tzjx;
  1534 + if(d1> new Date (baseF.getCFDate(10,30)) &&
  1535 + d1<new Date (baseF.getCFDate(12,0)) && cf <=0) {
  1536 + dx = dx + 20;
  1537 + cf++;
  1538 + }
  1539 + d1 = new Date(d1.setMinutes(d1.getMinutes() + dx));
  1540 + }
  1541 + }
  1542 + return {'d1':d1,'dir':dir};
  1543 + },
  1544 + /**
  1545 + * @discription : (TODO) 字符串转时间对象
  1546 + *
  1547 + * @params : 具有一定格式的时间字符串
  1548 + *
  1549 + * @return : 返回一个中国标准时间点
  1550 + *
  1551 + **/
  1552 + getDateTime : function(time) {
  1553 + var dateTime = new Date();
  1554 + if(time !=null && time !='' && typeof(time) !='undefined') {
  1555 + timeArr = time.split(':');
  1556 + dateTime.setHours(parseInt(timeArr[0]));
  1557 + dateTime.setMinutes(parseInt(timeArr[1]));
  1558 + }
  1559 + return dateTime;
  1560 + },
  1561 + /**
  1562 + * @discription : (TODO) 计算不同时段的车辆数
  1563 + *
  1564 + * @params : 数组对象
  1565 + *
  1566 + * @return : 返回一个数组对象。
  1567 + **/
  1568 + getArithmetic : function(array) {
  1569 + var $_sIndex = 0;
  1570 + for(var s = 0 ; s<array.length;s++) {
  1571 + var carNum = array[s].num - $_sIndex;
  1572 + array[s].carnum = carNum;
  1573 + if(s<3)
  1574 + $_sIndex = array[s].num;
  1575 + }
  1576 + return array;
  1577 + },
  1578 + /**
  1579 + * @discription : (TODO)根据不同时段的车辆数,用最适当的方式分配车
  1580 + *
  1581 + * @params : [carArra--路牌数组对象;lineTypeArray--不同时段的车辆数数组对象]
  1582 + *
  1583 + * @return : 返回一个数组。这里返回一个已分配好车辆的不同时段的车辆数数组对象
  1584 + **/
  1585 + getCutCarArray_ : function(carArra,lineTypeArray) {
  1586 + var tempArra = carArra.slice(),_sortArray = new Array(),_lenArray = new Array();
  1587 + var _sortLineNum = lineTypeArray[3].carnum <= lineTypeArray[4].carnum ? lineTypeArray[4].carnum : lineTypeArray[3].carnum,
  1588 + _lenLineNum = lineTypeArray[0].carnum+lineTypeArray[1].carnum+lineTypeArray[2].carnum,
  1589 + _avg = parseInt(carArra.length/2);
  1590 + if(_sortLineNum<_lenLineNum) {
  1591 + for(var e = 0 ;e<tempArra.length;e++) {
  1592 + if(e%2!=0)
  1593 + _sortArray.push(tempArra[e]);
  1594 + }
  1595 + _sortArray = _sortArray.splice(0,_sortLineNum);
  1596 + _lenArray = baseF.chaji_array(tempArra,_sortArray);
  1597 + }else if(_sortLineNum==_lenLineNum) {
  1598 + for(var t = 0 ;t<tempArra.length;t++) {
  1599 + if(t%2==0)
  1600 + _lenArray.push(tempArra[t]);
  1601 + else
  1602 + _sortArray.push(tempArra[t]);
  1603 + }
  1604 + }else if(_sortLineNum>_lenLineNum) {
  1605 + for(var e = 0 ;e<tempArra.length;e++) {
  1606 + if(e%2==0)
  1607 + _lenArray.push(tempArra[e]);
  1608 + }
  1609 + _lenArray = _lenArray.splice(0,_lenLineNum);
  1610 + _sortArray = baseF.chaji_array(tempArra,_lenArray);
  1611 + }
  1612 + for(var l =0 ;l<lineTypeArray.length;l++) {
  1613 + var carNum = lineTypeArray[l].carnum,concatArray = new Array();
  1614 + for(var c = 0; c<carNum;c++) {
  1615 + if(l<=2) {
  1616 + concatArray = concatArray.concat(_lenArray.splice(0,1));
  1617 + }else {
  1618 + concatArray = concatArray.concat(_sortArray[c]);
  1619 + }
  1620 + }
  1621 + lineTypeArray[l].car = concatArray;
  1622 + }
  1623 + return lineTypeArray;
  1624 + },
  1625 + /**
  1626 + * @discription : (TODO)求两个集合的差集
  1627 + *
  1628 + * @params : [arr1--数组1;arr2--数组2]
  1629 + *
  1630 + * @return : 返回两个集合的差集。这里返回的是封装的ar1不在ar2中的元素数组对象
  1631 + *
  1632 + **/
  1633 + chaji_array : function(arr1,arr2){
  1634 + var arr3 = [];
  1635 + for (var i = 0; i < arr1.length; i++) {
  1636 + var flag = true;
  1637 + for (var j = 0; j < arr2.length; j++) {
  1638 + if (arr2[j] == arr1[i])
  1639 + flag = false;
  1640 + }
  1641 + if (flag)
  1642 + arr3.push(arr1[i]);
  1643 + }
  1644 + return arr3;
  1645 + },
  1646 + };
  1647 + return baseF;
  1648 +}();
0 1649 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/components-bootstrap-tagsinput.js 0 → 100644
  1 +var ComponentsBootstrapTagsinput = function() {
  2 +
  3 + var handleDemo1 = function() {
  4 + var elt = $('#object_tagsinput');
  5 +
  6 + elt.tagsinput({
  7 + itemValue: 'value',
  8 + itemText: 'text',
  9 + });
  10 +
  11 + $('#object_tagsinput_add').on('click', function(){
  12 + elt.tagsinput('add', {
  13 + "value": $('#object_tagsinput_value').val(),
  14 + "text": $('#object_tagsinput_city').val(),
  15 + "continent": $('#object_tagsinput_continent').val()
  16 + });
  17 + });
  18 +
  19 + elt.tagsinput('add', { "value": 1 , "text": "Amsterdam" , "continent": "Europe" });
  20 + elt.tagsinput('add', { "value": 4 , "text": "Washington" , "continent": "America" });
  21 + elt.tagsinput('add', { "value": 7 , "text": "Sydney" , "continent": "Australia" });
  22 + elt.tagsinput('add', { "value": 10, "text": "Beijing" , "continent": "Asia" });
  23 + elt.tagsinput('add', { "value": 13, "text": "Cairo" , "continent": "Africa" });
  24 + }
  25 +
  26 + var handleDemo2 = function() {
  27 +
  28 + var elt = $('#state_tagsinput');
  29 +
  30 + elt.tagsinput({
  31 + tagClass: function(item) {
  32 + switch (item.continent) {
  33 + case 'Europe':
  34 + return 'label label-primary';
  35 + case 'America':
  36 + return 'label label-danger label-important';
  37 + case 'Australia':
  38 + return 'label label-success';
  39 + case 'Africa':
  40 + return 'label label-default';
  41 + case 'Asia':
  42 + return 'label label-warning';
  43 + }
  44 + },
  45 + itemValue: 'value',
  46 + itemText: 'text'
  47 + });
  48 +
  49 + $('#state_tagsinput_add').on('click', function(){
  50 + elt.tagsinput('add', {
  51 + "value": $('#state_tagsinput_value').val(),
  52 + "text": $('#state_tagsinput_city').val(),
  53 + "continent": $('#state_tagsinput_continent').val()
  54 + });
  55 + });
  56 +
  57 + elt.tagsinput('add', {
  58 + "value": 1,
  59 + "text": "Amsterdam",
  60 + "continent": "Europe"
  61 + });
  62 + elt.tagsinput('add', {
  63 + "value": 4,
  64 + "text": "Washington",
  65 + "continent": "America"
  66 + });
  67 + elt.tagsinput('add', {
  68 + "value": 7,
  69 + "text": "Sydney",
  70 + "continent": "Australia"
  71 + });
  72 + elt.tagsinput('add', {
  73 + "value": 10,
  74 + "text": "Beijing",
  75 + "continent": "Asia"
  76 + });
  77 + elt.tagsinput('add', {
  78 + "value": 13,
  79 + "text": "Cairo",
  80 + "continent": "Africa"
  81 + });
  82 + }
  83 +
  84 + return {
  85 + init: function() {
  86 + handleDemo1();
  87 + handleDemo2();
  88 + }
  89 + };
  90 +
  91 +}();
0 92 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js 0 → 100644
  1 +/**
  2 + * @discription TODO(图层类)
  3 + *
  4 + * @author bsth@lq
  5 + *
  6 + * @date 二〇一六年十二月八日 10:39:52
  7 + *
  8 + **/
  9 +
  10 +/**
  11 + *
  12 + * 图层作用域下的全局变量定义
  13 + *
  14 + ************************************************************************************************************************************************/
  15 +var historyArray = [],// 保存操作图形后的数据集合(撤销与恢复操作)
  16 + $_keyIndex = 0,// 记录当前操作步骤 (在撤销与恢复操作时)
  17 + $_GlobalGraph = new Object(),// 图层对象(在创建图层对象时)
  18 + flagIndex = 0,// 鼠标绘制的当前选择框标识(这里限制只做一次性选择元素拖拽,在绘制选择框时)
  19 + _singElmtDrStartX = 0, // 记录单个rect元素(班次)做左右拖拽(拖拽开始...)鼠标开始位置.
  20 + _singElemtDrStatus = false,// 标记单个rect元素沿X方向进行拖拽状态.默认关闭状态.
  21 + drwaStartY = 0,// 鼠标从选择框按下开始标记Y值(在选择框做上下【↕】拖拽时)
  22 + drwaStartYStatus = false,// 标记选择框沿Y方向进行拖拽状态.默认关闭状态.
  23 + drwaStartX = 0,// 鼠标从选择框左右拖拽中心点按下开始标记X值 (在选择框上边线中心点做左右【↔】拖拽时)
  24 + drwaStartXStatus = false,// 标记鼠标从选择框中心点按下沿X方向进行拖拽状态.默认关闭状态.
  25 + drwaRightX = 0,// 鼠标从选择框右拖拽中心点按下开始标记X值 (在选择框右边线中心点做右【→】拖拽时)
  26 + drwaRightXStatus = false,// 标记鼠标从选择框右边点按下沿X方向进行拖拽状态.默认关闭状态.
  27 + drwaLeftX = 0,// 鼠标从选择框左拖拽中心点按下开始标记X值 (在选择框左边线中心点做左【←】拖拽时)
  28 + drwaLeftXStatus = false,// 标记鼠标从选择框左边点按下沿X方向进行拖拽状态.默认关闭状态.
  29 + gClassNameArray = new Array(),// 标记被选择的元素(在绘制选择框完成时)
  30 + yAxisYArray = new Array(),// Y轴坐标数组
  31 + tipEventTimer = null,// 提示工具栏定时器.
  32 + workeType = [{'type':'六工一休','minueV':6.40,'hourV':6.66},
  33 + {'type':'五工一休','minueV':6.51,'hourV':6.85},
  34 + {'type':'四工一休','minueV':7.08,'hourV':7.14},
  35 + {'type':'三工一休','minueV':7.37,'hourV':7.61},
  36 + {'type':'二工一休','minueV':8.34,'hourV':8.34},
  37 + {'type':'一工一休','minueV':11.25,'hourV':11.42},
  38 + {'type':'五工二休','minueV':8.00,'hourV':7.99},
  39 + {'type':'无工休', 'minueV':5.43,'hourV':5.67}];// 班工时规定
  40 +/************************************************************************************************************************************************/
  41 +
  42 +/**
  43 + * @description : (TODO) : 撤销事件(后退)
  44 + *
  45 + * @see ✿ 判断是否在图层编辑(元素拖拽)中。
  46 + *
  47 + * 如果在,关闭图层编辑状态,记录当前操作步骤,根据步骤数在保存操作图形后的数据集合中获取数据重新渲染图层。
  48 + *
  49 + * @status OK.
  50 + ************************************************************************************************************************************************/
  51 +$('.revoke').on('click',function() {
  52 + // 判断选择框是否存在.
  53 + if(RelationshipGraph.getFlagIndex()>0){
  54 + // 关闭所有提示弹出层.
  55 + layer.closeAll();
  56 + layer.confirm('您正处于【批量班次操作】过程中...是否确定退出当前操作进行【撤销】!', {
  57 + btn : [ '确认提示并提交', '取消' ]
  58 + },function () {
  59 + // 执行选择框关闭函数.
  60 + RelationshipGraph.gClose();
  61 + // 执行撤销函数.
  62 + RelationshipGraph.cancel();
  63 + });
  64 + }else {
  65 + // 执行撤销函数.
  66 + RelationshipGraph.cancel();
  67 + }
  68 +});
  69 +/************************************************************************************************************************************************/
  70 +
  71 +
  72 +/**
  73 + * @description : (TODO) 监听恢复事件(前进)
  74 + *
  75 + * @see ✿ 判断是否在图层编辑(元素拖拽)中。
  76 + *
  77 + * 如果在,关闭图层编辑状态,记录当前操作步骤,根据步骤数在保存操作图形后的数据集合中获取数据重新渲染图层。
  78 + *
  79 + * @status OK.
  80 + ************************************************************************************************************************************************/
  81 +$('.recover').on('click',function() {
  82 + // 判断选择框是否存在.
  83 + if(RelationshipGraph.getFlagIndex()>0) {
  84 + // 关闭所有提示弹出层.
  85 + layer.closeAll();
  86 + layer.confirm('您正处于【批量班次操作】过程中...是否确定退出当前操作进行【恢复】!', {
  87 + btn : [ '确认提示并提交', '取消' ]
  88 + },function () {
  89 + // 执行选择框关闭函数.
  90 + RelationshipGraph.gClose();
  91 + // 执行恢复函数.
  92 + RelationshipGraph.regain();
  93 + });
  94 + }else {
  95 + // 执行恢复函数.
  96 + RelationshipGraph.regain();
  97 + }
  98 +});
  99 +/************************************************************************************************************************************************/
  100 +
  101 +/**
  102 + * @desciption (TODO) 监听删除事件.
  103 + *
  104 + * @status OK.
  105 + ************************************************************************************************************************************************/
  106 +$('.reladelete').on('click',function() {
  107 + // 判断是否存在选择框选中班次状态.
  108 + if(RelationshipGraph.getFlagIndex()<1) {
  109 + layer.msg('批量删除需要【框选择中班次】才可以操作哦...!');
  110 + return;
  111 + }
  112 + // 关闭所有提示弹出层.
  113 + layer.closeAll();
  114 + // 定义路牌.发车序号数组.
  115 + var lp = new Array(),fcno = new Array();
  116 + for(var c =0;c<gClassNameArray.length;c++) {
  117 + if(typeof(gClassNameArray[c])=='string') {
  118 + var data = d3.select('rect[parent-node='+ gClassNameArray[c] +']').data()[0];
  119 + if(lp.indexOf(data.lpName)<0)
  120 + lp.push(data.lpName);
  121 + fcno.push(data.fcno);
  122 + }
  123 + }
  124 + layer.confirm('您确定要进行批量删除路牌【'+ lp.toString() +'】-->发车序号【'+ fcno.toString() +'】嘛!'+
  125 + '</br>&nbsp;&nbsp;&nbsp;* 注意:如需要撤销当前操作,您可以在系统工具下拉选择点击【撤销按钮】进行恢复.', {
  126 + btn : [ '确认提示并提交', '取消' ]
  127 + }, function() {
  128 + // 关闭所有提示弹出层.
  129 + layer.closeAll();
  130 + // 删除class为case_g的g元素。
  131 + $("g.case_g").remove();
  132 + // 获取选择框所有的元素.
  133 + var nodes = d3.selectAll('.caseactive')[0];
  134 + // 删除选择框.
  135 + $_GlobalGraph.removeNodes(nodes);
  136 + // 选择框标记清零.
  137 + RelationshipGraph.setFlagIndex(0);
  138 + // 清空标记被选择框选中的元素数组.
  139 + gClassNameArray.splice(0,gClassNameArray.length);
  140 + // 重新绘制发车时刻,并重新统计.
  141 + RelationshipGraph.reDrawDepart();
  142 + // 记录当前操作.
  143 + $_GlobalGraph.addHistory();
  144 + });
  145 +});
  146 +/************************************************************************************************************************************************/
  147 +
  148 +
  149 +/**
  150 + * @description : (TODO) 监听添加班次事件.
  151 + *
  152 + * @status OK.
  153 + ************************************************************************************************************************************************/
  154 +$('.reladplus').on('click',function() {
  155 + // 判断选择框是否存在.
  156 + if(RelationshipGraph.getFlagIndex()>0) {
  157 + // 关闭所有提示弹出层.
  158 + layer.closeAll();
  159 + layer.confirm('您正处于【批量班次操作】过程中...是否确定退出当前操作进行【添加班次】!', {
  160 + btn : [ '确认提示并提交', '取消' ]
  161 + },function () {
  162 + // 关闭所有提示弹出层.
  163 + layer.closeAll();
  164 + // 执行选择框关闭函数.
  165 + RelationshipGraph.gClose();
  166 + // 执行添加班次函数.
  167 + RelationshipGraph.reladplus();
  168 + });
  169 + }else {
  170 + // 执行添加班次函数.
  171 + RelationshipGraph.reladplus();
  172 + }
  173 +});
  174 +/************************************************************************************************************************************************/
  175 +
  176 +/**
  177 + * @description : (TODO) 监听添加路牌事件.
  178 + *
  179 + * @status OK.
  180 + ************************************************************************************************************************************************/
  181 + $('.addlp').on('click',function() {
  182 + // 判断选择框是否存在.
  183 + if(RelationshipGraph.getFlagIndex()>0) {
  184 + // 关闭所有提示弹出层.
  185 + layer.closeAll();
  186 + layer.confirm('您正处于【批量班次操作】过程中...是否确定退出当前操作进行【添加路牌】!', {
  187 + btn : [ '确认提示并提交', '取消' ]
  188 + },function () {
  189 + // 关闭所有提示弹出层.
  190 + layer.closeAll();
  191 + // 执行选择框关闭函数.
  192 + RelationshipGraph.gClose();
  193 + // 执行添加路牌函数.
  194 + RelationshipGraph.addlp();
  195 + });
  196 + }else {
  197 + // 执行添加路牌函数.
  198 + RelationshipGraph.addlp();
  199 + }
  200 + });
  201 +/************************************************************************************************************************************************/
  202 +
  203 +/**
  204 + * @description : (TODO) 均匀发车事件.
  205 + *
  206 + * @stutas : OK.
  207 + *
  208 + ************************************************************************************************************************************************/
  209 +$('.updownread').on('click',function() {
  210 + // 判断选择框是否存在.
  211 + if(RelationshipGraph.getFlagIndex()>0) {
  212 + // 关闭所有提示弹出层.
  213 + layer.closeAll();
  214 + layer.confirm('您正处于【批量班次操作】过程中...是否确定退出当前操作进行【均匀发车间隙】!', {
  215 + btn : [ '确认提示并提交', '取消' ]
  216 + },function () {
  217 + // 关闭所有提示弹出层.
  218 + layer.closeAll();
  219 + // 执行选择框关闭函数.
  220 + RelationshipGraph.gClose();
  221 + // 执行均匀发车间隙函数.
  222 + RelationshipGraph.updownread();
  223 + });
  224 + }else {
  225 + // 执行均匀发车间隙函数
  226 + RelationshipGraph.updownread();
  227 + }
  228 +});
  229 +/************************************************************************************************************************************************/
  230 +
  231 +/**
  232 + * 调整班次点击事件
  233 + *
  234 + ************************************************************************************************************************************************/
  235 +$('.aboutread').on('click',function() {
  236 + // 判断选择框是否存在.
  237 + if(RelationshipGraph.getFlagIndex()>0) {
  238 + // 关闭所有提示弹出层.
  239 + layer.closeAll();
  240 + layer.confirm('您正处于【批量班次操作】过程中...是否确定退出当前操作进行【调整班次】!', {
  241 + btn : [ '确认提示并提交', '取消' ]
  242 + },function () {
  243 + // 关闭所有提示弹出层.
  244 + layer.closeAll();
  245 + // 执行选择框关闭函数.
  246 + RelationshipGraph.gClose();
  247 + // 执行均匀发车间隙函数.
  248 + RelationshipGraph.aboutread();
  249 + });
  250 + }else {
  251 + // 执行均匀发车间隙函数
  252 + RelationshipGraph.aboutread();
  253 + }
  254 +});
  255 +/************************************************************************************************************************************************/
  256 +
  257 +/**
  258 + * @description : (TODO) 保存数据.
  259 + *
  260 + * @status OK.
  261 + ************************************************************************************************************************************************/
  262 + $('.checkAdd').on('click',function() {
  263 + // 判断选择框是否存在.
  264 + if(RelationshipGraph.getFlagIndex()>0) {
  265 + // 关闭所有提示弹出层.
  266 + layer.closeAll();
  267 + layer.confirm('您正处于【批量班次操作】过程中...是否确定退出当前操作进行【保存数据】!', {
  268 + btn : [ '确认提示并提交', '取消' ]
  269 + },function () {
  270 + // 关闭所有提示弹出层.
  271 + layer.closeAll();
  272 + // 执行选择框关闭函数.
  273 + RelationshipGraph.gClose();
  274 + // 执行均匀发车间隙函数.
  275 + RelationshipGraph.checkAdd();
  276 + });
  277 + }else {
  278 + // 执行均匀发车间隙函数
  279 + RelationshipGraph.checkAdd();
  280 + }
  281 + });
  282 +/************************************************************************************************************************************************/
  283 +
  284 +/**
  285 + * @description : (TODO)获取路牌对应的班次数(这里的班次不包括早晚例保班次、吃饭时间)
  286 + *
  287 + * @params : [a1--班次数组;a2--路牌数组]
  288 + *
  289 + * @return : 返回一个数组.这里返回的是一个封装的每个路牌对应的班次数(这里的班次不包括早晚例保班次、吃饭时间、班次时间为0的班次)
  290 + ************************************************************************************************************************************************/
  291 +var getbczs = function (a1,a2) {
  292 + var array = new Array();
  293 + // 1、遍历路牌数组
  294 + for(var i = 0;i<a2.length;i++) {
  295 + var bcs = 0;
  296 + // 2、遍历班次数组
  297 + for(var j =0;j<a1.length;j++) {
  298 + // 3、判断当前班次j是否属于当前路牌i下,除去早晚例保班次、吃饭时间、班次时间为0的班次
  299 + if(a1[j].parent == a2[i].lpA.lpNo && a1[j].bcType!='bd' && a1[j].bcType!='lc' && a1[j].bcType!='cf' && a1[j].bcsj>0)
  300 + bcs++;
  301 + }
  302 + // 4、把每个路牌下的对应班次数一一封装在一起,并添加到返回数组里边
  303 + array.push({lpNo:a2[i].lpA.lpNo,bcs:bcs});
  304 + }
  305 + return array;
  306 +}
  307 +/************************************************************************************************************************************************/
  308 +
  309 +
  310 +/**
  311 + * d3动画过度
  312 + *
  313 + * @param {Object} d3 Element
  314 + *
  315 + * @returns {Function} 动画函数部分
  316 + ************************************************************************************************************************************************/
  317 +var _animation = function(d3Node) {return d3Node.transition().delay(function(d,i){return 0.001;}).duration(300).ease("linear");}
  318 +/************************************************************************************************************************************************/
  319 +
  320 +
  321 +/** 创建提示框内容
  322 + *
  323 + * @param {Object} RelationshipGraph 对象
  324 + *
  325 + * @returns {Object} table.outerHTML
  326 + ************************************************************************************************************************************************/
  327 +var createTooltip = function createTooltip(self) {
  328 + var hiddenKeys = ['_PRIVATE_','fcno' ,'PARENTCOLOR', 'SETNODECOLOR', 'SETNODESTROKECOLOR', /*'INTERVAL',*/'num'],
  329 + showKeys = self.configuration.showKeys;
  330 + return d3.tip().attr('class', 'relationshipGraph-tip').offset([-8, -10]).html(function (obj) {
  331 + var keys = Object.keys(obj),
  332 + table = document.createElement('table'),
  333 + count = keys.length,
  334 + rows = [];
  335 + while (count--) {
  336 + var element = keys[count],
  337 + upperCaseKey = element.toUpperCase();
  338 + if (!RelationshipGraph.contains(hiddenKeys, upperCaseKey) && !upperCaseKey.startsWith('__') && obj[element] !='tjz') {
  339 + var row = document.createElement('tr'),
  340 + key = showKeys ? document.createElement('td') : null,
  341 + value = document.createElement('td');
  342 + if (showKeys) {
  343 + var changeKey = null;
  344 + if(element=='fcsj')
  345 + changeKey = '发车时间:';
  346 + else if(element=='ARRIVALTIME')
  347 + changeKey = '到站时间:';
  348 + else if(element=='bcsj')
  349 + changeKey = '行驶时间:';
  350 + else if(element=='STOPTIME')
  351 + changeKey = '停息时间:';
  352 + else if(element=='xlDir')
  353 + changeKey = '行驶方向:';
  354 + else if(element=='parent')
  355 + changeKey = '当前车辆:';
  356 + else if(element=='bcType')
  357 + changeKey = '班次类型:';
  358 + else if(element=='tjbx')
  359 + changeKey = '推荐班型:';
  360 + else
  361 + changeKey = element;
  362 + key.innerHTML =changeKey;
  363 + row.appendChild(key);
  364 + }
  365 +
  366 + if (upperCaseKey == 'VALUE' && !self.configuration.valueKeyName) {
  367 + continue;
  368 + }
  369 +
  370 + if(obj[element]=='relationshipGraph-up')
  371 + value.innerHTML = '上行';
  372 + else if(obj[element]=='relationshipGraph-down')
  373 + value.innerHTML = '下行';
  374 + else if(obj[element]=='normal')
  375 + value.innerHTML = '正常';
  376 + else if(obj[element]=='region')
  377 + value.innerHTML = '区间';
  378 + else if(obj[element]=='fb')
  379 + value.innerHTML = '分班';
  380 + else if(obj[element]=='in')
  381 + value.innerHTML = '进场';
  382 + else if(obj[element]=='lc')
  383 + value.innerHTML = '保养';
  384 + else if(obj[element]=='out')
  385 + value.innerHTML = '出场';
  386 + else if(obj[element]=='bd')
  387 + value.innerHTML = '保养';
  388 + else
  389 + value.innerHTML = obj[element];
  390 + value.style.fontWeight = 'normal';
  391 + row.appendChild(value);
  392 + rows.push(row);
  393 + }
  394 + }
  395 + var rowCount = rows.length;
  396 + while (rowCount--) {
  397 + table.appendChild(rows[rowCount]);
  398 + }
  399 + return table.outerHTML;
  400 + });
  401 +};
  402 +/************************************************************************************************************************************************/
  403 +
  404 +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  405 +
  406 +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
  407 +
  408 +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("不能调用一个类作为函数."); } }
  409 +
  410 +/** 定义图层类
  411 + *
  412 + * @return {Object} 返回图层对象
  413 + *
  414 + **/
  415 +var RelationshipGraph = function () {
  416 +
  417 + /**
  418 + * 创建对象
  419 + *
  420 + * @param {d3.selection} 选择包含图的元素的标识
  421 + *
  422 + * @param {Object} 图层参数配置信息
  423 + *
  424 + **/
  425 + function RelationshipGraph(selection) {
  426 + // 获取配置参数
  427 + var userConfig = arguments.length <= 1 || arguments[1] === undefined ? { showTooltips: true, maxChildCount: 0, thresholds: [] } : arguments[1];
  428 + // 不能把类作为函数调用
  429 + _classCallCheck(this, RelationshipGraph);
  430 + var defaultOnClick = { parent: RelationshipGraph.noop, child: RelationshipGraph.noop };
  431 + // 图层配置参数信息
  432 + this.configuration = {
  433 + multiple: userConfig.multiple || 0,
  434 + hours : userConfig.hours || 24,
  435 + dxHours : userConfig.dxHours,
  436 + width:userConfig.width || 0,// 图层宽
  437 + height:userConfig.height || 0,// 图层高
  438 + offsetX:userConfig.offsetX || 0,// 偏移X值
  439 + offsetY:userConfig.offsetY || 0,// 偏移Y值
  440 + widtMargin:userConfig.widtMargin || 0,// 宽边距
  441 + heightMargin : userConfig.heightMargin ||0,// 高边距
  442 + downDy :userConfig.downDy ||0,// 下行发车时刻Y值差距
  443 + upDy : userConfig.upDy ||0,// 下行发车时刻Y值差值
  444 + timeDomainStart : userConfig.timeDomainStart,// 开始时间
  445 + timeDomainEnd : userConfig.timeDomainEnd,// 结束时间
  446 + startStr:userConfig.startStr,
  447 + endStr: userConfig.endStr,
  448 + taskTypes : userConfig.taskTypes,
  449 + lpNoA : userConfig.lpNoA,
  450 + tickFormat: userConfig.tickFormat,
  451 + stopAraay : userConfig.stopAraay,
  452 + dataMap : userConfig.dataMap,
  453 + selection: selection, // 图形的标识.
  454 + showTooltips: userConfig.showTooltips, // 是否显示工具提示在盘旋
  455 + maxChildCount: userConfig.maxChildCount || 0, // 每行最多显示的儿童数量.
  456 + onClick: userConfig.onClick || defaultOnClick, // 回调函数调用.
  457 + showKeys: userConfig.showKeys, // 是否显示在工具提示中的钥匙.
  458 + transitionTime: userConfig.transitionTime || 1500, // 过渡到开始和完成的时间.
  459 + valueKeyName: userConfig.valueKeyName, // 设置工具提示自定义键
  460 + bxrcgs : userConfig.bxrcgs
  461 + };
  462 + // 是否开启提示框 ,默认开启。
  463 + if (this.configuration.showTooltips === undefined)
  464 + this.configuration.showTooltips = true;
  465 + // 是否显示键 ,默认显示。
  466 + if (this.configuration.showKeys === undefined)
  467 + this.configuration.showKeys = true;
  468 + // 是否显示值,默认显示。
  469 + if (this.configuration.keyValueName === undefined)
  470 + this.configuration.keyValueName = 'value';
  471 +
  472 + this.measurementDiv = document.createElement('div');
  473 +
  474 + this.measurementDiv.className = 'relationshipGraph-measurement';
  475 +
  476 + document.body.appendChild(this.measurementDiv);
  477 +
  478 + this.measuredCache = {};
  479 +
  480 + this.representation = [];
  481 +
  482 + this._spacing = 1;
  483 +
  484 + this._d3V4 = !!this.configuration.selection._groups;
  485 +
  486 + if (this.configuration.showTooltips) {
  487 + this.tooltip = createTooltip(this);
  488 + this.tooltip.direction('n');
  489 + } else {
  490 + this.tooltip = null;
  491 + }
  492 +
  493 + this.svg = this.configuration.selection.select('svg').select('g');
  494 + if (this.svg.empty()) {
  495 + // 创建SVG元素将包含图
  496 + this.svg = this.configuration.selection.append('svg').attr("class", "svg-chart")
  497 + .attr('width',this.configuration.width + this.configuration.widtMargin)
  498 + .attr('height', this.configuration.height + this.configuration.heightMargin)
  499 + .attr('style', 'display: block')
  500 + .append('g').attr("class", "gantt-chart");
  501 +
  502 + // 创建时间线性区域
  503 + var x = d3.time
  504 + .scale()
  505 + .domain([ this.configuration.timeDomainStart, this.configuration.timeDomainEnd ])
  506 + .range([ 0, this.configuration.width])
  507 + .clamp(true),
  508 + // 创建Y线性区域
  509 + y = d3.scale
  510 + .ordinal()
  511 + .domain(this.configuration.lpNoA)
  512 + .rangeRoundBands([ 0, this.configuration.height], .1);
  513 +
  514 + this.configuration.y = y;
  515 + // 创建X轴
  516 + var xAxis = d3.svg
  517 + .axis()
  518 + .scale(x)
  519 + .orient("top")
  520 + .ticks(this.configuration.hours)
  521 + .tickFormat(d3.time.format(this.configuration.tickFormat))
  522 + .tickSubdivide(true)
  523 + .tickSize(8)
  524 + .tickPadding(8)
  525 + .innerTickSize(-(this.configuration.height)),
  526 + // 创建Y轴
  527 + yAxis = d3.svg
  528 + .axis()
  529 + .scale(y)
  530 + .orient("left")
  531 + .tickSize(0),
  532 + // 创建上行发车时间刻度尺轴
  533 + upxAxis = d3.svg
  534 + .axis()
  535 + .scale(x)
  536 + .orient("top")
  537 + .ticks(this.configuration.hours)
  538 + .tickFormat(d3.time.format(this.configuration.tickFormat))
  539 + .tickSubdivide(true)
  540 + .tickSize(30).tickPadding(3),
  541 + // 创建下行发车时间刻度尺轴
  542 + downxAxis = d3.svg
  543 + .axis()
  544 + .scale(x)
  545 + .orient("top")
  546 + .ticks(this.configuration.hours)
  547 + .tickFormat(d3.time.format(this.configuration.tickFormat))
  548 + .tickSubdivide(true)
  549 + .tickSize(30).tickPadding(3);
  550 + // 添加X轴
  551 + this.svg
  552 + .append("g")
  553 + .attr("class", "x axis")
  554 + .attr("transform", "translate(" + this.configuration.offsetX + ", " + this.configuration.offsetY + ")")
  555 + .transition()
  556 + .call(xAxis);
  557 + // 添加Y轴
  558 + this.svg
  559 + .append("g")
  560 + .attr("class", "y axis")
  561 + .attr("transform", "translate(" + this.configuration.offsetX + ", " + this.configuration.offsetY + ")")
  562 + .transition().call(yAxis);
  563 + // 添加上行发车时间刻度尺
  564 + this.svg
  565 + .append("g")
  566 + .attr("class", "up")
  567 + .attr("transform", "translate(" + this.configuration.offsetX + ", " + (this.configuration.offsetY - this.configuration.upDy) + ")")
  568 + .transition().call(upxAxis);
  569 + // 添加下行发车时间刻度尺
  570 + this.svg
  571 + .append("g")
  572 + .attr("class", "down")
  573 + .attr("transform", "translate(" + this.configuration.offsetX + ", " + (this.configuration.offsetY - this.configuration.downDy) + ")")
  574 + .transition().call(downxAxis);
  575 + this.svg
  576 + .append("g")
  577 + .attr("class", "shift");
  578 + var $_UP = d3.select('g.up')
  579 + .append('g')
  580 + .attr('class','tick')
  581 + .attr('transform','translate(0,0)')
  582 + .style('opacity',1),
  583 + $_DOWN = d3.select('g.down')
  584 + .append('g')
  585 + .attr('class','tick')
  586 + .attr('transform','translate(0,0)')
  587 + .style('opacity',1)
  588 + $_UP.append('line').attr('x2',0).attr('y2',0);
  589 + $_UP.append('text').attr('x',-10).attr('dy','.32em').attr('y',0).style('text-anchor','end').text('上行发车时刻');
  590 + $_DOWN.append('line').attr('x2',0).attr('y2',0);
  591 + $_DOWN.append('text').attr('x',-10).attr('dy','.32em').attr('y',0).style('text-anchor','end').text('下行发车时刻');
  592 + this.addListenerMouseEvent();
  593 + this.createStatistics();
  594 + // 清空数组
  595 + if(yAxisYArray.length>0)
  596 + yAxisYArray.splice(0,yAxisYArray.length);
  597 + for(var t = 0;t<this.configuration.taskTypes.length;t++) {
  598 + yAxisYArray.push({
  599 + y:y(this.configuration.taskTypes[t].lpNo)+this.configuration.offsetY,
  600 + carname:this.configuration.taskTypes[t].lpName,
  601 + lpA : this.configuration.taskTypes[t]});
  602 + }
  603 + }
  604 + this.graph = this;
  605 + }
  606 + _createClass(RelationshipGraph, [{
  607 + key: 'data',
  608 + value: function data(json) {
  609 + if (RelationshipGraph.verifyJson(json)) {
  610 + /** 上、下行JSON数组 */
  611 + var upArray = new Array(),downArray = new Array();
  612 + for(var j = 0 ; j< json.length ; j++) {
  613 + if(json[j].bcType=='normal' || json[j].bcType=='region') {
  614 + if(json[j].xlDir == 'relationshipGraph-up')
  615 + upArray.push(json[j]);
  616 + else if(json[j].xlDir == 'relationshipGraph-down')
  617 + downArray.push(json[j])
  618 + }
  619 + }
  620 + this.removeNodes(d3.selectAll('g.up_tick')[0]);
  621 + this.removeNodes(d3.selectAll('g.down_tick')[0]);
  622 + this.removeNodes($('g.shift').children());
  623 + var upNodes = this.configuration.selection.select('svg').select('g.up').selectAll('.up_tick').data(upArray),
  624 + downNodes = this.configuration.selection.select('svg').select('g.down').selectAll('.down_tick').data(downArray),
  625 + nodes = this.configuration.selection.select('svg').select('g.shift').selectAll('.data').data(json);
  626 + // 绘制上行发车时刻
  627 + this.createUpTime(upNodes);
  628 + // 绘制下行发车时刻
  629 + this.createDownTime(downNodes);
  630 + // 绘制班次
  631 + this.createClasses(nodes);
  632 + // 绘制统计值
  633 + this.statistics();
  634 + if (this.configuration.showTooltips) {
  635 + d3.select('.d3-tip').remove();
  636 + this.svg.call(this.tooltip);
  637 + }
  638 + }
  639 + return this;
  640 + }
  641 + }, {
  642 + key : 'createUpTime',
  643 + value : function createUpTime(upNodes) {
  644 + var _this = this;
  645 + var $g_tick = upNodes.enter().append('g').attr('class','up_tick')
  646 + .attr('transform', function (obj) {
  647 + var hourMinue = obj.fcsj.split(":");
  648 + var rectX = (parseInt(hourMinue[0])-_this.configuration.dxHours )*60*_this.configuration.multiple +
  649 + parseInt(hourMinue[1])*_this.configuration.multiple;
  650 + return 'translate(' + rectX + ',0)';
  651 + });
  652 + $g_tick.append('line').attr('y2',-5).attr('x2',0);
  653 + $g_tick.append('text').attr('y',-10).attr('dy','0em').attr('x',0).style('text-anchor','middle')
  654 + .text(function(obj) {
  655 + var hourMinue = obj.fcsj.split(":");
  656 + return hourMinue[1];
  657 + });
  658 + }
  659 + }, {
  660 + key : 'createDownTime',
  661 + value: function createDownTime(downNodes) {
  662 + var _this = this;
  663 + var $g_tick = downNodes.enter().append('g').attr('class','down_tick')
  664 + .attr('transform', function (obj) {
  665 + var hourMinue = obj.fcsj.split(":");
  666 + var rectX = (parseInt(hourMinue[0])-_this.configuration.dxHours )*60*_this.configuration.multiple + parseInt(hourMinue[1])*_this.configuration.multiple;
  667 + return 'translate(' + rectX + ',0)';
  668 + });
  669 + $g_tick.append('line').attr('y2',-5).attr('x2',0);
  670 + $g_tick.append('text').attr('y',-10).attr('dy','0em').attr('x',0).style('text-anchor','middle')
  671 + .text(function(obj) {
  672 + var hourMinue = obj.fcsj.split(":");
  673 + return hourMinue[1];
  674 + });
  675 +
  676 + }
  677 + }, {
  678 + key: 'setBxTagType',
  679 + value : function setBxTagType(node) {
  680 +
  681 + }
  682 +
  683 + }, {
  684 + /**
  685 + * @description : (TODO) 创建rect、text(班次对象、班次属性值)元素对象
  686 + *
  687 + * @param {Object} Elements
  688 + *
  689 + * @status : OK.
  690 + */
  691 + key: 'createClasses',
  692 + value: function createClasses(childrenNodes) {
  693 + // 把当前对象赋值给_this.
  694 + var _this = this;
  695 + // 添加底层rect元素(班次)对象.
  696 + childrenNodes.enter().append('rect').attr('id',RelationshipGraph.setIdValue) // 设值id
  697 + .attr('x',RelationshipGraph.setXValue) // 设值x坐标
  698 + .attr('y',RelationshipGraph.setYValue) // 设值y坐标.
  699 + .attr('class',RelationshipGraph.setRectClassV)// 设值class
  700 + .attr('width',RelationshipGraph.setRectWidthV) // 设值宽度
  701 + .attr('height',RelationshipGraph.setRectHeight)// 设值高度
  702 + .attr('parent-node',RelationshipGraph.setRectParenNodeIdV)// 设值父元素id
  703 + .attr('next-node',RelationshipGraph.setNextNodeIdV)// 设值下个元素的id
  704 + .attr('last-node',RelationshipGraph.setLastNodeIdV)// 设值上个元素的id
  705 + .attr('rect-type',RelationshipGraph.setNodeType('shift')); // 设值元素类型
  706 + // 添加第一行text元素(班次属性值[发车时间~到站时间])对象.
  707 + childrenNodes.enter().append('text').attr('id',RelationshipGraph.setText01IdV) //设值id.
  708 + .attr('x',RelationshipGraph.setXValue) // 设值x坐标.
  709 + .attr('y',RelationshipGraph.setYValue) // 设值y.
  710 + .attr('dx',RelationshipGraph.setTextDxV(5)) // 设值x方向偏移量.
  711 + .attr('dy',RelationshipGraph.setTextDyV(18))// 设值y方向偏移量.
  712 + .attr('class',RelationshipGraph.setTextClassV) //设值class.
  713 + .text(RelationshipGraph.setText01text)// 设值text文本
  714 + .attr('parent-node',RelationshipGraph.setIdValue)// 设置父元素id
  715 + .attr('text-type',RelationshipGraph.setNodeType('timeslot'));// 设值元素类型.
  716 + // 添加第二行text元素(班次属性值[行驶时间])对象.
  717 + childrenNodes.enter().append('text').attr('id',RelationshipGraph.setText02IdV)// 设值id.
  718 + .attr('x',RelationshipGraph.setXValue)// 设值x.
  719 + .attr('y',RelationshipGraph.setYValue)// 设值y.
  720 + .attr('dx',RelationshipGraph.setTextDxV(5))// 设值x方向偏移量.
  721 + .attr('dy',RelationshipGraph.setTextDyV(36))// 设值y方向偏移量.
  722 + .attr('class',RelationshipGraph.setTextClassV) // 设值class.
  723 + .text(RelationshipGraph.setText02text)// 设值text文本.
  724 + .attr('parent-node',RelationshipGraph.setIdValue)// 设值父元素id
  725 + .attr('text-type', RelationshipGraph.setNodeType('travel'));// 设置元素类型.
  726 + // 添加第三行text元素(班次属性值[停息时间])对象.
  727 + childrenNodes.enter().append('text').attr('id',RelationshipGraph.setText03IdV)// 设值id.
  728 + .attr('x',RelationshipGraph.setXValue)// 设值x
  729 + .attr('y',RelationshipGraph.setYValue)// 设值y
  730 + .attr('dx',RelationshipGraph.setTextDxV(5))// 设值x方向偏移量.
  731 + .attr('dy',RelationshipGraph.setTextDyV(54))// 设值y方向偏移量.
  732 + .attr('class',RelationshipGraph.setTextClassV)// 设值class.
  733 + .text(RelationshipGraph.setText03text)// 设值text文本.
  734 + .attr('parent-node',RelationshipGraph.setIdValue)// 设值父元素id.
  735 + .attr('text-type',RelationshipGraph.setNodeType('gap'));// 设值元素类型.
  736 + // 添加底层rect元素上的圆.
  737 + childrenNodes.enter().append('circle').attr('id',RelationshipGraph.setCircleIdV)// 设值id.
  738 + .attr('cx',RelationshipGraph.setCirclecxV)// 设值cx.
  739 + .attr('cy',RelationshipGraph.setCirclecyV)// 设值cy.
  740 + .attr('r',RelationshipGraph.setCircleRV)// 设值半径r.
  741 + .attr('class',RelationshipGraph.setCircleClass)// 设值class.
  742 + .attr('parent-node',RelationshipGraph.setIdValue);// 设值父元素id.
  743 + // 添加圆里的text元素(班次类型值)对象
  744 + childrenNodes.enter().append('text').attr('id',RelationshipGraph.setText04IdV)// 设值id.
  745 + .attr('x',RelationshipGraph.setText04XV)// 设值x.
  746 + .attr('y',RelationshipGraph.setText04YV)// 设值y.
  747 + .attr('class',RelationshipGraph.setText04ClassV)// 设值class
  748 + .text(RelationshipGraph.setText04text)//设值text文本.
  749 + .attr('parent-node', RelationshipGraph.setIdValue)// 设值父元素id.
  750 + .attr('text-type',RelationshipGraph.setNodeType('bcType'));// 设值元素类型.
  751 + // 添加底层rect元素的rect对象(覆盖层). 添加覆盖层是为了对拖拽事件的响应.
  752 + childrenNodes.enter().append('rect').attr('id',RelationshipGraph.setCoverRectIdV)// 设值id.
  753 + .attr('x',RelationshipGraph.setXValue)// 设值x.
  754 + .attr('y',RelationshipGraph.setYValue)// 设值y.
  755 + .attr('class',RelationshipGraph.setCoverRectClassV('rect-cover'))// 设值class.
  756 + .attr('width',RelationshipGraph.setRectWidthV)// 设值宽度.
  757 + .attr('height',RelationshipGraph.setRectHeight)// 设值高度.
  758 + .attr('parent-node',RelationshipGraph.setCoverRectParentV)// 设值父元素id.
  759 + .attr('rect-type',RelationshipGraph.setNodeType('cover'))// 设值元素类型.
  760 + .attr('next-node',RelationshipGraph.setCoverRectLastIdV)// 设值下个元素id.
  761 + .on('mouseover', _this.tooltip ? _this.tooltip.show : RelationshipGraph.noop)// 监听鼠标移入事件.
  762 + .on('mouseout', _this.tooltip ? _this.tooltip.hide : RelationshipGraph.noop)// 监听鼠标移出事件.
  763 + .on('mousedown', function (obj) {
  764 + _this.tooltip.hide();
  765 + _this.configuration.onClick.child(obj);
  766 + // 这里很关键.移除鼠标右击时做拖拽事件.决定了鼠标右击时只做左菜单.
  767 + if(window.event.which==3)
  768 + context.setisContext(true);
  769 + }).call(d3.behavior.drag()
  770 + .on("dragstart", RelationshipGraph.singleElementDrawStart) // 监听单个rect元素拖拽开始事件
  771 + .on("drag",RelationshipGraph.singleElementDrawRuing)// 监听单个rect元素拖拽中事件.
  772 + .on("dragend",RelationshipGraph.singleElementDrawStop));// 监听单个rect元素拖拽结束事件.
  773 + }
  774 + }, {
  775 + key: 'removeNodes',
  776 + value: function removeNodes(nodes) {
  777 + for(var n = 0 ;n<nodes.length;n++) {
  778 + $(nodes[n]).remove();
  779 + }
  780 + }
  781 + }, {
  782 + key : 'getSvgyAxisTransformY',
  783 + value : function getSvgyAxisTransformY() {
  784 + var listChildrNodes = $(".y").children(".tick");
  785 + var len_node = listChildrNodes.length;
  786 + var y_array = new Array();
  787 + for(var n = 0;n<len_node;n++) {
  788 + var transform = $(listChildrNodes[n]).attr("transform");
  789 + var t_value = transform.substring(transform.indexOf("(")+1 ,transform.lastIndexOf(")") ).split(",");
  790 + y_array.push(parseInt(t_value[1]));
  791 + }
  792 + return y_array;
  793 + }
  794 + }, {
  795 + key : 'getDataArray',
  796 + value : function getDataArray() {
  797 + var nodes = d3.selectAll('rect.data')[0],dataArray = new Array();
  798 + for(var i = 0 ; i<nodes.length;i++) {
  799 + dataArray.push(d3.select(nodes[i]).data()[0]);
  800 + }
  801 + return dataArray;
  802 + }
  803 + }, {
  804 + key : 'addHistory' ,
  805 + value : function addHistory() {
  806 + historyArray.push({'data':JSON.stringify(this.getDataArray()),'granph':JSON.stringify(this.configuration)});
  807 + $_keyIndex++;
  808 + }
  809 + }, {
  810 + key : 'statistics',
  811 + value : function statistics() {
  812 + var $_this = this,
  813 + array = $_this.getSvgyAxisTransformY(),
  814 + gdata = d3.selectAll('rect.data')[0],
  815 + arrayTemp = new Array(),
  816 + minValue = 0,timeNum;
  817 + for(var a=0;a<array.length;a++) {
  818 + var tempNum = 0,timeNum = 0,lpNo = '';
  819 + for(var g = 0 ; g <gdata.length;g++) {
  820 + var temp_i = parseInt(d3.select(gdata[g]).attr('y'))-this.configuration.offsetY;
  821 + if(temp_i<array[a] && temp_i>minValue) {
  822 + var parentNodeCName = d3.select(gdata[g]).attr('id'),
  823 + // nodes = d3.selectAll('text[parent-node='+ parentNodeCName +']')[0]
  824 + $_d = d3.select(gdata[g]).data()[0];
  825 + lpNo = $_d.lpNo;
  826 + timeNum = timeNum + parseInt($_d.STOPTIME) + parseInt($_d.bcsj);
  827 + if($_d.bcType!='bd' && $_d.bcType!='lc' && $_d.bcType!='cf' && $_d.bcsj>0)
  828 + tempNum++;
  829 + }
  830 + }
  831 + minValue = array[a];
  832 + var className = 'statis_container_' + array[a];
  833 + var textNodes = $("."+className).children("text");
  834 + /*var hours = parseInt(timeNum/60);
  835 + var mimus = timeNum%60,zgs = hours + (mimus==0? "": "." + mimus);*/
  836 + var zgs = parseFloat((timeNum/60).toFixed(2));
  837 + $(textNodes[0]).text("总工时:" + zgs);
  838 + $(textNodes[1]).text("总班次:"+(tempNum));
  839 + $_this.pptjbx($("."+className).children("rect")[2],zgs*1,lpNo,$_this);
  840 + }
  841 + }
  842 +
  843 + }, {
  844 +
  845 + }, {
  846 + key : 'pptjbx',
  847 + value : function pptjbx(node,gs,lpNo,$_this) {
  848 + if($_this.configuration.bxrcgs!=null) {
  849 + for(var t = 0 ; t<$_this.configuration.bxrcgs.length;t++) {
  850 + if($_this.configuration.bxrcgs[t].lpNo == lpNo)
  851 + d3.select(node).data()[0].tjbx = $_this.configuration.bxrcgs[t].type;
  852 + }
  853 + }else {
  854 + workeType.sort(function(a,b){return b.hourV-a.hourV});
  855 + var zhHoursA = new Array();
  856 + if(gs>(workeType[0].hourV+1)) {
  857 + for(var k = 0 ; k<workeType.length;k++) {
  858 + var kHourV = workeType[k].hourV;
  859 + for(var a = k ; a<workeType.length;a++) {
  860 + var aHourV = workeType[a].hourV;
  861 + var dx = Math.abs(parseInt(kHourV + aHourV - gs));
  862 + zhHoursA.push({'bx1': workeType[k].type,'bx2': '</br></br>' + workeType[a].type,'countGs':dx});
  863 + }
  864 + }
  865 + }else {
  866 + for(var b = 0 ; b<workeType.length;b++) {
  867 + zhHoursA.push({'bx1': workeType[b].type,'bx2':'','countGs':Math.abs(parseInt(workeType[b].hourV - gs))});
  868 + }
  869 + }
  870 + zhHoursA.sort(function(a,b){return a.countGs-b.countGs});
  871 + d3.select(node).data()[0].tjbx = zhHoursA[0].bx1 + zhHoursA[0].bx2;
  872 + }
  873 + /*if(gs>16) {
  874 + d3.select(node).data()[0].tjbx = 'zyxy';
  875 + } else {
  876 + var bclx = 'wz';
  877 + for(var g = 0 ; g<workeType.length;g++) {
  878 + if((gs<workeType[g].value && gs>workeType[g].value-10) || (gs<workeType[g].value*2 && gs>workeType[g].value2* -10)){
  879 + bclx = workeType[g].type;
  880 + break;
  881 + }
  882 + }
  883 + d3.select(node).data()[0].tjbx = bclx;
  884 + }*/
  885 + }
  886 + }, {
  887 + key : 'createStatistics',
  888 + value : function createStatistics() {
  889 + var svg = d3.select('.gantt-chart'),
  890 + _this = this,
  891 + array = _this.getSvgyAxisTransformY();
  892 + var g_statis = svg.selectAll('.g_statis').data([1]).enter().append('g').classed({'g_statis':true}).attr("transform", "translate(" + _this.configuration.offsetX + ", " + _this.configuration.offsetY + ")");
  893 + for(var c = 0 ;c<array.length;c++) {
  894 + var className = 'statis_container_' + array[c];
  895 + var statis_container = g_statis.append('g').attr("class",className).attr("transform", "translate(" + 0 + ", " + array[c] + ")");
  896 + statis_container.append('rect').classed({'rect_shift':true})
  897 + .attr("x",-_this.configuration.offsetX)
  898 + .attr("y",9)
  899 + .attr("rx",5)
  900 + .attr("ry",5)
  901 + .attr("width",_this.configuration.offsetX)
  902 + .attr("height",20);
  903 + statis_container.append('rect').classed({'rect_Whours':true})
  904 + .attr("x",-_this.configuration.offsetX)
  905 + .attr("y",32)
  906 + .attr("rx",5)
  907 + .attr("ry",5)
  908 + .attr("width",_this.configuration.offsetX)
  909 + .attr("height",20);
  910 + statis_container.append("text")
  911 + .attr("class","statis_text")
  912 + .attr("x",-_this.configuration.offsetX)
  913 + .attr("y",9)
  914 + .attr('dx',15)
  915 + .attr('dy',15)
  916 + .text("总工时:");
  917 + statis_container.append("text")
  918 + .attr("class","statis_text")
  919 + .attr("x",-_this.configuration.offsetX)
  920 + .attr("y",32)
  921 + .attr('dx',15)
  922 + .attr('dy',15)
  923 + .text("总班次:");
  924 + statis_container.append('rect').data([{'tjbx':'未知','bcType':'tjz'}]).classed({'rect-cover-statis':true})
  925 + .attr("x",-_this.configuration.offsetX)
  926 + .attr("y",8)
  927 + .attr("rx",5)
  928 + .attr("ry",5)
  929 + .attr("width",_this.configuration.offsetX)
  930 + .attr("height",20)
  931 + .on('mouseover', _this.tooltip ? _this.tooltip.show : RelationshipGraph.noop)
  932 + .on('mouseout', _this.tooltip ? _this.tooltip.hide : RelationshipGraph.noop);
  933 + statis_container.append('rect').data([{'bcType':'tjz'}]).classed({'rect-cover-statis':true})
  934 + .attr("x",-_this.configuration.offsetX)
  935 + .attr("y",32)
  936 + .attr("rx",5)
  937 + .attr("ry",5)
  938 + .attr("width",_this.configuration.offsetX)
  939 + .attr("height",20);
  940 + }
  941 + }
  942 +
  943 + }, {
  944 + /**
  945 + * @description : (TODO) 添加鼠标监听事件.
  946 + *
  947 + * ^^^^^^^^^^^^^^^^^^^^^
  948 + * 此事件做绘制选中班次框.
  949 + *
  950 + **/
  951 + key: 'addListenerMouseEvent',
  952 + value : function addListenerMouseEvent() {
  953 + // 1、 控制鼠标操作从 按下(300ms开始,并且按下时不能移动鼠标,打开开关) ---> 移动(画选择框) ---> 松开(关闭开关) 过程.
  954 + var flag = false,stop;
  955 + // 2、获取DIV ID为 [ganttSvg] svg容器.
  956 + var svg = d3.select("#ganttSvg");
  957 + // 3、给svg容器元素对象 添加鼠标按下事件.
  958 + svg.on('mousedown',function(e){
  959 + // 3.1、如果开关没打开,或者已存在选择框对象,或者从rect元素(班次)对象上按下时,提前结束鼠标操作过程.
  960 + if(flag || RelationshipGraph.getFlagIndex()>0 || d3.event.target.nodeName =='rect')
  961 + return false;
  962 + // 3.2、定义鼠标按下的x、y坐标 .
  963 + var d3MouseDown_x = parseInt(d3.mouse(this)[0]),d3MouseDown_y = parseInt(d3.mouse(this)[1]);
  964 + // 3.3、计时鼠标是否按下已有300ms,并且在300ms中鼠标未曾移动,则打开开关,进入鼠标操作过程.
  965 + stop = setTimeout(function(e) {
  966 + // 3.4、打开鼠标移动和松开事件开关.
  967 + flag = true;
  968 + // 3.5、记录当前选择框数 .
  969 + RelationshipGraph.setFlagIndex(1);
  970 + // 3.6、创建选择框 .
  971 + var container_g = d3.selectAll(".gantt-chart").selectAll('.case_g').data([1]).enter().append('g').classed({'case_g':true});
  972 + // 3.7、给选择框添加class为case_rect caseactive 元素.
  973 + container_g.append('rect').data([{'bcType':'tjz'}]).classed({'case_rect caseactive':true})
  974 + .attr('id', 'case_rectId')
  975 + .attr('x', d3MouseDown_x)
  976 + .attr('y', d3MouseDown_y)
  977 + .attr('rect-type', function (obj) {
  978 + return 'case';
  979 + }).call(d3.behavior.drag()
  980 + .on("dragstart",RelationshipGraph.regionDrawStart) // 3.7.1 给选择框添加沿X轴开始拖拽事件.
  981 + .on("drag",RelationshipGraph.regionDrawRuing) // 3.7.2 给选择框添加沿X轴拖拽中事件.
  982 + .on("dragend",RelationshipGraph.regionDrawStop));// 3.7.3 给选择框添加沿X轴拖拽结束事件.
  983 + // 3.8 打开小tips提示层.
  984 + layer.tips('鼠标绘制工具已打开,从此处位置开始绘制选中框来进行选中班次。', '.case_rect', {
  985 + tips: [1, '#3595CC'],
  986 + time: 4000
  987 + });
  988 + },200);
  989 + // 4、给svg容器元素对象 添加鼠标移动事件 . 这里等同于绘制选择框.
  990 + }).on('mousemove',function(e){
  991 + // 4.1 判断开关是否打开状态.
  992 + if(flag) {
  993 + // 4.1.1、定义鼠标移动的x、y坐标.
  994 + var d3MouseMove_x = parseInt(d3.mouse(this)[0]),d3MouseMove_y = parseInt(d3.mouse(this)[1]);
  995 + // 4.1.2、获取class 为case_rect 的元素起始x、y坐标点.
  996 + var mdX = parseInt($("rect.case_rect").attr("x")),mdY = parseInt($("rect.case_rect").attr("y"));
  997 + // 4.1.3、根据两点之间计算高和宽,并给class为case_rect元素设置高和宽的属性值.
  998 + svg.selectAll('rect.case_rect').attr("width", Math.abs(d3MouseMove_x - mdX)).attr("height", Math.abs(d3MouseMove_y - mdY));
  999 + }else {
  1000 + // 4.2 清楚定时器.
  1001 + clearTimeout(stop);
  1002 + }
  1003 + // 5、 给svg容器元素对象 添加鼠标松开事件.
  1004 + }).on('mouseup',function(e){
  1005 + if(flag) {
  1006 + layer.closeAll();// 关闭弹出层.
  1007 + RelationshipGraph.mouseUpEvent(flag);
  1008 + flag = false;
  1009 + } else {
  1010 + clearTimeout(stop);
  1011 + }
  1012 + // 6、给svg容器元素对象 添加鼠标移出事件.解决鼠标在其他元素上松开而不关闭开关问题.只有在绑定 mouseleave 事件的元素上,将鼠标移出时,才会触发该事件。
  1013 + }).on('mouseleave',function() {
  1014 + if(flag) {
  1015 + layer.closeAll();// 关闭弹出层.
  1016 + RelationshipGraph.mouseUpEvent(flag);
  1017 + flag = false;
  1018 + } else {
  1019 + clearTimeout(stop);
  1020 + }
  1021 + });
  1022 + }
  1023 + }], [{
  1024 + key: 'contains',
  1025 + value: function contains(arr, key) {
  1026 + return arr.indexOf(key) > -1;
  1027 + }
  1028 + }, {
  1029 + /**
  1030 + * @description : (TODO) 获取鼠标绘制的当前选择框标识(这里限制只做一次性选择元素拖拽,在绘制选择框时)
  1031 + *
  1032 + * @return 返回一个数值. 鼠标绘制的当前选择框标识(这里限制只做一次性选择元素拖拽,在绘制选择框时)
  1033 + * */
  1034 + key : 'getFlagIndex',
  1035 + value : function getFlagIndex() {
  1036 + return flagIndex;
  1037 + }
  1038 +
  1039 + }, {
  1040 + /**
  1041 + * @description : (TODO) 设值鼠标绘制的当前选择框标识(这里限制只做一次性选择元素拖拽,在绘制选择框时).
  1042 + *
  1043 + * @param [v--数值]
  1044 + * */
  1045 + key : 'setFlagIndex',
  1046 + value: function setFlagIndex(v) {
  1047 + flagIndex = v;
  1048 + }
  1049 + }, {
  1050 + /**
  1051 + * @description : (TODO) 关闭选择框按钮事件.
  1052 + *
  1053 + * @status OK.
  1054 + * */
  1055 + key : 'gClose',
  1056 + value : function gClose() {
  1057 + $("g.case_g").remove();
  1058 + RelationshipGraph.setFlagIndex(0);
  1059 + gClassNameArray = [];
  1060 + d3.selectAll('.caseactive').classed({'caseactive':false});
  1061 + }
  1062 + }, {
  1063 + /**
  1064 + * @description : (TODO) 添加班次事件.
  1065 + *
  1066 + * @status OK.
  1067 + * */
  1068 + key : 'reladplus',
  1069 + value : function reladplus() {
  1070 + // 弹出层mobal页面
  1071 + $.get('/pages/base/timesmodel/reladplus.html', function(m){
  1072 + $(pjaxContainer).append(m);
  1073 + // 规定被选元素要触发的事件。可以使自定义事件(使用 bind() 函数来附加),或者任何标准事件。
  1074 + $('#reladplus_mobal').trigger('reladplusMobal.show',[$_GlobalGraph,BaseFun,yAxisYArray]);
  1075 + });
  1076 + }
  1077 + }, {
  1078 + /**
  1079 + * @description : (TODO) 添加路牌.
  1080 + *
  1081 + * @status OK.
  1082 + * */
  1083 + key : 'addlp',
  1084 + value : function addlp() {
  1085 + // 获取初始路牌总数.
  1086 + var len = $_GlobalGraph.configuration.taskTypes.length;
  1087 + // 添加路牌.
  1088 + $_GlobalGraph.configuration.taskTypes.push({'lp':null,'lpName':len+1,'lpNo':len+1,'lpType':'普通路牌'});
  1089 + // 添加路牌编码
  1090 + $_GlobalGraph.configuration.lpNoA.push(len+1);
  1091 + // 修改图形高度
  1092 + $_GlobalGraph.configuration.height = $_GlobalGraph.configuration.lpNoA.length*60 + 240;
  1093 + // 修改初始化图形时间轴开始时间
  1094 + $_GlobalGraph.configuration.timeDomainStart=new Date($_GlobalGraph.configuration.startStr);
  1095 + // 修改初始化图形时间轴结束时间
  1096 + $_GlobalGraph.configuration.timeDomainEnd=new Date($_GlobalGraph.configuration.endStr);
  1097 + // 获取数据.
  1098 + var data_ = $_GlobalGraph.getDataArray();
  1099 + // 删除图形.
  1100 + $('svg.svg-chart').remove();
  1101 + // 重新创建图形.
  1102 + var graph_ = d3.select('#ganttSvg').relationshipGraph($_GlobalGraph.configuration);
  1103 + // 根据数据重新渲染图形.
  1104 + graph_.data(data_);
  1105 + $_GlobalGraph = graph_;
  1106 + // 记录当前操作.
  1107 + graph_.addHistory();
  1108 + // 弹出提示消息
  1109 + layer.msg('操作成功!已添路牌【'+ (len+1) +'】!');
  1110 + }
  1111 +
  1112 + }, {
  1113 + key : 'testFcno',
  1114 + value : function testFcno(arr) {
  1115 + for(var r = 0 ; r<arr.length;r++) {
  1116 + console.log(arr[r].fcno);
  1117 + }
  1118 + }
  1119 + }, {
  1120 + key : 'updownread',
  1121 + value : function updownread() {
  1122 + //var index = layer.load(1, {shade: [0.1,'#fff'] });//0.1透明度的白色背景
  1123 + // 1、获取所有班次数.
  1124 + var list = $_GlobalGraph.getDataArray();
  1125 + console.log(list.length);
  1126 + // 2、获取方向代码.
  1127 + var upDir = $_GlobalGraph.configuration.dataMap.dira[0],// 2.1 上行方向.
  1128 + downDir = $_GlobalGraph.configuration.dataMap.dira[1];// 2.2 下行方向.
  1129 + // 3、获取周转时间.
  1130 + var zzsj = $_GlobalGraph.configuration.stopAraay[0].zzsj;
  1131 + // 4、根据方向,归类班次.[上行班次;下行班次;其他班次(早晚例保、进出场、吃饭时间)].
  1132 + var tempa = BaseFun.getDirBc(list,$_GlobalGraph.configuration.dataMap.dira);
  1133 + console.log(tempa);
  1134 + //console.log(tempa.upArr.concat(tempa.downArr).length);
  1135 + // 5、均匀上行班次的发车间距.
  1136 + var sxbc = BaseFun.jhfcjx(tempa.upArr,upDir,zzsj,$_GlobalGraph.configuration.dataMap);
  1137 + console.log('getDirBc---- '+tempa.downArr.length);
  1138 + // 6、均匀下行班次的发车间距.
  1139 + var xxbc = BaseFun.jhfcjx(tempa.downArr,downDir,zzsj,$_GlobalGraph.configuration.dataMap);
  1140 + console.log('jhfcjx---'+ xxbc.length);
  1141 + //console.log(sxbc.concat(xxbc).length);
  1142 + // $_GlobalGraph.data(sxbc);
  1143 + // console.log($_GlobalGraph.configuration);
  1144 + var rsData = BaseFun.tztzsj01(sxbc.concat(xxbc),$_GlobalGraph.configuration.lpNoA,$_GlobalGraph.configuration.dataMap);
  1145 +
  1146 + var jar = BaseFun.tzsmbcsj(BaseFun.setbcsAndfcno(rsData),$_GlobalGraph.configuration.dataMap.smbcsjArr,
  1147 + $_GlobalGraph.configuration.dataMap.ccsjArr,
  1148 + $_GlobalGraph.configuration.dataMap.cclcArr,
  1149 + $_GlobalGraph.configuration.dataMap.qdzArr,
  1150 + $_GlobalGraph.configuration.stopAraay[0].lbsj);
  1151 +
  1152 + // 删除图形.
  1153 + $('svg.svg-chart').remove();
  1154 + // 重新创建图形.
  1155 + var graph_ = d3.select('#ganttSvg').relationshipGraph($_GlobalGraph.configuration);
  1156 + // 根据数据重新渲染图形.
  1157 + graph_.data(jar);
  1158 + $_GlobalGraph = graph_;
  1159 + // $_GlobalGraph.data(rsData);
  1160 + /*BaseFun.tztzsj(jar,$_GlobalGraph.configuration.lpNoA,$_GlobalGraph.configuration.dataMap);*/
  1161 + /*var resultJA = new Array();
  1162 + for(var m = 0 ; m < $_GlobalGraph.configuration.taskTypes.length; m++) {
  1163 + // 获取路牌编号.
  1164 + var lpNo_ = $_GlobalGraph.configuration.taskTypes[m].lpNo;
  1165 + // 定义路牌下的所有班次.
  1166 + var lpbc_ = new Array();
  1167 + // 遍历班次数.
  1168 + for(var j =0 ; j <jar.length; j++) {
  1169 + // 判断当期遍历的班次是否属于当前的路牌.
  1170 + if(jar[j].lpNo == lpNo_)
  1171 + lpbc_.push(jar[j]);
  1172 + }
  1173 + // 按照发车序号顺序排序.
  1174 + lpbc_.sort(function(a,b){return a.fcno-b.fcno});
  1175 + resultJA = resultJA.concat(BaseFun.addjclbbc(lpbc_,
  1176 + $_GlobalGraph.configuration.dataMap,$_GlobalGraph.configuration.stopAraay[0].lbsj,$_GlobalGraph.configuration.dataMap.map));
  1177 + }*/
  1178 +
  1179 + // BaseFun.tztzsj01(xxbc.concat(sxbc),$_GlobalGraph.configuration.lpNoA,$_GlobalGraph.configuration.dataMap)
  1180 + // $_GlobalGraph.data(BaseFun.tztzsj01(jar,$_GlobalGraph.configuration.lpNoA,$_GlobalGraph.configuration.dataMap));
  1181 + // 7、调整停站间隙.
  1182 + // var data = BaseFun.tztzsj(sxbc.concat(xxbc).concat(tempa.qt),$_GlobalGraph.configuration.lpNoA,$_GlobalGraph.configuration.dataMap);
  1183 + // 8、重新给定班次序号和发车序号.再确定首末班车时间.最后渲染数据.
  1184 + /*$_GlobalGraph.data(BaseFun.tzsmbcsj(BaseFun.setbcsAndfcno(data),
  1185 + $_GlobalGraph.configuration.dataMap.smbcsjArr,
  1186 + $_GlobalGraph.configuration.dataMap.ccsjArr,
  1187 + $_GlobalGraph.configuration.dataMap.cclcArr,
  1188 + $_GlobalGraph.configuration.dataMap.qdzArr,
  1189 + $_GlobalGraph.configuration.dataMap.lbsj));*/
  1190 + // 9、记录早操.并保存历史班次数据.
  1191 + // $_GlobalGraph.addHistory();
  1192 + //layer.close(index);
  1193 + }
  1194 + }, {
  1195 + /**
  1196 + * @description : (TODO) 调整班次函数.
  1197 + *
  1198 + * @status OK.
  1199 + * */
  1200 + key : 'aboutread',
  1201 + value : function aboutread() {
  1202 + // 弹出层mobal页面
  1203 + $.get('/pages/base/timesmodel/bctz.html', function(m){
  1204 + $(pjaxContainer).append(m);
  1205 + $('#tzbc_mobal').trigger('tzbcMobal.show',[$_GlobalGraph,getbczs($_GlobalGraph.getDataArray(),yAxisYArray),BaseFun]);
  1206 + });
  1207 + }
  1208 +
  1209 + }, {
  1210 + key : 'checkAdd',
  1211 + value : function checkAdd() {
  1212 + var xl = $_GlobalGraph.configuration.dataMap.map.lineName.split('_');
  1213 + if($_GlobalGraph.configuration.dataMap.map.istidc==1) {
  1214 + layer.confirm('系统已存在-->线路【'+
  1215 + $_GlobalGraph.configuration.dataMap.map.xlmc +'】-->时刻表【'+
  1216 + $_GlobalGraph.configuration.dataMap.map.skbmc +
  1217 + '】明细!是否覆盖!', {
  1218 + btn : [ '确认并提交', '取消' ]
  1219 + },function () {
  1220 + // 关闭所有提示弹出层.
  1221 + layer.closeAll();
  1222 + RelationshipGraph.submit($_GlobalGraph.configuration.dataMap.map.skbName,xl[0]);
  1223 + });
  1224 + }else {
  1225 + RelationshipGraph.submit($_GlobalGraph.configuration.dataMap.map.skbName,xl[0]);
  1226 + }
  1227 + }
  1228 +
  1229 + },{
  1230 + key : 'submit',
  1231 + value : function submit(skb,xl) {
  1232 + // 1、获取所有班次数据.
  1233 + var listA = $_GlobalGraph.getDataArray();
  1234 + // 2、弹出提示层.
  1235 + var index = layer.load(1, {
  1236 + shade: [0.1,'#fff'] // 0.1透明度的白色背景
  1237 + });
  1238 + // 3、post请求保存数据.
  1239 + $post('/tidc/skbDetailMxSave',{'d':JSON.stringify(listA), 'xl':xl, 'skb':skb},function(result) {
  1240 + // 3.1、关闭弹出层.
  1241 + layer.close(index);
  1242 + if(result){
  1243 + if(result.status=='SUCCESS') {
  1244 + layer.msg('保存成功...');// 弹出添加成功提示消息
  1245 + } else if(result.status=='ERROR') {
  1246 + layer.msg('保存失败...');// 弹出添加失败提示消息
  1247 + }
  1248 + }
  1249 + loadPage('index.html');// 返回index.html页面
  1250 + });
  1251 + }
  1252 + }, {
  1253 + /**
  1254 + * @description : (TODO) 撤销函数.
  1255 + *
  1256 + * @status OK.
  1257 + * */
  1258 + key : 'cancel',
  1259 + value : function cancel() {
  1260 + // 关闭弹出层.
  1261 + layer.closeAll();
  1262 + // 判断当对图形操作的步骤.
  1263 + if($_keyIndex==1) {
  1264 + layer.msg('已经是撤回到操作记录的【第一步】了!');
  1265 + return;
  1266 + }
  1267 + // 标记操作下标后退.
  1268 + $_keyIndex--;
  1269 + // 删除图形.
  1270 + $('svg.svg-chart').remove();
  1271 + // 获取撤销到当前操作下标的数据.
  1272 + var _obj = historyArray[$_keyIndex-1];
  1273 + // 创建图形对象.
  1274 + var graph_ = d3.select('#ganttSvg').relationshipGraph(JSON.parse(_obj.granph));
  1275 + // 根据数据重新渲染图形.
  1276 + graph_.data(JSON.parse(_obj.data));
  1277 + // 重新赋值图形对象.
  1278 + $_GlobalGraph = graph_;
  1279 + // 重新赋值图形对象.
  1280 + layer.msg('您已成功从【第 '+ ($_keyIndex+1) +'】撤销到【第 ' + ($_keyIndex) + '步】!');
  1281 + },
  1282 + }, {
  1283 + /**
  1284 + * @description : (TODO) 恢复函数.
  1285 + *
  1286 + * @status OK.
  1287 + * */
  1288 + key : 'regain',
  1289 + value : function regain() {
  1290 + // 关闭弹出层.
  1291 + layer.closeAll();
  1292 + // 判断当前操作是否恢复到最后一步的操纵.
  1293 + if($_keyIndex==historyArray.length) {
  1294 + layer.msg('已经是恢复到操作记录的【最后一步】了!');
  1295 + return;
  1296 + }
  1297 + // 标记操作下标前进.
  1298 + $_keyIndex++;
  1299 + // 删除图形.
  1300 + $('svg.svg-chart').remove();
  1301 + // 获取撤销到当前操作下标的数据.
  1302 + var _obj = historyArray[$_keyIndex-1];
  1303 + // 创建图形对象.
  1304 + var graph_ = d3.select('#ganttSvg').relationshipGraph(JSON.parse(_obj.granph));
  1305 + // 根据数据重新渲染图形.
  1306 + graph_.data(JSON.parse(_obj.data));
  1307 + // 重新赋值图形对象.
  1308 + $_GlobalGraph = graph_;
  1309 + // 弹出提示.
  1310 + layer.msg('您已成功从【第 '+ ($_keyIndex-1) +'】恢复到【第 ' + ($_keyIndex) + '步】!');
  1311 + },
  1312 + }, {
  1313 + /**
  1314 + * @description : (TODO) 获取底层Rect元素Id属性值.
  1315 + *
  1316 + * @param [obj--当前班次对象属性值]
  1317 + *
  1318 + * @return 返回一个底层Rect元素Id属性值.
  1319 + *
  1320 + * @status OK.
  1321 + * */
  1322 + key : 'setIdValue',
  1323 + value : function setIdValue(obj) {
  1324 + // 设置id属性值. 由一个 常量字符串 + 班次数 + 常量字符串 + 发车序号 + 常量字符 + 对应的y轴值.
  1325 + return 'shift-rect-' + obj.bcs + '_' + obj.fcno + '_' + $_GlobalGraph.configuration.y(obj.parent);
  1326 + }
  1327 + }, {
  1328 + /**
  1329 + * @description : (TODO) 获取X坐标属性值.
  1330 + *
  1331 + * @param [obj--当前班次对象属性值]
  1332 + *
  1333 + * @return 返回一个X坐标属性值.
  1334 + *
  1335 + * @status OK.
  1336 + * */
  1337 + key : 'setXValue',
  1338 + value : function setXValue(obj) {
  1339 + // 设置x坐标值.
  1340 + var hourMinue = obj.fcsj.split(":");
  1341 + return (parseInt(hourMinue[0])-$_GlobalGraph.configuration.dxHours )*60*$_GlobalGraph.configuration.multiple +
  1342 + parseInt(hourMinue[1])*$_GlobalGraph.configuration.multiple + $_GlobalGraph.configuration.offsetX;
  1343 + }
  1344 + }, {
  1345 + /**
  1346 + * @description : (TODO) 获取Y坐标属性值.
  1347 + *
  1348 + * @param [obj--当前班次对象属性值]
  1349 + *
  1350 + * @return 返回一个Y坐标属性值.
  1351 + *
  1352 + * @status OK.
  1353 + * */
  1354 + key : 'setYValue',
  1355 + value : function setYValue(obj) {
  1356 + return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY;
  1357 + }
  1358 + }, {
  1359 + /**
  1360 + * @description : (TODO) 获取Rect元素class属性值.
  1361 + *
  1362 + * @param [obj--当前班次对象属性值]
  1363 + *
  1364 + * @return 返回一个Rect元素class属性值.
  1365 + *
  1366 + * @status OK.
  1367 + * */
  1368 + key : 'setRectClassV',
  1369 + value : function setRectClassV(obj) {
  1370 + return obj.xlDir+ " data";
  1371 + }
  1372 + }, {
  1373 + /**
  1374 + * @description : (TODO) 获取Rect元素width属性值.
  1375 + *
  1376 + * @param [obj--当前班次对象属性值]
  1377 + *
  1378 + * @return 返回一个Rect元素width属性值.
  1379 + *
  1380 + * @status OK.
  1381 + * */
  1382 + key : 'setRectWidthV',
  1383 + value : function setRectWidthV(obj) {
  1384 + return obj.bcsj * $_GlobalGraph.configuration.multiple;
  1385 + }
  1386 + }, {
  1387 + /**
  1388 + * @description : (TODO) 获取Rect元素高度属性值.
  1389 + *
  1390 + * @param [obj--当前班次对象属性值]
  1391 + *
  1392 + * @return 返回一个Rect元素高度属性值.
  1393 + *
  1394 + * @status OK.
  1395 + * */
  1396 + key : 'setRectHeight',
  1397 + value : function setRectHeight(obj) {
  1398 + return $_GlobalGraph.configuration.y.rangeBand() + 2;
  1399 + }
  1400 + }, {
  1401 + /**
  1402 + * @description : (TODO) 获取底层rect父元素ID属性值.
  1403 + *
  1404 + * @param [obj--当前班次对象属性值]
  1405 + *
  1406 + * @return 返回一个底层rect父元素ID属性值.
  1407 + *
  1408 + * @status OK.
  1409 + * */
  1410 + key : 'setRectParenNodeIdV',
  1411 + value : function setRectParenNodeIdV(obj) {
  1412 + return 'parent_' + $_GlobalGraph.configuration.y(obj.parent) + '_' + obj.bcs + "_node_" + obj.fcno;
  1413 + }
  1414 + }, {
  1415 + /**
  1416 + * @description : (TODO) 获取下一个底层rect元素ID值.
  1417 + *
  1418 + * @param [obj--当前班次对象属性值]
  1419 + *
  1420 + * @return 返回一个下一个底层rect元素ID值.
  1421 + *
  1422 + * @status OK.
  1423 + * */
  1424 + key : 'setNextNodeIdV',
  1425 + value : function setNextNodeIdV(obj) {
  1426 + return "shift-rect-" + (obj.bcs+1) + '_' + (obj.fcno+1) + '_' + $_GlobalGraph.configuration.y(obj.parent);
  1427 + }
  1428 + }, {
  1429 + /**
  1430 + * @description : (TODO) 获取上一个底层rect元素ID值.
  1431 + *
  1432 + * @param [obj--当前班次对象属性值]
  1433 + *
  1434 + * @return 返回一个上一个底层rect元素ID值.
  1435 + *
  1436 + * @status OK.
  1437 + * */
  1438 + key : 'setLastNodeIdV',
  1439 + value : function setLastNodeIdV(obj) {
  1440 + return "shift-rect-" + (obj.bcs-1) + '_' + (obj.fcno-1)+ '_' + $_GlobalGraph.configuration.y(obj.parent);
  1441 + }
  1442 + }, {
  1443 + /**
  1444 + * @description : (TODO) 获取元素类型.
  1445 + *
  1446 + * @param [obj--当前班次对象属性值]
  1447 + *
  1448 + * @return 返回一个元素类型.
  1449 + *
  1450 + * @status OK.
  1451 + * */
  1452 + key : 'setNodeType',
  1453 + value : function setNodeType(type) {
  1454 + return type;
  1455 + }
  1456 + }, {
  1457 + /**
  1458 + * @description : (TODO) 获取text01元素ID属性值.
  1459 + *
  1460 + * @param [obj--当前班次对象属性值]
  1461 + *
  1462 + * @return 返回一个text01元素ID属性值.
  1463 + *
  1464 + * @status OK.
  1465 + * */
  1466 + key : 'setText01IdV',
  1467 + value : function setText01IdV(obj) {
  1468 + return "shift-rect-text01-" + obj.bcs + '_' + obj.fcno + $_GlobalGraph.configuration.y(obj.parent);
  1469 + }
  1470 + }, {
  1471 + /**
  1472 + * @description : (TODO) 获取text元素dx属性值.
  1473 + *
  1474 + * @param [obj--当前班次对象属性值]
  1475 + *
  1476 + * @return 返回一个text元素dx属性值.
  1477 + *
  1478 + * @status OK.
  1479 + * */
  1480 + key : 'setTextDxV',
  1481 + value : function setTextDxV(dx) {
  1482 + return dx;
  1483 + }
  1484 + }, {
  1485 + /**
  1486 + * @description : (TODO) 获取text元素dy属性值.
  1487 + *
  1488 + * @param [obj--当前班次对象属性值]
  1489 + *
  1490 + * @return 返回一个text元素dy属性值.
  1491 + *
  1492 + * @status OK.
  1493 + * */
  1494 + key : 'setTextDyV',
  1495 + value : function setTextDyV(dy) {
  1496 + return dy;
  1497 + }
  1498 + }, {
  1499 + /**
  1500 + * @description : (TODO) 获取text元素class属性值.
  1501 + *
  1502 + * @param [obj--当前班次对象属性值]
  1503 + *
  1504 + * @return 返回一个text元素class属性值.
  1505 + *
  1506 + * @status OK.
  1507 + * */
  1508 + key : 'setTextClassV',
  1509 + value : function setTextClassV(obj) {
  1510 + return obj.xlDir+ "-text";
  1511 + }
  1512 + }, {
  1513 + /**
  1514 + * @description : (TODO) 获取text01元素text文本.
  1515 + *
  1516 + * @param [obj--当前班次对象属性值]
  1517 + *
  1518 + * @return 返回一个text01元素text文本.
  1519 + *
  1520 + * @status OK.
  1521 + * */
  1522 + key : 'setText01text',
  1523 + value :function setText01text(obj) {
  1524 + var text = '';
  1525 + // 判断.如果班次时间大于〇 ,并且当前班次类型是 (正常班次、区间班次、直放班次、放站班次)其中的一种.则展示.这里的判断班次时间是为了隐藏那些班次时间为零的班次.
  1526 + if(obj.bcsj > 0 && (obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.normal ||
  1527 + obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.region ||
  1528 + obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.major ||
  1529 + obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.venting)) {
  1530 + var nowDate = new Date($_GlobalGraph.configuration.timeDomainStart);
  1531 + var hourMinuArray = obj.fcsj.split(":");
  1532 + nowDate.setHours(parseInt(hourMinuArray[0]));
  1533 + nowDate.setMinutes(parseInt(hourMinuArray[1])+obj.bcsj);
  1534 + text = obj.fcsj + '~' + (nowDate.getHours()<10? "0" + nowDate.getHours():nowDate.getHours()) +
  1535 + ":" +
  1536 + (nowDate.getMinutes()<10?"0"+nowDate.getMinutes():nowDate.getMinutes());
  1537 + }
  1538 + return text;
  1539 + }
  1540 + }, {
  1541 + /**
  1542 + * @description : (TODO) 获取circle圆元素ID值.
  1543 + *
  1544 + * @param [obj--当前班次对象属性值]
  1545 + *
  1546 + * @return 返回一个circle圆元素ID值.
  1547 + *
  1548 + * @status OK.
  1549 + * */
  1550 + key : 'setCircleIdV',
  1551 + value : function setCircleIdV(obj) {
  1552 + return "shift-rect-circle-" + obj.bcs + '_' + obj.fcno + $_GlobalGraph.configuration.y(obj.parent);
  1553 + }
  1554 + }, {
  1555 + /**
  1556 + * @description : (TODO) 获取circle圆元素cx值.
  1557 + *
  1558 + * @param [obj--当前班次对象属性值]
  1559 + *
  1560 + * @return 返回一个circle圆元素cx值.
  1561 + *
  1562 + * @status OK.
  1563 + * */
  1564 + key : 'setCirclecxV',
  1565 + value : function setCirclecxV(obj) {
  1566 + var hourMinue = obj.fcsj.split(":");
  1567 + return (parseInt(hourMinue[0])-$_GlobalGraph.configuration.dxHours )*60*$_GlobalGraph.configuration.multiple +
  1568 + parseInt(hourMinue[1])*$_GlobalGraph.configuration.multiple + $_GlobalGraph.configuration.offsetX +
  1569 + obj.bcsj * $_GlobalGraph.configuration.multiple - 12;
  1570 + }
  1571 + }, {
  1572 + /**
  1573 + * @description : (TODO) 获取circle圆元素cy值.
  1574 + *
  1575 + * @param [obj--当前班次对象属性值]
  1576 + *
  1577 + * @return 返回一个circle圆元素cy值.
  1578 + *
  1579 + * @status OK.
  1580 + * */
  1581 + key : 'setCirclecyV',
  1582 + value : function setCirclecyV(obj) {
  1583 + return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 12;
  1584 + }
  1585 + }, {
  1586 + /**
  1587 + * @description : (TODO) 获取circle圆元素r半径值.
  1588 + *
  1589 + * @param [obj--当前班次对象属性值]
  1590 + *
  1591 + * @return 返回一个circle圆元素r半径值.
  1592 + *
  1593 + * @status OK.
  1594 + * */
  1595 + key : 'setCircleRV',
  1596 + value : function setCircleRV(obj) {
  1597 + // 设置圆的半径.判断.如果班次时间大于〇则设置圆的半径常量8. 这里的判断是为了隐藏那些班次时间为零的班次.
  1598 + if(obj.bcsj>0)
  1599 + return 8 ;
  1600 + else
  1601 + return 0;
  1602 + }
  1603 + }, {
  1604 + /**
  1605 + * @description : (TODO) 获取circle圆元素class值.
  1606 + *
  1607 + * @param [obj--当前班次对象属性值]
  1608 + *
  1609 + * @return 返回一个circle圆元素class值.
  1610 + *
  1611 + * @status OK.
  1612 + * */
  1613 + key : 'setCircleClass',
  1614 + value : function setCircleClass(obj) {
  1615 + return obj.xlDir+ "-circle";
  1616 + }
  1617 + }, {
  1618 + /**
  1619 + * @description : (TODO) 获取text02元素ID属性值.
  1620 + *
  1621 + * @param [obj--当前班次对象属性值]
  1622 + *
  1623 + * @return 返回一个text02元素ID属性值.
  1624 + *
  1625 + * @status OK.
  1626 + * */
  1627 + key : 'setText02IdV',
  1628 + value : function setText02IdV(obj) {
  1629 + return "shift-rect-text02-" + obj.bcs + '_' + obj.fcno + $_GlobalGraph.configuration.y(obj.parent);
  1630 + }
  1631 + }, {
  1632 + /**
  1633 + * @description : (TODO) 获取text02元素text文本值.
  1634 + *
  1635 + * @param [obj--当前班次对象属性值]
  1636 + *
  1637 + * @return 返回一个text02元素text文本值.
  1638 + *
  1639 + * @status OK.
  1640 + * */
  1641 + key : 'setText02text',
  1642 + value : function setText02text(obj) {
  1643 + var text = '';
  1644 + if(obj.bcsj>0) {
  1645 + if(obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.bd ||
  1646 + obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.out||
  1647 + obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.in_||
  1648 + obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.lc)
  1649 + text = obj.fcsj;
  1650 + else if(obj.bcType=='cf')
  1651 + text = '吃:' + obj.bcsj;
  1652 + else
  1653 + text = "行:" + obj.bcsj;
  1654 + }
  1655 + return text;
  1656 + }
  1657 + }, {
  1658 + /**
  1659 + * @description : (TODO) 获取text03元素ID属性值.
  1660 + *
  1661 + * @param [obj--当前班次对象属性值]
  1662 + *
  1663 + * @return 返回一个text03元素ID属性值.
  1664 + *
  1665 + * @status OK.
  1666 + * */
  1667 + key : 'setText03IdV',
  1668 + value : function setText03IdV(obj) {
  1669 + return "shift-rect-text03-" + obj.bcs + '_' + obj.fcno + $_GlobalGraph.configuration.y(obj.parent);
  1670 + }
  1671 + }, {
  1672 + /**
  1673 + * @description : (TODO) 获取text03元素text文本值.
  1674 + *
  1675 + * @param [obj--当前班次对象属性值]
  1676 + *
  1677 + * @return 返回一个text03元素text文本值.
  1678 + *
  1679 + * @status OK.
  1680 + * */
  1681 + key : 'setText03text',
  1682 + value : function setText03text(obj) {
  1683 + var text = '';
  1684 + if(obj.bcsj>0) {
  1685 + if(obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.bd ||
  1686 + obj.bcType==$_GlobalGraph.configuration.dataMap.bcTypeArr.lc)
  1687 + text = "保:" + obj.bcsj;
  1688 + else if(obj.bcType=='out' || obj.bcType=='in')
  1689 + text = "行:" + obj.bcsj;
  1690 + else
  1691 + text = "停:" + obj.STOPTIME;
  1692 + }
  1693 + return text;
  1694 + }
  1695 + }, {
  1696 + /**
  1697 + * @description : (TODO) 获取text04元素ID属性值.
  1698 + *
  1699 + * @param [obj--当前班次对象属性值]
  1700 + *
  1701 + * @return 返回一个text04元素ID属性值.
  1702 + *
  1703 + * @status OK.
  1704 + * */
  1705 + key : 'setText04IdV',
  1706 + value : function (obj) {
  1707 + return "shift-rect-text04-" + obj.bcs + '_' + obj.fcno + $_GlobalGraph.configuration.y(obj.parent);
  1708 + }
  1709 + }, {
  1710 + /**
  1711 + * @description : (TODO) 获取text04元素x属性值.
  1712 + *
  1713 + * @param [obj--当前班次对象属性值]
  1714 + *
  1715 + * @return 返回一个text04元素x属性值.
  1716 + *
  1717 + * @status OK.
  1718 + * */
  1719 + key : 'setText04XV',
  1720 + value : function (obj) {
  1721 + var hourMinue = obj.fcsj.split(":");
  1722 + return (parseInt(hourMinue[0])-$_GlobalGraph.configuration.dxHours )*60*$_GlobalGraph.configuration.multiple +
  1723 + parseInt(hourMinue[1])*$_GlobalGraph.configuration.multiple + $_GlobalGraph.configuration.offsetX +
  1724 + obj.bcsj * $_GlobalGraph.configuration.multiple - 18;
  1725 + }
  1726 + }, {
  1727 + /**
  1728 + * @description : (TODO) 获取text04元素y属性值.
  1729 + *
  1730 + * @param [obj--当前班次对象属性值]
  1731 + *
  1732 + * @return 返回一个text04元素y属性值.
  1733 + *
  1734 + * @status OK.
  1735 + * */
  1736 + key : 'setText04YV',
  1737 + value : function setText04YV(obj) {
  1738 + return $_GlobalGraph.configuration.y(obj.parent) + $_GlobalGraph.configuration.offsetY + 16;
  1739 + }
  1740 + }, {
  1741 + /**
  1742 + * @description : (TODO) 获取text04元素class属性值.
  1743 + *
  1744 + * @param [obj--当前班次对象属性值]
  1745 + *
  1746 + * @return 返回一个text04元素class属性值.
  1747 + *
  1748 + * @status OK.
  1749 + * */
  1750 + key : 'setText04ClassV',
  1751 + value : function setText04ClassV(obj) {
  1752 + return obj.xlDir+ "-circle-text";
  1753 + }
  1754 + }, {
  1755 + /**
  1756 + * @description : (TODO) 获取text04元素text文本值.
  1757 + *
  1758 + * @param [obj--当前班次对象属性值]
  1759 + *
  1760 + * @return 返回一个text04元素text文本值.
  1761 + *
  1762 + * @status OK.
  1763 + * */
  1764 + key : 'setText04text',
  1765 + value : function(obj) {
  1766 + if(obj.bcsj>0) {
  1767 + if(obj.isfb == 1){
  1768 + return '分';
  1769 + }else {
  1770 + if(obj.bcType=='normal')
  1771 + return '正';
  1772 + else if(obj.bcType=='region')
  1773 + return '区';
  1774 + else if(obj.bcType=='major')
  1775 + return '站';
  1776 + else if(obj.bcType=='venting')
  1777 + return '直';
  1778 + else if(obj.bcType=='fb')
  1779 + return '分';
  1780 + else if(obj.bcType=='in')
  1781 + return '进';
  1782 + else if(obj.bcType=='lc')
  1783 + return '离';
  1784 + else if(obj.bcType=='out')
  1785 + return '出';
  1786 + else if(obj.bcType=='bd')
  1787 + return '到';
  1788 + else if(obj.bcType=='cf')
  1789 + return '吃';
  1790 + }
  1791 + }
  1792 + }
  1793 + }, {
  1794 + /**
  1795 + * @description : (TODO) 获取底层Rect元素的覆盖层rect元素Id属性值.
  1796 + *
  1797 + * @param [obj--当前班次对象属性值]
  1798 + *
  1799 + * @return 返回一个底层Rect元素的覆盖层rect元素Id属性值.
  1800 + *
  1801 + * @status OK.
  1802 + * */
  1803 + key : 'setCoverRectIdV',
  1804 + value : function setCoverRectIdV(obj) {
  1805 + return "shift-rect-cover-" + obj.bcs + '_' + obj.fcno + $_GlobalGraph.configuration.y(obj.parent);
  1806 + }
  1807 + }, {
  1808 + /**
  1809 + * @description : (TODO) 获取底层Rect元素的覆盖层rect元素class属性值.
  1810 + *
  1811 + * @param [obj--当前班次对象属性值]
  1812 + *
  1813 + * @return 返回一个底层Rect元素的覆盖层rect元素class属性值.
  1814 + *
  1815 + * @status OK.
  1816 + * */
  1817 + key : 'setCoverRectClassV',
  1818 + value : function setCoverRectClassV(className) {
  1819 + return className;
  1820 + }
  1821 + }, {
  1822 + /**
  1823 + * @description : (TODO) 获取底层Rect元素的覆盖层rect元素paren-node属性值.
  1824 + *
  1825 + * @param [obj--当前班次对象属性值]
  1826 + *
  1827 + * @return 返回一个底层Rect元素的覆盖层rect元素paren-node属性值.
  1828 + *
  1829 + * @status OK.
  1830 + * */
  1831 + key : 'setCoverRectParentV',
  1832 + value : function setCoverRectParentV(obj) {
  1833 + return "shift-rect-" + obj.bcs + '_' + obj.fcno + '_' + $_GlobalGraph.configuration.y(obj.parent) + '-cover';
  1834 + }
  1835 + }, {
  1836 + /**
  1837 + * @description : (TODO) 获取底层Rect元素的覆盖层rect元素next-node属性值.
  1838 + *
  1839 + * @param [obj--当前班次对象属性值]
  1840 + *
  1841 + * @return 返回一个底层Rect元素的覆盖层rect元素next-node属性值.
  1842 + *
  1843 + * @status OK.
  1844 + * */
  1845 + key : 'setCoverRectLastIdV',
  1846 + value : function setCoverRectLastIdV(obj) {
  1847 + return "shift-rect-cover-" + obj.bcs + '_' + (obj.fcno+1) + $_GlobalGraph.configuration.y(obj.parent);
  1848 + }
  1849 + }, {
  1850 + key : 'mouseUpEvent',
  1851 + value : function mouseUpEvent(flag) {
  1852 + // 5.1.2、 获取选择框的最小X、最小Y、最大X、最大Y.
  1853 + var caseRect = RelationshipGraph.getCaseRectAttribute(d3.selectAll('rect.case_rect'));
  1854 + // 5.1.3、获取所有的class为data的rect元素(班次)对象.
  1855 + var rectNodes = $('rect.data');
  1856 + // 5.1.4、定义被选中的上、下行元素(班次)元素对象x、y、parentId值数组 .
  1857 + var arrayUpX = new Array(),arrayUpY = new Array(),arrayDownX = new Array(),arrayDownY = new Array(),parA = new Array();
  1858 + // 5.1.5、遍历所有的元素对象. 获取出被选中的元素(班次)对象.
  1859 + for(var n = 0;n<rectNodes.length;n++) {
  1860 + // 5.1.5.1、定义当前元素最小X
  1861 + var downStartX = parseInt($(rectNodes[n]).attr('x')),
  1862 + downEndX = downStartX + parseInt($(rectNodes[n]).attr('width'));// 5.1.5.2、定义当前元素最大X
  1863 + // 5.1.5.3、定义当前元素最小Y
  1864 + var downStartY = parseInt($(rectNodes[n]).attr('y')),
  1865 + downEndY = downStartY + parseInt($(rectNodes[n]).attr('height'));// 5.1.5.4、定义当前元素最大Y
  1866 + /**
  1867 + * 5.1.5.4、 判断当前班次是否被框选在选中框内
  1868 + *
  1869 + * ✿ 图形理解判断条件 最大框代表选择框,框中的小方块代表选中的班次.
  1870 + *
  1871 + * minX----------------------------- maxY
  1872 + * │ │
  1873 + * │ □ □ □ □ □ □ □ □ □ │
  1874 + * │ │
  1875 + * minY----------------------------- maxX
  1876 + *
  1877 + * 如果当前小方块的最大X > 选择框的minX 并且 当前小方块的最小X < 选择框的maxX
  1878 + * 并且当前小方块的最大Y > 选择框的minY 并且 当前小方块的最小Y < 选择框的maxY
  1879 + * 则代表当前小方块在选择框内.
  1880 + **/
  1881 + if((downEndX > caseRect.caseRectMinX && downStartX < caseRect.caseRectMaxX) &&
  1882 + (downEndY > caseRect.caseRectMinY && downStartY < caseRect.caseRectMaxY)){
  1883 + var node = d3.select(rectNodes[n]);
  1884 + // 5.1.5.4.1、 获取当前元素的data数据.
  1885 + var d = node.data()[0];
  1886 + // 除去首末班车班次、早晚例保、进出场班次、吃饭班次.
  1887 + if(RelationshipGraph.issmbc(d.fcsj) || d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd ||
  1888 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out ||
  1889 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.cf ||
  1890 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.in_ ||
  1891 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.lc)
  1892 + continue;
  1893 + if(parA.indexOf(d.lpNo)<0)
  1894 + parA.push(d.lpNo);
  1895 + // 5.1.5.4.4、 把当前选择的最小x添加到arrayUpX数组中.
  1896 + arrayUpX.push(downStartX);
  1897 + // 5.1.5.4.5、 把当前选择的最小y添加到arrayUpY数组中.
  1898 + arrayUpY.push(downStartY);
  1899 + // 5.1.5.4.6、 把当前选择的最大x添加到arrayDownX数组中.
  1900 + arrayDownX.push(downEndX);
  1901 + // 5.1.5.4.7、 把当前选择的最大y添加到arrayDownY数组中.
  1902 + arrayDownY.push(downEndY);
  1903 + // 5.1.5.4.8、 把当前选择的元素的parent-node元素节点属性值添加到gClassNameArray中.
  1904 + gClassNameArray.push(node.attr('parent-node'));
  1905 + }
  1906 + }
  1907 + // 5.1.6、如果没有选择到元素(班次).给出提示,并执行选择框关闭事件.
  1908 + if(gClassNameArray.length==0) {
  1909 + // 5.1.6.1、弹出提示框.
  1910 + layer.msg('您没有框选中班次,请重新框选...');
  1911 + // 5.1.6.2、清除
  1912 + RelationshipGraph.gClose();
  1913 + // 5.1.6.3、结束事件.
  1914 + return false;
  1915 + }
  1916 + gClassNameArray.parA = parA;
  1917 + // 5.1.7、遍历 标记被选择的元素parent-node属性节点值的元素 添加class caseactive选中标记.
  1918 + for(var c =0;c<gClassNameArray.length;c++) {
  1919 + if(typeof(gClassNameArray[c])=='string') {
  1920 + var parentNodeCName = gClassNameArray[c], nodes = d3.selectAll('rect[parent-node='+ parentNodeCName +']')[0];
  1921 + for(var l =0;l<nodes.length;l++) {
  1922 + d3.select(nodes[l]).classed({'caseactive':true});
  1923 + var childrenNodesCName = $(nodes[l]).attr('id'),childrenNodes = $('text[parent-node='+ childrenNodesCName +']');
  1924 + d3.select('rect[parent-node='+ childrenNodesCName +'-cover]').classed({'caseactive':true});
  1925 + d3.select(d3.selectAll('circle[parent-node='+ childrenNodesCName +']')[0][0]).classed({'caseactive':true});
  1926 + for(var t = 0;t<childrenNodes.length;t++) {
  1927 + d3.select(childrenNodes[t]).classed({'caseactive':true});
  1928 + }
  1929 + }
  1930 + }
  1931 + }
  1932 + // 5.1.8、获取选择框元素对象.
  1933 + var d3CaseRectNode = d3.selectAll(".gantt-chart").selectAll('rect.case_rect');
  1934 + // 5.1.9、重新计算选择框的x、y、width、height属性值,并加上钢琴版动画效果.
  1935 + _animation(d3CaseRectNode).attr("x",function(d){
  1936 + return Math.min.apply(null, arrayUpX) -4;
  1937 + }).attr("y",function(d){
  1938 + return Math.min.apply(null, arrayUpY) -4;
  1939 + }).attr("width",function(d){
  1940 + return Math.max.apply(null, arrayDownX) - Math.min.apply(null, arrayUpX) + 8;
  1941 + }).attr("height",function(d){
  1942 + return Math.max.apply(null, arrayDownY) - Math.min.apply(null, arrayDownY) + parseInt(d3.select('rect[parent-node='+ gClassNameArray[0] +']').attr('height')) + 8;
  1943 + });
  1944 + // 5.1.9.10、延迟350毫秒绘制选择框上的关闭、拖动(左、右、中)按钮 .
  1945 + setTimeout(function(){
  1946 + RelationshipGraph._delayExecute();// 绘制选择框上的关闭、拖动(左、右、中)按钮.
  1947 + // 重新绘制g.shift下的选中元素.
  1948 + RelationshipGraph.restCaseNodes(document.querySelector("g.shift"),document.querySelectorAll("g.shift .caseactive"));
  1949 + // 重新绘制g.case_g下的选中元素.
  1950 + RelationshipGraph.restCaseNodes(document.querySelector("g.case_g"),document.querySelectorAll("g.case_g .caseactive"));
  1951 +
  1952 + },350);
  1953 + }
  1954 + }, {
  1955 + key : 'restCaseNodes',
  1956 + value : function(parends , nodes) {
  1957 + for(var n = 0 ; n<nodes.length;n++) {
  1958 + parends.removeChild(nodes[n]);
  1959 + parends.appendChild(nodes[n]);
  1960 + }
  1961 + }
  1962 + }, {
  1963 + key: 'noop',
  1964 + value: function noop() {}
  1965 + }, {
  1966 + key: 'isArray',
  1967 + value: function isArray(arr) {
  1968 + return Object.prototype.toString.call(arr) == '[object Array]';
  1969 + }
  1970 + }, {
  1971 + key : 'getCaseRectAttribute',
  1972 + value : function getCaseRectAttribute(node) {
  1973 + var caseRectMinX = parseInt(node.attr('x')),
  1974 + caseRectMinY = parseInt(node.attr('y'));
  1975 + var caseRectMaxX = caseRectMinX + parseInt(node.attr('width')),
  1976 + caseRectMaxY = caseRectMinY + parseInt(node.attr('height'));
  1977 + return {'caseRectMinX' : caseRectMinX, 'caseRectMinY': caseRectMinY, 'caseRectMaxX': caseRectMaxX,'caseRectMaxY':caseRectMaxY};
  1978 + }
  1979 + }, {
  1980 + /**
  1981 + * @description : (TODO) 绘制选择框上的关闭、拖动(左、右、中)按钮.
  1982 + *
  1983 + * @stauts : OK.
  1984 + *
  1985 + **/
  1986 + key : '_delayExecute',
  1987 + value : function _delayExecute() {
  1988 + // 1、获取选择框元素对象.
  1989 + var gCaseNode = d3.selectAll('g.case_g');
  1990 + // 2、获取选择框的最小X、最小Y、最大X、最大Y.
  1991 + var caseRect = RelationshipGraph.getCaseRectAttribute(d3.selectAll('rect.case_rect'));
  1992 + // 3、计算Y轴方向中间点的Y坐标.
  1993 + var Ds_yToe_d = Math.abs(caseRect.caseRectMaxY - caseRect.caseRectMinY)/2;
  1994 + // 4、计算X轴方向中间点的X坐标.
  1995 + var Ds_xToe_x = Math.abs(caseRect.caseRectMaxX - caseRect.caseRectMinX)/2;
  1996 + // 5、给选择框添加圆.这里画选择框关闭按钮
  1997 + gCaseNode.append('circle').classed({'c_close caseactive':true})
  1998 + .attr('cx', caseRect.caseRectMaxX+5).attr('cy', caseRect.caseRectMinY-5).attr('r', 8)
  1999 + .attr('group-id','c_close')
  2000 + .attr('parent-node','case_rectId');
  2001 + gCaseNode.append('circle').classed({'c_close_so caseactive':true})
  2002 + .attr('cx', caseRect.caseRectMaxX+5).attr('cy', caseRect.caseRectMinY-5).attr('r', 6)
  2003 + .attr('group-id','c_close')
  2004 + .attr('parent-node','case_rectId');
  2005 + gCaseNode.append('line').classed({'c_close_line_r caseactive':true})
  2006 + .attr('x1', caseRect.caseRectMaxX+2)
  2007 + .attr('y1', caseRect.caseRectMinY-8)
  2008 + .attr('x2', caseRect.caseRectMaxX+8)
  2009 + .attr('y2', caseRect.caseRectMinY-2)
  2010 + .attr('parent-node','case_rectId');
  2011 + gCaseNode.append('line').classed({'c_close_line_l caseactive':true})
  2012 + .attr('x1', caseRect.caseRectMaxX+2)
  2013 + .attr('y1', caseRect.caseRectMinY-2)
  2014 + .attr('x2', caseRect.caseRectMaxX+8)
  2015 + .attr('y2',caseRect.caseRectMinY-8)
  2016 + .attr('parent-node','case_rectId');
  2017 + gCaseNode.append('circle').classed({'c_close_cover caseactive':true})
  2018 + .attr('cx', caseRect.caseRectMaxX+5).attr('cy',caseRect.caseRectMinY-5).attr('r', 10)
  2019 + .attr('group-id','c_close')
  2020 + .attr('parent-node','case_rectId')
  2021 + .on('mouseover', function() {
  2022 + $(this).css("cursor","pointer");
  2023 + $("circle.c_close").css("opacity",1)
  2024 + $("line.c_close_line_r").css("opacity",1)
  2025 + $("line.c_close_line_l").css("opacity",1)
  2026 + }).on('mouseout',function() {
  2027 + $(this).css("cursor","default");
  2028 + $("circle.c_close").css("opacity",0.5)
  2029 + $("line.c_close_line_r").css("opacity",0.5)
  2030 + $("line.c_close_line_l").css("opacity",0.5)
  2031 + }).on('click', RelationshipGraph.gClose);
  2032 + // 6、给选择框添加圆.这里画左边拖拽点.
  2033 + gCaseNode.append('circle').classed({'test_r_left caseactive':true})
  2034 + .attr('cx', caseRect.caseRectMinX).attr('cy', Ds_yToe_d + caseRect.caseRectMinY).attr('r', 6)
  2035 + .attr('group-id','c_left')
  2036 + .attr('parent-node','case_rectId');
  2037 + gCaseNode.append('circle').classed({'test_r_left_so caseactive':true})
  2038 + .attr('cx', caseRect.caseRectMinX).attr('cy', Ds_yToe_d + caseRect.caseRectMinY).attr('r', 4)
  2039 + .attr('group-id','c_left')
  2040 + .attr('parent-node','case_rectId');
  2041 + gCaseNode.append('circle').classed({'test_r_left_solid caseactive':true})
  2042 + .attr('cx', caseRect.caseRectMinX).attr('cy', Ds_yToe_d + caseRect.caseRectMinY).attr('r', 2)
  2043 + .attr('group-id','c_left')
  2044 + .attr('parent-node','case_rectId');
  2045 + gCaseNode.append('circle').classed({'r_left_cover caseactive':true})
  2046 + .attr('cx', caseRect.caseRectMinX).attr('cy', Ds_yToe_d + caseRect.caseRectMinY).attr('r', 6)
  2047 + .attr('group-id','c_left')
  2048 + .attr('parent-node','case_rectId')
  2049 + .call(d3.behavior.drag()
  2050 + .on("dragstart",RelationshipGraph.dragLeftStart)
  2051 + .on("drag",RelationshipGraph.dragLeftRuing)
  2052 + .on("dragend",RelationshipGraph.dragLeftStop))
  2053 + .on('mouseover', function() {
  2054 + $(this).css("cursor","e-resize");
  2055 + }).on('mouseout',function() {
  2056 + $(this).css("cursor","default");
  2057 + });
  2058 + // 7、给选择框添加圆.这里画右边拖拽点.
  2059 + gCaseNode.append('circle').classed({'test_r_right caseactive':true})
  2060 + .attr('cx', caseRect.caseRectMaxX).attr('cy', Ds_yToe_d + caseRect.caseRectMinY).attr('r', 6)
  2061 + .attr('group-id','c_right')
  2062 + .attr('parent-node','case_rectId');
  2063 + gCaseNode.append('circle').classed({'test_r_right_so caseactive':true})
  2064 + .attr('cx', caseRect.caseRectMaxX).attr('cy', Ds_yToe_d + caseRect.caseRectMinY).attr('r', 4)
  2065 + .attr('group-id','c_right')
  2066 + .attr('parent-node','case_rectId');
  2067 + gCaseNode.append('circle').classed({'test_r_right_solid caseactive':true})
  2068 + .attr('cx', caseRect.caseRectMaxX).attr('cy', Ds_yToe_d + caseRect.caseRectMinY).attr('r', 2)
  2069 + .attr('group-id','c_right')
  2070 + .attr('parent-node','case_rectId');
  2071 + gCaseNode.append('circle').classed({'r_right_cover caseactive':true})
  2072 + .attr('cx', caseRect.caseRectMaxX).attr('cy', Ds_yToe_d + caseRect.caseRectMinY).attr('r', 6)
  2073 + .attr('group-id','c_right')
  2074 + .attr('parent-node','case_rectId')
  2075 + .call(d3.behavior.drag()
  2076 + .on("dragstart",RelationshipGraph.dragRightStart)
  2077 + .on("drag",RelationshipGraph.dragRightRuing)
  2078 + .on("dragend",RelationshipGraph.dragRightStop))
  2079 + .on('mouseover', function() {
  2080 + $(this).css("cursor","e-resize");
  2081 + }).on('mouseout',function() {
  2082 + $(this).css("cursor","default");
  2083 + });
  2084 + // 7、给选择框添加圆.这里画中心拖拽点.
  2085 + gCaseNode.append('circle').classed({'test_r_center caseactive':true})
  2086 + .attr('cx', Ds_xToe_x + caseRect.caseRectMinX).attr('cy', caseRect.caseRectMinY).attr('r', 8)
  2087 + .attr('group-id','c_center')
  2088 + .attr('parent-node','case_rectId');
  2089 + gCaseNode.append('circle').classed({'test_r_center_so caseactive':true})
  2090 + .attr('cx', Ds_xToe_x + caseRect.caseRectMinX).attr('cy', caseRect.caseRectMinY).attr('r', 6)
  2091 + .attr('group-id','c_center')
  2092 + .attr('parent-node','case_rectId');
  2093 + gCaseNode.append('circle').classed({'test_r_center_solid caseactive':true})
  2094 + .attr('cx', Ds_xToe_x + caseRect.caseRectMinX).attr('cy', caseRect.caseRectMinY).attr('r', 4)
  2095 + .attr('group-id','c_center')
  2096 + .attr('parent-node','case_rectId');
  2097 + gCaseNode.append('circle').classed({'r_center_cover caseactive':true})
  2098 + .attr('cx', Ds_xToe_x + caseRect.caseRectMinX).attr('cy', caseRect.caseRectMinY).attr('r', 8)
  2099 + .attr('group-id','c_center')
  2100 + .attr('parent-node','case_rectId')
  2101 + .call(d3.behavior.drag()
  2102 + .on("dragstart",RelationshipGraph.centerMoveSart)
  2103 + .on("drag",RelationshipGraph.centerMoveRuing)
  2104 + .on("dragend",RelationshipGraph.centerMoveStop))
  2105 + .on('mouseover', function() {
  2106 + $(this).css("cursor","move");
  2107 + }).on('mouseout',function() {
  2108 + $(this).css("cursor","default");
  2109 + });
  2110 + }
  2111 + }, {
  2112 + /**
  2113 + * @desription : (TODO) 选择框左边拖拽点沿X轴方向拖拽开始事件.
  2114 + *
  2115 + * @status : OK.
  2116 + **/
  2117 + key : 'dragLeftStart',
  2118 + value : function dragLeftStart(d,i) {
  2119 + // 1、拖拽开始鼠标当前坐标X点.
  2120 + drwaLeftX = d3.mouse(this)[0];
  2121 + }
  2122 + }, {
  2123 + /**
  2124 + * @desription : (TODO) 选择框左边拖拽点沿X轴方向拖拽中事件.
  2125 + *
  2126 + * @status : OK.
  2127 + **/
  2128 + key : 'dragLeftRuing',
  2129 + value : function dragLeftRuing(d,i) {
  2130 + // 1、开启标记鼠标从选择框左边点按下沿X方向进行拖拽状态.
  2131 + drwaLeftXStatus = true;
  2132 + // 2、记录鼠标当前X坐标
  2133 + var RDX = d3.mouse(this)[0];
  2134 + // 3、计算沿X轴方向偏移量. 当前坐标X - 初始起点坐标X.
  2135 + var dx = RDX - drwaLeftX;
  2136 + // 4、更新初始起点坐标X.
  2137 + drwaLeftX = RDX;
  2138 + RelationshipGraph.leftAndRightDraw(dx,'left');
  2139 + }
  2140 + }, {
  2141 + /**
  2142 + * @description : (TODO) 选择框左边拖拽点沿X轴方向停止拖拽事件.
  2143 + *
  2144 + * @status OK.
  2145 + * */
  2146 + key : 'dragLeftStop',
  2147 + value : function dragLeftStop(d,i) {
  2148 + if(drwaLeftXStatus) {
  2149 + // 1、关闭标记鼠标从选择框左边点按下沿X方向进行拖拽状态.
  2150 + drwaLeftXStatus = false;
  2151 + RelationshipGraph.leftAndRightStop('left');
  2152 + }
  2153 + }
  2154 +
  2155 + }, {
  2156 + /**
  2157 + * @description : (TODO) 选择框右边拖拽点沿X轴方向拖拽开始事件.
  2158 + *
  2159 + * @status OK.
  2160 + * */
  2161 + key : 'dragRightStart',
  2162 + value : function dragRightStart(d,i) {
  2163 + // 1、拖拽开始鼠标当前坐标X点.
  2164 + drwaRightX = d3.mouse(this)[0];
  2165 + }
  2166 +
  2167 + }, {
  2168 + /**
  2169 + * @description : (TODO) 选择框右边拖拽点沿X轴方向拖拽中事件.
  2170 + *
  2171 + * @status OK.
  2172 + * */
  2173 + key : 'dragRightRuing',
  2174 + value : function dragRightRuing(d,i) {
  2175 + // 1、开启标记鼠标从选择框右边点按下沿X方向进行拖拽状态.
  2176 + drwaRightXStatus = true;
  2177 + // 2、记录鼠标当前X坐标
  2178 + var RDX = d3.mouse(this)[0];
  2179 + // 3、计算沿X轴方向偏移量. 当前坐标X - 初始起点坐标X.
  2180 + var dx = RDX - drwaRightX;
  2181 + // 4、更新初始起点坐标X.
  2182 + drwaRightX = RDX;
  2183 + RelationshipGraph.leftAndRightDraw(dx,'right');
  2184 + }
  2185 +
  2186 + }, {
  2187 + /**
  2188 + * @description : (TODO) 选择框右边拖拽点沿X轴方向停止拖拽事件.
  2189 + *
  2190 + * @status OK.
  2191 + * */
  2192 + key : 'dragRightStop',
  2193 + value : function dragRightStop(d,i) {
  2194 + if(drwaRightXStatus) {
  2195 + drwaRightXStatus = false;
  2196 + RelationshipGraph.leftAndRightStop('right');
  2197 + }
  2198 + }
  2199 +
  2200 + }, {
  2201 + key : 'leftAndRightDraw',
  2202 + value : function leftAndRightDraw(dx,drawDir) {
  2203 + // 5、获取选中元素对象
  2204 + var rectTypeA = RelationshipGraph.getRectElementsNodes(d3.selectAll('.caseactive')[0],drawDir);
  2205 + RelationshipGraph.updCaseRect(RelationshipGraph.getCaseNodesAttr(rectTypeA.caseRect),dx,drawDir);
  2206 + var shiftRectA = rectTypeA.shiftRect,len = shiftRectA.length;
  2207 + var shiftRectA = rectTypeA.shiftRect,len = shiftRectA.length;
  2208 + for(var s = 0 ; s < len ; s++) {
  2209 + var rectNodesAttr = RelationshipGraph.getContextNodeAndData(d3.select(shiftRectA[s]).attr('id'));
  2210 + rectNodesAttr.qdbcNode.attr('x',parseInt(rectNodesAttr.qdbcNode.attr('x'))+(dx*shiftRectA[s].fcnodx));
  2211 + var tm = RelationshipGraph.zbTosj(parseInt(rectNodesAttr.qdbcNode.attr('x'))-$_GlobalGraph.configuration.offsetX);
  2212 + rectNodesAttr.dqbcData.fcsj = tm.hour + ':' + tm.min;
  2213 + var nowDate = BaseFun.getDateTime(rectNodesAttr.dqbcData.fcsj);
  2214 + nowDate.setMinutes(parseInt(tm.min)+rectNodesAttr.dqbcData.bcsj);
  2215 + rectNodesAttr.dqbcData.ARRIVALTIME = BaseFun.getTimeStr(nowDate);
  2216 + rectNodesAttr.dqbcData.STOPTIME = parseInt((BaseFun.getDateTime(rectNodesAttr.nextData.fcsj)-
  2217 + BaseFun.getDateTime(rectNodesAttr.dqbcData.ARRIVALTIME))/60000);
  2218 + for(var t = 0 ; t<rectNodesAttr.dqbctextNodes.length;t++) {
  2219 + RelationshipGraph.changeNode(rectNodesAttr.dqbctextNodes[t],dx*shiftRectA[s].fcnodx,rectNodesAttr.dqbcData);
  2220 + }
  2221 + rectNodesAttr.dqbcCircleNode.attr('cx',parseInt(rectNodesAttr.dqbcCircleNode.attr('cx'))+(dx*shiftRectA[s].fcnodx));
  2222 + if(rectNodesAttr.dqbcData.STOPTIME<0)
  2223 + d3.selectAll('text[parent-node='+ rectNodesAttr.qdbcNodeId +']').classed({'alert-danger':true});
  2224 + else
  2225 + d3.selectAll('text[parent-node='+ rectNodesAttr.qdbcNodeId +']').classed({'alert-danger':false});
  2226 + }
  2227 + }
  2228 + }, {
  2229 + key : 'leftAndRightStop',
  2230 + value : function leftAndRightStop(drawDir) {
  2231 + var rectTypeA = RelationshipGraph.getRectElementsNodes(d3.selectAll('.caseactive')[0],drawDir);
  2232 + var shiftRectA = rectTypeA.shiftRect,len = shiftRectA.length;
  2233 + for(var s = 0 ; s < len ; s++) {
  2234 + var rectNodesAttr = RelationshipGraph.getContextNodeAndData(d3.select(shiftRectA[s]).attr('id'));
  2235 + if(rectNodesAttr.dqbcData.STOPTIME<0) {
  2236 + var nextTzsjDx = $_GlobalGraph.configuration.dataMap.minztjx - rectNodesAttr.dqbcData.STOPTIME;
  2237 + // 修改遍历的当前元素数据的停站时间为最小停站时间.
  2238 + rectNodesAttr.dqbcData.STOPTIME = $_GlobalGraph.configuration.dataMap.minztjx;
  2239 + // 修改遍历的当前元素数据的文本展示停站时间
  2240 + for(var t = 0 ; t < rectNodesAttr.dqbctextNodes.length ; t++) {
  2241 + if(d3.select(rectNodesAttr.dqbctextNodes[t]).attr('text-type')=='gap')
  2242 + d3.select(rectNodesAttr.dqbctextNodes[t]).text('停:' + rectNodesAttr.dqbcData.STOPTIME);
  2243 + }
  2244 + /**
  2245 + * 修改下个班次的 发车时间、到达时间、停站时间
  2246 + *
  2247 + *
  2248 + * */
  2249 + var $_date = BaseFun.getDateTime(rectNodesAttr.dqbcData.ARRIVALTIME);
  2250 + $_date.setMinutes(parseInt($_date.getMinutes() + rectNodesAttr.dqbcData.STOPTIME));
  2251 + rectNodesAttr.nextData.fcsj = BaseFun.getTimeStr($_date);
  2252 + var $_x = parseInt($_date.getHours()-$_GlobalGraph.configuration.dxHours)*60*$_GlobalGraph.configuration.multiple +
  2253 + parseInt($_date.getMinutes())*$_GlobalGraph.configuration.multiple + $_GlobalGraph.configuration.offsetX;
  2254 + $_date.setMinutes(parseInt($_date.getMinutes() + rectNodesAttr.nextData.bcsj));
  2255 + rectNodesAttr.nextData.ARRIVALTIME = BaseFun.getTimeStr($_date);
  2256 + rectNodesAttr.nextData.STOPTIME = rectNodesAttr.nextData.STOPTIME-nextTzsjDx;
  2257 + /**
  2258 + * 修改下个班次的元素坐标属性值
  2259 + *
  2260 + * */
  2261 + rectNodesAttr.nextbcNode.attr('x',$_x);
  2262 + var rectCover = d3.select(d3.selectAll('rect[parent-node='+ rectNodesAttr.nextbcNodeId + '-cover' +']')[0][0]);
  2263 + rectCover.attr('x',$_x);
  2264 + rectNodesAttr.nextbcCircleNode.attr('cx',parseInt(rectNodesAttr.nextbcNode.attr('x')) +
  2265 + (rectNodesAttr.nextData.bcsj) * ($_GlobalGraph.configuration.multiple) - 12);
  2266 + var _text = parseInt(rectNodesAttr.nextbcNode.attr('x')) + (rectNodesAttr.nextData.bcsj) * ($_GlobalGraph.configuration.multiple) - 18;// 1.5.4、计算时刻转text X轴坐标值.
  2267 +
  2268 + for(var n = 0 ; n < rectNodesAttr.nextbctextNodes.length ; n++) {
  2269 + var _textType = d3.select(rectNodesAttr.nextbctextNodes[n]).attr('text-type'); // 1.5.4.1、获取当前text元素的类型.
  2270 + if(_textType =='bcType')
  2271 + d3.select(rectNodesAttr.nextbctextNodes[n]).attr('x',_text);
  2272 + else
  2273 + d3.select(rectNodesAttr.nextbctextNodes[n]).attr('x',$_x);
  2274 + if(_textType=='timeslot')
  2275 + d3.select(rectNodesAttr.nextbctextNodes[n]).text(rectNodesAttr.nextData.fcsj + '~' + rectNodesAttr.nextData.ARRIVALTIME);
  2276 + else if(_textType=='gap')
  2277 + d3.select(rectNodesAttr.nextbctextNodes[n]).text('停:' + rectNodesAttr.nextData.STOPTIME);
  2278 + }
  2279 + d3.selectAll('text[parent-node='+ rectNodesAttr.qdbcNodeId +']').classed({'alert-danger':false});
  2280 + }
  2281 + }
  2282 + }
  2283 + }, {
  2284 + /**
  2285 + * @description : (TODO) 修改选择框以及框边拖拽点的坐标属性值.
  2286 + *
  2287 + * @status OK.
  2288 + * */
  2289 + key : 'updCaseRect',
  2290 + value : function updCaseRect(nodes,dx,drawtype) {
  2291 + // 修改选择框元素的宽度属性值.
  2292 + if(drawtype == 'left') {
  2293 + nodes.caseRectNode.attr('width',parseInt(nodes.caseRectNode.attr('width'))-dx);
  2294 + // 修改选择框元素的X坐标属性值.
  2295 + nodes.caseRectNode.attr('x',parseInt(nodes.caseRectNode.attr('x'))+dx);
  2296 + }else if(drawtype == 'right') {
  2297 + nodes.caseRectNode.attr('width',parseInt(nodes.caseRectNode.attr('width'))+dx);
  2298 + var lineNodes = nodes.attrLine,_lLen = lineNodes.length;
  2299 + for(var l = 0 ; l < _lLen ; l++) {
  2300 + var line = d3.select(lineNodes[l]);
  2301 + line.attr('x1',parseInt(line.attr('x1'))+dx);
  2302 + line.attr('x2',parseInt(line.attr('x2'))+dx);
  2303 + }
  2304 + }
  2305 + var circleNodes = nodes.attrCircle,len = circleNodes.length;
  2306 + for(var c = 0 ; c < len ; c++) {
  2307 + var circle = d3.select(circleNodes[c]);
  2308 + var gourpId = circle.attr('group-id');
  2309 + if(gourpId=='c_left' && drawtype == 'left')
  2310 + circle.attr('cx',parseInt(circle.attr('cx'))+dx);
  2311 + else if(gourpId!='c_left' && gourpId!='c_center' && drawtype == 'right')
  2312 + circle.attr('cx',parseInt(circle.attr('cx'))+dx);
  2313 + else if(gourpId=='c_center')
  2314 + circle.attr('cx',parseInt(nodes.caseRectNode.attr('x')) + parseInt(nodes.caseRectNode.attr('width'))/2);
  2315 + }
  2316 + }
  2317 + }, {
  2318 + key : 'getRectNodesAttr',
  2319 + value : function getRectNodesAttr(rectNode) {
  2320 + var node = d3.select(rectNode);
  2321 + var nodeId = node.attr('id');
  2322 + return {'qdbcNodeId':nodeId,
  2323 + 'qdbcNode':node,
  2324 + 'dqbctextNodes':d3.selectAll('text[parent-node='+ nodeId +']')[0],// 当前班次元素对象的text文本元素.
  2325 + 'dqbcCircleNode':d3.select(d3.selectAll('circle[parent-node='+ nodeId +']')[0][0]),// 当前班次元素对象的circle圆元素
  2326 + 'dqbcData' : node.data()[0]
  2327 + }
  2328 + }
  2329 + }, {
  2330 + key : 'getCaseNodesAttr' ,
  2331 + value : function getCaseNodesAttr(caseRectNode) {
  2332 + var node = d3.select(caseRectNode);
  2333 + var nodeId = node.attr('id');
  2334 + return {'nodeId' : nodeId,
  2335 + 'caseRectNode' : node ,
  2336 + 'attrCircle' : d3.selectAll('circle[parent-node=' + nodeId + ']')[0],
  2337 + 'attrLine' : d3.selectAll('line[parent-node=' + nodeId + ']')[0]};
  2338 + }
  2339 + }, {
  2340 + key : 'getRectElementsNodes',
  2341 + value : function getRectElementsNodes(nodes,drawDir) {
  2342 + // 1、定义rect元素对象集合数组.
  2343 + var _rectNodes = new Array(),caseRect = null, tempAr = new Array();
  2344 + // 2、遍历nodes元素对象集合.
  2345 + for(var n = 0; n<nodes.length;n++) {
  2346 + // 2.1、定义遍历的当前元素对象的元素标签名称与rect-type名称.
  2347 + var tagName = $(nodes[n]).get(0).tagName;
  2348 + // 2.2、如果是rect并且是shift.则添加到rect元素集合数组中.
  2349 + if(tagName=='rect') {
  2350 + var rn = d3.select(nodes[n]);
  2351 + var rdt = rn.data()[0];
  2352 + var rectType = rn.attr('rect-type');
  2353 + if(rectType == 'shift') {
  2354 + _rectNodes.push(nodes[n]);// 2.3、添加到_rectNodes数组中.
  2355 + if(tempAr.indexOf(rdt.lpNo)<0)
  2356 + tempAr.push(rdt.lpNo);
  2357 + }else if(rectType == 'case') {
  2358 + caseRect = nodes[n];
  2359 + }
  2360 + }
  2361 + }
  2362 + var lpfcno = new Array();
  2363 + for(var p = 0 ; p < tempAr.length ; p++) {
  2364 + var fcnoA = new Array();
  2365 + for(var t = 0 ; t < _rectNodes.length ; t++) {
  2366 + var node = d3.select(_rectNodes[t]);
  2367 + var data = node.data()[0];
  2368 + if(data.lpNo == tempAr[p])
  2369 + fcnoA.push(data.fcno);
  2370 +
  2371 + }
  2372 + lpfcno.push({'lpNo':tempAr[p],'fcnoA' : fcnoA});
  2373 + }
  2374 +
  2375 + for(var r = 0;r<_rectNodes.length;r++ ) {
  2376 + var rtn = d3.select(_rectNodes[r]);
  2377 + var ndta = rtn.data()[0];
  2378 + for(var c = 0 ; c< lpfcno.length;c++) {
  2379 + if(ndta.lpNo == lpfcno[c].lpNo){
  2380 + if(drawDir=='right')
  2381 + _rectNodes[r].fcnodx = ndta.fcno - Math.min.apply(null, lpfcno[c].fcnoA);
  2382 + if(drawDir=='left')
  2383 + _rectNodes[r].fcnodx = Math.max.apply(null, lpfcno[c].fcnoA) - ndta.fcno;
  2384 + }
  2385 + }
  2386 + }
  2387 + return {shiftRect:_rectNodes,'caseRect':caseRect};
  2388 + }
  2389 + }, {
  2390 + /**
  2391 + * @desription : (TODO) 获取rect 元素对象.这里表示的是只获取班次元素对象.
  2392 + *
  2393 + * @params : [nodes--元素对象集合;type--移动的方向.]
  2394 + *
  2395 + * @status OK .
  2396 + **/
  2397 + key : 'getFirstRectElements',
  2398 + value : function getFirstRectElements(nodes,type) {
  2399 + // 遍历rect元素集合数组.
  2400 + for(var r =0; r<nodes.length;r++) {
  2401 + /**
  2402 + * 判断 type类型
  2403 + *
  2404 + * ✿ 如果是right.代表的是右拖拽时候.
  2405 + *
  2406 + * ✿ 如果是left.代表的是左拖拽时候.
  2407 + **/
  2408 + // 右拖拽.
  2409 + if(type=='right') {
  2410 + if(d3.select(_rectNodes[r]).attr('id').split('_')[1] != temp) {
  2411 + result.push({id:d3.select(_rectNodes[r]).attr('id')});
  2412 + }
  2413 + temp = d3.select(_rectNodes[r]).attr('id').split('_')[1];
  2414 + // 左拖拽.
  2415 + }else if(type =='left') {
  2416 + // 判断当前遍历是否到了数组下标最后一个.
  2417 + if(r<_rectNodes.length-1) {
  2418 + if(d3.select(_rectNodes[r]).attr('id').split('_')[1] != d3.select(_rectNodes[r+1]).attr('id').split('_')[1]) {
  2419 + result.push({id:d3.select(_rectNodes[r]).attr('id')});
  2420 + }
  2421 + }else {
  2422 + result.push({id:d3.select(_rectNodes[r]).attr('id')});
  2423 + }
  2424 + }
  2425 + }
  2426 + return {'fistnodes':result,'arr':_arr};
  2427 + }
  2428 +
  2429 + }, {
  2430 + /**
  2431 + * @desription : (TODO) 选择框沿Y轴拖拽开始事件.
  2432 + *
  2433 + * @status : OK.
  2434 + **/
  2435 + key : 'regionDrawStart',
  2436 + value : function regionDrawStart(d,i) {
  2437 + drwaStartY = d3.mouse(this)[1];// 给选择框往Y轴拖拽时开始点的Y坐标赋值.
  2438 + }
  2439 + }, {
  2440 + /**
  2441 + * @desription : (TODO) 选择框往Y轴方向拖拽中
  2442 + *
  2443 + * @status : OK.
  2444 + **/
  2445 + key : 'regionDrawRuing',
  2446 + value : function regionDrawRuing(d,i) {
  2447 + drwaStartYStatus = true;// 开启标记选择框沿Y方向进行拖拽状态.
  2448 + // 1、当前鼠标坐标位置.
  2449 + var RDY = d3.mouse(this)[1];
  2450 + // 2、当前鼠标位置的Y坐标 减去 起始点Y坐标 得到 Y轴方向的偏移量.
  2451 + var dy = RDY - drwaStartY;
  2452 + // 3、重新标记起始点.
  2453 + drwaStartY = RDY;
  2454 + // 4、获取选择的元素.
  2455 + var nodes = d3.selectAll('.caseactive')[0];
  2456 + // 5、遍历选中元素,并在拖拽过程中修改选中元素的属性值Y坐标.因为这里只沿Y轴方向进行拖拽,所以值修改Y坐标.
  2457 + for(var n = 0; n<nodes.length;n++) {
  2458 + // 5.1、获取当前元素的元素标签名称.
  2459 + var tagName = $(nodes[n]).get(0).tagName;
  2460 + // 5.2、判断 如果当前元素的元素标签名为rect元素.代表 方块
  2461 + if(tagName=='rect') {
  2462 + d3.select(nodes[n]).attr('y',parseInt(d3.select(nodes[n]).attr('y'))+dy);// 5.2.1、修改当前元素的Y属性值.
  2463 + // 5.3、判断 如果当前元素的元素标签名为text元素. 代表 文本
  2464 + }else if(tagName=='text') {
  2465 + d3.select(nodes[n]).attr('y',parseInt(d3.select(nodes[n]).attr('y'))+dy);// 5.3.1、修改当前元素的Y属性值.
  2466 + // 5.4、判断 如果当前元素的元素标签名为circle元素.代表 圆
  2467 + }else if(tagName == 'circle'){
  2468 + d3.select(nodes[n]).attr('cy',parseInt(d3.select(nodes[n]).attr('cy'))+dy);// 5.4.1、修改当前元素的Y属性值.
  2469 + // 5.5、判断 如果当前元素的元素标签名为circle元素.代表 线
  2470 + }else if(tagName=='line') {
  2471 + d3.select(nodes[n]).attr('y1',parseInt(d3.select(nodes[n]).attr('y1'))+dy);// 5.5.1、修改当前元素的Y属性值.
  2472 + d3.select(nodes[n]).attr('y2',parseInt(d3.select(nodes[n]).attr('y2'))+dy);// 5.5.2、修改当前元素的Y属性值.
  2473 + }
  2474 + }
  2475 + }
  2476 +
  2477 + }, {
  2478 + /**
  2479 + * @desription : (TODO) 选择框往Y轴方向拖拽结束.
  2480 + *
  2481 + * @status : OK.
  2482 + **/
  2483 + key : 'regionDrawStop',
  2484 + value : function regionDrawStop(d,i) {
  2485 + if(drwaStartYStatus) {
  2486 + drwaStartYStatus = false;// // 关闭标记选择框沿Y方向进行拖拽状态.
  2487 + // 1、获取拖拽元素当前的Y坐标点.
  2488 + var dqY = d3.select(this).attr("y");
  2489 + // 2、定义靠近对应路牌对应的Y坐标最近点,与路牌名称.
  2490 + var RDY = 0;//$_carName = '';
  2491 + for(var q = 0 ; q<yAxisYArray.length;q++) {
  2492 + if(dqY<yAxisYArray[q].y) {
  2493 + if(q==0) {
  2494 + RDY = yAxisYArray[q].y;
  2495 + }else {
  2496 + RDY = yAxisYArray[q-1].y;
  2497 + }
  2498 + break;
  2499 + }
  2500 + }
  2501 + // 3、当坐标点不在路牌所对应的坐标点范围内,如果小于最小路牌的Y坐标.则去最小路牌对应的Y坐标,如果大于最大路牌的Y坐标,则取最大路牌对应的Y坐标.
  2502 + var tagb = yAxisYArray[0].y-dqY < yAxisYArray[yAxisYArray.length-1].y-dqY;
  2503 + RDY = (RDY == 0 ? yAxisYArray[yAxisYArray.length-Math.max.apply(null, gClassNameArray.parA)].y : RDY);
  2504 + // 4、得到最终在沿Y拖拽过程中的Y轴偏移量.
  2505 + var dy = RDY - dqY - 4;
  2506 + // 5、获取选择的元素.
  2507 + var nodes = d3.selectAll('.caseactive')[0];
  2508 + // 6、遍历选中元素,并在拖拽过程中修改选中元素的属性值Y坐标.因为这里只沿Y轴方向进行拖拽,所以值修改Y坐标.
  2509 + for(var n = 0; n<nodes.length;n++) {
  2510 + // 6.1、获取当前元素的元素标签名称.
  2511 + var tagName = $(nodes[n]).get(0).tagName;
  2512 + // 6.2、判断 如果当前元素的元素标签名为rect元素.代表 方块
  2513 + if(tagName=='rect') {
  2514 + var y_dx = parseInt(d3.select(nodes[n]).attr('y'))+dy,lpA = '';
  2515 + _animation(d3.select(nodes[n])).attr('y',y_dx);
  2516 + for(var q = 0 ; q<yAxisYArray.length;q++) {
  2517 + if(y_dx<yAxisYArray[q].y) {
  2518 + if(q==0)
  2519 + lpA = yAxisYArray[q].lpA;
  2520 + else
  2521 + lpA = yAxisYArray[q-1].lpA;
  2522 + break;
  2523 + }
  2524 + }
  2525 + var tagb_ = yAxisYArray[0].y-y_dx < yAxisYArray[yAxisYArray.length-1].y-y_dx;
  2526 + lpA = (lpA == '' ? tagb_ ? yAxisYArray[yAxisYArray.length-1].lpA : yAxisYArray[0].lpA : lpA);
  2527 + var dt = d3.select(nodes[n]).data()[0];
  2528 + dt.parent = lpA.lpName;
  2529 + dt.lp = lpA.lp;
  2530 + dt.lpName = lpA.lpName;
  2531 + dt.lpNo = lpA.lpNo;
  2532 + dt.lpType = lpA.lpType;
  2533 + // 6.3、判断 如果当前元素的元素标签名为text元素. 代表 文本
  2534 + }else if(tagName=='text') {
  2535 + _animation(d3.select(nodes[n])).attr('y',parseInt(d3.select(nodes[n]).attr('y'))+dy);
  2536 + // 6.4、判断 如果当前元素的元素标签名为circle元素.代表 圆
  2537 + }else if(tagName == 'circle'){
  2538 + _animation(d3.select(nodes[n])).attr('cy',parseInt(d3.select(nodes[n]).attr('cy'))+dy);
  2539 + // 5.5、判断 如果当前元素的元素标签名为circle元素.代表 线
  2540 + }else if(tagName=='line') {
  2541 + _animation(d3.select(nodes[n])).attr('y1',parseInt(d3.select(nodes[n]).attr('y1'))+dy).attr('y2',parseInt(d3.select(nodes[n]).attr('y2'))+dy);
  2542 + }
  2543 + }
  2544 + setTimeout(function(){
  2545 + $_GlobalGraph.statistics();
  2546 + $_GlobalGraph.addHistory();
  2547 + },310);
  2548 + }
  2549 + }
  2550 + }, {
  2551 + /**
  2552 + * @description : (TODO) 鼠标从选择框中心点按下沿X方向左右拖拽开始事件.
  2553 + *
  2554 + * @status OK .
  2555 + **/
  2556 + key : 'centerMoveSart',
  2557 + value : function centerMoveSart(d,i) {
  2558 + // 1、记录拖拽起始点.
  2559 + drwaStartX = d3.mouse(this)[0];
  2560 + }
  2561 + }, {
  2562 + /**
  2563 + * @description : (TODO) 鼠标从选择框中心点按下沿X方向左右拖拽中事件.
  2564 + *
  2565 + * @status OK.
  2566 + **/
  2567 + key : 'centerMoveRuing',
  2568 + value : function centerMoveRuing(d,i) {
  2569 + // 1、开启标记鼠标从选择框中心点按下沿X方向进行拖拽状态.
  2570 + drwaStartXStatus = true;
  2571 + // 2、获取鼠标当前X坐标点位置.
  2572 + var RDX = d3.mouse(this)[0];
  2573 + // 3、计算起始点到当前点X方向的偏移量.
  2574 + var dx = RDX - drwaStartX;
  2575 + // 4、重新标记起点.
  2576 + drwaStartX = RDX;
  2577 + // 5、获取选中的元素.变量修改其元素属性值与数据.
  2578 + var nodes = d3.selectAll('.caseactive')[0];
  2579 + for(var n = 0; n<nodes.length;n++) {
  2580 + // 5.1、获取遍历的当前元素的元素标签名称.
  2581 + var tagName = $(nodes[n]).get(0).tagName;
  2582 + // 5.2、选择遍历的当前元素对象.
  2583 + var node = d3.select(nodes[n]);
  2584 + // 5.3、获取遍历的当前元素数据.
  2585 + var dt = node.data()[0];
  2586 + /**
  2587 + * 5.4、判断 tagName.
  2588 + *
  2589 + * 5.4.1、 ✿ 如果是rect 则修改X.并修改数据.
  2590 + *
  2591 + * 5.4.2、 ✿ 如果是text 修改文本属性值.
  2592 + *
  2593 + * 5.4.3、 ✿ 如果是circle 修改C.
  2594 + *
  2595 + * 5.4.4、 ✿ 如果是line 修改X1、X2.
  2596 + **/
  2597 + if(tagName=='rect') {
  2598 + // 5.4.1.1、修改遍历的当前元素X坐标属性值.
  2599 + node.attr('x',parseInt(node.attr('x'))+dx);
  2600 + // 5.4.1.2、根据X坐标值转为时刻
  2601 + var tm = RelationshipGraph.zbTosj(parseInt(node.attr('x'))-$_GlobalGraph.configuration.offsetX);
  2602 + // 5.4.1.3、修改遍历的当前元素数据的发车时间.
  2603 + dt.fcsj = tm.hour + ':' + tm.min;
  2604 + // 5.4.1.4、发车时间转时间对象
  2605 + var nowDate = BaseFun.getDateTime(dt.fcsj);
  2606 + // 5.4.1.5、修改时间.
  2607 + nowDate.setMinutes(parseInt(tm.min)+dt.bcsj);
  2608 + // 5.4.1.6、时间对象转字符串时刻.修改到达时间.
  2609 + dt.ARRIVALTIME = BaseFun.getTimeStr(nowDate);
  2610 + }else if(tagName=='text') {
  2611 + // 5.4.2.1、修改遍历的当前文本元素X坐标属性值.
  2612 + node.attr('x',parseInt(node.attr('x'))+dx);
  2613 + if(node.attr('text-type') =='timeslot') {
  2614 + if(dt.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.bd &&
  2615 + dt.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.out &&
  2616 + dt.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.cf &&
  2617 + dt.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.in_ &&
  2618 + dt.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.lc)
  2619 + node.text(dt.fcsj + '~' + dt.ARRIVALTIME);// 5.4.2.2、修改第一行的text文本.发车时间 ~ 到达时间.
  2620 + }
  2621 + }else if(tagName == 'circle'){
  2622 + // 5.4.3.1、修改遍历的当前圆元素CX坐标属性值.
  2623 + node.attr('cx',parseInt(node.attr('cx'))+dx);
  2624 + }else if(tagName=='line') {
  2625 + // 5.4.3.1、修改遍历的当前line线1元素X1坐标属性值.
  2626 + node.attr('x1',parseInt(node.attr('x1'))+dx);
  2627 + // 5.4.3.1、修改遍历的当前line线2元素X1坐标属性值.
  2628 + node.attr('x2',parseInt(node.attr('x2'))+dx);
  2629 + }
  2630 + }
  2631 + // 6、重新统计值.
  2632 + RelationshipGraph.reDrawDepart();
  2633 + }
  2634 + }, {
  2635 + /**
  2636 + * @description : (TODO) 鼠标从选择框中心点按下沿X方向左右拖拽结束事件.
  2637 + *
  2638 + * @status OK.
  2639 + **/
  2640 + key : 'centerMoveStop',
  2641 + value : function centerMoveStop(d,i) {
  2642 + /**
  2643 + * 1、《《《《《《《《判断 是否已经过沿X方向左右拖拽》》》》》》》》
  2644 + *
  2645 + **/
  2646 + if(drwaStartXStatus) {
  2647 + // 1.1、关闭标记鼠标从选择框中心点按下沿X方向进行拖拽状态.
  2648 + drwaStartXStatus = false;
  2649 + // 1.2、保存该操作记录.
  2650 + $_GlobalGraph.addHistory();
  2651 + }
  2652 + }
  2653 + }, {
  2654 + /**
  2655 + * @description : (TODO) 重新绘制发车时刻,并重新统计.
  2656 + *
  2657 + * @status : OK.
  2658 + * */
  2659 + key : 'reDrawDepart',
  2660 + value : function reDrawDepart() {
  2661 + // 1、删除g元素class为up_tick的节点(包括子节点).这里等同与清楚上行的发车时刻.
  2662 + $_GlobalGraph.removeNodes(d3.selectAll('g.up_tick')[0]);
  2663 + // 2、删除g元素class为down_tick的节点(包括子节点).这里等同与清楚下行的发车时刻.
  2664 + $_GlobalGraph.removeNodes(d3.selectAll('g.down_tick')[0]);
  2665 + // 3、获取所有的班次数据.
  2666 + var $_json = $_GlobalGraph.getDataArray();
  2667 + // 4、定义上、下行班次数组.
  2668 + var upArray = new Array(),downArray = new Array();
  2669 + for(var j = 0 ; j< $_json.length ; j++) {
  2670 + // 4.1、判断遍历的当前班次类型是否为normal
  2671 + if($_json[j].bcType== $_GlobalGraph.configuration.dataMap.bcTypeArr.normal) {
  2672 + // 4.2、判断遍历的当前元素方向.
  2673 + if($_json[j].xlDir == $_GlobalGraph.configuration.dataMap.dira[0])
  2674 + upArray.push($_json[j]);
  2675 + else if($_json[j].xlDir == $_GlobalGraph.configuration.dataMap.dira[1])
  2676 + downArray.push($_json[j])
  2677 + }
  2678 + }
  2679 + // 5、定义上、下行发车时刻元素节点集合.
  2680 + var upNodes = $_GlobalGraph.configuration.selection.select('svg').select('g.up').selectAll('.up_tick').data(upArray),
  2681 + downNodes = $_GlobalGraph.configuration.selection.select('svg').select('g.down').selectAll('.down_tick').data(downArray);
  2682 + // 6、绘制上行发车时刻
  2683 + $_GlobalGraph.createUpTime(upNodes);
  2684 + // 7、绘制下行发车时刻
  2685 + $_GlobalGraph.createDownTime(downNodes);
  2686 + // 8、重新统计值.
  2687 + $_GlobalGraph.statistics();
  2688 + }
  2689 + }, {
  2690 + /**
  2691 + * @description : (TODO) 对单个rect元素(班次)做左右拖拽(拖拽开始...).
  2692 + *
  2693 + * @status : OK.
  2694 + **/
  2695 + key : 'singleElementDrawStart',
  2696 + value : function singleElementDrawStart(d,i) {
  2697 + _singElmtDrStartX = d3.mouse(this)[0];// 初始化对单个rect元素进行拖拽时开始点X坐标.
  2698 + }
  2699 + }, {
  2700 + /**
  2701 + * @description : (TODO) 对单个rect元素(班次)做左右拖拽(拖拽中...).
  2702 + *
  2703 + * @status : OK.
  2704 + **/
  2705 + key : 'singleElementDrawRuing',
  2706 + value : function singleElementDrawRuing(d,i) {
  2707 + /**
  2708 + * 1、判断
  2709 + *
  2710 + * ✿ 当前班次是首末班车班次,如果是则不能结束拖拽.(* 根据_singElemtDrStatus状态来判断 除去正在进行拖拽的班次刚好拖拽到首末班次班次的发车时间点.)
  2711 + *
  2712 + * ✿ 当前班次是早晚例保、进出场班次、吃饭班次.如果是则不能结束拖拽.
  2713 + *
  2714 + **/
  2715 + if((RelationshipGraph.issmbc(d.fcsj) ||
  2716 + context.getisContext() ||
  2717 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd ||
  2718 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out ||
  2719 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.cf ||
  2720 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.in_ ||
  2721 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.lc) && !_singElemtDrStatus)
  2722 + return;
  2723 + // 2、拖拽过程隐藏提示工具窗口.
  2724 + $_GlobalGraph.tooltip.hide();
  2725 + // 3、开启标记单个rect元素沿X方向进行拖拽状态.
  2726 + _singElemtDrStatus = true;
  2727 + // 4、获取鼠标在拖拽中的当前坐标点.
  2728 + var RDX = d3.mouse(this)[0];
  2729 + // 5、计算当前鼠标坐标X相对初始点坐标X的偏移量.
  2730 + var dx = RDX - _singElmtDrStartX;
  2731 + // 6、重新赋值初始点坐标X.
  2732 + _singElmtDrStartX = RDX;
  2733 + // 7、根据当前被拖拽的元素rect元素的parent-node属性值 , 来获取当前班次的底层rect元素的相邻两个班次元素的相关信息.
  2734 + var nodeContext = RelationshipGraph.getContextNodeAndData(d3.select(this).attr('parent-node').replace('-cover',''));
  2735 + // 8、计算rect元素的被拖拽后的X坐标值.
  2736 + var chageX = parseInt(nodeContext.qdbcNode.attr('x'))+dx;
  2737 +
  2738 + /****************************************** update 当前的班次数据以及相关元素对象属性值. START ************************************/
  2739 +
  2740 + /**
  2741 + * 9.1、修改当期rect(班次)data数据属性值.
  2742 + *
  2743 + * ✿ 因为rect元素是沿X轴移动的.这里修改的值一般是 [fcsj--发车时间;ARRIVALTIME--到达时间;STOPTIME--停站时间].
  2744 + *
  2745 + * ✿ 因为当前班次的到达时间改变,导致与下个班次的发车时间相隔时间段改变.也就是当前班次停站时间被改变.
  2746 + **/
  2747 + // 9.1.1、根据当前元素的X坐标值等到对应的时刻.
  2748 + var tm = RelationshipGraph.zbTosj(chageX-$_GlobalGraph.configuration.offsetX);
  2749 + // 9.1.2、修改当前班次的发车时间.
  2750 + d.fcsj = tm.hour + ':' + tm.min;
  2751 + // 9.1.3 、定义当前班次的到达时间对象.
  2752 + var nowDate = BaseFun.getDateTime(d.fcsj);
  2753 + nowDate.setMinutes(parseInt(tm.min)+d.bcsj);// 10.3.1、设置分钟.
  2754 + // 9.1.4、修改当前班次的到达时间.
  2755 + d.ARRIVALTIME = BaseFun.getTimeStr(nowDate);
  2756 + d.STOPTIME = parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000);
  2757 + /**
  2758 + * 9.2、修改元素沿X轴方向的X坐标属性值.
  2759 + *
  2760 + * ✿ 这里的元素包括
  2761 + *
  2762 + * 当前被拖拽的元素(覆盖层)、当前被拖拽的元素的底层元素、text元素(文本元素)、circle元素(圆)
  2763 + **/
  2764 + // 9.2.1、修改当前被拖拽的班次rect元素覆盖层的X坐标值.
  2765 + d3.select(this).attr('x',chageX);
  2766 + // 9.2.2、修改当前被拖拽的班次rect底层元素X坐标值.
  2767 + nodeContext.qdbcNode.attr('x',chageX);
  2768 + // 9.2.3、修改当前被拖拽的rect底层元素上的 圆的元素对象.
  2769 + nodeContext.dqbcCircleNode.attr('cx',parseInt(nodeContext.dqbcCircleNode.attr('cx'))+dx);
  2770 + // 9.2.4、遍历text元素,并修改text属性值.
  2771 + for(var n = 0 ; n < nodeContext.dqbctextNodes.length ; n++) {
  2772 + // 9.2.4.1、修改text属性值.
  2773 + RelationshipGraph.changeNode(nodeContext.dqbctextNodes[n],dx,d);
  2774 + }
  2775 + /****************************************** update 当前的班次数据以及相关元素对象属性值. END ************************************/
  2776 +
  2777 + // 10、计算与上个班次的停站时间.
  2778 + var dxMinues = parseInt((BaseFun.getDateTime(d.fcsj) - BaseFun.getDateTime(nodeContext.lastData.ARRIVALTIME)) / 60000);
  2779 +
  2780 + /****************************************** update 上个的班次数据以及相关元素对象属性值. START ************************************/
  2781 +
  2782 + /**
  2783 + * 11、判断上个班次的类型.
  2784 + *
  2785 + * ✿ 11.1、如果是出场班次、吃饭班次 则停站时间为零,也就是说上个班次的到达时间是下个班次的发车时间.
  2786 + *
  2787 + * ✿ 11.2、如果是正常班次
  2788 + *
  2789 + **/
  2790 + if(nodeContext.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out ||
  2791 + nodeContext.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.cf) {
  2792 + /**
  2793 + * 11.1.1、 如果是出场班次、吃饭班次.修改上个班次数据属性值.
  2794 + *
  2795 + * ✿ 需要修改的数据属性值有[发车时间,到达时间].
  2796 + **/
  2797 + // 11.1.1.1、修改上个班次的到达时间.
  2798 + nodeContext.lastData.ARRIVALTIME = d.fcsj;
  2799 + var ddsj = BaseFun.getDateTime(nodeContext.lastData.ARRIVALTIME);
  2800 + ddsj.setMinutes(ddsj.getMinutes() - nodeContext.lastData.bcsj);
  2801 + // 11.1.1.2、修改上个班次的发车时间.
  2802 + nodeContext.lastData.fcsj = BaseFun.getTimeStr(ddsj);
  2803 + /**
  2804 + * 11.1.2、修改上个班次元素的属性值.
  2805 + *
  2806 + **/
  2807 + // 11.1.2.1、修改上个元素的rect覆盖层元素X坐标值.
  2808 + var lastRectCover = d3.select(d3.selectAll('rect[parent-node='+ nodeContext.qdbcNode.attr('last-node') + '-cover' +']')[0][0]);
  2809 + lastRectCover.attr('x',parseInt(lastRectCover.attr('x'))+dx);// 12.2.1.3.1、修改圆的cx属性值.
  2810 + // 11.1.2.2、修改上个元素的rect底层元素X坐标值.
  2811 + nodeContext.lastbcNode.attr('x',parseInt(nodeContext.lastbcNode.attr('x'))+dx);
  2812 + // 11.1.4.3、修改上个元素的rect底层元素上的 圆的元素CX坐标值
  2813 + nodeContext.lastbcCircleNode.attr('cx',parseInt(nodeContext.lastbcCircleNode.attr('cx'))+dx);
  2814 + // 11.1.4.4、遍历上个元素的text元素,并修改text属性值.
  2815 + for(var c = 0 ; c < nodeContext.lastTextNodes.length ; c++) {
  2816 + // 11.1.4.4.1、修改text属性值.
  2817 + RelationshipGraph.changeNode(nodeContext.lastTextNodes[c],dx,nodeContext.lastData);
  2818 + }
  2819 + // 11.1.4.5、获取上上个班次的元素对象.
  2820 + var xxgbcNode = d3.select('rect[id='+ nodeContext.lastbcNode.attr('last-node') +']');
  2821 + // 11.1.4.6、获取上上个班次的数据
  2822 + var xxgbc = xxgbcNode.data()[0];
  2823 +
  2824 + /**
  2825 + * 11.1.4.7、判断 上上个班次类型.
  2826 + *
  2827 + * ✿ 11.1.4.7.1、如果是保养班次.则修改这个班次的到达与发车时间以及元素属性值.
  2828 + *
  2829 + * ✿ 11.1.4.7.2、如果是正常班次.则修改这个班次的停站时间以及元素属性值.
  2830 + *
  2831 + **/
  2832 + if(xxgbc.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd) {
  2833 +
  2834 + /**
  2835 + * 11.1.4.7.1.1、修改上上个班次元素的数据属性值.
  2836 + *
  2837 + **/
  2838 + xxgbc.ARRIVALTIME = nodeContext.lastData.fcsj;// 修改到达时间
  2839 + var xxgbcddsj = BaseFun.getDateTime(xxgbc.ARRIVALTIME);
  2840 + xxgbcddsj.setMinutes(xxgbcddsj.getMinutes() - xxgbc.bcsj);
  2841 + xxgbc.fcsj = BaseFun.getTimeStr(xxgbcddsj);// 修改发车时间
  2842 + /**
  2843 + * 11.1.4.7.1.2、修改上上个班次元素的属性值.
  2844 + *
  2845 + **/
  2846 + xxgbcNode.attr('x',parseInt(xxgbcNode.attr('x'))+dx);// 修改底层rectX坐标值.
  2847 + var xxgbcCircle = d3.select(d3.selectAll('circle[parent-node='+ nodeContext.lastbcNode.attr('last-node') +']')[0][0]);
  2848 + xxgbcCircle.attr('cx',parseInt(xxgbcCircle.attr('cx'))+dx);// 修改圆的cx属性值.
  2849 + var xxgbcRectCover = d3.select(d3.selectAll('rect[parent-node='+ nodeContext.lastbcNode.attr('last-node') + '-cover' +']')[0][0]);
  2850 + xxgbcRectCover.attr('x',parseInt(xxgbcRectCover.attr('x'))+dx);// 修改覆盖层rectX坐标值.
  2851 + var xxgbcTextNodes = d3.selectAll('text[parent-node='+ nodeContext.lastbcNode.attr('last-node') +']')[0];
  2852 + for(var x = 0 ; x < xxgbcTextNodes.length ; x++) {
  2853 + RelationshipGraph.changeNode(xxgbcTextNodes[x],dx,xxgbc);// 修改text属性值.
  2854 + }
  2855 + }else if(xxgbc.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.normal) {
  2856 + /**
  2857 + * 11.1.4.7.2、如果是正常班次.
  2858 + *
  2859 + **/
  2860 + // 11.1.4.7.2.1、修改上上个班次元素的数据停站时间属性值.
  2861 + xxgbc.STOPTIME = parseInt((BaseFun.getDateTime(nodeContext.lastData.fcsj) - BaseFun.getDateTime(xxgbc.ARRIVALTIME)) / 60000);
  2862 + // 11.1.4.7.2.2、修改上上个班次text元素属性值.
  2863 + var _normalxxgbc = d3.selectAll('text[parent-node=' + nodeContext.lastbcNode.attr('last-node') +']')[0];
  2864 + for(var i = 0 ;i < _normalxxgbc.length ;i++) {
  2865 + var normalxxgbcNode_ = d3.select(_normalxxgbc[i]);
  2866 + if(normalxxgbcNode_.attr('text-type')=='gap')
  2867 + normalxxgbcNode_.text('停:' + xxgbc.STOPTIME);
  2868 + }
  2869 + }
  2870 + }else {
  2871 + /**
  2872 + * 11.2.1、如果是正常班次
  2873 + *
  2874 + * ✿ 需要修改的数据属性值有[停站时间].
  2875 + **/
  2876 + // 11.2.1.1、修改上个班次的停站时间.
  2877 + nodeContext.lastData.STOPTIME = dxMinues;
  2878 + /**
  2879 + * 11.2.2、修改上个班次元素的属性值.
  2880 + *
  2881 + **/
  2882 + for(var t = 0 ; t < nodeContext.lastTextNodes.length ;t++) {
  2883 + // 11.2.2.1、修改text元素对象.
  2884 + var lastNode_ = d3.select(nodeContext.lastTextNodes[t]);
  2885 + if(lastNode_.attr('text-type')=='gap')
  2886 + lastNode_.text('停:' + nodeContext.lastData.STOPTIME);// 15.4、修改第三行的text文本. 停站时间.
  2887 + }
  2888 + }
  2889 + /****************************************** update 上个的班次数据以及相关元素对象属性值. END ************************************/
  2890 + // 12、判断停站时间是否小于零.
  2891 + if(nodeContext.lastData.STOPTIME <0 || d.STOPTIME<0)
  2892 + d3.selectAll('text[parent-node='+ nodeContext.qdbcNodeId +']').classed({'alert-danger':true});// 12.1、添加停站时间小零的样式.
  2893 + else
  2894 + d3.selectAll('text[parent-node='+ nodeContext.qdbcNodeId +']').classed({'alert-danger':false});// 12.1、删除停站时间小零的样式.
  2895 + // 13、重新绘制发车时刻,并重新统计.
  2896 + RelationshipGraph.reDrawDepart();
  2897 + }
  2898 + }, {
  2899 + /**
  2900 + * @description : (TODO) 对单个rect元素(班次)做左右拖拽(拖拽结束...).
  2901 + *
  2902 + * @status : OK.
  2903 + *
  2904 + * */
  2905 + key : 'singleElementDrawStop',
  2906 + value : function singleElementDrawStop(d,i) {
  2907 + // 1、先判断是否进行过对该班次元素的拖拽行为.
  2908 + if(_singElemtDrStatus) {
  2909 + // 1.1、关闭标记单个rect元素沿X方向进行拖拽状态.
  2910 + _singElemtDrStatus = false;
  2911 + /**
  2912 + * 1.2、根据当前被拖拽的rect元素的parent-node属性值
  2913 + *
  2914 + * ✿ 获取当前班次的底层rect元素id属性值、以及底层的rect元素对象、以及属于该班次元素的属性值元素对象(circle、text)
  2915 + *
  2916 + * ✿ 获取上个班次的底层rect元素对象与数据. 以及属于该班次元素的属性值元素对象(circle、text).
  2917 + *
  2918 + * ✿ 获取下个班次的底层rect元素对象与数据. 以及属于该班次元素的属性值元素对象(circle、text).
  2919 + *
  2920 + **/
  2921 + var _obj = RelationshipGraph.getContextNodeAndData(d3.select(this).attr('parent-node').replace('-cover',''));
  2922 + // 1.3、定义最小停站间隙.
  2923 + var minSoptTime = $_GlobalGraph.configuration.dataMap.minztjx;
  2924 + // 1.4、创建当前时间对象.
  2925 + var $_date = new Date();
  2926 + // 1.5、判断 如果当前班次的停站时间小于零,则修改成最小停站时间.
  2927 + if(d.STOPTIME<0) {
  2928 + if(_obj.nextData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.in_)
  2929 + minSoptTime= 0;
  2930 + /**
  2931 + * 1.5.1、修改当前班次数据值.
  2932 + *
  2933 + **/
  2934 + $_date = BaseFun.getDateTime(_obj.nextData.fcsj);// 1.5.1.1、时间字符串转时间对象.
  2935 + $_date.setMinutes(parseInt($_date.getMinutes() - minSoptTime));// 1.5.1.2、修改分钟.
  2936 + d.STOPTIME = minSoptTime;// 1.5.1.3、修改当前班次的停站时间.
  2937 + d.ARRIVALTIME = BaseFun.getTimeStr($_date);// 1.5.1.4、修改当前班次的达到时间.
  2938 + $_date.setMinutes($_date.getMinutes()-d.bcsj);// 1.5.1.5、修改分钟.
  2939 + d.fcsj = BaseFun.getTimeStr($_date);// 1.5.1.4、修改当前班次的发车时间.
  2940 + // 1.5.2、计算时刻转rect X轴坐标值.
  2941 + var $_x = parseInt($_date.getHours()-$_GlobalGraph.configuration.dxHours)*60*$_GlobalGraph.configuration.multiple +
  2942 + parseInt($_date.getMinutes())*$_GlobalGraph.configuration.multiple + $_GlobalGraph.configuration.offsetX;
  2943 + /**
  2944 + * 1.5.3、修改当前班次元素属性值.
  2945 + *
  2946 + **/
  2947 + d3.select(this).attr('x',$_x);// 1.5.3.1、修改当前被拖拽元素覆盖层rect元素的X坐标属性值.
  2948 + _obj.qdbcNode.attr('x',$_x);// 1.5.3.2、修改底层rect元素的X坐标属性值.
  2949 + _obj.dqbcCircleNode.attr('cx',parseInt(_obj.qdbcNode.attr('x')) +
  2950 + (d.bcsj) * ($_GlobalGraph.configuration.multiple) - 12);// 1.5.3.3、修改属于当前班次元素的circle元素圆的cx值.
  2951 + var _text = parseInt(_obj.qdbcNode.attr('x')) + (d.bcsj) * ($_GlobalGraph.configuration.multiple) - 18;// 1.5.4、计算时刻转text X轴坐标值.
  2952 + /**
  2953 + * 1.5.4、修改当前班次元素下所属的text元素属性值.
  2954 + *
  2955 + **/
  2956 + for(var n = 0 ; n < _obj.dqbctextNodes.length ; n++) {
  2957 + var _textType = d3.select(_obj.dqbctextNodes[n]).attr('text-type'); // 1.5.4.1、获取当前text元素的类型.
  2958 + if(_textType =='bcType')
  2959 + d3.select(_obj.dqbctextNodes[n]).attr('x',_text);
  2960 + else
  2961 + d3.select(_obj.dqbctextNodes[n]).attr('x',$_x);
  2962 + if(_textType=='timeslot')
  2963 + d3.select(_obj.dqbctextNodes[n]).text(d.fcsj + '~' + d.ARRIVALTIME);
  2964 + else if(_textType=='gap')
  2965 + d3.select(_obj.dqbctextNodes[n]).text('停:' + d.STOPTIME);
  2966 + }
  2967 + if(_obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out ||
  2968 + _obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.cf) {
  2969 + // 11.1.1.1、修改上个班次的到达时间.
  2970 + _obj.lastData.ARRIVALTIME = d.fcsj;
  2971 + var ddsj = BaseFun.getDateTime(_obj.lastData.ARRIVALTIME);
  2972 + ddsj.setMinutes(ddsj.getMinutes() - _obj.lastData.bcsj);
  2973 + // 11.1.1.2、修改上个班次的发车时间.
  2974 + _obj.lastData.fcsj = BaseFun.getTimeStr(ddsj);
  2975 + var last_x = parseInt(ddsj.getHours()-$_GlobalGraph.configuration.dxHours)*60*$_GlobalGraph.configuration.multiple +
  2976 + parseInt(ddsj.getMinutes())*$_GlobalGraph.configuration.multiple + $_GlobalGraph.configuration.offsetX;
  2977 + /**
  2978 + * 11.1.2、修改上个班次元素的属性值.
  2979 + *
  2980 + **/
  2981 + // 11.1.2.1、修改上个元素的rect覆盖层元素X坐标值.
  2982 + var lastRectCover = d3.select(d3.selectAll('rect[parent-node='+ _obj.qdbcNode.attr('last-node') + '-cover' +']')[0][0]);
  2983 + lastRectCover.attr('x',last_x);// 12.2.1.3.1、修改圆的cx属性值.
  2984 + // 11.1.2.2、修改上个元素的rect底层元素X坐标值.
  2985 + _obj.lastbcNode.attr('x',last_x);
  2986 + // 11.1.4.3、修改上个元素的rect底层元素上的 圆的元素CX坐标值
  2987 + _obj.lastbcCircleNode.attr('cx',parseInt(_obj.lastbcNode.attr('x')) +
  2988 + (_obj.lastData.bcsj) * ($_GlobalGraph.configuration.multiple) - 12);// 1.5.3.3、修改属于当前班次元素的circle元素圆的cx值.
  2989 + var _text = parseInt(_obj.lastbcNode.attr('x')) + (_obj.lastData.bcsj) * ($_GlobalGraph.configuration.multiple) - 18;// 1.5.4、计算时刻转text X轴坐标值.
  2990 + // 11.1.4.4、遍历上个元素的text元素,并修改text属性值.
  2991 + for(var n = 0 ; n < _obj.lastTextNodes.length ; n++) {
  2992 + // 11.1.4.4.1、修改text属性值.
  2993 + // RelationshipGraph.changeNode(_obj.lastTextNodes[c],dx,_obj.lastData);
  2994 + var textNode = d3.select(_obj.lastTextNodes[n]);
  2995 + var _textType = textNode.attr('text-type'); // 1.5.4.1、获取当前text元素的类型.
  2996 + if(_textType =='bcType')
  2997 + d3.select(_obj.lastTextNodes[n]).attr('x',_text);
  2998 + else
  2999 + d3.select(_obj.lastTextNodes[n]).attr('x',last_x);
  3000 + if(_textType=='travel') {
  3001 + if(_obj.lastData.bcsj>0) {
  3002 + // 4.2 修改第二行的text文本.
  3003 + if(_obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd ||
  3004 + _obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out ||
  3005 + _obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.in_ ||
  3006 + _obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.lc)
  3007 + textNode.text(_obj.lastData.fcsj);
  3008 + else if(_obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.cf)
  3009 + textNode.text('吃:' + _obj.lastData.bcsj);
  3010 + else
  3011 + textNode.text("行:" + _obj.lastData.bcsj);
  3012 + }
  3013 + }else if(_textType=='gap') {
  3014 + if(_obj.lastData.bcsj>0) {
  3015 + // 4.3 修改第三行的text文本. 停站时间.
  3016 + if(_obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd||
  3017 + _obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.lc)
  3018 + textNode.text('保:' + d.bcsj);
  3019 + else if(_obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out ||
  3020 + _obj.lastData.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.in_)
  3021 + textNode.text('行:' + _obj.lastData.bcsj);
  3022 + else
  3023 + textNode.text('停:' + _obj.lastData.STOPTIME);
  3024 + }
  3025 + }
  3026 + }
  3027 + // 11.1.4.5、获取上上个班次的元素对象.
  3028 + var xxgbcNode = d3.select('rect[id='+ _obj.lastbcNode.attr('last-node') +']');
  3029 + // 11.1.4.6、获取上上个班次的数据
  3030 + var xxgbc = xxgbcNode.data()[0];
  3031 +
  3032 + /**
  3033 + * 11.1.4.7、判断 上上个班次类型.
  3034 + *
  3035 + * ✿ 11.1.4.7.1、如果是保养班次.则修改这个班次的到达与发车时间以及元素属性值.
  3036 + *
  3037 + * ✿ 11.1.4.7.2、如果是正常班次.则修改这个班次的停站时间以及元素属性值.
  3038 + *
  3039 + **/
  3040 + if(xxgbc.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd) {
  3041 +
  3042 + /**
  3043 + * 11.1.4.7.1.1、修改上上个班次元素的数据属性值.
  3044 + *
  3045 + **/
  3046 + xxgbc.ARRIVALTIME = _obj.lastData.fcsj;// 修改到达时间
  3047 + var xxgbcddsj = BaseFun.getDateTime(xxgbc.ARRIVALTIME);
  3048 + xxgbcddsj.setMinutes(xxgbcddsj.getMinutes() - xxgbc.bcsj);
  3049 + xxgbc.fcsj = BaseFun.getTimeStr(xxgbcddsj);// 修改发车时间
  3050 + var xxbgc_x = parseInt(xxgbcddsj.getHours()-$_GlobalGraph.configuration.dxHours)*60*$_GlobalGraph.configuration.multiple +
  3051 + parseInt(xxgbcddsj.getMinutes())*$_GlobalGraph.configuration.multiple + $_GlobalGraph.configuration.offsetX;
  3052 + /**
  3053 + * 11.1.4.7.1.2、修改上上个班次元素的属性值.
  3054 + *
  3055 + **/
  3056 + xxgbcNode.attr('x',xxbgc_x);// 修改底层rectX坐标值.
  3057 + var xxgbcCircle = d3.select(d3.selectAll('circle[parent-node='+ _obj.lastbcNode.attr('last-node') +']')[0][0]);
  3058 + xxgbcCircle.attr('cx',parseInt(xxgbcNode.attr('x')) +
  3059 + (xxgbc.bcsj) * ($_GlobalGraph.configuration.multiple) - 12);// 修改圆的cx属性值.
  3060 + var xxgbcRectCover = d3.select(d3.selectAll('rect[parent-node='+ _obj.lastbcNode.attr('last-node') + '-cover' +']')[0][0]);
  3061 + xxgbcRectCover.attr('x',xxbgc_x);// 修改覆盖层rectX坐标值.
  3062 + var xxgbcTextNodes = d3.selectAll('text[parent-node='+ _obj.lastbcNode.attr('last-node') +']')[0];
  3063 + var _text = parseInt(xxgbcNode.attr('x')) + (xxgbc.bcsj) * ($_GlobalGraph.configuration.multiple) - 18;// 1.5.4、计算时刻转text X轴坐标值.
  3064 + for(var x = 0 ; x < xxgbcTextNodes.length ; x++) {
  3065 + // RelationshipGraph.changeNode(xxgbcTextNodes[x],dx,xxgbc);// 修改text属性值.
  3066 + var textNode = d3.select(xxgbcTextNodes[x]);
  3067 + var _textType = textNode.attr('text-type'); // 1.5.4.1、获取当前text元素的类型.
  3068 + if(_textType =='bcType')
  3069 + d3.select(xxgbcTextNodes[x]).attr('x',_text);
  3070 + else
  3071 + d3.select(xxgbcTextNodes[x]).attr('x',xxbgc_x);
  3072 + if(_textType=='travel') {
  3073 + if(xxgbc.bcsj>0)
  3074 + textNode.text(xxgbc.fcsj);
  3075 + }else if(_textType=='gap') {
  3076 + if(xxgbc.bcsj>0)
  3077 + textNode.text('保:' + xxgbc.bcsj);
  3078 + }
  3079 + }
  3080 + }else if(xxgbc.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.normal) {
  3081 + /**
  3082 + * 11.1.4.7.2、如果是正常班次.
  3083 + *
  3084 + **/
  3085 + // 11.1.4.7.2.1、修改上上个班次元素的数据停站时间属性值.
  3086 + xxgbc.STOPTIME = parseInt((BaseFun.getDateTime(_obj.lastData.fcsj) - BaseFun.getDateTime(xxgbc.ARRIVALTIME)) / 60000);
  3087 + // 11.1.4.7.2.2、修改上上个班次text元素属性值.
  3088 + var _normalxxgbc = d3.selectAll('text[parent-node=' + _obj.lastbcNode.attr('last-node') +']')[0];
  3089 + for(var i = 0 ;i < _normalxxgbc.length ;i++) {
  3090 + var normalxxgbcNode_ = d3.select(_normalxxgbc[i]);
  3091 + if(normalxxgbcNode_.attr('text-type')=='gap')
  3092 + normalxxgbcNode_.text('停:' + xxgbc.STOPTIME);
  3093 + }
  3094 + }
  3095 + }else {
  3096 + /**
  3097 + * 1.5.6、修改上个元素班次与当前班次的停站时间和text元素的文本属性值.
  3098 + *
  3099 + **/
  3100 + _obj.lastData.STOPTIME = parseInt((BaseFun.getDateTime(d.fcsj) - BaseFun.getDateTime(_obj.lastData.ARRIVALTIME)) / 60000);
  3101 + for(var t = 0 ; t < _obj.lastTextNodes.length ;t++) {
  3102 + var nowTextNode = d3.select(_obj.lastTextNodes[t]);
  3103 + if(nowTextNode.attr('text-type')=='gap')
  3104 + d3.select(nowTextNode).text('停:' + _obj.lastData.STOPTIME);
  3105 + }
  3106 + }
  3107 + }else if(_obj.lastData.STOPTIME<0) {
  3108 + _obj.lastData.STOPTIME = minSoptTime;
  3109 + $_date = BaseFun.getDateTime(_obj.lastData.ARRIVALTIME);
  3110 + $_date.setMinutes($_date.getMinutes()+minSoptTime);
  3111 + var $_x = parseInt($_date.getHours()-$_GlobalGraph.configuration.dxHours)*60*$_GlobalGraph.configuration.multiple +
  3112 + parseInt($_date.getMinutes())*$_GlobalGraph.configuration.multiple + $_GlobalGraph.configuration.offsetX;
  3113 + d.fcsj = BaseFun.getTimeStr($_date);
  3114 + $_date.setMinutes($_date.getMinutes()+ d.bcsj);
  3115 + d.ARRIVALTIME = BaseFun.getTimeStr($_date);
  3116 + d3.select(this).attr('x',$_x);
  3117 + _obj.qdbcNode.attr('x',$_x);
  3118 + for(var t = 0 ; t < _obj.lastTextNodes.length ;t++) {
  3119 + var nowlastTextNode = d3.select(_obj.lastTextNodes[t]);
  3120 + if(nowlastTextNode.attr('text-type')=='gap')
  3121 + nowlastTextNode.text('停:' + _obj.lastData.STOPTIME);
  3122 + }
  3123 + _obj.dqbcCircleNode.attr('cx',
  3124 + parseInt(_obj.qdbcNode.attr('x')) + (d.bcsj) * ($_GlobalGraph.configuration.multiple) - 12);// 1.5.3.3、修改属于当前班次元素的circle元素圆的cx值.
  3125 + var _text = parseInt(_obj.qdbcNode.attr('x')) +
  3126 + (d.bcsj) * ($_GlobalGraph.configuration.multiple) - 18;
  3127 + var textNodes = _obj.dqbctextNodes;
  3128 + for(var n = 0 ; n < _obj.dqbctextNodes.length ; n++) {
  3129 + var tn = d3.select(_obj.dqbctextNodes[n]);
  3130 + var _textType = tn.attr('text-type');
  3131 + if(_textType =='bcType')
  3132 + d3.select(textNodes[n]).attr('x',_text);
  3133 + else
  3134 + d3.select(textNodes[n]).attr('x',$_x);
  3135 + if(_textType=='timeslot') {
  3136 + d3.select(_obj.dqbctextNodes[n]).text(d.fcsj + '~' + d.ARRIVALTIME);
  3137 + }else if(_textType=='gap') {
  3138 + d.STOPTIME = parseInt((BaseFun.getDateTime(_obj.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME)) / 60000);
  3139 + d3.select(textNodes[n]).text('停:' + d.STOPTIME);
  3140 + }
  3141 +
  3142 + }
  3143 + }
  3144 + d3.selectAll('text[parent-node='+ _obj.qdbcNodeId +']').classed({'alert-danger':false});
  3145 + RelationshipGraph.reDrawDepart();
  3146 + $_GlobalGraph.addHistory();
  3147 + }
  3148 + }
  3149 + }, {
  3150 + /**
  3151 + * @description : (TODO) 根据一个班次rect元素属性ID值获取上下相邻两个班次的相关信息.
  3152 + *
  3153 + * @params [idValue--某个班次元素对象字符串ID值]
  3154 + *
  3155 + * @returns 返回一个Object
  3156 + *
  3157 + * @status OK.
  3158 + **/
  3159 + key : 'getContextNodeAndData',
  3160 + value : function(idValue) {
  3161 + // 1、定义当前元素班次的底层rect元素.
  3162 + var qdbcNode = d3.select('rect[id='+ idValue +']');
  3163 + // 2、定义当前班次数据.
  3164 + var dqbcData = qdbcNode.data()[0];
  3165 + // 3、定义上个班次、下个班次的ID属性值.
  3166 + var lastbcNodeId = qdbcNode.attr('last-node'),nextbcNodeId = qdbcNode.attr('next-node');
  3167 + // 4、定义上个元素班次的底层rect元素.
  3168 + var lastbcNode = d3.select('rect[id='+ lastbcNodeId +']');
  3169 + // 5、定义上个班次数据.
  3170 + var lastData = lastbcNode.data()[0];
  3171 + // 6、定义下个班次元素对象
  3172 + var nextbcNode = d3.select('rect[id='+ nextbcNodeId +']');
  3173 + // 7、定义下个班次数据.
  3174 + var nextData = nextbcNode.data()[0];
  3175 + return {'qdbcNodeId':idValue,
  3176 + 'qdbcNode':qdbcNode,
  3177 + 'dqbctextNodes':d3.selectAll('text[parent-node='+ idValue +']')[0],// 当前班次元素对象的text文本元素.
  3178 + 'dqbcCircleNode':d3.select(d3.selectAll('circle[parent-node='+ idValue +']')[0][0]),// 当前班次元素对象的circle圆元素
  3179 + 'dqbcData' : dqbcData,
  3180 + 'lastbcNodeId':lastbcNodeId,
  3181 + 'lastbcNode':lastbcNode,
  3182 + 'lastTextNodes': d3.selectAll('text[parent-node='+ lastbcNodeId +']')[0],// 下个班次元素对象的text元素对象
  3183 + 'lastbcCircleNode':d3.select(d3.selectAll('circle[parent-node='+ lastbcNodeId +']')[0][0]),// 下个班次元素对象的circle元素对象
  3184 + 'lastData':lastData,
  3185 + 'nextbcNodeId':nextbcNodeId,
  3186 + 'nextbcNode':nextbcNode,
  3187 + 'nextbctextNodes' : d3.selectAll('text[parent-node='+ nextbcNodeId +']')[0],// 下个班次元素对象的text元素对象
  3188 + 'nextbcCircleNode':d3.select(d3.selectAll('circle[parent-node='+ nextbcNodeId +']')[0][0]),// 下个班次元素对象的circle元素对象
  3189 + 'nextData':nextData
  3190 + };
  3191 + }
  3192 + }, {
  3193 + /**
  3194 + * @description : (TODO) 修改班次属性值.
  3195 + *
  3196 + * @param
  3197 + *
  3198 + * @status OK.
  3199 + *
  3200 + * */
  3201 + key : 'updbcData',
  3202 + value : function updbcData(obj) {
  3203 +
  3204 + }
  3205 + }, {
  3206 + /**
  3207 + * @description : (TODO) 判断是否为首末班车班次.
  3208 + *
  3209 + * @params : [str--时间字符串]
  3210 + *
  3211 + * @return : 返回布尔值.
  3212 + *
  3213 + **/
  3214 + key : 'issmbc',
  3215 + value : function issmbc(str) {
  3216 + var tag = false;
  3217 + var list = $_GlobalGraph.configuration.dataMap.smbcsjArr;// 获取起终点站首末班车时间对成数组
  3218 + var len = list.length;
  3219 + for(var t = 0 ; t<len ; t++) {
  3220 + if(str== list[t].kssj || str == list[t].jssj)
  3221 + tag = true;
  3222 + }
  3223 + return tag;
  3224 + }
  3225 + }, {
  3226 + key : 'zbTosj',
  3227 + value : function zbTosj(_d3x) {
  3228 + var hour = parseInt(_d3x/($_GlobalGraph.configuration.multiple*60)) + $_GlobalGraph.configuration.dxHours;
  3229 + var min = parseInt((_d3x%($_GlobalGraph.configuration.multiple*60))/$_GlobalGraph.configuration.multiple);
  3230 + return {'hour': hour<10? '0' + hour : hour ,'min' : min < 10 ? '0' + min : min};
  3231 +
  3232 + }
  3233 + }, {
  3234 + /**
  3235 + * @description : (TODO) 修改text沿X方向的X坐标属性值和文本内容.
  3236 + *
  3237 + * @status : OK.
  3238 + **/
  3239 + key : 'changeNode',
  3240 + value : function changeNode(node,dx,d) {
  3241 + // 1、获取当前text元素对象.
  3242 + var textNode = d3.select(node);
  3243 + // 2、修改当前text元素的X属性值
  3244 + textNode.attr('x',parseInt(textNode.attr('x'))+dx);
  3245 + // 3、获取当前元素的text-type属性值.
  3246 + var _textType = textNode.attr('text-type');
  3247 + /**
  3248 + * 4、判断当前元素的text-type属性值类型.
  3249 + *
  3250 + * ✿ 如果是timeslot.代表的是第一行的text文本.发车时间 ~ 到达时间
  3251 + *
  3252 + * ✿ 如果是gap.代表的是第三行的text文本. 停站时间.
  3253 + */
  3254 + if(_textType=='timeslot') {
  3255 + // 4.1、修改第一行的text文本.发车时间 ~ 到达时间
  3256 + if(d.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.bd &&
  3257 + d.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.out &&
  3258 + d.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.cf &&
  3259 + d.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.in_ &&
  3260 + d.bcType != $_GlobalGraph.configuration.dataMap.bcTypeArr.lc)
  3261 + textNode.text(d.fcsj + '~' + d.ARRIVALTIME);
  3262 +
  3263 + }else if(_textType=='travel') {
  3264 + if(d.bcsj>0) {
  3265 + // 4.2 修改第二行的text文本.
  3266 + if(d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd ||
  3267 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out ||
  3268 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.in_ ||
  3269 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.lc)
  3270 + textNode.text(d.fcsj);
  3271 + else if(d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.cf)
  3272 + textNode.text('吃:' + d.bcsj);
  3273 + else
  3274 + textNode.text("行:" + d.bcsj);
  3275 + }
  3276 + }else if(_textType=='gap') {
  3277 + if(d.bcsj>0) {
  3278 + // 4.3 修改第三行的text文本. 停站时间.
  3279 + if(d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.bd||
  3280 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.lc)
  3281 + textNode.text('保:' + d.bcsj);
  3282 + else if(d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.out ||
  3283 + d.bcType == $_GlobalGraph.configuration.dataMap.bcTypeArr.in_)
  3284 + textNode.text('行:' + d.bcsj);
  3285 + else
  3286 + textNode.text('停:' + d.STOPTIME);
  3287 + }
  3288 + }
  3289 + }
  3290 + }, {
  3291 + key: 'verifyJson',
  3292 + value: function verifyJson(json) {
  3293 + if (!RelationshipGraph.isArray(json) || json.length < 0 || _typeof(json[0]) !== 'object') {
  3294 + throw 'JSON是JavaScript对象,不为空数组.';
  3295 + }
  3296 + var length = json.length;
  3297 + while (length--) {
  3298 + var element = json[length];
  3299 + var keys = Object.keys(element);
  3300 + var keyLength = keys.length;
  3301 + var parentColor = element.parentColor;
  3302 + if (element.parent === undefined) {
  3303 + throw '孩子没有父节点.';
  3304 + } else if (parentColor !== undefined && (parentColor > 4 || parentColor < 0)) {
  3305 + throw '父节点不支持该颜色.';
  3306 + }
  3307 + while (keyLength--) {
  3308 + if (keys[keyLength].toUpperCase() == 'VALUE') {
  3309 + if (keys[keyLength] != 'value') {
  3310 + json[length].value = json[length][keys[keyLength]];
  3311 + delete json[length][keys[keyLength]];
  3312 + }
  3313 + break;
  3314 + }
  3315 + }
  3316 + }
  3317 + return true;
  3318 + }
  3319 + }]);
  3320 + return RelationshipGraph;
  3321 +}();
  3322 +
  3323 +/** 创建关系图层
  3324 + *
  3325 + * @param {Object} 图层参数配置信息
  3326 + *
  3327 + * @return {Object} 返回创建图层对象
  3328 + *
  3329 + **/
  3330 +d3.selection.prototype.relationshipGraph = function (userConfig) {
  3331 + 'use strict';
  3332 + $_GlobalGraph = new RelationshipGraph(this, userConfig);
  3333 + return $_GlobalGraph;
  3334 +};
  3335 +
  3336 +/**
  3337 + * 全局定义,模块,svgelement
  3338 + *
  3339 + *
  3340 + */
  3341 +(function (root, factory) {
  3342 + 'use strict';
  3343 + if (typeof define === 'function' && define.amd) {
  3344 + define(['d3'], factory);
  3345 + } else if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports) {
  3346 + module.exports = function (d3) {
  3347 + d3.tip = factory(d3);
  3348 + return d3.tip;
  3349 + };
  3350 + } else {
  3351 + window.d3.tip = factory(d3);
  3352 + }
  3353 +})(undefined, function (d3) {
  3354 + 'use strict';
  3355 + return function () {
  3356 + var d3TipDirection = function d3TipDirection() {
  3357 + return 'n';
  3358 + };
  3359 + var d3TipOffset = function d3TipOffset() {
  3360 + return [0, 0];
  3361 + };
  3362 +
  3363 + var d3TipHtml = function d3TipHtml() {
  3364 + return ' ';
  3365 + };
  3366 + var initNode = function initNode() {
  3367 + var node = d3.select(document.createElement('div'));
  3368 + node.style('position', 'absolute').style('top', 0).style('opacity', 0).style('pointer-events', 'none').style('box-sizing', 'border-box');
  3369 + return node.node();
  3370 + };
  3371 + var getNodeEl = function getNodeEl() {
  3372 + if (node === null) {
  3373 + node = initNode();
  3374 + document.body.appendChild(node);
  3375 + }
  3376 +
  3377 + return d3.select(node);
  3378 + };
  3379 + var getScreenBBox = function getScreenBBox() {
  3380 + var targetel = target || d3.event.target;
  3381 +
  3382 + while ('undefined' === typeof targetel.getScreenCTM && 'undefined' === targetel.parentNode) {
  3383 + targetel = targetel.parentNode;
  3384 + }
  3385 +
  3386 + var bbox = {},
  3387 + matrix = targetel.getScreenCTM(),
  3388 + tbbox = targetel.getBBox(),
  3389 + width = tbbox.width,
  3390 + height = tbbox.height,
  3391 + x = tbbox.x,
  3392 + y = tbbox.y;
  3393 +
  3394 + point.x = x;
  3395 + point.y = y;
  3396 + bbox.nw = point.matrixTransform(matrix);
  3397 + point.x += width;
  3398 + bbox.ne = point.matrixTransform(matrix);
  3399 + point.y += height;
  3400 + bbox.se = point.matrixTransform(matrix);
  3401 + point.x -= width;
  3402 + bbox.sw = point.matrixTransform(matrix);
  3403 + point.y -= height / 2;
  3404 + bbox.w = point.matrixTransform(matrix);
  3405 + point.x += width;
  3406 + bbox.e = point.matrixTransform(matrix);
  3407 + point.x -= width / 2;
  3408 + point.y -= height / 2;
  3409 + bbox.n = point.matrixTransform(matrix);
  3410 + point.y += height;
  3411 + bbox.s = point.matrixTransform(matrix);
  3412 + return bbox;
  3413 + };
  3414 + var direction = d3TipDirection,
  3415 + offset = d3TipOffset,
  3416 + html = d3TipHtml,
  3417 + node = initNode(),
  3418 + svg = null,
  3419 + point = null,
  3420 + target = null;
  3421 + var getPageTopLeft = function getPageTopLeft(el) {
  3422 + var rect = el.getBoundingClientRect(),
  3423 + docEl = document.documentElement;
  3424 + return {
  3425 + top: rect.top + (window.pageYOffset || docEl.scrollTop || 0),
  3426 + right: rect.right + (window.pageXOffset || 0),
  3427 + bottom: rect.bottom + (window.pageYOffset || 0),
  3428 + left: rect.left + (window.pageXOffset || docEl.scrollLeft || 0)
  3429 + };
  3430 + };
  3431 + var functor = function functor(val) {
  3432 + return typeof val === 'function' ? val : function () {
  3433 + return val;
  3434 + };
  3435 + };
  3436 + var directionN = function directionN() {
  3437 + var bbox = getScreenBBox();
  3438 + return {
  3439 + top: bbox.n.y - node.offsetHeight,
  3440 + left: bbox.n.x - node.offsetWidth / 2
  3441 + };
  3442 + };
  3443 + var directionS = function directionS() {
  3444 + var bbox = getScreenBBox();
  3445 + return {
  3446 + top: bbox.s.y,
  3447 + left: bbox.s.x - node.offsetWidth / 2
  3448 + };
  3449 + };
  3450 + var directionE = function directionE() {
  3451 + var bbox = getScreenBBox();
  3452 + return {
  3453 + top: bbox.e.y - node.offsetHeight / 2,
  3454 + left: bbox.e.x
  3455 + };
  3456 + };
  3457 + var directionW = function directionW() {
  3458 + var bbox = getScreenBBox();
  3459 + return {
  3460 + top: bbox.w.y - node.offsetHeight / 2,
  3461 + left: bbox.w.x - node.offsetWidth
  3462 + };
  3463 + };
  3464 +
  3465 + var directionNW = function directionNW() {
  3466 + var bbox = getScreenBBox();
  3467 + return {
  3468 + top: bbox.nw.y - node.offsetHeight,
  3469 + left: bbox.nw.x - node.offsetWidth
  3470 + };
  3471 + };
  3472 + var directionNE = function directionNE() {
  3473 + var bbox = getScreenBBox();
  3474 + return {
  3475 + top: bbox.ne.y - node.offsetHeight,
  3476 + left: bbox.ne.x
  3477 + };
  3478 + };
  3479 + var directionSW = function directionSW() {
  3480 + var bbox = getScreenBBox();
  3481 + return {
  3482 + top: bbox.sw.y,
  3483 + left: bbox.sw.x - node.offsetWidth
  3484 + };
  3485 + };
  3486 +
  3487 + var directionSE = function directionSE() {
  3488 + var bbox = getScreenBBox();
  3489 + return {
  3490 + top: bbox.se.y,
  3491 + left: bbox.e.x
  3492 + };
  3493 + };
  3494 + var direction_callbacks = d3.map({
  3495 + n: directionN,
  3496 + s: directionS,
  3497 + e: directionE,
  3498 + w: directionW,
  3499 + nw: directionNW,
  3500 + ne: directionNE,
  3501 + sw: directionSW,
  3502 + se: directionSE
  3503 + }),
  3504 + directions = direction_callbacks.keys();
  3505 + var getSVGNode = function getSVGNode(el) {
  3506 + el = el.node();
  3507 + if (el.tagName.toLowerCase() === 'svg') {
  3508 + return el;
  3509 + }
  3510 + return el.ownerSVGElement;
  3511 + };
  3512 + var tip = function tip(vis) {
  3513 + svg = getSVGNode(vis);
  3514 + point = svg.createSVGPoint();
  3515 + document.body.appendChild(node);
  3516 + };
  3517 + tip.show = function () {
  3518 + var _this = this;
  3519 + var args = Array.prototype.slice.call(arguments);
  3520 + if (args[args.length - 1] instanceof SVGElement) {
  3521 + target = args.pop();
  3522 + }
  3523 + var content = html.apply(_this, args),
  3524 + poffset = offset.apply(_this, args),
  3525 + nodel = getNodeEl(),
  3526 + scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
  3527 + scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft;
  3528 + var coords = void 0,
  3529 + dir = direction.apply(_this, args),
  3530 + i = directions.length;
  3531 +
  3532 + tipEventTimer = setTimeout(function(e) {
  3533 + nodel.html(content).style('position', 'absolute').style('opacity', 1).style('pointer-events', 'all');
  3534 + },500);
  3535 +
  3536 + var node = nodel._groups ? nodel._groups[0][0] : nodel[0][0],
  3537 + nodeWidth = node.clientWidth,
  3538 + nodeHeight = node.clientHeight,
  3539 + windowWidth = window.innerWidth,
  3540 + windowHeight = window.innerHeight,
  3541 + elementCoords = getPageTopLeft(_this),
  3542 + breaksTop = elementCoords.top - nodeHeight < 0,
  3543 + breaksLeft = elementCoords.left - nodeWidth < 0,
  3544 + breaksRight = elementCoords.right + nodeHeight > windowWidth,
  3545 + breaksBottom = elementCoords.bottom + nodeHeight > windowHeight;
  3546 + if (breaksTop && !breaksRight && !breaksBottom && breaksLeft) {
  3547 + dir = 'e';
  3548 + } else if (breaksTop && !breaksRight && !breaksBottom && !breaksLeft) {
  3549 + dir = 's';
  3550 + } else if (breaksTop && breaksRight && !breaksBottom && !breaksLeft) {
  3551 + dir = 'w';
  3552 + } else if (!breaksTop && !breaksRight && !breaksBottom && breaksLeft) {
  3553 + dir = 'e';
  3554 + } else if (!breaksTop && !breaksRight && breaksBottom && breaksLeft) {
  3555 + dir = 'e';
  3556 + } else if (!breaksTop && !breaksRight && breaksBottom && !breaksLeft) {
  3557 + dir = 'e';
  3558 + } else if (!breaksTop && breaksRight && breaksBottom && !breaksLeft) {
  3559 + dir = 'n';
  3560 + } else if (!breaksTop && breaksRight && !breaksBottom && !breaksLeft) {
  3561 + dir = 'w';
  3562 + }
  3563 + direction(dir);
  3564 + while (i--) {
  3565 + nodel.classed(directions[i], false);
  3566 + }
  3567 + coords = direction_callbacks.get(dir).apply(_this);
  3568 + nodel.classed(dir, true).style('top', coords.top + poffset[0] + scrollTop + 'px').style('left', coords.left + poffset[1] + scrollLeft + 'px');
  3569 + return tip;
  3570 + };
  3571 + tip.hide = function () {
  3572 + clearTimeout(tipEventTimer);
  3573 + var nodel = getNodeEl();
  3574 + nodel.style('opacity', 0).style('pointer-events', 'none');
  3575 + return tip;
  3576 + };
  3577 + tip.attr = function (n) {
  3578 + if (arguments.length < 2 && typeof n === 'string') {
  3579 + return getNodeEl().attr(n);
  3580 + } else {
  3581 + var args = Array.prototype.slice.call(arguments);
  3582 + d3.selection.prototype.attr.apply(getNodeEl(), args);
  3583 + }
  3584 +
  3585 + return tip;
  3586 + };
  3587 + tip.style = function (n) {
  3588 + if (arguments.length < 2 && typeof n === 'string') {
  3589 + return getNodeEl().style(n);
  3590 + } else {
  3591 + var args = Array.prototype.slice.call(arguments);
  3592 +
  3593 + if (args.length === 1) {
  3594 + var styles = args[0],
  3595 + keys = Object.keys(styles);
  3596 +
  3597 + for (var key = 0; key < keys.length; key++) {
  3598 + d3.selection.prototype.style.apply(getNodeEl(), styles[key]);
  3599 + }
  3600 + }
  3601 + }
  3602 +
  3603 + return tip;
  3604 + };
  3605 + tip.direction = function (v) {
  3606 + if (!arguments.length) {
  3607 + return direction;
  3608 + }
  3609 + direction = v == null ? v : functor(v);
  3610 + return tip;
  3611 + };
  3612 + tip.offset = function (v) {
  3613 + if (!arguments.length) {
  3614 + return offset;
  3615 + }
  3616 + offset = v == null ? v : functor(v);
  3617 + return tip;
  3618 + };
  3619 + tip.html = function (v) {
  3620 + if (!arguments.length) {
  3621 + return html;
  3622 + }
  3623 + html = v == null ? v : functor(v);
  3624 + return tip;
  3625 + };
  3626 + tip.destroy = function () {
  3627 + if (node) {
  3628 + getNodeEl().remove();
  3629 + node = null;
  3630 + }
  3631 + return tip;
  3632 + };
  3633 + return tip;
  3634 + };
  3635 +});
0 3636 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/gantt.js 0 → 100644
  1 +(function() {
  2 + // 全屏模式点击事件.
  3 + $(document).on('click','.fullscreen',function() {
  4 + if($('.ganttSvgContainer').height()>400)
  5 + $('.ganttSvgContainer').css('height','400px');
  6 + else
  7 + $('.ganttSvgContainer').css('height','99%');
  8 + });
  9 + // 获取已存在的该时刻表明细数据.
  10 + var objD = window.localStorage.isDoDate;
  11 + // 获取表单参数配置数据.
  12 + var map = JSON.parse(window.localStorage.Gantt_AgursData);
  13 + // 延迟500毫秒执行.
  14 + setTimeout(function(){
  15 + // 1、定义开始与结束时间点字符串.
  16 + var seMap = getStartAndEndDate(map);
  17 + // 2、获取开始与结束时间对象.
  18 + /*var seDate = getksjssj(null,seMap.s.split('-')[0]);*/
  19 + var seDate = getksjssj(null,seMap.s);
  20 + // 3、定义周转时间.
  21 + map.zzsj = parseInt(getzzsj(map));
  22 + // 5、方向代码.
  23 + var dirA = getsxxDM();
  24 + // 6、班次类型.
  25 + var bcTypeArr = getbcType();
  26 + // 7、参数配置信息.
  27 + var dataMap = argsMap(map,dirA,bcTypeArr,seMap);
  28 + // 8、定义最大车辆数与停站时间.
  29 + var CSMap = null,data = null;
  30 + if(map.baseRes== '0') {
  31 + CSMap = getMaxCarAndStopSpace0(map,seMap);
  32 + }else if(map.baseRes== '1') {
  33 + CSMap = getMaxCarAndStopSpace1(map);
  34 + }
  35 + // 发车间隙
  36 + map.stopSpace = CSMap.stopSpace;
  37 + // 定义时间参数.
  38 + var stopAraay = getsj(map);
  39 + if(isNull(objD)) {
  40 + if(map.baseRes== '0') {
  41 + // 采用客流数据获取渲染时刻表明细图形的配置参数数据.
  42 + data = BaseFun.KLplaceClassesTime(CSMap.gattA,stopAraay,CSMap.maxCar,map,seMap,dataMap);
  43 + }else if(map.baseRes== '1') {
  44 + // 采用班型人次数据获取渲染时刻表明细图形的配置参数数据.
  45 + data = BaseFun.BXPplaceClassesTime(stopAraay,CSMap.maxCar,map,seMap,dataMap);
  46 + }
  47 +
  48 + }else {
  49 + // 使用已有的时刻表明细数据渲染视图.
  50 + data = JSON.parse(objD);
  51 + }
  52 + // 创建甘特图对象.
  53 + var graph = d3.select('#ganttSvg').relationshipGraph(
  54 + getGraphArgus({'ganttInitParams': map,'yAxisCarArray':CSMap.maxCar,
  55 + 'startDateTime':seDate.kssj,'endDateTime':seDate.jssj,'stopAraay':stopAraay,'dataMap':dataMap,'bxrcgs':data.bxrcgs}));
  56 + // 渲染数据.
  57 + graph.data(data.json);
  58 + // 记录操作记录.
  59 + graph.addHistory();
  60 + // 初始化右键菜单.
  61 + contextInit(graph);
  62 + },500);
  63 +
  64 + /**
  65 + * @description : (TODO) 根据客流数据分析各个时间段内的配车数、获取发车间隙与车辆数的最大值.
  66 + *
  67 + * @param [map--表单参数;seMap--开始与结束时间字符串点].
  68 + *
  69 + * @returns 返回一个分装时间段内的车辆数、发车间隙、车辆数的最大值集合.
  70 + * */
  71 + function getMaxCarAndStopSpace0(map,seMap) {
  72 + var sortGattA = BaseFun.sortGattDate([{'type':'sm','num':parseInt(map.zgfbeforepcs),'time':seMap.s + '-' + seMap.e},
  73 + {'type':'et','num':parseInt(map.wgfafterpcs),'time':map.earlyStartTime + '-' + seMap.e},
  74 + {'type':'me','num':parseInt(map.gfzjpcs),'time':map.earlyEndTime + '-' + map.lateStartTime},
  75 + {'type':'mm','num':parseInt(map.zgfpcs),'time':map.earlyStartTime + '-' + map.earlyEndTime},
  76 + {'type':'ee','num':parseInt(map.wgfpcs),'time':map.lateStartTime + '-' + map.lateEndTime}]);
  77 + return {'gattA':sortGattA,'stopSpace': Math.round(map.zzsj/sortGattA[sortGattA.length-1].num) ,'maxCar':getyArray(sortGattA)};
  78 + }
  79 +
  80 + /**
  81 + * @description : (TODO) 根据班型与人次得到发车间隙、车辆数的最大值.
  82 + *
  83 + * @param [map--表单参数].
  84 + *
  85 + * @returns 返回一个分装发车间隙、车辆数的最大值集合.
  86 + * */
  87 + function getMaxCarAndStopSpace1(map) {
  88 + return {'gattA':null,'stopSpace': Math.round(map.zzsj/map.clzs),'maxCar':BaseFun.getYAxisCarArray(parseInt(map.clzs))};
  89 + }
  90 +
  91 + /**
  92 + * @description : (TODO) 封装方向成对的数据集合.
  93 + *
  94 + * @param [gatps--表单数据;dira--方向集合;bcTypeArr--班次类型集合]
  95 + *
  96 + * @returns 返回一个封装方向成对的数据集合.
  97 + * */
  98 + function argsMap(gatps,dira,bcTypeArr,seMap) {
  99 + return {'jcsjArr' : BaseFun.formatPairing(gatps.upInTimer,gatps.downInTimer),// 进场里程。[下标0代表上;下标1代表下]
  100 + 'ccsjArr' : BaseFun.formatPairing(gatps.upOutTimer,gatps.downOutTimer),// 出场时间。[下标0代表上;下标1代表下]
  101 + 'jclcArr' : BaseFun.formatPairing(gatps.upInMileage,gatps.downInMileage),// 进场里程。[下标0代表上;下标1代表下]
  102 + 'cclcArr' : BaseFun.formatPairing(gatps.upOutMileage,gatps.downOutMileage),// 出场里程。[下标0代表上;下标1代表下]
  103 + 'pcxssjArr' : BaseFun.formatPairing(gatps.upTravelTime,gatps.downTravelTime),// 平常行驶时间。[下标0代表上;下标1代表下]
  104 + 'gfxxsjArr' : BaseFun.formatPairing(gatps.lateUpTime,gatps.lateDownTime),// 高峰行驶时间。[下标0代表上;下标1代表下]
  105 + 'pcxslcArr' : BaseFun.formatPairing(gatps.upMileage,gatps.downMileage),// 行驶里程。[下标0代表上;下标1代表下]
  106 + 'qdzArr' : BaseFun.qzdz(gatps.up_s.split('_')[0],gatps.down_s.split('_')[0]),// 起始站。[下标0代表上;下标1代表下]
  107 + 'zdzArr':BaseFun.qzdz(gatps.up_s.split('_')[1],gatps.down_s.split('_')[1]),// 终点站。[下标0代表上;下标1代表下]
  108 + 'zwcArr' : BaseFun.formatPairing(gatps.workeLunch,gatps.workeDinner),// 午晚餐时间。[下标0代表午;下标1代表晚]
  109 + 'smbcsjArr' : BaseFun.formatksjssj(gatps), // 起终点站首末班车时间.[下标0代表起始站的首末班车时间;下标1代表终点站的首末班车时间]
  110 + 'zgfsjd' : BaseFun.getsd(BaseFun.getDateTime(gatps.earlyStartTime),
  111 + BaseFun.getDateTime(gatps.earlyEndTime)), // 早高峰时间段
  112 + 'wgfsjd' : BaseFun.getsd(BaseFun.getDateTime(gatps.lateStartTime),
  113 + BaseFun.getDateTime(gatps.lateEndTime)),// 晚高峰时间段
  114 + 'gfzjsjd' : BaseFun.getsd(BaseFun.getDateTime(gatps.earlyEndTime),
  115 + BaseFun.getDateTime(gatps.lateStartTime)),//高峰之间时间段.
  116 + 'wgfzhsjd' : BaseFun.getsd(BaseFun.getDateTime(gatps.lateEndTime),
  117 + BaseFun.getDateTime(seMap.e)),// 晚高峰之后时间段
  118 + 'zgfzqsjd': BaseFun.getsd(BaseFun.getDateTime(seMap.s),
  119 + BaseFun.getDateTime(gatps.earlyStartTime)),//早高峰之前时间段.
  120 + 'dira' : dira,// 方向集合 [下标0代表上;下标1代表下]
  121 + 'bcTypeArr' : bcTypeArr,// 班次类型
  122 + 'lbsj' : gatps.lb=='' ? 0:parseInt(gatps.lb),// 例保时间.
  123 + 'minztjx' : parseInt(gatps.mixstopTime), // 最小停站时间.
  124 + 'map' : gatps,
  125 + };
  126 + }
  127 +
  128 + /**
  129 + * @description : (TODO) 获取周转时间.
  130 + *
  131 + * @params [map--表单配置参数].
  132 + *
  133 + * @return 返回一个周转时间.
  134 + * */
  135 + function getzzsj(map) {
  136 + // 一圈所用时间 (上行+下行+停歇时间)
  137 + return parseInt(map.upTravelTime) + parseInt(map.stopTime)*2 + parseInt(map.downTravelTime);
  138 + }
  139 +
  140 + /**
  141 + * @description : (TODO) 获取开始与结束时间字符串.
  142 + *
  143 + * @param [map--表单配置参数]
  144 + *
  145 + * @return 返回开始与结束时间字符串集合.
  146 + * */
  147 + function getStartAndEndDate(map) {
  148 + return {'s':getMinDate(map.startStationFirstTime,map.endStationFirstTime),
  149 + 'e':getMaxDate(map.startStationEndTime,map.endStationEndTime)}
  150 + }
  151 +
  152 + /**
  153 + * @description : (TODO) 获取最小时间.
  154 + *
  155 + * @param [d1--时间1;d2--时间2]
  156 + *
  157 + * @return 返回一个最小时间.
  158 + * */
  159 + function getMinDate(d1,d2) {
  160 + var str = '';
  161 + if(strToTime(d1)>strToTime(d2))
  162 + str = d2;
  163 + else
  164 + str = d1;
  165 + return str;
  166 + }
  167 +
  168 + /**
  169 + * @description : (TODO) 字符串时间点转时间对象.
  170 + *
  171 + * @param [t--字符串时间]
  172 + *
  173 + * @return 返回一个时间对象.
  174 + * */
  175 + function strToTime(t) {
  176 + var d = new Date();
  177 + if(t) {
  178 + var _str = t.split(':');
  179 + d.setHours(parseInt(_str[0]));
  180 + d.setMinutes(parseInt(_str[1]));
  181 + }
  182 + return d;
  183 + }
  184 +
  185 + /**
  186 + * @description : (TODO) 获取最大时间.
  187 + *
  188 + * @param [d1--时间1;d2--时间2]
  189 + *
  190 + * @return 返回一个最大时间.
  191 + * */
  192 + function getMaxDate(d1,d2) {
  193 + var str = '';
  194 + if(strToTime(d1)>strToTime(d2))
  195 + str = d1;
  196 + else
  197 + str = d2;
  198 + return str;
  199 + }
  200 +
  201 + /**
  202 + * @description : (TODO) 获取开始与结束时间对象.
  203 + *
  204 + * @param [d--日期;str--时间点字符串]
  205 + *
  206 + * @return 返回一个开始与结束时间的集合对象.
  207 + * */
  208 + function getksjssj(d,str) {
  209 + var newDate = new Date();
  210 + if(d !=null && d !='' && typeof(d) != 'undefined' ) {
  211 + newDate = new Date(d.replace(/-/g,"/"));
  212 + }
  213 + var kssj = d3.time.hour.offset(BaseFun.getEndDate(
  214 + newDate.getFullYear()+ "-" +
  215 + (newDate.getMonth()+1) + "-" +
  216 + newDate.getDate() + ' ' +
  217 + str.split(':')[0] + ':00'),-1);
  218 +
  219 + var year = '' , month = '',dt = '';
  220 + if(newDate.getDate()+1>31)
  221 + dt = '01';
  222 + else
  223 + dt = newDate.getDate()+1;
  224 + if(newDate.getMonth()+1>12)
  225 + month = '01';
  226 + else if(newDate.getDate()+1>31)
  227 + month = newDate.getMonth()+2;
  228 + else
  229 + month = newDate.getMonth()+1;
  230 + if(newDate.getMonth()+1>12)
  231 + year = newDate.getFullYear()+1;
  232 + else
  233 + year = newDate.getFullYear();
  234 + var jssj = BaseFun.getEndDate(year + '-' + month + '-' + dt + ' ' + '00:00');
  235 + return {'kssj' : kssj, 'jssj' : jssj};
  236 +
  237 + }
  238 +
  239 + /**
  240 + * @description : (TODO) 获取时间参数配置信息
  241 + *
  242 + * @param [map--表单配置参数]
  243 + *
  244 + * @returns 返回一个时间参数配置数据.
  245 + * */
  246 + function getsj(map) {
  247 + var sxsj = parseInt(map.upTravelTime);// 上行时间.
  248 + var xxsj = parseInt(map.downTravelTime);// 下行时间.
  249 + return [{'tzjx':parseInt(map.stopTime), // 停站间隙.
  250 + 'fcjx':parseInt(map.stopSpace),// 发车间隙.
  251 + 'sxsj':sxsj,// 上行时间.
  252 + 'xxsj':xxsj,// 下行时间.
  253 + 'zzsj':map.zzsj,// 周转时间.
  254 + 'wcsj':parseInt(map.workeLunch),// 午餐时间.
  255 + 'wcsj':parseInt(map.workeDinner),// 晚餐时间.
  256 + 'zgfsxsj':map.earlyUpTime==''? sxsj : parseInt(map.earlyUpTime),// 早高峰上行行驶时间.
  257 + 'zgfxxsj':map.earlyDownTime=='' ? xxsj : parseInt(map.earlyDownTime),// 早高峰下行行驶时间.
  258 + 'wgfsxsj':map.lateUpTime=='' ? sxsj : parseInt(map.lateUpTime),// 晚高峰上行行驶时间.
  259 + 'wgfxxsj':map.lateDownTime== '' ? xxsj: parseInt(map.lateDownTime),// 晚高峰下行行驶时间.
  260 + 'sxjcsj':map.upInTimer == '' ? 0 : parseInt(map.upInTimer),// 上行进场时间.
  261 + 'sxccsj':map.upOutTimer == '' ? 0 : parseInt(map.upOutTimer),// 上行出场时间.
  262 + 'xxjcsj':map.downInTimer =='' ? 0 : parseInt(map.downInTimer),// 下行进场时间.
  263 + 'xxccsj':map.downOutTimer =='' ? 0 : parseInt(map.downOutTimer),// 下行进场时间.
  264 + 'sxjclc':map.upInMileage==''? 0 : parseInt(map.upInMileage),// 上行进场里程.
  265 + 'sxcclc':map.upOutMileage==''? 0:parseInt(map.upOutMileage),// 上行出场里程.
  266 + 'xxjclc':map.downInMileage==''? 0 : parseInt(map.downInMileage),// 下行进场里程.
  267 + 'xxcclc':map.downOutMileage==''?0:parseInt(map.downOutMileage),// 下行出场里程.
  268 + 'lbsj': map.lb==''? 0 : parseInt(map.lb) // 例保时间.
  269 + }];
  270 + }
  271 +
  272 + /**
  273 + * @description : (TODO) 获取方向代码.
  274 + *
  275 + * @param [sx--上行;xx--下行].
  276 + *
  277 + * @returns 返回一个方向集合对象.
  278 + * */
  279 + function getsxxDM(sx,xx) {
  280 + return [sx == null || sx == '' || typeof(sx)=='undefined' ? 'relationshipGraph-up' : sx,
  281 + xx == null || xx == '' || typeof(sx)=='undefined' ? 'relationshipGraph-down': xx];
  282 + }
  283 +
  284 + /**
  285 + * @description : (TODO) 获取班次类型.
  286 + *
  287 + * @param [bd--早例保;out--出场;normal--正常;cf--吃饭;in_--进场;lc--晚例保;major--放站;venting--直放;region--区间].
  288 + *
  289 + * @returns 返回一个班次类型集合对象.
  290 + * */
  291 + function getbcType(bd,out,normal,cf,in_,lc,major,venting,region) {
  292 + return {'bd' : bd == null || bd == '' || typeof(bd)=='undefined' ? 'bd' : bd,
  293 + 'out': out == null || out == '' || typeof(out)=='undefined' ? 'out' : out,
  294 + 'normal': normal == null || normal == '' || typeof(normal)=='undefined' ? 'normal' : normal,
  295 + 'cf': cf == null || cf == '' || typeof(cf)=='undefined' ? 'cf' : cf,
  296 + 'in_': in_ == null || in_ == '' || typeof(in_)=='undefined' ? 'in' : in_,
  297 + 'lc': lc == null || lc == '' || typeof(lc)=='undefined' ? 'lc' : lc,
  298 + 'major': major == null || major == '' || typeof(major)=='undefined' ? 'major' : major,
  299 + 'venting': venting == null || venting == '' || typeof(venting)=='undefined' ? 'venting' : venting,
  300 + 'region': region == null || region == '' || typeof(region)=='undefined' ? 'region' : region,};
  301 + }
  302 +
  303 + /**
  304 + * @description : (TODO) 获取车辆最大数值.
  305 + *
  306 + * @param [arr-数组]
  307 + *
  308 + * @returns 返回车辆数最大值.
  309 + * */
  310 + function getyArray(arr) {
  311 + // 获取车辆最大数,作为Y轴的值
  312 + return BaseFun.getYAxisCarArray(arr[arr.length-1].num);
  313 + }
  314 +
  315 + /**
  316 + * @description : (TODO) 验证参数是否为空.
  317 + *
  318 + * @param [args--需要验证的参数]
  319 + *
  320 + * @return 返回一个布尔值.
  321 + * */
  322 + function isNull(agrs) {
  323 + var tag = false;
  324 + if(agrs==null || agrs=='' || agrs=='null')
  325 + tag = true;
  326 + return tag;
  327 + }
  328 +
  329 + /**
  330 + * @description : (TODO) 获取路牌编码.
  331 + *
  332 + * @param [arr--路牌对象集合]
  333 + *
  334 + * @return 返回一个路牌编码数组集合.
  335 + * */
  336 + function getylp(arr) {
  337 + var ra = new Array();
  338 + for(var i = 0 ; i<arr.length;i++) {
  339 + ra.push(arr[i].lpNo);
  340 + }
  341 + return ra;
  342 + }
  343 + /**
  344 + * @description : (TODO) 获取甘特图参数配置信息.
  345 + *
  346 + * @param [p--配置参数]
  347 + *
  348 + * @return 返回甘特图的参数配置信息.
  349 + * */
  350 + function getGraphArgus(p) {
  351 + var VALUEKEYNAME = 'Worldwide Gross',MULTIPLE = Math.round(105/parseInt(p.stopAraay[0].sxsj)) >=4 ? Math.round(90/parseInt(p.stopAraay[0].sxsj)) : 3 ,
  352 + DXHOURS = 24,MINUTE = 60,WIDTH = DXHOURS*MINUTE,MARGINLEFT = 380,HEIGHT = p.yAxisCarArray.length*60 + 240,
  353 + MARGINBOTTOM = 240,OFFSETX = 90,OFFSETY = 180,OFFSETUPY = 120,OFFSETDOWNY = 60,
  354 + STARTDATETIME = p.startDateTime ,ENDDATETIME = p.endDateTime ,TASKTYPES =p.yAxisCarArray ,TICKFORMAT ='%H:%M' ,SHOWTOOLTIPS = true;
  355 + var dx_time = p.endDateTime.getTime() - p.startDateTime.getTime() ;
  356 + // 计算出相差天数
  357 + var days=Math.floor(dx_time/(24*3600*1000));
  358 + // 计算出小时数
  359 + var leave1=dx_time%(24*3600*1000); //计算天数后剩余的毫秒数
  360 + var hours=Math.floor(leave1/(3600*1000));
  361 + DXHOURS = days*24+hours;
  362 + WIDTH = DXHOURS*MINUTE*MULTIPLE;
  363 + var args = {
  364 + 'valueKeyName': VALUEKEYNAME,
  365 + 'hours' : DXHOURS,
  366 + 'dxHours' : 24 - DXHOURS,
  367 + 'multiple': MULTIPLE,
  368 + 'width':WIDTH,
  369 + 'widtMargin':MARGINLEFT,
  370 + 'height':HEIGHT,
  371 + 'heightMargin':MARGINBOTTOM,
  372 + 'offsetX':OFFSETX,
  373 + 'offsetY':OFFSETY,
  374 + 'downDy':OFFSETDOWNY,
  375 + 'upDy':OFFSETUPY,
  376 + 'timeDomainStart' :STARTDATETIME,
  377 + 'timeDomainEnd' : ENDDATETIME,
  378 + 'startStr':'' + STARTDATETIME,
  379 + 'endStr': '' +ENDDATETIME,
  380 + 'taskTypes': TASKTYPES,
  381 + 'lpNoA':getylp(p.yAxisCarArray),
  382 + 'tickFormat': TICKFORMAT,
  383 + 'stopAraay' : p.stopAraay,
  384 + 'dataMap':p.dataMap,
  385 + 'showTooltips': SHOWTOOLTIPS,
  386 + 'bxrcgs':p.bxrcgs
  387 + }
  388 + return args;
  389 + }
  390 +
  391 + /**
  392 + * @descirption : (TODO) 初始化右击rect元素右键菜单栏.
  393 + *
  394 + * @status OK.
  395 + * */
  396 + function contextInit(graph) {
  397 + // 初始化context.
  398 + context.init({preventDoubleContext: true});
  399 + // 设置参数.
  400 + context.settings({compress: false});
  401 + // 设置菜单栏的内容.
  402 + context.attach('rect', [
  403 + {text: '修改',action: function(e){
  404 + // 弹出层mobal页面
  405 + $.get('/pages/base/timesmodel/edit-detail.html', function(m){
  406 + $(pjaxContainer).append(m);
  407 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  408 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  409 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  410 + // 显示修改班次片段.
  411 + $('#editDetail_mobal').trigger('editDetailMobal.show',[graph,nodeContext,BaseFun,map]);
  412 + });
  413 + }},
  414 + {text: '删除',action: function(e){
  415 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  416 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  417 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  418 + // 判断当前班次类型.
  419 + if(isType(nodeContext.dqbcData.bcType,graph,'删除',null,null))
  420 + return;
  421 + layer.confirm('您确定要删除【路牌'+ nodeContext.dqbcData.lpName +'-->发车序号'+ nodeContext.dqbcData.fcno +'】当前班次嘛!'+
  422 + '</br>【注意】:如需要撤销当前操作,您可以在系统工具下拉选择点击【撤销按钮】进行恢复.', {
  423 + btn : [ '确认提示并提交', '取消' ]
  424 + }, function() {
  425 + // 关闭弹出层.
  426 + layer.closeAll();
  427 + // 删除rect底层元素
  428 + d3.select('rect[id='+ nodeContext.qdbcNodeId +']').remove();
  429 + // 删除text元素.
  430 + d3.selectAll('text[parent-node='+ nodeContext.qdbcNodeId +']').remove();
  431 + // 删除圆.
  432 + d3.selectAll('circle[parent-node='+ nodeContext.qdbcNodeId +']').remove();
  433 + // 删除当前选择右键菜单rect元素.
  434 + d3.selectAll('rect.selected').remove();
  435 + var data = new Array();
  436 + // 判断删除的班次是否为出场后或者进场前的班次.如果是,则需要重新定义进出场和早晚例保.
  437 + if(nodeContext.lastData.bcType==graph.configuration.dataMap.bcTypeArr.out ||
  438 + nodeContext.nextData.bcType==graph.configuration.dataMap.bcTypeArr.in_) {
  439 + // 获取所有班次. 定义当前路牌下的所有班次、其他路牌下的班次.
  440 + var dtAll = graph.getDataArray(),dqlpbc = new Array,qtlpbc = new Array();
  441 + // 遍历分割班次.
  442 + for(var t = 0 ; t< dtAll.length; t++) {
  443 + // 判断遍历的当前班次路牌是否与选中修改的班次路牌是否一致.
  444 + if(dtAll[t].lpNo == nodeContext.dqbcData.lpNo)
  445 + dqlpbc.push(dtAll[t]);
  446 + else
  447 + qtlpbc.push(dtAll[t]);
  448 + }
  449 + // 首先除去进出场班次和早晚例保班次.定义进出出场和早晚例保班次数组、正常(包括正常、区间、直放、吃饭、放站)班次数组.
  450 + var jcclbbcA = Array(),normalA = new Array();
  451 + for(var d = 0 ; d < dqlpbc.length; d++) {
  452 + if(dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.bd ||
  453 + dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.in_||
  454 + dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.lc ||
  455 + dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.out)
  456 + jcclbbcA.push(dqlpbc[d]);
  457 + else
  458 + normalA.push(dqlpbc[d]);
  459 + }
  460 + // 把当前路牌下的班次按发车序号顺序排序.
  461 + normalA.sort(function(a,b){return a.fcno-b.fcno});
  462 + // 先添加进出场班次和早晚例保班次-->然后合并其他班次-->然后重置发车序号和班次数-->根据数据重新渲染视图.
  463 + data = BaseFun.setbcsAndfcno(qtlpbc.concat(BaseFun.addjclbbc(normalA,graph.configuration.dataMap,graph.configuration.stopAraay[0].lbsj,map)));
  464 + }else {
  465 + data = graph.getDataArray();
  466 + }
  467 + // 获取图形数据.重新绘制.
  468 + graph.data(data);
  469 + // 记录当前操作.
  470 + graph.addHistory();
  471 + stateSuccess('删除');
  472 + });
  473 + }},
  474 + {text: '设为上行',action: function(e){
  475 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  476 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  477 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  478 + // 判断是否重复设置.
  479 + if(nodeContext.dqbcData.xlDir == graph.configuration.dataMap.dira[0]) {
  480 + layer.msg('当前选择的班次已是【上行班次】,不能重复设置!');
  481 + return;
  482 + }
  483 + trimDir(graph,nodeContext,graph.configuration.dataMap.dira[0],graph.configuration.dataMap.dira[1]);
  484 + stateSuccess('设置成为上行');
  485 + }},
  486 + {text: '设为下行',action: function(e){
  487 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  488 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  489 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  490 + // 判断是否重复设置.
  491 + if(nodeContext.dqbcData.xlDir == graph.configuration.dataMap.dira[1]) {
  492 + layer.msg('当前选择的班次已是【下行班次】,不能重复设置!');
  493 + return;
  494 + }
  495 + trimDir(graph,nodeContext,graph.configuration.dataMap.dira[1],graph.configuration.dataMap.dira[0]);
  496 + stateSuccess('设置成为下行');
  497 + }},
  498 + {text: '设为正常',action: function(e){
  499 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  500 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  501 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  502 + // 获取当前班次的数据.
  503 + var dqbcData = nodeContext.dqbcData;
  504 + // 判断当前班次类型.
  505 + if(isType(dqbcData.bcType,graph,'设为正常班次',graph.configuration.dataMap.bcTypeArr.normal,'已是正常班次'))
  506 + return;
  507 + dqbcData.bcType = graph.configuration.dataMap.bcTypeArr.normal;
  508 + graph.data(graph.getDataArray());
  509 + graph.addHistory();
  510 + stateSuccess('设置成为正常班次');
  511 + }},
  512 + {text: '设为区间',action: function(e){
  513 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  514 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  515 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  516 + // 获取当前班次的数据.
  517 + var dqbcData = nodeContext.dqbcData;
  518 + // 判断当前班次类型.
  519 + if(isType(dqbcData.bcType,graph,'设为区间班次',graph.configuration.dataMap.bcTypeArr.region,'已是区间班次'))
  520 + return;
  521 + dqbcData.bcType = graph.configuration.dataMap.bcTypeArr.region;
  522 + graph.data(graph.getDataArray());
  523 + graph.addHistory();
  524 + stateSuccess('设置成为区间班次');
  525 + }},
  526 + {text: '设为分班', action: function(e){
  527 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  528 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  529 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  530 + // 获取当前班次的数据.
  531 + var dqbcData = nodeContext.dqbcData;
  532 + // 判断当前班次类型.
  533 + if(isType(dqbcData.isfb,graph,'设为分班',1,'已是分班班次'))
  534 + return;
  535 + /*if(dqbcData.isfb == 1) {
  536 + layer.msg('当前选择的班次【已是分班】班次.不能重复设置!');
  537 + return;
  538 + }*/
  539 + dqbcData.isfb = 1;
  540 + graph.data(graph.getDataArray());
  541 + graph.addHistory();
  542 + stateSuccess('设置成为分班');
  543 + }},
  544 + {text: '取消分班', action: function(e){
  545 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  546 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  547 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  548 + // 获取当前班次的数据.
  549 + var dqbcData = nodeContext.dqbcData;
  550 + // 判断当前班次类型.
  551 + if(isType(dqbcData.isfb,graph,'设为分班',0,'不是分班班次'))
  552 + return;
  553 + /*if(dqbcData.isfb == 0) {
  554 + layer.msg('当前选择的班次【不是分班】班次.不能重复设置!');
  555 + return;
  556 + }*/
  557 + dqbcData.isfb = 0;
  558 + graph.data(graph.getDataArray());
  559 + graph.addHistory();
  560 + stateSuccess('取消分班');
  561 + }},
  562 + {text: '设为直放', action: function(e){
  563 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  564 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  565 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  566 + // 获取当前班次的数据.
  567 + var dqbcData = nodeContext.dqbcData;
  568 + // 判断当前班次类型.
  569 + if(isType(dqbcData.bcType,graph,'设为直放班次',graph.configuration.dataMap.bcTypeArr.venting,'已是直放班次'))
  570 + return;
  571 + dqbcData.bcType = graph.configuration.dataMap.bcTypeArr.venting;
  572 + graph.data(graph.getDataArray());
  573 + graph.addHistory();
  574 + stateSuccess('设置成为直放班次');
  575 + }},
  576 + {text: '设为放站', action: function(e){
  577 + // 获取当前班次以及相邻班次的信息.(包括元素与数据).
  578 + var nodeContext = RelationshipGraph.getContextNodeAndData(
  579 + d3.select('rect.selected').attr('parent-node').replace('-cover',''));
  580 + // 获取当前班次的数据.
  581 + var dqbcData = nodeContext.dqbcData;
  582 + // 判断当前班次类型.
  583 + if(isType(dqbcData.bcType,graph,'设为放站班次',graph.configuration.dataMap.bcTypeArr.major,'已是放站班次'))
  584 + return;
  585 + dqbcData.bcType = graph.configuration.dataMap.bcTypeArr.major;
  586 + graph.data(graph.getDataArray());
  587 + graph.addHistory();
  588 + stateSuccess('设置成为放站班次');
  589 + }},
  590 + ]);
  591 + }
  592 +
  593 + function trimDir(graph,nodeContext,dqDir,tzDir) {
  594 + // 获取所有班次. 定义当前路牌下的所有班次、其他路牌下的班次.
  595 + var dtAll = graph.getDataArray(),dqlpbc = new Array,qtlpbc = new Array();
  596 + // 遍历分割班次.
  597 + for(var t = 0 ; t< dtAll.length; t++) {
  598 + // 判断遍历的当前班次路牌是否与选中修改的班次路牌是否一致.
  599 + if(dtAll[t].lpNo == nodeContext.dqbcData.lpNo)
  600 + dqlpbc.push(dtAll[t]);
  601 + else
  602 + qtlpbc.push(dtAll[t]);
  603 + }
  604 + // 首先除去进出场班次和早晚例保班次.定义进出出场和早晚例保班次数组、正常(包括正常、区间、直放、吃饭、放站)班次数组.
  605 + var jcclbbcA = Array(),normalA = new Array();
  606 + for(var d = 0 ; d < dqlpbc.length; d++) {
  607 + if(dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.bd ||
  608 + dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.in_||
  609 + dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.lc ||
  610 + dqlpbc[d].bcType==graph.configuration.dataMap.bcTypeArr.out)
  611 + jcclbbcA.push(dqlpbc[d]);
  612 + else
  613 + normalA.push(dqlpbc[d]);
  614 + }
  615 + // 修改当前路牌下的班次方向.
  616 + for(var r = 0; r<normalA.length;r++) {
  617 + // 修改方向.
  618 + if(normalA[r].xlDir == dqDir) {
  619 + normalA[r].xlDir = tzDir;
  620 + }else if(normalA[r].xlDir == tzDir) {
  621 + normalA[r].xlDir = dqDir;
  622 + }
  623 + }
  624 + // 把当前路牌下的班次按发车序号顺序排序.
  625 + normalA.sort(function(a,b){return a.fcno-b.fcno});
  626 + // 先添加进出场班次和早晚例保班次-->然后合并其他班次-->然后重置发车序号和班次数-->根据数据重新渲染视图.
  627 + graph.data(BaseFun.setbcsAndfcno(qtlpbc.concat(BaseFun.addjclbbc(normalA,graph.configuration.dataMap,graph.configuration.stopAraay[0].lbsj,map))));
  628 + // graph.data(BaseFun.addjclbbc(normalA,graph.configuration.dataMap,graph.configuration.stopAraay[0].lbsj,map));
  629 + // 记录当前操作.
  630 + graph.addHistory();
  631 + }
  632 +
  633 + function isType(bcType,graph,msg,inType,opr) {
  634 + var tag = false ;
  635 + layer.closeAll();
  636 + if(bcType==graph.configuration.dataMap.bcTypeArr.bd) {
  637 + layer.msg('当前选择的班次是【早例保时间】不能'+ msg +'!');
  638 + tag = true;
  639 + }else if(bcType==graph.configuration.dataMap.bcTypeArr.cf) {
  640 + layer.msg('当前选择的班次是【吃饭时间】不能'+ msg +'!');
  641 + tag = true;
  642 + }else if(bcType==graph.configuration.dataMap.bcTypeArr.in_) {
  643 + layer.msg('当前选择的班次是【进场班次】不能'+ msg +'!');
  644 + tag = true;
  645 + }else if(bcType==graph.configuration.dataMap.bcTypeArr.lc) {
  646 + layer.msg('当前选择的班次是【晚例保时间】不能'+ msg +'!');
  647 + tag = true;
  648 + }else if(bcType==graph.configuration.dataMap.bcTypeArr.out) {
  649 + layer.msg('当前选择的班次是【出场班次】不能' + msg + '!');
  650 + tag = true;
  651 + }else if(bcType==inType) {
  652 + layer.msg('当前选择的班次【'+ opr +'】,不能重复设置!');
  653 + tag = true;
  654 + }
  655 + return tag;
  656 + }
  657 +
  658 + /**
  659 + * @description : (TODO) 左菜单操作成功状态反馈.
  660 + *
  661 + * @param [msg--消息状态]
  662 + * */
  663 + function stateSuccess(msg) {
  664 + layer.closeAll();
  665 + layer.msg('操作成功!已【'+ msg + '】!');
  666 + }
  667 +})();
0 668 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/tagsinput.js 0 → 100644
  1 +var ComponentsBootstrapTagsinput = function() {
  2 + var handleDemo2 = function() {
  3 + var elt = $('#state_tagsinput');
  4 + elt.tagsinput({
  5 + tagClass: function(item) {
  6 + switch (item.continent) {
  7 + case '六工一休':
  8 + return 'label label-primary';
  9 + case '五工一休':
  10 + return 'label label-danger label-important';
  11 + case '五工二休':
  12 + return 'label label-purple';
  13 + case '四工一休':
  14 + return 'label label-default';
  15 + case '三工一休':
  16 + return 'label label-warning';
  17 + case '二工一休':
  18 + return 'label label-success';
  19 + case '一工一休':
  20 + return 'label label-info';
  21 + case '无工休':
  22 + return 'label label-yellow-gold';
  23 + }
  24 + },
  25 + itemValue: 'value',
  26 + itemText: 'text'
  27 + });
  28 + $('#state_tagsinput_add').on('click', function(){
  29 + var bctypeValue = $('#state_tagsinput_bctype').val();
  30 + var rcnum = $('#state_tagsinput_value').val();
  31 + if(isNull(bctypeValue,rcnum)) {
  32 + elt.tagsinput('add', {
  33 + "value": bctypeValue + '/' + rcnum,
  34 + "text": bctypeValue + '/' + rcnum,
  35 + "continent": bctypeValue,
  36 + });
  37 + $('#state_tagsinput_bctype').val(null);
  38 + $('#state_tagsinput_value').val(null);
  39 + }
  40 + });
  41 +
  42 + var isNull = function(v1,v2) {
  43 + var tag = true;
  44 + if(v1==''|| v2=='')
  45 + tag = false;
  46 + return tag;
  47 + }
  48 + }
  49 + return {
  50 + init: function() {
  51 + handleDemo2();
  52 + }
  53 + };
  54 +}();
0 55 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/reladplus.html 0 → 100644
  1 +<!-- 添加班次参数 -->
  2 +<div class="modal fade" id="reladplus_mobal" tabindex="-1" role="basic" aria-hidden="true">
  3 + <div class="modal-dialog">
  4 + <div class="modal-content">
  5 + <div class="modal-header">
  6 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
  7 + <h4 class="modal-title">添加班次参数</h4>
  8 + </div>
  9 + <div class="modal-body">
  10 + <form class="form-horizontal" action="/" method="post" id="reladplus" role="form">
  11 + <!-- alert-danger 组件START -->
  12 + <div class="alert alert-danger display-hide" id="reladplusname">
  13 + <button class="close" data-close="alert"></button>
  14 + 您的输入有误,请检查下面的输入项
  15 + </div>
  16 + <!-- 圈数 -->
  17 + <div class="form-group" id="formRequ">
  18 + <label class="col-md-3 control-label"><span class="required"> * </span>圈数:</label>
  19 + <div class="col-md-9">
  20 + <input type="number" class="form-control input-medium" id="lapNumberInput" name="lapNumber">
  21 + </div>
  22 + </div>
  23 + <!-- 所属车辆 -->
  24 + <div class="form-group" id="formRequ">
  25 + <label class="col-md-3 control-label"><span class="required"> * </span>所属车辆:</label>
  26 + <div class="col-md-9">
  27 + <select name="theCar" class="form-control input-medium" id="theCarSelect">
  28 + </select>
  29 + </div>
  30 + </div>
  31 + </form>
  32 + </div>
  33 + <div class="modal-footer">
  34 + <button type="button" class="btn default" data-dismiss="modal">取消</button>
  35 + <button type="button" class="btn btn-primary" id="reladplusnext">确定</button>
  36 + </div>
  37 + </div>
  38 + </div>
  39 +</div>
  40 +<script type="text/javascript">
  41 +/**
  42 + * @description : (TODO) 触发被选元素的指定事件类型。
  43 + *
  44 + * @params [obj--图形对象;bf--函数集合对象;cardata--路牌对应的Y轴坐标数组]
  45 + *
  46 + * @status OK.
  47 + */
  48 +$('#reladplus_mobal').on('reladplusMobal.show', function(e,obj,bf,cardata){
  49 + // 延迟200毫秒执行.
  50 + setTimeout(function(){
  51 + // 加载显示mobal
  52 + $('#reladplus_mobal').modal({show : true,backdrop: 'static', keyboard: false});
  53 + },200);
  54 + // 当模态框对用户可见时触发(将等待 CSS 过渡效果完成)。
  55 + $('#reladplus_mobal').on('show.bs.modal', function () {
  56 + // 初始化路牌下拉选择框.
  57 + var options = '<option value="">-- 请选择路牌 --</option>';
  58 + $.each(cardata, function(i,d){
  59 + options += '<option value="'+d.lpA.lpNo+'">'+d.carname+'</option>';
  60 + });
  61 + $('#theCarSelect').html(options);
  62 + // 初始化圈数.
  63 + $('#lapNumberInput').val(1);
  64 + });
  65 + // 获取表单元素
  66 + var form = $('#reladplus');
  67 + // 错误提示元素
  68 + var reladplusname = $('#reladplusname', form);
  69 + // 下一步点击事件
  70 + $('#reladplusnext').on('click', function() {
  71 + form.submit();// 表单提交
  72 + });
  73 + // 表单验证
  74 + form.validate({
  75 + errorElement : 'span',
  76 + errorClass : 'help-block help-block-error',
  77 + focusInvalid : false,
  78 + rules : {
  79 + 'lapNumber' : {required : true,number : true,digits : true},
  80 + 'theCar' : {required : true,},
  81 +
  82 + },
  83 + invalidHandler : function(event, validator) {
  84 + reladplusname.show();
  85 + App.scrollTo(reladplusname, -200);
  86 + },
  87 + highlight : function(element) {
  88 + $(element).closest('.form-group').addClass('has-error');
  89 + },
  90 + unhighlight : function(element) {
  91 + $(element).closest('.form-group').removeClass('has-error');
  92 + },
  93 + success : function(label) {
  94 + label.closest('.form-group').removeClass('has-error');
  95 + },
  96 + submitHandler : function(f) {
  97 + // 获取表单内容,并序列化.
  98 + var params = form.serializeJSON();
  99 + // 获取当前班次数组集合.
  100 + var jsonArray = obj.getDataArray();
  101 + // 得到该路牌下最后一个班次对象
  102 + var zhbcA = bf.getLastTime(jsonArray,params.theCar);
  103 + if(zhbcA.length>0) {
  104 + var lastObj = zhbcA[0];
  105 + // 定义停站时间
  106 + var tzsj = obj.configuration.stopAraay[0].tzjx;
  107 + // 定义开始时间
  108 + var kssj = new Date(),strArray = lastObj.ARRIVALTIME.split(':');
  109 + kssj.setHours(parseInt(strArray[0]));
  110 + kssj.setMinutes(parseInt(strArray[1])+tzsj);
  111 + // 定义班次序号
  112 + var xhNo = lastObj.fcno+1;
  113 + // 添加班次
  114 + bf.addbc(obj,lastObj,kssj,tzsj,xhNo,jsonArray,params.lapNumber*2);
  115 + // 调整班次数组.并重新给定班次序号和发车序号.再确定首末班车时间.最后渲染数据
  116 + obj.data(bf.tzsmbcsj(bf.setbcsAndfcno(bf.upd_Array(jsonArray,kssj,obj.configuration.dataMap,params.theCar,lastObj,lastObj.fcno+params.lapNumber*2)),
  117 + obj.configuration.dataMap.smbcsjArr,
  118 + obj.configuration.dataMap.ccsjArr,
  119 + obj.configuration.dataMap.cclcArr,
  120 + obj.configuration.dataMap.qdzArr,
  121 + obj.configuration.dataMap.lbsj));
  122 + }else if(zhbcA.length==0){
  123 + obj.data(jsonArray.concat(bf.addlpbc(obj,bf,params.theCar,parseInt(params.lapNumber)*2)));
  124 + }
  125 + // 记录早操.并保存历史班次数据
  126 + obj.addHistory();
  127 + // 隐藏错误提示
  128 + reladplusname.hide();
  129 + // 隐藏 reladplus_mobal 弹出层
  130 + $('#reladplus_mobal').modal('hide');
  131 + layer.msg('操作成功!已添加班次到路牌【'+ params.theCar +'】的最后!');
  132 + }
  133 + });
  134 +});
  135 +</script>
0 136 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/tepms/bctype_temp.html 0 → 100644
  1 +<script type="text/html" id = "bctype_temp">
  2 +<!-- 表单分组组件 form-group START -->
  3 +<div class="form-group">
  4 + <!-- 起始站首班时间 (* 必填项) START -->
  5 + <div class="col-md-4">
  6 + <label class="control-label col-md-5">
  7 + <span class="required"> * </span> 起始站首班时间:
  8 + </label>
  9 + <div class="col-md-5">
  10 + <input type="text" class="form-control" name="startStationFirstTime" value="{{map.line.startStationFirstTime}}" id="qdzsbsjInput"
  11 + placeholder="请输入起始站首班时间">
  12 + </div>
  13 + </div>
  14 + <!-- 起始站首班时间 (* 必填项) END -->
  15 + <!-- 起始站末班时间 (* 必填项) START -->
  16 + <div class="col-md-4">
  17 + <label class="control-label col-md-5">
  18 + <span class="required"> * </span> 起始站末班时间:
  19 + </label>
  20 + <div class="col-md-5">
  21 + <input type="text" class="form-control" name="startStationEndTime" value="{{map.line.startStationEndTime}}" id="qdzmbsjInput"
  22 + placeholder="请输入起始站末班时间">
  23 + </div>
  24 + </div>
  25 + <!-- 起始站末班时间 (* 必填项) END -->
  26 +
  27 + <!-- 终点站首班时间 (* 必填项) START -->
  28 + <div class="col-md-4">
  29 + <label class="control-label col-md-5">
  30 + <span class="required"> * </span> 终点站首班时间:
  31 + </label>
  32 + <div class="col-md-5">
  33 + <input type="text" class="form-control" name="endStationFirstTime" value="{{map.line.endStationFirstTime}}" id="zdzsbsjInput"
  34 + placeholder="请输入终点站首班时间">
  35 + </div>
  36 + </div>
  37 + <!-- 终点站首班时间 (* 必填项) END -->
  38 +</div>
  39 +<!-- 表单分组组件 form-group END -->
  40 +
  41 +<!-- 表单分组组件 form-group START -->
  42 +<div class="form-group">
  43 + <!-- 终点站末班时间 (* 必填项) START -->
  44 + <div class="col-md-4">
  45 + <label class="control-label col-md-5">
  46 + <span class="required"> * </span> 终点站末班时间:
  47 + </label>
  48 + <div class="col-md-5">
  49 + <input type="text" class="form-control" name="endStationEndTime" value="{{map.line.endStationEndTime}}" id="zdzmbsjInput"
  50 + placeholder="请输入终点站末班时间">
  51 + </div>
  52 + </div>
  53 + <!-- 终点站末班时间 (* 必填项) END -->
  54 + <!-- 早高峰开始时间 (* 必填项) START -->
  55 + <div class="col-md-4">
  56 + <label class="control-label col-md-5">
  57 + <span class="required"> * </span> 早高峰开始时间:
  58 + </label>
  59 + <div class="col-md-5">
  60 + <input type="text" class="form-control" name="earlyStartTime" value="{{map.earlyStartTime}}" id="zgfkssjInput"
  61 + placeholder="请输入早高峰开始时间">
  62 + </div>
  63 + </div>
  64 + <!-- 早高峰开始时间 (* 必填项) END -->
  65 + <!-- 早高峰结束时间 (* 必填项) START -->
  66 + <div class="col-md-4">
  67 + <label class="control-label col-md-5">
  68 + <span class="required"> * </span> 早高峰结束时间:
  69 + </label>
  70 + <div class="col-md-5">
  71 + <input type="text" class="form-control" name="earlyEndTime" value="{{map.earlyEndTime}}" id="zgfjssjInput"
  72 + placeholder="请输入早高峰结束时间">
  73 + </div>
  74 + </div>
  75 + <!-- 早高峰结束时间 (* 必填项) END -->
  76 +</div>
  77 +<!-- 表单分组组件 form-group END -->
  78 +
  79 +<!-- 表单分组组件 form-group START -->
  80 +<div class="form-group">
  81 + <!-- 晚高峰开始时间 (* 必填项) START -->
  82 + <div class="col-md-4">
  83 + <label class="control-label col-md-5">
  84 + <span class="required"> * </span> 晚高峰开始时间:
  85 + </label>
  86 + <div class="col-md-5">
  87 + <input type="text" class="form-control" name="lateStartTime" value="{{map.lateStartTime}}" id="wgfkssjInput"
  88 + placeholder="请输入晚高峰开始时间">
  89 + </div>
  90 + </div>
  91 + <!-- 晚高峰开始时间 (* 必填项) END -->
  92 + <!-- 晚高峰结束 (* 必填项) START -->
  93 + <div class="col-md-4">
  94 + <label class="control-label col-md-5">
  95 + <span class="required"> * </span> 晚高峰结束时间:
  96 + </label>
  97 + <div class="col-md-5">
  98 + <input type="text" class="form-control" name="lateEndTime" value="{{map.lateEndTime}}" id="wgfjssjInput"
  99 + placeholder="请输入晚高峰结束时间">
  100 + </div>
  101 + </div>
  102 + <!-- 晚高峰结束 (* 必填项) END -->
  103 + <!-- 上行行驶时间(* 必填项) START -->
  104 + <div class="col-md-4">
  105 + <label class="control-label col-md-5">
  106 + <span class="required"> * </span> 上行行驶时间&nbsp;&nbsp;&nbsp;:
  107 + </label>
  108 + <div class="col-md-5">
  109 + <input type="text" class="form-control" name="upTravelTime" value="{{map.upTravelTime}}" id="upTravelTimeInput"
  110 + placeholder="请输入上行行驶时间">
  111 + </div>
  112 + </div>
  113 + <!-- 上行行驶时间 (* 必填项) END -->
  114 +</div>
  115 +<!-- 表单分组组件 form-group END -->
  116 +
  117 +<!-- 表单分组组件 form-group START -->
  118 +<div class="form-group">
  119 + <!-- 下行行驶时间 (* 必填项) START -->
  120 + <div class="col-md-4">
  121 + <label class="control-label col-md-5">
  122 + <span class="required"> * </span> 下行行驶时间&nbsp;&nbsp;&nbsp;:
  123 + </label>
  124 + <div class="col-md-5">
  125 + <input type="text" class="form-control" name="downTravelTime" value="{{map.downTravelTime}}" id="downTravelTimeInput"
  126 + placeholder="请输入下行行驶时间">
  127 + </div>
  128 + </div>
  129 + <!-- 下行行驶时间(* 必填项) END -->
  130 + <!-- 上行里程(* 必填项) START -->
  131 + <div class="col-md-4">
  132 + <label class="control-label col-md-5">
  133 + <span class="required"> * </span> 上行行驶里程&nbsp;&nbsp;&nbsp;:
  134 + </label>
  135 + <div class="col-md-5">
  136 + <input type="text" class="form-control" name="upMileage" value="{{map.upMileage}}" id="upMileageInput"
  137 + placeholder="请输入上行行驶里程">
  138 + </div>
  139 + </div>
  140 + <!-- 上行里程 (* 必填项) END -->
  141 + <!-- 下行里程 (* 必填项) START -->
  142 + <div class="col-md-4">
  143 + <label class="control-label col-md-5">
  144 + <span class="required"> * </span> 下行行驶里程&nbsp;&nbsp;&nbsp;:
  145 + </label>
  146 + <div class="col-md-5">
  147 + <input type="text" class="form-control" name="downMileage" value="{{map.downMileage}}" id="downMileageInput"
  148 + placeholder="请输入下行行驶里程">
  149 + </div>
  150 + </div>
  151 + <!-- 下行里程(* 必填项) END -->
  152 +</div>
  153 +<!-- 表单分组组件 form-group END -->
  154 +
  155 +<!-- 表单分组组件 form-group START -->
  156 +<div class="form-group">
  157 + <!-- 停站间隙 (* 必填项) START -->
  158 + <div class="col-md-4">
  159 + <label class="control-label col-md-5">
  160 + <span class="required"> * </span> 平时停站间隙&nbsp;&nbsp;&nbsp;:
  161 + </label>
  162 + <div class="col-md-5">
  163 + <input type="text" class="form-control" name="stopTime" value="{{map.stopTime}}" id="stopTimeInput"
  164 + placeholder="请输入停站间隙">
  165 + </div>
  166 + </div>
  167 + <!-- 停站间隙 (* 必填项) END -->
  168 + <!-- 最大停站间隙(* 必填项) START -->
  169 + <div class="col-md-4">
  170 + <label class="control-label col-md-5">
  171 + <span class="required"> * </span> 最大停站间隙&nbsp;&nbsp;&nbsp;:
  172 + </label>
  173 + <div class="col-md-5">
  174 + <input type="text" class="form-control" name="maxstopTime" value="{{map.maxstopTime}}" id="maxstopTimeInput"
  175 + placeholder="请输入最大停站间隙">
  176 + </div>
  177 + </div>
  178 + <!-- 最大停站间隙 (* 必填项) END -->
  179 + <!-- 最小停站间隙(* 必填项) START -->
  180 + <div class="col-md-4">
  181 + <label class="control-label col-md-5">
  182 + <span class="required"> * </span> 最小停站间隙&nbsp;&nbsp;&nbsp;:
  183 + </label>
  184 + <div class="col-md-5">
  185 + <input type="text" class="form-control" name="mixstopTime" value="{{map.mixstopTime}}" id="mixstopTimeInput" placeholder="最小停站间隙">
  186 + </div>
  187 + </div>
  188 + <!-- 最小停站间隙(* 必填项) END -->
  189 +</div>
  190 +<!-- 表单分组组件 form-group END -->
  191 +
  192 +<!-- 表单分组组件 form-group START -->
  193 +<div class="form-group">
  194 + <!-- 停车场(* 必填项) START -->
  195 + <div class="col-md-4">
  196 + <label class="control-label col-md-5">停车场&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  197 + <div class="col-md-5">
  198 + <select name="carPark" class="form-control" id="carParkSelect" style="width:100%"></select>
  199 + </div>
  200 + </div>
  201 + <!-- 停车场(* 必填项) END -->
  202 + <!-- 早高峰上行时间(* 必填项) START -->
  203 + <div class="col-md-4">
  204 + <label class="control-label col-md-5">早高峰上行时间:</label>
  205 + <div class="col-md-5">
  206 + <input type="text" class="form-control" name="earlyUpTime" value="{{map.earlyUpTime}}" id="earlyUpTimeInput"
  207 + placeholder="请输入早高峰上行时间">
  208 + </div>
  209 + </div>
  210 + <!-- 早高峰上行时间(* 必填项) END -->
  211 + <!-- 早高峰下行时间(* 必填项) START -->
  212 + <div class="col-md-4">
  213 + <label class="control-label col-md-5">早高峰下行时间:</label>
  214 + <div class="col-md-5">
  215 + <input type="text" class="form-control" name="earlyDownTime" value="{{map.earlyDownTime}}" id="earlyDownTimeInput"
  216 + placeholder="请输入早高峰下行时间">
  217 + </div>
  218 + </div>
  219 + <!-- 早高峰下行时间(* 必填项) END -->
  220 +</div>
  221 +<!-- 表单分组组件 form-group END -->
  222 +
  223 +<!-- 表单分组组件 form-group START -->
  224 +<div class="form-group">
  225 + <!-- 晚高峰上行时间 (* 必填项) START -->
  226 + <div class="col-md-4">
  227 + <label class="control-label col-md-5">晚高峰上行时间:</label>
  228 + <div class="col-md-5">
  229 + <input type="text" class="form-control" name="lateUpTime" value="{{map.lateUpTime}}" id="lateUpTimeInput"
  230 + placeholder="请输入晚高峰上行时间">
  231 + </div>
  232 + </div>
  233 + <!-- 晚高峰上行时间(* 必填项) END -->
  234 + <!-- 晚高峰下行时间 (* 必填项) START -->
  235 + <div class="col-md-4">
  236 + <label class="control-label col-md-5">晚高峰下行时间:</label>
  237 + <div class="col-md-5">
  238 + <input type="text" class="form-control" name="lateDownTime" value="{{map.lateDownTime}}" id="lateDownTimeInput"
  239 + placeholder="请输入晚高峰下行时间">
  240 + </div>
  241 + </div>
  242 + <!-- 晚高峰下行时间(* 必填项) END -->
  243 + <!-- 低谷上行时间 START -->
  244 + <div class="col-md-4">
  245 + <label class="control-label col-md-5">低谷上行时间&nbsp;&nbsp;&nbsp;:</label>
  246 + <div class="col-md-5">
  247 + <input type="text" class="form-control" name="troughUpTime" value="{{map.troughUpTime}}" id="troughUpTimeInput"
  248 + placeholder="请输入低谷上行时间">
  249 + </div>
  250 + </div>
  251 + <!-- 低谷上行时间 END -->
  252 +</div>
  253 +<!-- 表单分组组件 form-group END -->
  254 +
  255 +<!-- 表单分组组件 form-group START -->
  256 +<div class="form-group">
  257 + <!-- 低谷下行时间 START -->
  258 + <div class="col-md-4">
  259 + <label class="control-label col-md-5">低谷下行时间&nbsp;&nbsp;&nbsp;:</label>
  260 + <div class="col-md-5">
  261 + <input type="text" class="form-control" name="troughDownTime" value="{{map.troughDownTime}}" id="troughDownTimeInput"
  262 + placeholder="请输入低谷下行时间">
  263 + </div>
  264 + </div>
  265 + <!-- 低谷下行时间 END -->
  266 + <!-- 区间上行时间 START -->
  267 + <div class="col-md-4">
  268 + <label class="control-label col-md-5">区间上行时间&nbsp;&nbsp;&nbsp;:</label>
  269 + <div class="col-md-5">
  270 + <input type="text" class="form-control" name="qjUpTime" id="qjUpTimeInput"
  271 + placeholder="请输入区间上行时间">
  272 + </div>
  273 + </div>
  274 + <!-- 区间上行时间 END -->
  275 + <!-- 区间下行时间 START -->
  276 + <div class="col-md-4">
  277 + <label class="control-label col-md-5">区间下行时间&nbsp;&nbsp;&nbsp;:</label>
  278 + <div class="col-md-5">
  279 + <input type="text" class="form-control" name="qjDownTime" id="qjDownTimeInput"
  280 + placeholder="请输入区间下行时间">
  281 + </div>
  282 + </div>
  283 + <!-- 区间下行时间 END -->
  284 +</div>
  285 +<!-- 表单分组组件 form-group END -->
  286 +
  287 +<!-- 表单分组组件 form-group START -->
  288 +<div class="form-group">
  289 + <!-- 空放行驶时间 START -->
  290 + <div class="col-md-4">
  291 + <label class="control-label col-md-5">空放行驶时间&nbsp;&nbsp;&nbsp;:</label>
  292 + <div class="col-md-5">
  293 + <input type="text" class="form-control" name="kfsj" id="kfsjInput"
  294 + placeholder="请输入空放行驶时间">
  295 + </div>
  296 + </div>
  297 + <!-- 空放行驶时间 END -->
  298 + <!-- 工作餐午餐时间 START -->
  299 + <div class="col-md-4">
  300 + <label class="control-label col-md-5">工作餐午餐时间:</label>
  301 + <div class="col-md-5">
  302 + <input type="text" class="form-control" name="workeLunch" value="{{map.workeLunch}}" id="workeLunchInput"
  303 + placeholder="请输入工作餐午餐时间">
  304 + </div>
  305 + </div>
  306 + <!-- 工作餐午餐时间 END -->
  307 + <!-- 工作餐晚餐时间 START -->
  308 + <div class="col-md-4">
  309 + <label class="control-label col-md-5">工作餐晚餐时间:</label>
  310 + <div class="col-md-5">
  311 + <input type="text" class="form-control" name="workeDinner" value="{{map.workeDinner}}" id="workeDinnerInput"
  312 + placeholder="请输入工作餐晚餐时间">
  313 + </div>
  314 + </div>
  315 + <!-- 工作餐晚餐时间 END -->
  316 +</div>
  317 +<!-- 表单分组组件 form-group END -->
  318 +
  319 +<!-- 表单分组组件 form-group START -->
  320 +<div class="form-group">
  321 + <!-- 上行进场时间 START -->
  322 + <div class="col-md-4">
  323 + <label class="control-label col-md-5">上行进场时间&nbsp;&nbsp;&nbsp;:</label>
  324 + <div class="col-md-5">
  325 + <input type="text" class="form-control" name="upInTimer" value="{{map.upInTimer}}" id="upInTimerInput"
  326 + placeholder="请输入上行进场时间">
  327 + </div>
  328 + </div>
  329 + <!-- 上行进场时间 END -->
  330 + <!-- 上行出场时间 START -->
  331 + <div class="col-md-4">
  332 + <label class="control-label col-md-5">上行出场时间&nbsp;&nbsp;&nbsp;:</label>
  333 + <div class="col-md-5">
  334 + <input type="text" class="form-control" name="upOutTimer" value="{{map.upOutTimer}}" id="upOutTimerInput"
  335 + placeholder="请输入上行出场时间">
  336 + </div>
  337 + </div>
  338 + <!-- 上行出场时间 END -->
  339 + <!-- 下行进场时间 START -->
  340 + <div class="col-md-4">
  341 + <label class="control-label col-md-5">下行进场时间&nbsp;&nbsp;&nbsp;:</label>
  342 + <div class="col-md-5">
  343 + <input type="text" class="form-control" name="downInTimer" value="{{map.downInTimer}}" id="downInTimerInput"
  344 + placeholder="请输入下行进场时间">
  345 + </div>
  346 + </div>
  347 + <!-- 下行进场时间 END -->
  348 +</div>
  349 +<!-- 表单分组组件 form-group END -->
  350 +
  351 +<!-- 表单分组组件 form-group START -->
  352 +<div class="form-group">
  353 + <!-- 下行出场时间 START -->
  354 + <div class="col-md-4">
  355 + <label class="control-label col-md-5">下行出场时间&nbsp;&nbsp;&nbsp;:</label>
  356 + <div class="col-md-5">
  357 + <input type="text" class="form-control" name="downOutTimer" value="{{map.downOutTimer}}" id="downOutTimerInput"
  358 + placeholder="请输入下行出场时间">
  359 + </div>
  360 + </div>
  361 + <!-- 下行出场时间 END -->
  362 + <!-- 上行进场里程 START -->
  363 + <div class="col-md-4">
  364 + <label class="control-label col-md-5">上行进场里程&nbsp;&nbsp;&nbsp;:</label>
  365 + <div class="col-md-5">
  366 + <input type="text" class="form-control" name="upInMileage" value="{{map.upInMileage}}" id="upInlcInput"
  367 + placeholder="请输入上行进场里程">
  368 + </div>
  369 + </div>
  370 + <!-- 上行进场里程 END -->
  371 + <!-- 上行出场里程 START -->
  372 + <div class="col-md-4">
  373 + <label class="control-label col-md-5">上行出场里程&nbsp;&nbsp;&nbsp;:</label>
  374 + <div class="col-md-5">
  375 + <input type="text" class="form-control" name="upOutMileage" value="{{map.upOutMileage}}" id="upOutlcInput"
  376 + placeholder="请输入上行出场里程">
  377 + </div>
  378 + </div>
  379 + <!-- 上行出场里程 END -->
  380 +</div>
  381 +<!-- 表单分组组件 form-group END -->
  382 +
  383 +<!-- 表单分组组件 form-group START -->
  384 +<div class="form-group">
  385 + <!-- 下行进场里程 START -->
  386 + <div class="col-md-4">
  387 + <label class="control-label col-md-5">下行进场里程&nbsp;&nbsp;&nbsp;:</label>
  388 + <div class="col-md-5">
  389 + <input type="text" class="form-control" name="downInMileage" value="{{map.downInMileage}}" id="downInlcInput"
  390 + placeholder="请输入下行进场里程">
  391 + </div>
  392 + </div>
  393 + <!-- 下行进场里程 END -->
  394 + <!-- 下行出场里程 START -->
  395 + <div class="col-md-4">
  396 + <label class="control-label col-md-5">下行出场里程&nbsp;&nbsp;&nbsp;:</label>
  397 + <div class="col-md-5">
  398 + <input type="text" class="form-control" name="downOutMileage" value="{{map.downOutMileage}}" id="downOutlcInput"
  399 + placeholder="请输入下行出场里程">
  400 + </div>
  401 + </div>
  402 + <!-- 下行出场里程 END -->
  403 + <!-- 早晚例行保养 START -->
  404 + <div class="col-md-4">
  405 + <label class="control-label col-md-5">早晚例行保养&nbsp;&nbsp;&nbsp;:</label>
  406 + <div class="col-md-5">
  407 + <input type="text" class="form-control" name="lb" value="{{map.lb}}" id="lbInput"
  408 + placeholder="请输入早晚例行保养">
  409 + </div>
  410 + </div>
  411 + <!-- 早晚例行保养 END -->
  412 +</div>
  413 +<!-- 表单分组组件 form-group END -->
  414 +
  415 +<!-- 表单分组组件 form-group START -->
  416 +<div class="form-group">
  417 + <!-- 班型与人次 (* 必填项) START -->
  418 + <div class="col-md-8 ">
  419 + <label class="control-label col-md-2"><span class="required"> * </span>班型与人次</label>
  420 + <div class="col-md-9 tagsDiv">
  421 + <input type="text" value="" name="bxrc" id="state_tagsinput" style="display: none;">
  422 + <div class="margin-top-10">
  423 + <select class="form-control input-large" id="state_tagsinput_bctype">
  424 + <option value="">请选择工休类型...</option>
  425 + <option value="六工一休">六工一休</option>
  426 + <option value="五工一休">五工一休</option>
  427 + <option value="五工二休">五工二休</option>
  428 + <option value="四工一休">四工一休</option>
  429 + <option value="三工一休">三工一休</option>
  430 + <option value="二工一休">二工一休</option>
  431 + <option value="一工一休">一工一休</option>
  432 + <option value="无工休">无工休</option>
  433 + </select>
  434 + </div>
  435 + <div class="margin-top-10">
  436 + <input type="number" class="form-control input-large" placeholder="请输入分配人次数" id="state_tagsinput_value">
  437 + </div>
  438 + <div class="margin-top-10">
  439 + <a href="javascript:;" class="btn red" id="state_tagsinput_add">添加</a>
  440 + </div>
  441 + </div>
  442 + </div>
  443 + <!-- 班型与人次 (* 必填项) END -->
  444 + <!-- 车辆总数 (* 必填项) START -->
  445 + <div class="col-md-4">
  446 + <label class="control-label col-md-5">
  447 + <span class="required"> * </span>
  448 + 车辆总数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  449 + <div class="col-md-5">
  450 + <input type="text" class="form-control" name="clzs" id="clzsInput"
  451 + placeholder="请输入车辆总数">
  452 + </div>
  453 + </div>
  454 + <!-- 车辆总数(* 必填项) END -->
  455 +</div>
  456 +<!-- 表单分组组件 form-group END -->
  457 +</script>
  458 +
  459 +<script type="text/html" id="bctype_tempconfig">
  460 +<h4 class="form-section"> 时刻表与线路名称 </h4>
  461 +<div class="form-group">
  462 + <div class="col-md-4">
  463 + <label class="control-label col-md-5"> 时刻表名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  464 + <div class="col-md-7">
  465 + <p class="form-control-static" data-display="skbName"> </p>
  466 + </div>
  467 + </div>
  468 + <div class="col-md-4">
  469 + <label class="control-label col-md-5"> 线路名称&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  470 + <div class="col-md-4">
  471 + <p class="form-control-static" data-display="lineName"> </p>
  472 + </div>
  473 + </div>
  474 +</div>
  475 +<h4 class="form-section"> 参数详情 </h4>
  476 +<!-- 表单分组组件 form-group START -->
  477 +<div class="form-group">
  478 + <!-- 起始站首班时间 (* 必填项) START -->
  479 + <div class="col-md-4">
  480 + <label class="control-label col-md-5"> 起始站首班时间: </label>
  481 + <div class="col-md-4">
  482 + <p class="form-control-static" data-display="startStationFirstTime"> </p>
  483 + </div>
  484 + </div>
  485 + <!-- 起始站首班时间 (* 必填项) END -->
  486 + <!-- 起始站末班时间 (* 必填项) START -->
  487 + <div class="col-md-4">
  488 + <label class="control-label col-md-5"> 起始站末班时间: </label>
  489 + <div class="col-md-4">
  490 + <p class="form-control-static" data-display="startStationEndTime"> </p>
  491 + </div>
  492 + </div>
  493 + <!-- 起始站末班时间 (* 必填项) END -->
  494 + <!-- 终点站首班时间 (* 必填项) START -->
  495 + <div class="col-md-4">
  496 + <label class="control-label col-md-5"> 终点站首班时间: </label>
  497 + <div class="col-md-4">
  498 + <p class="form-control-static" data-display="endStationFirstTime"> </p>
  499 + </div>
  500 + </div>
  501 + <!-- 终点站首班时间 (* 必填项) END -->
  502 +</div>
  503 +<!-- 表单分组组件 form-group END -->
  504 +
  505 +<!-- 表单分组组件 form-group START -->
  506 +<div class="form-group">
  507 + <!-- 终点站末班时间 (* 必填项) START -->
  508 + <div class="col-md-4">
  509 + <label class="control-label col-md-5"> 终点站末班时间: </label>
  510 + <div class="col-md-4">
  511 + <p class="form-control-static" data-display="endStationEndTime"> </p>
  512 + </div>
  513 + </div>
  514 + <!-- 终点站末班时间 (* 必填项) END -->
  515 + <!-- 早高峰开始时间(* 必填项) START -->
  516 + <div class="col-md-4">
  517 + <label class="control-label col-md-5"> 早高峰开始时间: </label>
  518 + <div class="col-md-4">
  519 + <p class="form-control-static" data-display="earlyStartTime"> </p>
  520 + </div>
  521 + </div>
  522 + <!-- 早高峰开始时间 (* 必填项) END -->
  523 + <!-- 早高峰结束时间 (* 必填项) START -->
  524 + <div class="col-md-4">
  525 + <label class="control-label col-md-5"> 早高峰结束时间: </label>
  526 + <div class="col-md-4">
  527 + <p class="form-control-static" data-display="earlyEndTime"> </p>
  528 + </div>
  529 + </div>
  530 + <!-- 早高峰结束时间 (* 必填项) END -->
  531 +</div>
  532 +<!-- 表单分组组件 form-group END -->
  533 +
  534 +<!-- 表单分组组件 form-group START -->
  535 +<div class="form-group">
  536 + <!-- 晚高峰开始时间(* 必填项) START -->
  537 + <div class="col-md-4">
  538 + <label class="control-label col-md-5"> 晚高峰开始时间: </label>
  539 + <div class="col-md-4">
  540 + <p class="form-control-static" data-display="lateStartTime"> </p>
  541 + </div>
  542 + </div>
  543 + <!-- 晚高峰开始时间(* 必填项) END -->
  544 + <!-- 晚高峰结束时间(* 必填项) START -->
  545 + <div class="col-md-4">
  546 + <label class="control-label col-md-5"> 晚高峰结束时间: </label>
  547 + <div class="col-md-4">
  548 + <p class="form-control-static" data-display="lateEndTime"> </p>
  549 + </div>
  550 + </div>
  551 + <!-- 晚高峰结束时间(* 必填项) END -->
  552 + <!-- 上行行驶时间(* 必填项) START -->
  553 + <div class="col-md-4">
  554 + <label class="control-label col-md-5"> 上行行驶时间&nbsp;&nbsp;&nbsp;: </label>
  555 + <div class="col-md-4">
  556 + <p class="form-control-static" data-display="upTravelTime"> </p>
  557 + </div>
  558 + </div>
  559 + <!-- 上行行驶时间(* 必填项) END -->
  560 +</div>
  561 +<!-- 表单分组组件 form-group END -->
  562 +
  563 +
  564 +<!-- 表单分组组件 form-group START -->
  565 +<div class="form-group">
  566 + <!-- 下行行驶时间(* 必填项) START -->
  567 + <div class="col-md-4">
  568 + <label class="control-label col-md-5"> 下行行驶时间&nbsp;&nbsp;&nbsp;: </label>
  569 + <div class="col-md-4">
  570 + <p class="form-control-static" data-display="downTravelTime"> </p>
  571 + </div>
  572 + </div>
  573 + <!-- 下行行驶时间(* 必填项) END -->
  574 + <!-- 上行行驶里程(* 必填项) START -->
  575 + <div class="col-md-4">
  576 + <label class="control-label col-md-5"> 上行行驶里程&nbsp;&nbsp;&nbsp;: </label>
  577 + <div class="col-md-4">
  578 + <p class="form-control-static" data-display="upMileage"> </p>
  579 + </div>
  580 + </div>
  581 + <!-- 上行行驶里程(* 必填项) END-->
  582 + <!-- 下行行驶里程(* 必填项) START -->
  583 + <div class="col-md-4">
  584 + <label class="control-label col-md-5"> 下行行驶里程&nbsp;&nbsp;&nbsp;: </label>
  585 + <div class="col-md-4">
  586 + <p class="form-control-static" data-display="downMileage"> </p>
  587 + </div>
  588 + </div>
  589 + <!-- 下行行驶里程(* 必填项) END -->
  590 +</div>
  591 +<!-- 表单分组组件 form-group END -->
  592 +
  593 +<!-- 表单分组组件 form-group START -->
  594 +<div class="form-group">
  595 + <!-- 平时停站间隙(* 必填项) START -->
  596 + <div class="col-md-4">
  597 + <label class="control-label col-md-5"> 平时停站间隙&nbsp;&nbsp;&nbsp;: </label>
  598 + <div class="col-md-4">
  599 + <p class="form-control-static" data-display="stopTime"> </p>
  600 + </div>
  601 + </div>
  602 + <!-- 平时停站间隙(* 必填项) END -->
  603 + <!-- 最大停站间隙(* 必填项) START -->
  604 + <div class="col-md-4">
  605 + <label class="control-label col-md-5"> 最大停站间隙&nbsp;&nbsp;&nbsp;: </label>
  606 + <div class="col-md-4">
  607 + <p class="form-control-static" data-display="maxstopTime"> </p>
  608 + </div>
  609 + </div>
  610 + <!-- 最大停站间隙(* 必填项) END -->
  611 + <!-- 最小停站间隙(* 必填项) START -->
  612 + <div class="col-md-4">
  613 + <label class="control-label col-md-5"> 最小停站间隙&nbsp;&nbsp;&nbsp;: </label>
  614 + <div class="col-md-4">
  615 + <p class="form-control-static" data-display="mixstopTime"> </p>
  616 + </div>
  617 + </div>
  618 + <!-- 最小停站间隙(* 必填项) END -->
  619 +</div>
  620 +<!-- 表单分组组件 form-group END -->
  621 +
  622 +<!-- 表单分组组件 form-group START -->
  623 +<div class="form-group">
  624 + <!-- 停车场 START -->
  625 + <div class="col-md-4">
  626 + <label class="control-label col-md-5">停车场&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  627 + <div class="col-md-7">
  628 + <p class="form-control-static" data-display="carPark"> </p>
  629 + </div>
  630 + </div>
  631 + <!-- 停车场 START -->
  632 + <!-- 早高峰上行时间 START -->
  633 + <div class="col-md-4">
  634 + <label class="control-label col-md-5"> 早高峰上行时间: </label>
  635 + <div class="col-md-6">
  636 + <p class="form-control-static" data-display="earlyUpTime"> </p>
  637 + </div>
  638 + </div>
  639 + <!-- 早高峰上行时间 END -->
  640 + <!-- 早高峰下行时间 START -->
  641 + <div class="col-md-4">
  642 + <label class="control-label col-md-5"> 早高峰下行时间: </label>
  643 + <div class="col-md-4">
  644 + <p class="form-control-static" data-display="earlyDownTime"> </p>
  645 + </div>
  646 + </div>
  647 + <!-- 早高峰下行时间 END -->
  648 +</div>
  649 +<!-- 表单分组组件 form-group END -->
  650 +
  651 +<!-- 表单分组组件 form-group START -->
  652 +<div class="form-group">
  653 + <!-- 晚高峰上行时间 START -->
  654 + <div class="col-md-4">
  655 + <label class="control-label col-md-5"> 晚高峰上行时间: </label>
  656 + <div class="col-md-4">
  657 + <p class="form-control-static" data-display="lateUpTime"> </p>
  658 + </div>
  659 + </div>
  660 + <!-- 晚高峰上行时间 END -->
  661 + <!-- 晚高峰下行时间 START -->
  662 + <div class="col-md-4">
  663 + <label class="control-label col-md-5"> 晚高峰下行时间:</label>
  664 + <div class="col-md-4">
  665 + <p class="form-control-static" data-display="lateDownTime"> </p>
  666 + </div>
  667 + </div>
  668 + <!-- 晚高峰下行时间 END -->
  669 + <!-- 低谷上行时间 START -->
  670 + <div class="col-md-4">
  671 + <label class="control-label col-md-5">低谷上行时间&nbsp;&nbsp;&nbsp;: </label>
  672 + <div class="col-md-4">
  673 + <p class="form-control-static" data-display="troughUpTime"> </p>
  674 + </div>
  675 + </div>
  676 + <!-- 低谷上行时间 END -->
  677 +</div>
  678 +<!-- 表单分组组件 form-group END -->
  679 +
  680 +<!-- 表单分组组件 form-group START -->
  681 +<div class="form-group">
  682 + <!-- 低谷下行时间 START -->
  683 + <div class="col-md-4">
  684 + <label class="control-label col-md-5"> 低谷下行时间&nbsp;&nbsp;&nbsp;: </label>
  685 + <div class="col-md-4">
  686 + <p class="form-control-static" data-display="troughDownTime"> </p>
  687 + </div>
  688 + </div>
  689 + <!-- 低谷下行时间 END -->
  690 + <!-- 区间上行时间 START -->
  691 + <div class="col-md-4">
  692 + <label class="control-label col-md-5"> 区间上行时间&nbsp;&nbsp;&nbsp;:</label>
  693 + <div class="col-md-4">
  694 + <p class="form-control-static" data-display="qjUpTime"> </p>
  695 + </div>
  696 + </div>
  697 + <!-- 区间上行时间 END -->
  698 + <!-- 区间下行时间 START -->
  699 + <div class="col-md-4">
  700 + <label class="control-label col-md-5">区间下行时间&nbsp;&nbsp;&nbsp;: </label>
  701 + <div class="col-md-4">
  702 + <p class="form-control-static" data-display="qjDownTime"> </p>
  703 + </div>
  704 + </div>
  705 + <!-- 区间下行时间 END -->
  706 +</div>
  707 +<!-- 表单分组组件 form-group END -->
  708 +
  709 +<!-- 表单分组组件 form-group START -->
  710 +<div class="form-group">
  711 + <!-- 空放行驶时间 START -->
  712 + <div class="col-md-4">
  713 + <label class="control-label col-md-5"> 空放行驶时间&nbsp;&nbsp;&nbsp;: </label>
  714 + <div class="col-md-4">
  715 + <p class="form-control-static" data-display="kfsj"> </p>
  716 + </div>
  717 + </div>
  718 + <!-- 空放行驶时间 END -->
  719 + <!-- 工作餐午餐时间 START -->
  720 + <div class="col-md-4">
  721 + <label class="control-label col-md-5"> 工作餐午餐时间: </label>
  722 + <div class="col-md-4">
  723 + <p class="form-control-static" data-display="workeLunch"> </p>
  724 + </div>
  725 + </div>
  726 + <!-- 工作餐午餐时间 END -->
  727 + <!-- 工作餐晚餐时间 START -->
  728 + <div class="col-md-4">
  729 + <label class="control-label col-md-5"> 工作餐晚餐时间: </label>
  730 + <div class="col-md-4">
  731 + <p class="form-control-static" data-display="workeDinner"> </p>
  732 + </div>
  733 + </div>
  734 + <!-- 空放行驶时间 END -->
  735 +</div>
  736 +<!-- 表单分组组件 form-group END -->
  737 +
  738 +<!-- 表单分组组件 form-group START -->
  739 +<div class="form-group">
  740 + <!-- 上行进场时间 START -->
  741 + <div class="col-md-4">
  742 + <label class="control-label col-md-5"> 上行进场时间&nbsp;&nbsp;&nbsp;:</label>
  743 + <div class="col-md-4">
  744 + <p class="form-control-static" data-display="upInTimer"> </p>
  745 + </div>
  746 + </div>
  747 + <!-- 上行进场时间 END -->
  748 + <!-- 上行出场时间 START -->
  749 + <div class="col-md-4">
  750 + <label class="control-label col-md-5"> 上行出场时间&nbsp;&nbsp;&nbsp;: </label>
  751 + <div class="col-md-4">
  752 + <p class="form-control-static" data-display="upOutTimer"> </p>
  753 + </div>
  754 + </div>
  755 + <!-- 上行出场时间 END -->
  756 + <!-- 下行进场时间 START -->
  757 + <div class="col-md-4">
  758 + <label class="control-label col-md-5"> 下行进场时间&nbsp;&nbsp;&nbsp;: </label>
  759 + <div class="col-md-4">
  760 + <p class="form-control-static" data-display="downInTimer"> </p>
  761 + </div>
  762 + </div>
  763 + <!-- 下行进场时间 END -->
  764 +</div>
  765 +<!-- 表单分组组件 form-group END -->
  766 +
  767 +<!-- 表单分组组件 form-group START -->
  768 +<div class="form-group">
  769 + <!-- 下行出场时间 START -->
  770 + <div class="col-md-4">
  771 + <label class="control-label col-md-5"> 下行出场时间&nbsp;&nbsp;&nbsp;: </label>
  772 + <div class="col-md-4">
  773 + <p class="form-control-static" data-display="downOutTimer"> </p>
  774 + </div>
  775 + </div>
  776 + <!-- 下行出场时间 END -->
  777 + <!-- 上行进场里程 START -->
  778 + <div class="col-md-4">
  779 + <label class="control-label col-md-5"> 上行进场里程&nbsp;&nbsp;&nbsp;: </label>
  780 + <div class="col-md-4">
  781 + <p class="form-control-static" data-display="upInMileage"> </p>
  782 + </div>
  783 + </div>
  784 + <!-- 上行进场里程 END -->
  785 + <!-- 上行出场里程 START -->
  786 + <div class="col-md-4">
  787 + <label class="control-label col-md-5">上行出场里程&nbsp;&nbsp;&nbsp;:</label>
  788 + <div class="col-md-4">
  789 + <p class="form-control-static" data-display="upOutMileage"> </p>
  790 + </div>
  791 + </div>
  792 + <!-- 上行出场里程 END -->
  793 +</div>
  794 +<!-- 表单分组组件 form-group END -->
  795 +
  796 +<!-- 表单分组组件 form-group START -->
  797 +<div class="form-group">
  798 + <!-- 下行进场里程 START -->
  799 + <div class="col-md-4">
  800 + <label class="control-label col-md-5">下行进场里程&nbsp;&nbsp;&nbsp;: </label>
  801 + <div class="col-md-4">
  802 + <p class="form-control-static" data-display="downInMileage"> </p>
  803 + </div>
  804 + </div>
  805 + <!-- 下行进场里程 END -->
  806 + <!-- 下行出场里程 START -->
  807 + <div class="col-md-4">
  808 + <label class="control-label col-md-5"> 下行出场里程&nbsp;&nbsp;&nbsp;:</label>
  809 + <div class="col-md-4">
  810 + <p class="form-control-static" data-display="downOutMileage"> </p>
  811 + </div>
  812 + </div>
  813 + <!-- 下行出场里程 END -->
  814 + <!-- 早晚例行保养 START -->
  815 + <div class="col-md-4">
  816 + <label class="control-label col-md-5">早晚例行保养&nbsp;&nbsp;&nbsp;:</label>
  817 + <div class="col-md-4">
  818 + <p class="form-control-static" data-display="lb"> </p>
  819 + </div>
  820 + </div>
  821 + <!-- 早晚例行保养 END -->
  822 +</div>
  823 +<!-- 表单分组组件 form-group END -->
  824 +
  825 +<!-- 表单分组组件 form-group START -->
  826 +<div class="form-group">
  827 + <!-- 车辆总数 START -->
  828 + <div class="col-md-4">
  829 + <label class="control-label col-md-5"> 车辆总数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  830 + <div class="col-md-4">
  831 + <p class="form-control-static" data-display="clzs"> </p>
  832 + </div>
  833 + </div>
  834 + <!-- 车辆总数 END -->
  835 + <!-- 班型与人次 START -->
  836 + <div class="col-md-6">
  837 + <label class="control-label col-md-3">班型与人次&nbsp;&nbsp;&nbsp;:</label>
  838 + <div class="col-md-9">
  839 + <p class="form-control-static" data-display="bxrc"> </p>
  840 + </div>
  841 + </div>
  842 + <!-- 班型与人次 END -->
  843 +</div>
  844 +<!-- 表单分组组件 form-group END -->
  845 +</script>
0 846 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/tepms/carnum_temp.html 0 → 100644
  1 +<script type="text/html" id = "carnum_temp">
  2 +<!-- 表单分组组件 form-group START -->
  3 +<div class="form-group">
  4 + <!-- 起始站首班时间 (* 必填项) START -->
  5 + <div class="col-md-4">
  6 + <label class="control-label col-md-5">
  7 + <span class="required"> * </span> 起始站首班时间:
  8 + </label>
  9 + <div class="col-md-5">
  10 + <input type="text" class="form-control" name="startStationFirstTime" value="{{map.line.startStationFirstTime}}" id="qdzsbsjInput"
  11 + placeholder="请输入起始站首班时间">
  12 + </div>
  13 + </div>
  14 + <!-- 起始站首班时间 (* 必填项) END -->
  15 + <!-- 起始站末班时间 (* 必填项) START -->
  16 + <div class="col-md-4">
  17 + <label class="control-label col-md-5">
  18 + <span class="required"> * </span> 起始站末班时间:
  19 + </label>
  20 + <div class="col-md-5">
  21 + <input type="text" class="form-control" name="startStationEndTime" value="{{map.line.startStationEndTime}}" id="qdzmbsjInput"
  22 + placeholder="请输入起始站末班时间">
  23 + </div>
  24 + </div>
  25 + <!-- 起始站末班时间 (* 必填项) END -->
  26 + <!-- 终点站首班时间 (* 必填项) START -->
  27 + <div class="col-md-4">
  28 + <label class="control-label col-md-5">
  29 + <span class="required"> * </span> 终点站首班时间:
  30 + </label>
  31 + <div class="col-md-5">
  32 + <input type="text" class="form-control" name="endStationFirstTime" value="{{map.line.endStationFirstTime}}" id="zdzsbsjInput"
  33 + placeholder="请输入终点站首班时间">
  34 + </div>
  35 + </div>
  36 + <!-- 终点站首班时间 (* 必填项) END -->
  37 +</div>
  38 +<!-- 表单分组组件 form-group END -->
  39 +
  40 +<!-- 表单分组组件 form-group START -->
  41 +<div class="form-group">
  42 + <!-- 终点站末班时间 (* 必填项) START -->
  43 + <div class="col-md-4">
  44 + <label class="control-label col-md-5">
  45 + <span class="required"> * </span> 终点站末班时间:
  46 + </label>
  47 + <div class="col-md-5">
  48 + <input type="text" class="form-control" name="endStationEndTime" value="{{map.line.endStationEndTime}}" id="zdzmbsjInput"
  49 + placeholder="请输入终点站末班时间">
  50 + </div>
  51 + </div>
  52 + <!-- 终点站末班时间 (* 必填项) END -->
  53 + <!-- 早高峰开始时间 (* 必填项) START -->
  54 + <div class="col-md-4">
  55 + <label class="control-label col-md-5">
  56 + <span class="required"> * </span> 早高峰开始时间:
  57 + </label>
  58 + <div class="col-md-5">
  59 + <input type="text" class="form-control" name="earlyStartTime" value="{{map.earlyStartTime}}" id="zgfkssjInput"
  60 + placeholder="请输入早高峰开始时间">
  61 + </div>
  62 + </div>
  63 + <!-- 早高峰开始时间 (* 必填项) END -->
  64 + <!-- 早高峰结束时间 (* 必填项) START -->
  65 + <div class="col-md-4">
  66 + <label class="control-label col-md-5">
  67 + <span class="required"> * </span> 早高峰结束时间:
  68 + </label>
  69 + <div class="col-md-5">
  70 + <input type="text" class="form-control" name="earlyEndTime" value="{{map.earlyEndTime}}" id="zgfjssjInput"
  71 + placeholder="请输入早高峰结束时间">
  72 + </div>
  73 + </div>
  74 + <!-- 早高峰结束时间 (* 必填项) END -->
  75 +</div>
  76 +<!-- 表单分组组件 form-group END -->
  77 +
  78 +<!-- 表单分组组件 form-group START -->
  79 +<div class="form-group">
  80 + <!-- 晚高峰开始时间 (* 必填项) START -->
  81 + <div class="col-md-4">
  82 + <label class="control-label col-md-5">
  83 + <span class="required"> * </span> 晚高峰开始时间:
  84 + </label>
  85 + <div class="col-md-5">
  86 + <input type="text" class="form-control" name="lateStartTime" value="{{map.lateStartTime}}" id="wgfkssjInput"
  87 + placeholder="请输入晚高峰开始时间">
  88 + </div>
  89 + </div>
  90 + <!-- 晚高峰开始时间 (* 必填项) END -->
  91 + <!-- 晚高峰结束 (* 必填项) START -->
  92 + <div class="col-md-4">
  93 + <label class="control-label col-md-5">
  94 + <span class="required"> * </span> 晚高峰结束时间:
  95 + </label>
  96 + <div class="col-md-5">
  97 + <input type="text" class="form-control" name="lateEndTime" value="{{map.lateEndTime}}" id="wgfjssjInput"
  98 + placeholder="请输入晚高峰结束时间">
  99 + </div>
  100 + </div>
  101 + <!-- 晚高峰结束 (* 必填项) END -->
  102 + <!-- 早高峰前配车数 (* 必填项) START -->
  103 + <div class="col-md-4">
  104 + <label class="control-label col-md-5">
  105 + <span class="required"> * </span> 早高峰前配车数:
  106 + </label>
  107 + <div class="col-md-5">
  108 + <input type="text" class="form-control" name="zgfbeforepcs" value="{{map.zgfbeforepcs}}" id="zgfbeforepcsInput"
  109 + placeholder="请输入早高峰前配车数">
  110 + </div>
  111 + </div>
  112 + <!-- 营运开始配车数 (* 必填项) END -->
  113 +</div>
  114 +<!-- 表单分组组件 form-group END -->
  115 +
  116 +<!-- 表单分组组件 form-group START -->
  117 +<div class="form-group">
  118 + <!-- 早高峰配车数 (* 必填项) START -->
  119 + <div class="col-md-4">
  120 + <label class="control-label col-md-5">
  121 + <span class="required"> * </span> 早高峰配车数&nbsp;&nbsp;&nbsp;:
  122 + </label>
  123 + <div class="col-md-5">
  124 + <input type="text" class="form-control" name="zgfpcs" value="{{map.zgfpcs}}" id="zgfpcsInput"
  125 + placeholder="请输入早高峰配车数">
  126 + </div>
  127 + </div>
  128 + <!-- 早高峰配车数 (* 必填项) END -->
  129 + <!-- 高峰之间配车数(* 必填项) START -->
  130 + <div class="col-md-4">
  131 + <label class="control-label col-md-5">
  132 + <span class="required"> * </span> 高峰之间配车数:
  133 + </label>
  134 + <div class="col-md-5">
  135 + <input type="text" class="form-control" name="gfzjpcs" value="{{map.gfzjpcs}}" id="gfzjpcsInput"
  136 + placeholder="请输入高峰之间配车数">
  137 + </div>
  138 + </div>
  139 + <!-- 高峰之间配车数 (* 必填项) END -->
  140 + <!-- 晚高峰配车数 (* 必填项) START -->
  141 + <div class="col-md-4">
  142 + <label class="control-label col-md-5">
  143 + <span class="required"> * </span> 晚高峰配车数&nbsp;&nbsp;&nbsp;:
  144 + </label>
  145 + <div class="col-md-5">
  146 + <input type="text" class="form-control" name="wgfpcs" value="{{map.wgfpcs}}" id="wgfpcsInput"
  147 + placeholder="请输入晚高峰配车数">
  148 + </div>
  149 + </div>
  150 + <!-- 晚高峰配车数 (* 必填项) END -->
  151 +</div>
  152 + <!-- 表单分组组件 form-group END -->
  153 +
  154 +<!-- 表单分组组件 form-group START -->
  155 +<div class="form-group">
  156 + <!-- 晚高峰后配车数 (* 必填项) START -->
  157 + <div class="col-md-4">
  158 + <label class="control-label col-md-5">
  159 + <span class="required"> * </span> 晚高峰后配车数:
  160 + </label>
  161 + <div class="col-md-5">
  162 + <input type="text" class="form-control" name="wgfafterpcs" value="{{map.wgfafterpcs}}" id="wgfafterpcsInput"
  163 + placeholder="请输入晚高峰后配车数">
  164 + </div>
  165 + </div>
  166 + <!-- 晚高峰后配车数 (* 必填项) END -->
  167 + <!-- 上行行驶时间(* 必填项) START -->
  168 + <div class="col-md-4">
  169 + <label class="control-label col-md-5">
  170 + <span class="required"> * </span> 上行行驶时间&nbsp;&nbsp;&nbsp;:
  171 + </label>
  172 + <div class="col-md-5">
  173 + <input type="text" class="form-control" name="upTravelTime" value="{{map.upTravelTime}}" id="upTravelTimeInput"
  174 + placeholder="请输入上行行驶时间">
  175 + </div>
  176 + </div>
  177 + <!-- 上行行驶时间 (* 必填项) END -->
  178 + <!-- 下行行驶时间 (* 必填项) START -->
  179 + <div class="col-md-4">
  180 + <label class="control-label col-md-5">
  181 + <span class="required"> * </span> 下行行驶时间&nbsp;&nbsp;&nbsp;:
  182 + </label>
  183 + <div class="col-md-5">
  184 + <input type="text" class="form-control" name="downTravelTime" value="{{map.downTravelTime}}" id="downTravelTimeInput"
  185 + placeholder="请输入下行行驶时间">
  186 + </div>
  187 + </div>
  188 + <!-- 下行行驶时间(* 必填项) END -->
  189 +</div>
  190 +<!-- 表单分组组件 form-group END -->
  191 +
  192 +<!-- 表单分组组件 form-group START -->
  193 +<div class="form-group">
  194 + <!-- 上行里程(* 必填项) START -->
  195 + <div class="col-md-4">
  196 + <label class="control-label col-md-5">
  197 + <span class="required"> * </span> 上行行驶里程&nbsp;&nbsp;&nbsp;:
  198 + </label>
  199 + <div class="col-md-5">
  200 + <input type="text" class="form-control" name="upMileage" value="{{map.upMileage}}" id="upMileageInput"
  201 + placeholder="请输入上行行驶里程">
  202 + </div>
  203 + </div>
  204 + <!-- 上行里程 (* 必填项) END -->
  205 + <!-- 下行里程 (* 必填项) START -->
  206 + <div class="col-md-4">
  207 + <label class="control-label col-md-5">
  208 + <span class="required"> * </span> 下行行驶里程&nbsp;&nbsp;&nbsp;:
  209 + </label>
  210 + <div class="col-md-5">
  211 + <input type="text" class="form-control" name="downMileage" value="{{map.downMileage}}" id="downMileageInput"
  212 + placeholder="请输入下行行驶里程">
  213 + </div>
  214 + </div>
  215 + <!-- 下行里程(* 必填项) END -->
  216 + <!-- 停站间隙 (* 必填项) START -->
  217 + <div class="col-md-4">
  218 + <label class="control-label col-md-5">
  219 + <span class="required"> * </span> 平时停站间隙&nbsp;&nbsp;&nbsp;:
  220 + </label>
  221 + <div class="col-md-5">
  222 + <input type="text" class="form-control" name="stopTime" value="{{map.stopTime}}" id="stopTimeInput"
  223 + placeholder="请输入停站间隙">
  224 + </div>
  225 + </div>
  226 + <!-- 停站间隙 (* 必填项) END -->
  227 +</div>
  228 +<!-- 表单分组组件 form-group END -->
  229 +
  230 +<!-- 表单分组组件 form-group START -->
  231 +<div class="form-group">
  232 + <!-- 最大停站间隙(* 必填项) START -->
  233 + <div class="col-md-4">
  234 + <label class="control-label col-md-5">
  235 + <span class="required"> * </span> 最大停站间隙&nbsp;&nbsp;&nbsp;:
  236 + </label>
  237 + <div class="col-md-5">
  238 + <input type="text" class="form-control" name="maxstopTime" value="{{map.maxstopTime}}" id="maxstopTimeInput"
  239 + placeholder="请输入最大停站间隙">
  240 + </div>
  241 + </div>
  242 + <!-- 最大停站间隙 (* 必填项) END -->
  243 + <!-- 最小停站间隙(* 必填项) START -->
  244 + <div class="col-md-4">
  245 + <label class="control-label col-md-5">
  246 + <span class="required"> * </span> 最小停站间隙&nbsp;&nbsp;&nbsp;:
  247 + </label>
  248 + <div class="col-md-5">
  249 + <input type="text" class="form-control" name="mixstopTime" value="{{map.mixstopTime}}" id="mixstopTimeInput" placeholder="最小停站间隙">
  250 + </div>
  251 + </div>
  252 + <!-- 最小停站间隙(* 必填项) END -->
  253 + <!-- 停车场(* 必填项) START -->
  254 + <div class="col-md-4">
  255 + <label class="control-label col-md-5">停车场&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  256 + <div class="col-md-5">
  257 + <select name="carPark" class="form-control" id="carParkSelect" style="width:100%"></select>
  258 + </div>
  259 + </div>
  260 + <!-- 停车场(* 必填项) END -->
  261 +</div>
  262 +<!-- 表单分组组件 form-group END -->
  263 +
  264 +<!-- 表单分组组件 form-group START -->
  265 +<div class="form-group">
  266 + <!-- 早高峰上行时间(* 必填项) START -->
  267 + <div class="col-md-4">
  268 + <label class="control-label col-md-5">早高峰上行时间:</label>
  269 + <div class="col-md-5">
  270 + <input type="text" class="form-control" name="earlyUpTime" value="{{map.earlyUpTime}}" id="earlyUpTimeInput"
  271 + placeholder="请输入早高峰上行时间">
  272 + </div>
  273 + </div>
  274 + <!-- 早高峰上行时间(* 必填项) END -->
  275 + <!-- 早高峰下行时间(* 必填项) START -->
  276 + <div class="col-md-4">
  277 + <label class="control-label col-md-5">早高峰下行时间:</label>
  278 + <div class="col-md-5">
  279 + <input type="text" class="form-control" name="earlyDownTime" value="{{map.earlyDownTime}}" id="earlyDownTimeInput"
  280 + placeholder="请输入早高峰下行时间">
  281 + </div>
  282 + </div>
  283 + <!-- 早高峰下行时间(* 必填项) END -->
  284 + <!-- 晚高峰上行时间 (* 必填项) START -->
  285 + <div class="col-md-4">
  286 + <label class="control-label col-md-5">晚高峰上行时间:</label>
  287 + <div class="col-md-5">
  288 + <input type="text" class="form-control" name="lateUpTime" value="{{map.lateUpTime}}" id="lateUpTimeInput"
  289 + placeholder="请输入晚高峰上行时间">
  290 + </div>
  291 + </div>
  292 + <!-- 晚高峰上行时间(* 必填项) END -->
  293 +</div>
  294 +<!-- 表单分组组件 form-group END -->
  295 +
  296 +<!-- 表单分组组件 form-group START -->
  297 +<div class="form-group">
  298 + <!-- 晚高峰下行时间 (* 必填项) START -->
  299 + <div class="col-md-4">
  300 + <label class="control-label col-md-5">晚高峰下行时间:</label>
  301 + <div class="col-md-5">
  302 + <input type="text" class="form-control" name="lateDownTime" value="{{map.lateDownTime}}" id="lateDownTimeInput"
  303 + placeholder="请输入晚高峰下行时间">
  304 + </div>
  305 + </div>
  306 + <!-- 晚高峰下行时间(* 必填项) END -->
  307 + <!-- 低谷上行时间 START -->
  308 + <div class="col-md-4">
  309 + <label class="control-label col-md-5">低谷上行时间&nbsp;&nbsp;&nbsp;:</label>
  310 + <div class="col-md-5">
  311 + <input type="text" class="form-control" name="troughUpTime" value="{{map.troughUpTime}}" id="troughUpTimeInput"
  312 + placeholder="请输入低谷上行时间">
  313 + </div>
  314 + </div>
  315 + <!-- 低谷上行时间 END -->
  316 + <!-- 低谷下行时间 START -->
  317 + <div class="col-md-4">
  318 + <label class="control-label col-md-5">低谷下行时间&nbsp;&nbsp;&nbsp;:</label>
  319 + <div class="col-md-5">
  320 + <input type="text" class="form-control" name="troughDownTime" value="{{map.troughDownTime}}" id="troughDownTimeInput"
  321 + placeholder="请输入低谷下行时间">
  322 + </div>
  323 + </div>
  324 + <!-- 低谷下行时间 END -->
  325 +</div>
  326 +<!-- 表单分组组件 form-group END -->
  327 +
  328 +<!-- 表单分组组件 form-group START -->
  329 +<div class="form-group">
  330 + <!-- 区间上行时间 START -->
  331 + <div class="col-md-4">
  332 + <label class="control-label col-md-5">区间上行时间&nbsp;&nbsp;&nbsp;:</label>
  333 + <div class="col-md-5">
  334 + <input type="text" class="form-control" name="qjUpTime" id="qjUpTimeInput"
  335 + placeholder="请输入区间上行时间">
  336 + </div>
  337 + </div>
  338 + <!-- 区间上行时间 END -->
  339 + <!-- 区间下行时间 START -->
  340 + <div class="col-md-4">
  341 + <label class="control-label col-md-5">区间下行时间&nbsp;&nbsp;&nbsp;:</label>
  342 + <div class="col-md-5">
  343 + <input type="text" class="form-control" name="qjDownTime" id="qjDownTimeInput"
  344 + placeholder="请输入区间下行时间">
  345 + </div>
  346 + </div>
  347 + <!-- 区间下行时间 END -->
  348 + <!-- 空放行驶时间 START -->
  349 + <div class="col-md-4">
  350 + <label class="control-label col-md-5">空放行驶时间&nbsp;&nbsp;&nbsp;:</label>
  351 + <div class="col-md-5">
  352 + <input type="text" class="form-control" name="kfsj" id="kfsjInput"
  353 + placeholder="请输入空放行驶时间">
  354 + </div>
  355 + </div>
  356 + <!-- 空放行驶时间 END -->
  357 +</div>
  358 +<!-- 表单分组组件 form-group END -->
  359 +
  360 +<!-- 表单分组组件 form-group START -->
  361 +<div class="form-group">
  362 + <!-- 工作餐午餐时间 START -->
  363 + <div class="col-md-4">
  364 + <label class="control-label col-md-5">工作餐午餐时间:</label>
  365 + <div class="col-md-5">
  366 + <input type="text" class="form-control" name="workeLunch" value="{{map.workeLunch}}" id="workeLunchInput"
  367 + placeholder="请输入工作餐午餐时间">
  368 + </div>
  369 + </div>
  370 + <!-- 工作餐午餐时间 END -->
  371 + <!-- 工作餐晚餐时间 START -->
  372 + <div class="col-md-4">
  373 + <label class="control-label col-md-5">工作餐晚餐时间:</label>
  374 + <div class="col-md-5">
  375 + <input type="text" class="form-control" name="workeDinner" value="{{map.workeDinner}}" id="workeDinnerInput"
  376 + placeholder="请输入工作餐晚餐时间">
  377 + </div>
  378 + </div>
  379 + <!-- 工作餐晚餐时间 END -->
  380 + <!-- 上行进场时间 START -->
  381 + <div class="col-md-4">
  382 + <label class="control-label col-md-5">上行进场时间&nbsp;&nbsp;&nbsp;:</label>
  383 + <div class="col-md-5">
  384 + <input type="text" class="form-control" name="upInTimer" value="{{map.upInTimer}}" id="upInTimerInput"
  385 + placeholder="请输入上行进场时间">
  386 + </div>
  387 + </div>
  388 + <!-- 上行进场时间 END -->
  389 +</div>
  390 +<!-- 表单分组组件 form-group END -->
  391 +
  392 +<!-- 表单分组组件 form-group START -->
  393 +<div class="form-group">
  394 + <!-- 上行出场时间 START -->
  395 + <div class="col-md-4">
  396 + <label class="control-label col-md-5">上行出场时间&nbsp;&nbsp;&nbsp;:</label>
  397 + <div class="col-md-5">
  398 + <input type="text" class="form-control" name="upOutTimer" value="{{map.upOutTimer}}" id="upOutTimerInput"
  399 + placeholder="请输入上行出场时间">
  400 + </div>
  401 + </div>
  402 + <!-- 上行出场时间 END -->
  403 + <!-- 下行进场时间 START -->
  404 + <div class="col-md-4">
  405 + <label class="control-label col-md-5">下行进场时间&nbsp;&nbsp;&nbsp;:</label>
  406 + <div class="col-md-5">
  407 + <input type="text" class="form-control" name="downInTimer" value="{{map.downInTimer}}" id="downInTimerInput"
  408 + placeholder="请输入下行进场时间">
  409 + </div>
  410 + </div>
  411 + <!-- 下行进场时间 END -->
  412 + <!-- 下行出场时间 START -->
  413 + <div class="col-md-4">
  414 + <label class="control-label col-md-5">下行出场时间&nbsp;&nbsp;&nbsp;:</label>
  415 + <div class="col-md-5">
  416 + <input type="text" class="form-control" name="downOutTimer" value="{{map.downOutTimer}}" id="downOutTimerInput"
  417 + placeholder="请输入下行出场时间">
  418 + </div>
  419 + </div>
  420 + <!-- 下行出场时间 END -->
  421 +</div>
  422 +<!-- 表单分组组件 form-group END -->
  423 +
  424 +<!-- 表单分组组件 form-group START -->
  425 +<div class="form-group">
  426 + <!-- 上行进场里程 START -->
  427 + <div class="col-md-4">
  428 + <label class="control-label col-md-5">上行进场里程&nbsp;&nbsp;&nbsp;:</label>
  429 + <div class="col-md-5">
  430 + <input type="text" class="form-control" name="upInMileage" value="{{map.upInMileage}}" id="upInlcInput"
  431 + placeholder="请输入上行进场里程">
  432 + </div>
  433 + </div>
  434 + <!-- 上行进场里程 END -->
  435 + <!-- 上行出场里程 START -->
  436 + <div class="col-md-4">
  437 + <label class="control-label col-md-5">上行出场里程&nbsp;&nbsp;&nbsp;:</label>
  438 + <div class="col-md-5">
  439 + <input type="text" class="form-control" name="upOutMileage" value="{{map.upOutMileage}}" id="upOutlcInput"
  440 + placeholder="请输入上行出场里程">
  441 + </div>
  442 + </div>
  443 + <!-- 上行出场里程 END -->
  444 + <!-- 下行进场里程 START -->
  445 + <div class="col-md-4">
  446 + <label class="control-label col-md-5">下行进场里程&nbsp;&nbsp;&nbsp;:</label>
  447 + <div class="col-md-5">
  448 + <input type="text" class="form-control" name="downInMileage" value="{{map.downInMileage}}" id="downInlcInput"
  449 + placeholder="请输入下行进场里程">
  450 + </div>
  451 + </div>
  452 + <!-- 下行进场里程 END -->
  453 +</div>
  454 +<!-- 表单分组组件 form-group END -->
  455 +
  456 +<!-- 表单分组组件 form-group START -->
  457 +<div class="form-group">
  458 + <!-- 下行出场里程 START -->
  459 + <div class="col-md-4">
  460 + <label class="control-label col-md-5">下行出场里程&nbsp;&nbsp;&nbsp;:</label>
  461 + <div class="col-md-5">
  462 + <input type="text" class="form-control" name="downOutMileage" value="{{map.downOutMileage}}" id="downOutlcInput"
  463 + placeholder="请输入下行出场里程">
  464 + </div>
  465 + </div>
  466 + <!-- 下行出场里程 END -->
  467 + <!-- 早晚例行保养 START -->
  468 + <div class="col-md-4">
  469 + <label class="control-label col-md-5">早晚例行保养&nbsp;&nbsp;&nbsp;:</label>
  470 + <div class="col-md-5">
  471 + <input type="text" class="form-control" name="lb" value="{{map.lb}}" id="lbInput"
  472 + placeholder="请输入早晚例行保养">
  473 + </div>
  474 + </div>
  475 + <!-- 早晚例行保养 END -->
  476 +</div>
  477 +<!-- 表单分组组件 form-group END -->
  478 +</script>
  479 +
  480 +<script type="text/html" id="carnum_tempconfig">
  481 +<h4 class="form-section"> 时刻表与线路名称 </h4>
  482 +<div class="form-group">
  483 + <div class="col-md-4">
  484 + <label class="control-label col-md-5"> 时刻表名称&nbsp;&nbsp;: </label>
  485 + <div class="col-md-7">
  486 + <p class="form-control-static" data-display="skbName"> </p>
  487 + </div>
  488 + </div>
  489 + <div class="col-md-4">
  490 + <label class="control-label col-md-5"> 线路名称&nbsp;&nbsp;&nbsp;: </label>
  491 + <div class="col-md-4">
  492 + <p class="form-control-static" data-display="lineName"> </p>
  493 + </div>
  494 + </div>
  495 +</div>
  496 +<h4 class="form-section"> 参数详情 </h4>
  497 +<!-- 表单分组组件 form-group START -->
  498 +<div class="form-group">
  499 + <!-- 起始站首班时间 (* 必填项) START -->
  500 + <div class="col-md-4">
  501 + <label class="control-label col-md-5"> 起始站首班时间: </label>
  502 + <div class="col-md-4">
  503 + <p class="form-control-static" data-display="startStationFirstTime"> </p>
  504 + </div>
  505 + </div>
  506 + <!-- 起始站首班时间 (* 必填项) END -->
  507 + <!-- 起始站末班时间 (* 必填项) START -->
  508 + <div class="col-md-4">
  509 + <label class="control-label col-md-5"> 起始站末班时间: </label>
  510 + <div class="col-md-4">
  511 + <p class="form-control-static" data-display="startStationEndTime"> </p>
  512 + </div>
  513 + </div>
  514 + <!-- 起始站末班时间 (* 必填项) END -->
  515 + <!-- 终点站首班时间 (* 必填项) START -->
  516 + <div class="col-md-4">
  517 + <label class="control-label col-md-5"> 终点站首班时间: </label>
  518 + <div class="col-md-4">
  519 + <p class="form-control-static" data-display="endStationFirstTime"> </p>
  520 + </div>
  521 + </div>
  522 + <!-- 终点站首班时间 (* 必填项) END -->
  523 +</div>
  524 +<!-- 表单分组组件 form-group END -->
  525 +
  526 +<!-- 表单分组组件 form-group START -->
  527 +<div class="form-group">
  528 + <!-- 终点站末班时间 (* 必填项) START -->
  529 + <div class="col-md-4">
  530 + <label class="control-label col-md-5"> 终点站末班时间: </label>
  531 + <div class="col-md-4">
  532 + <p class="form-control-static" data-display="endStationEndTime"> </p>
  533 + </div>
  534 + </div>
  535 + <!-- 终点站末班时间 (* 必填项) END -->
  536 + <!-- 早高峰开始时间(* 必填项) START -->
  537 + <div class="col-md-4">
  538 + <label class="control-label col-md-5"> 早高峰开始时间: </label>
  539 + <div class="col-md-4">
  540 + <p class="form-control-static" data-display="earlyStartTime"> </p>
  541 + </div>
  542 + </div>
  543 + <!-- 早高峰开始时间 (* 必填项) END -->
  544 + <!-- 早高峰结束时间 (* 必填项) START -->
  545 + <div class="col-md-4">
  546 + <label class="control-label col-md-5"> 早高峰结束时间: </label>
  547 + <div class="col-md-4">
  548 + <p class="form-control-static" data-display="earlyEndTime"> </p>
  549 + </div>
  550 + </div>
  551 + <!-- 早高峰结束时间 (* 必填项) END -->
  552 +</div>
  553 +<!-- 表单分组组件 form-group END -->
  554 +
  555 +<!-- 表单分组组件 form-group START -->
  556 +<div class="form-group">
  557 + <!-- 晚高峰开始时间(* 必填项) START -->
  558 + <div class="col-md-4">
  559 + <label class="control-label col-md-5"> 晚高峰开始时间: </label>
  560 + <div class="col-md-4">
  561 + <p class="form-control-static" data-display="lateStartTime"> </p>
  562 + </div>
  563 + </div>
  564 + <!-- 晚高峰开始时间(* 必填项) END -->
  565 + <!-- 晚高峰结束时间(* 必填项) START -->
  566 + <div class="col-md-4">
  567 + <label class="control-label col-md-5"> 晚高峰结束时间: </label>
  568 + <div class="col-md-4">
  569 + <p class="form-control-static" data-display="lateEndTime"> </p>
  570 + </div>
  571 + </div>
  572 + <!-- 晚高峰结束时间(* 必填项) END -->
  573 + <!-- 早高峰前配车数(* 必填项) START -->
  574 + <div class="col-md-4">
  575 + <label class="control-label col-md-5"> 早高峰前配车数: </label>
  576 + <div class="col-md-4">
  577 + <p class="form-control-static" data-display="zgfbeforepcs"> </p>
  578 + </div>
  579 + </div>
  580 + <!-- 早高峰前配车数(* 必填项) END -->
  581 +</div>
  582 +<!-- 表单分组组件 form-group END -->
  583 +
  584 +<!-- 表单分组组件 form-group START -->
  585 +<div class="form-group">
  586 + <!-- 早高峰配车数(* 必填项) START -->
  587 + <div class="col-md-4">
  588 + <label class="control-label col-md-5"> 早高峰配车数&nbsp;&nbsp;&nbsp;: </label>
  589 + <div class="col-md-4">
  590 + <p class="form-control-static" data-display="zgfpcs"> </p>
  591 + </div>
  592 + </div>
  593 + <!-- 早高峰配车数(* 必填项) END -->
  594 + <!-- 高峰之间配车数(* 必填项) START -->
  595 + <div class="col-md-4">
  596 + <label class="control-label col-md-5"> 高峰之间配车数: </label>
  597 + <div class="col-md-4">
  598 + <p class="form-control-static" data-display="gfzjpcs"> </p>
  599 + </div>
  600 + </div>
  601 + <!-- 高峰之间配车数(* 必填项) END -->
  602 + <!-- 晚高峰配车数(* 必填项) START -->
  603 + <div class="col-md-4">
  604 + <label class="control-label col-md-5"> 晚高峰配车数&nbsp;&nbsp;&nbsp;: </label>
  605 + <div class="col-md-4">
  606 + <p class="form-control-static" data-display="wgfpcs"> </p>
  607 + </div>
  608 + </div>
  609 + <!-- 晚高峰配车数(* 必填项) END -->
  610 +</div>
  611 +<!-- 表单分组组件 form-group END -->
  612 +
  613 +<!-- 表单分组组件 form-group START -->
  614 +<div class="form-group">
  615 + <!-- 晚高峰后配车数(* 必填项) START -->
  616 + <div class="col-md-4">
  617 + <label class="control-label col-md-5"> 晚高峰后配车数: </label>
  618 + <div class="col-md-4">
  619 + <p class="form-control-static" data-display="wgfafterpcs"> </p>
  620 + </div>
  621 + </div>
  622 + <!-- 晚高峰后配车数(* 必填项) END -->
  623 + <!-- 上行行驶时间(* 必填项) START -->
  624 + <div class="col-md-4">
  625 + <label class="control-label col-md-5"> 上行行驶时间&nbsp;&nbsp;&nbsp;: </label>
  626 + <div class="col-md-4">
  627 + <p class="form-control-static" data-display="upTravelTime"> </p>
  628 + </div>
  629 + </div>
  630 + <!-- 上行行驶时间(* 必填项) END -->
  631 + <!-- 下行行驶时间(* 必填项) START -->
  632 + <div class="col-md-4">
  633 + <label class="control-label col-md-5"> 下行行驶时间&nbsp;&nbsp;&nbsp;: </label>
  634 + <div class="col-md-4">
  635 + <p class="form-control-static" data-display="downTravelTime"> </p>
  636 + </div>
  637 + </div>
  638 + <!-- 下行行驶时间(* 必填项) END -->
  639 +</div>
  640 +<!-- 表单分组组件 form-group END -->
  641 +
  642 +<!-- 表单分组组件 form-group START -->
  643 +<div class="form-group">
  644 + <!-- 上行行驶里程(* 必填项) START -->
  645 + <div class="col-md-4">
  646 + <label class="control-label col-md-5"> 上行行驶里程&nbsp;&nbsp;&nbsp;: </label>
  647 + <div class="col-md-4">
  648 + <p class="form-control-static" data-display="upMileage"> </p>
  649 + </div>
  650 + </div>
  651 + <!-- 上行行驶里程(* 必填项) END-->
  652 + <!-- 下行行驶里程(* 必填项) START -->
  653 + <div class="col-md-4">
  654 + <label class="control-label col-md-5"> 下行行驶里程&nbsp;&nbsp;&nbsp;: </label>
  655 + <div class="col-md-4">
  656 + <p class="form-control-static" data-display="downMileage"> </p>
  657 + </div>
  658 + </div>
  659 + <!-- 下行行驶里程(* 必填项) END -->
  660 + <!-- 平时停站间隙(* 必填项) START -->
  661 + <div class="col-md-4">
  662 + <label class="control-label col-md-5"> 平时停站间隙&nbsp;&nbsp;&nbsp;: </label>
  663 + <div class="col-md-4">
  664 + <p class="form-control-static" data-display="stopTime"> </p>
  665 + </div>
  666 + </div>
  667 + <!-- 平时停站间隙(* 必填项) END -->
  668 +</div>
  669 +<!-- 表单分组组件 form-group END -->
  670 +
  671 +<!-- 表单分组组件 form-group START -->
  672 +<div class="form-group">
  673 + <!-- 最大停站间隙(* 必填项) START -->
  674 + <div class="col-md-4">
  675 + <label class="control-label col-md-5"> 最大停站间隙&nbsp;&nbsp;&nbsp;: </label>
  676 + <div class="col-md-4">
  677 + <p class="form-control-static" data-display="maxstopTime"> </p>
  678 + </div>
  679 + </div>
  680 + <!-- 最大停站间隙(* 必填项) END -->
  681 + <!-- 最小停站间隙(* 必填项) START -->
  682 + <div class="col-md-4">
  683 + <label class="control-label col-md-5"> 最小停站间隙&nbsp;&nbsp;&nbsp;: </label>
  684 + <div class="col-md-4">
  685 + <p class="form-control-static" data-display="mixstopTime"> </p>
  686 + </div>
  687 + </div>
  688 + <!-- 最小停站间隙(* 必填项) END -->
  689 + <!-- 停车场 START -->
  690 + <div class="col-md-4">
  691 + <label class="control-label col-md-5">停车场&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
  692 + <div class="col-md-6">
  693 + <p class="form-control-static" data-display="carPark"> </p>
  694 + </div>
  695 + </div>
  696 + <!-- 停车场 START -->
  697 +</div>
  698 +<!-- 表单分组组件 form-group END -->
  699 +
  700 +<!-- 表单分组组件 form-group START -->
  701 +<div class="form-group">
  702 + <!-- 早高峰上行时间 START -->
  703 + <div class="col-md-4">
  704 + <label class="control-label col-md-5"> 早高峰上行时间: </label>
  705 + <div class="col-md-4">
  706 + <p class="form-control-static" data-display="earlyUpTime"> </p>
  707 + </div>
  708 + </div>
  709 + <!-- 早高峰上行时间 END -->
  710 + <!-- 早高峰下行时间 START -->
  711 + <div class="col-md-4">
  712 + <label class="control-label col-md-5"> 早高峰下行时间: </label>
  713 + <div class="col-md-4">
  714 + <p class="form-control-static" data-display="earlyDownTime"> </p>
  715 + </div>
  716 + </div>
  717 + <!-- 早高峰下行时间 END -->
  718 + <!-- 晚高峰上行时间 START -->
  719 + <div class="col-md-4">
  720 + <label class="control-label col-md-5"> 晚高峰上行时间: </label>
  721 + <div class="col-md-4">
  722 + <p class="form-control-static" data-display="lateUpTime"> </p>
  723 + </div>
  724 + </div>
  725 + <!-- 晚高峰上行时间 END -->
  726 +</div>
  727 +<!-- 表单分组组件 form-group END -->
  728 +
  729 +<!-- 表单分组组件 form-group START -->
  730 +<div class="form-group">
  731 + <!-- 晚高峰下行时间 START -->
  732 + <div class="col-md-4">
  733 + <label class="control-label col-md-5"> 晚高峰下行时间:</label>
  734 + <div class="col-md-4">
  735 + <p class="form-control-static" data-display="lateDownTime"> </p>
  736 + </div>
  737 + </div>
  738 + <!-- 晚高峰下行时间 END -->
  739 + <!-- 低谷上行时间 START -->
  740 + <div class="col-md-4">
  741 + <label class="control-label col-md-5">低谷上行时间&nbsp;&nbsp;&nbsp;: </label>
  742 + <div class="col-md-4">
  743 + <p class="form-control-static" data-display="troughUpTime"> </p>
  744 + </div>
  745 + </div>
  746 + <!-- 低谷上行时间 END -->
  747 + <!-- 低谷下行时间 START -->
  748 + <div class="col-md-4">
  749 + <label class="control-label col-md-5"> 低谷下行时间&nbsp;&nbsp;&nbsp;: </label>
  750 + <div class="col-md-4">
  751 + <p class="form-control-static" data-display="troughDownTime"> </p>
  752 + </div>
  753 + </div>
  754 + <!-- 低谷下行时间 END -->
  755 +</div>
  756 +<!-- 表单分组组件 form-group END -->
  757 +
  758 +<!-- 表单分组组件 form-group START -->
  759 +<div class="form-group">
  760 + <!-- 区间上行时间 START -->
  761 + <div class="col-md-4">
  762 + <label class="control-label col-md-5"> 区间上行时间&nbsp;&nbsp;&nbsp;:</label>
  763 + <div class="col-md-4">
  764 + <p class="form-control-static" data-display="qjUpTime"> </p>
  765 + </div>
  766 + </div>
  767 + <!-- 区间上行时间 END -->
  768 + <!-- 区间下行时间 START -->
  769 + <div class="col-md-4">
  770 + <label class="control-label col-md-5">区间下行时间&nbsp;&nbsp;&nbsp;: </label>
  771 + <div class="col-md-4">
  772 + <p class="form-control-static" data-display="qjDownTime"> </p>
  773 + </div>
  774 + </div>
  775 + <!-- 区间下行时间 END -->
  776 + <!-- 空放行驶时间 START -->
  777 + <div class="col-md-4">
  778 + <label class="control-label col-md-5"> 空放行驶时间&nbsp;&nbsp;&nbsp;: </label>
  779 + <div class="col-md-4">
  780 + <p class="form-control-static" data-display="kfsj"> </p>
  781 + </div>
  782 + </div>
  783 + <!-- 空放行驶时间 END -->
  784 +</div>
  785 +<!-- 表单分组组件 form-group END -->
  786 +
  787 +<!-- 表单分组组件 form-group START -->
  788 +<div class="form-group">
  789 + <!-- 工作餐午餐时间 START -->
  790 + <div class="col-md-4">
  791 + <label class="control-label col-md-5"> 工作餐午餐时间: </label>
  792 + <div class="col-md-4">
  793 + <p class="form-control-static" data-display="workeLunch"> </p>
  794 + </div>
  795 + </div>
  796 + <!-- 工作餐午餐时间 END -->
  797 + <!-- 工作餐晚餐时间 START -->
  798 + <div class="col-md-4">
  799 + <label class="control-label col-md-5"> 工作餐晚餐时间: </label>
  800 + <div class="col-md-4">
  801 + <p class="form-control-static" data-display="workeDinner"> </p>
  802 + </div>
  803 + </div>
  804 + <!-- 空放行驶时间 END -->
  805 + <!-- 上行进场时间 START -->
  806 + <div class="col-md-4">
  807 + <label class="control-label col-md-5"> 上行进场时间&nbsp;&nbsp;&nbsp;:</label>
  808 + <div class="col-md-4">
  809 + <p class="form-control-static" data-display="upInTimer"> </p>
  810 + </div>
  811 + </div>
  812 + <!-- 上行进场时间 END -->
  813 +</div>
  814 +<!-- 表单分组组件 form-group END -->
  815 +
  816 +<!-- 表单分组组件 form-group START -->
  817 +<div class="form-group">
  818 + <!-- 上行出场时间 START -->
  819 + <div class="col-md-4">
  820 + <label class="control-label col-md-5"> 上行出场时间&nbsp;&nbsp;&nbsp;: </label>
  821 + <div class="col-md-4">
  822 + <p class="form-control-static" data-display="upOutTimer"> </p>
  823 + </div>
  824 + </div>
  825 + <!-- 上行出场时间 END -->
  826 + <!-- 下行进场时间 START -->
  827 + <div class="col-md-4">
  828 + <label class="control-label col-md-5"> 下行进场时间&nbsp;&nbsp;&nbsp;: </label>
  829 + <div class="col-md-4">
  830 + <p class="form-control-static" data-display="downInTimer"> </p>
  831 + </div>
  832 + </div>
  833 + <!-- 下行进场时间 END -->
  834 + <!-- 下行出场时间 START -->
  835 + <div class="col-md-4">
  836 + <label class="control-label col-md-5"> 下行出场时间&nbsp;&nbsp;&nbsp;: </label>
  837 + <div class="col-md-4">
  838 + <p class="form-control-static" data-display="downOutTimer"> </p>
  839 + </div>
  840 + </div>
  841 + <!-- 下行出场时间 END -->
  842 +</div>
  843 +<!-- 表单分组组件 form-group END -->
  844 +
  845 +<!-- 表单分组组件 form-group START -->
  846 +<div class="form-group">
  847 + <!-- 上行进场里程 START -->
  848 + <div class="col-md-4">
  849 + <label class="control-label col-md-5"> 上行进场里程&nbsp;&nbsp;&nbsp;: </label>
  850 + <div class="col-md-4">
  851 + <p class="form-control-static" data-display="upInMileage"> </p>
  852 + </div>
  853 + </div>
  854 + <!-- 上行进场里程 END -->
  855 + <!-- 上行出场里程 START -->
  856 + <div class="col-md-4">
  857 + <label class="control-label col-md-5">上行出场里程&nbsp;&nbsp;&nbsp;:</label>
  858 + <div class="col-md-4">
  859 + <p class="form-control-static" data-display="upOutMileage"> </p>
  860 + </div>
  861 + </div>
  862 + <!-- 上行出场里程 END -->
  863 + <!-- 下行进场里程 START -->
  864 + <div class="col-md-4">
  865 + <label class="control-label col-md-5">下行进场里程&nbsp;&nbsp;&nbsp;: </label>
  866 + <div class="col-md-4">
  867 + <p class="form-control-static" data-display="downInMileage"> </p>
  868 + </div>
  869 + </div>
  870 + <!-- 下行进场里程 END -->
  871 +</div>
  872 +<!-- 表单分组组件 form-group END -->
  873 +
  874 +<!-- 表单分组组件 form-group START -->
  875 +<div class="form-group">
  876 + <!-- 下行出场里程 START -->
  877 + <div class="col-md-4">
  878 + <label class="control-label col-md-5"> 下行出场里程&nbsp;&nbsp;&nbsp;:</label>
  879 + <div class="col-md-4">
  880 + <p class="form-control-static" data-display="downOutMileage"> </p>
  881 + </div>
  882 + </div>
  883 + <!-- 下行出场里程 END -->
  884 + <!-- 早晚例行保养 START -->
  885 + <div class="col-md-4">
  886 + <label class="control-label col-md-5">早晚例行保养&nbsp;&nbsp;&nbsp;:</label>
  887 + <div class="col-md-4">
  888 + <p class="form-control-static" data-display="lb"> </p>
  889 + </div>
  890 + </div>
  891 + <!-- 早晚例行保养 END -->
  892 +</div>
  893 +<!-- 表单分组组件 form-group END -->
  894 +</script>
0 895 \ No newline at end of file
... ...
src/main/resources/static/pages/electricity/list/list.html
... ... @@ -10,30 +10,29 @@
10 10 <li><span class="active">进出场存电量</span></li>
11 11 </ul>
12 12  
13   -<div class="row" id="ll_dlb_list">
  13 +<div class="row" id="dl_oil_list">
14 14 <div class="col-md-12">
15 15 <!-- Begin: life time stats -->
16 16 <div class="portlet light portlet-fit portlet-datatable bordered">
17 17 <div class="portlet-title">
18 18 <div class="caption">
19   - <i class="fa fa-battery-quarter"></i> <span
  19 + <i class="fa fa-fire-extinguisher"></i> <span
20 20 class="caption-subject font-dark sbold uppercase">进出场存电量表</span>
21 21 </div>
22 22 <div class="actions">
23   - <!-- <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> -->
24   - <button type="button" class="btn btn-circle blue" id="sortButton"><i class="fa fa-minus-square"></i>
25   - 保存
  23 + <button type="button" class="btn btn-circle blue" id="saveButton"><i class="fa fa-minus-square"></i>
  24 + 保存
26 25 </button>
27 26 <button type="button" class="btn btn-circle blue" id="obtain"><i class="fa fa-hourglass-half"></i>
28   - 获取加/存电信息
  27 + 获取加/存电信息
29 28 </button>
30 29 <button type="button" class="btn btn-circle blue" id="checkDl"><i class="fa fa-gg-circle"></i>
31   - 核对加注量(有加电无里程)
  30 + 核对加注量(有加电无里程)
32 31 </button>
33   - <!-- <button type="button" class="btn btn-circle blue" id="export"><i class="fa fa-file-excel-o"></i>
34   - 导出Excel
35   - </button> -->
36   - <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> 删除用户</button> -->
  32 + <button class="btn btn-circle blue"
  33 + id="export"> <i class="fa fa-file-excel-o"></i>
  34 + 导出Excel
  35 + </button>
37 36 </div>
38 37 </div>
39 38 <div class="portlet-body">
... ... @@ -41,72 +40,120 @@
41 40 <table
42 41 class="table table-striped table-bordered table-hover table-checkable"
43 42 id="datatable_dlb">
44   - <thead>
  43 + <thead >
45 44 <tr role="row" class="filter">
46   - <td> 公司:</td>
47   - <td colspan="2">
48   -
49   - <select class="form-control" name="ssgsdm_like" id="ylbListGsdmId" ></select>
50   -
51   - </td>
52   - <td>
53   - 分公司:
54   - </td>
55   - <td colspan="2">
56   -
57   - <select class="form-control" name="fgsdm_like" id="ylbListFgsdmId" ></select>
58   - </td>
59   -
60   - <td>
61   - 日期:
62   - </td>
63   - <td>
64   - <input type="text" style="width: 80px" name="rq" id="rq"/>
65   - </td>
66   - <td >
67   - 线路:
68   - </td>
69   - <td colspan="2">
70   - <select class="form-control" name="xlbm_eq" id="xlbm" style="width: 120px;"></select>
71   - &nbsp;
72   - </td>
73   - <td >
74   - 内部编码:
75   - </td>
76   - <td colspan="2">
77   - <select class="form-control" name="nbbm_eq" id="nbbm" style="width: 120px;"></select>
78   - </td>
79   - <td colspan="4">
80   - <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px">
81   - <i class="fa fa-search"></i> 搜索
82   - </button>
  45 + <td colspan="2">
  46 + <div style="float: right; " >&nbsp;公司</div>
  47 + </td>
  48 + <td colspan="3">
  49 + <div style="float: left;width: 150px">
  50 + <select class="form-control" name="ssgsdm_like"
  51 + id="ylbListGsdmId"></select>
  52 + </div>
  53 + </td>
  54 + <td colspan="2">
  55 + <div style="float: right; " >&nbsp;分公司</div>
  56 + </td>
  57 + <td colspan="3">
  58 + <div style="float: left;">
  59 + <select class="form-control" name="fgsdm_like"
  60 + id="ylbListFgsdmId" style="width: 150px"></select>
  61 + </div>
  62 + </td>
  63 + <td >
  64 + <div style="float: right; ">日期</div>
  65 + </td>
  66 + <td colspan="2">
  67 + <div style="float: left;">
  68 + <input type="text" style="width: 120px" name="rq" id="rq" />
  69 + </div>
  70 + </td>
  71 + <td rowspan="2" colspan="2">
  72 + <div style="float: left;">
  73 + &nbsp;<button
  74 + class="btn btn-sm green btn-outline filter-submit margin-bottom"
  75 + style="margin-right: 0px">
  76 + <i class="fa fa-search"></i> 搜索
  77 + </button> <!-- <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px"> -->
  78 + <!-- <i class="fa fa-times"></i> 重置 -->
  79 + <!-- </button> -->
83 80  
84   - <button class="btn btn-sm red btn-outline filter-cancel" style="margin-right:0px">
85   - <i class="fa fa-times"></i> 重置
86   - </button>
87   -
88   - </td>
  81 + </div>
  82 + </td>
89 83 </tr>
  84 + <tr class="filter2">
  85 + <td colspan="2">
  86 + <div style="float: right; ">&nbsp;线路</div>
  87 + </td>
  88 + <td colspan="3">
  89 + <div style="float: left;">
  90 + <select class="form-control" name="xlbm_like" id="xlbm"
  91 + style="width: 150px;"></select>
  92 + </div>
  93 + </td>
  94 + <td colspan="2">
  95 + <div style="float: right;">&nbsp;内部编码</div>
  96 + </td>
  97 + <td colspan="3">
  98 + <div style="float: left;">
  99 + <select class="form-control" name="nbbm_eq" id="nbbm"
  100 + style="width: 120px;"></select>
  101 + </div>
  102 + <div style="float: left;">
  103 + <button class="btn btn-sm #000 btn-outline filter-cancel"
  104 + style="margin-right: 0px">
  105 + <i class="fa fa-times"></i>
  106 + </button>
  107 + </div>
  108 + </td>
  109 + <td >
  110 + <div style="float: right;">
  111 + 类型
  112 + </div>
  113 + </td>
  114 + <td colspan="2">
  115 + <div style="float: left;">
  116 + <select class="form-control" name="sxtj">
  117 + <option value="0">全部</option>
  118 + <option value="1">一车一单</option>
  119 + <option value="2">一车多单</option>
  120 + <option value="3">有充电没里程</option>
  121 + <option value="4">有里程没充电</option>
  122 + </select>
  123 + </div>
  124 +
  125 + </td>
  126 + </tr>
  127 + <tr>
  128 + <td colspan="17">
  129 + <div style="float: left;">
  130 + 总计
  131 + &nbsp;&nbsp;
  132 + 充电量:&nbsp;<label id="sumJzl"></label>
  133 + &nbsp;&nbsp;
  134 + 耗电量:&nbsp;<label id="sumYh"></label>
  135 + &nbsp;&nbsp;
  136 + 损耗电量:&nbsp;<label id="sumSh"></label>
  137 + </div>
  138 + </td>
  139 + </tr>
90 140 <tr role="row" class="heading">
91 141 <th width="2%">#</th>
92   - <th width="9%">日期</th>
93   - <th width="6%">公司</th>
94   - <th width="9%">线路</th>
95   - <th width="6%">自编号</th>
96   - <th width="7%">驾驶员</th>
  142 + <th width="8%">日期</th>
  143 + <th width="5%">公司</th>
  144 + <th width="8%">线路</th>
  145 + <th width="5%">自编号</th>
  146 + <th width="6%">驾驶员</th>
97 147 <th width="4%">充电量</th>
98   - <th width="5%">出场公里</th>
99   - <th width="4%">进场公里</th>
100   - <th width="4%">出场存电</th>
101   - <th width="4%">进场存电</th>
  148 + <th width="6%">出场存电</th>
  149 + <th width="6%">进场存电</th>
102 150 <th width="5%">耗电</th>
103   - <th width="4%">尿素</th>
104 151 <th width="5%">耗损原因</th>
105   - <th width="5%">耗损电量</th>
106   - <th width="5%">当日总里程</th>
107   - <th width="5%">数据类型</th>
108   - <th width="5%">百公里电耗</th>
109   - <!-- <th width="5%">操作</th> -->
  152 + <th width="4%">耗损电量</th>
  153 + <th width="4%">当日总里程</th>
  154 + <th width="4%">数据类型</th>
  155 + <th width="4%">百公里电耗</th>
  156 +<!-- <th width="5%">操作</th> -->
110 157 </tr>
111 158 </thead>
112 159 <tbody></tbody>
... ... @@ -124,9 +171,8 @@
124 171 {{each list as obj i}}
125 172 <tr>
126 173 <td style="vertical-align: middle;">
127   - <input type="radio" name="id" class="group-checkable icheck" data-id="{{obj.id}}">
  174 + <input type="checkbox" name="id" class="group-checkable icheck" data-id="{{obj.id}}">
128 175 </td>
129   -
130 176 <td>
131 177 {{obj.rq}}
132 178 </td>
... ... @@ -137,160 +183,248 @@
137 183 {{obj.xlname}}
138 184 </td>
139 185 <td>
140   - {{obj.nbbm}}
  186 + <lable data-id="{{obj.id}}" class="in_carpark_nbbm">{{obj.nbbm}}</lable>
  187 +
141 188 </td>
142 189 <td>
143 190 {{obj.jsy}}
144 191 </td>
145 192 <td>
146   - {{obj.cdl}}
147   - </td>
148   - <td>
149   - {{obj.czlc}}
150   - </td>
151   - <td>
152   - {{obj.jzlc}}
153   - </td>
154   - <td>
155   - {{obj.czcd}}
  193 +
  194 + <lable data-id="{{obj.id}}" class="in_carpark_cdl"> {{obj.cdl}}</lable>
156 195 </td>
157 196 <td>
158   - <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzdl">
159   - {{obj.jzcd}}
160   - </a>
161   - %
  197 +
  198 + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_czcd"
  199 + type="text" value=" {{obj.czcd}}" style=" width:40px;float:left"
  200 +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
  201 + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" />
  202 + <lable style="float:left">%<lable>
162 203 </td>
163 204 <td>
164   -
165   - <a data-id="{{obj.id}}" href="javascript:;" class="in_carpark_hdl">
166   - {{obj.hd}}
167   - </a>
  205 + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzcd"
  206 + type="text" value=" {{obj.jzcd}}" style=" width:40px;float:left"
  207 +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
  208 + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" />
  209 + <lable style="float:left">%<lable>
168 210 </td>
169 211 <td>
170   - {{obj.ns}}
  212 +<input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_hd"
  213 + type="text" value=" {{obj.hd}}" style=" width:45px;float:left"
  214 +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
  215 + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" />
171 216 </td>
172 217 <td>
173   - {{obj.shyy}}
  218 + <select data-id="{{obj.id}}" class="in_carpark_shyy" style=" width:80px">
  219 + <option value='0' {{if obj.shyy==0}} selected = 'selected' {{/if}}>请选择</option>
  220 + <option value='1' {{if obj.shyy==1}} selected = 'selected' {{/if}}>票务用电</option>
  221 + <option value='2' {{if obj.shyy==2}} selected = 'selected' {{/if}}>保养用电</option>
  222 + <option value='3' {{if obj.shyy==3}} selected = 'selected' {{/if}}>报废车用电</option>
  223 + <option value='4' {{if obj.shyy==4}} selected = 'selected' {{/if}}>其它用电</option>
  224 + <option value='5' {{if obj.shyy==5}} selected = 'selected' {{/if}}>人保部</option>
  225 + <option value='6' {{if obj.shyy==6}} selected = 'selected' {{/if}}>车队</option>
  226 + <option value='7' {{if obj.shyy==7}} selected = 'selected' {{/if}}>车间(高保)</option>
  227 + <option value='8' {{if obj.shyy==8}} selected = 'selected' {{/if}}>车间(小修)</option>
  228 + </select>
174 229 </td>
175 230 <td>
176   - {{obj.sh}}
177   - </td>
  231 + <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_shyl"
  232 + value={{obj.sh}} style=" width:40px" type="text"
  233 +onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
  234 + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" />
  235 +
  236 +</td>
178 237 <td>
179 238 {{obj.zlc}}
180 239 </td>
181 240 <td>
182   - {{obj.yhlx}}
  241 + <select data-id="{{obj.id}}" class="in_carpark_yhlx">
  242 + <option value='0' {{if obj.yhlx==0}} selected = 'selected' {{/if}}>手录</option>
  243 + <option value='1' {{if obj.yhlx==1}} selected = 'selected' {{/if}}>拆分</option>
  244 + </select>
183 245 </td>
184 246 <td>
185 247 {{obj.bglyh}}
186 248 </td>
187   -
188 249 </tr>
189 250 {{/each}}
190 251 {{if list.length == 0}}
191 252 <tr>
192   - <td colspan=19><h6 class="muted">没有找到相关数据</h6></td>
  253 + <td colspan=15><h6 class="muted">没有找到相关数据</h6></td>
193 254 </tr>
194 255 {{/if}}
195 256 </script>
196 257  
197 258 <script>
198 259 $(function () {
  260 + var fage=false;
199 261 //var id = 15;
200   - //$('.in_carpark_jzdl[data-id='+id+']', '#ll_dlb_list')
  262 + //$('.in_carpark_jzcd[data-id='+id+']', '#dl_oil_list')
201 263  
202   - $("#checkDl").on('click', function () {
  264 + $("#checkYl").on('click', function () {
203 265 if ($("#rq").val() != "") {
204   - var cells = $('tr.filter')[0].cells
205   - , params = {}
206   - , name;
207   - $.each(cells, function (i, cell) {
208   - var items = $('input,select', cell);
209   - for (var j = 0, item; item = items[j++];) {
210   - name = $(item).attr('name');
211   - if (name) {
212   - params[name] = $(item).val();
213   - }
214   - }
215   - });
  266 + var params=getParamsList();
216 267 var i = layer.load(2);
217   - $get('/dlb/checkDl', params, function () {
  268 + $get('/ylb/checkYl', params, function () {
218 269 layer.close(i);
219   - var cells = $('tr.filter')[0].cells
220   - , params1 = {}
221   - , name;
222   - $.each(cells, function (i, cell) {
223   - var items = $('input,select', cell);
224   - for (var j = 0, item; item = items[j++];) {
225   - name = $(item).attr('name');
226   - if (name) {
227   - params1[name] = $(item).val();
228   - }
229   - }
230   - });
231   - jsDoQuery(params1, true);
  270 + jsDoQuery(params, true);
232 271 });
233 272 } else {
234 273 layer.msg('请选择日期.');
235 274 }
236 275 })
237 276  
238   - //拆分
  277 + //进场等于出场
  278 + $("#outAndIn").on('click', function () {
  279 + console.log("进场油量等于出场油量");
  280 + if ($("#rq").val() != "") {
  281 + var params=getParamsList();
  282 + var i = layer.load(2);
  283 + $get('/ylb/outAndIn', params, function () {
  284 + layer.close(i);
  285 + jsDoQuery(params, true);
  286 + });
  287 + } else {
  288 + layer.msg('请选择日期.');
  289 + }
  290 + });
  291 +
  292 +
  293 + //保存
  294 + $("#saveButton").on('click',function(){
  295 + var ylArray = [];
  296 + $('input.icheck').each(function(){
  297 + var map = {};
  298 + var id=$(this).data('id');
  299 + var nbbm =$('.in_carpark_nbbm[data-id='+id+']', '#dl_oil_list').html();
  300 + var cdl =$('.in_carpark_cdl[data-id='+id+']', '#dl_oil_list').html();
  301 + if(cdl=="" || cdl ==null){
  302 + cdl=0;
  303 + }
  304 + var czcd=$('.in_carpark_czcd[data-id='+id+']', '#dl_oil_list').val();
  305 + if(czcd=="" || czcd==null){
  306 + czcd=0;
  307 + }
  308 + var jzcd=$('.in_carpark_jzcd[data-id='+id+']', '#dl_oil_list').val();
  309 + if(jzcd=="" || jzcd==null){
  310 + jzcd=0;
  311 + }
  312 +
  313 + var sh = $('.in_carpark_shyl[data-id='+id+']', '#dl_oil_list').val();
  314 + if(sh=="" || sh==null){
  315 + sh=0;
  316 + }
  317 +
  318 + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#dl_oil_list').val();
  319 + var hd = $('.in_carpark_hd[data-id='+id+']', '#dl_oil_list').val();
  320 + if(hd=="" || hd==null){
  321 + hd=0;
  322 + }
  323 + var yhlx = $('.in_carpark_yhlx[data-id='+id+']', '#dl_oil_list').val();
  324 +
  325 + map['id']=id;
  326 + map['cdl']=cdl;
  327 + map['czcd']=czcd;
  328 + map['jzcd']=jzcd;
  329 + map['sh']=sh;
  330 + map['shyy']=shyy;
  331 + map['yhlx']=yhlx;
  332 + map['nbbm']=nbbm;
  333 + map['hd']=hd;
  334 + map['rq']=$("#rq").val();
  335 + ylArray.push(map);
  336 + })
  337 + var params = {};
  338 + params['dlbList']=JSON.stringify(ylArray);
  339 + var i = layer.load(2);
  340 + $post('/dlb/saveDlbList', params, function () {
  341 + layer.close(i);
  342 + var params1 =getParamsList();
  343 + jsDoQuery(params1, true);
  344 + });
  345 + })
  346 + //拆分
239 347 $("#sortButton").on('click', function () {
240 348 if ($("#rq").val() != "") {
241   - var id = $('input.icheck:checked').data('id');
  349 + var ylArray = [];
  350 + var nbbm="";
  351 + var msg="";
  352 + $('input.icheck:checked').each(function(){
  353 + var map = {};
  354 + var id=$(this).data('id');
  355 + var clzbh =$('.in_carpark_nbbm[data-id='+id+']', '#dl_oil_list').html();
  356 + if(nbbm.indexOf(clzbh)>-1){
  357 + if(msg==""){
  358 + msg += clzbh;
  359 + }else{
  360 + msg += ","+clzbh;
  361 + }
  362 + }else{
  363 + nbbm +=clzbh;
  364 + var jzyl=$('.in_carpark_jzcd[data-id='+id+']', '#dl_oil_list').val();
  365 + var sh = $('.in_carpark_shyl[data-id='+id+']', '#dl_oil_list').val();
  366 + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#dl_oil_list').val();
  367 + var ns = $('.in_carpark_ns[data-id='+id+']', '#dl_oil_list').val();
  368 + var rylx= $('.in_carpark_rylx[data-id='+id+']', '#dl_oil_list').val();
  369 + map['id']=id;
  370 + map['jzyl']=jzyl;
  371 + map['sh']=sh;
  372 + map['shyy']=shyy;
  373 + map['ns']=ns;
  374 + map['rylx']=rylx;
  375 + ylArray.push(map);
  376 + }
  377 +
  378 + }) ;
  379 + if(msg!=""){
  380 + layer.msg('内部编码为:【'+msg +'】的车辆请选择一条数据进行拆分.');
  381 + }else{
  382 + var params = {};
  383 + params['ylbList']=JSON.stringify(ylArray);
  384 + var i = layer.load(2);
  385 + $post('/ylb/sort', params, function () {
  386 + layer.close(i);
  387 + var params1 =getParamsList();
  388 + jsDoQuery(params1, true);
  389 + });
  390 +
  391 + }
  392 +
  393 + /* var id = $('input.icheck:checked').data('id');
242 394  
243 395 if (typeof(id) == 'undefined') {
244 396 layer.msg("请选择一行进行拆分");
245 397 } else {
246 398 //获取输入的进场存油
247   - var jzdl = $('.in_carpark_jzdl[data-id='+id+']', '#ll_dlb_list').html();
248   - var hdl= $('.in_carpark_hdl[data-id='+id+']', '#ll_dlb_list').html();
  399 + var jzyl = $('.in_carpark_jzcd[data-id='+id+']', '#dl_oil_list').html();
  400 + var sh = $('.in_carpark_shyl[data-id='+id+']', '#dl_oil_list').html();
  401 + var shyy = $('.in_carpark_shyy[data-id='+id+']', '#dl_oil_list').val();
249 402 // $("#jzyl" + id).html();
250 403 var params = {};
251   - params['jzdl'] = jzdl;
  404 + params['jzyl'] = jzyl;
  405 + params['sh'] =sh;
  406 + params['shyy']=shyy;
252 407 params['id'] = id;
253   - params['hdl']=hdl;
254 408 var i = layer.load(2);
255   - $get('/dlb/sort', params, function () {
  409 + $get('/ylb/sort', params, function () {
256 410 layer.close(i);
257   - var cells = $('tr.filter')[0].cells
258   - , params1 = {}
259   - , name;
260   - $.each(cells, function (i, cell) {
261   - var items = $('input,select', cell);
262   - for (var j = 0, item; item = items[j++];) {
263   - name = $(item).attr('name');
264   - if (name) {
265   - params1[name] = $(item).val();
266   - }
267   - }
268   - });
  411 + var params1 =getParamsList();
269 412 jsDoQuery(params1, true);
270 413 });
271 414  
272   - }
  415 + } */
273 416 } else {
274 417 layer.msg('请选择日期.');
275 418 }
276 419 })
277 420 //获取加存信息
278 421 $("#obtain").on('click', function () {
  422 + console.log("获取加存");
279 423 if ($("#rq").val() != "") {
280   - var cells = $('tr.filter')[0].cells
281   - , params = {}
282   - , name;
283   - $.each(cells, function (i, cell) {
284   - var items = $('input,select', cell);
285   - for (var j = 0, item; item = items[j++];) {
286   - name = $(item).attr('name');
287   - if (name) {
288   - params[name] = $(item).val();
289   - }
290   - }
291   - });
  424 + var params =getParamsList();
  425 +
292 426 var i = layer.load(2);
293   - $get('/dlb/obtain', params, function (s) {
  427 + $get('/dlb/obtain', params, function () {
294 428 layer.close(i);
295 429 jsDoQuery(params, true);
296 430 });
... ... @@ -306,13 +440,13 @@
306 440  
307 441 var page = 0, initPagination;
308 442 var icheckOptions = {
309   - radioClass: 'iradio_square-blue icheck',
  443 + radioClass: 'icheckbox_flat-blue',
310 444 increaseArea: '20%'
311 445 }
312 446  
313 447 //重置
314   - $('tr.filter .filter-cancel').on('click', function () {
315   - $('tr.filter input, select').val('').change();
  448 + $('tr.filter2 .filter-cancel').on('click', function () {
  449 + $('tr.filter2 , #nbbm').val('').change();
316 450 });
317 451  
318 452 //提交
... ... @@ -324,38 +458,58 @@
324 458 }else if(ylbGsdm=="" || ylbGsdm==null || ylbFgsdm=="" ||ylbFgsdm==null){
325 459 layer.msg('请选择公司和分公司.');
326 460 }else {
327   - var cells = $('tr.filter')[0].cells
328   - , params = {}
329   - , name;
330   - $.each(cells, function (i, cell) {
331   - var items = $('input,select', cell);
332   - for (var j = 0, item; item = items[j++];) {
333   - name = $(item).attr('name');
334   - if (name) {
335   - params[name] = $(item).val();
336   - }
337   - }
338   - });
  461 + var params = getParamsList();
  462 +
  463 +
339 464 page = 0;
340 465 jsDoQuery(params, true);
341 466 }
342 467 });
343 468  
  469 + function getParamsList(){
  470 + var cells = $('tr.filter')[0].cells
  471 + , cells1 = $('tr.filter2')[0].cells,params = {}
  472 + , name;
  473 + $.each(cells, function (i, cell) {
  474 + var items = $('input,select', cell);
  475 + for (var j = 0, item; item = items[j++];) {
  476 + name = $(item).attr('name');
  477 + if (name) {
  478 + params[name] = $(item).val();
  479 + }
  480 + }
  481 + });
  482 + $.each(cells1, function (i, cell) {
  483 + var items = $('input,select', cell);
  484 + for (var j = 0, item; item = items[j++];) {
  485 + name = $(item).attr('name');
  486 + if (name) {
  487 + params[name] = $(item).val();
  488 + }
  489 + }
  490 + });
  491 +
  492 + return params;
  493 + }
344 494  
345 495 // var gsqxdm="";
346 496  
347   -
348   - $.get('/user/companyData', function(result){
349   - obj = result;
350   - var options="";
351   -// = '<option value="">请选择</option>';
352   - for(var i = 0; i < obj.length; i++){
353   - options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
354   -// setFgsqx(obj[i].companyCode);
355   - }
356   - $('#ylbListGsdmId').html(options);
357   - updateCompany();
358   - });
  497 + var xlList;
  498 + var obj=[];
  499 + $.get('/report/lineList',function(result){
  500 + xlList=result;
  501 + $.get('/user/companyData', function(result){
  502 + obj = result;
  503 + var options="";
  504 + // = '<option value="">请选择</option>';
  505 + for(var i = 0; i < obj.length; i++){
  506 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  507 + // setFgsqx(obj[i].companyCode);
  508 + }
  509 + $('#ylbListGsdmId').html(options);
  510 + updateCompany();
  511 + });
  512 + })
359 513 /* function setFgsqx(gs){
360 514 var company =gs
361 515 var options = '';
... ... @@ -382,6 +536,7 @@
382 536 }
383 537 }
384 538 $('#ylbListFgsdmId').html(options);
  539 + initXl();
385 540 }
386 541 /*
387 542 * 获取数据 p: 要提交的参数, pagination: 是否重新分页
... ... @@ -413,26 +568,31 @@
413 568 params['fgsdm_in']=fgsqx1;
414 569 }
415 570 } */
416   - var i = layer.load(2);
417   - $get('/dlb', params, function (data) {
418   - $.each(data.content, function (i, obj) {
  571 +
  572 + var l = layer.load(2);
  573 + $get('/dlb/dlbList', params, function (data) {
  574 +
  575 + $.each(data, function (i, obj) {
419 576 obj.rq = moment(obj.rq).format("YYYY-MM-DD");
420 577 });
421   - var bodyHtm = template('dlb_list_temp', {list: data.content});
422   -
423   - $('#datatable_dlb tbody').html(bodyHtm)
  578 + var bodyHtm = template('dlb_list_temp', {list:data});
  579 + $('#datatable_dlb tbody').html(bodyHtm);
  580 + /* $('#datatable_dlb tbody').html(bodyHtm)
424 581 .find('.icheck').iCheck(icheckOptions)
425 582 .on('ifChanged', iCheckChange);
426 583 if (pagination && data.content.length > 0) {
427 584 //重新分页
428 585 initPagination = true;
429 586 showPagination(data);
430   - }
431   - layer.close(i);
432   -
433   - startOptHdlLink($('#ll_dlb_list .in_carpark_hdl'));
434   - startOptJzylLink($('#ll_dlb_list .in_carpark_jzdl'));
435   -
  587 + } */
  588 + layer.close(l);
  589 + $get('/dlb/sumYlb',params,function(returns){
  590 + $("#sumJzl").html(returns.jzl);
  591 + $("#sumYh").html(returns.yh);
  592 + $("#sumSh").html(returns.sh);
  593 + });
  594 +// startOptJzylLink($('#dl_oil_list .in_carpark_jzcd'));
  595 +// startOptShylLink($('#dl_oil_list .in_carpark_shyl'));
436 596 });
437 597 }
438 598  
... ... @@ -450,8 +610,6 @@
450 610 return '只能为数字!';
451 611 if (value < 0)
452 612 return '值不能小于0!';
453   - if (value > 100)
454   - return '值不能大于100!';
455 613 },
456 614 inputclass: 'form-control input-medium input-edtable-sm'
457 615 })
... ... @@ -459,9 +617,10 @@
459 617 $(this).text(params.newValue);
460 618 });
461 619 }
462   -
463   - function startOptHdlLink(es2) {
464   - es2.editable({
  620 +
  621 + //改变状态
  622 + function startOptShylLink(es) {
  623 + es.editable({
465 624 type: 'text',
466 625 placement: 'right',
467 626 width: 100,
... ... @@ -480,7 +639,6 @@
480 639 $(this).text(params.newValue);
481 640 });
482 641 }
483   -
484 642 function iCheckChange() {
485 643 var tr = $(this).parents('tr');
486 644 if (this.checked)
... ... @@ -511,18 +669,7 @@
511 669 return;
512 670 }
513 671  
514   - var cells = $('tr.filter')[0].cells
515   - , params = {}
516   - , name;
517   - $.each(cells, function (i, cell) {
518   - var items = $('input,select', cell);
519   - for (var j = 0, item; item = items[j++];) {
520   - name = $(item).attr('name');
521   - if (name) {
522   - params[name] = $(item).val();
523   - }
524   - }
525   - });
  672 + var params=getParamsList();
526 673 page = num - 1;
527 674 jsDoQuery(params, true);
528 675 }
... ... @@ -532,87 +679,132 @@
532 679  
533 680 //删除
534 681 $('#removeButton').on('click', function () {
535   - if ($(this).attr('disabled'))
536   - return;
537   -
538   - var id = $('input.icheck:checked').data('id');
539   - removeConfirm('确定要删除选中的数据?', '/resource/' + id, function () {
540   - $('tr.filter .filter-submit').click();
541   - });
  682 + var idArray = [];
  683 + var x=0;
  684 + $('input.icheck:checked').each(function(){
  685 + x++;
  686 + var map ={};
  687 + var id=$(this).data('id');
  688 + map['id']=id;
  689 + idArray.push(map);
  690 +
  691 + })
  692 + var params = {};
  693 + params['ids']=JSON.stringify(idArray);
  694 + if (x==0) {
  695 + layer.msg("请选择要删除的数据");
  696 + }else{
  697 + if(confirm('确定要删除选中的数据?'))
  698 + {
  699 + var i = layer.load(2);
  700 + $post('/ylb/deleteIds', params, function (result) {
  701 + layer.close(i);
  702 + var params=getParamsList();
  703 + jsDoQuery(params, true);
  704 + });
  705 + }
  706 + }
542 707 });
543 708  
544 709 //搜索线路
545   - $.get('/basic/lineCode2Name',function(result){
  710 + /* $.get('/basic/lineCode2Name',function(result){
546 711 var data=[];
547   -
  712 + data.push({id: " ", text: "全部线路"});
548 713 for(var code in result){
549 714 data.push({id: code, text: result[code]});
550 715 }
551 716 initPinYinSelect2('#xlbm',data,'');
552 717  
553   - })
554   -
555   - $('#nbbm').select2({
556   - placeholder: '搜索车辆...',
557   - ajax: {
558   - url: '/realSchedule/sreachVehic',
559   - dataType: 'json',
560   - delay: 150,
561   - data: function (params) {
562   - return {nbbm: params.term};
  718 + }) */
  719 +
  720 +
  721 + $("#ylbListFgsdmId").on("change",initXl);
  722 + function initXl(){
  723 + var data=[];
  724 + data.push({id: " ", text: "全部线路"});
  725 + if(fage){
  726 + $("#xlbm").select2("destroy").html('');
  727 + }
  728 + var fgs=$('#ylbListFgsdmId').val();
  729 + var gs=$('#ylbListGsdmId').val();
  730 + for(var i=0;i<xlList.length;i++){
  731 + if(gs!=""){
  732 + if(fgs!=""){
  733 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  734 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  735 + }
  736 + }else{
  737 + if(xlList[i]["gsbm"]==gs){
  738 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  739 + }
  740 + }
  741 + }
  742 + }
  743 + initPinYinSelect2('#xlbm',data,'');
  744 + fage=true;
  745 + }
  746 +// $("#ylbListGsdmId").on("change",initNbbm);
  747 +// $("#ylbListFgsdmId").on("change",initNbbm);
  748 +// $("#xlbm").on("change",initNbbm);
  749 +// function initNbbm(){
  750 +// var gsbm=$('#ylbListGsdmId').val(),
  751 +// var fgsbm=$('#ylbListFgsdmId').val(),
  752 +// var xlbm=$('#xlbm').val();
  753 +
  754 + $('#nbbm').select2({
  755 + placeholder: '搜索车辆...',
  756 + ajax: {
  757 + url: '/report/carList',
  758 + dataType: 'json',
  759 + delay: 150,
  760 + data: function (params) {
  761 + return {nbbm: params.term,
  762 + gsbm:$('#ylbListGsdmId').val(),
  763 + fgsbm:$('#ylbListFgsdmId').val(),
  764 + xlbm:$('#xlbm').val()};
  765 + },
  766 + processResults: function (data) {
  767 + return {
  768 + results: data
  769 + };
  770 + },
  771 + cache: true
563 772 },
564   - processResults: function (data) {
565   - return {
566   - results: data
567   - };
  773 + templateResult: function (repo) {
  774 + if (repo.loading) return repo.text;
  775 + var h = '<span>' + repo.text + '</span>';
  776 + h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
  777 + return h;
568 778 },
569   - cache: true
570   - },
571   - templateResult: function (repo) {
572   - if (repo.loading) return repo.text;
573   - var h = '<span>' + repo.text + '</span>';
574   - h += (repo.lineName ? '&nbsp;<span class="select2-desc">' + repo.lineName + '</span>' : '');
575   - return h;
576   - },
577   - escapeMarkup: function (markup) {
578   - return markup;
579   - },
580   - minimumInputLength: 1,
581   - templateSelection: function (repo) {
582   - return repo.text;
583   - },
584   - language: {
585   - noResults: function () {
586   - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  779 + escapeMarkup: function (markup) {
  780 + return markup;
587 781 },
588   - inputTooShort: function (e) {
589   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  782 + minimumInputLength: 1,
  783 + templateSelection: function (repo) {
  784 + return repo.text;
590 785 },
591   - searching: function () {
592   - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  786 + language: {
  787 + noResults: function () {
  788 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  789 + },
  790 + inputTooShort: function (e) {
  791 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  792 + },
  793 + searching: function () {
  794 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  795 + }
593 796 }
594   - }
595   - })
596   -
  797 + });
  798 +// }
  799 +
597 800  
598 801 //导出
599 802  
600 803 $("#export").on("click", function () {
601 804 if ($("#rq").val() != "") {
602   - var cells = $('tr.filter')[0].cells
603   - , params = {}
604   - , name;
605   - $.each(cells, function (i, cell) {
606   - var items = $('input,select', cell);
607   - for (var j = 0, item; item = items[j++];) {
608   - name = $(item).attr('name');
609   - if (name) {
610   - params[name] = $(item).val();
611   - }
612   - }
613   - });
  805 + var params=getParamsList();
614 806 $post('/ylb/listExport', params, function (result) {
615   - window.open("/downloadFile/download?fileName=进出场存电量" + moment($("#rq").val()).format("YYYYMMDD"));
  807 + window.open("/downloadFile/download?fileName="+$("#rq").val()+"进出场存油量" );
616 808 });
617 809 } else {
618 810 layer.msg('请选择日期.');
... ...
src/main/resources/static/pages/forms/statement/waybillQp.html
... ... @@ -324,7 +324,7 @@
324 324 <td>{{obj.zdsjActual}}</td>
325 325 <td>{{obj.fast}}</td>
326 326 <td>{{obj.slow}}</td>
327   - <td>{{obj.jhlc}}</td>
  327 + <td>{{obj.jhlcOrig}}</td>
328 328 <td>{{obj.sjlc}}</td>
329 329 <td title="{{obj.remarks}}">
330 330 {{if obj.remarks !=""}}
... ...
src/main/resources/static/pages/oil/jyglList.html
... ... @@ -128,35 +128,35 @@
128 128 {{obj.nbbm}}
129 129 </td>
130 130 <td>
131   - <select class="form-control in_carpark_jsy" name="jsy" id="jsy{{obj.id}}" data-id="{{obj.id}}">
  131 + <select class="form-control in_carpark_jsy" style=" width:100px" name="jsy" id="{{obj.nbbm}}" data-id="{{obj.nbbm}}">
132 132 <option selected="selected" value="{{obj.jsy}}">{{obj.jsy}}<option>
133 133 </select>
134 134 </td>
135 135 <td>
136 136  
137   - <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jzl"
  137 + <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_jzl"
138 138 type="text" value="{{obj.jzl}}" style=" width:45px"
139 139 onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"
140 140 onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')">
141 141 </td>
142 142 <td>
143   - <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_stationid"
  143 + <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_stationid"
144 144 type="text" value="{{obj.stationid}}" style=" width:45px" />
145 145 </td>
146 146 <td>
147   - <select data-id="{{obj.id}}" class="in_carpark_nylx" style=" width:80px" >
  147 + <select data-id="{{obj.nbbm}}" class="in_carpark_nylx" style=" width:80px" >
148 148 <option value='0' {{if obj.nylx==0}} selected = 'selected' {{/if}}>0号柴油</option>
149 149 <option value='1' {{if obj.nylx==1}} selected = 'selected' {{/if}}>负10号柴油</option>
150 150 </select>
151 151 </td>
152 152 <td>
153   - <input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_jyggh"
  153 + <input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_jyggh"
154 154 type="text" value="{{obj.jyggh}}" style=" width:45px" />
155 155 </td>
156 156 <td></td>
157 157 <td>{{obj.ldgh}}</td>
158 158 <td>
159   -<input data-id="{{obj.id}}" href="javascript:;" class="in_carpark_bz"
  159 +<input data-id="{{obj.nbbm}}" href="javascript:;" class="in_carpark_bz"
160 160 type="text" value="{{obj.bz}}" style=" width:45px" />
161 161 </td>
162 162 <td>
... ... @@ -199,8 +199,8 @@ $(function(){
199 199 params['gsbm']=$("#jyglListGsdmId").val();
200 200 params['fgsbm']=$("#jyglListFgsdmId").val();
201 201 params['rq']=$("#rq").val();
202   - console.log(params);
203 202 var i = layer.load(2);
  203 + console.log(params);
204 204 $post('/cwjy/savejzl', params, function(){
205 205 layer.close(i);
206 206 var cells = $('tr.filter')[0].cells
... ... @@ -343,6 +343,7 @@ $(function(){
343 343 console.log(data)
344 344 var bodyHtm = template('jygl_list_temp', {list: data});
345 345 $('#datatable_cwjy tbody').html(bodyHtm);
  346 + iCheckChange();
346 347 // .find('.icheck').iCheck(icheckOptions)
347 348 // .on('ifChanged', iCheckChange);
348 349 // if(pagination && data.dataList.length > 0){
... ... @@ -362,6 +363,11 @@ $(function(){
362 363 else
363 364 tr.removeClass('row-active');
364 365  
  366 +
  367 + $('input.icheck').each(function(){
  368 + var nbbm=$(this).data('id');
  369 + startOptJsy(nbbm);
  370 + })
365 371 // var id = $('input.icheck:checked').data('id');
366 372 // $("#jsy"+id).attr("disabled", false);
367 373 // startOptJsy(id);
... ... @@ -372,6 +378,48 @@ $(function(){
372 378 $('#removeButton').attr('disabled', 'disabled'); */
373 379 }
374 380  
  381 + //改变状态
  382 + function startOptJsy(id){
  383 + $('#'+id).select2({
  384 + placeholder: '搜索驾驶员...',
  385 + ajax: {
  386 + url: '/report/userList',
  387 + dataType: 'json',
  388 + delay: 150,
  389 + data: function(params){
  390 + return{jsy: params.term,gsbm:$('#jyglListGsdmId').val()};
  391 + },
  392 + processResults: function (data) {
  393 + return {
  394 + results: data
  395 + };
  396 + },
  397 + cache: true
  398 + },
  399 + templateResult: function(repo){
  400 + if (repo.loading) return repo.text;
  401 + var h = '<span>'+repo.text+'</span>';
  402 + return h;
  403 + },
  404 + escapeMarkup: function (markup) { return markup; },
  405 + minimumInputLength: 1,
  406 + templateSelection: function(repo){
  407 + return repo.text;
  408 + },
  409 + language: {
  410 + noResults: function(){
  411 + return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>';
  412 + },
  413 + inputTooShort : function(e) {
  414 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>';
  415 + },
  416 + searching : function() {
  417 + return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>';
  418 + }
  419 + }
  420 + })
  421 + }
  422 +
375 423 function showPagination(data){
376 424 //分页
377 425 $('#pagination').jqPaginator({
... ... @@ -429,45 +477,5 @@ function changeEnabled(id,enabled){
429 477 })
430 478 }
431 479  
432   -//改变状态
433   -function startOptJsy(id){
434   - $('#jsy'+id).select2({
435   - placeholder: '搜索驾驶员...',
436   - ajax: {
437   - url: '/personnel/sreachPersonnel',
438   - dataType: 'json',
439   - delay: 150,
440   - data: function(params){
441   - return{jobCode: params.term};
442   - },
443   - processResults: function (data) {
444   - return {
445   - results: data
446   - };
447   - },
448   - cache: true
449   - },
450   - templateResult: function(repo){
451   - if (repo.loading) return repo.text;
452   - var h = '<span>'+repo.text+'</span>';
453   - return h;
454   - },
455   - escapeMarkup: function (markup) { return markup; },
456   - minimumInputLength: 1,
457   - templateSelection: function(repo){
458   - return repo.text;
459   - },
460   - language: {
461   - noResults: function(){
462   - return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>';
463   - },
464   - inputTooShort : function(e) {
465   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>';
466   - },
467   - searching : function() {
468   - return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>';
469   - }
470   - }
471   - })
472   -}
  480 +
473 481 </script>
474 482 \ No newline at end of file
... ...
src/main/resources/static/pages/oil/list_ph.html
... ... @@ -59,7 +59,7 @@
59 59 <table
60 60 class="table table-striped table-bordered table-hover table-checkable"
61 61 id="datatable_ylb">
62   - <thead>
  62 + <thead >
63 63 <tr role="row" class="filter">
64 64 <td colspan="2">
65 65 <div style="float: right; " >&nbsp;公司&nbsp;</div>
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/form.html
... ... @@ -126,6 +126,14 @@
126 126 </div>
127 127 </div>
128 128  
  129 + <div class="form-group has-success has-feedback">
  130 + <label class="col-md-2 control-label">模式1(历史排班优先):</label>
  131 + <div class="col-md-3">
  132 + <sa-Radiogroup model="ctrl.schedulePlanManageForSave.isHistoryPlanFirst" dicgroup="truefalseType" name="isHistoryPlanFirst"></sa-Radiogroup>
  133 + </div>
  134 + </div>
  135 +
  136 +
129 137 <!-- 其他form-group -->
130 138  
131 139 </div>
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/module.js
... ... @@ -206,6 +206,9 @@ angular.module(&#39;ScheduleApp&#39;).controller(
206 206 self.schedulePlanManageForSave.xl.id = service.getSearchCondition()['xl.id_eq'];
207 207 self.schedulePlanManageForSave.xl.name = service.getSearchCondition()['xl.name_eq'];
208 208  
  209 + // 默认使用历史排班数据
  210 + self.schedulePlanManageForSave.isHistoryPlanFirst = true;
  211 +
209 212 // 提交方法
210 213 self.submit = function() {
211 214 console.log(self.schedulePlanManageForSave);
... ...