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