Commit b4cfaebf3afb82885ece5a309572e1f4f1b7abb1

Authored by mcy123
2 parents 6f233257 08fc891a

Merge branch 'minhang' of

http://192.168.168.201:8888/panzhaov5/bsth_control into minhang
Showing 55 changed files with 4296 additions and 1738 deletions
src/main/java/com/bsth/controller/schedule/BController.java 0 → 100644
  1 +package com.bsth.controller.schedule;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.service.schedule.BService;
  5 +import com.bsth.service.schedule.ScheduleException;
  6 +import com.google.common.base.Splitter;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.data.domain.PageRequest;
  9 +import org.springframework.data.domain.Sort;
  10 +import org.springframework.web.bind.annotation.*;
  11 +
  12 +import java.io.Serializable;
  13 +import java.util.ArrayList;
  14 +import java.util.HashMap;
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +
  18 +/**
  19 + * 基础控制器。
  20 + */
  21 +public class BController<T, ID extends Serializable> {
  22 + @Autowired
  23 + protected BService<T, ID> bService;
  24 +
  25 + // CRUD 操作
  26 + // Create操作
  27 + @RequestMapping(method = RequestMethod.POST)
  28 + public Map<String, Object> save(@RequestBody T t) {
  29 + T t_saved = bService.save(t);
  30 + Map<String, Object> rtn = new HashMap<>();
  31 + rtn.put("status", ResponseCode.SUCCESS);
  32 + rtn.put("data", t_saved);
  33 + return rtn;
  34 + }
  35 + // Update操作
  36 + @RequestMapping(value="/{id}", method = RequestMethod.POST)
  37 + public Map<String, Object> update(@RequestBody T t) {
  38 + return save(t);
  39 + }
  40 + // Research操作
  41 + @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  42 + public Map<String, Object> findById(@PathVariable("id") ID id) {
  43 + T t = bService.findById(id);
  44 + Map<String, Object> rtn = new HashMap<>();
  45 + rtn.put("status", ResponseCode.SUCCESS);
  46 + rtn.put("data", t);
  47 + return rtn;
  48 + }
  49 + @RequestMapping(value = "/all", method = RequestMethod.GET)
  50 + public Map<String, Object> list(@RequestParam Map<String, Object> param) {
  51 + List<T> tList = bService.list(param);
  52 + Map<String, Object> rtn = new HashMap<>();
  53 + rtn.put("status", ResponseCode.SUCCESS);
  54 + rtn.put("data", tList);
  55 + return rtn;
  56 + }
  57 + @RequestMapping(method = RequestMethod.GET)
  58 + public Map<String, Object> list(
  59 + @RequestParam Map<String, Object> map,
  60 + @RequestParam(defaultValue = "0") int page,
  61 + @RequestParam(defaultValue = "10") int size,
  62 + @RequestParam(defaultValue = "id") String order,
  63 + @RequestParam(defaultValue = "DESC") String direction) {
  64 + // 允许多个字段排序,order可以写单个字段,也可以写多个字段
  65 + // 多个字段格式:{col1},{col2},{col3},....,{coln}
  66 + List<String> order_columns = Splitter.on(",").trimResults().splitToList(order);
  67 + // 多字段排序:DESC,ASC...
  68 + List<String> order_dirs = Splitter.on(",").trimResults().splitToList(direction);
  69 +
  70 + Map<String, Object> rtn = new HashMap<>();
  71 +
  72 + if (order_dirs.size() == 1) { // 所有字段采用一种排序
  73 + rtn.put("status", ResponseCode.SUCCESS);
  74 + if (order_dirs.get(0).equals("ASC")) {
  75 + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.ASC, order_columns))));
  76 + } else {
  77 + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(Sort.Direction.DESC, order_columns))));
  78 + }
  79 + } else if (order_columns.size() == order_dirs.size()) {
  80 + List<Sort.Order> orderList = new ArrayList<>();
  81 + for (int i = 0; i < order_columns.size(); i++) {
  82 + if (null != order_dirs.get(i) && order_dirs.get(i).equals("ASC")) {
  83 + orderList.add(new Sort.Order(Sort.Direction.ASC, order_columns.get(i)));
  84 + } else {
  85 + orderList.add(new Sort.Order(Sort.Direction.DESC, order_columns.get(i)));
  86 + }
  87 + }
  88 + rtn.put("status", ResponseCode.SUCCESS);
  89 + rtn.put("data", bService.list(map, new PageRequest(page, size, new Sort(orderList))));
  90 + } else {
  91 + throw new RuntimeException("多字段排序参数格式问题,排序顺序和字段数不一致");
  92 + }
  93 +
  94 + return rtn;
  95 +
  96 + }
  97 +
  98 + // Delete操作
  99 + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
  100 + public Map<String, Object> delete(@PathVariable("id") ID id) {
  101 + Map<String, Object> rtn = new HashMap<>();
  102 + try {
  103 + bService.delete(id);
  104 + rtn.put("status", ResponseCode.SUCCESS);
  105 + } catch (ScheduleException exp) {
  106 + rtn.put("status", ResponseCode.ERROR);
  107 + rtn.put("msg", exp.getMessage());
  108 + }
  109 +
  110 + return rtn;
  111 + }
  112 +
  113 +}
src/main/java/com/bsth/controller/schedule/GuideboardInfoController.java deleted 100644 → 0
1 -package com.bsth.controller.schedule;  
2 -  
3 -import com.bsth.controller.BaseController;  
4 -import com.bsth.entity.schedule.GuideboardInfo;  
5 -import com.bsth.repository.schedule.GuideboardInfoRepository;  
6 -import com.bsth.service.schedule.utils.DataToolsProperties;  
7 -import org.springframework.beans.factory.annotation.Autowired;  
8 -import org.springframework.boot.context.properties.EnableConfigurationProperties;  
9 -import org.springframework.web.bind.annotation.PathVariable;  
10 -import org.springframework.web.bind.annotation.RequestMapping;  
11 -import org.springframework.web.bind.annotation.RequestMethod;  
12 -import org.springframework.web.bind.annotation.RestController;  
13 -  
14 -import java.util.List;  
15 -import java.util.Map;  
16 -  
17 -/**  
18 - * Created by xu on 16/5/11.  
19 - */  
20 -@RestController  
21 -@RequestMapping("gic")  
22 -@EnableConfigurationProperties(DataToolsProperties.class)  
23 -public class GuideboardInfoController extends BaseController<GuideboardInfo, Long> {  
24 - @Autowired  
25 - private DataToolsProperties dataToolsProperties;  
26 - @Autowired  
27 - private GuideboardInfoRepository guideboardInfoRepository;  
28 -  
29 - @Override  
30 - protected String getDataImportKtrClasspath() {  
31 - return dataToolsProperties.getGuideboardsDatainputktr();  
32 - }  
33 -  
34 - @Override  
35 - public GuideboardInfo findById(@PathVariable("id") Long aLong) {  
36 - return guideboardInfoRepository.findOneExtend(aLong);  
37 - }  
38 -  
39 -  
40 - @RequestMapping(value = "/ttlpnames", method = RequestMethod.GET)  
41 - public List<Map<String, Object>> findLpName(Long ttid) {  
42 - return guideboardInfoRepository.findLpName(ttid);  
43 - }  
44 -}  
src/main/java/com/bsth/controller/schedule/basicinfo/CarsController.java 0 → 100644
  1 +package com.bsth.controller.schedule.basicinfo;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.Cars;
  6 +import com.bsth.service.schedule.CarsService;
  7 +import com.bsth.service.schedule.ScheduleException;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * 车辆基础信息controller
  19 + */
  20 +@RestController(value = "carsController_sc")
  21 +@RequestMapping("cars_sc")
  22 +public class CarsController extends BController<Cars, Integer> {
  23 + @Autowired
  24 + private CarsService carsService;
  25 +
  26 + @RequestMapping(value = "/validate_zbh", method = RequestMethod.GET)
  27 + public Map<String, Object> validate_zbh(@RequestParam Map<String, Object> param) {
  28 + Map<String, Object> rtn = new HashMap<>();
  29 + try {
  30 + // 自编号验证
  31 + Cars cars = new Cars(
  32 + param.get("id_eq"),
  33 + param.get("insideCode_eq"),
  34 + null,
  35 + null,
  36 + null);
  37 + carsService.validate_nbbh(cars);
  38 + rtn.put("status", ResponseCode.SUCCESS);
  39 + } catch (ScheduleException exp) {
  40 + rtn.put("status", ResponseCode.ERROR);
  41 + rtn.put("msg", exp.getMessage());
  42 + }
  43 + return rtn;
  44 + }
  45 +
  46 + @RequestMapping(value = "/validate_clbh", method = RequestMethod.GET)
  47 + public Map<String, Object> validate_clbh(@RequestParam Map<String, Object> param) {
  48 + Map<String, Object> rtn = new HashMap<>();
  49 + try {
  50 + // 车辆编号验证
  51 + Cars cars = new Cars(
  52 + param.get("id_eq"),
  53 + null,
  54 + param.get("carCode_eq"),
  55 + null,
  56 + null);
  57 + carsService.validate_clbh(cars);
  58 + rtn.put("status", ResponseCode.SUCCESS);
  59 + } catch (ScheduleException exp) {
  60 + rtn.put("status", ResponseCode.ERROR);
  61 + rtn.put("msg", exp.getMessage());
  62 + }
  63 + return rtn;
  64 + }
  65 +
  66 + @RequestMapping(value = "/validate_cph", method = RequestMethod.GET)
  67 + public Map<String, Object> validate_cph(@RequestParam Map<String, Object> param) {
  68 + Map<String, Object> rtn = new HashMap<>();
  69 + try {
  70 + // 车牌号验证
  71 + Cars cars = new Cars(
  72 + param.get("id_eq"),
  73 + null,
  74 + null,
  75 + param.get("carPlate_eq"),
  76 + null);
  77 + carsService.validate_cph(cars);
  78 + rtn.put("status", ResponseCode.SUCCESS);
  79 + } catch (ScheduleException exp) {
  80 + rtn.put("status", ResponseCode.ERROR);
  81 + rtn.put("msg", exp.getMessage());
  82 + }
  83 + return rtn;
  84 + }
  85 +
  86 + @RequestMapping(value = "/validate_sbbh", method = RequestMethod.GET)
  87 + public Map<String, Object> validate_sbbh(@RequestParam Map<String, Object> param) {
  88 + Map<String, Object> rtn = new HashMap<>();
  89 + try {
  90 + // 设备编号验证
  91 + Cars cars = new Cars(
  92 + param.get("id_eq"),
  93 + null,
  94 + null,
  95 + null,
  96 + param.get("equipmentCode_eq")
  97 + );
  98 + carsService.validate_sbbh(cars);
  99 + rtn.put("status", ResponseCode.SUCCESS);
  100 + } catch (ScheduleException exp) {
  101 + rtn.put("status", ResponseCode.ERROR);
  102 + rtn.put("msg", exp.getMessage());
  103 + }
  104 + return rtn;
  105 + }
  106 +}
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java 0 → 100644
  1 +package com.bsth.controller.schedule.core;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
  5 +import com.bsth.entity.schedule.GuideboardInfo;
  6 +import com.bsth.repository.schedule.GuideboardInfoRepository;
  7 +import com.bsth.service.schedule.GuideboardInfoService;
  8 +import com.bsth.service.schedule.ScheduleException;
  9 +import com.bsth.service.schedule.utils.DataToolsProperties;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.boot.context.properties.EnableConfigurationProperties;
  12 +import org.springframework.web.bind.annotation.RequestMapping;
  13 +import org.springframework.web.bind.annotation.RequestMethod;
  14 +import org.springframework.web.bind.annotation.RequestParam;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import java.util.HashMap;
  18 +import java.util.List;
  19 +import java.util.Map;
  20 +
  21 +/**
  22 + * 路牌管理控制器。
  23 + */
  24 +@RestController
  25 +@RequestMapping("gic")
  26 +@EnableConfigurationProperties(DataToolsProperties.class)
  27 +public class GuideboardInfoController extends BController<GuideboardInfo, Long> {
  28 + @Autowired
  29 + private GuideboardInfoService guideboardInfoService;
  30 +// @Autowired
  31 +// private DataToolsProperties dataToolsProperties;
  32 + @Autowired
  33 + private GuideboardInfoRepository guideboardInfoRepository;
  34 +//
  35 +// @Override
  36 +// protected String getDataImportKtrClasspath() {
  37 +// return dataToolsProperties.getGuideboardsDatainputktr();
  38 +// }
  39 +//
  40 +// @Override
  41 +// public GuideboardInfo findById(@PathVariable("id") Long aLong) {
  42 +// return guideboardInfoRepository.findOneExtend(aLong);
  43 +// }
  44 +//
  45 +//
  46 + @RequestMapping(value = "/ttlpnames", method = RequestMethod.GET)
  47 + public List<Map<String, Object>> findLpName(Long ttid) {
  48 + return guideboardInfoRepository.findLpName(ttid);
  49 + }
  50 +
  51 + @RequestMapping(value = "/validate1", method = RequestMethod.GET)
  52 + public Map<String, Object> validate1(@RequestParam Map<String, Object> param) {
  53 + Map<String, Object> rtn = new HashMap<>();
  54 + try {
  55 + // 路牌编号验证
  56 + GuideboardInfo guideboardInfo = new GuideboardInfo(
  57 + param.get("xl.id_eq"),
  58 + param.get("lpNo_eq"),
  59 + null
  60 + );
  61 + guideboardInfoService.validate(guideboardInfo);
  62 + rtn.put("status", ResponseCode.SUCCESS);
  63 + } catch (ScheduleException exp) {
  64 + rtn.put("status", ResponseCode.ERROR);
  65 + rtn.put("msg", exp.getMessage());
  66 + }
  67 + return rtn;
  68 + }
  69 +
  70 + @RequestMapping(value = "/validate2", method = RequestMethod.GET)
  71 + public Map<String, Object> validate2(@RequestParam Map<String, Object> param) {
  72 + Map<String, Object> rtn = new HashMap<>();
  73 + try {
  74 + // 路牌名称验证
  75 + GuideboardInfo guideboardInfo = new GuideboardInfo(
  76 + param.get("xl.id_eq"),
  77 + null,
  78 + param.get("lpName_eq")
  79 + );
  80 + guideboardInfoService.validate(guideboardInfo);
  81 + rtn.put("status", ResponseCode.SUCCESS);
  82 + } catch (ScheduleException exp) {
  83 + rtn.put("status", ResponseCode.ERROR);
  84 + rtn.put("msg", exp.getMessage());
  85 + }
  86 + return rtn;
  87 + }
  88 +}
src/main/java/com/bsth/entity/Cars.java
1 package com.bsth.entity; 1 package com.bsth.entity;
2 2
3 import com.bsth.entity.sys.SysUser; 3 import com.bsth.entity.sys.SysUser;
  4 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 5
5 import javax.persistence.*; 6 import javax.persistence.*;
6 import java.io.Serializable; 7 import java.io.Serializable;
@@ -22,6 +23,7 @@ import java.util.Date; @@ -22,6 +23,7 @@ import java.util.Date;
22 23
23 @Entity 24 @Entity
24 @Table(name = "bsth_c_cars") 25 @Table(name = "bsth_c_cars")
  26 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
