Commit 703cb809c547dffac02cb2798f9b28d355be54d9

Authored by 李强
1 parent c4d00ef1

基础信息修订

Showing 22 changed files with 291 additions and 898 deletions
src/main/java/com/bsth/controller/SectionRouteController.java
@@ -35,6 +35,17 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer @@ -35,6 +35,17 @@ public class SectionRouteController extends BaseController<SectionRoute, Integer
35 @Autowired 35 @Autowired
36 SectionRouteService routeService; 36 SectionRouteService routeService;
37 37
  38 + /**
  39 + * @param @param map
  40 + * @throws
  41 + * @Title: list
  42 + * @Description: TODO(多条件查询)
  43 + */
  44 + @RequestMapping(value = "/all", method = RequestMethod.GET)
  45 + public Iterable<SectionRoute> list(@RequestParam Map<String, Object> map) {
  46 + return routeService.list(map);
  47 + }
  48 +
38 /** 49 /**
39 * @Description :TODO(查询路段信息) 50 * @Description :TODO(查询路段信息)
40 * 51 *
src/main/java/com/bsth/service/SectionRouteService.java
@@ -22,6 +22,14 @@ import com.bsth.entity.SectionRoute; @@ -22,6 +22,14 @@ import com.bsth.entity.SectionRoute;
22 */ 22 */
23 public interface SectionRouteService extends BaseService<SectionRoute, Integer> { 23 public interface SectionRouteService extends BaseService<SectionRoute, Integer> {
24 24
  25 + /**
  26 + *
  27 + * @Title: list
  28 + * @Description: TODO(多条件查询)
  29 + * @throws
  30 + */
  31 + Iterable<SectionRoute> list(Map<String, Object> map);
  32 +
25 List<Map<String, Object>> getSectionRoute(Map<String, Object> map); 33 List<Map<String, Object>> getSectionRoute(Map<String, Object> map);
26 34
27 /** 35 /**
src/main/java/com/bsth/service/impl/SectionRouteServiceImpl.java
@@ -6,12 +6,15 @@ import java.util.List; @@ -6,12 +6,15 @@ import java.util.List;
6 import java.util.Map; 6 import java.util.Map;
7 7
8 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.data.domain.Sort;
  10 +import org.springframework.data.domain.Sort.Direction;
9 import org.springframework.stereotype.Service; 11 import org.springframework.stereotype.Service;
10 12
11 import com.bsth.common.ResponseCode; 13 import com.bsth.common.ResponseCode;
12 import com.bsth.entity.Line; 14 import com.bsth.entity.Line;
13 import com.bsth.entity.Section; 15 import com.bsth.entity.Section;
14 import com.bsth.entity.SectionRoute; 16 import com.bsth.entity.SectionRoute;
  17 +import com.bsth.entity.search.CustomerSpecs;
15 import com.bsth.repository.LineRepository; 18 import com.bsth.repository.LineRepository;
16 import com.bsth.repository.SectionRepository; 19 import com.bsth.repository.SectionRepository;
17 import com.bsth.repository.SectionRouteRepository; 20 import com.bsth.repository.SectionRouteRepository;
@@ -46,6 +49,14 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ @@ -46,6 +49,14 @@ public class SectionRouteServiceImpl extends BaseServiceImpl&lt;SectionRoute, Integ
46 @Autowired 49 @Autowired
47 LineRepository lineRepository; 50 LineRepository lineRepository;
48 51
  52 + @Override
  53 + public Iterable<SectionRoute> list(Map<String, Object> map) {
  54 + List<Sort.Order> orderList = new ArrayList<>();
  55 + orderList.add(new Sort.Order(Direction.ASC, "directions"));
  56 + orderList.add(new Sort.Order(Direction.ASC, "sectionrouteCode"));
  57 + return repository.findAll(new CustomerSpecs<SectionRoute>(map), new Sort(orderList));
  58 + }
  59 +
49 /** 60 /**
50 * @Description :TODO(查询路段信息) 61 * @Description :TODO(查询路段信息)
51 * 62 *
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
@@ -413,34 +413,22 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -413,34 +413,22 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
413 */ 413 */
414 @Override 414 @Override
415 public List<Map<String, Object>> findUpStationRouteCode(Map<String, Object> map) { 415 public List<Map<String, Object>> findUpStationRouteCode(Map<String, Object> map) {
416 -  
417 Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString()); 416 Integer lineId = map.get("lineId").equals("") ? null : Integer.parseInt(map.get("lineId").toString());
418 -  
419 Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString()); 417 Integer direction = map.get("direction").equals("") ? null : Integer.parseInt(map.get("direction").toString());
420 -  
421 Integer stationRouteCode = map.get("stationRouteCode").equals("") ? null : Integer.parseInt(map.get("stationRouteCode").toString()); 418 Integer stationRouteCode = map.get("stationRouteCode").equals("") ? null : Integer.parseInt(map.get("stationRouteCode").toString());
422 -  
423 List<Object[]> reslutList = repository.findUpStationRouteCode(lineId, direction, stationRouteCode); 419 List<Object[]> reslutList = repository.findUpStationRouteCode(lineId, direction, stationRouteCode);
424 -  
425 List<Map<String, Object>> list = new ArrayList<Map<String,Object>>(); 420 List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();
426 -  
427 if(reslutList.size()>0) { 421 if(reslutList.size()>0) {
428 -  
429 for(int i = 0 ; i <reslutList.size() ;i++){ 422 for(int i = 0 ; i <reslutList.size() ;i++){
430 Map<String, Object> tempM = new HashMap<String, Object>(); 423 Map<String, Object> tempM = new HashMap<String, Object>();
431 tempM.put("stationRouteCode", reslutList.get(i)[0]); 424 tempM.put("stationRouteCode", reslutList.get(i)[0]);
432 tempM.put("stationRouteMarke", reslutList.get(i)[1]); 425 tempM.put("stationRouteMarke", reslutList.get(i)[1]);
433 -  
434 list.add(tempM); 426 list.add(tempM);
435 -  
436 } 427 }
437 -  
438 } 428 }
439 -  
440 return list; 429 return list;
441 } 430 }
442 431
443 -  
444 /** 432 /**
445 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标) 433 * @Description :TODO(查询线路某方向下所有站点的中心百度坐标)
446 * 434 *
src/main/resources/static/pages/base/section/add.html
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 Your form validation is successful! 77 Your form validation is successful!
78 </div> 78 </div>
79 79
80 - <!-- 选择添加站点方式 --> 80 + <!-- 选择添加路段方式 -->
81 <div class="tab-pane active" id="tab1"> 81 <div class="tab-pane active" id="tab1">
82 <h3 class="block"> 选择添加路段方式 </h3> 82 <h3 class="block"> 选择添加路段方式 </h3>
83 <!-- 起点名称 --> 83 <!-- 起点名称 -->
@@ -112,13 +112,13 @@ @@ -112,13 +112,13 @@
112 </div> 112 </div>
113 </div> 113 </div>
114 114
115 - <!-- 站点位置 --> 115 + <!-- 路段位置 -->
116 <div class="tab-pane" id="tab2"> 116 <div class="tab-pane" id="tab2">
117 <h3 class="block"> 路段位置 </h3> 117 <h3 class="block"> 路段位置 </h3>
118 <div id="sectionBmap_basic"></div> 118 <div id="sectionBmap_basic"></div>
119 </div> 119 </div>
120 120
121 - <!-- 站点信息 --> 121 + <!-- 路段信息 -->
122 <div class="tab-pane" id="tab3"> 122 <div class="tab-pane" id="tab3">
123 <h3 class="block"> 路段信息 </h3> 123 <h3 class="block"> 路段信息 </h3>
124 <input type="hidden" name="bsectionVector" id="bsectionVectorInput" /> 124 <input type="hidden" name="bsectionVector" id="bsectionVectorInput" />
@@ -145,7 +145,7 @@ @@ -145,7 +145,7 @@
145 <span class="required"> * </span> 路段名称: 145 <span class="required"> * </span> 路段名称:
146 </label> 146 </label>
147 <div class="col-md-6"> 147 <div class="col-md-6">
148 - <input type="text" class="form-control" name="sectionName" id="sectionNameInput" placeholder="站点名称"> 148 + <input type="text" class="form-control" name="sectionName" id="sectionNameInput" placeholder="路段名称">
149 </div> 149 </div>
150 </div> 150 </div>
151 </div> 151 </div>
@@ -157,35 +157,23 @@ @@ -157,35 +157,23 @@
157 <span class="required"> * </span> 路段编码: 157 <span class="required"> * </span> 路段编码:
158 </label> 158 </label>
159 <div class="col-md-6"> 159 <div class="col-md-6">
160 - <input type="text" class="form-control" name="sectionCode" id="sectionCodeInput"> 160 + <input type="text" class="form-control" name="sectionCode" id="sectionCodeInput" readonly="readonly">
161 </div> 161 </div>
162 </div> 162 </div>
163 </div> 163 </div>
164 -  
165 - <!-- 道路编码-->  
166 - <div class="form-body">  
167 - <div class="form-group">  
168 - <label class="control-label col-md-3">道路编码:</label>  
169 - <div class="col-md-6">  
170 - <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput">  
171 - </div>  
172 - </div>  
173 - </div>  
174 -  
175 <!-- 路段序号 --> 164 <!-- 路段序号 -->
176 <div class="form-body"> 165 <div class="form-body">
177 <div class="form-group"> 166 <div class="form-group">
178 <label class="control-label col-md-3"> 167 <label class="control-label col-md-3">
179 - <span class="required"> * </span>上一路段: 168 + 上一路段:
180 </label> 169 </label>
181 <div class="col-md-6"> 170 <div class="col-md-6">
182 <select name="sectionrouteCode" style="width:100%" class="form-control" id="sectionrouteCodeSelect"></select> 171 <select name="sectionrouteCode" style="width:100%" class="form-control" id="sectionrouteCodeSelect"></select>
183 - <span class="help-block"> *说明:选择的路段将作为路段序号的参考,成为选择路段的下一个路段。 </span> 172 + <span class="help-block">说明:选择的路段将作为本路段序号的参考,成为选择路段的下一个路段。 </span>
184 </div> 173 </div>
185 </div> 174 </div>
186 </div> 175 </div>
187 -  
188 - <!-- 站点方向 --> 176 + <!-- 路段方向 -->
189 <div class="form-body"> 177 <div class="form-body">
190 <div class="form-group"> 178 <div class="form-group">
191 <label class="control-label col-md-3"> 179 <label class="control-label col-md-3">
@@ -193,7 +181,7 @@ @@ -193,7 +181,7 @@
193 </label> 181 </label>
194 <div class="col-md-6"> 182 <div class="col-md-6">
195 <select name="directions" class="form-control" id="sectionDirSelect"> 183 <select name="directions" class="form-control" id="sectionDirSelect">
196 - <option value="">-- 请选择站点类型 --</option> 184 + <option value="">-- 请选择路段类型 --</option>
197 <option value="0">上行</option> 185 <option value="0">上行</option>
198 <option value="1">下行</option> 186 <option value="1">下行</option>
199 </select> 187 </select>
@@ -219,36 +207,43 @@ @@ -219,36 +207,43 @@
219 <label class="control-label col-md-3"> <span class="required"> * </span> 路段限速:</label> 207 <label class="control-label col-md-3"> <span class="required"> * </span> 路段限速:</label>
220 <div class="col-md-6"> 208 <div class="col-md-6">
221 <input type="text" class="form-control" name="speedLimit" id="speedLimitInput"> 209 <input type="text" class="form-control" name="speedLimit" id="speedLimitInput">
222 - <span class="help-block">单位: 千米/小时</span> 210 + <span class="help-block">单位:千米/时(km/h)</span>
223 </div> 211 </div>
224 </div> 212 </div>
225 </div> 213 </div>
226 - <!-- 路段时长 --> 214 + <!-- 道路编码-->
227 <div class="form-body"> 215 <div class="form-body">
228 <div class="form-group"> 216 <div class="form-group">
229 - <label class="col-md-3 control-label">路段时长:</label> 217 + <label class="control-label col-md-3">道路编码:</label>
230 <div class="col-md-6"> 218 <div class="col-md-6">
231 - <input type="text" class="form-control" name="sectionTime" id="sectionTimeInput" >  
232 - <span class="help-block">单位:分钟</span> 219 + <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput">
233 </div> 220 </div>
234 </div> 221 </div>
235 </div> 222 </div>
236 -  
237 <!-- 路段距离 --> 223 <!-- 路段距离 -->
238 <div class="form-body"> 224 <div class="form-body">
239 <div class="form-group"> 225 <div class="form-group">
240 <label class="col-md-3 control-label">路段距离:</label> 226 <label class="col-md-3 control-label">路段距离:</label>
241 <div class="col-md-6"> 227 <div class="col-md-6">
242 <input type="text" class="form-control" name="sectionDistance" id="sectionDistanceInput" > 228 <input type="text" class="form-control" name="sectionDistance" id="sectionDistanceInput" >
243 - <span class="help-block">单位:公里</span> 229 + <span class="help-block">单位:公里(km)</span>
  230 + </div>
  231 + </div>
  232 + </div>
  233 + <!-- 路段时长 -->
  234 + <div class="form-body">
  235 + <div class="form-group">
  236 + <label class="col-md-3 control-label">路段时长:</label>
  237 + <div class="col-md-6">
  238 + <input type="text" class="form-control" name="sectionTime" id="sectionTimeInput" >
  239 + <span class="help-block">单位:分钟(min)</span>
244 </div> 240 </div>
245 </div> 241 </div>
246 </div> 242 </div>
247 -  
248 <!-- 版本号 --> 243 <!-- 版本号 -->
249 <div class="form-body"> 244 <div class="form-body">
250 <div class="form-group"> 245 <div class="form-group">
251 - <label class="col-md-3 control-label">版本号:</label> 246 + <label class="col-md-3 control-label">版本号&nbsp;&nbsp;&nbsp;:</label>
252 <div class="col-md-6"> 247 <div class="col-md-6">
253 <input type="text" class="form-control" name="versions" value='1' Readonly> 248 <input type="text" class="form-control" name="versions" value='1' Readonly>
254 </div> 249 </div>
@@ -266,7 +261,7 @@ @@ -266,7 +261,7 @@
266 261
267 <!-- 确定提交资料信息 --> 262 <!-- 确定提交资料信息 -->
268 <div class="tab-pane" id="tab4"> 263 <div class="tab-pane" id="tab4">
269 - <h3 class="block"> 确认您提交的站点信息 </h3> 264 + <h3 class="block"> 确认您提交的路段信息 </h3>
270 265
271 <h4 class="form-section"> 路段信息 </h4> 266 <h4 class="form-section"> 路段信息 </h4>
272 267
@@ -305,21 +300,27 @@ @@ -305,21 +300,27 @@
305 </div> 300 </div>
306 </div> 301 </div>
307 302
308 - <div class="form-group">  
309 - <label class="control-label col-md-3">道路编码:</label> 303 + <div class="form-group">
  304 + <label class="control-label col-md-3">是否撤销:</label>
310 <div class="col-md-4"> 305 <div class="col-md-4">
311 - <p class="form-control-static" data-display="roadCoding"> </p> 306 + <p class="form-control-static" data-display="destroy"> </p>
312 </div> 307 </div>
313 </div> 308 </div>
314 309
315 -  
316 <div class="form-group"> 310 <div class="form-group">
317 - <label class="control-label col-md-3">路段线路:</label> 311 + <label class="control-label col-md-3">路段限速:</label>
318 <div class="col-md-4"> 312 <div class="col-md-4">
319 <p class="form-control-static" data-display="speedLimit"> </p> 313 <p class="form-control-static" data-display="speedLimit"> </p>
320 </div> 314 </div>
321 </div> 315 </div>
322 316
  317 + <div class="form-group">
  318 + <label class="control-label col-md-3">道路编码:</label>
  319 + <div class="col-md-4">
  320 + <p class="form-control-static" data-display="roadCoding"> </p>
  321 + </div>
  322 + </div>
  323 +
323 <div class="form-group"> 324 <div class="form-group">
324 <label class="control-label col-md-3">路段时长:</label> 325 <label class="control-label col-md-3">路段时长:</label>
325 <div class="col-md-4"> 326 <div class="col-md-4">
@@ -335,20 +336,13 @@ @@ -335,20 +336,13 @@
335 </div> 336 </div>
336 337
337 <div class="form-group"> 338 <div class="form-group">
338 - <label class="control-label col-md-3">版本号:</label> 339 + <label class="control-label col-md-3">版本号&nbsp;&nbsp;&nbsp;:</label>
339 <div class="col-md-4"> 340 <div class="col-md-4">
340 <p class="form-control-static" data-display="versions"> </p> 341 <p class="form-control-static" data-display="versions"> </p>
341 </div> 342 </div>
342 </div> 343 </div>
343 344
344 <div class="form-group"> 345 <div class="form-group">
345 - <label class="control-label col-md-3">是否撤销:</label>  
346 - <div class="col-md-4">  
347 - <p class="form-control-static" data-display="destroy"> </p>  
348 - </div>  
349 - </div>  
350 -  
351 - <div class="form-group">  
352 <label class="control-label col-md-3">描述/说明:</label> 346 <label class="control-label col-md-3">描述/说明:</label>
353 <div class="col-md-4"> 347 <div class="col-md-4">
354 <p class="form-control-static" data-display="descriptions"> </p> 348 <p class="form-control-static" data-display="descriptions"> </p>
src/main/resources/static/pages/base/section/editsection.html
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 <span class="required"> * </span> 路段编码: 38 <span class="required"> * </span> 路段编码:
39 </label> 39 </label>
40 <div class="col-md-6"> 40 <div class="col-md-6">
41 - <input type="text" class="form-control" name="sectionCode" id="sectionCodeInput" placeholder="路段编码"> 41 + <input type="text" class="form-control" name="sectionCode" id="sectionCodeInput" placeholder="路段编码" readonly="readonly">
42 </div> 42 </div>
43 </div> 43 </div>
44 </div> 44 </div>
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 </label> 50 </label>
51 <div class="col-md-6"> 51 <div class="col-md-6">
52 <select name="sectionrouteCode" class="form-control" id="sectionrouteCodeSelect"></select> 52 <select name="sectionrouteCode" class="form-control" id="sectionrouteCodeSelect"></select>
53 - <span class="help-block"> *说明:选择的路段将作为本站序号的参考,成为选择路段的下一个路段。 </span> 53 + <span class="help-block">说明:选择的路段将作为本路段序号的参考,成为选择路段的下一个路段。 </span>
54 </div> 54 </div>
55 </div> 55 </div>
56 </div> 56 </div>
@@ -77,6 +77,7 @@ @@ -77,6 +77,7 @@
77 </label> 77 </label>
78 <div class="col-md-6"> 78 <div class="col-md-6">
79 <input type="text" class="form-control" name="speedLimit" id="speedLimitInput" placeholder="路段限速"> 79 <input type="text" class="form-control" name="speedLimit" id="speedLimitInput" placeholder="路段限速">
  80 + <span class="help-block">单位:千米/时(km/h)</span>
80 </div> 81 </div>
81 </div> 82 </div>
82 </div> 83 </div>
@@ -102,23 +103,23 @@ @@ -102,23 +103,23 @@
102 </div> 103 </div>
103 </div> 104 </div>
104 </div> 105 </div>
105 - <!-- 路段时长 --> 106 + <!-- 路段长度 -->
106 <div class="form-body"> 107 <div class="form-body">
107 <div class="form-group"> 108 <div class="form-group">
108 - <label class="col-md-3 control-label">路段时长:</label> 109 + <label class="col-md-3 control-label">路段长度:</label>
109 <div class="col-md-6"> 110 <div class="col-md-6">
110 - <input type="text" class="form-control" name="sectionTime" id="sectionTimeInput" placeholder="路段时长">  
111 - <span class="help-block">单位:分钟</span> 111 + <input type="text" class="form-control" name="sectionDistance" id="sectionDistanceInput" placeholder="路段长度">
  112 + <span class="help-block">单位:公里(km)</span>
112 </div> 113 </div>
113 </div> 114 </div>
114 </div> 115 </div>
115 - <!-- 路段长度 --> 116 + <!-- 路段时长 -->
116 <div class="form-body"> 117 <div class="form-body">
117 <div class="form-group"> 118 <div class="form-group">
118 - <label class="col-md-3 control-label">路段长度:</label> 119 + <label class="col-md-3 control-label">路段历时:</label>
119 <div class="col-md-6"> 120 <div class="col-md-6">
120 - <input type="text" class="form-control" name="sectionDistance" id="sectionDistanceInput" placeholder="路段长度">  
121 - <span class="help-block">单位:公里</span> 121 + <input type="text" class="form-control" name="sectionTime" id="sectionTimeInput" placeholder="路段时长">
  122 + <span class="help-block">单位:分钟(min)</span>
122 </div> 123 </div>
123 </div> 124 </div>
124 </div> 125 </div>
@@ -223,12 +224,14 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect @@ -223,12 +224,14 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
223 focusInvalid : false, 224 focusInvalid : false,
224 rules : { 225 rules : {
225 'sectionName' : {required : true,maxlength:50},// 路段名称 必填项 226 'sectionName' : {required : true,maxlength:50},// 路段名称 必填项
226 - 'sectionCode': {required : true,},// 路段编码 227 + 'sectionCode': {required : true,},// 路段编码 必填项
227 'directions' : {required : true,},// 路段方向 必填项 228 'directions' : {required : true,},// 路段方向 必填项
228 - 'speedLimit' : {number : true},// 路段限速 必须输入合法的数字(负数,小数)。  
229 - 'sectionTime' : {number : true},// 路段长度 必须输入合法的数字(负数,小数)。  
230 - 'sectionDistance' : {number : true},// 路段时长 必须输入合法的数字(负数,小数)。  
231 - 'descriptions' : {maxlength: 150}// 描述与说明 最大长度 229 + 'speedLimit' : {required : true,number : true},// 路段限速 必须输入合法的数字(负数,小数)。
  230 + 'destroy' : {required : true,},// 是否撤销 必填项.
  231 + 'roadCoding' : {number : true},// 道路编码 必须输入合法的数字(负数,小数)。
  232 + 'sectionTime' : {number : true},// 路段时长 必须输入合法的数字(负数,小数)。
  233 + 'sectionDistance' : {number : true},// 路段长度 必须输入合法的数字(负数,小数)。
  234 + 'descriptions' : {maxlength: 150}// 描述与说明 最大长度.
232 }, 235 },
233 invalidHandler : function(event, validator) { 236 invalidHandler : function(event, validator) {
234 error.show(); 237 error.show();
src/main/resources/static/pages/base/section/js/add-form-wizard.js
@@ -21,12 +21,14 @@ var FormWizard = function() { @@ -21,12 +21,14 @@ var FormWizard = function() {
21 focusInvalid : true, // 验证错误获取焦点. 21 focusInvalid : true, // 验证错误获取焦点.
22 // 需要验证的表单元素. 22 // 需要验证的表单元素.
23 rules : { 23 rules : {
24 - 'stationStart' : {required : true,},// 起点 必填项.  
25 - 'stationEnd' : {required : true,},// 终点 必填项. 24 + 'stationStart' : {required : true,maxlength:50,},// 起点 必填项.
  25 + 'stationEnd' : {required : true,maxlength:50,},// 终点 必填项.
26 'line' : {required : true},// 线路名称 必填项. 26 'line' : {required : true},// 线路名称 必填项.
27 - 'sectionName' : {required : true,maxlength: 25},// 路段名称 必填项. 27 + 'sectionName' : {required : true,maxlength: 50},// 路段名称 必填项.
28 'sectionCode' : {required : true},// 路段编码 必填项. 28 'sectionCode' : {required : true},// 路段编码 必填项.
29 'directions' : {required : true},// 路段方向 必填项. 29 'directions' : {required : true},// 路段方向 必填项.
  30 + 'destroy' : {required : true},// 是否撤销 必填项.
  31 + 'roadCoding' : {number : true},// 道路编码 必须输入合法的数字(负数,小数)。
30 'sectionTime' : {number : true},// 路段时长 必须输入合法的数字(负数,小数)。 32 'sectionTime' : {number : true},// 路段时长 必须输入合法的数字(负数,小数)。
31 'sectionDistance' : {number : true},// 路段距离 必须输入合法的数字(负数,小数)。 33 'sectionDistance' : {number : true},// 路段距离 必须输入合法的数字(负数,小数)。
32 'speedLimit' : {required : true,number : true},// 必填项 路段限速 必须输入合法的数字(负数,小数)。 34 'speedLimit' : {required : true,number : true},// 必填项 路段限速 必须输入合法的数字(负数,小数)。
src/main/resources/static/pages/base/section/js/add-input-function.js
@@ -79,8 +79,8 @@ var PublicFunctions = function () { @@ -79,8 +79,8 @@ var PublicFunctions = function () {
79 // 获取某线路下的路段路由. 79 // 获取某线路下的路段路由.
80 getSectionRouteInfo : function(line,callback) { 80 getSectionRouteInfo : function(line,callback) {
81 $get('/sectionroute/all',{'line.id_eq':line,'destroy_eq':0},function(result) { 81 $get('/sectionroute/all',{'line.id_eq':line,'destroy_eq':0},function(result) {
82 - if(result.length>0)  
83 - result.sort(function(a,b){return a.sectionrouteCode-b.sectionrouteCode}); 82 + /*if(result.length>0)
  83 + result.sort(function(a,b){return a.sectionrouteCode-b.sectionrouteCode});*/
