Commit d7f05956a0222170fd51d03c7fb1e3ac7d61a502
1 parent
460b9760
基础信息功能修订
Showing
26 changed files
with
607 additions
and
1451 deletions
src/main/java/com/bsth/controller/CarParkController.java
| ... | ... | @@ -15,7 +15,6 @@ import org.springframework.web.bind.annotation.*; |
| 15 | 15 | @RestController |
| 16 | 16 | @RequestMapping("carpark") |
| 17 | 17 | public class CarParkController extends BaseController<CarPark, Integer> { |
| 18 | - | |
| 19 | 18 | @Autowired |
| 20 | 19 | CarParkService service; |
| 21 | 20 | |
| ... | ... | @@ -26,16 +25,10 @@ public class CarParkController extends BaseController<CarPark, Integer> { |
| 26 | 25 | */ |
| 27 | 26 | @RequestMapping(value="getCarParkCode" , method = RequestMethod.GET) |
| 28 | 27 | public Map<String, Object> getStationCode() { |
| 29 | - | |
| 30 | 28 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 31 | - | |
| 32 | - resultMap.put("carParkCode", "FFFF" + GetUIDAndCode.getCarParkId()); | |
| 33 | - | |
| 29 | + resultMap.put("carParkCode", "FFFFFF" + GetUIDAndCode.getCarParkId()); | |
| 34 | 30 | return resultMap; |
| 35 | - | |
| 36 | 31 | } |
| 37 | - | |
| 38 | - | |
| 39 | 32 | /** |
| 40 | 33 | * 新增停车场信息 |
| 41 | 34 | * |
| ... | ... | @@ -53,21 +46,14 @@ public class CarParkController extends BaseController<CarPark, Integer> { |
| 53 | 46 | */ |
| 54 | 47 | @RequestMapping(value="carParkSave" , method = RequestMethod.POST) |
| 55 | 48 | public Map<String, Object> stationSave(@RequestParam Map<String, Object> map) { |
| 56 | - | |
| 57 | 49 | map.put("createBy", ""); |
| 58 | - | |
| 59 | 50 | map.put("updateBy", ""); |
| 60 | - | |
| 61 | 51 | return service.carParkSave(map); |
| 62 | - | |
| 63 | 52 | } |
| 64 | - | |
| 65 | 53 | @RequestMapping(value = "findCarParkInfoFormId",method = RequestMethod.GET) |
| 66 | 54 | public List<Map<String, Object>> findCarParkInfoFormId(@RequestParam Map<String, Object> map) { |
| 67 | - | |
| 68 | 55 | return service.findCarParkInfoFormId(map); |
| 69 | 56 | } |
| 70 | - | |
| 71 | 57 | /** |
| 72 | 58 | * 修改停车场信息 |
| 73 | 59 | * |
| ... | ... | @@ -85,11 +71,12 @@ public class CarParkController extends BaseController<CarPark, Integer> { |
| 85 | 71 | */ |
| 86 | 72 | @RequestMapping(value="carParkUpdate" , method = RequestMethod.POST) |
| 87 | 73 | public Map<String, Object> carParkUpdate(@RequestParam Map<String, Object> map) { |
| 88 | - | |
| 89 | 74 | map.put("updateBy", ""); |
| 90 | - | |
| 91 | 75 | return service.carParkUpdate(map); |
| 92 | - | |
| 93 | 76 | } |
| 94 | 77 | |
| 78 | + @RequestMapping(value="isHaveParkCode",method=RequestMethod.GET) | |
| 79 | + public boolean isHaveParkCode(@RequestParam Map<String,Object> map) { | |
| 80 | + return service.selectTccInfoByCode(map); | |
| 81 | + } | |
| 95 | 82 | } | ... | ... |
src/main/java/com/bsth/entity/CarPark.java
| ... | ... | @@ -3,6 +3,9 @@ package com.bsth.entity; |
| 3 | 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 4 | 4 | |
| 5 | 5 | import javax.persistence.*; |
| 6 | + | |
| 7 | +import org.hibernate.annotations.Formula; | |
| 8 | + | |
| 6 | 9 | import java.util.Date; |
| 7 | 10 | |
| 8 | 11 | |
| ... | ... | @@ -77,6 +80,10 @@ public class CarPark { |
| 77 | 80 | // 分公司 |
| 78 | 81 | private String brancheCompany; |
| 79 | 82 | |
| 83 | + /** 组合公司分公司编码 */ | |
| 84 | + @Formula(" concat(company, '_', branche_company) ") | |
| 85 | + private String cgsbm; | |
| 86 | + | |
| 80 | 87 | // 是否撤销 |
| 81 | 88 | private Integer destroy; |
| 82 | 89 | |
| ... | ... | @@ -99,6 +106,14 @@ public class CarPark { |
| 99 | 106 | // 修改日期 |
| 100 | 107 | @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") |
| 101 | 108 | private Date updateDate; |
| 109 | + | |
| 110 | + public String getCgsbm() { | |
| 111 | + return cgsbm; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public void setCgsbm(String cgsbm) { | |
| 115 | + this.cgsbm = cgsbm; | |
| 116 | + } | |
| 102 | 117 | |
| 103 | 118 | public Integer getId() { |
| 104 | 119 | return id; | ... | ... |
src/main/java/com/bsth/repository/CarParkRepository.java
| ... | ... | @@ -107,4 +107,7 @@ public interface CarParkRepository extends BaseRepository<CarPark, Integer>{ |
| 107 | 107 | |
| 108 | 108 | @Query(value = "select st_astext(g_park_point), shapes_type, g_center_point, radius,park_code,park_name from bsth_c_car_park where park_code=?1", nativeQuery = true) |
| 109 | 109 | public Object[][] bufferAera(String parkCode); |
| 110 | + | |
| 111 | + @Query(value ="SELECT p.park_name,p.park_code from bsth_c_car_park p where p.park_code = ?1", nativeQuery=true) | |
| 112 | + List<Object[]> selectTccInfoByCode(String parkCode); | |
| 110 | 113 | } | ... | ... |
src/main/java/com/bsth/service/CarParkService.java
src/main/java/com/bsth/service/impl/CarParkServiceImpl.java
| ... | ... | @@ -26,55 +26,30 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem |
| 26 | 26 | |
| 27 | 27 | @Override |
| 28 | 28 | public Map<String, Object> carParkSave(Map<String, Object> map) { |
| 29 | - | |
| 30 | 29 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 31 | - | |
| 32 | 30 | try { |
| 33 | - | |
| 34 | 31 | // 停车场编码 |
| 35 | 32 | String parkCode = map.get("parkCode").equals("") ? null : map.get("parkCode").toString(); |
| 36 | - | |
| 37 | - // 停车场id | |
| 38 | - // Integer id = Integer.parseInt(parkCode); | |
| 39 | - | |
| 40 | 33 | // 停车场名称 |
| 41 | 34 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); |
| 42 | - | |
| 43 | 35 | // 地理位置(百度坐标集合) |
| 44 | 36 | String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); |
| 45 | - | |
| 46 | - // 地理位置(WGS坐标集合) | |
| 47 | - // String gParkPoint = map.get("gParkPoint").equals("") ? "" :map.get("gParkPoint").toString(); | |
| 48 | - | |
| 49 | 37 | // 多边形WGS坐标点集合 |
| 50 | 38 | String gParkPoint =""; |
| 51 | - | |
| 52 | 39 | if(!bParkPoint.equals("")) { |
| 53 | - | |
| 54 | 40 | String bPloygonGridArray[] = bParkPoint.split(","); |
| 55 | - | |
| 56 | 41 | int bLen_ = bPloygonGridArray.length; |
| 57 | - | |
| 58 | 42 | for(int b = 0 ;b<bLen_;b++) { |
| 59 | - | |
| 60 | 43 | String tempArray[]= bPloygonGridArray[b].split(" "); |
| 61 | - | |
| 62 | 44 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); |
| 63 | - | |
| 64 | 45 | if(b==0) { |
| 65 | - | |
| 66 | 46 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); |
| 67 | - | |
| 68 | 47 | }else { |
| 69 | - | |
| 70 | 48 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); |
| 71 | - | |
| 72 | 49 | } |
| 73 | - | |
| 74 | 50 | } |
| 75 | 51 | |
| 76 | 52 | } |
| 77 | - | |
| 78 | 53 | if(bParkPoint.equals("")) |
| 79 | 54 | bParkPoint = null; |
| 80 | 55 | else |
| ... | ... | @@ -84,169 +59,92 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem |
| 84 | 59 | gParkPoint = null; |
| 85 | 60 | else |
| 86 | 61 | gParkPoint = "POLYGON((" + gParkPoint +"))"; |
| 87 | - | |
| 88 | - /*bParkPoint = "POLYGON((" + bParkPoint +"))"; | |
| 89 | - | |
| 90 | - gParkPoint = "POLYGON((" + gParkPoint +"))";*/ | |
| 91 | - | |
| 92 | 62 | // 地理位置中心点(百度坐标) |
| 93 | 63 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); |
| 94 | - | |
| 95 | - // 地理位置中心点(WGS坐标) | |
| 96 | - // String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString(); | |
| 97 | - | |
| 98 | 64 | String bJwpointsArray[] =null; |
| 99 | - | |
| 100 | 65 | if(bCenterPoint!=null) { |
| 101 | - | |
| 102 | 66 | bJwpointsArray = bCenterPoint.split(" "); |
| 103 | - | |
| 104 | 67 | } |
| 105 | - | |
| 106 | 68 | String gCenterPoint = null; |
| 107 | - | |
| 108 | 69 | if(bJwpointsArray.length>0) { |
| 109 | - | |
| 110 | 70 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); |
| 111 | - | |
| 112 | 71 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); |
| 113 | - | |
| 114 | 72 | } |
| 115 | - | |
| 116 | 73 | // 坐标类型 |
| 117 | 74 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); |
| 118 | - | |
| 119 | 75 | // 图形类型 |
| 120 | 76 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); |
| 121 | - | |
| 122 | 77 | // 半径 |
| 123 | 78 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); |
| 124 | - | |
| 125 | 79 | // 面积 |
| 126 | 80 | Double area = map.get("area").equals("") ? 0.0 : Double.parseDouble(map.get("area").toString()); |
| 127 | - | |
| 128 | 81 | // 公司 |
| 129 | 82 | String company = map.get("company").equals("") ? "" : map.get("company").toString(); |
| 130 | - | |
| 131 | 83 | // 分公司 |
| 132 | - /*String brancheCompany = map.get("brancheCompany").equals("") ? "" : map.get("brancheCompany").toString();*/ | |
| 133 | - String brancheCompany=""; | |
| 134 | - | |
| 84 | + String brancheCompany = map.get("brancheCompany").equals("") ? "" : map.get("brancheCompany").toString(); | |
| 135 | 85 | // 是否撤销 |
| 136 | 86 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); |
| 137 | - | |
| 138 | 87 | // 版本号 |
| 139 | 88 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); |
| 140 | - | |
| 141 | 89 | // 描述与说明 |
| 142 | 90 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); |
| 143 | - | |
| 144 | 91 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); |
| 145 | - | |
| 146 | 92 | Date date = new Date(); |
| 147 | - | |
| 148 | 93 | // 创建日期 |
| 149 | 94 | String createDate = formatter.format(date); |
| 150 | - | |
| 151 | 95 | // 修改日期 |
| 152 | 96 | String updateDate = formatter.format(date); |
| 153 | - | |
| 154 | 97 | // 创建人 |
| 155 | 98 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); |
| 156 | - | |
| 157 | 99 | // 修改人 |
| 158 | 100 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); |
| 159 | - | |
| 160 | - | |
| 161 | - | |
| 162 | - | |
| 163 | 101 | carParkRepository.carParkSave(area, company, parkCode, parkName, |
| 164 | - | |
| 165 | 102 | brancheCompany, createBy, createDate, descriptions, destroy, |
| 166 | - | |
| 167 | 103 | updateBy, updateDate, versions, bCenterPoint, bParkPoint, |
| 168 | - | |
| 169 | 104 | dbType, gCenterPoint, gParkPoint, radius, shapesType); |
| 170 | - | |
| 171 | 105 | resultMap.put("status", ResponseCode.SUCCESS); |
| 172 | - | |
| 173 | 106 | } catch (Exception e) { |
| 174 | - | |
| 175 | 107 | resultMap.put("status", ResponseCode.ERROR); |
| 176 | - | |
| 177 | 108 | logger.error("save erro.", e); |
| 178 | - | |
| 179 | 109 | } |
| 180 | - | |
| 181 | 110 | return resultMap; |
| 182 | 111 | } |
| 183 | 112 | |
| 184 | 113 | @Override |
| 185 | 114 | public List<Map<String, Object>> findCarParkInfoFormId(Map<String, Object> map) { |
| 186 | - | |
| 187 | 115 | // 获取线路ID |
| 188 | 116 | Integer id = map.get("id").equals("") ? 0 : Integer.parseInt(map.get("id").toString()); |
| 189 | - | |
| 190 | 117 | List<Object[]> objects = carParkRepository.findCarParkInfoFormId(id); |
| 191 | - | |
| 192 | 118 | List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>(); |
| 193 | - | |
| 194 | 119 | int len = objects.size(); |
| 195 | - | |
| 196 | 120 | if(objects.size()>0) { |
| 197 | - | |
| 198 | 121 | for(int i = 0 ; i < len; i++) { |
| 199 | - | |
| 200 | 122 | Map<String, Object> tempM = new HashMap<String,Object>(); |
| 201 | - | |
| 202 | 123 | tempM.put("carParkId", objects.get(i)[0]); |
| 203 | - | |
| 204 | 124 | tempM.put("carParkArea", objects.get(i)[1]); |
| 205 | - | |
| 206 | 125 | tempM.put("carParkCompany", objects.get(i)[2]); |
| 207 | - | |
| 208 | 126 | tempM.put("carParkCode", objects.get(i)[3]); |
| 209 | - | |
| 210 | 127 | tempM.put("carParkName", objects.get(i)[4]); |
| 211 | - | |
| 212 | 128 | tempM.put("carParkBrancheCompany", objects.get(i)[5]); |
| 213 | - | |
| 214 | 129 | tempM.put("carParkCreateBy", objects.get(i)[6]); |
| 215 | - | |
| 216 | 130 | tempM.put("carParkCreateDate", objects.get(i)[7]); |
| 217 | - | |
| 218 | 131 | tempM.put("carParkDescriptions", objects.get(i)[8]); |
| 219 | - | |
| 220 | 132 | tempM.put("carParkDestroy", objects.get(i)[9]); |
| 221 | - | |
| 222 | 133 | tempM.put("carParkUpdate", objects.get(i)[10]); |
| 223 | - | |
| 224 | 134 | tempM.put("carParkUpdateDate", objects.get(i)[11]); |
| 225 | - | |
| 226 | 135 | tempM.put("carParkVersions", objects.get(i)[12]); |
| 227 | - | |
| 228 | 136 | tempM.put("carParkBcenterPoint", objects.get(i)[13]); |
| 229 | - | |
| 230 | 137 | tempM.put("carParkBparkPoint", objects.get(i)[14]); |
| 231 | - | |
| 232 | 138 | tempM.put("carParkGcenterPoint", objects.get(i)[15]); |
| 233 | - | |
| 234 | 139 | tempM.put("carParkGparkPoint", objects.get(i)[16]); |
| 235 | - | |
| 236 | 140 | tempM.put("carParkDBtype", objects.get(i)[17]); |
| 237 | - | |
| 238 | 141 | tempM.put("carParkRadius", objects.get(i)[18]); |
| 239 | - | |
| 240 | 142 | tempM.put("carParkShapesType", objects.get(i)[19]); |
| 241 | - | |
| 242 | 143 | resultList.add(tempM); |
| 243 | 144 | } |
| 244 | - | |
| 245 | 145 | } |
| 246 | - | |
| 247 | 146 | return resultList; |
| 248 | 147 | } |
| 249 | - | |
| 250 | 148 | /** |
| 251 | 149 | * 修改停车场信息 |
| 252 | 150 | * |
| ... | ... | @@ -265,90 +163,54 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem |
| 265 | 163 | @Override |
| 266 | 164 | public Map<String, Object> carParkUpdate(Map<String, Object> map) { |
| 267 | 165 | Map<String, Object> resultMap = new HashMap<String, Object>(); |
| 268 | - | |
| 269 | 166 | try { |
| 270 | - | |
| 271 | 167 | // id |
| 272 | 168 | Integer id = map.get("id").equals("") ? null : Integer.parseInt(map.get("id").toString()); |
| 273 | - | |
| 274 | 169 | if(id!=null) { |
| 275 | - | |
| 276 | 170 | // 面积 |
| 277 | 171 | Double area = map.get("area").equals("") ? null : Double.parseDouble(map.get("area").toString()); |
| 278 | - | |
| 279 | 172 | // 中心点(百度坐标) |
| 280 | 173 | String bCenterPoint = map.get("bCenterPoint").equals("") ? "" : map.get("bCenterPoint").toString(); |
| 281 | - | |
| 282 | 174 | // 图形坐标点集合(百度坐标) |
| 283 | 175 | String bParkPoint = map.get("bParkPoint").equals("") ? "" : map.get("bParkPoint").toString(); |
| 284 | - | |
| 285 | 176 | // 分公司 |
| 286 | - /*String brancheCompany = map.get("brancheCompany").equals("")? "" :map.get("brancheCompany").toString();*/ | |
| 287 | - String brancheCompany = ""; | |
| 288 | - | |
| 177 | + String brancheCompany = map.get("brancheCompany").equals("")? "" :map.get("brancheCompany").toString(); | |
| 178 | + //String brancheCompany = ""; | |
| 289 | 179 | // 公司 |
| 290 | 180 | String company = map.get("company").equals("") ? "" : map.get("company").toString(); |
| 291 | - | |
| 292 | 181 | // 坐标类型 |
| 293 | 182 | String dbType = map.get("dbType").equals("") ? "" : map.get("dbType").toString(); |
| 294 | - | |
| 295 | 183 | // 描述与说明 |
| 296 | 184 | String descriptions = map.get("descriptions").equals("") ? "" : map.get("descriptions").toString(); |
| 297 | - | |
| 298 | 185 | // 是否撤销 |
| 299 | 186 | Integer destroy = map.get("destroy").equals("") ? null : Integer.parseInt(map.get("destroy").toString()); |
| 300 | - | |
| 301 | 187 | // 中心点(WGS坐标) |
| 302 | 188 | // String gCenterPoint = map.get("gCenterPoint").equals("") ? "" : map.get("gCenterPoint").toString(); |
| 303 | - | |
| 304 | 189 | String bJwpointsArray[] =null; |
| 305 | - | |
| 306 | 190 | if(bCenterPoint!=null) { |
| 307 | - | |
| 308 | 191 | bJwpointsArray = bCenterPoint.split(" "); |
| 309 | - | |
| 310 | 192 | } |
| 311 | - | |
| 312 | 193 | String gCenterPoint =null; |
| 313 | - | |
| 314 | 194 | if(bJwpointsArray.length>0) { |
| 315 | - | |
| 316 | 195 | Location resultPoint = FromBDPointToWGSPoint(bJwpointsArray[0],bJwpointsArray[1]); |
| 317 | - | |
| 318 | 196 | gCenterPoint = String.valueOf(resultPoint.getLng()) + " " + String.valueOf(resultPoint.getLat()); |
| 319 | - | |
| 320 | 197 | } |
| 321 | - | |
| 322 | 198 | // 图形坐标点集合(WGS坐标) |
| 323 | 199 | // String gParkPoint = map.get("gParkPoint").equals("") ? "" : map.get("gParkPoint").toString(); |
| 324 | - | |
| 325 | 200 | // 多边形WGS坐标点集合 |
| 326 | 201 | String gParkPoint =""; |
| 327 | - | |
| 328 | 202 | if(!bParkPoint.equals("")) { |
| 329 | - | |
| 330 | 203 | String bPloygonGridArray[] = bParkPoint.split(","); |
| 331 | - | |
| 332 | 204 | int bLen_ = bPloygonGridArray.length; |
| 333 | - | |
| 334 | 205 | for(int b = 0 ;b<bLen_;b++) { |
| 335 | - | |
| 336 | 206 | String tempArray[]= bPloygonGridArray[b].split(" "); |
| 337 | - | |
| 338 | 207 | Location resultPoint = FromBDPointToWGSPoint(tempArray[0],tempArray[1]); |
| 339 | - | |
| 340 | 208 | if(b==0) { |
| 341 | - | |
| 342 | 209 | gParkPoint = resultPoint.getLng() + " " + resultPoint.getLat(); |
| 343 | - | |
| 344 | 210 | }else { |
| 345 | - | |
| 346 | 211 | gParkPoint = gParkPoint + ',' + resultPoint.getLng() + " " + resultPoint.getLat(); |
| 347 | - | |
| 348 | 212 | } |
| 349 | - | |
| 350 | 213 | } |
| 351 | - | |
| 352 | 214 | } |
| 353 | 215 | if(bParkPoint.equals("")) |
| 354 | 216 | bParkPoint = null; |
| ... | ... | @@ -362,69 +224,51 @@ public class CarParkServiceImpl extends BaseServiceImpl<CarPark, Integer> implem |
| 362 | 224 | /*bParkPoint = "POLYGON((" + bParkPoint +"))"; |
| 363 | 225 | |
| 364 | 226 | gParkPoint = "POLYGON((" + gParkPoint +"))";*/ |
| 365 | - | |
| 366 | 227 | // 编码 |
| 367 | 228 | String parkCode = map.get("parkCode").equals("") ? "" : map.get("parkCode").toString(); |
| 368 | - | |
| 369 | 229 | // 名称 |
| 370 | 230 | String parkName = map.get("parkName").equals("") ? "" : map.get("parkName").toString(); |
| 371 | - | |
| 372 | 231 | // 半径 |
| 373 | 232 | Integer radius = map.get("radius").equals("") ? null : Integer.parseInt(map.get("radius").toString()); |
| 374 | - | |
| 375 | 233 | // 图形类型 |
| 376 | 234 | String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); |
| 377 | - | |
| 378 | 235 | // 版本 |
| 379 | 236 | Integer versions = map.get("versions").equals("") ? null : Integer.parseInt(map.get("versions").toString()); |
| 380 | - | |
| 381 | 237 | // 创建人 |
| 382 | 238 | Integer createBy = map.get("createBy").equals("") ? null : Integer.parseInt(map.get("createBy").toString()); |
| 383 | - | |
| 384 | 239 | // 创建日期 |
| 385 | 240 | String createDate = map.get("createDate").equals("") ? "" : map.get("createDate").toString(); |
| 386 | - | |
| 387 | 241 | Integer updateBy = map.get("updateBy").equals("") ? null : Integer.parseInt(map.get("updateBy").toString()); |
| 388 | - | |
| 389 | 242 | SimpleDateFormat formatter = new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss"); |
| 390 | - | |
| 391 | 243 | Date date = new Date(); |
| 392 | - | |
| 393 | 244 | // 修改日期 |
| 394 | 245 | String updateDate = formatter.format(date); |
| 395 | - | |
| 396 | 246 | carParkRepository.carParkUpdate(area, company, parkCode, parkName, brancheCompany, createBy, createDate, descriptions, destroy, updateBy, updateDate, versions, bCenterPoint, gCenterPoint, bParkPoint, gParkPoint, dbType, radius, shapesType, id); |
| 397 | - | |
| 398 | 247 | } |
| 399 | - | |
| 400 | 248 | resultMap.put("status", ResponseCode.SUCCESS); |
| 401 | - | |
| 402 | 249 | } catch (Exception e) { |
| 403 | - | |
| 404 | 250 | resultMap.put("status", ResponseCode.ERROR); |
| 405 | - | |
| 406 | 251 | logger.error("save erro.", e); |
| 407 | - | |
| 408 | 252 | } |
| 409 | - | |
| 410 | 253 | return resultMap; |
| 411 | 254 | } |
| 412 | - | |
| 413 | 255 | /** 百度坐标转WGS坐标 */ |
| 414 | 256 | public Location FromBDPointToWGSPoint(String bLonx,String bLatx) { |
| 415 | - | |
| 416 | 257 | double lng = Double.parseDouble(bLonx); |
| 417 | - | |
| 418 | 258 | double lat = Double.parseDouble(bLatx); |
| 419 | - | |
| 420 | 259 | Location bdLoc = TransGPS.LocationMake(lng, lat); |
| 421 | - | |
| 422 | 260 | Location location = TransGPS.bd_decrypt(bdLoc); |
| 423 | - | |
| 424 | 261 | Location WGSPoint = TransGPS.transformFromGCJToWGS(location); |
| 425 | - | |
| 426 | 262 | return WGSPoint; |
| 427 | - | |
| 428 | 263 | } |
| 429 | - | |
| 264 | + | |
| 265 | + @Override | |
| 266 | + public boolean selectTccInfoByCode(Map<String, Object> map) { | |
| 267 | + List<Object[]> arrayObj = carParkRepository.selectTccInfoByCode(map.get("parkCode").equals("") ? "" : map.get("parkCode").toString()); | |
| 268 | + boolean tag = true; | |
| 269 | + if(arrayObj.size()>0) { | |
| 270 | + tag= false; | |
| 271 | + } | |
| 272 | + return tag; | |
| 273 | + } | |
| 430 | 274 | } | ... | ... |
src/main/resources/static/pages/base/carpark/add.html
| ... | ... | @@ -18,6 +18,7 @@ |
| 18 | 18 | <i class="icon-equalizer font-red-sunglo"></i> |
| 19 | 19 | <span class="caption-subject font-red-sunglo bold uppercase">添加停车场 |
| 20 | 20 | <span class="step-title"> 1 - 4 </span> |
| 21 | + <i class="fa fa-question-circle tipso-animation" style="color: rgba(158, 158, 158, 0.49);"></i> | |
| 21 | 22 | </span> |
| 22 | 23 | </div> |
| 23 | 24 | |
| ... | ... | @@ -38,28 +39,28 @@ |
| 38 | 39 | <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true"> |
| 39 | 40 | <span class="number"> 1 </span> |
| 40 | 41 | <span class="desc"> |
| 41 | - <i class="fa fa-check"></i> 选择添加停车场方式 </span> | |
| 42 | + <i class="fa fa-check"></i> 获取停车场位置方式 </span> | |
| 42 | 43 | </a> |
| 43 | 44 | </li> |
| 44 | 45 | <li> |
| 45 | 46 | <a href="#tab2" data-toggle="tab" class="step"> |
| 46 | 47 | <span class="number"> 2 </span> |
| 47 | 48 | <span class="desc"> |
| 48 | - <i class="fa fa-check"></i> 停车场位置 </span> | |
| 49 | + <i class="fa fa-check"></i> 确定停车场位置 </span> | |
| 49 | 50 | </a> |
| 50 | 51 | </li> |
| 51 | 52 | <li> |
| 52 | 53 | <a href="#tab3" data-toggle="tab" class="step active"> |
| 53 | 54 | <span class="number"> 3 </span> |
| 54 | 55 | <span class="desc"> |
| 55 | - <i class="fa fa-check"></i> 停车场信息 </span> | |
| 56 | + <i class="fa fa-check"></i> 填写停车场信息 </span> | |
| 56 | 57 | </a> |
| 57 | 58 | </li> |
| 58 | 59 | <li> |
| 59 | 60 | <a href="#tab4" data-toggle="tab" class="step"> |
| 60 | 61 | <span class="number"> 4 </span> |
| 61 | 62 | <span class="desc"> |
| 62 | - <i class="fa fa-check"></i> 确认 </span> | |
| 63 | + <i class="fa fa-check"></i> 确认并提交 </span> | |
| 63 | 64 | </a> |
| 64 | 65 | </li> |
| 65 | 66 | </ul> |
| ... | ... | @@ -81,47 +82,33 @@ |
| 81 | 82 | |
| 82 | 83 | <!-- 选择添加站点方式 --> |
| 83 | 84 | <div class="tab-pane active" id="tab1"> |
| 84 | - | |
| 85 | - <h3 class="block"> 选择添加停车场方式 </h3> | |
| 86 | - | |
| 87 | - <!-- 站点名称 --> | |
| 85 | + <h3 class="block"> 获取停车场位置方式 </h3> | |
| 86 | + <!--停车场名称 --> | |
| 88 | 87 | <div class="form-group" id="formRequ"> |
| 89 | - <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称:</label> | |
| 88 | + <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称 :</label> | |
| 90 | 89 | <div class="col-md-9"> |
| 91 | - <input type="text" class="form-control input-medium" id="parkNamebooxtInput" name="parkNamebooxt"> | |
| 90 | + <input type="text" class="form-control input-medium" id="parkNamebooxtInput" name="parkNamebooxt" placeholder="请输入停车场名称"> | |
| 92 | 91 | </div> |
| 93 | 92 | </div> |
| 94 | - | |
| 95 | 93 | <!-- 新增方式 --> |
| 96 | 94 | <div class="form-group"> |
| 97 | - <label class="col-md-3 control-label">新增方式:</label> | |
| 95 | + <label class="col-md-3 control-label"><span class="required"> * </span>选择获取方式:</label> | |
| 98 | 96 | <div class="col-md-9"> |
| 99 | 97 | <div class="icheck-list"> |
| 100 | 98 | <label> |
| 101 | 99 | <input type="radio" class="icheck" name="baseRes" value=0 checked> 系统生成 |
| 102 | 100 | </label> |
| 103 | 101 | <label > |
| 104 | - <input type="radio" class="icheck" name="baseRes" value=1 > 手动添加 | |
| 102 | + <input type="radio" class="icheck" name="baseRes" value=1 > 手动绘制 | |
| 105 | 103 | </label> |
| 106 | 104 | </div> |
| 107 | 105 | </div> |
| 108 | 106 | </div> |
| 109 | - | |
| 110 | - <div class="form-group"> | |
| 111 | - <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50"> | |
| 112 | - <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 新增方式说明: </span></h5> | |
| 113 | - <p><span class="help-block" style="color:#1bbc9b;"> a)系统生成:根据站点名称自动生成以100米为半径范围的圆.</span> </p> | |
| 114 | - <p><span class="help-block" style="color:#1bbc9b;"> b)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span> </p> | |
| 115 | - </div> | |
| 116 | - </div> | |
| 117 | - | |
| 118 | 107 | </div> |
| 119 | - | |
| 120 | - <!-- 站点位置 --> | |
| 108 | + <!--停车场位置 --> | |
| 121 | 109 | <div class="tab-pane" id="tab2"> |
| 122 | - <h3 class="block"> 站点位置 </h3> | |
| 110 | + <h3 class="block"> 停车场位置 </h3> | |
| 123 | 111 | <div id="addCarParkbmap_basic"></div> |
| 124 | - | |
| 125 | 112 | <div class="leftUtils"> |
| 126 | 113 | <div class="btn-group" style="left: 100px;"> |
| 127 | 114 | <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具 |
| ... | ... | @@ -139,243 +126,197 @@ |
| 139 | 126 | </div> |
| 140 | 127 | </div> |
| 141 | 128 | </div> |
| 142 | - | |
| 143 | - <!-- 站点信息 --> | |
| 129 | + <!--停车场信息 --> | |
| 144 | 130 | <div class="tab-pane" id="tab3"> |
| 145 | - | |
| 146 | 131 | <h3 class="block"> 停车场信息 </h3> |
| 147 | - | |
| 148 | 132 | <input type="hidden" name="bParkPoint" id="bParkPointInput" /> |
| 149 | - | |
| 150 | 133 | <input type="hidden" name="gParkPoint" id="gParkPointInput" /> |
| 151 | - | |
| 152 | 134 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> |
| 153 | - | |
| 154 | - | |
| 155 | 135 | <!-- 停车场名称 --> |
| 156 | 136 | <div class="form-body"> |
| 157 | 137 | <div class="form-group"> |
| 158 | 138 | <label class="control-label col-md-3"> |
| 159 | - <span class="required"> * </span> 停车场名称 : | |
| 139 | + <span class="required"> * </span> 停车场名称 : | |
| 160 | 140 | </label> |
| 161 | 141 | <div class="col-md-6"> |
| 162 | - <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="站点名称"> | |
| 142 | + <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="请输入站点名称" readonly="readonly"> | |
| 163 | 143 | </div> |
| 164 | 144 | </div> |
| 165 | 145 | </div> |
| 166 | - | |
| 167 | 146 | <!-- 停车场编码 --> |
| 168 | 147 | <div class="form-body"> |
| 169 | 148 | <div class="form-group"> |
| 170 | 149 | <label class="control-label col-md-3"> |
| 171 | - <span class="required"> * </span>停车场编码: | |
| 150 | + <span class="required"> * </span>停车场编码 : | |
| 172 | 151 | </label> |
| 173 | 152 | <div class="col-md-6"> |
| 174 | - <input type="text" class="form-control" name="parkCode" id="parkCodeInput"> | |
| 153 | + <input type="text" class="form-control" name="parkCode" id="parkCodeInput" placeholder="请输入停车场编码"> | |
| 175 | 154 | </div> |
| 176 | 155 | </div> |
| 177 | 156 | </div> |
| 178 | - | |
| 179 | - <!-- 中心位置坐标点 --> | |
| 157 | + <!-- 经纬度坐标点 --> | |
| 180 | 158 | <div class="form-body"> |
| 181 | 159 | <div class="form-group"> |
| 182 | - <label class="col-md-3 control-label">经纬度坐标点:</label> | |
| 160 | + <label class="col-md-3 control-label"><span class="required"> * </span>经纬度坐标点:</label> | |
| 183 | 161 | <div class="col-md-6"> |
| 184 | - <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput"> | |
| 162 | + <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput" readonly="readonly" placeholder="请输入经纬度坐标点"> | |
| 185 | 163 | </div> |
| 186 | 164 | </div> |
| 187 | 165 | </div> |
| 188 | 166 | |
| 189 | - <!-- 范围图形类型 --> | |
| 167 | + <!-- 几何图形类型 --> | |
| 190 | 168 | <div class="form-body"> |
| 191 | 169 | <div class="form-group"> |
| 192 | - <label class="col-md-3 control-label">范围图形类型:</label> | |
| 170 | + <label class="col-md-3 control-label"><span class="required"> * </span>几何图形类型:</label> | |
| 193 | 171 | <div class="col-md-6"> |
| 194 | - <select name="shapesType" class="form-control" id="shapesTypeSelect"> | |
| 195 | - <option value="">-- 请选择站点类型 --</option> | |
| 196 | - <option value="r">圆形</option> | |
| 197 | - <option value="d">多变形</option> | |
| 198 | - </select> | |
| 172 | + <input type="text" class="form-control" name="shapesType" id="shapesTypeSelect" readonly="readonly" placeholder="请输入几何图形类型"> | |
| 199 | 173 | </div> |
| 200 | 174 | </div> |
| 201 | 175 | </div> |
| 202 | - | |
| 203 | 176 | <!-- 圆形半径 --> |
| 177 | + <div class="form-body" id="radiusGroup"> | |
| 178 | + <div class="form-group"> | |
| 179 | + <label class="col-md-3 control-label"><span class="required"> * </span> 圆形半径 :</label> | |
| 180 | + <div class="col-md-6"> | |
| 181 | + <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="请输入圆形半径"> | |
| 182 | + </div> | |
| 183 | + </div> | |
| 184 | + </div> | |
| 185 | + <!-- 是否撤销 --> | |
| 204 | 186 | <div class="form-body"> |
| 205 | 187 | <div class="form-group"> |
| 206 | - <label class="col-md-3 control-label">圆形半径:</label> | |
| 188 | + <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销 :</label> | |
| 207 | 189 | <div class="col-md-6"> |
| 208 | - <input type="text" class="form-control" name="radius" id="radiusInput" > | |
| 190 | + <select name="destroy" class="form-control" id="destroySelect"> | |
| 191 | + <option value="">-- 请选择撤销类型 --</option> | |
| 192 | + <option value="0">否</option> | |
| 193 | + <option value="1">是</option> | |
| 194 | + </select> | |
| 209 | 195 | </div> |
| 210 | 196 | </div> |
| 211 | 197 | </div> |
| 212 | - | |
| 213 | 198 | <!-- 面积 --> |
| 214 | 199 | <div class="form-body"> |
| 215 | 200 | <div class="form-group"> |
| 216 | - <label class="col-md-3 control-label">面积:</label> | |
| 201 | + <label class="col-md-3 control-label">面积 :</label> | |
| 217 | 202 | <div class="col-md-6"> |
| 218 | - <input type="text" class="form-control" name="area" id="areaInput" > | |
| 219 | - <span class="help-block">单位:平方米</span> | |
| 203 | + <input type="text" class="form-control" name="area" id="areaInput" placeholder="请输入面积"> | |
| 204 | + <span class="help-block">单位:平方米(㎡)</span> | |
| 220 | 205 | </div> |
| 221 | 206 | </div> |
| 222 | 207 | </div> |
| 223 | - | |
| 224 | 208 | <!-- 所属公司 --> |
| 225 | 209 | <div class="form-body"> |
| 226 | 210 | <div class="form-group"> |
| 227 | - <label class="col-md-3 control-label">所属公司:</label> | |
| 211 | + <label class="col-md-3 control-label">所属公司 :</label> | |
| 228 | 212 | <div class="col-md-6"> |
| 229 | - <select name="company" class="form-control" style="width:100%" id="companySelect"> | |
| 230 | - | |
| 231 | - </select> | |
| 213 | + <select name="company" class="form-control" style="width:100%" id="companySelect"></select> | |
| 232 | 214 | </div> |
| 233 | 215 | </div> |
| 234 | 216 | </div> |
| 235 | - | |
| 236 | - | |
| 237 | 217 | <!-- 所属分公司 --> |
| 238 | - <!-- <div class="form-body"> | |
| 218 | + <div class="form-body"> | |
| 239 | 219 | <div class="form-group"> |
| 240 | - <label class="col-md-3 control-label">所属分公司:</label> | |
| 220 | + <label class="col-md-3 control-label">所属分公司 :</label> | |
| 241 | 221 | <div class="col-md-6"> |
| 242 | 222 | <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> |
| 243 | 223 | </select> |
| 244 | 224 | </div> |
| 245 | 225 | </div> |
| 246 | - </div> --> | |
| 247 | - | |
| 248 | - | |
| 226 | + </div> | |
| 249 | 227 | <!-- 版本号 --> |
| 250 | 228 | <div class="form-body"> |
| 251 | 229 | <div class="form-group"> |
| 252 | - <label class="col-md-3 control-label">版本号:</label> | |
| 230 | + <label class="col-md-3 control-label">版本号 :</label> | |
| 253 | 231 | <div class="col-md-6"> |
| 254 | - <input type="text" class="form-control" name="versions" value='1' Readonly> | |
| 232 | + <input type="text" class="form-control" name="versions" value='1' Readonly placeholder="请输入版本号"> | |
| 255 | 233 | </div> |
| 256 | 234 | </div> |
| 257 | 235 | </div> |
| 258 | - | |
| 259 | - <!-- 范围图形类型 --> | |
| 260 | - <div class="form-body"> | |
| 261 | - <div class="form-group"> | |
| 262 | - <label class="col-md-3 control-label">是否撤销:</label> | |
| 263 | - <div class="col-md-6"> | |
| 264 | - <select name="destroy" class="form-control" id="destroySelect"> | |
| 265 | - <option value="">-- 请选择撤销类型 --</option> | |
| 266 | - <option value="0">否</option> | |
| 267 | - <option value="1">是</option> | |
| 268 | - </select> | |
| 269 | - </div> | |
| 270 | - </div> | |
| 271 | - </div> | |
| 272 | - | |
| 273 | 236 | <!-- 描述/说明 --> |
| 274 | 237 | <div class="form-group"> |
| 275 | - <label class="control-label col-md-3"> 描述/说明: </label> | |
| 238 | + <label class="control-label col-md-3"> 描述/说明 : </label> | |
| 276 | 239 | <div class="col-md-6"> |
| 277 | - <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | |
| 240 | + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="请输入描述/说明"></textarea> | |
| 278 | 241 | </div> |
| 279 | 242 | </div> |
| 280 | 243 | |
| 281 | 244 | </div> |
| 282 | - | |
| 283 | 245 | <!-- 确定提交资料信息 --> |
| 284 | 246 | <div class="tab-pane" id="tab4"> |
| 285 | 247 | <h3 class="block"> 确认您提交的停车场信息 </h3> |
| 286 | - | |
| 287 | 248 | <h4 class="form-section"> 地理位置 </h4> |
| 288 | - | |
| 289 | 249 | <div class="form-group"> |
| 290 | - <label class="control-label col-md-3"> 范围图形类型: </label> | |
| 250 | + <label class="control-label col-md-3"> 几何图形类型: </label> | |
| 291 | 251 | <div class="col-md-4"> |
| 292 | 252 | <p class="form-control-static" data-display="shapesType"> </p> |
| 293 | 253 | </div> |
| 294 | 254 | </div> |
| 295 | - | |
| 296 | - <div class="form-group"> | |
| 297 | - <label class="control-label col-md-3"> 圆形半径: </label> | |
| 255 | + <div class="form-group"> | |
| 256 | + <label class="control-label col-md-3"> 圆形半径 : </label> | |
| 298 | 257 | <div class="col-md-4"> |
| 299 | 258 | <p class="form-control-static" data-display="radius"> </p> |
| 300 | 259 | </div> |
| 301 | 260 | </div> |
| 302 | 261 | |
| 303 | 262 | <div class="form-group"> |
| 304 | - <label class="control-label col-md-3"> 中心位置经纬度坐标点: </label> | |
| 263 | + <label class="control-label col-md-3"> 经纬度坐标点: </label> | |
| 305 | 264 | <div class="col-md-4"> |
| 306 | 265 | <p class="form-control-static" data-display="bCenterPoint"> </p> |
| 307 | 266 | </div> |
| 308 | 267 | </div> |
| 309 | - | |
| 310 | - <!-- <div class="form-group"> | |
| 311 | - <label class="control-label col-md-3"> 中心位置WGS坐标点: </label> | |
| 312 | - <div class="col-md-4"> | |
| 313 | - <p class="form-control-static" data-display="gCenterPoint"> </p> | |
| 314 | - </div> | |
| 315 | - </div> --> | |
| 316 | - | |
| 317 | 268 | <h4 class="form-section"> 停车场信息 </h4> |
| 318 | - | |
| 319 | 269 | <div class="form-group"> |
| 320 | - <label class="control-label col-md-3">停车场名称:</label> | |
| 270 | + <label class="control-label col-md-3">停车场名称 :</label> | |
| 321 | 271 | <div class="col-md-4"> |
| 322 | 272 | <p class="form-control-static" data-display="parkName"> </p> |
| 323 | 273 | </div> |
| 324 | 274 | </div> |
| 325 | - | |
| 326 | 275 | <div class="form-group"> |
| 327 | - <label class="control-label col-md-3">停车场编码:</label> | |
| 276 | + <label class="control-label col-md-3">停车场编码 :</label> | |
| 328 | 277 | <div class="col-md-4"> |
| 329 | 278 | <p class="form-control-static" data-display="parkCode"> </p> |
| 330 | 279 | </div> |
| 331 | 280 | </div> |
| 332 | - | |
| 333 | - <div class="form-group"> | |
| 334 | - <label class="control-label col-md-3">面积:</label> | |
| 281 | + <div class="form-group"> | |
| 282 | + <label class="control-label col-md-3">是否撤销 :</label> | |
| 283 | + <div class="col-md-4"> | |
| 284 | + <p class="form-control-static" data-display="destroy"> </p> | |
| 285 | + </div> | |
| 286 | + </div> | |
| 287 | + <div class="form-group"> | |
| 288 | + <label class="control-label col-md-3">面积 :</label> | |
| 335 | 289 | <div class="col-md-4"> |
| 336 | 290 | <p class="form-control-static" data-display="area"> </p> |
| 337 | 291 | </div> |
| 338 | 292 | </div> |
| 339 | - | |
| 340 | 293 | <div class="form-group"> |
| 341 | - <label class="control-label col-md-3">所属公司:</label> | |
| 294 | + <label class="control-label col-md-3">所属公司 :</label> | |
| 342 | 295 | <div class="col-md-4"> |
| 343 | 296 | <p class="form-control-static" data-display="company"> </p> |
| 344 | 297 | </div> |
| 345 | 298 | </div> |
| 346 | - | |
| 347 | - <!-- <div class="form-group"> | |
| 348 | - <label class="control-label col-md-3">分公司:</label> | |
| 349 | - <div class="col-md-4"> | |
| 350 | - <p class="form-control-static" data-display="brancheCompany"> </p> | |
| 351 | - </div> | |
| 352 | - </div> --> | |
| 353 | - | |
| 354 | 299 | <div class="form-group"> |
| 355 | - <label class="control-label col-md-3">版本号:</label> | |
| 300 | + <label class="control-label col-md-3">分公司 :</label> | |
| 356 | 301 | <div class="col-md-4"> |
| 357 | - <p class="form-control-static" data-display="versions"> </p> | |
| 302 | + <p class="form-control-static" data-display="brancheCompany"> </p> | |
| 358 | 303 | </div> |
| 359 | 304 | </div> |
| 360 | - | |
| 361 | - <div class="form-group"> | |
| 362 | - <label class="control-label col-md-3">是否撤销:</label> | |
| 305 | + <div class="form-group"> | |
| 306 | + <label class="control-label col-md-3">版本号 :</label> | |
| 363 | 307 | <div class="col-md-4"> |
| 364 | - <p class="form-control-static" data-display="destroy"> </p> | |
| 308 | + <p class="form-control-static" data-display="versions"> </p> | |
| 365 | 309 | </div> |
| 366 | 310 | </div> |
| 367 | - | |
| 368 | 311 | <div class="form-group"> |
| 369 | - <label class="control-label col-md-3">描述/说明:</label> | |
| 312 | + <label class="control-label col-md-3">描述/说明 :</label> | |
| 370 | 313 | <div class="col-md-4"> |
| 371 | 314 | <p class="form-control-static" data-display="descriptions"> </p> |
| 372 | 315 | </div> |
| 373 | 316 | </div> |
| 374 | - | |
| 375 | 317 | </div> |
| 376 | 318 | </div> |
| 377 | 319 | </div> |
| 378 | - | |
| 379 | 320 | <div class="form-actions"> |
| 380 | 321 | <div class="row"> |
| 381 | 322 | <div class="col-md-offset-3 col-md-9"> |
| ... | ... | @@ -390,26 +331,18 @@ |
| 390 | 331 | </div> |
| 391 | 332 | </div> |
| 392 | 333 | </div> |
| 393 | - | |
| 394 | 334 | </div> |
| 395 | 335 | </form> |
| 396 | - | |
| 397 | 336 | <!-- END FORM--> |
| 398 | - | |
| 399 | 337 | </div> |
| 400 | 338 | </div> |
| 401 | - | |
| 402 | 339 | <!-- 函数方法JS类库 --> |
| 403 | 340 | <script src="/pages/base/carpark/js/add-input-function.js"></script> |
| 404 | - | |
| 405 | 341 | <!-- 表单向导JS类库 --> |
| 406 | 342 | <script src="/pages/base/carpark/js/add-form-wizard.js"></script> |
| 407 | - | |
| 343 | +<!-- reload事件 --> | |
| 344 | +<script src="/pages/base/carpark/js/add-form-reload.js"></script> | |
| 408 | 345 | <!-- 地图JS类库 --> |
| 409 | 346 | <script src="/pages/base/carpark/js/add-vmap-world.js"></script> |
| 410 | - | |
| 411 | 347 | <!-- 表单元素事件JS类库 --> |
| 412 | -<script src="/pages/base/carpark/js/add-form-events.js"></script> | |
| 413 | - | |
| 414 | -<!-- reload事件 --> | |
| 415 | -<script src="/pages/base/carpark/js/add-form-reload.js"></script> | |
| 416 | 348 | \ No newline at end of file |
| 349 | +<script src="/pages/base/carpark/js/add-form-events.js"></script> | |
| 417 | 350 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/css/carpark-add.css
src/main/resources/static/pages/base/carpark/css/positions.css
| ... | ... | @@ -21,7 +21,7 @@ html,body{ |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
| 24 | -.leftUtils{ | |
| 24 | +.leftUtils, .drwmageUtils{ | |
| 25 | 25 | position: absolute; |
| 26 | 26 | padding-right: 100px; |
| 27 | 27 | width: 100%; |
| ... | ... | @@ -29,6 +29,7 @@ html,body{ |
| 29 | 29 | z-index: 9999; |
| 30 | 30 | padding-top: 7px; |
| 31 | 31 | top: 20px; |
| 32 | + display: none; | |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | .BMap_pop div:nth-child(1) , | ... | ... |
src/main/resources/static/pages/base/carpark/edit.html
| 1 | 1 | <!-- 编辑停车场 --> |
| 2 | 2 | <div class="modal fade" id="editPoitsions_carpark_mobal" tabindex="-1" role="basic" aria-hidden="true"> |
| 3 | - | |
| 4 | 3 | <div class="modal-dialog"> |
| 5 | - | |
| 6 | 4 | <div class="modal-content"> |
| 7 | - | |
| 8 | 5 | <div class="modal-header"> |
| 9 | 6 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> |
| 10 | - <h4 class="modal-title">编辑站点</h4> | |
| 7 | + <h4 class="modal-title">编辑停车场</h4> | |
| 11 | 8 | </div> |
| 12 | - | |
| 13 | 9 | <div class="modal-body"> |
| 14 | 10 | |
| 15 | 11 | <form class="form-horizontal" role="form" id="edit_carPark_form" action="/module" method="post"> |
| ... | ... | @@ -17,80 +13,81 @@ |
| 17 | 13 | <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> |
| 18 | 14 | 您的输入有误,请检查下面的输入项 |
| 19 | 15 | </div> |
| 20 | - | |
| 21 | 16 | <input type="hidden" name="id" id="idInput" /> |
| 22 | - | |
| 23 | 17 | <input type="hidden" name="bParkPoint" id="bParkPointInput" /> |
| 24 | - | |
| 25 | 18 | <input type="hidden" name="gParkPoint" id="gParkPointInput" /> |
| 26 | - | |
| 27 | 19 | <input type="hidden" name="dbType" id="dbTypeInput" value="b"/> |
| 28 | - | |
| 29 | 20 | <!-- 停车场名称 --> |
| 30 | 21 | <div class="form-body"> |
| 31 | 22 | <div class="form-group"> |
| 32 | 23 | <label class="control-label col-md-3"> |
| 33 | - <span class="required"> * </span> 停车场名称 : | |
| 24 | + <span class="required"> * </span> 停车场名称 : | |
| 34 | 25 | </label> |
| 35 | 26 | <div class="col-md-6"> |
| 36 | - <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="站点名称"> | |
| 27 | + <input type="text" class="form-control" name="parkName" id="parkNameInput" placeholder="请输入停车场名称"> | |
| 37 | 28 | </div> |
| 38 | 29 | </div> |
| 39 | 30 | </div> |
| 40 | - | |
| 41 | 31 | <!-- 停车场编码 --> |
| 42 | 32 | <div class="form-body"> |
| 43 | 33 | <div class="form-group"> |
| 44 | 34 | <label class="control-label col-md-3"> |
| 45 | - <span class="required"> * </span>停车场编码: | |
| 35 | + <span class="required"> * </span>停车场编码 : | |
| 46 | 36 | </label> |
| 47 | 37 | <div class="col-md-6"> |
| 48 | - <input type="text" class="form-control" name="parkCode" id="parkCodeInput"> | |
| 38 | + <input type="text" class="form-control" name="parkCode" id="parkCodeInput" readonly="readonly" placeholder="请输入停车场编码"> | |
| 49 | 39 | </div> |
| 50 | 40 | </div> |
| 51 | 41 | </div> |
| 52 | - | |
| 53 | - <!-- 中心位置坐标点 --> | |
| 42 | + <!-- 经纬度坐标点 --> | |
| 54 | 43 | <div class="form-body"> |
| 55 | 44 | <div class="form-group"> |
| 56 | - <label class="col-md-3 control-label">经纬度坐标点:</label> | |
| 45 | + <label class="col-md-3 control-label"><span class="required"> * </span>经纬度坐标点:</label> | |
| 57 | 46 | <div class="col-md-6"> |
| 58 | - <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput"> | |
| 47 | + <input type="text" class="form-control" name="bCenterPoint" id="bCenterPointInput" readonly="readonly" placeholder="请输入经纬度坐标点"> | |
| 59 | 48 | </div> |
| 60 | 49 | </div> |
| 61 | 50 | </div> |
| 62 | 51 | |
| 63 | - <!-- 范围图形类型 --> | |
| 52 | + <!-- 几何图形类型 --> | |
| 64 | 53 | <div class="form-body"> |
| 65 | 54 | <div class="form-group"> |
| 66 | - <label class="col-md-3 control-label">范围图形类型:</label> | |
| 55 | + <label class="col-md-3 control-label"><span class="required"> * </span>几何图形类型:</label> | |
| 67 | 56 | <div class="col-md-6"> |
| 68 | - <select name="shapesType" class="form-control" id="shapesTypeSelect"> | |
| 69 | - <option value="">-- 请选择站点类型 --</option> | |
| 70 | - <option value="r">圆形</option> | |
| 71 | - <option value="d">多变形</option> | |
| 72 | - </select> | |
| 57 | + <input type="text" class="form-control" name="shapesType" id="shapesTypeSelect" readonly="readonly" placeholder="请输入几何图形类型"> | |
| 73 | 58 | </div> |
| 74 | 59 | </div> |
| 75 | 60 | </div> |
| 76 | 61 | |
| 77 | 62 | <!-- 圆形半径 --> |
| 63 | + <div class="form-body" id="radiusGroup"> | |
| 64 | + <div class="form-group"> | |
| 65 | + <label class="col-md-3 control-label"><span class="required"> * </span>圆形半径 :</label> | |
| 66 | + <div class="col-md-6"> | |
| 67 | + <input type="text" class="form-control" name="radius" id="radiusInput" placeholder="请输入圆形半径"> | |
| 68 | + </div> | |
| 69 | + </div> | |
| 70 | + </div> | |
| 71 | + <!-- 是否撤销 --> | |
| 78 | 72 | <div class="form-body"> |
| 79 | 73 | <div class="form-group"> |
| 80 | - <label class="col-md-3 control-label">圆形半径:</label> | |
| 74 | + <label class="col-md-3 control-label"><span class="required"> * </span>是否撤销 :</label> | |
| 81 | 75 | <div class="col-md-6"> |
| 82 | - <input type="text" class="form-control" name="radius" id="radiusInput" > | |
| 76 | + <select name="destroy" class="form-control" id="destroySelect"> | |
| 77 | + <option value="">-- 请选择撤销类型 --</option> | |
| 78 | + <option value="0">否</option> | |
| 79 | + <option value="1">是</option> | |
| 80 | + </select> | |
| 83 | 81 | </div> |
| 84 | 82 | </div> |
| 85 | 83 | </div> |
| 86 | - | |
| 87 | 84 | <!-- 面积 --> |
| 88 | 85 | <div class="form-body"> |
| 89 | 86 | <div class="form-group"> |
| 90 | - <label class="col-md-3 control-label">面积:</label> | |
| 87 | + <label class="col-md-3 control-label">面积 :</label> | |
| 91 | 88 | <div class="col-md-6"> |
| 92 | 89 | <input type="text" class="form-control" name="area" id="areaInput" > |
| 93 | - <span class="help-block">单位:平方米</span> | |
| 90 | + <span class="help-block">单位:平方米(㎡)</span> | |
| 94 | 91 | </div> |
| 95 | 92 | </div> |
| 96 | 93 | </div> |
| ... | ... | @@ -98,7 +95,7 @@ |
| 98 | 95 | <!-- 所属公司 --> |
| 99 | 96 | <div class="form-body"> |
| 100 | 97 | <div class="form-group"> |
| 101 | - <label class="col-md-3 control-label">所属公司:</label> | |
| 98 | + <label class="col-md-3 control-label">所属公司 :</label> | |
| 102 | 99 | <div class="col-md-6"> |
| 103 | 100 | <select name="company" class="form-control" style="width:100%" id="companySelect"> |
| 104 | 101 | |
| ... | ... | @@ -106,47 +103,33 @@ |
| 106 | 103 | </div> |
| 107 | 104 | </div> |
| 108 | 105 | </div> |
| 109 | - | |
| 106 | + | |
| 110 | 107 | <!-- 所属分公司 --> |
| 111 | - <!-- <div class="form-body"> | |
| 108 | + <div class="form-body"> | |
| 112 | 109 | <div class="form-group"> |
| 113 | - <label class="col-md-3 control-label">所属分公司:</label> | |
| 110 | + <label class="col-md-3 control-label">所属分公司 :</label> | |
| 114 | 111 | <div class="col-md-6"> |
| 115 | 112 | <select name="brancheCompany" class="form-control" style="width:100%" id="brancheCompanySelect"> |
| 116 | 113 | </select> |
| 117 | 114 | </div> |
| 118 | 115 | </div> |
| 119 | - </div> --> | |
| 120 | - | |
| 121 | - <!-- 版本号 --> | |
| 122 | - <div class="form-body"> | |
| 123 | - <div class="form-group"> | |
| 124 | - <label class="col-md-3 control-label">版本号:</label> | |
| 125 | - <div class="col-md-6"> | |
| 126 | - <input type="text" class="form-control" name="versions" value='1' Readonly> | |
| 127 | - </div> | |
| 128 | - </div> | |
| 129 | 116 | </div> |
| 130 | 117 | |
| 131 | - <!-- 范围图形类型 --> | |
| 118 | + <!-- 版本号 --> | |
| 132 | 119 | <div class="form-body"> |
| 133 | 120 | <div class="form-group"> |
| 134 | - <label class="col-md-3 control-label">是否撤销:</label> | |
| 121 | + <label class="col-md-3 control-label">版本号 :</label> | |
| 135 | 122 | <div class="col-md-6"> |
| 136 | - <select name="destroy" class="form-control" id="destroySelect"> | |
| 137 | - <option value="">-- 请选择撤销类型 --</option> | |
| 138 | - <option value="0">否</option> | |
| 139 | - <option value="1">是</option> | |
| 140 | - </select> | |
| 123 | + <input type="text" class="form-control" name="versions" value='1' Readonly placeholder="请输入版本号"> | |
| 141 | 124 | </div> |
| 142 | 125 | </div> |
| 143 | 126 | </div> |
| 144 | 127 | |
| 145 | 128 | <!-- 描述/说明 --> |
| 146 | 129 | <div class="form-group"> |
| 147 | - <label class="control-label col-md-3"> 描述/说明: </label> | |
| 130 | + <label class="control-label col-md-3"> 描述/说明 : </label> | |
| 148 | 131 | <div class="col-md-6"> |
| 149 | - <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> | |
| 132 | + <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="请输入描述/说明"></textarea> | |
| 150 | 133 | </div> |
| 151 | 134 | </div> |
| 152 | 135 | </form> |
| ... | ... | @@ -161,105 +144,67 @@ |
| 161 | 144 | <script type="text/javascript"> |
| 162 | 145 | |
| 163 | 146 | $('#editPoitsions_carpark_mobal').on('editCarParkMobal_show', function(e, map,fun,carP,ajaxd){ |
| 164 | - | |
| 165 | 147 | /** 获取停车场信息对象 */ |
| 166 | 148 | var CarParkObj = carP.getEitdCarPark(); |
| 167 | - | |
| 168 | 149 | // 获取修改停车场对象ID |
| 169 | 150 | var carParkId = CarParkObj.carParkId; |
| 170 | - | |
| 171 | - /** 根据修改停车场对象属性值 设值表单元素 @paran:<CarParkObj:停车场对象>*/ | |
| 151 | + /** 根据修改停车场对象属性值 设值表单元素 @paran:<CarParkObj:停车场对象>*/ | |
| 172 | 152 | fun.setFormValue(CarParkObj); |
| 173 | - | |
| 174 | 153 | /** 填充公司下拉框 */ |
| 175 | 154 | fun.selectTemp(function() { |
| 176 | - | |
| 177 | 155 | // 获取公司代码 |
| 178 | 156 | var businessCode = CarParkObj.carParkCompany; |
| 179 | - | |
| 180 | 157 | // 获取公司元素并设值 |
| 181 | 158 | $('#companySelect').val(businessCode); |
| 182 | - | |
| 183 | - /** 填充分公司下拉框 @param:<businessCode:公司代码> */ | |
| 184 | - /* fun.getbrancheCompanyValues(businessCode,function() { | |
| 185 | - | |
| 159 | + /** 填充分公司下拉框 @param:<businessCode:公司代码> */ | |
| 160 | + fun.getbrancheCompanyValues(businessCode,function() { | |
| 186 | 161 | // 获取分公司元素并设值 |
| 187 | 162 | $('#brancheCompanySelect').val(CarParkObj.carParkBrancheCompany); |
| 188 | - | |
| 189 | - }); */ | |
| 190 | - | |
| 163 | + }); | |
| 191 | 164 | }); |
| 192 | - | |
| 193 | 165 | // 公司值改变事件 |
| 194 | - // $('#companySelect').on('change',companySelectChangeSetBrancheValue); | |
| 195 | - | |
| 166 | + $('#companySelect').on('change',companySelectChangeSetBrancheValue); | |
| 196 | 167 | function companySelectChangeSetBrancheValue() { |
| 197 | - | |
| 198 | 168 | // 获取公司下拉框选择值 |
| 199 | 169 | var businessCode = $('#companySelect').val(); |
| 200 | - | |
| 201 | 170 | // 分公司下拉框options属性值 |
| 202 | 171 | var options = '<option value="">-- 请选择分公司 --</option>'; |
| 203 | - | |
| 204 | 172 | // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 |
| 205 | 173 | if(businessCode == null || businessCode ==''){ |
| 206 | - | |
| 207 | 174 | // 填充分公司下拉框options |
| 208 | 175 | $('#brancheCompanySelect').html(options); |
| 209 | - | |
| 210 | 176 | } else { |
| 211 | - | |
| 212 | 177 | // 查询出所属公司下的分公司名称和相应分公司代码 |
| 213 | 178 | $get('/business/all', {upCode_eq: businessCode}, function(array){ |
| 214 | - | |
| 215 | 179 | // 遍历array |
| 216 | 180 | $.each(array, function(i,d){ |
| 217 | - | |
| 218 | 181 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; |
| 219 | - | |
| 220 | 182 | }); |
| 221 | - | |
| 222 | 183 | // 填充分公司下拉框options |
| 223 | 184 | $('#brancheCompanySelect').html(options); |
| 224 | - | |
| 225 | 185 | }); |
| 226 | 186 | } |
| 227 | 187 | } |
| 228 | - | |
| 229 | 188 | // 显示mobal |
| 230 | 189 | $('#editPoitsions_carpark_mobal').modal({show : true,backdrop: 'static',keyboard: false}); |
| 231 | - | |
| 232 | 190 | // 当调用 hide 实例方法时触发 |
| 233 | 191 | $('#editPoitsions_carpark_mobal').on('hide.bs.modal', function () { |
| 234 | - | |
| 235 | 192 | clearSechear(); |
| 236 | - | |
| 237 | 193 | }); |
| 238 | - | |
| 239 | 194 | function clearSechear(){ |
| 240 | - | |
| 241 | 195 | map.clearMarkAndOverlays(); |
| 242 | - | |
| 243 | 196 | carP.setEitdCarPark({}); |
| 244 | - | |
| 245 | 197 | fun.initCarPark(carParkId); |
| 246 | - | |
| 247 | 198 | } |
| 248 | - | |
| 249 | 199 | // 编辑表单元素 |
| 250 | 200 | var form = $('#edit_carPark_form'); |
| 251 | - | |
| 252 | 201 | // 获取错误提示元素 |
| 253 | 202 | var error = $('.alert-danger', form); |
| 254 | - | |
| 255 | 203 | // 提交数据按钮事件 |
| 256 | 204 | $('#editStationButton').on('click', function() { |
| 257 | - | |
| 258 | 205 | // 表单提交 |
| 259 | 206 | form.submit(); |
| 260 | - | |
| 261 | 207 | }); |
| 262 | - | |
| 263 | 208 | // 表单验证 |
| 264 | 209 | form.validate({ |
| 265 | 210 | |
| ... | ... | @@ -270,80 +215,52 @@ $('#editPoitsions_carpark_mobal').on('editCarParkMobal_show', function(e, map,fu |
| 270 | 215 | focusInvalid : false, |
| 271 | 216 | |
| 272 | 217 | rules : { |
| 273 | - | |
| 274 | - // 停车场名称 | |
| 275 | - 'parkName' : { | |
| 276 | - | |
| 277 | - // 必填项 | |
| 278 | - required : true | |
| 279 | - | |
| 280 | - } | |
| 281 | - | |
| 218 | + 'parkName' : {required : true,},// 停车场名称 必填项 | |
| 219 | + 'parkCode' : {required : true},// 停车场编码 必填项 | |
| 220 | + 'bCenterPoint' : {required : true,},// 经纬度坐标点 必填项 | |
| 221 | + 'shapesType' : {required : true,},// 几何图形类型 必填项 | |
| 222 | + 'radius' : {required : true,digits:true},// 圆形半径 必填项 | |
| 223 | + 'destroy' : {required : true,},// 是否撤销 必填项 | |
| 224 | + 'area' : {number:true,},// 面积 数字 | |
| 225 | + 'descriptions' : {maxlength: 200,},// 描述/说明 最大长度200 | |
| 282 | 226 | }, |
| 283 | - | |
| 284 | 227 | invalidHandler : function(event, validator) { |
| 285 | - | |
| 286 | 228 | error.show(); |
| 287 | - | |
| 288 | 229 | App.scrollTo(error, -200); |
| 289 | - | |
| 290 | 230 | }, |
| 291 | - | |
| 292 | 231 | highlight : function(element) { |
| 293 | - | |
| 294 | 232 | $(element).closest('.form-group').addClass('has-error'); |
| 295 | - | |
| 296 | 233 | }, |
| 297 | - | |
| 298 | 234 | unhighlight : function(element) { |
| 299 | - | |
| 300 | 235 | $(element).closest('.form-group').removeClass('has-error'); |
| 301 | - | |
| 302 | 236 | }, |
| 303 | - | |
| 304 | 237 | success : function(label) { |
| 305 | - | |
| 306 | 238 | label.closest('.form-group').removeClass('has-error'); |
| 307 | - | |
| 308 | 239 | }, |
| 309 | - | |
| 310 | 240 | submitHandler : function(f) { |
| 311 | - | |
| 312 | 241 | var params = form.serializeJSON(); |
| 313 | - | |
| 314 | 242 | params.createBy = CarParkObj.carParkCreateBy; |
| 315 | - | |
| 316 | 243 | // 定义日期格式 |
| 317 | 244 | var fs = 'YYYY-MM-DD HH:mm:ss' |
| 318 | - | |
| 319 | 245 | // 设置日期 |
| 320 | 246 | params.createDate = moment(CarParkObj.carParkCreateDate).format(fs); |
| 321 | - | |
| 322 | 247 | error.hide(); |
| 323 | - | |
| 248 | + if(params.shapesType=='多边形') | |
| 249 | + params.shapesType = 'd'; | |
| 250 | + else if(params.shapesType=='圆形') | |
| 251 | + params.shapesType=='r'; | |
| 324 | 252 | ajaxd.carParkUpdate(params,function(resuntDate) { |
| 325 | - | |
| 326 | 253 | if(resuntDate.status=='SUCCESS') { |
| 327 | - | |
| 328 | 254 | // 弹出添加成功提示消息 |
| 329 | 255 | layer.msg('修改成功...'); |
| 330 | - | |
| 331 | - | |
| 332 | 256 | }else { |
| 333 | - | |
| 334 | 257 | // 弹出添加失败提示消息 |
| 335 | 258 | layer.msg('修改失败...'); |
| 336 | - | |
| 337 | 259 | } |
| 338 | - | |
| 339 | 260 | clearSechear(); |
| 340 | - | |
| 341 | 261 | $('#editPoitsions_carpark_mobal').modal('hide'); |
| 342 | - | |
| 343 | 262 | }) |
| 344 | - | |
| 345 | 263 | } |
| 346 | 264 | }); |
| 347 | - | |
| 348 | 265 | }); |
| 349 | 266 | </script> |
| 350 | 267 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/edit_select.html
| ... | ... | @@ -3,34 +3,31 @@ |
| 3 | 3 | |
| 4 | 4 | <div class="modal-dialog"> |
| 5 | 5 | |
| 6 | - <div class="modal-content"> | |
| 6 | + <div class="modal-content" style="width:700px"> | |
| 7 | 7 | |
| 8 | 8 | <div class="modal-header"> |
| 9 | 9 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> |
| 10 | - <h4 class="modal-title">选择修改停车场方式</h4> | |
| 10 | + <h4 class="modal-title">选择修改停车场方式 | |
| 11 | + <i class="fa fa-question-circle tipso-animation" style="color: rgba(158, 158, 158, 0.49);"></i> | |
| 12 | + </h4> | |
| 11 | 13 | </div> |
| 12 | 14 | |
| 13 | 15 | <div class="modal-body"> |
| 14 | - | |
| 15 | 16 | <form class="form-horizontal" action="/" method="post" id="edit_select" role="form"> |
| 16 | - | |
| 17 | 17 | <div class="alert alert-danger display-hide" id="editSelectrequired"> |
| 18 | 18 | <button class="close" data-close="alert"></button> |
| 19 | - 站点名称为必填项 | |
| 19 | + 停车场名称为必填项 | |
| 20 | 20 | </div> |
| 21 | - | |
| 22 | 21 | <div class="alert alert-danger display-hide" id="serchrname"> |
| 23 | 22 | <button class="close" data-close="alert"></button> |
| 24 | 23 | 系统无法生成,请选择其他方式新增 |
| 25 | 24 | </div> |
| 26 | - | |
| 27 | 25 | <div class="form-group" id="formRequ"> |
| 28 | 26 | <label class="col-md-3 control-label"><span class="required"> * </span>停车场名称:</label> |
| 29 | 27 | <div class="col-md-9" id="errorInfo"> |
| 30 | 28 | <input type="text" class="form-control input-medium" id="carParkNameboxInput" name="carParkNamebox"> |
| 31 | 29 | </div> |
| 32 | 30 | </div> |
| 33 | - | |
| 34 | 31 | <div class="form-group"> |
| 35 | 32 | <label class="col-md-3 control-label">修改方式:</label> |
| 36 | 33 | <div class="col-md-9"> |
| ... | ... | @@ -44,13 +41,6 @@ |
| 44 | 41 | </div> |
| 45 | 42 | </div> |
| 46 | 43 | </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 | 44 | </form> |
| 55 | 45 | </div> |
| 56 | 46 | <div class="modal-footer"> |
| ... | ... | @@ -61,118 +51,87 @@ |
| 61 | 51 | </div> |
| 62 | 52 | </div> |
| 63 | 53 | <script type="text/javascript"> |
| 64 | - | |
| 65 | 54 | $('#editPositions_select_mobal').on('editSelectMobal_show', function(e, map,fun,carParkE,ajaxd){ |
| 66 | - | |
| 67 | 55 | // 显示选择修改方式弹出层 |
| 68 | 56 | $('#editPositions_select_mobal').modal({show : true,backdrop: 'static',keyboard: false}); |
| 69 | - | |
| 57 | + $('.tipso-animation').tipso({ | |
| 58 | + speed : 100, | |
| 59 | + background : '#0ed0e8', | |
| 60 | + color : '#ffffff', | |
| 61 | + position :'right', | |
| 62 | + width : 390, | |
| 63 | + delay : 400, | |
| 64 | + animationIn : 'bounceIn', | |
| 65 | + animationOut : 'bounceOut', | |
| 66 | + offsetX : -485, | |
| 67 | + offsetY : -25, | |
| 68 | + content :'<span style="display:block; float:left;font-size:x-small;line-height:12px">A)手动规划:手动在地图上画出停车场范围,然后双击鼠标右键保存.</span></br>'+ | |
| 69 | + '<span style="display:block; float:left;font-size:x-small">B)重新编辑:编辑原始位置与站点信息.</span>', | |
| 70 | + | |
| 71 | + }); | |
| 72 | + setTimeout(function(){ | |
| 73 | + $('.tipso-animation').tipso('show'); | |
| 74 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | |
| 75 | + },500); | |
| 70 | 76 | var carParkObj = carParkE.getEitdCarPark(); |
| 71 | - | |
| 72 | 77 | // 获取停车场名称元素并赋值 |
| 73 | 78 | $('#carParkNameboxInput').val(carParkObj.carParkName); |
| 74 | - | |
| 75 | 79 | // 定义停车场图形类型 |
| 76 | 80 | var stationShapesTypeV = carParkObj.carParkShapesType; |
| 77 | - | |
| 78 | 81 | // 获取表单元素 |
| 79 | 82 | var form = $('#edit_select'); |
| 80 | - | |
| 81 | 83 | // 获取错误提示元素 |
| 82 | 84 | var editSelectrequired = $('#editSelectrequired', form); |
| 83 | - | |
| 84 | 85 | // 下一步操作事件 |
| 85 | 86 | $('#editselectStationNextButton').on('click', function() { |
| 86 | - | |
| 87 | 87 | // 表单提交 |
| 88 | 88 | form.submit(); |
| 89 | - | |
| 90 | 89 | }); |
| 91 | - | |
| 92 | 90 | //form 表单验证 |
| 93 | 91 | form.validate({ |
| 94 | - | |
| 95 | 92 | errorElement : 'span', |
| 96 | - | |
| 97 | 93 | errorClass : 'help-block help-block-error', |
| 98 | - | |
| 99 | 94 | focusInvalid : false, |
| 100 | - | |
| 101 | 95 | rules : { |
| 102 | - | |
| 103 | - 'carParkNamebox' : { | |
| 104 | - | |
| 105 | - required : true, | |
| 106 | - | |
| 107 | - } | |
| 108 | - | |
| 96 | + 'carParkNamebox' : {required : true,} | |
| 109 | 97 | }, |
| 110 | - | |
| 111 | 98 | invalidHandler : function(event, validator) { |
| 112 | - | |
| 113 | 99 | editSelectrequired.show(); |
| 114 | - | |
| 115 | 100 | App.scrollTo(requiredname, -200); |
| 116 | - | |
| 117 | 101 | }, |
| 118 | 102 | |
| 119 | 103 | highlight : function(element) { |
| 120 | - | |
| 121 | 104 | $(element).closest('.form-group').addClass('has-error'); |
| 122 | - | |
| 123 | 105 | }, |
| 124 | - | |
| 125 | 106 | unhighlight : function(element) { |
| 126 | - | |
| 127 | 107 | $(element).closest('.form-group').removeClass('has-error'); |
| 128 | - | |
| 129 | 108 | }, |
| 130 | - | |
| 131 | 109 | success : function(label) { |
| 132 | - | |
| 133 | 110 | label.closest('.form-group').removeClass('has-error'); |
| 134 | - | |
| 135 | 111 | }, |
| 136 | - | |
| 137 | 112 | submitHandler : function(f) { |
| 138 | - | |
| 139 | 113 | // 隐藏弹出层 |
| 140 | 114 | $('#editPositions_select_mobal').modal('hide'); |
| 141 | - | |
| 142 | 115 | $('#eidt').attr("disabled",true); |
| 143 | - | |
| 144 | 116 | $('#eidt').addClass('btn disabled'); |
| 145 | - | |
| 146 | 117 | // 表单序列 |
| 147 | 118 | var params = form.serializeJSON(); |
| 148 | - | |
| 149 | 119 | // 停车场名称 |
| 150 | 120 | var editStationName = params.carParkNamebox; |
| 151 | - | |
| 152 | 121 | var eidtselect_ = params.editselect; |
| 153 | - | |
| 154 | 122 | // 设置停车场名称 |
| 155 | 123 | carParkE.setEitdCarParkName(editStationName); |
| 156 | - | |
| 157 | 124 | if(eidtselect_==0){ |
| 158 | - | |
| 159 | 125 | map.localSearchFromAdreesToPoint(editStationName); |
| 160 | - | |
| 161 | 126 | map.openDrawingManager(); |
| 162 | - | |
| 163 | 127 | }else if(eidtselect_==1){ |
| 164 | - | |
| 165 | 128 | // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) |
| 166 | 129 | var mindex = layer.msg('编辑完图形后,请双击图形区域保存',{ offset: '126px', |
| 167 | 130 | shift: 0,time: 10000}); |
| 168 | - | |
| 169 | 131 | // 编辑图形 |
| 170 | 132 | map.editShapes(stationShapesTypeV,mindex); |
| 171 | - | |
| 172 | 133 | } |
| 173 | - | |
| 174 | 134 | } |
| 175 | 135 | }); |
| 176 | - | |
| 177 | 136 | }); |
| 178 | 137 | </script> |
| 179 | 138 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/add-form-events.js
| 1 | 1 | $(function(){ |
| 2 | - | |
| 3 | - // 提交 | |
| 4 | - $('.button-submit').on('click',function() { | |
| 5 | - | |
| 6 | - // 获取表单 | |
| 7 | - var formSubm = $('#submit_carpark_form'); | |
| 8 | - | |
| 9 | - formSubm.submit(); | |
| 10 | - | |
| 11 | - }); | |
| 2 | + // 获取表单 提交 | |
| 3 | + $('.button-submit').on('click',function() {$('#submit_carpark_form').submit();}); | |
| 12 | 4 | |
| 13 | 5 | $('#oppenDrawingManager').on('click',function() { |
| 14 | - | |
| 15 | 6 | addCarParkVmapWorlds.drawingManagerOpen(); |
| 16 | - | |
| 17 | 7 | }); |
| 18 | - | |
| 19 | 8 | $('#closeDrawingManager').on('click',function() { |
| 20 | - | |
| 21 | 9 | addCarParkVmapWorlds.drawingManagerClose(); |
| 22 | - | |
| 23 | 10 | }); |
| 24 | - | |
| 25 | 11 | }); |
| 26 | 12 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/add-form-reload.js
| ... | ... | @@ -13,93 +13,66 @@ |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | (function(){ |
| 16 | - | |
| 17 | 16 | // 关闭左侧栏 |
| 18 | - if (!$('body').hasClass('page-sidebar-closed')) { | |
| 19 | - | |
| 20 | - $('.menu-toggler.sidebar-toggler').click(); | |
| 21 | - | |
| 22 | - } | |
| 23 | - | |
| 17 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | |
| 24 | 18 | setTimeout(function(){ |
| 25 | - | |
| 19 | + $('.tipso-animation').tipso({ | |
| 20 | + speed : 100, | |
| 21 | + background : '#0ed0e8', | |
| 22 | + color : '#ffffff', | |
| 23 | + position :'right', | |
| 24 | + width : 410, | |
| 25 | + delay : 400, | |
| 26 | + animationIn : 'bounceIn', | |
| 27 | + animationOut : 'bounceOut', | |
| 28 | + offsetX : 12, | |
| 29 | + offsetY : -70, | |
| 30 | + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)系统生成:根据停车场名称自动生成以100米为半径范围的圆.</span></br>'+ | |
| 31 | + '<span style="display:block; float:left;font-size:x-small;">B)手动绘制:手动在地图上画出停车场范围,然后双击鼠标右键保存.</span>', | |
| 32 | + | |
| 33 | + }); | |
| 34 | + $('.tipso-animation').tipso('show'); | |
| 35 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | |
| 26 | 36 | FormWizard.init(); |
| 27 | - | |
| 28 | - mapB = addCarParkVmapWorlds.init(); | |
| 29 | - | |
| 30 | 37 | PublicFunctions.getCarParkCode(function(d) { |
| 31 | - | |
| 32 | 38 | $('#parkCodeInput').val(d.carParkCode); |
| 33 | - | |
| 34 | 39 | }); |
| 35 | - | |
| 36 | 40 | $('#destroySelect').val('0'); |
| 37 | - | |
| 38 | 41 | PublicFunctions.getBusinessAllInfo(function(array) { |
| 39 | - | |
| 40 | 42 | var opGroup = '<option value="">请选择...</option><optgroup label="公司">'; |
| 41 | - | |
| 42 | 43 | var len_ = array.length; |
| 43 | - | |
| 44 | 44 | if(len_>0) { |
| 45 | - | |
| 46 | 45 | $.each(array, function(i, g){ |
| 47 | - | |
| 48 | 46 | opGroup += '<option value="'+g.businessCode+'">'+g.businessName+'</option>'; |
| 49 | - | |
| 50 | 47 | }); |
| 51 | - | |
| 52 | 48 | } |
| 53 | - | |
| 54 | 49 | opGroup += '</optgroup>'; |
| 55 | - | |
| 56 | 50 | $('#companySelect').html(opGroup).select2(); |
| 57 | - | |
| 58 | 51 | }); |
| 59 | - | |
| 60 | - /*var htm = '<option value="">请选择...</option><optgroup label="公司">'; | |
| 61 | - | |
| 52 | + var htm = '<option value="">请选择...</option><optgroup label="分公司">'; | |
| 62 | 53 | $('#brancheCompanySelect').html(htm).select2(); |
| 63 | - | |
| 64 | 54 | $('#companySelect').on("change", function (e) { |
| 65 | - | |
| 66 | 55 | // 获取公司下拉框选择值 |
| 67 | 56 | var businessCode = $('#companySelect').val(); |
| 68 | - | |
| 69 | 57 | // 分公司下拉框options属性值 |
| 70 | 58 | var options = '<option value="">请选择...</option><optgroup label="分公司">'; |
| 71 | - | |
| 72 | 59 | // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 |
| 73 | 60 | if(businessCode == null || businessCode ==''){ |
| 74 | - | |
| 75 | 61 | options += '</optgroup>'; |
| 76 | - | |
| 77 | 62 | // 填充分公司下拉框options |
| 78 | 63 | $('#brancheCompanySelect').html(options).select2(); |
| 79 | - | |
| 80 | 64 | } else { |
| 81 | - | |
| 82 | 65 | // 查询出所属公司下的分公司名称和相应分公司代码 |
| 83 | 66 | $get('/business/all', {upCode_eq: businessCode}, function(array){ |
| 84 | - | |
| 85 | 67 | // 遍历array |
| 86 | 68 | $.each(array, function(i,d){ |
| 87 | - | |
| 88 | 69 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; |
| 89 | - | |
| 90 | 70 | options += '</optgroup>'; |
| 91 | - | |
| 92 | 71 | }); |
| 93 | - | |
| 94 | 72 | // 填充分公司下拉框options |
| 95 | 73 | $('#brancheCompanySelect').html(options).select2(); |
| 96 | - | |
| 97 | 74 | }); |
| 98 | 75 | } |
| 99 | - | |
| 100 | 76 | }); |
| 101 | - */ | |
| 102 | - | |
| 103 | - }, 500); | |
| 104 | - | |
| 77 | + }, 300); | |
| 105 | 78 | })(); |
| 106 | 79 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
| 1 | - | |
| 2 | 1 | /** |
| 3 | 2 | * 表单的导航向导、验证、提交 |
| 4 | 3 | * |
| 5 | 4 | */ |
| 6 | - | |
| 7 | 5 | var FormWizard = function() { |
| 8 | - | |
| 9 | 6 | return { |
| 10 | - | |
| 11 | 7 | // 启动初始化向导导航 |
| 12 | 8 | init : function() { |
| 13 | - | |
| 14 | - if(!jQuery().bootstrapWizard) { | |
| 15 | - | |
| 16 | - return; | |
| 17 | - | |
| 18 | - } | |
| 19 | - | |
| 9 | + if(!jQuery().bootstrapWizard) {return;} | |
| 20 | 10 | // 定义表单 |
| 21 | 11 | var form = $('#submit_carpark_form'); |
| 22 | - | |
| 23 | 12 | // 定义表单异常 |
| 24 | 13 | var error = $('.alert-danger',form); |
| 25 | - | |
| 26 | 14 | // 定义表单成功 |
| 27 | 15 | var success = $('.alert-success',form); |
| 28 | - | |
| 29 | 16 | // 表单验证 |
| 30 | 17 | form.validate({ |
| 31 | - | |
| 32 | 18 | // 错误提示元素span对象 |
| 33 | 19 | errorElement : 'span', |
| 34 | - | |
| 35 | 20 | // 错误提示元素class名称 |
| 36 | 21 | errorClass : 'help-block help-block-error', |
| 37 | - | |
| 38 | 22 | // 验证错误获取焦点 |
| 39 | 23 | focusInvalid : true, |
| 40 | - | |
| 41 | 24 | // 需要验证的表单元素 |
| 42 | 25 | rules : { |
| 43 | - | |
| 44 | - // 停车场名称 | |
| 45 | - 'parkNamebooxt' : { | |
| 46 | - | |
| 47 | - // 必填项 | |
| 48 | - required : true, | |
| 49 | - | |
| 50 | - }, | |
| 51 | - | |
| 52 | - // 停车场名称 | |
| 53 | - 'parkName' : { | |
| 54 | - | |
| 55 | - // 必填项 | |
| 56 | - required : true, | |
| 57 | - | |
| 58 | - }, | |
| 59 | - | |
| 60 | - // 停车场编码 | |
| 61 | - 'parkCode' : { | |
| 62 | - | |
| 63 | - // 必填项 | |
| 64 | - required : true, | |
| 65 | - }, | |
| 66 | - | |
| 67 | - // 中心点坐标 | |
| 68 | - 'bCenterPoint' : { | |
| 69 | - | |
| 70 | - // 必填项 | |
| 71 | - required : true, | |
| 72 | - | |
| 73 | - }, | |
| 74 | - | |
| 75 | - // 图形类型 | |
| 76 | - 'shapesType' : { | |
| 77 | - | |
| 78 | - // 必填项 | |
| 79 | - required : true, | |
| 80 | - }, | |
| 81 | - | |
| 82 | - // 所属分公司 | |
| 83 | - /*'brancheCompany' : { | |
| 84 | - | |
| 85 | - // 必填项 | |
| 86 | - required : true, | |
| 87 | - }*/ | |
| 88 | - | |
| 89 | - | |
| 26 | + 'parkNamebooxt' : {required : true,},// 停车场名称 必填项 | |
| 27 | + 'parkName' : {required : true,},// 停车场名称 必填项 | |
| 28 | + 'parkCode' : {required : true,alnum:true, remote : { | |
| 29 | + type : "get",// 异步发送请求到服务器,验证parkCode | |
| 30 | + url : "/carpark/isHaveParkCode",//需要服务器controllor 中提供停车场编码检查的方法 | |
| 31 | + cache:false, | |
| 32 | + async:false, | |
| 33 | + data : {'parkCode' : function() { return $("#parkCodeInput").val(); }}, | |
| 34 | + }},// 停车场编码 必填项 | |
| 35 | + 'bCenterPoint' : {required : true,},// 经纬度坐标点 必填项 | |
| 36 | + 'shapesType' : {required : true,},// 几何图形类型 必填项 | |
| 37 | + 'radius' : {required : true,digits:true},// 圆形半径 必填项 | |
| 38 | + 'destroy' : {required : true,},// 是否撤销 必填项 | |
| 39 | + 'area' : {number:true,},// 面积 数字 | |
| 40 | + 'descriptions' : {maxlength: 200,},// 描述/说明 最大长度200 | |
| 41 | + }, | |
| 42 | + messages:{ | |
| 43 | + 'parkCode':{remote:'停车场编码系统已存在,请您重新输入!',}, | |
| 90 | 44 | }, |
| 91 | - | |
| 92 | 45 | /** |
| 93 | 46 | * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。 |
| 94 | 47 | * |
| 95 | 48 | * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator) |
| 96 | 49 | */ |
| 97 | 50 | invalidHandler : function(event, validator) { |
| 98 | - | |
| 99 | 51 | // 显示表单未通过提示信息 |
| 100 | 52 | error.show(); |
| 101 | - | |
| 102 | 53 | // 把提示信息放到指定的位置。 |
| 103 | 54 | App.scrollTo(error, -200); |
| 104 | 55 | }, |
| 105 | - | |
| 106 | 56 | /** |
| 107 | 57 | * 类型:Callback。 |
| 108 | 58 | * |
| 109 | 59 | * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。 |
| 110 | 60 | */ |
| 111 | 61 | highlight : function(element) { |
| 112 | - | |
| 113 | 62 | // 添加errorClass("has-error")到表单元素 |
| 114 | 63 | $(element).closest('.form-group').addClass('has-error'); |
| 115 | 64 | }, |
| 116 | - | |
| 117 | 65 | /** |
| 118 | 66 | * 类型:Callback。 |
| 119 | 67 | * |
| 120 | 68 | * 默认:移除errorClass("has-error")。与highlight操作相反 |
| 121 | 69 | */ |
| 122 | 70 | unhighlight : function(element) { |
| 123 | - | |
| 124 | 71 | // 移除errorClass("has-error") |
| 125 | 72 | $(element).closest('.form-group').removeClass('has-error'); |
| 126 | 73 | }, |
| 127 | - | |
| 128 | 74 | /** |
| 129 | 75 | * 类型:String,Callback。 |
| 130 | 76 | * |
| ... | ... | @@ -135,176 +81,146 @@ var FormWizard = function() { |
| 135 | 81 | * 如果是一个回调函数,则将标签作为其唯一的参数。 |
| 136 | 82 | */ |
| 137 | 83 | success : function(label) { |
| 138 | - | |
| 139 | 84 | // 当验证通过时,移除errorClass("has-error") |
| 140 | 85 | label.closest('.form-group').removeClass('has-error'); |
| 141 | 86 | }, |
| 142 | - | |
| 143 | 87 | /** |
| 144 | 88 | * 类型:Callback。 |
| 145 | 89 | * |
| 146 | 90 | * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form |
| 147 | 91 | */ |
| 148 | 92 | submitHandler : function(f) { |
| 149 | - | |
| 150 | 93 | // 表单序列化 |
| 151 | 94 | var params = form.serializeJSON(); |
| 152 | - | |
| 95 | + if(params.shapesType=='圆形') | |
| 96 | + params.shapesType='r'; | |
| 97 | + else if(params.shapesType=='多边形') | |
| 98 | + params.shapesType='d'; | |
| 153 | 99 | //保存站点 |
| 154 | 100 | PublicFunctions.carParkSave(params,function(data) { |
| 155 | - | |
| 156 | 101 | if(data.status=='SUCCESS') { |
| 157 | - | |
| 158 | 102 | // 弹出添加成功提示消息 |
| 159 | 103 | layer.msg('添加成功...'); |
| 160 | - | |
| 161 | - | |
| 162 | 104 | }else { |
| 163 | - | |
| 164 | 105 | // 弹出添加失败提示消息 |
| 165 | 106 | layer.msg('添加失败...'); |
| 166 | - | |
| 167 | 107 | } |
| 168 | - | |
| 169 | 108 | // 返回list.html页面 |
| 170 | 109 | loadPage('/pages/base/carpark/list.html'); |
| 171 | - | |
| 172 | 110 | }); |
| 173 | - | |
| 174 | 111 | } |
| 175 | 112 | }); |
| 113 | + $.validator.addMethod("alnum", function(value, element) { | |
| 114 | + return this.optional(element) || /^[a-zA-Z0-9]+$/.test(value); | |
| 115 | + }, "停车场编码只能包括英文字母和数字,请您重新输入!"); | |
| 116 | + | |
| 117 | + /*$.validator.addMethod("isHave", function(value, element) { | |
| 118 | + PublicFunctions.isHaveParkCode({'parkCode':value},function(d) { | |
| 119 | + debugger; | |
| 120 | + console.log(d); | |
| 121 | + if(d.length>0) | |
| 122 | + return false; | |
| 123 | + else | |
| 124 | + return true; | |
| 125 | + }); | |
| 126 | + }, "停车场编码系统已存在,请您重新输入!");*/ | |
| 176 | 127 | |
| 177 | 128 | // 确认提交信息 |
| 178 | 129 | var displayConfirm = function() { |
| 179 | - | |
| 180 | 130 | // 遍历表单元素下的tab4的class名称为form-control-static |
| 181 | 131 | $('#tab4 .form-control-static', form).each(function(){ |
| 182 | - | |
| 183 | 132 | // 定义input |
| 184 | 133 | var input = $('[name="'+$(this).attr("data-display")+'"]', form); |
| 185 | - | |
| 186 | 134 | if (input.is(":radio")) { |
| 187 | - | |
| 188 | 135 | input = $('[name="'+$(this).attr("data-display")+'"]:checked', form); |
| 189 | - | |
| 190 | 136 | } |
| 191 | 137 | if (input.is(":text") || input.is("textarea")) { |
| 192 | - | |
| 193 | 138 | $(this).html(input.val()); |
| 194 | - | |
| 195 | 139 | } else if (input.is("select")) { |
| 196 | - | |
| 197 | 140 | $(this).html(input.find('option:selected').text()); |
| 198 | - | |
| 199 | 141 | } else if (input.is(":radio") && input.is(":checked")) { |
| 200 | - | |
| 201 | 142 | $(this).html(input.attr("data-title")); |
| 202 | - | |
| 203 | 143 | } else if ($(this).attr("data-display") == 'payment[]') { |
| 204 | - | |
| 205 | 144 | var payment = []; |
| 206 | - | |
| 207 | 145 | $('[name="payment[]"]:checked', form).each(function(){ |
| 208 | - | |
| 209 | 146 | payment.push($(this).attr('data-title')); |
| 210 | - | |
| 211 | 147 | }); |
| 212 | - | |
| 213 | 148 | $(this).html(payment.join("<br>")); |
| 214 | 149 | } |
| 215 | 150 | }); |
| 216 | 151 | } |
| 217 | - | |
| 218 | 152 | /** 按钮点击时触发 */ |
| 219 | 153 | var handleTitle = function(tab, navigation, index) { |
| 220 | - | |
| 221 | 154 | // 定义导航条标签个数 |
| 222 | 155 | var total = navigation.find('li').length; |
| 223 | - | |
| 224 | 156 | // 当前标签页 |
| 225 | 157 | var current = index + 1; |
| 226 | - | |
| 227 | 158 | // 设置向导标题 |
| 228 | 159 | $('.step-title', $('#form-wizard-info')).text((index + 1) + ' - ' + total); |
| 229 | - | |
| 230 | 160 | // 删除"done"样式 |
| 231 | 161 | jQuery('li', $('#form-wizard-info')).removeClass("done"); |
| 232 | - | |
| 233 | 162 | // 获取导航标签元素集合 |
| 234 | 163 | var li_list = navigation.find('li'); |
| 235 | - | |
| 236 | 164 | // 遍历 |
| 237 | 165 | for (var i = 0; i < index; i++) { |
| 238 | - | |
| 239 | 166 | // 追加done样式 |
| 240 | 167 | jQuery(li_list[i]).addClass("done"); |
| 241 | - | |
| 242 | 168 | } |
| 243 | - | |
| 244 | - | |
| 245 | 169 | /** 如果为第一步隐藏返回按钮,否则显示返回按钮. */ |
| 246 | 170 | if (current == 1) { |
| 247 | - | |
| 248 | 171 | // 隐藏返回按钮 |
| 249 | 172 | $('#submit_carpark_form').find('.button-previous').hide(); |
| 250 | - | |
| 251 | 173 | } else { |
| 252 | - | |
| 253 | 174 | // 显示返回按钮 |
| 254 | 175 | $('#submit_carpark_form').find('.button-previous').show(); |
| 255 | - | |
| 256 | 176 | } |
| 257 | - | |
| 258 | 177 | if (current == 2) { |
| 259 | - | |
| 260 | - // 获取新增方式值 | |
| 261 | - var baseResValue = $('#submit_carpark_form input[name="baseRes"]:checked').val(); | |
| 262 | - | |
| 263 | - // 获取停车场名称值 | |
| 264 | - var stationNameV = $('#parkNamebooxtInput').val(); | |
| 265 | - | |
| 266 | - // 设置停车场名称 | |
| 267 | - $('#parkNameInput').val(stationNameV); | |
| 268 | - | |
| 269 | - if(baseResValue == 0) { | |
| 270 | - | |
| 271 | - $('.leftUtils').hide(); | |
| 272 | - | |
| 273 | - addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) { | |
| 274 | - | |
| 275 | - if(p) { | |
| 276 | - | |
| 277 | - addCarParkVmapWorlds.pointsCircle(p); | |
| 278 | - | |
| 279 | - } | |
| 280 | - | |
| 281 | - }); | |
| 282 | - | |
| 283 | - }else if(baseResValue ==1) { | |
| 284 | - | |
| 285 | - addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {}); | |
| 286 | - | |
| 287 | - $('.leftUtils').show(); | |
| 288 | - | |
| 289 | - addCarParkVmapWorlds.drawingManagerOpen(); | |
| 290 | - | |
| 291 | - } | |
| 178 | + layer.closeAll(); | |
| 179 | + var container = $("#addCarParkbmap_basic"); | |
| 180 | + container.children().remove(); | |
| 181 | + container.show(); | |
| 182 | + setTimeout(function(){ | |
| 183 | + addCarParkVmapWorlds.init(); | |
| 184 | + // 获取新增方式值 | |
| 185 | + var baseResValue = $('#submit_carpark_form input[name="baseRes"]:checked').val(); | |
| 186 | + // 获取停车场名称值 | |
| 187 | + var stationNameV = $('#parkNamebooxtInput').val(); | |
| 188 | + // 设置停车场名称 | |
| 189 | + $('#parkNameInput').val(stationNameV); | |
| 190 | + if(baseResValue == 0) { | |
| 191 | + $('.leftUtils').hide(); | |
| 192 | + addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) { | |
| 193 | + if(p) { | |
| 194 | + addCarParkVmapWorlds.pointsCircle(p); | |
| 195 | + } | |
| 196 | + }); | |
| 197 | + }else if(baseResValue ==1) { | |
| 198 | + addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {}); | |
| 199 | + $('.leftUtils').show(); | |
| 200 | + addCarParkVmapWorlds.drawingManagerOpen(); | |
| 201 | + } | |
| 202 | + $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); | |
| 203 | + },300) | |
| 204 | + }else if(current==3) { | |
| 205 | + setTimeout(function(){ | |
| 206 | + $('html,body').animate({scrollTop: ($('#tab3').offset().top-70) + "px"}); | |
| 207 | + layer.tips('停车场编码一旦确认提交就不能够轻易的去修改了哦:-O', '#parkCodeInput', {tips: [2, '#0ed0e8'],time: 4500,area: ['340px', '32px'],}); | |
| 208 | + },300); | |
| 209 | + }else if(current==4) { | |
| 210 | + layer.closeAll(); | |
| 211 | + setTimeout(function(){ | |
| 212 | + $('html,body').animate({scrollTop: ($('#tab4').offset().top+40) + "px"}); | |
| 213 | + },300); | |
| 292 | 214 | } |
| 293 | - | |
| 294 | 215 | /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */ |
| 295 | 216 | if (current >= total) { |
| 296 | - | |
| 297 | 217 | // 隐藏下一步按钮 |
| 298 | 218 | $('#submit_carpark_form').find('.button-next').hide(); |
| 299 | - | |
| 300 | 219 | // 显示提交按钮 |
| 301 | 220 | $('#submit_carpark_form').find('.button-submit').show(); |
| 302 | - | |
| 303 | 221 | // 确认提交信息 |
| 304 | 222 | displayConfirm(); |
| 305 | - | |
| 306 | 223 | } else { |
| 307 | - | |
| 308 | 224 | // 显示下一步按钮 |
| 309 | 225 | $('#submit_carpark_form').find('.button-next').show(); |
| 310 | 226 | |
| ... | ... | @@ -312,106 +228,59 @@ var FormWizard = function() { |
| 312 | 228 | $('#submit_carpark_form').find('.button-submit').hide(); |
| 313 | 229 | |
| 314 | 230 | } |
| 315 | - | |
| 316 | 231 | // 移动到指定位置 |
| 317 | 232 | App.scrollTo($('.page-title')); |
| 318 | - | |
| 319 | 233 | } |
| 320 | - | |
| 321 | 234 | // 表单导航向导插件 |
| 322 | 235 | $('#submit_carpark_form').bootstrapWizard({ |
| 323 | - | |
| 324 | 236 | // 下一步元素选择器 |
| 325 | 237 | 'nextSelector': '.button-next', |
| 326 | - | |
| 327 | 238 | // 返回元素选择器 |
| 328 | 239 | 'previousSelector': '.button-previous', |
| 329 | - | |
| 330 | 240 | /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */ |
| 331 | 241 | onTabClick: function (tab, navigation, index, clickedIndex) { |
| 332 | - | |
| 333 | 242 | return false; |
| 334 | - | |
| 335 | 243 | success.hide(); |
| 336 | - | |
| 337 | 244 | error.hide(); |
| 338 | - | |
| 339 | 245 | if (form.valid() == false) { |
| 340 | - | |
| 341 | 246 | return false; |
| 342 | - | |
| 343 | 247 | } |
| 344 | - | |
| 345 | 248 | handleTitle(tab, navigation, clickedIndex); |
| 346 | - | |
| 347 | 249 | }, |
| 348 | - | |
| 349 | 250 | /** 下一步按钮被单击时触发, 返回移动到下一个步骤. */ |
| 350 | 251 | onNext: function (tab, navigation, index) { |
| 351 | - | |
| 352 | 252 | success.hide(); |
| 353 | - | |
| 354 | 253 | error.hide(); |
| 355 | - | |
| 356 | 254 | if (form.valid() == false) { |
| 357 | - | |
| 358 | 255 | return false; |
| 359 | - | |
| 360 | 256 | } |
| 361 | - | |
| 362 | 257 | if(index==2) { |
| 363 | - | |
| 364 | 258 | addCarParkVmapWorlds.clearMarkAndOverlays(); |
| 365 | - | |
| 366 | 259 | addCarParkVmapWorlds.drawingManagerClose(); |
| 367 | - | |
| 368 | 260 | } |
| 369 | - | |
| 261 | + $('.tipso-animation').tipso('hide'); | |
| 370 | 262 | handleTitle(tab, navigation, index); |
| 371 | - | |
| 372 | 263 | }, |
| 373 | - | |
| 374 | 264 | /** 上一步按钮被单击时触发,返回移动到前一个步骤 */ |
| 375 | 265 | onPrevious: function (tab, navigation, index) { |
| 376 | - | |
| 377 | 266 | success.hide(); |
| 378 | - | |
| 379 | 267 | error.hide(); |
| 380 | - | |
| 381 | 268 | if(index ==0) { |
| 382 | - | |
| 383 | 269 | addCarParkVmapWorlds.drawingManagerClose(); |
| 384 | - | |
| 385 | 270 | } |
| 386 | - | |
| 387 | 271 | addCarParkVmapWorlds.clearMarkAndOverlays(); |
| 388 | - | |
| 389 | 272 | handleTitle(tab, navigation, index); |
| 390 | - | |
| 391 | 273 | }, |
| 392 | - | |
| 393 | 274 | /** 显示选项卡内容 */ |
| 394 | 275 | onTabShow: function (tab, navigation, index) { |
| 395 | - | |
| 396 | 276 | var total = navigation.find('li').length; |
| 397 | - | |
| 398 | 277 | var current = index + 1; |
| 399 | - | |
| 400 | 278 | var $percent = (current / total) * 100; |
| 401 | - | |
| 402 | - $('#submit_carpark_form').find('.progress-bar').css({ | |
| 403 | - | |
| 404 | - width: $percent + '%' | |
| 405 | - | |
| 406 | - }); | |
| 407 | - | |
| 279 | + $('#submit_carpark_form').find('.progress-bar').css({ width: $percent + '%'}); | |
| 408 | 280 | } |
| 409 | - | |
| 410 | 281 | }); |
| 411 | - | |
| 412 | 282 | // 初始化第一步隐藏返回按钮 |
| 413 | 283 | $('#submit_carpark_form').find('.button-previous').hide(); |
| 414 | - | |
| 415 | 284 | } |
| 416 | 285 | }; |
| 417 | -}(); | |
| 286 | +}(); | |
| 418 | 287 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/add-input-function.js
| ... | ... | @@ -2,64 +2,47 @@ |
| 2 | 2 | * 函数 |
| 3 | 3 | * |
| 4 | 4 | */ |
| 5 | - | |
| 6 | 5 | var PublicFunctions = function () { |
| 7 | - | |
| 8 | 6 | var PubFun = { |
| 9 | - | |
| 10 | 7 | /** @param points:中心点;bPolygonGridValue:百度坐标点图形集合;shapesTypeValue:范围图形类型;radiusValue:圆半径 */ |
| 11 | 8 | setFormInputValue: function(points,bPolygonGridValue,shapesTypeValue,radiusValue) { |
| 12 | - | |
| 13 | 9 | // 百度地图经纬度坐标中心点 |
| 14 | 10 | $('#bCenterPointInput').val(points); |
| 15 | - | |
| 16 | 11 | // 百度坐标点图形集合 |
| 17 | 12 | $('#bParkPointInput').val(bPolygonGridValue); |
| 18 | - | |
| 19 | 13 | // 图形类型 |
| 20 | - $('#shapesTypeSelect').val(shapesTypeValue); | |
| 21 | - | |
| 22 | - // 圆形半径 | |
| 14 | + if(shapesTypeValue == 'r') { | |
| 15 | + $('#shapesTypeSelect').val('圆形'); | |
| 16 | + // 圆形半径 | |
| 17 | + $('#radiusGroup').show(); | |
| 18 | + }else if(shapesTypeValue=='d') { | |
| 19 | + $('#shapesTypeSelect').val('多边形'); | |
| 20 | + $('#radiusGroup').hide(); | |
| 21 | + } | |
| 23 | 22 | $('#radiusInput').val(radiusValue); |
| 24 | - | |
| 25 | 23 | }, |
| 26 | - | |
| 27 | 24 | getBusinessAllInfo : function(cb) { |
| 28 | - | |
| 29 | 25 | // 填充公司下拉框选择值 |
| 30 | - $get('/business/all', {upCode_eq: '77'}, function(array){ | |
| 31 | - | |
| 26 | + $get('/business/all', {upCode_eq: '88'}, function(array){ | |
| 32 | 27 | cb && cb(array); |
| 33 | - | |
| 34 | 28 | }); |
| 35 | - | |
| 36 | 29 | }, |
| 37 | - | |
| 38 | 30 | getCarParkCode : function(callback) { |
| 39 | - | |
| 40 | 31 | $get('/carpark/getCarParkCode',null,function(d) { |
| 41 | - | |
| 42 | 32 | callback && callback(d); |
| 43 | - | |
| 44 | 33 | }); |
| 45 | - | |
| 46 | 34 | }, |
| 47 | - | |
| 48 | - // 新增站点保存 | |
| 35 | + isHaveParkCode : function(p,callback) { | |
| 36 | + $get('/carpark/isHaveParkCode',p,function(d) { | |
| 37 | + callback && callback(d); | |
| 38 | + }); | |
| 39 | + }, | |
| 40 | + // 新增停车场保存 | |
| 49 | 41 | carParkSave : function(carPark,callback) { |
| 50 | - | |
| 51 | - console.log(carPark); | |
| 52 | - | |
| 53 | 42 | $post('/carpark/carParkSave',carPark,function(data) { |
| 54 | - | |
| 55 | 43 | callback && callback(data); |
| 56 | - | |
| 57 | 44 | }); |
| 58 | - | |
| 59 | 45 | } |
| 60 | - | |
| 61 | 46 | } |
| 62 | - | |
| 63 | 47 | return PubFun ; |
| 64 | - | |
| 65 | 48 | }(); |
| 66 | 49 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/add-vmap-world.js
| 1 | 1 | var addCarParkVmapWorlds = function() { |
| 2 | - | |
| 3 | 2 | var mapB = '', circle = '', drawingManager = '',circle='',marker=''; |
| 4 | - | |
| 5 | 3 | var Bmap = { |
| 6 | - | |
| 7 | 4 | init : function() { |
| 8 | - | |
| 9 | 5 | // 设置中心点, |
| 10 | 6 | var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; |
| 11 | - | |
| 12 | 7 | // 百度API Key |
| 13 | 8 | var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; |
| 14 | - | |
| 15 | 9 | // 初始化百度地图 |
| 16 | 10 | mapB = new BMap.Map("addCarParkbmap_basic"); |
| 17 | - | |
| 18 | 11 | //中心点和缩放级别 |
| 19 | 12 | mapB.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); |
| 20 | - | |
| 21 | 13 | //启用地图拖拽事件,默认启用(可不写) |
| 22 | 14 | mapB.enableDragging(); |
| 23 | - | |
| 24 | 15 | //启用地图滚轮放大缩小 |
| 25 | 16 | mapB.enableScrollWheelZoom(); |
| 26 | - | |
| 27 | 17 | //禁用鼠标双击放大 |
| 28 | 18 | mapB.disableDoubleClickZoom(); |
| 29 | - | |
| 30 | 19 | //启用键盘上下左右键移动地图 |
| 31 | 20 | mapB.enableKeyboard(); |
| 32 | - | |
| 33 | 21 | var styleOptions = { |
| 34 | - | |
| 35 | 22 | //边线颜色。 |
| 36 | 23 | strokeColor : "blue", |
| 37 | - | |
| 38 | 24 | //填充颜色。当参数为空时,圆形将没有填充效果。 |
| 39 | 25 | fillColor : "blue", |
| 40 | - | |
| 41 | 26 | //边线的宽度,以像素为单位。 |
| 42 | 27 | strokeWeight : 3, |
| 43 | - | |
| 44 | 28 | //边线透明度,取值范围0 - 1。 |
| 45 | 29 | strokeOpacity : 0.8, |
| 46 | - | |
| 47 | 30 | //填充的透明度,取值范围0 - 1。 |
| 48 | 31 | fillOpacity : 0.6, |
| 49 | - | |
| 50 | 32 | //边线的样式,solid或dashed。 |
| 51 | 33 | strokeStyle : 'solid' |
| 52 | - | |
| 53 | 34 | }; |
| 54 | - | |
| 55 | 35 | // 创建鼠标绘制管理类 |
| 56 | 36 | drawingManager = new BMapLib.DrawingManager(mapB, { |
| 57 | - | |
| 58 | 37 | //是否开启绘制模式 |
| 59 | 38 | isOpen : false, |
| 60 | - | |
| 61 | 39 | //是否显示工具栏 |
| 62 | 40 | enableDrawingTool : false, |
| 63 | - | |
| 64 | 41 | drawingToolOptions : { |
| 65 | - | |
| 66 | 42 | //位置 |
| 67 | 43 | anchor : BMAP_ANCHOR_TOP_RIGHT, |
| 68 | - | |
| 69 | 44 | //偏离值 |
| 70 | 45 | offset : new BMap.Size(5, 5), |
| 71 | - | |
| 72 | 46 | //工具栏缩放比例 |
| 73 | 47 | scale : 0.8 |
| 74 | - | |
| 75 | 48 | }, |
| 76 | - | |
| 77 | 49 | //线的样式 |
| 78 | 50 | polygonOptions : styleOptions |
| 79 | - | |
| 80 | 51 | }); |
| 81 | - | |
| 82 | 52 | // 添加绘画完成事件 |
| 83 | 53 | drawingManager.addEventListener('polygoncomplete', function(e) { |
| 84 | - | |
| 85 | 54 | drawingManager.close(); |
| 86 | - | |
| 87 | 55 | if (e.getPath().length <= 2) { |
| 88 | - | |
| 89 | 56 | // 弹出提示消息 |
| 90 | 57 | layer.msg('坐标点不能小于等于两个...'); |
| 91 | - | |
| 92 | 58 | // 清除地图覆盖物 |
| 93 | 59 | mapB.clearOverlays(); |
| 94 | - | |
| 95 | 60 | drawingManager.open(); |
| 96 | - | |
| 97 | 61 | return false; |
| 98 | - | |
| 99 | 62 | }else { |
| 100 | - | |
| 101 | 63 | var pointE = e; |
| 102 | - | |
| 103 | 64 | // 多变行质心点 |
| 104 | 65 | var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; |
| 105 | - | |
| 106 | 66 | var addPolyGonLen_ = pointE.getPath().length; |
| 107 | - | |
| 108 | 67 | for(var k =0;k<addPolyGonLen_;k++) { |
| 109 | - | |
| 110 | 68 | if(k==0) { |
| 111 | - | |
| 112 | 69 | bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; |
| 113 | - | |
| 114 | 70 | }else { |
| 115 | - | |
| 116 | 71 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; |
| 117 | - | |
| 118 | 72 | } |
| 119 | - | |
| 120 | 73 | } |
| 121 | - | |
| 122 | 74 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat; |
| 123 | - | |
| 124 | 75 | PublicFunctions.setFormInputValue(addSttationPoints_,bPloygonGrid,'d',''); |
| 125 | 76 | } |
| 126 | - | |
| 127 | 77 | }); |
| 128 | - | |
| 129 | 78 | return mapB; |
| 130 | 79 | }, |
| 131 | - | |
| 132 | 80 | // 根据地理名称获取百度经纬度坐标 |
| 133 | 81 | localSearchFromAdreesToPoint: function(Address,cb) { |
| 134 | - | |
| 135 | 82 | // 创建一个搜索类实例 |
| 136 | 83 | var localSearch = new BMap.LocalSearch(mapB); |
| 137 | - | |
| 138 | 84 | // 检索完成后的回调函数。 |
| 139 | 85 | localSearch.setSearchCompleteCallback(function (searchResult) { |
| 140 | - | |
| 141 | 86 | var resultPoints = ''; |
| 142 | - | |
| 143 | 87 | if(searchResult) { |
| 144 | - | |
| 145 | 88 | // 返回索引指定的结果。索引0表示第1条结果 |
| 146 | 89 | var poi = searchResult.getPoi(0); |
| 147 | - | |
| 148 | 90 | if(poi) { |
| 149 | - | |
| 150 | 91 | //获取经度和纬度 |
| 151 | 92 | var stationNameChangePoint = new BMap.Point( poi.point.lng, poi.point.lat); |
| 152 | - | |
| 153 | 93 | marker = new BMap.Marker(stationNameChangePoint); |
| 154 | - | |
| 155 | 94 | var PanOptions ={noAnimation :true}; |
| 156 | - | |
| 157 | 95 | mapB.panTo(stationNameChangePoint,PanOptions); |
| 158 | - | |
| 159 | 96 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) |
| 160 | 97 | mapB.setZoom(18); |
| 161 | - | |
| 162 | 98 | mapB.panBy(0,-80); |
| 163 | - | |
| 164 | 99 | // 将标注添加到地图中 |
| 165 | 100 | mapB.addOverlay(marker); |
| 166 | - | |
| 167 | 101 | //跳动的动画 |
| 168 | 102 | marker.setAnimation(BMAP_ANIMATION_BOUNCE); |
| 169 | - | |
| 170 | 103 | cb && cb(stationNameChangePoint); |
| 171 | - | |
| 172 | 104 | }else { |
| 173 | - | |
| 174 | 105 | // 弹出添加成功提示消息 |
| 175 | 106 | layer.msg('无法获取停车场【'+Address+'】地理位置!'); |
| 176 | - | |
| 177 | 107 | cb && cb(false); |
| 178 | - | |
| 179 | 108 | } |
| 180 | - | |
| 181 | 109 | }else { |
| 182 | - | |
| 183 | 110 | // 弹出添加成功提示消息 |
| 184 | 111 | layer.msg('无法获取停车场【'+Address+'】地理位置!'); |
| 185 | - | |
| 186 | 112 | cb && cb(false); |
| 187 | 113 | } |
| 188 | - | |
| 189 | 114 | }); |
| 190 | - | |
| 191 | 115 | // 根据检索词发起检索。 |
| 192 | 116 | localSearch.search(Address); |
| 193 | - | |
| 194 | 117 | }, |
| 195 | 118 | |
| 196 | 119 | // 画圆 |
| 197 | 120 | pointsCircle : function(stationNameChangePoint) { |
| 198 | - | |
| 199 | 121 | //创建圆 |
| 200 | 122 | circle = new BMap.Circle(stationNameChangePoint,100,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); |
| 201 | - | |
| 202 | 123 | // 百度地图添加覆盖物圆 |
| 203 | 124 | mapB.addOverlay(circle); |
| 204 | - | |
| 205 | 125 | // 开启编辑功能 |
| 206 | 126 | circle.enableEditing(); |
| 207 | - | |
| 208 | 127 | // 编辑圆监听事件 |
| 209 | 128 | circle.addEventListener('remove',function() { |
| 210 | - | |
| 211 | 129 | // 清除marker |
| 212 | 130 | mapB.removeOverlay(marker); |
| 213 | - | |
| 214 | - /*VmapWorlds.clearMarkAndOverlays();*/ | |
| 215 | - | |
| 216 | 131 | // 返回圆形的半径,单位为米。 |
| 217 | 132 | var newRadius = circle.getRadius(); |
| 218 | - | |
| 219 | 133 | // 返回圆形的中心点坐标。 |
| 220 | 134 | var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; |
| 221 | - | |
| 222 | 135 | var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; |
| 223 | - | |
| 224 | 136 | circle = ''; |
| 225 | - | |
| 226 | 137 | PublicFunctions.setFormInputValue(newCenter,'','r',Math.round(newRadius)); |
| 227 | - | |
| 228 | 138 | }); |
| 229 | - | |
| 230 | 139 | }, |
| 231 | - | |
| 232 | 140 | // 打开绘画工具 |
| 233 | 141 | drawingManagerOpen : function() { |
| 234 | - | |
| 235 | 142 | // 打开鼠标绘画工具 |
| 236 | 143 | drawingManager.open(); |
| 237 | - | |
| 238 | 144 | // 设置属性 |
| 239 | 145 | drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); |
| 240 | - | |
| 241 | 146 | }, |
| 242 | - | |
| 243 | 147 | drawingManagerClose : function() { |
| 244 | - | |
| 245 | 148 | drawingManager.close(); |
| 246 | - | |
| 247 | 149 | }, |
| 248 | - | |
| 249 | 150 | clearMarkAndOverlays : function() { |
| 250 | - | |
| 251 | 151 | // 清楚地图覆盖物 |
| 252 | 152 | mapB.clearOverlays(); |
| 253 | - | |
| 254 | 153 | } |
| 255 | - | |
| 256 | 154 | } |
| 257 | - | |
| 258 | 155 | return Bmap; |
| 259 | - | |
| 260 | 156 | }(); |
| 261 | 157 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-list-table.js
| ... | ... | @@ -13,89 +13,154 @@ |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | (function(){ |
| 16 | + function getComp(cb) { | |
| 17 | + $.get('/user/companyData',null,function(rs) { | |
| 18 | + return cb && cb(rs); | |
| 19 | + }); | |
| 20 | + } | |
| 21 | + function initCompanySelect2(cb) { | |
| 22 | + // get请求获取公司 | |
| 23 | + $get('/business/all', {upCode_eq: '88'}, function(gs_d){ | |
| 24 | + return cb && cb(gs_d); | |
| 25 | + }); | |
| 26 | + } | |
| 27 | + initCompanySelect2(function(array) { | |
| 28 | + // 公司下拉options属性值 | |
| 29 | + var options = '<option value="">请选择...</option>'; | |
| 30 | + // 遍历array | |
| 31 | + $.each(array, function(i,d){ | |
| 32 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | |
| 33 | + }); | |
| 34 | + // 初始化公司下拉框并监听值改变事件. | |
| 35 | + $('#companySelect').html(options).on('change', setBrancheCompanySelectOptions); | |
| 36 | + // 初始化分公司下拉框. | |
| 37 | + setBrancheCompanySelectOptions(); | |
| 38 | + initLineSelect2(array); | |
| 39 | + /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */ | |
| 40 | + // loadTableDate({'destroy_eq':0,'name_like':splitxlName(storage.xlName_AgursData)},true); | |
| 41 | + }); | |
| 42 | + function initLineSelect2(compD) { | |
| 43 | + getComp(function(rs) { | |
| 44 | + var params = {}; | |
| 45 | + if(rs.length>0) { | |
| 46 | + var compA = new Array(); | |
| 47 | + for(var c = 0 ; c<rs.length;c++) { | |
| 48 | + var comC = rs[c].companyCode; | |
| 49 | + var child = rs[c].children; | |
| 50 | + if(child.length>0) { | |
| 51 | + for(var d = 0 ;d< child.length;d++) { | |
| 52 | + compA.push(comC + '_' + child[d].code); | |
| 53 | + } | |
| 54 | + }else { | |
| 55 | + compA.push(comC); | |
| 56 | + } | |
| 57 | + } | |
| 58 | + params.cgsbm_in = compA.toString(); | |
| 59 | + } | |
| 60 | + // 填充线路拉框选择值 | |
| 61 | + $get('/carpark/all', params, function(array){ | |
| 62 | + var len_ = array.length,paramsD = new Array(); | |
| 63 | + paramsD.push({'id':'请选择...' ,'text':'请选择...'}); | |
| 64 | + if(len_>0) { | |
| 65 | + $.each(array, function(i, g){ | |
| 66 | + if(g.parkName!='' || g.parkName != null) { | |
| 67 | + paramsD.push({'id':g.parkName + '_' + g.parkCode ,'text':g.parkName + gsdmTogsName(compD,g.company)}); | |
| 68 | + } | |
| 69 | + }); | |
| 70 | + if($('span').hasClass('select2-selection')) | |
| 71 | + $('span .select2-selection').remove(); | |
| 72 | + initPinYinSelect2($('#parkNameSelect'),paramsD,function(selector) { | |
| 73 | + }); | |
| 74 | + } | |
| 75 | + }); | |
| 76 | + }); | |
| 77 | + } | |
| 78 | + | |
| 79 | + $('#parkNameSelect').on('change',function() { | |
| 80 | + var value = $(this).val(); | |
| 81 | + if(value!=null && value!='') { | |
| 82 | + $('#parkCodeInput').val(value.split('_')[1]); | |
| 83 | + } | |
| 84 | + }); | |
| 16 | 85 | |
| 17 | - /** 填充公司下拉框选择值 */ | |
| 18 | - $get('/business/all', {upCode_eq: '77'}, function(array){ | |
| 19 | - | |
| 20 | - // 公司下拉options属性值 | |
| 86 | + function gsdmTogsName(gsD,code) { | |
| 87 | + var rsStr = ''; | |
| 88 | + for(var s = 0 ; s < gsD.length; s++) { | |
| 89 | + if(gsD[s].businessCode == code) { | |
| 90 | + rsStr = rsStr + '(' + gsD[s].businessName.replace('公司','') + ')'; | |
| 91 | + break; | |
| 92 | + } | |
| 93 | + } | |
| 94 | + return rsStr; | |
| 95 | + } | |
| 96 | + | |
| 97 | + function setBrancheCompanySelectOptions(){ | |
| 98 | + // 获取公司下拉框选择值 | |
| 99 | + var businessCode = $('#companySelect').val(); | |
| 100 | + // 分公司下拉框options属性值 | |
| 21 | 101 | var options = '<option value="">请选择...</option>'; |
| 22 | - | |
| 23 | - // 遍历array | |
| 24 | - $.each(array, function(i,d){ | |
| 25 | - | |
| 26 | - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | |
| 27 | - | |
| 28 | - }); | |
| 29 | - | |
| 30 | - // 填充公司下拉框options,并添加公司下拉框值改变事件setbrancheCompanySelectOptions | |
| 31 | - $('#companySelect').html(options) | |
| 32 | - //$('#companySelect').html(options).on('change', setbrancheCompanySelectOptions); | |
| 33 | - | |
| 34 | - }); | |
| 102 | + // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码 | |
| 103 | + if(businessCode == null || businessCode ==''){ | |
| 104 | + // 填充分公司下拉框options | |
| 105 | + $('#brancheCompanySelect').html(options); | |
| 106 | + } else { | |
| 107 | + /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */ | |
| 108 | + $get('/business/all', {upCode_eq: businessCode}, function(array){ | |
| 109 | + // 遍历array | |
| 110 | + $.each(array, function(i,d){ | |
| 111 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | |
| 112 | + // 填充分公司下拉框options | |
| 113 | + $('#brancheCompanySelect').html(options); | |
| 114 | + }); | |
| 115 | + }); | |
| 116 | + } | |
| 117 | + } | |
| 35 | 118 | |
| 36 | 119 | /** page : 当前页 initPag : */ |
| 37 | 120 | var page = 0,initPag; |
| 38 | - | |
| 39 | 121 | /** 表格数据分页加载 */ |
| 40 | 122 | loadTableDate(null,true); |
| 41 | - | |
| 42 | 123 | /** 重置按钮事件 */ |
| 43 | 124 | $('tr.filter .filter-cancel').on('click',function(){ |
| 44 | - | |
| 45 | 125 | // 清空搜索框值 |
| 46 | 126 | $('tr.filter input,select').val('').change(); |
| 47 | - | |
| 48 | 127 | // 重新加载表格数据 |
| 49 | 128 | loadTableDate(null,true); |
| 50 | 129 | }); |
| 51 | - | |
| 52 | 130 | /** 搜索按钮事件 */ |
| 53 | 131 | $('tr.filter .filter-submit').on('click',function(){ |
| 54 | - | |
| 55 | 132 | var params = getParams(); |
| 56 | - | |
| 57 | 133 | page = 0; |
| 58 | - | |
| 59 | 134 | loadTableDate(params,true); |
| 60 | - | |
| 61 | 135 | }); |
| 62 | 136 | |
| 63 | 137 | function getParams() { |
| 64 | - | |
| 65 | 138 | // cells 集合返回表格中所有(列)单元格的一个数组 |
| 66 | 139 | var cells = $('tr.filter')[0].cells; |
| 67 | - | |
| 68 | 140 | // 搜索参数集合 |
| 69 | 141 | var params = {}; |
| 70 | - | |
| 71 | 142 | // 搜索字段名称 |
| 72 | 143 | var name; |
| 73 | - | |
| 74 | 144 | // 遍历cells数组 |
| 75 | 145 | $.each(cells, function(i, cell){ |
| 76 | - | |
| 77 | 146 | // 获取第i列的input或者select集合 |
| 78 | 147 | var items = $('input,select', cell); |
| 79 | - | |
| 80 | 148 | // 遍历items集合 |
| 81 | 149 | for(var j = 0, item; item = items[j++];){ |
| 82 | - | |
| 83 | 150 | // 获取字段名称 |
| 84 | 151 | name = $(item).attr('name'); |
| 85 | - | |
| 86 | 152 | if(name){ |
| 87 | - | |
| 88 | 153 | // 赋取相对应的值 |
| 89 | 154 | params[name] = $(item).val(); |
| 90 | - | |
| 91 | 155 | } |
| 92 | 156 | } |
| 93 | - | |
| 94 | 157 | }); |
| 158 | + if(params.parkName_like=='请选择...') | |
| 159 | + params.parkName_like = ''; | |
| 160 | + else | |
| 161 | + params.parkName_like = params.parkName_like.split('_')[0]; | |
| 95 | 162 | return params; |
| 96 | - | |
| 97 | 163 | } |
| 98 | - | |
| 99 | 164 | |
| 100 | 165 | /** |
| 101 | 166 | * 表格数据分页加载事件 |
| ... | ... | @@ -106,99 +171,77 @@ |
| 106 | 171 | * |
| 107 | 172 | */ |
| 108 | 173 | function loadTableDate(param,isPon){ |
| 109 | - | |
| 110 | 174 | // 搜索参数 |
| 111 | 175 | var params = {}; |
| 112 | - | |
| 113 | 176 | if(param) { |
| 114 | - | |
| 115 | 177 | params = param; |
| 116 | - | |
| 117 | 178 | } |
| 118 | - | |
| 119 | 179 | // 排序(按更新时间) |
| 120 | 180 | params['order'] = 'id'; |
| 121 | - | |
| 122 | 181 | // 记录当前页数 |
| 123 | 182 | params['page'] = page; |
| 124 | - | |
| 125 | 183 | // 弹出正在加载层 |
| 126 | 184 | var i = layer.load(2); |
| 127 | - | |
| 128 | - // 异步请求获取表格数据 | |
| 129 | - $.get('/carpark',params,function(result){ | |
| 130 | - | |
| 131 | - // 添加序号 | |
| 132 | - result.content.page = page; | |
| 133 | - | |
| 134 | - // 把数据填充到模版中 | |
| 135 | - var tbodyHtml = template('carpark_list_table_temp',{list:result.content}); | |
| 136 | - | |
| 137 | - | |
| 138 | - $('#datatable_carpark tbody').html(tbodyHtml); | |
| 139 | - | |
| 140 | - // 是重新分页且返回数据长度大于0 | |
| 141 | - if(isPon && result.content.length > 0){ | |
| 142 | - | |
| 143 | - // 重新分页 | |
| 144 | - initPag = true; | |
| 145 | - | |
| 146 | - // 分页栏 | |
| 147 | - showPagination(result); | |
| 148 | - | |
| 185 | + getComp(function(rs) { | |
| 186 | + if(rs.length>0) { | |
| 187 | + var compA = new Array(); | |
| 188 | + for(var c = 0 ; c<rs.length;c++) { | |
| 189 | + var comC = rs[c].companyCode; | |
| 190 | + var child = rs[c].children; | |
| 191 | + if(child.length>0) { | |
| 192 | + for(var d = 0 ;d< child.length;d++) { | |
| 193 | + compA.push(comC + '_' + child[d].code); | |
| 194 | + } | |
| 195 | + }else { | |
| 196 | + compA.push(comC); | |
| 197 | + } | |
| 198 | + } | |
| 199 | + params.cgsbm_in = compA.toString(); | |
| 149 | 200 | } |
| 150 | - | |
| 151 | - // 关闭弹出加载层 | |
| 152 | - layer.close(i); | |
| 153 | - | |
| 201 | + // 异步请求获取表格数据 | |
| 202 | + $.get('/carpark',params,function(result){ | |
| 203 | + // 添加序号 | |
| 204 | + result.content.page = page; | |
| 205 | + // 把数据填充到模版中 | |
| 206 | + var tbodyHtml = template('carpark_list_table_temp',{list:result.content}); | |
| 207 | + $('#datatable_carpark tbody').html(tbodyHtml); | |
| 208 | + // 是重新分页且返回数据长度大于0 | |
| 209 | + if(isPon && result.content.length > 0){ | |
| 210 | + // 重新分页 | |
| 211 | + initPag = true; | |
| 212 | + // 分页栏 | |
| 213 | + showPagination(result); | |
| 214 | + } | |
| 215 | + // 关闭弹出加载层 | |
| 216 | + layer.close(i); | |
| 217 | + }); | |
| 154 | 218 | }); |
| 155 | 219 | } |
| 156 | 220 | |
| 157 | 221 | /** 分页栏组件 */ |
| 158 | 222 | function showPagination(data){ |
| 159 | - | |
| 160 | 223 | // 分页组件 |
| 161 | 224 | $('#pagination').jqPaginator({ |
| 162 | - | |
| 163 | 225 | // 总页数 |
| 164 | 226 | totalPages: data.totalPages, |
| 165 | - | |
| 166 | 227 | // 中间显示页数 |
| 167 | 228 | visiblePages: 6, |
| 168 | - | |
| 169 | 229 | // 当前页 |
| 170 | 230 | currentPage: page + 1, |
| 171 | - | |
| 172 | 231 | first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', |
| 173 | - | |
| 174 | 232 | prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', |
| 175 | - | |
| 176 | 233 | next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', |
| 177 | - | |
| 178 | 234 | last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', |
| 179 | - | |
| 180 | 235 | page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', |
| 181 | - | |
| 182 | 236 | onPageChange: function (num, type) { |
| 183 | - | |
| 184 | 237 | if(initPag){ |
| 185 | - | |
| 186 | 238 | initPag = false; |
| 187 | - | |
| 188 | 239 | return; |
| 189 | - | |
| 190 | 240 | } |
| 191 | - | |
| 192 | 241 | var pData = getParams(); |
| 193 | - | |
| 194 | 242 | page = num - 1; |
| 195 | - | |
| 196 | 243 | loadTableDate(pData, false); |
| 197 | - | |
| 198 | 244 | } |
| 199 | - | |
| 200 | 245 | }); |
| 201 | - | |
| 202 | 246 | } |
| 203 | - | |
| 204 | 247 | })(); |
| 205 | 248 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-ajax.js
| ... | ... | @@ -2,33 +2,19 @@ |
| 2 | 2 | * GetAjaxData :ajax异步请求 |
| 3 | 3 | * |
| 4 | 4 | */ |
| 5 | - | |
| 6 | 5 | var GetAjaxData = function(){ |
| 7 | - | |
| 8 | 6 | var ajaxData = { |
| 9 | - | |
| 10 | 7 | // 查询停车场信息 |
| 11 | 8 | getCarParkInfo : function(carParkId,callback){ |
| 12 | - | |
| 13 | 9 | $get('/carpark/findCarParkInfoFormId',{id:carParkId},function(r) { |
| 14 | - | |
| 15 | 10 | return callback && callback(r); |
| 16 | - | |
| 17 | 11 | }); |
| 18 | - | |
| 19 | 12 | }, |
| 20 | - | |
| 21 | 13 | carParkUpdate : function(params,callback){ |
| 22 | - | |
| 23 | 14 | $post('/carpark/carParkUpdate',params,function(data) { |
| 24 | - | |
| 25 | 15 | callback && callback(data); |
| 26 | - | |
| 27 | 16 | }); |
| 28 | - | |
| 29 | 17 | } |
| 30 | 18 | } |
| 31 | - | |
| 32 | 19 | return ajaxData; |
| 33 | - | |
| 34 | 20 | }(); |
| 35 | 21 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-events.js
| 1 | 1 | $(function(){ |
| 2 | - | |
| 3 | 2 | $('#backUp').on('click',function() { |
| 4 | - | |
| 5 | - // 获取返回元素并修改url地址 | |
| 6 | - /*$('#backUp').attr('href','list.html?');*/ | |
| 7 | - | |
| 8 | 3 | // 返回list.html页面 |
| 9 | 4 | loadPage('/pages/base/carpark/list.html'); |
| 10 | - | |
| 11 | 5 | }); |
| 12 | - | |
| 13 | 6 | $('#edit').on('click',function() { |
| 14 | - | |
| 15 | 7 | $.get('edit_select.html', function(m){ |
| 16 | - | |
| 17 | 8 | $(pjaxContainer).append(m); |
| 18 | - | |
| 19 | 9 | $('#editPositions_select_mobal').trigger('editSelectMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); |
| 20 | - | |
| 21 | 10 | }); |
| 22 | - | |
| 23 | 11 | }); |
| 24 | - | |
| 25 | - | |
| 12 | + // 监听打开鼠标绘制工具按钮事件. | |
| 13 | + $('#oppenDrawingManager').on('click',function() { | |
| 14 | + CarParkPWorldsBMap.openDrawingManager(); | |
| 15 | + }); | |
| 16 | + // 监听关闭鼠标绘制工具按钮事件. | |
| 17 | + $('#closeDrawingManager').on('click',function() { | |
| 18 | + CarParkPWorldsBMap.drawingManagerClose(); | |
| 19 | + }); | |
| 26 | 20 | }); |
| 27 | 21 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-function.js
| ... | ... | @@ -4,178 +4,105 @@ |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | var PublicFunctions = function () { |
| 7 | - | |
| 8 | 7 | var PubFun = { |
| 9 | - | |
| 10 | 8 | /** 停车场信息初始化 @param:<id:停车场ID> */ |
| 11 | 9 | initCarPark : function(id) { |
| 12 | - | |
| 13 | 10 | /** 获取停车场信息 @param:<id:停车场Id> */ |
| 14 | 11 | GetAjaxData.getCarParkInfo(id,function(r) { |
| 15 | - | |
| 16 | 12 | // 获取返回数据长度 |
| 17 | 13 | var len = r.length; |
| 18 | - | |
| 19 | 14 | // 如果大于零 |
| 20 | 15 | if(len>0) { |
| 21 | - | |
| 22 | 16 | // 获取停车场信息数据 |
| 23 | 17 | var carParkObj = r[0]; |
| 24 | - | |
| 25 | 18 | /** 设置停车场对象值 @param:<carParkObj:停车场对象值> */ |
| 26 | 19 | EditCarParkObj.setEitdCarPark(carParkObj); |
| 27 | - | |
| 28 | 20 | // 定义图形类型 |
| 29 | 21 | var stationShapesType = r[0].carParkShapesType; |
| 30 | - | |
| 31 | 22 | // 如果为空,则添加 |
| 32 | - if(stationShapesType==null){ | |
| 33 | - | |
| 23 | + if(stationShapesType==null || stationShapesType=='' ){ | |
| 34 | 24 | // 弹出选择框;确认则提交;取消则返回 |
| 35 | - layer.confirm('停车场位置缺失,自动延续为添加停车场位置', {btn : [ '确认提示并添加', '取消' ]}, function(index) { | |
| 36 | - | |
| 25 | + layer.confirm('停车场位置缺失,是否自动延续为添加停车场位置', {btn : [ '确认并添加', '取消并返回' ]}, function(index) { | |
| 37 | 26 | /** 关闭弹出层 @param:<index:当前弹出框> */ |
| 38 | 27 | layer.close(index); |
| 39 | - | |
| 28 | + $('.drwmageUtils').show(); | |
| 29 | + $('.leftUtils').hide(); | |
| 40 | 30 | // 停车场名称 |
| 41 | 31 | var nameV = r[0].carParkName; |
| 42 | - | |
| 43 | 32 | /** 根据名称定位 */ |
| 44 | 33 | CarParkPWorldsBMap.localSearchFromAdreesToPoint(nameV); |
| 45 | - | |
| 46 | 34 | // 打开绘制工具 |
| 47 | 35 | CarParkPWorldsBMap.openDrawingManager(); |
| 48 | - | |
| 36 | + },function() { | |
| 37 | + loadPage('/pages/base/carpark/list.html'); | |
| 49 | 38 | }); |
| 50 | - | |
| 51 | 39 | return ; |
| 52 | 40 | } |
| 53 | - | |
| 41 | + $('.leftUtils').show(); | |
| 42 | + $('.drwmageUtils').hide(); | |
| 54 | 43 | // 获取中心坐标点字符串分割 |
| 55 | 44 | var BJwpoints = r[0].carParkBcenterPoint.split(' '); |
| 56 | - | |
| 57 | 45 | // 中心坐标点 |
| 58 | 46 | var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); |
| 59 | - | |
| 60 | 47 | var shapesV = ''; |
| 61 | - | |
| 62 | 48 | if(r[0].carParkShapesType=='d') { |
| 63 | - | |
| 64 | 49 | shapesV = '多边形'; |
| 65 | - | |
| 66 | 50 | }else if(r[0].carParkShapesType=='r') { |
| 67 | - | |
| 68 | 51 | shapesV = '圆形'; |
| 69 | - | |
| 70 | 52 | } |
| 71 | - | |
| 72 | 53 | var companyV = ''; |
| 73 | - | |
| 74 | 54 | var branchecomV = ''; |
| 75 | - | |
| 76 | 55 | if( r[0].carParkCompany=='55'){ |
| 77 | - | |
| 78 | 56 | companyV = '上南公司'; |
| 79 | - | |
| 80 | 57 | if(r[0].carParkBrancheCompany=='1'){ |
| 81 | - | |
| 82 | 58 | branchecomV = '上南二分公司'; |
| 83 | - | |
| 84 | 59 | }else if(r[0].carParkBrancheCompany=='2'){ |
| 85 | - | |
| 86 | 60 | branchecomV = '上南三分公司'; |
| 87 | - | |
| 88 | 61 | }else if(r[0].carParkBrancheCompany=='3'){ |
| 89 | - | |
| 90 | 62 | branchecomV = '上南六分公司'; |
| 91 | - | |
| 92 | 63 | }else if(r[0].carParkBrancheCompany=='4'){ |
| 93 | - | |
| 94 | 64 | branchecomV = '上南一分公司'; |
| 95 | - | |
| 96 | 65 | } |
| 97 | - | |
| 98 | 66 | }else if( r[0].carParkCompany=='22'){ |
| 99 | - | |
| 100 | 67 | companyV = '金高公司'; |
| 101 | - | |
| 102 | 68 | if(r[0].carParkBrancheCompany=='1'){ |
| 103 | - | |
| 104 | 69 | branchecomV = '四分公司'; |
| 105 | - | |
| 106 | 70 | }else if(r[0].carParkBrancheCompany=='2'){ |
| 107 | - | |
| 108 | 71 | branchecomV = '二分公司'; |
| 109 | - | |
| 110 | 72 | }else if(r[0].carParkBrancheCompany=='3'){ |
| 111 | - | |
| 112 | 73 | branchecomV = '三分公司'; |
| 113 | - | |
| 114 | 74 | }else if(r[0].carParkBrancheCompany=='5'){ |
| 115 | - | |
| 116 | 75 | branchecomV = '一分公司'; |
| 117 | - | |
| 118 | 76 | } |
| 119 | - | |
| 120 | 77 | }else if( r[0].carParkCompany=='05'){ |
| 121 | - | |
| 122 | 78 | companyV = '杨高公司'; |
| 123 | - | |
| 124 | 79 | if(r[0].carParkBrancheCompany=='1'){ |
| 125 | - | |
| 126 | 80 | branchecomV = '川沙分公司'; |
| 127 | - | |
| 128 | 81 | }else if(r[0].carParkBrancheCompany=='2'){ |
| 129 | - | |
| 130 | 82 | branchecomV = '金桥分公司'; |
| 131 | - | |
| 132 | 83 | }else if(r[0].carParkBrancheCompany=='3'){ |
| 133 | - | |
| 134 | 84 | branchecomV = '芦潮港分公司'; |
| 135 | - | |
| 136 | 85 | }else if(r[0].carParkBrancheCompany=='5'){ |
| 137 | - | |
| 138 | 86 | branchecomV = '杨高分公司'; |
| 139 | - | |
| 140 | 87 | }else if(r[0].carParkBrancheCompany=='6'){ |
| 141 | - | |
| 142 | 88 | branchecomV = '周浦分公司'; |
| 143 | - | |
| 144 | 89 | } |
| 145 | - | |
| 146 | - | |
| 147 | 90 | }else if( r[0].carParkCompany=='26'){ |
| 148 | - | |
| 149 | 91 | companyV = '南汇公司'; |
| 150 | - | |
| 151 | 92 | if(r[0].carParkBrancheCompany=='1'){ |
| 152 | - | |
| 153 | 93 | branchecomV = '南汇一分'; |
| 154 | - | |
| 155 | 94 | }else if(r[0].carParkBrancheCompany=='2'){ |
| 156 | - | |
| 157 | 95 | branchecomV = '南汇二分'; |
| 158 | - | |
| 159 | 96 | }else if(r[0].carParkBrancheCompany=='3'){ |
| 160 | - | |
| 161 | 97 | branchecomV = '南汇三分'; |
| 162 | - | |
| 163 | 98 | }else if(r[0].carParkBrancheCompany=='4'){ |
| 164 | - | |
| 165 | 99 | branchecomV = '南汇维修公司'; |
| 166 | - | |
| 167 | 100 | }else if(r[0].carParkBrancheCompany=='5'){ |
| 168 | - | |
| 169 | 101 | branchecomV = '南汇公司'; |
| 170 | - | |
| 171 | 102 | } |
| 172 | - | |
| 173 | 103 | }else if( r[0].carParkCompany=='77'){ |
| 174 | - | |
| 175 | 104 | companyV ='闵行公司' |
| 176 | - | |
| 177 | 105 | } |
| 178 | - | |
| 179 | 106 | // 信息窗口类容 |
| 180 | 107 | var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ |
| 181 | 108 | '<span style="color:#DDD;font-size: 15px;">停车场名称:' + r[0].carParkName + '</span>' + |
| ... | ... | @@ -185,134 +112,91 @@ var PublicFunctions = function () { |
| 185 | 112 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围类型:' + shapesV + '</span>' + |
| 186 | 113 | '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].carParkRadius + '</span>' + |
| 187 | 114 | '<span class="help-block" style="color:#DDD;font-size: 15px;">所属公司:' + companyV + '</span>' + |
| 188 | - /*'<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + branchecomV+ '</span>' +*/ | |
| 115 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + branchecomV+ '</span>' + | |
| 189 | 116 | '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].carParkVersions + '</span>' + |
| 190 | 117 | '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ r[0].carParkDescriptions +'" >说明/描述:' + r[0].carParkDescriptions + '</span>' ; |
| 191 | - | |
| 192 | 118 | // 信息窗口参数属性 |
| 193 | 119 | var opts = { |
| 194 | - | |
| 195 | 120 | // 信息窗口宽度 |
| 196 | 121 | width : 200, |
| 197 | - | |
| 198 | 122 | // 信息窗口高度 |
| 199 | 123 | height : 450, |
| 200 | - | |
| 201 | 124 | // 信息窗位置偏移值。 |
| 202 | 125 | offset: new BMap.Size(500,80), |
| 203 | - | |
| 204 | 126 | //标题 |
| 205 | 127 | title : '<h4 style="color:#FFFFFF">'+r[0].carParkName+'停车场详情</h4>', |
| 206 | - | |
| 207 | 128 | //设置不允许信窗发送短息 |
| 208 | 129 | enableMessage : false, |
| 209 | - | |
| 210 | 130 | //是否开启点击地图关闭信息窗口 |
| 211 | 131 | enableCloseOnClick : false, |
| 212 | - | |
| 213 | 132 | // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) |
| 214 | 133 | enableAutoPan:true |
| 215 | 134 | }; |
| 216 | - | |
| 217 | 135 | if(stationShapesType == 'r') { |
| 218 | - | |
| 219 | 136 | /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ |
| 220 | 137 | CarParkPWorldsBMap.pointsCircle(r,point,htm,opts); |
| 221 | - | |
| 222 | 138 | }else if(stationShapesType == 'd'){ |
| 223 | - | |
| 224 | 139 | /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ |
| 225 | 140 | CarParkPWorldsBMap.pointsPolygon(r,point,htm,opts); |
| 226 | - | |
| 227 | 141 | } |
| 228 | 142 | } |
| 229 | - | |
| 230 | 143 | }); |
| 231 | - | |
| 232 | 144 | }, |
| 233 | 145 | |
| 234 | 146 | setFormValue : function(carParkObj) { |
| 235 | - | |
| 236 | 147 | $('#idInput').val(carParkObj.carParkId); |
| 237 | - | |
| 238 | 148 | $('#bParkPointInput').val(carParkObj.carParkBparkPoint); |
| 239 | - | |
| 240 | 149 | $('#parkNameInput').val(carParkObj.carParkName); |
| 241 | - | |
| 242 | 150 | $('#parkCodeInput').val(carParkObj.carParkCode); |
| 243 | - | |
| 244 | 151 | $('#bCenterPointInput').val(carParkObj.carParkBcenterPoint); |
| 245 | - | |
| 246 | - $('#shapesTypeSelect').val(carParkObj.carParkShapesType); | |
| 247 | - | |
| 152 | + if(carParkObj.carParkShapesType=='r') { | |
| 153 | + $('#shapesTypeSelect').val('圆形'); | |
| 154 | + $('#radiusGroup').show(); | |
| 155 | + }else if(carParkObj.carParkShapesType=='d') { | |
| 156 | + $('#shapesTypeSelect').val('多边形'); | |
| 157 | + $('#radiusGroup').hide(); | |
| 158 | + } | |
| 248 | 159 | $('#radiusInput').val(carParkObj.carParkRadius); |
| 249 | - | |
| 250 | 160 | $('#areaInput').val(carParkObj.carParkArea); |
| 251 | - | |
| 252 | 161 | $('#destroySelect').val(carParkObj.carParkDestroy); |
| 253 | - | |
| 254 | 162 | $('#descriptionsTextarea').val(carParkObj.carParkDescriptions); |
| 255 | - | |
| 256 | 163 | }, |
| 257 | 164 | |
| 258 | 165 | // 公司下拉框 |
| 259 | 166 | selectTemp : function(callback) { |
| 260 | - | |
| 261 | 167 | // 填充公司下拉框选择值 |
| 262 | - $.get('/business/all', {upCode_eq: '77'}, function(array){ | |
| 263 | - | |
| 168 | + $.get('/business/all', {upCode_eq: '88'}, function(array){ | |
| 264 | 169 | // 公司下拉options属性值 |
| 265 | 170 | var options = '<option value="">-- 请选择公司 --</option>'; |
| 266 | - | |
| 267 | 171 | // 遍历array |
| 268 | 172 | $.each(array, function(i,d){ |
| 269 | - | |
| 270 | 173 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; |
| 271 | - | |
| 272 | 174 | }); |
| 273 | - | |
| 274 | 175 | // 填充公司下拉框options |
| 275 | 176 | $('#companySelect').html(options); |
| 276 | - | |
| 277 | 177 | callback && callback(); |
| 278 | - | |
| 279 | 178 | }); |
| 280 | 179 | }, |
| 281 | - | |
| 282 | 180 | // 填充分公司下拉框选择值 |
| 283 | 181 | getbrancheCompanyValues : function(businessCode,cb){ |
| 284 | - | |
| 285 | 182 | // 分公司下拉框options属性值 |
| 286 | 183 | var options = '<option value="">-- 请选择分公司 --</option>'; |
| 287 | - | |
| 288 | 184 | if(businessCode) { |
| 289 | - | |
| 290 | 185 | $get('/business/all', {upCode_eq: businessCode}, function(brancheCompany){ |
| 291 | - | |
| 292 | 186 | // 遍历brancheCompany |
| 293 | 187 | $.each(brancheCompany, function(i,d){ |
| 294 | - | |
| 295 | 188 | options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; |
| 296 | - | |
| 297 | 189 | }); |
| 298 | - | |
| 299 | 190 | // 填充分公司下拉框options |
| 300 | 191 | $('#brancheCompanySelect').html(options); |
| 301 | - | |
| 302 | 192 | cb && cb(); |
| 303 | - | |
| 304 | 193 | }); |
| 305 | - | |
| 306 | 194 | } else { |
| 307 | - | |
| 308 | 195 | // 填充分公司下拉框options |
| 309 | 196 | $('#brancheCompanySelect').html(options); |
| 310 | - | |
| 311 | 197 | cb && cb(); |
| 312 | 198 | } |
| 313 | - | |
| 314 | 199 | }, |
| 315 | - | |
| 316 | 200 | } |
| 317 | 201 | |
| 318 | 202 | return PubFun ; | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-map.js
| ... | ... | @@ -8,443 +8,280 @@ var CarParkPWorldsBMap = function () { |
| 8 | 8 | var mapValue='',drawingManager='',marker='',circle='',polygon=''; |
| 9 | 9 | |
| 10 | 10 | var Bmap = { |
| 11 | - | |
| 12 | 11 | init : function() { |
| 13 | - | |
| 14 | 12 | // 设置中心点, |
| 15 | 13 | var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; |
| 16 | - | |
| 17 | 14 | // 百度API Key |
| 18 | 15 | var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; |
| 19 | - | |
| 20 | 16 | // 初始化百度地图 |
| 21 | 17 | mapValue = new BMap.Map("carParkbmap_basic"); |
| 22 | - | |
| 23 | 18 | //中心点和缩放级别 |
| 24 | 19 | mapValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); |
| 25 | - | |
| 26 | 20 | //启用地图拖拽事件,默认启用(可不写) |
| 27 | 21 | mapValue.enableDragging(); |
| 28 | - | |
| 29 | 22 | //启用地图滚轮放大缩小 |
| 30 | 23 | mapValue.enableScrollWheelZoom(); |
| 31 | - | |
| 32 | 24 | //禁用鼠标双击放大 |
| 33 | 25 | mapValue.disableDoubleClickZoom(); |
| 34 | - | |
| 35 | 26 | //启用键盘上下左右键移动地图 |
| 36 | 27 | mapValue.enableKeyboard(); |
| 37 | - | |
| 38 | 28 | var styleOptions = { |
| 39 | - | |
| 40 | 29 | //边线颜色。 |
| 41 | 30 | strokeColor : "blue", |
| 42 | - | |
| 43 | 31 | //填充颜色。当参数为空时,圆形将没有填充效果。 |
| 44 | 32 | fillColor : "blue", |
| 45 | - | |
| 46 | 33 | //边线的宽度,以像素为单位。 |
| 47 | 34 | strokeWeight : 3, |
| 48 | - | |
| 49 | 35 | //边线透明度,取值范围0 - 1。 |
| 50 | 36 | strokeOpacity : 0.8, |
| 51 | - | |
| 52 | 37 | //填充的透明度,取值范围0 - 1。 |
| 53 | 38 | fillOpacity : 0.6, |
| 54 | - | |
| 55 | 39 | //边线的样式,solid或dashed。 |
| 56 | 40 | strokeStyle : 'solid' |
| 57 | - | |
| 58 | 41 | }; |
| 59 | - | |
| 60 | 42 | // 创建鼠标绘制管理类 |
| 61 | 43 | drawingManager = new BMapLib.DrawingManager(mapValue, { |
| 62 | - | |
| 63 | 44 | //是否开启绘制模式 |
| 64 | 45 | isOpen : false, |
| 65 | - | |
| 66 | 46 | //是否显示工具栏 |
| 67 | 47 | enableDrawingTool : false, |
| 68 | - | |
| 69 | 48 | drawingToolOptions : { |
| 70 | - | |
| 71 | 49 | //位置 |
| 72 | 50 | anchor : BMAP_ANCHOR_TOP_RIGHT, |
| 73 | - | |
| 74 | 51 | //偏离值 |
| 75 | 52 | offset : new BMap.Size(5, 5), |
| 76 | - | |
| 77 | 53 | //工具栏缩放比例 |
| 78 | 54 | scale : 0.8 |
| 79 | - | |
| 80 | 55 | }, |
| 81 | - | |
| 82 | 56 | //线的样式 |
| 83 | 57 | polygonOptions : styleOptions |
| 84 | - | |
| 85 | 58 | }); |
| 86 | - | |
| 87 | 59 | // 添加绘画完成事件 |
| 88 | 60 | drawingManager.addEventListener('polygoncomplete', function(e) { |
| 89 | - | |
| 90 | - drawingManager.close(); | |
| 91 | - | |
| 61 | + drawingManager.close(); | |
| 92 | 62 | if (e.getPath().length <= 2) { |
| 93 | - | |
| 94 | 63 | // 弹出提示消息 |
| 95 | 64 | layer.msg('坐标点不能小于等于两个...'); |
| 96 | - | |
| 97 | 65 | // 清除地图覆盖物 |
| 98 | - map.clearOverlays(); | |
| 99 | - | |
| 100 | - // 加载该线路下所有站点位置添加到地图上 | |
| 101 | - return false; | |
| 102 | - | |
| 66 | + Bmap.clearMarkAndOverlays(); | |
| 67 | + // 加载该线路下所有站点位置添加到地图上 | |
| 68 | + return false; | |
| 103 | 69 | }else { |
| 104 | - | |
| 105 | 70 | var pointE = e; |
| 106 | - | |
| 107 | 71 | // 多变行质心点 |
| 108 | 72 | var addSttationPoints_ = pointE.getBounds().getCenter().lng+ ' ' + pointE.getBounds().getCenter().lat; |
| 109 | - | |
| 110 | 73 | var addPolyGonLen_ = pointE.getPath().length; |
| 111 | - | |
| 112 | 74 | for(var k =0;k<addPolyGonLen_;k++) { |
| 113 | - | |
| 114 | 75 | if(k==0) { |
| 115 | - | |
| 116 | 76 | bPloygonGrid = pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; |
| 117 | - | |
| 118 | 77 | }else { |
| 119 | - | |
| 120 | 78 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[k].lng + ' ' + pointE.getPath()[k].lat; |
| 121 | - | |
| 122 | 79 | } |
| 123 | 80 | |
| 124 | 81 | } |
| 125 | - | |
| 126 | 82 | bPloygonGrid = bPloygonGrid + ',' + pointE.getPath()[0].lng + ' ' + pointE.getPath()[0].lat; |
| 127 | - | |
| 128 | 83 | /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */ |
| 129 | 84 | EditCarParkObj.setCarParkBcenterPoint(addSttationPoints_); |
| 130 | - | |
| 131 | 85 | /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */ |
| 132 | 86 | EditCarParkObj.setCarParkShapesType('d'); |
| 133 | - | |
| 134 | 87 | /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */ |
| 135 | 88 | EditCarParkObj.setCarParkRadius(''); |
| 136 | - | |
| 137 | 89 | /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */ |
| 138 | 90 | EditCarParkObj.setCarParkBparkPoint(bPloygonGrid); |
| 139 | - | |
| 140 | 91 | $.get('edit.html', function(m){ |
| 141 | - | |
| 142 | 92 | $(pjaxContainer).append(m); |
| 143 | - | |
| 144 | 93 | $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); |
| 145 | - | |
| 146 | 94 | }); |
| 147 | - | |
| 148 | 95 | } |
| 149 | - | |
| 150 | 96 | }); |
| 151 | 97 | return mapValue; |
| 152 | 98 | }, |
| 153 | - | |
| 154 | 99 | openDrawingManager : function() { |
| 155 | - | |
| 156 | 100 | // 清楚地图覆盖物 |
| 157 | - mapValue.clearOverlays(); | |
| 158 | - | |
| 101 | + // mapValue.clearOverlays(); | |
| 159 | 102 | // 打开鼠标绘画工具 |
| 160 | 103 | drawingManager.open(); |
| 161 | - | |
| 162 | 104 | // 设置属性 |
| 163 | 105 | drawingManager.setDrawingMode(BMAP_DRAWING_POLYGON); |
| 164 | - | |
| 165 | 106 | }, |
| 166 | - | |
| 107 | + drawingManagerClose : function() { | |
| 108 | + drawingManager.close(); | |
| 109 | + }, | |
| 167 | 110 | localSearchFromAdreesToPoint: function(Address) { |
| 168 | - | |
| 169 | 111 | // 创建一个搜索类实例 |
| 170 | 112 | var localSearch = new BMap.LocalSearch(mapValue); |
| 171 | - | |
| 172 | 113 | // 检索完成后的回调函数。 |
| 173 | 114 | localSearch.setSearchCompleteCallback(function (searchResult) { |
| 174 | - | |
| 175 | 115 | var resultPoints = ''; |
| 176 | - | |
| 177 | 116 | if(searchResult) { |
| 178 | - | |
| 179 | 117 | // 返回索引指定的结果。索引0表示第1条结果 |
| 180 | 118 | var poi = searchResult.getPoi(0); |
| 181 | - | |
| 182 | 119 | if(poi) { |
| 183 | - | |
| 184 | 120 | //获取经度和纬度 |
| 185 | 121 | var Points = poi.point.lng + ' ' + poi.point.lat; |
| 186 | - | |
| 187 | 122 | var BJwpointsArray = Points.split(' '); |
| 188 | - | |
| 189 | 123 | var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); |
| 190 | - | |
| 191 | 124 | var marker_stargt2 = new BMap.Marker(stationNameChangePoint); |
| 192 | - | |
| 193 | 125 | var PanOptions ={noAnimation :true}; |
| 194 | - | |
| 195 | 126 | mapValue.panTo(stationNameChangePoint,PanOptions); |
| 196 | - | |
| 197 | 127 | mapValue.panBy(0,-200); |
| 198 | - | |
| 199 | 128 | // 将标注添加到地图中 |
| 200 | 129 | mapValue.addOverlay(marker_stargt2); |
| 201 | - | |
| 202 | 130 | //跳动的动画 |
| 203 | 131 | marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); |
| 204 | - | |
| 205 | 132 | } |
| 206 | - | |
| 207 | 133 | } |
| 208 | - | |
| 209 | 134 | }); |
| 210 | - | |
| 211 | 135 | // 根据检索词发起检索。 |
| 212 | 136 | localSearch.search(Address); |
| 213 | - | |
| 214 | 137 | }, |
| 215 | - | |
| 216 | 138 | /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ |
| 217 | 139 | pointsCircle : function(r,point,htm,opts) { |
| 218 | - | |
| 219 | 140 | //创建圆 |
| 220 | 141 | circle = new BMap.Circle(point,r[0].carParkRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); |
| 221 | - | |
| 222 | 142 | // 允许覆盖物在map.clearOverlays方法中被清除 |
| 223 | 143 | circle.enableMassClear(); |
| 224 | - | |
| 225 | 144 | // 百度地图添加覆盖物圆 |
| 226 | 145 | mapValue.addOverlay(circle); |
| 227 | - | |
| 228 | 146 | // 创建信息窗口 |
| 229 | 147 | infoWindow = new BMap.InfoWindow(htm, opts); |
| 230 | - | |
| 231 | 148 | // 自定义标注物图片 |
| 232 | 149 | var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); |
| 233 | - | |
| 234 | 150 | // 创建点 |
| 235 | 151 | marker = new BMap.Marker(point,{icon : icon_target}); |
| 236 | - | |
| 237 | 152 | // 把标注添物加到地图上 |
| 238 | 153 | mapValue.addOverlay(marker); |
| 239 | - | |
| 240 | 154 | setTimeout(function(){ |
| 241 | 155 | //开启信息窗口 |
| 242 | 156 | marker.openInfoWindow(infoWindow,point); |
| 243 | - | |
| 244 | 157 | },100); |
| 245 | - | |
| 246 | 158 | // 是否在平移过程中禁止动画。(自1.2新增) |
| 247 | 159 | var PanOptions_ ={noAnimation :true}; |
| 248 | - | |
| 249 | 160 | // 将地图的中心点更改为给定的点。 |
| 250 | 161 | mapValue.panTo(point,PanOptions_); |
| 251 | - | |
| 252 | 162 | // 添加标志物监听事件 |
| 253 | 163 | marker.addEventListener("click",function() { |
| 254 | - | |
| 255 | 164 | //开启信息窗口 |
| 256 | 165 | marker.openInfoWindow(infoWindow,point); |
| 257 | - | |
| 258 | 166 | }); |
| 259 | 167 | }, |
| 260 | 168 | |
| 261 | 169 | /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ |
| 262 | 170 | pointsPolygon : function(r,pointPolygon,htm,opts_polygon) { |
| 263 | - | |
| 264 | 171 | // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) |
| 265 | 172 | mapValue.setZoom(17); |
| 266 | - | |
| 267 | 173 | // 获取多边形坐标字符串 |
| 268 | 174 | var stationBPolygonGrid = r[0].carParkBparkPoint; |
| 269 | - | |
| 270 | 175 | // 截取多边形坐标字符串 |
| 271 | 176 | var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); |
| 272 | - | |
| 273 | 177 | // 按逗号切割 |
| 274 | 178 | var pointPolygonArray = stationBPolygonGridStr.split(','); |
| 275 | - | |
| 276 | 179 | // 多边形坐标集合 |
| 277 | 180 | var polygonP = []; |
| 278 | - | |
| 279 | 181 | for(var v = 0;v<pointPolygonArray.length;v++) { |
| 280 | - | |
| 281 | 182 | polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); |
| 282 | - | |
| 283 | 183 | } |
| 284 | - | |
| 285 | 184 | // 画多边形 |
| 286 | 185 | polygon = new BMap.Polygon(polygonP, { |
| 287 | - | |
| 288 | 186 | // 线条显色 |
| 289 | 187 | strokeColor : "blue", |
| 290 | - | |
| 291 | 188 | // 边线的宽度,以像素为单位。 |
| 292 | 189 | strokeWeight : 2, |
| 293 | - | |
| 294 | 190 | // 边线透明度,取值范围0 - 1。 |
| 295 | 191 | strokeOpacity : 0.5 |
| 296 | 192 | }); |
| 297 | - | |
| 298 | 193 | // 增加地图覆盖物多边形 |
| 299 | 194 | mapValue.addOverlay(polygon); |
| 300 | - | |
| 301 | 195 | // 创建信息窗口 |
| 302 | 196 | infoWindow = new BMap.InfoWindow(htm, opts_polygon); |
| 303 | - | |
| 304 | 197 | // 自定义标注物图片 |
| 305 | 198 | var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); |
| 306 | - | |
| 307 | 199 | // 创建点 |
| 308 | 200 | marker = new BMap.Marker(pointPolygon,{icon : icon_target}); |
| 309 | - | |
| 310 | 201 | // 把标注添物加到地图上 |
| 311 | 202 | mapValue.addOverlay(marker); |
| 312 | - | |
| 313 | 203 | // 是否在平移过程中禁止动画。(自1.2新增) |
| 314 | 204 | var PanOptions_ ={noAnimation :true}; |
| 315 | - | |
| 316 | 205 | // 将地图的中心点更改为给定的点。 |
| 317 | 206 | mapValue.panTo(pointPolygon,PanOptions_); |
| 318 | - | |
| 319 | 207 | // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 |
| 320 | 208 | mapValue.panBy(10,-250,PanOptions_); |
| 321 | - | |
| 322 | 209 | //开启信息窗口 |
| 323 | 210 | marker.openInfoWindow(infoWindow,pointPolygon); |
| 324 | - | |
| 325 | 211 | }, |
| 326 | 212 | |
| 327 | 213 | // 编辑图形 |
| 328 | 214 | editShapes : function(stationShapesTypeV,mindex) { |
| 329 | 215 | // 关闭信息窗口 |
| 330 | 216 | marker.closeInfoWindow(); |
| 331 | - | |
| 332 | 217 | // 清除marker |
| 333 | 218 | mapValue.removeOverlay(marker); |
| 334 | - | |
| 335 | 219 | // 编辑圆 |
| 336 | 220 | if(stationShapesTypeV =='r') { |
| 337 | - | |
| 338 | 221 | // 开启编辑功能 |
| 339 | 222 | circle.enableEditing(); |
| 340 | - | |
| 341 | 223 | // 编辑圆监听事件 |
| 342 | 224 | circle.addEventListener('dblclick',function() { |
| 343 | - | |
| 344 | 225 | // 关闭提示弹出层 |
| 345 | 226 | layer.close(mindex); |
| 346 | - | |
| 347 | 227 | // 返回圆形的半径,单位为米。 |
| 348 | 228 | var newRadius = circle.getRadius(); |
| 349 | - | |
| 350 | 229 | // 返回圆形的中心点坐标。 |
| 351 | 230 | var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; |
| 352 | - | |
| 353 | 231 | var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; |
| 354 | - | |
| 355 | 232 | /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */ |
| 356 | 233 | EditCarParkObj.setCarParkBcenterPoint(newCenter); |
| 357 | - | |
| 358 | 234 | /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */ |
| 359 | 235 | EditCarParkObj.setCarParkShapesType('r'); |
| 360 | - | |
| 361 | 236 | /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */ |
| 362 | 237 | EditCarParkObj.setCarParkRadius(Math.round(newRadius)); |
| 363 | - | |
| 364 | 238 | /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */ |
| 365 | 239 | EditCarParkObj.setCarParkBparkPoint(''); |
| 366 | - | |
| 367 | 240 | // 加载编辑页面 |
| 368 | 241 | $.get('edit.html', function(m){ |
| 369 | - | |
| 370 | 242 | $(pjaxContainer).append(m); |
| 371 | - | |
| 372 | 243 | $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); |
| 373 | - | |
| 374 | 244 | }); |
| 375 | - | |
| 376 | 245 | }); |
| 377 | - | |
| 378 | 246 | // 编辑多变行 |
| 379 | 247 | }else if(stationShapesTypeV =='d') { |
| 380 | - | |
| 381 | 248 | // 开启编辑功能(自 1.1 新增) |
| 382 | 249 | polygon.enableEditing(); |
| 383 | - | |
| 384 | 250 | // 添加多变行编辑事件 |
| 385 | 251 | polygon.addEventListener('dblclick',function(e) { |
| 386 | - | |
| 387 | 252 | // 获取编辑的多边形对象 |
| 388 | 253 | var edit_pointE = polygon; |
| 389 | - | |
| 390 | 254 | var edit_bPloygonGrid = ""; |
| 391 | - | |
| 392 | 255 | var editPolyGonLen_ = edit_pointE.getPath().length; |
| 393 | - | |
| 394 | 256 | for(var k =0;k<editPolyGonLen_;k++) { |
| 395 | - | |
| 396 | 257 | if(k==0) { |
| 397 | - | |
| 398 | 258 | edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; |
| 399 | - | |
| 400 | 259 | }else { |
| 401 | - | |
| 402 | 260 | edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; |
| 403 | - | |
| 404 | 261 | } |
| 405 | - | |
| 406 | 262 | } |
| 407 | - | |
| 408 | 263 | edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; |
| 409 | - | |
| 410 | 264 | // 多边形中心点 |
| 411 | 265 | var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; |
| 412 | - | |
| 413 | - | |
| 414 | 266 | /** 设置修改停车场集合对象图形质心点属性 @param:<addSttationPoints_:多边形质心点> */ |
| 415 | 267 | EditCarParkObj.setCarParkBcenterPoint(centre_points); |
| 416 | - | |
| 417 | 268 | /** 设置修改停车场集合对象图形类型属性 @param:<shapeType:图形类型> */ |
| 418 | 269 | EditCarParkObj.setCarParkShapesType('d'); |
| 419 | - | |
| 420 | 270 | /** 设置修改停车场集合对象圆形半径属性 @param:<radius:圆形半径> */ |
| 421 | 271 | EditCarParkObj.setCarParkRadius(''); |
| 422 | - | |
| 423 | 272 | /** 设置修改停车场集合对象名称 @param:<bParkPoint:多边形图形坐标集合> */ |
| 424 | 273 | EditCarParkObj.setCarParkBparkPoint(edit_bPloygonGrid); |
| 425 | - | |
| 426 | 274 | $.get('edit.html', function(m){ |
| 427 | - | |
| 428 | 275 | $(pjaxContainer).append(m); |
| 429 | - | |
| 430 | 276 | $('#editPoitsions_carpark_mobal').trigger('editCarParkMobal_show', [CarParkPWorldsBMap,PublicFunctions,EditCarParkObj,GetAjaxData]); |
| 431 | - | |
| 432 | 277 | }); |
| 433 | - | |
| 434 | 278 | }); |
| 435 | - | |
| 436 | 279 | } |
| 437 | - | |
| 438 | 280 | }, |
| 439 | - | |
| 440 | 281 | clearMarkAndOverlays : function() { |
| 441 | - | |
| 442 | 282 | // 清楚地图覆盖物 |
| 443 | 283 | mapValue.clearOverlays(); |
| 444 | - | |
| 445 | 284 | } |
| 446 | 285 | } |
| 447 | - | |
| 448 | 286 | return Bmap; |
| 449 | - | |
| 450 | 287 | }(); |
| 451 | 288 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/js/carpark-positions-reload.js
| ... | ... | @@ -13,26 +13,15 @@ |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | (function(){ |
| 16 | - | |
| 17 | 16 | // 获取参数停车场ID |
| 18 | 17 | var id = $.url().param('no'); |
| 19 | - | |
| 20 | 18 | // 关闭左侧栏 |
| 21 | - if (!$('body').hasClass('page-sidebar-closed')) { | |
| 22 | - | |
| 23 | - $('.menu-toggler.sidebar-toggler').click(); | |
| 24 | - | |
| 25 | - } | |
| 26 | - | |
| 27 | - // 等候500毫秒执行 | |
| 19 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | |
| 20 | + // 等候300毫秒执行 | |
| 28 | 21 | setTimeout(function(){ |
| 29 | - | |
| 30 | 22 | // 地图初始化 |
| 31 | 23 | mapB = CarParkPWorldsBMap.init(); |
| 32 | - | |
| 33 | 24 | /** 停车场信息初始化 @param:<id:停车场ID> */ |
| 34 | 25 | PublicFunctions.initCarPark(id); |
| 35 | - | |
| 36 | - },200); | |
| 37 | - | |
| 26 | + },300); | |
| 38 | 27 | })(); |
| 39 | 28 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/carpark/list.html
| ... | ... | @@ -30,23 +30,24 @@ |
| 30 | 30 | <thead> |
| 31 | 31 | <tr role="row" class="heading"> |
| 32 | 32 | <th width="3%">序号</th> |
| 33 | - <th width="8%">停车场名称</th> | |
| 34 | - <th width="8%">停车场编号</th> | |
| 33 | + <th width="12%">停车场名称</th> | |
| 34 | + <th width="8%">停车场编码</th> | |
| 35 | 35 | <th width="8%">地理位置</th> |
| 36 | - <th width="8%">面积</th> | |
| 37 | - <!-- <th width="8%">分公司</th> --> | |
| 36 | + <th width="6%">面积(㎡)</th> | |
| 38 | 37 | <th width="8%">所属公司</th> |
| 38 | + <th width="8%">所属分公司</th> | |
| 39 | 39 | <th width="6%">版本号</th> |
| 40 | 40 | <th width="6%">是否撤销</th> |
| 41 | - <th width="14%">操作</th> | |
| 41 | + <th width="10%">操作</th> | |
| 42 | 42 | </tr> |
| 43 | 43 | <tr role="row" class="filter"> |
| 44 | 44 | <td>#</td> |
| 45 | 45 | <td> |
| 46 | - <input type="text" class="form-control form-filter input-sm" name="parkName_like"> | |
| 46 | + <!-- <input type="text" class="form-control form-filter input-sm" name="parkName_like" > --> | |
| 47 | + <select name="parkName_like" class="form-control" style="width:100%" id="parkNameSelect"></select> | |
| 47 | 48 | </td> |
| 48 | 49 | <td> |
| 49 | - <input type="text" class="form-control form-filter input-sm" name="parkCode_like"> | |
| 50 | + <input type="text" class="form-control form-filter input-sm" name="parkCode_like" id="parkCodeInput"> | |
| 50 | 51 | |
| 51 | 52 | </td> |
| 52 | 53 | <td> |
| ... | ... | @@ -55,13 +56,14 @@ |
| 55 | 56 | <td> |
| 56 | 57 | <input type="text" class="form-control form-filter input-sm" name="area_eq"> |
| 57 | 58 | </td> |
| 58 | - <!-- <td> | |
| 59 | - <input type="text" class="form-control form-filter input-sm" name="brancheCompany_eq"> | |
| 60 | - </td> --> | |
| 61 | 59 | <td> |
| 62 | 60 | <select name="company_eq" class="form-control" id="companySelect"></select> |
| 63 | 61 | </td> |
| 64 | 62 | <td> |
| 63 | + <select name="brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select> | |
| 64 | + <!-- <input type="text" class="form-control form-filter input-sm" name="brancheCompany_eq" id="brancheCompanySelect"> --> | |
| 65 | + </td> | |
| 66 | + <td> | |
| 65 | 67 | <input type="text" class="form-control form-filter input-sm" name="versions_eq"> |
| 66 | 68 | </td> |
| 67 | 69 | <td> |
| ... | ... | @@ -93,8 +95,38 @@ |
| 93 | 95 | </div> |
| 94 | 96 | </div> |
| 95 | 97 | |
| 96 | -<!-- | |
| 97 | - | |
| 98 | +<script type="text/html" id="carpark_list_table_temp"> | |
| 99 | + {{each list as obj i }} | |
| 100 | + <tr> | |
| 101 | + <td style="vertical-align: middle;"> | |
| 102 | + {{(list.page*10)+(i+1)}} | |
| 103 | + </td> | |
| 104 | + <td> | |
| 105 | + {{obj.parkName}} | |
| 106 | + </td> | |
| 107 | + <td> | |
| 108 | + {{obj.parkCode}} | |
| 109 | + </td> | |
| 110 | + <td> | |
| 111 | + {{obj.bCenterPoint}} | |
| 112 | + </td> | |
| 113 | + <td> | |
| 114 | + {{obj.area}} | |
| 115 | + </td> | |
| 116 | + <td> | |
| 117 | + {{if obj.company == '55'}} | |
| 118 | + 上南公司 | |
| 119 | + {{else if obj.company == '22'}} | |
| 120 | + 金高公司 | |
| 121 | + {{else if obj.company == '05'}} | |
| 122 | + 杨高公司 | |
| 123 | + {{else if obj.company == '26'}} | |
| 124 | + 南汇公司 | |
| 125 | + {{else if obj.company == '77'}} | |
| 126 | + 闵行公司 | |
| 127 | + {{/if}} | |
| 128 | + </td> | |
| 129 | + <td> | |
| 98 | 130 | {{if obj.company == '55'}} |
| 99 | 131 | |
| 100 | 132 | {{if obj.brancheCompany == '1'}} |
| ... | ... | @@ -148,38 +180,6 @@ |
| 148 | 180 | {{/if}} |
| 149 | 181 | |
| 150 | 182 | {{/if}} |
| 151 | - | |
| 152 | - --> | |
| 153 | -<script type="text/html" id="carpark_list_table_temp"> | |
| 154 | - {{each list as obj i }} | |
| 155 | - <tr> | |
| 156 | - <td style="vertical-align: middle;"> | |
| 157 | - {{(list.page*10)+(i+1)}} | |
| 158 | - </td> | |
| 159 | - <td> | |
| 160 | - {{obj.parkName}} | |
| 161 | - </td> | |
| 162 | - <td> | |
| 163 | - {{obj.parkCode}} | |
| 164 | - </td> | |
| 165 | - <td> | |
| 166 | - {{obj.bCenterPoint}} | |
| 167 | - </td> | |
| 168 | - <td> | |
| 169 | - {{obj.area}} | |
| 170 | - </td> | |
| 171 | - <td> | |
| 172 | - {{if obj.company == '55'}} | |
| 173 | - 上南公司 | |
| 174 | - {{else if obj.company == '22'}} | |
| 175 | - 金高公司 | |
| 176 | - {{else if obj.company == '05'}} | |
| 177 | - 杨高公司 | |
| 178 | - {{else if obj.company == '26'}} | |
| 179 | - 南汇公司 | |
| 180 | - {{else if obj.company == '77'}} | |
| 181 | - 闵行公司 | |
| 182 | - {{/if}} | |
| 183 | 183 | </td> |
| 184 | 184 | <td> |
| 185 | 185 | {{obj.versions}} | ... | ... |
src/main/resources/static/pages/base/carpark/positions.html
| 1 | 1 | <link href="/pages/base/carpark/css/positions.css" rel="stylesheet" type="text/css" /> |
| 2 | - | |
| 3 | 2 | <!-- 地图容器--> |
| 4 | 3 | <div id="carParkbmap_basic"></div> |
| 5 | - | |
| 6 | 4 | <!-- 操作工具容器 --> |
| 7 | -<div class="leftUtils"> | |
| 5 | +<div class="leftUtils" style="display: none"> | |
| 8 | 6 | <div class="btn-group" style="left: 100px;"> |
| 9 | 7 | <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具 |
| 10 | 8 | <i class="fa fa-angle-down"></i> |
| ... | ... | @@ -20,21 +18,30 @@ |
| 20 | 18 | </ul> |
| 21 | 19 | </div> |
| 22 | 20 | </div> |
| 23 | - | |
| 21 | +<div class="drwmageUtils" style="display: none"> | |
| 22 | + <div class="btn-group" style="left: 100px;"> | |
| 23 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具 | |
| 24 | + <i class="fa fa-angle-down"></i> | |
| 25 | + </a> | |
| 26 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | |
| 27 | + <li> | |
| 28 | + <a href="javascript:;" id="oppenDrawingManager"><i class="fa fa-pencil"></i> 打开 </a> | |
| 29 | + </li> | |
| 30 | + <li> | |
| 31 | + <a href="javascript:;" id = "closeDrawingManager"> <i class="fa fa-reply"></i> 关闭 </a> | |
| 32 | + </li> | |
| 33 | + </ul> | |
| 34 | + </div> | |
| 35 | +</div> | |
| 24 | 36 | <!-- 编辑停车场对象类 --> |
| 25 | 37 | <script src="/pages/base/carpark/js/positioncarpark.js"></script> |
| 26 | - | |
| 27 | 38 | <!-- ajax异步请求类 --> |
| 28 | 39 | <script src="/pages/base/carpark/js/carpark-positions-ajax.js"></script> |
| 29 | - | |
| 30 | 40 | <!-- 函数方法JS类库 --> |
| 31 | 41 | <script src="/pages/base/carpark/js/carpark-positions-function.js"></script> |
| 32 | - | |
| 33 | 42 | <!-- 地图JS类库 --> |
| 34 | 43 | <script src="/pages/base/carpark/js/carpark-positions-map.js"></script> |
| 35 | - | |
| 36 | 44 | <!-- 事件(PublicFunctions)JS类库 --> |
| 37 | 45 | <script src="/pages/base/carpark/js/carpark-positions-events.js"></script> |
| 38 | - | |
| 39 | 46 | <!-- reloadJS类库 --> |
| 40 | 47 | <script src="/pages/base/carpark/js/carpark-positions-reload.js"></script> |
| 41 | 48 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/base/line/edit.html
| ... | ... | @@ -52,7 +52,7 @@ |
| 52 | 52 | <span class="required"> * </span>线路编码 : |
| 53 | 53 | </label> |
| 54 | 54 | <div class="col-md-4"> |
| 55 | - <input type="text" class="form-control" name="lineCode" id="lineCodeInput" placeholder="线路编码"> | |
| 55 | + <input type="text" class="form-control" name="lineCode" id="lineCodeInput" placeholder="线路编码" readonly="readonly"> | |
| 56 | 56 | </div> |
| 57 | 57 | </div> |
| 58 | 58 | <!-- 线路编码 (* 必填项) END --> | ... | ... |
src/main/resources/static/pages/base/lineinformation/js/lineinformation-add-form.js
| ... | ... | @@ -12,29 +12,51 @@ $(function(){ |
| 12 | 12 | // 获取参数ID |
| 13 | 13 | var lineId = $.url().param('no'); |
| 14 | 14 | if(lineId) { |
| 15 | - $get('/carpark/all',null, function(array){ | |
| 16 | - // 停车场下拉options属性值 | |
| 17 | - var options = '<option value="">-- 请选择停车场 --</option>'; | |
| 18 | - // 遍历array | |
| 19 | - $.each(array, function(i,d){ | |
| 20 | - options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>'; | |
| 21 | - }); | |
| 22 | - $('#carParkSelect').html(options) | |
| 23 | - }); | |
| 24 | 15 | // 填充线路下拉框选择值 |
| 25 | 16 | $get('/line/all', null, function(array){ |
| 26 | - var opGroup = '<option value="">请选择...</option><optgroup label="线路">'; | |
| 17 | + /*var opGroup = '<option value="">请选择...</option><optgroup label="线路">'; | |
| 27 | 18 | var len_ = array.length; |
| 28 | 19 | if(len_>0) { |
| 29 | 20 | $.each(array, function(i, g){ |
| 30 | - /*opGroup += '<option value="'+ g.id + '_' + g.lineCode +'">'+g.name+'</option>';*/ | |
| 31 | 21 | opGroup += '<option value="'+ g.id +'">'+g.name+'</option>'; |
| 32 | 22 | }); |
| 33 | 23 | } |
| 34 | 24 | opGroup += '</optgroup>'; |
| 35 | 25 | $('#lineSelect').html(opGroup).select2(); |
| 36 | - $("#lineSelect").select2("val", lineId); | |
| 26 | + $("#lineSelect").select2("val", lineId);*/ | |
| 27 | + var len_ = array.length,paramsD = new Array(); | |
| 28 | + if(len_>0) { | |
| 29 | + $.each(array, function(i, g){ | |
| 30 | + if(g.name!='' || g.name != null) { | |
| 31 | + /*paramsD.push({'id':g.name + '_' + g.id + '_' + g.lineCode ,'text':g.name + gsdmTogsName(compD,g.company)});*/ | |
| 32 | + paramsD.push({'id': g.id ,'text':g.name}); | |
| 33 | + } | |
| 34 | + }); | |
| 35 | + initPinYinSelect2($('#lineSelect'),paramsD,function(selector) { | |
| 36 | + selector.select2("val", lineId); | |
| 37 | + }); | |
| 38 | + } | |
| 37 | 39 | }); |
| 40 | + $get('/carpark/all',null, function(array){ | |
| 41 | + /* // 停车场下拉options属性值 | |
| 42 | + var options = '<option value="">-- 请选择停车场 --</option>'; | |
| 43 | + // 遍历array | |
| 44 | + $.each(array, function(i,d){ | |
| 45 | + options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>'; | |
| 46 | + }); | |
| 47 | + $('#carParkSelect').html(options)*/ | |
| 48 | + var len_ = array.length,paramsD = new Array(); | |
| 49 | + paramsD.push({'id':'' ,'text':'请选择...'}); | |
| 50 | + if(len_>0) { | |
| 51 | + $.each(array, function(i, g){ | |
| 52 | + if(g.parkName!='' || g.parkName != null) { | |
| 53 | + paramsD.push({'id':g.parkCode ,'text':g.parkName}); | |
| 54 | + } | |
| 55 | + }); | |
| 56 | + initPinYinSelect2($('#carParkSelect'),paramsD,function(selector) { | |
| 57 | + }); | |
| 58 | + } | |
| 59 | + }); | |
| 38 | 60 | $('.lineinformation_back').attr('href','/pages/base/lineinformation/list.html?no='+lineId); |
| 39 | 61 | $('#lineIdInput').val(lineId); |
| 40 | 62 | // 早高峰开始时间 | ... | ... |
src/main/resources/static/pages/base/lineinformation/js/lineinformation-edit-form.js
| ... | ... | @@ -30,24 +30,47 @@ $(function() { |
| 30 | 30 | // 如果不为空 |
| 31 | 31 | if(result) { |
| 32 | 32 | $get('/carpark/all',null, function(array){ |
| 33 | - // 停车场下拉options属性值 | |
| 33 | + /* // 停车场下拉options属性值 | |
| 34 | 34 | var options = '<option value="">-- 请选择停车场 --</option>'; |
| 35 | 35 | // 遍历array |
| 36 | 36 | $.each(array, function(i,d){ |
| 37 | 37 | options += '<option value="'+d.parkCode+'">'+d.parkName+'</option>'; |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | - $('#carParkSelect').html(options) | |
| 40 | + $('#carParkSelect').html(options)*/ | |
| 41 | + var len_ = array.length,paramsD = new Array(); | |
| 42 | + paramsD.push({'id':'' ,'text':'请选择...'}); | |
| 43 | + if(len_>0) { | |
| 44 | + $.each(array, function(i, g){ | |
| 45 | + if(g.parkName!='' || g.parkName != null) { | |
| 46 | + paramsD.push({'id':g.parkCode ,'text':g.parkName}); | |
| 47 | + } | |
| 48 | + }); | |
| 49 | + initPinYinSelect2($('#carParkSelect'),paramsD,function(selector) { | |
| 50 | + selector.select2("val", result.carPark); | |
| 51 | + }); | |
| 52 | + } | |
| 41 | 53 | // 获取线路标准类型并设值 |
| 42 | 54 | $('#typeInput').val(result.type); |
| 43 | 55 | // 获取表单元素下的元素并设值 |
| 44 | 56 | putFormData(result, '#lineinformation_edit_form'); |
| 45 | - $('#carParkSelect').val(result.carPark); | |
| 57 | + // $('#carParkSelect').val(result.carPark); | |
| 46 | 58 | // 获取线路ID元素并设值 |
| 47 | 59 | $('#lineIdInput').val(lineId); |
| 48 | 60 | // 填充线路下拉框选择值 |
| 49 | - $get('/line/all', null, function(array){ | |
| 50 | - var opGroup = '<option value="">请选择...</option><optgroup label="线路">'; | |
| 61 | + $get('/line/all', null, function(linearray){ | |
| 62 | + var linelen_ = linearray.length,lineparamsD = new Array(); | |
| 63 | + if(linelen_>0) { | |
| 64 | + $.each(linearray, function(i, g){ | |
| 65 | + if(g.name!='' || g.name != null) { | |
| 66 | + lineparamsD.push({'id': g.id ,'text':g.name}); | |
| 67 | + } | |
| 68 | + }); | |
| 69 | + initPinYinSelect2($('#lineSelect'),lineparamsD,function(lineselector) { | |
| 70 | + lineselector.select2("val", lineId); | |
| 71 | + }); | |
| 72 | + } | |
| 73 | + /*var opGroup = '<option value="">请选择...</option><optgroup label="线路">'; | |
| 51 | 74 | var len_ = array.length; |
| 52 | 75 | if(len_>0) { |
| 53 | 76 | $.each(array, function(i, g){ |
| ... | ... | @@ -56,7 +79,7 @@ $(function() { |
| 56 | 79 | } |
| 57 | 80 | opGroup += '</optgroup>'; |
| 58 | 81 | $('#lineSelect').html(opGroup).select2(); |
| 59 | - $("#lineSelect").select2("val", lineId); | |
| 82 | + $("#lineSelect").select2("val", lineId);*/ | |
| 60 | 83 | }); |
| 61 | 84 | }); |
| 62 | 85 | } | ... | ... |