Commit e785668f77fc6d745a555f07b181fbabc5b3db85
1 parent
c3d71a8e
线路版本更新优化
Showing
28 changed files
with
2001 additions
and
63 deletions
src/main/java/com/bsth/controller/StationController.java
| @@ -126,6 +126,27 @@ public class StationController extends BaseController<Station, Integer> { | @@ -126,6 +126,27 @@ public class StationController extends BaseController<Station, Integer> { | ||
| 126 | map.put("updateBy", ""); | 126 | map.put("updateBy", ""); |
| 127 | return service.stationUpdate(map); | 127 | return service.stationUpdate(map); |
| 128 | } | 128 | } |
| 129 | + | ||
| 130 | + /** | ||
| 131 | + * @Description :TODO(更新缓存站点保存) | ||
| 132 | + * | ||
| 133 | + * @param map <bJwpoints:中心点百度坐标;bPolygonGrid:多边形图形百度坐标;dbType:原坐标类型; | ||
| 134 | + * | ||
| 135 | + * descriptions:说明;destroy:是否撤销;directions:方向;distances:到站距离;gJwpoints:中心点WGS坐标; | ||
| 136 | + * | ||
| 137 | + * gPolygonGrid:多边形图形WGS坐标;lineId:线路ID;radius:圆半径;roadCoding:道路编码;shapesType:图形类型; | ||
| 138 | + * | ||
| 139 | + * stationCod:站点编码;stationMark:站点类型;stationName:站点名称;stationRouteCode:站点序号;toTime:到站时间 | ||
| 140 | + * | ||
| 141 | + * versions:版本号;x:城建坐标x;y:城建坐标y> | ||
| 142 | + * | ||
| 143 | + * @return Map<String, Object> <SUCCESS ; ERROR> | ||
| 144 | + */ | ||
| 145 | + @RequestMapping(value="stationCacheUpdate" , method = RequestMethod.POST) | ||
| 146 | + public Map<String, Object> stationCacheUpdate(@RequestParam Map<String, Object> map) { | ||
| 147 | + map.put("updateBy", ""); | ||
| 148 | + return service.stationCacheUpdate(map); | ||
| 149 | + } | ||
| 129 | /** | 150 | /** |
| 130 | * @Description :TODO(查询站点编码) | 151 | * @Description :TODO(查询站点编码) |
| 131 | * | 152 | * |
src/main/java/com/bsth/controller/StationRouteController.java
| 1 | package com.bsth.controller; | 1 | package com.bsth.controller; |
| 2 | 2 | ||
| 3 | import com.bsth.entity.StationRoute; | 3 | import com.bsth.entity.StationRoute; |
| 4 | +import com.bsth.entity.StationRouteCache; | ||
| 5 | +import com.bsth.repository.StationRouteCacheRepository; | ||
| 4 | import com.bsth.repository.StationRouteRepository; | 6 | import com.bsth.repository.StationRouteRepository; |
| 5 | import com.bsth.service.StationRouteService; | 7 | import com.bsth.service.StationRouteService; |
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -37,6 +39,8 @@ public class StationRouteController extends BaseController<StationRoute, Integer | @@ -37,6 +39,8 @@ public class StationRouteController extends BaseController<StationRoute, Integer | ||
| 37 | StationRouteService service; | 39 | StationRouteService service; |
| 38 | @Autowired | 40 | @Autowired |
| 39 | StationRouteRepository stationRouteRepository; | 41 | StationRouteRepository stationRouteRepository; |
| 42 | + @Autowired | ||
| 43 | + StationRouteCacheRepository stationRouteCacheRepository; | ||
| 40 | 44 | ||
| 41 | /** | 45 | /** |
| 42 | * @param @param map | 46 | * @param @param map |
| @@ -49,6 +53,11 @@ public class StationRouteController extends BaseController<StationRoute, Integer | @@ -49,6 +53,11 @@ public class StationRouteController extends BaseController<StationRoute, Integer | ||
| 49 | return service.list(map); | 53 | return service.list(map); |
| 50 | } | 54 | } |
| 51 | 55 | ||
| 56 | + @RequestMapping(value = "/cacheList", method = RequestMethod.GET) | ||
| 57 | + public List<StationRouteCache> cacheList(@RequestParam Map<String, Object> map) { | ||
| 58 | + return service.cacheList(map); | ||
| 59 | + } | ||
| 60 | + | ||
| 52 | /** | 61 | /** |
| 53 | * @Description :TODO(查询路段信息) | 62 | * @Description :TODO(查询路段信息) |
| 54 | * | 63 | * |
| @@ -101,6 +110,14 @@ public class StationRouteController extends BaseController<StationRoute, Integer | @@ -101,6 +110,14 @@ public class StationRouteController extends BaseController<StationRoute, Integer | ||
| 101 | } | 110 | } |
| 102 | 111 | ||
| 103 | /** | 112 | /** |
| 113 | + * @Description :TODO(查询缓存站点的上一个缓存站点) | ||
| 114 | + */ | ||
| 115 | + @RequestMapping(value = "/findCacheUpStationRouteCode" , method = RequestMethod.GET) | ||
| 116 | + public List<Map<String, Object>> findCacheUpStationRouteCode(@RequestParam Map<String, Object> map) { | ||
| 117 | + return service.findCacheUpStationRouteCode(map); | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + /** | ||
| 104 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) | 121 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) |
| 105 | * | 122 | * |
| 106 | * @param map <lineId:线路ID; direction:方向> | 123 | * @param map <lineId:线路ID; direction:方向> |
| @@ -195,4 +212,31 @@ public class StationRouteController extends BaseController<StationRoute, Integer | @@ -195,4 +212,31 @@ public class StationRouteController extends BaseController<StationRoute, Integer | ||
| 195 | public Map<String, Object> upddis(@RequestParam Map<String, Object> map) { | 212 | public Map<String, Object> upddis(@RequestParam Map<String, Object> map) { |
| 196 | return service.upddis(map); | 213 | return service.upddis(map); |
| 197 | } | 214 | } |
| 215 | + | ||
| 216 | + /** | ||
| 217 | + * | ||
| 218 | + * @Title: findCacheStationRoute | ||
| 219 | + * @Description: TODO(查询缓存路由) | ||
| 220 | + */ | ||
| 221 | + @RequestMapping(value = "/findCacheStationRoute",method = RequestMethod.GET) | ||
| 222 | + public List<StationRouteCache> findCacheStationRoute(@RequestParam Map<String, Object> map) { | ||
| 223 | + int lineId = Integer.parseInt(map.get("lineId").toString()); | ||
| 224 | + int dir = Integer.parseInt(map.get("dir").toString()); | ||
| 225 | + return stationRouteCacheRepository.findstationRoute(lineId, dir); | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + /** | ||
| 229 | + * | ||
| 230 | + * @Title: findCachePoint | ||
| 231 | + * | ||
| 232 | + * @param map <lineId:线路ID; dir:方向> | ||
| 233 | + * | ||
| 234 | + * @Description: TODO(查询缓存路由) | ||
| 235 | + */ | ||
| 236 | + @RequestMapping(value = "/findCachePoint",method = RequestMethod.GET) | ||
| 237 | + public List<Map<String, Object>> findCachePoint(@RequestParam Map<String, Object> map) { | ||
| 238 | + int lineId = Integer.parseInt(map.get("lineId").toString()); | ||
| 239 | + int dir = Integer.parseInt(map.get("dir").toString()); | ||
| 240 | + return service.findCachePoint(lineId, dir); | ||
| 241 | + } | ||
| 198 | } | 242 | } |
src/main/java/com/bsth/repository/StationRouteCacheRepository.java
| 1 | package com.bsth.repository; | 1 | package com.bsth.repository; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | +import java.util.Map; | ||
| 4 | 5 | ||
| 6 | +import org.springframework.data.domain.Sort; | ||
| 7 | +import org.springframework.data.jpa.domain.Specification; | ||
| 8 | +import org.springframework.data.jpa.repository.EntityGraph; | ||
| 5 | import org.springframework.data.jpa.repository.Modifying; | 9 | import org.springframework.data.jpa.repository.Modifying; |
| 6 | import org.springframework.data.jpa.repository.Query; | 10 | import org.springframework.data.jpa.repository.Query; |
| 7 | import org.springframework.stereotype.Repository; | 11 | import org.springframework.stereotype.Repository; |
| 8 | 12 | ||
| 13 | +import com.bsth.entity.StationRoute; | ||
| 9 | import com.bsth.entity.StationRouteCache; | 14 | import com.bsth.entity.StationRouteCache; |
| 15 | +import com.bsth.entity.search.CustomerSpecs; | ||
| 10 | 16 | ||
| 11 | /** | 17 | /** |
| 12 | * | 18 | * |
| @@ -45,8 +51,8 @@ public interface StationRouteCacheRepository extends BaseRepository<StationRoute | @@ -45,8 +51,8 @@ public interface StationRouteCacheRepository extends BaseRepository<StationRoute | ||
| 45 | /** | 51 | /** |
| 46 | * 查询站点路由 | 52 | * 查询站点路由 |
| 47 | */ | 53 | */ |
| 48 | - @Query("select r from StationRouteCache r where r.lineCode=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") | ||
| 49 | - public List<StationRouteCache> findstationRoute(String lineCode,Integer dir); | 54 | + @Query("select r from StationRouteCache r where r.line.id=?1 and r.directions=?2 and r.destroy=0 order by r.stationRouteCode") |
| 55 | + public List<StationRouteCache> findstationRoute(Integer lineId,Integer dir); | ||
| 50 | 56 | ||
| 51 | /** | 57 | /** |
| 52 | * 更新路线删除线路缓存站点 | 58 | * 更新路线删除线路缓存站点 |
| @@ -57,5 +63,78 @@ public interface StationRouteCacheRepository extends BaseRepository<StationRoute | @@ -57,5 +63,78 @@ public interface StationRouteCacheRepository extends BaseRepository<StationRoute | ||
| 57 | @Modifying | 63 | @Modifying |
| 58 | @Query(value="delete from bsth_c_stationroute_cache where line_code = ?1 and directions = ?2 ", nativeQuery=true) | 64 | @Query(value="delete from bsth_c_stationroute_cache where line_code = ?1 and directions = ?2 ", nativeQuery=true) |
| 59 | public void stationRouteCacheDel(String lineCode,Integer dir); | 65 | public void stationRouteCacheDel(String lineCode,Integer dir); |
| 66 | + | ||
| 67 | + | ||
| 68 | + @Query(value = "SELECT a.`stationRoute.id`," + | ||
| 69 | + "a.`stationRoute.line`," + | ||
| 70 | + "a.`stationRoute.station`," + | ||
| 71 | + "a.`stationRoute.stationName`," + | ||
| 72 | + "a.`stationRoute.stationRouteCode`," + | ||
| 73 | + "a.`stationRoute.lineCode`," + | ||
| 74 | + "a.`stationRoute.stationMark`," + | ||
| 75 | + "a.`stationRoute.outStationNmber`," + | ||
| 76 | + "a.`stationRoute.directions`," + | ||
| 77 | + "a.`stationRoute.distances`," + | ||
| 78 | + "a.`stationRoute.toTime`," + | ||
| 79 | + "a.`stationRoute.firstTime`," + | ||
| 80 | + "a.`stationRoute.endTime`," + | ||
| 81 | + "a.`stationRoute.descriptions`," + | ||
| 82 | + "a.`stationRoute.versions`," + | ||
| 83 | + "b.id AS 'station.id'," + | ||
| 84 | + "b.station_cod AS 'station.stationCod'," + | ||
| 85 | + "b.station_name AS 'station.stationName'," + | ||
| 86 | + "b.road_coding AS 'station.roadCoding'," + | ||
| 87 | + "b.db_type AS 'station.dbType'," + | ||
| 88 | + "b.b_jwpoints AS 'station.bJwpoints'," + | ||
| 89 | + "b.g_lonx AS 'station.gLonx'," + | ||
| 90 | + "b.g_lonx AS 'station.gLaty'," + | ||
| 91 | + "b.x AS 'station.x'," + | ||
| 92 | + "b.y AS 'station.y'," + | ||
| 93 | + "b.shapes_type AS 'station.shapesType'," + | ||
| 94 | + "b.radius AS 'station.radius'," + | ||
| 95 | + "ST_AsText(b.g_polygon_grid) AS 'station.gPolygonGrid'," + | ||
| 96 | + "ST_AsText(b.b_polygon_grid) AS 'station.bPolygonGrid'," + | ||
| 97 | + "b.destroy AS 'station.destroy'," + | ||
| 98 | + "b.versions AS 'station.versions'," + | ||
| 99 | + "b.descriptions AS 'station.descriptions' FROM (" + | ||
| 100 | + "SELECT r.id AS 'stationRoute.id'," + | ||
| 101 | + " r.line AS 'stationRoute.line'," + | ||
| 102 | + "r.station AS 'stationRoute.station'," + | ||
| 103 | + "r.station_name AS 'stationRoute.stationName'," + | ||
| 104 | + "r.station_route_code as 'stationRoute.stationRouteCode'," + | ||
| 105 | + "r.line_code AS 'stationRoute.lineCode'," + | ||
| 106 | + "r.station_mark AS 'stationRoute.stationMark'," + | ||
| 107 | + "r.out_station_nmber AS 'stationRoute.outStationNmber'," + | ||
| 108 | + "r.directions AS 'stationRoute.directions'," + | ||
| 109 | + "r.distances AS 'stationRoute.distances'," + | ||
| 110 | + "r.to_time AS 'stationRoute.toTime'," + | ||
| 111 | + "r.first_time AS 'stationRoute.firstTime'," + | ||
| 112 | + "r.end_time AS 'stationRoute.endTime'," + | ||
| 113 | + "r.descriptions AS 'stationRoute.descriptions'," + | ||
| 114 | + "r.versions AS 'stationRoute.versions' FROM bsth_c_stationroute_cache r WHERE r.line = ?1 and r.directions = ?2 and r.destroy=0) a " + | ||
| 115 | + "LEFT JOIN bsth_c_station b " + | ||
| 116 | + "ON a.`stationRoute.station` = b.id ORDER BY a.`stationRoute.stationRouteCode` ASC", nativeQuery=true) | ||
| 117 | + List<Object[]> findCachePoint(int lineId, int dir); | ||
| 118 | + | ||
| 119 | + | ||
| 120 | + /** | ||
| 121 | + * @Description :TODO(查询线线路方向下的站点路由) | ||
| 122 | + */ | ||
| 123 | + @EntityGraph(value = "stationRoute_station_cache", type = EntityGraph.EntityGraphType.FETCH) | ||
| 124 | + @Query(value="select sr from StationRouteCache sr where sr.line.id = ?1 and sr.directions = ?2 and sr.destroy = ?3 ORDER BY sr.stationRouteCode ASC") | ||
| 125 | + List<StationRouteCache> cacheList(Integer lineId, Integer directions, Integer destroy); | ||
| 60 | 126 | ||
| 127 | + /** | ||
| 128 | + * @Description :TODO(查询线路某方向下的站点序号与类型) | ||
| 129 | + * | ||
| 130 | + * @param map <lineId:线路ID; direction:方向;stationRouteCode:站点编码> | ||
| 131 | + * | ||
| 132 | + * @return List<Map<String, Object>> | ||
| 133 | + */ | ||
| 134 | + @Query(value = "select t.station_route_code,t.station_mark from bsth_c_stationroute_cache t where " + | ||
| 135 | + " t.station_route_code =(" + | ||
| 136 | + "select MAX(station_route_code) as stationRouteCode from bsth_c_stationroute_cache r WHERE " + | ||
| 137 | + "r.line=?1 and r.directions =?2 and station_route_code< ?3 and r.destroy = 0 ) and t.line=?1 and t.directions = ?2 AND t.destroy = 0", nativeQuery=true) | ||
| 138 | + List<Object[]> findUpStationRouteCode(Integer lineId,Integer direction,Integer stationRouteCode); | ||
| 139 | + | ||
| 61 | } | 140 | } |
src/main/java/com/bsth/service/StationRouteService.java
| @@ -6,6 +6,7 @@ import java.util.Map; | @@ -6,6 +6,7 @@ import java.util.Map; | ||
| 6 | import javax.servlet.http.HttpServletResponse; | 6 | import javax.servlet.http.HttpServletResponse; |
| 7 | 7 | ||
| 8 | import com.bsth.entity.StationRoute; | 8 | import com.bsth.entity.StationRoute; |
| 9 | +import com.bsth.entity.StationRouteCache; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * | 12 | * |
| @@ -32,6 +33,8 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> | @@ -32,6 +33,8 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> | ||
| 32 | */ | 33 | */ |
| 33 | Iterable<StationRoute> list(Map<String, Object> map); | 34 | Iterable<StationRoute> list(Map<String, Object> map); |
| 34 | 35 | ||
| 36 | + List<StationRouteCache> cacheList(Map<String, Object> map); | ||
| 37 | + | ||
| 35 | /** | 38 | /** |
| 36 | * @Description : TODO(根据路段站点Id批量撤销站点) | 39 | * @Description : TODO(根据路段站点Id批量撤销站点) |
| 37 | * | 40 | * |
| @@ -61,6 +64,8 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> | @@ -61,6 +64,8 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> | ||
| 61 | */ | 64 | */ |
| 62 | List<Map<String, Object>> findUpStationRouteCode(Map<String, Object> map); | 65 | List<Map<String, Object>> findUpStationRouteCode(Map<String, Object> map); |
| 63 | 66 | ||
| 67 | + List<Map<String, Object>> findCacheUpStationRouteCode(Map<String, Object> map); | ||
| 68 | + | ||
| 64 | /** | 69 | /** |
| 65 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) | 70 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) |
| 66 | * | 71 | * |
| @@ -115,4 +120,14 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> | @@ -115,4 +120,14 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> | ||
| 115 | 120 | ||
| 116 | void batchUpdate(Integer lineId, String lineCode); | 121 | void batchUpdate(Integer lineId, String lineCode); |
| 117 | 122 | ||
| 123 | + /** | ||
| 124 | + * @Description :TODO(查询缓存站点信息) | ||
| 125 | + * | ||
| 126 | + * @param map <line.id_eq:线路ID; directions_eq:方向> | ||
| 127 | + * | ||
| 128 | + * @return List<Map<String, Object>> | ||
| 129 | + */ | ||
| 130 | + List<Map<String, Object>> findCachePoint(int lineId, int dir); | ||
| 131 | + | ||
| 132 | + | ||
| 118 | } | 133 | } |
src/main/java/com/bsth/service/StationService.java
| @@ -81,5 +81,7 @@ public interface StationService extends BaseService<Station, Integer> { | @@ -81,5 +81,7 @@ public interface StationService extends BaseService<Station, Integer> { | ||
| 81 | * 上传的GPS点生成的路线保存在缓存表 | 81 | * 上传的GPS点生成的路线保存在缓存表 |
| 82 | */ | 82 | */ |
| 83 | Map<String, Object> cacheSave(Map<String, Object> map); | 83 | Map<String, Object> cacheSave(Map<String, Object> map); |
| 84 | + | ||
| 85 | + Map<String, Object> stationCacheUpdate(Map<String, Object> map); | ||
| 84 | 86 | ||
| 85 | } | 87 | } |
src/main/java/com/bsth/service/impl/SectionServiceImpl.java
| @@ -194,7 +194,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -194,7 +194,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 194 | // 撤销原有站点路由 | 194 | // 撤销原有站点路由 |
| 195 | stationRouteRepository.stationRouteUpdDestroy(sectionRouteLine,directions); | 195 | stationRouteRepository.stationRouteUpdDestroy(sectionRouteLine,directions); |
| 196 | // 站点保存 | 196 | // 站点保存 |
| 197 | - List<StationRouteCache> stationRouteList = stationRouteCacheRepository.findstationRoute(lineCode,directions); | 197 | + List<StationRouteCache> stationRouteList = stationRouteCacheRepository.findstationRoute(sectionRouteLine,directions); |
| 198 | for(int i=0; i < stationRouteList.size(); i++) { | 198 | for(int i=0; i < stationRouteList.size(); i++) { |
| 199 | StationRouteCache stationRouteCache = stationRouteList.get(i); | 199 | StationRouteCache stationRouteCache = stationRouteList.get(i); |
| 200 | StationRoute stationRoute = new StationRoute(); | 200 | StationRoute stationRoute = new StationRoute(); |
| @@ -328,7 +328,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | @@ -328,7 +328,7 @@ public class SectionServiceImpl extends BaseServiceImpl<Section, Integer> implem | ||
| 328 | // 删除原有历史表站点路由 | 328 | // 删除原有历史表站点路由 |
| 329 | lsStationRouteRepository.batchDelete(sectionRouteLine,directions,versions); | 329 | lsStationRouteRepository.batchDelete(sectionRouteLine,directions,versions); |
| 330 | // 站点保存 | 330 | // 站点保存 |
| 331 | - List<StationRouteCache> stationRouteList = stationRouteCacheRepository.findstationRoute(lineCode,directions); | 331 | + List<StationRouteCache> stationRouteList = stationRouteCacheRepository.findstationRoute(sectionRouteLine,directions); |
| 332 | for(int i=0; i < stationRouteList.size(); i++) { | 332 | for(int i=0; i < stationRouteList.size(); i++) { |
| 333 | StationRouteCache stationRouteCache = stationRouteList.get(i); | 333 | StationRouteCache stationRouteCache = stationRouteList.get(i); |
| 334 | LsStationRoute stationRoute = new LsStationRoute(); | 334 | LsStationRoute stationRoute = new LsStationRoute(); |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| @@ -4,6 +4,7 @@ import com.bsth.common.ResponseCode; | @@ -4,6 +4,7 @@ import com.bsth.common.ResponseCode; | ||
| 4 | import com.bsth.entity.Line; | 4 | import com.bsth.entity.Line; |
| 5 | import com.bsth.entity.Station; | 5 | import com.bsth.entity.Station; |
| 6 | import com.bsth.entity.StationRoute; | 6 | import com.bsth.entity.StationRoute; |
| 7 | +import com.bsth.entity.StationRouteCache; | ||
| 7 | import com.bsth.entity.search.CustomerSpecs; | 8 | import com.bsth.entity.search.CustomerSpecs; |
| 8 | import com.bsth.repository.LineRepository; | 9 | import com.bsth.repository.LineRepository; |
| 9 | import com.bsth.repository.SectionRouteRepository; | 10 | import com.bsth.repository.SectionRouteRepository; |
| @@ -75,6 +76,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -75,6 +76,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 75 | } | 76 | } |
| 76 | 77 | ||
| 77 | @Override | 78 | @Override |
| 79 | + public List<StationRouteCache> cacheList(Map<String, Object> map) { | ||
| 80 | + List<Sort.Order> orderList = new ArrayList<>(); | ||
| 81 | + orderList.add(new Sort.Order(Direction.ASC, "directions")); | ||
| 82 | + orderList.add(new Sort.Order(Direction.ASC, "stationRouteCode")); | ||
| 83 | + Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString()); | ||
| 84 | + Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString()); | ||
| 85 | + Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | ||
| 86 | + return cacheRepository.cacheList(lineId, direction, destroy); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + @Override | ||
| 78 | public Map<String, Object> getSectionRouteExport(Integer id, HttpServletResponse resp) { | 90 | public Map<String, Object> getSectionRouteExport(Integer id, HttpServletResponse resp) { |
| 79 | Map<String, Object> resultMap = new HashMap<String, Object>(); | 91 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 80 | try { | 92 | try { |
| @@ -195,7 +207,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -195,7 +207,7 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 195 | // 站点路由站点ID | 207 | // 站点路由站点ID |
| 196 | tempM.put("stationRouteStation", stationList.get(i)[2]); | 208 | tempM.put("stationRouteStation", stationList.get(i)[2]); |
| 197 | 209 | ||
| 198 | - // 站点路由站点名称 | 210 | + // 站点路由名称 |
| 199 | tempM.put("stationRouteStationName", stationList.get(i)[3]); | 211 | tempM.put("stationRouteStationName", stationList.get(i)[3]); |
| 200 | 212 | ||
| 201 | // 站点路由站点序号 | 213 | // 站点路由站点序号 |
| @@ -512,6 +524,24 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -512,6 +524,24 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 512 | return list; | 524 | return list; |
| 513 | } | 525 | } |
| 514 | 526 | ||
| 527 | + @Override | ||
| 528 | + public List<Map<String, Object>> findCacheUpStationRouteCode(Map<String, Object> map) { | ||
| 529 | + Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString()); | ||
| 530 | + Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString()); | ||
| 531 | + Integer stationRouteCode = map.get("stationRouteCode").equals("") ? null : Integer.parseInt(map.get("stationRouteCode").toString()); | ||
| 532 | + List<Object[]> reslutList = cacheRepository.findUpStationRouteCode(lineId, direction, stationRouteCode); | ||
| 533 | + List<Map<String, Object>> list = new ArrayList<Map<String,Object>>(); | ||
| 534 | + if(reslutList.size()>0) { | ||
| 535 | + for(int i = 0 ; i <reslutList.size() ;i++){ | ||
| 536 | + Map<String, Object> tempM = new HashMap<String, Object>(); | ||
| 537 | + tempM.put("stationRouteCode", reslutList.get(i)[0]); | ||
| 538 | + tempM.put("stationRouteMarke", reslutList.get(i)[1]); | ||
| 539 | + list.add(tempM); | ||
| 540 | + } | ||
| 541 | + } | ||
| 542 | + return list; | ||
| 543 | + } | ||
| 544 | + | ||
| 515 | /** | 545 | /** |
| 516 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) | 546 | * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) |
| 517 | * | 547 | * |
| @@ -1269,9 +1299,134 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | @@ -1269,9 +1299,134 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ | ||
| 1269 | return rs; | 1299 | return rs; |
| 1270 | } | 1300 | } |
| 1271 | 1301 | ||
| 1272 | - // 更具线路批量撤销 | 1302 | + /** |
| 1303 | + * @Description :TODO(更具线路批量撤销) | ||
| 1304 | + */ | ||
| 1273 | @Override | 1305 | @Override |
| 1274 | public void batchUpdate(Integer lineId, String lineCode) { | 1306 | public void batchUpdate(Integer lineId, String lineCode) { |
| 1275 | repository.batchUpdate(lineId,lineCode); | 1307 | repository.batchUpdate(lineId,lineCode); |
| 1276 | } | 1308 | } |
| 1309 | + | ||
| 1310 | + /** | ||
| 1311 | + * @Description :TODO(查询缓存路由) | ||
| 1312 | + * | ||
| 1313 | + * @param map <line.id_eq:线路ID; directions_eq:方向> | ||
| 1314 | + * | ||
| 1315 | + * @return List<Map<String, Object>> | ||
| 1316 | + */ | ||
| 1317 | + @Override | ||
| 1318 | + @Transactional | ||
| 1319 | + public List<Map<String, Object>> findCachePoint(int lineId, int dir) { | ||
| 1320 | + | ||
| 1321 | + List<Object[]> stationList = cacheRepository.findCachePoint(lineId, dir); | ||
| 1322 | + | ||
| 1323 | + List<Map<String, Object>> staitonRouteList= new ArrayList<Map<String, Object>>(); | ||
| 1324 | + | ||
| 1325 | + if(stationList.size()>0) { | ||
| 1326 | + | ||
| 1327 | + for(int i = 0 ; i < stationList.size(); i++) { | ||
| 1328 | + | ||
| 1329 | + Map<String, Object> tempM = new HashMap<String, Object>(); | ||
| 1330 | + | ||
| 1331 | + // 站点路由ID | ||
| 1332 | + tempM.put("stationRouteId", stationList.get(i)[0]); | ||
| 1333 | + | ||
| 1334 | + // 站点路由线路ID | ||
| 1335 | + tempM.put("stationRouteLine", stationList.get(i)[1]); | ||
| 1336 | + | ||
| 1337 | + // 站点路由站点ID | ||
| 1338 | + tempM.put("stationRouteStation", stationList.get(i)[2]); | ||
| 1339 | + | ||
| 1340 | + // 站点路由名称 | ||
| 1341 | + tempM.put("stationRouteStationName", stationList.get(i)[3]); | ||
| 1342 | + | ||
| 1343 | + // 站点路由站点序号 | ||
| 1344 | + tempM.put("stationRouteStationRouteCode", stationList.get(i)[4]); | ||
| 1345 | + | ||
| 1346 | + // 站点路由线路编码 | ||
| 1347 | + tempM.put("stationRouteLineCode", stationList.get(i)[5]); | ||
| 1348 | + | ||
| 1349 | + // 站点路由站点类型 | ||
| 1350 | + tempM.put("stationRouteStationMark", stationList.get(i)[6]); | ||
| 1351 | + | ||
| 1352 | + // 站点路由出站的序号 | ||
| 1353 | + tempM.put("stationRouteOutStationNmber", stationList.get(i)[7]); | ||
| 1354 | + | ||
| 1355 | + // 站点路由站点方向 | ||
| 1356 | + tempM.put("stationRouteDirections", stationList.get(i)[8]); | ||
| 1357 | + | ||
| 1358 | + // 站点路由站点到站距离 | ||
| 1359 | + tempM.put("stationRouteDistances", stationList.get(i)[9]); | ||
| 1360 | + | ||
| 1361 | + // 站点路由到站时间 | ||
| 1362 | + tempM.put("stationRouteToTime", stationList.get(i)[10]); | ||
| 1363 | + | ||
| 1364 | + // 站点路由站点首班时间 | ||
| 1365 | + tempM.put("stationRouteFirstTime", stationList.get(i)[11]); | ||
| 1366 | + | ||
| 1367 | + // 站点路由站点末班时间 | ||
| 1368 | + tempM.put("stationRouteEndTime", stationList.get(i)[12]); | ||
| 1369 | + | ||
| 1370 | + // 站点路由站点说明 | ||
| 1371 | + tempM.put("stationRouteDescriptions", stationList.get(i)[13]); | ||
| 1372 | + | ||
| 1373 | + // 站点路由版本 | ||
| 1374 | + tempM.put("stationRouteVersions", stationList.get(i)[14]); | ||
| 1375 | + | ||
| 1376 | + // 站点ID | ||
| 1377 | + tempM.put("stationId", stationList.get(i)[15]); | ||
| 1378 | + | ||
| 1379 | + // 站点编码 | ||
| 1380 | + tempM.put("stationStationCod", stationList.get(i)[16]); | ||
| 1381 | + | ||
| 1382 | + // 站点名称 | ||
| 1383 | + tempM.put("stationStationName", stationList.get(i)[17]); | ||
| 1384 | + | ||
| 1385 | + // 路段编码 | ||
| 1386 | + tempM.put("stationRoadCoding", stationList.get(i)[18]); | ||
| 1387 | + | ||
| 1388 | + // 原坐标类型 | ||
| 1389 | + tempM.put("stationDbType", stationList.get(i)[19]); | ||
| 1390 | + | ||
| 1391 | + // 中心点(百度坐标) | ||
| 1392 | + tempM.put("stationBJwpoints", stationList.get(i)[20]); | ||
| 1393 | + | ||
| 1394 | + // 中心点(WGS经度) | ||
| 1395 | + tempM.put("stationGLonx", stationList.get(i)[21]); | ||
| 1396 | + | ||
| 1397 | + // 中心点(WGS纬度) | ||
| 1398 | + tempM.put("stationGLaty", stationList.get(i)[22]); | ||
| 1399 | + | ||
| 1400 | + // 城建坐标x | ||
| 1401 | + tempM.put("stationx", stationList.get(i)[23]); | ||
| 1402 | + | ||
| 1403 | + // 城建坐标y | ||
| 1404 | + tempM.put("stationy", stationList.get(i)[24]); | ||
| 1405 | + | ||
| 1406 | + // 站点图形类型 | ||
| 1407 | + tempM.put("stationShapesType", stationList.get(i)[25]); | ||
| 1408 | + | ||
| 1409 | + // 站点圆半径 | ||
| 1410 | + tempM.put("stationRadius", stationList.get(i)[26]); | ||
| 1411 | + | ||
| 1412 | + // 站点图形WGS坐标 | ||
| 1413 | + tempM.put("stationGPolygonGrid", stationList.get(i)[27]); | ||
| 1414 | + | ||
| 1415 | + // 站点图形百度坐标 | ||
| 1416 | + tempM.put("stationBPolygonGrid", stationList.get(i)[28]); | ||
| 1417 | + | ||
| 1418 | + // 是否撤销 | ||
| 1419 | + tempM.put("stationDestroy", stationList.get(i)[29]); | ||
| 1420 | + | ||
| 1421 | + // 站点版本 | ||
| 1422 | + tempM.put("stationVersions", stationList.get(i)[30]); | ||
| 1423 | + | ||
| 1424 | + // 站点说明 | ||
| 1425 | + tempM.put("stationDescriptions", stationList.get(i)[31]); | ||
| 1426 | + | ||
| 1427 | + staitonRouteList.add(tempM); | ||
| 1428 | + } | ||
| 1429 | + } | ||
| 1430 | + return staitonRouteList; | ||
| 1431 | + } | ||
| 1277 | } | 1432 | } |
src/main/java/com/bsth/service/impl/StationServiceImpl.java
| @@ -1613,4 +1613,126 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1613,4 +1613,126 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1613 | } | 1613 | } |
| 1614 | 1614 | ||
| 1615 | } | 1615 | } |
| 1616 | + | ||
| 1617 | + /** | ||
| 1618 | + * @Description :TODO(更新缓存站点路由) | ||
| 1619 | + */ | ||
| 1620 | + @Override | ||
| 1621 | + public Map<String, Object> stationCacheUpdate(Map<String, Object> map) { | ||
| 1622 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | ||
| 1623 | + try { | ||
| 1624 | + // 站点Id | ||
| 1625 | + Integer stationId = map.get("stationId").equals("") ? null : Integer.parseInt(map.get("stationId").toString()); | ||
| 1626 | + String stationCod = map.get("stationCod").equals("") ? "" : map.get("stationCod").toString(); | ||
| 1627 | + String zdmc = map.get("zdmc").equals("") ? "" : map.get("zdmc").toString(); | ||
| 1628 | + // 站点路由名称 | ||
| 1629 | + String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString(); | ||
| 1630 | + // 所在道路编码 | ||
| 1631 | + String roadCoding = map.get("roadCoding").equals("") ? "" : map.get("roadCoding").toString(); | ||
| 1632 | + // 经纬坐标类型 | ||
| 1633 | + String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); | ||
| 1634 | + // 百度经纬度坐标 | ||
| 1635 | + String bJwpoints = map.get("bJwpoints").equals("") ? "" : map.get("bJwpoints").toString(); | ||
| 1636 | + String bJwpointsArray[] =null; | ||
| 1637 | + if(bJwpoints!=null) { | ||
| 1638 | + bJwpointsArray = bJwpoints.split(" "); | ||
| 1639 | + } | ||
| 1640 | + // WGS经纬度 | ||
| 1641 | + Float gLonx = null; | ||
| 1642 | + // WGS纬度 | ||
| 1643 | + Float gLaty = null; | ||
| 1644 | + if(bJwpointsArray.length>0) { | ||
| 1645 | + Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); | ||
| 1646 | + gLonx = (float)resultPoint.getLng(); | ||
| 1647 | + gLaty = (float)resultPoint.getLat(); | ||
| 1648 | + } | ||
| 1649 | + // 图形类型 | ||
| 1650 | + String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); | ||
| 1651 | + // 圆形半径 | ||
| 1652 | + Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); | ||
| 1653 | + // 多边形空间原坐标坐标点集合 | ||
| 1654 | + String bPloygonGrid = map.get("bPolygonGrid").equals("") ? "" : map.get("bPolygonGrid").toString(); | ||
| 1655 | + // 多边形WGS坐标点集合 | ||
| 1656 | + String gPloygonGrid =""; | ||
| 1657 | + if(!bPloygonGrid.equals("")) { | ||
| 1658 | + String bPloygonGridArray[] = bPloygonGrid.split(","); | ||
| 1659 | + int bLen_ = bPloygonGridArray.length; | ||
| 1660 | + for(int b = 0 ;b<bLen_;b++) { | ||
| 1661 | + String tempArray[]= bPloygonGridArray[b].split(" "); | ||
| 1662 | + Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); | ||
| 1663 | + if(b==0) { | ||
| 1664 | + gPloygonGrid = resultPoint.getLng() + " " + resultPoint.getLat(); | ||
| 1665 | + }else { | ||
| 1666 | + gPloygonGrid = gPloygonGrid + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); | ||
| 1667 | + } | ||
| 1668 | + } | ||
| 1669 | + } | ||
| 1670 | + if(bPloygonGrid.equals("")) | ||
| 1671 | + bPloygonGrid = null; | ||
| 1672 | + else | ||
| 1673 | + bPloygonGrid = "POLYGON((" + bPloygonGrid +"))"; | ||
| 1674 | + | ||
| 1675 | + if(gPloygonGrid.equals("")) | ||
| 1676 | + gPloygonGrid = null; | ||
| 1677 | + else | ||
| 1678 | + gPloygonGrid = "POLYGON((" + gPloygonGrid +"))"; | ||
| 1679 | + // 是否撤销 | ||
| 1680 | + Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | ||
| 1681 | + // 版本号 | ||
| 1682 | + Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); | ||
| 1683 | + // 描述与说明 | ||
| 1684 | + String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); | ||
| 1685 | + Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString()); | ||
| 1686 | + Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString()); | ||
| 1687 | + // 更新 | ||
| 1688 | + repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId); | ||
| 1689 | + // 站点路由Id | ||
| 1690 | + Integer stationRouteId = map.get("stationRouteId").equals("") ? null : Integer.parseInt(map.get("stationRouteId").toString()); | ||
| 1691 | + StationRouteCache resultS = routeCacheRepository.findOne(stationRouteId); | ||
| 1692 | + // 站点路由序号 | ||
| 1693 | + String stationRouteCodeStr = map.get("stationRouteCode").equals("") ? null : map.get("stationRouteCode").toString(); | ||
| 1694 | + Integer stationRouteCode = null; | ||
| 1695 | + if(stationRouteCodeStr!=null) { | ||
| 1696 | + String stationRouteCodeAraay[] = stationRouteCodeStr.split("_"); | ||
| 1697 | + int old_code = resultS.getStationRouteCode(); | ||
| 1698 | + int new_code = Integer.parseInt(stationRouteCodeAraay[0].toString())+100; | ||
| 1699 | + if(new_code==old_code){ | ||
| 1700 | + stationRouteCode = new_code; | ||
| 1701 | + }else { | ||
| 1702 | + stationRouteCode = new_code-100+1; | ||
| 1703 | + } | ||
| 1704 | + }else { | ||
| 1705 | + stationRouteCode = resultS.getStationRouteCode(); | ||
| 1706 | + } | ||
| 1707 | + stationRouteCode = stationRouteCode == null ? 100 : stationRouteCode; | ||
| 1708 | + Integer LineId = map.get("stationRouteLine").equals("") ? null : Integer.parseInt(map.get("stationRouteLine").toString()); | ||
| 1709 | + String stationMark = map.get("stationMark").equals("") ? null : map.get("stationMark").toString(); | ||
| 1710 | + Double distances = map.get("distances").equals("") ? 0.0d : Double.parseDouble(map.get("distances").toString()); | ||
| 1711 | + Double toTime = map.get("toTime").equals("") ? 0.0d : Double.parseDouble(map.get("toTime").toString()); | ||
| 1712 | + Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString()); | ||
| 1713 | + Station station = repository.findOne(stationId); | ||
| 1714 | + Line line = lineRepository.findOne(LineId); | ||
| 1715 | + StationRouteCache stationRoute = new StationRouteCache(); | ||
| 1716 | + stationRoute.setStationName(stationName); | ||
| 1717 | + stationRoute.setId(stationRouteId); | ||
| 1718 | + stationRoute.setStationRouteCode(stationRouteCode); | ||
| 1719 | + stationRoute.setStation(station); | ||
| 1720 | + stationRoute.setStationCode(station.getStationCod()); | ||
| 1721 | + stationRoute.setLine(line); | ||
| 1722 | + stationRoute.setLineCode(line.getLineCode()); | ||
| 1723 | + stationRoute.setStationMark(stationMark); | ||
| 1724 | + stationRoute.setDistances(distances); | ||
| 1725 | + stationRoute.setToTime(toTime); | ||
| 1726 | + stationRoute.setDirections(directions); | ||
| 1727 | + stationRoute.setVersions(versions); | ||
| 1728 | + stationRoute.setDestroy(destroy); | ||
| 1729 | + stationRoute.setDescriptions(descriptions); | ||
| 1730 | + routeCacheRepository.save(stationRoute); | ||
| 1731 | + resultMap.put("status", ResponseCode.SUCCESS); | ||
| 1732 | + } catch (Exception e) { | ||
| 1733 | + resultMap.put("status", ResponseCode.ERROR); | ||
| 1734 | + logger.error("save erro.", e); | ||
| 1735 | + } | ||
| 1736 | + return resultMap; | ||
| 1737 | + } | ||
| 1616 | } | 1738 | } |
| 1617 | \ No newline at end of file | 1739 | \ No newline at end of file |
src/main/resources/static/pages/base/line/css/bmap_base.css
| @@ -13,7 +13,7 @@ html,body{ | @@ -13,7 +13,7 @@ html,body{ | ||
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | .caption { | 15 | .caption { |
| 16 | - color: #B7B7B7; | 16 | + color: white; |
| 17 | font-size: 18px; | 17 | font-size: 18px; |
| 18 | position: relative; | 18 | position: relative; |
| 19 | margin: 15px; | 19 | margin: 15px; |
| @@ -33,11 +33,16 @@ html,body{ | @@ -33,11 +33,16 @@ html,body{ | ||
| 33 | box-shadow: 10px 10px 5px #888888; | 33 | box-shadow: 10px 10px 5px #888888; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | -.rm3_image { | 36 | +.table-toolbar { |
| 37 | + text-align: center; | ||
| 38 | + margin-top: 20px !important; | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +/* .rm3_image { | ||
| 37 | width: 120px; | 42 | width: 120px; |
| 38 | height: 26px; | 43 | height: 26px; |
| 39 | 44 | ||
| 40 | -} | 45 | +} */ |
| 41 | 46 | ||
| 42 | /* 隐藏百度地图logo */ | 47 | /* 隐藏百度地图logo */ |
| 43 | .anchorBL, | 48 | .anchorBL, |
| @@ -47,6 +52,68 @@ html,body{ | @@ -47,6 +52,68 @@ html,body{ | ||
| 47 | display: none; | 52 | display: none; |
| 48 | } | 53 | } |
| 49 | 54 | ||
| 55 | +.protlet-box{ | ||
| 56 | + | ||
| 57 | + position: absolute; | ||
| 58 | + | ||
| 59 | + top: 40px; | ||
| 60 | + | ||
| 61 | + margin-left: 10px; | ||
| 62 | + | ||
| 63 | + overflow: hidden; | ||
| 64 | + | ||
| 65 | + width: 380px; | ||
| 66 | + | ||
| 67 | + height: auto; | ||
| 68 | + | ||
| 69 | + background:transparent; | ||
| 70 | + | ||
| 71 | + border:0px solid; | ||
| 72 | + | ||
| 73 | + box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33); | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +.BMap_pop div:nth-child(1) , | ||
| 77 | +.BMap_pop div:nth-child(2) , | ||
| 78 | +.BMap_pop div:nth-child(3) , | ||
| 79 | +.BMap_pop div:nth-child(4) , | ||
| 80 | +.BMap_pop div:nth-child(5) , | ||
| 81 | +.BMap_pop div:nth-child(6) , | ||
| 82 | +.BMap_pop div:nth-child(7) { | ||
| 83 | + | ||
| 84 | + border:0px solid rgb(255, 255, 255) !important; | ||
| 85 | + background-color:#3B3F51 !important; | ||
| 86 | + | ||
| 87 | +} | ||
| 88 | + | ||
| 89 | +.BMap_pop div:nth-child(3){ | ||
| 90 | + | ||
| 91 | + width:23px !important; | ||
| 92 | + | ||
| 93 | +} | ||
| 94 | + | ||
| 95 | +.BMap_pop div:nth-child(7) { | ||
| 96 | + | ||
| 97 | + width:23px !important; | ||
| 98 | + | ||
| 99 | + height:24px !important; | ||
| 100 | + | ||
| 101 | +} | ||
| 102 | + | ||
| 103 | +.BMap_pop div:nth-child(5) { | ||
| 104 | + | ||
| 105 | + height:24px !important; | ||
| 106 | + | ||
| 107 | +} | ||
| 108 | + | ||
| 109 | +/* 图片以后在弄,先隐藏div */ | ||
| 110 | +.BMap_pop div:nth-child(8) { | ||
| 111 | + | ||
| 112 | + height:0px !important; | ||
| 113 | + /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */ | ||
| 114 | + /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */ | ||
| 115 | + | ||
| 116 | +} | ||
| 50 | 117 | ||
| 51 | .BMap_pop { | 118 | .BMap_pop { |
| 52 | 119 | ||
| @@ -54,6 +121,7 @@ html,body{ | @@ -54,6 +121,7 @@ html,body{ | ||
| 54 | 121 | ||
| 55 | } | 122 | } |
| 56 | 123 | ||
| 124 | +/* 滚动条属性 */ | ||
| 57 | .defeat-scroll { | 125 | .defeat-scroll { |
| 58 | width: 98%; | 126 | width: 98%; |
| 59 | height:380px; | 127 | height:380px; |
| @@ -88,3 +156,58 @@ background:rgba(255, 255, 255, 0); | @@ -88,3 +156,58 @@ background:rgba(255, 255, 255, 0); | ||
| 88 | /* background:#FF0BEE; */ | 156 | /* background:#FF0BEE; */ |
| 89 | background:rgba(255, 255, 255, 0); | 157 | background:rgba(255, 255, 255, 0); |
| 90 | } | 158 | } |
| 159 | +/* 右侧悬浮框属性 */ | ||
| 160 | +ul li a { | ||
| 161 | + display: block; | ||
| 162 | + color: white; | ||
| 163 | + padding: 8px 16px; | ||
| 164 | + text-decoration: none; | ||
| 165 | +} | ||
| 166 | + | ||
| 167 | +ul li { | ||
| 168 | + text-align: center; | ||
| 169 | +} | ||
| 170 | + | ||
| 171 | +ul li:last-child { | ||
| 172 | + border-bottom: none; | ||
| 173 | +} | ||
| 174 | + | ||
| 175 | +ul li a.active { | ||
| 176 | +/* background-color: #4CAF50; */ | ||
| 177 | + color: white; | ||
| 178 | +} | ||
| 179 | + | ||
| 180 | +ul li a:hover:not(.active) { | ||
| 181 | + background-color: #36c6d3; | ||
| 182 | + color: white; | ||
| 183 | +} | ||
| 184 | +/* 鼠标徘徊于tr张的状态 */ | ||
| 185 | +.table-hover > tbody > tr:hover { | ||
| 186 | + color: white; | ||
| 187 | + background-color: #36c6d3 !important; | ||
| 188 | +} | ||
| 189 | +/* 站点单选框 */ | ||
| 190 | +.radio_label { | ||
| 191 | + display:block; | ||
| 192 | + color: white; | ||
| 193 | + float: left; | ||
| 194 | + cursor: pointer; | ||
| 195 | + margin-left: 50px; | ||
| 196 | + font-size: 20px; | ||
| 197 | + margin-top: 5px; | ||
| 198 | + text-align: center; | ||
| 199 | +} | ||
| 200 | +.radioclass { | ||
| 201 | + margin-top: 6px !important; | ||
| 202 | + width: 17px; | ||
| 203 | + height: 17px; | ||
| 204 | + color: #36c6d3; | ||
| 205 | +/* background-color: #36c6d3; */ | ||
| 206 | +/* background-clip: #36c6d3; */ | ||
| 207 | +} | ||
| 208 | +.on { | ||
| 209 | + background-position: 0 0; | ||
| 210 | +} | ||
| 211 | + | ||
| 212 | + | ||
| 213 | + |
src/main/resources/static/pages/base/line/editRoute.html
| @@ -282,9 +282,6 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | @@ -282,9 +282,6 @@ $('#edit_route_mobal').on('editRouteMobal.show', function(e,transGPS,editRoute,m | ||
| 282 | fun.linePanlThree(lineid,data,directionData); | 282 | fun.linePanlThree(lineid,data,directionData); |
| 283 | }); | 283 | }); |
| 284 | $('#upload_show').removeClass('hidden'); | 284 | $('#upload_show').removeClass('hidden'); |
| 285 | - //$('#Undo').removeClass('hidden'); | ||
| 286 | - //$('#cut_section').removeClass('hidden'); | ||
| 287 | - //$('#uploadRoute').addClass('hidden'); | ||
| 288 | $('#upload').addClass('hidden'); | 285 | $('#upload').addClass('hidden'); |
| 289 | layer.msg('请先编辑路段,并保存!!!'); | 286 | layer.msg('请先编辑路段,并保存!!!'); |
| 290 | }else { | 287 | }else { |
src/main/resources/static/pages/base/line/editstation.html
0 → 100644
| 1 | +<!-- 编辑站点 --> | ||
| 2 | +<div class="modal fade" id="edit_station_mobal" role="basic" aria-hidden="true"> | ||
| 3 | + <div class="modal-dialog"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | ||
| 7 | + <h4 class="modal-title">编辑站点</h4> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + <form class="form-horizontal" role="form" id="edit_station_form" action="/module" method="post"> | ||
| 11 | + <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> | ||
| 12 | + 您的输入有误,请检查下面的输入项 | ||
| 13 | + </div> | ||
| 14 | + <!-- 线路ID --> | ||
| 15 | + <input type="hidden" name="stationId" id="stationIdInput"> | ||
| 16 | + <input type="hidden" name="stationRouteId" id="stationRouteIdInput"> | ||
| 17 | + <input type="hidden" name="stationRouteLine" id="stationRouteLineInput"> | ||
| 18 | + <input type="hidden" name="lineCode" id="lineCodeInput"> | ||
| 19 | + <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" /> | ||
| 20 | + <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" /> | ||
| 21 | + <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | ||
| 22 | + <input type="hidden" name="x" id="xInput" value=""/> | ||
| 23 | + <input type="hidden" name="y" id="yInput" value=""/> | ||
| 24 | + <!-- 站点名称 --> | ||
| 25 | + <div class="form-body"> | ||
| 26 | + <div class="form-group"> | ||
| 27 | + <label class="control-label col-md-3"> | ||
| 28 | + <span class="required"> * </span> 站点名称 : | ||
| 29 | + </label> | ||
| 30 | + <div class="col-md-6"> | ||
| 31 | + <input type="text" class="form-control" name="zdmc" id="zdmcInput" placeholder="站点名称" readonly="readonly"> | ||
| 32 | + </div> | ||
| 33 | + </div> | ||
| 34 | + </div> | ||
| 35 | + <!-- 站点路由名称 --> | ||
| 36 | + <div class="form-body"> | ||
| 37 | + <div class="form-group"> | ||
| 38 | + <label class="control-label col-md-3"> | ||
| 39 | + <span class="required"> * </span> 站点路由名称: | ||
| 40 | + </label> | ||
| 41 | + <div class="col-md-6"> | ||
| 42 | + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称"> | ||
| 43 | + </div> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + <!-- 站点编码 --> | ||
| 47 | + <div class="form-body"> | ||
| 48 | + <div class="form-group"> | ||
| 49 | + <label class="control-label col-md-3"> | ||
| 50 | + <span class="required"> * </span> 站点编码 : | ||
| 51 | + </label> | ||
| 52 | + <div class="col-md-6"> | ||
| 53 | + <input type="text" class="form-control" name="stationCod" id="stationCodInput" placeholder="站点编码" readonly="readonly"> | ||
| 54 | + </div> | ||
| 55 | + </div> | ||
| 56 | + </div> | ||
| 57 | + <!-- 站点方向 --> | ||
| 58 | + <div class="form-body"> | ||
| 59 | + <div class="form-group"> | ||
| 60 | + <label class="control-label col-md-3"> | ||
| 61 | + <span class="required"> * </span>站点方向 : | ||
| 62 | + </label> | ||
| 63 | + <div class="col-md-6"> | ||
| 64 | + <select name="directions" class="form-control" id="stationdirSelect"> | ||
| 65 | + <option value="">-- 请选择站点类型 --</option> | ||
| 66 | + <option value="0">上行</option> | ||
| 67 | + <option value="1">下行</option> | ||
| 68 | + </select> | ||
| 69 | + </div> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + <!-- 站点序号 --> | ||
| 73 | + <div class="form-body"> | ||
| 74 | + <div class="form-group"> | ||
| 75 | + <label class="control-label col-md-3"> | ||
| 76 | + 上一站点 : | ||
| 77 | + </label> | ||
| 78 | + <div class="col-md-6"> | ||
| 79 | + <select name="stationRouteCode" class="form-control" id="stationrouteSelect" style="width:100%"></select> | ||
| 80 | + <span class="help-block"> *说明:选择的站点将作为本站序号的参考,成为选择站点的下一站。 </span> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + <!-- 站点类型 --> | ||
| 85 | + <div class="form-body"> | ||
| 86 | + <div class="form-group"> | ||
| 87 | + <label class="control-label col-md-3"> | ||
| 88 | + <span class="required"> * </span>站点类型 : | ||
| 89 | + </label> | ||
| 90 | + <div class="col-md-6"> | ||
| 91 | + <select name="stationMark" class="form-control" id="stationMarkSelect"> | ||
| 92 | + <option value="">-- 请选择站点类型 --</option> | ||
| 93 | + <option value="B">起点站</option> | ||
| 94 | + <option value="Z">中途站</option> | ||
| 95 | + <option value="E">终点站</option> | ||
| 96 | + </select> | ||
| 97 | + </div> | ||
| 98 | + </div> | ||
| 99 | + </div> | ||
| 100 | + <!-- 经纬度坐标点 --> | ||
| 101 | + <div class="form-body"> | ||
| 102 | + <div class="form-group"> | ||
| 103 | + <label class="col-md-3 control-label"> <span class="required"> * </span>经纬度坐标点:</label> | ||
| 104 | + <div class="col-md-6"> | ||
| 105 | + <input type="text" class="form-control" name="bJwpoints" id="bJwpointsInput" placeholder="经纬度坐标点"> | ||
| 106 | + </div> | ||
| 107 | + </div> | ||
| 108 | + </div> | ||
| 109 | + <!-- 几何图形类型 --> | ||
| 110 | + <div class="form-body"> | ||
| 111 | + <div class="form-group"> | ||
| 112 | + <label class="col-md-3 control-label"><span class="required"> * </span>几何图形类型:</label> | ||
| 113 | + <div class="col-md-6"> | ||
| 114 | + <input type="text" class="form-control" name="shapesType" id="shapesTypeSelect" placeholder="几何图形类型" readonly="readonly"> | ||
| 115 | + </div> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + <!-- 圆形半径 --> | ||
| 119 | + <div class="form-body" id="radiusGroup"> | ||
| 120 | + <div class="form-group"> | ||
| 121 | + <label class="col-md-3 control-label"><span class="required"> * </span>圆形半径 :</label> | ||
| 122 | + <div class="col-md-6"> | ||
| 123 | + <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="圆形半径"> | ||
| 124 | + </div> | ||
| 125 | + </div> | ||
| 126 | + </div> | ||
| 127 | + <!-- 是否撤销 --> | ||
| 128 | + <div class="form-body"> | ||
| 129 | + <div class="form-group"> | ||
| 130 | + <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销 :</label> | ||
| 131 | + <div class="col-md-6"> | ||
| 132 | + <select name="destroy" class="form-control" id="destroySelect"> | ||
| 133 | + <option value="">-- 请选择撤销类型 --</option> | ||
| 134 | + <option value="0">否</option> | ||
| 135 | + <option value="1">是</option> | ||
| 136 | + </select> | ||
| 137 | + </div> | ||
| 138 | + </div> | ||
| 139 | + </div> | ||
| 140 | + <!-- 道路编码--> | ||
| 141 | + <div class="form-body"> | ||
| 142 | + <div class="form-group"> | ||
| 143 | + <label class="control-label col-md-3">道路编码 :</label> | ||
| 144 | + <div class="col-md-6"> | ||
| 145 | + <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码"> | ||
| 146 | + </div> | ||
| 147 | + </div> | ||
| 148 | + </div> | ||
| 149 | + <!-- 到站时间 --> | ||
| 150 | + <div class="form-body"> | ||
| 151 | + <div class="form-group"> | ||
| 152 | + <label class="col-md-3 control-label">到站时间 :</label> | ||
| 153 | + <div class="col-md-6"> | ||
| 154 | + <input type="text" class="form-control" name="toTime" id="toTimeInput" placeholder="到站时间"> | ||
| 155 | + <span class="help-block">单位:分钟</span> | ||
| 156 | + </div> | ||
| 157 | + </div> | ||
| 158 | + </div> | ||
| 159 | + <!-- 到站距离 --> | ||
| 160 | + <div class="form-body"> | ||
| 161 | + <div class="form-group"> | ||
| 162 | + <label class="col-md-3 control-label">到站距离 :</label> | ||
| 163 | + <div class="col-md-6"> | ||
| 164 | + <input type="text" class="form-control" name="distances" id="distancesInput" placeholder="到站距离"> | ||
| 165 | + <span class="help-block">单位:公里</span> | ||
| 166 | + </div> | ||
| 167 | + </div> | ||
| 168 | + </div> | ||
| 169 | + <!-- 版本号 --> | ||
| 170 | + <div class="form-body"> | ||
| 171 | + <div class="form-group"> | ||
| 172 | + <label class="col-md-3 control-label">版本号 :</label> | ||
| 173 | + <div class="col-md-6"> | ||
| 174 | + <input type="text" class="form-control" name="versions" id='versionsInput' Readonly> | ||
| 175 | + </div> | ||
| 176 | + </div> | ||
| 177 | + </div> | ||
| 178 | + <!-- 描述/说明 --> | ||
| 179 | + <div class="form-group"> | ||
| 180 | + <label class="control-label col-md-3"> 描述/说明 : </label> | ||
| 181 | + <div class="col-md-6"> | ||
| 182 | + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | ||
| 183 | + </div> | ||
| 184 | + </div> | ||
| 185 | + </form> | ||
| 186 | + </div> | ||
| 187 | + <div class="modal-footer"> | ||
| 188 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 189 | + <button type="button" class="btn btn-primary" id="editStationButton">提交数据</button> | ||
| 190 | + </div> | ||
| 191 | + </div> | ||
| 192 | + </div> | ||
| 193 | +</div> | ||
| 194 | +<script type="text/javascript"> | ||
| 195 | + | ||
| 196 | +$('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,station,fun){ | ||
| 197 | + layer.closeAll(); | ||
| 198 | + fun.setFormValue(station); | ||
| 199 | + var initzdlyP = {'lineId':station.stationRouteLine,'destroy':0,'direction':station.stationRouteDirections}; | ||
| 200 | + initSelect(initzdlyP); | ||
| 201 | + // 显示mobal | ||
| 202 | + $('#edit_station_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | ||
| 203 | + // 当调用 hide 实例方法时触发 | ||
| 204 | + $('#edit_station_mobal').on('hide.bs.modal', function () { | ||
| 205 | + closeMobleSetClean(); | ||
| 206 | + }); | ||
| 207 | + function closeMobleSetClean() { | ||
| 208 | + // 清除地图覆盖物 | ||
| 209 | + map_.clearMarkAndOverlays(); | ||
| 210 | + // 刷新站点列表 | ||
| 211 | + $('#station').click(); | ||
| 212 | + } | ||
| 213 | + // 编辑表单元素 | ||
| 214 | + var form = $('#edit_station_form'); | ||
| 215 | + // 获取错误提示元素 | ||
| 216 | + var error = $('.alert-danger', form); | ||
| 217 | + // 提交数据按钮事件 | ||
| 218 | + $('#editStationButton').on('click', function() { | ||
| 219 | + // 表单提交 | ||
| 220 | + form.submit(); | ||
| 221 | + }); | ||
| 222 | + // 表单验证 | ||
| 223 | + form.validate({ | ||
| 224 | + errorElement : 'span', | ||
| 225 | + errorClass : 'help-block help-block-error', | ||
| 226 | + focusInvalid : false, | ||
| 227 | + rules : { | ||
| 228 | + 'zdmc' : { required : true,maxlength : 50,},// 站点名称 必填项 | ||
| 229 | + 'stationName' : { required : true,maxlength : 50,},// 站点名称 必填项 | ||
| 230 | + 'stationCod': {required : true,},// 站点编码 必填项 | ||
| 231 | + 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项 | ||
| 232 | + 'stationRouteCode' : {isStart : true},// 站点序号 | ||
| 233 | + 'stationMark' : {required : true},// 站点类型 必填项 | ||
| 234 | + 'bJwpoints' : {required : true},// 经纬度坐标点 必填项 | ||
| 235 | + 'shapesType' : {required : true},// 几何图形类型 必填项 | ||
| 236 | + 'radius' : {required : true,number : true},// 圆形半径 必填项 | ||
| 237 | + 'destroy' : {required : true},// 是否撤销 必填项 | ||
| 238 | + 'toTime' : {number : true},// 到站时间 必须输入合法的数字(负数,小数)。 | ||
| 239 | + 'distances' : {number : true},// 到站距离 必须输入合法的数字(负数,小数)。 | ||
| 240 | + 'descriptions' : { maxlength: 150}// 描述与说明 最大长度 | ||
| 241 | + }, | ||
| 242 | + invalidHandler : function(event, validator) { | ||
| 243 | + error.show(); | ||
| 244 | + App.scrollTo(error, -200); | ||
| 245 | + }, | ||
| 246 | + highlight : function(element) { | ||
| 247 | + $(element).closest('.form-group').addClass('has-error'); | ||
| 248 | + }, | ||
| 249 | + unhighlight : function(element) { | ||
| 250 | + $(element).closest('.form-group').removeClass('has-error'); | ||
| 251 | + }, | ||
| 252 | + success : function(label) { | ||
| 253 | + label.closest('.form-group').removeClass('has-error'); | ||
| 254 | + }, | ||
| 255 | + submitHandler : function(f) { | ||
| 256 | + var params = form.serializeJSON(); | ||
| 257 | + error.hide(); | ||
| 258 | + if(params.shapesType=='圆形') | ||
| 259 | + params.shapesType='r'; | ||
| 260 | + else if(params.shapesType=='多边形') | ||
| 261 | + params.shapesType='d'; | ||
| 262 | + if(params.stationRouteCode=='请选择...') | ||
| 263 | + params.stationRouteCode=''; | ||
| 264 | + $post('/station/stationCacheUpdate',params,function(resuntDate) { | ||
| 265 | + if(resuntDate.status=='SUCCESS') { | ||
| 266 | + // 弹出添加成功提示消息 | ||
| 267 | + layer.msg('修改成功...'); | ||
| 268 | + /** 通知更新缓存区 */ | ||
| 269 | + $.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs){console.log(rs)}) | ||
| 270 | + }else { | ||
| 271 | + // 弹出添加失败提示消息 | ||
| 272 | + layer.msg('修改失败...'); | ||
| 273 | + } | ||
| 274 | + $('#edit_station_mobal').modal('hide'); | ||
| 275 | + closeMobleSetClean(); | ||
| 276 | + }); | ||
| 277 | + } | ||
| 278 | + }); | ||
| 279 | + // 站点序号值改变事件 | ||
| 280 | + $('#stationrouteSelect').on('change',function() { | ||
| 281 | + var stationRValue = $('#stationrouteSelect').val(); | ||
| 282 | + debugger | ||
| 283 | + if(stationRValue=='请选择...') { | ||
| 284 | + $('#stationMarkSelect').val('B'); | ||
| 285 | + }else { | ||
| 286 | + var tempStr = stationRValue.split('_'); | ||
| 287 | + if(tempStr[1] == 'E') { | ||
| 288 | + $('#stationMarkSelect').val('E'); | ||
| 289 | + }else { | ||
| 290 | + $('#stationMarkSelect').val('Z'); | ||
| 291 | + } | ||
| 292 | + } | ||
| 293 | + }); | ||
| 294 | + function initSelect(p){ | ||
| 295 | + $get('/stationroute/cacheList',p,function(array) { | ||
| 296 | + // 定义路段路由长度、渲染拼音检索下拉框格式数据. | ||
| 297 | + var len_ = array.length,paramsD = new Array(); | ||
| 298 | + if(len_>0) { | ||
| 299 | + paramsD.push({'id':'请选择...','text':'请选择...'}); | ||
| 300 | + // 遍历. | ||
| 301 | + $.each(array, function(i, g){ | ||
| 302 | + // 判断. | ||
| 303 | + if(g.name!='' || g.name != null) { | ||
| 304 | + if(g.stationRouteCode != station.stationRouteStationRouteCode) { | ||
| 305 | + // 添加拼音检索下拉框格式数据数组. | ||
| 306 | + if(station.stationRouteStationMark=='E' && i == (len_-2)){ | ||
| 307 | + paramsD.push({'id':g.stationRouteCode + '_' + 'E' + '_' + g.directions, | ||
| 308 | + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)}); | ||
| 309 | + }else { | ||
| 310 | + paramsD.push({'id':g.stationRouteCode + '_' + g.stationMark + '_' + g.directions, | ||
| 311 | + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)}); | ||
| 312 | + } | ||
| 313 | + } | ||
| 314 | + } | ||
| 315 | + }); | ||
| 316 | + $('#stationrouteSelect').empty(); | ||
| 317 | + // 初始化上一个路段拼音检索下拉框. | ||
| 318 | + initPinYinSelect2($('#stationrouteSelect'),paramsD,function(selector) { | ||
| 319 | + setZdlyValue(); | ||
| 320 | + }); | ||
| 321 | + } | ||
| 322 | + }); | ||
| 323 | + } | ||
| 324 | + function setZdlyValue() { | ||
| 325 | + var params = {}; | ||
| 326 | + params.lineId = station.stationRouteLine; | ||
| 327 | + params.direction = station.stationRouteDirections; | ||
| 328 | + params.stationRouteCode = station.stationRouteStationRouteCode; | ||
| 329 | + $get('/stationroute/findCacheUpStationRouteCode',params , function(str) { | ||
| 330 | + debugger | ||
| 331 | + if(str.length>0){ | ||
| 332 | + var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + station.stationRouteDirections; | ||
| 333 | + $('#stationrouteSelect').select2('val',upStationRouteCode); | ||
| 334 | + }else { | ||
| 335 | + $('#stationrouteSelect').select2('val','请选择...'); | ||
| 336 | + } | ||
| 337 | + $('#stationMarkSelect').val(station.stationRouteStationMark); | ||
| 338 | + }); | ||
| 339 | + } | ||
| 340 | + // 当站点类型为中途站或者终点站时,上一站点为必填项! | ||
| 341 | + $.validator.addMethod("isStart", function(value,element) { | ||
| 342 | + var tel = false; | ||
| 343 | + var stationMarkV = $('#stationMarkSelect').val(); | ||
| 344 | + var stationrouteSelectV = $('#stationrouteSelect').val(); | ||
| 345 | + if(stationMarkV =='B'){ | ||
| 346 | + tel = true; | ||
| 347 | + return tel; | ||
| 348 | + }else if(stationMarkV =='Z' || stationMarkV =='E'){ | ||
| 349 | + if(stationrouteSelectV!=''){ | ||
| 350 | + tel = true; | ||
| 351 | + return tel; | ||
| 352 | + } | ||
| 353 | + } | ||
| 354 | + return tel; | ||
| 355 | + }, '当站点类型为中途站或者终点站时,上一站点为必填项!'); | ||
| 356 | + // 方向 | ||
| 357 | + $.validator.addMethod("dirIs", function(value,element) { | ||
| 358 | + var tel = true; | ||
| 359 | + var stationMarkV = $('#stationdirSelect').val(); | ||
| 360 | + if(stationMarkV!=station.stationRouteDirections){ | ||
| 361 | + tel = false; | ||
| 362 | + } | ||
| 363 | + return tel; | ||
| 364 | + }, '方向必须一致!'); | ||
| 365 | +}); | ||
| 366 | +</script> | ||
| 0 | \ No newline at end of file | 367 | \ No newline at end of file |
src/main/resources/static/pages/base/line/editstation_select.html
0 → 100644
| 1 | +<!-- 选择编辑站点方式 --> | ||
| 2 | +<div class="modal fade" id="editstation_select_mobal" tabindex="-1" role="basic" aria-hidden="true"> | ||
| 3 | + <div class="modal-dialog"> | ||
| 4 | + <div class="modal-content" style="width: 700px;"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | ||
| 7 | + <h4 class="modal-title">选择修改站点方式 | ||
| 8 | + <i class="fa fa-question-circle tipso-animation" style="color: rgba(158, 158, 158, 0.49);"></i> | ||
| 9 | + </h4> | ||
| 10 | + </div> | ||
| 11 | + <div class="modal-body"> | ||
| 12 | + <form class="form-horizontal" action="/" method="post" id="edit_select" role="form"> | ||
| 13 | + <div class="alert alert-danger display-hide" id="editSelectrequired"> | ||
| 14 | + <button class="close" data-close="alert"></button> | ||
| 15 | + 站点名称为必填项 | ||
| 16 | + </div> | ||
| 17 | + <div class="alert alert-danger display-hide" id="serchrname"> | ||
| 18 | + <button class="close" data-close="alert"></button> | ||
| 19 | + 系统无法生成,请选择其他方式新增 | ||
| 20 | + </div> | ||
| 21 | + <div class="form-group" id="formRequ"> | ||
| 22 | + <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label> | ||
| 23 | + <div class="col-md-9" id="errorInfo"> | ||
| 24 | + <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox"> | ||
| 25 | + </div> | ||
| 26 | + </div> | ||
| 27 | + <div class="form-group"> | ||
| 28 | + <label class="col-md-3 control-label"><span class="required"> * </span>修改方式:</label> | ||
| 29 | + <div class="col-md-9"> | ||
| 30 | + <div class="icheck-list"> | ||
| 31 | + <label> | ||
| 32 | + <input type="radio" class="icheck" name="editselect" value=0> 重新绘制位置 | ||
| 33 | + </label> | ||
| 34 | + <label> | ||
| 35 | + <input type="radio" class="icheck" name="editselect" value=1 checked> 编辑原始位置 | ||
| 36 | + </label> | ||
| 37 | + </div> | ||
| 38 | + </div> | ||
| 39 | + </div> | ||
| 40 | + </form> | ||
| 41 | + </div> | ||
| 42 | + <div class="modal-footer"> | ||
| 43 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 44 | + <button type="button" class="btn btn-primary" id="editselectStationNextButton">下一步</button> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | +</div> | ||
| 49 | +<script type="text/javascript"> | ||
| 50 | +$('#editstation_select_mobal').on('editStationSelectMobal_show', function(e, map_,drw,stationRoute){ | ||
| 51 | +// var sel = fun.getCurrSelNode(dir_); | ||
| 52 | +// var Station = sel[0].original; | ||
| 53 | + // 显示选择修改方式弹出层 | ||
| 54 | + $('#editstation_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | ||
| 55 | + setTimeout(function(){ | ||
| 56 | + var offsetY = $('.modal-dialog').offset().top-3 , | ||
| 57 | + offsetX = $('.modal-dialog').offset().left-10 ; | ||
| 58 | + $('.tipso-animation').tipso({ | ||
| 59 | + speed : 100, | ||
| 60 | + background : '#0ed0e8', | ||
| 61 | + color : '#ffffff', | ||
| 62 | + position :'right', | ||
| 63 | + width : 390, | ||
| 64 | + delay : 400, | ||
| 65 | + animationIn : 'bounceIn', | ||
| 66 | + animationOut : 'bounceOut', | ||
| 67 | + offsetX : -(offsetX), | ||
| 68 | + offsetY : -(offsetY), | ||
| 69 | + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span></br>'+ | ||
| 70 | + '<span style="display:block; float:left;font-size:x-small">B)编辑原始位置:编辑原始位置与站点信息.</span>', | ||
| 71 | + | ||
| 72 | + }); | ||
| 73 | + $('.tipso-animation').tipso('show'); | ||
| 74 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | ||
| 75 | + },500); | ||
| 76 | + // 获取站点名称元素并赋值 | ||
| 77 | + $('#stationNamebootbox').val(stationRoute.stationStationName); | ||
| 78 | + // 获取表单元素 | ||
| 79 | + var form = $('#edit_select'); | ||
| 80 | + // 获取错误提示元素 | ||
| 81 | + var editSelectrequired = $('#editSelectrequired', form); | ||
| 82 | + // 下一步操作事件 | ||
| 83 | + $('#editselectStationNextButton').on('click', function() { | ||
| 84 | + // 表单提交 | ||
| 85 | + form.submit(); | ||
| 86 | + }); | ||
| 87 | + //form 表单验证 | ||
| 88 | + form.validate({ | ||
| 89 | + errorElement : 'span', | ||
| 90 | + errorClass : 'help-block help-block-error', | ||
| 91 | + focusInvalid : false, | ||
| 92 | + rules : { | ||
| 93 | + 'stationNamebootbox' : {required : true,maxlength : 50,} | ||
| 94 | + }, | ||
| 95 | + invalidHandler : function(event, validator) { | ||
| 96 | + editSelectrequired.show(); | ||
| 97 | + App.scrollTo(requiredname, -200); | ||
| 98 | + }, | ||
| 99 | + highlight : function(element) { | ||
| 100 | + $(element).closest('.form-group').addClass('has-error'); | ||
| 101 | + }, | ||
| 102 | + unhighlight : function(element) { | ||
| 103 | + $(element).closest('.form-group').removeClass('has-error'); | ||
| 104 | + }, | ||
| 105 | + success : function(label) { | ||
| 106 | + label.closest('.form-group').removeClass('has-error'); | ||
| 107 | + }, | ||
| 108 | + submitHandler : function(f) { | ||
| 109 | + // 隐藏弹出层 | ||
| 110 | + $('#editstation_select_mobal').modal('hide'); | ||
| 111 | + // 表单序列 | ||
| 112 | + var params = form.serializeJSON(); | ||
| 113 | + // 站点名称 | ||
| 114 | + stationRoute.zdmc = params.stationNamebootbox; | ||
| 115 | + | ||
| 116 | + if(params.editselect==0){ | ||
| 117 | + layer.confirm('重绘站点,会修改站点编码,影响已做好的排班和线路文件。请谨慎使用,谢谢!', { | ||
| 118 | + btn: ['绘制','取消'] //按钮 | ||
| 119 | + }, function(index){ | ||
| 120 | + // 站点形状 | ||
| 121 | + stationRoute.stationShapesType = 'd'; | ||
| 122 | + | ||
| 123 | + map_.clearMarkAndOverlays(); | ||
| 124 | + // 打开绘制工具 | ||
| 125 | + drw.openPointDrawingManager(stationRoute); | ||
| 126 | + map_.localtionPoint(stationRoute.zdmc); | ||
| 127 | + layer.close(index); | ||
| 128 | + }); | ||
| 129 | + }else if(params.editselect==1){ | ||
| 130 | + // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | ||
| 131 | + var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', | ||
| 132 | + shift: 0,time: 10000}); | ||
| 133 | + // 编辑图形 | ||
| 134 | + map_.editShapes(stationRoute); | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + }); | ||
| 138 | +}) | ||
| 139 | +</script> | ||
| 0 | \ No newline at end of file | 140 | \ No newline at end of file |
src/main/resources/static/pages/base/line/js/drawingManager.js
0 → 100644
| 1 | +var DrawingManagerObj = function () { | ||
| 2 | + | ||
| 3 | + // 创建鼠标绘制管理类 | ||
| 4 | + var drawingManager = ''; | ||
| 5 | + | ||
| 6 | + var draMangerObj = { | ||
| 7 | + | ||
| 8 | + /** 初始化绘制工具类 */ | ||
| 9 | + init : function(map,styleOptions) { | ||
| 10 | + | ||
| 11 | + drawingManager = new BMapLib.DrawingManager(map, { | ||
| 12 | + | ||
| 13 | + //是否开启绘制模式 | ||
| 14 | + isOpen : false, | ||
| 15 | + | ||
| 16 | + //是否显示工具栏 | ||
| 17 | + enableDrawingTool : false, | ||
| 18 | + | ||
| 19 | + drawingToolOptions : { | ||
| 20 | + | ||
| 21 | + //位置 | ||
| 22 | + anchor : BMAP_ANCHOR_TOP_RIGHT, | ||
| 23 | + | ||
| 24 | + //偏离值 | ||
| 25 | + offset : new BMap.Size(5, 5), | ||
| 26 | + | ||
| 27 | + //工具栏缩放比例 | ||
| 28 | + scale : 0.8 | ||
| 29 | + | ||
| 30 | + }, | ||
| 31 | + | ||
| 32 | + //线的样式 | ||
| 33 | + polygonOptions : styleOptions | ||
| 34 | + | ||
| 35 | + }); | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | + return drawingManager; | ||
| 40 | + | ||
| 41 | + }, | ||
| 42 | + | ||
| 43 | + openPointDrawingManager : function(objStation) { | ||
| 44 | + | ||
| 45 | + // 打开鼠标绘画工具 | ||
| 46 | + drawingManager.open(); | ||
| 47 | + | ||
| 48 | + // 设置属性 | ||
| 49 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | ||
| 50 | + | ||
| 51 | + // 添加绘画完成事件 | ||
| 52 | + drawingManager.addEventListener('polygoncomplete', function(e) { | ||
| 53 | + | ||
| 54 | + drawingManager.close; | ||
| 55 | + | ||
| 56 | + if (e.getPath().length <= 2) { | ||
| 57 | + | ||
| 58 | + WorldsBMapLine.clearMarkAndOverlays(); | ||
| 59 | + openPointDrawingManager(); | ||
| 60 | + | ||
| 61 | + // 弹出提示消息 | ||
| 62 | + layer.msg('坐标点不能小于等于两个,请重新绘画!'); | ||
| 63 | + | ||
| 64 | + return; | ||
| 65 | + | ||
| 66 | + }else { | ||
| 67 | + | ||
| 68 | + // 获取编辑的多边形对象 | ||
| 69 | + var edit_pointE = e; | ||
| 70 | + | ||
| 71 | + var edit_bPloygonGrid = ""; | ||
| 72 | + | ||
| 73 | + var editPolyGonLen_ = edit_pointE.getPath().length; | ||
| 74 | + | ||
| 75 | + for(var k =0;k<editPolyGonLen_;k++) { | ||
| 76 | + | ||
| 77 | + if(k==0) { | ||
| 78 | + | ||
| 79 | + edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 80 | + | ||
| 81 | + }else { | ||
| 82 | + | ||
| 83 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 84 | + | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; | ||
| 90 | + | ||
| 91 | + // 多边形中心点 | ||
| 92 | + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | ||
| 93 | + | ||
| 94 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | ||
| 95 | + objStation.stationBJwpoints = centre_points; | ||
| 96 | + | ||
| 97 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | ||
| 98 | + objStation.stationShapesType = 'd';; | ||
| 99 | + | ||
| 100 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | ||
| 101 | + objStation.stationRadius = ''; | ||
| 102 | + | ||
| 103 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | ||
| 104 | + objStation.stationBPolygonGrid = edit_bPloygonGrid; | ||
| 105 | + | ||
| 106 | + $.get('editstation.html', function(m){ | ||
| 107 | + | ||
| 108 | + $(pjaxContainer).append(m); | ||
| 109 | + | ||
| 110 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]); | ||
| 111 | + | ||
| 112 | + }); | ||
| 113 | + | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + }); | ||
| 117 | + | ||
| 118 | + }, | ||
| 119 | + | ||
| 120 | + closeDrawingManager : function() { | ||
| 121 | + | ||
| 122 | + drawingManager.close(); | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + return draMangerObj; | ||
| 127 | + | ||
| 128 | +}(); | ||
| 0 | \ No newline at end of file | 129 | \ No newline at end of file |
src/main/resources/static/pages/base/line/js/line-list-table.js
| @@ -96,6 +96,12 @@ | @@ -96,6 +96,12 @@ | ||
| 96 | }); | 96 | }); |
| 97 | }); | 97 | }); |
| 98 | } | 98 | } |
| 99 | + // 选择线路,填充线路编码搜索框 | ||
| 100 | + $("#lineSelect").on("change",function(){ | ||
| 101 | + var text = $('#lineSelect').val(); | ||
| 102 | + var linecode = text.split("_"); | ||
| 103 | + $("#lineCodeInput").val(linecode[2]); | ||
| 104 | + }); | ||
| 99 | 105 | ||
| 100 | function gsdmTogsName(gsD,code) { | 106 | function gsdmTogsName(gsD,code) { |
| 101 | var rsStr = ''; | 107 | var rsStr = ''; |
src/main/resources/static/pages/base/line/js/line-list-function.js renamed to src/main/resources/static/pages/base/line/js/line-map-function.js
| @@ -43,7 +43,52 @@ var PublicFunctions = function () { | @@ -43,7 +43,52 @@ var PublicFunctions = function () { | ||
| 43 | $('#destroySelect').val(Section.destroy); | 43 | $('#destroySelect').val(Section.destroy); |
| 44 | // 描述/说明 | 44 | // 描述/说明 |
| 45 | $('#descriptionsTextarea').val(Section.descriptions); | 45 | $('#descriptionsTextarea').val(Section.descriptions); |
| 46 | - }, | 46 | + }, |
| 47 | + setFormValue : function(editStationParmas) { | ||
| 48 | + // 站点ID | ||
| 49 | + $('#stationIdInput').val(editStationParmas.stationId); | ||
| 50 | + // 站点路由ID | ||
| 51 | + $('#stationRouteIdInput').val(editStationParmas.stationRouteId); | ||
| 52 | + // 站点路由线路Id | ||
| 53 | + $('#stationRouteLineInput').val(editStationParmas.stationRouteLine); | ||
| 54 | + // 线路编码 | ||
| 55 | + $('#lineCodeInput').val(editStationParmas.stationRouteLineCode); | ||
| 56 | + // 百度坐标点图形集合 | ||
| 57 | + $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid); | ||
| 58 | + // 获取站点名称元素设值 | ||
| 59 | + $('#zdmcInput').val(editStationParmas.stationStationName); | ||
| 60 | + // 获取站点路由名称元素设值 | ||
| 61 | + $('#stationNameInput').val(editStationParmas.stationRouteStationName); | ||
| 62 | + // 获取站点编码元素设值 | ||
| 63 | + $('#stationCodInput').val(editStationParmas.stationStationCod); | ||
| 64 | + // 获取站点类型元素设值 | ||
| 65 | + // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark); | ||
| 66 | + // 获取站点方向元素设值 | ||
| 67 | + $('#stationdirSelect').val(editStationParmas.stationRouteDirections); | ||
| 68 | + // 获取站点道路编码元素设值 | ||
| 69 | + $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding); | ||
| 70 | + // 百度地图经纬度坐标中心点 | ||
| 71 | + $('#bJwpointsInput').val(editStationParmas.stationBJwpoints); | ||
| 72 | + if(editStationParmas.stationShapesType=='r') { | ||
| 73 | + // 获取图形类型元素,并添加值 | ||
| 74 | + $('#shapesTypeSelect').val('圆形'); | ||
| 75 | + }else if(editStationParmas.stationShapesType=='d'){ | ||
| 76 | + $('#radiusGroup').hide(); | ||
| 77 | + $('#shapesTypeSelect').val('多边形'); | ||
| 78 | + } | ||
| 79 | + // 获取半径元素,并添加值 | ||
| 80 | + $('#radiusInput').val(editStationParmas.stationRadius); | ||
| 81 | + // 是否撤销 | ||
| 82 | + $('#destroySelect').val(editStationParmas.stationDestroy); | ||
| 83 | + // 到站时间 | ||
| 84 | + $('#toTimeInput').val(editStationParmas.stationRouteToTime); | ||
| 85 | + // 到站距离 | ||
| 86 | + $('#distancesInput').val(editStationParmas.stationRouteDistances); | ||
| 87 | + // 线路版本号 | ||
| 88 | + $('#versionsInput').val(editStationParmas.stationRouteVersions); | ||
| 89 | + // 描述/说明 | ||
| 90 | + $('#descriptionsTextarea').val(editStationParmas.stationRouteDescriptions); | ||
| 91 | + }, | ||
| 47 | /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | 92 | /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ |
| 48 | linePanlThree : function(lineId,data,direction) { | 93 | linePanlThree : function(lineId,data,direction) { |
| 49 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | 94 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ |
| @@ -94,6 +139,8 @@ var PublicFunctions = function () { | @@ -94,6 +139,8 @@ var PublicFunctions = function () { | ||
| 94 | WorldsBMapLine.drawingUpline01(polylineArray,polyline_center,data[d]); | 139 | WorldsBMapLine.drawingUpline01(polylineArray,polyline_center,data[d]); |
| 95 | } | 140 | } |
| 96 | } | 141 | } |
| 142 | + /** 画出所有切面切点(切路段的点) */ | ||
| 143 | + WorldsBMapLine.batchPaintingPoint(); | ||
| 97 | }); | 144 | }); |
| 98 | }, | 145 | }, |
| 99 | // 方向代码转名称. | 146 | // 方向代码转名称. |
| @@ -105,11 +152,22 @@ var PublicFunctions = function () { | @@ -105,11 +152,22 @@ var PublicFunctions = function () { | ||
| 105 | srStr = '下行'; | 152 | srStr = '下行'; |
| 106 | return srStr; | 153 | return srStr; |
| 107 | }, | 154 | }, |
| 108 | -// editAChangeCssRemoveDisabled : function() { | ||
| 109 | -// $('#downLine').removeClass('btn disabled'); | ||
| 110 | -// $('.btn-circle').removeClass('disabled'); | ||
| 111 | -// $('#upLine').removeClass('btn disabled'); | ||
| 112 | -// }, | 155 | + // 图形编辑完成 |
| 156 | + editAChangeCssRemoveDisabled : function() { | ||
| 157 | + $('#section').removeClass('btn disabled'); | ||
| 158 | + $('#station').removeClass('btn disabled'); | ||
| 159 | + $('.btn-circle').removeClass('disabled'); | ||
| 160 | + $('.radio').removeClass('disabled'); | ||
| 161 | + $('.radioclass').removeClass('disabled'); | ||
| 162 | + }, | ||
| 163 | + // 图形编辑中 | ||
| 164 | + addAChangeCssAddDisabled : function() { | ||
| 165 | + $('#section').addClass('btn disabled'); | ||
| 166 | + $('#station').addClass('btn disabled'); | ||
| 167 | + $('.btn-circle').addClass('disabled'); | ||
| 168 | + $('.radio').addClass('disabled'); | ||
| 169 | + $('.radioclass').addClass('disabled'); | ||
| 170 | + }, | ||
| 113 | } | 171 | } |
| 114 | return PubFun ; | 172 | return PubFun ; |
| 115 | }(); | 173 | }(); |
| 116 | \ No newline at end of file | 174 | \ No newline at end of file |
src/main/resources/static/pages/base/line/js/line-list-map.js renamed to src/main/resources/static/pages/base/line/js/map.js
| @@ -223,6 +223,8 @@ var WorldsBMapLine = function () { | @@ -223,6 +223,8 @@ var WorldsBMapLine = function () { | ||
| 223 | } | 223 | } |
| 224 | polyUpline01.enableEditing(); | 224 | polyUpline01.enableEditing(); |
| 225 | WorldsBMapLine.setIsEditStatus(true); | 225 | WorldsBMapLine.setIsEditStatus(true); |
| 226 | + // 关闭按钮事件 | ||
| 227 | + PublicFunctions.addAChangeCssAddDisabled(); | ||
| 226 | }); | 228 | }); |
| 227 | 229 | ||
| 228 | // 添加路段双击事件 | 230 | // 添加路段双击事件 |
| @@ -248,6 +250,8 @@ var WorldsBMapLine = function () { | @@ -248,6 +250,8 @@ var WorldsBMapLine = function () { | ||
| 248 | $(pjaxContainer).append(m); | 250 | $(pjaxContainer).append(m); |
| 249 | $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [WorldsBMapLine,GetAjaxData,EditSectionObj,PublicFunctions]); | 251 | $('#edit_section_mobal_cache').trigger('editSectionMobalCache_show', [WorldsBMapLine,GetAjaxData,EditSectionObj,PublicFunctions]); |
| 250 | }); | 252 | }); |
| 253 | + // 打开按钮事件 | ||
| 254 | + PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 251 | }); | 255 | }); |
| 252 | 256 | ||
| 253 | // 路段右击事件 | 257 | // 路段右击事件 |
| @@ -260,6 +264,9 @@ var WorldsBMapLine = function () { | @@ -260,6 +264,9 @@ var WorldsBMapLine = function () { | ||
| 260 | var lat = e.lat; | 264 | var lat = e.lat; |
| 261 | var sectionName = null; | 265 | var sectionName = null; |
| 262 | var marker = new BMap.Marker(new BMap.Point(lng, lat)); // 创建点 | 266 | var marker = new BMap.Marker(new BMap.Point(lng, lat)); // 创建点 |
| 267 | + var label = new BMap.Label(pointIndex+1,{offset:new BMap.Size(pointIndex>8?0:4,0)}); | ||
| 268 | + label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"}); | ||
| 269 | + marker.setLabel(label); | ||
| 263 | marker.isFlag = true; | 270 | marker.isFlag = true; |
| 264 | if(pointIndex == 0) { | 271 | if(pointIndex == 0) { |
| 265 | sectionPoint[pointIndex] = {lng:lng , lat:lat}; | 272 | sectionPoint[pointIndex] = {lng:lng , lat:lat}; |
| @@ -319,7 +326,29 @@ var WorldsBMapLine = function () { | @@ -319,7 +326,29 @@ var WorldsBMapLine = function () { | ||
| 319 | } | 326 | } |
| 320 | } | 327 | } |
| 321 | } | 328 | } |
| 322 | - }, | 329 | + }, |
| 330 | + // 批量画点 | ||
| 331 | + batchPaintingPoint : function() { | ||
| 332 | + $.each(sectionList, function(index, value) { | ||
| 333 | + var section = value.section; | ||
| 334 | + debugger | ||
| 335 | + if(index == 0){ | ||
| 336 | + var marker = new BMap.Marker(new BMap.Point(section[0].lng, section[0].lat)); // 创建点 | ||
| 337 | + var label = new BMap.Label(index+1,{offset:new BMap.Size(index>8?0:4,0)}); | ||
| 338 | + label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"}); | ||
| 339 | + marker.setLabel(label); | ||
| 340 | + marker.isFlag = true; | ||
| 341 | + mapBValue.addOverlay(marker);// 添加覆盖物 | ||
| 342 | + } | ||
| 343 | + var marker = new BMap.Marker(new BMap.Point(section[1].lng, section[1].lat)); // 创建点 | ||
| 344 | + var label = new BMap.Label(index+2,{offset:new BMap.Size(index>7?0:4,0)}); | ||
| 345 | + label.setStyle({border :"0", color : "white",backgroundColor:"rgba(0,0,0,0)"}); | ||
| 346 | + marker.setLabel(label); | ||
| 347 | + marker.isFlag = true; | ||
| 348 | + mapBValue.addOverlay(marker);// 添加覆盖物 | ||
| 349 | + }); | ||
| 350 | + | ||
| 351 | + }, | ||
| 323 | /** 在地图上画点 @param:<point_center:中心坐标点> */ | 352 | /** 在地图上画点 @param:<point_center:中心坐标点> */ |
| 324 | drawingUpStationPoint : function(point_center,stationName,s) { | 353 | drawingUpStationPoint : function(point_center,stationName,s) { |
| 325 | 354 | ||
| @@ -379,6 +408,531 @@ var WorldsBMapLine = function () { | @@ -379,6 +408,531 @@ var WorldsBMapLine = function () { | ||
| 379 | } | 408 | } |
| 380 | })() | 409 | })() |
| 381 | }, | 410 | }, |
| 411 | + // 地图画多边形 | ||
| 412 | + pointsPolygon : function(objStation) { | ||
| 413 | + | ||
| 414 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | ||
| 415 | + mapBValue.setZoom(15); | ||
| 416 | + | ||
| 417 | + // 如果不为空 | ||
| 418 | + if(objStation) { | ||
| 419 | + | ||
| 420 | + // 清除地图覆盖物 | ||
| 421 | + mapBValue.clearOverlays(); | ||
| 422 | + | ||
| 423 | + // 获取中心点坐标字符串 | ||
| 424 | + var testpointStr = objStation.stationBJwpoints; | ||
| 425 | + | ||
| 426 | + // 按空格切割中心点坐标字符串 | ||
| 427 | + var BJwpointsPolygon = testpointStr.split(' '); | ||
| 428 | + | ||
| 429 | + // 中心点坐标 | ||
| 430 | + var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]); | ||
| 431 | + | ||
| 432 | + // 获取多边形坐标字符串 | ||
| 433 | + var stationBPolygonGrid = objStation.stationBPolygonGrid; | ||
| 434 | + | ||
| 435 | + // 截取多边形坐标字符串 | ||
| 436 | + var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); | ||
| 437 | + | ||
| 438 | + // 按逗号切割 | ||
| 439 | + var pointPolygonArray = stationBPolygonGridStr.split(','); | ||
| 440 | + | ||
| 441 | + // 多边形坐标集合 | ||
| 442 | + var polygonP = []; | ||
| 443 | + | ||
| 444 | + for(var v = 0;v<pointPolygonArray.length;v++) { | ||
| 445 | + | ||
| 446 | + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); | ||
| 447 | + | ||
| 448 | + } | ||
| 449 | + | ||
| 450 | + // 画多边形 | ||
| 451 | + polygon = new BMap.Polygon(polygonP, { | ||
| 452 | + | ||
| 453 | + // 线条显色 | ||
| 454 | + strokeColor : "blue", | ||
| 455 | + | ||
| 456 | + // 边线的宽度,以像素为单位。 | ||
| 457 | + strokeWeight : 2, | ||
| 458 | + | ||
| 459 | + // 边线透明度,取值范围0 - 1。 | ||
| 460 | + strokeOpacity : 0.5 | ||
| 461 | + }); | ||
| 462 | + | ||
| 463 | + // 增加地图覆盖物多边形 | ||
| 464 | + mapBValue.addOverlay(polygon); | ||
| 465 | + | ||
| 466 | + // 信息窗口属性 | ||
| 467 | + var opts_polygon = { | ||
| 468 | + | ||
| 469 | + // 信息窗口宽度 | ||
| 470 | + width : 200, | ||
| 471 | + | ||
| 472 | + // 信息窗口高度 | ||
| 473 | + height : 400, | ||
| 474 | + | ||
| 475 | + // 信息窗位置偏移值。 | ||
| 476 | + offset: new BMap.Size(500,20), | ||
| 477 | + | ||
| 478 | + //标题 | ||
| 479 | + title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>', | ||
| 480 | + | ||
| 481 | + //设置不允许信窗发送短息 | ||
| 482 | + enableMessage : false, | ||
| 483 | + | ||
| 484 | + //是否开启点击地图关闭信息窗口 | ||
| 485 | + enableCloseOnClick : false | ||
| 486 | + }; | ||
| 487 | + | ||
| 488 | + var markTypeStr = ''; | ||
| 489 | + | ||
| 490 | + if(objStation.stationRouteStationMark=='B') { | ||
| 491 | + | ||
| 492 | + markTypeStr='起点站'; | ||
| 493 | + | ||
| 494 | + }else if(objStation.stationRouteStationMark=='Z') { | ||
| 495 | + | ||
| 496 | + markTypeStr ='中途站'; | ||
| 497 | + | ||
| 498 | + | ||
| 499 | + }else if(objStation.stationRouteStationMark=='E') { | ||
| 500 | + | ||
| 501 | + markTypeStr='终点站'; | ||
| 502 | + | ||
| 503 | + } | ||
| 504 | + | ||
| 505 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | ||
| 506 | + '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' + | ||
| 507 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' + | ||
| 508 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' + | ||
| 509 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' + | ||
| 510 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' + | ||
| 511 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | ||
| 512 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | ||
| 513 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + | ||
| 514 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号  :' + objStation.stationRouteVersions + '</span>' + | ||
| 515 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ | ||
| 516 | + 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ | ||
| 517 | + objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; | ||
| 518 | + | ||
| 519 | + // 创建信息窗口 | ||
| 520 | + var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon); | ||
| 521 | + // 自定义标注物图片 | ||
| 522 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | ||
| 523 | + | ||
| 524 | + // 创建点 | ||
| 525 | + marker = new BMap.Marker(pointPolygon,{icon : icon_target}); | ||
| 526 | + | ||
| 527 | + // 把标注添物加到地图上 | ||
| 528 | + mapBValue.addOverlay(marker); | ||
| 529 | + | ||
| 530 | + // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 531 | + var PanOptions_ ={noAnimation :true}; | ||
| 532 | + | ||
| 533 | + // 将地图的中心点更改为给定的点。 | ||
| 534 | + mapBValue.panTo(pointPolygon,PanOptions_); | ||
| 535 | + | ||
| 536 | + // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | ||
| 537 | + mapBValue.panBy(10,-150,PanOptions_); | ||
| 538 | + | ||
| 539 | + //开启信息窗口 | ||
| 540 | + mapBValue.openInfoWindow(infoWindow_target,pointPolygon); | ||
| 541 | + | ||
| 542 | + } | ||
| 543 | + | ||
| 544 | + }, | ||
| 545 | + | ||
| 546 | + // 画圆 | ||
| 547 | + pointsCircle : function(objStation) { | ||
| 548 | + | ||
| 549 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | ||
| 550 | + mapBValue.setZoom(16); | ||
| 551 | + | ||
| 552 | + if(objStation) { | ||
| 553 | + | ||
| 554 | + // 清除地图覆盖物 | ||
| 555 | + mapBValue.clearOverlays(); | ||
| 556 | + | ||
| 557 | + // 获取中心坐标点字符串分割 | ||
| 558 | + var BJwpoints = objStation.stationBJwpoints.split(' '); | ||
| 559 | + | ||
| 560 | + // 中心坐标点 | ||
| 561 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | ||
| 562 | + | ||
| 563 | + //创建圆 | ||
| 564 | + circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | ||
| 565 | + | ||
| 566 | + // 允许覆盖物在map.clearOverlays方法中被清除 | ||
| 567 | + circle.enableMassClear(); | ||
| 568 | + | ||
| 569 | + // 百度地图添加覆盖物圆 | ||
| 570 | + mapBValue.addOverlay(circle); | ||
| 571 | + | ||
| 572 | + // 信息窗口参数属性 | ||
| 573 | + var opts = { | ||
| 574 | + | ||
| 575 | + // 信息窗口宽度 | ||
| 576 | + width : 200, | ||
| 577 | + | ||
| 578 | + // 信息窗口高度 | ||
| 579 | + height : 450, | ||
| 580 | + | ||
| 581 | + // 信息窗位置偏移值。 | ||
| 582 | + offset: new BMap.Size(500,120), | ||
| 583 | + | ||
| 584 | + //标题 | ||
| 585 | + title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>', | ||
| 586 | + | ||
| 587 | + //设置不允许信窗发送短息 | ||
| 588 | + enableMessage : false, | ||
| 589 | + | ||
| 590 | + //是否开启点击地图关闭信息窗口 | ||
| 591 | + enableCloseOnClick : false, | ||
| 592 | + | ||
| 593 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | ||
| 594 | + enableAutoPan:false | ||
| 595 | + }; | ||
| 596 | + | ||
| 597 | + var markTypeStr = ''; | ||
| 598 | + | ||
| 599 | + if(objStation.stationRouteStationMark=='B') { | ||
| 600 | + | ||
| 601 | + markTypeStr='起点站'; | ||
| 602 | + | ||
| 603 | + }else if(objStation.stationRouteStationMark=='Z') { | ||
| 604 | + | ||
| 605 | + markTypeStr ='中途站'; | ||
| 606 | + | ||
| 607 | + | ||
| 608 | + }else if(objStation.stationRouteStationMark=='E') { | ||
| 609 | + | ||
| 610 | + markTypeStr='终点站'; | ||
| 611 | + | ||
| 612 | + } | ||
| 613 | + | ||
| 614 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | ||
| 615 | + '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' + | ||
| 616 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' + | ||
| 617 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' + | ||
| 618 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' + | ||
| 619 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' + | ||
| 620 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | ||
| 621 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | ||
| 622 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + | ||
| 623 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号  :' + objStation.stationRouteVersions + '</span>' + | ||
| 624 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ | ||
| 625 | + 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ | ||
| 626 | + objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; | ||
| 627 | + | ||
| 628 | + // 创建信息窗口 | ||
| 629 | + var infoWindow_target = new BMap.InfoWindow(htm, opts); | ||
| 630 | + // 自定义标注物图片 | ||
| 631 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | ||
| 632 | + | ||
| 633 | + // 创建点 | ||
| 634 | + marker = new BMap.Marker(point,{icon : icon_target}); | ||
| 635 | + | ||
| 636 | + // 把标注添物加到地图上 | ||
| 637 | + mapBValue.addOverlay(marker); | ||
| 638 | + | ||
| 639 | + setTimeout(function(){ | ||
| 640 | + //开启信息窗口 | ||
| 641 | + marker.openInfoWindow(infoWindow_target,point); | ||
| 642 | + | ||
| 643 | + },100); | ||
| 644 | + | ||
| 645 | + // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 646 | + var PanOptions_ ={noAnimation :true}; | ||
| 647 | + | ||
| 648 | + // 将地图的中心点更改为给定的点。 | ||
| 649 | + mapBValue.panTo(point,PanOptions_); | ||
| 650 | + | ||
| 651 | + mapBValue.panBy(10,-200,PanOptions_); | ||
| 652 | + | ||
| 653 | + // 添加标志物监听事件 | ||
| 654 | + marker.addEventListener("click",function() { | ||
| 655 | + | ||
| 656 | + //开启信息窗口 | ||
| 657 | + marker.openInfoWindow(infoWindow_target,point); | ||
| 658 | + | ||
| 659 | + }); | ||
| 660 | + | ||
| 661 | + } | ||
| 662 | + | ||
| 663 | + }, | ||
| 664 | + // 编辑图形 | ||
| 665 | + editShapes : function(objStation) { | ||
| 666 | + | ||
| 667 | + // 清空地图 | ||
| 668 | + WorldsBMapLine.clearMarkAndOverlays(); | ||
| 669 | + | ||
| 670 | + // 站点对象不为空 | ||
| 671 | + if(objStation) { | ||
| 672 | + var stationShapesType = objStation.stationShapesType; | ||
| 673 | + | ||
| 674 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | ||
| 675 | + mapBValue.setZoom(16); | ||
| 676 | + | ||
| 677 | + // 编辑圆 | ||
| 678 | + if(stationShapesType =='r') { | ||
| 679 | + | ||
| 680 | + // 获取中心坐标点字符串分割 | ||
| 681 | + var BJwpoints = objStation.stationBJwpoints.split(' '); | ||
| 682 | + | ||
| 683 | + // 中心坐标点 | ||
| 684 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | ||
| 685 | + | ||
| 686 | + //创建圆 | ||
| 687 | + circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | ||
| 688 | + | ||
| 689 | + // 允许覆盖物在map.clearOverlays方法中被清除 | ||
| 690 | + circle.enableMassClear(); | ||
| 691 | + | ||
| 692 | + // 百度地图添加覆盖物圆 | ||
| 693 | + mapBValue.addOverlay(circle); | ||
| 694 | + | ||
| 695 | + // 开启编辑功能 | ||
| 696 | + circle.enableEditing(); | ||
| 697 | + | ||
| 698 | + // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 699 | + var PanOptions_ ={noAnimation :true}; | ||
| 700 | + | ||
| 701 | + // 将地图的中心点更改为给定的点。 | ||
| 702 | + mapBValue.panTo(point,PanOptions_); | ||
| 703 | + | ||
| 704 | + mapBValue.panBy(10,-200,PanOptions_); | ||
| 705 | + | ||
| 706 | + // 关闭按钮事件 | ||
| 707 | + debugger | ||
| 708 | + PublicFunctions.addAChangeCssAddDisabled(); | ||
| 709 | + | ||
| 710 | + // 编辑圆监听事件 | ||
| 711 | + circle.addEventListener('dblclick',function() { | ||
| 712 | + | ||
| 713 | + // 返回圆形的半径,单位为米。 | ||
| 714 | + var newRadius = circle.getRadius(); | ||
| 715 | + | ||
| 716 | + // 返回圆形的中心点坐标。 | ||
| 717 | + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | ||
| 718 | + | ||
| 719 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | ||
| 720 | + objStation.stationBJwpoints = newCenter; | ||
| 721 | + | ||
| 722 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | ||
| 723 | +// objStation.stationBJwpoints = 'r'; | ||
| 724 | + | ||
| 725 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | ||
| 726 | + objStation.stationRadius = Math.round(newRadius); | ||
| 727 | + | ||
| 728 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | ||
| 729 | + objStation.stationBPolygonGrid = ''; | ||
| 730 | + | ||
| 731 | + // 加载编辑页面 | ||
| 732 | + $.get('editstation.html', function(m){ | ||
| 733 | + | ||
| 734 | + $(pjaxContainer).append(m); | ||
| 735 | + | ||
| 736 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]); | ||
| 737 | + | ||
| 738 | + }); | ||
| 739 | + | ||
| 740 | + // 打开按钮事件 | ||
| 741 | + PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 742 | + }); | ||
| 743 | + | ||
| 744 | + // 编辑多变行 | ||
| 745 | + }else if(stationShapesType =='d') { | ||
| 746 | + | ||
| 747 | + // 清除地图覆盖物 | ||
| 748 | + mapBValue.clearOverlays(); | ||
| 749 | + | ||
| 750 | + // 获取中心点坐标字符串 | ||
| 751 | + var testpointStr = objStation.stationBJwpoints; | ||
| 752 | + | ||
| 753 | + // 按空格切割中心点坐标字符串 | ||
| 754 | + var BJwpointsPolygon = testpointStr.split(' '); | ||
| 755 | + | ||
| 756 | + // 中心点坐标 | ||
| 757 | + var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]); | ||
| 758 | + | ||
| 759 | + // 获取多边形坐标字符串 | ||
| 760 | + var stationBPolygonGrid = objStation.stationBPolygonGrid; | ||
| 761 | + | ||
| 762 | + // 截取多边形坐标字符串 | ||
| 763 | + var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); | ||
| 764 | + | ||
| 765 | + // 按逗号切割 | ||
| 766 | + var pointPolygonArray = stationBPolygonGridStr.split(','); | ||
| 767 | + | ||
| 768 | + // 多边形坐标集合 | ||
| 769 | + var polygonP = []; | ||
| 770 | + | ||
| 771 | + for(var v = 0;v<pointPolygonArray.length;v++) { | ||
| 772 | + | ||
| 773 | + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); | ||
| 774 | + | ||
| 775 | + } | ||
| 776 | + | ||
| 777 | + // 画多边形 | ||
| 778 | + polygon = new BMap.Polygon(polygonP, { | ||
| 779 | + | ||
| 780 | + // 线条显色 | ||
| 781 | + strokeColor : "blue", | ||
| 782 | + | ||
| 783 | + // 边线的宽度,以像素为单位。 | ||
| 784 | + strokeWeight : 2, | ||
| 785 | + | ||
| 786 | + // 边线透明度,取值范围0 - 1。 | ||
| 787 | + strokeOpacity : 0.5 | ||
| 788 | + }); | ||
| 789 | + | ||
| 790 | + // 增加地图覆盖物多边形 | ||
| 791 | + mapBValue.addOverlay(polygon); | ||
| 792 | + | ||
| 793 | + // 开启编辑功能(自 1.1 新增) | ||
| 794 | + polygon.enableEditing(); | ||
| 795 | + | ||
| 796 | + // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 797 | + var PanOptions_ ={noAnimation :true}; | ||
| 798 | + | ||
| 799 | + // 将地图的中心点更改为给定的点。 | ||
| 800 | + mapBValue.panTo(pointPolygon,PanOptions_); | ||
| 801 | + | ||
| 802 | + // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | ||
| 803 | + mapBValue.panBy(10,-150,PanOptions_); | ||
| 804 | + | ||
| 805 | + // 关闭按钮事件(图形编辑中) | ||
| 806 | + PublicFunctions.addAChangeCssAddDisabled(); | ||
| 807 | + | ||
| 808 | + // 添加多变行编辑事件 | ||
| 809 | + polygon.addEventListener('dblclick',function(e) { | ||
| 810 | + | ||
| 811 | + // 获取编辑的多边形对象 | ||
| 812 | + var edit_pointE = polygon; | ||
| 813 | + | ||
| 814 | + var edit_bPloygonGrid = ""; | ||
| 815 | + | ||
| 816 | + var editPolyGonLen_ = edit_pointE.getPath().length; | ||
| 817 | + | ||
| 818 | + for(var k =0;k<editPolyGonLen_;k++) { | ||
| 819 | + | ||
| 820 | + if(k==0) { | ||
| 821 | + | ||
| 822 | + edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 823 | + | ||
| 824 | + }else { | ||
| 825 | + | ||
| 826 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 827 | + | ||
| 828 | + } | ||
| 829 | + | ||
| 830 | + } | ||
| 831 | + | ||
| 832 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; | ||
| 833 | + | ||
| 834 | + // 多边形中心点 | ||
| 835 | + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | ||
| 836 | + | ||
| 837 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | ||
| 838 | + objStation.stationBJwpoints = centre_points; | ||
| 839 | + | ||
| 840 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | ||
| 841 | + objStation.stationShapesType = 'd';; | ||
| 842 | + | ||
| 843 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | ||
| 844 | + objStation.stationRadius = ''; | ||
| 845 | + | ||
| 846 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | ||
| 847 | + objStation.stationBPolygonGrid = edit_bPloygonGrid; | ||
| 848 | + | ||
| 849 | + $.get('editstation.html', function(m){ | ||
| 850 | + | ||
| 851 | + $(pjaxContainer).append(m); | ||
| 852 | + | ||
| 853 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMapLine,objStation,PublicFunctions]); | ||
| 854 | + | ||
| 855 | + }); | ||
| 856 | + | ||
| 857 | + }); | ||
| 858 | + | ||
| 859 | + // 打开按钮事件 | ||
| 860 | + PublicFunctions.editAChangeCssRemoveDisabled(); | ||
| 861 | + } | ||
| 862 | + } | ||
| 863 | + }, | ||
| 864 | + | ||
| 865 | + localtionPoint : function(stationNameV) { | ||
| 866 | + | ||
| 867 | + WorldsBMapLine.localSearchFromAdreesToPoint(stationNameV,function(Points) { | ||
| 868 | + | ||
| 869 | + if(Points) { | ||
| 870 | + | ||
| 871 | + var BJwpointsArray = Points.split(' '); | ||
| 872 | + | ||
| 873 | + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | ||
| 874 | + | ||
| 875 | + var marker_stargt2 = new BMap.Marker(stationNameChangePoint); | ||
| 876 | + | ||
| 877 | + var PanOptions ={noAnimation :true}; | ||
| 878 | + | ||
| 879 | + mapBValue.panTo(stationNameChangePoint,PanOptions); | ||
| 880 | + | ||
| 881 | + mapBValue.panBy(0,-100); | ||
| 882 | + | ||
| 883 | + // 将标注添加到地图中 | ||
| 884 | + mapBValue.addOverlay(marker_stargt2); | ||
| 885 | + | ||
| 886 | + //跳动的动画 | ||
| 887 | + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | ||
| 888 | + | ||
| 889 | + } | ||
| 890 | + | ||
| 891 | + }); | ||
| 892 | + | ||
| 893 | + }, | ||
| 894 | + | ||
| 895 | + // 根据地理名称获取百度经纬度坐标 | ||
| 896 | + localSearchFromAdreesToPoint: function(Address,callback) { | ||
| 897 | + | ||
| 898 | + // 创建一个搜索类实例 | ||
| 899 | + var localSearch = new BMap.LocalSearch(mapBValue); | ||
| 900 | + | ||
| 901 | + // 检索完成后的回调函数。 | ||
| 902 | + localSearch.setSearchCompleteCallback(function (searchResult) { | ||
| 903 | + | ||
| 904 | + var resultPoints = ''; | ||
| 905 | + | ||
| 906 | + if(searchResult) { | ||
| 907 | + | ||
| 908 | + // 返回索引指定的结果。索引0表示第1条结果 | ||
| 909 | + var poi = searchResult.getPoi(0); | ||
| 910 | + | ||
| 911 | + if(poi) { | ||
| 912 | + | ||
| 913 | + //获取经度和纬度 | ||
| 914 | + resultPoints = poi.point.lng + ' ' + poi.point.lat; | ||
| 915 | + | ||
| 916 | + callback && callback(resultPoints); | ||
| 917 | + | ||
| 918 | + }else { | ||
| 919 | + | ||
| 920 | + callback && callback(false); | ||
| 921 | + | ||
| 922 | + } | ||
| 923 | + | ||
| 924 | + }else { | ||
| 925 | + | ||
| 926 | + callback && callback(false); | ||
| 927 | + } | ||
| 928 | + | ||
| 929 | + }); | ||
| 930 | + | ||
| 931 | + // 根据检索词发起检索。 | ||
| 932 | + localSearch.search(Address); | ||
| 933 | + | ||
| 934 | + }, | ||
| 935 | + | ||
| 382 | clearMarkAndOverlays : function() { | 936 | clearMarkAndOverlays : function() { |
| 383 | 937 | ||
| 384 | // 清楚地图覆盖物 | 938 | // 清楚地图覆盖物 |
src/main/resources/static/pages/base/line/list.html
| @@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
| 81 | <td>#</td> | 81 | <td>#</td> |
| 82 | <td>#</td> | 82 | <td>#</td> |
| 83 | <td> | 83 | <td> |
| 84 | - <input type="text" class="form-control form-filter input-sm" name="lineCode_eq"> | 84 | + <input type="text" class="form-control form-filter input-sm" name="lineCode_eq" id="lineCodeInput"> |
| 85 | </td> | 85 | </td> |
| 86 | <td> | 86 | <td> |
| 87 | <select name="name_like" class="form-control" style="width:100%" id="lineSelect"></select> | 87 | <select name="name_like" class="form-control" style="width:100%" id="lineSelect"></select> |
src/main/resources/static/pages/base/line/map.html
| 1 | -< | ||
| 2 | <link href="/pages/base/line/css/bmap_base.css" rel="stylesheet" | 1 | <link href="/pages/base/line/css/bmap_base.css" rel="stylesheet" |
| 3 | type="text/css" /> | 2 | type="text/css" /> |
| 4 | <div class="portlet-body"> | 3 | <div class="portlet-body"> |
| @@ -16,31 +15,53 @@ | @@ -16,31 +15,53 @@ | ||
| 16 | </button> | 15 | </button> |
| 17 | </div> | 16 | </div> |
| 18 | <div class="portlet-body hidden" id="upload_show"> | 17 | <div class="portlet-body hidden" id="upload_show"> |
| 19 | - <div class="defeat-scroll" | ||
| 20 | - style="height: auto; max-height: 600px; overflow-y: auto; border-left: 10px;"> | ||
| 21 | - <table class="table table-bordered table-hover table-checkable " | ||
| 22 | - id="section_table" style="color: #B7B7B7;"> | ||
| 23 | - <thead> | ||
| 24 | - <tr role="row" class="heading"> | ||
| 25 | - <th>截取路段</th> | ||
| 26 | - </tr> | ||
| 27 | - </thead> | ||
| 28 | - <tbody></tbody> | ||
| 29 | - </table> | 18 | + <div> |
| 19 | + <ul class="nav nav-pills nav-justified steps"> | ||
| 20 | + <li class="active"> | ||
| 21 | + <a id="section"><span>路段</span></a> | ||
| 22 | + </li> | ||
| 23 | + <li> | ||
| 24 | + <a id="station"><span>站点</span></a> | ||
| 25 | + </li> | ||
| 26 | + </ul> | ||
| 30 | </div> | 27 | </div> |
| 31 | - <div class="table-toolbar" style="text-align: center;"> | ||
| 32 | - <button class="btn btn-circle blue" id="cutSection">提交选项</button> | ||
| 33 | - <button class="btn btn-circle blue" id="Undo">撤销切点</button> | 28 | + <div id="section_list_div" class="active" style="margin: 5px;"> |
| 29 | + <div class="defeat-scroll" | ||
| 30 | + style="height: 400px; overflow-y: auto; "> | ||
| 31 | + <table class="table table-bordered table-hover table-checkable " | ||
| 32 | + id="section_table" style="color: white;"> | ||
| 33 | + <thead> | ||
| 34 | + <tr role="row" class="heading"> | ||
| 35 | + <th>截取路段的名称</th> | ||
| 36 | + </tr> | ||
| 37 | + </thead> | ||
| 38 | + <tbody></tbody> | ||
| 39 | + </table> | ||
| 40 | + </div> | ||
| 41 | + <div class="table-toolbar"> | ||
| 42 | + <a class="btn btn-circle blue" id="Undo">撤销切点</a> | ||
| 43 | + <a class="btn btn-circle blue" id="cutSection">提交选项</a> | ||
| 44 | + </div> | ||
| 45 | + </div> | ||
| 46 | + <div id="station_list_div" class="hidden"> | ||
| 47 | + <div class="defeat-scroll" | ||
| 48 | + style="height: 400px; overflow-y: auto; "> | ||
| 49 | + </div> | ||
| 50 | + <div class="table-toolbar"> | ||
| 51 | + <a class="btn btn-circle blue" id="findStation">查看站点</a> | ||
| 52 | + <a class="btn btn-circle blue" id="updateStation">修改站点</a> | ||
| 53 | + </div> | ||
| 34 | </div> | 54 | </div> |
| 35 | </div> | 55 | </div> |
| 36 | </div> | 56 | </div> |
| 37 | </div> | 57 | </div> |
| 38 | </div> | 58 | </div> |
| 59 | +<!-- 右侧悬浮框截取路段List --> | ||
| 39 | <script type="text/html" id="section_list"> | 60 | <script type="text/html" id="section_list"> |
| 40 | {{each list as obj i }} | 61 | {{each list as obj i }} |
| 41 | <tr> | 62 | <tr> |
| 42 | <td style="vertical-align: middle;"> | 63 | <td style="vertical-align: middle;"> |
| 43 | - {{obj.name}}:[{{obj.section[0].lng}},{{obj.section[0].lat}}],[{{obj.section[1].lng}},{{obj.section[1].lat}}] | 64 | + {{obj.name}} |
| 44 | </td> | 65 | </td> |
| 45 | {{/each}} | 66 | {{/each}} |
| 46 | {{if list.length == 0}} | 67 | {{if list.length == 0}} |
| @@ -50,7 +71,6 @@ | @@ -50,7 +71,6 @@ | ||
| 50 | {{/if}} | 71 | {{/if}} |
| 51 | </script> | 72 | </script> |
| 52 | <!--上传GPS坐标生成路线监听事件 --> | 73 | <!--上传GPS坐标生成路线监听事件 --> |
| 53 | -< | ||
| 54 | <script type="text/javascript"> | 74 | <script type="text/javascript"> |
| 55 | $(function(){ | 75 | $(function(){ |
| 56 | // 关闭左侧栏 | 76 | // 关闭左侧栏 |
| @@ -59,6 +79,8 @@ $(function(){ | @@ -59,6 +79,8 @@ $(function(){ | ||
| 59 | var id = $.url().param('no'); | 79 | var id = $.url().param('no'); |
| 60 | // 方向 (0:上行;1:下行)默认上行 | 80 | // 方向 (0:上行;1:下行)默认上行 |
| 61 | var direction = 0; | 81 | var direction = 0; |
| 82 | + // 站点Map | ||
| 83 | + var stationRouteMap = new Map(); | ||
| 62 | // 如果线路ID不为空 | 84 | // 如果线路ID不为空 |
| 63 | if(id) { | 85 | if(id) { |
| 64 | var styleOptions = { | 86 | var styleOptions = { |
| @@ -80,7 +102,7 @@ $(function(){ | @@ -80,7 +102,7 @@ $(function(){ | ||
| 80 | var map_ = WorldsBMapLine.init(); | 102 | var map_ = WorldsBMapLine.init(); |
| 81 | 103 | ||
| 82 | /** 初始化绘图工具类 @param:<map_:map对象;styleOptions:绘图样式对象> @return:DrawingManager对象 */ | 104 | /** 初始化绘图工具类 @param:<map_:map对象;styleOptions:绘图样式对象> @return:DrawingManager对象 */ |
| 83 | - DrawingManagerObj.init(map_,styleOptions); | 105 | +// DrawingManagerObj.init(map_,styleOptions); |
| 84 | 106 | ||
| 85 | layer.msg('请生成路线!!!'); | 107 | layer.msg('请生成路线!!!'); |
| 86 | 108 | ||
| @@ -157,6 +179,88 @@ $(function(){ | @@ -157,6 +179,88 @@ $(function(){ | ||
| 157 | layer.msg("没有截取路段,不可以撤销!!!"); | 179 | layer.msg("没有截取路段,不可以撤销!!!"); |
| 158 | } | 180 | } |
| 159 | }); | 181 | }); |
| 182 | + // 监听右侧悬浮框导航栏事件 | ||
| 183 | + $('#station').on('click',function(){ | ||
| 184 | + $('#section').parent().removeClass('active'); | ||
| 185 | + $('#station').parent().addClass('active'); | ||
| 186 | + $('#station_list_div').removeClass('hidden'); | ||
| 187 | + $('#station_list_div').addClass('active'); | ||
| 188 | + $('#section_list_div').removeClass('active'); | ||
| 189 | + $('#section_list_div').addClass('hidden'); | ||
| 190 | + // 清除地图覆盖物 | ||
| 191 | + WorldsBMapLine.clearMarkAndOverlays(); | ||
| 192 | + | ||
| 193 | + var params = {}; | ||
| 194 | + var line = EditRoute.getLineObj(); | ||
| 195 | + params.lineId=line.id; | ||
| 196 | + params.dir = line.dir; | ||
| 197 | + $.get('/stationroute/findCachePoint',params,function(data){ | ||
| 198 | + var station_radio_html = '<div id="station_radio">'; | ||
| 199 | + var cont = 1; | ||
| 200 | + var check = 'checked="checked"'; | ||
| 201 | + $.each(data,function(){ | ||
| 202 | + stationRouteMap[this.stationRouteId] = this; | ||
| 203 | + station_radio_html += '<div class="radio"><label class="radio_label on"><input name="stationRadio" type="radio" class="radioclass" value="'+this.stationRouteId+'" '+(cont==1?check:"")+' />'+this.stationRouteStationName+"</label></div>"; | ||
| 204 | + cont++; | ||
| 205 | + }); | ||
| 206 | + station_radio_html += '</div>'; | ||
| 207 | + $("#station_list_div .defeat-scroll").html(station_radio_html); | ||
| 208 | + }); | ||
| 209 | + }); | ||
| 210 | + | ||
| 211 | + $('#findStation').on('click', function(){ | ||
| 212 | + var id = $("input[type='radio']:checked").val(); | ||
| 213 | + var stationRoute = stationRouteMap[id]; | ||
| 214 | + // 站点形状 | ||
| 215 | + var shapesType = stationRoute.stationShapesType; | ||
| 216 | + // 如果是圆 | ||
| 217 | + if(shapesType =='r') { | ||
| 218 | + | ||
| 219 | + // 百度地图画圆 | ||
| 220 | + WorldsBMapLine.pointsCircle(stationRoute); | ||
| 221 | + | ||
| 222 | + // 如果是多变行 | ||
| 223 | + }else if(shapesType == 'd') { | ||
| 224 | + | ||
| 225 | + // 百度地图画多边形 | ||
| 226 | + WorldsBMapLine.pointsPolygon(stationRoute); | ||
| 227 | + } | ||
| 228 | + | ||
| 229 | + }); | ||
| 230 | + $('#updateStation').on('click', function(){ | ||
| 231 | + var id = $("input[type='radio']:checked").val(); | ||
| 232 | + var stationRoute = stationRouteMap[id]; | ||
| 233 | + | ||
| 234 | + if(id && stationRoute){ | ||
| 235 | + $.get('editstation_select.html', function(m){ | ||
| 236 | + $(pjaxContainer).append(m); | ||
| 237 | + $('#editstation_select_mobal').trigger('editStationSelectMobal_show', [WorldsBMapLine, DrawingManagerObj, stationRoute]); | ||
| 238 | + }); | ||
| 239 | + } else if(id && !stationRoute){ | ||
| 240 | + layer.msg('您选择的站点不存在,请重新选择!'); | ||
| 241 | + }else{ | ||
| 242 | + layer.msg('请先选择要编辑的站点!'); | ||
| 243 | + } | ||
| 244 | + }); | ||
| 245 | + $('#section').on('click',function(){ | ||
| 246 | + $('#station').parent().removeClass('active'); | ||
| 247 | + $('#section').parent().addClass('active'); | ||
| 248 | + $('#section_list_div').removeClass('hidden'); | ||
| 249 | + $('#section_list_div').addClass('active'); | ||
| 250 | + $('#station_list_div').removeClass('active'); | ||
| 251 | + $('#station_list_div').addClass('hidden'); | ||
| 252 | + // 清除地图覆盖物 | ||
| 253 | + WorldsBMapLine.clearMarkAndOverlays(); | ||
| 254 | + | ||
| 255 | + var line = EditRoute.getLineObj(); | ||
| 256 | + lineid=line.id; | ||
| 257 | + directions = line.dir; | ||
| 258 | + // 查询路段信息 | ||
| 259 | + $get('/sectionroute/findSectionCache',{'line.id_eq' : lineid , 'directions_eq' : directions},function(data) { | ||
| 260 | + // 在地图上画出线路走向 | ||
| 261 | + PublicFunctions.linePanlThree(lineid,data,directions); | ||
| 262 | + }); | ||
| 263 | + }); | ||
| 160 | // 滚动轴监听事件 | 264 | // 滚动轴监听事件 |
| 161 | $('#scrllmouseEvent_div').on('mousemove',function() { | 265 | $('#scrllmouseEvent_div').on('mousemove',function() { |
| 162 | $('.defeat-scroll').css('overflow','auto'); | 266 | $('.defeat-scroll').css('overflow','auto'); |
| @@ -170,12 +274,12 @@ $(function(){ | @@ -170,12 +274,12 @@ $(function(){ | ||
| 170 | <!--坐标转换类 --> | 274 | <!--坐标转换类 --> |
| 171 | <script src="/pages/base/line/js/transGPS.js"></script> | 275 | <script src="/pages/base/line/js/transGPS.js"></script> |
| 172 | <!-- 地图类 --> | 276 | <!-- 地图类 --> |
| 173 | -<script src="/pages/base/line/js/line-list-map.js"></script> | 277 | +<script src="/pages/base/line/js/map.js"></script> |
| 174 | <!-- 函数与方法 --> | 278 | <!-- 函数与方法 --> |
| 175 | -<script src="/pages/base/line/js/line-list-function.js"></script> | 279 | +<script src="/pages/base/line/js/line-map-function.js"></script> |
| 176 | <!-- 修改路段对象类 --> | 280 | <!-- 修改路段对象类 --> |
| 177 | <script src="/pages/base/stationroute/js/editsection.js"></script> | 281 | <script src="/pages/base/stationroute/js/editsection.js"></script> |
| 178 | <!-- 绘图类 --> | 282 | <!-- 绘图类 --> |
| 179 | -<script src="/pages/base/stationroute/js/drawingManager.js"></script> | 283 | +<script src="/pages/base/line/js/drawingManager.js"></script> |
| 180 | <!-- ajax请求类 --> | 284 | <!-- ajax请求类 --> |
| 181 | <script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> | 285 | <script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> |
| 182 | \ No newline at end of file | 286 | \ No newline at end of file |
src/main/resources/static/pages/base/line/submit_select.html
| @@ -78,7 +78,8 @@ | @@ -78,7 +78,8 @@ | ||
| 78 | $('#submit_select_mobal').modal('hide'); | 78 | $('#submit_select_mobal').modal('hide'); |
| 79 | layer.confirm('提交马上会把原有的站点和路段覆盖,您确定要提交吗?', { | 79 | layer.confirm('提交马上会把原有的站点和路段覆盖,您确定要提交吗?', { |
| 80 | btn: ['提交','取消'] //按钮 | 80 | btn: ['提交','取消'] //按钮 |
| 81 | - }, function(){ | 81 | + }, function(index){ |
| 82 | + layer.close(index); | ||
| 82 | $.post('/section/sectionCut', section, function(resuntDate){ | 83 | $.post('/section/sectionCut', section, function(resuntDate){ |
| 83 | if(resuntDate.status=='SUCCESS') { | 84 | if(resuntDate.status=='SUCCESS') { |
| 84 | // 弹出添加成功提示消息 | 85 | // 弹出添加成功提示消息 |
| @@ -106,7 +107,6 @@ | @@ -106,7 +107,6 @@ | ||
| 106 | layer.msg('提交成功!'); | 107 | layer.msg('提交成功!'); |
| 107 | // 返回线路list页面 | 108 | // 返回线路list页面 |
| 108 | loadPage('/pages/base/line/list.html'); | 109 | loadPage('/pages/base/line/list.html'); |
| 109 | -// window.location.href = "/pages/base/stationroute/list.html?no="+section.sectionrouteLine+","+section.sectionrouteDirections; | ||
| 110 | }else { | 110 | }else { |
| 111 | // 弹出添加失败提示消息 | 111 | // 弹出添加失败提示消息 |
| 112 | layer.msg('提交失败...'); | 112 | layer.msg('提交失败...'); |
src/main/resources/static/pages/base/lineversions/js/lineversions-list-table.js
| @@ -87,6 +87,12 @@ | @@ -87,6 +87,12 @@ | ||
| 87 | }); | 87 | }); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | + $('#lineSelect').on('change',function() { | ||
| 91 | + var text = $('#lineSelect').val(); | ||
| 92 | + var linecode = text.split("_"); | ||
| 93 | + $("#lineCodeInput").val(linecode[2]); | ||
| 94 | + }); | ||
| 95 | + | ||
| 90 | function gsdmTogsName(gsD,code) { | 96 | function gsdmTogsName(gsD,code) { |
| 91 | var rsStr = ''; | 97 | var rsStr = ''; |
| 92 | for(var s = 0 ; s < gsD.length; s++) { | 98 | for(var s = 0 ; s < gsD.length; s++) { |
src/main/resources/static/pages/base/lineversions/list.html
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | <tr role="row" class="filter"> | 50 | <tr role="row" class="filter"> |
| 51 | <td>#</td> | 51 | <td>#</td> |
| 52 | <td> | 52 | <td> |
| 53 | - <input type="text" class="form-control form-filter input-sm" name="lineCode_eq"> | 53 | + <input type="text" class="form-control form-filter input-sm" name="lineCode_eq" id="lineCodeInput"> |
| 54 | </td> | 54 | </td> |
| 55 | <td> | 55 | <td> |
| 56 | <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> | 56 | <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> |
src/main/resources/static/pages/base/section/js/section-list-table.js
| @@ -161,8 +161,12 @@ | @@ -161,8 +161,12 @@ | ||
| 161 | }); | 161 | }); |
| 162 | }); | 162 | }); |
| 163 | }); | 163 | }); |
| 164 | + // 选择线路,填充线路编码搜索框 | ||
| 164 | $('#lineSelect').on('change',function() { | 165 | $('#lineSelect').on('change',function() { |
| 165 | initldNameSelect(); | 166 | initldNameSelect(); |
| 167 | + var text = $('#lineSelect').val(); | ||
| 168 | + var linecode = text.split("_"); | ||
| 169 | + $("#lineCodeInput").val(linecode[2]); | ||
| 166 | }); | 170 | }); |
| 167 | $('#dirSelect').on('change',function() { | 171 | $('#dirSelect').on('change',function() { |
| 168 | initldNameSelect(); | 172 | initldNameSelect(); |
src/main/resources/static/pages/base/section/list.html
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | <tr role="row" class="filter"> | 48 | <tr role="row" class="filter"> |
| 49 | <td></td> | 49 | <td></td> |
| 50 | <td> | 50 | <td> |
| 51 | - <input type="text" class="form-control form-filter input-sm" name="lineCode_eq"> | 51 | + <input type="text" class="form-control form-filter input-sm" name="lineCode_eq" id="lineCodeInput"> |
| 52 | </td> | 52 | </td> |
| 53 | <td> | 53 | <td> |
| 54 | <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> | 54 | <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> |
src/main/resources/static/pages/base/station/js/station-list-table.js
| @@ -112,6 +112,9 @@ | @@ -112,6 +112,9 @@ | ||
| 112 | $('#lineSelect').on('change',function() { | 112 | $('#lineSelect').on('change',function() { |
| 113 | initzdNameSelect(); | 113 | initzdNameSelect(); |
| 114 | $('#destroy').val(0); | 114 | $('#destroy').val(0); |
| 115 | + var text = $('#lineSelect').val(); | ||
| 116 | + var linecode = text.split("_"); | ||
| 117 | + $("#lineCodeInput").val(linecode[2]); | ||
| 115 | }); | 118 | }); |
| 116 | 119 | ||
| 117 | $('#dirSelect').on('change',function() { | 120 | $('#dirSelect').on('change',function() { |
src/main/resources/static/pages/base/station/list.html
| @@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
| 48 | <tr role="row" class="filter"> | 48 | <tr role="row" class="filter"> |
| 49 | <td>#</td> | 49 | <td>#</td> |
| 50 | <td> | 50 | <td> |
| 51 | - <input type="text" class="form-control form-filter input-sm" name="lineCode_eq"> | 51 | + <input type="text" class="form-control form-filter input-sm" id="lineCodeInput" name="lineCode_eq"> |
| 52 | </td> | 52 | </td> |
| 53 | <td> | 53 | <td> |
| 54 | <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> | 54 | <select name="line.name_like" class="form-control" style="width:100%" id="lineSelect"></select> |
src/main/resources/static/pages/base/stationroute/edit.html
| @@ -197,6 +197,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | @@ -197,6 +197,7 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,stati | ||
| 197 | layer.closeAll(); | 197 | layer.closeAll(); |
| 198 | var editStationParmasObj = station_.getEitdStation(); | 198 | var editStationParmasObj = station_.getEitdStation(); |
| 199 | var addLine = Line_.getLineObj(); | 199 | var addLine = Line_.getLineObj(); |
| 200 | + debugger | ||
| 200 | fun.setFormValue(editStationParmasObj); | 201 | fun.setFormValue(editStationParmasObj); |
| 201 | var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLineCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRouteDirections}; | 202 | var initzdlyP = {'lineCode_eq':editStationParmasObj.stationRouteLineCode,'destroy_eq':0,'directions_eq':editStationParmasObj.stationRouteDirections}; |
| 202 | initSelect(initzdlyP); | 203 | initSelect(initzdlyP); |
src/main/resources/static/pages/base/stationroute/edit_select.html
| @@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
| 19 | 系统无法生成,请选择其他方式新增 | 19 | 系统无法生成,请选择其他方式新增 |
| 20 | </div> | 20 | </div> |
| 21 | <div class="form-group" id="formRequ"> | 21 | <div class="form-group" id="formRequ"> |
| 22 | - <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label> | 22 | + <label class="col-md-3 control-label"><span class="required"> * </span>原始站点名称:</label> |
| 23 | <div class="col-md-9" id="errorInfo"> | 23 | <div class="col-md-9" id="errorInfo"> |
| 24 | <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox"> | 24 | <input type="text" class="form-control input-medium" id="stationNamebootbox" name="stationNamebootbox"> |
| 25 | </div> | 25 | </div> |
| @@ -108,27 +108,37 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,ed | @@ -108,27 +108,37 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, map_,drw,ajaxd,ed | ||
| 108 | label.closest('.form-group').removeClass('has-error'); | 108 | label.closest('.form-group').removeClass('has-error'); |
| 109 | }, | 109 | }, |
| 110 | submitHandler : function(f) { | 110 | submitHandler : function(f) { |
| 111 | - editStationObj.setEitdStation(Station); | ||
| 112 | // 隐藏弹出层 | 111 | // 隐藏弹出层 |
| 113 | $('#edit_select_mobal').modal('hide'); | 112 | $('#edit_select_mobal').modal('hide'); |
| 114 | - $('#downLine').addClass('btn disabled'); | ||
| 115 | - $('.btn-circle').addClass('disabled'); | ||
| 116 | - $('#upLine').addClass('btn disabled'); | 113 | + |
| 117 | // 表单序列 | 114 | // 表单序列 |
| 118 | var params = form.serializeJSON(); | 115 | var params = form.serializeJSON(); |
| 119 | // 站点名称 | 116 | // 站点名称 |
| 120 | var editStationName = params.stationNamebootbox; | 117 | var editStationName = params.stationNamebootbox; |
| 121 | - editStationObj.setEitdStationName(editStationName); | 118 | + |
| 122 | if(params.editselect==0){ | 119 | if(params.editselect==0){ |
| 123 | - map_.clearMarkAndOverlays(); | ||
| 124 | - // 打开绘制工具 | ||
| 125 | - drw.openDrawingManager(); | ||
| 126 | - map_.localtionPoint(editStationName); | ||
| 127 | - layer.open({ | ||
| 128 | - title: '友情提示' | ||
| 129 | - ,content: '重绘站点,会修改站点编码,影响已做好的排班和线路文件。请谨慎使用,谢谢!' | ||
| 130 | - }); | 120 | + layer.confirm('重绘站点,会修改站点编码,影响已做好的排班和线路文件。请谨慎使用,谢谢!', { |
| 121 | + btn: ['绘制','取消'] //按钮 | ||
| 122 | + }, function(index){ | ||
| 123 | + $('#downLine').addClass('btn disabled'); | ||
| 124 | + $('.btn-circle').addClass('disabled'); | ||
| 125 | + $('#upLine').addClass('btn disabled'); | ||
| 126 | + editStationObj.setEitdStation(Station); | ||
| 127 | + editStationObj.setEitdStationName(editStationName); | ||
| 128 | + | ||
| 129 | + map_.clearMarkAndOverlays(); | ||
| 130 | + // 打开绘制工具 | ||
| 131 | + drw.openDrawingManager(); | ||
| 132 | + map_.localtionPoint(editStationName); | ||
| 133 | + layer.close(index) | ||
| 134 | + }); | ||
| 131 | }else if(params.editselect==1){ | 135 | }else if(params.editselect==1){ |
| 136 | + $('#downLine').addClass('btn disabled'); | ||
| 137 | + $('.btn-circle').addClass('disabled'); | ||
| 138 | + $('#upLine').addClass('btn disabled'); | ||
| 139 | + editStationObj.setEitdStation(Station); | ||
| 140 | + editStationObj.setEitdStationName(editStationName); | ||
| 141 | + | ||
| 132 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | 142 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) |
| 133 | var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', | 143 | var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', |
| 134 | shift: 0,time: 10000}); | 144 | shift: 0,time: 10000}); |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
| @@ -216,6 +216,7 @@ var WorldsBMap = function () { | @@ -216,6 +216,7 @@ var WorldsBMap = function () { | ||
| 216 | 216 | ||
| 217 | // 地图画多边形 | 217 | // 地图画多边形 |
| 218 | pointsPolygon : function(objStation) { | 218 | pointsPolygon : function(objStation) { |
| 219 | + debugger | ||
| 219 | 220 | ||
| 220 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | 221 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) |
| 221 | mapBValue.setZoom(15); | 222 | mapBValue.setZoom(15); |
| @@ -314,7 +315,7 @@ var WorldsBMap = function () { | @@ -314,7 +315,7 @@ var WorldsBMap = function () { | ||
| 314 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | 315 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + |
| 315 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | 316 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + |
| 316 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + | 317 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + |
| 317 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + objStation.stationRouteVersions + '</span>' + | 318 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号  :' + objStation.stationRouteVersions + '</span>' + |
| 318 | '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ | 319 | '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ |
| 319 | 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ | 320 | 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ |
| 320 | objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; | 321 | objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; |
| @@ -373,6 +374,7 @@ var WorldsBMap = function () { | @@ -373,6 +374,7 @@ var WorldsBMap = function () { | ||
| 373 | 374 | ||
| 374 | // 画圆 | 375 | // 画圆 |
| 375 | pointsCircle : function(objStation) { | 376 | pointsCircle : function(objStation) { |
| 377 | + debugger | ||
| 376 | 378 | ||
| 377 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | 379 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) |
| 378 | mapBValue.setZoom(16); | 380 | mapBValue.setZoom(16); |
| @@ -448,7 +450,7 @@ var WorldsBMap = function () { | @@ -448,7 +450,7 @@ var WorldsBMap = function () { | ||
| 448 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | 450 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + |
| 449 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | 451 | '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + |
| 450 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + | 452 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + |
| 451 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + objStation.stationRouteVersions + '</span>' + | 453 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本号  :' + objStation.stationRouteVersions + '</span>' + |
| 452 | '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ | 454 | '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ |
| 453 | 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ | 455 | 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ |
| 454 | objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; | 456 | objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; |
| @@ -533,7 +535,6 @@ var WorldsBMap = function () { | @@ -533,7 +535,6 @@ var WorldsBMap = function () { | ||
| 533 | 535 | ||
| 534 | // 编辑图形 | 536 | // 编辑图形 |
| 535 | editShapes : function(editStationName,stationShapesTypeV,mindex) { | 537 | editShapes : function(editStationName,stationShapesTypeV,mindex) { |
| 536 | - | ||
| 537 | // 关闭信息窗口 | 538 | // 关闭信息窗口 |
| 538 | marker.closeInfoWindow(); | 539 | marker.closeInfoWindow(); |
| 539 | 540 |