25 public class Cars implements Serializable { 27 public class Cars implements Serializable {
26 28
27 /** 主键Id */ 29 /** 主键Id */
@@ -30,7 +32,7 @@ public class Cars implements Serializable { @@ -30,7 +32,7 @@ public class Cars implements Serializable {
30 private Integer id; 32 private Integer id;
31 33
32 /** 自编号/内部编号 */ 34 /** 自编号/内部编号 */
33 - @Column(nullable = false, length = 8, unique = true) 35 + @Column(nullable = false, length = 20, unique = true)
34 private String insideCode; 36 private String insideCode;
35 37
36 // 公司、分公司暂时不用关联实体 38 // 公司、分公司暂时不用关联实体
@@ -150,6 +152,26 @@ public class Cars implements Serializable { @@ -150,6 +152,26 @@ public class Cars implements Serializable {
150 /** 修改日期 */ 152 /** 修改日期 */
151 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") 153 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
152 private Date updateDate; 154 private Date updateDate;
  155 +
  156 + public Cars() {}
  157 +
  158 + public Cars(Object id, Object nbbh, Object clbh, Object cph, Object sbbh) {
  159 + if (id != null) {
  160 + this.id = Integer.valueOf(id.toString());
  161 + }
  162 + if (nbbh != null) {
  163 + this.insideCode = nbbh.toString();
  164 + }
  165 + if (clbh != null) {
  166 + this.carCode = clbh.toString();
  167 + }
  168 + if (cph != null) {
  169 + this.carPlate = cph.toString();
  170 + }
  171 + if (sbbh != null) {
  172 + this.equipmentCode = sbbh.toString();
  173 + }
  174 + }
153 175
154 public String getServiceNo() { 176 public String getServiceNo() {
155 return serviceNo; 177 return serviceNo;
src/main/java/com/bsth/entity/Line.java
1 package com.bsth.entity; 1 package com.bsth.entity;
2 2
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
3 import org.springframework.format.annotation.DateTimeFormat; 4 import org.springframework.format.annotation.DateTimeFormat;
4 5
5 import javax.persistence.*; 6 import javax.persistence.*;
@@ -23,6 +24,7 @@ import java.util.Date; @@ -23,6 +24,7 @@ import java.util.Date;
23 24
24 @Entity 25 @Entity
25 @Table(name = "bsth_c_line") 26 @Table(name = "bsth_c_line")
  27 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
26 public class Line implements Serializable { 28 public class Line implements Serializable {
27 29
28 @Id 30 @Id
src/main/java/com/bsth/entity/schedule/GuideboardInfo.java
@@ -2,9 +2,9 @@ package com.bsth.entity.schedule; @@ -2,9 +2,9 @@ package com.bsth.entity.schedule;
2 2
3 import com.bsth.entity.Line; 3 import com.bsth.entity.Line;
4 import com.bsth.entity.sys.SysUser; 4 import com.bsth.entity.sys.SysUser;
  5 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5 6
6 import javax.persistence.*; 7 import javax.persistence.*;
7 -import javax.persistence.Table;  
8 import java.util.Date; 8 import java.util.Date;
9 9
10 /** 10 /**
@@ -17,6 +17,7 @@ import java.util.Date; @@ -17,6 +17,7 @@ import java.util.Date;
17 @NamedAttributeNode("xl") 17 @NamedAttributeNode("xl")
18 }) 18 })
19 }) 19 })
  20 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
20 public class GuideboardInfo { 21 public class GuideboardInfo {
21 22
22 /** 主键Id */ 23 /** 主键Id */
@@ -38,6 +39,10 @@ public class GuideboardInfo { @@ -38,6 +39,10 @@ public class GuideboardInfo {
38 @Column(nullable = false) 39 @Column(nullable = false)
39 private String lpType; 40 private String lpType;
40 41
  42 + /** 是否删除(标记) */
  43 + @Column(nullable = false)
  44 + private Boolean isCancel = false;
  45 +
41 /** 创建人 */ 46 /** 创建人 */
42 @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST) 47 @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
43 private SysUser createBy; 48 private SysUser createBy;
@@ -53,6 +58,30 @@ public class GuideboardInfo { @@ -53,6 +58,30 @@ public class GuideboardInfo {
53 private Date updateDate; 58 private Date updateDate;
54 59
55 60
  61 + public GuideboardInfo() {}
  62 +
  63 + public GuideboardInfo(Object xlid, Object lpNo, Object lpName) {
  64 + Integer xlid_ = xlid == null ? null : Integer.valueOf(xlid.toString());
  65 + Integer lpNo_ = lpNo == null ? null : Integer.valueOf(lpNo.toString());
  66 + String lpName_ = lpName == null ? null : String.valueOf(lpName);
  67 +
  68 + if (xlid_ != null) {
  69 + Line line = new Line();
  70 + line.setId(xlid_);
  71 + this.xl = line;
  72 + }
  73 +
  74 + this.lpNo = lpNo_;
  75 + this.lpName = lpName_;
  76 + }
  77 +
  78 + public GuideboardInfo(Integer xlid, Integer lpNo) {
  79 + this(xlid, lpNo, null);
  80 + }
  81 + public GuideboardInfo(Integer xlid, String lpName) {
  82 + this(xlid, null, lpName);
  83 + }
  84 +
56 public Long getId() { 85 public Long getId() {
57 return id; 86 return id;
58 } 87 }
@@ -124,4 +153,12 @@ public class GuideboardInfo { @@ -124,4 +153,12 @@ public class GuideboardInfo {
124 public void setUpdateDate(Date updateDate) { 153 public void setUpdateDate(Date updateDate) {
125 this.updateDate = updateDate; 154 this.updateDate = updateDate;
126 } 155 }
  156 +
  157 + public Boolean getIsCancel() {
  158 + return isCancel;
  159 + }
  160 +
  161 + public void setIsCancel(Boolean isCancel) {
  162 + this.isCancel = isCancel;
  163 + }
127 } 164 }
src/main/java/com/bsth/service/schedule/BService.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +import org.springframework.data.domain.Page;
  4 +import org.springframework.data.domain.Pageable;
  5 +
  6 +import java.io.Serializable;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +/**
  11 + * 基础service接口。
  12 + */
  13 +public interface BService<T, ID extends Serializable> {
  14 + // CRUD 操作
  15 + // Create,Update操作
  16 + T save(T t);
  17 + <S extends T> List<S> bulkSave(List<S> entities); // 批量保存(TODO:待测试)
  18 + // Research操作
  19 + T findById(ID id);
  20 + List<T> findAll();
  21 + Page<T> list(Map<String, Object> param, Pageable pageable);
  22 + List<T> list(Map<String, Object> param);
  23 + // Delete操作
  24 + void delete(ID id) throws ScheduleException;
  25 +}
src/main/java/com/bsth/service/schedule/CarsService.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +import com.bsth.entity.Cars;
  4 +
  5 +/**
  6 + * Created by xu on 16/12/8.
  7 + */
  8 +public interface CarsService extends BService<Cars, Integer> {
  9 + public void validate_nbbh(Cars cars) throws ScheduleException;
  10 + public void validate_clbh(Cars cars) throws ScheduleException;
  11 + public void validate_cph(Cars cars) throws ScheduleException;
  12 + public void validate_sbbh(Cars cars) throws ScheduleException;
  13 +}
src/main/java/com/bsth/service/schedule/GuideboardInfoService.java
1 package com.bsth.service.schedule; 1 package com.bsth.service.schedule;
2 2
3 import com.bsth.entity.schedule.GuideboardInfo; 3 import com.bsth.entity.schedule.GuideboardInfo;
4 -import com.bsth.service.BaseService;  
5 4
6 /** 5 /**
7 * Created by xu on 16/5/11. 6 * Created by xu on 16/5/11.
8 */ 7 */
9 -public interface GuideboardInfoService extends BaseService<GuideboardInfo, Long> { 8 +public interface GuideboardInfoService extends BService<GuideboardInfo, Long> {
  9 + public void validate(GuideboardInfo guideboardInfo) throws ScheduleException;
  10 + public void toggleCancel(Long id) throws ScheduleException;
10 } 11 }
src/main/java/com/bsth/service/schedule/GuideboardInfoServiceImpl.java deleted 100644 → 0
1 -package com.bsth.service.schedule;  
2 -  
3 -import com.bsth.entity.schedule.GuideboardInfo;  
4 -import com.bsth.service.impl.BaseServiceImpl;  
5 -import org.springframework.stereotype.Service;  
6 -  
7 -/**  
8 - * Created by xu on 16/5/11.  
9 - */  
10 -@Service  
11 -public class GuideboardInfoServiceImpl extends BaseServiceImpl<GuideboardInfo, Long> implements GuideboardInfoService {  
12 -}  
src/main/java/com/bsth/service/schedule/ScheduleException.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +/**
  4 + * Created by xu on 16/12/5.
  5 + */
  6 +public class ScheduleException extends Exception {
  7 + public ScheduleException(String message) {
  8 + super("计划调度业务错误==>>" + message);
  9 + }
  10 +}
src/main/java/com/bsth/service/schedule/impl/BServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.search.CustomerSpecs;
  4 +import com.bsth.repository.BaseRepository;
  5 +import com.bsth.service.schedule.BService;
  6 +import com.bsth.service.schedule.ScheduleException;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.beans.factory.annotation.Value;
  11 +import org.springframework.data.domain.Page;
  12 +import org.springframework.data.domain.Pageable;
  13 +import org.springframework.data.jpa.domain.Specification;
  14 +
  15 +import javax.persistence.EntityManager;
  16 +import java.io.Serializable;
  17 +import java.util.ArrayList;
  18 +import java.util.List;
  19 +import java.util.Map;
  20 +
  21 +/**
  22 + * 基础BService实现。
  23 + */
  24 +public class BServiceImpl<T, ID extends Serializable> implements BService<T, ID> {
  25 + @Autowired
  26 + private BaseRepository<T, ID> baseRepository;
  27 + @Autowired
  28 + private EntityManager entityManager;
  29 + @Value("${hibernate.jdbc.batch_size}")
  30 + private int batchSize;
  31 +
  32 + /** 日志记录器 */
  33 + protected Logger logger = LoggerFactory.getLogger(this.getClass());
  34 +
  35 + // CRUD 操作
  36 + // Create,Update操作
  37 + @Override
  38 + public T save(T t) {
  39 + if (logger.isDebugEnabled()) {
  40 + logger.debug("save...");
  41 + }
  42 + return baseRepository.save(t);
  43 + }
  44 + @Override
  45 + public <S extends T> List<S> bulkSave(List<S> entities) {
  46 + if (logger.isDebugEnabled()) {
  47 + logger.debug("bulkSave...");
  48 + }
  49 +
  50 + // 不使用内部批量保存,自己实现批量保存
  51 + final List<S> savedEntities = new ArrayList<>(entities.size());
  52 + int i = 0;
  53 + for (S t : entities) {
  54 + entityManager.persist(t);
  55 + savedEntities.add(t);
  56 + i++;
  57 + if (i % batchSize == 0) {
  58 + entityManager.flush();
  59 + entityManager.clear();
  60 + }
  61 + }
  62 + return savedEntities;
  63 + }
  64 +
  65 + // Research操作
  66 + @Override
  67 + public T findById(ID id) {
  68 + if (logger.isDebugEnabled()) {
  69 + logger.debug("findById...");
  70 + }
  71 +
  72 + return baseRepository.findOne(id);
  73 + }
  74 + @Override
  75 + public List<T> findAll() {
  76 + if (logger.isDebugEnabled()) {
  77 + logger.debug("findAll...");
  78 + }
  79 +
  80 + return (List<T>) baseRepository.findAll();
  81 + }
  82 + @Override
  83 + public Page<T> list(Map<String, Object> param, Pageable pageable) {
  84 + if (logger.isDebugEnabled()) {
  85 + logger.debug("list(...,pageable)...");
  86 + }
  87 +
  88 + // 自定义查询参数
  89 + Specification<T> specification = new CustomerSpecs<>(param);
  90 + return baseRepository.findAll(specification, pageable);
  91 + }
  92 + @Override
  93 + public List<T> list(Map<String, Object> param) {
  94 + if (logger.isDebugEnabled()) {
  95 + logger.debug("list...");
  96 + }
  97 +
  98 + // 自定义查询参数
  99 + Specification<T> specification = new CustomerSpecs<>(param);
  100 + return baseRepository.findAll(specification);
  101 + }
  102 + // Delete操作
  103 + @Override
  104 + public void delete(ID id) throws ScheduleException {
  105 + if (logger.isDebugEnabled()) {
  106 + logger.debug("delete...");
  107 + }
  108 +
  109 + baseRepository.delete(id);
  110 + }
  111 +}
src/main/java/com/bsth/service/schedule/impl/CarsServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.Cars;
  4 +import com.bsth.service.schedule.CarsService;
  5 +import com.bsth.service.schedule.ScheduleException;
  6 +import org.springframework.stereotype.Service;
  7 +import org.springframework.transaction.annotation.Transactional;
  8 +import org.springframework.util.CollectionUtils;
  9 +
  10 +import java.util.HashMap;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * Created by xu on 16/12/8.
  15 + */
  16 +@Service(value = "carsServiceImpl_sc")
  17 +public class CarsServiceImpl extends BServiceImpl<Cars, Integer> implements CarsService {
  18 +
  19 + @Override
  20 + @Transactional
  21 + public void validate_nbbh(Cars cars) throws ScheduleException {
  22 + // 查询条件
  23 + Map<String, Object> param = new HashMap<>();
  24 + if (cars.getId() != null) {
  25 + param.put("id_ne", cars.getId());
  26 + }
  27 + param.put("insideCode_eq", cars.getInsideCode());
  28 + if (!CollectionUtils.isEmpty(list(param))) {
  29 + throw new ScheduleException("车辆内部编号/自编号重复");
  30 + }
  31 + }
  32 +
  33 + @Override
  34 + @Transactional
  35 + public void validate_clbh(Cars cars) throws ScheduleException {
  36 + // 查询条件
  37 + Map<String, Object> param = new HashMap<>();
  38 + if (cars.getId() != null) {
  39 + param.put("id_ne", cars.getId());
  40 + }
  41 + param.put("carCode_eq", cars.getCarCode());
  42 + if (!CollectionUtils.isEmpty(list(param))) {
  43 + throw new ScheduleException("车辆编号重复");
  44 + }
  45 + }
  46 +
  47 + @Override
  48 + @Transactional
  49 + public void validate_cph(Cars cars) throws ScheduleException {
  50 + // 查询条件
  51 + Map<String, Object> param = new HashMap<>();
  52 + if (cars.getId() != null) {
  53 + param.put("id_ne", cars.getId());
  54 + }
  55 + param.put("carPlate_eq", cars.getCarPlate());
  56 + if (!CollectionUtils.isEmpty(list(param))) {
  57 + throw new ScheduleException("车牌号重复");
  58 + }
  59 + }
  60 +
  61 + @Override
  62 + @Transactional
  63 + public void validate_sbbh(Cars cars) throws ScheduleException {
  64 + // 查询条件
  65 + Map<String, Object> param = new HashMap<>();
  66 + if (cars.getId() != null) {
  67 + param.put("id_ne", cars.getId());
  68 + }
  69 + param.put("equipmentCode_eq", cars.getEquipmentCode());
  70 + if (!CollectionUtils.isEmpty(list(param))) {
  71 + throw new ScheduleException("设备编号重复");
  72 + }
  73 + }
  74 +}
src/main/java/com/bsth/service/schedule/impl/GuideboardInfoServiceImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.schedule.GuideboardInfo;
  4 +import com.bsth.entity.schedule.TTInfoDetail;
  5 +import com.bsth.service.schedule.GuideboardInfoService;
  6 +import com.bsth.service.schedule.ScheduleException;
  7 +import com.bsth.service.schedule.TTInfoDetailService;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Service;
  10 +import org.springframework.util.CollectionUtils;
  11 +
  12 +import javax.transaction.Transactional;
  13 +import java.util.HashMap;
  14 +import java.util.List;
  15 +import java.util.Map;
  16 +
  17 +/**
  18 + * 路牌信息服务。
  19 + */
  20 +@Service
  21 +public class GuideboardInfoServiceImpl extends BServiceImpl<GuideboardInfo, Long> implements GuideboardInfoService {
  22 + @Autowired
  23 + private TTInfoDetailService ttInfoDetailService;
  24 +
  25 + // 验证方法
  26 + @Transactional
  27 + public void validate(GuideboardInfo guideboardInfo) throws ScheduleException {
  28 + // 查询条件
  29 + Map<String, Object> param = new HashMap<>();
  30 + if (guideboardInfo.getId() != null)
  31 + param.put("id_ne", guideboardInfo.getId());
  32 +
  33 + if (guideboardInfo.getXl() == null || guideboardInfo.getXl().getId() == null) {
  34 + throw new ScheduleException("线路未选择");
  35 + } else {
  36 + param.put("xl.id_eq", guideboardInfo.getXl().getId());
  37 +
  38 +// param.put("isCancel_eq", false); // 作废的也算入判定区
  39 + if (guideboardInfo.getLpNo() != null) {
  40 + if (guideboardInfo.getLpName() != null) {
  41 + // 如果两个都写了,分开查询
  42 + param.put("lpNo_eq", guideboardInfo.getLpNo());
  43 + if (!CollectionUtils.isEmpty(list(param))) {
  44 + throw new ScheduleException("路牌编号重复");
  45 + }
  46 + param.remove("lpNo_eq");
  47 + param.put("lpName_eq", guideboardInfo.getLpName());
  48 + if (!CollectionUtils.isEmpty(list(param))) {
  49 + throw new ScheduleException("路牌名称重复");
  50 + }
  51 +
  52 + } else {
  53 + param.put("lpNo_eq", guideboardInfo.getLpNo());
  54 + if (!CollectionUtils.isEmpty(list(param))) {
  55 + throw new ScheduleException("路牌编号重复");
  56 + }
  57 + }
  58 + } else {
  59 + if (guideboardInfo.getLpName() != null) {
  60 + param.put("lpName_eq", guideboardInfo.getLpName());
  61 + if (!CollectionUtils.isEmpty(list(param))) {
  62 + throw new ScheduleException("路牌名字重复");
  63 + }
  64 + } else {
  65 + // 都为空
  66 + throw new ScheduleException("路牌编号名字都为空");
  67 + }
  68 + }
  69 + }
  70 +
  71 + }
  72 +
  73 + @Transactional
  74 + @Override
  75 + public void delete(Long aLong) throws ScheduleException {
  76 + // 删除操作就是作废操作
  77 + toggleCancel(aLong);
  78 + }
  79 +
  80 + // 作废方法
  81 + @Transactional
  82 + public void toggleCancel(Long id) throws ScheduleException {
  83 + GuideboardInfo guideboardInfo = findById(id);
  84 + Map<String, Object> param = new HashMap<>();
  85 + if (guideboardInfo.getIsCancel()) {
  86 + validate(guideboardInfo);
  87 + guideboardInfo.setIsCancel(false);
  88 + } else {
  89 + param.clear();
  90 + param.put("xl.id_eq", guideboardInfo.getXl().getId());
  91 + param.put("ttinfo.isCancel_eq", false);
  92 + param.put("lp.id_eq", guideboardInfo.getId());
  93 + List<TTInfoDetail> ttInfoDetailList = (List<TTInfoDetail>) ttInfoDetailService.list(param);
  94 + if (CollectionUtils.isEmpty(ttInfoDetailList)) {
  95 + guideboardInfo.setIsCancel(true);
  96 + } else {
  97 + throw new ScheduleException("在时刻表" +
  98 + ttInfoDetailList.get(0).getTtinfo().getName() +
  99 + "已使用,无法删除!");
  100 + }
  101 + }
  102 + }
  103 +
  104 +}
src/main/resources/static/pages/scheduleApp/Gruntfile.js
@@ -14,6 +14,9 @@ module.exports = function (grunt) { @@ -14,6 +14,9 @@ module.exports = function (grunt) {
14 }, 14 },
15 concat_route: { // 所有模块的route配置合并的js文件 15 concat_route: { // 所有模块的route配置合并的js文件
16 src: ['module/common/prj-common-ui-route-state.js'] 16 src: ['module/common/prj-common-ui-route-state.js']
  17 + },
  18 + concat_service: { // 所有模块的servie服务合并的js文件
  19 + src: ['module/common/prj-common-globalservice.js']
17 } 20 }
18 21
19 //, 22 //,
@@ -69,11 +72,13 @@ module.exports = function (grunt) { @@ -69,11 +72,13 @@ module.exports = function (grunt) {
69 'module/common/dts1/load/loadingWidget.js', // loading界面指令 72 'module/common/dts1/load/loadingWidget.js', // loading界面指令
70 'module/common/dts1/validation/remoteValidation.js',// 服务端验证指令 73 'module/common/dts1/validation/remoteValidation.js',// 服务端验证指令
71 'module/common/dts1/validation/remoteValidationt2.js',// 服务端验证指令(时刻表专用) 74 'module/common/dts1/validation/remoteValidationt2.js',// 服务端验证指令(时刻表专用)
  75 + 'module/common/dts1/validation/remoteValidation3.js',// 服务端验证指令
72 'module/common/dts1/select/saSelect.js', // select整合指令1 76 'module/common/dts1/select/saSelect.js', // select整合指令1
73 'module/common/dts1/select/saSelect2.js', // select整合指令2 77 'module/common/dts1/select/saSelect2.js', // select整合指令2
74 'module/common/dts1/select/saSelect3.js', // select整合指令3 78 'module/common/dts1/select/saSelect3.js', // select整合指令3
75 'module/common/dts1/select/saSelect4.js', // select整合指令4 79 'module/common/dts1/select/saSelect4.js', // select整合指令4
76 'module/common/dts1/select/saSelect5.js', // select整合指令5 80 'module/common/dts1/select/saSelect5.js', // select整合指令5
  81 + 'module/common/dts2/ttinfotable/mySelect.js', // select整合指令
77 'module/common/dts1/radioButton/saRadiogroup.js', // 单选框组整合指令 82 'module/common/dts1/radioButton/saRadiogroup.js', // 单选框组整合指令
78 'module/common/dts1/checkbox/saCheckboxgroup.js', // 多选框组整合指令 83 'module/common/dts1/checkbox/saCheckboxgroup.js', // 多选框组整合指令
79 'module/common/dts2/dateGroup/saDategroup.js', // 特殊日期选择指令 84 'module/common/dts2/dateGroup/saDategroup.js', // 特殊日期选择指令
@@ -104,6 +109,26 @@ module.exports = function (grunt) { @@ -104,6 +109,26 @@ module.exports = function (grunt) {
104 'module/core/ttInfoManage/detailedit/route.js' // 时刻表明细管理模块 109 'module/core/ttInfoManage/detailedit/route.js' // 时刻表明细管理模块
105 ], 110 ],
106 dest: 'module/common/prj-common-ui-route-state.js' 111 dest: 'module/common/prj-common-ui-route-state.js'
  112 + },
  113 + service: {
  114 + options: {
  115 + banner: '//所有模块service配置\n'
  116 + },
  117 + src: [
  118 + 'module/basicInfo/busInfoManage/service.js', // 车辆基础信息管理service
  119 + 'module/basicInfo/deviceInfoManage/service.js', // 设备信息管理service
  120 + 'module/basicInfo/employeeInfoManage/service.js', // 人员基础信息管理service
  121 + 'module/core/busConfig/service.js', // 车辆配置service
  122 + 'module/core/busLineInfoStat/service.js', // 线路运营概览service
  123 + 'module/core/employeeConfig/service.js', // 人员配置service
  124 + 'module/core/guideboardManage/service.js', // 路牌管理service
  125 + 'module/core/rerunManage/service.js', // 套跑管理service
  126 + 'module/core/schedulePlanManage/service.js', // 排班计划管理service
  127 + 'module/core/scheduleRuleManage/service.js', // 排班规则管理service
  128 + 'module/core/ttInfoManage/service.js', // 时刻表管理service
  129 + 'module/common/prj-common-globalservice-legacy.js' // 其他用service
  130 + ],
  131 + dest: 'module/common/prj-common-globalservice.js'
107 } 132 }
108 }, 133 },
109 134
@@ -440,4 +465,14 @@ module.exports = function (grunt) { @@ -440,4 +465,14 @@ module.exports = function (grunt) {
440 'clean:concat_route', 'concat:route' 465 'clean:concat_route', 'concat:route'
441 ]); 466 ]);
442 467
  468 + /*
  469 + 定义了一个service的grunt任务
  470 + 任务组有顺序,如下说明:
  471 + 1、clean:concat_route,清除合并生成的prj-common-globalservice.js文件
  472 + 2、concat:route,重新合并prj-common-globalservice.js文件
  473 + */
  474 + grunt.registerTask('service', [
  475 + 'clean:concat_service', 'concat:service'
  476 + ]);
  477 +
443 }; 478 };
444 \ No newline at end of file 479 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/edit.html
@@ -33,8 +33,8 @@ @@ -33,8 +33,8 @@
33 <div class="portlet-body form"> 33 <div class="portlet-body form">
34 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> 34 <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
35 <!--<div class="alert alert-danger display-hide">--> 35 <!--<div class="alert alert-danger display-hide">-->
36 - <!--<button class="close" data-close="alert"></button>-->  
37 - <!--您的输入有误,请检查下面的输入项--> 36 + <!--<button class="close" data-close="alert"></button>-->
  37 + <!--您的输入有误,请检查下面的输入项-->
38 <!--</div>--> 38 <!--</div>-->
39 39
40 40
@@ -45,9 +45,9 @@ @@ -45,9 +45,9 @@
45 <div class="col-md-3"> 45 <div class="col-md-3">
46 <input type="text" class="form-control" 46 <input type="text" class="form-control"
47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode" 47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode"
48 - required ng-maxlength="8" 48 + required ng-maxlength="20"
49 remote-Validation 49 remote-Validation
50 - remotevtype="cl1" 50 + remotevtype="cars_zbh"
51 remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}" 51 remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}"
52 placeholder="请输入车辆内部编码"/> 52 placeholder="请输入车辆内部编码"/>
53 </div> 53 </div>
@@ -56,10 +56,10 @@ @@ -56,10 +56,10 @@
56 内部编号必须填写 56 内部编号必须填写
57 </div> 57 </div>
58 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength"> 58 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength">
59 - 内部编号长度不能超过8 59 + 内部编号长度不能超过20
60 </div> 60 </div>
61 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.remote"> 61 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.remote">
62 - 内部编号不能重复 62 + {{$remote_msg}}
63 </div> 63 </div>
64 </div> 64 </div>
65 65
@@ -78,6 +78,7 @@ @@ -78,6 +78,7 @@
78 datatype="gsType" 78 datatype="gsType"
79 required > 79 required >
80 </sa-Select3> 80 </sa-Select3>
  81 +
81 </div> 82 </div>
82 <!-- 隐藏块,显示验证信息 --> 83 <!-- 隐藏块,显示验证信息 -->
83 <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> 84 <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required">
@@ -103,26 +104,40 @@ @@ -103,26 +104,40 @@
103 <label class="col-md-2 control-label">车辆编码*:</label> 104 <label class="col-md-2 control-label">车辆编码*:</label>
104 <div class="col-md-3"> 105 <div class="col-md-3">
105 <input type="text" class="form-control" 106 <input type="text" class="form-control"
106 - name="carCode" ng-model="ctrl.busInfoForSave.carCode"  
107 - required placeholder="请输入车辆编码"/> 107 + name="carCode" ng-model="ctrl.busInfoForSave.carCode"
  108 + required placeholder="请输入车辆编码"
  109 + remote-Validation
  110 + remotevtype="cars_clbh"
  111 + remotevparam="{{ {'carCode_eq': ctrl.busInfoForSave.carCode} | json}}"
  112 + />
108 </div> 113 </div>
109 <!-- 隐藏块,显示验证信息 --> 114 <!-- 隐藏块,显示验证信息 -->
110 <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.required"> 115 <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.required">
111 车辆编码必须填写 116 车辆编码必须填写
112 </div> 117 </div>
  118 + <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.remote">
  119 + {{$remote_msg}}
  120 + </div>
113 </div> 121 </div>
114 122
115 <div class="form-group has-success has-feedback"> 123 <div class="form-group has-success has-feedback">
116 <label class="col-md-2 control-label">车牌号*:</label> 124 <label class="col-md-2 control-label">车牌号*:</label>
117 <div class="col-md-3"> 125 <div class="col-md-3">
118 <input type="text" class="form-control" 126 <input type="text" class="form-control"
119 - name="carPlate" ng-model="ctrl.busInfoForSave.carPlate"  
120 - required placeholder="请输入车牌号"/> 127 + name="carPlate" ng-model="ctrl.busInfoForSave.carPlate"
  128 + required placeholder="请输入车牌号"
  129 + remote-Validation
  130 + remotevtype="cars_cph"
  131 + remotevparam="{{ {'carPlate_eq': ctrl.busInfoForSave.carPlate} | json}}"
  132 + />
121 </div> 133 </div>
122 <!-- 隐藏快,显示验证信息 --> 134 <!-- 隐藏快,显示验证信息 -->
123 <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.required"> 135 <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.required">
124 车牌号必须填写 136 车牌号必须填写
125 </div> 137 </div>
  138 + <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.remote">
  139 + {{$remote_msg}}
  140 + </div>
126 </div> 141 </div>
127 142
128 <div class="form-group has-success has-feedback"> 143 <div class="form-group has-success has-feedback">
@@ -149,62 +164,69 @@ @@ -149,62 +164,69 @@
149 <label class="col-md-2 control-label">终端号*:</label> 164 <label class="col-md-2 control-label">终端号*:</label>
150 <div class="col-md-3"> 165 <div class="col-md-3">
151 <input type="text" class="form-control" 166 <input type="text" class="form-control"
152 - name="equipmentCode" ng-model="ctrl.busInfoForSave.equipmentCode"  
153 - required placeholder="请输入设备终端号"/> 167 + name="equipmentCode" ng-model="ctrl.busInfoForSave.equipmentCode"
  168 + required placeholder="请输入设备终端号"
  169 + remote-Validation
  170 + remotevtype="cars_sbbh"
  171 + remotevparam="{{ {'equipmentCode_eq': ctrl.busInfoForSave.equipmentCode} | json}}"
  172 + />
154 </div> 173 </div>
155 <!-- 隐藏块,显示验证信息 --> 174 <!-- 隐藏块,显示验证信息 -->
156 <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.required"> 175 <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.required">
157 设备终端号必须填写 176 设备终端号必须填写
158 </div> 177 </div>
  178 + <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.remote">
  179 + {{$remote_msg}}
  180 + </div>
159 </div> 181 </div>
160 182
161 <div class="form-group"> 183 <div class="form-group">
162 <label class="col-md-2 control-label">车型类别:</label> 184 <label class="col-md-2 control-label">车型类别:</label>
163 <div class="col-md-4"> 185 <div class="col-md-4">
164 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carClass" 186 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carClass"
165 - placeholder="请输入车型类别"/> 187 + placeholder="请输入车型类别"/>
166 </div> 188 </div>
167 </div> 189 </div>
168 <div class="form-group"> 190 <div class="form-group">
169 <label class="col-md-2 control-label">技术速度:</label> 191 <label class="col-md-2 control-label">技术速度:</label>
170 <div class="col-md-4"> 192 <div class="col-md-4">
171 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.speed" 193 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.speed"
172 - placeholder="请输入技术速度"/> 194 + placeholder="请输入技术速度"/>
173 </div> 195 </div>
174 </div> 196 </div>
175 <div class="form-group"> 197 <div class="form-group">
176 <label class="col-md-2 control-label">座位数:</label> 198 <label class="col-md-2 control-label">座位数:</label>
177 <div class="col-md-4"> 199 <div class="col-md-4">
178 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carSeatnNumber" 200 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carSeatnNumber"
179 - placeholder="请输入座位数"/> 201 + placeholder="请输入座位数"/>
180 </div> 202 </div>
181 </div> 203 </div>
182 <div class="form-group"> 204 <div class="form-group">
183 <label class="col-md-2 control-label">载客标准:</label> 205 <label class="col-md-2 control-label">载客标准:</label>
184 <div class="col-md-4"> 206 <div class="col-md-4">
185 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carStandard" 207 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carStandard"
186 - placeholder="请输入载客标准"/> 208 + placeholder="请输入载客标准"/>
187 </div> 209 </div>
188 </div> 210 </div>
189 <div class="form-group"> 211 <div class="form-group">
190 <label class="col-md-2 control-label">标准油耗/开空调:</label> 212 <label class="col-md-2 control-label">标准油耗/开空调:</label>
191 <div class="col-md-4"> 213 <div class="col-md-4">
192 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.kburnStandard" 214 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.kburnStandard"
193 - placeholder="请输入标准油耗/开空调"/> 215 + placeholder="请输入标准油耗/开空调"/>
194 </div> 216 </div>
195 </div> 217 </div>
196 <div class="form-group"> 218 <div class="form-group">
197 <label class="col-md-2 control-label">标准油耗/关空调:</label> 219 <label class="col-md-2 control-label">标准油耗/关空调:</label>
198 <div class="col-md-4"> 220 <div class="col-md-4">
199 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.gburnStandard" 221 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.gburnStandard"
200 - placeholder="请输入标准油耗/关空调"/> 222 + placeholder="请输入标准油耗/关空调"/>
201 </div> 223 </div>
202 </div> 224 </div>
203 <div class="form-group"> 225 <div class="form-group">
204 <label class="col-md-2 control-label">报废号:</label> 226 <label class="col-md-2 control-label">报废号:</label>
205 <div class="col-md-4"> 227 <div class="col-md-4">
206 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.scrapCode" 228 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.scrapCode"
207 - placeholder="请输入报废号"/> 229 + placeholder="请输入报废号"/>
208 </div> 230 </div>
209 </div> 231 </div>
210 232
@@ -229,56 +251,56 @@ @@ -229,56 +251,56 @@
229 <label class="col-md-2 control-label">厂牌型号1:</label> 251 <label class="col-md-2 control-label">厂牌型号1:</label>
230 <div class="col-md-4"> 252 <div class="col-md-4">
231 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.makeCodeOne" 253 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.makeCodeOne"
232 - placeholder="请输入厂牌型号1"/> 254 + placeholder="请输入厂牌型号1"/>
233 </div> 255 </div>
234 </div> 256 </div>
235 <div class="form-group"> 257 <div class="form-group">
236 <label class="col-md-2 control-label">厂牌型号2:</label> 258 <label class="col-md-2 control-label">厂牌型号2:</label>
237 <div class="col-md-4"> 259 <div class="col-md-4">
238 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.makeCodeTwo" 260 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.makeCodeTwo"
239 - placeholder="请输入厂牌型号2"/> 261 + placeholder="请输入厂牌型号2"/>
240 </div> 262 </div>
241 </div> 263 </div>
242 <div class="form-group"> 264 <div class="form-group">
243 <label class="col-md-2 control-label">车辆等级标准:</label> 265 <label class="col-md-2 control-label">车辆等级标准:</label>
244 <div class="col-md-4"> 266 <div class="col-md-4">
245 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carGride" 267 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carGride"
246 - placeholder="请输入车辆等级标准"/> 268 + placeholder="请输入车辆等级标准"/>
247 </div> 269 </div>
248 </div> 270 </div>
249 <div class="form-group"> 271 <div class="form-group">
250 <label class="col-md-2 control-label">出厂排放标准:</label> 272 <label class="col-md-2 control-label">出厂排放标准:</label>
251 <div class="col-md-4"> 273 <div class="col-md-4">
252 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.emissionsStandard" 274 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.emissionsStandard"
253 - placeholder="请输入出场排放标准"/> 275 + placeholder="请输入出场排放标准"/>
254 </div> 276 </div>
255 </div> 277 </div>
256 <div class="form-group"> 278 <div class="form-group">
257 <label class="col-md-2 control-label">发动机号码1:</label> 279 <label class="col-md-2 control-label">发动机号码1:</label>
258 <div class="col-md-4"> 280 <div class="col-md-4">
259 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.engineCodeOne" 281 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.engineCodeOne"
260 - placeholder="请输入发动机号码1"/> 282 + placeholder="请输入发动机号码1"/>
261 </div> 283 </div>
262 </div> 284 </div>
263 <div class="form-group"> 285 <div class="form-group">
264 <label class="col-md-2 control-label">发动机号码2:</label> 286 <label class="col-md-2 control-label">发动机号码2:</label>
265 <div class="col-md-4"> 287 <div class="col-md-4">
266 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.engineCodeTwo" 288 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.engineCodeTwo"
267 - placeholder="请输入发动机号码2"/> 289 + placeholder="请输入发动机号码2"/>
268 </div> 290 </div>
269 </div> 291 </div>
270 <div class="form-group"> 292 <div class="form-group">
271 <label class="col-md-2 control-label">车架号码1:</label> 293 <label class="col-md-2 control-label">车架号码1:</label>
272 <div class="col-md-4"> 294 <div class="col-md-4">
273 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carNumberOne" 295 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carNumberOne"
274 - placeholder="请输入车架号码1"/> 296 + placeholder="请输入车架号码1"/>
275 </div> 297 </div>
276 </div> 298 </div>
277 <div class="form-group"> 299 <div class="form-group">
278 <label class="col-md-2 control-label">车架号码2:</label> 300 <label class="col-md-2 control-label">车架号码2:</label>
279 <div class="col-md-4"> 301 <div class="col-md-4">
280 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carNumberTwo" 302 <input type="text" class="form-control" ng-model="ctrl.busInfoForSave.carNumberTwo"
281 - placeholder="请输入车架号码2"/> 303 + placeholder="请输入车架号码2"/>
282 </div> 304 </div>
283 </div> 305 </div>
284 <div class="form-group"> 306 <div class="form-group">
@@ -422,5 +444,4 @@ @@ -422,5 +444,4 @@
422 444
423 </div> 445 </div>
424 446
425 -  
426 </div> 447 </div>
427 \ No newline at end of file 448 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/form.html
@@ -45,9 +45,9 @@ @@ -45,9 +45,9 @@
45 <div class="col-md-3"> 45 <div class="col-md-3">
46 <input type="text" class="form-control" 46 <input type="text" class="form-control"
47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode" 47 name="insideCode" ng-model="ctrl.busInfoForSave.insideCode"
48 - required ng-maxlength="8" 48 + required ng-maxlength="20"
49 remote-Validation 49 remote-Validation
50 - remotevtype="cl1" 50 + remotevtype="cars_zbh"
51 remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}" 51 remotevparam="{{ {'insideCode_eq': ctrl.busInfoForSave.insideCode} | json}}"
52 placeholder="请输入车辆内部编码"/> 52 placeholder="请输入车辆内部编码"/>
53 </div> 53 </div>
@@ -56,10 +56,10 @@ @@ -56,10 +56,10 @@
56 内部编号必须填写 56 内部编号必须填写
57 </div> 57 </div>
58 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength"> 58 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.maxlength">
59 - 内部编号长度不能超过8 59 + 内部编号长度不能超过20
60 </div> 60 </div>
61 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.remote"> 61 <div class="alert alert-danger well-sm" ng-show="myForm.insideCode.$error.remote">
62 - 内部编号不能重复 62 + {{$remote_msg}}
63 </div> 63 </div>
64 </div> 64 </div>
65 65
@@ -105,12 +105,19 @@ @@ -105,12 +105,19 @@
105 <div class="col-md-3"> 105 <div class="col-md-3">
106 <input type="text" class="form-control" 106 <input type="text" class="form-control"
107 name="carCode" ng-model="ctrl.busInfoForSave.carCode" 107 name="carCode" ng-model="ctrl.busInfoForSave.carCode"
108 - required placeholder="请输入车辆编码"/> 108 + required placeholder="请输入车辆编码"
  109 + remote-Validation
  110 + remotevtype="cars_clbh"
  111 + remotevparam="{{ {'carCode_eq': ctrl.busInfoForSave.carCode} | json}}"
  112 + />
109 </div> 113 </div>
110 <!-- 隐藏块,显示验证信息 --> 114 <!-- 隐藏块,显示验证信息 -->
111 <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.required"> 115 <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.required">
112 车辆编码必须填写 116 车辆编码必须填写
113 </div> 117 </div>
  118 + <div class="alert alert-danger well-sm" ng-show="myForm.carCode.$error.remote">
  119 + {{$remote_msg}}
  120 + </div>
114 </div> 121 </div>
115 122
116 <div class="form-group has-success has-feedback"> 123 <div class="form-group has-success has-feedback">
@@ -118,12 +125,19 @@ @@ -118,12 +125,19 @@
118 <div class="col-md-3"> 125 <div class="col-md-3">
119 <input type="text" class="form-control" 126 <input type="text" class="form-control"
120 name="carPlate" ng-model="ctrl.busInfoForSave.carPlate" 127 name="carPlate" ng-model="ctrl.busInfoForSave.carPlate"
121 - required placeholder="请输入车牌号"/> 128 + required placeholder="请输入车牌号"
  129 + remote-Validation
  130 + remotevtype="cars_cph"
  131 + remotevparam="{{ {'carPlate_eq': ctrl.busInfoForSave.carPlate} | json}}"
  132 + />
122 </div> 133 </div>
123 <!-- 隐藏快,显示验证信息 --> 134 <!-- 隐藏快,显示验证信息 -->
124 <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.required"> 135 <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.required">
125 车牌号必须填写 136 车牌号必须填写
126 </div> 137 </div>
  138 + <div class="alert alert-danger well-sm" ng-show="myForm.carPlate.$error.remote">
  139 + {{$remote_msg}}
  140 + </div>
127 </div> 141 </div>
128 142
129 <div class="form-group has-success has-feedback"> 143 <div class="form-group has-success has-feedback">
@@ -151,12 +165,19 @@ @@ -151,12 +165,19 @@
151 <div class="col-md-3"> 165 <div class="col-md-3">
152 <input type="text" class="form-control" 166 <input type="text" class="form-control"
153 name="equipmentCode" ng-model="ctrl.busInfoForSave.equipmentCode" 167 name="equipmentCode" ng-model="ctrl.busInfoForSave.equipmentCode"
154 - required placeholder="请输入设备终端号"/> 168 + required placeholder="请输入设备终端号"
  169 + remote-Validation
  170 + remotevtype="cars_sbbh"
  171 + remotevparam="{{ {'equipmentCode_eq': ctrl.busInfoForSave.equipmentCode} | json}}"
  172 + />
155 </div> 173 </div>
156 <!-- 隐藏块,显示验证信息 --> 174 <!-- 隐藏块,显示验证信息 -->
157 <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.required"> 175 <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.required">
158 设备终端号必须填写 176 设备终端号必须填写
159 </div> 177 </div>
  178 + <div class="alert alert-danger well-sm" ng-show="myForm.equipmentCode.$error.remote">
  179 + {{$remote_msg}}
  180 + </div>
160 </div> 181 </div>
161 182
162 <div class="form-group"> 183 <div class="form-group">
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/list.html
@@ -7,12 +7,12 @@ @@ -7,12 +7,12 @@
7 <th style="width: 50px;">序号</th> 7 <th style="width: 50px;">序号</th>
8 <th style="width: 130px;">车辆编号</th> 8 <th style="width: 130px;">车辆编号</th>
9 <th style="width: 130px;">内部编号</th> 9 <th style="width: 130px;">内部编号</th>
10 - <th >设备编号</th>  
11 - <th >车牌号</th>  
12 - <th style="width: 15%;">所在公司</th>  
13 - <th >所在分公司</th>  
14 - <th style="width: 10%">是否电车</th>  
15 - <th style="width: 21%">操作</th> 10 + <th style="width: 130px;">设备编号</th>
  11 + <th style="width: 130px;">车牌号</th>
  12 + <th style="width: 150px;">所在公司</th>
  13 + <th style="width: 100px;">所在分公司</th>
  14 + <th style="width: 80px">是否电车</th>
  15 + <th style="width: 100%">操作</th>
16 </tr> 16 </tr>
17 <tr role="row" class="filter"> 17 <tr role="row" class="filter">
18 <td></td> 18 <td></td>
@@ -23,8 +23,10 @@ @@ -23,8 +23,10 @@
23 <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().insideCode_like" placeholder="输入内部编号..."/> 23 <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().insideCode_like" placeholder="输入内部编号..."/>
24 </td> 24 </td>
25 <td> 25 <td>
  26 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().equipmentCode_like" placeholder="输入设备编号..."/>
26 </td> 27 </td>
27 <td> 28 <td>
  29 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition().carCode_like" placeholder="输入车牌号..."/>
28 </td> 30 </td>
29 <td> 31 <td>
30 <div> 32 <div>
@@ -47,18 +49,18 @@ @@ -47,18 +49,18 @@
47 </td> 49 </td>
48 <td> 50 <td>
49 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" 51 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
50 - ng-click="ctrl.pageChanaged()"> 52 + ng-click="ctrl.doPage()">
51 <i class="fa fa-search"></i> 搜索</button> 53 <i class="fa fa-search"></i> 搜索</button>
52 54
53 <button class="btn btn-sm red btn-outline filter-cancel" 55 <button class="btn btn-sm red btn-outline filter-cancel"
54 - ng-click="ctrl.resetSearchCondition()"> 56 + ng-click="ctrl.reset()">
55 <i class="fa fa-times"></i> 重置</button> 57 <i class="fa fa-times"></i> 重置</button>
56 </td> 58 </td>
57 59
58 </tr> 60 </tr>
59 </thead> 61 </thead>
60 <tbody> 62 <tbody>
61 - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> 63 + <tr ng-repeat="info in ctrl.page()['content']" class="odd gradeX">
62 <td> 64 <td>
63 <span ng-bind="$index + 1"></span> 65 <span ng-bind="$index + 1"></span>
64 </td> 66 </td>
@@ -96,9 +98,9 @@ @@ -96,9 +98,9 @@
96 </div> 98 </div>
97 99
98 <div style="text-align: right;"> 100 <div style="text-align: right;">
99 - <uib-pagination total-items="ctrl.pageInfo.totalItems"  
100 - ng-model="ctrl.pageInfo.currentPage"  
101 - ng-change="ctrl.pageChanaged()" 101 + <uib-pagination total-items="ctrl.page()['totalElements']"
  102 + ng-model="ctrl.page()['uiNumber']"
  103 + ng-change="ctrl.doPage()"
102 rotate="false" 104 rotate="false"
103 max-size="10" 105 max-size="10"
104 boundary-links="true" 106 boundary-links="true"
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
1 // 车辆基础信息维护 service controller等写在一起 1 // 车辆基础信息维护 service controller等写在一起
2 2
3 -angular.module('ScheduleApp').factory('BusInfoManageService', ['BusInfoManageService_g', function(service) { 3 +angular.module('ScheduleApp').factory(
  4 + 'BusInfoManageService',
  5 + [
  6 + 'BusInfoManageService_g',
  7 + function(service) {
4 8
5 - /** 当前的查询条件信息 */  
6 - var currentSearchCondition = {  
7 - "carCode_like" : "",  
8 - "insideCode_like" : "",  
9 - "equipmentCode_like" : "",  
10 - "carPlate_like" : ""  
11 - };  
12 -  
13 - /** 当前第几页 */  
14 - var currentPageNo = 1;  
15 - return {  
16 - /**  
17 - * 获取查询条件信息,  
18 - * 用于给controller用来和页面数据绑定。  
19 - */  
20 - getSearchCondition: function() {  
21 - return currentSearchCondition;  
22 - },  
23 - /**  
24 - * 重置查询条件信息。  
25 - */  
26 - resetSearchCondition: function() {  
27 - var key;  
28 - for (key in currentSearchCondition) {  
29 - currentSearchCondition[key] = undefined;  
30 - }  
31 - currentPageNo = 1;  
32 - },  
33 - /**  
34 - * 设置当前页码。  
35 - * @param cpn 从1开始,后台是从0开始的  
36 - */  
37 - setCurrentPageNo: function(cpn) {  
38 - currentPageNo = cpn;  
39 - },  
40 - /**  
41 - * 组装查询参数,返回一个promise查询结果。  
42 - * @param params 查询参数  
43 - * @return 返回一个 promise  
44 - */  
45 - getPage: function() {  
46 - var params = currentSearchCondition; // 查询条件  
47 - params.page = currentPageNo - 1; // 服务端页码从0开始  
48 - return service.rest.list(params).$promise;  
49 - },  
50 - /**  
51 - * 获取明细信息。  
52 - * @param id 车辆id  
53 - * @return 返回一个 promise  
54 - */  
55 - getDetail: function(id) {  
56 - var params = {id: id};  
57 - return service.rest.get(params).$promise;  
58 - },  
59 - /**  
60 - * 保存信息。  
61 - * @param obj 车辆详细信息  
62 - * @return 返回一个 promise  
63 - */  
64 - saveDetail: function(obj) {  
65 - return service.rest.save(obj).$promise;  
66 - },  
67 - /**  
68 - * 数据导出。  
69 - * @returns {*|Function|promise|n}  
70 - */  
71 - dataExport: function() {  
72 - return service.dataTools.dataExport().$promise;  
73 - }  
74 - };  
75 -}]); 9 + /** 当前的查询条件信息 */
  10 + var currentSearchCondition = {
  11 + page: 0,
  12 + "carCode_like" : "",
  13 + "insideCode_like" : "",
  14 + "equipmentCode_like" : "",
  15 + "carPlate_like" : ""
  16 + };
  17 + // 当前查询返回的信息
  18 + var currentPage = { // 后台spring data返回的格式
  19 + totalElements: 0,
  20 + number: 0, // 后台返回的页码,spring返回从0开始
  21 + content: [],
76 22
77 -angular.module('ScheduleApp').controller('BusInfoManageCtrl', [  
78 - 'BusInfoManageService','$state', '$uibModal', 'FileDownload_g',  
79 - function(busInfoManageService, $state, $uibModal, fileDownload) {  
80 - var self = this; 23 + uiNumber: 1 // 页面绑定的页码
  24 + };
81 25
82 - // 切换到form状态  
83 - self.goForm = function() {  
84 - //alert("切换");  
85 - $state.go("busInfoManage_form");  
86 - }; 26 + // 查询对象
  27 + var queryClass = service.rest;
87 28
88 - // 导入excel  
89 - self.importData = function() {  
90 - // large方式弹出模态对话框  
91 - var modalInstance = $uibModal.open({  
92 - templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html',  
93 - size: "lg",  
94 - animation: true,  
95 - backdrop: 'static',  
96 - resolve: {  
97 - // 可以传值给controller 29 + return {
  30 + getQueryClass: function() {
  31 + return queryClass;
98 }, 32 },
99 - windowClass: 'center-modal',  
100 - controller: "BusInfoManageToolsCtrl",  
101 - controllerAs: "ctrl",  
102 - bindToController: true  
103 - });  
104 - modalInstance.result.then(  
105 - function() {  
106 - console.log("dataImport.html打开"); 33 + /**
  34 + * 获取查询条件信息,
  35 + * 用于给controller用来和页面数据绑定。
  36 + */
  37 + getSearchCondition: function() {
  38 + currentSearchCondition.page = currentPage.uiNumber - 1;
  39 + return currentSearchCondition;
107 }, 40 },
108 - function() {  
109 - console.log("dataImport.html消失");  
110 - }  
111 - );  
112 - };  
113 -  
114 - // 导出excel  
115 - self.exportData = function() {  
116 - busInfoManageService.dataExport().then(  
117 - function(result) {  
118 - fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls"); 41 + /**
  42 + * 组装查询参数,返回一个promise查询结果。
  43 + * @param params 查询参数
  44 + * @return 返回一个 promise
  45 + */
  46 + getPage: function(page) {
  47 + if (page) {
  48 + currentPage.totalElements = page.totalElements;
  49 + currentPage.number = page.number;
  50 + currentPage.content = page.content;
  51 + }
  52 + return currentPage;
119 }, 53 },
120 - function(result) {  
121 - console.log("exportData failed:" + result); 54 + resetStatus: function() {
  55 + currentSearchCondition = {page: 0};
  56 + currentPage = {
  57 + totalElements: 0,
  58 + number: 0,
  59 + content: [],
  60 + uiNumber: 1
  61 + };
  62 + },
  63 +
  64 + /**
  65 + * 数据导出。
  66 + * @returns {*|Function|promise|n}
  67 + */
  68 + dataExport: function() {
  69 + return service.dataTools.dataExport().$promise;
122 } 70 }
123 - );  
124 - };  
125 - }]); 71 + };
  72 +
  73 + }
  74 + ]
  75 +);
  76 +
  77 +// index.html控制器
  78 +angular.module('ScheduleApp').controller(
  79 + 'BusInfoManageCtrl',
  80 + [
  81 + 'BusInfoManageService',
  82 + '$state',
  83 + '$uibModal',
  84 + 'FileDownload_g',
  85 + function(busInfoManageService, $state, $uibModal, fileDownload) {
  86 + var self = this;
  87 +
  88 + // 切换到form状态
  89 + self.goForm = function() {
  90 + //alert("切换");
  91 + $state.go("busInfoManage_form");
  92 + };
  93 +
  94 + // 导入excel
  95 + self.importData = function() {
  96 + // large方式弹出模态对话框
  97 + var modalInstance = $uibModal.open({
  98 + templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html',
  99 + size: "lg",
  100 + animation: true,
  101 + backdrop: 'static',
  102 + resolve: {
  103 + // 可以传值给controller
  104 + },
  105 + windowClass: 'center-modal',
  106 + controller: "BusInfoManageToolsCtrl",
  107 + controllerAs: "ctrl",
  108 + bindToController: true
  109 + });
  110 + modalInstance.result.then(
  111 + function() {
  112 + console.log("dataImport.html打开");
  113 + },
  114 + function() {
  115 + console.log("dataImport.html消失");
  116 + }
  117 + );
  118 + };
  119 +
  120 + // 导出excel
  121 + self.exportData = function() {
  122 + busInfoManageService.dataExport().then(
  123 + function(result) {
  124 + fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls");
  125 + },
  126 + function(result) {
  127 + console.log("exportData failed:" + result);
  128 + }
  129 + );
  130 + };
  131 + }
  132 + ]
  133 +);
126 134
127 angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { 135 angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
128 var self = this; 136 var self = this;
@@ -160,143 +168,114 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;BusInfoManageToolsCtrl&#39;, [&#39;$modalInsta @@ -160,143 +168,114 @@ angular.module(&#39;ScheduleApp&#39;).controller(&#39;BusInfoManageToolsCtrl&#39;, [&#39;$modalInsta
160 168
161 }]); 169 }]);
162 170
  171 +// list.html控制器
  172 +angular.module('ScheduleApp').controller(
  173 + 'BusInfoManageListCtrl',
  174 + [
  175 + 'BusInfoManageService',
  176 + '$scope',
  177 + function(service, $scope) {
  178 + var self = this;
  179 + var Cars = service.getQueryClass();
163 180
164 -angular.module('ScheduleApp').controller('BusInfoManageListCtrl', ['BusInfoManageService','$scope', function(busInfoManageService, $scope) {  
165 - var self = this;  
166 - self.pageInfo = {  
167 - totalItems : 0,  
168 - currentPage : 1,  
169 - infos: []  
170 - }; 181 + self.page = function() {
  182 + return service.getPage();
  183 + };
171 184
172 - // 初始创建的时候,获取一次列表数据  
173 - busInfoManageService.getPage().then(  
174 - function(result) {  
175 - self.pageInfo.totalItems = result.totalElements;  
176 - self.pageInfo.currentPage = result.number + 1;  
177 - self.pageInfo.infos = result.content;  
178 - busInfoManageService.setCurrentPageNo(result.number + 1);  
179 - },  
180 - function(result) {  
181 - alert("出错啦!");  
182 - }  
183 - ); 185 + self.searchCondition = function() {
  186 + return service.getSearchCondition();
  187 + };
184 188
185 - //$scope.$watch("ctrl.pageInfo.currentPage", function() {  
186 - // alert("dfdfdf");  
187 - //}); 189 + self.doPage = function() {
  190 + var result = Cars.list(self.searchCondition(), function() {
  191 + if (!result.status) {
  192 + service.getPage(result);
  193 + }
  194 + });
  195 + };
  196 + self.reset = function() {
  197 + service.resetStatus();
  198 + var result = Cars.list(self.searchCondition(), function() {
  199 + if (!result.status) {
  200 + service.getPage(result);
  201 + }
  202 + });
  203 + };
188 204
189 - // 翻页的时候调用  
190 - self.pageChanaged = function() {  
191 - busInfoManageService.setCurrentPageNo(self.pageInfo.currentPage);  
192 - busInfoManageService.getPage().then(  
193 - function(result) {  
194 - self.pageInfo.totalItems = result.totalElements;  
195 - self.pageInfo.currentPage = result.number + 1;  
196 - self.pageInfo.infos = result.content;  
197 - busInfoManageService.setCurrentPageNo(result.number + 1);  
198 - },  
199 - function(result) {  
200 - alert("出错啦!");  
201 - }  
202 - );  
203 - };  
204 - // 获取查询条件数据  
205 - self.searchCondition = function() {  
206 - return busInfoManageService.getSearchCondition();  
207 - };  
208 - // 重置查询条件  
209 - self.resetSearchCondition = function() {  
210 - busInfoManageService.resetSearchCondition();  
211 - self.pageInfo.currentPage = 1;  
212 - self.pageChanaged();  
213 - };  
214 -}]); 205 + self.doPage();
  206 + }
  207 + ]
  208 +);
