Commit 2ce4e3106d4b8ce42e05a44b0a5774c10c7197bc

Authored by 潘钊
2 parents 9955cf0f 2b8e8687

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

Showing 22 changed files with 4553 additions and 3038 deletions
src/main/java/com/bsth/controller/schedule/SchedulePlanController.java
@@ -4,11 +4,10 @@ import com.bsth.controller.BaseController; @@ -4,11 +4,10 @@ import com.bsth.controller.BaseController;
4 import com.bsth.entity.schedule.SchedulePlan; 4 import com.bsth.entity.schedule.SchedulePlan;
5 import com.bsth.service.schedule.SchedulePlanService; 5 import com.bsth.service.schedule.SchedulePlanService;
6 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
7 -import org.springframework.web.bind.annotation.RequestBody;  
8 -import org.springframework.web.bind.annotation.RequestMapping;  
9 -import org.springframework.web.bind.annotation.RequestMethod;  
10 -import org.springframework.web.bind.annotation.RestController; 7 +import org.springframework.web.bind.annotation.*;
11 8
  9 +import java.util.Date;
  10 +import java.util.List;
12 import java.util.Map; 11 import java.util.Map;
13 12
14 /** 13 /**
@@ -35,5 +34,21 @@ public class SchedulePlanController extends BaseController<SchedulePlan, Long> { @@ -35,5 +34,21 @@ public class SchedulePlanController extends BaseController<SchedulePlan, Long> {
35 return baseService.save(t); 34 return baseService.save(t);
36 } 35 }
37 36
  37 + // TODO:
  38 +// @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET)
  39 +// public List<Map<String, Object>> findGroupInfo(
  40 +// Integer xlid, Date scheduleDate) {
  41 +//
  42 +// }
  43 +
  44 + @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET)
  45 + public List<Map<String, Object>> findGroupInfo(
  46 + @PathVariable(value = "xlid") Integer xlid,
  47 + @PathVariable(value = "date") Date scheduleDate) {
  48 + return schedulePlanService.findGroupInfo(xlid, scheduleDate);
  49 + }
  50 +
  51 +// public int updateGroupInfo
  52 +
38 53
39 } 54 }
src/main/java/com/bsth/controller/schedule/ScheduleRule1FlatController.java
1 package com.bsth.controller.schedule; 1 package com.bsth.controller.schedule;
2 2
3 import com.bsth.controller.BaseController; 3 import com.bsth.controller.BaseController;
4 -import com.bsth.entity.schedule.EmployeeConfigInfo;  
5 -import com.bsth.entity.schedule.GuideboardInfo;  
6 import com.bsth.entity.schedule.rule.ScheduleRule1Flat; 4 import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
7 import com.bsth.repository.schedule.ScheduleRule1FlatRepository; 5 import com.bsth.repository.schedule.ScheduleRule1FlatRepository;
8 -import com.bsth.service.schedule.EmployeeConfigInfoService;  
9 -import com.bsth.service.schedule.GuideboardInfoService;  
10 -import org.apache.commons.lang3.StringUtils;  
11 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.web.bind.annotation.*; 7 import org.springframework.web.bind.annotation.*;
13 8
14 -import java.util.HashMap;  
15 import java.util.Map; 9 import java.util.Map;
16 10
17 /** 11 /**
@@ -23,10 +17,6 @@ public class ScheduleRule1FlatController extends BaseController&lt;ScheduleRule1Fla @@ -23,10 +17,6 @@ public class ScheduleRule1FlatController extends BaseController&lt;ScheduleRule1Fla
23 17
24 @Autowired 18 @Autowired
25 private ScheduleRule1FlatRepository scheduleRule1FlatRepository; 19 private ScheduleRule1FlatRepository scheduleRule1FlatRepository;
26 - @Autowired  
27 - private GuideboardInfoService guideboardInfoService;  
28 - @Autowired  
29 - private EmployeeConfigInfoService employeeConfigInfoService;  
30 20
31 @Override 21 @Override
32 public ScheduleRule1Flat findById(@PathVariable("id") Long aLong) { 22 public ScheduleRule1Flat findById(@PathVariable("id") Long aLong) {
@@ -44,63 +34,6 @@ public class ScheduleRule1FlatController extends BaseController&lt;ScheduleRule1Fla @@ -44,63 +34,6 @@ public class ScheduleRule1FlatController extends BaseController&lt;ScheduleRule1Fla
44 */ 34 */
45 @RequestMapping(method = RequestMethod.POST) 35 @RequestMapping(method = RequestMethod.POST)
46 public Map<String, Object> save(@RequestBody ScheduleRule1Flat t){ 36 public Map<String, Object> save(@RequestBody ScheduleRule1Flat t){
47 - // TODO:根据编码查找id,不做错误检测,暂时这样做,以后前端直接传过来  
48 - // 1、查找路牌配置id  
49 - Map<String, Object> param1 = new HashMap<>();  
50 - param1.put("xl.id_eq", t.getXl().getId());  
51 - param1.put("lpName_eq", null);  
52 -  
53 - String[] lpNames = t.getLpNames().split(",");  
54 - String[] lpIds = new String[lpNames.length];  
55 - for (int i = 0; i < lpNames.length; i++) {  
56 - param1.put("lpName_eq", lpNames[i]);  
57 - Iterable<GuideboardInfo> guideboardInfos = guideboardInfoService.list(param1);  
58 - if (!guideboardInfos.iterator().hasNext()) {  
59 - throw new RuntimeException("路牌:" + lpNames[i] + "没有找到!");  
60 - }  
61 - lpIds[i] = guideboardInfos.iterator().next().getId().toString();  
62 - }  
63 - t.setLpIds(StringUtils.join(lpIds, ","));  
64 -  
65 - // 2、查找人员配置id(这里要考虑分班的情况,先用-隔开,在用,隔开)  
66 - Map<String, Object> param2 = new HashMap<>();  
67 - param2.put("xl.id_eq", t.getXl().getId());  
68 - param2.put("dbbm_eq", null);  
69 -  
70 - String[] ryDbbms = t.getRyDbbms().split(",");  
71 - String[] ryIds = new String[ryDbbms.length];  
72 - for (int j = 0; j < ryDbbms.length; j++) {  
73 - if (ryDbbms[j].indexOf("-") == -1) {  
74 - param2.put("dbbm_eq", ryDbbms[j]);  
75 - Iterable<EmployeeConfigInfo> employeeConfigInfos = employeeConfigInfoService.list(param2);  
76 - if (!employeeConfigInfos.iterator().hasNext()) {  
77 - throw new RuntimeException("搭班编码::" + ryDbbms[j] + "没有找到!");  
78 - }  
79 - ryIds[j] = employeeConfigInfos.iterator().next().getId().toString();  
80 - } else {  
81 - String[] fbRyDbbms = ryDbbms[j].split("-");  
82 - if (fbRyDbbms.length != 2) {  
83 - throw new RuntimeException("搭班编码:" + ryDbbms[j] + "错误!");  
84 - }  
85 - String[] fbRyIds = new String[2];  
86 - param2.put("dbbm_eq", fbRyDbbms[0]);  
87 - Iterable<EmployeeConfigInfo> employeeConfigInfos = employeeConfigInfoService.list(param2);  
88 - if (!employeeConfigInfos.iterator().hasNext()) {  
89 - throw new RuntimeException("搭班编码::" + fbRyDbbms[0] + "没有找到!");  
90 - }  
91 - fbRyIds[0] = employeeConfigInfos.iterator().next().getId().toString();  
92 - param2.put("dbbm_eq", fbRyDbbms[1]);  
93 - employeeConfigInfos = employeeConfigInfoService.list(param2);  
94 - if (!employeeConfigInfos.iterator().hasNext()) {  
95 - throw new RuntimeException("搭班编码::" + fbRyDbbms[1] + "没有找到!");  
96 - }  
97 - fbRyIds[1] = employeeConfigInfos.iterator().next().getId().toString();  
98 - ryIds[j] = StringUtils.join(fbRyIds, "-");  
99 - }  
100 -  
101 - }  
102 - t.setRyConfigIds(StringUtils.join(ryIds, ","));  
103 -  
104 return baseService.save(t); 37 return baseService.save(t);
105 } 38 }
106 39
src/main/java/com/bsth/repository/schedule/SchedulePlanRepository.java
@@ -6,8 +6,15 @@ import org.springframework.data.domain.Page; @@ -6,8 +6,15 @@ import org.springframework.data.domain.Page;
6 import org.springframework.data.domain.Pageable; 6 import org.springframework.data.domain.Pageable;
7 import org.springframework.data.jpa.domain.Specification; 7 import org.springframework.data.jpa.domain.Specification;
8 import org.springframework.data.jpa.repository.EntityGraph; 8 import org.springframework.data.jpa.repository.EntityGraph;
  9 +import org.springframework.data.jpa.repository.Query;
  10 +import org.springframework.data.repository.query.Param;
9 import org.springframework.stereotype.Repository; 11 import org.springframework.stereotype.Repository;
10 12
  13 +import javax.persistence.SqlResultSetMapping;
  14 +import java.util.Date;
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +
11 /** 18 /**
12 * Created by xu on 16/6/16. 19 * Created by xu on 16/6/16.
13 */ 20 */
@@ -17,4 +24,37 @@ public interface SchedulePlanRepository extends BaseRepository&lt;SchedulePlan, Lon @@ -17,4 +24,37 @@ public interface SchedulePlanRepository extends BaseRepository&lt;SchedulePlan, Lon
17 @Override 24 @Override
18 Page<SchedulePlan> findAll(Specification<SchedulePlan> spec, Pageable pageable); 25 Page<SchedulePlan> findAll(Specification<SchedulePlan> spec, Pageable pageable);
19 26
  27 + @Query(value = " select " +
  28 + "xl_name as xlName, " +
  29 + "schedule_date as scheduleDate, " +
  30 + "lp_name as lpName, " +
  31 + "cl_zbh as clZbh, " +
  32 + "group_concat(distinct fcsj) ccsj, " +
  33 + "group_concat(distinct j_gh) jsyGh, " +
  34 + "group_concat(distinct j_name) jsyName, " +
  35 + "group_concat(distinct s_gh) spyGh, " +
  36 + "group_concat(distinct s_name) spyName, " +
  37 + "max(create_date) as createDate " +
  38 + "from bsth_c_s_sp_info " +
  39 + "where bc_type = 'out' and " +
  40 + "xl = ?1 and " +
  41 + "schedule_date = ?2 " +
  42 + "group by xl_name, schedule_date, lp_name " +
  43 + "order by xl_name, schedule_date, lp ", nativeQuery = true)
  44 + List<Object[]> findGroupInfo(Integer xlid, Date scheduleDate);
  45 +
  46 + @Query(value = "update " +
  47 + "bsth_c_s_sp_info " +
  48 + "set cl = :p1, cl_zbh = :p2 " +
  49 + "where xl = :p3 and " +
  50 + "schedule_date = :p4 and " +
  51 + "lp_name = :p5 ",
  52 + nativeQuery = true)
  53 + int updateGroupInfo_clinfo(
  54 + @Param("p1") Integer clid,
  55 + @Param("p2") String clZbh,
  56 + @Param("p3") Integer xlid,
  57 + @Param("p4") Date scheduleDate,
  58 + @Param("p5") String lpName);
  59 +
20 } 60 }
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -464,20 +464,43 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -464,20 +464,43 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
464 List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>(); 464 List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
465 465
466 DecimalFormat format = new DecimalFormat("0.00"); 466 DecimalFormat format = new DecimalFormat("0.00");
467 - int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);  
468 - int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);  
469 - int jhbc = 0;  
470 - double jhlc = 0;  
471 - float realMileage = 0l,addMileage = 0l,remMileage = 0l; 467 +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
  468 +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
  469 + int jhbc = 0,cjbc = 0,ljbc = 0;
  470 + double jhlc = 0, yygl = 0, ksgl = 0;
  471 + float addMileage = 0l,remMileage = 0l;
472 472
473 Map<String,Object> map; 473 Map<String,Object> map;
474 for(ScheduleRealInfo scheduleRealInfo : scheduleRealInfos){ 474 for(ScheduleRealInfo scheduleRealInfo : scheduleRealInfos){
475 if(scheduleRealInfo != null){ 475 if(scheduleRealInfo != null){
476 - jhlc += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();  
477 - realMileage += scheduleRealInfo.getRealMileage()==null?0:scheduleRealInfo.getRealMileage();  
478 - addMileage += scheduleRealInfo.getAddMileage()==null?0:scheduleRealInfo.getAddMileage();  
479 - remMileage += scheduleRealInfo.getRemMileage()==null?0:scheduleRealInfo.getRemMileage();  
480 - jhbc++; 476 + //计算计划里程(主任务过滤掉临加班次),烂班里程,临加里程,计划班次,烂班班次,增加班次
  477 + if(scheduleRealInfo.isSflj()){
  478 + addMileage += addMileage += scheduleRealInfo.getAddMileage()==null?0:scheduleRealInfo.getAddMileage();
  479 + ljbc++;
  480 + }else{
  481 + jhlc += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  482 + if(scheduleRealInfo.getStatus() != -1){
  483 + remMileage += scheduleRealInfo.getRemMileage()==null?0:scheduleRealInfo.getRemMileage();
  484 + }else{
  485 + cjbc++;
  486 + }
  487 + jhbc++;
  488 + }
  489 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  490 + //计算营运里程,空驶里程
  491 + if(childTaskPlans.isEmpty()){
  492 + yygl += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  493 + }else{
  494 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  495 + while(it.hasNext()){
  496 + ChildTaskPlan childTaskPlan = it.next();
  497 + if(childTaskPlan.getMileageType().equals("empty")){
  498 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  499 + }else{
  500 + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  501 + }
  502 + }
  503 + }
481 504
482 map = new HashMap<String, Object>(); 505 map = new HashMap<String, Object>();
483 try { 506 try {
@@ -509,9 +532,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -509,9 +532,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
509 map.put("jhlc", format.format(jhlc)); 532 map.put("jhlc", format.format(jhlc));
510 map.put("remMileage", format.format(remMileage)); 533 map.put("remMileage", format.format(remMileage));
511 map.put("addMileage", format.format(addMileage)); 534 map.put("addMileage", format.format(addMileage));
512 - map.put("yygl", format.format(realMileage-addMileage));  
513 - map.put("ksgl", format.format(realMileage-addMileage));  
514 - map.put("realMileage", format.format(realMileage)); 535 + map.put("yygl", format.format(yygl));
  536 + map.put("ksgl", format.format(ksgl));
  537 + map.put("realMileage", format.format(yygl+ksgl));
515 map.put("jhbc", jhbc); 538 map.put("jhbc", jhbc);
516 map.put("cjbc", cjbc); 539 map.put("cjbc", cjbc);
517 map.put("ljbc", ljbc); 540 map.put("ljbc", ljbc);
@@ -520,7 +543,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -520,7 +543,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
520 String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; 543 String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\";
521 544
522 list.add(listMap.iterator()); 545 list.add(listMap.iterator());
523 - ee.excelReplace(list, new Object[] { scheduleRealInfos.get(0),map }, path+"mould\\waybill.xls", 546 + ee.excelReplace(list, new Object[] { scheduleRealInfos.get(0),map }, path+"mould\\waybill_minhang.xls",
524 path+"export\\" + jName + ".xls"); 547 path+"export\\" + jName + ".xls");
525 return scheduleRealInfos; 548 return scheduleRealInfos;
526 } 549 }
@@ -983,27 +1006,58 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -983,27 +1006,58 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
983 String lpName,String date) { 1006 String lpName,String date) {
984 List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date); 1007 List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date);
985 DecimalFormat format = new DecimalFormat("0.00"); 1008 DecimalFormat format = new DecimalFormat("0.00");
986 - int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);  
987 - int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);  
988 - int jhbc = 0;  
989 - double jhlc = 0;  
990 - float realMileage = 0l,addMileage = 0l,remMileage = 0l; 1009 +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
  1010 +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
  1011 + int jhbc = 0,cjbc = 0,ljbc = 0;
  1012 + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0;
  1013 + float addMileage = 0l,remMileage = 0l;
991 Map<String,Object> map = new HashMap<String, Object>(); 1014 Map<String,Object> map = new HashMap<String, Object>();
992 for(ScheduleRealInfo scheduleRealInfo : list){ 1015 for(ScheduleRealInfo scheduleRealInfo : list){
993 if(scheduleRealInfo != null){ 1016 if(scheduleRealInfo != null){
994 - jhlc += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();  
995 - realMileage += scheduleRealInfo.getRealMileage()==null?0:scheduleRealInfo.getRealMileage();  
996 - addMileage += scheduleRealInfo.getAddMileage()==null?0:scheduleRealInfo.getAddMileage();  
997 - remMileage += scheduleRealInfo.getRemMileage()==null?0:scheduleRealInfo.getRemMileage();  
998 - jhbc++; 1017 + //计划里程(主任务过滤掉临加班次),
  1018 + //烂班里程(主任务烂班),
  1019 + //临加里程(主任务临加),
  1020 + //计划班次,烂班班次,增加班次
  1021 + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  1022 + if(scheduleRealInfo.isSflj()){
  1023 + addMileage += tempJhlc;
  1024 + ljbc++;
  1025 + }else{
  1026 + jhlc += tempJhlc;
  1027 + jhbc++;
  1028 + if(scheduleRealInfo.getStatus() == -1){
  1029 + remMileage += tempJhlc;
  1030 + cjbc++;
  1031 + }
  1032 + }
  1033 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  1034 + //计算营运里程,空驶里程
  1035 + if(childTaskPlans.isEmpty()){
  1036 + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
  1037 + || scheduleRealInfo.getBcType().equals("venting")){
  1038 + ksgl += tempJhlc;
  1039 + }else{
  1040 + yygl += tempJhlc;
  1041 + }
  1042 + }else{
  1043 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1044 + while(it.hasNext()){
  1045 + ChildTaskPlan childTaskPlan = it.next();
  1046 + if(childTaskPlan.getMileageType().equals("empty")){
  1047 + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1048 + }else{
  1049 + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1050 + }
  1051 + }
  1052 + }
999 } 1053 }
1000 } 1054 }
1001 map.put("jhlc", format.format(jhlc)); 1055 map.put("jhlc", format.format(jhlc));
1002 map.put("remMileage", format.format(remMileage)); 1056 map.put("remMileage", format.format(remMileage));
1003 map.put("addMileage", format.format(addMileage)); 1057 map.put("addMileage", format.format(addMileage));
1004 - map.put("yygl", format.format(jhlc));  
1005 - map.put("ksgl", format.format(realMileage-addMileage));  
1006 - map.put("realMileage", format.format(jhlc)); 1058 + map.put("yygl", format.format(yygl));
  1059 + map.put("ksgl", format.format(ksgl));
  1060 + map.put("realMileage", format.format(yygl+ksgl));
1007 map.put("jhbc", jhbc); 1061 map.put("jhbc", jhbc);
1008 map.put("cjbc", cjbc); 1062 map.put("cjbc", cjbc);
1009 map.put("ljbc", ljbc); 1063 map.put("ljbc", ljbc);
@@ -1066,17 +1120,43 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1066,17 +1120,43 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1066 public List<Map<String, Object>> statisticsDaily(String line, String date, 1120 public List<Map<String, Object>> statisticsDaily(String line, String date,
1067 String xlName) { 1121 String xlName) {
1068 List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); 1122 List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
  1123 + List<Map<String,Object>> lMap = new ArrayList<Map<String,Object>>();
  1124 + DecimalFormat format = new DecimalFormat("0.00");
1069 double jhlc = 0.00; 1125 double jhlc = 0.00;
1070 - float realMileage = 0l; 1126 + float sjgl = 0l,ssgl = 0l;
  1127 + Map<String,Object> map = new HashMap<String, Object>();
1071 for(ScheduleRealInfo scheduleRealInfo: list){ 1128 for(ScheduleRealInfo scheduleRealInfo: list){
1072 if(scheduleRealInfo != null){ 1129 if(scheduleRealInfo != null){
1073 - jhlc += scheduleRealInfo.getJhlc();  
1074 - if(scheduleRealInfo.getsName().equals("1")){  
1075 - realMileage += scheduleRealInfo.getRealMileage(); 1130 + if(!scheduleRealInfo.isSflj()){
  1131 + jhlc += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  1132 + }
  1133 + if(scheduleRealInfo.isDestroy()){
  1134 + ssgl += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  1135 + }
  1136 +
  1137 + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
  1138 + //计算实际里程,空驶里程
  1139 + if(childTaskPlans.isEmpty()){
  1140 + sjgl += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc();
  1141 + }else{
  1142 + Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
  1143 + while(it.hasNext()){
  1144 + ChildTaskPlan childTaskPlan = it.next();
  1145 + if(childTaskPlan.isDestroy()){
  1146 + ssgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1147 + }else{
  1148 + sjgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1149 + }
  1150 + }
1076 } 1151 }
1077 } 1152 }
1078 } 1153 }
1079 - return null; 1154 + map.put("xlName", xlName);
  1155 + map.put("jhlc", format.format(jhlc));
  1156 + map.put("sjgl", format.format(sjgl));
  1157 + map.put("ssgl", format.format(ssgl));
  1158 + lMap.add(map);
  1159 + return lMap;
1080 } 1160 }
1081 1161
1082 @Override 1162 @Override
src/main/java/com/bsth/service/schedule/SchedulePlanService.java
@@ -3,8 +3,31 @@ package com.bsth.service.schedule; @@ -3,8 +3,31 @@ package com.bsth.service.schedule;
3 import com.bsth.entity.schedule.SchedulePlan; 3 import com.bsth.entity.schedule.SchedulePlan;
4 import com.bsth.service.BaseService; 4 import com.bsth.service.BaseService;
5 5
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
6 /** 10 /**
7 * Created by xu on 16/6/16. 11 * Created by xu on 16/6/16.
8 */ 12 */
9 public interface SchedulePlanService extends BaseService<SchedulePlan, Long> { 13 public interface SchedulePlanService extends BaseService<SchedulePlan, Long> {
  14 +
  15 + /**
  16 + * 查找分组排班信息。
  17 + * @param xlid 线路Id
  18 + * @param scheduleDate 排班日期
  19 + * @return
  20 + */
  21 + List<Map<String, Object>> findGroupInfo(Integer xlid, Date scheduleDate);
  22 +
  23 + /**
  24 + * 更新分组排班信息。
  25 + * @param clid 车辆id
  26 + * @param clZbh 车辆自编号
  27 + * @param xlid 线路id
  28 + * @param scheduleDate 排班日期
  29 + * @param lpName 路牌名字
  30 + * @return
  31 + */
  32 + int updateGroupInfo_clinfo(Integer clid, String clZbh, Integer xlid, Date scheduleDate, String lpName);
10 } 33 }
src/main/java/com/bsth/service/schedule/SchedulePlanServiceImpl.java
@@ -5,7 +5,6 @@ import com.bsth.entity.schedule.*; @@ -5,7 +5,6 @@ import com.bsth.entity.schedule.*;
5 import com.bsth.entity.schedule.rule.ScheduleRule1Flat; 5 import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
6 import com.bsth.repository.schedule.SchedulePlanInfoRepository; 6 import com.bsth.repository.schedule.SchedulePlanInfoRepository;
7 import com.bsth.repository.schedule.SchedulePlanRepository; 7 import com.bsth.repository.schedule.SchedulePlanRepository;
8 -import com.bsth.service.LineService;  
9 import com.bsth.service.impl.BaseServiceImpl; 8 import com.bsth.service.impl.BaseServiceImpl;
10 import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; 9 import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input;
11 import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output; 10 import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output;
@@ -31,10 +30,6 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt; @@ -31,10 +30,6 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt;
31 @Autowired 30 @Autowired
32 private KieBase kieBase; 31 private KieBase kieBase;
33 @Autowired 32 @Autowired
34 - private ScheduleRule1FlatService scheduleRule1FlatService;  
35 - @Autowired  
36 - private LineService lineService;  
37 - @Autowired  
38 private IStrategy strategy; 33 private IStrategy strategy;
39 @Autowired 34 @Autowired
40 private SchedulePlanRepository schedulePlanRepository; 35 private SchedulePlanRepository schedulePlanRepository;
@@ -126,5 +121,91 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt; @@ -126,5 +121,91 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt;
126 return super.save(schedulePlan); 121 return super.save(schedulePlan);
127 } 122 }
128 123
  124 + @Override
  125 + public List<Map<String, Object>> findGroupInfo(Integer xlid, Date scheduleDate) {
  126 + List<Object[]> groupInfos = schedulePlanRepository.findGroupInfo(xlid, scheduleDate);
  127 + List<Map<String, Object>> ret = new ArrayList<>();
  128 + for (Object[] datas : groupInfos) {
  129 + // TODO:貌似springdata没有优雅的方式把List<Object[]>转换成List<Map<String, Object>>方法,
  130 + // TODO:可能jpa有相关标注,以后找到,此方法就作废
  131 +
  132 + Map<String, Object> map = new HashMap<>();
  133 +
  134 + // 线路名称
  135 + map.put("xlName", datas[0]);
  136 + // 排班时间
  137 + map.put("scheduleDate", datas[1]);
  138 + // 路牌名字
  139 + map.put("lpName", datas[2]);
  140 + // 车辆自编号
  141 + map.put("clZbh", datas[3]);
  142 + // 出场时间,如果有多个,需要分开
  143 + Object ccsj = datas[4];
  144 + if (ccsj != null) {
  145 + String[] ccsj_array = ((String) ccsj).split(",");
  146 + if (ccsj_array.length > 1) {
  147 + map.put("ccsj1", ccsj_array[0]);
  148 + map.put("ccsj2", ccsj_array[1]);
  149 + } else {
  150 + map.put("ccsj1", ccsj_array[0]);
  151 + }
  152 + }
  153 + // 驾驶员工号,如果有多个,需要分开
  154 + Object jsyGh = datas[5];
  155 + if (jsyGh != null) {
  156 + String[] jsyGh_array = ((String) jsyGh).split(",");
  157 + if (jsyGh_array.length > 1) {
  158 + map.put("jsy1Gh", jsyGh_array[0]);
  159 + map.put("jsy2Gh", jsyGh_array[1]);
  160 + } else {
  161 + map.put("jsy1Gh", jsyGh_array[0]);
  162 + }
  163 + }
  164 + // 驾驶员名字,如果有多个,需要分开
  165 + Object jsyName = datas[6];
  166 + if (jsyName != null) {
  167 + String[] jsyName_array = ((String) jsyName).split(",");
  168 + if (jsyName_array.length > 1) {
  169 + map.put("jsy1Name", jsyName_array[0]);
  170 + map.put("jsy2Name", jsyName_array[1]);
  171 + } else {
  172 + map.put("jsy1Name", jsyName_array[0]);
  173 + }
  174 + }
  175 + // 售票员工号,如果有多个,需要分开
  176 + Object spyGh = datas[7];
  177 + if (spyGh != null) {
  178 + String[] spyGh_array = ((String) spyGh).split(",");
  179 + if (spyGh_array.length > 1) {
  180 + map.put("spy1Gh", spyGh_array[0]);
  181 + map.put("spy2Gh", spyGh_array[1]);
  182 + } else {
  183 + map.put("spy1Gh", spyGh_array[0]);
  184 + }
  185 + }
  186 + // 售票员名字,如果有多个,需要分开
  187 + Object spyName = datas[8];
  188 + if (spyName != null) {
  189 + String[] spyName_array = ((String) spyName).split(",");
  190 + if (spyName_array.length > 1) {
  191 + map.put("spy1Name", spyName_array[0]);
  192 + map.put("spy2Name", spyName_array[1]);
  193 + } else {
  194 + map.put("spy1Name", spyName_array[0]);
  195 + }
  196 + }
  197 + // 创建时间
  198 + map.put("createDate", datas[9]);
  199 +
  200 + // TODO:可能还有其他字段
  201 +
  202 + ret.add(map);
  203 + }
  204 + return ret;
  205 + }
129 206
  207 + @Override
  208 + public int updateGroupInfo_clinfo(Integer clid, String clZbh, Integer xlid, Date scheduleDate, String lpName) {
  209 + return schedulePlanRepository.updateGroupInfo_clinfo(clid, clZbh, xlid, scheduleDate, lpName);
  210 + }
130 } 211 }
src/main/java/com/bsth/service/schedule/rules/ttinfo/TTInfo_input.java
1 -package com.bsth.service.schedule.rules.ttinfo;  
2 -  
3 -import com.bsth.entity.schedule.TTInfo;  
4 -import org.apache.commons.lang3.StringUtils;  
5 -import org.joda.time.DateTime;  
6 -import org.joda.time.format.DateTimeFormat;  
7 -  
8 -import java.util.ArrayList;  
9 -import java.util.List;  
10 -  
11 -/**  
12 - * 时刻表_输入  
13 - */  
14 -public class TTInfo_input implements Comparable<TTInfo_input> {  
15 - /** 时刻表id */  
16 - private String ttInfoId;  
17 - /** 线路Id */  
18 - private String xlId;  
19 - /** 周一到周日是否启用 */  
20 - private List<Boolean> weekdays = new ArrayList<>();  
21 - /** 特殊节假日 */  
22 - private List<DateTime> specialDays = new ArrayList<>();  
23 - /** 最新修改时间 */  
24 - private DateTime updateDate;  
25 - /** 是否启用 */  
26 - private Boolean isEnable;  
27 - /** 启用日期 */  
28 - private DateTime qyDate;  
29 -  
30 - public TTInfo_input() {  
31 -  
32 - }  
33 -  
34 - @Override  
35 - public int compareTo(TTInfo_input ttInfo_input) {  
36 - if (ttInfo_input != null) {  
37 - if (ttInfo_input.updateDate != null && this.updateDate != null)  
38 - return - this.updateDate.compareTo(ttInfo_input.updateDate);  
39 - }  
40 - return -1;  
41 - }  
42 -  
43 - public TTInfo_input(TTInfo ttInfo) {  
44 - this.ttInfoId = String.valueOf(ttInfo.getId());  
45 - this.xlId = String.valueOf(ttInfo.getXl().getId());  
46 - String[] days = ttInfo.getRule_days().split(",");  
47 - System.out.println(days.length);  
48 - for (int i = 0; i < 7; i++) {  
49 - if ("1".equals(days[i])) {  
50 - weekdays.add(true);  
51 - } else {  
52 - weekdays.add(false);  
53 - }  
54 - }  
55 - if (StringUtils.isNotEmpty(ttInfo.getSpecial_days())) {  
56 - String[] sdays = ttInfo.getSpecial_days().split(",");  
57 - for (int i = 0; i < sdays.length; i++) {  
58 - specialDays.add(DateTimeFormat.forPattern("yyyy-MM-dd").  
59 - parseDateTime(sdays[i]));  
60 - }  
61 - }  
62 -  
63 - this.updateDate = new DateTime(ttInfo.getUpdateDate());  
64 - this.isEnable = ttInfo.getIsEnableDisTemplate();  
65 - this.qyDate = new DateTime(ttInfo.getQyrq());  
66 -  
67 - }  
68 -  
69 - public String getTtInfoId() {  
70 - return ttInfoId;  
71 - }  
72 -  
73 - public void setTtInfoId(String ttInfoId) {  
74 - this.ttInfoId = ttInfoId;  
75 - }  
76 -  
77 - public String getXlId() {  
78 - return xlId;  
79 - }  
80 -  
81 - public void setXlId(String xlId) {  
82 - this.xlId = xlId;  
83 - }  
84 -  
85 - public List<Boolean> getWeekdays() {  
86 - return weekdays;  
87 - }  
88 -  
89 - public void setWeekdays(List<Boolean> weekdays) {  
90 - this.weekdays = weekdays;  
91 - }  
92 -  
93 - public List<DateTime> getSpecialDays() {  
94 - return specialDays;  
95 - }  
96 -  
97 - public void setSpecialDays(List<DateTime> specialDays) {  
98 - this.specialDays = specialDays;  
99 - }  
100 -  
101 - public DateTime getUpdateDate() {  
102 - return updateDate;  
103 - }  
104 -  
105 - public void setUpdateDate(DateTime updateDate) {  
106 - this.updateDate = updateDate;  
107 - }  
108 -  
109 - public Boolean getIsEnable() {  
110 - return isEnable;  
111 - }  
112 -  
113 - public void setIsEnable(Boolean isEnable) {  
114 - this.isEnable = isEnable;  
115 - }  
116 -  
117 - public DateTime getQyDate() {  
118 - return qyDate;  
119 - }  
120 -  
121 - public void setQyDate(DateTime qyDate) {  
122 - this.qyDate = qyDate;  
123 - }  
124 -} 1 +package com.bsth.service.schedule.rules.ttinfo;
  2 +
  3 +import com.bsth.entity.schedule.TTInfo;
  4 +import org.apache.commons.lang3.StringUtils;
  5 +import org.joda.time.DateTime;
  6 +import org.joda.time.format.DateTimeFormat;
  7 +
  8 +import java.util.ArrayList;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * 时刻表_输入
  13 + */
  14 +public class TTInfo_input implements Comparable<TTInfo_input> {
  15 + /** 时刻表id */
  16 + private String ttInfoId;
  17 + /** 线路Id */
  18 + private String xlId;
  19 + /** 周一到周日是否启用 */
  20 + private List<Boolean> weekdays = new ArrayList<>();
  21 + /** 特殊节假日 */
  22 + private List<DateTime> specialDays = new ArrayList<>();
  23 + /** 最新修改时间 */
  24 + private DateTime updateDate;
  25 + /** 是否启用 */
  26 + private Boolean isEnable;
  27 + /** 启用日期 */
  28 + private DateTime qyDate;
  29 +
  30 + public TTInfo_input() {
  31 +
  32 + }
  33 +
  34 + @Override
  35 + public int compareTo(TTInfo_input ttInfo_input) {
  36 + if (ttInfo_input != null) {
  37 + if (ttInfo_input.updateDate != null && this.updateDate != null)
  38 + return - this.updateDate.compareTo(ttInfo_input.updateDate);
  39 + }
  40 + return -1;
  41 + }
  42 +
  43 + public TTInfo_input(TTInfo ttInfo) {
  44 + this.ttInfoId = String.valueOf(ttInfo.getId());
  45 + this.xlId = String.valueOf(ttInfo.getXl().getId());
  46 + String[] days = ttInfo.getRule_days().split(",");
  47 + System.out.println(days.length);
  48 + for (int i = 0; i < 7; i++) {
  49 + if ("1".equals(days[i])) {
  50 + weekdays.add(true);
  51 + } else {
  52 + weekdays.add(false);
  53 + }
  54 + }
  55 +
  56 + if (StringUtils.isNotEmpty(ttInfo.getSpecial_days())) {
  57 + String[] sdays = ttInfo.getSpecial_days().split(",");
  58 + for (int i = 0; i < sdays.length; i++) {
  59 + specialDays.add(DateTimeFormat.forPattern("yyyy-MM-dd").
  60 + parseDateTime(sdays[i]));
  61 + }
  62 + }
  63 +
  64 + this.updateDate = new DateTime(ttInfo.getUpdateDate());
  65 + this.isEnable = ttInfo.getIsEnableDisTemplate();
  66 + this.qyDate = new DateTime(ttInfo.getQyrq());
  67 +
  68 + }
  69 +
  70 + public String getTtInfoId() {
  71 + return ttInfoId;
  72 + }
  73 +
  74 + public void setTtInfoId(String ttInfoId) {
  75 + this.ttInfoId = ttInfoId;
  76 + }
  77 +
  78 + public String getXlId() {
  79 + return xlId;
  80 + }
  81 +
  82 + public void setXlId(String xlId) {
  83 + this.xlId = xlId;
  84 + }
  85 +
  86 + public List<Boolean> getWeekdays() {
  87 + return weekdays;
  88 + }
  89 +
  90 + public void setWeekdays(List<Boolean> weekdays) {
  91 + this.weekdays = weekdays;
  92 + }
  93 +
  94 + public List<DateTime> getSpecialDays() {
  95 + return specialDays;
  96 + }
  97 +
  98 + public void setSpecialDays(List<DateTime> specialDays) {
  99 + this.specialDays = specialDays;
  100 + }
  101 +
  102 + public DateTime getUpdateDate() {
  103 + return updateDate;
  104 + }
  105 +
  106 + public void setUpdateDate(DateTime updateDate) {
  107 + this.updateDate = updateDate;
  108 + }
  109 +
  110 + public Boolean getIsEnable() {
  111 + return isEnable;
  112 + }
  113 +
  114 + public void setIsEnable(Boolean isEnable) {
  115 + this.isEnable = isEnable;
  116 + }
  117 +
  118 + public DateTime getQyDate() {
  119 + return qyDate;
  120 + }
  121 +
  122 + public void setQyDate(DateTime qyDate) {
  123 + this.qyDate = qyDate;
  124 + }
  125 +}
