Commit 692e166bf3e95e73e8bfe3637c333ccd606c419a

Authored by 潘钊
1 parent 62581fad

update...

src/main/java/com/bsth/controller/geo_data/GeoDataController.java
@@ -68,4 +68,9 @@ public class GeoDataController { @@ -68,4 +68,9 @@ public class GeoDataController {
68 public Map<String, Object> destroyRoad(GeoRoad road){ 68 public Map<String, Object> destroyRoad(GeoRoad road){
69 return geoDataService.destroyRoad(road); 69 return geoDataService.destroyRoad(road);
70 } 70 }
  71 +
  72 + @RequestMapping("findVersionInfo")
  73 + public Map<String, Object> findVersionInfo(@RequestParam String lineCode){
  74 + return geoDataService.findVersionInfo(lineCode);
  75 + }
71 } 76 }
72 \ No newline at end of file 77 \ No newline at end of file
src/main/java/com/bsth/entity/geo_data/GeoLineVersionInfo.java 0 → 100644
  1 +package com.bsth.entity.geo_data;
  2 +
  3 +import java.util.Date;
  4 +
  5 +/**
  6 + * 线路版本信息
  7 + * Created by panzhao on 2017/12/18.
  8 + */
  9 +public class GeoLineVersionInfo {
  10 + /** ID 主键(唯一标识符) int length(11) */
  11 + private Integer id;
  12 +
  13 + /** 线路版本名字 varchar length(50)
  14 + * 给排版人员选版本使用
  15 + * */
  16 + private String name;
  17 +
  18 + /** 线路ID int length(11) */
  19 + private Integer line;
  20 +
  21 + /** 线路编码 varchar length(50) */
  22 + private String lineCode;
  23 +
  24 + /** 版本号 int length(11) */
  25 + private int versions;
  26 +
  27 + /** 启用日期 timestamp */
  28 + private Date startDate;
  29 +
  30 + /** 终止日期 timestamp */
  31 + private Date endDate;
  32 +
  33 + /** 创建日期 timestamp */
  34 + private Date createDate;
  35 +
  36 + /** 修改日期 timestamp */
  37 + private Date updateDate;
  38 +
  39 + /** 备注 varchar length(50) */
  40 + private String remark;
  41 +
  42 + /** 版本状态 int length(11)
  43 + * 0(历史版本),1(当前版本),2(待更新版本)
  44 + */
  45 + private int status;
  46 +
  47 + /**
  48 + * 是否发布 int length(1)
  49 + * 0(没有),1(发布)
  50 + */
  51 + private int isupdate;
  52 +
  53 + private String lineName;
  54 +
  55 + public Integer getId() {
  56 + return id;
  57 + }
  58 +
  59 + public void setId(Integer id) {
  60 + this.id = id;
  61 + }
  62 +
  63 + public String getName() {
  64 + return name;
  65 + }
  66 +
  67 + public void setName(String name) {
  68 + this.name = name;
  69 + }
  70 +
  71 + public String getLineCode() {
  72 + return lineCode;
  73 + }
  74 +
  75 + public void setLineCode(String lineCode) {
  76 + this.lineCode = lineCode;
  77 + }
  78 +
  79 + public int getVersions() {
  80 + return versions;
  81 + }
  82 +
  83 + public void setVersions(int versions) {
  84 + this.versions = versions;
  85 + }
  86 +
  87 + public Date getStartDate() {
  88 + return startDate;
  89 + }
  90 +
  91 + public void setStartDate(Date startDate) {
  92 + this.startDate = startDate;
  93 + }
  94 +
  95 + public Date getEndDate() {
  96 + return endDate;
  97 + }
  98 +
  99 + public void setEndDate(Date endDate) {
  100 + this.endDate = endDate;
  101 + }
  102 +
  103 + public Date getCreateDate() {
  104 + return createDate;
  105 + }
  106 +
  107 + public void setCreateDate(Date createDate) {
  108 + this.createDate = createDate;
  109 + }
  110 +
  111 + public Date getUpdateDate() {
  112 + return updateDate;
  113 + }
  114 +
  115 + public void setUpdateDate(Date updateDate) {
  116 + this.updateDate = updateDate;
  117 + }
  118 +
  119 + public String getRemark() {
  120 + return remark;
  121 + }
  122 +
  123 + public void setRemark(String remark) {
  124 + this.remark = remark;
  125 + }
  126 +
  127 + public int getStatus() {
  128 + return status;
  129 + }
  130 +
  131 + public void setStatus(int status) {
  132 + this.status = status;
  133 + }
  134 +
  135 + public int getIsupdate() {
  136 + return isupdate;
  137 + }
  138 +
  139 + public void setIsupdate(int isupdate) {
  140 + this.isupdate = isupdate;
  141 + }
  142 +
  143 + public String getLineName() {
  144 + return lineName;
  145 + }
  146 +
  147 + public void setLineName(String lineName) {
  148 + this.lineName = lineName;
  149 + }
  150 +
  151 + public Integer getLine() {
  152 + return line;
  153 + }
  154 +
  155 + public void setLine(Integer line) {
  156 + this.line = line;
  157 + }
  158 +}