215 209
216 -angular.module('ScheduleApp').controller('BusInfoManageFormCtrl', ['BusInfoManageService', '$stateParams', '$state', function(busInfoManageService, $stateParams, $state) {  
217 - var self = this; 210 +// form.html控制器
  211 +angular.module('ScheduleApp').controller(
  212 + 'BusInfoManageFormCtrl',
  213 + [
  214 + 'BusInfoManageService',
  215 + '$stateParams',
  216 + '$state',
  217 + function(service, $stateParams, $state) {
  218 + var self = this;
  219 + var Cars = service.getQueryClass();
218 220
219 - // 报废日期 日期控件开关  
220 - self.scrapDateOpen = false;  
221 - self.scrapDate_open = function() {  
222 - self.scrapDateOpen = true;  
223 - }; 221 + // 报废日期 日期控件开关
  222 + self.scrapDateOpen = false;
  223 + self.scrapDate_open = function() {
  224 + self.scrapDateOpen = true;
  225 + };
224 226
225 - // 启用日期 日期控件开关  
226 - self.openDateOpen = false;  
227 - self.openDate_open = function() {  
228 - self.openDateOpen = true;  
229 - };  
230 - // 取消日期 日期控件开关  
231 - self.closeDateOpen = false;  
232 - self.closeDate_open = function() {  
233 - self.closeDateOpen = true;  
234 - }; 227 + // 启用日期 日期控件开关
  228 + self.openDateOpen = false;
  229 + self.openDate_open = function() {
  230 + self.openDateOpen = true;
  231 + };
  232 + // 取消日期 日期控件开关
  233 + self.closeDateOpen = false;
  234 + self.closeDate_open = function() {
  235 + self.closeDateOpen = true;
  236 + };
235 237
236 - // 欲保存的busInfo信息,绑定  
237 - self.busInfoForSave = {}; 238 + // 欲保存的busInfo信息,绑定
  239 + self.busInfoForSave = new Cars;
238 240
239 - // 获取传过来的id,有的话就是修改,获取一遍数据  
240 - var id = $stateParams.id;  
241 - if (id) {  
242 - self.busInfoForSave.id = id;  
243 - busInfoManageService.getDetail(id).then(  
244 - function(result) {  
245 - var key;  
246 - for (key in result) {  
247 - self.busInfoForSave[key] = result[key];  
248 - }  
249 - },  
250 - function(result) {  
251 - alert("出错啦!"); 241 + // 获取传过来的id,有的话就是修改,获取一遍数据
  242 + var id = $stateParams.id;
  243 + if (id) {
  244 + self.busInfoForSave = Cars.get({id: id}, function() {});
252 } 245 }
253 - );  
254 - }  
255 246
256 - // 提交方法  
257 - self.submit = function() {  
258 - console.log(self.busInfoForSave);  
259 - //if (self.busInfoForSave) {  
260 - // delete $stateParams.id;  
261 - //}  
262 - busInfoManageService.saveDetail(self.busInfoForSave).then(  
263 - function(result) {  
264 - // TODO:弹出框方式以后改  
265 - if (result.status == 'SUCCESS') {  
266 - alert("保存成功!"); 247 + // 提交方法
  248 + self.submit = function() {
  249 + console.log(self.busInfoForSave);
  250 + //if (self.busInfoForSave) {
  251 + // delete $stateParams.id;
  252 + //}
  253 + self.busInfoForSave.$save(function() {
267 $state.go("busInfoManage"); 254 $state.go("busInfoManage");
268 - } else {  
269 - alert("保存异常!");  
270 - }  
271 - },  
272 - function(result) {  
273 - // TODO:弹出框方式以后改  
274 - alert("出错啦!");  
275 - }  
276 - );  
277 - };  
278 -  
279 -}]); 255 + });
  256 + };
  257 + }
  258 + ]
  259 +);
280 260
281 -angular.module('ScheduleApp').controller('BusInfoManageDetailCtrl', ['BusInfoManageService', '$stateParams', function(busInfoManageService, $stateParams) {  
282 - var self = this;  
283 - self.title = "";  
284 - self.busInfoForDetail = {};  
285 - self.busInfoForDetail.id = $stateParams.id; 261 +// detail.html控制器
  262 +angular.module('ScheduleApp').controller(
  263 + 'BusInfoManageDetailCtrl',
  264 + [
  265 + 'BusInfoManageService',
  266 + '$stateParams',
  267 + function(service, $stateParams) {
  268 + var self = this;
  269 + var Cars = service.getQueryClass();
  270 + var id = $stateParams.id;
286 271
287 - // 当转向到此页面时,就获取明细信息并绑定  
288 - busInfoManageService.getDetail($stateParams.id).then(  
289 - function(result) {  
290 - var key;  
291 - for (key in result) {  
292 - self.busInfoForDetail[key] = result[key];  
293 - } 272 + self.title = "";
  273 + self.busInfoForDetail = {};
294 274
295 - self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息";  
296 - },  
297 - function(result) {  
298 - // TODO:弹出框方式以后改  
299 - alert("出错啦!"); 275 + // 当转向到此页面时,就获取明细信息并绑定
  276 + self.busInfoForDetail = Cars.get({id: id}, function() {
  277 + self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息";
  278 + });
300 } 279 }
301 - );  
302 -}]);  
303 \ No newline at end of file 280 \ No newline at end of file
  281 + ]
  282 +);
304 \ No newline at end of file 283 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/service.js 0 → 100644
  1 +// 车辆信息service
  2 +angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest: $resource(
  5 + '/cars_sc/:id',
  6 + {order: 'carCode', direction: 'ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + },
  13 + transformResponse: function(rs) {
  14 + var dst = angular.fromJson(rs);
  15 + if (dst.status == 'SUCCESS') {
  16 + return dst.data;
  17 + } else {
  18 + return dst; // 业务错误留给控制器处理
  19 + }
  20 + }
  21 + },
  22 + get: {
  23 + method: 'GET',
  24 + transformResponse: function(rs) {
  25 + var dst = angular.fromJson(rs);
  26 + if (dst.status == 'SUCCESS') {
  27 + return dst.data;
  28 + } else {
  29 + return dst;
  30 + }
  31 + }
  32 + },
  33 + save: {
  34 + method: 'POST'
  35 + }
  36 + }
  37 + ),
  38 + import: $resource(
  39 + '/cars/importfile',
  40 + {},
  41 + {
  42 + do: {
  43 + method: 'POST',
  44 + headers: {
  45 + 'Content-Type': 'application/x-www-form-urlencoded'
  46 + },
  47 + transformRequest: function(obj) {
  48 + var str = [];
  49 + for (var p in obj) {
  50 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  51 + }
  52 + return str.join("&");
  53 + }
  54 + }
  55 + }
  56 + ),
  57 + validate: $resource(
  58 + '/cars/validate/:type',
  59 + {},
  60 + {
  61 + insideCode: {
  62 + method: 'GET'
  63 + }
  64 + }
  65 + ),
  66 + dataTools: $resource(
  67 + '/cars/:type',
  68 + {},
  69 + {
  70 + dataExport: {
  71 + method: 'GET',
  72 + responseType: "arraybuffer",
  73 + params: {
  74 + type: "dataExport"
  75 + },
  76 + transformResponse: function(data, headers){
  77 + return {data : data};
  78 + }
  79 + }
  80 + }
  81 + )
  82 + };
  83 +}]);
0 \ No newline at end of file 84 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/service.js 0 → 100644
  1 +// 车辆设备信息service
  2 +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
  3 + return $resource(
  4 + '/cde/:id',
  5 + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'},
  6 + {
  7 + list: {
  8 + method: 'GET',
  9 + params: {
  10 + page: 0
  11 + }
  12 + },
  13 + get: {
  14 + method: 'GET'
  15 + },
  16 + save: {
  17 + method: 'POST'
  18 + },
  19 + delete: {
  20 + method: 'DELETE'
  21 + }
  22 + }
  23 + );
  24 +}]);
0 \ No newline at end of file 25 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/service.js 0 → 100644
  1 +// 人员信息service
  2 +angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest : $resource(
  5 + '/personnel/:id',
  6 + {order: 'jobCode', direction: 'ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + }
  13 + },
  14 + get: {
  15 + method: 'GET'
  16 + },
  17 + save: {
  18 + method: 'POST'
  19 + }
  20 + }
  21 + ),
  22 + validate: $resource(
  23 + '/personnel/validate/:type',
  24 + {},
  25 + {
  26 + jobCode: {
  27 + method: 'GET'
  28 + }
  29 + }
  30 + ),
  31 + dataTools: $resource(
  32 + '/personnel/:type',
  33 + {},
  34 + {
  35 + dataExport: {
  36 + method: 'GET',
  37 + responseType: "arraybuffer",
  38 + params: {
  39 + type: "dataExport"
  40 + },
  41 + transformResponse: function(data, headers){
  42 + return {data : data};
  43 + }
  44 + }
  45 + }
  46 + )
  47 + };
  48 +}]);
src/main/resources/static/pages/scheduleApp/module/common/directives/.gitkeep.txt 0 → 100644
src/main/resources/static/pages/scheduleApp/module/common/directives/select/mySelect.js 0 → 100644
  1 +/**
  2 + * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选
  3 + * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够
  4 + * cmoptions(必须):描述绑定的逻辑配置对象,格式如下:
  5 + *
  6 + * // TODO:
  7 + */
  8 +angular.module('ScheduleApp').directive('mySelect', [
  9 + function() {
  10 + return {
  11 + restrict: 'E',
  12 + template: '<div>bioxuxuan</div>',
  13 + require: 'ngModel',
  14 + compile: function(tElem, tAttrs) {
  15 + return {
  16 + pre: function(scope, element, attr) {
  17 +
  18 + },
  19 + post: function(scope, element, attr, ngModelCtr) {
  20 + // model -> view
  21 + ngModelCtr.$formatters.push(function(modelValue) {
  22 + // 监控model的变化
  23 + if (typeof modelValue != "undefined") {
  24 + console.log(modelValue);
  25 +
  26 + return modelValue;
  27 + }
  28 + });
  29 +
  30 + ngModelCtr.$render = function() {
  31 + if (typeof scope.ctrl.say != "undefined") {
  32 + element.find('div').css('color', 'red');
  33 + }
  34 + };
  35 +
  36 + ngModelCtr.$setViewValue("init value");
  37 +
  38 +
  39 + }
  40 + }
  41 + }
  42 + }
  43 + }
  44 +]);