src/main/resources/static/pages/forms/mould/waybill_minhang.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -82,23 +82,23 @@ @@ -82,23 +82,23 @@
82 <td>援外</td> 82 <td>援外</td>
83 <td>其他</td> 83 <td>其他</td>
84 <td>全日</td> 84 <td>全日</td>
85 - <td>6:31~8:30</td>  
86 - <td>16:01~18:00</td> 85 + <td>6:31~<br>8:30</td>
  86 + <td>16:01~<br>18:00</td>
87 <td>全日</td> 87 <td>全日</td>
88 - <td>6:31~8:30</td>  
89 - <td>16:01~18:00</td> 88 + <td>6:31~<br>8:30</td>
  89 + <td>16:01~<br>18:00</td>
90 <td>全日</td> 90 <td>全日</td>
91 - <td>6:31~8:30</td>  
92 - <td>16:01~18:00</td> 91 + <td>6:31~<br>8:30</td>
  92 + <td>16:01~<br>18:00</td>
93 <td>全日</td> 93 <td>全日</td>
94 - <td>6:31~8:30</td>  
95 - <td>16:01~18:00</td> 94 + <td>6:31~<br>8:30</td>
  95 + <td>16:01~<br>18:00</td>
96 <td>全日</td> 96 <td>全日</td>
97 - <td>6:31~8:30</td>  
98 - <td>16:01~18:00</td> 97 + <td>6:31~<br>8:30</td>
  98 + <td>16:01~<br>18:00</td>
99 <td>全日</td> 99 <td>全日</td>
100 - <td>6:31~8:30</td>  
101 - <td>16:01~18:00</td> 100 + <td>6:31~<br>8:30</td>
  101 + <td>16:01~<br>18:00</td>
102 </tr> 102 </tr>
103 </thead> 103 </thead>
104 <tr> 104 <tr>
@@ -153,37 +153,40 @@ @@ -153,37 +153,40 @@
153 <td colspan="40">&nbsp;</td> 153 <td colspan="40">&nbsp;</td>
154 </tr> 154 </tr>
155 <tr> 155 <tr>
156 - <td colspan="2">班</td> 156 + <td colspan="2">班</td>
157 <td colspan="2">车号</td> 157 <td colspan="2">车号</td>
158 <td>司早</td> 158 <td>司早</td>
159 <td>售早</td> 159 <td>售早</td>
160 <td>司晚</td> 160 <td>司晚</td>
161 <td>售晚</td> 161 <td>售晚</td>
162 - <td colspan="2">班</td> 162 + <td colspan="2">班</td>
163 <td colspan="2">车号</td> 163 <td colspan="2">车号</td>
164 <td>司早</td> 164 <td>司早</td>
165 <td>售早</td> 165 <td>售早</td>
166 <td>司晚</td> 166 <td>司晚</td>
167 <td>售晚</td> 167 <td>售晚</td>
168 - <td colspan="2">班</td> 168 + <td colspan="2">班</td>
169 <td colspan="2">车号</td> 169 <td colspan="2">车号</td>
170 <td>司早</td> 170 <td>司早</td>
171 <td>售早</td> 171 <td>售早</td>
172 <td>司晚</td> 172 <td>司晚</td>
173 <td>售晚</td> 173 <td>售晚</td>
174 - <td colspan="2">班</td> 174 + <td colspan="2">班</td>
175 <td colspan="2">车号</td> 175 <td colspan="2">车号</td>
176 <td>司早</td> 176 <td>司早</td>
177 <td>售早</td> 177 <td>售早</td>
178 <td>司晚</td> 178 <td>司晚</td>
179 <td>售晚</td> 179 <td>售晚</td>
180 - <td colspan="2">班</td> 180 + <td colspan="2">班</td>
181 <td colspan="2">车号</td> 181 <td colspan="2">车号</td>
182 <td>司早</td> 182 <td>司早</td>
183 <td>售早</td> 183 <td>售早</td>
184 <td>司晚</td> 184 <td>司晚</td>
185 <td>售晚</td> 185 <td>售晚</td>
186 </tr> 186 </tr>
  187 + <tbody class="scheduleDaily_2">
  188 +
  189 + </tbody>
187 <tr> 190 <tr>
188 <td colspan="40">&nbsp;</td> 191 <td colspan="40">&nbsp;</td>
189 </tr> 192 </tr>
@@ -232,7 +235,7 @@ @@ -232,7 +235,7 @@
232 <td>慢</td> 235 <td>慢</td>
233 <td>&nbsp;</td> 236 <td>&nbsp;</td>
234 </tr> 237 </tr>
235 - <tbody> 238 + <tbody class="scheduleDaily_3">
236 239
237 </tbody> 240 </tbody>
238 </table> 241 </table>
@@ -289,18 +292,69 @@ @@ -289,18 +292,69 @@
289 return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; 292 return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
290 } 293 }
291 } 294 }
292 - }); 295 + });
  296 +
  297 + //查询
  298 + $("#query").on('click',function(){
  299 + var line = $("#line").val();
  300 + var date = $("#date").val();
  301 + $.get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){
  302 + var scheduleDaily_2 = template('scheduleDaily_2',{list:result});
  303 + $('#forms .scheduleDaily_2').html(scheduleDaily_2);
  304 + });
  305 + $.get('/realSchedule/realScheduleList',{line:line,date:date},function(result){
  306 + var scheduleDaily_3 = template('scheduleDaily_3',{list:result});
  307 + $('#forms .scheduleDaily_3').html(scheduleDaily_3);
  308 + });
  309 +
  310 + });
293 }); 311 });
294 </script> 312 </script>
295 -<script type="text/html" id="list_forms"> 313 +<script type="text/html" id="scheduleDaily_2">
296 {{each list as obj i}} 314 {{each list as obj i}}
  315 + {{if i%5 == 0}}
  316 + <tr>
  317 + {{/if}}
  318 + <td colspan="2">{{obj.lpName}}</td>
  319 + <td colspan="2">{{obj.clZbh}}</td>
  320 + <td>{{obj.jGh}}</td>
  321 + <td>{{obj.sGh}}</td>
  322 + <td>&nbsp;</td>
  323 + <td>&nbsp;</td>
  324 + {{if (i+1)%5 == 0}}
  325 + </tr>
  326 + {{/if}}
  327 + {{/each}}
  328 + {{if list.length == 0}}
297 <tr> 329 <tr>
298 - 330 + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>
299 </tr> 331 </tr>
  332 + {{/if}}
  333 +</script>
  334 +<script type="text/html" id="scheduleDaily_3">
  335 + {{each list as obj i}}
  336 + {{if i%3 == 0}}
  337 + <tr>
  338 + {{/if}}
  339 + <td>{{obj.lpName}}</td>
  340 + <td colspan="2">{{obj.qdzName}}</td>
  341 + <td>{{obj.zdsj}}</td>
  342 + <td>{{obj.zdsjActual}}</td>
  343 + <td>&nbsp;</td>
  344 + <td>&nbsp;</td>
  345 + <td>{{obj.fcsj}}</td>
  346 + <td>{{obj.fcsjActual}}</td>
  347 + <td>&nbsp;</td>
  348 + <td>&nbsp;</td>
  349 + <td colspan="2">{{obj.remarks}}</td>
  350 + {{if (i+1)%3 == 0}}
  351 + <td>&nbsp;</td>
  352 + </tr>
  353 + {{/if}}
300 {{/each}} 354 {{/each}}
301 {{if list.length == 0}} 355 {{if list.length == 0}}
302 <tr> 356 <tr>
303 - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> 357 + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td>
304 </tr> 358 </tr>
305 {{/if}} 359 {{/if}}
306 </script> 360 </script>
307 \ No newline at end of file 361 \ No newline at end of file
src/main/resources/static/pages/forms/statement/statisticsDaily .html
@@ -101,7 +101,7 @@ @@ -101,7 +101,7 @@
101 <td>16:01~18:00</td> 101 <td>16:01~18:00</td>
102 </tr> 102 </tr>
103 </thead> 103 </thead>
104 - <tbody> 104 + <tbody class="statisticsDaily">
105 105
106 </tbody> 106 </tbody>
107 <tr> 107 <tr>
@@ -207,17 +207,52 @@ @@ -207,17 +207,52 @@
207 var date = $("#date").val(); 207 var date = $("#date").val();
208 $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){ 208 $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){
209 // 把数据填充到模版中 209 // 把数据填充到模版中
210 - var tbodyHtml = template('list_account',{list:result}); 210 + var tbodyHtml = template('statisticsDaily',{list:result});
211 // 把渲染好的模版html文本追加到表格中 211 // 把渲染好的模版html文本追加到表格中
212 - $('#forms tbody').html(tbodyHtml); 212 + $('#forms .statisticsDaily').html(tbodyHtml);
213 }); 213 });
214 }); 214 });
215 }); 215 });
216 </script> 216 </script>
217 -<script type="text/html" id="list_forms"> 217 +<script type="text/html" id="statisticsDaily">
218 {{each list as obj i}} 218 {{each list as obj i}}
219 - <tr>  
220 - 219 + <tr>
  220 + <td>{{obj.xlName}}</td>
  221 + <td>{{obj.jhlc}}</td>
  222 + <td>{{obj.sjgl}}</td>
  223 + <td>{{obj.ssgl}}</td>
  224 + <td>&nbsp;</td>
  225 + <td>&nbsp;</td>
  226 + <td>&nbsp;</td>
  227 + <td>&nbsp;</td>
  228 + <td>&nbsp;</td>
  229 + <td>&nbsp;</td>
  230 + <td>&nbsp;</td>
  231 + <td>&nbsp;</td>
  232 + <td>&nbsp;</td>
  233 + <td>&nbsp;</td>
  234 + <td>&nbsp;</td>
  235 + <td>&nbsp;</td>
  236 + <td>&nbsp;</td>
  237 + <td>&nbsp;</td>
  238 + <td>&nbsp;</td>
  239 + <td>&nbsp;</td>
  240 + <td>&nbsp;</td>
  241 + <td>&nbsp;</td>
  242 + <td>&nbsp;</td>
  243 + <td>&nbsp;</td>
  244 + <td>&nbsp;</td>
  245 + <td>&nbsp;</td>
  246 + <td>&nbsp;</td>
  247 + <td>&nbsp;</td>
  248 + <td>&nbsp;</td>
  249 + <td>&nbsp;</td>
  250 + <td>&nbsp;</td>
  251 + <td>&nbsp;</td>
  252 + <td>&nbsp;</td>
  253 + <td>&nbsp;</td>
  254 + <td>&nbsp;</td>
  255 + <td>&nbsp;</td>
221 </tr> 256 </tr>
222 {{/each}} 257 {{/each}}
223 {{if list.length == 0}} 258 {{if list.length == 0}}
src/main/resources/static/pages/forms/statement/waybill_minhang.html
@@ -304,32 +304,32 @@ @@ -304,32 +304,32 @@
304 <tr> 304 <tr>
305 <td colspan="2">计划公里</td> 305 <td colspan="2">计划公里</td>
306 <td>{{jhlc}}</td> 306 <td>{{jhlc}}</td>
307 - <td>抽减公里</td> 307 + <td>烂班公里</td>
308 <td>{{remMileage}}</td> 308 <td>{{remMileage}}</td>
309 - <td colspan="2">加公里</td> 309 + <td colspan="2">加公里</td>
310 <td>{{addMileage}}</td> 310 <td>{{addMileage}}</td>
311 - <td colspan="2">实际计划公里</td>  
312 - <td colspan="3">{{jhlc}}</td> 311 + <td colspan="2">营运公里</td>
  312 + <td colspan="3">{{yygl}}</td>
313 </tr> 313 </tr>
314 <tr> 314 <tr>
315 - <td colspan="2">营运公里</td>  
316 - <td>{{realMileage}}</td>  
317 - <td>空驶公里</td> 315 + <td colspan="2">空驶公里</td>
318 <td>{{ksgl}}</td> 316 <td>{{ksgl}}</td>
319 - <td colspan="2">总公里</td> 317 + <td>总公里</td>
320 <td>{{realMileage}}</td> 318 <td>{{realMileage}}</td>
321 <td colspan="2">计划班次</td> 319 <td colspan="2">计划班次</td>
322 - <td colspan="3">{{jhbc}}</td> 320 + <td>{{jhbc}}</td>
  321 + <td colspan="2">烂班班次</td>
  322 + <td colspan="3">{{cjbc}}</td>
323 </tr> 323 </tr>
324 <tr> 324 <tr>
325 - <td colspan="2">抽减班次</td>  
326 - <td>{{cjbc}}</td>  
327 - <td>增加班次</td> 325 + <td colspan="2">增加班次</td>
328 <td>{{ljbc}}</td> 326 <td>{{ljbc}}</td>
329 - <td colspan="2">实际计划班次</td>  
330 - <td>{{jhbc}}</td>  
331 - <td colspan="2">实际班次</td>  
332 - <td colspan="3">{{sjbc}}</td> 327 + <td>实际班次</td>
  328 + <td>{{sjbc}}</td>
  329 + <td colspan="2"></td>
  330 + <td></td>
  331 + <td colspan="2"></td>
  332 + <td colspan="3"></td>
333 </tr> 333 </tr>
334 </script> 334 </script>
335 <script type="text/html" id="ludan_4"> 335 <script type="text/html" id="ludan_4">
src/main/resources/static/pages/scheduleApp/module/common/dt/MyEmployeeGroupWrapTemplate.html 0 → 100644
  1 +<div name="{{$saEmployeegroupCtrl.$name_attr}}"
  2 + ng-model="$saEmployeegroupCtrl.$$internalmodel">
  3 +
  4 + <style>
  5 + .employee-select {
  6 + min-height: 180px;
  7 + border: 1px solid #ddd;
  8 + }
  9 + .employee-select .employee-input {
  10 + margin: 2px 5px 5px 5px;
  11 + padding-left: 0;
  12 + }
  13 + .employee-select .employee-select-cont {
  14 + text-align: left;
  15 + min-height: 60px;
  16 + padding-right: 0px;
  17 + }
  18 + .employee-select .employee-select-body {
  19 + margin-top: 10px;
  20 + overflow: auto;
  21 + width: auto;
  22 + min-height: 5px;
  23 + }
  24 + .employee-select .employee {
  25 + display: inline-block;
  26 + padding: 8px;
  27 + min-width: 50px;
  28 + text-align: center;
  29 + border: 1px solid #C1C1C1;
  30 + color: #666;
  31 + border-radius: 5px !important;
  32 + margin: 5px;
  33 + }
  34 + .employee-select .employee.active {
  35 + color: white;
  36 + background: #4095E8;
  37 + border: 1px solid #4095E8;
  38 + }
  39 + .employee-select .employee.start {
  40 + color: white;
  41 + background: #32C5D2;
  42 + border: 1px solid #32C5D2;
  43 + }
  44 +
  45 + </style>
  46 +
  47 + <div class="col-md-12 employee-select">
  48 + <div class="col-md-12 employee-input">
  49 + <div class="col-md-9">
  50 + 人员列表
  51 + <span ng-bind="$saEmployeegroupCtrl.$$dataDesc"></span>
  52 + </div>
  53 + </div>
  54 + <div class="col-md-12 employee-select-cont">
  55 + <div class="employee-select-body">
  56 + <div class="employee active"
  57 + ng-repeat="$d in $saEmployeegroupCtrl.$$data track by $index"
  58 + ng-click="$saEmployeegroupCtrl.$$internal_rylist_click($index)">
  59 + {{$d.jsy}}-{{$d.spy}}
  60 + </div>
  61 + </div>
  62 + </div>
  63 + <div class="col-md-12 employee-input">
  64 + <div class="col-md-9">
  65 + 已经选中的人员列表
  66 + <span ng-bind="$saEmployeegroupCtrl.$$dataSelectDesc"></span>
  67 + </div>
  68 + </div>
  69 + <div class="col-md-12 employee-select-cont">
  70 + <div class="employee-select-body">
  71 + <div ng-class="{employee: true, active: true, start: $d.isstart}"
  72 + ng-repeat="$d in $saEmployeegroupCtrl.$$dataSelected track by $index"
  73 + ng-click="$saEmployeegroupCtrl.$$internal_selrylist_click($index)"
  74 + ng-dblclick="$saEmployeegroupCtrl.$$internal_selrylist_dbclick($index)">
  75 + {{$d.jsy}}-{{$d.spy}}
  76 + </div>
  77 + </div>
  78 + </div>
  79 + </div>
  80 +
  81 +
  82 +</div>
0 \ No newline at end of file 83 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dt/MyGuideboardGroupWrapTemplate.html
1 -<div name="{{$saGuideboardgroupCtrl.$name_attr}}"  
2 - ng-model="$saGuideboardgroupCtrl.$$internalmodel">  
3 -  
4 - <style>  
5 - .guideboard-select {  
6 - height: 180px;  
7 - border: 1px solid #ddd;  
8 - }  
9 - .guideboard-select .guideboard-input {  
10 - margin: 2px 5px 5px 5px;  
11 - padding-left: 0;  
12 - }  
13 - .guideboard-select .guideboard-select-cont {  
14 - text-align: left;  
15 - height: 100px;  
16 - padding-right: 0px;  
17 - }  
18 - .guideboard-select .guideboard-select-body {  
19 - margin-top: 10px;  
20 - overflow: auto;  
21 - width: auto;  
22 - height: 100px;  
23 - }  
24 - .guideboard-select .guideboard {  
25 - display: inline-block;  
26 - padding: 8px;  
27 - min-width: 85px;  
28 - text-align: center;  
29 - border: 1px solid #C1C1C1;  
30 - color: #666;  
31 - border-radius: 5px !important;  
32 - margin: 5px;  
33 - }  
34 - .guideboard-select .guideboard.active {  
35 - color: white;  
36 - background: #4095E8;  
37 - border: 1px solid #4095E8;  
38 - }  
39 -  
40 - </style>  
41 -  
42 - <div class="col-md-12 guideboard-select">  
43 - <div class="col-md-12 guideboard-input">  
44 - <div class="col-md-9">  
45 - 某某线路的路牌列表  
46 - </div>  
47 - </div>  
48 - <div class="col-md-12 guideboard-select-cont">  
49 - <div class="guideboard-select-body">  
50 - <div class="guideboard active">  
51 - 1  
52 - </div>  
53 - <div class="guideboard active">  
54 - 2  
55 - </div>  
56 - <div class="guideboard active">  
57 - 3  
58 - </div>  
59 - <div class="guideboard active">  
60 - 4  
61 - </div>  
62 - </div>  
63 - </div>  
64 - </div>  
65 -  
66 - 1 +<div name="{{$saGuideboardgroupCtrl.$name_attr}}"
  2 + ng-model="$saGuideboardgroupCtrl.$$internalmodel">
  3 +
  4 + <style>
  5 + .guideboard-select {
  6 + min-height: 180px;
  7 + border: 1px solid #ddd;
  8 + }
  9 + .guideboard-select .guideboard-input {
  10 + margin: 2px 5px 5px 5px;
  11 + padding-left: 0;
  12 + }
  13 + .guideboard-select .guideboard-select-cont {
  14 + text-align: left;
  15 + min-height: 60px;
  16 + padding-right: 0px;
  17 + }
  18 + .guideboard-select .guideboard-select-body {
  19 + margin-top: 10px;
  20 + overflow: auto;
  21 + width: auto;
  22 + min-height: 5px;
  23 + }
  24 + .guideboard-select .guideboard {
  25 + display: inline-block;
  26 + padding: 8px;
  27 + min-width: 50px;
  28 + text-align: center;
  29 + border: 1px solid #C1C1C1;
  30 + color: #666;
  31 + border-radius: 5px !important;
  32 + margin: 5px;
  33 + }
  34 + .guideboard-select .guideboard.active {
  35 + color: white;
  36 + background: #4095E8;
  37 + border: 1px solid #4095E8;
  38 + }
  39 + .guideboard-select .guideboard.start {
  40 + color: white;
  41 + background: #32C5D2;
  42 + border: 1px solid #32C5D2;
  43 + }
  44 +
  45 + </style>
  46 +
  47 + <div class="col-md-12 guideboard-select">
  48 + <div class="col-md-12 guideboard-input">
  49 + <div class="col-md-9">
  50 + 路牌列表
  51 + <span ng-bind="$saGuideboardgroupCtrl.$$dataDesc"></span>
  52 + </div>
  53 + </div>
  54 + <div class="col-md-12 guideboard-select-cont">
  55 + <div class="guideboard-select-body">
  56 + <div class="guideboard active"
  57 + ng-repeat="$d in $saGuideboardgroupCtrl.$$data track by $index"
  58 + ng-click="$saGuideboardgroupCtrl.$$internal_lplist_click($index)">
  59 + {{$d.lpname}}
  60 + </div>
  61 + </div>
  62 + </div>
  63 + <div class="col-md-12 guideboard-input">
  64 + <div class="col-md-9">
  65 + 已经选中的路牌列表
  66 + <span ng-bind="$saGuideboardgroupCtrl.$$dataSelectDesc"></span>
  67 + </div>
  68 + </div>
  69 + <div class="col-md-12 guideboard-select-cont">
  70 + <div class="guideboard-select-body">
  71 + <div ng-class="{guideboard: true, active: true, start: $d.isstart}"
  72 + ng-repeat="$d in $saGuideboardgroupCtrl.$$dataSelected track by $index"
  73 + ng-click="$saGuideboardgroupCtrl.$$internal_sellplist_click($index)"
  74 + ng-dblclick="$saGuideboardgroupCtrl.$$internal_sellplist_dbclick($index)">
  75 + {{$d.lpname}}
  76 + </div>
  77 + </div>
  78 + </div>
  79 + </div>
  80 +