src/main/java/com/bsth/service/geo_data/GeoDataService.java
@@ -29,4 +29,6 @@ public interface GeoDataService { @@ -29,4 +29,6 @@ public interface GeoDataService {
29 Map<String,Object> destroyRoad(GeoRoad road); 29 Map<String,Object> destroyRoad(GeoRoad road);
30 30
31 Map<String,Object> addNewRoadRoute(String lineCode, int upDown, int versions, String sectionName,String crosesRoad, String coords, int prevRouteId); 31 Map<String,Object> addNewRoadRoute(String lineCode, int upDown, int versions, String sectionName,String crosesRoad, String coords, int prevRouteId);
  32 +
  33 + Map<String,Object> findVersionInfo(String lineCode);
32 } 34 }
src/main/java/com/bsth/service/geo_data/impl/GeoDataServiceImpl.java
1 package com.bsth.service.geo_data.impl; 1 package com.bsth.service.geo_data.impl;
2 2
3 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
  4 +import com.bsth.entity.geo_data.GeoLineVersionInfo;
4 import com.bsth.entity.geo_data.GeoRoad; 5 import com.bsth.entity.geo_data.GeoRoad;
5 import com.bsth.entity.geo_data.GeoStation; 6 import com.bsth.entity.geo_data.GeoStation;
6 import com.bsth.service.geo_data.GeoDataService; 7 import com.bsth.service.geo_data.GeoDataService;
@@ -191,7 +192,7 @@ public class GeoDataServiceImpl implements GeoDataService { @@ -191,7 +192,7 @@ public class GeoDataServiceImpl implements GeoDataService {
191 String bdCooed = "LINESTRING(" + coords + ")"; 192 String bdCooed = "LINESTRING(" + coords + ")";
192 //insert 路段 193 //insert 路段
193 sql = "insert into bsth_c_section(id, section_code, section_name, croses_road, bsection_vector, gsection_vector, create_date, update_date, versions) " + 194 sql = "insert into bsth_c_section(id, section_code, section_name, croses_road, bsection_vector, gsection_vector, create_date, update_date, versions) " +
194 - " values(?,?,?,?,ST_GeomFromText('"+wgsCoord+"'),ST_GeomFromText('"+bdCooed+"'),sysdate(),sysdate(),?)"; 195 + " values(?,?,?,?,ST_GeomFromText('"+bdCooed+"'),ST_GeomFromText('"+wgsCoord+"'),sysdate(),sysdate(),?)";
195 196
196 jdbcTemplate.update(sql, sCode, sCode, sectionName, crosesRoad, 1); 197 jdbcTemplate.update(sql, sCode, sCode, sectionName, crosesRoad, 1);
197 198
@@ -256,7 +257,6 @@ public class GeoDataServiceImpl implements GeoDataService { @@ -256,7 +257,6 @@ public class GeoDataServiceImpl implements GeoDataService {
256 //返回更新之后的数据 257 //返回更新之后的数据
257 List<GeoRoad> list = findRoadByUpdown(lineCode, upDown, versions); 258 List<GeoRoad> list = findRoadByUpdown(lineCode, upDown, versions);
258 rs.put("list", list); 259 rs.put("list", list);
259 - rs.put("upDown", upDown);  
260 rs.put("status", ResponseCode.SUCCESS); 260 rs.put("status", ResponseCode.SUCCESS);
261 } catch (Exception e) { 261 } catch (Exception e) {
262 tran.rollback(status); 262 tran.rollback(status);
@@ -267,6 +267,31 @@ public class GeoDataServiceImpl implements GeoDataService { @@ -267,6 +267,31 @@ public class GeoDataServiceImpl implements GeoDataService {
267 return rs; 267 return rs;
268 } 268 }
269 269
  270 + /**
  271 + * 获取线路版本信息
  272 + * @param lineCode
  273 + * @return
  274 + */
  275 + @Override
  276 + public Map<String, Object> findVersionInfo(String lineCode) {
  277 + Map<String, Object> rs = new HashMap<>();
  278 +
  279 + try {
  280 + String sql = "select t1.*,t2.name as line_name from bsth_c_line_versions t1 LEFT JOIN bsth_c_line t2 on t1.line_code=t2.line_code where t1.line_code='"+lineCode+"'";
  281 +
  282 + List<GeoLineVersionInfo> list =
  283 + jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(GeoLineVersionInfo.class));
  284 +
  285 + rs.put("list", list);
  286 + rs.put("status", ResponseCode.SUCCESS);
  287 + } catch (Exception e) {
  288 + logger.error("", e);
  289 + rs.put("status", ResponseCode.ERROR);
  290 + rs.put("msg", "服务器出现异常");
  291 + }
  292 + return rs;
  293 + }
  294 +
270 @Override 295 @Override
271 public Map<String, Object> addNewStationRoute(String lineCode, int upDown, int versions, String stationName, Float lat, Float lng, int prevRouteId) { 296 public Map<String, Object> addNewStationRoute(String lineCode, int upDown, int versions, String stationName, Float lat, Float lng, int prevRouteId) {
272 Map<String, Object> rs = new HashMap<>(); 297 Map<String, Object> rs = new HashMap<>();
src/main/resources/static/pages/base/geo_data_edit/css/mian.css
@@ -30,8 +30,6 @@ div#map_wrap{ @@ -30,8 +30,6 @@ div#map_wrap{
30 z-index: 99; 30 z-index: 99;
31 top: 10px; 31 top: 10px;
32 left: 330px; 32 left: 330px;
33 - background: #fffffff5;  
34 - box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48);  
35 } 33 }
36 .main_rt_tools_panel{ 34 .main_rt_tools_panel{
37 position: absolute; 35 position: absolute;
@@ -61,7 +59,7 @@ div#map_wrap{ @@ -61,7 +59,7 @@ div#map_wrap{
61 59
62 ._line_info{ 60 ._line_info{
63 width: 100%; 61 width: 100%;
64 - height: 90px; 62 + height: 80px;
65 background: white; 63 background: white;
66 box-shadow: 0px -2px 15px rgba(90, 90, 90, 0.48); 64 box-shadow: 0px -2px 15px rgba(90, 90, 90, 0.48);
67 } 65 }
@@ -104,7 +102,7 @@ div#map_wrap{ @@ -104,7 +102,7 @@ div#map_wrap{
104 margin-top: 6px; 102 margin-top: 6px;
105 } 103 }
106 ._route_info_wrap{ 104 ._route_info_wrap{
107 - height: calc(100% - 100px); 105 + height: calc(100% - 90px);
108 padding-top: 10px; 106 padding-top: 10px;
109 } 107 }
110 108
@@ -554,4 +552,56 @@ ul.context-menu-list.station-route-ct-menu.context-menu-root { @@ -554,4 +552,56 @@ ul.context-menu-list.station-route-ct-menu.context-menu-root {
554 552
555 .draw_polyline_switch>a{ 553 .draw_polyline_switch>a{
556 color: red; 554 color: red;
  555 +}
  556 +
  557 +.ct_search_input::placeholder{
  558 + font-size: 13px;
  559 +}
  560 +
  561 +.ct_search_result>ul.s_list ._title{
  562 + display: block;
  563 + color: #009688;
  564 + font-size: 14px;
  565 +}
  566 +
  567 +.ct_search_result>ul.s_list ._address{
  568 + font-size: 12px;
  569 +}
  570 +
  571 +.ct_s_i_wrap{
  572 + box-shadow: 0px 4px 12px rgba(145, 145, 145, 0.48);
  573 +}
  574 +
  575 +.ct_search_result{
  576 + background: #fff;
  577 + margin-top: 10px;
  578 + box-shadow: 5px 5px 15px rgba(90, 90, 90, 0.48);
  579 + max-width: 300px;
  580 +}
  581 +
  582 +.ct_search_result .s_list>li{
  583 + padding: 5px 15px;
  584 + cursor: pointer;
  585 + margin-top: 0;
  586 +
  587 + overflow: hidden;
  588 + text-overflow: ellipsis;
  589 + white-space: nowrap;
  590 +}
  591 +
  592 +.ct_search_result .s_list>li:hover{
  593 + background: #e1e1e1;
  594 +}
  595 +
  596 +.ct_search_result ._empty{
  597 + font-size: 12px;
  598 + color: #656464;
  599 +}
  600 +
  601 +.ct_search_result .uk-icon{
  602 + cursor: pointer;
  603 +}
  604 +
  605 +.main_lt_search_panel .uk-form-icon:not(a):not(button):not(input){
  606 + pointer-events: auto;
557 } 607 }
558 \ No newline at end of file 608 \ No newline at end of file
src/main/resources/static/pages/base/geo_data_edit/fragments/f_road_route.html
@@ -4,8 +4,8 @@ @@ -4,8 +4,8 @@
4 {{each list as subArr i}} 4 {{each list as subArr i}}
5 <li class="r_r_item f_r_a" data-id="{{subArr[0].id}}" data-code="{{subArr[0].sectionCode}}"> 5 <li class="r_r_item f_r_a" data-id="{{subArr[0].id}}" data-code="{{subArr[0].sectionCode}}">
6 <a data-code="{{subArr[0].sectionCode}}" data-updown="{{subArr[0].directions}}">{{subArr[0].sectionName}}<span class="sub_name">{{subArr[0].crosesRoad}}</span></a> 6 <a data-code="{{subArr[0].sectionCode}}" data-updown="{{subArr[0].directions}}">{{subArr[0].sectionName}}<span class="sub_name">{{subArr[0].crosesRoad}}</span></a>
7 - <ul class="uk-list bks_list">  
8 {{if subArr.length > 1}} 7 {{if subArr.length > 1}}
  8 + <ul class="uk-list bks_list">
9 {{each subArr as obj j}} 9 {{each subArr as obj j}}
10 {{if j > 0}} 10 {{if j > 0}}
11 <li class="r_r_item" data-id="{{obj.id}}" data-code="{{obj.sectionCode}}"> 11 <li class="r_r_item" data-id="{{obj.id}}" data-code="{{obj.sectionCode}}">
@@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
13 {{/if}} 13 {{/if}}
14 14
15 {{/each}} 15 {{/each}}
  16 + </ul>
16 {{/if}} 17 {{/if}}
17 - </ul>  
18 </li> 18 </li>
19 {{/each}} 19 {{/each}}
20 </ul> 20 </ul>
src/main/resources/static/pages/base/geo_data_edit/js/common_data.js
1 <!-- 数据 --> 1 <!-- 数据 -->
2 var gb_common_data = function () { 2 var gb_common_data = function () {
3 3
  4 + /**
  5 + * 加载线路基础信息
  6 + */
  7 +
4 8
5 res_load_ep.emitLater('load_common_data'); 9 res_load_ep.emitLater('load_common_data');
6 return {}; 10 return {};
src/main/resources/static/pages/base/geo_data_edit/js/map.js
@@ -113,11 +113,13 @@ var gb_ct_map = function () { @@ -113,11 +113,13 @@ var gb_ct_map = function () {
113 map.addOverlay(polyline); 113 map.addOverlay(polyline);
114 114
115 polyline.addEventListener('mouseover', function () { 115 polyline.addEventListener('mouseover', function () {
116 - if (map_status != 1) 116 + //if (map_status != 1)
  117 + if(this!=editPolyline)
117 this.setStrokeColor('#20bd26'); 118 this.setStrokeColor('#20bd26');
118 }); 119 });
119 polyline.addEventListener('mouseout', function () { 120 polyline.addEventListener('mouseout', function () {
120 - if (map_status != 1 && this != road_win_show_p) 121 + //if (map_status != 1 && this != road_win_show_p)
  122 + if(this!=editPolyline && this != road_win_show_p)
121 this.setStrokeColor(updownColor(this.ct_data.directions)); 123 this.setStrokeColor(updownColor(this.ct_data.directions));
122 }); 124 });
123 polyline.addEventListener('click', function (e) { 125 polyline.addEventListener('click', function (e) {
@@ -730,9 +732,9 @@ var gb_ct_map = function () { @@ -730,9 +732,9 @@ var gb_ct_map = function () {
730 732
731 //路段变色 733 //路段变色
732 var polyline = getRoadPolyline(road.sectionCode, road.directions); 734 var polyline = getRoadPolyline(road.sectionCode, road.directions);
  735 + editPolyline = polyline;
733 polyline.setStrokeColor('#E91E63'); 736 polyline.setStrokeColor('#E91E63');
734 737
735 - editPolyline = polyline;  
736 //路段可编辑 738 //路段可编辑
737 polyline.enableEditing(); 739 polyline.enableEditing();
738 740
@@ -762,16 +764,41 @@ var gb_ct_map = function () { @@ -762,16 +764,41 @@ var gb_ct_map = function () {
762 return polyline; 764 return polyline;
763 }; 765 };
764 766
  767 + var focusMarker;
  768 + var focusPoint = function (lat, lng) {
  769 + var p = new BMap.Point(lng,lat);
  770 + map.setCenter(p);
  771 +
  772 + clearfocus();
  773 +
  774 + var marker = new BMap.Marker(p);
  775 + map.addOverlay(marker);
  776 + marker.setAnimation(BMAP_ANIMATION_BOUNCE);
  777 + focusMarker = marker;
  778 + var zoom = map.getZoom();
  779 + if(zoom < 18)
  780 + map.setZoom(18);
  781 + };
  782 +
  783 + var clearfocus = function () {
  784 + if(focusMarker){
  785 + map.removeOverlay(focusMarker);
  786 + focusMarker = null;
  787 + }
  788 + };
  789 +
765 /** 790 /**
766 * 退出路段编辑模式 791 * 退出路段编辑模式
767 */ 792 */
768 - var exitEditRoadStatus = function (road) { 793 + var exitEditRoadStatus = function (road, noFocus) {
769 map_status = 0; 794 map_status = 0;
770 $('.main_left_panel_m_layer').hide(); 795 $('.main_left_panel_m_layer').hide();
771 $('.road_edit_panel').remove(); 796 $('.road_edit_panel').remove();
772 797
773 editPolyline.removeEventListener('lineupdate', reCalcPathLength); 798 editPolyline.removeEventListener('lineupdate', reCalcPathLength);
774 editPolyline = null; 799 editPolyline = null;
  800 + if(noFocus)
  801 + return;
775 802
776 //polyline 803 //polyline
777 var polyline = getRoadPolyline(road.sectionCode, road.directions); 804 var polyline = getRoadPolyline(road.sectionCode, road.directions);
@@ -813,6 +840,9 @@ var gb_ct_map = function () { @@ -813,6 +840,9 @@ var gb_ct_map = function () {
813 reDrawRoad: reDrawRoad, 840 reDrawRoad: reDrawRoad,
814 edit_road: start_edit_road, 841 edit_road: start_edit_road,
815 exitEditRoadStatus: exitEditRoadStatus, 842 exitEditRoadStatus: exitEditRoadStatus,
816 - showAddRoadPanel: showAddRoadPanel 843 + showAddRoadPanel: showAddRoadPanel,
  844 + map: map,
  845 + focus: focusPoint,
  846 + clearfocus: clearfocus
817 }; 847 };
818 }(); 848 }();
819 \ No newline at end of file 849 \ No newline at end of file
src/main/resources/static/pages/base/geo_data_edit/js/road_route.js
@@ -136,6 +136,22 @@ var gb_road_route = function () { @@ -136,6 +136,22 @@ var gb_road_route = function () {
136 add_road(addCell); 136 add_road(addCell);
137 }; 137 };
138 138
  139 + var insert_road_after = function (road) {
  140 + //在之后插入路段
  141 + var cell = getRoadLI(road);
  142 +
  143 + var addCell = $(temps['geo_d_e_add_road_panel-temp'](road));
  144 +
  145 + //var next = cell.next('.r_r_item');
  146 + //cell.after(addCell);
  147 + var $bksList = $('.bks_list', cell);
  148 + if($bksList.length > 0)
  149 + $bksList.prepend(addCell);
  150 + else
  151 + cell.after(addCell);
  152 + add_road(addCell);
  153 + };
  154 +
139 var add_road = function (cell) { 155 var add_road = function (cell) {
140 gb_ct_map.closeInfoWin(); 156 gb_ct_map.closeInfoWin();
141 //焦点 157 //焦点
@@ -160,7 +176,7 @@ var gb_road_route = function () { @@ -160,7 +176,7 @@ var gb_road_route = function () {
160 showDrawPanel(name, $('input[name=crosesRoad]',cell).val()); 176 showDrawPanel(name, $('input[name=crosesRoad]',cell).val());
161 }); 177 });
162 //监听回车事件 178 //监听回车事件
163 - $('[name=sectionName]', cell).on('keydown', function (e) { 179 + $('input', cell).on('keydown', function (e) {
164 if(event.keyCode == "13") 180 if(event.keyCode == "13")
165 $('.search_point_icon_btn', cell).trigger('click'); 181 $('.search_point_icon_btn', cell).trigger('click');
166 }); 182 });
@@ -185,6 +201,7 @@ var gb_road_route = function () { @@ -185,6 +201,7 @@ var gb_road_route = function () {
185 var callbackHandler = { 201 var callbackHandler = {
186 edit: edit_road, 202 edit: edit_road,
187 insert_before: insert_road_before, 203 insert_before: insert_road_before,
  204 + insert_after: insert_road_after,
188 destroy: function (road) { 205 destroy: function (road) {
189 gb_data_submit.destroyRoad(road); 206 gb_data_submit.destroyRoad(road);
190 } 207 }
@@ -238,7 +255,7 @@ var gb_road_route = function () { @@ -238,7 +255,7 @@ var gb_road_route = function () {
238 } 255 }
239 256
240 var update = function (road) { 257 var update = function (road) {
241 - var _pos = cv_points(this.bdCoords); 258 + var _pos = cv_points(road.bdCoords);
242 road.cp = geolib.getCenter(_pos); 259 road.cp = geolib.getCenter(_pos);
243 road.len = geolib.getPathLength(_pos); 260 road.len = geolib.getPathLength(_pos);
244 var array = road_maps[road.directions]; 261 var array = road_maps[road.directions];
@@ -254,7 +271,8 @@ var gb_road_route = function () { @@ -254,7 +271,8 @@ var gb_road_route = function () {
254 $('.up_down_route_list>li:'+(road.directions==0?'first':'last')+'>.road_route').html(htmlStr); 271 $('.up_down_route_list>li:'+(road.directions==0?'first':'last')+'>.road_route').html(htmlStr);
255 }; 272 };
256 273
257 - var destroyEnd = function (list, road) { 274 + var updateList = function (list) {
  275 + var updown = list[0].directions;
258 list.sort(function (a, b) { 276 list.sort(function (a, b) {
259 return parseInt(a.sectionrouteCode) - parseInt(b.sectionrouteCode); 277 return parseInt(a.sectionrouteCode) - parseInt(b.sectionrouteCode);
260 }); 278 });
@@ -266,12 +284,12 @@ var gb_road_route = function () { @@ -266,12 +284,12 @@ var gb_road_route = function () {
266 this.len = geolib.getPathLength(_pos); 284 this.len = geolib.getPathLength(_pos);
267 }); 285 });
268 286
269 - road_maps[road.directions] = list; 287 + road_maps[updown] = list;
270 //重新渲染 288 //重新渲染
271 var htmlStr = temps['geo_d_e_road_route-temp']({list: _group(list)}); 289 var htmlStr = temps['geo_d_e_road_route-temp']({list: _group(list)});
272 - $('.up_down_route_list>li:'+(road.directions==0?'first':'last')+'>.road_route').html(htmlStr); 290 + $('.up_down_route_list>li:'+(updown==0?'first':'last')+'>.road_route').html(htmlStr);
273 291
274 - gb_ct_map.reDrawRoad(road.directions); 292 + gb_ct_map.reDrawRoad(updown);
275 }; 293 };
276 294
277 /** 295 /**
@@ -321,7 +339,7 @@ var gb_road_route = function () { @@ -321,7 +339,7 @@ var gb_road_route = function () {
321 focus: focus, 339 focus: focus,
322 showPathLength: showPathLength, 340 showPathLength: showPathLength,
323 update: update, 341 update: update,
324 - destroyEnd: destroyEnd, 342 + updateList: updateList,
325 getRoadById: getRoadById, 343 getRoadById: getRoadById,
326 getAddPrevId: function () { 344 getAddPrevId: function () {
327 return addPrevId; 345 return addPrevId;
src/main/resources/static/pages/base/geo_data_edit/js/search.js 0 → 100644
  1 +/**
  2 + * 地图搜索定位
  3 + */
  4 +var gb_ct_search = function () {
  5 +
  6 + var local;
  7 +
  8 + var _$icon = $('.main_lt_search_panel span[uk-icon]');
  9 + var v, run_flag;
  10 + $('.ct_search_input').on('input', function () {
  11 + v = $(this).val();
  12 + if(run_flag)
  13 + return;
  14 +
  15 + run_flag = true;
  16 + setTimeout(function () {
  17 + if(!v){
  18 + _$icon.attr('uk-icon', 'icon: search');
  19 + closeSearchResult();
  20 + }
  21 + else{
  22 + _$icon.attr('uk-icon', 'icon: close');
  23 + local.search(v);
  24 + }
  25 + run_flag = false;
  26 + }, 300);
  27 + });
  28 +
  29 + var searchComplete = function (e) {
  30 + var htmlStr = template('geo_d_e_search_result-temp', {list: e.wr});
  31 + $('.ct_search_result').html(htmlStr);
  32 +
  33 + };
  34 +
  35 + _$icon.on('click', function () {
  36 + var type = $(this).attr('uk-icon');
  37 + if(type=='icon: close'){
  38 + $('.ct_search_input').val('');//.trigger('input');
  39 + _$icon.attr('uk-icon', 'icon: search');
  40 + closeSearchResult();
  41 + }
  42 + });
  43 +
  44 + $(document).on('click', '.ct_search_result>ul.s_list>li', function () {
  45 + if($(this).hasClass('_empty'))
  46 + return;
  47 + var lat = $(this).data('lat');
  48 + var lng = $(this).data('lng');
  49 + gb_ct_map.focus(lat, lng);
  50 + });
  51 +
  52 + function closeSearchResult() {
  53 + $('.ct_search_result').empty();
  54 + gb_ct_map.clearfocus();
  55 + }
  56 +
  57 + return {init: function () {
  58 + local = new BMap.LocalSearch(gb_ct_map.map, {
  59 + onSearchComplete: searchComplete
  60 + })
  61 + }}
  62 +}();
0 \ No newline at end of file 63 \ No newline at end of file
src/main/resources/static/pages/base/geo_data_edit/js/station_route.js
@@ -10,6 +10,8 @@ var gb_station_route = function () { @@ -10,6 +10,8 @@ var gb_station_route = function () {
10 var ep = EventProxy.create("data", "temp", function (data, temp) { 10 var ep = EventProxy.create("data", "temp", function (data, temp) {
11 station_maps = data; 11 station_maps = data;
12 temps = temp; 12 temps = temp;
  13 + //当前使用的线路版本
  14 + storage.setItem("geo_data_edit_line_version" , data[0][0].versions);
13 //渲染页面 15 //渲染页面
14 var upHtmlStr = temps['geo_d_e_station_route-temp']({list: station_maps[0]}); 16 var upHtmlStr = temps['geo_d_e_station_route-temp']({list: station_maps[0]});
15 $('.up_down_route_list>li:first>.station_route').html(upHtmlStr); 17 $('.up_down_route_list>li:first>.station_route').html(upHtmlStr);
@@ -138,8 +140,18 @@ var gb_station_route = function () { @@ -138,8 +140,18 @@ var gb_station_route = function () {
138 if(is_duplication(name)) 140 if(is_duplication(name))
139 return UIkit.notification("站点路由名称重复!!", {status: 'danger'}); 141 return UIkit.notification("站点路由名称重复!!", {status: 'danger'});
140 142
  143 + debugger
  144 + //上一个站点的ID
  145 + var _cell = $(this).parents('.station_li_transient');
  146 + var $prev = prevs(_cell, 's_r_item')
  147 + if($prev.length > 0)
  148 + addPrevId = $prev.data('id');
  149 + else
  150 + addPrevId = -1;
  151 +
141 $('.main_left_panel_m_layer').show(); 152 $('.main_left_panel_m_layer').show();
142 gb_ct_map.showAddPointPanel(name); 153 gb_ct_map.showAddPointPanel(name);
  154 +
143 }); 155 });
144 //监听回车事件 156 //监听回车事件
145 $('[name=stationName]', addCell).on('keydown', function (e) { 157 $('[name=stationName]', addCell).on('keydown', function (e) {
@@ -147,12 +159,27 @@ var gb_station_route = function () { @@ -147,12 +159,27 @@ var gb_station_route = function () {
147 $('.search_point_icon_btn', addCell).trigger('click'); 159 $('.search_point_icon_btn', addCell).trigger('click');
148 }); 160 });
149 161
150 - //上一个站点的ID 162 + /*//上一个站点的ID
151 var $prev = addCell.prev('.s_r_item'); 163 var $prev = addCell.prev('.s_r_item');
152 if($prev.length > 0) 164 if($prev.length > 0)
153 addPrevId = $prev.data('id'); 165 addPrevId = $prev.data('id');
154 else 166 else
155 - addPrevId = -1; 167 + addPrevId = -1;*/
  168 + };
  169 +
  170 + var prevs = function (that, clazz) {
  171 + var prev;
  172 + while(true){
  173 + prev = $(that).prev();
  174 +
  175 + if(prev.length == 0)
  176 + return null;
  177 +
  178 + if(prev.hasClass(clazz))
  179 + return prev;
  180 +
  181 + that = prev;
  182 + }
156 }; 183 };
157 184
158 /** 185 /**
src/main/resources/static/pages/base/geo_data_edit/js/submit.js
@@ -112,14 +112,15 @@ var gb_data_submit = function () { @@ -112,14 +112,15 @@ var gb_data_submit = function () {
112 } 112 }
113 data.coords = gsectionVector.substr(0, gsectionVector.length - 1); 113 data.coords = gsectionVector.substr(0, gsectionVector.length - 1);
114 114
115 - console.log('road data', data);  
116 -  
117 show_run_text('正在提交数据...'); 115 show_run_text('正在提交数据...');
118 //添加 116 //添加
119 gb_common.$post('/_geo_data/addNewRoadRoute', data, function (rs) { 117 gb_common.$post('/_geo_data/addNewRoadRoute', data, function (rs) {
120 118
  119 + gb_road_route.updateList(rs.list);
121 hide_run_text(); 120 hide_run_text();
122 UIkit.notification("添加成功!", {status: 'success'}); 121 UIkit.notification("添加成功!", {status: 'success'});
  122 + $('.add_road_search_point_wrap').remove();
  123 + gb_ct_map.exitEditRoadStatus(null, true);
123 }); 124 });
124 }); 125 });
125 return false; 126 return false;
@@ -194,7 +195,7 @@ var gb_data_submit = function () { @@ -194,7 +195,7 @@ var gb_data_submit = function () {
194 delete road.cp; 195 delete road.cp;
195 gb_common.$post("/_geo_data/destroyRoad", road, function (rs) { 196 gb_common.$post("/_geo_data/destroyRoad", road, function (rs) {
196 197
197 - gb_road_route.destroyEnd(rs.list, road); 198 + gb_road_route.updateList(rs.list);
198 hide_run_text(); 199 hide_run_text();
199 UIkit.notification("撤销成功!", {status: 'success'}); 200 UIkit.notification("撤销成功!", {status: 'success'});
200 }); 201 });
src/main/resources/static/pages/base/geo_data_edit/js/version_manage.js
@@ -2,6 +2,41 @@ @@ -2,6 +2,41 @@
2 2
3 var gb_version_manage = function () { 3 var gb_version_manage = function () {
4 4
  5 + var array;
  6 + var lineName;
  7 + var current;
  8 +
  9 + var init = function (cVersion) {
  10 + var lineCode = storage.getItem("geo_data_edit_line_code");
  11 + //获取线路版本信息
  12 + gb_common.$get('/_geo_data/findVersionInfo', {lineCode: lineCode}, function (rs) {
  13 + array = rs.list;
  14 + lineName = array[0].lineName;
  15 +
  16 + //当前使用版本
  17 + for(var i=0,obj;obj=array[i++];){
  18 + if(obj.versions==cVersion){
  19 + current = obj;
  20 + break;
  21 + }
  22 + }
  23 +
  24 + if(!current){
  25 + alert('异常,无法选中当前线路版本!');
  26 + }
  27 +
  28 + //线路名称
  29 + $('.main_left_panel>._line_info>._line_name>span').text(lineName);
  30 + //当前版本
  31 + $('.main_left_panel ._version_dropdown_wrap>._version_text').html(current.name + '<i uk-icon="icon: chevron-down;ratio:.6"></i>');
  32 + });
  33 + };
  34 +
5 res_load_ep.emitLater('load_version_manage'); 35 res_load_ep.emitLater('load_version_manage');
6 - return {}; 36 + return {
  37 + init: init,
  38 + getLineName: function () {
  39 + return lineName;
  40 + }
  41 + };
7 }(); 42 }();
8 \ No newline at end of file 43 \ No newline at end of file
src/main/resources/static/pages/base/geo_data_edit/main.html
@@ -24,11 +24,11 @@ @@ -24,11 +24,11 @@
24 <div class="main_left_panel"> 24 <div class="main_left_panel">
25 <div class="_line_info"> 25 <div class="_line_info">
26 <div class="_line_name"> 26 <div class="_line_name">
27 - 961路 27 + <span></span>
28 <a uk-icon="icon: plus" class="add_line_version_icon" title="添加一个新的线路版本" uk-tooltip></a> 28 <a uk-icon="icon: plus" class="add_line_version_icon" title="添加一个新的线路版本" uk-tooltip></a>
29 </div> 29 </div>
30 <div class="_version_dropdown_wrap"> 30 <div class="_version_dropdown_wrap">
31 - <a class="_version_text">原始版本 <i uk-icon="icon: chevron-down;ratio:.6"></i></a> 31 + <a class="_version_text"></a>
32 <div uk-dropdown> 32 <div uk-dropdown>
33 <ul class="uk-nav uk-dropdown-nav"> 33 <ul class="uk-nav uk-dropdown-nav">
34 <li class="uk-nav-header">历史</li> 34 <li class="uk-nav-header">历史</li>
@@ -41,9 +41,9 @@ @@ -41,9 +41,9 @@
41 </ul> 41 </ul>
42 </div> 42 </div>
43 </div> 43 </div>
44 - <span class="clock_enable_version"> 44 + <!--<span class="clock_enable_version">
45 <a uk-icon="icon: clock;ratio: .7" class=""></a> 25:30:20 启用(20180206线路改道) 45 <a uk-icon="icon: clock;ratio: .7" class=""></a> 25:30:20 启用(20180206线路改道)
46 - </span> 46 + </span>-->
47 </div> 47 </div>
48 48
49 <div class="_route_info_wrap"> 49 <div class="_route_info_wrap">
@@ -72,16 +72,32 @@ @@ -72,16 +72,32 @@
72 </div> 72 </div>
73 </div> 73 </div>
74 <div class="main_lt_search_panel"> 74 <div class="main_lt_search_panel">
75 - <div class="uk-inline"> 75 + <div class="uk-inline ct_s_i_wrap">
76 <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span> 76 <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>
77 - <input class="uk-input search_input" placeholder="搜索地图位置" type="text"> 77 + <input class="uk-input ct_search_input" placeholder="搜索地图位置" type="text">
78 </div> 78 </div>
  79 + <div class="ct_search_result"></div>
79 </div> 80 </div>
80 <div class="main_rt_tools_panel"> 81 <div class="main_rt_tools_panel">
81 <a uk-icon="icon: info;ratio: .9" class="_icon"></a> 82 <a uk-icon="icon: info;ratio: .9" class="_icon"></a>
82 <a uk-icon="icon: expand;ratio: .9" class="_icon full_screen_icon"></a> 83 <a uk-icon="icon: expand;ratio: .9" class="_icon full_screen_icon"></a>
83 </div> 84 </div>
84 </div> 85 </div>
  86 +
  87 +<script id="geo_d_e_search_result-temp" type="text/html">
  88 + <ul class="s_list uk-list">
  89 + {{each list as obj i}}
  90 + <li data-lat="{{obj.point.lat}}" data-lng="{{obj.point.lng}}">
  91 + <span class="_title">{{obj.title}}</span>
  92 + <span class="_address">{{obj.address}}</span>
  93 + </li>
  94 + {{/each}}
  95 +
  96 + {{if list.length==0}}
  97 + <li class="_empty">没有搜索到相关数据!</li>
  98 + {{/if}}
  99 + </ul>
  100 +</script>
85 <!-- 百度 --> 101 <!-- 百度 -->
86 <script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> 102 <script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
87 <script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> 103 <script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
@@ -108,8 +124,6 @@ @@ -108,8 +124,6 @@
108 var $loadPanel = $('body>.loading'); 124 var $loadPanel = $('body>.loading');
109 //___________________________________ 125 //___________________________________
110 var storage = window.localStorage; 126 var storage = window.localStorage;
111 - storage.setItem("geo_data_edit_line_code" , "10648");  
112 - storage.setItem("geo_data_edit_line_version" , "1");  
113 //___________________________________ 127 //___________________________________
114 128
115 top.document.title = "绘制线路"; 129 top.document.title = "绘制线路";
@@ -140,7 +154,11 @@ @@ -140,7 +154,11 @@
140 }); 154 });
141 155
142 eq.once('end', function () { 156 eq.once('end', function () {
  157 + //线路版本信息
  158 + gb_version_manage.init(gb_station_route.getData()[0][0].versions);
  159 +
143 $loadPanel.hide(); 160 $loadPanel.hide();
  161 + gb_ct_search.init();
144 }); 162 });
145 }); 163 });
146 164
@@ -183,6 +201,7 @@ @@ -183,6 +201,7 @@
183 <script src="/pages/base/geo_data_edit/js/history_edit_logs.js" ></script> 201 <script src="/pages/base/geo_data_edit/js/history_edit_logs.js" ></script>
184 <script src="/pages/base/geo_data_edit/js/map.js" ></script> 202 <script src="/pages/base/geo_data_edit/js/map.js" ></script>
185 <script src="/pages/base/geo_data_edit/js/submit.js" ></script> 203 <script src="/pages/base/geo_data_edit/js/submit.js" ></script>
  204 +<script src="/pages/base/geo_data_edit/js/search.js" ></script>
186 <script type="text/javascript" 205 <script type="text/javascript"
187 src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script> 206 src="http://api.map.baidu.com/library/DrawingManager/1.4/src/DrawingManager_min.js"></script>
188 </body> 207 </body>