0 \ No newline at end of file 45 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/directives/select/mySelectTemplate.html 0 → 100644
  1 +<div class="input-group" name="指令compile阶段设定1"
  2 + ng-model="$saSelectCtrl.$$internalmodel">
  3 + <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)"
  4 + theme="bootstrap" >
  5 + <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match>
  6 + <ui-select-choices repeat="指令compile阶段设定3"
  7 + refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)"
  8 + refresh-delay="10">
  9 +
  10 + 指令compile阶段设定777
  11 +
  12 + </ui-select-choices>
  13 + </ui-select>
  14 + <span class="input-group-btn">
  15 + <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default">
  16 + <span class="glyphicon glyphicon-trash"></span>
  17 + </button>
  18 + </span>
  19 +</div>
0 \ No newline at end of file 20 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts1/select/saSelect5.js
@@ -124,23 +124,40 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -124,23 +124,40 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
124 124
125 // 添加选中事件处理函数 125 // 添加选中事件处理函数
126 scope[ctrlAs].$$internal_select_fn = function($item) { 126 scope[ctrlAs].$$internal_select_fn = function($item) {
127 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";"); 127 + if ($dcname_attr.indexOf('_') > 0) {
  128 + scope[ctrlAs].model[$dcname_attr] = $item[$icname_attr];
  129 + } else {
  130 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";");
  131 + }
  132 +
128 133
129 eval("var obj=" + $cmaps_attr); 134 eval("var obj=" + $cmaps_attr);
130 for (var mc in obj) { // model的字段名:内部数据源对应字段名 135 for (var mc in obj) { // model的字段名:内部数据源对应字段名
131 var ic = obj[mc]; // 内部数据源对应字段 136 var ic = obj[mc]; // 内部数据源对应字段
132 - eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";"); 137 + if (mc.indexOf('_') > 0) {
  138 + scope[ctrlAs].model[mc] = $item[ic];
  139 + } else {
  140 + eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";");
  141 + }