67 </div> 81 </div>
68 \ No newline at end of file 82 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
1 -// 自定义指令,指令模版在dt目录下  
2 -  
3 -  
4 -angular.module('ScheduleApp').directive('loadingWidget', ['requestNotificationChannel', function(requestNotificationChannel) {  
5 - return {  
6 - restrict: 'A',  
7 - link: function(scope, element) {  
8 - // 初始隐藏loading界面  
9 - element.hide();  
10 -  
11 - // 开始请求通知处理  
12 - requestNotificationChannel.onRequestStarted(scope, function() {  
13 - element.show();  
14 - });  
15 - // 请求结束通知处理  
16 - requestNotificationChannel.onRequestEnded(scope, function() {  
17 - element.hide();  
18 - });  
19 - }  
20 - };  
21 -}]);  
22 -  
23 -angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) {  
24 - return {  
25 - restrict: 'E',  
26 - templateUrl: '/pages/scheduleApp/module/other/MyDictionarySelectTemplate.html',  
27 - scope: {  
28 - model: "="  
29 - },  
30 - controllerAs: "$saSelectCtrl",  
31 - bindToController: true,  
32 - controller: function() {  
33 - var self = this;  
34 - self.datas = []; // 关联的字典数据,内部格式 {code:{值},name:{名字}}  
35 - },  
36 - /**  
37 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
38 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
39 - * @param tElem  
40 - * @param tAttrs  
41 - * @returns {{pre: Function, post: Function}}  
42 - */  
43 - compile: function(tElem, tAttrs) {  
44 - // 确定是否使用angularjs required验证  
45 - // 属性 required  
46 - // 如果没有填写,内部不添加验证,如果填写了,并且等于true添加验证,否则不添加  
47 - var required_attr = tAttrs["required"];  
48 - if (required_attr) {  
49 - if (required_attr == "true") {  
50 - // 添加required属性指令  
51 - tElem.find("ui-select").attr("required", "");  
52 - } else {  
53 - // 不等于true,不添加required属性指令  
54 - }  
55 - } else {  
56 - // 不添加required属性指令  
57 - }  
58 -  
59 - //console.log("saSelect" + ":compile = >" + tElem.html());  
60 -  
61 - return {  
62 - pre: function(scope, element, attr) {  
63 - // TODO:  
64 - },  
65 - /**  
66 - * 相当于link函数。  
67 - *  
68 - * 重要属性如下:  
69 - * model 是绑定外部值。  
70 - * dicgroup 字典组的类型  
71 - * name input name属性值  
72 - */  
73 - post: function(scope, element, attr) {  
74 - // 1、获取属性  
75 - var dicgroup_attr = attr['dicgroup']; // 字典组的类型  
76 - var name_attr = attr['name']; // input name属性值  
77 - var dicname_attr = attr['dicname']; // model关联的字典名字段  
78 - var codename_attr = attr['codename']; // model关联的字典值字段  
79 - var placeholder_attr = attr['placeholder']; // select placeholder提示  
80 -  
81 - // 系统的字典对象,使用dictionaryUtils类获取  
82 - var origin_dicgroup;  
83 - var dic_key; // 字典key  
84 -  
85 - if (dicgroup_attr) { // 赋值指定的字典数据  
86 - origin_dicgroup = dictionaryUtils.getByGroup(dicgroup_attr);  
87 - for (dic_key in origin_dicgroup) {  
88 - var data = {}; // 重新组合的字典元素对象  
89 - if (dic_key == "true")  
90 - data.code = true;  
91 - else  
92 - data.code = dic_key;  
93 - data.name = origin_dicgroup[dic_key];  
94 - scope["$saSelectCtrl"].datas.push(data);  
95 - }  
96 - }  
97 -  
98 - if (name_attr) {  
99 - scope["$saSelectCtrl"].nv = name_attr;  
100 - }  
101 - if (placeholder_attr) {  
102 - scope["$saSelectCtrl"].ph = placeholder_attr;  
103 - }  
104 -  
105 - scope["$saSelectCtrl"].select = function($item) {  
106 - if (codename_attr) {  
107 - scope["$saSelectCtrl"].model[codename_attr] = $item.code;  
108 - }  
109 - if (dicname_attr) {  
110 - scope["$saSelectCtrl"].model[dicname_attr] = $item.name;  
111 - }  
112 - };  
113 -  
114 - scope["$saSelectCtrl"].remove = function() {  
115 - if (codename_attr) {  
116 - scope["$saSelectCtrl"].model[codename_attr] = null;  
117 - }  
118 - if (dicname_attr) {  
119 - scope["$saSelectCtrl"].model[dicname_attr] = null;  
120 - }  
121 - scope["$saSelectCtrl"].cmodel = null;  
122 - };  
123 -  
124 - $timeout(function() {  
125 - // 创建内部使用的绑定对象  
126 - var model_code = scope["$saSelectCtrl"].model[codename_attr];  
127 - scope["$saSelectCtrl"].cmodel = model_code;  
128 - }, 0);  
129 - }  
130 - }  
131 - }  
132 - };  
133 -}]);  
134 -  
135 -/**  
136 - * saRadiogroup指令  
137 - * 属性如下:  
138 - * model(必须):独立作用域,外部绑定的一个值,如:ctrl.timeTableManageForForm.isEnableDisTemplate  
139 - * dicgroup(必须):关联的字典数据type(TODO:以后增加其他数据源)  
140 - * name(必须):控件的名字  
141 - * required(可选):是否要用required验证  
142 - * disabled(可选):标示单选框是否可选  
143 - *  
144 - */  
145 -angular.module('ScheduleApp').directive("saRadiogroup", [function() {  
146 - /**  
147 - * 使用字典数据的单选按钮组的指令。  
148 - * 指令名称:truefalse-Dic  
149 - */  
150 - return {  
151 - restrict: 'E',  
152 - templateUrl: '/pages/scheduleApp/module/common/dt/MyRadioGroupWrapTemplate.html',  
153 - scope: {  
154 - model: "="  
155 - },  
156 - controllerAs: "$saRadiogroupCtrl",  
157 - bindToController: true,  
158 - controller: function($scope) {  
159 - //$scope["model"] = {selectedOption: null};  
160 - //console.log("controller");  
161 - //console.log("controller:" + $scope["model"]);  
162 -  
163 - var self = this;  
164 - self.$$data = null; // 内部数据  
165 - },  
166 -  
167 - /**  
168 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
169 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
170 - * @param tElem  
171 - * @param tAttrs  
172 - * @returns {{pre: Function, post: Function}}  
173 - */  
174 - compile: function(tElem, tAttrs) {  
175 - // 获取属性  
176 - var $dicgroup_attr = tAttrs["dicgroup"]; // 关联的字典数据type  
177 - var $name_attr = tAttrs["name"]; // 控件的名字  
178 - var $required_attr = tAttrs["required"]; // 是否要用required验证  
179 - var $disabled_attr = tAttrs["disabled"]; // 标示单选框是否可选  
180 -  
181 - // controlAs名字  
182 - var ctrlAs = "$saRadiogroupCtrl";  
183 -  
184 - // 如果有required属性,添加angularjs required验证  
185 - if ($required_attr != undefined) {  
186 - tElem.find("input").attr("required", "");  
187 - }  
188 -  
189 - return {  
190 - pre: function(scope, element, attr) {  
191 -  
192 - },  
193 -  
194 - /**  
195 - * 相当于link函数。  
196 - * @param scope  
197 - * @param element  
198 - * @param attr  
199 - */  
200 - post: function(scope, element, attr) {  
201 - //console.log("link");  
202 - //console.log("link:" + scope.model);  
203 - //scope["model"] = {selectedOption: null};  
204 -  
205 - if ($name_attr) {  
206 - scope[ctrlAs].nv = $name_attr;  
207 - }  
208 -  
209 - if ($disabled_attr) {  
210 - scope[ctrlAs].disabled = true;  
211 - }  
212 - if ($dicgroup_attr) {  
213 - var obj = dictionaryUtils.getByGroup($dicgroup_attr);  
214 - scope[ctrlAs].$$data = obj;  
215 - // 处理 scope["dic"] key值  
216 - scope[ctrlAs].dicvalueCalcu = function(value) {  
217 - if (value == "true") {  
218 - //console.log(value);  
219 - return true;  
220 - } else if (value == "false") {  
221 - //console.log(value);  
222 - return false;  
223 - } else {  
224 - return value;  
225 - }  
226 - };  
227 - }  
228 - }  
229 - };  
230 - }  
231 - };  
232 -}]);  
233 -  
234 -angular.module('ScheduleApp').directive("remoteValidaton", [  
235 - 'BusInfoManageService_g',  
236 - 'EmployeeInfoManageService_g',  
237 - 'TimeTableManageService_g',  
238 - function(  
239 - busInfoManageService_g,  
240 - employeeInfoManageService_g,  
241 - timeTableManageService_g  
242 - ) {  
243 - /**  
244 - * 远端验证指令,依赖于ngModel  
245 - * 指令名称 remote-Validation  
246 - * 需要属性 rvtype 表示验证类型  
247 - */  
248 - return {  
249 - restrict: "A",  
250 - require: "^ngModel",  
251 - link: function(scope, element, attr, ngModelCtrl) {  
252 - element.bind("keyup", function() {  
253 - var modelValue = ngModelCtrl.$modelValue;  
254 - var rv1_attr = attr["rv1"];  
255 - if (attr["rvtype"]) {  
256 -  
257 - // 根据rvtype的值,确定使用那个远端验证的url,  
258 - // rv1, rv2, rv3是关联比较值,暂时使用rv1  
259 - // 这个貌似没法通用,根据业务变换  
260 - // TODO:暂时有点乱以后改  
261 - if (attr["rvtype"] == "insideCode") {  
262 - busInfoManageService_g.validate.insideCode(  
263 - {"insideCode_eq": modelValue, type: "equale"},  
264 - function(result) {  
265 - //console.log(result);  
266 - if (result.status == "SUCCESS") {  
267 - ngModelCtrl.$setValidity('remote', true);  
268 - } else {  
269 - ngModelCtrl.$setValidity('remote', false);  
270 - }  
271 - },  
272 - function(result) {  
273 - //console.log(result);  
274 - ngModelCtrl.$setValidity('remote', true);  
275 - }  
276 - );  
277 - } else if (attr["rvtype"] == "jobCode") {  
278 - if (!rv1_attr) {  
279 - ngModelCtrl.$setValidity('remote', false);  
280 - return;  
281 - }  
282 -  
283 - employeeInfoManageService_g.validate.jobCode(  
284 - {"jobCode_eq": modelValue, "companyCode_eq": rv1_attr, type: "equale"},  
285 - function(result) {  
286 - //console.log(result);  
287 - if (result.status == "SUCCESS") {  
288 - ngModelCtrl.$setValidity('remote', true);  
289 - } else {  
290 - ngModelCtrl.$setValidity('remote', false);  
291 - }  
292 - },  
293 - function(result) {  
294 - //console.log(result);  
295 - ngModelCtrl.$setValidity('remote', true);  
296 - }  
297 - );  
298 - } else if (attr["rvtype"] == "ttinfoname") {  
299 - if (!rv1_attr) {  
300 - ngModelCtrl.$setValidity('remote', false);  
301 - return;  
302 - }  
303 -  
304 - timeTableManageService_g.validate.ttinfoname(  
305 - {"name_eq": modelValue, "xl.id_eq": rv1_attr, type: "equale"},  
306 - function(result) {  
307 - //console.log(result);  
308 - if (result.status == "SUCCESS") {  
309 - ngModelCtrl.$setValidity('remote', true);  
310 - } else {  
311 - ngModelCtrl.$setValidity('remote', false);  
312 - }  
313 - },  
314 - function(result) {  
315 - //console.log(result);  
316 - ngModelCtrl.$setValidity('remote', true);  
317 - }  
318 - );  
319 -  
320 - }  
321 - } else {  
322 - // 没有rvtype,就不用远端验证了  
323 - ngModelCtrl.$setValidity('remote', true);  
324 - }  
325 -  
326 - attr.$observe("rv1", function(value) {  
327 - if (attr["rvtype"] == "jobCode") {  
328 - if (!value) {  
329 - ngModelCtrl.$setValidity('remote', false);  
330 - return;  
331 - }  
332 -  
333 - employeeInfoManageService_g.validate.jobCode(  
334 - {"jobCode_eq": modelValue, "companyCode_eq": rv1_attr, type: "equale"},  
335 - function(result) {  
336 - //console.log(result);  
337 - if (result.status == "SUCCESS") {  
338 - ngModelCtrl.$setValidity('remote', true);  
339 - } else {  
340 - ngModelCtrl.$setValidity('remote', false);  
341 - }  
342 - },  
343 - function(result) {  
344 - //console.log(result);  
345 - ngModelCtrl.$setValidity('remote', true);  
346 - }  
347 - );  
348 - } else if (attr["rvtype"] == "ttinfoname") {  
349 - if (!value) {  
350 - ngModelCtrl.$setValidity('remote', false);  
351 - return;  
352 - }  
353 -  
354 - console.log("rv1:" + value);  
355 -  
356 - timeTableManageService_g.validate.ttinfoname(  
357 - {"name_eq": modelValue, "xl.id_eq": value, type: "equale"},  
358 - function(result) {  
359 - //console.log(result);  
360 - if (result.status == "SUCCESS") {  
361 - ngModelCtrl.$setValidity('remote', true);  
362 - } else {  
363 - ngModelCtrl.$setValidity('remote', false);  
364 - }  
365 - },  
366 - function(result) {  
367 - //console.log(result);  
368 - ngModelCtrl.$setValidity('remote', true);  
369 - }  
370 - );  
371 - }  
372 -  
373 - });  
374 - });  
375 - }  
376 - };  
377 - }]);  
378 -  
379 -  
380 -/**  
381 - * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。  
382 - * 1、compile阶段使用的属性如下:  
383 - * required:用于和表单验证连接,指定成required="true"才有效。  
384 - * 2、link阶段使用的属性如下  
385 - * model:关联的模型对象  
386 - * name:表单验证时需要的名字  
387 - * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加  
388 - * modelcolname1:关联的模型字段名字1(一般应该是编码字段)  
389 - * modelcolname2:关联的模型字段名字2(一般应该是名字字段)  
390 - * datacolname1;内部数据对应的字段名字1(与模型字段1对应)  
391 - * datacolname2:内部数据对应的字段名字2(与模型字段2对应)  
392 - * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用  
393 - * placeholder:select placeholder字符串描述  
394 - *  
395 - * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。  
396 - * $$SearchInfoService_g,内部使用的数据服务  
397 - */  
398 -// saSelect2指令使用的内部信service  
399 -angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {  
400 - return {  
401 - xl: $resource(  
402 - '/line/:type',  
403 - {order: 'name', direction: 'ASC'},  
404 - {  
405 - list: {  
406 - method: 'GET',  
407 - isArray: true  
408 - }  
409 - }  
410 - ),  
411 - zd: $resource(  
412 - '/stationroute/stations',  
413 - {order: 'stationCode', direction: 'ASC'},  
414 - {  
415 - list: {  
416 - method: 'GET',  
417 - isArray: true  
418 - }  
419 - }  
420 - ),  
421 - tcc: $resource(  
422 - '/carpark/:type',  
423 - {order: 'parkCode', direction: 'ASC'},  
424 - {  
425 - list: {  
426 - method: 'GET',  
427 - isArray: true  
428 - }  
429 - }  
430 - ),  
431 - ry: $resource(  
432 - '/personnel/:type',  
433 - {order: 'personnelName', direction: 'ASC'},  
434 - {  
435 - list: {  
436 - method: 'GET',  
437 - isArray: true  
438 - }  
439 - }  
440 - ),  
441 - cl: $resource(  
442 - '/cars/:type',  
443 - {order: "insideCode", direction: 'ASC'},  
444 - {  
445 - list: {  
446 - method: 'GET',  
447 - isArray: true  
448 - }  
449 - }  
450 - ),  
451 - ttInfo: $resource(  
452 - '/tic/:type',  
453 - {order: "name", direction: 'ASC'},  
454 - {  
455 - list: {  
456 - method: 'GET',  
457 - isArray: true  
458 - }  
459 - }  
460 - ),  
461 - cci: $resource(  
462 - '/cci/cars',  
463 - {},  
464 - {  
465 - list: {  
466 - method: 'GET',  
467 - isArray: true  
468 - }  
469 - }  
470 -  
471 - ),  
472 - cci2: $resource(  
473 - '/cci/:type',  
474 - {},  
475 - {  
476 - list: {  
477 - method: 'GET',  
478 - isArray: true  
479 - }  
480 - }  
481 - )  
482 - }  
483 -}]);  
484 -angular.module('ScheduleApp').filter("$$pyFilter", function() {  
485 - return function(items, props) {  
486 - var out = [];  
487 - var limit = props["limit"] || 20; // 默认20条记录  
488 -  
489 - if (angular.isArray(items)) {  
490 - items.forEach(function(item) {  
491 - if (out.length < limit) {  
492 - if (props.search) {  
493 - var upTerm = props.search.toUpperCase();  
494 - if(item.fullChars.indexOf(upTerm) != -1  
495 - || item.camelChars.indexOf(upTerm) != -1) {  
496 - out.push(item);  
497 - }  
498 - }  
499 - }  
500 - });  
501 - }  
502 -  
503 - return out;  
504 - };  
505 -});  
506 -angular.module('ScheduleApp').directive("saSelect2", [  
507 - '$timeout', '$$SearchInfoService_g',  
508 - function($timeout, $$searchInfoService_g) {  
509 - return {  
510 - restrict: 'E',  
511 - templateUrl: '/pages/scheduleApp/module/other/MySearchSelectTemplate.html',  
512 - scope: {  
513 - model: "=" // 独立作用域,关联外部的模型对象  
514 - },  
515 - controllerAs: "$saSelectCtrl",  
516 - bindToController: true,  
517 - controller: function($scope) {  
518 - var self = this;  
519 - self.$$data = []; // 内部关联的数据  
520 - },  
521 - /**  
522 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
523 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
524 - * @param tElem  
525 - * @param tAttrs  
526 - * @returns {{pre: Function, post: Function}}  
527 - */  
528 - compile: function(tElem, tAttrs) {  
529 - // 1、获取此阶段使用的属性  
530 - var $required_attr = tAttrs["required"]; // 用于和表单验证连接,指定成required="true"才有效。  
531 -  
532 - // 2、处理属性  
533 -  
534 - // 确定是否使用angularjs required验证  
535 - // 属性 required  
536 - // 如果没有填写,内部不添加验证,如果填写了,并且等于true添加验证,否则不添加  
537 - if ($required_attr) {  
538 - if ($required_attr == "true") {  
539 - // 添加required属性指令  
540 - tElem.find("ui-select").attr("required", "");  
541 - } else {  
542 - // 不等于true,不添加required属性指令  
543 - }  
544 - } else {  
545 - // 不添加required属性指令  
546 - }  
547 -  
548 - //console.log("saSelect" + ":compile = >" + tElem.html());  
549 -  
550 - return {  
551 - pre: function(scope, element, attr) {  
552 - // TODO:  
553 - },  
554 - /**  
555 - * 相当于link函数。  
556 - *  
557 - * 重要属性如下:  
558 - * model 是绑定外部值。  
559 - * dicgroup 字典组的类型  
560 - * name input name属性值  
561 - */  
562 - post: function(scope, element, attr) {  
563 - // 1、获取此阶段使用的属性  
564 - var $name_attr = attr["name"]; // 表单验证时需要的名字  
565 - var $type_attr = attr["type"]; // 关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加  
566 - var $modelcolname1_attr = attr["modelcolname1"]; // 关联的模型字段名字1(一般应该是编码字段)  
567 - var $modelcolname2_attr = attr["modelcolname2"]; // 关联的模型字段名字2(一般应该是名字字段)  
568 - var $datacolname1_attr = attr["datacolname1"]; // 内部数据对应的字段名字1(与模型字段1对应)  
569 - var $datacolname2_attr = attr["datacolname2"]; // 内部数据对应的字段名字2(与模型字段2对应)  
570 - var $showcolname_attr = attr["showcolname"]; // 下拉框显示的内部数据字段名  
571 - var $placeholder_attr = attr["placeholder"]; // select placeholder字符串描述  
572 -  
573 - // 2、处理属性、转换成$saSelectCtrl内部使用的属性  
574 - if ($name_attr) {  
575 - scope["$saSelectCtrl"].$name_attr = $name_attr;  
576 - }  
577 - if ($placeholder_attr) {  
578 - scope["$saSelectCtrl"].$placeholder_attr = $placeholder_attr;  
579 - }  
580 - if ($showcolname_attr) {  
581 - scope["$saSelectCtrl"].$showcolname_attr = $showcolname_attr;  
582 - }  
583 -  
584 - // 2-1、添加内部方法,根据type值,改变$$data的值  
585 - scope["$saSelectCtrl"].$$internal_data_change_fn = function() {  
586 - // 根据type属性动态载入数据  
587 - if ($type_attr) {  
588 - $$searchInfoService_g[$type_attr].list(  
589 - {type: "all"},  
590 - function(result) {  
591 - scope["$saSelectCtrl"].$$data = [];  
592 - for (var i = 0; i < result.length; i ++) {  
593 - var data = {}; // data是result的一部分属性集合,根据配置来确定  
594 - if ($datacolname1_attr) {  
595 - data[$datacolname1_attr] = result[i][$datacolname1_attr];  
596 - }  
597 - if ($datacolname2_attr) {  
598 - data[$datacolname2_attr] = result[i][$datacolname2_attr];  
599 - }  
600 - if ($showcolname_attr) {  
601 - // 动态添加基于名字的拼音  
602 - data[$showcolname_attr] = result[i][$showcolname_attr];  
603 - if (data[$showcolname_attr]) {  
604 - data["fullChars"] = pinyin.getFullChars(result[i][$showcolname_attr]).toUpperCase(); // 全拼  
605 - data["camelChars"] = pinyin.getCamelChars(result[i][$showcolname_attr]); // 简拼  
606 - }  
607 - }  
608 - if (data["fullChars"])  
609 - scope["$saSelectCtrl"].$$data.push(data);  
610 - }  
611 - },  
612 - function(result) {  
613 -  
614 - }  
615 - );  
616 - }  
617 - };  
618 -  
619 - // 3、选择、删除事件映射模型和内部数据对应的字段  
620 - scope["$saSelectCtrl"].$select_fn_attr = function($item) {  
621 - if ($modelcolname1_attr && $datacolname1_attr) {  
622 - scope["$saSelectCtrl"].model[$modelcolname1_attr] = $item[$datacolname1_attr];  
623 - }  
624 - if ($modelcolname2_attr && $datacolname2_attr) {  
625 - scope["$saSelectCtrl"].model[$modelcolname2_attr] = $item[$datacolname2_attr];  
626 - }  
627 - };  
628 - scope["$saSelectCtrl"].$remove_fn_attr = function() {  
629 - if ($modelcolname1_attr) {  
630 - scope["$saSelectCtrl"].model[$modelcolname1_attr] = null;  
631 - }  
632 - if ($modelcolname2_attr) {  
633 - scope["$saSelectCtrl"].model[$modelcolname2_attr] = null;  
634 - }  
635 - scope["$saSelectCtrl"].$$cmodel = null; // 内部模型清空  
636 -  
637 - scope["$saSelectCtrl"].$$internal_data_change_fn();  
638 - };  
639 -  
640 - // 4、搜索事件  
641 - scope["$saSelectCtrl"].$refreshdata_fn_attr = function($search) {  
642 - //var fullChars = pinyin.getFullChars($search).toUpperCase();  
643 - //var camelChars = pinyin.getCamelChars($search);  
644 - //  
645 - //console.log(fullChars + " " + camelChars);  
646 - // TODO:事件暂时没用,放着以后再说  
647 - };  
648 -  
649 - // 5、全部载入后,输入的  
650 - $timeout(function() {  
651 - // 创建内部使用的绑定对象,用于确认选中那个值  
652 - scope["$saSelectCtrl"].$$cmodel = scope["$saSelectCtrl"].model[$modelcolname1_attr];  
653 -  
654 - scope["$saSelectCtrl"].$$internal_data_change_fn();  
655 - }, 0);  
656 - }  
657 - }  
658 - }  
659 - };  
660 - }  
661 -]);  
662 -  
663 -/**  
664 - * saSelect3指令  
665 - * 属性如下:  
666 - * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave  
667 - * name(必须):控件的名字  
668 - * placeholder(可选):占位符字符串  
669 - * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}  
670 - * dcname(必须):绑定的model字段名,如:dcname=xl.id  
671 - * icname(必须):内部与之对应的字段名,如:icname=code  
672 - * dcname2(可选):其他需要赋值的model字段名2,如:dcname2=xl.name  
673 - * icname2(可选):内部与之对应的字段名2,如:icname2=name  
674 - * icnames(必须):用于用于显示,以及简评处理的内部数据字段,如:icnames=name  
675 - * required(可选):是否要用required验证  
676 - * datatype(必须):业务数据类型,有字典类型,动态数据类型,暂时写的死点  
677 - * mlp(可选):是否多级属性(这里假设外部model如果多级,内部model也是多级)  
678 - *  
679 - * 高级属性:  
680 - * dataassociate(可选):数据源是否关联属性(内部数据随外部指定的参数变化而变化)  
681 - * dataparam(可选):数据源关联的外部参数对象  
682 - *  
683 - */  
684 -angular.module('ScheduleApp').directive("saSelect3", [  
685 - '$timeout',  
686 - '$$SearchInfoService_g',  
687 - function($timeout, $$searchInfoService_g) {  
688 - return {  
689 - restrict: 'E',  
690 - templateUrl: '/pages/scheduleApp/module/common/dt/MyUiSelectWrapTemplate1.html',  
691 - scope: {  
692 - model: "=" // 独立作用域,关联外部的模型object  
693 - },  
694 - controllerAs: "$saSelectCtrl",  
695 - bindToController: true,  
696 - controller: function($scope) {  
697 - var self = this;  
698 - self.$$data = []; // ui-select显示用的数据源  
699 - self.$$data_real= []; // 内部真实的数据源  
700 - },  
701 -  
702 - /**  
703 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
704 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
705 - * @param tElem  
706 - * @param tAttrs  
707 - * @returns {{pre: Function, post: Function}}  
708 - */  
709 - compile: function(tElem, tAttrs) {  
710 - // 获取所有的属性  
711 - var $name_attr = tAttrs["name"]; // 控件的名字  
712 - var $placeholder_attr = tAttrs["placeholder"]; // 占位符的名字  
713 - var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名  
714 - var $icname_attr = tAttrs["icname"]; // 内部与之对应的字段名  
715 - var $dcname2_attr = tAttrs["dcname2"]; // 其他需要赋值的model字段名2  
716 - var $icname2_attr = tAttrs["icname2"]; // 内部与之对应的字段名2  
717 - var $icname_s_attr = tAttrs["icnames"]; // 用于用于显示,以及简评处理的内部数据字段  
718 - var $datatype_attr = tAttrs["datatype"]; // 内部业务数据类型  
719 - var $required_attr = tAttrs["required"]; // 是否需要required验证  
720 - var $mlp_attr = tAttrs["mlp"]; // 是否多级属性  
721 - var $dataassociate_attr = tAttrs["dataassociate"]; // 数据源是否关联属性  
722 -  
723 - // controlAs名字  
724 - var ctrlAs = "$saSelectCtrl";  
725 -  
726 - // 数据源初始化标志  
727 - var $$data_init = false;  
728 - // 如果有required属性,添加angularjs required验证  
729 - if ($required_attr != undefined) {  
730 - tElem.find("ui-select").attr("required", "");  
731 - }  
732 -  
733 - // 由于有的属性是多级的如xl.name,所以要在compile阶段重写属性绑定属性定义  
734 - // 原来的设置:{{$select.selected[$saSelectCtrl.$icname_s]}}  
735 - tElem.find("ui-select-match").html("{{$select.selected" + "." + $icname_s_attr + "}}");  
736 - // 原来的设置:item[$saSelectCtrl.$icname] as item in $saSelectCtrl.$$data  
737 - tElem.find("ui-select-choices").attr("repeat", "item" + "." + $icname_attr + " as item in $saSelectCtrl.$$data");  
738 - // 原来的设置:item[$saSelectCtrl.$icname_s]  
739 - tElem.find("ui-select-choices span").attr("ng-bind", "item" + "." + $icname_s_attr);  
740 - // 原来的设置:{{$saSelectCtrl.$name}}  
741 - tElem.find("ui-select").attr("name", $name_attr);  
742 - // 原来的设置:{{$saSelectCtrl.$placeholder}}  
743 - tElem.find("ui-select-match").attr("placeholder", $placeholder_attr);  
744 -  
745 - return {  
746 - pre: function(scope, element, attr) {  
747 - // TODO:  
748 - },  
749 - /**  
750 - * 相当于link函数。  
751 - * @param scope  
752 - * @param element  
753 - * @param attr  
754 - */  
755 - post: function(scope, element, attr) {  
756 - // 添加选中事件处理函数  
757 - scope[ctrlAs].$$internal_select_fn = function($item) {  
758 - if ($dcname_attr && $icname_attr) {  
759 - if ($mlp_attr) {  
760 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";");  
761 - } else {  
762 - scope[ctrlAs].model[$dcname_attr] = $item[$icname_attr];  
763 - }  
764 - }  
765 - if ($dcname2_attr && $icname2_attr) {  
766 - if ($mlp_attr) {  
767 - eval("scope[ctrlAs].model" + "." + $dcname2_attr + " = $item" + "." + $icname2_attr + ";");  
768 - } else {  
769 - scope[ctrlAs].model[$dcname2_attr] = $item[$icname2_attr];  
770 - }  
771 - }  
772 - };  
773 -  
774 - // 删除选中事件处理函数  
775 - scope[ctrlAs].$$internal_remove_fn = function() {  
776 - scope[ctrlAs].$$internalmodel = undefined;  
777 - if ($mlp_attr) {  
778 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;");  
779 - } else {  
780 - scope[ctrlAs].model[$dcname_attr] = undefined;  
781 - }  
782 -  
783 - if ($dcname2_attr) {  
784 - if ($mlp_attr) {  
785 - eval("scope[ctrlAs].model" + "." + $dcname2_attr + " = undefined;");  
786 - } else {  
787 - scope[ctrlAs].model[$dcname2_attr] = undefined;  
788 - }  
789 - }  
790 - };  
791 -  
792 - /**  
793 - * 内部方法,读取字典数据作为数据源。  
794 - * @param dicgroup 字典类型,如:gsType  
795 - * @param ccol 代码字段名  
796 - * @param ncol 名字字段名  
797 - */  
798 - scope[ctrlAs].$$internal_dic_data = function(dicgroup, ccol, ncol) {  
799 - var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup);  
800 - var dic_key; // 字典key  
801 - // 清空内部数据  
802 - scope[ctrlAs].$$data_real = [];  
803 - for (dic_key in origin_dicgroup) {  
804 - var data = {}; // 重新组合的字典元素对象  
805 - if (dic_key == "true")  
806 - data[ccol] = true;  
807 - else  
808 - data[ccol] = dic_key;  
809 - data[ncol] = origin_dicgroup[dic_key];  
810 - scope[ctrlAs].$$data_real.push(data);  
811 - }  
812 - // 这里直接将$$data_real数据深拷贝到$$data  
813 - angular.copy(scope[ctrlAs].$$data_real, scope[ctrlAs].$$data);  
814 -  
815 - console.log(scope[ctrlAs].$$data);  
816 - };  
817 -  
818 - /**  
819 - * TODO:这个方法有性能问题,result一多就会卡一卡,之后再解决把  
820 - * 内部方法,读取字典数据作为数据源。  
821 - * @param result 原始数据  
822 - * @param dcvalue 传入的关联数据  
823 - */  
824 - scope[ctrlAs].$$internal_other_data = function(result, dcvalue) {  
825 - //console.log("start");  
826 - // 清空内部数据  
827 - scope[ctrlAs].$$data_real = [];  
828 - scope[ctrlAs].$$data = [];  
829 - for (var i = 0; i < result.length; i ++) {  
830 - if ($icname_s_attr) {  
831 - if ($mlp_attr) {  
832 - if (eval("result[i]" + "." + $icname_s_attr)) {  
833 - // 全拼  
834 - result[i]["fullChars"] = pinyin.getFullChars(eval("result[i]" + "." + $icname_s_attr)).toUpperCase();  
835 - // 简拼  
836 - result[i]["camelChars"] = pinyin.getCamelChars(eval("result[i]" + "." + $icname_s_attr));  
837 - }  
838 - } else {  
839 - if (result[i][$icname_s_attr]) {  
840 - // 全拼  
841 - result[i]["fullChars"] = pinyin.getFullChars(result[i][$icname_s_attr]).toUpperCase();  
842 - // 简拼  
843 - result[i]["camelChars"] = pinyin.getCamelChars(result[i][$icname_s_attr]);  
844 - }  
845 - }  
846 - }  
847 -  
848 - if (result[i]["fullChars"]) { // 有拼音的加入数据源  
849 - scope[ctrlAs].$$data_real.push(result[i]);  
850 - }  
851 -  
852 - }  
853 - //console.log("start2");  
854 -  
855 - // 数量太大取前10条记录作为显示  
856 - if (angular.isArray(scope[ctrlAs].$$data_real)) {  
857 - // 先迭代循环查找已经传过来的值  
858 - if (scope[ctrlAs].$$data_real.length > 0) {  
859 - if (dcvalue) {  
860 - for (var j = 0; j < scope[ctrlAs].$$data_real.length; j++) {  
861 - if (scope[ctrlAs].$$data_real[j][$icname_attr] == dcvalue) {  
862 - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[j]));  
863 - break;  
864 - }  
865 - }  
866 - }  
867 - }  
868 - // 在插入剩余的数据  
869 - for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {  
870 - if (scope[ctrlAs].$$data.length < 10) {  
871 - if ($mlp_attr) {  
872 - if (eval("scope[ctrlAs].$$data_real[k]" + "." + $icname_attr + " != dcvalue")) {  
873 - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));  
874 - }  
875 - } else {  
876 - if (scope[ctrlAs].$$data_real[k][$icname_attr] != dcvalue) {  
877 - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));  
878 - }  
879 - }  
880 - } else {  
881 - break;  
882 - }  
883 - }  
884 - }  
885 -  
886 - //console.log("end");  
887 - };  
888 -  
889 - /**  
890 - * 判定一个对象是否为空对象。  
891 - * @param Obj  
892 - */  
893 - scope[ctrlAs].$$internal_isEmpty_obj = function(obj) {  
894 - console.log(typeof obj);  
895 -  
896 - if (typeof obj === "object" && !(obj instanceof Array)) {  
897 - for (var prop in obj) {  
898 - if (obj.hasOwnProperty(prop)) {  
899 - return false;  
900 - }  
901 - }  
902 - return true;  
903 - } else {  
904 - throw "必须是对象";  
905 - }  
906 - };  
907 -  
908 - // 刷新数据  
909 - scope[ctrlAs].$$internal_refresh_fn = function(search) {  
910 - // 绑定的model字段值,此属性是绑定属性,只能在link阶段获取  
911 - var $dcvalue_attr = attr["dcvalue"];  
912 -  
913 - console.log("刷新数据:" + $dcvalue_attr);  
914 -  
915 - if (!$$data_init) { // 只初始化$$data_real一次,重新载入页面才能重新初始化  
916 - if (dictionaryUtils.getByGroup($datatype_attr)) { // 判定是否字典类型数据源  
917 - scope[ctrlAs].$$internal_dic_data(  
918 - $datatype_attr, $icname_attr, $icname_s_attr);  
919 - if ($dcvalue_attr) {  
920 - scope[ctrlAs].$$internalmodel = $dcvalue_attr;  
921 - }  
922 - } else { // 非字典类型数据源  
923 - if (!$dataassociate_attr) {  
924 - $$searchInfoService_g[$datatype_attr].list(  
925 - {type: "all"},  
926 - function(result) {  
927 - //console.log("ok:" + $datatype_attr);  
928 - scope[ctrlAs].$$internal_other_data(result, $dcvalue_attr);  
929 - //console.log("ok2:" + $datatype_attr);  
930 - if ($dcvalue_attr) {  
931 - scope[ctrlAs].$$internalmodel = $dcvalue_attr;  
932 - }  
933 -  
934 - $$data_init = true;  
935 - },  
936 - function(result) {  
937 -  
938 - }  
939 - );  
940 - }  
941 - }  
942 - }  
943 -  
944 - if ($$data_init) {  
945 - if (search && search != "") { // 有search值  
946 - if (!dictionaryUtils.getByGroup($datatype_attr)) { // 其他数据源  
947 - // 处理search  
948 - console.log("search:" + search);  
949 -  
950 - scope[ctrlAs].$$data = [];  
951 - for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {  
952 - var upTerm = search.toUpperCase();  
953 - if (scope[ctrlAs].$$data.length < 10) {  
954 - if (scope[ctrlAs].$$data_real[k].fullChars.indexOf(upTerm) != -1  
955 - || scope[ctrlAs].$$data_real[k].camelChars.indexOf(upTerm) != -1) {  
956 - scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));  
957 - }  
958 - } else {  
959 - break;  
960 - }  
961 - }  
962 - }  
963 - }  
964 -  
965 - }  
966 -  
967 - };  
968 -  
969 -  
970 -  
971 -  
972 -  
973 -  
974 -  
975 -  
976 -  
977 -  
978 - // TODO:  
979 -  
980 - // dom全部载入后调用  
981 - $timeout(function() {  
982 - console.log("dom全部载入后调用");  
983 - }, 0);  
984 - // 监控dcvalue model值变换  
985 - attr.$observe("dcvalue", function(value) {  
986 - console.log("监控dc1 model值变换:" + value);  
987 - scope[ctrlAs].$$internalmodel = value;  
988 - }  
989 - );  
990 - // 监控获取数据参数变换  
991 - attr.$observe("dataparam", function(value) {  
992 - // 判定是否空对象  
993 - console.log(value);  
994 - var obj = JSON.parse(value);  
995 - var $dcvalue_attr = attr["dcvalue"];  
996 - if (!scope[ctrlAs].$$internal_isEmpty_obj(obj)) {  
997 - console.log("dataparam:" + obj);  
998 -  
999 - //  
1000 -  
1001 - obj["type"] = "all";  
1002 -  
1003 - $$data_init = false;  
1004 - $$searchInfoService_g[$datatype_attr].list(  
1005 - obj,  
1006 - function(result) {  
1007 - //console.log("ok:" + $datatype_attr);  
1008 - scope[ctrlAs].$$internal_other_data(result, $dcvalue_attr);  
1009 - //console.log("ok2:" + $datatype_attr);  
1010 - if ($dcvalue_attr) {  
1011 - scope[ctrlAs].$$internalmodel = $dcvalue_attr;  
1012 - }  
1013 -  
1014 - $$data_init = true;  
1015 - },  
1016 - function(result) {  
1017 -  
1018 - }  
1019 - );  
1020 - }  
1021 - }  
1022 - );  
1023 - }  
1024 - };  
1025 - }  
1026 - };  
1027 -  
1028 - }  
1029 -]);  
1030 -  
1031 -/**  
1032 - * saCheckboxgroup指令  
1033 - * 属性如下:  
1034 - * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave  
1035 - * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}  
1036 - * dcname(必须):绑定的model字段名,如:dcname=xl.id  
1037 - * name(必须):控件的名字  
1038 - * required(可选):是否要用required验证  
1039 - * disabled(可选):标示框是否可选  
1040 - *  
1041 - */  
1042 -angular.module('ScheduleApp').directive('saCheckboxgroup', [  
1043 - function() {  
1044 - return {  
1045 - restrict: 'E',  
1046 - templateUrl: '/pages/scheduleApp/module/common/dt/MyCheckboxGroupWrapTemplate.html',  
1047 - scope: {  
1048 - model: "=" // 独立作用域,关联外部的模型object  
1049 - },  
1050 - controllerAs: "$saCheckboxgroupCtrl",  
1051 - bindToController: true,  
1052 - controller: function($scope) {  
1053 - var self = this;  
1054 - self.$$data = []; // 内部的数据  
1055 -  
1056 - // TODO:数据写死,周一至周日选择数据,以后有别的数据再议  
1057 - self.$$data = [  
1058 - {name: "星期一", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1059 - {name: "星期二", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1060 - {name: "星期三", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1061 - {name: "星期四", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1062 - {name: "星期五", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1063 - {name: "星期六", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},  
1064 - {name: "星期日", checkedvalue: "1", uncheckedvalue: "0", ischecked: false}  
1065 - ];  
1066 - },  
1067 -  
1068 - /**  
1069 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
1070 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
1071 - * @param tElem  
1072 - * @param tAttrs  
1073 - * @returns {{pre: Function, post: Function}}  
1074 - */  
1075 - compile: function(tElem, tAttrs) {  
1076 - // 获取所有的属性  
1077 - var $name_attr = tAttrs["name"]; // 控件的名字  
1078 - var $required_attr = tAttrs["required"]; // 是否需要required验证  
1079 - var $disabled_attr = tAttrs["disabled"]; // 是否禁用  
1080 - var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名  
1081 -  
1082 - // controlAs名字  
1083 - var ctrlAs = '$saCheckboxgroupCtrl';  
1084 -  
1085 - // 如果有required属性,添加angularjs required验证  
1086 - if ($required_attr != undefined) {  
1087 - //console.log(tElem.html());  
1088 - tElem.find("div").attr("required", "");  
1089 - }  
1090 - // 如果有disabled属性,添加禁用标志  
1091 - if ($disabled_attr != undefined) {  
1092 - tElem.find("input").attr("ng-disabled", "true");  
1093 - }  
1094 -  
1095 - return {  
1096 - pre: function(scope, element, attr) {  
1097 - // TODO:  
1098 - },  
1099 - /**  
1100 - * 相当于link函数。  
1101 - * @param scope  
1102 - * @param element  
1103 - * @param attr  
1104 - */  
1105 - post: function(scope, element, attr) {  
1106 - // name属性  
1107 - if ($name_attr) {  
1108 - scope[ctrlAs]["$name_attr"] = $name_attr;  
1109 - }  
1110 -  
1111 - /**  
1112 - * checkbox选择事件处理函数。  
1113 - * @param $d 数据对象,$$data中的元素对象  
1114 - */  
1115 - scope[ctrlAs].$$internal_updateCheck_fn = function($d) {  
1116 - $d.ischecked = !$d.ischecked;  
1117 - console.log($d);  
1118 - };  
1119 -  
1120 - // 测试使用watch监控$$data的变化  
1121 - scope.$watch(  
1122 - function() {  
1123 - return scope[ctrlAs]["$$data"];  
1124 - },  
1125 - function(newValue, oldValue) {  
1126 - // 根据$$data生成对应的数据  
1127 - var rule_days_arr = [];  
1128 - var i;  
1129 - for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {  
1130 - if (scope[ctrlAs]["$$data"][i].ischecked)  
1131 - rule_days_arr.push(scope[ctrlAs]["$$data"][i].checkedvalue);  
1132 - else  
1133 - rule_days_arr.push(scope[ctrlAs]["$$data"][i].uncheckedvalue);  
1134 - }  
1135 - scope[ctrlAs].$$internalmodel = rule_days_arr.join(",");  
1136 - //scope[ctrlAs].$$internalmodel = undefined;  
1137 - console.log("bbbbbbbb--->" + scope[ctrlAs].$$internalmodel);  
1138 -  
1139 - // 更新model  
1140 - if ($dcname_attr) {  
1141 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = rule_days_arr.join(',');");  
1142 - }  
1143 -  
1144 -  
1145 - },  
1146 - true  
1147 - );  
1148 -  
1149 - // TODO:  
1150 -  
1151 - // 监控dcvalue model值变换  
1152 - attr.$observe("dcvalue", function(value) {  
1153 - console.log("saCheckboxgroup 监控dc1 model值变换:" + value);  
1154 - if (value) {  
1155 - // 根据value值,修改$$data里的值  
1156 - var data_array = value.split(",");  
1157 - var i;  
1158 - if (data_array.length > scope[ctrlAs]["$$data"].length) {  
1159 - for (i = 0; i < scope[ctrlAs]["$$data"].length; i ++) {  
1160 - if (data_array[i] == scope[ctrlAs]["$$data"][i].checkedvalue) {  
1161 - scope[ctrlAs]["$$data"][i].ischecked = true;  
1162 - } else {  
1163 - scope[ctrlAs]["$$data"][i].ischecked = false;  
1164 - }  
1165 - }  
1166 - } else {  
1167 - for (i = 0; i < data_array.length; i ++) {  
1168 - if (data_array[i] == scope[ctrlAs]["$$data"][i].checkedvalue) {  
1169 - scope[ctrlAs]["$$data"][i].ischecked = true;  
1170 - } else {  
1171 - scope[ctrlAs]["$$data"][i].ischecked = false;  
1172 - }  
1173 - }  
1174 - }  
1175 -  
1176 - }  
1177 - });  
1178 - }  
1179 -  
1180 - };  
1181 -  
1182 -  
1183 - }  
1184 -  
1185 - };  
1186 - }  
1187 -]);  
1188 -  
1189 -/**  
1190 - * saDategroup指令  
1191 - * 属性如下:  
1192 - * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave  
1193 - * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}  
1194 - * dcname(必须):绑定的model字段名,如:dcname=xl.id  
1195 - * name(必须):控件的名字  
1196 - * required(可选):是否要用required验证  
1197 - * disabled(可选):标示框是否可选  
1198 - *  
1199 - */  
1200 -angular.module('ScheduleApp').directive('saDategroup', [  
1201 - '$filter',  
1202 - function($filter) {  
1203 - return {  
1204 - restrict: 'E',  
1205 - templateUrl: '/pages/scheduleApp/module/common/dt/MyDateGroupWrapTemplate.html',  
1206 - scope: {  
1207 - model: "=" // 独立作用域,关联外部的模型object  
1208 - },  
1209 - controllerAs: "$saDategroupCtrl",  
1210 - bindToController: true,  
1211 - controller: function($scope) {  
1212 - var self = this;  
1213 - self.$$data = []; // 内部的数据  
1214 - self.$$date_select; // 内部选中的日期  
1215 -  
1216 - //// 测试数据  
1217 - //self.$$data = [  
1218 - // {datestr: '2011-01-01', ischecked: true},  
1219 - // {datestr: '2011-01-01', ischecked: true},  
1220 - // {datestr: '2011-01-01', ischecked: true}  
1221 - //];  
1222 - },  
1223 -  
1224 - /**  
1225 - * 此阶段可以改dom结构,此时angular还没扫描指令,  
1226 - * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。  
1227 - * @param tElem  
1228 - * @param tAttrs  
1229 - * @returns {{pre: Function, post: Function}}  
1230 - */  
1231 - compile: function(tElem, tAttrs) {  
1232 - // 获取所有的属性  
1233 - var $name_attr = tAttrs["name"]; // 控件的名字  
1234 - var $required_attr = tAttrs["required"]; // 是否需要required验证  
1235 - var $disabled_attr = tAttrs["disabled"]; // 是否禁用  
1236 - var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名  
1237 -  
1238 - // controlAs名字  
1239 - var ctrlAs = '$saDategroupCtrl';  
1240 -  
1241 - // 如果有required属性,添加angularjs required验证  
1242 - if ($required_attr != undefined) {  
1243 - //console.log(tElem.html());  
1244 - tElem.find("div").attr("required", "");  
1245 - }  
1246 - // 如果有disabled属性,添加禁用标志  
1247 - if ($disabled_attr != undefined) {  
1248 - tElem.find("input").attr("ng-disabled", "true");  
1249 - tElem.find("div").attr("ng-disabled", "true");  
1250 - }  
1251 -  
1252 - return {  
1253 - pre: function (scope, element, attr) {  
1254 - // TODO:  
1255 - },  
1256 - /**  
1257 - * 相当于link函数。  
1258 - * @param scope  
1259 - * @param element  
1260 - * @param attr  
1261 - */  
1262 - post: function (scope, element, attr) {  
1263 - // name属性  
1264 - if ($name_attr) {  
1265 - scope[ctrlAs]["$name_attr"] = $name_attr;  
1266 - }  
1267 -  
1268 -  
1269 - // 日期open属性,及方法  
1270 - scope[ctrlAs].$$specialDateOpen = false;  
1271 - scope[ctrlAs].$$specialDate_open = function() {  
1272 - scope[ctrlAs].$$specialDateOpen = true;  
1273 - };  
1274 -  
1275 - // 监控选择的日期  
1276 - scope.$watch(  
1277 - function() {  
1278 - return scope[ctrlAs]['$$date_select'];  
1279 - },  
1280 - function(newValue, oldValue) {  
1281 - if (newValue) {  
1282 - //console.log("saDategroup--->selectdate:" + newValue);  
1283 - // 调用内置filter,转换日期到yyyy-MM-dd格式  
1284 - var text = $filter('date')(newValue, 'yyyy-MM-dd');  
1285 - var i;  
1286 - var isexist = false; // 日期是否已经选择标识  
1287 - for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {  
1288 - if (scope[ctrlAs]["$$data"][i].datestr == text) {  
1289 - isexist = true;  
1290 - break;  
1291 - }  
1292 - }  
1293 - if (!isexist) {  
1294 - scope[ctrlAs]["$$data"].push(  
1295 - {  
1296 - datestr: text,  
1297 - ischecked: true  
1298 - }  
1299 - );  
1300 - }  
1301 -  
1302 - }  
1303 -  
1304 - }  
1305 - );  
1306 -  
1307 - /**  
1308 - * 日期点击事件处理函数。  
1309 - * @param $index 索引  
1310 - */  
1311 - scope[ctrlAs].$$internal_datestr_click = function($index) {  
1312 - scope[ctrlAs].$$data.splice($index, 1);  
1313 - };  
1314 -  
1315 - // 测试使用watch监控$$data的变化  
1316 - scope.$watch(  
1317 - function() {  
1318 - return scope[ctrlAs]['$$data'];  
1319 - },  
1320 - function(newValue, oldValue) {  
1321 - // 根据$$data生成对应的数据  
1322 - var special_days_arr = [];  
1323 - var i;  
1324 - for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {  
1325 - special_days_arr.push(scope[ctrlAs]["$$data"][i].datestr);  
1326 - }  
1327 -  
1328 - scope[ctrlAs].$$internalmodel = special_days_arr.join(",");  
1329 - console.log("bbbbbbbb--->" + scope[ctrlAs].$$internalmodel);  
1330 -  
1331 - // 更新model  
1332 - if ($dcname_attr) {  
1333 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = special_days_arr.join(',');");  
1334 - }  
1335 - },  
1336 - true  
1337 - );  
1338 -  
1339 - // 监控dcvalue model值变换  
1340 - attr.$observe("dcvalue", function(value) {  
1341 - console.log("saDategroup 监控dc1 model值变换:" + value);  
1342 - if (value) {  
1343 - // 根据value值,修改$$data里的值  
1344 - var date_array = value.split(",");  
1345 - var i;  
1346 - scope[ctrlAs]["$$data"] = [];  
1347 - for (i = 0; i < date_array.length; i++) {  
1348 - scope[ctrlAs]["$$data"].push(  
1349 - {  
1350 - datestr: date_array[i],  
1351 - ischecked: true  
1352 - }  
1353 - );  
1354 - }  
1355 -  
1356 -  
1357 -  
1358 -  
1359 -  
1360 -  
1361 -  
1362 -  
1363 -  
1364 - }  
1365 - });  
1366 -  
1367 - }  
1368 -  
1369 - };  
1370 - }  
1371 - }  
1372 - }  
1373 -]);  
1374 -  
1375 -  
1376 -  
1377 -  
1378 -  
1379 -  
1380 -  
1381 -  
1382 -  
1383 -  
1384 -  
1385 -  
1386 -  
1387 -  
1388 -  
1389 -  
1390 -  
1391 -  
1392 -  
1393 -  
1394 -  
1395 -  
1396 -  
1397 -  
1398 - 1 +// 自定义指令,指令模版在dt目录下
  2 +
  3 +
  4 +angular.module('ScheduleApp').directive('loadingWidget', ['requestNotificationChannel', function(requestNotificationChannel) {
  5 + return {
  6 + restrict: 'A',
  7 + link: function(scope, element) {
  8 + // 初始隐藏loading界面
  9 + element.hide();
  10 +
  11 + // 开始请求通知处理
  12 + requestNotificationChannel.onRequestStarted(scope, function() {
  13 + element.show();
  14 + });
  15 + // 请求结束通知处理
  16 + requestNotificationChannel.onRequestEnded(scope, function() {
  17 + element.hide();
  18 + });
  19 + }
  20 + };
  21 +}]);
  22 +
  23 +angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) {
  24 + return {
  25 + restrict: 'E',
  26 + templateUrl: '/pages/scheduleApp/module/other/MyDictionarySelectTemplate.html',
  27 + scope: {
  28 + model: "="
  29 + },
  30 + controllerAs: "$saSelectCtrl",
  31 + bindToController: true,
  32 + controller: function() {
  33 + var self = this;
  34 + self.datas = []; // 关联的字典数据,内部格式 {code:{值},name:{名字}}
  35 + },
  36 + /**
  37 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  38 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  39 + * @param tElem
  40 + * @param tAttrs
  41 + * @returns {{pre: Function, post: Function}}
  42 + */
  43 + compile: function(tElem, tAttrs) {
  44 + // 确定是否使用angularjs required验证
  45 + // 属性 required
  46 + // 如果没有填写,内部不添加验证,如果填写了,并且等于true添加验证,否则不添加
  47 + var required_attr = tAttrs["required"];
  48 + if (required_attr) {
  49 + if (required_attr == "true") {
  50 + // 添加required属性指令
  51 + tElem.find("ui-select").attr("required", "");
  52 + } else {
  53 + // 不等于true,不添加required属性指令
  54 + }
  55 + } else {
  56 + // 不添加required属性指令
  57 + }
  58 +
  59 + //console.log("saSelect" + ":compile = >" + tElem.html());
  60 +
  61 + return {
  62 + pre: function(scope, element, attr) {
  63 + // TODO:
  64 + },
  65 + /**
  66 + * 相当于link函数。
  67 + *
  68 + * 重要属性如下:
  69 + * model 是绑定外部值。
  70 + * dicgroup 字典组的类型
  71 + * name input name属性值
  72 + */
  73 + post: function(scope, element, attr) {
  74 + // 1、获取属性
  75 + var dicgroup_attr = attr['dicgroup']; // 字典组的类型
  76 + var name_attr = attr['name']; // input name属性值
  77 + var dicname_attr = attr['dicname']; // model关联的字典名字段
  78 + var codename_attr = attr['codename']; // model关联的字典值字段
  79 + var placeholder_attr = attr['placeholder']; // select placeholder提示
  80 +
  81 + // 系统的字典对象,使用dictionaryUtils类获取
  82 + var origin_dicgroup;
  83 + var dic_key; // 字典key
  84 +
  85 + if (dicgroup_attr) { // 赋值指定的字典数据
  86 + origin_dicgroup = dictionaryUtils.getByGroup(dicgroup_attr);
  87 + for (dic_key in origin_dicgroup) {
  88 + var data = {}; // 重新组合的字典元素对象
  89 + if (dic_key == "true")
  90 + data.code = true;
  91 + else
  92 + data.code = dic_key;
  93 + data.name = origin_dicgroup[dic_key];
  94 + scope["$saSelectCtrl"].datas.push(data);
  95 + }
  96 + }
  97 +
  98 + if (name_attr) {
  99 + scope["$saSelectCtrl"].nv = name_attr;
  100 + }
  101 + if (placeholder_attr) {
  102 + scope["$saSelectCtrl"].ph = placeholder_attr;
  103 + }
  104 +
  105 + scope["$saSelectCtrl"].select = function($item) {
  106 + if (codename_attr) {
  107 + scope["$saSelectCtrl"].model[codename_attr] = $item.code;
  108 + }
  109 + if (dicname_attr) {
  110 + scope["$saSelectCtrl"].model[dicname_attr] = $item.name;
  111 + }
  112 + };
  113 +
  114 + scope["$saSelectCtrl"].remove = function() {
  115 + if (codename_attr) {
  116 + scope["$saSelectCtrl"].model[codename_attr] = null;
  117 + }
  118 + if (dicname_attr) {
  119 + scope["$saSelectCtrl"].model[dicname_attr] = null;
  120 + }
  121 + scope["$saSelectCtrl"].cmodel = null;
  122 + };
  123 +
  124 + $timeout(function() {
  125 + // 创建内部使用的绑定对象
  126 + var model_code = scope["$saSelectCtrl"].model[codename_attr];
  127 + scope["$saSelectCtrl"].cmodel = model_code;
  128 + }, 0);
  129 + }
  130 + }
  131 + }
  132 + };
  133 +}]);
  134 +
  135 +/**
  136 + * saRadiogroup指令
  137 + * 属性如下:
  138 + * model(必须):独立作用域,外部绑定的一个值,如:ctrl.timeTableManageForForm.isEnableDisTemplate
  139 + * dicgroup(必须):关联的字典数据type(TODO:以后增加其他数据源)
  140 + * name(必须):控件的名字
  141 + * required(可选):是否要用required验证
  142 + * disabled(可选):标示单选框是否可选
  143 + *
  144 + */
  145 +angular.module('ScheduleApp').directive("saRadiogroup", [function() {
  146 + /**
  147 + * 使用字典数据的单选按钮组的指令。
  148 + * 指令名称:truefalse-Dic
  149 + */
  150 + return {
  151 + restrict: 'E',
  152 + templateUrl: '/pages/scheduleApp/module/common/dt/MyRadioGroupWrapTemplate.html',
  153 + scope: {
  154 + model: "="
  155 + },
  156 + controllerAs: "$saRadiogroupCtrl",
  157 + bindToController: true,
  158 + controller: function($scope) {
  159 + //$scope["model"] = {selectedOption: null};
  160 + //console.log("controller");
  161 + //console.log("controller:" + $scope["model"]);
  162 +
  163 + var self = this;
  164 + self.$$data = null; // 内部数据
  165 + },
  166 +
  167 + /**
  168 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  169 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  170 + * @param tElem
  171 + * @param tAttrs
  172 + * @returns {{pre: Function, post: Function}}
  173 + */
  174 + compile: function(tElem, tAttrs) {
  175 + // 获取属性
  176 + var $dicgroup_attr = tAttrs["dicgroup"]; // 关联的字典数据type
  177 + var $name_attr = tAttrs["name"]; // 控件的名字
  178 + var $required_attr = tAttrs["required"]; // 是否要用required验证
  179 + var $disabled_attr = tAttrs["disabled"]; // 标示单选框是否可选
  180 +
  181 + // controlAs名字
  182 + var ctrlAs = "$saRadiogroupCtrl";
  183 +
  184 + // 如果有required属性,添加angularjs required验证
  185 + if ($required_attr != undefined) {
  186 + tElem.find("input").attr("required", "");
  187 + }
  188 +
  189 + return {
  190 + pre: function(scope, element, attr) {
  191 +
  192 + },
  193 +
  194 + /**
  195 + * 相当于link函数。
  196 + * @param scope
  197 + * @param element
  198 + * @param attr
  199 + */
  200 + post: function(scope, element, attr) {
  201 + //console.log("link");
  202 + //console.log("link:" + scope.model);
  203 + //scope["model"] = {selectedOption: null};
  204 +
  205 + if ($name_attr) {
  206 + scope[ctrlAs].nv = $name_attr;
  207 + }
  208 +
  209 + if ($disabled_attr) {
  210 + scope[ctrlAs].disabled = true;
  211 + }
  212 + if ($dicgroup_attr) {
  213 + var obj = dictionaryUtils.getByGroup($dicgroup_attr);
  214 + scope[ctrlAs].$$data = obj;
  215 + // 处理 scope["dic"] key值
  216 + scope[ctrlAs].dicvalueCalcu = function(value) {
  217 + if (value == "true") {
  218 + //console.log(value);
  219 + return true;
  220 + } else if (value == "false") {
  221 + //console.log(value);
  222 + return false;
  223 + } else {
  224 + return value;
  225 + }
  226 + };
  227 + }
  228 + }
  229 + };
  230 + }
  231 + };
  232 +}]);
  233 +
  234 +angular.module('ScheduleApp').directive("remoteValidaton", [
  235 + 'BusInfoManageService_g',
  236 + 'EmployeeInfoManageService_g',
  237 + 'TimeTableManageService_g',
  238 + function(
  239 + busInfoManageService_g,
  240 + employeeInfoManageService_g,
  241 + timeTableManageService_g
  242 + ) {
  243 + /**
  244 + * 远端验证指令,依赖于ngModel
  245 + * 指令名称 remote-Validation
  246 + * 需要属性 rvtype 表示验证类型
  247 + */
  248 + return {
  249 + restrict: "A",
  250 + require: "^ngModel",
  251 + link: function(scope, element, attr, ngModelCtrl) {
  252 + element.bind("keyup", function() {
  253 + var modelValue = ngModelCtrl.$modelValue;
  254 + var rv1_attr = attr["rv1"];
  255 + if (attr["rvtype"]) {
  256 +
  257 + // 根据rvtype的值,确定使用那个远端验证的url,
  258 + // rv1, rv2, rv3是关联比较值,暂时使用rv1
  259 + // 这个貌似没法通用,根据业务变换
  260 + // TODO:暂时有点乱以后改
  261 + if (attr["rvtype"] == "insideCode") {
  262 + busInfoManageService_g.validate.insideCode(
  263 + {"insideCode_eq": modelValue, type: "equale"},
  264 + function(result) {
  265 + //console.log(result);
  266 + if (result.status == "SUCCESS") {
  267 + ngModelCtrl.$setValidity('remote', true);
  268 + } else {
  269 + ngModelCtrl.$setValidity('remote', false);
  270 + }
  271 + },
  272 + function(result) {
  273 + //console.log(result);
  274 + ngModelCtrl.$setValidity('remote', true);
  275 + }
  276 + );
  277 + } else if (attr["rvtype"] == "jobCode") {
  278 + if (!rv1_attr) {
  279 + ngModelCtrl.$setValidity('remote', false);
  280 + return;
  281 + }
  282 +
  283 + employeeInfoManageService_g.validate.jobCode(
  284 + {"jobCode_eq": modelValue, "companyCode_eq": rv1_attr, type: "equale"},
  285 + function(result) {
  286 + //console.log(result);
  287 + if (result.status == "SUCCESS") {
  288 + ngModelCtrl.$setValidity('remote', true);
  289 + } else {
  290 + ngModelCtrl.$setValidity('remote', false);
  291 + }
  292 + },
  293 + function(result) {
  294 + //console.log(result);
  295 + ngModelCtrl.$setValidity('remote', true);
  296 + }
  297 + );
  298 + } else if (attr["rvtype"] == "ttinfoname") {
  299 + if (!rv1_attr) {
  300 + ngModelCtrl.$setValidity('remote', false);
  301 + return;
  302 + }
  303 +
  304 + timeTableManageService_g.validate.ttinfoname(
  305 + {"name_eq": modelValue, "xl.id_eq": rv1_attr, type: "equale"},
  306 + function(result) {
  307 + //console.log(result);
  308 + if (result.status == "SUCCESS") {
  309 + ngModelCtrl.$setValidity('remote', true);
  310 + } else {
  311 + ngModelCtrl.$setValidity('remote', false);
  312 + }
  313 + },
  314 + function(result) {
  315 + //console.log(result);
  316 + ngModelCtrl.$setValidity('remote', true);
  317 + }
  318 + );
  319 +
  320 + }
  321 + } else {
  322 + // 没有rvtype,就不用远端验证了
  323 + ngModelCtrl.$setValidity('remote', true);
  324 + }
  325 +
  326 + attr.$observe("rv1", function(value) {
  327 + if (attr["rvtype"] == "jobCode") {
  328 + if (!value) {
  329 + ngModelCtrl.$setValidity('remote', false);
  330 + return;
  331 + }
  332 +
  333 + employeeInfoManageService_g.validate.jobCode(
  334 + {"jobCode_eq": modelValue, "companyCode_eq": rv1_attr, type: "equale"},
  335 + function(result) {
  336 + //console.log(result);
  337 + if (result.status == "SUCCESS") {
  338 + ngModelCtrl.$setValidity('remote', true);
  339 + } else {
  340 + ngModelCtrl.$setValidity('remote', false);
  341 + }
  342 + },
  343 + function(result) {
  344 + //console.log(result);
  345 + ngModelCtrl.$setValidity('remote', true);
  346 + }
  347 + );
  348 + } else if (attr["rvtype"] == "ttinfoname") {
  349 + if (!value) {
  350 + ngModelCtrl.$setValidity('remote', false);
  351 + return;
  352 + }
  353 +
  354 + console.log("rv1:" + value);
  355 +
  356 + timeTableManageService_g.validate.ttinfoname(
  357 + {"name_eq": modelValue, "xl.id_eq": value, type: "equale"},
  358 + function(result) {
  359 + //console.log(result);
  360 + if (result.status == "SUCCESS") {
  361 + ngModelCtrl.$setValidity('remote', true);
  362 + } else {
  363 + ngModelCtrl.$setValidity('remote', false);
  364 + }
  365 + },
  366 + function(result) {
  367 + //console.log(result);
  368 + ngModelCtrl.$setValidity('remote', true);
  369 + }
  370 + );
  371 + }
  372 +
  373 + });
  374 + });
  375 + }
  376 + };
  377 + }]);
  378 +
  379 +
  380 +/**
  381 + * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。
  382 + * 1、compile阶段使用的属性如下:
  383 + * required:用于和表单验证连接,指定成required="true"才有效。
  384 + * 2、link阶段使用的属性如下
  385 + * model:关联的模型对象
  386 + * name:表单验证时需要的名字
  387 + * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加
  388 + * modelcolname1:关联的模型字段名字1(一般应该是编码字段)
  389 + * modelcolname2:关联的模型字段名字2(一般应该是名字字段)
  390 + * datacolname1;内部数据对应的字段名字1(与模型字段1对应)
  391 + * datacolname2:内部数据对应的字段名字2(与模型字段2对应)
  392 + * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用
  393 + * placeholder:select placeholder字符串描述
  394 + *
  395 + * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。
  396 + * $$SearchInfoService_g,内部使用的数据服务
  397 + */
  398 +// saSelect2指令使用的内部信service
  399 +angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {
  400 + return {
  401 + xl: $resource(
  402 + '/line/:type',
  403 + {order: 'name', direction: 'ASC'},
  404 + {
  405 + list: {
  406 + method: 'GET',
  407 + isArray: true
  408 + }
  409 + }
  410 + ),
  411 + zd: $resource(
  412 + '/stationroute/stations',
  413 + {order: 'stationCode', direction: 'ASC'},
  414 + {
  415 + list: {
  416 + method: 'GET',
  417 + isArray: true
  418 + }
  419 + }
  420 + ),
  421 + tcc: $resource(
  422 + '/carpark/:type',
  423 + {order: 'parkCode', direction: 'ASC'},
  424 + {
  425 + list: {
  426 + method: 'GET',
  427 + isArray: true
  428 + }
  429 + }
  430 + ),
  431 + ry: $resource(
  432 + '/personnel/:type',
  433 + {order: 'personnelName', direction: 'ASC'},
  434 + {
  435 + list: {
  436 + method: 'GET',
  437 + isArray: true
  438 + }
  439 + }
  440 + ),
  441 + cl: $resource(
  442 + '/cars/:type',
  443 + {order: "insideCode", direction: 'ASC'},
  444 + {
  445 + list: {
  446 + method: 'GET',
  447 + isArray: true
  448 + }
  449 + }
  450 + ),
  451 + ttInfo: $resource(
  452 + '/tic/:type',
  453 + {order: "name", direction: 'ASC'},
  454 + {
  455 + list: {
  456 + method: 'GET',
  457 + isArray: true
  458 + }
  459 + }
  460 + ),
  461 + cci: $resource(
  462 + '/cci/cars',
  463 + {},
  464 + {
  465 + list: {
  466 + method: 'GET',
  467 + isArray: true
  468 + }
  469 + }
  470 +
  471 + ),
  472 + cci2: $resource(
  473 + '/cci/:type',
  474 + {},
  475 + {
  476 + list: {
  477 + method: 'GET',
  478 + isArray: true
  479 + }
  480 + }
  481 + )
  482 + }
  483 +}]);
  484 +angular.module('ScheduleApp').filter("$$pyFilter", function() {
  485 + return function(items, props) {
  486 + var out = [];
  487 + var limit = props["limit"] || 20; // 默认20条记录
  488 +
  489 + if (angular.isArray(items)) {
  490 + items.forEach(function(item) {
  491 + if (out.length < limit) {
  492 + if (props.search) {
  493 + var upTerm = props.search.toUpperCase();
  494 + if(item.fullChars.indexOf(upTerm) != -1
  495 + || item.camelChars.indexOf(upTerm) != -1) {
  496 + out.push(item);
  497 + }
  498 + }
  499 + }
  500 + });
  501 + }
  502 +
  503 + return out;
  504 + };
  505 +});
  506 +angular.module('ScheduleApp').directive("saSelect2", [
  507 + '$timeout', '$$SearchInfoService_g',
  508 + function($timeout, $$searchInfoService_g) {
  509 + return {
  510 + restrict: 'E',
  511 + templateUrl: '/pages/scheduleApp/module/other/MySearchSelectTemplate.html',
  512 + scope: {
  513 + model: "=" // 独立作用域,关联外部的模型对象
  514 + },
  515 + controllerAs: "$saSelectCtrl",
  516 + bindToController: true,
  517 + controller: function($scope) {
  518 + var self = this;
  519 + self.$$data = []; // 内部关联的数据
  520 + },
  521 + /**
  522 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  523 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  524 + * @param tElem
  525 + * @param tAttrs
  526 + * @returns {{pre: Function, post: Function}}
  527 + */
  528 + compile: function(tElem, tAttrs) {
  529 + // 1、获取此阶段使用的属性
  530 + var $required_attr = tAttrs["required"]; // 用于和表单验证连接,指定成required="true"才有效。
  531 +
  532 + // 2、处理属性
  533 +
  534 + // 确定是否使用angularjs required验证
  535 + // 属性 required
  536 + // 如果没有填写,内部不添加验证,如果填写了,并且等于true添加验证,否则不添加
  537 + if ($required_attr) {
  538 + if ($required_attr == "true") {
  539 + // 添加required属性指令
  540 + tElem.find("ui-select").attr("required", "");
  541 + } else {
  542 + // 不等于true,不添加required属性指令
  543 + }
  544 + } else {
  545 + // 不添加required属性指令
  546 + }
  547 +
  548 + //console.log("saSelect" + ":compile = >" + tElem.html());
  549 +
  550 + return {
  551 + pre: function(scope, element, attr) {
  552 + // TODO:
  553 + },
  554 + /**
  555 + * 相当于link函数。
  556 + *
  557 + * 重要属性如下:
  558 + * model 是绑定外部值。
  559 + * dicgroup 字典组的类型
  560 + * name input name属性值
  561 + */
  562 + post: function(scope, element, attr) {
  563 + // 1、获取此阶段使用的属性
  564 + var $name_attr = attr["name"]; // 表单验证时需要的名字
  565 + var $type_attr = attr["type"]; // 关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加
  566 + var $modelcolname1_attr = attr["modelcolname1"]; // 关联的模型字段名字1(一般应该是编码字段)
  567 + var $modelcolname2_attr = attr["modelcolname2"]; // 关联的模型字段名字2(一般应该是名字字段)
  568 + var $datacolname1_attr = attr["datacolname1"]; // 内部数据对应的字段名字1(与模型字段1对应)
  569 + var $datacolname2_attr = attr["datacolname2"]; // 内部数据对应的字段名字2(与模型字段2对应)
  570 + var $showcolname_attr = attr["showcolname"]; // 下拉框显示的内部数据字段名
  571 + var $placeholder_attr = attr["placeholder"]; // select placeholder字符串描述
  572 +
  573 + // 2、处理属性、转换成$saSelectCtrl内部使用的属性
  574 + if ($name_attr) {
  575 + scope["$saSelectCtrl"].$name_attr = $name_attr;
  576 + }
  577 + if ($placeholder_attr) {
  578 + scope["$saSelectCtrl"].$placeholder_attr = $placeholder_attr;
  579 + }
  580 + if ($showcolname_attr) {
  581 + scope["$saSelectCtrl"].$showcolname_attr = $showcolname_attr;
  582 + }
  583 +
  584 + // 2-1、添加内部方法,根据type值,改变$$data的值
  585 + scope["$saSelectCtrl"].$$internal_data_change_fn = function() {
  586 + // 根据type属性动态载入数据
  587 + if ($type_attr) {
  588 + $$searchInfoService_g[$type_attr].list(
  589 + {type: "all"},
  590 + function(result) {
  591 + scope["$saSelectCtrl"].$$data = [];
  592 + for (var i = 0; i < result.length; i ++) {
  593 + var data = {}; // data是result的一部分属性集合,根据配置来确定
  594 + if ($datacolname1_attr) {
  595 + data[$datacolname1_attr] = result[i][$datacolname1_attr];
  596 + }
  597 + if ($datacolname2_attr) {
  598 + data[$datacolname2_attr] = result[i][$datacolname2_attr];
  599 + }
  600 + if ($showcolname_attr) {
  601 + // 动态添加基于名字的拼音
  602 + data[$showcolname_attr] = result[i][$showcolname_attr];
  603 + if (data[$showcolname_attr]) {
  604 + data["fullChars"] = pinyin.getFullChars(result[i][$showcolname_attr]).toUpperCase(); // 全拼
  605 + data["camelChars"] = pinyin.getCamelChars(result[i][$showcolname_attr]); // 简拼
  606 + }
  607 + }
  608 + if (data["fullChars"])
  609 + scope["$saSelectCtrl"].$$data.push(data);
  610 + }
  611 + },
  612 + function(result) {
  613 +
  614 + }
  615 + );
  616 + }
  617 + };
  618 +
  619 + // 3、选择、删除事件映射模型和内部数据对应的字段
  620 + scope["$saSelectCtrl"].$select_fn_attr = function($item) {
  621 + if ($modelcolname1_attr && $datacolname1_attr) {
  622 + scope["$saSelectCtrl"].model[$modelcolname1_attr] = $item[$datacolname1_attr];
  623 + }
  624 + if ($modelcolname2_attr && $datacolname2_attr) {
  625 + scope["$saSelectCtrl"].model[$modelcolname2_attr] = $item[$datacolname2_attr];
  626 + }
  627 + };
  628 + scope["$saSelectCtrl"].$remove_fn_attr = function() {
  629 + if ($modelcolname1_attr) {
  630 + scope["$saSelectCtrl"].model[$modelcolname1_attr] = null;
  631 + }
  632 + if ($modelcolname2_attr) {
  633 + scope["$saSelectCtrl"].model[$modelcolname2_attr] = null;
  634 + }
  635 + scope["$saSelectCtrl"].$$cmodel = null; // 内部模型清空
  636 +
  637 + scope["$saSelectCtrl"].$$internal_data_change_fn();
  638 + };
  639 +
  640 + // 4、搜索事件
  641 + scope["$saSelectCtrl"].$refreshdata_fn_attr = function($search) {
  642 + //var fullChars = pinyin.getFullChars($search).toUpperCase();
  643 + //var camelChars = pinyin.getCamelChars($search);
  644 + //
  645 + //console.log(fullChars + " " + camelChars);
  646 + // TODO:事件暂时没用,放着以后再说
  647 + };
  648 +
  649 + // 5、全部载入后,输入的
  650 + $timeout(function() {
  651 + // 创建内部使用的绑定对象,用于确认选中那个值
  652 + scope["$saSelectCtrl"].$$cmodel = scope["$saSelectCtrl"].model[$modelcolname1_attr];
  653 +
  654 + scope["$saSelectCtrl"].$$internal_data_change_fn();
  655 + }, 0);
  656 + }
  657 + }
  658 + }
  659 + };
  660 + }
  661 +]);
  662 +
  663 +/**
  664 + * saSelect3指令
  665 + * 属性如下:
  666 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  667 + * name(必须):控件的名字
  668 + * placeholder(可选):占位符字符串
  669 + * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}
  670 + * dcname(必须):绑定的model字段名,如:dcname=xl.id
  671 + * icname(必须):内部与之对应的字段名,如:icname=code
  672 + * dcname2(可选):其他需要赋值的model字段名2,如:dcname2=xl.name
  673 + * icname2(可选):内部与之对应的字段名2,如:icname2=name
  674 + * icnames(必须):用于用于显示,以及简评处理的内部数据字段,如:icnames=name
  675 + * required(可选):是否要用required验证
  676 + * datatype(必须):业务数据类型,有字典类型,动态数据类型,暂时写的死点
  677 + * mlp(可选):是否多级属性(这里假设外部model如果多级,内部model也是多级)
  678 + *
  679 + * 高级属性:
  680 + * dataassociate(可选):数据源是否关联属性(内部数据随外部指定的参数变化而变化)
  681 + * dataparam(可选):数据源关联的外部参数对象
  682 + *
  683 + */
  684 +angular.module('ScheduleApp').directive("saSelect3", [
  685 + '$timeout',
  686 + '$$SearchInfoService_g',
  687 + function($timeout, $$searchInfoService_g) {
  688 + return {
  689 + restrict: 'E',
  690 + templateUrl: '/pages/scheduleApp/module/common/dt/MyUiSelectWrapTemplate1.html',
  691 + scope: {
  692 + model: "=" // 独立作用域,关联外部的模型object
  693 + },
  694 + controllerAs: "$saSelectCtrl",
  695 + bindToController: true,
  696 + controller: function($scope) {
  697 + var self = this;
  698 + self.$$data = []; // ui-select显示用的数据源
  699 + self.$$data_real= []; // 内部真实的数据源
  700 + },
  701 +
  702 + /**
  703 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  704 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  705 + * @param tElem
  706 + * @param tAttrs
  707 + * @returns {{pre: Function, post: Function}}
  708 + */
  709 + compile: function(tElem, tAttrs) {
  710 + // 获取所有的属性
  711 + var $name_attr = tAttrs["name"]; // 控件的名字
  712 + var $placeholder_attr = tAttrs["placeholder"]; // 占位符的名字
  713 + var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名
  714 + var $icname_attr = tAttrs["icname"]; // 内部与之对应的字段名
  715 + var $dcname2_attr = tAttrs["dcname2"]; // 其他需要赋值的model字段名2
  716 + var $icname2_attr = tAttrs["icname2"]; // 内部与之对应的字段名2
  717 + var $icname_s_attr = tAttrs["icnames"]; // 用于用于显示,以及简评处理的内部数据字段
  718 + var $datatype_attr = tAttrs["datatype"]; // 内部业务数据类型
  719 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  720 + var $mlp_attr = tAttrs["mlp"]; // 是否多级属性
  721 + var $dataassociate_attr = tAttrs["dataassociate"]; // 数据源是否关联属性
  722 +
  723 + // controlAs名字
  724 + var ctrlAs = "$saSelectCtrl";
  725 +
  726 + // 数据源初始化标志
  727 + var $$data_init = false;
  728 + // 如果有required属性,添加angularjs required验证
  729 + if ($required_attr != undefined) {
  730 + tElem.find("ui-select").attr("required", "");
  731 + }
  732 +
  733 + // 由于有的属性是多级的如xl.name,所以要在compile阶段重写属性绑定属性定义
  734 + // 原来的设置:{{$select.selected[$saSelectCtrl.$icname_s]}}
  735 + tElem.find("ui-select-match").html("{{$select.selected" + "." + $icname_s_attr + "}}");
  736 + // 原来的设置:item[$saSelectCtrl.$icname] as item in $saSelectCtrl.$$data
  737 + tElem.find("ui-select-choices").attr("repeat", "item" + "." + $icname_attr + " as item in $saSelectCtrl.$$data");
  738 + // 原来的设置:item[$saSelectCtrl.$icname_s]
  739 + tElem.find("ui-select-choices span").attr("ng-bind", "item" + "." + $icname_s_attr);
  740 + // 原来的设置:{{$saSelectCtrl.$name}}
  741 + tElem.find("ui-select").attr("name", $name_attr);
  742 + // 原来的设置:{{$saSelectCtrl.$placeholder}}
  743 + tElem.find("ui-select-match").attr("placeholder", $placeholder_attr);
  744 +
  745 + return {
  746 + pre: function(scope, element, attr) {
  747 + // TODO:
  748 + },
  749 + /**
  750 + * 相当于link函数。
  751 + * @param scope
  752 + * @param element
  753 + * @param attr
  754 + */
  755 + post: function(scope, element, attr) {
  756 + // 添加选中事件处理函数
  757 + scope[ctrlAs].$$internal_select_fn = function($item) {
  758 + if ($dcname_attr && $icname_attr) {
  759 + if ($mlp_attr) {
  760 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";");
  761 + } else {
  762 + scope[ctrlAs].model[$dcname_attr] = $item[$icname_attr];
  763 + }
  764 + }
  765 + if ($dcname2_attr && $icname2_attr) {
  766 + if ($mlp_attr) {
  767 + eval("scope[ctrlAs].model" + "." + $dcname2_attr + " = $item" + "." + $icname2_attr + ";");
  768 + } else {
  769 + scope[ctrlAs].model[$dcname2_attr] = $item[$icname2_attr];
  770 + }
  771 + }
  772 + };
  773 +
  774 + // 删除选中事件处理函数
  775 + scope[ctrlAs].$$internal_remove_fn = function() {
  776 + scope[ctrlAs].$$internalmodel = undefined;
  777 + if ($mlp_attr) {
  778 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;");
  779 + } else {
  780 + scope[ctrlAs].model[$dcname_attr] = undefined;
  781 + }
  782 +
  783 + if ($dcname2_attr) {
  784 + if ($mlp_attr) {
  785 + eval("scope[ctrlAs].model" + "." + $dcname2_attr + " = undefined;");
  786 + } else {
  787 + scope[ctrlAs].model[$dcname2_attr] = undefined;
  788 + }
  789 + }
  790 + };
  791 +
  792 + /**
  793 + * 内部方法,读取字典数据作为数据源。
  794 + * @param dicgroup 字典类型,如:gsType
  795 + * @param ccol 代码字段名
  796 + * @param ncol 名字字段名
  797 + */
  798 + scope[ctrlAs].$$internal_dic_data = function(dicgroup, ccol, ncol) {
  799 + var origin_dicgroup = dictionaryUtils.getByGroup(dicgroup);
  800 + var dic_key; // 字典key
  801 + // 清空内部数据
  802 + scope[ctrlAs].$$data_real = [];
  803 + for (dic_key in origin_dicgroup) {
  804 + var data = {}; // 重新组合的字典元素对象
  805 + if (dic_key == "true")
  806 + data[ccol] = true;
  807 + else
  808 + data[ccol] = dic_key;
  809 + data[ncol] = origin_dicgroup[dic_key];
  810 + scope[ctrlAs].$$data_real.push(data);
  811 + }
  812 + // 这里直接将$$data_real数据深拷贝到$$data
  813 + angular.copy(scope[ctrlAs].$$data_real, scope[ctrlAs].$$data);
  814 +
  815 + console.log(scope[ctrlAs].$$data);
  816 + };
  817 +
  818 + /**
  819 + * TODO:这个方法有性能问题,result一多就会卡一卡,之后再解决把
  820 + * 内部方法,读取字典数据作为数据源。
  821 + * @param result 原始数据
  822 + * @param dcvalue 传入的关联数据
  823 + */
  824 + scope[ctrlAs].$$internal_other_data = function(result, dcvalue) {
  825 + //console.log("start");
  826 + // 清空内部数据
  827 + scope[ctrlAs].$$data_real = [];
  828 + scope[ctrlAs].$$data = [];
  829 + for (var i = 0; i < result.length; i ++) {
  830 + if ($icname_s_attr) {
  831 + if ($mlp_attr) {
  832 + if (eval("result[i]" + "." + $icname_s_attr)) {
  833 + // 全拼
  834 + result[i]["fullChars"] = pinyin.getFullChars(eval("result[i]" + "." + $icname_s_attr)).toUpperCase();
  835 + // 简拼
  836 + result[i]["camelChars"] = pinyin.getCamelChars(eval("result[i]" + "." + $icname_s_attr));
  837 + }
  838 + } else {
  839 + if (result[i][$icname_s_attr]) {
  840 + // 全拼
  841 + result[i]["fullChars"] = pinyin.getFullChars(result[i][$icname_s_attr]).toUpperCase();
  842 + // 简拼
  843 + result[i]["camelChars"] = pinyin.getCamelChars(result[i][$icname_s_attr]);
  844 + }
  845 + }
  846 + }
  847 +
  848 + if (result[i]["fullChars"]) { // 有拼音的加入数据源
  849 + scope[ctrlAs].$$data_real.push(result[i]);
  850 + }
  851 +
  852 + }
  853 + //console.log("start2");
  854 +
  855 + // 数量太大取前10条记录作为显示
  856 + if (angular.isArray(scope[ctrlAs].$$data_real)) {
  857 + // 先迭代循环查找已经传过来的值
  858 + if (scope[ctrlAs].$$data_real.length > 0) {
  859 + if (dcvalue) {
  860 + for (var j = 0; j < scope[ctrlAs].$$data_real.length; j++) {
  861 + if (scope[ctrlAs].$$data_real[j][$icname_attr] == dcvalue) {
  862 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[j]));
  863 + break;
  864 + }
  865 + }
  866 + }
  867 + }
  868 + // 在插入剩余的数据
  869 + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {
  870 + if (scope[ctrlAs].$$data.length < 10) {
  871 + if ($mlp_attr) {
  872 + if (eval("scope[ctrlAs].$$data_real[k]" + "." + $icname_attr + " != dcvalue")) {
  873 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  874 + }
  875 + } else {
  876 + if (scope[ctrlAs].$$data_real[k][$icname_attr] != dcvalue) {
  877 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  878 + }
  879 + }
  880 + } else {
  881 + break;
  882 + }
  883 + }
  884 + }
  885 +
  886 + //console.log("end");
  887 + };
  888 +
  889 + /**
  890 + * 判定一个对象是否为空对象。
  891 + * @param Obj
  892 + */
  893 + scope[ctrlAs].$$internal_isEmpty_obj = function(obj) {
  894 + console.log(typeof obj);
  895 +
  896 + if (typeof obj === "object" && !(obj instanceof Array)) {
  897 + for (var prop in obj) {
  898 + if (obj.hasOwnProperty(prop)) {
  899 + return false;
  900 + }
  901 + }
  902 + return true;
  903 + } else {
  904 + throw "必须是对象";
  905 + }
  906 + };
  907 +
  908 + // 刷新数据
  909 + scope[ctrlAs].$$internal_refresh_fn = function(search) {
  910 + // 绑定的model字段值,此属性是绑定属性,只能在link阶段获取
  911 + var $dcvalue_attr = attr["dcvalue"];
  912 +
  913 + console.log("刷新数据:" + $dcvalue_attr);
  914 +
  915 + if (!$$data_init) { // 只初始化$$data_real一次,重新载入页面才能重新初始化
  916 + if (dictionaryUtils.getByGroup($datatype_attr)) { // 判定是否字典类型数据源
  917 + scope[ctrlAs].$$internal_dic_data(
  918 + $datatype_attr, $icname_attr, $icname_s_attr);
  919 + if ($dcvalue_attr) {
  920 + scope[ctrlAs].$$internalmodel = $dcvalue_attr;
  921 + }
  922 + } else { // 非字典类型数据源
  923 + if (!$dataassociate_attr) {
  924 + $$searchInfoService_g[$datatype_attr].list(
  925 + {type: "all"},
  926 + function(result) {
  927 + //console.log("ok:" + $datatype_attr);
  928 + scope[ctrlAs].$$internal_other_data(result, $dcvalue_attr);
  929 + //console.log("ok2:" + $datatype_attr);
  930 + if ($dcvalue_attr) {
  931 + scope[ctrlAs].$$internalmodel = $dcvalue_attr;
  932 + }
  933 +
  934 + $$data_init = true;
  935 + },
  936 + function(result) {
  937 +
  938 + }
  939 + );
  940 + }
  941 + }
  942 + }
  943 +
  944 + if ($$data_init) {
  945 + if (search && search != "") { // 有search值
  946 + if (!dictionaryUtils.getByGroup($datatype_attr)) { // 其他数据源
  947 + // 处理search
  948 + console.log("search:" + search);
  949 +
  950 + scope[ctrlAs].$$data = [];
  951 + for (var k = 0; k < scope[ctrlAs].$$data_real.length; k++) {
  952 + var upTerm = search.toUpperCase();
  953 + if (scope[ctrlAs].$$data.length < 10) {
  954 + if (scope[ctrlAs].$$data_real[k].fullChars.indexOf(upTerm) != -1
  955 + || scope[ctrlAs].$$data_real[k].camelChars.indexOf(upTerm) != -1) {
  956 + scope[ctrlAs].$$data.push(angular.copy(scope[ctrlAs].$$data_real[k]));
  957 + }
  958 + } else {
  959 + break;
  960 + }
  961 + }
  962 + }
  963 + }
  964 +
  965 + }
  966 +
  967 + };
  968 +
  969 +
  970 +
  971 +
  972 +
  973 +
  974 +
  975 +
  976 +
  977 +
  978 + // TODO:
  979 +
  980 + // dom全部载入后调用
  981 + $timeout(function() {
  982 + console.log("dom全部载入后调用");
  983 + }, 0);
  984 + // 监控dcvalue model值变换
  985 + attr.$observe("dcvalue", function(value) {
  986 + console.log("监控dc1 model值变换:" + value);
  987 + scope[ctrlAs].$$internalmodel = value;
  988 + }
  989 + );
  990 + // 监控获取数据参数变换
  991 + attr.$observe("dataparam", function(value) {
  992 + // 判定是否空对象
  993 + console.log(value);
  994 + var obj = JSON.parse(value);
  995 + var $dcvalue_attr = attr["dcvalue"];
  996 + if (!scope[ctrlAs].$$internal_isEmpty_obj(obj)) {
  997 + console.log("dataparam:" + obj);
  998 +
  999 + //
  1000 +
  1001 + obj["type"] = "all";
  1002 +
  1003 + $$data_init = false;
  1004 + $$searchInfoService_g[$datatype_attr].list(
  1005 + obj,
  1006 + function(result) {
  1007 + //console.log("ok:" + $datatype_attr);
  1008 + scope[ctrlAs].$$internal_other_data(result, $dcvalue_attr);
  1009 + //console.log("ok2:" + $datatype_attr);
  1010 + if ($dcvalue_attr) {
  1011 + scope[ctrlAs].$$internalmodel = $dcvalue_attr;
  1012 + }
  1013 +
  1014 + $$data_init = true;
  1015 + },
  1016 + function(result) {
  1017 +
  1018 + }
  1019 + );
  1020 + }
  1021 + }
  1022 + );
  1023 + }
  1024 + };
  1025 + }
  1026 + };
  1027 +
  1028 + }
  1029 +]);
  1030 +
  1031 +/**
  1032 + * saCheckboxgroup指令
  1033 + * 属性如下:
  1034 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  1035 + * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}
  1036 + * dcname(必须):绑定的model字段名,如:dcname=xl.id
  1037 + * name(必须):控件的名字
  1038 + * required(可选):是否要用required验证
  1039 + * disabled(可选):标示框是否可选
  1040 + *
  1041 + */
  1042 +angular.module('ScheduleApp').directive('saCheckboxgroup', [
  1043 + function() {
  1044 + return {
  1045 + restrict: 'E',
  1046 + templateUrl: '/pages/scheduleApp/module/common/dt/MyCheckboxGroupWrapTemplate.html',
  1047 + scope: {
  1048 + model: "=" // 独立作用域,关联外部的模型object
  1049 + },
  1050 + controllerAs: "$saCheckboxgroupCtrl",
  1051 + bindToController: true,
  1052 + controller: function($scope) {
  1053 + var self = this;
  1054 + self.$$data = []; // 内部的数据
  1055 +
  1056 + // TODO:数据写死,周一至周日选择数据,以后有别的数据再议
  1057 + self.$$data = [
  1058 + {name: "星期一", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1059 + {name: "星期二", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1060 + {name: "星期三", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1061 + {name: "星期四", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1062 + {name: "星期五", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1063 + {name: "星期六", checkedvalue: "1", uncheckedvalue: "0", ischecked: false},
  1064 + {name: "星期日", checkedvalue: "1", uncheckedvalue: "0", ischecked: false}
  1065 + ];
  1066 + },
  1067 +
  1068 + /**
  1069 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  1070 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  1071 + * @param tElem
  1072 + * @param tAttrs
  1073 + * @returns {{pre: Function, post: Function}}
  1074 + */
  1075 + compile: function(tElem, tAttrs) {
  1076 + // 获取所有的属性
  1077 + var $name_attr = tAttrs["name"]; // 控件的名字
  1078 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  1079 + var $disabled_attr = tAttrs["disabled"]; // 是否禁用
  1080 + var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名
  1081 +
  1082 + // controlAs名字
  1083 + var ctrlAs = '$saCheckboxgroupCtrl';
  1084 +
  1085 + // 如果有required属性,添加angularjs required验证
  1086 + if ($required_attr != undefined) {
  1087 + //console.log(tElem.html());
  1088 + tElem.find("div").attr("required", "");
  1089 + }
  1090 + // 如果有disabled属性,添加禁用标志
  1091 + if ($disabled_attr != undefined) {
  1092 + tElem.find("input").attr("ng-disabled", "true");
  1093 + }
  1094 +
  1095 + return {
  1096 + pre: function(scope, element, attr) {
  1097 + // TODO:
  1098 + },
  1099 + /**
  1100 + * 相当于link函数。
  1101 + * @param scope
  1102 + * @param element
  1103 + * @param attr
  1104 + */
  1105 + post: function(scope, element, attr) {
  1106 + // name属性
  1107 + if ($name_attr) {
  1108 + scope[ctrlAs]["$name_attr"] = $name_attr;
  1109 + }
  1110 +
  1111 + /**
  1112 + * checkbox选择事件处理函数。
  1113 + * @param $d 数据对象,$$data中的元素对象
  1114 + */
  1115 + scope[ctrlAs].$$internal_updateCheck_fn = function($d) {
  1116 + $d.ischecked = !$d.ischecked;
  1117 + console.log($d);
  1118 + };
  1119 +
  1120 + // 测试使用watch监控$$data的变化
  1121 + scope.$watch(
  1122 + function() {
  1123 + return scope[ctrlAs]["$$data"];
  1124 + },
  1125 + function(newValue, oldValue) {
  1126 + // 根据$$data生成对应的数据
  1127 + var rule_days_arr = [];
  1128 + var i;
  1129 + for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {
  1130 + if (scope[ctrlAs]["$$data"][i].ischecked)
  1131 + rule_days_arr.push(scope[ctrlAs]["$$data"][i].checkedvalue);
  1132 + else
  1133 + rule_days_arr.push(scope[ctrlAs]["$$data"][i].uncheckedvalue);
  1134 + }
  1135 + scope[ctrlAs].$$internalmodel = rule_days_arr.join(",");
  1136 + //scope[ctrlAs].$$internalmodel = undefined;
  1137 + console.log("bbbbbbbb--->" + scope[ctrlAs].$$internalmodel);
  1138 +
  1139 + // 更新model
  1140 + if ($dcname_attr) {
  1141 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = rule_days_arr.join(',');");
  1142 + }
  1143 +
  1144 +
  1145 + },
  1146 + true
  1147 + );
  1148 +
  1149 + // TODO:
  1150 +
  1151 + // 监控dcvalue model值变换
  1152 + attr.$observe("dcvalue", function(value) {
  1153 + console.log("saCheckboxgroup 监控dc1 model值变换:" + value);
  1154 + if (value) {
  1155 + // 根据value值,修改$$data里的值
  1156 + var data_array = value.split(",");
  1157 + var i;
  1158 + if (data_array.length > scope[ctrlAs]["$$data"].length) {
  1159 + for (i = 0; i < scope[ctrlAs]["$$data"].length; i ++) {
  1160 + if (data_array[i] == scope[ctrlAs]["$$data"][i].checkedvalue) {
  1161 + scope[ctrlAs]["$$data"][i].ischecked = true;
  1162 + } else {
  1163 + scope[ctrlAs]["$$data"][i].ischecked = false;
  1164 + }
  1165 + }
  1166 + } else {
  1167 + for (i = 0; i < data_array.length; i ++) {
  1168 + if (data_array[i] == scope[ctrlAs]["$$data"][i].checkedvalue) {
  1169 + scope[ctrlAs]["$$data"][i].ischecked = true;
  1170 + } else {
  1171 + scope[ctrlAs]["$$data"][i].ischecked = false;
  1172 + }
  1173 + }
  1174 + }
  1175 +
  1176 + }
  1177 + });
  1178 + }
  1179 +
  1180 + };
  1181 +
  1182 +
  1183 + }
  1184 +
  1185 + };
  1186 + }
  1187 +]);
  1188 +
  1189 +/**
  1190 + * saDategroup指令
  1191 + * 属性如下:
  1192 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  1193 + * dcvalue(必须):绑定的model字段值,如:dcvalue={{ctrl.employeeInfoForSave.xl.id}}
  1194 + * dcname(必须):绑定的model字段名,如:dcname=xl.id
  1195 + * name(必须):控件的名字
  1196 + * required(可选):是否要用required验证
  1197 + * disabled(可选):标示框是否可选
  1198 + *
  1199 + */
  1200 +angular.module('ScheduleApp').directive('saDategroup', [
  1201 + '$filter',
  1202 + function($filter) {
  1203 + return {
  1204 + restrict: 'E',
  1205 + templateUrl: '/pages/scheduleApp/module/common/dt/MyDateGroupWrapTemplate.html',
  1206 + scope: {
  1207 + model: "=" // 独立作用域,关联外部的模型object
  1208 + },
  1209 + controllerAs: "$saDategroupCtrl",
  1210 + bindToController: true,
  1211 + controller: function($scope) {
  1212 + var self = this;
  1213 + self.$$data = []; // 内部的数据
  1214 + self.$$date_select; // 内部选中的日期
  1215 +
  1216 + //// 测试数据
  1217 + //self.$$data = [
  1218 + // {datestr: '2011-01-01', ischecked: true},
  1219 + // {datestr: '2011-01-01', ischecked: true},
  1220 + // {datestr: '2011-01-01', ischecked: true}
  1221 + //];
  1222 + },
  1223 +
  1224 + /**
  1225 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  1226 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  1227 + * @param tElem
  1228 + * @param tAttrs
  1229 + * @returns {{pre: Function, post: Function}}
  1230 + */
  1231 + compile: function(tElem, tAttrs) {
  1232 + // 获取所有的属性
  1233 + var $name_attr = tAttrs["name"]; // 控件的名字
  1234 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  1235 + var $disabled_attr = tAttrs["disabled"]; // 是否禁用
  1236 + var $dcname_attr = tAttrs["dcname"]; // 绑定的model字段名
  1237 +
  1238 + // controlAs名字
  1239 + var ctrlAs = '$saDategroupCtrl';
  1240 +
  1241 + // 如果有required属性,添加angularjs required验证
  1242 + if ($required_attr != undefined) {
  1243 + //console.log(tElem.html());
  1244 + tElem.find("div").attr("required", "");
  1245 + }
  1246 + // 如果有disabled属性,添加禁用标志
  1247 + if ($disabled_attr != undefined) {
  1248 + tElem.find("input").attr("ng-disabled", "true");
  1249 + tElem.find("div").attr("ng-disabled", "true");
  1250 + }
  1251 +
  1252 + return {
  1253 + pre: function (scope, element, attr) {
  1254 + // TODO:
  1255 + },
  1256 + /**
  1257 + * 相当于link函数。
  1258 + * @param scope
  1259 + * @param element
  1260 + * @param attr
  1261 + */
  1262 + post: function (scope, element, attr) {
  1263 + // name属性
  1264 + if ($name_attr) {
  1265 + scope[ctrlAs]["$name_attr"] = $name_attr;
  1266 + }
  1267 +
  1268 +
  1269 + // 日期open属性,及方法
  1270 + scope[ctrlAs].$$specialDateOpen = false;
  1271 + scope[ctrlAs].$$specialDate_open = function() {
  1272 + scope[ctrlAs].$$specialDateOpen = true;
  1273 + };
  1274 +
  1275 + // 监控选择的日期
  1276 + scope.$watch(
  1277 + function() {
  1278 + return scope[ctrlAs]['$$date_select'];
  1279 + },
  1280 + function(newValue, oldValue) {
  1281 + if (newValue) {
  1282 + //console.log("saDategroup--->selectdate:" + newValue);
  1283 + // 调用内置filter,转换日期到yyyy-MM-dd格式
  1284 + var text = $filter('date')(newValue, 'yyyy-MM-dd');
  1285 + var i;
  1286 + var isexist = false; // 日期是否已经选择标识
  1287 + for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {
  1288 + if (scope[ctrlAs]["$$data"][i].datestr == text) {
  1289 + isexist = true;
  1290 + break;
  1291 + }
  1292 + }
  1293 + if (!isexist) {
  1294 + scope[ctrlAs]["$$data"].push(
  1295 + {
  1296 + datestr: text,
  1297 + ischecked: true
  1298 + }
  1299 + );
  1300 + }
  1301 +
  1302 + }
  1303 +
  1304 + }
  1305 + );
  1306 +
  1307 + /**
  1308 + * 日期点击事件处理函数。
  1309 + * @param $index 索引
  1310 + */
  1311 + scope[ctrlAs].$$internal_datestr_click = function($index) {
  1312 + scope[ctrlAs].$$data.splice($index, 1);
  1313 + };
  1314 +
  1315 + // 测试使用watch监控$$data的变化
  1316 + scope.$watch(
  1317 + function() {
  1318 + return scope[ctrlAs]['$$data'];
  1319 + },
  1320 + function(newValue, oldValue) {
  1321 + // 根据$$data生成对应的数据
  1322 + var special_days_arr = [];
  1323 + var i;
  1324 + for (i = 0; i < scope[ctrlAs]["$$data"].length; i++) {
  1325 + special_days_arr.push(scope[ctrlAs]["$$data"][i].datestr);
  1326 + }
  1327 +
  1328 + scope[ctrlAs].$$internalmodel = special_days_arr.join(",");
  1329 + console.log("bbbbbbbb--->" + scope[ctrlAs].$$internalmodel);
  1330 +
  1331 + // 更新model
  1332 + if ($dcname_attr) {
  1333 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = special_days_arr.join(',');");
  1334 + }
  1335 + },
  1336 + true
  1337 + );
  1338 +
  1339 + // 监控dcvalue model值变换
  1340 + attr.$observe("dcvalue", function(value) {
  1341 + console.log("saDategroup 监控dc1 model值变换:" + value);
  1342 + if (value) {
  1343 + // 根据value值,修改$$data里的值
  1344 + var date_array = value.split(",");
  1345 + var i;
  1346 + scope[ctrlAs]["$$data"] = [];
  1347 + for (i = 0; i < date_array.length; i++) {
  1348 + scope[ctrlAs]["$$data"].push(
  1349 + {
  1350 + datestr: date_array[i],
  1351 + ischecked: true
  1352 + }
  1353 + );
  1354 + }
  1355 +
  1356 +
  1357 +
  1358 +
  1359 +
  1360 +
  1361 +
  1362 +
  1363 +
  1364 + }
  1365 + });
  1366 +
  1367 + }
  1368 +
  1369 + };
  1370 + }
  1371 + }
  1372 + }
  1373 +]);
  1374 +
  1375 +/**
  1376 + * saGuideboardgroup指令
  1377 + * 属性如下:
  1378 + * name(必须):控件的名字
  1379 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  1380 + * xlidvalue(必须):绑定的model线路id值,如:xlidvalue={{ctrl.employeeInfoForSave.xl.id}}
  1381 + * lprangevalue(必须):绑定的model路牌名字范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}
  1382 + * lprangename(必须):绑定的model路牌名字范围字段名,如:lprangename=lprange
  1383 + * lpidrangevalue(必须):绑定的model路牌id范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}
  1384 + * lpidrangename(必须):绑定的model路牌id范围字段名,如:lprangename=lprange
  1385 + * lpstartvalue(必须):绑定的model起始路牌值,如:lpstartvalue={{ctrl.employeeInfoForSave.lpstart}}
  1386 + * lpstartname(必须):绑定的model起始路牌字段名,如:lpstartname=lpstart
  1387 + *
  1388 + * required(可选):是否要用required验证
  1389 + *
  1390 + */
  1391 +angular.module('ScheduleApp').directive('saGuideboardgroup', [
  1392 + 'GuideboardManageService_g',
  1393 + function(guideboardManageService_g) {
  1394 + return {
  1395 + restrict: 'E',
  1396 + templateUrl: '/pages/scheduleApp/module/common/dt/MyGuideboardGroupWrapTemplate.html',
  1397 + scope: {
  1398 + model: "=" // 独立作用域,关联外部的模型object
  1399 + },
  1400 + controllerAs: '$saGuideboardgroupCtrl',
  1401 + bindToController: true,
  1402 + controller: function($scope) {
  1403 + var self = this;
  1404 + self.$$data = []; // 选择线路后,该线路的路牌数据
  1405 +
  1406 + // 测试数据
  1407 + //self.$$data = [
  1408 + // {lpid: 1, lpname: '路1', isstart: false},
  1409 + // {lpid: 2, lpname: '路2', isstart: true},
  1410 + // {lpid: 3, lpname: '路3', isstart: false}
  1411 + //];
  1412 +
  1413 +
  1414 + self.$$dataSelected = []; // 选中的路牌列表
  1415 + self.$$dataSelectedStart = undefined; // 起始路牌
  1416 +
  1417 + //self.$$dataSelected = [
  1418 + // {lpid: 11, lpname: '路11', isstart: false},
  1419 + // {lpid: 12, lpname: '路12', isstart: true},
  1420 + // {lpid: 13, lpname: '路13', isstart: false}
  1421 + //];
  1422 +
  1423 + // saGuideboardgroup组件的ng-model,用于外部绑定等操作
  1424 + self.$$internalmodel = undefined;
  1425 +
  1426 + self.$$data_init = false; // *数据源初始化标志
  1427 + self.$$data_xl_first_init = false; // 线路是否初始化
  1428 + self.$$data_lp_first_init = false; // 路牌名字是否初始化
  1429 + self.$$data_lpid_first_init = false; // 路牌id是否初始化
  1430 + self.$$data_lpstart_first_init = false; // 起始路牌是否初始化
  1431 +
  1432 + self.$$dataDesc = ""; // 路牌列表描述
  1433 + self.$$dataSelectDesc = ""; // 选中路牌描述
  1434 +
  1435 + },
  1436 +
  1437 + /**
  1438 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  1439 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  1440 + * @param tElem
  1441 + * @param tAttrs
  1442 + * @returns {{pre: Function, post: Function}}
  1443 + */
  1444 + compile: function(tElem, tAttrs) {
  1445 + // TODO:获取所有的属性
  1446 + var $name_attr = tAttrs["name"]; // 控件的名字
  1447 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  1448 + var $lprangename_attr = tAttrs["lprangename"]; // 绑定的model路牌名字范围字段名
  1449 + var $lpidrangename_attr = tAttrs["lpidrangename"]; // 绑定的model路牌id范围字段名
  1450 + var $lpstartname_attr = tAttrs["lpstartname"]; // 绑定的model起始路牌字段名
  1451 +
  1452 + // controlAs名字
  1453 + var ctrlAs = '$saGuideboardgroupCtrl';
  1454 +
  1455 + // 如果有required属性,添加angularjs required验证
  1456 + if ($required_attr != undefined) {
  1457 + //console.log(tElem.html());
  1458 + tElem.find("div").attr("required", "");
  1459 + }
  1460 +
  1461 + return {
  1462 + pre: function(scope, element, attr) {
  1463 + // TODO:
  1464 + },
  1465 +
  1466 + /**
  1467 + * 相当于link函数。
  1468 + * @param scope
  1469 + * @param element
  1470 + * @param attr
  1471 + */
  1472 + post: function(scope, element, attr) {
  1473 + // name属性
  1474 + if ($name_attr) {
  1475 + scope[ctrlAs]["$name_attr"] = $name_attr;
  1476 + }
  1477 +
  1478 + // TODO:
  1479 +
  1480 +
  1481 + /**
  1482 + * 路牌列表点击(路牌列表中选中路牌)
  1483 + * @param $index
  1484 + */
  1485 + scope[ctrlAs].$$internal_lplist_click = function($index) {
  1486 + var data_temp = scope[ctrlAs].$$data;
  1487 + if (data_temp && data_temp.length > $index) {
  1488 + scope[ctrlAs].$$dataSelected.push({
  1489 + lpid: data_temp[$index].lpid,
  1490 + lpname: data_temp[$index].lpname,
  1491 + isstart: data_temp[$index].isstart
  1492 + });
  1493 +
  1494 + // 如果没有指定过初始路牌,默认选择此路牌作为起始路牌
  1495 + if (scope[ctrlAs].$$dataSelectedStart == undefined) {
  1496 + scope[ctrlAs].$$internal_sellplist_click(
  1497 + scope[ctrlAs].$$dataSelected.length - 1);
  1498 + }
  1499 + }
  1500 + };
  1501 + /**
  1502 + * 选中的路牌单击(初始路牌选择)
  1503 + * @param $index
  1504 + */
  1505 + scope[ctrlAs].$$internal_sellplist_click = function($index) {
  1506 + var data_temp = scope[ctrlAs].$$dataSelected;
  1507 + if (data_temp && data_temp.length > $index) {
  1508 + for (var i = 0; i < data_temp.length; i++) {
  1509 + data_temp[i].isstart = false;
  1510 + }
  1511 + data_temp[$index].isstart = true;
  1512 + scope[ctrlAs].$$dataSelectedStart = $index;
  1513 + }
  1514 + };
  1515 + /**
  1516 + * 选中的路牌双击(删除选中的路牌)
  1517 + * @param $index
  1518 + */
  1519 + scope[ctrlAs].$$internal_sellplist_dbclick = function($index) {
  1520 + var data_temp = scope[ctrlAs].$$dataSelected;
  1521 + if (data_temp && data_temp.length > $index) {
  1522 + if (scope[ctrlAs].$$dataSelectedStart == $index) {
  1523 + scope[ctrlAs].$$dataSelectedStart = undefined;
  1524 + }
  1525 + data_temp.splice($index, 1);
  1526 + }
  1527 + };
  1528 +
  1529 +
  1530 + /**
  1531 + * 验证内部数据,更新外部model
  1532 + */
  1533 + scope[ctrlAs].$$internal_validate_model = function() {
  1534 + var data_temp = scope[ctrlAs].$$dataSelected;
  1535 + var data_temp2 = scope[ctrlAs].$$dataSelectedStart;
  1536 + var lpNames = [];
  1537 + var lpIds = [];
  1538 + var lpStart = 0;
  1539 + var i = 0;
  1540 +
  1541 + if (data_temp &&
  1542 + data_temp.length > 0 &&
  1543 + data_temp2 != undefined) {
  1544 +
  1545 + for (i = 0; i < data_temp.length; i++) {
  1546 + lpNames.push(data_temp[i].lpname);
  1547 + lpIds.push(data_temp[i].lpid)
  1548 + }
  1549 + data_temp[data_temp2].isstart = true;
  1550 + lpStart = data_temp2 + 1;
  1551 +
  1552 + // 更新内部model,用于外部验证
  1553 + // 内部model的值暂时随意,以后再改
  1554 + scope[ctrlAs].$$internalmodel = {desc: "ok"};
  1555 +
  1556 + // 更新外部model字段
  1557 + if ($lprangename_attr) {
  1558 + console.log("lprangename=" + lpNames.join(','));
  1559 + eval("scope[ctrlAs].model" + "." + $lprangename_attr + " = lpNames.join(',');");
  1560 + }
  1561 + if ($lpidrangename_attr) {
  1562 + console.log("lpidrangename=" + lpIds.join(','));
  1563 + eval("scope[ctrlAs].model" + "." + $lpidrangename_attr + " = lpIds.join(',');");
  1564 + }
  1565 + if ($lpstartname_attr) {
  1566 + console.log("lpstartname=" + lpStart);
  1567 + eval("scope[ctrlAs].model" + "." + $lpstartname_attr + " = lpStart;");
  1568 + }
  1569 +
  1570 + scope[ctrlAs].$$dataSelectDesc =
  1571 + ",共" + data_temp.length + "个," + "初始路牌,第" + lpStart + "个";
  1572 +
  1573 + } else {
  1574 + scope[ctrlAs].$$internalmodel = undefined;
  1575 + }
  1576 +
  1577 +
  1578 + };
  1579 +
  1580 + // 监控内部数据,$$data_selected 变化
  1581 + scope.$watch(
  1582 + function() {
  1583 + return scope[ctrlAs].$$dataSelected;
  1584 + },
  1585 + function(newValue, oldValue) {
  1586 + scope[ctrlAs].$$internal_validate_model();
  1587 + },
  1588 + true
  1589 + );
  1590 +
  1591 + // 监控内部数据,$$data_selected_start 变化
  1592 + scope.$watch(
  1593 + function() {
  1594 + return scope[ctrlAs].$$dataSelectedStart;
  1595 + },
  1596 + function(newValue, oldValue) {
  1597 + scope[ctrlAs].$$internal_validate_model();
  1598 + },
  1599 + true
  1600 + );
  1601 +
  1602 + /**
  1603 + * 验证数据是否初始化完成,
  1604 + * 所谓的初始化就是内部所有的数据被有效设定过一次。
  1605 + */
  1606 + scope[ctrlAs].$$internal_validate_init = function() {
  1607 + var self = scope[ctrlAs];
  1608 +
  1609 + if (self.$$data_xl_first_init &&
  1610 + self.$$data_lp_first_init &&
  1611 + self.$$data_lpid_first_init &&
  1612 + self.$$data_lpstart_first_init) {
  1613 + console.log("数据初始化完毕!");
  1614 + self.$$data_init = true;
  1615 + }
  1616 +
  1617 + };
  1618 +
  1619 + // 监控初始化标志,线路,路牌,路牌id,起始路牌
  1620 + scope.$watch(
  1621 + function() {
  1622 + return scope[ctrlAs].$$data_xl_first_init;
  1623 + },
  1624 + function(newValue, oldValue) {
  1625 + scope[ctrlAs].$$internal_validate_init();
  1626 + }
  1627 + );
  1628 + scope.$watch(
  1629 + function() {
  1630 + return scope[ctrlAs].$$data_lp_first_init;
  1631 + },
  1632 + function(newValue, oldValue) {
  1633 + scope[ctrlAs].$$internal_validate_init();
  1634 + }
  1635 + );
  1636 + scope.$watch(
  1637 + function() {
  1638 + return scope[ctrlAs].$$data_lpid_first_init;
  1639 + },
  1640 + function(newValue, oldValue) {
  1641 + scope[ctrlAs].$$internal_validate_init();
  1642 + }
  1643 + );
  1644 + scope.$watch(
  1645 + function() {
  1646 + return scope[ctrlAs].$$data_lpstart_first_init;
  1647 + },
  1648 + function(newValue, oldValue) {
  1649 + scope[ctrlAs].$$internal_validate_init();
  1650 + }
  1651 + );
  1652 +
  1653 +
  1654 + // 监控线路id的变化
  1655 + attr.$observe("xlidvalue", function(value) {
  1656 + if (value && value != "") {
  1657 + console.log("xlidvalue=" + value);
  1658 +
  1659 + guideboardManageService_g.rest.list(
  1660 + {"xl.id_eq": value, size: 100},
  1661 + function(result) {
  1662 + // 获取值了
  1663 + console.log("路牌获取了");
  1664 +
  1665 + scope[ctrlAs].$$data = [];
  1666 + for (var i = 0; i < result.content.length; i++) {
  1667 + scope[ctrlAs].$$data.push({
  1668 + lpid: result.content[i].id,
  1669 + lpname: result.content[i].lpName,
  1670 + isstart: false
  1671 + });
  1672 + }
  1673 + if (scope[ctrlAs].$$data_init) {
  1674 + scope[ctrlAs].$$dataSelected = [];
  1675 + scope[ctrlAs].$$dataSelectedStart = undefined;
  1676 + scope[ctrlAs].$$internalmodel = undefined;
  1677 + scope[ctrlAs].$$dataDesc = "";
  1678 + scope[ctrlAs].$$dataSelectDesc = "";
  1679 + }
  1680 + scope[ctrlAs].$$data_xl_first_init = true;
  1681 +
  1682 + scope[ctrlAs].$$dataDesc = ",共" + result.content.length + "个";
  1683 + },
  1684 + function(result) {
  1685 +
  1686 + }
  1687 + );
  1688 +
  1689 + }
  1690 + });
  1691 +
  1692 + // 监控路牌名称范围值的变化
  1693 + attr.$observe("lprangevalue", function(value) {
  1694 + if (value && value != "") {
  1695 + var data_temp = scope[ctrlAs].$$dataSelected;
  1696 + var lpnames = value.split(",");
  1697 + var i = 0;
  1698 + if (data_temp && data_temp.length == 0) { // 初始创建
  1699 + console.log("lprangevalue变换了");
  1700 + for (i = 0; i < lpnames.length; i++) {
  1701 + scope[ctrlAs].$$dataSelected.push({
  1702 + lpname: lpnames[i],
  1703 + isstart: false
  1704 + });
  1705 + }
  1706 + } else {
  1707 + for (i = 0; i < lpnames.length; i++) {
  1708 + data_temp[i].lpname = lpnames[i];
  1709 + }
  1710 + }
  1711 + scope[ctrlAs].$$data_lp_first_init = true;
  1712 + }
  1713 + });
  1714 +
  1715 + // 监控路牌id范围值的变化
  1716 + attr.$observe("lpidrangevalue", function(value) {
  1717 + if (value && value != "") {
  1718 + console.log("lpidrangevalue=" + value);
  1719 + var data_temp = scope[ctrlAs].$$dataSelected;
  1720 + var lpids = value.split(",");
  1721 + var i = 0;
  1722 + if (data_temp && data_temp.length == 0) { // 初始创建
  1723 + console.log("lpidrangevalue");
  1724 + for (i = 0; i < lpids.length; i++) {
  1725 + scope[ctrlAs].$$dataSelected.push({
  1726 + lpid: lpids[i],
  1727 + isstart: false
  1728 + });
  1729 + }
  1730 + } else {
  1731 + for (i = 0; i < lpids.length; i++) {
  1732 + data_temp[i].lpid = lpids[i];
  1733 + }
  1734 + }
  1735 + scope[ctrlAs].$$data_lpid_first_init = true;
  1736 + }
  1737 + });
  1738 +
  1739 + // 监控起始路牌的变化
  1740 + attr.$observe("lpstartvalue", function(value) {
  1741 + if (value && value != "") {
  1742 + scope[ctrlAs].$$dataSelectedStart = value - 1;
  1743 + scope[ctrlAs].$$data_lpstart_first_init = true;
  1744 + }
  1745 + });
  1746 +
  1747 +
  1748 +
  1749 + }
  1750 + }
  1751 +
  1752 + }
  1753 + }
  1754 + }
  1755 +]);
  1756 +
  1757 +/**
  1758 + * saEmployeegroup指令
  1759 + * 属性如下:
  1760 + * name(必须):控件的名字
  1761 + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave
  1762 + * xlidvalue(必须):绑定的model线路id值,如:xlidvalue={{ctrl.employeeInfoForSave.xl.id}}
  1763 + * dbbmrangevalue(必须):绑定的model搭班编码范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}
  1764 + * dbbmrangename(必须):绑定的model搭班编码范围字段名,如:lprangename=lprange
  1765 + * rycidrangevalue(必须):绑定的model人员配置idid范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}}
  1766 + * rycidrangename(必须):绑定的model人员配置id范围字段名,如:lprangename=lprange
  1767 + * rystartvalue(必须):绑定的model起始人员,如:lpstartvalue={{ctrl.employeeInfoForSave.lpstart}}
  1768 + * rystartname(必须):绑定的model起始人员字段名,如:lpstartname=lpstart
  1769 + *
  1770 + * required(可选):是否要用required验证
  1771 + *
  1772 + */
  1773 +angular.module('ScheduleApp').directive('saEmployeegroup', [
  1774 + 'EmployeeConfigService_g',
  1775 + function(employeeConfigService_g) {
  1776 + return {
  1777 + restrict: 'E',
  1778 + templateUrl: '/pages/scheduleApp/module/common/dt/MyEmployeeGroupWrapTemplate.html',
  1779 + scope: {
  1780 + model: "=" // 独立作用域,关联外部的模型object
  1781 + },
  1782 + controllerAs: '$saEmployeegroupCtrl',
  1783 + bindToController: true,
  1784 + controller: function($scope) {
  1785 + var self = this;
  1786 + self.$$data = []; // 选择线路后,该线路的人员配置数据
  1787 +
  1788 + // 测试数据
  1789 + //self.$$data = [
  1790 + // {id: 1, dbbm: "1", jsy: '忍1', spy: '守1', isstart: false},
  1791 + // {id: 2, dbbm: "2", jsy: '忍2', spy: '守2', isstart: true},
  1792 + // {id: 3, dbbm: "3", jsy: '忍3', spy: '守3', isstart: false}
  1793 + //];
  1794 +
  1795 +
  1796 + self.$$dataSelected = []; // 选中的人员配置列表
  1797 + self.$$dataSelectedStart = undefined; // 起始人员配置
  1798 +
  1799 + // saGuideboardgroup组件的ng-model,用于外部绑定等操作
  1800 + self.$$internalmodel = undefined;
  1801 +
  1802 + self.$$data_init = false; // *数据源初始化标志
  1803 + self.$$data_xl_first_init = false; // 线路是否初始化
  1804 + self.$$data_ry_first_init = false; // 人员配置是否初始化
  1805 + self.$$data_rycid_first_init = false; // 人员配置id是否初始化
  1806 + self.$$data_rystart_first_init = false; // 起始人员是否初始化
  1807 +
  1808 + self.$$dataDesc = ""; // 路牌列表描述
  1809 + self.$$dataSelectDesc = ""; // 选中路牌描述
  1810 +
  1811 + },
  1812 +
  1813 + /**
  1814 + * 此阶段可以改dom结构,此时angular还没扫描指令,
  1815 + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。
  1816 + * @param tElem
  1817 + * @param tAttrs
  1818 + * @returns {{pre: Function, post: Function}}
  1819 + */
  1820 + compile: function(tElem, tAttrs) {
  1821 + // TODO:获取所有的属性
  1822 + var $name_attr = tAttrs["name"]; // 控件的名字
  1823 + var $required_attr = tAttrs["required"]; // 是否需要required验证
  1824 + var $dbbmrangename_attr = tAttrs["dbbmrangename"]; // 绑定的model搭班编码范围字段名
  1825 + var rycidrangename_attr = tAttrs["rycidrangename"]; // 绑定的model人员配置id范围字段名
  1826 + var $rystartname_attr = tAttrs["rystartname"]; // 绑定的model起始人员字段名
  1827 +
  1828 + // controlAs名字
  1829 + var ctrlAs = '$saEmployeegroupCtrl';
  1830 +
  1831 + // 如果有required属性,添加angularjs required验证
  1832 + if ($required_attr != undefined) {
  1833 + //console.log(tElem.html());
  1834 + tElem.find("div").attr("required", "");
  1835 + }
  1836 +
  1837 + return {
  1838 + pre: function(scope, element, attr) {
  1839 + // TODO:
  1840 + },
  1841 +
  1842 + /**
  1843 + * 相当于link函数。
  1844 + * @param scope
  1845 + * @param element
  1846 + * @param attr
  1847 + */
  1848 + post: function(scope, element, attr) {
  1849 + // name属性
  1850 + if ($name_attr) {
  1851 + scope[ctrlAs]["$name_attr"] = $name_attr;
  1852 + }
  1853 +
  1854 + // TODO:
  1855 +
  1856 +
  1857 + /**
  1858 + * 人员配置列表点击(人员配置列表中选中路牌)
  1859 + * @param $index
  1860 + */
  1861 + scope[ctrlAs].$$internal_rylist_click = function($index) {
  1862 + var data_temp = scope[ctrlAs].$$data;
  1863 + if (data_temp && data_temp.length > $index) {
  1864 + scope[ctrlAs].$$dataSelected.push({
  1865 + id : data_temp[$index].id,
  1866 + dbbm: data_temp[$index].dbbm,
  1867 + jsy: data_temp[$index].jsy,
  1868 + spy: data_temp[$index].spy,
  1869 + isstart: data_temp[$index].isstart
  1870 + });
  1871 +
  1872 + // 如果没有指定过初始人员,默认选择此人员作为起始人员
  1873 + if (scope[ctrlAs].$$dataSelectedStart == undefined) {
  1874 + scope[ctrlAs].$$internal_selrylist_click(
  1875 + scope[ctrlAs].$$dataSelected.length - 1);
  1876 + }
  1877 + }
  1878 + };
  1879 + /**
  1880 + * 选中的人员单击(初始人员选择)
  1881 + * @param $index
  1882 + */
  1883 + scope[ctrlAs].$$internal_selrylist_click = function($index) {
  1884 + var data_temp = scope[ctrlAs].$$dataSelected;
  1885 + if (data_temp && data_temp.length > $index) {
  1886 + for (var i = 0; i < data_temp.length; i++) {
  1887 + data_temp[i].isstart = false;
  1888 + }
  1889 + data_temp[$index].isstart = true;
  1890 + scope[ctrlAs].$$dataSelectedStart = $index;
  1891 + }
  1892 + };
  1893 + /**
  1894 + * 选中的人员双击(删除选中的人员)
  1895 + * @param $index
  1896 + */
  1897 + scope[ctrlAs].$$internal_selrylist_dbclick = function($index) {
  1898 + var data_temp = scope[ctrlAs].$$dataSelected;
  1899 + if (data_temp && data_temp.length > $index) {
  1900 + if (scope[ctrlAs].$$dataSelectedStart == $index) {
  1901 + scope[ctrlAs].$$dataSelectedStart = undefined;
  1902 + }
  1903 + data_temp.splice($index, 1);
  1904 + }
  1905 + };
  1906 +
  1907 +
  1908 + /**
  1909 + * 验证内部数据,更新外部model
  1910 + */
  1911 + scope[ctrlAs].$$internal_validate_model = function() {
  1912 + var data_temp = scope[ctrlAs].$$dataSelected;
  1913 + var data_temp2 = scope[ctrlAs].$$dataSelectedStart;
  1914 + var ryDbbms = [];
  1915 + var ryCids = [];
  1916 + var ryStart = 0;
  1917 + var i = 0;
  1918 +
  1919 + if (data_temp &&
  1920 + data_temp.length > 0 &&
  1921 + data_temp2 != undefined) {
  1922 +
  1923 + for (i = 0; i < data_temp.length; i++) {
  1924 + ryDbbms.push(data_temp[i].dbbm);
  1925 + ryCids.push(data_temp[i].id);
  1926 + }
  1927 + data_temp[data_temp2].isstart = true;
  1928 + ryStart = data_temp2 + 1;
  1929 +
  1930 + // 更新内部model,用于外部验证
  1931 + // 内部model的值暂时随意,以后再改
  1932 + scope[ctrlAs].$$internalmodel = {desc: "ok"};
  1933 +
  1934 + // 更新外部model字段
  1935 + if ($dbbmrangename_attr) {
  1936 + console.log("dbbmrangename=" + ryDbbms.join(','));
  1937 + eval("scope[ctrlAs].model" + "." + $dbbmrangename_attr + " = ryDbbms.join(',');");
  1938 + }
  1939 + if (rycidrangename_attr) {
  1940 + console.log("rycidrangename=" + ryCids.join(','));
  1941 + eval("scope[ctrlAs].model" + "." + rycidrangename_attr + " = ryCids.join(',');");
  1942 + }
  1943 + if ($rystartname_attr) {
  1944 + console.log("rystartname=" + ryStart);
  1945 + eval("scope[ctrlAs].model" + "." + $rystartname_attr + " = ryStart;");
  1946 + }
  1947 +
  1948 + scope[ctrlAs].$$dataSelectDesc =
  1949 + ",共" + data_temp.length + "组," + "初始人员,第" + ryStart + "组";
  1950 +
  1951 + } else {
  1952 + scope[ctrlAs].$$internalmodel = undefined;
  1953 + }
  1954 +
  1955 +
  1956 + };
  1957 +
  1958 + // 监控内部数据,$$data_selected 变化
  1959 + scope.$watch(
  1960 + function() {
  1961 + return scope[ctrlAs].$$dataSelected;
  1962 + },
  1963 + function(newValue, oldValue) {
  1964 + scope[ctrlAs].$$internal_validate_model();
  1965 + },
  1966 + true
  1967 + );
  1968 +
  1969 + // 监控内部数据,$$data_selected_start 变化
  1970 + scope.$watch(
  1971 + function() {
  1972 + return scope[ctrlAs].$$dataSelectedStart;
  1973 + },
  1974 + function(newValue, oldValue) {
  1975 + scope[ctrlAs].$$internal_validate_model();
  1976 + },
  1977 + true
  1978 + );
  1979 +
  1980 + /**
  1981 + * 验证数据是否初始化完成,
  1982 + * 所谓的初始化就是内部所有的数据被有效设定过一次。
  1983 + */
  1984 + scope[ctrlAs].$$internal_validate_init = function() {
  1985 + var self = scope[ctrlAs];
  1986 + var data_temp = self.$$data;
  1987 + var dataSelect_temp = self.$$dataSelected;
  1988 + var i = 0;
  1989 + var j = 0;
  1990 +
  1991 + if (self.$$data_xl_first_init &&
  1992 + self.$$data_ry_first_init &&
  1993 + self.$$data_rycid_first_init &&
  1994 + self.$$data_rystart_first_init) {
  1995 + console.log("数据初始化完毕!");
  1996 + self.$$data_init = true;
  1997 +
  1998 + // 修正选择dataSelect
  1999 + for (i = 0; i < dataSelect_temp.length; i++) {
  2000 + for (j = 0; j < data_temp.length; j++) {
  2001 + if (dataSelect_temp[i].dbbm == data_temp[j].dbbm) {
  2002 + dataSelect_temp[i].jsy = data_temp[j].jsy;
  2003 + dataSelect_temp[i].spy = data_temp[j].spy;
  2004 + break;
  2005 + }
  2006 + }
  2007 + }
  2008 + }
  2009 +
  2010 + };
  2011 +
  2012 + // 监控初始化标志,线路,人员,起始人员
  2013 + scope.$watch(
  2014 + function() {
  2015 + return scope[ctrlAs].$$data_xl_first_init;
  2016 + },
  2017 + function(newValue, oldValue) {
  2018 + scope[ctrlAs].$$internal_validate_init();
  2019 + }
  2020 + );
  2021 + scope.$watch(
  2022 + function() {
  2023 + return scope[ctrlAs].$$data_ry_first_init;
  2024 + },
  2025 + function(newValue, oldValue) {
  2026 + scope[ctrlAs].$$internal_validate_init();
  2027 + }
  2028 + );
  2029 + scope.$watch(
  2030 + function() {
  2031 + return scope[ctrlAs].$$data_rycid_first_init;
  2032 + },
  2033 + function(newValue, oldValue) {
  2034 + scope[ctrlAs].$$internal_validate_init();
  2035 + }
  2036 + );
  2037 + scope.$watch(
  2038 + function() {
  2039 + return scope[ctrlAs].$$data_rystart_first_init;
  2040 + },
  2041 + function(newValue, oldValue) {
  2042 + scope[ctrlAs].$$internal_validate_init();
  2043 + }
  2044 + );
  2045 +
  2046 +
  2047 + // 监控线路id的变化
  2048 + attr.$observe("xlidvalue", function(value) {
  2049 + if (value && value != "") {
  2050 + console.log("xlidvalue=" + value);
  2051 +
  2052 + employeeConfigService_g.rest.list(
  2053 + {"xl.id_eq": value, size: 100},
  2054 + function(result) {
  2055 + // 获取值了
  2056 + console.log("人员配置获取了");
  2057 +
  2058 + scope[ctrlAs].$$data = [];
  2059 + for (var i = 0; i < result.content.length; i++) {
  2060 + scope[ctrlAs].$$data.push({
  2061 + id: result.content[i].id,
  2062 + dbbm: result.content[i].dbbm,
  2063 + jsy: result.content[i].jsy.personnelName,
  2064 + spy: result.content[i].spy == null ? "" : result.content[i].spy.personnelName,
  2065 + isstart: false
  2066 + });
  2067 + }
  2068 + if (scope[ctrlAs].$$data_init) {
  2069 + scope[ctrlAs].$$dataSelected = [];
  2070 + scope[ctrlAs].$$dataSelectedStart = undefined;
  2071 + scope[ctrlAs].$$internalmodel = undefined;
  2072 + scope[ctrlAs].$$dataDesc = "";
  2073 + scope[ctrlAs].$$dataSelectDesc = "";
  2074 + }
  2075 + scope[ctrlAs].$$data_xl_first_init = true;
  2076 +
  2077 + scope[ctrlAs].$$dataDesc = ",共" + result.content.length + "组";
  2078 + },
  2079 + function(result) {
  2080 +
  2081 + }
  2082 + );
  2083 +
  2084 + }
  2085 + });
  2086 +
  2087 + // 监控搭班编码范围值的变化
  2088 + attr.$observe("dbbmrangevalue", function(value) {
  2089 + if (value && value != "") {
  2090 + var data_temp = scope[ctrlAs].$$dataSelected;
  2091 + var dbbmnames = value.split(",");
  2092 + var i = 0;
  2093 + if (data_temp && data_temp.length == 0) { // 初始创建
  2094 + console.log("dbbmrangevalue变换了");
  2095 + for (i = 0; i < dbbmnames.length; i++) {
  2096 + scope[ctrlAs].$$dataSelected.push({
  2097 + dbbm: dbbmnames[i],
  2098 + isstart: false
  2099 + });
  2100 + }
  2101 + } else {
  2102 + for (i = 0; i < dbbmnames.length; i++) {
  2103 + data_temp[i].dbbm = dbbmnames[i];
  2104 + }
  2105 + }
  2106 + scope[ctrlAs].$$data_ry_first_init = true;
  2107 + }
  2108 + });
  2109 +
  2110 + // 监控人员配置id范围值的变化
  2111 + attr.$observe("rycidrangevalue", function(value) {
  2112 + if (value && value != "") {
  2113 + var data_temp = scope[ctrlAs].$$dataSelected;
  2114 + var rycids = value.split(",");
  2115 + var i = 0;
  2116 + if (data_temp && data_temp.length == 0) { // 初始创建
  2117 + console.log("rycidrangevalue变换了");
  2118 + for (i = 0; i < rycids.length; i++) {
  2119 + scope[ctrlAs].$$dataSelected.push({
  2120 + id: rycids[i],
  2121 + isstart: false
  2122 + });
  2123 + }
  2124 + } else {
  2125 + for (i = 0; i < rycids.length; i++) {
  2126 + data_temp[i].id = rycids[i];
  2127 + }
  2128 + }
  2129 + scope[ctrlAs].$$data_rycid_first_init = true;
  2130 + }
  2131 + });
  2132 +
  2133 + // 监控起始人员的变化
  2134 + attr.$observe("rystartvalue", function(value) {
  2135 + if (value && value != "") {
  2136 + scope[ctrlAs].$$dataSelectedStart = value - 1;
  2137 + scope[ctrlAs].$$data_rystart_first_init = true;
  2138 + }
  2139 + });
  2140 +
  2141 +
  2142 +
  2143 + }
  2144 + }
  2145 +
  2146 + }
  2147 + }
  2148 + }
  2149 +]);
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
1 -// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用  
2 -  
3 -// 文件下载服务  
4 -angular.module('ScheduleApp').factory('FileDownload_g', function() {  
5 - return {  
6 - downloadFile: function (data, mimeType, fileName) {  
7 - var success = false;  
8 - var blob = new Blob([data], { type: mimeType });  
9 - try {  
10 - if (navigator.msSaveBlob)  
11 - navigator.msSaveBlob(blob, fileName);  
12 - else {  
13 - // Try using other saveBlob implementations, if available  
14 - var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;  
15 - if (saveBlob === undefined) throw "Not supported";  
16 - saveBlob(blob, fileName);  
17 - }  
18 - success = true;  
19 - } catch (ex) {  
20 - console.log("saveBlob method failed with the following exception:");  
21 - console.log(ex);  
22 - }  
23 -  
24 - if (!success) {  
25 - // Get the blob url creator  
26 - var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;  
27 - if (urlCreator) {  
28 - // Try to use a download link  
29 - var link = document.createElement('a');  
30 - if ('download' in link) {  
31 - // Try to simulate a click  
32 - try {  
33 - // Prepare a blob URL  
34 - var url = urlCreator.createObjectURL(blob);  
35 - link.setAttribute('href', url);  
36 -  
37 - // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)  
38 - link.setAttribute("download", fileName);  
39 -  
40 - // Simulate clicking the download link  
41 - var event = document.createEvent('MouseEvents');  
42 - event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);  
43 - link.dispatchEvent(event);  
44 - success = true;  
45 -  
46 - } catch (ex) {  
47 - console.log("Download link method with simulated click failed with the following exception:");  
48 - console.log(ex);  
49 - }  
50 - }  
51 -  
52 - if (!success) {  
53 - // Fallback to window.location method  
54 - try {  
55 - // Prepare a blob URL  
56 - // Use application/octet-stream when using window.location to force download  
57 - var url = urlCreator.createObjectURL(blob);  
58 - window.location = url;  
59 - console.log("Download link method with window.location succeeded");  
60 - success = true;  
61 - } catch (ex) {  
62 - console.log("Download link method with window.location failed with the following exception:");  
63 - console.log(ex);  
64 - }  
65 - }  
66 - }  
67 - }  
68 -  
69 - if (!success) {  
70 - // Fallback to window.open method  
71 - console.log("No methods worked for saving the arraybuffer, using last resort window.open");  
72 - window.open("", '_blank', '');  
73 - }  
74 - }  
75 - };  
76 -});  
77 -  
78 -// 车辆信息service  
79 -angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) {  
80 - return {  
81 - rest: $resource(  
82 - '/cars/:id',  
83 - {order: 'carCode', direction: 'ASC', id: '@id_route'},  
84 - {  
85 - list: {  
86 - method: 'GET',  
87 - params: {  
88 - page: 0  
89 - }  
90 - },  
91 - get: {  
92 - method: 'GET'  
93 - },  
94 - save: {  
95 - method: 'POST'  
96 - }  
97 - }  
98 - ),  
99 - validate: $resource(  
100 - '/cars/validate/:type',  
101 - {},  
102 - {  
103 - insideCode: {  
104 - method: 'GET'  
105 - }  
106 - }  
107 - ),  
108 - dataTools: $resource(  
109 - '/cars/:type',  
110 - {},  
111 - {  
112 - dataExport: {  
113 - method: 'GET',  
114 - responseType: "arraybuffer",  
115 - params: {  
116 - type: "dataExport"  
117 - },  
118 - transformResponse: function(data, headers){  
119 - return {data : data};  
120 - }  
121 - }  
122 - }  
123 - )  
124 - };  
125 -}]);  
126 -// 人员信息service  
127 -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {  
128 - return {  
129 - rest : $resource(  
130 - '/personnel/:id',  
131 - {order: 'jobCode', direction: 'ASC', id: '@id_route'},  
132 - {  
133 - list: {  
134 - method: 'GET',  
135 - params: {  
136 - page: 0  
137 - }  
138 - },  
139 - get: {  
140 - method: 'GET'  
141 - },  
142 - save: {  
143 - method: 'POST'  
144 - }  
145 - }  
146 - ),  
147 - validate: $resource(  
148 - '/personnel/validate/:type',  
149 - {},  
150 - {  
151 - jobCode: {  
152 - method: 'GET'  
153 - }  
154 - }  
155 - ),  
156 - dataTools: $resource(  
157 - '/personnel/:type',  
158 - {},  
159 - {  
160 - dataExport: {  
161 - method: 'GET',  
162 - responseType: "arraybuffer",  
163 - params: {  
164 - type: "dataExport"  
165 - },  
166 - transformResponse: function(data, headers){  
167 - return {data : data};  
168 - }  
169 - }  
170 - }  
171 - )  
172 - };  
173 -}]);  
174 -// 车辆设备信息service  
175 -angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {  
176 - return $resource(  
177 - '/carDevice/:id',  
178 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
179 - {  
180 - list: {  
181 - method: 'GET',  
182 - params: {  
183 - page: 0  
184 - }  
185 - },  
186 - get: {  
187 - method: 'GET'  
188 - },  
189 - save: {  
190 - method: 'POST'  
191 - }  
192 - }  
193 - );  
194 -}]);  
195 -  
196 -// 车辆配置service  
197 -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {  
198 - return {  
199 - rest : $resource(  
200 - '/cci/:id',  
201 - {order: 'createDate', direction: 'ASC', id: '@id_route'},  
202 - {  
203 - list: {  
204 - method: 'GET',  
205 - params: {  
206 - page: 0  
207 - }  
208 - },  
209 - get: {  
210 - method: 'GET'  
211 - },  
212 - save: {  
213 - method: 'POST'  
214 - }  
215 - }  
216 - )  
217 - };  
218 -}]);  
219 -  
220 -// 人员配置service  
221 -angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {  
222 - return {  
223 - rest : $resource(  
224 - '/eci/:id',  
225 - {order: 'xl.id,dbbmFormula', direction: 'ASC', id: '@id_route'},  
226 - {  
227 - list: {  
228 - method: 'GET',  
229 - params: {  
230 - page: 0  
231 - }  
232 - },  
233 - get: {  
234 - method: 'GET'  
235 - },  
236 - save: {  
237 - method: 'POST'  
238 - }  
239 - }  
240 - ),  
241 - validate: $resource( // TODO:  
242 - '/personnel/validate/:type',  
243 - {},  
244 - {  
245 - jobCode: {  
246 - method: 'GET'  
247 - }  
248 - }  
249 - )  
250 - };  
251 -}]);  
252 -  
253 -// 路牌管理service  
254 -angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) {  
255 - return {  
256 - rest: $resource(  
257 - '/gic/:id',  
258 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
259 - {  
260 - list: {  
261 - method: 'GET',  
262 - params: {  
263 - page: 0  
264 - }  
265 - },  
266 - get: {  
267 - method: 'GET'  
268 - },  
269 - save: {  
270 - method: 'POST'  
271 - }  
272 - }  
273 - )  
274 - };  
275 -}]);  
276 -  
277 -// 排班管理service  
278 -angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) {  
279 - return {  
280 - rest: $resource(  
281 - '/sr1fc/:id',  
282 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
283 - {  
284 - list: {  
285 - method: 'GET',  
286 - params: {  
287 - page: 0  
288 - }  
289 - },  
290 - get: {  
291 - method: 'GET'  
292 - },  
293 - save: {  
294 - method: 'POST'  
295 - },  
296 - delete: {  
297 - method: 'DELETE'  
298 - }  
299 - }  
300 - )  
301 - };  
302 -}]);  
303 -  
304 -// 时刻表管理service  
305 -angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) {  
306 - return {  
307 - rest: $resource(  
308 - '/tic/:id',  
309 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
310 - {  
311 - list: {  
312 - method: 'GET',  
313 - params: {  
314 - page: 0,  
315 - isCancel_eq: 'false'  
316 - }  
317 - },  
318 - get: {  
319 - method: 'GET'  
320 - },  
321 - save: {  
322 - method: 'POST'  
323 - },  
324 - delete: {  
325 - method: 'DELETE'  
326 - }  
327 - }  
328 - ),  
329 - validate: $resource(  
330 - '/tic/validate/:type',  
331 - {},  
332 - {  
333 - ttinfoname: {  
334 - method: 'GET'  
335 - }  
336 - }  
337 - )  
338 - };  
339 -}]);  
340 -// 时刻表明细管理service  
341 -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {  
342 - return {  
343 - rest: $resource(  
344 - '/tidc/:id',  
345 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
346 - {  
347 - get: {  
348 - method: 'GET'  
349 - },  
350 - save: {  
351 - method: 'POST'  
352 - }  
353 - }  
354 - ),  
355 - edit: $resource(  
356 - '/tidc/edit/:xlid/:ttid',  
357 - {},  
358 - {  
359 - list: {  
360 - method: 'GET'  
361 - }  
362 - }  
363 - )  
364 - };  
365 -}]);  
366 -  
367 -  
368 -  
369 -// 排班计划管理service  
370 -angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) {  
371 - return {  
372 - rest : $resource(  
373 - '/spc/:id',  
374 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
375 - {  
376 - list: {  
377 - method: 'GET',  
378 - params: {  
379 - page: 0  
380 - }  
381 - },  
382 - get: {  
383 - method: 'GET'  
384 - },  
385 - save: {  
386 - method: 'POST'  
387 - },  
388 - delete: {  
389 - method: 'DELETE'  
390 - }  
391 - }  
392 - )  
393 - };  
394 -}]);  
395 -  
396 -// 排班计划明细管理service  
397 -angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) {  
398 - return {  
399 - rest : $resource(  
400 - '/spic/:id',  
401 - {order: 'scheduleDate,lp,fcno', direction: 'ASC', id: '@id_route'},  
402 - {  
403 - list: {  
404 - method: 'GET',  
405 - params: {  
406 - page: 0  
407 - }  
408 - },  
409 - get: {  
410 - method: 'GET'  
411 - },  
412 - save: {  
413 - method: 'POST'  
414 - }  
415 - }  
416 - )  
417 - };  
418 -}]);  
419 -  
420 -// 线路运营统计service  
421 -angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {  
422 - return $resource(  
423 - '/bic/:id',  
424 - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询  
425 - {  
426 - list: {  
427 - method: 'GET',  
428 - params: {  
429 - page: 0  
430 - }  
431 - }  
432 - }  
433 - );  
434 -}]);  
435 -  
436 - 1 +// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用
  2 +
  3 +// 文件下载服务
  4 +angular.module('ScheduleApp').factory('FileDownload_g', function() {
  5 + return {
  6 + downloadFile: function (data, mimeType, fileName) {
  7 + var success = false;
  8 + var blob = new Blob([data], { type: mimeType });
  9 + try {
  10 + if (navigator.msSaveBlob)
  11 + navigator.msSaveBlob(blob, fileName);
  12 + else {
  13 + // Try using other saveBlob implementations, if available
  14 + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
  15 + if (saveBlob === undefined) throw "Not supported";
  16 + saveBlob(blob, fileName);
  17 + }
  18 + success = true;
  19 + } catch (ex) {
  20 + console.log("saveBlob method failed with the following exception:");
  21 + console.log(ex);
  22 + }
  23 +
  24 + if (!success) {
  25 + // Get the blob url creator
  26 + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
  27 + if (urlCreator) {
  28 + // Try to use a download link
  29 + var link = document.createElement('a');
  30 + if ('download' in link) {
  31 + // Try to simulate a click
  32 + try {
  33 + // Prepare a blob URL
  34 + var url = urlCreator.createObjectURL(blob);
  35 + link.setAttribute('href', url);
  36 +
  37 + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
  38 + link.setAttribute("download", fileName);
  39 +
  40 + // Simulate clicking the download link
  41 + var event = document.createEvent('MouseEvents');
  42 + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
  43 + link.dispatchEvent(event);
  44 + success = true;
  45 +
  46 + } catch (ex) {
  47 + console.log("Download link method with simulated click failed with the following exception:");
  48 + console.log(ex);
  49 + }
  50 + }
  51 +
  52 + if (!success) {
  53 + // Fallback to window.location method
  54 + try {
  55 + // Prepare a blob URL
  56 + // Use application/octet-stream when using window.location to force download
  57 + var url = urlCreator.createObjectURL(blob);
  58 + window.location = url;
  59 + console.log("Download link method with window.location succeeded");
  60 + success = true;
  61 + } catch (ex) {
  62 + console.log("Download link method with window.location failed with the following exception:");
  63 + console.log(ex);
  64 + }
  65 + }
  66 + }
  67 + }
  68 +
  69 + if (!success) {
  70 + // Fallback to window.open method
  71 + console.log("No methods worked for saving the arraybuffer, using last resort window.open");
  72 + window.open("", '_blank', '');
  73 + }
  74 + }
  75 + };
  76 +});
  77 +
  78 +// 车辆信息service
  79 +angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) {
  80 + return {
  81 + rest: $resource(
  82 + '/cars/:id',
  83 + {order: 'carCode', direction: 'ASC', id: '@id_route'},
  84 + {
  85 + list: {
  86 + method: 'GET',
  87 + params: {
  88 + page: 0
  89 + }
  90 + },
  91 + get: {
  92 + method: 'GET'
  93 + },
  94 + save: {
  95 + method: 'POST'
  96 + }
  97 + }
  98 + ),
  99 + validate: $resource(
  100 + '/cars/validate/:type',
  101 + {},
  102 + {
  103 + insideCode: {
  104 + method: 'GET'
  105 + }
  106 + }
  107 + ),
  108 + dataTools: $resource(
  109 + '/cars/:type',
  110 + {},
  111 + {
  112 + dataExport: {
  113 + method: 'GET',
  114 + responseType: "arraybuffer",
  115 + params: {
  116 + type: "dataExport"
  117 + },
  118 + transformResponse: function(data, headers){
  119 + return {data : data};
  120 + }
  121 + }
  122 + }
  123 + )
  124 + };
  125 +}]);
  126 +// 人员信息service
  127 +angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {
  128 + return {
  129 + rest : $resource(
  130 + '/personnel/:id',
  131 + {order: 'jobCode', direction: 'ASC', id: '@id_route'},
  132 + {
  133 + list: {
  134 + method: 'GET',
  135 + params: {
  136 + page: 0
  137 + }
  138 + },
  139 + get: {
  140 + method: 'GET'
  141 + },
  142 + save: {
  143 + method: 'POST'
  144 + }
  145 + }
  146 + ),
  147 + validate: $resource(
  148 + '/personnel/validate/:type',
  149 + {},
  150 + {
  151 + jobCode: {
  152 + method: 'GET'
  153 + }
  154 + }
  155 + ),
  156 + dataTools: $resource(
  157 + '/personnel/:type',
  158 + {},
  159 + {
  160 + dataExport: {
  161 + method: 'GET',
  162 + responseType: "arraybuffer",
  163 + params: {
  164 + type: "dataExport"
  165 + },
  166 + transformResponse: function(data, headers){
  167 + return {data : data};
  168 + }
  169 + }
  170 + }
  171 + )
  172 + };
  173 +}]);
  174 +// 车辆设备信息service
  175 +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
  176 + return $resource(
  177 + '/carDevice/:id',
  178 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  179 + {
  180 + list: {
  181 + method: 'GET',
  182 + params: {
  183 + page: 0
  184 + }
  185 + },
  186 + get: {
  187 + method: 'GET'
  188 + },
  189 + save: {
  190 + method: 'POST'
  191 + }
  192 + }
  193 + );
  194 +}]);
  195 +
  196 +// 车辆配置service
  197 +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
  198 + return {
  199 + rest : $resource(
  200 + '/cci/:id',
  201 + {order: 'createDate', direction: 'ASC', id: '@id_route'},
  202 + {
  203 + list: {
  204 + method: 'GET',
  205 + params: {
  206 + page: 0
  207 + }
  208 + },
  209 + get: {
  210 + method: 'GET'
  211 + },
  212 + save: {
  213 + method: 'POST'
  214 + }
  215 + }
  216 + )
  217 + };
  218 +}]);
  219 +
  220 +// 人员配置service
  221 +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {
  222 + return {
  223 + rest : $resource(
  224 + '/eci/:id',
  225 + {order: 'createDate', direction: 'ASC', id: '@id_route'},
  226 + {
  227 + list: {
  228 + method: 'GET',
  229 + params: {
  230 + page: 0
  231 + }
  232 + },
  233 + get: {
  234 + method: 'GET'
  235 + },
  236 + save: {
  237 + method: 'POST'
  238 + }
  239 + }
  240 + ),
  241 + validate: $resource( // TODO:
  242 + '/personnel/validate/:type',
  243 + {},
  244 + {
  245 + jobCode: {
  246 + method: 'GET'
  247 + }
  248 + }
  249 + )
  250 + };
  251 +}]);
  252 +
  253 +// 路牌管理service
  254 +angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) {
  255 + return {
  256 + rest: $resource(
  257 + '/gic/:id',
  258 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  259 + {
  260 + list: {
  261 + method: 'GET',
  262 + params: {
  263 + page: 0
  264 + }
  265 + },
  266 + get: {
  267 + method: 'GET'
  268 + },
  269 + save: {
  270 + method: 'POST'
  271 + }
  272 + }
  273 + )
  274 + };
  275 +}]);
  276 +
  277 +// 排班管理service
  278 +angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) {
  279 + return {
  280 + rest: $resource(
  281 + '/sr1fc/:id',
  282 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  283 + {
  284 + list: {
  285 + method: 'GET',
  286 + params: {
  287 + page: 0
  288 + }
  289 + },
  290 + get: {
  291 + method: 'GET'
  292 + },
  293 + save: {
  294 + method: 'POST'
  295 + },
  296 + delete: {
  297 + method: 'DELETE'
  298 + }
  299 + }
  300 + )
  301 + };
  302 +}]);
  303 +
  304 +// 时刻表管理service
  305 +angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) {
  306 + return {
  307 + rest: $resource(
  308 + '/tic/:id',
  309 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  310 + {
  311 + list: {
  312 + method: 'GET',
  313 + params: {
  314 + page: 0,
  315 + isCancel_eq: 'false'
  316 + }
  317 + },
  318 + get: {
  319 + method: 'GET'
  320 + },
  321 + save: {
  322 + method: 'POST'
  323 + },
  324 + delete: {
  325 + method: 'DELETE'
  326 + }
  327 + }
  328 + ),
  329 + validate: $resource(
  330 + '/tic/validate/:type',
  331 + {},
  332 + {
  333 + ttinfoname: {
  334 + method: 'GET'
  335 + }
  336 + }
  337 + )
  338 + };
  339 +}]);
  340 +// 时刻表明细管理service
  341 +angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {
  342 + return {
  343 + rest: $resource(
  344 + '/tidc/:id',
  345 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  346 + {
  347 + get: {
  348 + method: 'GET'
  349 + },
  350 + save: {
  351 + method: 'POST'
  352 + }
  353 + }
  354 + ),
  355 + edit: $resource(
  356 + '/tidc/edit/:xlid/:ttid',
  357 + {},
  358 + {
  359 + list: {
  360 + method: 'GET'
  361 + }
  362 + }
  363 + )
  364 + };
  365 +}]);
  366 +
  367 +
  368 +
  369 +// 排班计划管理service
  370 +angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) {
  371 + return {
  372 + rest : $resource(
  373 + '/spc/:id',
  374 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  375 + {
  376 + list: {
  377 + method: 'GET',
  378 + params: {
  379 + page: 0
  380 + }
  381 + },
  382 + get: {
  383 + method: 'GET'
  384 + },
  385 + save: {
  386 + method: 'POST'
  387 + },
  388 + delete: {
  389 + method: 'DELETE'
  390 + }
  391 + }
  392 + ),
  393 + groupinfo : $resource(
  394 + '/spc/groupinfos/:xlid/:sdate',
  395 + {},
  396 + {
  397 + list: {
  398 + method: 'GET',
  399 + isArray: true
  400 + }
  401 + }
  402 + )
  403 + };
  404 +}]);
  405 +
  406 +// 排班计划明细管理service
  407 +angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) {
  408 + return {
  409 + rest : $resource(
  410 + '/spic/:id',
  411 + {order: 'scheduleDate,lp,fcno', direction: 'ASC', id: '@id_route'},
  412 + {
  413 + list: {
  414 + method: 'GET',
  415 + params: {
  416 + page: 0
  417 + }
  418 + },
  419 + get: {
  420 + method: 'GET'
  421 + },
  422 + save: {
  423 + method: 'POST'
  424 + }
  425 + }
  426 + )
  427 + };
  428 +}]);
  429 +
  430 +// 线路运营统计service
  431 +angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {
  432 + return $resource(
  433 + '/bic/:id',
  434 + {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询
  435 + {
  436 + list: {
  437 + method: 'GET',
  438 + params: {
  439 + page: 0
  440 + }
  441 + }
  442 + }
  443 + );
  444 +}]);
  445 +
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
1 -// ui route 配置  
2 -  
3 -/** 配置所有模块页面route */  
4 -ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {  
5 - // 默认路由  
6 - //$urlRouterProvider.otherwise('/busConfig.html');  
7 -  
8 - $stateProvider  
9 - // 车辆基础信息模块配置  
10 - .state("busInfoManage", {  
11 - url: '/busInfoManage',  
12 - views: {  
13 - "": {  
14 - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html'  
15 - },  
16 - "busInfoManage_list@busInfoManage": {  
17 - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html'  
18 - }  
19 - },  
20 -  
21 - resolve: {  
22 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
23 - return $ocLazyLoad.load({  
24 - name: 'busInfoManage_module',  
25 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
26 - files: [  
27 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
28 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
29 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
30 - "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"  
31 - ]  
32 - });  
33 - }]  
34 - }  
35 - })  
36 - .state("busInfoManage_form", {  
37 - url: '/busInfoManage_form',  
38 - views: {  
39 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'}  
40 - },  
41 - resolve: {  
42 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
43 - return $ocLazyLoad.load({  
44 - name: 'busInfoManage_form_module',  
45 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
46 - files: [  
47 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
48 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
49 - "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"  
50 - ]  
51 - });  
52 - }]  
53 - }  
54 - })  
55 - .state("busInfoManage_edit", {  
56 - url: '/busInfoManage_edit/:id',  
57 - views: {  
58 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'}  
59 - },  
60 - resolve: {  
61 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
62 - return $ocLazyLoad.load({  
63 - name: 'busInfoManage_edit_module',  
64 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
65 - files: [  
66 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
67 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
68 - "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"  
69 - ]  
70 - });  
71 - }]  
72 - }  
73 - })  
74 - .state("busInfoManage_detail", {  
75 - url: '/busInfoManage_detail/:id',  
76 - views: {  
77 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'}  
78 - },  
79 - resolve: {  
80 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
81 - return $ocLazyLoad.load({  
82 - name: 'busInfoManage_detail_module',  
83 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
84 - files: [  
85 - "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"  
86 - ]  
87 - });  
88 - }]  
89 - }  
90 - })  
91 -  
92 - // 人员基础信息模块配置  
93 - .state("employeeInfoManage", {  
94 - url: '/employeeInfoManage',  
95 - views: {  
96 - "": {  
97 - templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html'  
98 - },  
99 - "employeeInfoManage_list@employeeInfoManage": {  
100 - templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html'  
101 - }  
102 - },  
103 -  
104 - resolve: {  
105 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
106 - return $ocLazyLoad.load({  
107 - name: 'employeeInfoManage_module',  
108 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
109 - files: [  
110 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
111 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
112 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
113 - "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"  
114 - ]  
115 - });  
116 - }]  
117 - }  
118 - })  
119 - .state("employeeInfoManage_form", {  
120 - url: '/employeeInfoManage_form',  
121 - views: {  
122 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html'}  
123 - },  
124 - resolve: {  
125 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
126 - return $ocLazyLoad.load({  
127 - name: 'employeeInfoManage_form_module',  
128 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
129 - files: [  
130 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
131 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
132 - "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"  
133 - ]  
134 - });  
135 - }]  
136 - }  
137 - })  
138 - .state("employeeInfoManage_edit", {  
139 - url: '/employeeInfoManage_edit/:id',  
140 - views: {  
141 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html'}  
142 - },  
143 - resolve: {  
144 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
145 - return $ocLazyLoad.load({  
146 - name: 'employeeInfoManage_edit_module',  
147 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
148 - files: [  
149 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
150 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
151 - "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"  
152 - ]  
153 - });  
154 - }]  
155 - }  
156 - })  
157 - .state("employeeInfoManage_detail", {  
158 - url: '/employeeInfoManage_detail/:id',  
159 - views: {  
160 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html'}  
161 - },  
162 - resolve: {  
163 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
164 - return $ocLazyLoad.load({  
165 - name: 'employeeInfoManage_detail_module',  
166 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
167 - files: [  
168 - "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"  
169 - ]  
170 - });  
171 - }]  
172 - }  
173 - })  
174 -  
175 - // 车辆设备信息模块配置  
176 - .state("deviceInfoManage", {  
177 - url: '/deviceInfoManage',  
178 - views: {  
179 - "": {  
180 - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html'  
181 - },  
182 - "deviceInfoManage_list@deviceInfoManage": {  
183 - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html'  
184 - }  
185 - },  
186 -  
187 - resolve: {  
188 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
189 - return $ocLazyLoad.load({  
190 - name: 'deviceInfoManage_module',  
191 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
192 - files: [  
193 - "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"  
194 - ]  
195 - });  
196 - }]  
197 - }  
198 - })  
199 - .state("deviceInfoManage_form", {  
200 - url: '/deviceInfoManage_form',  
201 - views: {  
202 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'}  
203 - },  
204 - resolve: {  
205 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
206 - return $ocLazyLoad.load({  
207 - name: 'deviceInfoManage_form_module',  
208 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
209 - files: [  
210 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
211 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
212 - "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"  
213 - ]  
214 - });  
215 - }]  
216 - }  
217 - })  
218 - .state("deviceInfoManage_edit", {  
219 - url: '/deviceInfoManage_edit/:id',  
220 - views: {  
221 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'}  
222 - },  
223 - resolve: {  
224 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
225 - return $ocLazyLoad.load({  
226 - name: 'deviceInfoManage_edit_module',  
227 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
228 - files: [  
229 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
230 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
231 - "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"  
232 - ]  
233 - });  
234 - }]  
235 - }  
236 - })  
237 - .state("deviceInfoManage_detail", {  
238 - url: '/deviceInfoManage_detail/:id',  
239 - views: {  
240 - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'}  
241 - },  
242 - resolve: {  
243 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
244 - return $ocLazyLoad.load({  
245 - name: 'deviceInfoManage_detail_module',  
246 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
247 - files: [  
248 - "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"  
249 - ]  
250 - });  
251 - }]  
252 - }  
253 - })  
254 -  
255 - // 车辆配置模块  
256 - .state("busConfig", {  
257 - url: '/busConfig',  
258 - views: {  
259 - "": {  
260 - templateUrl: 'pages/scheduleApp/module/core/busConfig/index.html'  
261 - },  
262 - "busConfig_list@busConfig": {  
263 - templateUrl: 'pages/scheduleApp/module/core/busConfig/list.html'  
264 - }  
265 - },  
266 -  
267 - resolve: {  
268 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
269 - return $ocLazyLoad.load({  
270 - name: 'busConfig_module',  
271 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
272 - files: [  
273 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
274 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
275 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
276 - "pages/scheduleApp/module/core/busConfig/busConfig.js"  
277 - ]  
278 - });  
279 - }]  
280 - }  
281 - })  
282 - .state("busConfig_form", {  
283 - url: '/busConfig_form',  
284 - views: {  
285 - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/form.html'}  
286 - },  
287 - resolve: {  
288 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
289 - return $ocLazyLoad.load({  
290 - name: 'busConfig_form_module',  
291 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
292 - files: [  
293 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
294 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
295 - "pages/scheduleApp/module/core/busConfig/busConfig.js"  
296 - ]  
297 - });  
298 - }]  
299 - }  
300 - })  
301 - .state("busConfig_edit", {  
302 - url: '/busConfig_edit/:id',  
303 - views: {  
304 - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/edit.html'}  
305 - },  
306 - resolve: {  
307 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
308 - return $ocLazyLoad.load({  
309 - name: 'busConfig_edit_module',  
310 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
311 - files: [  
312 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
313 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
314 - "pages/scheduleApp/module/core/busConfig/busConfig.js"  
315 - ]  
316 - });  
317 - }]  
318 - }  
319 - })  
320 - .state("busConfig_detail", {  
321 - url: '/busConfig_detail/:id',  
322 - views: {  
323 - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/detail.html'}  
324 - },  
325 - resolve: {  
326 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
327 - return $ocLazyLoad.load({  
328 - name: 'busConfig_detail_module',  
329 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
330 - files: [  
331 - "pages/scheduleApp/module/core/busConfig/busConfig.js"  
332 - ]  
333 - });  
334 - }]  
335 - }  
336 - })  
337 -  
338 - // 人员配置模块  
339 - .state("employeeConfig", {  
340 - url: '/employeeConfig',  
341 - views: {  
342 - "": {  
343 - templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html'  
344 - },  
345 - "employeeConfig_list@employeeConfig": {  
346 - templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html'  
347 - }  
348 - },  
349 -  
350 - resolve: {  
351 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
352 - return $ocLazyLoad.load({  
353 - name: 'employeeConfig_module',  
354 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
355 - files: [  
356 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
357 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
358 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
359 - "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"  
360 - ]  
361 - });  
362 - }]  
363 - }  
364 - })  
365 - .state("employeeConfig_form", {  
366 - url: '/employeeConfig_form',  
367 - views: {  
368 - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/form.html'}  
369 - },  
370 - resolve: {  
371 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
372 - return $ocLazyLoad.load({  
373 - name: 'employeeConfig_form_module',  
374 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
375 - files: [  
376 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
377 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
378 - "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"  
379 - ]  
380 - });  
381 - }]  
382 - }  
383 - })  
384 - .state("employeeConfig_edit", {  
385 - url: '/employeeConfig_edit/:id',  
386 - views: {  
387 - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/edit.html'}  
388 - },  
389 - resolve: {  
390 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
391 - return $ocLazyLoad.load({  
392 - name: 'employeeConfig_edit_module',  
393 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
394 - files: [  
395 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
396 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
397 - "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"  
398 - ]  
399 - });  
400 - }]  
401 - }  
402 - })  
403 - .state("employeeConfig_detail", {  
404 - url: '/employeeConfig_detail/:id',  
405 - views: {  
406 - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/detail.html'}  
407 - },  
408 - resolve: {  
409 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
410 - return $ocLazyLoad.load({  
411 - name: 'employeeConfig_detail_module',  
412 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
413 - files: [  
414 - "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"  
415 - ]  
416 - });  
417 - }]  
418 - }  
419 - })  
420 -  
421 - // 路牌管理  
422 - .state("guideboardManage", {  
423 - url: '/guideboardManage',  
424 - views: {  
425 - "": {  
426 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'  
427 - },  
428 - "guideboardManage_list@guideboardManage": {  
429 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'  
430 - }  
431 - },  
432 -  
433 - resolve: {  
434 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
435 - return $ocLazyLoad.load({  
436 - name: 'guideboardManage_module',  
437 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
438 - files: [  
439 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
440 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
441 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
442 - "pages/scheduleApp/module/core/guideboardManage/guideboardManage.js"  
443 - ]  
444 - });  
445 - }]  
446 - }  
447 - })  
448 - .state("guideboardManage_detail", {  
449 - url: '/guideboardManage_detail/:id',  
450 - views: {  
451 - "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}  
452 - },  
453 - resolve: {  
454 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
455 - return $ocLazyLoad.load({  
456 - name: 'guideboardManage_detail_module',  
457 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
458 - files: [  
459 - "pages/scheduleApp/module/core/guideboardManage/guideboardManage.js"  
460 - ]  
461 - });  
462 - }]  
463 - }  
464 - })  
465 -  
466 -  
467 - // 时刻表管理  
468 - .state("timeTableManage", {  
469 - url: '/timeTableManage',  
470 - views: {  
471 - "": {  
472 - templateUrl: 'pages/scheduleApp/module/core/timeTableManage/index.html'  
473 - },  
474 - "timeTableManage_list@timeTableManage": {  
475 - templateUrl: 'pages/scheduleApp/module/core/timeTableManage/list.html'  
476 - }  
477 - },  
478 -  
479 - resolve: {  
480 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
481 - return $ocLazyLoad.load({  
482 - name: 'timeTableManage_module',  
483 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
484 - files: [  
485 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
486 - "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"  
487 - ]  
488 - });  
489 - }]  
490 - }  
491 - })  
492 - .state("timeTableManage_form", {  
493 - url: '/timeTableManage_form',  
494 - views: {  
495 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/form.html'}  
496 - },  
497 - resolve: {  
498 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
499 - return $ocLazyLoad.load({  
500 - name: 'timeTableManage_form_module',  
501 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
502 - files: [  
503 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
504 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
505 - "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"  
506 - ]  
507 - });  
508 - }]  
509 - }  
510 - })  
511 - .state("timeTableManage_edit", {  
512 - url: '/timeTableManage_edit/:id',  
513 - views: {  
514 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/edit.html'}  
515 - },  
516 - resolve: {  
517 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
518 - return $ocLazyLoad.load({  
519 - name: 'timeTableManage_edit_module',  
520 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
521 - files: [  
522 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
523 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
524 - "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"  
525 - ]  
526 - });  
527 - }]  
528 - }  
529 - })  
530 - .state("timeTableManage_detail", {  
531 - url: '/timeTableManage_detail/:id',  
532 - views: {  
533 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail.html'}  
534 - },  
535 - resolve: {  
536 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
537 - return $ocLazyLoad.load({  
538 - name: 'timeTableManage_detail_module',  
539 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
540 - files: [  
541 - "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"  
542 - ]  
543 - });  
544 - }]  
545 - }  
546 - })  
547 - .state("timeTableDetailInfoManage", {  
548 - url: '/timeTableDetailInfoManage/:xlid/:ttid/:xlname/:ttname',  
549 - views: {  
550 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info.html'}  
551 - },  
552 - resolve: {  
553 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
554 - return $ocLazyLoad.load({  
555 - name: 'timeTableDetailInfoManage_module',  
556 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
557 - files: [  
558 - "pages/scheduleApp/module/core/timeTableManage/timeTableDetailManage.js"  
559 - ]  
560 - });  
561 - }]  
562 - }  
563 - })  
564 - .state("timeTableDetailInfoManage_detail_edit", {  
565 - url: '/timeTableDetailInfoManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname',  
566 - views: {  
567 - "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info_edit.html'}  
568 - },  
569 - resolve: {  
570 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
571 - return $ocLazyLoad.load({  
572 - name: 'timeTableDetailInfoManage_module',  
573 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
574 - files: [  
575 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
576 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
577 - "pages/scheduleApp/module/core/timeTableManage/timeTableDetailManage.js"  
578 - ]  
579 - });  
580 - }]  
581 - }  
582 - })  
583 -  
584 - // 排班规则管理模块  
585 - .state("scheduleRuleManage", {  
586 - url: '/scheduleRuleManage',  
587 - views: {  
588 - "": {  
589 - templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/index.html'  
590 - },  
591 - "scheduleRuleManage_list@scheduleRuleManage": {  
592 - templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/list.html'  
593 - }  
594 - },  
595 -  
596 - resolve: {  
597 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
598 - return $ocLazyLoad.load({  
599 - name: 'scheduleRuleManage_module',  
600 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
601 - files: [  
602 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
603 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
604 - "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"  
605 - ]  
606 - });  
607 - }]  
608 - }  
609 - })  
610 - .state("scheduleRuleManage_form", {  
611 - url: '/scheduleRuleManage_form',  
612 - views: {  
613 - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/form.html'}  
614 - },  
615 - resolve: {  
616 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
617 - return $ocLazyLoad.load({  
618 - name: 'scheduleRuleManage_form_module',  
619 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
620 - files: [  
621 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
622 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
623 - "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"  
624 - ]  
625 - });  
626 - }]  
627 - }  
628 - })  
629 - .state("scheduleRuleManage_edit", {  
630 - url: '/scheduleRuleManage_edit/:id',  
631 - views: {  
632 - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/edit.html'}  
633 - },  
634 - resolve: {  
635 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
636 - return $ocLazyLoad.load({  
637 - name: 'scheduleRuleManage_edit_module',  
638 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
639 - files: [  
640 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
641 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
642 - "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"  
643 - ]  
644 - });  
645 - }]  
646 - }  
647 - })  
648 - .state("scheduleRuleManage_detail", {  
649 - url: '/scheduleRuleManage_detail/:id',  
650 - views: {  
651 - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/detail.html'}  
652 - },  
653 - resolve: {  
654 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
655 - return $ocLazyLoad.load({  
656 - name: 'scheduleRuleManage_detail_module',  
657 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
658 - files: [  
659 - "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"  
660 - ]  
661 - });  
662 - }]  
663 - }  
664 - })  
665 -  
666 - // 排班计划管理模块  
667 - .state("schedulePlanManage", {  
668 - url: '/schedulePlanManage',  
669 - views: {  
670 - "": {  
671 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index.html'  
672 - },  
673 - "schedulePlanManage_list@schedulePlanManage": {  
674 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list.html'  
675 - }  
676 - },  
677 -  
678 - resolve: {  
679 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
680 - return $ocLazyLoad.load({  
681 - name: 'schedulePlanManage_module',  
682 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
683 - files: [  
684 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
685 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
686 - "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js"  
687 - ]  
688 - });  
689 - }]  
690 - }  
691 - })  
692 - .state("schedulePlanManage_form", {  
693 - url: '/schedulePlanManage_form',  
694 - views: {  
695 - "": {  
696 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/form.html'  
697 - }  
698 - },  
699 -  
700 - resolve: {  
701 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
702 - return $ocLazyLoad.load({  
703 - name: 'schedulePlanManage_form_module',  
704 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
705 - files: [  
706 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
707 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
708 - "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js"  
709 - ]  
710 - });  
711 - }]  
712 - }  
713 - })  
714 -  
715 - // 排班计划明细管理模块  
716 - .state("schedulePlanInfoManage", {  
717 - url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime',  
718 - views: {  
719 - "": {  
720 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index_info.html'  
721 - },  
722 - "schedulePlanInfoManage_list@schedulePlanInfoManage": {  
723 - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list_info.html'  
724 - }  
725 - },  
726 -  
727 - resolve: {  
728 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
729 - return $ocLazyLoad.load({  
730 - name: 'schedulePlanInfoManage_module',  
731 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
732 - files: [  
733 - "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanInfoManage.js"  
734 - ]  
735 - });  
736 - }]  
737 - }  
738 - })  
739 -  
740 - // 线路运营概览模块  
741 - .state("busLineInfoStat", {  
742 - url: '/busLineInfoStat',  
743 - views: {  
744 - "": {  
745 - templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/index.html'  
746 - },  
747 - "busLineInfoStat_list@busLineInfoStat": {  
748 - templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/list.html'  
749 - }  
750 - },  
751 -  
752 - resolve: {  
753 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
754 - return $ocLazyLoad.load({  
755 - name: 'busLineInfoStat_module',  
756 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
757 - files: [  
758 - "pages/scheduleApp/module/core/busLineInfoStat/busLineInfoStat.js"  
759 - ]  
760 - });  
761 - }]  
762 - }  
763 - })  
764 -  
765 -  
766 -  
767 -  
768 -  
769 - // TODO:  
770 -  
771 - ; 1 +// ui route 配置
  2 +
  3 +/** 配置所有模块页面route */
  4 +ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {
  5 + // 默认路由
  6 + //$urlRouterProvider.otherwise('/busConfig.html');
  7 +
  8 + $stateProvider
  9 + // 车辆基础信息模块配置
  10 + .state("busInfoManage", {
  11 + url: '/busInfoManage',
  12 + views: {
  13 + "": {
  14 + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html'
  15 + },
  16 + "busInfoManage_list@busInfoManage": {
  17 + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html'
  18 + }
  19 + },
  20 +
  21 + resolve: {
  22 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  23 + return $ocLazyLoad.load({
  24 + name: 'busInfoManage_module',
  25 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  26 + files: [
  27 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  28 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  29 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  30 + "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"
  31 + ]
  32 + });
  33 + }]
  34 + }
  35 + })
  36 + .state("busInfoManage_form", {
  37 + url: '/busInfoManage_form',
  38 + views: {
  39 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'}
  40 + },
  41 + resolve: {
  42 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  43 + return $ocLazyLoad.load({
  44 + name: 'busInfoManage_form_module',
  45 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  46 + files: [
  47 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  48 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  49 + "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"
  50 + ]
  51 + });
  52 + }]
  53 + }
  54 + })
  55 + .state("busInfoManage_edit", {
  56 + url: '/busInfoManage_edit/:id',
  57 + views: {
  58 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'}
  59 + },
  60 + resolve: {
  61 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  62 + return $ocLazyLoad.load({
  63 + name: 'busInfoManage_edit_module',
  64 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  65 + files: [
  66 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  67 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  68 + "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"
  69 + ]
  70 + });
  71 + }]
  72 + }
  73 + })
  74 + .state("busInfoManage_detail", {
  75 + url: '/busInfoManage_detail/:id',
  76 + views: {
  77 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'}
  78 + },
  79 + resolve: {
  80 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  81 + return $ocLazyLoad.load({
  82 + name: 'busInfoManage_detail_module',
  83 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  84 + files: [
  85 + "pages/scheduleApp/module/basicInfo/busInfoManage/busInfoManage.js"
  86 + ]
  87 + });
  88 + }]
  89 + }
  90 + })
  91 +
  92 + // 人员基础信息模块配置
  93 + .state("employeeInfoManage", {
  94 + url: '/employeeInfoManage',
  95 + views: {
  96 + "": {
  97 + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html'
  98 + },
  99 + "employeeInfoManage_list@employeeInfoManage": {
  100 + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html'
  101 + }
  102 + },
  103 +
  104 + resolve: {
  105 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  106 + return $ocLazyLoad.load({
  107 + name: 'employeeInfoManage_module',
  108 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  109 + files: [
  110 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  111 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  112 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  113 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"
  114 + ]
  115 + });
  116 + }]
  117 + }
  118 + })
  119 + .state("employeeInfoManage_form", {
  120 + url: '/employeeInfoManage_form',
  121 + views: {
  122 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html'}
  123 + },
  124 + resolve: {
  125 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  126 + return $ocLazyLoad.load({
  127 + name: 'employeeInfoManage_form_module',
  128 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  129 + files: [
  130 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  131 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  132 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"
  133 + ]
  134 + });
  135 + }]
  136 + }
  137 + })
  138 + .state("employeeInfoManage_edit", {
  139 + url: '/employeeInfoManage_edit/:id',
  140 + views: {
  141 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html'}
  142 + },
  143 + resolve: {
  144 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  145 + return $ocLazyLoad.load({
  146 + name: 'employeeInfoManage_edit_module',
  147 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  148 + files: [
  149 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  150 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  151 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"
  152 + ]
  153 + });
  154 + }]
  155 + }
  156 + })
  157 + .state("employeeInfoManage_detail", {
  158 + url: '/employeeInfoManage_detail/:id',
  159 + views: {
  160 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html'}
  161 + },
  162 + resolve: {
  163 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  164 + return $ocLazyLoad.load({
  165 + name: 'employeeInfoManage_detail_module',
  166 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  167 + files: [
  168 + "pages/scheduleApp/module/basicInfo/employeeInfoManage/employeeInfoManage.js"
  169 + ]
  170 + });
  171 + }]
  172 + }
  173 + })
  174 +
  175 + // 车辆设备信息模块配置
  176 + .state("deviceInfoManage", {
  177 + url: '/deviceInfoManage',
  178 + views: {
  179 + "": {
  180 + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html'
  181 + },
  182 + "deviceInfoManage_list@deviceInfoManage": {
  183 + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html'
  184 + }
  185 + },
  186 +
  187 + resolve: {
  188 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  189 + return $ocLazyLoad.load({
  190 + name: 'deviceInfoManage_module',
  191 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  192 + files: [
  193 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  194 + ]
  195 + });
  196 + }]
  197 + }
  198 + })
  199 + .state("deviceInfoManage_form", {
  200 + url: '/deviceInfoManage_form',
  201 + views: {
  202 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'}
  203 + },
  204 + resolve: {
  205 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  206 + return $ocLazyLoad.load({
  207 + name: 'deviceInfoManage_form_module',
  208 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  209 + files: [
  210 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  211 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  212 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  213 + ]
  214 + });
  215 + }]
  216 + }
  217 + })
  218 + .state("deviceInfoManage_edit", {
  219 + url: '/deviceInfoManage_edit/:id',
  220 + views: {
  221 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'}
  222 + },
  223 + resolve: {
  224 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  225 + return $ocLazyLoad.load({
  226 + name: 'deviceInfoManage_edit_module',
  227 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  228 + files: [
  229 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  230 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  231 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  232 + ]
  233 + });
  234 + }]
  235 + }
  236 + })
  237 + .state("deviceInfoManage_detail", {
  238 + url: '/deviceInfoManage_detail/:id',
  239 + views: {
  240 + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'}
  241 + },
  242 + resolve: {
  243 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  244 + return $ocLazyLoad.load({
  245 + name: 'deviceInfoManage_detail_module',
  246 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  247 + files: [
  248 + "pages/scheduleApp/module/basicInfo/deviceInfoManage/deviceInfoManage.js"
  249 + ]
  250 + });
  251 + }]
  252 + }
  253 + })
  254 +
  255 + // 车辆配置模块
  256 + .state("busConfig", {
  257 + url: '/busConfig',
  258 + views: {
  259 + "": {
  260 + templateUrl: 'pages/scheduleApp/module/core/busConfig/index.html'
  261 + },
  262 + "busConfig_list@busConfig": {
  263 + templateUrl: 'pages/scheduleApp/module/core/busConfig/list.html'
  264 + }
  265 + },
  266 +
  267 + resolve: {
  268 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  269 + return $ocLazyLoad.load({
  270 + name: 'busConfig_module',
  271 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  272 + files: [
  273 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  274 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  275 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  276 + "pages/scheduleApp/module/core/busConfig/busConfig.js"
  277 + ]
  278 + });
  279 + }]
  280 + }
  281 + })
  282 + .state("busConfig_form", {
  283 + url: '/busConfig_form',
  284 + views: {
  285 + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/form.html'}
  286 + },
  287 + resolve: {
  288 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  289 + return $ocLazyLoad.load({
  290 + name: 'busConfig_form_module',
  291 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  292 + files: [
  293 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  294 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  295 + "pages/scheduleApp/module/core/busConfig/busConfig.js"
  296 + ]
  297 + });
  298 + }]
  299 + }
  300 + })
  301 + .state("busConfig_edit", {
  302 + url: '/busConfig_edit/:id',
  303 + views: {
  304 + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/edit.html'}
  305 + },
  306 + resolve: {
  307 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  308 + return $ocLazyLoad.load({
  309 + name: 'busConfig_edit_module',
  310 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  311 + files: [
  312 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  313 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  314 + "pages/scheduleApp/module/core/busConfig/busConfig.js"
  315 + ]
  316 + });
  317 + }]
  318 + }
  319 + })
  320 + .state("busConfig_detail", {
  321 + url: '/busConfig_detail/:id',
  322 + views: {
  323 + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/detail.html'}
  324 + },
  325 + resolve: {
  326 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  327 + return $ocLazyLoad.load({
  328 + name: 'busConfig_detail_module',
  329 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  330 + files: [
  331 + "pages/scheduleApp/module/core/busConfig/busConfig.js"
  332 + ]
  333 + });
  334 + }]
  335 + }
  336 + })
  337 +
  338 + // 人员配置模块
  339 + .state("employeeConfig", {
  340 + url: '/employeeConfig',
  341 + views: {
  342 + "": {
  343 + templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html'
  344 + },
  345 + "employeeConfig_list@employeeConfig": {
  346 + templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html'
  347 + }
  348 + },
  349 +
  350 + resolve: {
  351 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  352 + return $ocLazyLoad.load({
  353 + name: 'employeeConfig_module',
  354 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  355 + files: [
  356 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  357 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  358 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  359 + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"
  360 + ]
  361 + });
  362 + }]
  363 + }
  364 + })
  365 + .state("employeeConfig_form", {
  366 + url: '/employeeConfig_form',
  367 + views: {
  368 + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/form.html'}
  369 + },
  370 + resolve: {
  371 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  372 + return $ocLazyLoad.load({
  373 + name: 'employeeConfig_form_module',
  374 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  375 + files: [
  376 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  377 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  378 + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"
  379 + ]
  380 + });
  381 + }]
  382 + }
  383 + })
  384 + .state("employeeConfig_edit", {
  385 + url: '/employeeConfig_edit/:id',
  386 + views: {
  387 + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/edit.html'}
  388 + },
  389 + resolve: {
  390 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  391 + return $ocLazyLoad.load({
  392 + name: 'employeeConfig_edit_module',
  393 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  394 + files: [
  395 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  396 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  397 + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"
  398 + ]
  399 + });
  400 + }]
  401 + }
  402 + })
  403 + .state("employeeConfig_detail", {
  404 + url: '/employeeConfig_detail/:id',
  405 + views: {
  406 + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/detail.html'}
  407 + },
  408 + resolve: {
  409 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  410 + return $ocLazyLoad.load({
  411 + name: 'employeeConfig_detail_module',
  412 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  413 + files: [
  414 + "pages/scheduleApp/module/core/employeeConfig/employeeConfig.js"
  415 + ]
  416 + });
  417 + }]
  418 + }
  419 + })
  420 +
  421 + // 路牌管理
  422 + .state("guideboardManage", {
  423 + url: '/guideboardManage',
  424 + views: {
  425 + "": {
  426 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'
  427 + },
  428 + "guideboardManage_list@guideboardManage": {
  429 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'
  430 + }
  431 + },
  432 +
  433 + resolve: {
  434 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  435 + return $ocLazyLoad.load({
  436 + name: 'guideboardManage_module',
  437 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  438 + files: [
  439 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  440 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  441 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  442 + "pages/scheduleApp/module/core/guideboardManage/guideboardManage.js"
  443 + ]
  444 + });
  445 + }]
  446 + }
  447 + })
  448 + .state("guideboardManage_detail", {
  449 + url: '/guideboardManage_detail/:id',
  450 + views: {
  451 + "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}
  452 + },
  453 + resolve: {
  454 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  455 + return $ocLazyLoad.load({
  456 + name: 'guideboardManage_detail_module',
  457 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  458 + files: [
  459 + "pages/scheduleApp/module/core/guideboardManage/guideboardManage.js"
  460 + ]
  461 + });
  462 + }]
  463 + }
  464 + })
  465 +
  466 +
  467 + // 时刻表管理
  468 + .state("timeTableManage", {
  469 + url: '/timeTableManage',
  470 + views: {
  471 + "": {
  472 + templateUrl: 'pages/scheduleApp/module/core/timeTableManage/index.html'
  473 + },
  474 + "timeTableManage_list@timeTableManage": {
  475 + templateUrl: 'pages/scheduleApp/module/core/timeTableManage/list.html'
  476 + }
  477 + },
  478 +
  479 + resolve: {
  480 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  481 + return $ocLazyLoad.load({
  482 + name: 'timeTableManage_module',
  483 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  484 + files: [
  485 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  486 + "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"
  487 + ]
  488 + });
  489 + }]
  490 + }
  491 + })
  492 + .state("timeTableManage_form", {
  493 + url: '/timeTableManage_form',
  494 + views: {
  495 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/form.html'}
  496 + },
  497 + resolve: {
  498 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  499 + return $ocLazyLoad.load({
  500 + name: 'timeTableManage_form_module',
  501 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  502 + files: [
  503 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  504 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  505 + "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"
  506 + ]
  507 + });
  508 + }]
  509 + }
  510 + })
  511 + .state("timeTableManage_edit", {
  512 + url: '/timeTableManage_edit/:id',
  513 + views: {
  514 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/edit.html'}
  515 + },
  516 + resolve: {
  517 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  518 + return $ocLazyLoad.load({
  519 + name: 'timeTableManage_edit_module',
  520 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  521 + files: [
  522 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  523 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  524 + "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"
  525 + ]
  526 + });
  527 + }]
  528 + }
  529 + })
  530 + .state("timeTableManage_detail", {
  531 + url: '/timeTableManage_detail/:id',
  532 + views: {
  533 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail.html'}
  534 + },
  535 + resolve: {
  536 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  537 + return $ocLazyLoad.load({
  538 + name: 'timeTableManage_detail_module',
  539 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  540 + files: [
  541 + "pages/scheduleApp/module/core/timeTableManage/timeTableManage.js"
  542 + ]
  543 + });
  544 + }]
  545 + }
  546 + })
  547 + .state("timeTableDetailInfoManage", {
  548 + url: '/timeTableDetailInfoManage/:xlid/:ttid/:xlname/:ttname',
  549 + views: {
  550 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info.html'}
  551 + },
  552 + resolve: {
  553 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  554 + return $ocLazyLoad.load({
  555 + name: 'timeTableDetailInfoManage_module',
  556 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  557 + files: [
  558 + "pages/scheduleApp/module/core/timeTableManage/timeTableDetailManage.js"
  559 + ]
  560 + });
  561 + }]
  562 + }
  563 + })
  564 + .state("timeTableDetailInfoManage_detail_edit", {
  565 + url: '/timeTableDetailInfoManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname',
  566 + views: {
  567 + "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info_edit.html'}
  568 + },
  569 + resolve: {
  570 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  571 + return $ocLazyLoad.load({
  572 + name: 'timeTableDetailInfoManage_module',
  573 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  574 + files: [
  575 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  576 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  577 + "pages/scheduleApp/module/core/timeTableManage/timeTableDetailManage.js"
  578 + ]
  579 + });
  580 + }]
  581 + }
  582 + })
  583 +
  584 + // 排班规则管理模块
  585 + .state("scheduleRuleManage", {
  586 + url: '/scheduleRuleManage',
  587 + views: {
  588 + "": {
  589 + templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/index.html'
  590 + },
  591 + "scheduleRuleManage_list@scheduleRuleManage": {
  592 + templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/list.html'
  593 + }
  594 + },
  595 +
  596 + resolve: {
  597 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  598 + return $ocLazyLoad.load({
  599 + name: 'scheduleRuleManage_module',
  600 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  601 + files: [
  602 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  603 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  604 + "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"
  605 + ]
  606 + });
  607 + }]
  608 + }
  609 + })
  610 + .state("scheduleRuleManage_form", {
  611 + url: '/scheduleRuleManage_form',
  612 + views: {
  613 + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/form.html'}
  614 + },
  615 + resolve: {
  616 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  617 + return $ocLazyLoad.load({
  618 + name: 'scheduleRuleManage_form_module',
  619 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  620 + files: [
  621 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  622 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  623 + "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"
  624 + ]
  625 + });
  626 + }]
  627 + }
  628 + })
  629 + .state("scheduleRuleManage_edit", {
  630 + url: '/scheduleRuleManage_edit/:id',
  631 + views: {
  632 + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/edit.html'}
  633 + },
  634 + resolve: {
  635 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  636 + return $ocLazyLoad.load({
  637 + name: 'scheduleRuleManage_edit_module',
  638 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  639 + files: [
  640 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  641 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  642 + "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"
  643 + ]
  644 + });
  645 + }]
  646 + }
  647 + })
  648 + .state("scheduleRuleManage_detail", {
  649 + url: '/scheduleRuleManage_detail/:id',
  650 + views: {
  651 + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/detail.html'}
  652 + },
  653 + resolve: {
  654 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  655 + return $ocLazyLoad.load({
  656 + name: 'scheduleRuleManage_detail_module',
  657 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  658 + files: [
  659 + "pages/scheduleApp/module/core/scheduleRuleManage/scheduleRuleManage.js"
  660 + ]
  661 + });
  662 + }]
  663 + }
  664 + })
  665 +
  666 + // 排班计划管理模块
  667 + .state("schedulePlanManage", {
  668 + url: '/schedulePlanManage',
  669 + views: {
  670 + "": {
  671 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index.html'
  672 + },
  673 + "schedulePlanManage_list@schedulePlanManage": {
  674 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list.html'
  675 + }
  676 + },
  677 +
  678 + resolve: {
  679 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  680 + return $ocLazyLoad.load({
  681 + name: 'schedulePlanManage_module',
  682 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  683 + files: [
  684 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  685 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  686 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js"
  687 + ]
  688 + });
  689 + }]
  690 + }
  691 + })
  692 + .state("schedulePlanManage_form", {
  693 + url: '/schedulePlanManage_form',
  694 + views: {
  695 + "": {
  696 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/form.html'
  697 + }
  698 + },
  699 +
  700 + resolve: {
  701 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  702 + return $ocLazyLoad.load({
  703 + name: 'schedulePlanManage_form_module',
  704 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  705 + files: [
  706 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  707 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  708 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanManage.js"
  709 + ]
  710 + });
  711 + }]
  712 + }
  713 + })
  714 +
  715 + // 排班计划明细管理模块
  716 + .state("schedulePlanInfoManage", {
  717 + url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime',
  718 + views: {
  719 + "": {
  720 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index_info.html'
  721 + },
  722 + "schedulePlanInfoManage_list@schedulePlanInfoManage": {
  723 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list_info.html'
  724 + }
  725 + },
  726 +
  727 + resolve: {
  728 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  729 + return $ocLazyLoad.load({
  730 + name: 'schedulePlanInfoManage_module',
  731 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  732 + files: [
  733 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanInfoManage.js"
  734 + ]
  735 + });
  736 + }]
  737 + }
  738 + })
  739 +
  740 + // 排班调度值勤日报模块
  741 + .state("schedulePlanReportManage", {
  742 + url: '/schedulePlanReportManage',
  743 + views: {
  744 + "": {
  745 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index_report.html'
  746 + },
  747 + "schedulePlanReportManage_list@schedulePlanReportManage": {
  748 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list_report.html'
  749 + }
  750 + },
  751 +
  752 + resolve: {
  753 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  754 + return $ocLazyLoad.load({
  755 + name: 'schedulePlanManage_module',
  756 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  757 + files: [
  758 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  759 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  760 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js"
  761 + ]
  762 + });
  763 + }]
  764 + }
  765 + })
  766 +
  767 + .state("schedulePlanReportManage_edit", {
  768 + url: '/schedulePlanReportManage_edit/:xlid/:sdate/:lp',
  769 + views: {
  770 + "": {
  771 + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/edit_report.html'
  772 + }
  773 + },
  774 +
  775 + resolve: {
  776 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  777 + return $ocLazyLoad.load({
  778 + name: 'schedulePlanReportManage_edit_module',
  779 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  780 + files: [
  781 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  782 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  783 + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js"
  784 + ]
  785 + });
  786 + }]
  787 + }
  788 + })
  789 +
  790 + // 线路运营概览模块
  791 + .state("busLineInfoStat", {
  792 + url: '/busLineInfoStat',
  793 + views: {
  794 + "": {
  795 + templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/index.html'
  796 + },
  797 + "busLineInfoStat_list@busLineInfoStat": {
  798 + templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/list.html'
  799 + }
  800 + },
  801 +
  802 + resolve: {
  803 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  804 + return $ocLazyLoad.load({
  805 + name: 'busLineInfoStat_module',
  806 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  807 + files: [
  808 + "pages/scheduleApp/module/core/busLineInfoStat/busLineInfoStat.js"
  809 + ]
  810 + });
  811 + }]
  812 + }
  813 + })
  814 +
  815 +
  816 +
  817 +
  818 +
  819 + // TODO:
  820 +
  821 + ;
