Commit 19277052bac44897aad8d8240507ba7aacc8b78f

Authored by 廖磊
2 parents 2ced7989 a0469a02

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing 34 changed files with 2313 additions and 694 deletions
src/main/java/com/bsth/controller/SectionRouteController.java
... ... @@ -72,4 +72,14 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer
72 72 public List<Map<String, Object>> findUpStationRouteCode(@RequestParam Map<String, Object> map) {
73 73 return routeService.findUpSectionRouteCode(map);
74 74 }
  75 +
  76 + /**
  77 + * @Description :TODO(引用路段)
  78 + *
  79 + * @return List<Map<String, Object>>
  80 + */
  81 + @RequestMapping(value = "/quoteSection" , method = RequestMethod.POST)
  82 + public Map<String, Object> quoteSection(@RequestParam Map<String, Object> map) {
  83 + return routeService.quoteSection(map);
  84 + }
75 85 }
... ...
src/main/java/com/bsth/controller/StationRouteController.java
... ... @@ -127,8 +127,17 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
127 127 */
128 128 @RequestMapping(value = "/multiLine", method = RequestMethod.GET)
129 129 public Map<String, Object> findByMultiLine(@RequestParam String lineIds){
130   -
131 130 return service.findByMultiLine(lineIds);
132 131 }
133 132  
  133 + /**
  134 + *
  135 + * @Title: updSwitchDir
  136 + * @Description: TODO(上下行切换)
  137 + */
  138 + @RequestMapping(value = "/updSwitchDir", method = RequestMethod.POST)
  139 + public Map<String, Object> updSwitchDir(@RequestParam String lineIds){
  140 + return service.updSwitchDir(lineIds);
  141 + }
  142 +
134 143 }
... ...
src/main/java/com/bsth/controller/gps/GpsController.java
... ... @@ -96,4 +96,16 @@ public class GpsController {
96 96 public Map<String, Object> gpsCompletion(@RequestParam long schId) {
97 97 return gpsService.gpsCompletion(schId);
98 98 }
  99 +
  100 + /**
  101 + * 历史GPS查询 ,第二版轨迹回放用
  102 + * @param nbbm
  103 + * @param st
  104 + * @param et
  105 + * @return
  106 + */
  107 + @RequestMapping(value = "/history_v2/{nbbm}")
  108 + public Map<String, Object> history_v2(@PathVariable("nbbm") String nbbm, @RequestParam long st, @RequestParam long et){
  109 + return gpsService.history_v2(nbbm, st, et);
  110 + }
99 111 }
... ...
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
... ... @@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
4 4 import com.alibaba.fastjson.serializer.PropertyFilter;
5 5 import com.bsth.common.ResponseCode;
6 6 import com.bsth.data.BasicData;
  7 +import com.bsth.entity.Line;
  8 +import com.google.common.collect.ArrayListMultimap;
7 9 import org.slf4j.Logger;
8 10 import org.slf4j.LoggerFactory;
9 11 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -11,9 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
11 13 import org.springframework.web.bind.annotation.RequestMethod;
12 14 import org.springframework.web.bind.annotation.RestController;
13 15  
14   -import java.util.HashMap;
15   -import java.util.List;
16   -import java.util.Map;
  16 +import java.util.*;
17 17  
18 18 @RestController
19 19 @RequestMapping("/basic")
... ... @@ -126,4 +126,23 @@ public class BasicDataController {
126 126 public Map<String, String> nbbm2PlateNo(){
127 127 return basicData.getNbbm2PlateNo();
128 128 }
  129 +
  130 +
  131 + /**
  132 + * 获取线路配车信息
  133 + * @return
  134 + */
  135 + @RequestMapping("/ccInfo")
  136 + public Map<String, Collection<String>> ccInfo(){
  137 +
  138 + ArrayListMultimap<String, String> listMultimap = ArrayListMultimap.create();
  139 + Set<String> ks = BasicData.nbbm2LineMap.keySet();
  140 +
  141 + Line line;
  142 + for(String nbbm : ks){
  143 + line = BasicData.nbbm2LineMap.get(nbbm);
  144 + listMultimap.put(line.getLineCode(), nbbm);
  145 + }
  146 + return listMultimap.asMap();
  147 + }
129 148 }
... ...
src/main/java/com/bsth/repository/SectionRepository.java
... ... @@ -113,5 +113,4 @@ public interface SectionRepository extends BaseRepository&lt;Section, Integer&gt; {
113 113 Double speedLimit,String descriptions,Integer version,Integer createBy,String createDate,
114 114  
115 115 Integer updateBy,String updateDate);
116   -
117 116 }
... ...
src/main/java/com/bsth/repository/SectionRouteRepository.java
... ... @@ -28,6 +28,14 @@ import com.bsth.entity.SectionRoute;
28 28 @Repository
29 29 public interface SectionRouteRepository extends BaseRepository<SectionRoute, Integer> {
30 30  
  31 + // 查询最大ID
  32 + @Query(value = "SELECT IFNULL(num,0) as maxId from (SELECT MAX(id) as num FROM bsth_c_sectionroute) k" , nativeQuery=true)
  33 + public long sectionRouteMaxId();
  34 +
  35 + // 查询最大ID
  36 + @Query(value = "SELECT IFNULL(num,0) as maxId from (SELECT MAX(sectionroute_code) as num FROM bsth_c_sectionroute where line_code = 601010 and directions = 1 and destroy = 0) k" , nativeQuery=true)
  37 + public int sectionRouteCodeMaxId();
  38 +
31 39 /**
32 40 * @Description :TODO(查询路段信息)
33 41 *
... ... @@ -162,4 +170,8 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int
162 170 @Modifying
163 171 @Query(value="UPDATE bsth_c_sectionroute set is_roade_speed = ?1 where line= ?2 and directions=?3 ",nativeQuery = true)
164 172 void isRoadSpeedUpd(Integer isR,Integer line,Integer directions);
  173 +
  174 + @Modifying
  175 + @Query(value="update bsth_c_sectionroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true)
  176 + public void sectionRouteDir(Integer line);
165 177 }
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -268,4 +268,8 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
268 268 "ORDER BY " +
269 269 "lineCode,directions,stationRouteCode")
270 270 List<Object[]> findAllLineWithYgc();
  271 +
  272 + @Modifying
  273 + @Query(value="update bsth_c_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true)
  274 + public void stationRouteDir(Integer line);
271 275 }
... ...
src/main/java/com/bsth/service/SectionRouteService.java
... ... @@ -41,4 +41,6 @@ public interface SectionRouteService extends BaseService&lt;SectionRoute, Integer&gt;
41 41 * @return List<Map<String, Object>>
42 42 */
43 43 List<Map<String, Object>> findUpSectionRouteCode(Map<String, Object> map);
  44 +
  45 + Map<String, Object> quoteSection(Map<String, Object> map);
44 46 }
... ...
src/main/java/com/bsth/service/StationRouteService.java
... ... @@ -79,5 +79,7 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt;
79 79 */
80 80 List<Map<String, Object>> findStationRouteInfo(Map<String, Object> map);
81 81  
82   - Map<String, Object> findByMultiLine(String lineIds);
  82 + Map<String, Object> findByMultiLine(String lineIds);
  83 +
  84 + Map<String, Object> updSwitchDir(String lineIds);
83 85 }
... ...
src/main/java/com/bsth/service/gps/GpsService.java
... ... @@ -18,4 +18,6 @@ public interface GpsService {
18 18 Map<String,Object> findRoadSpeed(String lineCode);
19 19  
20 20 Map<String,Object> gpsCompletion(long schId);
  21 +
  22 + Map<String,Object> history_v2(String nbbm, long st, long et);
21 23 }
... ...
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
... ... @@ -5,11 +5,14 @@ import com.bsth.data.BasicData;
5 5 import com.bsth.data.arrival.ArrivalEntity;
6 6 import com.bsth.data.gpsdata.GpsEntity;
7 7 import com.bsth.data.gpsdata.GpsRealData;
  8 +import com.bsth.data.gpsdata.arrival.utils.GeoUtils;
8 9 import com.bsth.data.schedule.DayOfSchedule;
9 10 import com.bsth.entity.realcontrol.ScheduleRealInfo;
10 11 import com.bsth.repository.CarParkRepository;
11 12 import com.bsth.repository.StationRepository;
12 13 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  14 +import com.bsth.service.gps.entity.HistoryGps_DTO;
  15 +import com.bsth.service.gps.entity.Road_DTO;