133 } 142 }
134 }; 143 };
135 144
136 // 删除选中事件处理函数 145 // 删除选中事件处理函数
137 scope[ctrlAs].$$internal_remove_fn = function() { 146 scope[ctrlAs].$$internal_remove_fn = function() {
138 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;"); 147 + if ($dcname_attr.indexOf('_') > 0) {
  148 + scope[ctrlAs].model[$dcname_attr] = undefined;
  149 + } else {
  150 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;");
  151 + }
139 152
140 eval("var obj=" + $cmaps_attr); 153 eval("var obj=" + $cmaps_attr);
141 var mc; // model的字段名 154 var mc; // model的字段名
142 for (mc in obj) { 155 for (mc in obj) {
143 - eval("scope[ctrlAs].model" + "." + mc + " = undefined;"); 156 + if (mc.indexOf('_') > 0) {
  157 + scope[ctrlAs].model[mc] = undefined;
  158 + } else {
  159 + eval("scope[ctrlAs].model" + "." + mc + " = undefined;");
  160 + }
144 } 161 }
145 }; 162 };
146 163
@@ -381,7 +398,11 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -381,7 +398,11 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
381 */ 398 */
382 scope.$watch( 399 scope.$watch(
383 function() { 400 function() {
384 - return eval("scope." + ctrlAs + ".model" + "." + $dcname_attr); 401 + if ($dcname_attr.indexOf('_') > 0) {
  402 + return scope[ctrlAs].model[$dcname_attr];
  403 + } else {
  404 + return eval("scope." + ctrlAs + ".model" + "." + $dcname_attr);
  405 + }
385 }, 406 },
386 function(newValue, oldValue) { 407 function(newValue, oldValue) {
387 if (newValue === undefined && oldValue === undefined) { 408 if (newValue === undefined && oldValue === undefined) {
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteValidation.js
@@ -27,7 +27,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -27,7 +27,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
27 var $watch_rvparam_obj = undefined; 27 var $watch_rvparam_obj = undefined;
28 28
29 // 验证数据 29 // 验证数据
30 - var $$internal_validate = function(ngModelCtrl) { 30 + var $$internal_validate = function(ngModelCtrl, scope) {
31 if ($watch_rvtype && $watch_rvparam_obj) { 31 if ($watch_rvtype && $watch_rvparam_obj) {
32 // 获取查询参数模版 32 // 获取查询参数模版
33 var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template; 33 var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template;
@@ -52,6 +52,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -52,6 +52,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
52 ngModelCtrl.$setValidity('remote', true); 52 ngModelCtrl.$setValidity('remote', true);
53 } else { 53 } else {
54 ngModelCtrl.$setValidity('remote', false); 54 ngModelCtrl.$setValidity('remote', false);
  55 + scope.$remote_msg = result.msg;
55 } 56 }
56 }, 57 },
57 function(result) { 58 function(result) {
@@ -74,7 +75,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -74,7 +75,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
74 attr.$observe("remotevtype", function(value) { 75 attr.$observe("remotevtype", function(value) {
75 if (value && value != "") { 76 if (value && value != "") {
76 $watch_rvtype = value; 77 $watch_rvtype = value;
77 - $$internal_validate(ngModelCtrl); 78 + $$internal_validate(ngModelCtrl, scope);
78 } 79 }
79 }); 80 });
80 /** 81 /**
@@ -86,7 +87,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -86,7 +87,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
86 return; 87 return;
87 } 88 }
88 $watch_rvparam_obj = JSON.parse(value); 89 $watch_rvparam_obj = JSON.parse(value);
89 - $$internal_validate(ngModelCtrl); 90 + $$internal_validate(ngModelCtrl, scope);
90 } 91 }
91 }); 92 });
92 } 93 }
src/main/resources/static/pages/scheduleApp/module/common/dts1/validation/remoteValidation3.js 0 → 100644
  1 +/**
  2 + * remoteValidationt3 远程验证指令(监控依赖的model变化)
  3 + * 属性如下:
  4 + * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl"
  5 + * remotemodel(必须):关联的model
  6 + * remotemodelcol(必须):关联的model属性
  7 + */
  8 +angular.module('ScheduleApp').directive(
  9 + 'remoteValidation3',
  10 + [
  11 + '$$SearchInfoService_g',
  12 + '$q',
  13 + function($$SearchInfoService_g, $q) {
  14 + return {
  15 + restrict: 'A', // 属性
  16 + require: '^ngModel', // 依赖所属指令的ngModel
  17 + compile: function(tElem, tAttrs) {
  18 + var remotevtype_attr = tAttrs['remotevtype'];
  19 + var remotemodel_attr = tAttrs['remotemodel'];
  20 + var remotemodelcol_attr = tAttrs['remotemodelcol'];
  21 + if (!remotevtype_attr) {
  22 + throw new Error("remotevtype属性必须填写");
  23 + }
  24 + if (!remotemodel_attr) {
  25 + throw new Error("remotemodel属性必须填写");
  26 + }
  27 + if (!remotemodelcol_attr) {
  28 + throw new Error("remotemodelcol属性必须填写");
  29 + }
  30 +
  31 + return {
  32 + pre: function(scope, element, attr) {
  33 +
  34 + },
  35 +
  36 + post: function(scope, element, attr, ngModelCtrl) {
  37 + ngModelCtrl.$asyncValidators.remote =
  38 + function(modelValue, viewValue) {
  39 + var deferred = $q.defer();
  40 +
  41 + // 远端验证service
  42 + var param = JSON.parse(attr['remotemodel']);
  43 + console.log(param);
  44 + param[remotemodelcol_attr] = modelValue;
  45 + $$SearchInfoService_g.validate[remotevtype_attr].remote.do(
  46 + param,
  47 + function(result) {
  48 + if (result.status == "SUCCESS") {
  49 + deferred.resolve();
  50 + } else {
  51 + scope.$remote_msg = result.msg;
  52 + deferred.reject();
  53 + }
  54 + },
  55 + function(result) {
  56 + deferred.reject();
  57 + }
  58 + );
  59 +
  60 + return deferred.promise;
  61 + };
  62 + }
  63 + };
  64 + }
  65 + }
  66 + }
  67 + ]
  68 +);
0 \ No newline at end of file 69 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/mySelect.js 0 → 100644
  1 +/**
  2 + * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选
  3 + * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够
  4 + * cmoptions(必须):描述绑定的逻辑配置对象,格式如下:
  5 + *
  6 + * // TODO:
  7 + */
  8 +angular.module('ScheduleApp').directive('mySelect', [
  9 + function() {
  10 + return {
  11 + restrict: 'E',
  12 + template: '<div>bioxuxuan</div>',
  13 + require: 'ngModel',
  14 + compile: function(tElem, tAttrs) {
  15 + return {
  16 + pre: function(scope, element, attr) {
  17 +
  18 + },
  19 + post: function(scope, element, attr, ngModelCtr) {
  20 + // model -> view
  21 + ngModelCtr.$formatters.push(function(modelValue) {
  22 + // 监控model的变化
  23 + if (typeof modelValue != "undefined") {
  24 + console.log(modelValue);
  25 +
  26 + return modelValue;
  27 + }
  28 + });
  29 +
  30 + ngModelCtr.$render = function() {
  31 + if (typeof scope.ctrl.say != "undefined") {
  32 + element.find('div').css('color', 'red');
  33 + }
  34 + };
  35 +
  36 + ngModelCtr.$setViewValue("init value");
  37 +
  38 +
  39 + }
  40 + }
  41 + }
  42 + }
  43 + }
  44 +]);
0 \ No newline at end of file 45 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/mySelectTemplate.html 0 → 100644
  1 +<div class="input-group" name="指令compile阶段设定1"
  2 + ng-model="$saSelectCtrl.$$internalmodel">
  3 + <ui-select ng-model="$saSelectCtrl.$$internal_select_value" on-select="$saSelectCtrl.$$internal_select_fn($item)"
  4 + theme="bootstrap" >
  5 + <ui-select-match placeholder="指令compile阶段设定">指令compile阶段设定2</ui-select-match>
  6 + <ui-select-choices repeat="指令compile阶段设定3"
  7 + refresh="$saSelectCtrl.$$internal_refresh_fn($select.search)"
  8 + refresh-delay="10">
  9 +
  10 + 指令compile阶段设定777
  11 +
  12 + </ui-select-choices>
  13 + </ui-select>
  14 + <span class="input-group-btn">
  15 + <button type="button" ng-click="$saSelectCtrl.$$internal_remove_fn()" class="btn btn-default">
  16 + <span class="glyphicon glyphicon-trash"></span>
  17 + </button>
  18 + </span>
  19 +</div>
0 \ No newline at end of file 20 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/main.js
@@ -76,13 +76,26 @@ ScheduleApp.factory( @@ -76,13 +76,26 @@ ScheduleApp.factory(
76 }, 76 },
77 requestError: function(rejection) { 77 requestError: function(rejection) {
78 requestNotificationChannel.requestEnded(); 78 requestNotificationChannel.requestEnded();
79 - alert("服务端无响应");  
80 return rejection; 79 return rejection;
81 }, 80 },
82 response: function(response) { 81 response: function(response) {
83 requestNotificationChannel.requestEnded(); 82 requestNotificationChannel.requestEnded();
84 83
85 - return response; 84 + var data = response.data;
  85 + var output = [];
  86 + if (data.status == '407') {
  87 + alert("请重新登录!");
  88 + return $q.reject(response);
  89 + } else if (data.status == '500') {
  90 + output.push("状态编码:" + data.status);
  91 + output.push("访问路径:" + data.path);
  92 + output.push("错误消息:" + data.message);
  93 + alert("服务端错误:" + "\n" + output.join("\n"));
  94 + return $q.reject(response);
  95 + } else {
  96 + return response;
  97 + }
  98 +
86 }, 99 },
87 responseError: function(rejection) { 100 responseError: function(rejection) {
88 requestNotificationChannel.requestEnded(); 101 requestNotificationChannel.requestEnded();
@@ -90,25 +103,23 @@ ScheduleApp.factory( @@ -90,25 +103,23 @@ ScheduleApp.factory(
90 // 处理错误,springboot会包装返回的错误数据 103 // 处理错误,springboot会包装返回的错误数据
91 // 如:{"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"} 104 // 如:{"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"}
92 105
93 - var status = rejection.status;  
94 - var path = rejection.data.path;  
95 - var message = rejection.data.message;  
96 var output = []; 106 var output = [];
97 - output.push("状态编码:" + status);  
98 - output.push("访问路径:" + path);  
99 - output.push("错误消息:" + message);  
100 - if (status) { 107 + if (!status) {
  108 + alert("我擦,后台返回连个状态码都没返回,见鬼了,服务器可能重启了");
  109 + } else if (status == -1) {
  110 + // 服务器断开了
  111 + alert("貌似服务端连接不上");
  112 + } else {
  113 + output.push("状态编码:" + status);
  114 + output.push("访问路径:" + rejection.path);
  115 + output.push("错误消息:" + rejection.message);
101 if (status == 500) { 116 if (status == 500) {
102 alert("服务端错误:" + "\n" + output.join("\n")); 117 alert("服务端错误:" + "\n" + output.join("\n"));
103 } else if (status == 407) { 118 } else if (status == 407) {
104 alert("请重新登录:" + "\n" + output.join("\n")); 119 alert("请重新登录:" + "\n" + output.join("\n"));
105 - } else if (status == -1) {  
106 - alert("貌似服务端连接不上");  
107 } else { 120 } else {
108 alert("其他错误:" + "\n" + output.join("\n")); 121 alert("其他错误:" + "\n" + output.join("\n"));
109 } 122 }
110 - } else {  
111 - alert("我擦,后台返回连个状态码都没返回,见鬼了!");  
112 } 123 }
113 124
114 return $q.reject(rejection); 125 return $q.reject(rejection);
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
@@ -49,7 +49,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -49,7 +49,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
49 var $watch_rvparam_obj = undefined; 49 var $watch_rvparam_obj = undefined;
50 50
51 // 验证数据 51 // 验证数据
52 - var $$internal_validate = function(ngModelCtrl) { 52 + var $$internal_validate = function(ngModelCtrl, scope) {
53 if ($watch_rvtype && $watch_rvparam_obj) { 53 if ($watch_rvtype && $watch_rvparam_obj) {
54 // 获取查询参数模版 54 // 获取查询参数模版
55 var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template; 55 var paramTemplate = $$SearchInfoService_g.validate[$watch_rvtype].template;
@@ -74,6 +74,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -74,6 +74,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
74 ngModelCtrl.$setValidity('remote', true); 74 ngModelCtrl.$setValidity('remote', true);
75 } else { 75 } else {
76 ngModelCtrl.$setValidity('remote', false); 76 ngModelCtrl.$setValidity('remote', false);
  77 + scope.$remote_msg = result.msg;
77 } 78 }
78 }, 79 },
79 function(result) { 80 function(result) {
@@ -96,7 +97,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -96,7 +97,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
96 attr.$observe("remotevtype", function(value) { 97 attr.$observe("remotevtype", function(value) {
97 if (value && value != "") { 98 if (value && value != "") {
98 $watch_rvtype = value; 99 $watch_rvtype = value;
99 - $$internal_validate(ngModelCtrl); 100 + $$internal_validate(ngModelCtrl, scope);
100 } 101 }
101 }); 102 });
102 /** 103 /**
@@ -108,7 +109,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [ @@ -108,7 +109,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidation&#39;, [
108 return; 109 return;
109 } 110 }
110 $watch_rvparam_obj = JSON.parse(value); 111 $watch_rvparam_obj = JSON.parse(value);
111 - $$internal_validate(ngModelCtrl); 112 + $$internal_validate(ngModelCtrl, scope);
112 } 113 }
113 }); 114 });
114 } 115 }
@@ -218,6 +219,74 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidationt2&#39;, [ @@ -218,6 +219,74 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;remoteValidationt2&#39;, [
218 } 219 }
219 ]); 220 ]);
220 221
  222 +/**
  223 + * remoteValidationt3 远程验证指令(监控依赖的model变化)
  224 + * 属性如下:
  225 + * remotevtype(必须):验证类型(在service中有对应映射),如rvtype="xl"
  226 + * remotemodel(必须):关联的model
  227 + * remotemodelcol(必须):关联的model属性
  228 + */
  229 +angular.module('ScheduleApp').directive(
  230 + 'remoteValidation3',
  231 + [
  232 + '$$SearchInfoService_g',
  233 + '$q',
  234 + function($$SearchInfoService_g, $q) {
  235 + return {
  236 + restrict: 'A', // 属性
  237 + require: '^ngModel', // 依赖所属指令的ngModel
  238 + compile: function(tElem, tAttrs) {
  239 + var remotevtype_attr = tAttrs['remotevtype'];
  240 + var remotemodel_attr = tAttrs['remotemodel'];
  241 + var remotemodelcol_attr = tAttrs['remotemodelcol'];
  242 + if (!remotevtype_attr) {
  243 + throw new Error("remotevtype属性必须填写");
  244 + }
  245 + if (!remotemodel_attr) {
  246 + throw new Error("remotemodel属性必须填写");
  247 + }
  248 + if (!remotemodelcol_attr) {
  249 + throw new Error("remotemodelcol属性必须填写");
  250 + }
  251 +
  252 + return {
  253 + pre: function(scope, element, attr) {
  254 +
  255 + },
  256 +
  257 + post: function(scope, element, attr, ngModelCtrl) {
  258 + ngModelCtrl.$asyncValidators.remote =
  259 + function(modelValue, viewValue) {
  260 + var deferred = $q.defer();
  261 +
  262 + // 远端验证service
  263 + var param = JSON.parse(attr['remotemodel']);
  264 + console.log(param);
  265 + param[remotemodelcol_attr] = modelValue;
  266 + $$SearchInfoService_g.validate[remotevtype_attr].remote.do(
  267 + param,
  268 + function(result) {
  269 + if (result.status == "SUCCESS") {
  270 + deferred.resolve();
  271 + } else {
  272 + scope.$remote_msg = result.msg;
  273 + deferred.reject();
  274 + }
  275 + },
  276 + function(result) {
  277 + deferred.reject();
  278 + }
  279 + );
  280 +
  281 + return deferred.promise;
  282 + };
  283 + }
  284 + };
  285 + }
  286 + }
  287 + }
  288 + ]
  289 +);
221 290
222 angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) { 291 angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) {
223 return { 292 return {
@@ -1331,23 +1400,40 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -1331,23 +1400,40 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1331 1400
1332 // 添加选中事件处理函数 1401 // 添加选中事件处理函数
1333 scope[ctrlAs].$$internal_select_fn = function($item) { 1402 scope[ctrlAs].$$internal_select_fn = function($item) {
1334 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";"); 1403 + if ($dcname_attr.indexOf('_') > 0) {
  1404 + scope[ctrlAs].model[$dcname_attr] = $item[$icname_attr];
  1405 + } else {
  1406 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = $item" + "." + $icname_attr + ";");
  1407 + }
  1408 +
1335 1409
1336 eval("var obj=" + $cmaps_attr); 1410 eval("var obj=" + $cmaps_attr);
1337 for (var mc in obj) { // model的字段名:内部数据源对应字段名 1411 for (var mc in obj) { // model的字段名:内部数据源对应字段名
1338 var ic = obj[mc]; // 内部数据源对应字段 1412 var ic = obj[mc]; // 内部数据源对应字段
1339 - eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";"); 1413 + if (mc.indexOf('_') > 0) {
  1414 + scope[ctrlAs].model[mc] = $item[ic];
  1415 + } else {
  1416 + eval("scope[ctrlAs].model" + "." + mc + " = $item" + "." + ic + ";");
  1417 + }
1340 } 1418 }
1341 }; 1419 };
1342 1420
1343 // 删除选中事件处理函数 1421 // 删除选中事件处理函数
1344 scope[ctrlAs].$$internal_remove_fn = function() { 1422 scope[ctrlAs].$$internal_remove_fn = function() {
1345 - eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;"); 1423 + if ($dcname_attr.indexOf('_') > 0) {
  1424 + scope[ctrlAs].model[$dcname_attr] = undefined;
  1425 + } else {
  1426 + eval("scope[ctrlAs].model" + "." + $dcname_attr + " = undefined;");
  1427 + }
1346 1428
1347 eval("var obj=" + $cmaps_attr); 1429 eval("var obj=" + $cmaps_attr);
1348 var mc; // model的字段名 1430 var mc; // model的字段名
1349 for (mc in obj) { 1431 for (mc in obj) {
1350 - eval("scope[ctrlAs].model" + "." + mc + " = undefined;"); 1432 + if (mc.indexOf('_') > 0) {
  1433 + scope[ctrlAs].model[mc] = undefined;
  1434 + } else {
  1435 + eval("scope[ctrlAs].model" + "." + mc + " = undefined;");
  1436 + }
1351 } 1437 }
1352 }; 1438 };
1353 1439
@@ -1588,7 +1674,11 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -1588,7 +1674,11 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1588 */ 1674 */
1589 scope.$watch( 1675 scope.$watch(
1590 function() { 1676 function() {
1591 - return eval("scope." + ctrlAs + ".model" + "." + $dcname_attr); 1677 + if ($dcname_attr.indexOf('_') > 0) {
  1678 + return scope[ctrlAs].model[$dcname_attr];
  1679 + } else {
  1680 + return eval("scope." + ctrlAs + ".model" + "." + $dcname_attr);
  1681 + }
1592 }, 1682 },
1593 function(newValue, oldValue) { 1683 function(newValue, oldValue) {
1594 if (newValue === undefined && oldValue === undefined) { 1684 if (newValue === undefined && oldValue === undefined) {
@@ -1608,6 +1698,50 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -1608,6 +1698,50 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1608 }; 1698 };
1609 } 1699 }
1610 ]); 1700 ]);
  1701 +/**
  1702 + * mySelect指令,封装uiselect指令,封装内部数据获取,只支持单选
  1703 + * cm(必须):绑定外部对象,因为关联的字段不只一个,单独使用ngModel不够
  1704 + * cmoptions(必须):描述绑定的逻辑配置对象,格式如下:
  1705 + *
  1706 + * // TODO:
  1707 + */
  1708 +angular.module('ScheduleApp').directive('mySelect', [
  1709 + function() {
  1710 + return {
  1711 + restrict: 'E',
  1712 + template: '<div>bioxuxuan</div>',
  1713 + require: 'ngModel',
  1714 + compile: function(tElem, tAttrs) {
  1715 + return {
  1716 + pre: function(scope, element, attr) {
  1717 +
  1718 + },
  1719 + post: function(scope, element, attr, ngModelCtr) {
  1720 + // model -> view
  1721 + ngModelCtr.$formatters.push(function(modelValue) {
  1722 + // 监控model的变化
  1723 + if (typeof modelValue != "undefined") {
  1724 + console.log(modelValue);
  1725 +
  1726 + return modelValue;
  1727 + }
  1728 + });
  1729 +
  1730 + ngModelCtr.$render = function() {
  1731 + if (typeof scope.ctrl.say != "undefined") {
  1732 + element.find('div').css('color', 'red');
  1733 + }
  1734 + };
  1735 +
  1736 + ngModelCtr.$setViewValue("init value");
  1737 +
  1738 +
  1739 + }
  1740 + }
  1741 + }
  1742 + }
  1743 + }
  1744 +]);
1611 1745
1612 /** 1746 /**
1613 * saRadiogroup指令 1747 * saRadiogroup指令
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice-legacy.js 0 → 100644
  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 +
  79 +/**
  80 + * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。
  81 + * 1、compile阶段使用的属性如下:
  82 + * required:用于和表单验证连接,指定成required="true"才有效。
  83 + * 2、link阶段使用的属性如下
  84 + * model:关联的模型对象
  85 + * name:表单验证时需要的名字
  86 + * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加
  87 + * modelcolname1:关联的模型字段名字1(一般应该是编码字段)
  88 + * modelcolname2:关联的模型字段名字2(一般应该是名字字段)
  89 + * datacolname1;内部数据对应的字段名字1(与模型字段1对应)
  90 + * datacolname2:内部数据对应的字段名字2(与模型字段2对应)
  91 + * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用
  92 + * placeholder:select placeholder字符串描述
  93 + *
  94 + * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。
  95 + * $$SearchInfoService_g,内部使用的数据服务
  96 + */
  97 +// saSelect2指令使用的内部信service
  98 +angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {
  99 + return {
  100 + xl: $resource(
  101 + '/line/:type',
  102 + {order: 'name', direction: 'ASC'},
  103 + {
  104 + list: {
  105 + method: 'GET',
  106 + isArray: true
  107 + }
  108 + }
  109 + ),
  110 + xlinfo: $resource(
  111 + '/lineInformation/:type',
  112 + {order: 'line.name', direction: 'ASC'},
  113 + {
  114 + list: {
  115 + method: 'GET',
  116 + isArray: true
  117 + }
  118 + }
  119 + ),
  120 + zd: $resource(
  121 + '/stationroute/stations',
  122 + {order: 'stationCode', direction: 'ASC'},
  123 + {
  124 + list: {
  125 + method: 'GET',
  126 + isArray: true
  127 + }
  128 + }
  129 + ),
  130 + tcc: $resource(
  131 + '/carpark/:type',
  132 + {order: 'parkCode', direction: 'ASC'},
  133 + {
  134 + list: {
  135 + method: 'GET',
  136 + isArray: true
  137 + }
  138 + }
  139 + ),
  140 + ry: $resource(
  141 + '/personnel/:type',
  142 + {order: 'personnelName', direction: 'ASC'},
  143 + {
  144 + list: {
  145 + method: 'GET',
  146 + isArray: true
  147 + }
  148 + }
  149 + ),
  150 + cl: $resource(
  151 + '/cars/:type',
  152 + {order: "insideCode", direction: 'ASC'},
  153 + {
  154 + list: {
  155 + method: 'GET',
  156 + isArray: true
  157 + }
  158 + }
  159 + ),
  160 + ttInfo: $resource(
  161 + '/tic/:type',
  162 + {order: "name", direction: 'ASC'},
  163 + {
  164 + list: {
  165 + method: 'GET',
  166 + isArray: true
  167 + }
  168 + }
  169 + ),
  170 + lpInfo: $resource(
  171 + '/gic/ttlpnames',
  172 + {order: "lpName", direction: 'ASC'},
  173 + {
  174 + list: {
  175 + method: 'GET',
  176 + isArray: true
  177 + }
  178 + }
  179 + ),
  180 + lpInfo2: $resource(
  181 + '/gic/:type',
  182 + {order: "lpName", direction: 'ASC'},
  183 + {
  184 + list: {
  185 + method: 'GET',
  186 + isArray: true
  187 + }
  188 + }
  189 + ),
  190 + cci: $resource(
  191 + '/cci/cars',
  192 + {},
  193 + {
  194 + list: {
  195 + method: 'GET',
  196 + isArray: true
  197 + }
  198 + }
  199 +
  200 + ),
  201 + cci2: $resource(
  202 + '/cci/:type',
  203 + {},
  204 + {
  205 + list: {
  206 + method: 'GET',
  207 + isArray: true
  208 + }
  209 + }
  210 + ),
  211 + cci3: $resource(
  212 + '/cci/cars2',
  213 + {},
  214 + {
  215 + list: {
  216 + method: 'GET',
  217 + isArray: true
  218 + }
  219 + }
  220 +
  221 + ),
  222 + eci: $resource(
  223 + '/eci/jsy',
  224 + {},
  225 + {
  226 + list: {
  227 + method: 'GET',
  228 + isArray: true
  229 + }
  230 + }
  231 + ),
  232 + eci2: $resource(
  233 + '/eci/spy',
  234 + {},
  235 + {
  236 + list: {
  237 + method: 'GET',
  238 + isArray: true
  239 + }
  240 + }
  241 + ),
  242 + eci3: $resource(
  243 + '/eci/:type',
  244 + {},
  245 + {
  246 + list: {
  247 + method: 'GET',
  248 + isArray: true
  249 + }
  250 + }
  251 + ),
  252 +
  253 +
  254 + validate: { // remoteValidation指令用到的resource
  255 + gbv1: { // 路牌序号验证
  256 + template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'},
  257 + remote: $resource(
  258 + '/gic/validate1',
  259 + {},
  260 + {
  261 + do: {
  262 + method: 'GET'
  263 + }
  264 + }
  265 + )
  266 + },
  267 + gbv2: { // 路牌名称验证
  268 + template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'},
  269 + remote: $resource(
  270 + '/gic/validate2',
  271 + {},
  272 + {
  273 + do: {
  274 + method: 'GET'
  275 + }
  276 + }
  277 + )
  278 + },
  279 +
  280 + cars_zbh: { // 自编号验证
  281 + template: {'insideCode_eq': '-1'}, // 查询参数模版
  282 + remote: $resource( // $resource封装对象
  283 + '/cars_sc/validate_zbh',
  284 + {},
  285 + {
  286 + do: {
  287 + method: 'GET'
  288 + }
  289 + }
  290 + )
  291 + },
  292 +
  293 + cars_sbbh: { // 验证设备编号
  294 + template: {'equipmentCode_eq': '-1'}, // 查询参数模版
  295 + remote: $resource( // $resource封装对象
  296 + '/cars_sc/validate_sbbh',
  297 + {},
  298 + {
  299 + do: {
  300 + method: 'GET'
  301 + }
  302 + }
  303 + )
  304 + },
  305 +
  306 + cars_clbh: { // 车辆编号验证
  307 + template: {'carCode_eq': '-1'}, // 查询参数模版
  308 + remote: $resource( // $resource封装对象
  309 + '/cars_sc/validate_clbh',
  310 + {},
  311 + {
  312 + do: {
  313 + method: 'GET'
  314 + }
  315 + }
  316 + )
  317 + },
  318 +
  319 + cars_cph: { // 车牌号验证
  320 + template: {'carPlate_eq': '-1'}, // 查询参数模版
  321 + remote: $resource( // $resource封装对象
  322 + '/cars_sc/validate_cph',
  323 + {},
  324 + {
  325 + do: {
  326 + method: 'GET'
  327 + }
  328 + }
  329 + )
  330 + },
  331 +
  332 +
  333 + cde1: { // 车辆设备启用日期验证
  334 + template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒
  335 + remote: $resource( // $resource封装对象
  336 + '/cde//validate/qyrq',
  337 + {},
  338 + {
  339 + do: {
  340 + method: 'GET'
  341 + }
  342 + }
  343 + )
  344 + },
  345 + ttc1: { // 时刻表名字验证
  346 + template: {'xl.id_eq': -1, 'name_eq': 'ddd'},
  347 + remote: $resource( // $resource封装对象
  348 + '/tic/validate/equale',
  349 + {},
  350 + {
  351 + do: {
  352 + method: 'GET'
  353 + }
  354 + }
  355 + )
  356 + },
  357 + sheet: { // 时刻表sheet工作区验证
  358 + template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''},
  359 + remote: $resource( // $resource封装对象
  360 + '/tidc/validate/sheet',
  361 + {},
  362 + {
  363 + do: {
  364 + method: 'POST',
  365 + headers: {
  366 + 'Content-Type': 'application/x-www-form-urlencoded'
  367 + },
  368 + transformRequest: function(obj) {
  369 + var str = [];
  370 + for (var p in obj) {
  371 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  372 + }
  373 + return str.join("&");
  374 + }
  375 + }
  376 + }
  377 + )
  378 + },
  379 + sheetli: { // 时刻表线路标准验证
  380 + template: {'lineinfoid': -1},
  381 + remote: $resource( // $resource封装对象
  382 + '/tidc/validate/lineinfo',
  383 + {},
  384 + {
  385 + do: {
  386 + method: 'GET'
  387 + }
  388 + }
  389 + )
  390 + }
  391 + }
  392 +
  393 + //validate: $resource(
  394 + // '/cars/validate/:type',
  395 + // {},
  396 + // {
  397 + // insideCode: {
  398 + // method: 'GET'
  399 + // }
  400 + // }
  401 + //)
  402 +
  403 +
  404 +
  405 + }
  406 +}]);
  407 +
  408 +
  409 +
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 - import: $resource(  
100 - '/cars/importfile',  
101 - {},  
102 - {  
103 - do: {  
104 - method: 'POST',  
105 - headers: {  
106 - 'Content-Type': 'application/x-www-form-urlencoded'  
107 - },  
108 - transformRequest: function(obj) {  
109 - var str = [];  
110 - for (var p in obj) {  
111 - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));  
112 - }  
113 - return str.join("&");  
114 - }  
115 - }  
116 - }  
117 - ),  
118 - validate: $resource(  
119 - '/cars/validate/:type',  
120 - {},  
121 - {  
122 - insideCode: {  
123 - method: 'GET'  
124 - }  
125 - }  
126 - ),  
127 - dataTools: $resource(  
128 - '/cars/:type',  
129 - {},  
130 - {  
131 - dataExport: {  
132 - method: 'GET',  
133 - responseType: "arraybuffer",  
134 - params: {  
135 - type: "dataExport"  
136 - },  
137 - transformResponse: function(data, headers){  
138 - return {data : data};  
139 - }  
140 - }  
141 - }  
142 - )  
143 - };  
144 -}]);  
145 -// 人员信息service  
146 -angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {  
147 - return {  
148 - rest : $resource(  
149 - '/personnel/:id',  
150 - {order: 'jobCode', direction: 'ASC', id: '@id_route'},  
151 - {  
152 - list: {  
153 - method: 'GET',  
154 - params: {  
155 - page: 0  
156 - }  
157 - },  
158 - get: {  
159 - method: 'GET'  
160 - },  
161 - save: {  
162 - method: 'POST'  
163 - }  
164 - }  
165 - ),  
166 - validate: $resource(  
167 - '/personnel/validate/:type',  
168 - {},  
169 - {  
170 - jobCode: {  
171 - method: 'GET'  
172 - }  
173 - }  
174 - ),  
175 - dataTools: $resource(  
176 - '/personnel/:type',  
177 - {},  
178 - {  
179 - dataExport: {  
180 - method: 'GET',  
181 - responseType: "arraybuffer",  
182 - params: {  
183 - type: "dataExport"  
184 - },  
185 - transformResponse: function(data, headers){  
186 - return {data : data};  
187 - }  
188 - }  
189 - }  
190 - )  
191 - };  
192 -}]);  
193 -// 车辆设备信息service  
194 -angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {  
195 - return $resource(  
196 - '/cde/:id',  
197 - {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'},  
198 - {  
199 - list: {  
200 - method: 'GET',  
201 - params: {  
202 - page: 0  
203 - }  
204 - },  
205 - get: {  
206 - method: 'GET'  
207 - },  
208 - save: {  
209 - method: 'POST'  
210 - },  
211 - delete: {  
212 - method: 'DELETE'  
213 - }  
214 - }  
215 - );  
216 -}]);  
217 -  
218 -// 车辆配置service  
219 -angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {  
220 - return {  
221 - rest : $resource(  
222 - '/cci/:id',  
223 - {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'},  
224 - {  
225 - list: {  
226 - method: 'GET',  
227 - params: {  
228 - page: 0  
229 - }  
230 - },  
231 - get: {  
232 - method: 'GET'  
233 - },  
234 - save: {  
235 - method: 'POST'  
236 - }  
237 - }  
238 - )  
239 - };  
240 -}]);  
241 -  
242 -// 人员配置service  
243 -angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {  
244 - return {  
245 - rest : $resource(  
246 - '/eci/:id',  
247 - {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'},  
248 - {  
249 - list: {  
250 - method: 'GET',  
251 - params: {  
252 - page: 0  
253 - }  
254 - },  
255 - get: {  
256 - method: 'GET'  
257 - },  
258 - save: {  
259 - method: 'POST'  
260 - },  
261 - delete: {  
262 - method: 'DELETE'  
263 - }  
264 - }  
265 - ),  
266 - validate: $resource( // TODO:  
267 - '/personnel/validate/:type',  
268 - {},  
269 - {  
270 - jobCode: {  
271 - method: 'GET'  
272 - }  
273 - }  
274 - )  
275 - };  
276 -}]);  
277 -  
278 -// 路牌管理service  
279 -angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) {  
280 - return {  
281 - rest: $resource(  
282 - '/gic/: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 - }  
298 - )  
299 - };  
300 -}]);  
301 -  
302 -// 排班管理service  
303 -angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) {  
304 - return {  
305 - rest: $resource(  
306 - '/sr1fc/:id',  
307 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
308 - {  
309 - list: {  
310 - method: 'GET',  
311 - params: {  
312 - page: 0  
313 - }  
314 - },  
315 - get: {  
316 - method: 'GET'  
317 - },  
318 - save: {  
319 - method: 'POST'  
320 - },  
321 - delete: {  
322 - method: 'DELETE'  
323 - }  
324 - }  
325 - )  
326 - };  
327 -}]);  
328 -  
329 -// 套跑管理service  
330 -angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) {  
331 - return {  
332 - rest: $resource(  
333 - 'rms/:id',  
334 - {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id_route'},  
335 - {  
336 - list: {  
337 - method: 'GET',  
338 - params: {  
339 - page: 0  
340 - }  
341 - },  
342 - get: {  
343 - method: 'GET'  
344 - },  
345 - save: {  
346 - method: 'POST'  
347 - },  
348 - delete: {  
349 - method: 'DELETE'  
350 - }  
351 - }  
352 - )  
353 - };  
354 -}]);  
355 -  
356 -// 时刻表管理service  
357 -angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) {  
358 - return {  
359 - rest: $resource(  
360 - '/tic/:id',  
361 - {order: 'xl,isCancel,isEnableDisTemplate,qyrq', direction: 'DESC,ASC,DESC,DESC', id: '@id'},  
362 - {  
363 - list: {  
364 - method: 'GET',  
365 - params: {  
366 - page: 0  
367 - }  
368 - }  
369 - }  
370 - )  
371 - };  
372 -}]);  
373 -// 时刻表明细管理service  
374 -angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {  
375 - return {  
376 - rest: $resource(  
377 - '/tidc/:id',  
378 - {order: 'createDate', direction: 'DESC', id: '@id_route'},  
379 - {  
380 - get: {  
381 - method: 'GET'  
382 - },  
383 - save: {  
384 - method: 'POST'  
385 - }  
386 - }  
387 - ),  
388 - import: $resource(  
389 - '/tidc/importfile',  
390 - {},  
391 - {  
392 - do: {  
393 - method: 'POST',  
394 - headers: {  
395 - 'Content-Type': 'application/x-www-form-urlencoded'  
396 - },  
397 - transformRequest: function(obj) {  
398 - var str = [];  
399 - for (var p in obj) {  
400 - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));  
401 - }  
402 - return str.join("&");  
403 - }  
404 - }  
405 - }  
406 - ),  
407 - edit: $resource(  
408 - '/tidc/edit/:xlid/:ttid',  
409 - {},  
410 - {  
411 - list: {  
412 - method: 'GET'  
413 - }  
414 - }  
415 - ),  
416 - bcdetails: $resource(  
417 - '/tidc/bcdetail',  
418 - {},  
419 - {  
420 - list: {  
421 - method: 'GET',  
422 - isArray: true  
423 - }  
424 - }  
425 - ),  
426 - dataTools: $resource(  
427 - '/tidc/:type',  
428 - {},  
429 - {  
430 - dataExport: {  
431 - method: 'GET',  
432 - responseType: "arraybuffer",  
433 - params: {  
434 - type: "dataExportExt"  
435 - },  
436 - transformResponse: function(data, headers){  
437 - return {data : data};  
438 - }  
439 - }  
440 - }  
441 - )  
442 -  
443 - // TODO:导入数据  
444 - };  
445 -}]);  
446 -  
447 -  
448 -  
449 -// 排班计划管理service  
450 -angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) {  
451 - return {  
452 - rest : $resource(  
453 - '/spc/:id',  
454 - {order: 'xl.id,createDate', direction: 'DESC,DESC', id: '@id_route'},  
455 - {  
456 - list: {  
457 - method: 'GET',  
458 - params: {  
459 - page: 0  
460 - }  
461 - },  
462 - get: {  
463 - method: 'GET'  
464 - },  
465 - save: {  
466 - method: 'POST'  
467 - },  
468 - delete: {  
469 - method: 'DELETE'  
470 - }  
471 - }  
472 - ),  
473 - tommorw: $resource(  
474 - '/spc/tommorw',  
475 - {},  
476 - {  
477 - list: {  
478 - method: 'GET'  
479 - }  
480 - }  
481 - )  
482 - };  
483 -}]);  
484 -  
485 -// 排班计划明细管理service  
486 -angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) {  
487 - return {  
488 - rest : $resource(  
489 - '/spic/:id',  
490 - {order: 'scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC', id: '@id_route'},  
491 - {  
492 - list: {  
493 - method: 'GET',  
494 - params: {  
495 - page: 0  
496 - }  
497 - },  
498 - get: {  
499 - method: 'GET'  
500 - },  
501 - save: {  
502 - method: 'POST'  
503 - }  
504 - }  
505 - ),  
506 - groupinfo : $resource(  
507 - '/spic/groupinfos/:xlid/:sdate',  
508 - {},  
509 - {  
510 - list: {  
511 - method: 'GET',  
512 - isArray: true  
513 - }  
514 - }  
515 - ),  
516 - updateGroupInfo : $resource(  
517 - '/spic/groupinfos/update',  
518 - {},  
519 - {  
520 - update: {  
521 - method: 'POST'  
522 - }  
523 - }  
524 - )  
525 - };  
526 -}]);  
527 -  
528 -// 线路运营统计service  
529 -angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {  
530 - return $resource(  
531 - '/bic/:id',  
532 - {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询  
533 - {  
534 - list: {  
535 - method: 'GET',  
536 - params: {  
537 - page: 0  
538 - }  
539 - }  
540 - }  
541 - );  
542 -}]);  
543 -  
544 -  
545 -  
546 -  
547 -/**  
548 - * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。  
549 - * 1、compile阶段使用的属性如下:  
550 - * required:用于和表单验证连接,指定成required="true"才有效。  
551 - * 2、link阶段使用的属性如下  
552 - * model:关联的模型对象  
553 - * name:表单验证时需要的名字  
554 - * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加  
555 - * modelcolname1:关联的模型字段名字1(一般应该是编码字段)  
556 - * modelcolname2:关联的模型字段名字2(一般应该是名字字段)  
557 - * datacolname1;内部数据对应的字段名字1(与模型字段1对应)  
558 - * datacolname2:内部数据对应的字段名字2(与模型字段2对应)  
559 - * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用  
560 - * placeholder:select placeholder字符串描述  
561 - *  
562 - * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。  
563 - * $$SearchInfoService_g,内部使用的数据服务  
564 - */  
565 -// saSelect2指令使用的内部信service  
566 -angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {  
567 - return {  
568 - xl: $resource(  
569 - '/line/:type',  
570 - {order: 'name', direction: 'ASC'},  
571 - {  
572 - list: {  
573 - method: 'GET',  
574 - isArray: true  
575 - }  
576 - }  
577 - ),  
578 - xlinfo: $resource(  
579 - '/lineInformation/:type',  
580 - {order: 'line.name', direction: 'ASC'},  
581 - {  
582 - list: {  
583 - method: 'GET',  
584 - isArray: true  
585 - }  
586 - }  
587 - ),  
588 - zd: $resource(  
589 - '/stationroute/stations',  
590 - {order: 'stationCode', direction: 'ASC'},  
591 - {  
592 - list: {  
593 - method: 'GET',  
594 - isArray: true  
595 - }  
596 - }  
597 - ),  
598 - tcc: $resource(  
599 - '/carpark/:type',  
600 - {order: 'parkCode', direction: 'ASC'},  
601 - {  
602 - list: {  
603 - method: 'GET',  
604 - isArray: true  
605 - }  
606 - }  
607 - ),  
608 - ry: $resource(  
609 - '/personnel/:type',  
610 - {order: 'personnelName', direction: 'ASC'},  
611 - {  
612 - list: {  
613 - method: 'GET',  
614 - isArray: true  
615 - }  
616 - }  
617 - ),  
618 - cl: $resource(  
619 - '/cars/:type',  
620 - {order: "insideCode", direction: 'ASC'},  
621 - {  
622 - list: {  
623 - method: 'GET',  
624 - isArray: true  
625 - }  
626 - }  
627 - ),  
628 - ttInfo: $resource(  
629 - '/tic/:type',  
630 - {order: "name", direction: 'ASC'},  
631 - {  
632 - list: {  
633 - method: 'GET',  
634 - isArray: true  
635 - }  
636 - }  
637 - ),  
638 - lpInfo: $resource(  
639 - '/gic/ttlpnames',  
640 - {order: "lpName", direction: 'ASC'},  
641 - {  
642 - list: {  
643 - method: 'GET',  
644 - isArray: true  
645 - }  
646 - }  
647 - ),  
648 - lpInfo2: $resource(  
649 - '/gic/:type',  
650 - {order: "lpName", direction: 'ASC'},  
651 - {  
652 - list: {  
653 - method: 'GET',  
654 - isArray: true  
655 - }  
656 - }  
657 - ),  
658 - cci: $resource(  
659 - '/cci/cars',  
660 - {},  
661 - {  
662 - list: {  
663 - method: 'GET',  
664 - isArray: true  
665 - }  
666 - }  
667 -  
668 - ),  
669 - cci2: $resource(  
670 - '/cci/:type',  
671 - {},  
672 - {  
673 - list: {  
674 - method: 'GET',  
675 - isArray: true  
676 - }  
677 - }  
678 - ),  
679 - cci3: $resource(  
680 - '/cci/cars2',  
681 - {},  
682 - {  
683 - list: {  
684 - method: 'GET',  
685 - isArray: true  
686 - }  
687 - }  
688 -  
689 - ),  
690 - eci: $resource(  
691 - '/eci/jsy',  
692 - {},  
693 - {  
694 - list: {  
695 - method: 'GET',  
696 - isArray: true  
697 - }  
698 - }  
699 - ),  
700 - eci2: $resource(  
701 - '/eci/spy',  
702 - {},  
703 - {  
704 - list: {  
705 - method: 'GET',  
706 - isArray: true  
707 - }  
708 - }  
709 - ),  
710 - eci3: $resource(  
711 - '/eci/:type',  
712 - {},  
713 - {  
714 - list: {  
715 - method: 'GET',  
716 - isArray: true  
717 - }  
718 - }  
719 - ),  
720 -  
721 -  
722 - validate: { // remoteValidation指令用到的resource  
723 - cl1: { // 车辆自编号不能重复验证  
724 - template: {'insideCode_eq': '-1'}, // 查询参数模版  
725 - remote: $resource( // $resource封装对象  
726 - '/cars/validate/equale',  
727 - {},  
728 - {  
729 - do: {  
730 - method: 'GET'  
731 - }  
732 - }  
733 - )  
734 - },  
735 - cde1: { // 车辆设备启用日期验证  
736 - template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒  
737 - remote: $resource( // $resource封装对象  
738 - '/cde//validate/qyrq',  
739 - {},  
740 - {  
741 - do: {  
742 - method: 'GET'  
743 - }  
744 - }  
745 - )  
746 - },  
747 - ttc1: { // 时刻表名字验证  
748 - template: {'xl.id_eq': -1, 'name_eq': 'ddd'},  
749 - remote: $resource( // $resource封装对象  
750 - '/tic/validate/equale',  
751 - {},  
752 - {  
753 - do: {  
754 - method: 'GET'  
755 - }  
756 - }  
757 - )  
758 - },  
759 - sheet: { // 时刻表sheet工作区验证  
760 - template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''},  
761 - remote: $resource( // $resource封装对象  
762 - '/tidc/validate/sheet',  
763 - {},  
764 - {  
765 - do: {  
766 - method: 'POST',  
767 - headers: {  
768 - 'Content-Type': 'application/x-www-form-urlencoded'  
769 - },  
770 - transformRequest: function(obj) {  
771 - var str = [];  
772 - for (var p in obj) {  
773 - str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));  
774 - }  
775 - return str.join("&");  
776 - }  
777 - }  
778 - }  
779 - )  
780 - },  
781 - sheetli: { // 时刻表线路标准验证  
782 - template: {'lineinfoid': -1},  
783 - remote: $resource( // $resource封装对象  
784 - '/tidc/validate/lineinfo',  
785 - {},  
786 - {  
787 - do: {  
788 - method: 'GET'  
789 - }  
790 - }  
791 - )  
792 - }  
793 - }  
794 -  
795 - //validate: $resource(  
796 - // '/cars/validate/:type',  
797 - // {},  
798 - // {  
799 - // insideCode: {  
800 - // method: 'GET'  
801 - // }  
802 - // }  
803 - //)  
804 -  
805 -  
806 -  
807 - }  
808 -}]);  
809 -  
810 -  
811 - 1 +//所有模块service配置
  2 +// 车辆信息service
  3 +angular.module('ScheduleApp').factory('BusInfoManageService_g', ['$resource', function($resource) {
  4 + return {
  5 + rest: $resource(
  6 + '/cars_sc/:id',
  7 + {order: 'carCode', direction: 'ASC', id: '@id_route'},
  8 + {
  9 + list: {
  10 + method: 'GET',
  11 + params: {
  12 + page: 0
  13 + },
  14 + transformResponse: function(rs) {
  15 + var dst = angular.fromJson(rs);
  16 + if (dst.status == 'SUCCESS') {
  17 + return dst.data;
  18 + } else {
  19 + return dst; // 业务错误留给控制器处理
  20 + }
  21 + }
  22 + },
  23 + get: {
  24 + method: 'GET',
  25 + transformResponse: function(rs) {
  26 + var dst = angular.fromJson(rs);
  27 + if (dst.status == 'SUCCESS') {
  28 + return dst.data;
  29 + } else {
  30 + return dst;
  31 + }
  32 + }
  33 + },
  34 + save: {
  35 + method: 'POST'
  36 + }
  37 + }
  38 + ),
  39 + import: $resource(
  40 + '/cars/importfile',
  41 + {},
  42 + {
  43 + do: {
  44 + method: 'POST',
  45 + headers: {
  46 + 'Content-Type': 'application/x-www-form-urlencoded'
  47 + },
  48 + transformRequest: function(obj) {
  49 + var str = [];
  50 + for (var p in obj) {
  51 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  52 + }
  53 + return str.join("&");
  54 + }
  55 + }
  56 + }
  57 + ),
  58 + validate: $resource(
  59 + '/cars/validate/:type',
  60 + {},
  61 + {
  62 + insideCode: {
  63 + method: 'GET'
  64 + }
  65 + }
  66 + ),
  67 + dataTools: $resource(
  68 + '/cars/:type',
  69 + {},
  70 + {
  71 + dataExport: {
  72 + method: 'GET',
  73 + responseType: "arraybuffer",
  74 + params: {
  75 + type: "dataExport"
  76 + },
  77 + transformResponse: function(data, headers){
  78 + return {data : data};
  79 + }
  80 + }
  81 + }
  82 + )
  83 + };
  84 +}]);
  85 +// 车辆设备信息service
  86 +angular.module('ScheduleApp').factory('DeviceInfoManageService_g', ['$resource', function($resource) {
  87 + return $resource(
  88 + '/cde/:id',
  89 + {order: 'xl,isCancel,cl,qyrq', direction: 'ASC,ASC,ASC,DESC', id: '@id_route'},
  90 + {
  91 + list: {
  92 + method: 'GET',
  93 + params: {
  94 + page: 0
  95 + }
  96 + },
  97 + get: {
  98 + method: 'GET'
  99 + },
  100 + save: {
  101 + method: 'POST'
  102 + },
  103 + delete: {
  104 + method: 'DELETE'
  105 + }
  106 + }
  107 + );
  108 +}]);
  109 +// 人员信息service
  110 +angular.module('ScheduleApp').factory('EmployeeInfoManageService_g', ['$resource', function($resource) {
  111 + return {
  112 + rest : $resource(
  113 + '/personnel/:id',
  114 + {order: 'jobCode', direction: 'ASC', id: '@id_route'},
  115 + {
  116 + list: {
  117 + method: 'GET',
  118 + params: {
  119 + page: 0
  120 + }
  121 + },
  122 + get: {
  123 + method: 'GET'
  124 + },
  125 + save: {
  126 + method: 'POST'
  127 + }
  128 + }
  129 + ),
  130 + validate: $resource(
  131 + '/personnel/validate/:type',
  132 + {},
  133 + {
  134 + jobCode: {
  135 + method: 'GET'
  136 + }
  137 + }
  138 + ),
  139 + dataTools: $resource(
  140 + '/personnel/:type',
  141 + {},
  142 + {
  143 + dataExport: {
  144 + method: 'GET',
  145 + responseType: "arraybuffer",
  146 + params: {
  147 + type: "dataExport"
  148 + },
  149 + transformResponse: function(data, headers){
  150 + return {data : data};
  151 + }
  152 + }
  153 + }
  154 + )
  155 + };
  156 +}]);
  157 +
  158 +// 车辆配置service
  159 +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
  160 + return {
  161 + rest : $resource(
  162 + '/cci/:id',
  163 + {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'},
  164 + {
  165 + list: {
  166 + method: 'GET',
  167 + params: {
  168 + page: 0
  169 + }
  170 + },
  171 + get: {
  172 + method: 'GET'
  173 + },
  174 + save: {
  175 + method: 'POST'
  176 + }
  177 + }
  178 + )
  179 + };
  180 +}]);
  181 +// 线路运营统计service
  182 +angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {
  183 + return $resource(
  184 + '/bic/:id',
  185 + {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询
  186 + {
  187 + list: {
  188 + method: 'GET',
  189 + params: {
  190 + page: 0
  191 + }
  192 + }
  193 + }
  194 + );
  195 +}]);
  196 +
  197 +// 人员配置service
  198 +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {
  199 + return {
  200 + rest : $resource(
  201 + '/eci/:id',
  202 + {order: 'xl.id,isCancel,dbbmFormula', 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 + delete: {
  217 + method: 'DELETE'
  218 + }
  219 + }
  220 + ),
  221 + validate: $resource( // TODO:
  222 + '/personnel/validate/:type',
  223 + {},
  224 + {
  225 + jobCode: {
  226 + method: 'GET'
  227 + }
  228 + }
  229 + )
  230 + };
  231 +}]);
  232 +// 路牌管理service
  233 +angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) {
  234 + return {
  235 + rest: $resource(
  236 + '/gic/:id',
  237 + {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id_route'},
  238 + {
  239 + list: {
  240 + method: 'GET',
  241 + params: {
  242 + page: 0
  243 + },
  244 + transformResponse: function(rs) {
  245 + var dst = angular.fromJson(rs);
  246 + if (dst.status == 'SUCCESS') {
  247 + return dst.data;
  248 + } else {
  249 + return dst;
  250 + }
  251 + }
  252 + },
  253 + get: {
  254 + method: 'GET',
  255 + transformResponse: function(rs) {
  256 + var dst = angular.fromJson(rs);
  257 + if (dst.status == 'SUCCESS') {
  258 + return dst.data;
  259 + } else {
  260 + return dst;
  261 + }
  262 + }
  263 + },
  264 + save: {
  265 + method: 'POST'
  266 + }
  267 + // 内部还有默认的方法delete
  268 + }
  269 + )
  270 + };
  271 +}]);
  272 +// 套跑管理service
  273 +angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) {
  274 + return {
  275 + rest: $resource(
  276 + 'rms/:id',
  277 + {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id_route'},
  278 + {
  279 + list: {
  280 + method: 'GET',
  281 + params: {
  282 + page: 0
  283 + }
  284 + },
  285 + get: {
  286 + method: 'GET'
  287 + },
  288 + save: {
  289 + method: 'POST'
  290 + },
  291 + delete: {
  292 + method: 'DELETE'
  293 + }
  294 + }
  295 + )
  296 + };
  297 +}]);
  298 +// 排班计划管理service
  299 +angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) {
  300 + return {
  301 + rest : $resource(
  302 + '/spc/:id',
  303 + {order: 'xl.id,createDate', direction: 'DESC,DESC', id: '@id_route'},
  304 + {
  305 + list: {
  306 + method: 'GET',
  307 + params: {
  308 + page: 0
  309 + }
  310 + },
  311 + get: {
  312 + method: 'GET'
  313 + },
  314 + save: {
  315 + method: 'POST'
  316 + },
  317 + delete: {
  318 + method: 'DELETE'
  319 + }
  320 + }
  321 + ),
  322 + tommorw: $resource(
  323 + '/spc/tommorw',
  324 + {},
  325 + {
  326 + list: {
  327 + method: 'GET'
  328 + }
  329 + }
  330 + )
  331 + };
  332 +}]);
  333 +
  334 +// 排班计划明细管理service
  335 +angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) {
  336 + return {
  337 + rest : $resource(
  338 + '/spic/:id',
  339 + {order: 'scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC', id: '@id_route'},
  340 + {
  341 + list: {
  342 + method: 'GET',
  343 + params: {
  344 + page: 0
  345 + }
  346 + },
  347 + get: {
  348 + method: 'GET'
  349 + },
  350 + save: {
  351 + method: 'POST'
  352 + }
  353 + }
  354 + ),
  355 + groupinfo : $resource(
  356 + '/spic/groupinfos/:xlid/:sdate',
  357 + {},
  358 + {
  359 + list: {
  360 + method: 'GET',
  361 + isArray: true
  362 + }
  363 + }
  364 + ),
  365 + updateGroupInfo : $resource(
  366 + '/spic/groupinfos/update',
  367 + {},
  368 + {
  369 + update: {
  370 + method: 'POST'
  371 + }
  372 + }
  373 + )
  374 + };
  375 +}]);
  376 +// 排班管理service
  377 +angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) {
  378 + return {
  379 + rest: $resource(
  380 + '/sr1fc/:id',
  381 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  382 + {
  383 + list: {
  384 + method: 'GET',
  385 + params: {
  386 + page: 0
  387 + }
  388 + },
  389 + get: {
  390 + method: 'GET'
  391 + },
  392 + save: {
  393 + method: 'POST'
  394 + },
  395 + delete: {
  396 + method: 'DELETE'
  397 + }
  398 + }
  399 + )
  400 + };
  401 +}]);
  402 +
  403 +// 时刻表管理service
  404 +angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) {
  405 + return {
  406 + rest: $resource(
  407 + '/tic/:id',
  408 + {order: 'xl,isCancel,isEnableDisTemplate,qyrq', direction: 'DESC,ASC,DESC,DESC', id: '@id'},
  409 + {
  410 + list: {
  411 + method: 'GET',
  412 + params: {
  413 + page: 0
  414 + }
  415 + }
  416 + }
  417 + )
  418 + };
  419 +}]);
  420 +
  421 +// 时刻表明细管理service
  422 +angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {
  423 + return {
  424 + rest: $resource(
  425 + '/tidc/:id',
  426 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  427 + {
  428 + get: {
  429 + method: 'GET'
  430 + },
  431 + save: {
  432 + method: 'POST'
  433 + }
  434 + }
  435 + ),
  436 + import: $resource(
  437 + '/tidc/importfile',
  438 + {},
  439 + {
  440 + do: {
  441 + method: 'POST',
  442 + headers: {
  443 + 'Content-Type': 'application/x-www-form-urlencoded'
  444 + },
  445 + transformRequest: function(obj) {
  446 + var str = [];
  447 + for (var p in obj) {
  448 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  449 + }
  450 + return str.join("&");
  451 + }
  452 + }
  453 + }
  454 + ),
  455 + edit: $resource(
  456 + '/tidc/edit/:xlid/:ttid',
  457 + {},
  458 + {
  459 + list: {
  460 + method: 'GET'
  461 + }
  462 + }
  463 + ),
  464 + bcdetails: $resource(
  465 + '/tidc/bcdetail',
  466 + {},
  467 + {
  468 + list: {
  469 + method: 'GET',
  470 + isArray: true
  471 + }
  472 + }
  473 + ),
  474 + dataTools: $resource(
  475 + '/tidc/:type',
  476 + {},
  477 + {
  478 + dataExport: {
  479 + method: 'GET',
  480 + responseType: "arraybuffer",
  481 + params: {
  482 + type: "dataExportExt"
  483 + },
  484 + transformResponse: function(data, headers){
  485 + return {data : data};
  486 + }
  487 + }
  488 + }
  489 + )
  490 +
  491 + // TODO:导入数据
  492 + };
  493 +}]);
  494 +// 项目通用的全局service服务,供不同的controller使用,自定义指令不使用
  495 +
  496 +// 文件下载服务
  497 +angular.module('ScheduleApp').factory('FileDownload_g', function() {
  498 + return {
  499 + downloadFile: function (data, mimeType, fileName) {
  500 + var success = false;
  501 + var blob = new Blob([data], { type: mimeType });
  502 + try {
  503 + if (navigator.msSaveBlob)
  504 + navigator.msSaveBlob(blob, fileName);
  505 + else {
  506 + // Try using other saveBlob implementations, if available
  507 + var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
  508 + if (saveBlob === undefined) throw "Not supported";
  509 + saveBlob(blob, fileName);
  510 + }
  511 + success = true;
  512 + } catch (ex) {
  513 + console.log("saveBlob method failed with the following exception:");
  514 + console.log(ex);
  515 + }
  516 +
  517 + if (!success) {
  518 + // Get the blob url creator
  519 + var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
  520 + if (urlCreator) {
  521 + // Try to use a download link
  522 + var link = document.createElement('a');
  523 + if ('download' in link) {
  524 + // Try to simulate a click
  525 + try {
  526 + // Prepare a blob URL
  527 + var url = urlCreator.createObjectURL(blob);
  528 + link.setAttribute('href', url);
  529 +
  530 + // Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
  531 + link.setAttribute("download", fileName);
  532 +
  533 + // Simulate clicking the download link
  534 + var event = document.createEvent('MouseEvents');
  535 + event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
  536 + link.dispatchEvent(event);
  537 + success = true;
  538 +
  539 + } catch (ex) {
  540 + console.log("Download link method with simulated click failed with the following exception:");
  541 + console.log(ex);
  542 + }
  543 + }
  544 +
  545 + if (!success) {
  546 + // Fallback to window.location method
  547 + try {
  548 + // Prepare a blob URL
  549 + // Use application/octet-stream when using window.location to force download
  550 + var url = urlCreator.createObjectURL(blob);
  551 + window.location = url;
  552 + console.log("Download link method with window.location succeeded");
  553 + success = true;
  554 + } catch (ex) {
  555 + console.log("Download link method with window.location failed with the following exception:");
  556 + console.log(ex);
  557 + }
  558 + }
  559 + }
  560 + }
  561 +
  562 + if (!success) {
  563 + // Fallback to window.open method
  564 + console.log("No methods worked for saving the arraybuffer, using last resort window.open");
  565 + window.open("", '_blank', '');
  566 + }
  567 + }
  568 + };
  569 +});
  570 +
  571 +
  572 +/**
  573 + * saSelect2指令,根据属性值,动态载入数据,然后支持拼音搜索,点击右边的按钮清除选择并重新载入数据。
  574 + * 1、compile阶段使用的属性如下:
  575 + * required:用于和表单验证连接,指定成required="true"才有效。
  576 + * 2、link阶段使用的属性如下
  577 + * model:关联的模型对象
  578 + * name:表单验证时需要的名字
  579 + * type:关联的那种数据值(xl/cl/ry)-> 对应线路信息/车辆信息/人员信息,后面有的继续加
  580 + * modelcolname1:关联的模型字段名字1(一般应该是编码字段)
  581 + * modelcolname2:关联的模型字段名字2(一般应该是名字字段)
  582 + * datacolname1;内部数据对应的字段名字1(与模型字段1对应)
  583 + * datacolname2:内部数据对应的字段名字2(与模型字段2对应)
  584 + * showcolname:下拉框显示的内部数据字段名(注意:不是模型数据字段名),TODO:以后考虑放动态表达式,并在compile阶段使用
  585 + * placeholder:select placeholder字符串描述
  586 + *
  587 + * $$pyFilter,内部的filter指令,结合简拼音进行拼音过滤。
  588 + * $$SearchInfoService_g,内部使用的数据服务
  589 + */
  590 +// saSelect2指令使用的内部信service
  591 +angular.module('ScheduleApp').factory('$$SearchInfoService_g', ['$resource', function($resource) {
  592 + return {
  593 + xl: $resource(
  594 + '/line/:type',
  595 + {order: 'name', direction: 'ASC'},
  596 + {
  597 + list: {
  598 + method: 'GET',
  599 + isArray: true
  600 + }
  601 + }
  602 + ),
  603 + xlinfo: $resource(
  604 + '/lineInformation/:type',
  605 + {order: 'line.name', direction: 'ASC'},
  606 + {
  607 + list: {
  608 + method: 'GET',
  609 + isArray: true
  610 + }
  611 + }
  612 + ),
  613 + zd: $resource(
  614 + '/stationroute/stations',
  615 + {order: 'stationCode', direction: 'ASC'},
  616 + {
  617 + list: {
  618 + method: 'GET',
  619 + isArray: true
  620 + }
  621 + }
  622 + ),
  623 + tcc: $resource(
  624 + '/carpark/:type',
  625 + {order: 'parkCode', direction: 'ASC'},
  626 + {
  627 + list: {
  628 + method: 'GET',
  629 + isArray: true
  630 + }
  631 + }
  632 + ),
  633 + ry: $resource(
  634 + '/personnel/:type',
  635 + {order: 'personnelName', direction: 'ASC'},
  636 + {
  637 + list: {
  638 + method: 'GET',
  639 + isArray: true
  640 + }
  641 + }
  642 + ),
  643 + cl: $resource(
  644 + '/cars/:type',
  645 + {order: "insideCode", direction: 'ASC'},
  646 + {
  647 + list: {
  648 + method: 'GET',
  649 + isArray: true
  650 + }
  651 + }
  652 + ),
  653 + ttInfo: $resource(
  654 + '/tic/:type',
  655 + {order: "name", direction: 'ASC'},
  656 + {
  657 + list: {
  658 + method: 'GET',
  659 + isArray: true
  660 + }
  661 + }
  662 + ),
  663 + lpInfo: $resource(
  664 + '/gic/ttlpnames',
  665 + {order: "lpName", direction: 'ASC'},
  666 + {
  667 + list: {
  668 + method: 'GET',
  669 + isArray: true
  670 + }
  671 + }
  672 + ),
  673 + lpInfo2: $resource(
  674 + '/gic/:type',
  675 + {order: "lpName", direction: 'ASC'},
  676 + {
  677 + list: {
  678 + method: 'GET',
  679 + isArray: true
  680 + }
  681 + }
  682 + ),
  683 + cci: $resource(
  684 + '/cci/cars',
  685 + {},
  686 + {
  687 + list: {
  688 + method: 'GET',
  689 + isArray: true
  690 + }
  691 + }
  692 +
  693 + ),
  694 + cci2: $resource(
  695 + '/cci/:type',
  696 + {},
  697 + {
  698 + list: {
  699 + method: 'GET',
  700 + isArray: true
  701 + }
  702 + }
  703 + ),
  704 + cci3: $resource(
  705 + '/cci/cars2',
  706 + {},
  707 + {
  708 + list: {
  709 + method: 'GET',
  710 + isArray: true
  711 + }
  712 + }
  713 +
  714 + ),
  715 + eci: $resource(
  716 + '/eci/jsy',
  717 + {},
  718 + {
  719 + list: {
  720 + method: 'GET',
  721 + isArray: true
  722 + }
  723 + }
  724 + ),
  725 + eci2: $resource(
  726 + '/eci/spy',
  727 + {},
  728 + {
  729 + list: {
  730 + method: 'GET',
  731 + isArray: true
  732 + }
  733 + }
  734 + ),
  735 + eci3: $resource(
  736 + '/eci/:type',
  737 + {},
  738 + {
  739 + list: {
  740 + method: 'GET',
  741 + isArray: true
  742 + }
  743 + }
  744 + ),
  745 +
  746 +
  747 + validate: { // remoteValidation指令用到的resource
  748 + gbv1: { // 路牌序号验证
  749 + template: {'xl.id_eq': -1, 'lpNo_eq': 'ddd'},
  750 + remote: $resource(
  751 + '/gic/validate1',
  752 + {},
  753 + {
  754 + do: {
  755 + method: 'GET'
  756 + }
  757 + }
  758 + )
  759 + },
  760 + gbv2: { // 路牌名称验证
  761 + template: {'xl.id_eq': -1, 'lpName_eq': 'ddd'},
  762 + remote: $resource(
  763 + '/gic/validate2',
  764 + {},
  765 + {
  766 + do: {
  767 + method: 'GET'
  768 + }
  769 + }
  770 + )
  771 + },
  772 +
  773 + cars_zbh: { // 自编号验证
  774 + template: {'insideCode_eq': '-1'}, // 查询参数模版
  775 + remote: $resource( // $resource封装对象
  776 + '/cars_sc/validate_zbh',
  777 + {},
  778 + {
  779 + do: {
  780 + method: 'GET'
  781 + }
  782 + }
  783 + )
  784 + },
  785 +
  786 + cars_sbbh: { // 验证设备编号
  787 + template: {'equipmentCode_eq': '-1'}, // 查询参数模版
  788 + remote: $resource( // $resource封装对象
  789 + '/cars_sc/validate_sbbh',
  790 + {},
  791 + {
  792 + do: {
  793 + method: 'GET'
  794 + }
  795 + }
  796 + )
  797 + },
  798 +
  799 + cars_clbh: { // 车辆编号验证
  800 + template: {'carCode_eq': '-1'}, // 查询参数模版
  801 + remote: $resource( // $resource封装对象
  802 + '/cars_sc/validate_clbh',
  803 + {},
  804 + {
  805 + do: {
  806 + method: 'GET'
  807 + }
  808 + }
  809 + )
  810 + },
  811 +
  812 + cars_cph: { // 车牌号验证
  813 + template: {'carPlate_eq': '-1'}, // 查询参数模版
  814 + remote: $resource( // $resource封装对象
  815 + '/cars_sc/validate_cph',
  816 + {},
  817 + {
  818 + do: {
  819 + method: 'GET'
  820 + }
  821 + }
  822 + )
  823 + },
  824 +
  825 +
  826 + cde1: { // 车辆设备启用日期验证
  827 + template: {'qyrq': 0, 'xl': 1, 'cl': 1}, // 日期毫秒
  828 + remote: $resource( // $resource封装对象
  829 + '/cde//validate/qyrq',
  830 + {},
  831 + {
  832 + do: {
  833 + method: 'GET'
  834 + }
  835 + }
  836 + )
  837 + },
  838 + ttc1: { // 时刻表名字验证
  839 + template: {'xl.id_eq': -1, 'name_eq': 'ddd'},
  840 + remote: $resource( // $resource封装对象
  841 + '/tic/validate/equale',
  842 + {},
  843 + {
  844 + do: {
  845 + method: 'GET'
  846 + }
  847 + }
  848 + )
  849 + },
  850 + sheet: { // 时刻表sheet工作区验证
  851 + template: {'filename': '', 'sheetname': '', 'lineid': -1, 'linename': ''},
  852 + remote: $resource( // $resource封装对象
  853 + '/tidc/validate/sheet',
  854 + {},
  855 + {
  856 + do: {
  857 + method: 'POST',
  858 + headers: {
  859 + 'Content-Type': 'application/x-www-form-urlencoded'
  860 + },
  861 + transformRequest: function(obj) {
  862 + var str = [];
  863 + for (var p in obj) {
  864 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  865 + }
  866 + return str.join("&");
  867 + }
  868 + }
  869 + }
  870 + )
  871 + },
  872 + sheetli: { // 时刻表线路标准验证
  873 + template: {'lineinfoid': -1},
  874 + remote: $resource( // $resource封装对象
  875 + '/tidc/validate/lineinfo',
  876 + {},
  877 + {
  878 + do: {
  879 + method: 'GET'
  880 + }
  881 + }
  882 + )
  883 + }
  884 + }
  885 +
  886 + //validate: $resource(
  887 + // '/cars/validate/:type',
  888 + // {},
  889 + // {
  890 + // insideCode: {
  891 + // method: 'GET'
  892 + // }
  893 + // }
  894 + //)
  895 +
  896 +
  897 +
  898 + }
  899 +}]);
  900 +
  901 +
  902 +
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
@@ -91,7 +91,7 @@ ScheduleApp.config([ @@ -91,7 +91,7 @@ ScheduleApp.config([
91 } 91 }
92 }) 92 })
93 } 93 }
94 -]); 94 +]);
95 // ui route 配置 95 // ui route 配置
96 96
97 /** 车辆设备信息模块配置route */ 97 /** 车辆设备信息模块配置route */
@@ -185,7 +185,7 @@ ScheduleApp.config([ @@ -185,7 +185,7 @@ ScheduleApp.config([
185 }) 185 })
186 186
187 } 187 }
188 -]); 188 +]);
189 // ui route 配置 189 // ui route 配置
190 190
191 /** 人员基础信息模块配置route */ 191 /** 人员基础信息模块配置route */
@@ -279,7 +279,7 @@ ScheduleApp.config([ @@ -279,7 +279,7 @@ ScheduleApp.config([
279 } 279 }
280 }) 280 })
281 281
282 -}]); 282 +}]);
283 // ui route 配置 283 // ui route 配置
284 284
285 /** 车辆配置模块页面route */ 285 /** 车辆配置模块页面route */
@@ -376,7 +376,7 @@ ScheduleApp.config([ @@ -376,7 +376,7 @@ ScheduleApp.config([
376 ]); 376 ]);
377 377
378 378
379 - 379 +
380 // ui route 配置 380 // ui route 配置
381 381
382 /** 线路运营概览配置route */ 382 /** 线路运营概览配置route */
@@ -413,7 +413,7 @@ ScheduleApp.config([ @@ -413,7 +413,7 @@ ScheduleApp.config([
413 }); 413 });
414 414
415 } 415 }
416 -]); 416 +]);
417 // ui route 配置 417 // ui route 配置
418 418
419 /** 人员配置模块页面route */ 419 /** 人员配置模块页面route */
@@ -508,63 +508,102 @@ ScheduleApp.config([ @@ -508,63 +508,102 @@ ScheduleApp.config([
508 }) 508 })
509 509
510 } 510 }
511 -]);  
512 -// ui route 配置  
513 -  
514 -/** 路牌管理配置所有模块页面route */  
515 -ScheduleApp.config([  
516 - '$stateProvider',  
517 - '$urlRouterProvider',  
518 - function($stateProvider, $urlRouterProvider) {  
519 - // 默认路由  
520 - //$urlRouterProvider.otherwise('/busConfig.html');  
521 -  
522 - $stateProvider  
523 - .state("guideboardManage", { // index页面  
524 - url: '/guideboardManage',  
525 - views: {  
526 - "": {  
527 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'  
528 - },  
529 - "guideboardManage_list@guideboardManage": {  
530 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'  
531 - }  
532 - },  
533 -  
534 - resolve: {  
535 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
536 - return $ocLazyLoad.load({  
537 - name: 'guideboardManage_module',  
538 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
539 - files: [  
540 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
541 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
542 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
543 - "pages/scheduleApp/module/core/guideboardManage/module.js"  
544 - ]  
545 - });  
546 - }]  
547 - }  
548 - })  
549 - .state("guideboardManage_detail", { // 详细信息页面  
550 - url: '/guideboardManage_detail/:id',  
551 - views: {  
552 - "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}  
553 - },  
554 - resolve: {  
555 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
556 - return $ocLazyLoad.load({  
557 - name: 'guideboardManage_detail_module',  
558 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
559 - files: [  
560 - "pages/scheduleApp/module/core/guideboardManage/module.js"  
561 - ]  
562 - });  
563 - }]  
564 - }  
565 - })  
566 -  
567 -}]); 511 +]);
  512 +// ui route 配置
  513 +
  514 +/** 路牌管理配置所有模块页面route */
  515 +ScheduleApp.config([
  516 + '$stateProvider',
  517 + '$urlRouterProvider',
  518 + function($stateProvider, $urlRouterProvider) {
  519 + // 默认路由
  520 + //$urlRouterProvider.otherwise('/busConfig.html');
  521 +
  522 + $stateProvider
  523 + .state("guideboardManage", { // index页面
  524 + url: '/guideboardManage',
  525 + views: {
  526 + "": {
  527 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'
  528 + },
  529 + "guideboardManage_list@guideboardManage": {
  530 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'
  531 + }
  532 + },
  533 +
  534 + resolve: {
  535 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  536 + return $ocLazyLoad.load({
  537 + name: 'guideboardManage_module',
  538 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  539 + files: [
  540 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  541 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  542 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  543 + "pages/scheduleApp/module/core/guideboardManage/module.js"
  544 + ]
  545 + });
  546 + }]
  547 + }
  548 + })
  549 + .state('guideboardManage_form', { // 添加路牌form
  550 + url: '/guideboardManage_form',
  551 + views: {
  552 + '': {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/form.html'}
  553 + },
  554 + resolve: {
  555 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  556 + return $ocLazyLoad.load({
  557 + name: 'guideboardManage_form_module',
  558 + insertBefore: '#ng_load_plugins_before',
  559 + files: [
  560 + 'assets/bower_components/angular-ui-select/dist/select.min.css',
  561 + 'assets/bower_components/angular-ui-select/dist/select.min.js',
  562 + 'pages/scheduleApp/module/core/guideboardManage/module.js'
  563 + ]
  564 + });
  565 + }]
  566 + }
  567 + })
  568 + .state('guideboardManage_edit', { // 修改路牌form
  569 + url: '/guideboardManage_edit/:id',
  570 + views: {
  571 + '': {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/edit.html'}
  572 + },
  573 + resolve: {
  574 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  575 + return $ocLazyLoad.load({
  576 + name: 'guideboardManage_edit_module',
  577 + insertBefore: '#ng_load_plugins_before',
  578 + files: [
  579 + 'assets/bower_components/angular-ui-select/dist/select.min.css',
  580 + 'assets/bower_components/angular-ui-select/dist/select.min.js',
  581 + 'pages/scheduleApp/module/core/guideboardManage/module.js'
  582 + ]
  583 + });
  584 + }]
  585 + }
  586 + })
  587 + .state("guideboardManage_detail", { // 详细信息页面
  588 + url: '/guideboardManage_detail/:id',
  589 + views: {
  590 + "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}
  591 + },
  592 + resolve: {
  593 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  594 + return $ocLazyLoad.load({
  595 + name: 'guideboardManage_detail_module',
  596 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  597 + files: [
  598 + "pages/scheduleApp/module/core/guideboardManage/module.js"
  599 + ]
  600 + });
  601 + }]
  602 + }
  603 + })
  604 +
  605 +
  606 +}]);
