Commit 339fc40224fb35592dfad9576b7ac067e4008ae6

Authored by 潘钊
1 parent d7092003

update

Showing 21 changed files with 653 additions and 204 deletions
src/main/java/com/bsth/controller/realcontrol/RealMapController.java
... ... @@ -35,4 +35,17 @@ public class RealMapController {
35 35 public Map<String, Object> carParkSpatialData(){
36 36 return realMapService.carParkSpatialData();
37 37 }
  38 +
  39 +
  40 + /**
  41 + *
  42 + * @Title: findRouteByLine
  43 + * @Description: TODO(获取线路的站点,路段路由)
  44 + * @param @param lineCode
  45 + * @throws
  46 + */
  47 + @RequestMapping(value = "/findRouteByLine")
  48 + public Map<String, Object> findRouteByLine(@RequestParam String lineCode){
  49 + return realMapService.findRouteByLine(lineCode);
  50 + }
38 51 }
... ...
src/main/java/com/bsth/service/realcontrol/RealMapService.java
... ... @@ -9,4 +9,6 @@ public interface RealMapService {
9 9 Map<String, Object> stationSpatialData(String idx);
10 10  
11 11 Map<String,Object> carParkSpatialData();
  12 +
  13 + Map<String,Object> findRouteByLine(String lineCode);
12 14 }
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
1 1 package com.bsth.service.realcontrol;
2 2  
3   -import java.util.Collection;
4   -import java.util.List;
5   -import java.util.Map;
6   -
7   -import org.springframework.stereotype.Service;
8   -
9 3 import com.bsth.controller.realcontrol.dto.ChangePersonCar;
10 4 import com.bsth.controller.realcontrol.dto.DfsjChange;
11 5 import com.bsth.entity.realcontrol.ScheduleRealInfo;
12 6 import com.bsth.service.BaseService;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import java.util.Collection;
  10 +import java.util.List;
  11 +import java.util.Map;
