Commit a57e714216e1026f454aac531ac0930984106bc0
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
47 changed files
with
1978 additions
and
1571 deletions
src/main/java/com/bsth/controller/realcontrol/FrequentPhrasesController.java
| 1 | -package com.bsth.controller.realcontrol; | |
| 2 | - | |
| 3 | -import com.bsth.controller.BaseController; | |
| 4 | -import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 5 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 6 | -import org.springframework.web.bind.annotation.RestController; | |
| 7 | - | |
| 8 | -/** | |
| 9 | - * Created by panzhao on 2017/9/17. | |
| 10 | - */ | |
| 11 | -@RestController | |
| 12 | -@RequestMapping("frequent_phrases") | |
| 13 | -public class FrequentPhrasesController extends BaseController<FrequentPhrases, Integer>{ | |
| 14 | - | |
| 15 | -} | |
| 1 | +package com.bsth.controller.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.controller.BaseController; | |
| 4 | +import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 5 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 6 | +import org.springframework.web.bind.annotation.RestController; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by panzhao on 2017/9/17. | |
| 10 | + */ | |
| 11 | +@RestController | |
| 12 | +@RequestMapping("frequent_phrases") | |
| 13 | +public class FrequentPhrasesController extends BaseController<FrequentPhrases, Integer>{ | |
| 14 | + | |
| 15 | +} | ... | ... |
src/main/java/com/bsth/controller/traffic/VehicleInoutStopController.java
0 → 100644
| 1 | +package com.bsth.controller.traffic; | |
| 2 | + | |
| 3 | +import com.bsth.controller.BaseController; | |
| 4 | +import com.bsth.entity.traffic.VehicleInoutStop; | |
| 5 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 6 | +import org.springframework.web.bind.annotation.RestController; | |
| 7 | +/** | |
| 8 | + * | |
| 9 | + * @author BSTH | |
| 10 | + * | |
| 11 | + */ | |
| 12 | +@RestController | |
| 13 | +@RequestMapping("vehicle_stop") | |
| 14 | +public class VehicleInoutStopController extends BaseController<VehicleInoutStop,Integer> { | |
| 15 | +} | ... | ... |
src/main/java/com/bsth/entity/realcontrol/FrequentPhrases.java
| 1 | -package com.bsth.entity.realcontrol; | |
| 2 | - | |
| 3 | -import javax.persistence.Entity; | |
| 4 | -import javax.persistence.GeneratedValue; | |
| 5 | -import javax.persistence.Id; | |
| 6 | -import javax.persistence.Table; | |
| 7 | - | |
| 8 | -/** | |
| 9 | - * 常用短语 | |
| 10 | - * Created by panzhao on 2017/9/17. | |
| 11 | - */ | |
| 12 | -@Entity | |
| 13 | -@Table(name = "bsth_c_s_frequent_phrases") | |
| 14 | -public class FrequentPhrases { | |
| 15 | - | |
| 16 | - @Id | |
| 17 | - @GeneratedValue | |
| 18 | - private Integer id; | |
| 19 | - | |
| 20 | - /** | |
| 21 | - * 用户名 | |
| 22 | - */ | |
| 23 | - private String userName; | |
| 24 | - | |
| 25 | - /** | |
| 26 | - * 短语 | |
| 27 | - */ | |
| 28 | - private String text; | |
| 29 | - | |
| 30 | - public Integer getId() { | |
| 31 | - return id; | |
| 32 | - } | |
| 33 | - | |
| 34 | - public void setId(Integer id) { | |
| 35 | - this.id = id; | |
| 36 | - } | |
| 37 | - | |
| 38 | - public String getUserName() { | |
| 39 | - return userName; | |
| 40 | - } | |
| 41 | - | |
| 42 | - public void setUserName(String userName) { | |
| 43 | - this.userName = userName; | |
| 44 | - } | |
| 45 | - | |
| 46 | - public String getText() { | |
| 47 | - return text; | |
| 48 | - } | |
| 49 | - | |
| 50 | - public void setText(String text) { | |
| 51 | - this.text = text; | |
| 52 | - } | |
| 53 | -} | |
| 1 | +package com.bsth.entity.realcontrol; | |
| 2 | + | |
| 3 | +import javax.persistence.Entity; | |
| 4 | +import javax.persistence.GeneratedValue; | |
| 5 | +import javax.persistence.Id; | |
| 6 | +import javax.persistence.Table; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 常用短语 | |
| 10 | + * Created by panzhao on 2017/9/17. | |
| 11 | + */ | |
| 12 | +@Entity | |
| 13 | +@Table(name = "bsth_c_s_frequent_phrases") | |
| 14 | +public class FrequentPhrases { | |
| 15 | + | |
| 16 | + @Id | |
| 17 | + @GeneratedValue | |
| 18 | + private Integer id; | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * 用户名 | |
| 22 | + */ | |
| 23 | + private String userName; | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 短语 | |
| 27 | + */ | |
| 28 | + private String text; | |
| 29 | + | |
| 30 | + public Integer getId() { | |
| 31 | + return id; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setId(Integer id) { | |
| 35 | + this.id = id; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public String getUserName() { | |
| 39 | + return userName; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setUserName(String userName) { | |
| 43 | + this.userName = userName; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public String getText() { | |
| 47 | + return text; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void setText(String text) { | |
| 51 | + this.text = text; | |
| 52 | + } | |
| 53 | +} | ... | ... |
src/main/java/com/bsth/entity/search/PredicatesBuilder.java
| ... | ... | @@ -108,7 +108,10 @@ public class PredicatesBuilder { |
| 108 | 108 | String.class.isAssignableFrom(rightType)) { // Date >= String |
| 109 | 109 | DateTime dateTime = new DateTime(object); |
| 110 | 110 | return cb.greaterThanOrEqualTo((Path<Date>) expression, dateTime.toDate()); |
| 111 | - } else { | |
| 111 | + } else if (long.class.isAssignableFrom(leftType) && | |
| 112 | + String.class.isAssignableFrom(rightType)) { // Long >= String | |
| 113 | + return cb.greaterThanOrEqualTo((Path<Long>) expression, Long.valueOf(object+"")); | |
| 114 | + } else { | |
| 112 | 115 | throw new RuntimeException("ge 不支持类型组合:" + expression.getJavaType() + ">=" + object.getClass()); |
| 113 | 116 | } |
| 114 | 117 | } |
| ... | ... | @@ -140,7 +143,10 @@ public class PredicatesBuilder { |
| 140 | 143 | String.class.isAssignableFrom(rightType)) { // Date <= String |
| 141 | 144 | DateTime dateTime = new DateTime(object); |
| 142 | 145 | return cb.lessThanOrEqualTo((Path<Date>) expression, dateTime.toDate()); |
| 143 | - } else { | |
| 146 | + }else if (long.class.isAssignableFrom(leftType) && | |
| 147 | + String.class.isAssignableFrom(rightType)) { // Long <= String | |
| 148 | + return cb.lessThanOrEqualTo((Path<Long>) expression, Long.valueOf(object + "") ); | |
| 149 | + } else { | |
| 144 | 150 | throw new RuntimeException("le 不支持类型组合:" + expression.getJavaType() + "<=" + object.getClass()); |
| 145 | 151 | } |
| 146 | 152 | } | ... | ... |
src/main/java/com/bsth/entity/traffic/VehicleInoutStop.java
| 1 | -package com.bsth.entity.traffic; | |
| 2 | - | |
| 3 | -import com.bsth.entity.Cars; | |
| 4 | -import com.bsth.entity.Line; | |
| 5 | - | |
| 6 | -import javax.persistence.*; | |
| 7 | -import java.util.Date; | |
| 8 | - | |
| 9 | -/** | |
| 10 | - * | |
| 11 | - * @ClassName: VehicleInoutStop(车载上报停靠站信息) | |
| 12 | - * | |
| 13 | - * @Description: TODO(线路标准信息) | |
| 14 | - * | |
| 15 | - * @Author bsth@zq | |
| 16 | - * | |
| 17 | - * @Date 2017-9-18 9:34:39 | |
| 18 | - * | |
| 19 | - * @Version 公交调度系统BS版 0.1 | |
| 20 | - * | |
| 21 | - */ | |
| 22 | -@Entity | |
| 23 | -@Table(name = "bsth_c_shreal") | |
| 24 | -public class VehicleInoutStop { | |
| 25 | - | |
| 26 | - @Id | |
| 27 | - @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 28 | - private Integer id; | |
| 29 | - | |
| 30 | - @ManyToOne | |
| 31 | - private Line line; | |
| 32 | - | |
| 33 | - @ManyToOne | |
| 34 | - private Cars cars; | |
| 35 | - | |
| 36 | - // 站点序号 | |
| 37 | - private Integer stop; | |
| 38 | - | |
| 39 | - // 营运状态 | |
| 40 | - private Integer serviceState; | |
| 41 | - | |
| 42 | - // 上下行 | |
| 43 | - private Integer upDown; | |
| 44 | - | |
| 45 | - // 进出站/站内外 | |
| 46 | - private Integer inOutStop; | |
| 47 | - | |
| 48 | - // 上报时间 | |
| 49 | - private Date reportDate; | |
| 50 | - | |
| 51 | - public Integer getId() { | |
| 52 | - return id; | |
| 53 | - } | |
| 54 | - | |
| 55 | - public void setId(Integer id) { | |
| 56 | - this.id = id; | |
| 57 | - } | |
| 58 | - | |
| 59 | - public Line getLine() { | |
| 60 | - return line; | |
| 61 | - } | |
| 62 | - | |
| 63 | - public void setLine(Line line) { | |
| 64 | - this.line = line; | |
| 65 | - } | |
| 66 | - | |
| 67 | - public Cars getCars() { | |
| 68 | - return cars; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public void setCars(Cars cars) { | |
| 72 | - this.cars = cars; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public Integer getStop() { | |
| 76 | - return stop; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public void setStop(Integer stop) { | |
| 80 | - this.stop = stop; | |
| 81 | - } | |
| 82 | - | |
| 83 | - public Integer getServiceState() { | |
| 84 | - return serviceState; | |
| 85 | - } | |
| 86 | - | |
| 87 | - public void setServiceState(Integer serviceState) { | |
| 88 | - this.serviceState = serviceState; | |
| 89 | - } | |
| 90 | - | |
| 91 | - public Integer getUpDown() { | |
| 92 | - return upDown; | |
| 93 | - } | |
| 94 | - | |
| 95 | - public void setUpDown(Integer upDown) { | |
| 96 | - this.upDown = upDown; | |
| 97 | - } | |
| 98 | - | |
| 99 | - public Integer getInOutStop() { | |
| 100 | - return inOutStop; | |
| 101 | - } | |
| 102 | - | |
| 103 | - public void setInOutStop(Integer inOutStop) { | |
| 104 | - this.inOutStop = inOutStop; | |
| 105 | - } | |
| 106 | - | |
| 107 | - public Date getReportDate() { | |
| 108 | - return reportDate; | |
| 109 | - } | |
| 110 | - | |
| 111 | - public void setReportDate(Date reportDate) { | |
| 112 | - this.reportDate = reportDate; | |
| 113 | - } | |
| 114 | -} | |
| 1 | +package com.bsth.entity.traffic; | |
| 2 | + | |
| 3 | +import com.bsth.entity.Cars; | |
| 4 | +import com.bsth.entity.Line; | |
| 5 | + | |
| 6 | +import javax.persistence.*; | |
| 7 | +import java.util.Date; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * | |
| 11 | + * @ClassName: VehicleInoutStop(车载上报停靠站信息) | |
| 12 | + * | |
| 13 | + * @Description: TODO(线路标准信息) | |
| 14 | + * | |
| 15 | + * @Author bsth@zq | |
| 16 | + * | |
| 17 | + * @Date 2017-9-18 9:34:39 | |
| 18 | + * | |
| 19 | + * @Version 公交调度系统BS版 0.1 | |
| 20 | + * | |
| 21 | + */ | |
| 22 | +@Entity | |
| 23 | +@Table(name = "bsth_c_shreal") | |
| 24 | +public class VehicleInoutStop { | |
| 25 | + | |
| 26 | + @Id | |
| 27 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 28 | + private Integer id; | |
| 29 | + | |
| 30 | + @ManyToOne | |
| 31 | + private Line line; | |
| 32 | + | |
| 33 | + @ManyToOne | |
| 34 | + private Cars cars; | |
| 35 | + | |
| 36 | + // 站点序号 | |
| 37 | + private Integer stop; | |
| 38 | + | |
| 39 | + // 营运状态 | |
| 40 | + private Integer serviceState; | |
| 41 | + | |
| 42 | + // 上下行 | |
| 43 | + private Integer upDown; | |
| 44 | + | |
| 45 | + // 进出站/站内外 | |
| 46 | + private Integer inOutStop; | |
| 47 | + | |
| 48 | + // 上报时间 | |
| 49 | + private long reportDate; | |
| 50 | + | |
| 51 | + public Integer getId() { | |
| 52 | + return id; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setId(Integer id) { | |
| 56 | + this.id = id; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public Line getLine() { | |
| 60 | + return line; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setLine(Line line) { | |
| 64 | + this.line = line; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public Cars getCars() { | |
| 68 | + return cars; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public void setCars(Cars cars) { | |
| 72 | + this.cars = cars; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public Integer getStop() { | |
| 76 | + return stop; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public void setStop(Integer stop) { | |
| 80 | + this.stop = stop; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public Integer getServiceState() { | |
| 84 | + return serviceState; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public void setServiceState(Integer serviceState) { | |
| 88 | + this.serviceState = serviceState; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public Integer getUpDown() { | |
| 92 | + return upDown; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public void setUpDown(Integer upDown) { | |
| 96 | + this.upDown = upDown; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public Integer getInOutStop() { | |
| 100 | + return inOutStop; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public void setInOutStop(Integer inOutStop) { | |
| 104 | + this.inOutStop = inOutStop; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public long getReportDate() { return reportDate; } | |
| 108 | + | |
| 109 | + public void setReportDate(long reportDate) { this.reportDate = reportDate; } | |
| 110 | +} | ... | ... |
src/main/java/com/bsth/repository/realcontrol/FrequentPhrasesRepository.java
| 1 | -package com.bsth.repository.realcontrol; | |
| 2 | - | |
| 3 | -import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 4 | -import com.bsth.repository.BaseRepository; | |
| 5 | -import org.springframework.stereotype.Repository; | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * Created by panzhao on 2017/9/17. | |
| 9 | - */ | |
| 10 | -@Repository | |
| 11 | -public interface FrequentPhrasesRepository extends BaseRepository<FrequentPhrases, Integer> { | |
| 12 | -} | |
| 1 | +package com.bsth.repository.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 4 | +import com.bsth.repository.BaseRepository; | |
| 5 | +import org.springframework.stereotype.Repository; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * Created by panzhao on 2017/9/17. | |
| 9 | + */ | |
| 10 | +@Repository | |
| 11 | +public interface FrequentPhrasesRepository extends BaseRepository<FrequentPhrases, Integer> { | |
| 12 | +} | ... | ... |
src/main/java/com/bsth/repository/traffic/VehicleInoutStopRepository.java
| 1 | -package com.bsth.repository.traffic; | |
| 2 | - | |
| 3 | -import com.bsth.entity.traffic.VehicleInoutStop; | |
| 4 | -import com.bsth.repository.BaseRepository; | |
| 5 | - | |
| 6 | -public interface VehicleInoutStopRepository extends BaseRepository<VehicleInoutStop, Integer> { | |
| 7 | -} | |
| 1 | +package com.bsth.repository.traffic; | |
| 2 | + | |
| 3 | +import com.bsth.entity.traffic.VehicleInoutStop; | |
| 4 | +import com.bsth.repository.BaseRepository; | |
| 5 | + | |
| 6 | +public interface VehicleInoutStopRepository extends BaseRepository<VehicleInoutStop, Integer> { | |
| 7 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/FrequentPhrasesService.java
| 1 | -package com.bsth.service.realcontrol; | |
| 2 | - | |
| 3 | -import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 4 | -import com.bsth.service.BaseService; | |
| 5 | - | |
| 6 | -/** | |
| 7 | - * Created by panzhao on 2017/9/17. | |
| 8 | - */ | |
| 9 | -public interface FrequentPhrasesService extends BaseService<FrequentPhrases, Integer> { | |
| 10 | -} | |
| 1 | +package com.bsth.service.realcontrol; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 4 | +import com.bsth.service.BaseService; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * Created by panzhao on 2017/9/17. | |
| 8 | + */ | |
| 9 | +public interface FrequentPhrasesService extends BaseService<FrequentPhrases, Integer> { | |
| 10 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/FrequentPhrasesServiceImpl.java
| 1 | -package com.bsth.service.realcontrol.impl; | |
| 2 | - | |
| 3 | -import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 4 | -import com.bsth.security.util.SecurityUtils; | |
| 5 | -import com.bsth.service.impl.BaseServiceImpl; | |
| 6 | -import com.bsth.service.realcontrol.FrequentPhrasesService; | |
| 7 | -import org.springframework.stereotype.Service; | |
| 8 | - | |
| 9 | -import java.util.Map; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * Created by panzhao on 2017/9/17. | |
| 13 | - */ | |
| 14 | -@Service | |
| 15 | -public class FrequentPhrasesServiceImpl extends BaseServiceImpl<FrequentPhrases, Integer> implements FrequentPhrasesService { | |
| 16 | - | |
| 17 | - @Override | |
| 18 | - public Map<String, Object> save(FrequentPhrases fp) { | |
| 19 | - fp.setUserName(SecurityUtils.getCurrentUser().getUserName()); | |
| 20 | - return super.save(fp); | |
| 21 | - } | |
| 22 | - | |
| 23 | - @Override | |
| 24 | - public Iterable<FrequentPhrases> list(Map<String, Object> map) { | |
| 25 | - map.put("userName_eq", SecurityUtils.getCurrentUser().getUserName()); | |
| 26 | - return super.list(map); | |
| 27 | - } | |
| 28 | -} | |
| 1 | +package com.bsth.service.realcontrol.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.realcontrol.FrequentPhrases; | |
| 4 | +import com.bsth.security.util.SecurityUtils; | |
| 5 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 6 | +import com.bsth.service.realcontrol.FrequentPhrasesService; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +import java.util.Map; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * Created by panzhao on 2017/9/17. | |
| 13 | + */ | |
| 14 | +@Service | |
| 15 | +public class FrequentPhrasesServiceImpl extends BaseServiceImpl<FrequentPhrases, Integer> implements FrequentPhrasesService { | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + public Map<String, Object> save(FrequentPhrases fp) { | |
| 19 | + fp.setUserName(SecurityUtils.getCurrentUser().getUserName()); | |
| 20 | + return super.save(fp); | |
| 21 | + } | |
| 22 | + | |
| 23 | + @Override | |
| 24 | + public Iterable<FrequentPhrases> list(Map<String, Object> map) { | |
| 25 | + map.put("userName_eq", SecurityUtils.getCurrentUser().getUserName()); | |
| 26 | + return super.list(map); | |
| 27 | + } | |
| 28 | +} | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -2608,7 +2608,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2608 | 2608 | path + "export/统计日报" + sdfSimple.format(sdfMonth.parse(date)) + ".xls"); |
| 2609 | 2609 | } catch (Exception e) { |
| 2610 | 2610 | // TODO: handle exception |
| 2611 | - e.printStackTrace(); | |
| 2611 | + //e.printStackTrace(); | |
| 2612 | + logger.info("" , e); | |
| 2612 | 2613 | } |
| 2613 | 2614 | } |
| 2614 | 2615 | ... | ... |
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
| ... | ... | @@ -271,7 +271,7 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail |
| 271 | 271 | for (int r = 1; r < sheet.getRows(); r++) { |
| 272 | 272 | List<FcInfo> fcInfos = new ArrayList<>(); |
| 273 | 273 | // 每行第一列都是路牌 |
| 274 | - fcInfos.add(new FcInfo(null, null, sheet.getCell(0, r).getContents(), null, null, null, null)); // 用fcsj放置路牌显示 | |
| 274 | + fcInfos.add(new FcInfo(null, null, sheet.getCell(0, r).getContents(), null, null, null, null, null)); // 用fcsj放置路牌显示 | |
| 275 | 275 | |
| 276 | 276 | int bc_ks = 0; // 空驶班次 |
| 277 | 277 | int bc_yy = 0; // 营运班次 |
| ... | ... | @@ -294,7 +294,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail |
| 294 | 294 | String qdzCode = content == null ? "" : content[7]; // 起点站编码 |
| 295 | 295 | String zdzCode = content == null ? "" : content[8]; // 终点站编码 |
| 296 | 296 | |
| 297 | - FcInfo fcInfo = new FcInfo(ttdid_str, bctype, fcsj, xldir, isfb, qdzCode, zdzCode); | |
| 297 | + String ists = content == null ? "" : content[9]; // 是否停驶 | |
| 298 | + | |
| 299 | + FcInfo fcInfo = new FcInfo(ttdid_str, bctype, fcsj, xldir, isfb, qdzCode, zdzCode, ists); | |
| 298 | 300 | |
| 299 | 301 | if (StringUtils.isNotEmpty(fzdname)) |
| 300 | 302 | headarrays[c] = fzdname; |
| ... | ... | @@ -328,10 +330,10 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail |
| 328 | 330 | } |
| 329 | 331 | |
| 330 | 332 | // 添加一列 空驶班次/空驶里程,fcsj放置数据 |
| 331 | - fcInfos.add(new FcInfo(null, null, String.format("%d/%.3f", bc_ks, lc_ks), null, null, null, null)); | |
| 333 | + fcInfos.add(new FcInfo(null, null, String.format("%d/%.3f", bc_ks, lc_ks), null, null, null, null, null)); | |
| 332 | 334 | |
| 333 | 335 | // 添加一列 营运班次/营运里程,fcsj放置数据 |
| 334 | - fcInfos.add(new FcInfo(null, null, String.format("%d/%.3f", bc_yy, lc_yy), null, null, null, null)); | |
| 336 | + fcInfos.add(new FcInfo(null, null, String.format("%d/%.3f", bc_yy, lc_yy), null, null, null, null, null)); | |
| 335 | 337 | |
| 336 | 338 | editInfo.getContents().add(fcInfos); |
| 337 | 339 | } | ... | ... |
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailForEdit.java
| ... | ... | @@ -29,6 +29,8 @@ public interface TTInfoDetailForEdit { |
| 29 | 29 | private String qdzCode; |
| 30 | 30 | /** 终点站code */ |
| 31 | 31 | private String zdzCode; |
| 32 | + /** 是否停驶 */ | |
| 33 | + private Boolean ists; | |
| 32 | 34 | |
| 33 | 35 | public FcInfo() { |
| 34 | 36 | } |
| ... | ... | @@ -40,7 +42,8 @@ public interface TTInfoDetailForEdit { |
| 40 | 42 | String xldir, |
| 41 | 43 | String isfb, |
| 42 | 44 | String qdzCode, |
| 43 | - String zdzCode) { | |
| 45 | + String zdzCode, | |
| 46 | + String ists) { | |
| 44 | 47 | this.ttdid = StringUtils.isEmpty(ttdid_str) ? null : Long.valueOf(ttdid_str); |
| 45 | 48 | this.bc_type = bc_type; |
| 46 | 49 | this.fcsj = fcsj; |
| ... | ... | @@ -59,6 +62,13 @@ public interface TTInfoDetailForEdit { |
| 59 | 62 | this.zdzCode = zdzCode; |
| 60 | 63 | } |
| 61 | 64 | |
| 65 | + if ("N".equals(ists)) | |
| 66 | + this.ists = false; | |
| 67 | + else if ("Y".equals(ists) || "true".equals(ists)) | |
| 68 | + this.ists = true; | |
| 69 | + else | |
| 70 | + this.ists = false; | |
| 71 | + | |
| 62 | 72 | } |
| 63 | 73 | |
| 64 | 74 | public Long getTtdid() { |
| ... | ... | @@ -116,6 +126,14 @@ public interface TTInfoDetailForEdit { |
| 116 | 126 | public void setZdzCode(String zdzCode) { |
| 117 | 127 | this.zdzCode = zdzCode; |
| 118 | 128 | } |
| 129 | + | |
| 130 | + public Boolean getIsts() { | |
| 131 | + return ists; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public void setIsts(Boolean ists) { | |
| 135 | + this.ists = ists; | |
| 136 | + } | |
| 119 | 137 | } |
| 120 | 138 | |
| 121 | 139 | /** | ... | ... |
src/main/java/com/bsth/service/traffic/VehicleInoutStopService.java
| 1 | -package com.bsth.service.traffic; | |
| 2 | - | |
| 3 | -import com.bsth.entity.traffic.VehicleInoutStop; | |
| 4 | -import com.bsth.service.BaseService; | |
| 5 | - | |
| 6 | - | |
| 7 | -/** | |
| 8 | - * 时刻模板上传日志 | |
| 9 | - */ | |
| 10 | -public interface VehicleInoutStopService extends BaseService<VehicleInoutStop,Integer> { | |
| 11 | - | |
| 12 | -} | |
| 1 | +package com.bsth.service.traffic; | |
| 2 | + | |
| 3 | +import com.bsth.entity.traffic.VehicleInoutStop; | |
| 4 | +import com.bsth.service.BaseService; | |
| 5 | + | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 时刻模板上传日志 | |
| 9 | + */ | |
| 10 | +public interface VehicleInoutStopService extends BaseService<VehicleInoutStop,Integer> { | |
| 11 | + | |
| 12 | +} | ... | ... |
src/main/java/com/bsth/service/traffic/impl/VehicleInoutStopServiceImpl.java
| 1 | -package com.bsth.service.traffic.impl; | |
| 2 | - | |
| 3 | -import com.bsth.entity.traffic.VehicleInoutStop; | |
| 4 | -import com.bsth.service.impl.BaseServiceImpl; | |
| 5 | -import com.bsth.service.traffic.VehicleInoutStopService; | |
| 6 | -import org.slf4j.Logger; | |
| 7 | -import org.slf4j.LoggerFactory; | |
| 8 | -import org.springframework.stereotype.Service; | |
| 9 | - | |
| 10 | -/** | |
| 11 | - * | |
| 12 | - * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) | |
| 13 | - * | |
| 14 | - * @Extends : BaseService | |
| 15 | - * | |
| 16 | - * @Description: | |
| 17 | - * | |
| 18 | - * @Author bsth@zq | |
| 19 | - * | |
| 20 | - * @Date 2016年10月28日 上午9:21:17 | |
| 21 | - * | |
| 22 | - * @Version 公交调度系统BS版 0.1 | |
| 23 | - * | |
| 24 | - */ | |
| 25 | - | |
| 26 | -@Service | |
| 27 | -public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutStop,Integer> implements VehicleInoutStopService { | |
| 28 | - | |
| 29 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 30 | - | |
| 31 | -} | |
| 1 | +package com.bsth.service.traffic.impl; | |
| 2 | + | |
| 3 | +import com.bsth.entity.traffic.VehicleInoutStop; | |
| 4 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 5 | +import com.bsth.service.traffic.VehicleInoutStopService; | |
| 6 | +import org.slf4j.Logger; | |
| 7 | +import org.slf4j.LoggerFactory; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * | |
| 12 | + * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) | |
| 13 | + * | |
| 14 | + * @Extends : BaseService | |
| 15 | + * | |
| 16 | + * @Description: | |
| 17 | + * | |
| 18 | + * @Author bsth@zq | |
| 19 | + * | |
| 20 | + * @Date 2016年10月28日 上午9:21:17 | |
| 21 | + * | |
| 22 | + * @Version 公交调度系统BS版 0.1 | |
| 23 | + * | |
| 24 | + */ | |
| 25 | + | |
| 26 | +@Service | |
| 27 | +public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutStop,Integer> implements VehicleInoutStopService { | |
| 28 | + | |
| 29 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 30 | + | |
| 31 | +} | ... | ... |
src/main/resources/datatools/ktrs/ttinfodetailoutputforedit.ktr
| ... | ... | @@ -3892,7 +3892,7 @@ |
| 3892 | 3892 | <optimizationLevel>9</optimizationLevel> |
| 3893 | 3893 | <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> |
| 3894 | 3894 | <jsScript_name>Script 1</jsScript_name> |
| 3895 | - <jsScript_script>//Script here

// 顺序,id,fcsj,jhlc,zdname,bctype,xldir,isfb
var all_content_array = [];
var all_content = ""; 
all_content_array.push(id);
all_content_array.push(fcsj);
all_content_array.push(jhlc);
all_content_array.push(fczdName);
all_content_array.push(bc_type);
all_content_array.push(xl_dir);
all_content_array.push(isfb);
all_content_array.push(qdz_code || 'null');
all_content_array.push(zdz_code || 'null');

all_content = all_content_array.join(","); // 逗号分隔</jsScript_script> | |
| 3895 | + <jsScript_script>//Script here

// 顺序,id,fcsj,jhlc,zdname,bctype,xldir,isfb
var all_content_array = [];
var all_content = ""; 
all_content_array.push(id);
all_content_array.push(fcsj);
all_content_array.push(jhlc);
all_content_array.push(fczdName);
all_content_array.push(bc_type);
all_content_array.push(xl_dir);
all_content_array.push(isfb);
all_content_array.push(qdz_code || 'null');
all_content_array.push(zdz_code || 'null');
all_content_array.push(ists);

all_content = all_content_array.join(","); // 逗号分隔</jsScript_script> | |
| 3896 | 3896 | </jsScript> </jsScripts> <fields> <field> <name>all_content</name> |
| 3897 | 3897 | <rename>all_content</rename> |
| 3898 | 3898 | <type>String</type> |
| ... | ... | @@ -3964,7 +3964,7 @@ |
| 3964 | 3964 | <schema_name/> |
| 3965 | 3965 | </partitioning> |
| 3966 | 3966 | <connection>bus_control_variable</connection> |
| 3967 | - <sql>select 
t.id as id
, concat(g.id, '_', g.lp_name) as lp
, g.xl as xl
, qdz_code
, qdz_name
, zdz_code
, zdz_name
, fcsj
, jhlc
, bc_type 
, bcs
, fcno
, xl_dir
, isfb
from bsth_c_s_ttinfo_detail t left join 
bsth_c_s_gbi g on t.lp = g.id 
where 
g.xl = ? and
t.ttinfo = ? 
order by g.lp_no asc, t.bcs asc</sql> | |
| 3967 | + <sql>select 
t.id as id
, concat(g.id, '_', g.lp_name) as lp
, g.xl as xl
, qdz_code
, qdz_name
, zdz_code
, zdz_name
, fcsj
, jhlc
, bc_type 
, bcs
, fcno
, xl_dir
, isfb
, ists
from bsth_c_s_ttinfo_detail t left join 
bsth_c_s_gbi g on t.lp = g.id 
where 
g.xl = ? and
t.ttinfo = ? 
order by g.lp_no asc, t.bcs asc</sql> | |
| 3968 | 3968 | <limit>0</limit> |
| 3969 | 3969 | <lookup>获取变量</lookup> |
| 3970 | 3970 | <execute_each_row>N</execute_each_row> | ... | ... |
src/main/resources/static/pages/report/oil/oilListMonth.html
| ... | ... | @@ -242,7 +242,9 @@ |
| 242 | 242 | } |
| 243 | 243 | var line = $("#line").val(); |
| 244 | 244 | var date = $("#date").val(); |
| 245 | - $get('/ylb/oilListMonth', {line:line,date:date,type:'export'}, function(result){ | |
| 245 | + var gsdm = $("#gsdm").val(); | |
| 246 | + var fgsdm = $("#fgsdm").val(); | |
| 247 | + $get('/ylb/oilListMonth', {line:line,date:date,gsdm:gsdm,fgsdm,fgsdm,type:'export'}, function(result){ | |
| 246 | 248 | window.open("/downloadFile/download?fileName=月存油报表"+moment(date).format("YYYYMMDD")); |
| 247 | 249 | }); |
| 248 | 250 | }); | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/index.html
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <span class="caption-subject bold uppercase">车辆信息表</span> |
| 28 | 28 | </div> |
| 29 | 29 | <div class="actions"> |
| 30 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 30 | + <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 31 | 31 | <i class="fa fa-plus"></i> |
| 32 | 32 | 添加车辆信息 |
| 33 | 33 | </a> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <span class="caption-subject bold uppercase">设备信息表</span> |
| 28 | 28 | </div> |
| 29 | 29 | <div class="actions"> |
| 30 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 30 | + <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 31 | 31 | <i class="fa fa-plus"></i> |
| 32 | 32 | 添加设备信息 |
| 33 | 33 | </a> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <span class="caption-subject bold uppercase">人员信息表</span> |
| 28 | 28 | </div> |
| 29 | 29 | <div class="actions"> |
| 30 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 30 | + <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 31 | 31 | <i class="fa fa-plus"></i> |
| 32 | 32 | 添加人员信息 |
| 33 | 33 | </a> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html
| ... | ... | @@ -55,20 +55,18 @@ |
| 55 | 55 | </sa-Select5> |
| 56 | 56 | </td> |
| 57 | 57 | <td> |
| 58 | - <div> | |
| 59 | - <sa-Select5 name="gz" | |
| 60 | - model="ctrl.searchCondition()" | |
| 61 | - cmaps="{'posts_eq': 'code'}" | |
| 62 | - dcname="posts_eq" | |
| 63 | - icname="code" | |
| 64 | - dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" | |
| 65 | - iterobjname="item" | |
| 66 | - iterobjexp="item.name" | |
| 67 | - searchph="请输拼音..." | |
| 68 | - searchexp="this.name" | |
| 69 | - > | |
| 70 | - </sa-Select5> | |
| 71 | - </div> | |
| 58 | + <sa-Select5 name="gz" | |
| 59 | + model="ctrl.searchCondition()" | |
| 60 | + cmaps="{'posts_eq': 'code'}" | |
| 61 | + dcname="posts_eq" | |
| 62 | + icname="code" | |
| 63 | + dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" | |
| 64 | + iterobjname="item" | |
| 65 | + iterobjexp="item.name" | |
| 66 | + searchph="请输拼音..." | |
| 67 | + searchexp="this.name" | |
| 68 | + > | |
| 69 | + </sa-Select5> | |
| 72 | 70 | </td> |
| 73 | 71 | <td> |
| 74 | 72 | <div> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTable.js
| ... | ... | @@ -20,6 +20,7 @@ angular.module('ScheduleApp').factory( |
| 20 | 20 | this.fcsj = detailInfo && detailInfo.fcsj; // 发车时间 |
| 21 | 21 | this.bc_type = detailInfo && detailInfo.bc_type; // 班次类型 |
| 22 | 22 | this.xldir = detailInfo && detailInfo.xldir; // 线路上下行 |
| 23 | + this.ists = detailInfo && detailInfo.ists; // 是否停驶 | |
| 23 | 24 | this.isfb = detailInfo && detailInfo.isfb; // 是否分班 |
| 24 | 25 | this.qdzCode = detailInfo && detailInfo.qdzCode; // 起点站Code |
| 25 | 26 | this.zdzCode = detailInfo && detailInfo.zdzCode; // 终点站Code | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html
| ... | ... | @@ -220,6 +220,10 @@ |
| 220 | 220 | background: #e43a45 !important; |
| 221 | 221 | color: white; |
| 222 | 222 | } |
| 223 | + .tt_table dd.ists { | |
| 224 | + background: #105383 !important; | |
| 225 | + color: white; | |
| 226 | + } | |
| 223 | 227 | .tt_table dd.region { |
| 224 | 228 | background: #686d7b !important; |
| 225 | 229 | color: white; |
| ... | ... | @@ -360,6 +364,7 @@ |
| 360 | 364 | lpName: !cell.ttdid, |
| 361 | 365 | error: cell.isValidInfo, |
| 362 | 366 | active: cell.sel, |
| 367 | + ists: cell.ists, | |
| 363 | 368 | region: cell.bc_type == 'region', |
| 364 | 369 | isfb: cell.isfb |
| 365 | 370 | }"> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| ... | ... | @@ -3915,6 +3915,7 @@ angular.module('ScheduleApp').factory( |
| 3915 | 3915 | this.fcsj = detailInfo && detailInfo.fcsj; // 发车时间 |
| 3916 | 3916 | this.bc_type = detailInfo && detailInfo.bc_type; // 班次类型 |
| 3917 | 3917 | this.xldir = detailInfo && detailInfo.xldir; // 线路上下行 |
| 3918 | + this.ists = detailInfo && detailInfo.ists; // 是否停驶 | |
| 3918 | 3919 | this.isfb = detailInfo && detailInfo.isfb; // 是否分班 |
| 3919 | 3920 | this.qdzCode = detailInfo && detailInfo.qdzCode; // 起点站Code |
| 3920 | 3921 | this.zdzCode = detailInfo && detailInfo.zdzCode; // 终点站Code | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| ... | ... | @@ -537,7 +537,15 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$reso |
| 537 | 537 | } |
| 538 | 538 | }, |
| 539 | 539 | get: { |
| 540 | - method: 'GET' | |
| 540 | + method: 'GET', | |
| 541 | + transformResponse: function(rs) { | |
| 542 | + var dst = angular.fromJson(rs); | |
| 543 | + if (dst.status == 'SUCCESS') { | |
| 544 | + return dst.data; | |
| 545 | + } else { | |
| 546 | + return dst; | |
| 547 | + } | |
| 548 | + } | |
| 541 | 549 | }, |
| 542 | 550 | save: { |
| 543 | 551 | method: 'POST' | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| ... | ... | @@ -772,7 +772,7 @@ ScheduleApp.config([ |
| 772 | 772 | $stateProvider |
| 773 | 773 | // 排班计划明细管理模块 |
| 774 | 774 | .state("schedulePlanInfoManage", { |
| 775 | - url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime', | |
| 775 | + url: '/schedulePlanInfoManage/:spid/:xlid/:xlname/:ttname/:stime/:etime', | |
| 776 | 776 | views: { |
| 777 | 777 | "": { |
| 778 | 778 | templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/index_info.html' |
| ... | ... | @@ -793,6 +793,24 @@ ScheduleApp.config([ |
| 793 | 793 | }); |
| 794 | 794 | }] |
| 795 | 795 | } |
| 796 | + }) | |
| 797 | + | |
| 798 | + .state("schedulePlanInfoManage_edit", { // 时刻表详细信息编辑 | |
| 799 | + url: '/schedulePlanInfoManage_edit/:spid/:xlid/:xlname/:ttname/:stime/:etime/:spinfoid', | |
| 800 | + views: { | |
| 801 | + "": {templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/edit.html'} | |
| 802 | + }, | |
| 803 | + resolve: { | |
| 804 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 805 | + return $ocLazyLoad.load({ | |
| 806 | + name: 'schedulePlanInfoManage_module', | |
| 807 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 808 | + files: [ | |
| 809 | + "pages/scheduleApp/module/core/schedulePlanManage/info/module.js" | |
| 810 | + ] | |
| 811 | + }); | |
| 812 | + }] | |
| 813 | + } | |
| 796 | 814 | }); |
| 797 | 815 | |
| 798 | 816 | } | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/index.html
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <span class="caption-subject bold uppercase">配置表</span> |
| 28 | 28 | </div> |
| 29 | 29 | <div class="actions"> |
| 30 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 30 | + <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 31 | 31 | <i class="fa fa-plus"></i> |
| 32 | 32 | 添加配置 |
| 33 | 33 | </a> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/index.html
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <span class="caption-subject bold uppercase">配置表</span> |
| 28 | 28 | </div> |
| 29 | 29 | <div class="actions"> |
| 30 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 30 | + <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 31 | 31 | <i class="fa fa-plus"></i> |
| 32 | 32 | 添加配置 |
| 33 | 33 | </a> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/index.html
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <span class="caption-subject bold uppercase">套跑信息</span> |
| 28 | 28 | </div> |
| 29 | 29 | <div class="actions"> |
| 30 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 30 | + <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 31 | 31 | <i class="fa fa-plus"></i> |
| 32 | 32 | 添加套跑 |
| 33 | 33 | </a> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/index.html
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <span class="caption-subject bold uppercase">排班计划</span> |
| 28 | 28 | </div> |
| 29 | 29 | <div class="actions"> |
| 30 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 30 | + <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 31 | 31 | <i class="fa fa-plus"></i> |
| 32 | 32 | 生成计划 |
| 33 | 33 | </a> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/edit.html
0 → 100644
| 1 | +<div ng-controller="SchedulePlanInfoManageEditCtrl as ctrl"> | |
| 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 href="javascript:" ng-click="ctrl.toPlanPage()">排班计划管理</a> | |
| 19 | + <i class="fa fa-circle"></i> | |
| 20 | + </li> | |
| 21 | + <li> | |
| 22 | + <a href="javascript:" ng-click="ctrl.toPlanInfoListPage()">排班计划管理</a> | |
| 23 | + <i class="fa fa-circle"></i> | |
| 24 | + </li> | |
| 25 | + <li> | |
| 26 | + <span class="active">修改计划班次明细</span> | |
| 27 | + </li> | |
| 28 | + </ul> | |
| 29 | + | |
| 30 | + <h1>TODO</h1> | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | +</div> | |
| 36 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
| 1 | 1 | <!-- ui-route busInfoManage.list --> |
| 2 | -<div ng-controller="SchedulePlanInfoManageListCtrl as ctrl"> | |
| 2 | +<div ng-controller="SchedulePlanInfoManageListCtrl as ctrl" > | |
| 3 | 3 | <div style="width: 100%; height: 100%; overflow: auto"> |
| 4 | 4 | <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column"> |
| 5 | 5 | <thead> |
| 6 | 6 | <tr role="row" class="heading"> |
| 7 | 7 | <th style="width: 70px;">序号</th> |
| 8 | - <th style="width: 80px;">线路</th> | |
| 8 | + <th style="width: 80px;">操作</th> | |
| 9 | 9 | <th style="width: 150px;">日期</th> |
| 10 | - <th style="width: 50px;">路牌</th> | |
| 11 | - <th style="width: 100px;">车辆</th> | |
| 12 | - <th style="width: 120px;">驾驶员(工号)</th> | |
| 10 | + <th style="width: 100px;">路牌</th> | |
| 11 | + <th style="width: 80px;">车辆</th> | |
| 12 | + <th style="width: 140px;">行车人员</th> | |
| 13 | 13 | <!--<th style="width: 120px;">售票员(工号)</th>--> |
| 14 | 14 | <th style="width: 80px;">班次类型</th> |
| 15 | 15 | <th style="width: 80px;">发车时间</th> |
| 16 | - <th style="width: 80px;">上下行</th> | |
| 16 | + <th style="width: 70px;">上下行</th> | |
| 17 | 17 | <th style="width: 80px;">起点站</th> |
| 18 | 18 | <th style="width: 80px;">终点站</th> |
| 19 | 19 | <th style="width: 60px">备注</th> |
| 20 | 20 | <th style="width: 100%">时刻表</th> |
| 21 | - <th style="width: 90px;">修改人</th> | |
| 22 | - <th style="width: 90px;">修改时间</th> | |
| 21 | + <th style="width: 80px;">修改人</th> | |
| 22 | + <th style="width: 80px;">修改时间</th> | |
| 23 | 23 | |
| 24 | 24 | <!-- TODO:还有其他的 --> |
| 25 | 25 | |
| ... | ... | @@ -32,6 +32,7 @@ |
| 32 | 32 | <input type="text" class="form-control input-sm" |
| 33 | 33 | name="scheduleDate" placeholder="选择日期..." |
| 34 | 34 | uib-datepicker-popup="yyyy-MM-dd" |
| 35 | + datepicker-append-to-body="true" | |
| 35 | 36 | is-open="ctrl.scheduleDate" |
| 36 | 37 | ng-model="ctrl.searchCondition()['scheduleDate_eq']" readonly/> |
| 37 | 38 | <span class="input-group-btn"> |
| ... | ... | @@ -41,6 +42,22 @@ |
| 41 | 42 | </span> |
| 42 | 43 | </div> |
| 43 | 44 | </td> |
| 45 | + <td> | |
| 46 | + <div style="position: absolute;width: 90px"> | |
| 47 | + <sa-Select5 name="lp" | |
| 48 | + model="ctrl.searchCondition()" | |
| 49 | + cmaps="{'lp_eq' : 'id'}" | |
| 50 | + dcname="lp_eq" | |
| 51 | + icname="id" | |
| 52 | + dsparams="{{ {type: 'ajax', param:{'xl.id_eq': xlid, 'type': 'all'}, atype:'lpInfo2' } | json }}" | |
| 53 | + iterobjname="item" | |
| 54 | + iterobjexp="item.lpName" | |
| 55 | + searchph="..." | |
| 56 | + searchexp="this.lpName" | |
| 57 | + > | |
| 58 | + </sa-Select5> | |
| 59 | + </div> | |
| 60 | + </td> | |
| 44 | 61 | <td></td> |
| 45 | 62 | <td></td> |
| 46 | 63 | <td></td> |
| ... | ... | @@ -67,7 +84,9 @@ |
| 67 | 84 | </td> |
| 68 | 85 | |
| 69 | 86 | <td> |
| 70 | - <span ng-bind="info.xlName"></span> | |
| 87 | + <a href="javascript:" class="btn btn-info btn-sm" ng-click="ctrl.toEditPage(info.id)" > | |
| 88 | + 修改 | |
| 89 | + </a> | |
| 71 | 90 | </td> |
| 72 | 91 | <td> |
| 73 | 92 | <span ng-bind="info.scheduleDate | date: 'yyyy-MM-dd'"></span> |
| ... | ... | @@ -78,10 +97,40 @@ |
| 78 | 97 | <td> |
| 79 | 98 | <span ng-bind="info.clZbh"></span> |
| 80 | 99 | </td> |
| 81 | - <td> | |
| 82 | - <span>{{info.jName ? info.jName + '(' + info.jGh + ')' : ''}}</span> | |
| 83 | 100 | |
| 101 | + <td class="container-fluid"> | |
| 102 | + <div class="row"> | |
| 103 | + <div style="padding-right: 1px;" class="col-md-6"> | |
| 104 | + <div ng-if="info.jName"> | |
| 105 | + <a href="#"> | |
| 106 | + <i class="fa fa-bus" aria-hidden="true"></i> | |
| 107 | + {{info.jName}} | |
| 108 | + </a> | |
| 109 | + </div> | |
| 110 | + <div ng-if="info.sName"> | |
| 111 | + <a href="#"> | |
| 112 | + <i class="fa fa-ticket" aria-hidden="true"></i> | |
| 113 | + {{info.sName}} | |
| 114 | + </a> | |
| 115 | + </div> | |
| 116 | + </div> | |
| 117 | + <div style="padding-left: 1px;" class="col-md-6"> | |
| 118 | + <div ng-if="info.jGh"> | |
| 119 | + <a href="#" style="padding-left: 5px"> | |
| 120 | + {{info.jGh}} | |
| 121 | + </a> | |
| 122 | + </div> | |
| 123 | + <div ng-if="info.sGh"> | |
| 124 | + <a href="#" style="padding-left: 5px"> | |
| 125 | + {{info.sGh}} | |
| 126 | + </a> | |
| 127 | + </div> | |
| 128 | + </div> | |
| 129 | + </div> | |
| 84 | 130 | </td> |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 85 | 134 | <!--<td>--> |
| 86 | 135 | <!--<span>{{info.sGh ? info.sName + '(' + info.sGh + ')' : ''}}</span>--> |
| 87 | 136 | <!--</td>--> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/module.js
| ... | ... | @@ -70,6 +70,7 @@ angular.module('ScheduleApp').controller( |
| 70 | 70 | function($state, $stateParams, $scope) { |
| 71 | 71 | var self = this; |
| 72 | 72 | var spid = $stateParams.spid; // 排班规则id |
| 73 | + var xlid = $stateParams.xlid; // 线路id | |
| 73 | 74 | var xlname = $stateParams.xlname; // 线路名字 |
| 74 | 75 | var ttname = $stateParams.ttname; // 时刻表名字 |
| 75 | 76 | var stime = $stateParams.stime; // 开始时间 |
| ... | ... | @@ -77,6 +78,7 @@ angular.module('ScheduleApp').controller( |
| 77 | 78 | |
| 78 | 79 | $scope.spid = spid; |
| 79 | 80 | $scope.xlname = xlname; |
| 81 | + $scope.xlid = xlid; | |
| 80 | 82 | $scope.ttname = ttname; |
| 81 | 83 | $scope.stime = stime; |
| 82 | 84 | $scope.etime = etime; |
| ... | ... | @@ -96,10 +98,15 @@ angular.module('ScheduleApp').controller( |
| 96 | 98 | 'SchedulePlanInfoManageListCtrl', |
| 97 | 99 | [ |
| 98 | 100 | 'SchedulePlanInfoManageService', |
| 101 | + '$stateParams', | |
| 99 | 102 | '$scope', |
| 100 | - function(service, $scope) { | |
| 103 | + '$state', | |
| 104 | + function(service, $stateParams, $scope, $state) { | |
| 101 | 105 | var self = this; |
| 102 | 106 | |
| 107 | + // 线路id | |
| 108 | + self.xlid = $stateParams.xlid; | |
| 109 | + | |
| 103 | 110 | // 日期 日期控件开关 |
| 104 | 111 | self.scheduleDate = false; |
| 105 | 112 | self.scheduleDate_open = function() { |
| ... | ... | @@ -135,9 +142,22 @@ angular.module('ScheduleApp').controller( |
| 135 | 142 | |
| 136 | 143 | self.doPage(); |
| 137 | 144 | |
| 145 | + self.toEditPage = function(spinfoid) { | |
| 146 | + $state.go("schedulePlanInfoManage_edit", { | |
| 147 | + spid : $stateParams.spid, | |
| 148 | + xlid : $stateParams.xlid, | |
| 149 | + xlname: $stateParams.xlname, | |
| 150 | + ttname: $stateParams.ttname, | |
| 151 | + stime: $stateParams.stime, | |
| 152 | + etime: $stateParams.etime, | |
| 153 | + spinfoid: spinfoid | |
| 154 | + }); | |
| 155 | + }; | |
| 156 | + | |
| 138 | 157 | $scope.$watch( |
| 139 | 158 | function() { |
| 140 | - return self.searchCondition()['scheduleDate_eq']; | |
| 159 | + //return self.searchCondition()['scheduleDate_eq']; | |
| 160 | + return self.searchCondition(); | |
| 141 | 161 | }, |
| 142 | 162 | function(newValue, oldValue) { |
| 143 | 163 | if (newValue == undefined && oldValue == undefined) { |
| ... | ... | @@ -145,13 +165,61 @@ angular.module('ScheduleApp').controller( |
| 145 | 165 | } else { |
| 146 | 166 | self.doPage(); |
| 147 | 167 | } |
| 148 | - } | |
| 168 | + }, | |
| 169 | + true | |
| 149 | 170 | ); |
| 150 | 171 | |
| 151 | 172 | } |
| 152 | 173 | ] |
| 153 | 174 | ); |
| 154 | 175 | |
| 176 | +// edit.html | |
| 177 | +angular.module("ScheduleApp").controller( | |
| 178 | + 'SchedulePlanInfoManageEditCtrl', | |
| 179 | + [ | |
| 180 | + 'SchedulePlanInfoManageService', | |
| 181 | + '$stateParams', | |
| 182 | + '$state', | |
| 183 | + function(service, $stateParams, $state) { | |
| 184 | + var self = this; | |
| 185 | + var SchedulePlanInfo = service.getQueryClass(); | |
| 186 | + | |
| 187 | + // 获取id | |
| 188 | + var spinfoid = $stateParams.spinfoid; | |
| 189 | + | |
| 190 | + // 欲保存的busInfo信息,绑定 | |
| 191 | + self.schedulePlanInfoForSave = new SchedulePlanInfo; | |
| 192 | + | |
| 193 | + self.toPlanPage = function() { | |
| 194 | + $state.go("schedulePlanManage"); | |
| 195 | + }; | |
| 196 | + self.toPlanInfoListPage = function() { | |
| 197 | + $state.go("schedulePlanInfoManage", $stateParams); | |
| 198 | + }; | |
| 199 | + | |
| 200 | + // 获取数据 | |
| 201 | + SchedulePlanInfo.get({id: spinfoid}, function(value) { | |
| 202 | + self.schedulePlanInfoForSave = value; | |
| 203 | + | |
| 204 | + // TODO | |
| 205 | + }); | |
| 206 | + | |
| 207 | + // 提交方法 | |
| 208 | + self.submit = function() { | |
| 209 | + // 保存或者更新 | |
| 210 | + self.schedulePlanInfoForSave.$save(function() { | |
| 211 | + self.toPlanInfoListPage(); | |
| 212 | + }); | |
| 213 | + }; | |
| 214 | + // 取消方法 | |
| 215 | + self.cancel = function() { | |
| 216 | + self.toPlanInfoListPage(); | |
| 217 | + }; | |
| 218 | + | |
| 219 | + | |
| 220 | + } | |
| 221 | + ] | |
| 222 | +); | |
| 155 | 223 | |
| 156 | 224 | |
| 157 | 225 | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/route.js
| ... | ... | @@ -11,7 +11,7 @@ ScheduleApp.config([ |
| 11 | 11 | $stateProvider |
| 12 | 12 | // 排班计划明细管理模块 |
| 13 | 13 | .state("schedulePlanInfoManage", { |
| 14 | - url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime', | |
| 14 | + url: '/schedulePlanInfoManage/:spid/:xlid/:xlname/:ttname/:stime/:etime', | |
| 15 | 15 | views: { |
| 16 | 16 | "": { |
| 17 | 17 | templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/index_info.html' |
| ... | ... | @@ -32,6 +32,24 @@ ScheduleApp.config([ |
| 32 | 32 | }); |
| 33 | 33 | }] |
| 34 | 34 | } |
| 35 | + }) | |
| 36 | + | |
| 37 | + .state("schedulePlanInfoManage_edit", { // 时刻表详细信息编辑 | |
| 38 | + url: '/schedulePlanInfoManage_edit/:spid/:xlid/:xlname/:ttname/:stime/:etime/:spinfoid', | |
| 39 | + views: { | |
| 40 | + "": {templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/edit.html'} | |
| 41 | + }, | |
| 42 | + resolve: { | |
| 43 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | + return $ocLazyLoad.load({ | |
| 45 | + name: 'schedulePlanInfoManage_module', | |
| 46 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | + files: [ | |
| 48 | + "pages/scheduleApp/module/core/schedulePlanManage/info/module.js" | |
| 49 | + ] | |
| 50 | + }); | |
| 51 | + }] | |
| 52 | + } | |
| 35 | 53 | }); |
| 36 | 54 | |
| 37 | 55 | } | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list.html
| ... | ... | @@ -132,7 +132,7 @@ |
| 132 | 132 | <td> |
| 133 | 133 | <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> |
| 134 | 134 | <!--<a href="edit.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 修改 </a>--> |
| 135 | - <a ui-sref="schedulePlanInfoManage({spid : info.id, xlname : info.xl.name, ttname : info.ttInfoNames, stime : info.scheduleFromTime, etime : info.scheduleToTime})" | |
| 135 | + <a ui-sref="schedulePlanInfoManage({spid : info.id, xlid: info.xl.id, xlname : info.xl.name, ttname : info.ttInfoNames, stime : info.scheduleFromTime, etime : info.scheduleToTime})" | |
| 136 | 136 | class="btn btn-info btn-sm"> 明细 </a> |
| 137 | 137 | <a sweetalert |
| 138 | 138 | sweet-options="{title: '是否删除排班计划?',text: '线路:' + info.xl.name + '</br>开始时间:' + ctrl.toDateStr(info.scheduleFromTime) + '</br>结束时间:' + ctrl.toDateStr(info.scheduleToTime) + '</br>请谨慎删除!', html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}" | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
| ... | ... | @@ -81,7 +81,15 @@ angular.module('ScheduleApp').factory('SchedulePlanInfoManageService_g', ['$reso |
| 81 | 81 | } |
| 82 | 82 | }, |
| 83 | 83 | get: { |
| 84 | - method: 'GET' | |
| 84 | + method: 'GET', | |
| 85 | + transformResponse: function(rs) { | |
| 86 | + var dst = angular.fromJson(rs); | |
| 87 | + if (dst.status == 'SUCCESS') { | |
| 88 | + return dst.data; | |
| 89 | + } else { | |
| 90 | + return dst; | |
| 91 | + } | |
| 92 | + } | |
| 85 | 93 | }, |
| 86 | 94 | save: { |
| 87 | 95 | method: 'POST' | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/index.html
| ... | ... | @@ -27,7 +27,7 @@ |
| 27 | 27 | <span class="caption-subject bold uppercase">排班规则</span> |
| 28 | 28 | </div> |
| 29 | 29 | <div class="actions"> |
| 30 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 30 | + <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.goForm()"> | |
| 31 | 31 | <i class="fa fa-plus"></i> |
| 32 | 32 | 添加规则 |
| 33 | 33 | </a> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
| ... | ... | @@ -36,6 +36,7 @@ |
| 36 | 36 | <!--<i class="fa fa-arrow-down" aria-hidden="true"></i>--> |
| 37 | 37 | <!--<span style="padding-right: 10px;">下行班次</span>--> |
| 38 | 38 | <!--<i class="fa fa-circle-o-notch" aria-hidden="true"></i>--> |
| 39 | + <span style="padding-right: 10px;background: #105383;color: white;text-align: center;">停驶班次</span> | |
| 39 | 40 | <span style="padding-right: 10px;background: #686d7b;color: white;text-align: center;">区间班次</span> |
| 40 | 41 | <!--<i class="fa fa-adjust" aria-hidden="true"></i>--> |
| 41 | 42 | <span style="padding-right: 10px;background: #adff00;color: #501a1a;text-align: center;">分班班次</span> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/index.html
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | <!--<i class="fa fa-plus"></i>--> |
| 32 | 32 | <!--测试--> |
| 33 | 33 | <!--</a>--> |
| 34 | - <a href="javascirpt:" class="btn btn-circle blue" ng-click="ctrl.toTtInfoManageForm()"> | |
| 34 | + <a href="javascript:" class="btn btn-circle blue" ng-click="ctrl.toTtInfoManageForm()"> | |
| 35 | 35 | <i class="fa fa-plus"></i> |
| 36 | 36 | 添加时刻表 |
| 37 | 37 | </a> | ... | ... |
src/main/resources/static/pages/trafficManage/js/lineStationUploadRecord.js
| ... | ... | @@ -13,16 +13,57 @@ |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | (function(){ |
| 16 | + var page = 0, initPag; | |
| 16 | 17 | // 关闭左侧栏 |
| 17 | 18 | if (!$('body').hasClass('page-sidebar-closed')) |
| 18 | 19 | $('.menu-toggler.sidebar-toggler').click(); |
| 19 | - // 日期控件 | |
| 20 | - $('#dateInput').datetimepicker({ | |
| 21 | - // 日期控件时间格式 | |
| 22 | - format : 'YYYY-MM-DD', | |
| 23 | - // 语言 | |
| 24 | - locale: 'zh-cn' | |
| 25 | - }); | |
| 20 | + | |
| 21 | + $("#dateInput").datetimepicker({ | |
| 22 | + format : 'YYYY-MM-DD', | |
| 23 | + locale : 'zh-cn' | |
| 24 | + }); | |
| 25 | + | |
| 26 | + var lines = new Array(); | |
| 27 | + | |
| 28 | + $('#line').select2({ | |
| 29 | + ajax: { | |
| 30 | + url: '/realSchedule/findLine', | |
| 31 | + type: 'post', | |
| 32 | + dataType: 'json', | |
| 33 | + delay: 150, | |
| 34 | + data: function(params){ | |
| 35 | + return{line: params.term}; | |
| 36 | + }, | |
| 37 | + processResults: function (data) { | |
| 38 | + return { | |
| 39 | + results: data | |
| 40 | + }; | |
| 41 | + }, | |
| 42 | + cache: true | |
| 43 | + }, | |
| 44 | + templateResult: function(repo){ | |
| 45 | + if (repo.loading) return repo.text; | |
| 46 | + var h = '<span>'+repo.text+'</span>'; | |
| 47 | + return h; | |
| 48 | + }, | |
| 49 | + escapeMarkup: function (markup) { return markup; }, | |
| 50 | + minimumInputLength: 1, | |
| 51 | + templateSelection: function(repo){ | |
| 52 | + return repo.text; | |
| 53 | + }, | |
| 54 | + language: { | |
| 55 | + noResults: function(){ | |
| 56 | + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 57 | + }, | |
| 58 | + inputTooShort : function(e) { | |
| 59 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 60 | + }, | |
| 61 | + searching : function() { | |
| 62 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 63 | + } | |
| 64 | + } | |
| 65 | + }); | |
| 66 | + | |
| 26 | 67 | // 日期范围输入框限制,绑定按键和粘贴事件 |
| 27 | 68 | $(".dateRange").keyup(function(){ |
| 28 | 69 | var tmptxt=$(this).val(); |
| ... | ... | @@ -48,81 +89,112 @@ |
| 48 | 89 | if(tmptxt < 0){ |
| 49 | 90 | $(this).val(00); |
| 50 | 91 | } |
| 51 | - }).css("ime-mode", "disabled"); | |
| 52 | - /** | |
| 53 | - * 取得编码-公司map | |
| 54 | - * gsmap["5"] = 南汇公司 | |
| 55 | - * gsmap["5_3"] = 芦潮港分公司 | |
| 56 | - */ | |
| 57 | - function getBusMap(){ | |
| 58 | - // 取得公司信息,替换公司编码 | |
| 59 | - var gsmap = {}; | |
| 60 | - $get('/business/all', null, function(array){ | |
| 61 | - $.each(array, function(i, gs){ | |
| 62 | - var k = gs.upCode + '_' + gs.businessCode; | |
| 63 | - if(gs.upCode === '88'){ | |
| 64 | - k = gs.businessCode; | |
| 65 | - } | |
| 66 | - gsmap[k] = gs.businessName; | |
| 67 | - }); | |
| 68 | - }); | |
| 69 | - return gsmap; | |
| 70 | - } | |
| 71 | - /** | |
| 72 | - * 设置公司自动完成 | |
| 73 | - */ | |
| 74 | - var lines = new Array(); | |
| 75 | - var gsmap = getBusMap(); | |
| 76 | - // 取得所有线路 | |
| 77 | - $get('/line/all', null, function(allLine) { | |
| 78 | - // 遍历数组 | |
| 79 | - $.each(allLine, function(i, e) { | |
| 80 | - var companyCode = e.company; | |
| 81 | - e.company = gsmap[e.company]; | |
| 82 | - e.brancheCompany = gsmap[companyCode+"_"+e.brancheCompany]; | |
| 83 | - var line = '{"hex":"' + e.company + '","label":"' + e.name | |
| 84 | - + '"}'; | |
| 85 | - var obj = jQuery.parseJSON(line); | |
| 86 | - lines[i] = obj; | |
| 87 | - }); | |
| 88 | - }); | |
| 89 | - // 给输入框绑定autocomplete事件 | |
| 90 | - $("input[name='xl.name_eq']").autocompleter({ | |
| 91 | - highlightMatches : true, | |
| 92 | - source : lines, | |
| 93 | - template : '{{ label }} <span>({{ hex }})</span>', | |
| 94 | - hint : true, | |
| 95 | - empty : false, | |
| 96 | - limit : 5, | |
| 97 | - }); | |
| 98 | - // 设置autocompleter的宽度和输入框一样 | |
| 99 | - $(".autocompleter").css("width", | |
| 100 | - $("input[name='xl.name_eq']").css("width")); | |
| 101 | - | |
| 102 | - /** | |
| 103 | - * 设置内部编码自动完成 | |
| 104 | - */ | |
| 105 | - var cars = new Array(); | |
| 106 | - // 取得所有车辆 | |
| 107 | - $get('/cars/all', null, function(allCars) { | |
| 108 | - // 遍历数组 | |
| 109 | - $.each(allCars, function(i, e) { | |
| 110 | - var car = '{"hex":"' + e.insideCode + '","label":"' + e.insideCode | |
| 111 | - + '"}'; | |
| 112 | - var obj = jQuery.parseJSON(car); | |
| 113 | - cars[i] = obj; | |
| 114 | - }); | |
| 115 | - }); | |
| 116 | - // 给输入框绑定autocomplete事件 | |
| 117 | - $("input[name='xl.insideCode_eq']").autocompleter({ | |
| 118 | - highlightMatches : true, | |
| 119 | - source : cars, | |
| 120 | - template : '{{ label }}', | |
| 121 | - hint : true, | |
| 122 | - empty : false, | |
| 123 | - limit : 5, | |
| 124 | - }); | |
| 125 | - // 设置autocompleter的宽度和输入框一样 | |
| 126 | - $(".autocompleter").css("width", | |
| 127 | - $("input[name='xl.insideCode_eq']").css("width")); | |
| 92 | + }).css("ime-mode", "disabled"); | |
| 93 | + | |
| 94 | + // 绑定查询事件 | |
| 95 | + $("#search").click(searchM); | |
| 96 | + // 查询方法 | |
| 97 | + function searchM(pagination) { | |
| 98 | + if($("#dateInput").val() == ""){ | |
| 99 | + alert("请选择时间"); | |
| 100 | + return ; | |
| 101 | + } | |
| 102 | + var params = {}; | |
| 103 | + // 排序(按方向与序号) | |
| 104 | + params['order'] = 'reportDate'; | |
| 105 | + // 排序方向. | |
| 106 | + params['direction'] = 'ASC'; | |
| 107 | + // 记录当前页数 | |
| 108 | + params['page'] = page; | |
| 109 | + // 弹出正在加载层 | |
| 110 | + var i = layer.load(2); | |
| 111 | + // 取得输入框的值 | |
| 112 | + var inputs = $(".form-inline input,select"); | |
| 113 | + // 遍历数组 | |
| 114 | + $.each(inputs, function(i, element) { | |
| 115 | + params[$(element).attr("name")] = $(element).val(); | |
| 116 | + }); | |
| 117 | + | |
| 118 | + var startDate = params['startDate']; | |
| 119 | + var endDate = params['endDate']; | |
| 120 | + var reportDate = params['reportDate']; | |
| 121 | + if($("#carPlate").val() != ''){ | |
| 122 | + params['cars.carPlate_eq'] = changeCarPlate($("#carPlate").val()); | |
| 123 | + } | |
| 124 | + if($("#insideCode").val() != ''){ | |
| 125 | + params['cars.insideCode_eq'] = $("#insideCode").val().toUpperCase(); | |
| 126 | + } | |
| 127 | + // 默认开始时间 | |
| 128 | + params['reportDate_ge'] = str2datetime(reportDate+" 00:00:00"); | |
| 129 | + // 默认结束时间 | |
| 130 | + params['reportDate_le'] = str2datetime(reportDate+" 23:59:59"); | |
| 131 | + | |
| 132 | + // 指定的开始时间 | |
| 133 | + if(startDate != ''){ | |
| 134 | + params['reportDate_gt'] = str2datetime(reportDate+" "+ (startDate > 9 ? startDate : "0"+startDate + ":00:00")); | |
| 135 | + } | |
| 136 | + // 指定的结束时间 | |
| 137 | + if(endDate != ''){ | |
| 138 | + params['reportDate_lt'] = str2datetime(reportDate+" "+ (endDate > 9 ? endDate : "0"+endDate + ":59:59")); | |
| 139 | + } | |
| 140 | + $get('/vehicle_stop', params, function(data) { | |
| 141 | + var content = data.content; | |
| 142 | + _dateFormat(content); | |
| 143 | + var bodyHtm = template('lineStationUploadRecord_list_temp', { | |
| 144 | + list : content | |
| 145 | + }); | |
| 146 | + $('#vehicle_stop tbody').html(bodyHtm); | |
| 147 | + if(pagination && data.content.length > 0){ | |
| 148 | + //重新分页 | |
| 149 | + initPag = true; | |
| 150 | + showPagination(data); | |
| 151 | + } | |
| 152 | + layer.close(i); | |
| 153 | + }); | |
| 154 | + } | |
| 155 | + | |
| 156 | + /** 分页栏组件 */ | |
| 157 | + function showPagination(data){ | |
| 158 | + // 分页组件 | |
| 159 | + $('#pagination').jqPaginator({ | |
| 160 | + // 总页数 | |
| 161 | + totalPages: data.totalPages, | |
| 162 | + // 中间显示页数 | |
| 163 | + visiblePages: 6, | |
| 164 | + // 当前页 | |
| 165 | + currentPage: page + 1, | |
| 166 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 167 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 168 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 169 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 170 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 171 | + onPageChange: function (num, type) { | |
| 172 | + if(initPag){ | |
| 173 | + initPag = false; | |
| 174 | + return; | |
| 175 | + } | |
| 176 | + page = num - 1; | |
| 177 | + searchM(false); | |
| 178 | + } | |
| 179 | + }); | |
| 180 | + } | |
| 181 | + | |
| 182 | + //转换时间格式 | |
| 183 | + function _dateFormat(list) { | |
| 184 | + var fs = 'YYYY-MM-DD HH:mm:ss'; | |
| 185 | + $.each(list, function(i, obj) { | |
| 186 | + obj.reportDate = moment(obj.reportDate).format(fs); | |
| 187 | + }); | |
| 188 | + } | |
| 189 | + | |
| 190 | + // 时间字符串转成时间戳 | |
| 191 | + function str2datetime(stringTime){ | |
| 192 | + return Date.parse(new Date(stringTime)); | |
| 193 | + } | |
| 194 | + | |
| 195 | + // 时间字符串转成时间戳 | |
| 196 | + function changeCarPlate(carPlate){ | |
| 197 | + var tmp = "沪" + carPlate.substr(0, 1) + "-" + carPlate.substr(1, carPlate.length); | |
| 198 | + return tmp.toUpperCase();; | |
| 199 | + } | |
| 128 | 200 | })(); |
| 129 | 201 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/trafficManage/lineStationUploadRecord.html
| ... | ... | @@ -8,30 +8,40 @@ |
| 8 | 8 | </ul> |
| 9 | 9 | <div class="tab_line"> |
| 10 | 10 | <div class="col-md-12"> |
| 11 | - <ul class="breadcrumb"> | |
| 12 | - <li>筛选数据:</li> | |
| 13 | - <li>日期:</li> | |
| 14 | - <li><input type="text" class="inputCommon dateTime" name="date" id="dateInput" placeholder="日期"></li> | |
| 15 | - <li>时间范围:</li> | |
| 16 | - <li><input type="text" class="inputCommon dateRange" name="startDate">至 | |
| 17 | - <input type="text" class="inputCommon dateRange" name="endDate">时</li> | |
| 18 | - <li>线路名称:</li> | |
| 19 | - <li><input type="text" class="form-control form-filter input-sm" | |
| 20 | - name="xl.name_eq" maxlength="40" /></li> | |
| 21 | - <li>内部编码:</li> | |
| 22 | - <li><input type="text" class="form-control form-filter input-sm" | |
| 23 | - name="xl.insideCode_eq" maxlength="40" /></li> | |
| 24 | - <li>车牌号:</li> | |
| 25 | - <li><input type="text" class="inputCommon inputCarPlate" | |
| 26 | - name="xl.carPlate_eq" maxlength="40" /></li> | |
| 27 | - <li><a class="btn btn-circle blue" id="search">筛选</a></li> | |
| 28 | - </ul> | |
| 11 | + <form class="form-inline" action=""> | |
| 12 | + <div class="inLine_block" class="param"> | |
| 13 | + <span class="item-label" style="width: 80px;">筛选数据:日期:</span> | |
| 14 | + <input class="form-control" name="reportDate" type="text" id="dateInput" style="width: 180px;"/> | |
| 15 | + </div> | |
| 16 | + <div class="inLine_block" style="display: inline-block;margin-left: 15px;"> | |
| 17 | + <span class="item-label" style="width: 80px;">时间范围:</span> | |
| 18 | + <input type="text" name="startDate" class="inputCommon dateRange">至 | |
| 19 | + <input type="text" name="endDate" class="inputCommon dateRange">时 | |
| 20 | + </div> | |
| 21 | + <div class="inLine_block" style="display: inline-block;margin-left: 15px;"> | |
| 22 | + <span class="item-label" style="width: 80px;">线路名称:</span> | |
| 23 | + <select class="form-control" name="line.id_eq" id="line" style="width: 150px;"></select> | |
| 24 | + </div> | |
| 25 | + <div class="inLine_block" style="display: inline-block;margin-left: 15px;"> | |
| 26 | + <span class="item-label" style="width: 80px;">内部编码:</span> | |
| 27 | + <input type="text" name="cars.insideCode_eq" id="insideCode" style="width: 120px;" maxlength="40"/> | |
| 28 | + </div> | |
| 29 | + <div class="inLine_block" style="display: inline-block;margin-left: 15px;"> | |
| 30 | + <span class="item-label" style="width: 80px;">车牌号:</span> | |
| 31 | + <input type="text" name="cars.carPlate_eq" id="carPlate" style="width: 120px;" maxlength="40"/> | |
| 32 | + <span style="color: red;width: 80px;">(沪D-12345 '沪'和'-'去掉)</span> | |
| 33 | + </div> | |
| 34 | + <div class="form-group" style="display: inline-block;margin-left: 15px;"> | |
| 35 | + <a class="btn btn-circle blue" id="search">筛选</a> | |
| 36 | + </div> | |
| 37 | + </form> | |
| 29 | 38 | </div> |
| 30 | 39 | <div class="col-md-12 panel-wrap"> |
| 31 | 40 | <div class="_panel"> |
| 32 | 41 | <div class="table-container"> |
| 33 | 42 | <table |
| 34 | - class="table table-striped table-bordered table-advance pb-table head"> | |
| 43 | + class="table table-striped table-bordered table-advance pb-table head" | |
| 44 | + id="vehicle_stop"> | |
| 35 | 45 | <thead> |
| 36 | 46 | <tr> |
| 37 | 47 | <th>序号</th> |
| ... | ... | @@ -59,53 +69,127 @@ |
| 59 | 69 | </div> |
| 60 | 70 | </div> |
| 61 | 71 | </div> |
| 62 | -<script id="lineStationRecord_list_temp" type="text/html"> | |
| 72 | +<script id="lineStationUploadRecord_list_temp" type="text/html"> | |
| 63 | 73 | {{each list as obj i}} |
| 64 | 74 | <tr> |
| 65 | 75 | <td class="seq" style="vertical-align: middle;"> |
| 66 | 76 | {{i+1}} |
| 67 | 77 | </td> |
| 68 | 78 | <td> |
| 69 | - {{obj.name}} | |
| 79 | + {{if obj.line.company == '55'}} | |
| 80 | + 上南公司 | |
| 81 | + {{else if obj.line.company == '22'}} | |
| 82 | + 金高公司 | |
| 83 | + {{else if obj.line.company == '05'}} | |
| 84 | + 杨高公司 | |
| 85 | + {{else if obj.line.company == '26'}} | |
| 86 | + 南汇公司 | |
| 87 | + {{else if obj.line.company == '77'}} | |
| 88 | + 闵行公司 | |
| 89 | + {{/if}} | |
| 70 | 90 | </td> |
| 71 | - <td class="ttInfoId"> | |
| 72 | - {{obj.company}} | |
| 91 | + <td> | |
| 92 | + {{if obj.line.company == '55'}} | |
| 93 | + | |
| 94 | + {{if obj.line.brancheCompany == '1'}} | |
| 95 | + 上南二分公司 | |
| 96 | + {{else if obj.line.brancheCompany == '2'}} | |
| 97 | + 上南三分公司 | |
| 98 | + {{else if obj.line.brancheCompany == '3'}} | |
| 99 | + 上南六分公司 | |
| 100 | + {{else if obj.line.brancheCompany == '4'}} | |
| 101 | + 上南一分公司 | |
| 102 | + {{/if}} | |
| 103 | + | |
| 104 | + {{else if obj.line.company == '22'}} | |
| 105 | + | |
| 106 | + {{if obj.line.brancheCompany == '1'}} | |
| 107 | + 四分公司 | |
| 108 | + {{else if obj.line.brancheCompany == '2'}} | |
| 109 | + 二分公司 | |
| 110 | + {{else if obj.line.brancheCompany == '3'}} | |
| 111 | + 三分公司 | |
| 112 | + {{else if obj.line.brancheCompany == '5'}} | |
| 113 | + 一分公司 | |
| 114 | + {{/if}} | |
| 115 | + | |
| 116 | + {{else if obj.line.company == '05'}} | |
| 117 | + | |
| 118 | + {{if obj.line.brancheCompany == '1'}} | |
| 119 | + 川沙分公司 | |
| 120 | + {{else if obj.line.brancheCompany == '2'}} | |
| 121 | + 金桥分公司 | |
| 122 | + {{else if obj.line.brancheCompany == '3'}} | |
| 123 | + 芦潮港分公司 | |
| 124 | + {{else if obj.line.brancheCompany == '5'}} | |
| 125 | + 杨高分公司 | |
| 126 | + {{else if obj.line.brancheCompany == '6'}} | |
| 127 | + 周浦分公司 | |
| 128 | + {{/if}} | |
| 129 | + | |
| 130 | + {{else if obj.line.company == '26'}} | |
| 131 | + | |
| 132 | + {{if obj.line.brancheCompany == '1'}} | |
| 133 | + 南汇一分 | |
| 134 | + {{else if obj.line.brancheCompany == '2'}} | |
| 135 | + 南汇二分 | |
| 136 | + {{else if obj.line.brancheCompany == '3'}} | |
| 137 | + 南汇三分 | |
| 138 | + {{else if obj.line.brancheCompany == '4'}} | |
| 139 | + 南汇维修公司 | |
| 140 | + {{else if obj.line.brancheCompany == '5'}} | |
| 141 | + 南汇公司 | |
| 142 | + {{/if}} | |
| 143 | + | |
| 144 | + {{/if}} | |
| 73 | 145 | </td> |
| 74 | 146 | <td> |
| 75 | - | |
| 147 | + {{obj.line.name}} | |
| 76 | 148 | </td> |
| 77 | - <td > | |
| 78 | - | |
| 149 | + <td> | |
| 150 | + {{obj.line.shanghaiLinecode}} | |
| 79 | 151 | </td> |
| 80 | 152 | <td> |
| 81 | - {{obj.name}} | |
| 153 | + {{obj.cars.insideCode}} | |
| 82 | 154 | </td> |
| 83 | 155 | <td> |
| 84 | - {{obj.company}} | |
| 156 | + {{obj.cars.equipmentCode}} | |
| 85 | 157 | </td> |
| 86 | 158 | <td> |
| 87 | - | |
| 159 | + {{obj.cars.carPlate}} | |
| 88 | 160 | </td> |
| 89 | - <td > | |
| 90 | - | |
| 161 | + <td> | |
| 162 | + {{obj.stop}} | |
| 91 | 163 | </td> |
| 92 | 164 | <td> |
| 93 | - {{obj.name}} | |
| 165 | + {{if obj.serviceState == 0}} | |
| 166 | + 营运 | |
| 167 | + {{else if obj.serviceState == 1}} | |
| 168 | + 停运 | |
| 169 | + {{/if}} | |
| 94 | 170 | </td> |
| 95 | 171 | <td> |
| 96 | - {{obj.company}} | |
| 172 | + {{if obj.upDown == 0}} | |
| 173 | + 上行 | |
| 174 | + {{else if obj.upDown == 1}} | |
| 175 | + 下行 | |
| 176 | + {{/if}} | |
| 97 | 177 | </td> |
| 98 | 178 | <td> |
| 99 | - | |
| 179 | + {{if obj.inOutStop == 0}} | |
| 180 | + 站内 | |
| 181 | + {{else if obj.inOutStop == 1}} | |
| 182 | + 站外 | |
| 183 | + {{/if}} | |
| 100 | 184 | </td> |
| 101 | - <td > | |
| 102 | - | |
| 185 | + <td> | |
| 186 | + {{obj.reportDate}} | |
| 103 | 187 | </td> |
| 104 | 188 | </tr> |
| 105 | 189 | {{/each}} |
| 106 | 190 | {{if list.length == 0}} |
| 107 | 191 | <tr class="muted"> |
| 108 | - <td colspan=5 style="text-align: center;"><h6>没有找到相关数据</h6></td> | |
| 192 | + <td colspan=13 style="text-align: center;"><h6>没有找到相关数据</h6></td> | |
| 109 | 193 | </tr> |
| 110 | 194 | {{/if}} |
| 111 | 195 | </script> | ... | ... |
src/main/resources/static/real_control_v2/alone_page/home/alone_data_basic.js
| 1 | -/* 基础数据管理模块 */ | |
| 2 | - | |
| 3 | -var gb_data_basic = (function () { | |
| 4 | - | |
| 5 | - var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | |
| 6 | - var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | |
| 7 | - , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | |
| 8 | - stationRoutes = routes; | |
| 9 | - lineCode2NameAll = code2Name; | |
| 10 | - lineInformations = informations; | |
| 11 | - nbbm2deviceMap = nbbm2device; | |
| 12 | - device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | |
| 13 | - allPersonnel = all_personnel; | |
| 14 | - svgAttrs = svgAttrMap; | |
| 15 | - | |
| 16 | - res_load_ep.emitLater('data-basic'); | |
| 17 | - }); | |
| 18 | - | |
| 19 | - var storage = window.localStorage; | |
| 20 | - //激活的线路 | |
| 21 | - var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 22 | - //lineCode to line object | |
| 23 | - var codeToLine = {}; | |
| 24 | - //lineCode idx string | |
| 25 | - var line_idx = (function () { | |
| 26 | - var str = ''; | |
| 27 | - for (var i = 0, item; item = activeLines[i++];) { | |
| 28 | - str += (',' + item.lineCode); | |
| 29 | - codeToLine[item.lineCode] = item; | |
| 30 | - } | |
| 31 | - return str.substr(1); | |
| 32 | - })(); | |
| 33 | - | |
| 34 | - //站点路由 | |
| 35 | - gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 36 | - var list = rs.list;//JSON.parse(rs.list); | |
| 37 | - var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 38 | - //排序 | |
| 39 | - for (var lineCode in routeData) { | |
| 40 | - routeData[lineCode].sort(stationRouteSort); | |
| 41 | - } | |
| 42 | - ep.emit('stationRoutes', routeData); | |
| 43 | - }); | |
| 44 | - | |
| 45 | - //线路标准信息 | |
| 46 | - /*gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 47 | - var informations = {}; | |
| 48 | - $.each(rs, function () { | |
| 49 | - informations[this.line.lineCode] = this; | |
| 50 | - delete this['line']; | |
| 51 | - }); | |
| 52 | - ep.emit('lineInformations', informations); | |
| 53 | - });*/ | |
| 54 | - ep.emit('lineInformations', {}); | |
| 55 | - | |
| 56 | - //人员信息 | |
| 57 | - ep.emit('all_personnel', {}); | |
| 58 | - /*loadAllPersonnel(function (data) { | |
| 59 | - ep.emit('all_personnel', data); | |
| 60 | - }); | |
| 61 | - function loadAllPersonnel(cb) { | |
| 62 | - $.get('/personnel/all_py', function (rs) { | |
| 63 | - //转换成自动补全组件需要的数据 | |
| 64 | - var data = [], code; | |
| 65 | - for(var i =0, p; p = rs[i++];){ | |
| 66 | - code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 67 | - data.push({ | |
| 68 | - value: code + '/' + p.name, | |
| 69 | - fullChars: p.fullChars.toUpperCase(), | |
| 70 | - camelChars: p.camelChars.toUpperCase() | |
| 71 | - }); | |
| 72 | - } | |
| 73 | - cb && cb(data); | |
| 74 | - }); | |
| 75 | - }*/ | |
| 76 | - | |
| 77 | - var carparks = {}; | |
| 78 | - //停车场数据 | |
| 79 | -/* gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | |
| 80 | - rs.list.sort(function (a, b) { | |
| 81 | - return a.parkName.localeCompare(b.parkName); | |
| 82 | - }); | |
| 83 | - $.each(rs.list, function () { | |
| 84 | - carparks[this.parkCode] = this; | |
| 85 | - }); | |
| 86 | - });*/ | |
| 87 | - | |
| 88 | - //车辆数据 | |
| 89 | - var carsArray; | |
| 90 | - /*$.get('/basic/cars?t=' + Math.random(), function (rs) { | |
| 91 | - carsArray = rs; | |
| 92 | - });*/ | |
| 93 | - | |
| 94 | - var getCarparkByCode = function (code) { | |
| 95 | - return carparks[code]; | |
| 96 | - }; | |
| 97 | - | |
| 98 | - //line code to name | |
| 99 | - $.get('/basic/lineCode2Name', function (rs) { | |
| 100 | - ep.emit('lineCode2Name', rs); | |
| 101 | - }); | |
| 102 | - | |
| 103 | - //nbbm to device id | |
| 104 | - $.get('/basic/nbbm2deviceId', function (rs) { | |
| 105 | - ep.emit('nbbm2deviceId', rs); | |
| 106 | - }); | |
| 107 | - //nbbm to 车牌号 | |
| 108 | - var nbbm2PlateMap; | |
| 109 | - $.get('/basic/nbbm2PlateNo', function (rs) { | |
| 110 | - nbbm2PlateMap = rs; | |
| 111 | - }); | |
| 112 | - | |
| 113 | - //模拟图属性数据 | |
| 114 | - gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 115 | - var data = {}; | |
| 116 | - $.each(rs.list, function () { | |
| 117 | - this.hideStations = JSON.parse(this.hideStations); | |
| 118 | - this.nicknames = JSON.parse(this.nicknames); | |
| 119 | - data[this.lineCode] = this; | |
| 120 | - }); | |
| 121 | - ep.emit('svg_attrs', data); | |
| 122 | - }); | |
| 123 | - | |
| 124 | - //站点和停车场历时、公里对照数据 | |
| 125 | - var stat_park_data; | |
| 126 | - /*var load_stat_park_data = function () { | |
| 127 | - $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 128 | - stat_park_data = rs; | |
| 129 | - }); | |
| 130 | - } | |
| 131 | - load_stat_park_data();*/ | |
| 132 | - | |
| 133 | - function findLineByCodes(codeArr) { | |
| 134 | - var rs = []; | |
| 135 | - $.each(codeArr, function () { | |
| 136 | - rs.push(codeToLine[this]); | |
| 137 | - }); | |
| 138 | - return rs; | |
| 139 | - } | |
| 140 | - | |
| 141 | - var findCodeByLinename = function (name) { | |
| 142 | - for (var code in lineCode2NameAll) { | |
| 143 | - if (name == lineCode2NameAll[code]) | |
| 144 | - return code; | |
| 145 | - } | |
| 146 | - | |
| 147 | - return null; | |
| 148 | - }; | |
| 149 | - | |
| 150 | - var getLineInformation = function (lineCode) { | |
| 151 | - return lineInformations[lineCode]; | |
| 152 | - }; | |
| 153 | - | |
| 154 | - var stationRouteSort = function (a, b) { | |
| 155 | - return a.stationRouteCode - b.stationRouteCode; | |
| 156 | - }; | |
| 157 | - | |
| 158 | - /** | |
| 159 | - * 常用的备注补全列表 | |
| 160 | - */ | |
| 161 | - var remarksArray = ['保养', '故障', '肇事', '加油', '维修', '援外', '路阻' | |
| 162 | - , '故障(离合器坏)', '故障,(方向盘坏)', '故障(排挡坏)', '故障(门坏)', '故障(雨刮器坏)','故障(刹车坏)', '故障(气打不上)' | |
| 163 | - ,'故障(整车无电)', '故障(故障灯常亮)', '故障(警报灯亮)', '故障(玻璃坏)', '故障(反光镜坏)', '故障(发电机坏)', '故障(漏防冻液)' | |
| 164 | - , '故障(漏水)','故障(轮胎坏)', '故障(无动力)', '故障(喷机油)', '故障(水温高)', '保养(一级保养)' | |
| 165 | - , '保养(二级保养)', '保养(三级保养)', '换车出场', '临加进场', '临加出场']; | |
| 166 | - var remarksMapps = []; | |
| 167 | - $.each(remarksArray, function (i, t) { | |
| 168 | - remarksMapps.push({ | |
| 169 | - value: t, | |
| 170 | - fullChars: pinyin.getFullChars(t).toUpperCase(), | |
| 171 | - camelChars: pinyin.getCamelChars(t) | |
| 172 | - }); | |
| 173 | - }); | |
| 174 | - | |
| 175 | - //文件载入完毕 | |
| 176 | - res_load_ep.emitLater('load_data_basic'); | |
| 177 | - | |
| 178 | - return { | |
| 179 | - activeLines: activeLines, | |
| 180 | - line_idx: line_idx, | |
| 181 | - codeToLine: codeToLine, | |
| 182 | - nbbm2deviceMap: function () { | |
| 183 | - return nbbm2deviceMap; | |
| 184 | - }, | |
| 185 | - device2nbbmMap: function () { | |
| 186 | - return device2nbbmMap; | |
| 187 | - }, | |
| 188 | - getLineInformation: getLineInformation, | |
| 189 | - allInformations: function () { | |
| 190 | - return lineInformations; | |
| 191 | - }, | |
| 192 | - stationRoutes: function (lineCode) { | |
| 193 | - return stationRoutes[lineCode] | |
| 194 | - }, | |
| 195 | - findLineByCodes: findLineByCodes, | |
| 196 | - lineCode2NameAll: function () { | |
| 197 | - return lineCode2NameAll | |
| 198 | - }, | |
| 199 | - allPersonnel: function () { | |
| 200 | - return allPersonnel; | |
| 201 | - }, | |
| 202 | - findCodeByLinename: findCodeByLinename, | |
| 203 | - getCarparkByCode: getCarparkByCode, | |
| 204 | - getSvgAttr: function (lineCode) { | |
| 205 | - return svgAttrs[lineCode]; | |
| 206 | - }, | |
| 207 | - setSvgAttr: function (attr) { | |
| 208 | - attr.hideStations = JSON.parse(attr.hideStations); | |
| 209 | - attr.nicknames = JSON.parse(attr.nicknames); | |
| 210 | - svgAttrs[attr.lineCode] = attr; | |
| 211 | - }, | |
| 212 | - //是否是环线 | |
| 213 | - isLoopLine: function (lineCode) { | |
| 214 | - var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 215 | - //下行只有2个站点 | |
| 216 | - var len = data[0].length; | |
| 217 | - if (len > 0 && data[1].length == 2) { | |
| 218 | - var first = data[0][0], | |
| 219 | - end = data[0][len - 1]; | |
| 220 | - | |
| 221 | - /*if(first.stationName != end.stationName) | |
| 222 | - return false;*/ | |
| 223 | - | |
| 224 | - var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 225 | - , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 226 | - | |
| 227 | - //并且上行起终点距离200米内 | |
| 228 | - if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 229 | - return true; | |
| 230 | - } | |
| 231 | - } | |
| 232 | - | |
| 233 | - return false; | |
| 234 | - }, | |
| 235 | - //刷新员工信息 | |
| 236 | - refreshAllPersonnel: function (cb) { | |
| 237 | - loadAllPersonnel(function (data) { | |
| 238 | - allPersonnel = data; | |
| 239 | - cb && cb(); | |
| 240 | - }); | |
| 241 | - }, | |
| 242 | - nbbm2PlateMap: function () { | |
| 243 | - return nbbm2PlateMap; | |
| 244 | - }, | |
| 245 | - carsArray: function () { | |
| 246 | - return carsArray; | |
| 247 | - }, | |
| 248 | - simpleParksArray: function () { | |
| 249 | - var map = {}; | |
| 250 | - for(var code in carparks) | |
| 251 | - map[code] = carparks[code].parkName; | |
| 252 | - return map; | |
| 253 | - }, | |
| 254 | - remarksMapps: function () { | |
| 255 | - return remarksMapps; | |
| 256 | - }, | |
| 257 | - get_stat_park_data: function () { | |
| 258 | - return stat_park_data; | |
| 259 | - }, | |
| 260 | - reload_stat_park_data: function () { | |
| 261 | - load_stat_park_data(); | |
| 262 | - } | |
| 263 | - }; | |
| 264 | -})(); | |
| 1 | +/* 基础数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_basic = (function () { | |
| 4 | + | |
| 5 | + var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | |
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | |
| 7 | + , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | |
| 8 | + stationRoutes = routes; | |
| 9 | + lineCode2NameAll = code2Name; | |
| 10 | + lineInformations = informations; | |
| 11 | + nbbm2deviceMap = nbbm2device; | |
| 12 | + device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | |
| 13 | + allPersonnel = all_personnel; | |
| 14 | + svgAttrs = svgAttrMap; | |
| 15 | + | |
| 16 | + res_load_ep.emitLater('data-basic'); | |
| 17 | + }); | |
| 18 | + | |
| 19 | + var storage = window.localStorage; | |
| 20 | + //激活的线路 | |
| 21 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 22 | + //lineCode to line object | |
| 23 | + var codeToLine = {}; | |
| 24 | + //lineCode idx string | |
| 25 | + var line_idx = (function () { | |
| 26 | + var str = ''; | |
| 27 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 28 | + str += (',' + item.lineCode); | |
| 29 | + codeToLine[item.lineCode] = item; | |
| 30 | + } | |
| 31 | + return str.substr(1); | |
| 32 | + })(); | |
| 33 | + | |
| 34 | + //站点路由 | |
| 35 | + gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 36 | + var list = rs.list;//JSON.parse(rs.list); | |
| 37 | + var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 38 | + //排序 | |
| 39 | + for (var lineCode in routeData) { | |
| 40 | + routeData[lineCode].sort(stationRouteSort); | |
| 41 | + } | |
| 42 | + ep.emit('stationRoutes', routeData); | |
| 43 | + }); | |
| 44 | + | |
| 45 | + //线路标准信息 | |
| 46 | + /*gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 47 | + var informations = {}; | |
| 48 | + $.each(rs, function () { | |
| 49 | + informations[this.line.lineCode] = this; | |
| 50 | + delete this['line']; | |
| 51 | + }); | |
| 52 | + ep.emit('lineInformations', informations); | |
| 53 | + });*/ | |
| 54 | + ep.emit('lineInformations', {}); | |
| 55 | + | |
| 56 | + //人员信息 | |
| 57 | + ep.emit('all_personnel', {}); | |
| 58 | + /*loadAllPersonnel(function (data) { | |
| 59 | + ep.emit('all_personnel', data); | |
| 60 | + }); | |
| 61 | + function loadAllPersonnel(cb) { | |
| 62 | + $.get('/personnel/all_py', function (rs) { | |
| 63 | + //转换成自动补全组件需要的数据 | |
| 64 | + var data = [], code; | |
| 65 | + for(var i =0, p; p = rs[i++];){ | |
| 66 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 67 | + data.push({ | |
| 68 | + value: code + '/' + p.name, | |
| 69 | + fullChars: p.fullChars.toUpperCase(), | |
| 70 | + camelChars: p.camelChars.toUpperCase() | |
| 71 | + }); | |
| 72 | + } | |
| 73 | + cb && cb(data); | |
| 74 | + }); | |
| 75 | + }*/ | |
| 76 | + | |
| 77 | + var carparks = {}; | |
| 78 | + //停车场数据 | |
| 79 | +/* gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | |
| 80 | + rs.list.sort(function (a, b) { | |
| 81 | + return a.parkName.localeCompare(b.parkName); | |
| 82 | + }); | |
| 83 | + $.each(rs.list, function () { | |
| 84 | + carparks[this.parkCode] = this; | |
| 85 | + }); | |
| 86 | + });*/ | |
| 87 | + | |
| 88 | + //车辆数据 | |
| 89 | + var carsArray; | |
| 90 | + /*$.get('/basic/cars?t=' + Math.random(), function (rs) { | |
| 91 | + carsArray = rs; | |
| 92 | + });*/ | |
| 93 | + | |
| 94 | + var getCarparkByCode = function (code) { | |
| 95 | + return carparks[code]; | |
| 96 | + }; | |
| 97 | + | |
| 98 | + //line code to name | |
| 99 | + $.get('/basic/lineCode2Name', function (rs) { | |
| 100 | + ep.emit('lineCode2Name', rs); | |
| 101 | + }); | |
| 102 | + | |
| 103 | + //nbbm to device id | |
| 104 | + $.get('/basic/nbbm2deviceId', function (rs) { | |
| 105 | + ep.emit('nbbm2deviceId', rs); | |
| 106 | + }); | |
| 107 | + //nbbm to 车牌号 | |
| 108 | + var nbbm2PlateMap; | |
| 109 | + $.get('/basic/nbbm2PlateNo', function (rs) { | |
| 110 | + nbbm2PlateMap = rs; | |
| 111 | + }); | |
| 112 | + | |
| 113 | + //模拟图属性数据 | |
| 114 | + gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 115 | + var data = {}; | |
| 116 | + $.each(rs.list, function () { | |
| 117 | + this.hideStations = JSON.parse(this.hideStations); | |
| 118 | + this.nicknames = JSON.parse(this.nicknames); | |
| 119 | + data[this.lineCode] = this; | |
| 120 | + }); | |
| 121 | + ep.emit('svg_attrs', data); | |
| 122 | + }); | |
| 123 | + | |
| 124 | + //站点和停车场历时、公里对照数据 | |
| 125 | + var stat_park_data; | |
| 126 | + /*var load_stat_park_data = function () { | |
| 127 | + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 128 | + stat_park_data = rs; | |
| 129 | + }); | |
| 130 | + } | |
| 131 | + load_stat_park_data();*/ | |
| 132 | + | |
| 133 | + function findLineByCodes(codeArr) { | |
| 134 | + var rs = []; | |
| 135 | + $.each(codeArr, function () { | |
| 136 | + rs.push(codeToLine[this]); | |
| 137 | + }); | |
| 138 | + return rs; | |
| 139 | + } | |
| 140 | + | |
| 141 | + var findCodeByLinename = function (name) { | |
| 142 | + for (var code in lineCode2NameAll) { | |
| 143 | + if (name == lineCode2NameAll[code]) | |
| 144 | + return code; | |
| 145 | + } | |
| 146 | + | |
| 147 | + return null; | |
| 148 | + }; | |
| 149 | + | |
| 150 | + var getLineInformation = function (lineCode) { | |
| 151 | + return lineInformations[lineCode]; | |
| 152 | + }; | |
| 153 | + | |
| 154 | + var stationRouteSort = function (a, b) { | |
| 155 | + return a.stationRouteCode - b.stationRouteCode; | |
| 156 | + }; | |
| 157 | + | |
| 158 | + /** | |
| 159 | + * 常用的备注补全列表 | |
| 160 | + */ | |
| 161 | + var remarksArray = ['保养', '故障', '肇事', '加油', '维修', '援外', '路阻' | |
| 162 | + , '故障(离合器坏)', '故障,(方向盘坏)', '故障(排挡坏)', '故障(门坏)', '故障(雨刮器坏)','故障(刹车坏)', '故障(气打不上)' | |
| 163 | + ,'故障(整车无电)', '故障(故障灯常亮)', '故障(警报灯亮)', '故障(玻璃坏)', '故障(反光镜坏)', '故障(发电机坏)', '故障(漏防冻液)' | |
| 164 | + , '故障(漏水)','故障(轮胎坏)', '故障(无动力)', '故障(喷机油)', '故障(水温高)', '保养(一级保养)' | |
| 165 | + , '保养(二级保养)', '保养(三级保养)', '换车出场', '临加进场', '临加出场']; | |
| 166 | + var remarksMapps = []; | |
| 167 | + $.each(remarksArray, function (i, t) { | |
| 168 | + remarksMapps.push({ | |
| 169 | + value: t, | |
| 170 | + fullChars: pinyin.getFullChars(t).toUpperCase(), | |
| 171 | + camelChars: pinyin.getCamelChars(t) | |
| 172 | + }); | |
| 173 | + }); | |
| 174 | + | |
| 175 | + //文件载入完毕 | |
| 176 | + res_load_ep.emitLater('load_data_basic'); | |
| 177 | + | |
| 178 | + return { | |
| 179 | + activeLines: activeLines, | |
| 180 | + line_idx: line_idx, | |
| 181 | + codeToLine: codeToLine, | |
| 182 | + nbbm2deviceMap: function () { | |
| 183 | + return nbbm2deviceMap; | |
| 184 | + }, | |
| 185 | + device2nbbmMap: function () { | |
| 186 | + return device2nbbmMap; | |
| 187 | + }, | |
| 188 | + getLineInformation: getLineInformation, | |
| 189 | + allInformations: function () { | |
| 190 | + return lineInformations; | |
| 191 | + }, | |
| 192 | + stationRoutes: function (lineCode) { | |
| 193 | + return stationRoutes[lineCode] | |
| 194 | + }, | |
| 195 | + findLineByCodes: findLineByCodes, | |
| 196 | + lineCode2NameAll: function () { | |
| 197 | + return lineCode2NameAll | |
| 198 | + }, | |
| 199 | + allPersonnel: function () { | |
| 200 | + return allPersonnel; | |
| 201 | + }, | |
| 202 | + findCodeByLinename: findCodeByLinename, | |
| 203 | + getCarparkByCode: getCarparkByCode, | |
| 204 | + getSvgAttr: function (lineCode) { | |
| 205 | + return svgAttrs[lineCode]; | |
| 206 | + }, | |
| 207 | + setSvgAttr: function (attr) { | |
| 208 | + attr.hideStations = JSON.parse(attr.hideStations); | |
| 209 | + attr.nicknames = JSON.parse(attr.nicknames); | |
| 210 | + svgAttrs[attr.lineCode] = attr; | |
| 211 | + }, | |
| 212 | + //是否是环线 | |
| 213 | + isLoopLine: function (lineCode) { | |
| 214 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 215 | + //下行只有2个站点 | |
| 216 | + var len = data[0].length; | |
| 217 | + if (len > 0 && data[1].length == 2) { | |
| 218 | + var first = data[0][0], | |
| 219 | + end = data[0][len - 1]; | |
| 220 | + | |
| 221 | + /*if(first.stationName != end.stationName) | |
| 222 | + return false;*/ | |
| 223 | + | |
| 224 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 225 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 226 | + | |
| 227 | + //并且上行起终点距离200米内 | |
| 228 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 229 | + return true; | |
| 230 | + } | |
| 231 | + } | |
| 232 | + | |
| 233 | + return false; | |
| 234 | + }, | |
| 235 | + //刷新员工信息 | |
| 236 | + refreshAllPersonnel: function (cb) { | |
| 237 | + loadAllPersonnel(function (data) { | |
| 238 | + allPersonnel = data; | |
| 239 | + cb && cb(); | |
| 240 | + }); | |
| 241 | + }, | |
| 242 | + nbbm2PlateMap: function () { | |
| 243 | + return nbbm2PlateMap; | |
| 244 | + }, | |
| 245 | + carsArray: function () { | |
| 246 | + return carsArray; | |
| 247 | + }, | |
| 248 | + simpleParksArray: function () { | |
| 249 | + var map = {}; | |
| 250 | + for(var code in carparks) | |
| 251 | + map[code] = carparks[code].parkName; | |
| 252 | + return map; | |
| 253 | + }, | |
| 254 | + remarksMapps: function () { | |
| 255 | + return remarksMapps; | |
| 256 | + }, | |
| 257 | + get_stat_park_data: function () { | |
| 258 | + return stat_park_data; | |
| 259 | + }, | |
| 260 | + reload_stat_park_data: function () { | |
| 261 | + load_stat_park_data(); | |
| 262 | + } | |
| 263 | + }; | |
| 264 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/alone_page/home/alone_data_gps.js
| 1 | -/* gps 数据管理模块 */ | |
| 2 | - | |
| 3 | -var gb_data_gps = (function () { | |
| 4 | - | |
| 5 | - //fixed time refresh delay | |
| 6 | - var delay = 1000 * 7; | |
| 7 | - //deviceId ——> gps | |
| 8 | - var realData = {}; | |
| 9 | - //refresh after callback | |
| 10 | - var refreshEventCallbacks = []; | |
| 11 | - //register callback function | |
| 12 | - var registerCallback = function (cb) { | |
| 13 | - if (cb) | |
| 14 | - refreshEventCallbacks.push(cb); | |
| 15 | - }; | |
| 16 | - | |
| 17 | - var refresh = function (cb) { | |
| 18 | - $.ajax({ | |
| 19 | - url: '/gps/real/line', | |
| 20 | - data: {lineCodes: gb_data_basic.line_idx}, | |
| 21 | - dataType: 'json', | |
| 22 | - success: function (rs) { | |
| 23 | - //用定时的gps来检测session断开 | |
| 24 | - if(rs.status && rs.status==407){ | |
| 25 | - location.href = '/login.html'; | |
| 26 | - return; | |
| 27 | - } | |
| 28 | - refreshData(rs); | |
| 29 | - cb(); | |
| 30 | - }, | |
| 31 | - error: function (xr, t) { | |
| 32 | - notify_err('刷新GPS失败,稍后重试' + t); | |
| 33 | - cb(); | |
| 34 | - } | |
| 35 | - }); | |
| 36 | - }; | |
| 37 | - | |
| 38 | - var refreshData = function (rs) { | |
| 39 | - var old, addArr = [], | |
| 40 | - upArr = [], | |
| 41 | - upDownChange = []; | |
| 42 | - | |
| 43 | - var schArray; | |
| 44 | - $.each(rs, function () { | |
| 45 | - old = realData[this.deviceId]; | |
| 46 | - if (old) { | |
| 47 | - if (this.timestamp > old.timestamp) { | |
| 48 | - if (old.upDown != this.upDown) | |
| 49 | - upDownChange.push(this); | |
| 50 | - else | |
| 51 | - upArr.push(this); | |
| 52 | - } | |
| 53 | - | |
| 54 | - } else | |
| 55 | - addArr.push(this); | |
| 56 | - | |
| 57 | - //班次信息 | |
| 58 | - /*if (this.schId) { | |
| 59 | - schArray = gb_schedule_table.findScheduleByLine(this.lineId); | |
| 60 | - if (schArray) | |
| 61 | - this.sch = schArray[this.schId]; | |
| 62 | - }*/ | |
| 63 | - | |
| 64 | - //时间格式化 | |
| 65 | - this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | |
| 66 | - realData[this.deviceId] = this; | |
| 67 | - }); | |
| 68 | - | |
| 69 | - //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | |
| 70 | - //CCCallFuncN | |
| 71 | - $.each(refreshEventCallbacks, function (i, cb) { | |
| 72 | - cb(addArr, upArr, upDownChange); | |
| 73 | - }); | |
| 74 | - | |
| 75 | - }; | |
| 76 | - | |
| 77 | - var startFixedTime; | |
| 78 | - var fixedTimeRefresh = function () { | |
| 79 | - if (startFixedTime) | |
| 80 | - return; | |
| 81 | - startFixedTime = true; | |
| 82 | - | |
| 83 | - (function () { | |
| 84 | - var f = arguments.callee; | |
| 85 | - refresh(function () { | |
| 86 | - setTimeout(f, delay); | |
| 87 | - }); | |
| 88 | - })(); | |
| 89 | - }; | |
| 90 | - | |
| 91 | - var gpsByLineCode = function (lineCode) { | |
| 92 | - var rs = []; | |
| 93 | - for (var device in realData) { | |
| 94 | - if (realData[device].lineId == lineCode) | |
| 95 | - rs.push(realData[device]); | |
| 96 | - } | |
| 97 | - return rs; | |
| 98 | - }; | |
| 99 | - | |
| 100 | - var findOne = function (deviceId) { | |
| 101 | - return realData[deviceId]; | |
| 102 | - }; | |
| 103 | - | |
| 104 | - var findGpsByNbbm = function (nbbm) { | |
| 105 | - return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 106 | - }; | |
| 107 | - | |
| 108 | - /** | |
| 109 | - * 设备掉线事件 | |
| 110 | - */ | |
| 111 | - var deviceOffline = function (gps) { | |
| 112 | - $.each(offlineCallbacks, function (i, cb) { | |
| 113 | - cb(gps); | |
| 114 | - }); | |
| 115 | - }; | |
| 116 | - | |
| 117 | - //注册掉线事件回调函数 | |
| 118 | - var offlineCallbacks = []; | |
| 119 | - var registerOfflineCb = function (cb) { | |
| 120 | - if (cb) | |
| 121 | - offlineCallbacks.push(cb); | |
| 122 | - }; | |
| 123 | - | |
| 124 | - return { | |
| 125 | - fixedTimeRefresh: fixedTimeRefresh, | |
| 126 | - registerCallback: registerCallback, | |
| 127 | - allGps: realData, | |
| 128 | - gpsByLineCode: gpsByLineCode, | |
| 129 | - findOne: findOne, | |
| 130 | - findGpsByNbbm: findGpsByNbbm, | |
| 131 | - deviceOffline: deviceOffline, | |
| 132 | - registerOfflineCb: registerOfflineCb | |
| 133 | - }; | |
| 134 | -})(); | |
| 1 | +/* gps 数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_gps = (function () { | |
| 4 | + | |
| 5 | + //fixed time refresh delay | |
| 6 | + var delay = 1000 * 7; | |
| 7 | + //deviceId ——> gps | |
| 8 | + var realData = {}; | |
| 9 | + //refresh after callback | |
| 10 | + var refreshEventCallbacks = []; | |
| 11 | + //register callback function | |
| 12 | + var registerCallback = function (cb) { | |
| 13 | + if (cb) | |
| 14 | + refreshEventCallbacks.push(cb); | |
| 15 | + }; | |
| 16 | + | |
| 17 | + var refresh = function (cb) { | |
| 18 | + $.ajax({ | |
| 19 | + url: '/gps/real/line', | |
| 20 | + data: {lineCodes: gb_data_basic.line_idx}, | |
| 21 | + dataType: 'json', | |
| 22 | + success: function (rs) { | |
| 23 | + //用定时的gps来检测session断开 | |
| 24 | + if(rs.status && rs.status==407){ | |
| 25 | + location.href = '/login.html'; | |
| 26 | + return; | |
| 27 | + } | |
| 28 | + refreshData(rs); | |
| 29 | + cb(); | |
| 30 | + }, | |
| 31 | + error: function (xr, t) { | |
| 32 | + notify_err('刷新GPS失败,稍后重试' + t); | |
| 33 | + cb(); | |
| 34 | + } | |
| 35 | + }); | |
| 36 | + }; | |
| 37 | + | |
| 38 | + var refreshData = function (rs) { | |
| 39 | + var old, addArr = [], | |
| 40 | + upArr = [], | |
| 41 | + upDownChange = []; | |
| 42 | + | |
| 43 | + var schArray; | |
| 44 | + $.each(rs, function () { | |
| 45 | + old = realData[this.deviceId]; | |
| 46 | + if (old) { | |
| 47 | + if (this.timestamp > old.timestamp) { | |
| 48 | + if (old.upDown != this.upDown) | |
| 49 | + upDownChange.push(this); | |
| 50 | + else | |
| 51 | + upArr.push(this); | |
| 52 | + } | |
| 53 | + | |
| 54 | + } else | |
| 55 | + addArr.push(this); | |
| 56 | + | |
| 57 | + //班次信息 | |
| 58 | + /*if (this.schId) { | |
| 59 | + schArray = gb_schedule_table.findScheduleByLine(this.lineId); | |
| 60 | + if (schArray) | |
| 61 | + this.sch = schArray[this.schId]; | |
| 62 | + }*/ | |
| 63 | + | |
| 64 | + //时间格式化 | |
| 65 | + this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | |
| 66 | + realData[this.deviceId] = this; | |
| 67 | + }); | |
| 68 | + | |
| 69 | + //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | |
| 70 | + //CCCallFuncN | |
| 71 | + $.each(refreshEventCallbacks, function (i, cb) { | |
| 72 | + cb(addArr, upArr, upDownChange); | |
| 73 | + }); | |
| 74 | + | |
| 75 | + }; | |
| 76 | + | |
| 77 | + var startFixedTime; | |
| 78 | + var fixedTimeRefresh = function () { | |
| 79 | + if (startFixedTime) | |
| 80 | + return; | |
| 81 | + startFixedTime = true; | |
| 82 | + | |
| 83 | + (function () { | |
| 84 | + var f = arguments.callee; | |
| 85 | + refresh(function () { | |
| 86 | + setTimeout(f, delay); | |
| 87 | + }); | |
| 88 | + })(); | |
| 89 | + }; | |
| 90 | + | |
| 91 | + var gpsByLineCode = function (lineCode) { | |
| 92 | + var rs = []; | |
| 93 | + for (var device in realData) { | |
| 94 | + if (realData[device].lineId == lineCode) | |
| 95 | + rs.push(realData[device]); | |
| 96 | + } | |
| 97 | + return rs; | |
| 98 | + }; | |
| 99 | + | |
| 100 | + var findOne = function (deviceId) { | |
| 101 | + return realData[deviceId]; | |
| 102 | + }; | |
| 103 | + | |
| 104 | + var findGpsByNbbm = function (nbbm) { | |
| 105 | + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 106 | + }; | |
| 107 | + | |
| 108 | + /** | |
| 109 | + * 设备掉线事件 | |
| 110 | + */ | |
| 111 | + var deviceOffline = function (gps) { | |
| 112 | + $.each(offlineCallbacks, function (i, cb) { | |
| 113 | + cb(gps); | |
| 114 | + }); | |
| 115 | + }; | |
| 116 | + | |
| 117 | + //注册掉线事件回调函数 | |
| 118 | + var offlineCallbacks = []; | |
| 119 | + var registerOfflineCb = function (cb) { | |
| 120 | + if (cb) | |
| 121 | + offlineCallbacks.push(cb); | |
| 122 | + }; | |
| 123 | + | |
| 124 | + return { | |
| 125 | + fixedTimeRefresh: fixedTimeRefresh, | |
| 126 | + registerCallback: registerCallback, | |
| 127 | + allGps: realData, | |
| 128 | + gpsByLineCode: gpsByLineCode, | |
| 129 | + findOne: findOne, | |
| 130 | + findGpsByNbbm: findGpsByNbbm, | |
| 131 | + deviceOffline: deviceOffline, | |
| 132 | + registerOfflineCb: registerOfflineCb | |
| 133 | + }; | |
| 134 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/alone_page/home/home_wrap.html
| 1 | -<!DOCTYPE html> | |
| 2 | -<html lang="zh-cn"> | |
| 3 | - | |
| 4 | -<head> | |
| 5 | - <meta charset="UTF-8"> | |
| 6 | - <title>主页模拟图</title> | |
| 7 | - <!-- uikit core style--> | |
| 8 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" /> | |
| 9 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" merge="plugins"/> | |
| 10 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" merge="plugins"/> | |
| 11 | - <link rel="stylesheet" | |
| 12 | - href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | |
| 13 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" merge="plugins"/> | |
| 14 | - | |
| 15 | - <!-- main style --> | |
| 16 | - <link rel="stylesheet" href="/real_control_v2/css/main.css" /> | |
| 17 | - <!-- home style --> | |
| 18 | - <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | |
| 19 | - | |
| 20 | - <!-- custom table --> | |
| 21 | - <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | |
| 22 | - <!-- jquery contextMenu style --> | |
| 23 | - <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" merge="plugins"/> | |
| 24 | - <!-- formvalidation style --> | |
| 25 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css" merge="plugins"/> | |
| 26 | - <!-- js tree --> | |
| 27 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/> | |
| 28 | - <!-- tooltip css--> | |
| 29 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css" merge="plugins"/> | |
| 30 | - <link rel="stylesheet" href="/real_control_v2/css/pace.css" merge="plugins"/> | |
| 31 | - | |
| 32 | - <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | |
| 33 | - <!-- perfect-scrollbar style --> | |
| 34 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | |
| 35 | - <!-- layer 3.0.3 --> | |
| 36 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | |
| 37 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | |
| 38 | - | |
| 39 | - | |
| 40 | - <style> | |
| 41 | - .main-container{ | |
| 42 | - height: 100% !important; | |
| 43 | - } | |
| 44 | - | |
| 45 | - #main-tab-content{ | |
| 46 | - padding: 0 !important; | |
| 47 | - } | |
| 48 | - | |
| 49 | - .home-panel{ | |
| 50 | - | |
| 51 | - } | |
| 52 | - | |
| 53 | - #home-main-content{ | |
| 54 | - padding: 0 !important; | |
| 55 | - } | |
| 56 | - | |
| 57 | - #main-tab-content>.home-panel>#home-main-content{ | |
| 58 | - overflow: inherit !important; | |
| 59 | - } | |
| 60 | - </style> | |
| 61 | -</head> | |
| 62 | - | |
| 63 | -<body> | |
| 64 | -<!--<div class="main-container" style="height: 100%;"> | |
| 65 | -</div>--> | |
| 66 | -<div class="main-container"> | |
| 67 | - <ul id="main-tab-content"> | |
| 68 | - <li class="home-panel"></li> | |
| 69 | - </ul> | |
| 70 | -</div> | |
| 71 | - | |
| 72 | - | |
| 73 | -<!-- 地图相关 --> | |
| 74 | -<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 75 | -<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 76 | -<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 77 | -<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 78 | -<!-- jquery --> | |
| 79 | -<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 80 | -<!-- jquery actual --> | |
| 81 | -<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | |
| 82 | -<!-- jquery.serializejson JSON序列化插件 --> | |
| 83 | -<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | |
| 84 | -<!-- moment.js 日期处理类库 --> | |
| 85 | -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 86 | -<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 87 | - | |
| 88 | -<!-- flatpickr --> | |
| 89 | -<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | |
| 90 | -<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | |
| 91 | - | |
| 92 | -<!-- perfect-scrollbar --> | |
| 93 | -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | |
| 94 | -<!-- common js --> | |
| 95 | -<script src="/real_control_v2/js/common.js"></script> | |
| 96 | -<!-- art-template 模版引擎 --> | |
| 97 | -<script src="/assets/plugins/template.js" merge="plugins"></script> | |
| 98 | -<!-- d3 --> | |
| 99 | -<script src="/assets/js/d3.min.js"></script> | |
| 100 | -<!-- EventProxy --> | |
| 101 | -<script src="/assets/js/eventproxy.js"></script> | |
| 102 | - | |
| 103 | -<script> | |
| 104 | - | |
| 105 | - | |
| 106 | - var res_load_ep = EventProxy.create('load_home_layout', 'load_home_line_panel', 'load_data_basic', 'data-basic', function () { | |
| 107 | - //加载主页 | |
| 108 | - gb_home_layout.layout(function () { | |
| 109 | - gb_home_line_panel.init(function () { | |
| 110 | - //gps自刷新 | |
| 111 | - gb_data_gps.fixedTimeRefresh(); | |
| 112 | - | |
| 113 | - $('.uk-icon-send-o.home_alone_page').remove(); | |
| 114 | - }); | |
| 115 | - }); | |
| 116 | - }); | |
| 117 | - | |
| 118 | - function connectArr(arr, separator, transFun) { | |
| 119 | - var rs = ''; | |
| 120 | - $.each(arr, function (i, item) { | |
| 121 | - if (transFun) | |
| 122 | - item = transFun(item); | |
| 123 | - rs += (separator + item); | |
| 124 | - }); | |
| 125 | - return rs.substr(separator.length); | |
| 126 | - } | |
| 127 | - | |
| 128 | - var isArray = function (obj) { | |
| 129 | - return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 130 | - }; | |
| 131 | - | |
| 132 | - var gb_form_validation_opts = { | |
| 133 | - framework: 'uikit', | |
| 134 | - locale: 'zh_CN', | |
| 135 | - icon: { | |
| 136 | - valid: 'uk-icon-check', | |
| 137 | - invalid: 'uk-icon-times', | |
| 138 | - validating: 'uk-icon-refresh' | |
| 139 | - } | |
| 140 | - }; | |
| 141 | - | |
| 142 | -</script> | |
| 143 | - | |
| 144 | -<!-- uikit core --> | |
| 145 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | |
| 146 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | |
| 147 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js" merge="uikit_js"></script> | |
| 148 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | |
| 149 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | |
| 150 | - | |
| 151 | - | |
| 152 | -<!-- jquery contextMenu --> | |
| 153 | -<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js" merge="plugins"></script> | |
| 154 | -<script src="/real_control_v2/assets/js/jquery.ui.position.min.js" merge="plugins"></script> | |
| 155 | -<!-- formvalidation- --> | |
| 156 | -<script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js" merge="plugins"></script> | |
| 157 | -<script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js" merge="plugins"></script> | |
| 158 | -<script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js" merge="plugins"></script> | |
| 159 | -<!-- js tree --> | |
| 160 | -<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | |
| 161 | -<!-- simple pinyin --> | |
| 162 | -<script src="/assets/plugins/pinyin.js" merge="plugins"></script> | |
| 163 | -<!-- qtip --> | |
| 164 | -<script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js" merge="plugins"></script> | |
| 165 | -<!-- layer 3.0.3 --> | |
| 166 | -<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | |
| 167 | - | |
| 168 | -<!-- 数据 --> | |
| 169 | -<script src="/real_control_v2/alone_page/home/alone_data_basic.js" merge="custom_js"></script> | |
| 170 | -<script src="/real_control_v2/alone_page/home/alone_data_gps.js" merge="custom_js"></script> | |
| 171 | -<script src="/real_control_v2/js/data/gps_abnormal.js" merge="custom_js"></script> | |
| 172 | -<!-- 线路模拟图 --> | |
| 173 | -<script src="/real_control_v2/js/utils/svg_chart.js" merge="custom_js"></script> | |
| 174 | -<script src="/real_control_v2/js/utils/svg_data_convert.js" merge="custom_js"></script> | |
| 175 | -<script src="/real_control_v2/js/utils/svg_chart_tooltip.js" merge="custom_js"></script> | |
| 176 | -<script src="/real_control_v2/js/utils/svg_chart_map.js" merge="custom_js"></script> | |
| 177 | - | |
| 178 | -<!-- custom table js --> | |
| 179 | -<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | |
| 180 | -<!-- home js --> | |
| 181 | -<script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script> | |
| 182 | -<script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script> | |
| 183 | -<script src="/real_control_v2/js/home/context_menu.js" merge="custom_js"></script> | |
| 184 | - | |
| 185 | - | |
| 186 | -<!-- 模态框扩展 --> | |
| 187 | -<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | |
| 188 | - | |
| 189 | -</body> | |
| 190 | - | |
| 191 | -</html> | |
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh-cn"> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="UTF-8"> | |
| 6 | + <title>主页模拟图</title> | |
| 7 | + <!-- uikit core style--> | |
| 8 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" /> | |
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" merge="plugins"/> | |
| 10 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" merge="plugins"/> | |
| 11 | + <link rel="stylesheet" | |
| 12 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | |
| 13 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" merge="plugins"/> | |
| 14 | + | |
| 15 | + <!-- main style --> | |
| 16 | + <link rel="stylesheet" href="/real_control_v2/css/main.css" /> | |
| 17 | + <!-- home style --> | |
| 18 | + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | |
| 19 | + | |
| 20 | + <!-- custom table --> | |
| 21 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | |
| 22 | + <!-- jquery contextMenu style --> | |
| 23 | + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" merge="plugins"/> | |
| 24 | + <!-- formvalidation style --> | |
| 25 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css" merge="plugins"/> | |
| 26 | + <!-- js tree --> | |
| 27 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/> | |
| 28 | + <!-- tooltip css--> | |
| 29 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css" merge="plugins"/> | |
| 30 | + <link rel="stylesheet" href="/real_control_v2/css/pace.css" merge="plugins"/> | |
| 31 | + | |
| 32 | + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | |
| 33 | + <!-- perfect-scrollbar style --> | |
| 34 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | |
| 35 | + <!-- layer 3.0.3 --> | |
| 36 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | |
| 37 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | |
| 38 | + | |
| 39 | + | |
| 40 | + <style> | |
| 41 | + .main-container{ | |
| 42 | + height: 100% !important; | |
| 43 | + } | |
| 44 | + | |
| 45 | + #main-tab-content{ | |
| 46 | + padding: 0 !important; | |
| 47 | + } | |
| 48 | + | |
| 49 | + .home-panel{ | |
| 50 | + | |
| 51 | + } | |
| 52 | + | |
| 53 | + #home-main-content{ | |
| 54 | + padding: 0 !important; | |
| 55 | + } | |
| 56 | + | |
| 57 | + #main-tab-content>.home-panel>#home-main-content{ | |
| 58 | + overflow: inherit !important; | |
| 59 | + } | |
| 60 | + </style> | |
| 61 | +</head> | |
| 62 | + | |
| 63 | +<body> | |
| 64 | +<!--<div class="main-container" style="height: 100%;"> | |
| 65 | +</div>--> | |
| 66 | +<div class="main-container"> | |
| 67 | + <ul id="main-tab-content"> | |
| 68 | + <li class="home-panel"></li> | |
| 69 | + </ul> | |
| 70 | +</div> | |
| 71 | + | |
| 72 | + | |
| 73 | +<!-- 地图相关 --> | |
| 74 | +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 75 | +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 76 | +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 77 | +<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 78 | +<!-- jquery --> | |
| 79 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 80 | +<!-- jquery actual --> | |
| 81 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | |
| 82 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 83 | +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | |
| 84 | +<!-- moment.js 日期处理类库 --> | |
| 85 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 86 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 87 | + | |
| 88 | +<!-- flatpickr --> | |
| 89 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | |
| 90 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | |
| 91 | + | |
| 92 | +<!-- perfect-scrollbar --> | |
| 93 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | |
| 94 | +<!-- common js --> | |
| 95 | +<script src="/real_control_v2/js/common.js"></script> | |
| 96 | +<!-- art-template 模版引擎 --> | |
| 97 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | |
| 98 | +<!-- d3 --> | |
| 99 | +<script src="/assets/js/d3.min.js"></script> | |
| 100 | +<!-- EventProxy --> | |
| 101 | +<script src="/assets/js/eventproxy.js"></script> | |
| 102 | + | |
| 103 | +<script> | |
| 104 | + | |
| 105 | + | |
| 106 | + var res_load_ep = EventProxy.create('load_home_layout', 'load_home_line_panel', 'load_data_basic', 'data-basic', function () { | |
| 107 | + //加载主页 | |
| 108 | + gb_home_layout.layout(function () { | |
| 109 | + gb_home_line_panel.init(function () { | |
| 110 | + //gps自刷新 | |
| 111 | + gb_data_gps.fixedTimeRefresh(); | |
| 112 | + | |
| 113 | + $('.uk-icon-send-o.home_alone_page').remove(); | |
| 114 | + }); | |
| 115 | + }); | |
| 116 | + }); | |
| 117 | + | |
| 118 | + function connectArr(arr, separator, transFun) { | |
| 119 | + var rs = ''; | |
| 120 | + $.each(arr, function (i, item) { | |
| 121 | + if (transFun) | |
| 122 | + item = transFun(item); | |
| 123 | + rs += (separator + item); | |
| 124 | + }); | |
| 125 | + return rs.substr(separator.length); | |
| 126 | + } | |
| 127 | + | |
| 128 | + var isArray = function (obj) { | |
| 129 | + return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 130 | + }; | |
| 131 | + | |
| 132 | + var gb_form_validation_opts = { | |
| 133 | + framework: 'uikit', | |
| 134 | + locale: 'zh_CN', | |
| 135 | + icon: { | |
| 136 | + valid: 'uk-icon-check', | |
| 137 | + invalid: 'uk-icon-times', | |
| 138 | + validating: 'uk-icon-refresh' | |
| 139 | + } | |
| 140 | + }; | |
| 141 | + | |
| 142 | +</script> | |
| 143 | + | |
| 144 | +<!-- uikit core --> | |
| 145 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | |
| 146 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | |
| 147 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js" merge="uikit_js"></script> | |
| 148 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | |
| 149 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | |
| 150 | + | |
| 151 | + | |
| 152 | +<!-- jquery contextMenu --> | |
| 153 | +<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js" merge="plugins"></script> | |
| 154 | +<script src="/real_control_v2/assets/js/jquery.ui.position.min.js" merge="plugins"></script> | |
| 155 | +<!-- formvalidation- --> | |
| 156 | +<script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js" merge="plugins"></script> | |
| 157 | +<script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js" merge="plugins"></script> | |
| 158 | +<script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js" merge="plugins"></script> | |
| 159 | +<!-- js tree --> | |
| 160 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | |
| 161 | +<!-- simple pinyin --> | |
| 162 | +<script src="/assets/plugins/pinyin.js" merge="plugins"></script> | |
| 163 | +<!-- qtip --> | |
| 164 | +<script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js" merge="plugins"></script> | |
| 165 | +<!-- layer 3.0.3 --> | |
| 166 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | |
| 167 | + | |
| 168 | +<!-- 数据 --> | |
| 169 | +<script src="/real_control_v2/alone_page/home/alone_data_basic.js" merge="custom_js"></script> | |
| 170 | +<script src="/real_control_v2/alone_page/home/alone_data_gps.js" merge="custom_js"></script> | |
| 171 | +<script src="/real_control_v2/js/data/gps_abnormal.js" merge="custom_js"></script> | |
| 172 | +<!-- 线路模拟图 --> | |
| 173 | +<script src="/real_control_v2/js/utils/svg_chart.js" merge="custom_js"></script> | |
| 174 | +<script src="/real_control_v2/js/utils/svg_data_convert.js" merge="custom_js"></script> | |
| 175 | +<script src="/real_control_v2/js/utils/svg_chart_tooltip.js" merge="custom_js"></script> | |
| 176 | +<script src="/real_control_v2/js/utils/svg_chart_map.js" merge="custom_js"></script> | |
| 177 | + | |
| 178 | +<!-- custom table js --> | |
| 179 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | |
| 180 | +<!-- home js --> | |
| 181 | +<script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script> | |
| 182 | +<script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script> | |
| 183 | +<script src="/real_control_v2/js/home/context_menu.js" merge="custom_js"></script> | |
| 184 | + | |
| 185 | + | |
| 186 | +<!-- 模态框扩展 --> | |
| 187 | +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | |
| 188 | + | |
| 189 | +</body> | |
| 190 | + | |
| 191 | +</html> | ... | ... |
src/main/resources/static/real_control_v2/alone_page/map/alone_data_basic.js
| 1 | -/* 基础数据管理模块 */ | |
| 2 | - | |
| 3 | -var gb_data_basic = (function () { | |
| 4 | - | |
| 5 | - var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | |
| 6 | - var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | |
| 7 | - , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | |
| 8 | - stationRoutes = routes; | |
| 9 | - lineCode2NameAll = code2Name; | |
| 10 | - lineInformations = informations; | |
| 11 | - nbbm2deviceMap = nbbm2device; | |
| 12 | - device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | |
| 13 | - allPersonnel = all_personnel; | |
| 14 | - svgAttrs = svgAttrMap; | |
| 15 | - | |
| 16 | - res_load_ep.emitLater('data-basic'); | |
| 17 | - }); | |
| 18 | - | |
| 19 | - var storage = window.localStorage; | |
| 20 | - //激活的线路 | |
| 21 | - var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 22 | - //lineCode to line object | |
| 23 | - var codeToLine = {}; | |
| 24 | - //lineCode idx string | |
| 25 | - var line_idx = (function () { | |
| 26 | - var str = ''; | |
| 27 | - for (var i = 0, item; item = activeLines[i++];) { | |
| 28 | - str += (',' + item.lineCode); | |
| 29 | - codeToLine[item.lineCode] = item; | |
| 30 | - } | |
| 31 | - return str.substr(1); | |
| 32 | - })(); | |
| 33 | - | |
| 34 | - //站点路由 | |
| 35 | - gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 36 | - var list = rs.list;//JSON.parse(rs.list); | |
| 37 | - var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 38 | - //排序 | |
| 39 | - for (var lineCode in routeData) { | |
| 40 | - routeData[lineCode].sort(stationRouteSort); | |
| 41 | - } | |
| 42 | - ep.emit('stationRoutes', routeData); | |
| 43 | - }); | |
| 44 | - | |
| 45 | - //线路标准信息 | |
| 46 | - gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 47 | - var informations = {}; | |
| 48 | - $.each(rs, function () { | |
| 49 | - informations[this.line.lineCode] = this; | |
| 50 | - delete this['line']; | |
| 51 | - }); | |
| 52 | - ep.emit('lineInformations', informations); | |
| 53 | - }); | |
| 54 | - | |
| 55 | - //人员信息 | |
| 56 | - loadAllPersonnel(function (data) { | |
| 57 | - ep.emit('all_personnel', data); | |
| 58 | - }); | |
| 59 | - function loadAllPersonnel(cb) { | |
| 60 | - $.get('/personnel/all_py', function (rs) { | |
| 61 | - //转换成自动补全组件需要的数据 | |
| 62 | - var data = [], code; | |
| 63 | - for(var i =0, p; p = rs[i++];){ | |
| 64 | - code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 65 | - data.push({ | |
| 66 | - value: code + '/' + p.name, | |
| 67 | - fullChars: p.fullChars.toUpperCase(), | |
| 68 | - camelChars: p.camelChars.toUpperCase() | |
| 69 | - }); | |
| 70 | - } | |
| 71 | - cb && cb(data); | |
| 72 | - }); | |
| 73 | - } | |
| 74 | - | |
| 75 | - var carparks = {}; | |
| 76 | - //停车场数据 | |
| 77 | - gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | |
| 78 | - rs.list.sort(function (a, b) { | |
| 79 | - return a.parkName.localeCompare(b.parkName); | |
| 80 | - }); | |
| 81 | - $.each(rs.list, function () { | |
| 82 | - carparks[this.parkCode] = this; | |
| 83 | - }); | |
| 84 | - }); | |
| 85 | - | |
| 86 | - //车辆数据 | |
| 87 | - var carsArray; | |
| 88 | - $.get('/basic/cars?t=' + Math.random(), function (rs) { | |
| 89 | - carsArray = rs; | |
| 90 | - }); | |
| 91 | - | |
| 92 | - var getCarparkByCode = function (code) { | |
| 93 | - return carparks[code]; | |
| 94 | - }; | |
| 95 | - | |
| 96 | - //line code to name | |
| 97 | - $.get('/basic/lineCode2Name', function (rs) { | |
| 98 | - ep.emit('lineCode2Name', rs); | |
| 99 | - }); | |
| 100 | - | |
| 101 | - //nbbm to device id | |
| 102 | - $.get('/basic/nbbm2deviceId', function (rs) { | |
| 103 | - ep.emit('nbbm2deviceId', rs); | |
| 104 | - }); | |
| 105 | - //nbbm to 车牌号 | |
| 106 | - var nbbm2PlateMap; | |
| 107 | - $.get('/basic/nbbm2PlateNo', function (rs) { | |
| 108 | - nbbm2PlateMap = rs; | |
| 109 | - }); | |
| 110 | - | |
| 111 | - //模拟图属性数据 | |
| 112 | - gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 113 | - var data = {}; | |
| 114 | - $.each(rs.list, function () { | |
| 115 | - this.hideStations = JSON.parse(this.hideStations); | |
| 116 | - this.nicknames = JSON.parse(this.nicknames); | |
| 117 | - data[this.lineCode] = this; | |
| 118 | - }); | |
| 119 | - ep.emit('svg_attrs', data); | |
| 120 | - }); | |
| 121 | - | |
| 122 | - //站点和停车场历时、公里对照数据 | |
| 123 | - var stat_park_data; | |
| 124 | - var load_stat_park_data = function () { | |
| 125 | - $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 126 | - stat_park_data = rs; | |
| 127 | - }); | |
| 128 | - } | |
| 129 | - load_stat_park_data(); | |
| 130 | - | |
| 131 | - function findLineByCodes(codeArr) { | |
| 132 | - var rs = []; | |
| 133 | - $.each(codeArr, function () { | |
| 134 | - rs.push(codeToLine[this]); | |
| 135 | - }); | |
| 136 | - return rs; | |
| 137 | - } | |
| 138 | - | |
| 139 | - var findCodeByLinename = function (name) { | |
| 140 | - for (var code in lineCode2NameAll) { | |
| 141 | - if (name == lineCode2NameAll[code]) | |
| 142 | - return code; | |
| 143 | - } | |
| 144 | - | |
| 145 | - return null; | |
| 146 | - }; | |
| 147 | - | |
| 148 | - var getLineInformation = function (lineCode) { | |
| 149 | - return lineInformations[lineCode]; | |
| 150 | - }; | |
| 151 | - | |
| 152 | - var stationRouteSort = function (a, b) { | |
| 153 | - return a.stationRouteCode - b.stationRouteCode; | |
| 154 | - }; | |
| 155 | - | |
| 156 | - return { | |
| 157 | - activeLines: activeLines, | |
| 158 | - line_idx: line_idx, | |
| 159 | - codeToLine: codeToLine, | |
| 160 | - nbbm2deviceMap: function () { | |
| 161 | - return nbbm2deviceMap; | |
| 162 | - }, | |
| 163 | - device2nbbmMap: function () { | |
| 164 | - return device2nbbmMap; | |
| 165 | - }, | |
| 166 | - getLineInformation: getLineInformation, | |
| 167 | - allInformations: function () { | |
| 168 | - return lineInformations; | |
| 169 | - }, | |
| 170 | - stationRoutes: function (lineCode) { | |
| 171 | - return stationRoutes[lineCode] | |
| 172 | - }, | |
| 173 | - findLineByCodes: findLineByCodes, | |
| 174 | - lineCode2NameAll: function () { | |
| 175 | - return lineCode2NameAll | |
| 176 | - }, | |
| 177 | - allPersonnel: function () { | |
| 178 | - return allPersonnel; | |
| 179 | - }, | |
| 180 | - findCodeByLinename: findCodeByLinename, | |
| 181 | - getCarparkByCode: getCarparkByCode, | |
| 182 | - getSvgAttr: function (lineCode) { | |
| 183 | - return svgAttrs[lineCode]; | |
| 184 | - }, | |
| 185 | - setSvgAttr: function (attr) { | |
| 186 | - attr.hideStations = JSON.parse(attr.hideStations); | |
| 187 | - attr.nicknames = JSON.parse(attr.nicknames); | |
| 188 | - svgAttrs[attr.lineCode] = attr; | |
| 189 | - }, | |
| 190 | - //是否是环线 | |
| 191 | - isLoopLine: function (lineCode) { | |
| 192 | - var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 193 | - //下行只有2个站点 | |
| 194 | - var len = data[0].length; | |
| 195 | - if (len > 0 && data[1].length == 2) { | |
| 196 | - var first = data[0][0], | |
| 197 | - end = data[0][len - 1]; | |
| 198 | - | |
| 199 | - /*if(first.stationName != end.stationName) | |
| 200 | - return false;*/ | |
| 201 | - | |
| 202 | - var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 203 | - , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 204 | - | |
| 205 | - //并且上行起终点距离200米内 | |
| 206 | - if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 207 | - return true; | |
| 208 | - } | |
| 209 | - } | |
| 210 | - | |
| 211 | - return false; | |
| 212 | - }, | |
| 213 | - //刷新员工信息 | |
| 214 | - refreshAllPersonnel: function (cb) { | |
| 215 | - loadAllPersonnel(function (data) { | |
| 216 | - allPersonnel = data; | |
| 217 | - cb && cb(); | |
| 218 | - }); | |
| 219 | - }, | |
| 220 | - nbbm2PlateMap: function () { | |
| 221 | - return nbbm2PlateMap; | |
| 222 | - }, | |
| 223 | - carsArray: function () { | |
| 224 | - return carsArray; | |
| 225 | - }, | |
| 226 | - simpleParksArray: function () { | |
| 227 | - var map = {}; | |
| 228 | - for(var code in carparks) | |
| 229 | - map[code] = carparks[code].parkName; | |
| 230 | - return map; | |
| 231 | - }, | |
| 232 | - remarksMapps: function () { | |
| 233 | - return remarksMapps; | |
| 234 | - }, | |
| 235 | - get_stat_park_data: function () { | |
| 236 | - return stat_park_data; | |
| 237 | - }, | |
| 238 | - reload_stat_park_data: function () { | |
| 239 | - load_stat_park_data(); | |
| 240 | - } | |
| 241 | - }; | |
| 242 | -})(); | |
| 1 | +/* 基础数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_basic = (function () { | |
| 4 | + | |
| 5 | + var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | |
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | |
| 7 | + , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | |
| 8 | + stationRoutes = routes; | |
| 9 | + lineCode2NameAll = code2Name; | |
| 10 | + lineInformations = informations; | |
| 11 | + nbbm2deviceMap = nbbm2device; | |
| 12 | + device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | |
| 13 | + allPersonnel = all_personnel; | |
| 14 | + svgAttrs = svgAttrMap; | |
| 15 | + | |
| 16 | + res_load_ep.emitLater('data-basic'); | |
| 17 | + }); | |
| 18 | + | |
| 19 | + var storage = window.localStorage; | |
| 20 | + //激活的线路 | |
| 21 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 22 | + //lineCode to line object | |
| 23 | + var codeToLine = {}; | |
| 24 | + //lineCode idx string | |
| 25 | + var line_idx = (function () { | |
| 26 | + var str = ''; | |
| 27 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 28 | + str += (',' + item.lineCode); | |
| 29 | + codeToLine[item.lineCode] = item; | |
| 30 | + } | |
| 31 | + return str.substr(1); | |
| 32 | + })(); | |
| 33 | + | |
| 34 | + //站点路由 | |
| 35 | + gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 36 | + var list = rs.list;//JSON.parse(rs.list); | |
| 37 | + var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 38 | + //排序 | |
| 39 | + for (var lineCode in routeData) { | |
| 40 | + routeData[lineCode].sort(stationRouteSort); | |
| 41 | + } | |
| 42 | + ep.emit('stationRoutes', routeData); | |
| 43 | + }); | |
| 44 | + | |
| 45 | + //线路标准信息 | |
| 46 | + gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 47 | + var informations = {}; | |
| 48 | + $.each(rs, function () { | |
| 49 | + informations[this.line.lineCode] = this; | |
| 50 | + delete this['line']; | |
| 51 | + }); | |
| 52 | + ep.emit('lineInformations', informations); | |
| 53 | + }); | |
| 54 | + | |
| 55 | + //人员信息 | |
| 56 | + loadAllPersonnel(function (data) { | |
| 57 | + ep.emit('all_personnel', data); | |
| 58 | + }); | |
| 59 | + function loadAllPersonnel(cb) { | |
| 60 | + $.get('/personnel/all_py', function (rs) { | |
| 61 | + //转换成自动补全组件需要的数据 | |
| 62 | + var data = [], code; | |
| 63 | + for(var i =0, p; p = rs[i++];){ | |
| 64 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 65 | + data.push({ | |
| 66 | + value: code + '/' + p.name, | |
| 67 | + fullChars: p.fullChars.toUpperCase(), | |
| 68 | + camelChars: p.camelChars.toUpperCase() | |
| 69 | + }); | |
| 70 | + } | |
| 71 | + cb && cb(data); | |
| 72 | + }); | |
| 73 | + } | |
| 74 | + | |
| 75 | + var carparks = {}; | |
| 76 | + //停车场数据 | |
| 77 | + gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | |
| 78 | + rs.list.sort(function (a, b) { | |
| 79 | + return a.parkName.localeCompare(b.parkName); | |
| 80 | + }); | |
| 81 | + $.each(rs.list, function () { | |
| 82 | + carparks[this.parkCode] = this; | |
| 83 | + }); | |
| 84 | + }); | |
| 85 | + | |
| 86 | + //车辆数据 | |
| 87 | + var carsArray; | |
| 88 | + $.get('/basic/cars?t=' + Math.random(), function (rs) { | |
| 89 | + carsArray = rs; | |
| 90 | + }); | |
| 91 | + | |
| 92 | + var getCarparkByCode = function (code) { | |
| 93 | + return carparks[code]; | |
| 94 | + }; | |
| 95 | + | |
| 96 | + //line code to name | |
| 97 | + $.get('/basic/lineCode2Name', function (rs) { | |
| 98 | + ep.emit('lineCode2Name', rs); | |
| 99 | + }); | |
| 100 | + | |
| 101 | + //nbbm to device id | |
| 102 | + $.get('/basic/nbbm2deviceId', function (rs) { | |
| 103 | + ep.emit('nbbm2deviceId', rs); | |
| 104 | + }); | |
| 105 | + //nbbm to 车牌号 | |
| 106 | + var nbbm2PlateMap; | |
| 107 | + $.get('/basic/nbbm2PlateNo', function (rs) { | |
| 108 | + nbbm2PlateMap = rs; | |
| 109 | + }); | |
| 110 | + | |
| 111 | + //模拟图属性数据 | |
| 112 | + gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 113 | + var data = {}; | |
| 114 | + $.each(rs.list, function () { | |
| 115 | + this.hideStations = JSON.parse(this.hideStations); | |
| 116 | + this.nicknames = JSON.parse(this.nicknames); | |
| 117 | + data[this.lineCode] = this; | |
| 118 | + }); | |
| 119 | + ep.emit('svg_attrs', data); | |
| 120 | + }); | |
| 121 | + | |
| 122 | + //站点和停车场历时、公里对照数据 | |
| 123 | + var stat_park_data; | |
| 124 | + var load_stat_park_data = function () { | |
| 125 | + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 126 | + stat_park_data = rs; | |
| 127 | + }); | |
| 128 | + } | |
| 129 | + load_stat_park_data(); | |
| 130 | + | |
| 131 | + function findLineByCodes(codeArr) { | |
| 132 | + var rs = []; | |
| 133 | + $.each(codeArr, function () { | |
| 134 | + rs.push(codeToLine[this]); | |
| 135 | + }); | |
| 136 | + return rs; | |
| 137 | + } | |
| 138 | + | |
| 139 | + var findCodeByLinename = function (name) { | |
| 140 | + for (var code in lineCode2NameAll) { | |
| 141 | + if (name == lineCode2NameAll[code]) | |
| 142 | + return code; | |
| 143 | + } | |
| 144 | + | |
| 145 | + return null; | |
| 146 | + }; | |
| 147 | + | |
| 148 | + var getLineInformation = function (lineCode) { | |
| 149 | + return lineInformations[lineCode]; | |
| 150 | + }; | |
| 151 | + | |
| 152 | + var stationRouteSort = function (a, b) { | |
| 153 | + return a.stationRouteCode - b.stationRouteCode; | |
| 154 | + }; | |
| 155 | + | |
| 156 | + return { | |
| 157 | + activeLines: activeLines, | |
| 158 | + line_idx: line_idx, | |
| 159 | + codeToLine: codeToLine, | |
| 160 | + nbbm2deviceMap: function () { | |
| 161 | + return nbbm2deviceMap; | |
| 162 | + }, | |
| 163 | + device2nbbmMap: function () { | |
| 164 | + return device2nbbmMap; | |
| 165 | + }, | |
| 166 | + getLineInformation: getLineInformation, | |
| 167 | + allInformations: function () { | |
| 168 | + return lineInformations; | |
| 169 | + }, | |
| 170 | + stationRoutes: function (lineCode) { | |
| 171 | + return stationRoutes[lineCode] | |
| 172 | + }, | |
| 173 | + findLineByCodes: findLineByCodes, | |
| 174 | + lineCode2NameAll: function () { | |
| 175 | + return lineCode2NameAll | |
| 176 | + }, | |
| 177 | + allPersonnel: function () { | |
| 178 | + return allPersonnel; | |
| 179 | + }, | |
| 180 | + findCodeByLinename: findCodeByLinename, | |
| 181 | + getCarparkByCode: getCarparkByCode, | |
| 182 | + getSvgAttr: function (lineCode) { | |
| 183 | + return svgAttrs[lineCode]; | |
| 184 | + }, | |
| 185 | + setSvgAttr: function (attr) { | |
| 186 | + attr.hideStations = JSON.parse(attr.hideStations); | |
| 187 | + attr.nicknames = JSON.parse(attr.nicknames); | |
| 188 | + svgAttrs[attr.lineCode] = attr; | |
| 189 | + }, | |
| 190 | + //是否是环线 | |
| 191 | + isLoopLine: function (lineCode) { | |
| 192 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 193 | + //下行只有2个站点 | |
| 194 | + var len = data[0].length; | |
| 195 | + if (len > 0 && data[1].length == 2) { | |
| 196 | + var first = data[0][0], | |
| 197 | + end = data[0][len - 1]; | |
| 198 | + | |
| 199 | + /*if(first.stationName != end.stationName) | |
| 200 | + return false;*/ | |
| 201 | + | |
| 202 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 203 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 204 | + | |
| 205 | + //并且上行起终点距离200米内 | |
| 206 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 207 | + return true; | |
| 208 | + } | |
| 209 | + } | |
| 210 | + | |
| 211 | + return false; | |
| 212 | + }, | |
| 213 | + //刷新员工信息 | |
| 214 | + refreshAllPersonnel: function (cb) { | |
| 215 | + loadAllPersonnel(function (data) { | |
| 216 | + allPersonnel = data; | |
| 217 | + cb && cb(); | |
| 218 | + }); | |
| 219 | + }, | |
| 220 | + nbbm2PlateMap: function () { | |
| 221 | + return nbbm2PlateMap; | |
| 222 | + }, | |
| 223 | + carsArray: function () { | |
| 224 | + return carsArray; | |
| 225 | + }, | |
| 226 | + simpleParksArray: function () { | |
| 227 | + var map = {}; | |
| 228 | + for(var code in carparks) | |
| 229 | + map[code] = carparks[code].parkName; | |
| 230 | + return map; | |
| 231 | + }, | |
| 232 | + remarksMapps: function () { | |
| 233 | + return remarksMapps; | |
| 234 | + }, | |
| 235 | + get_stat_park_data: function () { | |
| 236 | + return stat_park_data; | |
| 237 | + }, | |
| 238 | + reload_stat_park_data: function () { | |
| 239 | + load_stat_park_data(); | |
| 240 | + } | |
| 241 | + }; | |
| 242 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/alone_page/map/alone_data_gps.js
| 1 | -/* gps 数据管理模块 */ | |
| 2 | - | |
| 3 | -var gb_data_gps = (function () { | |
| 4 | - | |
| 5 | - //fixed time refresh delay | |
| 6 | - var delay = 1000 * 7; | |
| 7 | - //deviceId ——> gps | |
| 8 | - var realData = {}; | |
| 9 | - //refresh after callback | |
| 10 | - var refreshEventCallbacks = []; | |
| 11 | - //register callback function | |
| 12 | - var registerCallback = function (cb) { | |
| 13 | - if (cb) | |
| 14 | - refreshEventCallbacks.push(cb); | |
| 15 | - }; | |
| 16 | - | |
| 17 | - var refresh = function (cb) { | |
| 18 | - $.ajax({ | |
| 19 | - url: '/gps/real/line', | |
| 20 | - data: {lineCodes: gb_data_basic.line_idx}, | |
| 21 | - dataType: 'json', | |
| 22 | - success: function (rs) { | |
| 23 | - //用定时的gps来检测session断开 | |
| 24 | - if(rs.status && rs.status==407){ | |
| 25 | - location.href = '/login.html'; | |
| 26 | - return; | |
| 27 | - } | |
| 28 | - refreshData(rs); | |
| 29 | - cb(); | |
| 30 | - }, | |
| 31 | - error: function (xr, t) { | |
| 32 | - notify_err('刷新GPS失败,稍后重试' + t); | |
| 33 | - cb(); | |
| 34 | - } | |
| 35 | - }); | |
| 36 | - }; | |
| 37 | - | |
| 38 | - var refreshData = function (rs) { | |
| 39 | - var old, addArr = [], | |
| 40 | - upArr = [], | |
| 41 | - upDownChange = []; | |
| 42 | - | |
| 43 | - var schArray; | |
| 44 | - $.each(rs, function () { | |
| 45 | - old = realData[this.deviceId]; | |
| 46 | - if (old) { | |
| 47 | - if (this.timestamp > old.timestamp) { | |
| 48 | - if (old.upDown != this.upDown) | |
| 49 | - upDownChange.push(this); | |
| 50 | - else | |
| 51 | - upArr.push(this); | |
| 52 | - } | |
| 53 | - | |
| 54 | - } else | |
| 55 | - addArr.push(this); | |
| 56 | - | |
| 57 | - /* //班次信息 | |
| 58 | - if (this.schId) { | |
| 59 | - schArray = gb_schedule_table.findScheduleByLine(this.lineId); | |
| 60 | - if (schArray) | |
| 61 | - this.sch = schArray[this.schId]; | |
| 62 | - }*/ | |
| 63 | - | |
| 64 | - //时间格式化 | |
| 65 | - this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | |
| 66 | - realData[this.deviceId] = this; | |
| 67 | - }); | |
| 68 | - | |
| 69 | - //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | |
| 70 | - //CCCallFuncN | |
| 71 | - $.each(refreshEventCallbacks, function (i, cb) { | |
| 72 | - cb(addArr, upArr, upDownChange); | |
| 73 | - }); | |
| 74 | - | |
| 75 | - }; | |
| 76 | - | |
| 77 | - var startFixedTime; | |
| 78 | - var fixedTimeRefresh = function () { | |
| 79 | - if (startFixedTime) | |
| 80 | - return; | |
| 81 | - startFixedTime = true; | |
| 82 | - | |
| 83 | - (function () { | |
| 84 | - var f = arguments.callee; | |
| 85 | - refresh(function () { | |
| 86 | - setTimeout(f, delay); | |
| 87 | - }); | |
| 88 | - })(); | |
| 89 | - }; | |
| 90 | - | |
| 91 | - var gpsByLineCode = function (lineCode) { | |
| 92 | - var rs = []; | |
| 93 | - for (var device in realData) { | |
| 94 | - if (realData[device].lineId == lineCode) | |
| 95 | - rs.push(realData[device]); | |
| 96 | - } | |
| 97 | - return rs; | |
| 98 | - }; | |
| 99 | - | |
| 100 | - var findOne = function (deviceId) { | |
| 101 | - return realData[deviceId]; | |
| 102 | - }; | |
| 103 | - | |
| 104 | - var findGpsByNbbm = function (nbbm) { | |
| 105 | - return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 106 | - }; | |
| 107 | - | |
| 108 | - /** | |
| 109 | - * 设备掉线事件 | |
| 110 | - */ | |
| 111 | - var deviceOffline = function (gps) { | |
| 112 | - $.each(offlineCallbacks, function (i, cb) { | |
| 113 | - cb(gps); | |
| 114 | - }); | |
| 115 | - }; | |
| 116 | - | |
| 117 | - //注册掉线事件回调函数 | |
| 118 | - var offlineCallbacks = []; | |
| 119 | - var registerOfflineCb = function (cb) { | |
| 120 | - if (cb) | |
| 121 | - offlineCallbacks.push(cb); | |
| 122 | - }; | |
| 123 | - | |
| 124 | - return { | |
| 125 | - fixedTimeRefresh: fixedTimeRefresh, | |
| 126 | - registerCallback: registerCallback, | |
| 127 | - allGps: realData, | |
| 128 | - gpsByLineCode: gpsByLineCode, | |
| 129 | - findOne: findOne, | |
| 130 | - findGpsByNbbm: findGpsByNbbm, | |
| 131 | - deviceOffline: deviceOffline, | |
| 132 | - registerOfflineCb: registerOfflineCb | |
| 133 | - }; | |
| 134 | -})(); | |
| 1 | +/* gps 数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_gps = (function () { | |
| 4 | + | |
| 5 | + //fixed time refresh delay | |
| 6 | + var delay = 1000 * 7; | |
| 7 | + //deviceId ——> gps | |
| 8 | + var realData = {}; | |
| 9 | + //refresh after callback | |
| 10 | + var refreshEventCallbacks = []; | |
| 11 | + //register callback function | |
| 12 | + var registerCallback = function (cb) { | |
| 13 | + if (cb) | |
| 14 | + refreshEventCallbacks.push(cb); | |
| 15 | + }; | |
| 16 | + | |
| 17 | + var refresh = function (cb) { | |
| 18 | + $.ajax({ | |
| 19 | + url: '/gps/real/line', | |
| 20 | + data: {lineCodes: gb_data_basic.line_idx}, | |
| 21 | + dataType: 'json', | |
| 22 | + success: function (rs) { | |
| 23 | + //用定时的gps来检测session断开 | |
| 24 | + if(rs.status && rs.status==407){ | |
| 25 | + location.href = '/login.html'; | |
| 26 | + return; | |
| 27 | + } | |
| 28 | + refreshData(rs); | |
| 29 | + cb(); | |
| 30 | + }, | |
| 31 | + error: function (xr, t) { | |
| 32 | + notify_err('刷新GPS失败,稍后重试' + t); | |
| 33 | + cb(); | |
| 34 | + } | |
| 35 | + }); | |
| 36 | + }; | |
| 37 | + | |
| 38 | + var refreshData = function (rs) { | |
| 39 | + var old, addArr = [], | |
| 40 | + upArr = [], | |
| 41 | + upDownChange = []; | |
| 42 | + | |
| 43 | + var schArray; | |
| 44 | + $.each(rs, function () { | |
| 45 | + old = realData[this.deviceId]; | |
| 46 | + if (old) { | |
| 47 | + if (this.timestamp > old.timestamp) { | |
| 48 | + if (old.upDown != this.upDown) | |
| 49 | + upDownChange.push(this); | |
| 50 | + else | |
| 51 | + upArr.push(this); | |
| 52 | + } | |
| 53 | + | |
| 54 | + } else | |
| 55 | + addArr.push(this); | |
| 56 | + | |
| 57 | + /* //班次信息 | |
| 58 | + if (this.schId) { | |
| 59 | + schArray = gb_schedule_table.findScheduleByLine(this.lineId); | |
| 60 | + if (schArray) | |
| 61 | + this.sch = schArray[this.schId]; | |
| 62 | + }*/ | |
| 63 | + | |
| 64 | + //时间格式化 | |
| 65 | + this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | |
| 66 | + realData[this.deviceId] = this; | |
| 67 | + }); | |
| 68 | + | |
| 69 | + //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | |
| 70 | + //CCCallFuncN | |
| 71 | + $.each(refreshEventCallbacks, function (i, cb) { | |
| 72 | + cb(addArr, upArr, upDownChange); | |
| 73 | + }); | |
| 74 | + | |
| 75 | + }; | |
| 76 | + | |
| 77 | + var startFixedTime; | |
| 78 | + var fixedTimeRefresh = function () { | |
| 79 | + if (startFixedTime) | |
| 80 | + return; | |
| 81 | + startFixedTime = true; | |
| 82 | + | |
| 83 | + (function () { | |
| 84 | + var f = arguments.callee; | |
| 85 | + refresh(function () { | |
| 86 | + setTimeout(f, delay); | |
| 87 | + }); | |
| 88 | + })(); | |
| 89 | + }; | |
| 90 | + | |
| 91 | + var gpsByLineCode = function (lineCode) { | |
| 92 | + var rs = []; | |
| 93 | + for (var device in realData) { | |
| 94 | + if (realData[device].lineId == lineCode) | |
| 95 | + rs.push(realData[device]); | |
| 96 | + } | |
| 97 | + return rs; | |
| 98 | + }; | |
| 99 | + | |
| 100 | + var findOne = function (deviceId) { | |
| 101 | + return realData[deviceId]; | |
| 102 | + }; | |
| 103 | + | |
| 104 | + var findGpsByNbbm = function (nbbm) { | |
| 105 | + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 106 | + }; | |
| 107 | + | |
| 108 | + /** | |
| 109 | + * 设备掉线事件 | |
| 110 | + */ | |
| 111 | + var deviceOffline = function (gps) { | |
| 112 | + $.each(offlineCallbacks, function (i, cb) { | |
| 113 | + cb(gps); | |
| 114 | + }); | |
| 115 | + }; | |
| 116 | + | |
| 117 | + //注册掉线事件回调函数 | |
| 118 | + var offlineCallbacks = []; | |
| 119 | + var registerOfflineCb = function (cb) { | |
| 120 | + if (cb) | |
| 121 | + offlineCallbacks.push(cb); | |
| 122 | + }; | |
| 123 | + | |
| 124 | + return { | |
| 125 | + fixedTimeRefresh: fixedTimeRefresh, | |
| 126 | + registerCallback: registerCallback, | |
| 127 | + allGps: realData, | |
| 128 | + gpsByLineCode: gpsByLineCode, | |
| 129 | + findOne: findOne, | |
| 130 | + findGpsByNbbm: findGpsByNbbm, | |
| 131 | + deviceOffline: deviceOffline, | |
| 132 | + registerOfflineCb: registerOfflineCb | |
| 133 | + }; | |
| 134 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/alone_page/map/alone_wrap.html
| 1 | -<!DOCTYPE html> | |
| 2 | -<html lang="zh-cn"> | |
| 3 | - | |
| 4 | -<head> | |
| 5 | - <meta charset="UTF-8"> | |
| 6 | - <title>地图监控 v2.0</title> | |
| 7 | - <!-- uikit core style--> | |
| 8 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css"/> | |
| 9 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" | |
| 10 | - merge="plugins"/> | |
| 11 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" | |
| 12 | - merge="plugins"/> | |
| 13 | - <link rel="stylesheet" | |
| 14 | - href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | |
| 15 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" | |
| 16 | - merge="plugins"/> | |
| 17 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" | |
| 18 | - merge="plugins"/> | |
| 19 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" | |
| 20 | - merge="plugins"/> | |
| 21 | - | |
| 22 | - <!-- main style --> | |
| 23 | - <link rel="stylesheet" href="/real_control_v2/css/main.css"/> | |
| 24 | - <!-- north style --> | |
| 25 | - <link rel="stylesheet" href="/real_control_v2/css/north.css" merge="custom_style"/> | |
| 26 | - <!-- home style --> | |
| 27 | - <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | |
| 28 | - | |
| 29 | - <!-- js tree --> | |
| 30 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/> | |
| 31 | - | |
| 32 | - <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | |
| 33 | - <!-- perfect-scrollbar style --> | |
| 34 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" | |
| 35 | - merge="plugins"/> | |
| 36 | - <!-- layer 3.0.3 --> | |
| 37 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | |
| 38 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | |
| 39 | - | |
| 40 | - <!-- flatpickr --> | |
| 41 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" merge="plugins"/> | |
| 42 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" merge="plugins"/> | |
| 43 | - | |
| 44 | - <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | |
| 45 | -</head> | |
| 46 | - | |
| 47 | -<body> | |
| 48 | -<div class="main-container" style="height: 100%;"> | |
| 49 | - <span style="position: absolute;left: calc(50% - 35px);top: calc(45% - 35px);">加载中...</span> | |
| 50 | -</div> | |
| 51 | - | |
| 52 | -<!-- 地图相关 --> | |
| 53 | -<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 54 | -<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 55 | -<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 56 | -<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 57 | -<!-- 高德 --> | |
| 58 | -<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script> | |
| 59 | -<!-- jquery --> | |
| 60 | -<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 61 | -<!-- jquery actual --> | |
| 62 | -<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | |
| 63 | -<!-- moment.js 日期处理类库 --> | |
| 64 | -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 65 | -<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 66 | - | |
| 67 | -<!-- flatpickr --> | |
| 68 | -<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | |
| 69 | -<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | |
| 70 | - | |
| 71 | -<!-- perfect-scrollbar --> | |
| 72 | -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | |
| 73 | -<!-- common js --> | |
| 74 | -<script src="/real_control_v2/js/common.js"></script> | |
| 75 | -<!-- art-template 模版引擎 --> | |
| 76 | -<script src="/assets/plugins/template.js" merge="plugins"></script> | |
| 77 | -<!-- d3 --> | |
| 78 | -<script src="/assets/js/d3.min.js"></script> | |
| 79 | -<!-- EventProxy --> | |
| 80 | -<script src="/assets/js/eventproxy.js"></script> | |
| 81 | -<!-- uikit core --> | |
| 82 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | |
| 83 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | |
| 84 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | |
| 85 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js" merge="uikit_js"></script> | |
| 86 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" merge="uikit_js"></script> | |
| 87 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | |
| 88 | - | |
| 89 | -<!-- js tree --> | |
| 90 | -<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | |
| 91 | -<!-- layer 3.0.3 --> | |
| 92 | -<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | |
| 93 | - | |
| 94 | -<!-- 模态框扩展 --> | |
| 95 | -<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | |
| 96 | - | |
| 97 | -<script src="/real_control_v2/alone_page/map/alone_data_basic.js" merge="custom_js"></script> | |
| 98 | -<script src="/real_control_v2/alone_page/map/alone_data_gps.js" merge="custom_js"></script> | |
| 99 | -<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | |
| 100 | -<!-- jquery.serializejson JSON序列化插件 --> | |
| 101 | -<script src="/assets/plugins/jquery.serializejson.js" merge="uikit_js"></script> | |
| 102 | - | |
| 103 | -</body> | |
| 104 | -<script> | |
| 105 | - gb_data_gps.fixedTimeRefresh(); | |
| 106 | - var res_load_ep = EventProxy.create('data-basic', function () { | |
| 107 | - | |
| 108 | - //嵌入地图页面 | |
| 109 | - $('.main-container').load('/real_control_v2/mapmonitor/real.html', function () { | |
| 110 | - $('.map-system-msg.flex-left').remove(); | |
| 111 | - }); | |
| 112 | - }); | |
| 113 | - | |
| 114 | - var isArray = function (obj) { | |
| 115 | - return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 116 | - }; | |
| 117 | -</script> | |
| 118 | -</html> | |
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh-cn"> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="UTF-8"> | |
| 6 | + <title>地图监控 v2.0</title> | |
| 7 | + <!-- uikit core style--> | |
| 8 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css"/> | |
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" | |
| 10 | + merge="plugins"/> | |
| 11 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" | |
| 12 | + merge="plugins"/> | |
| 13 | + <link rel="stylesheet" | |
| 14 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | |
| 15 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" | |
| 16 | + merge="plugins"/> | |
| 17 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" | |
| 18 | + merge="plugins"/> | |
| 19 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" | |
| 20 | + merge="plugins"/> | |
| 21 | + | |
| 22 | + <!-- main style --> | |
| 23 | + <link rel="stylesheet" href="/real_control_v2/css/main.css"/> | |
| 24 | + <!-- north style --> | |
| 25 | + <link rel="stylesheet" href="/real_control_v2/css/north.css" merge="custom_style"/> | |
| 26 | + <!-- home style --> | |
| 27 | + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | |
| 28 | + | |
| 29 | + <!-- js tree --> | |
| 30 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/> | |
| 31 | + | |
| 32 | + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | |
| 33 | + <!-- perfect-scrollbar style --> | |
| 34 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" | |
| 35 | + merge="plugins"/> | |
| 36 | + <!-- layer 3.0.3 --> | |
| 37 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | |
| 38 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | |
| 39 | + | |
| 40 | + <!-- flatpickr --> | |
| 41 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" merge="plugins"/> | |
| 42 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" merge="plugins"/> | |
| 43 | + | |
| 44 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | |
| 45 | +</head> | |
| 46 | + | |
| 47 | +<body> | |
| 48 | +<div class="main-container" style="height: 100%;"> | |
| 49 | + <span style="position: absolute;left: calc(50% - 35px);top: calc(45% - 35px);">加载中...</span> | |
| 50 | +</div> | |
| 51 | + | |
| 52 | +<!-- 地图相关 --> | |
| 53 | +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 54 | +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 55 | +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 56 | +<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 57 | +<!-- 高德 --> | |
| 58 | +<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script> | |
| 59 | +<!-- jquery --> | |
| 60 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 61 | +<!-- jquery actual --> | |
| 62 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | |
| 63 | +<!-- moment.js 日期处理类库 --> | |
| 64 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 65 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 66 | + | |
| 67 | +<!-- flatpickr --> | |
| 68 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | |
| 69 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | |
| 70 | + | |
| 71 | +<!-- perfect-scrollbar --> | |
| 72 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | |
| 73 | +<!-- common js --> | |
| 74 | +<script src="/real_control_v2/js/common.js"></script> | |
| 75 | +<!-- art-template 模版引擎 --> | |
| 76 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | |
| 77 | +<!-- d3 --> | |
| 78 | +<script src="/assets/js/d3.min.js"></script> | |
| 79 | +<!-- EventProxy --> | |
| 80 | +<script src="/assets/js/eventproxy.js"></script> | |
| 81 | +<!-- uikit core --> | |
| 82 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | |
| 83 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | |
| 84 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | |
| 85 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js" merge="uikit_js"></script> | |
| 86 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" merge="uikit_js"></script> | |
| 87 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | |
| 88 | + | |
| 89 | +<!-- js tree --> | |
| 90 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | |
| 91 | +<!-- layer 3.0.3 --> | |
| 92 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | |
| 93 | + | |
| 94 | +<!-- 模态框扩展 --> | |
| 95 | +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | |
| 96 | + | |
| 97 | +<script src="/real_control_v2/alone_page/map/alone_data_basic.js" merge="custom_js"></script> | |
| 98 | +<script src="/real_control_v2/alone_page/map/alone_data_gps.js" merge="custom_js"></script> | |
| 99 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | |
| 100 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 101 | +<script src="/assets/plugins/jquery.serializejson.js" merge="uikit_js"></script> | |
| 102 | + | |
| 103 | +</body> | |
| 104 | +<script> | |
| 105 | + gb_data_gps.fixedTimeRefresh(); | |
| 106 | + var res_load_ep = EventProxy.create('data-basic', function () { | |
| 107 | + | |
| 108 | + //嵌入地图页面 | |
| 109 | + $('.main-container').load('/real_control_v2/mapmonitor/real.html', function () { | |
| 110 | + $('.map-system-msg.flex-left').remove(); | |
| 111 | + }); | |
| 112 | + }); | |
| 113 | + | |
| 114 | + var isArray = function (obj) { | |
| 115 | + return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 116 | + }; | |
| 117 | +</script> | |
| 118 | +</html> | ... | ... |
src/main/resources/static/real_control_v2/js/data/data_line_config.js
| 1 | -/** | |
| 2 | - * 线路配置信息 | |
| 3 | - * @type {{}} | |
| 4 | - */ | |
| 5 | -var gb_data_line_config = (function () { | |
| 6 | - | |
| 7 | - var lineConfigMap; | |
| 8 | - | |
| 9 | - var storage = window.localStorage; | |
| 10 | - var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 11 | - var line_idx = (function () { | |
| 12 | - var str = ''; | |
| 13 | - for (var i = 0, item; item = activeLines[i++];) { | |
| 14 | - str += (',' + item.lineCode); | |
| 15 | - } | |
| 16 | - return str.substr(1); | |
| 17 | - })(); | |
| 18 | - | |
| 19 | - gb_common.$get('/lineConfig/findByIdx', {idx: line_idx}, function (rs) { | |
| 20 | - lineConfigMap = {}; | |
| 21 | - $.each(rs.list, function () { | |
| 22 | - lineConfigMap[this.line.lineCode] = this; | |
| 23 | - }); | |
| 24 | - | |
| 25 | - console.log('lineConfigMap', lineConfigMap); | |
| 26 | - }); | |
| 27 | - | |
| 28 | - return { | |
| 29 | - get: function (lineCode) { | |
| 30 | - return lineConfigMap[lineCode]; | |
| 31 | - } | |
| 32 | - }; | |
| 1 | +/** | |
| 2 | + * 线路配置信息 | |
| 3 | + * @type {{}} | |
| 4 | + */ | |
| 5 | +var gb_data_line_config = (function () { | |
| 6 | + | |
| 7 | + var lineConfigMap; | |
| 8 | + | |
| 9 | + var storage = window.localStorage; | |
| 10 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 11 | + var line_idx = (function () { | |
| 12 | + var str = ''; | |
| 13 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 14 | + str += (',' + item.lineCode); | |
| 15 | + } | |
| 16 | + return str.substr(1); | |
| 17 | + })(); | |
| 18 | + | |
| 19 | + gb_common.$get('/lineConfig/findByIdx', {idx: line_idx}, function (rs) { | |
| 20 | + lineConfigMap = {}; | |
| 21 | + $.each(rs.list, function () { | |
| 22 | + lineConfigMap[this.line.lineCode] = this; | |
| 23 | + }); | |
| 24 | + | |
| 25 | + console.log('lineConfigMap', lineConfigMap); | |
| 26 | + }); | |
| 27 | + | |
| 28 | + return { | |
| 29 | + get: function (lineCode) { | |
| 30 | + return lineConfigMap[lineCode]; | |
| 31 | + } | |
| 32 | + }; | |
| 33 | 33 | })(); |
| 34 | 34 | \ No newline at end of file | ... | ... |