772 }]); 822 }]);
773 \ No newline at end of file 823 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/listInfo.html renamed to src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/edit_report.html
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/index_report.html 0 → 100644
  1 +<div class="page-head">
  2 + <div class="page-title">
  3 + <h1>调度值勤日报</h1>
  4 + </div>
  5 +</div>
  6 +
  7 +<ul class="page-breadcrumb breadcrumb">
  8 + <li>
  9 + <a href="/pages/home.html" data-pjax="">首页</a>
  10 + <i class="fa fa-circle"></i>
  11 + </li>
  12 + <li>
  13 + <span class="active">运营计划管理</span>
  14 + <i class="fa fa-circle"></i>
  15 + </li>
  16 + <li>
  17 + <span class="active">调度值勤日报</span>
  18 + </li>
  19 +</ul>
  20 +
  21 +<div class="row">
  22 + <div class="col-md-12" ng-controller="SchedulePlanReportManageCtrl as ctrl">
  23 + <div class="portlet light bordered">
  24 + <div class="portlet-title">
  25 + <div class="caption font-dark">
  26 + <i class="fa fa-database font-dark"></i>
  27 + <span class="caption-subject bold uppercase">排班计划</span>
  28 + </div>
  29 + <div class="actions">
  30 + <div class="btn-group">
  31 + <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">
  32 + <i class="fa fa-share"></i>
  33 + <span>数据工具</span>
  34 + <i class="fa fa-angle-down"></i>
  35 + </a>
  36 + <ul class="dropdown-menu pull-right">
  37 + <li>
  38 + <a href="javascript:" class="tool-action">
  39 + <i class="fa fa-file-excel-o"></i>
  40 + 导出excel
  41 + </a>
  42 + </li>
  43 + <li class="divider"></li>
  44 + <li>
  45 + <a href="javascript:" class="tool-action">
  46 + <i class="fa fa-refresh"></i>
  47 + 刷行数据
  48 + </a>
  49 + </li>
  50 + </ul>
  51 + </div>
  52 + </div>
  53 + </div>
  54 +
  55 + <div class="portlet-body">
  56 + <div ui-view="schedulePlanReportManage_list"></div>
  57 + </div>
  58 + </div>
  59 + </div>
  60 +</div>