84 callback && callback(result); 84 callback && callback(result);
85 }); 85 });
86 }, 86 },
src/main/resources/static/pages/base/section/js/section-list-table.js
@@ -18,14 +18,12 @@ @@ -18,14 +18,12 @@
18 return cb && cb(rs); 18 return cb && cb(rs);
19 }); 19 });
20 } 20 }
21 -  
22 function getCompInfo(cb) { 21 function getCompInfo(cb) {
23 // get请求获取公司 22 // get请求获取公司
24 $get('/business/all', {upCode_eq: '88'}, function(gs_d){ 23 $get('/business/all', {upCode_eq: '88'}, function(gs_d){
25 return cb && cb(gs_d); 24 return cb && cb(gs_d);
26 }); 25 });
27 } 26 }
28 -  
29 function gsdmTogsName(gsD,code) { 27 function gsdmTogsName(gsD,code) {
30 var rsStr = ''; 28 var rsStr = '';
31 for(var s = 0 ; s < gsD.length; s++) { 29 for(var s = 0 ; s < gsD.length; s++) {
@@ -36,7 +34,6 @@ @@ -36,7 +34,6 @@
36 } 34 }
37 return rsStr; 35 return rsStr;
38 } 36 }
39 -  
40 function splitxlName(str) { 37 function splitxlName(str) {
41 var rsStr = ''; 38 var rsStr = '';
42 if(str) { 39 if(str) {
@@ -167,22 +164,18 @@ @@ -167,22 +164,18 @@
167 }); 164 });
168 }); 165 });
169 }); 166 });
170 -  
171 $('#lineSelect').on('change',function() { 167 $('#lineSelect').on('change',function() {
172 initldNameSelect(); 168 initldNameSelect();
173 }); 169 });
174 -  
175 $('#dirSelect').on('change',function() { 170 $('#dirSelect').on('change',function() {
176 initldNameSelect(); 171 initldNameSelect();
177 }); 172 });
178 -  
179 $('#sectionNameSelect').on('change',function() { 173 $('#sectionNameSelect').on('change',function() {
180 var ldName = $(this).val(); 174 var ldName = $(this).val();
181 if(ldName!=null) { 175 if(ldName!=null) {
182 $('#destroy').val(ldName.split('_')[1]); 176 $('#destroy').val(ldName.split('_')[1]);
183 } 177 }
184 }); 178 });
185 -  
186 /** 179 /**
187 * @description : (TODO) 监听重置按钮事件. 180 * @description : (TODO) 监听重置按钮事件.
188 * 181 *
@@ -195,7 +188,6 @@ @@ -195,7 +188,6 @@
195 // 重新加载表格数据 188 // 重新加载表格数据
196 loadTableDate(null,true); 189 loadTableDate(null,true);
197 }); 190 });
198 -  
199 /** 191 /**
200 * @description : (TODO) 搜索按钮事件 192 * @description : (TODO) 搜索按钮事件
201 * 193 *
@@ -203,7 +195,6 @@ @@ -203,7 +195,6 @@
203 $('tr.filter .filter-submit').on('click',function(){ 195 $('tr.filter .filter-submit').on('click',function(){
204 initSearch(); 196 initSearch();
205 }); 197 });
206 -  
207 function initSearch() { 198 function initSearch() {
208 var params = getParams(); 199 var params = getParams();
209 page = 0; 200 page = 0;
@@ -216,7 +207,6 @@ @@ -216,7 +207,6 @@
216 params['line.name_like'] = splitxlName(params['line.name_like']); 207 params['line.name_like'] = splitxlName(params['line.name_like']);
217 loadTableDate(params,true); 208 loadTableDate(params,true);
218 } 209 }
219 -  
220 function getParams() { 210 function getParams() {
221 // cells 集合返回表格中所有(列)单元格的一个数组 211 // cells 集合返回表格中所有(列)单元格的一个数组
222 var cells = $('tr.filter')[0].cells; 212 var cells = $('tr.filter')[0].cells;
@@ -240,7 +230,6 @@ @@ -240,7 +230,6 @@
240 }); 230 });
241 return params; 231 return params;
242 } 232 }
243 -  
244 /** 233 /**
245 * @description : (TODO) 表格数据分页加载事件 234 * @description : (TODO) 表格数据分页加载事件
246 * 235 *
@@ -254,10 +243,10 @@ @@ -254,10 +243,10 @@
254 var params = {}; 243 var params = {};
255 if(param) 244 if(param)
256 params = param; 245 params = param;
257 - // 排序(按更新时间)  
258 - params['order'] = 'id';  
259 - // 记录当前页数  
260 - params['page'] = page; 246 + // 排序(按方向与序号)
  247 + params['order'] = 'directions,sectionrouteCode';
  248 + // 排序方向.
  249 + params['direction'] = 'ASC,ASC';
261 // 弹出正在加载层 250 // 弹出正在加载层
262 var i = layer.load(2); 251 var i = layer.load(2);
263 // 异步请求获取表格数据 252 // 异步请求获取表格数据
@@ -267,7 +256,7 @@ @@ -267,7 +256,7 @@
267 // 把数据填充到模版中 256 // 把数据填充到模版中
268 var tbodyHtml = template('sectionInfo_list_table_temp',{list:result.content}); 257 var tbodyHtml = template('sectionInfo_list_table_temp',{list:result.content});
269 // 把渲染好的模版html文本追加到表格中 258 // 把渲染好的模版html文本追加到表格中
270 - $('#datatable_line tbody').html(tbodyHtml); 259 + $('#datatable_setion tbody').html(tbodyHtml);
271 // 是重新分页且返回数据长度大于0 260 // 是重新分页且返回数据长度大于0
272 if(isPon && result.content.length > 0){ 261 if(isPon && result.content.length > 0){
273 // 重新分页 262 // 重新分页
src/main/resources/static/pages/base/section/list.html
@@ -28,19 +28,22 @@ @@ -28,19 +28,22 @@
28 </div> 28 </div>
29 <div class="portlet-body"> 29 <div class="portlet-body">
30 <div class="table-container" style="margin-top: 10px"> 30 <div class="table-container" style="margin-top: 10px">
31 - <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_line"> 31 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_setion">
32 <thead> 32 <thead>
33 <tr role="row" class="heading"> 33 <tr role="row" class="heading">
34 <th width="2%">#</th> 34 <th width="2%">#</th>
35 <th width="4%">线路编号</th> 35 <th width="4%">线路编号</th>
36 - <th width="14%">线路名称</th> 36 + <th width="11%">线路名称</th>
37 <th width="6%">线路方向</th> 37 <th width="6%">线路方向</th>
38 - <th width="14%">路段名称</th>  
39 - <th width="6%">路段编码</th> 38 + <th width="11%">路段名称</th>
  39 + <th width="4%">路段编码</th>
40 <th width="4%">路段序号</th> 40 <th width="4%">路段序号</th>
  41 + <th width="4%">路段限速</th>
  42 + <th width="4%">路段长度</th>
  43 + <th width="4%">路段历时</th>
41 <th width="4%">版本号</th> 44 <th width="4%">版本号</th>
42 <th width="6%">是否撤销</th> 45 <th width="6%">是否撤销</th>
43 - <th width="8%">操作</th> 46 + <th width="9%">操作</th>
44 </tr> 47 </tr>
45 <tr role="row" class="filter"> 48 <tr role="row" class="filter">
46 <td></td> 49 <td></td>
@@ -68,6 +71,15 @@ @@ -68,6 +71,15 @@
68 <input type="text" class="form-control form-filter input-sm" name="sectionrouteCode_eq"> 71 <input type="text" class="form-control form-filter input-sm" name="sectionrouteCode_eq">
69 </td> 72 </td>
70 <td> 73 <td>
  74 + <input type="text" class="form-control form-filter input-sm" name="section.speedLimit_eq">
  75 + </td>
  76 + <td>
  77 + <input type="text" class="form-control form-filter input-sm" name="section.sectionDistance_eq">
  78 + </td>
  79 + <td>
  80 + <input type="text" class="form-control form-filter input-sm" name="section.sectionTime_eq">
  81 + </td>
  82 + <td>
71 <input type="text" class="form-control form-filter input-sm" name="versions_eq"> 83 <input type="text" class="form-control form-filter input-sm" name="versions_eq">
72 </td> 84 </td>
73 <td> 85 <td>
@@ -127,6 +139,15 @@ @@ -127,6 +139,15 @@
127 {{obj.sectionrouteCode}} 139 {{obj.sectionrouteCode}}
128 </td> 140 </td>
129 <td> 141 <td>
  142 + {{obj.speedLimit}}
  143 + </td>
  144 + <td>
  145 + {{obj.sectionDistance}}
  146 + </td>
  147 + <td>
  148 + {{obj.sectionTime}}
  149 + </td>
  150 + <td>
130 {{obj.versions}} 151 {{obj.versions}}
131 </td> 152 </td>
132 <td> 153 <td>
@@ -143,7 +164,7 @@ @@ -143,7 +164,7 @@
143 {{/each}} 164 {{/each}}
144 {{if list.length == 0}} 165 {{if list.length == 0}}
145 <tr> 166 <tr>
146 - <td colspan=10><h6 class="muted">没有找到相关数据</h6></td> 167 + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td>
147 </tr> 168 </tr>
148 {{/if}} 169 {{/if}}
149 </script> 170 </script>
src/main/resources/static/pages/base/station/edit.html
1 <!-- 编辑站点弹出层mobal --> 1 <!-- 编辑站点弹出层mobal -->
2 <div class="modal fade" id="editPoitsions_station_mobal" tabindex="-1" role="basic" aria-hidden="true"> 2 <div class="modal fade" id="editPoitsions_station_mobal" tabindex="-1" role="basic" aria-hidden="true">
3 -  
4 <div class="modal-dialog"> 3 <div class="modal-dialog">
5 <div class="modal-content"> 4 <div class="modal-content">
6 -  
7 <!-- 弹出层标题title容器 --> 5 <!-- 弹出层标题title容器 -->
8 <div class="modal-header"> 6 <div class="modal-header">
9 <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> 7 <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
10 - <h4 class="modal-title">编辑站点</h4> 8 + <h4 class="modal-title">站点修改</h4>
11 </div> 9 </div>
12 -  
13 <!-- 弹出层主体内容容器 --> 10 <!-- 弹出层主体内容容器 -->
14 <div class="modal-body"> 11 <div class="modal-body">
15 -  
16 <!-- START FORM 表单容器 --> 12 <!-- START FORM 表单容器 -->
17 <form class="form-horizontal" role="form" id="edit_station_form" action="/module" method="post"> 13 <form class="form-horizontal" role="form" id="edit_station_form" action="/module" method="post">
18 -  
19 <!-- 表单错误提示信息容器 --> 14 <!-- 表单错误提示信息容器 -->
20 <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> 15 <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button>
21 您的输入有误,请检查下面的输入项 16 您的输入有误,请检查下面的输入项
22 </div> 17 </div>
23 -  
24 <!-- 站点ID --> 18 <!-- 站点ID -->
25 <input type="hidden" name="stationId" id="stationIdInput"> 19 <input type="hidden" name="stationId" id="stationIdInput">
26 -  
27 <!-- 站点路由ID --> 20 <!-- 站点路由ID -->
28 <input type="hidden" name="stationRouteId" id="stationRouteIdInput"> 21 <input type="hidden" name="stationRouteId" id="stationRouteIdInput">
29 -  
30 <!-- 线路ID --> 22 <!-- 线路ID -->
31 <input type="hidden" name="stationRouteLine" id="stationRouteLineInput"> 23 <input type="hidden" name="stationRouteLine" id="stationRouteLineInput">
32 -  
33 <!-- 线路编码 --> 24 <!-- 线路编码 -->
34 <input type="hidden" name="lineCode" id="lineCodeInput"> 25 <input type="hidden" name="lineCode" id="lineCodeInput">
35 -  
36 <!-- 图形坐标点集合(百度坐标) --> 26 <!-- 图形坐标点集合(百度坐标) -->
37 <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" /> 27 <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" />
38 -  
39 -  
40 <input type="hidden" name="gJwpoints" id="gJwpointsInput"> 28 <input type="hidden" name="gJwpoints" id="gJwpointsInput">
41 -  
42 <!-- 图形坐标点集合(WGS坐标) --> 29 <!-- 图形坐标点集合(WGS坐标) -->
43 <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" /> 30 <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" />
44 -  
45 <!-- 原始坐标类型 --> 31 <!-- 原始坐标类型 -->
46 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> 32 <input type="hidden" name="dbType" id="dbTypeInput" value="b"/>
47 -  
48 <!-- 城建坐标x --> 33 <!-- 城建坐标x -->
49 <input type="hidden" name="x" id="xInput" value=""/> 34 <input type="hidden" name="x" id="xInput" value=""/>
50 -  
51 <!-- 城建坐标y --> 35 <!-- 城建坐标y -->
52 <input type="hidden" name="y" id="yInput" value=""/> 36 <input type="hidden" name="y" id="yInput" value=""/>
53 -  
54 <!-- 站点名称 --> 37 <!-- 站点名称 -->
55 <div class="form-body"> 38 <div class="form-body">
56 <div class="form-group"> 39 <div class="form-group">
57 <label class="control-label col-md-3"> 40 <label class="control-label col-md-3">
58 - <span class="required"> * </span> 站点名称: 41 + <span class="required"> * </span> 站点路由名称:
59 </label> 42 </label>
60 <div class="col-md-6"> 43 <div class="col-md-6">
61 - <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称"> 44 + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点路由名称">
62 </div> 45 </div>
63 </div> 46 </div>
64 </div> 47 </div>
65 -  
66 <!-- 站点编码 --> 48 <!-- 站点编码 -->
67 <div class="form-body"> 49 <div class="form-body">
68 <div class="form-group"> 50 <div class="form-group">
69 <label class="control-label col-md-3"> 51 <label class="control-label col-md-3">
70 - <span class="required"> * </span>站点编码 52 + <span class="required"> * </span>站点编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
71 </label> 53 </label>
72 <div class="col-md-6"> 54 <div class="col-md-6">
73 - <input type="text" class="form-control" name="stationCod" id="stationCodInput" placeholder="站点编码"> 55 + <input type="text" class="form-control" name="stationCod" id="stationCodInput" placeholder="站点编码" readonly="readonly">
74 </div> 56 </div>
75 </div> 57 </div>
76 </div> 58 </div>
77 -  
78 - <!-- 站点序号 --> 59 + <!-- 站点方向 -->
79 <div class="form-body"> 60 <div class="form-body">
80 <div class="form-group"> 61 <div class="form-group">
81 <label class="control-label col-md-3"> 62 <label class="control-label col-md-3">
82 - <span class="required"> * </span>上一站点: 63 + <span class="required"> * </span>站点方向&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
83 </label> 64 </label>
84 <div class="col-md-6"> 65 <div class="col-md-6">
85 - <select name="stationRouteCode" class="form-control" id="stationrouteSelect"></select>  
86 - <span class="help-block"> *说明:选择的站点将作为本站序号的参考,成为选择站点的下一站。 </span> 66 + <select name="directions" class="form-control" id="stationdirSelect">
  67 + <option value="">-- 请选择站点类型 --</option>
  68 + <option value="0">上行</option>
  69 + <option value="1">下行</option>
  70 + </select>
87 </div> 71 </div>
88 </div> 72 </div>
89 </div> 73 </div>
90 -  
91 - <!-- 站点类型 --> 74 + <!-- 站点序号 -->
92 <div class="form-body"> 75 <div class="form-body">
93 <div class="form-group"> 76 <div class="form-group">
94 <label class="control-label col-md-3"> 77 <label class="control-label col-md-3">
95 - <span class="required"> * </span>站点类型: 78 + 上一站点&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
96 </label> 79 </label>
97 <div class="col-md-6"> 80 <div class="col-md-6">
98 - <select name="stationMark" class="form-control" id="stationMarkSelect">  
99 - <option value="">-- 请选择站点类型 --</option>  
100 - <option value="B">起点站</option>  
101 - <option value="Z">中途站</option>  
102 - <option value="E">终点站</option>  
103 - </select> 81 + <select name="stationRouteCode" class="form-control" id="stationrouteSelect" style="width:100%"></select>
  82 + <span class="help-block">说明:选择的站点将作为本站序号的参考,成为选择站点的下一站。 </span>
104 </div> 83 </div>
105 </div> 84 </div>
106 </div> 85 </div>
107 -  
108 - <!-- 站点方向 --> 86 + <!-- 站点类型 -->
109 <div class="form-body"> 87 <div class="form-body">
110 <div class="form-group"> 88 <div class="form-group">
111 <label class="control-label col-md-3"> 89 <label class="control-label col-md-3">
112 - <span class="required"> * </span>站点方向: 90 + <span class="required"> * </span>站点类型&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
113 </label> 91 </label>
114 <div class="col-md-6"> 92 <div class="col-md-6">
115 - <select name="directions" class="form-control" id="stationdirSelect"> 93 + <select name="stationMark" class="form-control" id="stationMarkSelect">
116 <option value="">-- 请选择站点类型 --</option> 94 <option value="">-- 请选择站点类型 --</option>
117 - <option value="0">上行</option>  
118 - <option value="1">下行</option> 95 + <option value="B">起点站</option>
  96 + <option value="Z">中途站</option>
  97 + <option value="E">终点站</option>
119 </select> 98 </select>
120 </div> 99 </div>
121 </div> 100 </div>
122 </div> 101 </div>
123 -  
124 - <!-- 道路编码--> 102 + <!-- 经纬度坐标点 -->
125 <div class="form-body"> 103 <div class="form-body">
126 <div class="form-group"> 104 <div class="form-group">
127 - <label class="control-label col-md-3">道路编码:</label> 105 + <label class="col-md-3 control-label"><span class="required"> * </span>经纬度坐标点:</label>
128 <div class="col-md-6"> 106 <div class="col-md-6">
129 - <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码"> 107 + <input type="text" class="form-control" name="bJwpoints" id="bJwpointsInput" placeholder="经纬度坐标点" readonly="readonly">
130 </div> 108 </div>
131 </div> 109 </div>
132 </div> 110 </div>
133 -  
134 - <!-- 中心位置坐标点 --> 111 + <!-- 几何图形类型 -->
135 <div class="form-body"> 112 <div class="form-body">
136 <div class="form-group"> 113 <div class="form-group">
137 - <label class="col-md-3 control-label">经纬度坐标点:</label> 114 + <label class="col-md-3 control-label"><span class="required"> * </span>几何图形类型:</label>
138 <div class="col-md-6"> 115 <div class="col-md-6">
139 - <input type="text" class="form-control" name="bJwpoints" id="bJwpointsInput" placeholder="经纬度坐标点"> 116 + <input type="text" class="form-control" name="shapesType" id="shapesTypeSelect" placeholder="范围图形类型" readonly="readonly">
140 </div> 117 </div>
141 </div> 118 </div>
142 </div> 119 </div>
143 -  
144 - <!-- 站点WGS经纬度 -->  
145 - <!-- <div class="form-body"> 120 + <!-- 圆形半径 -->
  121 + <div class="form-body" id="radiusGroup">
146 <div class="form-group"> 122 <div class="form-group">
147 - <label class="col-md-3 control-label">站点WGS经纬度:</label> 123 + <label class="col-md-3 control-label"><span class="required"> * </span>圆形半径&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
148 <div class="col-md-6"> 124 <div class="col-md-6">
149 - <input type="text" class="form-control" name="gJwpoints" id="gJwpointsInput" placeholder="站点WGS经纬度"> 125 + <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="圆形半径">
150 </div> 126 </div>
151 </div> 127 </div>
152 - </div> -->  
153 -  
154 - <!-- 范围图形类型 --> 128 + </div>
  129 + <!-- 是否撤销 -->
155 <div class="form-body"> 130 <div class="form-body">
156 <div class="form-group"> 131 <div class="form-group">
157 - <label class="col-md-3 control-label">范围图形类型:</label> 132 + <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
158 <div class="col-md-6"> 133 <div class="col-md-6">
159 - <select name="shapesType" class="form-control" id="shapesTypeSelect">  
160 - <option value="">-- 请选择站点类型 --</option>  
161 - <option value="r">圆形</option>  
162 - <option value="d">多变形</option> 134 + <select name="destroy" class="form-control" id="destroySelect">
  135 + <option value="">-- 请选择撤销类型 --</option>
  136 + <option value="0">否</option>
  137 + <option value="1">是</option>
163 </select> 138 </select>
164 </div> 139 </div>
165 </div> 140 </div>
166 </div> 141 </div>
167 -  
168 - <!-- 范围图形类型 --> 142 + <!-- 道路编码-->
169 <div class="form-body"> 143 <div class="form-body">
170 <div class="form-group"> 144 <div class="form-group">
171 - <label class="col-md-3 control-label">圆形半径:</label> 145 + <label class="control-label col-md-3">道路编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
172 <div class="col-md-6"> 146 <div class="col-md-6">
173 - <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="圆形半径"> 147 + <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码">
174 </div> 148 </div>
175 </div> 149 </div>
176 </div> 150 </div>
177 -  
178 <!-- 到站时间 --> 151 <!-- 到站时间 -->
179 <div class="form-body"> 152 <div class="form-body">
180 <div class="form-group"> 153 <div class="form-group">
181 - <label class="col-md-3 control-label">到站时间</label> 154 + <label class="col-md-3 control-label">到站时间&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
182 <div class="col-md-6"> 155 <div class="col-md-6">
183 <input type="text" class="form-control" name="toTime" id="toTimeInput" placeholder="到站时间"> 156 <input type="text" class="form-control" name="toTime" id="toTimeInput" placeholder="到站时间">
184 - <span class="help-block">单位:分钟</span> 157 + <span class="help-block">单位:分钟(min)</span>
185 </div> 158 </div>
186 </div> 159 </div>
187 </div> 160 </div>
188 -  
189 <!-- 到站距离 --> 161 <!-- 到站距离 -->
190 <div class="form-body"> 162 <div class="form-body">
191 <div class="form-group"> 163 <div class="form-group">
192 - <label class="col-md-3 control-label">到站距离</label> 164 + <label class="col-md-3 control-label">到站距离&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
193 <div class="col-md-6"> 165 <div class="col-md-6">
194 <input type="text" class="form-control" name="distances" id="distancesInput" placeholder="到站距离"> 166 <input type="text" class="form-control" name="distances" id="distancesInput" placeholder="到站距离">
195 - <span class="help-block">单位:公里</span> 167 + <span class="help-block">单位:公里(km)</span>
196 </div> 168 </div>
197 </div> 169 </div>
198 </div> 170 </div>
199 -  
200 <!-- 版本号 --> 171 <!-- 版本号 -->
201 <div class="form-body"> 172 <div class="form-body">
202 <div class="form-group"> 173 <div class="form-group">
203 - <label class="col-md-3 control-label">版本号</label> 174 + <label class="col-md-3 control-label">版本号&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
204 <div class="col-md-6"> 175 <div class="col-md-6">
205 <input type="text" class="form-control" name="versions" value='1' Readonly> 176 <input type="text" class="form-control" name="versions" value='1' Readonly>
206 </div> 177 </div>
207 </div> 178 </div>
208 </div> 179 </div>
209 -  
210 - <!-- 范围图形类型 -->  
211 - <div class="form-body">  
212 - <div class="form-group">  
213 - <label class="col-md-3 control-label">是否撤销:</label>  
214 - <div class="col-md-6">  
215 - <select name="destroy" class="form-control" id="destroySelect">  
216 - <option value="">-- 请选择撤销类型 --</option>  
217 - <option value="0">否</option>  
218 - <option value="1">是</option>  
219 - </select>  
220 - </div>  
221 - </div>  
222 - </div>  
223 -  
224 <!-- 描述/说明 --> 180 <!-- 描述/说明 -->
225 <div class="form-group"> 181 <div class="form-group">
226 - <label class="control-label col-md-3"> 描述/说明 </label> 182 + <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
227 <div class="col-md-6"> 183 <div class="col-md-6">
228 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> 184 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
229 </div> 185 </div>
230 </div> 186 </div>
231 -  
232 </form> 187 </form>
233 -  
234 <!-- END FORM --> 188 <!-- END FORM -->
235 </div> 189 </div>
236 -  
237 <!-- 表单操作按钮容器 --> 190 <!-- 表单操作按钮容器 -->
238 <div class="modal-footer"> 191 <div class="modal-footer">
239 <button type="button" class="btn default" data-dismiss="modal">取消</button> 192 <button type="button" class="btn default" data-dismiss="modal">取消</button>
@@ -244,312 +197,159 @@ @@ -244,312 +197,159 @@
244 </div> 197 </div>
245 </div> 198 </div>
246 <script type="text/javascript"> 199 <script type="text/javascript">
247 -  
248 $('#editPoitsions_station_mobal').on('editStationMobal_show', function(e, map,fun,stat){ 200 $('#editPoitsions_station_mobal').on('editStationMobal_show', function(e, map,fun,stat){
249 -  
250 // 获取站点对象信息 201 // 获取站点对象信息
251 var editStation = stat.getAddStation(); 202 var editStation = stat.getAddStation();
252 -  
253 // 初始化表单值 203 // 初始化表单值
254 fun.setFormValue(editStation); 204 fun.setFormValue(editStation);
255 -  
256 - // 方向  
257 - var edit_direction_v = editStation.stationRoutedirections;  
258 -  
259 - // 线路ID  
260 - var lineId = editStation.stationRouteLine;  
261 -  
262 - // 获取站点序号元素,并添加下拉属性值  
263 - fun.getStation(lineId,edit_direction_v,function(treeData) {  
264 -  
265 - var options = '<option value="">请选择...</option>';  
266 -  
267 - var dArray = treeData[0].children[0].children;  
268 -  
269 - var eq_stationRouteCode = editStation.stationRouteCode + '_' + editStation.stationRouteStationMark;  
270 -  
271 - for(var i = 0 ; i<dArray.length; i++){  
272 -  
273 - var ptions_v = dArray[i].stationRouteStationRouteCode+ '_'+ dArray[i].stationRouteStationMark;  
274 -  
275 - // 排除本站  
276 - if(eq_stationRouteCode == ptions_v){  
277 -  
278 - continue;  
279 -  
280 - }  
281 -  
282 - options += '<option value="'+ ptions_v +'">'+dArray[i].stationRouteStationName+'</option>'  
283 -  
284 - }  
285 -  
286 - $('#stationrouteSelect').html(options);  
287 -  
288 - fun.findUpStationRouteCode(lineId,edit_direction_v,editStation.stationRouteCode,function(str) {  
289 -  
290 - if(str.length>0){  
291 -  
292 - var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke;  
293 -  
294 - $('#stationrouteSelect').val(upStationRouteCode);  
295 -  
296 - }  
297 -  
298 - });  
299 -  
300 - });  
301 - 205 + var initzdlyP = {'lineCode_eq':editStation.stationRouteLIneCode,'destroy_eq':0,'directions_eq':editStation.stationRoutedirections};
  206 + initSelect(initzdlyP);
302 // 显示mobal 207 // 显示mobal
303 $('#editPoitsions_station_mobal').modal({show : true,backdrop: 'static',keyboard: false}); 208 $('#editPoitsions_station_mobal').modal({show : true,backdrop: 'static',keyboard: false});
304 -  
305 // 当调用 hide 实例方法时触发 209 // 当调用 hide 实例方法时触发
306 $('#editPoitsions_station_mobal').on('hide.bs.modal', function () { 210 $('#editPoitsions_station_mobal').on('hide.bs.modal', function () {
307 -  
308 closeMobleSetClean(); 211 closeMobleSetClean();
309 -  
310 }); 212 });
311 -  
312 function closeMobleSetClean() { 213 function closeMobleSetClean() {
313 -  
314 $('#eidt').attr("disabled",false); 214 $('#eidt').attr("disabled",false);
315 -    
316 $('#eidt').removeClass('btn disabled'); 215 $('#eidt').removeClass('btn disabled');
317 -  
318 $('#eidt').addClass('btn'); 216 $('#eidt').addClass('btn');
319 -  
320 // 清除地图覆盖物 217 // 清除地图覆盖物
321 map.clearMarkAndOverlays(); 218 map.clearMarkAndOverlays();
322 -  
323 var stationId = editStation.stationRouteId; 219 var stationId = editStation.stationRouteId;
324 -  
325 fun.initStationInfo(stationId); 220 fun.initStationInfo(stationId);
326 -  
327 } 221 }
328 -  
329 // 编辑表单元素 222 // 编辑表单元素
330 var form = $('#edit_station_form'); 223 var form = $('#edit_station_form');
331 -  
332 // 获取错误提示元素 224 // 获取错误提示元素
333 var error = $('.alert-danger', form); 225 var error = $('.alert-danger', form);
334 -  
335 // 提交数据按钮事件 226 // 提交数据按钮事件
336 $('#editStationButton').on('click', function() { 227 $('#editStationButton').on('click', function() {
337 -  
338 // 表单提交 228 // 表单提交
339 form.submit(); 229 form.submit();
340 -  
341 }); 230 });
342 -  
343 // 表单验证 231 // 表单验证
344 form.validate({ 232 form.validate({
345 -  
346 errorElement : 'span', 233 errorElement : 'span',
347 -  
348 errorClass : 'help-block help-block-error', 234 errorClass : 'help-block help-block-error',
349 -  
350 focusInvalid : false, 235 focusInvalid : false,
351 -  
352 rules : { 236 rules : {
353 -  
354 - // 站点名称  
355 - 'stationName' : {  
356 -  
357 - // 必填项  
358 - required : true  
359 -  
360 - },  
361 -  
362 - // 站点类型  
363 - 'stationMark' : {  
364 -  
365 - // 必填项  
366 - required : true  
367 -  
368 - },  
369 -  
370 - // 站点序号  
371 - 'stationRouteCode' : {  
372 -  
373 - isStart : true  
374 -  
375 - },  
376 -  
377 - // 站点编码  
378 - 'stationCod': {  
379 -  
380 - // 必填项  
381 - required : true,  
382 -  
383 - // 必须输入合法的数字(负数,小数)。  
384 - number : true  
385 -  
386 - },  
387 -  
388 - // 站点方向  
389 - 'directions' : {  
390 -  
391 - // 必填项  
392 - required : true,  
393 -  
394 - // 方向选择限制  
395 - dirIs : true  
396 -  
397 - },  
398 -  
399 - // 到站距离  
400 - 'distances' : {  
401 -  
402 - // 必须输入合法的数字(负数,小数)。  
403 - number : true  
404 -  
405 - },  
406 -  
407 - // 到站时间  
408 - 'toTime' : {  
409 -  
410 - // 必须输入合法的数字(负数,小数)。  
411 - number : true  
412 -  
413 - },  
414 -  
415 - // 描述与说明  
416 - 'descriptions' : {  
417 -  
418 - // 最大长度  
419 - maxlength: 150  
420 -  
421 - } 237 + 'stationName' : {required : true},// 站点路由名称 必填项
  238 + 'stationCod': {required : true,},// 站点编码 必填项
  239 + 'directions' : {required : true,dirIs : true},// 站点方向 必填项 必填项
  240 + 'stationRouteCode' : {isStart : true},// 站点序号
  241 + 'stationMark' : {required : true},// 站点类型 必填项
  242 + 'bJwpoints' : {required : true},// 经纬度坐标点 必填项
  243 + 'shapesType' : {required : true},// 几何图形类型 必填项
  244 + 'radius' : {required : true},// 圆形半径 必填项
  245 + 'destroy' : {required : true},// 是否撤销 必填项
  246 + 'toTime' : {number : true},// 到站时间 必须输入合法的数字(负数,小数)。
  247 + 'distances' : {number : true},// 到站距离 // 到站距离
  248 + 'descriptions' : {maxlength: 150}// 描述与说明 最大长度
422 }, 249 },
423 -  
424 invalidHandler : function(event, validator) { 250 invalidHandler : function(event, validator) {
425 -  
426 error.show(); 251 error.show();
427 -  
428 App.scrollTo(error, -200); 252 App.scrollTo(error, -200);
429 -  
430 }, 253 },
431 -  
432 highlight : function(element) { 254 highlight : function(element) {
433 -  
434 $(element).closest('.form-group').addClass('has-error'); 255 $(element).closest('.form-group').addClass('has-error');
435 -  
436 }, 256 },
437 -  
438 unhighlight : function(element) { 257 unhighlight : function(element) {
439 -  
440 $(element).closest('.form-group').removeClass('has-error'); 258 $(element).closest('.form-group').removeClass('has-error');
441 -  
442 }, 259 },
443 -  
444 success : function(label) { 260 success : function(label) {
445 -  
446 label.closest('.form-group').removeClass('has-error'); 261 label.closest('.form-group').removeClass('has-error');
447 -  
448 }, 262 },
449 -  
450 submitHandler : function(f) { 263 submitHandler : function(f) {
451 -  
452 - var params = form.serializeJSON();  
453 -  
454 error.hide(); 264 error.hide();
455 -  
456 - console.log(params);  
457 - 265 + var params = form.serializeJSON();
  266 + if(params.shapesType=='圆形')
  267 + params.shapesType = 'r';
  268 + else if(params.shapesType=='多边形')
  269 + params.shapesType = 'd';
458 fun.stationUpdate(params,function(resuntDate) { 270 fun.stationUpdate(params,function(resuntDate) {
459 -  
460 if(resuntDate.status=='SUCCESS') { 271 if(resuntDate.status=='SUCCESS') {
461 -  
462 // 弹出添加成功提示消息 272 // 弹出添加成功提示消息
463 layer.msg('修改成功...'); 273 layer.msg('修改成功...');
464 -  
465 }else { 274 }else {
466 -  
467 // 弹出添加失败提示消息 275 // 弹出添加失败提示消息
468 layer.msg('修改失败...'); 276 layer.msg('修改失败...');
469 -  
470 } 277 }
471 -  
472 // 隐藏弹出层mobal 278 // 隐藏弹出层mobal
473 $('#editPoitsions_station_mobal').modal('hide'); 279 $('#editPoitsions_station_mobal').modal('hide');
474 -  
475 closeMobleSetClean(); 280 closeMobleSetClean();
476 -  
477 - // 刷新站点数据  
478 - /* PublicFunctions.clearRefresh(); */  
479 }); 281 });
480 } 282 }
481 }); 283 });
482 -  
483 // 站点序号值改变事件 284 // 站点序号值改变事件
484 $('#stationrouteSelect').on('change',function() { 285 $('#stationrouteSelect').on('change',function() {
485 -  
486 var stationRValue = $('#stationrouteSelect').val(); 286 var stationRValue = $('#stationrouteSelect').val();
487 -  
488 if(stationRValue) { 287 if(stationRValue) {
489 -  
490 var tempStr = stationRValue.split('_'); 288 var tempStr = stationRValue.split('_');
491 -  
492 if(tempStr[1] == 'E') { 289 if(tempStr[1] == 'E') {
493 -  
494 $('#stationMarkSelect').val('E'); 290 $('#stationMarkSelect').val('E');
495 -  
496 }else { 291 }else {
497 -  
498 $('#stationMarkSelect').val('Z'); 292 $('#stationMarkSelect').val('Z');
499 -  
500 } 293 }
501 -  
502 } 294 }
503 -  
504 }); 295 });
505 -  
506 - 296 + function initSelect(p){
  297 + fun.getzdlyInfo(p,function(array) {
  298 + // 定义路段路由长度、渲染拼音检索下拉框格式数据.
  299 + var len_ = array.length,paramsD = new Array();
  300 + if(len_>0) {
  301 + paramsD.push({'id':'请选择...','text':'请选择...'});
  302 + // 遍历.
  303 + $.each(array, function(i, g){
  304 + // 判断.
  305 + if(g.name!='' || g.name != null) {
  306 + if(g.stationRouteCode != editStation.stationRouteCode) {
  307 + // 添加拼音检索下拉框格式数据数组.
  308 + paramsD.push({'id':g.stationRouteCode + '_' + g.stationMark + '_' + g.directions,
  309 + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)});
  310 + }
  311 + }
  312 + });
  313 + $('#stationrouteSelect').empty();
  314 + // 初始化上一个路段拼音检索下拉框.
  315 + initPinYinSelect2($('#stationrouteSelect'),paramsD,function(selector) {
  316 + setZdlyValue();
  317 + });
  318 + }
  319 + });
  320 + }
  321 + function setZdlyValue() {
  322 + fun.findUpStationRouteCode(editStation.stationRouteLine,editStation.stationRoutedirections,editStation.stationRouteCode,function(str) {
  323 + if(str.length>0){
  324 + var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStation.stationRoutedirections;
  325 + $('#stationrouteSelect').select2('val',upStationRouteCode);
  326 + }
  327 + });
  328 + }
