Commit c113ed1854296b4cf7f23d5be9e912f8772b0bf0
1 parent
406146b1
修改线路基础数据权限分配.新增时刻表编辑工具.
Showing
18 changed files
with
2973 additions
and
136 deletions
Too many changes to show.
To preserve performance only 18 of 26 files are displayed.
src/main/java/com/bsth/repository/schedule/TTInfoDetailRepository.java
| @@ -51,5 +51,7 @@ public interface TTInfoDetailRepository extends BaseRepository<TTInfoDetail, Lon | @@ -51,5 +51,7 @@ public interface TTInfoDetailRepository extends BaseRepository<TTInfoDetail, Lon | ||
| 51 | @Query(value = "delete from TTInfoDetail t where t.ttinfo.id = ?1") | 51 | @Query(value = "delete from TTInfoDetail t where t.ttinfo.id = ?1") |
| 52 | void deleteByTtinfoIdWithModify(Long ttinfoid); | 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/schedule/impl/TTInfoDetailServiceImpl.java
| @@ -15,6 +15,7 @@ import com.bsth.repository.StationRepository; | @@ -15,6 +15,7 @@ import com.bsth.repository.StationRepository; | ||
| 15 | import com.bsth.repository.schedule.GuideboardInfoRepository; | 15 | import com.bsth.repository.schedule.GuideboardInfoRepository; |
| 16 | import com.bsth.repository.schedule.TTInfoDetailRepository; | 16 | import com.bsth.repository.schedule.TTInfoDetailRepository; |
| 17 | import com.bsth.repository.schedule.TTInfoRepository; | 17 | import com.bsth.repository.schedule.TTInfoRepository; |
| 18 | +import com.bsth.repository.sys.SysUserRepository; | ||
| 18 | import com.bsth.service.CarParkService; | 19 | import com.bsth.service.CarParkService; |
| 19 | import com.bsth.service.LineInformationService; | 20 | import com.bsth.service.LineInformationService; |
| 20 | import com.bsth.service.StationRouteService; | 21 | import com.bsth.service.StationRouteService; |
| @@ -37,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; | @@ -37,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; | ||
| 37 | import org.springframework.beans.factory.annotation.Qualifier; | 38 | import org.springframework.beans.factory.annotation.Qualifier; |
| 38 | import org.springframework.boot.context.properties.EnableConfigurationProperties; | 39 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| 39 | import org.springframework.stereotype.Service; | 40 | import org.springframework.stereotype.Service; |
| 41 | +import org.springframework.transaction.annotation.Transactional; | ||
| 40 | import org.springframework.util.CollectionUtils; | 42 | import org.springframework.util.CollectionUtils; |
| 41 | 43 | ||
| 42 | import java.io.File; | 44 | import java.io.File; |
| @@ -76,6 +78,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -76,6 +78,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 76 | @Autowired | 78 | @Autowired |
| 77 | private CarParkRepository carParkRepository; | 79 | private CarParkRepository carParkRepository; |
| 78 | @Autowired | 80 | @Autowired |
| 81 | + private SysUserRepository sysUserRepository; | ||
| 82 | + @Autowired | ||
| 79 | private GuideboardInfoRepository guideboardInfoRepository; | 83 | private GuideboardInfoRepository guideboardInfoRepository; |
| 80 | @Autowired | 84 | @Autowired |
| 81 | @Qualifier(value = "dataToolsServiceImpl") | 85 | @Qualifier(value = "dataToolsServiceImpl") |
| @@ -533,14 +537,29 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -533,14 +537,29 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 533 | public List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId) { | 537 | public List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId) { |
| 534 | return ttInfoDetailRepository.findBcdetails(xlId, ttinfoId, lpId); | 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 | public Map<String, Object> skbDetailMxSave(Map<String, Object> map) { | 551 | public Map<String, Object> skbDetailMxSave(Map<String, Object> map) { |
| 539 | Map<String, Object> rs_m = new HashMap<String,Object>(); | 552 | Map<String, Object> rs_m = new HashMap<String,Object>(); |
| 540 | try { | 553 | try { |
| 554 | + // 1、获取数据. | ||
| 541 | String d = map.get("d") == null ? null : map.get("d").toString(); | 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 | if(d!=null) | 561 | if(d!=null) |
| 543 | - ttInfoDetailRepository.save(jsonArrayToListEntity(d)); | 562 | + ttInfoDetailRepository.save(jsonArrayToListEntity(d));// 2、保存. |
| 544 | } catch (Exception e) { | 563 | } catch (Exception e) { |
| 545 | e.printStackTrace(); | 564 | e.printStackTrace(); |
| 546 | rs_m.put("status", ResponseCode.ERROR); | 565 | rs_m.put("status", ResponseCode.ERROR); |
| @@ -549,68 +568,153 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -549,68 +568,153 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 549 | return rs_m; | 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 | public List<TTInfoDetail> jsonArrayToListEntity(String jsonStr) throws Exception { | 580 | public List<TTInfoDetail> jsonArrayToListEntity(String jsonStr) throws Exception { |
| 581 | + // 1、创建list分装的时刻表明细实体对象数据. | ||
| 553 | List<TTInfoDetail> listTd = new ArrayList<TTInfoDetail>(); | 582 | List<TTInfoDetail> listTd = new ArrayList<TTInfoDetail>(); |
| 583 | + // 2、json字符串转json数组. | ||
| 554 | JSONArray jsonArray = JSONArray.parseArray(jsonStr); | 584 | JSONArray jsonArray = JSONArray.parseArray(jsonStr); |
| 585 | + // 3、json数组转list分装的时刻表明细实体对象数据. | ||
| 555 | for(int i =0; i<jsonArray.size();i++) { | 586 | for(int i =0; i<jsonArray.size();i++) { |
| 556 | JSONObject jsonObj = jsonArray.getJSONObject(i); | 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 | listTd.add(objToEntity(jsonObj)); | 588 | listTd.add(objToEntity(jsonObj)); |
| 560 | } | 589 | } |
| 561 | return listTd; | 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 | public TTInfoDetail objToEntity(JSONObject obj) throws Exception { | 602 | public TTInfoDetail objToEntity(JSONObject obj) throws Exception { |
| 603 | + // 1、创建班次实体对象. | ||
| 565 | TTInfoDetail td = new TTInfoDetail(); | 604 | TTInfoDetail td = new TTInfoDetail(); |
| 605 | + // 2、获取线路id键值,并查询出该线路的实体对象. | ||
| 566 | Line xl = lineRepository.findOne(Integer.parseInt(obj.getString("xl"))); | 606 | Line xl = lineRepository.findOne(Integer.parseInt(obj.getString("xl"))); |
| 607 | + // 3、设置线路. | ||
| 567 | td.setXl(xl); | 608 | td.setXl(xl); |
| 609 | + // 4、设置时刻表. | ||
| 568 | td.setTtinfo(obj.getString("ttinfo") == null ? null : infoRepository.findOne(Long.parseLong(obj.getString("ttinfo")))); | 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 | td.setXlDir(dirToCod(obj.get("xlDir").toString())); | 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 | td.setZdz(obj.getString("zdz") ==null ? null :staRepository.findOne(Integer.parseInt(obj.getString("zdz")))); | 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 | return td; | 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 | public GuideboardInfo getLp(Line xl,String name, int code, String lpType) throws Exception { | 674 | public GuideboardInfo getLp(Line xl,String name, int code, String lpType) throws Exception { |
| 675 | + // 1、创建路牌实体对象. | ||
| 591 | GuideboardInfo entity = new GuideboardInfo(); | 676 | GuideboardInfo entity = new GuideboardInfo(); |
| 677 | + // 2、验证是否存在该路牌.如果数据库存在,则使用已有的.否则保存一块新的路牌. | ||
| 592 | List<GuideboardInfo> lgi = guideboardInfoRepository.validateLp(xl, name, code,lpType); | 678 | List<GuideboardInfo> lgi = guideboardInfoRepository.validateLp(xl, name, code,lpType); |
| 593 | if(lgi.size()>0) { | 679 | if(lgi.size()>0) { |
| 594 | entity = lgi.get(0); | 680 | entity = lgi.get(0); |
| 595 | }else{ | 681 | }else{ |
| 682 | + // 1、设置线路. | ||
| 596 | entity.setXl(xl); | 683 | entity.setXl(xl); |
| 684 | + // 2、设置路牌编码. | ||
| 597 | entity.setLpNo(code); | 685 | entity.setLpNo(code); |
| 686 | + // 3、设置路牌名称. | ||
| 598 | entity.setLpName(name); | 687 | entity.setLpName(name); |
| 688 | + // 4、设置路牌类型. | ||
| 599 | entity.setLpType(lpType); | 689 | entity.setLpType(lpType); |
| 690 | + // 5、标记是否已删除. | ||
| 600 | entity.setIsCancel(false); | 691 | entity.setIsCancel(false); |
| 692 | + // 6、设置创建人. | ||
| 601 | entity.setCreateBy(null); | 693 | entity.setCreateBy(null); |
| 694 | + // 7、设置修改人. | ||
| 602 | entity.setUpdateBy(null); | 695 | entity.setUpdateBy(null); |
| 696 | + // 8、保存路牌. | ||
| 603 | guideboardInfoRepository.save(entity); | 697 | guideboardInfoRepository.save(entity); |
| 604 | } | 698 | } |
| 699 | + // 9、返回路牌. | ||
| 605 | return entity; | 700 | return entity; |
| 606 | } | 701 | } |
| 607 | 702 | ||
| 703 | + /** | ||
| 704 | + * @description : (TODO) 线路方向转代码. | ||
| 705 | + * | ||
| 706 | + * @param : [str--方向字符串] | ||
| 707 | + * | ||
| 708 | + * @return 返回方向代码. | ||
| 709 | + * | ||
| 710 | + * @exception : 异常暂先抛出. | ||
| 711 | + * */ | ||
| 608 | public String dirToCod(String str) throws Exception { | 712 | public String dirToCod(String str) throws Exception { |
| 609 | String c = ""; | 713 | String c = ""; |
| 610 | if(str.equals("relationshipGraph-up")) | 714 | if(str.equals("relationshipGraph-up")) |
| 611 | - c = "0"; | 715 | + c = "0";// 上行. |
| 612 | else if(str.equals("relationshipGraph-down")) | 716 | else if(str.equals("relationshipGraph-down")) |
| 613 | - c = "1"; | 717 | + c = "1";// 下行. |
| 614 | return c; | 718 | return c; |
| 615 | } | 719 | } |
| 616 | } | 720 | } |
src/main/resources/application-dev.properties
| @@ -8,9 +8,12 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | @@ -8,9 +8,12 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | ||
| 8 | spring.jpa.database= MYSQL | 8 | spring.jpa.database= MYSQL |
| 9 | spring.jpa.show-sql= true | 9 | spring.jpa.show-sql= true |
| 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver | 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 | spring.datasource.username= root | 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 | #DATASOURCE | 17 | #DATASOURCE |
| 15 | spring.datasource.max-active=100 | 18 | spring.datasource.max-active=100 |
| 16 | spring.datasource.max-idle=8 | 19 | spring.datasource.max-idle=8 |
| @@ -26,7 +29,7 @@ spring.datasource.validation-query=select 1 | @@ -26,7 +29,7 @@ spring.datasource.validation-query=select 1 | ||
| 26 | ## | 29 | ## |
| 27 | #222.66.0.204:5555 | 30 | #222.66.0.204:5555 |
| 28 | ##\u5B9E\u65F6gps | 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 | #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/ | 33 | #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/ |
| 31 | ##\u6D88\u606F\u4E0B\u53D1 | 34 | ##\u6D88\u606F\u4E0B\u53D1 |
| 32 | http.send.directive = http://192.168.168.201:9090/transport_server/message/ | 35 | http.send.directive = http://192.168.168.201:9090/transport_server/message/ |
| 33 | \ No newline at end of file | 36 | \ No newline at end of file |
src/main/resources/static/index.html
| @@ -196,7 +196,7 @@ tr.row-active td { | @@ -196,7 +196,7 @@ tr.row-active td { | ||
| 196 | <!-- LOGO --> | 196 | <!-- LOGO --> |
| 197 | <div class="page-logo"> | 197 | <div class="page-logo"> |
| 198 | <a href="index.html" class="logo-default logo-default-text"> | 198 | <a href="index.html" class="logo-default logo-default-text"> |
| 199 | - 闵行公交调度系统 </a> | 199 | + 浦东公交调度系统 </a> |
| 200 | <div class="menu-toggler sidebar-toggler"></div> | 200 | <div class="menu-toggler sidebar-toggler"></div> |
| 201 | </div> | 201 | </div> |
| 202 | <!-- END LOGO --> | 202 | <!-- END LOGO --> |
src/main/resources/static/login.html
| @@ -181,7 +181,7 @@ | @@ -181,7 +181,7 @@ | ||
| 181 | <div class="wrapper ng-scope"> | 181 | <div class="wrapper ng-scope"> |
| 182 | <div id="loginPanel" class="dialog dialog-shadow"> | 182 | <div id="loginPanel" class="dialog dialog-shadow"> |
| 183 | <br> | 183 | <br> |
| 184 | - <h3 class="logo-text">闵行公交调度系统</h3> | 184 | + <h3 class="logo-text">浦东公交调度系统</h3> |
| 185 | <hr> | 185 | <hr> |
| 186 | <form style="padding: 0px 35px;"> | 186 | <form style="padding: 0px 35px;"> |
| 187 | <div class="form-group" style="margin-bottom: 0"> | 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,117 +22,127 @@ | ||
| 22 | 22 | ||
| 23 | $('#destroy').val(0); | 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 | $('tr.filter .filter-cancel').on('click',function() { | 56 | $('tr.filter .filter-cancel').on('click',function() { |
| 30 | - | ||
| 31 | // 清空搜索框值 | 57 | // 清空搜索框值 |
| 32 | $('tr.filter input,select').val('').change(); | 58 | $('tr.filter input,select').val('').change(); |
| 33 | - | ||
| 34 | /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */ | 59 | /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */ |
| 35 | loadTableDate(null,true); | 60 | loadTableDate(null,true); |
| 36 | }); | 61 | }); |
| 37 | 62 | ||
| 38 | /** 搜索按钮事件 */ | 63 | /** 搜索按钮事件 */ |
| 39 | $('tr.filter .filter-submit').on('click',function(){ | 64 | $('tr.filter .filter-submit').on('click',function(){ |
| 40 | - | ||
| 41 | var params = getParams(); | 65 | var params = getParams(); |
| 42 | - | ||
| 43 | page = 0; | 66 | page = 0; |
| 44 | - | ||
| 45 | /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */ | 67 | /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */ |
| 46 | loadTableDate(params,true); | 68 | loadTableDate(params,true); |
| 47 | }); | 69 | }); |
| 48 | 70 | ||
| 49 | function getParams() { | 71 | function getParams() { |
| 50 | - | ||
| 51 | // cells 集合返回表格中所有(列)单元格的一个数组 | 72 | // cells 集合返回表格中所有(列)单元格的一个数组 |
| 52 | var cells = $('tr.filter')[0].cells; | 73 | var cells = $('tr.filter')[0].cells; |
| 53 | - | ||
| 54 | // 搜索参数集合 | 74 | // 搜索参数集合 |
| 55 | var params = {}; | 75 | var params = {}; |
| 56 | - | ||
| 57 | // 搜索字段名称 | 76 | // 搜索字段名称 |
| 58 | var name; | 77 | var name; |
| 59 | - | ||
| 60 | // 遍历cells数组 | 78 | // 遍历cells数组 |
| 61 | $.each(cells, function(i, cell){ | 79 | $.each(cells, function(i, cell){ |
| 62 | - | ||
| 63 | // 获取第i列的input或者select集合 | 80 | // 获取第i列的input或者select集合 |
| 64 | var items = $('input,select', cell); | 81 | var items = $('input,select', cell); |
| 65 | - | ||
| 66 | // 遍历items集合 | 82 | // 遍历items集合 |
| 67 | for(var j = 0, item; item = items[j++];){ | 83 | for(var j = 0, item; item = items[j++];){ |
| 68 | - | ||
| 69 | // 获取字段名称 | 84 | // 获取字段名称 |
| 70 | name = $(item).attr('name'); | 85 | name = $(item).attr('name'); |
| 71 | - | ||
| 72 | if(name){ | 86 | if(name){ |
| 73 | - | ||
| 74 | // 赋取相对应的值 | 87 | // 赋取相对应的值 |
| 75 | params[name] = $(item).val(); | 88 | params[name] = $(item).val(); |
| 76 | - | ||
| 77 | } | 89 | } |
| 78 | } | 90 | } |
| 79 | }); | 91 | }); |
| 80 | - | ||
| 81 | return params; | 92 | return params; |
| 82 | - | ||
| 83 | } | 93 | } |
| 84 | 94 | ||
| 85 | /** 表格数据分页加载事件 @param:<param : 查询参数;isPon : 是否重新分页> */ | 95 | /** 表格数据分页加载事件 @param:<param : 查询参数;isPon : 是否重新分页> */ |
| 86 | function loadTableDate(param,isPon){ | 96 | function loadTableDate(param,isPon){ |
| 87 | - | ||
| 88 | // 搜索参数 | 97 | // 搜索参数 |
| 89 | var params = {}; | 98 | var params = {}; |
| 90 | - | ||
| 91 | if(param) { | 99 | if(param) { |
| 92 | - | ||
| 93 | params = param; | 100 | params = param; |
| 94 | - | ||
| 95 | } | 101 | } |
| 96 | - | ||
| 97 | // 排序(按更新时间) | 102 | // 排序(按更新时间) |
| 98 | params['order'] = 'id'; | 103 | params['order'] = 'id'; |
| 99 | - | ||
| 100 | // 记录当前页数 | 104 | // 记录当前页数 |
| 101 | params['page'] = page; | 105 | params['page'] = page; |
| 102 | - | ||
| 103 | // 弹出正在加载层 | 106 | // 弹出正在加载层 |
| 104 | var i = layer.load(2); | 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,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 | /* setbrancheCompanySelectOptions();*/ | 215 | /* setbrancheCompanySelectOptions();*/ |
| 227 | 216 | ||
| @@ -267,85 +256,55 @@ | @@ -267,85 +256,55 @@ | ||
| 267 | var len_ = array.length; | 256 | var len_ = array.length; |
| 268 | 257 | ||
| 269 | if(len_>0) { | 258 | if(len_>0) { |
| 270 | - | ||
| 271 | $.each(array, function(i, g){ | 259 | $.each(array, function(i, g){ |
| 272 | 260 | ||
| 273 | /*opGroup += '<option value="'+ g.id + '_' + g.lineCode +'">'+g.name+'</option>';*/ | 261 | /*opGroup += '<option value="'+ g.id + '_' + g.lineCode +'">'+g.name+'</option>';*/ |
| 274 | opGroup += '<option value="'+ g.name +'">'+g.name+'</option>'; | 262 | opGroup += '<option value="'+ g.name +'">'+g.name+'</option>'; |
| 275 | 263 | ||
| 276 | }); | 264 | }); |
| 277 | - | ||
| 278 | } | 265 | } |
| 279 | - | ||
| 280 | opGroup += '</optgroup>'; | 266 | opGroup += '</optgroup>'; |
| 281 | - | ||
| 282 | $('#lineSelect').html(opGroup).select2(); | 267 | $('#lineSelect').html(opGroup).select2(); |
| 283 | - | ||
| 284 | }); | 268 | }); |
| 285 | 269 | ||
| 286 | 270 | ||
| 287 | /** 生成行单,这里暂时只做了单选生成。 */ | 271 | /** 生成行单,这里暂时只做了单选生成。 */ |
| 288 | $('#datatable_ajax_tools #createUsingSingle').on('click', function() { | 272 | $('#datatable_ajax_tools #createUsingSingle').on('click', function() { |
| 289 | - | ||
| 290 | // 获取选中行 | 273 | // 获取选中行 |
| 291 | var arrChk = $("input[type='checkbox']:checked"); | 274 | var arrChk = $("input[type='checkbox']:checked"); |
| 292 | - | ||
| 293 | var len = arrChk.length; | 275 | var len = arrChk.length; |
| 294 | - | ||
| 295 | // 选中行ID与线路名称 | 276 | // 选中行ID与线路名称 |
| 296 | var id = '', lineName = ''; | 277 | var id = '', lineName = ''; |
| 297 | - | ||
| 298 | if(len>1) { | 278 | if(len>1) { |
| 299 | - | ||
| 300 | // 弹出添加成功提示消息 | 279 | // 弹出添加成功提示消息 |
| 301 | layer.msg('存在多选,请只选中一行!'); | 280 | layer.msg('存在多选,请只选中一行!'); |
| 302 | - | ||
| 303 | return ; | 281 | return ; |
| 304 | - | ||
| 305 | }else if(len==0) { | 282 | }else if(len==0) { |
| 306 | - | ||
| 307 | // 弹出添加成功提示消息 | 283 | // 弹出添加成功提示消息 |
| 308 | layer.msg('请选中一条线路!'); | 284 | layer.msg('请选中一条线路!'); |
| 309 | - | ||
| 310 | return ; | 285 | return ; |
| 311 | - | ||
| 312 | }else { | 286 | }else { |
| 313 | - | ||
| 314 | id = arrChk.data('id'); | 287 | id = arrChk.data('id'); |
| 315 | - | ||
| 316 | lineName = arrChk.val(); | 288 | lineName = arrChk.val(); |
| 317 | - | ||
| 318 | // 请求参数 | 289 | // 请求参数 |
| 319 | var params = {lineId:id}; | 290 | var params = {lineId:id}; |
| 320 | - | ||
| 321 | // 弹出正在加载层 | 291 | // 弹出正在加载层 |
| 322 | var index = layer.load(0); | 292 | var index = layer.load(0); |
| 323 | - | ||
| 324 | /** 生成线路行单 @pararm:<params:请求参数> */ | 293 | /** 生成线路行单 @pararm:<params:请求参数> */ |
| 325 | $post('/stationroute/usingSingle',params,function(data) { | 294 | $post('/stationroute/usingSingle',params,function(data) { |
| 326 | - | ||
| 327 | // 关闭弹出框 | 295 | // 关闭弹出框 |
| 328 | layer.close(index); | 296 | layer.close(index); |
| 329 | - | ||
| 330 | if(data.status=='SUCCESS') { | 297 | if(data.status=='SUCCESS') { |
| 331 | - | ||
| 332 | // 弹出添加成功提示消息 | 298 | // 弹出添加成功提示消息 |
| 333 | layer.msg('生成线路【'+ lineName +'】路单文件成功!'); | 299 | layer.msg('生成线路【'+ lineName +'】路单文件成功!'); |
| 334 | - | ||
| 335 | }else if(data.status=='ERROR'){ | 300 | }else if(data.status=='ERROR'){ |
| 336 | - | ||
| 337 | // 弹出添加成功提示消息 | 301 | // 弹出添加成功提示消息 |
| 338 | layer.msg('生成线路【'+ lineName +'】路单文件失败!'); | 302 | layer.msg('生成线路【'+ lineName +'】路单文件失败!'); |
| 339 | - | ||
| 340 | }else if(data.status=='NOTDATA') { | 303 | }else if(data.status=='NOTDATA') { |
| 341 | - | ||
| 342 | // 弹出添加成功提示消息 | 304 | // 弹出添加成功提示消息 |
| 343 | layer.msg('系统无线路【'+ lineName +'】的站点与路段信息!'); | 305 | layer.msg('系统无线路【'+ lineName +'】的站点与路段信息!'); |
| 344 | - | ||
| 345 | } | 306 | } |
| 346 | - | ||
| 347 | }); | 307 | }); |
| 348 | - | ||
| 349 | } | 308 | } |
| 350 | }); | 309 | }); |
| 351 | })(); | 310 | })(); |
| 352 | \ No newline at end of file | 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> 时刻表名称 : | ||
| 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> 线路名称 : | ||
| 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>客容总量 :</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 | \ No newline at end of file | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 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> 线路 : | ||
| 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> 路牌 : | ||
| 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> 方向 : | ||
| 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> 起点站 : | ||
| 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> 终点站 : | ||
| 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> 发车时间 : | ||
| 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> 班次类型 : | ||
| 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> 班次历时 : | ||
| 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> 计划里程 : | ||
| 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> 是否分班 : | ||
| 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 | + 备注 : | ||
| 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 | \ No newline at end of file | 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> 撤 销 | ||
| 56 | + </a> | ||
| 57 | + </li> | ||
| 58 | + <li> | ||
| 59 | + <a href="javascript:" class="tool-action recover"> | ||
| 60 | + <i class="fa fa-share"></i> 恢 复 | ||
| 61 | + </a> | ||
| 62 | + </li> | ||
| 63 | + <li> | ||
| 64 | + <a href="javascript:" class="tool-action reladelete"> | ||
| 65 | + <i class="fa fa-close"></i> 批量删除 | ||
| 66 | + </a> | ||
| 67 | + </li> | ||
| 68 | + <li> | ||
| 69 | + <a href="javascript:" class="tool-action reladplus"> | ||
| 70 | + <i class="fa fa-plus"></i> 添加班次 | ||
| 71 | + </a> | ||
| 72 | + </li> | ||
| 73 | + <li> | ||
| 74 | + <a href="javascript:" class="tool-action addlp"> | ||
| 75 | + <i class="fa fa-plus"></i> 添加路牌 | ||
| 76 | + </a> | ||
| 77 | + </li> | ||
| 78 | + <li> | ||
| 79 | + <a href="javascript:" class="tool-action updownread"> | ||
| 80 | + <i class="fa fa-arrows-h"></i> 均匀发车 | ||
| 81 | + </a> | ||
| 82 | + </li> | ||
| 83 | + <li> | ||
| 84 | + <a href="javascript:" class="tool-action aboutread"> | ||
| 85 | + <i class="fa fa-arrows-v"></i> 调整班次 | ||
| 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 | \ No newline at end of file | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 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 | +}(); |