Commit d84eb3f0740259cfd36cd1f2a8245367f627fc0a
1 parent
78d51cd7
浦东调度的异常功能,表格默认只显示当日信息。
Showing
14 changed files
with
2315 additions
and
147 deletions
src/main/java/com/bsth/controller/excep/SpeedingController.java
| @@ -31,10 +31,8 @@ public class SpeedingController extends BaseController<SysUser, Integer>{ | @@ -31,10 +31,8 @@ public class SpeedingController extends BaseController<SysUser, Integer>{ | ||
| 31 | map.put("pageData","10"); | 31 | map.put("pageData","10"); |
| 32 | pageObject=speedingService.Pagequery(map); | 32 | pageObject=speedingService.Pagequery(map); |
| 33 | return pageObject; | 33 | return pageObject; |
| 34 | - | ||
| 35 | } | 34 | } |
| 36 | 35 | ||
| 37 | - | ||
| 38 | @RequestMapping(value = "/getReport", method = RequestMethod.POST) | 36 | @RequestMapping(value = "/getReport", method = RequestMethod.POST) |
| 39 | public Map<String, Object> getReport(@RequestParam Map<String, Object> map) { | 37 | public Map<String, Object> getReport(@RequestParam Map<String, Object> map) { |
| 40 | Map<String, Object> modelMap = new HashMap<String, Object>(); | 38 | Map<String, Object> modelMap = new HashMap<String, Object>(); |
src/main/java/com/bsth/entity/excep/Speeding.java
| @@ -74,6 +74,13 @@ public class Speeding { | @@ -74,6 +74,13 @@ public class Speeding { | ||
| 74 | @Transient | 74 | @Transient |
| 75 | private String lpname; | 75 | private String lpname; |
| 76 | 76 | ||
| 77 | + //结束时间,单位:秒/s | ||
| 78 | + @Transient | ||
| 79 | + private Long endtimestamp; | ||
| 80 | + | ||
| 81 | + @Transient | ||
| 82 | + private String endtimestampDate; | ||
| 83 | + | ||
| 77 | /** | 84 | /** |
| 78 | * 创建时间 | 85 | * 创建时间 |
| 79 | */ | 86 | */ |
| @@ -169,6 +176,14 @@ public class Speeding { | @@ -169,6 +176,14 @@ public class Speeding { | ||
| 169 | this.timestampDate = timestampDate; | 176 | this.timestampDate = timestampDate; |
| 170 | } | 177 | } |
| 171 | 178 | ||
| 179 | + public String getEndtimestampDate() { | ||
| 180 | + return endtimestampDate; | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + public void setEndtimestampDate(String endtimestampDate) { | ||
| 184 | + this.endtimestampDate = endtimestampDate; | ||
| 185 | + } | ||
| 186 | + | ||
| 172 | public String getNbbm() { | 187 | public String getNbbm() { |
| 173 | return nbbm; | 188 | return nbbm; |
| 174 | } | 189 | } |
| @@ -193,6 +208,12 @@ public class Speeding { | @@ -193,6 +208,12 @@ public class Speeding { | ||
| 193 | this.lpname = lpname; | 208 | this.lpname = lpname; |
| 194 | } | 209 | } |
| 195 | 210 | ||
| 211 | + public Long getEndtimestamp() { | ||
| 212 | + return endtimestamp; | ||
| 213 | + } | ||
| 196 | 214 | ||
| 215 | + public void setEndtimestamp(Long endtimestamp) { | ||
| 216 | + this.endtimestamp = endtimestamp; | ||
| 217 | + } | ||
| 197 | 218 | ||
| 198 | } | 219 | } |
src/main/java/com/bsth/service/excep/impl/OutboundServiceImpl.java
| @@ -69,8 +69,8 @@ public class OutboundServiceImpl implements OutboundService{ | @@ -69,8 +69,8 @@ public class OutboundServiceImpl implements OutboundService{ | ||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | } | 71 | } |
| 72 | - sql +=" limit ?,?"; | ||
| 73 | - | 72 | + // sql +=" order by id limit ?,?"; |
| 73 | + sql +=" order by timestamp limit ?,?"; | ||
| 74 | 74 | ||
| 75 | try { | 75 | try { |
| 76 | conn = DBUtils_MS.getConnection(); | 76 | conn = DBUtils_MS.getConnection(); |
| @@ -95,15 +95,15 @@ public class OutboundServiceImpl implements OutboundService{ | @@ -95,15 +95,15 @@ public class OutboundServiceImpl implements OutboundService{ | ||
| 95 | Outbound outbound; | 95 | Outbound outbound; |
| 96 | while(rs.next()){ | 96 | while(rs.next()){ |
| 97 | outbound=new Outbound(); | 97 | outbound=new Outbound(); |
| 98 | - outbound.setId(Integer.valueOf(rs.getObject("id").toString())); | ||
| 99 | - outbound.setLat(Float.valueOf(rs.getObject("lat").toString())); | 98 | + // outbound.setId(Integer.valueOf(rs.getObject("id").toString())); |
| 100 | outbound.setLine(Integer.valueOf(rs.getObject("line").toString())); | 99 | outbound.setLine(Integer.valueOf(rs.getObject("line").toString())); |
| 100 | + outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); | ||
| 101 | + outbound.setLon(Float.valueOf(rs.getObject("lon").toString())); | ||
| 102 | + outbound.setLat(Float.valueOf(rs.getObject("lat").toString())); | ||
| 101 | //run 时注解 | 103 | //run 时注解 |
| 102 | outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString())); | 104 | outbound.setLineName(BasicData.lineCode2NameMap.get(outbound.getLine().toString())); |
| 103 | - outbound.setLon(Float.valueOf(rs.getObject("lon").toString())); | ||
| 104 | outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); | 105 | outbound.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); |
| 105 | outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); | 106 | outbound.setTimestampDate(sdf.format(new Date(outbound.getTimestamp()))); |
| 106 | - outbound.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); | ||
| 107 | outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); | 107 | outbound.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("vehicle").toString())); |
| 108 | // outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); | 108 | // outbound.setLocation(rs.getObject("location")==null?"":rs.getObject("location").toString()); |
| 109 | list.add(outbound); | 109 | list.add(outbound); |
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
| @@ -43,8 +43,10 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -43,8 +43,10 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 43 | Object line=map.get("line"); | 43 | Object line=map.get("line"); |
| 44 | Object nbbm=map.get("nbbm"); | 44 | Object nbbm=map.get("nbbm"); |
| 45 | Object updown=map.get("updown"); | 45 | Object updown=map.get("updown"); |
| 46 | - Object date=map.get("date"); | ||
| 47 | - | 46 | + Object startDate=map.get("startDate"); |
| 47 | + Object endDate=map.get("endDate"); | ||
| 48 | + | ||
| 49 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 48 | if(line!=null){ | 50 | if(line!=null){ |
| 49 | sql +=" and line like'%"+line.toString().trim()+"%'"; | 51 | sql +=" and line like'%"+line.toString().trim()+"%'"; |
| 50 | } | 52 | } |
| @@ -58,15 +60,23 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -58,15 +60,23 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 58 | if(updown!=null){ | 60 | if(updown!=null){ |
| 59 | sql +="and up_down like '%"+updown.toString()+"%'"; | 61 | sql +="and up_down like '%"+updown.toString()+"%'"; |
| 60 | } | 62 | } |
| 61 | - if(date!=null){ | ||
| 62 | - if (date.toString().length()>0) { | ||
| 63 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 63 | + if(startDate!=null){ |
| 64 | + if (startDate.toString().length()>0) { | ||
| 64 | try { | 65 | try { |
| 65 | - Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | ||
| 66 | - Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | ||
| 67 | - sql += " and timestamp >="+t1 +" and timestamp <="+t2; | 66 | + Long t1=sdf.parse(startDate.toString()+" 00:00:00").getTime(); |
| 67 | + sql += " and timestamp >="+t1; | ||
| 68 | + } catch (ParseException e) { | ||
| 69 | + e.printStackTrace(); | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + } | ||
| 74 | + if(endDate!=null){ | ||
| 75 | + if (endDate.toString().length()>0) { | ||
| 76 | + try { | ||
| 77 | + Long t2=sdf.parse(endDate.toString()+" 23:59:59").getTime(); | ||
| 78 | + sql += " and timestamp <="+t2; | ||
| 68 | } catch (ParseException e) { | 79 | } catch (ParseException e) { |
| 69 | - // TODO Auto-generated catch block | ||
| 70 | e.printStackTrace(); | 80 | e.printStackTrace(); |
| 71 | } | 81 | } |
| 72 | } | 82 | } |
| @@ -74,18 +84,17 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -74,18 +84,17 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 74 | } | 84 | } |
| 75 | 85 | ||
| 76 | 86 | ||
| 77 | - sql +=" order by id limit ?,?"; | 87 | + /*sql +=" order by id limit ?,?";*/ |
| 78 | 88 | ||
| 79 | 89 | ||
| 80 | try { | 90 | try { |
| 81 | conn = DBUtils_MS.getConnection(); | 91 | conn = DBUtils_MS.getConnection(); |
| 82 | ps = conn.prepareStatement(sql); | 92 | ps = conn.prepareStatement(sql); |
| 83 | - ps.setInt(1, page*10); // O-最大条数 -- M-起始条数 | 93 | + /* ps.setInt(1, page*10); // O-最大条数 -- M-起始条数 |
| 84 | ps.setInt(2, 10); // O-最小条数 -- M-显示条数 | 94 | ps.setInt(2, 10); // O-最小条数 -- M-显示条数 |
| 85 | - rs = ps.executeQuery(); | 95 | +*/ rs = ps.executeQuery(); |
| 86 | list = resultSet2Set(rs); | 96 | list = resultSet2Set(rs); |
| 87 | } catch (SQLException e) { | 97 | } catch (SQLException e) { |
| 88 | - // TODO Auto-generated catch block | ||
| 89 | e.printStackTrace(); | 98 | e.printStackTrace(); |
| 90 | }finally { | 99 | }finally { |
| 91 | DBUtils_MS.close(rs, ps, conn); | 100 | DBUtils_MS.close(rs, ps, conn); |
| @@ -106,6 +115,7 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -106,6 +115,7 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 106 | //run 时注解 | 115 | //run 时注解 |
| 107 | speeding.setLineName(BasicData.lineCode2NameMap.get(speeding.getLine().toString())); | 116 | speeding.setLineName(BasicData.lineCode2NameMap.get(speeding.getLine().toString())); |
| 108 | speeding.setLon(Float.valueOf(rs.getObject("lon").toString())); | 117 | speeding.setLon(Float.valueOf(rs.getObject("lon").toString())); |
| 118 | + speeding.setSpeed(Float.valueOf(rs.getObject("speed").toString())); | ||
| 109 | speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); | 119 | speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); |
| 110 | speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp()))); | 120 | speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp()))); |
| 111 | speeding.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); | 121 | speeding.setUpDown(Integer.valueOf(rs.getObject("up_down").toString())); |
| @@ -114,16 +124,18 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -114,16 +124,18 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 114 | } | 124 | } |
| 115 | return list; | 125 | return list; |
| 116 | } | 126 | } |
| 127 | + | ||
| 117 | @Override | 128 | @Override |
| 118 | public PageObject<Speeding> Pagequery(Map<String, Object> map) { | 129 | public PageObject<Speeding> Pagequery(Map<String, Object> map) { |
| 119 | - // TODO Auto-generated method stub | ||
| 120 | String sql="select count(*) record from bsth_c_speeding where 1=1 "; | 130 | String sql="select count(*) record from bsth_c_speeding where 1=1 "; |
| 121 | Object line=map.get("line"); | 131 | Object line=map.get("line"); |
| 122 | Object nbbm=map.get("nbbm"); | 132 | Object nbbm=map.get("nbbm"); |
| 123 | Object updown=map.get("updown"); | 133 | Object updown=map.get("updown"); |
| 134 | + Object startDate=map.get("startDate"); | ||
| 135 | + Object endDate=map.get("endDate"); | ||
| 136 | + //时间转换 | ||
| 137 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 124 | 138 | ||
| 125 | - Object date=map.get("date"); | ||
| 126 | - | ||
| 127 | if(line!=null){ | 139 | if(line!=null){ |
| 128 | sql +=" and line like'%"+line.toString().trim()+"%'"; | 140 | sql +=" and line like'%"+line.toString().trim()+"%'"; |
| 129 | } | 141 | } |
| @@ -136,15 +148,23 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -136,15 +148,23 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 136 | if(updown!=null){ | 148 | if(updown!=null){ |
| 137 | sql +="and up_down like '%"+updown.toString()+"%'"; | 149 | sql +="and up_down like '%"+updown.toString()+"%'"; |
| 138 | } | 150 | } |
| 139 | - if(date!=null){ | ||
| 140 | - if (date.toString().length()>0) { | ||
| 141 | - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:MM:SS"); | 151 | + if(startDate!=null){ |
| 152 | + if (startDate.toString().length()>0) { | ||
| 142 | try { | 153 | try { |
| 143 | - Long t1=sdf.parse(date.toString()+" 00:00:00").getTime(); | ||
| 144 | - Long t2=sdf.parse(date.toString()+" 23:59:59").getTime(); | ||
| 145 | - sql += " and timestamp >="+t1 +" and timestamp <="+t2; | 154 | + Long t1=sdf.parse(startDate.toString()+" 00:00:00").getTime(); |
| 155 | + sql += " and timestamp >="+t1; | ||
| 156 | + } catch (ParseException e) { | ||
| 157 | + e.printStackTrace(); | ||
| 158 | + } | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + } | ||
| 162 | + if(endDate!=null){ | ||
| 163 | + if (endDate.toString().length()>0) { | ||
| 164 | + try { | ||
| 165 | + Long t2=sdf.parse(endDate.toString()+" 23:59:59").getTime(); | ||
| 166 | + sql += " and timestamp <="+t2; | ||
| 146 | } catch (ParseException e) { | 167 | } catch (ParseException e) { |
| 147 | - // TODO Auto-generated catch block | ||
| 148 | e.printStackTrace(); | 168 | e.printStackTrace(); |
| 149 | } | 169 | } |
| 150 | } | 170 | } |
| @@ -163,49 +183,68 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -163,49 +183,68 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 163 | totalData=rs.getInt("record"); | 183 | totalData=rs.getInt("record"); |
| 164 | } | 184 | } |
| 165 | } catch (SQLException e) { | 185 | } catch (SQLException e) { |
| 166 | - // TODO Auto-generated catch block | ||
| 167 | e.printStackTrace(); | 186 | e.printStackTrace(); |
| 168 | }finally { | 187 | }finally { |
| 169 | DBUtils_MS.close(rs, ps, conn); | 188 | DBUtils_MS.close(rs, ps, conn); |
| 170 | } | 189 | } |
| 171 | 190 | ||
| 172 | - PageHelper pageHelper = new PageHelper(totalData, map); | ||
| 173 | - List<Speeding> list=findAll(pageHelper.getMap()); | ||
| 174 | - for (int i = 0; i < list.size(); i++) { | ||
| 175 | - String nbbm2=list.get(i).getVehicle() ; | ||
| 176 | - Long d1=list.get(i).getTimestamp(); | ||
| 177 | - Date datess = new Date(d1); | ||
| 178 | - String dates=new SimpleDateFormat("yyyy-MM-dd").format(datess); | ||
| 179 | - String sk=new SimpleDateFormat("HH:mm").format(datess); | ||
| 180 | - String sqlPbb="SELECT * FROM ( select lp_name,cl_zbh,j_gh,j_name,MIN(fcsj) as fcsj,MAX(zdsj) as ddsj" | ||
| 181 | - + " from bsth_c_s_sp_info_real where cl_zbh='"+nbbm2+"' and" | ||
| 182 | - + " real_exec_date='"+dates+"' GROUP BY cl_zbh,lp_name,j_gh,j_name ) t WHERE t.fcsj<='"+sk+"' AND t.ddsj>='"+sk+"' " ; | ||
| 183 | - List<ScheduleRealInfo> pbb =jdbcTemplate.query(sqlPbb, | ||
| 184 | - new RowMapper<ScheduleRealInfo>(){ | ||
| 185 | - @Override | ||
| 186 | - public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 187 | - ScheduleRealInfo s = new ScheduleRealInfo(); | ||
| 188 | - s.setjGh(rs.getString("j_gh")); | ||
| 189 | - s.setjName(rs.getString("j_name")); | ||
| 190 | - s.setLpName(rs.getString("lp_name")); | ||
| 191 | - return s; | ||
| 192 | - } | ||
| 193 | - }); | ||
| 194 | - if(pbb.size()>0){ | ||
| 195 | - list.get(i).setJsy(pbb.get(0).getjGh()+"/"+pbb.get(0).getjName()); | ||
| 196 | - list.get(i).setLpname(pbb.get(0).getLpName()); | ||
| 197 | - | 191 | + List<Speeding> list=findAll(map); |
| 192 | + List<Speeding> listResult = new ArrayList<Speeding>(); | ||
| 193 | + int curPage;//页码 | ||
| 194 | + int pageData;//每页的记录条数 | ||
| 195 | + int start;//起始数据下标 | ||
| 196 | + int totalPage;//总页数 | ||
| 197 | + if(list.size()>1){ | ||
| 198 | + Speeding speedingNow;//下标为i的车 | ||
| 199 | + Speeding speedingLast;//下标为i-1的车 | ||
| 200 | + String strNow; | ||
| 201 | + String strLast; | ||
| 202 | + for(int i = 1;i<list.size();i++){ | ||
| 203 | + speedingNow = list.get(i); | ||
| 204 | + speedingLast = list.get(i-1); | ||
| 205 | + strNow = speedingNow.getVehicle()+speedingNow.getLine()+speedingNow.getUpDown();//同一车辆同一线路同一方向 | ||
| 206 | + strLast = speedingLast.getVehicle()+speedingLast.getLine()+speedingLast.getUpDown(); | ||
| 207 | + //同一车辆同一线路同一方向并且该记录的超速的开始时间减去上一条超速记录的结束时间小于等于10s,证明该车超速。//PS:祛除数据库中的重复发送数据 | ||
| 208 | + if(strNow.equals(strLast) && Math.abs(speedingNow.getTimestamp()-speedingLast.getTimestamp())<=10*1000 && (speedingNow.getTimestamp()-speedingLast.getTimestamp()!=0)){ | ||
| 209 | + speedingLast.setEndtimestamp(speedingNow.getTimestamp()); | ||
| 210 | + speedingLast.setEndtimestampDate(sdf.format(new Date(speedingNow.getTimestamp())));//设置结束时间 | ||
| 211 | + listResult.add(speedingLast); | ||
| 212 | + } | ||
| 198 | } | 213 | } |
| 199 | 214 | ||
| 215 | + totalData = listResult.size();//总记录条数。 | ||
| 216 | + if(map.get("curPage") == null || map.get("curPage").equals("0")){ | ||
| 217 | + curPage = 0; | ||
| 218 | + }else{ | ||
| 219 | + curPage = Integer.parseInt((String) map.get("curPage")); | ||
| 220 | + } | ||
| 221 | + pageData = Integer.parseInt((String) map.get("pageData"));//每页的记录条数 | ||
| 222 | + start = (curPage - 0) * pageData; //起始记录下标。 | ||
| 223 | + totalPage = totalData % pageData == 0 ? totalData / pageData : totalData / pageData +1;//总页数 | ||
| 224 | + if(curPage == totalPage-1){//如果当前页等于总页数。 | ||
| 225 | + listResult = listResult.subList(start, totalData); | ||
| 226 | + }else{ | ||
| 227 | + listResult = listResult.subList(start, start+pageData); | ||
| 228 | + } | ||
| 229 | + }else{ | ||
| 230 | + curPage = 1; | ||
| 231 | + pageData = Integer.parseInt((String) map.get("pageData"));//每页的记录条数 | ||
| 232 | + totalPage =1; | ||
| 200 | } | 233 | } |
| 234 | + Map<String,Object> paramMap = new HashMap<String,Object>(); | ||
| 235 | + paramMap.put("totalPage", totalPage); | ||
| 236 | + paramMap.put("curPage", curPage); | ||
| 237 | + paramMap.put("pageData", pageData); | ||
| 238 | + PageHelper pageHelper = new PageHelper(totalData, paramMap); | ||
| 239 | + pageHelper.getMap(); | ||
| 201 | PageObject<Speeding> pageObject = pageHelper.getPageObject(); | 240 | PageObject<Speeding> pageObject = pageHelper.getPageObject(); |
| 202 | - pageObject.setDataList(list); | 241 | + pageObject.setDataList(listResult); |
| 203 | return pageObject; | 242 | return pageObject; |
| 204 | } | 243 | } |
| 205 | - | 244 | + |
| 245 | + | ||
| 206 | @Override | 246 | @Override |
| 207 | public Map<String, Object> getReport(Map<String, Object> map) { | 247 | public Map<String, Object> getReport(Map<String, Object> map) { |
| 208 | - // TODO Auto-generated method stub | ||
| 209 | String chartStr = ""; | 248 | String chartStr = ""; |
| 210 | Map<String, Object> mapValue = new HashMap<String, Object>(); | 249 | Map<String, Object> mapValue = new HashMap<String, Object>(); |
| 211 | try { | 250 | try { |
| @@ -309,10 +348,8 @@ public class SpeedingServiceImpl implements SpeedingService { | @@ -309,10 +348,8 @@ public class SpeedingServiceImpl implements SpeedingService { | ||
| 309 | } | 348 | } |
| 310 | 349 | ||
| 311 | } catch (SQLException e) { | 350 | } catch (SQLException e) { |
| 312 | - // TODO Auto-generated catch block | ||
| 313 | e.printStackTrace(); | 351 | e.printStackTrace(); |
| 314 | }catch (ParseException e1) { | 352 | }catch (ParseException e1) { |
| 315 | - // TODO Auto-generated catch block | ||
| 316 | e1.printStackTrace(); | 353 | e1.printStackTrace(); |
| 317 | }finally { | 354 | }finally { |
| 318 | DBUtils_MS.close(rs, ps, conn); | 355 | DBUtils_MS.close(rs, ps, conn); |
src/main/resources/static/pages/excep/boundList.html
| @@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
| 56 | <th width="3%">#</th> | 56 | <th width="3%">#</th> |
| 57 | <th width="15%">线路</th> | 57 | <th width="15%">线路</th> |
| 58 | <th width="13%">车辆自编号</th> | 58 | <th width="13%">车辆自编号</th> |
| 59 | - <th width="100">工号/名字</th> | 59 | + <th width="100">车辆坐标</th> |
| 60 | <th width="11%">路牌名</th> | 60 | <th width="11%">路牌名</th> |
| 61 | <th width="10%">上下行</th> | 61 | <th width="10%">上下行</th> |
| 62 | <th width="18%">时间</th> | 62 | <th width="18%">时间</th> |
| @@ -118,9 +118,11 @@ | @@ -118,9 +118,11 @@ | ||
| 118 | <td> | 118 | <td> |
| 119 | {{obj.vehicle}} | 119 | {{obj.vehicle}} |
| 120 | </td> | 120 | </td> |
| 121 | - | ||
| 122 | <td> | 121 | <td> |
| 123 | - {{obj.jsy}} | 122 | + <a href="/pages/excep/outBoundMap.html?no={{obj.line}},{{obj.upDown}},{{obj.lon}},{{obj.lat}}" |
| 123 | + class="btn default blue-stripe btn-sm" data-pjax> | ||
| 124 | + 查看车辆位置 | ||
| 125 | + </a> | ||
| 124 | </td> | 126 | </td> |
| 125 | <td> | 127 | <td> |
| 126 | {{obj.lpname}} | 128 | {{obj.lpname}} |
| @@ -156,11 +158,19 @@ $(function(){ | @@ -156,11 +158,19 @@ $(function(){ | ||
| 156 | checkboxClass: 'icheckbox_flat-blue', | 158 | checkboxClass: 'icheckbox_flat-blue', |
| 157 | increaseArea: '20%' | 159 | increaseArea: '20%' |
| 158 | } | 160 | } |
| 159 | - | ||
| 160 | -// jsDoQuery(null,true); | ||
| 161 | - | 161 | + var toDay = new Date(); |
| 162 | + var year = toDay.getFullYear(); | ||
| 163 | + var Month = toDay.getMonth()+1>10?toDay.getMonth()+1:"0"+(toDay.getMonth()+1); | ||
| 164 | + var Day = toDay.getDate()>10?toDay.getDate():"0"+toDay.getDate(); | ||
| 165 | + var date = year+"-"+Month+"-"+Day; | ||
| 166 | + //时间表单默认选择当日时间。 | ||
| 167 | + $("input[name='date']")[0].value = date; | ||
| 168 | + var parameter = new Object(); | ||
| 169 | + parameter.date = $("input[name='date']")[0].value; | ||
| 170 | + jsDoQuery(parameter,true); | ||
| 162 | //重置 | 171 | //重置 |
| 163 | $('tr.filter .filter-cancel').on('click', function(){ | 172 | $('tr.filter .filter-cancel').on('click', function(){ |
| 173 | + debugger; | ||
| 164 | $('tr.filter input, select').val('').change(); | 174 | $('tr.filter input, select').val('').change(); |
| 165 | jsDoQuery(null, true); | 175 | jsDoQuery(null, true); |
| 166 | }); | 176 | }); |
src/main/resources/static/pages/excep/img/bus.png
0 → 100644
1.03 KB
src/main/resources/static/pages/excep/js/outbound-map.js
0 → 100644
| 1 | +/** | ||
| 2 | + * 百度地图 | ||
| 3 | + * | ||
| 4 | + * - - - - - -》init:地图初始化 | ||
| 5 | + * | ||
| 6 | + * - - - - - -》lineInfoPanl:从百度地图抓去站点与路段数据 | ||
| 7 | + * | ||
| 8 | + * - - - - - -》getDistanceAndDuration:获取距离与时间 | ||
| 9 | + * | ||
| 10 | + * - - - - - -》pointsPolygon:地图画多边行 | ||
| 11 | + * | ||
| 12 | + * - - - - - -》pointsCircle:画圆 | ||
| 13 | + * | ||
| 14 | + * - - - - - -》localSearchFromAdreesToPoint:根据地理名称获取百度经纬度坐标 | ||
| 15 | + * | ||
| 16 | + * - - - - - -》drawingUpline:在地图上画出上行线路走向 | ||
| 17 | + * | ||
| 18 | + * - - - - - -》stationsNameToPoints:站点名称获取百度坐标(手动规划) | ||
| 19 | + * | ||
| 20 | + * - - - - - -》getDistanceAndTotime:根据坐标点获取两点之间的时间与距离(手动规划) | ||
| 21 | + * | ||
| 22 | + * - - - - - -》getSectionListPlonly:根据坐标点获取两点之间的折线路段(手动规划) | ||
| 23 | + */ | ||
| 24 | + | ||
| 25 | +var WorldsBMap = function () { | ||
| 26 | + | ||
| 27 | + /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆 */ | ||
| 28 | + var mapBValue = '';polygon='',polyUpline='',circle='',iseditStatus = false; | ||
| 29 | + | ||
| 30 | + var Bmap = { | ||
| 31 | + | ||
| 32 | + init : function() { | ||
| 33 | + | ||
| 34 | + // 设置中心点, | ||
| 35 | + var CENTER_POINT = {lng : 121.528733,lat : 31.237425}; | ||
| 36 | + | ||
| 37 | + // 百度API Key | ||
| 38 | + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT'; | ||
| 39 | + | ||
| 40 | + // 初始化百度地图 | ||
| 41 | + mapBValue = new BMap.Map("bmap_basic"); | ||
| 42 | + | ||
| 43 | + //中心点和缩放级别 | ||
| 44 | + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15); | ||
| 45 | + | ||
| 46 | + //启用地图拖拽事件,默认启用(可不写) | ||
| 47 | + mapBValue.enableDragging(); | ||
| 48 | + | ||
| 49 | + //启用地图滚轮放大缩小 | ||
| 50 | + mapBValue.enableScrollWheelZoom(); | ||
| 51 | + | ||
| 52 | + //禁用鼠标双击放大 | ||
| 53 | + mapBValue.disableDoubleClickZoom(); | ||
| 54 | + | ||
| 55 | + //启用键盘上下左右键移动地图 | ||
| 56 | + mapBValue.enableKeyboard(); | ||
| 57 | + | ||
| 58 | + return mapBValue; | ||
| 59 | + }, | ||
| 60 | + | ||
| 61 | + /** 获取地图对象 @return 地图对象map */ | ||
| 62 | + getmapBValue : function() { | ||
| 63 | + | ||
| 64 | + return mapBValue; | ||
| 65 | + | ||
| 66 | + }, | ||
| 67 | + | ||
| 68 | + getPolygon : function(){ | ||
| 69 | + | ||
| 70 | + return polygon; | ||
| 71 | + }, | ||
| 72 | + | ||
| 73 | + getPolyUpline : function() { | ||
| 74 | + | ||
| 75 | + return polyUpline; | ||
| 76 | + }, | ||
| 77 | + | ||
| 78 | + getCircle : function() { | ||
| 79 | + | ||
| 80 | + return circle; | ||
| 81 | + }, | ||
| 82 | + | ||
| 83 | + getIsEditStatus : function() { | ||
| 84 | + return iseditStatus; | ||
| 85 | + }, | ||
| 86 | + | ||
| 87 | + setIsEditStatus : function(v) { | ||
| 88 | + iseditStatus = v ; | ||
| 89 | + }, | ||
| 90 | + | ||
| 91 | + initDrawingManager: function(map,styleOptions) { | ||
| 92 | + | ||
| 93 | + }, | ||
| 94 | + | ||
| 95 | + getDrawingManagerObj : function() { | ||
| 96 | + | ||
| 97 | + return drawingManagerInitV; | ||
| 98 | + }, | ||
| 99 | + | ||
| 100 | + // 从百度地图抓去站点与路段数据 | ||
| 101 | + lineInfoPanl : function(lineNameValue,i,cb) { | ||
| 102 | + | ||
| 103 | + /** 根据线路名称与方向从百度地图获取站点与路段 @param lineNameValue:线路名称;i:方向<0:上行;1:下行> */ | ||
| 104 | + WorldsBMap.getBmapStationNames(lineNameValue,i,function(BusLine){ | ||
| 105 | + | ||
| 106 | + return cb && cb(BusLine); | ||
| 107 | + | ||
| 108 | + }); | ||
| 109 | + | ||
| 110 | + }, | ||
| 111 | + | ||
| 112 | + /** 获取距离与时间 @param <points:坐标点集合> */ | ||
| 113 | + getDistanceAndDuration : function(points,callback){ | ||
| 114 | + | ||
| 115 | + // 获取长度 | ||
| 116 | + var len = points.length; | ||
| 117 | + | ||
| 118 | + (function(){ | ||
| 119 | + | ||
| 120 | + if (!arguments.callee.count) { | ||
| 121 | + | ||
| 122 | + arguments.callee.count = 0; | ||
| 123 | + | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + arguments.callee.count++; | ||
| 127 | + | ||
| 128 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 129 | + | ||
| 130 | + if (index >= len-1) { | ||
| 131 | + | ||
| 132 | + callback && callback(points); | ||
| 133 | + | ||
| 134 | + return; | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + // 当函数被调用时,它的arguments.callee对象就会指向自身,也就是一个对自己的引用。(当前正在执行的函数。) | ||
| 138 | + var f = arguments.callee; | ||
| 139 | + | ||
| 140 | + // 起点坐标 <坐标格式:40.056878,116.30815> | ||
| 141 | + var origin = points[index].potion.lat + ',' + points[index].potion.lng; | ||
| 142 | + | ||
| 143 | + // 终点坐标 <坐标格式:40.056878,116.30815> | ||
| 144 | + var destination = points[index+1].potion.lat + ',' + points[index+1].potion.lng; | ||
| 145 | + | ||
| 146 | + var region = '上海'; | ||
| 147 | + | ||
| 148 | + var origin_region = '上海'; | ||
| 149 | + | ||
| 150 | + var destination_region = '上海'; | ||
| 151 | + | ||
| 152 | + var output = 'json'; | ||
| 153 | + | ||
| 154 | + var ak_My = 'wjlITmXeCek5MxyU3ZUBkTeU8B0o0npk'; | ||
| 155 | + | ||
| 156 | + /** | ||
| 157 | + * origin:起点名称或经纬度; | ||
| 158 | + * | ||
| 159 | + * destination:终点名称或经纬度; | ||
| 160 | + * | ||
| 161 | + * origin_region:起始点所在城市,驾车导航时必填。 | ||
| 162 | + * | ||
| 163 | + * destination_region:终点所在城市,驾车导航时必填。 | ||
| 164 | + * | ||
| 165 | + * output :表示输出类型,可设置为xml或json,默认为xml。 | ||
| 166 | + * | ||
| 167 | + **/ | ||
| 168 | + var paramsB = {origin:origin,destination:destination,region:region,origin_region:origin_region,destination_region:destination_region,output:output,ak:ak_My}; | ||
| 169 | + | ||
| 170 | + /** @description :未认证开发者默认配额为:2000次/天。 */ | ||
| 171 | + $.ajax({ | ||
| 172 | + | ||
| 173 | + // 百度地图根据坐标获取两点之间的时间与距离 | ||
| 174 | + url: 'http://api.map.baidu.com/direction/v1?mode=transit', | ||
| 175 | + | ||
| 176 | + data: paramsB, | ||
| 177 | + | ||
| 178 | + dataType: 'jsonp', | ||
| 179 | + | ||
| 180 | + success: function(r){ | ||
| 181 | + | ||
| 182 | + if(r) { | ||
| 183 | + | ||
| 184 | + if(r.message=='ok') { | ||
| 185 | + | ||
| 186 | + if(r.result.taxi==null) { | ||
| 187 | + | ||
| 188 | + // 获取距离(单位:米) | ||
| 189 | + points[index+1].distance = 0; | ||
| 190 | + | ||
| 191 | + // 获取时间(单位:秒) | ||
| 192 | + points[index+1].duration = 0; | ||
| 193 | + | ||
| 194 | + }else { | ||
| 195 | + | ||
| 196 | + // 获取距离(单位:米) | ||
| 197 | + points[index+1].distance = r.result.taxi.distance; | ||
| 198 | + | ||
| 199 | + // 获取时间(单位:秒) | ||
| 200 | + points[index+1].duration = r.result.taxi.duration; | ||
| 201 | + | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + } | ||
| 208 | + | ||
| 209 | + f(); | ||
| 210 | + } | ||
| 211 | + }); | ||
| 212 | + | ||
| 213 | + })(); | ||
| 214 | + | ||
| 215 | + }, | ||
| 216 | + | ||
| 217 | + // 地图画多边形 | ||
| 218 | + pointsPolygon : function(objStation) { | ||
| 219 | + | ||
| 220 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | ||
| 221 | + mapBValue.setZoom(15); | ||
| 222 | + | ||
| 223 | + // 如果不为空 | ||
| 224 | + if(objStation) { | ||
| 225 | + | ||
| 226 | + // 获取中心点坐标字符串 | ||
| 227 | + var testpointStr = objStation.stationBJwpoints; | ||
| 228 | + | ||
| 229 | + // 按空格切割中心点坐标字符串 | ||
| 230 | + var BJwpointsPolygon = testpointStr.split(' '); | ||
| 231 | + | ||
| 232 | + // 中心点坐标 | ||
| 233 | + var pointPolygon = new BMap.Point(BJwpointsPolygon[0], BJwpointsPolygon[1]); | ||
| 234 | + | ||
| 235 | + // 获取多边形坐标字符串 | ||
| 236 | + var stationBPolygonGrid = objStation.stationBPolygonGrid; | ||
| 237 | + | ||
| 238 | + // 截取多边形坐标字符串 | ||
| 239 | + var stationBPolygonGridStr = stationBPolygonGrid.substring(9,stationBPolygonGrid.length-2); | ||
| 240 | + | ||
| 241 | + // 按逗号切割 | ||
| 242 | + var pointPolygonArray = stationBPolygonGridStr.split(','); | ||
| 243 | + | ||
| 244 | + // 多边形坐标集合 | ||
| 245 | + var polygonP = []; | ||
| 246 | + | ||
| 247 | + for(var v = 0;v<pointPolygonArray.length;v++) { | ||
| 248 | + | ||
| 249 | + polygonP.push(new BMap.Point(pointPolygonArray[v].split(" ")[0],pointPolygonArray[v].split(" ")[1])); | ||
| 250 | + | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + // 画多边形 | ||
| 254 | + polygon = new BMap.Polygon(polygonP, { | ||
| 255 | + | ||
| 256 | + // 线条显色 | ||
| 257 | + strokeColor : "blue", | ||
| 258 | + | ||
| 259 | + // 边线的宽度,以像素为单位。 | ||
| 260 | + strokeWeight : 2, | ||
| 261 | + | ||
| 262 | + // 边线透明度,取值范围0 - 1。 | ||
| 263 | + strokeOpacity : 0.5 | ||
| 264 | + }); | ||
| 265 | + | ||
| 266 | + // 增加地图覆盖物多边形 | ||
| 267 | + mapBValue.addOverlay(polygon); | ||
| 268 | + | ||
| 269 | + // 信息窗口属性 | ||
| 270 | + var opts_polygon = { | ||
| 271 | + | ||
| 272 | + // 信息窗口宽度 | ||
| 273 | + width : 200, | ||
| 274 | + | ||
| 275 | + // 信息窗口高度 | ||
| 276 | + height : 400, | ||
| 277 | + | ||
| 278 | + // 信息窗位置偏移值。 | ||
| 279 | + offset: new BMap.Size(500,20), | ||
| 280 | + | ||
| 281 | + //标题 | ||
| 282 | + title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>', | ||
| 283 | + | ||
| 284 | + //设置不允许信窗发送短息 | ||
| 285 | + enableMessage : false, | ||
| 286 | + | ||
| 287 | + //是否开启点击地图关闭信息窗口 | ||
| 288 | + enableCloseOnClick : false | ||
| 289 | + }; | ||
| 290 | + | ||
| 291 | + var markTypeStr = ''; | ||
| 292 | + | ||
| 293 | + if(objStation.stationRouteStationMark=='B') { | ||
| 294 | + | ||
| 295 | + markTypeStr='起点站'; | ||
| 296 | + | ||
| 297 | + }else if(objStation.stationRouteStationMark=='Z') { | ||
| 298 | + | ||
| 299 | + markTypeStr ='中途站'; | ||
| 300 | + | ||
| 301 | + | ||
| 302 | + }else if(objStation.stationRouteStationMark=='E') { | ||
| 303 | + | ||
| 304 | + markTypeStr='终点站'; | ||
| 305 | + | ||
| 306 | + } | ||
| 307 | + | ||
| 308 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | ||
| 309 | + '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' + | ||
| 310 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' + | ||
| 311 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' + | ||
| 312 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' + | ||
| 313 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' + | ||
| 314 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | ||
| 315 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | ||
| 316 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + | ||
| 317 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + objStation.stationRouteVersions + '</span>' + | ||
| 318 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ | ||
| 319 | + 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ | ||
| 320 | + objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; | ||
| 321 | + | ||
| 322 | + // 创建信息窗口 | ||
| 323 | + var infoWindow_target = new BMap.InfoWindow(htm, opts_polygon); | ||
| 324 | + // 自定义标注物图片 | ||
| 325 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | ||
| 326 | + | ||
| 327 | + // 创建点 | ||
| 328 | + marker = new BMap.Marker(pointPolygon,{icon : icon_target}); | ||
| 329 | + | ||
| 330 | + // 把标注添物加到地图上 | ||
| 331 | + mapBValue.addOverlay(marker); | ||
| 332 | + | ||
| 333 | + // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 334 | + var PanOptions_ ={noAnimation :true}; | ||
| 335 | + | ||
| 336 | + // 将地图的中心点更改为给定的点。 | ||
| 337 | + mapBValue.panTo(pointPolygon,PanOptions_); | ||
| 338 | + | ||
| 339 | + // 将地图在水平位置上移动x像素,垂直位置上移动y像素。 | ||
| 340 | + mapBValue.panBy(10,-150,PanOptions_); | ||
| 341 | + | ||
| 342 | + //开启信息窗口 | ||
| 343 | + mapBValue.openInfoWindow(infoWindow_target,pointPolygon); | ||
| 344 | + | ||
| 345 | + } | ||
| 346 | + | ||
| 347 | + }, | ||
| 348 | + | ||
| 349 | + editPolyUpline : function() { | ||
| 350 | + // 禁止覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | ||
| 351 | + polyUpline.disableMassClear(); | ||
| 352 | + WorldsBMap.clearMarkAndOverlays(); | ||
| 353 | + // 允许覆盖物在map.clearOverlays方法中被清除。(自 1.1 新增) | ||
| 354 | + polyUpline.enableMassClear(); | ||
| 355 | + // 开启线路编辑 | ||
| 356 | + polyUpline.enableEditing(); | ||
| 357 | + // 添加双击折线保存事件 | ||
| 358 | + polyUpline.addEventListener('dblclick',function(e) { | ||
| 359 | + // 关闭 | ||
| 360 | + layer.closeAll(); | ||
| 361 | + polyUpline.disableEditing(); | ||
| 362 | + // 获取折线坐标集合 | ||
| 363 | + var editPloyLineArray = polyUpline.getPath(); | ||
| 364 | + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | ||
| 365 | + polyUpline= ''; | ||
| 366 | + // 加载修改路段弹出层mobal页面 | ||
| 367 | + $.get('editsection.html', function(m){ | ||
| 368 | + $(pjaxContainer).append(m); | ||
| 369 | + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]); | ||
| 370 | + }); | ||
| 371 | + }); | ||
| 372 | + }, | ||
| 373 | + | ||
| 374 | + // 画圆 | ||
| 375 | + pointsCircle : function(objStation) { | ||
| 376 | + | ||
| 377 | + // 将视图切换到指定的缩放等级,中心点坐标不变。注意:当有信息窗口在地图上打开时,地图缩放将保证信息窗口所在的坐标位置不动。(自1.2新增) | ||
| 378 | + mapBValue.setZoom(16); | ||
| 379 | + | ||
| 380 | + if(objStation) { | ||
| 381 | + | ||
| 382 | + // 清除地图覆盖物 | ||
| 383 | + mapBValue.clearOverlays(); | ||
| 384 | + | ||
| 385 | + // 获取中心坐标点字符串分割 | ||
| 386 | + var BJwpoints = objStation.stationBJwpoints.split(' '); | ||
| 387 | + | ||
| 388 | + // 中心坐标点 | ||
| 389 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | ||
| 390 | + | ||
| 391 | + //创建圆 | ||
| 392 | + circle = new BMap.Circle(point,objStation.stationRadius,{strokeColor:"blue", strokeWeight:2, strokeOpacity:0.5}); | ||
| 393 | + | ||
| 394 | + // 允许覆盖物在map.clearOverlays方法中被清除 | ||
| 395 | + circle.enableMassClear(); | ||
| 396 | + | ||
| 397 | + // 百度地图添加覆盖物圆 | ||
| 398 | + mapBValue.addOverlay(circle); | ||
| 399 | + | ||
| 400 | + // 信息窗口参数属性 | ||
| 401 | + var opts = { | ||
| 402 | + | ||
| 403 | + // 信息窗口宽度 | ||
| 404 | + width : 200, | ||
| 405 | + | ||
| 406 | + // 信息窗口高度 | ||
| 407 | + height : 450, | ||
| 408 | + | ||
| 409 | + // 信息窗位置偏移值。 | ||
| 410 | + offset: new BMap.Size(500,120), | ||
| 411 | + | ||
| 412 | + //标题 | ||
| 413 | + title : '<h4 style="color:#FFFFFF">'+objStation.stationStationName+'站详情</h4>', | ||
| 414 | + | ||
| 415 | + //设置不允许信窗发送短息 | ||
| 416 | + enableMessage : false, | ||
| 417 | + | ||
| 418 | + //是否开启点击地图关闭信息窗口 | ||
| 419 | + enableCloseOnClick : false, | ||
| 420 | + | ||
| 421 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | ||
| 422 | + enableAutoPan:false | ||
| 423 | + }; | ||
| 424 | + | ||
| 425 | + var markTypeStr = ''; | ||
| 426 | + | ||
| 427 | + if(objStation.stationRouteStationMark=='B') { | ||
| 428 | + | ||
| 429 | + markTypeStr='起点站'; | ||
| 430 | + | ||
| 431 | + }else if(objStation.stationRouteStationMark=='Z') { | ||
| 432 | + | ||
| 433 | + markTypeStr ='中途站'; | ||
| 434 | + | ||
| 435 | + | ||
| 436 | + }else if(objStation.stationRouteStationMark=='E') { | ||
| 437 | + | ||
| 438 | + markTypeStr='终点站'; | ||
| 439 | + | ||
| 440 | + } | ||
| 441 | + | ||
| 442 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | ||
| 443 | + '<span style="color:#DDD;font-size: 15px;">站点名称:' + objStation.stationStationName + '</span>' + | ||
| 444 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点编码:' + objStation.stationStationCod + '</span>' + | ||
| 445 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点序号:' + objStation.stationRouteStationRouteCode + '</span>' + | ||
| 446 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">站点类型:' + markTypeStr + '</span>' + | ||
| 447 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + objStation.stationBJwpoints + '</span>' + | ||
| 448 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站时间:' + objStation.stationRouteToTime + ' 分钟</span>' + | ||
| 449 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">到站距离:' + objStation.stationRouteDistances + ' 公里</span>' + | ||
| 450 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + objStation.stationRadius + '</span>' + | ||
| 451 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + objStation.stationRouteVersions + '</span>' + | ||
| 452 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD;'+ | ||
| 453 | + 'overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ | ||
| 454 | + objStation.stationRouteDescriptions +'" >说明/描述:' + objStation.stationRouteDescriptions + '</span>' ; | ||
| 455 | + | ||
| 456 | + // 创建信息窗口 | ||
| 457 | + var infoWindow_target = new BMap.InfoWindow(htm, opts); | ||
| 458 | + // 自定义标注物图片 | ||
| 459 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/cz.png',new BMap.Size(20, 20)); | ||
| 460 | + | ||
| 461 | + // 创建点 | ||
| 462 | + marker = new BMap.Marker(point,{icon : icon_target}); | ||
| 463 | + | ||
| 464 | + // 把标注添物加到地图上 | ||
| 465 | + mapBValue.addOverlay(marker); | ||
| 466 | + | ||
| 467 | + setTimeout(function(){ | ||
| 468 | + //开启信息窗口 | ||
| 469 | + marker.openInfoWindow(infoWindow_target,point); | ||
| 470 | + | ||
| 471 | + },100); | ||
| 472 | + | ||
| 473 | + // 是否在平移过程中禁止动画。(自1.2新增) | ||
| 474 | + var PanOptions_ ={noAnimation :true}; | ||
| 475 | + | ||
| 476 | + // 将地图的中心点更改为给定的点。 | ||
| 477 | + mapBValue.panTo(point,PanOptions_); | ||
| 478 | + | ||
| 479 | + mapBValue.panBy(10,-200,PanOptions_); | ||
| 480 | + | ||
| 481 | + // 添加标志物监听事件 | ||
| 482 | + marker.addEventListener("click",function() { | ||
| 483 | + | ||
| 484 | + //开启信息窗口 | ||
| 485 | + marker.openInfoWindow(infoWindow_target,point); | ||
| 486 | + | ||
| 487 | + }); | ||
| 488 | + | ||
| 489 | + } | ||
| 490 | + | ||
| 491 | + }, | ||
| 492 | + | ||
| 493 | + // 根据地理名称获取百度经纬度坐标 | ||
| 494 | + localSearchFromAdreesToPoint: function(Address,callback) { | ||
| 495 | + | ||
| 496 | + // 创建一个搜索类实例 | ||
| 497 | + var localSearch = new BMap.LocalSearch(mapBValue); | ||
| 498 | + | ||
| 499 | + // 检索完成后的回调函数。 | ||
| 500 | + localSearch.setSearchCompleteCallback(function (searchResult) { | ||
| 501 | + | ||
| 502 | + var resultPoints = ''; | ||
| 503 | + | ||
| 504 | + if(searchResult) { | ||
| 505 | + | ||
| 506 | + // 返回索引指定的结果。索引0表示第1条结果 | ||
| 507 | + var poi = searchResult.getPoi(0); | ||
| 508 | + | ||
| 509 | + if(poi) { | ||
| 510 | + | ||
| 511 | + //获取经度和纬度 | ||
| 512 | + resultPoints = poi.point.lng + ' ' + poi.point.lat; | ||
| 513 | + | ||
| 514 | + callback && callback(resultPoints); | ||
| 515 | + | ||
| 516 | + }else { | ||
| 517 | + | ||
| 518 | + callback && callback(false); | ||
| 519 | + | ||
| 520 | + } | ||
| 521 | + | ||
| 522 | + }else { | ||
| 523 | + | ||
| 524 | + callback && callback(false); | ||
| 525 | + } | ||
| 526 | + | ||
| 527 | + }); | ||
| 528 | + | ||
| 529 | + // 根据检索词发起检索。 | ||
| 530 | + localSearch.search(Address); | ||
| 531 | + | ||
| 532 | + }, | ||
| 533 | + | ||
| 534 | + // 编辑图形 | ||
| 535 | + editShapes : function(editStationName,stationShapesTypeV,mindex) { | ||
| 536 | + | ||
| 537 | + // 关闭信息窗口 | ||
| 538 | + marker.closeInfoWindow(); | ||
| 539 | + | ||
| 540 | + // 清除marker | ||
| 541 | + mapBValue.removeOverlay(marker); | ||
| 542 | + | ||
| 543 | + // 编辑圆 | ||
| 544 | + if(stationShapesTypeV =='r') { | ||
| 545 | + | ||
| 546 | + // 开启编辑功能 | ||
| 547 | + circle.enableEditing(); | ||
| 548 | + | ||
| 549 | + // 编辑圆监听事件 | ||
| 550 | + circle.addEventListener('dblclick',function() { | ||
| 551 | + | ||
| 552 | + // 关闭提示弹出层 | ||
| 553 | + layer.close(mindex); | ||
| 554 | + | ||
| 555 | + // 返回圆形的半径,单位为米。 | ||
| 556 | + var newRadius = circle.getRadius(); | ||
| 557 | + | ||
| 558 | + // 返回圆形的中心点坐标。 | ||
| 559 | + var newCenter = circle.getCenter().lng + ' ' + circle.getCenter().lat; | ||
| 560 | + | ||
| 561 | + var centre_New = [{potion:{lng:circle.getCenter().lng,lat:circle.getCenter().lat}}]; | ||
| 562 | + | ||
| 563 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | ||
| 564 | + EditStationObj.setEitdStationBJwpoints(newCenter); | ||
| 565 | + | ||
| 566 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | ||
| 567 | + EditStationObj.setEitdStationShapesType('r'); | ||
| 568 | + | ||
| 569 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | ||
| 570 | + EditStationObj.setEitdStationRadius(Math.round(newRadius)); | ||
| 571 | + | ||
| 572 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | ||
| 573 | + EditStationObj.setEitdBPolygonGrid(''); | ||
| 574 | + | ||
| 575 | + // 加载编辑页面 | ||
| 576 | + $.get('edit.html', function(m){ | ||
| 577 | + | ||
| 578 | + $(pjaxContainer).append(m); | ||
| 579 | + | ||
| 580 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap,GetAjaxData,EditStationObj,LineObj,PublicFunctions]); | ||
| 581 | + | ||
| 582 | + }); | ||
| 583 | + | ||
| 584 | + }); | ||
| 585 | + | ||
| 586 | + // 编辑多变行 | ||
| 587 | + }else if(stationShapesTypeV =='d') { | ||
| 588 | + | ||
| 589 | + // 开启编辑功能(自 1.1 新增) | ||
| 590 | + polygon.enableEditing(); | ||
| 591 | + | ||
| 592 | + // 添加多变行编辑事件 | ||
| 593 | + polygon.addEventListener('dblclick',function(e) { | ||
| 594 | + | ||
| 595 | + // 获取编辑的多边形对象 | ||
| 596 | + var edit_pointE = polygon; | ||
| 597 | + | ||
| 598 | + var edit_bPloygonGrid = ""; | ||
| 599 | + | ||
| 600 | + var editPolyGonLen_ = edit_pointE.getPath().length; | ||
| 601 | + | ||
| 602 | + for(var k =0;k<editPolyGonLen_;k++) { | ||
| 603 | + | ||
| 604 | + if(k==0) { | ||
| 605 | + | ||
| 606 | + edit_bPloygonGrid = edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 607 | + | ||
| 608 | + }else { | ||
| 609 | + | ||
| 610 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[k].lng + ' ' + edit_pointE.getPath()[k].lat; | ||
| 611 | + | ||
| 612 | + } | ||
| 613 | + | ||
| 614 | + } | ||
| 615 | + | ||
| 616 | + edit_bPloygonGrid = edit_bPloygonGrid + ',' + edit_pointE.getPath()[0].lng + ' ' + edit_pointE.getPath()[0].lat; | ||
| 617 | + | ||
| 618 | + // 多边形中心点 | ||
| 619 | + var centre_points = edit_pointE.getBounds().getCenter().lng + ' ' + edit_pointE.getBounds().getCenter().lat; | ||
| 620 | + | ||
| 621 | + /** 设置修改站点集合对象站点中心点百度坐标属性值 @param:<bJwpoints:中心点百度坐标) */ | ||
| 622 | + EditStationObj.setEitdStationBJwpoints(centre_points); | ||
| 623 | + | ||
| 624 | + /** 设置修改站点集合对象范围图形类型属性值 @param:<shapesType:范围图形类型) */ | ||
| 625 | + EditStationObj.setEitdStationShapesType('d'); | ||
| 626 | + | ||
| 627 | + /** 设置修改站点集合对象圆形半径属性值 @param:<radius:圆形半径) */ | ||
| 628 | + EditStationObj.setEitdStationRadius(''); | ||
| 629 | + | ||
| 630 | + /** 设置修改站点集合对象图形百度坐标集合属性值 @param:<bPolygonGrid:图形百度坐标集合) */ | ||
| 631 | + EditStationObj.setEitdBPolygonGrid(edit_bPloygonGrid); | ||
| 632 | + | ||
| 633 | + $.get('edit.html', function(m){ | ||
| 634 | + | ||
| 635 | + $(pjaxContainer).append(m); | ||
| 636 | + | ||
| 637 | + $('#edit_station_mobal').trigger('editSelectMobal_show', [WorldsBMap,GetAjaxData,EditStationObj,LineObj,PublicFunctions]); | ||
| 638 | + | ||
| 639 | + }); | ||
| 640 | + | ||
| 641 | + }); | ||
| 642 | + | ||
| 643 | + } | ||
| 644 | + | ||
| 645 | + }, | ||
| 646 | + | ||
| 647 | + // 在地图上画出上行线路走向 | ||
| 648 | + drawingUpline : function (polylineArray,polyline_center,data) { | ||
| 649 | + /*WorldsBMap.clearMarkAndOverlays();*/ | ||
| 650 | + polyUpline = ''; | ||
| 651 | + // 创建线路走向 | ||
| 652 | + polyUpline = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | ||
| 653 | + // polyUpline.data = data; | ||
| 654 | + // 把折线添加到地图上 | ||
| 655 | + mapBValue.addOverlay(polyUpline); | ||
| 656 | + /*var ceter_index = Math.round(resultdata.length / 2); | ||
| 657 | + | ||
| 658 | + var ceterPointsStr = resultdata[ceter_index].bJwpoints; | ||
| 659 | + | ||
| 660 | + var ceterPointsArray = ceterPointsStr.split(' '); | ||
| 661 | + | ||
| 662 | + var polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]);*/ | ||
| 663 | + var PanOptions_ ={noAnimation :true}; | ||
| 664 | + mapBValue.reset(); | ||
| 665 | + mapBValue.panTo(polyline_center,PanOptions_); | ||
| 666 | + mapBValue.panBy(500,-510,PanOptions_); | ||
| 667 | + mapBValue.setZoom(14); | ||
| 668 | + }, | ||
| 669 | + | ||
| 670 | + //在地图上画出公交位置。 | ||
| 671 | + drawingBus :function(lon,lat){ | ||
| 672 | + var point = new BMap.Point(lon,lat); | ||
| 673 | + var myIcon = new BMap.Icon("/pages/excep/img/bus.png", new BMap.Size(300,157)); | ||
| 674 | + var marker = new BMap.Marker(point,{icon:myIcon}); // 创建标注 | ||
| 675 | + mapBValue.addOverlay(marker); | ||
| 676 | + marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画 | ||
| 677 | + }, | ||
| 678 | + | ||
| 679 | + // 在地图上画出上行线路走向 | ||
| 680 | + drawingUpline01 : function (polylineArray,polyline_center,data) { | ||
| 681 | + var polyUpline01 = 'polyline' + '_' + data.sectionrouteId; | ||
| 682 | + // 创建线路走向 | ||
| 683 | + polyUpline01 = new BMap.Polyline(polylineArray, {strokeColor : "blue",strokeWeight : 6,strokeOpacity : 0.5}); | ||
| 684 | + polyUpline01.data = data; | ||
| 685 | + // 把折线添加到地图上 | ||
| 686 | + mapBValue.addOverlay(polyUpline01); | ||
| 687 | + polyUpline01.addEventListener('click',function(e) { | ||
| 688 | + if(WorldsBMap.getIsEditStatus()) { | ||
| 689 | + layer.msg('请先保存正在编辑的路段信息...'); | ||
| 690 | + return false; | ||
| 691 | + } | ||
| 692 | + polyUpline01.enableEditing(); | ||
| 693 | + WorldsBMap.setIsEditStatus(true); | ||
| 694 | + }); | ||
| 695 | + // 添加双击折线保存事件 | ||
| 696 | + polyUpline01.addEventListener('dblclick',function(e) { | ||
| 697 | + WorldsBMap.setIsEditStatus(false); | ||
| 698 | + // 关闭 | ||
| 699 | + layer.closeAll(); | ||
| 700 | + polyUpline01.disableEditing(); | ||
| 701 | + EditSectionObj.setEitdSection(polyUpline01.data); | ||
| 702 | + // 获取折线坐标集合 | ||
| 703 | + var editPloyLineArray = polyUpline01.getPath(); | ||
| 704 | + EditSectionObj.setEitdBsectionVector(JSON.stringify(editPloyLineArray)); | ||
| 705 | + // polyUpline= ''; | ||
| 706 | + // 加载修改路段弹出层mobal页面 | ||
| 707 | + $.get('editsection.html', function(m){ | ||
| 708 | + $(pjaxContainer).append(m); | ||
| 709 | + $('#edit_section_mobal').trigger('editSectionMobal_show', [WorldsBMap,GetAjaxData,EditSectionObj,PublicFunctions]); | ||
| 710 | + }); | ||
| 711 | + }); | ||
| 712 | + var PanOptions_ ={noAnimation :true}; | ||
| 713 | + mapBValue.reset(); | ||
| 714 | + mapBValue.panTo(polyline_center,PanOptions_); | ||
| 715 | + mapBValue.panBy(500,-510,PanOptions_); | ||
| 716 | + mapBValue.setZoom(14); | ||
| 717 | + }, | ||
| 718 | + | ||
| 719 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 720 | + drawingUpStationPoint : function(point_center,stationName,s) { | ||
| 721 | + | ||
| 722 | + // 自定义标注物图片 | ||
| 723 | + var icon_target = new BMap.Icon('/pages/base/stationroute/css/img/gjzd.png',new BMap.Size(10, 10)); | ||
| 724 | + | ||
| 725 | + var html2 = '<div style="position: absolute; margin: 0pt; padding: 0pt; width: 160px; height: 26px; left: -10px; top: -35px; overflow: hidden;">' | ||
| 726 | + + '<img class="rm3_image" style="border:none;left:0px; top:0px; position:absolute;" src="/pages/base/stationroute/css/img/back160.png">' | ||
| 727 | + + '</div>' | ||
| 728 | + + '<label class=" BMapLabel" unselectable="on" style="position: absolute; -moz-user-select: none; display: inline; cursor: inherit; border: 0px none; padding: 2px 1px 1px; white-space: nowrap; font: 12px arial,simsun; z-index: 80; color: rgb(255, 102, 0); left: 15px; top: -35px;"><span style="float: left; color: #fdfdfd; margin-left: -22px; font-size: 6px;">'+ s+'</span>'+ stationName+'</label>'; | ||
| 729 | + | ||
| 730 | + | ||
| 731 | + var myRichMarker1 = new BMapLib.RichMarker(html2, point_center,{ | ||
| 732 | + "anchor" : new BMap.Size(-10,8), | ||
| 733 | + "enableDragging" : true}); | ||
| 734 | + | ||
| 735 | + | ||
| 736 | + myRichMarker1.disableDragging(); | ||
| 737 | + mapBValue.addOverlay(myRichMarker1); | ||
| 738 | + | ||
| 739 | + | ||
| 740 | + // 创建标注物 | ||
| 741 | + marker = new BMap.Marker(point_center,{icon : icon_target}); | ||
| 742 | + | ||
| 743 | + // 允许覆盖物在map.clearOverlays方法中被清除。 | ||
| 744 | + marker.enableMassClear(); | ||
| 745 | + | ||
| 746 | + mapBValue.addOverlay(marker); | ||
| 747 | + }, | ||
| 748 | + | ||
| 749 | + // 站点名称获取百度坐标(手动规划) | ||
| 750 | + stationsNameToPoints : function(arra,callback) { | ||
| 751 | + // 获取长度 | ||
| 752 | + var len = arra.length; | ||
| 753 | + var stationList = []; | ||
| 754 | + (function(){ | ||
| 755 | + if (!arguments.callee.count) { | ||
| 756 | + arguments.callee.count = 0; | ||
| 757 | + } | ||
| 758 | + arguments.callee.count++; | ||
| 759 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 760 | + if (index >= len) { | ||
| 761 | + callback && callback(stationList); | ||
| 762 | + return ; | ||
| 763 | + } | ||
| 764 | + var f = arguments.callee; | ||
| 765 | + if(arra[index].name!=''){ | ||
| 766 | + var localSearch = new BMap.LocalSearch(mapBValue); | ||
| 767 | + localSearch.search(arra[index].name); | ||
| 768 | + localSearch.setSearchCompleteCallback(function (searchResult) { | ||
| 769 | + var poi = searchResult.getPoi(0); | ||
| 770 | + if(poi) { | ||
| 771 | + stationList.push({name:arra[index].name.replace('公交车站',''),wgs:arra[index].wgs,potion:{lng:poi.point.lng,lat:poi.point.lat}}); | ||
| 772 | + }else { | ||
| 773 | + stationList.push({name:arra[index].name.replace('公交车站',''),wgs:arra[index].wgs,potion:{lng:arra[index].wgs.x,lat:arra[index].wgs.y}}); | ||
| 774 | + } | ||
| 775 | + f(); | ||
| 776 | + }); | ||
| 777 | + }else { | ||
| 778 | + f(); | ||
| 779 | + } | ||
| 780 | + })(); | ||
| 781 | + }, | ||
| 782 | + | ||
| 783 | + // 根据坐标点获取两点之间的时间与距离(手动规划) | ||
| 784 | + getDistanceAndTotime : function(stationList,cb) { | ||
| 785 | + | ||
| 786 | + stationList[0].distance = ''; | ||
| 787 | + | ||
| 788 | + stationList[0].duration = ''; | ||
| 789 | + | ||
| 790 | + // var sectionList = []; | ||
| 791 | + | ||
| 792 | + // 获取长度 | ||
| 793 | + var len = stationList.length; | ||
| 794 | + | ||
| 795 | + (function(){ | ||
| 796 | + | ||
| 797 | + if (!arguments.callee.count) { | ||
| 798 | + | ||
| 799 | + arguments.callee.count = 0; | ||
| 800 | + | ||
| 801 | + } | ||
| 802 | + | ||
| 803 | + arguments.callee.count++; | ||
| 804 | + | ||
| 805 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 806 | + | ||
| 807 | + if (index >= len-1) { | ||
| 808 | + | ||
| 809 | + // cb && cb(stationList,sectionList); | ||
| 810 | + cb && cb(stationList); | ||
| 811 | + return; | ||
| 812 | + } | ||
| 813 | + | ||
| 814 | + var f = arguments.callee; | ||
| 815 | + | ||
| 816 | + var poiOne = new BMap.Point(stationList[index].potion.lng,stationList[index].potion.lat); | ||
| 817 | + | ||
| 818 | + var poiTwo = new BMap.Point(stationList[index+1].potion.lng,stationList[index+1].potion.lat); | ||
| 819 | + | ||
| 820 | + var transit = new BMap.TransitRoute(mapBValue, {renderOptions: {map: mapBValue},onSearchComplete: searchComplete}); | ||
| 821 | + | ||
| 822 | + transit.search(poiOne,poiTwo); | ||
| 823 | + | ||
| 824 | + function searchComplete(results){ | ||
| 825 | + | ||
| 826 | + var plan = results.getPlan(0); | ||
| 827 | + | ||
| 828 | + if (transit.getStatus() != BMAP_STATUS_SUCCESS){ | ||
| 829 | + | ||
| 830 | + stationList[index+1].distance = ''; | ||
| 831 | + | ||
| 832 | + stationList[index+1].duration = ''; | ||
| 833 | + | ||
| 834 | + // sectionList.push({sectionName:stationList[index].name+stationList[index+1].name,points:''}); | ||
| 835 | + | ||
| 836 | + }else { | ||
| 837 | + | ||
| 838 | + stationList[index+1].distance = plan.getDistance(true); | ||
| 839 | + | ||
| 840 | + stationList[index+1].duration = plan.getDuration(true); | ||
| 841 | + | ||
| 842 | + // var line = plan.getRoute(0); | ||
| 843 | + | ||
| 844 | + // sectionList.push({sectionName:stationList[index].name+stationList[index+1].name,points:line.getPath()}); | ||
| 845 | + | ||
| 846 | + } | ||
| 847 | + | ||
| 848 | + f(); | ||
| 849 | + } | ||
| 850 | + | ||
| 851 | + })(); | ||
| 852 | + | ||
| 853 | + }, | ||
| 854 | + | ||
| 855 | + // 根据坐标点获取两点之间的折线路段(手动规划) | ||
| 856 | + getSectionListPlonly : function(stationsPoint,cb) { | ||
| 857 | + | ||
| 858 | + var len = stationsPoint.length; | ||
| 859 | + | ||
| 860 | + var sectionList = []; | ||
| 861 | + | ||
| 862 | + (function(){ | ||
| 863 | + | ||
| 864 | + if (!arguments.callee.count) { | ||
| 865 | + | ||
| 866 | + arguments.callee.count = 0; | ||
| 867 | + | ||
| 868 | + } | ||
| 869 | + | ||
| 870 | + arguments.callee.count++; | ||
| 871 | + | ||
| 872 | + var index = parseInt(arguments.callee.count) - 1; | ||
| 873 | + | ||
| 874 | + if (index >= len-1 ) { | ||
| 875 | + | ||
| 876 | + cb && cb(sectionList); | ||
| 877 | + return; | ||
| 878 | + } | ||
| 879 | + | ||
| 880 | + var f = arguments.callee; | ||
| 881 | + | ||
| 882 | + var poiOne = new BMap.Point(stationsPoint[index].potion.lng,stationsPoint[index].potion.lat); | ||
| 883 | + | ||
| 884 | + var poiTwo = new BMap.Point(stationsPoint[index+1].potion.lng,stationsPoint[index+1].potion.lat); | ||
| 885 | + | ||
| 886 | + /* var transit = new BMap.TransitRoute(mapB, {renderOptions: {map: mapB},onPolylinesSet: searchPolylinesSet});*/ | ||
| 887 | + | ||
| 888 | + var transit = new BMap.DrivingRoute(mapBValue, {renderOptions: {map: mapBValue},onPolylinesSet: searchPolylinesSet}); | ||
| 889 | + | ||
| 890 | + function searchPolylinesSet(results){ | ||
| 891 | + | ||
| 892 | + if (transit.getStatus() != BMAP_STATUS_SUCCESS){ | ||
| 893 | + | ||
| 894 | + | ||
| 895 | + }else { | ||
| 896 | + | ||
| 897 | + var sectionArrayList = []; | ||
| 898 | + for (i = 0; i < results.length; i++){ | ||
| 899 | + | ||
| 900 | + // console.log(results[i].getPolyline().getPath()); | ||
| 901 | + sectionArrayList = sectionArrayList.concat(results[i].getPolyline().getPath()); | ||
| 902 | + | ||
| 903 | + } | ||
| 904 | + | ||
| 905 | + var sectionName = stationsPoint[index].name + '至' + stationsPoint[index+1].name; | ||
| 906 | + | ||
| 907 | + sectionList.push({sectionName:sectionName,points:sectionArrayList}); | ||
| 908 | + | ||
| 909 | + } | ||
| 910 | + | ||
| 911 | + f(); | ||
| 912 | + } | ||
| 913 | + | ||
| 914 | + transit.search(poiOne,poiTwo); | ||
| 915 | + | ||
| 916 | + })(); | ||
| 917 | + | ||
| 918 | + }, | ||
| 919 | + | ||
| 920 | + localtionPoint : function(stationNameV) { | ||
| 921 | + | ||
| 922 | + WorldsBMap.localSearchFromAdreesToPoint(stationNameV,function(Points) { | ||
| 923 | + | ||
| 924 | + if(Points) { | ||
| 925 | + | ||
| 926 | + var BJwpointsArray = Points.split(' '); | ||
| 927 | + | ||
| 928 | + var stationNameChangePoint = new BMap.Point(BJwpointsArray[0], BJwpointsArray[1]); | ||
| 929 | + | ||
| 930 | + var marker_stargt2 = new BMap.Marker(stationNameChangePoint); | ||
| 931 | + | ||
| 932 | + var PanOptions ={noAnimation :true}; | ||
| 933 | + | ||
| 934 | + mapBValue.panTo(stationNameChangePoint,PanOptions); | ||
| 935 | + | ||
| 936 | + mapBValue.panBy(0,-100); | ||
| 937 | + | ||
| 938 | + // 将标注添加到地图中 | ||
| 939 | + mapBValue.addOverlay(marker_stargt2); | ||
| 940 | + | ||
| 941 | + //跳动的动画 | ||
| 942 | + marker_stargt2.setAnimation(BMAP_ANIMATION_BOUNCE); | ||
| 943 | + | ||
| 944 | + } | ||
| 945 | + | ||
| 946 | + }); | ||
| 947 | + | ||
| 948 | + }, | ||
| 949 | + | ||
| 950 | + /** 系统规划抓去数据 @param lineNameValue:线路名称;i:方向*/ | ||
| 951 | + getBmapStationNames : function(lineNameValue,i,callback) { | ||
| 952 | + | ||
| 953 | + var busline = new BMap.BusLineSearch(mapBValue,{ | ||
| 954 | + | ||
| 955 | + // 设置公交列表查询后的回调函数。参数:rs: BusListResult类型 | ||
| 956 | + onGetBusListComplete:function(BusListResult) { | ||
| 957 | + | ||
| 958 | + // 如果不为空 | ||
| 959 | + if(BusListResult){ | ||
| 960 | + | ||
| 961 | + //获取第一个公交列表显示到map上 | ||
| 962 | + var fstLine = BusListResult.getBusListItem(i); | ||
| 963 | + | ||
| 964 | + /*if(fstLine==undefined){ | ||
| 965 | + | ||
| 966 | + layer.confirm('系统无法生成该线路【'+lineNameValue+'】的站点与路段!请点击返回选择其它方式规划', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ | ||
| 967 | + | ||
| 968 | + layer.closeAll(); | ||
| 969 | + | ||
| 970 | + if(i==0){ | ||
| 971 | + | ||
| 972 | + $('#upToolsMobal').show(); | ||
| 973 | + | ||
| 974 | + }else if(i==1){ | ||
| 975 | + | ||
| 976 | + $('#downToolsMobal').show(); | ||
| 977 | + | ||
| 978 | + } | ||
| 979 | + | ||
| 980 | + return; | ||
| 981 | + }); | ||
| 982 | + | ||
| 983 | + }*/ | ||
| 984 | + | ||
| 985 | + if(fstLine==undefined){ | ||
| 986 | + | ||
| 987 | + | ||
| 988 | + callback && callback(null); | ||
| 989 | + | ||
| 990 | + } | ||
| 991 | + | ||
| 992 | + busline.getBusLine(fstLine); | ||
| 993 | + | ||
| 994 | + } | ||
| 995 | + | ||
| 996 | + }, | ||
| 997 | + | ||
| 998 | + //设置公交线路查询后的回调函数.参数:rs: BusLine类型 | ||
| 999 | + onGetBusLineComplete: function(BusLine){ | ||
| 1000 | + | ||
| 1001 | + // 如果不为空 | ||
| 1002 | + if(BusLine){ | ||
| 1003 | + | ||
| 1004 | + callback && callback(BusLine); | ||
| 1005 | + | ||
| 1006 | + } | ||
| 1007 | + | ||
| 1008 | + } | ||
| 1009 | + | ||
| 1010 | + }); | ||
| 1011 | + | ||
| 1012 | + busline.getBusList(lineNameValue); | ||
| 1013 | + | ||
| 1014 | + }, | ||
| 1015 | + | ||
| 1016 | + clearMarkAndOverlays : function() { | ||
| 1017 | + | ||
| 1018 | + // 清楚地图覆盖物 | ||
| 1019 | + mapBValue.clearOverlays(); | ||
| 1020 | + | ||
| 1021 | + mapBValue.removeOverlay(); | ||
| 1022 | + | ||
| 1023 | + } | ||
| 1024 | + | ||
| 1025 | + } | ||
| 1026 | + | ||
| 1027 | + return Bmap; | ||
| 1028 | + | ||
| 1029 | +}(); | ||
| 0 | \ No newline at end of file | 1030 | \ No newline at end of file |
src/main/resources/static/pages/excep/js/outboundline.js
0 → 100644
| 1 | +/** | ||
| 2 | + * 线路类 | ||
| 3 | + * | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +var LineObj = function () { | ||
| 7 | + | ||
| 8 | + /** 定义线路对象 */ | ||
| 9 | + | ||
| 10 | + var line={}; | ||
| 11 | + | ||
| 12 | + var lineObj = { | ||
| 13 | + | ||
| 14 | + /** 初始化线路对象属性值 */ | ||
| 15 | + init : function(id) { | ||
| 16 | + // 线路Id | ||
| 17 | + line.id = id; | ||
| 18 | + return line; | ||
| 19 | + }, | ||
| 20 | + | ||
| 21 | + /** 获取线路对象 @return:<line:线路对象> */ | ||
| 22 | + getLineObj : function() { | ||
| 23 | + | ||
| 24 | + return line; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + return lineObj; | ||
| 30 | + | ||
| 31 | +}(); | ||
| 0 | \ No newline at end of file | 32 | \ No newline at end of file |
src/main/resources/static/pages/excep/js/outboundmap-function.js
0 → 100644
| 1 | +/** | ||
| 2 | + * 函数 | ||
| 3 | + * | ||
| 4 | + * - - - - - - - 》 getCurrSelNode : 获取选中树节点数据函数 | ||
| 5 | + * | ||
| 6 | + * - - - - - - - 》 resjtreeDate : 刷新树函数函数 | ||
| 7 | + * | ||
| 8 | + * - - - - - - - 》 setFormInputValue : 新增站点参数集合赋值函数 | ||
| 9 | + * | ||
| 10 | + * - - - - - - - 》 editSetStationParmas : 编辑站点参数集合赋值函数 | ||
| 11 | + * | ||
| 12 | + * - - - - - - - 》 editSeteditStationParmasValue:编辑站点范围图形参数集合赋值函数 | ||
| 13 | + * | ||
| 14 | + * - - - - - - - 》 lineNameIsHaveInterval : 系统规划时修正线路名称 | ||
| 15 | + * | ||
| 16 | + * - - - - - - - 》 systemLineStation:系统规划保存函数 | ||
| 17 | + * | ||
| 18 | + * - - - - - - - 》 stationRevoke :撤销站点 | ||
| 19 | + * | ||
| 20 | + * - - - - - - - 》 editLinePlan :编辑线路走向 | ||
| 21 | + * | ||
| 22 | + * - - - - - - - 》 setFormValue :编辑站点设置表单元素值 | ||
| 23 | + * | ||
| 24 | + * - - - - - - - 》 eachSectionList:路段折线百度坐标转WGS坐标 | ||
| 25 | + */ | ||
| 26 | + | ||
| 27 | +var lon = longitude; | ||
| 28 | +var lat = latitude; | ||
| 29 | + | ||
| 30 | +var PublicFunctions = function () { | ||
| 31 | + var PubFun = { | ||
| 32 | + /** 初始化线路标题与ID */ | ||
| 33 | + setTiteText : function(lineId) { | ||
| 34 | + // 根据线路ID获取线路名称 | ||
| 35 | + GetAjaxData.getIdLineName(lineId,function(data) { | ||
| 36 | + // 定义线路名称 | ||
| 37 | + var lineNameV = data.name; | ||
| 38 | + $('.portlet-title .caption').text(lineNameV); | ||
| 39 | + }); | ||
| 40 | + }, | ||
| 41 | + /** @param diraction 方向 @return array */ | ||
| 42 | + getCurrSelNode : function(diraction){ | ||
| 43 | + // 定义Obj | ||
| 44 | + var array = []; | ||
| 45 | + try { | ||
| 46 | + // 上行 | ||
| 47 | + if(diraction=='0'){ | ||
| 48 | + // 获取上行选中节点 | ||
| 49 | + array = $.jstree.reference("#station_Up_tree").get_selected(true); | ||
| 50 | + // 下行 | ||
| 51 | + }else if(diraction=='1'){ | ||
| 52 | + // 获取下行选中节点 | ||
| 53 | + array = $.jstree.reference("#station_Down_tree").get_selected(true); | ||
| 54 | + } | ||
| 55 | + } catch (e) { | ||
| 56 | + console.log(e); | ||
| 57 | + } | ||
| 58 | + // 返回Obj | ||
| 59 | + return array; | ||
| 60 | + }, | ||
| 61 | + /** @param id:线路ID ;directionData:方向 */ | ||
| 62 | + resjtreeDate : function(id,directionData){ | ||
| 63 | + // 获取树数据 | ||
| 64 | + GetAjaxData.getStation(id,directionData,function(treeDateJson) { | ||
| 65 | + // 获取数据长度 | ||
| 66 | + var len = treeDateJson[0].children[0].children.length; | ||
| 67 | + // 上行 | ||
| 68 | + if(directionData==0){ | ||
| 69 | + // 长度大于零 | ||
| 70 | + if(len>0) { | ||
| 71 | + // 隐藏上行规划 | ||
| 72 | + $('#upToolsMobal').hide(); | ||
| 73 | + // 显示树 | ||
| 74 | + $('#uptreeMobal').show(); | ||
| 75 | + // 刷新树 | ||
| 76 | + StationTreeData.upreloadeTree(treeDateJson); | ||
| 77 | + }else { | ||
| 78 | + // 显示上行规划 | ||
| 79 | + $('#upToolsMobal').show(); | ||
| 80 | + // 隐藏上行树 | ||
| 81 | + $('#uptreeMobal').hide(); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + // 下行 | ||
| 85 | + }else if(directionData==1){ | ||
| 86 | + // 如果长度大于 | ||
| 87 | + if(len>0) { | ||
| 88 | + // 隐藏下行规划 | ||
| 89 | + $('#downToolsMobal').hide(); | ||
| 90 | + // 显示下行树 | ||
| 91 | + $('#DowntreeMobal').show(); | ||
| 92 | + // 跟新树 | ||
| 93 | + StationTreeData.dwonreloadeTree(treeDateJson); | ||
| 94 | + }else { | ||
| 95 | + // 显示下行规划 | ||
| 96 | + $('#downToolsMobal').show(); | ||
| 97 | + // 隐藏下行树 | ||
| 98 | + $('#DowntreeMobal').hide(); | ||
| 99 | + } | ||
| 100 | + } | ||
| 101 | + }); | ||
| 102 | + }, | ||
| 103 | + | ||
| 104 | + /** 修正线路名称 @param:<directionUpValue:方向(0:上行;1:下行)> */ | ||
| 105 | + lineNameIsHaveInterval : function(directionData) { | ||
| 106 | + // 定义线路名称 | ||
| 107 | + var lineNameV = $('.portlet-title .caption').text(); | ||
| 108 | + // 线路名称是否为区间线路 | ||
| 109 | + if(lineNameV.indexOf('区间')>0){ | ||
| 110 | + // 截去区间 | ||
| 111 | + var lineNameNew = lineNameV.replace('区间',''); | ||
| 112 | + // 是否继续弹出层 | ||
| 113 | + layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', { | ||
| 114 | + btn : [ '确认提示并提交', '取消' ] | ||
| 115 | + }, function(index) { | ||
| 116 | + // 关闭弹出层 | ||
| 117 | + layer.close(index); | ||
| 118 | + // 线路名称去掉区间 | ||
| 119 | + lineNameV = lineNameNew; | ||
| 120 | + /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 121 | + PublicFunctions.systemLineStation(lineNameV,directionData); | ||
| 122 | + },function(){ | ||
| 123 | + // 关闭弹出层 | ||
| 124 | + layer.closeAll(); | ||
| 125 | + // 上行 | ||
| 126 | + if(directionData==0){ | ||
| 127 | + // 显示上行规划 | ||
| 128 | + $('#upToolsMobal').show(); | ||
| 129 | + // 下行 | ||
| 130 | + }else if(directionData==1){ | ||
| 131 | + // 显示下行规划 | ||
| 132 | + $('#downToolsMobal').show(); | ||
| 133 | + } | ||
| 134 | + }); | ||
| 135 | + | ||
| 136 | + // 线路名称是否为定班线路 | ||
| 137 | + }else if(lineNameV.indexOf('定班')>0){ | ||
| 138 | + // 截去定班 | ||
| 139 | + var lineNameNew = lineNameV.replace('定班',''); | ||
| 140 | + // 是否继续弹出层 | ||
| 141 | + layer.confirm('系统无法生成该线路【'+lineNameV+'】的站点与路段!自动修改为如下线路名称【'+lineNameNew+'】生成', { | ||
| 142 | + btn : [ '确认提示并提交', '取消' ] | ||
| 143 | + }, function(index) { | ||
| 144 | + // 关闭弹出层 | ||
| 145 | + layer.close(index); | ||
| 146 | + // 线路名称去掉区间 | ||
| 147 | + lineNameV = lineNameNew; | ||
| 148 | + /** 保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 149 | + PublicFunctions.systemLineStation(lineNameV,directionData); | ||
| 150 | + },function(){ | ||
| 151 | + // 关闭弹出层 | ||
| 152 | + layer.closeAll(); | ||
| 153 | + // 上行 | ||
| 154 | + if(directionData==0){ | ||
| 155 | + // 显示上行规划 | ||
| 156 | + $('#upToolsMobal').show(); | ||
| 157 | + // 下行 | ||
| 158 | + }else if(directionData==1){ | ||
| 159 | + // 显示下行规划 | ||
| 160 | + $('#downToolsMobal').show(); | ||
| 161 | + } | ||
| 162 | + }); | ||
| 163 | + }else { | ||
| 164 | + /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 165 | + PublicFunctions.systemLineStation(lineNameV,directionData); | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + }, | ||
| 169 | + | ||
| 170 | + /** 直接保存 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行)> */ | ||
| 171 | + systemLineStation : function(lineNameV,directionData) { | ||
| 172 | + /** 从百度地图获取线路信息 @param:<lineNameV:线路名称;directionData:方向(0:上行;1:下行);callback>*/ | ||
| 173 | + WorldsBMap.lineInfoPanl(lineNameV,directionData,function(BusLine){ | ||
| 174 | + // 如果线路信息不为空 | ||
| 175 | + if(BusLine) { | ||
| 176 | + /*if(BusLine.zB.length == 0){ | ||
| 177 | + | ||
| 178 | + layer.confirm('系统生成该线路【'+lineNameV+'】时获取站点与路段异常!请联系管理员或者检查网络连接是否异常!', { | ||
| 179 | + btn : [ '确认' ] | ||
| 180 | + }, function(index) { | ||
| 181 | + | ||
| 182 | + // 关闭弹出层 | ||
| 183 | + layer.closeAll(); | ||
| 184 | + | ||
| 185 | + // 上行 | ||
| 186 | + if(directionData==0){ | ||
| 187 | + | ||
| 188 | + // 显示上行规划 | ||
| 189 | + $('#upToolsMobal').show(); | ||
| 190 | + | ||
| 191 | + // 下行 | ||
| 192 | + }else if(directionData==1){ | ||
| 193 | + | ||
| 194 | + // 显示下行规划 | ||
| 195 | + $('#downToolsMobal').show(); | ||
| 196 | + | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + return ; | ||
| 200 | + }); | ||
| 201 | + | ||
| 202 | + }*/ | ||
| 203 | + // 获取公交线几何对象, 仅当结果自动添加到地图上时有效 | ||
| 204 | + var Polygon = BusLine.getPolyline(); | ||
| 205 | + // 返回多边型的点数组(自1.2新增) | ||
| 206 | + var polyGonArray = Polygon.getPath(); | ||
| 207 | + // 获取公交站点个数(自 1.2 新增) | ||
| 208 | + var stationNumber = BusLine.getNumBusStations(); | ||
| 209 | + // 定义线路信息集合 | ||
| 210 | + var stationInfo = []; | ||
| 211 | + // 遍历 | ||
| 212 | + for(var k = 0 ; k < stationNumber; k++) { | ||
| 213 | + // 定义线路信息集合 | ||
| 214 | + var tempM = {}; | ||
| 215 | + // 添加站点名称 | ||
| 216 | + tempM.name = BusLine.getBusStation(k).name; | ||
| 217 | + // 添加站点坐标 | ||
| 218 | + tempM.potion = BusLine.getBusStation(k).position; | ||
| 219 | + tempM.wgs = {x:'',y:''}; | ||
| 220 | + // 添加 | ||
| 221 | + stationInfo.push(tempM); | ||
| 222 | + } | ||
| 223 | + // 获取站点之间的距离与时间 | ||
| 224 | + WorldsBMap.getDistanceAndDuration(stationInfo,function(json) { | ||
| 225 | + // 设置第一个站的距离 | ||
| 226 | + json[0].distance = ''; | ||
| 227 | + // 设置第一个站的时间 | ||
| 228 | + json[0].duration = ''; | ||
| 229 | + // 定义站点信息JSON字符串 | ||
| 230 | + var stationJSON = JSON.stringify(json); | ||
| 231 | + // 定义路段信息字符串 | ||
| 232 | + var sectionJSON = JSON.stringify(polyGonArray); | ||
| 233 | + // 参数集合 | ||
| 234 | + var params = {}; | ||
| 235 | + // 站点信息JSON字符串 | ||
| 236 | + params.stationJSON = stationJSON; | ||
| 237 | + var addLine = LineObj.getLineObj(); | ||
| 238 | + // 线路ID | ||
| 239 | + params.lineId = addLine.id; | ||
| 240 | + // 方向 | ||
| 241 | + params.directions = directionData; | ||
| 242 | + // 原始坐标类型 | ||
| 243 | + params.dbType = 'b'; | ||
| 244 | + // 圆形半径 | ||
| 245 | + params.radius = '100'; | ||
| 246 | + // 图形类型(r:圆形;p:多边形) | ||
| 247 | + params.shapesType = 'r'; | ||
| 248 | + // destroy:是否撤销 | ||
| 249 | + params.destroy = '0'; | ||
| 250 | + // versions:版本号 | ||
| 251 | + params.versions = '1'; | ||
| 252 | + // 路段信息JSON字符串 | ||
| 253 | + params.sectionJSON = sectionJSON; | ||
| 254 | + // 限速 | ||
| 255 | + params.speedLimit = '60'; | ||
| 256 | + params.baseRes = 'No'; | ||
| 257 | + // 保存 | ||
| 258 | + GetAjaxData.collectionSave(params,function(rd) { | ||
| 259 | + if(rd.status='SUCCESS') { | ||
| 260 | + // 关闭弹出层 | ||
| 261 | + layer.closeAll(); | ||
| 262 | + layer.msg('保存成功!'); | ||
| 263 | + }else { | ||
| 264 | + // 保存失败 | ||
| 265 | + layer.msg('保存失败!'); | ||
| 266 | + } | ||
| 267 | + // 刷新树 | ||
| 268 | + PublicFunctions.resjtreeDate(addLine.id,directionData); | ||
| 269 | + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | ||
| 270 | + GetAjaxData.getSectionRouteInfo(addLine.id,directionData,function(data) { | ||
| 271 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 272 | + PublicFunctions.linePanlThree(addLine.id,data,directionData); | ||
| 273 | + }); | ||
| 274 | + }); | ||
| 275 | + | ||
| 276 | + }); | ||
| 277 | + } | ||
| 278 | + }); | ||
| 279 | + }, | ||
| 280 | + | ||
| 281 | + /** @param directionV_ :方向 */ | ||
| 282 | + stationRevoke : function(directionV_) { | ||
| 283 | + // 获取树选中节点对象 | ||
| 284 | + var obj = PublicFunctions.getCurrSelNode(directionV_); | ||
| 285 | + // 是否选中,选中节点是否为站点 | ||
| 286 | + if(obj.length == 0 || obj[0].original.chaildredType !='station'){ | ||
| 287 | + // 弹出提示层 | ||
| 288 | + layer.msg('请先选择要删除的站点!'); | ||
| 289 | + return; | ||
| 290 | + } | ||
| 291 | + // 弹出是否撤销提示框 | ||
| 292 | + layer.confirm('你确定要撤销【'+obj[0].text+'】站点吗?', {btn : [ '确定撤销','返回' ],icon: 3, title:'提示' }, function(index){ | ||
| 293 | + // 站点路由ID | ||
| 294 | + var stationRouteId = obj[0].original.stationRouteId; | ||
| 295 | + // 撤销参数集合 | ||
| 296 | + var params = {stationRouteId:stationRouteId,destroy:'1'}; | ||
| 297 | + // 方向 | ||
| 298 | + var stationRouteDirections = obj[0].original.stationRouteDirections; | ||
| 299 | + // 撤销 | ||
| 300 | + GetAjaxData.stationRouteIsDestroy(params,function(result) { | ||
| 301 | + // 关闭弹出框 | ||
| 302 | + layer.close(index); | ||
| 303 | + if(result.status=='SUCCESS'){ | ||
| 304 | + layer.msg('撤销上行站点【'+obj[0].text+'】成功!'); | ||
| 305 | + }else{ | ||
| 306 | + layer.msg('撤销上行站点【'+obj[0].text+'】失败!'); | ||
| 307 | + } | ||
| 308 | + WorldsBMap.clearMarkAndOverlays(); | ||
| 309 | + var Line = LineObj.getLineObj(); | ||
| 310 | + // 刷行左边树 | ||
| 311 | + PublicFunctions.resjtreeDate(Line.id,stationRouteDirections); | ||
| 312 | + /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | ||
| 313 | + GetAjaxData.getSectionRouteInfo(Line.id,stationRouteDirections,function(data) { | ||
| 314 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 315 | + PublicFunctions.linePanlThree(Line.id,data,stationRouteDirections); | ||
| 316 | + }); | ||
| 317 | + }); | ||
| 318 | + }); | ||
| 319 | + }, | ||
| 320 | + | ||
| 321 | + /** @param direction_ :方向 */ | ||
| 322 | + editLinePlan : function(direction_) { | ||
| 323 | + var sel = PublicFunctions.getCurrSelNode(direction_); | ||
| 324 | + if(sel.length==0 || sel[0].original.chaildredType !='section'){ | ||
| 325 | + if(direction_=='0') { | ||
| 326 | + layer.msg('请先选中要编辑的上行路段!'); | ||
| 327 | + }else if(direction_=='1') { | ||
| 328 | + layer.msg('请先选中要编辑的下行路段!'); | ||
| 329 | + } | ||
| 330 | + return; | ||
| 331 | + } | ||
| 332 | + $('#downLine').addClass('btn disabled'); | ||
| 333 | + $('.btn-circle').addClass('disabled'); | ||
| 334 | + $('#upLine').addClass('btn disabled'); | ||
| 335 | + var editSectionV = sel[0].original; | ||
| 336 | + EditSectionObj.setEitdSection(editSectionV); | ||
| 337 | + // 弹出添加失败提示消息,2秒关闭(如果不配置,默认是3秒) | ||
| 338 | + var yindex = layer.msg('编辑完线路走向后,请双击线路走向区域保存',{ offset: '126px',shift: 0,time: 10000}); | ||
| 339 | + WorldsBMap.editPolyUpline(); | ||
| 340 | + }, | ||
| 341 | + | ||
| 342 | + setFormValue : function(editStationParmas) { | ||
| 343 | + // 站点ID | ||
| 344 | + $('#stationIdInput').val(editStationParmas.stationId); | ||
| 345 | + // 站点路由ID | ||
| 346 | + $('#stationRouteIdInput').val(editStationParmas.stationRouteId); | ||
| 347 | + // 站点路由线路Id | ||
| 348 | + $('#stationRouteLineInput').val(editStationParmas.stationRouteLine); | ||
| 349 | + // 线路编码 | ||
| 350 | + $('#lineCodeInput').val(editStationParmas.stationRouteLineCode); | ||
| 351 | + // 百度坐标点图形集合 | ||
| 352 | + $('#bPolygonGridInput').val(editStationParmas.stationBPolygonGrid); | ||
| 353 | + // 获取站点名称元素设值 | ||
| 354 | + $('#zdmcInput').val(editStationParmas.stationStationName); | ||
| 355 | + // 获取站点路由名称元素设值 | ||
| 356 | + $('#stationNameInput').val(editStationParmas.stationRouteStationName); | ||
| 357 | + // 获取站点编码元素设值 | ||
| 358 | + $('#stationCodInput').val(editStationParmas.stationStationCod); | ||
| 359 | + // 获取站点类型元素设值 | ||
| 360 | + // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark); | ||
| 361 | + // 获取站点方向元素设值 | ||
| 362 | + $('#stationdirSelect').val(editStationParmas.stationRouteDirections); | ||
| 363 | + // 获取站点道路编码元素设值 | ||
| 364 | + $('#roadCodingCodInput').val(editStationParmas.stationRoadCoding); | ||
| 365 | + // 百度地图经纬度坐标中心点 | ||
| 366 | + $('#bJwpointsInput').val(editStationParmas.stationBJwpoints); | ||
| 367 | + if(editStationParmas.stationShapesType=='r') { | ||
| 368 | + // 获取图形类型元素,并添加值 | ||
| 369 | + $('#shapesTypeSelect').val('圆形'); | ||
| 370 | + }else if(editStationParmas.stationShapesType=='d'){ | ||
| 371 | + $('#radiusGroup').hide(); | ||
| 372 | + $('#shapesTypeSelect').val('多边形'); | ||
| 373 | + } | ||
| 374 | + // 获取半径元素,并添加值 | ||
| 375 | + $('#radiusInput').val(editStationParmas.stationRadius); | ||
| 376 | + // 是否撤销 | ||
| 377 | + $('#destroySelect').val(editStationParmas.stationDestroy); | ||
| 378 | + // 到站时间 | ||
| 379 | + $('#toTimeInput').val(editStationParmas.stationRouteToTime); | ||
| 380 | + // 到站距离 | ||
| 381 | + $('#distancesInput').val(editStationParmas.stationRouteDistances); | ||
| 382 | + // 描述/说明 | ||
| 383 | + $('#descriptionsTextarea').val(editStationParmas.stationRouteDescriptions); | ||
| 384 | + }, | ||
| 385 | + | ||
| 386 | + setSectionFormValue : function(Section) { | ||
| 387 | + $('#isRoadeSpeedInput').val(Section.isRoadeSpeed); | ||
| 388 | + // 路段ID | ||
| 389 | + $('#sectionIdInput').val(Section.sectionId); | ||
| 390 | + // 路段路由ID | ||
| 391 | + $('#sectionRouteIdInput').val(Section.sectionrouteId); | ||
| 392 | + // 线路ID | ||
| 393 | + $('#sectionRouteLineInput').val(Section.sectionrouteLine); | ||
| 394 | + // 线路编码 | ||
| 395 | + $('#lineCodeInput').val(Section.sectionrouteLineCode); | ||
| 396 | + // 折线坐标集合 | ||
| 397 | + $('#bsectionVectorInput').val(Section.sectionBsectionVector); | ||
| 398 | + // 路段名称 | ||
| 399 | + $('#sectionNameInput').val(Section.sectionName); | ||
| 400 | + // 路段编码 | ||
| 401 | + $('#sectionCodeInput').val(Section.sectionCode); | ||
| 402 | + // 路段序号 | ||
| 403 | + $('#sectionrouteCodeSelect').val(Section.sectionrouteCode); | ||
| 404 | + // 路段方向 | ||
| 405 | + $('#directionsSection').val(Section.sectionrouteDirections); | ||
| 406 | + // 道路编码 | ||
| 407 | + $('#roadCodingCodInput').val(Section.sectionRoadCoding); | ||
| 408 | + // 道路限速 | ||
| 409 | + $('#speedLimitInput').val(Section.sectionSpeedLimet); | ||
| 410 | + // 路段长度 | ||
| 411 | + $('#sectionDistanceInput').val(Section.sectionDistance); | ||
| 412 | + // 时长 | ||
| 413 | + $('#sectionTimeInput').val(Section.sectionTime); | ||
| 414 | + // 版本号 | ||
| 415 | + $('#versionsInput').val(Section.versions); | ||
| 416 | + // 是否撤销 | ||
| 417 | + $('#destroySelect').val(Section.destroy); | ||
| 418 | + // 描述/说明 | ||
| 419 | + $('#descriptionsTextarea').val(Section.descriptions); | ||
| 420 | + }, | ||
| 421 | + | ||
| 422 | + //lineId,data,direction | ||
| 423 | + treeSectionClick: function(lineId,data,direction){ | ||
| 424 | + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | ||
| 425 | + WorldsBMap.clearMarkAndOverlays(); | ||
| 426 | + // 编辑路段数据 | ||
| 427 | + for(var d= 0; d<data.length;d++){ | ||
| 428 | + // 地图折线坐标点集合 | ||
| 429 | + var polylineArray = []; | ||
| 430 | + // 获取路段折线坐标字符串 | ||
| 431 | + var sectionBsectionVectorStr = data[d].sectionBsectionVector; | ||
| 432 | + if(sectionBsectionVectorStr==null) { | ||
| 433 | + continue; | ||
| 434 | + } | ||
| 435 | + // 切割段折线坐标字符串 | ||
| 436 | + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); | ||
| 437 | + // 分割折线坐标字符串 | ||
| 438 | + var lineArray = tempStr.split(','); | ||
| 439 | + for(var i = 0;i<lineArray.length;i++) { | ||
| 440 | + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | ||
| 441 | + } | ||
| 442 | + var index = parseInt(polylineArray.length/2); | ||
| 443 | + var center = polylineArray[index]; | ||
| 444 | + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | ||
| 445 | + WorldsBMap.drawingUpline(polylineArray,center); | ||
| 446 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 447 | + WorldsBMap.drawingUpStationPoint(center,data[d].name,d+1); | ||
| 448 | + } | ||
| 449 | + }, | ||
| 450 | + | ||
| 451 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 452 | + linePanlThree : function(lineId,data,direction) { | ||
| 453 | + /** 获取站点路由信息 @param:<Line.id:线路Id;0:上行> @return:<resultdata:站点路由数据> */ | ||
| 454 | + GetAjaxData.getStationRoutePoint(lineId,direction,function(resultdata) { | ||
| 455 | + WorldsBMap.clearMarkAndOverlays(); | ||
| 456 | + var polyline_center; | ||
| 457 | + // 如果站点路由数据不为空 | ||
| 458 | + if(resultdata.length>0) { | ||
| 459 | + var ceter_index = Math.round(resultdata.length / 2); | ||
| 460 | + var ceterPointsStr = resultdata[ceter_index].bJwpoints; | ||
| 461 | + var ceterPointsArray = ceterPointsStr.split(' '); | ||
| 462 | + polyline_center = new BMap.Point(ceterPointsArray[0],ceterPointsArray[1]); | ||
| 463 | + // 遍历站点路由数据 | ||
| 464 | + for(var s = 0 ; s<resultdata.length;s++) { | ||
| 465 | + // 中心点坐标字符串 | ||
| 466 | + var bJwpointsStr = resultdata[s].bJwpoints; | ||
| 467 | + var stationName = resultdata[s].stationName; | ||
| 468 | + // 起个中心点坐标字符串 | ||
| 469 | + var bJwpointsArray = bJwpointsStr.split(' '); | ||
| 470 | + // 设置中心点 | ||
| 471 | + var point_center = new BMap.Point(bJwpointsArray[0],bJwpointsArray[1]); | ||
| 472 | + /** 在地图上画点 @param:<point_center:中心坐标点> */ | ||
| 473 | + WorldsBMap.drawingUpStationPoint(point_center,stationName,s+1); | ||
| 474 | + } | ||
| 475 | + | ||
| 476 | + } | ||
| 477 | + // 路段数据长度 | ||
| 478 | + var dataLen = data.length; | ||
| 479 | + //debugger; | ||
| 480 | + // 如果大于零 | ||
| 481 | + if(dataLen>0) { | ||
| 482 | + // 编辑路段数据 | ||
| 483 | + for(var d= 0; d<dataLen;d++){ | ||
| 484 | + // 地图折线坐标点集合 | ||
| 485 | + var polylineArray = []; | ||
| 486 | + // 获取路段折线坐标字符串 | ||
| 487 | + var sectionBsectionVectorStr = data[d].sectionBsectionVector; | ||
| 488 | + if(sectionBsectionVectorStr==null) | ||
| 489 | + continue; | ||
| 490 | + // 切割段折线坐标字符串 | ||
| 491 | + var tempStr = sectionBsectionVectorStr.substring(11,sectionBsectionVectorStr.length-1); | ||
| 492 | + // 分割折线坐标字符串 | ||
| 493 | + var lineArray = tempStr.split(','); | ||
| 494 | + for(var i = 0;i<lineArray.length;i++) { | ||
| 495 | + polylineArray.push(new BMap.Point(lineArray[i].split(' ')[0],lineArray[i].split(' ')[1])); | ||
| 496 | + } | ||
| 497 | + /** 在地图上画出线路走向 @param:<polylineArray:地图折线坐标点集合;resultdata:站点路由数据> */ | ||
| 498 | + /*WorldsBMap.drawingUpline(polylineArray,polyline_center,data[d]);*/ | ||
| 499 | + WorldsBMap.drawingUpline01(polylineArray,polyline_center,data[d]); | ||
| 500 | + } | ||
| 501 | + } | ||
| 502 | + WorldsBMap.drawingBus(lon,lat); | ||
| 503 | + }); | ||
| 504 | + }, | ||
| 505 | + /** 加载树 @param:<lineId:线路ID;diraction:方向(0:上行;1:下行)> */ | ||
| 506 | + TreeUpOrDown : function(lineId,diraction) { | ||
| 507 | + /** 获取树结果数据 @param:<lineId:线路ID;diraction:方向;callback:回调函数> */ | ||
| 508 | + GetAjaxData.getStation(lineId,diraction,function(treeDateJson) { | ||
| 509 | + // 获取返回数据长度 | ||
| 510 | + var len = treeDateJson[0].children[0].children.length; | ||
| 511 | + // 上行 | ||
| 512 | + if(diraction == 0) { | ||
| 513 | + /** 初始化上行树 @param:<treeDateJson:树数据结构> */ | ||
| 514 | + StationTreeData.upInit(treeDateJson); | ||
| 515 | + if(len>0) { | ||
| 516 | + $('#upToolsMobal').hide(); | ||
| 517 | + $('#uptreeMobal').show(); | ||
| 518 | + }else { | ||
| 519 | + $('#upToolsMobal').show(); | ||
| 520 | + $('#uptreeMobal').hide(); | ||
| 521 | + } | ||
| 522 | + // 下行 | ||
| 523 | + }else if(diraction ==1) { | ||
| 524 | + /** 出事画下行树 @param:<treeDateJson:树数据结构> */ | ||
| 525 | + StationTreeData.downInit(treeDateJson); | ||
| 526 | + if(len>0) { | ||
| 527 | + $('#downToolsMobal').hide(); | ||
| 528 | + $('#DowntreeMobal').show(); | ||
| 529 | + }else { | ||
| 530 | + $('#downToolsMobal').show(); | ||
| 531 | + $('#DowntreeMobal').hide(); | ||
| 532 | + } | ||
| 533 | + } | ||
| 534 | + }); | ||
| 535 | + }, | ||
| 536 | + isHaveStationName : function(data) { | ||
| 537 | + if(data.length>0) { | ||
| 538 | + layer.confirm('系统已存在【'+ data[0].stationName +'】该站点位置名称,请选择【系统引用】或者更改站点名称进行新增!', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ | ||
| 539 | + layer.close(index); | ||
| 540 | + }); | ||
| 541 | + return false; | ||
| 542 | + }else { | ||
| 543 | + return true; | ||
| 544 | + } | ||
| 545 | + }, | ||
| 546 | + editAChangeCssRemoveDisabled : function() { | ||
| 547 | + $('#downLine').removeClass('btn disabled'); | ||
| 548 | + $('.btn-circle').removeClass('disabled'); | ||
| 549 | + $('#upLine').removeClass('btn disabled'); | ||
| 550 | + }, | ||
| 551 | + // 方向代码转名称. | ||
| 552 | + dirdmToName : function(value){ | ||
| 553 | + var srStr = ''; | ||
| 554 | + if(value=='0') | ||
| 555 | + srStr = '上行'; | ||
| 556 | + else if(value=='1') | ||
| 557 | + srStr = '下行'; | ||
| 558 | + return srStr; | ||
| 559 | + }, | ||
| 560 | + } | ||
| 561 | + return PubFun ; | ||
| 562 | +}(); | ||
| 0 | \ No newline at end of file | 563 | \ No newline at end of file |
src/main/resources/static/pages/excep/js/outboundmap-load.js
0 → 100644
| 1 | +/** | ||
| 2 | + * reload事件 | ||
| 3 | + * | ||
| 4 | + * | ||
| 5 | + */ | ||
| 6 | + | ||
| 7 | +$(function(){ | ||
| 8 | + | ||
| 9 | + // 获取参数线路ID | ||
| 10 | + var no = $.url().param('no'); | ||
| 11 | + var up = $.url().param('up'); | ||
| 12 | + var paramArr = new Array(); | ||
| 13 | + paramArr = no.split(",");// 在每个逗号(,)处进行分解。 | ||
| 14 | + /*paramArr[0]:id | ||
| 15 | + paramArr[1]:上下行; | ||
| 16 | + paramArr[2]:经度 | ||
| 17 | + paramArr[3]:纬度*/ | ||
| 18 | + uoDown = paramArr[1]; | ||
| 19 | + longitude = paramArr[2]; | ||
| 20 | + latitude = paramArr[3]; | ||
| 21 | + // 如果线路ID不为空 | ||
| 22 | + var styleOptions = { | ||
| 23 | + strokeColor : "blue",//边线颜色。 | ||
| 24 | + fillColor : "blue",//填充颜色。当参数为空时,圆形将没有填充效果。 | ||
| 25 | + strokeWeight : 3,//边线的宽度,以像素为单位。 | ||
| 26 | + strokeOpacity : 0.8,//边线透明度,取值范围0 - 1。 | ||
| 27 | + fillOpacity : 0.6,//填充的透明度,取值范围0 - 1。 | ||
| 28 | + strokeStyle : 'solid' //边线的样式,solid或dashed。 | ||
| 29 | + }; | ||
| 30 | + // 等候500毫秒执行 | ||
| 31 | + setTimeout(function(){ | ||
| 32 | + | ||
| 33 | + /** 初始化线路对象,这里只初始化线路Id属性 @param:<id:线路ID> @return:Line */ | ||
| 34 | + var Line = LineObj.init(paramArr[0]); | ||
| 35 | + | ||
| 36 | + /** 初始化地图对象map @return:Map对象 */ | ||
| 37 | + var map_ = WorldsBMap.init(); | ||
| 38 | + | ||
| 39 | + /** 初始化绘图工具类 @param:<map_:map对象;styleOptions:绘图样式对象> @return:DrawingManager对象 */ | ||
| 40 | + var drawingManager_ = DrawingManagerObj.init(map_,styleOptions); | ||
| 41 | + | ||
| 42 | + /** 查询路段信息 @param:<Line.id:线路Id;0:上行> @return:data:路段数据 */ | ||
| 43 | + GetAjaxData.getSectionRouteInfo(Line.id,uoDown,function(data) { | ||
| 44 | + /** 在地图上画出线路走向 @param:<Line.id:线路Id;0:上行;data:路段数据> */ | ||
| 45 | + PublicFunctions.linePanlThree(Line.id,data,uoDown); | ||
| 46 | + }); | ||
| 47 | + },500); | ||
| 48 | +}); | ||
| 0 | \ No newline at end of file | 49 | \ No newline at end of file |
src/main/resources/static/pages/excep/offlineList.html
| @@ -161,9 +161,17 @@ $(function(){ | @@ -161,9 +161,17 @@ $(function(){ | ||
| 161 | var icheckOptions = { | 161 | var icheckOptions = { |
| 162 | checkboxClass: 'icheckbox_flat-blue', | 162 | checkboxClass: 'icheckbox_flat-blue', |
| 163 | increaseArea: '20%' | 163 | increaseArea: '20%' |
| 164 | - } | ||
| 165 | - | ||
| 166 | - jsDoQuery(null,true); | 164 | + }; |
| 165 | + var toDay = new Date(); | ||
| 166 | + var year = toDay.getFullYear(); | ||
| 167 | + var Month = toDay.getMonth()+1>10?toDay.getMonth()+1:"0"+(toDay.getMonth()+1); | ||
| 168 | + var Day = toDay.getDate()>10?toDay.getDate():"0"+toDay.getDate(); | ||
| 169 | + var date = year+"-"+Month+"-"+Day; | ||
| 170 | + //时间表单默认选择当日时间。 | ||
| 171 | + $("input[name='date']")[0].value = date; | ||
| 172 | + var parameter = new Object(); | ||
| 173 | + parameter.date = $("input[name='date']")[0].value; | ||
| 174 | + jsDoQuery(parameter,true); | ||
| 167 | 175 | ||
| 168 | //重置 | 176 | //重置 |
| 169 | $('tr.filter .filter-cancel').on('click', function(){ | 177 | $('tr.filter .filter-cancel').on('click', function(){ |
| @@ -201,9 +209,6 @@ $(function(){ | @@ -201,9 +209,6 @@ $(function(){ | ||
| 201 | params['page'] = page; | 209 | params['page'] = page; |
| 202 | var i = layer.load(2); | 210 | var i = layer.load(2); |
| 203 | $get('/offline/pagequery' ,params, function(data){ | 211 | $get('/offline/pagequery' ,params, function(data){ |
| 204 | -// $.each(data.content, function(i, obj) { | ||
| 205 | -// obj.lastLoginDate = moment(obj.lastLoginDate).format("YYYY-MM-DD HH:mm:ss"); | ||
| 206 | -// }); | ||
| 207 | var bodyHtm = template('offline_list_temp', {list: data.dataList}); | 212 | var bodyHtm = template('offline_list_temp', {list: data.dataList}); |
| 208 | 213 | ||
| 209 | $('#datatable_offline tbody').html(bodyHtm) | 214 | $('#datatable_offline tbody').html(bodyHtm) |
| @@ -247,10 +252,7 @@ $(function(){ | @@ -247,10 +252,7 @@ $(function(){ | ||
| 247 | initPagination = false; | 252 | initPagination = false; |
| 248 | return; | 253 | return; |
| 249 | } | 254 | } |
| 250 | - | ||
| 251 | - | ||
| 252 | - page = num - 1; | ||
| 253 | - | 255 | + page = num - 1; |
| 254 | var cells = $('tr.filter')[0].cells | 256 | var cells = $('tr.filter')[0].cells |
| 255 | ,params = {} | 257 | ,params = {} |
| 256 | ,name; | 258 | ,name; |
| @@ -294,52 +296,52 @@ $(function(){ | @@ -294,52 +296,52 @@ $(function(){ | ||
| 294 | }); | 296 | }); |
| 295 | 297 | ||
| 296 | $("#line").on("change",initXl); | 298 | $("#line").on("change",initXl); |
| 297 | -function initXl(){ | ||
| 298 | - $('#nbbm').select2({ | ||
| 299 | - placeholder: '搜索车辆...', | ||
| 300 | - ajax: { | ||
| 301 | - url: '/report/carList', | ||
| 302 | - dataType: 'json', | ||
| 303 | - delay: 150, | ||
| 304 | - data: function (params) { | ||
| 305 | - return {nbbm: params.term, | ||
| 306 | - gsbm:"", | ||
| 307 | - fgsbm:"", | ||
| 308 | - xlbm:$('#line').val()}; | ||
| 309 | - }, | ||
| 310 | - processResults: function (data) { | ||
| 311 | - return { | ||
| 312 | - results: data | ||
| 313 | - }; | ||
| 314 | - }, | ||
| 315 | - cache: true | ||
| 316 | - }, | ||
| 317 | - templateResult: function (repo) { | ||
| 318 | - if (repo.loading) return repo.text; | ||
| 319 | - var h = '<span>' + repo.text + '</span>'; | ||
| 320 | - h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | ||
| 321 | - return h; | ||
| 322 | - }, | ||
| 323 | - escapeMarkup: function (markup) { | ||
| 324 | - return markup; | ||
| 325 | - }, | ||
| 326 | - minimumInputLength: 1, | ||
| 327 | - templateSelection: function (repo) { | ||
| 328 | - return repo.text; | ||
| 329 | - }, | ||
| 330 | - language: { | ||
| 331 | - noResults: function () { | ||
| 332 | - return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 333 | - }, | ||
| 334 | - inputTooShort: function (e) { | ||
| 335 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 336 | - }, | ||
| 337 | - searching: function () { | ||
| 338 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 339 | - } | ||
| 340 | - } | ||
| 341 | - }); | ||
| 342 | -} | 299 | + function initXl(){ |
| 300 | + $('#nbbm').select2({ | ||
| 301 | + placeholder: '搜索车辆...', | ||
| 302 | + ajax: { | ||
| 303 | + url: '/report/carList', | ||
| 304 | + dataType: 'json', | ||
| 305 | + delay: 150, | ||
| 306 | + data: function (params) { | ||
| 307 | + return {nbbm: params.term, | ||
| 308 | + gsbm:"", | ||
| 309 | + fgsbm:"", | ||
| 310 | + xlbm:$('#line').val()}; | ||
| 311 | + }, | ||
| 312 | + processResults: function (data) { | ||
| 313 | + return { | ||
| 314 | + results: data | ||
| 315 | + }; | ||
| 316 | + }, | ||
| 317 | + cache: true | ||
| 318 | + }, | ||
| 319 | + templateResult: function (repo) { | ||
| 320 | + if (repo.loading) return repo.text; | ||
| 321 | + var h = '<span>' + repo.text + '</span>'; | ||
| 322 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | ||
| 323 | + return h; | ||
| 324 | + }, | ||
| 325 | + escapeMarkup: function (markup) { | ||
| 326 | + return markup; | ||
| 327 | + }, | ||
| 328 | + minimumInputLength: 1, | ||
| 329 | + templateSelection: function (repo) { | ||
| 330 | + return repo.text; | ||
| 331 | + }, | ||
| 332 | + language: { | ||
| 333 | + noResults: function () { | ||
| 334 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 335 | + }, | ||
| 336 | + inputTooShort: function (e) { | ||
| 337 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 338 | + }, | ||
| 339 | + searching: function () { | ||
| 340 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 341 | + } | ||
| 342 | + } | ||
| 343 | + }); | ||
| 344 | + } | ||
| 343 | 345 | ||
| 344 | }); | 346 | }); |
| 345 | </script> | 347 | </script> |
| 346 | \ No newline at end of file | 348 | \ No newline at end of file |
src/main/resources/static/pages/excep/outBoundMap.html
0 → 100644
| 1 | +<link href="/pages/base/stationroute/css/bmap_base.css" rel="stylesheet" type="text/css" /> | ||
| 2 | +<div class="portlet-body"> | ||
| 3 | + <!-- 地图 --> | ||
| 4 | + <div id="bmap_basic" class="bmaps"></div> | ||
| 5 | +</div> | ||
| 6 | +<!-- load事件 --> | ||
| 7 | +<script src="/pages/excep/js/outboundmap-load.js"></script> | ||
| 8 | +<!-- 线路类 --> | ||
| 9 | +<script src="/pages/excep/js/outboundline.js"></script> | ||
| 10 | +<!-- 绘图类 --> | ||
| 11 | +<script src="/pages/base/stationroute/js/drawingManager.js"></script> | ||
| 12 | +<!-- 地图类 --> | ||
| 13 | +<script src="/pages/excep/js/outbound-map.js"></script> | ||
| 14 | +<!-- 函数与方法 --> | ||
| 15 | +<script src="/pages/excep/js/outboundmap-function.js"></script> | ||
| 16 | +<!-- ajax请求类 --> | ||
| 17 | +<script src="/pages/base/stationroute/js/stationroute-ajax-getdata.js"></script> | ||
| 18 | + |
src/main/resources/static/pages/excep/speedingList.html
| @@ -54,28 +54,29 @@ | @@ -54,28 +54,29 @@ | ||
| 54 | <thead> | 54 | <thead> |
| 55 | <tr role="row" class="heading"> | 55 | <tr role="row" class="heading"> |
| 56 | <th width="3%">#</th> | 56 | <th width="3%">#</th> |
| 57 | - <th width="15%">线路</th> | ||
| 58 | - <th width="13%">车辆自编号</th> | ||
| 59 | - <th width="100">工号/名字</th> | ||
| 60 | - <th width="11%">路牌名</th> | 57 | + <th width="8%">线路</th> |
| 58 | + <th width="10%">车辆自编号</th> | ||
| 59 | + <!-- <th width="100">工号/名字</th> | ||
| 60 | + <th width="11%">路牌名</th> --> | ||
| 61 | <th width="10%">上下行</th> | 61 | <th width="10%">上下行</th> |
| 62 | - <th width="18%">时间</th> | 62 | + <th width="20%">超速时间</th> |
| 63 | + <th width="6%">持续时间</th> | ||
| 64 | + <th width="10%">查看轨迹</th> | ||
| 63 | <th width="18%">操作</th> | 65 | <th width="18%">操作</th> |
| 64 | </tr> | 66 | </tr> |
| 65 | <tr role="row" class="filter"> | 67 | <tr role="row" class="filter"> |
| 66 | <td></td> | 68 | <td></td> |
| 67 | <td> | 69 | <td> |
| 68 | -<!-- <input type="text" class="form-control form-filter input-sm" name="userName_like"> --> | ||
| 69 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 70 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 70 | </td> | 71 | </td> |
| 71 | <td> | 72 | <td> |
| 72 | -<!-- <input type="text" class="form-control form-filter input-sm" name="nbbm"> --> | ||
| 73 | - <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select> | 73 | + <select class="form-control" name="nbbm" id="nbbm" style="width: 150px;"></select> |
| 74 | </td> | 74 | </td> |
| 75 | - <td> | 75 | + <!-- <td> |
| 76 | 76 | ||
| 77 | </td> | 77 | </td> |
| 78 | - <td></td> | 78 | + <td> |
| 79 | + </td> --> | ||
| 79 | <td> | 80 | <td> |
| 80 | <select class="form-control form-filter " name="updown"> | 81 | <select class="form-control form-filter " name="updown"> |
| 81 | <option value="">请选择...</option> | 82 | <option value="">请选择...</option> |
| @@ -84,7 +85,16 @@ | @@ -84,7 +85,16 @@ | ||
| 84 | <option value="-1">无效</option> | 85 | <option value="-1">无效</option> |
| 85 | </select> | 86 | </select> |
| 86 | </td> | 87 | </td> |
| 87 | - <td> <input class="form-control" type="date" name="date" /></td> | 88 | + <td nowrap="nowrap"> |
| 89 | + <input class="form-control" type="date" name="startDate" style="width: 180px;"/> | ||
| 90 | + - | ||
| 91 | + <input class="form-control" type="date" name="endDate" style="width: 180px;"/> | ||
| 92 | + | ||
| 93 | + </td> | ||
| 94 | + <td> | ||
| 95 | + </td> | ||
| 96 | + <td> | ||
| 97 | + </td> | ||
| 88 | <td> | 98 | <td> |
| 89 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | 99 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > |
| 90 | <i class="fa fa-search"></i> 搜索</button> | 100 | <i class="fa fa-search"></i> 搜索</button> |
| @@ -117,13 +127,6 @@ | @@ -117,13 +127,6 @@ | ||
| 117 | <td> | 127 | <td> |
| 118 | {{obj.vehicle}} | 128 | {{obj.vehicle}} |
| 119 | </td> | 129 | </td> |
| 120 | - | ||
| 121 | - <td> | ||
| 122 | - {{obj.jsy}} | ||
| 123 | - </td> | ||
| 124 | - <td> | ||
| 125 | - {{obj.lpname}} | ||
| 126 | - </td> | ||
| 127 | <td> | 130 | <td> |
| 128 | {{if obj.upDown==0}} | 131 | {{if obj.upDown==0}} |
| 129 | 上行 | 132 | 上行 |
| @@ -137,6 +140,12 @@ | @@ -137,6 +140,12 @@ | ||
| 137 | {{obj.timestampDate}} | 140 | {{obj.timestampDate}} |
| 138 | </td> | 141 | </td> |
| 139 | <td> | 142 | <td> |
| 143 | + {{obj.durationTime}}秒 | ||
| 144 | + </td> | ||
| 145 | + <td> | ||
| 146 | + | ||
| 147 | + </td> | ||
| 148 | + <td> | ||
| 140 | 149 | ||
| 141 | </td> | 150 | </td> |
| 142 | </tr> | 151 | </tr> |
| @@ -156,8 +165,33 @@ $(function(){ | @@ -156,8 +165,33 @@ $(function(){ | ||
| 156 | increaseArea: '20%' | 165 | increaseArea: '20%' |
| 157 | } | 166 | } |
| 158 | 167 | ||
| 168 | + var date = new Date(); | ||
| 169 | + var week = date.getDay();//表明今天是周几。0-6表示周日到周六 | ||
| 170 | + var dateTime = date.getTime();//当前时间的时间戳,单位秒。 | ||
| 171 | + | ||
| 172 | + var endTime = dateTime-week*24*3600*1000;//上周末、格式为时间戳。 | ||
| 173 | + var startTime = endTime-6*24*3600*1000;//上周一、格式为时间戳。 | ||
| 174 | + | ||
| 175 | + var endDate = timeToData(endTime); | ||
| 176 | + var startDate = timeToData(startTime); | ||
| 177 | + //表单默认选择上周一到上周日的超速信息。 | ||
| 178 | + $("input[name='endDate']")[0].value = endDate; | ||
| 179 | + $("input[name='startDate']")[0].value = startDate; | ||
| 180 | + var parameter = new Object(); | ||
| 181 | + parameter.endDate = $("input[name='endDate']")[0].value; | ||
| 182 | + parameter.startDate = $("input[name='startDate']")[0].value; | ||
| 183 | + //jsDoQuery(parameter,true); | ||
| 159 | jsDoQuery(null,true); | 184 | jsDoQuery(null,true); |
| 160 | 185 | ||
| 186 | + //时间戳转换为年月日 | ||
| 187 | + function timeToData(time){ | ||
| 188 | + var date = new Date(time); | ||
| 189 | + var year = date.getFullYear(); | ||
| 190 | + var Month = date.getMonth()+1>10?date.getMonth()+1:"0"+(date.getMonth()+1); | ||
| 191 | + var Day = date.getDate()>10?date.getDate():"0"+date.getDate(); | ||
| 192 | + return year+"-"+Month+"-"+Day; | ||
| 193 | + } | ||
| 194 | + | ||
| 161 | //重置 | 195 | //重置 |
| 162 | $('tr.filter .filter-cancel').on('click', function(){ | 196 | $('tr.filter .filter-cancel').on('click', function(){ |
| 163 | $('tr.filter input, select').val('').change(); | 197 | $('tr.filter input, select').val('').change(); |
| @@ -226,8 +260,8 @@ $(function(){ | @@ -226,8 +260,8 @@ $(function(){ | ||
| 226 | function showPagination(data){ | 260 | function showPagination(data){ |
| 227 | //分页 | 261 | //分页 |
| 228 | $('#pagination').jqPaginator({ | 262 | $('#pagination').jqPaginator({ |
| 229 | - totalPages: data.totalPage, | ||
| 230 | - visiblePages: 6, | 263 | + totalPages: data.totalPage,//总页数 |
| 264 | + visiblePages: 6,// 中间显示页数 | ||
| 231 | currentPage: page + 1, | 265 | currentPage: page + 1, |
| 232 | first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | 266 | first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', |
| 233 | prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | 267 | prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', |
| @@ -257,7 +291,6 @@ $(function(){ | @@ -257,7 +291,6 @@ $(function(){ | ||
| 257 | }); | 291 | }); |
| 258 | } | 292 | } |
| 259 | 293 | ||
| 260 | - | ||
| 261 | //删除 | 294 | //删除 |
| 262 | $('#removeButton').on('click', function(){ | 295 | $('#removeButton').on('click', function(){ |
| 263 | if($(this).attr('disabled')) | 296 | if($(this).attr('disabled')) |
| @@ -279,7 +312,7 @@ $(function(){ | @@ -279,7 +312,7 @@ $(function(){ | ||
| 279 | } | 312 | } |
| 280 | initPinYinSelect2('#line',data,''); | 313 | initPinYinSelect2('#line',data,''); |
| 281 | 314 | ||
| 282 | -}); | 315 | + }); |
| 283 | 316 | ||
| 284 | $("#line").on("change",initXl); | 317 | $("#line").on("change",initXl); |
| 285 | function initXl(){ | 318 | function initXl(){ |
src/main/resources/static/pages/excep/speedingListmh.html
0 → 100644
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>超速异常</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li><a href="/pages/home.html" data-pjax>主页</a> <i class="fa fa-circle"></i></li> | ||
| 9 | + <li><span class="active">异常查看</span> <i class="fa fa-circle"></i></li> | ||
| 10 | + <li><span class="active">超速异常</span></li> | ||
| 11 | +</ul> | ||
| 12 | + | ||
| 13 | +<div class="row"> | ||
| 14 | + <div class="col-md-12"> | ||
| 15 | + <!-- Begin: life time stats --> | ||
| 16 | + <div class="portlet light portlet-fit portlet-datatable bordered"> | ||
| 17 | + <div class="portlet-title"> | ||
| 18 | + <div class="caption"> | ||
| 19 | + <i class="fa fa-times-circle"></i> <span | ||
| 20 | + class="caption-subject font-dark sbold uppercase">超速异常数据表</span> | ||
| 21 | + </div> | ||
| 22 | + <div class="actions"> | ||
| 23 | +<!-- <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加用户</a> --> | ||
| 24 | + <!-- <button type="button" class="btn btn-circle red" disabled="disabled" id="removeButton"><i class="fa fa-trash"></i> ɾ���û�</button> --> | ||
| 25 | + <!-- <div class="btn-group"> | ||
| 26 | + <a class="btn red btn-outline btn-circle" href="javascript:;" | ||
| 27 | + data-toggle="dropdown"> <i class="fa fa-share"></i> <span | ||
| 28 | + class="hidden-xs"> 系统工具</span> <i class="fa fa-angle-down"></i> | ||
| 29 | + </a> | ||
| 30 | + <ul class="dropdown-menu pull-right" id="datatable_ajax_tools"> | ||
| 31 | + <li><a href="javascript:;" data-action="0" | ||
| 32 | + class="tool-action"> <i class="fa fa-print"></i>打印 | ||
| 33 | + </a></li> | ||
| 34 | + <li><a href="javascript:;" data-action="1" | ||
| 35 | + class="tool-action"> <i class="fa fa-copy"></i> 复制 | ||
| 36 | + </a></li> | ||
| 37 | + <li><a href="javascript:;" data-action="3" | ||
| 38 | + class="tool-action"> <i class="fa fa-file-excel-o"></i> | ||
| 39 | + 导出Excel | ||
| 40 | + </a></li> | ||
| 41 | + <li class="divider"></li> | ||
| 42 | + <li><a href="javascript:;" data-action="5" | ||
| 43 | + class="tool-action"> <i class="fa fa-refresh"></i> 刷新数据 | ||
| 44 | + </a></li> | ||
| 45 | + </ul> | ||
| 46 | + </div> --> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + <div class="portlet-body"> | ||
| 50 | + <div class="table-container" style="margin-top: 10px"> | ||
| 51 | + <table | ||
| 52 | + class="table table-striped table-bordered table-hover table-checkable" | ||
| 53 | + id="datatable_speeding"> | ||
| 54 | + <thead> | ||
| 55 | + <tr role="row" class="heading"> | ||
| 56 | + <th width="3%">#</th> | ||
| 57 | + <th width="4%">线路</th> | ||
| 58 | + <th width="6%">车辆自编号</th> | ||
| 59 | + <th width="8%">上下行</th> | ||
| 60 | + <th width="10%">开始时间</th> | ||
| 61 | + <th width="10%">结束时间</th> | ||
| 62 | + <th width="8%">持续时间</th> | ||
| 63 | + <th width="8%">查看轨迹</th> | ||
| 64 | + <th width="6%">操作</th> | ||
| 65 | + </tr> | ||
| 66 | + <tr role="row" class="filter"> | ||
| 67 | + <td></td> | ||
| 68 | + <td> | ||
| 69 | + <select class="form-control" name="line" id="line" style="width: 100px;"></select> | ||
| 70 | + </td> | ||
| 71 | + <td> | ||
| 72 | + <select class="form-control" name="nbbm" id="nbbm" style="width: 100px;"></select> | ||
| 73 | + </td> | ||
| 74 | + <!-- <td> | ||
| 75 | + | ||
| 76 | + </td> | ||
| 77 | + <td> | ||
| 78 | + </td> --> | ||
| 79 | + <td> | ||
| 80 | + <select class="form-control form-filter " name="updown" style="width: 90px;"> | ||
| 81 | + <option value="">请选择...</option> | ||
| 82 | + <option value="0">上行</option> | ||
| 83 | + <option value="1">下行</option> | ||
| 84 | + <option value="-1">无效</option> | ||
| 85 | + </select> | ||
| 86 | + </td> | ||
| 87 | + <td> | ||
| 88 | + <input class="form-control" type="date" name="startDate" /> | ||
| 89 | + - | ||
| 90 | + <input class="form-control" type="date" name="endDate" /> | ||
| 91 | + </td> | ||
| 92 | + <td> | ||
| 93 | + </td> | ||
| 94 | + <td> | ||
| 95 | + </td> | ||
| 96 | + <td> | ||
| 97 | + </td> | ||
| 98 | + <td> | ||
| 99 | + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" > | ||
| 100 | + <i class="fa fa-search"></i> 搜索</button> | ||
| 101 | + | ||
| 102 | + <button class="btn btn-sm red btn-outline filter-cancel"> | ||
| 103 | + <i class="fa fa-times"></i> 重置</button> | ||
| 104 | + </td> | ||
| 105 | + </tr> | ||
| 106 | + </thead> | ||
| 107 | + <tbody></tbody> | ||
| 108 | + </table> | ||
| 109 | + <div style="text-align: right;"> | ||
| 110 | + <ul id="pagination" class="pagination"></ul> | ||
| 111 | + </div> | ||
| 112 | + </div> | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | + </div> | ||
| 116 | +</div> | ||
| 117 | + | ||
| 118 | +<script id="speeding_list_temp" type="text/html"> | ||
| 119 | +{{each list as obj i}} | ||
| 120 | +<tr> | ||
| 121 | + <td style="vertical-align: middle;"> | ||
| 122 | + <input type="checkbox" class="group-checkable icheck" data-id="{{obj.id}}"> | ||
| 123 | + </td> | ||
| 124 | + <td> | ||
| 125 | + {{obj.lineName}} | ||
| 126 | + </td> | ||
| 127 | + <td> | ||
| 128 | + {{obj.vehicle}} | ||
| 129 | + </td> | ||
| 130 | + <td> | ||
| 131 | + {{if obj.upDown==0}} | ||
| 132 | + 上行 | ||
| 133 | + {{else if obj.upDown==1}} | ||
| 134 | + 下行 | ||
| 135 | + {{else}} | ||
| 136 | + 无效 | ||
| 137 | + {{/if}} | ||
| 138 | + </td> | ||
| 139 | + <td> | ||
| 140 | + {{obj.timestampDate}} | ||
| 141 | + </td> | ||
| 142 | + <td> | ||
| 143 | + {{obj.endtimestampDate}} | ||
| 144 | + </td> | ||
| 145 | + <td> | ||
| 146 | + {{(obj.endtimestamp-obj.timestamp)/1000}}秒 | ||
| 147 | + </td> | ||
| 148 | + <td> | ||
| 149 | + <a class="btn default blue-stripe btn-sm lookTrajectory" data-pjax> | ||
| 150 | + 查看轨迹 | ||
| 151 | + </a> | ||
| 152 | + </td> | ||
| 153 | + <td> | ||
| 154 | + | ||
| 155 | + </td> | ||
| 156 | +</tr> | ||
| 157 | +{{/each}} | ||
| 158 | +{{if list.length == 0}} | ||
| 159 | +<tr> | ||
| 160 | + <td colspan=8><h6 class="muted">没有找到相关数据</h6></td> | ||
| 161 | +</tr> | ||
| 162 | +{{/if}} | ||
| 163 | +</script> | ||
| 164 | + | ||
| 165 | +<script> | ||
| 166 | +$(function(){ | ||
| 167 | + var page = 0, initPagination; | ||
| 168 | + var icheckOptions = { | ||
| 169 | + checkboxClass: 'icheckbox_flat-blue', | ||
| 170 | + increaseArea: '20%' | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + var date = new Date(); | ||
| 174 | + var week = date.getDay();//表明今天是周几。0-6表示周日到周六 | ||
| 175 | + var dateTime = date.getTime();//当前时间的时间戳,单位秒。 | ||
| 176 | + | ||
| 177 | + var endTime = dateTime-week*24*3600*1000;//上周末、格式为时间戳。 | ||
| 178 | + var startTime = endTime-6*24*3600*1000;//上周一、格式为时间戳。 | ||
| 179 | + | ||
| 180 | + var endDate = timeToData(endTime); | ||
| 181 | + var startDate = timeToData(startTime); | ||
| 182 | + //表单默认选择上周一到上周日的超速信息。 | ||
| 183 | + $("input[name='endDate']")[0].value = endDate; | ||
| 184 | + $("input[name='startDate']")[0].value = startDate; | ||
| 185 | + var parameter = new Object(); | ||
| 186 | + parameter.endDate = $("input[name='endDate']")[0].value; | ||
| 187 | + parameter.startDate = $("input[name='startDate']")[0].value; | ||
| 188 | + jsDoQuery(parameter,true); | ||
| 189 | + | ||
| 190 | + //时间戳转换为年月日 | ||
| 191 | + function timeToData(time){ | ||
| 192 | + var date = new Date(time); | ||
| 193 | + var year = date.getFullYear(); | ||
| 194 | + var Month = date.getMonth()+1>10?date.getMonth()+1:"0"+(date.getMonth()+1); | ||
| 195 | + var Day = date.getDate()>10?date.getDate():"0"+date.getDate(); | ||
| 196 | + return year+"-"+Month+"-"+Day; | ||
| 197 | + } | ||
| 198 | + | ||
| 199 | + //重置 | ||
| 200 | + $('tr.filter .filter-cancel').on('click', function(){ | ||
| 201 | + $('tr.filter input, select').val('').change(); | ||
| 202 | + jsDoQuery(null, true); | ||
| 203 | + }); | ||
| 204 | + | ||
| 205 | + //提交 | ||
| 206 | + $('tr.filter .filter-submit').on('click', function(){ | ||
| 207 | + var cells = $('tr.filter')[0].cells | ||
| 208 | + ,params = {} | ||
| 209 | + ,name; | ||
| 210 | + $.each(cells, function(i, cell){ | ||
| 211 | + var items = $('input,select', cell); | ||
| 212 | + for(var j = 0, item; item = items[j++];){ | ||
| 213 | + name = $(item).attr('name'); | ||
| 214 | + if(name){ | ||
| 215 | + params[name] = $(item).val(); | ||
| 216 | + } | ||
| 217 | + } | ||
| 218 | + }); | ||
| 219 | + page = 0; | ||
| 220 | + jsDoQuery(params, true); | ||
| 221 | + }); | ||
| 222 | + | ||
| 223 | + /* | ||
| 224 | + * 获取数据 p: 要提交的参数, pagination: 是否重新分页 | ||
| 225 | + */ | ||
| 226 | + function jsDoQuery(p, pagination){ | ||
| 227 | + var params = {}; | ||
| 228 | + if(p) | ||
| 229 | + params = p; | ||
| 230 | + //更新时间排序 | ||
| 231 | + params['order'] = 'lastLoginDate'; | ||
| 232 | + params['page'] = page; | ||
| 233 | + var i = layer.load(2); | ||
| 234 | + $get('/speeding/pagequery' ,params, function(data){ | ||
| 235 | + var bodyHtm = template('speeding_list_temp', {list: data.dataList}); | ||
| 236 | + $('#datatable_speeding tbody').html(bodyHtm) | ||
| 237 | + .find('.icheck').iCheck(icheckOptions) | ||
| 238 | + .on('ifChanged', iCheckChange); | ||
| 239 | + if(pagination && data.dataList.length > 0){ | ||
| 240 | + //重新分页 | ||
| 241 | + initPagination = true; | ||
| 242 | + showPagination(data); | ||
| 243 | + } | ||
| 244 | + layer.close(i); | ||
| 245 | + $(".lookTrajectory").click(function(){ | ||
| 246 | + layer.alert("暂未开放此功能!"); | ||
| 247 | + }) | ||
| 248 | + }); | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + function iCheckChange(){ | ||
| 252 | + var tr = $(this).parents('tr'); | ||
| 253 | + if(this.checked) | ||
| 254 | + tr.addClass('row-active'); | ||
| 255 | + else | ||
| 256 | + tr.removeClass('row-active'); | ||
| 257 | + | ||
| 258 | + if($('#datatable_resource input.icheck:checked').length == 1) | ||
| 259 | + $('#removeButton').removeAttr('disabled'); | ||
| 260 | + else | ||
| 261 | + $('#removeButton').attr('disabled', 'disabled'); | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + function showPagination(data){ | ||
| 265 | + //分页 | ||
| 266 | + $('#pagination').jqPaginator({ | ||
| 267 | + totalPages: data.totalPage,//总页数 | ||
| 268 | + visiblePages: 6,// 中间显示页数 | ||
| 269 | + currentPage: page + 1, | ||
| 270 | + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>', | ||
| 271 | + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>', | ||
| 272 | + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>', | ||
| 273 | + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>', | ||
| 274 | + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>', | ||
| 275 | + onPageChange: function (num, type) { | ||
| 276 | + if(initPagination){ | ||
| 277 | + initPagination = false; | ||
| 278 | + return; | ||
| 279 | + } | ||
| 280 | + page = num - 1; | ||
| 281 | + var cells = $('tr.filter')[0].cells | ||
| 282 | + ,params = {} | ||
| 283 | + ,name; | ||
| 284 | + $.each(cells, function(i, cell){ | ||
| 285 | + var items = $('input,select', cell); | ||
| 286 | + for(var j = 0, item; item = items[j++];){ | ||
| 287 | + name = $(item).attr('name'); | ||
| 288 | + if(name){ | ||
| 289 | + params[name] = $(item).val(); | ||
| 290 | + } | ||
| 291 | + } | ||
| 292 | + }); | ||
| 293 | + jsDoQuery(params, false); | ||
| 294 | + } | ||
| 295 | + }); | ||
| 296 | + } | ||
| 297 | + | ||
| 298 | + | ||
| 299 | + //删除 | ||
| 300 | + $('#removeButton').on('click', function(){ | ||
| 301 | + if($(this).attr('disabled')) | ||
| 302 | + return; | ||
| 303 | + | ||
| 304 | + var id = $('#datatable_resource input.icheck:checked').data('id'); | ||
| 305 | + | ||
| 306 | + removeConfirm('确定要删除选中的数据?', '/resource/' + id ,function(){ | ||
| 307 | + $('tr.filter .filter-submit').click(); | ||
| 308 | + }); | ||
| 309 | + }); | ||
| 310 | + | ||
| 311 | + //搜索线路 | ||
| 312 | + $.get('/basic/lineCode2Name',function(result){ | ||
| 313 | + var data=[]; | ||
| 314 | + data.push({id: " ", text: "全部线路"}); | ||
| 315 | + for(var code in result){ | ||
| 316 | + data.push({id: code, text: result[code]}); | ||
| 317 | + } | ||
| 318 | + initPinYinSelect2('#line',data,''); | ||
| 319 | + | ||
| 320 | + }); | ||
| 321 | + | ||
| 322 | +$("#line").on("change",initXl); | ||
| 323 | +function initXl(){ | ||
| 324 | +$('#nbbm').select2({ | ||
| 325 | + placeholder: '搜索车辆...', | ||
| 326 | + ajax: { | ||
| 327 | + url: '/report/carList', | ||
| 328 | + dataType: 'json', | ||
| 329 | + delay: 150, | ||
| 330 | + data: function (params) { | ||
| 331 | + return {nbbm: params.term, | ||
| 332 | + gsbm:"", | ||
| 333 | + fgsbm:"", | ||
| 334 | + xlbm:$('#line').val()}; | ||
| 335 | + }, | ||
| 336 | + processResults: function (data) { | ||
| 337 | + return { | ||
| 338 | + results: data | ||
| 339 | + }; | ||
| 340 | + }, | ||
| 341 | + cache: true | ||
| 342 | + }, | ||
| 343 | + templateResult: function (repo) { | ||
| 344 | + if (repo.loading) return repo.text; | ||
| 345 | + var h = '<span>' + repo.text + '</span>'; | ||
| 346 | + h += (repo.lineName ? ' <span class="select2-desc">' + repo.lineName + '</span>' : ''); | ||
| 347 | + return h; | ||
| 348 | + }, | ||
| 349 | + escapeMarkup: function (markup) { | ||
| 350 | + return markup; | ||
| 351 | + }, | ||
| 352 | + minimumInputLength: 1, | ||
| 353 | + templateSelection: function (repo) { | ||
| 354 | + return repo.text; | ||
| 355 | + }, | ||
| 356 | + language: { | ||
| 357 | + noResults: function () { | ||
| 358 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 359 | + }, | ||
| 360 | + inputTooShort: function (e) { | ||
| 361 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 362 | + }, | ||
| 363 | + searching: function () { | ||
| 364 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 365 | + } | ||
| 366 | + } | ||
| 367 | +}); | ||
| 368 | +} | ||
| 369 | + | ||
| 370 | + | ||
| 371 | +//改变状态 | ||
| 372 | +function changeEnabled(id,enabled){ | ||
| 373 | + debugger | ||
| 374 | + $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){ | ||
| 375 | + jsDoQuery(null, true); | ||
| 376 | + }) | ||
| 377 | +} | ||
| 378 | +}); | ||
| 379 | +</script> | ||
| 0 | \ No newline at end of file | 380 | \ No newline at end of file |