507 // 当站点类型为中途站或者终点站时,上一站点为必填项! 329 // 当站点类型为中途站或者终点站时,上一站点为必填项!
508 $.validator.addMethod("isStart", function(value,element) { 330 $.validator.addMethod("isStart", function(value,element) {
509 -  
510 var tel = false; 331 var tel = false;
511 -  
512 var stationMarkV = $('#stationMarkSelect').val(); 332 var stationMarkV = $('#stationMarkSelect').val();
513 -  
514 var stationrouteSelectV = $('#stationrouteSelect').val(); 333 var stationrouteSelectV = $('#stationrouteSelect').val();
515 -  
516 if(stationMarkV =='B'){ 334 if(stationMarkV =='B'){
517 -  
518 tel = true; 335 tel = true;
519 -  
520 return tel; 336 return tel;
521 -  
522 }else if(stationMarkV =='Z' || stationMarkV =='E'){ 337 }else if(stationMarkV =='Z' || stationMarkV =='E'){
523 -  
524 -  
525 - if(stationrouteSelectV!=''){  
526 - 338 + if(stationrouteSelectV!='' && stationrouteSelectV!='请选择...' && stationrouteSelectV!=null){
527 tel = true; 339 tel = true;
528 -  
529 return tel; 340 return tel;
530 -  
531 } 341 }
532 -  
533 } 342 }
534 -  
535 return tel; 343 return tel;
536 }, '当站点类型为中途站或者终点站时,上一站点为必填项!'); 344 }, '当站点类型为中途站或者终点站时,上一站点为必填项!');
537 -  
538 // 方向 345 // 方向
539 $.validator.addMethod("dirIs", function(value,element) { 346 $.validator.addMethod("dirIs", function(value,element) {
540 -  
541 var tel = true; 347 var tel = true;
542 -  
543 var stationMarkV = $('#stationdirSelect').val(); 348 var stationMarkV = $('#stationdirSelect').val();
544 -  
545 if(stationMarkV!=editStation.stationRoutedirections){ 349 if(stationMarkV!=editStation.stationRoutedirections){
546 -  
547 tel = false; 350 tel = false;
548 -  
549 } 351 }
550 -  
551 return tel; 352 return tel;
552 }, '方向必须一致!'); 353 }, '方向必须一致!');
553 -  
554 }); 354 });
555 </script> 355 </script>
556 \ No newline at end of file 356 \ No newline at end of file
src/main/resources/static/pages/base/station/edit_select.html
1 <!-- 选择编辑站点方式弹出层mobal --> 1 <!-- 选择编辑站点方式弹出层mobal -->
2 <div class="modal fade" id="editPositions_select_mobal" tabindex="-1" role="basic" aria-hidden="true"> 2 <div class="modal fade" id="editPositions_select_mobal" tabindex="-1" role="basic" aria-hidden="true">
3 -  
4 <div class="modal-dialog"> 3 <div class="modal-dialog">
5 -  
6 - <div class="modal-content">  
7 - 4 + <div class="modal-content" style="width: 700px;">
8 <!-- 弹出层标题title容器 --> 5 <!-- 弹出层标题title容器 -->
9 <div class="modal-header"> 6 <div class="modal-header">
10 <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> 7 <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
11 - <h4 class="modal-title">选择修改站点方式</h4> 8 + <h4 class="modal-title">选择修改站点方式
  9 + <i class="fa fa-question-circle tipso-animation" style="color: rgba(158, 158, 158, 0.49);"></i>
  10 + </h4>
