Commit 7065e32b904de69cd0f03d270dbc396aa61a0a89
1 parent
6f70835d
基础数据功能完善
Showing
43 changed files
with
9025 additions
and
0 deletions
src/main/java/com/bsth/controller/CarParkController.java
0 → 100644
| 1 | +package com.bsth.controller; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import com.bsth.entity.CarPark; | |
| 7 | +import com.bsth.service.CarParkService; | |
| 8 | +import com.bsth.util.GetUIDAndCode; | |
| 9 | + | |
| 10 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 11 | +import org.springframework.web.bind.annotation.*; | |
| 12 | + | |
| 13 | + | |
| 14 | +@RestController | |
| 15 | +@RequestMapping("carpark") | |
| 16 | +public class CarParkController extends BaseController<CarPark, Integer> { | |
| 17 | + | |
| 18 | + @Autowired | |
| 19 | + CarParkService service; | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * @Description :TODO(查询停车场编码) | |
| 23 | + * | |
| 24 | + * @return int <carParkCode 停车场编码> | |
| 25 | + */ | |
| 26 | + @RequestMapping(value="getCarParkCode" , method = RequestMethod.GET) | |
| 27 | + public long getStationCode() { | |
| 28 | + return GetUIDAndCode.getCarParkId(); | |
| 29 | + | |
| 30 | + } | |
| 31 | + | |
| 32 | + @RequestMapping(value="carParkSave" , method = RequestMethod.POST) | |
| 33 | + public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) { | |
| 34 | + | |
| 35 | + map.put("createBy", ""); | |
| 36 | + | |
| 37 | + map.put("updateBy", ""); | |
| 38 | + | |
| 39 | + return service.carParkSave(map); | |
| 40 | + | |
| 41 | + } | |
| 42 | + | |
| 43 | + @RequestMapping(value = "findCarParkInfoFormId",method = RequestMethod.GET) | |
| 44 | + public List<Map<String, Object>> findCarParkInfoFormId(@RequestParam Map<String, Object> map) { | |
| 45 | + | |
| 46 | + return service.findCarParkInfoFormId(map); | |
| 47 | + } | |
| 48 | + | |
| 49 | + @RequestMapping(value="carParkUpdate" , method = RequestMethod.POST) | |
| 50 | + public Map<String, Object> carParkUpdate(@RequestParam Map<String, Object> map) { | |
| 51 | + | |
| 52 | + map.put("updateBy", ""); | |
| 53 | + | |
| 54 | + return service.carParkUpdate(map); | |
| 55 | + | |
| 56 | + } | |
| 57 | + | |
| 58 | +} | ... | ... |
src/main/java/com/bsth/repository/CarParkRepository.java
0 → 100644
| 1 | +package com.bsth.repository; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | + | |
| 5 | +import org.springframework.data.jpa.repository.Modifying; | |
| 6 | +import org.springframework.data.jpa.repository.Query; | |
| 7 | +import org.springframework.stereotype.Repository; | |
| 8 | +import org.springframework.transaction.annotation.Transactional; | |
| 9 | + | |
| 10 | +import com.bsth.entity.CarPark; | |
| 11 | + | |
| 12 | +@Repository | |
| 13 | +public interface CarParkRepository extends BaseRepository<CarPark, Integer>{ | |
| 14 | + | |
| 15 | + // 查询最大ID | |
| 16 | + @Query(value = "SELECT IFNULL(num,0) as maxId from (SELECT MAX(id) as num FROM bsth_c_car_park) k" | |
| 17 | + , nativeQuery=true) | |
| 18 | + public long carParkMaxId(); | |
| 19 | + | |
| 20 | + @Transactional | |
| 21 | + @Modifying | |
| 22 | + @Query(value="INSERT INTO bsth_c_car_park (" + | |
| 23 | + "id , area , company , park_code , park_name , " + | |
| 24 | + "branche_company , create_by , create_date , descriptions , destroy," + | |
| 25 | + "update_by, update_date , versions , b_center_point , b_park_point , " + | |
| 26 | + "db_type, g_center_point, g_park_point, radius, shapes_type) " + | |
| 27 | + " VALUES(" + | |
| 28 | + "?1 , ?2 , ?3 , ?4 , ?5," + | |
| 29 | + "?6 , ?7 , str_to_date(?8,'%Y-%m-%d %H:%i:%s') , ?9 , ?10," + | |
| 30 | + "?11,str_to_date(?12,'%Y-%m-%d %H:%i:%s') ,?13, ?14, GeomFromText(?15), " + | |
| 31 | + "?16, ?17,GeomFromText(?18),?19,?20)", nativeQuery=true) | |
| 32 | + public void carParkSave(Integer id,Double area,String company,String parkCode,String parkName, | |
| 33 | + | |
| 34 | + String brancheCompany,Integer createBy,String createDate,String descriptions,Integer destroy, | |
| 35 | + | |
| 36 | + Integer updateBy,String updateDate,Integer versions,String bCenterPoint,String bParkPoint, | |
| 37 | + | |
| 38 | + String dbType,String gCenterPoint,String gParkPoint,Integer radius,String shapesType); | |
| 39 | + | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * @Description :TODO(查询路段信息) | |
| 43 | + * | |
| 44 | + * @param map <id:路段路由ID> | |
| 45 | + * | |
| 46 | + * @return List<Object[]> | |
| 47 | + */ | |
| 48 | + @Query(value ="SELECT k.id AS carParkId," + | |
| 49 | + "k.area AS carParkArea," + | |
| 50 | + "k.company AS carParkCompany," + | |
| 51 | + "k.park_code AS carParkCode," + | |
| 52 | + "k.park_name AS carParkName," + | |
| 53 | + "k.branche_company AS carParkBrancheCompany," + | |
| 54 | + "k.create_by AS carParkCreateBy," + | |
| 55 | + "k.create_date AS carParkCreateDate," + | |
| 56 | + "k.descriptions AS carParkDescriptions," + | |
| 57 | + "k.destroy AS carParkDestroy," + | |
| 58 | + "k.update_by AS carParkUpdate," + | |
| 59 | + "k.update_date AS carParkUpdateDate," + | |
| 60 | + "k.versions AS carParkVersions," + | |
| 61 | + "k.b_center_point AS carParkBcenterPoint," + | |
| 62 | + "AsText(k.b_park_point) AS carParkBparkPoint," + | |
| 63 | + "k.g_center_point AS carParkGcenterPoint," + | |
| 64 | + "AsText(k.g_park_point) AS carParkGparkPoint, " + | |
| 65 | + "k.db_type AS carParkDBtype," + | |
| 66 | + "k.radius AS carParkRadius," + | |
| 67 | + "k.shapes_type AS carParkShapesType FROM bsth_c_car_park k where k.id = ?1", nativeQuery=true) | |
| 68 | + List<Object[]> findCarParkInfoFormId(int id); | |
| 69 | + | |
| 70 | + @Transactional | |
| 71 | + @Modifying | |
| 72 | + @Query(value="UPDATE bsth_c_car_park SET " + | |
| 73 | + "area = ?1 , " + | |
| 74 | + "company = ?2 , " + | |
| 75 | + "park_code = ?3 , " + | |
| 76 | + "park_name = ?4 , " + | |
| 77 | + "branche_company = ?5 , " + | |
| 78 | + "create_by = ?6 , " + | |
| 79 | + "create_date = ?7 , " + | |
| 80 | + "descriptions = ?8 , " + | |
| 81 | + "destroy = ?9 , " + | |
| 82 | + "update_by = ?10 , " + | |
| 83 | + "update_date = ?11 , " + | |
| 84 | + "versions = ?12 , " + | |
| 85 | + "b_center_point = ?13 , " + | |
| 86 | + "g_center_point = ?14 , " + | |
| 87 | + "b_park_point = GeomFromText(?15) , " + | |
| 88 | + "g_park_point = GeomFromText(?16) , " + | |
| 89 | + "db_type = ?17 , " + | |
| 90 | + "radius = ?18 , " + | |
| 91 | + "shapes_type = ?19 " + | |
| 92 | + " WHERE id = ?20 ", nativeQuery=true) | |
| 93 | + public void carParkUpdate(double area,String company,String parkCode,String parkName,String brancheCompany, | |
| 94 | + | |
| 95 | + Integer createBy ,String createDate,String descriptions,Integer destroy,Integer updateBy, | |
| 96 | + | |
| 97 | + String updateDate,Integer versions,String bCenterPoint,String gCenterPoint,String bParkPoint, | |
| 98 | + | |
| 99 | + String gParkPoint,String dbType,Integer radius,String shapesType,Integer id ); | |
| 100 | + | |
| 101 | +} | ... | ... |
src/main/java/com/bsth/service/CarParkService.java
0 → 100644
| 1 | +package com.bsth.service; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +import com.bsth.entity.CarPark; | |
| 7 | + | |
| 8 | +public interface CarParkService extends BaseService<CarPark, Integer> { | |
| 9 | + | |
| 10 | + Map<String, Object> carParkSave(Map<String, Object> map); | |
| 11 | + | |
| 12 | + List<Map<String, Object>> findCarParkInfoFormId(Map<String, Object> map); | |
| 13 | + | |
| 14 | + Map<String, Object> carParkUpdate(Map<String, Object> map); | |
| 15 | + | |
| 16 | +} | ... | ... |
src/main/java/com/bsth/service/impl/CarParkServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.impl; | |
| 2 | + | |
| 3 | +import java.text.SimpleDateFormat; | |
| 4 | +import java.util.ArrayList; | |
| 5 | +import java.util.Date; | |
| 6 | +import java.util.HashMap; | |
| 7 | +import java.util.List; | |
| 8 | +import java.util.Map; | |
| 9 | + | |
| 10 | +import com.bsth.common.ResponseCode; | |
| 11 | +import com.bsth.entity.CarPark; | |
| 12 | +import com.bsth.repository.CarParkRepository; | |
| 13 | +import com.bsth.service.CarParkService; | |
| 14 | + | |
| 15 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 16 | +import org.springframework.stereotype.Service; | |
| 17 | + | |
| 18 | + | |
| 19 | +@Service | |
| 20 | +public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implements CarParkService { | |
| 21 | + | |
| 22 | + @Autowired | |
| 23 | + CarParkRepository carParkRepository; | |
| 24 | + | |
| 25 | + @Override | |
| 26 | + public Map<String, Object> carParkSave(Map<String, Object> map) { | |
| 27 | + | |
| 28 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | |
| 29 | + | |
| 30 | + try { | |
| 31 | + | |
| 32 | + // 停车场编码 | |
| 33 | + String parkCode = map.get("parkCode").equals("") ? null : map.get("parkCode").toString(); | |
| 34 | + | |
| 35 | + // 停车场id | |
| 36 | + Integer id = Integer.parseInt(parkCode); | |
| 37 | + | |
| 38 | + // 停车场名称 | |
| 39 | + String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); | |
| 40 | + | |
| 41 | + // 地理位置(百度坐标集合) | |
| 42 | + String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); | |
| 43 | + | |
| 44 | + // 地理位置(WGS坐标集合) | |
| 45 | + String gParkPoint = map.get("gParkPoint").equals("") ? "" :map.get("gParkPoint").toString(); | |
| 46 | + | |
| 47 | + // 地理位置中心点(百度坐标) | |
| 48 | + String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); | |
| 49 | + | |
| 50 | + // 地理位置中心点(WGS坐标) | |
| 51 | + String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString(); | |
| 52 | + | |
| 53 | + // 坐标类型 | |
| 54 | + String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); | |
| 55 | + | |
| 56 | + // 图形类型 | |
| 57 | + String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); | |
| 58 | + | |
| 59 | + // 半径 | |
| 60 | + Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); | |
| 61 | + | |
| 62 | + // 面积 | |
| 63 | + double area = map.get("area").equals("") ? null : Double.parseDouble(map.get("area").toString()); | |
| 64 | + | |
| 65 | + // 公司 | |
| 66 | + String company = map.get("company").equals("") ? "" : map.get("company").toString(); | |
| 67 | + | |
| 68 | + // 分公司 | |
| 69 | + String brancheCompany = map.get("brancheCompany").equals("") ? "" : map.get("brancheCompany").toString(); | |
| 70 | + | |
| 71 | + // 是否撤销 | |
| 72 | + Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | |
| 73 | + | |
| 74 | + // 版本号 | |
| 75 | + Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); | |
| 76 | + | |
| 77 | + // 描述与说明 | |
| 78 | + String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); | |
| 79 | + | |
| 80 | + SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); | |
| 81 | + | |
| 82 | + Date date = new Date(); | |
| 83 | + | |
| 84 | + // 创建日期 | |
| 85 | + String createDate = formatter.format(date); | |
| 86 | + | |
| 87 | + // 修改日期 | |
| 88 | + String updateDate = formatter.format(date); | |
| 89 | + | |
| 90 | + // 创建人 | |
| 91 | + Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); | |
| 92 | + | |
| 93 | + // 修改人 | |
| 94 | + Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); | |
| 95 | + | |
| 96 | + carParkRepository.carParkSave(id, area, company, parkCode, parkName, | |
| 97 | + | |
| 98 | + brancheCompany, createBy, createDate, descriptions, destroy, | |
| 99 | + | |
| 100 | + updateBy, updateDate, versions, bCenterPoint, bParkPoint, | |
| 101 | + | |
| 102 | + dbType, gCenterPoint, gParkPoint, radius, shapesType); | |
| 103 | + | |
| 104 | + resultMap.put("status", ResponseCode.SUCCESS); | |
| 105 | + | |
| 106 | + } catch (Exception e) { | |
| 107 | + | |
| 108 | + resultMap.put("status", ResponseCode.ERROR); | |
| 109 | + | |
| 110 | + logger.error("save erro.", e); | |
| 111 | + | |
| 112 | + } | |
| 113 | + | |
| 114 | + return resultMap; | |
| 115 | + } | |
| 116 | + | |
| 117 | + @Override | |
| 118 | + public List<Map<String, Object>> findCarParkInfoFormId(Map<String, Object> map) { | |
| 119 | + | |
| 120 | + // 获取线路ID | |
| 121 | + Integer id = map.get("id").equals("") ? 0 : Integer.parseInt(map.get("id").toString()); | |
| 122 | + | |
| 123 | + List<Object[]> objects = carParkRepository.findCarParkInfoFormId(id); | |
| 124 | + | |
| 125 | + List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); | |
| 126 | + | |
| 127 | + int len = objects.size(); | |
| 128 | + | |
| 129 | + if(objects.size()>0) { | |
| 130 | + | |
| 131 | + for(int i = 0 ; i < len; i++) { | |
| 132 | + | |
| 133 | + Map<String, Object> tempM = new HashMap<String,Object>(); | |
| 134 | + | |
| 135 | + tempM.put("carParkId", objects.get(i)[0]); | |
| 136 | + | |
| 137 | + tempM.put("carParkArea", objects.get(i)[1]); | |
| 138 | + | |
| 139 | + tempM.put("carParkCompany", objects.get(i)[2]); | |
| 140 | + | |
| 141 | + tempM.put("carParkCode", objects.get(i)[3]); | |
| 142 | + | |
| 143 | + tempM.put("carParkName", objects.get(i)[4]); | |
| 144 | + | |
| 145 | + tempM.put("carParkBrancheCompany", objects.get(i)[5]); | |
| 146 | + | |
| 147 | + tempM.put("carParkCreateBy", objects.get(i)[6]); | |
| 148 | + | |
| 149 | + tempM.put("carParkCreateDate", objects.get(i)[7]); | |
| 150 | + | |
| 151 | + tempM.put("carParkDescriptions", objects.get(i)[8]); | |
| 152 | + | |
| 153 | + tempM.put("carParkDestroy", objects.get(i)[9]); | |
| 154 | + | |
| 155 | + tempM.put("carParkUpdate", objects.get(i)[10]); | |
| 156 | + | |
| 157 | + tempM.put("carParkUpdateDate", objects.get(i)[11]); | |
| 158 | + | |
| 159 | + tempM.put("carParkVersions", objects.get(i)[12]); | |
| 160 | + | |
| 161 | + tempM.put("carParkBcenterPoint", objects.get(i)[13]); | |
| 162 | + | |
| 163 | + tempM.put("carParkBparkPoint", objects.get(i)[14]); | |
| 164 | + | |
| 165 | + tempM.put("carParkGcenterPoint", objects.get(i)[15]); | |
| 166 | + | |
| 167 | + tempM.put("carParkGparkPoint", objects.get(i)[16]); | |
| 168 | + | |
| 169 | + tempM.put("carParkDBtype", objects.get(i)[17]); | |
| 170 | + | |
| 171 | + tempM.put("carParkRadius", objects.get(i)[18]); | |
| 172 | + | |
| 173 | + tempM.put("carParkShapesType", objects.get(i)[19]); | |
| 174 | + | |
| 175 | + resultList.add(tempM); | |
| 176 | + } | |
| 177 | + | |
| 178 | + } | |
| 179 | + | |
| 180 | + return resultList; | |
| 181 | + } | |
| 182 | + | |
| 183 | + @Override | |
| 184 | + public Map<String, Object> carParkUpdate(Map<String, Object> map) { | |
| 185 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | |
| 186 | + | |
| 187 | + try { | |
| 188 | + | |
| 189 | + // id | |
| 190 | + Integer id = map.get("id").equals("") ? null : Integer.parseInt(map.get("id").toString()); | |
| 191 | + | |
| 192 | + if(id!=null) { | |
| 193 | + | |
| 194 | + // 面积 | |
| 195 | + double area = map.get("area").equals("") ? null : Double.parseDouble(map.get("area").toString()); | |
| 196 | + | |
| 197 | + // 中心点(百度坐标) | |
| 198 | + String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); | |
| 199 | + | |
| 200 | + // 图形坐标点集合(百度坐标) | |
| 201 | + String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); | |
| 202 | + | |
| 203 | + // 分公司 | |
| 204 | + String brancheCompany = map.get("brancheCompany").equals("")? "" :map.get("brancheCompany").toString(); | |
| 205 | + | |
| 206 | + // 公司 | |
| 207 | + String company = map.get("company").equals("") ? "" : map.get("company").toString(); | |
| 208 | + | |
| 209 | + // 坐标类型 | |
| 210 | + String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); | |
| 211 | + | |
| 212 | + // 描述与说明 | |
| 213 | + String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); | |
| 214 | + | |
| 215 | + // 是否撤销 | |
| 216 | + Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); | |
| 217 | + | |
| 218 | + // 中心点(WGS坐标) | |
| 219 | + String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString(); | |
| 220 | + | |
| 221 | + // 图形坐标点集合(WGS坐标) | |
| 222 | + String gParkPoint = map.get("gParkPoint").equals("") ? "" : map.get("gParkPoint").toString(); | |
| 223 | + | |
| 224 | + // 编码 | |
| 225 | + String parkCode = map.get("parkCode").equals("") ? "" : map.get("parkCode").toString(); | |
| 226 | + | |
| 227 | + // 名称 | |
| 228 | + String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); | |
| 229 | + | |
| 230 | + // 半径 | |
| 231 | + Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); | |
| 232 | + | |
| 233 | + // 图形类型 | |
| 234 | + String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); | |
| 235 | + | |
| 236 | + // 版本 | |
| 237 | + Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); | |
| 238 | + | |
| 239 | + // 创建人 | |
| 240 | + Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); | |
| 241 | + | |
| 242 | + // 创建日期 | |
| 243 | + String createDate = map.get("createDate").equals("") ? "" : map.get("createDate").toString(); | |
| 244 | + | |
| 245 | + Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); | |
| 246 | + | |
| 247 | + SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); | |
| 248 | + | |
| 249 | + Date date = new Date(); | |
| 250 | + | |
| 251 | + // 修改日期 | |
| 252 | + String updateDate = formatter.format(date); | |
| 253 | + | |
| 254 | + carParkRepository.carParkUpdate(area, company, parkCode, parkName, brancheCompany, createBy, createDate, descriptions, destroy, updateBy, updateDate, versions, bCenterPoint, gCenterPoint, bParkPoint, gParkPoint, dbType, radius, shapesType, id); | |
| 255 | + | |
| 256 | + } | |
| 257 | + | |
| 258 | + resultMap.put("status", ResponseCode.SUCCESS); | |
| 259 | + | |
| 260 | + } catch (Exception e) { | |
| 261 | + | |
| 262 | + resultMap.put("status", ResponseCode.ERROR); | |
| 263 | + | |
| 264 | + logger.error("save erro.", e); | |
| 265 | + | |
| 266 | + } | |
| 267 | + | |
| 268 | + return resultMap; | |
| 269 | + } | |
| 270 | + | |
| 271 | +} | ... | ... |
src/main/java/com/bsth/util/FTPClientUtils.java
0 → 100644
| 1 | +package com.bsth.util; | |
| 2 | + | |
| 3 | +import java.io.ByteArrayInputStream; | |
| 4 | +import java.io.File; | |
| 5 | +import java.io.FileInputStream; | |
| 6 | +import java.io.FileNotFoundException; | |
| 7 | +import java.io.IOException; | |
| 8 | +import java.io.InputStream; | |
| 9 | +import java.io.UnsupportedEncodingException; | |
| 10 | + | |
| 11 | +import org.apache.commons.net.ftp.FTPClient; | |
| 12 | +import org.apache.commons.net.ftp.FTPReply; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * @Description: 向FTP服务器上传文件 | |
| 16 | + * | |
| 17 | + * @Version 1.0 2016-06-21 4:31:09 by 李强 | |
| 18 | + * | |
| 19 | + */ | |
| 20 | +public class FTPClientUtils { | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * @param url FTP服务器hostname; | |
| 24 | + * | |
| 25 | + * - - - - port FTP服务器端口; | |
| 26 | + * | |
| 27 | + * - - - - username FTP登录账号; | |
| 28 | + * | |
| 29 | + * - - - - password FTP登录密码 ; | |
| 30 | + * | |
| 31 | + * - - - - path FTP服务器保存目录; | |
| 32 | + * | |
| 33 | + * - - - - filename 上传到FTP服务器上的文件名 | |
| 34 | + * | |
| 35 | + * - - - - input 输入流; | |
| 36 | + * | |
| 37 | + * @return 成功返回true,否则返回false | |
| 38 | + * | |
| 39 | + */ | |
| 40 | + public boolean uploadFile(String url,int port,String username, String password, String path, String filename, InputStream input) { | |
| 41 | + | |
| 42 | + boolean success = false; | |
| 43 | + | |
| 44 | + FTPClient ftp = new FTPClient(); | |
| 45 | + | |
| 46 | + try { | |
| 47 | + | |
| 48 | + int reply; | |
| 49 | + | |
| 50 | + //连接FTP服务器,如果采用默认端口,可以使用ftp.connect(url)的方式直接连接FTP服务器 | |
| 51 | + ftp.connect(url, port); | |
| 52 | + | |
| 53 | + //登录 | |
| 54 | + ftp.login(username, password); | |
| 55 | + | |
| 56 | + reply = ftp.getReplyCode(); | |
| 57 | + | |
| 58 | + if (!FTPReply.isPositiveCompletion(reply)) { | |
| 59 | + | |
| 60 | + ftp.disconnect(); | |
| 61 | + | |
| 62 | + return success; | |
| 63 | + | |
| 64 | + } | |
| 65 | + | |
| 66 | + ftp.changeWorkingDirectory(path); | |
| 67 | + | |
| 68 | + ftp.storeFile(filename, input); | |
| 69 | + | |
| 70 | + input.close(); | |
| 71 | + | |
| 72 | + ftp.logout(); | |
| 73 | + | |
| 74 | + success = true; | |
| 75 | + | |
| 76 | + } catch (IOException e) { | |
| 77 | + | |
| 78 | + e.printStackTrace(); | |
| 79 | + | |
| 80 | + } finally { | |
| 81 | + | |
| 82 | + if (ftp.isConnected()) { | |
| 83 | + | |
| 84 | + try { | |
| 85 | + | |
| 86 | + ftp.disconnect(); | |
| 87 | + | |
| 88 | + } catch (IOException ioe) { | |
| 89 | + | |
| 90 | + } | |
| 91 | + | |
| 92 | + } | |
| 93 | + | |
| 94 | + } | |
| 95 | + | |
| 96 | + return success; | |
| 97 | + } | |
| 98 | + | |
| 99 | + // 将本地文件上传到FTP服务器上 | |
| 100 | + public void testUpLoadFromDisk(){ | |
| 101 | + | |
| 102 | + try { | |
| 103 | + FileInputStream in=new FileInputStream(new File("D:/test.txt")); | |
| 104 | + | |
| 105 | + boolean flag = uploadFile("192.168.168.101", 21, "testftpservice", "123", "C:/ftptest", "test.txt", in); | |
| 106 | + | |
| 107 | + System.out.println(flag); | |
| 108 | + | |
| 109 | + } catch (FileNotFoundException e) { | |
| 110 | + | |
| 111 | + e.printStackTrace(); | |
| 112 | + | |
| 113 | + } | |
| 114 | + | |
| 115 | + } | |
| 116 | + | |
| 117 | + // 在FTP服务器上生成一个文件,并将一个字符串写入到该文件中 | |
| 118 | + public void testUpLoadFromString(){ | |
| 119 | + | |
| 120 | + try { | |
| 121 | + | |
| 122 | + String str = "test ftp "+ "\r\n"+ "ccccc dddd"; | |
| 123 | + | |
| 124 | + InputStream input = new ByteArrayInputStream(str.getBytes("utf-8")); | |
| 125 | + | |
| 126 | + boolean flag = uploadFile("192.168.168.101", 21, "testftpservice", "123", "C:/ftptest", "test.txt", input); | |
| 127 | + | |
| 128 | + System.out.println(flag); | |
| 129 | + | |
| 130 | + } catch (UnsupportedEncodingException e) { | |
| 131 | + | |
| 132 | + e.printStackTrace(); | |
| 133 | + | |
| 134 | + } | |
| 135 | + | |
| 136 | + } | |
| 137 | + | |
| 138 | + public static void main(String[] args){ | |
| 139 | + | |
| 140 | + FTPClientUtils testFClient = new FTPClientUtils(); | |
| 141 | + | |
| 142 | + System.out.println(4.18f+ 1.35f); | |
| 143 | + | |
| 144 | + | |
| 145 | + // testFClient.testUpLoadFromString(); | |
| 146 | + | |
| 147 | + } | |
| 148 | + | |
| 149 | +} | ... | ... |
src/main/java/com/bsth/util/GetUIDAndCode.java
0 → 100644
| 1 | +package com.bsth.util; | |
| 2 | + | |
| 3 | +import java.util.Timer; | |
| 4 | +import java.util.TimerTask; | |
| 5 | + | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.stereotype.Component; | |
| 8 | + | |
| 9 | +import com.bsth.repository.CarParkRepository; | |
| 10 | +import com.bsth.repository.LineRepository; | |
| 11 | +import com.bsth.repository.SectionRepository; | |
| 12 | +import com.bsth.repository.StationRepository; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * | |
| 16 | + * @ClassName: GetUIDAndCode(自定义ID) | |
| 17 | + * | |
| 18 | + * @Description: TODO(自定义ID) | |
| 19 | + * | |
| 20 | + * @Author bsth@lq | |
| 21 | + * | |
| 22 | + * @Date 2016年4月28日 上午9:21:17 | |
| 23 | + * | |
| 24 | + * @Version 公交调度系统BS版 0.1 | |
| 25 | + * | |
| 26 | + */ | |
| 27 | +@Component | |
| 28 | +public class GetUIDAndCode { | |
| 29 | + | |
| 30 | + @Autowired | |
| 31 | + private LineRepository lineRepository; | |
| 32 | + | |
| 33 | + @Autowired | |
| 34 | + private StationRepository stationRepository; | |
| 35 | + | |
| 36 | + @Autowired | |
| 37 | + private SectionRepository sectionRepository; | |
| 38 | + | |
| 39 | + @Autowired | |
| 40 | + private CarParkRepository carParkRepository; | |
| 41 | + | |
| 42 | + /** 线路ID */ | |
| 43 | + private static long lineId = 0L; | |
| 44 | + | |
| 45 | + /** 站点ID */ | |
| 46 | + private static long stationId = 0L; | |
| 47 | + | |
| 48 | + /** 路段ID */ | |
| 49 | + private static long sectionId = 0L; | |
| 50 | + | |
| 51 | + /** 停车长ID*/ | |
| 52 | + private static long carParkId = 0L; | |
| 53 | + | |
| 54 | + public GetUIDAndCode() { | |
| 55 | + | |
| 56 | + new Timer().schedule(new TimerTask() { | |
| 57 | + | |
| 58 | + @Override | |
| 59 | + public void run() { | |
| 60 | + | |
| 61 | + lineId = lineRepository.selectMaxIdToLineCode(); | |
| 62 | + | |
| 63 | + stationId = stationRepository.stationMaxId(); | |
| 64 | + | |
| 65 | + sectionId = sectionRepository.sectionMaxId(); | |
| 66 | + | |
| 67 | + carParkId = carParkRepository.carParkMaxId(); | |
| 68 | + | |
| 69 | + } | |
| 70 | + }, 1000 * 30); | |
| 71 | + | |
| 72 | + } | |
| 73 | + | |
| 74 | + public static synchronized long getLineId() { | |
| 75 | + | |
| 76 | + ++lineId; | |
| 77 | + | |
| 78 | + return lineId; | |
| 79 | + | |
| 80 | + } | |
| 81 | + | |
| 82 | + public static synchronized long getStationId() { | |
| 83 | + | |
| 84 | + ++stationId; | |
| 85 | + | |
| 86 | + return stationId; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public static synchronized long getSectionId() { | |
| 90 | + | |
| 91 | + ++sectionId; | |
| 92 | + | |
| 93 | + return sectionId; | |
| 94 | + | |
| 95 | + } | |
| 96 | + | |
| 97 | + public static synchronized long getCarParkId() { | |
| 98 | + | |
| 99 | + ++carParkId; | |
| 100 | + | |
| 101 | + return carParkId; | |
| 102 | + | |
| 103 | + } | |
| 104 | + | |
| 105 | +} | ... | ... |
src/main/java/com/bsth/util/TestPad.java
0 → 100644
| 1 | +package com.bsth.util; | |
| 2 | + | |
| 3 | +public class TestPad { | |
| 4 | + static double Rc = 6378137; // 赤道半径 | |
| 5 | + | |
| 6 | + static double Rj = 6356725; // 极半径 | |
| 7 | + double m_LoDeg, m_LoMin, m_LoSec; // longtitude 经度 | |
| 8 | + double m_LaDeg, m_LaMin, m_LaSec; | |
| 9 | + double m_Longitude, m_Latitude; | |
| 10 | + double m_RadLo, m_RadLa; | |
| 11 | + double Ec; | |
| 12 | + double Ed; | |
| 13 | + | |
| 14 | + | |
| 15 | + public static void main(String[] args) { | |
| 16 | + | |
| 17 | + TestPad A = new TestPad(121.60613, 31.270115); | |
| 18 | + TestPad B = new TestPad(121.605239 ,31.269705); | |
| 19 | + System.out.println(TestPad.angle(A, B)); | |
| 20 | + } | |
| 21 | + public TestPad(double longitude, double latitude) | |
| 22 | + { | |
| 23 | + m_LoDeg = (int)longitude; | |
| 24 | + m_LoMin = (int)((longitude - m_LoDeg)*60); | |
| 25 | + m_LoSec = (longitude - m_LoDeg - m_LoMin/60.)*3600; | |
| 26 | + | |
| 27 | + m_LaDeg = (int)latitude; | |
| 28 | + m_LaMin = (int)((latitude - m_LaDeg)*60); | |
| 29 | + m_LaSec = (latitude - m_LaDeg - m_LaMin/60.)*3600; | |
| 30 | + | |
| 31 | + m_Longitude = longitude; | |
| 32 | + m_Latitude = latitude; | |
| 33 | + m_RadLo = longitude * Math.PI/180.; | |
| 34 | + m_RadLa = latitude * Math.PI/180.; | |
| 35 | + Ec = Rj + (Rc - Rj) * (90.-m_Latitude) / 90.; | |
| 36 | + Ed = Ec * Math.cos(m_RadLa); | |
| 37 | + } | |
| 38 | + public static TestPad GetJWDB(TestPad A, double distance, double angle) | |
| 39 | + { | |
| 40 | + double dx = distance*1000 * Math.sin(angle * Math.PI /180.); | |
| 41 | + double dy = distance*1000 * Math.cos(angle * Math.PI /180.); | |
| 42 | + | |
| 43 | + //double dx = (B.m_RadLo - A.m_RadLo) * A.Ed; | |
| 44 | + //double dy = (B.m_RadLa - A.m_RadLa) * A.Ec; | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + double BJD = (dx/A.Ed + A.m_RadLo) * 180./Math.PI; | |
| 49 | + double BWD = (dy/A.Ec + A.m_RadLa) * 180./Math.PI; | |
| 50 | + TestPad B = new TestPad(BJD, BWD); | |
| 51 | + return B; | |
| 52 | + } | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + //! 已知点A经纬度,根据B点据A点的距离,和方位,求B点的经纬度 | |
| 57 | + /*! | |
| 58 | + * /param longitude 已知点A经度 | |
| 59 | + * /param latitude 已知点A纬度 | |
| 60 | + * /param distance B点到A点的距离 | |
| 61 | + * /param angle B点相对于A点的方位 | |
| 62 | + * /return B点的经纬度坐标 | |
| 63 | + */ | |
| 64 | + public static TestPad GetJWDB(double longitude, double latitude, double distance, double angle) | |
| 65 | + { | |
| 66 | + TestPad A = new TestPad(longitude,latitude); | |
| 67 | + return GetJWDB(A, distance, angle); | |
| 68 | + } | |
| 69 | + | |
| 70 | + | |
| 71 | + //! 计算点A 和 点B的经纬度,求他们的距离和点B相对于点A的方位 | |
| 72 | + /*! | |
| 73 | + * \param A A点经纬度 | |
| 74 | + * \param B B点经纬度 | |
| 75 | + * \param angle B相对于A的方位, 不需要返回该值,则将其设为空 | |
| 76 | + * \return A点B点的角度 | |
| 77 | + */ | |
| 78 | + public static double angle(TestPad A, TestPad B) | |
| 79 | + { | |
| 80 | + double dx = (B.m_RadLo - A.m_RadLo) * A.Ed; | |
| 81 | + double dy = (B.m_RadLa - A.m_RadLa) * A.Ec; | |
| 82 | +// double out = Math.sqrt(dx * dx + dy * dy); | |
| 83 | + double angle = 0.0; | |
| 84 | + angle = Math.atan(Math.abs(dx/dy))*180./Math.PI; | |
| 85 | + // 判断象限 | |
| 86 | + double dLo = B.m_Longitude - A.m_Longitude; | |
| 87 | + double dLa = B.m_Latitude - A.m_Latitude; | |
| 88 | + | |
| 89 | + if(dLo > 0 && dLa <= 0) { | |
| 90 | + angle = (90. - angle) + 90.; | |
| 91 | + } | |
| 92 | + else if(dLo <= 0 && dLa < 0) { | |
| 93 | + angle = angle + 180.; | |
| 94 | + } | |
| 95 | + else if(dLo < 0 && dLa >= 0) { | |
| 96 | + angle = (90. - angle) + 270; | |
| 97 | + } | |
| 98 | + return angle; | |
| 99 | + } | |
| 100 | +} | ... | ... |
src/main/resources/static/pages/base/carpark/add.html
0 → 100644
| 1 | +<link href="/pages/base/carpark/css/carpark-add.css" rel="stylesheet" type="text/css" /> | |
| 2 | +<div class="page-head"> | |
| 3 | + <div class="page-title"> | |
| 4 | + <h1>添加停车场</h1> | |
| 5 | + </div> | |
| 6 | +</div> | |
| 7 | + | |
| 8 | +<ul class="page-breadcrumb breadcrumb"> | |
| 9 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 10 | + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | |
| 11 | + <li><a href="/pages/base/carpark/list.html" data-pjax>停车场信息</a> <i class="fa fa-circle"></i></li> | |
| 12 | + <li><span class="active">添加停车场</span></li> | |
| 13 | +</ul> | |
| 14 | + | |
| 15 | +<div class="portlet light bordered" id="form-wizard-info"> | |
| 16 | + <div class="portlet-title"> | |
| 17 | + <div class="caption"> | |
| 18 | + <i class="icon-equalizer font-red-sunglo"></i> | |
| 19 | + <span class="caption-subject font-red-sunglo bold uppercase">添加停车场 | |
| 20 | + <span class="step-title"> 1 - 4 </span> | |
| 21 | + </span> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + <div class="portlet-body form"> | |
| 25 | + | |
| 26 | + <!-- START FORM --> | |
| 27 | + <form class="form-horizontal" id="submit_carpark_form" action="/" method="POST" novalidate="novalidate"> | |
| 28 | + <div class="form-wizard"> | |
| 29 | + <div class="form-body"> | |
| 30 | + <ul class="nav nav-pills nav-justified steps"> | |
| 31 | + <li class="active"> | |
| 32 | + <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true"> | |
| 33 | + <span class="number"> 1 </span> | |
| 34 | + <span class="desc"> | |
| 35 | + <i class="fa fa-check"></i> 选择添加停车场方式 </span> | |
| 36 | + </a> | |
| 37 | + </li> | |
| 38 | + <li> | |
| 39 | + <a href="#tab2" data-toggle="tab" class="step"> | |
| 40 | + <span class="number"> 2 </span> | |
| 41 | + <span class="desc"> | |
| 42 | + <i class="fa fa-check"></i> 停车场位置 </span> | |
| 43 | + </a> | |
| 44 | + </li> | |
| 45 | + <li> | |
| 46 | + <a href="#tab3" data-toggle="tab" class="step active"> | |
| 47 | + <span class="number"> 3 </span> | |
| 48 | + <span class="desc"> | |
| 49 | + <i class="fa fa-check"></i> 停车场信息 </span> | |
| 50 | + </a> | |
| 51 | + </li> | |
| 52 | + <li> | |
| 53 | + <a href="#tab4" data-toggle="tab" class="step"> | |
| 54 | + <span class="number"> 4 </span> | |
| 55 | + <span class="desc"> | |
| 56 | + <i class="fa fa-check"></i> 确认 </span> | |
| 57 | + </a> | |
| 58 | + </li> | |
| 59 | + </ul> | |
| 60 | + | |
| 61 | + <!-- 进度条 --> | |
| 62 | + <div id="bar" class="progress progress-striped" role="progressbar"> | |
| 63 | + <div class="progress-bar progress-bar-success" style="width: 25%;"></div> | |
| 64 | + </div> | |
| 65 | + | |
| 66 | + <div class="tab-content"> | |
| 67 | + <div class="alert alert-danger display-hide"> | |
| 68 | + <button class="close" data-close="alert"></button> | |
| 69 | + 您的输入有误,请检查下面的输入项 | |
| 70 | + </div> | |
| 71 | + <div class="alert alert-success display-none"> | |
| 72 | + <button class="close" data-dismiss="alert"></button> | |
| 73 | + Your form validation is successful! | |
| 74 | + </div> | |
| 75 | + | |
| 76 | + <!-- 选择添加站点方式 --> | |
| 77 | + <div class="tab-pane active" id="tab1"> | |
| 78 | + | |
| 79 | + <h3 class="block"> 选择添加停车场方式 </h3> | |
| 80 | + | |
| 81 | + <!-- 站点名称 --> | |
| 82 | + <div class="form-group" id="formRequ"> | |
| 83 | + <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称:</label> | |
| 84 | + <div class="col-md-9"> | |
| 85 | + <input type="text" class="form-control input-medium" id="parkNamebooxtInput" name="parkNamebooxt"> | |
| 86 | + </div> | |
| 87 | + </div> | |
| 88 | + | |
| 89 | + <!-- 新增方式 --> | |
| 90 | + <div class="form-group"> | |
| 91 | + <label class="col-md-3 control-label">新增方式:</label> | |
| 92 | + <div class="col-md-9"> | |
| 93 | + <div class="icheck-list"> | |
| 94 | + <label> | |
| 95 | + <input type="radio" class="icheck" name="baseRes" value=0 checked> 系统生成 | |
| 96 | + </label> | |
| 97 | + <label > | |
| 98 | + <input type="radio" class="icheck" name="baseRes" value=1 > 手动添加 | |
| 99 | + </label> | |
| 100 | + </div> | |
| 101 | + </div> | |
| 102 | + </div> | |
| 103 | + | |
| 104 | + <div class="form-group"> | |
| 105 | + <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50"> | |
| 106 | + <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 新增方式说明: </span></h5> | |
| 107 | + <p><span class="help-block" style="color:#1bbc9b;"> a)系统生成:根据站点名称自动生成以150米为半径范围的圆.</span> </p> | |
| 108 | + <p><span class="help-block" style="color:#1bbc9b;"> b)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span> </p> | |
| 109 | + </div> | |
| 110 | + </div> | |
| 111 | + | |
| 112 | + </div> | |
| 113 | + | |
| 114 | + <!-- 站点位置 --> | |
| 115 | + <div class="tab-pane" id="tab2"> | |
| 116 | + <h3 class="block"> 站点位置 </h3> | |
| 117 | + <div id="bmap_basic"></div> | |
| 118 | + | |
| 119 | + <div class="leftUtils"> | |
| 120 | + <div class="btn-group" style="left: 100px;"> | |
| 121 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具 | |
| 122 | + <i class="fa fa-angle-down"></i> | |
| 123 | + </a> | |
| 124 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | |
| 125 | + <li> | |
| 126 | + <a href="javascript:;" id="oppenDrawingManager"><i class="fa fa-pencil"></i> 打开 </a> | |
| 127 | + </li> | |
| 128 | + <li> | |
| 129 | + <a href="javascript:;" id = "closeDrawingManager"> <i class="fa fa-reply"></i> 关闭 </a> | |
| 130 | + </li> | |
| 131 | + | |
| 132 | + </ul> | |
| 133 | + </div> | |
| 134 | + </div> | |
| 135 | + </div> | |
| 136 | + | |
| 137 | + <!-- 站点信息 --> | |
| 138 | + <div class="tab-pane" id="tab3"> | |
| 139 | + | |
| 140 | + <h3 class="block"> 停车场信息 </h3> | |
| 141 | + | |
| 142 | + <input type="hidden" name="bParkPoint" id="bParkPointInput" /> | |
| 143 | + | |
| 144 | + <input type="hidden" name="gParkPoint" id="gParkPointInput" /> | |
| 145 | + | |
| 146 | + <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | |
| 147 | + | |
| 148 | + | |
| 149 | + <!-- 停车场名称 --> | |
| 150 | + <div class="form-body"> | |
| 151 | + <div class="form-group"> | |
| 152 | + <label class="control-label col-md-3"> | |
| 153 | + <span class="required"> * </span> 停车场名称 : | |
| 154 | + </label> | |
| 155 | + <div class="col-md-6"> | |
| 156 | + <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="站点名称"> | |
| 157 | + </div> | |
| 158 | + </div> | |
| 159 | + </div> | |
| 160 | + | |
| 161 | + <!-- 停车场编码 --> | |
| 162 | + <div class="form-body"> | |
| 163 | + <div class="form-group"> | |
| 164 | + <label class="control-label col-md-3"> | |
| 165 | + <span class="required"> * </span>停车场编码: | |
| 166 | + </label> | |
| 167 | + <div class="col-md-6"> | |
| 168 | + <input type="text" class="form-control" name="parkCode" id="parkCodeInput"> | |
| 169 | + </div> | |
| 170 | + </div> | |
| 171 | + </div> | |
| 172 | + | |
| 173 | + <!-- 中心位置坐标点 --> | |
| 174 | + <div class="form-body"> | |
| 175 | + <div class="form-group"> | |
| 176 | + <label class="col-md-3 control-label">经纬度坐标点:</label> | |
| 177 | + <div class="col-md-6"> | |
| 178 | + <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput"> | |
| 179 | + </div> | |
| 180 | + </div> | |
| 181 | + </div> | |
| 182 | + | |
| 183 | + <!-- 站点WGS经纬度 --> | |
| 184 | + <div class="form-body"> | |
| 185 | + <div class="form-group"> | |
| 186 | + <label class="col-md-3 control-label">站点WGS经纬度:</label> | |
| 187 | + <div class="col-md-6"> | |
| 188 | + <input type="text" class="form-control" name="gCenterPoint" id="gCenterPointInput"> | |
| 189 | + </div> | |
| 190 | + </div> | |
| 191 | + </div> | |
| 192 | + | |
| 193 | + <!-- 范围图形类型 --> | |
| 194 | + <div class="form-body"> | |
| 195 | + <div class="form-group"> | |
| 196 | + <label class="col-md-3 control-label">范围图形类型:</label> | |
| 197 | + <div class="col-md-6"> | |
| 198 | + <select name="shapesType" class="form-control" id="shapesTypeSelect"> | |
| 199 | + <option value="">-- 请选择站点类型 --</option> | |
| 200 | + <option value="r">圆形</option> | |
| 201 | + <option value="d">多变形</option> | |
| 202 | + </select> | |
| 203 | + </div> | |
| 204 | + </div> | |
| 205 | + </div> | |
| 206 | + | |
| 207 | + <!-- 圆形半径 --> | |
| 208 | + <div class="form-body"> | |
| 209 | + <div class="form-group"> | |
| 210 | + <label class="col-md-3 control-label">圆形半径:</label> | |
| 211 | + <div class="col-md-6"> | |
| 212 | + <input type="text" class="form-control" name="radius" id="radiusInput" > | |
| 213 | + </div> | |
| 214 | + </div> | |
| 215 | + </div> | |
| 216 | + | |
| 217 | + <!-- 面积 --> | |
| 218 | + <div class="form-body"> | |
| 219 | + <div class="form-group"> | |
| 220 | + <label class="col-md-3 control-label">面积:</label> | |
| 221 | + <div class="col-md-6"> | |
| 222 | + <input type="text" class="form-control" name="area" id="areaInput" > | |
| 223 | + <span class="help-block">单位:平方米</span> | |
| 224 | + </div> | |
| 225 | + </div> | |
| 226 | + </div> | |
| 227 | + | |
| 228 | + <!-- 所属公司 --> | |
| 229 | + <div class="form-body"> | |
| 230 | + <div class="form-group"> | |
| 231 | + <label class="col-md-3 control-label">所属公司:</label> | |
| 232 | + <div class="col-md-6"> | |
| 233 | + <select name="company" class="form-control" style="width:100%" id="companySelect"> | |
| 234 | + | |
| 235 | + </select> | |
| 236 | + </div> | |
| 237 | + </div> | |
| 238 | + </div> | |
| 239 | + | |
| 240 | + | |
| 241 | + <!-- 所属分公司 --> | |
| 242 | + <div class="form-body"> | |
| 243 | + <div class="form-group"> | |
| 244 | + <label class="col-md-3 control-label">所属分公司:</label> | |
| 245 | + <div class="col-md-6"> | |
| 246 | + <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> | |
| 247 | + </select> | |
| 248 | + </div> | |
| 249 | + </div> | |
| 250 | + </div> | |
| 251 | + | |
| 252 | + | |
| 253 | + <!-- 版本号 --> | |
| 254 | + <div class="form-body"> | |
| 255 | + <div class="form-group"> | |
| 256 | + <label class="col-md-3 control-label">版本号:</label> | |
| 257 | + <div class="col-md-6"> | |
| 258 | + <input type="text" class="form-control" name="versions" value='1' Readonly> | |
| 259 | + </div> | |
| 260 | + </div> | |
| 261 | + </div> | |
| 262 | + | |
| 263 | + <!-- 范围图形类型 --> | |
| 264 | + <div class="form-body"> | |
| 265 | + <div class="form-group"> | |
| 266 | + <label class="col-md-3 control-label">是否撤销:</label> | |
| 267 | + <div class="col-md-6"> | |
| 268 | + <select name="destroy" class="form-control" id="destroySelect"> | |
| 269 | + <option value="">-- 请选择撤销类型 --</option> | |
| 270 | + <option value="0">否</option> | |
| 271 | + <option value="1">是</option> | |
| 272 | + </select> | |
| 273 | + </div> | |
| 274 | + </div> | |
| 275 | + </div> | |
| 276 | + | |
| 277 | + <!-- 描述/说明 --> | |
| 278 | + <div class="form-group"> | |
| 279 | + <label class="control-label col-md-3"> 描述/说明: </label> | |
| 280 | + <div class="col-md-6"> | |
| 281 | + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | |
| 282 | + </div> | |
| 283 | + </div> | |
| 284 | + | |
| 285 | + </div> | |
| 286 | + | |
| 287 | + <!-- 确定提交资料信息 --> | |
| 288 | + <div class="tab-pane" id="tab4"> | |
| 289 | + <h3 class="block"> 确认您提交的停车场信息 </h3> | |
| 290 | + | |
| 291 | + <h4 class="form-section"> 地理位置 </h4> | |
| 292 | + | |
| 293 | + <div class="form-group"> | |
| 294 | + <label class="control-label col-md-3"> 范围图形类型: </label> | |
| 295 | + <div class="col-md-4"> | |
| 296 | + <p class="form-control-static" data-display="shapesType"> </p> | |
| 297 | + </div> | |
| 298 | + </div> | |
| 299 | + | |
| 300 | + <div class="form-group"> | |
| 301 | + <label class="control-label col-md-3"> 圆形半径: </label> | |
| 302 | + <div class="col-md-4"> | |
| 303 | + <p class="form-control-static" data-display="radius"> </p> | |
| 304 | + </div> | |
| 305 | + </div> | |
| 306 | + | |
| 307 | + <div class="form-group"> | |
| 308 | + <label class="control-label col-md-3"> 中心位置经纬度坐标点: </label> | |
| 309 | + <div class="col-md-4"> | |
| 310 | + <p class="form-control-static" data-display="bCenterPoint"> </p> | |
| 311 | + </div> | |
| 312 | + </div> | |
| 313 | + | |
| 314 | + <div class="form-group"> | |
| 315 | + <label class="control-label col-md-3"> 中心位置WGS坐标点: </label> | |
| 316 | + <div class="col-md-4"> | |
| 317 | + <p class="form-control-static" data-display="gCenterPoint"> </p> | |
| 318 | + </div> | |
| 319 | + </div> | |
| 320 | + | |
| 321 | + <h4 class="form-section"> 停车场信息 </h4> | |
| 322 | + | |
| 323 | + <div class="form-group"> | |
| 324 | + <label class="control-label col-md-3">停车场名称:</label> | |
| 325 | + <div class="col-md-4"> | |
| 326 | + <p class="form-control-static" data-display="parkName"> </p> | |
| 327 | + </div> | |
| 328 | + </div> | |
| 329 | + | |
| 330 | + <div class="form-group"> | |
| 331 | + <label class="control-label col-md-3">停车场编码:</label> | |
| 332 | + <div class="col-md-4"> | |
| 333 | + <p class="form-control-static" data-display="parkCode"> </p> | |
| 334 | + </div> | |
| 335 | + </div> | |
| 336 | + | |
| 337 | + <div class="form-group"> | |
| 338 | + <label class="control-label col-md-3">面积:</label> | |
| 339 | + <div class="col-md-4"> | |
| 340 | + <p class="form-control-static" data-display="area"> </p> | |
| 341 | + </div> | |
| 342 | + </div> | |
| 343 | + | |
| 344 | + <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="company"> </p> | |
| 348 | + </div> | |
| 349 | + </div> | |
| 350 | + | |
| 351 | + <div class="form-group"> | |
| 352 | + <label class="control-label col-md-3">分公司:</label> | |
| 353 | + <div class="col-md-4"> | |
| 354 | + <p class="form-control-static" data-display="brancheCompany"> </p> | |
| 355 | + </div> | |
| 356 | + </div> | |
| 357 | + | |
| 358 | + <div class="form-group"> | |
| 359 | + <label class="control-label col-md-3">版本号:</label> | |
| 360 | + <div class="col-md-4"> | |
| 361 | + <p class="form-control-static" data-display="versions"> </p> | |
| 362 | + </div> | |
| 363 | + </div> | |
| 364 | + | |
| 365 | + <div class="form-group"> | |
| 366 | + <label class="control-label col-md-3">是否撤销:</label> | |
| 367 | + <div class="col-md-4"> | |
| 368 | + <p class="form-control-static" data-display="destroy"> </p> | |
| 369 | + </div> | |
| 370 | + </div> | |
| 371 | + | |
| 372 | + <div class="form-group"> | |
| 373 | + <label class="control-label col-md-3">描述/说明:</label> | |
| 374 | + <div class="col-md-4"> | |
| 375 | + <p class="form-control-static" data-display="descriptions"> </p> | |
| 376 | + </div> | |
| 377 | + </div> | |
| 378 | + | |
| 379 | + </div> | |
| 380 | + </div> | |
| 381 | + </div> | |
| 382 | + | |
| 383 | + <div class="form-actions"> | |
| 384 | + <div class="row"> | |
| 385 | + <div class="col-md-offset-3 col-md-9"> | |
| 386 | + <a href="javascript:;" class="btn default button-previous disabled" style="display: none;"> | |
| 387 | + <i class="fa fa-angle-left"></i> 返回 </a> | |
| 388 | + <a href="javascript:;" class="btn btn-outline green button-next"> 下一步 | |
| 389 | + <i class="fa fa-angle-right"></i> | |
| 390 | + </a> | |
| 391 | + <a href="javascript:;" class="btn green button-submit" style="display: none;"> 提交 | |
| 392 | + <i class="fa fa-check"></i> | |
| 393 | + </a> | |
| 394 | + </div> | |
| 395 | + </div> | |
| 396 | + </div> | |
| 397 | + | |
| 398 | + </div> | |
| 399 | + </form> | |
| 400 | + | |
| 401 | + <!-- END FORM--> | |
| 402 | + | |
| 403 | + </div> | |
| 404 | +</div> | |
| 405 | +<script src="/pages/base/carpark/js/add-input-function.js"></script> | |
| 406 | +<script src="/pages/base/carpark/js/add-form-wizard.js"></script> | |
| 407 | +<script src="/pages/base/carpark/js/add-vmap-world.js"></script> | |
| 408 | +<script type="text/javascript"> | |
| 409 | + | |
| 410 | + var mapB = ''; | |
| 411 | + | |
| 412 | + var circle = ''; | |
| 413 | + | |
| 414 | + var drawingManager = ''; | |
| 415 | + | |
| 416 | + // 定义表单 | |
| 417 | + var form = $('#submit_carpark_form'); | |
| 418 | + | |
| 419 | + // 定义表单异常 | |
| 420 | + var error = $('.alert-danger',form); | |
| 421 | + | |
| 422 | + // 定义表单成功 | |
| 423 | + var success = $('.alert-success',form); | |
| 424 | + | |
| 425 | + $(document).ready(function() { | |
| 426 | + | |
| 427 | + // 关闭左侧栏 | |
| 428 | + if (!$('body').hasClass('page-sidebar-closed')) { | |
| 429 | + | |
| 430 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 431 | + | |
| 432 | + } | |
| 433 | + | |
| 434 | + setTimeout(function(){ | |
| 435 | + | |
| 436 | + FormWizard.init(); | |
| 437 | + | |
| 438 | + mapB = VmapWorlds.init(); | |
| 439 | + | |
| 440 | + PublicFunctions.getCarParkCode(function(carParkCode) { | |
| 441 | + | |
| 442 | + $('#parkCodeInput').val(carParkCode); | |
| 443 | + | |
| 444 | + }); | |
| 445 | + | |
| 446 | + $('#destroySelect').val('0'); | |
| 447 | + | |
| 448 | + PublicFunctions.getBusinessAllInfo(function(array) { | |
| 449 | + | |
| 450 | + var opGroup = '<option value="">请选择...</option><optgroup label="公司">'; | |
| 451 | + | |
| 452 | + var len_ = array.length; | |
| 453 | + | |
| 454 | + if(len_>0) { | |
| 455 | + | |
| 456 | + $.each(array, function(i, g){ | |
| 457 | + | |
| 458 | + opGroup += '<option value="'+g.businessCode+'">'+g.businessName+'</option>'; | |
| 459 | + | |
| 460 | + }); | |
| 461 | + | |
| 462 | + } | |
| 463 | + | |
| 464 | + opGroup += '</optgroup>'; | |
| 465 | + | |
| 466 | + $('#companySelect').html(opGroup).select2(); | |
| 467 | + | |
| 468 | + }); | |
| 469 | + | |
| 470 | + var htm = '<option value="">请选择...</option><optgroup label="公司">'; | |
| 471 | + | |
| 472 | + $('#brancheCompanySelect').html(htm).select2(); | |
| 473 | + | |
| 474 | + $('#companySelect').on("change", function (e) { | |
| 475 | + | |
| 476 | + // 获取公司下拉框选择值 | |
| 477 | + var businessCode = $('#companySelect').val(); | |
| 478 | + | |
| 479 | + // 分公司下拉框options属性值 | |
| 480 | + var options = '<option value="">请选择...</option><optgroup label="分公司">'; | |
| 481 | + | |
| 482 | + // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 | |
| 483 | + if(businessCode == null || businessCode ==''){ | |
| 484 | + | |
| 485 | + options += '</optgroup>'; | |
| 486 | + | |
| 487 | + // 填充分公司下拉框options | |
| 488 | + $('#brancheCompanySelect').html(options).select2(); | |
| 489 | + | |
| 490 | + } else { | |
| 491 | + | |
| 492 | + // 查询出所属公司下的分公司名称和相应分公司代码 | |
| 493 | + $get('/business/all', {upCode_eq: businessCode}, function(array){ | |
| 494 | + | |
| 495 | + // 遍历array | |
| 496 | + $.each(array, function(i,d){ | |
| 497 | + | |
| 498 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | |
| 499 | + | |
| 500 | + options += '</optgroup>'; | |
| 501 | + | |
| 502 | + }); | |
| 503 | + | |
| 504 | + // 填充分公司下拉框options | |
| 505 | + $('#brancheCompanySelect').html(options).select2(); | |
| 506 | + | |
| 507 | + }); | |
| 508 | + } | |
| 509 | + | |
| 510 | + }); | |
| 511 | + | |
| 512 | + | |
| 513 | + }, 500); | |
| 514 | + | |
| 515 | + }); | |
| 516 | + | |
| 517 | + // 提交 | |
| 518 | + $('.button-submit').on('click',function() { | |
| 519 | + | |
| 520 | + form.submit(); | |
| 521 | + | |
| 522 | + }); | |
| 523 | + | |
| 524 | + $('#oppenDrawingManager').on('click',function() { | |
| 525 | + | |
| 526 | + drawingManager.open(); | |
| 527 | + | |
| 528 | + // 设置属性 | |
| 529 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | |
| 530 | + | |
| 531 | + }); | |
| 532 | + | |
| 533 | + $('#closeDrawingManager').on('click',function() { | |
| 534 | + | |
| 535 | + drawingManager.close(); | |
| 536 | + }); | |
| 537 | + | |
| 538 | +</script> | |
| 0 | 539 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/css/carpark-add.css
0 → 100644
| 1 | +.leftUtils{ | |
| 2 | + position: absolute; | |
| 3 | + padding-right: 100px; | |
| 4 | + width: 100%; | |
| 5 | + height: 40px; | |
| 6 | + z-index: 9999; | |
| 7 | + padding-top: 7px; | |
| 8 | + top: 400px; | |
| 9 | +} | |
| 10 | +#bmap_basic{ | |
| 11 | + min-width: 100%; | |
| 12 | + width: 100%; | |
| 13 | + margin-top: -28px; | |
| 14 | + border: 2px solid #fdfdfd; | |
| 15 | + min-height: 400px; | |
| 16 | + height:100%; | |
| 17 | + overflow: hidden; | |
| 18 | + top: 15px; | |
| 19 | +} | |
| 20 | + | |
| 21 | + | |
| 22 | +/* 隐藏百度地图logo */ | |
| 23 | +.anchorBL, | |
| 24 | +.anchorBL, | |
| 25 | +.amap-logo, | |
| 26 | +.amap-copyright{ | |
| 27 | + display: none; | |
| 28 | +} | |
| 29 | + | |
| 30 | +.BMap_pop div:nth-child(1) , | |
| 31 | +.BMap_pop div:nth-child(2) , | |
| 32 | +.BMap_pop div:nth-child(3) , | |
| 33 | +.BMap_pop div:nth-child(4) , | |
| 34 | +.BMap_pop div:nth-child(5) , | |
| 35 | +.BMap_pop div:nth-child(6) , | |
| 36 | +.BMap_pop div:nth-child(7) { | |
| 37 | + | |
| 38 | + border:0px solid rgb(255, 255, 255) !important; | |
| 39 | + background-color:#3B3F51 !important; | |
| 40 | + | |
| 41 | +} | |
| 42 | + | |
| 43 | +.BMap_pop div:nth-child(3){ | |
| 44 | + | |
| 45 | + width:23px !important; | |
| 46 | + | |
| 47 | +} | |
| 48 | + | |
| 49 | +.BMap_pop div:nth-child(7) { | |
| 50 | + | |
| 51 | + width:23px !important; | |
| 52 | + | |
| 53 | + height:24px !important; | |
| 54 | + | |
| 55 | +} | |
| 56 | + | |
| 57 | +.BMap_pop div:nth-child(5) { | |
| 58 | + | |
| 59 | + height:24px !important; | |
| 60 | + | |
| 61 | +} | |
| 62 | + | |
| 63 | +/* 图片以后在弄,先隐藏div */ | |
| 64 | +.BMap_pop div:nth-child(8) { | |
| 65 | + | |
| 66 | + height:0px !important; | |
| 67 | + /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */ | |
| 68 | + /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */ | |
| 69 | + | |
| 70 | +} | |
| 71 | + | |
| 72 | +.BMap_pop { | |
| 73 | + | |
| 74 | + box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important; | |
| 75 | + | |
| 76 | +} | |
| 0 | 77 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/css/positions.css
0 → 100644
| 1 | +#bmap_basic{ | |
| 2 | + min-width: 100%; | |
| 3 | + width: calc(100% + 26px); | |
| 4 | + margin-top: -28px; | |
| 5 | + border: 2px solid #fdfdfd; | |
| 6 | + min-height: 1200px; | |
| 7 | + height:100%; | |
| 8 | + overflow: hidden; | |
| 9 | +} | |
| 10 | + | |
| 11 | +html,body{ | |
| 12 | + overflow:hidden; | |
| 13 | +} | |
| 14 | + | |
| 15 | +/* 隐藏百度地图logo */ | |
| 16 | +.anchorBL, | |
| 17 | +.anchorBL, | |
| 18 | +.amap-logo, | |
| 19 | +.amap-copyright{ | |
| 20 | + display: none; | |
| 21 | +} | |
| 22 | + | |
| 23 | + | |
| 24 | +.leftUtils{ | |
| 25 | + position: absolute; | |
| 26 | + padding-right: 100px; | |
| 27 | + width: 100%; | |
| 28 | + height: 40px; | |
| 29 | + z-index: 9999; | |
| 30 | + padding-top: 7px; | |
| 31 | + top: 20px; | |
| 32 | +} | |
| 33 | + | |
| 34 | +.BMap_pop div:nth-child(1) , | |
| 35 | +.BMap_pop div:nth-child(2) , | |
| 36 | +.BMap_pop div:nth-child(3) , | |
| 37 | +.BMap_pop div:nth-child(4) , | |
| 38 | +.BMap_pop div:nth-child(5) , | |
| 39 | +.BMap_pop div:nth-child(6) , | |
| 40 | +.BMap_pop div:nth-child(7) { | |
| 41 | + | |
| 42 | + border:0px solid rgb(255, 255, 255) !important; | |
| 43 | + background-color:#3B3F51 !important; | |
| 44 | + | |
| 45 | +} | |
| 46 | + | |
| 47 | +.BMap_pop div:nth-child(3){ | |
| 48 | + | |
| 49 | + width:23px !important; | |
| 50 | + | |
| 51 | +} | |
| 52 | + | |
| 53 | +.BMap_pop div:nth-child(7) { | |
| 54 | + | |
| 55 | + width:23px !important; | |
| 56 | + | |
| 57 | + height:24px !important; | |
| 58 | + | |
| 59 | +} | |
| 60 | + | |
| 61 | +.BMap_pop div:nth-child(5) { | |
| 62 | + | |
| 63 | + height:24px !important; | |
| 64 | + | |
| 65 | +} | |
| 66 | + | |
| 67 | +/* 图片以后在弄,先隐藏div */ | |
| 68 | +.BMap_pop div:nth-child(8) { | |
| 69 | + | |
| 70 | + height:0px !important; | |
| 71 | + /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */ | |
| 72 | + /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */ | |
| 73 | + | |
| 74 | +} | |
| 75 | + | |
| 76 | +.BMap_pop { | |
| 77 | + | |
| 78 | + box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important; | |
| 79 | + | |
| 80 | +} | |
| 0 | 81 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/edit.html
0 → 100644
| 1 | +<!-- 编辑停车场 --> | |
| 2 | +<div class="modal fade" id="edit_carPark_mobal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 3 | + | |
| 4 | + <div class="modal-dialog"> | |
| 5 | + | |
| 6 | + <div class="modal-content"> | |
| 7 | + | |
| 8 | + <div class="modal-header"> | |
| 9 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | |
| 10 | + <h4 class="modal-title">编辑站点</h4> | |
| 11 | + </div> | |
| 12 | + | |
| 13 | + <div class="modal-body"> | |
| 14 | + | |
| 15 | + <form class="form-horizontal" role="form" id="edit_carPark_form" action="/module" method="post"> | |
| 16 | + | |
| 17 | + <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> | |
| 18 | + 您的输入有误,请检查下面的输入项 | |
| 19 | + </div> | |
| 20 | + | |
| 21 | + <input type="hidden" name="id" id="idInput" /> | |
| 22 | + | |
| 23 | + <input type="hidden" name="bParkPoint" id="bParkPointInput" /> | |
| 24 | + | |
| 25 | + <input type="hidden" name="gParkPoint" id="gParkPointInput" /> | |
| 26 | + | |
| 27 | + <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | |
| 28 | + | |
| 29 | + <!-- 停车场名称 --> | |
| 30 | + <div class="form-body"> | |
| 31 | + <div class="form-group"> | |
| 32 | + <label class="control-label col-md-3"> | |
| 33 | + <span class="required"> * </span> 停车场名称 : | |
| 34 | + </label> | |
| 35 | + <div class="col-md-6"> | |
| 36 | + <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="站点名称"> | |
| 37 | + </div> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + | |
| 41 | + <!-- 停车场编码 --> | |
| 42 | + <div class="form-body"> | |
| 43 | + <div class="form-group"> | |
| 44 | + <label class="control-label col-md-3"> | |
| 45 | + <span class="required"> * </span>停车场编码: | |
| 46 | + </label> | |
| 47 | + <div class="col-md-6"> | |
| 48 | + <input type="text" class="form-control" name="parkCode" id="parkCodeInput"> | |
| 49 | + </div> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + | |
| 53 | + <!-- 中心位置坐标点 --> | |
| 54 | + <div class="form-body"> | |
| 55 | + <div class="form-group"> | |
| 56 | + <label class="col-md-3 control-label">经纬度坐标点:</label> | |
| 57 | + <div class="col-md-6"> | |
| 58 | + <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput"> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + | |
| 63 | + <!-- 站点WGS经纬度 --> | |
| 64 | + <div class="form-body"> | |
| 65 | + <div class="form-group"> | |
| 66 | + <label class="col-md-3 control-label">站点WGS经纬度:</label> | |
| 67 | + <div class="col-md-6"> | |
| 68 | + <input type="text" class="form-control" name="gCenterPoint" id="gCenterPointInput"> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + | |
| 73 | + <!-- 范围图形类型 --> | |
| 74 | + <div class="form-body"> | |
| 75 | + <div class="form-group"> | |
| 76 | + <label class="col-md-3 control-label">范围图形类型:</label> | |
| 77 | + <div class="col-md-6"> | |
| 78 | + <select name="shapesType" class="form-control" id="shapesTypeSelect"> | |
| 79 | + <option value="">-- 请选择站点类型 --</option> | |
| 80 | + <option value="r">圆形</option> | |
| 81 | + <option value="d">多变形</option> | |
| 82 | + </select> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + | |
| 87 | + <!-- 圆形半径 --> | |
| 88 | + <div class="form-body"> | |
| 89 | + <div class="form-group"> | |
| 90 | + <label class="col-md-3 control-label">圆形半径:</label> | |
| 91 | + <div class="col-md-6"> | |
| 92 | + <input type="text" class="form-control" name="radius" id="radiusInput" > | |
| 93 | + </div> | |
| 94 | + </div> | |
| 95 | + </div> | |
| 96 | + | |
| 97 | + <!-- 面积 --> | |
| 98 | + <div class="form-body"> | |
| 99 | + <div class="form-group"> | |
| 100 | + <label class="col-md-3 control-label">面积:</label> | |
| 101 | + <div class="col-md-6"> | |
| 102 | + <input type="text" class="form-control" name="area" id="areaInput" > | |
| 103 | + <span class="help-block">单位:平方米</span> | |
| 104 | + </div> | |
| 105 | + </div> | |
| 106 | + </div> | |
| 107 | + | |
| 108 | + <!-- 所属公司 --> | |
| 109 | + <div class="form-body"> | |
| 110 | + <div class="form-group"> | |
| 111 | + <label class="col-md-3 control-label">所属公司:</label> | |
| 112 | + <div class="col-md-6"> | |
| 113 | + <select name="company" class="form-control" style="width:100%" id="companySelect"> | |
| 114 | + | |
| 115 | + </select> | |
| 116 | + </div> | |
| 117 | + </div> | |
| 118 | + </div> | |
| 119 | + | |
| 120 | + <!-- 所属分公司 --> | |
| 121 | + <div class="form-body"> | |
| 122 | + <div class="form-group"> | |
| 123 | + <label class="col-md-3 control-label">所属分公司:</label> | |
| 124 | + <div class="col-md-6"> | |
| 125 | + <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> | |
| 126 | + </select> | |
| 127 | + </div> | |
| 128 | + </div> | |
| 129 | + </div> | |
| 130 | + | |
| 131 | + <!-- 版本号 --> | |
| 132 | + <div class="form-body"> | |
| 133 | + <div class="form-group"> | |
| 134 | + <label class="col-md-3 control-label">版本号:</label> | |
| 135 | + <div class="col-md-6"> | |
| 136 | + <input type="text" class="form-control" name="versions" value='1' Readonly> | |
| 137 | + </div> | |
| 138 | + </div> | |
| 139 | + </div> | |
| 140 | + | |
| 141 | + <!-- 范围图形类型 --> | |
| 142 | + <div class="form-body"> | |
| 143 | + <div class="form-group"> | |
| 144 | + <label class="col-md-3 control-label">是否撤销:</label> | |
| 145 | + <div class="col-md-6"> | |
| 146 | + <select name="destroy" class="form-control" id="destroySelect"> | |
| 147 | + <option value="">-- 请选择撤销类型 --</option> | |
| 148 | + <option value="0">否</option> | |
| 149 | + <option value="1">是</option> | |
| 150 | + </select> | |
| 151 | + </div> | |
| 152 | + </div> | |
| 153 | + </div> | |
| 154 | + | |
| 155 | + <!-- 描述/说明 --> | |
| 156 | + <div class="form-group"> | |
| 157 | + <label class="control-label col-md-3"> 描述/说明: </label> | |
| 158 | + <div class="col-md-6"> | |
| 159 | + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | |
| 160 | + </div> | |
| 161 | + </div> | |
| 162 | + </form> | |
| 163 | + </div> | |
| 164 | + <div class="modal-footer"> | |
| 165 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 166 | + <button type="button" class="btn btn-primary" id="editStationButton">提交数据</button> | |
| 167 | + </div> | |
| 168 | + </div> | |
| 169 | + </div> | |
| 170 | +</div> | |
| 171 | +<script type="text/javascript"> | |
| 172 | + | |
| 173 | +$(function(){ | |
| 174 | + | |
| 175 | + PublicFunctions.setFormValue(); | |
| 176 | + | |
| 177 | + PublicFunctions.selectTemp(function() { | |
| 178 | + | |
| 179 | + var businessCode = carParkObj[0].carParkCompany; | |
| 180 | + | |
| 181 | + $('#companySelect').val(businessCode); | |
| 182 | + | |
| 183 | + PublicFunctions.getbrancheCompanyValues(businessCode,function() { | |
| 184 | + | |
| 185 | + $('#brancheCompanySelect').val(carParkObj[0].carParkBrancheCompany); | |
| 186 | + | |
| 187 | + }); | |
| 188 | + | |
| 189 | + }); | |
| 190 | + | |
| 191 | + // 公司值改变事件 | |
| 192 | + $('#companySelect').on('change',companySelectChangeSetBrancheValue); | |
| 193 | + | |
| 194 | + function companySelectChangeSetBrancheValue() { | |
| 195 | + | |
| 196 | + // 获取公司下拉框选择值 | |
| 197 | + var businessCode = $('#companySelect').val(); | |
| 198 | + | |
| 199 | + // 分公司下拉框options属性值 | |
| 200 | + var options = '<option value="">-- 请选择分公司 --</option>'; | |
| 201 | + | |
| 202 | + // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 | |
| 203 | + if(businessCode == null || businessCode ==''){ | |
| 204 | + | |
| 205 | + // 填充分公司下拉框options | |
| 206 | + $('#brancheCompanySelect').html(options); | |
| 207 | + | |
| 208 | + } else { | |
| 209 | + | |
| 210 | + // 查询出所属公司下的分公司名称和相应分公司代码 | |
| 211 | + $get('/business/all', {upCode_eq: businessCode}, function(array){ | |
| 212 | + | |
| 213 | + // 遍历array | |
| 214 | + $.each(array, function(i,d){ | |
| 215 | + | |
| 216 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | |
| 217 | + | |
| 218 | + }); | |
| 219 | + | |
| 220 | + // 填充分公司下拉框options | |
| 221 | + $('#brancheCompanySelect').html(options); | |
| 222 | + | |
| 223 | + }); | |
| 224 | + } | |
| 225 | + } | |
| 226 | + | |
| 227 | + // 显示mobal | |
| 228 | + $('#edit_carPark_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | |
| 229 | + | |
| 230 | + // 当调用 hide 实例方法时触发 | |
| 231 | + $('#edit_carPark_mobal').on('hide.bs.modal', function () { | |
| 232 | + | |
| 233 | + // 清楚地图覆盖物 | |
| 234 | + mapB.clearOverlays(); | |
| 235 | + | |
| 236 | + carParkObj=''; | |
| 237 | + | |
| 238 | + PublicFunctions.initCarPark(); | |
| 239 | + }); | |
| 240 | + | |
| 241 | + | |
| 242 | + // 编辑表单元素 | |
| 243 | + var form = $('#edit_carPark_form'); | |
| 244 | + | |
| 245 | + // 获取错误提示元素 | |
| 246 | + var error = $('.alert-danger', form); | |
| 247 | + | |
| 248 | + // 提交数据按钮事件 | |
| 249 | + $('#editStationButton').on('click', function() { | |
| 250 | + | |
| 251 | + // 表单提交 | |
| 252 | + form.submit(); | |
| 253 | + | |
| 254 | + }); | |
| 255 | + | |
| 256 | + // 表单验证 | |
| 257 | + form.validate({ | |
| 258 | + | |
| 259 | + errorElement : 'span', | |
| 260 | + | |
| 261 | + errorClass : 'help-block help-block-error', | |
| 262 | + | |
| 263 | + focusInvalid : false, | |
| 264 | + | |
| 265 | + rules : { | |
| 266 | + | |
| 267 | + // 停车场名称 | |
| 268 | + 'parkName' : { | |
| 269 | + | |
| 270 | + // 必填项 | |
| 271 | + required : true | |
| 272 | + | |
| 273 | + } | |
| 274 | + | |
| 275 | + }, | |
| 276 | + | |
| 277 | + invalidHandler : function(event, validator) { | |
| 278 | + | |
| 279 | + error.show(); | |
| 280 | + | |
| 281 | + App.scrollTo(error, -200); | |
| 282 | + | |
| 283 | + }, | |
| 284 | + | |
| 285 | + highlight : function(element) { | |
| 286 | + | |
| 287 | + $(element).closest('.form-group').addClass('has-error'); | |
| 288 | + | |
| 289 | + }, | |
| 290 | + | |
| 291 | + unhighlight : function(element) { | |
| 292 | + | |
| 293 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 294 | + | |
| 295 | + }, | |
| 296 | + | |
| 297 | + success : function(label) { | |
| 298 | + | |
| 299 | + label.closest('.form-group').removeClass('has-error'); | |
| 300 | + | |
| 301 | + }, | |
| 302 | + | |
| 303 | + submitHandler : function(f) { | |
| 304 | + | |
| 305 | + var params = form.serializeJSON(); | |
| 306 | + | |
| 307 | + params.createBy = carParkObj[0].carParkCreateBy; | |
| 308 | + | |
| 309 | + // 定义日期格式 | |
| 310 | + var fs = 'YYYY-MM-DD HH:mm:ss' | |
| 311 | + | |
| 312 | + // 设置日期 | |
| 313 | + params.createDate = moment(carParkObj[0].carParkCreateDate).format(fs); | |
| 314 | + | |
| 315 | + error.hide(); | |
| 316 | + | |
| 317 | + PublicFunctions.carParkUpdate(params,function(resuntDate) { | |
| 318 | + | |
| 319 | + if(resuntDate.status=='SUCCESS') { | |
| 320 | + | |
| 321 | + // 弹出添加成功提示消息 | |
| 322 | + layer.msg('修改成功...'); | |
| 323 | + | |
| 324 | + | |
| 325 | + }else { | |
| 326 | + | |
| 327 | + // 弹出添加失败提示消息 | |
| 328 | + layer.msg('修改失败...'); | |
| 329 | + | |
| 330 | + } | |
| 331 | + | |
| 332 | + $('#edit_carPark_mobal').modal('hide'); | |
| 333 | + | |
| 334 | + }) | |
| 335 | + | |
| 336 | + } | |
| 337 | + }); | |
| 338 | + | |
| 339 | +}); | |
| 340 | +</script> | |
| 0 | 341 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/edit_select.html
0 → 100644
| 1 | +<!-- 选择编辑停车场方式 --> | |
| 2 | +<div class="modal fade" id="edit_select_mobal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 3 | + | |
| 4 | + <div class="modal-dialog"> | |
| 5 | + | |
| 6 | + <div class="modal-content"> | |
| 7 | + | |
| 8 | + <div class="modal-header"> | |
| 9 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | |
| 10 | + <h4 class="modal-title">选择修改停车场方式</h4> | |
| 11 | + </div> | |
| 12 | + | |
| 13 | + <div class="modal-body"> | |
| 14 | + | |
| 15 | + <form class="form-horizontal" action="/" method="post" id="edit_select" role="form"> | |
| 16 | + | |
| 17 | + <div class="alert alert-danger display-hide" id="editSelectrequired"> | |
| 18 | + <button class="close" data-close="alert"></button> | |
| 19 | + 站点名称为必填项 | |
| 20 | + </div> | |
| 21 | + | |
| 22 | + <div class="alert alert-danger display-hide" id="serchrname"> | |
| 23 | + <button class="close" data-close="alert"></button> | |
| 24 | + 系统无法生成,请选择其他方式新增 | |
| 25 | + </div> | |
| 26 | + | |
| 27 | + <div class="form-group" id="formRequ"> | |
| 28 | + <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称:</label> | |
| 29 | + <div class="col-md-9" id="errorInfo"> | |
| 30 | + <input type="text" class="form-control input-medium" id="carParkNameboxInput" name="carParkNamebox"> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + | |
| 34 | + <div class="form-group"> | |
| 35 | + <label class="col-md-3 control-label">修改方式:</label> | |
| 36 | + <div class="col-md-9"> | |
| 37 | + <div class="icheck-list"> | |
| 38 | + <label> | |
| 39 | + <input type="radio" class="icheck" name="editselect" value=0> 手动规划 | |
| 40 | + </label> | |
| 41 | + <label> | |
| 42 | + <input type="radio" class="icheck" name="editselect" value=1 checked> 重新编辑 | |
| 43 | + </label> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + <div class="form-group"> | |
| 48 | + <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50"> | |
| 49 | + <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 修改方式说明: </span></h5> | |
| 50 | + <p><span class="help-block" style="color:#1bbc9b;"> a)系统生成:根据站点名称自动生成以150米为半径范围的圆.</span> </p> | |
| 51 | + <p><span class="help-block" style="color:#1bbc9b;"> b)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span> </p> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + </form> | |
| 55 | + </div> | |
| 56 | + <div class="modal-footer"> | |
| 57 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 58 | + <button type="button" class="btn btn-primary" id="editselectStationNextButton">下一步</button> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | +</div> | |
| 63 | +<script type="text/javascript"> | |
| 64 | + | |
| 65 | +$(function(){ | |
| 66 | + | |
| 67 | + // 显示选择修改方式弹出层 | |
| 68 | + $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | |
| 69 | + | |
| 70 | + // 获取停车场名称元素并赋值 | |
| 71 | + $('#carParkNameboxInput').val(carParkObj[0].carParkName); | |
| 72 | + | |
| 73 | + // 定义停车场图形类型 | |
| 74 | + var stationShapesTypeV = carParkObj[0].carParkShapesType; | |
| 75 | + | |
| 76 | + // 获取表单元素 | |
| 77 | + var form = $('#edit_select'); | |
| 78 | + | |
| 79 | + // 获取错误提示元素 | |
| 80 | + var editSelectrequired = $('#editSelectrequired', form); | |
| 81 | + | |
| 82 | + // 下一步操作事件 | |
| 83 | + $('#editselectStationNextButton').on('click', function() { | |
| 84 | + | |
| 85 | + // 表单提交 | |
| 86 | + form.submit(); | |
| 87 | + | |
| 88 | + }); | |
| 89 | + | |
| 90 | + //form 表单验证 | |
| 91 | + form.validate({ | |
| 92 | + | |
| 93 | + errorElement : 'span', | |
| 94 | + | |
| 95 | + errorClass : 'help-block help-block-error', | |
| 96 | + | |
| 97 | + focusInvalid : false, | |
| 98 | + | |
| 99 | + rules : { | |
| 100 | + | |
| 101 | + 'carParkNamebox' : { | |
| 102 | + | |
| 103 | + minlength : 2, | |
| 104 | + | |
| 105 | + required : true, | |
| 106 | + | |
| 107 | + maxlength : 10 | |
| 108 | + | |
| 109 | + } | |
| 110 | + | |
| 111 | + }, | |
| 112 | + | |
| 113 | + invalidHandler : function(event, validator) { | |
| 114 | + | |
| 115 | + editSelectrequired.show(); | |
| 116 | + | |
| 117 | + App.scrollTo(requiredname, -200); | |
| 118 | + | |
| 119 | + }, | |
| 120 | + | |
| 121 | + highlight : function(element) { | |
| 122 | + | |
| 123 | + $(element).closest('.form-group').addClass('has-error'); | |
| 124 | + | |
| 125 | + }, | |
| 126 | + | |
| 127 | + unhighlight : function(element) { | |
| 128 | + | |
| 129 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 130 | + | |
| 131 | + }, | |
| 132 | + | |
| 133 | + success : function(label) { | |
| 134 | + | |
| 135 | + label.closest('.form-group').removeClass('has-error'); | |
| 136 | + | |
| 137 | + }, | |
| 138 | + | |
| 139 | + submitHandler : function(f) { | |
| 140 | + | |
| 141 | + // 隐藏弹出层 | |
| 142 | + $('#edit_select_mobal').modal('hide'); | |
| 143 | + | |
| 144 | + // 表单序列 | |
| 145 | + var params = form.serializeJSON(); | |
| 146 | + | |
| 147 | + // 停车场名称 | |
| 148 | + var editStationName = params.carParkNamebox; | |
| 149 | + | |
| 150 | + var eidtselect_ = params.editselect; | |
| 151 | + | |
| 152 | + // 站点名称 | |
| 153 | + carParkObj[0].carParkName = editStationName; | |
| 154 | + | |
| 155 | + if(eidtselect_==0){ | |
| 156 | + | |
| 157 | + // 清楚地图覆盖物 | |
| 158 | + mapB.clearOverlays(); | |
| 159 | + | |
| 160 | + // 打开鼠标绘画工具 | |
| 161 | + drawingManager.open(); | |
| 162 | + | |
| 163 | + // 设置属性 | |
| 164 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | |
| 165 | + | |
| 166 | + | |
| 167 | + }else if(eidtselect_==1){ | |
| 168 | + | |
| 169 | + // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | |
| 170 | + var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', | |
| 171 | + shift: 0,time: 10000}); | |
| 172 | + | |
| 173 | + // 编辑图形 | |
| 174 | + PublicFunctions.editShapes(stationShapesTypeV,mindex); | |
| 175 | + | |
| 176 | + } | |
| 177 | + | |
| 178 | + } | |
| 179 | + }); | |
| 180 | + | |
| 181 | +}); | |
| 182 | +</script> | |
| 0 | 183 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
0 → 100644
| 1 | + | |
| 2 | +/** | |
| 3 | + * 表单的导航向导、验证、提交 | |
| 4 | + * | |
| 5 | + */ | |
| 6 | + | |
| 7 | +var FormWizard = function() { | |
| 8 | + | |
| 9 | + return { | |
| 10 | + | |
| 11 | + // 启动初始化向导导航 | |
| 12 | + init : function() { | |
| 13 | + | |
| 14 | + if(!jQuery().bootstrapWizard) { | |
| 15 | + | |
| 16 | + return; | |
| 17 | + | |
| 18 | + } | |
| 19 | + | |
| 20 | + // 表单验证 | |
| 21 | + form.validate({ | |
| 22 | + | |
| 23 | + // 错误提示元素span对象 | |
| 24 | + errorElement : 'span', | |
| 25 | + | |
| 26 | + // 错误提示元素class名称 | |
| 27 | + errorClass : 'help-block help-block-error', | |
| 28 | + | |
| 29 | + // 验证错误获取焦点 | |
| 30 | + focusInvalid : true, | |
| 31 | + | |
| 32 | + // 需要验证的表单元素 | |
| 33 | + rules : { | |
| 34 | + | |
| 35 | + // 停车场名称 | |
| 36 | + 'parkNamebooxt' : { | |
| 37 | + | |
| 38 | + // 必填项 | |
| 39 | + required : true, | |
| 40 | + | |
| 41 | + // 最大长度 | |
| 42 | + maxlength: 20 | |
| 43 | + } | |
| 44 | + | |
| 45 | + | |
| 46 | + }, | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。 | |
| 50 | + * | |
| 51 | + * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator) | |
| 52 | + */ | |
| 53 | + invalidHandler : function(event, validator) { | |
| 54 | + | |
| 55 | + // 显示表单未通过提示信息 | |
| 56 | + error.show(); | |
| 57 | + | |
| 58 | + // 把提示信息放到指定的位置。 | |
| 59 | + App.scrollTo(error, -200); | |
| 60 | + }, | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 类型:Callback。 | |
| 64 | + * | |
| 65 | + * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。 | |
| 66 | + */ | |
| 67 | + highlight : function(element) { | |
| 68 | + | |
| 69 | + // 添加errorClass("has-error")到表单元素 | |
| 70 | + $(element).closest('.form-group').addClass('has-error'); | |
| 71 | + }, | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 类型:Callback。 | |
| 75 | + * | |
| 76 | + * 默认:移除errorClass("has-error")。与highlight操作相反 | |
| 77 | + */ | |
| 78 | + unhighlight : function(element) { | |
| 79 | + | |
| 80 | + // 移除errorClass("has-error") | |
| 81 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 82 | + }, | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * 类型:String,Callback。 | |
| 86 | + * | |
| 87 | + * 如果指定它,当验证通过时显示一个消息。 | |
| 88 | + * | |
| 89 | + * 如果是String类型的,则添加该样式到标签中; | |
| 90 | + * | |
| 91 | + * 如果是一个回调函数,则将标签作为其唯一的参数。 | |
| 92 | + */ | |
| 93 | + success : function(label) { | |
| 94 | + | |
| 95 | + // 当验证通过时,移除errorClass("has-error") | |
| 96 | + label.closest('.form-group').removeClass('has-error'); | |
| 97 | + }, | |
| 98 | + | |
| 99 | + /** | |
| 100 | + * 类型:Callback。 | |
| 101 | + * | |
| 102 | + * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form | |
| 103 | + */ | |
| 104 | + submitHandler : function(f) { | |
| 105 | + | |
| 106 | + // 表单序列化 | |
| 107 | + var params = form.serializeJSON(); | |
| 108 | + | |
| 109 | + //保存站点 | |
| 110 | + PublicFunctions.carParkSave(params,function(data) { | |
| 111 | + | |
| 112 | + if(data.status=='SUCCESS') { | |
| 113 | + | |
| 114 | + // 弹出添加成功提示消息 | |
| 115 | + layer.msg('添加成功...'); | |
| 116 | + | |
| 117 | + | |
| 118 | + }else { | |
| 119 | + | |
| 120 | + // 弹出添加失败提示消息 | |
| 121 | + layer.msg('添加失败...'); | |
| 122 | + | |
| 123 | + } | |
| 124 | + | |
| 125 | + // 返回list.html页面 | |
| 126 | + loadPage('list.html'); | |
| 127 | + | |
| 128 | + }); | |
| 129 | + | |
| 130 | + } | |
| 131 | + }); | |
| 132 | + | |
| 133 | + // 确认提交信息 | |
| 134 | + var displayConfirm = function() { | |
| 135 | + | |
| 136 | + // 遍历表单元素下的tab4的class名称为form-control-static | |
| 137 | + $('#tab4 .form-control-static', form).each(function(){ | |
| 138 | + | |
| 139 | + // 定义input | |
| 140 | + var input = $('[name="'+$(this).attr("data-display")+'"]', form); | |
| 141 | + | |
| 142 | + if (input.is(":radio")) { | |
| 143 | + | |
| 144 | + input = $('[name="'+$(this).attr("data-display")+'"]:checked', form); | |
| 145 | + | |
| 146 | + } | |
| 147 | + if (input.is(":text") || input.is("textarea")) { | |
| 148 | + | |
| 149 | + $(this).html(input.val()); | |
| 150 | + | |
| 151 | + } else if (input.is("select")) { | |
| 152 | + | |
| 153 | + $(this).html(input.find('option:selected').text()); | |
| 154 | + | |
| 155 | + } else if (input.is(":radio") && input.is(":checked")) { | |
| 156 | + | |
| 157 | + $(this).html(input.attr("data-title")); | |
| 158 | + | |
| 159 | + } else if ($(this).attr("data-display") == 'payment[]') { | |
| 160 | + | |
| 161 | + var payment = []; | |
| 162 | + | |
| 163 | + $('[name="payment[]"]:checked', form).each(function(){ | |
| 164 | + | |
| 165 | + payment.push($(this).attr('data-title')); | |
| 166 | + | |
| 167 | + }); | |
| 168 | + | |
| 169 | + $(this).html(payment.join("<br>")); | |
| 170 | + } | |
| 171 | + }); | |
| 172 | + } | |
| 173 | + | |
| 174 | + /** 按钮点击时触发 */ | |
| 175 | + var handleTitle = function(tab, navigation, index) { | |
| 176 | + | |
| 177 | + // 定义导航条标签个数 | |
| 178 | + var total = navigation.find('li').length; | |
| 179 | + | |
| 180 | + // 当前标签页 | |
| 181 | + var current = index + 1; | |
| 182 | + | |
| 183 | + // 设置向导标题 | |
| 184 | + $('.step-title', $('#form-wizard-info')).text((index + 1) + ' - ' + total); | |
| 185 | + | |
| 186 | + // 删除"done"样式 | |
| 187 | + jQuery('li', $('#form-wizard-info')).removeClass("done"); | |
| 188 | + | |
| 189 | + // 获取导航标签元素集合 | |
| 190 | + var li_list = navigation.find('li'); | |
| 191 | + | |
| 192 | + // 遍历 | |
| 193 | + for (var i = 0; i < index; i++) { | |
| 194 | + | |
| 195 | + // 追加done样式 | |
| 196 | + jQuery(li_list[i]).addClass("done"); | |
| 197 | + | |
| 198 | + } | |
| 199 | + | |
| 200 | + | |
| 201 | + /** 如果为第一步隐藏返回按钮,否则显示返回按钮. */ | |
| 202 | + if (current == 1) { | |
| 203 | + | |
| 204 | + // 隐藏返回按钮 | |
| 205 | + $('#submit_carpark_form').find('.button-previous').hide(); | |
| 206 | + | |
| 207 | + } else { | |
| 208 | + | |
| 209 | + // 显示返回按钮 | |
| 210 | + $('#submit_carpark_form').find('.button-previous').show(); | |
| 211 | + | |
| 212 | + } | |
| 213 | + | |
| 214 | + if (current == 2) { | |
| 215 | + | |
| 216 | + var baseResValue = $('#submit_carpark_form input[name="baseRes"]:checked').val(); | |
| 217 | + | |
| 218 | + var stationNameV = $('#parkNamebooxtInput').val(); | |
| 219 | + | |
| 220 | + $('#parkNameInput').val(stationNameV); | |
| 221 | + | |
| 222 | + VmapWorlds.localSearchFromAdreesToPoint(stationNameV,mapB,function(Points) { | |
| 223 | + | |
| 224 | + if(Points) { | |
| 225 | + | |
| 226 | + var BJwpointsArray = Points.split(' '); | |
| 227 | + | |
| 228 | + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | |
| 229 | + | |
| 230 | + marker_stargt2 = new BMap.Marker(stationNameChangePoint); | |
| 231 | + | |
| 232 | + var PanOptions ={noAnimation :true}; | |
| 233 | + | |
| 234 | + mapB.panTo(stationNameChangePoint,PanOptions); | |
| 235 | + | |
| 236 | + mapB.panBy(0,100); | |
| 237 | + | |
| 238 | + // 将标注添加到地图中 | |
| 239 | + mapB.addOverlay(marker_stargt2); | |
| 240 | + | |
| 241 | + //跳动的动画 | |
| 242 | + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | |
| 243 | + | |
| 244 | + if(baseResValue == 0) { | |
| 245 | + | |
| 246 | + $('.leftUtils').hide(); | |
| 247 | + | |
| 248 | + //创建圆 | |
| 249 | + circle = new BMap.Circle(stationNameChangePoint,150,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | |
| 250 | + | |
| 251 | + // 百度地图添加覆盖物圆 | |
| 252 | + mapB.addOverlay(circle); | |
| 253 | + | |
| 254 | + // 开启编辑功能 | |
| 255 | + circle.enableEditing(); | |
| 256 | + | |
| 257 | + // 编辑圆监听事件 | |
| 258 | + circle.addEventListener('remove',function() { | |
| 259 | + | |
| 260 | + // 清除marker | |
| 261 | + mapB.removeOverlay(marker_stargt2); | |
| 262 | + | |
| 263 | + // 返回圆形的半径,单位为米。 | |
| 264 | + var newRadius = circle.getRadius(); | |
| 265 | + | |
| 266 | + // 返回圆形的中心点坐标。 | |
| 267 | + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | |
| 268 | + | |
| 269 | + var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; | |
| 270 | + | |
| 271 | + // 中心百度坐标转WGS坐标 | |
| 272 | + PublicFunctions.getFormPointEToWGS(centre_New,function(p) { | |
| 273 | + | |
| 274 | + // 设置修改站点参数集合 | |
| 275 | + PublicFunctions.setFormInputValue(newCenter, p[0].WGSpotion.Lng , p[0].WGSpotion.Lat,'','','r',Math.round(newRadius)); | |
| 276 | + | |
| 277 | + }); | |
| 278 | + | |
| 279 | + }); | |
| 280 | + | |
| 281 | + }else if(baseResValue ==1) { | |
| 282 | + | |
| 283 | + VmapWorlds.drawingManagerOpen(); | |
| 284 | + | |
| 285 | + } | |
| 286 | + | |
| 287 | + }else { | |
| 288 | + | |
| 289 | + // 弹出添加成功提示消息 | |
| 290 | + layer.msg('无法获取停车场【'+stationNameV+'】地理位置!'); | |
| 291 | + | |
| 292 | + } | |
| 293 | + | |
| 294 | + }); | |
| 295 | + | |
| 296 | + } | |
| 297 | + | |
| 298 | + if(current == 3){ | |
| 299 | + | |
| 300 | + mapB.clearOverlays(); | |
| 301 | + | |
| 302 | + circle = ''; | |
| 303 | + | |
| 304 | + drawingManager.close(); | |
| 305 | + | |
| 306 | + } | |
| 307 | + | |
| 308 | + /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */ | |
| 309 | + if (current >= total) { | |
| 310 | + | |
| 311 | + // 隐藏下一步按钮 | |
| 312 | + $('#submit_carpark_form').find('.button-next').hide(); | |
| 313 | + | |
| 314 | + // 显示提交按钮 | |
| 315 | + $('#submit_carpark_form').find('.button-submit').show(); | |
| 316 | + | |
| 317 | + // 确认提交信息 | |
| 318 | + displayConfirm(); | |
| 319 | + | |
| 320 | + } else { | |
| 321 | + | |
| 322 | + // 显示下一步按钮 | |
| 323 | + $('#submit_carpark_form').find('.button-next').show(); | |
| 324 | + | |
| 325 | + // 隐藏提交按钮 | |
| 326 | + $('#submit_carpark_form').find('.button-submit').hide(); | |
| 327 | + | |
| 328 | + } | |
| 329 | + | |
| 330 | + // 移动到指定位置 | |
| 331 | + App.scrollTo($('.page-title')); | |
| 332 | + | |
| 333 | + } | |
| 334 | + | |
| 335 | + // 表单导航向导插件 | |
| 336 | + $('#submit_carpark_form').bootstrapWizard({ | |
| 337 | + | |
| 338 | + // 下一步元素选择器 | |
| 339 | + 'nextSelector': '.button-next', | |
| 340 | + | |
| 341 | + // 返回元素选择器 | |
| 342 | + 'previousSelector': '.button-previous', | |
| 343 | + | |
| 344 | + /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */ | |
| 345 | + onTabClick: function (tab, navigation, index, clickedIndex) { | |
| 346 | + | |
| 347 | + success.hide(); | |
| 348 | + | |
| 349 | + error.hide(); | |
| 350 | + | |
| 351 | + if (form.valid() == false) { | |
| 352 | + | |
| 353 | + return false; | |
| 354 | + | |
| 355 | + } | |
| 356 | + | |
| 357 | + handleTitle(tab, navigation, clickedIndex); | |
| 358 | + | |
| 359 | + }, | |
| 360 | + | |
| 361 | + /** 下一步按钮被单击时触发, 返回移动到下一个步骤. */ | |
| 362 | + onNext: function (tab, navigation, index) { | |
| 363 | + | |
| 364 | + success.hide(); | |
| 365 | + | |
| 366 | + error.hide(); | |
| 367 | + | |
| 368 | + if (form.valid() == false) { | |
| 369 | + | |
| 370 | + return false; | |
| 371 | + | |
| 372 | + } | |
| 373 | + | |
| 374 | + mapB.clearOverlays(); | |
| 375 | + | |
| 376 | + circle = ''; | |
| 377 | + | |
| 378 | + handleTitle(tab, navigation, index); | |
| 379 | + | |
| 380 | + }, | |
| 381 | + | |
| 382 | + /** 上一步按钮被单击时触发,返回移动到前一个步骤 */ | |
| 383 | + onPrevious: function (tab, navigation, index) { | |
| 384 | + | |
| 385 | + success.hide(); | |
| 386 | + | |
| 387 | + error.hide(); | |
| 388 | + | |
| 389 | + mapB.clearOverlays(); | |
| 390 | + | |
| 391 | + circle = ''; | |
| 392 | + | |
| 393 | + drawingManager.close(); | |
| 394 | + | |
| 395 | + handleTitle(tab, navigation, index); | |
| 396 | + | |
| 397 | + }, | |
| 398 | + | |
| 399 | + /** 显示选项卡内容 */ | |
| 400 | + onTabShow: function (tab, navigation, index) { | |
| 401 | + | |
| 402 | + var total = navigation.find('li').length; | |
| 403 | + | |
| 404 | + var current = index + 1; | |
| 405 | + | |
| 406 | + var $percent = (current / total) * 100; | |
| 407 | + | |
| 408 | + $('#submit_carpark_form').find('.progress-bar').css({ | |
| 409 | + | |
| 410 | + width: $percent + '%' | |
| 411 | + | |
| 412 | + }); | |
| 413 | + | |
| 414 | + } | |
| 415 | + | |
| 416 | + }); | |
| 417 | + | |
| 418 | + // 初始化第一步隐藏返回按钮 | |
| 419 | + $('#submit_carpark_form').find('.button-previous').hide(); | |
| 420 | + | |
| 421 | + } | |
| 422 | + }; | |
| 423 | +}(); | ... | ... |
src/main/resources/static/pages/base/carpark/js/add-input-function.js
0 → 100644
| 1 | +/** | |
| 2 | + * 函数 | |
| 3 | + * | |
| 4 | + * - - - - - - - 》 getCurrSelNode : 获取选中树节点数据函数 | |
| 5 | + * | |
| 6 | + * - - - - - - - 》 resjtreeDate : 刷新树函数函数 | |
| 7 | + * | |
| 8 | + * - - - - - - - 》 setFormInputValue : 新增站点参数集合赋值函数 | |
| 9 | + * | |
| 10 | + * - - - - - - - 》 editSetStationParmas : 编辑站点参数集合赋值函数 | |
| 11 | + * | |
| 12 | + * - - - - - - - 》 editSeteditStationParmasValue:编辑站点范围图形参数集合赋值函数 | |
| 13 | + * | |
| 14 | + * - - - - - - - 》 lineNameIsHaveInterval : 系统规划时线路名称是否为区间 | |
| 15 | + * | |
| 16 | + * - - - - - - - 》 systemLineStation:系统规划保存函数 | |
| 17 | + * | |
| 18 | + * - - - - - - - 》 stationRevoke :撤销站点 | |
| 19 | + * | |
| 20 | + * - - - - - - - 》 editLinePlan :编辑线路走向 | |
| 21 | + * | |
| 22 | + * - - - - - - - 》 setFormValue :编辑站点设置表单元素值 | |
| 23 | + * | |
| 24 | + * - - - - - - - 》 eachSectionList:路段折线百度坐标转WGS坐标 | |
| 25 | + */ | |
| 26 | + | |
| 27 | +var PublicFunctions = function () { | |
| 28 | + | |
| 29 | + var PubFun = { | |
| 30 | + | |
| 31 | + // 原百度坐标转WGS坐标 | |
| 32 | + getFormPointEToWGS: function(points,callback) { | |
| 33 | + | |
| 34 | + // 获取长度 | |
| 35 | + var len = points.length; | |
| 36 | + | |
| 37 | + (function(){ | |
| 38 | + | |
| 39 | + if (!arguments.callee.count) { | |
| 40 | + | |
| 41 | + arguments.callee.count = 0; | |
| 42 | + | |
| 43 | + } | |
| 44 | + | |
| 45 | + arguments.callee.count++; | |
| 46 | + | |
| 47 | + var index = parseInt(arguments.callee.count) - 1; | |
| 48 | + | |
| 49 | + if (index >= len) { | |
| 50 | + | |
| 51 | + callback && callback(points); | |
| 52 | + | |
| 53 | + return; | |
| 54 | + } | |
| 55 | + | |
| 56 | + var f = arguments.callee; | |
| 57 | + | |
| 58 | + $.ajax({ | |
| 59 | + | |
| 60 | + url: 'http://api.zdoz.net/bd2wgs.aspx', | |
| 61 | + | |
| 62 | + data: {lat: points[index].potion.lat , lng: points[index].potion.lng}, | |
| 63 | + | |
| 64 | + dataType: 'jsonp', | |
| 65 | + | |
| 66 | + success: function(r){ | |
| 67 | + | |
| 68 | + if(r) { | |
| 69 | + | |
| 70 | + points[index].WGSpotion = r; | |
| 71 | + | |
| 72 | + } | |
| 73 | + | |
| 74 | + f(); | |
| 75 | + } | |
| 76 | + }); | |
| 77 | + | |
| 78 | + })(); | |
| 79 | + | |
| 80 | + }, | |
| 81 | + | |
| 82 | + /** @param points:中心点 ;gLonx:中心点WGS经度;gLaty:中心点WGS纬度;bPolygonGridValue:百度坐标点图形集合;gPolygonGridVlaue:WGS坐标点图形集合;shapesTypeValue:范围图形类型;radiusValue:圆半径 */ | |
| 83 | + setFormInputValue: function(points,gLonx,gLaty,bPolygonGridValue,gPolygonGridVlaue,shapesTypeValue,radiusValue) { | |
| 84 | + | |
| 85 | + // 百度地图经纬度坐标中心点 | |
| 86 | + $('#bCenterPointInput').val(points); | |
| 87 | + | |
| 88 | + // WGS经纬度 | |
| 89 | + $('#gCenterPointInput').val(gLonx + ' ' + gLaty); | |
| 90 | + | |
| 91 | + // 百度坐标点图形集合 | |
| 92 | + $('#bParkPointInput').val(bPolygonGridValue); | |
| 93 | + | |
| 94 | + // WGS坐标点图形集合 | |
| 95 | + $('#gParkPointInput').val(gPolygonGridVlaue); | |
| 96 | + | |
| 97 | + // 图形类型 | |
| 98 | + $('#shapesTypeSelect').val(shapesTypeValue); | |
| 99 | + | |
| 100 | + // 圆形半径 | |
| 101 | + $('#radiusInput').val(radiusValue); | |
| 102 | + | |
| 103 | + }, | |
| 104 | + | |
| 105 | + getBusinessAllInfo : function(cb) { | |
| 106 | + | |
| 107 | + // 填充公司下拉框选择值 | |
| 108 | + $get('/business/all', {upCode_eq: '88'}, function(array){ | |
| 109 | + | |
| 110 | + return cb && cb(array); | |
| 111 | + | |
| 112 | + }); | |
| 113 | + | |
| 114 | + }, | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + getCarParkCode : function(callback) { | |
| 119 | + | |
| 120 | + $get('/carpark/getCarParkCode',null,function(carParkCode) { | |
| 121 | + | |
| 122 | + callback && callback(carParkCode); | |
| 123 | + | |
| 124 | + }); | |
| 125 | + | |
| 126 | + }, | |
| 127 | + | |
| 128 | + // 新增站点保存 | |
| 129 | + carParkSave : function(carPark,callback) { | |
| 130 | + | |
| 131 | + $post('/carpark/carParkSave',carPark,function(data) { | |
| 132 | + | |
| 133 | + callback && callback(data); | |
| 134 | + | |
| 135 | + }); | |
| 136 | + | |
| 137 | + } | |
| 138 | + | |
| 139 | + } | |
| 140 | + | |
| 141 | + return PubFun ; | |
| 142 | + | |
| 143 | +}(); | |
| 0 | 144 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/add-vmap-world.js
0 → 100644
| 1 | +var VmapWorlds = function() { | |
| 2 | + | |
| 3 | + var Bmap = { | |
| 4 | + | |
| 5 | + init : function() { | |
| 6 | + | |
| 7 | + // 设置中心点, | |
| 8 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | |
| 9 | + | |
| 10 | + // 百度API Key | |
| 11 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | |
| 12 | + | |
| 13 | + // 初始化百度地图 | |
| 14 | + var map = new BMap.Map("bmap_basic"); | |
| 15 | + | |
| 16 | + //中心点和缩放级别 | |
| 17 | + map.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | |
| 18 | + | |
| 19 | + //启用地图拖拽事件,默认启用(可不写) | |
| 20 | + map.enableDragging(); | |
| 21 | + | |
| 22 | + //启用地图滚轮放大缩小 | |
| 23 | + map.enableScrollWheelZoom(); | |
| 24 | + | |
| 25 | + //禁用鼠标双击放大 | |
| 26 | + map.disableDoubleClickZoom(); | |
| 27 | + | |
| 28 | + //启用键盘上下左右键移动地图 | |
| 29 | + map.enableKeyboard(); | |
| 30 | + | |
| 31 | + var styleOptions = { | |
| 32 | + | |
| 33 | + //边线颜色。 | |
| 34 | + strokeColor : "blue", | |
| 35 | + | |
| 36 | + //填充颜色。当参数为空时,圆形将没有填充效果。 | |
| 37 | + fillColor : "blue", | |
| 38 | + | |
| 39 | + //边线的宽度,以像素为单位。 | |
| 40 | + strokeWeight : 3, | |
| 41 | + | |
| 42 | + //边线透明度,取值范围0 - 1。 | |
| 43 | + strokeOpacity : 0.8, | |
| 44 | + | |
| 45 | + //填充的透明度,取值范围0 - 1。 | |
| 46 | + fillOpacity : 0.6, | |
| 47 | + | |
| 48 | + //边线的样式,solid或dashed。 | |
| 49 | + strokeStyle : 'solid' | |
| 50 | + | |
| 51 | + }; | |
| 52 | + | |
| 53 | + // 创建鼠标绘制管理类 | |
| 54 | + drawingManager = new BMapLib.DrawingManager(map, { | |
| 55 | + | |
| 56 | + //是否开启绘制模式 | |
| 57 | + isOpen : false, | |
| 58 | + | |
| 59 | + //是否显示工具栏 | |
| 60 | + enableDrawingTool : false, | |
| 61 | + | |
| 62 | + drawingToolOptions : { | |
| 63 | + | |
| 64 | + //位置 | |
| 65 | + anchor : BMAP_ANCHOR_TOP_RIGHT, | |
| 66 | + | |
| 67 | + //偏离值 | |
| 68 | + offset : new BMap.Size(5, 5), | |
| 69 | + | |
| 70 | + //工具栏缩放比例 | |
| 71 | + scale : 0.8 | |
| 72 | + | |
| 73 | + }, | |
| 74 | + | |
| 75 | + //线的样式 | |
| 76 | + polygonOptions : styleOptions | |
| 77 | + | |
| 78 | + }); | |
| 79 | + | |
| 80 | + // 添加绘画完成事件 | |
| 81 | + drawingManager.addEventListener('polygoncomplete', function(e) { | |
| 82 | + | |
| 83 | + drawingManager.close(); | |
| 84 | + | |
| 85 | + if (e.getPath().length <= 2) { | |
| 86 | + | |
| 87 | + // 弹出提示消息 | |
| 88 | + layer.msg('坐标点不能小于等于两个...'); | |
| 89 | + | |
| 90 | + // 清除地图覆盖物 | |
| 91 | + map.clearOverlays(); | |
| 92 | + | |
| 93 | + // 加载该线路下所有站点位置添加到地图上 | |
| 94 | + return false; | |
| 95 | + | |
| 96 | + }else { | |
| 97 | + | |
| 98 | + var pointE = e; | |
| 99 | + | |
| 100 | + // 多变行质心点 | |
| 101 | + var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; | |
| 102 | + | |
| 103 | + var PointsList = []; | |
| 104 | + | |
| 105 | + for ( var i = 0; i < pointE.getPath().length; i++) { | |
| 106 | + | |
| 107 | + PointsList.push({potion: {lng: pointE.getPath()[i].lng, lat: pointE.getPath()[i].lat}}); | |
| 108 | + | |
| 109 | + } | |
| 110 | + | |
| 111 | + PointsList.push({potion: {lng: pointE.getPath()[0].lng, lat: pointE.getPath()[0].lat}}); | |
| 112 | + | |
| 113 | + var centre = [{potion:{lng:pointE.getBounds().getCenter().lng,lat:pointE.getBounds().getCenter().lat}}]; | |
| 114 | + | |
| 115 | + PublicFunctions.getFormPointEToWGS(PointsList,function(resultdata) { | |
| 116 | + | |
| 117 | + var gPloygonGrid = ''; | |
| 118 | + | |
| 119 | + var bPloygonGrid = ''; | |
| 120 | + | |
| 121 | + for(var k =0;k<resultdata.length;k++) { | |
| 122 | + | |
| 123 | + if(k==0) { | |
| 124 | + | |
| 125 | + gPloygonGrid = resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 126 | + | |
| 127 | + bPloygonGrid = resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 128 | + | |
| 129 | + }else { | |
| 130 | + | |
| 131 | + gPloygonGrid = gPloygonGrid + ',' + resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 132 | + | |
| 133 | + bPloygonGrid = bPloygonGrid + ',' + resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 134 | + | |
| 135 | + } | |
| 136 | + | |
| 137 | + } | |
| 138 | + | |
| 139 | + gPloygonGrid = 'POLYGON((' + gPloygonGrid + '))'; | |
| 140 | + | |
| 141 | + bPloygonGrid = 'POLYGON((' + bPloygonGrid + '))'; | |
| 142 | + | |
| 143 | + PublicFunctions.getFormPointEToWGS(centre,function(p) { | |
| 144 | + | |
| 145 | + var gLonx = p[0].WGSpotion.Lng; | |
| 146 | + | |
| 147 | + var gLaty = p[0].WGSpotion.Lat; | |
| 148 | + | |
| 149 | + PublicFunctions.setFormInputValue(addSttationPoints_,gLonx,gLaty,bPloygonGrid,gPloygonGrid,'d',''); | |
| 150 | + | |
| 151 | + }); | |
| 152 | + | |
| 153 | + }); | |
| 154 | + | |
| 155 | + } | |
| 156 | + | |
| 157 | + }); | |
| 158 | + | |
| 159 | + return map; | |
| 160 | + }, | |
| 161 | + | |
| 162 | + // 根据地理名称获取百度经纬度坐标 | |
| 163 | + localSearchFromAdreesToPoint: function(Address,map,callback) { | |
| 164 | + | |
| 165 | + // 创建一个搜索类实例 | |
| 166 | + var localSearch = new BMap.LocalSearch(map); | |
| 167 | + | |
| 168 | + // 检索完成后的回调函数。 | |
| 169 | + localSearch.setSearchCompleteCallback(function (searchResult) { | |
| 170 | + | |
| 171 | + var resultPoints = ''; | |
| 172 | + | |
| 173 | + if(searchResult) { | |
| 174 | + | |
| 175 | + // 返回索引指定的结果。索引0表示第1条结果 | |
| 176 | + var poi = searchResult.getPoi(0); | |
| 177 | + | |
| 178 | + if(poi) { | |
| 179 | + | |
| 180 | + //获取经度和纬度 | |
| 181 | + resultPoints = poi.point.lng + ' ' + poi.point.lat; | |
| 182 | + | |
| 183 | + return callback && callback(resultPoints); | |
| 184 | + | |
| 185 | + }else { | |
| 186 | + | |
| 187 | + return callback && callback(false); | |
| 188 | + | |
| 189 | + } | |
| 190 | + | |
| 191 | + }else { | |
| 192 | + | |
| 193 | + return callback && callback(false); | |
| 194 | + } | |
| 195 | + | |
| 196 | + }); | |
| 197 | + | |
| 198 | + // 根据检索词发起检索。 | |
| 199 | + localSearch.search(Address); | |
| 200 | + | |
| 201 | + }, | |
| 202 | + | |
| 203 | + // 打开绘画工具 | |
| 204 | + drawingManagerOpen : function() { | |
| 205 | + | |
| 206 | + // 打开鼠标绘画工具 | |
| 207 | + drawingManager.open(); | |
| 208 | + | |
| 209 | + // 设置属性 | |
| 210 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | |
| 211 | + | |
| 212 | + } | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + } | |
| 217 | + | |
| 218 | + return Bmap; | |
| 219 | + | |
| 220 | +}(); | |
| 0 | 221 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-list-table.js
0 → 100644
| 1 | +/** | |
| 2 | + * | |
| 3 | + * @JSName : list.js(停车场list.html页面js) | |
| 4 | + * | |
| 5 | + * @Author : bsth@lq | |
| 6 | + * | |
| 7 | + * @Description : TODO(停车场list.html页面js) | |
| 8 | + * | |
| 9 | + * @Data : 2016年4月28日 上午9:21:17 | |
| 10 | + * | |
| 11 | + * @Version 公交调度系统BS版 0.1 | |
| 12 | + * | |
| 13 | + */ | |
| 14 | + | |
| 15 | +(function(){ | |
| 16 | + | |
| 17 | + /** page : 当前页 initPag : */ | |
| 18 | + var page = 0,initPag; | |
| 19 | + | |
| 20 | + /** 表格数据分页加载 */ | |
| 21 | + loadTableDate(null,true); | |
| 22 | + | |
| 23 | + /** 重置按钮事件 */ | |
| 24 | + $('tr.filter .filter-cancel').on('click',function(){ | |
| 25 | + | |
| 26 | + // 清空搜索框值 | |
| 27 | + $('tr.filter input,select').val('').change(); | |
| 28 | + | |
| 29 | + // 重新加载表格数据 | |
| 30 | + loadTableDate(null,true); | |
| 31 | + }); | |
| 32 | + | |
| 33 | + /** 搜索按钮事件 */ | |
| 34 | + $('tr.filter .filter-submit').on('click',function(){ | |
| 35 | + | |
| 36 | + // cells 集合返回表格中所有(列)单元格的一个数组 | |
| 37 | + var cells = $('tr.filter')[0].cells; | |
| 38 | + | |
| 39 | + // 搜索参数集合 | |
| 40 | + var params = {}; | |
| 41 | + | |
| 42 | + // 搜索字段名称 | |
| 43 | + var name; | |
| 44 | + | |
| 45 | + // 遍历cells数组 | |
| 46 | + $.each(cells, function(i, cell){ | |
| 47 | + | |
| 48 | + // 获取第i列的input或者select集合 | |
| 49 | + var items = $('input,select', cell); | |
| 50 | + | |
| 51 | + // 遍历items集合 | |
| 52 | + for(var j = 0, item; item = items[j++];){ | |
| 53 | + | |
| 54 | + // 获取字段名称 | |
| 55 | + name = $(item).attr('name'); | |
| 56 | + | |
| 57 | + if(name){ | |
| 58 | + | |
| 59 | + // 赋取相对应的值 | |
| 60 | + params[name] = $(item).val(); | |
| 61 | + | |
| 62 | + } | |
| 63 | + } | |
| 64 | + | |
| 65 | + }); | |
| 66 | + | |
| 67 | + page = 0; | |
| 68 | + | |
| 69 | + loadTableDate(params,true); | |
| 70 | + | |
| 71 | + }); | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 表格数据分页加载事件 | |
| 75 | + * | |
| 76 | + * ------@param : 查询参数 | |
| 77 | + * | |
| 78 | + * ------@isPon : 是否重新分页 | |
| 79 | + * | |
| 80 | + */ | |
| 81 | + function loadTableDate(param,isPon){ | |
| 82 | + | |
| 83 | + // 搜索参数 | |
| 84 | + var params = {}; | |
| 85 | + | |
| 86 | + if(param) { | |
| 87 | + | |
| 88 | + params = param; | |
| 89 | + | |
| 90 | + } | |
| 91 | + | |
| 92 | + // 排序(按更新时间) | |
| 93 | + params['order'] = 'id'; | |
| 94 | + | |
| 95 | + // 记录当前页数 | |
| 96 | + params['page'] = page; | |
| 97 | + | |
| 98 | + // 弹出正在加载层 | |
| 99 | + var i = layer.load(2); | |
| 100 | + | |
| 101 | + // 异步请求获取表格数据 | |
| 102 | + $.get('/carpark',params,function(result){ | |
| 103 | + | |
| 104 | + console.log(result); | |
| 105 | + | |
| 106 | + // 添加序号 | |
| 107 | + result.content.page = page; | |
| 108 | + | |
| 109 | + // 把数据填充到模版中 | |
| 110 | + var tbodyHtml = template('carpark_list_table_temp',{list:result.content}); | |
| 111 | + | |
| 112 | + | |
| 113 | + $('#datatable_carpark tbody').html(tbodyHtml); | |
| 114 | + | |
| 115 | + // 是重新分页且返回数据长度大于0 | |
| 116 | + if(isPon && result.content.length > 0){ | |
| 117 | + | |
| 118 | + // 重新分页 | |
| 119 | + initPag = true; | |
| 120 | + | |
| 121 | + // 分页栏 | |
| 122 | + showPagination(result); | |
| 123 | + | |
| 124 | + } | |
| 125 | + | |
| 126 | + // 关闭弹出加载层 | |
| 127 | + layer.close(i); | |
| 128 | + | |
| 129 | + }); | |
| 130 | + } | |
| 131 | + | |
| 132 | + /** 分页栏组件 */ | |
| 133 | + function showPagination(data){ | |
| 134 | + | |
| 135 | + // 分页组件 | |
| 136 | + $('#pagination').jqPaginator({ | |
| 137 | + | |
| 138 | + // 总页数 | |
| 139 | + totalPages: data.totalPages, | |
| 140 | + | |
| 141 | + // 中间显示页数 | |
| 142 | + visiblePages: 6, | |
| 143 | + | |
| 144 | + // 当前页 | |
| 145 | + currentPage: page + 1, | |
| 146 | + | |
| 147 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | |
| 148 | + | |
| 149 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | |
| 150 | + | |
| 151 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | |
| 152 | + | |
| 153 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | |
| 154 | + | |
| 155 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | |
| 156 | + | |
| 157 | + onPageChange: function (num, type) { | |
| 158 | + | |
| 159 | + if(initPag){ | |
| 160 | + | |
| 161 | + initPag = false; | |
| 162 | + | |
| 163 | + return; | |
| 164 | + | |
| 165 | + } | |
| 166 | + | |
| 167 | + page = num - 1; | |
| 168 | + | |
| 169 | + loadTableDate(null, false); | |
| 170 | + | |
| 171 | + } | |
| 172 | + | |
| 173 | + }); | |
| 174 | + | |
| 175 | + } | |
| 176 | + | |
| 177 | +})(); | |
| 0 | 178 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-events.js
0 → 100644
| 1 | +$(function(){ | |
| 2 | + | |
| 3 | + $('#backUp').on('click',function() { | |
| 4 | + | |
| 5 | + // 获取返回元素并修改url地址 | |
| 6 | + $('#backUp').attr('href','list.html?'); | |
| 7 | + | |
| 8 | + }); | |
| 9 | + | |
| 10 | + $('#edit').on('click',function() { | |
| 11 | + | |
| 12 | + $.get('edit_select.html', function(m){$(pjaxContainer).append(m);}); | |
| 13 | + | |
| 14 | + }); | |
| 15 | + | |
| 16 | + | |
| 17 | +}); | |
| 0 | 18 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-function.js
0 → 100644
| 1 | +/** | |
| 2 | + * 函数 | |
| 3 | + */ | |
| 4 | + | |
| 5 | +var PublicFunctions = function () { | |
| 6 | + | |
| 7 | + var PubFun = { | |
| 8 | + | |
| 9 | + initCarPark : function() { | |
| 10 | + | |
| 11 | + // 获取停车场信息 | |
| 12 | + PublicFunctions.getCarParkInfo(function(r) { | |
| 13 | + | |
| 14 | + console.log(r); | |
| 15 | + | |
| 16 | + var len = r.length; | |
| 17 | + | |
| 18 | + if(len>0) { | |
| 19 | + | |
| 20 | + carParkObj = r; | |
| 21 | + | |
| 22 | + var stationShapesType = r[0].carParkShapesType; | |
| 23 | + | |
| 24 | + if(stationShapesType==null){ | |
| 25 | + | |
| 26 | + // 弹出选择框;确认则提交;取消则返回 | |
| 27 | + layer.confirm('停车场位置缺失,自动延续为添加停车场位置', { | |
| 28 | + btn : [ '确认提示并提交', '取消' ] | |
| 29 | + }, function(index) { | |
| 30 | + | |
| 31 | + var stationNameV = r[0].carParkName; | |
| 32 | + | |
| 33 | + WorldsBMap.localSearchFromAdreesToPoint(stationNameV,mapB,function(Points) { | |
| 34 | + | |
| 35 | + if(Points) { | |
| 36 | + | |
| 37 | + var BJwpointsArray = Points.split(' '); | |
| 38 | + | |
| 39 | + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | |
| 40 | + | |
| 41 | + marker_stargt2 = new BMap.Marker(stationNameChangePoint); | |
| 42 | + | |
| 43 | + var PanOptions ={noAnimation :true}; | |
| 44 | + | |
| 45 | + mapB.panTo(stationNameChangePoint,PanOptions); | |
| 46 | + | |
| 47 | + mapB.panBy(0,-200); | |
| 48 | + | |
| 49 | + // 将标注添加到地图中 | |
| 50 | + mapB.addOverlay(marker_stargt2); | |
| 51 | + | |
| 52 | + //跳动的动画 | |
| 53 | + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | |
| 54 | + | |
| 55 | + } | |
| 56 | + | |
| 57 | + }); | |
| 58 | + | |
| 59 | + // 关闭弹出层 | |
| 60 | + layer.close(index); | |
| 61 | + | |
| 62 | + // 清楚地图覆盖物 | |
| 63 | + mapB.clearOverlays(); | |
| 64 | + | |
| 65 | + // 打开鼠标绘画工具 | |
| 66 | + drawingManager.open(); | |
| 67 | + | |
| 68 | + // 设置属性 | |
| 69 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | |
| 70 | + | |
| 71 | + }); | |
| 72 | + | |
| 73 | + return ; | |
| 74 | + } | |
| 75 | + | |
| 76 | + // 获取中心坐标点字符串分割 | |
| 77 | + var BJwpoints = r[0].carParkBcenterPoint.split(' '); | |
| 78 | + | |
| 79 | + // 中心坐标点 | |
| 80 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | |
| 81 | + | |
| 82 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | |
| 83 | + '<span style="color:#DDD;font-size: 15px;">停车场名称:' + r[0].carParkName + '</span>' + | |
| 84 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场编码:' + r[0].carParkCode + '</span>' + | |
| 85 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场面积:' + r[0].carParkArea + '</span>' + | |
| 86 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + r[0].stationJwpoints + '</span>' + | |
| 87 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].carParkRadius + '</span>' + | |
| 88 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].carParkVersions + '</span>' + | |
| 89 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ 'ddd' +'" >说明/描述:' + 'ddd' + '</span>' ; | |
| 90 | + | |
| 91 | + // 信息窗口参数属性 | |
| 92 | + var opts = { | |
| 93 | + | |
| 94 | + // 信息窗口宽度 | |
| 95 | + width : 200, | |
| 96 | + | |
| 97 | + // 信息窗口高度 | |
| 98 | + height : 450, | |
| 99 | + | |
| 100 | + // 信息窗位置偏移值。 | |
| 101 | + offset: new BMap.Size(500,-80), | |
| 102 | + | |
| 103 | + //标题 | |
| 104 | + title : '<h4 style="color:#FFFFFF">'+r[0].carParkName+'停车场详情</h4>', | |
| 105 | + | |
| 106 | + //设置不允许信窗发送短息 | |
| 107 | + enableMessage : false, | |
| 108 | + | |
| 109 | + //是否开启点击地图关闭信息窗口 | |
| 110 | + enableCloseOnClick : false, | |
| 111 | + | |
| 112 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | |
| 113 | + enableAutoPan:true | |
| 114 | + }; | |
| 115 | + | |
| 116 | + if(stationShapesType == 'r') { | |
| 117 | + | |
| 118 | + // 画圆 | |
| 119 | + PublicFunctions.pointsCircle(r,point,htm,opts,mapB); | |
| 120 | + | |
| 121 | + }else if(stationShapesType == 'd'){ | |
| 122 | + | |
| 123 | + // 画多边形 | |
| 124 | + PublicFunctions.pointsPolygon(r,point,htm,opts,mapB); | |
| 125 | + | |
| 126 | + } | |
| 127 | + } | |
| 128 | + | |
| 129 | + }); | |
| 130 | + | |
| 131 | + }, | |
| 132 | + | |
| 133 | + // 查询停车场信息 | |
| 134 | + getCarParkInfo : function(callback){ | |
| 135 | + | |
| 136 | + $get('/carpark/findCarParkInfoFormId',{id:id},function(r) { | |
| 137 | + | |
| 138 | + return callback && callback(r); | |
| 139 | + | |
| 140 | + }); | |
| 141 | + | |
| 142 | + }, | |
| 143 | + | |
| 144 | + // 在地图上画圆 | |
| 145 | + pointsCircle : function(r,point,htm,opts,map) { | |
| 146 | + | |
| 147 | + //创建圆 | |
| 148 | + circle = new BMap.Circle(point,r[0].carParkRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | |
| 149 | + | |
| 150 | + // 允许覆盖物在map.clearOverlays方法中被清除 | |
| 151 | + circle.enableMassClear(); | |
| 152 | + | |
| 153 | + // 百度地图添加覆盖物圆 | |
| 154 | + map.addOverlay(circle); | |
| 155 | + | |
| 156 | + // 创建信息窗口 | |
| 157 | + infoWindow = new BMap.InfoWindow(htm, opts); | |
| 158 | + | |
| 159 | + // 自定义标注物图片 | |
| 160 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | |
| 161 | + | |
| 162 | + // 创建点 | |
| 163 | + marker = new BMap.Marker(point,{icon : icon_target}); | |
| 164 | + | |
| 165 | + // 把标注添物加到地图上 | |
| 166 | + map.addOverlay(marker); | |
| 167 | + | |
| 168 | + setTimeout(function(){ | |
| 169 | + //开启信息窗口 | |
| 170 | + marker.openInfoWindow(infoWindow,point); | |
| 171 | + | |
| 172 | + },100); | |
| 173 | + | |
| 174 | + // 是否在平移过程中禁止动画。(自1.2新增) | |
| 175 | + var PanOptions_ ={noAnimation :true}; | |
| 176 | + | |
| 177 | + // 将地图的中心点更改为给定的点。 | |
| 178 | + map.panTo(point,PanOptions_); | |
| 179 | + | |
| 180 | + //map.panBy(10,-50,PanOptions_); | |
| 181 | + | |
| 182 | + // 添加标志物监听事件 | |
| 183 | + marker.addEventListener("click",function() { | |
| 184 | + | |
| 185 | + //开启信息窗口 | |
| 186 | + marker.openInfoWindow(infoWindow,point); | |
| 187 | + | |
| 188 | + }); | |
| 189 | + }, | |
| 190 | + | |
| 191 | + pointsPolygon : function(r,pointPolygon,htm,opts_polygon,map) { | |
| 192 | + | |
| 193 | + // 获取多边形坐标字符串 | |
| 194 | + var stationBPolygonGrid = r[0].carParkBparkPoint; | |
| 195 | + | |
| 196 | + // 截取多边形坐标字符串 | |
| 197 | + var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); | |
| 198 | + | |
| 199 | + // 按逗号切割 | |
| 200 | + var pointPolygonArray = stationBPolygonGridStr.split(','); | |
| 201 | + | |
| 202 | + // 多边形坐标集合 | |
| 203 | + var polygonP = []; | |
| 204 | + | |
| 205 | + for(var v = 0;v<pointPolygonArray.length;v++) { | |
| 206 | + | |
| 207 | + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); | |
| 208 | + | |
| 209 | + } | |
| 210 | + | |
| 211 | + // 画多边形 | |
| 212 | + polygon = new BMap.Polygon(polygonP, { | |
| 213 | + | |
| 214 | + // 线条显色 | |
| 215 | + strokeColor : "blue", | |
| 216 | + | |
| 217 | + // 边线的宽度,以像素为单位。 | |
| 218 | + strokeWeight : 2, | |
| 219 | + | |
| 220 | + // 边线透明度,取值范围0 - 1。 | |
| 221 | + strokeOpacity : 0.5 | |
| 222 | + }); | |
| 223 | + | |
| 224 | + // 增加地图覆盖物多边形 | |
| 225 | + map.addOverlay(polygon); | |
| 226 | + | |
| 227 | + // 创建信息窗口 | |
| 228 | + infoWindow = new BMap.InfoWindow(htm, opts_polygon); | |
| 229 | + | |
| 230 | + // 自定义标注物图片 | |
| 231 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | |
| 232 | + | |
| 233 | + // 创建点 | |
| 234 | + marker = new BMap.Marker(pointPolygon,{icon : icon_target}); | |
| 235 | + | |
| 236 | + // 把标注添物加到地图上 | |
| 237 | + map.addOverlay(marker); | |
| 238 | + | |
| 239 | + // 是否在平移过程中禁止动画。(自1.2新增) | |
| 240 | + var PanOptions_ ={noAnimation :true}; | |
| 241 | + | |
| 242 | + // 将地图的中心点更改为给定的点。 | |
| 243 | + map.panTo(pointPolygon,PanOptions_); | |
| 244 | + | |
| 245 | + // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | |
| 246 | + map.panBy(10,110,PanOptions_); | |
| 247 | + | |
| 248 | + //开启信息窗口 | |
| 249 | + marker.openInfoWindow(infoWindow,pointPolygon); | |
| 250 | + | |
| 251 | + }, | |
| 252 | + | |
| 253 | + // 编辑图形 | |
| 254 | + editShapes : function(stationShapesTypeV,mindex) { | |
| 255 | + | |
| 256 | + // 关闭信息窗口 | |
| 257 | + marker.closeInfoWindow(); | |
| 258 | + | |
| 259 | + // 清除marker | |
| 260 | + mapB.removeOverlay(marker); | |
| 261 | + | |
| 262 | + // 编辑圆 | |
| 263 | + if(stationShapesTypeV =='r') { | |
| 264 | + | |
| 265 | + // 开启编辑功能 | |
| 266 | + circle.enableEditing(); | |
| 267 | + | |
| 268 | + // 编辑圆监听事件 | |
| 269 | + circle.addEventListener('dblclick',function() { | |
| 270 | + | |
| 271 | + // 关闭提示弹出层 | |
| 272 | + layer.close(mindex); | |
| 273 | + | |
| 274 | + // 返回圆形的半径,单位为米。 | |
| 275 | + var newRadius = circle.getRadius(); | |
| 276 | + | |
| 277 | + // 返回圆形的中心点坐标。 | |
| 278 | + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | |
| 279 | + | |
| 280 | + var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; | |
| 281 | + | |
| 282 | + // 中心百度坐标转WGS坐标 | |
| 283 | + PublicFunctions.getFormPointEToWGS(centre_New,function(p) { | |
| 284 | + | |
| 285 | + // 设置修改站点参数集合 | |
| 286 | + PublicFunctions.editSeteditStationParmasValue(newCenter, p[0].WGSpotion.Lng , p[0].WGSpotion.Lat,'','','r',Math.round(newRadius)); | |
| 287 | + | |
| 288 | + // 加载编辑页面 | |
| 289 | + $.get('edit.html', function(m){$(pjaxContainer).append(m);}); | |
| 290 | + | |
| 291 | + }); | |
| 292 | + | |
| 293 | + }); | |
| 294 | + | |
| 295 | + // 编辑多变行 | |
| 296 | + }else if(stationShapesTypeV =='d') { | |
| 297 | + | |
| 298 | + // 开启编辑功能(自 1.1 新增) | |
| 299 | + polygon.enableEditing(); | |
| 300 | + | |
| 301 | + // 添加多变行编辑事件 | |
| 302 | + polygon.addEventListener('dblclick',function(e) { | |
| 303 | + | |
| 304 | + // 获取编辑的多边形对象 | |
| 305 | + var edit_pointE = polygon; | |
| 306 | + | |
| 307 | + // 多边形坐标点集合 | |
| 308 | + var eidt_PointsList = []; | |
| 309 | + | |
| 310 | + for ( var i = 0; i < edit_pointE.getPath().length; i++) { | |
| 311 | + | |
| 312 | + eidt_PointsList.push({potion: {lng: edit_pointE.getPath()[i].lng, lat: edit_pointE.getPath()[i].lat}}); | |
| 313 | + | |
| 314 | + } | |
| 315 | + | |
| 316 | + eidt_PointsList.push({potion: {lng: edit_pointE.getPath()[0].lng, lat: edit_pointE.getPath()[0].lat}}); | |
| 317 | + | |
| 318 | + var edit_centre = [{potion:{lng:edit_pointE.getBounds().getCenter().lng,lat:edit_pointE.getBounds().getCenter().lat}}]; | |
| 319 | + | |
| 320 | + // 多边形中心点 | |
| 321 | + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | |
| 322 | + | |
| 323 | + // 多边形坐标点集合转WGS坐标 | |
| 324 | + PublicFunctions.getFormPointEToWGS(eidt_PointsList,function(resultdata) { | |
| 325 | + | |
| 326 | + // 多边形WGS坐标字符串 | |
| 327 | + var eidt_gPloygonGrid = ''; | |
| 328 | + | |
| 329 | + // 百度坐标字符串 | |
| 330 | + var edit_bPloygonGrid = ''; | |
| 331 | + | |
| 332 | + for(var k =0;k<resultdata.length;k++) { | |
| 333 | + | |
| 334 | + if(k==0) { | |
| 335 | + | |
| 336 | + eidt_gPloygonGrid = resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 337 | + | |
| 338 | + edit_bPloygonGrid = resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 339 | + | |
| 340 | + }else { | |
| 341 | + | |
| 342 | + eidt_gPloygonGrid = eidt_gPloygonGrid + ',' + resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 343 | + | |
| 344 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 345 | + | |
| 346 | + } | |
| 347 | + | |
| 348 | + } | |
| 349 | + | |
| 350 | + eidt_gPloygonGrid = 'POLYGON((' + eidt_gPloygonGrid + '))'; | |
| 351 | + | |
| 352 | + edit_bPloygonGrid = 'POLYGON((' + edit_bPloygonGrid + '))'; | |
| 353 | + | |
| 354 | + // 中心点坐标转WGS坐标 | |
| 355 | + PublicFunctions.getFormPointEToWGS(edit_centre,function(p) { | |
| 356 | + | |
| 357 | + var edit_gLonx = p[0].WGSpotion.Lng; | |
| 358 | + | |
| 359 | + var edit_gLaty = p[0].WGSpotion.Lat; | |
| 360 | + | |
| 361 | + // 设置编辑站点参宿集合 | |
| 362 | + PublicFunctions.editSeteditStationParmasValue(centre_points,edit_gLonx,edit_gLaty,edit_bPloygonGrid,eidt_gPloygonGrid,'d',''); | |
| 363 | + | |
| 364 | + // 加载编辑页面 | |
| 365 | + $.get('edit.html', function(m){$(pjaxContainer).append(m);}); | |
| 366 | + | |
| 367 | + }); | |
| 368 | + | |
| 369 | + }); | |
| 370 | + }); | |
| 371 | + | |
| 372 | + } | |
| 373 | + | |
| 374 | + }, | |
| 375 | + | |
| 376 | + // 原百度坐标转WGS坐标 | |
| 377 | + getFormPointEToWGS: function(points,callback) { | |
| 378 | + | |
| 379 | + // 获取长度 | |
| 380 | + var len = points.length; | |
| 381 | + | |
| 382 | + (function(){ | |
| 383 | + | |
| 384 | + if (!arguments.callee.count) { | |
| 385 | + | |
| 386 | + arguments.callee.count = 0; | |
| 387 | + | |
| 388 | + } | |
| 389 | + | |
| 390 | + arguments.callee.count++; | |
| 391 | + | |
| 392 | + var index = parseInt(arguments.callee.count) - 1; | |
| 393 | + | |
| 394 | + if (index >= len) { | |
| 395 | + | |
| 396 | + callback && callback(points); | |
| 397 | + | |
| 398 | + return; | |
| 399 | + } | |
| 400 | + | |
| 401 | + var f = arguments.callee; | |
| 402 | + | |
| 403 | + $.ajax({ | |
| 404 | + | |
| 405 | + url: 'http://api.zdoz.net/bd2wgs.aspx', | |
| 406 | + | |
| 407 | + data: {lat: points[index].potion.lat , lng: points[index].potion.lng}, | |
| 408 | + | |
| 409 | + dataType: 'jsonp', | |
| 410 | + | |
| 411 | + success: function(r){ | |
| 412 | + | |
| 413 | + if(r) { | |
| 414 | + | |
| 415 | + points[index].WGSpotion = r; | |
| 416 | + | |
| 417 | + } | |
| 418 | + | |
| 419 | + f(); | |
| 420 | + } | |
| 421 | + }); | |
| 422 | + | |
| 423 | + })(); | |
| 424 | + | |
| 425 | + }, | |
| 426 | + | |
| 427 | + editSeteditStationParmasValue : function(points,gLonx,gLaty,bPolygonGridValue,gPolygonGridVlaue,shapesTypeValue,radiusValue) { | |
| 428 | + | |
| 429 | + // 百度地图经纬度坐标中心点 | |
| 430 | + carParkObj[0].carParkBcenterPoint = points; | |
| 431 | + | |
| 432 | + // WGS经度 | |
| 433 | + carParkObj[0].carParkGcenterPoint = gLonx + ' ' + gLaty; | |
| 434 | + | |
| 435 | + // 百度坐标点图形集合 | |
| 436 | + carParkObj[0].carParkGparkPoint = gPolygonGridVlaue; | |
| 437 | + | |
| 438 | + // WGS坐标点图形集合 | |
| 439 | + carParkObj[0].carParkBparkPoint = bPolygonGridValue; | |
| 440 | + | |
| 441 | + // 图形类型 | |
| 442 | + carParkObj[0].carParkShapesType = shapesTypeValue; | |
| 443 | + | |
| 444 | + // 圆形半径 | |
| 445 | + carParkObj[0].carParkRadius = radiusValue; | |
| 446 | + | |
| 447 | + }, | |
| 448 | + | |
| 449 | + setFormValue : function() { | |
| 450 | + | |
| 451 | + $('#idInput').val(carParkObj[0].carParkId); | |
| 452 | + | |
| 453 | + $('#bParkPointInput').val(carParkObj[0].carParkBparkPoint); | |
| 454 | + | |
| 455 | + $('#gParkPointInput').val(carParkObj[0].carParkGparkPoint); | |
| 456 | + | |
| 457 | + $('#parkNameInput').val(carParkObj[0].carParkName); | |
| 458 | + | |
| 459 | + $('#parkCodeInput').val(carParkObj[0].carParkCode); | |
| 460 | + | |
| 461 | + $('#bCenterPointInput').val(carParkObj[0].carParkBcenterPoint); | |
| 462 | + | |
| 463 | + $('#gCenterPointInput').val(carParkObj[0].carParkGcenterPoint); | |
| 464 | + | |
| 465 | + $('#shapesTypeSelect').val(carParkObj[0].carParkShapesType); | |
| 466 | + | |
| 467 | + $('#radiusInput').val(carParkObj[0].carParkRadius); | |
| 468 | + | |
| 469 | + $('#areaInput').val(carParkObj[0].carParkArea); | |
| 470 | + | |
| 471 | + /*$('#companySelect').val(carParkObj[0].carParkCompany);*/ | |
| 472 | + | |
| 473 | + /*$('#brancheCompanySelect').val(carParkObj[0].carParkBrancheCompany);*/ | |
| 474 | + | |
| 475 | + $('#destroySelect').val(carParkObj[0].carParkDestroy); | |
| 476 | + | |
| 477 | + $('#descriptionsTextarea').val(carParkObj[0].carParkDescriptions); | |
| 478 | + | |
| 479 | + }, | |
| 480 | + | |
| 481 | + // 公司下拉框 | |
| 482 | + selectTemp : function(callback) { | |
| 483 | + | |
| 484 | + // 填充公司下拉框选择值 | |
| 485 | + $.get('/business/all', {upCode_eq: '88'}, function(array){ | |
| 486 | + | |
| 487 | + // 公司下拉options属性值 | |
| 488 | + var options = '<option value="">-- 请选择公司 --</option>'; | |
| 489 | + | |
| 490 | + // 遍历array | |
| 491 | + $.each(array, function(i,d){ | |
| 492 | + | |
| 493 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | |
| 494 | + | |
| 495 | + }); | |
| 496 | + | |
| 497 | + // 填充公司下拉框options | |
| 498 | + $('#companySelect').html(options); | |
| 499 | + | |
| 500 | + callback && callback(); | |
| 501 | + | |
| 502 | + }); | |
| 503 | + }, | |
| 504 | + | |
| 505 | + // 填充分公司下拉框选择值 | |
| 506 | + getbrancheCompanyValues : function(businessCode,cb){ | |
| 507 | + | |
| 508 | + // 分公司下拉框options属性值 | |
| 509 | + var options = '<option value="">-- 请选择分公司 --</option>'; | |
| 510 | + | |
| 511 | + if(businessCode) { | |
| 512 | + | |
| 513 | + $get('/business/all', {upCode_eq: businessCode}, function(brancheCompany){ | |
| 514 | + | |
| 515 | + // 遍历brancheCompany | |
| 516 | + $.each(brancheCompany, function(i,d){ | |
| 517 | + | |
| 518 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | |
| 519 | + | |
| 520 | + }); | |
| 521 | + | |
| 522 | + // 填充分公司下拉框options | |
| 523 | + $('#brancheCompanySelect').html(options); | |
| 524 | + | |
| 525 | + cb && cb(); | |
| 526 | + | |
| 527 | + }); | |
| 528 | + | |
| 529 | + } else { | |
| 530 | + | |
| 531 | + // 填充分公司下拉框options | |
| 532 | + $('#brancheCompanySelect').html(options); | |
| 533 | + | |
| 534 | + cb && cb(); | |
| 535 | + } | |
| 536 | + | |
| 537 | + }, | |
| 538 | + | |
| 539 | + carParkUpdate : function(params,callback){ | |
| 540 | + | |
| 541 | + $post('/carpark/carParkUpdate',params,function(data) { | |
| 542 | + | |
| 543 | + callback && callback(data); | |
| 544 | + | |
| 545 | + }); | |
| 546 | + | |
| 547 | + } | |
| 548 | + | |
| 549 | + } | |
| 550 | + | |
| 551 | + return PubFun ; | |
| 552 | + | |
| 553 | +}(); | |
| 0 | 554 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-map.js
0 → 100644
| 1 | +/** | |
| 2 | + * 百度地图 | |
| 3 | + * | |
| 4 | + */ | |
| 5 | + | |
| 6 | +var WorldsBMap = function () { | |
| 7 | + | |
| 8 | + var Bmap = { | |
| 9 | + | |
| 10 | + init : function() { | |
| 11 | + | |
| 12 | + // 关闭左侧栏 | |
| 13 | + if (!$('body').hasClass('page-sidebar-closed')) { | |
| 14 | + | |
| 15 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 16 | + | |
| 17 | + } | |
| 18 | + | |
| 19 | + // 设置中心点, | |
| 20 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | |
| 21 | + | |
| 22 | + // 百度API Key | |
| 23 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | |
| 24 | + | |
| 25 | + // 初始化百度地图 | |
| 26 | + var map = new BMap.Map("bmap_basic"); | |
| 27 | + | |
| 28 | + //中心点和缩放级别 | |
| 29 | + map.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | |
| 30 | + | |
| 31 | + //启用地图拖拽事件,默认启用(可不写) | |
| 32 | + map.enableDragging(); | |
| 33 | + | |
| 34 | + //启用地图滚轮放大缩小 | |
| 35 | + map.enableScrollWheelZoom(); | |
| 36 | + | |
| 37 | + //禁用鼠标双击放大 | |
| 38 | + map.disableDoubleClickZoom(); | |
| 39 | + | |
| 40 | + //启用键盘上下左右键移动地图 | |
| 41 | + map.enableKeyboard(); | |
| 42 | + | |
| 43 | + var styleOptions = { | |
| 44 | + | |
| 45 | + //边线颜色。 | |
| 46 | + strokeColor : "blue", | |
| 47 | + | |
| 48 | + //填充颜色。当参数为空时,圆形将没有填充效果。 | |
| 49 | + fillColor : "blue", | |
| 50 | + | |
| 51 | + //边线的宽度,以像素为单位。 | |
| 52 | + strokeWeight : 3, | |
| 53 | + | |
| 54 | + //边线透明度,取值范围0 - 1。 | |
| 55 | + strokeOpacity : 0.8, | |
| 56 | + | |
| 57 | + //填充的透明度,取值范围0 - 1。 | |
| 58 | + fillOpacity : 0.6, | |
| 59 | + | |
| 60 | + //边线的样式,solid或dashed。 | |
| 61 | + strokeStyle : 'solid' | |
| 62 | + | |
| 63 | + }; | |
| 64 | + | |
| 65 | + // 创建鼠标绘制管理类 | |
| 66 | + drawingManager = new BMapLib.DrawingManager(map, { | |
| 67 | + | |
| 68 | + //是否开启绘制模式 | |
| 69 | + isOpen : false, | |
| 70 | + | |
| 71 | + //是否显示工具栏 | |
| 72 | + enableDrawingTool : false, | |
| 73 | + | |
| 74 | + drawingToolOptions : { | |
| 75 | + | |
| 76 | + //位置 | |
| 77 | + anchor : BMAP_ANCHOR_TOP_RIGHT, | |
| 78 | + | |
| 79 | + //偏离值 | |
| 80 | + offset : new BMap.Size(5, 5), | |
| 81 | + | |
| 82 | + //工具栏缩放比例 | |
| 83 | + scale : 0.8 | |
| 84 | + | |
| 85 | + }, | |
| 86 | + | |
| 87 | + //线的样式 | |
| 88 | + polygonOptions : styleOptions | |
| 89 | + | |
| 90 | + }); | |
| 91 | + | |
| 92 | + // 添加绘画完成事件 | |
| 93 | + drawingManager.addEventListener('polygoncomplete', function(e) { | |
| 94 | + | |
| 95 | + drawingManager.close(); | |
| 96 | + | |
| 97 | + if (e.getPath().length <= 2) { | |
| 98 | + | |
| 99 | + // 弹出提示消息 | |
| 100 | + layer.msg('坐标点不能小于等于两个...'); | |
| 101 | + | |
| 102 | + // 清除地图覆盖物 | |
| 103 | + map.clearOverlays(); | |
| 104 | + | |
| 105 | + // 加载该线路下所有站点位置添加到地图上 | |
| 106 | + return false; | |
| 107 | + | |
| 108 | + }else { | |
| 109 | + | |
| 110 | + var pointE = e; | |
| 111 | + | |
| 112 | + // 多变行质心点 | |
| 113 | + var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; | |
| 114 | + | |
| 115 | + var PointsList = []; | |
| 116 | + | |
| 117 | + for ( var i = 0; i < pointE.getPath().length; i++) { | |
| 118 | + | |
| 119 | + PointsList.push({potion: {lng: pointE.getPath()[i].lng, lat: pointE.getPath()[i].lat}}); | |
| 120 | + | |
| 121 | + } | |
| 122 | + | |
| 123 | + PointsList.push({potion: {lng: pointE.getPath()[0].lng, lat: pointE.getPath()[0].lat}}); | |
| 124 | + | |
| 125 | + var centre = [{potion:{lng:pointE.getBounds().getCenter().lng,lat:pointE.getBounds().getCenter().lat}}]; | |
| 126 | + | |
| 127 | + PublicFunctions.getFormPointEToWGS(PointsList,function(resultdata) { | |
| 128 | + | |
| 129 | + var gPloygonGrid = ''; | |
| 130 | + | |
| 131 | + var bPloygonGrid = ''; | |
| 132 | + | |
| 133 | + for(var k =0;k<resultdata.length;k++) { | |
| 134 | + | |
| 135 | + if(k==0) { | |
| 136 | + | |
| 137 | + gPloygonGrid = resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 138 | + | |
| 139 | + bPloygonGrid = resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 140 | + | |
| 141 | + }else { | |
| 142 | + | |
| 143 | + gPloygonGrid = gPloygonGrid + ',' + resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 144 | + | |
| 145 | + bPloygonGrid = bPloygonGrid + ',' + resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 146 | + | |
| 147 | + } | |
| 148 | + | |
| 149 | + } | |
| 150 | + | |
| 151 | + gPloygonGrid = 'POLYGON((' + gPloygonGrid + '))'; | |
| 152 | + | |
| 153 | + bPloygonGrid = 'POLYGON((' + bPloygonGrid + '))'; | |
| 154 | + | |
| 155 | + PublicFunctions.getFormPointEToWGS(centre,function(p) { | |
| 156 | + | |
| 157 | + var gLonx = p[0].WGSpotion.Lng; | |
| 158 | + | |
| 159 | + var gLaty = p[0].WGSpotion.Lat; | |
| 160 | + | |
| 161 | + PublicFunctions.editSeteditStationParmasValue(addSttationPoints_,gLonx,gLaty,bPloygonGrid,gPloygonGrid,'d',''); | |
| 162 | + | |
| 163 | + $.get('edit.html', function(m){$(pjaxContainer).append(m);}); | |
| 164 | + | |
| 165 | + }); | |
| 166 | + | |
| 167 | + }); | |
| 168 | + | |
| 169 | + } | |
| 170 | + | |
| 171 | + }); | |
| 172 | + return map; | |
| 173 | + }, | |
| 174 | + | |
| 175 | +localSearchFromAdreesToPoint: function(Address,map,callback) { | |
| 176 | + | |
| 177 | + // 创建一个搜索类实例 | |
| 178 | + var localSearch = new BMap.LocalSearch(map); | |
| 179 | + | |
| 180 | + // 检索完成后的回调函数。 | |
| 181 | + localSearch.setSearchCompleteCallback(function (searchResult) { | |
| 182 | + | |
| 183 | + var resultPoints = ''; | |
| 184 | + | |
| 185 | + if(searchResult) { | |
| 186 | + | |
| 187 | + // 返回索引指定的结果。索引0表示第1条结果 | |
| 188 | + var poi = searchResult.getPoi(0); | |
| 189 | + | |
| 190 | + if(poi) { | |
| 191 | + | |
| 192 | + //获取经度和纬度 | |
| 193 | + resultPoints = poi.point.lng + ' ' + poi.point.lat; | |
| 194 | + | |
| 195 | + callback && callback(resultPoints); | |
| 196 | + | |
| 197 | + }else { | |
| 198 | + | |
| 199 | + callback && callback(false); | |
| 200 | + | |
| 201 | + } | |
| 202 | + | |
| 203 | + }else { | |
| 204 | + | |
| 205 | + callback && callback(false); | |
| 206 | + } | |
| 207 | + | |
| 208 | + }); | |
| 209 | + | |
| 210 | + // 根据检索词发起检索。 | |
| 211 | + localSearch.search(Address); | |
| 212 | + | |
| 213 | + } | |
| 214 | + } | |
| 215 | + | |
| 216 | + return Bmap; | |
| 217 | + | |
| 218 | +}(); | |
| 0 | 219 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-reload.js
0 → 100644
| 1 | +/** | |
| 2 | + * | |
| 3 | + * @JSName : list.js(停车场定位positions.html页面js) | |
| 4 | + * | |
| 5 | + * @Author : bsth@lq | |
| 6 | + * | |
| 7 | + * @Description : TODO(停车场定位positions.html页面js) | |
| 8 | + * | |
| 9 | + * @Data : 2016年4月28日 上午9:21:17 | |
| 10 | + * | |
| 11 | + * @Version 公交调度系统BS版 0.1 | |
| 12 | + * | |
| 13 | + */ | |
| 14 | + | |
| 15 | +(function(){ | |
| 16 | + | |
| 17 | + // 获取参数线路ID | |
| 18 | + id = $.url().param('no'); | |
| 19 | + | |
| 20 | + // 等候500毫秒执行 | |
| 21 | + setTimeout(function(){ | |
| 22 | + | |
| 23 | + // 地图初始化 | |
| 24 | + mapB = WorldsBMap.init(); | |
| 25 | + | |
| 26 | + // 初始化停车场信息 | |
| 27 | + PublicFunctions.initCarPark(); | |
| 28 | + | |
| 29 | + },200); | |
| 30 | + | |
| 31 | +})(); | |
| 0 | 32 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/list.html
0 → 100644
| 1 | +<div class="page-head"> | |
| 2 | + <div class="page-title"> | |
| 3 | + <h1>停车场信息</h1> | |
| 4 | + </div> | |
| 5 | +</div> | |
| 6 | + | |
| 7 | +<ul class="page-breadcrumb breadcrumb"> | |
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 9 | + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | |
| 10 | + <li><span class="active">停车场信息</span></li> | |
| 11 | +</ul> | |
| 12 | + | |
| 13 | +<div class="row"> | |
| 14 | + <div class="col-md-12"> | |
| 15 | + <div class="portlet light porttlet-fit bordered"> | |
| 16 | + <div class="portlet-title"> | |
| 17 | + <div class="caption"> | |
| 18 | + <i class="fa fa-info-circle font-dark"></i> | |
| 19 | + <span class="caption-subject font-dark sbold uppercase">停车场信息</span> | |
| 20 | + </div> | |
| 21 | + <div class="actions"> | |
| 22 | + <div class="btn-group btn-group-devided" data-toggle="buttons"> | |
| 23 | + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加停车场</a> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + </div> | |
| 27 | + <div class="portlet-body"> | |
| 28 | + <div class="table-container" style="margin-top: 10px"> | |
| 29 | + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_carpark"> | |
| 30 | + <thead> | |
| 31 | + <tr role="row" class="heading"> | |
| 32 | + <th width="3%">序号</th> | |
| 33 | + <th width="8%">停车场名称</th> | |
| 34 | + <th width="8%">停车场编号</th> | |
| 35 | + <th width="8%">地理位置</th> | |
| 36 | + <th width="8%">面积</th> | |
| 37 | + <th width="8%">分公司</th> | |
| 38 | + <th width="8%">所属公司</th> | |
| 39 | + <th width="8%">版本号</th> | |
| 40 | + <th width="8%">是否撤销</th> | |
| 41 | + <th width="12%">操作</th> | |
| 42 | + </tr> | |
| 43 | + <tr role="row" class="filter"> | |
| 44 | + <td>#</td> | |
| 45 | + <td> | |
| 46 | + <input type="text" class="form-control form-filter input-sm" name="parkCode_eq"> | |
| 47 | + </td> | |
| 48 | + <td> | |
| 49 | + <input type="text" class="form-control form-filter input-sm" name="parkName_like"> | |
| 50 | + </td> | |
| 51 | + <td> | |
| 52 | + <input type="text" class="form-control form-filter input-sm" name="gCenterPoint_like"> | |
| 53 | + </td> | |
| 54 | + <td> | |
| 55 | + <input type="text" class="form-control form-filter input-sm" name="area_eq"> | |
| 56 | + </td> | |
| 57 | + <td> | |
| 58 | + <input type="text" class="form-control form-filter input-sm" name="brancheCompany_eq"> | |
| 59 | + </td> | |
| 60 | + <td> | |
| 61 | + <input type="text" class="form-control form-filter input-sm" name="company_eq"> | |
| 62 | + </td> | |
| 63 | + <td> | |
| 64 | + <input type="text" class="form-control form-filter input-sm" name="versions_eq"> | |
| 65 | + </td> | |
| 66 | + <td> | |
| 67 | + <select class="form-control form-filter " name="destroy_eq"> | |
| 68 | + <option value="">请选择...</option> | |
| 69 | + <option value="0">运营</option> | |
| 70 | + <option value="1">撤销</option> | |
| 71 | + </select> | |
| 72 | + </td> | |
| 73 | + <td> | |
| 74 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | |
| 75 | + <i class="fa fa-search"></i> 搜索 | |
| 76 | + </button> | |
| 77 | + | |
| 78 | + <button class="btn btn-sm red btn-outline filter-cancel"> | |
| 79 | + <i class="fa fa-times"></i> 重置 | |
| 80 | + </button> | |
| 81 | + </td> | |
| 82 | + </tr> | |
| 83 | + </thead> | |
| 84 | + <tbody></tbody> | |
| 85 | + </table> | |
| 86 | + <div style="text-align: right;"> | |
| 87 | + <ul id="pagination" class="pagination"></ul> | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + </div> | |
| 91 | + </div> | |
| 92 | + </div> | |
| 93 | +</div> | |
| 94 | +<script type="text/html" id="carpark_list_table_temp"> | |
| 95 | + {{each list as obj i }} | |
| 96 | + <tr> | |
| 97 | + <td style="vertical-align: middle;"> | |
| 98 | + {{(list.page*10)+(i+1)}} | |
| 99 | + </td> | |
| 100 | + <td> | |
| 101 | + {{obj.parkName}} | |
| 102 | + </td> | |
| 103 | + <td> | |
| 104 | + {{obj.parkCode}} | |
| 105 | + </td> | |
| 106 | + <td> | |
| 107 | + {{obj.bCenterPoint}} | |
| 108 | + </td> | |
| 109 | + <td> | |
| 110 | + {{obj.area}} | |
| 111 | + </td> | |
| 112 | + <td> | |
| 113 | + {{obj.brancheCompany}} | |
| 114 | + </td> | |
| 115 | + <td> | |
| 116 | + {{obj.company}} | |
| 117 | + </td> | |
| 118 | + <td> | |
| 119 | + {{obj.versions}} | |
| 120 | + </td> | |
| 121 | + <td> | |
| 122 | + {{obj.destroy}} | |
| 123 | + </td> | |
| 124 | + <td> | |
| 125 | + <a href="positions.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 定位 </a> | |
| 126 | + </td> | |
| 127 | + </tr> | |
| 128 | + {{/each}} | |
| 129 | + {{if list.length == 0}} | |
| 130 | + <tr> | |
| 131 | + <td colspan=10><h6 class="muted">没有找到相关数据</h6></td> | |
| 132 | + </tr> | |
| 133 | + {{/if}} | |
| 134 | +</script> | |
| 135 | +<script src="/pages/base/carpark/js/carpark-list-table.js"></script> | |
| 0 | 136 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/positions.html
0 → 100644
| 1 | +<link href="/pages/base/carpark/css/positions.css" rel="stylesheet" type="text/css" /> | |
| 2 | + | |
| 3 | +<!-- 地图容器--> | |
| 4 | +<div id="bmap_basic"></div> | |
| 5 | + | |
| 6 | +<!-- 操作工具容器 --> | |
| 7 | +<div class="leftUtils"> | |
| 8 | + <div class="btn-group" style="left: 100px;"> | |
| 9 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具 | |
| 10 | + <i class="fa fa-angle-down"></i> | |
| 11 | + </a> | |
| 12 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | |
| 13 | + <li> | |
| 14 | + <a href="javascript:;" id="edit"><i class="fa fa-pencil"></i> 修改 </a> | |
| 15 | + </li> | |
| 16 | + <li> | |
| 17 | + <a href="javascript:;" id = "backUp"> <i class="fa fa-reply"></i> 返回 </a> | |
| 18 | + </li> | |
| 19 | + | |
| 20 | + </ul> | |
| 21 | + </div> | |
| 22 | +</div> | |
| 23 | +<script type="text/javascript"> | |
| 24 | + | |
| 25 | + /** carParkObj:停车场对象;drawingManager:绘制工具对象;mapB地图对象;circle:圆对象; polygon:多边形对象;marker:覆盖物对象;信息窗口对象:infoWindow;id:停车场ID*/ | |
| 26 | + var carParkObj = '',drawingManager= '',mapB = '',circle = '',polygon='', polygon = '',marker = '',infoWindow = '',id=''; | |
| 27 | + | |
| 28 | +</script> | |
| 29 | + | |
| 30 | +<!-- 地图JS类库 --> | |
| 31 | +<script src="/pages/base/carpark/js/carpark-positions-map.js"></script> | |
| 32 | + | |
| 33 | +<!-- 方法JS类库 --> | |
| 34 | +<script src="/pages/base/carpark/js/carpark-positions-function.js"></script> | |
| 35 | + | |
| 36 | +<!-- reloadJS类库 --> | |
| 37 | +<script src="/pages/base/carpark/js/carpark-positions-reload.js"></script> | |
| 38 | + | |
| 39 | +<!-- 事件JS类库 --> | |
| 40 | +<script src="/pages/base/carpark/js/carpark-positions-events.js"></script> | |
| 0 | 41 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/section/add.html
0 → 100644
| 1 | +<link href="/pages/base/station/css/addmap.css" rel="stylesheet" type="text/css" /> | |
| 2 | +<div class="page-head"> | |
| 3 | + <div class="page-title"> | |
| 4 | + <h1>添加路段</h1> | |
| 5 | + </div> | |
| 6 | +</div> | |
| 7 | + | |
| 8 | +<ul class="page-breadcrumb breadcrumb"> | |
| 9 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 10 | + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | |
| 11 | + <li><a href="/pages/base/section/list.html" data-pjax>路段信息</a> <i class="fa fa-circle"></i></li> | |
| 12 | + <li><span class="active">添加路段</span></li> | |
| 13 | +</ul> | |
| 14 | + | |
| 15 | +<div class="portlet light bordered" id="form-wizard-info"> | |
| 16 | + <div class="portlet-title"> | |
| 17 | + <div class="caption"> | |
| 18 | + <i class="icon-equalizer font-red-sunglo"></i> | |
| 19 | + <span class="caption-subject font-red-sunglo bold uppercase">添加路段 | |
| 20 | + <span class="step-title"> 1 - 4 </span> | |
| 21 | + </span> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + <div class="portlet-body form"> | |
| 25 | + <!-- START FORM --> | |
| 26 | + <form class="form-horizontal" id="submit_section_form" action="/" method="POST" novalidate="novalidate"> | |
| 27 | + <div class="form-wizard"> | |
| 28 | + <div class="form-body"> | |
| 29 | + <ul class="nav nav-pills nav-justified steps"> | |
| 30 | + <li class="active"> | |
| 31 | + <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true"> | |
| 32 | + <span class="number"> 1 </span> | |
| 33 | + <span class="desc"> | |
| 34 | + <i class="fa fa-check"></i> 选择添加路段方式 </span> | |
| 35 | + </a> | |
| 36 | + </li> | |
| 37 | + <li> | |
| 38 | + <a href="#tab2" data-toggle="tab" class="step"> | |
| 39 | + <span class="number"> 2 </span> | |
| 40 | + <span class="desc"> | |
| 41 | + <i class="fa fa-check"></i> 路段位置 </span> | |
| 42 | + </a> | |
| 43 | + </li> | |
| 44 | + <li> | |
| 45 | + <a href="#tab3" data-toggle="tab" class="step active"> | |
| 46 | + <span class="number"> 3 </span> | |
| 47 | + <span class="desc"> | |
| 48 | + <i class="fa fa-check"></i> 路段信息 </span> | |
| 49 | + </a> | |
| 50 | + </li> | |
| 51 | + <li> | |
| 52 | + <a href="#tab4" data-toggle="tab" class="step"> | |
| 53 | + <span class="number"> 4 </span> | |
| 54 | + <span class="desc"> | |
| 55 | + <i class="fa fa-check"></i> 确认 </span> | |
| 56 | + </a> | |
| 57 | + </li> | |
| 58 | + </ul> | |
| 59 | + | |
| 60 | + <!-- 进度条 --> | |
| 61 | + <div id="bar" class="progress progress-striped" role="progressbar"> | |
| 62 | + <div class="progress-bar progress-bar-success" style="width: 25%;"></div> | |
| 63 | + </div> | |
| 64 | + | |
| 65 | + <div class="tab-content"> | |
| 66 | + <div class="alert alert-danger display-hide"> | |
| 67 | + <button class="close" data-close="alert"></button> | |
| 68 | + 您的输入有误,请检查下面的输入项 | |
| 69 | + </div> | |
| 70 | + <div class="alert alert-success display-none"> | |
| 71 | + <button class="close" data-dismiss="alert"></button> | |
| 72 | + Your form validation is successful! | |
| 73 | + </div> | |
| 74 | + | |
| 75 | + <!-- 选择添加站点方式 --> | |
| 76 | + <div class="tab-pane active" id="tab1"> | |
| 77 | + | |
| 78 | + <h3 class="block"> 选择添加路段方式 </h3> | |
| 79 | + | |
| 80 | + <!-- 站点名称 --> | |
| 81 | + <div class="form-group" id="formRequ"> | |
| 82 | + <label class="col-md-3 control-label"><span class="required"> * </span>路段起点名称:</label> | |
| 83 | + <div class="col-md-9"> | |
| 84 | + <input type="text" class="form-control input-medium" id="stationStartInput" name="stationStart"> | |
| 85 | + </div> | |
| 86 | + </div> | |
| 87 | + | |
| 88 | + <!-- 站点名称 --> | |
| 89 | + <div class="form-group" id="formRequ"> | |
| 90 | + <label class="col-md-3 control-label"><span class="required"> * </span>路段终点名称:</label> | |
| 91 | + <div class="col-md-9"> | |
| 92 | + <input type="text" class="form-control input-medium" id="stationEndInput" name="stationEnd"> | |
| 93 | + </div> | |
| 94 | + </div> | |
| 95 | + | |
| 96 | + <!-- 新增方式 --> | |
| 97 | + <div class="form-group"> | |
| 98 | + <label class="col-md-3 control-label">新增方式:</label> | |
| 99 | + <div class="col-md-9"> | |
| 100 | + <div class="icheck-list"> | |
| 101 | + <label> | |
| 102 | + <input type="radio" class="icheck" name="baseRes" value=0 checked> 系统生成 | |
| 103 | + </label> | |
| 104 | + <label > | |
| 105 | + <input type="radio" class="icheck" name="baseRes" value=1 > 手动添加 | |
| 106 | + </label> | |
| 107 | + <label> | |
| 108 | + <input type="radio" class="icheck" name="baseRes" value=2> 系统引用 | |
| 109 | + </label> | |
| 110 | + </div> | |
| 111 | + </div> | |
| 112 | + </div> | |
| 113 | + | |
| 114 | + <div class="form-group"> | |
| 115 | + <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50"> | |
| 116 | + <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 新增方式说明: </span></h5> | |
| 117 | + <p><span class="help-block" style="color:#1bbc9b;"> a)系统生成:根据路段的起点和终点名称自动生成一条折线走向.</span> </p> | |
| 118 | + <p><span class="help-block" style="color:#1bbc9b;"> b)手动添加:手动在地图上画出路段,然后双击鼠标右键保存.</span> </p> | |
| 119 | + <p><span class="help-block" style="color:#1bbc9b;"> c)选择引用:从系统中选择已有的路段进行引用.</span> </p> | |
| 120 | + </div> | |
| 121 | + </div> | |
| 122 | + | |
| 123 | + </div> | |
| 124 | + | |
| 125 | + <!-- 站点位置 --> | |
| 126 | + <div class="tab-pane" id="tab2"> | |
| 127 | + <h3 class="block"> 路段位置 </h3> | |
| 128 | + <div id="bmap_basic"></div> | |
| 129 | + </div> | |
| 130 | + | |
| 131 | + <!-- 站点信息 --> | |
| 132 | + <div class="tab-pane" id="tab3"> | |
| 133 | + <h3 class="block"> 站点信息 </h3> | |
| 134 | + | |
| 135 | + <input type="hidden" name="bsectionVector" id="bsectionVectorInput" /> | |
| 136 | + | |
| 137 | + <input type="hidden" name="gsectionVector" id="gsectionVectorInput" /> | |
| 138 | + | |
| 139 | + <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | |
| 140 | + | |
| 141 | + <input type="hidden" name="lineId" id="lineIdInput" value=""/> | |
| 142 | + | |
| 143 | + <!-- 线路名称 --> | |
| 144 | + <div class="form-body"> | |
| 145 | + <div class="form-group"> | |
| 146 | + <label class="control-label col-md-3"> | |
| 147 | + <span class="required"> * </span> 线路名称 : | |
| 148 | + </label> | |
| 149 | + <div class="col-md-6"> | |
| 150 | + <select name="line" class="form-control" style="width:100%" id="lineSelect"></select> | |
| 151 | + </div> | |
| 152 | + </div> | |
| 153 | + </div> | |
| 154 | + | |
| 155 | + <!-- 线路编码 --> | |
| 156 | + <div class="form-body"> | |
| 157 | + <div class="form-group"> | |
| 158 | + <label class="control-label col-md-3"> | |
| 159 | + <span class="required"> * </span>线路编码: | |
| 160 | + </label> | |
| 161 | + <div class="col-md-6"> | |
| 162 | + <input type="text" class="form-control" name="lineCode" id="lineCodeInput"> | |
| 163 | + </div> | |
| 164 | + </div> | |
| 165 | + </div> | |
| 166 | + | |
| 167 | + <!-- 站点名称 --> | |
| 168 | + <div class="form-body"> | |
| 169 | + <div class="form-group"> | |
| 170 | + <label class="control-label col-md-3"> | |
| 171 | + <span class="required"> * </span> 路段名称: | |
| 172 | + </label> | |
| 173 | + <div class="col-md-6"> | |
| 174 | + <input type="text" class="form-control" name="sectionName" id="sectionNameInput" placeholder="站点名称"> | |
| 175 | + </div> | |
| 176 | + </div> | |
| 177 | + </div> | |
| 178 | + | |
| 179 | + <!-- 站点编码 --> | |
| 180 | + <div class="form-body"> | |
| 181 | + <div class="form-group"> | |
| 182 | + <label class="control-label col-md-3"> | |
| 183 | + <span class="required"> * </span> 路段编码: | |
| 184 | + </label> | |
| 185 | + <div class="col-md-6"> | |
| 186 | + <input type="text" class="form-control" name="sectionCode" id="sectionCodeInput"> | |
| 187 | + </div> | |
| 188 | + </div> | |
| 189 | + </div> | |
| 190 | + | |
| 191 | + <!-- 道路编码--> | |
| 192 | + <div class="form-body"> | |
| 193 | + <div class="form-group"> | |
| 194 | + <label class="control-label col-md-3">道路编码:</label> | |
| 195 | + <div class="col-md-6"> | |
| 196 | + <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput"> | |
| 197 | + </div> | |
| 198 | + </div> | |
| 199 | + </div> | |
| 200 | + | |
| 201 | + <!-- 站点序号 --> | |
| 202 | + <div class="form-body"> | |
| 203 | + <div class="form-group"> | |
| 204 | + <label class="control-label col-md-3"> | |
| 205 | + <span class="required"> * </span>上一路段: | |
| 206 | + </label> | |
| 207 | + <div class="col-md-6"> | |
| 208 | + <select name="sectionrouteCode" style="width:100%" class="form-control" id="sectionrouteCodeSelect"></select> | |
| 209 | + <span class="help-block"> *说明:选择的路段将作为路段序号的参考,成为选择路段的下一个路段。 </span> | |
| 210 | + </div> | |
| 211 | + </div> | |
| 212 | + </div> | |
| 213 | + | |
| 214 | + <!-- 站点方向 --> | |
| 215 | + <div class="form-body"> | |
| 216 | + <div class="form-group"> | |
| 217 | + <label class="control-label col-md-3"> | |
| 218 | + <span class="required"> * </span>路段方向: | |
| 219 | + </label> | |
| 220 | + <div class="col-md-6"> | |
| 221 | + <select name="directions" class="form-control" id="stationdirSelect"> | |
| 222 | + <option value="">-- 请选择站点类型 --</option> | |
| 223 | + <option value="0">上行</option> | |
| 224 | + <option value="1">下行</option> | |
| 225 | + </select> | |
| 226 | + </div> | |
| 227 | + </div> | |
| 228 | + </div> | |
| 229 | + | |
| 230 | + <!-- 路段时长 --> | |
| 231 | + <div class="form-body"> | |
| 232 | + <div class="form-group"> | |
| 233 | + <label class="col-md-3 control-label">路段时长:</label> | |
| 234 | + <div class="col-md-6"> | |
| 235 | + <input type="text" class="form-control" name="sectionTime" id="sectionTimeInput" > | |
| 236 | + <span class="help-block">单位:分钟</span> | |
| 237 | + </div> | |
| 238 | + </div> | |
| 239 | + </div> | |
| 240 | + | |
| 241 | + <!-- 路段距离 --> | |
| 242 | + <div class="form-body"> | |
| 243 | + <div class="form-group"> | |
| 244 | + <label class="col-md-3 control-label">路段距离:</label> | |
| 245 | + <div class="col-md-6"> | |
| 246 | + <input type="text" class="form-control" name="sectionDistance" id="sectionDistanceInput" > | |
| 247 | + <span class="help-block">单位:公里</span> | |
| 248 | + </div> | |
| 249 | + </div> | |
| 250 | + </div> | |
| 251 | + | |
| 252 | + <!-- 限速 --> | |
| 253 | + <div class="form-body"> | |
| 254 | + <div class="form-group"> | |
| 255 | + <label class="control-label col-md-3">路段限速:</label> | |
| 256 | + <div class="col-md-6"> | |
| 257 | + <input type="text" class="form-control" name="speedLimit" id="speedLimitInput"> | |
| 258 | + <span class="help-block">单位: 千米/小时</span> | |
| 259 | + </div> | |
| 260 | + </div> | |
| 261 | + </div> | |
| 262 | + | |
| 263 | + <!-- 版本号 --> | |
| 264 | + <div class="form-body"> | |
| 265 | + <div class="form-group"> | |
| 266 | + <label class="col-md-3 control-label">版本号:</label> | |
| 267 | + <div class="col-md-6"> | |
| 268 | + <input type="text" class="form-control" name="versions" value='1' Readonly> | |
| 269 | + </div> | |
| 270 | + </div> | |
| 271 | + </div> | |
| 272 | + | |
| 273 | + <!-- 范围图形类型 --> | |
| 274 | + <div class="form-body"> | |
| 275 | + <div class="form-group"> | |
| 276 | + <label class="col-md-3 control-label">是否撤销:</label> | |
| 277 | + <div class="col-md-6"> | |
| 278 | + <select name="destroy" class="form-control" id="destroySelect"> | |
| 279 | + <option value="">-- 请选择撤销类型 --</option> | |
| 280 | + <option value="0">否</option> | |
| 281 | + <option value="1">是</option> | |
| 282 | + </select> | |
| 283 | + </div> | |
| 284 | + </div> | |
| 285 | + </div> | |
| 286 | + | |
| 287 | + <!-- 描述/说明 --> | |
| 288 | + <div class="form-group"> | |
| 289 | + <label class="control-label col-md-3"> 描述/说明: </label> | |
| 290 | + <div class="col-md-6"> | |
| 291 | + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | |
| 292 | + </div> | |
| 293 | + </div> | |
| 294 | + | |
| 295 | + </div> | |
| 296 | + | |
| 297 | + <!-- 确定提交资料信息 --> | |
| 298 | + <div class="tab-pane" id="tab4"> | |
| 299 | + <h3 class="block"> 确认您提交的站点信息 </h3> | |
| 300 | + | |
| 301 | + <h4 class="form-section"> 路段信息 </h4> | |
| 302 | + | |
| 303 | + <div class="form-group"> | |
| 304 | + <label class="control-label col-md-3">线路名称:</label> | |
| 305 | + <div class="col-md-4"> | |
| 306 | + <p class="form-control-static" data-display="line"> </p> | |
| 307 | + </div> | |
| 308 | + </div> | |
| 309 | + | |
| 310 | + <div class="form-group"> | |
| 311 | + <label class="control-label col-md-3">线路编码:</label> | |
| 312 | + <div class="col-md-4"> | |
| 313 | + <p class="form-control-static" data-display="lineCode"> </p> | |
| 314 | + </div> | |
| 315 | + </div> | |
| 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="stationName"> </p> | |
| 321 | + </div> | |
| 322 | + </div> | |
| 323 | + | |
| 324 | + <div class="form-group"> | |
| 325 | + <label class="control-label col-md-3">路段编码:</label> | |
| 326 | + <div class="col-md-4"> | |
| 327 | + <p class="form-control-static" data-display="stationCod"> </p> | |
| 328 | + </div> | |
| 329 | + </div> | |
| 330 | + | |
| 331 | + <div class="form-group"> | |
| 332 | + <label class="control-label col-md-3">上一路段:</label> | |
| 333 | + <div class="col-md-4"> | |
| 334 | + <p class="form-control-static" data-display="stationRouteCode"> </p> | |
| 335 | + </div> | |
| 336 | + </div> | |
| 337 | + | |
| 338 | + <div class="form-group"> | |
| 339 | + <label class="control-label col-md-3">路段方向:</label> | |
| 340 | + <div class="col-md-4"> | |
| 341 | + <p class="form-control-static" data-display="directions"> </p> | |
| 342 | + </div> | |
| 343 | + </div> | |
| 344 | + | |
| 345 | + <div class="form-group"> | |
| 346 | + <label class="control-label col-md-3">道路编码:</label> | |
| 347 | + <div class="col-md-4"> | |
| 348 | + <p class="form-control-static" data-display="roadCoding"> </p> | |
| 349 | + </div> | |
| 350 | + </div> | |
| 351 | + | |
| 352 | + <div class="form-group"> | |
| 353 | + <label class="control-label col-md-3">路段时长:</label> | |
| 354 | + <div class="col-md-4"> | |
| 355 | + <p class="form-control-static" data-display="toTime"> </p> | |
| 356 | + </div> | |
| 357 | + </div> | |
| 358 | + | |
| 359 | + <div class="form-group"> | |
| 360 | + <label class="control-label col-md-3">路段长度:</label> | |
| 361 | + <div class="col-md-4"> | |
| 362 | + <p class="form-control-static" data-display="distances"> </p> | |
| 363 | + </div> | |
| 364 | + </div> | |
| 365 | + | |
| 366 | + <div class="form-group"> | |
| 367 | + <label class="control-label col-md-3">版本号:</label> | |
| 368 | + <div class="col-md-4"> | |
| 369 | + <p class="form-control-static" data-display="versions"> </p> | |
| 370 | + </div> | |
| 371 | + </div> | |
| 372 | + | |
| 373 | + <div class="form-group"> | |
| 374 | + <label class="control-label col-md-3">是否撤销:</label> | |
| 375 | + <div class="col-md-4"> | |
| 376 | + <p class="form-control-static" data-display="destroy"> </p> | |
| 377 | + </div> | |
| 378 | + </div> | |
| 379 | + | |
| 380 | + <div class="form-group"> | |
| 381 | + <label class="control-label col-md-3">描述/说明:</label> | |
| 382 | + <div class="col-md-4"> | |
| 383 | + <p class="form-control-static" data-display="descriptions"> </p> | |
| 384 | + </div> | |
| 385 | + </div> | |
| 386 | + | |
| 387 | + </div> | |
| 388 | + </div> | |
| 389 | + </div> | |
| 390 | + <div class="form-actions"> | |
| 391 | + <div class="row"> | |
| 392 | + <div class="col-md-offset-3 col-md-9"> | |
| 393 | + <a href="javascript:;" class="btn default button-previous disabled" style="display: none;"> | |
| 394 | + <i class="fa fa-angle-left"></i> 返回 </a> | |
| 395 | + <a href="javascript:;" class="btn btn-outline green button-next"> 下一步 | |
| 396 | + <i class="fa fa-angle-right"></i> | |
| 397 | + </a> | |
| 398 | + <a href="javascript:;" class="btn green button-submit" style="display: none;"> 提交 | |
| 399 | + <i class="fa fa-check"></i> | |
| 400 | + </a> | |
| 401 | + </div> | |
| 402 | + </div> | |
| 403 | + </div> | |
| 404 | + </div> | |
| 405 | + </form> | |
| 406 | + <!-- END FORM--> | |
| 407 | + </div> | |
| 408 | +</div> | |
| 409 | +<script src="/pages/base/section/js/add-form-wizard.js"></script> | |
| 410 | +<script src="/pages/base/section/js/add-vmap-world.js"></script> | |
| 411 | +<script type="text/javascript"> | |
| 412 | + | |
| 413 | + var mapB = ''; | |
| 414 | + | |
| 415 | + var drawingManager = ''; | |
| 416 | + | |
| 417 | + // 定义表单 | |
| 418 | + var form = $('#submit_section_form'); | |
| 419 | + | |
| 420 | + // 定义表单异常 | |
| 421 | + var error = $('.alert-danger',form); | |
| 422 | + | |
| 423 | + // 定义表单成功 | |
| 424 | + var success = $('.alert-success',form); | |
| 425 | + | |
| 426 | + $(document).ready(function() { | |
| 427 | + | |
| 428 | + // 关闭左侧栏 | |
| 429 | + if (!$('body').hasClass('page-sidebar-closed')) { | |
| 430 | + | |
| 431 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 432 | + | |
| 433 | + } | |
| 434 | + | |
| 435 | + setTimeout(function(){ | |
| 436 | + | |
| 437 | + FormWizard.init(); | |
| 438 | + | |
| 439 | + mapB = VmapWorlds.init(); | |
| 440 | + | |
| 441 | + }, 500); | |
| 442 | + | |
| 443 | + }); | |
| 444 | + | |
| 445 | + // 提交 | |
| 446 | + $('.button-submit').on('click',function() { | |
| 447 | + | |
| 448 | + form.submit(); | |
| 449 | + | |
| 450 | + }); | |
| 451 | + | |
| 452 | +</script> | |
| 0 | 453 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/section/css/positions.css
0 → 100644
| 1 | +#bmap_basic{ | |
| 2 | + min-width: 100%; | |
| 3 | + width: calc(100% + 26px); | |
| 4 | + margin-top: -28px; | |
| 5 | + border: 2px solid #fdfdfd; | |
| 6 | + min-height: 1200px; | |
| 7 | + height:100%; | |
| 8 | + overflow: hidden; | |
| 9 | +} | |
| 10 | + | |
| 11 | +html,body{ | |
| 12 | + overflow:hidden; | |
| 13 | +} | |
| 14 | + | |
| 15 | +/* 隐藏百度地图logo */ | |
| 16 | +.anchorBL, | |
| 17 | +.anchorBL, | |
| 18 | +.amap-logo, | |
| 19 | +.amap-copyright{ | |
| 20 | + display: none; | |
| 21 | +} | |
| 22 | + | |
| 23 | + | |
| 24 | +.leftUtils{ | |
| 25 | + position: absolute; | |
| 26 | + padding-right: 100px; | |
| 27 | + width: 100%; | |
| 28 | + height: 40px; | |
| 29 | + z-index: 9999; | |
| 30 | + padding-top: 7px; | |
| 31 | + top: 20px; | |
| 32 | +} | |
| 33 | + | |
| 34 | +.BMap_pop div:nth-child(1) , | |
| 35 | +.BMap_pop div:nth-child(2) , | |
| 36 | +.BMap_pop div:nth-child(3) , | |
| 37 | +.BMap_pop div:nth-child(4) , | |
| 38 | +.BMap_pop div:nth-child(5) , | |
| 39 | +.BMap_pop div:nth-child(6) , | |
| 40 | +.BMap_pop div:nth-child(7) { | |
| 41 | + | |
| 42 | + border:0px solid rgb(255, 255, 255) !important; | |
| 43 | + background-color:#3B3F51 !important; | |
| 44 | + | |
| 45 | +} | |
| 46 | + | |
| 47 | +.BMap_pop div:nth-child(3){ | |
| 48 | + | |
| 49 | + width:23px !important; | |
| 50 | + | |
| 51 | +} | |
| 52 | + | |
| 53 | +.BMap_pop div:nth-child(7) { | |
| 54 | + | |
| 55 | + width:23px !important; | |
| 56 | + | |
| 57 | + height:24px !important; | |
| 58 | + | |
| 59 | +} | |
| 60 | + | |
| 61 | +.BMap_pop div:nth-child(5) { | |
| 62 | + | |
| 63 | + height:24px !important; | |
| 64 | + | |
| 65 | +} | |
| 66 | + | |
| 67 | +/* 图片以后在弄,先隐藏div */ | |
| 68 | +.BMap_pop div:nth-child(8) { | |
| 69 | + | |
| 70 | + height:0px !important; | |
| 71 | + /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */ | |
| 72 | + /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */ | |
| 73 | + | |
| 74 | +} | |
| 75 | + | |
| 76 | +.BMap_pop { | |
| 77 | + | |
| 78 | + box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important; | |
| 79 | + | |
| 80 | +} | |
| 0 | 81 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/section/js/add-form-wizard.js
0 → 100644
| 1 | + | |
| 2 | +/** | |
| 3 | + * 表单的导航向导、验证、提交 | |
| 4 | + * | |
| 5 | + */ | |
| 6 | + | |
| 7 | +var FormWizard = function() { | |
| 8 | + | |
| 9 | + return { | |
| 10 | + | |
| 11 | + // 启动初始化向导导航 | |
| 12 | + init : function() { | |
| 13 | + | |
| 14 | + if(!jQuery().bootstrapWizard) { | |
| 15 | + | |
| 16 | + return; | |
| 17 | + | |
| 18 | + } | |
| 19 | + | |
| 20 | + // 表单验证 | |
| 21 | + form.validate({ | |
| 22 | + | |
| 23 | + // 错误提示元素span对象 | |
| 24 | + errorElement : 'span', | |
| 25 | + | |
| 26 | + // 错误提示元素class名称 | |
| 27 | + errorClass : 'help-block help-block-error', | |
| 28 | + | |
| 29 | + // 验证错误获取焦点 | |
| 30 | + focusInvalid : true, | |
| 31 | + | |
| 32 | + // 需要验证的表单元素 | |
| 33 | + rules : { | |
| 34 | + | |
| 35 | + // 起点 | |
| 36 | + 'stationStart' : { | |
| 37 | + | |
| 38 | + // 必填项 | |
| 39 | + required : true, | |
| 40 | + | |
| 41 | + // 最大长度 | |
| 42 | + maxlength: 20 | |
| 43 | + }, | |
| 44 | + | |
| 45 | + // 终点 | |
| 46 | + 'stationEnd' : { | |
| 47 | + | |
| 48 | + // 必填项 | |
| 49 | + required : true, | |
| 50 | + | |
| 51 | + // 最大长度 | |
| 52 | + maxlength: 20 | |
| 53 | + } | |
| 54 | + | |
| 55 | + | |
| 56 | + }, | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。 | |
| 60 | + * | |
| 61 | + * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator) | |
| 62 | + */ | |
| 63 | + invalidHandler : function(event, validator) { | |
| 64 | + | |
| 65 | + // 显示表单未通过提示信息 | |
| 66 | + error.show(); | |
| 67 | + | |
| 68 | + // 把提示信息放到指定的位置。 | |
| 69 | + App.scrollTo(error, -200); | |
| 70 | + }, | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 类型:Callback。 | |
| 74 | + * | |
| 75 | + * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。 | |
| 76 | + */ | |
| 77 | + highlight : function(element) { | |
| 78 | + | |
| 79 | + // 添加errorClass("has-error")到表单元素 | |
| 80 | + $(element).closest('.form-group').addClass('has-error'); | |
| 81 | + }, | |
| 82 | + | |
| 83 | + /** | |
| 84 | + * 类型:Callback。 | |
| 85 | + * | |
| 86 | + * 默认:移除errorClass("has-error")。与highlight操作相反 | |
| 87 | + */ | |
| 88 | + unhighlight : function(element) { | |
| 89 | + | |
| 90 | + // 移除errorClass("has-error") | |
| 91 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 92 | + }, | |
| 93 | + | |
| 94 | + /** | |
| 95 | + * 类型:String,Callback。 | |
| 96 | + * | |
| 97 | + * 如果指定它,当验证通过时显示一个消息。 | |
| 98 | + * | |
| 99 | + * 如果是String类型的,则添加该样式到标签中; | |
| 100 | + * | |
| 101 | + * 如果是一个回调函数,则将标签作为其唯一的参数。 | |
| 102 | + */ | |
| 103 | + success : function(label) { | |
| 104 | + | |
| 105 | + // 当验证通过时,移除errorClass("has-error") | |
| 106 | + label.closest('.form-group').removeClass('has-error'); | |
| 107 | + }, | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * 类型:Callback。 | |
| 111 | + * | |
| 112 | + * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form | |
| 113 | + */ | |
| 114 | + submitHandler : function(f) { | |
| 115 | + | |
| 116 | + console.log('submit'); | |
| 117 | + | |
| 118 | + // 表单序列化 | |
| 119 | + var params = form.serializeJSON(); | |
| 120 | + | |
| 121 | + //保存站点 | |
| 122 | + PublicFunctions.stationSave(params,function(data) { | |
| 123 | + | |
| 124 | + if(data.status=='SUCCESS') { | |
| 125 | + | |
| 126 | + // 弹出添加成功提示消息 | |
| 127 | + layer.msg('添加成功...'); | |
| 128 | + | |
| 129 | + | |
| 130 | + }else { | |
| 131 | + | |
| 132 | + // 弹出添加失败提示消息 | |
| 133 | + layer.msg('添加失败...'); | |
| 134 | + | |
| 135 | + } | |
| 136 | + | |
| 137 | + // 返回list.html页面 | |
| 138 | + loadPage('list.html'); | |
| 139 | + | |
| 140 | + }); | |
| 141 | + | |
| 142 | + } | |
| 143 | + }); | |
| 144 | + | |
| 145 | + // 确认提交信息 | |
| 146 | + var displayConfirm = function() { | |
| 147 | + | |
| 148 | + // 遍历表单元素下的tab4的class名称为form-control-static | |
| 149 | + $('#tab4 .form-control-static', form).each(function(){ | |
| 150 | + | |
| 151 | + // 定义input | |
| 152 | + var input = $('[name="'+$(this).attr("data-display")+'"]', form); | |
| 153 | + | |
| 154 | + if (input.is(":radio")) { | |
| 155 | + | |
| 156 | + input = $('[name="'+$(this).attr("data-display")+'"]:checked', form); | |
| 157 | + | |
| 158 | + } | |
| 159 | + if (input.is(":text") || input.is("textarea")) { | |
| 160 | + | |
| 161 | + $(this).html(input.val()); | |
| 162 | + | |
| 163 | + } else if (input.is("select")) { | |
| 164 | + | |
| 165 | + $(this).html(input.find('option:selected').text()); | |
| 166 | + | |
| 167 | + } else if (input.is(":radio") && input.is(":checked")) { | |
| 168 | + | |
| 169 | + $(this).html(input.attr("data-title")); | |
| 170 | + | |
| 171 | + } else if ($(this).attr("data-display") == 'payment[]') { | |
| 172 | + | |
| 173 | + var payment = []; | |
| 174 | + | |
| 175 | + $('[name="payment[]"]:checked', form).each(function(){ | |
| 176 | + | |
| 177 | + payment.push($(this).attr('data-title')); | |
| 178 | + | |
| 179 | + }); | |
| 180 | + | |
| 181 | + $(this).html(payment.join("<br>")); | |
| 182 | + } | |
| 183 | + }); | |
| 184 | + } | |
| 185 | + | |
| 186 | + /** 按钮点击时触发 */ | |
| 187 | + var handleTitle = function(tab, navigation, index) { | |
| 188 | + | |
| 189 | + // 定义导航条标签个数 | |
| 190 | + var total = navigation.find('li').length; | |
| 191 | + | |
| 192 | + // 当前标签页 | |
| 193 | + var current = index + 1; | |
| 194 | + | |
| 195 | + // 设置向导标题 | |
| 196 | + $('.step-title', $('#form-wizard-info')).text((index + 1) + ' - ' + total); | |
| 197 | + | |
| 198 | + // 删除"done"样式 | |
| 199 | + jQuery('li', $('#form-wizard-info')).removeClass("done"); | |
| 200 | + | |
| 201 | + // 获取导航标签元素集合 | |
| 202 | + var li_list = navigation.find('li'); | |
| 203 | + | |
| 204 | + // 遍历 | |
| 205 | + for (var i = 0; i < index; i++) { | |
| 206 | + | |
| 207 | + // 追加done样式 | |
| 208 | + jQuery(li_list[i]).addClass("done"); | |
| 209 | + | |
| 210 | + } | |
| 211 | + | |
| 212 | + | |
| 213 | + /** 如果为第一步隐藏返回按钮,否则显示返回按钮. */ | |
| 214 | + if (current == 1) { | |
| 215 | + | |
| 216 | + // 隐藏返回按钮 | |
| 217 | + $('#submit_section_form').find('.button-previous').hide(); | |
| 218 | + | |
| 219 | + } else { | |
| 220 | + | |
| 221 | + // 显示返回按钮 | |
| 222 | + $('#submit_section_form').find('.button-previous').show(); | |
| 223 | + | |
| 224 | + } | |
| 225 | + | |
| 226 | + if (current == 2) { | |
| 227 | + | |
| 228 | + var baseResValue = $('#submit_section_form input[name="baseRes"]:checked').val(); | |
| 229 | + | |
| 230 | + var stationStartValue = $('#stationStartInput').val(); | |
| 231 | + | |
| 232 | + var stationEndValue = $('#stationEndInput').val(); | |
| 233 | + | |
| 234 | + var paramsStationsArray = []; | |
| 235 | + | |
| 236 | + paramsStationsArray[0] = stationStartValue;paramsStationsArray[1]=stationEndValue; | |
| 237 | + | |
| 238 | + | |
| 239 | + if(baseResValue == 0) { | |
| 240 | + | |
| 241 | + // 根据站点名称获取百度坐标 | |
| 242 | + VmapWorlds.stationsNameToPoints(paramsStationsArray,function(resultJson) { | |
| 243 | + | |
| 244 | + // 根据坐标点获取两点之间的时间与距离 | |
| 245 | + VmapWorlds.getDistanceAndTotime(resultJson,function(stationdataList) { | |
| 246 | + | |
| 247 | + VmapWorlds.getSectionListPlonly(stationdataList,function(sectiondata) { | |
| 248 | + | |
| 249 | + VmapWorlds.eachSectionList(sectiondata,function(successdata) { | |
| 250 | + | |
| 251 | + VmapWorlds.getFormPointEToWGS(stationdataList,function(stationdata) { | |
| 252 | + | |
| 253 | + var sectionList = successdata[0].points; | |
| 254 | + | |
| 255 | + var sectionDataLen_ = sectionList.length; | |
| 256 | + | |
| 257 | + var gPloygonGrid = ''; | |
| 258 | + | |
| 259 | + var bPloygonGrid = ''; | |
| 260 | + | |
| 261 | + console.log(successdata); | |
| 262 | + | |
| 263 | + for(var s = 0; s<sectionDataLen_;s++) { | |
| 264 | + | |
| 265 | + if(s==0){ | |
| 266 | + | |
| 267 | + gPloygonGrid = sectionList[s].WGSpotion.Lng + ' ' +sectionList[s].WGSpotion.Lat; | |
| 268 | + | |
| 269 | + bPloygonGrid = sectionList[s].lng + ' ' +sectionList[s].lat; | |
| 270 | + | |
| 271 | + }else{ | |
| 272 | + | |
| 273 | + gPloygonGrid = gPloygonGrid + ',' + sectionList[s].WGSpotion.Lng + ' ' +sectionList[s].WGSpotion.Lat; | |
| 274 | + | |
| 275 | + bPloygonGrid = bPloygonGrid + ',' + sectionList[s].lng + ' ' +sectionList[s].lat; | |
| 276 | + | |
| 277 | + } | |
| 278 | + | |
| 279 | + } | |
| 280 | + | |
| 281 | + gPloygonGrid = 'LINESTRING(' + gPloygonGrid + ')'; | |
| 282 | + | |
| 283 | + bPloygonGrid = 'LINESTRING(' + bPloygonGrid + ')'; | |
| 284 | + | |
| 285 | + $('#bsectionVectorInput').val(bPloygonGrid); | |
| 286 | + | |
| 287 | + $('#gsectionVectorInput').val(gPloygonGrid); | |
| 288 | + | |
| 289 | + }); | |
| 290 | + }); | |
| 291 | + | |
| 292 | + }); | |
| 293 | + }); | |
| 294 | + | |
| 295 | + }); | |
| 296 | + | |
| 297 | + }else if(baseResValue ==1) { | |
| 298 | + | |
| 299 | + VmapWorlds.drawingManagerOpen(mapB); | |
| 300 | + | |
| 301 | + }else if(baseResValue ==2) { | |
| 302 | + | |
| 303 | + | |
| 304 | + } | |
| 305 | + | |
| 306 | + } | |
| 307 | + | |
| 308 | + if(current == 3){ | |
| 309 | + | |
| 310 | + mapB.clearOverlays(); | |
| 311 | + | |
| 312 | + drawingManager.close(); | |
| 313 | + | |
| 314 | + } | |
| 315 | + | |
| 316 | + /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */ | |
| 317 | + if (current >= total) { | |
| 318 | + | |
| 319 | + // 隐藏下一步按钮 | |
| 320 | + $('#submit_section_form').find('.button-next').hide(); | |
| 321 | + | |
| 322 | + // 显示提交按钮 | |
| 323 | + $('#submit_section_form').find('.button-submit').show(); | |
| 324 | + | |
| 325 | + // 确认提交信息 | |
| 326 | + displayConfirm(); | |
| 327 | + | |
| 328 | + } else { | |
| 329 | + | |
| 330 | + // 显示下一步按钮 | |
| 331 | + $('#submit_section_form').find('.button-next').show(); | |
| 332 | + | |
| 333 | + // 隐藏提交按钮 | |
| 334 | + $('#submit_section_form').find('.button-submit').hide(); | |
| 335 | + | |
| 336 | + } | |
| 337 | + | |
| 338 | + // 移动到指定位置 | |
| 339 | + App.scrollTo($('.page-title')); | |
| 340 | + | |
| 341 | + } | |
| 342 | + | |
| 343 | + // 表单导航向导插件 | |
| 344 | + $('#submit_section_form').bootstrapWizard({ | |
| 345 | + | |
| 346 | + // 下一步元素选择器 | |
| 347 | + 'nextSelector': '.button-next', | |
| 348 | + | |
| 349 | + // 返回元素选择器 | |
| 350 | + 'previousSelector': '.button-previous', | |
| 351 | + | |
| 352 | + /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */ | |
| 353 | + onTabClick: function (tab, navigation, index, clickedIndex) { | |
| 354 | + | |
| 355 | + success.hide(); | |
| 356 | + | |
| 357 | + error.hide(); | |
| 358 | + | |
| 359 | + if (form.valid() == false) { | |
| 360 | + | |
| 361 | + return false; | |
| 362 | + | |
| 363 | + } | |
| 364 | + | |
| 365 | + handleTitle(tab, navigation, clickedIndex); | |
| 366 | + | |
| 367 | + }, | |
| 368 | + | |
| 369 | + /** 下一步按钮被单击时触发, 返回移动到下一个步骤. */ | |
| 370 | + onNext: function (tab, navigation, index) { | |
| 371 | + | |
| 372 | + success.hide(); | |
| 373 | + | |
| 374 | + error.hide(); | |
| 375 | + | |
| 376 | + if (form.valid() == false) { | |
| 377 | + | |
| 378 | + return false; | |
| 379 | + | |
| 380 | + } | |
| 381 | + | |
| 382 | + mapB.clearOverlays(); | |
| 383 | + | |
| 384 | + circle = ''; | |
| 385 | + | |
| 386 | + drawingManager.close(); | |
| 387 | + | |
| 388 | + handleTitle(tab, navigation, index); | |
| 389 | + }, | |
| 390 | + | |
| 391 | + /** 上一步按钮被单击时触发,返回移动到前一个步骤 */ | |
| 392 | + onPrevious: function (tab, navigation, index) { | |
| 393 | + | |
| 394 | + success.hide(); | |
| 395 | + | |
| 396 | + error.hide(); | |
| 397 | + | |
| 398 | + mapB.clearOverlays(); | |
| 399 | + | |
| 400 | + drawingManager.close(); | |
| 401 | + | |
| 402 | + handleTitle(tab, navigation, index); | |
| 403 | + | |
| 404 | + }, | |
| 405 | + | |
| 406 | + /** 显示选项卡内容 */ | |
| 407 | + onTabShow: function (tab, navigation, index) { | |
| 408 | + | |
| 409 | + var total = navigation.find('li').length; | |
| 410 | + | |
| 411 | + var current = index + 1; | |
| 412 | + | |
| 413 | + var $percent = (current / total) * 100; | |
| 414 | + | |
| 415 | + $('#submit_section_form').find('.progress-bar').css({ | |
| 416 | + | |
| 417 | + width: $percent + '%' | |
| 418 | + | |
| 419 | + }); | |
| 420 | + | |
| 421 | + } | |
| 422 | + | |
| 423 | + }); | |
| 424 | + | |
| 425 | + // 初始化第一步隐藏返回按钮 | |
| 426 | + $('#submit_section_form').find('.button-previous').hide(); | |
| 427 | + | |
| 428 | + } | |
| 429 | + }; | |
| 430 | +}(); | ... | ... |
src/main/resources/static/pages/base/section/js/add-vmap-world.js
0 → 100644
| 1 | +var VmapWorlds = function() { | |
| 2 | + | |
| 3 | + var Bmap = { | |
| 4 | + | |
| 5 | + init : function() { | |
| 6 | + | |
| 7 | + // 设置中心点, | |
| 8 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | |
| 9 | + | |
| 10 | + // 百度API Key | |
| 11 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | |
| 12 | + | |
| 13 | + // 初始化百度地图 | |
| 14 | + var map = new BMap.Map("bmap_basic"); | |
| 15 | + | |
| 16 | + //中心点和缩放级别 | |
| 17 | + map.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | |
| 18 | + | |
| 19 | + //启用地图拖拽事件,默认启用(可不写) | |
| 20 | + map.enableDragging(); | |
| 21 | + | |
| 22 | + //启用地图滚轮放大缩小 | |
| 23 | + map.enableScrollWheelZoom(); | |
| 24 | + | |
| 25 | + //禁用鼠标双击放大 | |
| 26 | + map.disableDoubleClickZoom(); | |
| 27 | + | |
| 28 | + //启用键盘上下左右键移动地图 | |
| 29 | + map.enableKeyboard(); | |
| 30 | + | |
| 31 | + var styleOptions = { | |
| 32 | + | |
| 33 | + //边线颜色。 | |
| 34 | + strokeColor : "blue", | |
| 35 | + | |
| 36 | + //填充颜色。当参数为空时,圆形将没有填充效果。 | |
| 37 | + fillColor : "blue", | |
| 38 | + | |
| 39 | + //边线的宽度,以像素为单位。 | |
| 40 | + strokeWeight : 3, | |
| 41 | + | |
| 42 | + //边线透明度,取值范围0 - 1。 | |
| 43 | + strokeOpacity : 0.8, | |
| 44 | + | |
| 45 | + //填充的透明度,取值范围0 - 1。 | |
| 46 | + fillOpacity : 0.6, | |
| 47 | + | |
| 48 | + //边线的样式,solid或dashed。 | |
| 49 | + strokeStyle : 'solid' | |
| 50 | + | |
| 51 | + }; | |
| 52 | + | |
| 53 | + // 创建鼠标绘制管理类 | |
| 54 | + drawingManager = new BMapLib.DrawingManager(map, { | |
| 55 | + | |
| 56 | + //是否开启绘制模式 | |
| 57 | + isOpen : false, | |
| 58 | + | |
| 59 | + //是否显示工具栏 | |
| 60 | + enableDrawingTool : false, | |
| 61 | + | |
| 62 | + drawingToolOptions : { | |
| 63 | + | |
| 64 | + //位置 | |
| 65 | + anchor : BMAP_ANCHOR_TOP_RIGHT, | |
| 66 | + | |
| 67 | + //偏离值 | |
| 68 | + offset : new BMap.Size(5, 5), | |
| 69 | + | |
| 70 | + //工具栏缩放比例 | |
| 71 | + scale : 0.8 | |
| 72 | + | |
| 73 | + }, | |
| 74 | + | |
| 75 | + //线的样式 | |
| 76 | + polylineOptions : styleOptions | |
| 77 | + | |
| 78 | + }); | |
| 79 | + | |
| 80 | + // 添加绘画完成事件 | |
| 81 | + drawingManager.addEventListener('polylinecomplete', function(e) { | |
| 82 | + | |
| 83 | + if (e.getPath().length <= 2) { | |
| 84 | + | |
| 85 | + // 弹出提示消息 | |
| 86 | + layer.msg('坐标点不能小于等于两个...'); | |
| 87 | + | |
| 88 | + // 清除地图覆盖物 | |
| 89 | + map.clearOverlays(); | |
| 90 | + | |
| 91 | + // 加载该线路下所有站点位置添加到地图上 | |
| 92 | + return false; | |
| 93 | + | |
| 94 | + }else { | |
| 95 | + | |
| 96 | + var pointE = e; | |
| 97 | + | |
| 98 | + var pointELen_ = pointE.getPath().length | |
| 99 | + | |
| 100 | + var PointsList = []; | |
| 101 | + | |
| 102 | + for ( var i = 0; i < pointELen_; i++) { | |
| 103 | + | |
| 104 | + PointsList.push({potion: {lng: pointE.getPath()[i].lng, lat: pointE.getPath()[i].lat}}); | |
| 105 | + | |
| 106 | + } | |
| 107 | + | |
| 108 | + VmapWorlds.getFormPointEToWGS(PointsList,function(resultdata) { | |
| 109 | + | |
| 110 | + console.log(resultdata); | |
| 111 | + | |
| 112 | + | |
| 113 | + var gPloygonGrid = ''; | |
| 114 | + | |
| 115 | + var bPloygonGrid = ''; | |
| 116 | + | |
| 117 | + for(var k =0;k<resultdata.length;k++) { | |
| 118 | + | |
| 119 | + if(k==0) { | |
| 120 | + | |
| 121 | + gPloygonGrid = resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 122 | + | |
| 123 | + bPloygonGrid = resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 124 | + | |
| 125 | + }else { | |
| 126 | + | |
| 127 | + gPloygonGrid = gPloygonGrid + ',' + resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 128 | + | |
| 129 | + bPloygonGrid = bPloygonGrid + ',' + resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 130 | + | |
| 131 | + } | |
| 132 | + | |
| 133 | + } | |
| 134 | + | |
| 135 | + gPloygonGrid = 'LINESTRING(' + gPloygonGrid + ')'; | |
| 136 | + | |
| 137 | + bPloygonGrid = 'LINESTRING(' + bPloygonGrid + ')'; | |
| 138 | + | |
| 139 | + $('#bsectionVectorInput').val(bPloygonGrid); | |
| 140 | + | |
| 141 | + $('#gsectionVectorInput').val(gPloygonGrid); | |
| 142 | + | |
| 143 | + | |
| 144 | + }); | |
| 145 | + | |
| 146 | + | |
| 147 | + /* | |
| 148 | + // 多变行质心点 | |
| 149 | + var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; | |
| 150 | + | |
| 151 | + var PointsList = []; | |
| 152 | + | |
| 153 | + for ( var i = 0; i < pointE.getPath().length; i++) { | |
| 154 | + | |
| 155 | + PointsList.push({potion: {lng: pointE.getPath()[i].lng, lat: pointE.getPath()[i].lat}}); | |
| 156 | + | |
| 157 | + } | |
| 158 | + | |
| 159 | + PointsList.push({potion: {lng: pointE.getPath()[0].lng, lat: pointE.getPath()[0].lat}}); | |
| 160 | + | |
| 161 | + var centre = [{potion:{lng:pointE.getBounds().getCenter().lng,lat:pointE.getBounds().getCenter().lat}}]; | |
| 162 | + | |
| 163 | + PublicFunctions.getFormPointEToWGS(PointsList,function(resultdata) { | |
| 164 | + | |
| 165 | + var gPloygonGrid = ''; | |
| 166 | + | |
| 167 | + var bPloygonGrid = ''; | |
| 168 | + | |
| 169 | + for(var k =0;k<resultdata.length;k++) { | |
| 170 | + | |
| 171 | + if(k==0) { | |
| 172 | + | |
| 173 | + gPloygonGrid = resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 174 | + | |
| 175 | + bPloygonGrid = resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 176 | + | |
| 177 | + }else { | |
| 178 | + | |
| 179 | + gPloygonGrid = gPloygonGrid + ',' + resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 180 | + | |
| 181 | + bPloygonGrid = bPloygonGrid + ',' + resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 182 | + | |
| 183 | + } | |
| 184 | + | |
| 185 | + } | |
| 186 | + | |
| 187 | + gPloygonGrid = 'POLYGON((' + gPloygonGrid + '))'; | |
| 188 | + | |
| 189 | + bPloygonGrid = 'POLYGON((' + bPloygonGrid + '))'; | |
| 190 | + | |
| 191 | + PublicFunctions.getFormPointEToWGS(centre,function(p) { | |
| 192 | + | |
| 193 | + var gLonx = p[0].WGSpotion.Lng; | |
| 194 | + | |
| 195 | + var gLaty = p[0].WGSpotion.Lat; | |
| 196 | + | |
| 197 | + PublicFunctions.setFormInputValue(addSttationPoints_,gLonx,gLaty,bPloygonGrid,gPloygonGrid,'d',''); | |
| 198 | + | |
| 199 | + }); | |
| 200 | + | |
| 201 | + });*/ | |
| 202 | + | |
| 203 | + } | |
| 204 | + | |
| 205 | + }); | |
| 206 | + | |
| 207 | + return map; | |
| 208 | + }, | |
| 209 | + | |
| 210 | + // 根据地理名称获取百度经纬度坐标 | |
| 211 | + localSearchFromAdreesToPoint: function(Address,map,callback) { | |
| 212 | + | |
| 213 | + // 创建一个搜索类实例 | |
| 214 | + var localSearch = new BMap.LocalSearch(map); | |
| 215 | + | |
| 216 | + // 检索完成后的回调函数。 | |
| 217 | + localSearch.setSearchCompleteCallback(function (searchResult) { | |
| 218 | + | |
| 219 | + var resultPoints = ''; | |
| 220 | + | |
| 221 | + if(searchResult) { | |
| 222 | + | |
| 223 | + // 返回索引指定的结果。索引0表示第1条结果 | |
| 224 | + var poi = searchResult.getPoi(0); | |
| 225 | + | |
| 226 | + if(poi) { | |
| 227 | + | |
| 228 | + //获取经度和纬度 | |
| 229 | + resultPoints = poi.point.lng + ' ' + poi.point.lat; | |
| 230 | + | |
| 231 | + callback && callback(resultPoints); | |
| 232 | + | |
| 233 | + }else { | |
| 234 | + | |
| 235 | + callback && callback(false); | |
| 236 | + | |
| 237 | + } | |
| 238 | + | |
| 239 | + }else { | |
| 240 | + | |
| 241 | + callback && callback(false); | |
| 242 | + } | |
| 243 | + | |
| 244 | + }); | |
| 245 | + | |
| 246 | + // 根据检索词发起检索。 | |
| 247 | + localSearch.search(Address); | |
| 248 | + | |
| 249 | + }, | |
| 250 | + | |
| 251 | + // 打开绘画工具 | |
| 252 | + drawingManagerOpen : function(map) { | |
| 253 | + | |
| 254 | + // 打开鼠标绘画工具 | |
| 255 | + drawingManager.open(); | |
| 256 | + | |
| 257 | + // 设置属性 | |
| 258 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYLINE); | |
| 259 | + | |
| 260 | + }, | |
| 261 | + | |
| 262 | + stationsNameToPoints : function(arra,callback) { | |
| 263 | + | |
| 264 | + // 获取长度 | |
| 265 | + var len = arra.length; | |
| 266 | + | |
| 267 | + var stationList = []; | |
| 268 | + | |
| 269 | + (function(){ | |
| 270 | + | |
| 271 | + if (!arguments.callee.count) { | |
| 272 | + | |
| 273 | + arguments.callee.count = 0; | |
| 274 | + | |
| 275 | + } | |
| 276 | + | |
| 277 | + arguments.callee.count++; | |
| 278 | + | |
| 279 | + var index = parseInt(arguments.callee.count) - 1; | |
| 280 | + | |
| 281 | + if (index >= len) { | |
| 282 | + | |
| 283 | + callback && callback(stationList); | |
| 284 | + | |
| 285 | + return; | |
| 286 | + } | |
| 287 | + | |
| 288 | + var f = arguments.callee; | |
| 289 | + | |
| 290 | + if(arra[index]!=''){ | |
| 291 | + | |
| 292 | + var localSearch = new BMap.LocalSearch(mapB); | |
| 293 | + | |
| 294 | + localSearch.search(arra[index]); | |
| 295 | + | |
| 296 | + localSearch.setSearchCompleteCallback(function (searchResult) { | |
| 297 | + | |
| 298 | + var poi = searchResult.getPoi(0); | |
| 299 | + | |
| 300 | + if(poi) { | |
| 301 | + | |
| 302 | + stationList.push({name:arra[index],potion:{lng:poi.point.lng,lat:poi.point.lat}}); | |
| 303 | + | |
| 304 | + f(); | |
| 305 | + | |
| 306 | + } | |
| 307 | + | |
| 308 | + }); | |
| 309 | + }else { | |
| 310 | + | |
| 311 | + f(); | |
| 312 | + | |
| 313 | + } | |
| 314 | + | |
| 315 | + })(); | |
| 316 | + | |
| 317 | + }, | |
| 318 | + | |
| 319 | + getDistanceAndTotime : function(stationList,cb) { | |
| 320 | + | |
| 321 | + stationList[0].distance = ''; | |
| 322 | + | |
| 323 | + stationList[0].duration = ''; | |
| 324 | + | |
| 325 | + // 获取长度 | |
| 326 | + var len = stationList.length; | |
| 327 | + | |
| 328 | + (function(){ | |
| 329 | + | |
| 330 | + if (!arguments.callee.count) { | |
| 331 | + | |
| 332 | + arguments.callee.count = 0; | |
| 333 | + | |
| 334 | + } | |
| 335 | + | |
| 336 | + arguments.callee.count++; | |
| 337 | + | |
| 338 | + var index = parseInt(arguments.callee.count) - 1; | |
| 339 | + | |
| 340 | + if (index >= len-1) { | |
| 341 | + | |
| 342 | + cb && cb(stationList); | |
| 343 | + return; | |
| 344 | + } | |
| 345 | + | |
| 346 | + var f = arguments.callee; | |
| 347 | + | |
| 348 | + var poiOne = new BMap.Point(stationList[index].potion.lng,stationList[index].potion.lat); | |
| 349 | + | |
| 350 | + var poiTwo = new BMap.Point(stationList[index+1].potion.lng,stationList[index+1].potion.lat); | |
| 351 | + | |
| 352 | + var transit = new BMap.TransitRoute(mapB, {renderOptions: {map: mapB},onSearchComplete: searchComplete}); | |
| 353 | + | |
| 354 | + transit.search(poiOne,poiTwo); | |
| 355 | + | |
| 356 | + function searchComplete(results){ | |
| 357 | + | |
| 358 | + var plan = results.getPlan(0); | |
| 359 | + | |
| 360 | + if (transit.getStatus() != BMAP_STATUS_SUCCESS){ | |
| 361 | + | |
| 362 | + stationList[index+1].distance = ''; | |
| 363 | + | |
| 364 | + stationList[index+1].duration = ''; | |
| 365 | + | |
| 366 | + | |
| 367 | + }else { | |
| 368 | + | |
| 369 | + stationList[index+1].distance = plan.getDistance(true); | |
| 370 | + | |
| 371 | + stationList[index+1].duration = plan.getDuration(true); | |
| 372 | + | |
| 373 | + } | |
| 374 | + | |
| 375 | + f(); | |
| 376 | + } | |
| 377 | + | |
| 378 | + })(); | |
| 379 | + | |
| 380 | + }, | |
| 381 | + | |
| 382 | + getSectionListPlonly : function(stationsPoint,cb) { | |
| 383 | + | |
| 384 | + var len = stationsPoint.length; | |
| 385 | + | |
| 386 | + var sectionList = []; | |
| 387 | + | |
| 388 | + (function(){ | |
| 389 | + | |
| 390 | + if (!arguments.callee.count) { | |
| 391 | + | |
| 392 | + arguments.callee.count = 0; | |
| 393 | + | |
| 394 | + } | |
| 395 | + | |
| 396 | + arguments.callee.count++; | |
| 397 | + | |
| 398 | + var index = parseInt(arguments.callee.count) - 1; | |
| 399 | + | |
| 400 | + if (index >= len-1 ) { | |
| 401 | + | |
| 402 | + cb && cb(sectionList); | |
| 403 | + return; | |
| 404 | + } | |
| 405 | + | |
| 406 | + var f = arguments.callee; | |
| 407 | + | |
| 408 | + var poiOne = new BMap.Point(stationsPoint[index].potion.lng,stationsPoint[index].potion.lat); | |
| 409 | + | |
| 410 | + var poiTwo = new BMap.Point(stationsPoint[index+1].potion.lng,stationsPoint[index+1].potion.lat); | |
| 411 | + | |
| 412 | + var transit = new BMap.DrivingRoute(mapB, {renderOptions: {map: mapB},onPolylinesSet: searchPolylinesSet}); | |
| 413 | + | |
| 414 | + function searchPolylinesSet(results){ | |
| 415 | + | |
| 416 | + if (transit.getStatus() != BMAP_STATUS_SUCCESS){ | |
| 417 | + | |
| 418 | + | |
| 419 | + }else { | |
| 420 | + | |
| 421 | + var sectionArrayList = []; | |
| 422 | + for (i = 0; i < results.length; i++){ | |
| 423 | + | |
| 424 | + sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath()); | |
| 425 | + | |
| 426 | + } | |
| 427 | + | |
| 428 | + var sectionName = stationsPoint[index].name + '至' + stationsPoint[index+1].name; | |
| 429 | + | |
| 430 | + sectionList.push({sectionName:sectionName,points:sectionArrayList}); | |
| 431 | + | |
| 432 | + } | |
| 433 | + | |
| 434 | + f(); | |
| 435 | + } | |
| 436 | + | |
| 437 | + transit.search(poiOne,poiTwo); | |
| 438 | + | |
| 439 | + })(); | |
| 440 | + | |
| 441 | + }, | |
| 442 | + | |
| 443 | + eachSectionList : function(sectiondata,cb) { | |
| 444 | + | |
| 445 | + var dataLen_ = sectiondata.length; | |
| 446 | + | |
| 447 | + (function(){ | |
| 448 | + | |
| 449 | + if (!arguments.callee.count) { | |
| 450 | + | |
| 451 | + arguments.callee.count = 0; | |
| 452 | + | |
| 453 | + } | |
| 454 | + | |
| 455 | + arguments.callee.count++; | |
| 456 | + | |
| 457 | + var index_ = parseInt(arguments.callee.count) - 1; | |
| 458 | + | |
| 459 | + if (index_ > dataLen_ -1) { | |
| 460 | + | |
| 461 | + cb && cb(sectiondata); | |
| 462 | + return; | |
| 463 | + | |
| 464 | + } | |
| 465 | + | |
| 466 | + var p = arguments.callee; | |
| 467 | + | |
| 468 | + VmapWorlds.MuneBpointsArrayToWGS(sectiondata[index_].points,function(polyGonArray_) { | |
| 469 | + | |
| 470 | + sectiondata[index_].points = polyGonArray_; | |
| 471 | + | |
| 472 | + p(); | |
| 473 | + }); | |
| 474 | + | |
| 475 | + })(); | |
| 476 | + | |
| 477 | + }, | |
| 478 | + | |
| 479 | + MuneBpointsArrayToWGS : function(polyGonArray,callback) { | |
| 480 | + | |
| 481 | + if(polyGonArray) { | |
| 482 | + | |
| 483 | + // 获取长度 | |
| 484 | + var len = polyGonArray.length; | |
| 485 | + | |
| 486 | + (function(){ | |
| 487 | + | |
| 488 | + if (!arguments.callee.count) { | |
| 489 | + | |
| 490 | + arguments.callee.count = 0; | |
| 491 | + | |
| 492 | + } | |
| 493 | + | |
| 494 | + arguments.callee.count++; | |
| 495 | + | |
| 496 | + var index = parseInt(arguments.callee.count) - 1; | |
| 497 | + | |
| 498 | + if (index >= len) { | |
| 499 | + | |
| 500 | + callback && callback(polyGonArray); | |
| 501 | + | |
| 502 | + return; | |
| 503 | + } | |
| 504 | + | |
| 505 | + var f = arguments.callee; | |
| 506 | + | |
| 507 | + $.ajax({ | |
| 508 | + | |
| 509 | + // 百度坐标获取WGS坐标 | |
| 510 | + url: 'http://api.zdoz.net/bd2wgs.aspx', | |
| 511 | + | |
| 512 | + data: {lat: polyGonArray[index].lat , lng: polyGonArray[index].lng}, | |
| 513 | + | |
| 514 | + dataType: 'jsonp', | |
| 515 | + | |
| 516 | + success: function(r){ | |
| 517 | + | |
| 518 | + if(r) { | |
| 519 | + | |
| 520 | + polyGonArray[index].WGSpotion = r; | |
| 521 | + | |
| 522 | + } | |
| 523 | + | |
| 524 | + f(); | |
| 525 | + } | |
| 526 | + }); | |
| 527 | + | |
| 528 | + })(); | |
| 529 | + | |
| 530 | + }else { | |
| 531 | + | |
| 532 | + callback && callback(''); | |
| 533 | + | |
| 534 | + } | |
| 535 | + | |
| 536 | + | |
| 537 | + }, | |
| 538 | + | |
| 539 | + getFormPointEToWGS: function(points,callback) { | |
| 540 | + | |
| 541 | + // 获取长度 | |
| 542 | + var len = points.length; | |
| 543 | + | |
| 544 | + (function(){ | |
| 545 | + | |
| 546 | + if (!arguments.callee.count) { | |
| 547 | + | |
| 548 | + arguments.callee.count = 0; | |
| 549 | + | |
| 550 | + } | |
| 551 | + | |
| 552 | + arguments.callee.count++; | |
| 553 | + | |
| 554 | + var index = parseInt(arguments.callee.count) - 1; | |
| 555 | + | |
| 556 | + if (index >= len) { | |
| 557 | + | |
| 558 | + callback && callback(points); | |
| 559 | + | |
| 560 | + return; | |
| 561 | + } | |
| 562 | + | |
| 563 | + var f = arguments.callee; | |
| 564 | + | |
| 565 | + $.ajax({ | |
| 566 | + | |
| 567 | + url: 'http://api.zdoz.net/bd2wgs.aspx', | |
| 568 | + | |
| 569 | + data: {lat: points[index].potion.lat , lng: points[index].potion.lng}, | |
| 570 | + | |
| 571 | + dataType: 'jsonp', | |
| 572 | + | |
| 573 | + success: function(r){ | |
| 574 | + | |
| 575 | + if(r) { | |
| 576 | + | |
| 577 | + points[index].WGSpotion = r; | |
| 578 | + | |
| 579 | + } | |
| 580 | + | |
| 581 | + f(); | |
| 582 | + } | |
| 583 | + }); | |
| 584 | + | |
| 585 | + })(); | |
| 586 | + | |
| 587 | + }, | |
| 588 | + | |
| 589 | + getFormPointEToWGS: function(points,callback) { | |
| 590 | + | |
| 591 | + // 获取长度 | |
| 592 | + var len = points.length; | |
| 593 | + | |
| 594 | + (function(){ | |
| 595 | + | |
| 596 | + if (!arguments.callee.count) { | |
| 597 | + | |
| 598 | + arguments.callee.count = 0; | |
| 599 | + | |
| 600 | + } | |
| 601 | + | |
| 602 | + arguments.callee.count++; | |
| 603 | + | |
| 604 | + var index = parseInt(arguments.callee.count) - 1; | |
| 605 | + | |
| 606 | + if (index >= len) { | |
| 607 | + | |
| 608 | + callback && callback(points); | |
| 609 | + | |
| 610 | + return; | |
| 611 | + } | |
| 612 | + | |
| 613 | + var f = arguments.callee; | |
| 614 | + | |
| 615 | + $.ajax({ | |
| 616 | + | |
| 617 | + url: 'http://api.zdoz.net/bd2wgs.aspx', | |
| 618 | + | |
| 619 | + data: {lat: points[index].potion.lat , lng: points[index].potion.lng}, | |
| 620 | + | |
| 621 | + dataType: 'jsonp', | |
| 622 | + | |
| 623 | + success: function(r){ | |
| 624 | + | |
| 625 | + if(r) { | |
| 626 | + | |
| 627 | + points[index].WGSpotion = r; | |
| 628 | + | |
| 629 | + } | |
| 630 | + | |
| 631 | + f(); | |
| 632 | + } | |
| 633 | + }); | |
| 634 | + | |
| 635 | + })(); | |
| 636 | + | |
| 637 | + } | |
| 638 | + | |
| 639 | + } | |
| 640 | + | |
| 641 | + return Bmap; | |
| 642 | + | |
| 643 | +}(); | |
| 0 | 644 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/section/js/section-positions-map.js
0 → 100644
| 1 | +/** | |
| 2 | + * 百度地图 | |
| 3 | + * | |
| 4 | + */ | |
| 5 | + | |
| 6 | +var WorldsBMap = function () { | |
| 7 | + | |
| 8 | + var Bmap = { | |
| 9 | + | |
| 10 | + init : function() { | |
| 11 | + | |
| 12 | + // 关闭左侧栏 | |
| 13 | + if (!$('body').hasClass('page-sidebar-closed')) { | |
| 14 | + | |
| 15 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 16 | + | |
| 17 | + } | |
| 18 | + | |
| 19 | + // 设置中心点, | |
| 20 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | |
| 21 | + | |
| 22 | + // 百度API Key | |
| 23 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | |
| 24 | + | |
| 25 | + // 初始化百度地图 | |
| 26 | + var map = new BMap.Map("bmap_basic"); | |
| 27 | + | |
| 28 | + //中心点和缩放级别 | |
| 29 | + map.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | |
| 30 | + | |
| 31 | + return map; | |
| 32 | + } | |
| 33 | + | |
| 34 | + } | |
| 35 | + | |
| 36 | + return Bmap; | |
| 37 | + | |
| 38 | +}(); | |
| 0 | 39 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/section/js/section-positions-reload.js
0 → 100644
| 1 | +/** | |
| 2 | + * | |
| 3 | + * @JSName : list.js(路段信息定位positions.html页面js) | |
| 4 | + * | |
| 5 | + * @Author : bsth@lq | |
| 6 | + * | |
| 7 | + * @Description : TODO(路段信息定位positions.html页面js) | |
| 8 | + * | |
| 9 | + * @Data : 2016年4月28日 上午9:21:17 | |
| 10 | + * | |
| 11 | + * @Version 公交调度系统BS版 0.1 | |
| 12 | + * | |
| 13 | + */ | |
| 14 | + | |
| 15 | +(function(){ | |
| 16 | + | |
| 17 | + // 获取参数线路ID | |
| 18 | + var id = $.url().param('no'); | |
| 19 | + | |
| 20 | + // 等候500毫秒执行 | |
| 21 | + setTimeout(function(){ | |
| 22 | + | |
| 23 | + // 地图初始化 | |
| 24 | + var mapB = WorldsBMap.init(); | |
| 25 | + | |
| 26 | + getStationRouteInfo(function(r) { | |
| 27 | + | |
| 28 | + console.log(r); | |
| 29 | + | |
| 30 | + var len = r.length; | |
| 31 | + | |
| 32 | + if(len>0) { | |
| 33 | + | |
| 34 | + var sectionBsectionVectorStr = r[0].sectionBsectionVector; | |
| 35 | + | |
| 36 | + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); | |
| 37 | + | |
| 38 | + var lineArray = tempStr.split(','); | |
| 39 | + | |
| 40 | + var polylineArray = []; | |
| 41 | + | |
| 42 | + var lineaLen = lineArray.length | |
| 43 | + | |
| 44 | + for(var i = 0;i<lineaLen;i++) { | |
| 45 | + | |
| 46 | + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | |
| 47 | + | |
| 48 | + } | |
| 49 | + | |
| 50 | + var centerI = Math.ceil(lineaLen/2); | |
| 51 | + | |
| 52 | + // 中心坐标点 | |
| 53 | + var point = new BMap.Point(lineArray[centerI].split(' ')[0],lineArray[centerI].split(' ')[1]); | |
| 54 | + | |
| 55 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | |
| 56 | + '<span style="color:#DDD;font-size: 15px;">路段名称:' + r[0].sectionName + '</span>' + | |
| 57 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">路段编码:' + r[0].sectionCode + '</span>' + | |
| 58 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">路段序号:' + r[0].sectionRouteCode + '</span>' + | |
| 59 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">限 速:' + r[0].sectionSpeedLimit + '</span>' + | |
| 60 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">路段长度:' + r[0].sectionDistance + '</span>' + | |
| 61 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">路段时间:' + r[0].sectionTime + '</span>' + | |
| 62 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ 'ddd' +'" >说明/描述:' + 'ddd' + '</span>' ; | |
| 63 | + | |
| 64 | + // 信息窗口参数属性 | |
| 65 | + var opts = { | |
| 66 | + | |
| 67 | + // 信息窗口宽度 | |
| 68 | + width : 200, | |
| 69 | + | |
| 70 | + // 信息窗口高度 | |
| 71 | + height : 450, | |
| 72 | + | |
| 73 | + // 信息窗位置偏移值。 | |
| 74 | + offset: new BMap.Size(500,-80), | |
| 75 | + | |
| 76 | + //标题 | |
| 77 | + title : '<h4 style="color:#FFFFFF">'+r[0].sectionName+'站详情</h4>', | |
| 78 | + | |
| 79 | + //设置不允许信窗发送短息 | |
| 80 | + enableMessage : false, | |
| 81 | + | |
| 82 | + //是否开启点击地图关闭信息窗口 | |
| 83 | + enableCloseOnClick : false, | |
| 84 | + | |
| 85 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | |
| 86 | + enableAutoPan:true | |
| 87 | + }; | |
| 88 | + | |
| 89 | + drawingUpline(point,polylineArray,htm,opts,mapB); | |
| 90 | + } | |
| 91 | + | |
| 92 | + }); | |
| 93 | + | |
| 94 | + },200); | |
| 95 | + | |
| 96 | + function getStationRouteInfo (callback){ | |
| 97 | + | |
| 98 | + $get('/sectionroute/findSectionRouteInfoFormId',{id:id},function(r) { | |
| 99 | + | |
| 100 | + return callback && callback(r); | |
| 101 | + | |
| 102 | + }); | |
| 103 | + | |
| 104 | + } | |
| 105 | + | |
| 106 | + $('#backUp').on('click',function() { | |
| 107 | + | |
| 108 | + // 获取返回元素并修改url地址 | |
| 109 | + $('#backUp').attr('href','list.html?'); | |
| 110 | + | |
| 111 | + }); | |
| 112 | + | |
| 113 | + function drawingUpline(point,polylineArray,htm,opts,mapB) { | |
| 114 | + | |
| 115 | + // 创建线路走向 | |
| 116 | + var polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | |
| 117 | + | |
| 118 | + // 把折线添加到地图上 | |
| 119 | + mapB.addOverlay(polyUpline); | |
| 120 | + | |
| 121 | + // 创建信息窗口 | |
| 122 | + var infoWindow_target = new BMap.InfoWindow(htm, opts); | |
| 123 | + | |
| 124 | + // 自定义标注物图片 | |
| 125 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | |
| 126 | + | |
| 127 | + // 创建点 | |
| 128 | + var marker = new BMap.Marker(point,{icon : icon_target}); | |
| 129 | + | |
| 130 | + // 把标注添物加到地图上 | |
| 131 | + mapB.addOverlay(marker); | |
| 132 | + | |
| 133 | + setTimeout(function(){ | |
| 134 | + //开启信息窗口 | |
| 135 | + marker.openInfoWindow(infoWindow_target,point); | |
| 136 | + | |
| 137 | + },100); | |
| 138 | + | |
| 139 | + var PanOptions_ ={noAnimation :true}; | |
| 140 | + | |
| 141 | + mapB.reset(); | |
| 142 | + | |
| 143 | + mapB.panTo(point,PanOptions_); | |
| 144 | + | |
| 145 | + mapB.panBy(500,-510,PanOptions_); | |
| 146 | + | |
| 147 | + mapB.setZoom(14); | |
| 148 | + | |
| 149 | + } | |
| 150 | + | |
| 151 | +})(); | |
| 0 | 152 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/section/positions.html
0 → 100644
| 1 | +<link href="/pages/base/section/css/positions.css" rel="stylesheet" type="text/css" /> | |
| 2 | + | |
| 3 | +<div id="bmap_basic"></div> | |
| 4 | + | |
| 5 | +<div class="leftUtils"> | |
| 6 | + <div class="btn-group" style="left: 100px;"> | |
| 7 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具 | |
| 8 | + <i class="fa fa-angle-down"></i> | |
| 9 | + </a> | |
| 10 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | |
| 11 | + <li> | |
| 12 | + <a href="javascript:;"><i class="fa fa-pencil"></i> 修改 </a> | |
| 13 | + </li> | |
| 14 | + <li> | |
| 15 | + <a href="javascript:;" id = "backUp"> <i class="fa fa-reply"></i> 返回 </a> | |
| 16 | + </li> | |
| 17 | + | |
| 18 | + </ul> | |
| 19 | + </div> | |
| 20 | +</div> | |
| 21 | +<script src="/pages/base/section/js/section-positions-map.js"></script> | |
| 22 | +<script src="/pages/base/section/js/section-positions-reload.js"></script> | |
| 0 | 23 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/add.html
0 → 100644
| 1 | +<link href="/pages/base/station/css/addmap.css" rel="stylesheet" type="text/css" /> | |
| 2 | + | |
| 3 | +<!-- 片段标题title容器 --> | |
| 4 | +<div class="page-head"> | |
| 5 | + <div class="page-title"> | |
| 6 | + <h1>添加站点</h1> | |
| 7 | + </div> | |
| 8 | +</div> | |
| 9 | + | |
| 10 | +<ul class="page-breadcrumb breadcrumb"> | |
| 11 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | |
| 12 | + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | |
| 13 | + <li><a href="/pages/base/station/list.html" data-pjax>站点信息</a> <i class="fa fa-circle"></i></li> | |
| 14 | + <li><span class="active">添加站点</span></li> | |
| 15 | +</ul> | |
| 16 | + | |
| 17 | +<div class="portlet light bordered" id="form-wizard-info"> | |
| 18 | + <div class="portlet-title"> | |
| 19 | + <div class="caption"> | |
| 20 | + <i class="icon-equalizer font-red-sunglo"></i> | |
| 21 | + <span class="caption-subject font-red-sunglo bold uppercase">添加站点 | |
| 22 | + <span class="step-title"> 1 - 4 </span> | |
| 23 | + </span> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + <div class="portlet-body form"> | |
| 27 | + | |
| 28 | + <!-- START FORM 表单容器 --> | |
| 29 | + <form class="form-horizontal" id="submit_station_form" action="/" method="POST" novalidate="novalidate"> | |
| 30 | + <div class="form-wizard"> | |
| 31 | + <div class="form-body"> | |
| 32 | + <ul class="nav nav-pills nav-justified steps"> | |
| 33 | + <li class="active"> | |
| 34 | + <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true"> | |
| 35 | + <span class="number"> 1 </span> | |
| 36 | + <span class="desc"> | |
| 37 | + <i class="fa fa-check"></i> 选择添加站点方式 </span> | |
| 38 | + </a> | |
| 39 | + </li> | |
| 40 | + <li> | |
| 41 | + <a href="#tab2" data-toggle="tab" class="step"> | |
| 42 | + <span class="number"> 2 </span> | |
| 43 | + <span class="desc"> | |
| 44 | + <i class="fa fa-check"></i> 站点位置 </span> | |
| 45 | + </a> | |
| 46 | + </li> | |
| 47 | + <li> | |
| 48 | + <a href="#tab3" data-toggle="tab" class="step active"> | |
| 49 | + <span class="number"> 3 </span> | |
| 50 | + <span class="desc"> | |
| 51 | + <i class="fa fa-check"></i> 站点信息 </span> | |
| 52 | + </a> | |
| 53 | + </li> | |
| 54 | + <li> | |
| 55 | + <a href="#tab4" data-toggle="tab" class="step"> | |
| 56 | + <span class="number"> 4 </span> | |
| 57 | + <span class="desc"> | |
| 58 | + <i class="fa fa-check"></i> 确认 </span> | |
| 59 | + </a> | |
| 60 | + </li> | |
| 61 | + </ul> | |
| 62 | + | |
| 63 | + <!-- 进度条 --> | |
| 64 | + <div id="bar" class="progress progress-striped" role="progressbar"> | |
| 65 | + <div class="progress-bar progress-bar-success" style="width: 25%;"></div> | |
| 66 | + </div> | |
| 67 | + | |
| 68 | + <div class="tab-content"> | |
| 69 | + <div class="alert alert-danger display-hide"> | |
| 70 | + <button class="close" data-close="alert"></button> | |
| 71 | + 您的输入有误,请检查下面的输入项 | |
| 72 | + </div> | |
| 73 | + <div class="alert alert-success display-none"> | |
| 74 | + <button class="close" data-dismiss="alert"></button> | |
| 75 | + 验证成功! | |
| 76 | + </div> | |
| 77 | + | |
| 78 | + <!-- 选择添加站点方式 --> | |
| 79 | + <div class="tab-pane active" id="tab1"> | |
| 80 | + | |
| 81 | + <h3 class="block"> 选择添加站点方式 </h3> | |
| 82 | + | |
| 83 | + <!-- 站点名称 --> | |
| 84 | + <div class="form-group" id="formRequ"> | |
| 85 | + <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label> | |
| 86 | + <div class="col-md-9"> | |
| 87 | + <input type="text" class="form-control input-medium" id="statinoNamebooxtInput" name="statinoNamebooxt"> | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + | |
| 91 | + <!-- 新增方式 --> | |
| 92 | + <div class="form-group"> | |
| 93 | + <label class="col-md-3 control-label">新增方式:</label> | |
| 94 | + <div class="col-md-9"> | |
| 95 | + <div class="icheck-list"> | |
| 96 | + <label> | |
| 97 | + <input type="radio" class="icheck" name="baseRes" value=0 checked> 系统生成 | |
| 98 | + </label> | |
| 99 | + <label > | |
| 100 | + <input type="radio" class="icheck" name="baseRes" value=1 > 手动添加 | |
| 101 | + </label> | |
| 102 | + <label> | |
| 103 | + <input type="radio" class="icheck" name="baseRes" value=2> 系统引用 | |
| 104 | + </label> | |
| 105 | + </div> | |
| 106 | + </div> | |
| 107 | + </div> | |
| 108 | + | |
| 109 | + <div class="form-group"> | |
| 110 | + <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50"> | |
| 111 | + <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 新增方式说明: </span></h5> | |
| 112 | + <p><span class="help-block" style="color:#1bbc9b;"> a)系统生成:根据站点名称自动生成以150米为半径范围的圆.</span> </p> | |
| 113 | + <p><span class="help-block" style="color:#1bbc9b;"> b)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span> </p> | |
| 114 | + <p><span class="help-block" style="color:#1bbc9b;"> c)选择引用:从系统中选择已有的站点进行引用.</span> </p> | |
| 115 | + </div> | |
| 116 | + </div> | |
| 117 | + | |
| 118 | + </div> | |
| 119 | + | |
| 120 | + <!-- 站点位置 --> | |
| 121 | + <div class="tab-pane" id="tab2"> | |
| 122 | + <h3 class="block"> 站点位置 </h3> | |
| 123 | + <div id="bmap_basic"></div> | |
| 124 | + </div> | |
| 125 | + | |
| 126 | + <!-- 站点信息 --> | |
| 127 | + <div class="tab-pane" id="tab3"> | |
| 128 | + <h3 class="block"> 站点信息 </h3> | |
| 129 | + | |
| 130 | + <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" /> | |
| 131 | + | |
| 132 | + <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" /> | |
| 133 | + | |
| 134 | + <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | |
| 135 | + | |
| 136 | + <input type="hidden" name="x" id="xInput" value=""/> | |
| 137 | + | |
| 138 | + <input type="hidden" name="y" id="yInput" value=""/> | |
| 139 | + | |
| 140 | + <input type="hidden" name="lineId" id="lineIdInput" value=""/> | |
| 141 | + | |
| 142 | + <!-- 线路名称 --> | |
| 143 | + <div class="form-body"> | |
| 144 | + <div class="form-group"> | |
| 145 | + <label class="control-label col-md-3"> | |
| 146 | + <span class="required"> * </span> 线路名称 : | |
| 147 | + </label> | |
| 148 | + <div class="col-md-6"> | |
| 149 | + <select name="line" class="form-control" style="width:100%" id="lineSelect"></select> | |
| 150 | + </div> | |
| 151 | + </div> | |
| 152 | + </div> | |
| 153 | + | |
| 154 | + <!-- 线路编码 --> | |
| 155 | + <div class="form-body"> | |
| 156 | + <div class="form-group"> | |
| 157 | + <label class="control-label col-md-3"> | |
| 158 | + <span class="required"> * </span>线路编码: | |
| 159 | + </label> | |
| 160 | + <div class="col-md-6"> | |
| 161 | + <input type="text" class="form-control" name="lineCode" id="lineCodeInput"> | |
| 162 | + </div> | |
| 163 | + </div> | |
| 164 | + </div> | |
| 165 | + | |
| 166 | + <!-- 站点名称 --> | |
| 167 | + <div class="form-body"> | |
| 168 | + <div class="form-group"> | |
| 169 | + <label class="control-label col-md-3"> | |
| 170 | + <span class="required"> * </span> 站点名称: | |
| 171 | + </label> | |
| 172 | + <div class="col-md-6"> | |
| 173 | + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称"> | |
| 174 | + </div> | |
| 175 | + </div> | |
| 176 | + </div> | |
| 177 | + | |
| 178 | + <!-- 站点编码 --> | |
| 179 | + <div class="form-body"> | |
| 180 | + <div class="form-group"> | |
| 181 | + <label class="control-label col-md-3"> | |
| 182 | + <span class="required"> * </span>站点编码: | |
| 183 | + </label> | |
| 184 | + <div class="col-md-6"> | |
| 185 | + <input type="text" class="form-control" name="stationCod" id="stationCodInput"> | |
| 186 | + </div> | |
| 187 | + </div> | |
| 188 | + </div> | |
| 189 | + | |
| 190 | + <!-- 站点序号 --> | |
| 191 | + <div class="form-body"> | |
| 192 | + <div class="form-group"> | |
| 193 | + <label class="control-label col-md-3"> | |
| 194 | + <span class="required"> * </span>上一站点: | |
| 195 | + </label> | |
| 196 | + <div class="col-md-6"> | |
| 197 | + <select name="stationRouteCode" style="width:100%" class="form-control" id="stationrouteSelect"></select> | |
| 198 | + <span class="help-block"> *说明:选择的站点将作为本站序号的参考,成为选择站点的下一站。 </span> | |
| 199 | + </div> | |
| 200 | + </div> | |
| 201 | + </div> | |
| 202 | + | |
| 203 | + <!-- 站点类型 --> | |
| 204 | + <div class="form-body"> | |
| 205 | + <div class="form-group"> | |
| 206 | + <label class="control-label col-md-3"> | |
| 207 | + <span class="required"> * </span>站点类型: | |
| 208 | + </label> | |
| 209 | + <div class="col-md-6"> | |
| 210 | + <select name="stationMark" class="form-control" id="stationMarkSelect"> | |
| 211 | + <option value="">-- 请选择站点类型 --</option> | |
| 212 | + <option value="B">起点站</option> | |
| 213 | + <option value="Z">中途站</option> | |
| 214 | + <option value="E">终点站</option> | |
| 215 | + <option value="T">停车场</option> | |
| 216 | + </select> | |
| 217 | + </div> | |
| 218 | + </div> | |
| 219 | + </div> | |
| 220 | + | |
| 221 | + <!-- 站点方向 --> | |
| 222 | + <div class="form-body"> | |
| 223 | + <div class="form-group"> | |
| 224 | + <label class="control-label col-md-3"> | |
| 225 | + <span class="required"> * </span>站点方向: | |
| 226 | + </label> | |
| 227 | + <div class="col-md-6"> | |
| 228 | + <select name="directions" class="form-control" id="stationdirSelect"> | |
| 229 | + <option value="">-- 请选择站点类型 --</option> | |
| 230 | + <option value="0">上行</option> | |
| 231 | + <option value="1">下行</option> | |
| 232 | + </select> | |
| 233 | + </div> | |
| 234 | + </div> | |
| 235 | + </div> | |
| 236 | + | |
| 237 | + <!-- 道路编码--> | |
| 238 | + <div class="form-body"> | |
| 239 | + <div class="form-group"> | |
| 240 | + <label class="control-label col-md-3">道路编码:</label> | |
| 241 | + <div class="col-md-6"> | |
| 242 | + <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput"> | |
| 243 | + </div> | |
| 244 | + </div> | |
| 245 | + </div> | |
| 246 | + | |
| 247 | + <!-- 中心位置坐标点 --> | |
| 248 | + <div class="form-body"> | |
| 249 | + <div class="form-group"> | |
| 250 | + <label class="col-md-3 control-label">经纬度坐标点:</label> | |
| 251 | + <div class="col-md-6"> | |
| 252 | + <input type="text" class="form-control" name="bJwpoints" id="bJwpointsInput"> | |
| 253 | + </div> | |
| 254 | + </div> | |
| 255 | + </div> | |
| 256 | + | |
| 257 | + <!-- 站点WGS经纬度 --> | |
| 258 | + <div class="form-body"> | |
| 259 | + <div class="form-group"> | |
| 260 | + <label class="col-md-3 control-label">站点WGS经纬度:</label> | |
| 261 | + <div class="col-md-6"> | |
| 262 | + <input type="text" class="form-control" name="gJwpoints" id="gJwpointsInput"> | |
| 263 | + </div> | |
| 264 | + </div> | |
| 265 | + </div> | |
| 266 | + | |
| 267 | + <!-- 范围图形类型 --> | |
| 268 | + <div class="form-body"> | |
| 269 | + <div class="form-group"> | |
| 270 | + <label class="col-md-3 control-label">范围图形类型:</label> | |
| 271 | + <div class="col-md-6"> | |
| 272 | + <select name="shapesType" class="form-control" id="shapesTypeSelect"> | |
| 273 | + <option value="">-- 请选择站点类型 --</option> | |
| 274 | + <option value="r">圆形</option> | |
| 275 | + <option value="d">多变形</option> | |
| 276 | + </select> | |
| 277 | + </div> | |
| 278 | + </div> | |
| 279 | + </div> | |
| 280 | + | |
| 281 | + <!-- 圆形半径 --> | |
| 282 | + <div class="form-body"> | |
| 283 | + <div class="form-group"> | |
| 284 | + <label class="col-md-3 control-label">圆形半径:</label> | |
| 285 | + <div class="col-md-6"> | |
| 286 | + <input type="text" class="form-control" name="radius" id="radiusInput" > | |
| 287 | + </div> | |
| 288 | + </div> | |
| 289 | + </div> | |
| 290 | + | |
| 291 | + <!-- 到站时间 --> | |
| 292 | + <div class="form-body"> | |
| 293 | + <div class="form-group"> | |
| 294 | + <label class="col-md-3 control-label">到站时间:</label> | |
| 295 | + <div class="col-md-6"> | |
| 296 | + <input type="text" class="form-control" name="toTime" id="toTimeInput" > | |
| 297 | + <span class="help-block">单位:分钟</span> | |
| 298 | + </div> | |
| 299 | + </div> | |
| 300 | + </div> | |
| 301 | + | |
| 302 | + <!-- 到站距离 --> | |
| 303 | + <div class="form-body"> | |
| 304 | + <div class="form-group"> | |
| 305 | + <label class="col-md-3 control-label">到站距离:</label> | |
| 306 | + <div class="col-md-6"> | |
| 307 | + <input type="text" class="form-control" name="distances" id="distancesInput" > | |
| 308 | + <span class="help-block">单位:公里</span> | |
| 309 | + </div> | |
| 310 | + </div> | |
| 311 | + </div> | |
| 312 | + | |
| 313 | + <!-- 版本号 --> | |
| 314 | + <div class="form-body"> | |
| 315 | + <div class="form-group"> | |
| 316 | + <label class="col-md-3 control-label">版本号:</label> | |
| 317 | + <div class="col-md-6"> | |
| 318 | + <input type="text" class="form-control" name="versions" value='1' Readonly> | |
| 319 | + </div> | |
| 320 | + </div> | |
| 321 | + </div> | |
| 322 | + | |
| 323 | + <!-- 范围图形类型 --> | |
| 324 | + <div class="form-body"> | |
| 325 | + <div class="form-group"> | |
| 326 | + <label class="col-md-3 control-label">是否撤销:</label> | |
| 327 | + <div class="col-md-6"> | |
| 328 | + <select name="destroy" class="form-control" id="destroySelect"> | |
| 329 | + <option value="">-- 请选择撤销类型 --</option> | |
| 330 | + <option value="0">否</option> | |
| 331 | + <option value="1">是</option> | |
| 332 | + </select> | |
| 333 | + </div> | |
| 334 | + </div> | |
| 335 | + </div> | |
| 336 | + | |
| 337 | + <!-- 描述/说明 --> | |
| 338 | + <div class="form-group"> | |
| 339 | + <label class="control-label col-md-3"> 描述/说明: </label> | |
| 340 | + <div class="col-md-6"> | |
| 341 | + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | |
| 342 | + </div> | |
| 343 | + </div> | |
| 344 | + | |
| 345 | + </div> | |
| 346 | + | |
| 347 | + <!-- 确定提交资料信息 --> | |
| 348 | + <div class="tab-pane" id="tab4"> | |
| 349 | + <h3 class="block"> 确认您提交的站点信息 </h3> | |
| 350 | + | |
| 351 | + <h4 class="form-section"> 地理位置 </h4> | |
| 352 | + | |
| 353 | + <div class="form-group"> | |
| 354 | + <label class="control-label col-md-3"> 范围图形类型: </label> | |
| 355 | + <div class="col-md-4"> | |
| 356 | + <p class="form-control-static" data-display="shapesType"> </p> | |
| 357 | + </div> | |
| 358 | + </div> | |
| 359 | + | |
| 360 | + <div class="form-group"> | |
| 361 | + <label class="control-label col-md-3"> 圆形半径: </label> | |
| 362 | + <div class="col-md-4"> | |
| 363 | + <p class="form-control-static" data-display="radius"> </p> | |
| 364 | + </div> | |
| 365 | + </div> | |
| 366 | + | |
| 367 | + <div class="form-group"> | |
| 368 | + <label class="control-label col-md-3"> 中心位置经纬度坐标点: </label> | |
| 369 | + <div class="col-md-4"> | |
| 370 | + <p class="form-control-static" data-display="bJwpoints"> </p> | |
| 371 | + </div> | |
| 372 | + </div> | |
| 373 | + | |
| 374 | + <div class="form-group"> | |
| 375 | + <label class="control-label col-md-3"> 中心位置WGS坐标点: </label> | |
| 376 | + <div class="col-md-4"> | |
| 377 | + <p class="form-control-static" data-display="bJwpoints"> </p> | |
| 378 | + </div> | |
| 379 | + </div> | |
| 380 | + | |
| 381 | + <!-- | |
| 382 | + <div class="form-group"> | |
| 383 | + <label class="control-label col-md-3"> 图形经纬度坐标点集合: </label> | |
| 384 | + <div class="col-md-4"> | |
| 385 | + <p class="form-control-static" data-display="bPolygonGrid"> </p> | |
| 386 | + </div> | |
| 387 | + </div> | |
| 388 | + | |
| 389 | + <div class="form-group"> | |
| 390 | + <label class="control-label col-md-3"> 图形经WGS坐标点集合: </label> | |
| 391 | + <div class="col-md-4"> | |
| 392 | + <p class="form-control-static" data-display="gPolygonGrid"> </p> | |
| 393 | + </div> | |
| 394 | + </div> | |
| 395 | + --> | |
| 396 | + <h4 class="form-section"> 站点信息 </h4> | |
| 397 | + | |
| 398 | + <div class="form-group"> | |
| 399 | + <label class="control-label col-md-3">线路名称:</label> | |
| 400 | + <div class="col-md-4"> | |
| 401 | + <p class="form-control-static" data-display="line"> </p> | |
| 402 | + </div> | |
| 403 | + </div> | |
| 404 | + | |
| 405 | + <div class="form-group"> | |
| 406 | + <label class="control-label col-md-3">线路编码:</label> | |
| 407 | + <div class="col-md-4"> | |
| 408 | + <p class="form-control-static" data-display="lineCode"> </p> | |
| 409 | + </div> | |
| 410 | + </div> | |
| 411 | + | |
| 412 | + <div class="form-group"> | |
| 413 | + <label class="control-label col-md-3">站点名称:</label> | |
| 414 | + <div class="col-md-4"> | |
| 415 | + <p class="form-control-static" data-display="stationName"> </p> | |
| 416 | + </div> | |
| 417 | + </div> | |
| 418 | + | |
| 419 | + <div class="form-group"> | |
| 420 | + <label class="control-label col-md-3">站点编码:</label> | |
| 421 | + <div class="col-md-4"> | |
| 422 | + <p class="form-control-static" data-display="stationCod"> </p> | |
| 423 | + </div> | |
| 424 | + </div> | |
| 425 | + | |
| 426 | + <div class="form-group"> | |
| 427 | + <label class="control-label col-md-3">上一站点:</label> | |
| 428 | + <div class="col-md-4"> | |
| 429 | + <p class="form-control-static" data-display="stationRouteCode"> </p> | |
| 430 | + </div> | |
| 431 | + </div> | |
| 432 | + | |
| 433 | + <div class="form-group"> | |
| 434 | + <label class="control-label col-md-3">站点类型:</label> | |
| 435 | + <div class="col-md-4"> | |
| 436 | + <p class="form-control-static" data-display="stationMark"> </p> | |
| 437 | + </div> | |
| 438 | + </div> | |
| 439 | + | |
| 440 | + <div class="form-group"> | |
| 441 | + <label class="control-label col-md-3">站点方向:</label> | |
| 442 | + <div class="col-md-4"> | |
| 443 | + <p class="form-control-static" data-display="directions"> </p> | |
| 444 | + </div> | |
| 445 | + </div> | |
| 446 | + | |
| 447 | + <div class="form-group"> | |
| 448 | + <label class="control-label col-md-3">道路编码:</label> | |
| 449 | + <div class="col-md-4"> | |
| 450 | + <p class="form-control-static" data-display="roadCoding"> </p> | |
| 451 | + </div> | |
| 452 | + </div> | |
| 453 | + | |
| 454 | + <div class="form-group"> | |
| 455 | + <label class="control-label col-md-3">到站时间:</label> | |
| 456 | + <div class="col-md-4"> | |
| 457 | + <p class="form-control-static" data-display="toTime"> </p> | |
| 458 | + </div> | |
| 459 | + </div> | |
| 460 | + | |
| 461 | + <div class="form-group"> | |
| 462 | + <label class="control-label col-md-3">到站距离:</label> | |
| 463 | + <div class="col-md-4"> | |
| 464 | + <p class="form-control-static" data-display="distances"> </p> | |
| 465 | + </div> | |
| 466 | + </div> | |
| 467 | + | |
| 468 | + <div class="form-group"> | |
| 469 | + <label class="control-label col-md-3">版本号:</label> | |
| 470 | + <div class="col-md-4"> | |
| 471 | + <p class="form-control-static" data-display="versions"> </p> | |
| 472 | + </div> | |
| 473 | + </div> | |
| 474 | + | |
| 475 | + <div class="form-group"> | |
| 476 | + <label class="control-label col-md-3">是否撤销:</label> | |
| 477 | + <div class="col-md-4"> | |
| 478 | + <p class="form-control-static" data-display="destroy"> </p> | |
| 479 | + </div> | |
| 480 | + </div> | |
| 481 | + | |
| 482 | + <div class="form-group"> | |
| 483 | + <label class="control-label col-md-3">描述/说明:</label> | |
| 484 | + <div class="col-md-4"> | |
| 485 | + <p class="form-control-static" data-display="descriptions"> </p> | |
| 486 | + </div> | |
| 487 | + </div> | |
| 488 | + | |
| 489 | + </div> | |
| 490 | + </div> | |
| 491 | + </div> | |
| 492 | + <div class="form-actions"> | |
| 493 | + <div class="row"> | |
| 494 | + <div class="col-md-offset-3 col-md-9"> | |
| 495 | + <a href="javascript:;" class="btn default button-previous disabled" style="display: none;"> | |
| 496 | + <i class="fa fa-angle-left"></i> 返回 </a> | |
| 497 | + <a href="javascript:;" class="btn btn-outline green button-next"> 下一步 | |
| 498 | + <i class="fa fa-angle-right"></i> | |
| 499 | + </a> | |
| 500 | + <a href="javascript:;" class="btn green button-submit" style="display: none;"> 提交 | |
| 501 | + <i class="fa fa-check"></i> | |
| 502 | + </a> | |
| 503 | + </div> | |
| 504 | + </div> | |
| 505 | + </div> | |
| 506 | + </div> | |
| 507 | + </form> | |
| 508 | + <!-- END FORM--> | |
| 509 | + </div> | |
| 510 | +</div> | |
| 511 | +<script src="/pages/base/station/js/add-input-function.js"></script> | |
| 512 | +<script src="/pages/base/station/js/add-form-wizard.js"></script> | |
| 513 | +<script src="/pages/base/station/js/add-vmap-world.js"></script> | |
| 514 | +<script type="text/javascript"> | |
| 515 | + | |
| 516 | + var mapB = ''; | |
| 517 | + | |
| 518 | + var circle = ''; | |
| 519 | + | |
| 520 | + var drawingManager = ''; | |
| 521 | + | |
| 522 | + // 定义表单 | |
| 523 | + var form = $('#submit_station_form'); | |
| 524 | + | |
| 525 | + // 定义表单异常 | |
| 526 | + var error = $('.alert-danger',form); | |
| 527 | + | |
| 528 | + // 定义表单成功 | |
| 529 | + var success = $('.alert-success',form); | |
| 530 | + | |
| 531 | + $(document).ready(function() { | |
| 532 | + | |
| 533 | + // 关闭左侧栏 | |
| 534 | + if (!$('body').hasClass('page-sidebar-closed')) { | |
| 535 | + | |
| 536 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 537 | + | |
| 538 | + } | |
| 539 | + | |
| 540 | + setTimeout(function(){ | |
| 541 | + | |
| 542 | + FormWizard.init(); | |
| 543 | + | |
| 544 | + mapB = VmapWorlds.init(); | |
| 545 | + | |
| 546 | + PublicFunctions.getStationCode(function(stationCode) { | |
| 547 | + | |
| 548 | + $('#stationCodInput').val(stationCode); | |
| 549 | + | |
| 550 | + }); | |
| 551 | + | |
| 552 | + $('#destroySelect').val('0'); | |
| 553 | + | |
| 554 | + PublicFunctions.getLineAllInfo(function(array) { | |
| 555 | + | |
| 556 | + var opGroup = '<option value="">请选择...</option><optgroup label="线路">'; | |
| 557 | + | |
| 558 | + var len_ = array.length; | |
| 559 | + | |
| 560 | + if(len_>0) { | |
| 561 | + | |
| 562 | + $.each(array, function(i, g){ | |
| 563 | + | |
| 564 | + opGroup += '<option value="'+ g.id + '_' + g.lineCode +'">'+g.name+'</option>'; | |
| 565 | + | |
| 566 | + }); | |
| 567 | + | |
| 568 | + } | |
| 569 | + | |
| 570 | + opGroup += '</optgroup>'; | |
| 571 | + | |
| 572 | + $('#lineSelect').html(opGroup).select2(); | |
| 573 | + | |
| 574 | + }); | |
| 575 | + | |
| 576 | + var htm = '<option value="">请选择...</option>'; | |
| 577 | + | |
| 578 | + $('#stationrouteSelect').html(htm).select2(); | |
| 579 | + | |
| 580 | + $('#lineSelect').on("change", function (e) { | |
| 581 | + | |
| 582 | + var lineSelectValue = $('#lineSelect').val(); | |
| 583 | + | |
| 584 | + if(lineSelectValue=='') { | |
| 585 | + | |
| 586 | + $('#lineCodeInput').val(''); | |
| 587 | + | |
| 588 | + $('#lineIdInput').val(''); | |
| 589 | + | |
| 590 | + }else { | |
| 591 | + | |
| 592 | + var lineSelectValueArray = lineSelectValue.split('_'); | |
| 593 | + | |
| 594 | + $('#lineIdInput').val(lineSelectValueArray[0]); | |
| 595 | + | |
| 596 | + $('#lineCodeInput').val(lineSelectValueArray[1]); | |
| 597 | + | |
| 598 | + PublicFunctions.getStationRouteInfo(lineSelectValueArray[1],function(p) { | |
| 599 | + | |
| 600 | + var p_len = p.length; | |
| 601 | + | |
| 602 | + var options = '<option value="">请选择...</option>'; | |
| 603 | + | |
| 604 | + if(p_len>0) { | |
| 605 | + | |
| 606 | + $.each(p, function(i, g){ | |
| 607 | + | |
| 608 | + if(g.directions==0){ | |
| 609 | + | |
| 610 | + options += '<optgroup label="上行">'; | |
| 611 | + | |
| 612 | + options += '<option value="'+g.stationRouteCode + '_' + g.stationMark + '_' + g.directions +'">'+g.stationName+'</option>' | |
| 613 | + | |
| 614 | + options += '</optgroup>'; | |
| 615 | + | |
| 616 | + }else if(g.directions==1) { | |
| 617 | + | |
| 618 | + options += '<optgroup label="下行">'; | |
| 619 | + | |
| 620 | + options += '<option value="'+g.stationRouteCode + '_' + g.stationMark + '_' + g.directions +'">'+g.stationName+'</option>' | |
| 621 | + | |
| 622 | + options += '</optgroup>'; | |
| 623 | + | |
| 624 | + } | |
| 625 | + | |
| 626 | + }); | |
| 627 | + | |
| 628 | + } | |
| 629 | + | |
| 630 | + $('#stationrouteSelect').html(options).select2(); | |
| 631 | + | |
| 632 | + $('#stationMarkSelect').val(''); | |
| 633 | + | |
| 634 | + $('#stationdirSelect').val(''); | |
| 635 | + | |
| 636 | + }); | |
| 637 | + } | |
| 638 | + }); | |
| 639 | + | |
| 640 | + $('#stationrouteSelect').on("change", function (e) { | |
| 641 | + | |
| 642 | + var stationrouteSelectValue = $('#stationrouteSelect').val(); | |
| 643 | + | |
| 644 | + if(stationrouteSelectValue==''){ | |
| 645 | + | |
| 646 | + $('#stationMarkSelect').val(''); | |
| 647 | + | |
| 648 | + $('#stationdirSelect').val(''); | |
| 649 | + | |
| 650 | + }else{ | |
| 651 | + | |
| 652 | + var stationrouteSelectValueArray = stationrouteSelectValue.split('_'); | |
| 653 | + | |
| 654 | + var stationMarkStr = stationrouteSelectValueArray[1]; | |
| 655 | + | |
| 656 | + if(stationMarkStr == 'E') { | |
| 657 | + | |
| 658 | + $('#stationMarkSelect').val('E'); | |
| 659 | + | |
| 660 | + }else{ | |
| 661 | + | |
| 662 | + $('#stationMarkSelect').val('Z'); | |
| 663 | + | |
| 664 | + } | |
| 665 | + | |
| 666 | + $('#stationdirSelect').val(stationrouteSelectValueArray[2]); | |
| 667 | + | |
| 668 | + } | |
| 669 | + | |
| 670 | + }); | |
| 671 | + | |
| 672 | + }, 500); | |
| 673 | + | |
| 674 | + }); | |
| 675 | + | |
| 676 | + // 提交 | |
| 677 | + $('.button-submit').on('click',function() { | |
| 678 | + | |
| 679 | + form.submit(); | |
| 680 | + | |
| 681 | + }); | |
| 682 | + | |
| 683 | +</script> | |
| 0 | 684 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/css/addmap.css
0 → 100644
| 1 | +#bmap_basic{ | |
| 2 | + min-width: 100%; | |
| 3 | + width: 100%; | |
| 4 | + margin-top: -28px; | |
| 5 | + border: 2px solid #fdfdfd; | |
| 6 | + min-height: 400px; | |
| 7 | + height:100%; | |
| 8 | + overflow: hidden; | |
| 9 | + top: 15px; | |
| 10 | +} | |
| 11 | + | |
| 12 | + | |
| 13 | +/* 隐藏百度地图logo */ | |
| 14 | +.anchorBL, | |
| 15 | +.anchorBL, | |
| 16 | +.amap-logo, | |
| 17 | +.amap-copyright{ | |
| 18 | + display: none; | |
| 19 | +} | |
| 20 | + | |
| 21 | +.BMap_pop div:nth-child(1) , | |
| 22 | +.BMap_pop div:nth-child(2) , | |
| 23 | +.BMap_pop div:nth-child(3) , | |
| 24 | +.BMap_pop div:nth-child(4) , | |
| 25 | +.BMap_pop div:nth-child(5) , | |
| 26 | +.BMap_pop div:nth-child(6) , | |
| 27 | +.BMap_pop div:nth-child(7) { | |
| 28 | + | |
| 29 | + border:0px solid rgb(255, 255, 255) !important; | |
| 30 | + background-color:#3B3F51 !important; | |
| 31 | + | |
| 32 | +} | |
| 33 | + | |
| 34 | +.BMap_pop div:nth-child(3){ | |
| 35 | + | |
| 36 | + width:23px !important; | |
| 37 | + | |
| 38 | +} | |
| 39 | + | |
| 40 | +.BMap_pop div:nth-child(7) { | |
| 41 | + | |
| 42 | + width:23px !important; | |
| 43 | + | |
| 44 | + height:24px !important; | |
| 45 | + | |
| 46 | +} | |
| 47 | + | |
| 48 | +.BMap_pop div:nth-child(5) { | |
| 49 | + | |
| 50 | + height:24px !important; | |
| 51 | + | |
| 52 | +} | |
| 53 | + | |
| 54 | +/* 图片以后在弄,先隐藏div */ | |
| 55 | +.BMap_pop div:nth-child(8) { | |
| 56 | + | |
| 57 | + height:0px !important; | |
| 58 | + /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */ | |
| 59 | + /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */ | |
| 60 | + | |
| 61 | +} | |
| 62 | + | |
| 63 | +.BMap_pop { | |
| 64 | + | |
| 65 | + box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important; | |
| 66 | + | |
| 67 | +} | |
| 0 | 68 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/css/positions.css
0 → 100644
| 1 | +#bmap_basic{ | |
| 2 | + min-width: 100%; | |
| 3 | + width: calc(100% + 26px); | |
| 4 | + margin-top: -28px; | |
| 5 | + border: 2px solid #fdfdfd; | |
| 6 | + min-height: 1200px; | |
| 7 | + height:100%; | |
| 8 | + overflow: hidden; | |
| 9 | +} | |
| 10 | + | |
| 11 | +html,body{ | |
| 12 | + overflow:hidden; | |
| 13 | +} | |
| 14 | + | |
| 15 | +/* 隐藏百度地图logo */ | |
| 16 | +.anchorBL, | |
| 17 | +.anchorBL, | |
| 18 | +.amap-logo, | |
| 19 | +.amap-copyright{ | |
| 20 | + display: none; | |
| 21 | +} | |
| 22 | + | |
| 23 | + | |
| 24 | +.leftUtils{ | |
| 25 | + position: absolute; | |
| 26 | + padding-right: 100px; | |
| 27 | + width: 100%; | |
| 28 | + height: 40px; | |
| 29 | + z-index: 9999; | |
| 30 | + padding-top: 7px; | |
| 31 | + top: 20px; | |
| 32 | +} | |
| 33 | + | |
| 34 | +.BMap_pop div:nth-child(1) , | |
| 35 | +.BMap_pop div:nth-child(2) , | |
| 36 | +.BMap_pop div:nth-child(3) , | |
| 37 | +.BMap_pop div:nth-child(4) , | |
| 38 | +.BMap_pop div:nth-child(5) , | |
| 39 | +.BMap_pop div:nth-child(6) , | |
| 40 | +.BMap_pop div:nth-child(7) { | |
| 41 | + | |
| 42 | + border:0px solid rgb(255, 255, 255) !important; | |
| 43 | + background-color:#3B3F51 !important; | |
| 44 | + | |
| 45 | +} | |
| 46 | + | |
| 47 | +.BMap_pop div:nth-child(3){ | |
| 48 | + | |
| 49 | + width:23px !important; | |
| 50 | + | |
| 51 | +} | |
| 52 | + | |
| 53 | +.BMap_pop div:nth-child(7) { | |
| 54 | + | |
| 55 | + width:23px !important; | |
| 56 | + | |
| 57 | + height:24px !important; | |
| 58 | + | |
| 59 | +} | |
| 60 | + | |
| 61 | +.BMap_pop div:nth-child(5) { | |
| 62 | + | |
| 63 | + height:24px !important; | |
| 64 | + | |
| 65 | +} | |
| 66 | + | |
| 67 | +/* 图片以后在弄,先隐藏div */ | |
| 68 | +.BMap_pop div:nth-child(8) { | |
| 69 | + | |
| 70 | + height:0px !important; | |
| 71 | + /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */ | |
| 72 | + /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */ | |
| 73 | + | |
| 74 | +} | |
| 75 | + | |
| 76 | +.BMap_pop { | |
| 77 | + | |
| 78 | + box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important; | |
| 79 | + | |
| 80 | +} | |
| 0 | 81 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/edit.html
0 → 100644
| 1 | +<!-- 编辑站点弹出层mobal --> | |
| 2 | +<div class="modal fade" id="edit_station_mobal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 3 | + | |
| 4 | + <div class="modal-dialog"> | |
| 5 | + <div class="modal-content"> | |
| 6 | + | |
| 7 | + <!-- 弹出层标题title容器 --> | |
| 8 | + <div class="modal-header"> | |
| 9 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | |
| 10 | + <h4 class="modal-title">编辑站点</h4> | |
| 11 | + </div> | |
| 12 | + | |
| 13 | + <!-- 弹出层主体内容容器 --> | |
| 14 | + <div class="modal-body"> | |
| 15 | + | |
| 16 | + <!-- START FORM 表单容器 --> | |
| 17 | + <form class="form-horizontal" role="form" id="edit_station_form" action="/module" method="post"> | |
| 18 | + | |
| 19 | + <!-- 表单错误提示信息容器 --> | |
| 20 | + <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> | |
| 21 | + 您的输入有误,请检查下面的输入项 | |
| 22 | + </div> | |
| 23 | + | |
| 24 | + <!-- 站点ID --> | |
| 25 | + <input type="hidden" name="stationId" id="stationIdInput"> | |
| 26 | + | |
| 27 | + <!-- 站点路由ID --> | |
| 28 | + <input type="hidden" name="stationRouteId" id="stationRouteIdInput"> | |
| 29 | + | |
| 30 | + <!-- 线路ID --> | |
| 31 | + <input type="hidden" name="stationRouteLine" id="stationRouteLineInput"> | |
| 32 | + | |
| 33 | + <!-- 线路编码 --> | |
| 34 | + <input type="hidden" name="lineCode" id="lineCodeInput"> | |
| 35 | + | |
| 36 | + <!-- 图形坐标点集合(百度坐标) --> | |
| 37 | + <input type="hidden" name="bPolygonGrid" id="bPolygonGridInput" /> | |
| 38 | + | |
| 39 | + <!-- 图形坐标点集合(WGS坐标) --> | |
| 40 | + <input type="hidden" name="gPolygonGrid" id="gPolygonGridInput" /> | |
| 41 | + | |
| 42 | + <!-- 原始坐标类型 --> | |
| 43 | + <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> | |
| 44 | + | |
| 45 | + <!-- 城建坐标x --> | |
| 46 | + <input type="hidden" name="x" id="xInput" value=""/> | |
| 47 | + | |
| 48 | + <!-- 城建坐标y --> | |
| 49 | + <input type="hidden" name="y" id="yInput" value=""/> | |
| 50 | + | |
| 51 | + <!-- 站点名称 --> | |
| 52 | + <div class="form-body"> | |
| 53 | + <div class="form-group"> | |
| 54 | + <label class="control-label col-md-3"> | |
| 55 | + <span class="required"> * </span> 站点名称: | |
| 56 | + </label> | |
| 57 | + <div class="col-md-6"> | |
| 58 | + <input type="text" class="form-control" name="stationName" id="stationNameInput" placeholder="站点名称"> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + | |
| 63 | + <!-- 站点编码 --> | |
| 64 | + <div class="form-body"> | |
| 65 | + <div class="form-group"> | |
| 66 | + <label class="control-label col-md-3"> | |
| 67 | + <span class="required"> * </span>站点编码: | |
| 68 | + </label> | |
| 69 | + <div class="col-md-6"> | |
| 70 | + <input type="text" class="form-control" name="stationCod" id="stationCodInput" placeholder="站点编码"> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + | |
| 75 | + <!-- 站点序号 --> | |
| 76 | + <div class="form-body"> | |
| 77 | + <div class="form-group"> | |
| 78 | + <label class="control-label col-md-3"> | |
| 79 | + <span class="required"> * </span>上一站点: | |
| 80 | + </label> | |
| 81 | + <div class="col-md-6"> | |
| 82 | + <select name="stationRouteCode" class="form-control" id="stationrouteSelect"></select> | |
| 83 | + <span class="help-block"> *说明:选择的站点将作为本站序号的参考,成为选择站点的下一站。 </span> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + </div> | |
| 87 | + | |
| 88 | + <!-- 站点类型 --> | |
| 89 | + <div class="form-body"> | |
| 90 | + <div class="form-group"> | |
| 91 | + <label class="control-label col-md-3"> | |
| 92 | + <span class="required"> * </span>站点类型: | |
| 93 | + </label> | |
| 94 | + <div class="col-md-6"> | |
| 95 | + <select name="stationMark" class="form-control" id="stationMarkSelect"> | |
| 96 | + <option value="">-- 请选择站点类型 --</option> | |
| 97 | + <option value="B">起点站</option> | |
| 98 | + <option value="Z">中途站</option> | |
| 99 | + <option value="E">终点站</option> | |
| 100 | + </select> | |
| 101 | + </div> | |
| 102 | + </div> | |
| 103 | + </div> | |
| 104 | + | |
| 105 | + <!-- 站点方向 --> | |
| 106 | + <div class="form-body"> | |
| 107 | + <div class="form-group"> | |
| 108 | + <label class="control-label col-md-3"> | |
| 109 | + <span class="required"> * </span>站点方向: | |
| 110 | + </label> | |
| 111 | + <div class="col-md-6"> | |
| 112 | + <select name="directions" class="form-control" id="stationdirSelect"> | |
| 113 | + <option value="">-- 请选择站点类型 --</option> | |
| 114 | + <option value="0">上行</option> | |
| 115 | + <option value="1">下行</option> | |
| 116 | + </select> | |
| 117 | + </div> | |
| 118 | + </div> | |
| 119 | + </div> | |
| 120 | + | |
| 121 | + <!-- 道路编码--> | |
| 122 | + <div class="form-body"> | |
| 123 | + <div class="form-group"> | |
| 124 | + <label class="control-label col-md-3">道路编码:</label> | |
| 125 | + <div class="col-md-6"> | |
| 126 | + <input type="text" class="form-control" name="roadCoding" id="roadCodingCodInput" placeholder="道路编码"> | |
| 127 | + </div> | |
| 128 | + </div> | |
| 129 | + </div> | |
| 130 | + | |
| 131 | + <!-- 中心位置坐标点 --> | |
| 132 | + <div class="form-body"> | |
| 133 | + <div class="form-group"> | |
| 134 | + <label class="col-md-3 control-label">经纬度坐标点:</label> | |
| 135 | + <div class="col-md-6"> | |
| 136 | + <input type="text" class="form-control" name="bJwpoints" id="bJwpointsInput" placeholder="经纬度坐标点"> | |
| 137 | + </div> | |
| 138 | + </div> | |
| 139 | + </div> | |
| 140 | + | |
| 141 | + <!-- 站点WGS经纬度 --> | |
| 142 | + <div class="form-body"> | |
| 143 | + <div class="form-group"> | |
| 144 | + <label class="col-md-3 control-label">站点WGS经纬度:</label> | |
| 145 | + <div class="col-md-6"> | |
| 146 | + <input type="text" class="form-control" name="gJwpoints" id="gJwpointsInput" placeholder="站点WGS经纬度"> | |
| 147 | + </div> | |
| 148 | + </div> | |
| 149 | + </div> | |
| 150 | + | |
| 151 | + <!-- 范围图形类型 --> | |
| 152 | + <div class="form-body"> | |
| 153 | + <div class="form-group"> | |
| 154 | + <label class="col-md-3 control-label">范围图形类型:</label> | |
| 155 | + <div class="col-md-6"> | |
| 156 | + <select name="shapesType" class="form-control" id="shapesTypeSelect"> | |
| 157 | + <option value="">-- 请选择站点类型 --</option> | |
| 158 | + <option value="r">圆形</option> | |
| 159 | + <option value="d">多变形</option> | |
| 160 | + </select> | |
| 161 | + </div> | |
| 162 | + </div> | |
| 163 | + </div> | |
| 164 | + | |
| 165 | + <!-- 范围图形类型 --> | |
| 166 | + <div class="form-body"> | |
| 167 | + <div class="form-group"> | |
| 168 | + <label class="col-md-3 control-label">圆形半径:</label> | |
| 169 | + <div class="col-md-6"> | |
| 170 | + <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="圆形半径"> | |
| 171 | + </div> | |
| 172 | + </div> | |
| 173 | + </div> | |
| 174 | + | |
| 175 | + <!-- 到站时间 --> | |
| 176 | + <div class="form-body"> | |
| 177 | + <div class="form-group"> | |
| 178 | + <label class="col-md-3 control-label">到站时间:</label> | |
| 179 | + <div class="col-md-6"> | |
| 180 | + <input type="text" class="form-control" name="toTime" id="toTimeInput" placeholder="到站时间"> | |
| 181 | + <span class="help-block">单位:分钟</span> | |
| 182 | + </div> | |
| 183 | + </div> | |
| 184 | + </div> | |
| 185 | + | |
| 186 | + <!-- 到站距离 --> | |
| 187 | + <div class="form-body"> | |
| 188 | + <div class="form-group"> | |
| 189 | + <label class="col-md-3 control-label">到站距离:</label> | |
| 190 | + <div class="col-md-6"> | |
| 191 | + <input type="text" class="form-control" name="distances" id="distancesInput" placeholder="到站距离"> | |
| 192 | + <span class="help-block">单位:公里</span> | |
| 193 | + </div> | |
| 194 | + </div> | |
| 195 | + </div> | |
| 196 | + | |
| 197 | + <!-- 版本号 --> | |
| 198 | + <div class="form-body"> | |
| 199 | + <div class="form-group"> | |
| 200 | + <label class="col-md-3 control-label">版本号:</label> | |
| 201 | + <div class="col-md-6"> | |
| 202 | + <input type="text" class="form-control" name="versions" value='1' Readonly> | |
| 203 | + </div> | |
| 204 | + </div> | |
| 205 | + </div> | |
| 206 | + | |
| 207 | + <!-- 范围图形类型 --> | |
| 208 | + <div class="form-body"> | |
| 209 | + <div class="form-group"> | |
| 210 | + <label class="col-md-3 control-label">是否撤销:</label> | |
| 211 | + <div class="col-md-6"> | |
| 212 | + <select name="destroy" class="form-control" id="destroySelect"> | |
| 213 | + <option value="">-- 请选择撤销类型 --</option> | |
| 214 | + <option value="0">否</option> | |
| 215 | + <option value="1">是</option> | |
| 216 | + </select> | |
| 217 | + </div> | |
| 218 | + </div> | |
| 219 | + </div> | |
| 220 | + | |
| 221 | + <!-- 描述/说明 --> | |
| 222 | + <div class="form-group"> | |
| 223 | + <label class="control-label col-md-3"> 描述/说明: </label> | |
| 224 | + <div class="col-md-6"> | |
| 225 | + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | |
| 226 | + </div> | |
| 227 | + </div> | |
| 228 | + | |
| 229 | + </form> | |
| 230 | + | |
| 231 | + <!-- END FORM --> | |
| 232 | + </div> | |
| 233 | + | |
| 234 | + <!-- 表单操作按钮容器 --> | |
| 235 | + <div class="modal-footer"> | |
| 236 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 237 | + <button type="button" class="btn btn-primary" id="editStationButton">提交数据</button> | |
| 238 | + </div> | |
| 239 | + | |
| 240 | + </div> | |
| 241 | + </div> | |
| 242 | +</div> | |
| 243 | +<script type="text/javascript"> | |
| 244 | +$(function(){ | |
| 245 | + | |
| 246 | + // 初始化表单值 | |
| 247 | + PublicFunctions.setFormValue(); | |
| 248 | + | |
| 249 | + // 方向 | |
| 250 | + var edit_direction_v = stationObj[0].stationRoutedirections; | |
| 251 | + | |
| 252 | + // 线路ID | |
| 253 | + var lineId = stationObj[0].stationRouteLine; | |
| 254 | + | |
| 255 | + // 获取站点序号元素,并添加下拉属性值 | |
| 256 | + PublicFunctions.getStation(lineId,edit_direction_v,function(treeData) { | |
| 257 | + | |
| 258 | + var options = '<option value="">请选择...</option>'; | |
| 259 | + | |
| 260 | + var dArray = treeData[0].children[0].children; | |
| 261 | + | |
| 262 | + var eq_stationRouteCode = stationObj[0].stationRouteCode + '_' + stationObj[0].stationRouteStationMark; | |
| 263 | + | |
| 264 | + for(var i = 0 ; i<dArray.length; i++){ | |
| 265 | + | |
| 266 | + var ptions_v = dArray[i].stationRouteStationRouteCode+ '_'+ dArray[i].stationRouteStationMark; | |
| 267 | + | |
| 268 | + // 排除本站 | |
| 269 | + if(eq_stationRouteCode == ptions_v){ | |
| 270 | + | |
| 271 | + continue; | |
| 272 | + | |
| 273 | + } | |
| 274 | + | |
| 275 | + options += '<option value="'+ ptions_v +'">'+dArray[i].stationRouteStationName+'</option>' | |
| 276 | + | |
| 277 | + } | |
| 278 | + | |
| 279 | + $('#stationrouteSelect').html(options); | |
| 280 | + | |
| 281 | + PublicFunctions.findUpStationRouteCode(lineId,edit_direction_v,stationObj[0].stationRouteCode,function(str) { | |
| 282 | + | |
| 283 | + if(str.length>0){ | |
| 284 | + | |
| 285 | + var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke; | |
| 286 | + | |
| 287 | + $('#stationrouteSelect').val(upStationRouteCode); | |
| 288 | + | |
| 289 | + } | |
| 290 | + | |
| 291 | + }); | |
| 292 | + | |
| 293 | + }); | |
| 294 | + | |
| 295 | + // 显示mobal | |
| 296 | + $('#edit_station_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | |
| 297 | + | |
| 298 | + // 当调用 hide 实例方法时触发 | |
| 299 | + $('#edit_station_mobal').on('hide.bs.modal', function () { | |
| 300 | + | |
| 301 | + PublicFunctions.clearRefresh(); | |
| 302 | + | |
| 303 | + }); | |
| 304 | + | |
| 305 | + | |
| 306 | + // 编辑表单元素 | |
| 307 | + var form = $('#edit_station_form'); | |
| 308 | + | |
| 309 | + // 获取错误提示元素 | |
| 310 | + var error = $('.alert-danger', form); | |
| 311 | + | |
| 312 | + // 提交数据按钮事件 | |
| 313 | + $('#editStationButton').on('click', function() { | |
| 314 | + | |
| 315 | + // 表单提交 | |
| 316 | + form.submit(); | |
| 317 | + | |
| 318 | + }); | |
| 319 | + | |
| 320 | + // 表单验证 | |
| 321 | + form.validate({ | |
| 322 | + | |
| 323 | + errorElement : 'span', | |
| 324 | + | |
| 325 | + errorClass : 'help-block help-block-error', | |
| 326 | + | |
| 327 | + focusInvalid : false, | |
| 328 | + | |
| 329 | + rules : { | |
| 330 | + | |
| 331 | + // 站点名称 | |
| 332 | + 'stationName' : { | |
| 333 | + | |
| 334 | + // 必填项 | |
| 335 | + required : true | |
| 336 | + | |
| 337 | + }, | |
| 338 | + | |
| 339 | + // 站点类型 | |
| 340 | + 'stationMark' : { | |
| 341 | + | |
| 342 | + // 必填项 | |
| 343 | + required : true | |
| 344 | + | |
| 345 | + }, | |
| 346 | + | |
| 347 | + // 站点序号 | |
| 348 | + 'stationRouteCode' : { | |
| 349 | + | |
| 350 | + isStart : true | |
| 351 | + | |
| 352 | + }, | |
| 353 | + | |
| 354 | + // 站点编码 | |
| 355 | + 'stationCod': { | |
| 356 | + | |
| 357 | + // 必填项 | |
| 358 | + required : true, | |
| 359 | + | |
| 360 | + // 必须输入合法的数字(负数,小数)。 | |
| 361 | + number : true | |
| 362 | + | |
| 363 | + }, | |
| 364 | + | |
| 365 | + // 站点方向 | |
| 366 | + 'directions' : { | |
| 367 | + | |
| 368 | + // 必填项 | |
| 369 | + required : true, | |
| 370 | + | |
| 371 | + // 方向选择限制 | |
| 372 | + dirIs : true | |
| 373 | + | |
| 374 | + }, | |
| 375 | + | |
| 376 | + // 到站距离 | |
| 377 | + 'distances' : { | |
| 378 | + | |
| 379 | + // 必须输入合法的数字(负数,小数)。 | |
| 380 | + number : true | |
| 381 | + | |
| 382 | + }, | |
| 383 | + | |
| 384 | + // 到站时间 | |
| 385 | + 'toTime' : { | |
| 386 | + | |
| 387 | + // 必须输入合法的数字(负数,小数)。 | |
| 388 | + number : true | |
| 389 | + | |
| 390 | + }, | |
| 391 | + | |
| 392 | + // 描述与说明 | |
| 393 | + 'descriptions' : { | |
| 394 | + | |
| 395 | + // 最大长度 | |
| 396 | + maxlength: 150 | |
| 397 | + | |
| 398 | + } | |
| 399 | + }, | |
| 400 | + | |
| 401 | + invalidHandler : function(event, validator) { | |
| 402 | + | |
| 403 | + error.show(); | |
| 404 | + | |
| 405 | + App.scrollTo(error, -200); | |
| 406 | + | |
| 407 | + }, | |
| 408 | + | |
| 409 | + highlight : function(element) { | |
| 410 | + | |
| 411 | + $(element).closest('.form-group').addClass('has-error'); | |
| 412 | + | |
| 413 | + }, | |
| 414 | + | |
| 415 | + unhighlight : function(element) { | |
| 416 | + | |
| 417 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 418 | + | |
| 419 | + }, | |
| 420 | + | |
| 421 | + success : function(label) { | |
| 422 | + | |
| 423 | + label.closest('.form-group').removeClass('has-error'); | |
| 424 | + | |
| 425 | + }, | |
| 426 | + | |
| 427 | + submitHandler : function(f) { | |
| 428 | + | |
| 429 | + var params = form.serializeJSON(); | |
| 430 | + | |
| 431 | + error.hide(); | |
| 432 | + | |
| 433 | + PublicFunctions.stationUpdate(params,function(resuntDate) { | |
| 434 | + | |
| 435 | + if(resuntDate.status=='SUCCESS') { | |
| 436 | + | |
| 437 | + // 弹出添加成功提示消息 | |
| 438 | + layer.msg('修改成功...'); | |
| 439 | + | |
| 440 | + }else { | |
| 441 | + | |
| 442 | + // 弹出添加失败提示消息 | |
| 443 | + layer.msg('修改失败...'); | |
| 444 | + | |
| 445 | + } | |
| 446 | + | |
| 447 | + // 隐藏弹出层mobal | |
| 448 | + $('#edit_station_mobal').modal('hide'); | |
| 449 | + | |
| 450 | + // 刷新站点数据 | |
| 451 | + PublicFunctions.clearRefresh(); | |
| 452 | + }); | |
| 453 | + } | |
| 454 | + }); | |
| 455 | + | |
| 456 | + // 站点序号值改变事件 | |
| 457 | + $('#stationrouteSelect').on('change',function() { | |
| 458 | + | |
| 459 | + var stationRValue = $('#stationrouteSelect').val(); | |
| 460 | + | |
| 461 | + if(stationRValue) { | |
| 462 | + | |
| 463 | + var tempStr = stationRValue.split('_'); | |
| 464 | + | |
| 465 | + console.log(tempStr); | |
| 466 | + | |
| 467 | + if(tempStr[1] == 'E') { | |
| 468 | + | |
| 469 | + $('#stationMarkSelect').val('E'); | |
| 470 | + | |
| 471 | + }else { | |
| 472 | + | |
| 473 | + $('#stationMarkSelect').val('Z'); | |
| 474 | + | |
| 475 | + } | |
| 476 | + | |
| 477 | + } | |
| 478 | + | |
| 479 | + }); | |
| 480 | + | |
| 481 | + | |
| 482 | + // 当站点类型为中途站或者终点站时,上一站点为必填项! | |
| 483 | + $.validator.addMethod("isStart", function(value,element) { | |
| 484 | + | |
| 485 | + var tel = false; | |
| 486 | + | |
| 487 | + var stationMarkV = $('#stationMarkSelect').val(); | |
| 488 | + | |
| 489 | + var stationrouteSelectV = $('#stationrouteSelect').val(); | |
| 490 | + | |
| 491 | + if(stationMarkV =='B'){ | |
| 492 | + | |
| 493 | + tel = true; | |
| 494 | + | |
| 495 | + return tel; | |
| 496 | + | |
| 497 | + }else if(stationMarkV =='Z' || stationMarkV =='E'){ | |
| 498 | + | |
| 499 | + | |
| 500 | + if(stationrouteSelectV!=''){ | |
| 501 | + | |
| 502 | + tel = true; | |
| 503 | + | |
| 504 | + return tel; | |
| 505 | + | |
| 506 | + } | |
| 507 | + | |
| 508 | + } | |
| 509 | + | |
| 510 | + return tel; | |
| 511 | + }, '当站点类型为中途站或者终点站时,上一站点为必填项!'); | |
| 512 | + | |
| 513 | + // 方向 | |
| 514 | + $.validator.addMethod("dirIs", function(value,element) { | |
| 515 | + | |
| 516 | + var tel = true; | |
| 517 | + | |
| 518 | + var stationMarkV = $('#stationdirSelect').val(); | |
| 519 | + | |
| 520 | + if(stationMarkV!=stationObj[0].stationRoutedirections){ | |
| 521 | + | |
| 522 | + tel = false; | |
| 523 | + | |
| 524 | + } | |
| 525 | + | |
| 526 | + return tel; | |
| 527 | + }, '方向必须一致!'); | |
| 528 | + | |
| 529 | +}); | |
| 530 | +</script> | |
| 0 | 531 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/edit_select.html
0 → 100644
| 1 | +<!-- 选择编辑站点方式弹出层mobal --> | |
| 2 | +<div class="modal fade" id="edit_select_mobal" tabindex="-1" role="basic" aria-hidden="true"> | |
| 3 | + | |
| 4 | + <div class="modal-dialog"> | |
| 5 | + | |
| 6 | + <div class="modal-content"> | |
| 7 | + | |
| 8 | + <!-- 弹出层标题title容器 --> | |
| 9 | + <div class="modal-header"> | |
| 10 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | |
| 11 | + <h4 class="modal-title">选择修改站点方式</h4> | |
| 12 | + </div> | |
| 13 | + | |
| 14 | + <!-- 弹出层主体内容容器 --> | |
| 15 | + <div class="modal-body"> | |
| 16 | + | |
| 17 | + <!-- START FORM 表单容器 --> | |
| 18 | + <form class="form-horizontal" action="/" method="post" id="edit_select" role="form"> | |
| 19 | + | |
| 20 | + <!-- 表单错误提示容器 --> | |
| 21 | + <div class="alert alert-danger display-hide" id="editSelectrequired"> | |
| 22 | + <button class="close" data-close="alert"></button> | |
| 23 | + 站点名称为必填项 | |
| 24 | + </div> | |
| 25 | + | |
| 26 | + <!-- 站点名称容器 --> | |
| 27 | + <div class="form-group" id="formRequ"> | |
| 28 | + <label class="col-md-3 control-label"><span class="required"> * </span>站点名称:</label> | |
| 29 | + <div class="col-md-9" id="errorInfo"> | |
| 30 | + <input type="text" class="form-control input-medium" id="stationNamebootboxInput" name="stationNamebootbox"> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + | |
| 34 | + <!-- 修改方式容器 --> | |
| 35 | + <div class="form-group"> | |
| 36 | + <label class="col-md-3 control-label">修改方式:</label> | |
| 37 | + <div class="col-md-9"> | |
| 38 | + <div class="icheck-list"> | |
| 39 | + <label> | |
| 40 | + <input type="radio" class="icheck" name="editselect" value=0> 重新绘制位置 | |
| 41 | + </label> | |
| 42 | + <label> | |
| 43 | + <input type="radio" class="icheck" name="editselect" value=1 checked> 编辑原始位置 | |
| 44 | + </label> | |
| 45 | + <!-- <label > | |
| 46 | + <input type="radio" class="icheck" name="editselect" value=2 > 选择引用 | |
| 47 | + </label> --> | |
| 48 | + </div> | |
| 49 | + </div> | |
| 50 | + </div> | |
| 51 | + | |
| 52 | + <!-- 修改方式说明容器 --> | |
| 53 | + <div class="form-group"> | |
| 54 | + <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50"> | |
| 55 | + <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 修改方式说明: </span></h5> | |
| 56 | + <p><span class="help-block" style="color:#1bbc9b;"> a)重新绘制位置:手动在地图上画出站点范围,然后双击鼠标右键保存.</span> </p> | |
| 57 | + <p><span class="help-block" style="color:#1bbc9b;"> b)编辑原始位置:编辑原始位置与站点信息.</span> </p> | |
| 58 | + <!-- <p><span class="help-block" style="color:#1bbc9b;"> c)选择引用:从系统中选择已有的站点进行引用.</span> </p> --> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </form> | |
| 62 | + | |
| 63 | + <!-- END FORM --> | |
| 64 | + | |
| 65 | + </div> | |
| 66 | + | |
| 67 | + <!-- 表单操作按钮容器 --> | |
| 68 | + <div class="modal-footer"> | |
| 69 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | |
| 70 | + <button type="button" class="btn btn-primary" id="editselectStationNextButton">下一步</button> | |
| 71 | + </div> | |
| 72 | + | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | +</div> | |
| 76 | +<script type="text/javascript"> | |
| 77 | + | |
| 78 | +$(function(){ | |
| 79 | + | |
| 80 | + // 显示选择修改方式弹出层 | |
| 81 | + $('#edit_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | |
| 82 | + | |
| 83 | + // 获取站点名称元素并赋值 | |
| 84 | + $('#stationNamebootboxInput').val(stationObj[0].stationName); | |
| 85 | + | |
| 86 | + // 定义站点图形类型 | |
| 87 | + var stationShapesTypeV = stationObj[0].stationShapesType; | |
| 88 | + | |
| 89 | + // 获取表单元素 | |
| 90 | + var form = $('#edit_select'); | |
| 91 | + | |
| 92 | + // 获取错误提示元素 | |
| 93 | + var editSelectrequired = $('#editSelectrequired', form); | |
| 94 | + | |
| 95 | + // 下一步操作事件 | |
| 96 | + $('#editselectStationNextButton').on('click', function() { | |
| 97 | + | |
| 98 | + // 表单提交 | |
| 99 | + form.submit(); | |
| 100 | + | |
| 101 | + }); | |
| 102 | + | |
| 103 | + //form 表单验证 | |
| 104 | + form.validate({ | |
| 105 | + | |
| 106 | + errorElement : 'span', | |
| 107 | + | |
| 108 | + errorClass : 'help-block help-block-error', | |
| 109 | + | |
| 110 | + focusInvalid : false, | |
| 111 | + | |
| 112 | + rules : { | |
| 113 | + | |
| 114 | + 'stationNamebootbox' : { | |
| 115 | + | |
| 116 | + minlength : 2, | |
| 117 | + | |
| 118 | + required : true, | |
| 119 | + | |
| 120 | + maxlength : 10 | |
| 121 | + | |
| 122 | + } | |
| 123 | + | |
| 124 | + }, | |
| 125 | + | |
| 126 | + invalidHandler : function(event, validator) { | |
| 127 | + | |
| 128 | + editSelectrequired.show(); | |
| 129 | + | |
| 130 | + App.scrollTo(requiredname, -200); | |
| 131 | + | |
| 132 | + }, | |
| 133 | + | |
| 134 | + highlight : function(element) { | |
| 135 | + | |
| 136 | + $(element).closest('.form-group').addClass('has-error'); | |
| 137 | + | |
| 138 | + }, | |
| 139 | + | |
| 140 | + unhighlight : function(element) { | |
| 141 | + | |
| 142 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 143 | + | |
| 144 | + }, | |
| 145 | + | |
| 146 | + success : function(label) { | |
| 147 | + | |
| 148 | + label.closest('.form-group').removeClass('has-error'); | |
| 149 | + | |
| 150 | + }, | |
| 151 | + | |
| 152 | + submitHandler : function(f) { | |
| 153 | + | |
| 154 | + // 隐藏弹出层 | |
| 155 | + $('#edit_select_mobal').modal('hide'); | |
| 156 | + | |
| 157 | + $('#eidt').attr("disabled",true); | |
| 158 | + | |
| 159 | + $('#eidt').addClass('btn disabled'); | |
| 160 | + | |
| 161 | + // 表单序列 | |
| 162 | + var params = form.serializeJSON(); | |
| 163 | + | |
| 164 | + // 站点名称 | |
| 165 | + var editStationName = params.stationNamebootbox; | |
| 166 | + | |
| 167 | + WorldsBMap.localSearchFromAdreesToPoint(editStationName,mapB,function(Points) { | |
| 168 | + | |
| 169 | + if(Points) { | |
| 170 | + | |
| 171 | + var BJwpointsArray = Points.split(' '); | |
| 172 | + | |
| 173 | + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | |
| 174 | + | |
| 175 | + var marker_stargt2 = new BMap.Marker(stationNameChangePoint); | |
| 176 | + | |
| 177 | + var PanOptions ={noAnimation :true}; | |
| 178 | + | |
| 179 | + mapB.panTo(stationNameChangePoint,PanOptions); | |
| 180 | + | |
| 181 | + mapB.panBy(0,-200); | |
| 182 | + | |
| 183 | + // 将标注添加到地图中 | |
| 184 | + mapB.addOverlay(marker_stargt2); | |
| 185 | + | |
| 186 | + //跳动的动画 | |
| 187 | + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | |
| 188 | + | |
| 189 | + } | |
| 190 | + | |
| 191 | + }); | |
| 192 | + | |
| 193 | + stationObj[0].stationName = editStationName; | |
| 194 | + | |
| 195 | + var eidtselect_ = params.editselect; | |
| 196 | + | |
| 197 | + if(eidtselect_==0){ | |
| 198 | + | |
| 199 | + WorldsBMap.drawingManagerOpen(); | |
| 200 | + | |
| 201 | + | |
| 202 | + }else if(eidtselect_==1){ | |
| 203 | + | |
| 204 | + // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | |
| 205 | + var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', | |
| 206 | + shift: 0,time: 10000}); | |
| 207 | + | |
| 208 | + // 关闭信息窗口 | |
| 209 | + marker.closeInfoWindow(); | |
| 210 | + | |
| 211 | + // 清除marker | |
| 212 | + mapB.removeOverlay(marker); | |
| 213 | + | |
| 214 | + // 编辑图形 | |
| 215 | + WorldsBMap.editShapes(stationShapesTypeV,mindex); | |
| 216 | + | |
| 217 | + }else if(eidtselect_==2){ | |
| 218 | + | |
| 219 | + // 系统引用 | |
| 220 | + $('#edit_select_mobal').modal('hide'); | |
| 221 | + | |
| 222 | + $.get('station_tabledate.html', function(m){$(pjaxContainer).append(m);}); | |
| 223 | + | |
| 224 | + } | |
| 225 | + | |
| 226 | + } | |
| 227 | + }); | |
| 228 | + | |
| 229 | +}); | |
| 230 | +</script> | |
| 0 | 231 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/js/add-form-wizard.js
0 → 100644
| 1 | + | |
| 2 | +/** | |
| 3 | + * 表单的导航向导、验证、提交 | |
| 4 | + * | |
| 5 | + */ | |
| 6 | + | |
| 7 | +var FormWizard = function() { | |
| 8 | + | |
| 9 | + return { | |
| 10 | + | |
| 11 | + // 启动初始化向导导航 | |
| 12 | + init : function() { | |
| 13 | + | |
| 14 | + if(!jQuery().bootstrapWizard) { | |
| 15 | + | |
| 16 | + return; | |
| 17 | + | |
| 18 | + } | |
| 19 | + | |
| 20 | + // 表单验证 | |
| 21 | + form.validate({ | |
| 22 | + | |
| 23 | + // 错误提示元素span对象 | |
| 24 | + errorElement : 'span', | |
| 25 | + | |
| 26 | + // 错误提示元素class名称 | |
| 27 | + errorClass : 'help-block help-block-error', | |
| 28 | + | |
| 29 | + // 验证错误获取焦点 | |
| 30 | + focusInvalid : true, | |
| 31 | + | |
| 32 | + // 需要验证的表单元素 | |
| 33 | + rules : { | |
| 34 | + | |
| 35 | + // 线路名称 | |
| 36 | + 'statinoNamebooxt' : { | |
| 37 | + | |
| 38 | + // 必填项 | |
| 39 | + required : true, | |
| 40 | + | |
| 41 | + // 最大长度 | |
| 42 | + maxlength: 20 | |
| 43 | + } | |
| 44 | + | |
| 45 | + | |
| 46 | + }, | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。 | |
| 50 | + * | |
| 51 | + * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator) | |
| 52 | + */ | |
| 53 | + invalidHandler : function(event, validator) { | |
| 54 | + | |
| 55 | + // 显示表单未通过提示信息 | |
| 56 | + error.show(); | |
| 57 | + | |
| 58 | + // 把提示信息放到指定的位置。 | |
| 59 | + App.scrollTo(error, -200); | |
| 60 | + }, | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 类型:Callback。 | |
| 64 | + * | |
| 65 | + * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。 | |
| 66 | + */ | |
| 67 | + highlight : function(element) { | |
| 68 | + | |
| 69 | + // 添加errorClass("has-error")到表单元素 | |
| 70 | + $(element).closest('.form-group').addClass('has-error'); | |
| 71 | + }, | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 类型:Callback。 | |
| 75 | + * | |
| 76 | + * 默认:移除errorClass("has-error")。与highlight操作相反 | |
| 77 | + */ | |
| 78 | + unhighlight : function(element) { | |
| 79 | + | |
| 80 | + // 移除errorClass("has-error") | |
| 81 | + $(element).closest('.form-group').removeClass('has-error'); | |
| 82 | + }, | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * 类型:String,Callback。 | |
| 86 | + * | |
| 87 | + * 如果指定它,当验证通过时显示一个消息。 | |
| 88 | + * | |
| 89 | + * 如果是String类型的,则添加该样式到标签中; | |
| 90 | + * | |
| 91 | + * 如果是一个回调函数,则将标签作为其唯一的参数。 | |
| 92 | + */ | |
| 93 | + success : function(label) { | |
| 94 | + | |
| 95 | + // 当验证通过时,移除errorClass("has-error") | |
| 96 | + label.closest('.form-group').removeClass('has-error'); | |
| 97 | + }, | |
| 98 | + | |
| 99 | + /** | |
| 100 | + * 类型:Callback。 | |
| 101 | + * | |
| 102 | + * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form | |
| 103 | + */ | |
| 104 | + submitHandler : function(f) { | |
| 105 | + | |
| 106 | + console.log('submit'); | |
| 107 | + | |
| 108 | + // 表单序列化 | |
| 109 | + var params = form.serializeJSON(); | |
| 110 | + | |
| 111 | + //保存站点 | |
| 112 | + PublicFunctions.stationSave(params,function(data) { | |
| 113 | + | |
| 114 | + if(data.status=='SUCCESS') { | |
| 115 | + | |
| 116 | + // 弹出添加成功提示消息 | |
| 117 | + layer.msg('添加成功...'); | |
| 118 | + | |
| 119 | + | |
| 120 | + }else { | |
| 121 | + | |
| 122 | + // 弹出添加失败提示消息 | |
| 123 | + layer.msg('添加失败...'); | |
| 124 | + | |
| 125 | + } | |
| 126 | + | |
| 127 | + // 返回list.html页面 | |
| 128 | + loadPage('list.html'); | |
| 129 | + | |
| 130 | + }); | |
| 131 | + | |
| 132 | + } | |
| 133 | + }); | |
| 134 | + | |
| 135 | + // 确认提交信息 | |
| 136 | + var displayConfirm = function() { | |
| 137 | + | |
| 138 | + // 遍历表单元素下的tab4的class名称为form-control-static | |
| 139 | + $('#tab4 .form-control-static', form).each(function(){ | |
| 140 | + | |
| 141 | + // 定义input | |
| 142 | + var input = $('[name="'+$(this).attr("data-display")+'"]', form); | |
| 143 | + | |
| 144 | + if (input.is(":radio")) { | |
| 145 | + | |
| 146 | + input = $('[name="'+$(this).attr("data-display")+'"]:checked', form); | |
| 147 | + | |
| 148 | + } | |
| 149 | + if (input.is(":text") || input.is("textarea")) { | |
| 150 | + | |
| 151 | + $(this).html(input.val()); | |
| 152 | + | |
| 153 | + } else if (input.is("select")) { | |
| 154 | + | |
| 155 | + $(this).html(input.find('option:selected').text()); | |
| 156 | + | |
| 157 | + } else if (input.is(":radio") && input.is(":checked")) { | |
| 158 | + | |
| 159 | + $(this).html(input.attr("data-title")); | |
| 160 | + | |
| 161 | + } else if ($(this).attr("data-display") == 'payment[]') { | |
| 162 | + | |
| 163 | + var payment = []; | |
| 164 | + | |
| 165 | + $('[name="payment[]"]:checked', form).each(function(){ | |
| 166 | + | |
| 167 | + payment.push($(this).attr('data-title')); | |
| 168 | + | |
| 169 | + }); | |
| 170 | + | |
| 171 | + $(this).html(payment.join("<br>")); | |
| 172 | + } | |
| 173 | + }); | |
| 174 | + } | |
| 175 | + | |
| 176 | + /** 按钮点击时触发 */ | |
| 177 | + var handleTitle = function(tab, navigation, index) { | |
| 178 | + | |
| 179 | + // 定义导航条标签个数 | |
| 180 | + var total = navigation.find('li').length; | |
| 181 | + | |
| 182 | + // 当前标签页 | |
| 183 | + var current = index + 1; | |
| 184 | + | |
| 185 | + // 设置向导标题 | |
| 186 | + $('.step-title', $('#form-wizard-info')).text((index + 1) + ' - ' + total); | |
| 187 | + | |
| 188 | + // 删除"done"样式 | |
| 189 | + jQuery('li', $('#form-wizard-info')).removeClass("done"); | |
| 190 | + | |
| 191 | + // 获取导航标签元素集合 | |
| 192 | + var li_list = navigation.find('li'); | |
| 193 | + | |
| 194 | + // 遍历 | |
| 195 | + for (var i = 0; i < index; i++) { | |
| 196 | + | |
| 197 | + // 追加done样式 | |
| 198 | + jQuery(li_list[i]).addClass("done"); | |
| 199 | + | |
| 200 | + } | |
| 201 | + | |
| 202 | + | |
| 203 | + /** 如果为第一步隐藏返回按钮,否则显示返回按钮. */ | |
| 204 | + if (current == 1) { | |
| 205 | + | |
| 206 | + // 隐藏返回按钮 | |
| 207 | + $('#submit_station_form').find('.button-previous').hide(); | |
| 208 | + | |
| 209 | + } else { | |
| 210 | + | |
| 211 | + // 显示返回按钮 | |
| 212 | + $('#submit_station_form').find('.button-previous').show(); | |
| 213 | + | |
| 214 | + } | |
| 215 | + | |
| 216 | + if (current == 2) { | |
| 217 | + | |
| 218 | + var baseResValue = $('#submit_station_form input[name="baseRes"]:checked').val(); | |
| 219 | + | |
| 220 | + var stationNameV = $('#statinoNamebooxtInput').val(); | |
| 221 | + | |
| 222 | + $('#stationNameInput').val(stationNameV); | |
| 223 | + | |
| 224 | + VmapWorlds.localSearchFromAdreesToPoint(stationNameV,mapB,function(Points) { | |
| 225 | + | |
| 226 | + if(Points) { | |
| 227 | + | |
| 228 | + var BJwpointsArray = Points.split(' '); | |
| 229 | + | |
| 230 | + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | |
| 231 | + | |
| 232 | + marker_stargt2 = new BMap.Marker(stationNameChangePoint); | |
| 233 | + | |
| 234 | + var PanOptions ={noAnimation :true}; | |
| 235 | + | |
| 236 | + mapB.panTo(stationNameChangePoint,PanOptions); | |
| 237 | + | |
| 238 | + mapB.panBy(0,100); | |
| 239 | + | |
| 240 | + // 将标注添加到地图中 | |
| 241 | + mapB.addOverlay(marker_stargt2); | |
| 242 | + | |
| 243 | + //跳动的动画 | |
| 244 | + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | |
| 245 | + | |
| 246 | + if(baseResValue == 0) { | |
| 247 | + | |
| 248 | + //创建圆 | |
| 249 | + circle = new BMap.Circle(stationNameChangePoint,150,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | |
| 250 | + | |
| 251 | + // 百度地图添加覆盖物圆 | |
| 252 | + mapB.addOverlay(circle); | |
| 253 | + | |
| 254 | + // 开启编辑功能 | |
| 255 | + circle.enableEditing(); | |
| 256 | + | |
| 257 | + // 编辑圆监听事件 | |
| 258 | + circle.addEventListener('remove',function() { | |
| 259 | + | |
| 260 | + // 清除marker | |
| 261 | + mapB.removeOverlay(marker_stargt2); | |
| 262 | + | |
| 263 | + // 返回圆形的半径,单位为米。 | |
| 264 | + var newRadius = circle.getRadius(); | |
| 265 | + | |
| 266 | + // 返回圆形的中心点坐标。 | |
| 267 | + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | |
| 268 | + | |
| 269 | + var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; | |
| 270 | + | |
| 271 | + // 中心百度坐标转WGS坐标 | |
| 272 | + PublicFunctions.getFormPointEToWGS(centre_New,function(p) { | |
| 273 | + | |
| 274 | + // 设置修改站点参数集合 | |
| 275 | + PublicFunctions.setFormInputValue(newCenter, p[0].WGSpotion.Lng , p[0].WGSpotion.Lat,'','','r',Math.round(newRadius)); | |
| 276 | + | |
| 277 | + }); | |
| 278 | + | |
| 279 | + }); | |
| 280 | + | |
| 281 | + }else if(baseResValue ==1) { | |
| 282 | + | |
| 283 | + VmapWorlds.drawingManagerOpen(mapB); | |
| 284 | + | |
| 285 | + }else if(baseResValue ==2) { | |
| 286 | + | |
| 287 | + | |
| 288 | + } | |
| 289 | + | |
| 290 | + } | |
| 291 | + | |
| 292 | + }); | |
| 293 | + | |
| 294 | + } | |
| 295 | + | |
| 296 | + if(current == 3){ | |
| 297 | + | |
| 298 | + mapB.clearOverlays(); | |
| 299 | + | |
| 300 | + circle = ''; | |
| 301 | + | |
| 302 | + drawingManager.close(); | |
| 303 | + | |
| 304 | + } | |
| 305 | + | |
| 306 | + /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */ | |
| 307 | + if (current >= total) { | |
| 308 | + | |
| 309 | + // 隐藏下一步按钮 | |
| 310 | + $('#submit_station_form').find('.button-next').hide(); | |
| 311 | + | |
| 312 | + // 显示提交按钮 | |
| 313 | + $('#submit_station_form').find('.button-submit').show(); | |
| 314 | + | |
| 315 | + // 确认提交信息 | |
| 316 | + displayConfirm(); | |
| 317 | + | |
| 318 | + } else { | |
| 319 | + | |
| 320 | + // 显示下一步按钮 | |
| 321 | + $('#submit_station_form').find('.button-next').show(); | |
| 322 | + | |
| 323 | + // 隐藏提交按钮 | |
| 324 | + $('#submit_station_form').find('.button-submit').hide(); | |
| 325 | + | |
| 326 | + } | |
| 327 | + | |
| 328 | + // 移动到指定位置 | |
| 329 | + App.scrollTo($('.page-title')); | |
| 330 | + | |
| 331 | + } | |
| 332 | + | |
| 333 | + // 表单导航向导插件 | |
| 334 | + $('#submit_station_form').bootstrapWizard({ | |
| 335 | + | |
| 336 | + // 下一步元素选择器 | |
| 337 | + 'nextSelector': '.button-next', | |
| 338 | + | |
| 339 | + // 返回元素选择器 | |
| 340 | + 'previousSelector': '.button-previous', | |
| 341 | + | |
| 342 | + /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */ | |
| 343 | + onTabClick: function (tab, navigation, index, clickedIndex) { | |
| 344 | + | |
| 345 | + success.hide(); | |
| 346 | + | |
| 347 | + error.hide(); | |
| 348 | + | |
| 349 | + if (form.valid() == false) { | |
| 350 | + | |
| 351 | + return false; | |
| 352 | + | |
| 353 | + } | |
| 354 | + | |
| 355 | + handleTitle(tab, navigation, clickedIndex); | |
| 356 | + | |
| 357 | + }, | |
| 358 | + | |
| 359 | + /** 下一步按钮被单击时触发, 返回移动到下一个步骤. */ | |
| 360 | + onNext: function (tab, navigation, index) { | |
| 361 | + | |
| 362 | + success.hide(); | |
| 363 | + | |
| 364 | + error.hide(); | |
| 365 | + | |
| 366 | + if (form.valid() == false) { | |
| 367 | + | |
| 368 | + return false; | |
| 369 | + | |
| 370 | + } | |
| 371 | + | |
| 372 | + mapB.clearOverlays(); | |
| 373 | + | |
| 374 | + circle = ''; | |
| 375 | + | |
| 376 | + drawingManager.close(); | |
| 377 | + | |
| 378 | + handleTitle(tab, navigation, index); | |
| 379 | + }, | |
| 380 | + | |
| 381 | + /** 上一步按钮被单击时触发,返回移动到前一个步骤 */ | |
| 382 | + onPrevious: function (tab, navigation, index) { | |
| 383 | + | |
| 384 | + success.hide(); | |
| 385 | + | |
| 386 | + error.hide(); | |
| 387 | + | |
| 388 | + mapB.clearOverlays(); | |
| 389 | + | |
| 390 | + circle = ''; | |
| 391 | + | |
| 392 | + drawingManager.close(); | |
| 393 | + | |
| 394 | + handleTitle(tab, navigation, index); | |
| 395 | + | |
| 396 | + }, | |
| 397 | + | |
| 398 | + /** 显示选项卡内容 */ | |
| 399 | + onTabShow: function (tab, navigation, index) { | |
| 400 | + | |
| 401 | + var total = navigation.find('li').length; | |
| 402 | + | |
| 403 | + var current = index + 1; | |
| 404 | + | |
| 405 | + var $percent = (current / total) * 100; | |
| 406 | + | |
| 407 | + $('#submit_station_form').find('.progress-bar').css({ | |
| 408 | + | |
| 409 | + width: $percent + '%' | |
| 410 | + | |
| 411 | + }); | |
| 412 | + | |
| 413 | + } | |
| 414 | + | |
| 415 | + }); | |
| 416 | + | |
| 417 | + // 初始化第一步隐藏返回按钮 | |
| 418 | + $('#submit_station_form').find('.button-previous').hide(); | |
| 419 | + | |
| 420 | + } | |
| 421 | + }; | |
| 422 | +}(); | ... | ... |
src/main/resources/static/pages/base/station/js/add-input-function.js
0 → 100644
| 1 | +/** | |
| 2 | + * 函数 | |
| 3 | + * | |
| 4 | + * - - - - - - - 》 getCurrSelNode : 获取选中树节点数据函数 | |
| 5 | + * | |
| 6 | + * - - - - - - - 》 resjtreeDate : 刷新树函数函数 | |
| 7 | + * | |
| 8 | + * - - - - - - - 》 setFormInputValue : 新增站点参数集合赋值函数 | |
| 9 | + * | |
| 10 | + * - - - - - - - 》 editSetStationParmas : 编辑站点参数集合赋值函数 | |
| 11 | + * | |
| 12 | + * - - - - - - - 》 editSeteditStationParmasValue:编辑站点范围图形参数集合赋值函数 | |
| 13 | + * | |
| 14 | + * - - - - - - - 》 lineNameIsHaveInterval : 系统规划时线路名称是否为区间 | |
| 15 | + * | |
| 16 | + * - - - - - - - 》 systemLineStation:系统规划保存函数 | |
| 17 | + * | |
| 18 | + * - - - - - - - 》 stationRevoke :撤销站点 | |
| 19 | + * | |
| 20 | + * - - - - - - - 》 editLinePlan :编辑线路走向 | |
| 21 | + * | |
| 22 | + * - - - - - - - 》 setFormValue :编辑站点设置表单元素值 | |
| 23 | + * | |
| 24 | + * - - - - - - - 》 eachSectionList:路段折线百度坐标转WGS坐标 | |
| 25 | + */ | |
| 26 | + | |
| 27 | +var PublicFunctions = function () { | |
| 28 | + | |
| 29 | + var PubFun = { | |
| 30 | + | |
| 31 | + // 原百度坐标转WGS坐标 | |
| 32 | + getFormPointEToWGS: function(points,callback) { | |
| 33 | + | |
| 34 | + // 获取长度 | |
| 35 | + var len = points.length; | |
| 36 | + | |
| 37 | + (function(){ | |
| 38 | + | |
| 39 | + if (!arguments.callee.count) { | |
| 40 | + | |
| 41 | + arguments.callee.count = 0; | |
| 42 | + | |
| 43 | + } | |
| 44 | + | |
| 45 | + arguments.callee.count++; | |
| 46 | + | |
| 47 | + var index = parseInt(arguments.callee.count) - 1; | |
| 48 | + | |
| 49 | + if (index >= len) { | |
| 50 | + | |
| 51 | + callback && callback(points); | |
| 52 | + | |
| 53 | + return; | |
| 54 | + } | |
| 55 | + | |
| 56 | + var f = arguments.callee; | |
| 57 | + | |
| 58 | + $.ajax({ | |
| 59 | + | |
| 60 | + url: 'http://api.zdoz.net/bd2wgs.aspx', | |
| 61 | + | |
| 62 | + data: {lat: points[index].potion.lat , lng: points[index].potion.lng}, | |
| 63 | + | |
| 64 | + dataType: 'jsonp', | |
| 65 | + | |
| 66 | + success: function(r){ | |
| 67 | + | |
| 68 | + if(r) { | |
| 69 | + | |
| 70 | + points[index].WGSpotion = r; | |
| 71 | + | |
| 72 | + } | |
| 73 | + | |
| 74 | + f(); | |
| 75 | + } | |
| 76 | + }); | |
| 77 | + | |
| 78 | + })(); | |
| 79 | + | |
| 80 | + }, | |
| 81 | + | |
| 82 | + /** @param points:中心点 ;gLonx:中心点WGS经度;gLaty:中心点WGS纬度;bPolygonGridValue:百度坐标点图形集合;gPolygonGridVlaue:WGS坐标点图形集合;shapesTypeValue:范围图形类型;radiusValue:圆半径 */ | |
| 83 | + setFormInputValue: function(points,gLonx,gLaty,bPolygonGridValue,gPolygonGridVlaue,shapesTypeValue,radiusValue) { | |
| 84 | + | |
| 85 | + // 百度地图经纬度坐标中心点 | |
| 86 | + $('#bJwpointsInput').val(points); | |
| 87 | + | |
| 88 | + // WGS经纬度 | |
| 89 | + $('#gJwpointsInput').val(gLonx + ' ' + gLaty); | |
| 90 | + | |
| 91 | + // 百度坐标点图形集合 | |
| 92 | + $('#bPolygonGridInput').val(bPolygonGridValue); | |
| 93 | + | |
| 94 | + // WGS坐标点图形集合 | |
| 95 | + $('#gPolygonGridInput').val(gPolygonGridVlaue); | |
| 96 | + | |
| 97 | + // 图形类型 | |
| 98 | + $('#shapesTypeSelect').val(shapesTypeValue); | |
| 99 | + | |
| 100 | + // 圆形半径 | |
| 101 | + $('#radiusInput').val(radiusValue); | |
| 102 | + | |
| 103 | + }, | |
| 104 | + | |
| 105 | + getLineAllInfo : function(cb) { | |
| 106 | + | |
| 107 | + // 填充公司下拉框选择值 | |
| 108 | + $get('/line/all', null, function(array){ | |
| 109 | + | |
| 110 | + return cb && cb(array); | |
| 111 | + | |
| 112 | + }); | |
| 113 | + | |
| 114 | + }, | |
| 115 | + | |
| 116 | + getStationRouteInfo : function(lineCode,callback) { | |
| 117 | + | |
| 118 | + $get('/stationroute/all',{'lineCode_eq':lineCode},function(result) { | |
| 119 | + | |
| 120 | + callback && callback(result); | |
| 121 | + | |
| 122 | + }); | |
| 123 | + | |
| 124 | + }, | |
| 125 | + | |
| 126 | + getStationCode : function(callback) { | |
| 127 | + | |
| 128 | + $get('/station/getStationCode',null,function(stationCode) { | |
| 129 | + | |
| 130 | + callback && callback(stationCode); | |
| 131 | + | |
| 132 | + }); | |
| 133 | + | |
| 134 | + }, | |
| 135 | + | |
| 136 | + // 新增站点保存 | |
| 137 | + stationSave : function(station,callback) { | |
| 138 | + | |
| 139 | + $post('/station/stationSave',station,function(data) { | |
| 140 | + | |
| 141 | + callback && callback(data); | |
| 142 | + | |
| 143 | + }); | |
| 144 | + | |
| 145 | + } | |
| 146 | + | |
| 147 | + } | |
| 148 | + | |
| 149 | + return PubFun ; | |
| 150 | + | |
| 151 | +}(); | |
| 0 | 152 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/js/add-vmap-world.js
0 → 100644
| 1 | +var VmapWorlds = function() { | |
| 2 | + | |
| 3 | + var Bmap = { | |
| 4 | + | |
| 5 | + init : function() { | |
| 6 | + | |
| 7 | + // 设置中心点, | |
| 8 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | |
| 9 | + | |
| 10 | + // 百度API Key | |
| 11 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | |
| 12 | + | |
| 13 | + // 初始化百度地图 | |
| 14 | + var map = new BMap.Map("bmap_basic"); | |
| 15 | + | |
| 16 | + //中心点和缩放级别 | |
| 17 | + map.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | |
| 18 | + | |
| 19 | + //启用地图拖拽事件,默认启用(可不写) | |
| 20 | + map.enableDragging(); | |
| 21 | + | |
| 22 | + //启用地图滚轮放大缩小 | |
| 23 | + map.enableScrollWheelZoom(); | |
| 24 | + | |
| 25 | + //禁用鼠标双击放大 | |
| 26 | + map.disableDoubleClickZoom(); | |
| 27 | + | |
| 28 | + //启用键盘上下左右键移动地图 | |
| 29 | + map.enableKeyboard(); | |
| 30 | + | |
| 31 | + var styleOptions = { | |
| 32 | + | |
| 33 | + //边线颜色。 | |
| 34 | + strokeColor : "blue", | |
| 35 | + | |
| 36 | + //填充颜色。当参数为空时,圆形将没有填充效果。 | |
| 37 | + fillColor : "blue", | |
| 38 | + | |
| 39 | + //边线的宽度,以像素为单位。 | |
| 40 | + strokeWeight : 3, | |
| 41 | + | |
| 42 | + //边线透明度,取值范围0 - 1。 | |
| 43 | + strokeOpacity : 0.8, | |
| 44 | + | |
| 45 | + //填充的透明度,取值范围0 - 1。 | |
| 46 | + fillOpacity : 0.6, | |
| 47 | + | |
| 48 | + //边线的样式,solid或dashed。 | |
| 49 | + strokeStyle : 'solid' | |
| 50 | + | |
| 51 | + }; | |
| 52 | + | |
| 53 | + // 创建鼠标绘制管理类 | |
| 54 | + drawingManager = new BMapLib.DrawingManager(map, { | |
| 55 | + | |
| 56 | + //是否开启绘制模式 | |
| 57 | + isOpen : false, | |
| 58 | + | |
| 59 | + //是否显示工具栏 | |
| 60 | + enableDrawingTool : false, | |
| 61 | + | |
| 62 | + drawingToolOptions : { | |
| 63 | + | |
| 64 | + //位置 | |
| 65 | + anchor : BMAP_ANCHOR_TOP_RIGHT, | |
| 66 | + | |
| 67 | + //偏离值 | |
| 68 | + offset : new BMap.Size(5, 5), | |
| 69 | + | |
| 70 | + //工具栏缩放比例 | |
| 71 | + scale : 0.8 | |
| 72 | + | |
| 73 | + }, | |
| 74 | + | |
| 75 | + //线的样式 | |
| 76 | + polygonOptions : styleOptions | |
| 77 | + | |
| 78 | + }); | |
| 79 | + | |
| 80 | + // 添加绘画完成事件 | |
| 81 | + drawingManager.addEventListener('polygoncomplete', function(e) { | |
| 82 | + | |
| 83 | + if (e.getPath().length <= 2) { | |
| 84 | + | |
| 85 | + // 弹出提示消息 | |
| 86 | + layer.msg('坐标点不能小于等于两个...'); | |
| 87 | + | |
| 88 | + // 清除地图覆盖物 | |
| 89 | + map.clearOverlays(); | |
| 90 | + | |
| 91 | + // 加载该线路下所有站点位置添加到地图上 | |
| 92 | + return false; | |
| 93 | + | |
| 94 | + }else { | |
| 95 | + | |
| 96 | + var pointE = e; | |
| 97 | + | |
| 98 | + // 多变行质心点 | |
| 99 | + var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; | |
| 100 | + | |
| 101 | + var PointsList = []; | |
| 102 | + | |
| 103 | + for ( var i = 0; i < pointE.getPath().length; i++) { | |
| 104 | + | |
| 105 | + PointsList.push({potion: {lng: pointE.getPath()[i].lng, lat: pointE.getPath()[i].lat}}); | |
| 106 | + | |
| 107 | + } | |
| 108 | + | |
| 109 | + PointsList.push({potion: {lng: pointE.getPath()[0].lng, lat: pointE.getPath()[0].lat}}); | |
| 110 | + | |
| 111 | + var centre = [{potion:{lng:pointE.getBounds().getCenter().lng,lat:pointE.getBounds().getCenter().lat}}]; | |
| 112 | + | |
| 113 | + PublicFunctions.getFormPointEToWGS(PointsList,function(resultdata) { | |
| 114 | + | |
| 115 | + var gPloygonGrid = ''; | |
| 116 | + | |
| 117 | + var bPloygonGrid = ''; | |
| 118 | + | |
| 119 | + for(var k =0;k<resultdata.length;k++) { | |
| 120 | + | |
| 121 | + if(k==0) { | |
| 122 | + | |
| 123 | + gPloygonGrid = resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 124 | + | |
| 125 | + bPloygonGrid = resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 126 | + | |
| 127 | + }else { | |
| 128 | + | |
| 129 | + gPloygonGrid = gPloygonGrid + ',' + resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 130 | + | |
| 131 | + bPloygonGrid = bPloygonGrid + ',' + resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 132 | + | |
| 133 | + } | |
| 134 | + | |
| 135 | + } | |
| 136 | + | |
| 137 | + gPloygonGrid = 'POLYGON((' + gPloygonGrid + '))'; | |
| 138 | + | |
| 139 | + bPloygonGrid = 'POLYGON((' + bPloygonGrid + '))'; | |
| 140 | + | |
| 141 | + PublicFunctions.getFormPointEToWGS(centre,function(p) { | |
| 142 | + | |
| 143 | + var gLonx = p[0].WGSpotion.Lng; | |
| 144 | + | |
| 145 | + var gLaty = p[0].WGSpotion.Lat; | |
| 146 | + | |
| 147 | + PublicFunctions.setFormInputValue(addSttationPoints_,gLonx,gLaty,bPloygonGrid,gPloygonGrid,'d',''); | |
| 148 | + | |
| 149 | + }); | |
| 150 | + | |
| 151 | + }); | |
| 152 | + | |
| 153 | + } | |
| 154 | + | |
| 155 | + }); | |
| 156 | + | |
| 157 | + return map; | |
| 158 | + }, | |
| 159 | + | |
| 160 | + // 根据地理名称获取百度经纬度坐标 | |
| 161 | + localSearchFromAdreesToPoint: function(Address,map,callback) { | |
| 162 | + | |
| 163 | + // 创建一个搜索类实例 | |
| 164 | + var localSearch = new BMap.LocalSearch(map); | |
| 165 | + | |
| 166 | + // 检索完成后的回调函数。 | |
| 167 | + localSearch.setSearchCompleteCallback(function (searchResult) { | |
| 168 | + | |
| 169 | + var resultPoints = ''; | |
| 170 | + | |
| 171 | + if(searchResult) { | |
| 172 | + | |
| 173 | + // 返回索引指定的结果。索引0表示第1条结果 | |
| 174 | + var poi = searchResult.getPoi(0); | |
| 175 | + | |
| 176 | + if(poi) { | |
| 177 | + | |
| 178 | + //获取经度和纬度 | |
| 179 | + resultPoints = poi.point.lng + ' ' + poi.point.lat; | |
| 180 | + | |
| 181 | + callback && callback(resultPoints); | |
| 182 | + | |
| 183 | + }else { | |
| 184 | + | |
| 185 | + callback && callback(false); | |
| 186 | + | |
| 187 | + } | |
| 188 | + | |
| 189 | + }else { | |
| 190 | + | |
| 191 | + callback && callback(false); | |
| 192 | + } | |
| 193 | + | |
| 194 | + }); | |
| 195 | + | |
| 196 | + // 根据检索词发起检索。 | |
| 197 | + localSearch.search(Address); | |
| 198 | + | |
| 199 | + }, | |
| 200 | + | |
| 201 | + // 打开绘画工具 | |
| 202 | + drawingManagerOpen : function(map) { | |
| 203 | + | |
| 204 | + // 打开鼠标绘画工具 | |
| 205 | + drawingManager.open(); | |
| 206 | + | |
| 207 | + // 设置属性 | |
| 208 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | |
| 209 | + | |
| 210 | + }, | |
| 211 | + | |
| 212 | + } | |
| 213 | + | |
| 214 | + return Bmap; | |
| 215 | + | |
| 216 | +}(); | |
| 0 | 217 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/js/station-positions-events.js
0 → 100644
| 1 | +$(function(){ | |
| 2 | + | |
| 3 | + // 返回 | |
| 4 | + $('#backUp').on('click',function() { | |
| 5 | + | |
| 6 | + // 获取返回元素并修改url地址 | |
| 7 | + $('#backUp').attr('href','list.html?'); | |
| 8 | + | |
| 9 | + }); | |
| 10 | + | |
| 11 | + // 修改上行站点mobal页面 | |
| 12 | + $('.dropdown-menu #eidt').on('click', function(){ | |
| 13 | + | |
| 14 | + $.get('edit_select.html', function(m){$(pjaxContainer).append(m);}); | |
| 15 | + | |
| 16 | + }); | |
| 17 | + | |
| 18 | +}); | |
| 0 | 19 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/js/station-positions-function.js
0 → 100644
| 1 | +/** | |
| 2 | + * 函数 | |
| 3 | + * | |
| 4 | + * - - - - - - - 》 getCurrSelNode : 获取选中树节点数据函数 | |
| 5 | + * | |
| 6 | + * - - - - - - - 》 resjtreeDate : 刷新树函数函数 | |
| 7 | + * | |
| 8 | + * - - - - - - - 》 setFormInputValue : 新增站点参数集合赋值函数 | |
| 9 | + * | |
| 10 | + * - - - - - - - 》 editSetStationParmas : 编辑站点参数集合赋值函数 | |
| 11 | + * | |
| 12 | + * - - - - - - - 》 editSeteditStationParmasValue:编辑站点范围图形参数集合赋值函数 | |
| 13 | + * | |
| 14 | + * - - - - - - - 》 lineNameIsHaveInterval : 系统规划时线路名称是否为区间 | |
| 15 | + * | |
| 16 | + * - - - - - - - 》 systemLineStation:系统规划保存函数 | |
| 17 | + * | |
| 18 | + * - - - - - - - 》 stationRevoke :撤销站点 | |
| 19 | + * | |
| 20 | + * - - - - - - - 》 editLinePlan :编辑线路走向 | |
| 21 | + * | |
| 22 | + * - - - - - - - 》 setFormValue :编辑站点设置表单元素值 | |
| 23 | + * | |
| 24 | + * - - - - - - - 》 eachSectionList:路段折线百度坐标转WGS坐标 | |
| 25 | + */ | |
| 26 | + | |
| 27 | +var PublicFunctions = function () { | |
| 28 | + | |
| 29 | + var PubFun = { | |
| 30 | + | |
| 31 | + initStationInfo : function() { | |
| 32 | + | |
| 33 | + PublicFunctions.getStationRouteInfo(function(r) { | |
| 34 | + | |
| 35 | + stationObj = r; | |
| 36 | + | |
| 37 | + var len = r.length; | |
| 38 | + | |
| 39 | + if(len>0) { | |
| 40 | + | |
| 41 | + var stationShapesType = r[0].stationShapesType; | |
| 42 | + | |
| 43 | + // 获取中心坐标点字符串分割 | |
| 44 | + var BJwpoints = r[0].stationJwpoints.split(' '); | |
| 45 | + | |
| 46 | + // 中心坐标点 | |
| 47 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | |
| 48 | + | |
| 49 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | |
| 50 | + '<span style="color:#DDD;font-size: 15px;">站点名称:' + r[0].stationName + '</span>' + | |
| 51 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + r[0].stationCode + '</span>' + | |
| 52 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + r[0].stationRouteCode + '</span>' + | |
| 53 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + r[0].stationJwpoints + '</span>' + | |
| 54 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].stationRadius + '</span>' + | |
| 55 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].stationRouteVersions + '</span>' + | |
| 56 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ 'ddd' +'" >说明/描述:' + 'ddd' + '</span>' ; | |
| 57 | + | |
| 58 | + // 信息窗口参数属性 | |
| 59 | + var opts = { | |
| 60 | + | |
| 61 | + // 信息窗口宽度 | |
| 62 | + width : 200, | |
| 63 | + | |
| 64 | + // 信息窗口高度 | |
| 65 | + height : 450, | |
| 66 | + | |
| 67 | + // 信息窗位置偏移值。 | |
| 68 | + offset: new BMap.Size(500,-80), | |
| 69 | + | |
| 70 | + //标题 | |
| 71 | + title : '<h4 style="color:#FFFFFF">'+r[0].stationName+'站详情</h4>', | |
| 72 | + | |
| 73 | + //设置不允许信窗发送短息 | |
| 74 | + enableMessage : false, | |
| 75 | + | |
| 76 | + //是否开启点击地图关闭信息窗口 | |
| 77 | + enableCloseOnClick : false, | |
| 78 | + | |
| 79 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | |
| 80 | + enableAutoPan:true | |
| 81 | + }; | |
| 82 | + | |
| 83 | + if(stationShapesType == 'r') { | |
| 84 | + | |
| 85 | + // 画圆 | |
| 86 | + PublicFunctions.pointsCircle(r,point,htm,opts,mapB); | |
| 87 | + | |
| 88 | + }else if(stationShapesType == 'd'){ | |
| 89 | + | |
| 90 | + // 画多边形 | |
| 91 | + PublicFunctions.pointsPolygon(r,point,htm,opts,mapB); | |
| 92 | + | |
| 93 | + } | |
| 94 | + | |
| 95 | + } | |
| 96 | + | |
| 97 | + }); | |
| 98 | + }, | |
| 99 | + | |
| 100 | + | |
| 101 | + editSeteditStationParmasValue : function(points,gLonx,gLaty,bPolygonGridValue,gPolygonGridVlaue,shapesTypeValue,radiusValue) { | |
| 102 | + | |
| 103 | + // 百度地图经纬度坐标中心点 | |
| 104 | + stationObj[0].stationJwpoints = points; | |
| 105 | + | |
| 106 | + // WGS经度 | |
| 107 | + stationObj[0].stationGlonx = gLonx; | |
| 108 | + | |
| 109 | + // WGS经度 | |
| 110 | + stationObj[0].gLaty = gLaty; | |
| 111 | + | |
| 112 | + // 百度坐标点图形集合 | |
| 113 | + stationObj[0].stationGPloyonGrid = bPolygonGridValue; | |
| 114 | + | |
| 115 | + // WGS坐标点图形集合 | |
| 116 | + stationObj[0].stationBPolyonGrid = gPolygonGridVlaue; | |
| 117 | + | |
| 118 | + // 图形类型 | |
| 119 | + stationObj[0].stationShapesType = shapesTypeValue; | |
| 120 | + | |
| 121 | + // 圆形半径 | |
| 122 | + stationObj[0].stationRadius = radiusValue; | |
| 123 | + | |
| 124 | + }, | |
| 125 | + | |
| 126 | + // 原百度坐标转WGS坐标 | |
| 127 | + getFormPointEToWGS: function(points,callback) { | |
| 128 | + | |
| 129 | + // 获取长度 | |
| 130 | + var len = points.length; | |
| 131 | + | |
| 132 | + (function(){ | |
| 133 | + | |
| 134 | + if (!arguments.callee.count) { | |
| 135 | + | |
| 136 | + arguments.callee.count = 0; | |
| 137 | + | |
| 138 | + } | |
| 139 | + | |
| 140 | + arguments.callee.count++; | |
| 141 | + | |
| 142 | + var index = parseInt(arguments.callee.count) - 1; | |
| 143 | + | |
| 144 | + if (index >= len) { | |
| 145 | + | |
| 146 | + callback && callback(points); | |
| 147 | + | |
| 148 | + return; | |
| 149 | + } | |
| 150 | + | |
| 151 | + var f = arguments.callee; | |
| 152 | + | |
| 153 | + $.ajax({ | |
| 154 | + | |
| 155 | + url: 'http://api.zdoz.net/bd2wgs.aspx', | |
| 156 | + | |
| 157 | + data: {lat: points[index].potion.lat , lng: points[index].potion.lng}, | |
| 158 | + | |
| 159 | + dataType: 'jsonp', | |
| 160 | + | |
| 161 | + success: function(r){ | |
| 162 | + | |
| 163 | + if(r) { | |
| 164 | + | |
| 165 | + points[index].WGSpotion = r; | |
| 166 | + | |
| 167 | + } | |
| 168 | + | |
| 169 | + f(); | |
| 170 | + } | |
| 171 | + }); | |
| 172 | + | |
| 173 | + })(); | |
| 174 | + | |
| 175 | + }, | |
| 176 | + | |
| 177 | + setFormValue : function() { | |
| 178 | + | |
| 179 | + // 站点ID | |
| 180 | + $('#stationIdInput').val(stationObj[0].stationId); | |
| 181 | + | |
| 182 | + // 站点路由ID | |
| 183 | + $('#stationRouteIdInput').val(stationObj[0].stationRouteId); | |
| 184 | + | |
| 185 | + // 站点路由线路Id | |
| 186 | + $('#stationRouteLineInput').val(stationObj[0].stationRouteLine); | |
| 187 | + | |
| 188 | + // 线路编码 | |
| 189 | + $('#lineCodeInput').val(stationObj[0].stationRouteLIneCode); | |
| 190 | + | |
| 191 | + // WGS坐标点图形集合 | |
| 192 | + $('#bPolygonGridInput').val(stationObj[0].stationBPolyonGrid); | |
| 193 | + | |
| 194 | + // 百度坐标点图形集合 | |
| 195 | + $('#gPolygonGridInput').val(stationObj[0].stationGPloyonGrid); | |
| 196 | + | |
| 197 | + // 获取站点名称元素设值 | |
| 198 | + $('#stationNameInput').val(stationObj[0].stationName); | |
| 199 | + | |
| 200 | + // 获取站点编码元素设值 | |
| 201 | + $('#stationCodInput').val(stationObj[0].stationCode); | |
| 202 | + | |
| 203 | + // 获取站点类型元素设值 | |
| 204 | + $('#stationMarkSelect').val(stationObj[0].stationRouteStationMark); | |
| 205 | + | |
| 206 | + // 获取站点方向元素设值 | |
| 207 | + $('#stationdirSelect').val(stationObj[0].stationRoutedirections); | |
| 208 | + | |
| 209 | + // 获取站点道路编码元素设值 | |
| 210 | + $('#roadCodingCodInput').val(stationObj[0].stationRoadCoding); | |
| 211 | + | |
| 212 | + // 百度地图经纬度坐标中心点 | |
| 213 | + $('#bJwpointsInput').val(stationObj[0].stationJwpoints); | |
| 214 | + | |
| 215 | + // WGS经纬度 | |
| 216 | + $('#gJwpointsInput').val(stationObj[0].stationGlonx + ' ' + stationObj[0].stationGlaty); | |
| 217 | + | |
| 218 | + // 获取图形类型元素,并添加值 | |
| 219 | + $('#shapesTypeSelect').val(stationObj[0].stationShapesType); | |
| 220 | + | |
| 221 | + // 获取半径元素,并添加值 | |
| 222 | + $('#radiusInput').val(stationObj[0].stationRadius); | |
| 223 | + | |
| 224 | + // 是否撤销 | |
| 225 | + $('#destroySelect').val(stationObj[0].stationRouteDestroy); | |
| 226 | + | |
| 227 | + // 到站时间 | |
| 228 | + $('#toTimeInput').val(stationObj[0].stationRouteToTime); | |
| 229 | + | |
| 230 | + // 到站距离 | |
| 231 | + $('#distancesInput').val(stationObj[0].stationRouteDistances); | |
| 232 | + | |
| 233 | + // 描述/说明 | |
| 234 | + $('#descriptionsTextarea').val(stationObj[0].stationRouteDescriptions); | |
| 235 | + | |
| 236 | + }, | |
| 237 | + | |
| 238 | + // 树数据获取 | |
| 239 | + getStation : function(id_,dir_,callback) { | |
| 240 | + | |
| 241 | + var treeDateJson = []; | |
| 242 | + | |
| 243 | + $get('/stationroute/findStations',{'line.id_eq' : id_ , 'directions_eq' : dir_},function(resultdata) { | |
| 244 | + | |
| 245 | + treeDateJson = createTreeData(resultdata); | |
| 246 | + | |
| 247 | + callback && callback(treeDateJson); | |
| 248 | + | |
| 249 | + }); | |
| 250 | + | |
| 251 | + }, | |
| 252 | + | |
| 253 | + findUpStationRouteCode : function(lineId,diraction,stationRouteCode,callback) { | |
| 254 | + | |
| 255 | + $get('/stationroute/findUpStationRouteCode',{lineId:lineId,direction:diraction,stationRouteCode:stationRouteCode},function(result) { | |
| 256 | + | |
| 257 | + callback && callback(result); | |
| 258 | + | |
| 259 | + }); | |
| 260 | + | |
| 261 | + }, | |
| 262 | + | |
| 263 | + getStationRouteInfo : function(callback){ | |
| 264 | + | |
| 265 | + $get('/stationroute/findStationRouteInfo',{id:id},function(r) { | |
| 266 | + | |
| 267 | + callback && callback(r); | |
| 268 | + | |
| 269 | + }); | |
| 270 | + | |
| 271 | + }, | |
| 272 | + | |
| 273 | + pointsPolygon : function(r,pointPolygon,htm,opts_polygon,map) { | |
| 274 | + | |
| 275 | + // 获取多边形坐标字符串 | |
| 276 | + var stationBPolygonGrid = r[0].stationBPolyonGrid; | |
| 277 | + | |
| 278 | + // 截取多边形坐标字符串 | |
| 279 | + var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); | |
| 280 | + | |
| 281 | + // 按逗号切割 | |
| 282 | + var pointPolygonArray = stationBPolygonGridStr.split(','); | |
| 283 | + | |
| 284 | + // 多边形坐标集合 | |
| 285 | + var polygonP = []; | |
| 286 | + | |
| 287 | + for(var v = 0;v<pointPolygonArray.length;v++) { | |
| 288 | + | |
| 289 | + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); | |
| 290 | + | |
| 291 | + } | |
| 292 | + | |
| 293 | + // 画多边形 | |
| 294 | + polygon = new BMap.Polygon(polygonP, { | |
| 295 | + | |
| 296 | + // 线条显色 | |
| 297 | + strokeColor : "blue", | |
| 298 | + | |
| 299 | + // 边线的宽度,以像素为单位。 | |
| 300 | + strokeWeight : 2, | |
| 301 | + | |
| 302 | + // 边线透明度,取值范围0 - 1。 | |
| 303 | + strokeOpacity : 0.5 | |
| 304 | + }); | |
| 305 | + | |
| 306 | + // 增加地图覆盖物多边形 | |
| 307 | + map.addOverlay(polygon); | |
| 308 | + | |
| 309 | + // 创建信息窗口 | |
| 310 | + infoWindow = new BMap.InfoWindow(htm, opts_polygon); | |
| 311 | + | |
| 312 | + // 自定义标注物图片 | |
| 313 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | |
| 314 | + | |
| 315 | + // 创建点 | |
| 316 | + marker = new BMap.Marker(pointPolygon,{icon : icon_target}); | |
| 317 | + | |
| 318 | + // 把标注添物加到地图上 | |
| 319 | + map.addOverlay(marker); | |
| 320 | + | |
| 321 | + // 是否在平移过程中禁止动画。(自1.2新增) | |
| 322 | + var PanOptions_ ={noAnimation :true}; | |
| 323 | + | |
| 324 | + // 将地图的中心点更改为给定的点。 | |
| 325 | + map.panTo(pointPolygon,PanOptions_); | |
| 326 | + | |
| 327 | + // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | |
| 328 | + map.panBy(10,110,PanOptions_); | |
| 329 | + | |
| 330 | + //开启信息窗口 | |
| 331 | + marker.openInfoWindow(infoWindow,pointPolygon); | |
| 332 | + | |
| 333 | + }, | |
| 334 | + | |
| 335 | + pointsCircle : function(r,point,htm,opts,map) { | |
| 336 | + | |
| 337 | + //创建圆 | |
| 338 | + circle = new BMap.Circle(point,r[0].stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | |
| 339 | + | |
| 340 | + // 允许覆盖物在map.clearOverlays方法中被清除 | |
| 341 | + circle.enableMassClear(); | |
| 342 | + | |
| 343 | + // 百度地图添加覆盖物圆 | |
| 344 | + map.addOverlay(circle); | |
| 345 | + | |
| 346 | + // 创建信息窗口 | |
| 347 | + infoWindow = new BMap.InfoWindow(htm, opts); | |
| 348 | + | |
| 349 | + // 自定义标注物图片 | |
| 350 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | |
| 351 | + | |
| 352 | + // 创建点 | |
| 353 | + marker = new BMap.Marker(point,{icon : icon_target}); | |
| 354 | + | |
| 355 | + // 把标注添物加到地图上 | |
| 356 | + map.addOverlay(marker); | |
| 357 | + | |
| 358 | + setTimeout(function(){ | |
| 359 | + //开启信息窗口 | |
| 360 | + marker.openInfoWindow(infoWindow,point); | |
| 361 | + | |
| 362 | + },100); | |
| 363 | + | |
| 364 | + // 是否在平移过程中禁止动画。(自1.2新增) | |
| 365 | + var PanOptions_ ={noAnimation :true}; | |
| 366 | + | |
| 367 | + // 将地图的中心点更改为给定的点。 | |
| 368 | + map.panTo(point,PanOptions_); | |
| 369 | + | |
| 370 | + //map.panBy(10,-50,PanOptions_); | |
| 371 | + | |
| 372 | + // 添加标志物监听事件 | |
| 373 | + marker.addEventListener("click",function() { | |
| 374 | + | |
| 375 | + //开启信息窗口 | |
| 376 | + marker.openInfoWindow(infoWindow,point); | |
| 377 | + | |
| 378 | + }); | |
| 379 | + }, | |
| 380 | + | |
| 381 | + // 站点更新 | |
| 382 | + stationUpdate : function(station,callback) { | |
| 383 | + | |
| 384 | + $post('/station/stationUpdate',station,function(data) { | |
| 385 | + | |
| 386 | + callback && callback(data); | |
| 387 | + | |
| 388 | + }); | |
| 389 | + | |
| 390 | + }, | |
| 391 | + | |
| 392 | + clearRefresh : function() { | |
| 393 | + | |
| 394 | + // 清楚地图覆盖物 | |
| 395 | + mapB.clearOverlays(); | |
| 396 | + | |
| 397 | + $('#eidt').attr("disabled",false); | |
| 398 | + | |
| 399 | + $('#eidt').removeClass('btn disabled'); | |
| 400 | + | |
| 401 | + $('#eidt').addClass('btn'); | |
| 402 | + | |
| 403 | + stationObj=''; | |
| 404 | + | |
| 405 | + PublicFunctions.initStationInfo(); | |
| 406 | + | |
| 407 | + } | |
| 408 | + } | |
| 409 | + | |
| 410 | + return PubFun ; | |
| 411 | + | |
| 412 | +}(); | |
| 0 | 413 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/js/station-positions-map.js
0 → 100644
| 1 | +/** | |
| 2 | + * 百度地图 | |
| 3 | + * | |
| 4 | + */ | |
| 5 | + | |
| 6 | +var WorldsBMap = function () { | |
| 7 | + | |
| 8 | + var Bmap = { | |
| 9 | + | |
| 10 | + init : function() { | |
| 11 | + | |
| 12 | + // 关闭左侧栏 | |
| 13 | + if (!$('body').hasClass('page-sidebar-closed')) { | |
| 14 | + | |
| 15 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 16 | + | |
| 17 | + } | |
| 18 | + | |
| 19 | + // 设置中心点, | |
| 20 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | |
| 21 | + | |
| 22 | + // 百度API Key | |
| 23 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | |
| 24 | + | |
| 25 | + // 初始化百度地图 | |
| 26 | + var map = new BMap.Map("bmap_basic"); | |
| 27 | + | |
| 28 | + //中心点和缩放级别 | |
| 29 | + map.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | |
| 30 | + | |
| 31 | + //启用地图拖拽事件,默认启用(可不写) | |
| 32 | + map.enableDragging(); | |
| 33 | + | |
| 34 | + //启用地图滚轮放大缩小 | |
| 35 | + map.enableScrollWheelZoom(); | |
| 36 | + | |
| 37 | + //禁用鼠标双击放大 | |
| 38 | + map.disableDoubleClickZoom(); | |
| 39 | + | |
| 40 | + //启用键盘上下左右键移动地图 | |
| 41 | + map.enableKeyboard(); | |
| 42 | + | |
| 43 | + var styleOptions = { | |
| 44 | + | |
| 45 | + //边线颜色。 | |
| 46 | + strokeColor : "blue", | |
| 47 | + | |
| 48 | + //填充颜色。当参数为空时,圆形将没有填充效果。 | |
| 49 | + fillColor : "blue", | |
| 50 | + | |
| 51 | + //边线的宽度,以像素为单位。 | |
| 52 | + strokeWeight : 3, | |
| 53 | + | |
| 54 | + //边线透明度,取值范围0 - 1。 | |
| 55 | + strokeOpacity : 0.8, | |
| 56 | + | |
| 57 | + //填充的透明度,取值范围0 - 1。 | |
| 58 | + fillOpacity : 0.6, | |
| 59 | + | |
| 60 | + //边线的样式,solid或dashed。 | |
| 61 | + strokeStyle : 'solid' | |
| 62 | + | |
| 63 | + }; | |
| 64 | + | |
| 65 | + // 创建鼠标绘制管理类 | |
| 66 | + drawingManager = new BMapLib.DrawingManager(map, { | |
| 67 | + | |
| 68 | + //是否开启绘制模式 | |
| 69 | + isOpen : false, | |
| 70 | + | |
| 71 | + //是否显示工具栏 | |
| 72 | + enableDrawingTool : false, | |
| 73 | + | |
| 74 | + drawingToolOptions : { | |
| 75 | + | |
| 76 | + //位置 | |
| 77 | + anchor : BMAP_ANCHOR_TOP_RIGHT, | |
| 78 | + | |
| 79 | + //偏离值 | |
| 80 | + offset : new BMap.Size(5, 5), | |
| 81 | + | |
| 82 | + //工具栏缩放比例 | |
| 83 | + scale : 0.8 | |
| 84 | + | |
| 85 | + }, | |
| 86 | + | |
| 87 | + //线的样式 | |
| 88 | + polygonOptions : styleOptions | |
| 89 | + | |
| 90 | + }); | |
| 91 | + | |
| 92 | + // 添加绘画完成事件 | |
| 93 | + drawingManager.addEventListener('polygoncomplete', function(e) { | |
| 94 | + | |
| 95 | + drawingManager.close(); | |
| 96 | + | |
| 97 | + if (e.getPath().length <= 2) { | |
| 98 | + | |
| 99 | + // 弹出提示消息 | |
| 100 | + layer.msg('坐标点不能小于等于两个...'); | |
| 101 | + | |
| 102 | + // 清除地图覆盖物 | |
| 103 | + map.clearOverlays(); | |
| 104 | + | |
| 105 | + // 加载该线路下所有站点位置添加到地图上 | |
| 106 | + return false; | |
| 107 | + | |
| 108 | + }else { | |
| 109 | + | |
| 110 | + var pointE = e; | |
| 111 | + | |
| 112 | + // 多变行质心点 | |
| 113 | + var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; | |
| 114 | + | |
| 115 | + var PointsList = []; | |
| 116 | + | |
| 117 | + for ( var i = 0; i < pointE.getPath().length; i++) { | |
| 118 | + | |
| 119 | + PointsList.push({potion: {lng: pointE.getPath()[i].lng, lat: pointE.getPath()[i].lat}}); | |
| 120 | + | |
| 121 | + } | |
| 122 | + | |
| 123 | + PointsList.push({potion: {lng: pointE.getPath()[0].lng, lat: pointE.getPath()[0].lat}}); | |
| 124 | + | |
| 125 | + var centre = [{potion:{lng:pointE.getBounds().getCenter().lng,lat:pointE.getBounds().getCenter().lat}}]; | |
| 126 | + | |
| 127 | + PublicFunctions.getFormPointEToWGS(PointsList,function(resultdata) { | |
| 128 | + | |
| 129 | + var gPloygonGrid = ''; | |
| 130 | + | |
| 131 | + var bPloygonGrid = ''; | |
| 132 | + | |
| 133 | + for(var k =0;k<resultdata.length;k++) { | |
| 134 | + | |
| 135 | + if(k==0) { | |
| 136 | + | |
| 137 | + gPloygonGrid = resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 138 | + | |
| 139 | + bPloygonGrid = resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 140 | + | |
| 141 | + }else { | |
| 142 | + | |
| 143 | + gPloygonGrid = gPloygonGrid + ',' + resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 144 | + | |
| 145 | + bPloygonGrid = bPloygonGrid + ',' + resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 146 | + | |
| 147 | + } | |
| 148 | + | |
| 149 | + } | |
| 150 | + | |
| 151 | + gPloygonGrid = 'POLYGON((' + gPloygonGrid + '))'; | |
| 152 | + | |
| 153 | + bPloygonGrid = 'POLYGON((' + bPloygonGrid + '))'; | |
| 154 | + | |
| 155 | + PublicFunctions.getFormPointEToWGS(centre,function(p) { | |
| 156 | + | |
| 157 | + var gLonx = p[0].WGSpotion.Lng; | |
| 158 | + | |
| 159 | + var gLaty = p[0].WGSpotion.Lat; | |
| 160 | + | |
| 161 | + PublicFunctions.editSeteditStationParmasValue(addSttationPoints_,gLonx,gLaty,bPloygonGrid,gPloygonGrid,'d',''); | |
| 162 | + | |
| 163 | + $.get('edit.html', function(m){$(pjaxContainer).append(m);}); | |
| 164 | + | |
| 165 | + }); | |
| 166 | + | |
| 167 | + }); | |
| 168 | + } | |
| 169 | + | |
| 170 | + }); | |
| 171 | + | |
| 172 | + return map; | |
| 173 | + }, | |
| 174 | + | |
| 175 | + // 打开绘画工具 | |
| 176 | + drawingManagerOpen : function() { | |
| 177 | + | |
| 178 | + // 清楚地图覆盖物 | |
| 179 | + mapB.clearOverlays(); | |
| 180 | + | |
| 181 | + // 打开鼠标绘画工具 | |
| 182 | + drawingManager.open(); | |
| 183 | + | |
| 184 | + // 设置属性 | |
| 185 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); | |
| 186 | + | |
| 187 | + }, | |
| 188 | + | |
| 189 | + // 编辑图形 | |
| 190 | + editShapes : function(stationShapesTypeV,mindex) { | |
| 191 | + | |
| 192 | + // 编辑圆 | |
| 193 | + if(stationShapesTypeV =='r') { | |
| 194 | + | |
| 195 | + // 开启编辑功能 | |
| 196 | + circle.enableEditing(); | |
| 197 | + | |
| 198 | + // 编辑圆监听事件 | |
| 199 | + circle.addEventListener('dblclick',function() { | |
| 200 | + | |
| 201 | + // 关闭提示弹出层 | |
| 202 | + layer.close(mindex); | |
| 203 | + | |
| 204 | + // 返回圆形的半径,单位为米。 | |
| 205 | + var newRadius = circle.getRadius(); | |
| 206 | + | |
| 207 | + // 返回圆形的中心点坐标。 | |
| 208 | + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | |
| 209 | + | |
| 210 | + var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; | |
| 211 | + | |
| 212 | + // 中心百度坐标转WGS坐标 | |
| 213 | + PublicFunctions.getFormPointEToWGS(centre_New,function(p) { | |
| 214 | + | |
| 215 | + // 设置修改站点参数集合 | |
| 216 | + PublicFunctions.editSeteditStationParmasValue(newCenter, p[0].WGSpotion.Lng , p[0].WGSpotion.Lat,'','','r',Math.round(newRadius)); | |
| 217 | + | |
| 218 | + // 加载编辑页面 | |
| 219 | + $.get('edit.html', function(m){$(pjaxContainer).append(m);}); | |
| 220 | + | |
| 221 | + }); | |
| 222 | + | |
| 223 | + }); | |
| 224 | + | |
| 225 | + // 编辑多变行 | |
| 226 | + }else if(stationShapesTypeV =='d') { | |
| 227 | + | |
| 228 | + // 开启编辑功能(自 1.1 新增) | |
| 229 | + polygon.enableEditing(); | |
| 230 | + | |
| 231 | + // 添加多变行编辑事件 | |
| 232 | + polygon.addEventListener('dblclick',function(e) { | |
| 233 | + | |
| 234 | + // 获取编辑的多边形对象 | |
| 235 | + var edit_pointE = polygon; | |
| 236 | + | |
| 237 | + // 多边形坐标点集合 | |
| 238 | + var eidt_PointsList = []; | |
| 239 | + | |
| 240 | + for ( var i = 0; i < edit_pointE.getPath().length; i++) { | |
| 241 | + | |
| 242 | + eidt_PointsList.push({potion: {lng: edit_pointE.getPath()[i].lng, lat: edit_pointE.getPath()[i].lat}}); | |
| 243 | + | |
| 244 | + } | |
| 245 | + | |
| 246 | + eidt_PointsList.push({potion: {lng: edit_pointE.getPath()[0].lng, lat: edit_pointE.getPath()[0].lat}}); | |
| 247 | + | |
| 248 | + var edit_centre = [{potion:{lng:edit_pointE.getBounds().getCenter().lng,lat:edit_pointE.getBounds().getCenter().lat}}]; | |
| 249 | + | |
| 250 | + // 多边形中心点 | |
| 251 | + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | |
| 252 | + | |
| 253 | + // 多边形坐标点集合转WGS坐标 | |
| 254 | + PublicFunctions.getFormPointEToWGS(eidt_PointsList,function(resultdata) { | |
| 255 | + | |
| 256 | + // 多边形WGS坐标字符串 | |
| 257 | + var eidt_gPloygonGrid = ''; | |
| 258 | + | |
| 259 | + // 百度坐标字符串 | |
| 260 | + var edit_bPloygonGrid = ''; | |
| 261 | + | |
| 262 | + for(var k =0;k<resultdata.length;k++) { | |
| 263 | + | |
| 264 | + if(k==0) { | |
| 265 | + | |
| 266 | + eidt_gPloygonGrid = resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 267 | + | |
| 268 | + edit_bPloygonGrid = resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 269 | + | |
| 270 | + }else { | |
| 271 | + | |
| 272 | + eidt_gPloygonGrid = eidt_gPloygonGrid + ',' + resultdata[k].WGSpotion.Lng + ' ' +resultdata[k].WGSpotion.Lat; | |
| 273 | + | |
| 274 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + resultdata[k].potion.lng + ' ' +resultdata[k].potion.lat; | |
| 275 | + | |
| 276 | + } | |
| 277 | + | |
| 278 | + } | |
| 279 | + | |
| 280 | + eidt_gPloygonGrid = 'POLYGON((' + eidt_gPloygonGrid + '))'; | |
| 281 | + | |
| 282 | + edit_bPloygonGrid = 'POLYGON((' + edit_bPloygonGrid + '))'; | |
| 283 | + | |
| 284 | + // 中心点坐标转WGS坐标 | |
| 285 | + PublicFunctions.getFormPointEToWGS(edit_centre,function(p) { | |
| 286 | + | |
| 287 | + var edit_gLonx = p[0].WGSpotion.Lng; | |
| 288 | + | |
| 289 | + var edit_gLaty = p[0].WGSpotion.Lat; | |
| 290 | + | |
| 291 | + // 设置编辑站点参宿集合 | |
| 292 | + PublicFunctions.editSeteditStationParmasValue(centre_points,edit_gLonx,edit_gLaty,edit_bPloygonGrid,eidt_gPloygonGrid,'d',''); | |
| 293 | + | |
| 294 | + // 加载编辑页面 | |
| 295 | + $.get('edit.html', function(m){$(pjaxContainer).append(m);}); | |
| 296 | + | |
| 297 | + }); | |
| 298 | + | |
| 299 | + }); | |
| 300 | + | |
| 301 | + | |
| 302 | + }); | |
| 303 | + | |
| 304 | + } | |
| 305 | + | |
| 306 | + }, | |
| 307 | + | |
| 308 | + localSearchFromAdreesToPoint: function(Address,map,callback) { | |
| 309 | + | |
| 310 | + // 创建一个搜索类实例 | |
| 311 | + var localSearch = new BMap.LocalSearch(map); | |
| 312 | + | |
| 313 | + // 检索完成后的回调函数。 | |
| 314 | + localSearch.setSearchCompleteCallback(function (searchResult) { | |
| 315 | + | |
| 316 | + var resultPoints = ''; | |
| 317 | + | |
| 318 | + if(searchResult) { | |
| 319 | + | |
| 320 | + // 返回索引指定的结果。索引0表示第1条结果 | |
| 321 | + var poi = searchResult.getPoi(0); | |
| 322 | + | |
| 323 | + if(poi) { | |
| 324 | + | |
| 325 | + //获取经度和纬度 | |
| 326 | + resultPoints = poi.point.lng + ' ' + poi.point.lat; | |
| 327 | + | |
| 328 | + callback && callback(resultPoints); | |
| 329 | + | |
| 330 | + }else { | |
| 331 | + | |
| 332 | + callback && callback(false); | |
| 333 | + | |
| 334 | + } | |
| 335 | + | |
| 336 | + }else { | |
| 337 | + | |
| 338 | + callback && callback(false); | |
| 339 | + } | |
| 340 | + | |
| 341 | + }); | |
| 342 | + | |
| 343 | + // 根据检索词发起检索。 | |
| 344 | + localSearch.search(Address); | |
| 345 | + | |
| 346 | + } | |
| 347 | + | |
| 348 | + } | |
| 349 | + | |
| 350 | + return Bmap; | |
| 351 | + | |
| 352 | +}(); | |
| 0 | 353 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/js/station-positions-reload.js
0 → 100644
| 1 | +/** | |
| 2 | + * | |
| 3 | + * @JSName : list.js(站点信息定位positions.html页面js) | |
| 4 | + * | |
| 5 | + * @Author : bsth@lq | |
| 6 | + * | |
| 7 | + * @Description : TODO(站点信息定位positions.html页面js) | |
| 8 | + * | |
| 9 | + * @Data : 2016年4月28日 上午9:21:17 | |
| 10 | + * | |
| 11 | + * @Version 公交调度系统BS版 0.1 | |
| 12 | + * | |
| 13 | + */ | |
| 14 | + | |
| 15 | +(function(){ | |
| 16 | + | |
| 17 | + // 获取参数线路ID | |
| 18 | + id = $.url().param('no'); | |
| 19 | + | |
| 20 | + // 等候500毫秒执行 | |
| 21 | + setTimeout(function(){ | |
| 22 | + | |
| 23 | + // 地图初始化 | |
| 24 | + mapB = WorldsBMap.init(); | |
| 25 | + | |
| 26 | + PublicFunctions.initStationInfo(); | |
| 27 | + | |
| 28 | + },200); | |
| 29 | + | |
| 30 | +})(); | |
| 0 | 31 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/station/positions.html
0 → 100644
| 1 | +<link href="/pages/base/station/css/positions.css" rel="stylesheet" type="text/css" /> | |
| 2 | + | |
| 3 | +<!-- 地图容器 --> | |
| 4 | +<div id="bmap_basic"></div> | |
| 5 | + | |
| 6 | +<!-- 操作工具容器disabled --> | |
| 7 | +<div class="leftUtils"> | |
| 8 | + <div class="btn-group" style="left: 100px;"> | |
| 9 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具 | |
| 10 | + <i class="fa fa-angle-down"></i> | |
| 11 | + </a> | |
| 12 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | |
| 13 | + <li> | |
| 14 | + <a href="javascript:;" class="btn" id="eidt"><i class="fa fa-pencil"></i> 修改 </a> | |
| 15 | + </li> | |
| 16 | + <li> | |
| 17 | + <a href="javascript:;" class="btn" id = "backUp"> <i class="fa fa-reply"></i> 返回 </a> | |
| 18 | + </li> | |
| 19 | + | |
| 20 | + </ul> | |
| 21 | + </div> | |
| 22 | +</div> | |
| 23 | +<script type="text/javascript"> | |
| 24 | + | |
| 25 | + /** 定义全局变量 */ | |
| 26 | + | |
| 27 | + /** stationObj:站点信息对象;drawingManager:绘制工具对象;mapB:地图对象:circle:圆对象;polygon:多边形对象 */ | |
| 28 | + var stationObj = '', drawingManager= '', mapB = '',circle = '',polygon = ''; | |
| 29 | + | |
| 30 | + /** marker:覆盖物对象;infoWindow:信息窗口对象;Id:站点ID */ | |
| 31 | + var marker = '',infoWindow = '',id = ''; | |
| 32 | + | |
| 33 | +</script> | |
| 34 | + | |
| 35 | +<!-- 地图JS类库 --> | |
| 36 | +<script src="/pages/base/station/js/station-positions-map.js"></script> | |
| 37 | + | |
| 38 | +<!-- 方法JS类库 --> | |
| 39 | +<script src="/pages/base/station/js/station-positions-function.js"></script> | |
| 40 | + | |
| 41 | +<!-- reloadJS类库 --> | |
| 42 | +<script src="/pages/base/station/js/station-positions-reload.js"></script> | |
| 43 | + | |
| 44 | +<!-- 事件JS类库 --> | |
| 45 | +<script src="/pages/base/station/js/station-positions-events.js"></script> | |
| 0 | 46 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/stationroute/css/img/back1.png
0 → 100644
979 Bytes