13 16 import com.bsth.util.DateUtils;
14 17 import com.bsth.util.TransGPS;
15 18 import com.bsth.util.TransGPS.Location;
... ... @@ -235,6 +238,9 @@ public class GpsServiceImpl implements GpsService {
235 238 bdLoc = TransGPS.bd_encrypt(gdLoc);
236 239 map.put("bd_lon", bdLoc.getLng());
237 240 map.put("bd_lat", bdLoc.getLat());
  241 + //原始坐标
  242 + map.put("lon", lon);
  243 + map.put("lat", lat);
238 244  
239 245 map.put("deviceId", rs.getString("DEVICE_ID"));
240 246 map.put("ts", rs.getLong("TS"));
... ... @@ -510,6 +516,49 @@ public class GpsServiceImpl implements GpsService {
510 516 return rs;
511 517 }
512 518  
  519 + @Override
  520 + public Map<String, Object> history_v2(String nbbm, long st, long et) {
  521 + Map<String, Object> rs = new HashMap<>();
  522 +
  523 + try {
  524 + //获取历史gps 数据
  525 + List<HistoryGps_DTO> list = HistoryGps_DTO.craete(history(new String[]{nbbm}, st, et));
  526 + if(list!=null && list.size() > 0){
  527 + //获取路段信息
  528 + String sql = "select ID, ST_AsText(GROAD_VECTOR) as GROAD_VECTOR,ROAD_CODE,ROAD_NAME,SPEED from bsth_c_road where road_code in(select section_code from bsth_c_sectionroute where line_code=? and destroy=0)";
  529 + List<Road_DTO> roads = Road_DTO.craete(jdbcTemplate.queryForList(sql, list.get(0).getLineId()));
  530 +
  531 + //为GPS数据关联路段信息
  532 + for(HistoryGps_DTO gps : list){
  533 + matchRoadToGps(gps, roads);
  534 + }
  535 + }
  536 +
  537 + rs.put("status", ResponseCode.SUCCESS);
  538 + rs.put("list", list);
  539 + }catch (Exception e){
  540 + logger.error("", e);
  541 + rs.put("status", ResponseCode.ERROR);
  542 + }
  543 + return rs;
  544 + }
  545 +
  546 + private void matchRoadToGps(HistoryGps_DTO gps, List<Road_DTO> roads){
  547 + double min = -1,distance;
  548 + Road_DTO nearRoad = null;
  549 + for(Road_DTO road : roads){
  550 + distance = GeoUtils.getDistanceFromLine(road.getLineStr(), gps.getPoint());
  551 +
  552 + if (min > distance || min == -1) {
  553 + min = distance;
  554 + nearRoad = road;
  555 + }
  556 + }
  557 +
  558 + gps.setRoad(nearRoad);
  559 + gps.setRoadMinDistance(min);
  560 + }
  561 +
513 562 private void sortGpsList(final Field f, List<GpsEntity> rs) {
514 563 Collections.sort(rs, new Comparator<GpsEntity>() {
515 564  
... ...
src/main/java/com/bsth/service/gps/entity/HistoryGps_DTO.java 0 → 100644
  1 +package com.bsth.service.gps.entity;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.arrival.ArrivalEntity;
  6 +import com.fasterxml.jackson.annotation.JsonIgnore;
  7 +import com.vividsolutions.jts.geom.Coordinate;
  8 +import com.vividsolutions.jts.geom.GeometryFactory;
  9 +import com.vividsolutions.jts.geom.Point;
  10 +
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 历史GPS DTO
  16 + * Created by panzhao on 2017/4/5.
  17 + */
  18 +public class HistoryGps_DTO {
  19 +
  20 + public static List<HistoryGps_DTO> craete(List<Map<String, Object>> mapList){
  21 + List<HistoryGps_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), HistoryGps_DTO.class);
  22 +
  23 + GeometryFactory geometryFactory = new GeometryFactory();
  24 + Point point;
  25 + for(HistoryGps_DTO gps : list){
  26 + point = geometryFactory.createPoint(new Coordinate(gps.getLat(), gps.getLon()));
  27 + gps.setPoint(point);
  28 + }
  29 + return list;
  30 + }
  31 +
  32 + private double gcj_lon;
  33 + private double gcj_lat;
  34 +
  35 + private double bd_lon;
  36 + private double bd_lat;
  37 +
  38 + private double lon;
  39 + private double lat;
  40 +
  41 + private String deviceId;
  42 + private long ts;
  43 + private long timestamp;
  44 + private String stopNo;
  45 + private float direction;
  46 +
  47 + private String lineId;
  48 + private float speed;
  49 + private ArrivalEntity inout_stop_info;
  50 + private int inout_stop;
  51 +
  52 + private String nbbm;
  53 + private int state;
  54 + private int upDown;
  55 +
  56 + @JsonIgnore
  57 + private Point point;
  58 +
  59 + /** 路段 */
  60 + private Road_DTO road;
  61 + /** 和路段的最短距离 */
  62 + private double roadMinDistance;
  63 +
  64 + public double getGcj_lon() {
  65 + return gcj_lon;
  66 + }
  67 +
  68 + public void setGcj_lon(double gcj_lon) {
  69 + this.gcj_lon = gcj_lon;
  70 + }
  71 +
  72 + public double getGcj_lat() {
  73 + return gcj_lat;
  74 + }
  75 +
  76 + public void setGcj_lat(double gcj_lat) {
  77 + this.gcj_lat = gcj_lat;
  78 + }
  79 +
  80 + public double getBd_lon() {
  81 + return bd_lon;
  82 + }
  83 +
  84 + public void setBd_lon(double bd_lon) {
  85 + this.bd_lon = bd_lon;
  86 + }
  87 +
  88 + public double getBd_lat() {
  89 + return bd_lat;
  90 + }
  91 +
  92 + public void setBd_lat(double bd_lat) {
  93 + this.bd_lat = bd_lat;
  94 + }
  95 +
  96 + public String getDeviceId() {
  97 + return deviceId;
  98 + }
  99 +
  100 + public void setDeviceId(String deviceId) {
  101 + this.deviceId = deviceId;
  102 + }
  103 +
  104 + public long getTs() {
  105 + return ts;
  106 + }
  107 +
  108 + public void setTs(long ts) {
  109 + this.ts = ts;
  110 + }
  111 +
  112 + public long getTimestamp() {
  113 + return timestamp;
  114 + }
  115 +
  116 + public void setTimestamp(long timestamp) {
  117 + this.timestamp = timestamp;
  118 + }
  119 +
  120 + public String getStopNo() {
  121 + return stopNo;
  122 + }
  123 +
  124 + public void setStopNo(String stopNo) {
  125 + this.stopNo = stopNo;
  126 + }
  127 +
  128 + public float getDirection() {
  129 + return direction;
  130 + }
  131 +
  132 + public void setDirection(float direction) {
  133 + this.direction = direction;
  134 + }
  135 +
  136 + public String getLineId() {
  137 + return lineId;
  138 + }
  139 +
  140 + public void setLineId(String lineId) {
  141 + this.lineId = lineId;
  142 + }
  143 +
  144 + public float getSpeed() {
  145 + return speed;
  146 + }
  147 +
  148 + public void setSpeed(float speed) {
  149 + this.speed = speed;
  150 + }
  151 +
  152 + public ArrivalEntity getInout_stop_info() {
  153 + return inout_stop_info;
  154 + }
  155 +
  156 + public void setInout_stop_info(ArrivalEntity inout_stop_info) {
  157 + this.inout_stop_info = inout_stop_info;
  158 + }
  159 +
  160 + public int getInout_stop() {
  161 + return inout_stop;
  162 + }
  163 +
  164 + public void setInout_stop(int inout_stop) {
  165 + this.inout_stop = inout_stop;
  166 + }
  167 +
  168 + public String getNbbm() {
  169 + return nbbm;
  170 + }
  171 +
  172 + public void setNbbm(String nbbm) {
  173 + this.nbbm = nbbm;
  174 + }
  175 +
  176 + public int getState() {
  177 + return state;
  178 + }
  179 +
  180 + public void setState(int state) {
  181 + this.state = state;
  182 + }
  183 +
  184 + public int getUpDown() {
  185 + return upDown;
  186 + }
  187 +
  188 + public void setUpDown(int upDown) {
  189 + this.upDown = upDown;
  190 + }
  191 +
  192 + public Road_DTO getRoad() {
  193 + return road;
  194 + }
  195 +
  196 + public void setRoad(Road_DTO road) {
  197 + this.road = road;
  198 + }
  199 +
  200 + public double getRoadMinDistance() {
  201 + return roadMinDistance;
  202 + }
  203 +
  204 + public void setRoadMinDistance(double roadMinDistance) {
  205 + this.roadMinDistance = roadMinDistance;
  206 + }
  207 +
  208 + public double getLon() {
  209 + return lon;
  210 + }
  211 +
  212 + public void setLon(double lon) {
  213 + this.lon = lon;
  214 + }
  215 +
  216 + public double getLat() {
  217 + return lat;
  218 + }
  219 +
  220 + public void setLat(double lat) {
  221 + this.lat = lat;
  222 + }
  223 +
  224 + public Point getPoint() {
  225 + return point;
  226 + }
  227 +
  228 + public void setPoint(Point point) {
  229 + this.point = point;
  230 + }
  231 +}
... ...
src/main/java/com/bsth/service/gps/entity/Road_DTO.java 0 → 100644
  1 +package com.bsth.service.gps.entity;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.fasterxml.jackson.annotation.JsonIgnore;
  6 +import com.vividsolutions.jts.geom.Coordinate;
  7 +import com.vividsolutions.jts.geom.GeometryFactory;
  8 +import com.vividsolutions.jts.geom.LineString;
  9 +
  10 +import java.util.ArrayList;
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 路段信息DTO
  16 + * Created by panzhao on 2017/4/5.
  17 + */
  18 +public class Road_DTO {
  19 +
  20 + public static List<Road_DTO> craete(List<Map<String, Object>> mapList){
  21 + List<Road_DTO> list = JSONObject.parseArray(JSON.toJSONString(mapList), Road_DTO.class);
  22 + //处理路段坐标
  23 + String polygonStr;
  24 + String[] coords;
  25 + int i, len;
  26 + String[] temps;//1, temps2;
  27 + List<Coordinate> cds;
  28 +
  29 + GeometryFactory geometryFactory = new GeometryFactory();
  30 + for(Road_DTO road : list){
  31 + polygonStr = road.getGROAD_VECTOR();
  32 + coords = polygonStr.substring(11, polygonStr.length() - 1).split(",");
  33 + len = coords.length;
  34 +
  35 + cds = new ArrayList<>();
  36 + //每2个点连一条线
  37 + for(i = 0; i < len; i ++){
  38 + temps = coords[i].split(" ");
  39 + cds.add(new Coordinate(Float.parseFloat(temps[1]), Float.parseFloat(temps[0])));
  40 + }
  41 +
  42 + Coordinate[] cdsArray = new Coordinate[cds.size()];
  43 + road.setLineStr(geometryFactory.createLineString(cds.toArray(cdsArray)));
  44 + }
  45 + return list;
  46 + }
  47 +
  48 + private long ID;
  49 +
  50 + @JsonIgnore
  51 + private String GROAD_VECTOR;
  52 +
  53 + private String ROAD_CODE;
  54 +
  55 + private String ROAD_NAME;
  56 +
  57 + private double SPEED;
  58 +
  59 + @JsonIgnore
  60 + private LineString lineStr;
  61 +
  62 + public long getID() {
  63 + return ID;
  64 + }
  65 +
  66 + public void setID(long ID) {
  67 + this.ID = ID;
  68 + }
  69 +
  70 + public String getGROAD_VECTOR() {
  71 + return GROAD_VECTOR;
  72 + }
  73 +
  74 + public void setGROAD_VECTOR(String GROAD_VECTOR) {
  75 + this.GROAD_VECTOR = GROAD_VECTOR;
  76 + }
  77 +
  78 + public String getROAD_CODE() {
  79 + return ROAD_CODE;
  80 + }
  81 +
  82 + public void setROAD_CODE(String ROAD_CODE) {
  83 + this.ROAD_CODE = ROAD_CODE;
  84 + }
  85 +
  86 + public String getROAD_NAME() {
  87 + return ROAD_NAME;
  88 + }
  89 +
  90 + public void setROAD_NAME(String ROAD_NAME) {
  91 + this.ROAD_NAME = ROAD_NAME;
  92 + }
  93 +
  94 + public double getSPEED() {
  95 + return SPEED;
  96 + }
  97 +
  98 + public void setSPEED(double SPEED) {
  99 + this.SPEED = SPEED;
  100 + }
  101 +
  102 + public LineString getLineStr() {
  103 + return lineStr;
  104 + }
  105 +
  106 + public void setLineStr(LineString lineStr) {
  107 + this.lineStr = lineStr;
  108 + }
  109 +}
... ...
src/main/java/com/bsth/service/impl/SectionRouteServiceImpl.java
... ... @@ -8,7 +8,12 @@ import java.util.Map;
8 8 import org.springframework.beans.factory.annotation.Autowired;
9 9 import org.springframework.stereotype.Service;
10 10  
  11 +import com.bsth.common.ResponseCode;
  12 +import com.bsth.entity.Line;
  13 +import com.bsth.entity.Section;
11 14 import com.bsth.entity.SectionRoute;
  15 +import com.bsth.repository.LineRepository;
  16 +import com.bsth.repository.SectionRepository;
12 17 import com.bsth.repository.SectionRouteRepository;
13 18 import com.bsth.service.SectionRouteService;
14 19  
... ... @@ -34,6 +39,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
34 39 @Autowired
35 40 SectionRouteRepository repository;
36 41  
  42 + @Autowired
  43 + SectionRepository repository2;
  44 +
  45 + @Autowired
  46 + LineRepository lineRepository;
  47 +
37 48 /**
38 49 * @Description :TODO(查询路段信息)
39 50 *
... ... @@ -43,21 +54,13 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
43 54 */
44 55 @Override
45 56 public List<Map<String, Object>> getSectionRoute(Map<String, Object> map) {
46   -
47 57 int lineId = map.get("line.id_eq").equals("") ? 0 : Integer.parseInt(map.get("line.id_eq").toString());
48   -
49 58 int directions = map.get("directions_eq").equals("") ? 0 : Integer.parseInt(map.get("directions_eq").toString());
50   -
51 59 List<Object[]> listObjArray = repository.getSectionRoute(lineId, directions);
52   -
53 60 List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
54   -
55 61 if(listObjArray.size()>0) {
56   -
57 62 for(int i = 0 ; i<listObjArray.size() ; i++){
58   -
59 63 Map<String, Object> tempM = new HashMap<String, Object>();
60   -
61 64 tempM.put("sectionrouteId",listObjArray.get(i)[0]);
62 65 tempM.put("sectionrouteLine",listObjArray.get(i)[1]);
63 66 tempM.put("sectionrouteLineCode",listObjArray.get(i)[2]);
... ... @@ -81,12 +84,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
81 84 tempM.put("sectionTime",listObjArray.get(i)[20]);
82 85 tempM.put("sectiondbType",listObjArray.get(i)[21]);
83 86 tempM.put("sectionSpeedLimet",listObjArray.get(i)[22]);
  87 + tempM.put("destroy",listObjArray.get(i)[23]);
  88 + tempM.put("versions",listObjArray.get(i)[24]);
  89 + tempM.put("descriptions",listObjArray.get(i)[25]);
84 90 resultList.add(tempM);
85   -
86 91 }
87   -
88 92 }
89   -
90 93 return resultList;
91 94 }
92 95  
... ... @@ -228,5 +231,68 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
228 231  
229 232 return list;
230 233 }
  234 +
  235 + @Override
  236 + public Map<String, Object> quoteSection(Map<String, Object> map) {
  237 + Map<String, Object> resultMap = new HashMap<String, Object>();
  238 + try {
  239 + Integer line = map.get("lineId") ==null ? null : Integer.parseInt(map.get("lineId").toString());
  240 + Integer dir = map.get("dir")==null ? null : Integer.parseInt(map.get("dir").toString());
  241 + Integer toDir = map.get("toDir")==null ? null : Integer.parseInt(map.get("toDir").toString());
  242 + if(line!=null && dir!=null) {
  243 + List<Object[]> list = repository.getSectionRoute(line, dir);
  244 + int src = repository.sectionRouteCodeMaxId();
  245 + for(int i = 0 ; i<list.size() ; i++) {
  246 + int sectionId = Integer.parseInt(String.valueOf(repository2.sectionMaxId())) + 1 ;
  247 + String sectionCode = String.valueOf(sectionId);
  248 + String sectionName = list.get(i)[9] == null ? null : list.get(i)[9].toString();
  249 + String crosesRoad = list.get(i)[10] == null ? null : list.get(i)[10].toString();
  250 + String endNode = list.get(i)[11] == null ? null : list.get(i)[11].toString();
  251 + String startNode = list.get(i)[12] == null ? null : list.get(i)[12].toString();
  252 + String middleNode = list.get(i)[13] == null ? null : list.get(i)[13].toString();
  253 + String sectionType = list.get(i)[14] == null ? null : list.get(i)[14].toString();
  254 + String csectionVector = list.get(i)[15] == null ? null : list.get(i)[15].toString();
  255 + String bsectionVector = list.get(i)[16] == null ? null : list.get(i)[16].toString();
  256 + String gsectionVector = list.get(i)[17] == null ? null : list.get(i)[17].toString();
  257 + String roadCoding = list.get(i)[18] == null ? null : list.get(i)[18].toString();
  258 + Double sectionDistance = list.get(i)[19] == null ? null : Double.parseDouble(list.get(i)[19].toString());
  259 + Double sectionTime = list.get(i)[20] == null ? null : Double.parseDouble(list.get(i)[20].toString());
  260 + String dbType = list.get(i)[21] == null ? null : list.get(i)[21].toString();
  261 + Double speedLimit = list.get(i)[22] == null ? null : Double.parseDouble(list.get(i)[22].toString());
  262 + Integer destroy = list.get(i)[23] == null ? null : Integer.parseInt(list.get(i)[23].toString());
  263 + Integer versions = list.get(i)[24] == null ? null : Integer.parseInt(list.get(i)[24].toString());
  264 + String descriptions = list.get(i)[25] == null ? null : list.get(i)[25].toString();
  265 + repository2.systemSave(sectionCode,
  266 + sectionName, crosesRoad, endNode, startNode, middleNode,
  267 + gsectionVector, bsectionVector,
  268 + sectionType, csectionVector, roadCoding,
  269 + sectionDistance, sectionTime, dbType, speedLimit, descriptions, versions, sectionId);
  270 + int sectionRouteId = Integer.parseInt(String.valueOf(repository.sectionRouteMaxId())) + 1 ;
  271 + SectionRoute sr = new SectionRoute();
  272 + Line lineObject = lineRepository.findOne(line);
  273 + Section section = repository2.findOne(sectionId);
  274 + Integer xh = (src == 0 ? (toDir ==1? (list.size()-i)*10 : (list.size()+i)*10) : toDir==1? (src + (list.size()-i)*10) : (src + (list.size()+i)*10)) ;
  275 + sr.setId(sectionRouteId);
  276 + sr.setSectionrouteCode(xh);
  277 + sr.setLineCode(lineObject.getLineCode());
  278 + sr.setSectionCode(sectionCode);
  279 + sr.setDirections(toDir);
  280 + sr.setVersions(versions);
  281 + sr.setDestroy(destroy);
  282 + sr.setLine(lineObject);
  283 + sr.setSection(section);
  284 + sr.setSectionCode(section.getSectionCode());
  285 + sr.setDescriptions(descriptions);
  286 + sr.setIsRoadeSpeed(1);
  287 + repository.save(sr);
  288 + }
  289 + }
  290 + resultMap.put("status", ResponseCode.SUCCESS);
  291 + } catch (Exception e) {
  292 + resultMap.put("status", ResponseCode.ERROR);
  293 + logger.error("save erro.", e);
  294 + }
  295 + return resultMap;
  296 + }
231 297  
232 298 }
... ...
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
... ... @@ -17,6 +17,7 @@ import com.bsth.util.db.DBUtils_MS;
17 17 import com.google.common.base.Splitter;
18 18 import org.springframework.beans.factory.annotation.Autowired;
19 19 import org.springframework.stereotype.Service;
  20 +import org.springframework.transaction.annotation.Transactional;
20 21  
21 22 import java.io.ByteArrayInputStream;
22 23 import java.io.File;
... ... @@ -1080,4 +1081,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
1080 1081  
1081 1082 return rs;
1082 1083 }
  1084 +
  1085 + @Override
  1086 + @Transactional
  1087 + public Map<String, Object> updSwitchDir(String lineIds) {
  1088 + Map<String, Object> rs = new HashMap<>();
  1089 + try{
  1090 + if(lineIds!=null && lineIds !="") {
  1091 + Integer lineId = Integer.parseInt(lineIds);
  1092 + // 上行站点切换到下行.
  1093 + repository.stationRouteDir(lineId);
  1094 + routeRepository.sectionRouteDir(lineId);
  1095 + }
  1096 + rs.put("status", ResponseCode.SUCCESS);
  1097 + }catch(Exception e){
  1098 + logger.error("", e);
  1099 + rs.put("status", ResponseCode.ERROR);
  1100 + }
  1101 + return rs;
  1102 + }
1083 1103 }
... ...
src/main/resources/datatools/ktrs/ttinfodetailoutputforedit.ktr
... ... @@ -3365,7 +3365,7 @@
3365 3365 <schema_name/>
3366 3366 </partitioning>
3367 3367 <connection>bus_control_variable</connection>
3368   - <sql>select &#xa;t.id as id&#xa;, g.lp_name as lp&#xa;, g.xl as xl&#xa;, qdz&#xa;, zdz&#xa;, tcc&#xa;, fcsj&#xa;, jhlc&#xa;, bc_type &#xa;, bcs&#xa;, fcno&#xa;, xl_dir&#xa;, isfb&#xa;from bsth_c_s_ttinfo_detail t left join &#xa;bsth_c_s_gbi g on t.lp &#x3d; g.id &#xa;where &#xa;g.xl &#x3d; &#x3f; and&#xa;t.ttinfo &#x3d; &#x3f; &#xa;order by t.bcs asc</sql>
  3368 + <sql>select &#xa;t.id as id&#xa;, concat&#x28;g.id, &#x27;_&#x27;, g.lp_name&#x29; as lp&#xa;, g.xl as xl&#xa;, qdz&#xa;, zdz&#xa;, tcc&#xa;, fcsj&#xa;, jhlc&#xa;, bc_type &#xa;, bcs&#xa;, fcno&#xa;, xl_dir&#xa;, isfb&#xa;from bsth_c_s_ttinfo_detail t left join &#xa;bsth_c_s_gbi g on t.lp &#x3d; g.id &#xa;where &#xa;g.xl &#x3d; &#x3f; and&#xa;t.ttinfo &#x3d; &#x3f; &#xa;order by t.bcs asc</sql>