12 </div> 11 </div>
13 -  
14 <!-- 弹出层主体内容容器 --> 12 <!-- 弹出层主体内容容器 -->
15 <div class="modal-body"> 13 <div class="modal-body">
16 -  
17 <!-- START FORM 表单容器 --> 14 <!-- START FORM 表单容器 -->
18 <form class="form-horizontal" action="/" method="post" id="edit_select" role="form"> 15 <form class="form-horizontal" action="/" method="post" id="edit_select" role="form">
19 -  
20 <!-- 表单错误提示容器 --> 16 <!-- 表单错误提示容器 -->
21 <div class="alert alert-danger display-hide" id="editSelectrequired"> 17 <div class="alert alert-danger display-hide" id="editSelectrequired">
22 <button class="close" data-close="alert"></button> 18 <button class="close" data-close="alert"></button>
23 站点名称为必填项 19 站点名称为必填项
24 </div> 20 </div>
25 -  
26 <!-- 站点名称容器 --> 21 <!-- 站点名称容器 -->
27 <div class="form-group" id="formRequ"> 22 <div class="form-group" id="formRequ">
28 - <label class="col-md-3 control-label"><span class="required"> * </span>站点名称</label> 23 + <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label>
29 <div class="col-md-9" id="errorInfo"> 24 <div class="col-md-9" id="errorInfo">
30 <input type="text" class="form-control input-medium" id="stationNamebootboxInput" name="stationNamebootbox"> 25 <input type="text" class="form-control input-medium" id="stationNamebootboxInput" name="stationNamebootbox">
31 </div> 26 </div>
32 </div> 27 </div>
33 -  
34 <!-- 修改方式容器 --> 28 <!-- 修改方式容器 -->
35 <div class="form-group"> 29 <div class="form-group">
36 - <label class="col-md-3 control-label">修改方式:</label> 30 + <label class="col-md-3 control-label"><span class="required"> * </span>修改方式:</label>
37 <div class="col-md-9"> 31 <div class="col-md-9">
38 <div class="icheck-list"> 32 <div class="icheck-list">
39 <label> 33 <label>
@@ -42,167 +36,109 @@ @@ -42,167 +36,109 @@
42 <label> 36 <label>
43 <input type="radio" class="icheck" name="editselect" value=1 checked> 编辑原始位置 37 <input type="radio" class="icheck" name="editselect" value=1 checked> 编辑原始位置
44 </label> 38 </label>
45 - <!-- <label >  
46 - <input type="radio" class="icheck" name="editselect" value=2 > 选择引用  
47 - </label> -->  
48 </div> 39 </div>
49 </div> 40 </div>
50 </div> 41 </div>
51 -  
52 - <!-- 修改方式说明容器 -->  
53 - <div class="form-group">  
54 - <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50">  
55 - <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 修改方式说明: </span></h5>  
56 - <p><span class="help-block" style="color:#1bbc9b;"> a)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span> </p>  
57 - <p><span class="help-block" style="color:#1bbc9b;"> b)编辑原始位置:编辑原始位置与站点信息.</span> </p>  
58 - <!-- <p><span class="help-block" style="color:#1bbc9b;"> c)选择引用:从系统中选择已有的站点进行引用.</span> </p> -->  
59 - </div>  
60 - </div>  
61 </form> 42 </form>
62 -  
63 <!-- END FORM --> 43 <!-- END FORM -->
64 -  
65 </div> 44 </div>
66 -  
67 <!-- 表单操作按钮容器 --> 45 <!-- 表单操作按钮容器 -->
68 <div class="modal-footer"> 46 <div class="modal-footer">
69 <button type="button" class="btn default" data-dismiss="modal">取消</button> 47 <button type="button" class="btn default" data-dismiss="modal">取消</button>
70 <button type="button" class="btn btn-primary" id="editselectStationNextButton">下一步</button> 48 <button type="button" class="btn btn-primary" id="editselectStationNextButton">下一步</button>
71 </div> 49 </div>
72 -  
73 </div> 50 </div>
74 </div> 51 </div>
75 </div> 52 </div>
76 <script type="text/javascript"> 53 <script type="text/javascript">
77 -  
78 $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,drm,fun,statn){ 54 $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,drm,fun,statn){
79 -  
80 var EditStation = statn.getAddStation(); 55 var EditStation = statn.getAddStation();
81 -  
82 // 显示选择修改方式弹出层 56 // 显示选择修改方式弹出层
83 $('#editPositions_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); 57 $('#editPositions_select_mobal').modal({show : true,backdrop: 'static',keyboard: false});
84 - 58 + $('.tipso-animation').tipso({
  59 + speed : 100,
  60 + background : '#0ed0e8',
  61 + color : '#ffffff',
  62 + position :'right',
  63 + width : 380,
  64 + delay : 400,
  65 + animationIn : 'bounceIn',
  66 + animationOut : 'bounceOut',
  67 + offsetX : -485,
  68 + offsetY : -25,
  69 + content :'<span style="display:block; float:left;font-size:x-small">a)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span></br>'+
  70 + '<span style="display:block; float:left;font-size:x-small">b)编辑原始位置:编辑原始位置与站点信息.</span>',
  71 +
  72 + });
  73 + setTimeout(function(){
  74 + $('.tipso-animation').tipso('show');
  75 + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000);
  76 + },500);
85 // 获取站点名称元素并赋值 77 // 获取站点名称元素并赋值
86 $('#stationNamebootboxInput').val(EditStation.stationName); 78 $('#stationNamebootboxInput').val(EditStation.stationName);
87 -  
88 // 定义站点图形类型 79 // 定义站点图形类型
89 var stationShapesTypeV = EditStation.stationShapesType; 80 var stationShapesTypeV = EditStation.stationShapesType;
90 -  
91 // 获取表单元素 81 // 获取表单元素
92 var form = $('#edit_select'); 82 var form = $('#edit_select');
93 -  
94 // 获取错误提示元素 83 // 获取错误提示元素
95 var editSelectrequired = $('#editSelectrequired', form); 84 var editSelectrequired = $('#editSelectrequired', form);
96 -  
97 // 下一步操作事件 85 // 下一步操作事件
98 $('#editselectStationNextButton').on('click', function() { 86 $('#editselectStationNextButton').on('click', function() {
99 -  
100 // 表单提交 87 // 表单提交
101 form.submit(); 88 form.submit();
102 -  
103 }); 89 });
104 -  
105 //form 表单验证 90 //form 表单验证
106 form.validate({ 91 form.validate({
107 -  
108 errorElement : 'span', 92 errorElement : 'span',
109 -  
110 errorClass : 'help-block help-block-error', 93 errorClass : 'help-block help-block-error',
111 -  
112 focusInvalid : false, 94 focusInvalid : false,
113 -  
114 rules : { 95 rules : {
115 -  
116 - 'stationNamebootbox' : {  
117 -  
118 - minlength : 2,  
119 -  
120 - required : true,  
121 -  
122 - maxlength : 10  
123 -  
124 - }  
125 - 96 + 'stationNamebootbox' : {required : true,maxlength : 50}// 站点名称 必填项 最大长度50
126 }, 97 },
127 -  
128 invalidHandler : function(event, validator) { 98 invalidHandler : function(event, validator) {
129 -  
130 editSelectrequired.show(); 99 editSelectrequired.show();
131 -  
132 App.scrollTo(requiredname, -200); 100 App.scrollTo(requiredname, -200);
133 -  
134 }, 101 },
135 -  
136 highlight : function(element) { 102 highlight : function(element) {
137 -  
138 $(element).closest('.form-group').addClass('has-error'); 103 $(element).closest('.form-group').addClass('has-error');
139 -  
140 }, 104 },
141 -  
142 unhighlight : function(element) { 105 unhighlight : function(element) {
143 -  
144 $(element).closest('.form-group').removeClass('has-error'); 106 $(element).closest('.form-group').removeClass('has-error');
145 -  
146 }, 107 },
147 -  
148 success : function(label) { 108 success : function(label) {
149 -  
150 label.closest('.form-group').removeClass('has-error'); 109 label.closest('.form-group').removeClass('has-error');
151 -  
152 }, 110 },
153 -  
154 submitHandler : function(f) { 111 submitHandler : function(f) {
155 -  
156 // 隐藏弹出层 112 // 隐藏弹出层
157 $('#editPositions_select_mobal').modal('hide'); 113 $('#editPositions_select_mobal').modal('hide');
158 -  
159   $('#eidt').attr("disabled",true); 114   $('#eidt').attr("disabled",true);
160 -    
161 $('#eidt').addClass('btn disabled'); 115 $('#eidt').addClass('btn disabled');
162 -  
163 // 表单序列 116 // 表单序列
164 var params = form.serializeJSON(); 117 var params = form.serializeJSON();
165 -  
166 // 站点名称 118 // 站点名称
167 var editStationName = params.stationNamebootbox; 119 var editStationName = params.stationNamebootbox;
168 -  
169 // 设置站点名称 120 // 设置站点名称
170 statn.setEitdStationName(editStationName); 121 statn.setEitdStationName(editStationName);
171 -  
172 var eidtselect_ = params.editselect; 122 var eidtselect_ = params.editselect;
173 -  
174 if(eidtselect_==0){ 123 if(eidtselect_==0){
175 -  
176 // 清除地图覆盖物 124 // 清除地图覆盖物
177 map.clearMarkAndOverlays(); 125 map.clearMarkAndOverlays();
178 -  
179 // 打开绘制工具 126 // 打开绘制工具
180 drm.openDrawingManager(); 127 drm.openDrawingManager();
181 -  
182 // 根据站点位置在地图定位 128 // 根据站点位置在地图定位
183 map.localtionPoint(editStationName); 129 map.localtionPoint(editStationName);
184 -  
185 -  
186 }else if(eidtselect_==1){ 130 }else if(eidtselect_==1){
187 -  
188 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) 131 // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒)
189 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', 132 var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px',
190 shift: 0,time: 10000}); 133 shift: 0,time: 10000});
191 -  
192 // 编辑图形 134 // 编辑图形
193 map.editShapes(stationShapesTypeV,mindex); 135 map.editShapes(stationShapesTypeV,mindex);
194 -  
195 }else if(eidtselect_==2){ 136 }else if(eidtselect_==2){
196 -  
197 // 系统引用 137 // 系统引用
198 $('#editPositions_select_mobal').modal('hide'); 138 $('#editPositions_select_mobal').modal('hide');
199 -  
200 $.get('station_tabledate.html', function(m){$(pjaxContainer).append(m);}); 139 $.get('station_tabledate.html', function(m){$(pjaxContainer).append(m);});
201 -  
202 } 140 }
203 -  
204 } 141 }
205 }); 142 });
206 -  
207 }); 143 });
208 </script> 144 </script>
209 \ No newline at end of file 145 \ No newline at end of file
src/main/resources/static/pages/base/station/js/positionsdrwmager.js
  1 +/**
  2 + * @description : (TODO) 创建鼠标绘制管理类
  3 + *
  4 + * @author bsth@lq
  5 + *
  6 + * @version 1.0
  7 + *
  8 + */