13 12  
14 13 @Service
15 14 public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, Long>{
... ...
src/main/java/com/bsth/service/realcontrol/dto/SectionRouteCoords.java 0 → 100644
  1 +package com.bsth.service.realcontrol.dto;
  2 +
  3 +/**
  4 + * 线调地图 路段路由DTO
  5 + * Created by panzhao on 2016/12/1.
  6 + */
  7 +public class SectionRouteCoords {
  8 +
  9 + private int id;
  10 +
  11 + private String lineCode;
  12 +
  13 + private String sectionCode;
  14 +
  15 + private String sectionrouteCode;
  16 +
  17 + private int directions;
  18 +
  19 + private String sectionName;
  20 +
  21 + private String gsectionVector;
  22 +
  23 + private Float sectionDistance;
  24 +
  25 + private Float sectionTime;
  26 +
  27 + public int getId() {
  28 + return id;
  29 + }
  30 +
  31 + public void setId(int id) {
  32 + this.id = id;
  33 + }
  34 +
  35 + public String getLineCode() {
  36 + return lineCode;
  37 + }
  38 +
  39 + public void setLineCode(String lineCode) {
  40 + this.lineCode = lineCode;
  41 + }
  42 +
  43 + public String getSectionCode() {
  44 + return sectionCode;
  45 + }
  46 +
  47 + public void setSectionCode(String sectionCode) {
  48 + this.sectionCode = sectionCode;
  49 + }
  50 +
  51 + public String getSectionrouteCode() {
  52 + return sectionrouteCode;
  53 + }
  54 +
  55 + public void setSectionrouteCode(String sectionrouteCode) {
  56 + this.sectionrouteCode = sectionrouteCode;
  57 + }
  58 +
  59 + public int getDirections() {
  60 + return directions;
  61 + }
  62 +
  63 + public void setDirections(int directions) {
  64 + this.directions = directions;
  65 + }
  66 +
  67 + public String getSectionName() {
  68 + return sectionName;
  69 + }
  70 +
  71 + public void setSectionName(String sectionName) {
  72 + this.sectionName = sectionName;
  73 + }
  74 +
  75 + public String getGsectionVector() {
  76 + return gsectionVector;
  77 + }
  78 +
  79 + public void setGsectionVector(String gsectionVector) {
  80 + this.gsectionVector = gsectionVector;
  81 + }
  82 +
  83 + public Float getSectionDistance() {
  84 + return sectionDistance;
  85 + }
  86 +
  87 + public void setSectionDistance(Float sectionDistance) {
  88 + this.sectionDistance = sectionDistance;
  89 + }
  90 +
  91 + public Float getSectionTime() {
  92 + return sectionTime;
  93 + }
  94 +
  95 + public void setSectionTime(Float sectionTime) {
  96 + this.sectionTime = sectionTime;
  97 + }
  98 +}
... ...
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java
... ... @@ -4,6 +4,8 @@ import com.bsth.common.ResponseCode;
4 4 import com.bsth.controller.realcontrol.dto.StationSpatialData;
5 5 import com.bsth.entity.CarPark;
6 6 import com.bsth.service.realcontrol.RealMapService;
  7 +import com.bsth.service.realcontrol.dto.SectionRouteCoords;
  8 +import com.bsth.util.TransGPS;
7 9 import com.google.common.base.Splitter;
8 10 import org.slf4j.Logger;
9 11 import org.slf4j.LoggerFactory;
... ... @@ -12,9 +14,7 @@ import org.springframework.jdbc.core.BeanPropertyRowMapper;
12 14 import org.springframework.jdbc.core.JdbcTemplate;
13 15 import org.springframework.stereotype.Service;
14 16  
15   -import java.util.HashMap;
16   -import java.util.List;
17   -import java.util.Map;
  17 +import java.util.*;
18 18  
19 19 /**
20 20 * Created by panzhao on 2016/11/23.
... ... @@ -36,13 +36,13 @@ public class RealMapServiceImpl implements RealMapService {
36 36 //拼接in语句
37 37 String inStr = "";
38 38 for (String code : idArray) {
39   - inStr += (",'" + code+"'");
  39 + inStr += (",'" + code + "'");
40 40 }
41 41 inStr = " (" + inStr.substring(1) + ")";
42 42  
43   - String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,s.G_LONX,s.G_LATY,s.RADIUS,s.SHAPES_TYPE,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID, r.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in "+inStr+" and r.destroy=0";
  43 + String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,s.G_LONX,s.G_LATY,s.RADIUS,s.SHAPES_TYPE,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID, r.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in " + inStr + " and r.destroy=0";
44 44  
45   - List<StationSpatialData> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(StationSpatialData.class));
  45 + List<StationSpatialData> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(StationSpatialData.class));
46 46 rs.put("status", ResponseCode.SUCCESS);
47 47 rs.put("list", list);
48 48 } catch (Exception e) {
... ... @@ -61,7 +61,7 @@ public class RealMapServiceImpl implements RealMapService {
61 61 try {
62 62 String sql = "select ID, AREA,PARK_CODE,PARK_NAME,ST_AsText(G_PARK_POINT) as G_PARK_POINT,G_CENTER_POINT,RADIUS,SHAPES_TYPE from bsth_c_car_park WHERE destroy=0 and shapes_type='d'";
63 63  
64   - List<CarPark> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(CarPark.class));
  64 + List<CarPark> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(CarPark.class));
65 65 rs.put("status", ResponseCode.SUCCESS);
66 66 rs.put("list", list);
67 67 } catch (Exception e) {
... ... @@ -71,4 +71,99 @@ public class RealMapServiceImpl implements RealMapService {
71 71 }
72 72 return rs;
73 73 }
  74 +
  75 + @Override
  76 + public Map<String, Object> findRouteByLine(String lineCode) {
  77 + Map<String, Object> rs = new HashMap<>();
  78 + String sql = "SELECT r.ID,r.LINE_CODE,r.SECTION_CODE,r.SECTIONROUTE_CODE,r.DIRECTIONS,s.SECTION_NAME,ST_AsText(s.GSECTION_VECTOR) GSECTION_VECTOR,s.SECTION_DISTANCE,s.SECTION_TIME FROM bsth_c_sectionroute r INNER JOIN bsth_c_section s on r.section_code=s.section_code WHERE r.line_code=? and r.destroy=0 order by sectionroute_code";
  79 + List<SectionRouteCoords> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(SectionRouteCoords.class), lineCode);
  80 +
  81 + //排序
  82 + Collections.sort(list, new Comparator<SectionRouteCoords>() {
  83 + @Override
  84 + public int compare(SectionRouteCoords o1, SectionRouteCoords o2) {
  85 + return Integer.parseInt(o1.getSectionrouteCode()) - Integer.parseInt(o2.getSectionrouteCode());
  86 + }
  87 + });
  88 +
  89 + List<String> upList = new ArrayList<>(),
  90 + downList = new ArrayList<>();
  91 +
  92 + String vectorStr = "";
  93 + for (SectionRouteCoords sr : list) {
  94 + vectorStr = sr.getGsectionVector();
  95 + vectorStr = vectorStr.substring(11, vectorStr.length() - 2);
  96 +
  97 + if (sr.getDirections() == 0)
  98 + upList.add(vectorStr);
  99 + else
  100 + downList.add(vectorStr);
  101 + }
  102 +
  103 + rs.put("up", upList);
  104 + rs.put("down", downList);
  105 + rs.put("up_bd", multiWgsToBd(upList));
  106 + rs.put("down_bd", multiWgsToBd(downList));
  107 + rs.put("up_gcj", multiWgsToGcj(upList));
  108 + rs.put("down_gcj", multiWgsToGcj(downList));
  109 +
  110 + rs.put("lineId", lineCode);
  111 + return rs;
  112 + }
  113 +
  114 + /**
  115 + * wgs 坐标数组转 百度
  116 + * @param list
  117 + * @return
  118 + */
  119 + private List<String> multiWgsToBd(List<String> list) {
  120 + List<String> bdList = new ArrayList<>();
  121 +
  122 + StringBuilder itemStr;
  123 + String[] subArr, cds;
  124 + TransGPS.Location location;
  125 + for(String item : list){
  126 + subArr = item.split(",");
  127 +
  128 + itemStr = new StringBuilder();
  129 + for(String coord : subArr){
  130 + cds = coord.split(" ");
  131 + //城建转经纬度
  132 + //Map<String, Double> map = JWDUtil.ConvertSHToJW(Double.parseDouble(cds[0]), Double.parseDouble(cds[1]));
  133 +
  134 +
  135 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(Double.parseDouble(cds[0]), Double.parseDouble(cds[1]))));
  136 + itemStr.append(location.getLng() + " " + location.getLat() + ",");
  137 + }
  138 +
  139 + bdList.add(itemStr.substring(0, itemStr.length() - 1));
  140 + }
  141 + return bdList;
  142 + }
  143 +
  144 + /**
  145 + * wgs 坐标数组转 Gcj
  146 + * @param list
  147 + * @return
  148 + */
  149 + private List<String> multiWgsToGcj(List<String> list) {
  150 + List<String> gcjList = new ArrayList<>();
  151 +
  152 + StringBuilder itemStr;
  153 + String[] subArr, cds;
  154 + TransGPS.Location location;
  155 + for(String item : list){
  156 + subArr = item.split(",");
  157 +
  158 + itemStr = new StringBuilder();
  159 + for(String coord : subArr){
  160 + cds = coord.split(" ");
  161 + location = TransGPS.transformFromWGSToGCJ(TransGPS.LocationMake(Double.parseDouble(cds[0]), Double.parseDouble(cds[1])));
  162 + itemStr.append(location.getLng() + " " + location.getLat() + ",");
  163 + }
  164 +
  165 + gcjList.add(itemStr.substring(0, itemStr.length() - 1));
  166 + }
  167 + return gcjList;
  168 + }
74 169 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -33,7 +33,6 @@ import com.bsth.service.SectionRouteService;
33 33 import com.bsth.service.impl.BaseServiceImpl;
34 34 import com.bsth.service.realcontrol.ScheduleRealInfoService;
35 35 import com.bsth.util.*;
36   -import com.bsth.util.TransGPS.Location;
37 36 import com.bsth.websocket.handler.SendUtils;
38 37 import com.google.common.base.Splitter;
39 38 import com.google.common.collect.ArrayListMultimap;
... ... @@ -991,7 +990,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
991 990 return "";
992 991  
993 992 String gcjStr = "";
994   - Location location;
  993 + TransGPS.Location location;