3369 3369 <limit>0</limit>
3370 3370 <lookup>&#x83b7;&#x53d6;&#x53d8;&#x91cf;</lookup>
3371 3371 <execute_each_row>N</execute_each_row>
... ...
src/main/resources/static/index.html
... ... @@ -196,7 +196,7 @@ tr.row-active td {
196 196 <!-- LOGO -->
197 197 <div class="page-logo">
198 198 <a href="index.html" class="logo-default logo-default-text">
199   - 浦东公交调度系统 </a>
  199 + 闵行公交调度系统 </a>
200 200 <div class="menu-toggler sidebar-toggler"></div>
201 201 </div>
202 202 <!-- END LOGO -->
... ...
src/main/resources/static/login.html
... ... @@ -181,7 +181,7 @@
181 181 <div class="wrapper ng-scope">
182 182 <div id="loginPanel" class="dialog dialog-shadow">
183 183 <br>
184   - <h3 class="logo-text">浦东公交调度系统</h3>
  184 + <h3 class="logo-text">闵行公交调度系统</h3>
185 185 <hr>
186 186 <form style="padding: 0px 35px;">
187 187 <div class="form-group" style="margin-bottom: 0">
... ...
src/main/resources/static/pages/base/stationroute/editsection.html
1 1 <!-- 编辑路段 -->
2 2 <div class="modal fade" id="edit_section_mobal" tabindex="-1" role="basic" aria-hidden="true">
3   -
4 3 <div class="modal-dialog">
5   -
6 4 <div class="modal-content">
7   -
8 5 <div class="modal-header">
9 6 <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
10 7 <h4 class="modal-title">路段路段</h4>
11 8 </div>
12   -
13 9 <div class="modal-body">
14   -
15 10 <form class="form-horizontal" role="form" id="edit_section__form" action="/module" method="post">
16   -
17 11 <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button>
18 12 您的输入有误,请检查下面的输入项
19 13 </div>
20   -
21 14 <!-- 线路ID -->
22   -
23 15 <input type="hidden" name="sectionId" id="sectionIdInput">
24   -
25 16 <input type="hidden" name="sectionRouteId" id="sectionRouteIdInput">
26   -
27 17 <input type="hidden" name="sectionRouteLine" id="sectionRouteLineInput">
28   -
29 18 <input type="hidden" name="lineCode" id="lineCodeInput">
30   -
31 19 <input type="hidden" name="bsectionVector" id="bsectionVectorInput" />
32   -
33 20 <input type="hidden" name="csectionVector" id="csectionVectorInput" value=""/>
34   -
35 21 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
36   -
37 22 <!-- 路段名称 -->
38 23 <div class="form-body">
39 24 <div class="form-group">
... ... @@ -45,7 +30,6 @@
45 30 </div>
46 31 </div>
47 32 </div>
48   -
49 33 <!-- 路段编码 -->
50 34 <div class="form-body">
51 35 <div class="form-group">
... ... @@ -57,7 +41,6 @@
57 41 </div>
58 42 </div>
59 43 </div>
60   -
61 44 <!-- 路段序号 -->
62 45 <div class="form-body">
63 46 <div class="form-group">
... ... @@ -70,24 +53,6 @@
70 53 </div>
71 54 </div>
72 55 </div>
73   -
74   - <!-- 路段类型 -->
75   - <!-- <div class="form-body">
76   - <div class="form-group">
77   - <label class="control-label col-md-3">
78   - <span class="required"> * </span>路段类型:
79   - </label>
80   - <div class="col-md-6">
81   - <select name="sectionType" class="form-control" id="sectionTypeSelect">
82   - <option value="">-- 请选择路段类型 --</option>
83   - <option value="B">起点站</option>
84   - <option value="Z">中途站</option>
85   - <option value="E">终点站</option>
86   - </select>
87   - </div>
88   - </div>
89   - </div> -->
90   -
91 56 <!-- 路段方向 -->
92 57 <div class="form-body">
93 58 <div class="form-group">
... ... @@ -103,7 +68,6 @@
103 68 </div>
104 69 </div>
105 70 </div>
106   -
107 71 <!-- 道路编码-->
108 72 <div class="form-body">
109 73 <div class="form-group">
... ... @@ -113,7 +77,6 @@
113 77 </div>
114 78 </div>
115 79 </div>
116   -
117 80 <!-- 路段限速 -->
118 81 <div class="form-body">
119 82 <div class="form-group">
... ... @@ -125,7 +88,6 @@
125 88 </div>
126 89 </div>
127 90 </div>
128   -
129 91 <!-- 路段时长 -->
130 92 <div class="form-body">
131 93 <div class="form-group">
... ... @@ -136,7 +98,6 @@
136 98 </div>
137 99 </div>
138 100 </div>
139   -
140 101 <!-- 路段长度 -->
141 102 <div class="form-body">
142 103 <div class="form-group">
... ... @@ -147,7 +108,6 @@
147 108 </div>
148 109 </div>
149 110 </div>
150   -
151 111 <!-- 版本号 -->
152 112 <div class="form-body">
153 113 <div class="form-group">
... ... @@ -157,7 +117,6 @@
157 117 </div>
158 118 </div>
159 119 </div>
160   -
161 120 <!-- 范围图形类型 -->
162 121 <div class="form-body">
163 122 <div class="form-group">
... ... @@ -171,7 +130,6 @@
171 130 </div>
172 131 </div>
173 132 </div>
174   -
175 133 <!-- 描述/说明 -->
176 134 <div class="form-group">
177 135 <label class="control-label col-md-3"> 描述/说明: </label>
... ... @@ -191,99 +149,56 @@
191 149 <script type="text/javascript">
192 150  
193 151 $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,section,fun){
194   -
195 152 var Section = section.getEitdSection();
196   -
197 153 fun.setSectionFormValue(Section);
198   -
199 154 // 方向
200 155 var dir = Section.sectionrouteDirections;
201   -
202 156 var lineId = Section.sectionrouteLine;
203   -
204 157 // 获取路段号元素,并添加下拉属性值
205 158 ajaxd.getStation(lineId,dir,function(treeData) {
206   -
207 159 var options = '<option value="">请选择...</option>';
208   -
209 160 var dArray = treeData[0].children[1].children;
210   -
211 161 var eq_stationRouteCode = Section.sectionrouteCode;
212   -
213 162 for(var i = 0 ; i<dArray.length; i++){
214   -
215 163 var ptions_v = dArray[i].sectionrouteCode;
216   -
217 164 // 排除本站
218   - if(eq_stationRouteCode == ptions_v){
219   -
  165 + if(eq_stationRouteCode == ptions_v)
220 166 continue;
221   -
222   - }
223   -
224 167 options += '<option value="'+ ptions_v +'">'+dArray[i].sectionName+'</option>'
225   -
226 168 }
227   -
228 169 $('#sectionrouteCodeSelect').html(options);
229   -
230 170 ajaxd.findUpSectionRouteCode(lineId,dir,eq_stationRouteCode,function(str) {
231   -
232 171 if(str.length>0){
233   -
234 172 var upStationRouteCode = str[0].sectionrouteCode
235   -
236 173 $('#sectionrouteCodeSelect').val(upStationRouteCode);
237   -
238 174 }
239   -
240 175 });
241   -
242 176 });
243   -
244 177 // 显示mobal
245 178 $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false});
246   -
247 179 // 当调用 hide 实例方法时触发
248 180 $('#edit_section_mobal').on('hide.bs.modal', function () {
249   -
250 181 closeMobleSetClean();
251   -
252 182 });
253   -
254 183 function closeMobleSetClean() {
255   -
256 184 // 清除地图覆盖物
257 185 map_.clearMarkAndOverlays();
258   -
259 186 /** 设置修改路段集合对象为空 */
260 187 section.setEitdSection({});
261   -
262 188 fun.resjtreeDate(lineId,dir);
263   -
264 189 fun.editAChangeCssRemoveDisabled();
265   -
266 190 ajaxd.getSectionRouteInfo(lineId,dir,function(data) {
267   -
268 191 fun.linePanlThree(lineId,data,dir);
269   -
270 192 });
271   -
272 193 }
273   -
274 194 // 编辑表单元素
275 195 var form = $('#edit_section__form');
276   -
277 196 // 获取错误提示元素
278 197 var error = $('.alert-danger', form);
279   -
280 198 // 提交数据按钮事件
281 199 $('#editSectionButton').on('click', function() {
282   -
283   -
284 200 // 表单提交
285 201 form.submit();
286   -
287 202 });
288 203  
289 204 // 表单验证
... ... @@ -392,42 +307,23 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
392 307 },
393 308  
394 309 submitHandler : function(f) {
395   -
396 310 var params = form.serializeJSON();
397   -
398 311 error.hide();
399   -
400   - console.log(params);
401   -
402 312 ajaxd.sectionUpdate(params,function(resuntDate) {
403   -
404 313 if(resuntDate.status=='SUCCESS') {
405   -
406 314 // 弹出添加成功提示消息
407 315 layer.msg('修改成功...');
408   -
409   -
410 316 }else {
411   -
412 317 // 弹出添加失败提示消息
413 318 layer.msg('修改失败...');
414   -
415 319 }
416   -
417 320 $('#edit_section_mobal').modal('hide');
418   -
419 321 var dir = params.directions
420   -
421 322 // 刷行左边树
422 323 fun.resjtreeDate(lineId,dir);
423   -
424 324 closeMobleSetClean();
425   -
426 325 });
427   -
428 326 }
429 327 });
430   -
431   -
432 328 });
433 329 </script>
434 330 \ No newline at end of file
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
... ... @@ -169,13 +169,9 @@ var GetAjaxData = function(){
169 169  
170 170 // 查询路段信息
171 171 getSectionRouteInfo : function(lineId,direction,callback) {
172   -
173 172 $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) {
174   -
175 173 callback && callback(resultdata);
176   -
177 174 });
178   -
179 175 },
180 176  
181 177 // 手动规划线路保存
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
... ... @@ -22,199 +22,222 @@ $(function(){
22 22  
23 23 // 上行站点其它规划点击事件
24 24 $('.upManual').on('click',function() {
25   -
26 25 // 加载其它规划选择弹出层mobal页面
27 26 $.get('add_manual_select.html', function(m){
28   -
29 27 $(pjaxContainer).append(m);
30   -
31 28 $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]);
32   -
33 29 });
34 30  
35 31 });
36 32  
37 33 // 上行站点新增事件
38 34 $('.module_tools #addUpStation').on('click', function() {
39   -
40 35 /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */
41 36 AddStationObj.setAddStationDiraction(directionUpValue);
42   -
43 37 // 加载选择新增方式mobal
44 38 $.get('add_select.html', function(m){
45   -
46 39 $(pjaxContainer).append(m);
47   -
48 40 $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]);
49   -
50 41 });
51   -
52 42 });
53 43  
54 44 // 修改上行站点mobal页面
55 45 $('.module_tools #editUpStation').on('click', function(){
56   -
57 46 var sel = PublicFunctions.getCurrSelNode(directionUpValue);
58   -
59 47 if(sel.length==0 || sel[0].original.chaildredType !='station'){
60   -
61 48 layer.msg('请先选择要编辑的上行站点!');
62   -
63 49 return;
64 50 }
65   -
66 51 $.get('edit_select.html', function(m){
67   -
68 52 $(pjaxContainer).append(m);
69   -
70 53 $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionUpValue]);
71 54 });
72   -
73 55 });
74 56  
75 57 // 撤销上行站点
76 58 $('.module_tools #deleteUpStation').on('click', function() {
77   -
78 59 PublicFunctions.stationRevoke(directionUpValue);
79   -
80 60 });
81 61  
82   - // 编辑线路上行走向
83   - $('.module_tools #editUplineTrend').on('click', function() {
84   -
85   - PublicFunctions.editLinePlan(directionUpValue);
86   -
  62 + // 切换上下行.
  63 + $('.retweet').on('click',function() {
  64 + layer.confirm('您是否确定将【上、下】行站点和路段进行对换!', {
  65 + btn : [ '确认提示并提交', '取消' ]
  66 + },function () {
  67 + // 关闭所有提示弹出层.
  68 + layer.closeAll();
  69 + // 弹出提示层.
  70 + var index = layer.load(1, {
  71 + shade: [0.1,'#fff'] // 透明度的白色背景
  72 + });
  73 + var Line = LineObj.getLineObj();
  74 + $post('/stationroute/updSwitchDir?lineIds='+ Line.id,null,function(data) {
  75 + layer.close(index);
  76 + if(data.status=='SUCCESS') {
  77 + // 弹出添加成功提示消息
  78 + layer.msg('操作成功...');
  79 + }else {
  80 + // 弹出添加失败提示消息
  81 + layer.msg('操作成功...');
  82 + }
  83 + WorldsBMap.clearMarkAndOverlays();
  84 + // 刷新左边树
  85 + PublicFunctions.resjtreeDate(Line.id,0);
  86 + PublicFunctions.resjtreeDate(Line.id,1);
  87 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  88 + GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) {
  89 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  90 + PublicFunctions.linePanlThree(Line.id,data,0);
  91 + });
  92 + });
  93 + });
87 94 });
88 95  
  96 + $('#quoteUp').on('click',function() {
  97 + // 弹出提示层.
  98 + var index = layer.load(1, {
  99 + shade: [0.1,'#fff'] // 透明度的白色背景
  100 + });
  101 + var Line = LineObj.getLineObj();
  102 + var params = {'lineId':Line.id ,'dir':0,'toDir':1};
  103 + quote(params,index);
  104 + /*$post('/sectionroute/quoteSection',{'lineId':Line.id ,'dir':0,'toDir':1} ,function(data) {
  105 + layer.close(index);
  106 + if(data.status=='SUCCESS') {
  107 + // 弹出添加成功提示消息
  108 + layer.msg('操作成功...');
  109 + }else {
  110 + // 弹出添加失败提示消息
  111 + layer.msg('操作成功...');
  112 + }
  113 + WorldsBMap.clearMarkAndOverlays();
  114 + // 刷新左边树
  115 + PublicFunctions.resjtreeDate(Line.id,0);
  116 + PublicFunctions.resjtreeDate(Line.id,1);
  117 + *//** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 *//*
  118 + GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) {
  119 + *//** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> *//*
  120 + PublicFunctions.linePanlThree(Line.id,data,0);
  121 + });
  122 + });*/
  123 + });
  124 +
  125 +
  126 + $('#quoteDown').on('click',function() {
  127 + // 弹出提示层.
  128 + var index = layer.load(1, {
  129 + shade: [0.1,'#fff'] // 透明度的白色背景
  130 + });
  131 + var Line = LineObj.getLineObj();
  132 + var params = {'lineId':Line.id ,'dir':1,'toDir':0} ;
  133 + quote(params,index);
  134 + });
  135 +
  136 + function quote(params,index) {
  137 + $post('/sectionroute/quoteSection',params,function(data) {
  138 + layer.close(index);
  139 + if(data.status=='SUCCESS') {
  140 + // 弹出添加成功提示消息
  141 + layer.msg('操作成功...');
  142 + }else {
  143 + // 弹出添加失败提示消息
  144 + layer.msg('操作成功...');
  145 + }
  146 + WorldsBMap.clearMarkAndOverlays();
  147 + // 刷新左边树
  148 + PublicFunctions.resjtreeDate(Line.id,0);
  149 + PublicFunctions.resjtreeDate(Line.id,1);
  150 + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */
  151 + GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) {
  152 + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
  153 + PublicFunctions.linePanlThree(Line.id,data,0);
  154 + });
  155 + });
  156 + }
  157 + // 编辑线路上行走向
  158 + $('.module_tools #editUplineTrend').on('click', function() {PublicFunctions.editLinePlan(directionUpValue);});
  159 +
89 160 // 线路上行
90 161 $('#leftUpOrDown #upLine').on('click', function(){
91   -
92 162 var lineIdEvents = LineObj.getLineObj();
93   -
94 163 GetAjaxData.getSectionRouteInfo(lineIdEvents.id,directionUpValue,function(data) {
95   -
96 164 PublicFunctions.linePanlThree(lineIdEvents.id,data,directionUpValue);
97   -
98 165 });
99   -
100 166 });
101 167  
102 168 // 系统规划下行站点
103 169 $('.downSystem').on('click',function() {
104   -
105 170 // 隐藏下行规划
106 171 $('#downToolsMobal').hide();
107   -
108 172 // 弹出正在加载层
109 173 var i = layer.load(0,{offset:['200px', '280px']});
110   -
111 174 /** 修正线路名称 @param:<directionUpValue:方向(上行)> */
112 175 PublicFunctions.lineNameIsHaveInterval(directionDownValue);
113   -
114 176 });
115 177  
116 178 // 下行站点其它规划点击事件
117 179 $('.downManual').on('click',function() {
118   -
119 180 // 加载其它规划选择弹出层mobal页面
120 181 $.get('add_manual_select.html', function(m){
121   -
122 182 $(pjaxContainer).append(m);
123   -
124 183 $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]);
125   -
126 184 });
127   -
128 185 });
129 186  
130 187 // 下行站点新增事件
131 188 $('.module_tools #addDownStation').on('click', function() {
132   -
133 189 /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */
134 190 AddStationObj.setAddStationDiraction(directionDownValue);
135   -
136 191 // 加载选择新增方式mobal
137 192 $.get('add_select.html', function(m){
138   -
139 193 $(pjaxContainer).append(m);
140   -
141 194 $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]);
142   -
143 195 });
144   -
145 196 });
146 197  
147 198 // 修改下行站点mobal页面
148 199 $('.module_tools #editDownStation').on('click', function(){
149   -
150 200 var sel = PublicFunctions.getCurrSelNode(directionDownValue);
151   -
152 201 if(sel.length==0 || sel[0].original.chaildredType !='station'){
153   -
154 202 layer.msg('请先选择要编辑的下行站点!');
155   -
156 203 return;
157 204 }
158   -
159 205 $.get('edit_select.html', function(m){
160   -
161 206 $(pjaxContainer).append(m);
162   -
163 207 $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionDownValue]);
164 208 });
165   -
166 209 });
167 210  
168 211 // 撤销下行站点
169 212 $('.module_tools #deleteDownStation').on('click', function() {
170   -
171 213 PublicFunctions.stationRevoke(directionDownValue);
172   -
173 214 });
174 215  
175 216 // 编辑线路下行走向
176 217 $('.module_tools #editDownlineTrend').on('click', function() {
177   -
178 218 PublicFunctions.editLinePlan(directionDownValue);
179   -
180 219 });
181 220  
182 221 // 线路下行
183 222 $('#leftUpOrDown #downLine').on('click', function(){
184   -
185 223 var lineIdEvents = LineObj.getLineObj();
186   -
187 224 GetAjaxData.getSectionRouteInfo(lineIdEvents.id,directionDownValue,function(data) {
188   -
189 225 PublicFunctions.linePanlThree(lineIdEvents.id,data,directionDownValue);
190   -
191 226 });
192   -
193 227 });
194 228  
195 229 // 生成行单
196 230 $('.module_tools #createUsingSingle').on('click', function() {
197   -
198 231 var lineIdEvents = LineObj.getLineObj();
199   -
200 232 var params = {lineId:lineIdEvents.id};
201   -
202 233 GetAjaxData.createUsingSingle(params,function(data) {
203   -
204 234 if(data.status=='SUCCESS') {
205   -
206 235 // 弹出添加成功提示消息
207 236 layer.msg('生成成功...');
208   -
209 237 }else {
210   -
211 238 // 弹出添加失败提示消息
212 239 layer.msg('生成失败...');
213   -
214 240 }
215   -
216 241 });
217   -
218 242 });
219   -
220 243 });
221 244 \ No newline at end of file
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
... ... @@ -478,7 +478,6 @@ var PublicFunctions = function () {
478 478 $('#upLine').addClass('btn disabled');
479 479  
480 480 var editSectionV = sel[0].original;
481   -
482 481 EditSectionObj.setEitdSection(editSectionV);
483 482  
484 483 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
... ... @@ -634,80 +633,53 @@ var PublicFunctions = function () {
634 633  
635 634 /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */
636 635 linePanlThree : function(lineId,data,direction) {
637   -
638 636 /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */
639 637 GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) {
640   -
641 638 WorldsBMap.clearMarkAndOverlays();
642   -
643 639 var polyline_center;
644   -
645 640 // 如果站点路由数据不为空
646 641 if(resultdata.length>0) {
647   -
648 642 var ceter_index = Math.round(resultdata.length / 2);
649   -
650 643 var ceterPointsStr = resultdata[ceter_index].bJwpoints;
651   -
652 644 var ceterPointsArray = ceterPointsStr.split(' ');
653   -
654 645 polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);
655   -
656 646 // 遍历站点路由数据
657 647 for(var s = 0 ; s<resultdata.length;s++) {
658   -
659 648 // 中心点坐标字符串
660 649 var bJwpointsStr = resultdata[s].bJwpoints;
661   -
662 650 var stationName = resultdata[s].stationName;
663   -
664 651 // 起个中心点坐标字符串
665 652 var bJwpointsArray = bJwpointsStr.split(' ');
666   -
667 653 // 设置中心点
668 654 var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]);
669   -
670 655 /** 在地图上画点 @param:<point_center:中心坐标点> */
671 656 WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1);
672   -
673 657 }
674 658  
675 659 }
676   -
677 660 // 路段数据长度
678 661 var dataLen = data.length;
679 662 //debugger;
680 663 // 如果大于零
681 664 if(dataLen>0) {
682   -
683 665 // 编辑路段数据
684 666 for(var d= 0; d<dataLen;d++){
685   -
686 667 // 地图折线坐标点集合
687 668 var polylineArray = [];
688   -
689 669 // 获取路段折线坐标字符串
690 670 var sectionBsectionVectorStr = data[d].sectionBsectionVector;
691   -
692   - if(sectionBsectionVectorStr==null) {
693   -
  671 + if(sectionBsectionVectorStr==null)
694 672 continue;
695   -
696   - }
697   -
698 673 // 切割段折线坐标字符串
699 674 var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1);
700   -
701 675 // 分割折线坐标字符串
702 676 var lineArray = tempStr.split(',');
703   -
704 677 for(var i = 0;i<lineArray.length;i++) {
705   -
706 678 polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1]));
707   -
708 679 }
709 680 /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */
710   - WorldsBMap.drawingUpline(polylineArray,polyline_center);
  681 + /*WorldsBMap.drawingUpline(polylineArray,polyline_center,data[d]);*/
  682 + WorldsBMap.drawingUpline01(polylineArray,polyline_center,data[d]);
