Commit 6f988cb2c14ceedd770715f75749c52e65e19388

Authored by 徐烜
2 parents fda49142 3da89284

PSM-8

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