568 // ui route 配置 607 // ui route 配置
569 608
570 /** 套跑管理模块配置页面route */ 609 /** 套跑管理模块配置页面route */
@@ -657,7 +696,7 @@ ScheduleApp.config([ @@ -657,7 +696,7 @@ ScheduleApp.config([
657 } 696 }
658 }) 697 })
659 } 698 }
660 -]); 699 +]);
661 // ui route 配置 700 // ui route 配置
662 701
663 /** 排班计划管理配置route */ 702 /** 排班计划管理配置route */
@@ -719,7 +758,7 @@ ScheduleApp.config([ @@ -719,7 +758,7 @@ ScheduleApp.config([
719 758
720 759
721 } 760 }
722 -]); 761 +]);
723 // ui route 配置 762 // ui route 配置
724 763
725 /** 排班计划明细配置route */ 764 /** 排班计划明细配置route */
@@ -757,7 +796,7 @@ ScheduleApp.config([ @@ -757,7 +796,7 @@ ScheduleApp.config([
757 }); 796 });
758 797
759 } 798 }
760 -]); 799 +]);
761 // ui route 配置 800 // ui route 配置
762 801
763 /** 排班调度值勤日报配置route */ 802 /** 排班调度值勤日报配置route */
@@ -819,7 +858,7 @@ ScheduleApp.config([ @@ -819,7 +858,7 @@ ScheduleApp.config([
819 }); 858 });
820 859
821 } 860 }
822 -]); 861 +]);
823 // ui route 配置 862 // ui route 配置
824 863
825 /** 排班规则模块配置route */ 864 /** 排班规则模块配置route */
@@ -912,102 +951,119 @@ ScheduleApp.config([ @@ -912,102 +951,119 @@ ScheduleApp.config([
912 } 951 }
913 }) 952 })
914 } 953 }
915 -]);  
916 -// ui route 配置  
917 -  
918 -/** 时刻表管理配置route */  
919 -ScheduleApp.config([  
920 - '$stateProvider',  
921 - '$urlRouterProvider',  
922 - function($stateProvider, $urlRouterProvider) {  
923 - // 默认路由  
924 - //$urlRouterProvider.otherwise('/busConfig.html');  
925 -  
926 - $stateProvider  
927 - .state("ttInfoManage", { // index页面  
928 - url: '/ttInfoManage',  
929 - views: {  
930 - "": {  
931 - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html'  
932 - },  
933 - "ttInfoManage_list@ttInfoManage": {  
934 - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html'  
935 - }  
936 - },  
937 -  
938 - resolve: {  
939 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
940 - return $ocLazyLoad.load({  
941 - name: 'ttInfoManage_module',  
942 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
943 - files: [  
944 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
945 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
946 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
947 - ]  
948 - });  
949 - }]  
950 - }  
951 - })  
952 - .state("ttInfoManage_form", { // 添加时刻表信息form  
953 - url: '/ttInfoManage_form',  
954 - views: {  
955 - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'}  
956 - },  
957 - resolve: {  
958 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
959 - return $ocLazyLoad.load({  
960 - name: 'ttInfoManage_form_module',  
961 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
962 - files: [  
963 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
964 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
965 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
966 - ]  
967 - });  
968 - }]  
969 - }  
970 - })  
971 - .state("ttInfoManage_edit", { // 修改时刻表信息form  
972 - url: '/ttInfoManage_edit/:id',  
973 - views: {  
974 - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'}  
975 - },  
976 - resolve: {  
977 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
978 - return $ocLazyLoad.load({  
979 - name: 'ttInfoManage_edit_module',  
980 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
981 - files: [  
982 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
983 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
984 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
985 - ]  
986 - });  
987 - }]  
988 - }  
989 - })  
990 - .state("ttInfoManage_detail", { // 时刻表详细信息  
991 - url: '/ttInfoManage_detail/:id',  
992 - views: {  
993 - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'}  
994 - },  
995 - resolve: {  
996 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
997 - return $ocLazyLoad.load({  
998 - name: 'ttInfoManage_detail_module',  
999 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
1000 - files: [  
1001 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
1002 - ]  
1003 - });  
1004 - }]  
1005 - }  
1006 - });  
1007 -  
1008 -  
1009 - }  
1010 -]); 954 +]);
  955 +// ui route 配置
  956 +
  957 +/** 时刻表管理配置route */
  958 +ScheduleApp.config([
  959 + '$stateProvider',
  960 + '$urlRouterProvider',
  961 + function($stateProvider, $urlRouterProvider) {
  962 + // 默认路由
  963 + //$urlRouterProvider.otherwise('/busConfig.html');
  964 +
  965 + $stateProvider
  966 + .state("ttInfoManage", { // index页面
  967 + url: '/ttInfoManage',
  968 + views: {
  969 + "": {
  970 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html'
  971 + },
  972 + "ttInfoManage_list@ttInfoManage": {
  973 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html'
  974 + }
  975 + },
  976 +
  977 + resolve: {
  978 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  979 + return $ocLazyLoad.load({
  980 + name: 'ttInfoManage_module',
  981 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  982 + files: [
  983 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  984 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  985 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  986 + ]
  987 + });
  988 + }]
  989 + }
  990 + })
  991 + .state("ttInfoManage_form", { // 添加时刻表信息form
  992 + url: '/ttInfoManage_form',
  993 + views: {
  994 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'}
  995 + },
  996 + resolve: {
  997 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  998 + return $ocLazyLoad.load({
  999 + name: 'ttInfoManage_form_module',
  1000 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1001 + files: [
  1002 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  1003 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  1004 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  1005 + ]
  1006 + });
  1007 + }]
  1008 + }
  1009 + })
  1010 + .state("ttInfoManage_edit", { // 修改时刻表信息form
  1011 + url: '/ttInfoManage_edit/:id',
  1012 + views: {
  1013 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'}
  1014 + },
  1015 + resolve: {
  1016 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1017 + return $ocLazyLoad.load({
  1018 + name: 'ttInfoManage_edit_module',
  1019 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1020 + files: [
  1021 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  1022 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  1023 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  1024 + ]
  1025 + });
  1026 + }]
  1027 + }
  1028 + })
  1029 + .state("ttInfoManage_detail", { // 时刻表详细信息
  1030 + url: '/ttInfoManage_detail/:id',
  1031 + views: {
  1032 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'}
  1033 + },
  1034 + resolve: {
  1035 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1036 + return $ocLazyLoad.load({
  1037 + name: 'ttInfoManage_detail_module',
  1038 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1039 + files: [
  1040 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  1041 + ]
  1042 + });
  1043 + }]
  1044 + }
  1045 + })
  1046 + .state('ttInfoManage_test', { // TODO:测试页面
  1047 + url: '/ttInfoManage_test',
  1048 + views: {
  1049 + '': {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/test.html'}
  1050 + },
  1051 + resolve: {
  1052 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  1053 + return $ocLazyLoad.load({
  1054 + name: 'ttInfoManage_test_module',
  1055 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  1056 + files: [
  1057 + 'pages/scheduleApp/module/core/ttInfoManage/test.js'
  1058 + ]
  1059 + });
  1060 + }]
  1061 + }
  1062 + })
  1063 +
  1064 +
  1065 + }
  1066 +]);