711 683  
712 684 }
713 685 }
... ... @@ -748,48 +720,27 @@ var PublicFunctions = function () {
748 720  
749 721 // 下行
750 722 }else if(diraction ==1) {
751   -
752 723 /** 出事画下行树 @param:<treeDateJson:树数据结构> */
753 724 StationTreeData.downInit(treeDateJson);
754   -
755 725 if(len>0) {
756   -
757 726 $('#downToolsMobal').hide();
758   -
759 727 $('#DowntreeMobal').show();
760   -
761 728 }else {
762   -
763 729 $('#downToolsMobal').show();
764   -
765 730 $('#DowntreeMobal').hide();
766   -
767 731 }
768   -
769 732 }
770   -
771 733 });
772   -
773 734 },
774   -
775 735 isHaveStationName : function(data) {
776   -
777 736 if(data.length>0) {
778   -
779 737 layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){
780   -
781 738 layer.close(index);
782   -
783 739 });
784   -
785 740 return false;
786   -
787 741 }else {
788   -
789 742 return true;
790   -
791 743 }
792   -
793 744 },
794 745  
795 746 editAChangeCssRemoveDisabled : function() {
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
... ... @@ -25,7 +25,7 @@
25 25 var WorldsBMap = function () {
26 26  
27 27 /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆 */
28   - var mapBValue = '';polygon='',polyUpline='',circle='';
  28 + var mapBValue = '';polygon='',polyUpline='',circle='',iseditStatus = false;
29 29  
30 30 var Bmap = {
31 31  
... ... @@ -80,6 +80,14 @@ var WorldsBMap = function () {
80 80 return circle;
81 81 },
82 82  
  83 + getIsEditStatus : function() {
  84 + return iseditStatus;
  85 + },
  86 +
  87 + setIsEditStatus : function(v) {
  88 + iseditStatus = v ;
  89 + },
  90 +
83 91 initDrawingManager: function(map,styleOptions) {
84 92  
85 93 },
... ... @@ -339,40 +347,26 @@ var WorldsBMap = function () {
339 347 },
340 348  
341 349 editPolyUpline : function() {
342   -
343 350 // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增)
344 351 polyUpline.disableMassClear();
345   -
346 352 WorldsBMap.clearMarkAndOverlays();
347   -
348 353 // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增)
349 354 polyUpline.enableMassClear();
350   -
351 355 // 开启线路编辑
352 356 polyUpline.enableEditing();
353   -
354 357 // 添加双击折线保存事件
355 358 polyUpline.addEventListener('dblclick',function(e) {
356   -
357 359 // 关闭
358 360 layer.closeAll();
359   -
360 361 polyUpline.disableEditing();
361   -
362 362 // 获取折线坐标集合
363 363 var editPloyLineArray = polyUpline.getPath();
364   -
365 364 EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
366   -
367 365 polyUpline= '';
368   -
369 366 // 加载修改路段弹出层mobal页面
370 367 $.get('editsection.html', function(m){
371   -
372 368 $(pjaxContainer).append(m);
373   -
374 369 $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]);
375   -
376 370 });
377 371 });
378 372 },
... ... @@ -651,17 +645,14 @@ var WorldsBMap = function () {
651 645 },
652 646  
653 647 // 在地图上画出上行线路走向
654   - drawingUpline : function (polylineArray,polyline_center) {
655   -
  648 + drawingUpline : function (polylineArray,polyline_center,data) {
656 649 /*WorldsBMap.clearMarkAndOverlays();*/
657 650 polyUpline = '';
658   -
659 651 // 创建线路走向
660 652 polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5});
661   -
  653 + // polyUpline.data = data;
662 654 // 把折线添加到地图上
663 655 mapBValue.addOverlay(polyUpline);
664   -
665 656 /*var ceter_index = Math.round(resultdata.length / 2);
666 657  
667 658 var ceterPointsStr = resultdata[ceter_index].bJwpoints;
... ... @@ -669,17 +660,52 @@ var WorldsBMap = function () {
669 660 var ceterPointsArray = ceterPointsStr.split(' ');
670 661  
671 662 var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*/
672   -
673 663 var PanOptions_ ={noAnimation :true};
674   -
675 664 mapBValue.reset();
676   -
677 665 mapBValue.panTo(polyline_center,PanOptions_);
678   -
679 666 mapBValue.panBy(500,-510,PanOptions_);
680   -
681 667 mapBValue.setZoom(14);
682   -
  668 + },
  669 +
  670 +
  671 + // 在地图上画出上行线路走向
  672 + drawingUpline01 : function (polylineArray,polyline_center,data) {
  673 + var polyUpline01 = 'polyline' + '_' + data.sectionrouteId;
  674 + // 创建线路走向
  675 + polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5});
  676 + polyUpline01.data = data;
  677 + // 把折线添加到地图上
  678 + mapBValue.addOverlay(polyUpline01);
  679 + polyUpline01.addEventListener('click',function(e) {
  680 + if(WorldsBMap.getIsEditStatus()) {
  681 + layer.msg('请先保存正在编辑的路段信息...');
  682 + return false;
  683 + }
  684 + polyUpline01.enableEditing();
  685 + WorldsBMap.setIsEditStatus(true);
  686 + });
  687 + // 添加双击折线保存事件
  688 + polyUpline01.addEventListener('dblclick',function(e) {
  689 + WorldsBMap.setIsEditStatus(false);
  690 + // 关闭
  691 + layer.closeAll();
  692 + polyUpline01.disableEditing();
  693 + EditSectionObj.setEitdSection(polyUpline01.data);
  694 + // 获取折线坐标集合
  695 + var editPloyLineArray = polyUpline01.getPath();
  696 + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray));
  697 + // polyUpline= '';
  698 + // 加载修改路段弹出层mobal页面
  699 + $.get('editsection.html', function(m){
  700 + $(pjaxContainer).append(m);
  701 + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]);
  702 + });
  703 + });
  704 + var PanOptions_ ={noAnimation :true};
  705 + mapBValue.reset();
  706 + mapBValue.panTo(polyline_center,PanOptions_);
  707 + mapBValue.panBy(500,-510,PanOptions_);
  708 + mapBValue.setZoom(14);