0 \ No newline at end of file 61 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list_report.html 0 → 100644
  1 +<!-- ui-route employeeInfoManage.list -->
  2 +<div ng-controller="SchedulePlanReportManageListCtrl as ctrl">
  3 + <div class="fixDiv">
  4 + <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column" style="width: 2000px">
  5 + <thead>
  6 + <tr role="row" class="heading">
  7 + <th style="width: 50px;">序号</th>
  8 + <th style="width: 230px;">线路</th>
  9 + <th style="width: 180px">日期</th>
  10 + <th style="width: 60px">路牌</th>
  11 + <th style="width: 100px;">车辆</th>
  12 + <th style="width: 80px;">出场1</th>
  13 + <th style="width: 100px;">驾工1</th>
  14 + <th style="width: 100px;">驾1</th>
  15 + <th style="width: 100px;">售工1</th>
  16 + <th style="width: 100px;">售1</th>
  17 + <th style="width: 80px;">出场2</th>
  18 + <th style="width: 100px;">驾工2</th>
  19 + <th style="width: 100px;">驾2</th>
  20 + <th style="width: 100px;">售工2</th>
  21 + <th style="width: 100px;">售2</th>
  22 + <th style="width: 150px;">排班时间</th>
  23 + <th>时刻表</th>
  24 + </tr>
  25 + <tr role="row" class="filter">
  26 + <td></td>
  27 + <td>
  28 + <sa-Select3 model="ctrl.searchCondition()"
  29 + name="xl"
  30 + placeholder="请输拼音..."
  31 + dcvalue="{{ctrl.searchCondition()['xlid']}}"
  32 + dcname="xlid"
  33 + icname="id"
  34 + icnames="name"
  35 + datatype="xl">
  36 + </sa-Select3>
  37 + </td>
  38 + <td>
  39 + <div class="input-group">
  40 + <input type="text" class="form-control"
  41 + name="scheduleDate" placeholder="选择日期..."
  42 + uib-datepicker-popup="yyyy-MM-dd"
  43 + is-open="ctrl.scheduleDateOpen"
  44 + ng-model="ctrl.searchCondition().sdate" readonly/>
  45 + <span class="input-group-btn">
  46 + <button type="button" class="btn btn-default" ng-click="ctrl.scheduleDate_open()">
  47 + <i class="glyphicon glyphicon-calendar"></i>
  48 + </button>
  49 + </span>
  50 + </div>
  51 + </td>
  52 + <td></td>
  53 + <td></td>
  54 + <td></td>
  55 + <td></td>
  56 + <td></td>
  57 + <td></td>
  58 + <td></td>
  59 + <td></td>
  60 + <td></td>
  61 + <td></td>
  62 + <td></td>
  63 + <td></td>
  64 + <td></td>
  65 + </tr>
  66 + </thead>
  67 + <tbody>
  68 + <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX">
  69 + <td>
  70 + <span ng-bind="$index + 1"></span>
  71 + </td>
  72 + <td>
  73 + <span ng-bind="info.xlName"></span>
  74 + </td>
  75 + <td>
  76 + <span ng-bind="info.scheduleDate | date: 'yyyy-MM-dd'"></span>
  77 + </td>
  78 + <td>
  79 + <span ng-bind="info.lpName"></span>
  80 + </td>
  81 + <td>
  82 + <a class="btn btn-success" ng-click="ctrl.goEditForm()">
  83 + <span ng-bind="info.clZbh"></span>
  84 + </a>
  85 + </td>
  86 + <td>
  87 + <a class="btn btn-success" ng-show="info.ccsj1">
  88 + <span ng-bind="info.ccsj1"></span>
  89 + </a>
  90 + </td>
  91 + <td>
  92 + <a class="btn btn-success" ng-show="info.jsy1Gh">
  93 + <span ng-bind="info.jsy1Gh"></span>
  94 + </a>
  95 + </td>
  96 + <td>
  97 + <a class="btn btn-success" ng-show="info.jsy1Name">
  98 + <span ng-bind="info.jsy1Name"></span>
  99 + </a>
  100 + </td>
  101 + <td>
  102 + <a class="btn btn-success" ng-show="info.spy1Gh">
  103 + <span ng-bind="info.spy1Gh"></span>
  104 + </a>
  105 + </td>
  106 + <td>
  107 + <a class="btn btn-success" ng-show="info.spy1Name">
  108 + <span ng-bind="info.spy1Name"></span>
  109 + </a>
  110 + </td>
  111 + <td>
  112 + <a class="btn btn-success" ng-show="info.ccsj2">
  113 + <span ng-bind="info.ccsj2"></span>
  114 + </a>
  115 + </td>
  116 + <td>
  117 + <a class="btn btn-success" ng-show="info.jsy2Gh">
  118 + <span ng-bind="info.jsy2Gh"></span>
  119 + </a>
  120 + </td>
  121 + <td>
  122 + <a class="btn btn-success" ng-show="info.jsy2Name">
  123 + <span ng-bind="info.jsy2Name"></span>
  124 + </a>
  125 + </td>
  126 + <td>
  127 + <a class="btn btn-success" ng-show="info.spy2Gh">
  128 + <span ng-bind="info.spy2Gh"></span>
  129 + </a>
  130 + </td>
  131 + <td>
  132 + <a class="btn btn-success" ng-show="info.spy2Name">
  133 + <span ng-bind="info.spy2Name"></span>
  134 + </a>
  135 + </td>
  136 + <td>
  137 + <span ng-bind="info.createDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
  138 + </td>
  139 + <td>
  140 + <span ng-bind="info.ttinfoName"></span>
  141 + </td>
  142 + </tr>
  143 + </tbody>
  144 + </table>
  145 + </div>
  146 +
  147 +</div>