1011 // ui route 配置 1067 // ui route 配置
1012 1068
1013 /** 时刻表编辑管理配置route */ 1069 /** 时刻表编辑管理配置route */
src/main/resources/static/pages/scheduleApp/module/core/busConfig/service.js 0 → 100644
  1 +// 车辆配置service
  2 +angular.module('ScheduleApp').factory('BusConfigService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest : $resource(
  5 + '/cci/:id',
  6 + {order: 'xl.id,cl.insideCode,isCancel', direction: 'ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + }
  13 + },
  14 + get: {
  15 + method: 'GET'
  16 + },
  17 + save: {
  18 + method: 'POST'
  19 + }
  20 + }
  21 + )
  22 + };
  23 +}]);
0 \ No newline at end of file 24 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/busLineInfoStat/service.js 0 → 100644
  1 +// 线路运营统计service
  2 +angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', function($resource) {
  3 + return $resource(
  4 + '/bic/:id',
  5 + {order: 'createDate', direction: 'DESC', id: '@id_route'}, // TODO:以后需要根据属性对象的属性查询
  6 + {
  7 + list: {
  8 + method: 'GET',
  9 + params: {
  10 + page: 0
  11 + }
  12 + }
  13 + }
  14 + );
  15 +}]);
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/service.js 0 → 100644
  1 +// 人员配置service
  2 +angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest : $resource(
  5 + '/eci/:id',
  6 + {order: 'xl.id,isCancel,dbbmFormula', direction: 'ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + }
  13 + },
  14 + get: {
  15 + method: 'GET'
  16 + },
  17 + save: {
  18 + method: 'POST'
  19 + },
  20 + delete: {
  21 + method: 'DELETE'
  22 + }
  23 + }
  24 + ),
  25 + validate: $resource( // TODO:
  26 + '/personnel/validate/:type',
  27 + {},
  28 + {
  29 + jobCode: {
  30 + method: 'GET'
  31 + }
  32 + }
  33 + )
  34 + };
  35 +}]);
0 \ No newline at end of file 36 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/edit.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="guideboardManage">路牌管理</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="GuideboardManageFormCtrl as ctrl">
  26 + <div class="portlet-title">
  27 + <div class="caption">
  28 + <i class="icon-equalizer font-red-sunglo"></i> <span
  29 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  30 + </div>
  31 + </div>
  32 +
  33 + <div class="portlet-body form">
  34 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  35 +
  36 + <div class="form-body">
  37 + <div class="form-group has-success has-feedback">
  38 + <label class="col-md-2 control-label">线路*:</label>
  39 + <div class="col-md-3">
  40 + <sa-Select5 name="xl"
  41 + model="ctrl.guideboardManageForForm"
  42 + cmaps="{'xl.id' : 'id'}"
  43 + dcname="xl.id"
  44 + icname="id"
  45 + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
  46 + iterobjname="item"
  47 + iterobjexp="item.name"
  48 + searchph="请输拼音..."
  49 + searchexp="this.name"
  50 + required >
  51 + </sa-Select5>
  52 + </div>
  53 + <!-- 隐藏块,显示验证信息 -->
  54 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  55 + 线路必须选择
  56 + </div>
  57 + </div>
  58 +
  59 + <div class="form-group has-success has-feedback">
  60 + <label class="col-md-2 control-label">路牌编号:</label>
  61 + <div class="col-md-3">
  62 + <input type="number" class="form-control" ng-model="ctrl.guideboardManageForForm.lpNo"
  63 + name="lpNo" placeholder="请输入路牌编号..." min="1" required
  64 + remote-Validation
  65 + remotevtype="gbv1"
  66 + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
  67 +
  68 + />
  69 + </div>
  70 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.required">
  71 + 路牌编号必须填写
  72 + </div>
  73 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.number">
  74 + 必须输入数字
  75 + </div>
  76 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.remote">
  77 + {{$remote_msg}}
  78 + </div>
  79 + </div>
  80 +
  81 + <div class="form-group has-success has-feedback">
  82 + <label class="col-md-2 control-label">路牌名称*:</label>
  83 + <div class="col-md-3">
  84 + <input type="text" class="form-control" ng-model="ctrl.guideboardManageForForm.lpName"
  85 + name="lpName" placeholder="请输入路牌名字..." required
  86 + remote-Validation
  87 + remotevtype="gbv2"
  88 + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
  89 +
  90 + />
  91 + </div>
  92 +
  93 + <!-- 隐藏块,显示验证信息 -->
  94 + <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.required">
  95 + 路牌名称必须填写
  96 + </div>
  97 + <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.remote">
  98 + {{$remote_msg}}
  99 + </div>
  100 + </div>
  101 +
  102 + <!-- 路牌类型暂时是普通路牌,默认填写了 -->
  103 +
  104 +
  105 + </div>
  106 +
  107 + <div class="form-actions">
  108 + <div class="row">
  109 + <div class="col-md-offset-3 col-md-4">
  110 + <button type="submit" class="btn green" ng-disabled="!myForm.$valid">
  111 + <i class="fa fa-check">提交</i>
  112 + </button>
  113 + <a type="button" class="btn default" ui-sref="guideboardManage">
  114 + <i class="fa fa-times">取消</i>
  115 + </a>
  116 + </div>
  117 + </div>
  118 + </div>
  119 +
  120 + </form>
  121 +
  122 + </div>
  123 +
  124 +</div>
  125 +
  126 +
  127 +
  128 +
  129 +
  130 +
  131 +
  132 +
  133 +
  134 +
  135 +
  136 +
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/form.html
1 -<h1>TODO</h1>  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +<div class="page-head">
  3 + <div class="page-title">
  4 + <h1>路牌管理</h1>
  5 + </div>
  6 +</div>
  7 +
  8 +<ul class="page-breadcrumb breadcrumb">
  9 + <li>
  10 + <a href="/pages/home.html" data-pjax="">首页</a>
  11 + <i class="fa fa-circle"></i>
  12 + </li>
  13 + <li>
  14 + <span class="active">运营计划管理</span>
  15 + <i class="fa fa-circle"></i>
  16 + </li>
  17 + <li>
  18 + <a ui-sref="guideboardManage">路牌管理</a>
  19 + <i class="fa fa-circle"></i>
  20 + </li>
  21 + <li>
  22 + <span class="active">添加路牌</span>
  23 + </li>
  24 +</ul>
  25 +
  26 +<div class="portlet light bordered" ng-controller="GuideboardManageFormCtrl as ctrl">
  27 + <div class="portlet-title">
  28 + <div class="caption">
  29 + <i class="icon-equalizer font-red-sunglo"></i> <span
  30 + class="caption-subject font-red-sunglo bold uppercase">表单</span>
  31 + </div>
  32 + </div>
  33 +
  34 + <div class="portlet-body form">
  35 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  36 +
  37 + <div class="form-body">
  38 + <div class="form-group has-success has-feedback">
  39 + <label class="col-md-2 control-label">线路*:</label>
  40 + <div class="col-md-3">
  41 + <sa-Select5 name="xl"
  42 + model="ctrl.guideboardManageForForm"
  43 + cmaps="{'xl.id' : 'id'}"
  44 + dcname="xl.id"
  45 + icname="id"
  46 + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
  47 + iterobjname="item"
  48 + iterobjexp="item.name"
  49 + searchph="请输拼音..."
  50 + searchexp="this.name"
  51 + required >
  52 + </sa-Select5>
  53 + </div>
  54 + <!-- 隐藏块,显示验证信息 -->
  55 + <div class="alert alert-danger well-sm" ng-show="myForm.xl.$error.required">
  56 + 线路必须选择
  57 + </div>
  58 + </div>
  59 +
  60 + <div class="form-group has-success has-feedback">
  61 + <label class="col-md-2 control-label">路牌编号:</label>
  62 + <div class="col-md-3">
  63 + <input type="number" class="form-control" ng-model="ctrl.guideboardManageForForm.lpNo"
  64 + name="lpNo" placeholder="请输入路牌编号..." min="1" required
  65 + remote-Validation
  66 + remotevtype="gbv1"
  67 + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpNo_eq': ctrl.guideboardManageForForm.lpNo} | json}}"
  68 +
  69 + />
  70 + </div>
  71 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.required">
  72 + 路牌编号必须填写
  73 + </div>
  74 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.number">
  75 + 必须输入数字
  76 + </div>
  77 + <div class="alert alert-danger well-sm" ng-show="myForm.lpNo.$error.remote">
  78 + {{$remote_msg}}
  79 + </div>
  80 + </div>
  81 +
  82 + <div class="form-group has-success has-feedback">
  83 + <label class="col-md-2 control-label">路牌名称*:</label>
  84 + <div class="col-md-3">
  85 + <input type="text" class="form-control" ng-model="ctrl.guideboardManageForForm.lpName"
  86 + name="lpName" placeholder="请输入路牌名字..." required
  87 + remote-Validation
  88 + remotevtype="gbv2"
  89 + remotevparam="{{ {'xl.id_eq': ctrl.guideboardManageForForm.xl.id, 'lpName_eq': ctrl.guideboardManageForForm.lpName} | json}}"
  90 +
  91 + />
  92 + </div>
  93 +
  94 + <!-- 隐藏块,显示验证信息 -->
  95 + <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.required">
  96 + 路牌名称必须填写
  97 + </div>
  98 + <div class="alert alert-danger well-sm" ng-show="myForm.lpName.$error.remote">
  99 + {{$remote_msg}}
  100 + </div>
  101 + </div>
  102 +
  103 + <!-- 路牌类型暂时是普通路牌,默认填写了 -->
  104 +
  105 +
  106 + </div>
  107 +
  108 + <div class="form-actions">
  109 + <div class="row">
  110 + <div class="col-md-offset-3 col-md-4">
  111 + <button type="submit" class="btn green"
  112 + ng-disabled="!myForm.$valid"
  113 + >
  114 + <i class="fa fa-check">提交</i>
  115 + </button>
  116 + <a type="button" class="btn default" ui-sref="guideboardManage">
  117 + <i class="fa fa-times">取消</i>
  118 + </a>
  119 + </div>
  120 + </div>
  121 + </div>
  122 +
  123 + </form>
  124 +
  125 + </div>
  126 +
  127 +</div>
  128 +
  129 +
  130 +
  131 +
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/index.html
@@ -27,10 +27,10 @@ @@ -27,10 +27,10 @@
27 <span class="caption-subject bold uppercase">路牌表</span> 27 <span class="caption-subject bold uppercase">路牌表</span>
28 </div> 28 </div>
29 <div class="actions"> 29 <div class="actions">
30 - <!--<a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()">-->  
31 - <!--<i class="fa fa-plus"></i>-->  
32 - <!--添加路牌-->  
33 - <!--</a>--> 30 + <a ui-sref="guideboardManage_form" class="btn btn-circle blue">
  31 + <i class="fa fa-plus"></i>
  32 + 添加路牌
  33 + </a>
34 34
35 <div class="btn-group"> 35 <div class="btn-group">
36 <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> 36 <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/list.html
@@ -4,44 +4,55 @@ @@ -4,44 +4,55 @@
4 <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column"> 4 <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column">
5 <thead> 5 <thead>
6 <tr role="row" class="heading"> 6 <tr role="row" class="heading">
7 - <th style="width: 5%">序号</th>  
8 - <th style="width: 15%">线路</th>  
9 - <th >路牌编号</th> 7 + <th style="width: 50px">序号</th>
  8 + <th style="width: 150px;">线路</th>
  9 + <th style="width: 100px;">路牌编号</th>
10 <th >路牌名称</th> 10 <th >路牌名称</th>
11 - <th >路牌类型</th>  
12 - <th style="width: 21%">操作</th> 11 + <th style="width: 100px;">路牌类型</th>
  12 + <th style="width: 80px;">状态</th>
  13 + <th style="width: 20%">操作</th>
13 </tr> 14 </tr>
14 <tr role="row" class="filter"> 15 <tr role="row" class="filter">
15 <td></td> 16 <td></td>
16 <td> 17 <td>
17 <div> 18 <div>
18 - <sa-Select3 model="ctrl.searchCondition()"  
19 - name="xl"  
20 - placeholder="请输拼音..."  
21 - dcvalue="{{ctrl.searchCondition()['xl.lineCode_eq']}}" 19 + <sa-Select5 name="xl"
  20 + model="ctrl.searchCondition()"
  21 + cmaps="{'xl.lineCode_eq' : 'lineCode'}"
22 dcname="xl.lineCode_eq" 22 dcname="xl.lineCode_eq"
23 icname="lineCode" 23 icname="lineCode"
24 - icnames="name"  
25 - datatype="xl">  
26 - </sa-Select3> 24 + dsparams="{{ {type: 'ajax', param:{type: 'all', 'destroy_eq': 0}, atype:'xl' } | json }}"
  25 + iterobjname="item"
  26 + iterobjexp="item.name"
  27 + searchph="请输拼音..."
  28 + searchexp="this.name"
  29 + required >
  30 + </sa-Select5>
27 </div> 31 </div>
28 </td> 32 </td>
29 <td></td> 33 <td></td>
30 - <td></td> 34 + <td>
  35 + <input type="text" class="form-control form-filter input-sm" ng-model="ctrl.searchCondition()['lpName_like']" placeholder="请输入路牌名字..."/>
  36 + </td>
31 <td></td> 37 <td></td>
32 <td> 38 <td>
  39 + <label class="checkbox-inline">
  40 + <input type="checkbox" ng-model="ctrl.searchCondition()['isCancel_eq']"/>已作废
  41 + </label>
  42 + </td>
  43 + <td>
33 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" 44 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
34 - ng-click="ctrl.pageChanaged()"> 45 + ng-click="ctrl.doPage()">
35 <i class="fa fa-search"></i> 搜索</button> 46 <i class="fa fa-search"></i> 搜索</button>
36 47
37 <button class="btn btn-sm red btn-outline filter-cancel" 48 <button class="btn btn-sm red btn-outline filter-cancel"
38 - ng-click="ctrl.resetSearchCondition()"> 49 + ng-click="ctrl.reset()">
39 <i class="fa fa-times"></i> 重置</button> 50 <i class="fa fa-times"></i> 重置</button>
40 </td> 51 </td>
41 </tr> 52 </tr>
42 </thead> 53 </thead>
43 <tbody> 54 <tbody>
44 - <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> 55 + <tr ng-repeat="info in ctrl.page()['content']" ng-class="{odd: true, gradeX: true, danger: info.isCancel}">
45 <td> 56 <td>
46 <span ng-bind="$index + 1"></span> 57 <span ng-bind="$index + 1"></span>
47 </td> 58 </td>
@@ -58,10 +69,16 @@ @@ -58,10 +69,16 @@
58 <span ng-bind="info.lpType"></span> 69 <span ng-bind="info.lpType"></span>
59 </td> 70 </td>
60 <td> 71 <td>
  72 + <span class="glyphicon glyphicon-ok" ng-if="info.isCancel == '0'"></span>
  73 + <span class="glyphicon glyphicon-remove" ng-if="info.isCancel == '1'"></span>
  74 + </td>
  75 + <td>
61 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> 76 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
62 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> 77 <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>-->
63 <a ui-sref="guideboardManage_detail({id : info.id})" class="btn btn-info btn-sm"> 详细 </a> 78 <a ui-sref="guideboardManage_detail({id : info.id})" class="btn btn-info btn-sm"> 详细 </a>
64 - <!--<a ui-sref="#" class="btn default blue-stripe btn-sm"> 修改 </a>--> 79 + <a ui-sref="guideboardManage_edit({id: info.id})" class="btn btn-info btn-sm" ng-if="info.isCancel == '0'"> 修改 </a>
  80 + <a ng-click="ctrl.toggleCancel(info.id)" class="btn btn-danger btn-sm" ng-if="info.isCancel == '0'"> 作废 </a>
  81 + <a ng-click="ctrl.toggleCancel(info.id)" class="btn btn-success btn-sm" ng-if="info.isCancel == '1'"> 撤销 </a>
65 </td> 82 </td>
66 </tr> 83 </tr>
67 </tbody> 84 </tbody>
@@ -69,9 +86,9 @@ @@ -69,9 +86,9 @@
69 </div> 86 </div>
70 87
71 <div style="text-align: right;"> 88 <div style="text-align: right;">
72 - <uib-pagination total-items="ctrl.pageInfo.totalItems"  
73 - ng-model="ctrl.pageInfo.currentPage"  
74 - ng-change="ctrl.pageChanaged()" 89 + <uib-pagination total-items="ctrl.page()['totalElements']"
  90 + ng-model="ctrl.page()['uiNumber']"
  91 + ng-change="ctrl.doPage()"
