Commit 63112b1514d2ba20b082fec3c5b1d208bce77f52
1 parent
47d423b5
路段限速信息的添加,已及添加路段,站点,停车场的绘画改变。
Showing
32 changed files
with
2157 additions
and
23 deletions
src/main/java/com/bsth/controller/RoadSpeedController.java
0 → 100644
| 1 | +package com.bsth.controller; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 8 | +import org.springframework.web.bind.annotation.RequestMethod; | ||
| 9 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 10 | +import org.springframework.web.bind.annotation.RestController; | ||
| 11 | + | ||
| 12 | +import com.bsth.entity.RoadSpeed; | ||
| 13 | +import com.bsth.service.RoadSpeedService; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * | ||
| 17 | + * @ClassName: RoadSpeedController(路段限速控制器) | ||
| 18 | + * | ||
| 19 | + * @Extends : BaseController | ||
| 20 | + * | ||
| 21 | + * @Description: TODO(路段限速控制层) | ||
| 22 | + * | ||
| 23 | + * @Author bsth@lq | ||
| 24 | + * | ||
| 25 | + * @Version 公交调度系统BS版 0.1 | ||
| 26 | + * | ||
| 27 | + */ | ||
| 28 | +@RestController | ||
| 29 | +@RequestMapping("roadSpeed") | ||
| 30 | +public class RoadSpeedController extends BaseController<RoadSpeed, Integer> { | ||
| 31 | + | ||
| 32 | + @Autowired | ||
| 33 | + private RoadSpeedService service; | ||
| 34 | + | ||
| 35 | + /*@RequestMapping(value="all", method = RequestMethod.GET) | ||
| 36 | + public List<RoadSpeed> allRoadSpeed(){ | ||
| 37 | + return service.allRoadSpeed(); | ||
| 38 | + }*/ | ||
| 39 | + | ||
| 40 | + @RequestMapping(value="save", method = RequestMethod.POST) | ||
| 41 | + public Map<String, Object> save(@RequestParam Map<String, Object> map){ | ||
| 42 | + return service.roadSpeedSave(map); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @RequestMapping(value="update", method = RequestMethod.POST) | ||
| 46 | + public Map<String, Object> update(@RequestParam Map<String, Object> map){ | ||
| 47 | + return service.update(map); | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + @RequestMapping(value="findById", method = RequestMethod.GET) | ||
| 51 | + public RoadSpeed findById(@RequestParam(defaultValue = "id") Integer id){ | ||
| 52 | + return service.findId(id); | ||
| 53 | + } | ||
| 54 | +} |
src/main/java/com/bsth/entity/RoadSpeed.java
0 → 100644
| 1 | +package com.bsth.entity; | ||
| 2 | + | ||
| 3 | +import java.util.Date; | ||
| 4 | + | ||
| 5 | +import javax.persistence.Column; | ||
| 6 | +import javax.persistence.Entity; | ||
| 7 | +import javax.persistence.GeneratedValue; | ||
| 8 | +import javax.persistence.GenerationType; | ||
| 9 | +import javax.persistence.Id; | ||
| 10 | +import javax.persistence.Table; | ||
| 11 | + | ||
| 12 | +@Entity | ||
| 13 | +@Table(name = "bsth_c_road_speed") | ||
| 14 | +public class RoadSpeed { | ||
| 15 | + | ||
| 16 | + @Id | ||
| 17 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 18 | + private Integer id; | ||
| 19 | + | ||
| 20 | + // 路段名称 | ||
| 21 | + private String name; | ||
| 22 | + | ||
| 23 | + // 路段矢量(空间坐标点集合)--GPS坐标点 | ||
| 24 | + private String bRoadVector; | ||
| 25 | + | ||
| 26 | + // 路段矢量(空间坐标点集合)--百度坐标点 | ||
| 27 | + private String gRoadVector; | ||
| 28 | + | ||
| 29 | + // 限速 (km/h) | ||
| 30 | + private Double speed; | ||
| 31 | + | ||
| 32 | + // 限速开始时间 | ||
| 33 | + private String speedStartDate; | ||
| 34 | + | ||
| 35 | + // 限速结束时间 | ||
| 36 | + private String speedEndDate; | ||
| 37 | + | ||
| 38 | + // 是否启用限速(0:启用、1:未启用) | ||
| 39 | + private int isStart; | ||
| 40 | + | ||
| 41 | + // 预留字段(限速的线路) | ||
| 42 | + private String line; | ||
| 43 | + | ||
| 44 | + // 创建日期 timestamp | ||
| 45 | + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | ||
| 46 | + private Date createDate; | ||
| 47 | + | ||
| 48 | + // 修改日期 timestamp | ||
| 49 | + @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | ||
| 50 | + private Date updateDate; | ||
| 51 | + | ||
| 52 | + public Integer getId() { | ||
| 53 | + return id; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + public String getName() { | ||
| 57 | + return name; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + public String getbRoadVector() { | ||
| 61 | + return bRoadVector; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + public String getgRoadVector() { | ||
| 65 | + return gRoadVector; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + public Double getSpeed() { | ||
| 69 | + return speed; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + public String getSpeedStartDate() { | ||
| 73 | + return speedStartDate; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + public String getSpeedEndDate() { | ||
| 77 | + return speedEndDate; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public int getIsStart() { | ||
| 81 | + return isStart; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public String getLine() { | ||
| 85 | + return line; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public Date getCreateDate() { | ||
| 89 | + return createDate; | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + public Date getUpdateDate() { | ||
| 93 | + return updateDate; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + public void setId(Integer id) { | ||
| 97 | + this.id = id; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + public void setName(String name) { | ||
| 101 | + this.name = name; | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + public void setbRoadVector(String bRoadVector) { | ||
| 105 | + this.bRoadVector = bRoadVector; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + public void setgRoadVector(String gRoadVector) { | ||
| 109 | + this.gRoadVector = gRoadVector; | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + public void setSpeed(Double speed) { | ||
| 113 | + this.speed = speed; | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + public void setSpeedStartDate(String speedStartDate) { | ||
| 117 | + this.speedStartDate = speedStartDate; | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + public void setSpeedEndDate(String speedEndDate) { | ||
| 121 | + this.speedEndDate = speedEndDate; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + public void setIsStart(int isStart) { | ||
| 125 | + this.isStart = isStart; | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + public void setLine(String line) { | ||
| 129 | + this.line = line; | ||
| 130 | + } | ||
| 131 | + | ||
| 132 | + public void setCreateDate(Date createDate) { | ||
| 133 | + this.createDate = createDate; | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + public void setUpdateDate(Date updateDate) { | ||
| 137 | + this.updateDate = updateDate; | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + @Override | ||
| 141 | + public String toString() { | ||
| 142 | + return "RoadSpeed [id=" + id + ", name=" + name + ", bRoadVector=" + bRoadVector + ", gRoadVector=" | ||
| 143 | + + gRoadVector + ", speed=" + speed + ", speedStartDate=" + speedStartDate + ", speedEndDate=" | ||
| 144 | + + speedEndDate + ", isStart=" + isStart + ", line=" + line + ", createDate=" + createDate | ||
| 145 | + + ", updateDate=" + updateDate + "]"; | ||
| 146 | + } | ||
| 147 | + | ||
| 148 | + | ||
| 149 | +} |
src/main/java/com/bsth/repository/RoadSpeedRepository.java
0 → 100644
| 1 | +package com.bsth.repository; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +import org.springframework.data.jpa.repository.Modifying; | ||
| 7 | +import org.springframework.data.jpa.repository.Query; | ||
| 8 | +import org.springframework.stereotype.Repository; | ||
| 9 | +import org.springframework.transaction.annotation.Transactional; | ||
| 10 | + | ||
| 11 | +import com.bsth.entity.RoadSpeed; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * | ||
| 15 | + * @Interface: RoadSpeedRepository(路段限速Repository数据持久层接口) | ||
| 16 | + * | ||
| 17 | + * @Extends : BaseRepository | ||
| 18 | + * | ||
| 19 | + * @Description: TODO(线路版本Repository数据持久层接口) | ||
| 20 | + * | ||
| 21 | + * @Author bsth@lq | ||
| 22 | + * | ||
| 23 | + * @Version 公交调度系统BS版 0.1 | ||
| 24 | + * | ||
| 25 | + */ | ||
| 26 | +@Repository | ||
| 27 | +public interface RoadSpeedRepository extends BaseRepository<RoadSpeed, Integer> { | ||
| 28 | + | ||
| 29 | + @Transactional | ||
| 30 | + @Modifying | ||
| 31 | + @Query(value="INSERT INTO bsth_c_road_speed "+ | ||
| 32 | + | ||
| 33 | + "(name , g_road_vector , b_road_vector , speed, speed_start_date ,"+ | ||
| 34 | + | ||
| 35 | + "speed_end_date , is_start) VALUES (?1 , LINESTRINGFROMTEXT(?2) , LINESTRINGFROMTEXT(?3) , ?4 , ?5 , "+ | ||
| 36 | + | ||
| 37 | + "?6 , ?7 )", nativeQuery=true) | ||
| 38 | + public void roadSpeedSave(String name, String gRoadVector, String bRoadVector, double speed, String speedStartDate, | ||
| 39 | + String speedEndDate, int isStart); | ||
| 40 | + | ||
| 41 | + @Query(value="SELECT " | ||
| 42 | + + "rs.id as id, " | ||
| 43 | + + "rs.name as name, " | ||
| 44 | + + "AsText(rs.b_road_vector) as bRoadVector, " | ||
| 45 | + + "AsText(rs.g_road_vector) as gRoadVector, " | ||
| 46 | + + "rs.speed as speed, " | ||
| 47 | + + "rs.speed_start_date as speedStartDate, " | ||
| 48 | + + "rs.speed_end_date as speedEndDate, " | ||
| 49 | + + "rs.is_start as isStart, " | ||
| 50 | + + "rs.line as line " | ||
| 51 | + + "FROM bsth_c_road_speed rs WHERE rs.id=?1 ", nativeQuery=true) | ||
| 52 | + public List<Object[]> findById(Integer id); | ||
| 53 | + | ||
| 54 | + @Transactional | ||
| 55 | + @Modifying | ||
| 56 | + @Query(value="update bsth_c_road_speed set name=?2, g_road_vector=LINESTRINGFROMTEXT(?3)," | ||
| 57 | + + " b_road_vector=LINESTRINGFROMTEXT(?4), speed=?5, speed_start_date=?6, " | ||
| 58 | + + "speed_end_date=?7, is_start=?8 where id=?1", nativeQuery=true) | ||
| 59 | + public void update(int id, String name, String gRoadVector, String bRoadVector, double speed, String speedStartDate, | ||
| 60 | + String speedEndDate, int isStart); | ||
| 61 | + | ||
| 62 | +} |
src/main/java/com/bsth/service/RoadSpeedService.java
0 → 100644
| 1 | +package com.bsth.service; | ||
| 2 | + | ||
| 3 | +import java.util.List; | ||
| 4 | +import java.util.Map; | ||
| 5 | + | ||
| 6 | +import com.bsth.entity.RoadSpeed; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * | ||
| 10 | + * @Interface: RoadSpeedService(路段限速service业务层实现接口) | ||
| 11 | + * | ||
| 12 | + * @extends : BaseService | ||
| 13 | + * | ||
| 14 | + * @Description: TODO(路段限速service业务层实现接口) | ||
| 15 | + * | ||
| 16 | + * @Author bsth@lq | ||
| 17 | + * | ||
| 18 | + * @Version 公交调度系统BS版 0.1 | ||
| 19 | + * | ||
| 20 | + */ | ||
| 21 | +public interface RoadSpeedService extends BaseService<RoadSpeed, Integer> { | ||
| 22 | + | ||
| 23 | + Map<String, Object> update(Map<String, Object> map); | ||
| 24 | + | ||
| 25 | + Map<String, Object> roadSpeedSave(Map<String, Object> map); | ||
| 26 | + | ||
| 27 | + RoadSpeed findId(Integer id); | ||
| 28 | + | ||
| 29 | + List<RoadSpeed> allRoadSpeed(); | ||
| 30 | +} |
src/main/java/com/bsth/service/impl/RoadSpeedServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.impl; | ||
| 2 | + | ||
| 3 | +import java.util.ArrayList; | ||
| 4 | +import java.util.HashMap; | ||
| 5 | +import java.util.Iterator; | ||
| 6 | +import java.util.List; | ||
| 7 | +import java.util.Map; | ||
| 8 | + | ||
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | +import org.springframework.stereotype.Service; | ||
| 11 | + | ||
| 12 | +import com.alibaba.fastjson.JSONArray; | ||
| 13 | +import com.bsth.common.ResponseCode; | ||
| 14 | +import com.bsth.entity.RoadSpeed; | ||
| 15 | +import com.bsth.repository.RoadSpeedRepository; | ||
| 16 | +import com.bsth.service.RoadSpeedService; | ||
| 17 | +import com.bsth.util.TransGPS; | ||
| 18 | +import com.bsth.util.TransGPS.Location; | ||
| 19 | + | ||
| 20 | +@Service | ||
| 21 | +public class RoadSpeedServiceImpl extends BaseServiceImpl<RoadSpeed, Integer> implements RoadSpeedService { | ||
| 22 | + | ||
| 23 | + @Autowired | ||
| 24 | + private RoadSpeedRepository repository; | ||
| 25 | + | ||
| 26 | + @Override | ||
| 27 | + public Map<String, Object> update(Map<String, Object> map) { | ||
| 28 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | ||
| 29 | + try { | ||
| 30 | + int id = Integer.parseInt(map.get("id").toString()); | ||
| 31 | + String name = map.get("name").toString(); | ||
| 32 | + double speed = Double.valueOf(map.get("speed").toString()); | ||
| 33 | + String speedStartDate = map.get("speedStartDate").toString(); | ||
| 34 | + String speedEndDate = map.get("speedEndDate").toString(); | ||
| 35 | + int isStart = Integer.parseInt(map.get("isStart").toString()); | ||
| 36 | + String sectionJSON = map.get("bRoadVector").toString(); | ||
| 37 | + // 原始线状图形坐标集合 | ||
| 38 | + String sectionsBpoints = ""; | ||
| 39 | + // WGS线状图形坐标集合 | ||
| 40 | + String sectionsWJPpoints = ""; | ||
| 41 | + if(!sectionJSON.equals("")) { | ||
| 42 | + // 转换成JSON数组 | ||
| 43 | + JSONArray sectionsArray = JSONArray.parseArray(sectionJSON); | ||
| 44 | + // 遍历 | ||
| 45 | + for(int s = 0 ;s<sectionsArray.size();s++) { | ||
| 46 | + String pointsLngStr = sectionsArray.getJSONObject(s).get("lng").toString(); | ||
| 47 | + String pointsLatStr = sectionsArray.getJSONObject(s).get("lat").toString(); | ||
| 48 | + String WGSLngStr = ""; | ||
| 49 | + String WGSLatStr = ""; | ||
| 50 | + Location resultPoint = FromBDPointToWGSPoint(pointsLngStr,pointsLatStr); | ||
| 51 | + WGSLngStr = String.valueOf(resultPoint.getLng()); | ||
| 52 | + WGSLatStr = String.valueOf(resultPoint.getLat()); | ||
| 53 | + if(s==0) { | ||
| 54 | + sectionsBpoints = pointsLngStr + " " + pointsLatStr; | ||
| 55 | + sectionsWJPpoints = WGSLngStr + " " + WGSLatStr; | ||
| 56 | + }else { | ||
| 57 | + sectionsBpoints = sectionsBpoints + "," + pointsLngStr + " " + pointsLatStr; | ||
| 58 | + sectionsWJPpoints = sectionsWJPpoints + "," + WGSLngStr + " " + WGSLatStr; | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + // WGS坐标点集合 | ||
| 63 | + String gRoadVector = "LINESTRING(" + sectionsWJPpoints +")"; | ||
| 64 | + // 原坐标点集合 | ||
| 65 | + String bRoadVector = "LINESTRING(" + sectionsBpoints + ")"; | ||
| 66 | + | ||
| 67 | + repository.update(id,name,gRoadVector,bRoadVector,speed,speedStartDate,speedEndDate,isStart); | ||
| 68 | + resultMap.put("status", ResponseCode.SUCCESS); | ||
| 69 | + } catch (Exception e) { | ||
| 70 | + resultMap.put("status", ResponseCode.ERROR); | ||
| 71 | + logger.error("save erro.", e); | ||
| 72 | + } | ||
| 73 | + return resultMap; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + @Override | ||
| 77 | + public Map<String, Object> roadSpeedSave(Map<String, Object> map) { | ||
| 78 | + Map<String, Object> resultMap = new HashMap<String, Object>(); | ||
| 79 | + try { | ||
| 80 | + String name = map.get("name").toString(); | ||
| 81 | + double speed = Double.valueOf(map.get("speed").toString()); | ||
| 82 | + String speedStartDate = map.get("speedStartDate").toString(); | ||
| 83 | + String speedEndDate = map.get("speedEndDate").toString(); | ||
| 84 | + int isStart = Integer.parseInt(map.get("isStart").toString()); | ||
| 85 | + String sectionJSON = map.get("bRoadVector").toString(); | ||
| 86 | + // 原始线状图形坐标集合 | ||
| 87 | + String sectionsBpoints = ""; | ||
| 88 | + // WGS线状图形坐标集合 | ||
| 89 | + String sectionsWJPpoints = ""; | ||
| 90 | + if(!sectionJSON.equals("")) { | ||
| 91 | + // 转换成JSON数组 | ||
| 92 | + JSONArray sectionsArray = JSONArray.parseArray(sectionJSON); | ||
| 93 | + // 遍历 | ||
| 94 | + for(int s = 0 ;s<sectionsArray.size();s++) { | ||
| 95 | + String pointsLngStr = sectionsArray.getJSONObject(s).get("lng").toString(); | ||
| 96 | + String pointsLatStr = sectionsArray.getJSONObject(s).get("lat").toString(); | ||
| 97 | + String WGSLngStr = ""; | ||
| 98 | + String WGSLatStr = ""; | ||
| 99 | + Location resultPoint = FromBDPointToWGSPoint(pointsLngStr,pointsLatStr); | ||
| 100 | + WGSLngStr = String.valueOf(resultPoint.getLng()); | ||
| 101 | + WGSLatStr = String.valueOf(resultPoint.getLat()); | ||
| 102 | + if(s==0) { | ||
| 103 | + sectionsBpoints = pointsLngStr + " " + pointsLatStr; | ||
| 104 | + sectionsWJPpoints = WGSLngStr + " " + WGSLatStr; | ||
| 105 | + }else { | ||
| 106 | + sectionsBpoints = sectionsBpoints + "," + pointsLngStr + " " + pointsLatStr; | ||
| 107 | + sectionsWJPpoints = sectionsWJPpoints + "," + WGSLngStr + " " + WGSLatStr; | ||
| 108 | + } | ||
| 109 | + } | ||
| 110 | + } | ||
| 111 | + // WGS坐标点集合 | ||
| 112 | + String gRoadVector = "LINESTRING(" + sectionsWJPpoints +")"; | ||
| 113 | + // 原坐标点集合 | ||
| 114 | + String bRoadVector = "LINESTRING(" + sectionsBpoints + ")"; | ||
| 115 | + | ||
| 116 | + repository.roadSpeedSave(name,gRoadVector,bRoadVector,speed,speedStartDate,speedEndDate,isStart); | ||
| 117 | + resultMap.put("status", ResponseCode.SUCCESS); | ||
| 118 | + } catch (Exception e) { | ||
| 119 | + resultMap.put("status", ResponseCode.ERROR); | ||
| 120 | + logger.error("save erro.", e); | ||
| 121 | + } | ||
| 122 | + return resultMap; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + /** 百度坐标转WGS坐标 */ | ||
| 126 | + public Location FromBDPointToWGSPoint(String bLonx,String bLatx) { | ||
| 127 | + | ||
| 128 | + double lng = Double.parseDouble(bLonx); | ||
| 129 | + | ||
| 130 | + double lat = Double.parseDouble(bLatx); | ||
| 131 | + | ||
| 132 | + Location bdLoc = TransGPS.LocationMake(lng, lat); | ||
| 133 | + | ||
| 134 | + Location location = TransGPS.bd_decrypt(bdLoc); | ||
| 135 | + | ||
| 136 | + Location WGSPoint = TransGPS.transformFromGCJToWGS(location); | ||
| 137 | + | ||
| 138 | + return WGSPoint; | ||
| 139 | + | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + @Override | ||
| 143 | + public RoadSpeed findId(Integer id) { | ||
| 144 | + List<Object[]> listObc = repository.findById(id); | ||
| 145 | + | ||
| 146 | + Object rsObj[] = listObc.get(0); | ||
| 147 | + RoadSpeed rs = new RoadSpeed(); | ||
| 148 | + String id1 = rsObj[0].toString(); | ||
| 149 | + rs.setId(Integer.parseInt(id1)); | ||
| 150 | + rs.setName(rsObj[1].toString()); | ||
| 151 | + rs.setbRoadVector(rsObj[2].toString()); | ||
| 152 | + rs.setgRoadVector(rsObj[3].toString()); | ||
| 153 | + rs.setSpeed(Double.valueOf(rsObj[4].toString())); | ||
| 154 | + rs.setSpeedStartDate(rsObj[5].toString()); | ||
| 155 | + rs.setSpeedEndDate(rsObj[6].toString()); | ||
| 156 | + rs.setIsStart(Integer.parseInt(rsObj[7].toString())); | ||
| 157 | + if (rsObj[8] != null) { | ||
| 158 | + rs.setLine(rsObj[8].toString()); | ||
| 159 | + } | ||
| 160 | + return rs; | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + @Override | ||
| 164 | + public List<RoadSpeed> allRoadSpeed() { | ||
| 165 | + List<RoadSpeed> list = new ArrayList<>(); | ||
| 166 | + /*Iterator<RoadSpeed> itr = repository.findAll().iterator(); | ||
| 167 | + while (itr.hasNext()){ | ||
| 168 | + RoadSpeed aRoadSpeed = itr.next(); | ||
| 169 | + System.out.println("aRoadSpeed"); | ||
| 170 | + list.add(aRoadSpeed); | ||
| 171 | + }*/ | ||
| 172 | + return list; | ||
| 173 | + } | ||
| 174 | +} |
src/main/resources/static/pages/base/carpark/js/add-form-wizard.js
| @@ -198,7 +198,7 @@ var FormWizard = function() { | @@ -198,7 +198,7 @@ var FormWizard = function() { | ||
| 198 | }else if(baseResValue ==1) { | 198 | }else if(baseResValue ==1) { |
| 199 | addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {}); | 199 | addCarParkVmapWorlds.localSearchFromAdreesToPoint(stationNameV,function(p) {}); |
| 200 | $('.leftUtils').show(); | 200 | $('.leftUtils').show(); |
| 201 | - addCarParkVmapWorlds.drawingManagerOpen(); | 201 | +// addCarParkVmapWorlds.drawingManagerOpen(); |
| 202 | } | 202 | } |
| 203 | $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); | 203 | $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); |
| 204 | },300) | 204 | },300) |
src/main/resources/static/pages/base/roadspeed/add.html
0 → 100644
| 1 | +<link href="/pages/base/roadspeed/css/addmap.css" rel="stylesheet" type="text/css" /> | ||
| 2 | +<div class="page-head"> | ||
| 3 | + <div class="page-title"> | ||
| 4 | + <h1>添加路段限速</h1> | ||
| 5 | + </div> | ||
| 6 | +</div> | ||
| 7 | + | ||
| 8 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 9 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 10 | + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | ||
| 11 | + <li><a href="/pages/base/roadspeed/list.html" data-pjax>路段限速信息</a> <i class="fa fa-circle"></i></li> | ||
| 12 | + <li><span class="active">添加路段限速</span></li> | ||
| 13 | +</ul> | ||
| 14 | + | ||
| 15 | +<div class="portlet light bordered" id="form-wizard-info"> | ||
| 16 | + <div class="portlet-title"> | ||
| 17 | + <div class="caption"> | ||
| 18 | + <i class="icon-equalizer font-red-sunglo"></i> | ||
| 19 | + <span class="caption-subject font-red-sunglo bold uppercase">添加路段限速 | ||
| 20 | + <span class="step-title"> 1 - 4 </span> | ||
| 21 | + <i class="fa fa-question-circle tipso-animation" style="color: rgba(158, 158, 158, 0.49);"></i> | ||
| 22 | + </span> | ||
| 23 | + </div> | ||
| 24 | + <div class="actions"> | ||
| 25 | + <div class="btn-group btn-group-devided" data-toggle="buttons"> | ||
| 26 | + <a class="btn btn-circle default" href="/pages/base/roadspeed/list.html" style="float: right;padding: 4px 23px;" data-pjax=""><i class="fa fa-reply"></i> 退出</a> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + </div> | ||
| 30 | + <div class="portlet-body form"> | ||
| 31 | + <!-- START FORM --> | ||
| 32 | + <form class="form-horizontal" id="submit_roadspeed_form" action="/" method="POST" novalidate="novalidate"> | ||
| 33 | + <div class="form-wizard"> | ||
| 34 | + <div class="form-body"> | ||
| 35 | + <ul class="nav nav-pills nav-justified steps"> | ||
| 36 | + <li class="active"> | ||
| 37 | + <a href="#tab1" data-toggle="tab" class="step" aria-expanded="true"> | ||
| 38 | + <span class="number"> 1 </span> | ||
| 39 | + <span class="desc"> | ||
| 40 | + <i class="fa fa-check"></i> 选择添加路段限速方式 </span> | ||
| 41 | + </a> | ||
| 42 | + </li> | ||
| 43 | + <li> | ||
| 44 | + <a href="#tab2" data-toggle="tab" class="step"> | ||
| 45 | + <span class="number"> 2 </span> | ||
| 46 | + <span class="desc"> | ||
| 47 | + <i class="fa fa-check"></i> 路段位置 </span> | ||
| 48 | + </a> | ||
| 49 | + </li> | ||
| 50 | + <li> | ||
| 51 | + <a href="#tab3" data-toggle="tab" class="step active"> | ||
| 52 | + <span class="number"> 3 </span> | ||
| 53 | + <span class="desc"> | ||
| 54 | + <i class="fa fa-check"></i> 路段限速信息 </span> | ||
| 55 | + </a> | ||
| 56 | + </li> | ||
| 57 | + <li> | ||
| 58 | + <a href="#tab4" data-toggle="tab" class="step"> | ||
| 59 | + <span class="number"> 4 </span> | ||
| 60 | + <span class="desc"> | ||
| 61 | + <i class="fa fa-check"></i> 确认 </span> | ||
| 62 | + </a> | ||
| 63 | + </li> | ||
| 64 | + </ul> | ||
| 65 | + <!-- 进度条 --> | ||
| 66 | + <div id="bar" class="progress progress-striped" role="progressbar"> | ||
| 67 | + <div class="progress-bar progress-bar-success" style="width: 25%;"></div> | ||
| 68 | + </div> | ||
| 69 | + | ||
| 70 | + <div class="tab-content"> | ||
| 71 | + <div class="alert alert-danger display-hide"> | ||
| 72 | + <button class="close" data-close="alert"></button> | ||
| 73 | + 您的输入有误,请检查下面的输入项 | ||
| 74 | + </div> | ||
| 75 | + <div class="alert alert-success display-none"> | ||
| 76 | + <button class="close" data-dismiss="alert"></button> | ||
| 77 | + Your form validation is successful! | ||
| 78 | + </div> | ||
| 79 | + | ||
| 80 | + <!-- 选择添加路段方式 --> | ||
| 81 | + <div class="tab-pane active" id="tab1"> | ||
| 82 | + <h3 class="block"> 选择添加路段限速方式 </h3> | ||
| 83 | + <!-- 起点名称 --> | ||
| 84 | + <div class="form-group" id="formRequ"> | ||
| 85 | + <label class="col-md-3 control-label"><span class="required"> * </span>路段起点名称:</label> | ||
| 86 | + <div class="col-md-9"> | ||
| 87 | + <input type="text" class="form-control input-medium" id="stationStartInput" name="stationStart"> | ||
| 88 | + </div> | ||
| 89 | + </div> | ||
| 90 | + <!-- 终点名称--> | ||
| 91 | + <div class="form-group" id="formRequ"> | ||
| 92 | + <label class="col-md-3 control-label"><span class="required"> * </span>路段终点名称:</label> | ||
| 93 | + <div class="col-md-9"> | ||
| 94 | + <input type="text" class="form-control input-medium" id="stationEndInput" name="stationEnd"> | ||
| 95 | + </div> | ||
| 96 | + </div> | ||
| 97 | + <!-- 新增方式 --> | ||
| 98 | + <div class="form-group"> | ||
| 99 | + <label class="col-md-3 control-label"><span class="required"> * </span> | ||
| 100 | + 新增方式 : | ||
| 101 | + </label> | ||
| 102 | + <div class="col-md-9"> | ||
| 103 | + <div class="icheck-list"> | ||
| 104 | + <label> | ||
| 105 | + <input type="radio" class="icheck" name="baseRes" value=0 > 系统生成 | ||
| 106 | + </label> | ||
| 107 | + <label > | ||
| 108 | + <input type="radio" class="icheck" name="baseRes" value=1 checked> 手动添加 | ||
| 109 | + </label> | ||
| 110 | + </div> | ||
| 111 | + </div> | ||
| 112 | + </div> | ||
| 113 | + </div> | ||
| 114 | + | ||
| 115 | + <!-- 路段位置 --> | ||
| 116 | + <div class="tab-pane" id="tab2"> | ||
| 117 | + <h3 class="block"> 路段位置 </h3> | ||
| 118 | + <div id="roadBmap_basic"></div> | ||
| 119 | + <div class="leftUtils"> | ||
| 120 | + <div class="btn-group" style="left: 100px;"> | ||
| 121 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具 | ||
| 122 | + <i class="fa fa-angle-down"></i> | ||
| 123 | + </a> | ||
| 124 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | ||
| 125 | + <li> | ||
| 126 | + <a href="javascript:;" id="openDrawingManager"><i class="fa fa-pencil"></i> 打开 </a> | ||
| 127 | + </li> | ||
| 128 | + <li> | ||
| 129 | + <a href="javascript:;" id = "closeDrawingManager"> <i class="fa fa-reply"></i> 关闭 </a> | ||
| 130 | + </li> | ||
| 131 | + | ||
| 132 | + </ul> | ||
| 133 | + </div> | ||
| 134 | + </div> | ||
| 135 | + </div> | ||
| 136 | + | ||
| 137 | + <!-- 路段信息 --> | ||
| 138 | + <div class="tab-pane" id="tab3"> | ||
| 139 | + <h3 class="block"> 路段限速信息 </h3> | ||
| 140 | + <input type="hidden" name="bRoadVector" id="bRoadVectorInput" /> | ||
| 141 | + <input type="hidden" name="gRoadVector" id="gRoadVectorInput" /> | ||
| 142 | + | ||
| 143 | + <!-- 路段名称 --> | ||
| 144 | + <div class="form-body"> | ||
| 145 | + <div class="form-group"> | ||
| 146 | + <label class="control-label col-md-3"> | ||
| 147 | + <span class="required"> * </span> 路段名称: | ||
| 148 | + </label> | ||
| 149 | + <div class="col-md-6"> | ||
| 150 | + <input type="text" class="form-control" name="name" id="nameInput" placeholder="路段名称"> | ||
| 151 | + </div> | ||
| 152 | + </div> | ||
| 153 | + </div> | ||
| 154 | + <!-- 限速开始时间 --> | ||
| 155 | + <div class="form-body"> | ||
| 156 | + <div class="form-group"> | ||
| 157 | + <label class="control-label col-md-3"> | ||
| 158 | + <span class="required"> * </span> 限速开始时间: | ||
| 159 | + </label> | ||
| 160 | + <div class="col-md-6"> | ||
| 161 | + <input type="text" class="form-control" name="speedStartDate" id="speedStartDateInput" placeholder="限速开始时间"> | ||
| 162 | + </div> | ||
| 163 | + </div> | ||
| 164 | + </div> | ||
| 165 | + <!-- 限速结束时间 --> | ||
| 166 | + <div class="form-body"> | ||
| 167 | + <div class="form-group"> | ||
| 168 | + <label class="control-label col-md-3"> | ||
| 169 | + <span class="required"> * </span> 限速结束时间: | ||
| 170 | + </label> | ||
| 171 | + <div class="col-md-6"> | ||
| 172 | + <input type="text" class="form-control" name="speedEndDate" id="speedEndDateInput" placeholder="限速结束时间"> | ||
| 173 | + </div> | ||
| 174 | + </div> | ||
| 175 | + </div> | ||
| 176 | + <!-- 是否撤销 --> | ||
| 177 | + <div class="form-body"> | ||
| 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 | + <select name="isStart" class="form-control" id="isStartSelect"> | ||
| 182 | + <option value="">-- 请选择启用类型 --</option> | ||
| 183 | + <option value="0">启用</option> | ||
| 184 | + <option value="1">未启用</option> | ||
| 185 | + </select> | ||
| 186 | + </div> | ||
| 187 | + </div> | ||
| 188 | + </div> | ||
| 189 | + <!-- 限速 --> | ||
| 190 | + <div class="form-body"> | ||
| 191 | + <div class="form-group"> | ||
| 192 | + <label class="control-label col-md-3"> <span class="required"> * </span> 路段限速:</label> | ||
| 193 | + <div class="col-md-6"> | ||
| 194 | + <input type="text" class="form-control" name="speed" id="speedInput" value="60"> | ||
| 195 | + <span class="help-block">单位:千米/时(km/h)</span> | ||
| 196 | + </div> | ||
| 197 | + </div> | ||
| 198 | + </div> | ||
| 199 | + | ||
| 200 | + </div> | ||
| 201 | + | ||
| 202 | + <!-- 确定提交资料信息 --> | ||
| 203 | + <div class="tab-pane" id="tab4"> | ||
| 204 | + <h3 class="block"> 确认您提交的路段限速信息 </h3> | ||
| 205 | + | ||
| 206 | + <h4 class="form-section"> 路段限速信息 </h4> | ||
| 207 | + | ||
| 208 | + <div class="form-group"> | ||
| 209 | + <label class="control-label col-md-3">路段名称:</label> | ||
| 210 | + <div class="col-md-4"> | ||
| 211 | + <p class="form-control-static" data-display="name"> </p> | ||
| 212 | + </div> | ||
| 213 | + </div> | ||
| 214 | + | ||
| 215 | + <div class="form-group"> | ||
| 216 | + <label class="control-label col-md-3">限速开始时间:</label> | ||
| 217 | + <div class="col-md-4"> | ||
| 218 | + <p class="form-control-static" data-display="speedStartDate"> </p> | ||
| 219 | + </div> | ||
| 220 | + </div> | ||
| 221 | + | ||
| 222 | + <div class="form-group"> | ||
| 223 | + <label class="control-label col-md-3">限速结束时间:</label> | ||
| 224 | + <div class="col-md-4"> | ||
| 225 | + <p class="form-control-static" data-display="speedEndDate"> </p> | ||
| 226 | + </div> | ||
| 227 | + </div> | ||
| 228 | + | ||
| 229 | + <div class="form-group"> | ||
| 230 | + <label class="control-label col-md-3">是否启用:</label> | ||
| 231 | + <div class="col-md-4"> | ||
| 232 | + <p class="form-control-static" data-display="isStart"> </p> | ||
| 233 | + </div> | ||
| 234 | + </div> | ||
| 235 | + | ||
| 236 | + <div class="form-group"> | ||
| 237 | + <label class="control-label col-md-3">路段限速:</label> | ||
| 238 | + <div class="col-md-4"> | ||
| 239 | + <p class="form-control-static" data-display="speed"> </p> | ||
| 240 | + </div> | ||
| 241 | + </div> | ||
| 242 | + | ||
| 243 | + </div> | ||
| 244 | + </div> | ||
| 245 | + </div> | ||
| 246 | + <div class="form-actions"> | ||
| 247 | + <div class="row"> | ||
| 248 | + <div class="col-md-offset-3 col-md-9"> | ||
| 249 | + <a href="javascript:;" class="btn default button-previous disabled" style="display: none;"> | ||
| 250 | + <i class="fa fa-angle-left"></i> 返回 </a> | ||
| 251 | + <a href="javascript:;" class="btn btn-outline green button-next"> 下一步 | ||
| 252 | + <i class="fa fa-angle-right"></i> | ||
| 253 | + </a> | ||
| 254 | + <a href="javascript:;" class="btn green button-submit" style="display: none;"> 提交 | ||
| 255 | + <i class="fa fa-check"></i> | ||
| 256 | + </a> | ||
| 257 | + </div> | ||
| 258 | + </div> | ||
| 259 | + </div> | ||
| 260 | + </div> | ||
| 261 | + </form> | ||
| 262 | + <!-- END FORM--> | ||
| 263 | + </div> | ||
| 264 | +</div> | ||
| 265 | +<!-- 表单向导JS类库 --> | ||
| 266 | +<script src="/pages/base/roadspeed/js/add-form-wizard.js"></script> | ||
| 267 | +<!-- 地图JS类库 --> | ||
| 268 | +<script src="/pages/base/roadspeed/js/add-vmap-world.js"></script> | ||
| 269 | +<!-- reload事件 --> | ||
| 270 | +<script src="/pages/base/roadspeed/js/add-form-reload.js"></script> | ||
| 0 | \ No newline at end of file | 271 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/css/addmap.css
0 → 100644
| 1 | +#roadBmap_basic{ | ||
| 2 | + min-width: 100%; | ||
| 3 | + width: 100%; | ||
| 4 | + margin-top: -28px; | ||
| 5 | + border: 2px solid #fdfdfd; | ||
| 6 | + min-height: 400px; | ||
| 7 | + height:100%; | ||
| 8 | + overflow: hidden; | ||
| 9 | + top: 15px; | ||
| 10 | +} | ||
| 11 | +/* 绘画工具 */ | ||
| 12 | +.leftUtils{ | ||
| 13 | + position: absolute; | ||
| 14 | + padding-right: 100px; | ||
| 15 | + width: 100%; | ||
| 16 | + height: 40px; | ||
| 17 | + z-index: 9999; | ||
| 18 | + padding-top: 7px; | ||
| 19 | + top: 400px; | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +/* 隐藏百度地图logo */ | ||
| 23 | +.anchorBL, | ||
| 24 | +.anchorBL, | ||
| 25 | +.amap-logo, | ||
| 26 | +.amap-copyright{ | ||
| 27 | + display: none; | ||
| 28 | +} | ||
| 29 | + | ||
| 30 | +.BMap_pop div:nth-child(1) , | ||
| 31 | +.BMap_pop div:nth-child(2) , | ||
| 32 | +.BMap_pop div:nth-child(3) , | ||
| 33 | +.BMap_pop div:nth-child(4) , | ||
| 34 | +.BMap_pop div:nth-child(5) , | ||
| 35 | +.BMap_pop div:nth-child(6) , | ||
| 36 | +.BMap_pop div:nth-child(7) { | ||
| 37 | + border:0px solid rgb(255, 255, 255) !important; | ||
| 38 | + background-color:#3B3F51 !important; | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +.BMap_pop div:nth-child(3){ | ||
| 42 | + width:23px !important; | ||
| 43 | +} | ||
| 44 | + | ||
| 45 | +.BMap_pop div:nth-child(7) { | ||
| 46 | + width:23px !important; | ||
| 47 | + height:24px !important; | ||
| 48 | +} | ||
| 49 | + | ||
| 50 | +.BMap_pop div:nth-child(5) { | ||
| 51 | + height:24px !important; | ||
| 52 | +} | ||
| 53 | + | ||
| 54 | +/* 图片以后在弄,先隐藏div */ | ||
| 55 | +.BMap_pop div:nth-child(8) { | ||
| 56 | + height:0px !important; | ||
| 57 | + /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */ | ||
| 58 | + /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */ | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +.BMap_pop { | ||
| 62 | + box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important; | ||
| 63 | +} | ||
| 0 | \ No newline at end of file | 64 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/css/positions.css
0 → 100644
| 1 | +#roadspeedPbmap_basic{ | ||
| 2 | + min-width: 100%; | ||
| 3 | + width: calc(100% + 26px); | ||
| 4 | + margin-top: -28px; | ||
| 5 | + border: 2px solid #fdfdfd; | ||
| 6 | + min-height: 1200px; | ||
| 7 | + height:100%; | ||
| 8 | + overflow: hidden; | ||
| 9 | +} | ||
| 10 | + | ||
| 11 | +html,body{ | ||
| 12 | + overflow:hidden; | ||
| 13 | +} | ||
| 14 | + | ||
| 15 | +/* 隐藏百度地图logo */ | ||
| 16 | +.anchorBL, | ||
| 17 | +.anchorBL, | ||
| 18 | +.amap-logo, | ||
| 19 | +.amap-copyright{ | ||
| 20 | + display: none; | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +.leftUtils{ | ||
| 25 | + position: absolute; | ||
| 26 | + padding-right: 100px; | ||
| 27 | + width: 100%; | ||
| 28 | + height: 40px; | ||
| 29 | + z-index: 9999; | ||
| 30 | + padding-top: 7px; | ||
| 31 | + top: 20px; | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +.BMap_pop div:nth-child(1) , | ||
| 35 | +.BMap_pop div:nth-child(2) , | ||
| 36 | +.BMap_pop div:nth-child(3) , | ||
| 37 | +.BMap_pop div:nth-child(4) , | ||
| 38 | +.BMap_pop div:nth-child(5) , | ||
| 39 | +.BMap_pop div:nth-child(6) , | ||
| 40 | +.BMap_pop div:nth-child(7) { | ||
| 41 | + | ||
| 42 | + border:0px solid rgb(255, 255, 255) !important; | ||
| 43 | + background-color:#3B3F51 !important; | ||
| 44 | + | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +.BMap_pop div:nth-child(3){ | ||
| 48 | + | ||
| 49 | + width:23px !important; | ||
| 50 | + | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +.BMap_pop div:nth-child(7) { | ||
| 54 | + | ||
| 55 | + width:23px !important; | ||
| 56 | + | ||
| 57 | + height:24px !important; | ||
| 58 | + | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +.BMap_pop div:nth-child(5) { | ||
| 62 | + | ||
| 63 | + height:24px !important; | ||
| 64 | + | ||
| 65 | +} | ||
| 66 | + | ||
| 67 | +/* 图片以后在弄,先隐藏div */ | ||
| 68 | +.BMap_pop div:nth-child(8) { | ||
| 69 | + | ||
| 70 | + height:0px !important; | ||
| 71 | + /* background:url('/pages/base/stationroute/css/img/iw3-1.png') no-repeat !important; */ | ||
| 72 | + /* background-image:url('/pages/base/stationroute/css/img/windowinfo_b.jpg') !important; */ | ||
| 73 | + | ||
| 74 | +} | ||
| 75 | + | ||
| 76 | +/* 图片以后在弄,先隐藏div */ | ||
| 77 | +.BMap_pop img:nth-child(10) { | ||
| 78 | + | ||
| 79 | + display: none; | ||
| 80 | + | ||
| 81 | +} | ||
| 82 | + | ||
| 83 | +.BMap_pop { | ||
| 84 | + | ||
| 85 | + box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important; | ||
| 86 | + | ||
| 87 | +} | ||
| 0 | \ No newline at end of file | 88 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/editroadspeed.html
0 → 100644
| 1 | +<!-- 编辑路段 --> | ||
| 2 | +<div class="modal fade" id="edit_roadspeed_mobal" role="basic" aria-hidden="true"> | ||
| 3 | + <div class="modal-dialog"> | ||
| 4 | + <div class="modal-content"> | ||
| 5 | + <div class="modal-header"> | ||
| 6 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | ||
| 7 | + <h4 class="modal-title">路段限速修改</h4> | ||
| 8 | + </div> | ||
| 9 | + <div class="modal-body"> | ||
| 10 | + <form class="form-horizontal" role="form" id="edit_roadspeed_form" action="/module" method="post"> | ||
| 11 | + <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> | ||
| 12 | + 您的输入有误,请检查下面的输入项 | ||
| 13 | + </div> | ||
| 14 | + <input type="hidden" name="bRoadVector" id="bRoadVectorInput" /> | ||
| 15 | + <input type="hidden" name="gRoadVector" id="gRoadVectorInput" /> | ||
| 16 | + <!-- 路段名称 --> | ||
| 17 | + <div class="form-body"> | ||
| 18 | + <div class="form-group"> | ||
| 19 | + <label class="control-label col-md-3"> | ||
| 20 | + <span class="required"> * </span> 路段限速Id: | ||
| 21 | + </label> | ||
| 22 | + <div class="col-md-6"> | ||
| 23 | + <input type="text" class="form-control" name="id" id="idInput" placeholder="路段名称" readonly="readonly"> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + </div> | ||
| 27 | + <!-- 路段名称 --> | ||
| 28 | + <div class="form-body"> | ||
| 29 | + <div class="form-group"> | ||
| 30 | + <label class="control-label col-md-3"> | ||
| 31 | + <span class="required"> * </span> 路段名称: | ||
| 32 | + </label> | ||
| 33 | + <div class="col-md-6"> | ||
| 34 | + <input type="text" class="form-control" name="name" id="nameInput" placeholder="路段名称"> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + <!-- 限速开始时间 --> | ||
| 39 | + <div class="form-body"> | ||
| 40 | + <div class="form-group"> | ||
| 41 | + <label class="control-label col-md-3"> | ||
| 42 | + <span class="required"> * </span> 限速开始时间: | ||
| 43 | + </label> | ||
| 44 | + <div class="col-md-6"> | ||
| 45 | + <input type="text" class="form-control" name="speedStartDate" id="speedStartDateInput" placeholder="限速开始时间"> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + <!-- 限速结束时间 --> | ||
| 50 | + <div class="form-body"> | ||
| 51 | + <div class="form-group"> | ||
| 52 | + <label class="control-label col-md-3"> | ||
| 53 | + <span class="required"> * </span> 限速结束时间: | ||
| 54 | + </label> | ||
| 55 | + <div class="col-md-6"> | ||
| 56 | + <input type="text" class="form-control" name="speedEndDate" id="speedEndDateInput" placeholder="限速结束时间"> | ||
| 57 | + </div> | ||
| 58 | + </div> | ||
| 59 | + </div> | ||
| 60 | + <!-- 是否撤销 --> | ||
| 61 | + <div class="form-body"> | ||
| 62 | + <div class="form-group"> | ||
| 63 | + <label class="col-md-3 control-label"> <span class="required"> * </span> 是否启用:</label> | ||
| 64 | + <div class="col-md-6"> | ||
| 65 | + <select name="isStart" class="form-control" id="isStartSelect"> | ||
| 66 | + <option value="">-- 请选择启用类型 --</option> | ||
| 67 | + <option value="0">启用</option> | ||
| 68 | + <option value="1">未启用</option> | ||
| 69 | + </select> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + </div> | ||
| 73 | + <!-- 限速 --> | ||
| 74 | + <div class="form-body"> | ||
| 75 | + <div class="form-group"> | ||
| 76 | + <label class="control-label col-md-3"> <span class="required"> * </span> 路段限速:</label> | ||
| 77 | + <div class="col-md-6"> | ||
| 78 | + <input type="text" class="form-control" name="speed" id="speedInput" > | ||
| 79 | + <span class="help-block">单位:千米/时(km/h)</span> | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + </form> | ||
| 84 | + </div> | ||
| 85 | + <div class="modal-footer"> | ||
| 86 | + <button type="button" class="btn default" data-dismiss="modal">取消</button> | ||
| 87 | + <button type="button" class="btn btn-primary" id="editRoadspeedButton">提交数据</button> | ||
| 88 | + </div> | ||
| 89 | + </div> | ||
| 90 | + </div> | ||
| 91 | +</div> | ||
| 92 | +<script type="text/javascript"> | ||
| 93 | +$('#edit_roadspeed_mobal').on('editRoadspeedMobal_show', function(e, map_,ajaxd,roadspeed,fun){ | ||
| 94 | + // 获取路段信息. | ||
| 95 | + var Roadspeed = roadspeed.getEitdRoadspeed(); | ||
| 96 | + // 限速路段id | ||
| 97 | + var id = Roadspeed.id; | ||
| 98 | + // 设值表单字段值. | ||
| 99 | + fun.setRoadspeedFormValue(Roadspeed); | ||
| 100 | + | ||
| 101 | + // 显示mobal | ||
| 102 | + $('#edit_roadspeed_mobal').modal({show : true,backdrop: 'static',keyboard: false}); | ||
| 103 | + // 当调用 hide 实例方法时触发 | ||
| 104 | + $('#edit_roadspeed_mobal').on('hide.bs.modal', function () { | ||
| 105 | + closeMobleSetClean(); | ||
| 106 | + }); | ||
| 107 | + function closeMobleSetClean() { | ||
| 108 | + // 清除地图覆盖物 | ||
| 109 | + map_.clearMarkAndOverlays(); | ||
| 110 | + /** 设置修改路段集合对象为空 */ | ||
| 111 | + roadspeed.setEitdRoadspeed({}); | ||
| 112 | + $('.dropdown-toggle').removeClass('disabled'); | ||
| 113 | + $('#eidt').removeClass('btn disabled'); | ||
| 114 | + $('#eidt').attr("disabled",false); | ||
| 115 | + /** 初始化路段信息 @return <id:路段路由ID> */ | ||
| 116 | + fun.initRoadspeedInfo(id); | ||
| 117 | + } | ||
| 118 | + // 编辑表单元素 | ||
| 119 | + var form = $('#edit_roadspeed_form'); | ||
| 120 | + // 获取错误提示元素 | ||
| 121 | + var error = $('.alert-danger', form); | ||
| 122 | + // 提交数据按钮事件 | ||
| 123 | + $('#editRoadspeedButton').on('click', function() { | ||
| 124 | + // 表单提交 | ||
| 125 | + form.submit(); | ||
| 126 | + }); | ||
| 127 | + // 表单验证 | ||
| 128 | + form.validate({ | ||
| 129 | + errorElement : 'span', | ||
| 130 | + errorClass : 'help-block help-block-error', | ||
| 131 | + focusInvalid : false, | ||
| 132 | + rules : { | ||
| 133 | + 'id' : {required : true,maxlength: 50},// id 必填项. | ||
| 134 | + 'name' : {required : true,maxlength: 50},// 路段名称 必填项. | ||
| 135 | + 'speedStartDate' : {required : true},// 限速开始时间 必填项. | ||
| 136 | + 'speedEndDate' : {required : true},// 限速结束时间 必填项. | ||
| 137 | + 'isStart' : {required : true},// 是否启用 必填项. | ||
| 138 | + 'speed' : {required : true,number : true},// 必填项 路段限速 必须输入合法的数字(负数,小数)。 | ||
| 139 | + }, | ||
| 140 | + invalidHandler : function(event, validator) { | ||
| 141 | + error.show(); | ||
| 142 | + App.scrollTo(error, -200); | ||
| 143 | + }, | ||
| 144 | + highlight : function(element) { | ||
| 145 | + $(element).closest('.form-group').addClass('has-error'); | ||
| 146 | + }, | ||
| 147 | + | ||
| 148 | + unhighlight : function(element) { | ||
| 149 | + $(element).closest('.form-group').removeClass('has-error'); | ||
| 150 | + | ||
| 151 | + }, | ||
| 152 | + success : function(label) { | ||
| 153 | + label.closest('.form-group').removeClass('has-error'); | ||
| 154 | + | ||
| 155 | + }, | ||
| 156 | + submitHandler : function(f) { | ||
| 157 | + var params = form.serializeJSON(); | ||
| 158 | + params.bRoadVector = EditRoadspeedObj.getEitdRoadspeed().bRoadVector; | ||
| 159 | + error.hide(); | ||
| 160 | + ajaxd.roadspeedUpdate(params,function(resuntDate) { | ||
| 161 | + if(resuntDate.status=='SUCCESS') { | ||
| 162 | + // 弹出添加成功提示消息 | ||
| 163 | + layer.msg('修改成功...'); | ||
| 164 | + }else { | ||
| 165 | + // 弹出添加失败提示消息 | ||
| 166 | + layer.msg('修改失败...'); | ||
| 167 | + | ||
| 168 | + } | ||
| 169 | + $('#edit_roadspeed_mobal').modal('hide'); | ||
| 170 | + closeMobleSetClean(); | ||
| 171 | + }); | ||
| 172 | + } | ||
| 173 | + }); | ||
| 174 | +}); | ||
| 175 | +</script> | ||
| 0 | \ No newline at end of file | 176 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/js/add-form-reload.js
0 → 100644
| 1 | +(function(){ | ||
| 2 | + // 关闭左侧栏 | ||
| 3 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | ||
| 4 | + // 延迟500毫秒执行. | ||
| 5 | + setTimeout(function(){ | ||
| 6 | + FormWizard.init();// 表单向导初始化. | ||
| 7 | + $('#isStartSelect').val('0');// 设值是否启用. | ||
| 8 | + | ||
| 9 | + $('.tipso-animation').tipso({ | ||
| 10 | + speed : 100, | ||
| 11 | + background : '#0ed0e8', | ||
| 12 | + color : '#ffffff', | ||
| 13 | + position :'right', | ||
| 14 | + width : 410, | ||
| 15 | + delay : 400, | ||
| 16 | + animationIn : 'bounceIn', | ||
| 17 | + animationOut : 'bounceOut', | ||
| 18 | + offsetX : 12, | ||
| 19 | + offsetY : -70, | ||
| 20 | + content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">a)系统生成:根据路段的起、终点站名称自动生成一条折线走向。</span></br>'+ | ||
| 21 | + '<span style="display:block; float:left;font-size:x-small;">b)手动添加:打开绘画工具,手动在地图上画出路段,然后双击鼠标右键结束当前绘制。</span>', | ||
| 22 | + | ||
| 23 | + }); | ||
| 24 | + $('.tipso-animation').tipso('show'); | ||
| 25 | + setTimeout(function(){$('.tipso-animation').tipso('hide');},4000); | ||
| 26 | + }, 500); | ||
| 27 | + /** 限速开始时间 日期控件 <format:日期控件时间格式;locale:语言> */ | ||
| 28 | + $('#speedStartDateInput').datetimepicker({format : 'HH:mm', locale: 'zh-cn'}); | ||
| 29 | + /** 限速结束时间 日期控件 <format:日期控件时间格式;locale:语言> */ | ||
| 30 | + $('#speedEndDateInput').datetimepicker({format : 'HH:mm', locale: 'zh-cn'}); | ||
| 31 | + | ||
| 32 | + // 监听提交事件. | ||
| 33 | + $('.button-submit').on('click',function() { | ||
| 34 | + $('#submit_roadspeed_form').submit();// 获取表单并提交. | ||
| 35 | + }); | ||
| 36 | + // 打开绘画工具 | ||
| 37 | + $('#openDrawingManager').on('click',function() { | ||
| 38 | + SectionVmapWorlds.drawingManagerOpen(); | ||
| 39 | + }); | ||
| 40 | + // 关闭绘画工具 | ||
| 41 | + $('#closeDrawingManager').on('click',function() { | ||
| 42 | + SectionVmapWorlds.drawingManagerClose(); | ||
| 43 | + }); | ||
| 44 | + | ||
| 45 | + | ||
| 46 | +})(); | ||
| 0 | \ No newline at end of file | 47 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/js/add-form-wizard.js
0 → 100644
| 1 | +/** | ||
| 2 | + * @description : (TODO) 表单的导航向导、验证、提交. | ||
| 3 | + * | ||
| 4 | + * @author bsth@lq. | ||
| 5 | + * | ||
| 6 | + * @version 1.0. | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | +var FormWizard = function() { | ||
| 10 | + return { | ||
| 11 | + // 启动初始化向导导航. | ||
| 12 | + init : function() { | ||
| 13 | + if(!jQuery().bootstrapWizard) {return;} | ||
| 14 | + var form = $('#submit_roadspeed_form');// 定义表单. | ||
| 15 | + var error = $('.alert-danger',form);// 定义表单异常. | ||
| 16 | + var success = $('.alert-success',form);// 定义表单成功. | ||
| 17 | + // 表单验证. | ||
| 18 | + form.validate({ | ||
| 19 | + errorElement : 'span',// 错误提示元素span对象. | ||
| 20 | + errorClass : 'help-block help-block-error', // 错误提示元素class名称. | ||
| 21 | + focusInvalid : true, // 验证错误获取焦点. | ||
| 22 | + // 需要验证的表单元素. | ||
| 23 | + rules : { | ||
| 24 | + 'stationStart' : {required : true,maxlength:50,},// 起点 必填项. | ||
| 25 | + 'stationEnd' : {required : true,maxlength:50,},// 终点 必填项. | ||
| 26 | + 'name' : {required : true,maxlength: 50},// 路段名称 必填项. | ||
| 27 | + 'speedStartDate' : {required : true},// 限速开始时间 必填项. | ||
| 28 | + 'speedEndDate' : {required : true},// 限速结束时间 必填项. | ||
| 29 | + 'isStart' : {required : true},// 是否启用 必填项. | ||
| 30 | + 'speed' : {required : true,number : true},// 必填项 路段限速 必须输入合法的数字(负数,小数)。 | ||
| 31 | + }, | ||
| 32 | + /** | ||
| 33 | + * 类型:Callback。当未通过验证的表单提交时,可以在该回调函数中处理一些事情。 | ||
| 34 | + * | ||
| 35 | + * 参数:该回调函数有两个参数:第一个为一个事件对象,第二个为验证器(validator). | ||
| 36 | + */ | ||
| 37 | + invalidHandler : function(event, validator) { | ||
| 38 | + error.show();// 显示表单未通过提示信息. | ||
| 39 | + App.scrollTo(error, -200);// 把提示信息放到指定的位置。 | ||
| 40 | + }, | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 类型:Callback。 | ||
| 44 | + * | ||
| 45 | + * 默认:添加errorClass("has-error")到表单元素。将未通过验证的表单元素设置高亮。 | ||
| 46 | + */ | ||
| 47 | + highlight : function(element) { | ||
| 48 | + $(element).closest('.form-group').addClass('has-error'); // 添加errorClass("has-error")到表单元素. | ||
| 49 | + }, | ||
| 50 | + | ||
| 51 | + /** | ||
| 52 | + * 类型:Callback。 | ||
| 53 | + * | ||
| 54 | + * 默认:移除errorClass("has-error")。与highlight操作相反. | ||
| 55 | + */ | ||
| 56 | + unhighlight : function(element) { | ||
| 57 | + $(element).closest('.form-group').removeClass('has-error');// 移除errorClass("has-error") . | ||
| 58 | + }, | ||
| 59 | + | ||
| 60 | + /** | ||
| 61 | + * 类型:String,Callback。 | ||
| 62 | + * | ||
| 63 | + * 如果指定它,当验证通过时显示一个消息。 | ||
| 64 | + * | ||
| 65 | + * 如果是String类型的,则添加该样式到标签中; | ||
| 66 | + * | ||
| 67 | + * 如果是一个回调函数,则将标签作为其唯一的参数。 | ||
| 68 | + */ | ||
| 69 | + success : function(label) { | ||
| 70 | + label.closest('.form-group').removeClass('has-error'); // 当验证通过时,移除errorClass("has-error"). | ||
| 71 | + }, | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * 类型:Callback。 | ||
| 75 | + * | ||
| 76 | + * 默认:default (native) form submit;当表单通过验证,提交表单。回调函数有个默认参数form. | ||
| 77 | + */ | ||
| 78 | + submitHandler : function(f) { | ||
| 79 | + var params = form.serializeJSON();// 表单序列化. | ||
| 80 | + if(params.roadVector=='') { | ||
| 81 | + layer.msg('路段几何图形为空~请先在路段位置步骤中绘制出线路走向!'); | ||
| 82 | + return; | ||
| 83 | + } | ||
| 84 | + // 新增路段限速保存. | ||
| 85 | + $post('/roadSpeed/save',params,function(data) { | ||
| 86 | + if(data.status=='SUCCESS') { | ||
| 87 | + layer.msg('添加成功...');// 弹出添加成功提示消息. | ||
| 88 | + }else { | ||
| 89 | + layer.msg('添加失败...');// 弹出添加失败提示消息. | ||
| 90 | + } | ||
| 91 | + loadPage('list.html');// 返回list.html页面. | ||
| 92 | + }); | ||
| 93 | + } | ||
| 94 | + }); | ||
| 95 | + | ||
| 96 | + // 确认提交信息. | ||
| 97 | + var displayConfirm = function() { | ||
| 98 | + // 遍历表单元素下的tab4的class名称为form-control-static. | ||
| 99 | + $('#tab4 .form-control-static', form).each(function(){ | ||
| 100 | + // 定义input | ||
| 101 | + var input = $('[name="'+$(this).attr("data-display")+'"]', form); | ||
| 102 | + if (input.is(":radio")) { | ||
| 103 | + input = $('[name="'+$(this).attr("data-display")+'"]:checked', form); | ||
| 104 | + } | ||
| 105 | + if (input.is(":text") || input.is("textarea")) { | ||
| 106 | + $(this).html(input.val()); | ||
| 107 | + } else if (input.is("select")) { | ||
| 108 | + $(this).html(input.find('option:selected').text()); | ||
| 109 | + } else if (input.is(":radio") && input.is(":checked")) { | ||
| 110 | + $(this).html(input.attr("data-title")); | ||
| 111 | + } else if ($(this).attr("data-display") == 'payment[]') { | ||
| 112 | + var payment = []; | ||
| 113 | + $('[name="payment[]"]:checked', form).each(function(){ | ||
| 114 | + payment.push($(this).attr('data-title')); | ||
| 115 | + }); | ||
| 116 | + $(this).html(payment.join("<br>")); | ||
| 117 | + } | ||
| 118 | + }); | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + /** 按钮点击时触发 */ | ||
| 122 | + var handleTitle = function(tab, navigation, index) { | ||
| 123 | + $('.tipso-animation').tipso('hide'); | ||
| 124 | + var total = navigation.find('li').length;// 定义导航条标签个数. | ||
| 125 | + var current = index + 1; // 当前标签页 | ||
| 126 | + $('.step-title', $('#form-wizard-info')).text((index + 1) + ' - ' + total);// 设置向导标题. | ||
| 127 | + jQuery('li', $('#form-wizard-info')).removeClass("done");// 删除"done"样式. | ||
| 128 | + var li_list = navigation.find('li');// 获取导航标签元素集合. | ||
| 129 | + // 遍历 | ||
| 130 | + for (var i = 0; i < index; i++) { | ||
| 131 | + jQuery(li_list[i]).addClass("done");// 追加done样式. | ||
| 132 | + } | ||
| 133 | + /** 如果为第一步隐藏返回按钮,否则显示返回按钮. */ | ||
| 134 | + if (current == 1) { | ||
| 135 | + $('#submit_roadspeed_form').find('.button-previous').hide();// 隐藏返回按钮. | ||
| 136 | + } else { | ||
| 137 | + $('#submit_roadspeed_form').find('.button-previous').show();// 显示返回按钮. | ||
| 138 | + } | ||
| 139 | + if (current == 2) { | ||
| 140 | + var container = $("#roadBmap_basic"); | ||
| 141 | + container.children().remove(); | ||
| 142 | + container.show(); | ||
| 143 | + setTimeout(function(){ | ||
| 144 | + SectionVmapWorlds.init(); | ||
| 145 | + var baseResValue = $('#submit_roadspeed_form input[name="baseRes"]:checked').val(); | ||
| 146 | + var stationStartValue = $('#stationStartInput').val(); | ||
| 147 | + var stationEndValue = $('#stationEndInput').val(); | ||
| 148 | + var paramsStationsArray = []; | ||
| 149 | + paramsStationsArray[0] = stationStartValue+'公交车站'; | ||
| 150 | + paramsStationsArray[1]= stationEndValue+'公交车站'; | ||
| 151 | + $('#nameInput').val(stationStartValue + '至' + stationEndValue ); | ||
| 152 | + if(baseResValue == 0) { | ||
| 153 | + $('.leftUtils').hide(); | ||
| 154 | + // 根据站点名称获取百度坐标. | ||
| 155 | + SectionVmapWorlds.stationsNameToPoints(paramsStationsArray,function(resultJson) { | ||
| 156 | + // 根据坐标点获取两点之间的时间与距离. | ||
| 157 | + SectionVmapWorlds.getDistanceAndDuration(resultJson,function(stationdataList) { | ||
| 158 | + SectionVmapWorlds.getSectionListPlonly(stationdataList,function(sectiondata) { | ||
| 159 | + $('#bRoadVectorInput').val(JSON.stringify(sectiondata)); | ||
| 160 | + }); | ||
| 161 | + }); | ||
| 162 | + }); | ||
| 163 | + }else if(baseResValue ==1) { | ||
| 164 | + SectionVmapWorlds.localSearchFromAdreesToPoint(stationStartValue+'公交车站'); | ||
| 165 | + SectionVmapWorlds.localSearchFromAdreesToPoint(stationEndValue+'公交车站'); | ||
| 166 | +// SectionVmapWorlds.drawingManagerOpen(); | ||
| 167 | + } | ||
| 168 | + $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); | ||
| 169 | + },300) | ||
| 170 | + } else if(current==3) { | ||
| 171 | + setTimeout(function(){ | ||
| 172 | + $('html,body').animate({scrollTop: ($('#tab3').offset().top-70) + "px"}); | ||
| 173 | + },500); | ||
| 174 | + }else if(current==4) { | ||
| 175 | + setTimeout(function(){ | ||
| 176 | + $('html,body').animate({scrollTop: ($('#tab4').offset().top+40) + "px"}); | ||
| 177 | + },500); | ||
| 178 | + } | ||
| 179 | + /** 如果为最后一步显示提交按钮,隐藏下一步按钮,否则隐藏提交按钮,显示下一步按钮 */ | ||
| 180 | + if (current >= total) { | ||
| 181 | + $('#submit_roadspeed_form').find('.button-next').hide();// 隐藏下一步按钮. | ||
| 182 | + $('#submit_roadspeed_form').find('.button-submit').show(); // 显示提交按钮. | ||
| 183 | + displayConfirm();// 确认提交信息. | ||
| 184 | + } else { | ||
| 185 | + $('#submit_roadspeed_form').find('.button-next').show();// 隐藏提交按钮. | ||
| 186 | + $('#submit_roadspeed_form').find('.button-submit').hide();// 隐藏提交按钮. | ||
| 187 | + } | ||
| 188 | + App.scrollTo($('.page-title'));// 移动到指定位置. | ||
| 189 | + } | ||
| 190 | + // 表单导航向导插件. | ||
| 191 | + $('#submit_roadspeed_form').bootstrapWizard({ | ||
| 192 | + 'nextSelector': '.button-next',// 下一步元素选择器. | ||
| 193 | + 'previousSelector': '.button-previous',// 返回元素选择器. | ||
| 194 | + /** 当一个导航标签被点击,返回错误的移动到该选项卡,并显示它的内容. */ | ||
| 195 | + onTabClick: function (tab, navigation, index, clickedIndex) { | ||
| 196 | + return false; | ||
| 197 | + success.hide(); | ||
| 198 | + error.hide(); | ||
| 199 | + if (form.valid() == false) { | ||
| 200 | + return false; | ||
| 201 | + } | ||
| 202 | + handleTitle(tab, navigation, clickedIndex); | ||
| 203 | + }, | ||
| 204 | + /** 下一步按钮被单击时触发, 返回移动到下一个步骤. */ | ||
| 205 | + onNext: function (tab, navigation, index) { | ||
| 206 | + success.hide(); | ||
| 207 | + error.hide(); | ||
| 208 | + if (form.valid() == false) { | ||
| 209 | + return false; | ||
| 210 | + } | ||
| 211 | + if(index==2) { | ||
| 212 | + SectionVmapWorlds.drawingManagerClose(); | ||
| 213 | + SectionVmapWorlds.clearMarkAndOverlays(); | ||
| 214 | + } | ||
| 215 | + handleTitle(tab, navigation, index); | ||
| 216 | + }, | ||
| 217 | + /** 上一步按钮被单击时触发,返回移动到前一个步骤 */ | ||
| 218 | + onPrevious: function (tab, navigation, index) { | ||
| 219 | + success.hide(); | ||
| 220 | + error.hide(); | ||
| 221 | + SectionVmapWorlds.clearMarkAndOverlays(); | ||
| 222 | + if(index==0) { | ||
| 223 | + SectionVmapWorlds.drawingManagerClose(); | ||
| 224 | + } | ||
| 225 | + handleTitle(tab, navigation, index); | ||
| 226 | + }, | ||
| 227 | + /** 显示选项卡内容 */ | ||
| 228 | + onTabShow: function (tab, navigation, index) { | ||
| 229 | + var total = navigation.find('li').length; | ||
| 230 | + var current = index + 1; | ||
| 231 | + var $percent = (current / total) * 100; | ||
| 232 | + $('#submit_roadspeed_form').find('.progress-bar').css({ | ||
| 233 | + width: $percent + '%', | ||
| 234 | + }); | ||
| 235 | + } | ||
| 236 | + }); | ||
| 237 | + $('#submit_roadspeed_form').find('.button-previous').hide();// 初始化第一步隐藏返回按钮 | ||
| 238 | + } | ||
| 239 | + }; | ||
| 240 | +}(); |
src/main/resources/static/pages/base/roadspeed/js/add-vmap-world.js
0 → 100644
| 1 | +var SectionVmapWorlds = function() { | ||
| 2 | + var mapB = '', drawingManager = ''; | ||
| 3 | + var Bmap = { | ||
| 4 | + init : function() { | ||
| 5 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425};// 设置中心点. | ||
| 6 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';// 百度API Key | ||
| 7 | + mapB = new BMap.Map("roadBmap_basic");// 初始化百度地图 | ||
| 8 | + mapB.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15);//中心点和缩放级别 | ||
| 9 | + mapB.enableDragging(); //启用地图拖拽事件,默认启用(可不写) | ||
| 10 | + mapB.enableScrollWheelZoom(); //启用地图滚轮放大缩小 | ||
| 11 | + mapB.disableDoubleClickZoom();//禁用鼠标双击放大 | ||
| 12 | + mapB.enableKeyboard();//启用键盘上下左右键移动地图 | ||
| 13 | + var styleOptions = { | ||
| 14 | + strokeColor : "blue",//边线颜色。 | ||
| 15 | + fillColor : "blue",//填充颜色。当参数为空时,圆形将没有填充效果。 | ||
| 16 | + strokeWeight : 3,//边线的宽度,以像素为单位。 | ||
| 17 | + strokeOpacity : 0.8,//边线的宽度,以像素为单位。 | ||
| 18 | + fillOpacity : 0.6,//填充的透明度,取值范围0 - 1。 | ||
| 19 | + strokeStyle : 'solid' //边线的样式,solid或dashed。 | ||
| 20 | + }; | ||
| 21 | + // 创建鼠标绘制管理类 | ||
| 22 | + drawingManager = new BMapLib.DrawingManager(mapB, { | ||
| 23 | + isOpen : false,//是否开启绘制模式 | ||
| 24 | + enableDrawingTool : false,//是否显示工具栏 | ||
| 25 | + drawingToolOptions : { | ||
| 26 | + anchor : BMAP_ANCHOR_TOP_RIGHT,//位置 | ||
| 27 | + offset : new BMap.Size(5, 5),//偏离值 | ||
| 28 | + scale : 0.8//工具栏缩放比例 | ||
| 29 | + | ||
| 30 | + }, | ||
| 31 | + polylineOptions : styleOptions//线的样式 | ||
| 32 | + }); | ||
| 33 | + // 添加绘画完成事件 | ||
| 34 | + drawingManager.addEventListener('polylinecomplete', function(e) { | ||
| 35 | + drawingManager.close(); | ||
| 36 | + var editPloyLineArray = e.getPath();// 获取折线坐标集合 | ||
| 37 | + $('#bRoadVectorInput').val(JSON.stringify(editPloyLineArray)); | ||
| 38 | + }); | ||
| 39 | + return mapB; | ||
| 40 | + }, | ||
| 41 | + // 根据地理名称获取百度经纬度坐标进行定位. | ||
| 42 | + localSearchFromAdreesToPoint: function(Address) { | ||
| 43 | + // 创建一个搜索类实例 | ||
| 44 | + var localSearch = new BMap.LocalSearch(mapB); | ||
| 45 | + // 检索完成后的回调函数。 | ||
| 46 | + localSearch.setSearchCompleteCallback(function (searchResult) { | ||
| 47 | + var resultPoints = ''; | ||
| 48 | + if(searchResult) { | ||
| 49 | + // 返回索引指定的结果。索引0表示第1条结果 | ||
| 50 | + var poi = searchResult.getPoi(0); | ||
| 51 | + if(poi) { | ||
| 52 | + //获取经度和纬度 | ||
| 53 | + var stationNameChangePoint = new BMap.Point( poi.point.lng, poi.point.lat); | ||
| 54 | + marker = new BMap.Marker(stationNameChangePoint); | ||
| 55 | + var PanOptions ={noAnimation :true}; | ||
| 56 | + mapB.panTo(stationNameChangePoint,PanOptions); | ||
| 57 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | ||
| 58 | + mapB.setZoom(16); | ||
| 59 | + mapB.panBy(-300,-50); | ||
| 60 | + // 将标注添加到地图中 | ||
| 61 | + mapB.addOverlay(marker); | ||
| 62 | + //跳动的动画 | ||
| 63 | + marker.setAnimation(BMAP_ANIMATION_BOUNCE); | ||
| 64 | + }else { | ||
| 65 | + // 弹出添加成功提示消息 | ||
| 66 | + layer.msg('无法获取停车场【'+Address+'】地理位置!'); | ||
| 67 | + } | ||
| 68 | + }else { | ||
| 69 | + // 弹出添加成功提示消息 | ||
| 70 | + layer.msg('无法获取停车场【'+Address+'】地理位置!'); | ||
| 71 | + } | ||
| 72 | + }); | ||
| 73 | + // 根据检索词发起检索。 | ||
| 74 | + localSearch.search(Address); | ||
| 75 | + }, | ||
| 76 | + // 根据名称获取坐标. | ||
| 77 | + stationsNameToPoints : function(arra,callback) { | ||
| 78 | + // 获取长度 | ||
| 79 | + var len = arra.length; | ||
| 80 | + var stationList = []; | ||
| 81 | + (function(){ | ||
| 82 | + if (!arguments.callee.count) { | ||
| 83 | + arguments.callee.count = 0; | ||
| 84 | + } | ||
| 85 | + arguments.callee.count++; | ||
| 86 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 87 | + if (index >= len) { | ||
| 88 | + callback && callback(stationList); | ||
| 89 | + return; | ||
| 90 | + } | ||
| 91 | + var f = arguments.callee; | ||
| 92 | + if(arra[index]!=''){ | ||
| 93 | + var localSearch = new BMap.LocalSearch(mapB); | ||
| 94 | + localSearch.search(arra[index]); | ||
| 95 | + localSearch.setSearchCompleteCallback(function (searchResult) { | ||
| 96 | + var poi = searchResult.getPoi(0); | ||
| 97 | + if(poi) { | ||
| 98 | + stationList.push({name:arra[index],potion:{lng:poi.point.lng,lat:poi.point.lat}}); | ||
| 99 | + f(); | ||
| 100 | + } | ||
| 101 | + }); | ||
| 102 | + }else { | ||
| 103 | + f(); | ||
| 104 | + } | ||
| 105 | + })(); | ||
| 106 | + }, | ||
| 107 | + /** 获取距离与时间 @param <points:坐标点集合> */ | ||
| 108 | + getDistanceAndDuration : function(points,callback){ | ||
| 109 | + // 获取长度 | ||
| 110 | + var len = points.length; | ||
| 111 | + (function(){ | ||
| 112 | + if (!arguments.callee.count) { | ||
| 113 | + arguments.callee.count = 0; | ||
| 114 | + } | ||
| 115 | + arguments.callee.count++; | ||
| 116 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 117 | + if (index >= len-1) { | ||
| 118 | + callback && callback(points); | ||
| 119 | + return; | ||
| 120 | + } | ||
| 121 | + // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。) | ||
| 122 | + var f = arguments.callee; | ||
| 123 | + // 起点坐标 <坐标格式:40.056878,116.30815> | ||
| 124 | + var origin = points[index].potion.lat + ',' + points[index].potion.lng; | ||
| 125 | + // 终点坐标 <坐标格式:40.056878,116.30815> | ||
| 126 | + var destination = points[index+1].potion.lat + ',' + points[index+1].potion.lng; | ||
| 127 | + var region = '上海'; | ||
| 128 | + var origin_region = '上海'; | ||
| 129 | + var destination_region = '上海'; | ||
| 130 | + var output = 'json'; | ||
| 131 | + var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk'; | ||
| 132 | + /** | ||
| 133 | + * @param :< origin:起点名称或经纬度;destination:终点名称或经纬度;origin_region:起始点所在城市,驾车导航时必填。 | ||
| 134 | + * | ||
| 135 | + * destination_region:终点所在城市,驾车导航时必填。output :表示输出类型,可设置为xml或json,默认为xml。> | ||
| 136 | + * | ||
| 137 | + * @returns :r <jsonp格式> | ||
| 138 | + **/ | ||
| 139 | + var paramsB = {origin:origin,destination:destination,region:region,origin_region:origin_region,destination_region:destination_region,output:output,ak:ak_My}; | ||
| 140 | + /** @description :未认证开发者默认配额为:2000次/天。 */ | ||
| 141 | + $.ajax({ | ||
| 142 | + // 百度地图根据坐标获取两点之间的时间与距离 | ||
| 143 | + url: 'http://api.map.baidu.com/direction/v1?mode=transit', | ||
| 144 | + data: paramsB, | ||
| 145 | + dataType: 'jsonp', | ||
| 146 | + success: function(r){ | ||
| 147 | + if(r) { | ||
| 148 | + if(r.message=='ok') { | ||
| 149 | + // 获取距离(单位:米) | ||
| 150 | + points[index+1].distance = r.result.taxi.distance; | ||
| 151 | + // 获取时间(单位:秒) | ||
| 152 | + points[index+1].duration = r.result.taxi.duration; | ||
| 153 | + } | ||
| 154 | + } | ||
| 155 | + f(); | ||
| 156 | + } | ||
| 157 | + }); | ||
| 158 | + })(); | ||
| 159 | + }, | ||
| 160 | + // 获取路段几何图形坐标集合. | ||
| 161 | + getSectionListPlonly : function(stationsPoint,cb) { | ||
| 162 | + var len = stationsPoint.length; | ||
| 163 | + var sectionList = []; | ||
| 164 | + (function(){ | ||
| 165 | + if (!arguments.callee.count) { | ||
| 166 | + arguments.callee.count = 0; | ||
| 167 | + } | ||
| 168 | + arguments.callee.count++; | ||
| 169 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 170 | + if (index >= len-1 ) { | ||
| 171 | + cb && cb(sectionList); | ||
| 172 | + return; | ||
| 173 | + } | ||
| 174 | + var f = arguments.callee; | ||
| 175 | + var poiOne = new BMap.Point(stationsPoint[index].potion.lng,stationsPoint[index].potion.lat); | ||
| 176 | + var poiTwo = new BMap.Point(stationsPoint[index+1].potion.lng,stationsPoint[index+1].potion.lat); | ||
| 177 | + var transit = new BMap.DrivingRoute(mapB, {renderOptions: {map: mapB},onPolylinesSet: searchPolylinesSet}); | ||
| 178 | + function searchPolylinesSet(results){ | ||
| 179 | + if (transit.getStatus() != BMAP_STATUS_SUCCESS){ | ||
| 180 | + }else { | ||
| 181 | + var sectionArrayList = []; | ||
| 182 | + for (i = 0; i < results.length; i++){ | ||
| 183 | + sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath()); | ||
| 184 | + } | ||
| 185 | + sectionList = sectionArrayList; | ||
| 186 | + } | ||
| 187 | + f(); | ||
| 188 | + } | ||
| 189 | + transit.search(poiOne,poiTwo); | ||
| 190 | + })(); | ||
| 191 | + }, | ||
| 192 | + // 清楚地图覆盖物 | ||
| 193 | + clearMarkAndOverlays : function() { | ||
| 194 | + mapB.clearOverlays(); | ||
| 195 | + }, | ||
| 196 | + // 关闭绘画工具. | ||
| 197 | + drawingManagerClose : function() { | ||
| 198 | + drawingManager.close(); | ||
| 199 | + }, | ||
| 200 | + // 打开绘画工具. | ||
| 201 | + drawingManagerOpen : function() { | ||
| 202 | + drawingManager.open();// 打开鼠标绘画工具. | ||
| 203 | + drawingManager.setDrawingMode(BMAP_DRAWING_POLYLINE);// 设置属性. | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + return Bmap; | ||
| 208 | + | ||
| 209 | +}(); | ||
| 0 | \ No newline at end of file | 210 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/js/positionroadspeed.js
0 → 100644
| 1 | +var EditRoadspeedObj = function () { | ||
| 2 | + /** 定义修改路段对象 */ | ||
| 3 | + var roadspeed={}; | ||
| 4 | + var roadspeedObj = { | ||
| 5 | + /** 获取修改路段集合对象 @return:<roadspeed:修改路段对象> */ | ||
| 6 | + getEitdRoadspeed : function() { | ||
| 7 | + return roadspeed; | ||
| 8 | + }, | ||
| 9 | + /** 设置修改路段集合对象为空 */ | ||
| 10 | + setEitdRoadspeed : function(sc) { | ||
| 11 | + roadspeed = sc; | ||
| 12 | + }, | ||
| 13 | + /** 设置修改路段集合对象折线百度坐标集合属性值 @param:<broadspeedVector:折线百度坐标集合) */ | ||
| 14 | + setEitdBroadspeedVector : function(bRoadVector) { | ||
| 15 | + roadspeed.bRoadVector = bRoadVector; | ||
| 16 | + } | ||
| 17 | + } | ||
| 18 | + return roadspeedObj; | ||
| 19 | +}(); |
src/main/resources/static/pages/base/roadspeed/js/roadspeed-ajax-getdata.js
0 → 100644
| 1 | +/** | ||
| 2 | + * @description : (TODO) GetAjaxData :封装ajax异步请求方法 | ||
| 3 | + * | ||
| 4 | + * @author bsth@lq | ||
| 5 | + * | ||
| 6 | + * @version 1.0 | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | +var GetAjaxData = function(){ | ||
| 10 | + var ajaxData = { | ||
| 11 | + // 根据ID查询路段信息. | ||
| 12 | + getRoadspeedRouteInfoById : function(roadspeedId,callback){ | ||
| 13 | + $get('/roadSpeed/findById',{id:roadspeedId},function(r) { | ||
| 14 | + return callback && callback(r); | ||
| 15 | + }); | ||
| 16 | + }, | ||
| 17 | + | ||
| 18 | + // 编辑线路走向保存 | ||
| 19 | + roadspeedUpdate:function(roadspeed,callback) { | ||
| 20 | + | ||
| 21 | + $post('/roadSpeed/update',roadspeed,function(data) { | ||
| 22 | + | ||
| 23 | + callback && callback(data); | ||
| 24 | + | ||
| 25 | + }) | ||
| 26 | + | ||
| 27 | + } | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + return ajaxData; | ||
| 31 | + | ||
| 32 | +}(); | ||
| 0 | \ No newline at end of file | 33 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/js/roadspeed-list-table.js
0 → 100644
| 1 | +(function(){ | ||
| 2 | + | ||
| 3 | + // 关闭左侧栏 | ||
| 4 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | ||
| 5 | + // page : 当前页、initPag : | ||
| 6 | + var page = 0,initPag; | ||
| 7 | + | ||
| 8 | + function stratDmToName(value){ | ||
| 9 | + var rsStr = ''; | ||
| 10 | + if(value==0) | ||
| 11 | + rsStr = '启用'; | ||
| 12 | + else if(value==1) | ||
| 13 | + rsStr = '未启用'; | ||
| 14 | + return rsStr; | ||
| 15 | + } | ||
| 16 | + // 填充线路拉框选择值 | ||
| 17 | + $.get('/roadSpeed/all', function(array){ | ||
| 18 | + var len_ = array.length,paramsD = new Array(); | ||
| 19 | + if(len_>0) { | ||
| 20 | + $.each(array, function(i, g){ | ||
| 21 | + if(g.name!='' || g.name != null) { | ||
| 22 | + paramsD.push({'id':g.name ,'text':g.name }); | ||
| 23 | + } | ||
| 24 | + }); | ||
| 25 | +// if($('span').hasClass('select2-selection')) | ||
| 26 | +// $('span .select2-selection').remove(); | ||
| 27 | + initPinYinSelect2($('#nameSelect'),paramsD,function(selector) { | ||
| 28 | + selector.select2("val", ""); | ||
| 29 | + }); | ||
| 30 | + } | ||
| 31 | + }); | ||
| 32 | + initSearch(); | ||
| 33 | + /** | ||
| 34 | + * @description : (TODO) 监听重置按钮事件. | ||
| 35 | + * | ||
| 36 | + */ | ||
| 37 | + $('tr.filter .filter-cancel').on('click',function(){ | ||
| 38 | + // 清空搜索框值 | ||
| 39 | + $('tr.filter input,select').val('').change(); | ||
| 40 | + $('.tipso-animation').tipso('hide'); | ||
| 41 | + // 重新加载表格数据 | ||
| 42 | + loadTableDate(null,true); | ||
| 43 | + }); | ||
| 44 | + /** | ||
| 45 | + * @description : (TODO) 搜索按钮事件 | ||
| 46 | + * | ||
| 47 | + */ | ||
| 48 | + $('tr.filter .filter-submit').on('click',function(){ | ||
| 49 | + initSearch(); | ||
| 50 | + }); | ||
| 51 | + function initSearch() { | ||
| 52 | + var params = getParams(); | ||
| 53 | + page = 0; | ||
| 54 | + loadTableDate(params,true); | ||
| 55 | + } | ||
| 56 | + function getParams() { | ||
| 57 | + // cells 集合返回表格中所有(列)单元格的一个数组 | ||
| 58 | + var cells = $('tr.filter')[0].cells; | ||
| 59 | + // 搜索参数集合 | ||
| 60 | + var params = {}; | ||
| 61 | + // 搜索字段名称 | ||
| 62 | + var name; | ||
| 63 | + // 遍历cells数组 | ||
| 64 | + $.each(cells, function(i, cell){ | ||
| 65 | + // 获取第i列的input或者select集合 | ||
| 66 | + var items = $('input,select', cell); | ||
| 67 | + // 遍历items集合 | ||
| 68 | + for(var j = 0, item; item = items[j++];){ | ||
| 69 | + // 获取字段名称 | ||
| 70 | + name = $(item).attr('name'); | ||
| 71 | + if(name){ | ||
| 72 | + // 赋取相对应的值 | ||
| 73 | + params[name] = $(item).val(); | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + }); | ||
| 77 | + return params; | ||
| 78 | + } | ||
| 79 | + /** | ||
| 80 | + * @description : (TODO) 表格数据分页加载事件 | ||
| 81 | + * | ||
| 82 | + * ------@param : 查询参数 | ||
| 83 | + * | ||
| 84 | + * ------@isPon : 是否重新分页 | ||
| 85 | + * | ||
| 86 | + */ | ||
| 87 | + function loadTableDate(param,isPon){ | ||
| 88 | + // 搜索参数 | ||
| 89 | + var params = {}; | ||
| 90 | + if(param) | ||
| 91 | + params = param; | ||
| 92 | + // 排序(按方向与序号) | ||
| 93 | + params['order'] = 'id,speedStartDate'; | ||
| 94 | + // 排序方向. | ||
| 95 | + params['direction'] = 'DESC,ASC'; | ||
| 96 | + // 记录当前页数 | ||
| 97 | + params['page'] = page; | ||
| 98 | + // 弹出正在加载层 | ||
| 99 | + var i = layer.load(2); | ||
| 100 | + // 异步请求获取表格数据 | ||
| 101 | + $.get('/roadSpeed',params,function(result){ | ||
| 102 | + // 添加序号 | ||
| 103 | + result.content.page = page; | ||
| 104 | + // 把数据填充到模版中 | ||
| 105 | + var tbodyHtml = template('roadSpeed_list_table_temp',{list:result.content}); | ||
| 106 | + // 把渲染好的模版html文本追加到表格中 | ||
| 107 | + $('#datatable_roadSpeed tbody').html(tbodyHtml); | ||
| 108 | + // 是重新分页且返回数据长度大于0 | ||
| 109 | + if(isPon && result.content.length > 0){ | ||
| 110 | + // 重新分页 | ||
| 111 | + initPag = true; | ||
| 112 | + // 分页栏 | ||
| 113 | + showPagination(result); | ||
| 114 | + } | ||
| 115 | + // 关闭弹出加载层 | ||
| 116 | + layer.close(i); | ||
| 117 | + }); | ||
| 118 | + } | ||
| 119 | + /** | ||
| 120 | + * @description : (TODO) 分页栏组件 | ||
| 121 | + * | ||
| 122 | + */ | ||
| 123 | + function showPagination(data){ | ||
| 124 | + // 分页组件 | ||
| 125 | + $('#pagination').jqPaginator({ | ||
| 126 | + // 总页数 | ||
| 127 | + totalPages: data.totalPages, | ||
| 128 | + // 中间显示页数 | ||
| 129 | + visiblePages: 6, | ||
| 130 | + // 当前页 | ||
| 131 | + currentPage: page + 1, | ||
| 132 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | ||
| 133 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | ||
| 134 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | ||
| 135 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | ||
| 136 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | ||
| 137 | + onPageChange: function (num, type) { | ||
| 138 | + if(initPag){ | ||
| 139 | + initPag = false; | ||
| 140 | + return; | ||
| 141 | + } | ||
| 142 | + var pData = getParams(); | ||
| 143 | + page = num - 1; | ||
| 144 | + loadTableDate(pData, false); | ||
| 145 | + } | ||
| 146 | + }); | ||
| 147 | + } | ||
| 148 | +})(); | ||
| 0 | \ No newline at end of file | 149 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/js/roadspeed-positions-events.js
0 → 100644
| 1 | +$(function(){ | ||
| 2 | + // 监听返回按钮事件. | ||
| 3 | + $('#backUp').on('click',function() { | ||
| 4 | + // 返回list.html页面 | ||
| 5 | + loadPage('/pages/base/roadspeed/list.html'); | ||
| 6 | + }); | ||
| 7 | + | ||
| 8 | + // 监听编辑线路走向. | ||
| 9 | + $('.dropdown-menu #eidt').on('click', function(){ | ||
| 10 | + $('#eidt').attr("disabled",true); | ||
| 11 | + $('#eidt').addClass('btn disabled'); | ||
| 12 | + // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | ||
| 13 | + var yindex = layer.msg('编辑完线路走向后,请双击线路走向区域保存',{ offset: '126px',shift: 0,time: 10000}); | ||
| 14 | + RoadspeedPWorldsBMap.editPolyUpline(); | ||
| 15 | + }); | ||
| 16 | +}); | ||
| 0 | \ No newline at end of file | 17 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/js/roadspeed-positions-function.js
0 → 100644
| 1 | +var PositionsPublicFunctions = function () { | ||
| 2 | + var PubFun = { | ||
| 3 | + // 初始化路段信息与线路走向. | ||
| 4 | + initRoadspeedInfo : function(roadspeedId) { | ||
| 5 | + GetAjaxData.getRoadspeedRouteInfoById(roadspeedId,function(roadspeedInfo) { | ||
| 6 | + if(roadspeedInfo != null && roadspeedInfo != "") { | ||
| 7 | + EditRoadspeedObj.setEitdRoadspeed(roadspeedInfo); | ||
| 8 | + RoadspeedPWorldsBMap.drawingUpline(roadspeedInfo); | ||
| 9 | + } | ||
| 10 | + }); | ||
| 11 | + }, | ||
| 12 | + // 设值表单字段值. | ||
| 13 | + setRoadspeedFormValue : function(roadspeed) { | ||
| 14 | + $('#idInput').val(roadspeed.id);// 路段ID | ||
| 15 | + $('#nameInput').val(roadspeed.name);// 名字 | ||
| 16 | + $('#speedStartDateInput').val(roadspeed.speedStartDate);// 限速开始时间 | ||
| 17 | + $('#speedEndDateInput').val(roadspeed.speedEndDate);// 限速结束时间 | ||
| 18 | + $('#isStartSelect').val(roadspeed.isStart);// 是否启用 | ||
| 19 | + $('#speedInput').val(roadspeed.speed);// 限速 | ||
| 20 | + } | ||
| 21 | + } | ||
| 22 | + return PubFun ; | ||
| 23 | +}(); | ||
| 0 | \ No newline at end of file | 24 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/js/roadspeed-positions-map.js
0 → 100644
| 1 | +/** | ||
| 2 | + * @description : (TODO) 百度地图 | ||
| 3 | + * | ||
| 4 | + * @author bsth@lq | ||
| 5 | + * | ||
| 6 | + * @version 1.0 | ||
| 7 | + * | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +var RoadspeedPWorldsBMap = function () { | ||
| 11 | + // 定义地图对象、地图覆盖物、线性几何图形. | ||
| 12 | + var mapValue = '',marker='', polyUpline=''; | ||
| 13 | + var Bmap = { | ||
| 14 | + // 初始化地图. | ||
| 15 | + init : function() { | ||
| 16 | + // 设置中心点 | ||
| 17 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | ||
| 18 | + // 百度API Key | ||
| 19 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | ||
| 20 | + // 初始化百度地图 | ||
| 21 | + mapValue = new BMap.Map('roadspeedPbmap_basic'); | ||
| 22 | + //中心点和缩放级别 | ||
| 23 | + mapValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | ||
| 24 | + //启用地图拖拽事件,默认启用(可不写) | ||
| 25 | + mapValue.enableDragging(); | ||
| 26 | + //启用地图滚轮放大缩小 | ||
| 27 | + mapValue.enableScrollWheelZoom(); | ||
| 28 | + //禁用鼠标双击放大 | ||
| 29 | + mapValue.disableDoubleClickZoom(); | ||
| 30 | + //启用键盘上下左右键移动地图 | ||
| 31 | + mapValue.enableKeyboard(); | ||
| 32 | + return mapValue; | ||
| 33 | + }, | ||
| 34 | + // 绘制线路走向线性几何图形. | ||
| 35 | + drawingUpline : function(r) { | ||
| 36 | + var bRoadVectorStr = r.bRoadVector; | ||
| 37 | + var tempStr = bRoadVectorStr.substring(11,bRoadVectorStr.length-1); | ||
| 38 | + var lineArray = tempStr.split(','); | ||
| 39 | + var polylineArray = []; | ||
| 40 | + var lineaLen = lineArray.length | ||
| 41 | + for(var i = 0;i<lineaLen;i++) { | ||
| 42 | + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | ||
| 43 | + } | ||
| 44 | + var centerI = Math.ceil(lineaLen/2); | ||
| 45 | + // 中心坐标点 | ||
| 46 | + var point = new BMap.Point(lineArray[centerI].split(' ')[0],lineArray[centerI].split(' ')[1]); | ||
| 47 | + // 创建线路走向 | ||
| 48 | + polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "#5298ff",strokeWeight : 6,strokeOpacity :1,strokeStyle:'solid'}); | ||
| 49 | + // 把折线添加到地图上 | ||
| 50 | + mapValue.addOverlay(polyUpline); | ||
| 51 | + // 信息窗口参数属性 | ||
| 52 | + var opts = { | ||
| 53 | + // 信息窗口宽度 | ||
| 54 | + width : 200, | ||
| 55 | + // 信息窗口高度 | ||
| 56 | + height : 300, | ||
| 57 | + // 信息窗位置偏移值。 | ||
| 58 | + offset: new BMap.Size(500,-80), | ||
| 59 | + //标题 | ||
| 60 | + title : '<h4 style="color:#FFFFFF">'+r.name+'详情</h4>', | ||
| 61 | + //设置不允许信窗发送短息 | ||
| 62 | + enableMessage : false, | ||
| 63 | + //是否开启点击地图关闭信息窗口 | ||
| 64 | + enableCloseOnClick : false, | ||
| 65 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | ||
| 66 | + enableAutoPan:true | ||
| 67 | + }; | ||
| 68 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | ||
| 69 | + '<span style="color:#DDD;font-size: 15px;">路段名称:' + r.name + '</span>' + | ||
| 70 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">限速开始时间:' + r.speedStartDate + '</span>' + | ||
| 71 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">限速结束时间:' + r.speedEndDate + '</span>' + | ||
| 72 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">限 速:' + r.speed + '</span>'; | ||
| 73 | + // 创建信息窗口 | ||
| 74 | + var infoWindow_target = new BMap.InfoWindow(htm, opts); | ||
| 75 | + // 自定义标注物图片 | ||
| 76 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/blank.gif',new BMap.Size(20, 20)); | ||
| 77 | + // 创建点 | ||
| 78 | + marker = new BMap.Marker(point,{icon : icon_target}); | ||
| 79 | + // 把标注添物加到地图上 | ||
| 80 | + mapValue.addOverlay(marker); | ||
| 81 | + //开启信息窗口 | ||
| 82 | + marker.openInfoWindow(infoWindow_target,point); | ||
| 83 | + var PanOptions_ ={noAnimation :true}; | ||
| 84 | + mapValue.reset(); | ||
| 85 | + mapValue.panTo(point,PanOptions_); | ||
| 86 | + mapValue.panBy(0,-110,PanOptions_); | ||
| 87 | + mapValue.setZoom(14); | ||
| 88 | + }, | ||
| 89 | + // 编辑线路走向几何线性图形. | ||
| 90 | + editPolyUpline : function() { | ||
| 91 | + // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | ||
| 92 | + polyUpline.disableMassClear(); | ||
| 93 | + RoadspeedPWorldsBMap.clearMarkAndOverlays(); | ||
| 94 | + // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | ||
| 95 | + polyUpline.enableMassClear(); | ||
| 96 | + // 开启线路编辑 | ||
| 97 | + polyUpline.enableEditing(); | ||
| 98 | + // 添加双击折线保存事件 | ||
| 99 | + polyUpline.addEventListener('dblclick',function(e) { | ||
| 100 | + // 关闭 | ||
| 101 | + layer.closeAll(); | ||
| 102 | + polyUpline.disableEditing(); | ||
| 103 | + // 获取折线坐标集合 | ||
| 104 | + var editPloyLineArray = polyUpline.getPath(); | ||
| 105 | + EditRoadspeedObj.setEitdBroadspeedVector(JSON.stringify(editPloyLineArray)); | ||
| 106 | + polyUpline= ''; | ||
| 107 | + // 加载修改路段弹出层mobal页面 | ||
| 108 | + $.get('editroadspeed.html', function(m){ | ||
| 109 | + $(pjaxContainer).append(m); | ||
| 110 | + $('#edit_roadspeed_mobal').trigger('editRoadspeedMobal_show', [RoadspeedPWorldsBMap,GetAjaxData,EditRoadspeedObj,PositionsPublicFunctions]); | ||
| 111 | + }); | ||
| 112 | + }); | ||
| 113 | + }, | ||
| 114 | + // 清楚地图覆盖物 | ||
| 115 | + clearMarkAndOverlays : function() { | ||
| 116 | + mapValue.clearOverlays(); | ||
| 117 | + mapValue.removeOverlay(); | ||
| 118 | + } | ||
| 119 | + } | ||
| 120 | + return Bmap; | ||
| 121 | +}(); | ||
| 0 | \ No newline at end of file | 122 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/js/roadspeed-positions-reload.js
0 → 100644
| 1 | +(function(){ | ||
| 2 | + // 获取参数线路ID. | ||
| 3 | + var id = $.url().param('no'); | ||
| 4 | + // 关闭左侧栏. | ||
| 5 | + if (!$('body').hasClass('page-sidebar-closed')) {$('.menu-toggler.sidebar-toggler').click();} | ||
| 6 | + // 等候300毫秒执行. | ||
| 7 | + setTimeout(function(){ | ||
| 8 | + /** 初始化地图 @return <mapB:地图对象> */ | ||
| 9 | + var mapB = RoadspeedPWorldsBMap.init(); | ||
| 10 | + /** 初始化路段信息 @return <id:路段路由ID> */ | ||
| 11 | + PositionsPublicFunctions.initRoadspeedInfo(id); | ||
| 12 | + },300); | ||
| 13 | +})(); | ||
| 0 | \ No newline at end of file | 14 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/list.html
0 → 100644
| 1 | +<link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css " rel="stylesheet" type="text/css" /> | ||
| 2 | +<div class="page-head"> | ||
| 3 | + <div class="page-title"> | ||
| 4 | + <h1>路段限速信息</h1> | ||
| 5 | + </div> | ||
| 6 | +</div> | ||
| 7 | + | ||
| 8 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 9 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 10 | + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li> | ||
| 11 | + <li><span class="active">路段限速信息</span></li> | ||
| 12 | +</ul> | ||
| 13 | + | ||
| 14 | +<div class="row"> | ||
| 15 | + <div class="col-md-12"> | ||
| 16 | + <div class="portlet light porttlet-fit bordered"> | ||
| 17 | + <div class="portlet-title"> | ||
| 18 | + <div class="tipso-animation"> | ||
| 19 | + </div> | ||
| 20 | + <div class="caption"> | ||
| 21 | + <i class="fa fa-info-circle font-dark"></i> | ||
| 22 | + <span class="caption-subject font-dark sbold uppercase">路段限速信息</span> | ||
| 23 | + </div> | ||
| 24 | + <div class="actions"> | ||
| 25 | + <div class="btn-group btn-group-devided" data-toggle="buttons"> | ||
| 26 | + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加路段限速</a> | ||
| 27 | + </div> | ||
| 28 | + </div> | ||
| 29 | + </div> | ||
| 30 | + <div class="portlet-body"> | ||
| 31 | + <div class="table-container" style="margin-top: 10px"> | ||
| 32 | + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_roadSpeed"> | ||
| 33 | + <thead> | ||
| 34 | + <tr role="row" class="heading"> | ||
| 35 | + <th width="2%">#</th> | ||
| 36 | + <th width="4%">路段限速Id</th> | ||
| 37 | + <th width="4%">路段限速名称</th> | ||
| 38 | + <th width="4%">限速(km/h)</th> | ||
| 39 | + <th width="4%">限速开始时间</th> | ||
| 40 | + <th width="4%">限速结束时间</th> | ||
| 41 | + <th width="3%">是否启用</th> | ||
| 42 | + <th width="8%">操作</th> | ||
| 43 | + </tr> | ||
| 44 | + <tr role="row" class="filter"> | ||
| 45 | + <td></td> | ||
| 46 | + <td> | ||
| 47 | + <input type="text" class="form-control form-filter input-sm" name="id_eq"> | ||
| 48 | + </td> | ||
| 49 | + <td> | ||
| 50 | + <select type="text" class="form-control form-filter input-sm" name="name_eq" id="nameSelect"> | ||
| 51 | + </select> | ||
| 52 | + </td> | ||
| 53 | + <td> | ||
| 54 | + <input type="text" class="form-control form-filter input-sm" name="speed_eq"> | ||
| 55 | + </td> | ||
| 56 | + <td> | ||
| 57 | + </td> | ||
| 58 | + <td> | ||
| 59 | + </td> | ||
| 60 | + <td> | ||
| 61 | + <select class="form-control form-filter" id ="dirSelect" name="isStart_eq"> | ||
| 62 | + <option value="">请选择...</option> | ||
| 63 | + <option value="0">启用</option> | ||
| 64 | + <option value="1">未启用</option> | ||
| 65 | + </select> | ||
| 66 | + </td> | ||
| 67 | + <td> | ||
| 68 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | ||
| 69 | + <i class="fa fa-search"></i> 搜索 | ||
| 70 | + </button> | ||
| 71 | + | ||
| 72 | + <button class="btn btn-sm red btn-outline filter-cancel"> | ||
| 73 | + <i class="fa fa-times"></i> 重置 | ||
| 74 | + </button> | ||
| 75 | + </td> | ||
| 76 | + </tr> | ||
| 77 | + </thead> | ||
| 78 | + <tbody></tbody> | ||
| 79 | + </table> | ||
| 80 | + <div style="text-align: right;"> | ||
| 81 | + <ul id="pagination" class="pagination"></ul> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + </div> | ||
| 87 | +</div> | ||
| 88 | +<script type="text/html" id="roadSpeed_list_table_temp"> | ||
| 89 | + {{each list as obj i }} | ||
| 90 | + <tr> | ||
| 91 | + <td style="vertical-align: middle;"> | ||
| 92 | + {{(list.page*10)+(i+1)}} | ||
| 93 | + </td> | ||
| 94 | + <td style="vertical-align: middle;"> | ||
| 95 | + {{obj.id}} | ||
| 96 | + </td> | ||
| 97 | + <td> | ||
| 98 | + {{obj.name}} | ||
| 99 | + </td> | ||
| 100 | + | ||
| 101 | + <td> | ||
| 102 | + {{obj.speed}} | ||
| 103 | + </td> | ||
| 104 | + <td> | ||
| 105 | + {{obj.speedStartDate}} | ||
| 106 | + </td> | ||
| 107 | + <td> | ||
| 108 | + {{obj.speedEndDate}} | ||
| 109 | + </td> | ||
| 110 | + <td> | ||
| 111 | + {{if obj.isStart == '0'}} | ||
| 112 | + 启用 | ||
| 113 | + {{else if obj.isStart == '1'}} | ||
| 114 | + 未启用 | ||
| 115 | + {{/if}} | ||
| 116 | + </td> | ||
| 117 | + <td> | ||
| 118 | + <a href="positions.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 定位 </a> | ||
| 119 | + </td> | ||
| 120 | + </tr> | ||
| 121 | + {{/each}} | ||
| 122 | + {{if list.length == 0}} | ||
| 123 | + <tr> | ||
| 124 | + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td> | ||
| 125 | + </tr> | ||
| 126 | + {{/if}} | ||
| 127 | +</script> | ||
| 128 | +<script src="/pages/base/roadspeed/js/roadspeed-list-table.js"></script> | ||
| 0 | \ No newline at end of file | 129 | \ No newline at end of file |
src/main/resources/static/pages/base/roadspeed/positions.html
0 → 100644
| 1 | +<link href="/pages/base/roadspeed/css/positions.css" rel="stylesheet" type="text/css" /> | ||
| 2 | +<div id="roadspeedPbmap_basic"></div> | ||
| 3 | +<div class="leftUtils"> | ||
| 4 | + <div class="btn-group" style="left: 100px;"> | ||
| 5 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 操作工具 | ||
| 6 | + <i class="fa fa-angle-down"></i> | ||
| 7 | + </a> | ||
| 8 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | ||
| 9 | + <li> | ||
| 10 | + <a href="javascript:;" id = "eidt"><i class="fa fa-pencil"></i> 修改 </a> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <a href="javascript:;" id = "backUp"> <i class="fa fa-reply"></i> 返回 </a> | ||
| 14 | + </li> | ||
| 15 | + | ||
| 16 | + </ul> | ||
| 17 | + </div> | ||
| 18 | +</div> | ||
| 19 | +<!-- 编辑路段对象类 --> | ||
| 20 | +<script src="/pages/base/roadspeed/js/positionroadspeed.js"></script> | ||
| 21 | +<!-- ajax异步请求类 --> | ||
| 22 | +<script src="/pages/base/roadspeed/js/roadspeed-ajax-getdata.js"></script> | ||
| 23 | +<!-- 函数方法类 --> | ||
| 24 | +<script src="/pages/base/roadspeed/js/roadspeed-positions-function.js"></script> | ||
| 25 | +<!-- 地图类 --> | ||
| 26 | +<script src="/pages/base/roadspeed/js/roadspeed-positions-map.js"></script> | ||
| 27 | +<!-- 事件类 --> | ||
| 28 | +<script src="/pages/base/roadspeed/js/roadspeed-positions-events.js"></script> | ||
| 29 | +<!-- reload类 --> | ||
| 30 | +<script src="/pages/base/roadspeed/js/roadspeed-positions-reload.js"></script> | ||
| 0 | \ No newline at end of file | 31 | \ No newline at end of file |
src/main/resources/static/pages/base/section/add.html
| @@ -116,6 +116,22 @@ | @@ -116,6 +116,22 @@ | ||
| 116 | <div class="tab-pane" id="tab2"> | 116 | <div class="tab-pane" id="tab2"> |
| 117 | <h3 class="block"> 路段位置 </h3> | 117 | <h3 class="block"> 路段位置 </h3> |
| 118 | <div id="sectionBmap_basic"></div> | 118 | <div id="sectionBmap_basic"></div> |
| 119 | + <div class="leftUtils"> | ||
| 120 | + <div class="btn-group" style="left: 100px;"> | ||
| 121 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具 | ||
| 122 | + <i class="fa fa-angle-down"></i> | ||
| 123 | + </a> | ||
| 124 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | ||
| 125 | + <li> | ||
| 126 | + <a href="javascript:;" id="openDrawingManager"><i class="fa fa-pencil"></i> 打开 </a> | ||
| 127 | + </li> | ||
| 128 | + <li> | ||
| 129 | + <a href="javascript:;" id = "closeDrawingManager"> <i class="fa fa-reply"></i> 关闭 </a> | ||
| 130 | + </li> | ||
| 131 | + | ||
| 132 | + </ul> | ||
| 133 | + </div> | ||
| 134 | + </div> | ||
| 119 | </div> | 135 | </div> |
| 120 | 136 | ||
| 121 | <!-- 路段信息 --> | 137 | <!-- 路段信息 --> |
src/main/resources/static/pages/base/section/css/addmap.css
| @@ -8,6 +8,16 @@ | @@ -8,6 +8,16 @@ | ||
| 8 | overflow: hidden; | 8 | overflow: hidden; |
| 9 | top: 15px; | 9 | top: 15px; |
| 10 | } | 10 | } |
| 11 | +/* 绘画工具 */ | ||
| 12 | +.leftUtils{ | ||
| 13 | + position: absolute; | ||
| 14 | + padding-right: 100px; | ||
| 15 | + width: 100%; | ||
| 16 | + height: 40px; | ||
| 17 | + z-index: 9999; | ||
| 18 | + padding-top: 7px; | ||
| 19 | + top: 400px; | ||
| 20 | +} | ||
| 11 | 21 | ||
| 12 | /* 隐藏百度地图logo */ | 22 | /* 隐藏百度地图logo */ |
| 13 | .anchorBL, | 23 | .anchorBL, |
src/main/resources/static/pages/base/section/js/add-form-events.js
| @@ -3,6 +3,14 @@ $(function(){ | @@ -3,6 +3,14 @@ $(function(){ | ||
| 3 | $('.button-submit').on('click',function() { | 3 | $('.button-submit').on('click',function() { |
| 4 | $('#submit_section_form').submit();// 获取表单并提交. | 4 | $('#submit_section_form').submit();// 获取表单并提交. |
| 5 | }); | 5 | }); |
| 6 | + // 打开绘画工具 | ||
| 7 | + $('#openDrawingManager').on('click',function() { | ||
| 8 | + SectionVmapWorlds.drawingManagerOpen(); | ||
| 9 | + }); | ||
| 10 | + // 关闭绘画工具 | ||
| 11 | + $('#closeDrawingManager').on('click',function() { | ||
| 12 | + SectionVmapWorlds.drawingManagerClose(); | ||
| 13 | + }); | ||
| 6 | // 监听线路名称下拉框值改变事件. | 14 | // 监听线路名称下拉框值改变事件. |
| 7 | $('#lineSelect').on("change", function (e) { | 15 | $('#lineSelect').on("change", function (e) { |
| 8 | var lineSelectValue = $('#lineSelect').val();// 获取线路名称值. | 16 | var lineSelectValue = $('#lineSelect').val();// 获取线路名称值. |
| @@ -10,7 +18,6 @@ $(function(){ | @@ -10,7 +18,6 @@ $(function(){ | ||
| 10 | $('#lineCodeInput').val('');// 设值线路编码. | 18 | $('#lineCodeInput').val('');// 设值线路编码. |
| 11 | $('#lineIdInput').val('');// 设值线路ID. | 19 | $('#lineIdInput').val('');// 设值线路ID. |
| 12 | }else { | 20 | }else { |
| 13 | - debugger | ||
| 14 | var lineSelectValueArray = lineSelectValue.split('_');// 切割线路名称值. | 21 | var lineSelectValueArray = lineSelectValue.split('_');// 切割线路名称值. |
| 15 | $('#lineIdInput').val(lineSelectValueArray[0]);// 设值线路编码. | 22 | $('#lineIdInput').val(lineSelectValueArray[0]);// 设值线路编码. |
| 16 | $('#lineCodeInput').val(lineSelectValueArray[1]);// 设值线路ID. | 23 | $('#lineCodeInput').val(lineSelectValueArray[1]);// 设值线路ID. |
src/main/resources/static/pages/base/section/js/add-form-reload.js
| @@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
| 57 | offsetX : 12, | 57 | offsetX : 12, |
| 58 | offsetY : -70, | 58 | offsetY : -70, |
| 59 | content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">a)系统生成:根据路段的起、终点站名称自动生成一条折线走向。</span></br>'+ | 59 | content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">a)系统生成:根据路段的起、终点站名称自动生成一条折线走向。</span></br>'+ |
| 60 | - '<span style="display:block; float:left;font-size:x-small;">b)手动添加:手动在地图上画出路段,然后双击鼠标右键结束当前绘制。</span>', | 60 | + '<span style="display:block; float:left;font-size:x-small;">b)手动添加:打开绘画工具,手动在地图上画出路段,然后双击鼠标右键结束当前绘制。</span>', |
| 61 | 61 | ||
| 62 | }); | 62 | }); |
| 63 | $('.tipso-animation').tipso('show'); | 63 | $('.tipso-animation').tipso('show'); |
src/main/resources/static/pages/base/section/js/add-form-wizard.js
| @@ -155,6 +155,7 @@ var FormWizard = function() { | @@ -155,6 +155,7 @@ var FormWizard = function() { | ||
| 155 | paramsStationsArray[1]= stationEndValue+'公交车站'; | 155 | paramsStationsArray[1]= stationEndValue+'公交车站'; |
| 156 | $('#sectionNameInput').val(stationStartValue + '至' + stationEndValue ); | 156 | $('#sectionNameInput').val(stationStartValue + '至' + stationEndValue ); |
| 157 | if(baseResValue == 0) { | 157 | if(baseResValue == 0) { |
| 158 | + $('.leftUtils').hide(); | ||
| 158 | // 根据站点名称获取百度坐标. | 159 | // 根据站点名称获取百度坐标. |
| 159 | SectionVmapWorlds.stationsNameToPoints(paramsStationsArray,function(resultJson) { | 160 | SectionVmapWorlds.stationsNameToPoints(paramsStationsArray,function(resultJson) { |
| 160 | // 根据坐标点获取两点之间的时间与距离. | 161 | // 根据坐标点获取两点之间的时间与距离. |
| @@ -167,7 +168,7 @@ var FormWizard = function() { | @@ -167,7 +168,7 @@ var FormWizard = function() { | ||
| 167 | }else if(baseResValue ==1) { | 168 | }else if(baseResValue ==1) { |
| 168 | SectionVmapWorlds.localSearchFromAdreesToPoint(stationStartValue+'公交车站'); | 169 | SectionVmapWorlds.localSearchFromAdreesToPoint(stationStartValue+'公交车站'); |
| 169 | SectionVmapWorlds.localSearchFromAdreesToPoint(stationEndValue+'公交车站'); | 170 | SectionVmapWorlds.localSearchFromAdreesToPoint(stationEndValue+'公交车站'); |
| 170 | - SectionVmapWorlds.drawingManagerOpen(); | 171 | +// SectionVmapWorlds.drawingManagerOpen(); |
| 171 | } | 172 | } |
| 172 | $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); | 173 | $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); |
| 173 | },300) | 174 | },300) |
src/main/resources/static/pages/base/section/js/add-input-function.js
| @@ -86,7 +86,9 @@ var PublicFunctions = function () { | @@ -86,7 +86,9 @@ var PublicFunctions = function () { | ||
| 86 | }, | 86 | }, |
| 87 | // 新增路段保存. | 87 | // 新增路段保存. |
| 88 | sectionSave : function(section,callback) { | 88 | sectionSave : function(section,callback) { |
| 89 | + debugger | ||
| 89 | $post('/section/sectionSave',section,function(data) { | 90 | $post('/section/sectionSave',section,function(data) { |
| 91 | + debugger | ||
| 90 | callback && callback(data); | 92 | callback && callback(data); |
| 91 | }); | 93 | }); |
| 92 | } | 94 | } |
src/main/resources/static/pages/base/station/add.html
| @@ -102,23 +102,22 @@ | @@ -102,23 +102,22 @@ | ||
| 102 | <!-- 站点位置 --> | 102 | <!-- 站点位置 --> |
| 103 | <div class="tab-pane" id="tab2"> | 103 | <div class="tab-pane" id="tab2"> |
| 104 | <h3 class="block"> 站点位置 </h3> | 104 | <h3 class="block"> 站点位置 </h3> |
| 105 | - <div id="stationbmap_basic"> | ||
| 106 | - <div class="leftUtils"> | ||
| 107 | - <div class="btn-group" style="left: 100px;"> | ||
| 108 | - <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具 | ||
| 109 | - <i class="fa fa-angle-down"></i> | ||
| 110 | - </a> | ||
| 111 | - <ul class="dropdown-menu pull-right" style="min-width:100px"> | ||
| 112 | - <li> | ||
| 113 | - <a href="javascript:;" id="oppenDrawingManager"><i class="fa fa-pencil"></i> 打开 </a> | ||
| 114 | - </li> | ||
| 115 | - <li> | ||
| 116 | - <a href="javascript:;" id = "closeDrawingManager"> <i class="fa fa-reply"></i> 关闭 </a> | ||
| 117 | - </li> | ||
| 118 | - </ul> | ||
| 119 | - </div> | 105 | + <div id="stationbmap_basic"></div> |
| 106 | + <div class="leftUtils"> | ||
| 107 | + <div class="btn-group" style="left: 100px;"> | ||
| 108 | + <a class="btn btn-sm green-seagreen dropdown-toggle" style="width: 98px;" href="javascript:;" data-toggle="dropdown" aria-expanded="false"> 绘制工具 | ||
| 109 | + <i class="fa fa-angle-down"></i> | ||
| 110 | + </a> | ||
| 111 | + <ul class="dropdown-menu pull-right" style="min-width:100px"> | ||
| 112 | + <li> | ||
| 113 | + <a href="javascript:;" id="oppenDrawingManager"><i class="fa fa-pencil"></i> 打开 </a> | ||
| 114 | + </li> | ||
| 115 | + <li> | ||
| 116 | + <a href="javascript:;" id = "closeDrawingManager"> <i class="fa fa-reply"></i> 关闭 </a> | ||
| 117 | + </li> | ||
| 118 | + </ul> | ||
| 120 | </div> | 119 | </div> |
| 121 | - </div> | 120 | + </div> |
| 122 | </div> | 121 | </div> |
| 123 | <!-- 站点信息 --> | 122 | <!-- 站点信息 --> |
| 124 | <div class="tab-pane" id="tab3"> | 123 | <div class="tab-pane" id="tab3"> |
src/main/resources/static/pages/base/station/css/addmap.css
| @@ -9,6 +9,16 @@ | @@ -9,6 +9,16 @@ | ||
| 9 | top: 15px; | 9 | top: 15px; |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | +/* 绘画工具 */ | ||
| 13 | +.leftUtils{ | ||
| 14 | + position: absolute; | ||
| 15 | + padding-right: 100px; | ||
| 16 | + width: 100%; | ||
| 17 | + height: 40px; | ||
| 18 | + z-index: 9999; | ||
| 19 | + padding-top: 7px; | ||
| 20 | + top: 400px; | ||
| 21 | +} | ||
| 12 | 22 | ||
| 13 | /* 隐藏百度地图logo */ | 23 | /* 隐藏百度地图logo */ |
| 14 | .anchorBL, | 24 | .anchorBL, |
src/main/resources/static/pages/base/station/js/add-form-reload.js
| @@ -54,7 +54,7 @@ | @@ -54,7 +54,7 @@ | ||
| 54 | offsetX : 12, | 54 | offsetX : 12, |
| 55 | offsetY : -70, | 55 | offsetY : -70, |
| 56 | content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)系统生成:根据站点名称自动生成以100米为半径范围的圆.</span></br>'+ | 56 | content :'<span style="display:block; float:left;font-size:x-small;line-height:10px">A)系统生成:根据站点名称自动生成以100米为半径范围的圆.</span></br>'+ |
| 57 | - '<span style="display:block; float:left;font-size:x-small;">B)手动添加:手动在地图上画出站点范围,然后双击鼠标右键保存.</span>', | 57 | + '<span style="display:block; float:left;font-size:x-small;">B)手动添加:请打开绘画工具,手动在地图上画出站点范围,然后双击鼠标右键保存.</span>', |
| 58 | 58 | ||
| 59 | }); | 59 | }); |
| 60 | $('.tipso-animation').tipso('show'); | 60 | $('.tipso-animation').tipso('show'); |
src/main/resources/static/pages/base/station/js/add-form-wizard.js
| @@ -185,16 +185,16 @@ var FormWizard = function() { | @@ -185,16 +185,16 @@ var FormWizard = function() { | ||
| 185 | var stationNameV = $('#zdmcInput').val(); | 185 | var stationNameV = $('#zdmcInput').val(); |
| 186 | $('#stationNameInput').val(stationNameV); | 186 | $('#stationNameInput').val(stationNameV); |
| 187 | if(baseResValue == 0) { | 187 | if(baseResValue == 0) { |
| 188 | + $('.leftUtils').hide(); | ||
| 188 | StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV+'公交车站',function(p) { | 189 | StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV+'公交车站',function(p) { |
| 189 | if(p) { | 190 | if(p) { |
| 190 | - $('.leftUtils').hide(); | ||
| 191 | StationPVmapWorlds.pointsCircle(p); | 191 | StationPVmapWorlds.pointsCircle(p); |
| 192 | } | 192 | } |
| 193 | }); | 193 | }); |
| 194 | }else if(baseResValue ==1) { | 194 | }else if(baseResValue ==1) { |
| 195 | StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV+'公交车站',function(p) {}); | 195 | StationPVmapWorlds.localSearchFromAdreesToPoint(stationNameV+'公交车站',function(p) {}); |
| 196 | $('.leftUtils').show(); | 196 | $('.leftUtils').show(); |
| 197 | - StationPVmapWorlds.drawingManagerOpen(); | 197 | +// StationPVmapWorlds.drawingManagerOpen(); |
| 198 | } | 198 | } |
| 199 | $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); | 199 | $('html,body').animate({scrollTop: ($('#form-wizard-info').offset().top-5) + "px"},500); |
| 200 | },300) | 200 | },300) |