683 709 },
684 710  
685 711 /** 在地图上画点 @param:<point_center:中心坐标点> */
... ...
src/main/resources/static/pages/base/stationroute/js/stationroute-list-reload.js
... ... @@ -7,38 +7,18 @@
7 7 $(function(){
8 8  
9 9 // 关闭左侧栏
10   - if (!$('body').hasClass('page-sidebar-closed')) {
11   -
12   - $('.menu-toggler.sidebar-toggler').click();
13   -
14   - }
15   -
  10 + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();}
16 11 // 获取参数线路ID
17 12 var id = $.url().param('no');
18   -
19 13 // 如果线路ID不为空
20 14 if(id) {
21   -
22 15 var styleOptions = {
23   -
24   - //边线颜色。
25   - strokeColor : "blue",
26   -
27   - //填充颜色。当参数为空时,圆形将没有填充效果。
28   - fillColor : "blue",
29   -
30   - //边线的宽度,以像素为单位。
31   - strokeWeight : 3,
32   -
33   - //边线透明度,取值范围0 - 1。
34   - strokeOpacity : 0.8,
35   -
36   - //填充的透明度,取值范围0 - 1。
37   - fillOpacity : 0.6,
38   -
39   - //边线的样式,solid或dashed。
40   - strokeStyle : 'solid'
41   -
  16 + strokeColor : "blue",//边线颜色。
  17 + fillColor : "blue",//填充颜色。当参数为空时,圆形将没有填充效果。
  18 + strokeWeight : 3,//边线的宽度,以像素为单位。
  19 + strokeOpacity : 0.8,//边线透明度,取值范围0 - 1。
  20 + fillOpacity : 0.6,//填充的透明度,取值范围0 - 1。
  21 + strokeStyle : 'solid' //边线的样式,solid或dashed。
42 22 };
43 23  
44 24 // 等候500毫秒执行
... ...
src/main/resources/static/pages/base/stationroute/list.html
1 1 <link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" />
2   -
3 2 <div class="portlet-body">
4   -
5 3 <!-- 地图 -->
6 4 <div id="bmap_basic" class="bmaps"></div>
7   -
8   -
9 5 <div class="portlet box protlet-box" style="top:20px">
10   -
11 6 <!-- 左边标题栏 -->
12 7 <div class="portlet-title" style="background-color:#3B3F51">
13 8 <div class="caption">
... ... @@ -17,13 +12,9 @@
17 12 <a href="javascript:;" class="collapse" data-original-title="" title=""> </a>
18 13 </div>
19 14 </div>
20   -
21   -
22 15 <!-- 左边栏 -->
23 16 <div class="portlet-body" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 200px;">
24   -
25 17 <div class="row">
26   -
27 18 <!-- 上下行栏 -->
28 19 <div class="col-md-3 col-sm-3 col-xs-3">
29 20 <ul class="nav nav-tabs tabs-left" id="leftUpOrDown">
... ... @@ -35,13 +26,10 @@
35 26 </li>
36 27 </ul>
37 28 </div>
38   -
39 29 <div class="col-md-9 col-sm-9 col-xs-9">
40 30 <div class="tab-content">
41   -
42 31 <!-- 左边栏上行 -->
43 32 <div class="tab-pane active in" id="stationUp" data-direction="0">
44   -
45 33 <div class="portlet-body" id="uptreeMobal" style="display: none">
46 34 <div class="table-toolbar">
47 35 <div class="row">
... ... @@ -71,8 +59,15 @@
71 59 </li>
72 60 <li class="divider"> </li>
73 61 <li>
74   - <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a>
  62 + <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a>
  63 + </li>
  64 + <li class="divider"> </li>
  65 + <li>
  66 + <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a>
75 67 </li>
  68 + <!-- <li>
  69 + <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a>
  70 + </li> -->
76 71 <!-- <li>
77 72 <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a>
78 73 </li> -->
... ... @@ -88,7 +83,6 @@
88 83 <div id="station_Up_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div>
89 84 </div>
90 85 </div>
91   -
92 86 <!-- 无上行站点添加方式 -->
93 87 <div id="upToolsMobal" class="portlet-body" style="display:none">
94 88 <div class="row">
... ... @@ -156,8 +150,15 @@
156 150 </li>
157 151 <li class="divider"> </li>
158 152 <li>
159   - <a href="javascript:;" id="editDownlineTrend"><i class="fa fa-close"></i> 编辑走向</a>
  153 + <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a>
  154 + </li>
  155 + <li class="divider"> </li>
  156 + <li>
  157 + <a href="javascript:;" id="quoteUp"><i class="fa fa-long-arrow-up"></i> 引用上行路段</a>
160 158 </li>
  159 + <!-- <li>
  160 + <a href="javascript:;" id="editDownlineTrend"><i class="fa fa-close"></i> 编辑走向</a>
  161 + </li> -->
161 162 </ul>
162 163 </div>
163 164 </div>
... ... @@ -170,7 +171,6 @@
170 171 <div id="station_Down_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div>
171 172 </div>
172 173 </div>
173   -
174 174 <!-- 无上行站点添加方式 -->
175 175 <div id="downToolsMobal" class="portlet-body" style="display:none">
176 176 <div class="row">
... ... @@ -213,33 +213,23 @@
213 213 </div>
214 214 <!-- 线路类 -->
215 215 <script src="/pages/base/stationroute/js/line.js"></script>
216   -
217 216 <!-- 新增站点对象类 -->
218 217 <script src="/pages/base/stationroute/js/addstationobj.js"></script>
219   -
220 218 <!-- 修改站点对象类 -->
221 219 <script src="/pages/base/stationroute/js/editstationobj.js"></script>
222   -
223 220 <!-- 修改路段对象类 -->
224 221 <script src="/pages/base/stationroute/js/editsection.js"></script>
225   -
226 222 <!-- 绘图类 -->
227 223 <script src="/pages/base/stationroute/js/drawingManager.js"></script>
228   -
229 224 <!-- 地图类 -->
230 225 <script src="/pages/base/stationroute/js/stationroute-list-map.js"></script>
231   -
232 226 <!-- 函数与方法 -->
233 227 <script src="/pages/base/stationroute/js/stationroute-list-function.js"></script>
234   -
235 228 <!-- ajax请求类 -->
236 229 <script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script>
237   -
238 230 <!-- 树对类 -->
239 231 <script src="/pages/base/stationroute/js/stationroute-list-treedata.js"></script>
240   -
241 232 <!-- reload事件 -->
242 233 <script src="/pages/base/stationroute/js/stationroute-list-reload.js"></script>
243   -
244 234 <!-- 事件监听 -->
245 235 <script src="/pages/base/stationroute/js/stationroute-list-events.js"></script>
246 236 \ No newline at end of file
... ...
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTable.js
... ... @@ -7,123 +7,351 @@
7 7 * TODO:优化开发中
8 8 *
9 9 */
10   -angular.module('ScheduleApp').directive('saTimetable', ['$compile', '$window',
11   - function($compile, $window) {
12   - return {
13   - restrict: 'E',
14   - templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
15   - scope: { // 独立作用域
16   - // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
17   - ds: "=ngModel",
18   - celldbclickFn: "&celldbclick"
19   -
20   - // TODO:
21   -
22   - },
23   - controllerAs: "$saTimeTableCtrl",
24   - bindToController: true,
25   - controller: function() {
26   - var self = this;
27   - this.$$headToolTip = ""; // 表头tooltip信息
28   -
29   - // TODO:
30   - },
31   -
32   - /**,
33   - * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
34   - * @param tElem
35   - * @param tAttrs
36   - * @returns {{pre: Function, post: Function}}
37   - */
38   - compile: function(tElem, tAttrs) {
39   - // 获取属性
40   - var $attr_name = tAttrs["name"]; // 控件的名字
41   - if (!$attr_name) {
42   - throw new Error("saTimeTable指令 name属性required");
  10 +
  11 +angular.module('ScheduleApp').factory(
  12 + 'SaTimeTableUtils',
  13 + [
  14 + function() {
  15 + // 内部班次信息类
  16 + // detailInfo是后台返回的数据,格式如下:
  17 + // {"ttdid":null,"fcsj":"3/17.10","bc_type":null,"xldir":null,"isfb":false,"qdz":null,"zdz":null,"tcc":null}
  18 + var BcInfo = function(detailInfo) {
  19 + this.ttdid = detailInfo && detailInfo.ttdid; // 时刻表id
  20 + this.fcsj = detailInfo && detailInfo.fcsj; // 发车时间
  21 + this.bc_type = detailInfo && detailInfo.bc_type; // 班次类型
  22 + this.xldir = detailInfo && detailInfo.xldir; // 线路上下行
  23 + this.isfb = detailInfo && detailInfo.isfb; // 是否分班
  24 + this.qdz = detailInfo && detailInfo.qdz; // 起点站id
  25 + this.zdz = detailInfo && detailInfo.zdz; // 终点站id
  26 + this.tcc = detailInfo && detailInfo.tcc; // 停车场id
  27 +
  28 + // 路牌信息
  29 + this.lpId = undefined; // id
  30 + this.lpName = undefined; // 名字
  31 +
  32 + // 发车序号,班次数
  33 + this.fcno = undefined;
  34 + this.bcs = undefined;
  35 +
  36 + this.sel = false; // 是否被选中
  37 +
  38 + // 其余函数判定的内部保存值
  39 + this.isCanSel = false;
  40 + this.isValidInfo = false;
  41 +
  42 + };
  43 + BcInfo.prototype.canUpdate = function() { // 是否能更新
  44 + if (this.sel && this.ttdid) {
  45 + return true;
  46 + } else {
  47 + return false;
  48 + }
  49 + };
  50 + BcInfo.prototype.canDelete = function() { // 是否能删除
  51 + if (this.sel && this.ttdid) {
  52 + return true;
  53 + } else {
  54 + return false;
43 55 }
44   - var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
45   -
46   - // 内部controlAs名字
47   - var ctrlAs = '$saTimeTableCtrl';
48   -
49   - // 当前选中的cell
50   - var startRowIndex = undefined;
51   - var startColIndex = undefined;
52   - var shiftKey = false; // shift键是否被按住
53   - var ctrlKey = false; // ctrl是否被按住
54   - // shift选中的cell
55   - var shiftCells = [];
56   -
57   - // TODO:
58   -
59   - return {
60   - pre: function(scope, element, attr) {
61   - // TODO:
62   - //alert(element.find("#tooltipTest").html());
63   - //$compile(element.find("#tooltipTest"))(scope);
64   -
65   - },
66   - post: function(scope, element, attr) {
67   - // TODO:
68   -
69   - // ------------------- dom事件处理function -----------------//
70   - scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
71   - console.log("click " + "row=" + rowindex + ",col=" + colindex);
72   - var internal_ds = scope[ctrlAs].ds.detailInfos;
73   -
74   - if (cell.ttdid) { // 是班次的单元格才能操作
75   - cell.sel = !cell.sel;
  56 + };
  57 + BcInfo.prototype.canSel = function() { // 是否能选中
  58 + if (this.ttdid) {
  59 + this.isCanSel = true;
  60 + return true;
  61 + } else if (this.fcsj) {
  62 + // 没有ttdid,有fcsj标识,
  63 + // 由于是后台返回数据的格式,这种就是路牌和汇总信息,不能选中
  64 + this.isCanSel = false;
  65 + return false;
  66 + } else {
  67 + // 都是空的,表示是一个空班次,可以选中
  68 + this.isCanSel = true;
  69 + return true;
  70 + }
  71 + };
  72 + BcInfo.prototype.validInfo = function() { // 验证班次信息内容是否正确
  73 + if (this.canSel() && this.ttdid) {
  74 + if (this.bc_type == 'in') {
  75 + if (this.qdz == null || this.tcc == null) {
  76 + this.isValidInfo = true;
  77 + return true;
  78 + } else {
  79 + this.isValidInfo = false;
  80 + return false;
  81 + }
  82 + } else if (this.bc_type == 'out') {
  83 + if (this.tcc == null || this.zdz == null) {
  84 + this.isValidInfo = true;
  85 + return true;
  86 + } else {
  87 + this.isValidInfo = false;
  88 + return false;
  89 + }
  90 + } else {
  91 + if (this.qdz == null || this.zdz == null) {
  92 + this.isValidInfo = true;
  93 + return true;
  94 + } else {
  95 + this.isValidInfo = false;
  96 + return false;
  97 + }
  98 + }
  99 + } else {
  100 + this.isValidInfo = true;
  101 + return true;
  102 + }
  103 + };
  104 +
  105 + BcInfo.prototype.where = function(xldir, startTime_h_m, endTime_h_m, isInOut) { // 判定班次是否在指定条件内
  106 + var fcsj_m_h = [];
  107 + fcsj_m_h[0] = parseInt(this.fcsj.split(":")[0]);
  108 + fcsj_m_h[1] = parseInt(this.fcsj.split(":")[1]);
  109 +
  110 + var fcsj = new Date(2000,1,1);
  111 + fcsj.setHours(fcsj_m_h[0]);
  112 + fcsj.setMinutes(fcsj_m_h[1]);
  113 +
  114 + var s_temp_date = new Date(2000, 1, 1);
  115 + var e_temp_date = new Date(2000, 1, 1);
  116 +
  117 + if (xldir == 2) { // 上下行
  118 + // 判定是否要进出场班次
  119 + if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
  120 + return false;
  121 + }
  122 +
  123 + if (startTime_h_m) {
  124 + if (endTime_h_m) {
  125 + s_temp_date.setHours(startTime_h_m[0]);
  126 + s_temp_date.setMinutes(startTime_h_m[1]);
  127 + e_temp_date.setHours(endTime_h_m[0]);
  128 + e_temp_date.setMinutes(endTime_h_m[1]);
  129 + return fcsj >= s_temp_date && fcsj <= e_temp_date;
  130 + } else {
  131 + s_temp_date.setHours(startTime_h_m[0]);
  132 + s_temp_date.setMinutes(startTime_h_m[1]);
  133 + return fcsj >= s_temp_date;
  134 + }
  135 + } else {
  136 + if (endTime_h_m) {
  137 + e_temp_date.setHours(endTime_h_m[0]);
  138 + e_temp_date.setMinutes(endTime_h_m[1]);
  139 + return fcsj <= e_temp_date;
  140 + } else {
  141 + return false;
  142 + }
  143 + }
  144 + } else {
  145 + // 判定是否要进出场班次
  146 + if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
  147 + return false;
  148 + }
  149 +
  150 + if (xldir == this.xldir) {
  151 + if (startTime_h_m) {
  152 + if (endTime_h_m) {
  153 + s_temp_date.setHours(startTime_h_m[0]);
  154 + s_temp_date.setMinutes(startTime_h_m[1]);
  155 + e_temp_date.setHours(endTime_h_m[0]);
  156 + e_temp_date.setMinutes(endTime_h_m[1]);
  157 + return fcsj >= s_temp_date && fcsj <= e_temp_date;
  158 + } else {
  159 + s_temp_date.setHours(startTime_h_m[0]);
  160 + s_temp_date.setMinutes(startTime_h_m[1]);
  161 + return fcsj >= s_temp_date;
  162 + }
  163 + } else {
  164 + if (endTime_h_m) {
  165 + e_temp_date.setHours(endTime_h_m[0]);
  166 + e_temp_date.setMinutes(endTime_h_m[1]);
  167 + return fcsj <= e_temp_date;
  168 + } else {
  169 + return true;
76 170 }
  171 + }
  172 + } else {
  173 + return false;
  174 + }
  175 + }
  176 + };
  177 +
  178 + return {
  179 + createBcInfo: function(detailInfo, lpDetailInfo) {
  180 + var bcInfo = new BcInfo(detailInfo);
  181 + if (!bcInfo.ttdid && bcInfo.fcsj && bcInfo.fcsj.indexOf('_') > 0) {
  182 + var temp_info = bcInfo.fcsj.split('_');
  183 + // 添加信息的属性
  184 + bcInfo.lpName = temp_info[1];
  185 + bcInfo.lpId = temp_info[0];
  186 + // 修改fcsj为路牌名字
  187 + bcInfo.fcsj = bcInfo.lpName;
  188 + }
  189 +
  190 + // 重新设定路牌信息
  191 + if (!bcInfo.lpId) {
  192 + bcInfo.lpId = lpDetailInfo.lpId;
  193 + bcInfo.lpName = lpDetailInfo.lpName;
  194 + }
77 195  
78   - };
79   - scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
80   - if (cell.ttdid) { // 是班次的单元格才能操作
81   - if ($attr_celldbclick) {
82   - // 注意调用方法
83   - scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  196 + return bcInfo;
  197 + },
  198 + initTTInfoDetail: function(formobj, cellinfo, colinfo, xlid, xlname, ttid, ttname) {
  199 + formobj.xl = {};
  200 + formobj.xl.id = xlid;
  201 + formobj.xl.name = xlname;
  202 + formobj.ttinfo = {};
  203 + formobj.ttinfo.id = ttid;
  204 + formobj.ttinfo.name = ttname;
  205 + formobj.lp = {};
  206 + formobj.lp.id = cellinfo.lpId;
  207 + formobj.lp.lpName = cellinfo.lpName;
  208 + formobj.fcno = cellinfo.fcno;
  209 + formobj.bcs = cellinfo.bcs;
  210 + formobj.isFB = cellinfo.isfb;
  211 +
  212 + formobj.bcType = colinfo.bc_type;
  213 + formobj.xlDir = colinfo.xldir;
  214 + if (colinfo.qdz) {
  215 + formobj.qdz = {};
  216 + formobj.qdz.id = colinfo.qdz;
  217 + }
  218 + if (colinfo.zdz) {
  219 + formobj.zdz = {};
  220 + formobj.zdz.id = colinfo.zdz;
  221 + }
  222 + if (colinfo.tcc) {
  223 + formobj.tcc = {};
  224 + formobj.tcc.id = colinfo.tcc;
  225 + }
  226 +
  227 + }
  228 + };
  229 + }
  230 + ]
  231 +);
  232 +
  233 +angular.module('ScheduleApp').directive(
  234 + 'saTimetable',
  235 + [
  236 + '$compile',
  237 + '$window',
  238 + function($compile, $window) {
  239 + return {
  240 + restrict: 'E',
  241 + templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
  242 + scope: { // 独立作用域
  243 + // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
  244 + ds: "=ngModel",
  245 + celldbclickFn: "&celldbclick"
  246 +
  247 + // TODO:
  248 +
  249 + },
  250 + controllerAs: "$saTimeTableCtrl",
  251 + bindToController: true,
  252 + controller: function() {
  253 + var self = this;
  254 + this.$$headToolTip = ""; // 表头tooltip信息
  255 +
  256 + // TODO:
  257 + },
  258 +
  259 + /**,
  260 + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
  261 + * @param tElem
  262 + * @param tAttrs
  263 + * @returns {{pre: Function, post: Function}}
  264 + */
  265 + compile: function(tElem, tAttrs) {
  266 + // 获取属性
  267 + var $attr_name = tAttrs["name"]; // 控件的名字
  268 + if (!$attr_name) {
  269 + throw new Error("saTimeTable指令 name属性required");
  270 + }
  271 + var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
  272 +
  273 + // 内部controlAs名字
  274 + var ctrlAs = '$saTimeTableCtrl';
  275 +
  276 + // 当前选中的cell
  277 + var startRowIndex = undefined;
  278 + var startColIndex = undefined;
  279 + var shiftKey = false; // shift键是否被按住
  280 + var ctrlKey = false; // ctrl是否被按住
  281 + // shift选中的cell
  282 + var shiftCells = [];
  283 +
  284 + // TODO:
  285 +
  286 + return {
  287 + pre: function(scope, element, attr) {
  288 + // TODO:
  289 + //alert(element.find("#tooltipTest").html());
  290 + //$compile(element.find("#tooltipTest"))(scope);
  291 +
  292 + },
  293 + post: function(scope, element, attr) {
  294 + // TODO:
  295 +
  296 + // ------------------- dom事件处理function -----------------//
  297 + scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
  298 + console.log("click " + "row=" + rowindex + ",col=" + colindex);
  299 + var internal_ds = scope[ctrlAs].ds.detailInfos;
  300 +
  301 + if (cell.canSel()) { // 是班次的单元格才能操作
  302 + cell.sel = !cell.sel;
84 303 }
85   - }
86   - };
87   -
88   - // ------------------- 监控function ------------------//
89   - // 监控明细数据,生成表头的tooltip
90   - scope.$watch(
91   - function() {
92   - return scope[ctrlAs].ds;
93   - },
94   - function(newValue, oldValue) {
95   - if (newValue &&
96   - newValue.detailHeads &&
97   - newValue.detailHeads.length > 0) {
98   - var tooltip = [];
99   - tooltip.push("出场");
100   - angular.forEach(newValue.detailHeads, function(value) {
101   - if (value != "出场" &&
102   - value != "路牌" &&
103   - value != "进场" &&
104   - value != "空驶班次/空驶里程" &&
105   - value != "运营班次/运营里程" ) {
106   - var exist = false;
107   - angular.forEach(tooltip, function(tip) {
108   - if (tip == value) {
109   - exist = true;
  304 +
  305 + };
  306 + scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
  307 + if (cell.canSel()) { // 是班次的单元格才能操作
  308 + if ($attr_celldbclick) {
  309 + // 注意调用方法
  310 + scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  311 + }
  312 + }
  313 + };
  314 +
  315 + // ------------------- 监控function ------------------//
  316 + // 监控明细数据,生成表头的tooltip
  317 + scope.$watch(
  318 + function() {
  319 + return scope[ctrlAs].ds;
  320 + },
  321 + function(newValue, oldValue) {
  322 + if (newValue &&
  323 + newValue.detailHeads &&
  324 + newValue.detailHeads.length > 0) {
  325 + var tooltip = [];
  326 + tooltip.push("出场");
  327 + angular.forEach(newValue.detailHeads, function(value) {
  328 + if (value != "出场" &&
  329 + value != "路牌" &&
  330 + value != "进场" &&
  331 + value != "空驶班次/空驶里程" &&
  332 + value != "运营班次/运营里程" ) {
  333 + var exist = false;
  334 + angular.forEach(tooltip, function(tip) {
  335 + if (tip == value) {
  336 + exist = true;
  337 + }
  338 + });
  339 + if (!exist) {
  340 + tooltip.push(value);
110 341 }
111   - });
112   - if (!exist) {
113   - tooltip.push(value);
114 342 }
115   - }
116   - });
117   - tooltip.push("进场");
118   - scope[ctrlAs].$$headToolTip = tooltip.join(",");
119   - }
120   - },
121   - true
122   - )
123   - }
124   - };
125   - }
  343 + });
  344 + tooltip.push("进场");
  345 + scope[ctrlAs].$$headToolTip = tooltip.join(",");
  346 + }
  347 + },
  348 + true
  349 + )
  350 + }
  351 + };
  352 + }
126 353  
127   - };
128   - }
129   -]);
  354 + };
  355 + }
  356 + ]
  357 +);
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
... ... @@ -3705,126 +3705,354 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saBcgroup&#39;, [
3705 3705 * TODO:优化开发中
3706 3706 *
3707 3707 */
3708   -angular.module('ScheduleApp').directive('saTimetable', ['$compile', '$window',
3709   - function($compile, $window) {
3710   - return {
3711   - restrict: 'E',
3712   - templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
3713   - scope: { // 独立作用域
3714   - // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
3715   - ds: "=ngModel",
3716   - celldbclickFn: "&celldbclick"
3717 3708  
3718   - // TODO:
  3709 +angular.module('ScheduleApp').factory(
  3710 + 'SaTimeTableUtils',
  3711 + [
  3712 + function() {
  3713 + // 内部班次信息类
  3714 + // detailInfo是后台返回的数据,格式如下:
  3715 + // {"ttdid":null,"fcsj":"3/17.10","bc_type":null,"xldir":null,"isfb":false,"qdz":null,"zdz":null,"tcc":null}
  3716 + var BcInfo = function(detailInfo) {
  3717 + this.ttdid = detailInfo && detailInfo.ttdid; // 时刻表id
  3718 + this.fcsj = detailInfo && detailInfo.fcsj; // 发车时间
  3719 + this.bc_type = detailInfo && detailInfo.bc_type; // 班次类型
  3720 + this.xldir = detailInfo && detailInfo.xldir; // 线路上下行
  3721 + this.isfb = detailInfo && detailInfo.isfb; // 是否分班
  3722 + this.qdz = detailInfo && detailInfo.qdz; // 起点站id
  3723 + this.zdz = detailInfo && detailInfo.zdz; // 终点站id
  3724 + this.tcc = detailInfo && detailInfo.tcc; // 停车场id
  3725 +
  3726 + // 路牌信息
  3727 + this.lpId = undefined; // id
  3728 + this.lpName = undefined; // 名字
  3729 +
  3730 + // 发车序号,班次数
  3731 + this.fcno = undefined;
  3732 + this.bcs = undefined;
  3733 +
  3734 + this.sel = false; // 是否被选中
  3735 +
  3736 + // 其余函数判定的内部保存值
  3737 + this.isCanSel = false;
  3738 + this.isValidInfo = false;
3719 3739  
3720   - },
3721   - controllerAs: "$saTimeTableCtrl",
3722   - bindToController: true,
3723   - controller: function() {
3724   - var self = this;
3725   - this.$$headToolTip = ""; // 表头tooltip信息
  3740 + };
  3741 + BcInfo.prototype.canUpdate = function() { // 是否能更新
  3742 + if (this.sel && this.ttdid) {
  3743 + return true;
  3744 + } else {
  3745 + return false;
  3746 + }
  3747 + };
  3748 + BcInfo.prototype.canDelete = function() { // 是否能删除
  3749 + if (this.sel && this.ttdid) {
  3750 + return true;
  3751 + } else {
  3752 + return false;
  3753 + }
  3754 + };
  3755 + BcInfo.prototype.canSel = function() { // 是否能选中
  3756 + if (this.ttdid) {
  3757 + this.isCanSel = true;
  3758 + return true;
  3759 + } else if (this.fcsj) {
  3760 + // 没有ttdid,有fcsj标识,
  3761 + // 由于是后台返回数据的格式,这种就是路牌和汇总信息,不能选中
  3762 + this.isCanSel = false;
  3763 + return false;
  3764 + } else {
  3765 + // 都是空的,表示是一个空班次,可以选中
  3766 + this.isCanSel = true;
  3767 + return true;
  3768 + }
  3769 + };
  3770 + BcInfo.prototype.validInfo = function() { // 验证班次信息内容是否正确
  3771 + if (this.canSel() && this.ttdid) {
  3772 + if (this.bc_type == 'in') {
  3773 + if (this.qdz == null || this.tcc == null) {
  3774 + this.isValidInfo = true;
  3775 + return true;
  3776 + } else {
  3777 + this.isValidInfo = false;
  3778 + return false;
  3779 + }
  3780 + } else if (this.bc_type == 'out') {
  3781 + if (this.tcc == null || this.zdz == null) {
  3782 + this.isValidInfo = true;
  3783 + return true;
  3784 + } else {
  3785 + this.isValidInfo = false;
  3786 + return false;
  3787 + }
  3788 + } else {
  3789 + if (this.qdz == null || this.zdz == null) {
  3790 + this.isValidInfo = true;
  3791 + return true;
  3792 + } else {
  3793 + this.isValidInfo = false;
  3794 + return false;
  3795 + }
  3796 + }
  3797 + } else {
  3798 + this.isValidInfo = true;
  3799 + return true;
  3800 + }
  3801 + };
3726 3802  
3727   - // TODO:
3728   - },
  3803 + BcInfo.prototype.where = function(xldir, startTime_h_m, endTime_h_m, isInOut) { // 判定班次是否在指定条件内
  3804 + var fcsj_m_h = [];
  3805 + fcsj_m_h[0] = parseInt(this.fcsj.split(":")[0]);
  3806 + fcsj_m_h[1] = parseInt(this.fcsj.split(":")[1]);
3729 3807  
3730   - /**,
3731   - * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
3732   - * @param tElem
3733   - * @param tAttrs
3734   - * @returns {{pre: Function, post: Function}}
3735   - */
3736   - compile: function(tElem, tAttrs) {
3737   - // 获取属性
3738   - var $attr_name = tAttrs["name"]; // 控件的名字
3739   - if (!$attr_name) {
3740   - throw new Error("saTimeTable指令 name属性required");
  3808 + var fcsj = new Date(2000,1,1);
  3809 + fcsj.setHours(fcsj_m_h[0]);
  3810 + fcsj.setMinutes(fcsj_m_h[1]);
  3811 +
  3812 + var s_temp_date = new Date(2000, 1, 1);
  3813 + var e_temp_date = new Date(2000, 1, 1);
  3814 +
  3815 + if (xldir == 2) { // 上下行
  3816 + // 判定是否要进出场班次
  3817 + if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
  3818 + return false;
  3819 + }
  3820 +
  3821 + if (startTime_h_m) {
  3822 + if (endTime_h_m) {
  3823 + s_temp_date.setHours(startTime_h_m[0]);
  3824 + s_temp_date.setMinutes(startTime_h_m[1]);
  3825 + e_temp_date.setHours(endTime_h_m[0]);
  3826 + e_temp_date.setMinutes(endTime_h_m[1]);
  3827 + return fcsj >= s_temp_date && fcsj <= e_temp_date;
  3828 + } else {
  3829 + s_temp_date.setHours(startTime_h_m[0]);
  3830 + s_temp_date.setMinutes(startTime_h_m[1]);
  3831 + return fcsj >= s_temp_date;
  3832 + }
  3833 + } else {
  3834 + if (endTime_h_m) {
  3835 + e_temp_date.setHours(endTime_h_m[0]);
  3836 + e_temp_date.setMinutes(endTime_h_m[1]);
  3837 + return fcsj <= e_temp_date;
  3838 + } else {
  3839 + return false;
  3840 + }
  3841 + }
  3842 + } else {
  3843 + // 判定是否要进出场班次
  3844 + if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
  3845 + return false;
  3846 + }
  3847 +
  3848 + if (xldir == this.xldir) {
  3849 + if (startTime_h_m) {
  3850 + if (endTime_h_m) {
  3851 + s_temp_date.setHours(startTime_h_m[0]);
  3852 + s_temp_date.setMinutes(startTime_h_m[1]);
  3853 + e_temp_date.setHours(endTime_h_m[0]);
  3854 + e_temp_date.setMinutes(endTime_h_m[1]);
  3855 + return fcsj >= s_temp_date && fcsj <= e_temp_date;
  3856 + } else {
  3857 + s_temp_date.setHours(startTime_h_m[0]);
  3858 + s_temp_date.setMinutes(startTime_h_m[1]);
  3859 + return fcsj >= s_temp_date;
  3860 + }
  3861 + } else {
  3862 + if (endTime_h_m) {
  3863 + e_temp_date.setHours(endTime_h_m[0]);
  3864 + e_temp_date.setMinutes(endTime_h_m[1]);
  3865 + return fcsj <= e_temp_date;
  3866 + } else {
  3867 + return true;
  3868 + }
  3869 + }
  3870 + } else {
  3871 + return false;
  3872 + }
3741 3873 }
3742   - var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
  3874 + };
3743 3875  
3744   - // 内部controlAs名字
3745   - var ctrlAs = '$saTimeTableCtrl';
  3876 + return {
  3877 + createBcInfo: function(detailInfo, lpDetailInfo) {
  3878 + var bcInfo = new BcInfo(detailInfo);
  3879 + if (!bcInfo.ttdid && bcInfo.fcsj && bcInfo.fcsj.indexOf('_') > 0) {
  3880 + var temp_info = bcInfo.fcsj.split('_');
  3881 + // 添加信息的属性
  3882 + bcInfo.lpName = temp_info[1];
  3883 + bcInfo.lpId = temp_info[0];
  3884 + // 修改fcsj为路牌名字
  3885 + bcInfo.fcsj = bcInfo.lpName;
  3886 + }
3746 3887  
3747   - // 当前选中的cell
3748   - var startRowIndex = undefined;
3749   - var startColIndex = undefined;
3750   - var shiftKey = false; // shift键是否被按住
3751   - var ctrlKey = false; // ctrl是否被按住
3752   - // shift选中的cell
3753   - var shiftCells = [];
  3888 + // 重新设定路牌信息
  3889 + if (!bcInfo.lpId) {
  3890 + bcInfo.lpId = lpDetailInfo.lpId;
  3891 + bcInfo.lpName = lpDetailInfo.lpName;
  3892 + }
3754 3893  
3755   - // TODO:
  3894 + return bcInfo;
  3895 + },
  3896 + initTTInfoDetail: function(formobj, cellinfo, colinfo, xlid, xlname, ttid, ttname) {
  3897 + formobj.xl = {};
  3898 + formobj.xl.id = xlid;
  3899 + formobj.xl.name = xlname;
  3900 + formobj.ttinfo = {};
  3901 + formobj.ttinfo.id = ttid;
  3902 + formobj.ttinfo.name = ttname;
  3903 + formobj.lp = {};
  3904 + formobj.lp.id = cellinfo.lpId;
  3905 + formobj.lp.lpName = cellinfo.lpName;
  3906 + formobj.fcno = cellinfo.fcno;
  3907 + formobj.bcs = cellinfo.bcs;
  3908 + formobj.isFB = cellinfo.isfb;
  3909 +
  3910 + formobj.bcType = colinfo.bc_type;
  3911 + formobj.xlDir = colinfo.xldir;
  3912 + if (colinfo.qdz) {
  3913 + formobj.qdz = {};
  3914 + formobj.qdz.id = colinfo.qdz;
  3915 + }
  3916 + if (colinfo.zdz) {
  3917 + formobj.zdz = {};
  3918 + formobj.zdz.id = colinfo.zdz;
  3919 + }
  3920 + if (colinfo.tcc) {
  3921 + formobj.tcc = {};
  3922 + formobj.tcc.id = colinfo.tcc;
  3923 + }
3756 3924  
3757   - return {
3758   - pre: function(scope, element, attr) {
3759   - // TODO:
3760   - //alert(element.find("#tooltipTest").html());
3761   - //$compile(element.find("#tooltipTest"))(scope);
  3925 + }
  3926 + };
  3927 + }
  3928 + ]
  3929 +);
3762 3930  
3763   - },
3764   - post: function(scope, element, attr) {
3765   - // TODO:
  3931 +angular.module('ScheduleApp').directive(
  3932 + 'saTimetable',
  3933 + [
  3934 + '$compile',
  3935 + '$window',
  3936 + function($compile, $window) {
  3937 + return {
  3938 + restrict: 'E',
  3939 + templateUrl: '/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTableTemplate.html',
  3940 + scope: { // 独立作用域
  3941 + // 注意:数据暂时从外部ngModel里获取,以后内部自己处理
  3942 + ds: "=ngModel",
  3943 + celldbclickFn: "&celldbclick"
3766 3944  
3767   - // ------------------- dom事件处理function -----------------//
3768   - scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
3769   - console.log("click " + "row=" + rowindex + ",col=" + colindex);
3770   - var internal_ds = scope[ctrlAs].ds.detailInfos;
  3945 + // TODO:
3771 3946  
3772   - if (cell.ttdid) { // 是班次的单元格才能操作
3773   - cell.sel = !cell.sel;
3774   - }
  3947 + },
  3948 + controllerAs: "$saTimeTableCtrl",
  3949 + bindToController: true,
  3950 + controller: function() {
  3951 + var self = this;
  3952 + this.$$headToolTip = ""; // 表头tooltip信息
3775 3953  
3776   - };
3777   - scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
3778   - if (cell.ttdid) { // 是班次的单元格才能操作
3779   - if ($attr_celldbclick) {
3780   - // 注意调用方法
3781   - scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  3954 + // TODO:
  3955 + },
  3956 +
  3957 + /**,
  3958 + * compile阶段,angular还没有编译模版,根据需要可以修改模版dom
  3959 + * @param tElem
  3960 + * @param tAttrs
  3961 + * @returns {{pre: Function, post: Function}}
  3962 + */
  3963 + compile: function(tElem, tAttrs) {
  3964 + // 获取属性
  3965 + var $attr_name = tAttrs["name"]; // 控件的名字
  3966 + if (!$attr_name) {
  3967 + throw new Error("saTimeTable指令 name属性required");
  3968 + }
  3969 + var $attr_celldbclick = tAttrs["celldbclick"]; // 单元格双击事件名
  3970 +
  3971 + // 内部controlAs名字
  3972 + var ctrlAs = '$saTimeTableCtrl';
  3973 +
  3974 + // 当前选中的cell
  3975 + var startRowIndex = undefined;
  3976 + var startColIndex = undefined;
  3977 + var shiftKey = false; // shift键是否被按住
  3978 + var ctrlKey = false; // ctrl是否被按住
  3979 + // shift选中的cell
  3980 + var shiftCells = [];
  3981 +
  3982 + // TODO:
  3983 +
  3984 + return {
  3985 + pre: function(scope, element, attr) {
  3986 + // TODO:
  3987 + //alert(element.find("#tooltipTest").html());
  3988 + //$compile(element.find("#tooltipTest"))(scope);
  3989 +
  3990 + },
  3991 + post: function(scope, element, attr) {
  3992 + // TODO:
  3993 +
  3994 + // ------------------- dom事件处理function -----------------//
  3995 + scope[ctrlAs].$$cell_click = function(rowindex, colindex, cell) {
  3996 + console.log("click " + "row=" + rowindex + ",col=" + colindex);
  3997 + var internal_ds = scope[ctrlAs].ds.detailInfos;
  3998 +
  3999 + if (cell.canSel()) { // 是班次的单元格才能操作
  4000 + cell.sel = !cell.sel;
3782 4001 }
3783   - }
3784   - };
3785 4002  
3786   - // ------------------- 监控function ------------------//
3787   - // 监控明细数据,生成表头的tooltip
3788   - scope.$watch(
3789   - function() {
3790   - return scope[ctrlAs].ds;
3791   - },
3792   - function(newValue, oldValue) {
3793   - if (newValue &&
3794   - newValue.detailHeads &&
3795   - newValue.detailHeads.length > 0) {
3796   - var tooltip = [];
3797   - tooltip.push("出场");
3798   - angular.forEach(newValue.detailHeads, function(value) {
3799   - if (value != "出场" &&
3800   - value != "路牌" &&
3801   - value != "进场" &&
3802   - value != "空驶班次/空驶里程" &&
3803   - value != "运营班次/运营里程" ) {
3804   - var exist = false;
3805   - angular.forEach(tooltip, function(tip) {
3806   - if (tip == value) {
3807   - exist = true;
  4003 + };
  4004 + scope[ctrlAs].$$cell_dbclick = function(rowindex, colindex, cell) {
  4005 + if (cell.canSel()) { // 是班次的单元格才能操作
  4006 + if ($attr_celldbclick) {
  4007 + // 注意调用方法
  4008 + scope[ctrlAs].celldbclickFn()(rowindex, colindex);
  4009 + }
  4010 + }
  4011 + };
  4012 +
  4013 + // ------------------- 监控function ------------------//
  4014 + // 监控明细数据,生成表头的tooltip
  4015 + scope.$watch(
  4016 + function() {
  4017 + return scope[ctrlAs].ds;
  4018 + },
  4019 + function(newValue, oldValue) {
  4020 + if (newValue &&
  4021 + newValue.detailHeads &&
  4022 + newValue.detailHeads.length > 0) {
  4023 + var tooltip = [];
  4024 + tooltip.push("出场");
  4025 + angular.forEach(newValue.detailHeads, function(value) {
  4026 + if (value != "出场" &&
  4027 + value != "路牌" &&
  4028 + value != "进场" &&
  4029 + value != "空驶班次/空驶里程" &&
  4030 + value != "运营班次/运营里程" ) {
  4031 + var exist = false;
  4032 + angular.forEach(tooltip, function(tip) {
  4033 + if (tip == value) {
  4034 + exist = true;
  4035 + }
  4036 + });
  4037 + if (!exist) {
  4038 + tooltip.push(value);
3808 4039 }
3809   - });
3810   - if (!exist) {
3811   - tooltip.push(value);
3812 4040 }
3813   - }
3814   - });
3815   - tooltip.push("进场");
3816   - scope[ctrlAs].$$headToolTip = tooltip.join(",");
3817   - }
3818   - },
3819   - true
3820   - )
3821   - }
3822   - };
3823   - }
  4041 + });
  4042 + tooltip.push("进场");
  4043 + scope[ctrlAs].$$headToolTip = tooltip.join(",");
  4044 + }
  4045 + },
  4046 + true
  4047 + )
  4048 + }
  4049 + };
  4050 + }
3824 4051  
3825   - };
3826   - }
3827   -]);
  4052 + };
  4053 + }
  4054 + ]
  4055 +);
3828 4056  
3829 4057 /**
3830 4058 * saScpdate指令(非通用指令,只在排版计划form中使用)。
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
... ... @@ -1149,7 +1149,7 @@ ScheduleApp.config([
1149 1149 }
1150 1150 })
1151 1151 .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑
1152   - url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname',
  1152 + url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname/:rowindex/:colindex',
1153 1153 views: {
1154 1154 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'}
1155 1155 },
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
... ... @@ -59,6 +59,12 @@
59 59 批量修改
60 60 </a>
61 61 </li>
  62 + <li>
  63 + <a href="javascript:" class="tool-action" ng-click="ctrl.deleteInfos()">
  64 + <i class="fa fa-file-excel-o"></i>
  65 + 批量删除
  66 + </a>
  67 + </li>
62 68 <li class="divider"></li>
63 69 <li>
64 70 <a href="javascript:" class="tool-action" ng-click="ctrl.clearsel()">
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/route.js
... ... @@ -82,7 +82,7 @@ ScheduleApp.config([
82 82 }
83 83 })
84 84 .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑
85   - url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname',
  85 + url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname/:rowindex/:colindex',
86 86 views: {
87 87 "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'}
88 88 },
... ...
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js
... ... @@ -5,7 +5,8 @@ angular.module(&#39;ScheduleApp&#39;).factory(
5 5 'TimeTableDetailManageService_g',
6 6 '$state',
7 7 '$q',
8   - function(service, $state, $q) {
  8 + 'SaTimeTableUtils',
  9 + function(service, $state, $q, SaTimeTableUtils) {
9 10  
10 11 // 查询对象类
11 12 var queryClass = service.rest;
... ... @@ -14,6 +15,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
14 15 var editInfo = {
15 16 detailHeads: [], // 时刻表头信息
16 17 detailInfos: [], // 时刻表明细信息
  18 + columnBcInfo: [], // 每列班次的信息
17 19 yydesc: "" // 营运汇总描述
18 20 };
19 21  
... ... @@ -34,6 +36,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
34 36 editInfo = {
35 37 detailHeads: [], // 时刻表头信息
36 38 detailInfos: [], // 时刻表明细信息
  39 + columnBcInfo: [], // 每列班次的信息(保存每列的站点信息)
37 40 yydesc: "" // 营运汇总描述
38 41 };
39 42  
... ... @@ -42,116 +45,37 @@ angular.module(&#39;ScheduleApp&#39;).factory(
42 45 editInfo.detailHeads = result.header;
43 46 editInfo.detailInfos = result.contents;
44 47 editInfo.yydesc = result.yy_desc;
  48 + editInfo.columnBcInfo = [editInfo.detailInfos[0].length];
45 49  
46   - // detailInfos里添加是否选中的flag
  50 + // 将editInfo.detailInfos中的值重新修正一遍
47 51 for (var i = 0; i < editInfo.detailInfos.length; i++) {
48 52 for (var j = 0; j < editInfo.detailInfos[i].length; j++) {
49   - editInfo.detailInfos[i][j].sel = false;
50   - // 给cell定义一个valid属性,及方法,判定这个班次的数据是否正常
51   - editInfo.detailInfos[i][j].invalidFlag = true;
52   - editInfo.detailInfos[i][j].validInfo = function() { // 验证方法
53   - if (!this.ttdid) {
54   - this.invalidFlag = false;
55   - return;
56   - }
57   -
58   - if (this.bc_type == 'in') {
59   - if (this.qdz == null || this.tcc == null) {
60   - this.invalidFlag = true;
61   - } else {
62   - this.invalidFlag = false;
63   - }
64   - } else if (this.bc_type == 'out') {
65   - if (this.tcc == null || this.zdz == null) {
66   - this.invalidFlag = true;
67   - } else {
68   - this.invalidFlag = false;
69   - }
70   - } else {
71   - if (this.qdz == null || this.zdz == null) {
72   - this.invalidFlag = true;
73   - } else {
74   - this.invalidFlag = false;
75   - }
76   - }
77   - };
78   - editInfo.detailInfos[i][j].where = function(xldir, startTime_h_m, endTime_h_m, isInOut) { // where方法
79   - var fcsj_m_h = [];
80   - fcsj_m_h[0] = parseInt(this.fcsj.split(":")[0]);
81   - fcsj_m_h[1] = parseInt(this.fcsj.split(":")[1]);
82   -
83   - var fcsj = new Date(2000,1,1);
84   - fcsj.setHours(fcsj_m_h[0]);
85   - fcsj.setMinutes(fcsj_m_h[1]);
86   -
87   - var s_temp_date = new Date(2000, 1, 1);
88   - var e_temp_date = new Date(2000, 1, 1);
89   -
90   - if (xldir == 2) { // 上下行
91   - // 判定是否要进出场班次
92   - if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
93   - return false;
94   - }
95   -
96   - if (startTime_h_m) {
97   - if (endTime_h_m) {
98   - s_temp_date.setHours(startTime_h_m[0]);
99   - s_temp_date.setMinutes(startTime_h_m[1]);
100   - e_temp_date.setHours(endTime_h_m[0]);
101   - e_temp_date.setMinutes(endTime_h_m[1]);
102   - return fcsj >= s_temp_date && fcsj <= e_temp_date;
103   - } else {
104   - s_temp_date.setHours(startTime_h_m[0]);
105   - s_temp_date.setMinutes(startTime_h_m[1]);
106   - return fcsj >= s_temp_date;
107   - }
108   - } else {
109   - if (endTime_h_m) {
110   - e_temp_date.setHours(endTime_h_m[0]);
111   - e_temp_date.setMinutes(endTime_h_m[1]);
112   - return fcsj <= e_temp_date;
113   - } else {
114   - return false;
115   - }
116   - }
117   - } else {
118   - // 判定是否要进出场班次
119   - if (isInOut == false && (this.bc_type == "in" || this.bc_type == "out")) {
120   - return false;
121   - }
122   -
123   - if (xldir == this.xldir) {
124   - if (startTime_h_m) {
125   - if (endTime_h_m) {
126   - s_temp_date.setHours(startTime_h_m[0]);
127   - s_temp_date.setMinutes(startTime_h_m[1]);
128   - e_temp_date.setHours(endTime_h_m[0]);
129   - e_temp_date.setMinutes(endTime_h_m[1]);
130   - return fcsj >= s_temp_date && fcsj <= e_temp_date;
131   - } else {
132   - s_temp_date.setHours(startTime_h_m[0]);
133   - s_temp_date.setMinutes(startTime_h_m[1]);
134   - return fcsj >= s_temp_date;
135   - }
136   - } else {
137   - if (endTime_h_m) {
138   - e_temp_date.setHours(endTime_h_m[0]);
139   - e_temp_date.setMinutes(endTime_h_m[1]);
140   - return fcsj <= e_temp_date;
141   - } else {
142   - return true;
143   - }
144   - }
145   - } else {
146   - return false;
147   - }
148   - }
149   -
150   - };
151   - editInfo.detailInfos[i][j].validInfo();
  53 + var detailInfo = SaTimeTableUtils.createBcInfo(
  54 + editInfo.detailInfos[i][j],
  55 + editInfo.detailInfos[i][0]
  56 + );
  57 + detailInfo.fcno = j;
  58 + detailInfo.bcs = i * (editInfo.detailInfos[i].length - 3) + j;
  59 + detailInfo.validInfo();
  60 + editInfo.detailInfos[i][j] = detailInfo;
  61 +
  62 + if (!editInfo.columnBcInfo[j]) {
  63 + editInfo.columnBcInfo[j] = {};
  64 + }
  65 + if (!editInfo.columnBcInfo[j].bc_type && detailInfo.ttdid) {
  66 + // 设定站点信息
  67 + editInfo.columnBcInfo[j].bc_type = detailInfo.bc_type;
  68 + editInfo.columnBcInfo[j].xldir = detailInfo.xldir;
  69 + editInfo.columnBcInfo[j].isfb = detailInfo.isfb;
  70 + editInfo.columnBcInfo[j].qdz = detailInfo.qdz;
  71 + editInfo.columnBcInfo[j].zdz = detailInfo.zdz;
  72 + editInfo.columnBcInfo[j].tcc = detailInfo.tcc;
  73 + }
152 74  
153 75 }
154 76 }
  77 +
  78 + console.log(editInfo.columnBcInfo);
155 79 } else {
156 80 alert(result.msg);
157 81 }
... ... @@ -169,6 +93,57 @@ angular.module(&#39;ScheduleApp&#39;).factory(
169 93 return flag;
170 94 },
171 95  
  96 + deleteInfos: function() { // 批量删除数据
  97 + var deferred = $q.defer();
  98 +
  99 + // 找出所有选中的ttinfodetailids
  100 + var ttinfodetailIds = [];
  101 + for (var i = 0; i < editInfo.detailInfos.length; i++) {
  102 + for (var j = 0; j < editInfo.detailInfos[i].length; j++) {
  103 + if (editInfo.detailInfos[i][j].canDelete())
  104 + ttinfodetailIds.push(editInfo.detailInfos[i][j]);
  105 + }
  106 + }
  107 + // ajax调用
  108 + var success_counts = 0; // 成功数
  109 + var error_counts = 0; // 失败数
  110 + for (var n = 0; n < ttinfodetailIds.length; n++) {
  111 + (function(index) {
  112 + queryClass.delete({id: ttinfodetailIds[index].ttdid}, function(value) {
  113 + if (value.status == 'ERROR') {
  114 + error_counts ++;
  115 + if (success_counts + error_counts == ttinfodetailIds.length) {
  116 + deferred.reject();
  117 + }
  118 + } else {
  119 + // 赋值(上下行,发车时间,班次类型,起点站,终点站,停车场)
  120 + ttinfodetailIds[index].fcsj = undefined;
  121 + ttinfodetailIds[index].xldir = undefined;
  122 + ttinfodetailIds[index].bc_type = undefined;
  123 + ttinfodetailIds[index].qdz = undefined;
  124 + ttinfodetailIds[index].zdz = undefined;
  125 + ttinfodetailIds[index].tcc = undefined;
  126 +
  127 + ttinfodetailIds[index].validInfo();
  128 +
  129 + success_counts ++;
  130 + if (success_counts + error_counts == ttinfodetailIds.length) {
  131 + deferred.resolve();
  132 + }
  133 + }
  134 + }, function(value) {
  135 + error_counts ++;
  136 + if (success_counts + error_counts == ttinfodetailIds.length) {
  137 + deferred.reject();
  138 + }
  139 + });
  140 +
  141 + })(n);
  142 + }
  143 +
  144 + return deferred.promise;
  145 + },
  146 +
172 147 editInfos: function(updateObject) { // 批量保存数据 // TODO:
173 148 var deferred = $q.defer();
174 149  
... ... @@ -176,7 +151,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(
176 151 var ttinfodetailIds = [];
177 152 for (var i = 0; i < editInfo.detailInfos.length; i++) {
178 153 for (var j = 0; j < editInfo.detailInfos[i].length; j++) {
179   - if (editInfo.detailInfos[i][j].sel == true)
  154 + if (editInfo.detailInfos[i][j].canUpdate())
180 155 ttinfodetailIds.push(editInfo.detailInfos[i][j]);
181 156 }
182 157 }
... ... @@ -329,7 +304,9 @@ angular.module(&#39;ScheduleApp&#39;).controller(
329 304 xlid: self.xlid,
330 305 ttid: self.ttid,
331 306 xlname: self.xlname,
332   - ttname: self.ttname
  307 + ttname: self.ttname,
  308 + rowindex: r,
  309 + colindex: c
333 310 }
334 311 );
335 312 };
... ... @@ -360,6 +337,30 @@ angular.module(&#39;ScheduleApp&#39;).controller(
360 337 });
361 338 };
362 339  
  340 + // 批量删除
  341 + self.deleteInfos = function() {
  342 + if (!service.editIsSel()) {
  343 + alert("请选择班次信息");
  344 + return;
  345 + }
  346 + service.deleteInfos().then(function() {
  347 + $state.go("ttInfoDetailManage_edit3", {
  348 + xlid: self.xlid,
  349 + ttid: self.ttid,
  350 + xlname: self.xlname,
  351 + ttname: self.ttname
  352 + });
  353 + }, function() {
  354 + alert("批量删除失败!");
  355 + $state.go("ttInfoDetailManage_edit3", {
  356 + xlid: self.xlid,
  357 + ttid: self.ttid,
  358 + xlname: self.xlname,
  359 + ttname: self.ttname
  360 + });
  361 + });
  362 + };
  363 +
363 364 // 查询对象类
364 365 var TTInfoDetail = service.getQueryClass();
365 366  
... ... @@ -445,7 +446,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
445 446 'TimeTableDetailManageService_old',
446 447 '$stateParams',
447 448 '$state',
448   - function(service, $stateParams, $state) {
  449 + 'SaTimeTableUtils',
  450 + function(service, $stateParams, $state, SaTimeTableUtils) {
449 451 var self = this;
450 452 var TTInfoDetail = service.getQueryClass();
451 453  
... ... @@ -465,6 +467,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
465 467 self.ttid = $stateParams.ttid; // 获取传过来的时刻表id
466 468 self.xlname = $stateParams.xlname; // 获取传过来的线路名字
467 469 self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字
  470 + self.rowindex = $stateParams.rowindex; // 修改的第几行
  471 + self.colindex = $stateParams.colindex; // 修改的第几列
468 472  
469 473 self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息";
470 474  
... ... @@ -509,6 +513,24 @@ angular.module(&#39;ScheduleApp&#39;).controller(
509 513 "->班次详细信息";
510 514 });
511 515  
  516 + } else { // 此单元格为空,使用columnBcInfo填充
  517 + SaTimeTableUtils.initTTInfoDetail(
  518 + self.TimeTableDetailForSave,
  519 + service.getEditInfo().detailInfos[self.rowindex][self.colindex],
  520 + service.getEditInfo().columnBcInfo[self.colindex],
  521 + self.xlid,
  522 + self.xlname,
  523 + self.ttid,
  524 + self.ttname
  525 + );
  526 +
  527 + self.stop_temp.setModelValue(self.TimeTableDetailForSave);
  528 + self.title2 =
  529 + self.xlname + "(" + self.ttname + ")" + "时刻表明细信息" +
  530 + "->路牌" + self.TimeTableDetailForSave.lp.lpName +
  531 + "->发车顺序号" + self.TimeTableDetailForSave.fcno +
  532 + "->班次详细信息";
  533 +
512 534 }
513 535  
514 536 // 提交方法
... ... @@ -523,22 +545,18 @@ angular.module(&#39;ScheduleApp&#39;).controller(
523 545 self.TimeTableDetailForSave.$save(function(value) {
524 546 // 修正内部edit的值
525 547 var detailInfos = service.getEditInfo().detailInfos;
526   - for (var i = 0; i < detailInfos.length; i ++) {
527   - for (var j = 0; j < detailInfos[i].length; j++) {
528   - if (detailInfos[i][j].ttdid == id) {
529   - // 赋值(上下行,发车时间,班次类型)
530   - detailInfos[i][j].fcsj = value.fcsj || undefined;
531   - detailInfos[i][j].xldir = value.xlDir || undefined;
532   - detailInfos[i][j].bc_type = value.bcType || undefined;
533   - detailInfos[i][j].tcc = value.tcc || undefined;
534   - detailInfos[i][j].zdz = value.zdz || undefined;
535   - detailInfos[i][j].qdz = value.qdz || undefined;
536   - detailInfos[i][j].isfb = value.isFB;
537   -
538   - detailInfos[i][j].validInfo();
539   - }
540   - }
541   - }
  548 + var detailInfo = detailInfos[self.rowindex][self.colindex];
  549 + // 赋值(上下行,发车时间,班次类型)
  550 + detailInfo.fcsj = value.fcsj || undefined;
  551 + detailInfo.xldir = value.xlDir || undefined;
  552 + detailInfo.bc_type = value.bcType || undefined;
  553 + detailInfo.tcc = value.tcc || undefined;
  554 + detailInfo.zdz = value.zdz || undefined;
  555 + detailInfo.qdz = value.qdz || undefined;
  556 + detailInfo.isfb = value.isFB;
  557 +
  558 + detailInfo.validInfo();
  559 +
542 560 //$state.go("ttInfoDetailManage_edit", {
543 561 // xlid: self.xlid,
544 562 // ttid: self.ttid,
... ... @@ -567,6 +585,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
567 585 '$stateParams',
568 586 '$state',
569 587 function(service, $stateParams, $state) {
  588 + // TODO:
  589 +
570 590 var self = this;
571 591 var TTInfoDetail = service.getQueryClass();
572 592  
... ...
src/main/resources/static/real_control_v2/js/modal_extend.js
1   -
2 1 //modal hide remove dom
3 2 $(document).on('hide.uk.modal', '.uk-modal', function () {
4 3 $(this).remove();
... ... @@ -26,22 +25,25 @@ var show_modal = function (id, dom) {
26 25  
27 26 var open_modal = function (pageUrl, data, opt) {
28 27 $.get(pageUrl, function (dom) {
29   - if (!$(dom).hasClass('uk-modal')) {
30   - alert('无效的dom片段!');
31   - return;
32   - }
33   - var id = '#' + $(dom).attr('id');
34   -
35   - $(document.body).append(dom);
36   - UIkit.modal(id, opt).show();
37   - //move
38   - modal_move($('.uk-modal-header',id));
39   -
40   - if (data)
41   - $(id).trigger('init', data);
  28 + open_modal_dom(dom, data, opt);
42 29 });
43 30 };
44 31  
  32 +var open_modal_dom = function (dom, data, opt) {
  33 + if (!$(dom).hasClass('uk-modal')) {
  34 + alert('无效的dom片段!');
  35 + return;
  36 + }
  37 + var id = '#' + $(dom).attr('id');
  38 +
  39 + $(document.body).append(dom);
  40 + UIkit.modal(id, opt).show();
  41 + //move
  42 + modal_move($('.uk-modal-header',id));
  43 +
  44 + if (data)
  45 + $(id).trigger('init', data);
  46 +};
45 47  
46 48 var modal_move = function (m_header) {
47 49 var _moveFlag;
... ... @@ -90,4 +92,4 @@ var modal_move = function (m_header) {
90 92 _moveObj = null;
91 93 });
92 94  
93   -};
  95 +};
94 96 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/css/real.css
... ... @@ -649,4 +649,155 @@ input[type=checkbox].disabled{
649 649 padding-top: 15px;
650 650 border-right: 1px solid #d8d7d7;
651 651 box-shadow: 3px 1px 8px 0 rgba(0, 0, 0, 0.12), 1px 0px 8px 0 rgba(0, 0, 0, 0.12);
  652 +}
  653 +
  654 +.playBackForm{
  655 + margin-bottom: 0 !important;
  656 +}
  657 +
  658 +.playBackForm .uk-form-label{
  659 + width: 70px;
  660 +}
  661 +
  662 +.playBackForm .uk-form-controls{
  663 + margin-left: 75px;
  664 +}
  665 +
  666 +.playBackForm>.uk-grid{
  667 + margin-top: 14px;
  668 +}
  669 +.playBackForm .autocomplete-nbbm{
  670 + width: 100%;
  671 +}
  672 +.playBackForm .autocomplete-nbbm input{
  673 + width: calc(100% - 28px);
  674 +}
  675 +.playBackForm>.uk-grid>*{
  676 + padding-left: 18px;
  677 +}
  678 +
  679 +.abnormal_table_wrap{
  680 + height: calc(50% - 210px);
  681 + margin-left: -35px;
  682 + border-top: 1px solid #ededed;
  683 + margin-top: 26px;
  684 + position: relative;
  685 + /*border-bottom: 1px solid #ededed;*/
  686 +}
  687 +
  688 +.other_info_table_wrap{
  689 + height: calc(50% - 20px);
  690 +}
  691 +
  692 +.abnormal_table_wrap:before{
  693 + content: '异常信息';
  694 + position: absolute;
  695 + top: -12px;
  696 + left: 20px;
  697 + background: white;
  698 + padding: 2px 5px;
  699 + color: #9e9e9e;
  700 +}
  701 +
  702 +.playBackForm .playBackButton{
  703 + width: 90%;
  704 + margin-left: 5%;
  705 + border: 0 !important;
  706 + background-image: none !important;
  707 + background-color: #00aff2;
  708 +}
  709 +
  710 +
  711 +.ct_table.gps-road-info dl dt:nth-of-type(1), .ct_table.gps-road-info dl dd:nth-of-type(1) {
  712 + width: 26%;
  713 + text-indent: 15px;
  714 +}
  715 +.ct_table.gps-road-info dl dt:nth-of-type(2), .ct_table.gps-road-info dl dd:nth-of-type(2) {
  716 + width: 16%;
  717 +}
  718 +.ct_table.gps-road-info dl dt:nth-of-type(3), .ct_table.gps-road-info dl dd:nth-of-type(3) {
  719 + width: 57%;
  720 + border-right: 0;
  721 +}
  722 +
  723 +
  724 +.inout_table_wrap .ct_table dl dt:nth-of-type(1), .inout_table_wrap .ct_table dl dd:nth-of-type(1){
  725 + width: 36%;
  726 + text-indent: 12px;
  727 +}
  728 +.inout_table_wrap .ct_table dl dt:nth-of-type(2), .inout_table_wrap .ct_table dl dd:nth-of-type(2){
  729 + width: 21%;
  730 +}
  731 +.inout_table_wrap .ct_table dl dt:nth-of-type(3), .inout_table_wrap .ct_table dl dd:nth-of-type(3){
  732 + width: 20%;
  733 +}
  734 +.inout_table_wrap .ct_table dl dt:nth-of-type(4), .inout_table_wrap .ct_table dl dd:nth-of-type(4){
  735 + width: 11%;
  736 +}
  737 +.inout_table_wrap .ct_table dl dt:nth-of-type(5), .inout_table_wrap .ct_table dl dd:nth-of-type(5){
  738 + width: 11%;
  739 + border-right: 0;
  740 +}
  741 +
  742 +.abnormal_table_panel .ct_table dl dt:nth-of-type(1), .abnormal_table_panel .ct_table dl dd:nth-of-type(1){
  743 + width: 28%;
  744 + text-indent: 12px;
  745 +}
  746 +.abnormal_table_panel .ct_table dl dt:nth-of-type(2), .abnormal_table_panel .ct_table dl dd:nth-of-type(2){
  747 + width: 26%;
  748 +}
  749 +.abnormal_table_panel .ct_table dl dt:nth-of-type(3), .abnormal_table_panel .ct_table dl dd:nth-of-type(3){
  750 + width: 26%;
  751 +}
  752 +.abnormal_table_panel .ct_table dl dt:nth-of-type(4), .abnormal_table_panel .ct_table dl dd:nth-of-type(4){
  753 + width: 19%;
  754 + border-right: 0;
  755 +}
  756 +
  757 +
  758 +.playBackForm .ct_table .ct_table_body dl:last-child dd{
  759 + border-bottom: 1px solid #dedede;
  760 +}
  761 +
  762 +.ct_table.gps-road-info .ct_table_head,
  763 +.inout_table_wrap .ct_table .ct_table_head,
  764 +.abnormal_table_panel .ct_table .ct_table_head{
  765 + background: none;
  766 + background-image: linear-gradient(to right,rgba(255, 255, 255, 0) 1% ,#eee 7% ,#eee 99%);
  767 +}
  768 +
  769 +#map-playback2-modal .uk-accordion-title{
  770 + margin-bottom: 5px;
  771 + border-radius: 0;
  772 + font-size: 15px;
  773 + font-weight: 600;
  774 + border-right: 0;
  775 +}
  776 +
  777 +.cc_info_accordion ul{
  778 + background: #efefef;
  779 +}
  780 +
  781 +.cc_info_accordion ul li{
  782 + cursor: default;
  783 + padding: 5px 9px;
  784 + background: #fff;
  785 + margin-top: 1px;
  786 + -webkit-border-start: 6px solid transparent;
  787 + -webkit-padding-start: 18px;
  788 + user-select: none;
  789 +}
  790 +
  791 +.cc_info_accordion ul li:hover,
  792 +.cc_info_accordion ul li.active{
  793 + background: #d5fff6;
  794 + -webkit-border-start-color: #1bbc9b;
  795 +}
  796 +
  797 +.cc_info_accordion .uk-accordion-content{
  798 + padding: 0;
  799 +}
  800 +.cc_info_accordion{
  801 + height: calc(100% - 40px);
  802 + overflow: auto;
652 803 }
653 804 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v2/main.html
... ... @@ -2,17 +2,593 @@
2 2 <div class="uk-modal-dialog uk-modal-dialog-blank">
3 3 <button class="uk-modal-close uk-close" type="button"></button>
4 4 <div class="uk-grid uk-flex-middle" data-uk-grid-margin>
5   - <div class="uk-width-medium-1-10 uk-height-viewport z-depth-viewport" >
  5 + <div class="uk-width-medium-1-10 uk-height-viewport z-depth-viewport">
  6 + <h5 style="color: #868484;text-indent: 5px;">
  7 + 线路配车
  8 + </h5>
  9 + <div class="uk-accordion cc_info_accordion" data-uk-accordion data-uk-observe>
  10 + </div>
  11 +
