Commit 63cbb0a19689a9021b4833eacd5fa7193cb6ad7e
Merge branch 'master' of http://222.66.0.204:8090/panzhaov5/bsth_control
Showing
15 changed files
with
627 additions
and
318 deletions
src/main/java/com/bsth/controller/schedule/TTInfoDetailController.java
| @@ -2,7 +2,9 @@ package com.bsth.controller.schedule; | @@ -2,7 +2,9 @@ package com.bsth.controller.schedule; | ||
| 2 | 2 | ||
| 3 | import com.bsth.common.ResponseCode; | 3 | import com.bsth.common.ResponseCode; |
| 4 | import com.bsth.controller.BaseController; | 4 | import com.bsth.controller.BaseController; |
| 5 | +import com.bsth.entity.CarPark; | ||
| 5 | import com.bsth.entity.schedule.TTInfoDetail; | 6 | import com.bsth.entity.schedule.TTInfoDetail; |
| 7 | +import com.bsth.service.CarParkService; | ||
| 6 | import com.bsth.service.schedule.TTInfoDetailServiceImpl; | 8 | import com.bsth.service.schedule.TTInfoDetailServiceImpl; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.web.bind.annotation.PathVariable; | 10 | import org.springframework.web.bind.annotation.PathVariable; |
| @@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController; | @@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 12 | import org.springframework.web.multipart.MultipartFile; | 14 | import org.springframework.web.multipart.MultipartFile; |
| 13 | 15 | ||
| 14 | import java.util.HashMap; | 16 | import java.util.HashMap; |
| 17 | +import java.util.Iterator; | ||
| 15 | import java.util.Map; | 18 | import java.util.Map; |
| 16 | 19 | ||
| 17 | /** | 20 | /** |
| @@ -22,16 +25,29 @@ import java.util.Map; | @@ -22,16 +25,29 @@ import java.util.Map; | ||
| 22 | public class TTInfoDetailController extends BaseController<TTInfoDetail, Long> { | 25 | public class TTInfoDetailController extends BaseController<TTInfoDetail, Long> { |
| 23 | @Autowired | 26 | @Autowired |
| 24 | private TTInfoDetailServiceImpl ttInfoDetailService; | 27 | private TTInfoDetailServiceImpl ttInfoDetailService; |
| 28 | + @Autowired | ||
| 29 | + private CarParkService carParkService; | ||
| 25 | 30 | ||
| 26 | @RequestMapping(value = "/dataImportExtend", method = RequestMethod.POST) | 31 | @RequestMapping(value = "/dataImportExtend", method = RequestMethod.POST) |
| 27 | public Map<String, Object> uploadDataAndImport( | 32 | public Map<String, Object> uploadDataAndImport( |
| 28 | - MultipartFile file, String xlmc, String ttinfoname, String tccname) throws Exception { | 33 | + MultipartFile file, String xlmc, String ttinfoname, String tcccode) throws Exception { |
| 29 | Map<String, Object> resultMap = new HashMap<>(); | 34 | Map<String, Object> resultMap = new HashMap<>(); |
| 30 | 35 | ||
| 31 | try { | 36 | try { |
| 32 | - ttInfoDetailService.fileDataImport(file, xlmc, ttinfoname, tccname); | ||
| 33 | - resultMap.put("status", ResponseCode.SUCCESS); | ||
| 34 | - resultMap.put("msg", "导入成功"); | 37 | + // 查看停车场是否存在,不存在报错 |
| 38 | + Map<String, Object> param = new HashMap<>(); | ||
| 39 | + param.put("parkCode_eq", tcccode); | ||
| 40 | + Iterator<CarPark> carParkIterator = carParkService.list(param).iterator(); | ||
| 41 | + if (!carParkIterator.hasNext()) { | ||
| 42 | + // 没有停车场,报错 | ||
| 43 | + resultMap.put("status", ResponseCode.ERROR); | ||
| 44 | + resultMap.put("msg", "没有停车场数据,停车场代码=" + tcccode); | ||
| 45 | + } else { | ||
| 46 | + CarPark carPark = carParkIterator.next(); | ||
| 47 | + ttInfoDetailService.fileDataImport(file, xlmc, ttinfoname, carPark.getParkName()); | ||
| 48 | + resultMap.put("status", ResponseCode.SUCCESS); | ||
| 49 | + resultMap.put("msg", "导入成功"); | ||
| 50 | + } | ||
| 35 | } catch (Exception exp) { | 51 | } catch (Exception exp) { |
| 36 | exp.printStackTrace(); | 52 | exp.printStackTrace(); |
| 37 | throw exp; | 53 | throw exp; |
src/main/java/com/bsth/service/impl/StationServiceImpl.java
| @@ -192,7 +192,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -192,7 +192,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 192 | 192 | ||
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | - if(resultLine.getStartStationName()==null){ | 195 | + if(resultLine.getStartStationName().equals("")){ |
| 196 | 196 | ||
| 197 | for(int k =0;k<sizeL;k++) { | 197 | for(int k =0;k<sizeL;k++) { |
| 198 | 198 | ||
| @@ -209,7 +209,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -209,7 +209,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 209 | 209 | ||
| 210 | }; | 210 | }; |
| 211 | 211 | ||
| 212 | - if(resultLine.getEndStationName()==null) { | 212 | + if(resultLine.getEndStationName().equals("")) { |
| 213 | 213 | ||
| 214 | for(int k =0;k<sizeL;k++) { | 214 | for(int k =0;k<sizeL;k++) { |
| 215 | 215 | ||
| @@ -1334,153 +1334,8 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1334,153 +1334,8 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1334 | if(!stationJSON.equals("")) { | 1334 | if(!stationJSON.equals("")) { |
| 1335 | 1335 | ||
| 1336 | // 保存站点与站点路由信息 | 1336 | // 保存站点与站点路由信息 |
| 1337 | - resultSaveMapm = savaStationAndStationRouteInfo( stationJSON, sectionDistance, sectionDuration, dbType,radius, shapesType, destroy, versions, sumUpOrDownMileage, directions, resultLine); | ||
| 1338 | - | ||
| 1339 | - /* | 1337 | + // resultSaveMapm = savaStationAndStationRouteInfo( stationJSON, sectionDistance, sectionDuration, dbType,radius, shapesType, destroy, versions, sumUpOrDownMileage, directions, resultLine); |
| 1340 | 1338 | ||
| 1341 | - JSONArray stationsArray = JSONArray.parseArray(stationJSON); | ||
| 1342 | - | ||
| 1343 | - for(int i = 0;i <stationsArray.size();i++) { | ||
| 1344 | - | ||
| 1345 | - // 站点名称 | ||
| 1346 | - String stationName = stationsArray.getJSONObject(i).equals("") ? "" : stationsArray.getJSONObject(i).get("name").toString(); | ||
| 1347 | - | ||
| 1348 | - String distanceStr = stationsArray.getJSONObject(i).equals("") ? "" : stationsArray.getJSONObject(i).get("distance").toString(); | ||
| 1349 | - | ||
| 1350 | - String durationStr = stationsArray.getJSONObject(i).equals("") ? "" : stationsArray.getJSONObject(i).get("duration").toString(); | ||
| 1351 | - | ||
| 1352 | - // 百度经纬度坐标 | ||
| 1353 | - String bJwpoints = ""; | ||
| 1354 | - | ||
| 1355 | - // 百度坐标经度 | ||
| 1356 | - String bLonx = JSONObject.parseObject(stationsArray.getJSONObject(i).get("potion").toString()).get("lng").toString(); | ||
| 1357 | - | ||
| 1358 | - // 百度坐标纬度 | ||
| 1359 | - String bLatx = JSONObject.parseObject(stationsArray.getJSONObject(i).get("potion").toString()).get("lat").toString(); | ||
| 1360 | - | ||
| 1361 | - // 百度经纬度 | ||
| 1362 | - bJwpoints = bLonx + " " + bLatx; | ||
| 1363 | - | ||
| 1364 | - List<Object[]> stationNameList = repository.findStationName(stationName); | ||
| 1365 | - | ||
| 1366 | - boolean isHave = isHaveStationname(bJwpoints,stationNameList); | ||
| 1367 | - | ||
| 1368 | - // 初始化站点对象 | ||
| 1369 | - Station arg0 = new Station(); | ||
| 1370 | - | ||
| 1371 | - // 站点编码 | ||
| 1372 | - long stationCode = 0L; | ||
| 1373 | - | ||
| 1374 | - if(isHave) { | ||
| 1375 | - | ||
| 1376 | - Integer stationId = Integer.parseInt(stationNameList.get(0)[1].toString()); | ||
| 1377 | - | ||
| 1378 | - arg0 = repository.findOne(stationId); | ||
| 1379 | - | ||
| 1380 | - stationCode = Integer.parseInt(arg0.getStationCod()); | ||
| 1381 | - | ||
| 1382 | - }else { | ||
| 1383 | - | ||
| 1384 | - stationCode = GetUIDAndCode.getStationId(); | ||
| 1385 | - | ||
| 1386 | - int stationId = (int) (stationCode); | ||
| 1387 | - | ||
| 1388 | - arg0.setId(stationId); | ||
| 1389 | - | ||
| 1390 | - arg0.setStationName(stationName); | ||
| 1391 | - | ||
| 1392 | - // 原坐标类型 | ||
| 1393 | - arg0.setDbType(dbType); | ||
| 1394 | - | ||
| 1395 | - // 站点地理位置WGS坐标经度 | ||
| 1396 | - String gLonx = JSONObject.parseObject(stationsArray.getJSONObject(i).get("WGSpotion").toString()).get("Lng").toString(); | ||
| 1397 | - arg0.setgLonx(Float.parseFloat(gLonx)); | ||
| 1398 | - | ||
| 1399 | - // 站点地理位置WGS坐标纬度 | ||
| 1400 | - String gLaty = JSONObject.parseObject(stationsArray.getJSONObject(i).get("WGSpotion").toString()).get("Lat").toString(); | ||
| 1401 | - arg0.setgLaty(Float.parseFloat(gLaty)); | ||
| 1402 | - | ||
| 1403 | - // 半径 | ||
| 1404 | - int radius = map.get("radius").equals("") ? 0 : Integer.parseInt(map.get("radius").toString()); | ||
| 1405 | - arg0.setRadius(radius); | ||
| 1406 | - | ||
| 1407 | - // 图形类型 | ||
| 1408 | - String shapesType = map.get("shapesType").equals("") ? "" : map.get("shapesType").toString(); | ||
| 1409 | - arg0.setShapesType(shapesType); | ||
| 1410 | - | ||
| 1411 | - // 站点编码 | ||
| 1412 | - arg0.setStationCod(String.valueOf(stationCode)); | ||
| 1413 | - | ||
| 1414 | - // 是否想撤销 | ||
| 1415 | - arg0.setDestroy(destroy); | ||
| 1416 | - | ||
| 1417 | - // 版本号 | ||
| 1418 | - arg0.setVersions(versions); | ||
| 1419 | - | ||
| 1420 | - arg0.setbJwpoints(bJwpoints); | ||
| 1421 | - | ||
| 1422 | - // 插入站点信息 | ||
| 1423 | - repository.save(arg0); | ||
| 1424 | - | ||
| 1425 | - | ||
| 1426 | - // 站点路由对象 | ||
| 1427 | - StationRoute route = new StationRoute(); | ||
| 1428 | - | ||
| 1429 | - // 站点名称 | ||
| 1430 | - route.setStationName(stationName); | ||
| 1431 | - | ||
| 1432 | - route.setDistances(distance); | ||
| 1433 | - | ||
| 1434 | - route.setToTime(duration); | ||
| 1435 | - | ||
| 1436 | - route.setDestroy(destroy); | ||
| 1437 | - | ||
| 1438 | - // 站点编码 | ||
| 1439 | - route.setStationCode(arg0.getStationCod()); | ||
| 1440 | - | ||
| 1441 | - // 站点序号 | ||
| 1442 | - route.setStationRouteCode((i+1)*100); | ||
| 1443 | - | ||
| 1444 | - // 站点类型 | ||
| 1445 | - if(i==0) { | ||
| 1446 | - | ||
| 1447 | - // 起始站 | ||
| 1448 | - route.setStationMark("B"); | ||
| 1449 | - | ||
| 1450 | - }else if(i==stationsArray.size()-1) { | ||
| 1451 | - | ||
| 1452 | - // 终点站 | ||
| 1453 | - route.setStationMark("E"); | ||
| 1454 | - | ||
| 1455 | - }else { | ||
| 1456 | - | ||
| 1457 | - // 中途站 | ||
| 1458 | - route.setStationMark("Z"); | ||
| 1459 | - | ||
| 1460 | - } | ||
| 1461 | - | ||
| 1462 | - // 版本号 | ||
| 1463 | - route.setVersions(versions); | ||
| 1464 | - | ||
| 1465 | - // 站点ID | ||
| 1466 | - route.setStation(arg0); | ||
| 1467 | - | ||
| 1468 | - // 方向 | ||
| 1469 | - route.setDirections(directions); | ||
| 1470 | - | ||
| 1471 | - // 线路ID | ||
| 1472 | - route.setLine(resultLine); | ||
| 1473 | - | ||
| 1474 | - // 线路编码 | ||
| 1475 | - route.setLineCode(resultLine.getLineCode()); | ||
| 1476 | - | ||
| 1477 | - | ||
| 1478 | - // 插入站点路由信息 | ||
| 1479 | - routeRepository.save(route); | ||
| 1480 | - | ||
| 1481 | - } | ||
| 1482 | - } | ||
| 1483 | - */ | ||
| 1484 | } | 1339 | } |
| 1485 | 1340 | ||
| 1486 | // 路段长度 | 1341 | // 路段长度 |
| @@ -1492,7 +1347,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1492,7 +1347,7 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1492 | // 如果路段信息JSON字符串不为空 | 1347 | // 如果路段信息JSON字符串不为空 |
| 1493 | if(!sectionJSON.equals("")) { | 1348 | if(!sectionJSON.equals("")) { |
| 1494 | 1349 | ||
| 1495 | - manualSaveSectionAndSectionRoute(sectionJSON, speedLimitStr, sectionDistance, sectionDuration, dbType, versions, resultLine, destroy, directions); | 1350 | + // manualSaveSectionAndSectionRoute(sectionJSON, speedLimitStr, sectionDistance, sectionDuration, dbType, versions, resultLine, destroy, directions); |
| 1496 | 1351 | ||
| 1497 | } | 1352 | } |
| 1498 | 1353 | ||
| @@ -1504,11 +1359,11 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | @@ -1504,11 +1359,11 @@ public class StationServiceImpl extends BaseServiceImpl<Station, Integer> implem | ||
| 1504 | sumUpOrDownMileage = s.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | 1359 | sumUpOrDownMileage = s.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
| 1505 | 1360 | ||
| 1506 | // 更新里程 | 1361 | // 更新里程 |
| 1507 | - updateLineInfoUpOrDownMileage( resultLine , directions, sumUpOrDownMileage); | 1362 | + // updateLineInfoUpOrDownMileage( resultLine , directions, sumUpOrDownMileage); |
| 1508 | 1363 | ||
| 1509 | if(directions==0) { | 1364 | if(directions==0) { |
| 1510 | 1365 | ||
| 1511 | - lineUpdateStationName(resultLine); | 1366 | + // lineUpdateStationName(resultLine); |
| 1512 | 1367 | ||
| 1513 | } | 1368 | } |
| 1514 | 1369 |
src/main/resources/static/index.html
| @@ -195,6 +195,14 @@ tr.row-active td { | @@ -195,6 +195,14 @@ tr.row-active td { | ||
| 195 | <div id="route-container"> | 195 | <div id="route-container"> |
| 196 | <div ng-app="ScheduleApp"> | 196 | <div ng-app="ScheduleApp"> |
| 197 | <div ng-controller="ScheduleAppController"> | 197 | <div ng-controller="ScheduleAppController"> |
| 198 | + | ||
| 199 | + <!-- loading widget --> | ||
| 200 | + <div id="loadingWidget" class="flyover mask" loading-widget> | ||
| 201 | + <div class="alert alert-info"> | ||
| 202 | + <strong>载入中......</strong> | ||
| 203 | + </div> | ||
| 204 | + </div> | ||
| 205 | + | ||
| 198 | <div ui-view class="fade-in-up"> </div> | 206 | <div ui-view class="fade-in-up"> </div> |
| 199 | </div> | 207 | </div> |
| 200 | </div> | 208 | </div> |
src/main/resources/static/pages/base/stationroute/addstationstemplate.html
| @@ -33,6 +33,26 @@ | @@ -33,6 +33,26 @@ | ||
| 33 | </div> | 33 | </div> |
| 34 | 34 | ||
| 35 | <div class="form-group"> | 35 | <div class="form-group"> |
| 36 | + <label class="col-md-3 control-label">坐标系类型:</label> | ||
| 37 | + <div class="col-md-9"> | ||
| 38 | + <div class="icheck-list"> | ||
| 39 | + <label> | ||
| 40 | + <input type="radio" class="icheck" name="baseRes" value='No'> 暂无坐标系 | ||
| 41 | + </label> | ||
| 42 | + <label> | ||
| 43 | + <input type="radio" class="icheck" name="baseRes" value='GCJ-02' > 火星坐标系 | ||
| 44 | + </label> | ||
| 45 | + <label > | ||
| 46 | + <input type="radio" class="icheck" name="baseRes" value='BD-09'> 百度坐标系 | ||
| 47 | + </label> | ||
| 48 | + <label > | ||
| 49 | + <input type="radio" class="icheck" name="baseRes" value='WGS84' checked> WGS84坐标系 | ||
| 50 | + </label> | ||
| 51 | + </div> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + | ||
| 55 | + <div class="form-group"> | ||
| 36 | <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50"> | 56 | <div class="alert alert-info font-blue-chambray" style="background-color: #2C3E50"> |
| 37 | <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 手动添加站点规划说明: </span></h5> | 57 | <h5 class="block"><span class="help-block" style="color:#1bbc9b;"> * 手动添加站点规划说明: </span></h5> |
| 38 | <p> | 58 | <p> |
| @@ -146,21 +166,135 @@ $('#add_station_template_mobal').on('AddStationTempMobal.show', function(e,map,a | @@ -146,21 +166,135 @@ $('#add_station_template_mobal').on('AddStationTempMobal.show', function(e,map,a | ||
| 146 | // 弹出正在加载层 | 166 | // 弹出正在加载层 |
| 147 | var i = layer.load(0,{offset:['200px', '280px']}); | 167 | var i = layer.load(0,{offset:['200px', '280px']}); |
| 148 | 168 | ||
| 149 | - // 表单序列画 | 169 | + // 表单序列化 |
| 150 | var params = form.serializeJSON(); | 170 | var params = form.serializeJSON(); |
| 151 | 171 | ||
| 172 | + var baseResValue = params.baseRes; | ||
| 173 | + | ||
| 152 | // 站点名称字符串切割 | 174 | // 站点名称字符串切割 |
| 153 | var paramsStationsArray = params.stations.split('\r\n'); | 175 | var paramsStationsArray = params.stations.split('\r\n'); |
| 154 | 176 | ||
| 155 | - var stationList = []; | ||
| 156 | - | ||
| 157 | var len = paramsStationsArray.length; | 177 | var len = paramsStationsArray.length; |
| 158 | 178 | ||
| 159 | - if(len>0) { | 179 | + if(baseResValue=='No'){ |
| 160 | 180 | ||
| 161 | - for(var k =0;k<len;k++) { | 181 | + debugger; |
| 182 | + | ||
| 183 | + var stationList = []; | ||
| 184 | + | ||
| 185 | + for(var k =0;k<len;k++) | ||
| 186 | + stationList.push({name:paramsStationsArray[k]+'公交车站'}); | ||
| 187 | + | ||
| 188 | + | ||
| 189 | + console.log(stationList); | ||
| 190 | + | ||
| 191 | + return; | ||
| 192 | + | ||
| 193 | + // 根据站点名称获取百度坐标 | ||
| 194 | + map.stationsNameToPoints(stationList,function(resultJson) { | ||
| 162 | 195 | ||
| 163 | - debugger; | 196 | + // 根据坐标点获取两点之间的时间与距离 |
| 197 | + map.getDistanceAndDuration(resultJson,function(stationdataList) { | ||
| 198 | + | ||
| 199 | + // 根据坐标点获取两点之间的折线路段 | ||
| 200 | + map.getSectionListPlonly(stationdataList,function(sectiondata) { | ||
| 201 | + | ||
| 202 | + var addLine = LineObj.getLineObj(); | ||
| 203 | + | ||
| 204 | + // 设置第一个站的距离 | ||
| 205 | + stationdataList[0].distance = ''; | ||
| 206 | + | ||
| 207 | + // 设置第一个站的时间 | ||
| 208 | + stationdataList[0].duration = ''; | ||
| 209 | + | ||
| 210 | + // 定义站点信息JSON字符串 | ||
| 211 | + var stationJSON = JSON.stringify(stationdataList); | ||
| 212 | + | ||
| 213 | + // 定义路段信息字符串 | ||
| 214 | + var sectionJSON = JSON.stringify(sectiondata); | ||
| 215 | + | ||
| 216 | + // 参数集合 | ||
| 217 | + var params = {}; | ||
| 218 | + | ||
| 219 | + // 站点信息JSON字符串 | ||
| 220 | + params.stationJSON = stationJSON; | ||
| 221 | + | ||
| 222 | + // 线路ID | ||
| 223 | + params.lineId = addLine.id; | ||
| 224 | + | ||
| 225 | + // 方向 | ||
| 226 | + params.directions = directionData; | ||
| 227 | + | ||
| 228 | + // 原始坐标类型 | ||
| 229 | + params.dbType = 'b'; | ||
| 230 | + | ||
| 231 | + // 圆形半径 | ||
| 232 | + params.radius = '100'; | ||
| 233 | + | ||
| 234 | + // 限速 | ||
| 235 | + params.speedLimit = '60'; | ||
| 236 | + | ||
| 237 | + // 图形类型(r:圆形;p:多边形) | ||
| 238 | + params.shapesType = 'r'; | ||
| 239 | + | ||
| 240 | + // destroy:是否撤销 | ||
| 241 | + params.destroy = '0'; | ||
| 242 | + | ||
| 243 | + // versions:版本号 | ||
| 244 | + params.versions = '1'; | ||
| 245 | + | ||
| 246 | + // 路段信息JSON字符串 | ||
| 247 | + params.sectionJSON = sectionJSON; | ||
| 248 | + | ||
| 249 | + // 保存 | ||
| 250 | + ajaxd.manualSave(params,function(rd) { | ||
| 251 | + | ||
| 252 | + if(rd.status='SUCCESS') { | ||
| 253 | + | ||
| 254 | + layer.msg('保存成功!'); | ||
| 255 | + | ||
| 256 | + }else { | ||
| 257 | + | ||
| 258 | + layer.msg('保存失败!'); | ||
| 259 | + | ||
| 260 | + } | ||
| 261 | + | ||
| 262 | + // 关闭弹出层 | ||
| 263 | + layer.closeAll(); | ||
| 264 | + | ||
| 265 | + // 清除地图覆盖物 | ||
| 266 | + map.clearMarkAndOverlays(); | ||
| 267 | + | ||
| 268 | + // 刷新树 | ||
| 269 | + fun.resjtreeDate(addLine.id,directionData); | ||
| 270 | + | ||
| 271 | + // 查询上行路段信息 | ||
| 272 | + ajaxd.getSectionRouteInfo(addLine.id,directionData,function(data) { | ||
| 273 | + | ||
| 274 | + // 在地图上画出线路走向 | ||
| 275 | + fun.linePanlThree(data,directionData); | ||
| 276 | + | ||
| 277 | + }); | ||
| 278 | + | ||
| 279 | + }); | ||
| 280 | + | ||
| 281 | + }); | ||
| 282 | + | ||
| 283 | + }); | ||
| 284 | + | ||
| 285 | + }); | ||
| 286 | + | ||
| 287 | + }else { | ||
| 288 | + | ||
| 289 | + | ||
| 290 | + | ||
| 291 | + | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + | ||
| 295 | + /* if(len>0) { | ||
| 296 | + | ||
| 297 | + for(var k =0;k<len;k++) { | ||
| 164 | 298 | ||
| 165 | if(paramsStationsArray[k]=="") | 299 | if(paramsStationsArray[k]=="") |
| 166 | continue; | 300 | continue; |
| @@ -185,102 +319,7 @@ $('#add_station_template_mobal').on('AddStationTempMobal.show', function(e,map,a | @@ -185,102 +319,7 @@ $('#add_station_template_mobal').on('AddStationTempMobal.show', function(e,map,a | ||
| 185 | 319 | ||
| 186 | return; | 320 | return; |
| 187 | 321 | ||
| 188 | - } | ||
| 189 | - console.log(stationList); | ||
| 190 | - // 根据站点名称获取百度坐标 | ||
| 191 | - map.stationsNameToPoints(stationList,function(resultJson) { | ||
| 192 | - console.log(resultJson); | ||
| 193 | - debugger; | ||
| 194 | - // 根据坐标点获取两点之间的时间与距离 | ||
| 195 | - map.getDistanceAndDuration(resultJson,function(stationdataList) { | ||
| 196 | - | ||
| 197 | - // 根据坐标点获取两点之间的折线路段 | ||
| 198 | - map.getSectionListPlonly(stationdataList,function(sectiondata) { | ||
| 199 | - | ||
| 200 | - var addLine = LineObj.getLineObj(); | ||
| 201 | - | ||
| 202 | - // 设置第一个站的距离 | ||
| 203 | - stationdataList[0].distance = ''; | ||
| 204 | - | ||
| 205 | - // 设置第一个站的时间 | ||
| 206 | - stationdataList[0].duration = ''; | ||
| 207 | - | ||
| 208 | - // 定义站点信息JSON字符串 | ||
| 209 | - var stationJSON = JSON.stringify(stationdataList); | ||
| 210 | - | ||
| 211 | - // 定义路段信息字符串 | ||
| 212 | - var sectionJSON = JSON.stringify(sectiondata); | ||
| 213 | - | ||
| 214 | - // 参数集合 | ||
| 215 | - var params = {}; | ||
| 216 | - | ||
| 217 | - // 站点信息JSON字符串 | ||
| 218 | - params.stationJSON = stationJSON; | ||
| 219 | - | ||
| 220 | - // 线路ID | ||
| 221 | - params.lineId = addLine.id; | ||
| 222 | - | ||
| 223 | - // 方向 | ||
| 224 | - params.directions = directionData; | ||
| 225 | - | ||
| 226 | - // 原始坐标类型 | ||
| 227 | - params.dbType = 'b'; | ||
| 228 | - | ||
| 229 | - // 圆形半径 | ||
| 230 | - params.radius = '100'; | ||
| 231 | - | ||
| 232 | - // 限速 | ||
| 233 | - params.speedLimit = '60'; | ||
| 234 | - | ||
| 235 | - // 图形类型(r:圆形;p:多边形) | ||
| 236 | - params.shapesType = 'r'; | ||
| 237 | - | ||
| 238 | - // destroy:是否撤销 | ||
| 239 | - params.destroy = '0'; | ||
| 240 | - | ||
| 241 | - // versions:版本号 | ||
| 242 | - params.versions = '1'; | ||
| 243 | - | ||
| 244 | - // 路段信息JSON字符串 | ||
| 245 | - params.sectionJSON = sectionJSON; | ||
| 246 | - | ||
| 247 | - // 保存 | ||
| 248 | - ajaxd.manualSave(params,function(rd) { | ||
| 249 | - | ||
| 250 | - if(rd.status='SUCCESS') { | ||
| 251 | - | ||
| 252 | - layer.msg('保存成功!'); | ||
| 253 | - | ||
| 254 | - }else { | ||
| 255 | - | ||
| 256 | - layer.msg('保存失败!'); | ||
| 257 | - | ||
| 258 | - } | ||
| 259 | - | ||
| 260 | - // 关闭弹出层 | ||
| 261 | - layer.closeAll(); | ||
| 262 | - | ||
| 263 | - // 清除地图覆盖物 | ||
| 264 | - map.clearMarkAndOverlays(); | ||
| 265 | - | ||
| 266 | - // 刷新树 | ||
| 267 | - fun.resjtreeDate(addLine.id,directionData); | ||
| 268 | - | ||
| 269 | - // 查询上行路段信息 | ||
| 270 | - ajaxd.getSectionRouteInfo(addLine.id,directionData,function(data) { | ||
| 271 | - | ||
| 272 | - // 在地图上画出线路走向 | ||
| 273 | - fun.linePanlThree(data,directionData); | ||
| 274 | - | ||
| 275 | - }); | ||
| 276 | - | ||
| 277 | - }); | ||
| 278 | - | ||
| 279 | - }); | ||
| 280 | - | ||
| 281 | - }); | ||
| 282 | - | ||
| 283 | - }); | 322 | + } */ |
| 284 | 323 | ||
| 285 | } | 324 | } |
| 286 | 325 |
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
| @@ -301,11 +301,14 @@ var PublicFunctions = function () { | @@ -301,11 +301,14 @@ var PublicFunctions = function () { | ||
| 301 | // 添加站点坐标 | 301 | // 添加站点坐标 |
| 302 | tempM.potion = BusLine.getBusStation(k).position; | 302 | tempM.potion = BusLine.getBusStation(k).position; |
| 303 | 303 | ||
| 304 | + tempM.wgs = {x:'',y:''}; | ||
| 305 | + | ||
| 304 | // 添加 | 306 | // 添加 |
| 305 | stationInfo.push(tempM); | 307 | stationInfo.push(tempM); |
| 306 | 308 | ||
| 307 | } | 309 | } |
| 308 | - | 310 | + console.log(stationInfo); |
| 311 | + debugger; | ||
| 309 | // 获取站点之间的距离与时间 | 312 | // 获取站点之间的距离与时间 |
| 310 | WorldsBMap.getDistanceAndDuration(stationInfo,function(json) { | 313 | WorldsBMap.getDistanceAndDuration(stationInfo,function(json) { |
| 311 | 314 |
src/main/resources/static/pages/scheduleApp/module/common/main.css
| @@ -55,3 +55,21 @@ form input.ng-valid.ng-dirty.ng-valid-required { | @@ -55,3 +55,21 @@ form input.ng-valid.ng-dirty.ng-valid-required { | ||
| 55 | overflow: hidden; | 55 | overflow: hidden; |
| 56 | text-overflow: ellipsis; | 56 | text-overflow: ellipsis; |
| 57 | } | 57 | } |
| 58 | + | ||
| 59 | +.flyover .alert { | ||
| 60 | + left: 50%; | ||
| 61 | + top: 50%; | ||
| 62 | + position: fixed; | ||
| 63 | + z-index: 1050; | ||
| 64 | +} | ||
| 65 | + | ||
| 66 | +.flyover.mask { | ||
| 67 | + top: 0; | ||
| 68 | + left: 0; | ||
| 69 | + position: fixed; | ||
| 70 | + width: 100%; | ||
| 71 | + height: 100%; | ||
| 72 | + opacity: 0.5; | ||
| 73 | + background: black; | ||
| 74 | + z-index: 1049; | ||
| 75 | +} |
src/main/resources/static/pages/scheduleApp/module/common/main.js
| @@ -8,8 +8,86 @@ var ScheduleApp = angular.module('ScheduleApp', [ | @@ -8,8 +8,86 @@ var ScheduleApp = angular.module('ScheduleApp', [ | ||
| 8 | 'ngResource' // resource服务 | 8 | 'ngResource' // resource服务 |
| 9 | ]); | 9 | ]); |
| 10 | 10 | ||
| 11 | +/** | ||
| 12 | + * 用于请求通知。 | ||
| 13 | + */ | ||
| 14 | +ScheduleApp.factory('requestNotificationChannel', ['$rootScope', function($rootScope) { | ||
| 15 | + // 通知消息常量 | ||
| 16 | + var _START_REQUEST_ = '_START_REQUEST_'; // 开始请求通知message | ||
| 17 | + var _END_REQUEST_ = '_END_REQUEST_'; // 请求结束通知message | ||
| 18 | + | ||
| 19 | + // 计数器 | ||
| 20 | + var activeCalls = 0; | ||
| 21 | + | ||
| 22 | + // 发布开始请求通知 | ||
| 23 | + var requestStarted = function() { | ||
| 24 | + activeCalls += 1; | ||
| 25 | + console.log("activeCalls=" + activeCalls); | ||
| 26 | + $rootScope.$broadcast(_START_REQUEST_); | ||
| 27 | + }; | ||
| 28 | + // 发布请求结束通知 | ||
| 29 | + var requestEnded = function() { | ||
| 30 | + activeCalls -= 1; | ||
| 31 | + console.log("activeCalls=" + activeCalls); | ||
| 32 | + $rootScope.$broadcast(_END_REQUEST_); | ||
| 33 | + }; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 订阅开始请求通知。 | ||
| 37 | + * @param $scope 作用域 | ||
| 38 | + * @param handler 通知处理器函数 | ||
| 39 | + */ | ||
| 40 | + var onRequestStarted = function($scope, handler) { | ||
| 41 | + $scope.$on(_START_REQUEST_, function(event) { | ||
| 42 | + handler(); | ||
| 43 | + }); | ||
| 44 | + }; | ||
| 45 | + /** | ||
| 46 | + * 订阅请求结束通知。 | ||
| 47 | + * @param $scope 作用域 | ||
| 48 | + * @param handler 通知处理器函数 | ||
| 49 | + */ | ||
| 50 | + var onRequestEnded = function($scope, handler) { | ||
| 51 | + $scope.$on(_END_REQUEST_, function(event) { | ||
| 52 | + handler(); | ||
| 53 | + }); | ||
| 54 | + }; | ||
| 55 | + | ||
| 56 | + return { | ||
| 57 | + requestStarted : requestStarted, | ||
| 58 | + requestEnded : requestEnded, | ||
| 59 | + onRequestStarted : onRequestStarted, | ||
| 60 | + onRequestEnded : onRequestEnded | ||
| 61 | + }; | ||
| 62 | + | ||
| 63 | +}]); | ||
| 64 | + | ||
| 65 | +// http 拦截器 | ||
| 66 | +ScheduleApp.factory('myInterceptor', ['requestNotificationChannel', function(requestNotificationChannel) { | ||
| 67 | + return { | ||
| 68 | + request: function(config) { | ||
| 69 | + requestNotificationChannel.requestStarted(); | ||
| 70 | + return config; | ||
| 71 | + }, | ||
| 72 | + requestError: function(rejection) { | ||
| 73 | + requestNotificationChannel.requestEnded(); | ||
| 74 | + return rejection; | ||
| 75 | + }, | ||
| 76 | + response: function(response) { | ||
| 77 | + requestNotificationChannel.requestEnded(); | ||
| 78 | + return response; | ||
| 79 | + }, | ||
| 80 | + responseError: function(rejection) { | ||
| 81 | + requestNotificationChannel.requestEnded(); | ||
| 82 | + return rejection; | ||
| 83 | + } | ||
| 84 | + }; | ||
| 85 | + | ||
| 86 | +}]); | ||
| 87 | + | ||
| 11 | ScheduleApp.config(['$httpProvider', function($httpProvider) { | 88 | ScheduleApp.config(['$httpProvider', function($httpProvider) { |
| 12 | $httpProvider.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; | 89 | $httpProvider.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; |
| 90 | + $httpProvider.interceptors.push('myInterceptor'); | ||
| 13 | }]); | 91 | }]); |
| 14 | 92 | ||
| 15 | /** ocLazyLoader 配置 */ | 93 | /** ocLazyLoader 配置 */ |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| 1 | // 自定义指令,指令模版在dt目录下 | 1 | // 自定义指令,指令模版在dt目录下 |
| 2 | 2 | ||
| 3 | + | ||
| 4 | +angular.module('ScheduleApp').directive('loadingWidget', ['requestNotificationChannel', function(requestNotificationChannel) { | ||
| 5 | + return { | ||
| 6 | + restrict: 'A', | ||
| 7 | + link: function(scope, element) { | ||
| 8 | + // 初始隐藏loading界面 | ||
| 9 | + element.hide(); | ||
| 10 | + | ||
| 11 | + // 开始请求通知处理 | ||
| 12 | + requestNotificationChannel.onRequestStarted(scope, function() { | ||
| 13 | + element.show(); | ||
| 14 | + }); | ||
| 15 | + // 请求结束通知处理 | ||
| 16 | + requestNotificationChannel.onRequestEnded(scope, function() { | ||
| 17 | + element.hide(); | ||
| 18 | + }); | ||
| 19 | + } | ||
| 20 | + }; | ||
| 21 | +}]); | ||
| 22 | + | ||
| 3 | angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) { | 23 | angular.module('ScheduleApp').directive("saSelect", ['$timeout', function($timeout) { |
| 4 | return { | 24 | return { |
| 5 | restrict: 'E', | 25 | restrict: 'E', |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| @@ -545,7 +545,7 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | @@ -545,7 +545,7 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi | ||
| 545 | } | 545 | } |
| 546 | }) | 546 | }) |
| 547 | .state("timeTableDetailInfoManage", { | 547 | .state("timeTableDetailInfoManage", { |
| 548 | - url: '/timeTableDetailInfoManage/:xlid/:ttid', | 548 | + url: '/timeTableDetailInfoManage/:xlid/:ttid/:xlname/:ttname', |
| 549 | views: { | 549 | views: { |
| 550 | "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info.html'} | 550 | "": {templateUrl: 'pages/scheduleApp/module/core/timeTableManage/detail_info.html'} |
| 551 | }, | 551 | }, |
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/detail_info.html
| @@ -18,17 +18,24 @@ | @@ -18,17 +18,24 @@ | ||
| 18 | <i class="fa fa-circle"></i> | 18 | <i class="fa fa-circle"></i> |
| 19 | </li> | 19 | </li> |
| 20 | <li> | 20 | <li> |
| 21 | - <span class="active">待测试时刻表明细</span> | 21 | + <span class="active">编辑时刻表明细信息</span> |
| 22 | </li> | 22 | </li> |
| 23 | </ul> | 23 | </ul> |
| 24 | 24 | ||
| 25 | -<div class="row" id="timeTableDetail" > | 25 | +<!--<!– loading widget –>--> |
| 26 | +<!--<div id="loadingWidget" class="flyover mask" loading-widget>--> | ||
| 27 | + <!--<div class="alert alert-info">--> | ||
| 28 | + <!--<strong>载入中......</strong>--> | ||
| 29 | + <!--</div>--> | ||
| 30 | +<!--</div>--> | ||
| 31 | + | ||
| 32 | +<div class="row" id="timeTableDetail" ng-controller="TimeTableDetailManageCtrl as ctrl"> | ||
| 26 | <div class="col-md-12"> | 33 | <div class="col-md-12"> |
| 27 | <div class="portlet light bordered"> | 34 | <div class="portlet light bordered"> |
| 28 | <div class="portlet-title"> | 35 | <div class="portlet-title"> |
| 29 | <div class="caption font-dark"> | 36 | <div class="caption font-dark"> |
| 30 | <i class="fa fa-database font-dark"></i> | 37 | <i class="fa fa-database font-dark"></i> |
| 31 | - <span class="caption-subject bold uppercase">待测试时刻表明细</span> | 38 | + <span class="caption-subject bold uppercase" ng-bind="ctrl.title"></span> |
| 32 | </div> | 39 | </div> |
| 33 | <div class="actions"> | 40 | <div class="actions"> |
| 34 | <a href="javascirpt:" class="btn btn-circle blue"> | 41 | <a href="javascirpt:" class="btn btn-circle blue"> |
| @@ -86,24 +93,55 @@ | @@ -86,24 +93,55 @@ | ||
| 86 | 93 | ||
| 87 | <div class="portlet-body"> | 94 | <div class="portlet-body"> |
| 88 | <!--<div ng-view></div>--> | 95 | <!--<div ng-view></div>--> |
| 89 | - <table class="table table-striped table-bordered table-hover table-checkable order-column" ng-controller="TimeTableDetailManageCtrl as ctrl"> | ||
| 90 | - <thead> | ||
| 91 | - <tr> | ||
| 92 | - <th ng-repeat="head in ctrl.detailHeads track by $index"> | ||
| 93 | - <span ng-bind="head"></span> | ||
| 94 | - </th> | 96 | + <div class="fixDiv"> |
| 97 | + <table style="width: 2000px" class="table table-striped table-bordered table-hover table-checkable order-column"> | ||
| 98 | + <thead> | ||
| 99 | + <tr> | ||
| 100 | + <th ng-repeat="head in ctrl.detailHeads track by $index"> | ||
| 101 | + <span ng-bind="head"></span> | ||
| 102 | + </th> | ||
| 103 | + | ||
| 104 | + </tr> | ||
| 105 | + </thead> | ||
| 106 | + <tbody> | ||
| 107 | + <tr ng-repeat="info in ctrl.detailInfos"> | ||
| 108 | + <td ng-repeat="cell in info track by $index"> | ||
| 109 | + | ||
| 110 | + <!--<span ng-bind="cell.fcsj"></span>--> | ||
| 111 | + <span ng-if="!cell.ttdid" ng-bind="cell.fcsj"></span> | ||
| 112 | + | ||
| 113 | + <div ng-if="cell.ttdid" class="btn-group"> | ||
| 114 | + <a href="javascript:" class="btn blue btn-outline btn-circle" data-toggle="dropdown"> | ||
| 115 | + <i class="fa fa-share"></i> | ||
| 116 | + <span ng-bind="cell.fcsj"></span> | ||
| 117 | + <i class="fa fa-angle-down"></i> | ||
| 118 | + </a> | ||
| 119 | + <ul class="dropdown-menu pull-left"> | ||
| 120 | + <li> | ||
| 121 | + <a href="javascript:" class="tool-action" ng-click="ctrl.editBcInfo(cell)"> | ||
| 122 | + <i class="fa fa-file-excel-o"></i> | ||
| 123 | + 修改 | ||
| 124 | + </a> | ||
| 125 | + </li> | ||
| 126 | + <li class="divider"></li> | ||
| 127 | + <li> | ||
| 128 | + <a href="javascript:" class="tool-action"> | ||
| 129 | + <i class="fa fa-refresh"></i> | ||
| 130 | + 删除 | ||
| 131 | + </a> | ||
| 132 | + </li> | ||
| 133 | + </ul> | ||
| 134 | + </div> | ||
| 95 | 135 | ||
| 96 | - </tr> | ||
| 97 | - </thead> | ||
| 98 | - <tbody> | ||
| 99 | - <tr ng-repeat="info in ctrl.detailInfos"> | ||
| 100 | - <td ng-repeat="cell in info track by $index"> | ||
| 101 | - <span ng-bind="cell.fcsj"></span> | ||
| 102 | - </td> | ||
| 103 | - </tr> | ||
| 104 | 136 | ||
| 105 | - </tbody> | ||
| 106 | - </table> | 137 | + |
| 138 | + </td> | ||
| 139 | + </tr> | ||
| 140 | + | ||
| 141 | + </tbody> | ||
| 142 | + </table> | ||
| 143 | + </div> | ||
| 144 | + | ||
| 107 | 145 | ||
| 108 | </div> | 146 | </div> |
| 109 | </div> | 147 | </div> |
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/detail_info_form.html
0 → 100644
| 1 | +<div class="modal-header"> | ||
| 2 | + <h3 class="modal-title">班次详细信息</h3> | ||
| 3 | +</div> | ||
| 4 | + | ||
| 5 | +<div class="modal-body"> | ||
| 6 | + | ||
| 7 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 8 | + <div class="form-body"> | ||
| 9 | + <div class="form-group has-success has-feedback"> | ||
| 10 | + <label class="col-md-2 control-label">线路*:</label> | ||
| 11 | + <div class="col-md-3"> | ||
| 12 | + <input type="text" class="form-control" | ||
| 13 | + ng-model="ctrl.TimeTableDetailForSave.xl.name" | ||
| 14 | + readonly/> | ||
| 15 | + </div> | ||
| 16 | + | ||
| 17 | + </div> | ||
| 18 | + <div class="form-group has-success has-feedback"> | ||
| 19 | + <label class="col-md-2 control-label">时刻表名称*:</label> | ||
| 20 | + <div class="col-md-3"> | ||
| 21 | + <input type="text" class="form-control" | ||
| 22 | + ng-model="ctrl.TimeTableDetailForSave.ttinfo.name" | ||
| 23 | + readonly/> | ||
| 24 | + </div> | ||
| 25 | + </div> | ||
| 26 | + <div class="form-group has-success has-feedback"> | ||
| 27 | + <label class="col-md-2 control-label">路牌*:</label> | ||
| 28 | + <div class="col-md-3"> | ||
| 29 | + <input type="text" class="form-control" | ||
| 30 | + ng-model="ctrl.TimeTableDetailForSave.lp.lpName" | ||
| 31 | + readonly/> | ||
| 32 | + </div> | ||
| 33 | + | ||
| 34 | + </div> | ||
| 35 | + <div class="form-group has-success has-feedback"> | ||
| 36 | + <label class="col-md-2 control-label">发车顺序号*:</label> | ||
| 37 | + <div class="col-md-3"> | ||
| 38 | + <input type="text" class="form-control" | ||
| 39 | + ng-model="ctrl.TimeTableDetailForSave.lp.fcno" | ||
| 40 | + readonly/> | ||
| 41 | + </div> | ||
| 42 | + | ||
| 43 | + </div> | ||
| 44 | + <div class="form-group has-success has-feedback"> | ||
| 45 | + <label class="col-md-2 control-label">方向*:</label> | ||
| 46 | + <div class="col-md-3"> | ||
| 47 | + <input type="text" class="form-control" | ||
| 48 | + ng-model="ctrl.TimeTableDetailForSave.xlDir" | ||
| 49 | + readonly/> | ||
| 50 | + </div> | ||
| 51 | + | ||
| 52 | + </div> | ||
| 53 | + <div class="form-group has-success has-feedback"> | ||
| 54 | + <label class="col-md-2 control-label">起点站*:</label> | ||
| 55 | + <div class="col-md-3"> | ||
| 56 | + <input type="text" class="form-control" | ||
| 57 | + ng-model="ctrl.TimeTableDetailForSave.qdz.stationName" | ||
| 58 | + readonly/> | ||
| 59 | + </div> | ||
| 60 | + </div> | ||
| 61 | + <div class="form-group has-success has-feedback"> | ||
| 62 | + <label class="col-md-2 control-label">终点站*:</label> | ||
| 63 | + <div class="col-md-3"> | ||
| 64 | + <input type="text" class="form-control" | ||
| 65 | + ng-model="ctrl.TimeTableDetailForSave.zdz.stationName" | ||
| 66 | + readonly/> | ||
| 67 | + </div> | ||
| 68 | + | ||
| 69 | + </div> | ||
| 70 | + <div class="form-group has-success has-feedback"> | ||
| 71 | + <label class="col-md-2 control-label">发车时间*:</label> | ||
| 72 | + <div class="col-md-3"> | ||
| 73 | + <input type="text" class="form-control" | ||
| 74 | + ng-model="ctrl.TimeTableDetailForSave.fcsj" | ||
| 75 | + readonly/> | ||
| 76 | + </div> | ||
| 77 | + | ||
| 78 | + </div> | ||
| 79 | + <div class="form-group"> | ||
| 80 | + <label class="col-md-2 control-label">对应班次数:</label> | ||
| 81 | + <div class="col-md-3"> | ||
| 82 | + <input type="text" class="form-control" | ||
| 83 | + ng-model="ctrl.TimeTableDetailForSave.bcs" | ||
| 84 | + readonly/> | ||
| 85 | + </div> | ||
| 86 | + | ||
| 87 | + </div> | ||
| 88 | + <div class="form-group"> | ||
| 89 | + <label class="col-md-2 control-label">计划里程:</label> | ||
| 90 | + <div class="col-md-3"> | ||
| 91 | + <input type="text" class="form-control" | ||
| 92 | + ng-model="ctrl.TimeTableDetailForSave.jhlc" | ||
| 93 | + readonly/> | ||
| 94 | + </div> | ||
| 95 | + | ||
| 96 | + </div> | ||
| 97 | + <div class="form-group"> | ||
| 98 | + <label class="col-md-2 control-label">班次历时:</label> | ||
| 99 | + <div class="col-md-3"> | ||
| 100 | + <input type="text" class="form-control" | ||
| 101 | + ng-model="ctrl.TimeTableDetailForSave.bcsj" | ||
| 102 | + readonly/> | ||
| 103 | + </div> | ||
| 104 | + | ||
| 105 | + </div> | ||
| 106 | + <div class="form-group has-success has-feedback"> | ||
| 107 | + <label class="col-md-2 control-label">班次类型:</label> | ||
| 108 | + <div class="col-md-3"> | ||
| 109 | + <input type="text" class="form-control" | ||
| 110 | + ng-model="ctrl.TimeTableDetailForSave.bcType" | ||
| 111 | + readonly/> | ||
| 112 | + </div> | ||
| 113 | + | ||
| 114 | + </div> | ||
| 115 | + <div class="form-group"> | ||
| 116 | + <label class="col-md-2 control-label">备注:</label> | ||
| 117 | + <div class="col-md-3"> | ||
| 118 | + <textarea class="form-control" | ||
| 119 | + ng-model="ctrl.TimeTableDetailForSave.remark" | ||
| 120 | + readonly/> | ||
| 121 | + </div> | ||
| 122 | + | ||
| 123 | + </div> | ||
| 124 | + | ||
| 125 | + </div> | ||
| 126 | + | ||
| 127 | + <div class="form-actions"> | ||
| 128 | + <div class="row"> | ||
| 129 | + <div class="col-md-offset-3 col-md-4"> | ||
| 130 | + <button type="submit" class="btn green" | ||
| 131 | + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 132 | + <a type="button" class="btn default" ng-click="ctrl.close()" ><i class="fa fa-times"></i> 取消</a> | ||
| 133 | + </div> | ||
| 134 | + </div> | ||
| 135 | + </div> | ||
| 136 | + </form> | ||
| 137 | + | ||
| 138 | +</div> | ||
| 139 | + | ||
| 140 | +<div class="modal-footer"> | ||
| 141 | + <!--<button class="btn btn-primary" ng-click="ctrl.close()">关闭</button>--> | ||
| 142 | +</div> | ||
| 0 | \ No newline at end of file | 143 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/list.html
| @@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
| 66 | <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span> | 66 | <span ng-bind="info.qyrq | date: 'yyyy-MM-dd'"></span> |
| 67 | </td> | 67 | </td> |
| 68 | <td> | 68 | <td> |
| 69 | - <a ui-sref="timeTableDetailInfoManage({xlid: info.xl.id, ttid : info.id})" | 69 | + <a ui-sref="timeTableDetailInfoManage({xlid: info.xl.id, ttid : info.id, xlname: info.xl.name, ttname : info.name})" |
| 70 | class="btn default blue-stripe btn-sm"> 编辑 </a> | 70 | class="btn default blue-stripe btn-sm"> 编辑 </a> |
| 71 | <a ng-click="ctrl.importData($index)" class="btn default blue-stripe btn-sm"> 导入 </a> | 71 | <a ng-click="ctrl.importData($index)" class="btn default blue-stripe btn-sm"> 导入 </a> |
| 72 | <a href="javascript:" class="btn default blue-stripe btn-sm"> 导出 </a> | 72 | <a href="javascript:" class="btn default blue-stripe btn-sm"> 导出 </a> |
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/timeTableDetailManage.js
| @@ -31,10 +31,14 @@ angular.module('ScheduleApp').factory('TimeTableDetailManageService', ['TimeTabl | @@ -31,10 +31,14 @@ angular.module('ScheduleApp').factory('TimeTableDetailManageService', ['TimeTabl | ||
| 31 | 31 | ||
| 32 | }]); | 32 | }]); |
| 33 | 33 | ||
| 34 | -angular.module('ScheduleApp').controller('TimeTableDetailManageCtrl', ['TimeTableDetailManageService', '$stateParams', function(timeTableDetailManageService, $stateParams) { | 34 | +angular.module('ScheduleApp').controller('TimeTableDetailManageCtrl', ['TimeTableDetailManageService', '$stateParams', '$uibModal', function(timeTableDetailManageService, $stateParams, $uibModal) { |
| 35 | var self = this; | 35 | var self = this; |
| 36 | - var xlid = $stateParams.xlid; // 湖区传过来的线路id | 36 | + var xlid = $stateParams.xlid; // 获取传过来的线路id |
| 37 | var ttid = $stateParams.ttid; // 获取传过来的时刻表id | 37 | var ttid = $stateParams.ttid; // 获取传过来的时刻表id |
| 38 | + var xlname = $stateParams.xlname; // 获取传过来的线路名字 | ||
| 39 | + var ttname = $stateParams.ttname; // 获取传过来的时刻表名字 | ||
| 40 | + | ||
| 41 | + this.title = xlname + "(" + ttname + ")" + "时刻表明细信息"; | ||
| 38 | 42 | ||
| 39 | // 载入待编辑的时刻表明细数据 | 43 | // 载入待编辑的时刻表明细数据 |
| 40 | timeTableDetailManageService.getEditInfo(xlid, ttid).then( | 44 | timeTableDetailManageService.getEditInfo(xlid, ttid).then( |
| @@ -48,47 +52,52 @@ angular.module('ScheduleApp').controller('TimeTableDetailManageCtrl', ['TimeTabl | @@ -48,47 +52,52 @@ angular.module('ScheduleApp').controller('TimeTableDetailManageCtrl', ['TimeTabl | ||
| 48 | } | 52 | } |
| 49 | ); | 53 | ); |
| 50 | 54 | ||
| 55 | + // 修改班次信息 | ||
| 56 | + self.editBcInfo = function(bcinfo) { | ||
| 57 | + // 班次信息id | ||
| 58 | + var ttdid = bcinfo["ttdid"]; | ||
| 59 | + | ||
| 60 | + console.log("ttdid=" + ttdid); | ||
| 61 | + | ||
| 62 | + // large方式弹出模态对话框 | ||
| 63 | + var modalInstance = $uibModal.open({ | ||
| 64 | + templateUrl: '/pages/scheduleApp/module/core/timeTableManage/detail_info_form.html', | ||
| 65 | + size: "lg", | ||
| 66 | + animation: true, | ||
| 67 | + backdrop: 'static', | ||
| 68 | + resolve: { | ||
| 69 | + // 传递给controller | ||
| 70 | + r_ttdid: function() {return ttdid} | ||
| 71 | + }, | ||
| 72 | + windowClass: 'center-modal', | ||
| 73 | + controller: 'TimeTableDetailManageFormCtrl', | ||
| 74 | + controllerAs: 'ctrl', | ||
| 75 | + bindToController: true | ||
| 76 | + }); | ||
| 77 | + | ||
| 78 | + modalInstance.result.then( | ||
| 79 | + function() { | ||
| 80 | + console.log("detail_info_form.html打开"); | ||
| 81 | + }, | ||
| 82 | + function() { | ||
| 83 | + console.log("detail_info_form.html消失") | ||
| 84 | + } | ||
| 85 | + ); | ||
| 51 | 86 | ||
| 52 | - | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | - | ||
| 58 | - | ||
| 59 | - | ||
| 60 | - | ||
| 61 | - | ||
| 62 | - | ||
| 63 | - | ||
| 64 | - | ||
| 65 | - | ||
| 66 | - | ||
| 67 | - | ||
| 68 | - | ||
| 69 | - | ||
| 70 | - | ||
| 71 | - | ||
| 72 | - | ||
| 73 | - | ||
| 74 | - | ||
| 75 | - | ||
| 76 | - | ||
| 77 | - | ||
| 78 | - | 87 | + }; |
| 79 | 88 | ||
| 80 | 89 | ||
| 81 | 90 | ||
| 82 | }]); | 91 | }]); |
| 83 | 92 | ||
| 84 | -angular.module('ScheduleApp').controller('TimeTableDetailManageFormCtrl', ['TimeTableDetailManageService', '$stateParams', '$state', function(timeTableDetailManageService, $stateParams, $state) { | 93 | +angular.module('ScheduleApp').controller('TimeTableDetailManageFormCtrl', ['TimeTableDetailManageService', '$modalInstance', 'r_ttdid', function(timeTableDetailManageService, $modalInstance, r_ttdid) { |
| 85 | var self = this; | 94 | var self = this; |
| 86 | 95 | ||
| 87 | // 欲保存的busInfo信息,绑定 | 96 | // 欲保存的busInfo信息,绑定 |
| 88 | self.TimeTableDetailForSave = {}; | 97 | self.TimeTableDetailForSave = {}; |
| 89 | 98 | ||
| 90 | // 获取传过来的id,有的话就是修改,获取一遍数据 | 99 | // 获取传过来的id,有的话就是修改,获取一遍数据 |
| 91 | - var id = $stateParams.id; | 100 | + var id = r_ttdid; |
| 92 | if (id) { | 101 | if (id) { |
| 93 | self.TimeTableDetailForSave.id = id; | 102 | self.TimeTableDetailForSave.id = id; |
| 94 | timeTableDetailManageService.getDetail(id).then( | 103 | timeTableDetailManageService.getDetail(id).then( |
| @@ -115,7 +124,7 @@ angular.module('ScheduleApp').controller('TimeTableDetailManageFormCtrl', ['Time | @@ -115,7 +124,7 @@ angular.module('ScheduleApp').controller('TimeTableDetailManageFormCtrl', ['Time | ||
| 115 | // TODO:弹出框方式以后改 | 124 | // TODO:弹出框方式以后改 |
| 116 | if (result.status == 'SUCCESS') { | 125 | if (result.status == 'SUCCESS') { |
| 117 | alert("保存成功!"); | 126 | alert("保存成功!"); |
| 118 | - //$state.go("busInfoManage"); | 127 | + $modalInstance.dismiss("cancel"); |
| 119 | } else { | 128 | } else { |
| 120 | alert("保存异常!"); | 129 | alert("保存异常!"); |
| 121 | } | 130 | } |
| @@ -127,4 +136,9 @@ angular.module('ScheduleApp').controller('TimeTableDetailManageFormCtrl', ['Time | @@ -127,4 +136,9 @@ angular.module('ScheduleApp').controller('TimeTableDetailManageFormCtrl', ['Time | ||
| 127 | ); | 136 | ); |
| 128 | }; | 137 | }; |
| 129 | 138 | ||
| 139 | + // 关闭窗口 | ||
| 140 | + self.close = function() { | ||
| 141 | + $modalInstance.dismiss("cancel"); | ||
| 142 | + }; | ||
| 143 | + | ||
| 130 | }]); | 144 | }]); |
| 131 | \ No newline at end of file | 145 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/timeTableManage.js
| @@ -188,8 +188,8 @@ angular.module('ScheduleApp').controller('TimeTableManageListCtrl', ['TimeTableM | @@ -188,8 +188,8 @@ angular.module('ScheduleApp').controller('TimeTableManageListCtrl', ['TimeTableM | ||
| 188 | var xlmc = self.pageInfo.infos[$index]["xl"]["name"]; | 188 | var xlmc = self.pageInfo.infos[$index]["xl"]["name"]; |
| 189 | // 时刻表名称 | 189 | // 时刻表名称 |
| 190 | var ttinfoname = self.pageInfo.infos[$index]["name"]; | 190 | var ttinfoname = self.pageInfo.infos[$index]["name"]; |
| 191 | - // 停车场名称(TODO:暂时写死) | ||
| 192 | - var tccname = "东川路地铁站停车场"; | 191 | + // 停车场代码 |
| 192 | + var tcccode = self.pageInfo.infos[$index]["xl"]["carParkCode"]; | ||
| 193 | 193 | ||
| 194 | // large方式弹出模态对话框 | 194 | // large方式弹出模态对话框 |
| 195 | var modalInstance = $uibModal.open({ | 195 | var modalInstance = $uibModal.open({ |
| @@ -201,7 +201,7 @@ angular.module('ScheduleApp').controller('TimeTableManageListCtrl', ['TimeTableM | @@ -201,7 +201,7 @@ angular.module('ScheduleApp').controller('TimeTableManageListCtrl', ['TimeTableM | ||
| 201 | // 可以传值给controller | 201 | // 可以传值给controller |
| 202 | r_xlmc : function() {return xlmc}, | 202 | r_xlmc : function() {return xlmc}, |
| 203 | r_ttinfoname : function() {return ttinfoname;}, | 203 | r_ttinfoname : function() {return ttinfoname;}, |
| 204 | - r_tccname : function() {return tccname;} | 204 | + r_tcccode : function() {return tcccode;} |
| 205 | }, | 205 | }, |
| 206 | windowClass: 'center-modal', | 206 | windowClass: 'center-modal', |
| 207 | controller: "TimeTableDetailManageToolsCtrl", | 207 | controller: "TimeTableDetailManageToolsCtrl", |
| @@ -220,12 +220,12 @@ angular.module('ScheduleApp').controller('TimeTableManageListCtrl', ['TimeTableM | @@ -220,12 +220,12 @@ angular.module('ScheduleApp').controller('TimeTableManageListCtrl', ['TimeTableM | ||
| 220 | 220 | ||
| 221 | }]); | 221 | }]); |
| 222 | 222 | ||
| 223 | -angular.module('ScheduleApp').controller('TimeTableDetailManageToolsCtrl', ['$modalInstance', 'FileUploader', 'r_xlmc', 'r_ttinfoname', 'r_tccname', function($modalInstance, FileUploader, r_xlmc, r_ttinfoname, r_tccname) { | 223 | +angular.module('ScheduleApp').controller('TimeTableDetailManageToolsCtrl', ['$modalInstance', 'FileUploader', 'r_xlmc', 'r_ttinfoname', 'r_tcccode', function($modalInstance, FileUploader, r_xlmc, r_ttinfoname, r_tcccode) { |
| 224 | var self = this; | 224 | var self = this; |
| 225 | 225 | ||
| 226 | self.xlmc = r_xlmc; | 226 | self.xlmc = r_xlmc; |
| 227 | self.ttinfoname = r_ttinfoname; | 227 | self.ttinfoname = r_ttinfoname; |
| 228 | - self.tccname = r_tccname; | 228 | + self.tcccode = r_tcccode; |
| 229 | 229 | ||
| 230 | // 关闭窗口 | 230 | // 关闭窗口 |
| 231 | self.close = function() { | 231 | self.close = function() { |
| @@ -240,7 +240,7 @@ angular.module('ScheduleApp').controller('TimeTableDetailManageToolsCtrl', ['$mo | @@ -240,7 +240,7 @@ angular.module('ScheduleApp').controller('TimeTableDetailManageToolsCtrl', ['$mo | ||
| 240 | self.uploader = new FileUploader({ | 240 | self.uploader = new FileUploader({ |
| 241 | url: "/tidc/dataImportExtend", | 241 | url: "/tidc/dataImportExtend", |
| 242 | filters: [], // 用于过滤文件,比如只允许导入excel, | 242 | filters: [], // 用于过滤文件,比如只允许导入excel, |
| 243 | - formData: [{xlmc: self.xlmc, ttinfoname: self.ttinfoname, tccname: self.tccname}] | 243 | + formData: [{xlmc: self.xlmc, ttinfoname: self.ttinfoname, tcccode: self.tcccode}] |
| 244 | }); | 244 | }); |
| 245 | self.uploader.onAfterAddingFile = function(fileItem) | 245 | self.uploader.onAfterAddingFile = function(fileItem) |
| 246 | { | 246 | { |
src/main/resources/static/pages/scheduleApp/module/main.js
| @@ -8,8 +8,86 @@ var ScheduleApp = angular.module('ScheduleApp', [ | @@ -8,8 +8,86 @@ var ScheduleApp = angular.module('ScheduleApp', [ | ||
| 8 | 'ngResource' // resource服务 | 8 | 'ngResource' // resource服务 |
| 9 | ]); | 9 | ]); |
| 10 | 10 | ||
| 11 | -ScheduleApp.config(['$httpProvider', function($httpProvider) { | 11 | +/** |
| 12 | + * 用于请求通知。 | ||
| 13 | + */ | ||
| 14 | +ScheduleApp.factory('requestNotificationChannel', ['$rootScope', function($rootScope) { | ||
| 15 | + // 通知消息常量 | ||
| 16 | + var _START_REQUEST_ = '_START_REQUEST_'; // 开始请求通知message | ||
| 17 | + var _END_REQUEST_ = '_END_REQUEST_'; // 请求结束通知message | ||
| 18 | + | ||
| 19 | + // 计数器 | ||
| 20 | + var activeCalls = 0; | ||
| 21 | + | ||
| 22 | + // 发布开始请求通知 | ||
| 23 | + var requestStarted = function() { | ||
| 24 | + activeCalls += 1; | ||
| 25 | + console.log("activeCalls=" + activeCalls); | ||
| 26 | + $rootScope.$broadcast(_START_REQUEST_); | ||
| 27 | + }; | ||
| 28 | + // 发布请求结束通知 | ||
| 29 | + var requestEnded = function() { | ||
| 30 | + activeCalls -= 1; | ||
| 31 | + console.log("activeCalls=" + activeCalls); | ||
| 32 | + $rootScope.$broadcast(_END_REQUEST_); | ||
| 33 | + }; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 订阅开始请求通知。 | ||
| 37 | + * @param $scope 作用域 | ||
| 38 | + * @param handler 通知处理器函数 | ||
| 39 | + */ | ||
| 40 | + var onRequestStarted = function($scope, handler) { | ||
| 41 | + $scope.$on(_START_REQUEST_, function(event) { | ||
| 42 | + handler(); | ||
| 43 | + }); | ||
| 44 | + }; | ||
| 45 | + /** | ||
| 46 | + * 订阅请求结束通知。 | ||
| 47 | + * @param $scope 作用域 | ||
| 48 | + * @param handler 通知处理器函数 | ||
| 49 | + */ | ||
| 50 | + var onRequestEnded = function($scope, handler) { | ||
| 51 | + $scope.$on(_END_REQUEST_, function(event) { | ||
| 52 | + handler(); | ||
| 53 | + }); | ||
| 54 | + }; | ||
| 55 | + | ||
| 56 | + return { | ||
| 57 | + requestStarted : requestStarted, | ||
| 58 | + requestEnded : requestEnded, | ||
| 59 | + onRequestStarted : onRequestStarted, | ||
| 60 | + onRequestEnded : onRequestEnded | ||
| 61 | + }; | ||
| 62 | + | ||
| 63 | +}]); | ||
| 64 | + | ||
| 65 | +// http 拦截器 | ||
| 66 | +ScheduleApp.factory('myInterceptor', ['requestNotificationChannel', function(requestNotificationChannel) { | ||
| 67 | + return { | ||
| 68 | + request: function(config) { | ||
| 69 | + requestNotificationChannel.requestStarted(); | ||
| 70 | + return config; | ||
| 71 | + }, | ||
| 72 | + requestError: function(rejection) { | ||
| 73 | + requestNotificationChannel.requestEnded(); | ||
| 74 | + return rejection; | ||
| 75 | + }, | ||
| 76 | + response: function(response) { | ||
| 77 | + requestNotificationChannel.requestEnded(); | ||
| 78 | + return response; | ||
| 79 | + }, | ||
| 80 | + responseError: function(rejection) { | ||
| 81 | + requestNotificationChannel.requestEnded(); | ||
| 82 | + return rejection; | ||
| 83 | + } | ||
| 84 | + }; | ||
| 85 | + | ||
| 86 | +}]); | ||
| 87 | + | ||
| 88 | +ScheduleApp.config(['$httpProvider', 'myInterceptor', function($httpProvider, myInterceptor) { | ||
| 12 | $httpProvider.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; | 89 | $httpProvider.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; |
| 90 | + $httpProvider.interceptors.push(myInterceptor); | ||
| 13 | }]); | 91 | }]); |
| 14 | 92 | ||
| 15 | /** ocLazyLoader 配置 */ | 93 | /** ocLazyLoader 配置 */ |