Commit 7c055cbf27425cccce0794f8666550850f232b67
Merge branch 'minhang' into qingpu
# Conflicts: # src/main/resources/ms-jdbc.properties
Showing
38 changed files
with
2042 additions
and
412 deletions
src/main/java/com/bsth/controller/forecast/SampleController.java
| 1 | 1 | package com.bsth.controller.forecast; |
| 2 | 2 | |
| 3 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 3 | 4 | import org.springframework.web.bind.annotation.RequestMapping; |
| 4 | 5 | import org.springframework.web.bind.annotation.RestController; |
| 5 | 6 | |
| 6 | 7 | import com.bsth.controller.BaseController; |
| 7 | 8 | import com.bsth.entity.forecast.Sample; |
| 9 | +import com.bsth.service.forecast.SampleService; | |
| 8 | 10 | |
| 9 | 11 | @RestController |
| 10 | 12 | @RequestMapping("sample") |
| 11 | 13 | public class SampleController extends BaseController<Sample, Long>{ |
| 12 | 14 | |
| 15 | + @Autowired | |
| 16 | + SampleService sampleService; | |
| 17 | + | |
| 18 | + @RequestMapping("/create/gps") | |
| 19 | + public int createDataByGps(String lineCode, Integer updown){ | |
| 20 | + return sampleService.createDataByGps(lineCode, updown); | |
| 21 | + } | |
| 13 | 22 | } | ... | ... |
src/main/java/com/bsth/controller/schedule/SchedulePlanController.java
| ... | ... | @@ -4,11 +4,10 @@ import com.bsth.controller.BaseController; |
| 4 | 4 | import com.bsth.entity.schedule.SchedulePlan; |
| 5 | 5 | import com.bsth.service.schedule.SchedulePlanService; |
| 6 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | -import org.springframework.web.bind.annotation.RequestBody; | |
| 8 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 9 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 10 | -import org.springframework.web.bind.annotation.RestController; | |
| 7 | +import org.springframework.web.bind.annotation.*; | |
| 11 | 8 | |
| 9 | +import java.util.Date; | |
| 10 | +import java.util.List; | |
| 12 | 11 | import java.util.Map; |
| 13 | 12 | |
| 14 | 13 | /** |
| ... | ... | @@ -35,5 +34,21 @@ public class SchedulePlanController extends BaseController<SchedulePlan, Long> { |
| 35 | 34 | return baseService.save(t); |
| 36 | 35 | } |
| 37 | 36 | |
| 37 | + // TODO: | |
| 38 | +// @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET) | |
| 39 | +// public List<Map<String, Object>> findGroupInfo( | |
| 40 | +// Integer xlid, Date scheduleDate) { | |
| 41 | +// | |
| 42 | +// } | |
| 43 | + | |
| 44 | + @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET) | |
| 45 | + public List<Map<String, Object>> findGroupInfo( | |
| 46 | + @PathVariable(value = "xlid") Integer xlid, | |
| 47 | + @PathVariable(value = "date") Date scheduleDate) { | |
| 48 | + return schedulePlanService.findGroupInfo(xlid, scheduleDate); | |
| 49 | + } | |
| 50 | + | |
| 51 | +// public int updateGroupInfo | |
| 52 | + | |
| 38 | 53 | |
| 39 | 54 | } | ... | ... |
src/main/java/com/bsth/controller/schedule/ScheduleRule1FlatController.java
| 1 | 1 | package com.bsth.controller.schedule; |
| 2 | 2 | |
| 3 | 3 | import com.bsth.controller.BaseController; |
| 4 | -import com.bsth.entity.schedule.EmployeeConfigInfo; | |
| 5 | -import com.bsth.entity.schedule.GuideboardInfo; | |
| 6 | 4 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 7 | 5 | import com.bsth.repository.schedule.ScheduleRule1FlatRepository; |
| 8 | -import com.bsth.service.schedule.EmployeeConfigInfoService; | |
| 9 | -import com.bsth.service.schedule.GuideboardInfoService; | |
| 10 | -import org.apache.commons.lang3.StringUtils; | |
| 11 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 7 | import org.springframework.web.bind.annotation.*; |
| 13 | 8 | |
| 14 | -import java.util.HashMap; | |
| 15 | 9 | import java.util.Map; |
| 16 | 10 | |
| 17 | 11 | /** |
| ... | ... | @@ -23,10 +17,6 @@ public class ScheduleRule1FlatController extends BaseController<ScheduleRule1Fla |
| 23 | 17 | |
| 24 | 18 | @Autowired |
| 25 | 19 | private ScheduleRule1FlatRepository scheduleRule1FlatRepository; |
| 26 | - @Autowired | |
| 27 | - private GuideboardInfoService guideboardInfoService; | |
| 28 | - @Autowired | |
| 29 | - private EmployeeConfigInfoService employeeConfigInfoService; | |
| 30 | 20 | |
| 31 | 21 | @Override |
| 32 | 22 | public ScheduleRule1Flat findById(@PathVariable("id") Long aLong) { |
| ... | ... | @@ -44,63 +34,6 @@ public class ScheduleRule1FlatController extends BaseController<ScheduleRule1Fla |
| 44 | 34 | */ |
| 45 | 35 | @RequestMapping(method = RequestMethod.POST) |
| 46 | 36 | public Map<String, Object> save(@RequestBody ScheduleRule1Flat t){ |
| 47 | - // TODO:根据编码查找id,不做错误检测,暂时这样做,以后前端直接传过来 | |
| 48 | - // 1、查找路牌配置id | |
| 49 | - Map<String, Object> param1 = new HashMap<>(); | |
| 50 | - param1.put("xl.id_eq", t.getXl().getId()); | |
| 51 | - param1.put("lpName_eq", null); | |
| 52 | - | |
| 53 | - String[] lpNames = t.getLpNames().split(","); | |
| 54 | - String[] lpIds = new String[lpNames.length]; | |
| 55 | - for (int i = 0; i < lpNames.length; i++) { | |
| 56 | - param1.put("lpName_eq", lpNames[i]); | |
| 57 | - Iterable<GuideboardInfo> guideboardInfos = guideboardInfoService.list(param1); | |
| 58 | - if (!guideboardInfos.iterator().hasNext()) { | |
| 59 | - throw new RuntimeException("路牌:" + lpNames[i] + "没有找到!"); | |
| 60 | - } | |
| 61 | - lpIds[i] = guideboardInfos.iterator().next().getId().toString(); | |
| 62 | - } | |
| 63 | - t.setLpIds(StringUtils.join(lpIds, ",")); | |
| 64 | - | |
| 65 | - // 2、查找人员配置id(这里要考虑分班的情况,先用-隔开,在用,隔开) | |
| 66 | - Map<String, Object> param2 = new HashMap<>(); | |
| 67 | - param2.put("xl.id_eq", t.getXl().getId()); | |
| 68 | - param2.put("dbbm_eq", null); | |
| 69 | - | |
| 70 | - String[] ryDbbms = t.getRyDbbms().split(","); | |
| 71 | - String[] ryIds = new String[ryDbbms.length]; | |
| 72 | - for (int j = 0; j < ryDbbms.length; j++) { | |
| 73 | - if (ryDbbms[j].indexOf("-") == -1) { | |
| 74 | - param2.put("dbbm_eq", ryDbbms[j]); | |
| 75 | - Iterable<EmployeeConfigInfo> employeeConfigInfos = employeeConfigInfoService.list(param2); | |
| 76 | - if (!employeeConfigInfos.iterator().hasNext()) { | |
| 77 | - throw new RuntimeException("搭班编码::" + ryDbbms[j] + "没有找到!"); | |
| 78 | - } | |
| 79 | - ryIds[j] = employeeConfigInfos.iterator().next().getId().toString(); | |
| 80 | - } else { | |
| 81 | - String[] fbRyDbbms = ryDbbms[j].split("-"); | |
| 82 | - if (fbRyDbbms.length != 2) { | |
| 83 | - throw new RuntimeException("搭班编码:" + ryDbbms[j] + "错误!"); | |
| 84 | - } | |
| 85 | - String[] fbRyIds = new String[2]; | |
| 86 | - param2.put("dbbm_eq", fbRyDbbms[0]); | |
| 87 | - Iterable<EmployeeConfigInfo> employeeConfigInfos = employeeConfigInfoService.list(param2); | |
| 88 | - if (!employeeConfigInfos.iterator().hasNext()) { | |
| 89 | - throw new RuntimeException("搭班编码::" + fbRyDbbms[0] + "没有找到!"); | |
| 90 | - } | |
| 91 | - fbRyIds[0] = employeeConfigInfos.iterator().next().getId().toString(); | |
| 92 | - param2.put("dbbm_eq", fbRyDbbms[1]); | |
| 93 | - employeeConfigInfos = employeeConfigInfoService.list(param2); | |
| 94 | - if (!employeeConfigInfos.iterator().hasNext()) { | |
| 95 | - throw new RuntimeException("搭班编码::" + fbRyDbbms[1] + "没有找到!"); | |
| 96 | - } | |
| 97 | - fbRyIds[1] = employeeConfigInfos.iterator().next().getId().toString(); | |
| 98 | - ryIds[j] = StringUtils.join(fbRyIds, "-"); | |
| 99 | - } | |
| 100 | - | |
| 101 | - } | |
| 102 | - t.setRyConfigIds(StringUtils.join(ryIds, ",")); | |
| 103 | - | |
| 104 | 37 | return baseService.save(t); |
| 105 | 38 | } |
| 106 | 39 | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| ... | ... | @@ -75,7 +75,7 @@ public class BasicData implements CommandLineRunner{ |
| 75 | 75 | |
| 76 | 76 | @Override |
| 77 | 77 | public void run(String... arg0) throws Exception { |
| 78 | - Application.mainServices.scheduleWithFixedDelay(dataLoader, 0, 2, TimeUnit.HOURS); | |
| 78 | + Application.mainServices.scheduleWithFixedDelay(dataLoader, 0, 1, TimeUnit.HOURS); | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | ... | ... |
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
| ... | ... | @@ -62,8 +62,8 @@ public class GpsRealData implements CommandLineRunner{ |
| 62 | 62 | |
| 63 | 63 | @Override |
| 64 | 64 | public void run(String... arg0) throws Exception { |
| 65 | - logger.info("gpsDataLoader,20,8"); | |
| 66 | - Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 8, TimeUnit.SECONDS); | |
| 65 | + logger.info("gpsDataLoader,20,6"); | |
| 66 | + Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 6, TimeUnit.SECONDS); | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | public static GpsEntity add(GpsEntity gps) { | ... | ... |
src/main/java/com/bsth/repository/forecast/SampleRepository.java
| 1 | 1 | package com.bsth.repository.forecast; |
| 2 | 2 | |
| 3 | +import org.springframework.data.jpa.repository.Modifying; | |
| 4 | +import org.springframework.data.jpa.repository.Query; | |
| 3 | 5 | import org.springframework.stereotype.Repository; |
| 6 | +import org.springframework.transaction.annotation.Transactional; | |
| 4 | 7 | |
| 5 | 8 | import com.bsth.entity.forecast.Sample; |
| 6 | 9 | import com.bsth.repository.BaseRepository; |
| ... | ... | @@ -8,4 +11,9 @@ import com.bsth.repository.BaseRepository; |
| 8 | 11 | @Repository |
| 9 | 12 | public interface SampleRepository extends BaseRepository<Sample, Long>{ |
| 10 | 13 | |
| 14 | + | |
| 15 | + @Transactional | |
| 16 | + @Modifying | |
| 17 | + @Query("delete Sample where lineCode=?1 and updown=?2") | |
| 18 | + void deleteByLineAndUpdown(Integer lineCode, int updown); | |
| 11 | 19 | } | ... | ... |
src/main/java/com/bsth/repository/schedule/SchedulePlanRepository.java
| ... | ... | @@ -6,8 +6,15 @@ import org.springframework.data.domain.Page; |
| 6 | 6 | import org.springframework.data.domain.Pageable; |
| 7 | 7 | import org.springframework.data.jpa.domain.Specification; |
| 8 | 8 | import org.springframework.data.jpa.repository.EntityGraph; |
| 9 | +import org.springframework.data.jpa.repository.Query; | |
| 10 | +import org.springframework.data.repository.query.Param; | |
| 9 | 11 | import org.springframework.stereotype.Repository; |
| 10 | 12 | |
| 13 | +import javax.persistence.SqlResultSetMapping; | |
| 14 | +import java.util.Date; | |
| 15 | +import java.util.List; | |
| 16 | +import java.util.Map; | |
| 17 | + | |
| 11 | 18 | /** |
| 12 | 19 | * Created by xu on 16/6/16. |
| 13 | 20 | */ |
| ... | ... | @@ -17,4 +24,37 @@ public interface SchedulePlanRepository extends BaseRepository<SchedulePlan, Lon |
| 17 | 24 | @Override |
| 18 | 25 | Page<SchedulePlan> findAll(Specification<SchedulePlan> spec, Pageable pageable); |
| 19 | 26 | |
| 27 | + @Query(value = " select " + | |
| 28 | + "xl_name as xlName, " + | |
| 29 | + "schedule_date as scheduleDate, " + | |
| 30 | + "lp_name as lpName, " + | |
| 31 | + "cl_zbh as clZbh, " + | |
| 32 | + "group_concat(distinct fcsj) ccsj, " + | |
| 33 | + "group_concat(distinct j_gh) jsyGh, " + | |
| 34 | + "group_concat(distinct j_name) jsyName, " + | |
| 35 | + "group_concat(distinct s_gh) spyGh, " + | |
| 36 | + "group_concat(distinct s_name) spyName, " + | |
| 37 | + "max(create_date) as createDate " + | |
| 38 | + "from bsth_c_s_sp_info " + | |
| 39 | + "where bc_type = 'out' and " + | |
| 40 | + "xl = ?1 and " + | |
| 41 | + "schedule_date = ?2 " + | |
| 42 | + "group by xl_name, schedule_date, lp_name " + | |
| 43 | + "order by xl_name, schedule_date, lp ", nativeQuery = true) | |
| 44 | + List<Object[]> findGroupInfo(Integer xlid, Date scheduleDate); | |
| 45 | + | |
| 46 | + @Query(value = "update " + | |
| 47 | + "bsth_c_s_sp_info " + | |
| 48 | + "set cl = :p1, cl_zbh = :p2 " + | |
| 49 | + "where xl = :p3 and " + | |
| 50 | + "schedule_date = :p4 and " + | |
| 51 | + "lp_name = :p5 ", | |
| 52 | + nativeQuery = true) | |
| 53 | + int updateGroupInfo_clinfo( | |
| 54 | + @Param("p1") Integer clid, | |
| 55 | + @Param("p2") String clZbh, | |
| 56 | + @Param("p3") Integer xlid, | |
| 57 | + @Param("p4") Date scheduleDate, | |
| 58 | + @Param("p5") String lpName); | |
| 59 | + | |
| 20 | 60 | } | ... | ... |
src/main/java/com/bsth/service/forecast/SampleService.java
src/main/java/com/bsth/service/forecast/SampleServiceImpl.java
| ... | ... | @@ -3,15 +3,22 @@ package com.bsth.service.forecast; |
| 3 | 3 | import java.util.Iterator; |
| 4 | 4 | import java.util.Map; |
| 5 | 5 | |
| 6 | +import javax.transaction.Transactional; | |
| 7 | + | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 6 | 9 | import org.springframework.stereotype.Service; |
| 7 | 10 | |
| 8 | 11 | import com.bsth.data.BasicData; |
| 9 | 12 | import com.bsth.entity.forecast.Sample; |
| 13 | +import com.bsth.repository.forecast.SampleRepository; | |
| 10 | 14 | import com.bsth.service.impl.BaseServiceImpl; |
| 11 | 15 | |
| 12 | 16 | @Service |
| 13 | -public class SampleServiceImpl extends BaseServiceImpl<Sample, Long>{ | |
| 17 | +public class SampleServiceImpl extends BaseServiceImpl<Sample, Long> implements SampleService{ | |
| 14 | 18 | |
| 19 | + @Autowired | |
| 20 | + SampleRepository sampleRepository; | |
| 21 | + | |
| 15 | 22 | @Override |
| 16 | 23 | public Iterable<Sample> list(Map<String, Object> map) { |
| 17 | 24 | Iterable<Sample> rs = super.list(map); |
| ... | ... | @@ -26,4 +33,13 @@ public class SampleServiceImpl extends BaseServiceImpl<Sample, Long>{ |
| 26 | 33 | } |
| 27 | 34 | return rs; |
| 28 | 35 | } |
| 36 | + | |
| 37 | + @Transactional | |
| 38 | + @Override | |
| 39 | + public int createDataByGps(String lineCode, Integer updown) { | |
| 40 | + //删除原有数据 | |
| 41 | + sampleRepository.deleteByLineAndUpdown(Integer.parseInt(lineCode), updown); | |
| 42 | + | |
| 43 | + return 0; | |
| 44 | + } | |
| 29 | 45 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -464,20 +464,43 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 464 | 464 | List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>(); |
| 465 | 465 | |
| 466 | 466 | DecimalFormat format = new DecimalFormat("0.00"); |
| 467 | - int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | |
| 468 | - int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | |
| 469 | - int jhbc = 0; | |
| 470 | - double jhlc = 0; | |
| 471 | - float realMileage = 0l,addMileage = 0l,remMileage = 0l; | |
| 467 | +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | |
| 468 | +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | |
| 469 | + int jhbc = 0,cjbc = 0,ljbc = 0; | |
| 470 | + double jhlc = 0, yygl = 0, ksgl = 0; | |
| 471 | + float addMileage = 0l,remMileage = 0l; | |
| 472 | 472 | |
| 473 | 473 | Map<String,Object> map; |
| 474 | 474 | for(ScheduleRealInfo scheduleRealInfo : scheduleRealInfos){ |
| 475 | 475 | if(scheduleRealInfo != null){ |
| 476 | - jhlc += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 477 | - realMileage += scheduleRealInfo.getRealMileage()==null?0:scheduleRealInfo.getRealMileage(); | |
| 478 | - addMileage += scheduleRealInfo.getAddMileage()==null?0:scheduleRealInfo.getAddMileage(); | |
| 479 | - remMileage += scheduleRealInfo.getRemMileage()==null?0:scheduleRealInfo.getRemMileage(); | |
| 480 | - jhbc++; | |
| 476 | + //计算计划里程(主任务过滤掉临加班次),烂班里程,临加里程,计划班次,烂班班次,增加班次 | |
| 477 | + if(scheduleRealInfo.isSflj()){ | |
| 478 | + addMileage += addMileage += scheduleRealInfo.getAddMileage()==null?0:scheduleRealInfo.getAddMileage(); | |
| 479 | + ljbc++; | |
| 480 | + }else{ | |
| 481 | + jhlc += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 482 | + if(scheduleRealInfo.getStatus() != -1){ | |
| 483 | + remMileage += scheduleRealInfo.getRemMileage()==null?0:scheduleRealInfo.getRemMileage(); | |
| 484 | + }else{ | |
| 485 | + cjbc++; | |
| 486 | + } | |
| 487 | + jhbc++; | |
| 488 | + } | |
| 489 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 490 | + //计算营运里程,空驶里程 | |
| 491 | + if(childTaskPlans.isEmpty()){ | |
| 492 | + yygl += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 493 | + }else{ | |
| 494 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 495 | + while(it.hasNext()){ | |
| 496 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 497 | + if(childTaskPlan.getMileageType().equals("empty")){ | |
| 498 | + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 499 | + }else{ | |
| 500 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 501 | + } | |
| 502 | + } | |
| 503 | + } | |
| 481 | 504 | |
| 482 | 505 | map = new HashMap<String, Object>(); |
| 483 | 506 | try { |
| ... | ... | @@ -509,9 +532,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 509 | 532 | map.put("jhlc", format.format(jhlc)); |
| 510 | 533 | map.put("remMileage", format.format(remMileage)); |
| 511 | 534 | map.put("addMileage", format.format(addMileage)); |
| 512 | - map.put("yygl", format.format(realMileage-addMileage)); | |
| 513 | - map.put("ksgl", format.format(realMileage-addMileage)); | |
| 514 | - map.put("realMileage", format.format(realMileage)); | |
| 535 | + map.put("yygl", format.format(yygl)); | |
| 536 | + map.put("ksgl", format.format(ksgl)); | |
| 537 | + map.put("realMileage", format.format(yygl+ksgl)); | |
| 515 | 538 | map.put("jhbc", jhbc); |
| 516 | 539 | map.put("cjbc", cjbc); |
| 517 | 540 | map.put("ljbc", ljbc); |
| ... | ... | @@ -520,7 +543,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 520 | 543 | String path = this.getClass().getResource("/").getPath()+"static\\pages\\forms\\"; |
| 521 | 544 | |
| 522 | 545 | list.add(listMap.iterator()); |
| 523 | - ee.excelReplace(list, new Object[] { scheduleRealInfos.get(0),map }, path+"mould\\waybill.xls", | |
| 546 | + ee.excelReplace(list, new Object[] { scheduleRealInfos.get(0),map }, path+"mould\\waybill_minhang.xls", | |
| 524 | 547 | path+"export\\" + jName + ".xls"); |
| 525 | 548 | return scheduleRealInfos; |
| 526 | 549 | } |
| ... | ... | @@ -983,27 +1006,58 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 983 | 1006 | String lpName,String date) { |
| 984 | 1007 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date); |
| 985 | 1008 | DecimalFormat format = new DecimalFormat("0.00"); |
| 986 | - int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | |
| 987 | - int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | |
| 988 | - int jhbc = 0; | |
| 989 | - double jhlc = 0; | |
| 990 | - float realMileage = 0l,addMileage = 0l,remMileage = 0l; | |
| 1009 | +// int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | |
| 1010 | +// int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | |
| 1011 | + int jhbc = 0,cjbc = 0,ljbc = 0; | |
| 1012 | + double jhlc = 0, yygl = 0, ksgl = 0,tempJhlc = 0; | |
| 1013 | + float addMileage = 0l,remMileage = 0l; | |
| 991 | 1014 | Map<String,Object> map = new HashMap<String, Object>(); |
| 992 | 1015 | for(ScheduleRealInfo scheduleRealInfo : list){ |
| 993 | 1016 | if(scheduleRealInfo != null){ |
| 994 | - jhlc += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 995 | - realMileage += scheduleRealInfo.getRealMileage()==null?0:scheduleRealInfo.getRealMileage(); | |
| 996 | - addMileage += scheduleRealInfo.getAddMileage()==null?0:scheduleRealInfo.getAddMileage(); | |
| 997 | - remMileage += scheduleRealInfo.getRemMileage()==null?0:scheduleRealInfo.getRemMileage(); | |
| 998 | - jhbc++; | |
| 1017 | + //计划里程(主任务过滤掉临加班次), | |
| 1018 | + //烂班里程(主任务烂班), | |
| 1019 | + //临加里程(主任务临加), | |
| 1020 | + //计划班次,烂班班次,增加班次 | |
| 1021 | + tempJhlc = scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 1022 | + if(scheduleRealInfo.isSflj()){ | |
| 1023 | + addMileage += tempJhlc; | |
| 1024 | + ljbc++; | |
| 1025 | + }else{ | |
| 1026 | + jhlc += tempJhlc; | |
| 1027 | + jhbc++; | |
| 1028 | + if(scheduleRealInfo.getStatus() == -1){ | |
| 1029 | + remMileage += tempJhlc; | |
| 1030 | + cjbc++; | |
| 1031 | + } | |
| 1032 | + } | |
| 1033 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1034 | + //计算营运里程,空驶里程 | |
| 1035 | + if(childTaskPlans.isEmpty()){ | |
| 1036 | + if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | |
| 1037 | + || scheduleRealInfo.getBcType().equals("venting")){ | |
| 1038 | + ksgl += tempJhlc; | |
| 1039 | + }else{ | |
| 1040 | + yygl += tempJhlc; | |
| 1041 | + } | |
| 1042 | + }else{ | |
| 1043 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1044 | + while(it.hasNext()){ | |
| 1045 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1046 | + if(childTaskPlan.getMileageType().equals("empty")){ | |
| 1047 | + ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1048 | + }else{ | |
| 1049 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1050 | + } | |
| 1051 | + } | |
| 1052 | + } | |
| 999 | 1053 | } |
| 1000 | 1054 | } |
| 1001 | 1055 | map.put("jhlc", format.format(jhlc)); |
| 1002 | 1056 | map.put("remMileage", format.format(remMileage)); |
| 1003 | 1057 | map.put("addMileage", format.format(addMileage)); |
| 1004 | - map.put("yygl", format.format(jhlc)); | |
| 1005 | - map.put("ksgl", format.format(realMileage-addMileage)); | |
| 1006 | - map.put("realMileage", format.format(jhlc)); | |
| 1058 | + map.put("yygl", format.format(yygl)); | |
| 1059 | + map.put("ksgl", format.format(ksgl)); | |
| 1060 | + map.put("realMileage", format.format(yygl+ksgl)); | |
| 1007 | 1061 | map.put("jhbc", jhbc); |
| 1008 | 1062 | map.put("cjbc", cjbc); |
| 1009 | 1063 | map.put("ljbc", ljbc); |
| ... | ... | @@ -1066,17 +1120,43 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1066 | 1120 | public List<Map<String, Object>> statisticsDaily(String line, String date, |
| 1067 | 1121 | String xlName) { |
| 1068 | 1122 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); |
| 1123 | + List<Map<String,Object>> lMap = new ArrayList<Map<String,Object>>(); | |
| 1124 | + DecimalFormat format = new DecimalFormat("0.00"); | |
| 1069 | 1125 | double jhlc = 0.00; |
| 1070 | - float realMileage = 0l; | |
| 1126 | + float sjgl = 0l,ssgl = 0l; | |
| 1127 | + Map<String,Object> map = new HashMap<String, Object>(); | |
| 1071 | 1128 | for(ScheduleRealInfo scheduleRealInfo: list){ |
| 1072 | 1129 | if(scheduleRealInfo != null){ |
| 1073 | - jhlc += scheduleRealInfo.getJhlc(); | |
| 1074 | - if(scheduleRealInfo.getsName().equals("1")){ | |
| 1075 | - realMileage += scheduleRealInfo.getRealMileage(); | |
| 1130 | + if(!scheduleRealInfo.isSflj()){ | |
| 1131 | + jhlc += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 1132 | + } | |
| 1133 | + if(scheduleRealInfo.isDestroy()){ | |
| 1134 | + ssgl += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 1135 | + } | |
| 1136 | + | |
| 1137 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | |
| 1138 | + //计算实际里程,空驶里程 | |
| 1139 | + if(childTaskPlans.isEmpty()){ | |
| 1140 | + sjgl += scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc(); | |
| 1141 | + }else{ | |
| 1142 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | |
| 1143 | + while(it.hasNext()){ | |
| 1144 | + ChildTaskPlan childTaskPlan = it.next(); | |
| 1145 | + if(childTaskPlan.isDestroy()){ | |
| 1146 | + ssgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1147 | + }else{ | |
| 1148 | + sjgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1149 | + } | |
| 1150 | + } | |
| 1076 | 1151 | } |
| 1077 | 1152 | } |
| 1078 | 1153 | } |
| 1079 | - return null; | |
| 1154 | + map.put("xlName", xlName); | |
| 1155 | + map.put("jhlc", format.format(jhlc)); | |
| 1156 | + map.put("sjgl", format.format(sjgl)); | |
| 1157 | + map.put("ssgl", format.format(ssgl)); | |
| 1158 | + lMap.add(map); | |
| 1159 | + return lMap; | |
| 1080 | 1160 | } |
| 1081 | 1161 | |
| 1082 | 1162 | @Override | ... | ... |
src/main/java/com/bsth/service/schedule/SchedulePlanService.java
| ... | ... | @@ -3,8 +3,31 @@ package com.bsth.service.schedule; |
| 3 | 3 | import com.bsth.entity.schedule.SchedulePlan; |
| 4 | 4 | import com.bsth.service.BaseService; |
| 5 | 5 | |
| 6 | +import java.util.Date; | |
| 7 | +import java.util.List; | |
| 8 | +import java.util.Map; | |
| 9 | + | |
| 6 | 10 | /** |
| 7 | 11 | * Created by xu on 16/6/16. |
| 8 | 12 | */ |
| 9 | 13 | public interface SchedulePlanService extends BaseService<SchedulePlan, Long> { |
| 14 | + | |
| 15 | + /** | |
| 16 | + * 查找分组排班信息。 | |
| 17 | + * @param xlid 线路Id | |
| 18 | + * @param scheduleDate 排班日期 | |
| 19 | + * @return | |
| 20 | + */ | |
| 21 | + List<Map<String, Object>> findGroupInfo(Integer xlid, Date scheduleDate); | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 更新分组排班信息。 | |
| 25 | + * @param clid 车辆id | |
| 26 | + * @param clZbh 车辆自编号 | |
| 27 | + * @param xlid 线路id | |
| 28 | + * @param scheduleDate 排班日期 | |
| 29 | + * @param lpName 路牌名字 | |
| 30 | + * @return | |
| 31 | + */ | |
| 32 | + int updateGroupInfo_clinfo(Integer clid, String clZbh, Integer xlid, Date scheduleDate, String lpName); | |
| 10 | 33 | } | ... | ... |
src/main/java/com/bsth/service/schedule/SchedulePlanServiceImpl.java
| ... | ... | @@ -5,7 +5,6 @@ import com.bsth.entity.schedule.*; |
| 5 | 5 | import com.bsth.entity.schedule.rule.ScheduleRule1Flat; |
| 6 | 6 | import com.bsth.repository.schedule.SchedulePlanInfoRepository; |
| 7 | 7 | import com.bsth.repository.schedule.SchedulePlanRepository; |
| 8 | -import com.bsth.service.LineService; | |
| 9 | 8 | import com.bsth.service.impl.BaseServiceImpl; |
| 10 | 9 | import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; |
| 11 | 10 | import com.bsth.service.schedule.rules.shiftloop.ScheduleResult_output; |
| ... | ... | @@ -31,10 +30,6 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl<SchedulePlan, Long> |
| 31 | 30 | @Autowired |
| 32 | 31 | private KieBase kieBase; |
| 33 | 32 | @Autowired |
| 34 | - private ScheduleRule1FlatService scheduleRule1FlatService; | |
| 35 | - @Autowired | |
| 36 | - private LineService lineService; | |
| 37 | - @Autowired | |
| 38 | 33 | private IStrategy strategy; |
| 39 | 34 | @Autowired |
| 40 | 35 | private SchedulePlanRepository schedulePlanRepository; |
| ... | ... | @@ -126,5 +121,91 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl<SchedulePlan, Long> |
| 126 | 121 | return super.save(schedulePlan); |
| 127 | 122 | } |
| 128 | 123 | |
| 124 | + @Override | |
| 125 | + public List<Map<String, Object>> findGroupInfo(Integer xlid, Date scheduleDate) { | |
| 126 | + List<Object[]> groupInfos = schedulePlanRepository.findGroupInfo(xlid, scheduleDate); | |
| 127 | + List<Map<String, Object>> ret = new ArrayList<>(); | |
| 128 | + for (Object[] datas : groupInfos) { | |
| 129 | + // TODO:貌似springdata没有优雅的方式把List<Object[]>转换成List<Map<String, Object>>方法, | |
| 130 | + // TODO:可能jpa有相关标注,以后找到,此方法就作废 | |
| 131 | + | |
| 132 | + Map<String, Object> map = new HashMap<>(); | |
| 133 | + | |
| 134 | + // 线路名称 | |
| 135 | + map.put("xlName", datas[0]); | |
| 136 | + // 排班时间 | |
| 137 | + map.put("scheduleDate", datas[1]); | |
| 138 | + // 路牌名字 | |
| 139 | + map.put("lpName", datas[2]); | |
| 140 | + // 车辆自编号 | |
| 141 | + map.put("clZbh", datas[3]); | |
| 142 | + // 出场时间,如果有多个,需要分开 | |
| 143 | + Object ccsj = datas[4]; | |
| 144 | + if (ccsj != null) { | |
| 145 | + String[] ccsj_array = ((String) ccsj).split(","); | |
| 146 | + if (ccsj_array.length > 1) { | |
| 147 | + map.put("ccsj1", ccsj_array[0]); | |
| 148 | + map.put("ccsj2", ccsj_array[1]); | |
| 149 | + } else { | |
| 150 | + map.put("ccsj1", ccsj_array[0]); | |
| 151 | + } | |
| 152 | + } | |
| 153 | + // 驾驶员工号,如果有多个,需要分开 | |
| 154 | + Object jsyGh = datas[5]; | |
| 155 | + if (jsyGh != null) { | |
| 156 | + String[] jsyGh_array = ((String) jsyGh).split(","); | |
| 157 | + if (jsyGh_array.length > 1) { | |
| 158 | + map.put("jsy1Gh", jsyGh_array[0]); | |
| 159 | + map.put("jsy2Gh", jsyGh_array[1]); | |
| 160 | + } else { | |
| 161 | + map.put("jsy1Gh", jsyGh_array[0]); | |
| 162 | + } | |
| 163 | + } | |
| 164 | + // 驾驶员名字,如果有多个,需要分开 | |
| 165 | + Object jsyName = datas[6]; | |
| 166 | + if (jsyName != null) { | |
| 167 | + String[] jsyName_array = ((String) jsyName).split(","); | |
| 168 | + if (jsyName_array.length > 1) { | |
| 169 | + map.put("jsy1Name", jsyName_array[0]); | |
| 170 | + map.put("jsy2Name", jsyName_array[1]); | |
| 171 | + } else { | |
| 172 | + map.put("jsy1Name", jsyName_array[0]); | |
| 173 | + } | |
| 174 | + } | |
| 175 | + // 售票员工号,如果有多个,需要分开 | |
| 176 | + Object spyGh = datas[7]; | |
| 177 | + if (spyGh != null) { | |
| 178 | + String[] spyGh_array = ((String) spyGh).split(","); | |
| 179 | + if (spyGh_array.length > 1) { | |
| 180 | + map.put("spy1Gh", spyGh_array[0]); | |
| 181 | + map.put("spy2Gh", spyGh_array[1]); | |
| 182 | + } else { | |
| 183 | + map.put("spy1Gh", spyGh_array[0]); | |
| 184 | + } | |
| 185 | + } | |
| 186 | + // 售票员名字,如果有多个,需要分开 | |
| 187 | + Object spyName = datas[8]; | |
| 188 | + if (spyName != null) { | |
| 189 | + String[] spyName_array = ((String) spyName).split(","); | |
| 190 | + if (spyName_array.length > 1) { | |
| 191 | + map.put("spy1Name", spyName_array[0]); | |
| 192 | + map.put("spy2Name", spyName_array[1]); | |
| 193 | + } else { | |
| 194 | + map.put("spy1Name", spyName_array[0]); | |
| 195 | + } | |
| 196 | + } | |
| 197 | + // 创建时间 | |
| 198 | + map.put("createDate", datas[9]); | |
| 199 | + | |
| 200 | + // TODO:可能还有其他字段 | |
| 201 | + | |
| 202 | + ret.add(map); | |
| 203 | + } | |
| 204 | + return ret; | |
| 205 | + } | |
| 129 | 206 | |
| 207 | + @Override | |
| 208 | + public int updateGroupInfo_clinfo(Integer clid, String clZbh, Integer xlid, Date scheduleDate, String lpName) { | |
| 209 | + return schedulePlanRepository.updateGroupInfo_clinfo(clid, clZbh, xlid, scheduleDate, lpName); | |
| 210 | + } | |
| 130 | 211 | } | ... | ... |
src/main/java/com/bsth/service/schedule/rules/ttinfo/TTInfo_input.java
| ... | ... | @@ -52,6 +52,7 @@ public class TTInfo_input implements Comparable<TTInfo_input> { |
| 52 | 52 | weekdays.add(false); |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | + | |
| 55 | 56 | if (StringUtils.isNotEmpty(ttInfo.getSpecial_days())) { |
| 56 | 57 | String[] sdays = ttInfo.getSpecial_days().split(","); |
| 57 | 58 | for (int i = 0; i < sdays.length; i++) { | ... | ... |
src/main/java/com/bsth/websocket/handler/SendUtils.java
| ... | ... | @@ -18,6 +18,7 @@ import com.bsth.data.LineConfigData; |
| 18 | 18 | import com.bsth.data.schedule.DayOfSchedule; |
| 19 | 19 | import com.bsth.entity.directive.D80; |
| 20 | 20 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 21 | +import com.fasterxml.jackson.core.JsonProcessingException; | |
| 21 | 22 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 22 | 23 | |
| 23 | 24 | @Component |
| ... | ... | @@ -130,10 +131,18 @@ public class SendUtils{ |
| 130 | 131 | * @Description: TODO(调度指令状态推送) |
| 131 | 132 | */ |
| 132 | 133 | public void sendDirectiveToPage(ScheduleRealInfo sch) { |
| 133 | - JSONObject json = new JSONObject(); | |
| 134 | - json.put("fn", "directive"); | |
| 135 | - json.put("t", sch); | |
| 136 | - socketHandler.sendMessageToLine(sch.getXlBm(), json.toJSONString()); | |
| 134 | + | |
| 135 | + Map<String, Object> map = new HashMap<>(); | |
| 136 | + map.put("fn", "directive"); | |
| 137 | + map.put("t", sch);; | |
| 138 | + | |
| 139 | + ObjectMapper mapper = new ObjectMapper(); | |
| 140 | + | |
| 141 | + try { | |
| 142 | + socketHandler.sendMessageToLine(sch.getXlBm(), mapper.writeValueAsString(map)); | |
| 143 | + } catch (JsonProcessingException e) { | |
| 144 | + logger.error("", e); | |
| 145 | + } | |
| 137 | 146 | } |
| 138 | 147 | |
| 139 | 148 | public void send80ToPage(D80 d80) { | ... | ... |
src/main/resources/datatools/config-prod.properties
| ... | ... | @@ -4,13 +4,13 @@ |
| 4 | 4 | datatools.kettle_properties=/datatools/kettle.properties |
| 5 | 5 | # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) |
| 6 | 6 | #数据库ip地址 |
| 7 | -datatools.kvars_dbip=192.168.40.82 | |
| 7 | +datatools.kvars_dbip=192.168.168.171 | |
| 8 | 8 | #数据库用户名 |
| 9 | 9 | datatools.kvars_dbuname=root |
| 10 | 10 | #数据库密码 |
| 11 | -datatools.kvars_dbpwd=123456 | |
| 11 | +datatools.kvars_dbpwd=root2jsp | |
| 12 | 12 | #数据库库名 |
| 13 | -datatools.kvars_dbdname=qp_control | |
| 13 | +datatools.kvars_dbdname=control | |
| 14 | 14 | |
| 15 | 15 | # 3、上传数据配置信息 |
| 16 | 16 | # 上传文件目录配置(根据不同的环境需要修正) | ... | ... |
src/main/resources/ms-jdbc.properties
| 1 | -#ms.mysql.driver= com.mysql.jdbc.Driver | |
| 2 | -#ms.mysql.url= jdbc:mysql://127.0.0.1:3306/ms?useUnicode=true&characterEncoding=utf-8 | |
| 3 | -#ms.mysql.username= root | |
| 4 | -#ms.mysql.password= panzhao | |
| 5 | - | |
| 6 | 1 | ms.mysql.driver= com.mysql.jdbc.Driver |
| 7 | 2 | ms.mysql.url= jdbc:mysql://192.168.40.82:3306/ms?useUnicode=true&characterEncoding=utf-8 |
| 8 | 3 | ms.mysql.username= root |
| 9 | 4 | ms.mysql.password= 123456 |
| 5 | + | |
| 6 | +#ms.mysql.url= jdbc:mysql://127.0.0.1:3306/ms?useUnicode=true&characterEncoding=utf-8 | |
| 7 | +#ms.mysql.username= root | |
| 8 | +#ms.mysql.password= panzhao | ... | ... |
src/main/resources/static/pages/base/lineinformation/add.html
| ... | ... | @@ -224,8 +224,8 @@ |
| 224 | 224 | <!-- <input type="text" class="form-control" name="carPark" id="carParkInput" placeholder="停车场"> --> |
| 225 | 225 | </div> |
| 226 | 226 | </div> |
| 227 | - | |
| 228 | - <!-- 进场时间 --> | |
| 227 | + <!-- | |
| 228 | + 进场时间 | |
| 229 | 229 | <div class="form-group"> |
| 230 | 230 | <label class="control-label col-md-3"> 进场时间 : </label> |
| 231 | 231 | <div class="col-md-4"> |
| ... | ... | @@ -234,7 +234,7 @@ |
| 234 | 234 | </div> |
| 235 | 235 | </div> |
| 236 | 236 | |
| 237 | - <!-- 出场时间 --> | |
| 237 | + 出场时间 | |
| 238 | 238 | <div class="form-group"> |
| 239 | 239 | <label class="control-label col-md-3"> 出场时间 : </label> |
| 240 | 240 | <div class="col-md-4"> |
| ... | ... | @@ -243,14 +243,14 @@ |
| 243 | 243 | </div> |
| 244 | 244 | </div> |
| 245 | 245 | |
| 246 | - <!-- 进场里程 --> | |
| 246 | + 进场里程 | |
| 247 | 247 | <div class="form-group"> |
| 248 | 248 | <label class="control-label col-md-3"> 进场里程 : </label> |
| 249 | 249 | <div class="col-md-4"> |
| 250 | 250 | <input type="text" class="form-control" name="paradeMileage" id="paradeMileageInput" placeholder="进场里程"> |
| 251 | 251 | <span class="help-block"> 描述:起点至停车场的里程 </span> |
| 252 | 252 | </div> |
| 253 | - </div> | |
| 253 | + </div> --> | |
| 254 | 254 | |
| 255 | 255 | |
| 256 | 256 | <!-- 上行进场时间 --> |
| ... | ... | @@ -328,15 +328,15 @@ |
| 328 | 328 | </div> |
| 329 | 329 | |
| 330 | 330 | |
| 331 | - | |
| 332 | - <!-- 出场里程 --> | |
| 331 | + <!-- | |
| 332 | + 出场里程 | |
| 333 | 333 | <div class="form-group"> |
| 334 | 334 | <label class="control-label col-md-3"> 出场里程: </label> |
| 335 | 335 | <div class="col-md-4"> |
| 336 | 336 | <input type="text" class="form-control" name="outMileage" id="outMileageInput" placeholder="出场里程"> |
| 337 | 337 | <span class="help-block"> 描述:停车场至起点的里程 </span> |
| 338 | 338 | </div> |
| 339 | - </div> | |
| 339 | + </div> --> | |
| 340 | 340 | |
| 341 | 341 | <!-- 早高峰大间隔 --> |
| 342 | 342 | <div class="form-group"> | ... | ... |
src/main/resources/static/pages/base/lineinformation/details.html
| ... | ... | @@ -231,8 +231,8 @@ |
| 231 | 231 | <!-- <input type="text" class="form-control" name="carPark" id="carParkInput" placeholder="停车场"> --> |
| 232 | 232 | </div> |
| 233 | 233 | </div> |
| 234 | - | |
| 235 | - <!-- 进场时间 --> | |
| 234 | + <!-- | |
| 235 | + 进场时间 | |
| 236 | 236 | <div class="form-group"> |
| 237 | 237 | <label class="control-label col-md-3"> 进场时间 : </label> |
| 238 | 238 | <div class="col-md-4"> |
| ... | ... | @@ -241,14 +241,14 @@ |
| 241 | 241 | </div> |
| 242 | 242 | </div> |
| 243 | 243 | |
| 244 | - <!-- 出场时间 --> | |
| 244 | + 出场时间 | |
| 245 | 245 | <div class="form-group"> |
| 246 | 246 | <label class="control-label col-md-3"> 出场时间 : </label> |
| 247 | 247 | <div class="col-md-4"> |
| 248 | 248 | <input type="text" class="form-control" name="outTime" id="outTimeInput" placeholder="出场时间"> |
| 249 | 249 | <span class="help-block"> 描述:停车场至起点的时间 </span> |
| 250 | 250 | </div> |
| 251 | - </div> | |
| 251 | + </div> --> | |
| 252 | 252 | |
| 253 | 253 | |
| 254 | 254 | <!-- 上行进场时间 --> |
| ... | ... | @@ -324,8 +324,8 @@ |
| 324 | 324 | <span class="help-block"> 描述:下行起点至停车场的出场里程 </span> |
| 325 | 325 | </div> |
| 326 | 326 | </div> |
| 327 | - | |
| 328 | - <!-- 进场里程 --> | |
| 327 | + <!-- | |
| 328 | + 进场里程 | |
| 329 | 329 | <div class="form-group"> |
| 330 | 330 | <label class="control-label col-md-3"> 进场里程 : </label> |
| 331 | 331 | <div class="col-md-4"> |
| ... | ... | @@ -334,7 +334,7 @@ |
| 334 | 334 | </div> |
| 335 | 335 | </div> |
| 336 | 336 | |
| 337 | - <!-- 出场里程 --> | |
| 337 | + 出场里程 | |
| 338 | 338 | <div class="form-group"> |
| 339 | 339 | <label class="control-label col-md-3"> 出场里程: </label> |
| 340 | 340 | <div class="col-md-4"> |
| ... | ... | @@ -342,7 +342,7 @@ |
| 342 | 342 | <span class="help-block"> 描述:停车场至起点的里程 </span> |
| 343 | 343 | </div> |
| 344 | 344 | </div> |
| 345 | - | |
| 345 | + --> | |
| 346 | 346 | <!-- 早高峰大间隔 --> |
| 347 | 347 | <div class="form-group"> |
| 348 | 348 | <label class="control-label col-md-3"> 早高峰大间隔: </label> | ... | ... |
src/main/resources/static/pages/base/lineinformation/edit.html
| ... | ... | @@ -234,8 +234,8 @@ |
| 234 | 234 | <!-- <input type="text" class="form-control" name="carPark" id="carParkInput" placeholder="停车场"> --> |
| 235 | 235 | </div> |
| 236 | 236 | </div> |
| 237 | - | |
| 238 | - <!-- 进场时间 --> | |
| 237 | + <!-- | |
| 238 | + 进场时间 | |
| 239 | 239 | <div class="form-group"> |
| 240 | 240 | <label class="control-label col-md-3"> 进场时间 : </label> |
| 241 | 241 | <div class="col-md-4"> |
| ... | ... | @@ -244,7 +244,7 @@ |
| 244 | 244 | </div> |
| 245 | 245 | </div> |
| 246 | 246 | |
| 247 | - <!-- 出场时间 --> | |
| 247 | + 出场时间 | |
| 248 | 248 | <div class="form-group"> |
| 249 | 249 | <label class="control-label col-md-3"> 出场时间 : </label> |
| 250 | 250 | <div class="col-md-4"> |
| ... | ... | @@ -253,7 +253,7 @@ |
| 253 | 253 | </div> |
| 254 | 254 | </div> |
| 255 | 255 | |
| 256 | - | |
| 256 | + --> | |
| 257 | 257 | <!-- 上行进场时间 --> |
| 258 | 258 | <div class="form-group"> |
| 259 | 259 | <label class="control-label col-md-3"> 上行进场时间 : </label> |
| ... | ... | @@ -327,8 +327,8 @@ |
| 327 | 327 | <span class="help-block"> 描述:下行起点至停车场的出场里程 </span> |
| 328 | 328 | </div> |
| 329 | 329 | </div> |
| 330 | - | |
| 331 | - <!-- 进场里程 --> | |
| 330 | + <!-- | |
| 331 | + 进场里程 | |
| 332 | 332 | <div class="form-group"> |
| 333 | 333 | <label class="control-label col-md-3"> 进场里程 : </label> |
| 334 | 334 | <div class="col-md-4"> |
| ... | ... | @@ -337,7 +337,7 @@ |
| 337 | 337 | </div> |
| 338 | 338 | </div> |
| 339 | 339 | |
| 340 | - <!-- 出场里程 --> | |
| 340 | + 出场里程 | |
| 341 | 341 | <div class="form-group"> |
| 342 | 342 | <label class="control-label col-md-3"> 出场里程: </label> |
| 343 | 343 | <div class="col-md-4"> |
| ... | ... | @@ -345,7 +345,7 @@ |
| 345 | 345 | <span class="help-block"> 描述:停车场至起点的里程 </span> |
| 346 | 346 | </div> |
| 347 | 347 | </div> |
| 348 | - | |
| 348 | + --> | |
| 349 | 349 | <!-- 早高峰大间隔 --> |
| 350 | 350 | <div class="form-group"> |
| 351 | 351 | <label class="control-label col-md-3"> 早高峰大间隔: </label> | ... | ... |
src/main/resources/static/pages/forecast/sample/css/main.css
| 1 | -#lineConfigPanel{ | |
| 1 | +#forecastSamplePanel{ | |
| 2 | 2 | background: #fff; |
| 3 | 3 | overflow: hidden; |
| 4 | 4 | font-family: 'Segoe UI',Arial,'Microsoft Yahei',sans-serif !important; |
| 5 | 5 | min-width: 1392px; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | -#lineConfigPanel h1{ | |
| 8 | +#forecastSamplePanel h1{ | |
| 9 | 9 | -webkit-margin-start: 23px; |
| 10 | 10 | color: rgb(92, 97, 102); |
| 11 | 11 | margin-bottom: 1em; |
| ... | ... | @@ -13,26 +13,26 @@ |
| 13 | 13 | font-size: 1.5em; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | -#lineConfigPanel .line_config_tree ul { | |
| 16 | +#forecastSamplePanel .line_config_tree ul { | |
| 17 | 17 | list-style-type: none; |
| 18 | 18 | padding: 0; |
| 19 | 19 | height: 100% !important; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | -#lineConfigPanel .line_config_tree ul li{ | |
| 22 | +#forecastSamplePanel .line_config_tree ul li{ | |
| 23 | 23 | -webkit-border-start: 6px solid transparent; |
| 24 | 24 | -webkit-padding-start: 18px; |
| 25 | 25 | -webkit-user-select: none; |
| 26 | 26 | cursor: pointer; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -#lineConfigPanel .line_config_tree ul li.selected{ | |
| 29 | +#forecastSamplePanel .line_config_tree ul li.selected{ | |
| 30 | 30 | -webkit-border-start-color: #1bbc9b; |
| 31 | 31 | cursor: default; |
| 32 | 32 | pointer-events: none; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | -#lineConfigPanel .line_config_tree ul li button{ | |
| 35 | +#forecastSamplePanel .line_config_tree ul li button{ | |
| 36 | 36 | background-color: white; |
| 37 | 37 | border: 0; |
| 38 | 38 | color: #999; |
| ... | ... | @@ -43,25 +43,26 @@ |
| 43 | 43 | padding: 0; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | -#lineConfigPanel .line_config_tree ul li.selected button{ | |
| 46 | +#forecastSamplePanel .line_config_tree ul li.selected button{ | |
| 47 | 47 | color: #1bbc9b; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | -#lineConfigPanel #trafficChart{ | |
| 50 | +#forecastSamplePanel #trafficChart{ | |
| 51 | 51 | display: inline-block; |
| 52 | 52 | width: calc(100% - 152px); |
| 53 | 53 | vertical-align: top; |
| 54 | 54 | height: 100%; |
| 55 | + overflow: auto; | |
| 56 | + padding-bottom: 12px; | |
| 55 | 57 | } |
| 56 | 58 | |
| 57 | -#lineConfigPanel #trafficChart .sample_tags{ | |
| 59 | +#forecastSamplePanel #trafficChart .sample_tags{ | |
| 58 | 60 | width: 100%; |
| 59 | - height: 65px; | |
| 60 | 61 | text-align: right; |
| 61 | - padding: 20px 40px 0; | |
| 62 | + padding: 20px 40px 10px; | |
| 62 | 63 | } |
| 63 | 64 | |
| 64 | -#lineConfigPanel #trafficChart .sample_tags a.tag{ | |
| 65 | +#forecastSamplePanel #trafficChart .sample_tags a.tag{ | |
| 65 | 66 | display: inline-block; |
| 66 | 67 | line-height: 1; |
| 67 | 68 | vertical-align: baseline; |
| ... | ... | @@ -79,37 +80,44 @@ |
| 79 | 80 | font-weight: 400; |
| 80 | 81 | } |
| 81 | 82 | |
| 82 | -#lineConfigPanel #trafficChart svg{ | |
| 83 | - width: 100%; | |
| 84 | - height: calc(100% - 65px); | |
| 83 | +#forecastSamplePanel #trafficChart svg{ | |
| 84 | + width: calc(100% - 11px); | |
| 85 | +} | |
| 86 | + | |
| 87 | +#svgWrap{ | |
| 88 | + width: calc(100% - 10px); | |
| 89 | + border: 1px solid #dadada; | |
| 90 | + border-radius: 3px !important; | |
| 91 | + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12); | |
| 92 | + transition: all .3s ease; | |
| 85 | 93 | } |
| 86 | 94 | |
| 87 | -#lineConfigPanel #trafficChart svg circle{ | |
| 95 | +#forecastSamplePanel #trafficChart svg circle{ | |
| 88 | 96 | fill: #b9b7b7; |
| 89 | 97 | r: 6; |
| 90 | 98 | stroke: rgb(253, 253, 253); |
| 91 | 99 | stroke-width: 3; |
| 92 | 100 | } |
| 93 | 101 | |
| 94 | -#lineConfigPanel #trafficChart svg path{ | |
| 102 | +#forecastSamplePanel #trafficChart svg path{ | |
| 95 | 103 | stroke-width: 6.4px; |
| 96 | 104 | opacity: 0.9; |
| 97 | 105 | stroke: #b2afaf; |
| 98 | 106 | cursor: pointer; |
| 99 | 107 | } |
| 100 | 108 | |
| 101 | -#lineConfigPanel #trafficChart svg path.active{ | |
| 109 | +#forecastSamplePanel #trafficChart svg path.active{ | |
| 102 | 110 | stroke: #1bbc9b; |
| 103 | 111 | } |
| 104 | 112 | |
| 105 | -#lineConfigPanel #trafficChart svg text{ | |
| 113 | +#forecastSamplePanel #trafficChart svg text{ | |
| 106 | 114 | font-size: 85%; |
| 107 | 115 | fill: #6b6666; |
| 108 | 116 | font-weight: bold; |
| 109 | 117 | pointer-events: none; |
| 110 | 118 | } |
| 111 | 119 | |
| 112 | -#lineConfigPanel #trafficChart .sample_tags a.tag.active{ | |
| 120 | +#forecastSamplePanel #trafficChart .sample_tags a.tag.active{ | |
| 113 | 121 | background-color: #1bbc9b; |
| 114 | 122 | color: white; |
| 115 | 123 | } |
| ... | ... | @@ -120,7 +128,7 @@ |
| 120 | 128 | height: 100%; |
| 121 | 129 | } |
| 122 | 130 | |
| 123 | -#lineConfigPanel .slimScrollBar{ | |
| 131 | +#forecastSamplePanel .slimScrollBar{ | |
| 124 | 132 | border-radius: 7px !important; |
| 125 | 133 | background: rgb(176, 173, 173) !important; |
| 126 | 134 | width: 4px !important; |
| ... | ... | @@ -179,8 +187,10 @@ |
| 179 | 187 | } |
| 180 | 188 | |
| 181 | 189 | .left_station_route .tabbable-line .tab-content{ |
| 182 | - height: 100% !important; | |
| 183 | - padding: 20px 0 0; | |
| 190 | + height: calc(100% - 63px); | |
| 191 | + padding: 20px 0 0; | |
| 192 | + overflow: auto; | |
| 193 | + border-top: 0; | |
| 184 | 194 | } |
| 185 | 195 | |
| 186 | 196 | rect.station_rect{ |
| ... | ... | @@ -196,10 +206,43 @@ rect.f_rect{ |
| 196 | 206 | cursor: pointer; |
| 197 | 207 | } |
| 198 | 208 | |
| 199 | -#lineConfigPanel #trafficChart svg text.f_text{ | |
| 209 | +#forecastSamplePanel #trafficChart svg text.f_text{ | |
| 200 | 210 | fill: #ffffff; |
| 201 | 211 | } |
| 202 | 212 | |
| 203 | 213 | .select2-container--open{ |
| 204 | 214 | z-index: 100000000; |
| 215 | +} | |
| 216 | + | |
| 217 | +.inline-link{ | |
| 218 | + font-size: 12px; | |
| 219 | + color: red; | |
| 220 | + text-decoration: underline; | |
| 221 | + display: inline-block; | |
| 222 | + vertical-align: bottom; | |
| 223 | + margin: 0 8px 7px 0; | |
| 224 | +} | |
| 225 | + | |
| 226 | + | |
| 227 | +#forecastSamplePanel .tab-content::-webkit-scrollbar, | |
| 228 | +#forecastSamplePanel #trafficChart::-webkit-scrollbar { | |
| 229 | + width: 15px; | |
| 230 | + height: 16px; | |
| 231 | +} | |
| 232 | +#forecastSamplePanel .tab-content::-webkit-scrollbar-track, | |
| 233 | +#forecastSamplePanel .tab-content::-webkit-scrollbar-thumb, | |
| 234 | +#forecastSamplePanel #trafficChart::-webkit-scrollbar-track, | |
| 235 | +#forecastSamplePanel #trafficChart::-webkit-scrollbar-thumb { | |
| 236 | + border-radius: 999px; | |
| 237 | + border: 5px solid transparent; | |
| 238 | +} | |
| 239 | +#forecastSamplePanel .tab-content::-webkit-scrollbar-thumb, | |
| 240 | +#forecastSamplePanel #trafficChart::-webkit-scrollbar-thumb { | |
| 241 | + min-height: 20px; | |
| 242 | + background-clip: content-box; | |
| 243 | + box-shadow: 0 0 0 5px rgba(0,0,0,.2) inset; | |
| 244 | +} | |
| 245 | +#forecastSamplePanel .tab-content::-webkit-scrollbar-corner, | |
| 246 | +#forecastSamplePanel #trafficChart::-webkit-scrollbar-corner { | |
| 247 | + background: transparent; | |
| 205 | 248 | } |
| 206 | 249 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forecast/sample/js/svg.js
| ... | ... | @@ -53,10 +53,10 @@ var sampleSvg = (function(){ |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | function draw(opt){ |
| 56 | - $('#trafficChart svg').remove(); | |
| 57 | - svg = d3.select('#trafficChart').append('svg'); | |
| 56 | + $('#svgWrap svg').remove(); | |
| 57 | + svg = d3.select('#svgWrap').append('svg'); | |
| 58 | 58 | //容器宽度 |
| 59 | - var width = $('#trafficChart svg').width(); | |
| 59 | + var width = $('#svgWrap svg').width(); | |
| 60 | 60 | margin = (width - (rowNum - 1) * itemWidth) / 2; |
| 61 | 61 | var rts = opt.rts |
| 62 | 62 | _count = rts.length; |
| ... | ... | @@ -69,6 +69,10 @@ var sampleSvg = (function(){ |
| 69 | 69 | stationMapp[obj.stationCode] = obj.stationName; |
| 70 | 70 | }); |
| 71 | 71 | |
| 72 | + var h = rts[rts.length - 1].cy + 50; | |
| 73 | + svg.style('height', h).style('opacity', 0); | |
| 74 | + $('#svgWrap').css('height', h + 6); | |
| 75 | + | |
| 72 | 76 | //画线 |
| 73 | 77 | svg.selectAll('path').data(rts) |
| 74 | 78 | .enter().append('path') |
| ... | ... | @@ -91,13 +95,16 @@ var sampleSvg = (function(){ |
| 91 | 95 | drawText(rts); |
| 92 | 96 | //显示tags |
| 93 | 97 | showTags(); |
| 98 | + | |
| 99 | + //d3 anim | |
| 100 | + svg.transition().delay(100).style('opacity', 1); | |
| 94 | 101 | } |
| 95 | 102 | |
| 96 | 103 | //tag 点击事件 |
| 97 | 104 | $('#trafficChart').on('click', '.sample_tags a.tag', function(){ |
| 98 | 105 | $('.sample_tags a.tag.active').removeClass('active'); |
| 99 | 106 | $(this).addClass('active'); |
| 100 | - var tag = $(this).text(); | |
| 107 | + var tag = $(this).attr('title'); | |
| 101 | 108 | clearRunTimeE(); |
| 102 | 109 | //show |
| 103 | 110 | showRunTimeE(_data[tag]) |
| ... | ... | @@ -115,7 +122,6 @@ var sampleSvg = (function(){ |
| 115 | 122 | .attr('data-sid', this.id); |
| 116 | 123 | }); |
| 117 | 124 | |
| 118 | - console.log('showRunTimeE...', rs); | |
| 119 | 125 | //背景 |
| 120 | 126 | svg.selectAll('.f_rect') |
| 121 | 127 | .data(rs).enter().append('rect') |
| ... | ... | @@ -153,11 +159,14 @@ var sampleSvg = (function(){ |
| 153 | 159 | $.each(rs, function(i, d){ |
| 154 | 160 | if(!_data[d.tag]){ |
| 155 | 161 | _data[d.tag] = []; |
| 156 | - tags += '<a class="tag">'+d.tag+'</a>'; | |
| 162 | + tags += '<a class="tag" title="'+d.tag+'">'+(d.tag + ' ' + d.sDate + ' - ' + d.eDate)+'</a>'; | |
| 157 | 163 | } |
| 158 | 164 | _data[d.tag].push(d); |
| 159 | 165 | }); |
| 160 | - $('#trafficChart .sample_tags').html(tags); | |
| 166 | + | |
| 167 | + var wrap = $('#trafficChart .sample_tags'); | |
| 168 | + wrap.find('a.tag').remove(); | |
| 169 | + wrap.append(tags); | |
| 161 | 170 | //选中第一个tag |
| 162 | 171 | $('#trafficChart .sample_tags a.tag:eq(0)').click(); |
| 163 | 172 | }); |
| ... | ... | @@ -173,42 +182,16 @@ var sampleSvg = (function(){ |
| 173 | 182 | } |
| 174 | 183 | |
| 175 | 184 | function popAddModal(id){ |
| 176 | - //var eid = id ,sid = prve(id); | |
| 177 | - //if(!sid)return; | |
| 178 | - | |
| 179 | - //var opts = {sid: sid, eid: eid, sName: stationMapp[sid], eName: stationMapp[eid]}; | |
| 180 | 185 | $.get('/pages/forecast/sample/modal.html', function(rs){ |
| 181 | 186 | var index = layer.open({ |
| 182 | 187 | type: 1, |
| 183 | 188 | area: '550px', |
| 184 | 189 | content: rs, |
| 185 | 190 | shift: 5, |
| 186 | - // title: '...', | |
| 191 | + title: '人工编辑', | |
| 187 | 192 | success: function(layero, index){ |
| 188 | 193 | var activeTag = $('.sample_tags a.tag.active'); |
| 189 | - $('#forecast_sample_modal').trigger('init', {layero: layero, _opt: _opt, _data: _data, id: id, tag: activeTag.length > 0?activeTag.text():''}); | |
| 190 | - /*$("#addSampleForm select[name=tag]").select2({ | |
| 191 | - maximumSelectionLength: 1, | |
| 192 | - tags: true | |
| 193 | - }) | |
| 194 | - .on('change', function(){ | |
| 195 | - var t = $(this).val(); | |
| 196 | - if(tagRange[t]){ | |
| 197 | - $("#addSampleForm input[name=sDate]").val(tagRange[t].s); | |
| 198 | - $("#addSampleForm input[name=eDate]").val(tagRange[t].e); | |
| 199 | - } | |
| 200 | - }); | |
| 201 | - | |
| 202 | - //提交 | |
| 203 | - $('#addSampleForm .confirm').on('click', function(){ | |
| 204 | - if(customFormValidate('#addSampleForm')){ | |
| 205 | - console.log(_opt); | |
| 206 | - var param = $('#addSampleForm').serializeJSON(); | |
| 207 | - param.lineCode = _opt.lineCode; | |
| 208 | - param.updown = _opt.updown; | |
| 209 | - $post('/sample', param, function(){layer.close(index);}); | |
| 210 | - } | |
| 211 | - });*/ | |
| 194 | + $('#forecast_sample_modal').trigger('init', {drawObject: drawObject, layero: layero, _opt: _opt, _data: _data, id: id, tag: activeTag.length > 0?activeTag.attr('title'):''}); | |
| 212 | 195 | } |
| 213 | 196 | }); |
| 214 | 197 | }); |
| ... | ... | @@ -247,34 +230,5 @@ var sampleSvg = (function(){ |
| 247 | 230 | return cp; |
| 248 | 231 | } |
| 249 | 232 | |
| 250 | - /** | |
| 251 | - * 自定义表单校验 | |
| 252 | - */ | |
| 253 | - function customFormValidate(f){ | |
| 254 | - var rs = true; | |
| 255 | - //所有可见的项 | |
| 256 | - var es = $('input,select', f); | |
| 257 | - | |
| 258 | - for(var i = 0, e; e = es[i++];){ | |
| 259 | - if($(e).attr('required') && ( $(e).val() == null || $(e).val() == '')){ | |
| 260 | - if($(e).hasClass('select2-hidden-accessible')) | |
| 261 | - $(e).next().find('.select2-selection').addClass('custom-val-error'); | |
| 262 | - else | |
| 263 | - $(e).addClass('custom-val-error'); | |
| 264 | - rs = false; | |
| 265 | - } | |
| 266 | - else{ | |
| 267 | - if($(e).hasClass('select2-hidden-accessible')) | |
| 268 | - $(e).next().find('.select2-selection').removeClass('custom-val-error'); | |
| 269 | - else | |
| 270 | - $(e).removeClass('custom-val-error'); | |
| 271 | - } | |
| 272 | - } | |
| 273 | - | |
| 274 | - if(!rs){ | |
| 275 | - layer.alert('数据完整性校验失败,请检查输入项', {icon: 2, title: '操作失败', shift: 5}); | |
| 276 | - } | |
| 277 | - return rs; | |
| 278 | - } | |
| 279 | 233 | return drawObject; |
| 280 | 234 | })(); |
| 281 | 235 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forecast/sample/main.html
| 1 | 1 | <link href="/pages/forecast/sample/css/main.css" rel="stylesheet" type="text/css" /> |
| 2 | -<div id="lineConfigPanel"> | |
| 2 | +<div id="forecastSamplePanel"> | |
| 3 | 3 | <div class="line_config_tree" > |
| 4 | 4 | <h1 >线路</h1> |
| 5 | 5 | <ul></ul> |
| ... | ... | @@ -29,7 +29,12 @@ |
| 29 | 29 | </div> |
| 30 | 30 | |
| 31 | 31 | <div id="trafficChart" > |
| 32 | - <div class="sample_tags"></div> | |
| 32 | + <div class="sample_tags"> | |
| 33 | + <a href="javascript:;" class="inline-link" id="gpsCreateDataLink"><i class="fa fa-sign-in"> </i> GPS生成数据</a> | |
| 34 | + </div> | |
| 35 | + <div id="svgWrap" > | |
| 36 | + | |
| 37 | + </div> | |
| 33 | 38 | </div> |
| 34 | 39 | </div> |
| 35 | 40 | </div> |
| ... | ... | @@ -57,23 +62,23 @@ |
| 57 | 62 | //站点路由信息 |
| 58 | 63 | var routes = {}; |
| 59 | 64 | |
| 60 | - var $panel = $('#lineConfigPanel') | |
| 65 | + var $panel = $('#forecastSamplePanel') | |
| 61 | 66 | ,$body = $('.line_config_content .body'); |
| 62 | 67 | var h = $('.page-container>.page-sidebar-wrapper>.page-sidebar').height(); |
| 63 | 68 | $panel.css('height', h - 18); |
| 64 | 69 | |
| 65 | - //线路滚动条 | |
| 70 | + //线路滚动条 | |
| 66 | 71 | $('.line_config_tree ul').slimscroll({ |
| 67 | 72 | height : 'calc(100% - 68px)', |
| 68 | 73 | alwaysVisible : true, |
| 69 | 74 | opacity : .8 |
| 70 | 75 | }); |
| 71 | 76 | |
| 72 | - //路由 | |
| 77 | +/* //路由 | |
| 73 | 78 | $('.left_station_route .tab-content').slimscroll({ |
| 74 | 79 | height : 'calc(100% - 46px)', |
| 75 | 80 | opacity : .8 |
| 76 | - }); | |
| 81 | + }); */ | |
| 77 | 82 | |
| 78 | 83 | //上下行切换事件 |
| 79 | 84 | $('.left_station_route .tabbable-line ul li').on('click', function(){setTimeout(drawSvg, 300);}); |
| ... | ... | @@ -149,8 +154,21 @@ |
| 149 | 154 | sampleSvg.draw({lineCode: getLineCode(), rts: rts, updown: getUpdown()}); |
| 150 | 155 | } |
| 151 | 156 | |
| 152 | - $('#lineConfigPanel').on('click', '.sample_route_item', function(){ | |
| 157 | + $('#forecastSamplePanel').on('click', '.sample_route_item', function(){ | |
| 153 | 158 | sampleSvg.popAddModal($(this).data('id')); |
| 154 | 159 | }) |
| 160 | + | |
| 161 | + | |
| 162 | + $('#gpsCreateDataLink').on('click', function(){ | |
| 163 | + var lineName = $('.line_config_tree ul li.selected button').text(); | |
| 164 | + var updownText = $('.left_station_route ul li.active a').text(); | |
| 165 | + | |
| 166 | + layer.confirm('使用GPS轨迹生成【'+lineName+' -'+updownText+'】站点间耗时数据? 该操作将会清除原有数据。', { | |
| 167 | + btn: ['我确定','算了吧'], | |
| 168 | + icon: 3 | |
| 169 | + }, function(){ | |
| 170 | + | |
| 171 | + }); | |
| 172 | + }); | |
| 155 | 173 | }(); |
| 156 | 174 | </script> |
| 157 | 175 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forecast/sample/modal.html
| ... | ... | @@ -19,9 +19,12 @@ |
| 19 | 19 | <div class="tab-content"> |
| 20 | 20 | {{each data as obj i}} |
| 21 | 21 | <div class="tab-pane" id="tab_sample_{{i}}"> |
| 22 | - <form class="form-horizontal" role="form" style="padding: 35px 25px;" id="addSampleForm"> | |
| 23 | - <input type="hidden" name="sStation" value="{{obj.d.sid}}"/> | |
| 24 | - <input type="hidden" name="eStation" value="{{obj.d.eid}}"/> | |
| 22 | + <form class="form-horizontal" role="form" style="padding: 35px 25px;" id="editSampleForm_{{i}}"> | |
| 23 | + <input type="hidden" name="id" value="{{obj.d.id}}"/> | |
| 24 | + <input type="hidden" name="sStation" value="{{obj.d.sStation}}"/> | |
| 25 | + <input type="hidden" name="eStation" value="{{obj.d.eStation}}"/> | |
| 26 | + <input type="hidden" name="tag" value="{{obj.d.tag}}"/> | |
| 27 | + | |
| 25 | 28 | <div class="form-body"> |
| 26 | 29 | <div class="form-group"> |
| 27 | 30 | <label class="col-md-3 control-label">开始站:</label> |
| ... | ... | @@ -56,8 +59,8 @@ |
| 56 | 59 | <div class="form-actions"> |
| 57 | 60 | <div class="row"> |
| 58 | 61 | <div class="col-md-offset-4 col-md-8"> |
| 59 | - <button type="button" class="btn green confirm"><i class="fa fa-check"></i> 保存</button> | |
| 60 | - <button type="button" class="btn red layui-layer-close">删除</button> | |
| 62 | + <button type="button" class="btn green confirm" data-form="#editSampleForm_{{i}}"><i class="fa fa-check"></i> 保存</button> | |
| 63 | + <button type="button" class="btn red remove" data-id="{{obj.d.id}}">删除</button> | |
| 61 | 64 | </div> |
| 62 | 65 | </div> |
| 63 | 66 | </div> |
| ... | ... | @@ -112,8 +115,8 @@ |
| 112 | 115 | <br> |
| 113 | 116 | <div class="form-actions"> |
| 114 | 117 | <div class="row"> |
| 115 | - <div class="col-md-offset-4 col-md-8"> | |
| 116 | - <button type="button" class="btn green confirm"><i class="fa fa-check"></i> 提交</button> | |
| 118 | + <div class="col-md-offset-5 col-md-7"> | |
| 119 | + <button type="button" class="btn green confirm" data-form="#addSampleForm"><i class="fa fa-check"></i> 提交</button> | |
| 117 | 120 | </div> |
| 118 | 121 | </div> |
| 119 | 122 | </div> |
| ... | ... | @@ -125,18 +128,26 @@ |
| 125 | 128 | |
| 126 | 129 | <script> |
| 127 | 130 | !function(){ |
| 128 | - var _data,_opt,id, currentData, layero; | |
| 131 | + var _data,_opt,id, currentData, layero, drawObject; | |
| 129 | 132 | var tagRange = {'早高峰': {s: '06:31', e: '08:30'}, '平峰': {s: '08:31', e: '16:00'}, '晚高峰': {s: '16:01', e: '18:00'}}; |
| 130 | 133 | |
| 131 | 134 | $('#forecast_sample_modal').on('init', function(e, rs){ |
| 132 | 135 | _data = rs._data; |
| 133 | 136 | _opt = rs._opt; |
| 137 | + drawObject = rs.drawObject; | |
| 134 | 138 | layero = rs.layero; |
| 135 | 139 | id = rs.id; |
| 136 | 140 | |
| 137 | - var eid = id, sid = prve(id).stationCode; | |
| 141 | + var _prve = prve(id); | |
| 142 | + if(!_prve){ | |
| 143 | + layer.closeAll(); | |
| 144 | + layer.msg('没有上一站,无法录入数据!'); | |
| 145 | + return; | |
| 146 | + } | |
| 147 | + var eid = id, sid = _prve.stationCode; | |
| 138 | 148 | var sampData = searchData(sid, eid); |
| 139 | 149 | var baseData = {sid: sid, eid: eid, sName: toName(sid), eName: toName(eid)}; |
| 150 | + console.log('baseData', baseData); | |
| 140 | 151 | var html = template('forecast_sample_tab_detail_temp', {data: sampData, base: baseData}); |
| 141 | 152 | $('#forecast_sample_modal .row').html(html); |
| 142 | 153 | //默认选中tab |
| ... | ... | @@ -157,13 +168,30 @@ |
| 157 | 168 | |
| 158 | 169 | toCenter(layero); |
| 159 | 170 | |
| 160 | - //currentData = searchData(sid, eid)[rs.tag]; | |
| 161 | - | |
| 162 | - //console.log('当前站点: ' , getById(id)); | |
| 163 | - //console.log('上一个站点: ' , prve(id)); | |
| 164 | - //console.log('当前数据:', currentData); | |
| 171 | + //确定 | |
| 172 | + $('#forecast_sample_modal .confirm').on('click', function(){ | |
| 173 | + var f = $(this).data('form'); | |
| 174 | + if(customFormValidate(f)){ | |
| 175 | + var param = $(f).serializeJSON(); | |
| 176 | + param.lineCode = _opt.lineCode; | |
| 177 | + param.updown = _opt.updown; | |
| 178 | + | |
| 179 | + layer.msg('操作中...', {icon: 16}); | |
| 180 | + $post('/sample', param, function(){ | |
| 181 | + layer.closeAll(); | |
| 182 | + layer.msg('保存成功!'); | |
| 183 | + drawObject.draw(_opt); | |
| 184 | + }); | |
| 185 | + } | |
| 186 | + }); | |
| 165 | 187 | |
| 166 | - //forecast_sample_tab_detail_temp | |
| 188 | + //删除 | |
| 189 | + $('#forecast_sample_modal .remove').on('click', function(){ | |
| 190 | + removeConfirm('确定删除这条数据?', '/sample/' + $(this).data('id'), function(){ | |
| 191 | + layer.closeAll(); | |
| 192 | + drawObject.draw(_opt); | |
| 193 | + }); | |
| 194 | + }); | |
| 167 | 195 | }); |
| 168 | 196 | |
| 169 | 197 | |
| ... | ... | @@ -177,7 +205,6 @@ |
| 177 | 205 | |
| 178 | 206 | } |
| 179 | 207 | } |
| 180 | - | |
| 181 | 208 | return null; |
| 182 | 209 | } |
| 183 | 210 | |
| ... | ... | @@ -237,5 +264,35 @@ |
| 237 | 264 | else |
| 238 | 265 | firstTab.click(); |
| 239 | 266 | } |
| 267 | + | |
| 268 | + /** | |
| 269 | + * 自定义表单校验 | |
| 270 | + */ | |
| 271 | + function customFormValidate(f){ | |
| 272 | + var rs = true; | |
| 273 | + //所有可见的项 | |
| 274 | + var es = $('input,select', f); | |
| 275 | + | |
| 276 | + for(var i = 0, e; e = es[i++];){ | |
| 277 | + if($(e).attr('required') && ( $(e).val() == null || $(e).val() == '')){ | |
| 278 | + if($(e).hasClass('select2-hidden-accessible')) | |
| 279 | + $(e).next().find('.select2-selection').addClass('custom-val-error'); | |
| 280 | + else | |
| 281 | + $(e).addClass('custom-val-error'); | |
| 282 | + rs = false; | |
| 283 | + } | |
| 284 | + else{ | |
| 285 | + if($(e).hasClass('select2-hidden-accessible')) | |
| 286 | + $(e).next().find('.select2-selection').removeClass('custom-val-error'); | |
| 287 | + else | |
| 288 | + $(e).removeClass('custom-val-error'); | |
| 289 | + } | |
| 290 | + } | |
| 291 | + | |
| 292 | + if(!rs){ | |
| 293 | + layer.alert('数据完整性校验失败,请检查输入项', {icon: 2, title: '操作失败', shift: 5}); | |
| 294 | + } | |
| 295 | + return rs; | |
| 296 | + } | |
| 240 | 297 | }(); |
| 241 | 298 | </script> |
| 242 | 299 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/mould/waybill_minhang.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| ... | ... | @@ -82,23 +82,23 @@ |
| 82 | 82 | <td>援外</td> |
| 83 | 83 | <td>其他</td> |
| 84 | 84 | <td>全日</td> |
| 85 | - <td>6:31~8:30</td> | |
| 86 | - <td>16:01~18:00</td> | |
| 85 | + <td>6:31~<br>8:30</td> | |
| 86 | + <td>16:01~<br>18:00</td> | |
| 87 | 87 | <td>全日</td> |
| 88 | - <td>6:31~8:30</td> | |
| 89 | - <td>16:01~18:00</td> | |
| 88 | + <td>6:31~<br>8:30</td> | |
| 89 | + <td>16:01~<br>18:00</td> | |
| 90 | 90 | <td>全日</td> |
| 91 | - <td>6:31~8:30</td> | |
| 92 | - <td>16:01~18:00</td> | |
| 91 | + <td>6:31~<br>8:30</td> | |
| 92 | + <td>16:01~<br>18:00</td> | |
| 93 | 93 | <td>全日</td> |
| 94 | - <td>6:31~8:30</td> | |
| 95 | - <td>16:01~18:00</td> | |
| 94 | + <td>6:31~<br>8:30</td> | |
| 95 | + <td>16:01~<br>18:00</td> | |
| 96 | 96 | <td>全日</td> |
| 97 | - <td>6:31~8:30</td> | |
| 98 | - <td>16:01~18:00</td> | |
| 97 | + <td>6:31~<br>8:30</td> | |
| 98 | + <td>16:01~<br>18:00</td> | |
| 99 | 99 | <td>全日</td> |
| 100 | - <td>6:31~8:30</td> | |
| 101 | - <td>16:01~18:00</td> | |
| 100 | + <td>6:31~<br>8:30</td> | |
| 101 | + <td>16:01~<br>18:00</td> | |
| 102 | 102 | </tr> |
| 103 | 103 | </thead> |
| 104 | 104 | <tr> |
| ... | ... | @@ -153,37 +153,40 @@ |
| 153 | 153 | <td colspan="40"> </td> |
| 154 | 154 | </tr> |
| 155 | 155 | <tr> |
| 156 | - <td colspan="2">班次</td> | |
| 156 | + <td colspan="2">班序</td> | |
| 157 | 157 | <td colspan="2">车号</td> |
| 158 | 158 | <td>司早</td> |
| 159 | 159 | <td>售早</td> |
| 160 | 160 | <td>司晚</td> |
| 161 | 161 | <td>售晚</td> |
| 162 | - <td colspan="2">班次</td> | |
| 162 | + <td colspan="2">班序</td> | |
| 163 | 163 | <td colspan="2">车号</td> |
| 164 | 164 | <td>司早</td> |
| 165 | 165 | <td>售早</td> |
| 166 | 166 | <td>司晚</td> |
| 167 | 167 | <td>售晚</td> |
| 168 | - <td colspan="2">班次</td> | |
| 168 | + <td colspan="2">班序</td> | |
| 169 | 169 | <td colspan="2">车号</td> |
| 170 | 170 | <td>司早</td> |
| 171 | 171 | <td>售早</td> |
| 172 | 172 | <td>司晚</td> |
| 173 | 173 | <td>售晚</td> |
| 174 | - <td colspan="2">班次</td> | |
| 174 | + <td colspan="2">班序</td> | |
| 175 | 175 | <td colspan="2">车号</td> |
| 176 | 176 | <td>司早</td> |
| 177 | 177 | <td>售早</td> |
| 178 | 178 | <td>司晚</td> |
| 179 | 179 | <td>售晚</td> |
| 180 | - <td colspan="2">班次</td> | |
| 180 | + <td colspan="2">班序</td> | |
| 181 | 181 | <td colspan="2">车号</td> |
| 182 | 182 | <td>司早</td> |
| 183 | 183 | <td>售早</td> |
| 184 | 184 | <td>司晚</td> |
| 185 | 185 | <td>售晚</td> |
| 186 | 186 | </tr> |
| 187 | + <tbody class="scheduleDaily_2"> | |
| 188 | + | |
| 189 | + </tbody> | |
| 187 | 190 | <tr> |
| 188 | 191 | <td colspan="40"> </td> |
| 189 | 192 | </tr> |
| ... | ... | @@ -232,7 +235,7 @@ |
| 232 | 235 | <td>慢</td> |
| 233 | 236 | <td> </td> |
| 234 | 237 | </tr> |
| 235 | - <tbody> | |
| 238 | + <tbody class="scheduleDaily_3"> | |
| 236 | 239 | |
| 237 | 240 | </tbody> |
| 238 | 241 | </table> |
| ... | ... | @@ -289,18 +292,69 @@ |
| 289 | 292 | return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; |
| 290 | 293 | } |
| 291 | 294 | } |
| 292 | - }); | |
| 295 | + }); | |
| 296 | + | |
| 297 | + //查询 | |
| 298 | + $("#query").on('click',function(){ | |
| 299 | + var line = $("#line").val(); | |
| 300 | + var date = $("#date").val(); | |
| 301 | + $.get('/realSchedule/queryUserInfo',{line:line,date:date},function(result){ | |
| 302 | + var scheduleDaily_2 = template('scheduleDaily_2',{list:result}); | |
| 303 | + $('#forms .scheduleDaily_2').html(scheduleDaily_2); | |
| 304 | + }); | |
| 305 | + $.get('/realSchedule/realScheduleList',{line:line,date:date},function(result){ | |
| 306 | + var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); | |
| 307 | + $('#forms .scheduleDaily_3').html(scheduleDaily_3); | |
| 308 | + }); | |
| 309 | + | |
| 310 | + }); | |
| 293 | 311 | }); |
| 294 | 312 | </script> |
| 295 | -<script type="text/html" id="list_forms"> | |
| 313 | +<script type="text/html" id="scheduleDaily_2"> | |
| 296 | 314 | {{each list as obj i}} |
| 315 | + {{if i%5 == 0}} | |
| 316 | + <tr> | |
| 317 | + {{/if}} | |
| 318 | + <td colspan="2">{{obj.lpName}}</td> | |
| 319 | + <td colspan="2">{{obj.clZbh}}</td> | |
| 320 | + <td>{{obj.jGh}}</td> | |
| 321 | + <td>{{obj.sGh}}</td> | |
| 322 | + <td> </td> | |
| 323 | + <td> </td> | |
| 324 | + {{if (i+1)%5 == 0}} | |
| 325 | + </tr> | |
| 326 | + {{/if}} | |
| 327 | + {{/each}} | |
| 328 | + {{if list.length == 0}} | |
| 297 | 329 | <tr> |
| 298 | - | |
| 330 | + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td> | |
| 299 | 331 | </tr> |
| 332 | + {{/if}} | |
| 333 | +</script> | |
| 334 | +<script type="text/html" id="scheduleDaily_3"> | |
| 335 | + {{each list as obj i}} | |
| 336 | + {{if i%3 == 0}} | |
| 337 | + <tr> | |
| 338 | + {{/if}} | |
| 339 | + <td>{{obj.lpName}}</td> | |
| 340 | + <td colspan="2">{{obj.qdzName}}</td> | |
| 341 | + <td>{{obj.zdsj}}</td> | |
| 342 | + <td>{{obj.zdsjActual}}</td> | |
| 343 | + <td> </td> | |
| 344 | + <td> </td> | |
| 345 | + <td>{{obj.fcsj}}</td> | |
| 346 | + <td>{{obj.fcsjActual}}</td> | |
| 347 | + <td> </td> | |
| 348 | + <td> </td> | |
| 349 | + <td colspan="2">{{obj.remarks}}</td> | |
| 350 | + {{if (i+1)%3 == 0}} | |
| 351 | + <td> </td> | |
| 352 | + </tr> | |
| 353 | + {{/if}} | |
| 300 | 354 | {{/each}} |
| 301 | 355 | {{if list.length == 0}} |
| 302 | 356 | <tr> |
| 303 | - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> | |
| 357 | + <td colspan="40"><h6 class="muted">没有找到相关数据</h6></td> | |
| 304 | 358 | </tr> |
| 305 | 359 | {{/if}} |
| 306 | 360 | </script> |
| 307 | 361 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/forms/statement/statisticsDaily .html
| ... | ... | @@ -101,7 +101,7 @@ |
| 101 | 101 | <td>16:01~18:00</td> |
| 102 | 102 | </tr> |
| 103 | 103 | </thead> |
| 104 | - <tbody> | |
| 104 | + <tbody class="statisticsDaily"> | |
| 105 | 105 | |
| 106 | 106 | </tbody> |
| 107 | 107 | <tr> |
| ... | ... | @@ -207,17 +207,52 @@ |
| 207 | 207 | var date = $("#date").val(); |
| 208 | 208 | $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName},function(result){ |
| 209 | 209 | // 把数据填充到模版中 |
| 210 | - var tbodyHtml = template('list_account',{list:result}); | |
| 210 | + var tbodyHtml = template('statisticsDaily',{list:result}); | |
| 211 | 211 | // 把渲染好的模版html文本追加到表格中 |
| 212 | - $('#forms tbody').html(tbodyHtml); | |
| 212 | + $('#forms .statisticsDaily').html(tbodyHtml); | |
| 213 | 213 | }); |
| 214 | 214 | }); |
| 215 | 215 | }); |
| 216 | 216 | </script> |
| 217 | -<script type="text/html" id="list_forms"> | |
| 217 | +<script type="text/html" id="statisticsDaily"> | |
| 218 | 218 | {{each list as obj i}} |
| 219 | - <tr> | |
| 220 | - | |
| 219 | + <tr> | |
| 220 | + <td>{{obj.xlName}}</td> | |
| 221 | + <td>{{obj.jhlc}}</td> | |
| 222 | + <td>{{obj.sjgl}}</td> | |
| 223 | + <td>{{obj.ssgl}}</td> | |
| 224 | + <td> </td> | |
| 225 | + <td> </td> | |
| 226 | + <td> </td> | |
| 227 | + <td> </td> | |
| 228 | + <td> </td> | |
| 229 | + <td> </td> | |
| 230 | + <td> </td> | |
| 231 | + <td> </td> | |
| 232 | + <td> </td> | |
| 233 | + <td> </td> | |
| 234 | + <td> </td> | |
| 235 | + <td> </td> | |
| 236 | + <td> </td> | |
| 237 | + <td> </td> | |
| 238 | + <td> </td> | |
| 239 | + <td> </td> | |
| 240 | + <td> </td> | |
| 241 | + <td> </td> | |
| 242 | + <td> </td> | |
| 243 | + <td> </td> | |
| 244 | + <td> </td> | |
| 245 | + <td> </td> | |
| 246 | + <td> </td> | |
| 247 | + <td> </td> | |
| 248 | + <td> </td> | |
| 249 | + <td> </td> | |
| 250 | + <td> </td> | |
| 251 | + <td> </td> | |
| 252 | + <td> </td> | |
| 253 | + <td> </td> | |
| 254 | + <td> </td> | |
| 255 | + <td> </td> | |
| 221 | 256 | </tr> |
| 222 | 257 | {{/each}} |
| 223 | 258 | {{if list.length == 0}} | ... | ... |
src/main/resources/static/pages/forms/statement/waybill_minhang.html
| ... | ... | @@ -304,32 +304,32 @@ |
| 304 | 304 | <tr> |
| 305 | 305 | <td colspan="2">计划公里</td> |
| 306 | 306 | <td>{{jhlc}}</td> |
| 307 | - <td>抽减公里</td> | |
| 307 | + <td>烂班公里</td> | |
| 308 | 308 | <td>{{remMileage}}</td> |
| 309 | - <td colspan="2">增加公里</td> | |
| 309 | + <td colspan="2">临加公里</td> | |
| 310 | 310 | <td>{{addMileage}}</td> |
| 311 | - <td colspan="2">实际计划公里</td> | |
| 312 | - <td colspan="3">{{jhlc}}</td> | |
| 311 | + <td colspan="2">营运公里</td> | |
| 312 | + <td colspan="3">{{yygl}}</td> | |
| 313 | 313 | </tr> |
| 314 | 314 | <tr> |
| 315 | - <td colspan="2">营运公里</td> | |
| 316 | - <td>{{realMileage}}</td> | |
| 317 | - <td>空驶公里</td> | |
| 315 | + <td colspan="2">空驶公里</td> | |
| 318 | 316 | <td>{{ksgl}}</td> |
| 319 | - <td colspan="2">总公里</td> | |
| 317 | + <td>总公里</td> | |
| 320 | 318 | <td>{{realMileage}}</td> |
| 321 | 319 | <td colspan="2">计划班次</td> |
| 322 | - <td colspan="3">{{jhbc}}</td> | |
| 320 | + <td>{{jhbc}}</td> | |
| 321 | + <td colspan="2">烂班班次</td> | |
| 322 | + <td colspan="3">{{cjbc}}</td> | |
| 323 | 323 | </tr> |
| 324 | 324 | <tr> |
| 325 | - <td colspan="2">抽减班次</td> | |
| 326 | - <td>{{cjbc}}</td> | |
| 327 | - <td>增加班次</td> | |
| 325 | + <td colspan="2">增加班次</td> | |
| 328 | 326 | <td>{{ljbc}}</td> |
| 329 | - <td colspan="2">实际计划班次</td> | |
| 330 | - <td>{{jhbc}}</td> | |
| 331 | - <td colspan="2">实际班次</td> | |
| 332 | - <td colspan="3">{{sjbc}}</td> | |
| 327 | + <td>实际班次</td> | |
| 328 | + <td>{{sjbc}}</td> | |
| 329 | + <td colspan="2"></td> | |
| 330 | + <td></td> | |
| 331 | + <td colspan="2"></td> | |
| 332 | + <td colspan="3"></td> | |
| 333 | 333 | </tr> |
| 334 | 334 | </script> |
| 335 | 335 | <script type="text/html" id="ludan_4"> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dt/MyEmployeeGroupWrapTemplate.html
0 → 100644
| 1 | +<div name="{{$saEmployeegroupCtrl.$name_attr}}" | |
| 2 | + ng-model="$saEmployeegroupCtrl.$$internalmodel"> | |
| 3 | + | |
| 4 | + <style> | |
| 5 | + .employee-select { | |
| 6 | + min-height: 180px; | |
| 7 | + border: 1px solid #ddd; | |
| 8 | + } | |
| 9 | + .employee-select .employee-input { | |
| 10 | + margin: 2px 5px 5px 5px; | |
| 11 | + padding-left: 0; | |
| 12 | + } | |
| 13 | + .employee-select .employee-select-cont { | |
| 14 | + text-align: left; | |
| 15 | + min-height: 60px; | |
| 16 | + padding-right: 0px; | |
| 17 | + } | |
| 18 | + .employee-select .employee-select-body { | |
| 19 | + margin-top: 10px; | |
| 20 | + overflow: auto; | |
| 21 | + width: auto; | |
| 22 | + min-height: 5px; | |
| 23 | + } | |
| 24 | + .employee-select .employee { | |
| 25 | + display: inline-block; | |
| 26 | + padding: 8px; | |
| 27 | + min-width: 50px; | |
| 28 | + text-align: center; | |
| 29 | + border: 1px solid #C1C1C1; | |
| 30 | + color: #666; | |
| 31 | + border-radius: 5px !important; | |
| 32 | + margin: 5px; | |
| 33 | + } | |
| 34 | + .employee-select .employee.active { | |
| 35 | + color: white; | |
| 36 | + background: #4095E8; | |
| 37 | + border: 1px solid #4095E8; | |
| 38 | + } | |
| 39 | + .employee-select .employee.start { | |
| 40 | + color: white; | |
| 41 | + background: #32C5D2; | |
| 42 | + border: 1px solid #32C5D2; | |
| 43 | + } | |
| 44 | + | |
| 45 | + </style> | |
| 46 | + | |
| 47 | + <div class="col-md-12 employee-select"> | |
| 48 | + <div class="col-md-12 employee-input"> | |
| 49 | + <div class="col-md-9"> | |
| 50 | + 人员列表 | |
| 51 | + <span ng-bind="$saEmployeegroupCtrl.$$dataDesc"></span> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + <div class="col-md-12 employee-select-cont"> | |
| 55 | + <div class="employee-select-body"> | |
| 56 | + <div class="employee active" | |
| 57 | + ng-repeat="$d in $saEmployeegroupCtrl.$$data track by $index" | |
| 58 | + ng-click="$saEmployeegroupCtrl.$$internal_rylist_click($index)"> | |
| 59 | + {{$d.jsy}}-{{$d.spy}} | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + <div class="col-md-12 employee-input"> | |
| 64 | + <div class="col-md-9"> | |
| 65 | + 已经选中的人员列表 | |
| 66 | + <span ng-bind="$saEmployeegroupCtrl.$$dataSelectDesc"></span> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | + <div class="col-md-12 employee-select-cont"> | |
| 70 | + <div class="employee-select-body"> | |
| 71 | + <div ng-class="{employee: true, active: true, start: $d.isstart}" | |
| 72 | + ng-repeat="$d in $saEmployeegroupCtrl.$$dataSelected track by $index" | |
| 73 | + ng-click="$saEmployeegroupCtrl.$$internal_selrylist_click($index)" | |
| 74 | + ng-dblclick="$saEmployeegroupCtrl.$$internal_selrylist_dbclick($index)"> | |
| 75 | + {{$d.jsy}}-{{$d.spy}} | |
| 76 | + </div> | |
| 77 | + </div> | |
| 78 | + </div> | |
| 79 | + </div> | |
| 80 | + | |
| 81 | + | |
| 82 | +</div> | |
| 0 | 83 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/dt/MyGuideboardGroupWrapTemplate.html
| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | |
| 4 | 4 | <style> |
| 5 | 5 | .guideboard-select { |
| 6 | - height: 180px; | |
| 6 | + min-height: 180px; | |
| 7 | 7 | border: 1px solid #ddd; |
| 8 | 8 | } |
| 9 | 9 | .guideboard-select .guideboard-input { |
| ... | ... | @@ -12,19 +12,19 @@ |
| 12 | 12 | } |
| 13 | 13 | .guideboard-select .guideboard-select-cont { |
| 14 | 14 | text-align: left; |
| 15 | - height: 100px; | |
| 15 | + min-height: 60px; | |
| 16 | 16 | padding-right: 0px; |
| 17 | 17 | } |
| 18 | 18 | .guideboard-select .guideboard-select-body { |
| 19 | 19 | margin-top: 10px; |
| 20 | 20 | overflow: auto; |
| 21 | 21 | width: auto; |
| 22 | - height: 100px; | |
| 22 | + min-height: 5px; | |
| 23 | 23 | } |
| 24 | 24 | .guideboard-select .guideboard { |
| 25 | 25 | display: inline-block; |
| 26 | 26 | padding: 8px; |
| 27 | - min-width: 85px; | |
| 27 | + min-width: 50px; | |
| 28 | 28 | text-align: center; |
| 29 | 29 | border: 1px solid #C1C1C1; |
| 30 | 30 | color: #666; |
| ... | ... | @@ -36,32 +36,46 @@ |
| 36 | 36 | background: #4095E8; |
| 37 | 37 | border: 1px solid #4095E8; |
| 38 | 38 | } |
| 39 | + .guideboard-select .guideboard.start { | |
| 40 | + color: white; | |
| 41 | + background: #32C5D2; | |
| 42 | + border: 1px solid #32C5D2; | |
| 43 | + } | |
| 39 | 44 | |
| 40 | 45 | </style> |
| 41 | 46 | |
| 42 | 47 | <div class="col-md-12 guideboard-select"> |
| 43 | 48 | <div class="col-md-12 guideboard-input"> |
| 44 | 49 | <div class="col-md-9"> |
| 45 | - 某某线路的路牌列表 | |
| 50 | + 路牌列表 | |
| 51 | + <span ng-bind="$saGuideboardgroupCtrl.$$dataDesc"></span> | |
| 46 | 52 | </div> |
| 47 | 53 | </div> |
| 48 | 54 | <div class="col-md-12 guideboard-select-cont"> |
| 49 | 55 | <div class="guideboard-select-body"> |
| 50 | - <div class="guideboard active"> | |
| 51 | - 1 | |
| 52 | - </div> | |
| 53 | - <div class="guideboard active"> | |
| 54 | - 2 | |
| 55 | - </div> | |
| 56 | - <div class="guideboard active"> | |
| 57 | - 3 | |
| 56 | + <div class="guideboard active" | |
| 57 | + ng-repeat="$d in $saGuideboardgroupCtrl.$$data track by $index" | |
| 58 | + ng-click="$saGuideboardgroupCtrl.$$internal_lplist_click($index)"> | |
| 59 | + {{$d.lpname}} | |
| 58 | 60 | </div> |
| 59 | - <div class="guideboard active"> | |
| 60 | - 4 | |
| 61 | + </div> | |
| 62 | + </div> | |
| 63 | + <div class="col-md-12 guideboard-input"> | |
| 64 | + <div class="col-md-9"> | |
| 65 | + 已经选中的路牌列表 | |
| 66 | + <span ng-bind="$saGuideboardgroupCtrl.$$dataSelectDesc"></span> | |
| 67 | + </div> | |
| 68 | + </div> | |
| 69 | + <div class="col-md-12 guideboard-select-cont"> | |
| 70 | + <div class="guideboard-select-body"> | |
| 71 | + <div ng-class="{guideboard: true, active: true, start: $d.isstart}" | |
| 72 | + ng-repeat="$d in $saGuideboardgroupCtrl.$$dataSelected track by $index" | |
| 73 | + ng-click="$saGuideboardgroupCtrl.$$internal_sellplist_click($index)" | |
| 74 | + ng-dblclick="$saGuideboardgroupCtrl.$$internal_sellplist_dbclick($index)"> | |
| 75 | + {{$d.lpname}} | |
| 61 | 76 | </div> |
| 62 | 77 | </div> |
| 63 | 78 | </div> |
| 64 | 79 | </div> |
| 65 | 80 | |
| 66 | - | |
| 67 | 81 | </div> |
| 68 | 82 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
| ... | ... | @@ -1372,27 +1372,778 @@ angular.module('ScheduleApp').directive('saDategroup', [ |
| 1372 | 1372 | } |
| 1373 | 1373 | ]); |
| 1374 | 1374 | |
| 1375 | +/** | |
| 1376 | + * saGuideboardgroup指令 | |
| 1377 | + * 属性如下: | |
| 1378 | + * name(必须):控件的名字 | |
| 1379 | + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave | |
| 1380 | + * xlidvalue(必须):绑定的model线路id值,如:xlidvalue={{ctrl.employeeInfoForSave.xl.id}} | |
| 1381 | + * lprangevalue(必须):绑定的model路牌名字范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}} | |
| 1382 | + * lprangename(必须):绑定的model路牌名字范围字段名,如:lprangename=lprange | |
| 1383 | + * lpidrangevalue(必须):绑定的model路牌id范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}} | |
| 1384 | + * lpidrangename(必须):绑定的model路牌id范围字段名,如:lprangename=lprange | |
| 1385 | + * lpstartvalue(必须):绑定的model起始路牌值,如:lpstartvalue={{ctrl.employeeInfoForSave.lpstart}} | |
| 1386 | + * lpstartname(必须):绑定的model起始路牌字段名,如:lpstartname=lpstart | |
| 1387 | + * | |
| 1388 | + * required(可选):是否要用required验证 | |
| 1389 | + * | |
| 1390 | + */ | |
| 1391 | +angular.module('ScheduleApp').directive('saGuideboardgroup', [ | |
| 1392 | + 'GuideboardManageService_g', | |
| 1393 | + function(guideboardManageService_g) { | |
| 1394 | + return { | |
| 1395 | + restrict: 'E', | |
| 1396 | + templateUrl: '/pages/scheduleApp/module/common/dt/MyGuideboardGroupWrapTemplate.html', | |
| 1397 | + scope: { | |
| 1398 | + model: "=" // 独立作用域,关联外部的模型object | |
| 1399 | + }, | |
| 1400 | + controllerAs: '$saGuideboardgroupCtrl', | |
| 1401 | + bindToController: true, | |
| 1402 | + controller: function($scope) { | |
| 1403 | + var self = this; | |
| 1404 | + self.$$data = []; // 选择线路后,该线路的路牌数据 | |
| 1375 | 1405 | |
| 1406 | + // 测试数据 | |
| 1407 | + //self.$$data = [ | |
| 1408 | + // {lpid: 1, lpname: '路1', isstart: false}, | |
| 1409 | + // {lpid: 2, lpname: '路2', isstart: true}, | |
| 1410 | + // {lpid: 3, lpname: '路3', isstart: false} | |
| 1411 | + //]; | |
| 1376 | 1412 | |
| 1377 | 1413 | |
| 1414 | + self.$$dataSelected = []; // 选中的路牌列表 | |
| 1415 | + self.$$dataSelectedStart = undefined; // 起始路牌 | |
| 1378 | 1416 | |
| 1417 | + //self.$$dataSelected = [ | |
| 1418 | + // {lpid: 11, lpname: '路11', isstart: false}, | |
| 1419 | + // {lpid: 12, lpname: '路12', isstart: true}, | |
| 1420 | + // {lpid: 13, lpname: '路13', isstart: false} | |
| 1421 | + //]; | |
| 1379 | 1422 | |
| 1423 | + // saGuideboardgroup组件的ng-model,用于外部绑定等操作 | |
| 1424 | + self.$$internalmodel = undefined; | |
| 1380 | 1425 | |
| 1426 | + self.$$data_init = false; // *数据源初始化标志 | |
| 1427 | + self.$$data_xl_first_init = false; // 线路是否初始化 | |
| 1428 | + self.$$data_lp_first_init = false; // 路牌名字是否初始化 | |
| 1429 | + self.$$data_lpid_first_init = false; // 路牌id是否初始化 | |
| 1430 | + self.$$data_lpstart_first_init = false; // 起始路牌是否初始化 | |
| 1381 | 1431 | |
| 1432 | + self.$$dataDesc = ""; // 路牌列表描述 | |
| 1433 | + self.$$dataSelectDesc = ""; // 选中路牌描述 | |
| 1382 | 1434 | |
| 1435 | + }, | |
| 1383 | 1436 | |
| 1437 | + /** | |
| 1438 | + * 此阶段可以改dom结构,此时angular还没扫描指令, | |
| 1439 | + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。 | |
| 1440 | + * @param tElem | |
| 1441 | + * @param tAttrs | |
| 1442 | + * @returns {{pre: Function, post: Function}} | |
| 1443 | + */ | |
| 1444 | + compile: function(tElem, tAttrs) { | |
| 1445 | + // TODO:获取所有的属性 | |
| 1446 | + var $name_attr = tAttrs["name"]; // 控件的名字 | |
| 1447 | + var $required_attr = tAttrs["required"]; // 是否需要required验证 | |
| 1448 | + var $lprangename_attr = tAttrs["lprangename"]; // 绑定的model路牌名字范围字段名 | |
| 1449 | + var $lpidrangename_attr = tAttrs["lpidrangename"]; // 绑定的model路牌id范围字段名 | |
| 1450 | + var $lpstartname_attr = tAttrs["lpstartname"]; // 绑定的model起始路牌字段名 | |
| 1384 | 1451 | |
| 1452 | + // controlAs名字 | |
| 1453 | + var ctrlAs = '$saGuideboardgroupCtrl'; | |
| 1385 | 1454 | |
| 1455 | + // 如果有required属性,添加angularjs required验证 | |
| 1456 | + if ($required_attr != undefined) { | |
| 1457 | + //console.log(tElem.html()); | |
| 1458 | + tElem.find("div").attr("required", ""); | |
| 1459 | + } | |
| 1386 | 1460 | |
| 1461 | + return { | |
| 1462 | + pre: function(scope, element, attr) { | |
| 1463 | + // TODO: | |
| 1464 | + }, | |
| 1387 | 1465 | |
| 1466 | + /** | |
| 1467 | + * 相当于link函数。 | |
| 1468 | + * @param scope | |
| 1469 | + * @param element | |
| 1470 | + * @param attr | |
| 1471 | + */ | |
| 1472 | + post: function(scope, element, attr) { | |
| 1473 | + // name属性 | |
| 1474 | + if ($name_attr) { | |
| 1475 | + scope[ctrlAs]["$name_attr"] = $name_attr; | |
| 1476 | + } | |
| 1388 | 1477 | |
| 1478 | + // TODO: | |
| 1389 | 1479 | |
| 1390 | 1480 | |
| 1481 | + /** | |
| 1482 | + * 路牌列表点击(路牌列表中选中路牌) | |
| 1483 | + * @param $index | |
| 1484 | + */ | |
| 1485 | + scope[ctrlAs].$$internal_lplist_click = function($index) { | |
| 1486 | + var data_temp = scope[ctrlAs].$$data; | |
| 1487 | + if (data_temp && data_temp.length > $index) { | |
| 1488 | + scope[ctrlAs].$$dataSelected.push({ | |
| 1489 | + lpid: data_temp[$index].lpid, | |
| 1490 | + lpname: data_temp[$index].lpname, | |
| 1491 | + isstart: data_temp[$index].isstart | |
| 1492 | + }); | |
| 1493 | + | |
| 1494 | + // 如果没有指定过初始路牌,默认选择此路牌作为起始路牌 | |
| 1495 | + if (scope[ctrlAs].$$dataSelectedStart == undefined) { | |
| 1496 | + scope[ctrlAs].$$internal_sellplist_click( | |
| 1497 | + scope[ctrlAs].$$dataSelected.length - 1); | |
| 1498 | + } | |
| 1499 | + } | |
| 1500 | + }; | |
| 1501 | + /** | |
| 1502 | + * 选中的路牌单击(初始路牌选择) | |
| 1503 | + * @param $index | |
| 1504 | + */ | |
| 1505 | + scope[ctrlAs].$$internal_sellplist_click = function($index) { | |
| 1506 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 1507 | + if (data_temp && data_temp.length > $index) { | |
| 1508 | + for (var i = 0; i < data_temp.length; i++) { | |
| 1509 | + data_temp[i].isstart = false; | |
| 1510 | + } | |
| 1511 | + data_temp[$index].isstart = true; | |
| 1512 | + scope[ctrlAs].$$dataSelectedStart = $index; | |
| 1513 | + } | |
| 1514 | + }; | |
| 1515 | + /** | |
| 1516 | + * 选中的路牌双击(删除选中的路牌) | |
| 1517 | + * @param $index | |
| 1518 | + */ | |
| 1519 | + scope[ctrlAs].$$internal_sellplist_dbclick = function($index) { | |
| 1520 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 1521 | + if (data_temp && data_temp.length > $index) { | |
| 1522 | + if (scope[ctrlAs].$$dataSelectedStart == $index) { | |
| 1523 | + scope[ctrlAs].$$dataSelectedStart = undefined; | |
| 1524 | + } | |
| 1525 | + data_temp.splice($index, 1); | |
| 1526 | + } | |
| 1527 | + }; | |
| 1391 | 1528 | |
| 1392 | 1529 | |
| 1530 | + /** | |
| 1531 | + * 验证内部数据,更新外部model | |
| 1532 | + */ | |
| 1533 | + scope[ctrlAs].$$internal_validate_model = function() { | |
| 1534 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 1535 | + var data_temp2 = scope[ctrlAs].$$dataSelectedStart; | |
| 1536 | + var lpNames = []; | |
| 1537 | + var lpIds = []; | |
| 1538 | + var lpStart = 0; | |
| 1539 | + var i = 0; | |
| 1540 | + | |
| 1541 | + if (data_temp && | |
| 1542 | + data_temp.length > 0 && | |
| 1543 | + data_temp2 != undefined) { | |
| 1544 | + | |
| 1545 | + for (i = 0; i < data_temp.length; i++) { | |
| 1546 | + lpNames.push(data_temp[i].lpname); | |
| 1547 | + lpIds.push(data_temp[i].lpid) | |
| 1548 | + } | |
| 1549 | + data_temp[data_temp2].isstart = true; | |
| 1550 | + lpStart = data_temp2 + 1; | |
| 1393 | 1551 | |
| 1552 | + // 更新内部model,用于外部验证 | |
| 1553 | + // 内部model的值暂时随意,以后再改 | |
| 1554 | + scope[ctrlAs].$$internalmodel = {desc: "ok"}; | |
| 1394 | 1555 | |
| 1556 | + // 更新外部model字段 | |
| 1557 | + if ($lprangename_attr) { | |
| 1558 | + console.log("lprangename=" + lpNames.join(',')); | |
| 1559 | + eval("scope[ctrlAs].model" + "." + $lprangename_attr + " = lpNames.join(',');"); | |
| 1560 | + } | |
| 1561 | + if ($lpidrangename_attr) { | |
| 1562 | + console.log("lpidrangename=" + lpIds.join(',')); | |
| 1563 | + eval("scope[ctrlAs].model" + "." + $lpidrangename_attr + " = lpIds.join(',');"); | |
| 1564 | + } | |
| 1565 | + if ($lpstartname_attr) { | |
| 1566 | + console.log("lpstartname=" + lpStart); | |
| 1567 | + eval("scope[ctrlAs].model" + "." + $lpstartname_attr + " = lpStart;"); | |
| 1568 | + } | |
| 1395 | 1569 | |
| 1570 | + scope[ctrlAs].$$dataSelectDesc = | |
| 1571 | + ",共" + data_temp.length + "个," + "初始路牌,第" + lpStart + "个"; | |
| 1396 | 1572 | |
| 1573 | + } else { | |
| 1574 | + scope[ctrlAs].$$internalmodel = undefined; | |
| 1575 | + } | |
| 1397 | 1576 | |
| 1398 | 1577 | |
| 1578 | + }; | |
| 1579 | + | |
| 1580 | + // 监控内部数据,$$data_selected 变化 | |
| 1581 | + scope.$watch( | |
| 1582 | + function() { | |
| 1583 | + return scope[ctrlAs].$$dataSelected; | |
| 1584 | + }, | |
| 1585 | + function(newValue, oldValue) { | |
| 1586 | + scope[ctrlAs].$$internal_validate_model(); | |
| 1587 | + }, | |
| 1588 | + true | |
| 1589 | + ); | |
| 1590 | + | |
| 1591 | + // 监控内部数据,$$data_selected_start 变化 | |
| 1592 | + scope.$watch( | |
| 1593 | + function() { | |
| 1594 | + return scope[ctrlAs].$$dataSelectedStart; | |
| 1595 | + }, | |
| 1596 | + function(newValue, oldValue) { | |
| 1597 | + scope[ctrlAs].$$internal_validate_model(); | |
| 1598 | + }, | |
| 1599 | + true | |
| 1600 | + ); | |
| 1601 | + | |
| 1602 | + /** | |
| 1603 | + * 验证数据是否初始化完成, | |
| 1604 | + * 所谓的初始化就是内部所有的数据被有效设定过一次。 | |
| 1605 | + */ | |
| 1606 | + scope[ctrlAs].$$internal_validate_init = function() { | |
| 1607 | + var self = scope[ctrlAs]; | |
| 1608 | + | |
| 1609 | + if (self.$$data_xl_first_init && | |
| 1610 | + self.$$data_lp_first_init && | |
| 1611 | + self.$$data_lpid_first_init && | |
| 1612 | + self.$$data_lpstart_first_init) { | |
| 1613 | + console.log("数据初始化完毕!"); | |
| 1614 | + self.$$data_init = true; | |
| 1615 | + } | |
| 1616 | + | |
| 1617 | + }; | |
| 1618 | + | |
| 1619 | + // 监控初始化标志,线路,路牌,路牌id,起始路牌 | |
| 1620 | + scope.$watch( | |
| 1621 | + function() { | |
| 1622 | + return scope[ctrlAs].$$data_xl_first_init; | |
| 1623 | + }, | |
| 1624 | + function(newValue, oldValue) { | |
| 1625 | + scope[ctrlAs].$$internal_validate_init(); | |
| 1626 | + } | |
| 1627 | + ); | |
| 1628 | + scope.$watch( | |
| 1629 | + function() { | |
| 1630 | + return scope[ctrlAs].$$data_lp_first_init; | |
| 1631 | + }, | |
| 1632 | + function(newValue, oldValue) { | |
| 1633 | + scope[ctrlAs].$$internal_validate_init(); | |
| 1634 | + } | |
| 1635 | + ); | |
| 1636 | + scope.$watch( | |
| 1637 | + function() { | |
| 1638 | + return scope[ctrlAs].$$data_lpid_first_init; | |
| 1639 | + }, | |
| 1640 | + function(newValue, oldValue) { | |
| 1641 | + scope[ctrlAs].$$internal_validate_init(); | |
| 1642 | + } | |
| 1643 | + ); | |
| 1644 | + scope.$watch( | |
| 1645 | + function() { | |
| 1646 | + return scope[ctrlAs].$$data_lpstart_first_init; | |
| 1647 | + }, | |
| 1648 | + function(newValue, oldValue) { | |
| 1649 | + scope[ctrlAs].$$internal_validate_init(); | |
| 1650 | + } | |
| 1651 | + ); | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + // 监控线路id的变化 | |
| 1655 | + attr.$observe("xlidvalue", function(value) { | |
| 1656 | + if (value && value != "") { | |
| 1657 | + console.log("xlidvalue=" + value); | |
| 1658 | + | |
| 1659 | + guideboardManageService_g.rest.list( | |
| 1660 | + {"xl.id_eq": value, size: 100}, | |
| 1661 | + function(result) { | |
| 1662 | + // 获取值了 | |
| 1663 | + console.log("路牌获取了"); | |
| 1664 | + | |
| 1665 | + scope[ctrlAs].$$data = []; | |
| 1666 | + for (var i = 0; i < result.content.length; i++) { | |
| 1667 | + scope[ctrlAs].$$data.push({ | |
| 1668 | + lpid: result.content[i].id, | |
| 1669 | + lpname: result.content[i].lpName, | |
| 1670 | + isstart: false | |
| 1671 | + }); | |
| 1672 | + } | |
| 1673 | + if (scope[ctrlAs].$$data_init) { | |
| 1674 | + scope[ctrlAs].$$dataSelected = []; | |
| 1675 | + scope[ctrlAs].$$dataSelectedStart = undefined; | |
| 1676 | + scope[ctrlAs].$$internalmodel = undefined; | |
| 1677 | + scope[ctrlAs].$$dataDesc = ""; | |
| 1678 | + scope[ctrlAs].$$dataSelectDesc = ""; | |
| 1679 | + } | |
| 1680 | + scope[ctrlAs].$$data_xl_first_init = true; | |
| 1681 | + | |
| 1682 | + scope[ctrlAs].$$dataDesc = ",共" + result.content.length + "个"; | |
| 1683 | + }, | |
| 1684 | + function(result) { | |
| 1685 | + | |
| 1686 | + } | |
| 1687 | + ); | |
| 1688 | + | |
| 1689 | + } | |
| 1690 | + }); | |
| 1691 | + | |
| 1692 | + // 监控路牌名称范围值的变化 | |
| 1693 | + attr.$observe("lprangevalue", function(value) { | |
| 1694 | + if (value && value != "") { | |
| 1695 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 1696 | + var lpnames = value.split(","); | |
| 1697 | + var i = 0; | |
| 1698 | + if (data_temp && data_temp.length == 0) { // 初始创建 | |
| 1699 | + console.log("lprangevalue变换了"); | |
| 1700 | + for (i = 0; i < lpnames.length; i++) { | |
| 1701 | + scope[ctrlAs].$$dataSelected.push({ | |
| 1702 | + lpname: lpnames[i], | |
| 1703 | + isstart: false | |
| 1704 | + }); | |
| 1705 | + } | |
| 1706 | + } else { | |
| 1707 | + for (i = 0; i < lpnames.length; i++) { | |
| 1708 | + data_temp[i].lpname = lpnames[i]; | |
| 1709 | + } | |
| 1710 | + } | |
| 1711 | + scope[ctrlAs].$$data_lp_first_init = true; | |
| 1712 | + } | |
| 1713 | + }); | |
| 1714 | + | |
| 1715 | + // 监控路牌id范围值的变化 | |
| 1716 | + attr.$observe("lpidrangevalue", function(value) { | |
| 1717 | + if (value && value != "") { | |
| 1718 | + console.log("lpidrangevalue=" + value); | |
| 1719 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 1720 | + var lpids = value.split(","); | |
| 1721 | + var i = 0; | |
| 1722 | + if (data_temp && data_temp.length == 0) { // 初始创建 | |
| 1723 | + console.log("lpidrangevalue"); | |
| 1724 | + for (i = 0; i < lpids.length; i++) { | |
| 1725 | + scope[ctrlAs].$$dataSelected.push({ | |
| 1726 | + lpid: lpids[i], | |
| 1727 | + isstart: false | |
| 1728 | + }); | |
| 1729 | + } | |
| 1730 | + } else { | |
| 1731 | + for (i = 0; i < lpids.length; i++) { | |
| 1732 | + data_temp[i].lpid = lpids[i]; | |
| 1733 | + } | |
| 1734 | + } | |
| 1735 | + scope[ctrlAs].$$data_lpid_first_init = true; | |
| 1736 | + } | |
| 1737 | + }); | |
| 1738 | + | |
| 1739 | + // 监控起始路牌的变化 | |
| 1740 | + attr.$observe("lpstartvalue", function(value) { | |
| 1741 | + if (value && value != "") { | |
| 1742 | + scope[ctrlAs].$$dataSelectedStart = value - 1; | |
| 1743 | + scope[ctrlAs].$$data_lpstart_first_init = true; | |
| 1744 | + } | |
| 1745 | + }); | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + } | |
| 1750 | + } | |
| 1751 | + | |
| 1752 | + } | |
| 1753 | + } | |
| 1754 | + } | |
| 1755 | +]); | |
| 1756 | + | |
| 1757 | +/** | |
| 1758 | + * saEmployeegroup指令 | |
| 1759 | + * 属性如下: | |
| 1760 | + * name(必须):控件的名字 | |
| 1761 | + * model(必须):指定一个外部object,独立作用域,如:model=ctrl.employeeInfoForSave | |
| 1762 | + * xlidvalue(必须):绑定的model线路id值,如:xlidvalue={{ctrl.employeeInfoForSave.xl.id}} | |
| 1763 | + * dbbmrangevalue(必须):绑定的model搭班编码范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}} | |
| 1764 | + * dbbmrangename(必须):绑定的model搭班编码范围字段名,如:lprangename=lprange | |
| 1765 | + * rycidrangevalue(必须):绑定的model人员配置idid范围值,如:lprangevalue={{ctrl.employeeInfoForSave.lprange}} | |
| 1766 | + * rycidrangename(必须):绑定的model人员配置id范围字段名,如:lprangename=lprange | |
| 1767 | + * rystartvalue(必须):绑定的model起始人员,如:lpstartvalue={{ctrl.employeeInfoForSave.lpstart}} | |
| 1768 | + * rystartname(必须):绑定的model起始人员字段名,如:lpstartname=lpstart | |
| 1769 | + * | |
| 1770 | + * required(可选):是否要用required验证 | |
| 1771 | + * | |
| 1772 | + */ | |
| 1773 | +angular.module('ScheduleApp').directive('saEmployeegroup', [ | |
| 1774 | + 'EmployeeConfigService_g', | |
| 1775 | + function(employeeConfigService_g) { | |
| 1776 | + return { | |
| 1777 | + restrict: 'E', | |
| 1778 | + templateUrl: '/pages/scheduleApp/module/common/dt/MyEmployeeGroupWrapTemplate.html', | |
| 1779 | + scope: { | |
| 1780 | + model: "=" // 独立作用域,关联外部的模型object | |
| 1781 | + }, | |
| 1782 | + controllerAs: '$saEmployeegroupCtrl', | |
| 1783 | + bindToController: true, | |
| 1784 | + controller: function($scope) { | |
| 1785 | + var self = this; | |
| 1786 | + self.$$data = []; // 选择线路后,该线路的人员配置数据 | |
| 1787 | + | |
| 1788 | + // 测试数据 | |
| 1789 | + //self.$$data = [ | |
| 1790 | + // {id: 1, dbbm: "1", jsy: '忍1', spy: '守1', isstart: false}, | |
| 1791 | + // {id: 2, dbbm: "2", jsy: '忍2', spy: '守2', isstart: true}, | |
| 1792 | + // {id: 3, dbbm: "3", jsy: '忍3', spy: '守3', isstart: false} | |
| 1793 | + //]; | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + self.$$dataSelected = []; // 选中的人员配置列表 | |
| 1797 | + self.$$dataSelectedStart = undefined; // 起始人员配置 | |
| 1798 | + | |
| 1799 | + // saGuideboardgroup组件的ng-model,用于外部绑定等操作 | |
| 1800 | + self.$$internalmodel = undefined; | |
| 1801 | + | |
| 1802 | + self.$$data_init = false; // *数据源初始化标志 | |
| 1803 | + self.$$data_xl_first_init = false; // 线路是否初始化 | |
| 1804 | + self.$$data_ry_first_init = false; // 人员配置是否初始化 | |
| 1805 | + self.$$data_rycid_first_init = false; // 人员配置id是否初始化 | |
| 1806 | + self.$$data_rystart_first_init = false; // 起始人员是否初始化 | |
| 1807 | + | |
| 1808 | + self.$$dataDesc = ""; // 路牌列表描述 | |
| 1809 | + self.$$dataSelectDesc = ""; // 选中路牌描述 | |
| 1810 | + | |
| 1811 | + }, | |
| 1812 | + | |
| 1813 | + /** | |
| 1814 | + * 此阶段可以改dom结构,此时angular还没扫描指令, | |
| 1815 | + * 这里就可以动态添加其他angularjs的指令字符串,如required指令字符串。 | |
| 1816 | + * @param tElem | |
| 1817 | + * @param tAttrs | |
| 1818 | + * @returns {{pre: Function, post: Function}} | |
| 1819 | + */ | |
| 1820 | + compile: function(tElem, tAttrs) { | |
| 1821 | + // TODO:获取所有的属性 | |
| 1822 | + var $name_attr = tAttrs["name"]; // 控件的名字 | |
| 1823 | + var $required_attr = tAttrs["required"]; // 是否需要required验证 | |
| 1824 | + var $dbbmrangename_attr = tAttrs["dbbmrangename"]; // 绑定的model搭班编码范围字段名 | |
| 1825 | + var rycidrangename_attr = tAttrs["rycidrangename"]; // 绑定的model人员配置id范围字段名 | |
| 1826 | + var $rystartname_attr = tAttrs["rystartname"]; // 绑定的model起始人员字段名 | |
| 1827 | + | |
| 1828 | + // controlAs名字 | |
| 1829 | + var ctrlAs = '$saEmployeegroupCtrl'; | |
| 1830 | + | |
| 1831 | + // 如果有required属性,添加angularjs required验证 | |
| 1832 | + if ($required_attr != undefined) { | |
| 1833 | + //console.log(tElem.html()); | |
| 1834 | + tElem.find("div").attr("required", ""); | |
| 1835 | + } | |
| 1836 | + | |
| 1837 | + return { | |
| 1838 | + pre: function(scope, element, attr) { | |
| 1839 | + // TODO: | |
| 1840 | + }, | |
| 1841 | + | |
| 1842 | + /** | |
| 1843 | + * 相当于link函数。 | |
| 1844 | + * @param scope | |
| 1845 | + * @param element | |
| 1846 | + * @param attr | |
| 1847 | + */ | |
| 1848 | + post: function(scope, element, attr) { | |
| 1849 | + // name属性 | |
| 1850 | + if ($name_attr) { | |
| 1851 | + scope[ctrlAs]["$name_attr"] = $name_attr; | |
| 1852 | + } | |
| 1853 | + | |
| 1854 | + // TODO: | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + /** | |
| 1858 | + * 人员配置列表点击(人员配置列表中选中路牌) | |
| 1859 | + * @param $index | |
| 1860 | + */ | |
| 1861 | + scope[ctrlAs].$$internal_rylist_click = function($index) { | |
| 1862 | + var data_temp = scope[ctrlAs].$$data; | |
| 1863 | + if (data_temp && data_temp.length > $index) { | |
| 1864 | + scope[ctrlAs].$$dataSelected.push({ | |
| 1865 | + id : data_temp[$index].id, | |
| 1866 | + dbbm: data_temp[$index].dbbm, | |
| 1867 | + jsy: data_temp[$index].jsy, | |
| 1868 | + spy: data_temp[$index].spy, | |
| 1869 | + isstart: data_temp[$index].isstart | |
| 1870 | + }); | |
| 1871 | + | |
| 1872 | + // 如果没有指定过初始人员,默认选择此人员作为起始人员 | |
| 1873 | + if (scope[ctrlAs].$$dataSelectedStart == undefined) { | |
| 1874 | + scope[ctrlAs].$$internal_selrylist_click( | |
| 1875 | + scope[ctrlAs].$$dataSelected.length - 1); | |
| 1876 | + } | |
| 1877 | + } | |
| 1878 | + }; | |
| 1879 | + /** | |
| 1880 | + * 选中的人员单击(初始人员选择) | |
| 1881 | + * @param $index | |
| 1882 | + */ | |
| 1883 | + scope[ctrlAs].$$internal_selrylist_click = function($index) { | |
| 1884 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 1885 | + if (data_temp && data_temp.length > $index) { | |
| 1886 | + for (var i = 0; i < data_temp.length; i++) { | |
| 1887 | + data_temp[i].isstart = false; | |
| 1888 | + } | |
| 1889 | + data_temp[$index].isstart = true; | |
| 1890 | + scope[ctrlAs].$$dataSelectedStart = $index; | |
| 1891 | + } | |
| 1892 | + }; | |
| 1893 | + /** | |
| 1894 | + * 选中的人员双击(删除选中的人员) | |
| 1895 | + * @param $index | |
| 1896 | + */ | |
| 1897 | + scope[ctrlAs].$$internal_selrylist_dbclick = function($index) { | |
| 1898 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 1899 | + if (data_temp && data_temp.length > $index) { | |
| 1900 | + if (scope[ctrlAs].$$dataSelectedStart == $index) { | |
| 1901 | + scope[ctrlAs].$$dataSelectedStart = undefined; | |
| 1902 | + } | |
| 1903 | + data_temp.splice($index, 1); | |
| 1904 | + } | |
| 1905 | + }; | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + /** | |
| 1909 | + * 验证内部数据,更新外部model | |
| 1910 | + */ | |
| 1911 | + scope[ctrlAs].$$internal_validate_model = function() { | |
| 1912 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 1913 | + var data_temp2 = scope[ctrlAs].$$dataSelectedStart; | |
| 1914 | + var ryDbbms = []; | |
| 1915 | + var ryCids = []; | |
| 1916 | + var ryStart = 0; | |
| 1917 | + var i = 0; | |
| 1918 | + | |
| 1919 | + if (data_temp && | |
| 1920 | + data_temp.length > 0 && | |
| 1921 | + data_temp2 != undefined) { | |
| 1922 | + | |
| 1923 | + for (i = 0; i < data_temp.length; i++) { | |
| 1924 | + ryDbbms.push(data_temp[i].dbbm); | |
| 1925 | + ryCids.push(data_temp[i].id); | |
| 1926 | + } | |
| 1927 | + data_temp[data_temp2].isstart = true; | |
| 1928 | + ryStart = data_temp2 + 1; | |
| 1929 | + | |
| 1930 | + // 更新内部model,用于外部验证 | |
| 1931 | + // 内部model的值暂时随意,以后再改 | |
| 1932 | + scope[ctrlAs].$$internalmodel = {desc: "ok"}; | |
| 1933 | + | |
| 1934 | + // 更新外部model字段 | |
| 1935 | + if ($dbbmrangename_attr) { | |
| 1936 | + console.log("dbbmrangename=" + ryDbbms.join(',')); | |
| 1937 | + eval("scope[ctrlAs].model" + "." + $dbbmrangename_attr + " = ryDbbms.join(',');"); | |
| 1938 | + } | |
| 1939 | + if (rycidrangename_attr) { | |
| 1940 | + console.log("rycidrangename=" + ryCids.join(',')); | |
| 1941 | + eval("scope[ctrlAs].model" + "." + rycidrangename_attr + " = ryCids.join(',');"); | |
| 1942 | + } | |
| 1943 | + if ($rystartname_attr) { | |
| 1944 | + console.log("rystartname=" + ryStart); | |
| 1945 | + eval("scope[ctrlAs].model" + "." + $rystartname_attr + " = ryStart;"); | |
| 1946 | + } | |
| 1947 | + | |
| 1948 | + scope[ctrlAs].$$dataSelectDesc = | |
| 1949 | + ",共" + data_temp.length + "组," + "初始人员,第" + ryStart + "组"; | |
| 1950 | + | |
| 1951 | + } else { | |
| 1952 | + scope[ctrlAs].$$internalmodel = undefined; | |
| 1953 | + } | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + }; | |
| 1957 | + | |
| 1958 | + // 监控内部数据,$$data_selected 变化 | |
| 1959 | + scope.$watch( | |
| 1960 | + function() { | |
| 1961 | + return scope[ctrlAs].$$dataSelected; | |
| 1962 | + }, | |
| 1963 | + function(newValue, oldValue) { | |
| 1964 | + scope[ctrlAs].$$internal_validate_model(); | |
| 1965 | + }, | |
| 1966 | + true | |
| 1967 | + ); | |
| 1968 | + | |
| 1969 | + // 监控内部数据,$$data_selected_start 变化 | |
| 1970 | + scope.$watch( | |
| 1971 | + function() { | |
| 1972 | + return scope[ctrlAs].$$dataSelectedStart; | |
| 1973 | + }, | |
| 1974 | + function(newValue, oldValue) { | |
| 1975 | + scope[ctrlAs].$$internal_validate_model(); | |
| 1976 | + }, | |
| 1977 | + true | |
| 1978 | + ); | |
| 1979 | + | |
| 1980 | + /** | |
| 1981 | + * 验证数据是否初始化完成, | |
| 1982 | + * 所谓的初始化就是内部所有的数据被有效设定过一次。 | |
| 1983 | + */ | |
| 1984 | + scope[ctrlAs].$$internal_validate_init = function() { | |
| 1985 | + var self = scope[ctrlAs]; | |
| 1986 | + var data_temp = self.$$data; | |
| 1987 | + var dataSelect_temp = self.$$dataSelected; | |
| 1988 | + var i = 0; | |
| 1989 | + var j = 0; | |
| 1990 | + | |
| 1991 | + if (self.$$data_xl_first_init && | |
| 1992 | + self.$$data_ry_first_init && | |
| 1993 | + self.$$data_rycid_first_init && | |
| 1994 | + self.$$data_rystart_first_init) { | |
| 1995 | + console.log("数据初始化完毕!"); | |
| 1996 | + self.$$data_init = true; | |
| 1997 | + | |
| 1998 | + // 修正选择dataSelect | |
| 1999 | + for (i = 0; i < dataSelect_temp.length; i++) { | |
| 2000 | + for (j = 0; j < data_temp.length; j++) { | |
| 2001 | + if (dataSelect_temp[i].dbbm == data_temp[j].dbbm) { | |
| 2002 | + dataSelect_temp[i].jsy = data_temp[j].jsy; | |
| 2003 | + dataSelect_temp[i].spy = data_temp[j].spy; | |
| 2004 | + break; | |
| 2005 | + } | |
| 2006 | + } | |
| 2007 | + } | |
| 2008 | + } | |
| 2009 | + | |
| 2010 | + }; | |
| 2011 | + | |
| 2012 | + // 监控初始化标志,线路,人员,起始人员 | |
| 2013 | + scope.$watch( | |
| 2014 | + function() { | |
| 2015 | + return scope[ctrlAs].$$data_xl_first_init; | |
| 2016 | + }, | |
| 2017 | + function(newValue, oldValue) { | |
| 2018 | + scope[ctrlAs].$$internal_validate_init(); | |
| 2019 | + } | |
| 2020 | + ); | |
| 2021 | + scope.$watch( | |
| 2022 | + function() { | |
| 2023 | + return scope[ctrlAs].$$data_ry_first_init; | |
| 2024 | + }, | |
| 2025 | + function(newValue, oldValue) { | |
| 2026 | + scope[ctrlAs].$$internal_validate_init(); | |
| 2027 | + } | |
| 2028 | + ); | |
| 2029 | + scope.$watch( | |
| 2030 | + function() { | |
| 2031 | + return scope[ctrlAs].$$data_rycid_first_init; | |
| 2032 | + }, | |
| 2033 | + function(newValue, oldValue) { | |
| 2034 | + scope[ctrlAs].$$internal_validate_init(); | |
| 2035 | + } | |
| 2036 | + ); | |
| 2037 | + scope.$watch( | |
| 2038 | + function() { | |
| 2039 | + return scope[ctrlAs].$$data_rystart_first_init; | |
| 2040 | + }, | |
| 2041 | + function(newValue, oldValue) { | |
| 2042 | + scope[ctrlAs].$$internal_validate_init(); | |
| 2043 | + } | |
| 2044 | + ); | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + // 监控线路id的变化 | |
| 2048 | + attr.$observe("xlidvalue", function(value) { | |
| 2049 | + if (value && value != "") { | |
| 2050 | + console.log("xlidvalue=" + value); | |
| 2051 | + | |
| 2052 | + employeeConfigService_g.rest.list( | |
| 2053 | + {"xl.id_eq": value, size: 100}, | |
| 2054 | + function(result) { | |
| 2055 | + // 获取值了 | |
| 2056 | + console.log("人员配置获取了"); | |
| 2057 | + | |
| 2058 | + scope[ctrlAs].$$data = []; | |
| 2059 | + for (var i = 0; i < result.content.length; i++) { | |
| 2060 | + scope[ctrlAs].$$data.push({ | |
| 2061 | + id: result.content[i].id, | |
| 2062 | + dbbm: result.content[i].dbbm, | |
| 2063 | + jsy: result.content[i].jsy.personnelName, | |
| 2064 | + spy: result.content[i].spy == null ? "" : result.content[i].spy.personnelName, | |
| 2065 | + isstart: false | |
| 2066 | + }); | |
| 2067 | + } | |
| 2068 | + if (scope[ctrlAs].$$data_init) { | |
| 2069 | + scope[ctrlAs].$$dataSelected = []; | |
| 2070 | + scope[ctrlAs].$$dataSelectedStart = undefined; | |
| 2071 | + scope[ctrlAs].$$internalmodel = undefined; | |
| 2072 | + scope[ctrlAs].$$dataDesc = ""; | |
| 2073 | + scope[ctrlAs].$$dataSelectDesc = ""; | |
| 2074 | + } | |
| 2075 | + scope[ctrlAs].$$data_xl_first_init = true; | |
| 2076 | + | |
| 2077 | + scope[ctrlAs].$$dataDesc = ",共" + result.content.length + "组"; | |
| 2078 | + }, | |
| 2079 | + function(result) { | |
| 2080 | + | |
| 2081 | + } | |
| 2082 | + ); | |
| 2083 | + | |
| 2084 | + } | |
| 2085 | + }); | |
| 2086 | + | |
| 2087 | + // 监控搭班编码范围值的变化 | |
| 2088 | + attr.$observe("dbbmrangevalue", function(value) { | |
| 2089 | + if (value && value != "") { | |
| 2090 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 2091 | + var dbbmnames = value.split(","); | |
| 2092 | + var i = 0; | |
| 2093 | + if (data_temp && data_temp.length == 0) { // 初始创建 | |
| 2094 | + console.log("dbbmrangevalue变换了"); | |
| 2095 | + for (i = 0; i < dbbmnames.length; i++) { | |
| 2096 | + scope[ctrlAs].$$dataSelected.push({ | |
| 2097 | + dbbm: dbbmnames[i], | |
| 2098 | + isstart: false | |
| 2099 | + }); | |
| 2100 | + } | |
| 2101 | + } else { | |
| 2102 | + for (i = 0; i < dbbmnames.length; i++) { | |
| 2103 | + data_temp[i].dbbm = dbbmnames[i]; | |
| 2104 | + } | |
| 2105 | + } | |
| 2106 | + scope[ctrlAs].$$data_ry_first_init = true; | |
| 2107 | + } | |
| 2108 | + }); | |
| 2109 | + | |
| 2110 | + // 监控人员配置id范围值的变化 | |
| 2111 | + attr.$observe("rycidrangevalue", function(value) { | |
| 2112 | + if (value && value != "") { | |
| 2113 | + var data_temp = scope[ctrlAs].$$dataSelected; | |
| 2114 | + var rycids = value.split(","); | |
| 2115 | + var i = 0; | |
| 2116 | + if (data_temp && data_temp.length == 0) { // 初始创建 | |
| 2117 | + console.log("rycidrangevalue变换了"); | |
| 2118 | + for (i = 0; i < rycids.length; i++) { | |
| 2119 | + scope[ctrlAs].$$dataSelected.push({ | |
| 2120 | + id: rycids[i], | |
| 2121 | + isstart: false | |
| 2122 | + }); | |
| 2123 | + } | |
| 2124 | + } else { | |
| 2125 | + for (i = 0; i < rycids.length; i++) { | |
| 2126 | + data_temp[i].id = rycids[i]; | |
| 2127 | + } | |
| 2128 | + } | |
| 2129 | + scope[ctrlAs].$$data_rycid_first_init = true; | |
| 2130 | + } | |
| 2131 | + }); | |
| 2132 | + | |
| 2133 | + // 监控起始人员的变化 | |
| 2134 | + attr.$observe("rystartvalue", function(value) { | |
| 2135 | + if (value && value != "") { | |
| 2136 | + scope[ctrlAs].$$dataSelectedStart = value - 1; | |
| 2137 | + scope[ctrlAs].$$data_rystart_first_init = true; | |
| 2138 | + } | |
| 2139 | + }); | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + } | |
| 2144 | + } | |
| 2145 | + | |
| 2146 | + } | |
| 2147 | + } | |
| 2148 | + } | |
| 2149 | +]); | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
| ... | ... | @@ -222,7 +222,7 @@ angular.module('ScheduleApp').factory('EmployeeConfigService_g', ['$resource', f |
| 222 | 222 | return { |
| 223 | 223 | rest : $resource( |
| 224 | 224 | '/eci/:id', |
| 225 | - {order: 'xl.id,dbbmFormula', direction: 'ASC', id: '@id_route'}, | |
| 225 | + {order: 'createDate', direction: 'ASC', id: '@id_route'}, | |
| 226 | 226 | { |
| 227 | 227 | list: { |
| 228 | 228 | method: 'GET', |
| ... | ... | @@ -389,6 +389,16 @@ angular.module('ScheduleApp').factory('SchedulePlanManageService_g', ['$resource |
| 389 | 389 | method: 'DELETE' |
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | + ), | |
| 393 | + groupinfo : $resource( | |
| 394 | + '/spc/groupinfos/:xlid/:sdate', | |
| 395 | + {}, | |
| 396 | + { | |
| 397 | + list: { | |
| 398 | + method: 'GET', | |
| 399 | + isArray: true | |
| 400 | + } | |
| 401 | + } | |
| 392 | 402 | ) |
| 393 | 403 | }; |
| 394 | 404 | }]); |
| ... | ... | @@ -433,4 +443,3 @@ angular.module('ScheduleApp').factory('BusLineInfoStatService_g', ['$resource', |
| 433 | 443 | ); |
| 434 | 444 | }]); |
| 435 | 445 | |
| 436 | - | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| ... | ... | @@ -737,6 +737,56 @@ ScheduleApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvi |
| 737 | 737 | } |
| 738 | 738 | }) |
| 739 | 739 | |
| 740 | + // 排班调度值勤日报模块 | |
| 741 | + .state("schedulePlanReportManage", { | |
| 742 | + url: '/schedulePlanReportManage', | |
| 743 | + views: { | |
| 744 | + "": { | |
| 745 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index_report.html' | |
| 746 | + }, | |
| 747 | + "schedulePlanReportManage_list@schedulePlanReportManage": { | |
| 748 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list_report.html' | |
| 749 | + } | |
| 750 | + }, | |
| 751 | + | |
| 752 | + resolve: { | |
| 753 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 754 | + return $ocLazyLoad.load({ | |
| 755 | + name: 'schedulePlanManage_module', | |
| 756 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 757 | + files: [ | |
| 758 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 759 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 760 | + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js" | |
| 761 | + ] | |
| 762 | + }); | |
| 763 | + }] | |
| 764 | + } | |
| 765 | + }) | |
| 766 | + | |
| 767 | + .state("schedulePlanReportManage_edit", { | |
| 768 | + url: '/schedulePlanReportManage_edit/:xlid/:sdate/:lp', | |
| 769 | + views: { | |
| 770 | + "": { | |
| 771 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/edit_report.html' | |
| 772 | + } | |
| 773 | + }, | |
| 774 | + | |
| 775 | + resolve: { | |
| 776 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 777 | + return $ocLazyLoad.load({ | |
| 778 | + name: 'schedulePlanReportManage_edit_module', | |
| 779 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 780 | + files: [ | |
| 781 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 782 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 783 | + "pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js" | |
| 784 | + ] | |
| 785 | + }); | |
| 786 | + }] | |
| 787 | + } | |
| 788 | + }) | |
| 789 | + | |
| 740 | 790 | // 线路运营概览模块 |
| 741 | 791 | .state("busLineInfoStat", { |
| 742 | 792 | url: '/busLineInfoStat', | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/listInfo.html renamed to src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/edit_report.html
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/index_report.html
0 → 100644
| 1 | +<div class="page-head"> | |
| 2 | + <div class="page-title"> | |
| 3 | + <h1>调度值勤日报</h1> | |
| 4 | + </div> | |
| 5 | +</div> | |
| 6 | + | |
| 7 | +<ul class="page-breadcrumb breadcrumb"> | |
| 8 | + <li> | |
| 9 | + <a href="/pages/home.html" data-pjax="">首页</a> | |
| 10 | + <i class="fa fa-circle"></i> | |
| 11 | + </li> | |
| 12 | + <li> | |
| 13 | + <span class="active">运营计划管理</span> | |
| 14 | + <i class="fa fa-circle"></i> | |
| 15 | + </li> | |
| 16 | + <li> | |
| 17 | + <span class="active">调度值勤日报</span> | |
| 18 | + </li> | |
| 19 | +</ul> | |
| 20 | + | |
| 21 | +<div class="row"> | |
| 22 | + <div class="col-md-12" ng-controller="SchedulePlanReportManageCtrl as ctrl"> | |
| 23 | + <div class="portlet light bordered"> | |
| 24 | + <div class="portlet-title"> | |
| 25 | + <div class="caption font-dark"> | |
| 26 | + <i class="fa fa-database font-dark"></i> | |
| 27 | + <span class="caption-subject bold uppercase">排班计划</span> | |
| 28 | + </div> | |
| 29 | + <div class="actions"> | |
| 30 | + <div class="btn-group"> | |
| 31 | + <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown"> | |
| 32 | + <i class="fa fa-share"></i> | |
| 33 | + <span>数据工具</span> | |
| 34 | + <i class="fa fa-angle-down"></i> | |
| 35 | + </a> | |
| 36 | + <ul class="dropdown-menu pull-right"> | |
| 37 | + <li> | |
| 38 | + <a href="javascript:" class="tool-action"> | |
| 39 | + <i class="fa fa-file-excel-o"></i> | |
| 40 | + 导出excel | |
| 41 | + </a> | |
| 42 | + </li> | |
| 43 | + <li class="divider"></li> | |
| 44 | + <li> | |
| 45 | + <a href="javascript:" class="tool-action"> | |
| 46 | + <i class="fa fa-refresh"></i> | |
| 47 | + 刷行数据 | |
| 48 | + </a> | |
| 49 | + </li> | |
| 50 | + </ul> | |
| 51 | + </div> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + | |
| 55 | + <div class="portlet-body"> | |
| 56 | + <div ui-view="schedulePlanReportManage_list"></div> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + </div> | |
| 60 | +</div> | |
| 0 | 61 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list_report.html
0 → 100644
| 1 | +<!-- ui-route employeeInfoManage.list --> | |
| 2 | +<div ng-controller="SchedulePlanReportManageListCtrl as ctrl"> | |
| 3 | + <div class="fixDiv"> | |
| 4 | + <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column" style="width: 2000px"> | |
| 5 | + <thead> | |
| 6 | + <tr role="row" class="heading"> | |
| 7 | + <th style="width: 50px;">序号</th> | |
| 8 | + <th style="width: 230px;">线路</th> | |
| 9 | + <th style="width: 180px">日期</th> | |
| 10 | + <th style="width: 60px">路牌</th> | |
| 11 | + <th style="width: 100px;">车辆</th> | |
| 12 | + <th style="width: 80px;">出场1</th> | |
| 13 | + <th style="width: 100px;">驾工1</th> | |
| 14 | + <th style="width: 100px;">驾1</th> | |
| 15 | + <th style="width: 100px;">售工1</th> | |
| 16 | + <th style="width: 100px;">售1</th> | |
| 17 | + <th style="width: 80px;">出场2</th> | |
| 18 | + <th style="width: 100px;">驾工2</th> | |
| 19 | + <th style="width: 100px;">驾2</th> | |
| 20 | + <th style="width: 100px;">售工2</th> | |
| 21 | + <th style="width: 100px;">售2</th> | |
| 22 | + <th style="width: 150px;">排班时间</th> | |
| 23 | + <th>时刻表</th> | |
| 24 | + </tr> | |
| 25 | + <tr role="row" class="filter"> | |
| 26 | + <td></td> | |
| 27 | + <td> | |
| 28 | + <sa-Select3 model="ctrl.searchCondition()" | |
| 29 | + name="xl" | |
| 30 | + placeholder="请输拼音..." | |
| 31 | + dcvalue="{{ctrl.searchCondition()['xlid']}}" | |
| 32 | + dcname="xlid" | |
| 33 | + icname="id" | |
| 34 | + icnames="name" | |
| 35 | + datatype="xl"> | |
| 36 | + </sa-Select3> | |
| 37 | + </td> | |
| 38 | + <td> | |
| 39 | + <div class="input-group"> | |
| 40 | + <input type="text" class="form-control" | |
| 41 | + name="scheduleDate" placeholder="选择日期..." | |
| 42 | + uib-datepicker-popup="yyyy-MM-dd" | |
| 43 | + is-open="ctrl.scheduleDateOpen" | |
| 44 | + ng-model="ctrl.searchCondition().sdate" readonly/> | |
| 45 | + <span class="input-group-btn"> | |
| 46 | + <button type="button" class="btn btn-default" ng-click="ctrl.scheduleDate_open()"> | |
| 47 | + <i class="glyphicon glyphicon-calendar"></i> | |
| 48 | + </button> | |
| 49 | + </span> | |
| 50 | + </div> | |
| 51 | + </td> | |
| 52 | + <td></td> | |
| 53 | + <td></td> | |
| 54 | + <td></td> | |
| 55 | + <td></td> | |
| 56 | + <td></td> | |
| 57 | + <td></td> | |
| 58 | + <td></td> | |
| 59 | + <td></td> | |
| 60 | + <td></td> | |
| 61 | + <td></td> | |
| 62 | + <td></td> | |
| 63 | + <td></td> | |
| 64 | + <td></td> | |
| 65 | + </tr> | |
| 66 | + </thead> | |
| 67 | + <tbody> | |
| 68 | + <tr ng-repeat="info in ctrl.pageInfo.infos" class="odd gradeX"> | |
| 69 | + <td> | |
| 70 | + <span ng-bind="$index + 1"></span> | |
| 71 | + </td> | |
| 72 | + <td> | |
| 73 | + <span ng-bind="info.xlName"></span> | |
| 74 | + </td> | |
| 75 | + <td> | |
| 76 | + <span ng-bind="info.scheduleDate | date: 'yyyy-MM-dd'"></span> | |
| 77 | + </td> | |
| 78 | + <td> | |
| 79 | + <span ng-bind="info.lpName"></span> | |
| 80 | + </td> | |
| 81 | + <td> | |
| 82 | + <a class="btn btn-success" ng-click="ctrl.goEditForm()"> | |
| 83 | + <span ng-bind="info.clZbh"></span> | |
| 84 | + </a> | |
| 85 | + </td> | |
| 86 | + <td> | |
| 87 | + <a class="btn btn-success" ng-show="info.ccsj1"> | |
| 88 | + <span ng-bind="info.ccsj1"></span> | |
| 89 | + </a> | |
| 90 | + </td> | |
| 91 | + <td> | |
| 92 | + <a class="btn btn-success" ng-show="info.jsy1Gh"> | |
| 93 | + <span ng-bind="info.jsy1Gh"></span> | |
| 94 | + </a> | |
| 95 | + </td> | |
| 96 | + <td> | |
| 97 | + <a class="btn btn-success" ng-show="info.jsy1Name"> | |
| 98 | + <span ng-bind="info.jsy1Name"></span> | |
| 99 | + </a> | |
| 100 | + </td> | |
| 101 | + <td> | |
| 102 | + <a class="btn btn-success" ng-show="info.spy1Gh"> | |
| 103 | + <span ng-bind="info.spy1Gh"></span> | |
| 104 | + </a> | |
| 105 | + </td> | |
| 106 | + <td> | |
| 107 | + <a class="btn btn-success" ng-show="info.spy1Name"> | |
| 108 | + <span ng-bind="info.spy1Name"></span> | |
| 109 | + </a> | |
| 110 | + </td> | |
| 111 | + <td> | |
| 112 | + <a class="btn btn-success" ng-show="info.ccsj2"> | |
| 113 | + <span ng-bind="info.ccsj2"></span> | |
| 114 | + </a> | |
| 115 | + </td> | |
| 116 | + <td> | |
| 117 | + <a class="btn btn-success" ng-show="info.jsy2Gh"> | |
| 118 | + <span ng-bind="info.jsy2Gh"></span> | |
| 119 | + </a> | |
| 120 | + </td> | |
| 121 | + <td> | |
| 122 | + <a class="btn btn-success" ng-show="info.jsy2Name"> | |
| 123 | + <span ng-bind="info.jsy2Name"></span> | |
| 124 | + </a> | |
| 125 | + </td> | |
| 126 | + <td> | |
| 127 | + <a class="btn btn-success" ng-show="info.spy2Gh"> | |
| 128 | + <span ng-bind="info.spy2Gh"></span> | |
| 129 | + </a> | |
| 130 | + </td> | |
| 131 | + <td> | |
| 132 | + <a class="btn btn-success" ng-show="info.spy2Name"> | |
| 133 | + <span ng-bind="info.spy2Name"></span> | |
| 134 | + </a> | |
| 135 | + </td> | |
| 136 | + <td> | |
| 137 | + <span ng-bind="info.createDate | date: 'yyyy-MM-dd HH:mm:ss'"></span> | |
| 138 | + </td> | |
| 139 | + <td> | |
| 140 | + <span ng-bind="info.ttinfoName"></span> | |
| 141 | + </td> | |
| 142 | + </tr> | |
| 143 | + </tbody> | |
| 144 | + </table> | |
| 145 | + </div> | |
| 146 | + | |
| 147 | +</div> | |
| 0 | 148 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/schedulePlanReportManage.js
0 → 100644
| 1 | +// 调度值勤日报管理 service controller 等写在一起 | |
| 2 | +// TODO:使用的global服务需要修正 | |
| 3 | +angular.module('ScheduleApp').factory('SchedulePlanReportManageService', ['SchedulePlanManageService_g', function(service) { | |
| 4 | + /** 当前的查询条件信息 */ | |
| 5 | + var currentSearchCondition = {}; | |
| 6 | + | |
| 7 | + return { | |
| 8 | + /** | |
| 9 | + * 获取查询条件信息, | |
| 10 | + * 用于给controller用来和页面数据绑定。 | |
| 11 | + */ | |
| 12 | + getSearchCondition: function() { | |
| 13 | + return currentSearchCondition; | |
| 14 | + }, | |
| 15 | + /** | |
| 16 | + * 重置查询条件信息。 | |
| 17 | + */ | |
| 18 | + resetSearchCondition: function() { | |
| 19 | + var key; | |
| 20 | + for (key in currentSearchCondition) { | |
| 21 | + currentSearchCondition[key] = undefined; | |
| 22 | + } | |
| 23 | + }, | |
| 24 | + /** | |
| 25 | + * 组装查询参数,返回一个promise查询结果。 | |
| 26 | + * @param params 查询参数 | |
| 27 | + * @return 返回一个 promise | |
| 28 | + */ | |
| 29 | + getPage: function() { | |
| 30 | + var params = currentSearchCondition; // 查询条件 | |
| 31 | + | |
| 32 | + // TODO:如果没有选中线路、日期,默认选中一个 | |
| 33 | + if (!params.xlid) { | |
| 34 | + currentSearchCondition.xlid = 2; | |
| 35 | + } | |
| 36 | + if (!params.sdate) { | |
| 37 | + currentSearchCondition.sdate = new Date(); | |
| 38 | + currentSearchCondition.sdate.setTime(1472140800000); | |
| 39 | + } | |
| 40 | + | |
| 41 | + return service.groupinfo.list(params).$promise; | |
| 42 | + }, | |
| 43 | + /** | |
| 44 | + * 获取明细信息。 | |
| 45 | + * @param id 车辆id | |
| 46 | + * @return 返回一个 promise | |
| 47 | + */ | |
| 48 | + getDetail: function(id) { | |
| 49 | + var params = {id: id}; | |
| 50 | + return service.get(params).$promise; | |
| 51 | + }, | |
| 52 | + /** | |
| 53 | + * 保存信息。 | |
| 54 | + * @param obj 车辆详细信息 | |
| 55 | + * @return 返回一个 promise | |
| 56 | + */ | |
| 57 | + saveDetail: function(obj) { | |
| 58 | + return service.save(obj).$promise; | |
| 59 | + } | |
| 60 | + }; | |
| 61 | + | |
| 62 | +}]); | |
| 63 | + | |
| 64 | +angular.module('ScheduleApp').controller('SchedulePlanReportManageCtrl', [ | |
| 65 | + 'SchedulePlanReportManageService', '$state', | |
| 66 | + function(schedulePlanReportManageService, $state) { | |
| 67 | + var self = this; | |
| 68 | + | |
| 69 | + // 切换到form状态 | |
| 70 | + self.goForm = function() { | |
| 71 | + alert("切换"); | |
| 72 | + } | |
| 73 | + } | |
| 74 | +]); | |
| 75 | + | |
| 76 | +angular.module('ScheduleApp').controller('SchedulePlanReportManageListCtrl', [ | |
| 77 | + 'SchedulePlanReportManageService', '$scope', '$state', | |
| 78 | + function(schedulePlanReportManageService, $scope, $state) { | |
| 79 | + | |
| 80 | + var self = this; | |
| 81 | + self.pageInfo = { | |
| 82 | + infos: [] | |
| 83 | + }; | |
| 84 | + | |
| 85 | + // 日期 日期控件开关 | |
| 86 | + self.scheduleDateOpen = false; | |
| 87 | + self.scheduleDate_open = function() { | |
| 88 | + self.scheduleDateOpen = true; | |
| 89 | + }; | |
| 90 | + | |
| 91 | + // 初始创建的时候,获取一次列表数据 | |
| 92 | + schedulePlanReportManageService.getPage().then( | |
| 93 | + function(result) { | |
| 94 | + self.pageInfo.infos = result; | |
| 95 | + }, | |
| 96 | + function(result) { | |
| 97 | + alert("出错啦!"); | |
| 98 | + } | |
| 99 | + ); | |
| 100 | + | |
| 101 | + // 翻页的时候调用 | |
| 102 | + self.pageChanaged = function() { | |
| 103 | + schedulePlanReportManageService.getPage().then( | |
| 104 | + function(result) { | |
| 105 | + self.pageInfo.infos = result; | |
| 106 | + }, | |
| 107 | + function(result) { | |
| 108 | + alert("出错啦!"); | |
| 109 | + } | |
| 110 | + ); | |
| 111 | + }; | |
| 112 | + // 获取查询条件数据 | |
| 113 | + self.searchCondition = function() { | |
| 114 | + return schedulePlanReportManageService.getSearchCondition(); | |
| 115 | + }; | |
| 116 | + // 重置查询条件 | |
| 117 | + self.resetSearchCondition = function() { | |
| 118 | + return schedulePlanReportManageService.resetSearchCondition(); | |
| 119 | + }; | |
| 120 | + | |
| 121 | + // 监控条件变化,触发查询 | |
| 122 | + $scope.$watch( | |
| 123 | + function() { | |
| 124 | + return schedulePlanReportManageService.getSearchCondition(); | |
| 125 | + }, | |
| 126 | + function(newValue, oldValue) { | |
| 127 | + if (newValue) { | |
| 128 | + if (newValue.xlid && newValue.sdate) { | |
| 129 | + self.pageChanaged(); | |
| 130 | + } | |
| 131 | + } | |
| 132 | + }, | |
| 133 | + true | |
| 134 | + ); | |
| 135 | + | |
| 136 | + // 切换到修改页面 | |
| 137 | + self.goEditForm = function() { | |
| 138 | + //$state.go("schedulePlanReportManage_edit"); | |
| 139 | + } | |
| 140 | + | |
| 141 | + } | |
| 142 | +]); | |
| 143 | + | |
| 144 | +angular.module('ScheduleApp').controller('SchedulePlanReportManageFormCtrl', ['SchedulePlanReportManageService', '$stateParams', '$state', function(schedulePlanReportManageService, $stateParams, $state) { | |
| 145 | + // TODO: | |
| 146 | +}]); | |
| 147 | + | |
| 148 | +angular.module('ScheduleApp').controller('SchedulePlanReportManageDetailCtrl', ['SchedulePlanReportManageService', '$stateParams', function(schedulePlanReportManageService, $stateParams) { | |
| 149 | + // TODO: | |
| 150 | +}]); | |
| 151 | + | |
| 152 | + | |
| 153 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/edit.html
| ... | ... | @@ -107,59 +107,53 @@ |
| 107 | 107 | |
| 108 | 108 | <div class="form-group has-success has-feedback"> |
| 109 | 109 | <label class="col-md-2 control-label">路牌范围*:</label> |
| 110 | - <div class="col-md-4"> | |
| 111 | - <input type="text" class="form-control" name="lpNames" ng-model="ctrl.scheduleRuleManageForSave.lpNames" required | |
| 112 | - placeholder="由路牌名称组成,逗号分隔"/> | |
| 113 | - </div> | |
| 114 | - <!-- 隐藏块,显示验证信息 --> | |
| 115 | - <div class="alert alert-danger well-sm" ng-show="myForm.lpNames.$error.required"> | |
| 116 | - 路牌范围必须填写 | |
| 117 | - </div> | |
| 118 | - </div> | |
| 119 | - | |
| 120 | - <div class="form-group has-success has-feedback"> | |
| 121 | - <label class="col-md-2 control-label">起始路牌*:</label> | |
| 122 | - <div class="col-md-4"> | |
| 123 | - <input type="text" class="form-control" name="lpStart" ng-model="ctrl.scheduleRuleManageForSave.lpStart" required | |
| 124 | - placeholder="起始路牌索引,从1开始"/> | |
| 125 | - </div> | |
| 126 | - <!-- 隐藏块,显示验证信息 --> | |
| 127 | - <div class="alert alert-danger well-sm" ng-show="myForm.lpStart.$error.required"> | |
| 128 | - 起始路牌必须填写 | |
| 110 | + <div class="col-md-6"> | |
| 111 | + <sa-Guideboardgroup model="ctrl.scheduleRuleManageForSave" | |
| 112 | + name="lprange" | |
| 113 | + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}" | |
| 114 | + lprangevalue="{{ctrl.scheduleRuleManageForSave.lpNames}}" | |
| 115 | + lprangename="lpNames" | |
| 116 | + lpidrangevalue="{{ctrl.scheduleRuleManageForSave.lpIds}}" | |
| 117 | + lpidrangename="lpIds" | |
| 118 | + lpstartvalue="{{ctrl.scheduleRuleManageForSave.lpStart}}" | |
| 119 | + lpstartname="lpStart" | |
| 120 | + required | |
| 121 | + > | |
| 122 | + </sa-Guideboardgroup> | |
| 123 | + </div> | |
| 124 | + <div class="alert alert-danger well-sm" ng-show="myForm.lprange.$error.required"> | |
| 125 | + 路牌范围,起始路牌必须选择 | |
| 129 | 126 | </div> |
| 130 | 127 | </div> |
| 131 | 128 | |
| 132 | 129 | <div class="form-group has-success has-feedback"> |
| 133 | 130 | <label class="col-md-2 control-label">人员范围*:</label> |
| 134 | - <div class="col-md-4"> | |
| 135 | - <input type="text" class="form-control" name="ryDbbms" ng-model="ctrl.scheduleRuleManageForSave.ryDbbms" required | |
| 136 | - placeholder="由人员配置的搭班编码组成,逗号分隔"/> | |
| 137 | - </div> | |
| 138 | - <!-- 隐藏块,显示验证信息 --> | |
| 139 | - <div class="alert alert-danger well-sm" ng-show="myForm.ryDbbms.$error.required"> | |
| 140 | - 人员范围必须填写 | |
| 131 | + <div class="col-md-6"> | |
| 132 | + <sa-Employeegroup model="ctrl.scheduleRuleManageForSave" | |
| 133 | + name="ryrange" | |
| 134 | + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}" | |
| 135 | + dbbmrangevalue="{{ctrl.scheduleRuleManageForSave.ryDbbms}}" | |
| 136 | + dbbmrangename="ryDbbms" | |
| 137 | + rycidrangevalue="{{ctrl.scheduleRuleManageForSave.ryConfigIds}}" | |
| 138 | + rycidrangename="ryConfigIds" | |
| 139 | + rystartvalue="{{ctrl.scheduleRuleManageForSave.ryStart}}" | |
| 140 | + rystartname="ryStart" | |
| 141 | + required | |
| 142 | + > | |
| 143 | + </sa-Employeegroup> | |
| 144 | + </div> | |
| 145 | + <div class="alert alert-danger well-sm" ng-show="myForm.ryrange.$error.required"> | |
| 146 | + 人员范围,起始人员必须选择 | |
| 141 | 147 | </div> |
| 142 | 148 | </div> |
| 143 | 149 | |
| 144 | - <div class="form-group has-success has-feedback"> | |
| 145 | - <label class="col-md-2 control-label">起始人员*:</label> | |
| 146 | - <div class="col-md-4"> | |
| 147 | - <input type="text" class="form-control" name="ryStart" ng-model="ctrl.scheduleRuleManageForSave.ryStart" required | |
| 148 | - placeholder="起始人员索引,从1开始"/> | |
| 149 | - </div> | |
| 150 | - <!-- 隐藏块,显示验证信息 --> | |
| 151 | - <div class="alert alert-danger well-sm" ng-show="myForm.ryStart.$error.required"> | |
| 152 | - 起始路牌必须填写 | |
| 153 | - </div> | |
| 154 | - </div> | |
| 155 | - | |
| 156 | - <div class="form-group"> | |
| 157 | - <label class="col-md-2 control-label">翻班格式:</label> | |
| 158 | - <div class="col-md-4"> | |
| 159 | - <input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs" | |
| 160 | - placeholder="车辆翻班格式"/> | |
| 161 | - </div> | |
| 162 | - </div> | |
| 150 | + <!--<div class="form-group">--> | |
| 151 | + <!--<label class="col-md-2 control-label">翻班格式:</label>--> | |
| 152 | + <!--<div class="col-md-4">--> | |
| 153 | + <!--<input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs"--> | |
| 154 | + <!--placeholder="车辆翻班格式"/>--> | |
| 155 | + <!--</div>--> | |
| 156 | + <!--</div>--> | |
| 163 | 157 | |
| 164 | 158 | |
| 165 | 159 | <!-- 其他form-group --> |
| ... | ... | @@ -181,5 +175,4 @@ |
| 181 | 175 | |
| 182 | 176 | </div> |
| 183 | 177 | |
| 184 | - | |
| 185 | 178 | </div> |
| 186 | 179 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/form.html
| ... | ... | @@ -107,59 +107,53 @@ |
| 107 | 107 | |
| 108 | 108 | <div class="form-group has-success has-feedback"> |
| 109 | 109 | <label class="col-md-2 control-label">路牌范围*:</label> |
| 110 | - <div class="col-md-4"> | |
| 111 | - <input type="text" class="form-control" name="lpNames" ng-model="ctrl.scheduleRuleManageForSave.lpNames" required | |
| 112 | - placeholder="由路牌名称组成,逗号分隔"/> | |
| 113 | - </div> | |
| 114 | - <!-- 隐藏块,显示验证信息 --> | |
| 115 | - <div class="alert alert-danger well-sm" ng-show="myForm.lpNames.$error.required"> | |
| 116 | - 路牌范围必须填写 | |
| 117 | - </div> | |
| 118 | - </div> | |
| 119 | - | |
| 120 | - <div class="form-group has-success has-feedback"> | |
| 121 | - <label class="col-md-2 control-label">起始路牌*:</label> | |
| 122 | - <div class="col-md-4"> | |
| 123 | - <input type="text" class="form-control" name="lpStart" ng-model="ctrl.scheduleRuleManageForSave.lpStart" required | |
| 124 | - placeholder="起始路牌索引,从1开始"/> | |
| 125 | - </div> | |
| 126 | - <!-- 隐藏块,显示验证信息 --> | |
| 127 | - <div class="alert alert-danger well-sm" ng-show="myForm.lpStart.$error.required"> | |
| 128 | - 起始路牌必须填写 | |
| 110 | + <div class="col-md-6"> | |
| 111 | + <sa-Guideboardgroup model="ctrl.scheduleRuleManageForSave" | |
| 112 | + name="lprange" | |
| 113 | + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}" | |
| 114 | + lprangevalue="{{ctrl.scheduleRuleManageForSave.lpNames}}" | |
| 115 | + lprangename="lpNames" | |
| 116 | + lpidrangevalue="{{ctrl.scheduleRuleManageForSave.lpIds}}" | |
| 117 | + lpidrangename="lpIds" | |
| 118 | + lpstartvalue="{{ctrl.scheduleRuleManageForSave.lpStart}}" | |
| 119 | + lpstartname="lpStart" | |
| 120 | + required | |
| 121 | + > | |
| 122 | + </sa-Guideboardgroup> | |
| 123 | + </div> | |
| 124 | + <div class="alert alert-danger well-sm" ng-show="myForm.lprange.$error.required"> | |
| 125 | + 路牌范围,起始路牌必须选择 | |
| 129 | 126 | </div> |
| 130 | 127 | </div> |
| 131 | 128 | |
| 132 | 129 | <div class="form-group has-success has-feedback"> |
| 133 | 130 | <label class="col-md-2 control-label">人员范围*:</label> |
| 134 | - <div class="col-md-4"> | |
| 135 | - <input type="text" class="form-control" name="ryDbbms" ng-model="ctrl.scheduleRuleManageForSave.ryDbbms" required | |
| 136 | - placeholder="由人员配置的搭班编码组成,逗号分隔"/> | |
| 137 | - </div> | |
| 138 | - <!-- 隐藏块,显示验证信息 --> | |
| 139 | - <div class="alert alert-danger well-sm" ng-show="myForm.ryDbbms.$error.required"> | |
| 140 | - 人员范围必须填写 | |
| 131 | + <div class="col-md-6"> | |
| 132 | + <sa-Employeegroup model="ctrl.scheduleRuleManageForSave" | |
| 133 | + name="ryrange" | |
| 134 | + xlidvalue="{{ctrl.scheduleRuleManageForSave.xl.id}}" | |
| 135 | + dbbmrangevalue="{{ctrl.scheduleRuleManageForSave.ryDbbms}}" | |
| 136 | + dbbmrangename="ryDbbms" | |
| 137 | + rycidrangevalue="{{ctrl.scheduleRuleManageForSave.ryConfigIds}}" | |
| 138 | + rycidrangename="ryConfigIds" | |
| 139 | + rystartvalue="{{ctrl.scheduleRuleManageForSave.ryStart}}" | |
| 140 | + rystartname="ryStart" | |
| 141 | + required | |
| 142 | + > | |
| 143 | + </sa-Employeegroup> | |
| 144 | + </div> | |
| 145 | + <div class="alert alert-danger well-sm" ng-show="myForm.ryrange.$error.required"> | |
| 146 | + 人员范围,起始人员必须选择 | |
| 141 | 147 | </div> |
| 142 | 148 | </div> |
| 143 | 149 | |
| 144 | - <div class="form-group has-success has-feedback"> | |
| 145 | - <label class="col-md-2 control-label">起始人员*:</label> | |
| 146 | - <div class="col-md-4"> | |
| 147 | - <input type="text" class="form-control" name="ryStart" ng-model="ctrl.scheduleRuleManageForSave.ryStart" required | |
| 148 | - placeholder="起始人员索引,从1开始"/> | |
| 149 | - </div> | |
| 150 | - <!-- 隐藏块,显示验证信息 --> | |
| 151 | - <div class="alert alert-danger well-sm" ng-show="myForm.ryStart.$error.required"> | |
| 152 | - 起始路牌必须填写 | |
| 153 | - </div> | |
| 154 | - </div> | |
| 155 | - | |
| 156 | - <div class="form-group"> | |
| 157 | - <label class="col-md-2 control-label">翻班格式:</label> | |
| 158 | - <div class="col-md-4"> | |
| 159 | - <input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs" | |
| 160 | - placeholder="车辆翻班格式"/> | |
| 161 | - </div> | |
| 162 | - </div> | |
| 150 | + <!--<div class="form-group">--> | |
| 151 | + <!--<label class="col-md-2 control-label">翻班格式:</label>--> | |
| 152 | + <!--<div class="col-md-4">--> | |
| 153 | + <!--<input type="text" class="form-control" name="fbgs" ng-model="ctrl.scheduleRuleManageForSave.fbgs"--> | |
| 154 | + <!--placeholder="车辆翻班格式"/>--> | |
| 155 | + <!--</div>--> | |
| 156 | + <!--</div>--> | |
| 163 | 157 | |
| 164 | 158 | |
| 165 | 159 | <!-- 其他form-group --> | ... | ... |