Commit e3975088c8784b2e0ce0b05c1aa2ac15685e5a75
1 parent
bd209a0e
1.一阶段
Showing
11 changed files
with
120 additions
and
105 deletions
src/main/java/com/bsth/controller/LsStationRouteController.java
| ... | ... | @@ -75,12 +75,26 @@ public class LsStationRouteController extends BaseController<LsStationRoute, Int |
| 75 | 75 | return result; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - @RequestMapping(method = RequestMethod.POST) | |
| 79 | - @Override | |
| 80 | - public Map<String, Object> save(LsStationRoute stationRoute) { | |
| 78 | + @RequestMapping(value = "/add", method = RequestMethod.POST) | |
| 79 | + public Map<String, Object> add(LsStationRoute stationRoute) { | |
| 81 | 80 | Map<String, Object> result = new HashMap<>(); |
| 82 | 81 | try { |
| 83 | - lsStationRouteService.save(stationRoute); | |
| 82 | + lsStationRouteService.add(stationRoute); | |
| 83 | + result.put("status", ResponseCode.SUCCESS); | |
| 84 | + } catch (Exception e) { | |
| 85 | + result.put("status", ResponseCode.ERROR); | |
| 86 | + result.put("msg", e.getMessage()); | |
| 87 | + log.error("", e); | |
| 88 | + } | |
| 89 | + | |
| 90 | + return result; | |
| 91 | + } | |
| 92 | + | |
| 93 | + @RequestMapping(value = "/modify", method = RequestMethod.POST) | |
| 94 | + public Map<String, Object> modify(LsStationRoute stationRoute) { | |
| 95 | + Map<String, Object> result = new HashMap<>(); | |
| 96 | + try { | |
| 97 | + lsStationRouteService.modify(stationRoute); | |
| 84 | 98 | result.put("status", ResponseCode.SUCCESS); |
| 85 | 99 | } catch (Exception e) { |
| 86 | 100 | result.put("status", ResponseCode.ERROR); | ... | ... |
src/main/java/com/bsth/service/LsStationRouteService.java
| ... | ... | @@ -22,4 +22,16 @@ public interface LsStationRouteService extends BaseService<LsStationRoute, Integ |
| 22 | 22 | * @param ids |
| 23 | 23 | */ |
| 24 | 24 | void batchDestroy(List<Integer> ids); |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 添加站点路由 | |
| 28 | + * @param stationRoute | |
| 29 | + */ | |
| 30 | + Map<String, Object> add(LsStationRoute stationRoute); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 修改站点路由 | |
| 34 | + * @param stationRoute | |
| 35 | + */ | |
| 36 | + Map<String, Object> modify(LsStationRoute stationRoute); | |
| 25 | 37 | } | ... | ... |
src/main/java/com/bsth/service/impl/LsStationRouteServiceImpl.java
| ... | ... | @@ -76,7 +76,7 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I |
| 76 | 76 | |
| 77 | 77 | @Transactional |
| 78 | 78 | @Override |
| 79 | - public Map<String, Object> save(LsStationRoute stationRoute) { | |
| 79 | + public Map<String, Object> add(LsStationRoute stationRoute) { | |
| 80 | 80 | Station station = stationRoute.getStation(); |
| 81 | 81 | Line line = lineRepository.findById(stationRoute.getLine().getId()).get(); |
| 82 | 82 | Integer versions = lineVersionsRepository.findCurrentVersion(line.getId()); |
| ... | ... | @@ -119,6 +119,32 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl<LsStationRoute, I |
| 119 | 119 | return new HashMap<>(); |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | + @Transactional | |
| 123 | + @Override | |
| 124 | + public Map<String, Object> modify(LsStationRoute stationRoute) { | |
| 125 | + LsStationRoute stationRoute1 = lsStationRouteRepository.findById(stationRoute.getId()).get(); | |
| 126 | + Integer versions = lineVersionsRepository.findCurrentVersion(stationRoute1.getLine().getId()); | |
| 127 | + | |
| 128 | + // 多边形缓冲区 | |
| 129 | + if ("d".equals(stationRoute.getShapedType())) { | |
| 130 | + String wkt = stationRoute.getBufferPolygonWkt(); | |
| 131 | + | |
| 132 | + stationRoute.setBufferPolygon((Polygon) Wkt.fromWkt(wkt)); | |
| 133 | + stationRoute.setBufferPolygonWgs(GeoConverter.polygonBd2wgs(wkt)); | |
| 134 | + } | |
| 135 | + | |
| 136 | + lsStationRouteRepository.updateStatiouRouteCode(stationRoute); | |
| 137 | + CustomBeanUtils.copyPropertiesIgnoredNull(stationRoute, stationRoute1); | |
| 138 | + lsStationRouteRepository.save(stationRoute1); | |
| 139 | + remark(stationRoute1); | |
| 140 | + if (stationRoute.getVersions().equals(versions)) { | |
| 141 | + stationRouteRepository.deleteByLineAndVersion(stationRoute1.getLine().getId(), versions); | |
| 142 | + stationRouteRepository.updateFromHistory(stationRoute1.getLine().getId(), versions); | |
| 143 | + } | |
| 144 | + | |
| 145 | + return new HashMap<>(); | |
| 146 | + } | |
| 147 | + | |
| 122 | 148 | public void remark(LsStationRoute stationRoute) { |
| 123 | 149 | lsStationRouteRepository.updateStartZ(stationRoute); |
| 124 | 150 | lsStationRouteRepository.updateStartB(stationRoute); | ... | ... |
src/main/resources/static/pages/base/stationroute/add_stationroute_step2.html
| ... | ... | @@ -230,6 +230,7 @@ $('#add_stationroute_step2_modal').on('modal.show', function(e, _WorldsBMap,_Get |
| 230 | 230 | $('#add_stationroute_step2_modal').on('show.bs.modal', function () { |
| 231 | 231 | // 获取站点编码元素,添加站点编码值 |
| 232 | 232 | _GetAjaxData.getStationCode(function(stationCode) { |
| 233 | + debugger | |
| 233 | 234 | var stationId = Station.id ? Station.id : stationCode, stationCode = Station.stationCode ? Station.stationCode : stationCode; |
| 234 | 235 | var stationName = Station.stationName ? Station.stationName : Station.stationNamebootbox; |
| 235 | 236 | var station = {id: stationId, stationCode: stationCode, stationName: stationName, centerPointWkt: Station.bJwpoints, shapedType: Station.shapesType}; | ... | ... |
src/main/resources/static/pages/base/stationroute/edit_select.html renamed to src/main/resources/static/pages/base/stationroute/edit_stationroute_step1.html
| 1 | 1 | <!-- 选择编辑站点方式 --> |
| 2 | -<div class="modal fade" id="edit_select_mobal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 2 | +<div class="modal fade" id="edit_stationroute_step1_modal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 3 | 3 | <div class="modal-dialog"> |
| 4 | 4 | <div class="modal-content" style="width: 700px;"> |
| 5 | 5 | <div class="modal-header"> |
| ... | ... | @@ -47,9 +47,9 @@ |
| 47 | 47 | </div> |
| 48 | 48 | <script type="text/javascript"> |
| 49 | 49 | |
| 50 | -$('#edit_select_mobal').on('editSelectMobal_show', function(e, _WorldsBMap,_DrawingManagerObj,_GetAjaxData,_EditStationObj,_LineObj,_PublicFunctions,Station){ | |
| 50 | +$('#edit_stationroute_step1_modal').on('modal.show', function(e, _WorldsBMap,_DrawingManagerObj,_GetAjaxData,_EditStationObj,_LineObj,_PublicFunctions,Station){ | |
| 51 | 51 | // 显示选择修改方式弹出层 |
| 52 | - $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | |
| 52 | + $('#edit_stationroute_step1_modal').modal({show: true,backdrop: 'static',keyboard: false}); | |
| 53 | 53 | setTimeout(function(){ |
| 54 | 54 | var offsetY = $('.modal-dialog').offset().top-3 , |
| 55 | 55 | offsetX = $('.modal-dialog').offset().left-10 ; |
| ... | ... | @@ -105,36 +105,30 @@ $('#edit_select_mobal').on('editSelectMobal_show', function(e, _WorldsBMap,_Draw |
| 105 | 105 | }, |
| 106 | 106 | submitHandler : function(f) { |
| 107 | 107 | // 隐藏弹出层 |
| 108 | - $('#edit_select_mobal').modal('hide'); | |
| 108 | + $('#edit_stationroute_step1_modal').modal('hide'); | |
| 109 | 109 | |
| 110 | 110 | // 表单序列 |
| 111 | 111 | var params = form.serializeJSON(); |
| 112 | 112 | // 站点名称 |
| 113 | 113 | var editStationName = params.stationNamebootbox; |
| 114 | 114 | // TODO(点击查询位置后绘画效果失败,待修改) |
| 115 | - if(params.editselect==0){ | |
| 115 | + if (params.editselect == 0) { | |
| 116 | + debugger | |
| 116 | 117 | _EditStationObj.setEitdStation(Station); |
| 117 | 118 | _EditStationObj.setEitdStationName(editStationName); |
| 118 | 119 | |
| 119 | - // _WorldsBMap.clearMarkAndOverlays(); | |
| 120 | + _WorldsBMap.getmapBValue().closeInfoWindow(); | |
| 120 | 121 | // 打开绘制工具 |
| 121 | 122 | _DrawingManagerObj.openDrawingManager(); |
| 122 | - _WorldsBMap.localtionPoint(editStationName+"公交站点"); | |
| 123 | - // _PublicFunctions.editMapStatus(); | |
| 124 | - }else if(params.editselect==1){ | |
| 125 | - WorldsBMap.localSearchFromAdreesToPoint(editStationName+"公交站点", function (Points) { | |
| 126 | - if (Points) { | |
| 127 | - Station.stationJwpoints = Points; | |
| 128 | - } | |
| 129 | - Station.stationShapesType = 'r'; | |
| 130 | - Station.stationGPloyonGrid = null; | |
| 131 | - Station.stationRadius = 100; | |
| 132 | - _EditStationObj.setEitdStation(Station); | |
| 133 | - _EditStationObj.setEitdStationName(editStationName); | |
| 134 | - _WorldsBMap.editShapes(_EditStationObj); | |
| 135 | - }); | |
| 123 | + } else if (params.editselect == 1) { | |
| 124 | + Station.stationShapesType = 'r'; | |
| 125 | + Station.stationGPloyonGrid = null; | |
| 126 | + Station.stationRadius = 80; | |
| 127 | + _EditStationObj.setEitdStation(Station); | |
| 128 | + _EditStationObj.setEitdStationName(editStationName); | |
| 129 | + _WorldsBMap.editShapes(_EditStationObj); | |
| 136 | 130 | // _PublicFunctions.editMapStatus(); |
| 137 | - }else if(params.editselect==2){ | |
| 131 | + } else if (params.editselect == 2){ | |
| 138 | 132 | _EditStationObj.setEitdStation(Station); |
| 139 | 133 | _EditStationObj.setEitdStationName(editStationName); |
| 140 | 134 | _WorldsBMap.clearMark(); | ... | ... |
src/main/resources/static/pages/base/stationroute/edit.html renamed to src/main/resources/static/pages/base/stationroute/edit_stationroute_step2.html
| 1 | 1 | <!-- 编辑站点 --> |
| 2 | -<div class="modal fade" id="edit_station_mobal" role="basic" aria-hidden="true"> | |
| 2 | +<div class="modal fade" id="edit_stationroute_step2_modal" role="basic" aria-hidden="true"> | |
| 3 | 3 | <div class="modal-dialog"> |
| 4 | 4 | <div class="modal-content"> |
| 5 | 5 | <div class="modal-header"> |
| ... | ... | @@ -21,18 +21,26 @@ |
| 21 | 21 | <input type="hidden" name="descriptions" id="descriptionsTextarea" /> |
| 22 | 22 | <input type="hidden" name="directions" id="stationdirSelect" /> |
| 23 | 23 | <input type="hidden" name="station.id" id="stationIdInput" /> |
| 24 | - <input type="hidden" name="station.stationName" id="zdmcInput" /> | |
| 25 | - <input type="hidden" name="station.destroy" /> | |
| 26 | 24 | |
| 27 | 25 | <!-- 站点名称 --> |
| 28 | - <!-- 站点名称 --> | |
| 29 | 26 | <div class="form-body"> |
| 30 | 27 | <div class="form-group"> |
| 31 | 28 | <label class="control-label col-md-3"> |
| 32 | 29 | <span class="required"> * </span> 站点名称 : |
| 33 | 30 | </label> |
| 34 | 31 | <div class="col-md-6"> |
| 35 | - <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称" readonly="readonly"> | |
| 32 | + <input type="text" class="form-control" name="station.stationName" id="zdmcInput" placeholder="站点名称" readonly="readonly"> | |
| 33 | + </div> | |
| 34 | + </div> | |
| 35 | + </div> | |
| 36 | + <!-- 站点路由名称 --> | |
| 37 | + <div class="form-body"> | |
| 38 | + <div class="form-group"> | |
| 39 | + <label class="control-label col-md-3"> | |
| 40 | + <span class="required"> * </span> 站点路由名称: | |
| 41 | + </label> | |
| 42 | + <div class="col-md-6"> | |
| 43 | + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称"> | |
| 36 | 44 | </div> |
| 37 | 45 | </div> |
| 38 | 46 | </div> |
| ... | ... | @@ -97,15 +105,6 @@ |
| 97 | 105 | </div> |
| 98 | 106 | </div> |
| 99 | 107 | </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="station.centerPointWkt" id="bJwpointsInput" placeholder="经纬度坐标点"> | |
| 106 | - </div> | |
| 107 | - </div> | |
| 108 | - </div> | |
| 109 | 108 | <!-- 几何图形类型 --> |
| 110 | 109 | <div class="form-body"> |
| 111 | 110 | <div class="form-group"> |
| ... | ... | @@ -185,20 +184,20 @@ |
| 185 | 184 | </div> |
| 186 | 185 | </div> |
| 187 | 186 | <script type="text/javascript"> |
| 188 | -$('#edit_station_mobal').on('editSelectMobal_show', function(e, _WorldsBMap,_GetAjaxData,_EditStationObj,_LineObj,_PublicFunctions){ | |
| 187 | +$('#edit_stationroute_step2_modal').on('modal.show', function(e, _WorldsBMap,_GetAjaxData,_EditStationObj,_LineObj,_PublicFunctions){ | |
| 189 | 188 | layer.closeAll(); |
| 190 | 189 | var station = _EditStationObj.getEitdStation(); |
| 191 | - var addLine = _LineObj.getLineObj(); | |
| 190 | + var line = _LineObj.getLineObj(); | |
| 192 | 191 | _PublicFunctions.setFormValue(station); |
| 193 | 192 | var initzdlyP = {'lineCode_eq': station.stationRouteLine, 'destroy_eq': 0, 'directions_eq': station.stationRoutedirections, 'versions_eq': station.stationRouteVersions}; |
| 194 | 193 | initSelect(initzdlyP); |
| 195 | 194 | // 显示mobal |
| 196 | - $('#edit_station_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | |
| 195 | + $('#edit_stationroute_step2_modal').modal({show: true, backdrop: 'static', keyboard: false}); | |
| 197 | 196 | // 当调用 hide 实例方法时触发 |
| 198 | - $('#edit_station_mobal').on('hide.bs.modal', function () { | |
| 197 | + $('#edit_stationroute_step2_modal').on('hide.bs.modal', function () { | |
| 199 | 198 | closeMobleSetClean(); |
| 200 | 199 | }); |
| 201 | - $('#statusInput').val(addLine.status); | |
| 200 | + $('#statusInput').val(line.status); | |
| 202 | 201 | function closeMobleSetClean() { |
| 203 | 202 | // 清除地图覆盖物 |
| 204 | 203 | _WorldsBMap.clearMarkAndOverlays(); |
| ... | ... | @@ -207,14 +206,9 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, _WorldsBMap,_Get |
| 207 | 206 | _EditStationObj.setEitdStation({}); |
| 208 | 207 | |
| 209 | 208 | var add_direction_v = $('#stationdirSelect').val(); |
| 210 | - _PublicFunctions.resjtreeDate(addLine.id,add_direction_v,version); | |
| 209 | + _PublicFunctions.resjtreeDate(line.id,add_direction_v,version); | |
| 211 | 210 | _PublicFunctions.editAChangeCssRemoveDisabled(); |
| 212 | - | |
| 213 | - console.log(_WorldsBMap.getStationArray()); | |
| 214 | - | |
| 215 | - //_GetAjaxData.getSectionRouteInfo(addLine.id,add_direction_v,version,function(data) { | |
| 216 | - // _PublicFunctions.linePanlThree(addLine.id,data,add_direction_v,version); | |
| 217 | - //}); | |
| 211 | + //console.log(_WorldsBMap.getStationArray()); | |
| 218 | 212 | _PublicFunctions.editMapStatusRemove(); |
| 219 | 213 | setTimeout(function () { |
| 220 | 214 | var stationArray = _WorldsBMap.getStationArray(); |
| ... | ... | @@ -237,13 +231,11 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, _WorldsBMap,_Get |
| 237 | 231 | errorClass : 'help-block help-block-error', |
| 238 | 232 | focusInvalid : false, |
| 239 | 233 | rules : { |
| 240 | - 'zdmc' : { required : true,maxlength : 50},// 站点名称 必填项 | |
| 234 | + 'station.stationName' : { required : true,maxlength : 50},// 站点名称 必填项 | |
| 241 | 235 | 'stationName' : { required : true,maxlength : 50},// 站点名称 必填项 |
| 242 | - 'stationCod': {required : true},// 站点编码 必填项 | |
| 243 | 236 | 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项 |
| 244 | 237 | 'stationRouteCode' : {isStart : true},// 站点序号 |
| 245 | 238 | 'stationMark' : {required : true},// 站点类型 必填项 |
| 246 | - 'bJwpoints' : {required : true},// 经纬度坐标点 必填项 | |
| 247 | 239 | 'shapesType' : {required : true},// 几何图形类型 必填项 |
| 248 | 240 | 'radius' : {required : true,number : true},// 圆形半径 必填项 |
| 249 | 241 | 'destroy' : {required : true},// 是否撤销 必填项 |
| ... | ... | @@ -279,23 +271,19 @@ $('#edit_station_mobal').on('editSelectMobal_show', function(e, _WorldsBMap,_Get |
| 279 | 271 | if (params.bufferPolygonWkt) { |
| 280 | 272 | params.bufferPolygonWkt = "POLYGON((" + params.bufferPolygonWkt + "))"; |
| 281 | 273 | } |
| 282 | - _GetAjaxData.stationUpdate(params,function(resuntDate) { | |
| 283 | - if(resuntDate.status=='SUCCESS') { | |
| 284 | - // 弹出添加成功提示消息 | |
| 274 | + // 保存 | |
| 275 | + _GetAjaxData.stationUpdate(params, function(data) { | |
| 276 | + if (data.status == 'SUCCESS') { | |
| 285 | 277 | layer.msg('修改成功...'); |
| 286 | - /** 通知更新缓存区 */ | |
| 287 | - // $.post('http://192.168.168.171:8800/transport_server/basic/refresh',function(rs){console.log(rs)}) | |
| 288 | - }else { | |
| 289 | - // 弹出添加失败提示消息 | |
| 278 | + } else { | |
| 290 | 279 | layer.msg('修改失败...'); |
| 291 | 280 | } |
| 292 | - $('#edit_station_mobal').modal('hide'); | |
| 293 | - var id = addLine.id; | |
| 281 | + $('#edit_stationroute_step2_modal').modal('hide'); | |
| 282 | + var id = line.id; | |
| 294 | 283 | var dir = params.directions |
| 295 | - | |
| 296 | 284 | // 刷行左边树 |
| 297 | - _PublicFunctions.resjtreeDate(id,dir,$("#versions").val()); | |
| 298 | - closeMobleSetClean(); | |
| 285 | + _PublicFunctions.resjtreeDate(id, dir, $("#versions").val()); | |
| 286 | + //closeMobleSetClean(); | |
| 299 | 287 | }); |
| 300 | 288 | } |
| 301 | 289 | }); | ... | ... |
src/main/resources/static/pages/base/stationroute/js/drawingManager.js
| ... | ... | @@ -87,10 +87,7 @@ var DrawingManagerObj = function () { |
| 87 | 87 | |
| 88 | 88 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat; |
| 89 | 89 | |
| 90 | - var add = AddStationObj.getAddStation(); | |
| 91 | - | |
| 92 | - var edit = EditStationObj.getEitdStation(); | |
| 93 | - | |
| 90 | + var add = AddStationObj.getAddStation(), edit = EditStationObj.getEitdStation(); | |
| 94 | 91 | if(!$.isEmptyObject(add)){ |
| 95 | 92 | /** 设置新增站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ |
| 96 | 93 | AddStationObj.setAddStationShapesType('d'); |
| ... | ... | @@ -102,36 +99,27 @@ var DrawingManagerObj = function () { |
| 102 | 99 | AddStationObj.setBPolygonGrid(bPloygonGrid); |
| 103 | 100 | |
| 104 | 101 | $.get('add_stationroute_step2.html', function(m){ |
| 105 | - | |
| 106 | 102 | $(pjaxContainer).append(m); |
| 107 | - | |
| 108 | 103 | $('#add_stationroute_step2_modal').trigger('modal.show', [WorldsBMap,GetAjaxData,AddStationObj,LineObj,PublicFunctions]); |
| 109 | - | |
| 110 | 104 | }); |
| 111 | 105 | } |
| 112 | 106 | |
| 113 | 107 | if(!$.isEmptyObject(edit)){ |
| 114 | 108 | /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ |
| 115 | 109 | EditStationObj.setEitdStationShapesType('d'); |
| 116 | - | |
| 117 | 110 | /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ |
| 118 | 111 | EditStationObj.setEitdStationRadius(''); |
| 119 | - | |
| 120 | 112 | /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ |
| 121 | 113 | EditStationObj.setEitdBPolygonGrid(bPloygonGrid); |
| 122 | 114 | |
| 123 | 115 | // 加载编辑页面 |
| 124 | - $.get('edit.html', function(m){ | |
| 125 | - | |
| 116 | + $.get('edit_stationroute_step2.html', function(m){ | |
| 126 | 117 | $(pjaxContainer).append(m); |
| 127 | - | |
| 128 | - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap,GetAjaxData,EditStationObj,LineObj,PublicFunctions]); | |
| 118 | + $('#edit_stationroute_step2_modal').trigger('modal.show', [WorldsBMap,GetAjaxData,EditStationObj,LineObj,PublicFunctions]); | |
| 129 | 119 | |
| 130 | 120 | }); |
| 131 | 121 | } |
| 132 | - | |
| 133 | 122 | } |
| 134 | - | |
| 135 | 123 | }); |
| 136 | 124 | |
| 137 | 125 | return drawingManager; | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
| ... | ... | @@ -107,15 +107,15 @@ var GetAjaxData = function(){ |
| 107 | 107 | callback && callback(result); |
| 108 | 108 | }); |
| 109 | 109 | }, |
| 110 | - // 新增站点保存 | |
| 111 | - stationSave : function(station,callback) { | |
| 112 | - $post('/api/lsstationroute',station,function(data) { | |
| 110 | + // 新增站点路由 | |
| 111 | + stationSave : function(stationRoute, callback) { | |
| 112 | + $post('/api/lsstationroute/add', stationRoute, function(data) { | |
| 113 | 113 | callback && callback(data); |
| 114 | 114 | }); |
| 115 | 115 | }, |
| 116 | - // 站点更新 | |
| 117 | - stationUpdate : function(station,callback) { | |
| 118 | - $post('/station/stationUpdate',station,function(data) { | |
| 116 | + // 站点路由更新 | |
| 117 | + stationUpdate : function(stationRoute, callback) { | |
| 118 | + $post('/api/lsstationroute/modify', stationRoute, function(data) { | |
| 119 | 119 | callback && callback(data); |
| 120 | 120 | }); |
| 121 | 121 | }, | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
| ... | ... | @@ -427,7 +427,6 @@ var PublicFunctions = function () { |
| 427 | 427 | $('#lineCodeInput').val(editStationParmas.stationRouteLIneCode); |
| 428 | 428 | // 行业标准 |
| 429 | 429 | $('#industryCodeInput').val(editStationParmas.industryCode); |
| 430 | - | |
| 431 | 430 | $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark); |
| 432 | 431 | // 百度坐标点图形集合 |
| 433 | 432 | $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid); | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
| ... | ... | @@ -330,8 +330,8 @@ window.WorldsBMap = function () { |
| 330 | 330 | setDragMarker(stationMarkers[station.stationRouteId]); |
| 331 | 331 | |
| 332 | 332 | // 获取中心坐标点字符串分割 |
| 333 | - var BJwpoints = station.stationJwpoints; | |
| 334 | - BJwpoints = BJwpoints.substring(6, BJwpoints.length - 1); | |
| 333 | + var BJwpoints = station.stationJwpoints, idx = BJwpoints.indexOf('POINT('); | |
| 334 | + BJwpoints = idx > -1 ? BJwpoints.substring(6, BJwpoints.length - 1) : BJwpoints; | |
| 335 | 335 | BJwpoints = BJwpoints.split(' '); |
| 336 | 336 | // 中心坐标点 |
| 337 | 337 | var centerPoint = new BMap.Point(BJwpoints[0], BJwpoints[1]); |
| ... | ... | @@ -370,9 +370,9 @@ window.WorldsBMap = function () { |
| 370 | 370 | // 清除正在编辑的站点 |
| 371 | 371 | editCircle = null; |
| 372 | 372 | // 加载编辑页面 |
| 373 | - $.get('edit.html', function (m) { | |
| 373 | + $.get('edit_stationroute_step2.html', function (m) { | |
| 374 | 374 | $(pjaxContainer).append(m); |
| 375 | - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap, GetAjaxData, EditStationObj, LineObj, PublicFunctions]); | |
| 375 | + $('#edit_stationroute_step2_modal').trigger('modal.show', [WorldsBMap, GetAjaxData, EditStationObj, LineObj, PublicFunctions]); | |
| 376 | 376 | }); |
| 377 | 377 | }); |
| 378 | 378 | // 编辑多边行 |
| ... | ... | @@ -431,9 +431,9 @@ window.WorldsBMap = function () { |
| 431 | 431 | EditStationObj.setEitdBPolygonGrid(edit_bPloygonGrid); |
| 432 | 432 | // 清除正在编辑的站点 |
| 433 | 433 | editPolygon = null; |
| 434 | - $.get('edit.html', function (m) { | |
| 434 | + $.get('edit_stationroute_step2.html', function (m) { | |
| 435 | 435 | $(pjaxContainer).append(m); |
| 436 | - $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap, GetAjaxData, EditStationObj, LineObj, PublicFunctions]); | |
| 436 | + $('#edit_stationroute_step2_modal').trigger('modal.show', [WorldsBMap, GetAjaxData, EditStationObj, LineObj, PublicFunctions]); | |
| 437 | 437 | }); |
| 438 | 438 | }); |
| 439 | 439 | } |
| ... | ... | @@ -733,12 +733,10 @@ window.WorldsBMap = function () { |
| 733 | 733 | }, |
| 734 | 734 | // 修改站点 |
| 735 | 735 | editStation: function (stationRouteId) { |
| 736 | - // $.get("/stationroute/findStationRouteInfo",{"id":stationRouteId},function (route) { | |
| 737 | - $.get('edit_select.html', function (m) { | |
| 736 | + $.get('edit_stationroute_step1.html', function (m) { | |
| 738 | 737 | $(pjaxContainer).append(m); |
| 739 | - $('#edit_select_mobal').trigger('editSelectMobal_show', [WorldsBMap, DrawingManagerObj, GetAjaxData, EditStationObj, LineObj, PublicFunctions, stationArray[stationRouteId]]); | |
| 738 | + $('#edit_stationroute_step1_modal').trigger('modal.show', [WorldsBMap, DrawingManagerObj, GetAjaxData, EditStationObj, LineObj, PublicFunctions, stationArray[stationRouteId]]); | |
| 740 | 739 | }); |
| 741 | - // }); | |
| 742 | 740 | }, |
| 743 | 741 | addBetweenStationRoad: function (stationRouteId) { |
| 744 | 742 | var version = $("#versions").val(); | ... | ... |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-treedata.js
| ... | ... | @@ -24,16 +24,11 @@ var StationTreeData = function(){ |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | function TreeOnclickEvent(treeOjb) { |
| 27 | - if(treeOjb==null) | |
| 28 | - return; | |
| 29 | - // 节点个数 | |
| 30 | - var len = treeOjb.length; | |
| 31 | - if(len<0) { | |
| 27 | + if(treeOjb == null || treeOjb.length < 1) { | |
| 32 | 28 | return; |
| 33 | 29 | } |
| 34 | 30 | |
| 35 | 31 | // 获取数据 |
| 36 | - debugger | |
| 37 | 32 | var stationData = treeOjb[0].original; |
| 38 | 33 | // 选中的节点类型 |
| 39 | 34 | var chaildredType_ = stationData.chaildredType; | ... | ... |