Commit 19277052bac44897aad8d8240507ba7aacc8b78f
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,4 +72,14 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer | ||
| 72 | public List<Map<String, Object>> findUpStationRouteCode(@RequestParam Map<String, Object> map) { | 72 | public List<Map<String, Object>> findUpStationRouteCode(@RequestParam Map<String, Object> map) { |
| 73 | return routeService.findUpSectionRouteCode(map); | 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<StationRoute, Integer | @@ -127,8 +127,17 @@ public class StationRouteController extends BaseController<StationRoute, Integer | ||
| 127 | */ | 127 | */ |
| 128 | @RequestMapping(value = "/multiLine", method = RequestMethod.GET) | 128 | @RequestMapping(value = "/multiLine", method = RequestMethod.GET) |
| 129 | public Map<String, Object> findByMultiLine(@RequestParam String lineIds){ | 129 | public Map<String, Object> findByMultiLine(@RequestParam String lineIds){ |
| 130 | - | ||
| 131 | return service.findByMultiLine(lineIds); | 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,4 +96,16 @@ public class GpsController { | ||
| 96 | public Map<String, Object> gpsCompletion(@RequestParam long schId) { | 96 | public Map<String, Object> gpsCompletion(@RequestParam long schId) { |
| 97 | return gpsService.gpsCompletion(schId); | 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,6 +4,8 @@ import com.alibaba.fastjson.JSON; | ||
| 4 | import com.alibaba.fastjson.serializer.PropertyFilter; | 4 | import com.alibaba.fastjson.serializer.PropertyFilter; |
| 5 | import com.bsth.common.ResponseCode; | 5 | import com.bsth.common.ResponseCode; |
| 6 | import com.bsth.data.BasicData; | 6 | import com.bsth.data.BasicData; |
| 7 | +import com.bsth.entity.Line; | ||
| 8 | +import com.google.common.collect.ArrayListMultimap; | ||
| 7 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| 8 | import org.slf4j.LoggerFactory; | 10 | import org.slf4j.LoggerFactory; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -11,9 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -11,9 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
| 11 | import org.springframework.web.bind.annotation.RequestMethod; | 13 | import org.springframework.web.bind.annotation.RequestMethod; |
| 12 | import org.springframework.web.bind.annotation.RestController; | 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 | @RestController | 18 | @RestController |
| 19 | @RequestMapping("/basic") | 19 | @RequestMapping("/basic") |
| @@ -126,4 +126,23 @@ public class BasicDataController { | @@ -126,4 +126,23 @@ public class BasicDataController { | ||
| 126 | public Map<String, String> nbbm2PlateNo(){ | 126 | public Map<String, String> nbbm2PlateNo(){ |
| 127 | return basicData.getNbbm2PlateNo(); | 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<Section, Integer> { | @@ -113,5 +113,4 @@ public interface SectionRepository extends BaseRepository<Section, Integer> { | ||
| 113 | Double speedLimit,String descriptions,Integer version,Integer createBy,String createDate, | 113 | Double speedLimit,String descriptions,Integer version,Integer createBy,String createDate, |
| 114 | 114 | ||
| 115 | Integer updateBy,String updateDate); | 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,6 +28,14 @@ import com.bsth.entity.SectionRoute; | ||
| 28 | @Repository | 28 | @Repository |
| 29 | public interface SectionRouteRepository extends BaseRepository<SectionRoute, Integer> { | 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 | * @Description :TODO(查询路段信息) | 40 | * @Description :TODO(查询路段信息) |
| 33 | * | 41 | * |
| @@ -162,4 +170,8 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int | @@ -162,4 +170,8 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int | ||
| 162 | @Modifying | 170 | @Modifying |
| 163 | @Query(value="UPDATE bsth_c_sectionroute set is_roade_speed = ?1 where line= ?2 and directions=?3 ",nativeQuery = true) | 171 | @Query(value="UPDATE bsth_c_sectionroute set is_roade_speed = ?1 where line= ?2 and directions=?3 ",nativeQuery = true) |
| 164 | void isRoadSpeedUpd(Integer isR,Integer line,Integer directions); | 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<StationRoute, Int | @@ -268,4 +268,8 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int | ||
| 268 | "ORDER BY " + | 268 | "ORDER BY " + |
| 269 | "lineCode,directions,stationRouteCode") | 269 | "lineCode,directions,stationRouteCode") |
| 270 | List<Object[]> findAllLineWithYgc(); | 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<SectionRoute, Integer> | @@ -41,4 +41,6 @@ public interface SectionRouteService extends BaseService<SectionRoute, Integer> | ||
| 41 | * @return List<Map<String, Object>> | 41 | * @return List<Map<String, Object>> |
| 42 | */ | 42 | */ |
| 43 | List<Map<String, Object>> findUpSectionRouteCode(Map<String, Object> map); | 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<StationRoute, Integer> | @@ -79,5 +79,7 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> | ||
| 79 | */ | 79 | */ |
| 80 | List<Map<String, Object>> findStationRouteInfo(Map<String, Object> map); | 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,4 +18,6 @@ public interface GpsService { | ||
| 18 | Map<String,Object> findRoadSpeed(String lineCode); | 18 | Map<String,Object> findRoadSpeed(String lineCode); |
| 19 | 19 | ||
| 20 | Map<String,Object> gpsCompletion(long schId); | 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,11 +5,14 @@ import com.bsth.data.BasicData; | ||
| 5 | import com.bsth.data.arrival.ArrivalEntity; | 5 | import com.bsth.data.arrival.ArrivalEntity; |
| 6 | import com.bsth.data.gpsdata.GpsEntity; | 6 | import com.bsth.data.gpsdata.GpsEntity; |
| 7 | import com.bsth.data.gpsdata.GpsRealData; | 7 | import com.bsth.data.gpsdata.GpsRealData; |
| 8 | +import com.bsth.data.gpsdata.arrival.utils.GeoUtils; | ||
| 8 | import com.bsth.data.schedule.DayOfSchedule; | 9 | import com.bsth.data.schedule.DayOfSchedule; |
| 9 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 10 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 10 | import com.bsth.repository.CarParkRepository; | 11 | import com.bsth.repository.CarParkRepository; |
| 11 | import com.bsth.repository.StationRepository; | 12 | import com.bsth.repository.StationRepository; |
| 12 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 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 | import com.bsth.util.DateUtils; | 16 | import com.bsth.util.DateUtils; |
| 14 | import com.bsth.util.TransGPS; | 17 | import com.bsth.util.TransGPS; |
| 15 | import com.bsth.util.TransGPS.Location; | 18 | import com.bsth.util.TransGPS.Location; |
| @@ -235,6 +238,9 @@ public class GpsServiceImpl implements GpsService { | @@ -235,6 +238,9 @@ public class GpsServiceImpl implements GpsService { | ||
| 235 | bdLoc = TransGPS.bd_encrypt(gdLoc); | 238 | bdLoc = TransGPS.bd_encrypt(gdLoc); |
| 236 | map.put("bd_lon", bdLoc.getLng()); | 239 | map.put("bd_lon", bdLoc.getLng()); |
| 237 | map.put("bd_lat", bdLoc.getLat()); | 240 | map.put("bd_lat", bdLoc.getLat()); |
| 241 | + //原始坐标 | ||
| 242 | + map.put("lon", lon); | ||
| 243 | + map.put("lat", lat); | ||
| 238 | 244 | ||
| 239 | map.put("deviceId", rs.getString("DEVICE_ID")); | 245 | map.put("deviceId", rs.getString("DEVICE_ID")); |
| 240 | map.put("ts", rs.getLong("TS")); | 246 | map.put("ts", rs.getLong("TS")); |
| @@ -510,6 +516,49 @@ public class GpsServiceImpl implements GpsService { | @@ -510,6 +516,49 @@ public class GpsServiceImpl implements GpsService { | ||
| 510 | return rs; | 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 | private void sortGpsList(final Field f, List<GpsEntity> rs) { | 562 | private void sortGpsList(final Field f, List<GpsEntity> rs) { |
| 514 | Collections.sort(rs, new Comparator<GpsEntity>() { | 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,7 +8,12 @@ import java.util.Map; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | import org.springframework.stereotype.Service; | 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 | import com.bsth.entity.SectionRoute; | 14 | import com.bsth.entity.SectionRoute; |
| 15 | +import com.bsth.repository.LineRepository; | ||
| 16 | +import com.bsth.repository.SectionRepository; | ||
| 12 | import com.bsth.repository.SectionRouteRepository; | 17 | import com.bsth.repository.SectionRouteRepository; |
| 13 | import com.bsth.service.SectionRouteService; | 18 | import com.bsth.service.SectionRouteService; |
| 14 | 19 | ||
| @@ -34,6 +39,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | @@ -34,6 +39,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 34 | @Autowired | 39 | @Autowired |
| 35 | SectionRouteRepository repository; | 40 | SectionRouteRepository repository; |
| 36 | 41 | ||
| 42 | + @Autowired | ||
| 43 | + SectionRepository repository2; | ||
| 44 | + | ||
| 45 | + @Autowired | ||
| 46 | + LineRepository lineRepository; | ||
| 47 | + | ||
| 37 | /** | 48 | /** |
| 38 | * @Description :TODO(查询路段信息) | 49 | * @Description :TODO(查询路段信息) |
| 39 | * | 50 | * |
| @@ -43,21 +54,13 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | @@ -43,21 +54,13 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 43 | */ | 54 | */ |
| 44 | @Override | 55 | @Override |
| 45 | public List<Map<String, Object>> getSectionRoute(Map<String, Object> map) { | 56 | public List<Map<String, Object>> getSectionRoute(Map<String, Object> map) { |
| 46 | - | ||
| 47 | int lineId = map.get("line.id_eq").equals("") ? 0 : Integer.parseInt(map.get("line.id_eq").toString()); | 57 | int lineId = map.get("line.id_eq").equals("") ? 0 : Integer.parseInt(map.get("line.id_eq").toString()); |
| 48 | - | ||
| 49 | int directions = map.get("directions_eq").equals("") ? 0 : Integer.parseInt(map.get("directions_eq").toString()); | 58 | int directions = map.get("directions_eq").equals("") ? 0 : Integer.parseInt(map.get("directions_eq").toString()); |
| 50 | - | ||
| 51 | List<Object[]> listObjArray = repository.getSectionRoute(lineId, directions); | 59 | List<Object[]> listObjArray = repository.getSectionRoute(lineId, directions); |
| 52 | - | ||
| 53 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); | 60 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); |
| 54 | - | ||
| 55 | if(listObjArray.size()>0) { | 61 | if(listObjArray.size()>0) { |
| 56 | - | ||
| 57 | for(int i = 0 ; i<listObjArray.size() ; i++){ | 62 | for(int i = 0 ; i<listObjArray.size() ; i++){ |
| 58 | - | ||
| 59 | Map<String, Object> tempM = new HashMap<String, Object>(); | 63 | Map<String, Object> tempM = new HashMap<String, Object>(); |
| 60 | - | ||
| 61 | tempM.put("sectionrouteId",listObjArray.get(i)[0]); | 64 | tempM.put("sectionrouteId",listObjArray.get(i)[0]); |
| 62 | tempM.put("sectionrouteLine",listObjArray.get(i)[1]); | 65 | tempM.put("sectionrouteLine",listObjArray.get(i)[1]); |
| 63 | tempM.put("sectionrouteLineCode",listObjArray.get(i)[2]); | 66 | tempM.put("sectionrouteLineCode",listObjArray.get(i)[2]); |
| @@ -81,12 +84,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | @@ -81,12 +84,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 81 | tempM.put("sectionTime",listObjArray.get(i)[20]); | 84 | tempM.put("sectionTime",listObjArray.get(i)[20]); |
| 82 | tempM.put("sectiondbType",listObjArray.get(i)[21]); | 85 | tempM.put("sectiondbType",listObjArray.get(i)[21]); |
| 83 | tempM.put("sectionSpeedLimet",listObjArray.get(i)[22]); | 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 | resultList.add(tempM); | 90 | resultList.add(tempM); |
| 85 | - | ||
| 86 | } | 91 | } |
| 87 | - | ||
| 88 | } | 92 | } |
| 89 | - | ||
| 90 | return resultList; | 93 | return resultList; |
| 91 | } | 94 | } |
| 92 | 95 | ||
| @@ -228,5 +231,68 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | @@ -228,5 +231,68 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ | ||
| 228 | 231 | ||
| 229 | return list; | 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,6 +17,7 @@ import com.bsth.util.db.DBUtils_MS; | ||
| 17 | import com.google.common.base.Splitter; | 17 | import com.google.common.base.Splitter; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.stereotype.Service; | 19 | import org.springframework.stereotype.Service; |
| 20 | +import org.springframework.transaction.annotation.Transactional; | ||
| 20 | 21 | ||
| 21 | import java.io.ByteArrayInputStream; | 22 | import java.io.ByteArrayInputStream; |
| 22 | import java.io.File; | 23 | import java.io.File; |
| @@ -1080,4 +1081,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -1080,4 +1081,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 1080 | 1081 | ||
| 1081 | return rs; | 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,7 +3365,7 @@ | ||
| 3365 | <schema_name/> | 3365 | <schema_name/> |
| 3366 | </partitioning> | 3366 | </partitioning> |
| 3367 | <connection>bus_control_variable</connection> | 3367 | <connection>bus_control_variable</connection> |
| 3368 | - <sql>select 
t.id as id
, g.lp_name as lp
, g.xl as xl
, qdz
, zdz
, tcc
, fcsj
, jhlc
, bc_type 
, bcs
, fcno
, xl_dir
, isfb
from bsth_c_s_ttinfo_detail t left join 
bsth_c_s_gbi g on t.lp = g.id 
where 
g.xl = ? and
t.ttinfo = ? 
order by t.bcs asc</sql> | 3368 | + <sql>select 
t.id as id
, concat(g.id, '_', g.lp_name) as lp
, g.xl as xl
, qdz
, zdz
, tcc
, fcsj
, jhlc
, bc_type 
, bcs
, fcno
, xl_dir
, isfb
from bsth_c_s_ttinfo_detail t left join 
bsth_c_s_gbi g on t.lp = g.id 
where 
g.xl = ? and
t.ttinfo = ? 
order by t.bcs asc</sql> |
| 3369 | <limit>0</limit> | 3369 | <limit>0</limit> |
| 3370 | <lookup>获取变量</lookup> | 3370 | <lookup>获取变量</lookup> |
| 3371 | <execute_each_row>N</execute_each_row> | 3371 | <execute_each_row>N</execute_each_row> |
src/main/resources/static/index.html
| @@ -196,7 +196,7 @@ tr.row-active td { | @@ -196,7 +196,7 @@ tr.row-active td { | ||
| 196 | <!-- LOGO --> | 196 | <!-- LOGO --> |
| 197 | <div class="page-logo"> | 197 | <div class="page-logo"> |
| 198 | <a href="index.html" class="logo-default logo-default-text"> | 198 | <a href="index.html" class="logo-default logo-default-text"> |
| 199 | - 浦东公交调度系统 </a> | 199 | + 闵行公交调度系统 </a> |
| 200 | <div class="menu-toggler sidebar-toggler"></div> | 200 | <div class="menu-toggler sidebar-toggler"></div> |
| 201 | </div> | 201 | </div> |
| 202 | <!-- END LOGO --> | 202 | <!-- END LOGO --> |
src/main/resources/static/login.html
| @@ -181,7 +181,7 @@ | @@ -181,7 +181,7 @@ | ||
| 181 | <div class="wrapper ng-scope"> | 181 | <div class="wrapper ng-scope"> |
| 182 | <div id="loginPanel" class="dialog dialog-shadow"> | 182 | <div id="loginPanel" class="dialog dialog-shadow"> |
| 183 | <br> | 183 | <br> |
| 184 | - <h3 class="logo-text">浦东公交调度系统</h3> | 184 | + <h3 class="logo-text">闵行公交调度系统</h3> |
| 185 | <hr> | 185 | <hr> |
| 186 | <form style="padding: 0px 35px;"> | 186 | <form style="padding: 0px 35px;"> |
| 187 | <div class="form-group" style="margin-bottom: 0"> | 187 | <div class="form-group" style="margin-bottom: 0"> |
src/main/resources/static/pages/base/stationroute/editsection.html
| 1 | <!-- 编辑路段 --> | 1 | <!-- 编辑路段 --> |
| 2 | <div class="modal fade" id="edit_section_mobal" tabindex="-1" role="basic" aria-hidden="true"> | 2 | <div class="modal fade" id="edit_section_mobal" tabindex="-1" role="basic" aria-hidden="true"> |
| 3 | - | ||
| 4 | <div class="modal-dialog"> | 3 | <div class="modal-dialog"> |
| 5 | - | ||
| 6 | <div class="modal-content"> | 4 | <div class="modal-content"> |
| 7 | - | ||
| 8 | <div class="modal-header"> | 5 | <div class="modal-header"> |
| 9 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | 6 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> |
| 10 | <h4 class="modal-title">路段路段</h4> | 7 | <h4 class="modal-title">路段路段</h4> |
| 11 | </div> | 8 | </div> |
| 12 | - | ||
| 13 | <div class="modal-body"> | 9 | <div class="modal-body"> |
| 14 | - | ||
| 15 | <form class="form-horizontal" role="form" id="edit_section__form" action="/module" method="post"> | 10 | <form class="form-horizontal" role="form" id="edit_section__form" action="/module" method="post"> |
| 16 | - | ||
| 17 | <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> | 11 | <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> |
| 18 | 您的输入有误,请检查下面的输入项 | 12 | 您的输入有误,请检查下面的输入项 |
| 19 | </div> | 13 | </div> |
| 20 | - | ||
| 21 | <!-- 线路ID --> | 14 | <!-- 线路ID --> |
| 22 | - | ||
| 23 | <input type="hidden" name="sectionId" id="sectionIdInput"> | 15 | <input type="hidden" name="sectionId" id="sectionIdInput"> |
| 24 | - | ||
| 25 | <input type="hidden" name="sectionRouteId" id="sectionRouteIdInput"> | 16 | <input type="hidden" name="sectionRouteId" id="sectionRouteIdInput"> |
| 26 | - | ||
| 27 | <input type="hidden" name="sectionRouteLine" id="sectionRouteLineInput"> | 17 | <input type="hidden" name="sectionRouteLine" id="sectionRouteLineInput"> |
| 28 | - | ||
| 29 | <input type="hidden" name="lineCode" id="lineCodeInput"> | 18 | <input type="hidden" name="lineCode" id="lineCodeInput"> |
| 30 | - | ||
| 31 | <input type="hidden" name="bsectionVector" id="bsectionVectorInput" /> | 19 | <input type="hidden" name="bsectionVector" id="bsectionVectorInput" /> |
| 32 | - | ||
| 33 | <input type="hidden" name="csectionVector" id="csectionVectorInput" value=""/> | 20 | <input type="hidden" name="csectionVector" id="csectionVectorInput" value=""/> |
| 34 | - | ||
| 35 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | 21 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> |
| 36 | - | ||
| 37 | <!-- 路段名称 --> | 22 | <!-- 路段名称 --> |
| 38 | <div class="form-body"> | 23 | <div class="form-body"> |
| 39 | <div class="form-group"> | 24 | <div class="form-group"> |
| @@ -45,7 +30,6 @@ | @@ -45,7 +30,6 @@ | ||
| 45 | </div> | 30 | </div> |
| 46 | </div> | 31 | </div> |
| 47 | </div> | 32 | </div> |
| 48 | - | ||
| 49 | <!-- 路段编码 --> | 33 | <!-- 路段编码 --> |
| 50 | <div class="form-body"> | 34 | <div class="form-body"> |
| 51 | <div class="form-group"> | 35 | <div class="form-group"> |
| @@ -57,7 +41,6 @@ | @@ -57,7 +41,6 @@ | ||
| 57 | </div> | 41 | </div> |
| 58 | </div> | 42 | </div> |
| 59 | </div> | 43 | </div> |
| 60 | - | ||
| 61 | <!-- 路段序号 --> | 44 | <!-- 路段序号 --> |
| 62 | <div class="form-body"> | 45 | <div class="form-body"> |
| 63 | <div class="form-group"> | 46 | <div class="form-group"> |
| @@ -70,24 +53,6 @@ | @@ -70,24 +53,6 @@ | ||
| 70 | </div> | 53 | </div> |
| 71 | </div> | 54 | </div> |
| 72 | </div> | 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 | <div class="form-body"> | 57 | <div class="form-body"> |
| 93 | <div class="form-group"> | 58 | <div class="form-group"> |
| @@ -103,7 +68,6 @@ | @@ -103,7 +68,6 @@ | ||
| 103 | </div> | 68 | </div> |
| 104 | </div> | 69 | </div> |
| 105 | </div> | 70 | </div> |
| 106 | - | ||
| 107 | <!-- 道路编码--> | 71 | <!-- 道路编码--> |
| 108 | <div class="form-body"> | 72 | <div class="form-body"> |
| 109 | <div class="form-group"> | 73 | <div class="form-group"> |
| @@ -113,7 +77,6 @@ | @@ -113,7 +77,6 @@ | ||
| 113 | </div> | 77 | </div> |
| 114 | </div> | 78 | </div> |
| 115 | </div> | 79 | </div> |
| 116 | - | ||
| 117 | <!-- 路段限速 --> | 80 | <!-- 路段限速 --> |
| 118 | <div class="form-body"> | 81 | <div class="form-body"> |
| 119 | <div class="form-group"> | 82 | <div class="form-group"> |
| @@ -125,7 +88,6 @@ | @@ -125,7 +88,6 @@ | ||
| 125 | </div> | 88 | </div> |
| 126 | </div> | 89 | </div> |
| 127 | </div> | 90 | </div> |
| 128 | - | ||
| 129 | <!-- 路段时长 --> | 91 | <!-- 路段时长 --> |
| 130 | <div class="form-body"> | 92 | <div class="form-body"> |
| 131 | <div class="form-group"> | 93 | <div class="form-group"> |
| @@ -136,7 +98,6 @@ | @@ -136,7 +98,6 @@ | ||
| 136 | </div> | 98 | </div> |
| 137 | </div> | 99 | </div> |
| 138 | </div> | 100 | </div> |
| 139 | - | ||
| 140 | <!-- 路段长度 --> | 101 | <!-- 路段长度 --> |
| 141 | <div class="form-body"> | 102 | <div class="form-body"> |
| 142 | <div class="form-group"> | 103 | <div class="form-group"> |
| @@ -147,7 +108,6 @@ | @@ -147,7 +108,6 @@ | ||
| 147 | </div> | 108 | </div> |
| 148 | </div> | 109 | </div> |
| 149 | </div> | 110 | </div> |
| 150 | - | ||
| 151 | <!-- 版本号 --> | 111 | <!-- 版本号 --> |
| 152 | <div class="form-body"> | 112 | <div class="form-body"> |
| 153 | <div class="form-group"> | 113 | <div class="form-group"> |
| @@ -157,7 +117,6 @@ | @@ -157,7 +117,6 @@ | ||
| 157 | </div> | 117 | </div> |
| 158 | </div> | 118 | </div> |
| 159 | </div> | 119 | </div> |
| 160 | - | ||
| 161 | <!-- 范围图形类型 --> | 120 | <!-- 范围图形类型 --> |
| 162 | <div class="form-body"> | 121 | <div class="form-body"> |
| 163 | <div class="form-group"> | 122 | <div class="form-group"> |
| @@ -171,7 +130,6 @@ | @@ -171,7 +130,6 @@ | ||
| 171 | </div> | 130 | </div> |
| 172 | </div> | 131 | </div> |
| 173 | </div> | 132 | </div> |
| 174 | - | ||
| 175 | <!-- 描述/说明 --> | 133 | <!-- 描述/说明 --> |
| 176 | <div class="form-group"> | 134 | <div class="form-group"> |
| 177 | <label class="control-label col-md-3"> 描述/说明: </label> | 135 | <label class="control-label col-md-3"> 描述/说明: </label> |
| @@ -191,99 +149,56 @@ | @@ -191,99 +149,56 @@ | ||
| 191 | <script type="text/javascript"> | 149 | <script type="text/javascript"> |
| 192 | 150 | ||
| 193 | $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,section,fun){ | 151 | $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,section,fun){ |
| 194 | - | ||
| 195 | var Section = section.getEitdSection(); | 152 | var Section = section.getEitdSection(); |
| 196 | - | ||
| 197 | fun.setSectionFormValue(Section); | 153 | fun.setSectionFormValue(Section); |
| 198 | - | ||
| 199 | // 方向 | 154 | // 方向 |
| 200 | var dir = Section.sectionrouteDirections; | 155 | var dir = Section.sectionrouteDirections; |
| 201 | - | ||
| 202 | var lineId = Section.sectionrouteLine; | 156 | var lineId = Section.sectionrouteLine; |
| 203 | - | ||
| 204 | // 获取路段号元素,并添加下拉属性值 | 157 | // 获取路段号元素,并添加下拉属性值 |
| 205 | ajaxd.getStation(lineId,dir,function(treeData) { | 158 | ajaxd.getStation(lineId,dir,function(treeData) { |
| 206 | - | ||
| 207 | var options = '<option value="">请选择...</option>'; | 159 | var options = '<option value="">请选择...</option>'; |
| 208 | - | ||
| 209 | var dArray = treeData[0].children[1].children; | 160 | var dArray = treeData[0].children[1].children; |
| 210 | - | ||
| 211 | var eq_stationRouteCode = Section.sectionrouteCode; | 161 | var eq_stationRouteCode = Section.sectionrouteCode; |
| 212 | - | ||
| 213 | for(var i = 0 ; i<dArray.length; i++){ | 162 | for(var i = 0 ; i<dArray.length; i++){ |
| 214 | - | ||
| 215 | var ptions_v = dArray[i].sectionrouteCode; | 163 | var ptions_v = dArray[i].sectionrouteCode; |
| 216 | - | ||
| 217 | // 排除本站 | 164 | // 排除本站 |
| 218 | - if(eq_stationRouteCode == ptions_v){ | ||
| 219 | - | 165 | + if(eq_stationRouteCode == ptions_v) |
| 220 | continue; | 166 | continue; |
| 221 | - | ||
| 222 | - } | ||
| 223 | - | ||
| 224 | options += '<option value="'+ ptions_v +'">'+dArray[i].sectionName+'</option>' | 167 | options += '<option value="'+ ptions_v +'">'+dArray[i].sectionName+'</option>' |
| 225 | - | ||
| 226 | } | 168 | } |
| 227 | - | ||
| 228 | $('#sectionrouteCodeSelect').html(options); | 169 | $('#sectionrouteCodeSelect').html(options); |
| 229 | - | ||
| 230 | ajaxd.findUpSectionRouteCode(lineId,dir,eq_stationRouteCode,function(str) { | 170 | ajaxd.findUpSectionRouteCode(lineId,dir,eq_stationRouteCode,function(str) { |
| 231 | - | ||
| 232 | if(str.length>0){ | 171 | if(str.length>0){ |
| 233 | - | ||
| 234 | var upStationRouteCode = str[0].sectionrouteCode | 172 | var upStationRouteCode = str[0].sectionrouteCode |
| 235 | - | ||
| 236 | $('#sectionrouteCodeSelect').val(upStationRouteCode); | 173 | $('#sectionrouteCodeSelect').val(upStationRouteCode); |
| 237 | - | ||
| 238 | } | 174 | } |
| 239 | - | ||
| 240 | }); | 175 | }); |
| 241 | - | ||
| 242 | }); | 176 | }); |
| 243 | - | ||
| 244 | // 显示mobal | 177 | // 显示mobal |
| 245 | $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | 178 | $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false}); |
| 246 | - | ||
| 247 | // 当调用 hide 实例方法时触发 | 179 | // 当调用 hide 实例方法时触发 |
| 248 | $('#edit_section_mobal').on('hide.bs.modal', function () { | 180 | $('#edit_section_mobal').on('hide.bs.modal', function () { |
| 249 | - | ||
| 250 | closeMobleSetClean(); | 181 | closeMobleSetClean(); |
| 251 | - | ||
| 252 | }); | 182 | }); |
| 253 | - | ||
| 254 | function closeMobleSetClean() { | 183 | function closeMobleSetClean() { |
| 255 | - | ||
| 256 | // 清除地图覆盖物 | 184 | // 清除地图覆盖物 |
| 257 | map_.clearMarkAndOverlays(); | 185 | map_.clearMarkAndOverlays(); |
| 258 | - | ||
| 259 | /** 设置修改路段集合对象为空 */ | 186 | /** 设置修改路段集合对象为空 */ |
| 260 | section.setEitdSection({}); | 187 | section.setEitdSection({}); |
| 261 | - | ||
| 262 | fun.resjtreeDate(lineId,dir); | 188 | fun.resjtreeDate(lineId,dir); |
| 263 | - | ||
| 264 | fun.editAChangeCssRemoveDisabled(); | 189 | fun.editAChangeCssRemoveDisabled(); |
| 265 | - | ||
| 266 | ajaxd.getSectionRouteInfo(lineId,dir,function(data) { | 190 | ajaxd.getSectionRouteInfo(lineId,dir,function(data) { |
| 267 | - | ||
| 268 | fun.linePanlThree(lineId,data,dir); | 191 | fun.linePanlThree(lineId,data,dir); |
| 269 | - | ||
| 270 | }); | 192 | }); |
| 271 | - | ||
| 272 | } | 193 | } |
| 273 | - | ||
| 274 | // 编辑表单元素 | 194 | // 编辑表单元素 |
| 275 | var form = $('#edit_section__form'); | 195 | var form = $('#edit_section__form'); |
| 276 | - | ||
| 277 | // 获取错误提示元素 | 196 | // 获取错误提示元素 |
| 278 | var error = $('.alert-danger', form); | 197 | var error = $('.alert-danger', form); |
| 279 | - | ||
| 280 | // 提交数据按钮事件 | 198 | // 提交数据按钮事件 |
| 281 | $('#editSectionButton').on('click', function() { | 199 | $('#editSectionButton').on('click', function() { |
| 282 | - | ||
| 283 | - | ||
| 284 | // 表单提交 | 200 | // 表单提交 |
| 285 | form.submit(); | 201 | form.submit(); |
| 286 | - | ||
| 287 | }); | 202 | }); |
| 288 | 203 | ||
| 289 | // 表单验证 | 204 | // 表单验证 |
| @@ -392,42 +307,23 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | @@ -392,42 +307,23 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect | ||
| 392 | }, | 307 | }, |
| 393 | 308 | ||
| 394 | submitHandler : function(f) { | 309 | submitHandler : function(f) { |
| 395 | - | ||
| 396 | var params = form.serializeJSON(); | 310 | var params = form.serializeJSON(); |
| 397 | - | ||
| 398 | error.hide(); | 311 | error.hide(); |
| 399 | - | ||
| 400 | - console.log(params); | ||
| 401 | - | ||
| 402 | ajaxd.sectionUpdate(params,function(resuntDate) { | 312 | ajaxd.sectionUpdate(params,function(resuntDate) { |
| 403 | - | ||
| 404 | if(resuntDate.status=='SUCCESS') { | 313 | if(resuntDate.status=='SUCCESS') { |
| 405 | - | ||
| 406 | // 弹出添加成功提示消息 | 314 | // 弹出添加成功提示消息 |
| 407 | layer.msg('修改成功...'); | 315 | layer.msg('修改成功...'); |
| 408 | - | ||
| 409 | - | ||
| 410 | }else { | 316 | }else { |
| 411 | - | ||
| 412 | // 弹出添加失败提示消息 | 317 | // 弹出添加失败提示消息 |
| 413 | layer.msg('修改失败...'); | 318 | layer.msg('修改失败...'); |
| 414 | - | ||
| 415 | } | 319 | } |
| 416 | - | ||
| 417 | $('#edit_section_mobal').modal('hide'); | 320 | $('#edit_section_mobal').modal('hide'); |
| 418 | - | ||
| 419 | var dir = params.directions | 321 | var dir = params.directions |
| 420 | - | ||
| 421 | // 刷行左边树 | 322 | // 刷行左边树 |
| 422 | fun.resjtreeDate(lineId,dir); | 323 | fun.resjtreeDate(lineId,dir); |
| 423 | - | ||
| 424 | closeMobleSetClean(); | 324 | closeMobleSetClean(); |
| 425 | - | ||
| 426 | }); | 325 | }); |
| 427 | - | ||
| 428 | } | 326 | } |
| 429 | }); | 327 | }); |
| 430 | - | ||
| 431 | - | ||
| 432 | }); | 328 | }); |
| 433 | </script> | 329 | </script> |
| 434 | \ No newline at end of file | 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,13 +169,9 @@ var GetAjaxData = function(){ | ||
| 169 | 169 | ||
| 170 | // 查询路段信息 | 170 | // 查询路段信息 |
| 171 | getSectionRouteInfo : function(lineId,direction,callback) { | 171 | getSectionRouteInfo : function(lineId,direction,callback) { |
| 172 | - | ||
| 173 | $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) { | 172 | $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) { |
| 174 | - | ||
| 175 | callback && callback(resultdata); | 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,199 +22,222 @@ $(function(){ | ||
| 22 | 22 | ||
| 23 | // 上行站点其它规划点击事件 | 23 | // 上行站点其它规划点击事件 |
| 24 | $('.upManual').on('click',function() { | 24 | $('.upManual').on('click',function() { |
| 25 | - | ||
| 26 | // 加载其它规划选择弹出层mobal页面 | 25 | // 加载其它规划选择弹出层mobal页面 |
| 27 | $.get('add_manual_select.html', function(m){ | 26 | $.get('add_manual_select.html', function(m){ |
| 28 | - | ||
| 29 | $(pjaxContainer).append(m); | 27 | $(pjaxContainer).append(m); |
| 30 | - | ||
| 31 | $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]); | 28 | $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]); |
| 32 | - | ||
| 33 | }); | 29 | }); |
| 34 | 30 | ||
| 35 | }); | 31 | }); |
| 36 | 32 | ||
| 37 | // 上行站点新增事件 | 33 | // 上行站点新增事件 |
| 38 | $('.module_tools #addUpStation').on('click', function() { | 34 | $('.module_tools #addUpStation').on('click', function() { |
| 39 | - | ||
| 40 | /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */ | 35 | /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */ |
| 41 | AddStationObj.setAddStationDiraction(directionUpValue); | 36 | AddStationObj.setAddStationDiraction(directionUpValue); |
| 42 | - | ||
| 43 | // 加载选择新增方式mobal | 37 | // 加载选择新增方式mobal |
| 44 | $.get('add_select.html', function(m){ | 38 | $.get('add_select.html', function(m){ |
| 45 | - | ||
| 46 | $(pjaxContainer).append(m); | 39 | $(pjaxContainer).append(m); |
| 47 | - | ||
| 48 | $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]); | 40 | $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]); |
| 49 | - | ||
| 50 | }); | 41 | }); |
| 51 | - | ||
| 52 | }); | 42 | }); |
| 53 | 43 | ||
| 54 | // 修改上行站点mobal页面 | 44 | // 修改上行站点mobal页面 |
| 55 | $('.module_tools #editUpStation').on('click', function(){ | 45 | $('.module_tools #editUpStation').on('click', function(){ |
| 56 | - | ||
| 57 | var sel = PublicFunctions.getCurrSelNode(directionUpValue); | 46 | var sel = PublicFunctions.getCurrSelNode(directionUpValue); |
| 58 | - | ||
| 59 | if(sel.length==0 || sel[0].original.chaildredType !='station'){ | 47 | if(sel.length==0 || sel[0].original.chaildredType !='station'){ |
| 60 | - | ||
| 61 | layer.msg('请先选择要编辑的上行站点!'); | 48 | layer.msg('请先选择要编辑的上行站点!'); |
| 62 | - | ||
| 63 | return; | 49 | return; |
| 64 | } | 50 | } |
| 65 | - | ||
| 66 | $.get('edit_select.html', function(m){ | 51 | $.get('edit_select.html', function(m){ |
| 67 | - | ||
| 68 | $(pjaxContainer).append(m); | 52 | $(pjaxContainer).append(m); |
| 69 | - | ||
| 70 | $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionUpValue]); | 53 | $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionUpValue]); |
| 71 | }); | 54 | }); |
| 72 | - | ||
| 73 | }); | 55 | }); |
| 74 | 56 | ||
| 75 | // 撤销上行站点 | 57 | // 撤销上行站点 |
| 76 | $('.module_tools #deleteUpStation').on('click', function() { | 58 | $('.module_tools #deleteUpStation').on('click', function() { |
| 77 | - | ||
| 78 | PublicFunctions.stationRevoke(directionUpValue); | 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 | $('#leftUpOrDown #upLine').on('click', function(){ | 161 | $('#leftUpOrDown #upLine').on('click', function(){ |
| 91 | - | ||
| 92 | var lineIdEvents = LineObj.getLineObj(); | 162 | var lineIdEvents = LineObj.getLineObj(); |
| 93 | - | ||
| 94 | GetAjaxData.getSectionRouteInfo(lineIdEvents.id,directionUpValue,function(data) { | 163 | GetAjaxData.getSectionRouteInfo(lineIdEvents.id,directionUpValue,function(data) { |
| 95 | - | ||
| 96 | PublicFunctions.linePanlThree(lineIdEvents.id,data,directionUpValue); | 164 | PublicFunctions.linePanlThree(lineIdEvents.id,data,directionUpValue); |
| 97 | - | ||
| 98 | }); | 165 | }); |
| 99 | - | ||
| 100 | }); | 166 | }); |
| 101 | 167 | ||
| 102 | // 系统规划下行站点 | 168 | // 系统规划下行站点 |
| 103 | $('.downSystem').on('click',function() { | 169 | $('.downSystem').on('click',function() { |
| 104 | - | ||
| 105 | // 隐藏下行规划 | 170 | // 隐藏下行规划 |
| 106 | $('#downToolsMobal').hide(); | 171 | $('#downToolsMobal').hide(); |
| 107 | - | ||
| 108 | // 弹出正在加载层 | 172 | // 弹出正在加载层 |
| 109 | var i = layer.load(0,{offset:['200px', '280px']}); | 173 | var i = layer.load(0,{offset:['200px', '280px']}); |
| 110 | - | ||
| 111 | /** 修正线路名称 @param:<directionUpValue:方向(上行)> */ | 174 | /** 修正线路名称 @param:<directionUpValue:方向(上行)> */ |
| 112 | PublicFunctions.lineNameIsHaveInterval(directionDownValue); | 175 | PublicFunctions.lineNameIsHaveInterval(directionDownValue); |
| 113 | - | ||
| 114 | }); | 176 | }); |
| 115 | 177 | ||
| 116 | // 下行站点其它规划点击事件 | 178 | // 下行站点其它规划点击事件 |
| 117 | $('.downManual').on('click',function() { | 179 | $('.downManual').on('click',function() { |
| 118 | - | ||
| 119 | // 加载其它规划选择弹出层mobal页面 | 180 | // 加载其它规划选择弹出层mobal页面 |
| 120 | $.get('add_manual_select.html', function(m){ | 181 | $.get('add_manual_select.html', function(m){ |
| 121 | - | ||
| 122 | $(pjaxContainer).append(m); | 182 | $(pjaxContainer).append(m); |
| 123 | - | ||
| 124 | $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]); | 183 | $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]); |
| 125 | - | ||
| 126 | }); | 184 | }); |
| 127 | - | ||
| 128 | }); | 185 | }); |
| 129 | 186 | ||
| 130 | // 下行站点新增事件 | 187 | // 下行站点新增事件 |
| 131 | $('.module_tools #addDownStation').on('click', function() { | 188 | $('.module_tools #addDownStation').on('click', function() { |
| 132 | - | ||
| 133 | /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */ | 189 | /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */ |
| 134 | AddStationObj.setAddStationDiraction(directionDownValue); | 190 | AddStationObj.setAddStationDiraction(directionDownValue); |
| 135 | - | ||
| 136 | // 加载选择新增方式mobal | 191 | // 加载选择新增方式mobal |
| 137 | $.get('add_select.html', function(m){ | 192 | $.get('add_select.html', function(m){ |
| 138 | - | ||
| 139 | $(pjaxContainer).append(m); | 193 | $(pjaxContainer).append(m); |
| 140 | - | ||
| 141 | $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]); | 194 | $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]); |
| 142 | - | ||
| 143 | }); | 195 | }); |
| 144 | - | ||
| 145 | }); | 196 | }); |
| 146 | 197 | ||
| 147 | // 修改下行站点mobal页面 | 198 | // 修改下行站点mobal页面 |
| 148 | $('.module_tools #editDownStation').on('click', function(){ | 199 | $('.module_tools #editDownStation').on('click', function(){ |
| 149 | - | ||
| 150 | var sel = PublicFunctions.getCurrSelNode(directionDownValue); | 200 | var sel = PublicFunctions.getCurrSelNode(directionDownValue); |
| 151 | - | ||
| 152 | if(sel.length==0 || sel[0].original.chaildredType !='station'){ | 201 | if(sel.length==0 || sel[0].original.chaildredType !='station'){ |
| 153 | - | ||
| 154 | layer.msg('请先选择要编辑的下行站点!'); | 202 | layer.msg('请先选择要编辑的下行站点!'); |
| 155 | - | ||
| 156 | return; | 203 | return; |
| 157 | } | 204 | } |
| 158 | - | ||
| 159 | $.get('edit_select.html', function(m){ | 205 | $.get('edit_select.html', function(m){ |
| 160 | - | ||
| 161 | $(pjaxContainer).append(m); | 206 | $(pjaxContainer).append(m); |
| 162 | - | ||
| 163 | $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionDownValue]); | 207 | $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionDownValue]); |
| 164 | }); | 208 | }); |
| 165 | - | ||
| 166 | }); | 209 | }); |
| 167 | 210 | ||
| 168 | // 撤销下行站点 | 211 | // 撤销下行站点 |
| 169 | $('.module_tools #deleteDownStation').on('click', function() { | 212 | $('.module_tools #deleteDownStation').on('click', function() { |
| 170 | - | ||
| 171 | PublicFunctions.stationRevoke(directionDownValue); | 213 | PublicFunctions.stationRevoke(directionDownValue); |
| 172 | - | ||
| 173 | }); | 214 | }); |
| 174 | 215 | ||
| 175 | // 编辑线路下行走向 | 216 | // 编辑线路下行走向 |
| 176 | $('.module_tools #editDownlineTrend').on('click', function() { | 217 | $('.module_tools #editDownlineTrend').on('click', function() { |
| 177 | - | ||
| 178 | PublicFunctions.editLinePlan(directionDownValue); | 218 | PublicFunctions.editLinePlan(directionDownValue); |
| 179 | - | ||
| 180 | }); | 219 | }); |
| 181 | 220 | ||
| 182 | // 线路下行 | 221 | // 线路下行 |
| 183 | $('#leftUpOrDown #downLine').on('click', function(){ | 222 | $('#leftUpOrDown #downLine').on('click', function(){ |
| 184 | - | ||
| 185 | var lineIdEvents = LineObj.getLineObj(); | 223 | var lineIdEvents = LineObj.getLineObj(); |
| 186 | - | ||
| 187 | GetAjaxData.getSectionRouteInfo(lineIdEvents.id,directionDownValue,function(data) { | 224 | GetAjaxData.getSectionRouteInfo(lineIdEvents.id,directionDownValue,function(data) { |
| 188 | - | ||
| 189 | PublicFunctions.linePanlThree(lineIdEvents.id,data,directionDownValue); | 225 | PublicFunctions.linePanlThree(lineIdEvents.id,data,directionDownValue); |
| 190 | - | ||
| 191 | }); | 226 | }); |
| 192 | - | ||
| 193 | }); | 227 | }); |
| 194 | 228 | ||
| 195 | // 生成行单 | 229 | // 生成行单 |
| 196 | $('.module_tools #createUsingSingle').on('click', function() { | 230 | $('.module_tools #createUsingSingle').on('click', function() { |
| 197 | - | ||
| 198 | var lineIdEvents = LineObj.getLineObj(); | 231 | var lineIdEvents = LineObj.getLineObj(); |
| 199 | - | ||
| 200 | var params = {lineId:lineIdEvents.id}; | 232 | var params = {lineId:lineIdEvents.id}; |
| 201 | - | ||
| 202 | GetAjaxData.createUsingSingle(params,function(data) { | 233 | GetAjaxData.createUsingSingle(params,function(data) { |
| 203 | - | ||
| 204 | if(data.status=='SUCCESS') { | 234 | if(data.status=='SUCCESS') { |
| 205 | - | ||
| 206 | // 弹出添加成功提示消息 | 235 | // 弹出添加成功提示消息 |
| 207 | layer.msg('生成成功...'); | 236 | layer.msg('生成成功...'); |
| 208 | - | ||
| 209 | }else { | 237 | }else { |
| 210 | - | ||
| 211 | // 弹出添加失败提示消息 | 238 | // 弹出添加失败提示消息 |
| 212 | layer.msg('生成失败...'); | 239 | layer.msg('生成失败...'); |
| 213 | - | ||
| 214 | } | 240 | } |
| 215 | - | ||
| 216 | }); | 241 | }); |
| 217 | - | ||
| 218 | }); | 242 | }); |
| 219 | - | ||
| 220 | }); | 243 | }); |
| 221 | \ No newline at end of file | 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,7 +478,6 @@ var PublicFunctions = function () { | ||
| 478 | $('#upLine').addClass('btn disabled'); | 478 | $('#upLine').addClass('btn disabled'); |
| 479 | 479 | ||
| 480 | var editSectionV = sel[0].original; | 480 | var editSectionV = sel[0].original; |
| 481 | - | ||
| 482 | EditSectionObj.setEitdSection(editSectionV); | 481 | EditSectionObj.setEitdSection(editSectionV); |
| 483 | 482 | ||
| 484 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | 483 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) |
| @@ -634,80 +633,53 @@ var PublicFunctions = function () { | @@ -634,80 +633,53 @@ var PublicFunctions = function () { | ||
| 634 | 633 | ||
| 635 | /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | 634 | /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ |
| 636 | linePanlThree : function(lineId,data,direction) { | 635 | linePanlThree : function(lineId,data,direction) { |
| 637 | - | ||
| 638 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | 636 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ |
| 639 | GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) { | 637 | GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) { |
| 640 | - | ||
| 641 | WorldsBMap.clearMarkAndOverlays(); | 638 | WorldsBMap.clearMarkAndOverlays(); |
| 642 | - | ||
| 643 | var polyline_center; | 639 | var polyline_center; |
| 644 | - | ||
| 645 | // 如果站点路由数据不为空 | 640 | // 如果站点路由数据不为空 |
| 646 | if(resultdata.length>0) { | 641 | if(resultdata.length>0) { |
| 647 | - | ||
| 648 | var ceter_index = Math.round(resultdata.length / 2); | 642 | var ceter_index = Math.round(resultdata.length / 2); |
| 649 | - | ||
| 650 | var ceterPointsStr = resultdata[ceter_index].bJwpoints; | 643 | var ceterPointsStr = resultdata[ceter_index].bJwpoints; |
| 651 | - | ||
| 652 | var ceterPointsArray = ceterPointsStr.split(' '); | 644 | var ceterPointsArray = ceterPointsStr.split(' '); |
| 653 | - | ||
| 654 | polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]); | 645 | polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]); |
| 655 | - | ||
| 656 | // 遍历站点路由数据 | 646 | // 遍历站点路由数据 |
| 657 | for(var s = 0 ; s<resultdata.length;s++) { | 647 | for(var s = 0 ; s<resultdata.length;s++) { |
| 658 | - | ||
| 659 | // 中心点坐标字符串 | 648 | // 中心点坐标字符串 |
| 660 | var bJwpointsStr = resultdata[s].bJwpoints; | 649 | var bJwpointsStr = resultdata[s].bJwpoints; |
| 661 | - | ||
| 662 | var stationName = resultdata[s].stationName; | 650 | var stationName = resultdata[s].stationName; |
| 663 | - | ||
| 664 | // 起个中心点坐标字符串 | 651 | // 起个中心点坐标字符串 |
| 665 | var bJwpointsArray = bJwpointsStr.split(' '); | 652 | var bJwpointsArray = bJwpointsStr.split(' '); |
| 666 | - | ||
| 667 | // 设置中心点 | 653 | // 设置中心点 |
| 668 | var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); | 654 | var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); |
| 669 | - | ||
| 670 | /** 在地图上画点 @param:<point_center:中心坐标点> */ | 655 | /** 在地图上画点 @param:<point_center:中心坐标点> */ |
| 671 | WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1); | 656 | WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1); |
| 672 | - | ||
| 673 | } | 657 | } |
| 674 | 658 | ||
| 675 | } | 659 | } |
| 676 | - | ||
| 677 | // 路段数据长度 | 660 | // 路段数据长度 |
| 678 | var dataLen = data.length; | 661 | var dataLen = data.length; |
| 679 | //debugger; | 662 | //debugger; |
| 680 | // 如果大于零 | 663 | // 如果大于零 |
| 681 | if(dataLen>0) { | 664 | if(dataLen>0) { |
| 682 | - | ||
| 683 | // 编辑路段数据 | 665 | // 编辑路段数据 |
| 684 | for(var d= 0; d<dataLen;d++){ | 666 | for(var d= 0; d<dataLen;d++){ |
| 685 | - | ||
| 686 | // 地图折线坐标点集合 | 667 | // 地图折线坐标点集合 |
| 687 | var polylineArray = []; | 668 | var polylineArray = []; |
| 688 | - | ||
| 689 | // 获取路段折线坐标字符串 | 669 | // 获取路段折线坐标字符串 |
| 690 | var sectionBsectionVectorStr = data[d].sectionBsectionVector; | 670 | var sectionBsectionVectorStr = data[d].sectionBsectionVector; |
| 691 | - | ||
| 692 | - if(sectionBsectionVectorStr==null) { | ||
| 693 | - | 671 | + if(sectionBsectionVectorStr==null) |
| 694 | continue; | 672 | continue; |
| 695 | - | ||
| 696 | - } | ||
| 697 | - | ||
| 698 | // 切割段折线坐标字符串 | 673 | // 切割段折线坐标字符串 |
| 699 | var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); | 674 | var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); |
| 700 | - | ||
| 701 | // 分割折线坐标字符串 | 675 | // 分割折线坐标字符串 |
| 702 | var lineArray = tempStr.split(','); | 676 | var lineArray = tempStr.split(','); |
| 703 | - | ||
| 704 | for(var i = 0;i<lineArray.length;i++) { | 677 | for(var i = 0;i<lineArray.length;i++) { |
| 705 | - | ||
| 706 | polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | 678 | polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); |
| 707 | - | ||
| 708 | } | 679 | } |
| 709 | /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | 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,48 +720,27 @@ var PublicFunctions = function () { | ||
| 748 | 720 | ||
| 749 | // 下行 | 721 | // 下行 |
| 750 | }else if(diraction ==1) { | 722 | }else if(diraction ==1) { |
| 751 | - | ||
| 752 | /** 出事画下行树 @param:<treeDateJson:树数据结构> */ | 723 | /** 出事画下行树 @param:<treeDateJson:树数据结构> */ |
| 753 | StationTreeData.downInit(treeDateJson); | 724 | StationTreeData.downInit(treeDateJson); |
| 754 | - | ||
| 755 | if(len>0) { | 725 | if(len>0) { |
| 756 | - | ||
| 757 | $('#downToolsMobal').hide(); | 726 | $('#downToolsMobal').hide(); |
| 758 | - | ||
| 759 | $('#DowntreeMobal').show(); | 727 | $('#DowntreeMobal').show(); |
| 760 | - | ||
| 761 | }else { | 728 | }else { |
| 762 | - | ||
| 763 | $('#downToolsMobal').show(); | 729 | $('#downToolsMobal').show(); |
| 764 | - | ||
| 765 | $('#DowntreeMobal').hide(); | 730 | $('#DowntreeMobal').hide(); |
| 766 | - | ||
| 767 | } | 731 | } |
| 768 | - | ||
| 769 | } | 732 | } |
| 770 | - | ||
| 771 | }); | 733 | }); |
| 772 | - | ||
| 773 | }, | 734 | }, |
| 774 | - | ||
| 775 | isHaveStationName : function(data) { | 735 | isHaveStationName : function(data) { |
| 776 | - | ||
| 777 | if(data.length>0) { | 736 | if(data.length>0) { |
| 778 | - | ||
| 779 | layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ | 737 | layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ |
| 780 | - | ||
| 781 | layer.close(index); | 738 | layer.close(index); |
| 782 | - | ||
| 783 | }); | 739 | }); |
| 784 | - | ||
| 785 | return false; | 740 | return false; |
| 786 | - | ||
| 787 | }else { | 741 | }else { |
| 788 | - | ||
| 789 | return true; | 742 | return true; |
| 790 | - | ||
| 791 | } | 743 | } |
| 792 | - | ||
| 793 | }, | 744 | }, |
| 794 | 745 | ||
| 795 | editAChangeCssRemoveDisabled : function() { | 746 | editAChangeCssRemoveDisabled : function() { |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
| @@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
| 25 | var WorldsBMap = function () { | 25 | var WorldsBMap = function () { |
| 26 | 26 | ||
| 27 | /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆 */ | 27 | /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆 */ |
| 28 | - var mapBValue = '';polygon='',polyUpline='',circle=''; | 28 | + var mapBValue = '';polygon='',polyUpline='',circle='',iseditStatus = false; |
| 29 | 29 | ||
| 30 | var Bmap = { | 30 | var Bmap = { |
| 31 | 31 | ||
| @@ -80,6 +80,14 @@ var WorldsBMap = function () { | @@ -80,6 +80,14 @@ var WorldsBMap = function () { | ||
| 80 | return circle; | 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 | initDrawingManager: function(map,styleOptions) { | 91 | initDrawingManager: function(map,styleOptions) { |
| 84 | 92 | ||
| 85 | }, | 93 | }, |
| @@ -339,40 +347,26 @@ var WorldsBMap = function () { | @@ -339,40 +347,26 @@ var WorldsBMap = function () { | ||
| 339 | }, | 347 | }, |
| 340 | 348 | ||
| 341 | editPolyUpline : function() { | 349 | editPolyUpline : function() { |
| 342 | - | ||
| 343 | // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | 350 | // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) |
| 344 | polyUpline.disableMassClear(); | 351 | polyUpline.disableMassClear(); |
| 345 | - | ||
| 346 | WorldsBMap.clearMarkAndOverlays(); | 352 | WorldsBMap.clearMarkAndOverlays(); |
| 347 | - | ||
| 348 | // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | 353 | // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) |
| 349 | polyUpline.enableMassClear(); | 354 | polyUpline.enableMassClear(); |
| 350 | - | ||
| 351 | // 开启线路编辑 | 355 | // 开启线路编辑 |
| 352 | polyUpline.enableEditing(); | 356 | polyUpline.enableEditing(); |
| 353 | - | ||
| 354 | // 添加双击折线保存事件 | 357 | // 添加双击折线保存事件 |
| 355 | polyUpline.addEventListener('dblclick',function(e) { | 358 | polyUpline.addEventListener('dblclick',function(e) { |
| 356 | - | ||
| 357 | // 关闭 | 359 | // 关闭 |
| 358 | layer.closeAll(); | 360 | layer.closeAll(); |
| 359 | - | ||
| 360 | polyUpline.disableEditing(); | 361 | polyUpline.disableEditing(); |
| 361 | - | ||
| 362 | // 获取折线坐标集合 | 362 | // 获取折线坐标集合 |
| 363 | var editPloyLineArray = polyUpline.getPath(); | 363 | var editPloyLineArray = polyUpline.getPath(); |
| 364 | - | ||
| 365 | EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | 364 | EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); |
| 366 | - | ||
| 367 | polyUpline= ''; | 365 | polyUpline= ''; |
| 368 | - | ||
| 369 | // 加载修改路段弹出层mobal页面 | 366 | // 加载修改路段弹出层mobal页面 |
| 370 | $.get('editsection.html', function(m){ | 367 | $.get('editsection.html', function(m){ |
| 371 | - | ||
| 372 | $(pjaxContainer).append(m); | 368 | $(pjaxContainer).append(m); |
| 373 | - | ||
| 374 | $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]); | 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,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 | /*WorldsBMap.clearMarkAndOverlays();*/ | 649 | /*WorldsBMap.clearMarkAndOverlays();*/ |
| 657 | polyUpline = ''; | 650 | polyUpline = ''; |
| 658 | - | ||
| 659 | // 创建线路走向 | 651 | // 创建线路走向 |
| 660 | polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | 652 | polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); |
| 661 | - | 653 | + // polyUpline.data = data; |
| 662 | // 把折线添加到地图上 | 654 | // 把折线添加到地图上 |
| 663 | mapBValue.addOverlay(polyUpline); | 655 | mapBValue.addOverlay(polyUpline); |
| 664 | - | ||
| 665 | /*var ceter_index = Math.round(resultdata.length / 2); | 656 | /*var ceter_index = Math.round(resultdata.length / 2); |
| 666 | 657 | ||
| 667 | var ceterPointsStr = resultdata[ceter_index].bJwpoints; | 658 | var ceterPointsStr = resultdata[ceter_index].bJwpoints; |
| @@ -669,17 +660,52 @@ var WorldsBMap = function () { | @@ -669,17 +660,52 @@ var WorldsBMap = function () { | ||
| 669 | var ceterPointsArray = ceterPointsStr.split(' '); | 660 | var ceterPointsArray = ceterPointsStr.split(' '); |
| 670 | 661 | ||
| 671 | var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*/ | 662 | var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*/ |
| 672 | - | ||
| 673 | var PanOptions_ ={noAnimation :true}; | 663 | var PanOptions_ ={noAnimation :true}; |
| 674 | - | ||
| 675 | mapBValue.reset(); | 664 | mapBValue.reset(); |
| 676 | - | ||
| 677 | mapBValue.panTo(polyline_center,PanOptions_); | 665 | mapBValue.panTo(polyline_center,PanOptions_); |
| 678 | - | ||
| 679 | mapBValue.panBy(500,-510,PanOptions_); | 666 | mapBValue.panBy(500,-510,PanOptions_); |
| 680 | - | ||
| 681 | mapBValue.setZoom(14); | 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 | /** 在地图上画点 @param:<point_center:中心坐标点> */ | 711 | /** 在地图上画点 @param:<point_center:中心坐标点> */ |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-reload.js
| @@ -7,38 +7,18 @@ | @@ -7,38 +7,18 @@ | ||
| 7 | $(function(){ | 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 | // 获取参数线路ID | 11 | // 获取参数线路ID |
| 17 | var id = $.url().param('no'); | 12 | var id = $.url().param('no'); |
| 18 | - | ||
| 19 | // 如果线路ID不为空 | 13 | // 如果线路ID不为空 |
| 20 | if(id) { | 14 | if(id) { |
| 21 | - | ||
| 22 | var styleOptions = { | 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 | // 等候500毫秒执行 | 24 | // 等候500毫秒执行 |
src/main/resources/static/pages/base/stationroute/list.html
| 1 | <link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" /> | 1 | <link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" /> |
| 2 | - | ||
| 3 | <div class="portlet-body"> | 2 | <div class="portlet-body"> |
| 4 | - | ||
| 5 | <!-- 地图 --> | 3 | <!-- 地图 --> |
| 6 | <div id="bmap_basic" class="bmaps"></div> | 4 | <div id="bmap_basic" class="bmaps"></div> |
| 7 | - | ||
| 8 | - | ||
| 9 | <div class="portlet box protlet-box" style="top:20px"> | 5 | <div class="portlet box protlet-box" style="top:20px"> |
| 10 | - | ||
| 11 | <!-- 左边标题栏 --> | 6 | <!-- 左边标题栏 --> |
| 12 | <div class="portlet-title" style="background-color:#3B3F51"> | 7 | <div class="portlet-title" style="background-color:#3B3F51"> |
| 13 | <div class="caption"> | 8 | <div class="caption"> |
| @@ -17,13 +12,9 @@ | @@ -17,13 +12,9 @@ | ||
| 17 | <a href="javascript:;" class="collapse" data-original-title="" title=""> </a> | 12 | <a href="javascript:;" class="collapse" data-original-title="" title=""> </a> |
| 18 | </div> | 13 | </div> |
| 19 | </div> | 14 | </div> |
| 20 | - | ||
| 21 | - | ||
| 22 | <!-- 左边栏 --> | 15 | <!-- 左边栏 --> |
| 23 | <div class="portlet-body" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 200px;"> | 16 | <div class="portlet-body" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 200px;"> |
| 24 | - | ||
| 25 | <div class="row"> | 17 | <div class="row"> |
| 26 | - | ||
| 27 | <!-- 上下行栏 --> | 18 | <!-- 上下行栏 --> |
| 28 | <div class="col-md-3 col-sm-3 col-xs-3"> | 19 | <div class="col-md-3 col-sm-3 col-xs-3"> |
| 29 | <ul class="nav nav-tabs tabs-left" id="leftUpOrDown"> | 20 | <ul class="nav nav-tabs tabs-left" id="leftUpOrDown"> |
| @@ -35,13 +26,10 @@ | @@ -35,13 +26,10 @@ | ||
| 35 | </li> | 26 | </li> |
| 36 | </ul> | 27 | </ul> |
| 37 | </div> | 28 | </div> |
| 38 | - | ||
| 39 | <div class="col-md-9 col-sm-9 col-xs-9"> | 29 | <div class="col-md-9 col-sm-9 col-xs-9"> |
| 40 | <div class="tab-content"> | 30 | <div class="tab-content"> |
| 41 | - | ||
| 42 | <!-- 左边栏上行 --> | 31 | <!-- 左边栏上行 --> |
| 43 | <div class="tab-pane active in" id="stationUp" data-direction="0"> | 32 | <div class="tab-pane active in" id="stationUp" data-direction="0"> |
| 44 | - | ||
| 45 | <div class="portlet-body" id="uptreeMobal" style="display: none"> | 33 | <div class="portlet-body" id="uptreeMobal" style="display: none"> |
| 46 | <div class="table-toolbar"> | 34 | <div class="table-toolbar"> |
| 47 | <div class="row"> | 35 | <div class="row"> |
| @@ -71,8 +59,15 @@ | @@ -71,8 +59,15 @@ | ||
| 71 | </li> | 59 | </li> |
| 72 | <li class="divider"> </li> | 60 | <li class="divider"> </li> |
| 73 | <li> | 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 | </li> | 67 | </li> |
| 68 | + <!-- <li> | ||
| 69 | + <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a> | ||
| 70 | + </li> --> | ||
| 76 | <!-- <li> | 71 | <!-- <li> |
| 77 | <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a> | 72 | <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a> |
| 78 | </li> --> | 73 | </li> --> |
| @@ -88,7 +83,6 @@ | @@ -88,7 +83,6 @@ | ||
| 88 | <div id="station_Up_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div> | 83 | <div id="station_Up_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div> |
| 89 | </div> | 84 | </div> |
| 90 | </div> | 85 | </div> |
| 91 | - | ||
| 92 | <!-- 无上行站点添加方式 --> | 86 | <!-- 无上行站点添加方式 --> |
| 93 | <div id="upToolsMobal" class="portlet-body" style="display:none"> | 87 | <div id="upToolsMobal" class="portlet-body" style="display:none"> |
| 94 | <div class="row"> | 88 | <div class="row"> |
| @@ -156,8 +150,15 @@ | @@ -156,8 +150,15 @@ | ||
| 156 | </li> | 150 | </li> |
| 157 | <li class="divider"> </li> | 151 | <li class="divider"> </li> |
| 158 | <li> | 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 | </li> | 158 | </li> |
| 159 | + <!-- <li> | ||
| 160 | + <a href="javascript:;" id="editDownlineTrend"><i class="fa fa-close"></i> 编辑走向</a> | ||
| 161 | + </li> --> | ||
| 161 | </ul> | 162 | </ul> |
| 162 | </div> | 163 | </div> |
| 163 | </div> | 164 | </div> |
| @@ -170,7 +171,6 @@ | @@ -170,7 +171,6 @@ | ||
| 170 | <div id="station_Down_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div> | 171 | <div id="station_Down_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div> |
| 171 | </div> | 172 | </div> |
| 172 | </div> | 173 | </div> |
| 173 | - | ||
| 174 | <!-- 无上行站点添加方式 --> | 174 | <!-- 无上行站点添加方式 --> |
| 175 | <div id="downToolsMobal" class="portlet-body" style="display:none"> | 175 | <div id="downToolsMobal" class="portlet-body" style="display:none"> |
| 176 | <div class="row"> | 176 | <div class="row"> |
| @@ -213,33 +213,23 @@ | @@ -213,33 +213,23 @@ | ||
| 213 | </div> | 213 | </div> |
| 214 | <!-- 线路类 --> | 214 | <!-- 线路类 --> |
| 215 | <script src="/pages/base/stationroute/js/line.js"></script> | 215 | <script src="/pages/base/stationroute/js/line.js"></script> |
| 216 | - | ||
| 217 | <!-- 新增站点对象类 --> | 216 | <!-- 新增站点对象类 --> |
| 218 | <script src="/pages/base/stationroute/js/addstationobj.js"></script> | 217 | <script src="/pages/base/stationroute/js/addstationobj.js"></script> |
| 219 | - | ||
| 220 | <!-- 修改站点对象类 --> | 218 | <!-- 修改站点对象类 --> |
| 221 | <script src="/pages/base/stationroute/js/editstationobj.js"></script> | 219 | <script src="/pages/base/stationroute/js/editstationobj.js"></script> |
| 222 | - | ||
| 223 | <!-- 修改路段对象类 --> | 220 | <!-- 修改路段对象类 --> |
| 224 | <script src="/pages/base/stationroute/js/editsection.js"></script> | 221 | <script src="/pages/base/stationroute/js/editsection.js"></script> |
| 225 | - | ||
| 226 | <!-- 绘图类 --> | 222 | <!-- 绘图类 --> |
| 227 | <script src="/pages/base/stationroute/js/drawingManager.js"></script> | 223 | <script src="/pages/base/stationroute/js/drawingManager.js"></script> |
| 228 | - | ||
| 229 | <!-- 地图类 --> | 224 | <!-- 地图类 --> |
| 230 | <script src="/pages/base/stationroute/js/stationroute-list-map.js"></script> | 225 | <script src="/pages/base/stationroute/js/stationroute-list-map.js"></script> |
| 231 | - | ||
| 232 | <!-- 函数与方法 --> | 226 | <!-- 函数与方法 --> |
| 233 | <script src="/pages/base/stationroute/js/stationroute-list-function.js"></script> | 227 | <script src="/pages/base/stationroute/js/stationroute-list-function.js"></script> |
| 234 | - | ||
| 235 | <!-- ajax请求类 --> | 228 | <!-- ajax请求类 --> |
| 236 | <script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> | 229 | <script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> |
| 237 | - | ||
| 238 | <!-- 树对类 --> | 230 | <!-- 树对类 --> |
| 239 | <script src="/pages/base/stationroute/js/stationroute-list-treedata.js"></script> | 231 | <script src="/pages/base/stationroute/js/stationroute-list-treedata.js"></script> |
| 240 | - | ||
| 241 | <!-- reload事件 --> | 232 | <!-- reload事件 --> |
| 242 | <script src="/pages/base/stationroute/js/stationroute-list-reload.js"></script> | 233 | <script src="/pages/base/stationroute/js/stationroute-list-reload.js"></script> |
| 243 | - | ||
| 244 | <!-- 事件监听 --> | 234 | <!-- 事件监听 --> |
| 245 | <script src="/pages/base/stationroute/js/stationroute-list-events.js"></script> | 235 | <script src="/pages/base/stationroute/js/stationroute-list-events.js"></script> |
| 246 | \ No newline at end of file | 236 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/common/dts2/ttinfotable/saTimeTable.js
| @@ -7,123 +7,351 @@ | @@ -7,123 +7,351 @@ | ||
| 7 | * TODO:优化开发中 | 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('ScheduleApp').directive('saBcgroup', [ | @@ -3705,126 +3705,354 @@ angular.module('ScheduleApp').directive('saBcgroup', [ | ||
| 3705 | * TODO:优化开发中 | 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 | * saScpdate指令(非通用指令,只在排版计划form中使用)。 | 4058 | * saScpdate指令(非通用指令,只在排版计划form中使用)。 |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| @@ -1149,7 +1149,7 @@ ScheduleApp.config([ | @@ -1149,7 +1149,7 @@ ScheduleApp.config([ | ||
| 1149 | } | 1149 | } |
| 1150 | }) | 1150 | }) |
| 1151 | .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑 | 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 | views: { | 1153 | views: { |
| 1154 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'} | 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,6 +59,12 @@ | ||
| 59 | 批量修改 | 59 | 批量修改 |
| 60 | </a> | 60 | </a> |
| 61 | </li> | 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 | <li class="divider"></li> | 68 | <li class="divider"></li> |
| 63 | <li> | 69 | <li> |
| 64 | <a href="javascript:" class="tool-action" ng-click="ctrl.clearsel()"> | 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,7 +82,7 @@ ScheduleApp.config([ | ||
| 82 | } | 82 | } |
| 83 | }) | 83 | }) |
| 84 | .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑 | 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 | views: { | 86 | views: { |
| 87 | "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'} | 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('ScheduleApp').factory( | @@ -5,7 +5,8 @@ angular.module('ScheduleApp').factory( | ||
| 5 | 'TimeTableDetailManageService_g', | 5 | 'TimeTableDetailManageService_g', |
| 6 | '$state', | 6 | '$state', |
| 7 | '$q', | 7 | '$q', |
| 8 | - function(service, $state, $q) { | 8 | + 'SaTimeTableUtils', |
| 9 | + function(service, $state, $q, SaTimeTableUtils) { | ||
| 9 | 10 | ||
| 10 | // 查询对象类 | 11 | // 查询对象类 |
| 11 | var queryClass = service.rest; | 12 | var queryClass = service.rest; |
| @@ -14,6 +15,7 @@ angular.module('ScheduleApp').factory( | @@ -14,6 +15,7 @@ angular.module('ScheduleApp').factory( | ||
| 14 | var editInfo = { | 15 | var editInfo = { |
| 15 | detailHeads: [], // 时刻表头信息 | 16 | detailHeads: [], // 时刻表头信息 |
| 16 | detailInfos: [], // 时刻表明细信息 | 17 | detailInfos: [], // 时刻表明细信息 |
| 18 | + columnBcInfo: [], // 每列班次的信息 | ||
| 17 | yydesc: "" // 营运汇总描述 | 19 | yydesc: "" // 营运汇总描述 |
| 18 | }; | 20 | }; |
| 19 | 21 | ||
| @@ -34,6 +36,7 @@ angular.module('ScheduleApp').factory( | @@ -34,6 +36,7 @@ angular.module('ScheduleApp').factory( | ||
| 34 | editInfo = { | 36 | editInfo = { |
| 35 | detailHeads: [], // 时刻表头信息 | 37 | detailHeads: [], // 时刻表头信息 |
| 36 | detailInfos: [], // 时刻表明细信息 | 38 | detailInfos: [], // 时刻表明细信息 |
| 39 | + columnBcInfo: [], // 每列班次的信息(保存每列的站点信息) | ||
| 37 | yydesc: "" // 营运汇总描述 | 40 | yydesc: "" // 营运汇总描述 |
| 38 | }; | 41 | }; |
| 39 | 42 | ||
| @@ -42,116 +45,37 @@ angular.module('ScheduleApp').factory( | @@ -42,116 +45,37 @@ angular.module('ScheduleApp').factory( | ||
| 42 | editInfo.detailHeads = result.header; | 45 | editInfo.detailHeads = result.header; |
| 43 | editInfo.detailInfos = result.contents; | 46 | editInfo.detailInfos = result.contents; |
| 44 | editInfo.yydesc = result.yy_desc; | 47 | editInfo.yydesc = result.yy_desc; |
| 48 | + editInfo.columnBcInfo = [editInfo.detailInfos[0].length]; | ||
| 45 | 49 | ||
| 46 | - // detailInfos里添加是否选中的flag | 50 | + // 将editInfo.detailInfos中的值重新修正一遍 |
| 47 | for (var i = 0; i < editInfo.detailInfos.length; i++) { | 51 | for (var i = 0; i < editInfo.detailInfos.length; i++) { |
| 48 | for (var j = 0; j < editInfo.detailInfos[i].length; j++) { | 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 | } else { | 79 | } else { |
| 156 | alert(result.msg); | 80 | alert(result.msg); |
| 157 | } | 81 | } |
| @@ -169,6 +93,57 @@ angular.module('ScheduleApp').factory( | @@ -169,6 +93,57 @@ angular.module('ScheduleApp').factory( | ||
| 169 | return flag; | 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 | editInfos: function(updateObject) { // 批量保存数据 // TODO: | 147 | editInfos: function(updateObject) { // 批量保存数据 // TODO: |
| 173 | var deferred = $q.defer(); | 148 | var deferred = $q.defer(); |
| 174 | 149 | ||
| @@ -176,7 +151,7 @@ angular.module('ScheduleApp').factory( | @@ -176,7 +151,7 @@ angular.module('ScheduleApp').factory( | ||
| 176 | var ttinfodetailIds = []; | 151 | var ttinfodetailIds = []; |
| 177 | for (var i = 0; i < editInfo.detailInfos.length; i++) { | 152 | for (var i = 0; i < editInfo.detailInfos.length; i++) { |
| 178 | for (var j = 0; j < editInfo.detailInfos[i].length; j++) { | 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 | ttinfodetailIds.push(editInfo.detailInfos[i][j]); | 155 | ttinfodetailIds.push(editInfo.detailInfos[i][j]); |
| 181 | } | 156 | } |
| 182 | } | 157 | } |
| @@ -329,7 +304,9 @@ angular.module('ScheduleApp').controller( | @@ -329,7 +304,9 @@ angular.module('ScheduleApp').controller( | ||
| 329 | xlid: self.xlid, | 304 | xlid: self.xlid, |
| 330 | ttid: self.ttid, | 305 | ttid: self.ttid, |
| 331 | xlname: self.xlname, | 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('ScheduleApp').controller( | @@ -360,6 +337,30 @@ angular.module('ScheduleApp').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 | var TTInfoDetail = service.getQueryClass(); | 365 | var TTInfoDetail = service.getQueryClass(); |
| 365 | 366 | ||
| @@ -445,7 +446,8 @@ angular.module('ScheduleApp').controller( | @@ -445,7 +446,8 @@ angular.module('ScheduleApp').controller( | ||
| 445 | 'TimeTableDetailManageService_old', | 446 | 'TimeTableDetailManageService_old', |
| 446 | '$stateParams', | 447 | '$stateParams', |
| 447 | '$state', | 448 | '$state', |
| 448 | - function(service, $stateParams, $state) { | 449 | + 'SaTimeTableUtils', |
| 450 | + function(service, $stateParams, $state, SaTimeTableUtils) { | ||
| 449 | var self = this; | 451 | var self = this; |
| 450 | var TTInfoDetail = service.getQueryClass(); | 452 | var TTInfoDetail = service.getQueryClass(); |
| 451 | 453 | ||
| @@ -465,6 +467,8 @@ angular.module('ScheduleApp').controller( | @@ -465,6 +467,8 @@ angular.module('ScheduleApp').controller( | ||
| 465 | self.ttid = $stateParams.ttid; // 获取传过来的时刻表id | 467 | self.ttid = $stateParams.ttid; // 获取传过来的时刻表id |
| 466 | self.xlname = $stateParams.xlname; // 获取传过来的线路名字 | 468 | self.xlname = $stateParams.xlname; // 获取传过来的线路名字 |
| 467 | self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | 469 | self.ttname = $stateParams.ttname; // 获取传过来的时刻表名字 |
| 470 | + self.rowindex = $stateParams.rowindex; // 修改的第几行 | ||
| 471 | + self.colindex = $stateParams.colindex; // 修改的第几列 | ||
| 468 | 472 | ||
| 469 | self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; | 473 | self.title1 = self.xlname + "(" + self.ttname + ")" + "时刻表明细信息"; |
| 470 | 474 | ||
| @@ -509,6 +513,24 @@ angular.module('ScheduleApp').controller( | @@ -509,6 +513,24 @@ angular.module('ScheduleApp').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('ScheduleApp').controller( | @@ -523,22 +545,18 @@ angular.module('ScheduleApp').controller( | ||
| 523 | self.TimeTableDetailForSave.$save(function(value) { | 545 | self.TimeTableDetailForSave.$save(function(value) { |
| 524 | // 修正内部edit的值 | 546 | // 修正内部edit的值 |
| 525 | var detailInfos = service.getEditInfo().detailInfos; | 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 | //$state.go("ttInfoDetailManage_edit", { | 560 | //$state.go("ttInfoDetailManage_edit", { |
| 543 | // xlid: self.xlid, | 561 | // xlid: self.xlid, |
| 544 | // ttid: self.ttid, | 562 | // ttid: self.ttid, |
| @@ -567,6 +585,8 @@ angular.module('ScheduleApp').controller( | @@ -567,6 +585,8 @@ angular.module('ScheduleApp').controller( | ||
| 567 | '$stateParams', | 585 | '$stateParams', |
| 568 | '$state', | 586 | '$state', |
| 569 | function(service, $stateParams, $state) { | 587 | function(service, $stateParams, $state) { |
| 588 | + // TODO: | ||
| 589 | + | ||
| 570 | var self = this; | 590 | var self = this; |
| 571 | var TTInfoDetail = service.getQueryClass(); | 591 | var TTInfoDetail = service.getQueryClass(); |
| 572 | 592 |
src/main/resources/static/real_control_v2/js/modal_extend.js
| 1 | - | ||
| 2 | //modal hide remove dom | 1 | //modal hide remove dom |
| 3 | $(document).on('hide.uk.modal', '.uk-modal', function () { | 2 | $(document).on('hide.uk.modal', '.uk-modal', function () { |
| 4 | $(this).remove(); | 3 | $(this).remove(); |
| @@ -26,22 +25,25 @@ var show_modal = function (id, dom) { | @@ -26,22 +25,25 @@ var show_modal = function (id, dom) { | ||
| 26 | 25 | ||
| 27 | var open_modal = function (pageUrl, data, opt) { | 26 | var open_modal = function (pageUrl, data, opt) { |
| 28 | $.get(pageUrl, function (dom) { | 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 | var modal_move = function (m_header) { | 48 | var modal_move = function (m_header) { |
| 47 | var _moveFlag; | 49 | var _moveFlag; |
| @@ -90,4 +92,4 @@ var modal_move = function (m_header) { | @@ -90,4 +92,4 @@ var modal_move = function (m_header) { | ||
| 90 | _moveObj = null; | 92 | _moveObj = null; |
| 91 | }); | 93 | }); |
| 92 | 94 | ||
| 93 | -}; | 95 | +}; |
| 94 | \ No newline at end of file | 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,4 +649,155 @@ input[type=checkbox].disabled{ | ||
| 649 | padding-top: 15px; | 649 | padding-top: 15px; |
| 650 | border-right: 1px solid #d8d7d7; | 650 | border-right: 1px solid #d8d7d7; |
| 651 | box-shadow: 3px 1px 8px 0 rgba(0, 0, 0, 0.12), 1px 0px 8px 0 rgba(0, 0, 0, 0.12); | 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 | \ No newline at end of file | 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,17 +2,593 @@ | ||
| 2 | <div class="uk-modal-dialog uk-modal-dialog-blank"> | 2 | <div class="uk-modal-dialog uk-modal-dialog-blank"> |
| 3 | <button class="uk-modal-close uk-close" type="button"></button> | 3 | <button class="uk-modal-close uk-close" type="button"></button> |
| 4 | <div class="uk-grid uk-flex-middle" data-uk-grid-margin> | 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 | </div> | 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 | </div> | 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 | </div> | 406 | </div> |
| 11 | </div> | 407 | </div> |
| 12 | </div> | 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 | <script> | 432 | <script> |
| 14 | (function () { | 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 | </script> | 593 | </script> |
| 18 | -</div> | 594 | +</div> |
| 19 | \ No newline at end of file | 595 | \ No newline at end of file |