1 var PositionsDrawingManagerObj = function () { 9 var PositionsDrawingManagerObj = function () {
2 -  
3 // 创建鼠标绘制管理类 10 // 创建鼠标绘制管理类
4 var drawingManager = ''; 11 var drawingManager = '';
5 -  
6 var draMangerObj = { 12 var draMangerObj = {
7 -  
8 /** 初始化绘制工具类 */ 13 /** 初始化绘制工具类 */
9 init : function(map,styleOptions) { 14 init : function(map,styleOptions) {
10 -  
11 drawingManager = new BMapLib.DrawingManager(map, { 15 drawingManager = new BMapLib.DrawingManager(map, {
12 -  
13 //是否开启绘制模式 16 //是否开启绘制模式
14 isOpen : false, 17 isOpen : false,
15 -  
16 //是否显示工具栏 18 //是否显示工具栏
17 enableDrawingTool : false, 19 enableDrawingTool : false,
18 -  
19 drawingToolOptions : { 20 drawingToolOptions : {
20 -  
21 //位置 21 //位置
22 anchor : BMAP_ANCHOR_TOP_RIGHT, 22 anchor : BMAP_ANCHOR_TOP_RIGHT,
23 -  
24 //偏离值 23 //偏离值
25 offset : new BMap.Size(5, 5), 24 offset : new BMap.Size(5, 5),
26 -  
27 //工具栏缩放比例 25 //工具栏缩放比例
28 scale : 0.8 26 scale : 0.8
29 -  
30 }, 27 },
31 -  
32 //线的样式 28 //线的样式
33 polygonOptions : styleOptions 29 polygonOptions : styleOptions
34 -  
35 }); 30 });
36 31
37 // 添加绘画完成事件 32 // 添加绘画完成事件
38 drawingManager.addEventListener('polygoncomplete', function(e) { 33 drawingManager.addEventListener('polygoncomplete', function(e) {
39 -  
40 drawingManager.close; 34 drawingManager.close;
41 -  
42 if (e.getPath().length <= 2) { 35 if (e.getPath().length <= 2) {
43 -  
44 // 弹出提示消息 36 // 弹出提示消息
45 layer.msg('坐标点不能小于等于两个...'); 37 layer.msg('坐标点不能小于等于两个...');
46 -  
47 // 清除地图覆盖物 38 // 清除地图覆盖物
48 StationPositionsWorldsBMap.clearMarkAndOverlays(); 39 StationPositionsWorldsBMap.clearMarkAndOverlays();
49 -  
50 var addStation = PositionsStationObj.getAddStation(); 40 var addStation = PositionsStationObj.getAddStation();
51 -  
52 var stationId = addStation.stationId; 41 var stationId = addStation.stationId;
53 -  
54 PositionsPublicFunctions.initStationInfo(stationId); 42 PositionsPublicFunctions.initStationInfo(stationId);
55 -  
56 PositionsStationObj.setAddStation({}); 43 PositionsStationObj.setAddStation({});
57 -  
58 return false; 44 return false;
59 -  
60 }else { 45 }else {
61 -  
62 var pointE = e; 46 var pointE = e;
63 -  
64 // 多变行质心点 47 // 多变行质心点
65 var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; 48 var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat;
66 -  
67 var addPolyGonLen_ = pointE.getPath().length; 49 var addPolyGonLen_ = pointE.getPath().length;
68 -  
69 for(var k =0;k<addPolyGonLen_;k++) { 50 for(var k =0;k<addPolyGonLen_;k++) {
70 -  
71 if(k==0) { 51 if(k==0) {
72 -  
73 bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; 52 bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat;
74 -  
75 }else { 53 }else {
76 -  
77 bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; 54 bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat;
78 -  
79 } 55 }
80 -  
81 } 56 }
82 -  
83 bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat; 57 bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat;
84 -  
85 /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ 58 /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
86 PositionsStationObj.setEitdStationBJwpoints(addSttationPoints_); 59 PositionsStationObj.setEitdStationBJwpoints(addSttationPoints_);
87 -  
88 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ 60 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
89 PositionsStationObj.setEitdStationShapesType('d'); 61 PositionsStationObj.setEitdStationShapesType('d');
90 -  
91 /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ 62 /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
92 PositionsStationObj.setEitdStationRadius(''); 63 PositionsStationObj.setEitdStationRadius('');
93 -  
94 /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ 64 /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
95 PositionsStationObj.setEitdBPolygonGrid(bPloygonGrid); 65 PositionsStationObj.setEitdBPolygonGrid(bPloygonGrid);
96 -  
97 $.get('edit.html', function(m){ 66 $.get('edit.html', function(m){
98 -  
99 $(pjaxContainer).append(m); 67 $(pjaxContainer).append(m);
100 -  
101 $('#editPoitsions_station_mobal').trigger('editStationMobal_show', [StationPositionsWorldsBMap,PositionsPublicFunctions,PositionsStationObj]); 68 $('#editPoitsions_station_mobal').trigger('editStationMobal_show', [StationPositionsWorldsBMap,PositionsPublicFunctions,PositionsStationObj]);
102 -  
103 }); 69 });
104 } 70 }
105 -  
106 }); 71 });
107 -  
108 return drawingManager; 72 return drawingManager;
109 -  
110 }, 73 },
111 -  
112 openDrawingManager : function() { 74 openDrawingManager : function() {
113 -  
114 // 打开鼠标绘画工具 75 // 打开鼠标绘画工具
115 drawingManager.open(); 76 drawingManager.open();
116 -  
117 // 设置属性 77 // 设置属性
118 drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); 78 drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON);
119 -  
120 } 79 }
121 } 80 }
122 -  
123 return draMangerObj; 81 return draMangerObj;
124 -  
125 }(); 82 }();
126 \ No newline at end of file 83 \ No newline at end of file
src/main/resources/static/pages/base/station/js/positionstation.js
1 var PositionsStationObj = function () { 1 var PositionsStationObj = function () {
2 -  
3 /** 定义新增站点对象 */ 2 /** 定义新增站点对象 */
4 var station={}; 3 var station={};
5 -  
6 var stationObj = { 4 var stationObj = {
7 -  
8 /** 获取新增站点集合对象 @return:<station:新增站点对象> */ 5 /** 获取新增站点集合对象 @return:<station:新增站点对象> */
9 getAddStation : function() { 6 getAddStation : function() {
10 -  
11 return station; 7 return station;
12 }, 8 },
13 -  
14 /** 设置新增站点集合对象为空 */ 9 /** 设置新增站点集合对象为空 */
15 setAddStation : function(r) { 10 setAddStation : function(r) {
16 -  
17 station = r; 11 station = r;
18 -  
19 }, 12 },
20 -  
21 /** 设置新增站点集合对象方向属性值 @param:<dir:方向(0:上行;1:下行)> */ 13 /** 设置新增站点集合对象方向属性值 @param:<dir:方向(0:上行;1:下行)> */
22 setAddStationDiraction : function(dir) { 14 setAddStationDiraction : function(dir) {
23 -  
24 station.dir = dir; 15 station.dir = dir;
25 }, 16 },
26 -  
27 /** 设置新增站点集合对象站点名称属性值 @param:<name:站点名称) */ 17 /** 设置新增站点集合对象站点名称属性值 @param:<name:站点名称) */
28 setEitdStationName : function(name) { 18 setEitdStationName : function(name) {
29 -  
30 station.stationName = name; 19 station.stationName = name;
31 -  
32 }, 20 },
33 -  
34 /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ 21 /** 设置新增站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
35 setEitdStationBJwpoints : function(bJwpoints) { 22 setEitdStationBJwpoints : function(bJwpoints) {
36 -  
37 station.stationJwpoints = bJwpoints; 23 station.stationJwpoints = bJwpoints;
38 }, 24 },
39 -  
40 /** 设置新增站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ 25 /** 设置新增站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
41 setEitdStationShapesType : function(shapesType) { 26 setEitdStationShapesType : function(shapesType) {
42 -  
43 station.stationShapesType = shapesType; 27 station.stationShapesType = shapesType;
44 }, 28 },
45 -  
46 /** 设置新增站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ 29 /** 设置新增站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
47 setEitdStationRadius : function(radius) { 30 setEitdStationRadius : function(radius) {
48 -  
49 station.stationRadius = radius; 31 station.stationRadius = radius;
50 }, 32 },
51 -  
52 /** 设置新增站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ 33 /** 设置新增站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
53 setEitdBPolygonGrid : function(bPolygonGrid) { 34 setEitdBPolygonGrid : function(bPolygonGrid) {
54 -  
55 station.stationBPolyonGrid = bPolygonGrid; 35 station.stationBPolyonGrid = bPolygonGrid;
56 } 36 }
57 } 37 }
58 -  
59 return stationObj; 38 return stationObj;
60 -  
61 }(); 39 }();
62 \ No newline at end of file 40 \ No newline at end of file
src/main/resources/static/pages/base/station/js/station-list-table.js
@@ -261,6 +261,7 @@ @@ -261,6 +261,7 @@
261 var i = layer.load(2); 261 var i = layer.load(2);
262 // 异步请求获取表格数据 262 // 异步请求获取表格数据
263 $.get('/stationroute',params,function(result){ 263 $.get('/stationroute',params,function(result){
  264 + console.log(result);
264 // 添加序号 265 // 添加序号
265 result.content.page = page; 266 result.content.page = page;
266 // 把数据填充到模版中 267 // 把数据填充到模版中
src/main/resources/static/pages/base/station/js/station-positions-events.js
1 $(function(){ 1 $(function(){
2 -  
3 // 返回 2 // 返回
4 $('#backUp').on('click',function() { 3 $('#backUp').on('click',function() {
5 -  
6 // 返回list.html页面 4 // 返回list.html页面
7 loadPage('/pages/base/station/list.html'); 5 loadPage('/pages/base/station/list.html');
8 -  
9 }); 6 });
10 -  
11 // 修改上行站点mobal页面 7 // 修改上行站点mobal页面
12 $('.dropdown-menu #eidt').on('click', function(){ 8 $('.dropdown-menu #eidt').on('click', function(){
13 -  
14 $.get('edit_select.html', function(m){ 9 $.get('edit_select.html', function(m){
15 -  
16 $(pjaxContainer).append(m); 10 $(pjaxContainer).append(m);
17 -  
18 $('#editPositions_select_mobal').trigger('editSelectMobal_show', [StationPositionsWorldsBMap,PositionsDrawingManagerObj,PositionsPublicFunctions,PositionsStationObj]); 11 $('#editPositions_select_mobal').trigger('editSelectMobal_show', [StationPositionsWorldsBMap,PositionsDrawingManagerObj,PositionsPublicFunctions,PositionsStationObj]);
19 -  
20 }); 12 });
21 -  
22 }); 13 });
23 -  
24 }); 14 });
25 \ No newline at end of file 15 \ No newline at end of file
src/main/resources/static/pages/base/station/js/station-positions-function.js
@@ -5,46 +5,26 @@ @@ -5,46 +5,26 @@
5 var PositionsPublicFunctions = function () { 5 var PositionsPublicFunctions = function () {
6 6
7 var PubFun = { 7 var PubFun = {
8 -  
9 initStationInfo : function(id) { 8 initStationInfo : function(id) {
10 -  
11 PositionsPublicFunctions.getStationRouteInfo(id,function(r) { 9 PositionsPublicFunctions.getStationRouteInfo(id,function(r) {
12 - 10 + StationPositionsWorldsBMap.clearMarkAndOverlays();
13 var Station = r[0]; 11 var Station = r[0];
14 -  
15 PositionsStationObj.setAddStation(Station); 12 PositionsStationObj.setAddStation(Station);
16 -  
17 var len = r.length; 13 var len = r.length;
18 -  
19 if(len>0) { 14 if(len>0) {
20 -  
21 - console.log(r[0]);  
22 -  
23 var markTypeStr = ''; 15 var markTypeStr = '';
24 -  
25 if(r[0].stationRouteStationMark=='B') { 16 if(r[0].stationRouteStationMark=='B') {
26 -  
27 markTypeStr='起点站'; 17 markTypeStr='起点站';
28 -  
29 }else if(r[0].stationRouteStationMark=='Z') { 18 }else if(r[0].stationRouteStationMark=='Z') {
30 -  
31 markTypeStr ='中途站'; 19 markTypeStr ='中途站';
32 -  
33 -  
34 }else if(r[0].stationRouteStationMark=='E') { 20 }else if(r[0].stationRouteStationMark=='E') {
35 -  
36 markTypeStr='终点站'; 21 markTypeStr='终点站';
37 -  
38 } 22 }
39 -  
40 var stationShapesType = r[0].stationShapesType; 23 var stationShapesType = r[0].stationShapesType;
41 -  
42 // 获取中心坐标点字符串分割 24 // 获取中心坐标点字符串分割
43 var BJwpoints = r[0].stationJwpoints.split(' '); 25 var BJwpoints = r[0].stationJwpoints.split(' ');
44 -  
45 // 中心坐标点 26 // 中心坐标点
46 var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); 27 var point = new BMap.Point(BJwpoints[0], BJwpoints[1]);
47 -  
48 var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ 28 var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+
49 '<span style="color:#DDD;font-size: 15px;">站点名称:' + r[0].stationName + '</span>' + 29 '<span style="color:#DDD;font-size: 15px;">站点名称:' + r[0].stationName + '</span>' +
50 '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + r[0].stationCode + '</span>' + 30 '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + r[0].stationCode + '</span>' +
@@ -58,277 +38,169 @@ var PositionsPublicFunctions = function () { @@ -58,277 +38,169 @@ var PositionsPublicFunctions = function () {
58 '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ 38 '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+
59 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ 39 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+
60 r[0].stationRouteDescriptions +'" >说明/描述:' + r[0].stationRouteDescriptions + '</span>' ; 40 r[0].stationRouteDescriptions +'" >说明/描述:' + r[0].stationRouteDescriptions + '</span>' ;
61 -  
62 // 信息窗口参数属性 41 // 信息窗口参数属性
63 var opts = { 42 var opts = {
64 -  
65 // 信息窗口宽度 43 // 信息窗口宽度
66 width : 200, 44 width : 200,
67 -  
68 // 信息窗口高度 45 // 信息窗口高度
69 height : 450, 46 height : 450,
70 -  
71 // 信息窗位置偏移值。 47 // 信息窗位置偏移值。
72 offset: new BMap.Size(500,80), 48 offset: new BMap.Size(500,80),
73 -  
74 //标题 49 //标题
75 title : '<h4 style="color:#FFFFFF">'+r[0].stationName+'站详情</h4>', 50 title : '<h4 style="color:#FFFFFF">'+r[0].stationName+'站详情</h4>',
76 -  
77 //设置不允许信窗发送短息 51 //设置不允许信窗发送短息
78 enableMessage : false, 52 enableMessage : false,
79 -  
80 //是否开启点击地图关闭信息窗口 53 //是否开启点击地图关闭信息窗口
81 enableCloseOnClick : false, 54 enableCloseOnClick : false,
82 -  
83 // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) 55 // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增)
84 enableAutoPan:true 56 enableAutoPan:true
85 }; 57 };
86 -  
87 if(stationShapesType == 'r') { 58 if(stationShapesType == 'r') {
88 -  
89 // 画圆 59 // 画圆
90 StationPositionsWorldsBMap.pointsCircle(r,point,htm,opts); 60 StationPositionsWorldsBMap.pointsCircle(r,point,htm,opts);
91 -  
92 }else if(stationShapesType == 'd'){ 61 }else if(stationShapesType == 'd'){
93 -  
94 // 画多边形 62 // 画多边形
95 StationPositionsWorldsBMap.pointsPolygon(r,point,htm,opts); 63 StationPositionsWorldsBMap.pointsPolygon(r,point,htm,opts);
96 -  
97 } 64 }
98 -  
99 } 65 }
100 -  
101 }); 66 });
102 }, 67 },
103 -  
104 editSeteditStationParmasValue : function(points,gLonx,gLaty,bPolygonGridValue,gPolygonGridVlaue,shapesTypeValue,radiusValue) { 68 editSeteditStationParmasValue : function(points,gLonx,gLaty,bPolygonGridValue,gPolygonGridVlaue,shapesTypeValue,radiusValue) {
105 -  
106 // 百度地图经纬度坐标中心点 69 // 百度地图经纬度坐标中心点
107 stationObj[0].stationJwpoints = points; 70 stationObj[0].stationJwpoints = points;
108 -  
109 // WGS经度 71 // WGS经度
110 stationObj[0].stationGlonx = gLonx; 72 stationObj[0].stationGlonx = gLonx;
111 -  
112 // WGS经度 73 // WGS经度
113 stationObj[0].stationGlaty = gLaty; 74 stationObj[0].stationGlaty = gLaty;
114 -  
115 // 百度坐标点图形集合 75 // 百度坐标点图形集合
116 stationObj[0].stationGPloyonGrid = gPolygonGridVlaue; 76 stationObj[0].stationGPloyonGrid = gPolygonGridVlaue;
117 -  
118 // WGS坐标点图形集合 77 // WGS坐标点图形集合
119 stationObj[0].stationBPolyonGrid = bPolygonGridValue; 78 stationObj[0].stationBPolyonGrid = bPolygonGridValue;
120 -  
121 // 图形类型 79 // 图形类型
122 stationObj[0].stationShapesType = shapesTypeValue; 80 stationObj[0].stationShapesType = shapesTypeValue;
123 -  
124 // 圆形半径 81 // 圆形半径
125 stationObj[0].stationRadius = radiusValue; 82 stationObj[0].stationRadius = radiusValue;
126 -  
127 }, 83 },
128 -  
129 // 原百度坐标转WGS坐标 84 // 原百度坐标转WGS坐标
130 getFormPointEToWGS: function(points,callback) { 85 getFormPointEToWGS: function(points,callback) {
131 -  
132 // 获取长度 86 // 获取长度
133 var len = points.length; 87 var len = points.length;
134 -  
135 (function(){ 88 (function(){
136 -  
137 if (!arguments.callee.count) { 89 if (!arguments.callee.count) {
138 -  
139 arguments.callee.count = 0; 90 arguments.callee.count = 0;
140 -  
141 } 91 }
142 -  
143 arguments.callee.count++; 92 arguments.callee.count++;
144 -  
145 var index = parseInt(arguments.callee.count) - 1; 93 var index = parseInt(arguments.callee.count) - 1;
146 -  
147 if (index >= len) { 94 if (index >= len) {
148 -  
149 callback && callback(points); 95 callback && callback(points);
150 -  
151 return; 96 return;
152 } 97 }
153 -  
154 var f = arguments.callee; 98 var f = arguments.callee;
155 -  
156 $.ajax({ 99 $.ajax({
157 -  
158 url: 'http://api.zdoz.net/bd2wgs.aspx', 100 url: 'http://api.zdoz.net/bd2wgs.aspx',
159 -  
160 data: {lat: points[index].potion.lat , lng: points[index].potion.lng}, 101 data: {lat: points[index].potion.lat , lng: points[index].potion.lng},
161 -  
162 dataType: 'jsonp', 102 dataType: 'jsonp',
163 -  
164 success: function(r){ 103 success: function(r){
165 -  
166 if(r) { 104 if(r) {
167 -  
168 points[index].WGSpotion = r; 105 points[index].WGSpotion = r;
169 -  
170 } 106 }
171 -  
172 f(); 107 f();
173 } 108 }
174 }); 109 });
175 -  
176 })(); 110 })();
177 -  
178 }, 111 },
179 -  
180 setFormValue : function(stationObj) { 112 setFormValue : function(stationObj) {
181 -  
182 // 站点ID 113 // 站点ID
183 $('#stationIdInput').val(stationObj.stationId); 114 $('#stationIdInput').val(stationObj.stationId);
184 -  
185 // 站点路由ID 115 // 站点路由ID
186 $('#stationRouteIdInput').val(stationObj.stationRouteId); 116 $('#stationRouteIdInput').val(stationObj.stationRouteId);
187 -  
188 // 站点路由线路Id 117 // 站点路由线路Id
189 $('#stationRouteLineInput').val(stationObj.stationRouteLine); 118 $('#stationRouteLineInput').val(stationObj.stationRouteLine);
190 -  
191 // 线路编码 119 // 线路编码
192 $('#lineCodeInput').val(stationObj.stationRouteLIneCode); 120 $('#lineCodeInput').val(stationObj.stationRouteLIneCode);
193 -  
194 // WGS坐标点图形集合 121 // WGS坐标点图形集合
195 $('#bPolygonGridInput').val(stationObj.stationBPolyonGrid); 122 $('#bPolygonGridInput').val(stationObj.stationBPolyonGrid);
196 -  
197 // 获取站点名称元素设值 123 // 获取站点名称元素设值
198 $('#stationNameInput').val(stationObj.stationName); 124 $('#stationNameInput').val(stationObj.stationName);
199 -  
200 // 获取站点编码元素设值 125 // 获取站点编码元素设值
201 $('#stationCodInput').val(stationObj.stationCode); 126 $('#stationCodInput').val(stationObj.stationCode);
202 -  
203 // 获取站点类型元素设值 127 // 获取站点类型元素设值
204 $('#stationMarkSelect').val(stationObj.stationRouteStationMark); 128 $('#stationMarkSelect').val(stationObj.stationRouteStationMark);
205 -  
206 // 获取站点方向元素设值 129 // 获取站点方向元素设值
207 $('#stationdirSelect').val(stationObj.stationRoutedirections); 130 $('#stationdirSelect').val(stationObj.stationRoutedirections);
208 -  
209 // 获取站点道路编码元素设值 131 // 获取站点道路编码元素设值
210 $('#roadCodingCodInput').val(stationObj.stationRoadCoding); 132 $('#roadCodingCodInput').val(stationObj.stationRoadCoding);
211 -  
212 // 百度地图经纬度坐标中心点 133 // 百度地图经纬度坐标中心点
213 $('#bJwpointsInput').val(stationObj.stationJwpoints); 134 $('#bJwpointsInput').val(stationObj.stationJwpoints);
214 -  
215 // 获取图形类型元素,并添加值 135 // 获取图形类型元素,并添加值
216 - $('#shapesTypeSelect').val(stationObj.stationShapesType);  
217 - 136 + if(stationObj.stationShapesType=='r') {
  137 + $('#shapesTypeSelect').val('圆形');
  138 + }else if(stationObj.stationShapesType=='d'){
  139 + $('#shapesTypeSelect').val('多边形');
  140 + $('#radiusGroup').hide();
  141 + }
  142 + /*$('#shapesTypeSelect').val(stationObj.stationShapesType);*/
218 // 获取半径元素,并添加值 143 // 获取半径元素,并添加值
219 $('#radiusInput').val(stationObj.stationRadius); 144 $('#radiusInput').val(stationObj.stationRadius);
220 -  
221 // 是否撤销 145 // 是否撤销
222 $('#destroySelect').val(stationObj.stationRouteDestroy); 146 $('#destroySelect').val(stationObj.stationRouteDestroy);
223 -  
224 // 到站时间 147 // 到站时间
225 $('#toTimeInput').val(stationObj.stationRouteToTime); 148 $('#toTimeInput').val(stationObj.stationRouteToTime);
226 -  
227 // 到站距离 149 // 到站距离
228 $('#distancesInput').val(stationObj.stationRouteDistances); 150 $('#distancesInput').val(stationObj.stationRouteDistances);
229 -  
230 // 描述/说明 151 // 描述/说明
231 $('#descriptionsTextarea').val(stationObj.stationRouteDescriptions); 152 $('#descriptionsTextarea').val(stationObj.stationRouteDescriptions);
232 -  
233 }, 153 },
234 -  
235 - // 树数据获取  
236 - getStation : function(id_,dir_,callback) {  
237 -  
238 - var treeDateJson = [];  
239 -  
240 - $get('/stationroute/findStations',{'line.id_eq' : id_ , 'directions_eq' : dir_},function(resultdata) {  
241 -  
242 - treeDateJson = createTreeData(resultdata);  
243 -  
244 - callback && callback(treeDateJson);  
245 - 154 + // 获取站点路由.
  155 + getzdlyInfo : function(params,callback) {
  156 + $get('/stationroute/all',params,function(result) {
  157 + callback && callback(result);
246 }); 158 });
247 -  
248 }, 159 },
249 - 160 + // 方向代码转名称.
  161 + dirdmToName : function(value){
  162 + var srStr = '';
  163 + if(value=='0')
  164 + srStr = '上行';
  165 + else if(value=='1')
  166 + srStr = '下行';
  167 + return srStr;
  168 + },
250 findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) { 169 findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) {
251 -  
252 $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) { 170 $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) {
253 -  
254 callback && callback(result); 171 callback && callback(result);
255 -  
256 }); 172 });
257 -  
258 }, 173 },
259 -  
260 getStationRouteInfo : function(stationId,callback){ 174 getStationRouteInfo : function(stationId,callback){
261 -  
262 $get('/stationroute/findStationRouteInfo',{id:stationId},function(r) { 175 $get('/stationroute/findStationRouteInfo',{id:stationId},function(r) {
263 -  
264 callback && callback(r); 176 callback && callback(r);
265 -  
266 }); 177 });
267 -  
268 }, 178 },
269 -  
270 // 站点更新 179 // 站点更新
271 stationUpdate : function(station,callback) { 180 stationUpdate : function(station,callback) {
272 -  
273 $post('/station/stationUpdate',station,function(data) { 181 $post('/station/stationUpdate',station,function(data) {
274 -  
275 callback && callback(data); 182 callback && callback(data);
276 -  
277 }); 183 });
278 -  
279 - },  
280 -  
281 - clearRefresh : function() {  
282 -  
283 - // 清楚地图覆盖物  
284 - mapB.clearOverlays();  
285 -  
286 - $('#eidt').attr("disabled",false);  
287 -    
288 - $('#eidt').removeClass('btn disabled');  
289 -  
290 - $('#eidt').addClass('btn');  
291 -  
292 - stationObj='';  
293 -  
294 - PublicFunctions.initStationInfo(stationId,mapB);  
295 -  
296 }, 184 },
297 -  
298 getstationObjData : function(){ 185 getstationObjData : function(){
299 -  
300 return stationObj; 186 return stationObj;
301 }, 187 },
302 -  
303 getStationIdValue : function() { 188 getStationIdValue : function() {
304 -  
305 return stationId; 189 return stationId;
306 }, 190 },
307 -  
308 setStationNameValue : function(editStationName) { 191 setStationNameValue : function(editStationName) {
309 -  
310 stationObj[0].stationName = editStationName; 192 stationObj[0].stationName = editStationName;
311 -  
312 return stationObj; 193 return stationObj;
313 }, 194 },
314 -  
315 getPolygonObj : function() { 195 getPolygonObj : function() {
316 -  
317 return polygon; 196 return polygon;
318 }, 197 },
319 -  
320 getMarkerObj : function() { 198 getMarkerObj : function() {
321 -  
322 return marker; 199 return marker;
323 }, 200 },
324 -  
325 getCircleObj : function() { 201 getCircleObj : function() {
326 -  
327 return circle; 202 return circle;
328 -  
329 } 203 }
330 } 204 }
331 -  
332 return PubFun ; 205 return PubFun ;
333 -  
334 }(); 206 }();
335 \ No newline at end of file 207 \ No newline at end of file
src/main/resources/static/pages/base/station/js/station-positions-map.js
@@ -4,356 +4,217 @@ @@ -4,356 +4,217 @@
4 */ 4 */
5 5
6 var StationPositionsWorldsBMap = function () { 6 var StationPositionsWorldsBMap = function () {
7 -  
8 var mapBValue = '',marker='',polygon=''; 7 var mapBValue = '',marker='',polygon='';
9 -  
10 var Bmap = { 8 var Bmap = {
11 -  
12 init : function() { 9 init : function() {
13 -  
14 // 关闭左侧栏 10 // 关闭左侧栏
15 - if (!$('body').hasClass('page-sidebar-closed')) {  
16 -  
17 - $('.menu-toggler.sidebar-toggler').click();  
18 -  
19 - }  
20 - 11 + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();}
21 // 设置中心点, 12 // 设置中心点,
22 var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; 13 var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
23 -  
24 // 百度API Key 14 // 百度API Key
25 var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; 15 var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
26 -  
27 // 初始化百度地图 16 // 初始化百度地图
28 mapBValue = new BMap.Map("positionBmap_basic"); 17 mapBValue = new BMap.Map("positionBmap_basic");
29 -  
30 //中心点和缩放级别 18 //中心点和缩放级别
31 mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); 19 mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15);
32 -  
33 //启用地图拖拽事件,默认启用(可不写) 20 //启用地图拖拽事件,默认启用(可不写)
34 mapBValue.enableDragging(); 21 mapBValue.enableDragging();
35 -  
36 //启用地图滚轮放大缩小 22 //启用地图滚轮放大缩小
37 mapBValue.enableScrollWheelZoom(); 23 mapBValue.enableScrollWheelZoom();
38 -  
39 //禁用鼠标双击放大 24 //禁用鼠标双击放大
40 mapBValue.disableDoubleClickZoom(); 25 mapBValue.disableDoubleClickZoom();
41 -  
42 //启用键盘上下左右键移动地图 26 //启用键盘上下左右键移动地图
43 mapBValue.enableKeyboard(); 27 mapBValue.enableKeyboard();
44 -  
45 return mapBValue; 28 return mapBValue;
46 }, 29 },
47 -  
48 // 获取百度地图map值 30 // 获取百度地图map值
49 getMapBValue : function(){ 31 getMapBValue : function(){
50 -  
51 return mapBValue; 32 return mapBValue;
52 }, 33 },
53 -  
54 pointsCircle : function(r,point,htm,opts) { 34 pointsCircle : function(r,point,htm,opts) {
55 -  
56 // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) 35 // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增)
57 mapBValue.setZoom(17); 36 mapBValue.setZoom(17);
58 -  
59 //创建圆 37 //创建圆
60 circle = new BMap.Circle(point,r[0].stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); 38 circle = new BMap.Circle(point,r[0].stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5});
61 -  
62 // 允许覆盖物在map.clearOverlays方法中被清除 39 // 允许覆盖物在map.clearOverlays方法中被清除
63 circle.enableMassClear(); 40 circle.enableMassClear();
64 -  
65 // 百度地图添加覆盖物圆 41 // 百度地图添加覆盖物圆
66 mapBValue.addOverlay(circle); 42 mapBValue.addOverlay(circle);
67 -  
68 // 创建信息窗口 43 // 创建信息窗口
69 infoWindow = new BMap.InfoWindow(htm, opts); 44 infoWindow = new BMap.InfoWindow(htm, opts);
70 -  
71 // 自定义标注物图片 45 // 自定义标注物图片
72 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); 46 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
73 -  
74 // 创建点 47 // 创建点
75 marker = new BMap.Marker(point,{icon : icon_target}); 48 marker = new BMap.Marker(point,{icon : icon_target});
76 -  
77 // 把标注添物加到地图上 49 // 把标注添物加到地图上
78 mapBValue.addOverlay(marker); 50 mapBValue.addOverlay(marker);
79 -  
80 setTimeout(function(){ 51 setTimeout(function(){
81 //开启信息窗口 52 //开启信息窗口
82 marker.openInfoWindow(infoWindow,point); 53 marker.openInfoWindow(infoWindow,point);
83 -  
84 },100); 54 },100);
85 -  
86 // 是否在平移过程中禁止动画。(自1.2新增) 55 // 是否在平移过程中禁止动画。(自1.2新增)
87 var PanOptions_ ={noAnimation :true}; 56 var PanOptions_ ={noAnimation :true};
88 -  
89 // 将地图的中心点更改为给定的点。 57 // 将地图的中心点更改为给定的点。
90 mapBValue.panTo(point,PanOptions_); 58 mapBValue.panTo(point,PanOptions_);
91 -  
92 mapBValue.panBy(10,-250,PanOptions_); 59 mapBValue.panBy(10,-250,PanOptions_);
93 -  
94 // 添加标志物监听事件 60 // 添加标志物监听事件
95 marker.addEventListener("click",function() { 61 marker.addEventListener("click",function() {
96 -  
97 //开启信息窗口 62 //开启信息窗口
98 marker.openInfoWindow(infoWindow,point); 63 marker.openInfoWindow(infoWindow,point);
99 -  
100 }); 64 });
101 }, 65 },
102 -  
103 pointsPolygon : function(r,pointPolygon,htm,opts_polygon) { 66 pointsPolygon : function(r,pointPolygon,htm,opts_polygon) {
104 -  
105 // 获取多边形坐标字符串 67 // 获取多边形坐标字符串
106 var stationBPolygonGrid = r[0].stationBPolyonGrid; 68 var stationBPolygonGrid = r[0].stationBPolyonGrid;
107 -  
108 // 截取多边形坐标字符串 69 // 截取多边形坐标字符串
109 var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); 70 var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2);
110 -  
111 // 按逗号切割 71 // 按逗号切割
112 var pointPolygonArray = stationBPolygonGridStr.split(','); 72 var pointPolygonArray = stationBPolygonGridStr.split(',');
113 -  
114 // 多边形坐标集合 73 // 多边形坐标集合
115 var polygonP = []; 74 var polygonP = [];
116 -  
117 for(var v = 0;v<pointPolygonArray.length;v++) { 75 for(var v = 0;v<pointPolygonArray.length;v++) {
118 -  
119 polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); 76 polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1]));
120 -  
121 } 77 }
122 -  
123 // 画多边形 78 // 画多边形
124 polygon = new BMap.Polygon(polygonP, { 79 polygon = new BMap.Polygon(polygonP, {
125 -  
126 // 线条显色 80 // 线条显色
127 strokeColor : "blue", 81 strokeColor : "blue",
128 -  
129 // 边线的宽度,以像素为单位。 82 // 边线的宽度,以像素为单位。
130 strokeWeight : 2, 83 strokeWeight : 2,
131 -  
132 // 边线透明度,取值范围0 - 1。 84 // 边线透明度,取值范围0 - 1。
133 strokeOpacity : 0.5 85 strokeOpacity : 0.5
134 }); 86 });
135 -  
136 // 增加地图覆盖物多边形 87 // 增加地图覆盖物多边形
137 mapBValue.addOverlay(polygon); 88 mapBValue.addOverlay(polygon);
138 -  
139 // 创建信息窗口 89 // 创建信息窗口
140 infoWindow = new BMap.InfoWindow(htm, opts_polygon); 90 infoWindow = new BMap.InfoWindow(htm, opts_polygon);
141 -  
142 // 自定义标注物图片 91 // 自定义标注物图片
143 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); 92 var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20));
144 -  
145 // 创建点 93 // 创建点
146 marker = new BMap.Marker(pointPolygon,{icon : icon_target}); 94 marker = new BMap.Marker(pointPolygon,{icon : icon_target});
147 -  
148 // 把标注添物加到地图上 95 // 把标注添物加到地图上
149 mapBValue.addOverlay(marker); 96 mapBValue.addOverlay(marker);
150 -  
151 // 是否在平移过程中禁止动画。(自1.2新增) 97 // 是否在平移过程中禁止动画。(自1.2新增)
152 var PanOptions_ ={noAnimation :true}; 98 var PanOptions_ ={noAnimation :true};
153 -  
154 // 将地图的中心点更改为给定的点。 99 // 将地图的中心点更改为给定的点。
155 mapBValue.panTo(pointPolygon,PanOptions_); 100 mapBValue.panTo(pointPolygon,PanOptions_);
156 -  
157 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 101 // 将地图在水平位置上移动x像素,垂直位置上移动y像素。
158 mapBValue.panBy(10,-510,PanOptions_); 102 mapBValue.panBy(10,-510,PanOptions_);
159 -  
160 //开启信息窗口 103 //开启信息窗口
161 marker.openInfoWindow(infoWindow,pointPolygon); 104 marker.openInfoWindow(infoWindow,pointPolygon);
162 -  
163 }, 105 },
164 -  
165 // 编辑图形 106 // 编辑图形
166 editShapes : function(stationShapesTypeV,mindex) { 107 editShapes : function(stationShapesTypeV,mindex) {
167 -  
168 // 关闭信息窗口 108 // 关闭信息窗口
169 marker.closeInfoWindow(); 109 marker.closeInfoWindow();
170 -  
171 // 清除marker 110 // 清除marker
172 mapBValue.removeOverlay(marker); 111 mapBValue.removeOverlay(marker);
173 -  
174 // 编辑圆 112 // 编辑圆
175 if(stationShapesTypeV =='r') { 113 if(stationShapesTypeV =='r') {
176 -  
177 // 开启编辑功能 114 // 开启编辑功能
178 circle.enableEditing(); 115 circle.enableEditing();
179 -  
180 // 编辑圆监听事件 116 // 编辑圆监听事件
181 circle.addEventListener('dblclick',function() { 117 circle.addEventListener('dblclick',function() {
182 -  
183 // 关闭提示弹出层 118 // 关闭提示弹出层
184 layer.close(mindex); 119 layer.close(mindex);
185 -  
186 // 返回圆形的半径,单位为米。 120 // 返回圆形的半径,单位为米。
187 var newRadius = circle.getRadius(); 121 var newRadius = circle.getRadius();
188 -  
189 // 返回圆形的中心点坐标。 122 // 返回圆形的中心点坐标。
190 var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; 123 var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat;
191 -  
192 var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; 124 var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}];
193 -  
194 /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ 125 /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
195 PositionsStationObj.setEitdStationBJwpoints(newCenter); 126 PositionsStationObj.setEitdStationBJwpoints(newCenter);
196 -  
197 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ 127 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
198 PositionsStationObj.setEitdStationShapesType('r'); 128 PositionsStationObj.setEitdStationShapesType('r');
199 -  
200 /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ 129 /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
201 PositionsStationObj.setEitdStationRadius(Math.round(newRadius)); 130 PositionsStationObj.setEitdStationRadius(Math.round(newRadius));
202 -  
203 /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ 131 /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
204 PositionsStationObj.setEitdBPolygonGrid(''); 132 PositionsStationObj.setEitdBPolygonGrid('');
205 -  
206 // 加载编辑页面 133 // 加载编辑页面
207 $.get('edit.html', function(m){ 134 $.get('edit.html', function(m){
208 -  
209 $(pjaxContainer).append(m); 135 $(pjaxContainer).append(m);
210 -  
211 $('#editPoitsions_station_mobal').trigger('editStationMobal_show', [StationPositionsWorldsBMap,PositionsPublicFunctions,PositionsStationObj]); 136 $('#editPoitsions_station_mobal').trigger('editStationMobal_show', [StationPositionsWorldsBMap,PositionsPublicFunctions,PositionsStationObj]);
212 -  
213 }); 137 });
214 -  
215 }); 138 });
216 -  
217 // 编辑多变行 139 // 编辑多变行
218 }else if(stationShapesTypeV =='d') { 140 }else if(stationShapesTypeV =='d') {
219 -  
220 // 开启编辑功能(自 1.1 新增) 141 // 开启编辑功能(自 1.1 新增)
221 polygon.enableEditing(); 142 polygon.enableEditing();
222 -  
223 // 添加多变行编辑事件 143 // 添加多变行编辑事件
224 polygon.addEventListener('dblclick',function(e) { 144 polygon.addEventListener('dblclick',function(e) {
225 -  
226 // 获取编辑的多边形对象 145 // 获取编辑的多边形对象
227 var edit_pointE = polygon; 146 var edit_pointE = polygon;
228 -  
229 var edit_bPloygonGrid = ""; 147 var edit_bPloygonGrid = "";
230 -  
231 var editPolyGonLen_ = edit_pointE.getPath().length; 148 var editPolyGonLen_ = edit_pointE.getPath().length;
232 -  
233 for(var k =0;k<editPolyGonLen_;k++) { 149 for(var k =0;k<editPolyGonLen_;k++) {
234 -  
235 if(k==0) { 150 if(k==0) {
236 -  
237 edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; 151 edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
238 -  
239 }else { 152 }else {
240 -  
241 edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; 153 edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat;
242 -  
243 } 154 }
244 -  
245 } 155 }
246 -  
247 edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; 156 edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat;
248 -  
249 // 多边形中心点 157 // 多边形中心点
250 var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; 158 var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat;
251 -  
252 /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ 159 /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */
253 PositionsStationObj.setEitdStationBJwpoints(centre_points); 160 PositionsStationObj.setEitdStationBJwpoints(centre_points);
254 -  
255 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ 161 /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */
256 PositionsStationObj.setEitdStationShapesType('d'); 162 PositionsStationObj.setEitdStationShapesType('d');
257 -  
258 /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ 163 /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */
259 PositionsStationObj.setEitdStationRadius(''); 164 PositionsStationObj.setEitdStationRadius('');
260 -  
261 /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ 165 /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */
262 PositionsStationObj.setEitdBPolygonGrid(edit_bPloygonGrid); 166 PositionsStationObj.setEitdBPolygonGrid(edit_bPloygonGrid);
263 -  
264 $.get('edit.html', function(m){ 167 $.get('edit.html', function(m){
265 -  
266 $(pjaxContainer).append(m); 168 $(pjaxContainer).append(m);
267 -  
268 $('#editPoitsions_station_mobal').trigger('editStationMobal_show', [StationPositionsWorldsBMap,PositionsPublicFunctions,PositionsStationObj]); 169 $('#editPoitsions_station_mobal').trigger('editStationMobal_show', [StationPositionsWorldsBMap,PositionsPublicFunctions,PositionsStationObj]);
269 -  
270 }); 170 });
271 -  
272 }); 171 });
273 -  
274 } 172 }
275 -  
276 }, 173 },
277 - 174 + // 定位
278 localSearchFromAdreesToPoint: function(Address,callback) { 175 localSearchFromAdreesToPoint: function(Address,callback) {
279 -  
280 // 创建一个搜索类实例 176 // 创建一个搜索类实例
281 var localSearch = new BMap.LocalSearch(mapBValue); 177 var localSearch = new BMap.LocalSearch(mapBValue);
282 -  
283 // 检索完成后的回调函数。 178 // 检索完成后的回调函数。
284 localSearch.setSearchCompleteCallback(function (searchResult) { 179 localSearch.setSearchCompleteCallback(function (searchResult) {
285 -  
286 var resultPoints = ''; 180 var resultPoints = '';
287 -  
288 if(searchResult) { 181 if(searchResult) {
289 -  
290 // 返回索引指定的结果。索引0表示第1条结果 182 // 返回索引指定的结果。索引0表示第1条结果
291 var poi = searchResult.getPoi(0); 183 var poi = searchResult.getPoi(0);
292 -  
293 if(poi) { 184 if(poi) {
294 -  
295 //获取经度和纬度 185 //获取经度和纬度
296 resultPoints = poi.point.lng + ' ' + poi.point.lat; 186 resultPoints = poi.point.lng + ' ' + poi.point.lat;
297 -  
298 callback && callback(resultPoints); 187 callback && callback(resultPoints);
299 -  
300 }else { 188 }else {
301 -  
302 callback && callback(false); 189 callback && callback(false);
303 -  
304 } 190 }
305 -  
306 }else { 191 }else {
307 -  
308 callback && callback(false); 192 callback && callback(false);
309 } 193 }
310 -  
311 }); 194 });
312 -  
313 // 根据检索词发起检索。 195 // 根据检索词发起检索。
314 localSearch.search(Address); 196 localSearch.search(Address);
315 -  
316 }, 197 },
317 -  
318 localtionPoint : function(stationNameV) { 198 localtionPoint : function(stationNameV) {
319 -  
320 StationPositionsWorldsBMap.localSearchFromAdreesToPoint(stationNameV,function(Points) { 199 StationPositionsWorldsBMap.localSearchFromAdreesToPoint(stationNameV,function(Points) {
321 -  
322 if(Points) { 200 if(Points) {
323 -  
324 var BJwpointsArray = Points.split(' '); 201 var BJwpointsArray = Points.split(' ');
325 -  
326 var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); 202 var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]);
327 -  
328 var marker_stargt2 = new BMap.Marker(stationNameChangePoint); 203 var marker_stargt2 = new BMap.Marker(stationNameChangePoint);
329 -  
330 var PanOptions ={noAnimation :true}; 204 var PanOptions ={noAnimation :true};
331 -  
332 mapBValue.panTo(stationNameChangePoint,PanOptions); 205 mapBValue.panTo(stationNameChangePoint,PanOptions);
333 -  
334 mapBValue.panBy(0,-100); 206 mapBValue.panBy(0,-100);
335 -  
336 // 将标注添加到地图中 207 // 将标注添加到地图中
337 mapBValue.addOverlay(marker_stargt2); 208 mapBValue.addOverlay(marker_stargt2);
338 -  
339 //跳动的动画 209 //跳动的动画
340 marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); 210 marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE);
341 -  
342 } 211 }
343 -  
344 }); 212 });
345 -  
346 }, 213 },
347 - 214 + // 清楚地图覆盖物
348 clearMarkAndOverlays : function() { 215 clearMarkAndOverlays : function() {
349 -  
350 - // 清楚地图覆盖物  
351 mapBValue.clearOverlays(); 216 mapBValue.clearOverlays();
352 -  
353 } 217 }
354 -  
355 } 218 }
356 -  
357 return Bmap; 219 return Bmap;
358 -  
359 }(); 220 }();
360 \ No newline at end of file 221 \ No newline at end of file
src/main/resources/static/pages/base/station/js/station-positions-reload.js
@@ -13,44 +13,29 @@ @@ -13,44 +13,29 @@
13 */ 13 */
14 14
15 (function(){ 15 (function(){
16 -  
17 // 获取参数线路ID 16 // 获取参数线路ID
18 var id = $.url().param('no'); 17 var id = $.url().param('no');
19 -  
20 var styleOptions = { 18 var styleOptions = {
21 -  
22 //边线颜色。 19 //边线颜色。
23 strokeColor : "blue", 20 strokeColor : "blue",
24 -  
25 //填充颜色。当参数为空时,圆形将没有填充效果。 21 //填充颜色。当参数为空时,圆形将没有填充效果。
26 fillColor : "blue", 22 fillColor : "blue",
27 -  
28 //边线的宽度,以像素为单位。 23 //边线的宽度,以像素为单位。
29 strokeWeight : 3, 24 strokeWeight : 3,
30 -  
31 //边线透明度,取值范围0 - 1。 25 //边线透明度,取值范围0 - 1。
32 strokeOpacity : 0.8, 26 strokeOpacity : 0.8,
33 -  
34 //填充的透明度,取值范围0 - 1。 27 //填充的透明度,取值范围0 - 1。
35 fillOpacity : 0.6, 28 fillOpacity : 0.6,
36 -  
37 //边线的样式,solid或dashed。 29 //边线的样式,solid或dashed。
38 strokeStyle : 'solid' 30 strokeStyle : 'solid'
39 -  
40 }; 31 };
41 -  
42 - // 等候500毫秒执行 32 + // 等候300毫秒执行
43 setTimeout(function(){ 33 setTimeout(function(){
44 -  
45 // 初始化地图 34 // 初始化地图
46 var map_ = StationPositionsWorldsBMap.init(); 35 var map_ = StationPositionsWorldsBMap.init();
47 -  
48 // 初始化绘制工具类 36 // 初始化绘制工具类
49 var drawingManager_ = PositionsDrawingManagerObj.init(map_,styleOptions); 37 var drawingManager_ = PositionsDrawingManagerObj.init(map_,styleOptions);
50 -  
51 // 初始化站点信息 38 // 初始化站点信息
52 PositionsPublicFunctions.initStationInfo(id); 39 PositionsPublicFunctions.initStationInfo(id);
53 -  
54 - },200);  
55 - 40 + },300);
56 })(); 41 })();
57 \ No newline at end of file 42 \ No newline at end of file
src/main/resources/static/pages/base/station/list.html
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 <th width="5%">线路编号</th> 35 <th width="5%">线路编号</th>
36 <th width="11%">线路名称</th> 36 <th width="11%">线路名称</th>
37 <th width="5%">线路方向</th> 37 <th width="5%">线路方向</th>
38 - <th width="14%">站点名称</th> 38 + <th width="14%">站点路由名称</th>
39 <th width="5%">站点编码</th> 39 <th width="5%">站点编码</th>
40 <th width="4%">站点序号</th> 40 <th width="4%">站点序号</th>
41 <th width="6%">站点类型</th> 41 <th width="6%">站点类型</th>
src/main/resources/static/pages/base/station/positions.html
1 <link href="/pages/base/station/css/positions.css" rel="stylesheet" type="text/css" /> 1 <link href="/pages/base/station/css/positions.css" rel="stylesheet" type="text/css" />
2 -  
3 <!-- 地图容器 --> 2 <!-- 地图容器 -->
4 <div id="positionBmap_basic"></div> 3 <div id="positionBmap_basic"></div>
5 -  
6 <!-- 操作工具容器disabled --> 4 <!-- 操作工具容器disabled -->
7 <div class="leftUtils"> 5 <div class="leftUtils">
8 <div class="btn-group" style="left: 100px;"> 6 <div class="btn-group" style="left: 100px;">
@@ -20,21 +18,15 @@ @@ -20,21 +18,15 @@
20 </ul> 18 </ul>
21 </div> 19 </div>
22 </div> 20 </div>
23 -  
24 <!-- 站点对象类 --> 21 <!-- 站点对象类 -->
25 <script src="/pages/base/station/js/positionstation.js"></script> 22 <script src="/pages/base/station/js/positionstation.js"></script>
26 -  
27 -<!-- 绘制工具类 -->  
28 -<script src="/pages/base/station/js/positionsdrwmager.js"></script>  
29 -  
30 <!-- 地图JS类库 --> 23 <!-- 地图JS类库 -->
31 <script src="/pages/base/station/js/station-positions-map.js"></script> 24 <script src="/pages/base/station/js/station-positions-map.js"></script>
32 - 25 +<!-- 绘制工具类 -->
  26 +<script src="/pages/base/station/js/positionsdrwmager.js"></script>