75 rotate="false" 92 rotate="false"
76 max-size="10" 93 max-size="10"
77 boundary-links="true" 94 boundary-links="true"
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/module.js
1 -// 路牌管理 service controller 等写在一起  
2 -  
3 -angular.module('ScheduleApp').factory('GuideboardManageService', ['GuideboardManageService_g', function(service) {  
4 - /** 当前的查询条件信息 */  
5 - var currentSearchCondition = {};  
6 -  
7 - /** 当前第几页 */  
8 - var currentPageNo = 1;  
9 -  
10 - return {  
11 - /**  
12 - * 获取查询条件信息,  
13 - * 用于给controller用来和页面数据绑定。  
14 - */  
15 - getSearchCondition: function() {  
16 - return currentSearchCondition;  
17 - },  
18 - /**  
19 - * 重置查询条件信息。  
20 - */  
21 - resetSearchCondition: function() {  
22 - var key;  
23 - for (key in currentSearchCondition) {  
24 - currentSearchCondition[key] = undefined;  
25 - }  
26 - },  
27 - /**  
28 - * 设置当前页码。  
29 - * @param cpn 从1开始,后台是从0开始的  
30 - */  
31 - setCurrentPageNo: function(cpn) {  
32 - currentPageNo = cpn;  
33 - },  
34 - /**  
35 - * 组装查询参数,返回一个promise查询结果。  
36 - * @param params 查询参数  
37 - * @return 返回一个 promise  
38 - */  
39 - getPage: function() {  
40 - var params = currentSearchCondition; // 查询条件  
41 - params.page = currentPageNo - 1; // 服务端页码从0开始  
42 - return service.rest.list(params).$promise;  
43 - },  
44 - /**  
45 - * 获取明细信息。  
46 - * @param id 车辆id  
47 - * @return 返回一个 promise  
48 - */  
49 - getDetail: function(id) {  
50 - var params = {id: id};  
51 - return service.rest.get(params).$promise;  
52 - },  
53 - /**  
54 - * 保存信息。  
55 - * @param obj 车辆详细信息  
56 - * @return 返回一个 promise  
57 - */  
58 - saveDetail: function(obj) {  
59 - return service.rest.save(obj).$promise;  
60 - }  
61 - };  
62 -}]);  
63 -  
64 -angular.module('ScheduleApp').controller('GuideboardManageCtrl', ['GuideboardManageService', '$state', '$uibModal', function(guideboardManageService, $state, $uibModal) {  
65 - var self = this;  
66 -  
67 - // 切换到form状态  
68 - self.goForm = function() {  
69 - alert("切换添加");  
70 - };  
71 -  
72 - // 导入excel  
73 - self.importData = function() {  
74 - // large方式弹出模态对话框  
75 - var modalInstance = $uibModal.open({  
76 - templateUrl: '/pages/scheduleApp/module/core/guideboardManage/dataImport.html',  
77 - size: "lg",  
78 - animation: true,  
79 - backdrop: 'static',  
80 - resolve: {  
81 - // 可以传值给controller  
82 - },  
83 - windowClass: 'center-modal',  
84 - controller: "GuideboardManageToolsCtrl",  
85 - controllerAs: "ctrl",  
86 - bindToController: true  
87 - });  
88 - modalInstance.result.then(  
89 - function() {  
90 - console.log("dataImport.html打开");  
91 - },  
92 - function() {  
93 - console.log("dataImport.html消失");  
94 - }  
95 - );  
96 - };  
97 -}]);  
98 -  
99 -angular.module('ScheduleApp').controller('GuideboardManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {  
100 - var self = this;  
101 - self.data = "TODO";  
102 -  
103 - // 关闭窗口  
104 - self.close = function() {  
105 - $modalInstance.dismiss("cancel");  
106 - };  
107 -  
108 - self.clearInputFile = function() {  
109 - angular.element("input[type='file']").val(null);  
110 - };  
111 -  
112 - // 上传文件组件  
113 - self.uploader = new FileUploader({  
114 - url: "/gic/dataImport",  
115 - filters: [] // 用于过滤文件,比如只允许导入excel  
116 - });  
117 - self.uploader.onAfterAddingFile = function(fileItem)  
118 - {  
119 - console.info('onAfterAddingFile', fileItem);  
120 - console.log(self.uploader.queue.length);  
121 - if (self.uploader.queue.length > 1)  
122 - self.uploader.removeFromQueue(0);  
123 - };  
124 - self.uploader.onSuccessItem = function(fileItem, response, status, headers)  
125 - {  
126 - console.info('onSuccessItem', fileItem, response, status, headers);  
127 - };  
128 - self.uploader.onErrorItem = function(fileItem, response, status, headers)  
129 - {  
130 - console.info('onErrorItem', fileItem, response, status, headers);  
131 - };  
132 -  
133 -}]);  
134 -  
135 -angular.module('ScheduleApp').controller('GuideboardManageListCtrl', ['GuideboardManageService', function(guideboardManageService) {  
136 - var self = this;  
137 - self.pageInfo = {  
138 - totalItems : 0,  
139 - currentPage : 1,  
140 - infos: []  
141 - };  
142 -  
143 - // 初始创建的时候,获取一次列表数据  
144 - guideboardManageService.getPage().then(  
145 - function(result) {  
146 - self.pageInfo.totalItems = result.totalElements;  
147 - self.pageInfo.currentPage = result.number + 1;  
148 - self.pageInfo.infos = result.content;  
149 - guideboardManageService.setCurrentPageNo(result.number + 1);  
150 - },  
151 - function(result) {  
152 - alert("出错啦!");  
153 - }  
154 - );  
155 -  
156 - //$scope.$watch("ctrl.pageInfo.currentPage", function() {  
157 - // alert("dfdfdf");  
158 - //});  
159 -  
160 - // 翻页的时候调用  
161 - self.pageChanaged = function() {  
162 - guideboardManageService.setCurrentPageNo(self.pageInfo.currentPage);  
163 - guideboardManageService.getPage().then(  
164 - function(result) {  
165 - self.pageInfo.totalItems = result.totalElements;  
166 - self.pageInfo.currentPage = result.number + 1;  
167 - self.pageInfo.infos = result.content;  
168 - guideboardManageService.setCurrentPageNo(result.number + 1);  
169 - },  
170 - function(result) {  
171 - alert("出错啦!");  
172 - }  
173 - );  
174 - };  
175 - // 获取查询条件数据  
176 - self.searchCondition = function() {  
177 - return guideboardManageService.getSearchCondition();  
178 - };  
179 - // 重置查询条件  
180 - self.resetSearchCondition = function() {  
181 - guideboardManageService.resetSearchCondition();  
182 - self.pageInfo.currentPage = 1;  
183 - self.pageChanaged();  
184 - };  
185 -  
186 -}]);  
187 -  
188 -angular.module('ScheduleApp').controller('GuideboardManageFormCtrl', ['GuideboardManageService', '$stateParams', '$state', function(guideboardManageService, $stateParams, $state) {  
189 - // TODO:  
190 -}]);  
191 -  
192 -angular.module('ScheduleApp').controller('GuideboardManageDetailCtrl', ['GuideboardManageService', '$stateParams', function(guideboardManageService, $stateParams) {  
193 - var self = this;  
194 - self.title = "";  
195 - self.guideboardForDetail = {};  
196 - self.guideboardForDetail.id = $stateParams.id;  
197 -  
198 - // 当转向到此页面时,就获取明细信息并绑定  
199 - guideboardManageService.getDetail($stateParams.id).then(  
200 - function(result) {  
201 - var key;  
202 - for (key in result) {  
203 - self.guideboardForDetail[key] = result[key];  
204 - }  
205 -  
206 - self.title = "路牌 " + self.guideboardForDetail.lpName + " 详细信息";  
207 - },  
208 - function(result) {  
209 - // TODO:弹出框方式以后改  
210 - alert("出错啦!");  
211 - }  
212 - );  
213 -}]);  
214 -  
215 - 1 +// 路牌管理 service controller 等写在一起
  2 +
  3 +angular.module('ScheduleApp').factory(
  4 + 'GuideboardManageService',
  5 + [
  6 + 'GuideboardManageService_g',
  7 + function(service) {
  8 +
  9 + /** 当前的查询条件信息 */
  10 + var currentSearchCondition = {page: 0, 'isCancel_eq': false};
  11 + // 当前查询返回的信息
  12 + var currentPage = { // 后台spring data返回的格式
  13 + totalElements: 0,
  14 + number: 0, // 后台返回的页码,spring返回从0开始
  15 + content: [],
  16 +
  17 + uiNumber: 1 // 页面绑定的页码
  18 + };
  19 +
  20 + // 查询对象类
  21 + var queryClass = service.rest;
  22 +
  23 + return {
  24 + getGbQueryClass: function() {
  25 + return queryClass;
  26 + },
  27 +
  28 + /**
  29 + * 获取查询条件信息,
  30 + * 用于给controller用来和页面数据绑定。
  31 + */
  32 + getSearchCondition: function() {
  33 + currentSearchCondition.page = currentPage.uiNumber - 1;
  34 + return currentSearchCondition;
  35 + },
  36 + /**
  37 + * 重置查询条件信息。
  38 + */
  39 + resetStatus: function() {
  40 + currentSearchCondition = {page: 0, 'isCancel_eq': false};
  41 + currentPage = {
  42 + totalElements: 0,
  43 + number: 0,
  44 + content: [],
  45 + uiNumber: 1
  46 + };
  47 + },
  48 + /**
  49 + * 组装查询参数,返回一个promise查询结果。
  50 + * @param params 查询参数
  51 + * @return 返回一个 promise
  52 + */
  53 + getPage: function(page) {
  54 + if (page) {
  55 + currentPage.totalElements = page.totalElements;
  56 + currentPage.number = page.number;
  57 + currentPage.content = page.content;
  58 + }
  59 + return currentPage;
  60 + },
  61 + /**
  62 + * 获取明细信息。
  63 + * @param id 车辆id
  64 + * @return 返回一个 promise
  65 + */
  66 + getDetail: function(id) {
  67 + var params = {id: id};
  68 + return service.rest.get(params).$promise;
  69 + },
  70 + /**
  71 + * 保存信息。
  72 + * @param obj 车辆详细信息
  73 + * @return 返回一个 promise
  74 + */
  75 + saveDetail: function(obj) {
  76 + return service.rest.save(obj).$promise;
  77 + }
  78 + };
  79 + }
  80 + ]
  81 +);
  82 +
  83 +angular.module('ScheduleApp').controller('GuideboardManageCtrl', ['GuideboardManageService', '$state', '$uibModal', function(guideboardManageService, $state, $uibModal) {
  84 + var self = this;
  85 +
  86 + // 切换到form状态
  87 + self.goForm = function() {
  88 + alert("切换添加");
  89 + };
  90 +
  91 + // 导入excel
  92 + self.importData = function() {
  93 + // large方式弹出模态对话框
  94 + var modalInstance = $uibModal.open({
  95 + templateUrl: '/pages/scheduleApp/module/core/guideboardManage/dataImport.html',
  96 + size: "lg",
  97 + animation: true,
  98 + backdrop: 'static',
  99 + resolve: {
  100 + // 可以传值给controller
  101 + },
  102 + windowClass: 'center-modal',
  103 + controller: "GuideboardManageToolsCtrl",
  104 + controllerAs: "ctrl",
  105 + bindToController: true
  106 + });
  107 + modalInstance.result.then(
  108 + function() {
  109 + console.log("dataImport.html打开");
  110 + },
  111 + function() {
  112 + console.log("dataImport.html消失");
  113 + }
  114 + );
  115 + };
  116 +
  117 +}]);
  118 +
  119 +angular.module('ScheduleApp').controller('GuideboardManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) {
  120 + var self = this;
  121 + self.data = "TODO";
  122 +
  123 + // 关闭窗口
  124 + self.close = function() {
  125 + $modalInstance.dismiss("cancel");
  126 + };
  127 +
  128 + self.clearInputFile = function() {
  129 + angular.element("input[type='file']").val(null);
  130 + };
  131 +
  132 + // 上传文件组件
  133 + self.uploader = new FileUploader({
  134 + url: "/gic/dataImport",
  135 + filters: [] // 用于过滤文件,比如只允许导入excel
  136 + });
  137 + self.uploader.onAfterAddingFile = function(fileItem)
  138 + {
  139 + console.info('onAfterAddingFile', fileItem);
  140 + console.log(self.uploader.queue.length);
  141 + if (self.uploader.queue.length > 1)
  142 + self.uploader.removeFromQueue(0);
  143 + };
  144 + self.uploader.onSuccessItem = function(fileItem, response, status, headers)
  145 + {
  146 + console.info('onSuccessItem', fileItem, response, status, headers);
  147 + };
  148 + self.uploader.onErrorItem = function(fileItem, response, status, headers)
  149 + {
  150 + console.info('onErrorItem', fileItem, response, status, headers);
  151 + };
  152 +
  153 +}]);
  154 +
  155 +// list.html控制器
  156 +angular.module('ScheduleApp').controller(
  157 + 'GuideboardManageListCtrl',
  158 + [
  159 + 'GuideboardManageService',
  160 + function(service) {
  161 + var self = this;
  162 + var Gb = service.getGbQueryClass();
  163 +
  164 + self.page = function() {
  165 + return service.getPage();
  166 + };
  167 +
  168 + self.searchCondition = function() {
  169 + return service.getSearchCondition();
  170 + };
  171 +
  172 + self.doPage = function() {
  173 + var result = Gb.list(self.searchCondition(), function(result) {
  174 + service.getPage(result);
  175 + });
  176 + };
  177 + self.reset = function() {
  178 + service.resetStatus();
  179 + var result = Gb.list(self.searchCondition(), function() {
  180 + service.getPage(result);
  181 + });
  182 + };
  183 + self.toggleTtinfo = function(id) {
  184 + Gb.delete({id: id}, function(result) {
  185 + if (result.message) { // 暂时这样做,之后全局拦截
  186 + alert("失败:" + result.message);
  187 + } else {
  188 + self.doPage();
  189 + }
  190 + });
  191 + };
  192 +
  193 + // 作废切换
  194 + self.toggleCancel = function(id) {
  195 + Gb.delete({id: id}, function(result) {
  196 + if (result.status == "ERROR") { // 暂时这样做,之后全局拦截
  197 + alert("失败:" + result.msg);
  198 + } else {
  199 + self.doPage();
  200 + }
  201 + });
  202 + };
  203 +
  204 +
  205 + // TODO:导出
  206 +
  207 +
  208 + self.doPage();
  209 + }
  210 + ]
  211 +);
  212 +
  213 +//form.html控制器
  214 +angular.module('ScheduleApp').controller(
  215 + 'GuideboardManageFormCtrl',
  216 + [
  217 + 'GuideboardManageService',
  218 + '$stateParams',
  219 + '$state',
  220 + '$scope',
  221 + function(service, $stateParams, $state, $scope) {
  222 + var self = this;
  223 + var Gb = service.getGbQueryClass();
  224 +
  225 + // 欲保存的表单信息,双向绑定
  226 + self.guideboardManageForForm = new Gb;
  227 + self.guideboardManageForForm.xl = {};
  228 +
  229 + // 如果是修改,获取传过来的id,从后台获取一份数据,用于绑定页面form值
  230 + var id = $stateParams.id;
  231 + if (id) {
  232 + Gb.get({id: id}, function(value) {
  233 + self.guideboardManageForForm = value;
  234 + });
  235 + }
  236 + // form提交方法
  237 + self.submit = function() {
  238 + console.log($scope);
  239 + console.log(self.guideboardManageForForm);
  240 +
  241 + self.guideboardManageForForm.lpType = "普通路牌";
  242 + self.guideboardManageForForm.$save(function() {
  243 + $state.go("guideboardManage");
  244 + });
  245 + };
  246 +
  247 + }
  248 + ]
  249 +);
  250 +
  251 +// detail.html控制器
  252 +angular.module('ScheduleApp').controller(
  253 + 'GuideboardManageDetailCtrl',
  254 + [
  255 + 'GuideboardManageService',
  256 + '$stateParams',
  257 + function(service, $stateParams) {
  258 + var self = this;
  259 + var Gb = service.getGbQueryClass();
  260 + var id = $stateParams.id;
  261 +
  262 + self.title = "";
  263 + self.guideboardForDetail = {};
  264 +
  265 + // 当转向到此页面时,就获取明细信息并绑定
  266 + Gb.get({id: id}, function(result) {
  267 + self.guideboardForDetail = result.data;
  268 + self.title = "路牌 " + self.guideboardForDetail.lpName + " 详细信息";
  269 + });
  270 + }
  271 + ]
  272 +);
  273 +
  274 +
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/route.js
1 -// ui route 配置  
2 -  
3 -/** 路牌管理配置所有模块页面route */  
4 -ScheduleApp.config([  
5 - '$stateProvider',  
6 - '$urlRouterProvider',  
7 - function($stateProvider, $urlRouterProvider) {  
8 - // 默认路由  
9 - //$urlRouterProvider.otherwise('/busConfig.html');  
10 -  
11 - $stateProvider  
12 - .state("guideboardManage", { // index页面  
13 - url: '/guideboardManage',  
14 - views: {  
15 - "": {  
16 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'  
17 - },  
18 - "guideboardManage_list@guideboardManage": {  
19 - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'  
20 - }  
21 - },  
22 -  
23 - resolve: {  
24 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
25 - return $ocLazyLoad.load({  
26 - name: 'guideboardManage_module',  
27 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
28 - files: [  
29 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
30 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
31 - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",  
32 - "pages/scheduleApp/module/core/guideboardManage/module.js"  
33 - ]  
34 - });  
35 - }]  
36 - }  
37 - })  
38 - .state("guideboardManage_detail", { // 详细信息页面  
39 - url: '/guideboardManage_detail/:id',  
40 - views: {  
41 - "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}  
42 - },  
43 - resolve: {  
44 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
45 - return $ocLazyLoad.load({  
46 - name: 'guideboardManage_detail_module',  
47 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
48 - files: [  
49 - "pages/scheduleApp/module/core/guideboardManage/module.js"  
50 - ]  
51 - });  
52 - }]  
53 - }  
54 - })  
55 - 1 +// ui route 配置
  2 +
  3 +/** 路牌管理配置所有模块页面route */
  4 +ScheduleApp.config([
  5 + '$stateProvider',
  6 + '$urlRouterProvider',
  7 + function($stateProvider, $urlRouterProvider) {
  8 + // 默认路由
  9 + //$urlRouterProvider.otherwise('/busConfig.html');
  10 +
  11 + $stateProvider
  12 + .state("guideboardManage", { // index页面
  13 + url: '/guideboardManage',
  14 + views: {
  15 + "": {
  16 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html'
  17 + },
  18 + "guideboardManage_list@guideboardManage": {
  19 + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html'
  20 + }
  21 + },
  22 +
  23 + resolve: {
  24 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  25 + return $ocLazyLoad.load({
  26 + name: 'guideboardManage_module',
  27 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  28 + files: [
  29 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  30 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  31 + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js",
  32 + "pages/scheduleApp/module/core/guideboardManage/module.js"
  33 + ]
  34 + });
  35 + }]
  36 + }
  37 + })
  38 + .state('guideboardManage_form', { // 添加路牌form
  39 + url: '/guideboardManage_form',
  40 + views: {
  41 + '': {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/form.html'}
  42 + },
  43 + resolve: {
  44 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  45 + return $ocLazyLoad.load({
  46 + name: 'guideboardManage_form_module',
  47 + insertBefore: '#ng_load_plugins_before',
  48 + files: [
  49 + 'assets/bower_components/angular-ui-select/dist/select.min.css',
  50 + 'assets/bower_components/angular-ui-select/dist/select.min.js',
  51 + 'pages/scheduleApp/module/core/guideboardManage/module.js'
  52 + ]
  53 + });
  54 + }]
  55 + }
  56 + })
  57 + .state('guideboardManage_edit', { // 修改路牌form
  58 + url: '/guideboardManage_edit/:id',
  59 + views: {
  60 + '': {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/edit.html'}
  61 + },
  62 + resolve: {
  63 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  64 + return $ocLazyLoad.load({
  65 + name: 'guideboardManage_edit_module',
  66 + insertBefore: '#ng_load_plugins_before',
  67 + files: [
  68 + 'assets/bower_components/angular-ui-select/dist/select.min.css',
  69 + 'assets/bower_components/angular-ui-select/dist/select.min.js',
  70 + 'pages/scheduleApp/module/core/guideboardManage/module.js'
  71 + ]
  72 + });
  73 + }]
  74 + }
  75 + })
  76 + .state("guideboardManage_detail", { // 详细信息页面
  77 + url: '/guideboardManage_detail/:id',
  78 + views: {
  79 + "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'}
  80 + },
  81 + resolve: {
  82 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  83 + return $ocLazyLoad.load({
  84 + name: 'guideboardManage_detail_module',
  85 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  86 + files: [
  87 + "pages/scheduleApp/module/core/guideboardManage/module.js"
  88 + ]
  89 + });
  90 + }]
  91 + }
  92 + })
  93 +
  94 +
56 }]); 95 }]);
57 \ No newline at end of file 96 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/service.js 0 → 100644
  1 +// 路牌管理service
  2 +angular.module('ScheduleApp').factory('GuideboardManageService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest: $resource(
  5 + '/gic/:id',
  6 + {order: 'xl,isCancel', direction: 'DESC,ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + },
  13 + transformResponse: function(rs) {
  14 + var dst = angular.fromJson(rs);
  15 + if (dst.status == 'SUCCESS') {
  16 + return dst.data;
  17 + } else {
  18 + return dst;
  19 + }
  20 + }
  21 + },
  22 + get: {
  23 + method: 'GET',
  24 + transformResponse: function(rs) {
  25 + var dst = angular.fromJson(rs);
  26 + if (dst.status == 'SUCCESS') {
  27 + return dst.data;
  28 + } else {
  29 + return dst;
  30 + }
  31 + }
  32 + },
  33 + save: {
  34 + method: 'POST'
  35 + }
  36 + // 内部还有默认的方法delete
  37 + }
  38 + )
  39 + };
  40 +}]);
0 \ No newline at end of file 41 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/service.js 0 → 100644
  1 +// 套跑管理service
  2 +angular.module('ScheduleApp').factory('rerunManageService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest: $resource(
  5 + 'rms/:id',
  6 + {order: 'rerunXl.id,isCancel', direction: 'ASC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + }
  13 + },
  14 + get: {
  15 + method: 'GET'
  16 + },
  17 + save: {
  18 + method: 'POST'
  19 + },
  20 + delete: {
  21 + method: 'DELETE'
  22 + }
  23 + }
  24 + )
  25 + };
  26 +}]);
0 \ No newline at end of file 27 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js 0 → 100644
  1 +// 排班计划管理service
  2 +angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest : $resource(
  5 + '/spc/:id',
  6 + {order: 'xl.id,createDate', direction: 'DESC,DESC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + }
  13 + },
  14 + get: {
  15 + method: 'GET'
  16 + },
  17 + save: {
  18 + method: 'POST'
  19 + },
  20 + delete: {
  21 + method: 'DELETE'
  22 + }
  23 + }
  24 + ),
  25 + tommorw: $resource(
  26 + '/spc/tommorw',
  27 + {},
  28 + {
  29 + list: {
  30 + method: 'GET'
  31 + }
  32 + }
  33 + )
  34 + };
  35 +}]);
  36 +
  37 +// 排班计划明细管理service
  38 +angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$resource', function($resource) {
  39 + return {
  40 + rest : $resource(
  41 + '/spic/:id',
  42 + {order: 'scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC', id: '@id_route'},
  43 + {
  44 + list: {
  45 + method: 'GET',
  46 + params: {
  47 + page: 0
  48 + }
  49 + },
  50 + get: {
  51 + method: 'GET'
  52 + },
  53 + save: {
  54 + method: 'POST'
  55 + }
  56 + }
  57 + ),
  58 + groupinfo : $resource(
  59 + '/spic/groupinfos/:xlid/:sdate',
  60 + {},
  61 + {
  62 + list: {
  63 + method: 'GET',
  64 + isArray: true
  65 + }
  66 + }
  67 + ),
  68 + updateGroupInfo : $resource(
  69 + '/spic/groupinfos/update',
  70 + {},
  71 + {
  72 + update: {
  73 + method: 'POST'
  74 + }
  75 + }
  76 + )
  77 + };
  78 +}]);
0 \ No newline at end of file 79 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/service.js 0 → 100644
  1 +// 排班管理service
  2 +angular.module('ScheduleApp').factory('ScheduleRuleManageService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest: $resource(
  5 + '/sr1fc/:id',
  6 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + }
  13 + },
  14 + get: {
  15 + method: 'GET'
  16 + },
  17 + save: {
  18 + method: 'POST'
  19 + },
  20 + delete: {
  21 + method: 'DELETE'
  22 + }
  23 + }
  24 + )
  25 + };
  26 +}]);
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/index.html
@@ -27,6 +27,10 @@ @@ -27,6 +27,10 @@
27 <span class="caption-subject bold uppercase">时刻表</span> 27 <span class="caption-subject bold uppercase">时刻表</span>
28 </div> 28 </div>
29 <div class="actions"> 29 <div class="actions">
  30 + <a ui-sref="ttInfoManage_test" class="btn btn-circle blue">
  31 + <i class="fa fa-plus"></i>
  32 + 测试
  33 + </a>
30 <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.toTtInfoManageForm()"> 34 <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.toTtInfoManageForm()">
31 <i class="fa fa-plus"></i> 35 <i class="fa fa-plus"></i>
32 添加时刻表 36 添加时刻表
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/route.js
1 -// ui route 配置  
2 -  
3 -/** 时刻表管理配置route */  
4 -ScheduleApp.config([  
5 - '$stateProvider',  
6 - '$urlRouterProvider',  
7 - function($stateProvider, $urlRouterProvider) {  
8 - // 默认路由  
9 - //$urlRouterProvider.otherwise('/busConfig.html');  
10 -  
11 - $stateProvider  
12 - .state("ttInfoManage", { // index页面  
13 - url: '/ttInfoManage',  
14 - views: {  
15 - "": {  
16 - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html'  
17 - },  
18 - "ttInfoManage_list@ttInfoManage": {  
19 - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html'  
20 - }  
21 - },  
22 -  
23 - resolve: {  
24 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
25 - return $ocLazyLoad.load({  
26 - name: 'ttInfoManage_module',  
27 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
28 - files: [  
29 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
30 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
31 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
32 - ]  
33 - });  
34 - }]  
35 - }  
36 - })  
37 - .state("ttInfoManage_form", { // 添加时刻表信息form  
38 - url: '/ttInfoManage_form',  
39 - views: {  
40 - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'}  
41 - },  
42 - resolve: {  
43 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
44 - return $ocLazyLoad.load({  
45 - name: 'ttInfoManage_form_module',  
46 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
47 - files: [  
48 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
49 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
50 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
51 - ]  
52 - });  
53 - }]  
54 - }  
55 - })  
56 - .state("ttInfoManage_edit", { // 修改时刻表信息form  
57 - url: '/ttInfoManage_edit/:id',  
58 - views: {  
59 - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'}  
60 - },  
61 - resolve: {  
62 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
63 - return $ocLazyLoad.load({  
64 - name: 'ttInfoManage_edit_module',  
65 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
66 - files: [  
67 - "assets/bower_components/angular-ui-select/dist/select.min.css",  
68 - "assets/bower_components/angular-ui-select/dist/select.min.js",  
69 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
70 - ]  
71 - });  
72 - }]  
73 - }  
74 - })  
75 - .state("ttInfoManage_detail", { // 时刻表详细信息  
76 - url: '/ttInfoManage_detail/:id',  
77 - views: {  
78 - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'}  
79 - },  
80 - resolve: {  
81 - deps: ['$ocLazyLoad', function($ocLazyLoad) {  
82 - return $ocLazyLoad.load({  
83 - name: 'ttInfoManage_detail_module',  
84 - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置  
85 - files: [  
86 - "pages/scheduleApp/module/core/ttInfoManage/module.js"  
87 - ]  
88 - });  
89 - }]  
90 - }  
91 - });  
92 -  
93 -  
94 - } 1 +// ui route 配置
  2 +
  3 +/** 时刻表管理配置route */
  4 +ScheduleApp.config([
  5 + '$stateProvider',
  6 + '$urlRouterProvider',
  7 + function($stateProvider, $urlRouterProvider) {
  8 + // 默认路由
  9 + //$urlRouterProvider.otherwise('/busConfig.html');
  10 +
  11 + $stateProvider
  12 + .state("ttInfoManage", { // index页面
  13 + url: '/ttInfoManage',
  14 + views: {
  15 + "": {
  16 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html'
  17 + },
  18 + "ttInfoManage_list@ttInfoManage": {
  19 + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html'
  20 + }
  21 + },
  22 +
  23 + resolve: {
  24 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  25 + return $ocLazyLoad.load({
  26 + name: 'ttInfoManage_module',
  27 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  28 + files: [
  29 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  30 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  31 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  32 + ]
  33 + });
  34 + }]
  35 + }
  36 + })
  37 + .state("ttInfoManage_form", { // 添加时刻表信息form
  38 + url: '/ttInfoManage_form',
  39 + views: {
  40 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'}
  41 + },
  42 + resolve: {
  43 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  44 + return $ocLazyLoad.load({
  45 + name: 'ttInfoManage_form_module',
  46 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  47 + files: [
  48 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  49 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  50 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  51 + ]
  52 + });
  53 + }]
  54 + }
  55 + })
  56 + .state("ttInfoManage_edit", { // 修改时刻表信息form
  57 + url: '/ttInfoManage_edit/:id',
  58 + views: {
  59 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'}
  60 + },
  61 + resolve: {
  62 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  63 + return $ocLazyLoad.load({
  64 + name: 'ttInfoManage_edit_module',
  65 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  66 + files: [
  67 + "assets/bower_components/angular-ui-select/dist/select.min.css",
  68 + "assets/bower_components/angular-ui-select/dist/select.min.js",
  69 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  70 + ]
  71 + });
  72 + }]
  73 + }
  74 + })
  75 + .state("ttInfoManage_detail", { // 时刻表详细信息
  76 + url: '/ttInfoManage_detail/:id',
  77 + views: {
  78 + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'}
  79 + },
  80 + resolve: {
  81 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  82 + return $ocLazyLoad.load({
  83 + name: 'ttInfoManage_detail_module',
  84 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  85 + files: [
  86 + "pages/scheduleApp/module/core/ttInfoManage/module.js"
  87 + ]
  88 + });
  89 + }]
  90 + }
  91 + })
  92 + .state('ttInfoManage_test', { // TODO:测试页面
  93 + url: '/ttInfoManage_test',
  94 + views: {
  95 + '': {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/test.html'}
  96 + },
  97 + resolve: {
  98 + deps: ['$ocLazyLoad', function($ocLazyLoad) {
  99 + return $ocLazyLoad.load({
  100 + name: 'ttInfoManage_test_module',
  101 + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置
  102 + files: [
  103 + 'pages/scheduleApp/module/core/ttInfoManage/test.js'
  104 + ]
  105 + });
  106 + }]
  107 + }
  108 + })
  109 +
  110 +
  111 + }
95 ]); 112 ]);
96 \ No newline at end of file 113 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/service.js 0 → 100644
  1 +// 时刻表管理service
  2 +angular.module('ScheduleApp').factory('TimeTableManageService_g', ['$resource', function($resource) {
  3 + return {
  4 + rest: $resource(
  5 + '/tic/:id',
  6 + {order: 'xl,isCancel,isEnableDisTemplate,qyrq', direction: 'DESC,ASC,DESC,DESC', id: '@id'},
  7 + {
  8 + list: {
  9 + method: 'GET',
  10 + params: {
  11 + page: 0
  12 + }
  13 + }
  14 + }
  15 + )
  16 + };
  17 +}]);
  18 +
  19 +// 时刻表明细管理service
  20 +angular.module('ScheduleApp').factory('TimeTableDetailManageService_g', ['$resource', function($resource) {
  21 + return {
  22 + rest: $resource(
  23 + '/tidc/:id',
  24 + {order: 'createDate', direction: 'DESC', id: '@id_route'},
  25 + {
  26 + get: {
  27 + method: 'GET'
  28 + },
  29 + save: {
  30 + method: 'POST'
  31 + }
  32 + }
  33 + ),
  34 + import: $resource(
  35 + '/tidc/importfile',
  36 + {},
  37 + {
  38 + do: {
  39 + method: 'POST',
  40 + headers: {
  41 + 'Content-Type': 'application/x-www-form-urlencoded'
  42 + },
  43 + transformRequest: function(obj) {
  44 + var str = [];
  45 + for (var p in obj) {
  46 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  47 + }
  48 + return str.join("&");
  49 + }
  50 + }
  51 + }
  52 + ),
  53 + edit: $resource(
  54 + '/tidc/edit/:xlid/:ttid',
  55 + {},
  56 + {
  57 + list: {
  58 + method: 'GET'
  59 + }
  60 + }
  61 + ),
  62 + bcdetails: $resource(
  63 + '/tidc/bcdetail',
  64 + {},
  65 + {
  66 + list: {
  67 + method: 'GET',
  68 + isArray: true
  69 + }
  70 + }
  71 + ),
  72 + dataTools: $resource(
  73 + '/tidc/:type',
  74 + {},
  75 + {
  76 + dataExport: {
  77 + method: 'GET',
  78 + responseType: "arraybuffer",
  79 + params: {
  80 + type: "dataExportExt"
  81 + },
  82 + transformResponse: function(data, headers){
  83 + return {data : data};
  84 + }
  85 + }
  86 + }
  87 + )
  88 +
  89 + // TODO:导入数据
  90 + };
  91 +}]);
0 \ No newline at end of file 92 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/test.html 0 → 100644
  1 +<h1>测试新的改版select指令</h1>
  2 +
  3 +<div ng-controller="TestCtrl as ctrl">
  4 + <form name="myForm" class="form-horizontal" ng-submit="ctrl.sub()">
  5 + <div class="form-body">
  6 + <div class="form-group">
  7 + <label class="col-md-2 control-label">测试文本:</label>
  8 + <div class="col-md-3">
  9 + <input type="text" class="form-control" name="txt" ng-model="ctrl.say"/>
  10 + </div>
  11 + </div>
  12 + <div class="form-group">
  13 + <my-select name="mtxt" ng-model="ctrl.say" required>
  14 + <h1>{{ctrl.say}}</h1>
  15 + </my-select>
  16 + </div>
  17 + </div>
  18 + <div class="form-actions">
  19 + <div class="row">
  20 + <button type="submit" class="btn green" ng-disabled="!myForm.$valid">
  21 + <i class="fa fa-check"></i>
  22 + 提交
  23 + </button>
  24 + </div>
  25 + </div>
  26 + </form>
  27 +</div>
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/test.js 0 → 100644
  1 +// 测试controller
  2 +
  3 +angular.module('ScheduleApp').controller('TestCtrl', [
  4 + function() {
  5 + var self = this;
  6 + self.say = "say something";
  7 +
  8 + self.sub = function() {
  9 + alert("submit...");
  10 + };
  11 +
  12 + self.loaddata = function() {
  13 + alert("数据数据数据")
  14 + };
  15 + }
  16 +]);
0 \ No newline at end of file 17 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/package.json
@@ -34,6 +34,6 @@ @@ -34,6 +34,6 @@
34 "protractor": "protractor test/protractor-conf.js", 34 "protractor": "protractor test/protractor-conf.js",
35 35
36 36
37 - "build": "grunt directive route" 37 + "build": "grunt directive route service"
38 } 38 }
39 } 39 }