Commit 2460355ec83a354983ea0e921b6a806879eb19e3
1 parent
ab1f6f09
路段与站点的基础信息编辑功能修订.
Showing
16 changed files
with
264 additions
and
326 deletions
src/main/java/com/bsth/controller/SectionRouteController.java
| ... | ... | @@ -72,4 +72,14 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer |
| 72 | 72 | public List<Map<String, Object>> findUpStationRouteCode(@RequestParam Map<String, Object> map) { |
| 73 | 73 | return routeService.findUpSectionRouteCode(map); |
| 74 | 74 | } |
| 75 | + | |
| 76 | + /** | |
| 77 | + * @Description :TODO(引用路段) | |
| 78 | + * | |
| 79 | + * @return List<Map<String, Object>> | |
| 80 | + */ | |
| 81 | + @RequestMapping(value = "/quoteSection" , method = RequestMethod.POST) | |
| 82 | + public Map<String, Object> quoteSection(@RequestParam Map<String, Object> map) { | |
| 83 | + return routeService.quoteSection(map); | |
| 84 | + } | |
| 75 | 85 | } | ... | ... |
src/main/java/com/bsth/controller/StationRouteController.java
| ... | ... | @@ -127,8 +127,17 @@ public class StationRouteController extends BaseController<StationRoute, Integer |
| 127 | 127 | */ |
| 128 | 128 | @RequestMapping(value = "/multiLine", method = RequestMethod.GET) |
| 129 | 129 | public Map<String, Object> findByMultiLine(@RequestParam String lineIds){ |
| 130 | - | |
| 131 | 130 | return service.findByMultiLine(lineIds); |
| 132 | 131 | } |
| 133 | 132 | |
| 133 | + /** | |
| 134 | + * | |
| 135 | + * @Title: updSwitchDir | |
| 136 | + * @Description: TODO(上下行切换) | |
| 137 | + */ | |
| 138 | + @RequestMapping(value = "/updSwitchDir", method = RequestMethod.POST) | |
| 139 | + public Map<String, Object> updSwitchDir(@RequestParam String lineIds){ | |
| 140 | + return service.updSwitchDir(lineIds); | |
| 141 | + } | |
| 142 | + | |
| 134 | 143 | } | ... | ... |
src/main/java/com/bsth/repository/SectionRepository.java
src/main/java/com/bsth/repository/SectionRouteRepository.java
| ... | ... | @@ -28,6 +28,14 @@ import com.bsth.entity.SectionRoute; |
| 28 | 28 | @Repository |
| 29 | 29 | public interface SectionRouteRepository extends BaseRepository<SectionRoute, Integer> { |
| 30 | 30 | |
| 31 | + // 查询最大ID | |
| 32 | + @Query(value = "SELECT IFNULL(num,0) as maxId from (SELECT MAX(id) as num FROM bsth_c_sectionroute) k" , nativeQuery=true) | |
| 33 | + public long sectionRouteMaxId(); | |
| 34 | + | |
| 35 | + // 查询最大ID | |
| 36 | + @Query(value = "SELECT IFNULL(num,0) as maxId from (SELECT MAX(sectionroute_code) as num FROM bsth_c_sectionroute where line_code = 601010 and directions = 1 and destroy = 0) k" , nativeQuery=true) | |
| 37 | + public int sectionRouteCodeMaxId(); | |
| 38 | + | |
| 31 | 39 | /** |
| 32 | 40 | * @Description :TODO(查询路段信息) |
| 33 | 41 | * |
| ... | ... | @@ -162,4 +170,8 @@ public interface SectionRouteRepository extends BaseRepository<SectionRoute, Int |
| 162 | 170 | @Modifying |
| 163 | 171 | @Query(value="UPDATE bsth_c_sectionroute set is_roade_speed = ?1 where line= ?2 and directions=?3 ",nativeQuery = true) |
| 164 | 172 | void isRoadSpeedUpd(Integer isR,Integer line,Integer directions); |
| 173 | + | |
| 174 | + @Modifying | |
| 175 | + @Query(value="update bsth_c_sectionroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true) | |
| 176 | + public void sectionRouteDir(Integer line); | |
| 165 | 177 | } | ... | ... |
src/main/java/com/bsth/repository/StationRouteRepository.java
| ... | ... | @@ -268,4 +268,8 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int |
| 268 | 268 | "ORDER BY " + |
| 269 | 269 | "lineCode,directions,stationRouteCode") |
| 270 | 270 | List<Object[]> findAllLineWithYgc(); |
| 271 | + | |
| 272 | + @Modifying | |
| 273 | + @Query(value="update bsth_c_stationroute set directions = case directions when 1 then 0 when 0 then 1 end where line_code = ?1 ", nativeQuery=true) | |
| 274 | + public void stationRouteDir(Integer line); | |
| 271 | 275 | } | ... | ... |
src/main/java/com/bsth/service/SectionRouteService.java
| ... | ... | @@ -41,4 +41,6 @@ public interface SectionRouteService extends BaseService<SectionRoute, Integer> |
| 41 | 41 | * @return List<Map<String, Object>> |
| 42 | 42 | */ |
| 43 | 43 | List<Map<String, Object>> findUpSectionRouteCode(Map<String, Object> map); |
| 44 | + | |
| 45 | + Map<String, Object> quoteSection(Map<String, Object> map); | |
| 44 | 46 | } | ... | ... |
src/main/java/com/bsth/service/StationRouteService.java
| ... | ... | @@ -79,5 +79,7 @@ public interface StationRouteService extends BaseService<StationRoute, Integer> |
| 79 | 79 | */ |
| 80 | 80 | List<Map<String, Object>> findStationRouteInfo(Map<String, Object> map); |
| 81 | 81 | |
| 82 | - Map<String, Object> findByMultiLine(String lineIds); | |
| 82 | + Map<String, Object> findByMultiLine(String lineIds); | |
| 83 | + | |
| 84 | + Map<String, Object> updSwitchDir(String lineIds); | |
| 83 | 85 | } | ... | ... |
src/main/java/com/bsth/service/impl/SectionRouteServiceImpl.java
| ... | ... | @@ -8,7 +8,12 @@ import java.util.Map; |
| 8 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 9 | import org.springframework.stereotype.Service; |
| 10 | 10 | |
| 11 | +import com.bsth.common.ResponseCode; | |
| 12 | +import com.bsth.entity.Line; | |
| 13 | +import com.bsth.entity.Section; | |
| 11 | 14 | import com.bsth.entity.SectionRoute; |
| 15 | +import com.bsth.repository.LineRepository; | |
| 16 | +import com.bsth.repository.SectionRepository; | |
| 12 | 17 | import com.bsth.repository.SectionRouteRepository; |
| 13 | 18 | import com.bsth.service.SectionRouteService; |
| 14 | 19 | |
| ... | ... | @@ -34,6 +39,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ |
| 34 | 39 | @Autowired |
| 35 | 40 | SectionRouteRepository repository; |
| 36 | 41 | |
| 42 | + @Autowired | |
| 43 | + SectionRepository repository2; | |
| 44 | + | |
| 45 | + @Autowired | |
| 46 | + LineRepository lineRepository; | |
| 47 | + | |
| 37 | 48 | /** |
| 38 | 49 | * @Description :TODO(查询路段信息) |
| 39 | 50 | * |
| ... | ... | @@ -43,21 +54,13 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ |
| 43 | 54 | */ |
| 44 | 55 | @Override |
| 45 | 56 | public List<Map<String, Object>> getSectionRoute(Map<String, Object> map) { |
| 46 | - | |
| 47 | 57 | int lineId = map.get("line.id_eq").equals("") ? 0 : Integer.parseInt(map.get("line.id_eq").toString()); |
| 48 | - | |
| 49 | 58 | int directions = map.get("directions_eq").equals("") ? 0 : Integer.parseInt(map.get("directions_eq").toString()); |
| 50 | - | |
| 51 | 59 | List<Object[]> listObjArray = repository.getSectionRoute(lineId, directions); |
| 52 | - | |
| 53 | 60 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); |
| 54 | - | |
| 55 | 61 | if(listObjArray.size()>0) { |
| 56 | - | |
| 57 | 62 | for(int i = 0 ; i<listObjArray.size() ; i++){ |
| 58 | - | |
| 59 | 63 | Map<String, Object> tempM = new HashMap<String, Object>(); |
| 60 | - | |
| 61 | 64 | tempM.put("sectionrouteId",listObjArray.get(i)[0]); |
| 62 | 65 | tempM.put("sectionrouteLine",listObjArray.get(i)[1]); |
| 63 | 66 | tempM.put("sectionrouteLineCode",listObjArray.get(i)[2]); |
| ... | ... | @@ -81,12 +84,12 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ |
| 81 | 84 | tempM.put("sectionTime",listObjArray.get(i)[20]); |
| 82 | 85 | tempM.put("sectiondbType",listObjArray.get(i)[21]); |
| 83 | 86 | tempM.put("sectionSpeedLimet",listObjArray.get(i)[22]); |
| 87 | + tempM.put("destroy",listObjArray.get(i)[23]); | |
| 88 | + tempM.put("versions",listObjArray.get(i)[24]); | |
| 89 | + tempM.put("descriptions",listObjArray.get(i)[25]); | |
| 84 | 90 | resultList.add(tempM); |
| 85 | - | |
| 86 | 91 | } |
| 87 | - | |
| 88 | 92 | } |
| 89 | - | |
| 90 | 93 | return resultList; |
| 91 | 94 | } |
| 92 | 95 | |
| ... | ... | @@ -228,5 +231,68 @@ public class SectionRouteServiceImpl extends BaseServiceImpl<SectionRoute, Integ |
| 228 | 231 | |
| 229 | 232 | return list; |
| 230 | 233 | } |
| 234 | + | |
| 235 | + @Override | |
| 236 | + public Map<String, Object> quoteSection(Map<String, Object> map) { | |
| 237 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | |
| 238 | + try { | |
| 239 | + Integer line = map.get("lineId") ==null ? null : Integer.parseInt(map.get("lineId").toString()); | |
| 240 | + Integer dir = map.get("dir")==null ? null : Integer.parseInt(map.get("dir").toString()); | |
| 241 | + Integer toDir = map.get("toDir")==null ? null : Integer.parseInt(map.get("toDir").toString()); | |
| 242 | + if(line!=null && dir!=null) { | |
| 243 | + List<Object[]> list = repository.getSectionRoute(line, dir); | |
| 244 | + for(int i = 0 ; i<list.size() ; i++) { | |
| 245 | + int sectionId = Integer.parseInt(String.valueOf(repository2.sectionMaxId())) + 1 ; | |
| 246 | + String sectionCode = String.valueOf(sectionId); | |
| 247 | + String sectionName = list.get(i)[9] == null ? null : list.get(i)[9].toString(); | |
| 248 | + String crosesRoad = list.get(i)[10] == null ? null : list.get(i)[10].toString(); | |
| 249 | + String endNode = list.get(i)[11] == null ? null : list.get(i)[11].toString(); | |
| 250 | + String startNode = list.get(i)[12] == null ? null : list.get(i)[12].toString(); | |
| 251 | + String middleNode = list.get(i)[13] == null ? null : list.get(i)[13].toString(); | |
| 252 | + String sectionType = list.get(i)[14] == null ? null : list.get(i)[14].toString(); | |
| 253 | + String csectionVector = list.get(i)[15] == null ? null : list.get(i)[15].toString(); | |
| 254 | + String bsectionVector = list.get(i)[16] == null ? null : list.get(i)[16].toString(); | |
| 255 | + String gsectionVector = list.get(i)[17] == null ? null : list.get(i)[17].toString(); | |
| 256 | + String roadCoding = list.get(i)[18] == null ? null : list.get(i)[18].toString(); | |
| 257 | + Double sectionDistance = list.get(i)[19] == null ? null : Double.parseDouble(list.get(i)[19].toString()); | |
| 258 | + Double sectionTime = list.get(i)[20] == null ? null : Double.parseDouble(list.get(i)[20].toString()); | |
| 259 | + String dbType = list.get(i)[21] == null ? null : list.get(i)[21].toString(); | |
| 260 | + Double speedLimit = list.get(i)[22] == null ? null : Double.parseDouble(list.get(i)[22].toString()); | |
| 261 | + Integer destroy = list.get(i)[23] == null ? null : Integer.parseInt(list.get(i)[23].toString()); | |
| 262 | + Integer versions = list.get(i)[24] == null ? null : Integer.parseInt(list.get(i)[24].toString()); | |
| 263 | + String descriptions = list.get(i)[25] == null ? null : list.get(i)[25].toString(); | |
| 264 | + repository2.systemSave(sectionCode, | |
| 265 | + sectionName, crosesRoad, endNode, startNode, middleNode, | |
| 266 | + gsectionVector, bsectionVector, | |
| 267 | + sectionType, csectionVector, roadCoding, | |
| 268 | + sectionDistance, sectionTime, dbType, speedLimit, descriptions, versions, sectionId); | |
| 269 | + int sectionRouteId = Integer.parseInt(String.valueOf(repository.sectionRouteMaxId())) + 1 ; | |
| 270 | + SectionRoute sr = new SectionRoute(); | |
| 271 | + Line lineObject = lineRepository.findOne(line); | |
| 272 | + Section section = repository2.findOne(sectionId); | |
| 273 | + int src = repository.sectionRouteCodeMaxId(); | |
| 274 | + src = src == 0 ? list.size() : src - (list.size()-i)*10 ; | |
| 275 | + sr.setId(sectionRouteId); | |
| 276 | + sr.setSectionrouteCode(src); | |
| 277 | + sr.setLineCode(lineObject.getLineCode()); | |
| 278 | + sr.setSectionCode(sectionCode); | |
| 279 | + sr.setDirections(toDir); | |
| 280 | + sr.setVersions(versions); | |
| 281 | + sr.setDestroy(destroy); | |
| 282 | + sr.setLine(lineObject); | |
| 283 | + sr.setSection(section); | |
| 284 | + sr.setSectionCode(section.getSectionCode()); | |
| 285 | + sr.setDescriptions(descriptions); | |
| 286 | + sr.setIsRoadeSpeed(1); | |
| 287 | + repository.save(sr); | |
| 288 | + } | |
| 289 | + } | |
| 290 | + resultMap.put("status", ResponseCode.SUCCESS); | |
| 291 | + } catch (Exception e) { | |
| 292 | + resultMap.put("status", ResponseCode.ERROR); | |
| 293 | + logger.error("save erro.", e); | |
| 294 | + } | |
| 295 | + return resultMap; | |
| 296 | + } | |
| 231 | 297 | |
| 232 | 298 | } | ... | ... |
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
| ... | ... | @@ -17,6 +17,7 @@ import com.bsth.util.db.DBUtils_MS; |
| 17 | 17 | import com.google.common.base.Splitter; |
| 18 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | 19 | import org.springframework.stereotype.Service; |
| 20 | +import org.springframework.transaction.annotation.Transactional; | |
| 20 | 21 | |
| 21 | 22 | import java.io.ByteArrayInputStream; |
| 22 | 23 | import java.io.File; |
| ... | ... | @@ -1080,4 +1081,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ |
| 1080 | 1081 | |
| 1081 | 1082 | return rs; |
| 1082 | 1083 | } |
| 1084 | + | |
| 1085 | + @Override | |
| 1086 | + @Transactional | |
| 1087 | + public Map<String, Object> updSwitchDir(String lineIds) { | |
| 1088 | + Map<String, Object> rs = new HashMap<>(); | |
| 1089 | + try{ | |
| 1090 | + if(lineIds!=null && lineIds !="") { | |
| 1091 | + Integer lineId = Integer.parseInt(lineIds); | |
| 1092 | + // 上行站点切换到下行. | |
| 1093 | + repository.stationRouteDir(lineId); | |
| 1094 | + routeRepository.sectionRouteDir(lineId); | |
| 1095 | + } | |
| 1096 | + rs.put("status", ResponseCode.SUCCESS); | |
| 1097 | + }catch(Exception e){ | |
| 1098 | + logger.error("", e); | |
| 1099 | + rs.put("status", ResponseCode.ERROR); | |
| 1100 | + } | |
| 1101 | + return rs; | |
| 1102 | + } | |
| 1083 | 1103 | } | ... | ... |
src/main/resources/static/pages/base/stationroute/editsection.html
| 1 | 1 | <!-- 编辑路段 --> |
| 2 | 2 | <div class="modal fade" id="edit_section_mobal" tabindex="-1" role="basic" aria-hidden="true"> |
| 3 | - | |
| 4 | 3 | <div class="modal-dialog"> |
| 5 | - | |
| 6 | 4 | <div class="modal-content"> |
| 7 | - | |
| 8 | 5 | <div class="modal-header"> |
| 9 | 6 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> |
| 10 | 7 | <h4 class="modal-title">路段路段</h4> |
| 11 | 8 | </div> |
| 12 | - | |
| 13 | 9 | <div class="modal-body"> |
| 14 | - | |
| 15 | 10 | <form class="form-horizontal" role="form" id="edit_section__form" action="/module" method="post"> |
| 16 | - | |
| 17 | 11 | <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> |
| 18 | 12 | 您的输入有误,请检查下面的输入项 |
| 19 | 13 | </div> |
| 20 | - | |
| 21 | 14 | <!-- 线路ID --> |
| 22 | - | |
| 23 | 15 | <input type="hidden" name="sectionId" id="sectionIdInput"> |
| 24 | - | |
| 25 | 16 | <input type="hidden" name="sectionRouteId" id="sectionRouteIdInput"> |
| 26 | - | |
| 27 | 17 | <input type="hidden" name="sectionRouteLine" id="sectionRouteLineInput"> |
| 28 | - | |
| 29 | 18 | <input type="hidden" name="lineCode" id="lineCodeInput"> |
| 30 | - | |
| 31 | 19 | <input type="hidden" name="bsectionVector" id="bsectionVectorInput" /> |
| 32 | - | |
| 33 | 20 | <input type="hidden" name="csectionVector" id="csectionVectorInput" value=""/> |
| 34 | - | |
| 35 | 21 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> |
| 36 | - | |
| 37 | 22 | <!-- 路段名称 --> |
| 38 | 23 | <div class="form-body"> |
| 39 | 24 | <div class="form-group"> |
| ... | ... | @@ -45,7 +30,6 @@ |
| 45 | 30 | </div> |
| 46 | 31 | </div> |
| 47 | 32 | </div> |
| 48 | - | |
| 49 | 33 | <!-- 路段编码 --> |
| 50 | 34 | <div class="form-body"> |
| 51 | 35 | <div class="form-group"> |
| ... | ... | @@ -57,7 +41,6 @@ |
| 57 | 41 | </div> |
| 58 | 42 | </div> |
| 59 | 43 | </div> |
| 60 | - | |
| 61 | 44 | <!-- 路段序号 --> |
| 62 | 45 | <div class="form-body"> |
| 63 | 46 | <div class="form-group"> |
| ... | ... | @@ -70,24 +53,6 @@ |
| 70 | 53 | </div> |
| 71 | 54 | </div> |
| 72 | 55 | </div> |
| 73 | - | |
| 74 | - <!-- 路段类型 --> | |
| 75 | - <!-- <div class="form-body"> | |
| 76 | - <div class="form-group"> | |
| 77 | - <label class="control-label col-md-3"> | |
| 78 | - <span class="required"> * </span>路段类型: | |
| 79 | - </label> | |
| 80 | - <div class="col-md-6"> | |
| 81 | - <select name="sectionType" class="form-control" id="sectionTypeSelect"> | |
| 82 | - <option value="">-- 请选择路段类型 --</option> | |
| 83 | - <option value="B">起点站</option> | |
| 84 | - <option value="Z">中途站</option> | |
| 85 | - <option value="E">终点站</option> | |
| 86 | - </select> | |
| 87 | - </div> | |
| 88 | - </div> | |
| 89 | - </div> --> | |
| 90 | - | |
| 91 | 56 | <!-- 路段方向 --> |
| 92 | 57 | <div class="form-body"> |
| 93 | 58 | <div class="form-group"> |
| ... | ... | @@ -103,7 +68,6 @@ |
| 103 | 68 | </div> |
| 104 | 69 | </div> |
| 105 | 70 | </div> |
| 106 | - | |
| 107 | 71 | <!-- 道路编码--> |
| 108 | 72 | <div class="form-body"> |
| 109 | 73 | <div class="form-group"> |
| ... | ... | @@ -113,7 +77,6 @@ |
| 113 | 77 | </div> |
| 114 | 78 | </div> |
| 115 | 79 | </div> |
| 116 | - | |
| 117 | 80 | <!-- 路段限速 --> |
| 118 | 81 | <div class="form-body"> |
| 119 | 82 | <div class="form-group"> |
| ... | ... | @@ -125,7 +88,6 @@ |
| 125 | 88 | </div> |
| 126 | 89 | </div> |
| 127 | 90 | </div> |
| 128 | - | |
| 129 | 91 | <!-- 路段时长 --> |
| 130 | 92 | <div class="form-body"> |
| 131 | 93 | <div class="form-group"> |
| ... | ... | @@ -136,7 +98,6 @@ |
| 136 | 98 | </div> |
| 137 | 99 | </div> |
| 138 | 100 | </div> |
| 139 | - | |
| 140 | 101 | <!-- 路段长度 --> |
| 141 | 102 | <div class="form-body"> |
| 142 | 103 | <div class="form-group"> |
| ... | ... | @@ -147,7 +108,6 @@ |
| 147 | 108 | </div> |
| 148 | 109 | </div> |
| 149 | 110 | </div> |
| 150 | - | |
| 151 | 111 | <!-- 版本号 --> |
| 152 | 112 | <div class="form-body"> |
| 153 | 113 | <div class="form-group"> |
| ... | ... | @@ -157,7 +117,6 @@ |
| 157 | 117 | </div> |
| 158 | 118 | </div> |
| 159 | 119 | </div> |
| 160 | - | |
| 161 | 120 | <!-- 范围图形类型 --> |
| 162 | 121 | <div class="form-body"> |
| 163 | 122 | <div class="form-group"> |
| ... | ... | @@ -171,7 +130,6 @@ |
| 171 | 130 | </div> |
| 172 | 131 | </div> |
| 173 | 132 | </div> |
| 174 | - | |
| 175 | 133 | <!-- 描述/说明 --> |
| 176 | 134 | <div class="form-group"> |
| 177 | 135 | <label class="control-label col-md-3"> 描述/说明: </label> |
| ... | ... | @@ -191,99 +149,56 @@ |
| 191 | 149 | <script type="text/javascript"> |
| 192 | 150 | |
| 193 | 151 | $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,section,fun){ |
| 194 | - | |
| 195 | 152 | var Section = section.getEitdSection(); |
| 196 | - | |
| 197 | 153 | fun.setSectionFormValue(Section); |
| 198 | - | |
| 199 | 154 | // 方向 |
| 200 | 155 | var dir = Section.sectionrouteDirections; |
| 201 | - | |
| 202 | 156 | var lineId = Section.sectionrouteLine; |
| 203 | - | |
| 204 | 157 | // 获取路段号元素,并添加下拉属性值 |
| 205 | 158 | ajaxd.getStation(lineId,dir,function(treeData) { |
| 206 | - | |
| 207 | 159 | var options = '<option value="">请选择...</option>'; |
| 208 | - | |
| 209 | 160 | var dArray = treeData[0].children[1].children; |
| 210 | - | |
| 211 | 161 | var eq_stationRouteCode = Section.sectionrouteCode; |
| 212 | - | |
| 213 | 162 | for(var i = 0 ; i<dArray.length; i++){ |
| 214 | - | |
| 215 | 163 | var ptions_v = dArray[i].sectionrouteCode; |
| 216 | - | |
| 217 | 164 | // 排除本站 |
| 218 | - if(eq_stationRouteCode == ptions_v){ | |
| 219 | - | |
| 165 | + if(eq_stationRouteCode == ptions_v) | |
| 220 | 166 | continue; |
| 221 | - | |
| 222 | - } | |
| 223 | - | |
| 224 | 167 | options += '<option value="'+ ptions_v +'">'+dArray[i].sectionName+'</option>' |
| 225 | - | |
| 226 | 168 | } |
| 227 | - | |
| 228 | 169 | $('#sectionrouteCodeSelect').html(options); |
| 229 | - | |
| 230 | 170 | ajaxd.findUpSectionRouteCode(lineId,dir,eq_stationRouteCode,function(str) { |
| 231 | - | |
| 232 | 171 | if(str.length>0){ |
| 233 | - | |
| 234 | 172 | var upStationRouteCode = str[0].sectionrouteCode |
| 235 | - | |
| 236 | 173 | $('#sectionrouteCodeSelect').val(upStationRouteCode); |
| 237 | - | |
| 238 | 174 | } |
| 239 | - | |
| 240 | 175 | }); |
| 241 | - | |
| 242 | 176 | }); |
| 243 | - | |
| 244 | 177 | // 显示mobal |
| 245 | 178 | $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false}); |
| 246 | - | |
| 247 | 179 | // 当调用 hide 实例方法时触发 |
| 248 | 180 | $('#edit_section_mobal').on('hide.bs.modal', function () { |
| 249 | - | |
| 250 | 181 | closeMobleSetClean(); |
| 251 | - | |
| 252 | 182 | }); |
| 253 | - | |
| 254 | 183 | function closeMobleSetClean() { |
| 255 | - | |
| 256 | 184 | // 清除地图覆盖物 |
| 257 | 185 | map_.clearMarkAndOverlays(); |
| 258 | - | |
| 259 | 186 | /** 设置修改路段集合对象为空 */ |
| 260 | 187 | section.setEitdSection({}); |
| 261 | - | |
| 262 | 188 | fun.resjtreeDate(lineId,dir); |
| 263 | - | |
| 264 | 189 | fun.editAChangeCssRemoveDisabled(); |
| 265 | - | |
| 266 | 190 | ajaxd.getSectionRouteInfo(lineId,dir,function(data) { |
| 267 | - | |
| 268 | 191 | fun.linePanlThree(lineId,data,dir); |
| 269 | - | |
| 270 | 192 | }); |
| 271 | - | |
| 272 | 193 | } |
| 273 | - | |
| 274 | 194 | // 编辑表单元素 |
| 275 | 195 | var form = $('#edit_section__form'); |
| 276 | - | |
| 277 | 196 | // 获取错误提示元素 |
| 278 | 197 | var error = $('.alert-danger', form); |
| 279 | - | |
| 280 | 198 | // 提交数据按钮事件 |
| 281 | 199 | $('#editSectionButton').on('click', function() { |
| 282 | - | |
| 283 | - | |
| 284 | 200 | // 表单提交 |
| 285 | 201 | form.submit(); |
| 286 | - | |
| 287 | 202 | }); |
| 288 | 203 | |
| 289 | 204 | // 表单验证 |
| ... | ... | @@ -392,42 +307,23 @@ $('#edit_section_mobal').on('editSectionMobal_show', function(e, map_,ajaxd,sect |
| 392 | 307 | }, |
| 393 | 308 | |
| 394 | 309 | submitHandler : function(f) { |
| 395 | - | |
| 396 | 310 | var params = form.serializeJSON(); |
| 397 | - | |
| 398 | 311 | error.hide(); |
| 399 | - | |
| 400 | - console.log(params); | |
| 401 | - | |
| 402 | 312 | ajaxd.sectionUpdate(params,function(resuntDate) { |
| 403 | - | |
| 404 | 313 | if(resuntDate.status=='SUCCESS') { |
| 405 | - | |
| 406 | 314 | // 弹出添加成功提示消息 |
| 407 | 315 | layer.msg('修改成功...'); |
| 408 | - | |
| 409 | - | |
| 410 | 316 | }else { |
| 411 | - | |
| 412 | 317 | // 弹出添加失败提示消息 |
| 413 | 318 | layer.msg('修改失败...'); |
| 414 | - | |
| 415 | 319 | } |
| 416 | - | |
| 417 | 320 | $('#edit_section_mobal').modal('hide'); |
| 418 | - | |
| 419 | 321 | var dir = params.directions |
| 420 | - | |
| 421 | 322 | // 刷行左边树 |
| 422 | 323 | fun.resjtreeDate(lineId,dir); |
| 423 | - | |
| 424 | 324 | closeMobleSetClean(); |
| 425 | - | |
| 426 | 325 | }); |
| 427 | - | |
| 428 | 326 | } |
| 429 | 327 | }); |
| 430 | - | |
| 431 | - | |
| 432 | 328 | }); |
| 433 | 329 | </script> |
| 434 | 330 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
| ... | ... | @@ -169,13 +169,9 @@ var GetAjaxData = function(){ |
| 169 | 169 | |
| 170 | 170 | // 查询路段信息 |
| 171 | 171 | getSectionRouteInfo : function(lineId,direction,callback) { |
| 172 | - | |
| 173 | 172 | $get('/sectionroute/findSection',{'line.id_eq' : lineId , 'directions_eq' : direction},function(resultdata) { |
| 174 | - | |
| 175 | 173 | callback && callback(resultdata); |
| 176 | - | |
| 177 | 174 | }); |
| 178 | - | |
| 179 | 175 | }, |
| 180 | 176 | |
| 181 | 177 | // 手动规划线路保存 | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
| ... | ... | @@ -22,199 +22,188 @@ $(function(){ |
| 22 | 22 | |
| 23 | 23 | // 上行站点其它规划点击事件 |
| 24 | 24 | $('.upManual').on('click',function() { |
| 25 | - | |
| 26 | 25 | // 加载其它规划选择弹出层mobal页面 |
| 27 | 26 | $.get('add_manual_select.html', function(m){ |
| 28 | - | |
| 29 | 27 | $(pjaxContainer).append(m); |
| 30 | - | |
| 31 | 28 | $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionUpValue,LineObj,PublicFunctions]); |
| 32 | - | |
| 33 | 29 | }); |
| 34 | 30 | |
| 35 | 31 | }); |
| 36 | 32 | |
| 37 | 33 | // 上行站点新增事件 |
| 38 | 34 | $('.module_tools #addUpStation').on('click', function() { |
| 39 | - | |
| 40 | 35 | /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */ |
| 41 | 36 | AddStationObj.setAddStationDiraction(directionUpValue); |
| 42 | - | |
| 43 | 37 | // 加载选择新增方式mobal |
| 44 | 38 | $.get('add_select.html', function(m){ |
| 45 | - | |
| 46 | 39 | $(pjaxContainer).append(m); |
| 47 | - | |
| 48 | 40 | $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]); |
| 49 | - | |
| 50 | 41 | }); |
| 51 | - | |
| 52 | 42 | }); |
| 53 | 43 | |
| 54 | 44 | // 修改上行站点mobal页面 |
| 55 | 45 | $('.module_tools #editUpStation').on('click', function(){ |
| 56 | - | |
| 57 | 46 | var sel = PublicFunctions.getCurrSelNode(directionUpValue); |
| 58 | - | |
| 59 | 47 | if(sel.length==0 || sel[0].original.chaildredType !='station'){ |
| 60 | - | |
| 61 | 48 | layer.msg('请先选择要编辑的上行站点!'); |
| 62 | - | |
| 63 | 49 | return; |
| 64 | 50 | } |
| 65 | - | |
| 66 | 51 | $.get('edit_select.html', function(m){ |
| 67 | - | |
| 68 | 52 | $(pjaxContainer).append(m); |
| 69 | - | |
| 70 | 53 | $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionUpValue]); |
| 71 | 54 | }); |
| 72 | - | |
| 73 | 55 | }); |
| 74 | 56 | |
| 75 | 57 | // 撤销上行站点 |
| 76 | 58 | $('.module_tools #deleteUpStation').on('click', function() { |
| 77 | - | |
| 78 | 59 | PublicFunctions.stationRevoke(directionUpValue); |
| 79 | - | |
| 80 | 60 | }); |
| 81 | 61 | |
| 82 | - // 编辑线路上行走向 | |
| 83 | - $('.module_tools #editUplineTrend').on('click', function() { | |
| 84 | - | |
| 85 | - PublicFunctions.editLinePlan(directionUpValue); | |
| 86 | - | |
| 62 | + // 切换上下行. | |
| 63 | + $('.retweet').on('click',function() { | |
| 64 | + layer.confirm('您是否确定将【上、下】行站点和路段进行对换!', { | |
| 65 | + btn : [ '确认提示并提交', '取消' ] | |
| 66 | + },function () { | |
| 67 | + // 关闭所有提示弹出层. | |
| 68 | + layer.closeAll(); | |
| 69 | + // 弹出提示层. | |
| 70 | + var index = layer.load(1, { | |
| 71 | + shade: [0.1,'#fff'] // 透明度的白色背景 | |
| 72 | + }); | |
| 73 | + var Line = LineObj.getLineObj(); | |
| 74 | + $post('/stationroute/updSwitchDir?lineIds='+ Line.id,null,function(data) { | |
| 75 | + layer.close(index); | |
| 76 | + if(data.status=='SUCCESS') { | |
| 77 | + // 弹出添加成功提示消息 | |
| 78 | + layer.msg('操作成功...'); | |
| 79 | + }else { | |
| 80 | + // 弹出添加失败提示消息 | |
| 81 | + layer.msg('操作成功...'); | |
| 82 | + } | |
| 83 | + WorldsBMap.clearMarkAndOverlays(); | |
| 84 | + // 刷新左边树 | |
| 85 | + PublicFunctions.resjtreeDate(Line.id,0); | |
| 86 | + PublicFunctions.resjtreeDate(Line.id,1); | |
| 87 | + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | |
| 88 | + GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) { | |
| 89 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | |
| 90 | + PublicFunctions.linePanlThree(Line.id,data,0); | |
| 91 | + }); | |
| 92 | + }); | |
| 93 | + }); | |
| 87 | 94 | }); |
| 88 | 95 | |
| 96 | + $('#quoteUp').on('click',function() { | |
| 97 | + // 弹出提示层. | |
| 98 | + var index = layer.load(1, { | |
| 99 | + shade: [0.1,'#fff'] // 透明度的白色背景 | |
| 100 | + }); | |
| 101 | + var Line = LineObj.getLineObj(); | |
| 102 | + $post('/sectionroute/quoteSection',{'lineId':Line.id ,'dir':0,'toDir':1} ,function(data) { | |
| 103 | + layer.close(index); | |
| 104 | + if(data.status=='SUCCESS') { | |
| 105 | + // 弹出添加成功提示消息 | |
| 106 | + layer.msg('操作成功...'); | |
| 107 | + }else { | |
| 108 | + // 弹出添加失败提示消息 | |
| 109 | + layer.msg('操作成功...'); | |
| 110 | + } | |
| 111 | + WorldsBMap.clearMarkAndOverlays(); | |
| 112 | + // 刷新左边树 | |
| 113 | + PublicFunctions.resjtreeDate(Line.id,0); | |
| 114 | + PublicFunctions.resjtreeDate(Line.id,1); | |
| 115 | + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | |
| 116 | + GetAjaxData.getSectionRouteInfo(Line.id,0,function(data) { | |
| 117 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | |
| 118 | + PublicFunctions.linePanlThree(Line.id,data,0); | |
| 119 | + }); | |
| 120 | + }); | |
| 121 | + }); | |
| 122 | + | |
| 123 | + // 编辑线路上行走向 | |
| 124 | + $('.module_tools #editUplineTrend').on('click', function() {PublicFunctions.editLinePlan(directionUpValue);}); | |
| 125 | + | |
| 89 | 126 | // 线路上行 |
| 90 | 127 | $('#leftUpOrDown #upLine').on('click', function(){ |
| 91 | - | |
| 92 | 128 | var lineIdEvents = LineObj.getLineObj(); |
| 93 | - | |
| 94 | 129 | GetAjaxData.getSectionRouteInfo(lineIdEvents.id,directionUpValue,function(data) { |
| 95 | - | |
| 96 | 130 | PublicFunctions.linePanlThree(lineIdEvents.id,data,directionUpValue); |
| 97 | - | |
| 98 | 131 | }); |
| 99 | - | |
| 100 | 132 | }); |
| 101 | 133 | |
| 102 | 134 | // 系统规划下行站点 |
| 103 | 135 | $('.downSystem').on('click',function() { |
| 104 | - | |
| 105 | 136 | // 隐藏下行规划 |
| 106 | 137 | $('#downToolsMobal').hide(); |
| 107 | - | |
| 108 | 138 | // 弹出正在加载层 |
| 109 | 139 | var i = layer.load(0,{offset:['200px', '280px']}); |
| 110 | - | |
| 111 | 140 | /** 修正线路名称 @param:<directionUpValue:方向(上行)> */ |
| 112 | 141 | PublicFunctions.lineNameIsHaveInterval(directionDownValue); |
| 113 | - | |
| 114 | 142 | }); |
| 115 | 143 | |
| 116 | 144 | // 下行站点其它规划点击事件 |
| 117 | 145 | $('.downManual').on('click',function() { |
| 118 | - | |
| 119 | 146 | // 加载其它规划选择弹出层mobal页面 |
| 120 | 147 | $.get('add_manual_select.html', function(m){ |
| 121 | - | |
| 122 | 148 | $(pjaxContainer).append(m); |
| 123 | - | |
| 124 | 149 | $('#add_manual_mobal').trigger('AddManualMobal.show', [WorldsBMap,GetAjaxData,directionDownValue,LineObj,PublicFunctions]); |
| 125 | - | |
| 126 | 150 | }); |
| 127 | - | |
| 128 | 151 | }); |
| 129 | 152 | |
| 130 | 153 | // 下行站点新增事件 |
| 131 | 154 | $('.module_tools #addDownStation').on('click', function() { |
| 132 | - | |
| 133 | 155 | /** 设置新增站点对象方向属性值 @param:<directionUpValue:方向(0:上行;1:下行)> */ |
| 134 | 156 | AddStationObj.setAddStationDiraction(directionDownValue); |
| 135 | - | |
| 136 | 157 | // 加载选择新增方式mobal |
| 137 | 158 | $.get('add_select.html', function(m){ |
| 138 | - | |
| 139 | 159 | $(pjaxContainer).append(m); |
| 140 | - | |
| 141 | 160 | $('#add_select_mobal').trigger('AddSelectMobal.show', [WorldsBMap,DrawingManagerObj,GetAjaxData,AddStationObj,LineObj,PublicFunctions]); |
| 142 | - | |
| 143 | 161 | }); |
| 144 | - | |
| 145 | 162 | }); |
| 146 | 163 | |
| 147 | 164 | // 修改下行站点mobal页面 |
| 148 | 165 | $('.module_tools #editDownStation').on('click', function(){ |
| 149 | - | |
| 150 | 166 | var sel = PublicFunctions.getCurrSelNode(directionDownValue); |
| 151 | - | |
| 152 | 167 | if(sel.length==0 || sel[0].original.chaildredType !='station'){ |
| 153 | - | |
| 154 | 168 | layer.msg('请先选择要编辑的下行站点!'); |
| 155 | - | |
| 156 | 169 | return; |
| 157 | 170 | } |
| 158 | - | |
| 159 | 171 | $.get('edit_select.html', function(m){ |
| 160 | - | |
| 161 | 172 | $(pjaxContainer).append(m); |
| 162 | - | |
| 163 | 173 | $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap,DrawingManagerObj,GetAjaxData,EditStationObj,LineObj,PublicFunctions,directionDownValue]); |
| 164 | 174 | }); |
| 165 | - | |
| 166 | 175 | }); |
| 167 | 176 | |
| 168 | 177 | // 撤销下行站点 |
| 169 | 178 | $('.module_tools #deleteDownStation').on('click', function() { |
| 170 | - | |
| 171 | 179 | PublicFunctions.stationRevoke(directionDownValue); |
| 172 | - | |
| 173 | 180 | }); |
| 174 | 181 | |
| 175 | 182 | // 编辑线路下行走向 |
| 176 | 183 | $('.module_tools #editDownlineTrend').on('click', function() { |
| 177 | - | |
| 178 | 184 | PublicFunctions.editLinePlan(directionDownValue); |
| 179 | - | |
| 180 | 185 | }); |
| 181 | 186 | |
| 182 | 187 | // 线路下行 |
| 183 | 188 | $('#leftUpOrDown #downLine').on('click', function(){ |
| 184 | - | |
| 185 | 189 | var lineIdEvents = LineObj.getLineObj(); |
| 186 | - | |
| 187 | 190 | GetAjaxData.getSectionRouteInfo(lineIdEvents.id,directionDownValue,function(data) { |
| 188 | - | |
| 189 | 191 | PublicFunctions.linePanlThree(lineIdEvents.id,data,directionDownValue); |
| 190 | - | |
| 191 | 192 | }); |
| 192 | - | |
| 193 | 193 | }); |
| 194 | 194 | |
| 195 | 195 | // 生成行单 |
| 196 | 196 | $('.module_tools #createUsingSingle').on('click', function() { |
| 197 | - | |
| 198 | 197 | var lineIdEvents = LineObj.getLineObj(); |
| 199 | - | |
| 200 | 198 | var params = {lineId:lineIdEvents.id}; |
| 201 | - | |
| 202 | 199 | GetAjaxData.createUsingSingle(params,function(data) { |
| 203 | - | |
| 204 | 200 | if(data.status=='SUCCESS') { |
| 205 | - | |
| 206 | 201 | // 弹出添加成功提示消息 |
| 207 | 202 | layer.msg('生成成功...'); |
| 208 | - | |
| 209 | 203 | }else { |
| 210 | - | |
| 211 | 204 | // 弹出添加失败提示消息 |
| 212 | 205 | layer.msg('生成失败...'); |
| 213 | - | |
| 214 | 206 | } |
| 215 | - | |
| 216 | 207 | }); |
| 217 | - | |
| 218 | 208 | }); |
| 219 | - | |
| 220 | 209 | }); |
| 221 | 210 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
| ... | ... | @@ -478,7 +478,6 @@ var PublicFunctions = function () { |
| 478 | 478 | $('#upLine').addClass('btn disabled'); |
| 479 | 479 | |
| 480 | 480 | var editSectionV = sel[0].original; |
| 481 | - | |
| 482 | 481 | EditSectionObj.setEitdSection(editSectionV); |
| 483 | 482 | |
| 484 | 483 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) |
| ... | ... | @@ -634,80 +633,53 @@ var PublicFunctions = function () { |
| 634 | 633 | |
| 635 | 634 | /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ |
| 636 | 635 | linePanlThree : function(lineId,data,direction) { |
| 637 | - | |
| 638 | 636 | /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ |
| 639 | 637 | GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) { |
| 640 | - | |
| 641 | 638 | WorldsBMap.clearMarkAndOverlays(); |
| 642 | - | |
| 643 | 639 | var polyline_center; |
| 644 | - | |
| 645 | 640 | // 如果站点路由数据不为空 |
| 646 | 641 | if(resultdata.length>0) { |
| 647 | - | |
| 648 | 642 | var ceter_index = Math.round(resultdata.length / 2); |
| 649 | - | |
| 650 | 643 | var ceterPointsStr = resultdata[ceter_index].bJwpoints; |
| 651 | - | |
| 652 | 644 | var ceterPointsArray = ceterPointsStr.split(' '); |
| 653 | - | |
| 654 | 645 | polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]); |
| 655 | - | |
| 656 | 646 | // 遍历站点路由数据 |
| 657 | 647 | for(var s = 0 ; s<resultdata.length;s++) { |
| 658 | - | |
| 659 | 648 | // 中心点坐标字符串 |
| 660 | 649 | var bJwpointsStr = resultdata[s].bJwpoints; |
| 661 | - | |
| 662 | 650 | var stationName = resultdata[s].stationName; |
| 663 | - | |
| 664 | 651 | // 起个中心点坐标字符串 |
| 665 | 652 | var bJwpointsArray = bJwpointsStr.split(' '); |
| 666 | - | |
| 667 | 653 | // 设置中心点 |
| 668 | 654 | var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); |
| 669 | - | |
| 670 | 655 | /** 在地图上画点 @param:<point_center:中心坐标点> */ |
| 671 | 656 | WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1); |
| 672 | - | |
| 673 | 657 | } |
| 674 | 658 | |
| 675 | 659 | } |
| 676 | - | |
| 677 | 660 | // 路段数据长度 |
| 678 | 661 | var dataLen = data.length; |
| 679 | 662 | //debugger; |
| 680 | 663 | // 如果大于零 |
| 681 | 664 | if(dataLen>0) { |
| 682 | - | |
| 683 | 665 | // 编辑路段数据 |
| 684 | 666 | for(var d= 0; d<dataLen;d++){ |
| 685 | - | |
| 686 | 667 | // 地图折线坐标点集合 |
| 687 | 668 | var polylineArray = []; |
| 688 | - | |
| 689 | 669 | // 获取路段折线坐标字符串 |
| 690 | 670 | var sectionBsectionVectorStr = data[d].sectionBsectionVector; |
| 691 | - | |
| 692 | - if(sectionBsectionVectorStr==null) { | |
| 693 | - | |
| 671 | + if(sectionBsectionVectorStr==null) | |
| 694 | 672 | continue; |
| 695 | - | |
| 696 | - } | |
| 697 | - | |
| 698 | 673 | // 切割段折线坐标字符串 |
| 699 | 674 | var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); |
| 700 | - | |
| 701 | 675 | // 分割折线坐标字符串 |
| 702 | 676 | var lineArray = tempStr.split(','); |
| 703 | - | |
| 704 | 677 | for(var i = 0;i<lineArray.length;i++) { |
| 705 | - | |
| 706 | 678 | polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); |
| 707 | - | |
| 708 | 679 | } |
| 709 | 680 | /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ |
| 710 | - WorldsBMap.drawingUpline(polylineArray,polyline_center); | |
| 681 | + /*WorldsBMap.drawingUpline(polylineArray,polyline_center,data[d]);*/ | |
| 682 | + WorldsBMap.drawingUpline01(polylineArray,polyline_center,data[d]); | |
| 711 | 683 | |
| 712 | 684 | } |
| 713 | 685 | } |
| ... | ... | @@ -748,48 +720,27 @@ var PublicFunctions = function () { |
| 748 | 720 | |
| 749 | 721 | // 下行 |
| 750 | 722 | }else if(diraction ==1) { |
| 751 | - | |
| 752 | 723 | /** 出事画下行树 @param:<treeDateJson:树数据结构> */ |
| 753 | 724 | StationTreeData.downInit(treeDateJson); |
| 754 | - | |
| 755 | 725 | if(len>0) { |
| 756 | - | |
| 757 | 726 | $('#downToolsMobal').hide(); |
| 758 | - | |
| 759 | 727 | $('#DowntreeMobal').show(); |
| 760 | - | |
| 761 | 728 | }else { |
| 762 | - | |
| 763 | 729 | $('#downToolsMobal').show(); |
| 764 | - | |
| 765 | 730 | $('#DowntreeMobal').hide(); |
| 766 | - | |
| 767 | 731 | } |
| 768 | - | |
| 769 | 732 | } |
| 770 | - | |
| 771 | 733 | }); |
| 772 | - | |
| 773 | 734 | }, |
| 774 | - | |
| 775 | 735 | isHaveStationName : function(data) { |
| 776 | - | |
| 777 | 736 | if(data.length>0) { |
| 778 | - | |
| 779 | 737 | layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ |
| 780 | - | |
| 781 | 738 | layer.close(index); |
| 782 | - | |
| 783 | 739 | }); |
| 784 | - | |
| 785 | 740 | return false; |
| 786 | - | |
| 787 | 741 | }else { |
| 788 | - | |
| 789 | 742 | return true; |
| 790 | - | |
| 791 | 743 | } |
| 792 | - | |
| 793 | 744 | }, |
| 794 | 745 | |
| 795 | 746 | editAChangeCssRemoveDisabled : function() { | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
| ... | ... | @@ -339,40 +339,26 @@ var WorldsBMap = function () { |
| 339 | 339 | }, |
| 340 | 340 | |
| 341 | 341 | editPolyUpline : function() { |
| 342 | - | |
| 343 | 342 | // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) |
| 344 | 343 | polyUpline.disableMassClear(); |
| 345 | - | |
| 346 | 344 | WorldsBMap.clearMarkAndOverlays(); |
| 347 | - | |
| 348 | 345 | // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) |
| 349 | 346 | polyUpline.enableMassClear(); |
| 350 | - | |
| 351 | 347 | // 开启线路编辑 |
| 352 | 348 | polyUpline.enableEditing(); |
| 353 | - | |
| 354 | 349 | // 添加双击折线保存事件 |
| 355 | 350 | polyUpline.addEventListener('dblclick',function(e) { |
| 356 | - | |
| 357 | 351 | // 关闭 |
| 358 | 352 | layer.closeAll(); |
| 359 | - | |
| 360 | 353 | polyUpline.disableEditing(); |
| 361 | - | |
| 362 | 354 | // 获取折线坐标集合 |
| 363 | 355 | var editPloyLineArray = polyUpline.getPath(); |
| 364 | - | |
| 365 | 356 | EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); |
| 366 | - | |
| 367 | 357 | polyUpline= ''; |
| 368 | - | |
| 369 | 358 | // 加载修改路段弹出层mobal页面 |
| 370 | 359 | $.get('editsection.html', function(m){ |
| 371 | - | |
| 372 | 360 | $(pjaxContainer).append(m); |
| 373 | - | |
| 374 | 361 | $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]); |
| 375 | - | |
| 376 | 362 | }); |
| 377 | 363 | }); |
| 378 | 364 | }, |
| ... | ... | @@ -651,17 +637,14 @@ var WorldsBMap = function () { |
| 651 | 637 | }, |
| 652 | 638 | |
| 653 | 639 | // 在地图上画出上行线路走向 |
| 654 | - drawingUpline : function (polylineArray,polyline_center) { | |
| 655 | - | |
| 640 | + drawingUpline : function (polylineArray,polyline_center,data) { | |
| 656 | 641 | /*WorldsBMap.clearMarkAndOverlays();*/ |
| 657 | 642 | polyUpline = ''; |
| 658 | - | |
| 659 | 643 | // 创建线路走向 |
| 660 | 644 | polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); |
| 661 | - | |
| 645 | + // polyUpline.data = data; | |
| 662 | 646 | // 把折线添加到地图上 |
| 663 | 647 | mapBValue.addOverlay(polyUpline); |
| 664 | - | |
| 665 | 648 | /*var ceter_index = Math.round(resultdata.length / 2); |
| 666 | 649 | |
| 667 | 650 | var ceterPointsStr = resultdata[ceter_index].bJwpoints; |
| ... | ... | @@ -669,17 +652,46 @@ var WorldsBMap = function () { |
| 669 | 652 | var ceterPointsArray = ceterPointsStr.split(' '); |
| 670 | 653 | |
| 671 | 654 | var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*/ |
| 672 | - | |
| 673 | 655 | var PanOptions_ ={noAnimation :true}; |
| 674 | - | |
| 675 | 656 | mapBValue.reset(); |
| 676 | - | |
| 677 | 657 | mapBValue.panTo(polyline_center,PanOptions_); |
| 678 | - | |
| 679 | 658 | mapBValue.panBy(500,-510,PanOptions_); |
| 680 | - | |
| 681 | 659 | mapBValue.setZoom(14); |
| 682 | - | |
| 660 | + }, | |
| 661 | + | |
| 662 | + | |
| 663 | + // 在地图上画出上行线路走向 | |
| 664 | + drawingUpline01 : function (polylineArray,polyline_center,data) { | |
| 665 | + var polyUpline01 = 'polyline' + '_' + data.sectionrouteId; | |
| 666 | + // 创建线路走向 | |
| 667 | + polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | |
| 668 | + polyUpline01.data = data; | |
| 669 | + // 把折线添加到地图上 | |
| 670 | + mapBValue.addOverlay(polyUpline01); | |
| 671 | + polyUpline01.addEventListener('click',function(e) { | |
| 672 | + polyUpline01.enableEditing(); | |
| 673 | + }); | |
| 674 | + // 添加双击折线保存事件 | |
| 675 | + polyUpline01.addEventListener('dblclick',function(e) { | |
| 676 | + // 关闭 | |
| 677 | + layer.closeAll(); | |
| 678 | + polyUpline01.disableEditing(); | |
| 679 | + EditSectionObj.setEitdSection(polyUpline01.data); | |
| 680 | + // 获取折线坐标集合 | |
| 681 | + var editPloyLineArray = polyUpline01.getPath(); | |
| 682 | + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | |
| 683 | + // polyUpline= ''; | |
| 684 | + // 加载修改路段弹出层mobal页面 | |
| 685 | + $.get('editsection.html', function(m){ | |
| 686 | + $(pjaxContainer).append(m); | |
| 687 | + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]); | |
| 688 | + }); | |
| 689 | + }); | |
| 690 | + var PanOptions_ ={noAnimation :true}; | |
| 691 | + mapBValue.reset(); | |
| 692 | + mapBValue.panTo(polyline_center,PanOptions_); | |
| 693 | + mapBValue.panBy(500,-510,PanOptions_); | |
| 694 | + mapBValue.setZoom(14); | |
| 683 | 695 | }, |
| 684 | 696 | |
| 685 | 697 | /** 在地图上画点 @param:<point_center:中心坐标点> */ | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-reload.js
| ... | ... | @@ -7,38 +7,18 @@ |
| 7 | 7 | $(function(){ |
| 8 | 8 | |
| 9 | 9 | // 关闭左侧栏 |
| 10 | - if (!$('body').hasClass('page-sidebar-closed')) { | |
| 11 | - | |
| 12 | - $('.menu-toggler.sidebar-toggler').click(); | |
| 13 | - | |
| 14 | - } | |
| 15 | - | |
| 10 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | |
| 16 | 11 | // 获取参数线路ID |
| 17 | 12 | var id = $.url().param('no'); |
| 18 | - | |
| 19 | 13 | // 如果线路ID不为空 |
| 20 | 14 | if(id) { |
| 21 | - | |
| 22 | 15 | var styleOptions = { |
| 23 | - | |
| 24 | - //边线颜色。 | |
| 25 | - strokeColor : "blue", | |
| 26 | - | |
| 27 | - //填充颜色。当参数为空时,圆形将没有填充效果。 | |
| 28 | - fillColor : "blue", | |
| 29 | - | |
| 30 | - //边线的宽度,以像素为单位。 | |
| 31 | - strokeWeight : 3, | |
| 32 | - | |
| 33 | - //边线透明度,取值范围0 - 1。 | |
| 34 | - strokeOpacity : 0.8, | |
| 35 | - | |
| 36 | - //填充的透明度,取值范围0 - 1。 | |
| 37 | - fillOpacity : 0.6, | |
| 38 | - | |
| 39 | - //边线的样式,solid或dashed。 | |
| 40 | - strokeStyle : 'solid' | |
| 41 | - | |
| 16 | + strokeColor : "blue",//边线颜色。 | |
| 17 | + fillColor : "blue",//填充颜色。当参数为空时,圆形将没有填充效果。 | |
| 18 | + strokeWeight : 3,//边线的宽度,以像素为单位。 | |
| 19 | + strokeOpacity : 0.8,//边线透明度,取值范围0 - 1。 | |
| 20 | + fillOpacity : 0.6,//填充的透明度,取值范围0 - 1。 | |
| 21 | + strokeStyle : 'solid' //边线的样式,solid或dashed。 | |
| 42 | 22 | }; |
| 43 | 23 | |
| 44 | 24 | // 等候500毫秒执行 | ... | ... |
src/main/resources/static/pages/base/stationroute/list.html
| 1 | 1 | <link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" /> |
| 2 | - | |
| 3 | 2 | <div class="portlet-body"> |
| 4 | - | |
| 5 | 3 | <!-- 地图 --> |
| 6 | 4 | <div id="bmap_basic" class="bmaps"></div> |
| 7 | - | |
| 8 | - | |
| 9 | 5 | <div class="portlet box protlet-box" style="top:20px"> |
| 10 | - | |
| 11 | 6 | <!-- 左边标题栏 --> |
| 12 | 7 | <div class="portlet-title" style="background-color:#3B3F51"> |
| 13 | 8 | <div class="caption"> |
| ... | ... | @@ -17,13 +12,9 @@ |
| 17 | 12 | <a href="javascript:;" class="collapse" data-original-title="" title=""> </a> |
| 18 | 13 | </div> |
| 19 | 14 | </div> |
| 20 | - | |
| 21 | - | |
| 22 | 15 | <!-- 左边栏 --> |
| 23 | 16 | <div class="portlet-body" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 200px;"> |
| 24 | - | |
| 25 | 17 | <div class="row"> |
| 26 | - | |
| 27 | 18 | <!-- 上下行栏 --> |
| 28 | 19 | <div class="col-md-3 col-sm-3 col-xs-3"> |
| 29 | 20 | <ul class="nav nav-tabs tabs-left" id="leftUpOrDown"> |
| ... | ... | @@ -35,13 +26,10 @@ |
| 35 | 26 | </li> |
| 36 | 27 | </ul> |
| 37 | 28 | </div> |
| 38 | - | |
| 39 | 29 | <div class="col-md-9 col-sm-9 col-xs-9"> |
| 40 | 30 | <div class="tab-content"> |
| 41 | - | |
| 42 | 31 | <!-- 左边栏上行 --> |
| 43 | 32 | <div class="tab-pane active in" id="stationUp" data-direction="0"> |
| 44 | - | |
| 45 | 33 | <div class="portlet-body" id="uptreeMobal" style="display: none"> |
| 46 | 34 | <div class="table-toolbar"> |
| 47 | 35 | <div class="row"> |
| ... | ... | @@ -71,8 +59,15 @@ |
| 71 | 59 | </li> |
| 72 | 60 | <li class="divider"> </li> |
| 73 | 61 | <li> |
| 74 | - <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a> | |
| 62 | + <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a> | |
| 63 | + </li> | |
| 64 | + <li class="divider"> </li> | |
| 65 | + <li> | |
| 66 | + <a href="javascript:;" id="quoteDown"><i class="fa fa-long-arrow-down"></i> 引用下行路段</a> | |
| 75 | 67 | </li> |
| 68 | + <!-- <li> | |
| 69 | + <a href="javascript:;" id="editUplineTrend"><i class="fa fa-edit"></i> 编辑走向</a> | |
| 70 | + </li> --> | |
| 76 | 71 | <!-- <li> |
| 77 | 72 | <a href="javascript:;" id="createUsingSingle"><i class="fa fa-edit"></i> 生成行单</a> |
| 78 | 73 | </li> --> |
| ... | ... | @@ -88,7 +83,6 @@ |
| 88 | 83 | <div id="station_Up_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div> |
| 89 | 84 | </div> |
| 90 | 85 | </div> |
| 91 | - | |
| 92 | 86 | <!-- 无上行站点添加方式 --> |
| 93 | 87 | <div id="upToolsMobal" class="portlet-body" style="display:none"> |
| 94 | 88 | <div class="row"> |
| ... | ... | @@ -156,8 +150,15 @@ |
| 156 | 150 | </li> |
| 157 | 151 | <li class="divider"> </li> |
| 158 | 152 | <li> |
| 159 | - <a href="javascript:;" id="editDownlineTrend"><i class="fa fa-close"></i> 编辑走向</a> | |
| 153 | + <a href="javascript:;" class="retweet"><i class="fa fa-retweet"></i> 切换上下行</a> | |
| 154 | + </li> | |
| 155 | + <li class="divider"> </li> | |
| 156 | + <li> | |
| 157 | + <a href="javascript:;" id="quoteUp"><i class="fa fa-long-arrow-up"></i> 引用上行路段</a> | |
| 160 | 158 | </li> |
| 159 | + <!-- <li> | |
| 160 | + <a href="javascript:;" id="editDownlineTrend"><i class="fa fa-close"></i> 编辑走向</a> | |
| 161 | + </li> --> | |
| 161 | 162 | </ul> |
| 162 | 163 | </div> |
| 163 | 164 | </div> |
| ... | ... | @@ -170,7 +171,6 @@ |
| 170 | 171 | <div id="station_Down_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div> |
| 171 | 172 | </div> |
| 172 | 173 | </div> |
| 173 | - | |
| 174 | 174 | <!-- 无上行站点添加方式 --> |
| 175 | 175 | <div id="downToolsMobal" class="portlet-body" style="display:none"> |
| 176 | 176 | <div class="row"> |
| ... | ... | @@ -213,33 +213,23 @@ |
| 213 | 213 | </div> |
| 214 | 214 | <!-- 线路类 --> |
| 215 | 215 | <script src="/pages/base/stationroute/js/line.js"></script> |
| 216 | - | |
| 217 | 216 | <!-- 新增站点对象类 --> |
| 218 | 217 | <script src="/pages/base/stationroute/js/addstationobj.js"></script> |
| 219 | - | |
| 220 | 218 | <!-- 修改站点对象类 --> |
| 221 | 219 | <script src="/pages/base/stationroute/js/editstationobj.js"></script> |
| 222 | - | |
| 223 | 220 | <!-- 修改路段对象类 --> |
| 224 | 221 | <script src="/pages/base/stationroute/js/editsection.js"></script> |
| 225 | - | |
| 226 | 222 | <!-- 绘图类 --> |
| 227 | 223 | <script src="/pages/base/stationroute/js/drawingManager.js"></script> |
| 228 | - | |
| 229 | 224 | <!-- 地图类 --> |
| 230 | 225 | <script src="/pages/base/stationroute/js/stationroute-list-map.js"></script> |
| 231 | - | |
| 232 | 226 | <!-- 函数与方法 --> |
| 233 | 227 | <script src="/pages/base/stationroute/js/stationroute-list-function.js"></script> |
| 234 | - | |
| 235 | 228 | <!-- ajax请求类 --> |
| 236 | 229 | <script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> |
| 237 | - | |
| 238 | 230 | <!-- 树对类 --> |
| 239 | 231 | <script src="/pages/base/stationroute/js/stationroute-list-treedata.js"></script> |
| 240 | - | |
| 241 | 232 | <!-- reload事件 --> |
| 242 | 233 | <script src="/pages/base/stationroute/js/stationroute-list-reload.js"></script> |
| 243 | - | |
| 244 | 234 | <!-- 事件监听 --> |
| 245 | 235 | <script src="/pages/base/stationroute/js/stationroute-list-events.js"></script> |
| 246 | 236 | \ No newline at end of file | ... | ... |