0 \ No newline at end of file 148 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js 0 → 100644
  1 +// 调度值勤日报管理 service controller 等写在一起
  2 +// TODO:使用的global服务需要修正
  3 +angular.module('ScheduleApp').factory('SchedulePlanReportManageService', ['SchedulePlanManageService_g', function(service) {
  4 + /** 当前的查询条件信息 */
  5 + var currentSearchCondition = {};
  6 +
  7 + return {
  8 + /**
  9 + * 获取查询条件信息,
  10 + * 用于给controller用来和页面数据绑定。
  11 + */
  12 + getSearchCondition: function() {
  13 + return currentSearchCondition;
  14 + },
  15 + /**
  16 + * 重置查询条件信息。
  17 + */
  18 + resetSearchCondition: function() {
  19 + var key;
  20 + for (key in currentSearchCondition) {
  21 + currentSearchCondition[key] = undefined;
  22 + }
  23 + },
  24 + /**
  25 + * 组装查询参数,返回一个promise查询结果。
  26 + * @param params 查询参数
  27 + * @return 返回一个 promise
  28 + */
  29 + getPage: function() {
  30 + var params = currentSearchCondition; // 查询条件
  31 +
  32 + // TODO:如果没有选中线路、日期,默认选中一个
  33 + if (!params.xlid) {
  34 + currentSearchCondition.xlid = 2;
  35 + }
  36 + if (!params.sdate) {
  37 + currentSearchCondition.sdate = new Date();
  38 + currentSearchCondition.sdate.setTime(1472140800000);
  39 + }
  40 +
  41 + return service.groupinfo.list(params).$promise;
  42 + },
  43 + /**
  44 + * 获取明细信息。
  45 + * @param id 车辆id
  46 + * @return 返回一个 promise
  47 + */
  48 + getDetail: function(id) {
  49 + var params = {id: id};
  50 + return service.get(params).$promise;
  51 + },
  52 + /**
  53 + * 保存信息。
  54 + * @param obj 车辆详细信息
  55 + * @return 返回一个 promise
  56 + */
  57 + saveDetail: function(obj) {
  58 + return service.save(obj).$promise;
  59 + }
  60 + };
  61 +
  62 +}]);
  63 +
  64 +angular.module('ScheduleApp').controller('SchedulePlanReportManageCtrl', [
  65 + 'SchedulePlanReportManageService', '$state',
  66 + function(schedulePlanReportManageService, $state) {
  67 + var self = this;
  68 +
  69 + // 切换到form状态
  70 + self.goForm = function() {
  71 + alert("切换");
  72 + }
  73 + }
  74 +]);
  75 +
  76 +angular.module('ScheduleApp').controller('SchedulePlanReportManageListCtrl', [
  77 + 'SchedulePlanReportManageService', '$scope', '$state',
  78 + function(schedulePlanReportManageService, $scope, $state) {
  79 +
  80 + var self = this;
  81 + self.pageInfo = {
  82 + infos: []
  83 + };
  84 +
  85 + // 日期 日期控件开关
  86 + self.scheduleDateOpen = false;
  87 + self.scheduleDate_open = function() {
  88 + self.scheduleDateOpen = true;
  89 + };
  90 +
  91 + // 初始创建的时候,获取一次列表数据
  92 + schedulePlanReportManageService.getPage().then(
  93 + function(result) {
  94 + self.pageInfo.infos = result;
  95 + },
  96 + function(result) {
  97 + alert("出错啦!");
  98 + }
  99 + );
  100 +
  101 + // 翻页的时候调用
  102 + self.pageChanaged = function() {
  103 + schedulePlanReportManageService.getPage().then(
  104 + function(result) {
  105 + self.pageInfo.infos = result;
  106 + },
  107 + function(result) {
  108 + alert("出错啦!");
  109 + }
  110 + );
  111 + };
  112 + // 获取查询条件数据
  113 + self.searchCondition = function() {
  114 + return schedulePlanReportManageService.getSearchCondition();
  115 + };
  116 + // 重置查询条件
  117 + self.resetSearchCondition = function() {
  118 + return schedulePlanReportManageService.resetSearchCondition();
  119 + };
  120 +
  121 + // 监控条件变化,触发查询
  122 + $scope.$watch(
  123 + function() {
  124 + return schedulePlanReportManageService.getSearchCondition();
  125 + },
  126 + function(newValue, oldValue) {
  127 + if (newValue) {
  128 + if (newValue.xlid && newValue.sdate) {
  129 + self.pageChanaged();
  130 + }
  131 + }
  132 + },
  133 + true
  134 + );
  135 +
  136 + // 切换到修改页面
  137 + self.goEditForm = function() {
  138 + //$state.go("schedulePlanReportManage_edit");
  139 + }
  140 +
  141 + }
  142 +]);
  143 +
  144 +angular.module('ScheduleApp').controller('SchedulePlanReportManageFormCtrl', ['SchedulePlanReportManageService', '$stateParams', '$state', function(schedulePlanReportManageService, $stateParams, $state) {
  145 + // TODO:
  146 +}]);
  147 +
  148 +angular.module('ScheduleApp').controller('SchedulePlanReportManageDetailCtrl', ['SchedulePlanReportManageService', '$stateParams', function(schedulePlanReportManageService, $stateParams) {
  149 + // TODO:
  150 +}]);
  151 +
  152 +
  153 +
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/edit.html
@@ -107,59 +107,53 @@ @@ -107,59 +107,53 @@
107 107
108 <div class="form-group has-success has-feedback"> 108 <div class="form-group has-success has-feedback">
109 <label class="col-md-2 control-label">路牌范围*:</label> 109 <label class="col-md-2 control-label">路牌范围*:</label>
110 - <div class="col-md-4">  
111 - <input type="text" class="form-control" name="lpNames" ng-model="ctrl.scheduleRuleManageForSave.lpNames" required  
112 - placeholder="由路牌名称组成,逗号分隔"/>  
113 - </div>  
114 - <!-- 隐藏块,显示验证信息 -->  
115 - <div class="alert alert-danger well-sm" ng-show="myForm.lpNames.$error.required">  
116 - 路牌范围必须填写  
117 - </div>  
118 - </div>  
119 -  
120 - <div class="form-group has-success has-feedback">  
121 - <label class="col-md-2 control-label">起始路牌*:</label>  
122 - <div class="col-md-4">  
123 - <input type="text" class="form-control" name="lpStart" ng-model="ctrl.scheduleRuleManageForSave.lpStart" required  
124 - placeholder="起始路牌索引,从1开始"/>  
125 - </div>  
126 - <!-- 隐藏块,显示验证信息 -->  
127 - <div class="alert alert-danger well-sm" ng-show="myForm.lpStart.$error.required">  
128 - 起始路牌必须填写 110 + <div class="col-md-6">
  111 + <sa-Guideboardgroup model="ctrl.scheduleRuleManageForSave"
  112 + name="lprange"
  113 + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}"
  114 + lprangevalue="{{ctrl.scheduleRuleManageForSave.lpNames}}"
  115 + lprangename="lpNames"
  116 + lpidrangevalue="{{ctrl.scheduleRuleManageForSave.lpIds}}"
  117 + lpidrangename="lpIds"
  118 + lpstartvalue="{{ctrl.scheduleRuleManageForSave.lpStart}}"
  119 + lpstartname="lpStart"
  120 + required
  121 + >
  122 + </sa-Guideboardgroup>
  123 + </div>
  124 + <div class="alert alert-danger well-sm" ng-show="myForm.lprange.$error.required">
  125 + 路牌范围,起始路牌必须选择