995 994 for(String crd : array){
996 995 subArray = crd.split(" ");
997 996 if(subArray.length != 2)
... ...
src/main/resources/static/pages/control/lineallot/allot.html
... ... @@ -404,6 +404,7 @@ $(function(){
404 404 var f = arguments.callee
405 405 ,item = lsData[i];
406 406  
  407 + //$.get('/realMap/findRouteByLine', {lineCode: item.lineCode}, function(rs){
407 408 $.get('/realSchedule/findRouteByLine', {lineCode: item.lineCode}, function(rs){
408 409 if(rs && rs.lineId){
409 410 cacheData[item.lineCode] = rs;
... ...
src/main/resources/static/real_control_v2/css/line_schedule.css
... ... @@ -309,7 +309,7 @@ span.fcsj-diff {
309 309  
310 310 .ct-form-modal form input, .ct-form-modal form select {
311 311 width: 100%;
312   - height: 34px!important;
  312 + height: 34px;
313 313 }
314 314  
315 315 .ct-form-modal form small.font-danger {
... ... @@ -690,7 +690,7 @@ i.add-temp-sch-icon:hover{
690 690  
691 691 input.i-cbox[type=checkbox]{
692 692 width: 20px;
693   - height: 18px !important;
  693 + height: 18px;
694 694 vertical-align: middle;
695 695 margin-top: -3px;
696 696 }
... ... @@ -846,4 +846,23 @@ input.i-cbox[type=checkbox]{
846 846 color: #bab6b6;
847 847 font-family: 微软雅黑;
848 848 font-size: 13px;
  849 +}
  850 +
  851 +#add-sub-task-inpark-modal .uk-panel-box{
  852 + background-color: #ffffff;
  853 +}
  854 +
  855 +#add-sub-task-inpark-modal .pl5{
  856 + padding-left: 5px;
  857 +}
  858 +
  859 +#add-sub-task-inpark-modal.uk-modal .uk-form.fv-form{
  860 + margin-bottom: 0px !important;
  861 +}
  862 +#add-sub-task-inpark-modal .uk-form select{
  863 + width: 100%
  864 +}
  865 +
  866 +#add-sub-task-inpark-modal .uk-grid{
  867 + margin-top: 10px;
849 868 }
850 869 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -314,4 +314,20 @@ li.map-panel{
314 314 .main-container .load-panel{
315 315 display: block;
316 316 color: #999797;
  317 +}
  318 +
  319 +.uk-panel-box-danger {
  320 + background-color: #fff1f0;
  321 + color: #d85030;
  322 + border-color: rgba(216,80,48,.3);
  323 +}
  324 +
  325 +.uk-panel-box-danger .uk-panel-title {
  326 + color: #d85030;
  327 +}
  328 +
  329 +.uk-badge-default {
  330 + background-color: #a09b9c;
  331 + background-image: -webkit-linear-gradient(top,#9a9898,#8c8687);
  332 + background-image: linear-gradient(to bottom,#9a9898,#8c8687);
317 333 }
318 334 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
... ... @@ -37,7 +37,7 @@
37 37 <dl>
38 38 <dt>序号</dt>
39 39 <dt>开始时间
40   - <i class="uk-icon-question-circle" data-uk-tooltip title="蓝色字为实发时间"></i></dt>
  40 + <i class="uk-icon-question-circle" data-uk-tooltip title="蓝色字为实发时间"></i></dt>
41 41 <dt>结束时间</dt>
42 42 <dt>起点</dt>
43 43 <dt>终点</dt>
... ... @@ -79,9 +79,9 @@
79 79 <dd>{{i+1}}</dd>
80 80 <dd>
81 81 {{if sch.fcsjActual==null}}
82   - {{sch.dfsj}}
  82 + {{sch.dfsj}}
83 83 {{else}}
84   - <span class="sjfc-time">{{sch.fcsjActual}}</span>
  84 + <span class="sjfc-time">{{sch.fcsjActual}}</span>
85 85 {{/if}}
86 86  
87 87 {{if sch.bcType == "out"}}
... ... @@ -98,7 +98,7 @@
98 98 {{/if}}
99 99  
100 100 {{if sch.cTasks.length > 0}}
101   - <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span>
  101 + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span>
102 102 {{/if}}
103 103 </dd>
104 104 <dd>{{sch.zdsj}}</dd>
... ... @@ -111,67 +111,67 @@
111 111 {{/each}}
112 112 </script>
113 113 <script id="sub_task-table-temp" type="text/html">
114   - {{each list as task i}}
  114 + {{each list as task i}}
115 115 <dl data-id="{{task.id}}">
116   - <dd>{{i+1}}</dd>
117   - <dd><span class="nt-dictionary" data-group="ChildTaskType">{{task.type2}}</span></dd>
118   - <dd>{{task.startStationName}}</dd>
119   - <dd>{{task.endStationName}}</dd>
120   - <dd>{{task.startDate}}</dd>
121   - <dd>{{task.endDate}}</dd>
122   - <dd>
123   - {{task.mileage}}
124   - (<span class="nt-dictionary" data-group="MileageType">{{task.mileageType}}</span>
125   - {{if task.destroy}}
126   - <small style="color:red;">烂班</small>
127   - {{/if}}
128   - )
129   - </dd>
130   - <dd title="{{task.remarks}}">{{task.remarks}}</dd>
  116 + <dd>{{i+1}}</dd>
  117 + <dd><span class="nt-dictionary" data-group="ChildTaskType">{{task.type2}}</span></dd>
  118 + <dd>{{task.startStationName}}</dd>
  119 + <dd>{{task.endStationName}}</dd>
  120 + <dd>{{task.startDate}}</dd>
  121 + <dd>{{task.endDate}}</dd>
  122 + <dd>
  123 + {{task.mileage}}
  124 + (<span class="nt-dictionary" data-group="MileageType">{{task.mileageType}}</span>
  125 + {{if task.destroy}}
  126 + <small style="color:red;">烂班</small>
  127 + {{/if}}
  128 + )
  129 + </dd>
  130 + <dd title="{{task.remarks}}">{{task.remarks}}</dd>
131 131 </dl>
132   - {{/each}}
  132 + {{/each}}
133 133 </script>
134 134 <script>
135   - (function() {
136   - var modal_opts = { center: false, bgclose: false, modal:false }
  135 + (function () {
  136 + var modal_opts = {center: false, bgclose: false, modal: false}
137 137 var modal = '#schedule-lj_zrw-modal',
138   - f,
139   - m_t_body = '.main-schedule-table .ct_table_body',
140   - s_t_body = '.sub-task-table .ct_table_body',
141   - folder = '/real_control_v2/fragments/line_schedule/context_menu',
142   - sch, schList, lp2SchMap;
143   - $(modal).on('init', function(e, data) {
  138 + f,
  139 + m_t_body = '.main-schedule-table .ct_table_body',
  140 + s_t_body = '.sub-task-table .ct_table_body',
  141 + folder = '/real_control_v2/fragments/line_schedule/context_menu',
  142 + sch, schList, lp2SchMap;
  143 + $(modal).on('init', function (e, data) {
144 144 sch = data.sch;
145 145  
146 146 f = $('.search-form', modal);
147 147 //线路下拉框
148 148 var opts = '';
149   - $.each(gb_data_basic.activeLines, function() {
  149 + $.each(gb_data_basic.activeLines, function () {
150 150 opts += '<option value="' + this.lineCode + '">' + this.name + '</option>';
151 151 });
152 152 $('[name=lineSelect]', f).html(opts)
153   - .on('change', function() {
154   - var lineCode = $(this).val();
155   - schList = gb_schedule_table.findScheduleByLine(lineCode);
156   - lp2SchMap = gb_common.groupBy(schList, 'lpName');
  153 + .on('change', function () {
  154 + var lineCode = $(this).val();
  155 + schList = gb_schedule_table.findScheduleByLine(lineCode);
  156 + lp2SchMap = gb_common.groupBy(schList, 'lpName');
157 157  
158   - var opts = '';
159   - for (var lpName in lp2SchMap)
160   - opts += '<option value="' + lpName + '">' + lpName + '</option>';
161   - $('[name=lpName]', f).html(opts).trigger('change');
162   - });
  158 + var opts = '';
  159 + for (var lpName in lp2SchMap)
  160 + opts += '<option value="' + lpName + '">' + lpName + '</option>';
  161 + $('[name=lpName]', f).html(opts).trigger('change');
  162 + });
163 163  
164 164 //路牌下拉框
165   - $('[name=lpName]', f).on('change', function() {
  165 + $('[name=lpName]', f).on('change', function () {
166 166 var list = lp2SchMap[$(this).val()].sort(gb_schedule_table.schedule_sort),
167   - htmlBody = template('schedule-main-table-temp', {
168   - list: list
169   - });
  167 + htmlBody = template('schedule-main-table-temp', {
  168 + list: list
  169 + });
170 170 $(m_t_body, modal).html(htmlBody);
171 171 $(s_t_body, modal).empty();
172 172 });
173 173 //班次点击
174   - $(modal).on('click contextmenu', m_t_body + ' dl', function() {
  174 + $(modal).on('click contextmenu', m_t_body + ' dl', function () {
175 175 $(this).parent().find('.active').removeClass('active');
176 176 $(this).addClass('active');
177 177 //show 子任务
... ... @@ -186,122 +186,133 @@
186 186 selectedDl(sch);
187 187 });
188 188  
189   - function selectedDl(sch){
190   - //默认选中项
191   - $('[name=lineSelect]', f).val(sch.xlBm).trigger('change');
192   - $('[name=lpName]', f).val(sch.lpName).trigger('change');
193   - var dl = $('.main-schedule-table', modal).find('dl[data-id=' + sch.id + ']').trigger('click');
194   - //滚动到可视区域
195   - var cont = $('.main-schedule-wrap', modal);
196   - cont.animate({
197   - scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - 38
198   - }, 500);
  189 + function selectedDl(sch) {
  190 + //默认选中项
  191 + $('[name=lineSelect]', f).val(sch.xlBm).trigger('change');
  192 + $('[name=lpName]', f).val(sch.lpName).trigger('change');
  193 + var dl = $('.main-schedule-table', modal).find('dl[data-id=' + sch.id + ']').trigger('click');
  194 + //滚动到可视区域
  195 + var cont = $('.main-schedule-wrap', modal);
  196 + cont.animate({
  197 + scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - 38
  198 + }, 500);
199 199 }
200 200  
201   - function getActiveSch(){
202   - var dl=$('.main-schedule-table dl.active', modal)
203   - ,sch, lineCode=$('[name=lineSelect]', f).val();
204   - if(dl.length > 0)
205   - sch=gb_schedule_table.findScheduleByLine(lineCode)[dl.data('id')];
  201 + function getActiveSch() {
  202 + var dl = $('.main-schedule-table dl.active', modal)
  203 + , sch, lineCode = $('[name=lineSelect]', f).val();
  204 + if (dl.length > 0)
  205 + sch = gb_schedule_table.findScheduleByLine(lineCode)[dl.data('id')];
206 206  
207   - return sch;
  207 + return sch;
208 208 }
209 209  
210 210 //刷新主任务表格
211   - var m_s_table_update=function(e, opts){
212   - var lineCode=$('[name=lineSelect]', f).val();
213   - //重新获取班次数据
214   - schList = gb_schedule_table.findScheduleByLine(lineCode);
215   - lp2SchMap = gb_common.groupBy(schList, 'lpName');
216   - $('[name=lpName]', f).trigger('change');
  211 + var m_s_table_update = function (e, opts) {
  212 + var lineCode = $('[name=lineSelect]', f).val();
  213 + //重新获取班次数据
  214 + schList = gb_schedule_table.findScheduleByLine(lineCode);
  215 + lp2SchMap = gb_common.groupBy(schList, 'lpName');
  216 + $('[name=lpName]', f).trigger('change');
217 217  
218   - if(opts && opts.sch){
219   - selectedDl(opts.sch);
220   - }
  218 + if (opts && opts.sch) {
  219 + selectedDl(opts.sch);
  220 + }
221 221 }
222 222  
223 223 //刷新子任务表格
224   - var sub_task_update=function(){
225   - var sch=getActiveSch()
226   - ,htmlStr=''
227   - ,tbody=$(s_t_body, modal);
228   - sch.cTasks.sort(sub_task_sort);
229   - htmlStr = template('sub_task-table-temp', {list: sch.cTasks});
230   - tbody.html(htmlStr);
231   - //字典转换
232   - dictionaryUtils.transformDom($('.nt-dictionary', tbody));
  224 + var sub_task_update = function () {
  225 + var sch = getActiveSch()
  226 + , htmlStr = ''
  227 + , tbody = $(s_t_body, modal);
  228 + sch.cTasks.sort(sub_task_sort);
  229 + htmlStr = template('sub_task-table-temp', {list: sch.cTasks});
  230 + tbody.html(htmlStr);
  231 + //字典转换
  232 + dictionaryUtils.transformDom($('.nt-dictionary', tbody));
233 233 }
234 234  
235 235 //新增临加
236   - var add_temp_sch=function(){
237   - var sch=getActiveSch();
238   - if(!sch)
239   - sch={xlBm: $('[name=lineSelect]', f).val(), lpName: $('[name=lpName]', f).val()};
  236 + var add_temp_sch = function () {
  237 + var sch = getActiveSch();
  238 + if (!sch)
  239 + sch = {xlBm: $('[name=lineSelect]', f).val(), lpName: $('[name=lpName]', f).val()};
240 240  
241   - open_modal(folder + '/add_temp_sch.html', {
242   - sch:sch
243   - }, modal_opts);
  241 + open_modal(folder + '/add_temp_sch.html', {
  242 + sch: sch
  243 + }, modal_opts);
244 244 }
245 245  
246 246 //删除临加班次
247   - var remove_sch=function(){
248   - var sch = getActiveSch();
249   - if(!sch || !sch.sflj)
250   - return notify_err('只能删除临加班次!');
251   - var str='<h3>确定要删除临加班次<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>?</h3>';
252   - alt_confirm(str, function(){
253   - gb_common.$del('/realSchedule/' + sch.id, function(rs){
254   - //前端数据更新
255   - gb_schedule_table.updateSchedule(rs.ts);
256   - gb_schedule_table.deheteSchedule(rs.delete);
257   - //m_s_table_update();
258   - $('.main-schedule-table', modal).trigger('refresh');
259   - });
260   - }, '确定删除');
261   - }
  247 + var remove_sch = function () {
  248 + var sch = getActiveSch();
  249 + if (!sch || !sch.sflj)
  250 + return notify_err('只能删除临加班次!');
  251 + var str = '<h3>确定要删除临加班次<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>?</h3>';
  252 + alt_confirm(str, function () {
  253 + gb_common.$del('/realSchedule/' + sch.id, function (rs) {
  254 + //前端数据更新
  255 + gb_schedule_table.updateSchedule(rs.ts);
  256 + gb_schedule_table.deheteSchedule(rs.delete);
  257 + //m_s_table_update();
  258 + $('.main-schedule-table', modal).trigger('refresh');
  259 + });
  260 + }, '确定删除');
  261 + };
262 262 //添加自定义子任务
263   - var add_sub_task_other=function(){
264   - var sch=getActiveSch();
265   - if(!sch)
266   - return notify_err('无法获取到主任务信息!');
267   - open_modal(folder + '/sub_task/add_sub_task_other.html', {
268   - sch:sch
269   - }, modal_opts);
270   - }
  263 + var add_sub_task_other = function () {
  264 + var sch = getActiveSch();
  265 + if (!sch)
  266 + return notify_err('无法获取到主任务信息!');
  267 + open_modal(folder + '/sub_task/add_sub_task_other.html', {
  268 + sch: sch
  269 + }, modal_opts);
  270 + };
  271 +
  272 + //回场子任务
  273 + var add_sub_task_in = function () {
  274 + var sch = getActiveSch();
  275 + if (!sch)
  276 + return notify_err('无法获取到主任务信息!');
  277 + open_modal(folder + '/sub_task/add_sub_task_inpark.html', {
  278 + sch: sch
  279 + }, modal_opts);
  280 + };
271 281  
272 282 //删除子任务
273   - var remove_sub_task=function(){
274   - var activeDl=$(s_t_body, modal).find('dl.context-menu-active');
275   - if(activeDl.length==0)
276   - return;
277   - var dds=activeDl.find('dd');
278   - console.log(dds);
279   - var id=activeDl.data('id')
280   - ,str='<h3>确定要删除子任务<span style="color:red;margin: 0 5px;">'+ $(dds[4]).text()+','+ $(dds[6]).text() +' </span>?</h3>';
281   - alt_confirm(str, function(){
282   - gb_common.$del('/childTask/' + id, function(rs){
283   - gb_schedule_table.updateSchedule(rs.t);
284   - notify_succ('删除子任务成功!');
285   - //刷新班次列表
286   - m_s_table_update();
287   - //选中班次
288   - selectedDl(rs.t);
289   - });
290   - }, '确定删除');
291   - }
  283 + var remove_sub_task = function () {
  284 + var activeDl = $(s_t_body, modal).find('dl.context-menu-active');
  285 + if (activeDl.length == 0)
  286 + return;
  287 + var dds = activeDl.find('dd');
  288 + console.log(dds);
  289 + var id = activeDl.data('id')
  290 + , str = '<h3>确定要删除子任务<span style="color:red;margin: 0 5px;">' + $(dds[4]).text() + ',' + $(dds[6]).text() + ' </span>?</h3>';
  291 + alt_confirm(str, function () {
  292 + gb_common.$del('/childTask/' + id, function (rs) {
  293 + gb_schedule_table.updateSchedule(rs.t);
  294 + notify_succ('删除子任务成功!');
  295 + //刷新班次列表
  296 + m_s_table_update();
  297 + //选中班次
  298 + selectedDl(rs.t);
  299 + });
  300 + }, '确定删除');
  301 + };
292 302  
293   - var callbackHandler={
294   - add_temp_sch:add_temp_sch,
295   - remove_sch: remove_sch,
296   - add_sub_task_other:add_sub_task_other,
297   - remove_sub_task: remove_sub_task
298   - }
  303 + var callbackHandler = {
  304 + add_temp_sch: add_temp_sch,
  305 + remove_sch: remove_sch,
  306 + add_sub_task_other: add_sub_task_other,
  307 + add_sub_task_in: add_sub_task_in,
  308 + remove_sub_task: remove_sub_task
  309 + };
299 310  
300 311 //右键菜单
301 312 $.contextMenu({
302   - selector: modal+ ' '+m_t_body+' dl',
  313 + selector: modal + ' ' + m_t_body + ' dl',
303 314 className: 'schedule-ct-menu',
304   - callback: function(key, options) {
  315 + callback: function (key, options) {
305 316 callbackHandler[key] && callbackHandler[key]();
306 317 },
307 318 items: {
... ... @@ -313,11 +324,11 @@
313 324 items: {
314 325 'add_sub_task_in': {
315 326 name: '回场',
316   - disabled:true
  327 + disabled: true
317 328 },
318 329 'add_sub_task_out': {
319 330 name: '出场',
320   - disabled:true
  331 + disabled: true
321 332 },
322 333 'add_sub_task_other': {
323 334 name: '自定义'
... ... @@ -325,16 +336,16 @@
325 336 }
326 337 },
327 338 'remove_sch': {
328   - name: '删除'
  339 + name: '删除'
329 340 }
330 341 }
331 342 });
332 343  
333 344 //右键菜单
334 345 $.contextMenu({
335   - selector: modal+' '+s_t_body+' dl',
  346 + selector: modal + ' ' + s_t_body + ' dl',
336 347 className: 'schedule-ct-menu',
337   - callback: function(key, options) {
  348 + callback: function (key, options) {
338 349 callbackHandler[key] && callbackHandler[key]();
339 350 },
340 351 items: {
... ... @@ -349,8 +360,8 @@
349 360  
350 361 $('.add-temp-sch-icon', modal).on('click', add_temp_sch);
351 362  
352   - function sub_task_sort(a, b){
353   - return a.id - b.id;
  363 + function sub_task_sort(a, b) {
  364 + return a.id - b.id;
354 365 }
355 366 })();
356 367 </script>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_inpark.html 0 → 100644
  1 +<div class="uk-modal" id="add-sub-task-inpark-modal">
  2 + <div class="uk-modal-dialog" style="width: 935px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>回场子任务</h2></div>
  6 +
  7 + <div class="uk-grid tm-grid-truncate" data-uk-grid-margin="">
  8 + <div class="uk-width-medium-1-3 uk-row-first">
  9 + <div class="uk-panel uk-panel-box uk-panel-box-primary">
  10 + <div class="uk-panel-badge uk-badge">营运</div>
  11 + <h3 class="uk-panel-title">线路上站点间</h3>
  12 + <form class="uk-form uk-form-horizontal">
  13 + <div class="uk-grid">
  14 + <div class="uk-width-3-10">
  15 + <div class="uk-form-row">
  16 + <label class="uk-form-label">起点 </label>
  17 + </div>
  18 + </div>
  19 + <div class="uk-width-7-10 pl5">
  20 + <select name="startStation" required></select>
  21 + </div>
  22 + </div>
  23 + <div class="uk-grid">
  24 + <div class="uk-width-3-10">
  25 + <div class="uk-form-row">
  26 + <label class="uk-form-label">终点 </label>
  27 + </div>
  28 + </div>
  29 + <div class="uk-width-7-10 pl5">
  30 + <select name="endStation" required></select>
  31 + </div>
  32 + </div>
  33 + <div class="uk-grid">
  34 + <div class="uk-width-3-10">
  35 + <div class="uk-form-row">
  36 + <label class="uk-form-label">营运里程</label>
  37 + </div>
  38 + </div>
  39 + <div class="uk-width-7-10 pl5">
  40 + <select name="endStation" required></select>
  41 + </div>
  42 + </div>
  43 + </form>
  44 + </div>
  45 + </div>
  46 + <div class="uk-width-medium-1-3">
  47 + <div class="uk-panel uk-panel-box uk-panel-box-secondary">
  48 + <div class="uk-panel-badge uk-badge uk-badge-default">空驶</div>
  49 + <h3 class="uk-panel-title">进场</h3>
  50 + Lorem ipsum dolor sit amet, consectetur adipisicing elit. <code>.uk-panel-box-primary</code>
  51 + </div>
  52 + </div>
  53 + <div class="uk-width-medium-1-3">
  54 + <div class="uk-panel uk-panel-box uk-panel-box-danger">
  55 + <div class="uk-panel-badge uk-badge uk-badge-danger">烂班</div>
  56 + <h3 class="uk-panel-title">线路上站点间</h3>
  57 + Lorem ipsum dolor sit amet, consectetur adipisicing elit. <code>.uk-panel-box-primary</code>
  58 + </div>
  59 + </div>
  60 + </div>
  61 + </div>
  62 +
  63 + <script id="sub-task-inpark-form-temp" type="text/html">
  64 + </script>
  65 +
  66 + <script>
  67 + (function() {
  68 + var modal = '#add-sub-task-inpark-modal',
  69 + sch, stationRoutes, parks, information;
  70 + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他'];
  71 + $(modal).on('init', function(e, data) {
  72 + sch = data.sch;
  73 + //var formHtml = template('sub-task-inpark-form-temp', {sch:sch, adjustExps: adjustExps});
  74 + //$('form', modal).html(formHtml);
  75 + //字典转换
  76 + //dictionaryUtils.transformDom($('.nt-dictionary', modal));
  77 +
  78 + //站点路由
  79 + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function(a, b){
  80 + return a.stationRouteCode-b.stationRouteCode;
  81 + }), 'directions');
  82 + //停车场
  83 + $.get('/basic/parks', function(rs){
  84 + parks=rs;
  85 + });
  86 + //线路标准
  87 + information=gb_data_basic.getLineInformation(sch.xlBm);
  88 +
  89 + //submit
  90 + var f = $('form', modal).formValidation(gb_form_validation_opts);
  91 + f.on('success.form.fv', function(e) {
  92 + disabled_submit_btn(this);
  93 + e.preventDefault();
  94 + var data = $(this).serializeJSON();
  95 +/*
  96 + gb_common.$post('/childTask', data, function(rs){
  97 + notify_succ('子任务添加成功');
  98 + gb_schedule_table.updateSchedule(rs.t);
  99 + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: rs.t});
  100 + UIkit.modal(modal).hide();
  101 + });*/
  102 + });
  103 + });
  104 + })();
  105 + </script>
  106 +</div>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_other.html
... ... @@ -2,7 +2,7 @@
2 2 <div class="uk-modal-dialog" style="width: 635px;">
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 4 <div class="uk-modal-header">
5   - <h2>新增自定义子任务</h2></div>
  5 + <h2>自定义子任务</h2></div>
6 6 <form class="uk-form uk-form-horizontal">
7 7 </form>
8 8 </div>
... ...
src/main/resources/static/real_control_v2/js/common.js
... ... @@ -124,8 +124,8 @@ var gb_common = (function () {
124 124 }
125 125  
126 126 var get_device_tree_data = function (allGps, idBefore) {
127   - if(!idBefore)
128   - idBefore='';
  127 + if (!idBefore)
  128 + idBefore = '';
129 129 var treeData = [];
130 130 //var data = groupBy(get_vals(gb_data_gps.allGps), 'lineId');
131 131 var data = groupBy(get_vals(allGps), 'lineId');
... ... @@ -135,28 +135,28 @@ var gb_common = (function () {
135 135 data[name] = groupBy(data[code], 'upDown');
136 136 treeData.push({
137 137 'text': name,
138   - 'a_attr': {'type': 'line', 'id': idBefore+'line_'+code},
  138 + 'a_attr': {'type': 'line', 'id': idBefore + 'line_' + code},
139 139 'children': [{
140 140 'text': '上行',
141   - 'children': grabs(data[name][0]),
  141 + 'children': grabs(data[name][0], idBefore),
142 142 'a_attr': {
143 143 'type': 'route',
144 144 'route': code + '_0',
145   - 'id': idBefore+'route_' + code + '_0'
  145 + 'id': idBefore + 'route_' + code + '_0'
146 146 }
147 147 }, {
148 148 'text': '下行',
149   - 'children': grabs(data[name][1]),
  149 + 'children': grabs(data[name][1], idBefore),
150 150 'a_attr': {
151 151 'type': 'route',
152 152 'route': code + '_1',
153   - 'id': idBefore+'route_' + code + '_1'
  153 + 'id': idBefore + 'route_' + code + '_1'
154 154 }
155 155 }]
156 156 });
157 157 }
158 158  
159   - function grabs(array) {
  159 + function grabs(array, idBefore) {
160 160 if (!array)
161 161 return;
162 162 var rs = [];
... ... @@ -165,7 +165,8 @@ var gb_common = (function () {
165 165 'text': this.nbbm,
166 166 'a_attr': {
167 167 'type': 'device',
168   - 'device': this.deviceId
  168 + 'device': this.deviceId,
  169 + 'id': idBefore + 'device_' + this.nbbm
169 170 },
170 171 'data': {lineId: this.lineId, upDown: this.upDown},
171 172 'icon': 'uk-icon-bus'
... ...
src/main/resources/static/real_control_v2/mapmonitor/css/real.css
... ... @@ -113,8 +113,17 @@ input[type=checkbox].disabled{
113 113 width: 240px;
114 114 right: 327px;
115 115 padding-left: 20px;
  116 + transition: all .07s linear;
116 117 }
117 118  
  119 +.real_bottom_panel .telescopic{
  120 + position: absolute;
  121 + top: 4px;
  122 + right: 7px;
  123 + color: #827f7f;
  124 + cursor: pointer;
  125 + font-size: 16px;
  126 +}
118 127  
119 128 .real_right_gps_panel>form{
120 129 text-align: center;
... ... @@ -180,7 +189,7 @@ input[type=checkbox].disabled{
180 189 width: 100%;
181 190 height: 100%;
182 191 height: calc(100% - 7px);
183   - overflow: auto;
  192 + overflow: hidden;
184 193 padding-top: 7px;
185 194 font-size: 13px;
186 195 position: relative;
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/gps_tree.js
... ... @@ -7,7 +7,7 @@ var gb_map_gps_tree = (function () {
7 7 var jstreeChanged = function (e, node, event) {
8 8 gb_map_overlay_mge.refresh();
9 9 };
10   -
  10 +
11 11 var init = function (cb) {
12 12 var allGps = gb_data_gps.allGps;
13 13 _devices = gb_common.get_keys(allGps);
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/baidu.js
... ... @@ -73,20 +73,35 @@ var gb_map_baidu = (function(){
73 73 if(polylines[opt.id])
74 74 return;
75 75  
76   - var pos = [], temps;
77   - var route = opt.upDown==0?opt.route.up:opt.route.down;
  76 + var pos, temps;
  77 + var route = opt.upDown==0?opt.route.up_bd:opt.route.down_bd;
  78 + var polyline, _pLines=[];
  79 + $.each(route, function (i, item) {
  80 +
  81 + pos = [];
  82 + $.each(item.split(','), function () {
  83 + temps = this.split(' ');
  84 + pos.push(new BMap.Point(temps[0], temps[1]));
  85 + });
  86 + polyline = new BMap.Polyline(pos, opt.style);
  87 + map.addOverlay(polyline);
  88 + _pLines.push(polyline);
  89 +
  90 + });
78 91  
79   - $.each(route.split(','), function(){
  92 + //根据ID保存映射
  93 + polylines[opt.id]=_pLines;
  94 + /*$.each(route.split(','), function(){
80 95 temps = this.split(' ');
81 96 pos.push(new BMap.Point(temps[0], temps[1]));
82   - });
  97 + });*/
83 98  
84   - var polyline = new BMap.Polyline(pos, opt.style);
  99 + /*var polyline = new BMap.Polyline(pos, opt.style);
85 100 //根据ID保存映射
86 101 polylines[opt.id]=polyline;
87 102 if(opt.hide)
88 103 polyline.hide();
89   - map.addOverlay(polyline);
  104 + map.addOverlay(polyline);*/
90 105  
91 106 //延迟居中,避免多次调用时抖动
92 107 //delayToCenter(pos[parseInt(pos.length / 2)]);
... ... @@ -102,16 +117,24 @@ var gb_map_baidu = (function(){
102 117 refreshPolyline: function (opt) {
103 118 var idx = opt.idx;
104 119 for(var id in polylines){
105   - if(idx.indexOf(id) != -1)
106   - polylines[id].show();
107   - else
108   - polylines[id].hide();
  120 + if(idx.indexOf(id) != -1){
  121 + $.each(polylines[id], function () {
  122 + this.show();
  123 + })
  124 + }
  125 + else{
  126 + $.each(polylines[id], function () {
  127 + this.hide();
  128 + })
  129 + }
109 130 }
110 131 },
111 132 //定位到线路中间点
112 133 centerToLine: function (opt) {
113   - var pos=polylines[opt.id].getPath();
114   - delayToCenter(pos[parseInt(pos.length / 2)]);
  134 + var _pLines = polylines[opt.id];
  135 + delayToCenter(_pLines[parseInt(_pLines.length/2)].getPath()[0]);
  136 + //var pos=polylines[opt.id].getPath();
  137 + //delayToCenter(pos[parseInt(pos.length / 2)]);
115 138 },
116 139 //绘制GPS信号
117 140 drawRealGpsMarker: function(opts){
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/gaode.js
... ... @@ -83,8 +83,31 @@ var gb_map_gaode = (function() {
83 83 map.clearMap();
84 84 },
85 85 drawLine: function(opt){
86   - //linePolyline = [];
87   - var pos = [], temps;
  86 + if(polylines[opt.id])
  87 + return;
  88 +
  89 + var pos, temps;
  90 + var route = opt.upDown==0?opt.route.up_gcj:opt.route.down_gcj;
  91 +
  92 + var polyline, _pLines=[];
  93 + $.each(route, function (i, item) {
  94 +
  95 + pos = [];
  96 + $.each(item.split(','), function () {
  97 + temps = this.split(' ');
  98 + pos.push([temps[0], temps[1]]);
  99 + });
  100 +
  101 + opt.style.path=pos;
  102 + var polyline = new AMap.Polyline(opt.style);
  103 + polyline.setMap(map);
  104 +
  105 + _pLines.push(polyline);
  106 + });
  107 +
  108 + polylines[opt.id]=_pLines;
  109 +
  110 + /*var pos = [], temps;
88 111 var route = opt.upDown==0?opt.route.up_gcj:opt.route.down_gcj;
89 112  
90 113 $.each(route.split(','), function(){
... ... @@ -99,21 +122,30 @@ var gb_map_gaode = (function() {
99 122 if(opt.hide)
100 123 polyline.hide();
101 124  
102   - polyline.setMap(map);
  125 + polyline.setMap(map);*/
103 126 },
104 127 //定位到线路中间点
105 128 centerToLine: function (opt) {
106   - var pos=polylines[opt.id].getPath();
107   - map.setCenter(pos[parseInt(pos.length / 2)]);
  129 + //var pos=polylines[opt.id].getPath();
  130 + //map.setCenter(pos[parseInt(pos.length / 2)]);
  131 +
  132 + var _pLines = polylines[opt.id];
  133 + map.setCenter(_pLines[parseInt(_pLines.length/2)].getPath()[0]);
108 134 },
109 135 //根据id 显示polyline
110 136 refreshPolyline: function (opt) {
111 137 var idx = opt.idx;
112 138 for(var id in polylines){
113   - if(idx.indexOf(id) != -1)
114   - polylines[id].show();
115   - else
116   - polylines[id].hide();
  139 + if(idx.indexOf(id) != -1){
  140 + $.each(polylines[id], function () {
  141 + this.show();
  142 + })
  143 + }
  144 + else{
  145 + $.each(polylines[id], function () {
  146 + this.hide();
  147 + })
  148 + }
117 149 }
118 150 },
119 151 drawStationMarker: function (opt) {
... ... @@ -332,7 +364,6 @@ var gb_map_gaode = (function() {
332 364 if(config.carIcon.angle) {
333 365 marker.setIcon(gb_map_imap.busIcon);
334 366 marker.setAngle(gps.direction - 90);
335   - marker.setOffset(new AMap.Pixel(-(w / 2), -12));
336 367  
337 368 marker.setLabel({
338 369 content: gps.nbbm,
... ... @@ -345,6 +376,7 @@ var gb_map_gaode = (function() {
345 376 image: gb_map_imap.createCarIcon(gps, w)
346 377 }));
347 378 }
  379 + marker.setOffset(new AMap.Pixel(-(w / 2), -12.5));
348 380 }
349 381  
350 382 //创建站点marker
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/map_overlay_manager.js
... ... @@ -203,7 +203,7 @@ var gb_map_overlay_mge = (function () {
203 203  
204 204 //地图居中至合理的位置
205 205 var centerToRational=function () {
206   - var chs=gb_map_gps_tree.getChecked();
  206 + var chs=getCheckedDevice();
207 207 if(chs && chs.length > 0){
208 208 var id=chs[0].data.lineId+'_'+chs[0].data.upDown;
209 209 gb_map_imap.call('centerToLine', {id: id});
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/real.js
... ... @@ -10,11 +10,12 @@ var mapmonitor_load_ep = EventProxy.create(&#39;load_iMap&#39;, &#39;load_baidu&#39;, &#39;load_gaod
10 10 .changeMap(gb_map_config.getConfig().map_type);
11 11  
12 12 //init tree
13   - gb_map_gps_tree.init(function () {
  13 + /*gb_map_gps_tree.init(function () {
14 14 gb_map_overlay_mge.init();
15 15 gb_map_spatial_data.init();
16   - });
  16 + });*/
17 17  
  18 +/*
18 19 $(".real_bottom_panel").resizable({
19 20 handles: {
20 21 'n': '.real_bottom_panel #handle'
... ... @@ -22,6 +23,27 @@ var mapmonitor_load_ep = EventProxy.create(&#39;load_iMap&#39;, &#39;load_baidu&#39;, &#39;load_gaod
22 23 maxHeight: 384,
23 24 minHeight: 18
24 25 });
  26 +*/
  27 +
  28 + var maxHeight=384, minHeight=124, threshold=8;
  29 + $(".real_bottom_panel").on('mousewheel', function (e) {
  30 + var event = e.originalEvent;
  31 + var code = delta = (event.wheelDelta) ? event.wheelDelta / 120 : -(event.detail || 0) / 3;
  32 +
  33 + if(code > 0){
  34 + var h = $(this).height()-threshold;
  35 + $(this).height(h>minHeight?h:minHeight);
  36 + }
  37 + else{
  38 + var h = $(this).height()+threshold;
  39 + $(this).height(h<maxHeight?h:maxHeight);
  40 + }
  41 + return false;
  42 + });
  43 +
  44 + $('.real_bottom_panel .telescopic').on('click', function () {
  45 +
  46 + });
25 47 });
26 48  
27 49 var gb_map_consts = {
... ... @@ -36,13 +58,13 @@ var gb_map_consts = {
36 58 CanvasRenderingContext2D.prototype.roundRect = function (x, y, w, h, r) {
37 59 if (w < 2 * r) r = w / 2;
38 60 if (h < 2 * r) r = h / 2;
39   - this.strokeStyle ='rgba(0,102,0,.1)';
  61 + this.strokeStyle = 'rgba(0,102,0,.1)';
40 62 this.beginPath();
41   - this.moveTo(x+r, y);
42   - this.arcTo(x+w, y, x+w, y+h, r);
43   - this.arcTo(x+w, y+h, x, y+h, r);
44   - this.arcTo(x, y+h, x, y, r);
45   - this.arcTo(x, y, x+w, y, r);
  63 + this.moveTo(x + r, y);
  64 + this.arcTo(x + w, y, x + w, y + h, r);
  65 + this.arcTo(x + w, y + h, x, y + h, r);
  66 + this.arcTo(x, y + h, x, y, r);
  67 + this.arcTo(x, y, x + w, y, r);
46 68 this.closePath();
47 69 return this;
48 70 }
49 71 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/spatial_data.js
... ... @@ -126,7 +126,7 @@ var gb_map_spatial_data = (function () {
126 126  
127 127 refresh();
128 128 });
129   - }
  129 + };
130 130  
131 131 //计算多边形面积
132 132 function calcPolygonArea(polygonStr) {
... ...
src/main/resources/static/real_control_v2/mapmonitor/real.html
... ... @@ -32,8 +32,11 @@
32 32 </div>
33 33  
34 34 <div class="real_bottom_panel">
35   - <div id="handle" class="ui-resizable-handle ui-resizable-n"></div>
  35 + <!--<div id="handle" class="ui-resizable-handle ui-resizable-n"></div>-->
36 36 <div class="real_br_cont map_config_wrap"></div>
  37 + <div class="telescopic">
  38 + <i class="uk-icon-angle-double-up" ></i>
  39 + </div>
37 40 </div>
38 41  
39 42 <div class="real_spatial_panel">
... ...