6 12 </div>
7   - <div class="uk-width-medium-2-10 uk-height-viewport z-depth-viewport">
  13 + <div class="uk-width-medium-2-10 uk-height-viewport z-depth-viewport ">
  14 + <form class="uk-form uk-form-horizontal playBackForm">
  15 + <div class="uk-grid">
  16 + <div class="uk-width-1-1">
  17 + <div class="uk-form-row">
  18 + <label class="uk-form-label">车辆编码</label>
  19 + <div class="uk-form-controls">
  20 + <div class="uk-autocomplete uk-form autocomplete-nbbm">
  21 + <input name="nbbm" required/>
  22 + </div>
  23 + </div>
  24 + </div>
  25 + </div>
  26 + </div>
  27 + <div class="uk-grid">
  28 + <div class="uk-width-2-3">
  29 + <div class="uk-form-row">
  30 + <label class="uk-form-label">开始时间</label>
  31 + <div class="uk-form-controls">
  32 + <input name="sDate" type="date" required/>
  33 + </div>
  34 + </div>
  35 + </div>
  36 + <div class="uk-width-1-3" style="padding-left: 15px;">
  37 + <div class="uk-form-row">
  38 + <div class="uk-form-controls" style="margin-left: 0;">
  39 + <input name="sTime" type="time" required/>
  40 + </div>
  41 + </div>
  42 + </div>
  43 + </div>
  44 + <div class="uk-grid">
  45 + <div class="uk-width-2-3">
  46 + <div class="uk-form-row">
  47 + <label class="uk-form-label">结束时间</label>
  48 + <div class="uk-form-controls">
  49 + <input name="eDate" type="date" required/>
  50 + </div>
  51 + </div>
  52 + </div>
  53 + <div class="uk-width-1-3" style="padding-left: 15px;">
  54 + <div class="uk-form-row">
  55 + <div class="uk-form-controls" style="margin-left: 0;">
  56 + <input name="eTime" type="time" required/>
  57 + </div>
  58 + </div>
  59 + </div>
  60 + </div>
  61 + <div class="uk-grid">
  62 + <button class="uk-button uk-button-large uk-button-primary playBackButton" type="submit"><i
  63 + class="uk-icon-search"> </i> 搜索轨迹
  64 + </button>
  65 + </div>
  66 + </form>
  67 + <!-- 异常警报 -->
  68 + <div class="abnormal_table_wrap">
  69 + <div class="abnormal_table_panel"
  70 + style="height: calc(100% - 15px);margin-top: 15px;overflow: auto;">
  71 + <div class="ct_table abnormal_table" style="height: calc(100% - 30px);">
  72 + <div class="ct_table_head">
  73 + <dl>
  74 + <dt>异常状态</dt>
  75 + <dt>开始时间</dt>
  76 + <dt>结束时间</dt>
  77 + <dt>图像</dt>
  78 + </dl>
  79 + </div>
  80 + <div class="ct_table_body">
  81 + <dl>
  82 + <dd>超速(80)</dd>
  83 + <dd>05:00.20</dd>
  84 + <dd>05:00.20</dd>
  85 + <dd></dd>
  86 + </dl>
  87 + <dl>
  88 + <dd>越界</dd>
  89 + <dd>05:00.20</dd>
  90 + <dd>05:00.20</dd>
  91 + <dd></dd>
  92 + </dl>
  93 + <dl>
  94 + <dd>超速(80)</dd>
  95 + <dd>05:00.20</dd>
  96 + <dd>05:00.20</dd>
  97 + <dd></dd>
  98 + </dl>
  99 + <dl>
  100 + <dd>越界</dd>
  101 + <dd>05:00.20</dd>
  102 + <dd>05:00.20</dd>
  103 + <dd></dd>
  104 + </dl>
  105 + <dl>
  106 + <dd>超速(180)</dd>
  107 + <dd>05:00.20</dd>
  108 + <dd>05:00.20</dd>
  109 + <dd></dd>
  110 + </dl>
  111 + <dl>
  112 + <dd>越界</dd>
  113 + <dd>05:00.20</dd>
  114 + <dd>05:00.20</dd>
  115 + <dd></dd>
  116 + </dl>
  117 + <dl>
  118 + <dd>超速(80)</dd>
  119 + <dd>05:00.20</dd>
  120 + <dd>05:00.20</dd>
  121 + <dd></dd>
  122 + </dl>
  123 + <dl>
  124 + <dd>越界</dd>
  125 + <dd>05:00.20</dd>
  126 + <dd>05:00.20</dd>
  127 + <dd></dd>
  128 + </dl>
  129 + <dl>
  130 + <dd>超速(80)</dd>
  131 + <dd>05:00.20</dd>
  132 + <dd>05:00.20</dd>
  133 + <dd></dd>
  134 + </dl>
  135 + <dl>
  136 + <dd>越界</dd>
  137 + <dd>05:00.20</dd>
  138 + <dd>05:00.20</dd>
  139 + <dd></dd>
  140 + </dl>
  141 + <dl>
  142 + <dd>超速(80)</dd>
  143 + <dd>05:00.20</dd>
  144 + <dd>05:00.20</dd>
  145 + <dd></dd>
  146 + </dl>
  147 + <dl>
  148 + <dd>越界</dd>
  149 + <dd>05:00.20</dd>
  150 + <dd>05:00.20</dd>
  151 + <dd></dd>
  152 + </dl>
  153 + <dl>
  154 + <dd>超速(80)</dd>
  155 + <dd>05:00.20</dd>
  156 + <dd>05:00.20</dd>
  157 + <dd></dd>
  158 + </dl>
  159 + <dl>
  160 + <dd>越界</dd>
  161 + <dd>05:00.20</dd>
  162 + <dd>05:00.20</dd>
  163 + <dd></dd>
  164 + </dl>
  165 + <dl>
  166 + <dd>超速(80)</dd>
  167 + <dd>05:00.20</dd>
  168 + <dd>05:00.20</dd>
  169 + <dd></dd>
  170 + </dl>
  171 + <dl>
  172 + <dd>越界</dd>
  173 + <dd>05:00.20</dd>
  174 + <dd>05:00.20</dd>
  175 + <dd></dd>
  176 + </dl>
  177 + <dl>
  178 + <dd>超速(80)</dd>
  179 + <dd>05:00.20</dd>
  180 + <dd>05:00.20</dd>
  181 + <dd></dd>
  182 + </dl>
  183 + <dl>
  184 + <dd>越界</dd>
  185 + <dd>05:00.20</dd>
  186 + <dd>05:00.20</dd>
  187 + <dd></dd>
  188 + </dl>
  189 + <dl>
  190 + <dd>超速(80)</dd>
  191 + <dd>05:00.20</dd>
  192 + <dd>05:00.20</dd>
  193 + <dd></dd>
  194 + </dl>
  195 + <dl>
  196 + <dd>越界</dd>
  197 + <dd>05:00.20</dd>
  198 + <dd>05:00.20</dd>
  199 + <dd></dd>
  200 + </dl>
  201 +
  202 + </div>
  203 + </div>
  204 + </div>
  205 + </div>
  206 + <!-- 路段 和 到离站信息 -->
  207 + <div class="uk-margin uk-grid other_info_table_wrap" data-uk-grid-margin>
  208 + <div class="uk-width-medium-1-1" style="padding-left: 0;">
  209 +
  210 + <ul class="uk-tab" data-uk-tab="{connect:'#real_gps_info_tab_content'}"
  211 + style="padding-left: 12px;">
  212 + <li class="uk-active"><a>行车轨迹</a></li>
  213 + <li><a>到离站信息</a></li>
  214 + </ul>
  215 +
  216 + <ul id="real_gps_info_tab_content" class="uk-switcher uk-margin"
  217 + style="height: calc(100% - 44px);margin-top: 7px;">
  218 + <li class="uk-active" style="height: 100%;">
  219 + <div class="road_table_wrap" style="height: 100%;overflow: auto;">
  220 + <div class="ct_table gps-road-info"
  221 + style="height: calc(100% - 30px);">
  222 + <div class="ct_table_head">
  223 + <dl>
  224 + <dt>时间</dt>
  225 + <dt>速度</dt>
  226 + <dt>所在路段</dt>
  227 + </dl>
  228 + </div>
  229 + <div class="ct_table_body">
  230 + </div>
  231 + </div>
  232 + </div>
  233 + </li>
  234 + <!-- 到离站数据 -->
  235 + <li style="height: 100%;">
  236 + <div class="inout_table_wrap" style="height: 100%;overflow: auto;">
  237 + <div class="ct_table" style="height: calc(100% - 30px);">
  238 + <div class="ct_table_head">
  239 + <dl>
  240 + <dt>站点</dt>
  241 + <dt>到站时间</dt>
  242 + <dt>离站时间</dt>
  243 + <dt>上客</dt>
  244 + <dt>下客</dt>
  245 + </dl>
  246 + </div>
  247 + <div class="ct_table_body">
  248 + <dl>
  249 + <dd>金桥路朴珊德拉</dd>
  250 + <dd>05:02.4</dd>
  251 + <dd>05:04.6</dd>
  252 + <dd>5</dd>
  253 + <dd>12</dd>
  254 + </dl>
  255 + <dl>
  256 + <dd>金桥路朴珊德拉</dd>
  257 + <dd>05:02.4</dd>
  258 + <dd>05:04.6</dd>
  259 + <dd>5</dd>
  260 + <dd>12</dd>
  261 + </dl>
  262 + <dl>
  263 + <dd>金桥路朴珊德拉</dd>
  264 + <dd>05:02.4</dd>
  265 + <dd>05:04.6</dd>
  266 + <dd>5</dd>
  267 + <dd>12</dd>
  268 + </dl>
  269 + <dl>
  270 + <dd>金桥路朴珊德拉</dd>
  271 + <dd>05:02.4</dd>
  272 + <dd>05:04.6</dd>
  273 + <dd>5</dd>
  274 + <dd>12</dd>
  275 + </dl>
  276 + <dl>
  277 + <dd>金桥路朴珊德拉</dd>
  278 + <dd>05:02.4</dd>
  279 + <dd>05:04.6</dd>
  280 + <dd>5</dd>
  281 + <dd>12</dd>
  282 + </dl>
  283 + <dl>
  284 + <dd>金桥路朴珊德拉</dd>
  285 + <dd>05:02.4</dd>
  286 + <dd>05:04.6</dd>
  287 + <dd>5</dd>
  288 + <dd>12</dd>
  289 + </dl>
  290 + <dl>
  291 + <dd>金桥路朴珊德拉</dd>
  292 + <dd>05:02.4</dd>
  293 + <dd>05:04.6</dd>
  294 + <dd>5</dd>
  295 + <dd>12</dd>
  296 + </dl>
  297 + <dl>
  298 + <dd>金桥路朴珊德拉</dd>
  299 + <dd>05:02.4</dd>
  300 + <dd>05:04.6</dd>
  301 + <dd>5</dd>
  302 + <dd>12</dd>
  303 + </dl>
  304 + <dl>
  305 + <dd>金桥路朴珊德拉</dd>
  306 + <dd>05:02.4</dd>
  307 + <dd>05:04.6</dd>
  308 + <dd>5</dd>
  309 + <dd>12</dd>
  310 + </dl>
  311 + <dl>
  312 + <dd>金桥路朴珊德拉</dd>
  313 + <dd>05:02.4</dd>
  314 + <dd>05:04.6</dd>
  315 + <dd>5</dd>
  316 + <dd>12</dd>
  317 + </dl>
  318 + <dl>
  319 + <dd>金桥路朴珊德拉</dd>
  320 + <dd>05:02.4</dd>
  321 + <dd>05:04.6</dd>
  322 + <dd>5</dd>
  323 + <dd>12</dd>
  324 + </dl>
  325 + <dl>
  326 + <dd>金桥路朴珊德拉</dd>
  327 + <dd>05:02.4</dd>
  328 + <dd>05:04.6</dd>
  329 + <dd>5</dd>
  330 + <dd>12</dd>
  331 + </dl>
  332 + <dl>
  333 + <dd>金桥路朴珊德拉</dd>
  334 + <dd>05:02.4</dd>
  335 + <dd>05:04.6</dd>
  336 + <dd>5</dd>
  337 + <dd>12</dd>
  338 + </dl>
  339 + <dl>
  340 + <dd>金桥路朴珊德拉</dd>
  341 + <dd>05:02.4</dd>
  342 + <dd>05:04.6</dd>
  343 + <dd>5</dd>
  344 + <dd>12</dd>
  345 + </dl>
  346 + <dl>
  347 + <dd>金桥路朴珊德拉</dd>
  348 + <dd>05:02.4</dd>
  349 + <dd>05:04.6</dd>
  350 + <dd>5</dd>
  351 + <dd>12</dd>
  352 + </dl>
  353 + <dl>
  354 + <dd>金桥路朴珊德拉</dd>
  355 + <dd>05:02.4</dd>
  356 + <dd>05:04.6</dd>
  357 + <dd>5</dd>
  358 + <dd>12</dd>
  359 + </dl>
  360 + <dl>
  361 + <dd>金桥路朴珊德拉</dd>
  362 + <dd>05:02.4</dd>
  363 + <dd>05:04.6</dd>
  364 + <dd>5</dd>
  365 + <dd>12</dd>
  366 + </dl>
  367 + <dl>
  368 + <dd>金桥路朴珊德拉</dd>
  369 + <dd>05:02.4</dd>
  370 + <dd>05:04.6</dd>
  371 + <dd>5</dd>
  372 + <dd>12</dd>
  373 + </dl>
  374 + <dl>
  375 + <dd>金桥路朴珊德拉</dd>
  376 + <dd>05:02.4</dd>
  377 + <dd>05:04.6</dd>
  378 + <dd>5</dd>
  379 + <dd>12</dd>
  380 + </dl>
  381 + <dl>
  382 + <dd>金桥路朴珊德拉</dd>
  383 + <dd>05:02.4</dd>
  384 + <dd>05:04.6</dd>
  385 + <dd>5</dd>
  386 + <dd>12</dd>
  387 + </dl>
  388 + <dl>
  389 + <dd>金桥路朴珊德拉</dd>
  390 + <dd>05:02.4</dd>
  391 + <dd>05:04.6</dd>
  392 + <dd>5</dd>
  393 + <dd>12</dd>
  394 + </dl>
  395 +
  396 + </div>
  397 + </div>
  398 + </div>
  399 + </li>
  400 + </ul>
  401 +
  402 + </div>
  403 + </div>