129 </div> 126 </div>
130 </div> 127 </div>
131 128
132 <div class="form-group has-success has-feedback"> 129 <div class="form-group has-success has-feedback">
133 <label class="col-md-2 control-label">人员范围*:</label> 130 <label class="col-md-2 control-label">人员范围*:</label>
134 - <div class="col-md-4">  
135 - <input type="text" class="form-control" name="ryDbbms" ng-model="ctrl.scheduleRuleManageForSave.ryDbbms" required  
136 - placeholder="由人员配置的搭班编码组成,逗号分隔"/>  
137 - </div>  
138 - <!-- 隐藏块,显示验证信息 -->  
139 - <div class="alert alert-danger well-sm" ng-show="myForm.ryDbbms.$error.required">  
140 - 人员范围必须填写 131 + <div class="col-md-6">
  132 + <sa-Employeegroup model="ctrl.scheduleRuleManageForSave"
  133 + name="ryrange"
  134 + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}"
  135 + dbbmrangevalue="{{ctrl.scheduleRuleManageForSave.ryDbbms}}"
  136 + dbbmrangename="ryDbbms"
  137 + rycidrangevalue="{{ctrl.scheduleRuleManageForSave.ryConfigIds}}"
  138 + rycidrangename="ryConfigIds"
  139 + rystartvalue="{{ctrl.scheduleRuleManageForSave.ryStart}}"
  140 + rystartname="ryStart"
  141 + required
  142 + >
  143 + </sa-Employeegroup>
  144 + </div>
  145 + <div class="alert alert-danger well-sm" ng-show="myForm.ryrange.$error.required">
  146 + 人员范围,起始人员必须选择