33 <!-- 方法函数JS类库 --> 27 <!-- 方法函数JS类库 -->
34 <script src="/pages/base/station/js/station-positions-function.js"></script> 28 <script src="/pages/base/station/js/station-positions-function.js"></script>
35 -  
36 <!-- reloadJS类库 --> 29 <!-- reloadJS类库 -->
37 <script src="/pages/base/station/js/station-positions-reload.js"></script> 30 <script src="/pages/base/station/js/station-positions-reload.js"></script>
38 -  
39 <!-- 事件JS类库 --> 31 <!-- 事件JS类库 -->
40 <script src="/pages/base/station/js/station-positions-events.js"></script> 32 <script src="/pages/base/station/js/station-positions-events.js"></script>
41 \ No newline at end of file 33 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/js/stationroute-ajax-getdata.js
@@ -78,17 +78,11 @@ var GetAjaxData = function(){ @@ -78,17 +78,11 @@ var GetAjaxData = function(){
78 78
79 // 查询站点编码 79 // 查询站点编码
80 getStationCode : function(callback) { 80 getStationCode : function(callback) {
81 -  
82 $get('/station/getStationCode',null,function(stationCode) { 81 $get('/station/getStationCode',null,function(stationCode) {
83 -  
84 if(stationCode>0 || stationCode==0) { 82 if(stationCode>0 || stationCode==0) {
85 -  
86 - callback && callback(stationCode+1);  
87 - 83 + callback && callback(stationCode);
88 } 84 }
89 -  
90 }); 85 });
91 -  
92 }, 86 },
93 87
94 findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) { 88 findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) {