Commit 10f61394b67e0eb6a1a7eda9a03b64d0c77588e9
1 parent
78cdf33f
线调页面完善
Showing
79 changed files
with
6399 additions
and
729 deletions
src/main/java/com/bsth/common/Constants.java
| ... | ... | @@ -24,7 +24,7 @@ public class Constants { |
| 24 | 24 | /** |
| 25 | 25 | * 线调部分子页面不做拦截,便于浏览器缓存 |
| 26 | 26 | */ |
| 27 | - public static final String XD_CHILD_PAGES = "/pages/control/line/child_pages/**"; | |
| 27 | + public static final String XD_CHILD_PAGES = "/real_control_v2/**"; | |
| 28 | 28 | public static final String XD_TEMPS = "/pages/control/line/temps/**"; |
| 29 | 29 | |
| 30 | 30 | //车载网关上行接口 | ... | ... |
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
| 1 | 1 | package com.bsth.controller.realcontrol; |
| 2 | 2 | |
| 3 | +import java.util.HashMap; | |
| 4 | +import java.util.List; | |
| 3 | 5 | import java.util.Map; |
| 4 | 6 | |
| 5 | 7 | import org.springframework.web.bind.annotation.RequestMapping; |
| 6 | 8 | import org.springframework.web.bind.annotation.RestController; |
| 7 | 9 | |
| 10 | +import com.alibaba.fastjson.JSON; | |
| 11 | +import com.alibaba.fastjson.serializer.PropertyFilter; | |
| 8 | 12 | import com.bsth.data.BasicData; |
| 9 | 13 | |
| 10 | 14 | @RestController |
| ... | ... | @@ -21,4 +25,40 @@ public class BasicDataController { |
| 21 | 25 | public Map<String, String> findLineCodeMap(){ |
| 22 | 26 | return BasicData.lineCode2NameMap; |
| 23 | 27 | } |
| 28 | + | |
| 29 | + @RequestMapping("/parks") | |
| 30 | + public Map<String, String> findParks(){ | |
| 31 | + Map<String, String> rs = new HashMap<>(); | |
| 32 | + List<String> codes = BasicData.parkCodeList; | |
| 33 | + for(String code : codes){ | |
| 34 | + rs.put(code, BasicData.stationCode2NameMap.get(code)); | |
| 35 | + } | |
| 36 | + return rs; | |
| 37 | + } | |
| 38 | + | |
| 39 | + @RequestMapping("/personnel") | |
| 40 | + public Map<String, Object> findPersonnelInfo(){ | |
| 41 | + Map<String, Object> rs = new HashMap<>(); | |
| 42 | + PersonnelFieldFilter filter=new PersonnelFieldFilter(); | |
| 43 | + //驾驶员 | |
| 44 | + rs.put("jsy", JSON.parse(JSON.toJSONString(BasicData.jsyMap.values(), filter))); | |
| 45 | + //售票员 | |
| 46 | + rs.put("spy", JSON.parse(JSON.toJSONString(BasicData.spyMap.values(), filter))); | |
| 47 | + return rs; | |
| 48 | + } | |
| 49 | + | |
| 50 | + | |
| 51 | + public class PersonnelFieldFilter implements PropertyFilter{ | |
| 52 | + | |
| 53 | + String[] whiteList=new String[]{"jobCode", "personnelName", "brancheCompany"}; | |
| 54 | + @Override | |
| 55 | + public boolean apply(Object object, String name, Object value) { | |
| 56 | + for(String f : whiteList){ | |
| 57 | + if(name.equals(f)) | |
| 58 | + return true; | |
| 59 | + } | |
| 60 | + return false; | |
| 61 | + } | |
| 62 | + | |
| 63 | + } | |
| 24 | 64 | } | ... | ... |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -7,6 +7,7 @@ import java.util.List; |
| 7 | 7 | import java.util.Map; |
| 8 | 8 | |
| 9 | 9 | import org.apache.commons.lang3.StringEscapeUtils; |
| 10 | +import org.drools.core.runtime.help.impl.XStreamJSon.JSonAbortWorkItemConverter; | |
| 10 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | 12 | import org.springframework.web.bind.annotation.PathVariable; |
| 12 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -14,7 +15,11 @@ import org.springframework.web.bind.annotation.RequestMethod; |
| 14 | 15 | import org.springframework.web.bind.annotation.RequestParam; |
| 15 | 16 | import org.springframework.web.bind.annotation.RestController; |
| 16 | 17 | |
| 18 | +import com.alibaba.fastjson.JSON; | |
| 19 | +import com.alibaba.fastjson.JSONArray; | |
| 17 | 20 | import com.bsth.controller.BaseController; |
| 21 | +import com.bsth.controller.realcontrol.dto.ChangePersonCar; | |
| 22 | +import com.bsth.controller.realcontrol.dto.DfsjChange; | |
| 18 | 23 | import com.bsth.data.BasicData; |
| 19 | 24 | import com.bsth.data.schedule.DayOfSchedule; |
| 20 | 25 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| ... | ... | @@ -42,10 +47,12 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 42 | 47 | |
| 43 | 48 | /** |
| 44 | 49 | * |
| 50 | + * 改由通过 websocket 注册监听!!! | |
| 51 | + * | |
| 45 | 52 | * @Title: registerLine @Description: TODO(注册线路,后续才能收到数据推送) @param @param |
| 46 | 53 | * lineCodes @throws |
| 47 | 54 | * 用GET 防止监控模式下被拦截 |
| 48 | - */ | |
| 55 | + | |
| 49 | 56 | @RequestMapping(value = "/registerLine", method = RequestMethod.GET) |
| 50 | 57 | public int registerLine(@RequestParam String lineCodes) { |
| 51 | 58 | List<String> list = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(lineCodes); |
| ... | ... | @@ -58,7 +65,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 58 | 65 | BasicData.lineCode2SocketUserMap.put(line, userName); |
| 59 | 66 | |
| 60 | 67 | return 0; |
| 61 | - } | |
| 68 | + }*/ | |
| 62 | 69 | |
| 63 | 70 | /** |
| 64 | 71 | * |
| ... | ... | @@ -67,20 +74,19 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 67 | 74 | */ |
| 68 | 75 | @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST) |
| 69 | 76 | public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks, |
| 70 | - @RequestParam String dfsj, String clZbh, String jsy, String spy) { | |
| 71 | - return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, clZbh, jsy, spy); | |
| 77 | + @RequestParam String dfsj/*, String clZbh, String jsy, String spy*/) { | |
| 78 | + return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj/*, clZbh, jsy, spy*/); | |
| 72 | 79 | } |
| 73 | 80 | |
| 74 | 81 | /** |
| 75 | 82 | * |
| 76 | - * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID | |
| 77 | - * ,分隔 @param @param spaceAdjust 自动调整后续间隔(1 是 -1 否) @param @param remarks | |
| 78 | - * 备注 @param @param reason 理由 @param @param spaceNum 间隔(分钟) @throws | |
| 83 | + * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔 | |
| 79 | 84 | */ |
| 80 | 85 | @RequestMapping(value = "/destroy", method = RequestMethod.POST) |
| 81 | - public Map<String, Object> destroy(@RequestParam String idsStr, @RequestParam(defaultValue = "-1") int spaceAdjust, | |
| 82 | - @RequestParam String remarks, @RequestParam String reason, @RequestParam(defaultValue = "0") int spaceNum) { | |
| 83 | - return scheduleRealInfoService.destroy(idsStr, spaceAdjust, remarks, reason, spaceNum); | |
| 86 | + public Map<String, Object> destroy(@RequestParam String idsStr | |
| 87 | + /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/, | |
| 88 | + @RequestParam String remarks/*, @RequestParam String reason, @RequestParam(defaultValue = "0") int spaceNum*/) { | |
| 89 | + return scheduleRealInfoService.destroy(idsStr/*, spaceAdjust*/, remarks/*, reason, spaceNum*/); | |
| 84 | 90 | } |
| 85 | 91 | |
| 86 | 92 | /** |
| ... | ... | @@ -380,4 +386,18 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 380 | 386 | public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){ |
| 381 | 387 | return scheduleRealInfoService.realScheduleList(line,date); |
| 382 | 388 | } |
| 389 | + | |
| 390 | + @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST) | |
| 391 | + public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){ | |
| 392 | + cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson); | |
| 393 | + List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class); | |
| 394 | + return scheduleRealInfoService.multi_tzrc(cpcs); | |
| 395 | + } | |
| 396 | + | |
| 397 | + @RequestMapping(value="/multi_dftz", method=RequestMethod.POST) | |
| 398 | + public Map<String, Object> multi_dftz(@RequestParam String dcsJson){ | |
| 399 | + dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson); | |
| 400 | + List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class); | |
| 401 | + return scheduleRealInfoService.multi_dftz(dfsjcs); | |
| 402 | + } | |
| 383 | 403 | } | ... | ... |
src/main/java/com/bsth/controller/realcontrol/dto/ChangePersonCar.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol.dto; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * | |
| 5 | + * @ClassName: ChangePersonCar | |
| 6 | + * @Description: TODO(换人换车) | |
| 7 | + * @author PanZhao | |
| 8 | + * @date 2016年10月30日 下午10:06:54 | |
| 9 | + * | |
| 10 | + */ | |
| 11 | +public class ChangePersonCar { | |
| 12 | + | |
| 13 | + /** 班次ID */ | |
| 14 | + private Long schId; | |
| 15 | + | |
| 16 | + /** 要更换的车辆自编号 */ | |
| 17 | + private String clZbh; | |
| 18 | + | |
| 19 | + /** 驾驶员 工号/姓名 */ | |
| 20 | + private String jsy; | |
| 21 | + | |
| 22 | + /** 售票员 工号/姓名 */ | |
| 23 | + private String spy; | |
| 24 | + | |
| 25 | + public Long getSchId() { | |
| 26 | + return schId; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public void setSchId(Long schId) { | |
| 30 | + this.schId = schId; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public String getJsy() { | |
| 34 | + return jsy; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public void setJsy(String jsy) { | |
| 38 | + this.jsy = jsy; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public String getSpy() { | |
| 42 | + return spy; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setSpy(String spy) { | |
| 46 | + this.spy = spy; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public String getClZbh() { | |
| 50 | + return clZbh; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setClZbh(String clZbh) { | |
| 54 | + this.clZbh = clZbh; | |
| 55 | + } | |
| 56 | + | |
| 57 | +} | ... | ... |
src/main/java/com/bsth/controller/realcontrol/dto/DfsjChange.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol.dto; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * | |
| 5 | + * @ClassName: DfsjChange | |
| 6 | + * @Description: TODO(待发调整) | |
| 7 | + * @author PanZhao | |
| 8 | + * @date 2016年10月31日 上午1:00:11 | |
| 9 | + * | |
| 10 | + */ | |
| 11 | +public class DfsjChange { | |
| 12 | + | |
| 13 | + private Long schId; | |
| 14 | + | |
| 15 | + private String old_dfsj; | |
| 16 | + | |
| 17 | + private String new_dfsj; | |
| 18 | + | |
| 19 | + public Long getSchId() { | |
| 20 | + return schId; | |
| 21 | + } | |
| 22 | + | |
| 23 | + public void setSchId(Long schId) { | |
| 24 | + this.schId = schId; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public String getOld_dfsj() { | |
| 28 | + return old_dfsj; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setOld_dfsj(String old_dfsj) { | |
| 32 | + this.old_dfsj = old_dfsj; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public String getNew_dfsj() { | |
| 36 | + return new_dfsj; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setNew_dfsj(String new_dfsj) { | |
| 40 | + this.new_dfsj = new_dfsj; | |
| 41 | + } | |
| 42 | + | |
| 43 | +} | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| ... | ... | @@ -17,12 +17,14 @@ import com.bsth.Application; |
| 17 | 17 | import com.bsth.entity.CarPark; |
| 18 | 18 | import com.bsth.entity.Cars; |
| 19 | 19 | import com.bsth.entity.Line; |
| 20 | +import com.bsth.entity.Personnel; | |
| 20 | 21 | import com.bsth.entity.Station; |
| 21 | 22 | import com.bsth.entity.StationRoute; |
| 22 | 23 | import com.bsth.entity.schedule.CarConfigInfo; |
| 23 | 24 | import com.bsth.repository.CarParkRepository; |
| 24 | 25 | import com.bsth.repository.CarsRepository; |
| 25 | 26 | import com.bsth.repository.LineRepository; |
| 27 | +import com.bsth.repository.PersonnelRepository; | |
| 26 | 28 | import com.bsth.repository.StationRepository; |
| 27 | 29 | import com.bsth.repository.StationRouteRepository; |
| 28 | 30 | import com.bsth.repository.schedule.CarConfigInfoRepository; |
| ... | ... | @@ -74,6 +76,14 @@ public class BasicData implements CommandLineRunner{ |
| 74 | 76 | //线路Code和shangHaiLinecode 对照 |
| 75 | 77 | public static Map<String, String> lineCode2ShangHaiCodeMap; |
| 76 | 78 | |
| 79 | + //驾驶员工号 和 personnel 对象映射 | |
| 80 | + public static Map<String, Personnel> jsyMap; | |
| 81 | + //售票员工号 和 personnel 对象映射 | |
| 82 | + public static Map<String, Personnel> spyMap; | |
| 83 | + //全量员工 工号和姓名对照 | |
| 84 | + public static Map<String, String> allPerson; | |
| 85 | + | |
| 86 | + | |
| 77 | 87 | static Logger logger = LoggerFactory.getLogger(BasicData.class); |
| 78 | 88 | |
| 79 | 89 | @Autowired |
| ... | ... | @@ -106,6 +116,9 @@ public class BasicData implements CommandLineRunner{ |
| 106 | 116 | @Autowired |
| 107 | 117 | StationRouteRepository stationRouteRepository; |
| 108 | 118 | |
| 119 | + @Autowired | |
| 120 | + PersonnelRepository personnelRepository; | |
| 121 | + | |
| 109 | 122 | |
| 110 | 123 | @Override |
| 111 | 124 | public void run() { |
| ... | ... | @@ -118,12 +131,18 @@ public class BasicData implements CommandLineRunner{ |
| 118 | 131 | */ |
| 119 | 132 | public int loadAllData(){ |
| 120 | 133 | try{ |
| 134 | + //设备信息 | |
| 121 | 135 | loadDeviceInfo(); |
| 136 | + //站点信息 | |
| 122 | 137 | loadStationInfo(); |
| 138 | + //线路信息 | |
| 123 | 139 | loadLineInfo(); |
| 140 | + //车辆和线路映射信息 | |
| 124 | 141 | loadNbbm2LineInfo(); |
| 125 | - | |
| 142 | + //站点路由信息 | |
| 126 | 143 | loadStationRouteInfo(); |
| 144 | + //人员信息 | |
| 145 | + loadPersonnelInfo(); | |
| 127 | 146 | logger.info("加载基础数据成功!," ); |
| 128 | 147 | }catch(Exception e){ |
| 129 | 148 | logger.error("加载基础数据时出现异常," , e); |
| ... | ... | @@ -235,5 +254,37 @@ public class BasicData implements CommandLineRunner{ |
| 235 | 254 | lineId2ShangHaiCodeMap = id2SHcode; |
| 236 | 255 | lineCode2ShangHaiCodeMap = code2SHcode; |
| 237 | 256 | } |
| 257 | + | |
| 258 | + /** | |
| 259 | + * | |
| 260 | + * @Title: loadPersonnelInfo | |
| 261 | + * @Description: TODO(加载人员信息) | |
| 262 | + */ | |
| 263 | + public void loadPersonnelInfo() { | |
| 264 | + Iterator<Personnel> iterator = personnelRepository.findAll().iterator(); | |
| 265 | + | |
| 266 | + Map<String, Personnel> jsyTempMap=new HashMap<>() | |
| 267 | + , spyTempMap=new HashMap<>(); | |
| 268 | + Map<String, String> allPersonMap=new HashMap<>(); | |
| 269 | + | |
| 270 | + Personnel p; | |
| 271 | + | |
| 272 | + while(iterator.hasNext()){ | |
| 273 | + p = iterator.next(); | |
| 274 | + | |
| 275 | + if(p.getPosts() != null){ | |
| 276 | + if(p.getPosts().equals("1")) | |
| 277 | + jsyTempMap.put(p.getJobCode(), p); | |
| 278 | + else if(p.getPosts().equals("2")) | |
| 279 | + spyTempMap.put(p.getJobCode(), p); | |
| 280 | + } | |
| 281 | + | |
| 282 | + allPersonMap.put(p.getJobCode(), p.getPersonnelName()); | |
| 283 | + } | |
| 284 | + | |
| 285 | + jsyMap=jsyTempMap; | |
| 286 | + spyMap=spyTempMap; | |
| 287 | + allPerson=allPersonMap; | |
| 288 | + } | |
| 238 | 289 | } |
| 239 | 290 | } | ... | ... |
src/main/java/com/bsth/data/arrival/AnalyseArrivalData.java renamed to src/main/java/com/bsth/data/arrival/AnalyseData.java
| ... | ... | @@ -20,9 +20,9 @@ import com.bsth.data.BasicData; |
| 20 | 20 | * |
| 21 | 21 | */ |
| 22 | 22 | @Component |
| 23 | -public class AnalyseArrivalData { | |
| 23 | +public class AnalyseData { | |
| 24 | 24 | |
| 25 | - Logger logger = LoggerFactory.getLogger(AnalyseArrivalData.class); | |
| 25 | + Logger logger = LoggerFactory.getLogger(AnalyseData.class); | |
| 26 | 26 | |
| 27 | 27 | public void analyse(Set<String> cars){ |
| 28 | 28 | try{ | ... | ... |
src/main/java/com/bsth/data/arrival/ArrivalData_GPS.java
src/main/java/com/bsth/data/directive/FirstScheduleCheckThread.java
| ... | ... | @@ -43,6 +43,9 @@ public class FirstScheduleCheckThread extends Thread{ |
| 43 | 43 | List<ScheduleRealInfo> schList; |
| 44 | 44 | ScheduleRealInfo first; |
| 45 | 45 | for(String car : cars){ |
| 46 | + if(car.equals("SXC-CD1004")){ | |
| 47 | + System.out.println("debugger..."); | |
| 48 | + } | |
| 46 | 49 | schList = dayOfSchedule.findByNbbm(car); |
| 47 | 50 | |
| 48 | 51 | if(null == schList || schList.size() == 0) |
| ... | ... | @@ -54,7 +57,7 @@ public class FirstScheduleCheckThread extends Thread{ |
| 54 | 57 | && first.getBcType().equals("out")){ |
| 55 | 58 | |
| 56 | 59 | //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令 |
| 57 | - if(first.getJhlc() == null) | |
| 60 | + if(first.getJhlc() == null && first.getXlDir().equals(schList.get(1).getXlDir())) | |
| 58 | 61 | first = schList.get(1); |
| 59 | 62 | |
| 60 | 63 | //为首班补发指令 | ... | ... |
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
| ... | ... | @@ -72,7 +72,7 @@ public class GpsRealData implements CommandLineRunner{ |
| 72 | 72 | |
| 73 | 73 | @Override |
| 74 | 74 | public void run(String... arg0) throws Exception { |
| 75 | - Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 18, TimeUnit.SECONDS); | |
| 75 | + Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 6, TimeUnit.SECONDS); | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | public GpsEntity add(GpsEntity gps) { | ... | ... |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| ... | ... | @@ -24,10 +24,8 @@ import org.springframework.stereotype.Component; |
| 24 | 24 | import com.alibaba.fastjson.JSON; |
| 25 | 25 | import com.alibaba.fastjson.JSONArray; |
| 26 | 26 | import com.bsth.Application; |
| 27 | -import com.bsth.data.BasicData; | |
| 28 | 27 | import com.bsth.data.LineConfigData; |
| 29 | 28 | import com.bsth.data.directive.FirstScheduleCheckThread; |
| 30 | -import com.bsth.data.gpsdata.GpsEntity; | |
| 31 | 29 | import com.bsth.data.gpsdata.GpsRealData; |
| 32 | 30 | import com.bsth.data.schedule.thread.ScheduleLateThread; |
| 33 | 31 | import com.bsth.data.schedule.thread.SchedulePstThread; |
| ... | ... | @@ -124,7 +122,7 @@ public class DayOfSchedule implements CommandLineRunner { |
| 124 | 122 | //入库 |
| 125 | 123 | Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS); |
| 126 | 124 | //首班出场指令补发器 |
| 127 | - Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 60, 60, TimeUnit.SECONDS); | |
| 125 | + Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 10, 60, TimeUnit.SECONDS); | |
| 128 | 126 | //班次误点扫描 |
| 129 | 127 | Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS); |
| 130 | 128 | } |
| ... | ... | @@ -262,6 +260,7 @@ public class DayOfSchedule implements CommandLineRunner { |
| 262 | 260 | for(ScheduleRealInfo sch : remList){ |
| 263 | 261 | if(null != sch){ |
| 264 | 262 | nbbmScheduleMap.remove(sch.getClZbh(), sch); |
| 263 | + id2SchedulMap.remove(sch.getId()); | |
| 265 | 264 | count ++; |
| 266 | 265 | } |
| 267 | 266 | } |
| ... | ... | @@ -467,9 +466,23 @@ public class DayOfSchedule implements CommandLineRunner { |
| 467 | 466 | id2SchedulMap.put(sch.getId(), sch); |
| 468 | 467 | } |
| 469 | 468 | |
| 469 | + public void delete(ScheduleRealInfo sch) { | |
| 470 | + //ScheduleRealInfo sch = id2SchedulMap.get(id); | |
| 471 | + if(!sch.isSflj()) | |
| 472 | + return; | |
| 473 | + | |
| 474 | + nbbmScheduleMap.remove(sch.getClZbh(), sch); | |
| 475 | + id2SchedulMap.remove(sch.getId()); | |
| 476 | + //return sch; | |
| 477 | + } | |
| 478 | + | |
| 470 | 479 | public void calcQdzTimePlan(String nbbm){ |
| 471 | 480 | schAttrCalculator.calcQdzTimePlan(nbbmScheduleMap.get(nbbm)); |
| 472 | 481 | } |
| 482 | + | |
| 483 | + public List<ScheduleRealInfo> updateQdzTimePlan(String nbbm){ | |
| 484 | + return schAttrCalculator.updateQdzTimePlan(nbbmScheduleMap.get(nbbm)); | |
| 485 | + } | |
| 473 | 486 | |
| 474 | 487 | /** |
| 475 | 488 | * |
| ... | ... | @@ -596,15 +609,6 @@ public class DayOfSchedule implements CommandLineRunner { |
| 596 | 609 | } |
| 597 | 610 | return outList; |
| 598 | 611 | } |
| 599 | - | |
| 600 | - public ScheduleRealInfo delete(Long id) { | |
| 601 | - ScheduleRealInfo sch = id2SchedulMap.get(id); | |
| 602 | - if(!sch.isSflj()) | |
| 603 | - return null; | |
| 604 | - | |
| 605 | - nbbmScheduleMap.remove(sch.getClZbh(), sch); | |
| 606 | - return sch; | |
| 607 | - } | |
| 608 | 612 | |
| 609 | 613 | public Set<String> allCar(){ |
| 610 | 614 | return nbbmScheduleMap.keySet(); |
| ... | ... | @@ -625,6 +629,33 @@ public class DayOfSchedule implements CommandLineRunner { |
| 625 | 629 | public Map<String, ScheduleRealInfo> execPlamMap(){ |
| 626 | 630 | return carExecutePlanMap; |
| 627 | 631 | } |
| 632 | + | |
| 633 | + /** | |
| 634 | + * @Title: changeCar | |
| 635 | + * @Description: TODO(班次换车) 返回有更新的班次 | |
| 636 | + * @param @param sch | |
| 637 | + * @param @param newClZbh 新的车辆自编号 | |
| 638 | + */ | |
| 639 | + public List<ScheduleRealInfo> changeCar(ScheduleRealInfo sch , String newClZbh){ | |
| 640 | + List<ScheduleRealInfo> ups = new ArrayList<>(); | |
| 641 | + String oldClzbh = sch.getClZbh(); | |
| 642 | + if(oldClzbh.equals(newClZbh)) | |
| 643 | + return ups; | |
| 644 | + | |
| 645 | + | |
| 646 | + //变更相关映射信息 | |
| 647 | + nbbmScheduleMap.remove(sch.getClZbh(), sch); | |
| 648 | + | |
| 649 | + sch.setClZbh(newClZbh); | |
| 650 | + nbbmScheduleMap.put(newClZbh, sch); | |
| 651 | + nbbm2SEStationMap.put(newClZbh, sch.getQdzCode()); | |
| 652 | + nbbm2SEStationMap.put(newClZbh, sch.getZdzCode()); | |
| 653 | + | |
| 654 | + //重新计算班次应到时间 | |
| 655 | + ups.addAll(updateQdzTimePlan(oldClzbh)); | |
| 656 | + ups.addAll(updateQdzTimePlan(newClZbh)); | |
| 657 | + return ups; | |
| 658 | + } | |
| 628 | 659 | |
| 629 | 660 | /** |
| 630 | 661 | * | ... | ... |
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
| ... | ... | @@ -2,6 +2,7 @@ package com.bsth.data.schedule; |
| 2 | 2 | |
| 3 | 3 | import java.text.ParseException; |
| 4 | 4 | import java.text.SimpleDateFormat; |
| 5 | +import java.util.ArrayList; | |
| 5 | 6 | import java.util.Collections; |
| 6 | 7 | import java.util.Date; |
| 7 | 8 | import java.util.List; |
| ... | ... | @@ -44,15 +45,20 @@ public class SchAttrCalculator { |
| 44 | 45 | if (null == sch.getFcsjT()) |
| 45 | 46 | calcFcsjTime(sch); |
| 46 | 47 | |
| 48 | + SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"); | |
| 47 | 49 | /* |
| 48 | 50 | * 早于线路开始运营时间的,加一天 |
| 49 | 51 | * 如该线路 2点开始运营,2016-08-23的班次,则 2016-08-23 0:25 的班次应该调整成 2016-08-24 0:25 |
| 50 | - */ | |
| 51 | - SimpleDateFormat sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-ddHH:mm") | |
| 52 | + | |
| 53 | + | |
| 52 | 54 | ,sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"); |
| 53 | 55 | long st = sdfyyyyMMddHHmm.parse(sch.getScheduleDateStr() + conf.getStartOpt()).getTime(); |
| 54 | 56 | if (st > sch.getFcsjT()) |
| 57 | + sch.setFcsjAll(sch.getFcsjT() + DAY_TIME);*/ | |
| 58 | + | |
| 59 | + if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){ | |
| 55 | 60 | sch.setFcsjAll(sch.getFcsjT() + DAY_TIME); |
| 61 | + } | |
| 56 | 62 | |
| 57 | 63 | sch.setRealExecDate(sdfyyyyMMdd.format(new Date(sch.getFcsjT()))); |
| 58 | 64 | } catch (Exception e) { |
| ... | ... | @@ -108,6 +114,43 @@ public class SchAttrCalculator { |
| 108 | 114 | |
| 109 | 115 | /** |
| 110 | 116 | * |
| 117 | + * @Title: updateQdzTimePlan | |
| 118 | + * @Description: TODO(更新班次的起点应到时间,list 必须是同一辆车的班次) 并返回被更新的班次 | |
| 119 | + */ | |
| 120 | + public List<ScheduleRealInfo> updateQdzTimePlan(List<ScheduleRealInfo> list){ | |
| 121 | + Collections.sort(list, new ScheduleComparator.FCSJ()); | |
| 122 | + | |
| 123 | + List<ScheduleRealInfo> updateList = new ArrayList<>(); | |
| 124 | + int len = list.size(); | |
| 125 | + if(len == 0) | |
| 126 | + return updateList; | |
| 127 | + | |
| 128 | + ScheduleRealInfo prve = list.get(0), curr; | |
| 129 | + for(int i = 1; i < len; i ++){ | |
| 130 | + curr = list.get(i); | |
| 131 | + | |
| 132 | + if(prve.getZdzName().equals(curr.getQdzName())){ | |
| 133 | + | |
| 134 | + if(curr.getQdzArrDateJH() != null && prve.getZdsj().equals(curr.getQdzArrDateJH())){ | |
| 135 | + prve = curr; | |
| 136 | + continue; | |
| 137 | + } | |
| 138 | + | |
| 139 | + curr.setQdzArrDateJH(prve.getZdsj()); | |
| 140 | + updateList.add(curr); | |
| 141 | + } | |
| 142 | + else{ | |
| 143 | + curr.setQdzArrDateJH(null); | |
| 144 | + updateList.add(curr); | |
| 145 | + } | |
| 146 | + prve = curr; | |
| 147 | + } | |
| 148 | + | |
| 149 | + return updateList; | |
| 150 | + } | |
| 151 | + | |
| 152 | + /** | |
| 153 | + * | |
| 111 | 154 | * @Title: connectOutSchedule |
| 112 | 155 | * @Description: TODO(关联出场班次) |
| 113 | 156 | */ | ... | ... |
src/main/java/com/bsth/entity/realcontrol/LineConfig.java
| ... | ... | @@ -49,9 +49,9 @@ public class LineConfig { |
| 49 | 49 | /** 开始运营时间 HH:mm */ |
| 50 | 50 | private String startOpt; |
| 51 | 51 | |
| 52 | - /** 当天开始营运时间戳 */ | |
| 52 | + /** 当天开始营运时间戳 | |
| 53 | 53 | @Transient |
| 54 | - private long currStartTime; | |
| 54 | + private long currStartTime;*/ | |
| 55 | 55 | |
| 56 | 56 | /** 托管状态 */ |
| 57 | 57 | private boolean trust; | ... | ... |
src/main/java/com/bsth/oplog/http/HttpOpLogInterceptor.java
| ... | ... | @@ -25,11 +25,11 @@ public class HttpOpLogInterceptor implements HandlerInterceptor { |
| 25 | 25 | private final PathMatcher pathMatcher = new AntPathMatcher(); |
| 26 | 26 | |
| 27 | 27 | // GET 白名单 |
| 28 | - private String[] httpGetWhiteList = { "/user/login/**", "/user/currentUser", "/dictionary/**", "/module/findByCurrentUser", "/gps/**", "/error/**" }; | |
| 28 | + private String[] httpGetWhiteList = { "/user/login/**", "/user/currentUser","/dictionary/**", "/module/findByCurrentUser", "/gps/**", "/error/**" }; | |
| 29 | 29 | |
| 30 | 30 | // POST 白名单 |
| 31 | 31 | private String[] httpPostWhiteList = { |
| 32 | - | |
| 32 | + "/control/upstream" | |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | 35 | @Autowired | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -6,6 +6,8 @@ import java.util.Map; |
| 6 | 6 | |
| 7 | 7 | import org.springframework.stereotype.Service; |
| 8 | 8 | |
| 9 | +import com.bsth.controller.realcontrol.dto.ChangePersonCar; | |
| 10 | +import com.bsth.controller.realcontrol.dto.DfsjChange; | |
| 9 | 11 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 10 | 12 | import com.bsth.service.BaseService; |
| 11 | 13 | |
| ... | ... | @@ -14,9 +16,9 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 14 | 16 | |
| 15 | 17 | Map<String, Collection<ScheduleRealInfo>> findByLines(String lines); |
| 16 | 18 | |
| 17 | - Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj,String nbbm,String jsy,String spy); | |
| 19 | + Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj/*,String nbbm,String jsy,String spy*/); | |
| 18 | 20 | |
| 19 | - Map<String, Object> destroy(String idsStr, int spaceAdjust, String remarks, String reason, int spaceNum); | |
| 21 | + Map<String, Object> destroy(String idsStr/*, int spaceAdjust*/, String remarks/*, String reason, int spaceNum*/); | |
| 20 | 22 | |
| 21 | 23 | List<Map<String, String>> findDriverByLine(String lineCode); |
| 22 | 24 | |
| ... | ... | @@ -112,4 +114,8 @@ public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, L |
| 112 | 114 | List<ScheduleRealInfo> realScheduleList(String line,String date); |
| 113 | 115 | |
| 114 | 116 | List<Map<String,Object>> yesterdayDataList(String line); |
| 117 | + | |
| 118 | + Map<String, Object> multi_tzrc(List<ChangePersonCar> cpcs); | |
| 119 | + | |
| 120 | + Map<String, Object> multi_dftz(List<DfsjChange> dfsjcs); | |
| 115 | 121 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| ... | ... | @@ -41,7 +41,7 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon |
| 41 | 41 | //再关联主任务 |
| 42 | 42 | ScheduleRealInfo sch = dayOfSchedule.get(t.getSchedule().getId()); |
| 43 | 43 | sch.getcTasks().add(t); |
| 44 | - //rs = scheduleRealInfoService.save(sch); | |
| 44 | + dayOfSchedule.save(sch); | |
| 45 | 45 | |
| 46 | 46 | rs.put("t", sch); |
| 47 | 47 | return rs; |
| ... | ... | @@ -57,6 +57,8 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon |
| 57 | 57 | sch.getcTasks().remove(cPlan); |
| 58 | 58 | //删除子任务 |
| 59 | 59 | rs = super.delete(id); |
| 60 | + dayOfSchedule.save(sch); | |
| 61 | + | |
| 60 | 62 | rs.put("t", sch); |
| 61 | 63 | return rs; |
| 62 | 64 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -8,6 +8,7 @@ import java.util.Collection; |
| 8 | 8 | import java.util.Collections; |
| 9 | 9 | import java.util.Date; |
| 10 | 10 | import java.util.HashMap; |
| 11 | +import java.util.HashSet; | |
| 11 | 12 | import java.util.Iterator; |
| 12 | 13 | import java.util.List; |
| 13 | 14 | import java.util.Map; |
| ... | ... | @@ -24,10 +25,14 @@ import org.springframework.stereotype.Service; |
| 24 | 25 | import com.alibaba.fastjson.JSONArray; |
| 25 | 26 | import com.alibaba.fastjson.JSONObject; |
| 26 | 27 | import com.bsth.common.ResponseCode; |
| 28 | +import com.bsth.controller.realcontrol.dto.ChangePersonCar; | |
| 29 | +import com.bsth.controller.realcontrol.dto.DfsjChange; | |
| 27 | 30 | import com.bsth.data.BasicData; |
| 31 | +import com.bsth.data.LineConfigData; | |
| 28 | 32 | import com.bsth.data.arrival.ArrivalData_GPS; |
| 29 | 33 | import com.bsth.data.arrival.ArrivalEntity; |
| 30 | 34 | import com.bsth.data.schedule.DayOfSchedule; |
| 35 | +import com.bsth.data.schedule.SchAttrCalculator; | |
| 31 | 36 | import com.bsth.data.schedule.ScheduleComparator; |
| 32 | 37 | import com.bsth.entity.Cars; |
| 33 | 38 | import com.bsth.entity.Line; |
| ... | ... | @@ -93,7 +98,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 93 | 98 | |
| 94 | 99 | @Autowired |
| 95 | 100 | DayOfSchedule dayOfSchedule; |
| 101 | + | |
| 102 | + @Autowired | |
| 103 | + SchAttrCalculator schAttrCalculator; | |
| 96 | 104 | |
| 105 | + @Autowired | |
| 106 | + LineConfigData lineConfigData; | |
| 107 | + | |
| 97 | 108 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 98 | 109 | |
| 99 | 110 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| ... | ... | @@ -113,7 +124,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 113 | 124 | } |
| 114 | 125 | |
| 115 | 126 | @Override |
| 116 | - public Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String nbbm,String jsy,String spy) { | |
| 127 | + public Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj/*, String nbbm,String jsy,String spy*/) { | |
| 117 | 128 | Map<String, Object> map = new HashMap<>(); |
| 118 | 129 | try { |
| 119 | 130 | |
| ... | ... | @@ -121,18 +132,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 121 | 132 | schedule.setDfsjT(sdfMinute.parse(schedule.getRealExecDate() + " " + dfsj).getTime()); |
| 122 | 133 | schedule.setDfsj(dfsj); |
| 123 | 134 | schedule.addRemarks(remarks); |
| 124 | - schedule.setClZbh(nbbm); | |
| 125 | - if(jsy != null && jsy.indexOf("/") != -1){ | |
| 126 | - String[] jsyArray = jsy.split("/"); | |
| 127 | - schedule.setjGh(jsyArray[0]); | |
| 128 | - schedule.setjName(jsyArray[1]); | |
| 129 | - } | |
| 130 | - | |
| 131 | - if(spy != null && spy.indexOf("/") != -1){ | |
| 132 | - String[] spyArray = spy.split("/"); | |
| 133 | - schedule.setsGh(spyArray[0]); | |
| 134 | - schedule.setsName(spyArray[1]); | |
| 135 | - } | |
| 135 | +// schedule.setClZbh(nbbm); | |
| 136 | +// if(jsy != null && jsy.indexOf("/") != -1){ | |
| 137 | +// String[] jsyArray = jsy.split("/"); | |
| 138 | +// schedule.setjGh(jsyArray[0]); | |
| 139 | +// schedule.setjName(jsyArray[1]); | |
| 140 | +// } | |
| 141 | +// | |
| 142 | +// if(spy != null && spy.indexOf("/") != -1){ | |
| 143 | +// String[] spyArray = spy.split("/"); | |
| 144 | +// schedule.setsGh(spyArray[0]); | |
| 145 | +// schedule.setsName(spyArray[1]); | |
| 146 | +// } | |
| 136 | 147 | |
| 137 | 148 | List<ScheduleRealInfo> ts = new ArrayList<>(); |
| 138 | 149 | ts.add(schedule); |
| ... | ... | @@ -157,11 +168,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 157 | 168 | } |
| 158 | 169 | |
| 159 | 170 | @Override |
| 160 | - public Map<String, Object> destroy(String idsStr, int spaceAdjust, String remarks, String reason, int spaceNum) { | |
| 171 | + public Map<String, Object> destroy(String idsStr, /*int spaceAdjust, */String remarks/*, String reason, int spaceNum*/) { | |
| 161 | 172 | |
| 162 | 173 | Map<String, Object> map = new HashMap<>(); |
| 163 | 174 | List<ScheduleRealInfo> rsList = new ArrayList<>(); |
| 164 | - map.put("list", rsList); | |
| 175 | + map.put("ts", rsList); | |
| 165 | 176 | try { |
| 166 | 177 | List<String> idList = Lists.newArrayList(Splitter.on(',').trimResults().omitEmptyStrings().split(idsStr)); |
| 167 | 178 | |
| ... | ... | @@ -182,48 +193,48 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 182 | 193 | } |
| 183 | 194 | |
| 184 | 195 | // 调整间隔 |
| 185 | - if (spaceAdjust == 1) { | |
| 186 | - | |
| 187 | - ScheduleRealInfo first = dayOfSchedule.get(Long.parseLong(idList.get(0))); | |
| 188 | - String lineCode = first.getXlBm() + ""; | |
| 189 | - String upDown = first.getXlDir(); | |
| 190 | - | |
| 191 | - List<ScheduleRealInfo> schList = dayOfSchedule.findByLineCode(lineCode), | |
| 192 | - dirList = new ArrayList<>(); | |
| 193 | - // 筛选走向 | |
| 194 | - for (ScheduleRealInfo s : schList) { | |
| 195 | - if (s.getXlDir().equals(upDown)) { | |
| 196 | - dirList.add(s); | |
| 197 | - } | |
| 198 | - } | |
| 199 | - | |
| 200 | - int size = dirList.size(); | |
| 201 | - Long st = null; | |
| 202 | - int diff = spaceNum * 60 * 1000; | |
| 203 | - for (int i = 0; i < size; i++) { | |
| 204 | - schedule = dirList.get(i); | |
| 205 | - | |
| 206 | - if (schedule.getId() == first.getId()) { | |
| 207 | - if (i == 0) | |
| 208 | - st = schedule.getDfsjT() - diff; | |
| 209 | - else | |
| 210 | - st = dirList.get(i - 1).getDfsjT(); | |
| 211 | - continue; | |
| 212 | - } | |
| 213 | - if (null == st || schedule.getStatus() == -1) | |
| 214 | - continue; | |
| 215 | - | |
| 216 | - st = st + diff; | |
| 217 | - schedule.setDfsjT(st); | |
| 218 | - schedule.setDfsj(sdfShort.format(new Date(st))); | |
| 219 | - | |
| 220 | - dayOfSchedule.save(schedule); | |
| 221 | - //scheduleRealInfoRepository.save(schedule); | |
| 222 | - //ScheduleBuffer.persistentList.add(schedule); | |
| 223 | - // 将调整的班次返回给页面 | |
| 224 | - rsList.add(schedule); | |
| 225 | - } | |
| 226 | - } | |
| 196 | +// if (spaceAdjust == 1) { | |
| 197 | +// | |
| 198 | +// ScheduleRealInfo first = dayOfSchedule.get(Long.parseLong(idList.get(0))); | |
| 199 | +// String lineCode = first.getXlBm() + ""; | |
| 200 | +// String upDown = first.getXlDir(); | |
| 201 | +// | |
| 202 | +// List<ScheduleRealInfo> schList = dayOfSchedule.findByLineCode(lineCode), | |
| 203 | +// dirList = new ArrayList<>(); | |
| 204 | +// // 筛选走向 | |
| 205 | +// for (ScheduleRealInfo s : schList) { | |
| 206 | +// if (s.getXlDir().equals(upDown)) { | |
| 207 | +// dirList.add(s); | |
| 208 | +// } | |
| 209 | +// } | |
| 210 | +// | |
| 211 | +// int size = dirList.size(); | |
| 212 | +// Long st = null; | |
| 213 | +// int diff = spaceNum * 60 * 1000; | |
| 214 | +// for (int i = 0; i < size; i++) { | |
| 215 | +// schedule = dirList.get(i); | |
| 216 | +// | |
| 217 | +// if (schedule.getId() == first.getId()) { | |
| 218 | +// if (i == 0) | |
| 219 | +// st = schedule.getDfsjT() - diff; | |
| 220 | +// else | |
| 221 | +// st = dirList.get(i - 1).getDfsjT(); | |
| 222 | +// continue; | |
| 223 | +// } | |
| 224 | +// if (null == st || schedule.getStatus() == -1) | |
| 225 | +// continue; | |
| 226 | +// | |
| 227 | +// st = st + diff; | |
| 228 | +// schedule.setDfsjT(st); | |
| 229 | +// schedule.setDfsj(sdfShort.format(new Date(st))); | |
| 230 | +// | |
| 231 | +// dayOfSchedule.save(schedule); | |
| 232 | +// //scheduleRealInfoRepository.save(schedule); | |
| 233 | +// //ScheduleBuffer.persistentList.add(schedule); | |
| 234 | +// // 将调整的班次返回给页面 | |
| 235 | +// rsList.add(schedule); | |
| 236 | +// } | |
| 237 | +// } | |
| 227 | 238 | |
| 228 | 239 | map.put("status", ResponseCode.SUCCESS); |
| 229 | 240 | } catch (Exception e) { |
| ... | ... | @@ -302,6 +313,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 302 | 313 | return rsList; |
| 303 | 314 | } |
| 304 | 315 | |
| 316 | + | |
| 305 | 317 | /** |
| 306 | 318 | * 临加班次 |
| 307 | 319 | */ |
| ... | ... | @@ -312,41 +324,85 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 312 | 324 | SysUser user = SecurityUtils.getCurrentUser(); |
| 313 | 325 | String schDate = DayOfSchedule.currSchDateMap.get(t.getXlBm()); |
| 314 | 326 | |
| 315 | - SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"); | |
| 327 | + SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd") | |
| 328 | + ,sdfyyyyMMddHHmm = new SimpleDateFormat("yyyy-MM-ddHH:mm"); | |
| 329 | + | |
| 330 | + if(StringUtils.isEmpty(t.getjGh())){ | |
| 331 | + rs.put("status", ResponseCode.ERROR); | |
| 332 | + rs.put("msg", "驾驶员工号不能为空!"); | |
| 333 | + return rs; | |
| 334 | + } | |
| 335 | + | |
| 316 | 336 | t.setScheduleDateStr(schDate); |
| 317 | 337 | t.setScheduleDate(sdfyyyyMMdd.parse(schDate)); |
| 318 | 338 | t.setRealExecDate(schDate); |
| 319 | 339 | t.setCreateBy(user); |
| 320 | 340 | t.setSflj(true); |
| 321 | 341 | t.setLate(false); |
| 342 | + t.setZdsjT(sdfyyyyMMddHHmm.parse(schDate + t.getZdsj()).getTime()); | |
| 343 | + | |
| 344 | + | |
| 322 | 345 | //班次历时 |
| 323 | 346 | t.setBcsj(DateUtils.calcHHmmDiff(t.getFcsj(), t.getZdsj()) / 1000 / 60); |
| 324 | - | |
| 347 | + | |
| 348 | + //起终点名称 | |
| 349 | + t.setQdzName(BasicData.stationCode2NameMap.get(t.getQdzCode())); | |
| 350 | + t.setZdzName(BasicData.stationCode2NameMap.get(t.getZdzCode())); | |
| 351 | + | |
| 352 | + //计算班次实际时间 | |
| 353 | + schAttrCalculator.calcRealDate(t).calcAllTimeByFcsj(t); | |
| 354 | + if(t.getZdsjT() < t.getFcsjT()){ | |
| 355 | + rs.put("status", ResponseCode.ERROR); | |
| 356 | + rs.put("msg", "起终点时间异常!"); | |
| 357 | + return rs; | |
| 358 | + } | |
| 359 | + | |
| 325 | 360 | //实时入库 |
| 326 | - rs = super.save(t); | |
| 361 | + super.save(t); | |
| 362 | + | |
| 327 | 363 | // 加入缓存 |
| 328 | 364 | dayOfSchedule.put(t); |
| 329 | 365 | |
| 330 | - dayOfSchedule.calcQdzTimePlan(t.getClZbh()); | |
| 331 | - //将该临加之后的班次作为更新返回页面 | |
| 332 | - List<ScheduleRealInfo> list = dayOfSchedule.nextAll(t) | |
| 333 | - ,rsList = null; | |
| 366 | + //更新起点应到时间 | |
| 367 | + List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(t.getClZbh()); | |
| 334 | 368 | |
| 335 | - for(ScheduleRealInfo sch : list){ | |
| 336 | - if(sch.getId() == t.getId()) | |
| 337 | - rsList = new ArrayList<>(); | |
| 338 | - | |
| 339 | - if(rsList != null) | |
| 340 | - rsList.add(sch); | |
| 341 | - } | |
| 342 | 369 | |
| 343 | - rs.put("ups", rsList); | |
| 370 | + rs.put("ts", ts); | |
| 371 | + rs.put("t", t); | |
| 344 | 372 | }catch(Exception e){ |
| 345 | 373 | logger.error("", e); |
| 346 | 374 | rs.put("status", ResponseCode.ERROR); |
| 347 | 375 | } |
| 348 | 376 | return rs; |
| 349 | 377 | } |
| 378 | + | |
| 379 | + @Override | |
| 380 | + public Map<String, Object> delete(Long id) { | |
| 381 | + Map<String, Object> rs = new HashMap<>(); | |
| 382 | + rs.put("status", ResponseCode.ERROR); | |
| 383 | + | |
| 384 | + ScheduleRealInfo sch = dayOfSchedule.get(id); | |
| 385 | + if(sch == null){ | |
| 386 | + rs.put("msg", "无效的id号"); | |
| 387 | + return rs; | |
| 388 | + } | |
| 389 | + | |
| 390 | + if(!sch.isSflj()){ | |
| 391 | + rs.put("msg", "你只能删除临加班次"); | |
| 392 | + return rs; | |
| 393 | + } | |
| 394 | + | |
| 395 | + dayOfSchedule.delete(sch); | |
| 396 | + //ScheduleRealInfo sch = dayOfSchedule.delete(id); | |
| 397 | + //数据库删除 | |
| 398 | + rs = super.delete(id); | |
| 399 | + //更新起点应到时间 | |
| 400 | + List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch.getClZbh()); | |
| 401 | + rs.put("ts", ts); | |
| 402 | + rs.put("delete", sch); | |
| 403 | + | |
| 404 | + return rs; | |
| 405 | + } | |
| 350 | 406 | |
| 351 | 407 | @Override |
| 352 | 408 | public List<Map<String, String>> sreachVehic(String nbbm) { |
| ... | ... | @@ -783,11 +839,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 783 | 839 | try { |
| 784 | 840 | Long id = Long.parseLong(map.get("id")); |
| 785 | 841 | //班次类型 |
| 786 | - String bcType = map.get("bcType"); | |
| 842 | + //String bcType = map.get("bcType"); | |
| 787 | 843 | //车辆自编号 |
| 788 | - String clZbh = map.get("clZbh"); | |
| 844 | + //String clZbh = map.get("clZbh"); | |
| 789 | 845 | //计划发车时间 |
| 790 | - String fcsj = map.get("fcsj"); | |
| 846 | + //String fcsj = map.get("fcsj"); | |
| 791 | 847 | //实际发车时间 |
| 792 | 848 | String fcsjActual = map.get("fcsjActual"); |
| 793 | 849 | |
| ... | ... | @@ -798,23 +854,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 798 | 854 | |
| 799 | 855 | ScheduleRealInfo sch = dayOfSchedule.get(id); |
| 800 | 856 | if(null != sch){ |
| 801 | - //驾驶员 | |
| 802 | - if(StringUtils.isNotBlank(map.get("jsy"))){ | |
| 803 | - String[] jsy = map.get("jsy").split("/"); | |
| 804 | - sch.setjGh(jsy[0]); | |
| 805 | - sch.setjName(jsy[1]); | |
| 806 | - } | |
| 857 | +// //驾驶员 | |
| 858 | +// if(StringUtils.isNotBlank(map.get("jsy"))){ | |
| 859 | +// String[] jsy = map.get("jsy").split("/"); | |
| 860 | +// sch.setjGh(jsy[0]); | |
| 861 | +// sch.setjName(jsy[1]); | |
| 862 | +// } | |
| 807 | 863 | |
| 808 | 864 | //售票员 |
| 809 | - if(StringUtils.isNotBlank(map.get("spy"))){ | |
| 810 | - String[] spy = map.get("spy").split("/"); | |
| 811 | - sch.setsGh(spy[0]); | |
| 812 | - sch.setsName(spy[1]); | |
| 813 | - } | |
| 865 | +// if(StringUtils.isNotBlank(map.get("spy"))){ | |
| 866 | +// String[] spy = map.get("spy").split("/"); | |
| 867 | +// sch.setsGh(spy[0]); | |
| 868 | +// sch.setsName(spy[1]); | |
| 869 | +// } | |
| 814 | 870 | |
| 815 | - sch.setBcType(bcType); | |
| 816 | - sch.setClZbh(clZbh); | |
| 817 | - sch.setFcsjAll(fcsj); | |
| 871 | + //sch.setBcType(bcType); | |
| 872 | + //sch.setClZbh(clZbh); | |
| 873 | + //sch.setFcsjAll(fcsj); | |
| 818 | 874 | |
| 819 | 875 | if(StringUtils.isNotBlank(fcsjActual)){ |
| 820 | 876 | //调整实发 |
| ... | ... | @@ -1410,19 +1466,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1410 | 1466 | return scheduleRealInfoRepository.scheduleByDateAndLine(line, date); |
| 1411 | 1467 | } |
| 1412 | 1468 | |
| 1413 | - @Override | |
| 1414 | - public Map<String, Object> delete(Long id) { | |
| 1415 | - Map<String, Object> rs = new HashMap<>(); | |
| 1416 | - ScheduleRealInfo sch = dayOfSchedule.delete(id); | |
| 1417 | - if(null != sch){ | |
| 1418 | - rs = super.delete(id); | |
| 1419 | - rs.put("t", sch); | |
| 1420 | - } | |
| 1421 | - else | |
| 1422 | - rs.put("status", ResponseCode.ERROR); | |
| 1423 | - | |
| 1424 | - return rs; | |
| 1425 | - } | |
| 1426 | 1469 | |
| 1427 | 1470 | public List<Map<String,Object>> yesterdayDataList(String line) { |
| 1428 | 1471 | //前一天日期 |
| ... | ... | @@ -1471,4 +1514,99 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1471 | 1514 | } |
| 1472 | 1515 | return yesterdayDataList; |
| 1473 | 1516 | } |
| 1517 | + | |
| 1518 | + /** | |
| 1519 | + * 批量调整人车 | |
| 1520 | + */ | |
| 1521 | + @Override | |
| 1522 | + public Map<String, Object> multi_tzrc(List<ChangePersonCar> cpcs) { | |
| 1523 | + Map<String, Object> rs = new HashMap<>(); | |
| 1524 | + Set<ScheduleRealInfo> set = new HashSet<>(); | |
| 1525 | + | |
| 1526 | + ScheduleRealInfo sch; | |
| 1527 | + | |
| 1528 | + for(ChangePersonCar cpc : cpcs){ | |
| 1529 | + | |
| 1530 | + sch = dayOfSchedule.get(cpc.getSchId()); | |
| 1531 | + if(sch==null) | |
| 1532 | + continue; | |
| 1533 | + | |
| 1534 | + if(StringUtils.isNotEmpty(cpc.getJsy())){ | |
| 1535 | + //换驾驶员 | |
| 1536 | + persoChange(sch, cpc.getJsy().split("/")[0]); | |
| 1537 | + } | |
| 1538 | + | |
| 1539 | + //换售票员 | |
| 1540 | + if(StringUtils.isNotEmpty(cpc.getSpy())){ | |
| 1541 | + persoChangeSPY(sch, cpc.getSpy().split("/")[0]); | |
| 1542 | + } | |
| 1543 | + | |
| 1544 | + //换车 | |
| 1545 | + if(StringUtils.isNotEmpty(cpc.getClZbh())){ | |
| 1546 | + set.add(sch); | |
| 1547 | + set.addAll(dayOfSchedule.changeCar(sch, cpc.getClZbh())); | |
| 1548 | + } | |
| 1549 | + | |
| 1550 | + } | |
| 1551 | + rs.put("ts", set); | |
| 1552 | + rs.put("status", ResponseCode.SUCCESS); | |
| 1553 | + return rs; | |
| 1554 | + } | |
| 1555 | + | |
| 1556 | + /** | |
| 1557 | + * | |
| 1558 | + * @Title: persoChange | |
| 1559 | + * @Description: TODO(班次换驾驶员) | |
| 1560 | + */ | |
| 1561 | + public void persoChange(ScheduleRealInfo sch, String jGh){ | |
| 1562 | + if(sch.getjGh().equals(jGh)) | |
| 1563 | + return; | |
| 1564 | + String jName = BasicData.allPerson.get(jGh); | |
| 1565 | + if(StringUtils.isNotEmpty(jName)){ | |
| 1566 | + sch.setjGh(jGh); | |
| 1567 | + sch.setjName(jName); | |
| 1568 | + } | |
| 1569 | + } | |
| 1570 | + | |
| 1571 | + /** | |
| 1572 | + * | |
| 1573 | + * @Title: persoChange | |
| 1574 | + * @Description: TODO(班次换售票员) | |
| 1575 | + */ | |
| 1576 | + public void persoChangeSPY(ScheduleRealInfo sch, String sGh){ | |
| 1577 | + if(sch.getsGh().equals(sGh)) | |
| 1578 | + return; | |
| 1579 | + String sName = BasicData.allPerson.get(sGh); | |
| 1580 | + if(StringUtils.isNotEmpty(sName)){ | |
| 1581 | + sch.setsGh(sGh); | |
| 1582 | + sch.setsName(sName); | |
| 1583 | + } | |
| 1584 | + } | |
| 1585 | + | |
| 1586 | + /** | |
| 1587 | + * 批量待发调整 | |
| 1588 | + */ | |
| 1589 | + @Override | |
| 1590 | + public Map<String, Object> multi_dftz(List<DfsjChange> dfsjcs) { | |
| 1591 | + Map<String, Object> rs = new HashMap<>(); | |
| 1592 | + List<ScheduleRealInfo> list = new ArrayList<>(); | |
| 1593 | + | |
| 1594 | + ScheduleRealInfo sch; | |
| 1595 | + for(DfsjChange dc : dfsjcs){ | |
| 1596 | + if(StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj())) | |
| 1597 | + continue; | |
| 1598 | + | |
| 1599 | + sch = dayOfSchedule.get(dc.getSchId()); | |
| 1600 | + if(sch==null) | |
| 1601 | + continue; | |
| 1602 | + | |
| 1603 | + sch.setDfsjAll(dc.getNew_dfsj()); | |
| 1604 | + | |
| 1605 | + list.add(sch); | |
| 1606 | + } | |
| 1607 | + | |
| 1608 | + rs.put("status", ResponseCode.SUCCESS); | |
| 1609 | + rs.put("ts", list); | |
| 1610 | + return rs; | |
| 1611 | + } | |
| 1474 | 1612 | } | ... | ... |
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
| ... | ... | @@ -2,6 +2,9 @@ package com.bsth.websocket.handler; |
| 2 | 2 | |
| 3 | 3 | import java.io.IOException; |
| 4 | 4 | import java.util.ArrayList; |
| 5 | +import java.util.HashMap; | |
| 6 | +import java.util.List; | |
| 7 | +import java.util.Map; | |
| 5 | 8 | import java.util.Set; |
| 6 | 9 | |
| 7 | 10 | import org.slf4j.Logger; |
| ... | ... | @@ -13,11 +16,13 @@ import org.springframework.web.socket.WebSocketHandler; |
| 13 | 16 | import org.springframework.web.socket.WebSocketMessage; |
| 14 | 17 | import org.springframework.web.socket.WebSocketSession; |
| 15 | 18 | |
| 19 | +import com.alibaba.fastjson.JSONObject; | |
| 16 | 20 | import com.bsth.common.Constants; |
| 17 | 21 | import com.bsth.data.BasicData; |
| 22 | +import com.google.common.base.Splitter; | |
| 23 | +import com.google.common.collect.ArrayListMultimap; | |
| 18 | 24 | |
| 19 | 25 | /** |
| 20 | - * 注意:在sendMsg时,多线程状态下有几率出现连接状态脏读,建议 synchronized | |
| 21 | 26 | * @author PanZhao |
| 22 | 27 | */ |
| 23 | 28 | @Component |
| ... | ... | @@ -26,27 +31,57 @@ public class RealControlSocketHandler implements WebSocketHandler { |
| 26 | 31 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 27 | 32 | |
| 28 | 33 | private static final ArrayList<WebSocketSession> users; |
| 34 | + private static final ArrayListMultimap<String, WebSocketSession> listenMap; | |
| 29 | 35 | |
| 30 | 36 | static { |
| 31 | 37 | users = new ArrayList<WebSocketSession>(); |
| 38 | + listenMap = ArrayListMultimap.create(); | |
| 32 | 39 | } |
| 33 | 40 | |
| 34 | 41 | @Override |
| 35 | 42 | public void afterConnectionClosed(WebSocketSession session, CloseStatus arg1) |
| 36 | 43 | throws Exception { |
| 37 | 44 | users.remove(session); |
| 45 | + //清理监听 | |
| 46 | + Set<String> keys = listenMap.keySet(); | |
| 47 | + Map<String, WebSocketSession> remMap = new HashMap<>(); | |
| 48 | + for(String k : keys){ | |
| 49 | + if(listenMap.get(k).contains(session)) | |
| 50 | + remMap.put(k, session); | |
| 51 | + } | |
| 52 | + | |
| 53 | + Set<String> remSet = remMap.keySet(); | |
| 54 | + for(String k : remSet){ | |
| 55 | + listenMap.remove(k, remMap.get(k)); | |
| 56 | + logger.info("web socket close, remove listen K: "+ k); | |
| 57 | + } | |
| 58 | + logger.info("listen values size: " + listenMap.values().size()); | |
| 38 | 59 | } |
| 39 | 60 | |
| 40 | 61 | @Override |
| 41 | 62 | public void afterConnectionEstablished(WebSocketSession session) |
| 42 | 63 | throws Exception { |
| 43 | 64 | users.add(session); |
| 44 | - logger.info("###############users size" + users.size()); | |
| 45 | 65 | } |
| 46 | 66 | |
| 47 | 67 | @Override |
| 48 | - public void handleMessage(WebSocketSession arg0, WebSocketMessage<?> arg1) | |
| 68 | + public void handleMessage(WebSocketSession session, WebSocketMessage<?> msg) | |
| 49 | 69 | throws Exception { |
| 70 | + JSONObject jsonObj = JSONObject.parseObject(msg.getPayload().toString()); | |
| 71 | + switch (jsonObj.getString("operCode")) { | |
| 72 | + case "register_line": | |
| 73 | + //注册线路监听 | |
| 74 | + List<String> idx = Splitter.on(",").splitToList(jsonObj.getString("idx")); | |
| 75 | + for(String lineCode : idx){ | |
| 76 | + if(BasicData.lineCode2NameMap.containsKey(lineCode)) | |
| 77 | + listenMap.put(lineCode, session); | |
| 78 | + } | |
| 79 | + break; | |
| 80 | + | |
| 81 | + default: | |
| 82 | + break; | |
| 83 | + } | |
| 84 | + System.out.println(msg); | |
| 50 | 85 | } |
| 51 | 86 | |
| 52 | 87 | @Override |
| ... | ... | @@ -108,20 +143,21 @@ public class RealControlSocketHandler implements WebSocketHandler { |
| 108 | 143 | * @param message |
| 109 | 144 | */ |
| 110 | 145 | public synchronized void sendMessageToLine(String lineCode, String msg) { |
| 111 | - Set<String> uids = BasicData.lineCode2SocketUserMap.get(lineCode); | |
| 112 | - if(null == uids || uids.size() == 0) | |
| 113 | - return; | |
| 146 | + //Set<String> uids = BasicData.lineCode2SocketUserMap.get(lineCode); | |
| 147 | + //if(null == uids || uids.size() == 0) | |
| 148 | + // return; | |
| 114 | 149 | |
| 115 | 150 | TextMessage message = new TextMessage(msg.getBytes()); |
| 116 | - for (WebSocketSession user : users) { | |
| 117 | - if (uids.contains(user.getAttributes().get(Constants.SESSION_USERNAME))) { | |
| 118 | - try { | |
| 119 | - if (user.isOpen()) { | |
| 120 | - user.sendMessage(message); | |
| 121 | - } | |
| 122 | - } catch (IOException e) { | |
| 123 | - logger.error("sendMessageToLine error ....", e); | |
| 151 | + | |
| 152 | + List<WebSocketSession> sessList = listenMap.get(lineCode); | |
| 153 | + | |
| 154 | + for (WebSocketSession user : sessList) { | |
| 155 | + try { | |
| 156 | + if (user.isOpen()) { | |
| 157 | + user.sendMessage(message); | |
| 124 | 158 | } |
| 159 | + } catch (IOException e) { | |
| 160 | + logger.error("sendMessageToLine error ....", e); | |
| 125 | 161 | } |
| 126 | 162 | } |
| 127 | 163 | } | ... | ... |
src/main/java/com/bsth/websocket/handler/SendUtils.java
| ... | ... | @@ -169,7 +169,7 @@ public class SendUtils{ |
| 169 | 169 | |
| 170 | 170 | twins.setFcsjActualAll(sch.getFcsjActualTime()); |
| 171 | 171 | //刷新关联的出场班次 |
| 172 | - refreshSch(twins); | |
| 172 | + //refreshSch(twins); | |
| 173 | 173 | } |
| 174 | 174 | }catch(Exception e){ |
| 175 | 175 | logger.error("", e); |
| ... | ... | @@ -186,7 +186,7 @@ public class SendUtils{ |
| 186 | 186 | |
| 187 | 187 | twins.setZdsjActualAll(sch.getZdsjActualTime()); |
| 188 | 188 | //刷新关联的出场班次 |
| 189 | - refreshSch(twins); | |
| 189 | + //refreshSch(twins); | |
| 190 | 190 | } |
| 191 | 191 | }catch(Exception e){ |
| 192 | 192 | logger.error("", e); | ... | ... |
src/main/resources/static/index.html
| ... | ... | @@ -307,7 +307,7 @@ tr.row-active td { |
| 307 | 307 | <!-- 表格控件 --> |
| 308 | 308 | <!-- 统计图控件 --> |
| 309 | 309 | <script src="/assets/global/getEchart.js"></script> |
| 310 | -<script src="/assets/global/echarts.js"></script> | |
| 310 | +<!-- <script src="/assets/global/echarts.js"></script> --> | |
| 311 | 311 | <script src="/assets/js/common.js"></script> |
| 312 | 312 | <script src="/assets/js/dictionary.js"></script> |
| 313 | 313 | ... | ... |
src/main/resources/static/pages/control/line/js/messenger.js
| 1 | 1 | var _messenger = (function(){ |
| 2 | 2 | |
| 3 | 3 | //定时到离站信使清理掉(不包含80) |
| 4 | - !function(){ | |
| 5 | - var f = arguments.callee | |
| 6 | - ,ct = Date.parse(new Date()) / 1000 | |
| 7 | - ,list, time, lineCode; | |
| 8 | - | |
| 9 | - try { | |
| 10 | - var lineArray = _data.getLines(); | |
| 11 | - | |
| 12 | - $.each(lineArray, function(){ | |
| 13 | - lineCode = this.lineCode; | |
| 14 | - | |
| 15 | - list = $('#messengerList' + lineCode).find('.log-item.fache,.log-item.zhongdian'); | |
| 16 | - $.each(list, function(){ | |
| 17 | - time = parseInt($(this).data('time')); | |
| 18 | - if(ct - time >= 30) | |
| 19 | - removeLogItem($(this)); | |
| 20 | - }); | |
| 21 | - //更新未处理的消息数量 | |
| 22 | - setUntreatedNum(lineCode); | |
| 23 | - }); | |
| 24 | - } catch (e) { | |
| 25 | - console.log(e); | |
| 26 | - } | |
| 27 | - setTimeout(f, 3000); | |
| 28 | - }(); | |
| 4 | +// !function(){ | |
| 5 | +// var f = arguments.callee | |
| 6 | +// ,ct = Date.parse(new Date()) / 1000 | |
| 7 | +// ,list, time, lineCode; | |
| 8 | +// | |
| 9 | +// try { | |
| 10 | +// var lineArray = _data.getLines(); | |
| 11 | +// | |
| 12 | +// $.each(lineArray, function(){ | |
| 13 | +// lineCode = this.lineCode; | |
| 14 | +// | |
| 15 | +// list = $('#messengerList' + lineCode).find('.log-item.fache,.log-item.zhongdian'); | |
| 16 | +// $.each(list, function(){ | |
| 17 | +// time = parseInt($(this).data('time')); | |
| 18 | +// if(ct - time >= 30) | |
| 19 | +// removeLogItem($(this)); | |
| 20 | +// }); | |
| 21 | +// //更新未处理的消息数量 | |
| 22 | +// setUntreatedNum(lineCode); | |
| 23 | +// }); | |
| 24 | +// } catch (e) { | |
| 25 | +// console.log(e); | |
| 26 | +// } | |
| 27 | +// setTimeout(f, 30000); | |
| 28 | +// }(); | |
| 29 | 29 | |
| 30 | 30 | //未处理消息数量 |
| 31 | 31 | function setUntreatedNum(lineCode){ | ... | ... |
src/main/resources/static/pages/control/line/js/webSocketHandle.js
| ... | ... | @@ -3,13 +3,13 @@ var _socket = (function(){ |
| 3 | 3 | |
| 4 | 4 | //将当前用户和线路绑定到后台 |
| 5 | 5 | setTimeout(function(){ |
| 6 | - $.get('/realSchedule/registerLine', {lineCodes: lineCodes} | |
| 7 | - ,function(rs){ | |
| 8 | - if(rs == 0){ | |
| 9 | - console.log('注册线路成功!'); | |
| 6 | +// $.get('/realSchedule/registerLine', {lineCodes: lineCodes} | |
| 7 | +// ,function(rs){ | |
| 8 | +// if(rs == 0){ | |
| 9 | +// console.log('注册线路成功!'); | |
| 10 | 10 | initWebSocket(); |
| 11 | - } | |
| 12 | - }); | |
| 11 | +// } | |
| 12 | +// }); | |
| 13 | 13 | }, 500); |
| 14 | 14 | |
| 15 | 15 | //初始化webSocket |
| ... | ... | @@ -20,6 +20,12 @@ var initWebSocket = function(){ |
| 20 | 20 | msgSock.onopen = function(e) { |
| 21 | 21 | console.log('webSocket[realcontrol] onopen'); |
| 22 | 22 | countDown('webSocketHandle.js'); |
| 23 | + //注册线路监听 | |
| 24 | + var data = { | |
| 25 | + operCode: 'register_line', | |
| 26 | + idx: '63002' | |
| 27 | + } | |
| 28 | + msgSock.send(JSON.stringify(data)); | |
| 23 | 29 | }; |
| 24 | 30 | //接收消息 |
| 25 | 31 | msgSock.onmessage = function(e) { | ... | ... |
src/main/resources/static/pages/control/lineallot/allot.html
| ... | ... | @@ -163,8 +163,8 @@ |
| 163 | 163 | <a href="javascript:;" class="btn btn-lg blue gotoControl red" data-status=1> |
| 164 | 164 | <i class="fa fa-power-off"></i> 主调模式 </a> |
| 165 | 165 | |
| 166 | - <a href="javascript:;" id="monitor" class="btn btn-lg grey gotoControl" data-status=0> | |
| 167 | - <i class="fa fa-tv"></i> 监控模式 </a> | |
| 166 | + <!-- <a href="javascript:;" id="monitor" class="btn btn-lg grey gotoControl" data-status=0> | |
| 167 | + <i class="fa fa-tv"></i> 监控模式 </a> --> | |
| 168 | 168 | |
| 169 | 169 | <a href="javascript:;" id="resetBtn" style="left: 120px;color: #3598DC;"> |
| 170 | 170 | <i class="fa fa-history"></i> 重置</a> |
| ... | ... | @@ -340,7 +340,8 @@ $(function(){ |
| 340 | 340 | ep.tail('gotoControl', function(){ |
| 341 | 341 | //alert('进入线调'); |
| 342 | 342 | layer.closeAll(); |
| 343 | - loadPage('/pages/control/line/index.html'); | |
| 343 | + //loadPage('/pages/control/line/index.html'); | |
| 344 | + window.location.href="/real_control_v2/main.html"; | |
| 344 | 345 | }); |
| 345 | 346 | }); |
| 346 | 347 | ... | ... |
src/main/resources/static/pages/mapmonitor/real/css/real.css
| ... | ... | @@ -27,7 +27,7 @@ label.BMapLabel{ |
| 27 | 27 | |
| 28 | 28 | #mapContainer{ |
| 29 | 29 | min-width: 100%; |
| 30 | - width: calc(100% + 26px); | |
| 30 | + width: calc(100% + 26px); | |
| 31 | 31 | margin-top: -28px; |
| 32 | 32 | border: 2px solid #fdfdfd; |
| 33 | 33 | } |
| ... | ... | @@ -48,9 +48,9 @@ label.BMapLabel{ |
| 48 | 48 | background-color: #3B3F51; |
| 49 | 49 | top: 98px; |
| 50 | 50 | /* padding-top: 15px; */ |
| 51 | - | |
| 51 | + | |
| 52 | 52 | transition: all .3s ease; |
| 53 | - | |
| 53 | + | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | .mapRightWrap.vehicle .slimScrollBar{ |
| ... | ... | @@ -77,7 +77,7 @@ label.BMapLabel{ |
| 77 | 77 | |
| 78 | 78 | .mapRightWrap.to_searchPanel{ |
| 79 | 79 | transform:rotateY(180deg); |
| 80 | - height: 200px; | |
| 80 | + height: 200px; | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | .mapRightWrap.to_vehicle{ |
| ... | ... | @@ -186,7 +186,7 @@ label.BMapLabel{ |
| 186 | 186 | color: #ddd; |
| 187 | 187 | padding-top: 7px; |
| 188 | 188 | top: 20px; |
| 189 | - | |
| 189 | + | |
| 190 | 190 | transition: all .5s ease; |
| 191 | 191 | } |
| 192 | 192 | |
| ... | ... | @@ -274,7 +274,7 @@ html{ |
| 274 | 274 | height: 100%; |
| 275 | 275 | width: 6px; |
| 276 | 276 | display: inline-block; |
| 277 | - | |
| 277 | + | |
| 278 | 278 | -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out; |
| 279 | 279 | animation: sk-stretchdelay 1.2s infinite ease-in-out; |
| 280 | 280 | } |
| ... | ... | @@ -300,15 +300,15 @@ html{ |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | @-webkit-keyframes sk-stretchdelay { |
| 303 | - 0%, 40%, 100% { -webkit-transform: scaleY(0.4) } | |
| 303 | + 0%, 40%, 100% { -webkit-transform: scaleY(0.4) } | |
| 304 | 304 | 20% { -webkit-transform: scaleY(1.0) } |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | @keyframes sk-stretchdelay { |
| 308 | - 0%, 40%, 100% { | |
| 308 | + 0%, 40%, 100% { | |
| 309 | 309 | transform: scaleY(0.4); |
| 310 | 310 | -webkit-transform: scaleY(0.4); |
| 311 | - } 20% { | |
| 311 | + } 20% { | |
| 312 | 312 | transform: scaleY(1.0); |
| 313 | 313 | -webkit-transform: scaleY(1.0); |
| 314 | 314 | } |
| ... | ... | @@ -326,7 +326,7 @@ html{ |
| 326 | 326 | background-color: #69D7E1; |
| 327 | 327 | float: left; |
| 328 | 328 | -webkit-animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out; |
| 329 | - animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out; | |
| 329 | + animation: sk-cubeGridScaleDelay 1.3s infinite ease-in-out; | |
| 330 | 330 | } |
| 331 | 331 | .sk-cube-grid .sk-cube1 { |
| 332 | 332 | -webkit-animation-delay: 0.2s; |
| ... | ... | @@ -362,7 +362,7 @@ html{ |
| 362 | 362 | transform: scale3D(1, 1, 1); |
| 363 | 363 | } 35% { |
| 364 | 364 | -webkit-transform: scale3D(0, 0, 1); |
| 365 | - transform: scale3D(0, 0, 1); | |
| 365 | + transform: scale3D(0, 0, 1); | |
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | |
| ... | ... | @@ -373,7 +373,7 @@ html{ |
| 373 | 373 | } 35% { |
| 374 | 374 | -webkit-transform: scale3D(0, 0, 1); |
| 375 | 375 | transform: scale3D(0, 0, 1); |
| 376 | - } | |
| 376 | + } | |
| 377 | 377 | } |
| 378 | 378 | /* spinner load end ------------------------------- */ |
| 379 | 379 | |
| ... | ... | @@ -406,7 +406,7 @@ html{ |
| 406 | 406 | font-size: 24px; |
| 407 | 407 | color: #7C8994; |
| 408 | 408 | transition: all .5s ease; |
| 409 | - | |
| 409 | + | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | .mapRightWrap.vehicle p.head>span.icon.rotate{ |
| ... | ... | @@ -451,7 +451,7 @@ html{ |
| 451 | 451 | |
| 452 | 452 | .mapRightWrap.vehicle .vehicle-item.online_0 div.text span.nbbm:hover{ |
| 453 | 453 | color: #45D245; |
| 454 | -} | |
| 454 | +} | |
| 455 | 455 | |
| 456 | 456 | .mapRightWrap.vehicle .vehicle-item.online_1 div.text span.nbbm:hover{ |
| 457 | 457 | color: #f16454; |
| ... | ... | @@ -490,7 +490,7 @@ html{ |
| 490 | 490 | width: 100%; |
| 491 | 491 | top: 60px; |
| 492 | 492 | color: #e5e5e5; |
| 493 | - | |
| 493 | + | |
| 494 | 494 | max-height: 500px; |
| 495 | 495 | overflow: auto; |
| 496 | 496 | } |
| ... | ... | @@ -638,7 +638,7 @@ html{ |
| 638 | 638 | .mapRightWrap.gaode .search_result .item_vehicle.state_online{ |
| 639 | 639 | color: #3d3dec; |
| 640 | 640 | } |
| 641 | - | |
| 641 | + | |
| 642 | 642 | .mapRightWrap.gaode .search_result .result_item span.sub_text{ |
| 643 | 643 | color: #8E8D8D; |
| 644 | 644 | } |
| ... | ... | @@ -733,7 +733,7 @@ html{ |
| 733 | 733 | background: #2d2b2b; |
| 734 | 734 | width: 0; |
| 735 | 735 | cursor: pointer; |
| 736 | - | |
| 736 | + | |
| 737 | 737 | /* transition: all 1s ease; */ |
| 738 | 738 | } |
| 739 | 739 | |
| ... | ... | @@ -780,11 +780,11 @@ html{ |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | 782 | .pback-logs-item.out{ |
| 783 | - color: #f58f83; | |
| 783 | + color: #f58f83; | |
| 784 | 784 | } |
| 785 | 785 | |
| 786 | 786 | .pback-logs-item.in{ |
| 787 | - color: #8181d4; | |
| 787 | + color: #8181d4; | |
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | .pback-logs-item{ |
| ... | ... | @@ -910,4 +910,4 @@ html{ |
| 910 | 910 | |
| 911 | 911 | #bufferAreaConfigPanel ul.list li:FIRST-CHILD { |
| 912 | 912 | margin-top: 0px; |
| 913 | -} | |
| 914 | 913 | \ No newline at end of file |
| 914 | +} | ... | ... |
src/main/resources/static/pages/mapmonitor/real/js/map/iMap.js
| 1 | 1 | /** 各个地图平台通用接口定义 */ |
| 2 | 2 | var iMap = (function(){ |
| 3 | - | |
| 3 | + | |
| 4 | 4 | var storage = window.localStorage; |
| 5 | 5 | // 地图DOM容器 |
| 6 | 6 | var mapContainer = $('#mapContainer'); |
| ... | ... | @@ -11,7 +11,7 @@ var iMap = (function(){ |
| 11 | 11 | //添加一个地图实例 |
| 12 | 12 | addMap: function(name, text, instance){ |
| 13 | 13 | maps[name] = {name: name, text: text, instance: instance}; |
| 14 | - | |
| 14 | + | |
| 15 | 15 | if(!currentMap) |
| 16 | 16 | currentMap = name; |
| 17 | 17 | return mapProxy; |
| ... | ... | @@ -26,14 +26,14 @@ var iMap = (function(){ |
| 26 | 26 | $(consts.mapContainer).html(''); |
| 27 | 27 | //解除实时路况按钮点击事件 |
| 28 | 28 | $(consts.trafficBtn).unbind('click'); |
| 29 | - | |
| 29 | + | |
| 30 | 30 | //新地图 INIT |
| 31 | 31 | var text = maps[mapName].text; |
| 32 | 32 | layer.msg('正在切换到' + text + '...', {icon : 16,shade : [ 0.6, '#393D49' ],time : 0}); |
| 33 | 33 | var newMap = maps[mapName].instance; |
| 34 | 34 | newMap.init(); |
| 35 | 35 | setText(text); |
| 36 | - | |
| 36 | + | |
| 37 | 37 | currentMap = mapName; |
| 38 | 38 | //收拢线路 |
| 39 | 39 | $('.mapRightWrap .collapse.in').collapse('hide'); |
| ... | ... | @@ -44,7 +44,7 @@ var iMap = (function(){ |
| 44 | 44 | call: function(f, opts){ |
| 45 | 45 | if(f == 'init') |
| 46 | 46 | setText(maps[currentMap].text); |
| 47 | - | |
| 47 | + | |
| 48 | 48 | var instance = maps[currentMap].instance; |
| 49 | 49 | if(instance[f]) |
| 50 | 50 | instance[f](opts); |
| ... | ... | @@ -53,23 +53,23 @@ var iMap = (function(){ |
| 53 | 53 | return mapProxy; |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | - | |
| 56 | + | |
| 57 | 57 | //绘制车辆icon |
| 58 | 58 | function createCarIcon(gps, w){ |
| 59 | 59 | var canvas = $('<canvas></canvas>')[0]; |
| 60 | 60 | var ctx = canvas.getContext('2d'); |
| 61 | - | |
| 61 | + | |
| 62 | 62 | var colours = color(gps); |
| 63 | - | |
| 63 | + | |
| 64 | 64 | ctx.shadowOffsetX = 5; // 阴影Y轴偏移 |
| 65 | 65 | ctx.shadowOffsetY = 5; // 阴影X轴偏移 |
| 66 | 66 | ctx.shadowBlur = 1; // 模糊尺寸 |
| 67 | 67 | ctx.shadowColor = colours.shadow; // 颜色 |
| 68 | - | |
| 68 | + | |
| 69 | 69 | //绘制背景 |
| 70 | 70 | if(!w) |
| 71 | 71 | w = 70; |
| 72 | - | |
| 72 | + | |
| 73 | 73 | ctx.roundRect(0, 0, w, 25, 5).stroke(); |
| 74 | 74 | ctx.fillStyle=colours.bgColor; |
| 75 | 75 | ctx.fill(); |
| ... | ... | @@ -77,10 +77,10 @@ var iMap = (function(){ |
| 77 | 77 | ctx.font="14px arial"; |
| 78 | 78 | ctx.fillStyle = "#fff"; |
| 79 | 79 | ctx.fillText(gps.nbbm, 8, 18); |
| 80 | - | |
| 80 | + | |
| 81 | 81 | return canvas.toDataURL(); |
| 82 | 82 | } |
| 83 | - | |
| 83 | + | |
| 84 | 84 | function color(g){ |
| 85 | 85 | var colours = {}; |
| 86 | 86 | switch (g.state) { |
| ... | ... | @@ -108,18 +108,18 @@ var iMap = (function(){ |
| 108 | 108 | colours['shadow'] = 'rgba(136, 133, 133, 0.3)'; |
| 109 | 109 | break; |
| 110 | 110 | } |
| 111 | - | |
| 111 | + | |
| 112 | 112 | return colours; |
| 113 | 113 | } |
| 114 | - | |
| 114 | + | |
| 115 | 115 | function alertErr(text){ |
| 116 | 116 | layer.alert(text, {icon: 2, title: '来自地图的异常'}); |
| 117 | 117 | } |
| 118 | - | |
| 118 | + | |
| 119 | 119 | function setText(text) { |
| 120 | 120 | $('.leftUtils span.dropdown-toggle').html( |
| 121 | 121 | text + ' <i class="fa fa-angle-down"></i>'); |
| 122 | 122 | } |
| 123 | - | |
| 123 | + | |
| 124 | 124 | return mapProxy; |
| 125 | -})(); | |
| 126 | 125 | \ No newline at end of file |
| 126 | +})(); | ... | ... |
src/main/resources/static/pages/mapmonitor/real/js/map/platform/baidu.js
| 1 | 1 | /** 百度地图相关接口封装 */ |
| 2 | 2 | var baiduMap = (function(){ |
| 3 | - | |
| 3 | + | |
| 4 | 4 | var map; |
| 5 | 5 | var realMarkers = {}; |
| 6 | 6 | var topMarker; |
| ... | ... | @@ -16,10 +16,10 @@ var baiduMap = (function(){ |
| 16 | 16 | //中心点和缩放级别 |
| 17 | 17 | map.centerAndZoom(new BMap.Point(consts.center_point.lng, consts.center_point.lat), 15); |
| 18 | 18 | map.enableScrollWheelZoom(); |
| 19 | - | |
| 19 | + | |
| 20 | 20 | layer.closeAll(); |
| 21 | 21 | window.localStorage.setItem('real_map', 'baidu'); |
| 22 | - | |
| 22 | + | |
| 23 | 23 | // 路况控件 |
| 24 | 24 | var ctrl = new BMapLib.TrafficControl(); |
| 25 | 25 | map.addControl(ctrl); |
| ... | ... | @@ -54,13 +54,13 @@ var baiduMap = (function(){ |
| 54 | 54 | }, |
| 55 | 55 | //画线路图层 |
| 56 | 56 | drawLine: function(opts){ |
| 57 | - | |
| 57 | + | |
| 58 | 58 | map.clearOverlays(); |
| 59 | 59 | linePolyline = []; |
| 60 | 60 | //从localStorage里读取路由信息 |
| 61 | 61 | var upLineOps = {strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5} |
| 62 | 62 | ,downLineOps = {strokeColor:"red", strokeWeight:6, strokeOpacity:0.5}; |
| 63 | - | |
| 63 | + | |
| 64 | 64 | var upPos = [], downPos = [], tempArray; |
| 65 | 65 | var route = opts.route; |
| 66 | 66 | //上行 |
| ... | ... | @@ -69,12 +69,12 @@ var baiduMap = (function(){ |
| 69 | 69 | tempArray = this.split(' '); |
| 70 | 70 | upPos.push(new BMap.Point(tempArray[0], tempArray[1])); |
| 71 | 71 | }); |
| 72 | - | |
| 72 | + | |
| 73 | 73 | var upLine = new BMap.Polyline(upPos, upLineOps); |
| 74 | 74 | map.addOverlay(upLine); |
| 75 | - | |
| 75 | + | |
| 76 | 76 | linePolyline.push(upLine); |
| 77 | - | |
| 77 | + | |
| 78 | 78 | map.panTo(upPos[parseInt(upPos.length / 2)]); |
| 79 | 79 | } |
| 80 | 80 | //下行 |
| ... | ... | @@ -83,10 +83,10 @@ var baiduMap = (function(){ |
| 83 | 83 | tempArray = this.split(' '); |
| 84 | 84 | downPos.push(new BMap.Point(tempArray[0], tempArray[1])); |
| 85 | 85 | }); |
| 86 | - | |
| 86 | + | |
| 87 | 87 | var downLine = new BMap.Polyline(downPos, downLineOps); |
| 88 | 88 | map.addOverlay(downLine); |
| 89 | - | |
| 89 | + | |
| 90 | 90 | linePolyline.push(downLine); |
| 91 | 91 | } |
| 92 | 92 | }, |
| ... | ... | @@ -141,7 +141,7 @@ var baiduMap = (function(){ |
| 141 | 141 | circle.setStrokeColor(opts.color); |
| 142 | 142 | if(opts.weight) |
| 143 | 143 | circle.setStrokeWeight(opts.weight); |
| 144 | - | |
| 144 | + | |
| 145 | 145 | map.addOverlay(circle); |
| 146 | 146 | buffAreas[opts.id] = circle; |
| 147 | 147 | }, |
| ... | ... | @@ -153,7 +153,7 @@ var baiduMap = (function(){ |
| 153 | 153 | coord = TransGPS.wgsToBD(parseFloat(wgs[1]), parseFloat(wgs[0])); |
| 154 | 154 | points.push(new BMap.Point(coord.lng, coord.lat)); |
| 155 | 155 | }); |
| 156 | - | |
| 156 | + | |
| 157 | 157 | var polygon = new BMap.Polygon(points, {strokeColor: opts.color, strokeWeight: opts.weight, strokeOpacity: 0.7}); |
| 158 | 158 | map.addOverlay(polygon); |
| 159 | 159 | buffAreas[opts.id] = polygon; |
| ... | ... | @@ -166,23 +166,23 @@ var baiduMap = (function(){ |
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | }; |
| 169 | - | |
| 169 | + | |
| 170 | 170 | return baiduInstance; |
| 171 | - | |
| 171 | + | |
| 172 | 172 | var bd_gps_info_win_opts = { |
| 173 | 173 | width : 190, |
| 174 | 174 | height: 255, |
| 175 | 175 | enableMessage:true |
| 176 | 176 | }; |
| 177 | 177 | function createBDMarkerByGps(gpsData){ |
| 178 | - | |
| 178 | + | |
| 179 | 179 | var point = new BMap.Point(gpsData.bd_lon, gpsData.bd_lat); |
| 180 | 180 | var marker = new BMap.Marker(point); |
| 181 | - | |
| 181 | + | |
| 182 | 182 | //根据编码长度 计算marker 宽度 |
| 183 | 183 | var w = gpsData.nbbm.length * 10; |
| 184 | 184 | marker.setIcon(new BMap.Icon(iMap.createCarIcon(gpsData, w), new BMap.Size(w,25))); |
| 185 | - | |
| 185 | + | |
| 186 | 186 | marker.infoWindow = new BMap.InfoWindow(bd_gps_info_win_opts); |
| 187 | 187 | marker.gpsData = gpsData; |
| 188 | 188 | //click |
| ... | ... | @@ -195,29 +195,29 @@ var baiduMap = (function(){ |
| 195 | 195 | }); |
| 196 | 196 | return marker; |
| 197 | 197 | } |
| 198 | - | |
| 198 | + | |
| 199 | 199 | //隐藏线路线条 |
| 200 | 200 | function hideLinePolyline(){ |
| 201 | 201 | if(!linePolyline || linePolyline.length == 0) |
| 202 | 202 | return; |
| 203 | - | |
| 203 | + | |
| 204 | 204 | layer.msg('隐藏线路图层',{offset: 'ct', shift : 5}); |
| 205 | 205 | $.each(linePolyline, function(){ |
| 206 | 206 | this.setStrokeOpacity(0.1); |
| 207 | 207 | }); |
| 208 | 208 | } |
| 209 | - | |
| 209 | + | |
| 210 | 210 | //显示线路线条 |
| 211 | 211 | function showLinePolyline(){ |
| 212 | 212 | if(!linePolyline || linePolyline.length == 0) |
| 213 | 213 | return; |
| 214 | - | |
| 214 | + | |
| 215 | 215 | layer.msg('显示线路图层',{offset: 'ct', shift : 5}); |
| 216 | 216 | $.each(linePolyline, function(){ |
| 217 | 217 | this.setStrokeOpacity(0.5); |
| 218 | 218 | }); |
| 219 | 219 | } |
| 220 | - | |
| 220 | + | |
| 221 | 221 | function moveMarker(m, gps){ |
| 222 | 222 | m.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat)); |
| 223 | 223 | m.gpsData = gps; |
| ... | ... | @@ -225,24 +225,24 @@ var baiduMap = (function(){ |
| 225 | 225 | //根据编码长度 计算marker 宽度 |
| 226 | 226 | var w = gps.nbbm.length * 10; |
| 227 | 227 | m.setIcon(new BMap.Icon(iMap.createCarIcon(gps, w), new BMap.Size(w,25))); |
| 228 | - | |
| 228 | + | |
| 229 | 229 | //更新 infoWindow |
| 230 | 230 | if(m.infoWindow.isOpen()){ |
| 231 | 231 | bdOpenWindow(m); |
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | - | |
| 234 | + | |
| 235 | 235 | function setTop(m){ |
| 236 | 236 | if(topMarker) |
| 237 | 237 | topMarker.setTop(false); |
| 238 | 238 | m.setTop(true); |
| 239 | 239 | topMarker = m; |
| 240 | 240 | } |
| 241 | - | |
| 241 | + | |
| 242 | 242 | function bdOpenWindow(marker){ |
| 243 | 243 | marker.gpsData.fromNow = moment(marker.gpsData.timestamp).fromNow(); |
| 244 | - | |
| 244 | + | |
| 245 | 245 | marker.infoWindow.setContent(template('gps_info_win_temp', marker.gpsData)); |
| 246 | 246 | map.openInfoWindow(marker.infoWindow, marker.point); |
| 247 | 247 | } |
| 248 | -})(); | |
| 249 | 248 | \ No newline at end of file |
| 249 | +})(); | ... | ... |
src/main/resources/static/pages/mapmonitor/real/js/playBack.js
| ... | ... | @@ -18,7 +18,7 @@ var playBack = (function() { |
| 18 | 18 | var step = 10; |
| 19 | 19 | //1个px多少秒 |
| 20 | 20 | var secondPX; |
| 21 | - | |
| 21 | + | |
| 22 | 22 | var tRange; |
| 23 | 23 | //进度条宽度 |
| 24 | 24 | var pWidth; |
| ... | ... | @@ -47,13 +47,13 @@ var playBack = (function() { |
| 47 | 47 | var firstDeviceId; |
| 48 | 48 | //是否启用焦点跟踪 |
| 49 | 49 | var isEnableFocus; |
| 50 | - | |
| 50 | + | |
| 51 | 51 | var car2DeviceId; |
| 52 | - | |
| 52 | + | |
| 53 | 53 | //事件监听 |
| 54 | 54 | $('.play-back-btns .playBtn').on('click', function(){ |
| 55 | 55 | var status = $(this).data('status'); |
| 56 | - | |
| 56 | + | |
| 57 | 57 | //开始播放 |
| 58 | 58 | if(status == 0){ |
| 59 | 59 | maxWidth = $('.play-back-progress').width(); |
| ... | ... | @@ -65,7 +65,7 @@ var playBack = (function() { |
| 65 | 65 | $(this).removeClass('fa-pause').addClass('fa-play').data('status', 0); |
| 66 | 66 | } |
| 67 | 67 | }); |
| 68 | - | |
| 68 | + | |
| 69 | 69 | $('.progress-body').mousemove(function(e){ |
| 70 | 70 | var w = e.clientX - 20 |
| 71 | 71 | showMarkTextMouse(w); |
| ... | ... | @@ -76,7 +76,7 @@ var playBack = (function() { |
| 76 | 76 | goToByTime(sTime + w * secondPX); |
| 77 | 77 | hideMarkTextMouse(); |
| 78 | 78 | }); |
| 79 | - | |
| 79 | + | |
| 80 | 80 | //退出 |
| 81 | 81 | $('.play-back-close').on('click', function(){ |
| 82 | 82 | stop(); |
| ... | ... | @@ -94,7 +94,7 @@ var playBack = (function() { |
| 94 | 94 | //动画 |
| 95 | 95 | $('.play-back-list').removeClass('fadeInRightBig').addClass('fadeOutRightBig'); |
| 96 | 96 | $('.play-back-btns,.progress-wrap').removeClass('fadeInUpBig').addClass('fadeOutDownBig'); |
| 97 | - | |
| 97 | + | |
| 98 | 98 | setTimeout(function(){ |
| 99 | 99 | $('.mapRightWrap,.mapTools,.leftUtilsWrap').fadeIn(); |
| 100 | 100 | //隐藏元素,还原样式 |
| ... | ... | @@ -102,13 +102,13 @@ var playBack = (function() { |
| 102 | 102 | $('.play-back-btns,.progress-wrap').hide().removeClass('fadeOutDownBig').addClass('fadeInUpBig'); |
| 103 | 103 | }, 500); |
| 104 | 104 | }); |
| 105 | - | |
| 105 | + | |
| 106 | 106 | function showMarkText(w){ |
| 107 | 107 | var text = moment(cTime * 1000).format('HH:mm.ss'); |
| 108 | - | |
| 108 | + | |
| 109 | 109 | $presMark.text(text).css('left', w - $presMark.width() / 2).show(); |
| 110 | 110 | } |
| 111 | - | |
| 111 | + | |
| 112 | 112 | //添加进出站日志 |
| 113 | 113 | function addInOutText(gps){ |
| 114 | 114 | var info = gps.inout_stop_info; |
| ... | ... | @@ -122,10 +122,10 @@ var playBack = (function() { |
| 122 | 122 | gps.nbbm + ' '+ (info.inOut==1?'出':'进') +'站 '+info.stopName+' '+ |
| 123 | 123 | '<span class="pback-logs-item-date">'+ date +'</span>'+ |
| 124 | 124 | '</div>'; |
| 125 | - | |
| 125 | + | |
| 126 | 126 | $('.pback-logs').prepend(html); |
| 127 | 127 | } |
| 128 | - | |
| 128 | + | |
| 129 | 129 | //播放速度 |
| 130 | 130 | $('.play-speed-select li').on('click', function(){ |
| 131 | 131 | stop(); |
| ... | ... | @@ -133,7 +133,7 @@ var playBack = (function() { |
| 133 | 133 | $('#playSpeedText').text(speed); |
| 134 | 134 | play(); |
| 135 | 135 | }); |
| 136 | - | |
| 136 | + | |
| 137 | 137 | //被选中的缓冲区 |
| 138 | 138 | var buffAeraArray = {}, bConfLayer; |
| 139 | 139 | //缓冲区 |
| ... | ... | @@ -143,12 +143,12 @@ var playBack = (function() { |
| 143 | 143 | bConfLayer = null; |
| 144 | 144 | return; |
| 145 | 145 | } |
| 146 | - | |
| 146 | + | |
| 147 | 147 | //计算弹出位置 |
| 148 | 148 | var top = $(this).offset().top - 450 |
| 149 | 149 | ,left = $(this).offset().left - 230 / 2; |
| 150 | 150 | $.get('/pages/mapmonitor/real/bufferAreaConfig.html', function(rs){ |
| 151 | - | |
| 151 | + | |
| 152 | 152 | bConfLayer = layer.open({ |
| 153 | 153 | type: 1, |
| 154 | 154 | area: ['280px', '430px'], |
| ... | ... | @@ -167,11 +167,11 @@ var playBack = (function() { |
| 167 | 167 | }); |
| 168 | 168 | }); |
| 169 | 169 | }); |
| 170 | - | |
| 170 | + | |
| 171 | 171 | function hideMarkText(w){ |
| 172 | 172 | $presMark.hide(); |
| 173 | 173 | } |
| 174 | - | |
| 174 | + | |
| 175 | 175 | function showMarkTextMouse(w){ |
| 176 | 176 | var text = moment((sTime + w * secondPX) * 1000).format('HH:mm.ss'); |
| 177 | 177 | $presMarkMouse.text(text).css('left', w - $presMarkMouse.width() / 2).show(); |
| ... | ... | @@ -179,7 +179,7 @@ var playBack = (function() { |
| 179 | 179 | function hideMarkTextMouse(){ |
| 180 | 180 | $presMarkMouse.hide(); |
| 181 | 181 | } |
| 182 | - | |
| 182 | + | |
| 183 | 183 | //日志区域滚动条 |
| 184 | 184 | $('.pback-logs').slimscroll({ |
| 185 | 185 | height: '100%', |
| ... | ... | @@ -188,9 +188,9 @@ var playBack = (function() { |
| 188 | 188 | |
| 189 | 189 | var exports = { |
| 190 | 190 | init : function() { |
| 191 | - | |
| 191 | + | |
| 192 | 192 | lineGroup.clear(); |
| 193 | - | |
| 193 | + | |
| 194 | 194 | car2DeviceId = JSON.parse(window.localStorage.getItem('car2DeviceId')); |
| 195 | 195 | var htmlStr = template('play_back_panel_temp', {}) |
| 196 | 196 | ,carSel = '.mapRightWrap select[name="nbbm[]"]'; |
| ... | ... | @@ -205,10 +205,10 @@ var playBack = (function() { |
| 205 | 205 | //获取对应线路 |
| 206 | 206 | defaultLine = e.params.data.lineCode; |
| 207 | 207 | }); |
| 208 | - | |
| 208 | + | |
| 209 | 209 | //点击轨迹回放按钮 |
| 210 | 210 | $('#playBackBtn').on('click', playBackBtnClick); |
| 211 | - | |
| 211 | + | |
| 212 | 212 | //默认值,当前时间前2小时 |
| 213 | 213 | var m = moment() |
| 214 | 214 | ,rq='YYYY-MM-DD', sj='HH:mm'; |
| ... | ... | @@ -222,19 +222,19 @@ var playBack = (function() { |
| 222 | 222 | defaultLine = lineCode; |
| 223 | 223 | } |
| 224 | 224 | }; |
| 225 | - | |
| 225 | + | |
| 226 | 226 | function playBackBtnClick(){ |
| 227 | 227 | //表单校验 |
| 228 | 228 | if(!customFormValidate('#playBackForm')) |
| 229 | 229 | return; |
| 230 | - | |
| 230 | + | |
| 231 | 231 | var params = $('#playBackForm').serializeJSON(); |
| 232 | 232 | //查询历史gps数据 |
| 233 | 233 | var fs = 'YYYY-MM-DDHH:mm' |
| 234 | 234 | ,st = moment(params.sDate + params.sTime, fs).format('X') |
| 235 | 235 | ,et = moment(params.eDate + params.eTime, fs).format('X') |
| 236 | 236 | ,nbbm = params.nbbm; |
| 237 | - | |
| 237 | + | |
| 238 | 238 | isEnableFocus = params.enableFocus; |
| 239 | 239 | layer.msg('查询历史GPS...', {icon: 16, time: 0,shade:0.3}); |
| 240 | 240 | $.ajax({ |
| ... | ... | @@ -246,7 +246,7 @@ var playBack = (function() { |
| 246 | 246 | layer.alert('服务器没有返回数据,请检查你的输入参数!', {icon: 3}); |
| 247 | 247 | return; |
| 248 | 248 | } |
| 249 | - | |
| 249 | + | |
| 250 | 250 | gpsArray = rs; |
| 251 | 251 | size = gpsArray.length; |
| 252 | 252 | layer.closeAll(); |
| ... | ... | @@ -257,33 +257,33 @@ var playBack = (function() { |
| 257 | 257 | sTime = parseInt(st); |
| 258 | 258 | eTime = parseInt(et); |
| 259 | 259 | tRange = et - st; |
| 260 | - | |
| 260 | + | |
| 261 | 261 | //获取进度条宽度 |
| 262 | 262 | pWidth = $('.progress-body').width(); |
| 263 | 263 | secondPX = tRange / pWidth; |
| 264 | 264 | //清理地图 |
| 265 | 265 | iMap.call('clear'); |
| 266 | - | |
| 266 | + | |
| 267 | 267 | firstCar = params.nbbm[0]; |
| 268 | 268 | firstDeviceId = car2DeviceId[firstCar]; |
| 269 | - | |
| 269 | + | |
| 270 | 270 | if(defaultLine){ |
| 271 | 271 | layer.msg('加载线路图层数据...', {icon: 16, time: 0,shade:0.3}); |
| 272 | 272 | $.get('/realSchedule/findRouteByLine', {lineCode: defaultLine} |
| 273 | 273 | ,function(route){ |
| 274 | 274 | lineRoute = route; |
| 275 | 275 | iMap.call('drawLine', {route: lineRoute}); |
| 276 | - | |
| 276 | + | |
| 277 | 277 | cTime = sTime; |
| 278 | 278 | play(); |
| 279 | - | |
| 279 | + | |
| 280 | 280 | //自动定位到第一辆车的第一个点 |
| 281 | 281 | var nbbm = params.nbbm[0] |
| 282 | 282 | ,firstTime = searchFirst(gpsArray, nbbm); |
| 283 | 283 | if(firstTime){ |
| 284 | 284 | layer.msg('从该时区内 ' + nbbm + ' 的首个信号点,' + moment(firstTime).format('HH:mm') + '开始' |
| 285 | 285 | ,{offset: 'ct', shift : 5, skin: 'layer-bg-green'}); |
| 286 | - | |
| 286 | + | |
| 287 | 287 | goToByTime(firstTime / 1000); |
| 288 | 288 | } |
| 289 | 289 | else |
| ... | ... | @@ -296,7 +296,7 @@ var playBack = (function() { |
| 296 | 296 | } |
| 297 | 297 | }); |
| 298 | 298 | } |
| 299 | - | |
| 299 | + | |
| 300 | 300 | //搜索时间范围内第一个gps点的时间 |
| 301 | 301 | function searchFirst(list, nbbm){ |
| 302 | 302 | var time; |
| ... | ... | @@ -306,10 +306,10 @@ var playBack = (function() { |
| 306 | 306 | break; |
| 307 | 307 | } |
| 308 | 308 | } |
| 309 | - | |
| 309 | + | |
| 310 | 310 | return time; |
| 311 | 311 | } |
| 312 | - | |
| 312 | + | |
| 313 | 313 | function stop(){ |
| 314 | 314 | _stopFocusTimer = 1; |
| 315 | 315 | clearInterval(focusTimer); |
| ... | ... | @@ -318,13 +318,13 @@ var playBack = (function() { |
| 318 | 318 | $('.play-back-btns .playBtn').removeClass('fa-pause').addClass('fa-play').data('status', 0); |
| 319 | 319 | prgTimer = null; |
| 320 | 320 | } |
| 321 | - | |
| 321 | + | |
| 322 | 322 | function play(){ |
| 323 | 323 | $('#progress-mark-time').show(); |
| 324 | 324 | $('.play-back-btns .playBtn').removeClass('fa-play').addClass('fa-pause').data('status', 1); |
| 325 | 325 | //开始播放 |
| 326 | 326 | start(); |
| 327 | - | |
| 327 | + | |
| 328 | 328 | //启动焦点定位(单独用一个定时器做缓冲) |
| 329 | 329 | console.log('isEnableFocus', isEnableFocus); |
| 330 | 330 | if(isEnableFocus){ |
| ... | ... | @@ -332,46 +332,46 @@ var playBack = (function() { |
| 332 | 332 | startTrackFocus(); |
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | - | |
| 335 | + | |
| 336 | 336 | var _stopFocusTimer, focusTimer; |
| 337 | 337 | function startTrackFocus(){ |
| 338 | 338 | trackFocus(); |
| 339 | 339 | if(!_stopFocusTimer) |
| 340 | 340 | focusTimer = setTimeout(startTrackFocus, 1800); |
| 341 | 341 | } |
| 342 | - | |
| 342 | + | |
| 343 | 343 | function trackFocus(){ |
| 344 | 344 | //定位焦点 |
| 345 | 345 | if(firstDeviceId) |
| 346 | 346 | iMap.call('goToMarker', {deviceId: firstDeviceId}); |
| 347 | 347 | } |
| 348 | - | |
| 348 | + | |
| 349 | 349 | function start(){ |
| 350 | 350 | prgTimer = setTimeout(start, 1000 / speed); |
| 351 | 351 | run(); |
| 352 | 352 | } |
| 353 | - | |
| 353 | + | |
| 354 | 354 | var cw = 0; |
| 355 | 355 | function run(){ |
| 356 | 356 | cTime += step; |
| 357 | - | |
| 357 | + | |
| 358 | 358 | cw = (cTime - sTime) / secondPX; |
| 359 | 359 | //显示时间标记 |
| 360 | 360 | showMarkText(cw); |
| 361 | 361 | //移动GPS点 |
| 362 | 362 | moveGpsByTime(cTime); |
| 363 | - | |
| 363 | + | |
| 364 | 364 | if(cw >= pWidth){ |
| 365 | 365 | stop(); |
| 366 | 366 | $('#progress-mark-time').hide(); |
| 367 | 367 | cw = pWidth; |
| 368 | - | |
| 368 | + | |
| 369 | 369 | layer.msg('本次轨迹回放已结束' |
| 370 | 370 | ,{offset: 'ct', shift : 5 , skin: 'layer-bg-red'}); |
| 371 | 371 | } |
| 372 | 372 | $pmk.css('width', cw + 'px'); |
| 373 | 373 | } |
| 374 | - | |
| 374 | + | |
| 375 | 375 | //根据时间移动GPS |
| 376 | 376 | function moveGpsByTime(t){ |
| 377 | 377 | t = t * 1000; |
| ... | ... | @@ -382,28 +382,28 @@ var playBack = (function() { |
| 382 | 382 | rs[gps.nbbm] = gps; |
| 383 | 383 | else |
| 384 | 384 | break; |
| 385 | - | |
| 385 | + | |
| 386 | 386 | //到离站信息 |
| 387 | 387 | if(gps.inout_stop != -1) |
| 388 | 388 | addInOutText(gps); |
| 389 | 389 | } |
| 390 | - | |
| 390 | + | |
| 391 | 391 | //绘制到地图 |
| 392 | 392 | var marker, gpsList = []; |
| 393 | 393 | for(var nbbm in rs){ |
| 394 | 394 | gps = rs[nbbm]; |
| 395 | 395 | gpsList.push(gps); |
| 396 | 396 | } |
| 397 | - | |
| 397 | + | |
| 398 | 398 | iMap.call('drawRealGpsMarker', {gpsList: gpsList}); |
| 399 | 399 | } |
| 400 | - | |
| 400 | + | |
| 401 | 401 | function goToByTime(time){ |
| 402 | 402 | //停止播放 |
| 403 | 403 | clearInterval(prgTimer); |
| 404 | 404 | prgTimer = null; |
| 405 | 405 | cIndex = 0; |
| 406 | - | |
| 406 | + | |
| 407 | 407 | cTime = time; |
| 408 | 408 | //清空右侧日志信息 |
| 409 | 409 | $('.pback-logs').html(''); |
| ... | ... | @@ -411,16 +411,16 @@ var playBack = (function() { |
| 411 | 411 | removeAllGps(); |
| 412 | 412 | play(); |
| 413 | 413 | } |
| 414 | - | |
| 415 | - | |
| 414 | + | |
| 415 | + | |
| 416 | 416 | //removeMarker |
| 417 | 417 | function removeAllGps(){ |
| 418 | 418 | for(var nbbm in markerMap) |
| 419 | 419 | iMap.call('clear'); |
| 420 | - | |
| 420 | + | |
| 421 | 421 | markerMap = {}; |
| 422 | 422 | } |
| 423 | - | |
| 423 | + | |
| 424 | 424 | /** |
| 425 | 425 | * 自定义表单校验 |
| 426 | 426 | */ |
| ... | ... | @@ -428,7 +428,7 @@ var playBack = (function() { |
| 428 | 428 | var rs = true; |
| 429 | 429 | //所有可见的项 |
| 430 | 430 | var es = $('input,select', f); |
| 431 | - | |
| 431 | + | |
| 432 | 432 | for(var i = 0, e; e = es[i++];){ |
| 433 | 433 | if($(e).attr('required') && ( $(e).val() == null || $(e).val() == '')){ |
| 434 | 434 | if($(e).hasClass('select2-hidden-accessible')) |
| ... | ... | @@ -444,12 +444,12 @@ var playBack = (function() { |
| 444 | 444 | $(e).removeClass('custom-val-error'); |
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | - | |
| 447 | + | |
| 448 | 448 | if(!rs){ |
| 449 | - layer.alert('数据完整性校验失败,请检查输入项', {icon: 2, title: '操作失败', shift: 5}); | |
| 449 | + layer.alert('数据完整性校验失败,请检查输入项', {icon: 2, title: '操作失败', shift: 5}); | |
| 450 | 450 | } |
| 451 | 451 | return rs; |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | return exports; |
| 455 | -})(); | |
| 456 | 455 | \ No newline at end of file |
| 456 | +})(); | ... | ... |
src/main/resources/static/pages/mapmonitor/real/js/real.js
| 1 | 1 | !function() { |
| 2 | 2 | //css3动画结束事件 |
| 3 | 3 | var animationend = 'webkitAnimationEnd animationend'; |
| 4 | - | |
| 4 | + | |
| 5 | 5 | var playAnimation; |
| 6 | 6 | //地图右侧容器 |
| 7 | 7 | var mrw = $('.mapRightWrap'); |
| 8 | 8 | //加载动画 |
| 9 | - var spinnerLoad = '<div class="spinner">' | |
| 9 | + var spinnerLoad = '<div class="spinner">' | |
| 10 | 10 | + ' <div class="rect1"></div>' |
| 11 | - + ' <div class="rect2"></div>' | |
| 11 | + + ' <div class="rect2"></div>' | |
| 12 | 12 | + ' <div class="rect3"></div>' |
| 13 | - + ' <div class="rect4"></div>' | |
| 13 | + + ' <div class="rect4"></div>' | |
| 14 | 14 | + ' <div class="rect5"></div>' |
| 15 | 15 | + '</div>'; |
| 16 | - | |
| 16 | + | |
| 17 | 17 | // mapRightWrap 角度恢复 |
| 18 | 18 | function resetRotate(cb, midCallback) { |
| 19 | 19 | mrw.one('transitionend', function() { |
| ... | ... | @@ -21,22 +21,22 @@ |
| 21 | 21 | $(this).css('transition', 'none').addClass('rotate0'); |
| 22 | 22 | |
| 23 | 23 | midCallback && midCallback(); |
| 24 | - | |
| 24 | + | |
| 25 | 25 | setTimeout(function() { |
| 26 | 26 | mrw.css('transition', 'all .5s ease-in-out') |
| 27 | 27 | .removeClass('disable'); |
| 28 | 28 | playAnimation = false; |
| 29 | - | |
| 29 | + | |
| 30 | 30 | cb && cb(); |
| 31 | 31 | }, 500); |
| 32 | 32 | |
| 33 | 33 | }); |
| 34 | 34 | } |
| 35 | - | |
| 35 | + | |
| 36 | 36 | $('#openWindow').on('click', function(){ |
| 37 | 37 | window.open('/pages/mapmonitor/alone/wrap.html','alone_map' ); |
| 38 | 38 | }); |
| 39 | - | |
| 39 | + | |
| 40 | 40 | // tools点击 |
| 41 | 41 | $('.mapTools div.item').on('click', function() { |
| 42 | 42 | if ($(this).hasClass('active')) { |
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | $(this).addClass('active'); |
| 55 | 55 | //清理地图 |
| 56 | 56 | iMap.call('clear'); |
| 57 | - | |
| 57 | + | |
| 58 | 58 | toolsEvent.clearStyle(); |
| 59 | 59 | toolsEvent[method](); |
| 60 | 60 | }); |
| ... | ... | @@ -76,7 +76,7 @@ |
| 76 | 76 | playBack : function() { |
| 77 | 77 | mrw.html('').addClass('playBack'); |
| 78 | 78 | playBack.init(); |
| 79 | - | |
| 79 | + | |
| 80 | 80 | }, |
| 81 | 81 | clearStyle : function() { |
| 82 | 82 | mrw.removeClass( |
| ... | ... | @@ -98,5 +98,5 @@ |
| 98 | 98 | |
| 99 | 99 | mrw.html(spinnerLoad); |
| 100 | 100 | lineGroup.showDataLazy(); |
| 101 | - | |
| 102 | -}(); | |
| 103 | 101 | \ No newline at end of file |
| 102 | + | |
| 103 | +}(); | ... | ... |
src/main/resources/static/real_control_v2/css/ct_table.css
| ... | ... | @@ -6,9 +6,9 @@ |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | .ct_table { |
| 9 | - position: relative; | |
| 10 | - padding-top: 30px; | |
| 11 | - font-size: 13px; | |
| 9 | + position: relative; | |
| 10 | + padding-top: 30px; | |
| 11 | + font-size: 13px; | |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | .ct_table>.ct_table_head { |
| ... | ... | @@ -20,31 +20,30 @@ |
| 20 | 20 | line-height: 30px; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | -.ct_table>.ct_table_head dl{ | |
| 24 | - border-bottom: 0; | |
| 23 | +.ct_table>.ct_table_head dl { | |
| 24 | + border-bottom: 0; | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | -.ct_table>.ct_table_head dl dt{ | |
| 28 | - font-weight: normal; | |
| 27 | +.ct_table>.ct_table_head dl dt { | |
| 28 | + font-weight: normal; | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | -.ct_table>.ct_table_body{ | |
| 32 | - width: 100%; | |
| 31 | +.ct_table>.ct_table_body { | |
| 32 | + width: 100%; | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | .ct_table dl { |
| 36 | - display: block; | |
| 37 | - width: 100%; | |
| 38 | - margin: 0; | |
| 39 | - border-bottom: 1px solid #eee; | |
| 40 | - height: 30px; | |
| 41 | - cursor: default; | |
| 36 | + display: block; | |
| 37 | + width: 100%; | |
| 38 | + margin: 0; | |
| 39 | + /*border-bottom: 1px solid;*/ | |
| 40 | + height: 30px; | |
| 41 | + cursor: default; | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | -.ct_table>.ct_table_body dl:hover, | |
| 45 | -.ct_table>.ct_table_body dl.context-menu-active{ | |
| 46 | - box-shadow: 0 0 6px #656c71; | |
| 47 | - background: #f5fbff; | |
| 44 | +.ct_table>.ct_table_body dl:hover, .ct_table>.ct_table_body dl.context-menu-active { | |
| 45 | + box-shadow: 0 0 4px #656c71; | |
| 46 | + background: #f5fbff; | |
| 48 | 47 | } |
| 49 | 48 | |
| 50 | 49 | |
| ... | ... | @@ -53,35 +52,84 @@ |
| 53 | 52 | }*/ |
| 54 | 53 | |
| 55 | 54 | .ct_table dl dd, .ct_table dl dt { |
| 56 | - display: inline-block; | |
| 57 | - white-space: nowrap; | |
| 58 | - overflow: hidden; | |
| 59 | - text-overflow: ellipsis; | |
| 60 | - height: 100%; | |
| 61 | - line-height: 30px; | |
| 62 | - border-right: 1px solid; | |
| 63 | - border-right-color: #e6e6e6; | |
| 64 | - text-indent: 5px; | |
| 55 | + display: inline-block; | |
| 56 | + white-space: nowrap; | |
| 57 | + overflow: hidden; | |
| 58 | + text-overflow: ellipsis; | |
| 59 | + height: 100%; | |
| 60 | + line-height: 30px; | |
| 61 | + border-right: 1px solid; | |
| 62 | + text-indent: 5px; | |
| 65 | 63 | } |
| 66 | 64 | |
| 67 | -.ct_table_wrap{ | |
| 68 | - border: 1px solid #e6e6e6; | |
| 69 | - border-left: 0; | |
| 65 | +.ct_table_wrap { | |
| 66 | + border: 1px solid #e6e6e6; | |
| 67 | + border-left: 0; | |
| 70 | 68 | } |
| 71 | 69 | |
| 72 | -/*.ct_table dl dt{ | |
| 73 | - border-right-color: #fff; | |
| 74 | -}*/ | |
| 70 | +.ct_table>.ct_table_head { | |
| 71 | + border-bottom: 1px solid #dedede; | |
| 72 | +} | |
| 73 | + | |
| 74 | +.ct_table dl { | |
| 75 | + font-size: 0; | |
| 76 | + white-space: nowrap; | |
| 77 | +} | |
| 75 | 78 | |
| 76 | -dl.ct_row_active, | |
| 77 | -.ct_table>.ct_table_body dl.ct_row_active:hover { | |
| 79 | +.ct_table dl dd, .ct_table dl dt { | |
| 80 | + border-right-color: #dedede; | |
| 81 | + font-size: 13px; | |
| 82 | + border-bottom: 1px solid #dedede; | |
| 83 | +} | |
| 84 | + | |
| 85 | +dl.ct_row_active, .ct_table>.ct_table_body dl.ct_row_active:hover { | |
| 78 | 86 | /*background-image: -webkit-linear-gradient(top, #5e96d2, #ffffff, #ffffff, #5e96d2);*/ |
| 79 | 87 | } |
| 80 | 88 | |
| 89 | +dt[sort-field] { | |
| 90 | + cursor: pointer; | |
| 91 | +} | |
| 92 | + | |
| 93 | +dt[sort-field] i.uk-icon-sort-asc { | |
| 94 | + vertical-align: middle; | |
| 95 | + margin-top: 3px; | |
| 96 | +} | |
| 81 | 97 | |
| 82 | -/*.ct_table dl dd.ct_fixed, .ct_table dl dt.ct_fixed{ | |
| 83 | - position: absolute; | |
| 84 | - background: #fff; | |
| 85 | - height: 30px; | |
| 86 | - border-right: 1px solid red; | |
| 87 | -}*/ | |
| 98 | +dt[sort-field] i.uk-icon-sort-desc { | |
| 99 | + vertical-align: middle; | |
| 100 | + margin-top: -8px; | |
| 101 | +} | |
| 102 | + | |
| 103 | +.ct_table_wrap.ct_table_no_border{ | |
| 104 | + height: 350px; | |
| 105 | + border: 0; | |
| 106 | + margin-top: 15px; | |
| 107 | +} | |
| 108 | + | |
| 109 | +.ct_table_no_border .ct_table{ | |
| 110 | + padding-top: 35px; | |
| 111 | +} | |
| 112 | + | |
| 113 | +.ct_table_no_border .ct_table>.ct_table_head,.ct_table_no_border .ct_table dl { | |
| 114 | + height: 35px; | |
| 115 | + line-height: 35px; | |
| 116 | + background: white; | |
| 117 | +} | |
| 118 | +.ct_table dl{ | |
| 119 | + transition: all .1s ease; | |
| 120 | +} | |
| 121 | + | |
| 122 | +.ct_table_no_border .ct_table>.ct_table_head dl dt { | |
| 123 | + font-weight: 600; | |
| 124 | + font-size: 13px; | |
| 125 | +} | |
| 126 | + | |
| 127 | +.ct_table_no_border .ct_table dl dd,.ct_table_no_border .ct_table dl dt { | |
| 128 | + font-size: 14px; | |
| 129 | + border-right: 0; | |
| 130 | +} | |
| 131 | + | |
| 132 | +.ct_table .uk-icon-question-circle{ | |
| 133 | + color: #b3b2b2; | |
| 134 | + cursor: pointer; | |
| 135 | +} | ... | ... |
src/main/resources/static/real_control_v2/css/home.css
| ... | ... | @@ -36,18 +36,19 @@ |
| 36 | 36 | |
| 37 | 37 | .uk-grid.home-line-card { |
| 38 | 38 | background: #fafafa; |
| 39 | - border: 1px solid #e5e5e5; | |
| 39 | + border: 1px solid #e6e6e6; | |
| 40 | 40 | border-radius: 4px; |
| 41 | - margin: 0 2px 4px; | |
| 41 | + margin: 0 1px 4px 1px; | |
| 42 | 42 | min-height: 230px; |
| 43 | - height: calc(100% / 3 - 6px); | |
| 43 | + height: calc(100% / 3 - 12px); | |
| 44 | + padding: 3px; | |
| 44 | 45 | } |
| 45 | 46 | |
| 46 | 47 | .uk-grid.home-line-card .svg-chart-wrap { |
| 47 | 48 | background: #fff; |
| 48 | - border: 1px double #dadada; | |
| 49 | - border-radius: 4px; | |
| 50 | 49 | position: relative; |
| 50 | + border-left: 1px solid #e6e6e6; | |
| 51 | + border-right: 1px solid #e6e6e6; | |
| 51 | 52 | } |
| 52 | 53 | |
| 53 | 54 | .uk-grid.home-line-card .data-wrap { |
| ... | ... | @@ -57,7 +58,7 @@ |
| 57 | 58 | } |
| 58 | 59 | |
| 59 | 60 | .home-gps-table { |
| 60 | - width: 620px; | |
| 61 | + width: 560px; | |
| 61 | 62 | } |
| 62 | 63 | |
| 63 | 64 | .home-gps-table small { |
| ... | ... | @@ -65,12 +66,12 @@ |
| 65 | 66 | } |
| 66 | 67 | |
| 67 | 68 | .home-gps-table dl dt:nth-of-type(1), .home-gps-table dl dd:nth-of-type(1) { |
| 68 | - width: 13%; | |
| 69 | + width: 15%; | |
| 69 | 70 | font-size: 14px; |
| 70 | 71 | } |
| 71 | 72 | |
| 72 | 73 | .home-gps-table dl dt:nth-of-type(2), .home-gps-table dl dd:nth-of-type(2) { |
| 73 | - width: 7% | |
| 74 | + width: 8% | |
| 74 | 75 | } |
| 75 | 76 | |
| 76 | 77 | .home-gps-table dl dt:nth-of-type(3), .home-gps-table dl dd:nth-of-type(3) { |
| ... | ... | @@ -78,11 +79,11 @@ |
| 78 | 79 | } |
| 79 | 80 | |
| 80 | 81 | .home-gps-table dl dt:nth-of-type(4), .home-gps-table dl dd:nth-of-type(4) { |
| 81 | - width: 17% | |
| 82 | + width: 19% | |
| 82 | 83 | } |
| 83 | 84 | |
| 84 | 85 | .home-gps-table dl dt:nth-of-type(5), .home-gps-table dl dd:nth-of-type(5) { |
| 85 | - width: 17% | |
| 86 | + width: 18% | |
| 86 | 87 | } |
| 87 | 88 | |
| 88 | 89 | .home-gps-table dl dt:nth-of-type(6), .home-gps-table dl dd:nth-of-type(6) { |
| ... | ... | @@ -99,18 +100,18 @@ |
| 99 | 100 | } |
| 100 | 101 | |
| 101 | 102 | .data-wrap.up { |
| 102 | - border-left: 1px solid #dadada; | |
| 103 | + /*border-left: 1px solid #dadada;*/ | |
| 103 | 104 | } |
| 104 | 105 | |
| 105 | 106 | .data-wrap.down { |
| 106 | - border-right: 1px solid #dadada; | |
| 107 | + /*border-right: 1px solid #dadada;*/ | |
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | .data-wrap .data-title { |
| 110 | 111 | height: 25px; |
| 111 | 112 | line-height: 25px; |
| 112 | 113 | font-size: 13px; |
| 113 | - padding: 3px 0 3px; | |
| 114 | + padding: 0 0 3px; | |
| 114 | 115 | } |
| 115 | 116 | |
| 116 | 117 | .data-wrap .data-title span.data-title-text { |
| ... | ... | @@ -122,12 +123,12 @@ |
| 122 | 123 | |
| 123 | 124 | .data-wrap.up .data-title span.data-title-text { |
| 124 | 125 | background: #5e96d2; |
| 125 | - background-image: -webkit-linear-gradient(top, #5e96d2, #5788bb); | |
| 126 | + /*background-image: -webkit-linear-gradient(top, #5e96d2, #5788bb);*/ | |
| 126 | 127 | } |
| 127 | 128 | |
| 128 | 129 | .data-wrap.down .data-title span.data-title-text { |
| 129 | - background: #c92121; | |
| 130 | - background-image: -webkit-linear-gradient(top, #d66868, #bf6363); | |
| 130 | + background: #d66868; | |
| 131 | + /*background-image: -webkit-linear-gradient(top, #d66868, #bf6363);*/ | |
| 131 | 132 | } |
| 132 | 133 | |
| 133 | 134 | .data-wrap .data-body { |
| ... | ... | @@ -182,19 +183,54 @@ |
| 182 | 183 | padding-left: 10px; |
| 183 | 184 | } |
| 184 | 185 | |
| 185 | -#show-multi-send-modal ul.uk-list li span{ | |
| 186 | - font-size: 12px; | |
| 186 | +#show-multi-send-modal ul.uk-list li span { | |
| 187 | + font-size: 12px; | |
| 187 | 188 | } |
| 188 | -#show-multi-send-modal ul.uk-list li span.text-lg{ | |
| 189 | - font-size: 15px; | |
| 190 | - margin-right: 5px; | |
| 189 | + | |
| 190 | +#show-multi-send-modal ul.uk-list li span.text-lg { | |
| 191 | + font-size: 15px; | |
| 192 | + margin-right: 5px; | |
| 191 | 193 | } |
| 192 | 194 | |
| 193 | 195 | #show-multi-send-modal ul.uk-list-line>li:nth-child(n+2) { |
| 194 | 196 | border-top: 1px solid #f1f1f1; |
| 195 | 197 | } |
| 196 | 198 | |
| 197 | -/*#context-menu-layer{ | |
| 198 | - opacity: 0.1 !Important; | |
| 199 | - background-color: rgb(179, 179, 179) !Important; | |
| 199 | +.modal-loading { | |
| 200 | + position: relative; | |
| 201 | + height: 60px; | |
| 202 | +} | |
| 203 | + | |
| 204 | +.modal-loading .uk-modal-spinner { | |
| 205 | + position: absolute; | |
| 206 | + top: 10%; | |
| 207 | + left: 50%; | |
| 208 | + -webkit-transform: translate(-50%, -50%); | |
| 209 | + transform: translate(-50%, -10%); | |
| 210 | + font-size: 25px; | |
| 211 | + color: #ddd; | |
| 212 | +} | |
| 213 | + | |
| 214 | +.modal-loading .text { | |
| 215 | + position: absolute; | |
| 216 | + top: 20%; | |
| 217 | + left: 51%; | |
| 218 | + -webkit-transform: translate(-55%, -50%); | |
| 219 | + transform: translate(-49%, 20px); | |
| 220 | + font-size: 13px; | |
| 221 | + color: #717171; | |
| 222 | +} | |
| 223 | + | |
| 224 | +#c0a3_detail_panel .uk-table th { | |
| 225 | + text-align: right; | |
| 226 | + width: 50%; | |
| 227 | + padding-right: 20px; | |
| 228 | +} | |
| 229 | + | |
| 230 | +/*.data-wrap.up::-webkit-scrollbar-thumb{ | |
| 231 | + box-shadow: 0 0 0 5px rgba(94, 150, 210, 0.61) inset; | |
| 232 | +} | |
| 233 | + | |
| 234 | +.data-wrap.down::-webkit-scrollbar-thumb{ | |
| 235 | + box-shadow: 0 0 0 5px rgba(210, 103, 103, 0.44) inset; | |
| 200 | 236 | }*/ | ... | ... |
src/main/resources/static/real_control_v2/css/line_schedule.css
0 → 100644
| 1 | +.line_schedule { | |
| 2 | + height: 100%; | |
| 3 | + overflow: hidden; | |
| 4 | +} | |
| 5 | + | |
| 6 | +.line_schedule .uk-grid { | |
| 7 | + margin-left: 0; | |
| 8 | +} | |
| 9 | + | |
| 10 | +.line_schedule .uk-grid>* { | |
| 11 | + padding: 0; | |
| 12 | +} | |
| 13 | + | |
| 14 | +.line_schedule div.uk-width-1-6, .line_schedule div.uk-width-1-2 { | |
| 15 | + padding: 0 2px 2px 2px; | |
| 16 | +} | |
| 17 | + | |
| 18 | +.line_schedule .footer-chart { | |
| 19 | + height: 243px; | |
| 20 | + margin-top: 5px; | |
| 21 | +} | |
| 22 | + | |
| 23 | +.line_schedule .uk-grid.top-container { | |
| 24 | + height: calc(100% - 260px); | |
| 25 | + margin-top: 5px; | |
| 26 | + overflow: hidden; | |
| 27 | +} | |
| 28 | + | |
| 29 | +.line_schedule .card-panel { | |
| 30 | + padding: 0; | |
| 31 | + height: 100%; | |
| 32 | + border: 1px solid #ddd; | |
| 33 | + background: #fafafa; | |
| 34 | + border-radius: 4px; | |
| 35 | + moz-user-select: -moz-none; | |
| 36 | + -moz-user-select: none; | |
| 37 | + -o-user-select: none; | |
| 38 | + -khtml-user-select: none; | |
| 39 | + -webkit-user-select: none; | |
| 40 | + -ms-user-select: none; | |
| 41 | + user-select: none; | |
| 42 | +} | |
| 43 | + | |
| 44 | +.line_schedule .ct_table { | |
| 45 | + padding-top: 36px; | |
| 46 | +} | |
| 47 | + | |
| 48 | +.line_schedule .ct_table>.ct_table_head { | |
| 49 | + height: 36px; | |
| 50 | + line-height: 36px; | |
| 51 | +} | |
| 52 | + | |
| 53 | +.line_schedule .schedule-wrap { | |
| 54 | + height: calc(100% - 1px); | |
| 55 | + padding: 0; | |
| 56 | +} | |
| 57 | + | |
| 58 | +.line_schedule .schedule-wrap h3 { | |
| 59 | + margin: 7px 0 5px; | |
| 60 | + text-indent: 5px; | |
| 61 | +} | |
| 62 | + | |
| 63 | +.line_schedule .schedule-wrap.up h3 { | |
| 64 | + color: #2765A7; | |
| 65 | +} | |
| 66 | + | |
| 67 | +.line_schedule .schedule-wrap.down h3 { | |
| 68 | + color: #C92121; | |
| 69 | +} | |
| 70 | + | |
| 71 | +.line-schedule-table dl dt:nth-of-type(1), .line-schedule-table dl dd:nth-of-type(1) { | |
| 72 | + width: 50px; | |
| 73 | +} | |
| 74 | + | |
| 75 | +.line-schedule-table dl dd:nth-of-type(1) { | |
| 76 | + background: #eae8e8; | |
| 77 | + /*border-bottom: 1px solid #b3b3b3;*/ | |
| 78 | + border-right: 1px solid #b3b3b3; | |
| 79 | + text-align: center; | |
| 80 | + text-indent: -3px; | |
| 81 | +} | |
| 82 | + | |
| 83 | +.line-schedule-table dl dt:nth-of-type(2), .line-schedule-table dl dd:nth-of-type(2) { | |
| 84 | + width: 55px; | |
| 85 | + text-align: center; | |
| 86 | +} | |
| 87 | + | |
| 88 | +.line-schedule-table dl dt:nth-of-type(3), .line-schedule-table dl dd:nth-of-type(3) { | |
| 89 | + width: calc(2% + 86px); | |
| 90 | +} | |
| 91 | + | |
| 92 | +.line-schedule-table dl dt:nth-of-type(4), .line-schedule-table dl dd:nth-of-type(4) { | |
| 93 | + width: 10%; | |
| 94 | + /*color: #676767;*/ | |
| 95 | +} | |
| 96 | + | |
| 97 | +.line-schedule-table dl dt:nth-of-type(5), .line-schedule-table dl dd:nth-of-type(5) { | |
| 98 | + width: 11%; | |
| 99 | +} | |
| 100 | + | |
| 101 | +.line-schedule-table dl dt:nth-of-type(6), .line-schedule-table dl dd:nth-of-type(6) { | |
| 102 | + width: calc(15% + 8px); | |
| 103 | + /*color: #676767;*/ | |
| 104 | +} | |
| 105 | + | |
| 106 | +.line-schedule-table dl dt:nth-of-type(7), .line-schedule-table dl dd:nth-of-type(7) { | |
| 107 | + width: 10%; | |
| 108 | +} | |
| 109 | + | |
| 110 | +.line-schedule-table dl dt:nth-of-type(8), .line-schedule-table dl dd:nth-of-type(8) { | |
| 111 | + width: calc(48% - 228px); | |
| 112 | +} | |
| 113 | + | |
| 114 | +.line-schedule-table dl dt:nth-of-type(9), .line-schedule-table dl dd:nth-of-type(9) { | |
| 115 | + width: 50px; | |
| 116 | + border-right: 0; | |
| 117 | +} | |
| 118 | + | |
| 119 | +.schedule-body { | |
| 120 | + height: calc(100% - 37px); | |
| 121 | + background: #fff; | |
| 122 | +} | |
| 123 | + | |
| 124 | +.schedule-body .ct_table_wrap { | |
| 125 | + height: 100%; | |
| 126 | + border-bottom: 0; | |
| 127 | + overflow-x: hidden; | |
| 128 | +} | |
| 129 | + | |
| 130 | +.schedule-body .ct_table_wrap .ct_table .ct_table_body dl:last-child { | |
| 131 | + border-bottom: 0; | |
| 132 | +} | |
| 133 | + | |
| 134 | +.schedule-body .ct_table>.ct_table_body dl:hover dd:nth-of-type(1) { | |
| 135 | + background: #fafafa; | |
| 136 | + background: linear-gradient(to right, #fafafa, #f5fbff); | |
| 137 | +} | |
| 138 | + | |
| 139 | +.schedule-body .ct_table dl dd, .schedule-body .ct_table dl dt { | |
| 140 | + font-size: 14px; | |
| 141 | + line-height: 37px; | |
| 142 | +} | |
| 143 | + | |
| 144 | +.ct_table .uk-badge { | |
| 145 | + padding: 0 1px 0 1px; | |
| 146 | + text-indent: 0; | |
| 147 | + font-family: 华文细黑; | |
| 148 | +} | |
| 149 | + | |
| 150 | +.ct_table .uk-badge.uk-badge-notification{ | |
| 151 | + text-indent: -1px; | |
| 152 | +} | |
| 153 | + | |
| 154 | +.schedule-body .ct_table dl._active, .schedule-body .ct_table>.ct_table_body dl._active:hover { | |
| 155 | + background: #dedede; | |
| 156 | +} | |
| 157 | + | |
| 158 | +.schedule-body .ct_table dl._active dd { | |
| 159 | + background: #cef9e3!important; | |
| 160 | + color: #484848; | |
| 161 | +} | |
| 162 | + | |
| 163 | +.schedule-body .ct_table dl._active dd a { | |
| 164 | + color: #0162b5; | |
| 165 | +} | |
| 166 | + | |
| 167 | +.schedule-body .ct_table dl._active dd.seq_no { | |
| 168 | + background: #94e6bd !important; | |
| 169 | + color: #156138; | |
| 170 | + font-weight: 600; | |
| 171 | +} | |
| 172 | + | |
| 173 | +.schedule-body .ct_table dl.drag-active, .schedule-body .ct_table>.ct_table_body dl.drag-active:hover { | |
| 174 | + background: #dedede; | |
| 175 | +} | |
| 176 | + | |
| 177 | +.schedule-body .ct_table dl.drag-active dd { | |
| 178 | + background: #cef9e3!important; | |
| 179 | + color: #484848; | |
| 180 | + border-top: 1px solid #e0d7d7; | |
| 181 | +} | |
| 182 | + | |
| 183 | +.schedule-body .ct_table dl.drag-active dd a { | |
| 184 | + color: #0162b5; | |
| 185 | +} | |
| 186 | + | |
| 187 | +.schedule-body .ct_table dl.drag-active dd.seq_no { | |
| 188 | + background: #94e6bd !important; | |
| 189 | + color: #156138; | |
| 190 | + font-weight: 600; | |
| 191 | +} | |
| 192 | + | |
| 193 | +.context-menu-list.schedule-ct-menu { | |
| 194 | + /*font-size: 13px;*/ | |
| 195 | + font-family: 微软雅黑; | |
| 196 | +} | |
| 197 | + | |
| 198 | +.context-menu-list.schedule-ct-menu .context-menu-item { | |
| 199 | + padding: .25em 2em; | |
| 200 | +} | |
| 201 | + | |
| 202 | +.context-menu-list.schedule-ct-menu-input { | |
| 203 | + width: 88px !important; | |
| 204 | + min-width: 80px !important; | |
| 205 | + font-family: 微软雅黑; | |
| 206 | +} | |
| 207 | + | |
| 208 | +.context-menu-list.schedule-ct-menu-input .context-menu-item { | |
| 209 | + padding: .25em 2em; | |
| 210 | +} | |
| 211 | + | |
| 212 | +.db-input { | |
| 213 | + width: calc(100% - 8px); | |
| 214 | + height: calc(100% - 9px); | |
| 215 | + margin-left: -4px; | |
| 216 | + vertical-align: top; | |
| 217 | + font-size: 13px; | |
| 218 | + color: red; | |
| 219 | + font-family: 微软雅黑; | |
| 220 | + margin-top: 1px; | |
| 221 | +} | |
| 222 | + | |
| 223 | +.schedule-body .ct_table dl { | |
| 224 | + height: 36px; | |
| 225 | +} | |
| 226 | + | |
| 227 | +span.fcsj-diff { | |
| 228 | + color: gray; | |
| 229 | + margin-left: 3px; | |
| 230 | +} | |
| 231 | + | |
| 232 | + | |
| 233 | +/** 图例 */ | |
| 234 | + | |
| 235 | +dd.tl-yzx { | |
| 236 | + background: #c1ddf0; | |
| 237 | + border-bottom: 0 !important; | |
| 238 | + border-top: 1px solid #f5f5f5; | |
| 239 | +} | |
| 240 | + | |
| 241 | +dd.tl-qrlb { | |
| 242 | + background: #7B6B24; | |
| 243 | + color: #EAEBEC; | |
| 244 | + font-size: 13px; | |
| 245 | +} | |
| 246 | + | |
| 247 | +dd.tl-qrlb::before { | |
| 248 | + content: '烂班'; | |
| 249 | +} | |
| 250 | + | |
| 251 | +dd.tl-zzzx { | |
| 252 | + background: #96F396; | |
| 253 | +} | |
| 254 | + | |
| 255 | +.ct_table>.ct_table_body dl:hover dd.tl-yzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-yzx, .ct_table>.ct_table_body dl:hover dd.tl-zzzx, .ct_table>.ct_table_body dl.context-menu-active dd.tl-zzzx { | |
| 256 | + background: none; | |
| 257 | +} | |
| 258 | + | |
| 259 | +.ct_table>.ct_table_body dl:hover dd.tl-qrlb, .ct_table>.ct_table_body dl.context-menu-active dd.tl-qrlb { | |
| 260 | + font-weight: 600; | |
| 261 | +} | |
| 262 | + | |
| 263 | +.schedule-body .ct_table dl.drag-active dd.tl-qrlb { | |
| 264 | + color: red; | |
| 265 | + font-weight: 600; | |
| 266 | +} | |
| 267 | + | |
| 268 | +.line_schedule .footer-chart .svg-wrap { | |
| 269 | + width: 100%; | |
| 270 | + height: 100%; | |
| 271 | + position: relative; | |
| 272 | +} | |
| 273 | + | |
| 274 | +.ct-form-modal form .uk-grid+.uk-grid { | |
| 275 | + margin-top: 10px; | |
| 276 | +} | |
| 277 | + | |
| 278 | +.ct-form-modal form small { | |
| 279 | + color: #928e8e; | |
| 280 | + margin-left: 3px; | |
| 281 | +} | |
| 282 | + | |
| 283 | +.ct-form-modal form input, .ct-form-modal form select { | |
| 284 | + width: 100%; | |
| 285 | + height: 34px!important; | |
| 286 | +} | |
| 287 | + | |
| 288 | +.ct-form-modal form small.font-danger { | |
| 289 | + color: red; | |
| 290 | +} | |
| 291 | + | |
| 292 | +.ct-form-modal form.uk-form-horizontal .uk-form-label { | |
| 293 | + width: 80px; | |
| 294 | +} | |
| 295 | + | |
| 296 | +.ct-form-modal form.uk-form-horizontal .uk-form-controls { | |
| 297 | + margin-left: 85px; | |
| 298 | +} | |
| 299 | + | |
| 300 | +.sch-time-checkbox-list { | |
| 301 | + height: 240px; | |
| 302 | + overflow: auto; | |
| 303 | + border: 1px solid #c4c4c4; | |
| 304 | + border-radius: 4px; | |
| 305 | + padding: 9px 0; | |
| 306 | +} | |
| 307 | + | |
| 308 | +.sch-time-checkbox-list label { | |
| 309 | + display: block; | |
| 310 | + font-size: 16px; | |
| 311 | + border-bottom: 1px dashed #e6e3e3; | |
| 312 | + height: 30px; | |
| 313 | + line-height: 30px; | |
| 314 | + padding-left: 12px; | |
| 315 | +} | |
| 316 | + | |
| 317 | +/*.sch-time-checkbox-list label input[type=checkbox] { | |
| 318 | + width: 20px; | |
| 319 | + height: 18px !important; | |
| 320 | + vertical-align: middle; | |
| 321 | + margin-top: -3px; | |
| 322 | +}*/ | |
| 323 | + | |
| 324 | +.ct-form-modal form.uk-form-horizontal .ct-stacked .uk-form-label { | |
| 325 | + width: 100%; | |
| 326 | +} | |
| 327 | + | |
| 328 | +.ct-form-modal form.uk-form-horizontal .ct-stacked .uk-form-controls { | |
| 329 | + margin: 32px 0 0 0; | |
| 330 | +} | |
| 331 | + | |
| 332 | +.ct-form-modal form.uk-form-horizontal .ct-stacked .uk-form-controls textarea { | |
| 333 | + width: 100%; | |
| 334 | +} | |
| 335 | + | |
| 336 | + | |
| 337 | +/** 批量待发调整 */ | |
| 338 | + | |
| 339 | +.ct_table.multi-dftz-table { | |
| 340 | + width: 100%; | |
| 341 | + border-left: 1px solid #e6e6e6; | |
| 342 | + padding-top: 35px; | |
| 343 | + vertical-align: top; | |
| 344 | + -webkit-user-select: none; | |
| 345 | + -moz-user-select: none; | |
| 346 | + -ms-user-select: none; | |
| 347 | + user-select: none; | |
| 348 | +} | |
| 349 | + | |
| 350 | +.ct_table.multi-dftz-table>.ct_table_head, .ct_table.multi-dftz-table dl { | |
| 351 | + height: 35px; | |
| 352 | + line-height: 35px; | |
| 353 | +} | |
| 354 | + | |
| 355 | +.ct_table.multi-dftz-table dl dd, .ct_table.multi-dftz-table dl dt { | |
| 356 | + line-height: 37px; | |
| 357 | +} | |
| 358 | + | |
| 359 | +.ct_table.multi-dftz-table dl dd, .ct_table.multi-dftz-table dl dt { | |
| 360 | + font-size: 14px; | |
| 361 | +} | |
| 362 | + | |
| 363 | +.multi-dftz-table dl dt:nth-of-type(1), .multi-dftz-table dl dd:nth-of-type(1) { | |
| 364 | + width: 10%; | |
| 365 | + text-align: center; | |
| 366 | +} | |
| 367 | + | |
| 368 | +.multi-dftz-table dl dt:nth-of-type(2), .multi-dftz-table dl dd:nth-of-type(2) { | |
| 369 | + width: 14%; | |
| 370 | +} | |
| 371 | + | |
| 372 | +.multi-dftz-table dl dt:nth-of-type(3), .multi-dftz-table dl dd:nth-of-type(3) { | |
| 373 | + width: 14%; | |
| 374 | +} | |
| 375 | + | |
| 376 | +.multi-dftz-table dl dt:nth-of-type(4), .multi-dftz-table dl dd:nth-of-type(4) { | |
| 377 | + width: 15%; | |
| 378 | +} | |
| 379 | + | |
| 380 | +.multi-dftz-table dl dt:nth-of-type(5), .multi-dftz-table dl dd:nth-of-type(5) { | |
| 381 | + width: 15%; | |
| 382 | +} | |
| 383 | + | |
| 384 | +.multi-dftz-table dl dt:nth-of-type(6), .multi-dftz-table dl dd:nth-of-type(6) { | |
| 385 | + width: 31%; | |
| 386 | + border-right: 0; | |
| 387 | + position: relative; | |
| 388 | +} | |
| 389 | + | |
| 390 | +.ct_table.multi-dftz-table input { | |
| 391 | + width: 70%; | |
| 392 | + height: 27px; | |
| 393 | + font-family: 微软雅黑; | |
| 394 | + color: #545353; | |
| 395 | + border: 1px solid #b1b1b1; | |
| 396 | + border-radius: 3px; | |
| 397 | + font-size: 14px; | |
| 398 | +} | |
| 399 | + | |
| 400 | +.ct_table.multi-dftz-table input.modify { | |
| 401 | + color: #447eb1; | |
| 402 | + border: 1px solid #689cd0; | |
| 403 | +} | |
| 404 | + | |
| 405 | +span.modify-num { | |
| 406 | + position: absolute; | |
| 407 | + bottom: 2px; | |
| 408 | + right: 3px; | |
| 409 | + color: blue; | |
| 410 | + font-family: 华文细黑; | |
| 411 | + height: 25px; | |
| 412 | + width: 35px; | |
| 413 | + line-height: 25px; | |
| 414 | + text-align: center; | |
| 415 | + text-indent: 0; | |
| 416 | +} | |
| 417 | + | |
| 418 | +span.modify-num.negative { | |
| 419 | + color: red; | |
| 420 | +} | |
| 421 | + | |
| 422 | +span.drag-panel { | |
| 423 | + padding: 6px 7px; | |
| 424 | + display: inline-block; | |
| 425 | + margin-bottom: 5px; | |
| 426 | + background: #fafafa; | |
| 427 | + color: #666; | |
| 428 | + border: 1px solid #e5e5e5; | |
| 429 | + border-radius: 4px; | |
| 430 | + width: 120px; | |
| 431 | + cursor: move; | |
| 432 | + position: absolute; | |
| 433 | + z-index: 2; | |
| 434 | + transition: all .2s ease; | |
| 435 | +} | |
| 436 | + | |
| 437 | +span.drag-panel.no-anim { | |
| 438 | + transition: none; | |
| 439 | +} | |
| 440 | + | |
| 441 | +span.drag-panel.disable { | |
| 442 | + opacity: 0.2; | |
| 443 | + cursor: no-drop; | |
| 444 | +} | |
| 445 | + | |
| 446 | +span.drag-panel.draging { | |
| 447 | + opacity: 0; | |
| 448 | +} | |
| 449 | + | |
| 450 | +div.drop-rail:before { | |
| 451 | + font-size: 12px; | |
| 452 | + color: #eeeaea; | |
| 453 | + width: 100%; | |
| 454 | + display: block; | |
| 455 | + text-align: center; | |
| 456 | + margin-top: 7px; | |
| 457 | + content: ' ' | |
| 458 | +} | |
| 459 | + | |
| 460 | +div.drop-rail[data-type="people"]:before { | |
| 461 | + content: "驾驶员"; | |
| 462 | +} | |
| 463 | + | |
| 464 | +div.drop-rail[data-type="car"]:before { | |
| 465 | + content: "车辆"; | |
| 466 | +} | |
| 467 | + | |
| 468 | +#schedule-multi-tzrc-modal { | |
| 469 | + -webkit-user-select: none; | |
| 470 | + -moz-user-select: none; | |
| 471 | + -ms-user-select: none; | |
| 472 | + user-select: none; | |
| 473 | +} | |
| 474 | + | |
| 475 | +#schedule-multi-tzrc-modal .tm-grid-truncate>.uk-width-medium-1-4 { | |
| 476 | + padding: 7px 0 10px 10px; | |
| 477 | +} | |
| 478 | + | |
| 479 | +.drag-panel-wrap { | |
| 480 | + width: 163px; | |
| 481 | + height: 94px; | |
| 482 | +} | |
| 483 | + | |
| 484 | +.drag-panel-wrap.over { | |
| 485 | + border: 1px dashed #b3b2b2; | |
| 486 | +} | |
| 487 | + | |
| 488 | +dl.relevance-active dd:nth-child(n+2) { | |
| 489 | + background: #76a6c7 !important; | |
| 490 | + color: white; | |
| 491 | +} | |
| 492 | + | |
| 493 | +dl.relevance-active dd.tl-qrlb { | |
| 494 | + background: linear-gradient(to right, #7B6B24, #4992c3) !important; | |
| 495 | + color: #f8e9cd; | |
| 496 | +} | |
| 497 | + | |
| 498 | +dl.relevance-active dd.tl-zzzx { | |
| 499 | + background: linear-gradient(to right, #96F396, #4992c3) !important; | |
| 500 | + color: #565252; | |
| 501 | +} | |
| 502 | + | |
| 503 | +dl.relevance-active dd.tl-zzzx span.fcsj-diff { | |
| 504 | + color: #5e5a5a | |
| 505 | +} | |
| 506 | + | |
| 507 | +dl.relevance-active dd span.fcsj-diff { | |
| 508 | + color: #d7d6d6; | |
| 509 | +} | |
| 510 | + | |
| 511 | +dl.relevance-active a { | |
| 512 | + color: #dff0ff; | |
| 513 | +} | |
| 514 | + | |
| 515 | +.right-text-lp { | |
| 516 | + position: absolute; | |
| 517 | + right: 7px; | |
| 518 | + padding: 0 5px; | |
| 519 | + border-radius: 5px; | |
| 520 | + font-size: 12px; | |
| 521 | + color: #a0a0a0; | |
| 522 | +} | |
| 523 | + | |
| 524 | +div.drop-rail { | |
| 525 | + position: absolute; | |
| 526 | + width: 140px; | |
| 527 | + height: 36px; | |
| 528 | + margin: -2px 0 0 -3px; | |
| 529 | + background: transparent; | |
| 530 | + z-index: 1; | |
| 531 | +} | |
| 532 | + | |
| 533 | +div.drop-rail.over { | |
| 534 | + border: 1px dashed #dddddd; | |
| 535 | +} | |
| 536 | + | |
| 537 | +.uk-table.comf-result tbody tr td:nth-of-type(1) { | |
| 538 | + font-family: 微软雅黑; | |
| 539 | +} | |
| 540 | + | |
| 541 | +.uk-table.comf-result tbody tr td:nth-of-type(3) { | |
| 542 | + color: #888686; | |
| 543 | +} | |
| 544 | + | |
| 545 | +.uk-table.comf-result tbody tr td:nth-of-type(4) { | |
| 546 | + color: #366fad; | |
| 547 | +} | |
| 548 | + | |
| 549 | +label.destroy-sch{ | |
| 550 | + color: #928e8e; | |
| 551 | +} | |
| 552 | +label.destroy-sch small{ | |
| 553 | + color: #e25e5e; | |
| 554 | +} | |
| 555 | + | |
| 556 | +.main-schedule-table dl dt:nth-of-type(1), .main-schedule-table dl dd:nth-of-type(1) { | |
| 557 | + width: 6%; | |
| 558 | + text-align: center; | |
| 559 | +} | |
| 560 | +.main-schedule-table dl dt:nth-of-type(2), .main-schedule-table dl dd:nth-of-type(2) { | |
| 561 | + width: 14%; | |
| 562 | +} | |
| 563 | +.main-schedule-table dl dt:nth-of-type(3), .main-schedule-table dl dd:nth-of-type(3) { | |
| 564 | + width: 10%; | |
| 565 | +} | |
| 566 | +.main-schedule-table dl dt:nth-of-type(4), .main-schedule-table dl dd:nth-of-type(4) { | |
| 567 | + width: 19%; | |
| 568 | +} | |
| 569 | +.main-schedule-table dl dt:nth-of-type(5), .main-schedule-table dl dd:nth-of-type(5) { | |
| 570 | + width: 19%; | |
| 571 | +} | |
| 572 | +.main-schedule-table dl dt:nth-of-type(6), .main-schedule-table dl dd:nth-of-type(6) { | |
| 573 | + width: 10%; | |
| 574 | +} | |
| 575 | +.main-schedule-table dl dt:nth-of-type(7), .main-schedule-table dl dd:nth-of-type(7) { | |
| 576 | + width: 12%; | |
| 577 | +} | |
| 578 | +.main-schedule-table dl dt:nth-of-type(8), .main-schedule-table dl dd:nth-of-type(8) { | |
| 579 | + width: 10%; | |
| 580 | +} | |
| 581 | + | |
| 582 | +.main-schedule-table.ct_table dl.active, | |
| 583 | +.main-schedule-table.ct_table>.ct_table_body dl.active:hover, | |
| 584 | +.main-schedule-table.ct_table>.ct_table_body dl.context-menu-active{ | |
| 585 | + background: #9393bf; | |
| 586 | + box-shadow: 0 0 4px #656c71; | |
| 587 | + color: white; | |
| 588 | +} | |
| 589 | + | |
| 590 | +.main-schedule-table span.sjfc-time{ | |
| 591 | + color:#07d | |
| 592 | +} | |
| 593 | + | |
| 594 | +.main-schedule-table dl.active span.sjfc-time{ | |
| 595 | + background: white; | |
| 596 | + border-radius: 5px; | |
| 597 | + padding: 2px 1px; | |
| 598 | + vertical-align: middle; | |
| 599 | +} | |
| 600 | + | |
| 601 | +.sub-task-table dl dt:nth-of-type(1), .sub-task-table dl dd:nth-of-type(1) { | |
| 602 | + width: 6%; | |
| 603 | + text-align: center; | |
| 604 | +} | |
| 605 | +.sub-task-table dl dt:nth-of-type(2), .sub-task-table dl dd:nth-of-type(2) { | |
| 606 | + width: 15%; | |
| 607 | +} | |
| 608 | +.sub-task-table dl dt:nth-of-type(3), .sub-task-table dl dd:nth-of-type(3) { | |
| 609 | + width: 16%; | |
| 610 | +} | |
| 611 | +.sub-task-table dl dt:nth-of-type(4), .sub-task-table dl dd:nth-of-type(4) { | |
| 612 | + width: 16%; | |
| 613 | +} | |
| 614 | +.sub-task-table dl dt:nth-of-type(5), .sub-task-table dl dd:nth-of-type(5) { | |
| 615 | + width: 11%; | |
| 616 | +} | |
| 617 | +.sub-task-table dl dt:nth-of-type(6), .sub-task-table dl dd:nth-of-type(6) { | |
| 618 | + width: 11%; | |
| 619 | +} | |
| 620 | +.sub-task-table dl dt:nth-of-type(7), .sub-task-table dl dd:nth-of-type(7) { | |
| 621 | + width: 14%; | |
| 622 | +} | |
| 623 | +.sub-task-table dl dt:nth-of-type(8), .sub-task-table dl dd:nth-of-type(8) { | |
| 624 | + width: 9%; | |
| 625 | +} | |
| 626 | + | |
| 627 | +.sub-task-table>.ct_table_body>dl:last-child dd{ | |
| 628 | + border-bottom: 0; | |
| 629 | +} | |
| 630 | + | |
| 631 | +i.add-temp-sch-icon{ | |
| 632 | + float: right; | |
| 633 | + font-size: 18px; | |
| 634 | + cursor: pointer; | |
| 635 | + color: #4592b8; | |
| 636 | + margin: 10px 15px 0; | |
| 637 | +} | |
| 638 | +i.add-temp-sch-icon:hover{ | |
| 639 | + color: #2d7091; | |
| 640 | +} | |
| 641 | + | |
| 642 | + | |
| 643 | +input.i-cbox[type=checkbox]{ | |
| 644 | + width: 20px; | |
| 645 | + height: 18px !important; | |
| 646 | + vertical-align: middle; | |
| 647 | + margin-top: -3px; | |
| 648 | +} | |
| 649 | + | |
| 650 | +.sys-note-80, | |
| 651 | +.sys-note-42{ | |
| 652 | + width: calc(100% - 10px) !important; | |
| 653 | + margin: 5px !important; | |
| 654 | +} | |
| 655 | +.sys-note-80 .uk-panel-box, | |
| 656 | +.sys-note-42 .uk-panel-box{ | |
| 657 | + padding: 10px; | |
| 658 | +} | |
| 659 | +.sys-note-80 .uk-panel-title{ | |
| 660 | + margin-bottom: 3px; | |
| 661 | + font-size: 15px; | |
| 662 | +} | |
| 663 | + | |
| 664 | +.sys-note-42 .title{ | |
| 665 | + font-family: 微软雅黑; | |
| 666 | + margin-bottom: 3px; | |
| 667 | +} | |
| 668 | +.sys-note-80 .uk-button-group, | |
| 669 | +.sys-note-42 .uk-button-group{ | |
| 670 | + display: block; | |
| 671 | + margin-top: 5px; | |
| 672 | +} | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | +.sch-tzrc-table dl dt:nth-of-type(1), .sch-tzrc-table dl dd:nth-of-type(1) { | |
| 677 | + width: 30%; | |
| 678 | +} | |
| 679 | +.sch-tzrc-table dl dt:nth-of-type(2), .sch-tzrc-table dl dd:nth-of-type(2) { | |
| 680 | + width: 25%; | |
| 681 | +} | |
| 682 | +.sch-tzrc-table dl dt:nth-of-type(3), .sch-tzrc-table dl dd:nth-of-type(3) { | |
| 683 | + width: 25%; | |
| 684 | +} | |
| 685 | +.sch-tzrc-table dl dt:nth-of-type(4), .sch-tzrc-table dl dd:nth-of-type(4) { | |
| 686 | + width: 20%; | |
| 687 | +} | |
| 688 | + | |
| 689 | +.ct-form-modal .uk-autocomplete{ | |
| 690 | + width: 100%; | |
| 691 | +} | |
| 692 | + | |
| 693 | +.sch-tzrc-table.ct_table dl.active, | |
| 694 | +.sch-tzrc-table.ct_table>.ct_table_body dl.active:hover, | |
| 695 | +.sch-tzrc-table.ct_table>.ct_table_body dl.context-menu-active{ | |
| 696 | + background: #e6e6e6; | |
| 697 | +} | ... | ... |
src/main/resources/static/real_control_v2/css/main.css
| ... | ... | @@ -4,8 +4,8 @@ |
| 4 | 4 | display: none; |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -audio, canvas, img, svg, video{ | |
| 8 | - max-width: none; | |
| 7 | +audio, canvas, img, svg, video { | |
| 8 | + max-width: none; | |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | html, body { |
| ... | ... | @@ -166,12 +166,12 @@ svg.line-chart g.gps-wrap>rect { |
| 166 | 166 | cursor: pointer; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | -svg.line-chart g.gps-wrap>rect[updown="0"]{ | |
| 170 | - stroke: #5e96d2; | |
| 169 | +svg.line-chart g.gps-wrap>rect[updown="0"] { | |
| 170 | + stroke: #5e96d2; | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | -svg.line-chart g.gps-wrap>rect[updown="1"]{ | |
| 174 | - stroke: #c92121; | |
| 173 | +svg.line-chart g.gps-wrap>rect[updown="1"] { | |
| 174 | + stroke: #c92121; | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | svg.line-chart g.gps-wrap>rect.hover { |
| ... | ... | @@ -184,12 +184,12 @@ svg.line-chart g.gps-wrap>text { |
| 184 | 184 | pointer-events: none; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | -svg.line-chart g.gps-wrap>text[updown="0"]{ | |
| 188 | - fill: #5e96d2; | |
| 187 | +svg.line-chart g.gps-wrap>text[updown="0"] { | |
| 188 | + fill: #5e96d2; | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | -svg.line-chart g.gps-wrap>text[updown="1"]{ | |
| 192 | - fill: #c92121; | |
| 191 | +svg.line-chart g.gps-wrap>text[updown="1"] { | |
| 192 | + fill: #c92121; | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | svg.line-chart .merge_hide { |
| ... | ... | @@ -209,35 +209,48 @@ svg.line-chart g.merge-item text { |
| 209 | 209 | pointer-events: none; |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | +.qtip-multi-gps { | |
| 213 | + max-width: 716px !important; | |
| 214 | +} | |
| 212 | 215 | |
| 213 | -/*.tooltip{ | |
| 214 | - position: absolute; | |
| 215 | - z-index: 99999; | |
| 216 | - /* border-radius: 5px !important; | |
| 217 | - border: 1px solid rgba(94, 150, 210, 1); | |
| 218 | - background: rgba(255, 255, 255, 0.95); | |
| 219 | - box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12); | |
| 220 | - width: 185px; | |
| 221 | -}*/ | |
| 216 | +.qtip-bootstrap.qtip-multi-gps .qtip-content { | |
| 217 | + padding: 0; | |
| 218 | +} | |
| 222 | 219 | |
| 223 | 220 | .tooltip { |
| 224 | 221 | position: relative; |
| 225 | - padding-bottom: 130px; | |
| 226 | - width: 208px; | |
| 222 | + padding-bottom: 160px; | |
| 223 | + width: 220px; | |
| 227 | 224 | } |
| 228 | 225 | |
| 229 | -.tooltip hr { | |
| 230 | - border-top: 1px solid #6b6b6b; | |
| 231 | - width: calc(100% + 20px); | |
| 232 | - margin: 13px 0 13px -10px; | |
| 226 | +.multi-tooltip-wrap{ | |
| 227 | + width: 100%; | |
| 228 | + max-height: 350px; | |
| 229 | + overflow: auto; | |
| 230 | +} | |
| 231 | + | |
| 232 | +.tip_map_wrap.multi{ | |
| 233 | + width: 100%; | |
| 234 | + height: 130px; | |
| 233 | 235 | } |
| 234 | 236 | |
| 237 | +.tooltip.multi-tooltip { | |
| 238 | + width: 160px; | |
| 239 | + display: inline-block; | |
| 240 | + padding: 10px 0 10px 15px; | |
| 241 | + border-right: 1px solid #eeeeee; | |
| 242 | + border-bottom: 1px solid #eeeeee; | |
| 243 | +} | |
| 235 | 244 | |
| 236 | -/*.tooltip.fixed{ | |
| 237 | - transition: all .5s ease; | |
| 238 | - border: 1px solid #fff; | |
| 239 | - background: #fff; | |
| 240 | -}*/ | |
| 245 | +.tooltip hr { | |
| 246 | + border-top: 1px solid #eeeeee; | |
| 247 | + width: calc(100% + 30px); | |
| 248 | + margin: 7px 0 11px -15px; | |
| 249 | +} | |
| 250 | + | |
| 251 | +.tooltip.multi-tooltip hr { | |
| 252 | + width: calc(100% + 16px); | |
| 253 | +} | |
| 241 | 254 | |
| 242 | 255 | .tooltip .tooltip-container { |
| 243 | 256 | padding: 1px; |
| ... | ... | @@ -246,84 +259,43 @@ svg.line-chart g.merge-item text { |
| 246 | 259 | .tooltip .tooltip-container div, .tooltip .tooltip-container div a { |
| 247 | 260 | margin: 7px 1px; |
| 248 | 261 | font-size: 13px; |
| 249 | - color: rgb(236, 236, 236); | |
| 262 | + color: rgb(76, 76, 76); | |
| 250 | 263 | } |
| 251 | 264 | |
| 252 | 265 | .tooltip .tooltip-container div.title { |
| 253 | 266 | margin: 8px 1px 12px; |
| 254 | 267 | } |
| 255 | 268 | |
| 256 | - | |
| 257 | -/*.tooltip .tooltip-container div a{ | |
| 258 | - color: #fff; | |
| 259 | -}*/ | |
| 260 | - | |
| 261 | 269 | .tooltip .tooltip-container .title a { |
| 262 | 270 | font-size: 18px; |
| 263 | 271 | font-family: 微软雅黑; |
| 264 | - color: #fff; | |
| 265 | 272 | } |
| 266 | 273 | |
| 267 | - | |
| 268 | -/* | |
| 269 | -.tooltip .tooltip-container .subtitle, | |
| 270 | -.tooltip .tooltip-container .subtitle a{ | |
| 271 | - color: #999; | |
| 272 | - font-size: 13px; | |
| 273 | -}*/ | |
| 274 | - | |
| 275 | 274 | .tooltip span.field { |
| 276 | - color: #c0c0c0; | |
| 275 | + color: #7d7d7b; | |
| 277 | 276 | margin-right: 5px; |
| 278 | 277 | } |
| 279 | 278 | |
| 280 | 279 | .tooltip .tip_map_wrap { |
| 281 | 280 | position: absolute; |
| 282 | - bottom: -12px; | |
| 283 | - left: -10px; | |
| 284 | - width: calc(100% + 18px); | |
| 281 | + bottom: -16px; | |
| 282 | + left: -15px; | |
| 283 | + width: calc(100% + 28px); | |
| 285 | 284 | background: #fff; |
| 286 | - height: 130px; | |
| 285 | + height: 165px; | |
| 287 | 286 | border-radius: 0 0 5px 5px; |
| 287 | + border-top: 1px solid #e6e4e4; | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - | |
| 291 | -/*.tooltip.tooltip-modal{ | |
| 292 | -width: 700px; | |
| 293 | -height: 400px; | |
| 294 | - box-shadow: 0 12px 15px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19); | |
| 295 | -} | |
| 296 | - | |
| 297 | -.tooltip #tip_map_wrap{ | |
| 298 | - width: 100%; | |
| 299 | - height: 100%; | |
| 300 | -}*/ | |
| 301 | - | |
| 302 | - | |
| 303 | -/*svg g.gps-wrap>g.down>g.gps>rect{ | |
| 304 | - stroke:#e43a45; | |
| 305 | -} | |
| 306 | - | |
| 307 | -svg g.down>g.gps>text{ | |
| 308 | - fill:#e43a45; | |
| 309 | -}*/ | |
| 310 | - | |
| 311 | - | |
| 312 | -/*svg g.gps-wrap>g.up>g.gps>text{ | |
| 313 | - transform: translate(3px, 17px); | |
| 290 | +canvas.crosshair-layer { | |
| 291 | + position: absolute; | |
| 292 | + width: 100%; | |
| 293 | + height: 100%; | |
| 294 | + background: rgba(255, 255, 255, 0.33); | |
| 295 | + left: 0; | |
| 314 | 296 | } |
| 315 | 297 | |
| 316 | -svg g.gps-wrap>g.down>g.gps>text{ | |
| 317 | - transform: translate(3px, -17px); | |
| 318 | -}*/ | |
| 319 | - | |
| 320 | - | |
| 321 | -/*.uk-modal .uk-form-row.readonly-checkbox{ | |
| 322 | - margin: 8px 0 -10px; | |
| 323 | - font-size: 12px; | |
| 324 | - color: grey; | |
| 298 | +li.map-panel{ | |
| 299 | + height: 100%; | |
| 300 | + position: relative; | |
| 325 | 301 | } |
| 326 | - | |
| 327 | -.uk-modal .uk-form-row.readonly-checkbox input{ | |
| 328 | - vertical-align: middle; | |
| 329 | -}*/ | ... | ... |
src/main/resources/static/real_control_v2/css/north.css
src/main/resources/static/real_control_v2/fragments/home/c0_a3.html
0 → 100644
| 1 | +<div class="uk-modal" id="home-c0a3-modal"> | |
| 2 | + <div class="uk-modal-dialog"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>B-91071 设备参数</h2></div> | |
| 6 | + | |
| 7 | + <div class="modal-loading"> | |
| 8 | + <div class="uk-modal-spinner"></div> | |
| 9 | + <div class="text">正在下发指令...</div> | |
| 10 | + </div> | |
| 11 | + | |
| 12 | + | |
| 13 | + <div id="c0a3_detail_panel" style="display: none;"> | |
| 14 | + <table class="uk-table uk-table-striped uk-table-hover"> | |
| 15 | + <tr> | |
| 16 | + <th>设备编号:</th> | |
| 17 | + <td>559L0018</td> | |
| 18 | + </tr> | |
| 19 | + <tr> | |
| 20 | + <th>网关IP地址:</th> | |
| 21 | + <td>222.68.12.48</td> | |
| 22 | + </tr> | |
| 23 | + <tr> | |
| 24 | + <th>网关端口:</th> | |
| 25 | + <td>30020</td> | |
| 26 | + </tr> | |
| 27 | + <tr> | |
| 28 | + <th>定时定距上报模式:</th> | |
| 29 | + <td>0</td> | |
| 30 | + </tr> | |
| 31 | + <tr> | |
| 32 | + <th>定时上报时间间隔:</th> | |
| 33 | + <td>0</td> | |
| 34 | + </tr> | |
| 35 | + <tr> | |
| 36 | + <th>定距上报距离间隔:</th> | |
| 37 | + <td>0</td> | |
| 38 | + </tr> | |
| 39 | + <tr> | |
| 40 | + <th>非线路状态超速阀门:</th> | |
| 41 | + <td>0</td> | |
| 42 | + </tr> | |
| 43 | + <tr> | |
| 44 | + <th>预警阀门:</th> | |
| 45 | + <td>0</td> | |
| 46 | + </tr> | |
| 47 | + <tr> | |
| 48 | + <th>pos机IP地址:</th> | |
| 49 | + <td>192.168.2.52</td> | |
| 50 | + </tr> | |
| 51 | + <tr> | |
| 52 | + <th>pos机端口:</th> | |
| 53 | + <td>8090</td> | |
| 54 | + </tr> | |
| 55 | + <tr> | |
| 56 | + <th>延迟机关时间:</th> | |
| 57 | + <td>0</td> | |
| 58 | + </tr> | |
| 59 | + <tr> | |
| 60 | + <th>中门视频切换到码表界面速度阀门:</th> | |
| 61 | + <td>0</td> | |
| 62 | + </tr> | |
| 63 | + <tr> | |
| 64 | + <th>码表界面切换到中门视频速度阀门:</th> | |
| 65 | + <td>0</td> | |
| 66 | + </tr> | |
| 67 | + <tr> | |
| 68 | + <th>对比度:</th> | |
| 69 | + <td>0</td> | |
| 70 | + </tr> | |
| 71 | + <tr> | |
| 72 | + <th>亮度:</th> | |
| 73 | + <td>0</td> | |
| 74 | + </tr> | |
| 75 | + <tr> | |
| 76 | + <th>饱和度:</th> | |
| 77 | + <td>0</td> | |
| 78 | + </tr> | |
| 79 | + </table> | |
| 80 | + </div> | |
| 81 | + </div> | |
| 82 | + <script> | |
| 83 | + (function() { | |
| 84 | + var modal = '#home-c0a3-modal'; | |
| 85 | + $(modal).on('init', function(e, data) { | |
| 86 | + $.post('/directive/c0a4', {nbbm: 'B-99999'}); | |
| 87 | + //console.log('init...'); | |
| 88 | + setTimeout(function() { | |
| 89 | + $('.modal-loading .text', modal).text('等待设备响应数据...'); | |
| 90 | + }, 1500); | |
| 91 | + | |
| 92 | + setTimeout(function() { | |
| 93 | + //$('.modal-loading .text', modal).text('等待设备响应数据...'); | |
| 94 | + $('.modal-loading', modal).remove(); | |
| 95 | + | |
| 96 | + $('#c0a3_detail_panel').show(); | |
| 97 | + }, 4500); | |
| 98 | + }); | |
| 99 | + })(); | |
| 100 | + </script> | |
| 101 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/home/tooltip.html
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <a href="javascript:;" data-for="station" class="tip_modal">{{nbbm}}</a> |
| 7 | 7 | </div> |
| 8 | 8 | <div> |
| 9 | - <span class="field">站点:</span><a href="javascript:;" >{{stationName}}</a> | |
| 9 | + <span class="field">站点:</span>{{stationName}} | |
| 10 | 10 | </div> |
| 11 | 11 | <!-- <div> |
| 12 | 12 | {{lineName}} -{{if upDown==0}}上行{{else}}下行{{/if}} |
| ... | ... | @@ -15,10 +15,7 @@ |
| 15 | 15 | <span class="field">设备:</span>{{deviceId}} |
| 16 | 16 | </div> |
| 17 | 17 | <div> |
| 18 | - <span class="field">经度:</span>{{lon}} | |
| 19 | - </div> | |
| 20 | - <div> | |
| 21 | - <span class="field">纬度:</span>{{lat}} | |
| 18 | + <span class="field">坐标:</span>{{lon}} {{lat}} | |
| 22 | 19 | </div> |
| 23 | 20 | <div> |
| 24 | 21 | <span class="field">速度:</span>{{speed}}</div> |
| ... | ... | @@ -27,15 +24,36 @@ |
| 27 | 24 | 预计 {{expectStopTime}} 分钟到达终点</div> |
| 28 | 25 | <!-- <hr> --> |
| 29 | 26 | <!-- <div class="subtitle">更新时间: 10:34.26</div> --> |
| 30 | - <div class="tip_map_wrap"> | |
| 27 | + <div class="tip_map_wrap"></div> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + </script> | |
| 31 | 31 | |
| 32 | + <script id="tooltip_multi_gps_temp" type="text/html"> | |
| 33 | + <div class="multi-tooltip-wrap"> | |
| 34 | + {{each list as gps i}} | |
| 35 | + <div class="tooltip multi-tooltip" > | |
| 36 | + <div class="tooltip-container"> | |
| 37 | + <div class="title"> | |
| 38 | + <a href="javascript:;" data-for="station" class="tip_modal">{{gps.nbbm}}</a> | |
| 32 | 39 | </div> |
| 33 | - <!-- <div class="subtitle" style="margin-top: 8px;"> | |
| 34 | - <a href="javascript:;" data-for="map" class="tip_modal" data-lon={{lon}} data-lat={{lat}} data-nbbm={{nbbm}}> | |
| 35 | - <i class="fa fa-map-marker"></i> 地图查看 | |
| 36 | - </a> | |
| 37 | - </div> --> | |
| 40 | + <div> | |
| 41 | + <span class="field">站点:</span>{{gps.stationName}} | |
| 42 | + </div> | |
| 43 | + <div> | |
| 44 | + <span class="field">设备:</span>{{gps.deviceId}} | |
| 45 | + </div> | |
| 46 | + <div> | |
| 47 | + <span class="field">进站时间:</span>? | |
| 48 | + </div> | |
| 49 | + <div> | |
| 50 | + <span class="field">计划发出:</span>? | |
| 51 | + </div> | |
| 52 | + | |
| 38 | 53 | </div> |
| 39 | - </div> | |
| 54 | + </div> | |
| 55 | + {{/each}} | |
| 56 | + </div> | |
| 57 | + <div class="tip_map_wrap multi"></div> | |
| 40 | 58 | </script> |
| 41 | 59 | </div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/add_temp_sch.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="schedule-addsch-modal"> | |
| 2 | + <div class="uk-modal-dialog"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>新增临加班次</h2></div> | |
| 6 | + <form class="uk-form uk-form-horizontal"> | |
| 7 | + </form> | |
| 8 | + </div> | |
| 9 | + | |
| 10 | + <script id="schedule-addsch-form-temp" type="text/html"> | |
| 11 | + <div class="uk-grid"> | |
| 12 | + <div class="uk-width-1-2"> | |
| 13 | + <div class="uk-form-row"> | |
| 14 | + <label class="uk-form-label">班次类型</label> | |
| 15 | + <div class="uk-form-controls"> | |
| 16 | + <select class="form-control nt-dictionary" name="bcType" data-code="{{bcType}}" data-group=ScheduleType></select> | |
| 17 | + </div> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + <div class="uk-width-1-2"> | |
| 21 | + <div class="uk-form-row"> | |
| 22 | + <label class="uk-form-label">上下行</label> | |
| 23 | + <div class="uk-form-controls"> | |
| 24 | + <select name="xlDir"> | |
| 25 | + <option value="0">上行</option> | |
| 26 | + <option value="1">下行</option> | |
| 27 | + </select> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + <div class="uk-grid"> | |
| 33 | + <div class="uk-width-1-2"> | |
| 34 | + <div class="uk-form-row"> | |
| 35 | + <label class="uk-form-label">起点站</label> | |
| 36 | + <div class="uk-form-controls"> | |
| 37 | + <select name="qdzCode" required> | |
| 38 | + </select> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + <div class="uk-width-1-2"> | |
| 43 | + <div class="uk-form-row"> | |
| 44 | + <label class="uk-form-label">终点站</label> | |
| 45 | + <div class="uk-form-controls"> | |
| 46 | + <select name="zdzCode" required> | |
| 47 | + </select> | |
| 48 | + </div> | |
| 49 | + </div> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + <div class="uk-grid"> | |
| 53 | + <div class="uk-width-1-2"> | |
| 54 | + <div class="uk-form-row"> | |
| 55 | + <label class="uk-form-label">开始时间</label> | |
| 56 | + <div class="uk-form-controls"> | |
| 57 | + <input type="time" value="{{zdsj}}" name="fcsj" required> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + <div class="uk-width-1-2"> | |
| 62 | + <div class="uk-form-row"> | |
| 63 | + <label class="uk-form-label">结束时间</label> | |
| 64 | + <div class="uk-form-controls"> | |
| 65 | + <input type="time" name="zdsj" required> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | + </div> | |
| 70 | + <div class="uk-grid"> | |
| 71 | + <div class="uk-width-1-2"> | |
| 72 | + <div class="uk-form-row"> | |
| 73 | + <label class="uk-form-label">车辆</label> | |
| 74 | + <div class="uk-form-controls"> | |
| 75 | + <div class="uk-autocomplete uk-form car-autocom"> | |
| 76 | + <input type="text" value="{{clZbh}}" name="clZbh" required> | |
| 77 | + </div> | |
| 78 | + </div> | |
| 79 | + </div> | |
| 80 | + </div> | |
| 81 | + <div class="uk-width-1-2"> | |
| 82 | + <div class="uk-form-row"> | |
| 83 | + <label class="uk-form-label">里程</label> | |
| 84 | + <div class="uk-form-controls"> | |
| 85 | + <input type="text" name="jhlc" value="{{jhlc}}" max=222 data-fv-lessthan-inclusive="false" required> | |
| 86 | + </div> | |
| 87 | + </div> | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + <div class="uk-grid"> | |
| 91 | + <div class="uk-width-1-2"> | |
| 92 | + <div class="uk-form-row"> | |
| 93 | + <label class="uk-form-label">驾驶员 <i class="uk-icon-question-circle" data-uk-tooltip title="如果有驾驶员未提示,请至后台“基础信息 -人员信息”里纠正该员工的“工种”类别 "></i></label> | |
| 94 | + <div class="uk-form-controls"> | |
| 95 | + <div class="uk-autocomplete uk-form jsy-autocom"> | |
| 96 | + <input type="text" value="{{jGh}}/{{jName}}" name="jsy" required> | |
| 97 | + </div> | |
| 98 | + </div> | |
| 99 | + </div> | |
| 100 | + </div> | |
| 101 | + <div class="uk-width-1-2"> | |
| 102 | + <div class="uk-form-row"> | |
| 103 | + <label class="uk-form-label">售票员</label> | |
| 104 | + <div class="uk-form-controls"> | |
| 105 | + <div class="uk-autocomplete uk-form spy-autocom"> | |
| 106 | + <input type="text" name="spy" value="{{sGh}}/{{sName}}"> | |
| 107 | + </div> | |
| 108 | + </div> | |
| 109 | + </div> | |
| 110 | + </div> | |
| 111 | + </div> | |
| 112 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 113 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 114 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 115 | + </div> | |
| 116 | + </script> | |
| 117 | + | |
| 118 | + <script> | |
| 119 | + (function() { | |
| 120 | + var modal = '#schedule-addsch-modal', | |
| 121 | + sch, stationRoutes, parks; | |
| 122 | + $(modal).on('init', function(e, data) { | |
| 123 | + sch = data.sch; | |
| 124 | + var formHtml = template('schedule-addsch-form-temp', sch); | |
| 125 | + $('form', modal).html(formHtml); | |
| 126 | + //字典转换 | |
| 127 | + dictionaryUtils.transformDom($('.nt-dictionary', modal)); | |
| 128 | + | |
| 129 | + //----------- Autocomplete -------------- | |
| 130 | + $.get('/basic/cars', function(rs) { | |
| 131 | + //车辆 | |
| 132 | + gb_common.carAutocomplete($('.car-autocom', modal), rs); | |
| 133 | + }); | |
| 134 | + $.get('/basic/personnel', function(rs) { | |
| 135 | + //驾驶员 | |
| 136 | + gb_common.personAutocomplete($('.jsy-autocom', modal), rs.jsy); | |
| 137 | + //售票员 | |
| 138 | + gb_common.personAutocomplete($('.spy-autocom', modal), rs.spy); | |
| 139 | + }); | |
| 140 | + | |
| 141 | + //站点路由 | |
| 142 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function(a, b){ | |
| 143 | + return a.stationRouteCode-b.stationRouteCode; | |
| 144 | + }), 'directions'); | |
| 145 | + //停车场 | |
| 146 | + $.get('/basic/parks', function(rs){ | |
| 147 | + parks=rs; | |
| 148 | + }); | |
| 149 | + | |
| 150 | + //submit | |
| 151 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | |
| 152 | + f.on('success.form.fv', function(e) { | |
| 153 | + e.preventDefault(); | |
| 154 | + var data = $(this).serializeJSON(); | |
| 155 | + data.xlBm=sch.xlBm; | |
| 156 | + data.xlName=sch.xlName; | |
| 157 | + data.lpName=sch.lpName; | |
| 158 | + //拆分驾驶员工号和姓名 | |
| 159 | + data.jGh = data.jsy.split('/')[0]; | |
| 160 | + data.jName = data.jsy.split('/')[1]; | |
| 161 | + delete data.jsy; | |
| 162 | + //拆分售票员工号和姓名 | |
| 163 | + if(data.sGh != null){ | |
| 164 | + data.sGh = data.spy.split('/')[0]; | |
| 165 | + data.sName = data.spy.split('/')[1]; | |
| 166 | + delete data.spy; | |
| 167 | + } | |
| 168 | + | |
| 169 | + gb_common.$post('/realSchedule', data, function(rs){ | |
| 170 | + //插入 | |
| 171 | + gb_schedule_table.insertSchedule(rs.t, rs.ts); | |
| 172 | + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: rs.t}); | |
| 173 | + UIkit.modal(modal).hide(); | |
| 174 | + notify_succ('新增临加班次成功'); | |
| 175 | + }); | |
| 176 | + }); | |
| 177 | + | |
| 178 | + //班次类型 和 上下行切换 | |
| 179 | + $('[name=bcType],[name=xlDir]', f).on('change', function(){ | |
| 180 | + var bcType_e=$('[name=bcType]', f) | |
| 181 | + , xlDir_e=$('[name=xlDir]', f); | |
| 182 | + | |
| 183 | + var routes=stationRoutes[xlDir_e.val()] | |
| 184 | + ,lastCode=routes[routes.length-1].stationCode | |
| 185 | + ,opts='',park_opts=''; | |
| 186 | + //station options | |
| 187 | + $.each(routes, function(){ | |
| 188 | + opts+='<option value="'+this.stationCode+'">'+this.stationName+'</option>' | |
| 189 | + }); | |
| 190 | + //park options | |
| 191 | + for(var code in parks) | |
| 192 | + park_opts+='<option value="'+code+'">'+parks[code]+'</option>'; | |
| 193 | + | |
| 194 | + var qdz=$('[name=qdzCode]', f),zdz=$('[name=zdzCode]', f); | |
| 195 | + switch (bcType_e.val()) { | |
| 196 | + case 'out': | |
| 197 | + qdz.html(park_opts); | |
| 198 | + zdz.html(opts); | |
| 199 | + break; | |
| 200 | + case 'in': | |
| 201 | + qdz.html(opts); | |
| 202 | + zdz.html(park_opts); | |
| 203 | + break; | |
| 204 | + default: | |
| 205 | + qdz.html(opts); | |
| 206 | + zdz.html(opts).val(lastCode); | |
| 207 | + } | |
| 208 | + }).trigger('change'); | |
| 209 | + | |
| 210 | + }); | |
| 211 | + })(); | |
| 212 | + </script> | |
| 213 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="schedule-dftz-modal"> | |
| 2 | + <div class="uk-modal-dialog"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>待发调整</h2></div> | |
| 6 | + <form class="uk-form uk-form-horizontal"> | |
| 7 | + </form> | |
| 8 | + </div> | |
| 9 | + | |
| 10 | + <script id="schedule-dftz-form-temp" type="text/html"> | |
| 11 | + <input type="hidden" name="id" value="{{id}}"/> | |
| 12 | + <div class="uk-grid"> | |
| 13 | + <div class="uk-width-1-2"> | |
| 14 | + <div class="uk-form-row"> | |
| 15 | + <label class="uk-form-label" >班次类型</label> | |
| 16 | + <div class="uk-form-controls"> | |
| 17 | + <select class="form-control nt-dictionary" data-code="{{bcType}}" data-group=ScheduleType></select> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + | |
| 23 | + <div class="uk-grid"> | |
| 24 | + <div class="uk-width-1-2"> | |
| 25 | + <div class="uk-form-row"> | |
| 26 | + <label class="uk-form-label" >从<small>(起点站)</small></label> | |
| 27 | + <div class="uk-form-controls"> | |
| 28 | + <input type="text" value="{{qdzName}}" disabled> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + <div class="uk-width-1-2"> | |
| 33 | + <div class="uk-form-row"> | |
| 34 | + <label class="uk-form-label" >到<small>(终点站)</small></label> | |
| 35 | + <div class="uk-form-controls"> | |
| 36 | + <input type="text" value="{{zdzName}}" disabled> | |
| 37 | + </div> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + <div class="uk-grid"> | |
| 42 | + <div class="uk-width-1-1"> | |
| 43 | + <div class="uk-form-row ct-stacked"> | |
| 44 | + <label class="uk-form-label" for="form-s-t">备注<small class="font-danger">(不超过20个字符)</small></label> | |
| 45 | + <div class="uk-form-controls"> | |
| 46 | + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="20" ></textarea> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + </div> | |
| 50 | + </div> | |
| 51 | + | |
| 52 | + <div class="uk-grid"> | |
| 53 | + <div class="uk-width-1-2"> | |
| 54 | + <div class="uk-form-row"> | |
| 55 | + <label class="uk-form-label" >车辆编码: </label> | |
| 56 | + <div class="uk-form-controls"> | |
| 57 | + <input type="text" value="{{clZbh}}" disabled> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + <div class="uk-width-1-2"> | |
| 62 | + <div class="uk-form-row"> | |
| 63 | + <label class="uk-form-label" >路牌:</label> | |
| 64 | + <div class="uk-form-controls"> | |
| 65 | + <input type="text" value="{{lpName}}" disabled> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | + </div> | |
| 70 | + | |
| 71 | + <div class="uk-grid"> | |
| 72 | + <div class="uk-width-1-2"> | |
| 73 | + <div class="uk-form-row"> | |
| 74 | + <label class="uk-form-label" >计发时刻: </label> | |
| 75 | + <div class="uk-form-controls"> | |
| 76 | + <input type="time" value="{{fcsj}}" disabled> | |
| 77 | + </div> | |
| 78 | + </div> | |
| 79 | + </div> | |
| 80 | + <div class="uk-width-1-2"> | |
| 81 | + <div class="uk-form-row"> | |
| 82 | + <label class="uk-form-label" >预发时刻</label> | |
| 83 | + <div class="uk-form-controls"> | |
| 84 | + <input type="time" name="dfsj" value="{{dfsj}}" required autofocus> | |
| 85 | + </div> | |
| 86 | + </div> | |
| 87 | + </div> | |
| 88 | + </div> | |
| 89 | + | |
| 90 | + <div class="uk-grid"> | |
| 91 | + <div class="uk-width-1-2"> | |
| 92 | + <div class="uk-form-row"> | |
| 93 | + <label class="uk-form-label" >驾驶员 </label> | |
| 94 | + <div class="uk-form-controls"> | |
| 95 | + <input type="text" value="{{jGh}}/{{jName}}" disabled> | |
| 96 | + </div> | |
| 97 | + </div> | |
| 98 | + </div> | |
| 99 | + <div class="uk-width-1-2"> | |
| 100 | + <div class="uk-form-row"> | |
| 101 | + <label class="uk-form-label" >售票员</label> | |
| 102 | + <div class="uk-form-controls"> | |
| 103 | + <input type="text" value="{{sGh}}/{{sName}}" disabled> | |
| 104 | + </div> | |
| 105 | + </div> | |
| 106 | + </div> | |
| 107 | + </div> | |
| 108 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 109 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 110 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 111 | + </div> | |
| 112 | + </script> | |
| 113 | + | |
| 114 | + <script> | |
| 115 | + (function() { | |
| 116 | + var modal = '#schedule-dftz-modal' | |
| 117 | + ,sch; | |
| 118 | + $(modal).on('init', function(e, data) { | |
| 119 | + sch=data.sch; | |
| 120 | + var formHtml = template('schedule-dftz-form-temp', sch); | |
| 121 | + $('form', modal).html(formHtml); | |
| 122 | + //字典转换 | |
| 123 | + dictionaryUtils.transformDom($('.nt-dictionary', modal)); | |
| 124 | + | |
| 125 | + //submit | |
| 126 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | |
| 127 | + f.on('success.form.fv', function(e) { | |
| 128 | + e.preventDefault(); | |
| 129 | + var data = $(this).serializeJSON(); | |
| 130 | + if(data.dfsj==sch.dfsj && data.remarks==''){ | |
| 131 | + return; | |
| 132 | + } | |
| 133 | + gb_common.$post('/realSchedule/outgoAdjust', data, function(rs){ | |
| 134 | + //更新班次信息 | |
| 135 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 136 | + notify_succ('操作成功!'); | |
| 137 | + UIkit.modal(modal).hide(); | |
| 138 | + }); | |
| 139 | + }); | |
| 140 | + | |
| 141 | + //班次类型 | |
| 142 | + if(sch.bcType=='out'||sch.bcType=='in') | |
| 143 | + $('select[name=bcType]', f).attr('disabled','disabled'); | |
| 144 | + else { | |
| 145 | + //正常班次只能改为直放 和 放大站 | |
| 146 | + $('select[name=bcType] option', f).each(function(){ | |
| 147 | + var whiteList=['venting', 'major', sch.bcType]; | |
| 148 | + if(whiteList.indexOf($(this).val()) == -1) | |
| 149 | + $(this).remove(); | |
| 150 | + }); | |
| 151 | + } | |
| 152 | + }); | |
| 153 | + })(); | |
| 154 | + </script> | |
| 155 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="schedule-fcxxwt-modal"> | |
| 2 | + <div class="uk-modal-dialog"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>发车信息微调</h2></div> | |
| 6 | + <form class="uk-form uk-form-horizontal"> | |
| 7 | + </form> | |
| 8 | + </div> | |
| 9 | + | |
| 10 | + <script id="schedule-fcxxwt-form-temp" type="text/html"> | |
| 11 | + <input type="hidden" name="id" value="{{sch.id}}"/> | |
| 12 | + | |
| 13 | + <div class="uk-grid"> | |
| 14 | + <div class="uk-width-1-2"> | |
| 15 | + <div class="uk-form-row"> | |
| 16 | + <label class="uk-form-label" >发车站点</label> | |
| 17 | + <div class="uk-form-controls"> | |
| 18 | + <input type="text" value="{{sch.qdzName}}" disabled> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + <div class="uk-width-1-2"> | |
| 23 | + <div class="uk-form-row"> | |
| 24 | + <label class="uk-form-label" >结束站点</label> | |
| 25 | + <div class="uk-form-controls"> | |
| 26 | + <input type="text" value="{{sch.zdzName}}" disabled> | |
| 27 | + </div> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + <div class="uk-grid"> | |
| 32 | + <div class="uk-width-1-2"> | |
| 33 | + <div class="uk-form-row"> | |
| 34 | + <label class="uk-form-label" >车辆编码</label> | |
| 35 | + <div class="uk-form-controls"> | |
| 36 | + <input type="text" value="{{sch.clZbh}}" disabled> | |
| 37 | + </div> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + <div class="uk-width-1-2"> | |
| 41 | + <div class="uk-form-row"> | |
| 42 | + <label class="uk-form-label" >路 牌</label> | |
| 43 | + <div class="uk-form-controls"> | |
| 44 | + <input type="text" value="{{sch.lpName}}" disabled> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + | |
| 50 | + <div class="uk-grid"> | |
| 51 | + <div class="uk-width-1-2"> | |
| 52 | + <div class="uk-form-row"> | |
| 53 | + <label class="uk-form-label" >驾驶员</label> | |
| 54 | + <div class="uk-form-controls"> | |
| 55 | + <input type="text" value="{{sch.jGh}}/{{sch.jName}}" disabled> | |
| 56 | + </div> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + <div class="uk-width-1-2"> | |
| 60 | + <div class="uk-form-row"> | |
| 61 | + <label class="uk-form-label" >售票员</label> | |
| 62 | + <div class="uk-form-controls"> | |
| 63 | + <input type="text" value="{{sch.sGh}}/{{sch.sName}}" disabled> | |
| 64 | + </div> | |
| 65 | + </div> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + | |
| 69 | + <div class="uk-grid"> | |
| 70 | + <div class="uk-width-1-2"> | |
| 71 | + <div class="uk-form-row"> | |
| 72 | + <label class="uk-form-label" >计发时刻</label> | |
| 73 | + <div class="uk-form-controls"> | |
| 74 | + <input type="text" value="{{sch.fcsj}}" disabled> | |
| 75 | + </div> | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + <div class="uk-width-1-2"> | |
| 79 | + <div class="uk-form-row"> | |
| 80 | + <label class="uk-form-label" >实际时刻</label> | |
| 81 | + <div class="uk-form-controls"> | |
| 82 | + <input type="time" value="{{sch.fcsjActual}}" name="fcsjActual" {{if sch.status==0}}autofocus{{/if}}> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + </div> | |
| 86 | + </div> | |
| 87 | + | |
| 88 | + <div class="uk-grid"> | |
| 89 | + <div class="uk-width-1-2"> | |
| 90 | + <div class="uk-form-row"> | |
| 91 | + <label class="uk-form-label" >到达时刻</label> | |
| 92 | + <div class="uk-form-controls"> | |
| 93 | + <input type="time" value="{{sch.zdsjActual}}" name="zdsjActual" {{if sch.status==1}}autofocus{{/if}}> | |
| 94 | + </div> | |
| 95 | + </div> | |
| 96 | + </div> | |
| 97 | + <div class="uk-width-1-2"> | |
| 98 | + <div class="uk-form-row"> | |
| 99 | + <label class="uk-form-label" >班次类型</label> | |
| 100 | + <div class="uk-form-controls"> | |
| 101 | + <select class="form-control nt-dictionary" data-code="{{sch.bcType}}" name="bcType" data-group=ScheduleType></select> | |
| 102 | + </div> | |
| 103 | + </div> | |
| 104 | + </div> | |
| 105 | + </div> | |
| 106 | + | |
| 107 | + <div class="uk-grid"> | |
| 108 | + <div class="uk-width-1-1"> | |
| 109 | + <div class="uk-form-row"> | |
| 110 | + <label class="uk-form-label" >调整说明</label> | |
| 111 | + <div class="uk-form-controls"> | |
| 112 | + <select name="adjustExps"> | |
| 113 | + <option value="">请选择..</option> | |
| 114 | + {{each adjustExps as exp i}} | |
| 115 | + <option value="{{exp}}">{{exp}}</option> | |
| 116 | + {{/each}} | |
| 117 | + </select> | |
| 118 | + </div> | |
| 119 | + </div> | |
| 120 | + </div> | |
| 121 | + </div> | |
| 122 | + <div class="uk-grid"> | |
| 123 | + <div class="uk-width-1-1"> | |
| 124 | + <div class="uk-form-row ct-stacked"> | |
| 125 | + <div class="uk-form-controls" style="margin-top: 5px;"> | |
| 126 | + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="20" placeholder="备注,不超过20个字符"></textarea> | |
| 127 | + </div> | |
| 128 | + </div> | |
| 129 | + </div> | |
| 130 | + </div> | |
| 131 | + | |
| 132 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 133 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 134 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 135 | + </div> | |
| 136 | + </script> | |
| 137 | + | |
| 138 | + <script> | |
| 139 | + (function() { | |
| 140 | + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | |
| 141 | + var modal = '#schedule-fcxxwt-modal' | |
| 142 | + ,sch; | |
| 143 | + $(modal).on('init', function(e, data) { | |
| 144 | + sch=data.sch; | |
| 145 | + var formHtml = template('schedule-fcxxwt-form-temp', {sch: sch, adjustExps:adjustExps}); | |
| 146 | + $('form', modal).html(formHtml); | |
| 147 | + //字典转换 | |
| 148 | + dictionaryUtils.transformDom($('.nt-dictionary', modal)); | |
| 149 | + | |
| 150 | + //submit | |
| 151 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | |
| 152 | + f.on('success.form.fv', function(e) { | |
| 153 | + e.preventDefault(); | |
| 154 | + var data = $(this).serializeJSON(); | |
| 155 | + | |
| 156 | + gb_common.$post('/realSchedule/schInfoFineTune', data, function(rs){ | |
| 157 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 158 | + UIkit.modal(modal).hide(); | |
| 159 | + notify_succ('操作成功!'); | |
| 160 | + }); | |
| 161 | + }); | |
| 162 | + | |
| 163 | + //班次类型 | |
| 164 | + if(sch.bcType=='out'||sch.bcType=='in') | |
| 165 | + $('select[name=bcType]', f).attr('disabled','disabled'); | |
| 166 | + else { | |
| 167 | + //正常班次只能改为直放 和 放大站 | |
| 168 | + $('select[name=bcType] option', f).each(function(){ | |
| 169 | + var whiteList=['venting', 'major', sch.bcType]; | |
| 170 | + if(whiteList.indexOf($(this).val()) == -1) | |
| 171 | + $(this).remove(); | |
| 172 | + }); | |
| 173 | + } | |
| 174 | + | |
| 175 | + $('[name=adjustExps]', f).on('change', function(){ | |
| 176 | + var rem=$('[name=remarks]', f); | |
| 177 | + rem.val(rem.val() + $(this).val() + ',').trigger('input'); | |
| 178 | + }); | |
| 179 | + }); | |
| 180 | + })(); | |
| 181 | + </script> | |
| 182 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/jhlb.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="schedule-jhlb-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 370px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>计划烂班</h2></div> | |
| 6 | + <form class="uk-form uk-form-horizontal"> | |
| 7 | + </form> | |
| 8 | + </div> | |
| 9 | + | |
| 10 | + <script id="schedule-jhlb-form-temp" type="text/html"> | |
| 11 | + <div class="uk-grid"> | |
| 12 | + <div class="uk-width-1-1"> | |
| 13 | + <div class="uk-form-row"> | |
| 14 | + <label class="uk-form-label" >内部编码</label> | |
| 15 | + <div class="uk-form-controls"> | |
| 16 | + <input value="{{sch.clZbh}}" disabled/> | |
| 17 | + </div> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + | |
| 22 | + <div class="uk-grid"> | |
| 23 | + <div class="uk-width-1-1"> | |
| 24 | + <div class="uk-form-row"> | |
| 25 | + <label class="uk-form-label" >班次</label> | |
| 26 | + <div class="uk-form-controls sch-time-checkbox-list"> | |
| 27 | + {{each list as sch i}} | |
| 28 | + <label {{if sch.destroy}}class="destroy-sch"{{/if}}> | |
| 29 | + <input class="i-cbox" name="ids[]" value="{{sch.id}}" type="checkbox" {{if sch.destroy}}disabled{{/if}}> | |
| 30 | + {{sch.dfsj}} | |
| 31 | + {{if sch.bcType == "out"}} | |
| 32 | + <span class="uk-badge uk-badge-success">出场</span> | |
| 33 | + {{else if sch.bcType == "in"}} | |
| 34 | + <span class="uk-badge uk-badge-warning">进场</span> | |
| 35 | + {{/if}} | |
| 36 | + {{if sch.destroy}} | |
| 37 | + <small>已烂班</small> | |
| 38 | + {{/if}} | |
| 39 | + </label> | |
| 40 | + {{/each}} | |
| 41 | + </div> | |
| 42 | + </div> | |
| 43 | + </div> | |
| 44 | + </div> | |
| 45 | + <div class="uk-grid"> | |
| 46 | + <div class="uk-width-1-1"> | |
| 47 | + <div class="uk-form-row"> | |
| 48 | + <label class="uk-form-label" >调整说明</label> | |
| 49 | + <div class="uk-form-controls"> | |
| 50 | + <select name="adjustExps"> | |
| 51 | + <option value="">请选择..</option> | |
| 52 | + {{each adjustExps as exp i}} | |
| 53 | + <option value="{{exp}}">{{exp}}</option> | |
| 54 | + {{/each}} | |
| 55 | + </select> | |
| 56 | + </div> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + <div class="uk-grid"> | |
| 61 | + <div class="uk-width-1-1"> | |
| 62 | + <div class="uk-form-row ct-stacked"> | |
| 63 | + <div class="uk-form-controls" style="margin-top: 5px;"> | |
| 64 | + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-notempty data-fv-stringlength="true" data-fv-stringlength-max="20" placeholder="烂班说明,不超过20个字符"></textarea> | |
| 65 | + </div> | |
| 66 | + </div> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | + | |
| 70 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 71 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 72 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 73 | + </div> | |
| 74 | + </script> | |
| 75 | + | |
| 76 | + <script> | |
| 77 | + (function() { | |
| 78 | + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | |
| 79 | + var modal = '#schedule-jhlb-modal', | |
| 80 | + sch; | |
| 81 | + $(modal).on('init', function(e, data) { | |
| 82 | + sch = data.sch; | |
| 83 | + //获取车辆所有班次 | |
| 84 | + var schArr = gb_common.get_vals(gb_schedule_table.findScheduleByLine(sch.xlBm)).filter(function(item) { | |
| 85 | + return item.clZbh == sch.clZbh; | |
| 86 | + }).sort(gb_schedule_table.schedule_sort); | |
| 87 | + | |
| 88 | + var formHtml = template('schedule-jhlb-form-temp', { | |
| 89 | + sch: sch, | |
| 90 | + list: schArr, | |
| 91 | + adjustExps:adjustExps | |
| 92 | + }); | |
| 93 | + $('form', modal).html(formHtml); | |
| 94 | + | |
| 95 | + if(!sch.destroy){ | |
| 96 | + //选中班次 | |
| 97 | + var ckbox=$('input[type=checkbox][value='+sch.id+']', f).attr('checked', 'checked'); | |
| 98 | + //滚动到可视区域 | |
| 99 | + var cont=$('.sch-time-checkbox-list', f); | |
| 100 | + cont.animate({ | |
| 101 | + scrollTop: ckbox.offset().top - cont.offset().top + cont.scrollTop() - 10 | |
| 102 | + }, 500); | |
| 103 | + } | |
| 104 | + | |
| 105 | + //submit | |
| 106 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | |
| 107 | + f.on('success.form.fv', function(e) { | |
| 108 | + e.preventDefault(); | |
| 109 | + var data = $(this).serializeJSON(); | |
| 110 | + if(!data.ids || data.ids.length==0){ | |
| 111 | + UIkit.modal(modal).hide(); | |
| 112 | + return; | |
| 113 | + } | |
| 114 | + var idsStr=''; | |
| 115 | + $.each(data.ids, function(){idsStr+=(','+this)}); | |
| 116 | + data.idsStr=idsStr.substr(1); | |
| 117 | + //提交 | |
| 118 | + gb_common.$post('/realSchedule/destroy', data, function(rs){ | |
| 119 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 120 | + UIkit.modal(modal).hide(); | |
| 121 | + notify_succ('烂班操作成功!'); | |
| 122 | + }); | |
| 123 | + }); | |
| 124 | + | |
| 125 | + $('[name=adjustExps]', f).on('change', function(){ | |
| 126 | + var rem=$('[name=remarks]', f); | |
| 127 | + rem.val(rem.val() + $(this).val() + ',').trigger('input'); | |
| 128 | + }); | |
| 129 | + }); | |
| 130 | + })(); | |
| 131 | + </script> | |
| 132 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="schedule-lj_zrw-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 930px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>临加/子任务</h2></div> | |
| 6 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | |
| 7 | + <form class="uk-form uk-form-horizontal search-form"> | |
| 8 | + <div class="uk-grid"> | |
| 9 | + <div class="uk-width-1-3"> | |
| 10 | + <div class="uk-form-row"> | |
| 11 | + <label class="uk-form-label" style="width: 50px;">线路</label> | |
| 12 | + <div class="uk-form-controls" style="margin-left: 51px;"> | |
| 13 | + <select name="lineSelect"></select> | |
| 14 | + </div> | |
| 15 | + </div> | |
| 16 | + </div> | |
| 17 | + <div class="uk-width-1-3"> | |
| 18 | + <div class="uk-form-row"> | |
| 19 | + <label class="uk-form-label" style="width: 50px;">路牌</label> | |
| 20 | + <div class="uk-form-controls" style="margin-left: 51px;"> | |
| 21 | + <select name="lpName"></select> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + <div class="uk-width-1-3"> | |
| 26 | + <div class="uk-form-row"> | |
| 27 | + <i class="uk-icon-plus add-temp-sch-icon" title="新增临加班次" data-uk-tooltip></i> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + </form> | |
| 32 | + </div> | |
| 33 | + | |
| 34 | + <div class="ct_table_wrap ct_table_no_border main-schedule-wrap" style="height: 350px;"> | |
| 35 | + <div class="ct_table main-schedule-table"> | |
| 36 | + <div class="ct_table_head"> | |
| 37 | + <dl> | |
| 38 | + <dt>序号</dt> | |
| 39 | + <dt>开始时间 | |
| 40 | + <i class="uk-icon-question-circle" data-uk-tooltip title="蓝色字为实发时间"></i></dt> | |
| 41 | + <dt>结束时间</dt> | |
| 42 | + <dt>起点</dt> | |
| 43 | + <dt>终点</dt> | |
| 44 | + <dt>里程</dt> | |
| 45 | + <dt>车辆</dt> | |
| 46 | + <dt>驾驶员</dt> | |
| 47 | + </dl> | |
| 48 | + </div> | |
| 49 | + <div class="ct_table_body"></div> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + | |
| 53 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary" style="padding-bottom: 0;"> | |
| 54 | + <h3 class="uk-panel-title">子任务列表</h3> | |
| 55 | + <div class="ct_table_wrap ct_table_no_border" style="height: 142px;"> | |
| 56 | + <div class="ct_table sub-task-table"> | |
| 57 | + <div class="ct_table_head"> | |
| 58 | + <dl> | |
| 59 | + <dt>序号</dt> | |
| 60 | + <dt>类型</dt> | |
| 61 | + <dt>起点</dt> | |
| 62 | + <dt>终点</dt> | |
| 63 | + <dt>开始时间</dt> | |
| 64 | + <dt>结束时间</dt> | |
| 65 | + <dt>里程</dt> | |
| 66 | + <dt>备注</dt> | |
| 67 | + </dl> | |
| 68 | + </div> | |
| 69 | + <div class="ct_table_body"> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + | |
| 76 | + <script id="schedule-main-table-temp" type="text/html"> | |
| 77 | + {{each list as sch i}} | |
| 78 | + <dl data-id={{sch.id}}> | |
| 79 | + <dd>{{i+1}}</dd> | |
| 80 | + <dd> | |
| 81 | + {{if sch.fcsjActual==null}} | |
| 82 | + {{sch.dfsj}} | |
| 83 | + {{else}} | |
| 84 | + <span class="sjfc-time">{{sch.fcsjActual}}</span> | |
| 85 | + {{/if}} | |
| 86 | + {{if sch.bcType == "out"}} | |
| 87 | + <span class="uk-badge uk-badge-success">出场</span> | |
| 88 | + {{else if sch.bcType == "in"}} | |
| 89 | + <span class="uk-badge uk-badge-warning">进场</span> | |
| 90 | + {{/if}} | |
| 91 | + {{if sch.sflj}} | |
| 92 | + <span class="uk-badge uk-badge-danger">临加</span> | |
| 93 | + {{/if}} | |
| 94 | + {{if sch.cTasks.length > 0}} | |
| 95 | + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | |
| 96 | + {{/if}} | |
| 97 | + </dd> | |
| 98 | + <dd>{{sch.zdsj}}</dd> | |
| 99 | + <dd>{{sch.qdzName}}</dd> | |
| 100 | + <dd>{{sch.zdzName}}</dd> | |
| 101 | + <dd>{{sch.jhlc}}</dd> | |
| 102 | + <dd>{{sch.clZbh}}</dd> | |
| 103 | + <dd>{{sch.jName}}</dd> | |
| 104 | + </dl> | |
| 105 | + {{/each}} | |
| 106 | + </script> | |
| 107 | + <script id="sub_task-table-temp" type="text/html"> | |
| 108 | + {{each list as task i}} | |
| 109 | + <dl data-id="{{task.id}}"> | |
| 110 | + <dd>{{i+1}}</dd> | |
| 111 | + <dd><span class="nt-dictionary" data-group="ChildTaskType">{{task.type2}}</span></dd> | |
| 112 | + <dd>{{task.startStationName}}</dd> | |
| 113 | + <dd>{{task.endStationName}}</dd> | |
| 114 | + <dd>{{task.startDate}}</dd> | |
| 115 | + <dd>{{task.endDate}}</dd> | |
| 116 | + <dd> | |
| 117 | + {{task.mileage}} | |
| 118 | + (<span class="nt-dictionary" data-group="MileageType">{{task.mileageType}}</span> | |
| 119 | + {{if task.destroy}} | |
| 120 | + <small style="color:red;">烂班</small> | |
| 121 | + {{/if}} | |
| 122 | + ) | |
| 123 | + </dd> | |
| 124 | + <dd title="{{task.remarks}}">{{task.remarks}}</dd> | |
| 125 | + </dl> | |
| 126 | + {{/each}} | |
| 127 | + </script> | |
| 128 | + <script> | |
| 129 | + (function() { | |
| 130 | + var modal_opts = { center: false, bgclose: false, modal:false } | |
| 131 | + var modal = '#schedule-lj_zrw-modal', | |
| 132 | + f, | |
| 133 | + m_t_body = '.main-schedule-table .ct_table_body', | |
| 134 | + s_t_body = '.sub-task-table .ct_table_body', | |
| 135 | + folder = '/real_control_v2/fragments/line_schedule/context_menu', | |
| 136 | + sch, schList, lp2SchMap; | |
| 137 | + $(modal).on('init', function(e, data) { | |
| 138 | + sch = data.sch; | |
| 139 | + | |
| 140 | + f = $('.search-form', modal); | |
| 141 | + //线路下拉框 | |
| 142 | + var opts = ''; | |
| 143 | + $.each(gb_data_basic.activeLines, function() { | |
| 144 | + opts += '<option value="' + this.lineCode + '">' + this.name + '</option>'; | |
| 145 | + }); | |
| 146 | + $('[name=lineSelect]', f).html(opts) | |
| 147 | + .on('change', function() { | |
| 148 | + var lineCode = $(this).val(); | |
| 149 | + schList = gb_schedule_table.findScheduleByLine(lineCode); | |
| 150 | + lp2SchMap = gb_common.groupBy(schList, 'lpName'); | |
| 151 | + | |
| 152 | + var opts = ''; | |
| 153 | + for (var lpName in lp2SchMap) | |
| 154 | + opts += '<option value="' + lpName + '">' + lpName + '</option>'; | |
| 155 | + $('[name=lpName]', f).html(opts).trigger('change'); | |
| 156 | + }); | |
| 157 | + | |
| 158 | + //路牌下拉框 | |
| 159 | + $('[name=lpName]', f).on('change', function() { | |
| 160 | + var list = lp2SchMap[$(this).val()].sort(gb_schedule_table.schedule_sort), | |
| 161 | + htmlBody = template('schedule-main-table-temp', { | |
| 162 | + list: list | |
| 163 | + }); | |
| 164 | + $(m_t_body, modal).html(htmlBody); | |
| 165 | + $(s_t_body, modal).empty(); | |
| 166 | + }); | |
| 167 | + //班次点击 | |
| 168 | + $(modal).on('click contextmenu', m_t_body + ' dl', function() { | |
| 169 | + $(this).parent().find('.active').removeClass('active'); | |
| 170 | + $(this).addClass('active'); | |
| 171 | + //show 子任务 | |
| 172 | + $('.sub-task-table', modal).trigger('refresh'); | |
| 173 | + }); | |
| 174 | + //班次table刷新事件 | |
| 175 | + $('.main-schedule-table', modal).on('refresh', m_s_table_update); | |
| 176 | + //子任务table刷新事件 | |
| 177 | + $('.sub-task-table', modal).on('refresh', sub_task_update); | |
| 178 | + | |
| 179 | + //选中默认班次 | |
| 180 | + selectedDl(sch); | |
| 181 | + }); | |
| 182 | + | |
| 183 | + function selectedDl(sch){ | |
| 184 | + //默认选中项 | |
| 185 | + $('[name=lineSelect]', f).val(sch.xlBm).trigger('change'); | |
| 186 | + $('[name=lpName]', f).val(sch.lpName).trigger('change'); | |
| 187 | + var dl = $('.main-schedule-table', modal).find('dl[data-id=' + sch.id + ']').trigger('click'); | |
| 188 | + //滚动到可视区域 | |
| 189 | + var cont = $('.main-schedule-wrap', modal); | |
| 190 | + cont.animate({ | |
| 191 | + scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - 38 | |
| 192 | + }, 500); | |
| 193 | + } | |
| 194 | + | |
| 195 | + function getActiveSch(){ | |
| 196 | + var dl=$('.main-schedule-table dl.active', modal) | |
| 197 | + ,sch, lineCode=$('[name=lineSelect]', f).val(); | |
| 198 | + if(dl.length > 0) | |
| 199 | + sch=gb_schedule_table.findScheduleByLine(lineCode)[dl.data('id')]; | |
| 200 | + | |
| 201 | + return sch; | |
| 202 | + } | |
| 203 | + | |
| 204 | + //刷新主任务表格 | |
| 205 | + var m_s_table_update=function(e, opts){ | |
| 206 | + var lineCode=$('[name=lineSelect]', f).val(); | |
| 207 | + //重新获取班次数据 | |
| 208 | + schList = gb_schedule_table.findScheduleByLine(lineCode); | |
| 209 | + lp2SchMap = gb_common.groupBy(schList, 'lpName'); | |
| 210 | + $('[name=lpName]', f).trigger('change'); | |
| 211 | + | |
| 212 | + if(opts && opts.sch){ | |
| 213 | + selectedDl(opts.sch); | |
| 214 | + } | |
| 215 | + } | |
| 216 | + | |
| 217 | + //刷新子任务表格 | |
| 218 | + var sub_task_update=function(){ | |
| 219 | + var sch=getActiveSch() | |
| 220 | + ,htmlStr='' | |
| 221 | + ,tbody=$(s_t_body, modal); | |
| 222 | + sch.cTasks.sort(sub_task_sort); | |
| 223 | + htmlStr = template('sub_task-table-temp', {list: sch.cTasks}); | |
| 224 | + tbody.html(htmlStr); | |
| 225 | + //字典转换 | |
| 226 | + dictionaryUtils.transformDom($('.nt-dictionary', tbody)); | |
| 227 | + } | |
| 228 | + | |
| 229 | + //新增临加 | |
| 230 | + var add_temp_sch=function(){ | |
| 231 | + var sch=getActiveSch(); | |
| 232 | + if(!sch) | |
| 233 | + sch={xlBm: $('[name=lineSelect]', f).val(), lpName: $('[name=lpName]', f).val()}; | |
| 234 | + | |
| 235 | + open_modal(folder + '/add_temp_sch.html', { | |
| 236 | + sch:sch | |
| 237 | + }, modal_opts); | |
| 238 | + } | |
| 239 | + | |
| 240 | + //删除临加班次 | |
| 241 | + var remove_sch=function(){ | |
| 242 | + var sch = getActiveSch(); | |
| 243 | + if(!sch || !sch.sflj) | |
| 244 | + return notify_err('只能删除临加班次!'); | |
| 245 | + var str='<h3>确定要删除临加班次<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>?</h3>'; | |
| 246 | + alt_confirm(str, function(){ | |
| 247 | + gb_common.$del('/realSchedule/' + sch.id, function(rs){ | |
| 248 | + //前端数据更新 | |
| 249 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 250 | + gb_schedule_table.deheteSchedule(rs.delete); | |
| 251 | + //m_s_table_update(); | |
| 252 | + $('.main-schedule-table', modal).trigger('refresh'); | |
| 253 | + }); | |
| 254 | + }, '确定删除'); | |
| 255 | + } | |
| 256 | + //添加自定义子任务 | |
| 257 | + var add_sub_task_other=function(){ | |
| 258 | + var sch=getActiveSch(); | |
| 259 | + if(!sch) | |
| 260 | + return notify_err('无法获取到主任务信息!'); | |
| 261 | + open_modal(folder + '/sub_task/add_sub_task_other.html', { | |
| 262 | + sch:sch | |
| 263 | + }, modal_opts); | |
| 264 | + } | |
| 265 | + | |
| 266 | + //删除子任务 | |
| 267 | + var remove_sub_task=function(){ | |
| 268 | + var activeDl=$(s_t_body, modal).find('dl.context-menu-active'); | |
| 269 | + if(activeDl.length==0) | |
| 270 | + return; | |
| 271 | + var dds=activeDl.find('dd'); | |
| 272 | + console.log(dds); | |
| 273 | + var id=activeDl.data('id') | |
| 274 | + ,str='<h3>确定要删除子任务<span style="color:red;margin: 0 5px;">'+ $(dds[4]).text()+','+ $(dds[6]).text() +' </span>?</h3>'; | |
| 275 | + alt_confirm(str, function(){ | |
| 276 | + gb_common.$del('/childTask/' + id, function(rs){ | |
| 277 | + gb_schedule_table.updateSchedule(rs.t); | |
| 278 | + notify_succ('删除子任务成功!'); | |
| 279 | + //刷新班次列表 | |
| 280 | + m_s_table_update(); | |
| 281 | + //选中班次 | |
| 282 | + selectedDl(rs.t); | |
| 283 | + }); | |
| 284 | + }, '确定删除'); | |
| 285 | + } | |
| 286 | + | |
| 287 | + var callbackHandler={ | |
| 288 | + add_temp_sch:add_temp_sch, | |
| 289 | + remove_sch: remove_sch, | |
| 290 | + add_sub_task_other:add_sub_task_other, | |
| 291 | + remove_sub_task: remove_sub_task | |
| 292 | + } | |
| 293 | + | |
| 294 | + //右键菜单 | |
| 295 | + $.contextMenu({ | |
| 296 | + selector: modal+ ' '+m_t_body+' dl', | |
| 297 | + className: 'schedule-ct-menu', | |
| 298 | + callback: function(key, options) { | |
| 299 | + callbackHandler[key] && callbackHandler[key](); | |
| 300 | + }, | |
| 301 | + items: { | |
| 302 | + "add_temp_sch": { | |
| 303 | + name: "临加班次" | |
| 304 | + }, | |
| 305 | + "add_sub_task": { | |
| 306 | + name: "添加子任务", | |
| 307 | + items: { | |
| 308 | + 'add_sub_task_in': { | |
| 309 | + name: '回场', | |
| 310 | + disabled:true | |
| 311 | + }, | |
| 312 | + 'add_sub_task_out': { | |
| 313 | + name: '出场', | |
| 314 | + disabled:true | |
| 315 | + }, | |
| 316 | + 'add_sub_task_other': { | |
| 317 | + name: '自定义' | |
| 318 | + } | |
| 319 | + } | |
| 320 | + }, | |
| 321 | + 'remove_sch': { | |
| 322 | + name: '删除' | |
| 323 | + } | |
| 324 | + } | |
| 325 | + }); | |
| 326 | + | |
| 327 | + //右键菜单 | |
| 328 | + $.contextMenu({ | |
| 329 | + selector: modal+' '+s_t_body+' dl', | |
| 330 | + className: 'schedule-ct-menu', | |
| 331 | + callback: function(key, options) { | |
| 332 | + callbackHandler[key] && callbackHandler[key](); | |
| 333 | + }, | |
| 334 | + items: { | |
| 335 | + "remove_sub_task": { | |
| 336 | + name: "删除子任务" | |
| 337 | + , icon: "delete" | |
| 338 | + } | |
| 339 | + } | |
| 340 | + }); | |
| 341 | + | |
| 342 | + gb_ct_table.fixedHead($('.ct_table_wrap', modal)); | |
| 343 | + | |
| 344 | + $('.add-temp-sch-icon', modal).on('click', add_temp_sch); | |
| 345 | + | |
| 346 | + function sub_task_sort(a, b){ | |
| 347 | + return a.id - b.id; | |
| 348 | + } | |
| 349 | + })(); | |
| 350 | + </script> | |
| 351 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/multi_dftz.html
0 → 100644
| 1 | +<div class="uk-modal" id="schedule-multi-dftz-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 710px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>批量待发调整</h2></div> | |
| 6 | + | |
| 7 | + <div class="ct_table_wrap" style="overflow: hidden;"> | |
| 8 | + <div class="ct_table multi-dftz-table"> | |
| 9 | + <div class="ct_table_head"> | |
| 10 | + <dl> | |
| 11 | + <dt>路牌</dt> | |
| 12 | + <dt>车辆</dt> | |
| 13 | + <dt>驾驶员</dt> | |
| 14 | + <dt>计发时间</dt> | |
| 15 | + <dt>待发时间</dt> | |
| 16 | + <dt>待发调整</dt> | |
| 17 | + </dl> | |
| 18 | + </div> | |
| 19 | + <div class="ct_table_body"></div> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + | |
| 23 | + <div class="uk-modal-footer uk-text-right"> | |
| 24 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 25 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 26 | + </div> | |
| 27 | + </div> | |
| 28 | + | |
| 29 | + <script id="schedule-multi-dftz-table-temp" type="text/html"> | |
| 30 | + {{each list as sch i}} | |
| 31 | + <dl data-id="{{sch.id}}"> | |
| 32 | + <dd><a>{{sch.lpName}}</a></dd> | |
| 33 | + <dd data-nbbm="{{sch.clZbh}}">{{sch.clZbh}}</dd> | |
| 34 | + <dd>{{sch.jName}}</dd> | |
| 35 | + <dd>{{sch.fcsj}} {{if sch.bcType == "out"}} | |
| 36 | + <span class="uk-badge uk-badge-success">出场</span> {{else if sch.bcType == "in"}} | |
| 37 | + <span class="uk-badge uk-badge-warning">进场</span> {{/if}} | |
| 38 | + </dd> | |
| 39 | + <dd>{{sch.dfsj}}</dd> | |
| 40 | + <dd> | |
| 41 | + <input type="time" value="{{sch.dfsj}}" data-old="{{sch.dfsj}}" /> | |
| 42 | + <span class="modify-num" draggable="true"></span> | |
| 43 | + </dd> | |
| 44 | + </dl> | |
| 45 | + {{/each}} | |
| 46 | + </script> | |
| 47 | + | |
| 48 | + <script> | |
| 49 | + (function() { | |
| 50 | + var modal = '#schedule-multi-dftz-modal'; | |
| 51 | + $(modal).on('init', function(e, data) { | |
| 52 | + var bodyHtml = template('schedule-multi-dftz-table-temp', data); | |
| 53 | + $('.multi-dftz-table .ct_table_body', modal).html(bodyHtml); | |
| 54 | + | |
| 55 | + $('.multi-dftz-table input', modal).on('input propertychange', valChange); | |
| 56 | + }); | |
| 57 | + | |
| 58 | + $('button[type=submit]', modal).on('click', function() { | |
| 59 | + var data = [], text=''; | |
| 60 | + var dls = $('.multi-dftz-table .ct_table_body dl', modal); | |
| 61 | + $.each(dls, function() { | |
| 62 | + var input = $($('dd', this)[5]).find('input'), | |
| 63 | + v = $.trim(input.val()), | |
| 64 | + old = input.data('old'); | |
| 65 | + if (!v || v == old) | |
| 66 | + return true; | |
| 67 | + data.push({ | |
| 68 | + schId: $(this).data('id'), | |
| 69 | + old_dfsj: old, | |
| 70 | + new_dfsj: v | |
| 71 | + }); | |
| 72 | + text+=('<span style="color:red;">'+old + '——>' + v + '</span>,'); | |
| 73 | + }); | |
| 74 | + | |
| 75 | + alt_confirm('确定要进行调整?' + text, function(){ | |
| 76 | + gb_common.$post('/realSchedule/multi_dftz', { | |
| 77 | + dcsJson: JSON.stringify(data) | |
| 78 | + }, function(rs) { | |
| 79 | + if(rs.ts && rs.ts.length > 0){ | |
| 80 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 81 | + UIkit.modal(modal).hide(); | |
| 82 | + notify_succ('待发调整成功'); | |
| 83 | + } | |
| 84 | + }); | |
| 85 | + }, '确定调整'); | |
| 86 | + }); | |
| 87 | + | |
| 88 | + var valChange = function() { | |
| 89 | + var old = moment($(this).data('old'), "HH:mm"), | |
| 90 | + now = moment($(this).val(), "HH:mm"), | |
| 91 | + diff = now.diff(old) / 1000 / 60, | |
| 92 | + span = $(this).next('.modify-num'); | |
| 93 | + | |
| 94 | + if (diff > 0) | |
| 95 | + span.removeClass('negative').text('+' + diff); | |
| 96 | + else if (diff == 0) { | |
| 97 | + span.text(''); | |
| 98 | + } else | |
| 99 | + span.addClass('negative').text('-' + Math.abs(diff)); | |
| 100 | + } | |
| 101 | + | |
| 102 | + //drag.... | |
| 103 | + var mdf_nos = modal + ' span.modify-num', | |
| 104 | + eleDrag = null; | |
| 105 | + $(document).on('dragstart', mdf_nos, function(ev) { | |
| 106 | + eleDrag = this; | |
| 107 | + $(mdf_nos).css('border', '1px dotted grey'); | |
| 108 | + }) | |
| 109 | + .on('dragend', mdf_nos, function(ev) { | |
| 110 | + $(mdf_nos).css('border', '0'); | |
| 111 | + eleDrag = null; | |
| 112 | + $('.multi-dftz-table input', modal).each(function() { | |
| 113 | + var old = $(this).data('old'), | |
| 114 | + diff = $(this).next('.modify-num').text(), | |
| 115 | + symbol = diff.substr(0, 1), | |
| 116 | + num = parseInt(diff.substr(1)), | |
| 117 | + now; | |
| 118 | + | |
| 119 | + if (symbol == '+') | |
| 120 | + now = moment(old, "HH:mm").add(num, 'minutes'); | |
| 121 | + else | |
| 122 | + now = moment(old, "HH:mm").subtract(num, 'minutes'); | |
| 123 | + | |
| 124 | + $(this).val(now.format('HH:mm')); | |
| 125 | + }); | |
| 126 | + }) | |
| 127 | + .on('dragenter', mdf_nos, function(e) { | |
| 128 | + e.preventDefault(); | |
| 129 | + if (eleDrag) { | |
| 130 | + var t = $(eleDrag).text(), | |
| 131 | + symbol = t.substr(0, 1); | |
| 132 | + | |
| 133 | + if (symbol == '+') | |
| 134 | + $(this).removeClass('negative'); | |
| 135 | + else | |
| 136 | + $(this).addClass('negative'); | |
| 137 | + $(this).text(t); | |
| 138 | + } | |
| 139 | + }) | |
| 140 | + .on('dragover', mdf_nos, function(e) { | |
| 141 | + e.preventDefault(); | |
| 142 | + }); | |
| 143 | + })(); | |
| 144 | + </script> | |
| 145 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/multi_tzrc.html
0 → 100644
| 1 | +<div class="uk-modal" id="schedule-multi-tzrc-modal"> | |
| 2 | + <div class="drag-container"></div> | |
| 3 | + <div class="uk-modal-dialog" style="width: 860px;"> | |
| 4 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 5 | + <div class="uk-modal-header"> | |
| 6 | + <h2>调整人车</h2></div> | |
| 7 | + | |
| 8 | + <div class="uk-grid tm-grid-truncate" style="margin-left: 0;"> | |
| 9 | + </div> | |
| 10 | + | |
| 11 | + <div class="change_log"> | |
| 12 | + | |
| 13 | + </div> | |
| 14 | + <div class="uk-modal-footer uk-text-right"> | |
| 15 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 16 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 17 | + </div> | |
| 18 | + </div> | |
| 19 | + | |
| 20 | + <script id="schedule-multi-tzrc-items-temp" type="text/html"> | |
| 21 | + {{each list as sch i}} | |
| 22 | + <div class="uk-width-medium-1-4"> | |
| 23 | + <div class="uk-panel uk-panel-box sch-panel"> | |
| 24 | + <div class="right-text-lp">路牌: {{sch.lpName}}</div> | |
| 25 | + <h3 class="uk-panel-title"> | |
| 26 | + {{sch.dfsj}} | |
| 27 | + {{if sch.bcType == "out"}} | |
| 28 | + <span class="uk-badge uk-badge-success">出场</span> | |
| 29 | + {{else if sch.bcType == "in"}} | |
| 30 | + <span class="uk-badge uk-badge-warning">进场</span> | |
| 31 | + {{/if}} | |
| 32 | + </h3> | |
| 33 | + <div class="drag-panel-wrap" draggable="false" data-id="{{sch.id}}"></div> | |
| 34 | + </div> | |
| 35 | + </div> | |
| 36 | + {{/each}} | |
| 37 | + </script> | |
| 38 | + | |
| 39 | + <script id="multi-tzrc-drag-panel-temp" type="text/html"> | |
| 40 | + <div style="left:{{left}}px;top:{{top1}}px;" class="drop-rail" data-type="people" for="#drag_people_{{sch.id}}"></div> | |
| 41 | + <span class="drag-panel" draggable="true" data-type="people" style="left:{{left}}px;top:{{top1}}px" id="drag_people_{{sch.id}}"> | |
| 42 | + <i class="uk-sortable-handle uk-icon uk-icon-user uk-margin-small-right"></i> | |
| 43 | + <span>{{sch.jGh}}/{{sch.jName}}</span></span> | |
| 44 | + | |
| 45 | + <div style="left:{{left}}px;top:{{top2}}px" class="drop-rail" data-type="car" for="#drag_car_{{sch.id}}"></div> | |
| 46 | + <span class="drag-panel" draggable="true" data-type="car" style="left:{{left}}px;top:{{top2}}px" id="drag_car_{{sch.id}}"> | |
| 47 | + <i class="uk-sortable-handle uk-icon uk-icon-bus uk-margin-small-right"></i> | |
| 48 | + <span>{{sch.clZbh}}</span> | |
| 49 | + </span> | |
| 50 | + </script> | |
| 51 | + | |
| 52 | + <script id="multi-tzrc-result-temp" type="text/html"> | |
| 53 | + <h3>请确认你的变更操作</h3> | |
| 54 | + <table class="uk-table uk-table-hover comf-result"> | |
| 55 | + <thead> | |
| 56 | + <tr> | |
| 57 | + <th>操作类型</th> | |
| 58 | + <th>班次</th> | |
| 59 | + <th>之前</th> | |
| 60 | + <th>现在</th> | |
| 61 | + </tr> | |
| 62 | + </thead> | |
| 63 | + <tbody> | |
| 64 | + {{each list as r i}} | |
| 65 | + <tr> | |
| 66 | + {{if r.change_type=="people"}} | |
| 67 | + <td>换人</td> | |
| 68 | + <td>{{r.sch.dfsj}}</td> | |
| 69 | + <td>{{r.sch.jGh}}/{{r.sch.jName}}</td> | |
| 70 | + <td>{{r.new_people}}</td> | |
| 71 | + {{else if r.change_type=="car"}} | |
| 72 | + <td>换车</td> | |
| 73 | + <td>{{r.sch.dfsj}}</td> | |
| 74 | + <td>{{r.sch.clZbh}}</td> | |
| 75 | + <td>{{r.new_car}}</td> | |
| 76 | + {{/if}} | |
| 77 | + </tr> | |
| 78 | + {{/each}} | |
| 79 | + </tbody> | |
| 80 | + </table> | |
| 81 | + </script> | |
| 82 | + | |
| 83 | + <script> | |
| 84 | + (function() { | |
| 85 | + //var changeLog=[]; | |
| 86 | + var modal = '#schedule-multi-tzrc-modal', | |
| 87 | + schArr; | |
| 88 | + $(modal).on('init', function(e, data) { | |
| 89 | + schArr = data.list; | |
| 90 | + var bodyHtml = template('schedule-multi-tzrc-items-temp', data); | |
| 91 | + $('.tm-grid-truncate', modal).html(bodyHtml); | |
| 92 | + | |
| 93 | + //计算位置,渲染 drag panel | |
| 94 | + setTimeout(renderDragPanels, 400); | |
| 95 | + }); | |
| 96 | + | |
| 97 | + function renderDragPanels() { | |
| 98 | + var drags = ''; | |
| 99 | + $('.sch-panel .drag-panel-wrap', modal).each(function(i) { | |
| 100 | + var offset = $(this).offset(), | |
| 101 | + top = offset.top + 11, | |
| 102 | + sch = schArr[i]; | |
| 103 | + | |
| 104 | + if (!sch.id == $(this).data('id')) | |
| 105 | + return true; | |
| 106 | + | |
| 107 | + drags += (template('multi-tzrc-drag-panel-temp', { | |
| 108 | + sch: sch, | |
| 109 | + top1: top, | |
| 110 | + top2: top + 39, | |
| 111 | + left: offset.left + 13 | |
| 112 | + })); | |
| 113 | + }); | |
| 114 | + $('.drag-container', modal).append(drags); | |
| 115 | + | |
| 116 | + //drag event | |
| 117 | + $('.drag-panel', modal).each(function() { | |
| 118 | + this.addEventListener('dragstart', handleDragStart, false); | |
| 119 | + //this.addEventListener('dragenter', handleDragEnter, false) | |
| 120 | + //this.addEventListener('dragover', handleDragOver, false); | |
| 121 | + //this.addEventListener('dragleave', handleDragLeave, false); | |
| 122 | + //this.addEventListener('drop', handleDrop, false); | |
| 123 | + this.addEventListener('dragend', handleDragEnd, false); | |
| 124 | + }); | |
| 125 | + | |
| 126 | + //drop | |
| 127 | + $('.drop-rail', modal).each(function() { | |
| 128 | + this.addEventListener('dragover', handleDragOver, false); | |
| 129 | + this.addEventListener('dragleave', handleDragLeave, false); | |
| 130 | + this.addEventListener('drop', handleDrop, false); | |
| 131 | + }) | |
| 132 | + | |
| 133 | + //drop | |
| 134 | + // $('.drag-panel-wrap', modal).each(function() { | |
| 135 | + // this.addEventListener('dragover', handleDragOver, false); | |
| 136 | + // this.addEventListener('dragleave', handleDragLeave, false); | |
| 137 | + // }); | |
| 138 | + } | |
| 139 | + | |
| 140 | + var dragSrcEl = null; | |
| 141 | + | |
| 142 | + function handleDragStart(e) { | |
| 143 | + //this.style.opacity = '0.4';draging | |
| 144 | + $(this).addClass('draging'); | |
| 145 | + dragSrcEl = this; | |
| 146 | + //dataTransfer | |
| 147 | + e.dataTransfer.effectAllowed = 'move'; | |
| 148 | + //e.dataTransfer.setData('text/html', this.innerHTML); | |
| 149 | + | |
| 150 | + var type = $(this).data('type'); | |
| 151 | + $('.drag-panel[data-type!="' + type + '"]', modal).addClass('disable'); | |
| 152 | + $('.drop-rail[data-type="' + type + '"]', modal).addClass('over'); | |
| 153 | + $('.drag-panel', modal).css('pointer-events', 'none'); | |
| 154 | + $(this).css('pointer-events', 'auto'); | |
| 155 | + } | |
| 156 | + | |
| 157 | + function handleDragEnter(e) { | |
| 158 | + //this.classList.add('over'); | |
| 159 | + } | |
| 160 | + | |
| 161 | + function handleDragOver(e) { | |
| 162 | + //type 不同时才允许落下 | |
| 163 | + if ($(this).data('type') == $(dragSrcEl).data('type')) { | |
| 164 | + e.preventDefault(); | |
| 165 | + e.dataTransfer.dropEffect = 'move'; | |
| 166 | + | |
| 167 | + chnagePos($($(this).attr('for')), $(dragSrcEl)); | |
| 168 | + return false; | |
| 169 | + } | |
| 170 | + } | |
| 171 | + | |
| 172 | + function handleDragLeave(e) { | |
| 173 | + resetPos($($(this).attr('for'))); | |
| 174 | + } | |
| 175 | + | |
| 176 | + function handleDrop(e) { | |
| 177 | + e.stopPropagation(); | |
| 178 | + | |
| 179 | + var sid = $(dragSrcEl).attr('id'), | |
| 180 | + eid = $(this).attr('for'); | |
| 181 | + if (sid != eid && $(dragSrcEl).data('type') == $(this).data('type')) { | |
| 182 | + //exchange drag item id | |
| 183 | + $(eid).attr('id', sid.replace('#', '')); | |
| 184 | + $(dragSrcEl).attr('id', eid.replace('#', '')); | |
| 185 | + | |
| 186 | + //change dragSrcEl position | |
| 187 | + $(dragSrcEl).addClass('no-anim').css('top', $(this).css('top')).css('left', $(this).css('left')); | |
| 188 | + //changeLog.push({sid: sid, eid: eid}); | |
| 189 | + //addExchangeLog(sid, eid, $(dragSrcEl).data('type')); | |
| 190 | + //$(dragSrcEl) | |
| 191 | + //var type = $(dragSrcEl).data('type'); | |
| 192 | + | |
| 193 | + } | |
| 194 | + // if (dragSrcEl != this) { | |
| 195 | + // dragSrcEl.innerHTML = this.innerHTML; | |
| 196 | + // this.innerHTML = e.dataTransfer.getData('text/html'); | |
| 197 | + // } | |
| 198 | + // return false; | |
| 199 | + } | |
| 200 | + | |
| 201 | + function handleDragEnd(e) { | |
| 202 | + if (dragSrcEl) { | |
| 203 | + $(dragSrcEl).removeClass('draging'); | |
| 204 | + } | |
| 205 | + | |
| 206 | + $('.drop-rail', modal).removeClass('over'); | |
| 207 | + $('.drag-panel', modal).removeClass('disable no-anim transient') | |
| 208 | + .css('pointer-events', 'auto'); | |
| 209 | + } | |
| 210 | + | |
| 211 | + function chnagePos(s, d) { | |
| 212 | + if (s.hasClass('transient')) | |
| 213 | + return; | |
| 214 | + var top = d.css('top'), | |
| 215 | + left = d.css('left'), | |
| 216 | + oldTop = s.css('top'), | |
| 217 | + oldLeft = s.css('left'); | |
| 218 | + s.css('top', top).css('left', left).data('oldtop', oldTop).data('oldLeft', oldLeft).addClass('transient'); | |
| 219 | + } | |
| 220 | + | |
| 221 | + function resetPos(s) { | |
| 222 | + if (!s.hasClass('transient')) | |
| 223 | + return; | |
| 224 | + | |
| 225 | + var top = s.data('oldtop'), | |
| 226 | + left = s.data('oldLeft'); | |
| 227 | + s.css('top', top).css('left', left).removeData('oldtop').removeData('oldLeft').removeClass('transient'); | |
| 228 | + } | |
| 229 | + | |
| 230 | + // function addExchangeLog(sid, eid, type){ | |
| 231 | + // //console.log('addExchangeLog', sid, eid, type); | |
| 232 | + // sid=sid.substr(sid.lastIndexOf('_') + 1); | |
| 233 | + // eid=eid.substr(eid.lastIndexOf('_') + 1); | |
| 234 | + // changeLog.push({sid: sid, eid: eid, type: type}); | |
| 235 | + // | |
| 236 | + // //console.log(changeLog); | |
| 237 | + // } | |
| 238 | + | |
| 239 | + $('button[type=submit]', modal).on('click', function() { | |
| 240 | + //$(this).attr('disabled', 'disabled'); | |
| 241 | + //比对变更 | |
| 242 | + var people, car, oldpeople, oldcar; | |
| 243 | + var changes = []; | |
| 244 | + $.each(schArr, function() { | |
| 245 | + people = $('span', '#drag_people_' + this.id).text(); | |
| 246 | + car = $('span', '#drag_car_' + this.id).text(); | |
| 247 | + oldpeople = this.jGh + '/' + this.jName; | |
| 248 | + | |
| 249 | + if (oldpeople != people) | |
| 250 | + changes.push({ | |
| 251 | + change_type: 'people', | |
| 252 | + sch: this, | |
| 253 | + old_people: oldpeople, | |
| 254 | + new_people: people | |
| 255 | + }); | |
| 256 | + if (this.clZbh != car) | |
| 257 | + changes.push({ | |
| 258 | + change_type: 'car', | |
| 259 | + sch: this, | |
| 260 | + old_car: this.clZbh, | |
| 261 | + new_car: car | |
| 262 | + }); | |
| 263 | + }); | |
| 264 | + | |
| 265 | + if (changes.length == 0) { | |
| 266 | + //UIkit.notify("无变更", {status:'success'}) | |
| 267 | + closeModal(modal); | |
| 268 | + return; | |
| 269 | + } | |
| 270 | + //console.log(changes); | |
| 271 | + var comfHtml = template('multi-tzrc-result-temp', { | |
| 272 | + list: changes | |
| 273 | + }); | |
| 274 | + | |
| 275 | + alt_confirm(comfHtml, function(){ | |
| 276 | + //提交数据 | |
| 277 | + var data=[]; | |
| 278 | + $.each(changes, function(){ | |
| 279 | + data.push({ | |
| 280 | + schId: this.sch.id, | |
| 281 | + jsy: this.new_people, | |
| 282 | + clZbh: this.new_car | |
| 283 | + }); | |
| 284 | + }); | |
| 285 | + gb_common.$post('/realSchedule/multi_tzrc', { | |
| 286 | + cpcsJson: JSON.stringify(data) | |
| 287 | + }, function(rs) { | |
| 288 | + if(rs.ts && rs.ts.length > 0){ | |
| 289 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 290 | + UIkit.modal(modal).hide(); | |
| 291 | + notify_succ('调整人车成功'); | |
| 292 | + } | |
| 293 | + }); | |
| 294 | + }, '确认调整'); | |
| 295 | + }); | |
| 296 | + | |
| 297 | + | |
| 298 | + function closeModal(modal) { | |
| 299 | + $('a.uk-modal-close.uk-close', modal).click(); | |
| 300 | + } | |
| 301 | + })(); | |
| 302 | + </script> | |
| 303 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sftz.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="schedule-sftz-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 350px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>实发调整</h2></div> | |
| 6 | + <form class="uk-form uk-form-horizontal"> | |
| 7 | + </form> | |
| 8 | + </div> | |
| 9 | + | |
| 10 | + <script id="schedule-sftz-form-temp" type="text/html"> | |
| 11 | + <input type="hidden" name="id" value="{{id}}" /> | |
| 12 | + <div class="uk-grid"> | |
| 13 | + <div class="uk-width-1-1"> | |
| 14 | + <div class="uk-form-row"> | |
| 15 | + <label class="uk-form-label" >车辆</label> | |
| 16 | + <div class="uk-form-controls"> | |
| 17 | + <input type="text" value="{{clZbh}}" disabled> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + <div class="uk-grid"> | |
| 23 | + <div class="uk-width-1-1"> | |
| 24 | + <div class="uk-form-row"> | |
| 25 | + <label class="uk-form-label" >路牌</label> | |
| 26 | + <div class="uk-form-controls"> | |
| 27 | + <input type="text" value="{{lpName}}" disabled> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + <div class="uk-grid"> | |
| 33 | + <div class="uk-width-1-1"> | |
| 34 | + <div class="uk-form-row"> | |
| 35 | + <label class="uk-form-label" >计发时刻</label> | |
| 36 | + <div class="uk-form-controls"> | |
| 37 | + <input type="text" value="{{fcsj}}" disabled> | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + <div class="uk-grid"> | |
| 43 | + <div class="uk-width-1-1"> | |
| 44 | + <div class="uk-form-row"> | |
| 45 | + <label class="uk-form-label" >实发时刻</label> | |
| 46 | + <div class="uk-form-controls"> | |
| 47 | + <input type="time" name="fcsjActual" value="{{fcsjActual}}" autofocus> | |
| 48 | + </div> | |
| 49 | + </div> | |
| 50 | + </div> | |
| 51 | + </div> | |
| 52 | + <div class="uk-grid"> | |
| 53 | + <div class="uk-width-1-1"> | |
| 54 | + <div class="uk-form-row ct-stacked"> | |
| 55 | + <label class="uk-form-label" for="form-s-t">调整说明<small class="font-danger">(不超过20个字符)</small></label> | |
| 56 | + <div class="uk-form-controls"> | |
| 57 | + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-notempty data-fv-stringlength="true" data-fv-stringlength-max="20"></textarea> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + | |
| 63 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 64 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 65 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 66 | + </div> | |
| 67 | + </script> | |
| 68 | + | |
| 69 | + <script> | |
| 70 | + (function() { | |
| 71 | + var modal = '#schedule-sftz-modal', | |
| 72 | + sch; | |
| 73 | + $(modal).on('init', function(e, data) { | |
| 74 | + sch = data.sch; | |
| 75 | + var formHtml = template('schedule-sftz-form-temp', sch); | |
| 76 | + $('form', modal).html(formHtml); | |
| 77 | + | |
| 78 | + //submit | |
| 79 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | |
| 80 | + f.on('success.form.fv', function(e) { | |
| 81 | + e.preventDefault(); | |
| 82 | + var data = $(this).serializeJSON(); | |
| 83 | + | |
| 84 | + gb_common.$post('/realSchedule/realOutAdjust', data, function(rs) { | |
| 85 | + if (rs.ts) { | |
| 86 | + //更新前端数据 | |
| 87 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 88 | + UIkit.modal(modal).hide(); | |
| 89 | + notify_succ('实发调整成功!'); | |
| 90 | + } | |
| 91 | + }); | |
| 92 | + }); | |
| 93 | + }); | |
| 94 | + })(); | |
| 95 | + </script> | |
| 96 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task/add_sub_task_other.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="add-sub-task-other-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 635px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>新增自定义子任务</h2></div> | |
| 6 | + <form class="uk-form uk-form-horizontal"> | |
| 7 | + </form> | |
| 8 | + </div> | |
| 9 | + | |
| 10 | + <script id="sub-task-other-form-temp" type="text/html"> | |
| 11 | + <input type="hidden" value="{{sch.id}}" name="schedule.id"> | |
| 12 | + <div class="uk-grid"> | |
| 13 | + <div class="uk-width-1-1"> | |
| 14 | + <div class="uk-form-row"> | |
| 15 | + <label class="uk-form-label">班次类型</label> | |
| 16 | + <div class="uk-form-controls"> | |
| 17 | + <select class="form-control" name="type1" style="width: 65px;"> | |
| 18 | + <option>正常</option> | |
| 19 | + <option>临加</option> | |
| 20 | + </select> | |
| 21 | + <select class="form-control nt-dictionary" name="type2" data-group=ChildTaskType style="width: 126px;;"></select> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + <div class="uk-grid"> | |
| 27 | + <div class="uk-width-1-2"> | |
| 28 | + <div class="uk-form-row"> | |
| 29 | + <label class="uk-form-label">起点 </label> | |
| 30 | + <div class="uk-form-controls"> | |
| 31 | + <select name="startStation" required></select> | |
| 32 | + </div> | |
| 33 | + </div> | |
| 34 | + </div> | |
| 35 | + <div class="uk-width-1-2"> | |
| 36 | + <div class="uk-form-row"> | |
| 37 | + <label class="uk-form-label">终点</label> | |
| 38 | + <div class="uk-form-controls"> | |
| 39 | + <select name="endStation" required></select> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + </div> | |
| 43 | + </div> | |
| 44 | + | |
| 45 | + <div class="uk-grid"> | |
| 46 | + <div class="uk-width-1-2"> | |
| 47 | + <div class="uk-form-row"> | |
| 48 | + <label class="uk-form-label">里程类型</label> | |
| 49 | + <div class="uk-form-controls"> | |
| 50 | + <select class="form-control nt-dictionary" required name="mileageType" data-group="MileageType" ></select> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + <div class="uk-width-1-2"> | |
| 55 | + <div class="uk-form-row"> | |
| 56 | + <label class="uk-form-label">公里数</label> | |
| 57 | + <div class="uk-form-controls"> | |
| 58 | + <input class="form-control" name="mileage" max=222 data-fv-lessthan-inclusive="false" required> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + | |
| 64 | + <div class="uk-grid"> | |
| 65 | + <div class="uk-width-1-2"> | |
| 66 | + <div class="uk-form-row"> | |
| 67 | + <label class="uk-form-label">开始时间</label> | |
| 68 | + <div class="uk-form-controls"> | |
| 69 | + <input name="startDate" value="{{sch.fcsj}}" type="time" required> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + <div class="uk-width-1-2"> | |
| 74 | + <div class="uk-form-row"> | |
| 75 | + <label class="uk-form-label">结束时间</label> | |
| 76 | + <div class="uk-form-controls"> | |
| 77 | + <input name="endDate" value="{{sch.zdsj}}" type="time" required> | |
| 78 | + </div> | |
| 79 | + </div> | |
| 80 | + </div> | |
| 81 | + </div> | |
| 82 | + | |
| 83 | + <div class="uk-grid"> | |
| 84 | + <div class="uk-width-1-2"> | |
| 85 | + <div class="uk-form-row" style="padding-top: 5px;"> | |
| 86 | + <label class="uk-form-label"></label> | |
| 87 | + <div class="uk-form-controls"> | |
| 88 | + <label> | |
| 89 | + <input type="checkbox" value=1 name="destroy" class="i-cbox"> 是否烂班 | |
| 90 | + </label> | |
| 91 | + </div> | |
| 92 | + </div> | |
| 93 | + </div> | |
| 94 | + <div class="uk-width-1-2 destroy_reason_wrap" style="display: none;"> | |
| 95 | + <div class="uk-form-row"> | |
| 96 | + <label class="uk-form-label">烂班原因</label> | |
| 97 | + <div class="uk-form-controls"> | |
| 98 | + <select class="form-control" name="destroyReason" > | |
| 99 | + <option value="">请选择...</option> | |
| 100 | + {{each adjustExps as exp i}} | |
| 101 | + <option value="{{exp}}">{{exp}}</option> | |
| 102 | + {{/each}} | |
| 103 | + </select> | |
| 104 | + </div> | |
| 105 | + </div> | |
| 106 | + </div> | |
| 107 | + </div> | |
| 108 | + | |
| 109 | + <div class="uk-grid"> | |
| 110 | + <div class="uk-width-1-1"> | |
| 111 | + <div class="uk-form-row ct-stacked"> | |
| 112 | + <div class="uk-form-controls" style="margin-top: 5px;"> | |
| 113 | + <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="50" placeholder="备注,不超过50个字符"></textarea> | |
| 114 | + </div> | |
| 115 | + </div> | |
| 116 | + </div> | |
| 117 | + </div> | |
| 118 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 119 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 120 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 121 | + </div> | |
| 122 | + </script> | |
| 123 | + | |
| 124 | + <script> | |
| 125 | + (function() { | |
| 126 | + var modal = '#add-sub-task-other-modal', | |
| 127 | + sch, stationRoutes, parks; | |
| 128 | + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; | |
| 129 | + $(modal).on('init', function(e, data) { | |
| 130 | + sch = data.sch; | |
| 131 | + var formHtml = template('sub-task-other-form-temp', {sch:sch, adjustExps: adjustExps}); | |
| 132 | + $('form', modal).html(formHtml); | |
| 133 | + //字典转换 | |
| 134 | + dictionaryUtils.transformDom($('.nt-dictionary', modal)); | |
| 135 | + | |
| 136 | + //----------- Autocomplete -------------- | |
| 137 | + $.get('/basic/cars', function(rs) { | |
| 138 | + //车辆 | |
| 139 | + gb_common.carAutocomplete($('.car-autocom', modal), rs); | |
| 140 | + }); | |
| 141 | + $.get('/basic/personnel', function(rs) { | |
| 142 | + //驾驶员 | |
| 143 | + gb_common.personAutocomplete($('.jsy-autocom', modal), rs.jsy); | |
| 144 | + //售票员 | |
| 145 | + gb_common.personAutocomplete($('.spy-autocom', modal), rs.spy); | |
| 146 | + }); | |
| 147 | + | |
| 148 | + //站点路由 | |
| 149 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function(a, b){ | |
| 150 | + return a.stationRouteCode-b.stationRouteCode; | |
| 151 | + }), 'directions'); | |
| 152 | + //停车场 | |
| 153 | + $.get('/basic/parks', function(rs){ | |
| 154 | + parks=rs; | |
| 155 | + }); | |
| 156 | + | |
| 157 | + //submit | |
| 158 | + var f = $('form', modal).formValidation(gb_form_validation_opts); | |
| 159 | + f.on('success.form.fv', function(e) { | |
| 160 | + e.preventDefault(); | |
| 161 | + var data = $(this).serializeJSON(); | |
| 162 | + | |
| 163 | + gb_common.$post('/childTask', data, function(rs){ | |
| 164 | + notify_succ('子任务添加成功'); | |
| 165 | + gb_schedule_table.updateSchedule(rs.t); | |
| 166 | + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: rs.t}); | |
| 167 | + //$('#schedule-lj_zrw-modal .sub-task-table').trigger('refresh'); | |
| 168 | + UIkit.modal(modal).hide(); | |
| 169 | + }); | |
| 170 | + }); | |
| 171 | + | |
| 172 | + //班次类型 | |
| 173 | + $('[name=type2]', f).on('change', function(){ | |
| 174 | + var routes=stationRoutes[sch.xlDir] | |
| 175 | + ,lastCode=routes[routes.length-1].stationCode | |
| 176 | + ,opts='',park_opts=''; | |
| 177 | + //station options | |
| 178 | + $.each(routes, function(){ | |
| 179 | + opts+='<option value="'+this.stationCode+'">'+this.stationName+'</option>' | |
| 180 | + }); | |
| 181 | + //park options | |
| 182 | + for(var code in parks) | |
| 183 | + park_opts+='<option value="'+code+'">'+parks[code]+'</option>'; | |
| 184 | + | |
| 185 | + var qdz=$('[name=startStation]', f),zdz=$('[name=endStation]', f); | |
| 186 | + switch ($(this).val()) { | |
| 187 | + case '3'://出场 | |
| 188 | + qdz.html(park_opts); | |
| 189 | + zdz.html(opts); | |
| 190 | + break; | |
| 191 | + case '2'://进场 | |
| 192 | + qdz.html(opts); | |
| 193 | + zdz.html(park_opts); | |
| 194 | + break; | |
| 195 | + default: | |
| 196 | + qdz.html(opts); | |
| 197 | + zdz.html(opts).val(lastCode); | |
| 198 | + } | |
| 199 | + }); | |
| 200 | + | |
| 201 | + //是否烂班 | |
| 202 | + $('[name=destroy]', f).on('click', function(){ | |
| 203 | + console.log(this, this.checked); | |
| 204 | + if(this.checked){ | |
| 205 | + $('.destroy_reason_wrap', modal).show(); | |
| 206 | + } | |
| 207 | + else { | |
| 208 | + $('.destroy_reason_wrap', modal).hide(); | |
| 209 | + } | |
| 210 | + }); | |
| 211 | + | |
| 212 | + $('[name=destroyReason]', f).on('change', function(){ | |
| 213 | + var rem=$('[name=remarks]', f); | |
| 214 | + rem.val(rem.val() + $(this).val() + ','); | |
| 215 | + }); | |
| 216 | + }); | |
| 217 | + })(); | |
| 218 | + </script> | |
| 219 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="schedule-tzrc-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 680px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>调整人车</h2></div> | |
| 6 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | |
| 7 | + <form class="uk-form uk-form-horizontal search-form"> | |
| 8 | + <div class="uk-grid"> | |
| 9 | + <div class="uk-width-1-3"> | |
| 10 | + <div class="uk-form-row"> | |
| 11 | + <label class="uk-form-label" style="width: 50px;">线路</label> | |
| 12 | + <div class="uk-form-controls" style="margin-left: 51px;"> | |
| 13 | + <select name="lineSelect"></select> | |
| 14 | + </div> | |
| 15 | + </div> | |
| 16 | + </div> | |
| 17 | + <div class="uk-width-1-3"> | |
| 18 | + <div class="uk-form-row"> | |
| 19 | + <label class="uk-form-label" style="width: 50px;">路牌</label> | |
| 20 | + <div class="uk-form-controls" style="margin-left: 51px;"> | |
| 21 | + <select name="lpName"></select> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + </form> | |
| 27 | + </div> | |
| 28 | + | |
| 29 | + <div class="ct_table_wrap ct_table_no_border tzrc-table-wrap" style="height: 300px;"> | |
| 30 | + <div class="ct_table sch-tzrc-table"> | |
| 31 | + <div class="ct_table_head"> | |
| 32 | + <dl> | |
| 33 | + <dt>时间</dt> | |
| 34 | + <dt>车辆</dt> | |
| 35 | + <dt>驾驶员</dt> | |
| 36 | + <dt>售票员</dt> | |
| 37 | + </dl> | |
| 38 | + </div> | |
| 39 | + <div class="ct_table_body"></div> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + | |
| 43 | + <form class="uk-form uk-form-horizontal tzrc_form" style="padding-top: 20px;border-top: 1px solid whitesmoke;"> | |
| 44 | + <div class="uk-grid"> | |
| 45 | + <div class="uk-width-1-2"> | |
| 46 | + <div class="uk-form-row"> | |
| 47 | + <label class="uk-form-label">车辆</label> | |
| 48 | + <div class="uk-form-controls"> | |
| 49 | + <div class="uk-autocomplete uk-form car-autocom"> | |
| 50 | + <input type="text" value="" name="clZbh" required> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + </div> | |
| 55 | + <div class="uk-width-1-2"> | |
| 56 | + <div class="uk-form-row"> | |
| 57 | + <label class="uk-form-label">驾驶员 <i class="uk-icon-question-circle" data-uk-tooltip title="如果有驾驶员未提示,请至后台“基础信息 -人员信息”里纠正该员工的“工种”类别 "></i></label> | |
| 58 | + <div class="uk-form-controls"> | |
| 59 | + <div class="uk-autocomplete uk-form jsy-autocom"> | |
| 60 | + <input type="text" value="" name="jsy" required> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + </div> | |
| 64 | + </div> | |
| 65 | + </div> | |
| 66 | + <div class="uk-grid"> | |
| 67 | + <div class="uk-width-1-2"> | |
| 68 | + <div class="uk-form-row"> | |
| 69 | + <label class="uk-form-label">售票员</label> | |
| 70 | + <div class="uk-form-controls"> | |
| 71 | + <div class="uk-autocomplete uk-form spy-autocom"> | |
| 72 | + <input type="text" value="" name="spy"> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + </div> | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + <div class="uk-modal-footer uk-text-right" style="margin-bottom: -20px;"> | |
| 79 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 80 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> 保存</button> | |
| 81 | + </div> | |
| 82 | + </form> | |
| 83 | + </div> | |
| 84 | + | |
| 85 | + <script id="schedule-tzrc-table-temp" type="text/html"> | |
| 86 | + {{each list as sch i}} | |
| 87 | + <dl data-id="{{sch.id}}"> | |
| 88 | + <dd> | |
| 89 | + <label> | |
| 90 | + <input {{if sch.fcsjActual!=null}}disabled{{/if}} type="checkbox" value=1 name="schCBox" class="i-cbox" style="margin-top: 0px;"> | |
| 91 | + {{sch.dfsj}} | |
| 92 | + {{if sch.bcType == "out"}} | |
| 93 | + <span class="uk-badge uk-badge-success">出场</span> | |
| 94 | + {{else if sch.bcType == "in"}} | |
| 95 | + <span class="uk-badge uk-badge-warning">进场</span> | |
| 96 | + {{/if}} | |
| 97 | + {{if sch.sflj}} | |
| 98 | + <span class="uk-badge uk-badge-danger">临加</span> | |
| 99 | + {{/if}} | |
| 100 | + {{if sch.cTasks.length > 0}} | |
| 101 | + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | |
| 102 | + {{/if}} | |
| 103 | + </label> | |
| 104 | + </dd> | |
| 105 | + <dd>{{sch.clZbh}}</dd> | |
| 106 | + <dd>{{sch.jGh}}/{{sch.jName}}</dd> | |
| 107 | + <dd>{{sch.sGh}}/{{sch.sName}}</dddd> | |
| 108 | + </dl> | |
| 109 | + {{/each}} | |
| 110 | + </script> | |
| 111 | + <script> | |
| 112 | + (function() { | |
| 113 | + var modal = '#schedule-tzrc-modal', | |
| 114 | + sch, schList, lp2SchMap; | |
| 115 | + $(modal).on('init', function(e, data) { | |
| 116 | + sch = data.sch; | |
| 117 | + | |
| 118 | + //线路下拉框 | |
| 119 | + var opts = ''; | |
| 120 | + $.each(gb_data_basic.activeLines, function() { | |
| 121 | + opts += '<option value="' + this.lineCode + '">' + this.name + '</option>'; | |
| 122 | + }); | |
| 123 | + $('[name=lineSelect]', modal).html(opts) | |
| 124 | + .on('change', function() { | |
| 125 | + var lineCode = $(this).val(); | |
| 126 | + schList = gb_schedule_table.findScheduleByLine(lineCode); | |
| 127 | + lp2SchMap = gb_common.groupBy(schList, 'lpName'); | |
| 128 | + | |
| 129 | + var opts = ''; | |
| 130 | + for (var lpName in lp2SchMap) | |
| 131 | + opts += '<option value="' + lpName + '">' + lpName + '</option>'; | |
| 132 | + $('[name=lpName]', modal).html(opts).trigger('change'); | |
| 133 | + }); | |
| 134 | + | |
| 135 | + //路牌下拉框 | |
| 136 | + $('[name=lpName]', modal).on('change', function() { | |
| 137 | + var list = lp2SchMap[$(this).val()].sort(gb_schedule_table.schedule_sort), | |
| 138 | + htmlBody = template('schedule-tzrc-table-temp', { | |
| 139 | + list: list | |
| 140 | + }); | |
| 141 | + $('.sch-tzrc-table .ct_table_body', modal).html(htmlBody); | |
| 142 | + }); | |
| 143 | + | |
| 144 | + $(modal).on('click', '.sch-tzrc-table .ct_table_body dl input[type=checkbox]', function() { | |
| 145 | + if ($(this).attr('disabled')) return; | |
| 146 | + var dl = $(this).parents('dl'); | |
| 147 | + if (this.checked) { | |
| 148 | + dl.addClass('active'); | |
| 149 | + var lineCode = $('[name=lineSelect]', modal).val(); | |
| 150 | + var sch = gb_schedule_table.findScheduleByLine(lineCode)[dl.data('id')]; | |
| 151 | + | |
| 152 | + writeSch2Form(sch); | |
| 153 | + } else | |
| 154 | + dl.removeClass('active'); | |
| 155 | + }); | |
| 156 | + | |
| 157 | + //----------- Autocomplete -------------- | |
| 158 | + $.get('/basic/cars', function(rs) { | |
| 159 | + //车辆 | |
| 160 | + gb_common.carAutocomplete($('.car-autocom', modal), rs); | |
| 161 | + }); | |
| 162 | + $.get('/basic/personnel', function(rs) { | |
| 163 | + //驾驶员 | |
| 164 | + gb_common.personAutocomplete($('.jsy-autocom', modal), rs.jsy); | |
| 165 | + //售票员 | |
| 166 | + gb_common.personAutocomplete($('.spy-autocom', modal), rs.spy); | |
| 167 | + }); | |
| 168 | + | |
| 169 | + //默认选中项 | |
| 170 | + $('[name=lineSelect]', modal).val(sch.xlBm).trigger('change'); | |
| 171 | + $('[name=lpName]', modal).val(sch.lpName).trigger('change'); | |
| 172 | + var dl = $('.sch-tzrc-table', modal).find('dl[data-id=' + sch.id + ']'); | |
| 173 | + $('input[type=checkbox]', dl).trigger('click'); | |
| 174 | + | |
| 175 | + //滚动到可视区域 | |
| 176 | + var cont = $('.tzrc-table-wrap', modal); | |
| 177 | + cont.animate({ | |
| 178 | + scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - 38 | |
| 179 | + }, 500); | |
| 180 | + | |
| 181 | + gb_ct_table.fixedHead($('.ct_table_wrap', modal)); | |
| 182 | + | |
| 183 | + //submit | |
| 184 | + var f = $('form.tzrc_form', modal).formValidation(gb_form_validation_opts); | |
| 185 | + f.on('success.form.fv', function(e) { | |
| 186 | + e.preventDefault(); | |
| 187 | + var param = $(this).serializeJSON(); | |
| 188 | + var data = []; | |
| 189 | + var checkeds = $('.sch-tzrc-table input[type=checkbox]:checked', modal); | |
| 190 | + if (checkeds.length == 0) | |
| 191 | + return notify_err('请选中要调整的班次'); | |
| 192 | + | |
| 193 | + var schId; | |
| 194 | + $.each(checkeds, function() { | |
| 195 | + schId = $(this).parents('dl').data('id'); | |
| 196 | + data.push({ | |
| 197 | + schId: schId, | |
| 198 | + jsy: param.jsy, | |
| 199 | + spy: param.spy, | |
| 200 | + clZbh: param.clZbh | |
| 201 | + }); | |
| 202 | + }); | |
| 203 | + gb_common.$post('/realSchedule/multi_tzrc', { | |
| 204 | + cpcsJson: JSON.stringify(data) | |
| 205 | + }, function(rs) { | |
| 206 | + if(rs.ts && rs.ts.length > 0){ | |
| 207 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 208 | + UIkit.modal(modal).hide(); | |
| 209 | + notify_succ('调整人车成功'); | |
| 210 | + } | |
| 211 | + }); | |
| 212 | + }); | |
| 213 | + }); | |
| 214 | + | |
| 215 | + function writeSch2Form(sch) { | |
| 216 | + var f = $('.tzrc_form', modal); | |
| 217 | + $('input[name=clZbh]', f).val(sch.clZbh).trigger('input'); | |
| 218 | + $('input[name=jsy]', f).val(sch.jGh + '/' + sch.jName).trigger('input'); | |
| 219 | + if (sch.sGh) | |
| 220 | + $('input[name=spy]', f).val(sch.sGh + '/' + sch.sName); | |
| 221 | + } | |
| 222 | + })(); | |
| 223 | + </script> | |
| 224 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/layout.html
0 → 100644
| 1 | +<div> | |
| 2 | + <!-- line schedule tab body layout template --> | |
| 3 | + <script id="cont-line-layout-temp" type="text/html"> | |
| 4 | + <div class="uk-grid top-container"> | |
| 5 | + <div class="uk-width-5-6 uk-grid schedule-wrap" > | |
| 6 | + <div class="uk-width-1-2"> | |
| 7 | + <div class="card-panel"></div> | |
| 8 | + </div> | |
| 9 | + | |
| 10 | + <div class="uk-width-1-2"> | |
| 11 | + <div class="card-panel"></div> | |
| 12 | + </div> | |
| 13 | + </div> | |
| 14 | + <div class="uk-width-1-6" style="height: calc(100% - 1px);"> | |
| 15 | + <div class="card-panel sys-mailbox" style="overflow: auto;"> | |
| 16 | + | |
| 17 | + </div> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + | |
| 21 | + <div class="footer-chart"> | |
| 22 | + <div class="card-panel"> | |
| 23 | + <div class="svg-wrap"></div> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + </script> | |
| 27 | + </div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
0 → 100644
| 1 | +<div> | |
| 2 | + <script id="line-schedule-table-temp" type="text/html"> | |
| 3 | + <div class="schedule-wrap {{if dir==0}}up{{else}}down{{/if}}"> | |
| 4 | + <h3 class="header-title">上行/江月路地铁站</h3> | |
| 5 | + <div class="schedule-body"> | |
| 6 | + <div class="ct_table_wrap"> | |
| 7 | + <div class="ct_table line-schedule-table"> | |
| 8 | + <div class="ct_table_head"> | |
| 9 | + <dl> | |
| 10 | + <dt>序号</dt> | |
| 11 | + <dt>路牌</dt> | |
| 12 | + <dt>车辆</dt> | |
| 13 | + <dt>应到</dt> | |
| 14 | + <dt>实到</dt> | |
| 15 | + <dt sort-field>计发</dt> | |
| 16 | + <dt sort-field>待发</dt> | |
| 17 | + <dt>实发</dt> | |
| 18 | + <dt>原因</dt> | |
| 19 | + </dl> | |
| 20 | + </div> | |
| 21 | + <div class="ct_table_body"> | |
| 22 | + {{each list as sch i}} | |
| 23 | + <dl data-id="{{sch.id}}" > | |
| 24 | + <dd class="seq_no">{{i + 1}}</dd> | |
| 25 | + <dd class="lpName"><a>{{sch.lpName}}</a></dd> | |
| 26 | + <dd data-nbbm="{{sch.clZbh}}">{{sch.clZbh}}</dd> | |
| 27 | + <dd>{{sch.qdzArrDateJH}}</dd> | |
| 28 | + <dd>{{sch.qdzArrDateSJ}}</dd> | |
| 29 | + <dd data-sort-val={{sch.fcsjT}}> | |
| 30 | + {{sch.fcsj}} | |
| 31 | + {{if sch.bcType == "out"}} | |
| 32 | + <span class="uk-badge uk-badge-success">出场</span> | |
| 33 | + {{else if sch.bcType == "in"}} | |
| 34 | + <span class="uk-badge uk-badge-warning">进场</span> | |
| 35 | + {{/if}} | |
| 36 | + {{if sch.sflj}} | |
| 37 | + <span class="uk-badge uk-badge-danger">临加</span> | |
| 38 | + {{/if}} | |
| 39 | + {{if sch.cTasks.length > 0}} | |
| 40 | + <span class="uk-badge uk-badge-notification">{{sch.cTasks.length}}</span> | |
| 41 | + {{/if}} | |
| 42 | + </dd> | |
| 43 | + <dd data-sort-val={{sch.dfsjT}} dbclick dbclick-type="dfsj" dbclick-val="{{sch.dfsj}}">{{sch.dfsj}}</dd> | |
| 44 | + <dd class=" | |
| 45 | + {{if sch.status==-1}} | |
| 46 | + tl-qrlb | |
| 47 | + {{else if sch.status==2}} | |
| 48 | + tl-yzx | |
| 49 | + {{else if sch.status==1}} | |
| 50 | + tl-zzzx | |
| 51 | + {{/if}}"> | |
| 52 | + {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> | |
| 53 | + </dd> | |
| 54 | + <dd data-uk-observe> | |
| 55 | + <span title="{{sch.remarks}}" data-uk-tooltip>{{sch.remarks}}</span> | |
| 56 | + </dd> | |
| 57 | + </dl> | |
| 58 | + {{/each}} | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + </div> | |
| 64 | +</script> | |
| 65 | + | |
| 66 | +<script id="line-schedule-fcsj-temp" type="text/html"> | |
| 67 | + <dd data-sort-val={{fcsjT}}> | |
| 68 | + {{fcsj}} | |
| 69 | + {{if bcType == "out"}} | |
| 70 | + <span class="uk-badge uk-badge-success">出场</span> | |
| 71 | + {{else if bcType == "in"}} | |
| 72 | + <span class="uk-badge uk-badge-warning">进场</span> | |
| 73 | + {{/if}} | |
| 74 | + {{if sflj}} | |
| 75 | + <span class="uk-badge uk-badge-danger">临加</span> | |
| 76 | + {{/if}} | |
| 77 | + {{if cTasks.length > 0}} | |
| 78 | + <span class="uk-badge uk-badge-notification">{{cTasks.length}}</span> | |
| 79 | + {{/if}} | |
| 80 | + </dd> | |
| 81 | +</script> | |
| 82 | + | |
| 83 | +<script id="line-schedule-sfsj-temp" type="text/html"> | |
| 84 | +<dd class=" | |
| 85 | + {{if status==-1}} | |
| 86 | + tl-qrlb | |
| 87 | + {{else if status==2}} | |
| 88 | + tl-yzx | |
| 89 | + {{else if status==1}} | |
| 90 | + tl-zzzx | |
| 91 | + {{/if}}"> | |
| 92 | + {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> | |
| 93 | +</dd> | |
| 94 | +</script> | |
| 95 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/sys_mailbox.html
0 → 100644
| 1 | +<div> | |
| 2 | + <script id="sys-note-80-temp" type="text/html"> | |
| 3 | + <div class="uk-width-medium-1-1 sys-note-80" data-id={{id}}> | |
| 4 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | |
| 5 | + <h4 class="uk-panel-title">{{data.nbbm}} {{text}}</h4> | |
| 6 | + <code>{{dateStr}}</code> | |
| 7 | + <div class="uk-button-group"> | |
| 8 | + <a class="uk-button uk-button-mini uk-button-primary">同意</a> | |
| 9 | + <a class="uk-button uk-button-mini">不同意</a> | |
| 10 | + </div> | |
| 11 | + </div> | |
| 12 | + </div> | |
| 13 | + </script> | |
| 14 | + | |
| 15 | + <script id="sys-note-42-temp" type="text/html"> | |
| 16 | + <div class="uk-width-medium-1-1 sys-note-42" id="{{domId}}"> | |
| 17 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | |
| 18 | + <h5 class="title"> | |
| 19 | + {{t.fcsjActual}} {{t.clZbh}} 已由 {{t.qdzName}} 发出 | |
| 20 | + </h5> | |
| 21 | + <code>{{dataStr}}</code> | |
| 22 | + <div class="uk-button-group"> | |
| 23 | + <a class="uk-button uk-button-mini uk-button-primary" >确定</a> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + </script> | |
| 27 | + | |
| 28 | + <script id="sys-note-42_1-temp" type="text/html"> | |
| 29 | + <div class="uk-width-medium-1-1 sys-note-42" id="{{domId}}"> | |
| 30 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | |
| 31 | + <h5 class="title"> | |
| 32 | + {{t.zdsjActual}} {{t.clZbh}} 到达 {{t.zdzName}};已完成 {{finish}} 个班次; | |
| 33 | + {{if nt != null}} | |
| 34 | + 下一发车时间 {{nt.dfsj}};由{{nt.qdzName}} 发往 {{nt.zdzName}};应到{{nt.zdsj}} | |
| 35 | + {{else}} | |
| 36 | + 已完成当日所有班次。 | |
| 37 | + {{/if}} | |
| 38 | + </h5> | |
| 39 | + <code>{{dataStr}}</code> | |
| 40 | + <div class="uk-button-group"> | |
| 41 | + <a class="uk-button uk-button-mini uk-button-primary" >确定</a> | |
| 42 | + </div> | |
| 43 | + </div> | |
| 44 | + </div> | |
| 45 | + </script> | |
| 46 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/tabs.html
| 1 | 1 | <div> |
| 2 | 2 | <script id="north-tabs-temp" type="text/html"> |
| 3 | - <ul class="uk-tab" data-uk-tab="{connect:'#main-tab-content', animation: 'fade'}"> | |
| 3 | + <ul class="uk-tab" data-uk-tab="{connect:'#main-tab-content'}"> | |
| 4 | 4 | <li class="uk-active" ><a>主页</a></li> |
| 5 | 5 | <li class=""><a>地图</a></li> |
| 6 | 6 | {{each list as line i}} |
| ... | ... | @@ -10,11 +10,11 @@ |
| 10 | 10 | </script> |
| 11 | 11 | |
| 12 | 12 | <script id="north-tab-content-temp" type="text/html"> |
| 13 | - <ul id="main-tab-content" class="uk-switcher uk-margin"> | |
| 13 | + <ul id="main-tab-content" class="uk-switcher uk-margin "> | |
| 14 | 14 | <li class="uk-active home-panel">主页</li> |
| 15 | 15 | <li class="map-panel">地图</li> |
| 16 | 16 | {{each list as line i}} |
| 17 | - <li class="">{{line.name}}</li> | |
| 17 | + <li class="line_schedule" data-id="{{line.lineCode}}">{{line.name}}</li> | |
| 18 | 18 | {{/each}} |
| 19 | 19 | </ul> |
| 20 | 20 | </script> | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | </a> |
| 8 | 8 | <ul class="uk-navbar-nav"> |
| 9 | 9 | {{each list as obj i}} |
| 10 | - <li class="uk-parent" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false"> | |
| 10 | + <li class="uk-parent {{obj.disabled}}" data-uk-dropdown="" aria-haspopup="true" aria-expanded="false"> | |
| 11 | 11 | <a>{{obj.text}} <i class="uk-icon-caret-down"></i></a> |
| 12 | 12 | <div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" style="top: 40px; left: 0px;"> |
| 13 | 13 | <ul class="uk-nav uk-nav-navbar"> |
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | {{else if c.divider}} |
| 19 | 19 | <li class="uk-nav-divider"></li> |
| 20 | 20 | {{else}} |
| 21 | - <li class="event"><a data-event="{{c.event}}">{{c.text}}</a></li> | |
| 21 | + <li class="event {{obj.disabled}}"><a data-event="{{c.event}}">{{c.text}}</a></li> | |
| 22 | 22 | {{/if}} |
| 23 | 23 | {{/each}} |
| 24 | 24 | </ul> |
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | </ul> |
| 29 | 29 | <div class="uk-navbar-content uk-navbar-flip uk-hidden-small"> |
| 30 | 30 | <div class="uk-button-group"> |
| 31 | - <button class="uk-button uk-button-danger">退出线调</button> | |
| 31 | + <button class="uk-button uk-button-danger exit-system">退出线调</button> | |
| 32 | 32 | </div> |
| 33 | 33 | </div> |
| 34 | 34 | </nav> | ... | ... |
src/main/resources/static/real_control_v2/js/common.js
| 1 | 1 | var gb_common = (function() { |
| 2 | 2 | |
| 3 | + var reqCode80 = {0xA1: '请求恢复运营', 0xA2: '申请调档', 0xA3: '出场请求', 0xA5: '进场请求', 0xA7: '加油请求', 0x50: '车辆故障', 0x70: '路阻报告', 0x60: '事故报告', 0x11: '扣证纠纷', 0x12 : '报警'}; | |
| 4 | + | |
| 3 | 5 | var groupBy = function(list, field) { |
| 4 | 6 | var rs = {}, |
| 5 | 7 | key; |
| ... | ... | @@ -14,13 +16,13 @@ var gb_common = (function() { |
| 14 | 16 | return rs; |
| 15 | 17 | } |
| 16 | 18 | |
| 17 | - var compileTempByDom = function(dom) { | |
| 19 | + var compileTempByDom = function(dom, opts) { | |
| 18 | 20 | var tps = {}, |
| 19 | 21 | id; |
| 20 | 22 | $('script[type="text/html"]', dom).each(function() { |
| 21 | 23 | id = $(this).attr('id'); |
| 22 | 24 | if (id) |
| 23 | - tps[id] = template.compile($(this).html()); | |
| 25 | + tps[id] = template.compile($(this).html(), opts); | |
| 24 | 26 | }); |
| 25 | 27 | return tps; |
| 26 | 28 | } |
| ... | ... | @@ -46,11 +48,30 @@ var gb_common = (function() { |
| 46 | 48 | }); |
| 47 | 49 | } |
| 48 | 50 | |
| 51 | + var $post_arr = function(url, data, successFun) { | |
| 52 | + $.ajax({ | |
| 53 | + url: url, | |
| 54 | + method: 'POST', | |
| 55 | + traditional: true, | |
| 56 | + data: data, | |
| 57 | + complete: function(xhr, ts) { | |
| 58 | + ajaxComplete(xhr, ts, successFun); | |
| 59 | + } | |
| 60 | + }); | |
| 61 | + } | |
| 62 | + | |
| 63 | + var $del = function(url, successFun){ | |
| 64 | + $post(url, {'_method': 'delete'},function(rs){ | |
| 65 | + successFun && successFun(rs); | |
| 66 | + }); | |
| 67 | + } | |
| 68 | + | |
| 69 | + var errorHead='<span style="color:red;">服务器出现异常:</span>'; | |
| 49 | 70 | function successHandle(json, handle) { |
| 50 | 71 | var status = json.status; |
| 51 | 72 | if (status == 407) { |
| 52 | 73 | alert('被注销的登录'); |
| 53 | - location.reload(true); | |
| 74 | + location.href = '/'; | |
| 54 | 75 | return; |
| 55 | 76 | } |
| 56 | 77 | |
| ... | ... | @@ -60,7 +81,7 @@ var gb_common = (function() { |
| 60 | 81 | } |
| 61 | 82 | |
| 62 | 83 | if (status == 'ERROR') |
| 63 | - UIkit.modal.alert('服务器出现异常: ' + (json.msg ? json.msg : '未知异常')); | |
| 84 | + UIkit.modal.alert(errorHead+ (json.msg ? json.msg : '未知异常'), {labels:{Ok: '确定'}}); | |
| 64 | 85 | else |
| 65 | 86 | handle && handle(json); |
| 66 | 87 | } |
| ... | ... | @@ -69,10 +90,7 @@ var gb_common = (function() { |
| 69 | 90 | if (ts == 'success') { |
| 70 | 91 | successHandle(JSON.parse(xhr.responseText), succ); |
| 71 | 92 | } else if (ts == 'error') { |
| 72 | - layer.alert(xhr.responseText, { | |
| 73 | - icon: 2, | |
| 74 | - title: '操作失败' | |
| 75 | - }); | |
| 93 | + UIkit.modal.alert(errorHead + xhr.responseText, {labels:{Ok: '确定'}}); | |
| 76 | 94 | } |
| 77 | 95 | } |
| 78 | 96 | |
| ... | ... | @@ -85,12 +103,12 @@ var gb_common = (function() { |
| 85 | 103 | return array; |
| 86 | 104 | } |
| 87 | 105 | |
| 88 | - var get_keys = function(json){ | |
| 89 | - var array = []; | |
| 90 | - for (var key in json) { | |
| 91 | - array.push(key); | |
| 92 | - } | |
| 93 | - return array; | |
| 106 | + var get_keys = function(json) { | |
| 107 | + var array = []; | |
| 108 | + for (var key in json) { | |
| 109 | + array.push(key); | |
| 110 | + } | |
| 111 | + return array; | |
| 94 | 112 | } |
| 95 | 113 | |
| 96 | 114 | var get_device_tree_data = function() { |
| ... | ... | @@ -102,12 +120,21 @@ var gb_common = (function() { |
| 102 | 120 | data[name] = groupBy(data[code], 'upDown'); |
| 103 | 121 | treeData.push({ |
| 104 | 122 | 'text': name, |
| 123 | + 'a_attr':{'type': 'line'}, | |
| 105 | 124 | 'children': [{ |
| 106 | 125 | 'text': '上行', |
| 107 | - 'children': grabs(data[name][0]) | |
| 126 | + 'children': grabs(data[name][0]), | |
| 127 | + 'a_attr': { | |
| 128 | + 'type': 'route', | |
| 129 | + 'route': code+'_0' | |
| 130 | + } | |
| 108 | 131 | }, { |
| 109 | 132 | 'text': '下行', |
| 110 | - 'children': grabs(data[name][1]) | |
| 133 | + 'children': grabs(data[name][1]), | |
| 134 | + 'a_attr': { | |
| 135 | + 'type': 'route', | |
| 136 | + 'route': code+'_1' | |
| 137 | + } | |
| 111 | 138 | }] |
| 112 | 139 | }); |
| 113 | 140 | } |
| ... | ... | @@ -120,7 +147,8 @@ var gb_common = (function() { |
| 120 | 147 | rs.push({ |
| 121 | 148 | 'text': this.nbbm, |
| 122 | 149 | 'a_attr': { |
| 123 | - 'type': 'device' | |
| 150 | + 'type': 'device', | |
| 151 | + 'device': this.deviceId | |
| 124 | 152 | }, |
| 125 | 153 | 'icon': 'uk-icon-bus' |
| 126 | 154 | }); |
| ... | ... | @@ -145,7 +173,33 @@ var gb_common = (function() { |
| 145 | 173 | camelChars: pinyin.getCamelChars(name) |
| 146 | 174 | }); |
| 147 | 175 | } |
| 176 | + init_autocom_pinyin(element, data); | |
| 177 | + }; | |
| 148 | 178 | |
| 179 | + var personAutocomplete = function(element, personList) { | |
| 180 | + var data = [],name; | |
| 181 | + $.each(personList, function(){ | |
| 182 | + name=this.personnelName; | |
| 183 | + data.push({ | |
| 184 | + value: this.jobCode+'/'+name, | |
| 185 | + fullChars: pinyin.getFullChars(name).toUpperCase(), | |
| 186 | + camelChars: pinyin.getCamelChars(name), | |
| 187 | + brancheCompany: this.brancheCompany | |
| 188 | + }); | |
| 189 | + }); | |
| 190 | + console.log('data', data); | |
| 191 | + init_autocom_pinyin(element, data); | |
| 192 | + }; | |
| 193 | + | |
| 194 | + var carAutocomplete=function(element, list){ | |
| 195 | + var data = []; | |
| 196 | + $.each(list, function(){ | |
| 197 | + data.push({value: this}); | |
| 198 | + }); | |
| 199 | + init_autocomplete(element, data); | |
| 200 | + } | |
| 201 | + | |
| 202 | + var init_autocom_pinyin=function(element, data){ | |
| 149 | 203 | // init autocomplete |
| 150 | 204 | var autocomplete = UIkit.autocomplete(element, { |
| 151 | 205 | minLength: 1, |
| ... | ... | @@ -156,27 +210,74 @@ var gb_common = (function() { |
| 156 | 210 | count = 0; |
| 157 | 211 | |
| 158 | 212 | $.each(data, function() { |
| 159 | - if (this.value.indexOf(q) != -1 || this.fullChars.indexOf(q) != -1 || this.camelChars.indexOf(q) != -1) | |
| 160 | - rs.push(this); | |
| 213 | + if (this.value.indexOf(q) != -1 || this.fullChars.indexOf(q) != -1 || this.camelChars.indexOf(q) != -1){ | |
| 214 | + rs.push(this); | |
| 215 | + count++; | |
| 216 | + } | |
| 161 | 217 | |
| 162 | 218 | if (count >= 10) |
| 163 | 219 | return false; |
| 164 | - count++; | |
| 165 | 220 | }); |
| 166 | 221 | |
| 167 | 222 | release && release(rs); |
| 168 | 223 | } |
| 169 | 224 | }); |
| 170 | - }; | |
| 225 | + } | |
| 226 | + | |
| 227 | + var init_autocomplete=function(element, data){ | |
| 228 | + var autocomplete = UIkit.autocomplete(element, { | |
| 229 | + minLength: 1, | |
| 230 | + delay: 50, | |
| 231 | + source: function(release) { | |
| 232 | + var q = $('input', element).val().toUpperCase(), | |
| 233 | + rs = [], | |
| 234 | + count = 0; | |
| 235 | + | |
| 236 | + $.each(data, function() { | |
| 237 | + if (this.value.indexOf(q) != -1){ | |
| 238 | + rs.push(this); | |
| 239 | + count++; | |
| 240 | + } | |
| 241 | + if (count >= 10) | |
| 242 | + return false; | |
| 243 | + }); | |
| 244 | + release && release(rs); | |
| 245 | + } | |
| 246 | + }); | |
| 247 | + } | |
| 248 | + | |
| 249 | + // function whichTransitionEvent() { | |
| 250 | + // var t; | |
| 251 | + // var el = document.createElement('fakeelement'); | |
| 252 | + // var transitions = { | |
| 253 | + // 'transition': 'transitionend', | |
| 254 | + // 'OTransition': 'oTransitionEnd', | |
| 255 | + // 'MozTransition': 'transitionend', | |
| 256 | + // 'WebkitTransition': 'webkitTransitionEnd', | |
| 257 | + // 'MsTransition': 'msTransitionEnd' | |
| 258 | + // } | |
| 259 | + // for (t in transitions) { | |
| 260 | + // if (el.style[t] !== undefined) { | |
| 261 | + // return transitions[t]; | |
| 262 | + // } | |
| 263 | + // } | |
| 264 | + // } | |
| 171 | 265 | |
| 172 | 266 | return { |
| 267 | + reqCode80: reqCode80, | |
| 173 | 268 | groupBy: groupBy, |
| 174 | 269 | compileTempByDom: compileTempByDom, |
| 175 | 270 | $get: $get, |
| 176 | 271 | $post: $post, |
| 272 | + $post_arr: $post_arr, | |
| 273 | + $del: $del, | |
| 177 | 274 | get_vals: get_vals, |
| 178 | 275 | get_keys: get_keys, |
| 179 | 276 | get_device_tree_data: get_device_tree_data, |
| 180 | - lineAutocomplete: lineAutocomplete | |
| 277 | + lineAutocomplete: lineAutocomplete, | |
| 278 | + personAutocomplete: personAutocomplete, | |
| 279 | + carAutocomplete: carAutocomplete | |
| 280 | + | |
| 281 | + //whichTransitionEvent:whichTransitionEvent | |
| 181 | 282 | }; |
| 182 | 283 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/data/data_gps.js
src/main/resources/static/real_control_v2/js/data/json/back
0 → 100644
| 1 | +[{ | |
| 2 | + "id": 1, | |
| 3 | + "text": "基础数据", | |
| 4 | + "children": [{ | |
| 5 | + "id": 1.1, | |
| 6 | + "text": "线路", | |
| 7 | + "event": "" | |
| 8 | + }, { | |
| 9 | + "id": 1.2, | |
| 10 | + "text": "人员", | |
| 11 | + "event": "" | |
| 12 | + }, { | |
| 13 | + "id": 1.3, | |
| 14 | + "text": "车辆", | |
| 15 | + "event": "" | |
| 16 | + }, { | |
| 17 | + "id": 1.4, | |
| 18 | + "text": "线路配置", | |
| 19 | + "header": true | |
| 20 | + }, { | |
| 21 | + "id": 1.5, | |
| 22 | + "text": "人员配置", | |
| 23 | + "event": "" | |
| 24 | + }, { | |
| 25 | + "id": 1.6, | |
| 26 | + "text": "车辆配置", | |
| 27 | + "event": "" | |
| 28 | + }, { | |
| 29 | + "id": 1.7, | |
| 30 | + "divider": true | |
| 31 | + }, { | |
| 32 | + "id": 1.8, | |
| 33 | + "text": "计划排班", | |
| 34 | + "event": "" | |
| 35 | + }] | |
| 36 | +}, { | |
| 37 | + "id": 2, | |
| 38 | + "text": "车载设备", | |
| 39 | + "children": [{ | |
| 40 | + "id": 2.1, | |
| 41 | + "text": "设备管理", | |
| 42 | + "event": "", | |
| 43 | + "disabled": "disabled" | |
| 44 | + }, { | |
| 45 | + "id": 2.2, | |
| 46 | + "text": "设备上报记录", | |
| 47 | + "event": "device_report", | |
| 48 | + "disabled": "disabled" | |
| 49 | + }, { | |
| 50 | + "id": 2.3, | |
| 51 | + "text": "指令下发记录", | |
| 52 | + "event": "directive_history" | |
| 53 | + }] | |
| 54 | +}, { | |
| 55 | + "id": 3, | |
| 56 | + "text": "系统设置", | |
| 57 | + "children": [{ | |
| 58 | + "id": 3.1, | |
| 59 | + "text": "TTS", | |
| 60 | + "event": "", | |
| 61 | + "disabled": "disabled" | |
| 62 | + }, { | |
| 63 | + "id": 3.2, | |
| 64 | + "text": "更新日志", | |
| 65 | + "event": "", | |
| 66 | + "disabled": "disabled" | |
| 67 | + }] | |
| 68 | +}] | ... | ... |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
| 1 | 1 | [{ |
| 2 | 2 | "id": 1, |
| 3 | - "text": "基础数据", | |
| 4 | - "children": [{ | |
| 5 | - "id": 1.1, | |
| 6 | - "text": "线路", | |
| 7 | - "event": "" | |
| 8 | - }, { | |
| 9 | - "id": 1.2, | |
| 10 | - "text": "人员", | |
| 11 | - "event": "" | |
| 12 | - }, { | |
| 13 | - "id": 1.3, | |
| 14 | - "text": "车辆", | |
| 15 | - "event": "" | |
| 16 | - }, { | |
| 17 | - "id": 1.4, | |
| 18 | - "text": "线路配置", | |
| 19 | - "header": true | |
| 20 | - }, { | |
| 21 | - "id": 1.5, | |
| 22 | - "text": "人员配置", | |
| 23 | - "event": "" | |
| 24 | - }, { | |
| 25 | - "id": 1.6, | |
| 26 | - "text": "车辆配置", | |
| 27 | - "event": "" | |
| 28 | - }, { | |
| 29 | - "id": 1.7, | |
| 30 | - "divider": true | |
| 31 | - }, { | |
| 32 | - "id": 1.8, | |
| 33 | - "text": "计划排班", | |
| 34 | - "event": "" | |
| 35 | - }] | |
| 3 | + "text": "基础数据" | |
| 36 | 4 | }, { |
| 37 | 5 | "id": 2, |
| 38 | 6 | "text": "车载设备", |
| 39 | - "children": [{ | |
| 40 | - "id": 2.1, | |
| 41 | - "text": "设备管理", | |
| 42 | - "event": "" | |
| 43 | - }, { | |
| 44 | - "id": 2.2, | |
| 45 | - "text": "设备上报记录", | |
| 46 | - "event": "device_report" | |
| 47 | - }, { | |
| 7 | + "children": [ | |
| 8 | + { | |
| 48 | 9 | "id": 2.3, |
| 49 | 10 | "text": "指令下发记录", |
| 50 | 11 | "event": "directive_history" |
| 51 | 12 | }] |
| 52 | 13 | }, { |
| 53 | 14 | "id": 3, |
| 54 | - "text": "系统设置", | |
| 55 | - "children": [{ | |
| 56 | - "id": 3.1, | |
| 57 | - "text": "TTS", | |
| 58 | - "event": "" | |
| 59 | - }, { | |
| 60 | - "id": 3.2, | |
| 61 | - "text": "更新日志", | |
| 62 | - "event": "" | |
| 63 | - }] | |
| 15 | + "text": "系统设置" | |
| 64 | 16 | }] | ... | ... |
src/main/resources/static/real_control_v2/js/home/context_menu.js
| ... | ... | @@ -180,7 +180,7 @@ var gb_home_context_menu = (function() { |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | var C0_A3 = function(){ |
| 183 | - | |
| 183 | + open_modal('/real_control_v2/fragments/home/c0_a3.html', {}, {center: false, bgclose: false}); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | var callbackHandler = { |
| ... | ... | @@ -222,10 +222,12 @@ var gb_home_context_menu = (function() { |
| 222 | 222 | }, |
| 223 | 223 | 'sep2': '---------', |
| 224 | 224 | 'C0_A3': { |
| 225 | - name: '设备参数管理' | |
| 225 | + name: '设备参数管理', | |
| 226 | + disabled:true | |
| 226 | 227 | }, |
| 227 | 228 | 'C0_A5': { |
| 228 | - name: '程序更新' | |
| 229 | + name: '程序更新', | |
| 230 | + disabled:true | |
| 229 | 231 | } |
| 230 | 232 | } |
| 231 | 233 | }); | ... | ... |
src/main/resources/static/real_control_v2/js/home/line_panel.js
| ... | ... | @@ -24,7 +24,7 @@ var gb_home_line_panel = (function() { |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | 26 | //fixed table head |
| 27 | - gb_ct_table.fixedHead($('.ct_table_wrap')); | |
| 27 | + gb_ct_table.fixedHead($('.ct_table_wrap', '.home-panel')); | |
| 28 | 28 | |
| 29 | 29 | //register gps refresh event |
| 30 | 30 | gb_data_gps.registerCallback(gps_refresh_event); | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
0 → 100644
| 1 | +/* line schedule table context menu*/ | |
| 2 | + | |
| 3 | +var gb_schedule_context_menu = (function() { | |
| 4 | + | |
| 5 | + var modal_opts = { | |
| 6 | + center: false, | |
| 7 | + bgclose: false | |
| 8 | + }, | |
| 9 | + folder = '/real_control_v2/fragments/line_schedule/context_menu'; | |
| 10 | + var callbackHandler = { | |
| 11 | + dftz: function(sch) { | |
| 12 | + open_modal(folder + '/dftz.html', { | |
| 13 | + sch: sch | |
| 14 | + }, modal_opts); | |
| 15 | + }, | |
| 16 | + multi_tzrc: function(schArray) { | |
| 17 | + open_modal(folder + '/multi_tzrc.html', { | |
| 18 | + list: schArray | |
| 19 | + }, modal_opts); | |
| 20 | + }, | |
| 21 | + multi_dftz: function(schArray) { | |
| 22 | + open_modal(folder + '/multi_dftz.html', { | |
| 23 | + list: schArray | |
| 24 | + }, modal_opts); | |
| 25 | + }, | |
| 26 | + jhlb: function(sch) { | |
| 27 | + open_modal(folder + '/jhlb.html', { | |
| 28 | + sch: sch | |
| 29 | + }, modal_opts); | |
| 30 | + }, | |
| 31 | + cxlb: function(sch) { | |
| 32 | + if (!sch.destroy) | |
| 33 | + return notify_err('烂掉的班次才能执行此操作!'); | |
| 34 | + | |
| 35 | + var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>的烂班设置?</h3>' | |
| 36 | + alt_confirm(content, function() { | |
| 37 | + gb_common.$post('/realSchedule/revokeDestroy', { | |
| 38 | + id: sch.id | |
| 39 | + }, function(rs) { | |
| 40 | + gb_schedule_table.updateSchedule(rs.t); | |
| 41 | + notify_succ('撤销烂班操作成功!'); | |
| 42 | + }); | |
| 43 | + }, '确认撤销'); | |
| 44 | + }, | |
| 45 | + sftz: function(sch) { | |
| 46 | + open_modal(folder + '/sftz.html', { | |
| 47 | + sch: sch | |
| 48 | + }, modal_opts); | |
| 49 | + }, | |
| 50 | + cxsf: function(sch) { | |
| 51 | + if (!sch.fcsjActual) | |
| 52 | + return notify_err('车辆未实发,无法执行该操作!'); | |
| 53 | + | |
| 54 | + var content = '<h3>确定要撤销<span style="color:red;margin: 0 5px;">' + sch.clZbh + '( ' + sch.dfsj + ' )</span>的实发时间?</h3>' | |
| 55 | + alt_confirm(content, function() { | |
| 56 | + gb_common.$post('/realSchedule/revokeRealOutgo', { | |
| 57 | + id: sch.id | |
| 58 | + }, function(rs) { | |
| 59 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 60 | + notify_succ('撤销实发操作成功!'); | |
| 61 | + }); | |
| 62 | + }, '确认撤销实发'); | |
| 63 | + }, | |
| 64 | + fcxxwt: function(sch) { | |
| 65 | + open_modal(folder + '/fcxxwt.html', { | |
| 66 | + sch: sch | |
| 67 | + }, modal_opts); | |
| 68 | + }, | |
| 69 | + lj_zrw: function(sch) { | |
| 70 | + open_modal(folder + '/lj_zrw.html', { | |
| 71 | + sch: sch | |
| 72 | + }, modal_opts); | |
| 73 | + }, | |
| 74 | + tzrc: function(sch) { | |
| 75 | + open_modal(folder + '/tzrc.html', { | |
| 76 | + sch: sch | |
| 77 | + }, modal_opts); | |
| 78 | + }, | |
| 79 | + zlcf: function(sch) { | |
| 80 | + var text = sch.clZbh + '重发调度指令? [路牌: ' + sch.lpName + ' 计划时间:' + sch.fcsj + ' 待发时间:' + sch.dfsj + ']'; | |
| 81 | + alt_confirm(text, function() { | |
| 82 | + //走短语下发 | |
| 83 | + $.post('/directive/dispatch', {id: sch.id}, | |
| 84 | + function(code) { | |
| 85 | + if (code == 0) | |
| 86 | + notify_succ('发送指令成功'); | |
| 87 | + else | |
| 88 | + notify_err('发送指令失败'); | |
| 89 | + }); | |
| 90 | + }, '确定下发指令'); | |
| 91 | + } | |
| 92 | + }; | |
| 93 | + | |
| 94 | + $.contextMenu({ | |
| 95 | + selector: '.line_schedule .ct_table_body dl:not([class="drag-active"])', | |
| 96 | + className: 'schedule-ct-menu', | |
| 97 | + callback: function(key, options) { | |
| 98 | + var $tbody = options.$trigger.parent(), | |
| 99 | + id = $('.context-menu-active', $tbody).data('id'), | |
| 100 | + lineCode = $tbody.parents('li.line_schedule').data('id'), | |
| 101 | + sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 102 | + | |
| 103 | + callbackHandler[key] && callbackHandler[key](sch); | |
| 104 | + }, | |
| 105 | + items: { | |
| 106 | + 'dftz': { | |
| 107 | + name: '待发调整' | |
| 108 | + }, | |
| 109 | + 'sep1': '---------', | |
| 110 | + 'jhlb': { | |
| 111 | + name: '计划烂班' | |
| 112 | + }, | |
| 113 | + 'cxlb': { | |
| 114 | + name: '撤销烂班' | |
| 115 | + }, | |
| 116 | + 'sftz': { | |
| 117 | + name: '实发调整' | |
| 118 | + }, | |
| 119 | + 'cxsf': { | |
| 120 | + name: '撤销实发' | |
| 121 | + }, | |
| 122 | + 'sep2': '---------', | |
| 123 | + 'fcxxwt': { | |
| 124 | + name: '发车信息微调' | |
| 125 | + }, | |
| 126 | + 'lj_zrw': { | |
| 127 | + name: '临加/子任务' | |
| 128 | + }, | |
| 129 | + 'sep4': '---------', | |
| 130 | + 'tzrc': { | |
| 131 | + name: '调整人车' | |
| 132 | + }, | |
| 133 | + 'zlcf': { | |
| 134 | + name: '指令重发' | |
| 135 | + } | |
| 136 | + } | |
| 137 | + }); | |
| 138 | + | |
| 139 | + | |
| 140 | + $.contextMenu({ | |
| 141 | + selector: '.line_schedule .ct_table_body dl.drag-active', | |
| 142 | + className: 'schedule-ct-menu', | |
| 143 | + callback: function(key, options) { | |
| 144 | + var $tbody = options.$trigger.parent(), | |
| 145 | + lineCode = $tbody.parents('li.line_schedule').data('id'), | |
| 146 | + schArray = [], | |
| 147 | + all = gb_schedule_table.findScheduleByLine(lineCode); | |
| 148 | + | |
| 149 | + $tbody.find('dl.drag-active').each(function() { | |
| 150 | + schArray.push(all[$(this).data('id')]); | |
| 151 | + }); | |
| 152 | + | |
| 153 | + callbackHandler[key] && callbackHandler[key](schArray); | |
| 154 | + }, | |
| 155 | + items: { | |
| 156 | + 'multi_dftz': { | |
| 157 | + name: '待发调整' | |
| 158 | + }, | |
| 159 | + 'jgtz': { | |
| 160 | + name: '间隔调整', | |
| 161 | + disabled:true | |
| 162 | + }, | |
| 163 | + 'multi_tzrc': { | |
| 164 | + name: '调整人车' | |
| 165 | + } | |
| 166 | + } | |
| 167 | + }); | |
| 168 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/dbclick.js
0 → 100644
| 1 | +/** schedule table double click event */ | |
| 2 | +var gb_schedule_table_dbclick = (function() { | |
| 3 | + | |
| 4 | + //待发调整 | |
| 5 | + var dftzHandler = function(input) { | |
| 6 | + var val = $(input).val(), | |
| 7 | + $dd = $(input).parent(), | |
| 8 | + id = $(input).parents('dl').data('id'); | |
| 9 | + | |
| 10 | + if (val == '' || $dd.attr('dbclick-val') == val) { | |
| 11 | + $dd.html($dd.attr('dbclick-val')); | |
| 12 | + return; | |
| 13 | + } | |
| 14 | + else { | |
| 15 | + gb_common.$post('/realSchedule/outgoAdjust', { | |
| 16 | + id: id, | |
| 17 | + dfsj: val, | |
| 18 | + remarks: '' | |
| 19 | + }, function(rs) { | |
| 20 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 21 | + notify_succ('待发调整成功!'); | |
| 22 | + }); | |
| 23 | + } | |
| 24 | + } | |
| 25 | + | |
| 26 | + var dbclick_opts = { | |
| 27 | + 'dfsj': { | |
| 28 | + inputType: 'time', | |
| 29 | + submit: dftzHandler | |
| 30 | + } | |
| 31 | + }; | |
| 32 | + | |
| 33 | + //var input = ; | |
| 34 | + var init = function(tbody) { | |
| 35 | + //console.log('gb_schedule_table_dbclick.init...'); | |
| 36 | + $('.line-schedule-table .ct_table_body dd[dbclick]').dblclick(function() { | |
| 37 | + console.log('dblclick...') | |
| 38 | + var val = $(this).attr('dbclick-val'), | |
| 39 | + type = $(this).attr('dbclick-type'); | |
| 40 | + | |
| 41 | + $(this).html('<input required opts_type="' + type + '" type="' + dbclick_opts[type].inputType + '" class="db-input" value="' + val + '">'); | |
| 42 | + | |
| 43 | + //console.log($('input', this)); | |
| 44 | + var $input = $('input', this); | |
| 45 | + $input.focus().on('keyup', inputKeyup) | |
| 46 | + .on('blur', function() { | |
| 47 | + dbclick_opts[type].submit($input); | |
| 48 | + }); | |
| 49 | + }); | |
| 50 | + } | |
| 51 | + | |
| 52 | + var inputKeyup = function(e) { | |
| 53 | + if (e && e.keyCode == 13) { | |
| 54 | + var type = $(this).attr('opts_type'); | |
| 55 | + dbclick_opts[type].submit(this); | |
| 56 | + } | |
| 57 | + } | |
| 58 | + | |
| 59 | + $.contextMenu({ | |
| 60 | + selector: '.line_schedule .ct_table_body input.db-input', | |
| 61 | + className: 'schedule-ct-menu-input', | |
| 62 | + callback: function(key, options) { | |
| 63 | + //callbackHandler[key] && callbackHandler[key](); | |
| 64 | + //if(key == 'cancel') | |
| 65 | + }, | |
| 66 | + items: { | |
| 67 | + 'cancel': { | |
| 68 | + name: '取消', | |
| 69 | + icon: "delete" | |
| 70 | + }, | |
| 71 | + 'save': { | |
| 72 | + name: '保存', | |
| 73 | + icon: "edit" | |
| 74 | + } | |
| 75 | + } | |
| 76 | + }); | |
| 77 | + | |
| 78 | + return { | |
| 79 | + init: init | |
| 80 | + }; | |
| 81 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/layout.js
0 → 100644
| 1 | +/** 单线路调度 布局 */ | |
| 2 | +var gb_line_layout = (function() { | |
| 3 | + | |
| 4 | + var temps; | |
| 5 | + | |
| 6 | + var layout = function(cb) { | |
| 7 | + $.get('/real_control_v2/fragments/line_schedule/layout.html', function(dom) { | |
| 8 | + temps = gb_common.compileTempByDom(dom); | |
| 9 | + | |
| 10 | + var htmlStr = temps['cont-line-layout-temp']({}); | |
| 11 | + | |
| 12 | + $('#main-tab-content .line_schedule').each(function(){ | |
| 13 | + $(this).html(htmlStr); | |
| 14 | + | |
| 15 | + var lineCode=$(this).data('id') | |
| 16 | + ,svgWrap=$('.footer-chart .svg-wrap', this); | |
| 17 | + gb_svg_chart.draw_line(lineCode, svgWrap); | |
| 18 | + //console.log('gb_line_layout...', this); | |
| 19 | + //$('.footer-chart .svg-wrap', this) | |
| 20 | + }); | |
| 21 | + | |
| 22 | + cb && cb(); | |
| 23 | + }); | |
| 24 | + } | |
| 25 | + | |
| 26 | + return { | |
| 27 | + layout: layout | |
| 28 | + }; | |
| 29 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
0 → 100644
| 1 | +/** schedule table */ | |
| 2 | + | |
| 3 | +var gb_schedule_table = (function() { | |
| 4 | + | |
| 5 | + var temps; | |
| 6 | + //线路分组的班次数据 | |
| 7 | + var line2Schedule = {}; | |
| 8 | + | |
| 9 | + var schedule_sort = function(s1, s2) { | |
| 10 | + return s1.dfsjT - s2.dfsjT; | |
| 11 | + } | |
| 12 | + | |
| 13 | + var show = function() { | |
| 14 | + //从服务器获取班次数据 | |
| 15 | + $.get('/realSchedule/lines', { | |
| 16 | + lines: gb_data_basic.line_idx | |
| 17 | + }, function(rs) { | |
| 18 | + for (var lineCode in rs) { | |
| 19 | + //排序 | |
| 20 | + rs[lineCode].sort(schedule_sort); | |
| 21 | + line2Schedule[lineCode] = {}; | |
| 22 | + //calc shift | |
| 23 | + $.each(rs[lineCode], function() { | |
| 24 | + calc_sch_real_shift(this); | |
| 25 | + line2Schedule[lineCode][this.id] = this; | |
| 26 | + }); | |
| 27 | + } | |
| 28 | + ep.emit('data', rs); | |
| 29 | + }); | |
| 30 | + | |
| 31 | + //加载班次表格渲染模板 | |
| 32 | + $.get('/real_control_v2/fragments/line_schedule/sch_table.html', function(dom) { | |
| 33 | + ep.emit('temp', gb_common.compileTempByDom(dom, { | |
| 34 | + compress: true | |
| 35 | + })); | |
| 36 | + }); | |
| 37 | + | |
| 38 | + | |
| 39 | + var ep = EventProxy.create("data", "temp", function(data, temp) { | |
| 40 | + temps = temp; | |
| 41 | + var lineCode, dirData, htmlStr; | |
| 42 | + $('#main-tab-content .line_schedule').each(function() { | |
| 43 | + lineCode = $(this).data('id'); | |
| 44 | + if (arrayIsNull(data[lineCode])) | |
| 45 | + return true; | |
| 46 | + dirData = gb_common.groupBy(data[lineCode], 'xlDir'); | |
| 47 | + for (var upDown in dirData) { | |
| 48 | + htmlStr = temps['line-schedule-table-temp']({ | |
| 49 | + dir: upDown, | |
| 50 | + list: dirData[upDown] | |
| 51 | + }); | |
| 52 | + | |
| 53 | + $('.schedule-wrap .card-panel:eq(' + upDown + ')', this).html(htmlStr); | |
| 54 | + } | |
| 55 | + }); | |
| 56 | + var content = $('.line_schedule .ct_table_wrap'); | |
| 57 | + //fixed table head | |
| 58 | + gb_ct_table.fixedHead(content); | |
| 59 | + //enable sort | |
| 60 | + gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init); | |
| 61 | + //dbclick event | |
| 62 | + gb_schedule_table_dbclick.init(); | |
| 63 | + }); | |
| 64 | + } | |
| 65 | + | |
| 66 | + //重置序号 | |
| 67 | + var reset_seq_no = function(dls) { | |
| 68 | + dls.each(function(i, dl) { | |
| 69 | + $('dd:eq(0)', dl).text(i + 1); | |
| 70 | + }); | |
| 71 | + } | |
| 72 | + | |
| 73 | + //计算实发时间差值 | |
| 74 | + var calc_sch_real_shift = function(sch) { | |
| 75 | + if (sch.fcsjActualTime) { | |
| 76 | + var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60); | |
| 77 | + if (diff > 0) | |
| 78 | + sch.fcsj_diff = '( +' + diff + ' )'; | |
| 79 | + else if (diff < 0) | |
| 80 | + sch.fcsj_diff = '( ' + diff + ' )'; | |
| 81 | + else | |
| 82 | + sch.fcsj_diff = ''; | |
| 83 | + } | |
| 84 | + } | |
| 85 | + | |
| 86 | + function arrayIsNull(array) { | |
| 87 | + return !array || array.length == 0; | |
| 88 | + } | |
| 89 | + | |
| 90 | + var findScheduleByLine = function(lineCode) { | |
| 91 | + return line2Schedule[lineCode]; | |
| 92 | + } | |
| 93 | + | |
| 94 | + //新增一个班次,附带更新的班次 | |
| 95 | + var insertSchedule=function(sch, upArr){ | |
| 96 | + line2Schedule[sch.xlBm][sch.id]=sch; | |
| 97 | + //update | |
| 98 | + if(isArray(upArr)){ | |
| 99 | + $.each(upArr, function(){ | |
| 100 | + line2Schedule[this.xlBm][this.id]=this; | |
| 101 | + }); | |
| 102 | + } | |
| 103 | + | |
| 104 | + //重新渲染表格 | |
| 105 | + var data=gb_common.get_vals(line2Schedule[sch.xlBm]).sort(schedule_sort) | |
| 106 | + ,dirData = gb_common.groupBy(data, 'xlDir') | |
| 107 | + ,tabCont=$('li.line_schedule[data-id='+sch.xlBm+']'); | |
| 108 | + | |
| 109 | + for (var upDown in dirData) { | |
| 110 | + htmlStr = temps['line-schedule-table-temp']({ | |
| 111 | + dir: upDown, | |
| 112 | + list: dirData[upDown] | |
| 113 | + }); | |
| 114 | + $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); | |
| 115 | + } | |
| 116 | + //定位到新添加的班次 | |
| 117 | + scroToDl(sch); | |
| 118 | + } | |
| 119 | + | |
| 120 | + //删除一个班次 | |
| 121 | + var deheteSchedule = function(sch){ | |
| 122 | + sch = line2Schedule[sch.xlBm][sch.id]; | |
| 123 | + if(sch){ | |
| 124 | + var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']') | |
| 125 | + ,dls=dl.parent().find('dl'); | |
| 126 | + delete line2Schedule[sch.xlBm][sch.id]; | |
| 127 | + dl.remove(); | |
| 128 | + reset_seq_no(dls); | |
| 129 | + } | |
| 130 | + } | |
| 131 | + | |
| 132 | + //更新班次 | |
| 133 | + var updateSchedule = function(schArr) { | |
| 134 | + if (!isArray(schArr)) | |
| 135 | + schArr = [schArr]; | |
| 136 | + | |
| 137 | + $.each(schArr, function() { | |
| 138 | + line2Schedule[this.xlBm][this.id] = this; | |
| 139 | + updateDom(this); | |
| 140 | + }); | |
| 141 | + } | |
| 142 | + | |
| 143 | + //update dom | |
| 144 | + var updateDom = function(sch) { | |
| 145 | + if(!sch) return; | |
| 146 | + var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); | |
| 147 | + var dds = $('dd', dl); | |
| 148 | + $(dds[1]).find('a').text(sch.lpName); | |
| 149 | + $(dds[2]).data('nbbm', sch.clZbh).text(sch.clZbh); | |
| 150 | + if (sch.qdzArrDateJH) | |
| 151 | + $(dds[3]).text(sch.qdzArrDateJH); | |
| 152 | + if (sch.qdzArrDateSJ) | |
| 153 | + $(dds[4]).text(sch.qdzArrDateSJ); | |
| 154 | + | |
| 155 | + //计发时间 | |
| 156 | + $(dds[5]).replaceWith(temps['line-schedule-fcsj-temp'](sch)); | |
| 157 | + $(dds[6]).data('sort-val', sch.dfsjT).attr('dbclick-val', sch.dfsj).html(sch.dfsj); | |
| 158 | + | |
| 159 | + //实发时间 | |
| 160 | + calc_sch_real_shift(sch); | |
| 161 | + var sfsjDd = temps['line-schedule-sfsj-temp'](sch); | |
| 162 | + $(dds[7]).replaceWith(sfsjDd); | |
| 163 | + if(sch.remarks) | |
| 164 | + $(dds[8]).html('<span title="'+sch.remarks+'" data-uk-tooltip>'+sch.remarks+'</span>'); | |
| 165 | + } | |
| 166 | + | |
| 167 | + //拖拽选中... | |
| 168 | + var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no'; | |
| 169 | + var drag_strat; | |
| 170 | + $(document).on('mousedown', seq_nos, function(e) { | |
| 171 | + if(e.button != 0) return; | |
| 172 | + var dl = $(this).parent(); | |
| 173 | + if (dl.hasClass('drag-active')) | |
| 174 | + dl.removeClass('drag-active'); | |
| 175 | + else | |
| 176 | + dl.addClass('drag-active'); | |
| 177 | + | |
| 178 | + drag_strat = parseInt($(this).text()) - 1; | |
| 179 | + }).on('mouseup', function() { | |
| 180 | + drag_strat = null; | |
| 181 | + }).on('mouseover', seq_nos, function() { | |
| 182 | + if (drag_strat) { | |
| 183 | + var drag_end = parseInt($(this).text()), | |
| 184 | + dls = $(this).parents('.ct_table_body').find('dl'); | |
| 185 | + | |
| 186 | + reset_drag_active_all(this); | |
| 187 | + if (drag_end - drag_strat <= 1) | |
| 188 | + return; | |
| 189 | + | |
| 190 | + for (var i = drag_strat; i < drag_end; i++) | |
| 191 | + $(dls[i]).addClass('drag-active'); | |
| 192 | + } | |
| 193 | + }).on('click', seq_nos, function() { | |
| 194 | + reset_relevance_active(this); | |
| 195 | + }); | |
| 196 | + //非seq_no 单元格点击 | |
| 197 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function() { | |
| 198 | + reset_drag_active_all(this); | |
| 199 | + //选中相关班次 | |
| 200 | + var id = $(this).parent().data('id'), | |
| 201 | + contWrap = $(this).parents('li.line_schedule'), | |
| 202 | + lineCode = contWrap.data('id'), | |
| 203 | + sch = line2Schedule[lineCode][id], | |
| 204 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function(item) { | |
| 205 | + return item.clZbh == sch.clZbh; | |
| 206 | + }).sort(schedule_sort), | |
| 207 | + nextSch; | |
| 208 | + $.each(schArr, function(i) { | |
| 209 | + $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active'); | |
| 210 | + if (i < schArr.length - 1 && this.id == id) | |
| 211 | + nextSch = schArr[i + 1]; | |
| 212 | + }); | |
| 213 | + | |
| 214 | + if (nextSch.xlDir == sch.xlDir) | |
| 215 | + return; | |
| 216 | + //滚动到下一个班次 | |
| 217 | + scroToDl(nextSch); | |
| 218 | + }); | |
| 219 | + | |
| 220 | + //路牌点击 | |
| 221 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function() { | |
| 222 | + reset_drag_active_all(this); | |
| 223 | + //选中路牌下相关班次 | |
| 224 | + var id = $(this).parent().data('id'), | |
| 225 | + contWrap = $(this).parents('li.line_schedule'), | |
| 226 | + lineCode = contWrap.data('id'), | |
| 227 | + sch = line2Schedule[lineCode][id], | |
| 228 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function(item) { | |
| 229 | + return item.lpName == sch.lpName; | |
| 230 | + }).sort(schedule_sort); | |
| 231 | + $.each(schArr, function(i) { | |
| 232 | + $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active'); | |
| 233 | + }); | |
| 234 | + | |
| 235 | + notify_succ('高亮路牌 ' + sch.lpName); | |
| 236 | + }); | |
| 237 | + | |
| 238 | + //头部点击去掉选中光标 | |
| 239 | + $(document).on('click', '.header-title', function() { | |
| 240 | + // $(this).parents('.schedule-wrap').find('.relevance-active') | |
| 241 | + // .removeClass('relevance-active'); | |
| 242 | + reset_drag_active_all(this); | |
| 243 | + }); | |
| 244 | + | |
| 245 | + var scroToDl = function(sch) { | |
| 246 | + var dl = $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')), | |
| 247 | + cont = dl.parents('.ct_table_wrap'), | |
| 248 | + diff = cont.height() / 2; | |
| 249 | + cont.animate({ | |
| 250 | + scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - diff | |
| 251 | + }, 500); | |
| 252 | + } | |
| 253 | + | |
| 254 | + var reset_drag_active_all = function(dd) { | |
| 255 | + $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); | |
| 256 | + reset_relevance_active(dd); | |
| 257 | + } | |
| 258 | + | |
| 259 | + var reset_relevance_active = function(dd) { | |
| 260 | + $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active'); | |
| 261 | + } | |
| 262 | + | |
| 263 | + return { | |
| 264 | + show: show, | |
| 265 | + findScheduleByLine: findScheduleByLine, | |
| 266 | + updateSchedule: updateSchedule, | |
| 267 | + deheteSchedule: deheteSchedule, | |
| 268 | + insertSchedule: insertSchedule, | |
| 269 | + schedule_sort: schedule_sort | |
| 270 | + }; | |
| 271 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/js/main.js
| ... | ... | @@ -20,18 +20,25 @@ var gb_main_ep = new EventProxy(), |
| 20 | 20 | //home line panel |
| 21 | 21 | eq.once('home-line-panel', function() { |
| 22 | 22 | gb_home_line_panel.init(g_emit('gps-time-refresh')); |
| 23 | - | |
| 24 | - //draw svg | |
| 25 | - // $('.home-line-card', '#home-main-content').each(function(){ | |
| 26 | - // var wrap = $('.svg-chart-wrap', this); | |
| 27 | - // console.log(wrap, wrap.actual('outerWidth'), wrap.actual('outerHeight'), wrap.parent().actual('outerHeight')); | |
| 28 | - // }); | |
| 29 | - //gb_svg_chart.draw_line(line.lineCode, $('.svg-chart-wrap', this)); | |
| 30 | 23 | }); |
| 31 | 24 | |
| 32 | 25 | //start fixed time refresh |
| 33 | 26 | eq.once('gps-time-refresh', function() { |
| 34 | 27 | gb_data_gps.fixedTimeRefresh(); |
| 28 | + g_emit('line-schedule-layout')(); | |
| 29 | + }); | |
| 30 | + | |
| 31 | + //line schedule layout | |
| 32 | + eq.once('line-schedule-layout', function() { | |
| 33 | + gb_line_layout.layout(g_emit('render-sch-table')); | |
| 34 | + }); | |
| 35 | + | |
| 36 | + //render schedule table | |
| 37 | + eq.once('render-sch-table', function() { | |
| 38 | + gb_schedule_table.show(); | |
| 39 | + | |
| 40 | + //嵌入地图页面 | |
| 41 | + $('li.map-panel','#main-tab-content').load('/real_control_v2/mapmonitor/real_monitor/real.html'); | |
| 35 | 42 | }); |
| 36 | 43 | |
| 37 | 44 | function g_emit(id) { |
| ... | ... | @@ -87,6 +94,23 @@ var notify_err = function(t) { |
| 87 | 94 | }); |
| 88 | 95 | } |
| 89 | 96 | |
| 97 | +var alt_confirm = function(content, succ, okBtn) { | |
| 98 | + var modalEl = UIkit.modal.confirm(content, function() { | |
| 99 | + succ && succ(); | |
| 100 | + modalEl.hide(); | |
| 101 | + }, { | |
| 102 | + labels: { | |
| 103 | + Ok: okBtn, | |
| 104 | + Cancel: '取消' | |
| 105 | + }, | |
| 106 | + center: true | |
| 107 | + }); | |
| 108 | +} | |
| 109 | + | |
| 110 | +var isArray = function(obj) { | |
| 111 | + return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 112 | +} | |
| 113 | + | |
| 90 | 114 | var notify_err_form = function(t, form) { |
| 91 | 115 | $('.uk-alert-danger', form).remove(); |
| 92 | 116 | $('.uk-modal-footer', form).before('<div class="uk-alert uk-alert-danger" data-uk-alert="">' + |
| ... | ... | @@ -97,30 +121,33 @@ var notify_err_form = function(t, form) { |
| 97 | 121 | enable_submit_btn(form); |
| 98 | 122 | } |
| 99 | 123 | |
| 100 | -var enable_submit_btn = function(form){ | |
| 101 | - var subBtn = $('button[type=submit]', form); | |
| 102 | - if(subBtn){ | |
| 103 | - subBtn.removeClass('disabled').removeAttr('disabled'); | |
| 104 | - } | |
| 124 | +var enable_submit_btn = function(form) { | |
| 125 | + var subBtn = $('button[type=submit]', form); | |
| 126 | + if (subBtn) { | |
| 127 | + subBtn.removeClass('disabled').removeAttr('disabled'); | |
| 128 | + } | |
| 105 | 129 | } |
| 106 | 130 | |
| 107 | -var show_modal = function(id, dom){ | |
| 108 | - $(document.body).append(dom); | |
| 109 | - return UIkit.modal(id, {bgclose: false}).show(); | |
| 131 | +var show_modal = function(id, dom) { | |
| 132 | + $(document.body).append(dom); | |
| 133 | + return UIkit.modal(id, { | |
| 134 | + bgclose: false | |
| 135 | + }).show(); | |
| 110 | 136 | } |
| 111 | 137 | |
| 112 | -var open_modal = function(pageUrl, data){ | |
| 113 | - $.get(pageUrl, function(dom){ | |
| 114 | - if(!$(dom).hasClass('uk-modal')){ | |
| 115 | - alert('无效的dom片段!'); | |
| 116 | - return; | |
| 117 | - } | |
| 118 | - var id = '#' + $(dom).attr('id'); | |
| 138 | +var open_modal = function(pageUrl, data, opt) { | |
| 139 | + $.get(pageUrl, function(dom) { | |
| 140 | + if (!$(dom).hasClass('uk-modal')) { | |
| 141 | + alert('无效的dom片段!'); | |
| 142 | + return; | |
| 143 | + } | |
| 144 | + var id = '#' + $(dom).attr('id'); | |
| 119 | 145 | |
| 120 | - $(document.body).append(dom); | |
| 121 | - UIkit.modal(id, {bgclose: false, center:true}).show(); | |
| 146 | + $(document.body).append(dom); | |
| 122 | 147 | |
| 123 | - if(data) | |
| 124 | - $(id).trigger('init', data); | |
| 125 | - }); | |
| 148 | + UIkit.modal(id, opt).show(); | |
| 149 | + | |
| 150 | + if (data) | |
| 151 | + $(id).trigger('init', data); | |
| 152 | + }); | |
| 126 | 153 | } | ... | ... |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| ... | ... | @@ -2,6 +2,8 @@ |
| 2 | 2 | |
| 3 | 3 | var gb_northToolbar = (function() { |
| 4 | 4 | |
| 5 | + var modal_opts={center: true,bgclose: false}; | |
| 6 | + | |
| 5 | 7 | $.get('/real_control_v2/fragments/north/toolbar.html', function(temp){ |
| 6 | 8 | ep.emit("template", temp); |
| 7 | 9 | }); |
| ... | ... | @@ -14,6 +16,14 @@ var gb_northToolbar = (function() { |
| 14 | 16 | var t = $('#north-toolbar-temp', temp).html() |
| 15 | 17 | ,htmlStr = template.render(t)({list: data}); |
| 16 | 18 | $('.north .north-toolbar').html(htmlStr); |
| 19 | + | |
| 20 | + //exit | |
| 21 | + $('.north .north-toolbar .exit-system').on('click', function(){ | |
| 22 | + alert(11); | |
| 23 | + //关闭websocket 连接 | |
| 24 | + gb_sch_websocket.sock.close(); | |
| 25 | + window.location.href='/pages/control/lineallot/allot.html'; | |
| 26 | + }); | |
| 17 | 27 | }); |
| 18 | 28 | |
| 19 | 29 | $(document).on('click', '#north_toolbar_panel li.event a', function(){ |
| ... | ... | @@ -29,7 +39,7 @@ var gb_northToolbar = (function() { |
| 29 | 39 | }); |
| 30 | 40 | }, |
| 31 | 41 | directive_history: function(){ |
| 32 | - open_modal('/real_control_v2/fragments/north/nav/directive_history.html', {}); | |
| 42 | + open_modal('/real_control_v2/fragments/north/nav/directive_history.html', {}, modal_opts); | |
| 33 | 43 | } |
| 34 | 44 | } |
| 35 | 45 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/utils/ct_table.js
| ... | ... | @@ -8,13 +8,59 @@ var gb_ct_table = (function() { |
| 8 | 8 | }); |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | - // //select row | |
| 12 | - // $(document).on('click', '.ct_table .ct_table_body dl', function(){ | |
| 13 | - // $('dl', $(this).parent()).removeClass('ct_row_active'); | |
| 14 | - // $(this).addClass('ct_row_active'); | |
| 15 | - // }); | |
| 11 | + function enableSort(es, before, after) { | |
| 12 | + $('dt[sort-field]', es).each(function() { | |
| 13 | + if ($('i.uk-icon-sort', this).length > 0) | |
| 14 | + return true; | |
| 15 | + | |
| 16 | + $(this).append('<i class="uk-icon-sort"></i>') | |
| 17 | + .on('click', function(){sort(this, before, after);}); | |
| 18 | + }); | |
| 19 | + } | |
| 20 | + | |
| 21 | + var sort = function(field, replaceBefore, replaceAfter) { | |
| 22 | + var index = $(field).index(), | |
| 23 | + $tbody = $(field).parents('.ct_table_head').next('.ct_table_body'), | |
| 24 | + dls = $('dl', $tbody.clone()); | |
| 25 | + | |
| 26 | + //asc, desc | |
| 27 | + var order = toggleOrder(field); | |
| 28 | + | |
| 29 | + dls.sort(function(a, b) { | |
| 30 | + var e1 = $('dd:eq(' + index + ')', a), | |
| 31 | + e2 = $('dd:eq(' + index + ')', b); | |
| 32 | + var a_v = e1.attr('data-sort-val'), | |
| 33 | + b_v = e2.attr('data-sort-val'); | |
| 34 | + if (!a_v) | |
| 35 | + a_v = e1.text(); | |
| 36 | + if (!b_v) | |
| 37 | + b_v = e2.text(); | |
| 38 | + return order == 'asc' ? a_v.localeCompare(b_v) : b_v.localeCompare(a_v); | |
| 39 | + }); | |
| 40 | + | |
| 41 | + replaceBefore && replaceBefore(dls); | |
| 42 | + $tbody.empty().append(dls); | |
| 43 | + //console.log('replaceAfter..', replaceAfter); | |
| 44 | + replaceAfter && replaceAfter($tbody); | |
| 45 | + } | |
| 46 | + | |
| 47 | + function toggleOrder(that) { | |
| 48 | + var order = $(that).data('order'); | |
| 49 | + if(!order) | |
| 50 | + order = 'asc'; | |
| 51 | + else | |
| 52 | + order = (order=='asc' ? 'desc' : 'asc'); | |
| 53 | + | |
| 54 | + //reset other class | |
| 55 | + $('dt[sort-field]>i', $(that).parent()).attr('class', 'uk-icon-sort'); | |
| 56 | + | |
| 57 | + $('i', that).attr('class', 'uk-icon-sort-'+order); | |
| 58 | + $(that).data('order', order); | |
| 59 | + return order; | |
| 60 | + } | |
| 16 | 61 | |
| 17 | 62 | return { |
| 18 | - fixedHead: fixedHead | |
| 63 | + fixedHead: fixedHead, | |
| 64 | + enableSort: enableSort | |
| 19 | 65 | }; |
| 20 | 66 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/utils/svg_chart.js
| ... | ... | @@ -66,15 +66,21 @@ var gb_svg_chart = (function() { |
| 66 | 66 | |
| 67 | 67 | //add svg dom |
| 68 | 68 | var svg = d3.select(wrap[0]).append('svg') |
| 69 | - .classed({'line-chart': true}).attr('data-code', lineCode) | |
| 69 | + .classed({ | |
| 70 | + 'line-chart': true | |
| 71 | + }).attr('data-code', lineCode) | |
| 70 | 72 | .attr('onselectstart', 'return false'); |
| 71 | 73 | |
| 72 | 74 | //add item g |
| 73 | 75 | var items = svg.selectAll('g.item').data(data) |
| 74 | - .enter().append('g').classed({'item': true}); | |
| 76 | + .enter().append('g').classed({ | |
| 77 | + 'item': true | |
| 78 | + }); | |
| 75 | 79 | |
| 76 | 80 | //up station link path |
| 77 | - var p_clzz = {'station_link': true}; | |
| 81 | + var p_clzz = { | |
| 82 | + 'station_link': true | |
| 83 | + }; | |
| 78 | 84 | items.append('path').classed(p_clzz) |
| 79 | 85 | .attr('d', function(d, i) { |
| 80 | 86 | return i < len - 1 ? upLine([i, i + 1]) : ''; |
| ... | ... | @@ -88,7 +94,9 @@ var gb_svg_chart = (function() { |
| 88 | 94 | }); |
| 89 | 95 | |
| 90 | 96 | //up circle |
| 91 | - var c_clzz = {'station_circle': true}; | |
| 97 | + var c_clzz = { | |
| 98 | + 'station_circle': true | |
| 99 | + }; | |
| 92 | 100 | items.append('circle').classed(c_clzz) |
| 93 | 101 | .attr('cx', cx) |
| 94 | 102 | .attr('cy', cy) |
| ... | ... | @@ -126,22 +134,36 @@ var gb_svg_chart = (function() { |
| 126 | 134 | .attr('y', ty); |
| 127 | 135 | |
| 128 | 136 | //gps wrap |
| 129 | - svg.append('g').classed({'gps-wrap': true}); | |
| 137 | + svg.append('g').classed({ | |
| 138 | + 'gps-wrap': true | |
| 139 | + }); | |
| 130 | 140 | //marker clusterer wrap |
| 131 | - svg.append('g').classed({'marker-clusterer': true}); | |
| 141 | + svg.append('g').classed({ | |
| 142 | + 'marker-clusterer': true | |
| 143 | + }); | |
| 132 | 144 | }; |
| 133 | 145 | |
| 134 | 146 | |
| 135 | 147 | // ----- draw gps ------ |
| 136 | 148 | //gps 按线路站点分组后的下标映射 |
| 137 | 149 | var line_gps_index = {}; |
| 138 | - var gx = function(gps) { | |
| 139 | - var circle = $('.station_circle[data-id=' + gps.stopNo + ']'); | |
| 150 | + var get_circle = function(dataId, svg) { | |
| 151 | + var circle = $('.station_circle[data-id=' + dataId + ']', svg); | |
| 152 | + if (circle.length == 0) | |
| 153 | + circle = null; | |
| 154 | + return circle; | |
| 155 | + }, | |
| 156 | + gx = function(gps, svg) { | |
| 157 | + var circle = get_circle(gps.stopNo, svg); | |
| 158 | + if (!circle) return -100; | |
| 159 | + | |
| 140 | 160 | return circle.attr('cx') - 14; |
| 141 | 161 | }, |
| 142 | - gy = function(gps) { | |
| 143 | - var circle = $('.station_circle[data-id=' + gps.stopNo + ']'), | |
| 144 | - cy = parseInt(circle.attr('cy')), | |
| 162 | + gy = function(gps, svg) { | |
| 163 | + var circle = get_circle(gps.stopNo, svg); | |
| 164 | + if (!circle) return -100; | |
| 165 | + | |
| 166 | + var cy = parseInt(circle.attr('cy')), | |
| 145 | 167 | index = line_gps_index[gps.lineId][gps.stopNo][gps.deviceId]; |
| 146 | 168 | |
| 147 | 169 | return gps.upDown == 0 ? cy - 31 - (index * 28) : cy + 7 + (index * 28); |
| ... | ... | @@ -170,8 +192,18 @@ var gb_svg_chart = (function() { |
| 170 | 192 | gps_key = function(d) { |
| 171 | 193 | return d.deviceId; |
| 172 | 194 | }, |
| 173 | - gps_update_point = function(e) { | |
| 174 | - e.transition().attr('x', gx).attr('y', gy).attr('updown', function(d){return d.upDown;}); | |
| 195 | + gps_update_point = function(e, svg) { | |
| 196 | + e.transition().attr('x', function(d) { | |
| 197 | + return gx(d, svg); | |
| 198 | + }) | |
| 199 | + .attr('y', function(d) { | |
| 200 | + return gy(d, svg); | |
| 201 | + }) | |
| 202 | + .attr('updown', function(d) { | |
| 203 | + return d.upDown; | |
| 204 | + }); | |
| 205 | + //update tip position | |
| 206 | + gb_svg_tooltip.update(e); | |
| 175 | 207 | }, |
| 176 | 208 | rct_id = function(d) { |
| 177 | 209 | return 'rct_' + d.deviceId; |
| ... | ... | @@ -186,11 +218,14 @@ var gb_svg_chart = (function() { |
| 186 | 218 | |
| 187 | 219 | line_gps_index[lineCode] = gps_index_mapp(data); |
| 188 | 220 | $.each(svgs, function() { |
| 221 | + //绘制gps | |
| 189 | 222 | draw_gps(this, data); |
| 223 | + //聚合gps | |
| 224 | + marker_clusterer(this, lineCode); | |
| 190 | 225 | }); |
| 191 | 226 | |
| 192 | - //聚合gps | |
| 193 | - marker_clusterer(lineCode); | |
| 227 | + | |
| 228 | + //marker_clusterer(lineCode); | |
| 194 | 229 | } |
| 195 | 230 | |
| 196 | 231 | var draw_gps = function(svg, data) { |
| ... | ... | @@ -201,55 +236,56 @@ var gb_svg_chart = (function() { |
| 201 | 236 | //rect |
| 202 | 237 | var rects = gps_cont.selectAll('rect').data(data, gps_key); |
| 203 | 238 | rects.enter().append('rect').attr('_id', rct_id); |
| 204 | - gps_update_point(rects); | |
| 239 | + gps_update_point(rects, svg); | |
| 205 | 240 | //text |
| 206 | 241 | var ts = gps_cont.selectAll('text').data(data, gps_key); |
| 207 | 242 | ts.enter().append('text').text(g_text).attr('_id', tx_id); |
| 208 | - gps_update_point(ts); | |
| 243 | + gps_update_point(ts, svg); | |
| 209 | 244 | }; |
| 210 | 245 | |
| 211 | - var marker_clusterer = function(lineCode) { | |
| 212 | - var gpsArr, idxMapp = line_gps_index[lineCode] | |
| 213 | - ,svgs = $('.line-chart[data-code=' + lineCode + ']'); | |
| 246 | + var marker_clusterer = function(svg, lineCode) { | |
| 247 | + //debugger | |
| 248 | + var gpsArr, idxMapp = line_gps_index[lineCode]; | |
| 249 | + //svgs = $('.line-chart[data-code=' + lineCode + ']'); | |
| 214 | 250 | for (var stopNo in idxMapp) { |
| 215 | 251 | gpsArr = gb_common.get_keys(idxMapp[stopNo]); |
| 216 | - if (gpsArr.length > 2) | |
| 217 | - marker_clusterer_merge(svgs, stopNo, gpsArr); | |
| 218 | - } | |
| 252 | + //remove old merger point | |
| 253 | + $('g[_id=' + 'merger_' + stopNo + ']', svg).remove(); | |
| 254 | + if (gpsArr.length <= 2) | |
| 255 | + continue; | |
| 219 | 256 | |
| 220 | - //marker-clusterer | |
| 257 | + marker_clusterer_merge(svg, stopNo, gpsArr); | |
| 258 | + } | |
| 221 | 259 | } |
| 222 | 260 | |
| 223 | - var marker_clusterer_merge = function(svgs, stopNo, gpsArr) { | |
| 261 | + var marker_clusterer_merge = function(svg, stopNo, gpsArr) { | |
| 224 | 262 | //stop circle |
| 225 | - var circle = $('.station_circle[data-id=' + stopNo + ']'), | |
| 226 | - x = parseInt(circle.attr('cx')), | |
| 263 | + var circle = get_circle(stopNo, svg); | |
| 264 | + if (!circle) return; | |
| 265 | + | |
| 266 | + var x = parseInt(circle.attr('cx')), | |
| 227 | 267 | y = parseInt(circle.attr('cy')), |
| 228 | 268 | isDown = circle.attr('class').indexOf('down') != -1; |
| 229 | 269 | |
| 230 | - $.each(svgs, function() { | |
| 231 | - $('g[_id=' + 'merger_' + stopNo + ']', this).remove(); | |
| 232 | - var svg = d3.select(this); | |
| 233 | - //console.log('需要聚合的站点: ' + stopNo); | |
| 234 | - //hide old element | |
| 235 | - $.each(gpsArr, function(i, d) { | |
| 236 | - $('rect[_id=rct_' + d + '],text[_id=tx_' + d + ']').attr('class', 'merge_hide'); | |
| 237 | - }); | |
| 238 | - | |
| 239 | - var mergerG = svg.selectAll('g.marker-clusterer').append('g').attr('_id', 'merger_' + stopNo) | |
| 240 | - .classed({ | |
| 241 | - 'merge-item': true | |
| 242 | - }); | |
| 243 | - //merge rect | |
| 244 | - mergerG.append('rect').attr('x', x - 12) | |
| 245 | - .attr('y', function() { | |
| 246 | - return isDown ? y + 5 : y - 30; | |
| 247 | - }); | |
| 248 | - //merge text | |
| 249 | - mergerG.append('text').text(gpsArr.length) | |
| 250 | - .attr('x', x - 4) | |
| 251 | - .attr('y', isDown ? y + 22 : y - 12); | |
| 270 | + var svg = d3.select(svg); | |
| 271 | + //hide old element | |
| 272 | + $.each(gpsArr, function(i, d) { | |
| 273 | + $('rect[_id=rct_' + d + '],text[_id=tx_' + d + ']').attr('class', 'merge_hide'); | |
| 252 | 274 | }); |
| 275 | + | |
| 276 | + var mergerG = svg.selectAll('g.marker-clusterer').append('g').attr('_id', 'merger_' + stopNo) | |
| 277 | + .classed({ | |
| 278 | + 'merge-item': true | |
| 279 | + }); | |
| 280 | + //merge rect | |
| 281 | + mergerG.append('rect').attr('x', x - 12) | |
| 282 | + .attr('y', function() { | |
| 283 | + return isDown ? y + 5 : y - 30; | |
| 284 | + }); | |
| 285 | + //merge text | |
| 286 | + mergerG.append('text').text(gpsArr.length) | |
| 287 | + .attr('x', x - 4) | |
| 288 | + .attr('y', isDown ? y + 22 : y - 12); | |
| 253 | 289 | } |
| 254 | 290 | |
| 255 | 291 | return { | ... | ... |
src/main/resources/static/real_control_v2/js/utils/svg_chart_map.js
0 → 100644
| 1 | +var gb_svg_map_util = (function(){ | |
| 2 | + var storage = window.localStorage; | |
| 3 | + var drawLine = function(map, gps) { | |
| 4 | + //从storage里获取路段路由数据 | |
| 5 | + var routes = JSON.parse(storage.getItem(gps.lineId + '_route')), | |
| 6 | + updown = gps.upDown == 0 ? 'up' : 'down', | |
| 7 | + pots = [], | |
| 8 | + tempArr; | |
| 9 | + | |
| 10 | + $.each(routes[updown].split(','), function() { | |
| 11 | + tempArr = this.split(' '); | |
| 12 | + pots.push(new BMap.Point(tempArr[0], tempArr[1])); | |
| 13 | + }); | |
| 14 | + | |
| 15 | + var polyline = new BMap.Polyline(pots, { | |
| 16 | + strokeWeight: 6, | |
| 17 | + strokeOpacity: 0.5, | |
| 18 | + strokeColor: gps.upDown == 0 ? 'blue' : 'red' | |
| 19 | + }); | |
| 20 | + | |
| 21 | + map.addOverlay(polyline); | |
| 22 | + | |
| 23 | + $.each(gb_data_basic.stationRoutes(gps.lineId), function() { | |
| 24 | + if (this.directions == gps.upDown) { | |
| 25 | + var marker = drawStationMarker(this); | |
| 26 | + if (marker) | |
| 27 | + map.addOverlay(marker); | |
| 28 | + } | |
| 29 | + }) | |
| 30 | + } | |
| 31 | + | |
| 32 | + var drawStationMarker = function(routeItem) { | |
| 33 | + var station = routeItem.station, | |
| 34 | + coord = TransGPS.wgsToBD(station.gLaty, station.gLonx); | |
| 35 | + | |
| 36 | + var marker = new BMap.Marker(new BMap.Point(coord.lng, coord.lat)); | |
| 37 | + | |
| 38 | + //label | |
| 39 | + var offsetX = Math.abs(station.stationName.length / 2 * 12), | |
| 40 | + offsetY = -20, | |
| 41 | + label = new BMap.Label(station.stationName, { | |
| 42 | + offset: new BMap.Size(-offsetX, offsetY) | |
| 43 | + }); | |
| 44 | + | |
| 45 | + label.setStyle({ | |
| 46 | + borderColor: 'rgb(130, 119, 119)', | |
| 47 | + borderRadius: '3px', | |
| 48 | + padding: '3px 7px 3px 7px', | |
| 49 | + color: 'rgb(130, 119, 119)' | |
| 50 | + }); | |
| 51 | + marker.setLabel(label); | |
| 52 | + return marker; | |
| 53 | + } | |
| 54 | + | |
| 55 | + return {drawLine: drawLine}; | |
| 56 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/js/utils/svg_chart_tooltip.js
| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | var gb_svg_tooltip = (function() { |
| 4 | 4 | |
| 5 | - var storage = window.localStorage; | |
| 6 | 5 | var temps; |
| 7 | 6 | $.get('/real_control_v2/fragments/home/tooltip.html', function(dom) { |
| 8 | 7 | temps = gb_common.compileTempByDom(dom); |
| ... | ... | @@ -10,11 +9,14 @@ var gb_svg_tooltip = (function() { |
| 10 | 9 | |
| 11 | 10 | // normal gps tooltip |
| 12 | 11 | $(document).on('mouseenter', 'svg .gps-wrap rect', function() { |
| 12 | + var rect = $(this); | |
| 13 | + if(rect.attr('aria-describedby')) | |
| 14 | + return; | |
| 13 | 15 | var gps = gb_data_gps.findOne($(this).attr('_id').split('_')[1]); |
| 14 | 16 | $(this).qtip({ |
| 15 | 17 | show: { |
| 16 | 18 | ready: true, |
| 17 | - delay: 340 | |
| 19 | + delay: 300 | |
| 18 | 20 | }, |
| 19 | 21 | content: { |
| 20 | 22 | text: function() { |
| ... | ... | @@ -22,10 +24,11 @@ var gb_svg_tooltip = (function() { |
| 22 | 24 | } |
| 23 | 25 | }, |
| 24 | 26 | position: { |
| 25 | - viewport: $(window) | |
| 27 | + viewport: $(window), | |
| 28 | + target: rect | |
| 26 | 29 | }, |
| 27 | 30 | style: { |
| 28 | - classes: 'qtip-dark qtip-shadow qtip-rounded' | |
| 31 | + classes: 'qtip-bootstrap' | |
| 29 | 32 | }, |
| 30 | 33 | hide: { |
| 31 | 34 | fixed: true, |
| ... | ... | @@ -33,91 +36,134 @@ var gb_svg_tooltip = (function() { |
| 33 | 36 | }, |
| 34 | 37 | events: { |
| 35 | 38 | hidden: function(event, api) { |
| 36 | - $(this).remove(); | |
| 39 | + rect.dblclick(null); | |
| 40 | + rect.removeAttr('fiexd-tip'); | |
| 41 | + //destroy dom | |
| 42 | + $(this).qtip('destroy', true); | |
| 37 | 43 | }, |
| 38 | 44 | visible: function() { |
| 39 | 45 | show_baidu_map($('.tip_map_wrap', this)[0], gps); |
| 46 | + rect.dblclick(fiexdTip); | |
| 40 | 47 | } |
| 41 | 48 | } |
| 42 | 49 | }); |
| 43 | 50 | }); |
| 44 | 51 | |
| 45 | - var carIcon = '/assets/img/bus1.png'; | |
| 46 | - //,normalIcon = '/assets/img/Marker_32px_583000_easyicon.net.png'; | |
| 47 | - var show_baidu_map = function(elem, gps) { | |
| 48 | - var map = new BMap.Map(elem), | |
| 49 | - coord = TransGPS.wgsToBD(gps.lat, gps.lon), | |
| 50 | - point = new BMap.Point(coord.lng, coord.lat); | |
| 52 | + //multiple gps tooltip | |
| 53 | + $(document).on('mouseenter', 'svg .merge-item rect', function() { | |
| 54 | + var rect = $(this); | |
| 55 | + if(rect.attr('aria-describedby')) | |
| 56 | + return; | |
| 57 | + // var gps = gb_data_gps.findOne($(this).attr('_id').split('_')[1]); | |
| 58 | + //获取聚合的gps | |
| 59 | + var lineCode=$(this).parents('svg').data('code') | |
| 60 | + ,stop=$(this).parent().attr('_id').split('_')[1] | |
| 61 | + ,gpsArray=searchByStop(gb_data_gps.gpsByLineCode(lineCode), stop); | |
| 51 | 62 | |
| 52 | - map.centerAndZoom(point, 15); | |
| 53 | - map.enableScrollWheelZoom(true); | |
| 54 | - map.setMapStyle({ | |
| 55 | - style: 'grayscale' | |
| 63 | + console.log('gpsArray...',gpsArray); | |
| 64 | + $(this).qtip({ | |
| 65 | + show: { | |
| 66 | + ready: true, | |
| 67 | + delay: 300 | |
| 68 | + }, | |
| 69 | + content: { | |
| 70 | + text: function() { | |
| 71 | + return temps['tooltip_multi_gps_temp']({list: gpsArray}); | |
| 72 | + } | |
| 73 | + }, | |
| 74 | + position: { | |
| 75 | + viewport: $(window), | |
| 76 | + target: rect | |
| 77 | + }, | |
| 78 | + style: { | |
| 79 | + classes: 'qtip-bootstrap qtip-multi-gps' | |
| 80 | + }, | |
| 81 | + hide: { | |
| 82 | + fixed: true, | |
| 83 | + delay: 300 | |
| 84 | + }, | |
| 85 | + events: { | |
| 86 | + hidden: function(event, api) { | |
| 87 | + //rect.dblclick(null); | |
| 88 | + //destroy dom | |
| 89 | + $(this).qtip('destroy', true); | |
| 90 | + }, | |
| 91 | + visible: function() { | |
| 92 | + show_baidu_map($('.tip_map_wrap', this)[0], gpsArray); | |
| 93 | + //rect.dblclick(fiexdTip); | |
| 94 | + } | |
| 95 | + } | |
| 56 | 96 | }); |
| 57 | - //gps marker | |
| 58 | - var marker = new BMap.Marker(point) | |
| 59 | - ,icon = new BMap.Icon(carIcon, new BMap.Size(25,25)); | |
| 60 | - marker.setIcon(icon); | |
| 61 | - marker.setRotation(gps.direction); | |
| 62 | - marker.setTop(true); | |
| 63 | - map.addOverlay(marker); | |
| 64 | - //draw line routes | |
| 65 | - drawLine(map, gps); | |
| 66 | - } | |
| 97 | + }); | |
| 67 | 98 | |
| 68 | - var drawLine = function(map, gps) { | |
| 69 | - //从storage里获取路段路由数据 | |
| 70 | - var routes = JSON.parse(storage.getItem(gps.lineId + '_route')), | |
| 71 | - updown = gps.upDown == 0 ? 'up' : 'down', | |
| 72 | - pots = [], | |
| 73 | - tempArr; | |
| 99 | + //dblclick | |
| 100 | + var fiexdTip = function() { | |
| 101 | + var tipId = $(this).attr('aria-describedby'); | |
| 102 | + if (tipId) { | |
| 103 | + var api = $('#' + tipId).qtip('api'); | |
| 104 | + api.set({ | |
| 105 | + 'hide.event': false, | |
| 106 | + 'content.button': 'Close', | |
| 107 | + 'content.title': 'GPS正常', | |
| 108 | + 'position.my': 'top center', | |
| 109 | + 'position.at': 'bottom center' | |
| 110 | + }); | |
| 111 | + $(this).attr('fiexd-tip', '1'); | |
| 112 | + } | |
| 113 | + } | |
| 74 | 114 | |
| 75 | - $.each(routes[updown].split(','), function() { | |
| 76 | - tempArr = this.split(' '); | |
| 77 | - pots.push(new BMap.Point(tempArr[0], tempArr[1])); | |
| 115 | + var carIcon = '/assets/img/bus1.png'; | |
| 116 | + //,normalIcon = '/assets/img/Marker_32px_583000_easyicon.net.png'; | |
| 117 | + var show_baidu_map = function(elem, list) { | |
| 118 | + if(!isArray(list)) | |
| 119 | + list=[list]; | |
| 120 | + //init map | |
| 121 | + var map = new BMap.Map(elem); | |
| 122 | + map.setMapStyle({ | |
| 123 | + style: 'googlelite' | |
| 78 | 124 | }); |
| 125 | + map.enableScrollWheelZoom(true); | |
| 126 | + //gps marker | |
| 127 | + var coord,point; | |
| 128 | + $.each(list, function(i){ | |
| 129 | + coord = TransGPS.wgsToBD(this.lat, this.lon); | |
| 130 | + point = new BMap.Point(coord.lng, coord.lat); | |
| 79 | 131 | |
| 80 | - var polyline = new BMap.Polyline(pots, { | |
| 81 | - strokeWeight: 6, | |
| 82 | - strokeOpacity: 0.5, | |
| 83 | - strokeColor: gps.upDown == 0 ? 'blue' : 'red' | |
| 84 | - }); | |
| 132 | + var marker = new BMap.Marker(point), | |
| 133 | + icon = new BMap.Icon(carIcon, new BMap.Size(25, 25)); | |
| 134 | + marker.setIcon(icon); | |
| 135 | + marker.setRotation(this.direction); | |
| 136 | + marker.setTop(true); | |
| 137 | + map.addOverlay(marker); | |
| 85 | 138 | |
| 86 | - map.addOverlay(polyline); | |
| 139 | + if(i>=list.length-1) | |
| 140 | + map.centerAndZoom(point, 15); | |
| 141 | + }); | |
| 142 | + //draw line routes | |
| 143 | + gb_svg_map_util.drawLine(map, list[0]); | |
| 144 | + } | |
| 87 | 145 | |
| 88 | - $.each(gb_data_basic.stationRoutes(gps.lineId), function() { | |
| 89 | - if (this.directions == gps.upDown) { | |
| 90 | - var marker = drawStationMarker(this); | |
| 91 | - if (marker) | |
| 92 | - map.addOverlay(marker); | |
| 93 | - } | |
| 94 | - }) | |
| 146 | + function searchByStop(list, stop){ | |
| 147 | + var rs = []; | |
| 148 | + $.each(list, function(){ | |
| 149 | + if(this.stopNo==stop) | |
| 150 | + rs.push(this); | |
| 151 | + }); | |
| 152 | + return rs; | |
| 95 | 153 | } |
| 96 | 154 | |
| 97 | - var drawStationMarker = function(routeItem) { | |
| 98 | - var station = routeItem.station, | |
| 99 | - coord = TransGPS.wgsToBD(station.gLaty, station.gLonx); | |
| 155 | + function updateFixedTip(es){ | |
| 156 | + $.each(es, function(){ | |
| 157 | + if(!$(this).attr('fiexd-tip')) | |
| 158 | + return true; | |
| 100 | 159 | |
| 101 | - var marker = new BMap.Marker(new BMap.Point(coord.lng, coord.lat)); | |
| 160 | + var qtip=$('#'+$(this).attr('aria-describedby')); | |
| 102 | 161 | |
| 103 | - //label | |
| 104 | - var offsetX = Math.abs(station.stationName.length / 2 * 12), | |
| 105 | - offsetY = -20, | |
| 106 | - label = new BMap.Label(station.stationName, { | |
| 107 | - offset: new BMap.Size(-offsetX, offsetY) | |
| 108 | - }); | |
| 109 | 162 | |
| 110 | - label.setStyle({ | |
| 111 | - borderColor: 'rgb(130, 119, 119)', | |
| 112 | - borderRadius: '3px', | |
| 113 | - padding: '3px 7px 3px 7px', | |
| 114 | - color: 'rgb(130, 119, 119)' | |
| 115 | - }); | |
| 116 | - marker.setLabel(label); | |
| 117 | - //marker.setIcon(new BMap.Icon(normalIcon, new BMap.Size(32,32))); | |
| 118 | - //normalIcon | |
| 119 | - return marker; | |
| 163 | + }); | |
| 120 | 164 | } |
| 121 | 165 | |
| 122 | - return {}; | |
| 166 | + return { | |
| 167 | + update: updateFixedTip | |
| 168 | + }; | |
| 123 | 169 | })(); | ... | ... |
src/main/resources/static/real_control_v2/js/websocket/sch_websocket.js
0 → 100644
| 1 | +var gb_sch_websocket = (function() { | |
| 2 | + | |
| 3 | + var temps; | |
| 4 | + $.get('/real_control_v2/fragments/line_schedule/sys_mailbox.html', function(dom) { | |
| 5 | + temps = gb_common.compileTempByDom(dom); | |
| 6 | + }); | |
| 7 | + | |
| 8 | + var schSock = new SockJS('/sockjs/realcontrol'); | |
| 9 | + | |
| 10 | + schSock.onopen = function(e) { | |
| 11 | + console.log('webSocket[realcontrol] onopen'); | |
| 12 | + setTimeout(function() { | |
| 13 | + //注册线路监听 | |
| 14 | + var data = { | |
| 15 | + operCode: 'register_line', | |
| 16 | + idx: gb_data_basic.line_idx | |
| 17 | + } | |
| 18 | + schSock.send(JSON.stringify(data)); | |
| 19 | + }, 500); | |
| 20 | + }; | |
| 21 | + //接收消息 | |
| 22 | + schSock.onmessage = function(e) { | |
| 23 | + try { | |
| 24 | + var jsonMsg = $.parseJSON(e.data); | |
| 25 | + msgHandle[jsonMsg.fn](jsonMsg); | |
| 26 | + } catch (e) { | |
| 27 | + console.log(e, e.data); | |
| 28 | + } | |
| 29 | + }; | |
| 30 | + | |
| 31 | + //断开 | |
| 32 | + schSock.onclose = function(e) { | |
| 33 | + alert('和服务器连接断开....'); | |
| 34 | + }; | |
| 35 | + | |
| 36 | + //80协议上报 | |
| 37 | + var report80 = function(msg) { | |
| 38 | + console.log('report80...', msg); | |
| 39 | + msg.dateStr = moment(msg.timestamp).format('HH:mm'); | |
| 40 | + msg.text = gb_common.reqCode80[msg.data.requestCode]; | |
| 41 | + | |
| 42 | + findMailBox(msg.data.lineId).prepend(temps['sys-note-80-temp'](msg)); | |
| 43 | + } | |
| 44 | + | |
| 45 | + var waitRemoves = []; | |
| 46 | + //车辆发出 | |
| 47 | + var faChe = function(msg) { | |
| 48 | + gb_schedule_table.updateSchedule(msg.t); | |
| 49 | + msg.domId = 'fache_' + msg.t.id + '_' + parseInt(Math.random() * 10000); | |
| 50 | + | |
| 51 | + findMailBox(msg.t.xlBm).prepend(temps['sys-note-42-temp'](msg)); | |
| 52 | + waitRemoves.push({ | |
| 53 | + t: currentSecond(), | |
| 54 | + dom: msg.domId | |
| 55 | + }); | |
| 56 | + } | |
| 57 | + | |
| 58 | + //到达终点 | |
| 59 | + var zhongDian = function(msg) { | |
| 60 | + gb_schedule_table.updateSchedule(msg.t); | |
| 61 | + msg.domId = 'zhongDian_' + msg.t.id + '_' + parseInt(Math.random() * 10000); | |
| 62 | + | |
| 63 | + findMailBox(msg.t.xlBm).prepend(temps['sys-note-42_1-temp'](msg)); | |
| 64 | + waitRemoves.push({ | |
| 65 | + t: currentSecond(), | |
| 66 | + dom: msg.domId | |
| 67 | + }); | |
| 68 | + } | |
| 69 | + | |
| 70 | + //服务器通知刷新班次 | |
| 71 | + var refreshSch = function(msg) { | |
| 72 | + gb_schedule_table.updateSchedule(msg.ts); | |
| 73 | + } | |
| 74 | + | |
| 75 | + var msgHandle = { | |
| 76 | + report80: report80, | |
| 77 | + faChe: faChe, | |
| 78 | + zhongDian: zhongDian, | |
| 79 | + refreshSch: refreshSch | |
| 80 | + } | |
| 81 | + | |
| 82 | + function currentSecond() { | |
| 83 | + return Date.parse(new Date()) / 1000; | |
| 84 | + } | |
| 85 | + | |
| 86 | + var mailBoxs = {}; | |
| 87 | + | |
| 88 | + function findMailBox(lineCode) { | |
| 89 | + if (mailBoxs[lineCode]) | |
| 90 | + return mailBoxs[lineCode]; | |
| 91 | + | |
| 92 | + var mbox = $('li.line_schedule[data-id=' + lineCode + ']').find('div.sys-mailbox'); | |
| 93 | + mailBoxs[lineCode] = mbox; | |
| 94 | + return mbox; | |
| 95 | + } | |
| 96 | + | |
| 97 | + //定时到离站信使清理掉 | |
| 98 | + ! function() { | |
| 99 | + var f = arguments.callee, | |
| 100 | + ct = Date.parse(new Date()) / 1000, | |
| 101 | + item; | |
| 102 | + try { | |
| 103 | + for (var i = 0; i < 1000; i++) { | |
| 104 | + if (waitRemoves.length == 0) | |
| 105 | + break; | |
| 106 | + item = waitRemoves[0]; | |
| 107 | + if (ct - item.t >= 30) { | |
| 108 | + waitRemoves.shift(); | |
| 109 | + $('#' + item.dom).remove(); | |
| 110 | + } | |
| 111 | + } | |
| 112 | + } catch (e) { | |
| 113 | + console.log(e); | |
| 114 | + } | |
| 115 | + setTimeout(f, 5000); | |
| 116 | + }(); | |
| 117 | + | |
| 118 | + return { | |
| 119 | + sock: schSock | |
| 120 | + }; | |
| 121 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/main.html
| ... | ... | @@ -16,6 +16,8 @@ |
| 16 | 16 | <link rel="stylesheet" href="/real_control_v2/css/north.css" /> |
| 17 | 17 | <!-- home style --> |
| 18 | 18 | <link rel="stylesheet" href="/real_control_v2/css/home.css" /> |
| 19 | + <!-- line style --> | |
| 20 | + <link rel="stylesheet" href="/real_control_v2/css/line_schedule.css" /> | |
| 19 | 21 | <!-- custom table --> |
| 20 | 22 | <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" /> |
| 21 | 23 | <!-- jquery contextMenu style --> |
| ... | ... | @@ -48,12 +50,21 @@ |
| 48 | 50 | |
| 49 | 51 | <div class="main-container"></div> |
| 50 | 52 | |
| 53 | + <!-- 地图相关 --> | |
| 54 | + <script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT" ></script> | |
| 55 | + <script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 56 | + <script src="/assets/js/baidu//MarkerClusterer.js"></script> | |
| 57 | + <script src="/assets/js/TransGPS.js" ></script> | |
| 58 | + <!-- 高德 --> | |
| 59 | + <script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda" ></script> | |
| 51 | 60 | <!-- jquery --> |
| 52 | 61 | <script src="/real_control_v2/assets/js/jquery.min.js"></script> |
| 53 | 62 | <!-- jquery actual --> |
| 54 | 63 | <script src="/real_control_v2/assets/js/jquery.actual.min.js"></script> |
| 55 | 64 | <!-- jquery.serializejson JSON序列化插件 --> |
| 56 | 65 | <script src="/assets/plugins/jquery.serializejson.js"></script> |
| 66 | + <!-- moment.js 日期处理类库 --> | |
| 67 | + <script src="/assets/plugins/moment-with-locales.js"></script> | |
| 57 | 68 | <!-- common js --> |
| 58 | 69 | <script src="/real_control_v2/js/common.js"></script> |
| 59 | 70 | <!-- art-template 模版引擎 --> |
| ... | ... | @@ -91,6 +102,7 @@ |
| 91 | 102 | <script src="/real_control_v2/js/utils/svg_chart.js"></script> |
| 92 | 103 | <script src="/real_control_v2/js/utils/svg_data_convert.js"></script> |
| 93 | 104 | <script src="/real_control_v2/js/utils/svg_chart_tooltip.js"></script> |
| 105 | + <script src="/real_control_v2/js/utils/svg_chart_map.js"></script> | |
| 94 | 106 | |
| 95 | 107 | <!-- custom table js --> |
| 96 | 108 | <script src="/real_control_v2/js/utils/ct_table.js"></script> |
| ... | ... | @@ -101,9 +113,17 @@ |
| 101 | 113 | <script src="/real_control_v2/js/home/layout.js"></script> |
| 102 | 114 | <script src="/real_control_v2/js/home/line_panel.js"></script> |
| 103 | 115 | <script src="/real_control_v2/js/home/context_menu.js"></script> |
| 116 | + <!-- line schedule js --> | |
| 117 | + <script src="/real_control_v2/js/line_schedule/layout.js"></script> | |
| 118 | + <script src="/real_control_v2/js/line_schedule/sch_table.js"></script> | |
| 119 | + <script src="/real_control_v2/js/line_schedule/context_menu.js"></script> | |
| 120 | + <script src="/real_control_v2/js/line_schedule/dbclick.js"></script> | |
| 104 | 121 | |
| 105 | - <script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT" ></script> | |
| 106 | - <script src="/assets/js/TransGPS.js" ></script> | |
| 122 | + <!-- 字典相关 --> | |
| 123 | + <script src="/assets/js/dictionary.js"></script> | |
| 124 | + <!-- websocket --> | |
| 125 | + <script src="/assets/js/sockjs.min.js"></script> | |
| 126 | + <script src="/real_control_v2/js/websocket/sch_websocket.js"></script> | |
| 107 | 127 | </body> |
| 108 | 128 | |
| 109 | 129 | </html> | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/css/real.css
0 → 100644
| 1 | +.z-depth-2 { | |
| 2 | + box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); | |
| 3 | +} | |
| 4 | + | |
| 5 | +#mapContainer { | |
| 6 | + width: 100%; | |
| 7 | + height: 100%; | |
| 8 | +} | |
| 9 | + | |
| 10 | +.map-lt-tools { | |
| 11 | + position: absolute; | |
| 12 | + z-index: 2; | |
| 13 | + top: 20px; | |
| 14 | + left: 25px; | |
| 15 | + background: white; | |
| 16 | +} | |
| 17 | + | |
| 18 | +.map-lt-tools ul>li>a{ | |
| 19 | + font-family: 华文细黑; | |
| 20 | +} | |
| 21 | + | |
| 22 | +.map_rt_wrap { | |
| 23 | + position: absolute; | |
| 24 | + z-index: 2; | |
| 25 | + top: 20px; | |
| 26 | + right: 30px; | |
| 27 | + padding: 5px; | |
| 28 | +} | |
| 29 | + | |
| 30 | +.map_rt_wrap .uk-tab { | |
| 31 | + background: white; | |
| 32 | + font-family: 华文细黑; | |
| 33 | + border-radius: 5px | |
| 34 | + width: 350px; | |
| 35 | + float: right; | |
| 36 | +} | |
| 37 | + | |
| 38 | +.map_rt_wrap .uk-tab>li>a { | |
| 39 | + font-size: 16px; | |
| 40 | + padding: 16px 12px 12px 12px; | |
| 41 | + border-radius: 5px; | |
| 42 | +} | |
| 43 | + | |
| 44 | +#mapRtContainer { | |
| 45 | + margin-top: 70px; | |
| 46 | + background: white; | |
| 47 | + border-radius: 5px; | |
| 48 | +} | |
| 49 | + | |
| 50 | +#mapRtContainer .real_monitor { | |
| 51 | + height: 661px; | |
| 52 | + padding: 30px 0 0 20px; | |
| 53 | + overflow: auto; | |
| 54 | +} | |
| 55 | + | |
| 56 | +#mapRtContainer .search_panel { | |
| 57 | + height: 60px; | |
| 58 | +} | |
| 59 | + | |
| 60 | +#mapRtContainer .play_back { | |
| 61 | + /*height: 300px;*/ | |
| 62 | + width: 380px; | |
| 63 | +} | |
| 64 | + | |
| 65 | +#mapRtContainer .play_back .ct-form-modal form .uk-grid+.uk-grid{ | |
| 66 | + margin-top: 15px; | |
| 67 | +} | |
| 68 | + | |
| 69 | +#mapRtContainer .play_back .b_c_submit{ | |
| 70 | + text-align: center; | |
| 71 | + margin-top: 20px; | |
| 72 | + margin-bottom: 20px; | |
| 73 | +} | |
| 74 | + | |
| 75 | +#mapRtContainer .play_back .ct-form-modal form input[type=date]{ | |
| 76 | + width: 140px; | |
| 77 | +} | |
| 78 | +#mapRtContainer .play_back .ct-form-modal form input[type=time]{ | |
| 79 | + width: calc(100% - 145px); | |
| 80 | +} | |
| 81 | + | |
| 82 | +#mapRtContainer .play_back .uk-alert{ | |
| 83 | + background: transparent; | |
| 84 | + border: 0; | |
| 85 | + border-bottom: 1px solid rgba(45,112,145,.3); | |
| 86 | + border-radius: 5px 5px 0 0; | |
| 87 | + font-size: 13px; | |
| 88 | +} | |
| 89 | + | |
| 90 | +.map-system-msg{ | |
| 91 | + position: absolute; | |
| 92 | + z-index: 2; | |
| 93 | + top: 20px; | |
| 94 | + background: red; | |
| 95 | + color: white; | |
| 96 | + padding: 7px; | |
| 97 | + left: 320px; | |
| 98 | + border-radius: 5px; | |
| 99 | + font-size: 16px; | |
| 100 | + font-family: 微软雅黑; | |
| 101 | +} | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/fragments/play_back_modal.html
0 → 100644
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/fragments/playback.html
0 → 100644
| 1 | +<div> | |
| 2 | +<script id="map_play_back_form_temp" type="text/html"> | |
| 3 | +<div class="ct-form-modal"> | |
| 4 | + <div class="uk-alert uk-alert-danger"> | |
| 5 | + <i class="uk-icon-exclamation-circle"></i> 最多跨一天回放,请尽量小范围的查询 | |
| 6 | + </div> | |
| 7 | + <form class="uk-form uk-form-horizontal" style="padding: 15px;"> | |
| 8 | + <div class="uk-grid"> | |
| 9 | + <div class="uk-width-1-1"> | |
| 10 | + <div class="uk-form-row"> | |
| 11 | + <label class="uk-form-label">车辆编码</label> | |
| 12 | + <div class="uk-form-controls"> | |
| 13 | + <div class="uk-autocomplete uk-form" id="p_b_autocomp_car" style="width: 100%;"> | |
| 14 | + <input type="text" name="nbbm" placeholder="车辆自编号" required> | |
| 15 | + </div> | |
| 16 | + </div> | |
| 17 | + </div> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + <div class="uk-grid"> | |
| 21 | + <div class="uk-width-1-1"> | |
| 22 | + <div class="uk-form-row"> | |
| 23 | + <label class="uk-form-label">起始时间</label> | |
| 24 | + <div class="uk-form-controls"> | |
| 25 | + <input type="date" name="sDate" required > | |
| 26 | + <input type="time" name="sTime" required > | |
| 27 | + </div> | |
| 28 | + </div> | |
| 29 | + </div> | |
| 30 | + </div> | |
| 31 | + <div class="uk-grid"> | |
| 32 | + <div class="uk-width-1-1"> | |
| 33 | + <div class="uk-form-row"> | |
| 34 | + <label class="uk-form-label">截止时间</label> | |
| 35 | + <div class="uk-form-controls"> | |
| 36 | + <input type="date" name="eDate" required > | |
| 37 | + <input type="time" name="eTime" required > | |
| 38 | + </div> | |
| 39 | + </div> | |
| 40 | + </div> | |
| 41 | + </div> | |
| 42 | + <div class="b_c_submit"> | |
| 43 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-play-circle"></i> 轨迹回放</button> | |
| 44 | + </div> | |
| 45 | + </form> | |
| 46 | +</div> | |
| 47 | +</script> | |
| 48 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/fragments/real_monitor.html
0 → 100644
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/js/gps_play_back.js
0 → 100644
| 1 | +var gb_map_playback = (function() { | |
| 2 | + var gb_form_validation_opts = { | |
| 3 | + framework: 'uikit', | |
| 4 | + locale: 'zh_CN' | |
| 5 | + }; | |
| 6 | + | |
| 7 | + var temps; | |
| 8 | + $.get('/real_control_v2/mapmonitor/real_monitor/fragments/playback.html', function(dom) { | |
| 9 | + temps= gb_common.compileTempByDom(dom); | |
| 10 | + }); | |
| 11 | + | |
| 12 | + var init = function() { | |
| 13 | + var cont = '#mapRtContainer'; | |
| 14 | + | |
| 15 | + var htmlStr = temps['map_play_back_form_temp']({}); | |
| 16 | + $('.play_back', cont).html(htmlStr); | |
| 17 | + | |
| 18 | + var f = $('.play_back form', cont).formValidation(gb_form_validation_opts); | |
| 19 | + f.on('success.form.fv', function(e) { | |
| 20 | + e.preventDefault(); | |
| 21 | + var data = $(this).serializeJSON(); | |
| 22 | + console.log(data); | |
| 23 | + //查询历史gps数据 | |
| 24 | + var fs = 'YYYY-MM-DDHH:mm', | |
| 25 | + st = moment(data.sDate + data.sTime, fs).format('X'), | |
| 26 | + et = moment(data.eDate + data.eTime, fs).format('X'), | |
| 27 | + nbbm = data.nbbm; | |
| 28 | + //isEnableFocus = params.enableFocus; | |
| 29 | + $.ajax({ | |
| 30 | + url: '/gps/gpsHistory/multiple', | |
| 31 | + traditional: true, | |
| 32 | + data: { | |
| 33 | + nbbmArray: nbbm, | |
| 34 | + st: st, | |
| 35 | + et: et | |
| 36 | + }, | |
| 37 | + success: function(rs) { | |
| 38 | + if (!rs || rs.length == 0) { | |
| 39 | + alert('服务器没有返回数据,请检查你的输入参数!'); | |
| 40 | + return; | |
| 41 | + } | |
| 42 | + console.log(rs); | |
| 43 | + } | |
| 44 | + }); | |
| 45 | + }); | |
| 46 | + | |
| 47 | + //----------- 车辆 Autocomplete -------------- | |
| 48 | + $.get('/basic/cars', function(rs) { | |
| 49 | + gb_common.carAutocomplete($('#p_b_autocomp_car', cont), rs); | |
| 50 | + }); | |
| 51 | + | |
| 52 | + //默认值,当前时间前2小时 | |
| 53 | + var m = moment(), | |
| 54 | + rq = 'YYYY-MM-DD', | |
| 55 | + sj = 'HH:mm'; | |
| 56 | + $('input[name=eDate]', cont).val(m.format(rq)); | |
| 57 | + $('input[name=eTime]', cont).val(m.format('HH:mm')); | |
| 58 | + $('input[name=sDate]', cont).val(m.subtract(2, 'hour').format(rq)); | |
| 59 | + $('input[name=sTime]', cont).val(m.format(sj)); | |
| 60 | + } | |
| 61 | + | |
| 62 | + return { | |
| 63 | + init: init | |
| 64 | + } | |
| 65 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/js/gps_tree.js
0 → 100644
| 1 | +var gb_map_gps_tree = (function() { | |
| 2 | + var storage = window.localStorage; | |
| 3 | + var _tree; | |
| 4 | + var drawLine = function(node, flag) { | |
| 5 | + var key = node.a_attr.route; | |
| 6 | + if(flag || node.state.selected){ | |
| 7 | + var lineCode = key.split('_')[0]; | |
| 8 | + //从storage里获取路由数据 | |
| 9 | + var route = JSON.parse(storage.getItem(lineCode + '_route')); | |
| 10 | + //在地图上画出线路 | |
| 11 | + gb_map_imap.call('drawLine', { | |
| 12 | + route: route, | |
| 13 | + updown: key.split('_')[1], | |
| 14 | + key: key | |
| 15 | + }); | |
| 16 | + if(flag) | |
| 17 | + return; | |
| 18 | + | |
| 19 | + drawGpsByParent(node); | |
| 20 | + } | |
| 21 | + else { | |
| 22 | + gb_map_imap.call('removeLine', {key: key}); | |
| 23 | + removeGpsByParent(node); | |
| 24 | + } | |
| 25 | + } | |
| 26 | + | |
| 27 | + var drawGpsByLine=function(node){ | |
| 28 | + var cNode; | |
| 29 | + for (var i = 0, j = node.children_d.length; i < j; i++) { | |
| 30 | + cNode = _tree.jstree(true).get_node(node.children_d[i]); | |
| 31 | + jstreeChanged(null, {node: cNode}); | |
| 32 | + } | |
| 33 | + } | |
| 34 | + | |
| 35 | + var drawGpsByParent=function(node){ | |
| 36 | + $.each(node.children, function(){ | |
| 37 | + drawGps(_tree.jstree(true).get_node(this)); | |
| 38 | + }); | |
| 39 | + } | |
| 40 | + | |
| 41 | + var removeGpsByParent=function(node){ | |
| 42 | + $.each(node.children, function(){ | |
| 43 | + removeGps(_tree.jstree(true).get_node(this).a_attr.device); | |
| 44 | + }); | |
| 45 | + } | |
| 46 | + | |
| 47 | + var drawGps=function(node){ | |
| 48 | + var parentNode=_tree.jstree(true).get_node(node.parent); | |
| 49 | + //绘制父节点路由 | |
| 50 | + if(node.state.selected && !parentNode.state.selected) | |
| 51 | + drawLine(parentNode, true); | |
| 52 | + | |
| 53 | + var device = node.a_attr.device; | |
| 54 | + if(node.state.selected){ | |
| 55 | + //绘制gps | |
| 56 | + var gps=gb_data_gps.allGps[device]; | |
| 57 | + gb_map_imap.call('drawRealGpsMarker', {gpsList: [gps], coordTransform: true}); | |
| 58 | + } | |
| 59 | + else{ | |
| 60 | + removeGps(device); | |
| 61 | + var arr=parentNode.children; | |
| 62 | + for (i = 0, j = arr.length; i < j; i++) { | |
| 63 | + node = _tree.jstree(true).get_node(arr[i]); | |
| 64 | + if(node.state.selected) | |
| 65 | + return; | |
| 66 | + } | |
| 67 | + gb_map_imap.call('removeLine', {key: parentNode.a_attr.route}); | |
| 68 | + } | |
| 69 | + } | |
| 70 | + | |
| 71 | + var removeGps=function(device){ | |
| 72 | + //删除gps | |
| 73 | + gb_map_imap.call('removeGps', {deviceArr: [device]}); | |
| 74 | + } | |
| 75 | + | |
| 76 | + var jstreeChanged = function(e, data) { | |
| 77 | + var i, j, r = [], | |
| 78 | + node = data.node; | |
| 79 | + if (!node) return; | |
| 80 | + switch (node.a_attr.type) { | |
| 81 | + case 'route': | |
| 82 | + drawLine(node); | |
| 83 | + break; | |
| 84 | + case 'device': | |
| 85 | + drawGps(node); | |
| 86 | + break; | |
| 87 | + case 'line': | |
| 88 | + drawGpsByLine(node); | |
| 89 | + break; | |
| 90 | + } | |
| 91 | + } | |
| 92 | + | |
| 93 | + var init = function() { | |
| 94 | + //设备树//open_all | |
| 95 | + var treeData = gb_common.get_device_tree_data(); | |
| 96 | + _tree = $('.real_monitor', '#mapRtContainer') | |
| 97 | + .on('loaded.jstree', function(){ | |
| 98 | + _tree.jstree(true).open_all(); | |
| 99 | + }) | |
| 100 | + .on('changed.jstree', jstreeChanged) | |
| 101 | + .jstree({ | |
| 102 | + 'core': { | |
| 103 | + 'data': treeData | |
| 104 | + }, | |
| 105 | + 'plugins': ['checkbox'] | |
| 106 | + }); | |
| 107 | + | |
| 108 | + //register gps refresh event | |
| 109 | + //gb_data_gps.registerCallback(gps_refresh_event); | |
| 110 | + } | |
| 111 | + | |
| 112 | + var gps_refresh_event=function(addArr, upArr, upDownChange){ | |
| 113 | + console.log('gps_refresh_event....'); | |
| 114 | + var all = addArr.concat(upArr).concat(upDownChange); | |
| 115 | + gb_map_imap.call('drawRealGpsMarker', {gpsList: all, coordTransform: true}); | |
| 116 | + } | |
| 117 | + | |
| 118 | + //文件载入完毕 | |
| 119 | + mapmonitor_load_ep.emitLater('load_gps_tree'); | |
| 120 | + return { | |
| 121 | + init: init | |
| 122 | + }; | |
| 123 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/js/map/iMap.js
0 → 100644
| 1 | +/** 各地图平台通用接口定义 */ | |
| 2 | +var gb_map_imap = (function(){ | |
| 3 | + | |
| 4 | + var storage = window.localStorage; | |
| 5 | + // 地图DOM容器 | |
| 6 | + var mapContainer = $('#mapContainer'); | |
| 7 | + var maps = {}; | |
| 8 | + //尝试从 localStorage 里获取默认的地图类型 | |
| 9 | + var currentMap = storage.getItem('real_map'); | |
| 10 | + var mapProxy = { | |
| 11 | + //添加一个地图实例 | |
| 12 | + addMap: function(name, text, instance){ | |
| 13 | + maps[name] = {name: name, text: text, instance: instance}; | |
| 14 | + | |
| 15 | + if(!currentMap) | |
| 16 | + currentMap = name; | |
| 17 | + return mapProxy; | |
| 18 | + }, | |
| 19 | + changeDefault: function(mapName){ | |
| 20 | + if(mapName == currentMap) | |
| 21 | + return; | |
| 22 | + if(maps[mapName]){ | |
| 23 | + //原地图 destroy | |
| 24 | + var oldMap = maps[currentMap].instance; | |
| 25 | + oldMap.destroy && oldMap.destroy(); | |
| 26 | + $(gb_map_consts.mapContainer).html(''); | |
| 27 | + //解除实时路况按钮点击事件 | |
| 28 | + $(gb_map_consts.trafficBtn).unbind('click'); | |
| 29 | + | |
| 30 | + //新地图 INIT | |
| 31 | + var text = maps[mapName].text; | |
| 32 | + //layer.msg('正在切换到' + text + '...', {icon : 16,shade : [ 0.6, '#393D49' ],time : 0}); | |
| 33 | + var newMap = maps[mapName].instance; | |
| 34 | + newMap.init(); | |
| 35 | + setText(text); | |
| 36 | + | |
| 37 | + currentMap = mapName; | |
| 38 | + //收拢线路 | |
| 39 | + $('.mapRightWrap .collapse.in').collapse('hide'); | |
| 40 | + }else | |
| 41 | + alertErr('不存在的地图实例' + mapName); | |
| 42 | + }, | |
| 43 | + createCarIcon: createCarIcon, | |
| 44 | + call: function(f, opts){ | |
| 45 | + if(f == 'init') | |
| 46 | + setText(maps[currentMap].text); | |
| 47 | + | |
| 48 | + var instance = maps[currentMap].instance; | |
| 49 | + if(instance[f]) | |
| 50 | + instance[f](opts); | |
| 51 | + else | |
| 52 | + alertErr('当前地图实例不支持操作:' + f); | |
| 53 | + return mapProxy; | |
| 54 | + } | |
| 55 | + } | |
| 56 | + | |
| 57 | + //绘制车辆icon | |
| 58 | + function createCarIcon(gps, w){ | |
| 59 | + var canvas = $('<canvas></canvas>')[0]; | |
| 60 | + var ctx = canvas.getContext('2d'); | |
| 61 | + | |
| 62 | + var colours = color(gps); | |
| 63 | + | |
| 64 | + ctx.shadowOffsetX = 5; // 阴影Y轴偏移 | |
| 65 | + ctx.shadowOffsetY = 5; // 阴影X轴偏移 | |
| 66 | + ctx.shadowBlur = 1; // 模糊尺寸 | |
| 67 | + ctx.shadowColor = colours.shadow; // 颜色 | |
| 68 | + | |
| 69 | + //绘制背景 | |
| 70 | + if(!w) | |
| 71 | + w = 70; | |
| 72 | + | |
| 73 | + ctx.roundRect(0, 0, w, 25, 5).stroke(); | |
| 74 | + ctx.fillStyle=colours.bgColor; | |
| 75 | + ctx.fill(); | |
| 76 | + //文字 | |
| 77 | + ctx.font="14px arial"; | |
| 78 | + ctx.fillStyle = "#fff"; | |
| 79 | + ctx.fillText(gps.nbbm, 8, 18); | |
| 80 | + | |
| 81 | + return canvas.toDataURL(); | |
| 82 | + } | |
| 83 | + | |
| 84 | + function color(g){ | |
| 85 | + var colours = {}; | |
| 86 | + switch (g.state) { | |
| 87 | + case 0: | |
| 88 | + if(g.upDown == 0){ | |
| 89 | + //营运上行 | |
| 90 | + colours['bgColor'] = 'rgba(94, 150, 210, 1)'; | |
| 91 | + colours['shadow'] = 'rgba(94, 150, 210, 0.3)'; | |
| 92 | + } | |
| 93 | + else if(g.upDown == 1){ | |
| 94 | + //营运下行 | |
| 95 | + colours['bgColor'] = 'rgba(201, 33, 33, 1)'; | |
| 96 | + colours['shadow'] = 'rgba(201, 33, 33, 0.3)'; | |
| 97 | + } | |
| 98 | + else{ | |
| 99 | + //未知走向 | |
| 100 | + colours['bgColor'] = 'rgba(0, 0, 0, 1)'; | |
| 101 | + colours['shadow'] = 'rgba(0, 0, 0, 0.3)'; | |
| 102 | + } | |
| 103 | + break; | |
| 104 | + | |
| 105 | + default: | |
| 106 | + //非营运 | |
| 107 | + colours['bgColor'] = 'rgba(136, 133, 133, 1)'; | |
| 108 | + colours['shadow'] = 'rgba(136, 133, 133, 0.3)'; | |
| 109 | + break; | |
| 110 | + } | |
| 111 | + | |
| 112 | + return colours; | |
| 113 | + } | |
| 114 | + | |
| 115 | + function alertErr(text){ | |
| 116 | + notify_err('map -'+text); | |
| 117 | + } | |
| 118 | + | |
| 119 | + function setText(text) { | |
| 120 | + $('#curr_map_name').text(text); | |
| 121 | + } | |
| 122 | + | |
| 123 | + //文件载入完毕 | |
| 124 | + mapmonitor_load_ep.emitLater('load_iMap'); | |
| 125 | + return mapProxy; | |
| 126 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/js/map/platform/baidu.js
0 → 100644
| 1 | +/** 百度地图相关接口封装 */ | |
| 2 | +var gb_map_baidu = (function(){ | |
| 3 | + | |
| 4 | + var map; | |
| 5 | + var realMarkers = {}; | |
| 6 | + var topMarker; | |
| 7 | + //实时路况是否打开 | |
| 8 | + var traffVisible; | |
| 9 | + //线路 Polyline | |
| 10 | + var linePolyline; | |
| 11 | + | |
| 12 | + var polylines={}; | |
| 13 | + var buffAreas = {}; | |
| 14 | + var baiduInstance = { | |
| 15 | + //初始化 | |
| 16 | + init: function(){ | |
| 17 | + map = new BMap.Map($(gb_map_consts.mapContainer)[0]); | |
| 18 | + //中心点和缩放级别 | |
| 19 | + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 15); | |
| 20 | + map.enableScrollWheelZoom(); | |
| 21 | + | |
| 22 | + window.localStorage.setItem('real_map', 'baidu'); | |
| 23 | + | |
| 24 | + // 路况控件 | |
| 25 | + var ctrl = new BMapLib.TrafficControl(); | |
| 26 | + map.addControl(ctrl); | |
| 27 | + | |
| 28 | + $(gb_map_consts.trafficBtn).on('click', function() { | |
| 29 | + if (traffVisible) { | |
| 30 | + ctrl.hide(); | |
| 31 | + traffVisible = false; | |
| 32 | + showLinePolyline(); | |
| 33 | + } else { | |
| 34 | + ctrl.show(); | |
| 35 | + traffVisible = true; | |
| 36 | + hideLinePolyline(); | |
| 37 | + } | |
| 38 | + }); | |
| 39 | + //百度路况控件自身关闭按钮 | |
| 40 | + $('.portlet-fullscreen').on('click', '.maplibTc .maplibTcClose', function(){ | |
| 41 | + traffVisible = false; | |
| 42 | + showLinePolyline(); | |
| 43 | + }); | |
| 44 | + | |
| 45 | + //$('#tcWrap.maplibTc').addClass('animated bounceInLeft'); | |
| 46 | + //$('.maplibTcBtn_deskTop.anchorTR').remove(); | |
| 47 | + }, | |
| 48 | + destroy: function(){ | |
| 49 | + realMarkers = {}; | |
| 50 | + linePolyline = []; | |
| 51 | + }, | |
| 52 | + clear: function(){ | |
| 53 | + realMarkers = {}; | |
| 54 | + map.clearOverlays(); | |
| 55 | + }, | |
| 56 | + //画线路图层 | |
| 57 | + drawLine: function(opts){ | |
| 58 | + if(polylines[opts.key]){ | |
| 59 | + //centerToPolyline(polylines[opts.key]); | |
| 60 | + return; | |
| 61 | + } | |
| 62 | + var plconfg={strokeWeight:6, strokeOpacity:0.5}; | |
| 63 | + var pos = [], tempArray; | |
| 64 | + var route; | |
| 65 | + var polyline; | |
| 66 | + //上行 | |
| 67 | + if(opts.updown==0){ | |
| 68 | + route=opts.route.up; | |
| 69 | + plconfg.strokeColor="blue"; | |
| 70 | + } | |
| 71 | + else if(opts.updown==1){ | |
| 72 | + route=opts.route.down; | |
| 73 | + plconfg.strokeColor="red"; | |
| 74 | + } | |
| 75 | + $.each(route.split(','), function(){ | |
| 76 | + tempArray = this.split(' '); | |
| 77 | + pos.push(new BMap.Point(tempArray[0], tempArray[1])); | |
| 78 | + }); | |
| 79 | + | |
| 80 | + polyline = new BMap.Polyline(pos, plconfg); | |
| 81 | + polylines[opts.key]=polyline; | |
| 82 | + map.addOverlay(polyline); | |
| 83 | + | |
| 84 | + console.log('centerToPolyline...'); | |
| 85 | + centerToPolyline(polyline); | |
| 86 | + }, | |
| 87 | + removeLine: function(opts){ | |
| 88 | + var polyline=polylines[opts.key]; | |
| 89 | + if(polyline){ | |
| 90 | + map.removeOverlay(polyline); | |
| 91 | + polylines[opts.key]=null; | |
| 92 | + delete polylines[opts.key]; | |
| 93 | + } | |
| 94 | + }, | |
| 95 | + //绘制GPS信号 | |
| 96 | + drawRealGpsMarker: function(opts){ | |
| 97 | + var gpsArray = opts.gpsList; | |
| 98 | + var marker, coord; | |
| 99 | + $.each(gpsArray, function(i, gps){ | |
| 100 | + if(opts.coordTransform){ | |
| 101 | + //坐标转换 | |
| 102 | + coord = TransGPS.wgsToBD(gps.lat, gps.lon); | |
| 103 | + gps.bd_lat = coord.lat; | |
| 104 | + gps.bd_lon = coord.lng; | |
| 105 | + } | |
| 106 | + | |
| 107 | + marker = realMarkers[gps.deviceId]; | |
| 108 | + if(marker){ | |
| 109 | + if(gps.timestamp == marker.gpsData.timestamp) | |
| 110 | + return; | |
| 111 | + else | |
| 112 | + moveMarker(marker, gps);//移动marker | |
| 113 | + } | |
| 114 | + else{ | |
| 115 | + //创建marker | |
| 116 | + marker = createBDMarkerByGps(gps); | |
| 117 | + map.addOverlay(marker); | |
| 118 | + //设备号和marker映射 | |
| 119 | + realMarkers[gps.deviceId] = marker; | |
| 120 | + } | |
| 121 | + }); | |
| 122 | + }, | |
| 123 | + removeGps: function(opts){ | |
| 124 | + var deviceArr = opts.deviceArr; | |
| 125 | + $.each(deviceArr, function(){ | |
| 126 | + if(realMarkers[this]){ | |
| 127 | + map.removeOverlay(realMarkers[this]); | |
| 128 | + realMarkers[this]=null; | |
| 129 | + delete realMarkers[this]; | |
| 130 | + } | |
| 131 | + }); | |
| 132 | + }, | |
| 133 | + //定位到marker | |
| 134 | + goToMarker: function(opts){ | |
| 135 | + var deviceId = opts.deviceId | |
| 136 | + ,m = realMarkers[deviceId]; | |
| 137 | + if(m){ | |
| 138 | + map.panTo(m.point); | |
| 139 | + setTop(m); | |
| 140 | + } | |
| 141 | + }, | |
| 142 | + //打开信息窗口 | |
| 143 | + openWindow: function(opts){ | |
| 144 | + var deviceId = opts.deviceId | |
| 145 | + ,m = realMarkers[deviceId]; | |
| 146 | + bdOpenWindow(m); | |
| 147 | + }, | |
| 148 | + //绘制圆形 | |
| 149 | + drawCircle: function(opts){ | |
| 150 | + var coord = TransGPS.wgsToBD(opts.lat, opts.lon); | |
| 151 | + var circle = new BMap.Circle(new BMap.Point(coord.lng, coord.lat), opts.radius); | |
| 152 | + if(opts.color) | |
| 153 | + circle.setStrokeColor(opts.color); | |
| 154 | + if(opts.weight) | |
| 155 | + circle.setStrokeWeight(opts.weight); | |
| 156 | + | |
| 157 | + map.addOverlay(circle); | |
| 158 | + buffAreas[opts.id] = circle; | |
| 159 | + }, | |
| 160 | + //绘制多边形 | |
| 161 | + drawPolygon: function(opts){ | |
| 162 | + var wgs,coord, points = []; | |
| 163 | + $.each(opts.cds, function(){ | |
| 164 | + wgs = this.split(' '); | |
| 165 | + coord = TransGPS.wgsToBD(parseFloat(wgs[1]), parseFloat(wgs[0])); | |
| 166 | + points.push(new BMap.Point(coord.lng, coord.lat)); | |
| 167 | + }); | |
| 168 | + | |
| 169 | + var polygon = new BMap.Polygon(points, {strokeColor: opts.color, strokeWeight: opts.weight, strokeOpacity: 0.7}); | |
| 170 | + map.addOverlay(polygon); | |
| 171 | + buffAreas[opts.id] = polygon; | |
| 172 | + }, | |
| 173 | + //删除缓冲区 | |
| 174 | + clearBuffArea: function(code){ | |
| 175 | + if(buffAreas[code]){ | |
| 176 | + map.removeOverlay(buffAreas[code]); | |
| 177 | + delete buffAreas[code]; | |
| 178 | + } | |
| 179 | + } | |
| 180 | + }; | |
| 181 | + | |
| 182 | + var bd_gps_info_win_opts = { | |
| 183 | + width : 190, | |
| 184 | + height: 255, | |
| 185 | + enableMessage:true | |
| 186 | + }; | |
| 187 | + function createBDMarkerByGps(gpsData){ | |
| 188 | + | |
| 189 | + var point = new BMap.Point(gpsData.bd_lon, gpsData.bd_lat); | |
| 190 | + var marker = new BMap.Marker(point); | |
| 191 | + | |
| 192 | + //根据编码长度 计算marker 宽度 | |
| 193 | + var w = gpsData.nbbm.length * 10; | |
| 194 | + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIcon(gpsData, w), new BMap.Size(w,25))); | |
| 195 | + | |
| 196 | + marker.infoWindow = new BMap.InfoWindow(bd_gps_info_win_opts); | |
| 197 | + marker.gpsData = gpsData; | |
| 198 | + //click | |
| 199 | + marker.addEventListener('click', function(){ | |
| 200 | + bdOpenWindow(this); | |
| 201 | + }); | |
| 202 | + //mouseover | |
| 203 | + marker.addEventListener('mouseover', function(){ | |
| 204 | + setTop(this); | |
| 205 | + }); | |
| 206 | + return marker; | |
| 207 | + } | |
| 208 | + | |
| 209 | + //隐藏线路线条 | |
| 210 | + function hideLinePolyline(){ | |
| 211 | + if(!linePolyline || linePolyline.length == 0) | |
| 212 | + return; | |
| 213 | + | |
| 214 | + layer.msg('隐藏线路图层',{offset: 'ct', shift : 5}); | |
| 215 | + $.each(linePolyline, function(){ | |
| 216 | + this.setStrokeOpacity(0.1); | |
| 217 | + }); | |
| 218 | + } | |
| 219 | + | |
| 220 | + //显示线路线条 | |
| 221 | + function showLinePolyline(){ | |
| 222 | + if(!linePolyline || linePolyline.length == 0) | |
| 223 | + return; | |
| 224 | + | |
| 225 | + layer.msg('显示线路图层',{offset: 'ct', shift : 5}); | |
| 226 | + $.each(linePolyline, function(){ | |
| 227 | + this.setStrokeOpacity(0.5); | |
| 228 | + }); | |
| 229 | + } | |
| 230 | + | |
| 231 | + function moveMarker(m, gps){ | |
| 232 | + m.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat)); | |
| 233 | + m.gpsData = gps; | |
| 234 | + //重新设置icon | |
| 235 | + //根据编码长度 计算marker 宽度 | |
| 236 | + var w = gps.nbbm.length * 10; | |
| 237 | + m.setIcon(new BMap.Icon(gb_map_imap.createCarIcon(gps, w), new BMap.Size(w,25))); | |
| 238 | + | |
| 239 | + //更新 infoWindow | |
| 240 | + if(m.infoWindow.isOpen()){ | |
| 241 | + bdOpenWindow(m); | |
| 242 | + } | |
| 243 | + } | |
| 244 | + | |
| 245 | + function setTop(m){ | |
| 246 | + if(topMarker) | |
| 247 | + topMarker.setTop(false); | |
| 248 | + m.setTop(true); | |
| 249 | + topMarker = m; | |
| 250 | + } | |
| 251 | + | |
| 252 | + function bdOpenWindow(marker){ | |
| 253 | + marker.gpsData.fromNow = moment(marker.gpsData.timestamp).fromNow(); | |
| 254 | + | |
| 255 | + marker.infoWindow.setContent(template('map_gps_info_win_temp', marker.gpsData)); | |
| 256 | + map.openInfoWindow(marker.infoWindow, marker.point); | |
| 257 | + } | |
| 258 | + | |
| 259 | + function centerToPolyline(polyline){ | |
| 260 | + var pos=polyline.getPath(); | |
| 261 | + map.panTo(pos[parseInt(pos.length / 2)]); | |
| 262 | + } | |
| 263 | + | |
| 264 | + //文件载入完毕 | |
| 265 | + mapmonitor_load_ep.emitLater('load_baidu'); | |
| 266 | + | |
| 267 | + return baiduInstance; | |
| 268 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/js/map/platform/gaode.js
0 → 100644
| 1 | +/** 高德地图相关接口封装 */ | |
| 2 | +var gb_map_gaode = (function() { | |
| 3 | + | |
| 4 | + var mapLoadAnim = '<div class="sk-cube-grid _center">' | |
| 5 | + + '<div class="sk-cube sk-cube1"></div>' | |
| 6 | + + '<div class="sk-cube sk-cube2"></div>' | |
| 7 | + + '<div class="sk-cube sk-cube3"></div>' | |
| 8 | + + '<div class="sk-cube sk-cube4"></div>' | |
| 9 | + + '<div class="sk-cube sk-cube5"></div>' | |
| 10 | + + '<div class="sk-cube sk-cube6"></div>' | |
| 11 | + + '<div class="sk-cube sk-cube7"></div>' | |
| 12 | + + '<div class="sk-cube sk-cube8"></div>' | |
| 13 | + + '<div class="sk-cube sk-cube9"></div>' + '</div>'; | |
| 14 | + | |
| 15 | + var map; | |
| 16 | + var topMarkr; | |
| 17 | + var realMarkers = {}; | |
| 18 | + //线路路由线条 | |
| 19 | + var linePolyline; | |
| 20 | + //实时路况是否显示 | |
| 21 | + var traffVisible; | |
| 22 | + var gaodeInstance = { | |
| 23 | + init : function() { | |
| 24 | + var $mapCon = $(gb_map_consts.mapContainer); | |
| 25 | + $mapCon.html(mapLoadAnim); | |
| 26 | + //设置样式 | |
| 27 | + gaodeInstance.setStyle(); | |
| 28 | + | |
| 29 | + map = new AMap.Map($mapCon[0]); | |
| 30 | + // 地图中心和缩放级别 | |
| 31 | + map.setZoomAndCenter(14, [ gb_map_consts.center_point.lng, gb_map_consts.center_point.lat ]); | |
| 32 | + // 加载完成 | |
| 33 | + AMap.event.addListener(map, 'complete', function() { | |
| 34 | + layer.closeAll(); | |
| 35 | + window.localStorage.setItem('real_map', 'gaode'); | |
| 36 | + /*storage.setItem('real_map', REAL_GAODE_TEXT); | |
| 37 | + $('.sk-cube-grid._center').remove();*/ | |
| 38 | + }); | |
| 39 | + | |
| 40 | + // 实时路况图层 | |
| 41 | + var trafficLayer = new AMap.TileLayer.Traffic(); | |
| 42 | + trafficLayer.setMap(map); | |
| 43 | + trafficLayer.hide(); | |
| 44 | + | |
| 45 | + $(gb_map_consts.trafficBtn).on('click', function() { | |
| 46 | + if (traffVisible) { | |
| 47 | + trafficLayer.hide(); | |
| 48 | + traffVisible = false; | |
| 49 | + $(this).removeClass('active'); | |
| 50 | + showLinePolyline(); | |
| 51 | + } else { | |
| 52 | + trafficLayer.show(); | |
| 53 | + traffVisible = true; | |
| 54 | + $(this).addClass('active'); | |
| 55 | + hideLinePolyline(); | |
| 56 | + } | |
| 57 | + }); | |
| 58 | + }, | |
| 59 | + setStyle : function() { | |
| 60 | + $('.mapRightWrap').addClass('gaode'); | |
| 61 | + $('.mapTools').addClass('gaode'); | |
| 62 | + $('.leftUtils').addClass('gaode'); | |
| 63 | + }, | |
| 64 | + destroy:function(){ | |
| 65 | + realMarkers = {}; | |
| 66 | + $('.mapRightWrap').removeClass('gaode'); | |
| 67 | + $('.mapTools').removeClass('gaode'); | |
| 68 | + $('.leftUtils').removeClass('gaode'); | |
| 69 | + }, | |
| 70 | + clear: function(){ | |
| 71 | + realMarkers = {}; | |
| 72 | + map.clearMap(); | |
| 73 | + linePolyline = []; | |
| 74 | + }, | |
| 75 | + drawLine: function(opts){ | |
| 76 | + linePolyline = []; | |
| 77 | + | |
| 78 | + map.clearMap(); | |
| 79 | + | |
| 80 | + var upArr = [], downArr = []; | |
| 81 | + var upLineOps = {path: upArr, strokeColor:"blue", strokeWeight:6, strokeOpacity:0.5} | |
| 82 | + ,downLineOps = {path: downArr, strokeColor:"red", strokeWeight:6, strokeOpacity:0.5}; | |
| 83 | + var route = opts.route; | |
| 84 | + //上行 | |
| 85 | + if(route.up){ | |
| 86 | + $.each(route.up_gcj.split(','), function(){ | |
| 87 | + tempArray = this.split(' '); | |
| 88 | + upArr.push([tempArray[0], tempArray[1]]); | |
| 89 | + }); | |
| 90 | + var upLine = new AMap.Polyline(upLineOps); | |
| 91 | + //保存线条引用 | |
| 92 | + linePolyline.push(upLine); | |
| 93 | + upLine.setMap(map); | |
| 94 | + map.setCenter(upArr[parseInt(upArr.length / 2)]); | |
| 95 | + | |
| 96 | + } | |
| 97 | + //下行 | |
| 98 | + if(route.down){ | |
| 99 | + $.each(route.down_gcj.split(','), function(){ | |
| 100 | + tempArray = this.split(' '); | |
| 101 | + downArr.push([tempArray[0], tempArray[1]]); | |
| 102 | + }); | |
| 103 | + var downLine = new AMap.Polyline(downLineOps); | |
| 104 | + //保存线条引用 | |
| 105 | + linePolyline.push(downLine); | |
| 106 | + downLine.setMap(map); | |
| 107 | + } | |
| 108 | + //实时路况下不显示 | |
| 109 | + if(traffVisible) | |
| 110 | + hideLinePolyline(); | |
| 111 | + }, | |
| 112 | + drawRealGpsMarker: function(opts){ | |
| 113 | + var gpsArray = opts.gpsList; | |
| 114 | + var coord; | |
| 115 | + $.each(gpsArray, function(i, gps){ | |
| 116 | + if(opts.coordTransform){ | |
| 117 | + coord = TransGPS.transformFromWGSToGCJ(gps.lat, gps.lon); | |
| 118 | + gps.gcj_lat = coord.lat; | |
| 119 | + gps.gcj_lon = coord.lng; | |
| 120 | + } | |
| 121 | + | |
| 122 | + marker = realMarkers[gps.deviceId]; | |
| 123 | + if(marker){ | |
| 124 | + if(gps.timestamp == marker.gpsData.timestamp) | |
| 125 | + return; | |
| 126 | + else | |
| 127 | + moveMarker(marker, gps);//移动marker | |
| 128 | + } | |
| 129 | + else{ | |
| 130 | + var marker = createGDMarkerByGps(gps); | |
| 131 | + realMarkers[gps.deviceId] = marker | |
| 132 | + } | |
| 133 | + }); | |
| 134 | + }, | |
| 135 | + goToMarker: function(opts){ | |
| 136 | + var deviceId = opts.deviceId | |
| 137 | + ,m = realMarkers[deviceId]; | |
| 138 | + if(m){ | |
| 139 | + map.setCenter(m.getPosition()); | |
| 140 | + setTop(m); | |
| 141 | + } | |
| 142 | + }, | |
| 143 | + openWindow: function(opts){ | |
| 144 | + var deviceId = opts.deviceId | |
| 145 | + ,m = realMarkers[deviceId]; | |
| 146 | + openWindow(m); | |
| 147 | + } | |
| 148 | + }; | |
| 149 | + | |
| 150 | + function createGDMarkerByGps(gps){ | |
| 151 | + //根据编码长度 计算marker 宽度 | |
| 152 | + var w = gps.nbbm.length * 10; | |
| 153 | + | |
| 154 | + var marker = new AMap.Marker({ | |
| 155 | + map: map, | |
| 156 | + position: [gps.gcj_lon, gps.gcj_lat], | |
| 157 | + icon: new AMap.Icon({ | |
| 158 | + size: new AMap.Size(w, 25), //图标大小 | |
| 159 | + image: iMap.createCarIcon(gps, w) | |
| 160 | + }), | |
| 161 | + offset: new AMap.Pixel(-35, -12) | |
| 162 | + }); | |
| 163 | + | |
| 164 | + //绑定数据 | |
| 165 | + marker.gpsData = gps; | |
| 166 | + marker.infoWindow = new AMap.InfoWindow(); | |
| 167 | + | |
| 168 | + marker.on('mouseover', function(){ | |
| 169 | + setTop(this); | |
| 170 | + }); | |
| 171 | + //点击事件 | |
| 172 | + marker.on('click', function(){ | |
| 173 | + openWindow(this); | |
| 174 | + }); | |
| 175 | + | |
| 176 | + return marker; | |
| 177 | + } | |
| 178 | + | |
| 179 | + function moveMarker(m, gps){ | |
| 180 | + m.setPosition(new AMap.LngLat(gps.gcj_lon, gps.gcj_lat)); | |
| 181 | + m.gpsData = gps; | |
| 182 | + //重新设置icon | |
| 183 | + //根据编码长度 计算marker 宽度 | |
| 184 | + var w = gps.nbbm.length * 10; | |
| 185 | + m.setIcon(new AMap.Icon({ | |
| 186 | + size: new AMap.Size(w, 25), | |
| 187 | + image: iMap.createCarIcon(gps, w) | |
| 188 | + })); | |
| 189 | + | |
| 190 | + if(m.infoWindow.getIsOpen()) | |
| 191 | + openWindow(m); | |
| 192 | + } | |
| 193 | + | |
| 194 | + //隐藏线路线条 | |
| 195 | + function hideLinePolyline(){ | |
| 196 | + if(!linePolyline || linePolyline.length == 0) | |
| 197 | + return; | |
| 198 | + layer.msg('隐藏线路图层',{offset: 'ct', shift : 5}); | |
| 199 | + $.each(linePolyline, function(){ | |
| 200 | + this.setOptions({strokeOpacity: 0}); | |
| 201 | + }); | |
| 202 | + } | |
| 203 | + | |
| 204 | + //显示线路线条 | |
| 205 | + function showLinePolyline(){ | |
| 206 | + if(!linePolyline || linePolyline.length == 0) | |
| 207 | + return; | |
| 208 | + | |
| 209 | + layer.msg('显示线路图层',{offset: 'ct', shift : 5}); | |
| 210 | + $.each(linePolyline, function(){ | |
| 211 | + this.setOptions({strokeOpacity: 0.5}); | |
| 212 | + }); | |
| 213 | + } | |
| 214 | + | |
| 215 | + function openWindow(marker){ | |
| 216 | + marker.gpsData.fromNow = moment(marker.gpsData.timestamp).fromNow(); | |
| 217 | + /*var infoWindow = new AMap.InfoWindow({ | |
| 218 | + content: template('gps_info_win_temp', marker.gpsData) | |
| 219 | + });*/ | |
| 220 | + marker.infoWindow.setContent(template('gps_info_win_temp', marker.gpsData)); | |
| 221 | + marker.infoWindow.open(map, marker.getPosition()); | |
| 222 | + } | |
| 223 | + | |
| 224 | + function setTop(marker){ | |
| 225 | + if(topMarkr) | |
| 226 | + topMarkr.setzIndex(1); | |
| 227 | + marker.setzIndex(2); | |
| 228 | + topMarkr = marker; | |
| 229 | + } | |
| 230 | + | |
| 231 | + //文件载入完毕 | |
| 232 | + mapmonitor_load_ep.emitLater('load_gaode'); | |
| 233 | + | |
| 234 | + return gaodeInstance; | |
| 235 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/js/real.js
0 → 100644
| 1 | +var mapmonitor_load_ep = EventProxy.create('load_iMap', 'load_baidu', 'load_gaode', 'load_gps_tree', function() { | |
| 2 | + moment.locale('zh-cn'); | |
| 3 | + //地图 | |
| 4 | + gb_map_imap.addMap('baidu', '百度地图', gb_map_baidu) | |
| 5 | + .addMap('gaode', '高德地图', gb_map_gaode) | |
| 6 | + .call('init'); | |
| 7 | + | |
| 8 | + $('#mapTypeDrop li').on('click', function() { | |
| 9 | + gb_map_imap.changeDefault($(this).data('id')); | |
| 10 | + }); | |
| 11 | + | |
| 12 | + //设备树 | |
| 13 | + gb_map_gps_tree.init(); | |
| 14 | + //轨迹回放form | |
| 15 | + gb_map_playback.init(); | |
| 16 | + | |
| 17 | + $('#openFullWindow').on('click', function(){ | |
| 18 | + window.open('/pages/mapmonitor/alone/wrap.html','alone_map' ); | |
| 19 | + }); | |
| 20 | +}); | |
| 21 | + | |
| 22 | +var gb_map_consts = { | |
| 23 | + mapContainer: '#mapContainer', | |
| 24 | + center_point: { | |
| 25 | + lng: 121.544336, | |
| 26 | + lat: 31.221315 | |
| 27 | + }, | |
| 28 | + allGps: {}, | |
| 29 | + trafficBtn: '#trafficChangeBtn' //实时路况按钮 | |
| 30 | +} | |
| 31 | + | |
| 32 | +//Canvas 带圆角的矩形 | |
| 33 | +CanvasRenderingContext2D.prototype.roundRect = function (x, y, w, h, r) { | |
| 34 | + if (w < 2 * r) r = w / 2; | |
| 35 | + if (h < 2 * r) r = h / 2; | |
| 36 | + this.strokeStyle ='rgba(0,102,0,.1)'; | |
| 37 | + this.beginPath(); | |
| 38 | + this.moveTo(x+r, y); | |
| 39 | + this.arcTo(x+w, y, x+w, y+h, r); | |
| 40 | + this.arcTo(x+w, y+h, x, y+h, r); | |
| 41 | + this.arcTo(x, y+h, x, y, r); | |
| 42 | + this.arcTo(x, y, x+w, y, r); | |
| 43 | + this.closePath(); | |
| 44 | + return this; | |
| 45 | +} | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/real_monitor/real.html
0 → 100644
| 1 | +<link href="/assets/css/TrafficControl.css" rel="stylesheet" /> | |
| 2 | +<link rel="stylesheet" href="/real_control_v2/mapmonitor/real_monitor/css/real.css" /> | |
| 3 | +<div id="mapContainer"></div> | |
| 4 | +<div class="map-system-msg z-depth-2"> | |
| 5 | + 当前地图模块正在维护升级,请点击左侧 新窗口 按钮打开原版地图。 | |
| 6 | +</div> | |
| 7 | +<nav class="uk-navbar map-lt-tools z-depth-2"> | |
| 8 | + <ul class="uk-navbar-nav"> | |
| 9 | + <li class="uk-parent" data-uk-dropdown> | |
| 10 | + <a><span id="curr_map_name">百度地图</span> <i class="uk-icon-caret-down"></i></a> | |
| 11 | + <div class="uk-dropdown uk-dropdown-navbar" > | |
| 12 | + <ul class="uk-nav uk-nav-navbar" id="mapTypeDrop"> | |
| 13 | + <li data-id="baidu"><a>百度地图</a></li> | |
| 14 | + <li data-id="gaode"><a>高德地图</a></li> | |
| 15 | + </ul> | |
| 16 | + </div> | |
| 17 | + </li> | |
| 18 | + <li id="trafficChangeBtn"><a>路况</a></li> | |
| 19 | + <li id="openFullWindow"><a>新窗口</a></li> | |
| 20 | + </ul> | |
| 21 | +</nav> | |
| 22 | + | |
| 23 | +<div class="map_rt_wrap"> | |
| 24 | + <ul class="uk-tab z-depth-2" data-uk-tab data-uk-switcher="{connect:'#mapRtContainer'}"> | |
| 25 | + <li class="uk-active"><a>实时监控</a></li> | |
| 26 | + <li class="uk-disabled"><a><i class="uk-icon-search"></i> 搜索</a></li> | |
| 27 | + <li class="uk-disabled"><a><i class="uk-icon-history"></i> 回放</a></li> | |
| 28 | + <li class="uk-disabled"><a>安全行车</a></li> | |
| 29 | + </ul> | |
| 30 | + <ul id="mapRtContainer" class="uk-switcher z-depth-2"> | |
| 31 | + <li class="real_monitor"></li> | |
| 32 | + <li class="search_panel">搜索</li> | |
| 33 | + <li class="play_back">轨迹回放</li> | |
| 34 | + <li>安全行车</li> | |
| 35 | + </ul> | |
| 36 | +</div> | |
| 37 | +<!-- gps信息窗口 --> | |
| 38 | +<script id="map_gps_info_win_temp" type="text/html"> | |
| 39 | +<div class="gps_info_win"> | |
| 40 | +<h5 style="color:#0E6AF9;"> | |
| 41 | +{{if stationName!=null}} | |
| 42 | + {{stationName}} | |
| 43 | +{{else}} | |
| 44 | + 未知站点 | |
| 45 | +{{/if}} | |
| 46 | +</h5> | |
| 47 | +<h4 style="margin: 5px 0 5px 0;"> | |
| 48 | + <span style="color: #0E6AF9;">{{nbbm}}</span> | |
| 49 | +</h4> | |
| 50 | +<p> | |
| 51 | +营运状态:{{if state==0}}营运{{else}}非营运{{/if}} | |
| 52 | +</p> | |
| 53 | +<p> | |
| 54 | +走向:{{if upDown==0}}上行{{else if upDown==1}}下行{{else}}未知走向{{/if}} | |
| 55 | +</p> | |
| 56 | +<p>速度:{{speed}}</p> | |
| 57 | +<p>经度:{{lon}}</p> | |
| 58 | +<p>纬度:{{lat}}</p> | |
| 59 | + | |
| 60 | +<p style="color: gray;">{{fromNow}} 更新</p> | |
| 61 | +<hr> | |
| 62 | +<p> | |
| 63 | +{{if currSch!=null}} | |
| 64 | + 路牌:{{currSch.lpName}} | |
| 65 | +{{/if}} | |
| 66 | +</p> | |
| 67 | +<p class="banci-info"> | |
| 68 | + {{if currSch!=null}}开往 {{currSch.zdzName}}{{/if}} | |
| 69 | +</p> | |
| 70 | +<p class="banci-info"> | |
| 71 | +{{if nextSch!=null}} | |
| 72 | + 下一班{{nextSch.qdzName}} {{nextSch.fcsj}} 发车 | |
| 73 | +{{/if}} | |
| 74 | +</p> | |
| 75 | +<a href="javascript:lineGroup.toPlayBack('{{nbbm}}', '{{lineId}}')" class="link_to_pback" style="color:#006600;font-size:12px;">轨迹回放</a> | |
| 76 | +</div> | |
| 77 | +</script> | |
| 78 | +<script src="/real_control_v2/mapmonitor/real_monitor/js/gps_play_back.js"></script> | |
| 79 | +<script src="/real_control_v2/mapmonitor/real_monitor/js/real.js"></script> | |
| 80 | +<script src="/real_control_v2/mapmonitor/real_monitor/js/map/iMap.js"></script> | |
| 81 | +<script src="/real_control_v2/mapmonitor/real_monitor/js/map/iMap.js"></script> | |
| 82 | +<script src="/real_control_v2/mapmonitor/real_monitor/js/map/platform/baidu.js"></script> | |
| 83 | +<script src="/real_control_v2/mapmonitor/real_monitor/js/map/platform/gaode.js"></script> | |
| 84 | +<script src="/real_control_v2/mapmonitor/real_monitor/js/gps_tree.js"></script> | ... | ... |