141 </div> 147 </div>
142 </div> 148 </div>
143 149
144 - <div class="form-group has-success has-feedback">  
145 - <label class="col-md-2 control-label">起始人员*:</label>  
146 - <div class="col-md-4">  
147 - <input type="text" class="form-control" name="ryStart" ng-model="ctrl.scheduleRuleManageForSave.ryStart" required  
148 - placeholder="起始人员索引,从1开始"/>  
149 - </div>  
150 - <!-- 隐藏块,显示验证信息 -->  
151 - <div class="alert alert-danger well-sm" ng-show="myForm.ryStart.$error.required">  
152 - 起始路牌必须填写  
153 - </div>  
154 - </div>  
155 -  
156 - <div class="form-group">  
157 - <label class="col-md-2 control-label">翻班格式:</label>  
158 - <div class="col-md-4">  
159 - <input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs"  
160 - placeholder="车辆翻班格式"/>  
161 - </div>  
162 - </div> 150 + <!--<div class="form-group">-->
  151 + <!--<label class="col-md-2 control-label">翻班格式:</label>-->
  152 + <!--<div class="col-md-4">-->
  153 + <!--<input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs"-->
  154 + <!--placeholder="车辆翻班格式"/>-->
  155 + <!--</div>-->
  156 + <!--</div>-->
163 157
164 158
165 <!-- 其他form-group --> 159 <!-- 其他form-group -->
@@ -181,5 +175,4 @@ @@ -181,5 +175,4 @@
181 175
182 </div> 176 </div>
183 177
184 -  
185 </div> 178 </div>
186 \ No newline at end of file 179 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/form.html
@@ -107,59 +107,53 @@ @@ -107,59 +107,53 @@
107 107
108 <div class="form-group has-success has-feedback"> 108 <div class="form-group has-success has-feedback">
109 <label class="col-md-2 control-label">路牌范围*:</label> 109 <label class="col-md-2 control-label">路牌范围*:</label>
110 - <div class="col-md-4">  
111 - <input type="text" class="form-control" name="lpNames" ng-model="ctrl.scheduleRuleManageForSave.lpNames" required  
112 - placeholder="由路牌名称组成,逗号分隔"/>  
113 - </div>  
114 - <!-- 隐藏块,显示验证信息 -->  
115 - <div class="alert alert-danger well-sm" ng-show="myForm.lpNames.$error.required">  
116 - 路牌范围必须填写  
117 - </div>  
118 - </div>  
119 -  
120 - <div class="form-group has-success has-feedback">  
121 - <label class="col-md-2 control-label">起始路牌*:</label>  
122 - <div class="col-md-4">  
123 - <input type="text" class="form-control" name="lpStart" ng-model="ctrl.scheduleRuleManageForSave.lpStart" required  
124 - placeholder="起始路牌索引,从1开始"/>  
125 - </div>  
126 - <!-- 隐藏块,显示验证信息 -->  
127 - <div class="alert alert-danger well-sm" ng-show="myForm.lpStart.$error.required">  
128 - 起始路牌必须填写 110 + <div class="col-md-6">
  111 + <sa-Guideboardgroup model="ctrl.scheduleRuleManageForSave"
  112 + name="lprange"
  113 + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}"
  114 + lprangevalue="{{ctrl.scheduleRuleManageForSave.lpNames}}"
  115 + lprangename="lpNames"
  116 + lpidrangevalue="{{ctrl.scheduleRuleManageForSave.lpIds}}"
  117 + lpidrangename="lpIds"
  118 + lpstartvalue="{{ctrl.scheduleRuleManageForSave.lpStart}}"
  119 + lpstartname="lpStart"
  120 + required
  121 + >
  122 + </sa-Guideboardgroup>
  123 + </div>
  124 + <div class="alert alert-danger well-sm" ng-show="myForm.lprange.$error.required">
  125 + 路牌范围,起始路牌必须选择
129 </div> 126 </div>
130 </div> 127 </div>
131 128
132 <div class="form-group has-success has-feedback"> 129 <div class="form-group has-success has-feedback">
133 <label class="col-md-2 control-label">人员范围*:</label> 130 <label class="col-md-2 control-label">人员范围*:</label>
134 - <div class="col-md-4">  
135 - <input type="text" class="form-control" name="ryDbbms" ng-model="ctrl.scheduleRuleManageForSave.ryDbbms" required  
136 - placeholder="由人员配置的搭班编码组成,逗号分隔"/>  
137 - </div>  
138 - <!-- 隐藏块,显示验证信息 -->  
139 - <div class="alert alert-danger well-sm" ng-show="myForm.ryDbbms.$error.required">  
140 - 人员范围必须填写 131 + <div class="col-md-6">
  132 + <sa-Employeegroup model="ctrl.scheduleRuleManageForSave"
  133 + name="ryrange"
  134 + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}"
  135 + dbbmrangevalue="{{ctrl.scheduleRuleManageForSave.ryDbbms}}"
  136 + dbbmrangename="ryDbbms"
  137 + rycidrangevalue="{{ctrl.scheduleRuleManageForSave.ryConfigIds}}"
  138 + rycidrangename="ryConfigIds"
  139 + rystartvalue="{{ctrl.scheduleRuleManageForSave.ryStart}}"
  140 + rystartname="ryStart"
  141 + required
  142 + >
  143 + </sa-Employeegroup>
  144 + </div>
  145 + <div class="alert alert-danger well-sm" ng-show="myForm.ryrange.$error.required">
  146 + 人员范围,起始人员必须选择
141 </div> 147 </div>
142 </div> 148 </div>
143 149
144 - <div class="form-group has-success has-feedback">  
145 - <label class="col-md-2 control-label">起始人员*:</label>  
146 - <div class="col-md-4">  
147 - <input type="text" class="form-control" name="ryStart" ng-model="ctrl.scheduleRuleManageForSave.ryStart" required  
148 - placeholder="起始人员索引,从1开始"/>  
149 - </div>  
150 - <!-- 隐藏块,显示验证信息 -->  
151 - <div class="alert alert-danger well-sm" ng-show="myForm.ryStart.$error.required">  
152 - 起始路牌必须填写  
153 - </div>  
154 - </div>  
155 -  
156 - <div class="form-group">  
157 - <label class="col-md-2 control-label">翻班格式:</label>  
158 - <div class="col-md-4">  
159 - <input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs"  
160 - placeholder="车辆翻班格式"/>  
161 - </div>  
162 - </div> 150 + <!--<div class="form-group">-->
  151 + <!--<label class="col-md-2 control-label">翻班格式:</label>-->
  152 + <!--<div class="col-md-4">-->
  153 + <!--<input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs"-->
  154 + <!--placeholder="车辆翻班格式"/>-->
  155 + <!--</div>-->
  156 + <!--</div>-->
163 157
164 158
165 <!-- 其他form-group --> 159 <!-- 其他form-group -->