8 404 </div>
9   - <div class="uk-width-medium-7-10 uk-height-viewport">
  405 + <div class="uk-width-medium-7-10 uk-height-viewport map-wrap">
10 406 </div>
11 407 </div>
12 408 </div>
  409 +
  410 + <script id="cc_info_accordion_cont_temp" type="text/html">
  411 + {{each ccInfo as cc i}}
  412 + <h3 class="uk-accordion-title">{{cc.name}}</h3>
  413 + <div class="uk-accordion-content">
  414 + <ul class="uk-list">
  415 + {{each cc.cars as c j}}
  416 + <li>{{c}}</li>
  417 + {{/each}}
  418 + </ul>
  419 + </div>
  420 + {{/each}}
  421 + </script>
  422 +
  423 + <script id="gps_road_info_cont_temp" type="text/html">
  424 + {{each array as gps i}}
  425 + <dl data-code="{{gps.road.road_CODE}}">
  426 + <dd>{{gps.timeStr}}</dd>
  427 + <dd>{{gps.speed}}</dd>
  428 + <dd>{{gps.road.road_NAME}}</dd>
  429 + </dl>
  430 + {{/each}}
  431 + </script>
13 432 <script>
14 433 (function () {
15   - var modal = '#map-playback2-modal';
  434 + var modal = '#map-playback2-modal', gpsArray;
  435 +
  436 + $(modal).on('init', function (e, data) {
  437 + //初始化地图
  438 + map = new BMap.Map($('.map-wrap', modal)[0]);
  439 + //中心点和缩放级别
  440 + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16);
  441 + map.enableScrollWheelZoom();
  442 +
  443 + //固定表头
  444 + gb_ct_table.fixedHead($('.road_table_wrap', modal));
  445 + gb_ct_table.fixedHead($('.inout_table_wrap', modal));
  446 + gb_ct_table.fixedHead($('.abnormal_table_panel', modal));
  447 + //线路配车
  448 + ccInfo.init();
  449 +
  450 + //表单初始值
  451 + searchForm.init(data);
  452 + });
  453 +
  454 + /**
  455 + * 线路配车相关
  456 + */
  457 + var ccInfo = (function () {
  458 +
  459 + function init() {
  460 + $.get('/basic/ccInfo', function (rs) {
  461 + var ccInfo = [], lines = gb_data_basic.codeToLine;
  462 + for (var code in lines) {
  463 + ccInfo.push({
  464 + name: lines[code].name,
  465 + cars: carSort(rs[code])
  466 + });
  467 + }
  468 +
  469 + var htmlStr = template('cc_info_accordion_cont_temp', {ccInfo: ccInfo});
  470 + $('.cc_info_accordion', modal).html(htmlStr)
  471 + .find('.uk-list li').on('click', itemClick);
  472 + });
  473 + }
  474 +
  475 + function carSort(list) {
  476 + if (!list)
  477 + return [];
  478 + return list.sort();
  479 + }
  480 +
  481 + function itemClick() {
  482 + $(this).parent().find('li.active').removeClass('active');
  483 + $(this).addClass('active');
  484 + searchForm.setNbbm($(this).text());
  485 + }
  486 +
  487 + return {
  488 + init: init
  489 + };
  490 + })();
  491 +
  492 + /**
  493 + * 搜索表单相关
  494 + */
  495 + var searchForm = (function () {
  496 +
  497 + var f = $('.playBackForm', modal);
  498 +
  499 + var init = function (data) {
  500 + //设置初始值
  501 + if (data.nbbm)
  502 + $('[name=nbbm]', f).val(data.nbbm);
  503 + var st = moment().subtract(2, 'hour');
  504 + if (data.st)
  505 + st = moment(data.st, 'YYYY-MM-DD HH:mm');
  506 + $('[name=sDate]', f).val(st.format('YYYY-MM-DD'));
  507 + $('[name=sTime]', f).val(st.format('HH:mm'));
  508 + var et = moment();
  509 + if (data.et)
  510 + et = moment(data.et, 'YYYY-MM-DD HH:mm');
  511 + $('[name=eDate]', f).val(et.format('YYYY-MM-DD'));
  512 + $('[name=eTime]', f).val(et.format('HH:mm'));
  513 +
  514 + //搜索事件
  515 + $('button[type=submit]', f).on('click', search);
  516 + };
  517 +
  518 + var setNbbm = function (v) {
  519 + $('[name=nbbm]', f).val(v);
  520 + };
  521 +
  522 + var ONE_DAY = 60 * 60 * 24;
  523 + var MIN_SPACE = 60;
  524 + var search = function (e) {
  525 + e.stopPropagation();
  526 + var data = f.serializeJSON();
  527 +
  528 + //校验时间间隔
  529 + var fs = 'YYYY-MM-DDHH:mm';
  530 + var st = parseInt(moment(data.sDate + data.sTime, fs).format('X'));
  531 + var et = parseInt(moment(data.eDate + data.eTime, fs).format('X'));
  532 +
  533 + if (et < st)
  534 + notify_err('结束时间不能小于开始时间');
  535 + else if ((et - st) > ONE_DAY)
  536 + notify_err('最大间隔24小时!');
  537 + else if ((et - st) < MIN_SPACE)
  538 + notify_err('最小间隔1分钟!');
  539 + else {
  540 + $.ajax({
  541 + url: '/gps/history_v2/' + data.nbbm,
  542 + traditional: true,
  543 + data: {st: st, et: et},
  544 + success: function (rs) {
  545 + gpsArray = rs.list;
  546 + if (!rs || rs.length == 0) {
  547 + notify_err('没有搜索到轨迹数据!');
  548 + return;
  549 + }
  550 +
  551 + //行车轨迹
  552 + trailTableObj.showInitData(gpsArray);
  553 + }
  554 + });
  555 + }
  556 + return false;
  557 + };
  558 + return {
  559 + init: init,
  560 + setNbbm: setNbbm
  561 + };
  562 + })();
  563 +
  564 + /**
  565 + * 行车轨迹表格
  566 + */
  567 + var trailTableObj = (function () {
  568 +
  569 + var showInitData = function (list) {
  570 + var array = [];
  571 + for (var i = 0, gps; gps = list[i++];) {
  572 + //格式化时间
  573 + gps.timeStr = moment(gps.timestamp).format('HH:mm.ss');
  574 + try {
  575 + if (i > 0 && array[array.length - 1].road.road_CODE == gps.road.road_CODE)
  576 + array.pop();
  577 + }
  578 + catch (e) {}
  579 +
  580 + if (gps.road)
  581 + array.push(gps);
  582 + }
  583 +
  584 + var htmlStr = template('gps_road_info_cont_temp', {array: array});
  585 + $('.gps-road-info .ct_table_body', modal).html(htmlStr);
  586 + };
  587 +
  588 + return {
  589 + showInitData: showInitData
  590 + };
  591 + })();
16 592 })();
17 593 </script>
18   -</div>
  594 +</div>
19 595 \ No newline at end of file
... ...