Commit 27cda0bcdb0753ca53560d8e44fb59d8def69781
Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
update...
Showing
40 changed files
with
6588 additions
and
5683 deletions
src/main/java/com/bsth/controller/report/ReportController.java
| ... | ... | @@ -48,5 +48,25 @@ public class ReportController { |
| 48 | 48 | @RequestParam String code) { |
| 49 | 49 | return service.historyMessageCount(line, date, code); |
| 50 | 50 | } |
| 51 | + | |
| 52 | + @RequestMapping(value = "/tbodyTime1", method = RequestMethod.GET) | |
| 53 | + public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String date) { | |
| 54 | + return service.tbodyTime1(line, date); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @RequestMapping(value = "/tbodyTime2", method = RequestMethod.GET) | |
| 58 | + public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String date) { | |
| 59 | + return service.tbodyTime2(line, date); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @RequestMapping(value = "/tbodyTime3", method = RequestMethod.GET) | |
| 63 | + public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String date) { | |
| 64 | + return service.tbodyTime3(line, date); | |
| 65 | + } | |
| 66 | + | |
| 67 | + @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET) | |
| 68 | + public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String date) { | |
| 69 | + return service.tbodyTime5(line, date); | |
| 70 | + } | |
| 51 | 71 | |
| 52 | 72 | } | ... | ... |
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
| ... | ... | @@ -3,25 +3,24 @@ package com.bsth.controller.schedule; |
| 3 | 3 | import com.bsth.service.TrafficManageService; |
| 4 | 4 | |
| 5 | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | -import org.springframework.web.bind.annotation.PathVariable; | |
| 7 | 6 | import org.springframework.web.bind.annotation.RequestMapping; |
| 8 | 7 | import org.springframework.web.bind.annotation.RequestMethod; |
| 9 | 8 | import org.springframework.web.bind.annotation.RequestParam; |
| 10 | 9 | import org.springframework.web.bind.annotation.RestController; |
| 11 | 10 | |
| 12 | 11 | /** |
| 13 | - * | |
| 12 | + * | |
| 14 | 13 | * @author BSTH |
| 15 | 14 | * |
| 16 | 15 | */ |
| 17 | 16 | @RestController |
| 18 | 17 | @RequestMapping("trmg") |
| 19 | 18 | public class TrafficManageController { |
| 20 | - | |
| 19 | + | |
| 21 | 20 | @Autowired |
| 22 | - private TrafficManageService trManageService; | |
| 23 | - | |
| 24 | - | |
| 21 | + private TrafficManageService trManageService; | |
| 22 | + | |
| 23 | + | |
| 25 | 24 | @RequestMapping(value = "/setXL", method = RequestMethod.GET) |
| 26 | 25 | public String setXL() throws Exception { |
| 27 | 26 | try { |
| ... | ... | @@ -30,7 +29,7 @@ public class TrafficManageController { |
| 30 | 29 | throw new Exception(exp.getCause()); |
| 31 | 30 | } |
| 32 | 31 | } |
| 33 | - | |
| 32 | + | |
| 34 | 33 | @RequestMapping(value = "/setCL", method = RequestMethod.GET) |
| 35 | 34 | public String setCL() throws Exception { |
| 36 | 35 | try { |
| ... | ... | @@ -39,7 +38,7 @@ public class TrafficManageController { |
| 39 | 38 | throw new Exception(exp.getCause()); |
| 40 | 39 | } |
| 41 | 40 | } |
| 42 | - | |
| 41 | + | |
| 43 | 42 | @RequestMapping(value = "/setSJ", method = RequestMethod.GET) |
| 44 | 43 | public String setSJ() throws Exception { |
| 45 | 44 | try { |
| ... | ... | @@ -48,16 +47,43 @@ public class TrafficManageController { |
| 48 | 47 | throw new Exception(exp.getCause()); |
| 49 | 48 | } |
| 50 | 49 | } |
| 51 | - | |
| 52 | - @RequestMapping(value = "/setCS", method = RequestMethod.GET) | |
| 53 | - public String setCS() throws Exception { | |
| 50 | + | |
| 51 | + @RequestMapping(value = "/setLD", method = RequestMethod.GET) | |
| 52 | + public String setLD() throws Exception { | |
| 54 | 53 | try { |
| 55 | - return trManageService.setCS(); | |
| 54 | + return trManageService.setLD(); | |
| 55 | + } catch (Exception exp) { | |
| 56 | + throw new Exception(exp.getCause()); | |
| 57 | + } | |
| 58 | + } | |
| 59 | + | |
| 60 | + @RequestMapping(value = "/setLCYH", method = RequestMethod.GET) | |
| 61 | + public String setLCYH() throws Exception { | |
| 62 | + try { | |
| 63 | + return trManageService.setLCYH(); | |
| 64 | + } catch (Exception exp) { | |
| 65 | + throw new Exception(exp.getCause()); | |
| 66 | + } | |
| 67 | + } | |
| 68 | + | |
| 69 | + @RequestMapping(value = "/setDDRB", method = RequestMethod.GET) | |
| 70 | + public String setDDRB() throws Exception { | |
| 71 | + try { | |
| 72 | + return trManageService.setDDRB(); | |
| 56 | 73 | } catch (Exception exp) { |
| 57 | 74 | throw new Exception(exp.getCause()); |
| 58 | 75 | } |
| 59 | 76 | } |
| 60 | - | |
| 77 | + | |
| 78 | + @RequestMapping(value = "/setJHBC", method = RequestMethod.GET) | |
| 79 | + public String setJHBC() throws Exception { | |
| 80 | + try { | |
| 81 | + return trManageService.setJHBC(); | |
| 82 | + } catch (Exception exp) { | |
| 83 | + throw new Exception(exp.getCause()); | |
| 84 | + } | |
| 85 | + } | |
| 86 | + | |
| 61 | 87 | @RequestMapping(value = "/setSKB", method = RequestMethod.GET) |
| 62 | 88 | public String setSKB(@RequestParam("ids") String ids) throws Exception { |
| 63 | 89 | try { |
| ... | ... | @@ -66,7 +92,7 @@ public class TrafficManageController { |
| 66 | 92 | throw new Exception(exp.getCause()); |
| 67 | 93 | } |
| 68 | 94 | } |
| 69 | - | |
| 95 | + | |
| 70 | 96 | @RequestMapping(value = "/setXLPC", method = RequestMethod.GET) |
| 71 | 97 | public String setXLPC() throws Exception { |
| 72 | 98 | try { |
| ... | ... | @@ -75,13 +101,23 @@ public class TrafficManageController { |
| 75 | 101 | throw new Exception(exp.getCause()); |
| 76 | 102 | } |
| 77 | 103 | } |
| 78 | - | |
| 79 | - @RequestMapping(value = "/setJHBC", method = RequestMethod.GET) | |
| 80 | - public String setJHBC() throws Exception { | |
| 104 | + | |
| 105 | + @RequestMapping(value = "/setCS", method = RequestMethod.GET) | |
| 106 | + public String setCS() throws Exception { | |
| 81 | 107 | try { |
| 82 | - return trManageService.setDDRB(); | |
| 108 | + return trManageService.setCS(); | |
| 83 | 109 | } catch (Exception exp) { |
| 84 | 110 | throw new Exception(exp.getCause()); |
| 85 | 111 | } |
| 86 | 112 | } |
| 113 | + | |
| 114 | + @RequestMapping(value = "/getDownLoadAllDataFile", method = RequestMethod.GET) | |
| 115 | + public String getDownLoadAllDataFile() throws Exception { | |
| 116 | + try { | |
| 117 | + return trManageService.getDownLoadAllDataFile(); | |
| 118 | + } catch (Exception exp) { | |
| 119 | + throw new Exception(exp.getCause()); | |
| 120 | + } | |
| 121 | + } | |
| 122 | + | |
| 87 | 123 | } | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| ... | ... | @@ -70,7 +70,7 @@ public class BasicData implements CommandLineRunner { |
| 70 | 70 | public static Map<String, String> allPerson; |
| 71 | 71 | |
| 72 | 72 | //站点名和运管处编号 对照 |
| 73 | - public static Map<String, Map<String, Map>> stationName2YgcNumber; | |
| 73 | + public static Map<String,Integer> stationName2YgcNumber; | |
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | static Logger logger = LoggerFactory.getLogger(BasicData.class); |
| ... | ... | @@ -233,13 +233,6 @@ public class BasicData implements CommandLineRunner { |
| 233 | 233 | * @Description: TODO(加载线路相关信息) |
| 234 | 234 | */ |
| 235 | 235 | public void loadLineInfo(){ |
| 236 | - List<StationRoute> stationsList = null;// 站点路由集 | |
| 237 | - StationRoute stationRoute = null; | |
| 238 | - int size = 0; | |
| 239 | - Map<String, Integer> station2Number ; | |
| 240 | - Map<String, Map> dirs2Statioin ; | |
| 241 | - int[] dirs = {0,1};// 运行方向 上下行 | |
| 242 | - int num = 1; | |
| 243 | 236 | Iterator<Line> iterator = lineRepository.findAll().iterator(); |
| 244 | 237 | |
| 245 | 238 | Line line; |
| ... | ... | @@ -247,7 +240,7 @@ public class BasicData implements CommandLineRunner { |
| 247 | 240 | Map<String, String> code2name = new HashMap<>(); |
| 248 | 241 | Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); |
| 249 | 242 | Map<String, String> code2SHcode = new HashMap<String, String>(); |
| 250 | - Map<String, Map<String, Map>> tempStationName2YgcNumber = new HashMap<String, Map<String, Map>>(); | |
| 243 | + Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>(); | |
| 251 | 244 | |
| 252 | 245 | while(iterator.hasNext()){ |
| 253 | 246 | line = iterator.next(); |
| ... | ... | @@ -259,27 +252,26 @@ public class BasicData implements CommandLineRunner { |
| 259 | 252 | /** |
| 260 | 253 | * 加载运管处的站点及序号 |
| 261 | 254 | * 上行从1开始,下行顺序续编 |
| 262 | - | |
| 263 | - num = 1; | |
| 264 | - dirs2Statioin = new HashMap<String, Map>(); | |
| 265 | - for (int i = 0; i < dirs.length; i++) { | |
| 266 | - // 分别取得上下行的站点 | |
| 267 | - stationsList = stationRouteRepository.findByLine(line.getLineCode(), dirs[i]); | |
| 268 | - size = stationsList == null ? 0 :stationsList.size(); | |
| 269 | - if(size > 0 ){ | |
| 270 | - station2Number = new HashMap<String, Integer>(); | |
| 271 | - for (int j = 0; j < size; j++) { | |
| 272 | - stationRoute = stationsList.get(j); | |
| 273 | - // map保存为(站点名称 -->序号) | |
| 274 | - station2Number.put(stationRoute.getStationName(), num++); | |
| 255 | + */ | |
| 256 | + List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc(); | |
| 257 | + if(ygcLines != null && ygcLines.size() > 0){ | |
| 258 | + int size = ygcLines.size(); | |
| 259 | + Object[] tempArray ; | |
| 260 | + int num = 1; | |
| 261 | + String key; | |
| 262 | + String lineCode = ""; | |
| 263 | + for (int i = 0; i < size; i ++){ | |
| 264 | + tempArray = ygcLines.get(i); | |
| 265 | + if(lineCode.equals("")){ | |
| 266 | + lineCode = tempArray[0]+""; | |
| 267 | + }else if(!lineCode.equals(tempArray[0]+"")){ | |
| 268 | + num = 1; | |
| 269 | + lineCode = tempArray[0]+""; | |
| 275 | 270 | } |
| 276 | - // 保存两个数据,(0 --> station2Number)(1 --> station2Number) 0上行 1 下行 | |
| 277 | - dirs2Statioin.put(dirs[i]+"", station2Number); | |
| 271 | + key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2]; | |
| 272 | + tempStationName2YgcNumber.put(key,num++); | |
| 278 | 273 | } |
| 279 | 274 | } |
| 280 | - // 保存(站点编码 --> dirs2Statioin) | |
| 281 | - tempStationName2YgcNumber.put(line.getLineCode(), dirs2Statioin); | |
| 282 | - */ | |
| 283 | 275 | } |
| 284 | 276 | |
| 285 | 277 | lineId2CodeMap = biMap; | ... | ... |
src/main/java/com/bsth/repository/StationRouteRepository.java
| ... | ... | @@ -257,4 +257,15 @@ public interface StationRouteRepository extends BaseRepository<StationRoute, Int |
| 257 | 257 | @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) |
| 258 | 258 | @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1") |
| 259 | 259 | List<StationRoute> findByLineCode(String lineCode); |
| 260 | + | |
| 261 | + @Query("SELECT " + | |
| 262 | + "lineCode,directions,stationName,stationRouteCode " + | |
| 263 | + "FROM " + | |
| 264 | + "StationRoute s " + | |
| 265 | + "WHERE " + | |
| 266 | + "s.destroy = 0 " + | |
| 267 | + "and s.lineCode in(select lineCode from Line where inUse = 1) " + | |
| 268 | + "ORDER BY " + | |
| 269 | + "lineCode,directions,stationRouteCode") | |
| 270 | + List<Object[]> findAllLineWithYgc(); | |
| 260 | 271 | } | ... | ... |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| 1 | 1 | package com.bsth.service.impl; |
| 2 | 2 | |
| 3 | -import java.io.BufferedOutputStream; | |
| 4 | -import java.io.File; | |
| 5 | -import java.io.FileOutputStream; | |
| 6 | -import java.io.IOException; | |
| 7 | -import java.sql.Connection; | |
| 8 | -import java.sql.PreparedStatement; | |
| 9 | -import java.sql.ResultSet; | |
| 10 | -import java.text.DecimalFormat; | |
| 11 | -import java.text.SimpleDateFormat; | |
| 12 | -import java.util.Date; | |
| 13 | -import java.util.HashMap; | |
| 14 | -import java.util.Iterator; | |
| 15 | -import java.util.List; | |
| 16 | -import java.util.Map; | |
| 17 | -import java.util.Set; | |
| 18 | - | |
| 19 | -import org.apache.commons.lang.time.DateUtils; | |
| 20 | -import org.slf4j.Logger; | |
| 21 | -import org.slf4j.LoggerFactory; | |
| 22 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 23 | -import org.springframework.data.domain.Sort; | |
| 24 | -import org.springframework.data.domain.Sort.Direction; | |
| 25 | -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | |
| 26 | -import org.springframework.stereotype.Service; | |
| 27 | - | |
| 28 | 3 | import com.bsth.data.BasicData; |
| 29 | -import com.bsth.entity.Cars; | |
| 30 | -import com.bsth.entity.Line; | |
| 31 | -import com.bsth.entity.LineInformation; | |
| 32 | -import com.bsth.entity.Personnel; | |
| 33 | -import com.bsth.entity.StationRoute; | |
| 4 | +import com.bsth.entity.*; | |
| 34 | 5 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 35 | 6 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 36 | 7 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| 37 | 8 | import com.bsth.entity.schedule.TTInfo; |
| 38 | 9 | import com.bsth.entity.schedule.TTInfoDetail; |
| 39 | 10 | import com.bsth.entity.search.CustomerSpecs; |
| 40 | -import com.bsth.repository.CarsRepository; | |
| 41 | -import com.bsth.repository.LineInformationRepository; | |
| 42 | -import com.bsth.repository.LineRepository; | |
| 43 | -import com.bsth.repository.PersonnelRepository; | |
| 44 | -import com.bsth.repository.StationRouteRepository; | |
| 45 | -import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 46 | -import com.bsth.repository.schedule.EmployeeConfigInfoRepository; | |
| 47 | -import com.bsth.repository.schedule.SchedulePlanInfoRepository; | |
| 48 | -import com.bsth.repository.schedule.TTInfoDetailRepository; | |
| 49 | -import com.bsth.repository.schedule.TTInfoRepository; | |
| 11 | +import com.bsth.repository.*; | |
| 12 | +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 13 | +import com.bsth.repository.schedule.*; | |
| 50 | 14 | import com.bsth.service.TrafficManageService; |
| 51 | 15 | import com.bsth.util.TimeUtils; |
| 52 | 16 | import com.bsth.util.db.DBUtils_MS; |
| ... | ... | @@ -54,7 +18,25 @@ import com.bsth.webService.trafficManage.geotool.services.Internal; |
| 54 | 18 | import com.bsth.webService.trafficManage.geotool.services.InternalPortType; |
| 55 | 19 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; |
| 56 | 20 | import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; |
| 57 | -import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | |
| 21 | +import org.apache.commons.lang.time.DateUtils; | |
| 22 | +import org.slf4j.Logger; | |
| 23 | +import org.slf4j.LoggerFactory; | |
| 24 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 25 | +import org.springframework.data.domain.Sort; | |
| 26 | +import org.springframework.data.domain.Sort.Direction; | |
| 27 | +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | |
| 28 | +import org.springframework.stereotype.Service; | |
| 29 | + | |
| 30 | +import java.io.BufferedOutputStream; | |
| 31 | +import java.io.File; | |
| 32 | +import java.io.FileOutputStream; | |
| 33 | +import java.io.IOException; | |
| 34 | +import java.sql.Connection; | |
| 35 | +import java.sql.PreparedStatement; | |
| 36 | +import java.sql.ResultSet; | |
| 37 | +import java.text.DecimalFormat; | |
| 38 | +import java.text.SimpleDateFormat; | |
| 39 | +import java.util.*; | |
| 58 | 40 | /** |
| 59 | 41 | * |
| 60 | 42 | * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) |
| ... | ... | @@ -63,7 +45,7 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 63 | 45 | * |
| 64 | 46 | * @Description: TODO(运管处接口service业务层) |
| 65 | 47 | * |
| 66 | - * @Author bsth@z | |
| 48 | + * @Author bsth@zq | |
| 67 | 49 | * |
| 68 | 50 | * @Date 2016年10月28日 上午9:21:17 |
| 69 | 51 | * |
| ... | ... | @@ -158,8 +140,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 158 | 140 | @Override |
| 159 | 141 | public String setXL() { |
| 160 | 142 | String result = "failure"; |
| 143 | + StringBuffer sBuffer = new StringBuffer(); | |
| 161 | 144 | try { |
| 162 | - StringBuffer sBuffer = new StringBuffer(); ; | |
| 163 | 145 | Iterator<Line> lineIterator = lineRepository.findAll().iterator(); |
| 164 | 146 | Line line = null; |
| 165 | 147 | List<StationRoute> stationsList = null;// 站点路由集 |
| ... | ... | @@ -168,7 +150,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 168 | 150 | sBuffer.append("<XLs>"); |
| 169 | 151 | while(lineIterator.hasNext()){ |
| 170 | 152 | line = lineIterator.next(); |
| 171 | - if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){ | |
| 153 | + if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null | |
| 154 | + || line.getInUse() == 0){ | |
| 172 | 155 | continue; |
| 173 | 156 | } |
| 174 | 157 | sBuffer.append("<XL>"); |
| ... | ... | @@ -208,7 +191,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 208 | 191 | sBuffer.append("</XLs>"); |
| 209 | 192 | System.out.println(sBuffer.toString()); |
| 210 | 193 | if(sBuffer.indexOf("<XL>") != -1){ |
| 211 | - logger.info("setXL:"+sBuffer.toString()); | |
| 212 | 194 | String portResult = portType.setXL(userNameXl, passwordXl, sBuffer.toString()); |
| 213 | 195 | String portArray[] = portResult.split("\n"); |
| 214 | 196 | if(portArray.length >= 4){ |
| ... | ... | @@ -224,8 +206,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 224 | 206 | } |
| 225 | 207 | } |
| 226 | 208 | } catch (Exception e) { |
| 209 | + logger.error("setXL:",e); | |
| 227 | 210 | e.printStackTrace(); |
| 228 | 211 | }finally{ |
| 212 | + logger.info("setXL:"+sBuffer.toString()); | |
| 229 | 213 | logger.info("setXL:"+result); |
| 230 | 214 | } |
| 231 | 215 | return result; |
| ... | ... | @@ -237,8 +221,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 237 | 221 | @Override |
| 238 | 222 | public String setCL() { |
| 239 | 223 | String result = "failure"; |
| 224 | + StringBuffer sBuffer =new StringBuffer(); | |
| 240 | 225 | try { |
| 241 | - StringBuffer sBuffer =new StringBuffer(); | |
| 242 | 226 | sBuffer.append("<CLs>"); |
| 243 | 227 | Cars cars = null; |
| 244 | 228 | String company; |
| ... | ... | @@ -258,13 +242,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 258 | 242 | sBuffer.append("</CL>"); |
| 259 | 243 | } |
| 260 | 244 | sBuffer.append("</CLs>"); |
| 261 | - logger.info("setCL:"+sBuffer.toString()); | |
| 262 | 245 | if(ssop.setCL(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 263 | 246 | result = "success"; |
| 264 | 247 | } |
| 265 | 248 | } catch (Exception e) { |
| 249 | + logger.error("setCL:",e); | |
| 266 | 250 | e.printStackTrace(); |
| 267 | 251 | }finally{ |
| 252 | + logger.info("setCL:"+sBuffer.toString()); | |
| 268 | 253 | logger.info("setCL:"+result); |
| 269 | 254 | } |
| 270 | 255 | return result; |
| ... | ... | @@ -276,8 +261,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 276 | 261 | @Override |
| 277 | 262 | public String setSJ() { |
| 278 | 263 | String result = "failure"; |
| 264 | + StringBuffer sBuffer =new StringBuffer(); | |
| 279 | 265 | try { |
| 280 | - StringBuffer sBuffer =new StringBuffer(); | |
| 281 | 266 | sBuffer.append("<SJs>"); |
| 282 | 267 | Personnel personnel = null; |
| 283 | 268 | String company; |
| ... | ... | @@ -295,13 +280,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 295 | 280 | sBuffer.append("</SJ>"); |
| 296 | 281 | } |
| 297 | 282 | sBuffer.append("</SJs>"); |
| 298 | - logger.info("setSJ:"+sBuffer.toString()); | |
| 299 | 283 | if(ssop.setSJ(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 300 | 284 | result = "success"; |
| 301 | 285 | }; |
| 302 | 286 | } catch (Exception e) { |
| 287 | + logger.error("setSJ:",e); | |
| 303 | 288 | e.printStackTrace(); |
| 304 | 289 | }finally{ |
| 290 | + logger.info("setSJ:"+sBuffer.toString()); | |
| 305 | 291 | logger.info("setSJ:"+result); |
| 306 | 292 | } |
| 307 | 293 | return result; |
| ... | ... | @@ -309,15 +295,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 309 | 295 | |
| 310 | 296 | /** |
| 311 | 297 | * 上传路单 |
| 312 | - * @param date | |
| 313 | - * @return xml格式的字符串 | |
| 298 | + * @return 上传成功标识 | |
| 314 | 299 | */ |
| 315 | 300 | public String setLD(){ |
| 316 | 301 | String result = "failure"; |
| 317 | 302 | // 取昨天 的日期 |
| 318 | 303 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 304 | + StringBuffer sf = new StringBuffer(); | |
| 319 | 305 | try { |
| 320 | - StringBuffer sf = new StringBuffer(); | |
| 321 | 306 | sf.append("<DLDS>"); |
| 322 | 307 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); |
| 323 | 308 | List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date); |
| ... | ... | @@ -368,20 +353,19 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 368 | 353 | sf.append("</LD>"); |
| 369 | 354 | } |
| 370 | 355 | } |
| 371 | - | |
| 372 | 356 | sf.append("</LDList>"); |
| 373 | 357 | sf.append("</DLD>"); |
| 374 | 358 | } |
| 375 | 359 | } |
| 376 | - | |
| 377 | 360 | sf.append("</DLDS>"); |
| 378 | - logger.info("setLD:"+sf.toString()); | |
| 379 | 361 | if(ssop.setLD(userNameOther, passwordOther, sf.toString()).isSuccess()){ |
| 380 | 362 | result = "success"; |
| 381 | 363 | } |
| 382 | 364 | } catch (Exception e) { |
| 365 | + logger.error("setLD:",e); | |
| 383 | 366 | e.printStackTrace(); |
| 384 | 367 | }finally{ |
| 368 | + logger.info("setLD:"+sf.toString()); | |
| 385 | 369 | logger.info("setLD:"+result); |
| 386 | 370 | } |
| 387 | 371 | return result; |
| ... | ... | @@ -389,15 +373,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 389 | 373 | |
| 390 | 374 | /** |
| 391 | 375 | * 上传里程油耗 |
| 392 | - * @param date | |
| 393 | - * @return | |
| 376 | + * @return 上传成功标识 | |
| 394 | 377 | */ |
| 395 | 378 | public String setLCYH(){ |
| 396 | 379 | String result = "failure"; |
| 397 | 380 | // 取昨天 的日期 |
| 398 | 381 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 382 | + StringBuffer sf = new StringBuffer(); | |
| 399 | 383 | try { |
| 400 | - StringBuffer sf = new StringBuffer(); | |
| 401 | 384 | sf.append("<LCYHS>"); |
| 402 | 385 | List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); |
| 403 | 386 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); |
| ... | ... | @@ -451,13 +434,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 451 | 434 | } |
| 452 | 435 | } |
| 453 | 436 | sf.append("</LCYHS>"); |
| 454 | - logger.info("setLCYH:"+sf.toString()); | |
| 455 | 437 | if(ssop.setLCYH(userNameOther, passwordOther, sf.toString()).isSuccess()){ |
| 456 | 438 | result = "success"; |
| 457 | 439 | } |
| 458 | 440 | } catch (Exception e) { |
| 441 | + logger.error("setLCYH:",e); | |
| 459 | 442 | e.printStackTrace(); |
| 460 | 443 | }finally{ |
| 444 | + logger.info("setLCYH:"+sf.toString()); | |
| 461 | 445 | logger.info("setLCYH:"+result); |
| 462 | 446 | } |
| 463 | 447 | return result; |
| ... | ... | @@ -471,8 +455,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 471 | 455 | String result = "failure"; |
| 472 | 456 | // 取昨天 的日期 |
| 473 | 457 | String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); |
| 458 | + StringBuffer sf = new StringBuffer(); | |
| 474 | 459 | try { |
| 475 | - StringBuffer sf = new StringBuffer(); | |
| 476 | 460 | sf.append("<DDRBS>"); |
| 477 | 461 | List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); |
| 478 | 462 | List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); |
| ... | ... | @@ -554,13 +538,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 554 | 538 | } |
| 555 | 539 | } |
| 556 | 540 | sf.append("</DDRBS>"); |
| 557 | - logger.info("setDDRB:"+sf.toString()); | |
| 558 | 541 | if(ssop.setDDRB(userNameOther, passwordOther, sf.toString()).isSuccess()){ |
| 559 | 542 | result = "success"; |
| 560 | 543 | } |
| 561 | 544 | } catch (Exception e) { |
| 545 | + logger.error("setDDRB:",e); | |
| 562 | 546 | e.printStackTrace(); |
| 563 | 547 | }finally{ |
| 548 | + logger.info("setDDRB:"+sf.toString()); | |
| 564 | 549 | logger.info("setDDRB:"+result); |
| 565 | 550 | } |
| 566 | 551 | return result; |
| ... | ... | @@ -572,8 +557,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 572 | 557 | @Override |
| 573 | 558 | public String setJHBC() { |
| 574 | 559 | String result = "failure"; |
| 560 | + StringBuffer sBuffer =new StringBuffer(); | |
| 575 | 561 | try { |
| 576 | - StringBuffer sBuffer =new StringBuffer(); | |
| 577 | 562 | sBuffer.append("<JHBCs>"); |
| 578 | 563 | // 声明变量 |
| 579 | 564 | SchedulePlanInfo schedulePlanInfo = null; |
| ... | ... | @@ -633,13 +618,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 633 | 618 | } |
| 634 | 619 | } |
| 635 | 620 | sBuffer.append("</JHBCs>"); |
| 636 | - logger.info("setJHBC:"+sBuffer.toString()); | |
| 637 | 621 | if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 638 | 622 | result = "success"; |
| 639 | 623 | } |
| 640 | 624 | } catch (Exception e) { |
| 625 | + logger.error("setJHBC:",e); | |
| 641 | 626 | e.printStackTrace(); |
| 642 | 627 | }finally{ |
| 628 | + logger.info("setJHBC:"+sBuffer.toString()); | |
| 643 | 629 | logger.info("setJHBC:"+result); |
| 644 | 630 | } |
| 645 | 631 | return result; |
| ... | ... | @@ -651,14 +637,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 651 | 637 | @Override |
| 652 | 638 | public String setSKB(String ids) { |
| 653 | 639 | String result = "failure"; |
| 640 | + StringBuffer sBuffer = new StringBuffer(); | |
| 654 | 641 | try { |
| 655 | 642 | String[] idArray = ids.split(","); |
| 656 | - StringBuffer sBuffer = new StringBuffer(); | |
| 643 | + StringBuffer sBufferA; | |
| 644 | + StringBuffer sBufferB; | |
| 657 | 645 | TTInfo ttInfo; |
| 658 | - TTInfoDetail ttInfoDetail; | |
| 646 | + TTInfoDetail ttInfoDetail = null; | |
| 659 | 647 | Iterator<TTInfoDetail> ttInfoDetailIterator; |
| 660 | 648 | HashMap<String,Object> param = new HashMap<String, Object>(); |
| 661 | - String ttinfoJhlc = null;//计划总里程 | |
| 662 | 649 | String lineCode ; |
| 663 | 650 | sBuffer.append("<SKBs>"); |
| 664 | 651 | for (int i = 0; i < idArray.length; i++) { |
| ... | ... | @@ -668,57 +655,61 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 668 | 655 | param.put("ttinfo.id_eq", ttInfo.getId()); |
| 669 | 656 | ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param), |
| 670 | 657 | new Sort(Direction.ASC, "xlDir")).iterator(); |
| 671 | - sBuffer.append("<SKB>"); | |
| 672 | - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl().getId())) | |
| 673 | - .append("</XLBM>"); | |
| 674 | - ttinfoJhlc = new String(); | |
| 675 | - sBuffer.append("<JHZLC>").append(ttinfoJhlc).append("</JHZLC>"); | |
| 676 | - sBuffer.append("<JHYYLC>").append(ttinfoJhlc).append("</JHYYLC>"); | |
| 677 | - sBuffer.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>"); | |
| 678 | - sBuffer.append("<JSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</JSRQ>");///////// | |
| 679 | - sBuffer.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>"); | |
| 680 | - sBuffer.append("<TBYY>").append("").append("</TBYY>"); | |
| 681 | - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | |
| 682 | - int num = 1; | |
| 683 | - // 加上<BCList> | |
| 684 | 658 | if(ttInfoDetailIterator.hasNext()){ |
| 685 | - sBuffer.append("<BCList>"); | |
| 686 | - } | |
| 687 | - while (ttInfoDetailIterator.hasNext()) { | |
| 688 | - ttInfoDetail = ttInfoDetailIterator.next(); | |
| 689 | - if(ttInfoDetail.getBcType().equals("in") || ttInfoDetail.getBcType().equals("out")){ | |
| 690 | - continue; | |
| 659 | + sBuffer.append("<SKB>"); | |
| 660 | + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl().getId())) | |
| 661 | + .append("</XLBM>"); | |
| 662 | + sBufferB = new StringBuffer(); | |
| 663 | + sBufferB.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>"); | |
| 664 | + // 结束日期暂时不要,节假日的班次表才需要,如春节的班次表 | |
| 665 | + sBufferB.append("<JSRQ>").append("").append("</JSRQ>"); | |
| 666 | + sBufferB.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>"); | |
| 667 | + sBufferB.append("<TBYY>").append("").append("</TBYY>"); | |
| 668 | + sBufferB.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); | |
| 669 | + sBufferB.append("<BCList>"); | |
| 670 | + int num = 1; | |
| 671 | + while (ttInfoDetailIterator.hasNext()) { | |
| 672 | + ttInfoDetail = ttInfoDetailIterator.next(); | |
| 673 | + if(ttInfoDetail.getBcType().equals("in") || ttInfoDetail.getBcType().equals("out")){ | |
| 674 | + continue; | |
| 675 | + } | |
| 676 | + if(num++ == 1){ | |
| 677 | + sBufferA = new StringBuffer(); | |
| 678 | + sBufferA.append("<JHZLC>").append(ttInfoDetail.getJhlc()).append("</JHZLC>"); | |
| 679 | + sBufferA.append("<JHYYLC>").append(ttInfoDetail.getJhlc()).append("</JHYYLC>"); | |
| 680 | + sBuffer.append(sBufferA).append(sBufferB); | |
| 681 | + } | |
| 682 | + lineCode = ttInfoDetail.getXl().getLineCode(); | |
| 683 | + // 如果发车时间格式错误,忽略此条 | |
| 684 | + if(changeTimeFormat(ttInfoDetail) == null){ | |
| 685 | + continue; | |
| 686 | + } | |
| 687 | + sBuffer.append("<BC>"); | |
| 688 | + sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>"); | |
| 689 | + sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>"); | |
| 690 | + sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>"); | |
| 691 | + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 692 | + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>"); | |
| 693 | + sBuffer.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>"); | |
| 694 | + sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>"); | |
| 695 | + sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 696 | + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</DDXH>"); | |
| 697 | + sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); | |
| 698 | + sBuffer.append("</BC>"); | |
| 691 | 699 | } |
| 692 | - ttinfoJhlc = ttInfoDetail.getJhlc()+"";// 设置计划总里程 | |
| 693 | - lineCode = ttInfoDetail.getXl().getLineCode(); | |
| 694 | - sBuffer.append("<BC>"); | |
| 695 | - sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>"); | |
| 696 | - sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>"); | |
| 697 | - sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>"); | |
| 698 | - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 699 | - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>"); | |
| 700 | - sBuffer.append("<JHFCSJ>").append(ttInfoDetail.getFcsj()).append("</JHFCSJ>"); | |
| 701 | - sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>"); | |
| 702 | - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 703 | - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</ZDXH>"); | |
| 704 | - sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); | |
| 705 | - sBuffer.append("</BC>"); | |
| 706 | - | |
| 707 | - num++; | |
| 708 | - } | |
| 709 | - if(sBuffer.indexOf("<BCList>") != -1){ | |
| 710 | 700 | sBuffer.append("</BCList>"); |
| 701 | + sBuffer.append("</SKB>"); | |
| 711 | 702 | } |
| 712 | - sBuffer.append("</SKB>"); | |
| 713 | 703 | } |
| 714 | 704 | sBuffer.append("</SKBs>"); |
| 715 | - logger.info("setSKB:"+sBuffer.toString()); | |
| 716 | 705 | if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 717 | 706 | result = "success"; |
| 718 | 707 | } |
| 719 | 708 | } catch (Exception e) { |
| 709 | + logger.error("setSKB:", e); | |
| 720 | 710 | e.printStackTrace(); |
| 721 | 711 | }finally{ |
| 712 | + logger.info("setSKB:"+sBuffer.toString()); | |
| 722 | 713 | logger.info("setSKB:"+result); |
| 723 | 714 | } |
| 724 | 715 | return result; |
| ... | ... | @@ -730,8 +721,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 730 | 721 | @Override |
| 731 | 722 | public String setXLPC() { |
| 732 | 723 | String result = "failure"; |
| 724 | + StringBuffer sBuffer =new StringBuffer(); | |
| 733 | 725 | try { |
| 734 | - StringBuffer sBuffer =new StringBuffer(); | |
| 735 | 726 | sBuffer.append("<XLPCs>"); |
| 736 | 727 | // 声明变量 |
| 737 | 728 | Line line = null; |
| ... | ... | @@ -773,13 +764,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 773 | 764 | sBuffer.append("</XLPC>"); |
| 774 | 765 | } |
| 775 | 766 | sBuffer.append("</XLPCs>"); |
| 776 | - logger.info("setXLPC:"+sBuffer.toString()); | |
| 777 | 767 | if(ssop.setXLPC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 778 | 768 | result = "success"; |
| 779 | 769 | } |
| 780 | 770 | } catch (Exception e) { |
| 771 | + logger.error("setXLPC:",e); | |
| 781 | 772 | e.printStackTrace(); |
| 782 | 773 | }finally{ |
| 774 | + logger.info("setXLPC:"+sBuffer.toString()); | |
| 783 | 775 | logger.info("setXLPC:"+result); |
| 784 | 776 | } |
| 785 | 777 | return result; |
| ... | ... | @@ -832,13 +824,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 832 | 824 | sBuffer.append("</CS>"); |
| 833 | 825 | } |
| 834 | 826 | sBuffer.append("</CSs>"); |
| 835 | - logger.info("setCS:"+sBuffer.toString()); | |
| 836 | 827 | if(ssop.setCS(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ |
| 837 | 828 | result = "success"; |
| 838 | 829 | } |
| 839 | 830 | } catch (Exception e) { |
| 831 | + logger.error("setCS:",e); | |
| 840 | 832 | e.printStackTrace(); |
| 841 | 833 | } finally { |
| 834 | + logger.info("setCS:"+sBuffer.toString()); | |
| 842 | 835 | logger.info("setCS:"+result); |
| 843 | 836 | DBUtils_MS.close(rs, ps, conn); |
| 844 | 837 | } |
| ... | ... | @@ -949,11 +942,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 949 | 942 | min = fullTime % 60; |
| 950 | 943 | sumHour = Integer.valueOf(fcsjArray[0])+hour; |
| 951 | 944 | if(sumHour >= 24){ |
| 952 | - result = sumHour - 24+":"; | |
| 945 | + result = String.format("%02d",sumHour - 24); | |
| 953 | 946 | }else{ |
| 954 | - result = sumHour +":"; | |
| 947 | + result = String.format("%02d",sumHour);; | |
| 955 | 948 | } |
| 956 | - result +=String.format("%02d", min); | |
| 949 | + result +=":"+String.format("%02d", min); | |
| 957 | 950 | }else{ |
| 958 | 951 | result = fcsj; |
| 959 | 952 | } |
| ... | ... | @@ -961,6 +954,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 961 | 954 | } |
| 962 | 955 | |
| 963 | 956 | /** |
| 957 | + * 改变时间格式 | |
| 958 | + * @param ttInfoDetail 时刻表详细 | |
| 959 | + * @return xx:yy | |
| 960 | + */ | |
| 961 | + private String changeTimeFormat(TTInfoDetail ttInfoDetail){ | |
| 962 | + String result = "00:00"; | |
| 963 | + String fcsj = ttInfoDetail.getFcsj(); | |
| 964 | + if(fcsj.indexOf(":") != -1){ | |
| 965 | + // 时和分隔开 | |
| 966 | + String[] fcsjArray = fcsj.split(":"); | |
| 967 | + result = String.format("%02d", Integer.valueOf(fcsjArray[0]))+":"; | |
| 968 | + result +=String.format("%02d", Integer.valueOf(fcsjArray[1])); | |
| 969 | + }else{ | |
| 970 | + result = null; | |
| 971 | + logger.info("setSKB:发车时间错误:ttInfoDetail.id="+ttInfoDetail.getId()); | |
| 972 | + } | |
| 973 | + return result; | |
| 974 | + } | |
| 975 | + | |
| 976 | + /** | |
| 964 | 977 | * 拼装线路计划班次表的XML |
| 965 | 978 | * @param sBuffer |
| 966 | 979 | * @param schedulePlanInfo |
| ... | ... | @@ -993,7 +1006,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 993 | 1006 | flag = 0; |
| 994 | 1007 | } |
| 995 | 1008 | result += flag; |
| 996 | - if(i !=ruleDayArray.length ){ | |
| 1009 | + if(i !=ruleDayArray.length -1){ | |
| 997 | 1010 | result +=","; |
| 998 | 1011 | } |
| 999 | 1012 | } |
| ... | ... | @@ -1017,15 +1030,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 1017 | 1030 | } |
| 1018 | 1031 | } |
| 1019 | 1032 | /** |
| 1020 | - * @param stations 站点路由集 | |
| 1033 | + * @param stationsList 站点路由集 | |
| 1021 | 1034 | * @param sBuffer sBuffer |
| 1022 | - * @param StartId 站点序号起始ID | |
| 1035 | + * @param startId 站点序号起始ID | |
| 1023 | 1036 | * |
| 1024 | 1037 | * @return 站点序号累加后的ID |
| 1025 | 1038 | */ |
| 1026 | 1039 | private int packagStationXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId){ |
| 1027 | 1040 | int size = stationsList.size(); |
| 1028 | - StationRoute srRoute = null; | |
| 1041 | + StationRoute srRoute; | |
| 1029 | 1042 | String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站 |
| 1030 | 1043 | for (int i = 0; i < size; i++) { |
| 1031 | 1044 | srRoute = stationsList.get(i); |
| ... | ... | @@ -1062,9 +1075,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 1062 | 1075 | */ |
| 1063 | 1076 | private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationName){ |
| 1064 | 1077 | Integer number = 0; |
| 1065 | - Map<String, Map> dirs2Statioin = BasicData.stationName2YgcNumber.get(lineCode); | |
| 1066 | - Map<String, Integer> station2Number = dirs2Statioin.get(direction); | |
| 1067 | - number = station2Number.get(stationName); | |
| 1078 | + number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationName); | |
| 1068 | 1079 | return number; |
| 1069 | 1080 | } |
| 1070 | 1081 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -1145,7 +1145,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1145 | 1145 | || scheduleRealInfo.getBcType().equals("venting")){ |
| 1146 | 1146 | ksgl += tempJhlc; |
| 1147 | 1147 | }else{ |
| 1148 | - yygl += tempJhlc; | |
| 1148 | + if(scheduleRealInfo.getStatus() != -1){ | |
| 1149 | + yygl += tempJhlc; | |
| 1150 | + } | |
| 1149 | 1151 | } |
| 1150 | 1152 | }else{ |
| 1151 | 1153 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| ... | ... | @@ -1154,7 +1156,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 1154 | 1156 | if(childTaskPlan.getMileageType().equals("empty")){ |
| 1155 | 1157 | ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); |
| 1156 | 1158 | }else{ |
| 1157 | - yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1159 | + if(childTaskPlan.isDestroy()){ | |
| 1160 | + remMileage += tempJhlc; | |
| 1161 | + cjbc++; | |
| 1162 | + }else{ | |
| 1163 | + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); | |
| 1164 | + } | |
| 1158 | 1165 | } |
| 1159 | 1166 | } |
| 1160 | 1167 | } | ... | ... |
src/main/java/com/bsth/service/report/ReportService.java
| ... | ... | @@ -18,4 +18,12 @@ public interface ReportService { |
| 18 | 18 | List<Map<String, String>> sreachZd(String line,int zdlx,String zd); |
| 19 | 19 | |
| 20 | 20 | List<Object[]> historyMessageCount(String line, String date, String code); |
| 21 | + | |
| 22 | + Map<String, Object> tbodyTime1(String line ,String date); | |
| 23 | + | |
| 24 | + Map<String, Object> tbodyTime2(String line ,String date); | |
| 25 | + | |
| 26 | + List<Map<String, Object>> tbodyTime3(String line ,String date); | |
| 27 | + List<Map<String, Object>> tbodyTime5(String line ,String date); | |
| 28 | + | |
| 21 | 29 | } | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -3,6 +3,7 @@ import java.sql.Connection; |
| 3 | 3 | import java.sql.PreparedStatement; |
| 4 | 4 | import java.sql.ResultSet; |
| 5 | 5 | import java.sql.SQLException; |
| 6 | +import java.text.DecimalFormat; | |
| 6 | 7 | import java.text.ParseException; |
| 7 | 8 | import java.text.SimpleDateFormat; |
| 8 | 9 | import java.util.ArrayList; |
| ... | ... | @@ -16,12 +17,15 @@ import org.slf4j.Logger; |
| 16 | 17 | import org.slf4j.LoggerFactory; |
| 17 | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | 19 | import org.springframework.jdbc.core.JdbcTemplate; |
| 20 | +import org.springframework.jdbc.core.RowMapper; | |
| 19 | 21 | import org.springframework.stereotype.Service; |
| 20 | 22 | |
| 21 | 23 | import com.bsth.data.BasicData; |
| 22 | 24 | import com.bsth.entity.StationRoute; |
| 23 | 25 | import com.bsth.entity.excep.ArrivalInfo; |
| 26 | +import com.bsth.entity.oil.Ylb; | |
| 24 | 27 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 28 | +import com.bsth.entity.schedule.SchedulePlanInfo; | |
| 25 | 29 | import com.bsth.repository.StationRouteRepository; |
| 26 | 30 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 27 | 31 | import com.bsth.service.report.ReportService; |
| ... | ... | @@ -252,5 +256,515 @@ public class ReportServiceImpl implements ReportService{ |
| 252 | 256 | List<Object[]> list = scheduleRealInfoRepository.historyMessageCount(line, date, code); |
| 253 | 257 | return list; |
| 254 | 258 | } |
| 259 | + @Override | |
| 260 | + public Map<String, Object> tbodyTime1(String line, String date) { | |
| 261 | + DecimalFormat df = new DecimalFormat("#0.00"); | |
| 262 | + // TODO Auto-generated method stub | |
| 263 | + //查询配车 | |
| 264 | + String sqlPc=" SELECT cl_zbh FROM bsth_c_s_sp_info " | |
| 265 | + +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' " | |
| 266 | + + " and xl_bm='"+line+"' and bc_type='normal' " | |
| 267 | + + " group by cl_zbh "; | |
| 268 | + Map<String, Object> map=new HashMap<String,Object>(); | |
| 269 | + List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc, | |
| 270 | + new RowMapper<Map<String, Object>>(){ | |
| 271 | + @Override | |
| 272 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 273 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 274 | + m.put("zbh", rs.getString("cl_zbh")); | |
| 275 | + return m; | |
| 276 | + } | |
| 277 | + }); | |
| 278 | + //配车 | |
| 279 | + int pcs=listPc.size(); | |
| 280 | + | |
| 281 | + | |
| 282 | + String sqlPlan="select jhlc, bc_type ,fcsj from bsth_c_s_sp_info " | |
| 283 | + + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"; | |
| 284 | + | |
| 285 | + //班次 | |
| 286 | + int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60; | |
| 287 | + int qcBc=0,qjBc=0,zqcBc=0,zqjBc=0,wqcBc=0,wqjBc=0; | |
| 288 | + double zlc = 0 , yylc = 0,kslc=0; | |
| 289 | + //查询班次 | |
| 290 | + List<Map<String, Object>> listPlan= jdbcTemplate.query(sqlPlan, | |
| 291 | + new RowMapper<Map<String, Object>>(){ | |
| 292 | + @Override | |
| 293 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 294 | + Map<String, Object> m2=new HashMap<String,Object>(); | |
| 295 | + m2.put("jhlc", rs.getDouble("jhlc")); | |
| 296 | + m2.put("bcType", rs.getString("bc_type")); | |
| 297 | + m2.put("fcsj", rs.getString("fcsj")); | |
| 298 | + return m2; | |
| 299 | + } | |
| 300 | + }); | |
| 301 | + | |
| 302 | + for (int i = 0; i < listPlan.size(); i++) { | |
| 303 | + Map<String, Object> m=listPlan.get(i); | |
| 304 | + double jhlc=Double.parseDouble(m.get("jhlc").toString()); | |
| 305 | + String bcType=m.get("bcType").toString(); | |
| 306 | + String fcsjs[]=m.get("fcsj").toString().split(":"); | |
| 307 | + | |
| 308 | + zlc +=jhlc; | |
| 309 | + if(bcType.equals("normal")){ | |
| 310 | + qcBc ++; | |
| 311 | + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0 | |
| 312 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){ | |
| 313 | + zqcBc++; | |
| 314 | + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0 | |
| 315 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){ | |
| 316 | + wqcBc++; | |
| 317 | + } | |
| 318 | + yylc +=jhlc; | |
| 319 | + }else if(bcType.equals("region")){ | |
| 320 | + qjBc++; | |
| 321 | + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0 | |
| 322 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){ | |
| 323 | + zqjBc++; | |
| 324 | + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0 | |
| 325 | + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){ | |
| 326 | + wqjBc++; | |
| 327 | + } | |
| 328 | + | |
| 329 | + yylc+=jhlc; | |
| 330 | + }else{ | |
| 331 | + kslc+=jhlc; | |
| 332 | + } | |
| 333 | + } | |
| 334 | + | |
| 335 | + map.put("pcs", pcs); | |
| 336 | + map.put("qcbc", qcBc); | |
| 337 | + map.put("qjbc", qjBc); | |
| 338 | + map.put("zqcbc", zqcBc); | |
| 339 | + map.put("zqjbc", zqjBc); | |
| 340 | + map.put("wqcbc", wqcBc); | |
| 341 | + map.put("wqjbc", wqjBc); | |
| 342 | + map.put("zlc", df.format( zlc)); | |
| 343 | + map.put("yylc", df.format(yylc)); | |
| 344 | + map.put("kslc",df.format( kslc)); | |
| 345 | + //查询里程 | |
| 346 | + return map; | |
| 347 | + } | |
| 348 | + @Override | |
| 349 | + public Map<String, Object> tbodyTime2(String line, String date) { | |
| 350 | + DecimalFormat df = new DecimalFormat("#0.00"); | |
| 351 | + // TODO Auto-generated method stub | |
| 352 | + //查询配车 | |
| 353 | + String sqlPc=" SELECT sum(bcsj) as yysj ,sum(jhlc) as yygl FROM bsth_c_s_sp_info " | |
| 354 | + +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' " | |
| 355 | + + " and xl_bm='"+line+"' and bc_type in ('normal' ,'region' )"; | |
| 356 | + Map<String, Object> map=new HashMap<String,Object>(); | |
| 357 | + List<Map<String, Object>> list= jdbcTemplate.query(sqlPc, | |
| 358 | + new RowMapper<Map<String, Object>>(){ | |
| 359 | + @Override | |
| 360 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 361 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 362 | + m.put("yysj", rs.getInt("yysj")); | |
| 363 | + m.put("yygl", rs.getString("yygl")==null?"0":rs.getString("yygl")); | |
| 364 | + return m; | |
| 365 | + } | |
| 366 | + }); | |
| 367 | + int yysj=0 ; | |
| 368 | + double yycs=0 ,yygl=0; | |
| 369 | + if(list.size()>0){ | |
| 370 | + Map<String, Object> m=list.get(0); | |
| 371 | + yysj=Integer.parseInt((m.get("yysj").toString())); | |
| 372 | + yygl=Double.parseDouble(m.get("yygl").toString()); | |
| 373 | + } | |
| 374 | + if(yysj>0){ | |
| 375 | + yycs =yygl/(yysj*1.0/60); | |
| 376 | + } | |
| 377 | + int hh=yysj/60; | |
| 378 | + int mm=yysj%60; | |
| 379 | + | |
| 380 | + map.put("yysj", hh+":"+mm); | |
| 381 | + map.put("yycs", df.format(yycs)+"公里/小时"); | |
| 382 | +// map.put(key, value) | |
| 383 | + return map; | |
| 384 | + } | |
| 255 | 385 | |
| 386 | + public static void main(String[] args) { | |
| 387 | + System.out.println(609360/60); | |
| 388 | + System.out.println(609360%60); | |
| 389 | + } | |
| 390 | + @Override | |
| 391 | + public List<Map<String, Object>> tbodyTime3(String line, String date) { | |
| 392 | + // TODO Auto-generated method stub | |
| 393 | + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); | |
| 394 | + String sqlZd=" select qdz_name, count(cl_zbh) as cls , 'zqc' as lx from bsth_c_s_sp_info where " | |
| 395 | + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' and bc_type='normal' " | |
| 396 | + + " and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union " | |
| 397 | + + " select qdz_name, count(cl_zbh) as cls , 'wqc' as lx from bsth_c_s_sp_info " | |
| 398 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | |
| 399 | + + " and bc_type='normal' and fcsj>'16:01' and fcsj<'18:00' group by qdz_name union " | |
| 400 | + + " select qdz_name, count(cl_zbh) as cls , 'zqj' as lx from bsth_c_s_sp_info " | |
| 401 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | |
| 402 | + + " and bc_type='region' and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union " | |
| 403 | + + " select qdz_name, count(cl_zbh) as cls , 'wqj' as lx from bsth_c_s_sp_info " | |
| 404 | + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' " | |
| 405 | + + " and bc_type='region' and fcsj>'16:01' and fcsj<'18:00'group by qdz_name"; | |
| 406 | + | |
| 407 | + List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd, | |
| 408 | + new RowMapper<Map<String, Object>>(){ | |
| 409 | + @Override | |
| 410 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 411 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 412 | + m.put("zdm", rs.getString("qdz_name")); | |
| 413 | + m.put("cls", rs.getString("cls")); | |
| 414 | + m.put("lx", rs.getString("lx")); | |
| 415 | + return m; | |
| 416 | + } | |
| 417 | + }); | |
| 418 | + int a=0; | |
| 419 | + int b=0; | |
| 420 | + int c=0; | |
| 421 | + int d=0; | |
| 422 | + for(int i=0;i<lists.size();i++){ | |
| 423 | + boolean fage=true; | |
| 424 | + Map<String, Object> newMap= new HashMap<String, Object>(); | |
| 425 | + list.add(newMap); | |
| 426 | + Map<String, Object> maps=lists.get(i); | |
| 427 | + if(maps.get("lx").equals("zqc")){ | |
| 428 | + list.get(a).put("zqcZm", maps.get("zdm")); | |
| 429 | + list.get(a).put("zqcCls", maps.get("cls")); | |
| 430 | + a++; | |
| 431 | + fage=false; | |
| 432 | + }else if(maps.get("lx").equals("wqc")){ | |
| 433 | + list.get(b).put("wqcZm", maps.get("zdm")); | |
| 434 | + list.get(b).put("wqcCls", maps.get("cls")); | |
| 435 | + b++; | |
| 436 | + fage=false; | |
| 437 | + }else if(maps.get("lx").equals("zqj")){ | |
| 438 | + list.get(c).put("zqjZm", maps.get("zdm")); | |
| 439 | + list.get(c).put("zqjCls", maps.get("cls")); | |
| 440 | + c++; | |
| 441 | + fage=false; | |
| 442 | + }else if(maps.get("lx").equals("wqj")){ | |
| 443 | + list.get(d).put("wqjZm", maps.get("zdm")); | |
| 444 | + list.get(d).put("wqjCls", maps.get("cls")); | |
| 445 | + d++; | |
| 446 | + fage=false; | |
| 447 | + } | |
| 448 | + if(fage){ | |
| 449 | + break; | |
| 450 | + } | |
| 451 | + } | |
| 452 | + boolean status=true; | |
| 453 | + while (status) { | |
| 454 | + for (int i = 0; i < list.size(); i++) { | |
| 455 | + if(list.get(i).isEmpty()){ | |
| 456 | + list.remove(i); | |
| 457 | + status=true; | |
| 458 | + }else{ | |
| 459 | + status=false; | |
| 460 | + } | |
| 461 | + } | |
| 462 | + | |
| 463 | + } | |
| 464 | + return list; | |
| 465 | + } | |
| 466 | + @Override | |
| 467 | + public List<Map<String, Object>> tbodyTime5(String line, String date) { | |
| 468 | + // TODO Auto-generated method stub | |
| 469 | + String sql="select min(fcsj) as fcsj,'lx0' as lx from bsth_c_s_sp_info where " | |
| 470 | + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | |
| 471 | + + " and bc_type='out' and xl_dir=0 union " | |
| 472 | + + " select min(fcsj) as fcsj,'lx1' as lx from bsth_c_s_sp_info where " | |
| 473 | + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | |
| 474 | + + " and bc_type='out' and xl_dir=1"; | |
| 475 | + List<Map<String, Object>> lists= jdbcTemplate.query(sql, | |
| 476 | + new RowMapper<Map<String, Object>>(){ | |
| 477 | + @Override | |
| 478 | + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 479 | + Map<String, Object> m=new HashMap<String,Object>(); | |
| 480 | + m.put("lx", rs.getString("lx")); | |
| 481 | + m.put("fcsj", rs.getString("fcsj")); | |
| 482 | + return m; | |
| 483 | + } | |
| 484 | + }); | |
| 485 | + | |
| 486 | + String sqlList="select * from bsth_c_s_sp_info where " | |
| 487 | + + "DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'" | |
| 488 | + + " and bc_type='normal' order by fcsj"; | |
| 489 | + List<SchedulePlanInfo> list= jdbcTemplate.query(sqlList, | |
| 490 | + new RowMapper<SchedulePlanInfo>(){ | |
| 491 | + @Override | |
| 492 | + public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | |
| 493 | + SchedulePlanInfo m=new SchedulePlanInfo(); | |
| 494 | + m.setBcsj(rs.getInt("bcsj")); | |
| 495 | + m.setXlDir(rs.getString("xl_dir")); | |
| 496 | + m.setFcsj(rs.getString("fcsj")); | |
| 497 | + return m; | |
| 498 | + } | |
| 499 | + }); | |
| 500 | + //上下行最早发车时间 (用于与夜班线 跨零点的班次进行比较) | |
| 501 | + String lx0=""; | |
| 502 | + String lx1=""; | |
| 503 | + for (int x = 0; x < lists.size(); x++) { | |
| 504 | + if(lists.get(x).get("lx").equals("lx0")){ | |
| 505 | + lx0=lists.get(x).get("fcsj").toString(); | |
| 506 | + }else{ | |
| 507 | + lx1=lists.get(x).get("fcsj").toString(); | |
| 508 | + } | |
| 509 | + } | |
| 510 | + | |
| 511 | + String[] lx0sj = lx0.split(":"); | |
| 512 | + int sxFc=Integer.parseInt(lx0sj[0])*60+Integer.parseInt(lx0sj[1]); | |
| 513 | + String[] lx1sj = lx1.split(":"); | |
| 514 | + int xxFc=Integer.parseInt(lx1sj[0])*60+Integer.parseInt(lx1sj[1]); | |
| 515 | + //班次 | |
| 516 | + int sj_0 = 6*60+31,sj_1 = 8*60+30,sj_2 = 16*60+1,sj_3 = 18*60; | |
| 517 | + | |
| 518 | + //顺序 出场--早高峰---中午---晚高峰---进场 | |
| 519 | + //实驶时间时间(分),0为上行,1为下行 | |
| 520 | + int ccsj0=0,ccsj1=0,zgf0=0,zgf1=0,zw0=0,zw1=0,wgf0=0,wgf1=0,jcsj0=0,jcsj1=0; | |
| 521 | + | |
| 522 | + //记录上一个发车时间(方便记录间距) | |
| 523 | + int cfc0=0,cfc1=0,zfc0=0,zfc1=0,zwfc0=0,zwfc1=0,wfc0=0,wfc1=0,jcfc0Z=0,jcfc1Z=0,jcfc0W=0,jcfc1W=0; | |
| 524 | + //车距 (发车时间的间距) i--MIN a--MAX | |
| 525 | + int iC=999,aC=-1,iZg=999,aZg=-1,iZw=999,aZw=-1,iWg=999,aWg=-1,iJcZ=999,aJcZ=-1,iJcW=999,aJcW=-1; | |
| 526 | + int iC1=999,aC1=-1,iZg1=999,aZg1=-1,iZw1=999,aZw1=-1,iWg1=999,aWg1=-1,iJc1Z=999,aJc1Z=-1,iJc1W=999,aJc1W=-1; | |
| 527 | +// List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); | |
| 528 | + for(int i=0;i<list.size();i++){ | |
| 529 | + SchedulePlanInfo t=list.get(i); | |
| 530 | + String xlDir=t.getXlDir(); | |
| 531 | + int bcsj=t.getBcsj(); | |
| 532 | + String fcsj=t.getFcsj(); | |
| 533 | + String[] fcsjs=fcsj.split(":"); | |
| 534 | + int fcsjNum=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]); | |
| 535 | + | |
| 536 | + if(xlDir.equals("0")){ | |
| 537 | + if(fcsjNum>=sxFc && fcsjNum<sj_0){ | |
| 538 | + ccsj0 +=bcsj; | |
| 539 | + if(aC<0){ | |
| 540 | + cfc0 =fcsjNum; | |
| 541 | + aC=0; | |
| 542 | + }else{ | |
| 543 | + if(fcsjNum-cfc0<iC){ | |
| 544 | + iC=fcsjNum-cfc0; | |
| 545 | + } | |
| 546 | + if(fcsjNum-cfc0>aC){ | |
| 547 | + aC=fcsjNum-cfc0; | |
| 548 | + } | |
| 549 | + | |
| 550 | + cfc0=fcsjNum; | |
| 551 | + } | |
| 552 | + | |
| 553 | + }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){ | |
| 554 | + zgf0 +=bcsj; | |
| 555 | + if(aZg<0){ | |
| 556 | + zfc0 =fcsjNum; | |
| 557 | + aZg=0; | |
| 558 | + }else{ | |
| 559 | + if(fcsjNum-zfc0<iZg){ | |
| 560 | + iZg=fcsjNum-zfc0; | |
| 561 | + } | |
| 562 | + | |
| 563 | + if(fcsjNum-zfc0>aZg){ | |
| 564 | + aZg=fcsjNum-zfc0; | |
| 565 | + } | |
| 566 | + | |
| 567 | + zfc0=fcsjNum; | |
| 568 | + } | |
| 569 | + }else if(fcsjNum>sj_1 && fcsjNum<sj_2){ | |
| 570 | + zw0 +=bcsj; | |
| 571 | + if(aZw<0){ | |
| 572 | + zwfc0 =fcsjNum; | |
| 573 | + aZw=0; | |
| 574 | + }else{ | |
| 575 | + if(fcsjNum-zwfc0<iZw){ | |
| 576 | + iZw=fcsjNum-zwfc0; | |
| 577 | + } | |
| 578 | + if(fcsjNum-zwfc0>aZw){ | |
| 579 | + aZw=fcsjNum-zwfc0; | |
| 580 | + } | |
| 581 | + zwfc0=fcsjNum; | |
| 582 | + } | |
| 583 | + | |
| 584 | + }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){ | |
| 585 | + wgf0 +=bcsj; | |
| 586 | + if(aWg<0){ | |
| 587 | + wfc0=fcsjNum; | |
| 588 | + aWg=0; | |
| 589 | + }else{ | |
| 590 | + if(fcsjNum-wfc0<iWg){ | |
| 591 | + iWg=fcsjNum-wfc0; | |
| 592 | + } | |
| 593 | + if(fcsjNum-wfc0>aWg){ | |
| 594 | + aWg=fcsjNum-wfc0; | |
| 595 | + } | |
| 596 | + wfc0=fcsjNum; | |
| 597 | + } | |
| 598 | + }else if(fcsjNum>sj_3){ | |
| 599 | + jcsj0 +=bcsj; | |
| 600 | + if(aJcW<0){ | |
| 601 | + jcfc0W=fcsjNum; | |
| 602 | + aJcW=0; | |
| 603 | + }else{ | |
| 604 | + if(fcsjNum-jcfc0W<iJcW){ | |
| 605 | + iJcW=fcsjNum-jcfc0W; | |
| 606 | + } | |
| 607 | + if(fcsjNum-jcfc0W>aJcW){ | |
| 608 | + aJcW=fcsjNum-jcfc0W; | |
| 609 | + } | |
| 610 | + jcfc0W=fcsjNum; | |
| 611 | + } | |
| 612 | + }else if(fcsjNum<sxFc){ | |
| 613 | + jcsj0 +=bcsj; | |
| 614 | + if(aJcZ<0){ | |
| 615 | + jcfc0Z=fcsjNum; | |
| 616 | + aJcZ=0; | |
| 617 | + }else{ | |
| 618 | + if(fcsjNum-jcfc0Z<iJcZ){ | |
| 619 | + iJcZ=fcsjNum-jcfc0Z; | |
| 620 | + } | |
| 621 | + if(fcsjNum-jcfc0Z>aJcZ){ | |
| 622 | + aJcZ=fcsjNum-jcfc0Z; | |
| 623 | + } | |
| 624 | + jcfc0Z=fcsjNum; | |
| 625 | + } | |
| 626 | + } | |
| 627 | + | |
| 628 | + | |
| 629 | + }else{ | |
| 630 | + if(fcsjNum>=xxFc && fcsjNum<sj_0){ | |
| 631 | + ccsj1 +=bcsj; | |
| 632 | + if(aC1<0){ | |
| 633 | + cfc1=fcsjNum; | |
| 634 | + aC1=0; | |
| 635 | + }else{ | |
| 636 | + if(fcsjNum-cfc1<iC1){ | |
| 637 | + iC1=fcsjNum-cfc1; | |
| 638 | + } | |
| 639 | + if(fcsjNum-cfc1>aC1){ | |
| 640 | + aC1=fcsjNum-cfc1; | |
| 641 | + } | |
| 642 | + cfc1=fcsjNum; | |
| 643 | + } | |
| 644 | + }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){ | |
| 645 | + zgf1 +=bcsj; | |
| 646 | + if(aZg1<0){ | |
| 647 | + zfc1=fcsjNum; | |
| 648 | + aZg1=0; | |
| 649 | + }else{ | |
| 650 | + if(fcsjNum-zfc1<iZg1){ | |
| 651 | + iZg1=fcsjNum-zfc1; | |
| 652 | + } | |
| 653 | + if(fcsjNum-zfc1>aZg1){ | |
| 654 | + aZg1=fcsjNum-zfc1; | |
| 655 | + } | |
| 656 | + | |
| 657 | + zfc1=fcsjNum; | |
| 658 | + } | |
| 659 | + }else if(fcsjNum>sj_1 && fcsjNum<sj_2){ | |
| 660 | + zw1 +=bcsj; | |
| 661 | + if(aZw1<0){ | |
| 662 | + zwfc1=fcsjNum; | |
| 663 | + aZw1=0; | |
| 664 | + }else{ | |
| 665 | + if(fcsjNum-zwfc1<iZw1){ | |
| 666 | + iZw1=fcsjNum-zwfc1; | |
| 667 | + } | |
| 668 | + if(fcsjNum-zwfc1>aZw1){ | |
| 669 | + aZw1=fcsjNum-zwfc1; | |
| 670 | + } | |
| 671 | + zwfc1=fcsjNum; | |
| 672 | + } | |
| 673 | + }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){ | |
| 674 | + wgf1 +=bcsj; | |
| 675 | + if(aWg1<0){ | |
| 676 | + wfc1=fcsjNum; | |
| 677 | + aWg1=0; | |
| 678 | + }else{ | |
| 679 | + if(fcsjNum-wfc1<iWg1){ | |
| 680 | + iWg1=fcsjNum-wfc1; | |
| 681 | + } | |
| 682 | + if(fcsjNum-wfc1<aWg1){ | |
| 683 | + aWg1=fcsjNum-wfc1; | |
| 684 | + } | |
| 685 | + wfc1=fcsjNum; | |
| 686 | + } | |
| 687 | + }else if(fcsjNum>sj_3){ | |
| 688 | + jcsj1 +=bcsj; | |
| 689 | + if(aJc1W<0){ | |
| 690 | + jcfc1W=fcsjNum; | |
| 691 | + aJc1W=0; | |
| 692 | + }else{ | |
| 693 | + if(fcsjNum-jcfc1W<iJc1W){ | |
| 694 | + aJc1W=fcsjNum-jcfc1W; | |
| 695 | + } | |
| 696 | + if(fcsjNum-jcfc1W>aJc1W){ | |
| 697 | + aJc1W=fcsjNum-jcfc1W; | |
| 698 | + } | |
| 699 | + | |
| 700 | + jcfc1W=fcsjNum; | |
| 701 | + } | |
| 702 | + }else if(fcsjNum<xxFc){ | |
| 703 | + jcsj1 +=bcsj; | |
| 704 | + if(aJc1Z<0){ | |
| 705 | + jcfc1Z=fcsjNum; | |
| 706 | + aJc1Z=0; | |
| 707 | + }else{ | |
| 708 | + if(fcsjNum-jcfc1Z<iJc1Z){ | |
| 709 | + aJc1Z=fcsjNum-jcfc1Z; | |
| 710 | + } | |
| 711 | + if(fcsjNum-jcfc1Z>aJc1Z){ | |
| 712 | + aJc1Z=fcsjNum-jcfc1Z; | |
| 713 | + } | |
| 714 | + | |
| 715 | + jcfc1Z=fcsjNum; | |
| 716 | + } | |
| 717 | + } | |
| 718 | + } | |
| 719 | + | |
| 720 | + } | |
| 721 | + | |
| 722 | + | |
| 723 | + List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>(); | |
| 724 | + Map<String, Object> newmap1=new HashMap<String,Object>(); | |
| 725 | + Map<String, Object> newmap2=new HashMap<String,Object>(); | |
| 726 | + Map<String, Object> newmap3=new HashMap<String,Object>(); | |
| 727 | + Map<String, Object> newmap4=new HashMap<String,Object>(); | |
| 728 | + Map<String, Object> newmap5=new HashMap<String,Object>(); | |
| 729 | + newmap1.put("sjd", "(首)——6:30"); | |
| 730 | + newmap1.put("sxsj", ccsj0); | |
| 731 | + newmap1.put("xxsj", ccsj1); | |
| 732 | + newmap1.put("fqsj", ccsj0+ccsj1); | |
| 733 | + newmap1.put("cj", (iC-iC1>0?iC1:iC)+"——"+(aC-aC1>0?aC:aC1)); | |
| 734 | + | |
| 735 | + newmap2.put("sjd", "6:31——8:30"); | |
| 736 | + newmap2.put("sxsj", zgf0); | |
| 737 | + newmap2.put("xxsj", zgf1); | |
| 738 | + newmap2.put("fqsj", zgf1+zgf0); | |
| 739 | + newmap2.put("cj", (iZg-iZg1>0?iZg1:iZg)+"——"+(aZg-aZg1>0?aZg:aZg1)); | |
| 740 | + | |
| 741 | + newmap3.put("sjd", "8:30——16:00"); | |
| 742 | + newmap3.put("sxsj", zw0); | |
| 743 | + newmap3.put("xxsj", zw1); | |
| 744 | + newmap3.put("fqsj", zw0+zw1); | |
| 745 | + newmap3.put("cj", (iZw-iZw1>0?iZw1:iZw)+"——"+(aZw-aZw1>0?aZw:aZw1)); | |
| 746 | + | |
| 747 | + newmap4.put("sjd", "16:01——18:00"); | |
| 748 | + newmap4.put("sxsj", wgf0); | |
| 749 | + newmap4.put("xxsj", wgf1); | |
| 750 | + newmap4.put("fqsj", wgf0+wgf1); | |
| 751 | + newmap4.put("cj", (iWg-iWg1>0?iWg1:iWg)+"——"+(aWg-aWg1>0?aWg:aWg1)); | |
| 752 | + | |
| 753 | + newmap5.put("sjd", "18:00——(末)"); | |
| 754 | + newmap5.put("sxsj", jcsj0); | |
| 755 | + newmap5.put("xxsj", jcsj1); | |
| 756 | + newmap5.put("fqsj", jcsj0+jcsj1); | |
| 757 | + int min0=iJcZ-iJcW>0?iJcW:iJcZ; | |
| 758 | + int max0=aJcZ-aJcW>0?aJcZ:aJcW; | |
| 759 | + int min1=iJc1Z-iJc1W>0?iJc1W:iJc1Z; | |
| 760 | + int max1=aJc1Z-aJc1W>0?aJc1Z:aJc1W; | |
| 761 | + newmap5.put("cj", (min0-min1>0?min1:min0)+"——"+(max0-max1>0?max0:max1)); | |
| 762 | + | |
| 763 | + newList.add(newmap1); | |
| 764 | + newList.add(newmap2); | |
| 765 | + newList.add(newmap3); | |
| 766 | + newList.add(newmap4); | |
| 767 | + newList.add(newmap5); | |
| 768 | + return newList; | |
| 769 | + } | |
| 256 | 770 | } | ... | ... |
src/main/resources/static/pages/forms/statement/changetochange.html
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | |
| 29 | 29 | <div class="page-head"> |
| 30 | 30 | <div class="page-title"> |
| 31 | - <h1>换人换车情况统计表</h1> | |
| 31 | + <h1>鎹汉鎹㈣溅鎯呭喌缁熻琛</h1> | |
| 32 | 32 | </div> |
| 33 | 33 | </div> |
| 34 | 34 | |
| ... | ... | @@ -38,28 +38,28 @@ |
| 38 | 38 | <div class="portlet-title"> |
| 39 | 39 | <form class="form-inline" action="" method="post"> |
| 40 | 40 | <div style="display: inline-block;"> |
| 41 | - <span class="item-label" style="width: 80px;">线路: </span> | |
| 41 | + <span class="item-label" style="width: 80px;">绾胯矾: </span> | |
| 42 | 42 | <select class="form-control" name="line" id="line" style="width: 120px;"></select> |
| 43 | 43 | </div> |
| 44 | 44 | <div style="display: inline-block;margin-left: 15px;"> |
| 45 | - <span class="item-label" style="width: 80px;">开始时间: </span> | |
| 45 | + <span class="item-label" style="width: 80px;">寮濮嬫椂闂: </span> | |
| 46 | 46 | <input class="form-control" type="text" id="startDate" style="width: 120px;"/> |
| 47 | 47 | </div> |
| 48 | 48 | <div style="display: inline-block;margin-left: 15px;"> |
| 49 | - <span class="item-label" style="width: 80px;">结束时间: </span> | |
| 49 | + <span class="item-label" style="width: 80px;">缁撴潫鏃堕棿: </span> | |
| 50 | 50 | <input class="form-control" type="text" id="endDate" style="width: 120px;"/> |
| 51 | 51 | </div> |
| 52 | 52 | <div style="display: inline-block;"> |
| 53 | - <span class="item-label" style="width: 120px;">类型: </span> | |
| 53 | + <span class="item-label" style="width: 120px;">绫诲瀷: </span> | |
| 54 | 54 | <select class="form-control" id="sel"> |
| 55 | - <option value="">请选择</option> | |
| 56 | - <option value="1">换人</option> | |
| 57 | - <option value="2">换车</option> | |
| 55 | + <option value="">璇烽夋嫨</option> | |
| 56 | + <option value="1">鎹汉</option> | |
| 57 | + <option value="2">鎹㈣溅</option> | |
| 58 | 58 | </select> |
| 59 | 59 | </div> |
| 60 | 60 | <div class="form-group"> |
| 61 | - <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 62 | - <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 61 | + <input class="btn btn-default" type="button" id="query" value="绛涢"/> | |
| 62 | + <input class="btn btn-default" type="button" id="export" value="瀵煎嚭"/> | |
| 63 | 63 | </div> |
| 64 | 64 | </form> |
| 65 | 65 | </div> |
| ... | ... | @@ -68,35 +68,35 @@ |
| 68 | 68 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 69 | 69 | <thead> |
| 70 | 70 | <tr> |
| 71 | - <th colspan="15">换人换车情况统计表</th> | |
| 71 | + <th colspan="15">鎹汉鎹㈣溅鎯呭喌缁熻琛</th> | |
| 72 | 72 | </tr> |
| 73 | 73 | <tr> |
| 74 | - <td rowspan="3" style=" padding-top: 50px;">日期</td> | |
| 75 | - <td rowspan="3" style=" padding-top: 50px;">公司</td> | |
| 76 | - <td rowspan="3" style=" padding-top: 50px;">分公司</td> | |
| 77 | - <td rowspan="3" style=" padding-top: 50px;">线路</td> | |
| 78 | - <td rowspan="3" style=" padding-top: 50px;">路牌</td> | |
| 79 | - <td rowspan="3" style=" padding-top: 50px;">发生时间</td> | |
| 80 | - <td rowspan="3" style=" padding-top: 50px;">修改时间</td> | |
| 81 | - <td colspan="2">配车</td> | |
| 82 | - <td colspan="4">人员</td> | |
| 83 | - <td rowspan="3" style=" padding-top: 50px;">原因</td> | |
| 84 | - <td rowspan="3" style=" padding-top: 50px;">修改人</td> | |
| 74 | + <td rowspan="3" style=" padding-top: 50px;">鏃ユ湡</td> | |
| 75 | + <td rowspan="3" style=" padding-top: 50px;">鍏徃</td> | |
| 76 | + <td rowspan="3" style=" padding-top: 50px;">鍒嗗叕鍙</td> | |
| 77 | + <td rowspan="3" style=" padding-top: 50px;">绾胯矾</td> | |
| 78 | + <td rowspan="3" style=" padding-top: 50px;">璺墝</td> | |
| 79 | + <td rowspan="3" style=" padding-top: 50px;">鍙戠敓鏃堕棿</td> | |
| 80 | + <td rowspan="3" style=" padding-top: 50px;">淇敼鏃堕棿</td> | |
| 81 | + <td colspan="2">閰嶈溅</td> | |
| 82 | + <td colspan="4">浜哄憳</td> | |
| 83 | + <td rowspan="3" style=" padding-top: 50px;">鍘熷洜</td> | |
| 84 | + <td rowspan="3" style=" padding-top: 50px;">淇敼浜</td> | |
| 85 | 85 | </tr> |
| 86 | 86 | <tr> |
| 87 | - <td>计划</td> | |
| 88 | - <td>实际</td> | |
| 89 | - <td colspan="2">计划</td> | |
| 90 | - <td colspan="2">实际</td> | |
| 87 | + <td>璁″垝</td> | |
| 88 | + <td>瀹為檯</td> | |
| 89 | + <td colspan="2">璁″垝</td> | |
| 90 | + <td colspan="2">瀹為檯</td> | |
| 91 | 91 | |
| 92 | 92 | </tr> |
| 93 | 93 | <tr> |
| 94 | - <td>车号</td> | |
| 95 | - <td>车号</td> | |
| 96 | - <td>工号</td> | |
| 97 | - <td>人员</td> | |
| 98 | - <td>工号</td> | |
| 99 | - <td>人员</td> | |
| 94 | + <td>杞﹀彿</td> | |
| 95 | + <td>杞﹀彿</td> | |
| 96 | + <td>宸ュ彿</td> | |
| 97 | + <td>浜哄憳</td> | |
| 98 | + <td>宸ュ彿</td> | |
| 99 | + <td>浜哄憳</td> | |
| 100 | 100 | </tr> |
| 101 | 101 | </thead> |
| 102 | 102 | <tbody> |
| ... | ... | @@ -111,7 +111,7 @@ |
| 111 | 111 | |
| 112 | 112 | <script> |
| 113 | 113 | $(function(){ |
| 114 | - // 关闭左侧栏 | |
| 114 | + // 鍏抽棴宸︿晶鏍 | |
| 115 | 115 | if (!$('body').hasClass('page-sidebar-closed')) |
| 116 | 116 | $('.menu-toggler.sidebar-toggler').click(); |
| 117 | 117 | |
| ... | ... | @@ -148,13 +148,13 @@ |
| 148 | 148 | }, |
| 149 | 149 | language: { |
| 150 | 150 | noResults: function(){ |
| 151 | - return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>'; | |
| 151 | + return '<span style="color:red;font-size: 12px;">娌℃湁鎼滅储鍒扮嚎璺紒</span>'; | |
| 152 | 152 | }, |
| 153 | 153 | inputTooShort : function(e) { |
| 154 | - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>'; | |
| 154 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 杈撳叆绾胯矾鎼滅储绾胯矾</span>'; | |
| 155 | 155 | }, |
| 156 | 156 | searching : function() { |
| 157 | - return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>'; | |
| 157 | + return '<span style="color:gray;font-size: 12px;"> 姝e湪鎼滅储绾胯矾...</span>'; | |
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | }); |
| ... | ... | @@ -182,20 +182,20 @@ |
| 182 | 182 | } |
| 183 | 183 | obj.updateDate = moment(obj.startDate).format("YYYY-MM-DD HH:mm:ss"); |
| 184 | 184 | }); |
| 185 | - // 把数据填充到模版中 | |
| 185 | + // 鎶婃暟鎹~鍏呭埌妯$増涓 | |
| 186 | 186 | var tbodyHtml = template('changetochange',{list:result}); |
| 187 | - // 把渲染好的模版html文本追加到表格中 | |
| 187 | + // 鎶婃覆鏌撳ソ鐨勬ā鐗坔tml鏂囨湰杩藉姞鍒拌〃鏍间腑 | |
| 188 | 188 | $('#forms tbody').html(tbodyHtml); |
| 189 | 189 | }) |
| 190 | 190 | |
| 191 | 191 | }else{ |
| 192 | - alert("请选择时间范围!"); | |
| 192 | + alert("璇烽夋嫨鏃堕棿鑼冨洿!"); | |
| 193 | 193 | } |
| 194 | 194 | }); |
| 195 | 195 | |
| 196 | 196 | $("#export").on("click",function(){ |
| 197 | 197 | $post('/mcy_export/changetochangeExport',{startDate:startDate,endDate:endDate,type:'export'},function(result){ |
| 198 | - window.open("/downloadFile/download?fileName=换人换车情况日统计"+moment(startDate).format("YYYYMMDD")); | |
| 198 | + window.open("/downloadFile/download?fileName=鎹汉鎹㈣溅鎯呭喌鏃ョ粺璁"+moment(startDate).format("YYYYMMDD")); | |
| 199 | 199 | }); |
| 200 | 200 | }); |
| 201 | 201 | }); |
| ... | ... | @@ -222,7 +222,7 @@ |
| 222 | 222 | {{/each}} |
| 223 | 223 | {{if list.length == 0}} |
| 224 | 224 | <tr> |
| 225 | - <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> | |
| 225 | + <td colspan="15"><h6 class="muted">娌℃湁鎵惧埌鐩稿叧鏁版嵁</h6></td> | |
| 226 | 226 | </tr> |
| 227 | 227 | {{/if}} |
| 228 | 228 | </script> | ... | ... |
src/main/resources/static/pages/report/timetable/timetable.html
0 → 100644
| 1 | +<style type="text/css"> | |
| 2 | + .table-bordered { | |
| 3 | + border: 1px solid; } | |
| 4 | + .table-bordered > thead > tr > th, | |
| 5 | + .table-bordered > thead > tr > td, | |
| 6 | + .table-bordered > tbody > tr > th, | |
| 7 | + .table-bordered > tbody > tr > td, | |
| 8 | + .table-bordered > tfoot > tr > th, | |
| 9 | + .table-bordered > tfoot > tr > td { | |
| 10 | + border: 1px solid; } | |
| 11 | + .table-bordered > thead > tr > th, | |
| 12 | + .table-bordered > thead > tr > td { | |
| 13 | + border-bottom-width: 2px; } | |
| 14 | + | |
| 15 | + .table > tbody + tbody { | |
| 16 | + border-top: 1px solid; } | |
| 17 | +</style> | |
| 18 | + | |
| 19 | +<div class="page-head"> | |
| 20 | + <div class="page-title"> | |
| 21 | + <h1>行车时刻表统计表</h1> | |
| 22 | + </div> | |
| 23 | +</div> | |
| 24 | + | |
| 25 | +<div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light porttlet-fit bordered"> | |
| 28 | + <div class="portlet-title"> | |
| 29 | + <form class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block;"> | |
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | |
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | |
| 36 | + <input class="form-control" type="text" id="date" style="width: 180px;"/> | |
| 37 | + </div> | |
| 38 | + <div class="form-group"> | |
| 39 | + <input class="btn btn-default" type="button" id="query" value="查询"/> | |
| 40 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 41 | + </div> | |
| 42 | + </form> | |
| 43 | + </div> | |
| 44 | + <div class="portlet-body"> | |
| 45 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> | |
| 46 | + <label id="xlxq"></label> | |
| 47 | + <table class="table table-bordered table-hover table-checkable" style="margin-bottom:5p" id="formsTime1"> | |
| 48 | + <thead> | |
| 49 | + <tr> | |
| 50 | + <th colspan="10">行车时刻表统计表</th> | |
| 51 | + </tr> | |
| 52 | + <tr> | |
| 53 | + <td align="center">配车</td> | |
| 54 | + <td colspan="6" align="center">全日班次</td> | |
| 55 | + <td colspan="3" align="center">计划里程</td> | |
| 56 | + </tr> | |
| 57 | + <tr> | |
| 58 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">合计</td> | |
| 59 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">全程 班次</td> | |
| 60 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">区间 班次</td> | |
| 61 | + <td colspan="2" align="center">6:31-8:30</td> | |
| 62 | + <td colspan="2" align="center">16:01-18:00</td> | |
| 63 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">总里程</td> | |
| 64 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">营业里程</td> | |
| 65 | + <td rowspan="2" style="text-align:center;vertical-align:middle;">空驶里程</td> | |
| 66 | + </tr> | |
| 67 | + <tr> | |
| 68 | + <td >全程</td> | |
| 69 | + <td >区间</td> | |
| 70 | + <td >全程</td> | |
| 71 | + <td >区间</td> | |
| 72 | + </tr> | |
| 73 | + </thead> | |
| 74 | + | |
| 75 | + <tbody class="tbody_time_1"> | |
| 76 | + | |
| 77 | + </tbody> | |
| 78 | + </table> | |
| 79 | + | |
| 80 | + <div class="portlet-body"> | |
| 81 | + <div class="row"> | |
| 82 | + <div class="col-md-4" id="divTime2"> | |
| 83 | + <table class="table table-bordered table-hover table-checkable pre-scrollable" id="formsTime2"> | |
| 84 | + <tr> | |
| 85 | + <td colspan="2"> 营运车时 (计划班次的营运时间/公里)</td> | |
| 86 | + </tr> | |
| 87 | + <tr> | |
| 88 | + <td colspan="2">营业里程/营运时间(小时)</td> | |
| 89 | + | |
| 90 | + </tr> | |
| 91 | + <tr> | |
| 92 | + <td align="center" width="50%"> | |
| 93 | + 营运时间(时:分) | |
| 94 | + </td> | |
| 95 | + <td align="center"> | |
| 96 | + 营运车速 | |
| 97 | + </td> | |
| 98 | + </tr> | |
| 99 | + <tbody class="tbody_time_2"> | |
| 100 | + | |
| 101 | + </tbody> | |
| 102 | + </table> | |
| 103 | + | |
| 104 | + </div> | |
| 105 | + | |
| 106 | + <div class="col-md-8" id="divTime3" > | |
| 107 | + <table class="table table-bordered table-checkable" id="formsTime3"> | |
| 108 | + <tr> | |
| 109 | + <td colspan="8">站点配车</td> | |
| 110 | + </tr> | |
| 111 | + <tr> | |
| 112 | + <td colspan="4" align="center">6:31—8:30</td> | |
| 113 | + <td colspan="4" align="center">16:01—18:00</td> | |
| 114 | + </tr> | |
| 115 | + <tr> | |
| 116 | + <td width="18%">全程站名</td> | |
| 117 | + <td>配车</td> | |
| 118 | + <td width="18%">区间站名</td> | |
| 119 | + <td>配车</td> | |
| 120 | + <td width="18%">全程站名</td> | |
| 121 | + <td>配车</td> | |
| 122 | + <td width="18%">区间站名</td> | |
| 123 | + <td>配车</td> | |
| 124 | + </tr> | |
| 125 | + <tbody class="tbody_time_3"> | |
| 126 | + | |
| 127 | + </tbody> | |
| 128 | + </table> | |
| 129 | + </div> | |
| 130 | + | |
| 131 | + </div> | |
| 132 | + </div> | |
| 133 | + <div class="portlet-body"> | |
| 134 | + <div class="row"> | |
| 135 | + <div class="col-md-6" > | |
| 136 | + <table class="table table-bordered table-checkable"> | |
| 137 | + <tr> | |
| 138 | + <td colspan="6">调度形式</td> | |
| 139 | + </tr> | |
| 140 | + <tr> | |
| 141 | + <td colspan="3" align="center">上行向()站</td> | |
| 142 | + <td colspan="3" align="center">下行向()站</td> | |
| 143 | + </tr> | |
| 144 | + <tr> | |
| 145 | + <td>起讫站</td> | |
| 146 | + <td>起讫时间</td> | |
| 147 | + <td>班次</td> | |
| 148 | + <td>起讫站</td> | |
| 149 | + <td>起讫时间</td> | |
| 150 | + <td>班次</td> | |
| 151 | + </tr> | |
| 152 | + <tbody class="tbody_time_4"> | |
| 153 | + | |
| 154 | + </tbody> | |
| 155 | + </table> | |
| 156 | + </div> | |
| 157 | + <div class="col-md-6" > | |
| 158 | + <table class="table table-bordered table-checkable" id="formsTime5"> | |
| 159 | + <tr> | |
| 160 | + <td colspan="5">全日分组行驶时间(区间除外)</td> | |
| 161 | + </tr> | |
| 162 | + <tr> | |
| 163 | + <td width="25%" rowspan="2" style="text-align:center;vertical-align:middle;w">分组 时间</td> | |
| 164 | + <td width="30%" colspan="2" style="text-align:center;vertical-align:middle;">实驶(分)</td> | |
| 165 | + <td width="20%" rowspan="2" style="text-align:center;vertical-align:middle;">分圈 时间</td> | |
| 166 | + <td width="25%" rowspan="2" style="text-align:center;vertical-align:middle;">车距</td> | |
| 167 | + </tr> | |
| 168 | + <tr> | |
| 169 | + <td>上行</td> | |
| 170 | + <td>下行</td> | |
| 171 | + </tr> | |
| 172 | + <tbody class="tbody_time_5"> | |
| 173 | + | |
| 174 | + </tbody> | |
| 175 | + </table> | |
| 176 | + </div> | |
| 177 | + </div> | |
| 178 | + </div> | |
| 179 | + </div> | |
| 180 | + </div> | |
| 181 | + </div> | |
| 182 | + </div> | |
| 183 | +</div> | |
| 184 | + | |
| 185 | +<script> | |
| 186 | + $(function(){ | |
| 187 | + // 关闭左侧栏 | |
| 188 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 189 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 190 | + | |
| 191 | + $("#date").datetimepicker({ | |
| 192 | + format : 'YYYY-MM-DD', | |
| 193 | + locale : 'zh-cn' | |
| 194 | + }); | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + $.get('/basic/lineCode2Name',function(result){ | |
| 199 | + var data=[]; | |
| 200 | + | |
| 201 | + for(var code in result){ | |
| 202 | + data.push({id: code, text: result[code]}); | |
| 203 | + } | |
| 204 | + initPinYinSelect2('#line',data,''); | |
| 205 | + | |
| 206 | + }) | |
| 207 | + //查询 | |
| 208 | + $("#query").on('click',function(){ | |
| 209 | + var line = $("#line").val(); | |
| 210 | + var xlName = $("#select2-line-container").html(); | |
| 211 | + var date = $("#date").val(); | |
| 212 | + if(date==null|| date==""){ | |
| 213 | + layer.msg('请选择日期.'); | |
| 214 | + }else if(line==null || line ==""){ | |
| 215 | + layer.msg('请选择线路.'); | |
| 216 | + }else{ | |
| 217 | + $get('/report/tbodyTime1',{line:line,date:date},function(result){ | |
| 218 | + var tbodyTime1 = template('tbodyTime1',{result}); | |
| 219 | + $('#formsTime1 .tbody_time_1').html(tbodyTime1); | |
| 220 | + }); | |
| 221 | + $.get('/report/tbodyTime2',{line:line,date:date},function(result){ | |
| 222 | + var tbodyTime2 = template('tbodyTime2',{result}); | |
| 223 | + $('#formsTime2 .tbody_time_2').html(tbodyTime2); | |
| 224 | + }); | |
| 225 | + $.get('/report/tbodyTime3',{line:line,date:date},function(result){ | |
| 226 | + | |
| 227 | + var tbodyTime3 = template('tbodyTime3',{list:result}); | |
| 228 | + $('#formsTime3 .tbody_time_3').html(tbodyTime3); | |
| 229 | + var divTime3 = window.document.getElementById('formsTime3'); | |
| 230 | + var divTime2 = window.document.getElementById('formsTime2'); | |
| 231 | + console.log(divTime3.offsetHeight); | |
| 232 | + divTime2.style.height=divTime3.offsetHeight+"px"; | |
| 233 | + });/* | |
| 234 | + $.get('/report/tbodyTime4',{line:line,date:date},function(result){ | |
| 235 | + var scheduleDaily_3 = template('scheduleDaily_3',{list:result}); | |
| 236 | + $('#forms .scheduleDaily_3').html(scheduleDaily_3); | |
| 237 | + });*/ | |
| 238 | + $.get('/report/tbodyTime5',{line:line,date:date},function(result){ | |
| 239 | + var tbodyTime5 = template('tbodyTime5',{list:result}); | |
| 240 | + $('#formsTime5 .tbody_time_5').html(tbodyTime5); | |
| 241 | + }); | |
| 242 | + } | |
| 243 | + | |
| 244 | + | |
| 245 | + }); | |
| 246 | + }); | |
| 247 | +</script> | |
| 248 | +<script type="text/html" id="tbodyTime1"> | |
| 249 | + <tr> | |
| 250 | + <td>{{result.pcs}}</td> | |
| 251 | + <td>{{result.qcbc}}</td> | |
| 252 | + <td>{{result.qjbc}}</td> | |
| 253 | + <td>{{result.zqcbc}}</td> | |
| 254 | + <td>{{result.zqjbc}}</td> | |
| 255 | + <td>{{result.wqcbc}}</td> | |
| 256 | + <td>{{result.wqjbc}}</td> | |
| 257 | + <td>{{result.zlc}}</td> | |
| 258 | + <td>{{result.yylc}}</td> | |
| 259 | + <td>{{result.kslc}}</td> | |
| 260 | + </tr> | |
| 261 | +</script> | |
| 262 | + | |
| 263 | +<script type="text/html" id="tbodyTime2"> | |
| 264 | + <tr> | |
| 265 | + <td align="center">{{result.yysj}}</td> | |
| 266 | + <td align="center">{{result.yycs}}</td> | |
| 267 | + </tr> | |
| 268 | +</script> | |
| 269 | + | |
| 270 | +<script type="text/html" id="tbodyTime3"> | |
| 271 | +{{each list as result i}} | |
| 272 | + <tr> | |
| 273 | + <td align="center">{{result.zqcZm}}</td> | |
| 274 | + <td align="center">{{result.zqcCls}}</td> | |
| 275 | + <td align="center">{{result.zqjZm}}</td> | |
| 276 | + <td align="center">{{result.zqjCls}}</td> | |
| 277 | + <td align="center">{{result.wqcZm}}</td> | |
| 278 | + <td align="center">{{result.wqcCls}}</td> | |
| 279 | + <td align="center">{{result.wqjZm}}</td> | |
| 280 | + <td align="center">{{result.wqjCls}}</td> | |
| 281 | + </tr> | |
| 282 | +{{/each}} | |
| 283 | +{{if list.length == 0}} | |
| 284 | + <tr> | |
| 285 | + <td colspan="8"><h6 class="muted">没有找到相关数据</h6></td> | |
| 286 | + </tr> | |
| 287 | + {{/if}} | |
| 288 | +</script> | |
| 289 | + | |
| 290 | + | |
| 291 | +<script type="text/html" id="tbodyTime5"> | |
| 292 | +{{each list as result i}} | |
| 293 | + <tr> | |
| 294 | + <td align="center">{{result.sjd}}</td> | |
| 295 | + <td align="center">{{result.sxsj}}</td> | |
| 296 | + <td align="center">{{result.xxsj}}</td> | |
| 297 | + <td align="center">{{result.fqsj}}</td> | |
| 298 | + <td align="center">{{result.cj}}</td> | |
| 299 | + </tr> | |
| 300 | +{{/each}} | |
| 301 | +{{if list.length == 0}} | |
| 302 | + <tr> | |
| 303 | + <td colspan="5"><h6 class="muted">没有找到相关数据</h6></td> | |
| 304 | + </tr> | |
| 305 | + {{/if}} | |
| 306 | +</script> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/module.js
| 1 | -// 车辆基础信息维护 service controller等写在一起 | |
| 2 | - | |
| 3 | -angular.module('ScheduleApp').factory('BusInfoManageService', ['BusInfoManageService_g', function(service) { | |
| 4 | - | |
| 5 | - /** 当前的查询条件信息 */ | |
| 6 | - var currentSearchCondition = { | |
| 7 | - "carCode_like" : "", | |
| 8 | - "insideCode_like" : "", | |
| 9 | - "equipmentCode_like" : "", | |
| 10 | - "carPlate_like" : "" | |
| 11 | - }; | |
| 12 | - | |
| 13 | - /** 当前第几页 */ | |
| 14 | - var currentPageNo = 1; | |
| 15 | - return { | |
| 16 | - /** | |
| 17 | - * 获取查询条件信息, | |
| 18 | - * 用于给controller用来和页面数据绑定。 | |
| 19 | - */ | |
| 20 | - getSearchCondition: function() { | |
| 21 | - return currentSearchCondition; | |
| 22 | - }, | |
| 23 | - /** | |
| 24 | - * 重置查询条件信息。 | |
| 25 | - */ | |
| 26 | - resetSearchCondition: function() { | |
| 27 | - var key; | |
| 28 | - for (key in currentSearchCondition) { | |
| 29 | - currentSearchCondition[key] = undefined; | |
| 30 | - } | |
| 31 | - currentPageNo = 1; | |
| 32 | - }, | |
| 33 | - /** | |
| 34 | - * 设置当前页码。 | |
| 35 | - * @param cpn 从1开始,后台是从0开始的 | |
| 36 | - */ | |
| 37 | - setCurrentPageNo: function(cpn) { | |
| 38 | - currentPageNo = cpn; | |
| 39 | - }, | |
| 40 | - /** | |
| 41 | - * 组装查询参数,返回一个promise查询结果。 | |
| 42 | - * @param params 查询参数 | |
| 43 | - * @return 返回一个 promise | |
| 44 | - */ | |
| 45 | - getPage: function() { | |
| 46 | - var params = currentSearchCondition; // 查询条件 | |
| 47 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 48 | - return service.rest.list(params).$promise; | |
| 49 | - }, | |
| 50 | - /** | |
| 51 | - * 获取明细信息。 | |
| 52 | - * @param id 车辆id | |
| 53 | - * @return 返回一个 promise | |
| 54 | - */ | |
| 55 | - getDetail: function(id) { | |
| 56 | - var params = {id: id}; | |
| 57 | - return service.rest.get(params).$promise; | |
| 58 | - }, | |
| 59 | - /** | |
| 60 | - * 保存信息。 | |
| 61 | - * @param obj 车辆详细信息 | |
| 62 | - * @return 返回一个 promise | |
| 63 | - */ | |
| 64 | - saveDetail: function(obj) { | |
| 65 | - return service.rest.save(obj).$promise; | |
| 66 | - }, | |
| 67 | - /** | |
| 68 | - * 数据导出。 | |
| 69 | - * @returns {*|Function|promise|n} | |
| 70 | - */ | |
| 71 | - dataExport: function() { | |
| 72 | - return service.dataTools.dataExport().$promise; | |
| 73 | - } | |
| 74 | - }; | |
| 75 | -}]); | |
| 76 | - | |
| 77 | -angular.module('ScheduleApp').controller('BusInfoManageCtrl', [ | |
| 78 | - 'BusInfoManageService','$state', '$uibModal', 'FileDownload_g', | |
| 79 | - function(busInfoManageService, $state, $uibModal, fileDownload) { | |
| 80 | - var self = this; | |
| 81 | - | |
| 82 | - // 切换到form状态 | |
| 83 | - self.goForm = function() { | |
| 84 | - //alert("切换"); | |
| 85 | - $state.go("busInfoManage_form"); | |
| 86 | - }; | |
| 87 | - | |
| 88 | - // 导入excel | |
| 89 | - self.importData = function() { | |
| 90 | - // large方式弹出模态对话框 | |
| 91 | - var modalInstance = $uibModal.open({ | |
| 92 | - templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html', | |
| 93 | - size: "lg", | |
| 94 | - animation: true, | |
| 95 | - backdrop: 'static', | |
| 96 | - resolve: { | |
| 97 | - // 可以传值给controller | |
| 98 | - }, | |
| 99 | - windowClass: 'center-modal', | |
| 100 | - controller: "BusInfoManageToolsCtrl", | |
| 101 | - controllerAs: "ctrl", | |
| 102 | - bindToController: true | |
| 103 | - }); | |
| 104 | - modalInstance.result.then( | |
| 105 | - function() { | |
| 106 | - console.log("dataImport.html打开"); | |
| 107 | - }, | |
| 108 | - function() { | |
| 109 | - console.log("dataImport.html消失"); | |
| 110 | - } | |
| 111 | - ); | |
| 112 | - }; | |
| 113 | - | |
| 114 | - // 导出excel | |
| 115 | - self.exportData = function() { | |
| 116 | - busInfoManageService.dataExport().then( | |
| 117 | - function(result) { | |
| 118 | - fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls"); | |
| 119 | - }, | |
| 120 | - function(result) { | |
| 121 | - console.log("exportData failed:" + result); | |
| 122 | - } | |
| 123 | - ); | |
| 124 | - }; | |
| 125 | - }]); | |
| 126 | - | |
| 127 | -angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 128 | - var self = this; | |
| 129 | - self.data = "TODO"; | |
| 130 | - | |
| 131 | - // 关闭窗口 | |
| 132 | - self.close = function() { | |
| 133 | - $modalInstance.dismiss("cancel"); | |
| 134 | - }; | |
| 135 | - | |
| 136 | - self.clearInputFile = function() { | |
| 137 | - angular.element("input[type='file']").val(null); | |
| 138 | - }; | |
| 139 | - | |
| 140 | - // 上传文件组件 | |
| 141 | - self.uploader = new FileUploader({ | |
| 142 | - url: "/cars/dataImport", | |
| 143 | - filters: [] // 用于过滤文件,比如只允许导入excel | |
| 144 | - }); | |
| 145 | - self.uploader.onAfterAddingFile = function(fileItem) | |
| 146 | - { | |
| 147 | - console.info('onAfterAddingFile', fileItem); | |
| 148 | - console.log(self.uploader.queue.length); | |
| 149 | - if (self.uploader.queue.length > 1) | |
| 150 | - self.uploader.removeFromQueue(0); | |
| 151 | - }; | |
| 152 | - self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 153 | - { | |
| 154 | - console.info('onSuccessItem', fileItem, response, status, headers); | |
| 155 | - }; | |
| 156 | - self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 157 | - { | |
| 158 | - console.info('onErrorItem', fileItem, response, status, headers); | |
| 159 | - }; | |
| 160 | - | |
| 161 | -}]); | |
| 162 | - | |
| 163 | - | |
| 164 | -angular.module('ScheduleApp').controller('BusInfoManageListCtrl', ['BusInfoManageService','$scope', function(busInfoManageService, $scope) { | |
| 165 | - var self = this; | |
| 166 | - self.pageInfo = { | |
| 167 | - totalItems : 0, | |
| 168 | - currentPage : 1, | |
| 169 | - infos: [] | |
| 170 | - }; | |
| 171 | - | |
| 172 | - // 初始创建的时候,获取一次列表数据 | |
| 173 | - busInfoManageService.getPage().then( | |
| 174 | - function(result) { | |
| 175 | - self.pageInfo.totalItems = result.totalElements; | |
| 176 | - self.pageInfo.currentPage = result.number + 1; | |
| 177 | - self.pageInfo.infos = result.content; | |
| 178 | - busInfoManageService.setCurrentPageNo(result.number + 1); | |
| 179 | - }, | |
| 180 | - function(result) { | |
| 181 | - alert("出错啦!"); | |
| 182 | - } | |
| 183 | - ); | |
| 184 | - | |
| 185 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 186 | - // alert("dfdfdf"); | |
| 187 | - //}); | |
| 188 | - | |
| 189 | - // 翻页的时候调用 | |
| 190 | - self.pageChanaged = function() { | |
| 191 | - busInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 192 | - busInfoManageService.getPage().then( | |
| 193 | - function(result) { | |
| 194 | - self.pageInfo.totalItems = result.totalElements; | |
| 195 | - self.pageInfo.currentPage = result.number + 1; | |
| 196 | - self.pageInfo.infos = result.content; | |
| 197 | - busInfoManageService.setCurrentPageNo(result.number + 1); | |
| 198 | - }, | |
| 199 | - function(result) { | |
| 200 | - alert("出错啦!"); | |
| 201 | - } | |
| 202 | - ); | |
| 203 | - }; | |
| 204 | - // 获取查询条件数据 | |
| 205 | - self.searchCondition = function() { | |
| 206 | - return busInfoManageService.getSearchCondition(); | |
| 207 | - }; | |
| 208 | - // 重置查询条件 | |
| 209 | - self.resetSearchCondition = function() { | |
| 210 | - busInfoManageService.resetSearchCondition(); | |
| 211 | - self.pageInfo.currentPage = 1; | |
| 212 | - self.pageChanaged(); | |
| 213 | - }; | |
| 214 | -}]); | |
| 215 | - | |
| 216 | -angular.module('ScheduleApp').controller('BusInfoManageFormCtrl', ['BusInfoManageService', '$stateParams', '$state', function(busInfoManageService, $stateParams, $state) { | |
| 217 | - var self = this; | |
| 218 | - | |
| 219 | - // 报废日期 日期控件开关 | |
| 220 | - self.scrapDateOpen = false; | |
| 221 | - self.scrapDate_open = function() { | |
| 222 | - self.scrapDateOpen = true; | |
| 223 | - }; | |
| 224 | - | |
| 225 | - // 启用日期 日期控件开关 | |
| 226 | - self.openDateOpen = false; | |
| 227 | - self.openDate_open = function() { | |
| 228 | - self.openDateOpen = true; | |
| 229 | - }; | |
| 230 | - // 取消日期 日期控件开关 | |
| 231 | - self.closeDateOpen = false; | |
| 232 | - self.closeDate_open = function() { | |
| 233 | - self.closeDateOpen = true; | |
| 234 | - }; | |
| 235 | - | |
| 236 | - // 欲保存的busInfo信息,绑定 | |
| 237 | - self.busInfoForSave = {}; | |
| 238 | - | |
| 239 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 240 | - var id = $stateParams.id; | |
| 241 | - if (id) { | |
| 242 | - self.busInfoForSave.id = id; | |
| 243 | - busInfoManageService.getDetail(id).then( | |
| 244 | - function(result) { | |
| 245 | - var key; | |
| 246 | - for (key in result) { | |
| 247 | - self.busInfoForSave[key] = result[key]; | |
| 248 | - } | |
| 249 | - }, | |
| 250 | - function(result) { | |
| 251 | - alert("出错啦!"); | |
| 252 | - } | |
| 253 | - ); | |
| 254 | - } | |
| 255 | - | |
| 256 | - // 提交方法 | |
| 257 | - self.submit = function() { | |
| 258 | - console.log(self.busInfoForSave); | |
| 259 | - //if (self.busInfoForSave) { | |
| 260 | - // delete $stateParams.id; | |
| 261 | - //} | |
| 262 | - busInfoManageService.saveDetail(self.busInfoForSave).then( | |
| 263 | - function(result) { | |
| 264 | - // TODO:弹出框方式以后改 | |
| 265 | - if (result.status == 'SUCCESS') { | |
| 266 | - alert("保存成功!"); | |
| 267 | - $state.go("busInfoManage"); | |
| 268 | - } else { | |
| 269 | - alert("保存异常!"); | |
| 270 | - } | |
| 271 | - }, | |
| 272 | - function(result) { | |
| 273 | - // TODO:弹出框方式以后改 | |
| 274 | - alert("出错啦!"); | |
| 275 | - } | |
| 276 | - ); | |
| 277 | - }; | |
| 278 | - | |
| 279 | -}]); | |
| 280 | - | |
| 281 | -angular.module('ScheduleApp').controller('BusInfoManageDetailCtrl', ['BusInfoManageService', '$stateParams', function(busInfoManageService, $stateParams) { | |
| 282 | - var self = this; | |
| 283 | - self.title = ""; | |
| 284 | - self.busInfoForDetail = {}; | |
| 285 | - self.busInfoForDetail.id = $stateParams.id; | |
| 286 | - | |
| 287 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 288 | - busInfoManageService.getDetail($stateParams.id).then( | |
| 289 | - function(result) { | |
| 290 | - var key; | |
| 291 | - for (key in result) { | |
| 292 | - self.busInfoForDetail[key] = result[key]; | |
| 293 | - } | |
| 294 | - | |
| 295 | - self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息"; | |
| 296 | - }, | |
| 297 | - function(result) { | |
| 298 | - // TODO:弹出框方式以后改 | |
| 299 | - alert("出错啦!"); | |
| 300 | - } | |
| 301 | - ); | |
| 1 | +// 车辆基础信息维护 service controller等写在一起 | |
| 2 | + | |
| 3 | +angular.module('ScheduleApp').factory('BusInfoManageService', ['BusInfoManageService_g', function(service) { | |
| 4 | + | |
| 5 | + /** 当前的查询条件信息 */ | |
| 6 | + var currentSearchCondition = { | |
| 7 | + "carCode_like" : "", | |
| 8 | + "insideCode_like" : "", | |
| 9 | + "equipmentCode_like" : "", | |
| 10 | + "carPlate_like" : "" | |
| 11 | + }; | |
| 12 | + | |
| 13 | + /** 当前第几页 */ | |
| 14 | + var currentPageNo = 1; | |
| 15 | + return { | |
| 16 | + /** | |
| 17 | + * 获取查询条件信息, | |
| 18 | + * 用于给controller用来和页面数据绑定。 | |
| 19 | + */ | |
| 20 | + getSearchCondition: function() { | |
| 21 | + return currentSearchCondition; | |
| 22 | + }, | |
| 23 | + /** | |
| 24 | + * 重置查询条件信息。 | |
| 25 | + */ | |
| 26 | + resetSearchCondition: function() { | |
| 27 | + var key; | |
| 28 | + for (key in currentSearchCondition) { | |
| 29 | + currentSearchCondition[key] = undefined; | |
| 30 | + } | |
| 31 | + currentPageNo = 1; | |
| 32 | + }, | |
| 33 | + /** | |
| 34 | + * 设置当前页码。 | |
| 35 | + * @param cpn 从1开始,后台是从0开始的 | |
| 36 | + */ | |
| 37 | + setCurrentPageNo: function(cpn) { | |
| 38 | + currentPageNo = cpn; | |
| 39 | + }, | |
| 40 | + /** | |
| 41 | + * 组装查询参数,返回一个promise查询结果。 | |
| 42 | + * @param params 查询参数 | |
| 43 | + * @return 返回一个 promise | |
| 44 | + */ | |
| 45 | + getPage: function() { | |
| 46 | + var params = currentSearchCondition; // 查询条件 | |
| 47 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 48 | + return service.rest.list(params).$promise; | |
| 49 | + }, | |
| 50 | + /** | |
| 51 | + * 获取明细信息。 | |
| 52 | + * @param id 车辆id | |
| 53 | + * @return 返回一个 promise | |
| 54 | + */ | |
| 55 | + getDetail: function(id) { | |
| 56 | + var params = {id: id}; | |
| 57 | + return service.rest.get(params).$promise; | |
| 58 | + }, | |
| 59 | + /** | |
| 60 | + * 保存信息。 | |
| 61 | + * @param obj 车辆详细信息 | |
| 62 | + * @return 返回一个 promise | |
| 63 | + */ | |
| 64 | + saveDetail: function(obj) { | |
| 65 | + return service.rest.save(obj).$promise; | |
| 66 | + }, | |
| 67 | + /** | |
| 68 | + * 数据导出。 | |
| 69 | + * @returns {*|Function|promise|n} | |
| 70 | + */ | |
| 71 | + dataExport: function() { | |
| 72 | + return service.dataTools.dataExport().$promise; | |
| 73 | + } | |
| 74 | + }; | |
| 75 | +}]); | |
| 76 | + | |
| 77 | +angular.module('ScheduleApp').controller('BusInfoManageCtrl', [ | |
| 78 | + 'BusInfoManageService','$state', '$uibModal', 'FileDownload_g', | |
| 79 | + function(busInfoManageService, $state, $uibModal, fileDownload) { | |
| 80 | + var self = this; | |
| 81 | + | |
| 82 | + // 切换到form状态 | |
| 83 | + self.goForm = function() { | |
| 84 | + //alert("切换"); | |
| 85 | + $state.go("busInfoManage_form"); | |
| 86 | + }; | |
| 87 | + | |
| 88 | + // 导入excel | |
| 89 | + self.importData = function() { | |
| 90 | + // large方式弹出模态对话框 | |
| 91 | + var modalInstance = $uibModal.open({ | |
| 92 | + templateUrl: '/pages/scheduleApp/module/basicInfo/busInfoManage/dataImport.html', | |
| 93 | + size: "lg", | |
| 94 | + animation: true, | |
| 95 | + backdrop: 'static', | |
| 96 | + resolve: { | |
| 97 | + // 可以传值给controller | |
| 98 | + }, | |
| 99 | + windowClass: 'center-modal', | |
| 100 | + controller: "BusInfoManageToolsCtrl", | |
| 101 | + controllerAs: "ctrl", | |
| 102 | + bindToController: true | |
| 103 | + }); | |
| 104 | + modalInstance.result.then( | |
| 105 | + function() { | |
| 106 | + console.log("dataImport.html打开"); | |
| 107 | + }, | |
| 108 | + function() { | |
| 109 | + console.log("dataImport.html消失"); | |
| 110 | + } | |
| 111 | + ); | |
| 112 | + }; | |
| 113 | + | |
| 114 | + // 导出excel | |
| 115 | + self.exportData = function() { | |
| 116 | + busInfoManageService.dataExport().then( | |
| 117 | + function(result) { | |
| 118 | + fileDownload.downloadFile(result.data, "application/octet-stream", "车辆基础信息.xls"); | |
| 119 | + }, | |
| 120 | + function(result) { | |
| 121 | + console.log("exportData failed:" + result); | |
| 122 | + } | |
| 123 | + ); | |
| 124 | + }; | |
| 125 | + }]); | |
| 126 | + | |
| 127 | +angular.module('ScheduleApp').controller('BusInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 128 | + var self = this; | |
| 129 | + self.data = "TODO"; | |
| 130 | + | |
| 131 | + // 关闭窗口 | |
| 132 | + self.close = function() { | |
| 133 | + $modalInstance.dismiss("cancel"); | |
| 134 | + }; | |
| 135 | + | |
| 136 | + self.clearInputFile = function() { | |
| 137 | + angular.element("input[type='file']").val(null); | |
| 138 | + }; | |
| 139 | + | |
| 140 | + // 上传文件组件 | |
| 141 | + self.uploader = new FileUploader({ | |
| 142 | + url: "/cars/dataImport", | |
| 143 | + filters: [] // 用于过滤文件,比如只允许导入excel | |
| 144 | + }); | |
| 145 | + self.uploader.onAfterAddingFile = function(fileItem) | |
| 146 | + { | |
| 147 | + console.info('onAfterAddingFile', fileItem); | |
| 148 | + console.log(self.uploader.queue.length); | |
| 149 | + if (self.uploader.queue.length > 1) | |
| 150 | + self.uploader.removeFromQueue(0); | |
| 151 | + }; | |
| 152 | + self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 153 | + { | |
| 154 | + console.info('onSuccessItem', fileItem, response, status, headers); | |
| 155 | + }; | |
| 156 | + self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 157 | + { | |
| 158 | + console.info('onErrorItem', fileItem, response, status, headers); | |
| 159 | + }; | |
| 160 | + | |
| 161 | +}]); | |
| 162 | + | |
| 163 | + | |
| 164 | +angular.module('ScheduleApp').controller('BusInfoManageListCtrl', ['BusInfoManageService','$scope', function(busInfoManageService, $scope) { | |
| 165 | + var self = this; | |
| 166 | + self.pageInfo = { | |
| 167 | + totalItems : 0, | |
| 168 | + currentPage : 1, | |
| 169 | + infos: [] | |
| 170 | + }; | |
| 171 | + | |
| 172 | + // 初始创建的时候,获取一次列表数据 | |
| 173 | + busInfoManageService.getPage().then( | |
| 174 | + function(result) { | |
| 175 | + self.pageInfo.totalItems = result.totalElements; | |
| 176 | + self.pageInfo.currentPage = result.number + 1; | |
| 177 | + self.pageInfo.infos = result.content; | |
| 178 | + busInfoManageService.setCurrentPageNo(result.number + 1); | |
| 179 | + }, | |
| 180 | + function(result) { | |
| 181 | + alert("出错啦!"); | |
| 182 | + } | |
| 183 | + ); | |
| 184 | + | |
| 185 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 186 | + // alert("dfdfdf"); | |
| 187 | + //}); | |
| 188 | + | |
| 189 | + // 翻页的时候调用 | |
| 190 | + self.pageChanaged = function() { | |
| 191 | + busInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 192 | + busInfoManageService.getPage().then( | |
| 193 | + function(result) { | |
| 194 | + self.pageInfo.totalItems = result.totalElements; | |
| 195 | + self.pageInfo.currentPage = result.number + 1; | |
| 196 | + self.pageInfo.infos = result.content; | |
| 197 | + busInfoManageService.setCurrentPageNo(result.number + 1); | |
| 198 | + }, | |
| 199 | + function(result) { | |
| 200 | + alert("出错啦!"); | |
| 201 | + } | |
| 202 | + ); | |
| 203 | + }; | |
| 204 | + // 获取查询条件数据 | |
| 205 | + self.searchCondition = function() { | |
| 206 | + return busInfoManageService.getSearchCondition(); | |
| 207 | + }; | |
| 208 | + // 重置查询条件 | |
| 209 | + self.resetSearchCondition = function() { | |
| 210 | + busInfoManageService.resetSearchCondition(); | |
| 211 | + self.pageInfo.currentPage = 1; | |
| 212 | + self.pageChanaged(); | |
| 213 | + }; | |
| 214 | +}]); | |
| 215 | + | |
| 216 | +angular.module('ScheduleApp').controller('BusInfoManageFormCtrl', ['BusInfoManageService', '$stateParams', '$state', function(busInfoManageService, $stateParams, $state) { | |
| 217 | + var self = this; | |
| 218 | + | |
| 219 | + // 报废日期 日期控件开关 | |
| 220 | + self.scrapDateOpen = false; | |
| 221 | + self.scrapDate_open = function() { | |
| 222 | + self.scrapDateOpen = true; | |
| 223 | + }; | |
| 224 | + | |
| 225 | + // 启用日期 日期控件开关 | |
| 226 | + self.openDateOpen = false; | |
| 227 | + self.openDate_open = function() { | |
| 228 | + self.openDateOpen = true; | |
| 229 | + }; | |
| 230 | + // 取消日期 日期控件开关 | |
| 231 | + self.closeDateOpen = false; | |
| 232 | + self.closeDate_open = function() { | |
| 233 | + self.closeDateOpen = true; | |
| 234 | + }; | |
| 235 | + | |
| 236 | + // 欲保存的busInfo信息,绑定 | |
| 237 | + self.busInfoForSave = {}; | |
| 238 | + | |
| 239 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 240 | + var id = $stateParams.id; | |
| 241 | + if (id) { | |
| 242 | + self.busInfoForSave.id = id; | |
| 243 | + busInfoManageService.getDetail(id).then( | |
| 244 | + function(result) { | |
| 245 | + var key; | |
| 246 | + for (key in result) { | |
| 247 | + self.busInfoForSave[key] = result[key]; | |
| 248 | + } | |
| 249 | + }, | |
| 250 | + function(result) { | |
| 251 | + alert("出错啦!"); | |
| 252 | + } | |
| 253 | + ); | |
| 254 | + } | |
| 255 | + | |
| 256 | + // 提交方法 | |
| 257 | + self.submit = function() { | |
| 258 | + console.log(self.busInfoForSave); | |
| 259 | + //if (self.busInfoForSave) { | |
| 260 | + // delete $stateParams.id; | |
| 261 | + //} | |
| 262 | + busInfoManageService.saveDetail(self.busInfoForSave).then( | |
| 263 | + function(result) { | |
| 264 | + // TODO:弹出框方式以后改 | |
| 265 | + if (result.status == 'SUCCESS') { | |
| 266 | + alert("保存成功!"); | |
| 267 | + $state.go("busInfoManage"); | |
| 268 | + } else { | |
| 269 | + alert("保存异常!"); | |
| 270 | + } | |
| 271 | + }, | |
| 272 | + function(result) { | |
| 273 | + // TODO:弹出框方式以后改 | |
| 274 | + alert("出错啦!"); | |
| 275 | + } | |
| 276 | + ); | |
| 277 | + }; | |
| 278 | + | |
| 279 | +}]); | |
| 280 | + | |
| 281 | +angular.module('ScheduleApp').controller('BusInfoManageDetailCtrl', ['BusInfoManageService', '$stateParams', function(busInfoManageService, $stateParams) { | |
| 282 | + var self = this; | |
| 283 | + self.title = ""; | |
| 284 | + self.busInfoForDetail = {}; | |
| 285 | + self.busInfoForDetail.id = $stateParams.id; | |
| 286 | + | |
| 287 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 288 | + busInfoManageService.getDetail($stateParams.id).then( | |
| 289 | + function(result) { | |
| 290 | + var key; | |
| 291 | + for (key in result) { | |
| 292 | + self.busInfoForDetail[key] = result[key]; | |
| 293 | + } | |
| 294 | + | |
| 295 | + self.title = "车辆 " + self.busInfoForDetail.insideCode + " 详细信息"; | |
| 296 | + }, | |
| 297 | + function(result) { | |
| 298 | + // TODO:弹出框方式以后改 | |
| 299 | + alert("出错啦!"); | |
| 300 | + } | |
| 301 | + ); | |
| 302 | 302 | }]); |
| 303 | 303 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/busInfoManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 车辆基础信息模块配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("busInfoManage", { // index页面 | |
| 13 | - url: '/busInfoManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html' | |
| 17 | - }, | |
| 18 | - "busInfoManage_list@busInfoManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'busInfoManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 33 | - ] | |
| 34 | - }); | |
| 35 | - }] | |
| 36 | - } | |
| 37 | - }) | |
| 38 | - .state("busInfoManage_form", { // 添加车辆form | |
| 39 | - url: '/busInfoManage_form', | |
| 40 | - views: { | |
| 41 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'} | |
| 42 | - }, | |
| 43 | - resolve: { | |
| 44 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | - return $ocLazyLoad.load({ | |
| 46 | - name: 'busInfoManage_form_module', | |
| 47 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | - files: [ | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 52 | - ] | |
| 53 | - }); | |
| 54 | - }] | |
| 55 | - } | |
| 56 | - }) | |
| 57 | - .state("busInfoManage_edit", { // 修改车辆form | |
| 58 | - url: '/busInfoManage_edit/:id', | |
| 59 | - views: { | |
| 60 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'} | |
| 61 | - }, | |
| 62 | - resolve: { | |
| 63 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | - return $ocLazyLoad.load({ | |
| 65 | - name: 'busInfoManage_edit_module', | |
| 66 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | - files: [ | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 71 | - ] | |
| 72 | - }); | |
| 73 | - }] | |
| 74 | - } | |
| 75 | - }) | |
| 76 | - .state("busInfoManage_detail", { // 车辆详细信息 | |
| 77 | - url: '/busInfoManage_detail/:id', | |
| 78 | - views: { | |
| 79 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'} | |
| 80 | - }, | |
| 81 | - resolve: { | |
| 82 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | - return $ocLazyLoad.load({ | |
| 84 | - name: 'busInfoManage_detail_module', | |
| 85 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | - files: [ | |
| 87 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 88 | - ] | |
| 89 | - }); | |
| 90 | - }] | |
| 91 | - } | |
| 92 | - }) | |
| 93 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 车辆基础信息模块配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("busInfoManage", { // index页面 | |
| 13 | + url: '/busInfoManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html' | |
| 17 | + }, | |
| 18 | + "busInfoManage_list@busInfoManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'busInfoManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 33 | + ] | |
| 34 | + }); | |
| 35 | + }] | |
| 36 | + } | |
| 37 | + }) | |
| 38 | + .state("busInfoManage_form", { // 添加车辆form | |
| 39 | + url: '/busInfoManage_form', | |
| 40 | + views: { | |
| 41 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'} | |
| 42 | + }, | |
| 43 | + resolve: { | |
| 44 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | + return $ocLazyLoad.load({ | |
| 46 | + name: 'busInfoManage_form_module', | |
| 47 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | + files: [ | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 52 | + ] | |
| 53 | + }); | |
| 54 | + }] | |
| 55 | + } | |
| 56 | + }) | |
| 57 | + .state("busInfoManage_edit", { // 修改车辆form | |
| 58 | + url: '/busInfoManage_edit/:id', | |
| 59 | + views: { | |
| 60 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'} | |
| 61 | + }, | |
| 62 | + resolve: { | |
| 63 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | + return $ocLazyLoad.load({ | |
| 65 | + name: 'busInfoManage_edit_module', | |
| 66 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | + files: [ | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 71 | + ] | |
| 72 | + }); | |
| 73 | + }] | |
| 74 | + } | |
| 75 | + }) | |
| 76 | + .state("busInfoManage_detail", { // 车辆详细信息 | |
| 77 | + url: '/busInfoManage_detail/:id', | |
| 78 | + views: { | |
| 79 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'} | |
| 80 | + }, | |
| 81 | + resolve: { | |
| 82 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | + return $ocLazyLoad.load({ | |
| 84 | + name: 'busInfoManage_detail_module', | |
| 85 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | + files: [ | |
| 87 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 88 | + ] | |
| 89 | + }); | |
| 90 | + }] | |
| 91 | + } | |
| 92 | + }) | |
| 93 | + } | |
| 94 | 94 | ]); |
| 95 | 95 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js
| 1 | -// 设备信息维护 service controller 等写在一起 | |
| 2 | - | |
| 3 | -angular.module('ScheduleApp').factory('DeviceInfoManageService', ['DeviceInfoManageService_g', function(service) { | |
| 4 | - /** 当前的查询条件信息 */ | |
| 5 | - var currentSearchCondition = {}; | |
| 6 | - | |
| 7 | - /** 当前第几页 */ | |
| 8 | - var currentPageNo = 1; | |
| 9 | - | |
| 10 | - return { | |
| 11 | - /** | |
| 12 | - * 获取查询条件信息, | |
| 13 | - * 用于给controller用来和页面数据绑定。 | |
| 14 | - */ | |
| 15 | - getSearchCondition: function() { | |
| 16 | - return currentSearchCondition; | |
| 17 | - }, | |
| 18 | - /** | |
| 19 | - * 重置查询条件信息。 | |
| 20 | - */ | |
| 21 | - resetSearchCondition: function() { | |
| 22 | - var key; | |
| 23 | - for (key in currentSearchCondition) { | |
| 24 | - currentSearchCondition[key] = ""; | |
| 25 | - } | |
| 26 | - }, | |
| 27 | - /** | |
| 28 | - * 设置当前页码。 | |
| 29 | - * @param cpn 从1开始,后台是从0开始的 | |
| 30 | - */ | |
| 31 | - setCurrentPageNo: function(cpn) { | |
| 32 | - currentPageNo = cpn; | |
| 33 | - }, | |
| 34 | - /** | |
| 35 | - * 组装查询参数,返回一个promise查询结果。 | |
| 36 | - * @param params 查询参数 | |
| 37 | - * @return 返回一个 promise | |
| 38 | - */ | |
| 39 | - getPage: function() { | |
| 40 | - var params = currentSearchCondition; // 查询条件 | |
| 41 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | - return service.list(params).$promise; | |
| 43 | - }, | |
| 44 | - /** | |
| 45 | - * 获取明细信息。 | |
| 46 | - * @param id 车辆id | |
| 47 | - * @return 返回一个 promise | |
| 48 | - */ | |
| 49 | - getDetail: function(id) { | |
| 50 | - var params = {id: id}; | |
| 51 | - return service.get(params).$promise; | |
| 52 | - }, | |
| 53 | - /** | |
| 54 | - * 保存信息。 | |
| 55 | - * @param obj 车辆详细信息 | |
| 56 | - * @return 返回一个 promise | |
| 57 | - */ | |
| 58 | - saveDetail: function(obj) { | |
| 59 | - return service.save(obj).$promise; | |
| 60 | - }, | |
| 61 | - /** | |
| 62 | - * 删除信息。 | |
| 63 | - * @param id 主键id | |
| 64 | - * @returns {*|Function|promise|n} | |
| 65 | - */ | |
| 66 | - deleteDetail: function(id) { | |
| 67 | - return service.delete({id: id}).$promise; | |
| 68 | - } | |
| 69 | - }; | |
| 70 | - | |
| 71 | -}]); | |
| 72 | - | |
| 73 | -angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', '$state', function(deviceInfoManageService, $state) { | |
| 74 | - var self = this; | |
| 75 | - | |
| 76 | - // 切换到form状态 | |
| 77 | - self.goForm = function() { | |
| 78 | - //alert("切换"); | |
| 79 | - $state.go("deviceInfoManage_form"); | |
| 80 | - } | |
| 81 | - | |
| 82 | - | |
| 83 | -}]); | |
| 84 | - | |
| 85 | -angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { | |
| 86 | - var self = this; | |
| 87 | - self.pageInfo = { | |
| 88 | - totalItems : 0, | |
| 89 | - currentPage : 1, | |
| 90 | - infos: [] | |
| 91 | - }; | |
| 92 | - | |
| 93 | - // 初始创建的时候,获取一次列表数据 | |
| 94 | - deviceInfoManageService.getPage().then( | |
| 95 | - function(result) { | |
| 96 | - self.pageInfo.totalItems = result.totalElements; | |
| 97 | - self.pageInfo.currentPage = result.number + 1; | |
| 98 | - self.pageInfo.infos = result.content; | |
| 99 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 100 | - }, | |
| 101 | - function(result) { | |
| 102 | - alert("出错啦!"); | |
| 103 | - } | |
| 104 | - ); | |
| 105 | - | |
| 106 | - // 翻页的时候调用 | |
| 107 | - self.pageChanaged = function() { | |
| 108 | - deviceInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 109 | - deviceInfoManageService.getPage().then( | |
| 110 | - function(result) { | |
| 111 | - self.pageInfo.totalItems = result.totalElements; | |
| 112 | - self.pageInfo.currentPage = result.number + 1; | |
| 113 | - self.pageInfo.infos = result.content; | |
| 114 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 115 | - }, | |
| 116 | - function(result) { | |
| 117 | - alert("出错啦!"); | |
| 118 | - } | |
| 119 | - ); | |
| 120 | - }; | |
| 121 | - // 获取查询条件数据 | |
| 122 | - self.searchCondition = function() { | |
| 123 | - return deviceInfoManageService.getSearchCondition(); | |
| 124 | - }; | |
| 125 | - // 重置查询条件 | |
| 126 | - self.resetSearchCondition = function() { | |
| 127 | - deviceInfoManageService.resetSearchCondition(); | |
| 128 | - self.pageInfo.currentPage = 1; | |
| 129 | - self.pageChanaged(); | |
| 130 | - }; | |
| 131 | - | |
| 132 | - // 作废/撤销 | |
| 133 | - self.toggleCde = function(id) { | |
| 134 | - // TODO: | |
| 135 | - deviceInfoManageService.deleteDetail(id).then( | |
| 136 | - function(result) { | |
| 137 | - if (result.message) { // 暂时这样做,之后全局拦截 | |
| 138 | - alert("失败:" + result.message); | |
| 139 | - } else { | |
| 140 | - alert("成功!"); | |
| 141 | - | |
| 142 | - deviceInfoManageService.getPage().then( | |
| 143 | - function(result) { | |
| 144 | - self.pageInfo.totalItems = result.totalElements; | |
| 145 | - self.pageInfo.currentPage = result.number + 1; | |
| 146 | - self.pageInfo.infos = result.content; | |
| 147 | - deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 148 | - }, | |
| 149 | - function(result) { | |
| 150 | - alert("出错啦!"); | |
| 151 | - } | |
| 152 | - ); | |
| 153 | - } | |
| 154 | - | |
| 155 | - }, | |
| 156 | - function(result) { | |
| 157 | - alert("出错啦!" + result); | |
| 158 | - } | |
| 159 | - ); | |
| 160 | - }; | |
| 161 | - | |
| 162 | -}]); | |
| 163 | - | |
| 164 | -angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', '$stateParams', '$state', function(deviceInfoManageService, $stateParams, $state) { | |
| 165 | - var self = this; | |
| 166 | - | |
| 167 | - // 启用日期 日期控件开关 | |
| 168 | - self.qyrqOpen = false; | |
| 169 | - self.qyrq_open = function() { | |
| 170 | - self.qyrqOpen = true; | |
| 171 | - }; | |
| 172 | - | |
| 173 | - // 欲保存的busInfo信息,绑定 | |
| 174 | - self.deviceInfoForSave = {}; | |
| 175 | - | |
| 176 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 177 | - var id = $stateParams.id; | |
| 178 | - if (id) { | |
| 179 | - self.deviceInfoForSave.id = id; | |
| 180 | - deviceInfoManageService.getDetail(id).then( | |
| 181 | - function(result) { | |
| 182 | - var key; | |
| 183 | - for (key in result) { | |
| 184 | - self.deviceInfoForSave[key] = result[key]; | |
| 185 | - } | |
| 186 | - // 填写所有的 select 控件选中框数据 | |
| 187 | - // 公司字典 | |
| 188 | - if (self.deviceInfoForSave.gsName) { | |
| 189 | - angular.forEach(self.gses, function(data) { | |
| 190 | - if (self.deviceInfoForSave.gsName == data.gsmc) { | |
| 191 | - self.deviceInfoForSave.gs_selected = data; | |
| 192 | - } | |
| 193 | - }); | |
| 194 | - } | |
| 195 | - }, | |
| 196 | - function(result) { | |
| 197 | - alert("出错啦!"); | |
| 198 | - } | |
| 199 | - ); | |
| 200 | - } | |
| 201 | - | |
| 202 | - // 提交方法 | |
| 203 | - self.submit = function() { | |
| 204 | - console.log(self.deviceInfoForSave); | |
| 205 | - deviceInfoManageService.saveDetail(self.deviceInfoForSave).then( | |
| 206 | - function(result) { | |
| 207 | - // TODO:弹出框方式以后改 | |
| 208 | - if (result.status == 'SUCCESS') { | |
| 209 | - alert("保存成功!"); | |
| 210 | - $state.go("deviceInfoManage"); | |
| 211 | - } else { | |
| 212 | - alert("保存异常!"); | |
| 213 | - } | |
| 214 | - }, | |
| 215 | - function(result) { | |
| 216 | - // TODO:弹出框方式以后改 | |
| 217 | - alert("出错啦!"); | |
| 218 | - } | |
| 219 | - ); | |
| 220 | - }; | |
| 221 | - | |
| 222 | -}]); | |
| 223 | - | |
| 224 | -angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', '$stateParams', function(deviceInfoManageService, $stateParams) { | |
| 225 | - var self = this; | |
| 226 | - self.title = ""; | |
| 227 | - self.deviceInfoForDetail = {}; | |
| 228 | - self.deviceInfoForDetail.id = $stateParams.id; | |
| 229 | - | |
| 230 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 231 | - deviceInfoManageService.getDetail($stateParams.id).then( | |
| 232 | - function(result) { | |
| 233 | - var key; | |
| 234 | - for (key in result) { | |
| 235 | - self.deviceInfoForDetail[key] = result[key]; | |
| 236 | - } | |
| 237 | - | |
| 238 | - self.title = "车辆 " + self.deviceInfoForDetail.clZbh + "设备信息"; | |
| 239 | - }, | |
| 240 | - function(result) { | |
| 241 | - // TODO:弹出框方式以后改 | |
| 242 | - alert("出错啦!"); | |
| 243 | - } | |
| 244 | - ); | |
| 1 | +// 设备信息维护 service controller 等写在一起 | |
| 2 | + | |
| 3 | +angular.module('ScheduleApp').factory('DeviceInfoManageService', ['DeviceInfoManageService_g', function(service) { | |
| 4 | + /** 当前的查询条件信息 */ | |
| 5 | + var currentSearchCondition = {}; | |
| 6 | + | |
| 7 | + /** 当前第几页 */ | |
| 8 | + var currentPageNo = 1; | |
| 9 | + | |
| 10 | + return { | |
| 11 | + /** | |
| 12 | + * 获取查询条件信息, | |
| 13 | + * 用于给controller用来和页面数据绑定。 | |
| 14 | + */ | |
| 15 | + getSearchCondition: function() { | |
| 16 | + return currentSearchCondition; | |
| 17 | + }, | |
| 18 | + /** | |
| 19 | + * 重置查询条件信息。 | |
| 20 | + */ | |
| 21 | + resetSearchCondition: function() { | |
| 22 | + var key; | |
| 23 | + for (key in currentSearchCondition) { | |
| 24 | + currentSearchCondition[key] = ""; | |
| 25 | + } | |
| 26 | + }, | |
| 27 | + /** | |
| 28 | + * 设置当前页码。 | |
| 29 | + * @param cpn 从1开始,后台是从0开始的 | |
| 30 | + */ | |
| 31 | + setCurrentPageNo: function(cpn) { | |
| 32 | + currentPageNo = cpn; | |
| 33 | + }, | |
| 34 | + /** | |
| 35 | + * 组装查询参数,返回一个promise查询结果。 | |
| 36 | + * @param params 查询参数 | |
| 37 | + * @return 返回一个 promise | |
| 38 | + */ | |
| 39 | + getPage: function() { | |
| 40 | + var params = currentSearchCondition; // 查询条件 | |
| 41 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | + return service.list(params).$promise; | |
| 43 | + }, | |
| 44 | + /** | |
| 45 | + * 获取明细信息。 | |
| 46 | + * @param id 车辆id | |
| 47 | + * @return 返回一个 promise | |
| 48 | + */ | |
| 49 | + getDetail: function(id) { | |
| 50 | + var params = {id: id}; | |
| 51 | + return service.get(params).$promise; | |
| 52 | + }, | |
| 53 | + /** | |
| 54 | + * 保存信息。 | |
| 55 | + * @param obj 车辆详细信息 | |
| 56 | + * @return 返回一个 promise | |
| 57 | + */ | |
| 58 | + saveDetail: function(obj) { | |
| 59 | + return service.save(obj).$promise; | |
| 60 | + }, | |
| 61 | + /** | |
| 62 | + * 删除信息。 | |
| 63 | + * @param id 主键id | |
| 64 | + * @returns {*|Function|promise|n} | |
| 65 | + */ | |
| 66 | + deleteDetail: function(id) { | |
| 67 | + return service.delete({id: id}).$promise; | |
| 68 | + } | |
| 69 | + }; | |
| 70 | + | |
| 71 | +}]); | |
| 72 | + | |
| 73 | +angular.module('ScheduleApp').controller('DeviceInfoManageCtrl', ['DeviceInfoManageService', '$state', function(deviceInfoManageService, $state) { | |
| 74 | + var self = this; | |
| 75 | + | |
| 76 | + // 切换到form状态 | |
| 77 | + self.goForm = function() { | |
| 78 | + //alert("切换"); | |
| 79 | + $state.go("deviceInfoManage_form"); | |
| 80 | + } | |
| 81 | + | |
| 82 | + | |
| 83 | +}]); | |
| 84 | + | |
| 85 | +angular.module('ScheduleApp').controller('DeviceInfoManageListCtrl', ['DeviceInfoManageService', function(deviceInfoManageService) { | |
| 86 | + var self = this; | |
| 87 | + self.pageInfo = { | |
| 88 | + totalItems : 0, | |
| 89 | + currentPage : 1, | |
| 90 | + infos: [] | |
| 91 | + }; | |
| 92 | + | |
| 93 | + // 初始创建的时候,获取一次列表数据 | |
| 94 | + deviceInfoManageService.getPage().then( | |
| 95 | + function(result) { | |
| 96 | + self.pageInfo.totalItems = result.totalElements; | |
| 97 | + self.pageInfo.currentPage = result.number + 1; | |
| 98 | + self.pageInfo.infos = result.content; | |
| 99 | + deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 100 | + }, | |
| 101 | + function(result) { | |
| 102 | + alert("出错啦!"); | |
| 103 | + } | |
| 104 | + ); | |
| 105 | + | |
| 106 | + // 翻页的时候调用 | |
| 107 | + self.pageChanaged = function() { | |
| 108 | + deviceInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 109 | + deviceInfoManageService.getPage().then( | |
| 110 | + function(result) { | |
| 111 | + self.pageInfo.totalItems = result.totalElements; | |
| 112 | + self.pageInfo.currentPage = result.number + 1; | |
| 113 | + self.pageInfo.infos = result.content; | |
| 114 | + deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 115 | + }, | |
| 116 | + function(result) { | |
| 117 | + alert("出错啦!"); | |
| 118 | + } | |
| 119 | + ); | |
| 120 | + }; | |
| 121 | + // 获取查询条件数据 | |
| 122 | + self.searchCondition = function() { | |
| 123 | + return deviceInfoManageService.getSearchCondition(); | |
| 124 | + }; | |
| 125 | + // 重置查询条件 | |
| 126 | + self.resetSearchCondition = function() { | |
| 127 | + deviceInfoManageService.resetSearchCondition(); | |
| 128 | + self.pageInfo.currentPage = 1; | |
| 129 | + self.pageChanaged(); | |
| 130 | + }; | |
| 131 | + | |
| 132 | + // 作废/撤销 | |
| 133 | + self.toggleCde = function(id) { | |
| 134 | + // TODO: | |
| 135 | + deviceInfoManageService.deleteDetail(id).then( | |
| 136 | + function(result) { | |
| 137 | + if (result.message) { // 暂时这样做,之后全局拦截 | |
| 138 | + alert("失败:" + result.message); | |
| 139 | + } else { | |
| 140 | + alert("成功!"); | |
| 141 | + | |
| 142 | + deviceInfoManageService.getPage().then( | |
| 143 | + function(result) { | |
| 144 | + self.pageInfo.totalItems = result.totalElements; | |
| 145 | + self.pageInfo.currentPage = result.number + 1; | |
| 146 | + self.pageInfo.infos = result.content; | |
| 147 | + deviceInfoManageService.setCurrentPageNo(result.number + 1); | |
| 148 | + }, | |
| 149 | + function(result) { | |
| 150 | + alert("出错啦!"); | |
| 151 | + } | |
| 152 | + ); | |
| 153 | + } | |
| 154 | + | |
| 155 | + }, | |
| 156 | + function(result) { | |
| 157 | + alert("出错啦!" + result); | |
| 158 | + } | |
| 159 | + ); | |
| 160 | + }; | |
| 161 | + | |
| 162 | +}]); | |
| 163 | + | |
| 164 | +angular.module('ScheduleApp').controller('DeviceInfoManageFormCtrl', ['DeviceInfoManageService', '$stateParams', '$state', function(deviceInfoManageService, $stateParams, $state) { | |
| 165 | + var self = this; | |
| 166 | + | |
| 167 | + // 启用日期 日期控件开关 | |
| 168 | + self.qyrqOpen = false; | |
| 169 | + self.qyrq_open = function() { | |
| 170 | + self.qyrqOpen = true; | |
| 171 | + }; | |
| 172 | + | |
| 173 | + // 欲保存的busInfo信息,绑定 | |
| 174 | + self.deviceInfoForSave = {}; | |
| 175 | + | |
| 176 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 177 | + var id = $stateParams.id; | |
| 178 | + if (id) { | |
| 179 | + self.deviceInfoForSave.id = id; | |
| 180 | + deviceInfoManageService.getDetail(id).then( | |
| 181 | + function(result) { | |
| 182 | + var key; | |
| 183 | + for (key in result) { | |
| 184 | + self.deviceInfoForSave[key] = result[key]; | |
| 185 | + } | |
| 186 | + // 填写所有的 select 控件选中框数据 | |
| 187 | + // 公司字典 | |
| 188 | + if (self.deviceInfoForSave.gsName) { | |
| 189 | + angular.forEach(self.gses, function(data) { | |
| 190 | + if (self.deviceInfoForSave.gsName == data.gsmc) { | |
| 191 | + self.deviceInfoForSave.gs_selected = data; | |
| 192 | + } | |
| 193 | + }); | |
| 194 | + } | |
| 195 | + }, | |
| 196 | + function(result) { | |
| 197 | + alert("出错啦!"); | |
| 198 | + } | |
| 199 | + ); | |
| 200 | + } | |
| 201 | + | |
| 202 | + // 提交方法 | |
| 203 | + self.submit = function() { | |
| 204 | + console.log(self.deviceInfoForSave); | |
| 205 | + deviceInfoManageService.saveDetail(self.deviceInfoForSave).then( | |
| 206 | + function(result) { | |
| 207 | + // TODO:弹出框方式以后改 | |
| 208 | + if (result.status == 'SUCCESS') { | |
| 209 | + alert("保存成功!"); | |
| 210 | + $state.go("deviceInfoManage"); | |
| 211 | + } else { | |
| 212 | + alert("保存异常!"); | |
| 213 | + } | |
| 214 | + }, | |
| 215 | + function(result) { | |
| 216 | + // TODO:弹出框方式以后改 | |
| 217 | + alert("出错啦!"); | |
| 218 | + } | |
| 219 | + ); | |
| 220 | + }; | |
| 221 | + | |
| 222 | +}]); | |
| 223 | + | |
| 224 | +angular.module('ScheduleApp').controller('DeviceInfoManageDetailCtrl', ['DeviceInfoManageService', '$stateParams', function(deviceInfoManageService, $stateParams) { | |
| 225 | + var self = this; | |
| 226 | + self.title = ""; | |
| 227 | + self.deviceInfoForDetail = {}; | |
| 228 | + self.deviceInfoForDetail.id = $stateParams.id; | |
| 229 | + | |
| 230 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 231 | + deviceInfoManageService.getDetail($stateParams.id).then( | |
| 232 | + function(result) { | |
| 233 | + var key; | |
| 234 | + for (key in result) { | |
| 235 | + self.deviceInfoForDetail[key] = result[key]; | |
| 236 | + } | |
| 237 | + | |
| 238 | + self.title = "车辆 " + self.deviceInfoForDetail.clZbh + "设备信息"; | |
| 239 | + }, | |
| 240 | + function(result) { | |
| 241 | + // TODO:弹出框方式以后改 | |
| 242 | + alert("出错啦!"); | |
| 243 | + } | |
| 244 | + ); | |
| 245 | 245 | }]); |
| 246 | 246 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/deviceInfoManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 车辆设备信息模块配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("deviceInfoManage", { // index页面 | |
| 13 | - url: '/deviceInfoManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html' | |
| 17 | - }, | |
| 18 | - "deviceInfoManage_list@deviceInfoManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'deviceInfoManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 32 | - ] | |
| 33 | - }); | |
| 34 | - }] | |
| 35 | - } | |
| 36 | - }) | |
| 37 | - .state("deviceInfoManage_form", { // 添加设备信息form | |
| 38 | - url: '/deviceInfoManage_form', | |
| 39 | - views: { | |
| 40 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'} | |
| 41 | - }, | |
| 42 | - resolve: { | |
| 43 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | - return $ocLazyLoad.load({ | |
| 45 | - name: 'deviceInfoManage_form_module', | |
| 46 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | - files: [ | |
| 48 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 51 | - ] | |
| 52 | - }); | |
| 53 | - }] | |
| 54 | - } | |
| 55 | - }) | |
| 56 | - .state("deviceInfoManage_edit", { // 修改设备信息form | |
| 57 | - url: '/deviceInfoManage_edit/:id', | |
| 58 | - views: { | |
| 59 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'} | |
| 60 | - }, | |
| 61 | - resolve: { | |
| 62 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | - return $ocLazyLoad.load({ | |
| 64 | - name: 'deviceInfoManage_edit_module', | |
| 65 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | - files: [ | |
| 67 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 70 | - ] | |
| 71 | - }); | |
| 72 | - }] | |
| 73 | - } | |
| 74 | - }) | |
| 75 | - .state("deviceInfoManage_detail", { // 详细信息页面 | |
| 76 | - url: '/deviceInfoManage_detail/:id', | |
| 77 | - views: { | |
| 78 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'} | |
| 79 | - }, | |
| 80 | - resolve: { | |
| 81 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | - return $ocLazyLoad.load({ | |
| 83 | - name: 'deviceInfoManage_detail_module', | |
| 84 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | - files: [ | |
| 86 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 87 | - ] | |
| 88 | - }); | |
| 89 | - }] | |
| 90 | - } | |
| 91 | - }) | |
| 92 | - | |
| 93 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 车辆设备信息模块配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("deviceInfoManage", { // index页面 | |
| 13 | + url: '/deviceInfoManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html' | |
| 17 | + }, | |
| 18 | + "deviceInfoManage_list@deviceInfoManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'deviceInfoManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 32 | + ] | |
| 33 | + }); | |
| 34 | + }] | |
| 35 | + } | |
| 36 | + }) | |
| 37 | + .state("deviceInfoManage_form", { // 添加设备信息form | |
| 38 | + url: '/deviceInfoManage_form', | |
| 39 | + views: { | |
| 40 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'} | |
| 41 | + }, | |
| 42 | + resolve: { | |
| 43 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | + return $ocLazyLoad.load({ | |
| 45 | + name: 'deviceInfoManage_form_module', | |
| 46 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | + files: [ | |
| 48 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 51 | + ] | |
| 52 | + }); | |
| 53 | + }] | |
| 54 | + } | |
| 55 | + }) | |
| 56 | + .state("deviceInfoManage_edit", { // 修改设备信息form | |
| 57 | + url: '/deviceInfoManage_edit/:id', | |
| 58 | + views: { | |
| 59 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'} | |
| 60 | + }, | |
| 61 | + resolve: { | |
| 62 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | + return $ocLazyLoad.load({ | |
| 64 | + name: 'deviceInfoManage_edit_module', | |
| 65 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | + files: [ | |
| 67 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 70 | + ] | |
| 71 | + }); | |
| 72 | + }] | |
| 73 | + } | |
| 74 | + }) | |
| 75 | + .state("deviceInfoManage_detail", { // 详细信息页面 | |
| 76 | + url: '/deviceInfoManage_detail/:id', | |
| 77 | + views: { | |
| 78 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'} | |
| 79 | + }, | |
| 80 | + resolve: { | |
| 81 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | + return $ocLazyLoad.load({ | |
| 83 | + name: 'deviceInfoManage_detail_module', | |
| 84 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | + files: [ | |
| 86 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 87 | + ] | |
| 88 | + }); | |
| 89 | + }] | |
| 90 | + } | |
| 91 | + }) | |
| 92 | + | |
| 93 | + } | |
| 94 | 94 | ]); |
| 95 | 95 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js
| 1 | -// 人员信息管理 service controller等写在一起 | |
| 2 | - | |
| 3 | -angular.module('ScheduleApp').factory('EmployeeInfoManageService', ['EmployeeInfoManageService_g', function(service) { | |
| 4 | - | |
| 5 | - /** 当前的查询条件信息 */ | |
| 6 | - var currentSearchCondition = { | |
| 7 | - //"carCode_like" : "", | |
| 8 | - //"insideCode_like" : "", | |
| 9 | - //"equipmentCode_like" : "", | |
| 10 | - //"carPlate_like" : "" | |
| 11 | - }; | |
| 12 | - | |
| 13 | - /** 当前第几页 */ | |
| 14 | - var currentPageNo = 1; | |
| 15 | - | |
| 16 | - return { | |
| 17 | - /** | |
| 18 | - * 获取查询条件信息, | |
| 19 | - * 用于给controller用来和页面数据绑定。 | |
| 20 | - */ | |
| 21 | - getSearchCondition: function() { | |
| 22 | - return currentSearchCondition; | |
| 23 | - }, | |
| 24 | - /** | |
| 25 | - * 重置查询条件信息。 | |
| 26 | - */ | |
| 27 | - resetSearchCondition: function() { | |
| 28 | - var key; | |
| 29 | - for (key in currentSearchCondition) { | |
| 30 | - currentSearchCondition[key] = undefined; | |
| 31 | - } | |
| 32 | - currentPageNo = 1; | |
| 33 | - }, | |
| 34 | - /** | |
| 35 | - * 设置当前页码。 | |
| 36 | - * @param cpn 从1开始,后台是从0开始的 | |
| 37 | - */ | |
| 38 | - setCurrentPageNo: function(cpn) { | |
| 39 | - currentPageNo = cpn; | |
| 40 | - }, | |
| 41 | - /** | |
| 42 | - * 组装查询参数,返回一个promise查询结果。 | |
| 43 | - * @param params 查询参数 | |
| 44 | - * @return 返回一个 promise | |
| 45 | - */ | |
| 46 | - getPage: function() { | |
| 47 | - var params = currentSearchCondition; // 查询条件 | |
| 48 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 49 | - return service.rest.list(params).$promise; | |
| 50 | - }, | |
| 51 | - /** | |
| 52 | - * 获取明细信息。 | |
| 53 | - * @param id 车辆id | |
| 54 | - * @return 返回一个 promise | |
| 55 | - */ | |
| 56 | - getDetail: function(id) { | |
| 57 | - var params = {id: id}; | |
| 58 | - return service.rest.get(params).$promise; | |
| 59 | - }, | |
| 60 | - /** | |
| 61 | - * 保存信息。 | |
| 62 | - * @param obj 车辆详细信息 | |
| 63 | - * @return 返回一个 promise | |
| 64 | - */ | |
| 65 | - saveDetail: function(obj) { | |
| 66 | - return service.rest.save(obj).$promise; | |
| 67 | - }, | |
| 68 | - /** | |
| 69 | - * 数据导出。 | |
| 70 | - * @returns {*|Function|promise|n} | |
| 71 | - */ | |
| 72 | - dataExport: function() { | |
| 73 | - return service.dataTools.dataExport().$promise; | |
| 74 | - } | |
| 75 | - } | |
| 76 | - | |
| 77 | -}]); | |
| 78 | - | |
| 79 | -angular.module('ScheduleApp').controller('EmployeeInfoManageCtrl', [ | |
| 80 | - 'EmployeeInfoManageService', '$state', '$uibModal', 'FileDownload_g', | |
| 81 | - function(employeeInfoManageService, $state, $uibModal, fileDownload) { | |
| 82 | - var self = this; | |
| 83 | - | |
| 84 | - // 切换到form状态 | |
| 85 | - self.goForm = function() { | |
| 86 | - //alert("切换"); | |
| 87 | - $state.go("employeeInfoManage_form"); | |
| 88 | - } | |
| 89 | - | |
| 90 | - // 导入excel | |
| 91 | - self.importData = function() { | |
| 92 | - // large方式弹出模态对话框 | |
| 93 | - var modalInstance = $uibModal.open({ | |
| 94 | - templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html', | |
| 95 | - size: "lg", | |
| 96 | - animation: true, | |
| 97 | - backdrop: 'static', | |
| 98 | - resolve: { | |
| 99 | - // 可以传值给controller | |
| 100 | - }, | |
| 101 | - windowClass: 'center-modal', | |
| 102 | - controller: "EmployInfoManageToolsCtrl", | |
| 103 | - controllerAs: "ctrl", | |
| 104 | - bindToController: true | |
| 105 | - }); | |
| 106 | - modalInstance.result.then( | |
| 107 | - function() { | |
| 108 | - console.log("dataImport.html打开"); | |
| 109 | - }, | |
| 110 | - function() { | |
| 111 | - console.log("dataImport.html消失"); | |
| 112 | - } | |
| 113 | - ); | |
| 114 | - }; | |
| 115 | - | |
| 116 | - // 导出excel | |
| 117 | - self.exportData = function() { | |
| 118 | - employeeInfoManageService.dataExport().then( | |
| 119 | - function(result) { | |
| 120 | - fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls"); | |
| 121 | - }, | |
| 122 | - function(result) { | |
| 123 | - console.log("exportData failed:" + result); | |
| 124 | - } | |
| 125 | - ); | |
| 126 | - }; | |
| 127 | - }]); | |
| 128 | - | |
| 129 | -angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 130 | - var self = this; | |
| 131 | - | |
| 132 | - // 关闭窗口 | |
| 133 | - self.close = function() { | |
| 134 | - $modalInstance.dismiss("cancel"); | |
| 135 | - }; | |
| 136 | - | |
| 137 | - self.clearInputFile = function() { | |
| 138 | - angular.element("input[type='file']").val(null); | |
| 139 | - }; | |
| 140 | - | |
| 141 | - // 上传文件组件 | |
| 142 | - self.uploader = new FileUploader({ | |
| 143 | - url: "/personnel/dataImport", | |
| 144 | - filters: [] // 用于过滤文件,比如只允许导入excel | |
| 145 | - }); | |
| 146 | - self.uploader.onAfterAddingFile = function(fileItem) | |
| 147 | - { | |
| 148 | - console.info('onAfterAddingFile', fileItem); | |
| 149 | - console.log(self.uploader.queue.length); | |
| 150 | - if (self.uploader.queue.length > 1) | |
| 151 | - self.uploader.removeFromQueue(0); | |
| 152 | - }; | |
| 153 | - self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 154 | - { | |
| 155 | - console.info('onSuccessItem', fileItem, response, status, headers); | |
| 156 | - }; | |
| 157 | - self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 158 | - { | |
| 159 | - console.info('onErrorItem', fileItem, response, status, headers); | |
| 160 | - }; | |
| 161 | - | |
| 162 | -}]); | |
| 163 | - | |
| 164 | -angular.module('ScheduleApp').controller('EmployeeInfoManageListCtrl', ['EmployeeInfoManageService', function(employeeInfoManageService) { | |
| 165 | - var self = this; | |
| 166 | - self.pageInfo = { | |
| 167 | - totalItems : 0, | |
| 168 | - currentPage : 1, | |
| 169 | - infos: [] | |
| 170 | - }; | |
| 171 | - | |
| 172 | - // 初始创建的时候,获取一次列表数据 | |
| 173 | - employeeInfoManageService.getPage().then( | |
| 174 | - function(result) { | |
| 175 | - self.pageInfo.totalItems = result.totalElements; | |
| 176 | - self.pageInfo.currentPage = result.number + 1; | |
| 177 | - self.pageInfo.infos = result.content; | |
| 178 | - employeeInfoManageService.setCurrentPageNo(result.number + 1); | |
| 179 | - }, | |
| 180 | - function(result) { | |
| 181 | - alert("出错啦!"); | |
| 182 | - } | |
| 183 | - ); | |
| 184 | - | |
| 185 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 186 | - // alert("dfdfdf"); | |
| 187 | - //}); | |
| 188 | - | |
| 189 | - // 翻页的时候调用 | |
| 190 | - self.pageChanaged = function() { | |
| 191 | - employeeInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 192 | - employeeInfoManageService.getPage().then( | |
| 193 | - function(result) { | |
| 194 | - self.pageInfo.totalItems = result.totalElements; | |
| 195 | - self.pageInfo.currentPage = result.number + 1; | |
| 196 | - self.pageInfo.infos = result.content; | |
| 197 | - employeeInfoManageService.setCurrentPageNo(result.number + 1); | |
| 198 | - }, | |
| 199 | - function(result) { | |
| 200 | - alert("出错啦!"); | |
| 201 | - } | |
| 202 | - ); | |
| 203 | - }; | |
| 204 | - // 获取查询条件数据 | |
| 205 | - self.searchCondition = function() { | |
| 206 | - return employeeInfoManageService.getSearchCondition(); | |
| 207 | - }; | |
| 208 | - // 重置查询条件 | |
| 209 | - self.resetSearchCondition = function() { | |
| 210 | - employeeInfoManageService.resetSearchCondition(); | |
| 211 | - self.pageInfo.currentPage = 1; | |
| 212 | - self.pageChanaged(); | |
| 213 | - }; | |
| 214 | -}]); | |
| 215 | - | |
| 216 | -angular.module('ScheduleApp').controller('EmployeeInfoManageFormCtrl', ['EmployeeInfoManageService', '$stateParams', '$state', function(employeeInfoManageService, $stateParams, $state) { | |
| 217 | - var self = this; | |
| 218 | - | |
| 219 | - // 欲保存的busInfo信息,绑定 | |
| 220 | - self.employeeInfoForSave = {}; | |
| 221 | - | |
| 222 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 223 | - var id = $stateParams.id; | |
| 224 | - if (id) { | |
| 225 | - self.employeeInfoForSave.id = id; | |
| 226 | - employeeInfoManageService.getDetail(id).then( | |
| 227 | - function(result) { | |
| 228 | - var key; | |
| 229 | - for (key in result) { | |
| 230 | - self.employeeInfoForSave[key] = result[key]; | |
| 231 | - } | |
| 232 | - }, | |
| 233 | - function(result) { | |
| 234 | - alert("出错啦!"); | |
| 235 | - } | |
| 236 | - ); | |
| 237 | - } | |
| 238 | - | |
| 239 | - // 提交方法 | |
| 240 | - self.submit = function() { | |
| 241 | - console.log(self.employeeInfoForSave); | |
| 242 | - employeeInfoManageService.saveDetail(self.employeeInfoForSave).then( | |
| 243 | - function(result) { | |
| 244 | - // TODO:弹出框方式以后改 | |
| 245 | - if (result.status == 'SUCCESS') { | |
| 246 | - alert("保存成功!"); | |
| 247 | - $state.go("employeeInfoManage"); | |
| 248 | - } else { | |
| 249 | - alert("保存异常!"); | |
| 250 | - } | |
| 251 | - }, | |
| 252 | - function(result) { | |
| 253 | - // TODO:弹出框方式以后改 | |
| 254 | - alert("出错啦!"); | |
| 255 | - } | |
| 256 | - ); | |
| 257 | - }; | |
| 258 | - | |
| 259 | - | |
| 260 | -}]); | |
| 261 | - | |
| 262 | -angular.module('ScheduleApp').controller('EmployeeInfoManageDetailCtrl', ['EmployeeInfoManageService', '$stateParams', function(employeeInfoManageService, $stateParams) { | |
| 263 | - var self = this; | |
| 264 | - self.title = ""; | |
| 265 | - self.employeeInfoForDetail = {}; | |
| 266 | - self.employeeInfoForDetail.id = $stateParams.id; | |
| 267 | - | |
| 268 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 269 | - employeeInfoManageService.getDetail($stateParams.id).then( | |
| 270 | - function(result) { | |
| 271 | - var key; | |
| 272 | - for (key in result) { | |
| 273 | - self.employeeInfoForDetail[key] = result[key]; | |
| 274 | - } | |
| 275 | - | |
| 276 | - self.title = "员工 " + self.employeeInfoForDetail.personnelName + " 详细信息"; | |
| 277 | - }, | |
| 278 | - function(result) { | |
| 279 | - // TODO:弹出框方式以后改 | |
| 280 | - alert("出错啦!"); | |
| 281 | - } | |
| 282 | - ); | |
| 283 | -}]); | |
| 284 | - | |
| 1 | +// 人员信息管理 service controller等写在一起 | |
| 2 | + | |
| 3 | +angular.module('ScheduleApp').factory('EmployeeInfoManageService', ['EmployeeInfoManageService_g', function(service) { | |
| 4 | + | |
| 5 | + /** 当前的查询条件信息 */ | |
| 6 | + var currentSearchCondition = { | |
| 7 | + //"carCode_like" : "", | |
| 8 | + //"insideCode_like" : "", | |
| 9 | + //"equipmentCode_like" : "", | |
| 10 | + //"carPlate_like" : "" | |
| 11 | + }; | |
| 12 | + | |
| 13 | + /** 当前第几页 */ | |
| 14 | + var currentPageNo = 1; | |
| 15 | + | |
| 16 | + return { | |
| 17 | + /** | |
| 18 | + * 获取查询条件信息, | |
| 19 | + * 用于给controller用来和页面数据绑定。 | |
| 20 | + */ | |
| 21 | + getSearchCondition: function() { | |
| 22 | + return currentSearchCondition; | |
| 23 | + }, | |
| 24 | + /** | |
| 25 | + * 重置查询条件信息。 | |
| 26 | + */ | |
| 27 | + resetSearchCondition: function() { | |
| 28 | + var key; | |
| 29 | + for (key in currentSearchCondition) { | |
| 30 | + currentSearchCondition[key] = undefined; | |
| 31 | + } | |
| 32 | + currentPageNo = 1; | |
| 33 | + }, | |
| 34 | + /** | |
| 35 | + * 设置当前页码。 | |
| 36 | + * @param cpn 从1开始,后台是从0开始的 | |
| 37 | + */ | |
| 38 | + setCurrentPageNo: function(cpn) { | |
| 39 | + currentPageNo = cpn; | |
| 40 | + }, | |
| 41 | + /** | |
| 42 | + * 组装查询参数,返回一个promise查询结果。 | |
| 43 | + * @param params 查询参数 | |
| 44 | + * @return 返回一个 promise | |
| 45 | + */ | |
| 46 | + getPage: function() { | |
| 47 | + var params = currentSearchCondition; // 查询条件 | |
| 48 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 49 | + return service.rest.list(params).$promise; | |
| 50 | + }, | |
| 51 | + /** | |
| 52 | + * 获取明细信息。 | |
| 53 | + * @param id 车辆id | |
| 54 | + * @return 返回一个 promise | |
| 55 | + */ | |
| 56 | + getDetail: function(id) { | |
| 57 | + var params = {id: id}; | |
| 58 | + return service.rest.get(params).$promise; | |
| 59 | + }, | |
| 60 | + /** | |
| 61 | + * 保存信息。 | |
| 62 | + * @param obj 车辆详细信息 | |
| 63 | + * @return 返回一个 promise | |
| 64 | + */ | |
| 65 | + saveDetail: function(obj) { | |
| 66 | + return service.rest.save(obj).$promise; | |
| 67 | + }, | |
| 68 | + /** | |
| 69 | + * 数据导出。 | |
| 70 | + * @returns {*|Function|promise|n} | |
| 71 | + */ | |
| 72 | + dataExport: function() { | |
| 73 | + return service.dataTools.dataExport().$promise; | |
| 74 | + } | |
| 75 | + } | |
| 76 | + | |
| 77 | +}]); | |
| 78 | + | |
| 79 | +angular.module('ScheduleApp').controller('EmployeeInfoManageCtrl', [ | |
| 80 | + 'EmployeeInfoManageService', '$state', '$uibModal', 'FileDownload_g', | |
| 81 | + function(employeeInfoManageService, $state, $uibModal, fileDownload) { | |
| 82 | + var self = this; | |
| 83 | + | |
| 84 | + // 切换到form状态 | |
| 85 | + self.goForm = function() { | |
| 86 | + //alert("切换"); | |
| 87 | + $state.go("employeeInfoManage_form"); | |
| 88 | + } | |
| 89 | + | |
| 90 | + // 导入excel | |
| 91 | + self.importData = function() { | |
| 92 | + // large方式弹出模态对话框 | |
| 93 | + var modalInstance = $uibModal.open({ | |
| 94 | + templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html', | |
| 95 | + size: "lg", | |
| 96 | + animation: true, | |
| 97 | + backdrop: 'static', | |
| 98 | + resolve: { | |
| 99 | + // 可以传值给controller | |
| 100 | + }, | |
| 101 | + windowClass: 'center-modal', | |
| 102 | + controller: "EmployInfoManageToolsCtrl", | |
| 103 | + controllerAs: "ctrl", | |
| 104 | + bindToController: true | |
| 105 | + }); | |
| 106 | + modalInstance.result.then( | |
| 107 | + function() { | |
| 108 | + console.log("dataImport.html打开"); | |
| 109 | + }, | |
| 110 | + function() { | |
| 111 | + console.log("dataImport.html消失"); | |
| 112 | + } | |
| 113 | + ); | |
| 114 | + }; | |
| 115 | + | |
| 116 | + // 导出excel | |
| 117 | + self.exportData = function() { | |
| 118 | + employeeInfoManageService.dataExport().then( | |
| 119 | + function(result) { | |
| 120 | + fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls"); | |
| 121 | + }, | |
| 122 | + function(result) { | |
| 123 | + console.log("exportData failed:" + result); | |
| 124 | + } | |
| 125 | + ); | |
| 126 | + }; | |
| 127 | + }]); | |
| 128 | + | |
| 129 | +angular.module('ScheduleApp').controller('EmployInfoManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 130 | + var self = this; | |
| 131 | + | |
| 132 | + // 关闭窗口 | |
| 133 | + self.close = function() { | |
| 134 | + $modalInstance.dismiss("cancel"); | |
| 135 | + }; | |
| 136 | + | |
| 137 | + self.clearInputFile = function() { | |
| 138 | + angular.element("input[type='file']").val(null); | |
| 139 | + }; | |
| 140 | + | |
| 141 | + // 上传文件组件 | |
| 142 | + self.uploader = new FileUploader({ | |
| 143 | + url: "/personnel/dataImport", | |
| 144 | + filters: [] // 用于过滤文件,比如只允许导入excel | |
| 145 | + }); | |
| 146 | + self.uploader.onAfterAddingFile = function(fileItem) | |
| 147 | + { | |
| 148 | + console.info('onAfterAddingFile', fileItem); | |
| 149 | + console.log(self.uploader.queue.length); | |
| 150 | + if (self.uploader.queue.length > 1) | |
| 151 | + self.uploader.removeFromQueue(0); | |
| 152 | + }; | |
| 153 | + self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 154 | + { | |
| 155 | + console.info('onSuccessItem', fileItem, response, status, headers); | |
| 156 | + }; | |
| 157 | + self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 158 | + { | |
| 159 | + console.info('onErrorItem', fileItem, response, status, headers); | |
| 160 | + }; | |
| 161 | + | |
| 162 | +}]); | |
| 163 | + | |
| 164 | +angular.module('ScheduleApp').controller('EmployeeInfoManageListCtrl', ['EmployeeInfoManageService', function(employeeInfoManageService) { | |
| 165 | + var self = this; | |
| 166 | + self.pageInfo = { | |
| 167 | + totalItems : 0, | |
| 168 | + currentPage : 1, | |
| 169 | + infos: [] | |
| 170 | + }; | |
| 171 | + | |
| 172 | + // 初始创建的时候,获取一次列表数据 | |
| 173 | + employeeInfoManageService.getPage().then( | |
| 174 | + function(result) { | |
| 175 | + self.pageInfo.totalItems = result.totalElements; | |
| 176 | + self.pageInfo.currentPage = result.number + 1; | |
| 177 | + self.pageInfo.infos = result.content; | |
| 178 | + employeeInfoManageService.setCurrentPageNo(result.number + 1); | |
| 179 | + }, | |
| 180 | + function(result) { | |
| 181 | + alert("出错啦!"); | |
| 182 | + } | |
| 183 | + ); | |
| 184 | + | |
| 185 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 186 | + // alert("dfdfdf"); | |
| 187 | + //}); | |
| 188 | + | |
| 189 | + // 翻页的时候调用 | |
| 190 | + self.pageChanaged = function() { | |
| 191 | + employeeInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 192 | + employeeInfoManageService.getPage().then( | |
| 193 | + function(result) { | |
| 194 | + self.pageInfo.totalItems = result.totalElements; | |
| 195 | + self.pageInfo.currentPage = result.number + 1; | |
| 196 | + self.pageInfo.infos = result.content; | |
| 197 | + employeeInfoManageService.setCurrentPageNo(result.number + 1); | |
| 198 | + }, | |
| 199 | + function(result) { | |
| 200 | + alert("出错啦!"); | |
| 201 | + } | |
| 202 | + ); | |
| 203 | + }; | |
| 204 | + // 获取查询条件数据 | |
| 205 | + self.searchCondition = function() { | |
| 206 | + return employeeInfoManageService.getSearchCondition(); | |
| 207 | + }; | |
| 208 | + // 重置查询条件 | |
| 209 | + self.resetSearchCondition = function() { | |
| 210 | + employeeInfoManageService.resetSearchCondition(); | |
| 211 | + self.pageInfo.currentPage = 1; | |
| 212 | + self.pageChanaged(); | |
| 213 | + }; | |
| 214 | +}]); | |
| 215 | + | |
| 216 | +angular.module('ScheduleApp').controller('EmployeeInfoManageFormCtrl', ['EmployeeInfoManageService', '$stateParams', '$state', function(employeeInfoManageService, $stateParams, $state) { | |
| 217 | + var self = this; | |
| 218 | + | |
| 219 | + // 欲保存的busInfo信息,绑定 | |
| 220 | + self.employeeInfoForSave = {}; | |
| 221 | + | |
| 222 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 223 | + var id = $stateParams.id; | |
| 224 | + if (id) { | |
| 225 | + self.employeeInfoForSave.id = id; | |
| 226 | + employeeInfoManageService.getDetail(id).then( | |
| 227 | + function(result) { | |
| 228 | + var key; | |
| 229 | + for (key in result) { | |
| 230 | + self.employeeInfoForSave[key] = result[key]; | |
| 231 | + } | |
| 232 | + }, | |
| 233 | + function(result) { | |
| 234 | + alert("出错啦!"); | |
| 235 | + } | |
| 236 | + ); | |
| 237 | + } | |
| 238 | + | |
| 239 | + // 提交方法 | |
| 240 | + self.submit = function() { | |
| 241 | + console.log(self.employeeInfoForSave); | |
| 242 | + employeeInfoManageService.saveDetail(self.employeeInfoForSave).then( | |
| 243 | + function(result) { | |
| 244 | + // TODO:弹出框方式以后改 | |
| 245 | + if (result.status == 'SUCCESS') { | |
| 246 | + alert("保存成功!"); | |
| 247 | + $state.go("employeeInfoManage"); | |
| 248 | + } else { | |
| 249 | + alert("保存异常!"); | |
| 250 | + } | |
| 251 | + }, | |
| 252 | + function(result) { | |
| 253 | + // TODO:弹出框方式以后改 | |
| 254 | + alert("出错啦!"); | |
| 255 | + } | |
| 256 | + ); | |
| 257 | + }; | |
| 258 | + | |
| 259 | + | |
| 260 | +}]); | |
| 261 | + | |
| 262 | +angular.module('ScheduleApp').controller('EmployeeInfoManageDetailCtrl', ['EmployeeInfoManageService', '$stateParams', function(employeeInfoManageService, $stateParams) { | |
| 263 | + var self = this; | |
| 264 | + self.title = ""; | |
| 265 | + self.employeeInfoForDetail = {}; | |
| 266 | + self.employeeInfoForDetail.id = $stateParams.id; | |
| 267 | + | |
| 268 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 269 | + employeeInfoManageService.getDetail($stateParams.id).then( | |
| 270 | + function(result) { | |
| 271 | + var key; | |
| 272 | + for (key in result) { | |
| 273 | + self.employeeInfoForDetail[key] = result[key]; | |
| 274 | + } | |
| 275 | + | |
| 276 | + self.title = "员工 " + self.employeeInfoForDetail.personnelName + " 详细信息"; | |
| 277 | + }, | |
| 278 | + function(result) { | |
| 279 | + // TODO:弹出框方式以后改 | |
| 280 | + alert("出错啦!"); | |
| 281 | + } | |
| 282 | + ); | |
| 283 | +}]); | |
| 284 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 人员基础信息模块配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("employeeInfoManage", { // index页面 | |
| 13 | - url: '/employeeInfoManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html' | |
| 17 | - }, | |
| 18 | - "employeeInfoManage_list@employeeInfoManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'employeeInfoManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | - "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 33 | - ] | |
| 34 | - }); | |
| 35 | - }] | |
| 36 | - } | |
| 37 | - }) | |
| 38 | - .state("employeeInfoManage_form", { // 添加人员信息form | |
| 39 | - url: '/employeeInfoManage_form', | |
| 40 | - views: { | |
| 41 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html'} | |
| 42 | - }, | |
| 43 | - resolve: { | |
| 44 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | - return $ocLazyLoad.load({ | |
| 46 | - name: 'employeeInfoManage_form_module', | |
| 47 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | - files: [ | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | - "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 52 | - ] | |
| 53 | - }); | |
| 54 | - }] | |
| 55 | - } | |
| 56 | - }) | |
| 57 | - .state("employeeInfoManage_edit", { // 修改人员信息form | |
| 58 | - url: '/employeeInfoManage_edit/:id', | |
| 59 | - views: { | |
| 60 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html'} | |
| 61 | - }, | |
| 62 | - resolve: { | |
| 63 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | - return $ocLazyLoad.load({ | |
| 65 | - name: 'employeeInfoManage_edit_module', | |
| 66 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | - files: [ | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | - "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 71 | - ] | |
| 72 | - }); | |
| 73 | - }] | |
| 74 | - } | |
| 75 | - }) | |
| 76 | - .state("employeeInfoManage_detail", { // 详细信息页面 | |
| 77 | - url: '/employeeInfoManage_detail/:id', | |
| 78 | - views: { | |
| 79 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html'} | |
| 80 | - }, | |
| 81 | - resolve: { | |
| 82 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | - return $ocLazyLoad.load({ | |
| 84 | - name: 'employeeInfoManage_detail_module', | |
| 85 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | - files: [ | |
| 87 | - "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 88 | - ] | |
| 89 | - }); | |
| 90 | - }] | |
| 91 | - } | |
| 92 | - }) | |
| 93 | - | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 人员基础信息模块配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("employeeInfoManage", { // index页面 | |
| 13 | + url: '/employeeInfoManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html' | |
| 17 | + }, | |
| 18 | + "employeeInfoManage_list@employeeInfoManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'employeeInfoManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 33 | + ] | |
| 34 | + }); | |
| 35 | + }] | |
| 36 | + } | |
| 37 | + }) | |
| 38 | + .state("employeeInfoManage_form", { // 添加人员信息form | |
| 39 | + url: '/employeeInfoManage_form', | |
| 40 | + views: { | |
| 41 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html'} | |
| 42 | + }, | |
| 43 | + resolve: { | |
| 44 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | + return $ocLazyLoad.load({ | |
| 46 | + name: 'employeeInfoManage_form_module', | |
| 47 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | + files: [ | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 52 | + ] | |
| 53 | + }); | |
| 54 | + }] | |
| 55 | + } | |
| 56 | + }) | |
| 57 | + .state("employeeInfoManage_edit", { // 修改人员信息form | |
| 58 | + url: '/employeeInfoManage_edit/:id', | |
| 59 | + views: { | |
| 60 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html'} | |
| 61 | + }, | |
| 62 | + resolve: { | |
| 63 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | + return $ocLazyLoad.load({ | |
| 65 | + name: 'employeeInfoManage_edit_module', | |
| 66 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | + files: [ | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 71 | + ] | |
| 72 | + }); | |
| 73 | + }] | |
| 74 | + } | |
| 75 | + }) | |
| 76 | + .state("employeeInfoManage_detail", { // 详细信息页面 | |
| 77 | + url: '/employeeInfoManage_detail/:id', | |
| 78 | + views: { | |
| 79 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html'} | |
| 80 | + }, | |
| 81 | + resolve: { | |
| 82 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | + return $ocLazyLoad.load({ | |
| 84 | + name: 'employeeInfoManage_detail_module', | |
| 85 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | + files: [ | |
| 87 | + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 88 | + ] | |
| 89 | + }); | |
| 90 | + }] | |
| 91 | + } | |
| 92 | + }) | |
| 93 | + | |
| 94 | 94 | }]); |
| 95 | 95 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/common/prj-common-ui-route-state.js
| 1 | -//所有模块ui route 配置// ui route 配置 | |
| 2 | - | |
| 3 | -/** 车辆基础信息模块配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("busInfoManage", { // index页面 | |
| 13 | - url: '/busInfoManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html' | |
| 17 | - }, | |
| 18 | - "busInfoManage_list@busInfoManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'busInfoManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 33 | - ] | |
| 34 | - }); | |
| 35 | - }] | |
| 36 | - } | |
| 37 | - }) | |
| 38 | - .state("busInfoManage_form", { // 添加车辆form | |
| 39 | - url: '/busInfoManage_form', | |
| 40 | - views: { | |
| 41 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'} | |
| 42 | - }, | |
| 43 | - resolve: { | |
| 44 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | - return $ocLazyLoad.load({ | |
| 46 | - name: 'busInfoManage_form_module', | |
| 47 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | - files: [ | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 52 | - ] | |
| 53 | - }); | |
| 54 | - }] | |
| 55 | - } | |
| 56 | - }) | |
| 57 | - .state("busInfoManage_edit", { // 修改车辆form | |
| 58 | - url: '/busInfoManage_edit/:id', | |
| 59 | - views: { | |
| 60 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'} | |
| 61 | - }, | |
| 62 | - resolve: { | |
| 63 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | - return $ocLazyLoad.load({ | |
| 65 | - name: 'busInfoManage_edit_module', | |
| 66 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | - files: [ | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 71 | - ] | |
| 72 | - }); | |
| 73 | - }] | |
| 74 | - } | |
| 75 | - }) | |
| 76 | - .state("busInfoManage_detail", { // 车辆详细信息 | |
| 77 | - url: '/busInfoManage_detail/:id', | |
| 78 | - views: { | |
| 79 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'} | |
| 80 | - }, | |
| 81 | - resolve: { | |
| 82 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | - return $ocLazyLoad.load({ | |
| 84 | - name: 'busInfoManage_detail_module', | |
| 85 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | - files: [ | |
| 87 | - "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 88 | - ] | |
| 89 | - }); | |
| 90 | - }] | |
| 91 | - } | |
| 92 | - }) | |
| 93 | - } | |
| 94 | -]); | |
| 95 | -// ui route 配置 | |
| 96 | - | |
| 97 | -/** 车辆设备信息模块配置route */ | |
| 98 | -ScheduleApp.config([ | |
| 99 | - '$stateProvider', | |
| 100 | - '$urlRouterProvider', | |
| 101 | - function($stateProvider, $urlRouterProvider) { | |
| 102 | - // 默认路由 | |
| 103 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 104 | - | |
| 105 | - $stateProvider | |
| 106 | - .state("deviceInfoManage", { // index页面 | |
| 107 | - url: '/deviceInfoManage', | |
| 108 | - views: { | |
| 109 | - "": { | |
| 110 | - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html' | |
| 111 | - }, | |
| 112 | - "deviceInfoManage_list@deviceInfoManage": { | |
| 113 | - templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html' | |
| 114 | - } | |
| 115 | - }, | |
| 116 | - | |
| 117 | - resolve: { | |
| 118 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 119 | - return $ocLazyLoad.load({ | |
| 120 | - name: 'deviceInfoManage_module', | |
| 121 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 122 | - files: [ | |
| 123 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 124 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 125 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 126 | - ] | |
| 127 | - }); | |
| 128 | - }] | |
| 129 | - } | |
| 130 | - }) | |
| 131 | - .state("deviceInfoManage_form", { // 添加设备信息form | |
| 132 | - url: '/deviceInfoManage_form', | |
| 133 | - views: { | |
| 134 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'} | |
| 135 | - }, | |
| 136 | - resolve: { | |
| 137 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 138 | - return $ocLazyLoad.load({ | |
| 139 | - name: 'deviceInfoManage_form_module', | |
| 140 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 141 | - files: [ | |
| 142 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 143 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 144 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 145 | - ] | |
| 146 | - }); | |
| 147 | - }] | |
| 148 | - } | |
| 149 | - }) | |
| 150 | - .state("deviceInfoManage_edit", { // 修改设备信息form | |
| 151 | - url: '/deviceInfoManage_edit/:id', | |
| 152 | - views: { | |
| 153 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'} | |
| 154 | - }, | |
| 155 | - resolve: { | |
| 156 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 157 | - return $ocLazyLoad.load({ | |
| 158 | - name: 'deviceInfoManage_edit_module', | |
| 159 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 160 | - files: [ | |
| 161 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 162 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 163 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 164 | - ] | |
| 165 | - }); | |
| 166 | - }] | |
| 167 | - } | |
| 168 | - }) | |
| 169 | - .state("deviceInfoManage_detail", { // 详细信息页面 | |
| 170 | - url: '/deviceInfoManage_detail/:id', | |
| 171 | - views: { | |
| 172 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'} | |
| 173 | - }, | |
| 174 | - resolve: { | |
| 175 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 176 | - return $ocLazyLoad.load({ | |
| 177 | - name: 'deviceInfoManage_detail_module', | |
| 178 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 179 | - files: [ | |
| 180 | - "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 181 | - ] | |
| 182 | - }); | |
| 183 | - }] | |
| 184 | - } | |
| 185 | - }) | |
| 186 | - | |
| 187 | - } | |
| 188 | -]); | |
| 189 | -// ui route 配置 | |
| 190 | - | |
| 191 | -/** 人员基础信息模块配置route */ | |
| 192 | -ScheduleApp.config([ | |
| 193 | - '$stateProvider', | |
| 194 | - '$urlRouterProvider', | |
| 195 | - function($stateProvider, $urlRouterProvider) { | |
| 196 | - // 默认路由 | |
| 197 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 198 | - | |
| 199 | - $stateProvider | |
| 200 | - .state("employeeInfoManage", { // index页面 | |
| 201 | - url: '/employeeInfoManage', | |
| 202 | - views: { | |
| 203 | - "": { | |
| 204 | - templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html' | |
| 205 | - }, | |
| 206 | - "employeeInfoManage_list@employeeInfoManage": { | |
| 207 | - templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html' | |
| 208 | - } | |
| 209 | - }, | |
| 210 | - | |
| 211 | - resolve: { | |
| 212 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 213 | - return $ocLazyLoad.load({ | |
| 214 | - name: 'employeeInfoManage_module', | |
| 215 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 216 | - files: [ | |
| 217 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 218 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 219 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 220 | - "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 221 | - ] | |
| 222 | - }); | |
| 223 | - }] | |
| 224 | - } | |
| 225 | - }) | |
| 226 | - .state("employeeInfoManage_form", { // 添加人员信息form | |
| 227 | - url: '/employeeInfoManage_form', | |
| 228 | - views: { | |
| 229 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html'} | |
| 230 | - }, | |
| 231 | - resolve: { | |
| 232 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 233 | - return $ocLazyLoad.load({ | |
| 234 | - name: 'employeeInfoManage_form_module', | |
| 235 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 236 | - files: [ | |
| 237 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 238 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 239 | - "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 240 | - ] | |
| 241 | - }); | |
| 242 | - }] | |
| 243 | - } | |
| 244 | - }) | |
| 245 | - .state("employeeInfoManage_edit", { // 修改人员信息form | |
| 246 | - url: '/employeeInfoManage_edit/:id', | |
| 247 | - views: { | |
| 248 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html'} | |
| 249 | - }, | |
| 250 | - resolve: { | |
| 251 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 252 | - return $ocLazyLoad.load({ | |
| 253 | - name: 'employeeInfoManage_edit_module', | |
| 254 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 255 | - files: [ | |
| 256 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 257 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 258 | - "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 259 | - ] | |
| 260 | - }); | |
| 261 | - }] | |
| 262 | - } | |
| 263 | - }) | |
| 264 | - .state("employeeInfoManage_detail", { // 详细信息页面 | |
| 265 | - url: '/employeeInfoManage_detail/:id', | |
| 266 | - views: { | |
| 267 | - "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html'} | |
| 268 | - }, | |
| 269 | - resolve: { | |
| 270 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 271 | - return $ocLazyLoad.load({ | |
| 272 | - name: 'employeeInfoManage_detail_module', | |
| 273 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 274 | - files: [ | |
| 275 | - "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 276 | - ] | |
| 277 | - }); | |
| 278 | - }] | |
| 279 | - } | |
| 280 | - }) | |
| 281 | - | |
| 282 | -}]); | |
| 283 | -// ui route 配置 | |
| 284 | - | |
| 285 | -/** 车辆配置模块页面route */ | |
| 286 | -ScheduleApp.config([ | |
| 287 | - '$stateProvider', | |
| 288 | - '$urlRouterProvider', | |
| 289 | - function($stateProvider, $urlRouterProvider) { | |
| 290 | - // 默认路由 | |
| 291 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 292 | - | |
| 293 | - $stateProvider | |
| 294 | - .state("busConfig", { // index主页面 | |
| 295 | - url: '/busConfig', | |
| 296 | - views: { | |
| 297 | - "": { | |
| 298 | - templateUrl: 'pages/scheduleApp/module/core/busConfig/index.html' | |
| 299 | - }, | |
| 300 | - "busConfig_list@busConfig": { | |
| 301 | - templateUrl: 'pages/scheduleApp/module/core/busConfig/list.html' | |
| 302 | - } | |
| 303 | - }, | |
| 304 | - | |
| 305 | - resolve: { | |
| 306 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 307 | - return $ocLazyLoad.load({ | |
| 308 | - name: 'busConfig_module', | |
| 309 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 310 | - files: [ | |
| 311 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 312 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 313 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 314 | - "pages/scheduleApp/module/core/busConfig/module.js" | |
| 315 | - ] | |
| 316 | - }); | |
| 317 | - }] | |
| 318 | - } | |
| 319 | - }) | |
| 320 | - .state("busConfig_form", { // 添加页面 | |
| 321 | - url: '/busConfig_form', | |
| 322 | - views: { | |
| 323 | - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/form.html'} | |
| 324 | - }, | |
| 325 | - resolve: { | |
| 326 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 327 | - return $ocLazyLoad.load({ | |
| 328 | - name: 'busConfig_form_module', | |
| 329 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 330 | - files: [ | |
| 331 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 332 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 333 | - "pages/scheduleApp/module/core/busConfig/module.js" | |
| 334 | - ] | |
| 335 | - }); | |
| 336 | - }] | |
| 337 | - } | |
| 338 | - }) | |
| 339 | - .state("busConfig_edit", { // 修改页面 | |
| 340 | - url: '/busConfig_edit/:id', | |
| 341 | - views: { | |
| 342 | - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/edit.html'} | |
| 343 | - }, | |
| 344 | - resolve: { | |
| 345 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 346 | - return $ocLazyLoad.load({ | |
| 347 | - name: 'busConfig_edit_module', | |
| 348 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 349 | - files: [ | |
| 350 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 351 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 352 | - "pages/scheduleApp/module/core/busConfig/module.js" | |
| 353 | - ] | |
| 354 | - }); | |
| 355 | - }] | |
| 356 | - } | |
| 357 | - }) | |
| 358 | - .state("busConfig_detail", { // 详细信息页面 | |
| 359 | - url: '/busConfig_detail/:id', | |
| 360 | - views: { | |
| 361 | - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/detail.html'} | |
| 362 | - }, | |
| 363 | - resolve: { | |
| 364 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 365 | - return $ocLazyLoad.load({ | |
| 366 | - name: 'busConfig_detail_module', | |
| 367 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 368 | - files: [ | |
| 369 | - "pages/scheduleApp/module/core/busConfig/module.js" | |
| 370 | - ] | |
| 371 | - }); | |
| 372 | - }] | |
| 373 | - } | |
| 374 | - }); | |
| 375 | - } | |
| 376 | -]); | |
| 377 | - | |
| 378 | - | |
| 379 | - | |
| 380 | -// ui route 配置 | |
| 381 | - | |
| 382 | -/** 线路运营概览配置route */ | |
| 383 | -ScheduleApp.config([ | |
| 384 | - '$stateProvider', | |
| 385 | - '$urlRouterProvider', | |
| 386 | - function($stateProvider, $urlRouterProvider) { | |
| 387 | - // 默认路由 | |
| 388 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 389 | - | |
| 390 | - $stateProvider | |
| 391 | - .state("busLineInfoStat", { // index页面 | |
| 392 | - url: '/busLineInfoStat', | |
| 393 | - views: { | |
| 394 | - "": { | |
| 395 | - templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/index.html' | |
| 396 | - }, | |
| 397 | - "busLineInfoStat_list@busLineInfoStat": { | |
| 398 | - templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/list.html' | |
| 399 | - } | |
| 400 | - }, | |
| 401 | - | |
| 402 | - resolve: { | |
| 403 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 404 | - return $ocLazyLoad.load({ | |
| 405 | - name: 'busLineInfoStat_module', | |
| 406 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 407 | - files: [ | |
| 408 | - "pages/scheduleApp/module/core/busLineInfoStat/module.js" | |
| 409 | - ] | |
| 410 | - }); | |
| 411 | - }] | |
| 412 | - } | |
| 413 | - }); | |
| 414 | - | |
| 415 | - } | |
| 416 | -]); | |
| 417 | -// ui route 配置 | |
| 418 | - | |
| 419 | -/** 人员配置模块页面route */ | |
| 420 | -ScheduleApp.config([ | |
| 421 | - '$stateProvider', | |
| 422 | - '$urlRouterProvider', | |
| 423 | - function($stateProvider, $urlRouterProvider) { | |
| 424 | - // 默认路由 | |
| 425 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 426 | - | |
| 427 | - $stateProvider | |
| 428 | - .state("employeeConfig", { // index页面 | |
| 429 | - url: '/employeeConfig', | |
| 430 | - views: { | |
| 431 | - "": { | |
| 432 | - templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html' | |
| 433 | - }, | |
| 434 | - "employeeConfig_list@employeeConfig": { | |
| 435 | - templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html' | |
| 436 | - } | |
| 437 | - }, | |
| 438 | - | |
| 439 | - resolve: { | |
| 440 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 441 | - return $ocLazyLoad.load({ | |
| 442 | - name: 'employeeConfig_module', | |
| 443 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 444 | - files: [ | |
| 445 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 446 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 447 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 448 | - "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 449 | - ] | |
| 450 | - }); | |
| 451 | - }] | |
| 452 | - } | |
| 453 | - }) | |
| 454 | - .state("employeeConfig_form", { // 添加人员配置form | |
| 455 | - url: '/employeeConfig_form', | |
| 456 | - views: { | |
| 457 | - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/form.html'} | |
| 458 | - }, | |
| 459 | - resolve: { | |
| 460 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 461 | - return $ocLazyLoad.load({ | |
| 462 | - name: 'employeeConfig_form_module', | |
| 463 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 464 | - files: [ | |
| 465 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 466 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 467 | - "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 468 | - ] | |
| 469 | - }); | |
| 470 | - }] | |
| 471 | - } | |
| 472 | - }) | |
| 473 | - .state("employeeConfig_edit", { // 修改人员配置form | |
| 474 | - url: '/employeeConfig_edit/:id', | |
| 475 | - views: { | |
| 476 | - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/edit.html'} | |
| 477 | - }, | |
| 478 | - resolve: { | |
| 479 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 480 | - return $ocLazyLoad.load({ | |
| 481 | - name: 'employeeConfig_edit_module', | |
| 482 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 483 | - files: [ | |
| 484 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 485 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 486 | - "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 487 | - ] | |
| 488 | - }); | |
| 489 | - }] | |
| 490 | - } | |
| 491 | - }) | |
| 492 | - .state("employeeConfig_detail", { // 详细信息页面 | |
| 493 | - url: '/employeeConfig_detail/:id', | |
| 494 | - views: { | |
| 495 | - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/detail.html'} | |
| 496 | - }, | |
| 497 | - resolve: { | |
| 498 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 499 | - return $ocLazyLoad.load({ | |
| 500 | - name: 'employeeConfig_detail_module', | |
| 501 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 502 | - files: [ | |
| 503 | - "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 504 | - ] | |
| 505 | - }); | |
| 506 | - }] | |
| 507 | - } | |
| 508 | - }) | |
| 509 | - | |
| 510 | - } | |
| 511 | -]); | |
| 512 | -// ui route 配置 | |
| 513 | - | |
| 514 | -/** 路牌管理配置所有模块页面route */ | |
| 515 | -ScheduleApp.config([ | |
| 516 | - '$stateProvider', | |
| 517 | - '$urlRouterProvider', | |
| 518 | - function($stateProvider, $urlRouterProvider) { | |
| 519 | - // 默认路由 | |
| 520 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 521 | - | |
| 522 | - $stateProvider | |
| 523 | - .state("guideboardManage", { // index页面 | |
| 524 | - url: '/guideboardManage', | |
| 525 | - views: { | |
| 526 | - "": { | |
| 527 | - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html' | |
| 528 | - }, | |
| 529 | - "guideboardManage_list@guideboardManage": { | |
| 530 | - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html' | |
| 531 | - } | |
| 532 | - }, | |
| 533 | - | |
| 534 | - resolve: { | |
| 535 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 536 | - return $ocLazyLoad.load({ | |
| 537 | - name: 'guideboardManage_module', | |
| 538 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 539 | - files: [ | |
| 540 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 541 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 542 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 543 | - "pages/scheduleApp/module/core/guideboardManage/module.js" | |
| 544 | - ] | |
| 545 | - }); | |
| 546 | - }] | |
| 547 | - } | |
| 548 | - }) | |
| 549 | - .state("guideboardManage_detail", { // 详细信息页面 | |
| 550 | - url: '/guideboardManage_detail/:id', | |
| 551 | - views: { | |
| 552 | - "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'} | |
| 553 | - }, | |
| 554 | - resolve: { | |
| 555 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 556 | - return $ocLazyLoad.load({ | |
| 557 | - name: 'guideboardManage_detail_module', | |
| 558 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 559 | - files: [ | |
| 560 | - "pages/scheduleApp/module/core/guideboardManage/module.js" | |
| 561 | - ] | |
| 562 | - }); | |
| 563 | - }] | |
| 564 | - } | |
| 565 | - }) | |
| 566 | - | |
| 567 | -}]); | |
| 568 | -// ui route 配置 | |
| 569 | - | |
| 570 | -/** 套跑管理模块配置页面route */ | |
| 571 | -ScheduleApp.config([ | |
| 572 | - '$stateProvider', | |
| 573 | - '$urlRouterProvider', | |
| 574 | - function($stateProvider, $urlRouterProvider) { | |
| 575 | - // 默认路由 | |
| 576 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 577 | - | |
| 578 | - $stateProvider | |
| 579 | - .state("rerunManage", { // index页面 | |
| 580 | - url: '/rerunManage', | |
| 581 | - views: { | |
| 582 | - "": { | |
| 583 | - templateUrl: 'pages/scheduleApp/module/core/rerunManage/index.html' | |
| 584 | - }, | |
| 585 | - "rerunManage_list@rerunManage": { | |
| 586 | - templateUrl: 'pages/scheduleApp/module/core/rerunManage/list.html' | |
| 587 | - } | |
| 588 | - }, | |
| 589 | - | |
| 590 | - resolve: { | |
| 591 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 592 | - return $ocLazyLoad.load({ | |
| 593 | - name: 'rerunManage_module', | |
| 594 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 595 | - files: [ | |
| 596 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 597 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 598 | - "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 599 | - ] | |
| 600 | - }); | |
| 601 | - }] | |
| 602 | - } | |
| 603 | - }) | |
| 604 | - .state("rerunManage_form", { // 添加套跑form | |
| 605 | - url: '/rerunManage_form', | |
| 606 | - views: { | |
| 607 | - "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/form.html'} | |
| 608 | - }, | |
| 609 | - resolve: { | |
| 610 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 611 | - return $ocLazyLoad.load({ | |
| 612 | - name: 'rerunManage_form_module', | |
| 613 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 614 | - files: [ | |
| 615 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 616 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 617 | - "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 618 | - ] | |
| 619 | - }); | |
| 620 | - }] | |
| 621 | - } | |
| 622 | - }) | |
| 623 | - .state("rerunManage_edit", { // 修改套跑form | |
| 624 | - url: '/rerunManage_edit/:id', | |
| 625 | - views: { | |
| 626 | - "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/edit.html'} | |
| 627 | - }, | |
| 628 | - resolve: { | |
| 629 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 630 | - return $ocLazyLoad.load({ | |
| 631 | - name: 'rerunManage_edit_module', | |
| 632 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 633 | - files: [ | |
| 634 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 635 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 636 | - "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 637 | - ] | |
| 638 | - }); | |
| 639 | - }] | |
| 640 | - } | |
| 641 | - }) | |
| 642 | - .state("rerunManage_detail", { // 详细信息页面 | |
| 643 | - url: '/rerunManage_detail/:id', | |
| 644 | - views: { | |
| 645 | - "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/detail.html'} | |
| 646 | - }, | |
| 647 | - resolve: { | |
| 648 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 649 | - return $ocLazyLoad.load({ | |
| 650 | - name: 'rerunManage_detail_module', | |
| 651 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 652 | - files: [ | |
| 653 | - "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 654 | - ] | |
| 655 | - }); | |
| 656 | - }] | |
| 657 | - } | |
| 658 | - }) | |
| 659 | - } | |
| 660 | -]); | |
| 661 | -// ui route 配置 | |
| 662 | - | |
| 663 | -/** 排班计划管理配置route */ | |
| 664 | -ScheduleApp.config([ | |
| 665 | - '$stateProvider', | |
| 666 | - '$urlRouterProvider', | |
| 667 | - function($stateProvider, $urlRouterProvider) { | |
| 668 | - // 默认路由 | |
| 669 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 670 | - | |
| 671 | - $stateProvider | |
| 672 | - .state("schedulePlanManage", { // index页面 | |
| 673 | - url: '/schedulePlanManage', | |
| 674 | - views: { | |
| 675 | - "": { | |
| 676 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index.html' | |
| 677 | - }, | |
| 678 | - "schedulePlanManage_list@schedulePlanManage": { | |
| 679 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list.html' | |
| 680 | - } | |
| 681 | - }, | |
| 682 | - | |
| 683 | - resolve: { | |
| 684 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 685 | - return $ocLazyLoad.load({ | |
| 686 | - name: 'schedulePlanManage_module', | |
| 687 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 688 | - files: [ | |
| 689 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 690 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 691 | - "pages/scheduleApp/module/core/schedulePlanManage/module.js" | |
| 692 | - ] | |
| 693 | - }); | |
| 694 | - }] | |
| 695 | - } | |
| 696 | - }) | |
| 697 | - .state("schedulePlanManage_form", { // 添加排班计划form | |
| 698 | - url: '/schedulePlanManage_form', | |
| 699 | - views: { | |
| 700 | - "": { | |
| 701 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/form.html' | |
| 702 | - } | |
| 703 | - }, | |
| 704 | - | |
| 705 | - resolve: { | |
| 706 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 707 | - return $ocLazyLoad.load({ | |
| 708 | - name: 'schedulePlanManage_form_module', | |
| 709 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 710 | - files: [ | |
| 711 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 712 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 713 | - "pages/scheduleApp/module/core/schedulePlanManage/module.js" | |
| 714 | - ] | |
| 715 | - }); | |
| 716 | - }] | |
| 717 | - } | |
| 718 | - }) | |
| 719 | - | |
| 720 | - | |
| 721 | - } | |
| 722 | -]); | |
| 723 | -// ui route 配置 | |
| 724 | - | |
| 725 | -/** 排班计划明细配置route */ | |
| 726 | -ScheduleApp.config([ | |
| 727 | - '$stateProvider', | |
| 728 | - '$urlRouterProvider', | |
| 729 | - function($stateProvider, $urlRouterProvider) { | |
| 730 | - // 默认路由 | |
| 731 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 732 | - | |
| 733 | - $stateProvider | |
| 734 | - // 排班计划明细管理模块 | |
| 735 | - .state("schedulePlanInfoManage", { | |
| 736 | - url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime', | |
| 737 | - views: { | |
| 738 | - "": { | |
| 739 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/index_info.html' | |
| 740 | - }, | |
| 741 | - "schedulePlanInfoManage_list@schedulePlanInfoManage": { | |
| 742 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html' | |
| 743 | - } | |
| 744 | - }, | |
| 745 | - | |
| 746 | - resolve: { | |
| 747 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 748 | - return $ocLazyLoad.load({ | |
| 749 | - name: 'schedulePlanInfoManage_module', | |
| 750 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 751 | - files: [ | |
| 752 | - "pages/scheduleApp/module/core/schedulePlanManage/info/module.js" | |
| 753 | - ] | |
| 754 | - }); | |
| 755 | - }] | |
| 756 | - } | |
| 757 | - }); | |
| 758 | - | |
| 759 | - } | |
| 760 | -]); | |
| 761 | -// ui route 配置 | |
| 762 | - | |
| 763 | -/** 排班调度值勤日报配置route */ | |
| 764 | -ScheduleApp.config([ | |
| 765 | - '$stateProvider', | |
| 766 | - '$urlRouterProvider', | |
| 767 | - function($stateProvider, $urlRouterProvider) { | |
| 768 | - // 默认路由 | |
| 769 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 770 | - | |
| 771 | - $stateProvider | |
| 772 | - .state("schedulePlanReportManage", { | |
| 773 | - url: '/schedulePlanReportManage', | |
| 774 | - views: { | |
| 775 | - "": { | |
| 776 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/index_report.html' | |
| 777 | - }, | |
| 778 | - "schedulePlanReportManage_list@schedulePlanReportManage": { | |
| 779 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/list_report.html' | |
| 780 | - } | |
| 781 | - }, | |
| 782 | - | |
| 783 | - resolve: { | |
| 784 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 785 | - return $ocLazyLoad.load({ | |
| 786 | - name: 'schedulePlanManage_module', | |
| 787 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 788 | - files: [ | |
| 789 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 790 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 791 | - "pages/scheduleApp/module/core/schedulePlanManage/report/module.js" | |
| 792 | - ] | |
| 793 | - }); | |
| 794 | - }] | |
| 795 | - } | |
| 796 | - }) | |
| 797 | - .state("schedulePlanReportManage_edit", { | |
| 798 | - url: '/schedulePlanReportManage_edit', | |
| 799 | - params: {type: 0, groupInfo: null}, | |
| 800 | - views: { | |
| 801 | - "": { | |
| 802 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/edit_report.html' | |
| 803 | - } | |
| 804 | - }, | |
| 805 | - | |
| 806 | - resolve: { | |
| 807 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 808 | - return $ocLazyLoad.load({ | |
| 809 | - name: 'schedulePlanReportManage_edit_module', | |
| 810 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 811 | - files: [ | |
| 812 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 813 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 814 | - "pages/scheduleApp/module/core/schedulePlanManage/report/module.js" | |
| 815 | - ] | |
| 816 | - }); | |
| 817 | - }] | |
| 818 | - } | |
| 819 | - }); | |
| 820 | - | |
| 821 | - } | |
| 822 | -]); | |
| 823 | -// ui route 配置 | |
| 824 | - | |
| 825 | -/** 排班规则模块配置route */ | |
| 826 | -ScheduleApp.config([ | |
| 827 | - '$stateProvider', | |
| 828 | - '$urlRouterProvider', | |
| 829 | - function($stateProvider, $urlRouterProvider) { | |
| 830 | - // 默认路由 | |
| 831 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 832 | - | |
| 833 | - $stateProvider | |
| 834 | - .state("scheduleRuleManage", { // index页面 | |
| 835 | - url: '/scheduleRuleManage', | |
| 836 | - views: { | |
| 837 | - "": { | |
| 838 | - templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/index.html' | |
| 839 | - }, | |
| 840 | - "scheduleRuleManage_list@scheduleRuleManage": { | |
| 841 | - templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/list.html' | |
| 842 | - } | |
| 843 | - }, | |
| 844 | - | |
| 845 | - resolve: { | |
| 846 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 847 | - return $ocLazyLoad.load({ | |
| 848 | - name: 'scheduleRuleManage_module', | |
| 849 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 850 | - files: [ | |
| 851 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 852 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 853 | - "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 854 | - ] | |
| 855 | - }); | |
| 856 | - }] | |
| 857 | - } | |
| 858 | - }) | |
| 859 | - .state("scheduleRuleManage_form", { // 添加排班规则form | |
| 860 | - url: '/scheduleRuleManage_form', | |
| 861 | - views: { | |
| 862 | - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/form.html'} | |
| 863 | - }, | |
| 864 | - resolve: { | |
| 865 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 866 | - return $ocLazyLoad.load({ | |
| 867 | - name: 'scheduleRuleManage_form_module', | |
| 868 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 869 | - files: [ | |
| 870 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 871 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 872 | - "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 873 | - ] | |
| 874 | - }); | |
| 875 | - }] | |
| 876 | - } | |
| 877 | - }) | |
| 878 | - .state("scheduleRuleManage_edit", { // 修改排班规则form | |
| 879 | - url: '/scheduleRuleManage_edit/:id', | |
| 880 | - views: { | |
| 881 | - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/edit.html'} | |
| 882 | - }, | |
| 883 | - resolve: { | |
| 884 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 885 | - return $ocLazyLoad.load({ | |
| 886 | - name: 'scheduleRuleManage_edit_module', | |
| 887 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 888 | - files: [ | |
| 889 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 890 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 891 | - "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 892 | - ] | |
| 893 | - }); | |
| 894 | - }] | |
| 895 | - } | |
| 896 | - }) | |
| 897 | - .state("scheduleRuleManage_detail", { // 详细信息 | |
| 898 | - url: '/scheduleRuleManage_detail/:id', | |
| 899 | - views: { | |
| 900 | - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/detail.html'} | |
| 901 | - }, | |
| 902 | - resolve: { | |
| 903 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 904 | - return $ocLazyLoad.load({ | |
| 905 | - name: 'scheduleRuleManage_detail_module', | |
| 906 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 907 | - files: [ | |
| 908 | - "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 909 | - ] | |
| 910 | - }); | |
| 911 | - }] | |
| 912 | - } | |
| 913 | - }) | |
| 914 | - } | |
| 915 | -]); | |
| 916 | -// ui route 配置 | |
| 917 | - | |
| 918 | -/** 时刻表管理配置route */ | |
| 919 | -ScheduleApp.config([ | |
| 920 | - '$stateProvider', | |
| 921 | - '$urlRouterProvider', | |
| 922 | - function($stateProvider, $urlRouterProvider) { | |
| 923 | - // 默认路由 | |
| 924 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 925 | - | |
| 926 | - $stateProvider | |
| 927 | - .state("ttInfoManage", { // index页面 | |
| 928 | - url: '/ttInfoManage', | |
| 929 | - views: { | |
| 930 | - "": { | |
| 931 | - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html' | |
| 932 | - }, | |
| 933 | - "ttInfoManage_list@ttInfoManage": { | |
| 934 | - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html' | |
| 935 | - } | |
| 936 | - }, | |
| 937 | - | |
| 938 | - resolve: { | |
| 939 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 940 | - return $ocLazyLoad.load({ | |
| 941 | - name: 'ttInfoManage_module', | |
| 942 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 943 | - files: [ | |
| 944 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 945 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 946 | - "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 947 | - ] | |
| 948 | - }); | |
| 949 | - }] | |
| 950 | - } | |
| 951 | - }) | |
| 952 | - .state("ttInfoManage_form", { // 添加时刻表信息form | |
| 953 | - url: '/ttInfoManage_form', | |
| 954 | - views: { | |
| 955 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'} | |
| 956 | - }, | |
| 957 | - resolve: { | |
| 958 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 959 | - return $ocLazyLoad.load({ | |
| 960 | - name: 'ttInfoManage_form_module', | |
| 961 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 962 | - files: [ | |
| 963 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 964 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 965 | - "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 966 | - ] | |
| 967 | - }); | |
| 968 | - }] | |
| 969 | - } | |
| 970 | - }) | |
| 971 | - .state("ttInfoManage_edit", { // 修改时刻表信息form | |
| 972 | - url: '/ttInfoManage_edit/:id', | |
| 973 | - views: { | |
| 974 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'} | |
| 975 | - }, | |
| 976 | - resolve: { | |
| 977 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 978 | - return $ocLazyLoad.load({ | |
| 979 | - name: 'ttInfoManage_edit_module', | |
| 980 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 981 | - files: [ | |
| 982 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 983 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 984 | - "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 985 | - ] | |
| 986 | - }); | |
| 987 | - }] | |
| 988 | - } | |
| 989 | - }) | |
| 990 | - .state("ttInfoManage_detail", { // 时刻表详细信息 | |
| 991 | - url: '/ttInfoManage_detail/:id', | |
| 992 | - views: { | |
| 993 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'} | |
| 994 | - }, | |
| 995 | - resolve: { | |
| 996 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 997 | - return $ocLazyLoad.load({ | |
| 998 | - name: 'ttInfoManage_detail_module', | |
| 999 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 1000 | - files: [ | |
| 1001 | - "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 1002 | - ] | |
| 1003 | - }); | |
| 1004 | - }] | |
| 1005 | - } | |
| 1006 | - }); | |
| 1007 | - | |
| 1008 | - | |
| 1009 | - } | |
| 1010 | -]); | |
| 1011 | -// ui route 配置 | |
| 1012 | - | |
| 1013 | -/** 时刻表编辑管理配置route */ | |
| 1014 | -ScheduleApp.config([ | |
| 1015 | - '$stateProvider', | |
| 1016 | - '$urlRouterProvider', | |
| 1017 | - function($stateProvider, $urlRouterProvider) { | |
| 1018 | - // 默认路由 | |
| 1019 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 1020 | - | |
| 1021 | - $stateProvider | |
| 1022 | - .state("ttInfoDetailManage_form", { // 时刻表明细导入 | |
| 1023 | - url: '/ttInfoDetailManage_form/:xlid/:ttid/:xlname/:ttname', | |
| 1024 | - views: { | |
| 1025 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/form.html'} | |
| 1026 | - }, | |
| 1027 | - resolve: { | |
| 1028 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 1029 | - return $ocLazyLoad.load({ | |
| 1030 | - name: 'ttInfoDetailManage_form_module', | |
| 1031 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 1032 | - files: [ | |
| 1033 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 1034 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 1035 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 1036 | - "pages/scheduleApp/module/core/ttInfoManage/detailedit/module.js" | |
| 1037 | - ] | |
| 1038 | - }); | |
| 1039 | - }] | |
| 1040 | - } | |
| 1041 | - }) | |
| 1042 | - .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑 | |
| 1043 | - url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname', | |
| 1044 | - views: { | |
| 1045 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'} | |
| 1046 | - }, | |
| 1047 | - resolve: { | |
| 1048 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 1049 | - return $ocLazyLoad.load({ | |
| 1050 | - name: 'ttInfoDetailManage_edit_module', | |
| 1051 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 1052 | - files: [ | |
| 1053 | - "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 1054 | - ] | |
| 1055 | - }); | |
| 1056 | - }] | |
| 1057 | - } | |
| 1058 | - }) | |
| 1059 | - .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑 | |
| 1060 | - url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname', | |
| 1061 | - views: { | |
| 1062 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'} | |
| 1063 | - }, | |
| 1064 | - resolve: { | |
| 1065 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 1066 | - return $ocLazyLoad.load({ | |
| 1067 | - name: 'ttInfoDetailManage_detail_edit_module', | |
| 1068 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 1069 | - files: [ | |
| 1070 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 1071 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 1072 | - "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 1073 | - ] | |
| 1074 | - }); | |
| 1075 | - }] | |
| 1076 | - } | |
| 1077 | - }); | |
| 1078 | - | |
| 1079 | - } | |
| 1 | +//所有模块ui route 配置// ui route 配置 | |
| 2 | + | |
| 3 | +/** 车辆基础信息模块配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("busInfoManage", { // index页面 | |
| 13 | + url: '/busInfoManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/index.html' | |
| 17 | + }, | |
| 18 | + "busInfoManage_list@busInfoManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'busInfoManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 33 | + ] | |
| 34 | + }); | |
| 35 | + }] | |
| 36 | + } | |
| 37 | + }) | |
| 38 | + .state("busInfoManage_form", { // 添加车辆form | |
| 39 | + url: '/busInfoManage_form', | |
| 40 | + views: { | |
| 41 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/form.html'} | |
| 42 | + }, | |
| 43 | + resolve: { | |
| 44 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | + return $ocLazyLoad.load({ | |
| 46 | + name: 'busInfoManage_form_module', | |
| 47 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | + files: [ | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 52 | + ] | |
| 53 | + }); | |
| 54 | + }] | |
| 55 | + } | |
| 56 | + }) | |
| 57 | + .state("busInfoManage_edit", { // 修改车辆form | |
| 58 | + url: '/busInfoManage_edit/:id', | |
| 59 | + views: { | |
| 60 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/edit.html'} | |
| 61 | + }, | |
| 62 | + resolve: { | |
| 63 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | + return $ocLazyLoad.load({ | |
| 65 | + name: 'busInfoManage_edit_module', | |
| 66 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | + files: [ | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 71 | + ] | |
| 72 | + }); | |
| 73 | + }] | |
| 74 | + } | |
| 75 | + }) | |
| 76 | + .state("busInfoManage_detail", { // 车辆详细信息 | |
| 77 | + url: '/busInfoManage_detail/:id', | |
| 78 | + views: { | |
| 79 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/busInfoManage/detail.html'} | |
| 80 | + }, | |
| 81 | + resolve: { | |
| 82 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | + return $ocLazyLoad.load({ | |
| 84 | + name: 'busInfoManage_detail_module', | |
| 85 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | + files: [ | |
| 87 | + "pages/scheduleApp/module/basicInfo/busInfoManage/module.js" | |
| 88 | + ] | |
| 89 | + }); | |
| 90 | + }] | |
| 91 | + } | |
| 92 | + }) | |
| 93 | + } | |
| 94 | +]); | |
| 95 | +// ui route 配置 | |
| 96 | + | |
| 97 | +/** 车辆设备信息模块配置route */ | |
| 98 | +ScheduleApp.config([ | |
| 99 | + '$stateProvider', | |
| 100 | + '$urlRouterProvider', | |
| 101 | + function($stateProvider, $urlRouterProvider) { | |
| 102 | + // 默认路由 | |
| 103 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 104 | + | |
| 105 | + $stateProvider | |
| 106 | + .state("deviceInfoManage", { // index页面 | |
| 107 | + url: '/deviceInfoManage', | |
| 108 | + views: { | |
| 109 | + "": { | |
| 110 | + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/index.html' | |
| 111 | + }, | |
| 112 | + "deviceInfoManage_list@deviceInfoManage": { | |
| 113 | + templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/list.html' | |
| 114 | + } | |
| 115 | + }, | |
| 116 | + | |
| 117 | + resolve: { | |
| 118 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 119 | + return $ocLazyLoad.load({ | |
| 120 | + name: 'deviceInfoManage_module', | |
| 121 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 122 | + files: [ | |
| 123 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 124 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 125 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 126 | + ] | |
| 127 | + }); | |
| 128 | + }] | |
| 129 | + } | |
| 130 | + }) | |
| 131 | + .state("deviceInfoManage_form", { // 添加设备信息form | |
| 132 | + url: '/deviceInfoManage_form', | |
| 133 | + views: { | |
| 134 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/form.html'} | |
| 135 | + }, | |
| 136 | + resolve: { | |
| 137 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 138 | + return $ocLazyLoad.load({ | |
| 139 | + name: 'deviceInfoManage_form_module', | |
| 140 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 141 | + files: [ | |
| 142 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 143 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 144 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 145 | + ] | |
| 146 | + }); | |
| 147 | + }] | |
| 148 | + } | |
| 149 | + }) | |
| 150 | + .state("deviceInfoManage_edit", { // 修改设备信息form | |
| 151 | + url: '/deviceInfoManage_edit/:id', | |
| 152 | + views: { | |
| 153 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/edit.html'} | |
| 154 | + }, | |
| 155 | + resolve: { | |
| 156 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 157 | + return $ocLazyLoad.load({ | |
| 158 | + name: 'deviceInfoManage_edit_module', | |
| 159 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 160 | + files: [ | |
| 161 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 162 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 163 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 164 | + ] | |
| 165 | + }); | |
| 166 | + }] | |
| 167 | + } | |
| 168 | + }) | |
| 169 | + .state("deviceInfoManage_detail", { // 详细信息页面 | |
| 170 | + url: '/deviceInfoManage_detail/:id', | |
| 171 | + views: { | |
| 172 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/deviceInfoManage/detail.html'} | |
| 173 | + }, | |
| 174 | + resolve: { | |
| 175 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 176 | + return $ocLazyLoad.load({ | |
| 177 | + name: 'deviceInfoManage_detail_module', | |
| 178 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 179 | + files: [ | |
| 180 | + "pages/scheduleApp/module/basicInfo/deviceInfoManage/module.js" | |
| 181 | + ] | |
| 182 | + }); | |
| 183 | + }] | |
| 184 | + } | |
| 185 | + }) | |
| 186 | + | |
| 187 | + } | |
| 188 | +]); | |
| 189 | +// ui route 配置 | |
| 190 | + | |
| 191 | +/** 人员基础信息模块配置route */ | |
| 192 | +ScheduleApp.config([ | |
| 193 | + '$stateProvider', | |
| 194 | + '$urlRouterProvider', | |
| 195 | + function($stateProvider, $urlRouterProvider) { | |
| 196 | + // 默认路由 | |
| 197 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 198 | + | |
| 199 | + $stateProvider | |
| 200 | + .state("employeeInfoManage", { // index页面 | |
| 201 | + url: '/employeeInfoManage', | |
| 202 | + views: { | |
| 203 | + "": { | |
| 204 | + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html' | |
| 205 | + }, | |
| 206 | + "employeeInfoManage_list@employeeInfoManage": { | |
| 207 | + templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/list.html' | |
| 208 | + } | |
| 209 | + }, | |
| 210 | + | |
| 211 | + resolve: { | |
| 212 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 213 | + return $ocLazyLoad.load({ | |
| 214 | + name: 'employeeInfoManage_module', | |
| 215 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 216 | + files: [ | |
| 217 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 218 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 219 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 220 | + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 221 | + ] | |
| 222 | + }); | |
| 223 | + }] | |
| 224 | + } | |
| 225 | + }) | |
| 226 | + .state("employeeInfoManage_form", { // 添加人员信息form | |
| 227 | + url: '/employeeInfoManage_form', | |
| 228 | + views: { | |
| 229 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html'} | |
| 230 | + }, | |
| 231 | + resolve: { | |
| 232 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 233 | + return $ocLazyLoad.load({ | |
| 234 | + name: 'employeeInfoManage_form_module', | |
| 235 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 236 | + files: [ | |
| 237 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 238 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 239 | + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 240 | + ] | |
| 241 | + }); | |
| 242 | + }] | |
| 243 | + } | |
| 244 | + }) | |
| 245 | + .state("employeeInfoManage_edit", { // 修改人员信息form | |
| 246 | + url: '/employeeInfoManage_edit/:id', | |
| 247 | + views: { | |
| 248 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html'} | |
| 249 | + }, | |
| 250 | + resolve: { | |
| 251 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 252 | + return $ocLazyLoad.load({ | |
| 253 | + name: 'employeeInfoManage_edit_module', | |
| 254 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 255 | + files: [ | |
| 256 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 257 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 258 | + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 259 | + ] | |
| 260 | + }); | |
| 261 | + }] | |
| 262 | + } | |
| 263 | + }) | |
| 264 | + .state("employeeInfoManage_detail", { // 详细信息页面 | |
| 265 | + url: '/employeeInfoManage_detail/:id', | |
| 266 | + views: { | |
| 267 | + "": {templateUrl: 'pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html'} | |
| 268 | + }, | |
| 269 | + resolve: { | |
| 270 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 271 | + return $ocLazyLoad.load({ | |
| 272 | + name: 'employeeInfoManage_detail_module', | |
| 273 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 274 | + files: [ | |
| 275 | + "pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js" | |
| 276 | + ] | |
| 277 | + }); | |
| 278 | + }] | |
| 279 | + } | |
| 280 | + }) | |
| 281 | + | |
| 282 | +}]); | |
| 283 | +// ui route 配置 | |
| 284 | + | |
| 285 | +/** 车辆配置模块页面route */ | |
| 286 | +ScheduleApp.config([ | |
| 287 | + '$stateProvider', | |
| 288 | + '$urlRouterProvider', | |
| 289 | + function($stateProvider, $urlRouterProvider) { | |
| 290 | + // 默认路由 | |
| 291 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 292 | + | |
| 293 | + $stateProvider | |
| 294 | + .state("busConfig", { // index主页面 | |
| 295 | + url: '/busConfig', | |
| 296 | + views: { | |
| 297 | + "": { | |
| 298 | + templateUrl: 'pages/scheduleApp/module/core/busConfig/index.html' | |
| 299 | + }, | |
| 300 | + "busConfig_list@busConfig": { | |
| 301 | + templateUrl: 'pages/scheduleApp/module/core/busConfig/list.html' | |
| 302 | + } | |
| 303 | + }, | |
| 304 | + | |
| 305 | + resolve: { | |
| 306 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 307 | + return $ocLazyLoad.load({ | |
| 308 | + name: 'busConfig_module', | |
| 309 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 310 | + files: [ | |
| 311 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 312 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 313 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 314 | + "pages/scheduleApp/module/core/busConfig/module.js" | |
| 315 | + ] | |
| 316 | + }); | |
| 317 | + }] | |
| 318 | + } | |
| 319 | + }) | |
| 320 | + .state("busConfig_form", { // 添加页面 | |
| 321 | + url: '/busConfig_form', | |
| 322 | + views: { | |
| 323 | + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/form.html'} | |
| 324 | + }, | |
| 325 | + resolve: { | |
| 326 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 327 | + return $ocLazyLoad.load({ | |
| 328 | + name: 'busConfig_form_module', | |
| 329 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 330 | + files: [ | |
| 331 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 332 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 333 | + "pages/scheduleApp/module/core/busConfig/module.js" | |
| 334 | + ] | |
| 335 | + }); | |
| 336 | + }] | |
| 337 | + } | |
| 338 | + }) | |
| 339 | + .state("busConfig_edit", { // 修改页面 | |
| 340 | + url: '/busConfig_edit/:id', | |
| 341 | + views: { | |
| 342 | + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/edit.html'} | |
| 343 | + }, | |
| 344 | + resolve: { | |
| 345 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 346 | + return $ocLazyLoad.load({ | |
| 347 | + name: 'busConfig_edit_module', | |
| 348 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 349 | + files: [ | |
| 350 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 351 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 352 | + "pages/scheduleApp/module/core/busConfig/module.js" | |
| 353 | + ] | |
| 354 | + }); | |
| 355 | + }] | |
| 356 | + } | |
| 357 | + }) | |
| 358 | + .state("busConfig_detail", { // 详细信息页面 | |
| 359 | + url: '/busConfig_detail/:id', | |
| 360 | + views: { | |
| 361 | + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/detail.html'} | |
| 362 | + }, | |
| 363 | + resolve: { | |
| 364 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 365 | + return $ocLazyLoad.load({ | |
| 366 | + name: 'busConfig_detail_module', | |
| 367 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 368 | + files: [ | |
| 369 | + "pages/scheduleApp/module/core/busConfig/module.js" | |
| 370 | + ] | |
| 371 | + }); | |
| 372 | + }] | |
| 373 | + } | |
| 374 | + }); | |
| 375 | + } | |
| 376 | +]); | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | +// ui route 配置 | |
| 381 | + | |
| 382 | +/** 线路运营概览配置route */ | |
| 383 | +ScheduleApp.config([ | |
| 384 | + '$stateProvider', | |
| 385 | + '$urlRouterProvider', | |
| 386 | + function($stateProvider, $urlRouterProvider) { | |
| 387 | + // 默认路由 | |
| 388 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 389 | + | |
| 390 | + $stateProvider | |
| 391 | + .state("busLineInfoStat", { // index页面 | |
| 392 | + url: '/busLineInfoStat', | |
| 393 | + views: { | |
| 394 | + "": { | |
| 395 | + templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/index.html' | |
| 396 | + }, | |
| 397 | + "busLineInfoStat_list@busLineInfoStat": { | |
| 398 | + templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/list.html' | |
| 399 | + } | |
| 400 | + }, | |
| 401 | + | |
| 402 | + resolve: { | |
| 403 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 404 | + return $ocLazyLoad.load({ | |
| 405 | + name: 'busLineInfoStat_module', | |
| 406 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 407 | + files: [ | |
| 408 | + "pages/scheduleApp/module/core/busLineInfoStat/module.js" | |
| 409 | + ] | |
| 410 | + }); | |
| 411 | + }] | |
| 412 | + } | |
| 413 | + }); | |
| 414 | + | |
| 415 | + } | |
| 416 | +]); | |
| 417 | +// ui route 配置 | |
| 418 | + | |
| 419 | +/** 人员配置模块页面route */ | |
| 420 | +ScheduleApp.config([ | |
| 421 | + '$stateProvider', | |
| 422 | + '$urlRouterProvider', | |
| 423 | + function($stateProvider, $urlRouterProvider) { | |
| 424 | + // 默认路由 | |
| 425 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 426 | + | |
| 427 | + $stateProvider | |
| 428 | + .state("employeeConfig", { // index页面 | |
| 429 | + url: '/employeeConfig', | |
| 430 | + views: { | |
| 431 | + "": { | |
| 432 | + templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html' | |
| 433 | + }, | |
| 434 | + "employeeConfig_list@employeeConfig": { | |
| 435 | + templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html' | |
| 436 | + } | |
| 437 | + }, | |
| 438 | + | |
| 439 | + resolve: { | |
| 440 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 441 | + return $ocLazyLoad.load({ | |
| 442 | + name: 'employeeConfig_module', | |
| 443 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 444 | + files: [ | |
| 445 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 446 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 447 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 448 | + "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 449 | + ] | |
| 450 | + }); | |
| 451 | + }] | |
| 452 | + } | |
| 453 | + }) | |
| 454 | + .state("employeeConfig_form", { // 添加人员配置form | |
| 455 | + url: '/employeeConfig_form', | |
| 456 | + views: { | |
| 457 | + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/form.html'} | |
| 458 | + }, | |
| 459 | + resolve: { | |
| 460 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 461 | + return $ocLazyLoad.load({ | |
| 462 | + name: 'employeeConfig_form_module', | |
| 463 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 464 | + files: [ | |
| 465 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 466 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 467 | + "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 468 | + ] | |
| 469 | + }); | |
| 470 | + }] | |
| 471 | + } | |
| 472 | + }) | |
| 473 | + .state("employeeConfig_edit", { // 修改人员配置form | |
| 474 | + url: '/employeeConfig_edit/:id', | |
| 475 | + views: { | |
| 476 | + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/edit.html'} | |
| 477 | + }, | |
| 478 | + resolve: { | |
| 479 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 480 | + return $ocLazyLoad.load({ | |
| 481 | + name: 'employeeConfig_edit_module', | |
| 482 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 483 | + files: [ | |
| 484 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 485 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 486 | + "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 487 | + ] | |
| 488 | + }); | |
| 489 | + }] | |
| 490 | + } | |
| 491 | + }) | |
| 492 | + .state("employeeConfig_detail", { // 详细信息页面 | |
| 493 | + url: '/employeeConfig_detail/:id', | |
| 494 | + views: { | |
| 495 | + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/detail.html'} | |
| 496 | + }, | |
| 497 | + resolve: { | |
| 498 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 499 | + return $ocLazyLoad.load({ | |
| 500 | + name: 'employeeConfig_detail_module', | |
| 501 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 502 | + files: [ | |
| 503 | + "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 504 | + ] | |
| 505 | + }); | |
| 506 | + }] | |
| 507 | + } | |
| 508 | + }) | |
| 509 | + | |
| 510 | + } | |
| 511 | +]); | |
| 512 | +// ui route 配置 | |
| 513 | + | |
| 514 | +/** 路牌管理配置所有模块页面route */ | |
| 515 | +ScheduleApp.config([ | |
| 516 | + '$stateProvider', | |
| 517 | + '$urlRouterProvider', | |
| 518 | + function($stateProvider, $urlRouterProvider) { | |
| 519 | + // 默认路由 | |
| 520 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 521 | + | |
| 522 | + $stateProvider | |
| 523 | + .state("guideboardManage", { // index页面 | |
| 524 | + url: '/guideboardManage', | |
| 525 | + views: { | |
| 526 | + "": { | |
| 527 | + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html' | |
| 528 | + }, | |
| 529 | + "guideboardManage_list@guideboardManage": { | |
| 530 | + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html' | |
| 531 | + } | |
| 532 | + }, | |
| 533 | + | |
| 534 | + resolve: { | |
| 535 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 536 | + return $ocLazyLoad.load({ | |
| 537 | + name: 'guideboardManage_module', | |
| 538 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 539 | + files: [ | |
| 540 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 541 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 542 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 543 | + "pages/scheduleApp/module/core/guideboardManage/module.js" | |
| 544 | + ] | |
| 545 | + }); | |
| 546 | + }] | |
| 547 | + } | |
| 548 | + }) | |
| 549 | + .state("guideboardManage_detail", { // 详细信息页面 | |
| 550 | + url: '/guideboardManage_detail/:id', | |
| 551 | + views: { | |
| 552 | + "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'} | |
| 553 | + }, | |
| 554 | + resolve: { | |
| 555 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 556 | + return $ocLazyLoad.load({ | |
| 557 | + name: 'guideboardManage_detail_module', | |
| 558 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 559 | + files: [ | |
| 560 | + "pages/scheduleApp/module/core/guideboardManage/module.js" | |
| 561 | + ] | |
| 562 | + }); | |
| 563 | + }] | |
| 564 | + } | |
| 565 | + }) | |
| 566 | + | |
| 567 | +}]); | |
| 568 | +// ui route 配置 | |
| 569 | + | |
| 570 | +/** 套跑管理模块配置页面route */ | |
| 571 | +ScheduleApp.config([ | |
| 572 | + '$stateProvider', | |
| 573 | + '$urlRouterProvider', | |
| 574 | + function($stateProvider, $urlRouterProvider) { | |
| 575 | + // 默认路由 | |
| 576 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 577 | + | |
| 578 | + $stateProvider | |
| 579 | + .state("rerunManage", { // index页面 | |
| 580 | + url: '/rerunManage', | |
| 581 | + views: { | |
| 582 | + "": { | |
| 583 | + templateUrl: 'pages/scheduleApp/module/core/rerunManage/index.html' | |
| 584 | + }, | |
| 585 | + "rerunManage_list@rerunManage": { | |
| 586 | + templateUrl: 'pages/scheduleApp/module/core/rerunManage/list.html' | |
| 587 | + } | |
| 588 | + }, | |
| 589 | + | |
| 590 | + resolve: { | |
| 591 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 592 | + return $ocLazyLoad.load({ | |
| 593 | + name: 'rerunManage_module', | |
| 594 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 595 | + files: [ | |
| 596 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 597 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 598 | + "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 599 | + ] | |
| 600 | + }); | |
| 601 | + }] | |
| 602 | + } | |
| 603 | + }) | |
| 604 | + .state("rerunManage_form", { // 添加套跑form | |
| 605 | + url: '/rerunManage_form', | |
| 606 | + views: { | |
| 607 | + "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/form.html'} | |
| 608 | + }, | |
| 609 | + resolve: { | |
| 610 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 611 | + return $ocLazyLoad.load({ | |
| 612 | + name: 'rerunManage_form_module', | |
| 613 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 614 | + files: [ | |
| 615 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 616 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 617 | + "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 618 | + ] | |
| 619 | + }); | |
| 620 | + }] | |
| 621 | + } | |
| 622 | + }) | |
| 623 | + .state("rerunManage_edit", { // 修改套跑form | |
| 624 | + url: '/rerunManage_edit/:id', | |
| 625 | + views: { | |
| 626 | + "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/edit.html'} | |
| 627 | + }, | |
| 628 | + resolve: { | |
| 629 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 630 | + return $ocLazyLoad.load({ | |
| 631 | + name: 'rerunManage_edit_module', | |
| 632 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 633 | + files: [ | |
| 634 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 635 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 636 | + "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 637 | + ] | |
| 638 | + }); | |
| 639 | + }] | |
| 640 | + } | |
| 641 | + }) | |
| 642 | + .state("rerunManage_detail", { // 详细信息页面 | |
| 643 | + url: '/rerunManage_detail/:id', | |
| 644 | + views: { | |
| 645 | + "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/detail.html'} | |
| 646 | + }, | |
| 647 | + resolve: { | |
| 648 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 649 | + return $ocLazyLoad.load({ | |
| 650 | + name: 'rerunManage_detail_module', | |
| 651 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 652 | + files: [ | |
| 653 | + "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 654 | + ] | |
| 655 | + }); | |
| 656 | + }] | |
| 657 | + } | |
| 658 | + }) | |
| 659 | + } | |
| 660 | +]); | |
| 661 | +// ui route 配置 | |
| 662 | + | |
| 663 | +/** 排班计划管理配置route */ | |
| 664 | +ScheduleApp.config([ | |
| 665 | + '$stateProvider', | |
| 666 | + '$urlRouterProvider', | |
| 667 | + function($stateProvider, $urlRouterProvider) { | |
| 668 | + // 默认路由 | |
| 669 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 670 | + | |
| 671 | + $stateProvider | |
| 672 | + .state("schedulePlanManage", { // index页面 | |
| 673 | + url: '/schedulePlanManage', | |
| 674 | + views: { | |
| 675 | + "": { | |
| 676 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index.html' | |
| 677 | + }, | |
| 678 | + "schedulePlanManage_list@schedulePlanManage": { | |
| 679 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list.html' | |
| 680 | + } | |
| 681 | + }, | |
| 682 | + | |
| 683 | + resolve: { | |
| 684 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 685 | + return $ocLazyLoad.load({ | |
| 686 | + name: 'schedulePlanManage_module', | |
| 687 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 688 | + files: [ | |
| 689 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 690 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 691 | + "pages/scheduleApp/module/core/schedulePlanManage/module.js" | |
| 692 | + ] | |
| 693 | + }); | |
| 694 | + }] | |
| 695 | + } | |
| 696 | + }) | |
| 697 | + .state("schedulePlanManage_form", { // 添加排班计划form | |
| 698 | + url: '/schedulePlanManage_form', | |
| 699 | + views: { | |
| 700 | + "": { | |
| 701 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/form.html' | |
| 702 | + } | |
| 703 | + }, | |
| 704 | + | |
| 705 | + resolve: { | |
| 706 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 707 | + return $ocLazyLoad.load({ | |
| 708 | + name: 'schedulePlanManage_form_module', | |
| 709 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 710 | + files: [ | |
| 711 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 712 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 713 | + "pages/scheduleApp/module/core/schedulePlanManage/module.js" | |
| 714 | + ] | |
| 715 | + }); | |
| 716 | + }] | |
| 717 | + } | |
| 718 | + }) | |
| 719 | + | |
| 720 | + | |
| 721 | + } | |
| 722 | +]); | |
| 723 | +// ui route 配置 | |
| 724 | + | |
| 725 | +/** 排班计划明细配置route */ | |
| 726 | +ScheduleApp.config([ | |
| 727 | + '$stateProvider', | |
| 728 | + '$urlRouterProvider', | |
| 729 | + function($stateProvider, $urlRouterProvider) { | |
| 730 | + // 默认路由 | |
| 731 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 732 | + | |
| 733 | + $stateProvider | |
| 734 | + // 排班计划明细管理模块 | |
| 735 | + .state("schedulePlanInfoManage", { | |
| 736 | + url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime', | |
| 737 | + views: { | |
| 738 | + "": { | |
| 739 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/index_info.html' | |
| 740 | + }, | |
| 741 | + "schedulePlanInfoManage_list@schedulePlanInfoManage": { | |
| 742 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html' | |
| 743 | + } | |
| 744 | + }, | |
| 745 | + | |
| 746 | + resolve: { | |
| 747 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 748 | + return $ocLazyLoad.load({ | |
| 749 | + name: 'schedulePlanInfoManage_module', | |
| 750 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 751 | + files: [ | |
| 752 | + "pages/scheduleApp/module/core/schedulePlanManage/info/module.js" | |
| 753 | + ] | |
| 754 | + }); | |
| 755 | + }] | |
| 756 | + } | |
| 757 | + }); | |
| 758 | + | |
| 759 | + } | |
| 760 | +]); | |
| 761 | +// ui route 配置 | |
| 762 | + | |
| 763 | +/** 排班调度值勤日报配置route */ | |
| 764 | +ScheduleApp.config([ | |
| 765 | + '$stateProvider', | |
| 766 | + '$urlRouterProvider', | |
| 767 | + function($stateProvider, $urlRouterProvider) { | |
| 768 | + // 默认路由 | |
| 769 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 770 | + | |
| 771 | + $stateProvider | |
| 772 | + .state("schedulePlanReportManage", { | |
| 773 | + url: '/schedulePlanReportManage', | |
| 774 | + views: { | |
| 775 | + "": { | |
| 776 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/index_report.html' | |
| 777 | + }, | |
| 778 | + "schedulePlanReportManage_list@schedulePlanReportManage": { | |
| 779 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/list_report.html' | |
| 780 | + } | |
| 781 | + }, | |
| 782 | + | |
| 783 | + resolve: { | |
| 784 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 785 | + return $ocLazyLoad.load({ | |
| 786 | + name: 'schedulePlanManage_module', | |
| 787 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 788 | + files: [ | |
| 789 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 790 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 791 | + "pages/scheduleApp/module/core/schedulePlanManage/report/module.js" | |
| 792 | + ] | |
| 793 | + }); | |
| 794 | + }] | |
| 795 | + } | |
| 796 | + }) | |
| 797 | + .state("schedulePlanReportManage_edit", { | |
| 798 | + url: '/schedulePlanReportManage_edit', | |
| 799 | + params: {type: 0, groupInfo: null}, | |
| 800 | + views: { | |
| 801 | + "": { | |
| 802 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/edit_report.html' | |
| 803 | + } | |
| 804 | + }, | |
| 805 | + | |
| 806 | + resolve: { | |
| 807 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 808 | + return $ocLazyLoad.load({ | |
| 809 | + name: 'schedulePlanReportManage_edit_module', | |
| 810 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 811 | + files: [ | |
| 812 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 813 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 814 | + "pages/scheduleApp/module/core/schedulePlanManage/report/module.js" | |
| 815 | + ] | |
| 816 | + }); | |
| 817 | + }] | |
| 818 | + } | |
| 819 | + }); | |
| 820 | + | |
| 821 | + } | |
| 822 | +]); | |
| 823 | +// ui route 配置 | |
| 824 | + | |
| 825 | +/** 排班规则模块配置route */ | |
| 826 | +ScheduleApp.config([ | |
| 827 | + '$stateProvider', | |
| 828 | + '$urlRouterProvider', | |
| 829 | + function($stateProvider, $urlRouterProvider) { | |
| 830 | + // 默认路由 | |
| 831 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 832 | + | |
| 833 | + $stateProvider | |
| 834 | + .state("scheduleRuleManage", { // index页面 | |
| 835 | + url: '/scheduleRuleManage', | |
| 836 | + views: { | |
| 837 | + "": { | |
| 838 | + templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/index.html' | |
| 839 | + }, | |
| 840 | + "scheduleRuleManage_list@scheduleRuleManage": { | |
| 841 | + templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/list.html' | |
| 842 | + } | |
| 843 | + }, | |
| 844 | + | |
| 845 | + resolve: { | |
| 846 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 847 | + return $ocLazyLoad.load({ | |
| 848 | + name: 'scheduleRuleManage_module', | |
| 849 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 850 | + files: [ | |
| 851 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 852 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 853 | + "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 854 | + ] | |
| 855 | + }); | |
| 856 | + }] | |
| 857 | + } | |
| 858 | + }) | |
| 859 | + .state("scheduleRuleManage_form", { // 添加排班规则form | |
| 860 | + url: '/scheduleRuleManage_form', | |
| 861 | + views: { | |
| 862 | + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/form.html'} | |
| 863 | + }, | |
| 864 | + resolve: { | |
| 865 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 866 | + return $ocLazyLoad.load({ | |
| 867 | + name: 'scheduleRuleManage_form_module', | |
| 868 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 869 | + files: [ | |
| 870 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 871 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 872 | + "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 873 | + ] | |
| 874 | + }); | |
| 875 | + }] | |
| 876 | + } | |
| 877 | + }) | |
| 878 | + .state("scheduleRuleManage_edit", { // 修改排班规则form | |
| 879 | + url: '/scheduleRuleManage_edit/:id', | |
| 880 | + views: { | |
| 881 | + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/edit.html'} | |
| 882 | + }, | |
| 883 | + resolve: { | |
| 884 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 885 | + return $ocLazyLoad.load({ | |
| 886 | + name: 'scheduleRuleManage_edit_module', | |
| 887 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 888 | + files: [ | |
| 889 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 890 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 891 | + "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 892 | + ] | |
| 893 | + }); | |
| 894 | + }] | |
| 895 | + } | |
| 896 | + }) | |
| 897 | + .state("scheduleRuleManage_detail", { // 详细信息 | |
| 898 | + url: '/scheduleRuleManage_detail/:id', | |
| 899 | + views: { | |
| 900 | + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/detail.html'} | |
| 901 | + }, | |
| 902 | + resolve: { | |
| 903 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 904 | + return $ocLazyLoad.load({ | |
| 905 | + name: 'scheduleRuleManage_detail_module', | |
| 906 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 907 | + files: [ | |
| 908 | + "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 909 | + ] | |
| 910 | + }); | |
| 911 | + }] | |
| 912 | + } | |
| 913 | + }) | |
| 914 | + } | |
| 915 | +]); | |
| 916 | +// ui route 配置 | |
| 917 | + | |
| 918 | +/** 时刻表管理配置route */ | |
| 919 | +ScheduleApp.config([ | |
| 920 | + '$stateProvider', | |
| 921 | + '$urlRouterProvider', | |
| 922 | + function($stateProvider, $urlRouterProvider) { | |
| 923 | + // 默认路由 | |
| 924 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 925 | + | |
| 926 | + $stateProvider | |
| 927 | + .state("ttInfoManage", { // index页面 | |
| 928 | + url: '/ttInfoManage', | |
| 929 | + views: { | |
| 930 | + "": { | |
| 931 | + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html' | |
| 932 | + }, | |
| 933 | + "ttInfoManage_list@ttInfoManage": { | |
| 934 | + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html' | |
| 935 | + } | |
| 936 | + }, | |
| 937 | + | |
| 938 | + resolve: { | |
| 939 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 940 | + return $ocLazyLoad.load({ | |
| 941 | + name: 'ttInfoManage_module', | |
| 942 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 943 | + files: [ | |
| 944 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 945 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 946 | + "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 947 | + ] | |
| 948 | + }); | |
| 949 | + }] | |
| 950 | + } | |
| 951 | + }) | |
| 952 | + .state("ttInfoManage_form", { // 添加时刻表信息form | |
| 953 | + url: '/ttInfoManage_form', | |
| 954 | + views: { | |
| 955 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'} | |
| 956 | + }, | |
| 957 | + resolve: { | |
| 958 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 959 | + return $ocLazyLoad.load({ | |
| 960 | + name: 'ttInfoManage_form_module', | |
| 961 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 962 | + files: [ | |
| 963 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 964 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 965 | + "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 966 | + ] | |
| 967 | + }); | |
| 968 | + }] | |
| 969 | + } | |
| 970 | + }) | |
| 971 | + .state("ttInfoManage_edit", { // 修改时刻表信息form | |
| 972 | + url: '/ttInfoManage_edit/:id', | |
| 973 | + views: { | |
| 974 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'} | |
| 975 | + }, | |
| 976 | + resolve: { | |
| 977 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 978 | + return $ocLazyLoad.load({ | |
| 979 | + name: 'ttInfoManage_edit_module', | |
| 980 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 981 | + files: [ | |
| 982 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 983 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 984 | + "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 985 | + ] | |
| 986 | + }); | |
| 987 | + }] | |
| 988 | + } | |
| 989 | + }) | |
| 990 | + .state("ttInfoManage_detail", { // 时刻表详细信息 | |
| 991 | + url: '/ttInfoManage_detail/:id', | |
| 992 | + views: { | |
| 993 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'} | |
| 994 | + }, | |
| 995 | + resolve: { | |
| 996 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 997 | + return $ocLazyLoad.load({ | |
| 998 | + name: 'ttInfoManage_detail_module', | |
| 999 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 1000 | + files: [ | |
| 1001 | + "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 1002 | + ] | |
| 1003 | + }); | |
| 1004 | + }] | |
| 1005 | + } | |
| 1006 | + }); | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + } | |
| 1010 | +]); | |
| 1011 | +// ui route 配置 | |
| 1012 | + | |
| 1013 | +/** 时刻表编辑管理配置route */ | |
| 1014 | +ScheduleApp.config([ | |
| 1015 | + '$stateProvider', | |
| 1016 | + '$urlRouterProvider', | |
| 1017 | + function($stateProvider, $urlRouterProvider) { | |
| 1018 | + // 默认路由 | |
| 1019 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 1020 | + | |
| 1021 | + $stateProvider | |
| 1022 | + .state("ttInfoDetailManage_form", { // 时刻表明细导入 | |
| 1023 | + url: '/ttInfoDetailManage_form/:xlid/:ttid/:xlname/:ttname', | |
| 1024 | + views: { | |
| 1025 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/form.html'} | |
| 1026 | + }, | |
| 1027 | + resolve: { | |
| 1028 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 1029 | + return $ocLazyLoad.load({ | |
| 1030 | + name: 'ttInfoDetailManage_form_module', | |
| 1031 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 1032 | + files: [ | |
| 1033 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 1034 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 1035 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 1036 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/module.js" | |
| 1037 | + ] | |
| 1038 | + }); | |
| 1039 | + }] | |
| 1040 | + } | |
| 1041 | + }) | |
| 1042 | + .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑 | |
| 1043 | + url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname', | |
| 1044 | + views: { | |
| 1045 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'} | |
| 1046 | + }, | |
| 1047 | + resolve: { | |
| 1048 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 1049 | + return $ocLazyLoad.load({ | |
| 1050 | + name: 'ttInfoDetailManage_edit_module', | |
| 1051 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 1052 | + files: [ | |
| 1053 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 1054 | + ] | |
| 1055 | + }); | |
| 1056 | + }] | |
| 1057 | + } | |
| 1058 | + }) | |
| 1059 | + .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑 | |
| 1060 | + url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname', | |
| 1061 | + views: { | |
| 1062 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'} | |
| 1063 | + }, | |
| 1064 | + resolve: { | |
| 1065 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 1066 | + return $ocLazyLoad.load({ | |
| 1067 | + name: 'ttInfoDetailManage_detail_edit_module', | |
| 1068 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 1069 | + files: [ | |
| 1070 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 1071 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 1072 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 1073 | + ] | |
| 1074 | + }); | |
| 1075 | + }] | |
| 1076 | + } | |
| 1077 | + }); | |
| 1078 | + | |
| 1079 | + } | |
| 1080 | 1080 | ]); |
| 1081 | 1081 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/module.js
| 1 | -// 车辆配置管理 service controller 等写在一起 | |
| 2 | -angular.module('ScheduleApp').factory('BusConfigService', ['BusConfigService_g', function(service) { | |
| 3 | - /** 当前的查询条件信息 */ | |
| 4 | - var currentSearchCondition = {'isCancel_eq': false}; | |
| 5 | - | |
| 6 | - /** 当前第几页 */ | |
| 7 | - var currentPageNo = 1; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = undefined; | |
| 24 | - } | |
| 25 | - currentSearchCondition['isCancel_eq'] = false; | |
| 26 | - }, | |
| 27 | - /** | |
| 28 | - * 设置当前页码。 | |
| 29 | - * @param cpn 从1开始,后台是从0开始的 | |
| 30 | - */ | |
| 31 | - setCurrentPageNo: function(cpn) { | |
| 32 | - currentPageNo = cpn; | |
| 33 | - }, | |
| 34 | - /** | |
| 35 | - * 组装查询参数,返回一个promise查询结果。 | |
| 36 | - * @param params 查询参数 | |
| 37 | - * @return 返回一个 promise | |
| 38 | - */ | |
| 39 | - getPage: function() { | |
| 40 | - var params = currentSearchCondition; // 查询条件 | |
| 41 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | - return service.rest.list(params).$promise; | |
| 43 | - }, | |
| 44 | - /** | |
| 45 | - * 获取明细信息。 | |
| 46 | - * @param id 车辆id | |
| 47 | - * @return 返回一个 promise | |
| 48 | - */ | |
| 49 | - getDetail: function(id) { | |
| 50 | - var params = {id: id}; | |
| 51 | - return service.rest.get(params).$promise; | |
| 52 | - }, | |
| 53 | - /** | |
| 54 | - * 保存信息。 | |
| 55 | - * @param obj 车辆详细信息 | |
| 56 | - * @return 返回一个 promise | |
| 57 | - */ | |
| 58 | - saveDetail: function(obj) { | |
| 59 | - return service.rest.save(obj).$promise; | |
| 60 | - }, | |
| 61 | - /** | |
| 62 | - * 删除信息。 | |
| 63 | - * @param id 主键id | |
| 64 | - * @returns {*|Function|promise|n} | |
| 65 | - */ | |
| 66 | - deleteDetail: function(id) { | |
| 67 | - return service.rest.delete({id: id}).$promise; | |
| 68 | - } | |
| 69 | - }; | |
| 70 | - | |
| 71 | -}]); | |
| 72 | - | |
| 73 | -angular.module('ScheduleApp').controller('BusConfigCtrl', ['BusConfigService', '$state', '$uibModal', function(busConfigService, $state, $uibModal) { | |
| 74 | - var self = this; | |
| 75 | - | |
| 76 | - // 切换到form状态 | |
| 77 | - self.goForm = function() { | |
| 78 | - //alert("切换"); | |
| 79 | - $state.go("busConfig_form"); | |
| 80 | - }; | |
| 81 | - | |
| 82 | - // 导入excel | |
| 83 | - self.importData = function() { | |
| 84 | - // large方式弹出模态对话框 | |
| 85 | - var modalInstance = $uibModal.open({ | |
| 86 | - templateUrl: '/pages/scheduleApp/module/core/busConfig/dataImport.html', | |
| 87 | - size: "lg", | |
| 88 | - animation: true, | |
| 89 | - backdrop: 'static', | |
| 90 | - resolve: { | |
| 91 | - // 可以传值给controller | |
| 92 | - }, | |
| 93 | - windowClass: 'center-modal', | |
| 94 | - controller: "BusConfigToolsCtrl", | |
| 95 | - controllerAs: "ctrl", | |
| 96 | - bindToController: true | |
| 97 | - }); | |
| 98 | - modalInstance.result.then( | |
| 99 | - function() { | |
| 100 | - console.log("dataImport.html打开"); | |
| 101 | - }, | |
| 102 | - function() { | |
| 103 | - console.log("dataImport.html消失"); | |
| 104 | - } | |
| 105 | - ); | |
| 106 | - }; | |
| 107 | -}]); | |
| 108 | - | |
| 109 | -angular.module('ScheduleApp').controller('BusConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 110 | - var self = this; | |
| 111 | - self.data = "TODO"; | |
| 112 | - | |
| 113 | - // 关闭窗口 | |
| 114 | - self.close = function() { | |
| 115 | - $modalInstance.dismiss("cancel"); | |
| 116 | - }; | |
| 117 | - | |
| 118 | - self.clearInputFile = function() { | |
| 119 | - angular.element("input[type='file']").val(null); | |
| 120 | - }; | |
| 121 | - | |
| 122 | - // 上传文件组件 | |
| 123 | - self.uploader = new FileUploader({ | |
| 124 | - url: "/cci/dataImport", | |
| 125 | - filters: [] // 用于过滤文件,比如只允许导入excel | |
| 126 | - }); | |
| 127 | - self.uploader.onAfterAddingFile = function(fileItem) | |
| 128 | - { | |
| 129 | - console.info('onAfterAddingFile', fileItem); | |
| 130 | - console.log(self.uploader.queue.length); | |
| 131 | - if (self.uploader.queue.length > 1) | |
| 132 | - self.uploader.removeFromQueue(0); | |
| 133 | - }; | |
| 134 | - self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 135 | - { | |
| 136 | - console.info('onSuccessItem', fileItem, response, status, headers); | |
| 137 | - }; | |
| 138 | - self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 139 | - { | |
| 140 | - console.info('onErrorItem', fileItem, response, status, headers); | |
| 141 | - }; | |
| 142 | - | |
| 143 | -}]); | |
| 144 | - | |
| 145 | -angular.module('ScheduleApp').controller('BusConfigListCtrl', ['BusConfigService', function(busConfigService) { | |
| 146 | - var self = this; | |
| 147 | - self.pageInfo = { | |
| 148 | - totalItems : 0, | |
| 149 | - currentPage : 1, | |
| 150 | - infos: [] | |
| 151 | - }; | |
| 152 | - | |
| 153 | - // 初始创建的时候,获取一次列表数据 | |
| 154 | - busConfigService.getPage().then( | |
| 155 | - function(result) { | |
| 156 | - self.pageInfo.totalItems = result.totalElements; | |
| 157 | - self.pageInfo.currentPage = result.number + 1; | |
| 158 | - self.pageInfo.infos = result.content; | |
| 159 | - busConfigService.setCurrentPageNo(result.number + 1); | |
| 160 | - }, | |
| 161 | - function(result) { | |
| 162 | - alert("出错啦!"); | |
| 163 | - } | |
| 164 | - ); | |
| 165 | - | |
| 166 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 167 | - // alert("dfdfdf"); | |
| 168 | - //}); | |
| 169 | - | |
| 170 | - // 翻页的时候调用 | |
| 171 | - self.pageChanaged = function() { | |
| 172 | - busConfigService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 173 | - busConfigService.getPage().then( | |
| 174 | - function(result) { | |
| 175 | - self.pageInfo.totalItems = result.totalElements; | |
| 176 | - self.pageInfo.currentPage = result.number + 1; | |
| 177 | - self.pageInfo.infos = result.content; | |
| 178 | - busConfigService.setCurrentPageNo(result.number + 1); | |
| 179 | - }, | |
| 180 | - function(result) { | |
| 181 | - alert("出错啦!"); | |
| 182 | - } | |
| 183 | - ); | |
| 184 | - }; | |
| 185 | - // 获取查询条件数据 | |
| 186 | - self.searchCondition = function() { | |
| 187 | - return busConfigService.getSearchCondition(); | |
| 188 | - }; | |
| 189 | - // 重置查询条件 | |
| 190 | - self.resetSearchCondition = function() { | |
| 191 | - busConfigService.resetSearchCondition(); | |
| 192 | - self.pageInfo.currentPage = 1; | |
| 193 | - self.pageChanaged(); | |
| 194 | - }; | |
| 195 | - | |
| 196 | - // 删除时刻表 | |
| 197 | - self.deleteEci = function(id) { | |
| 198 | - // TODO: | |
| 199 | - busConfigService.deleteDetail(id).then( | |
| 200 | - function(result) { | |
| 201 | - if (result.message) { // 暂时这样做,之后全局拦截 | |
| 202 | - alert("失败:" + result.message); | |
| 203 | - } else { | |
| 204 | - alert("作废成功!"); | |
| 205 | - | |
| 206 | - busConfigService.getPage().then( | |
| 207 | - function(result) { | |
| 208 | - self.pageInfo.totalItems = result.totalElements; | |
| 209 | - self.pageInfo.currentPage = result.number + 1; | |
| 210 | - self.pageInfo.infos = result.content; | |
| 211 | - busConfigService.setCurrentPageNo(result.number + 1); | |
| 212 | - }, | |
| 213 | - function(result) { | |
| 214 | - alert("出错啦!"); | |
| 215 | - } | |
| 216 | - ); | |
| 217 | - } | |
| 218 | - | |
| 219 | - }, | |
| 220 | - function(result) { | |
| 221 | - alert("出错啦!" + result); | |
| 222 | - } | |
| 223 | - ); | |
| 224 | - }; | |
| 225 | - | |
| 226 | - // 撤销修改 | |
| 227 | - self.redoDeleteEci = function(id) { | |
| 228 | - busConfigService.getDetail(id).then( | |
| 229 | - function(result) { | |
| 230 | - result.isCancel = 'false'; | |
| 231 | - busConfigService.saveDetail(result).then( | |
| 232 | - function(result) { | |
| 233 | - if (result.message) { // 暂时这样做,之后全局拦截 | |
| 234 | - alert("失败:" + result.message); | |
| 235 | - } else { | |
| 236 | - alert("撤销成功!"); | |
| 237 | - | |
| 238 | - busConfigService.getPage().then( | |
| 239 | - function(result) { | |
| 240 | - self.pageInfo.totalItems = result.totalElements; | |
| 241 | - self.pageInfo.currentPage = result.number + 1; | |
| 242 | - self.pageInfo.infos = result.content; | |
| 243 | - busConfigService.setCurrentPageNo(result.number + 1); | |
| 244 | - }, | |
| 245 | - function(result) { | |
| 246 | - alert("出错啦!"); | |
| 247 | - } | |
| 248 | - ); | |
| 249 | - } | |
| 250 | - }, | |
| 251 | - function(result) { | |
| 252 | - // TODO:弹出框方式以后改 | |
| 253 | - alert("出错啦!"); | |
| 254 | - } | |
| 255 | - ); | |
| 256 | - }, | |
| 257 | - function(result) { | |
| 258 | - // TODO:弹出框方式以后改 | |
| 259 | - alert("出错啦!"); | |
| 260 | - } | |
| 261 | - ); | |
| 262 | - }; | |
| 263 | - | |
| 264 | -}]); | |
| 265 | - | |
| 266 | -angular.module('ScheduleApp').controller('BusConfigFormCtrl', ['BusConfigService', '$stateParams', '$state', '$scope', function(busConfigService, $stateParams, $state, $scope) { | |
| 267 | - var self = this; | |
| 268 | - | |
| 269 | - // 启用日期 日期控件开关 | |
| 270 | - self.qyrqOpen = false; | |
| 271 | - self.qyrq_open = function() { | |
| 272 | - self.qyrqOpen = true; | |
| 273 | - }; | |
| 274 | - | |
| 275 | - // 终止日期 日期控件开关 | |
| 276 | - self.zzrqOpen = false; | |
| 277 | - self.zzrq_open = function() { | |
| 278 | - self.zzrqOpen = true; | |
| 279 | - }; | |
| 280 | - | |
| 281 | - // 欲保存的busInfo信息,绑定 | |
| 282 | - self.busConfigForSave = {xl:{}, cl:{}}; | |
| 283 | - | |
| 284 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 285 | - var id = $stateParams.id; | |
| 286 | - if (id) { | |
| 287 | - self.busConfigForSave.id = id; | |
| 288 | - busConfigService.getDetail(id).then( | |
| 289 | - function(result) { | |
| 290 | - var key; | |
| 291 | - for (key in result) { | |
| 292 | - self.busConfigForSave[key] = result[key]; | |
| 293 | - } | |
| 294 | - }, | |
| 295 | - function(result) { | |
| 296 | - alert("出错啦!"); | |
| 297 | - } | |
| 298 | - ); | |
| 299 | - } | |
| 300 | - | |
| 301 | - // 提交方法 | |
| 302 | - self.submit = function() { | |
| 303 | - console.log(self.busConfigForSave); | |
| 304 | - busConfigService.saveDetail(self.busConfigForSave).then( | |
| 305 | - function(result) { | |
| 306 | - // TODO:弹出框方式以后改 | |
| 307 | - if (result.status == 'SUCCESS') { | |
| 308 | - alert("保存成功!"); | |
| 309 | - $state.go("busConfig"); | |
| 310 | - } else { | |
| 311 | - alert("保存异常!"); | |
| 312 | - } | |
| 313 | - }, | |
| 314 | - function(result) { | |
| 315 | - // TODO:弹出框方式以后改 | |
| 316 | - alert("出错啦!"); | |
| 317 | - } | |
| 318 | - ); | |
| 319 | - }; | |
| 320 | -}]); | |
| 321 | - | |
| 322 | -angular.module('ScheduleApp').controller('BusConfigDetailCtrl', ['BusConfigService', '$stateParams', function(busConfigService, $stateParams) { | |
| 323 | - var self = this; | |
| 324 | - self.title = ""; | |
| 325 | - self.busConfigForDetail = {}; | |
| 326 | - self.busConfigForDetail.id = $stateParams.id; | |
| 327 | - | |
| 328 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 329 | - busConfigService.getDetail($stateParams.id).then( | |
| 330 | - function(result) { | |
| 331 | - var key; | |
| 332 | - for (key in result) { | |
| 333 | - self.busConfigForDetail[key] = result[key]; | |
| 334 | - } | |
| 335 | - | |
| 336 | - self.title = "车辆 " + self.busConfigForDetail.cl.insideCode + " 配置详细信息"; | |
| 337 | - }, | |
| 338 | - function(result) { | |
| 339 | - // TODO:弹出框方式以后改 | |
| 340 | - alert("出错啦!"); | |
| 341 | - } | |
| 342 | - ); | |
| 343 | -}]); | |
| 344 | - | |
| 345 | - | |
| 346 | - | |
| 1 | +// 车辆配置管理 service controller 等写在一起 | |
| 2 | +angular.module('ScheduleApp').factory('BusConfigService', ['BusConfigService_g', function(service) { | |
| 3 | + /** 当前的查询条件信息 */ | |
| 4 | + var currentSearchCondition = {'isCancel_eq': false}; | |
| 5 | + | |
| 6 | + /** 当前第几页 */ | |
| 7 | + var currentPageNo = 1; | |
| 8 | + | |
| 9 | + return { | |
| 10 | + /** | |
| 11 | + * 获取查询条件信息, | |
| 12 | + * 用于给controller用来和页面数据绑定。 | |
| 13 | + */ | |
| 14 | + getSearchCondition: function() { | |
| 15 | + return currentSearchCondition; | |
| 16 | + }, | |
| 17 | + /** | |
| 18 | + * 重置查询条件信息。 | |
| 19 | + */ | |
| 20 | + resetSearchCondition: function() { | |
| 21 | + var key; | |
| 22 | + for (key in currentSearchCondition) { | |
| 23 | + currentSearchCondition[key] = undefined; | |
| 24 | + } | |
| 25 | + currentSearchCondition['isCancel_eq'] = false; | |
| 26 | + }, | |
| 27 | + /** | |
| 28 | + * 设置当前页码。 | |
| 29 | + * @param cpn 从1开始,后台是从0开始的 | |
| 30 | + */ | |
| 31 | + setCurrentPageNo: function(cpn) { | |
| 32 | + currentPageNo = cpn; | |
| 33 | + }, | |
| 34 | + /** | |
| 35 | + * 组装查询参数,返回一个promise查询结果。 | |
| 36 | + * @param params 查询参数 | |
| 37 | + * @return 返回一个 promise | |
| 38 | + */ | |
| 39 | + getPage: function() { | |
| 40 | + var params = currentSearchCondition; // 查询条件 | |
| 41 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | + return service.rest.list(params).$promise; | |
| 43 | + }, | |
| 44 | + /** | |
| 45 | + * 获取明细信息。 | |
| 46 | + * @param id 车辆id | |
| 47 | + * @return 返回一个 promise | |
| 48 | + */ | |
| 49 | + getDetail: function(id) { | |
| 50 | + var params = {id: id}; | |
| 51 | + return service.rest.get(params).$promise; | |
| 52 | + }, | |
| 53 | + /** | |
| 54 | + * 保存信息。 | |
| 55 | + * @param obj 车辆详细信息 | |
| 56 | + * @return 返回一个 promise | |
| 57 | + */ | |
| 58 | + saveDetail: function(obj) { | |
| 59 | + return service.rest.save(obj).$promise; | |
| 60 | + }, | |
| 61 | + /** | |
| 62 | + * 删除信息。 | |
| 63 | + * @param id 主键id | |
| 64 | + * @returns {*|Function|promise|n} | |
| 65 | + */ | |
| 66 | + deleteDetail: function(id) { | |
| 67 | + return service.rest.delete({id: id}).$promise; | |
| 68 | + } | |
| 69 | + }; | |
| 70 | + | |
| 71 | +}]); | |
| 72 | + | |
| 73 | +angular.module('ScheduleApp').controller('BusConfigCtrl', ['BusConfigService', '$state', '$uibModal', function(busConfigService, $state, $uibModal) { | |
| 74 | + var self = this; | |
| 75 | + | |
| 76 | + // 切换到form状态 | |
| 77 | + self.goForm = function() { | |
| 78 | + //alert("切换"); | |
| 79 | + $state.go("busConfig_form"); | |
| 80 | + }; | |
| 81 | + | |
| 82 | + // 导入excel | |
| 83 | + self.importData = function() { | |
| 84 | + // large方式弹出模态对话框 | |
| 85 | + var modalInstance = $uibModal.open({ | |
| 86 | + templateUrl: '/pages/scheduleApp/module/core/busConfig/dataImport.html', | |
| 87 | + size: "lg", | |
| 88 | + animation: true, | |
| 89 | + backdrop: 'static', | |
| 90 | + resolve: { | |
| 91 | + // 可以传值给controller | |
| 92 | + }, | |
| 93 | + windowClass: 'center-modal', | |
| 94 | + controller: "BusConfigToolsCtrl", | |
| 95 | + controllerAs: "ctrl", | |
| 96 | + bindToController: true | |
| 97 | + }); | |
| 98 | + modalInstance.result.then( | |
| 99 | + function() { | |
| 100 | + console.log("dataImport.html打开"); | |
| 101 | + }, | |
| 102 | + function() { | |
| 103 | + console.log("dataImport.html消失"); | |
| 104 | + } | |
| 105 | + ); | |
| 106 | + }; | |
| 107 | +}]); | |
| 108 | + | |
| 109 | +angular.module('ScheduleApp').controller('BusConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 110 | + var self = this; | |
| 111 | + self.data = "TODO"; | |
| 112 | + | |
| 113 | + // 关闭窗口 | |
| 114 | + self.close = function() { | |
| 115 | + $modalInstance.dismiss("cancel"); | |
| 116 | + }; | |
| 117 | + | |
| 118 | + self.clearInputFile = function() { | |
| 119 | + angular.element("input[type='file']").val(null); | |
| 120 | + }; | |
| 121 | + | |
| 122 | + // 上传文件组件 | |
| 123 | + self.uploader = new FileUploader({ | |
| 124 | + url: "/cci/dataImport", | |
| 125 | + filters: [] // 用于过滤文件,比如只允许导入excel | |
| 126 | + }); | |
| 127 | + self.uploader.onAfterAddingFile = function(fileItem) | |
| 128 | + { | |
| 129 | + console.info('onAfterAddingFile', fileItem); | |
| 130 | + console.log(self.uploader.queue.length); | |
| 131 | + if (self.uploader.queue.length > 1) | |
| 132 | + self.uploader.removeFromQueue(0); | |
| 133 | + }; | |
| 134 | + self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 135 | + { | |
| 136 | + console.info('onSuccessItem', fileItem, response, status, headers); | |
| 137 | + }; | |
| 138 | + self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 139 | + { | |
| 140 | + console.info('onErrorItem', fileItem, response, status, headers); | |
| 141 | + }; | |
| 142 | + | |
| 143 | +}]); | |
| 144 | + | |
| 145 | +angular.module('ScheduleApp').controller('BusConfigListCtrl', ['BusConfigService', function(busConfigService) { | |
| 146 | + var self = this; | |
| 147 | + self.pageInfo = { | |
| 148 | + totalItems : 0, | |
| 149 | + currentPage : 1, | |
| 150 | + infos: [] | |
| 151 | + }; | |
| 152 | + | |
| 153 | + // 初始创建的时候,获取一次列表数据 | |
| 154 | + busConfigService.getPage().then( | |
| 155 | + function(result) { | |
| 156 | + self.pageInfo.totalItems = result.totalElements; | |
| 157 | + self.pageInfo.currentPage = result.number + 1; | |
| 158 | + self.pageInfo.infos = result.content; | |
| 159 | + busConfigService.setCurrentPageNo(result.number + 1); | |
| 160 | + }, | |
| 161 | + function(result) { | |
| 162 | + alert("出错啦!"); | |
| 163 | + } | |
| 164 | + ); | |
| 165 | + | |
| 166 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 167 | + // alert("dfdfdf"); | |
| 168 | + //}); | |
| 169 | + | |
| 170 | + // 翻页的时候调用 | |
| 171 | + self.pageChanaged = function() { | |
| 172 | + busConfigService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 173 | + busConfigService.getPage().then( | |
| 174 | + function(result) { | |
| 175 | + self.pageInfo.totalItems = result.totalElements; | |
| 176 | + self.pageInfo.currentPage = result.number + 1; | |
| 177 | + self.pageInfo.infos = result.content; | |
| 178 | + busConfigService.setCurrentPageNo(result.number + 1); | |
| 179 | + }, | |
| 180 | + function(result) { | |
| 181 | + alert("出错啦!"); | |
| 182 | + } | |
| 183 | + ); | |
| 184 | + }; | |
| 185 | + // 获取查询条件数据 | |
| 186 | + self.searchCondition = function() { | |
| 187 | + return busConfigService.getSearchCondition(); | |
| 188 | + }; | |
| 189 | + // 重置查询条件 | |
| 190 | + self.resetSearchCondition = function() { | |
| 191 | + busConfigService.resetSearchCondition(); | |
| 192 | + self.pageInfo.currentPage = 1; | |
| 193 | + self.pageChanaged(); | |
| 194 | + }; | |
| 195 | + | |
| 196 | + // 删除时刻表 | |
| 197 | + self.deleteEci = function(id) { | |
| 198 | + // TODO: | |
| 199 | + busConfigService.deleteDetail(id).then( | |
| 200 | + function(result) { | |
| 201 | + if (result.message) { // 暂时这样做,之后全局拦截 | |
| 202 | + alert("失败:" + result.message); | |
| 203 | + } else { | |
| 204 | + alert("作废成功!"); | |
| 205 | + | |
| 206 | + busConfigService.getPage().then( | |
| 207 | + function(result) { | |
| 208 | + self.pageInfo.totalItems = result.totalElements; | |
| 209 | + self.pageInfo.currentPage = result.number + 1; | |
| 210 | + self.pageInfo.infos = result.content; | |
| 211 | + busConfigService.setCurrentPageNo(result.number + 1); | |
| 212 | + }, | |
| 213 | + function(result) { | |
| 214 | + alert("出错啦!"); | |
| 215 | + } | |
| 216 | + ); | |
| 217 | + } | |
| 218 | + | |
| 219 | + }, | |
| 220 | + function(result) { | |
| 221 | + alert("出错啦!" + result); | |
| 222 | + } | |
| 223 | + ); | |
| 224 | + }; | |
| 225 | + | |
| 226 | + // 撤销修改 | |
| 227 | + self.redoDeleteEci = function(id) { | |
| 228 | + busConfigService.getDetail(id).then( | |
| 229 | + function(result) { | |
| 230 | + result.isCancel = 'false'; | |
| 231 | + busConfigService.saveDetail(result).then( | |
| 232 | + function(result) { | |
| 233 | + if (result.message) { // 暂时这样做,之后全局拦截 | |
| 234 | + alert("失败:" + result.message); | |
| 235 | + } else { | |
| 236 | + alert("撤销成功!"); | |
| 237 | + | |
| 238 | + busConfigService.getPage().then( | |
| 239 | + function(result) { | |
| 240 | + self.pageInfo.totalItems = result.totalElements; | |
| 241 | + self.pageInfo.currentPage = result.number + 1; | |
| 242 | + self.pageInfo.infos = result.content; | |
| 243 | + busConfigService.setCurrentPageNo(result.number + 1); | |
| 244 | + }, | |
| 245 | + function(result) { | |
| 246 | + alert("出错啦!"); | |
| 247 | + } | |
| 248 | + ); | |
| 249 | + } | |
| 250 | + }, | |
| 251 | + function(result) { | |
| 252 | + // TODO:弹出框方式以后改 | |
| 253 | + alert("出错啦!"); | |
| 254 | + } | |
| 255 | + ); | |
| 256 | + }, | |
| 257 | + function(result) { | |
| 258 | + // TODO:弹出框方式以后改 | |
| 259 | + alert("出错啦!"); | |
| 260 | + } | |
| 261 | + ); | |
| 262 | + }; | |
| 263 | + | |
| 264 | +}]); | |
| 265 | + | |
| 266 | +angular.module('ScheduleApp').controller('BusConfigFormCtrl', ['BusConfigService', '$stateParams', '$state', '$scope', function(busConfigService, $stateParams, $state, $scope) { | |
| 267 | + var self = this; | |
| 268 | + | |
| 269 | + // 启用日期 日期控件开关 | |
| 270 | + self.qyrqOpen = false; | |
| 271 | + self.qyrq_open = function() { | |
| 272 | + self.qyrqOpen = true; | |
| 273 | + }; | |
| 274 | + | |
| 275 | + // 终止日期 日期控件开关 | |
| 276 | + self.zzrqOpen = false; | |
| 277 | + self.zzrq_open = function() { | |
| 278 | + self.zzrqOpen = true; | |
| 279 | + }; | |
| 280 | + | |
| 281 | + // 欲保存的busInfo信息,绑定 | |
| 282 | + self.busConfigForSave = {xl:{}, cl:{}}; | |
| 283 | + | |
| 284 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 285 | + var id = $stateParams.id; | |
| 286 | + if (id) { | |
| 287 | + self.busConfigForSave.id = id; | |
| 288 | + busConfigService.getDetail(id).then( | |
| 289 | + function(result) { | |
| 290 | + var key; | |
| 291 | + for (key in result) { | |
| 292 | + self.busConfigForSave[key] = result[key]; | |
| 293 | + } | |
| 294 | + }, | |
| 295 | + function(result) { | |
| 296 | + alert("出错啦!"); | |
| 297 | + } | |
| 298 | + ); | |
| 299 | + } | |
| 300 | + | |
| 301 | + // 提交方法 | |
| 302 | + self.submit = function() { | |
| 303 | + console.log(self.busConfigForSave); | |
| 304 | + busConfigService.saveDetail(self.busConfigForSave).then( | |
| 305 | + function(result) { | |
| 306 | + // TODO:弹出框方式以后改 | |
| 307 | + if (result.status == 'SUCCESS') { | |
| 308 | + alert("保存成功!"); | |
| 309 | + $state.go("busConfig"); | |
| 310 | + } else { | |
| 311 | + alert("保存异常!"); | |
| 312 | + } | |
| 313 | + }, | |
| 314 | + function(result) { | |
| 315 | + // TODO:弹出框方式以后改 | |
| 316 | + alert("出错啦!"); | |
| 317 | + } | |
| 318 | + ); | |
| 319 | + }; | |
| 320 | +}]); | |
| 321 | + | |
| 322 | +angular.module('ScheduleApp').controller('BusConfigDetailCtrl', ['BusConfigService', '$stateParams', function(busConfigService, $stateParams) { | |
| 323 | + var self = this; | |
| 324 | + self.title = ""; | |
| 325 | + self.busConfigForDetail = {}; | |
| 326 | + self.busConfigForDetail.id = $stateParams.id; | |
| 327 | + | |
| 328 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 329 | + busConfigService.getDetail($stateParams.id).then( | |
| 330 | + function(result) { | |
| 331 | + var key; | |
| 332 | + for (key in result) { | |
| 333 | + self.busConfigForDetail[key] = result[key]; | |
| 334 | + } | |
| 335 | + | |
| 336 | + self.title = "车辆 " + self.busConfigForDetail.cl.insideCode + " 配置详细信息"; | |
| 337 | + }, | |
| 338 | + function(result) { | |
| 339 | + // TODO:弹出框方式以后改 | |
| 340 | + alert("出错啦!"); | |
| 341 | + } | |
| 342 | + ); | |
| 343 | +}]); | |
| 344 | + | |
| 345 | + | |
| 346 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/busConfig/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 车辆配置模块页面route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("busConfig", { // index主页面 | |
| 13 | - url: '/busConfig', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/core/busConfig/index.html' | |
| 17 | - }, | |
| 18 | - "busConfig_list@busConfig": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/core/busConfig/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'busConfig_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | - "pages/scheduleApp/module/core/busConfig/module.js" | |
| 33 | - ] | |
| 34 | - }); | |
| 35 | - }] | |
| 36 | - } | |
| 37 | - }) | |
| 38 | - .state("busConfig_form", { // 添加页面 | |
| 39 | - url: '/busConfig_form', | |
| 40 | - views: { | |
| 41 | - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/form.html'} | |
| 42 | - }, | |
| 43 | - resolve: { | |
| 44 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | - return $ocLazyLoad.load({ | |
| 46 | - name: 'busConfig_form_module', | |
| 47 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | - files: [ | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | - "pages/scheduleApp/module/core/busConfig/module.js" | |
| 52 | - ] | |
| 53 | - }); | |
| 54 | - }] | |
| 55 | - } | |
| 56 | - }) | |
| 57 | - .state("busConfig_edit", { // 修改页面 | |
| 58 | - url: '/busConfig_edit/:id', | |
| 59 | - views: { | |
| 60 | - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/edit.html'} | |
| 61 | - }, | |
| 62 | - resolve: { | |
| 63 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | - return $ocLazyLoad.load({ | |
| 65 | - name: 'busConfig_edit_module', | |
| 66 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | - files: [ | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | - "pages/scheduleApp/module/core/busConfig/module.js" | |
| 71 | - ] | |
| 72 | - }); | |
| 73 | - }] | |
| 74 | - } | |
| 75 | - }) | |
| 76 | - .state("busConfig_detail", { // 详细信息页面 | |
| 77 | - url: '/busConfig_detail/:id', | |
| 78 | - views: { | |
| 79 | - "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/detail.html'} | |
| 80 | - }, | |
| 81 | - resolve: { | |
| 82 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | - return $ocLazyLoad.load({ | |
| 84 | - name: 'busConfig_detail_module', | |
| 85 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | - files: [ | |
| 87 | - "pages/scheduleApp/module/core/busConfig/module.js" | |
| 88 | - ] | |
| 89 | - }); | |
| 90 | - }] | |
| 91 | - } | |
| 92 | - }); | |
| 93 | - } | |
| 94 | -]); | |
| 95 | - | |
| 96 | - | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 车辆配置模块页面route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("busConfig", { // index主页面 | |
| 13 | + url: '/busConfig', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/core/busConfig/index.html' | |
| 17 | + }, | |
| 18 | + "busConfig_list@busConfig": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/core/busConfig/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'busConfig_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | + "pages/scheduleApp/module/core/busConfig/module.js" | |
| 33 | + ] | |
| 34 | + }); | |
| 35 | + }] | |
| 36 | + } | |
| 37 | + }) | |
| 38 | + .state("busConfig_form", { // 添加页面 | |
| 39 | + url: '/busConfig_form', | |
| 40 | + views: { | |
| 41 | + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/form.html'} | |
| 42 | + }, | |
| 43 | + resolve: { | |
| 44 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | + return $ocLazyLoad.load({ | |
| 46 | + name: 'busConfig_form_module', | |
| 47 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | + files: [ | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | + "pages/scheduleApp/module/core/busConfig/module.js" | |
| 52 | + ] | |
| 53 | + }); | |
| 54 | + }] | |
| 55 | + } | |
| 56 | + }) | |
| 57 | + .state("busConfig_edit", { // 修改页面 | |
| 58 | + url: '/busConfig_edit/:id', | |
| 59 | + views: { | |
| 60 | + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/edit.html'} | |
| 61 | + }, | |
| 62 | + resolve: { | |
| 63 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | + return $ocLazyLoad.load({ | |
| 65 | + name: 'busConfig_edit_module', | |
| 66 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | + files: [ | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | + "pages/scheduleApp/module/core/busConfig/module.js" | |
| 71 | + ] | |
| 72 | + }); | |
| 73 | + }] | |
| 74 | + } | |
| 75 | + }) | |
| 76 | + .state("busConfig_detail", { // 详细信息页面 | |
| 77 | + url: '/busConfig_detail/:id', | |
| 78 | + views: { | |
| 79 | + "": {templateUrl: 'pages/scheduleApp/module/core/busConfig/detail.html'} | |
| 80 | + }, | |
| 81 | + resolve: { | |
| 82 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | + return $ocLazyLoad.load({ | |
| 84 | + name: 'busConfig_detail_module', | |
| 85 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | + files: [ | |
| 87 | + "pages/scheduleApp/module/core/busConfig/module.js" | |
| 88 | + ] | |
| 89 | + }); | |
| 90 | + }] | |
| 91 | + } | |
| 92 | + }); | |
| 93 | + } | |
| 94 | +]); | |
| 95 | + | |
| 96 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/busLineInfoStat/module.js
| 1 | -// 车辆配置管理 service controller 等写在一起 | |
| 2 | -angular.module('ScheduleApp').factory('BusLineInfoStatService', ['BusLineInfoStatService_g', function(service) { | |
| 3 | - /** 当前的查询条件信息 */ | |
| 4 | - var currentSearchCondition = {}; | |
| 5 | - | |
| 6 | - /** 当前第几页 */ | |
| 7 | - var currentPageNo = 1; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = ""; | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - /** | |
| 27 | - * 设置当前页码。 | |
| 28 | - * @param cpn 从1开始,后台是从0开始的 | |
| 29 | - */ | |
| 30 | - setCurrentPageNo: function(cpn) { | |
| 31 | - currentPageNo = cpn; | |
| 32 | - }, | |
| 33 | - /** | |
| 34 | - * 组装查询参数,返回一个promise查询结果。 | |
| 35 | - * @param params 查询参数 | |
| 36 | - * @return 返回一个 promise | |
| 37 | - */ | |
| 38 | - getPage: function() { | |
| 39 | - var params = currentSearchCondition; // 查询条件 | |
| 40 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | - return service.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('BusLineInfoStatCtrl', ['BusLineInfoStatService', '$state', function(busLineInfoStatService, $state) { | |
| 65 | - var self = this; | |
| 66 | - | |
| 67 | - // 切换到form状态 | |
| 68 | - self.goForm = function() { | |
| 69 | - alert("切换"); | |
| 70 | - } | |
| 71 | -}]); | |
| 72 | - | |
| 73 | -angular.module('ScheduleApp').controller('BusLineInfoStatListCtrl', ['BusLineInfoStatService', function(busLineInfoStatService) { | |
| 74 | - var self = this; | |
| 75 | - self.pageInfo = { | |
| 76 | - totalItems : 0, | |
| 77 | - currentPage : 1, | |
| 78 | - infos: [] | |
| 79 | - }; | |
| 80 | - | |
| 81 | - // 初始创建的时候,获取一次列表数据 | |
| 82 | - busLineInfoStatService.getPage().then( | |
| 83 | - function(result) { | |
| 84 | - self.pageInfo.totalItems = result.totalElements; | |
| 85 | - self.pageInfo.currentPage = result.number + 1; | |
| 86 | - self.pageInfo.infos = result.content; | |
| 87 | - busLineInfoStatService.setCurrentPageNo(result.number + 1); | |
| 88 | - }, | |
| 89 | - function(result) { | |
| 90 | - alert("出错啦!"); | |
| 91 | - } | |
| 92 | - ); | |
| 93 | - | |
| 94 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 95 | - // alert("dfdfdf"); | |
| 96 | - //}); | |
| 97 | - | |
| 98 | - // 翻页的时候调用 | |
| 99 | - self.pageChanaged = function() { | |
| 100 | - busLineInfoStatService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 101 | - busLineInfoStatService.getPage().then( | |
| 102 | - function(result) { | |
| 103 | - self.pageInfo.totalItems = result.totalElements; | |
| 104 | - self.pageInfo.currentPage = result.number + 1; | |
| 105 | - self.pageInfo.infos = result.content; | |
| 106 | - busLineInfoStatService.setCurrentPageNo(result.number + 1); | |
| 107 | - }, | |
| 108 | - function(result) { | |
| 109 | - alert("出错啦!"); | |
| 110 | - } | |
| 111 | - ); | |
| 112 | - }; | |
| 113 | - // 获取查询条件数据 | |
| 114 | - self.searchCondition = function() { | |
| 115 | - return busLineInfoStatService.getSearchCondition(); | |
| 116 | - }; | |
| 117 | - // 重置查询条件 | |
| 118 | - self.resetSearchCondition = function() { | |
| 119 | - return busLineInfoStatService.resetSearchCondition(); | |
| 120 | - }; | |
| 121 | - | |
| 122 | -}]); | |
| 123 | - | |
| 124 | -angular.module('ScheduleApp').controller('BusLineInfoStatFormCtrl', ['BusLineInfoStatService', '$stateParams', '$state', function(busLineInfoStatService, $stateParams, $state) { | |
| 125 | - // TODO: | |
| 126 | -}]); | |
| 127 | - | |
| 128 | -angular.module('ScheduleApp').controller('BusLineInfoStatDetailCtrl', ['BusLineInfoStatService', '$stateParams', function(busLineInfoStatService, $stateParams) { | |
| 129 | - // TODO: | |
| 130 | -}]); | |
| 131 | - | |
| 132 | - | |
| 133 | - | |
| 1 | +// 车辆配置管理 service controller 等写在一起 | |
| 2 | +angular.module('ScheduleApp').factory('BusLineInfoStatService', ['BusLineInfoStatService_g', function(service) { | |
| 3 | + /** 当前的查询条件信息 */ | |
| 4 | + var currentSearchCondition = {}; | |
| 5 | + | |
| 6 | + /** 当前第几页 */ | |
| 7 | + var currentPageNo = 1; | |
| 8 | + | |
| 9 | + return { | |
| 10 | + /** | |
| 11 | + * 获取查询条件信息, | |
| 12 | + * 用于给controller用来和页面数据绑定。 | |
| 13 | + */ | |
| 14 | + getSearchCondition: function() { | |
| 15 | + return currentSearchCondition; | |
| 16 | + }, | |
| 17 | + /** | |
| 18 | + * 重置查询条件信息。 | |
| 19 | + */ | |
| 20 | + resetSearchCondition: function() { | |
| 21 | + var key; | |
| 22 | + for (key in currentSearchCondition) { | |
| 23 | + currentSearchCondition[key] = ""; | |
| 24 | + } | |
| 25 | + }, | |
| 26 | + /** | |
| 27 | + * 设置当前页码。 | |
| 28 | + * @param cpn 从1开始,后台是从0开始的 | |
| 29 | + */ | |
| 30 | + setCurrentPageNo: function(cpn) { | |
| 31 | + currentPageNo = cpn; | |
| 32 | + }, | |
| 33 | + /** | |
| 34 | + * 组装查询参数,返回一个promise查询结果。 | |
| 35 | + * @param params 查询参数 | |
| 36 | + * @return 返回一个 promise | |
| 37 | + */ | |
| 38 | + getPage: function() { | |
| 39 | + var params = currentSearchCondition; // 查询条件 | |
| 40 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | + return service.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('BusLineInfoStatCtrl', ['BusLineInfoStatService', '$state', function(busLineInfoStatService, $state) { | |
| 65 | + var self = this; | |
| 66 | + | |
| 67 | + // 切换到form状态 | |
| 68 | + self.goForm = function() { | |
| 69 | + alert("切换"); | |
| 70 | + } | |
| 71 | +}]); | |
| 72 | + | |
| 73 | +angular.module('ScheduleApp').controller('BusLineInfoStatListCtrl', ['BusLineInfoStatService', function(busLineInfoStatService) { | |
| 74 | + var self = this; | |
| 75 | + self.pageInfo = { | |
| 76 | + totalItems : 0, | |
| 77 | + currentPage : 1, | |
| 78 | + infos: [] | |
| 79 | + }; | |
| 80 | + | |
| 81 | + // 初始创建的时候,获取一次列表数据 | |
| 82 | + busLineInfoStatService.getPage().then( | |
| 83 | + function(result) { | |
| 84 | + self.pageInfo.totalItems = result.totalElements; | |
| 85 | + self.pageInfo.currentPage = result.number + 1; | |
| 86 | + self.pageInfo.infos = result.content; | |
| 87 | + busLineInfoStatService.setCurrentPageNo(result.number + 1); | |
| 88 | + }, | |
| 89 | + function(result) { | |
| 90 | + alert("出错啦!"); | |
| 91 | + } | |
| 92 | + ); | |
| 93 | + | |
| 94 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 95 | + // alert("dfdfdf"); | |
| 96 | + //}); | |
| 97 | + | |
| 98 | + // 翻页的时候调用 | |
| 99 | + self.pageChanaged = function() { | |
| 100 | + busLineInfoStatService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 101 | + busLineInfoStatService.getPage().then( | |
| 102 | + function(result) { | |
| 103 | + self.pageInfo.totalItems = result.totalElements; | |
| 104 | + self.pageInfo.currentPage = result.number + 1; | |
| 105 | + self.pageInfo.infos = result.content; | |
| 106 | + busLineInfoStatService.setCurrentPageNo(result.number + 1); | |
| 107 | + }, | |
| 108 | + function(result) { | |
| 109 | + alert("出错啦!"); | |
| 110 | + } | |
| 111 | + ); | |
| 112 | + }; | |
| 113 | + // 获取查询条件数据 | |
| 114 | + self.searchCondition = function() { | |
| 115 | + return busLineInfoStatService.getSearchCondition(); | |
| 116 | + }; | |
| 117 | + // 重置查询条件 | |
| 118 | + self.resetSearchCondition = function() { | |
| 119 | + return busLineInfoStatService.resetSearchCondition(); | |
| 120 | + }; | |
| 121 | + | |
| 122 | +}]); | |
| 123 | + | |
| 124 | +angular.module('ScheduleApp').controller('BusLineInfoStatFormCtrl', ['BusLineInfoStatService', '$stateParams', '$state', function(busLineInfoStatService, $stateParams, $state) { | |
| 125 | + // TODO: | |
| 126 | +}]); | |
| 127 | + | |
| 128 | +angular.module('ScheduleApp').controller('BusLineInfoStatDetailCtrl', ['BusLineInfoStatService', '$stateParams', function(busLineInfoStatService, $stateParams) { | |
| 129 | + // TODO: | |
| 130 | +}]); | |
| 131 | + | |
| 132 | + | |
| 133 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/busLineInfoStat/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 线路运营概览配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("busLineInfoStat", { // index页面 | |
| 13 | - url: '/busLineInfoStat', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/index.html' | |
| 17 | - }, | |
| 18 | - "busLineInfoStat_list@busLineInfoStat": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'busLineInfoStat_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "pages/scheduleApp/module/core/busLineInfoStat/module.js" | |
| 30 | - ] | |
| 31 | - }); | |
| 32 | - }] | |
| 33 | - } | |
| 34 | - }); | |
| 35 | - | |
| 36 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 线路运营概览配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("busLineInfoStat", { // index页面 | |
| 13 | + url: '/busLineInfoStat', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/index.html' | |
| 17 | + }, | |
| 18 | + "busLineInfoStat_list@busLineInfoStat": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/core/busLineInfoStat/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'busLineInfoStat_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "pages/scheduleApp/module/core/busLineInfoStat/module.js" | |
| 30 | + ] | |
| 31 | + }); | |
| 32 | + }] | |
| 33 | + } | |
| 34 | + }); | |
| 35 | + | |
| 36 | + } | |
| 37 | 37 | ]); |
| 38 | 38 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/module.js
| 1 | -// 人员配置管理 service controller 等写在一起 | |
| 2 | - | |
| 3 | -angular.module('ScheduleApp').factory('EmployeeConfigService', ['EmployeeConfigService_g', function(service) { | |
| 4 | - /** 当前的查询条件信息 */ | |
| 5 | - var currentSearchCondition = {'isCancel_eq': false}; | |
| 6 | - | |
| 7 | - /** 当前第几页 */ | |
| 8 | - var currentPageNo = 1; | |
| 9 | - | |
| 10 | - return { | |
| 11 | - /** | |
| 12 | - * 获取查询条件信息, | |
| 13 | - * 用于给controller用来和页面数据绑定。 | |
| 14 | - */ | |
| 15 | - getSearchCondition: function() { | |
| 16 | - return currentSearchCondition; | |
| 17 | - }, | |
| 18 | - /** | |
| 19 | - * 重置查询条件信息。 | |
| 20 | - */ | |
| 21 | - resetSearchCondition: function() { | |
| 22 | - var key; | |
| 23 | - for (key in currentSearchCondition) { | |
| 24 | - currentSearchCondition[key] = undefined; | |
| 25 | - } | |
| 26 | - currentSearchCondition['isCancel_eq'] = false; | |
| 27 | - }, | |
| 28 | - /** | |
| 29 | - * 设置当前页码。 | |
| 30 | - * @param cpn 从1开始,后台是从0开始的 | |
| 31 | - */ | |
| 32 | - setCurrentPageNo: function(cpn) { | |
| 33 | - currentPageNo = cpn; | |
| 34 | - }, | |
| 35 | - /** | |
| 36 | - * 组装查询参数,返回一个promise查询结果。 | |
| 37 | - * @param params 查询参数 | |
| 38 | - * @return 返回一个 promise | |
| 39 | - */ | |
| 40 | - getPage: function() { | |
| 41 | - var params = currentSearchCondition; // 查询条件 | |
| 42 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 43 | - return service.rest.list(params).$promise; | |
| 44 | - }, | |
| 45 | - /** | |
| 46 | - * 获取明细信息。 | |
| 47 | - * @param id 车辆id | |
| 48 | - * @return 返回一个 promise | |
| 49 | - */ | |
| 50 | - getDetail: function(id) { | |
| 51 | - var params = {id: id}; | |
| 52 | - return service.rest.get(params).$promise; | |
| 53 | - }, | |
| 54 | - /** | |
| 55 | - * 保存信息。 | |
| 56 | - * @param obj 车辆详细信息 | |
| 57 | - * @return 返回一个 promise | |
| 58 | - */ | |
| 59 | - saveDetail: function(obj) { | |
| 60 | - return service.rest.save(obj).$promise; | |
| 61 | - }, | |
| 62 | - /** | |
| 63 | - * 删除信息。 | |
| 64 | - * @param id 主键id | |
| 65 | - * @returns {*|Function|promise|n} | |
| 66 | - */ | |
| 67 | - deleteDetail: function(id) { | |
| 68 | - return service.rest.delete({id: id}).$promise; | |
| 69 | - } | |
| 70 | - }; | |
| 71 | -}]); | |
| 72 | - | |
| 73 | -angular.module('ScheduleApp').controller('EmployeeConfigCtrl', ['EmployeeConfigService', '$state', '$uibModal', function(employeeConfigService, $state, $uibModal) { | |
| 74 | - var self = this; | |
| 75 | - | |
| 76 | - // 切换到form状态 | |
| 77 | - self.goForm = function() { | |
| 78 | - //alert("切换"); | |
| 79 | - $state.go("employeeConfig_form"); | |
| 80 | - }; | |
| 81 | - | |
| 82 | - // 导入excel | |
| 83 | - self.importData = function() { | |
| 84 | - // large方式弹出模态对话框 | |
| 85 | - var modalInstance = $uibModal.open({ | |
| 86 | - templateUrl: '/pages/scheduleApp/module/core/employeeConfig/dataImport.html', | |
| 87 | - size: "lg", | |
| 88 | - animation: true, | |
| 89 | - backdrop: 'static', | |
| 90 | - resolve: { | |
| 91 | - // 可以传值给controller | |
| 92 | - }, | |
| 93 | - windowClass: 'center-modal', | |
| 94 | - controller: "EmployeeConfigToolsCtrl", | |
| 95 | - controllerAs: "ctrl", | |
| 96 | - bindToController: true | |
| 97 | - }); | |
| 98 | - modalInstance.result.then( | |
| 99 | - function() { | |
| 100 | - console.log("dataImport.html打开"); | |
| 101 | - }, | |
| 102 | - function() { | |
| 103 | - console.log("dataImport.html消失"); | |
| 104 | - } | |
| 105 | - ); | |
| 106 | - }; | |
| 107 | -}]); | |
| 108 | - | |
| 109 | -angular.module('ScheduleApp').controller('EmployeeConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 110 | - var self = this; | |
| 111 | - self.data = "TODO"; | |
| 112 | - | |
| 113 | - // 关闭窗口 | |
| 114 | - self.close = function() { | |
| 115 | - $modalInstance.dismiss("cancel"); | |
| 116 | - }; | |
| 117 | - | |
| 118 | - self.clearInputFile = function() { | |
| 119 | - angular.element("input[type='file']").val(null); | |
| 120 | - }; | |
| 121 | - | |
| 122 | - // 上传文件组件 | |
| 123 | - self.uploader = new FileUploader({ | |
| 124 | - url: "/eci/dataImport", | |
| 125 | - filters: [] // 用于过滤文件,比如只允许导入excel | |
| 126 | - }); | |
| 127 | - self.uploader.onAfterAddingFile = function(fileItem) | |
| 128 | - { | |
| 129 | - console.info('onAfterAddingFile', fileItem); | |
| 130 | - console.log(self.uploader.queue.length); | |
| 131 | - if (self.uploader.queue.length > 1) | |
| 132 | - self.uploader.removeFromQueue(0); | |
| 133 | - }; | |
| 134 | - self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 135 | - { | |
| 136 | - console.info('onSuccessItem', fileItem, response, status, headers); | |
| 137 | - }; | |
| 138 | - self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 139 | - { | |
| 140 | - console.info('onErrorItem', fileItem, response, status, headers); | |
| 141 | - }; | |
| 142 | - | |
| 143 | -}]); | |
| 144 | - | |
| 145 | -angular.module('ScheduleApp').controller('EmployeeConfigListCtrl', ['EmployeeConfigService', function(employeeConfigService) { | |
| 146 | - var self = this; | |
| 147 | - self.pageInfo = { | |
| 148 | - totalItems : 0, | |
| 149 | - currentPage : 1, | |
| 150 | - infos: [] | |
| 151 | - }; | |
| 152 | - | |
| 153 | - // 初始创建的时候,获取一次列表数据 | |
| 154 | - employeeConfigService.getPage().then( | |
| 155 | - function(result) { | |
| 156 | - self.pageInfo.totalItems = result.totalElements; | |
| 157 | - self.pageInfo.currentPage = result.number + 1; | |
| 158 | - self.pageInfo.infos = result.content; | |
| 159 | - employeeConfigService.setCurrentPageNo(result.number + 1); | |
| 160 | - }, | |
| 161 | - function(result) { | |
| 162 | - alert("出错啦!"); | |
| 163 | - } | |
| 164 | - ); | |
| 165 | - | |
| 166 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 167 | - // alert("dfdfdf"); | |
| 168 | - //}); | |
| 169 | - | |
| 170 | - // 翻页的时候调用 | |
| 171 | - self.pageChanaged = function() { | |
| 172 | - employeeConfigService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 173 | - employeeConfigService.getPage().then( | |
| 174 | - function(result) { | |
| 175 | - self.pageInfo.totalItems = result.totalElements; | |
| 176 | - self.pageInfo.currentPage = result.number + 1; | |
| 177 | - self.pageInfo.infos = result.content; | |
| 178 | - employeeConfigService.setCurrentPageNo(result.number + 1); | |
| 179 | - }, | |
| 180 | - function(result) { | |
| 181 | - alert("出错啦!"); | |
| 182 | - } | |
| 183 | - ); | |
| 184 | - }; | |
| 185 | - // 获取查询条件数据 | |
| 186 | - self.searchCondition = function() { | |
| 187 | - return employeeConfigService.getSearchCondition(); | |
| 188 | - }; | |
| 189 | - // 重置查询条件 | |
| 190 | - self.resetSearchCondition = function() { | |
| 191 | - employeeConfigService.resetSearchCondition(); | |
| 192 | - self.pageInfo.currentPage = 1; | |
| 193 | - self.pageChanaged(); | |
| 194 | - }; | |
| 195 | - | |
| 196 | - // 删除时刻表 | |
| 197 | - self.deleteEci = function(id) { | |
| 198 | - // TODO: | |
| 199 | - employeeConfigService.deleteDetail(id).then( | |
| 200 | - function(result) { | |
| 201 | - if (result.message) { // 暂时这样做,之后全局拦截 | |
| 202 | - alert("失败:" + result.message); | |
| 203 | - } else { | |
| 204 | - alert("作废成功!"); | |
| 205 | - | |
| 206 | - employeeConfigService.getPage().then( | |
| 207 | - function(result) { | |
| 208 | - self.pageInfo.totalItems = result.totalElements; | |
| 209 | - self.pageInfo.currentPage = result.number + 1; | |
| 210 | - self.pageInfo.infos = result.content; | |
| 211 | - employeeConfigService.setCurrentPageNo(result.number + 1); | |
| 212 | - }, | |
| 213 | - function(result) { | |
| 214 | - alert("出错啦!"); | |
| 215 | - } | |
| 216 | - ); | |
| 217 | - } | |
| 218 | - | |
| 219 | - }, | |
| 220 | - function(result) { | |
| 221 | - alert("出错啦!" + result); | |
| 222 | - } | |
| 223 | - ); | |
| 224 | - }; | |
| 225 | - | |
| 226 | - // 撤销修改 | |
| 227 | - self.redoDeleteEci = function(id) { | |
| 228 | - employeeConfigService.getDetail(id).then( | |
| 229 | - function(result) { | |
| 230 | - result.isCancel = 'false'; | |
| 231 | - employeeConfigService.saveDetail(result).then( | |
| 232 | - function(result) { | |
| 233 | - if (result.message) { // 暂时这样做,之后全局拦截 | |
| 234 | - alert("失败:" + result.message); | |
| 235 | - } else { | |
| 236 | - alert("撤销成功!"); | |
| 237 | - | |
| 238 | - employeeConfigService.getPage().then( | |
| 239 | - function(result) { | |
| 240 | - self.pageInfo.totalItems = result.totalElements; | |
| 241 | - self.pageInfo.currentPage = result.number + 1; | |
| 242 | - self.pageInfo.infos = result.content; | |
| 243 | - employeeConfigService.setCurrentPageNo(result.number + 1); | |
| 244 | - }, | |
| 245 | - function(result) { | |
| 246 | - alert("出错啦!"); | |
| 247 | - } | |
| 248 | - ); | |
| 249 | - } | |
| 250 | - }, | |
| 251 | - function(result) { | |
| 252 | - // TODO:弹出框方式以后改 | |
| 253 | - alert("出错啦!"); | |
| 254 | - } | |
| 255 | - ); | |
| 256 | - }, | |
| 257 | - function(result) { | |
| 258 | - // TODO:弹出框方式以后改 | |
| 259 | - alert("出错啦!"); | |
| 260 | - } | |
| 261 | - ); | |
| 262 | - }; | |
| 263 | - | |
| 264 | -}]); | |
| 265 | - | |
| 266 | -angular.module('ScheduleApp').controller('EmployeeConfigFormCtrl', ['EmployeeConfigService', '$stateParams', '$state', function(employeeConfigService, $stateParams, $state) { | |
| 267 | - var self = this; | |
| 268 | - | |
| 269 | - // 欲保存的busInfo信息,绑定 | |
| 270 | - self.employeeConfigForSave = {xl:{}, jsy:{}, spy:{}}; | |
| 271 | - | |
| 272 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 273 | - var id = $stateParams.id; | |
| 274 | - if (id) { | |
| 275 | - self.employeeConfigForSave.id = id; | |
| 276 | - employeeConfigService.getDetail(id).then( | |
| 277 | - function(result) { | |
| 278 | - var key; | |
| 279 | - for (key in result) { | |
| 280 | - self.employeeConfigForSave[key] = result[key]; | |
| 281 | - } | |
| 282 | - | |
| 283 | - if (!self.employeeConfigForSave.spy) { | |
| 284 | - self.employeeConfigForSave.spy = {}; | |
| 285 | - } | |
| 286 | - | |
| 287 | - }, | |
| 288 | - function(result) { | |
| 289 | - alert("出错啦!"); | |
| 290 | - } | |
| 291 | - ); | |
| 292 | - } | |
| 293 | - | |
| 294 | - // 提交方法 | |
| 295 | - self.submit = function() { | |
| 296 | - console.log(self.employeeConfigForSave); | |
| 297 | - | |
| 298 | - // 如果自对象没id值,设置成null | |
| 299 | - if (self.employeeConfigForSave.spy && !self.employeeConfigForSave.spy.id) { | |
| 300 | - self.employeeConfigForSave.spy = null; | |
| 301 | - } | |
| 302 | - | |
| 303 | - employeeConfigService.saveDetail(self.employeeConfigForSave).then( | |
| 304 | - function(result) { | |
| 305 | - // TODO:弹出框方式以后改 | |
| 306 | - if (result.status == 'SUCCESS') { | |
| 307 | - alert("保存成功!"); | |
| 308 | - $state.go("employeeConfig"); | |
| 309 | - } else { | |
| 310 | - alert("保存异常!"); | |
| 311 | - } | |
| 312 | - }, | |
| 313 | - function(result) { | |
| 314 | - // TODO:弹出框方式以后改 | |
| 315 | - alert("出错啦!"); | |
| 316 | - } | |
| 317 | - ); | |
| 318 | - }; | |
| 319 | -}]); | |
| 320 | - | |
| 321 | -angular.module('ScheduleApp').controller('EmployeeConfigDetailCtrl', ['EmployeeConfigService', '$stateParams', function(employeeConfigService, $stateParams) { | |
| 322 | - var self = this; | |
| 323 | - self.title = ""; | |
| 324 | - self.employeeConfigForDetail = {}; | |
| 325 | - self.employeeConfigForDetail.id = $stateParams.id; | |
| 326 | - | |
| 327 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 328 | - employeeConfigService.getDetail($stateParams.id).then( | |
| 329 | - function(result) { | |
| 330 | - var key; | |
| 331 | - for (key in result) { | |
| 332 | - self.employeeConfigForDetail[key] = result[key]; | |
| 333 | - } | |
| 334 | - | |
| 335 | - self.title = "驾驶员 " + self.employeeConfigForDetail.jsy.personnelName + " 配置详细信息"; | |
| 336 | - }, | |
| 337 | - function(result) { | |
| 338 | - // TODO:弹出框方式以后改 | |
| 339 | - alert("出错啦!"); | |
| 340 | - } | |
| 341 | - ); | |
| 342 | -}]); | |
| 343 | - | |
| 1 | +// 人员配置管理 service controller 等写在一起 | |
| 2 | + | |
| 3 | +angular.module('ScheduleApp').factory('EmployeeConfigService', ['EmployeeConfigService_g', function(service) { | |
| 4 | + /** 当前的查询条件信息 */ | |
| 5 | + var currentSearchCondition = {'isCancel_eq': false}; | |
| 6 | + | |
| 7 | + /** 当前第几页 */ | |
| 8 | + var currentPageNo = 1; | |
| 9 | + | |
| 10 | + return { | |
| 11 | + /** | |
| 12 | + * 获取查询条件信息, | |
| 13 | + * 用于给controller用来和页面数据绑定。 | |
| 14 | + */ | |
| 15 | + getSearchCondition: function() { | |
| 16 | + return currentSearchCondition; | |
| 17 | + }, | |
| 18 | + /** | |
| 19 | + * 重置查询条件信息。 | |
| 20 | + */ | |
| 21 | + resetSearchCondition: function() { | |
| 22 | + var key; | |
| 23 | + for (key in currentSearchCondition) { | |
| 24 | + currentSearchCondition[key] = undefined; | |
| 25 | + } | |
| 26 | + currentSearchCondition['isCancel_eq'] = false; | |
| 27 | + }, | |
| 28 | + /** | |
| 29 | + * 设置当前页码。 | |
| 30 | + * @param cpn 从1开始,后台是从0开始的 | |
| 31 | + */ | |
| 32 | + setCurrentPageNo: function(cpn) { | |
| 33 | + currentPageNo = cpn; | |
| 34 | + }, | |
| 35 | + /** | |
| 36 | + * 组装查询参数,返回一个promise查询结果。 | |
| 37 | + * @param params 查询参数 | |
| 38 | + * @return 返回一个 promise | |
| 39 | + */ | |
| 40 | + getPage: function() { | |
| 41 | + var params = currentSearchCondition; // 查询条件 | |
| 42 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 43 | + return service.rest.list(params).$promise; | |
| 44 | + }, | |
| 45 | + /** | |
| 46 | + * 获取明细信息。 | |
| 47 | + * @param id 车辆id | |
| 48 | + * @return 返回一个 promise | |
| 49 | + */ | |
| 50 | + getDetail: function(id) { | |
| 51 | + var params = {id: id}; | |
| 52 | + return service.rest.get(params).$promise; | |
| 53 | + }, | |
| 54 | + /** | |
| 55 | + * 保存信息。 | |
| 56 | + * @param obj 车辆详细信息 | |
| 57 | + * @return 返回一个 promise | |
| 58 | + */ | |
| 59 | + saveDetail: function(obj) { | |
| 60 | + return service.rest.save(obj).$promise; | |
| 61 | + }, | |
| 62 | + /** | |
| 63 | + * 删除信息。 | |
| 64 | + * @param id 主键id | |
| 65 | + * @returns {*|Function|promise|n} | |
| 66 | + */ | |
| 67 | + deleteDetail: function(id) { | |
| 68 | + return service.rest.delete({id: id}).$promise; | |
| 69 | + } | |
| 70 | + }; | |
| 71 | +}]); | |
| 72 | + | |
| 73 | +angular.module('ScheduleApp').controller('EmployeeConfigCtrl', ['EmployeeConfigService', '$state', '$uibModal', function(employeeConfigService, $state, $uibModal) { | |
| 74 | + var self = this; | |
| 75 | + | |
| 76 | + // 切换到form状态 | |
| 77 | + self.goForm = function() { | |
| 78 | + //alert("切换"); | |
| 79 | + $state.go("employeeConfig_form"); | |
| 80 | + }; | |
| 81 | + | |
| 82 | + // 导入excel | |
| 83 | + self.importData = function() { | |
| 84 | + // large方式弹出模态对话框 | |
| 85 | + var modalInstance = $uibModal.open({ | |
| 86 | + templateUrl: '/pages/scheduleApp/module/core/employeeConfig/dataImport.html', | |
| 87 | + size: "lg", | |
| 88 | + animation: true, | |
| 89 | + backdrop: 'static', | |
| 90 | + resolve: { | |
| 91 | + // 可以传值给controller | |
| 92 | + }, | |
| 93 | + windowClass: 'center-modal', | |
| 94 | + controller: "EmployeeConfigToolsCtrl", | |
| 95 | + controllerAs: "ctrl", | |
| 96 | + bindToController: true | |
| 97 | + }); | |
| 98 | + modalInstance.result.then( | |
| 99 | + function() { | |
| 100 | + console.log("dataImport.html打开"); | |
| 101 | + }, | |
| 102 | + function() { | |
| 103 | + console.log("dataImport.html消失"); | |
| 104 | + } | |
| 105 | + ); | |
| 106 | + }; | |
| 107 | +}]); | |
| 108 | + | |
| 109 | +angular.module('ScheduleApp').controller('EmployeeConfigToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 110 | + var self = this; | |
| 111 | + self.data = "TODO"; | |
| 112 | + | |
| 113 | + // 关闭窗口 | |
| 114 | + self.close = function() { | |
| 115 | + $modalInstance.dismiss("cancel"); | |
| 116 | + }; | |
| 117 | + | |
| 118 | + self.clearInputFile = function() { | |
| 119 | + angular.element("input[type='file']").val(null); | |
| 120 | + }; | |
| 121 | + | |
| 122 | + // 上传文件组件 | |
| 123 | + self.uploader = new FileUploader({ | |
| 124 | + url: "/eci/dataImport", | |
| 125 | + filters: [] // 用于过滤文件,比如只允许导入excel | |
| 126 | + }); | |
| 127 | + self.uploader.onAfterAddingFile = function(fileItem) | |
| 128 | + { | |
| 129 | + console.info('onAfterAddingFile', fileItem); | |
| 130 | + console.log(self.uploader.queue.length); | |
| 131 | + if (self.uploader.queue.length > 1) | |
| 132 | + self.uploader.removeFromQueue(0); | |
| 133 | + }; | |
| 134 | + self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 135 | + { | |
| 136 | + console.info('onSuccessItem', fileItem, response, status, headers); | |
| 137 | + }; | |
| 138 | + self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 139 | + { | |
| 140 | + console.info('onErrorItem', fileItem, response, status, headers); | |
| 141 | + }; | |
| 142 | + | |
| 143 | +}]); | |
| 144 | + | |
| 145 | +angular.module('ScheduleApp').controller('EmployeeConfigListCtrl', ['EmployeeConfigService', function(employeeConfigService) { | |
| 146 | + var self = this; | |
| 147 | + self.pageInfo = { | |
| 148 | + totalItems : 0, | |
| 149 | + currentPage : 1, | |
| 150 | + infos: [] | |
| 151 | + }; | |
| 152 | + | |
| 153 | + // 初始创建的时候,获取一次列表数据 | |
| 154 | + employeeConfigService.getPage().then( | |
| 155 | + function(result) { | |
| 156 | + self.pageInfo.totalItems = result.totalElements; | |
| 157 | + self.pageInfo.currentPage = result.number + 1; | |
| 158 | + self.pageInfo.infos = result.content; | |
| 159 | + employeeConfigService.setCurrentPageNo(result.number + 1); | |
| 160 | + }, | |
| 161 | + function(result) { | |
| 162 | + alert("出错啦!"); | |
| 163 | + } | |
| 164 | + ); | |
| 165 | + | |
| 166 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 167 | + // alert("dfdfdf"); | |
| 168 | + //}); | |
| 169 | + | |
| 170 | + // 翻页的时候调用 | |
| 171 | + self.pageChanaged = function() { | |
| 172 | + employeeConfigService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 173 | + employeeConfigService.getPage().then( | |
| 174 | + function(result) { | |
| 175 | + self.pageInfo.totalItems = result.totalElements; | |
| 176 | + self.pageInfo.currentPage = result.number + 1; | |
| 177 | + self.pageInfo.infos = result.content; | |
| 178 | + employeeConfigService.setCurrentPageNo(result.number + 1); | |
| 179 | + }, | |
| 180 | + function(result) { | |
| 181 | + alert("出错啦!"); | |
| 182 | + } | |
| 183 | + ); | |
| 184 | + }; | |
| 185 | + // 获取查询条件数据 | |
| 186 | + self.searchCondition = function() { | |
| 187 | + return employeeConfigService.getSearchCondition(); | |
| 188 | + }; | |
| 189 | + // 重置查询条件 | |
| 190 | + self.resetSearchCondition = function() { | |
| 191 | + employeeConfigService.resetSearchCondition(); | |
| 192 | + self.pageInfo.currentPage = 1; | |
| 193 | + self.pageChanaged(); | |
| 194 | + }; | |
| 195 | + | |
| 196 | + // 删除时刻表 | |
| 197 | + self.deleteEci = function(id) { | |
| 198 | + // TODO: | |
| 199 | + employeeConfigService.deleteDetail(id).then( | |
| 200 | + function(result) { | |
| 201 | + if (result.message) { // 暂时这样做,之后全局拦截 | |
| 202 | + alert("失败:" + result.message); | |
| 203 | + } else { | |
| 204 | + alert("作废成功!"); | |
| 205 | + | |
| 206 | + employeeConfigService.getPage().then( | |
| 207 | + function(result) { | |
| 208 | + self.pageInfo.totalItems = result.totalElements; | |
| 209 | + self.pageInfo.currentPage = result.number + 1; | |
| 210 | + self.pageInfo.infos = result.content; | |
| 211 | + employeeConfigService.setCurrentPageNo(result.number + 1); | |
| 212 | + }, | |
| 213 | + function(result) { | |
| 214 | + alert("出错啦!"); | |
| 215 | + } | |
| 216 | + ); | |
| 217 | + } | |
| 218 | + | |
| 219 | + }, | |
| 220 | + function(result) { | |
| 221 | + alert("出错啦!" + result); | |
| 222 | + } | |
| 223 | + ); | |
| 224 | + }; | |
| 225 | + | |
| 226 | + // 撤销修改 | |
| 227 | + self.redoDeleteEci = function(id) { | |
| 228 | + employeeConfigService.getDetail(id).then( | |
| 229 | + function(result) { | |
| 230 | + result.isCancel = 'false'; | |
| 231 | + employeeConfigService.saveDetail(result).then( | |
| 232 | + function(result) { | |
| 233 | + if (result.message) { // 暂时这样做,之后全局拦截 | |
| 234 | + alert("失败:" + result.message); | |
| 235 | + } else { | |
| 236 | + alert("撤销成功!"); | |
| 237 | + | |
| 238 | + employeeConfigService.getPage().then( | |
| 239 | + function(result) { | |
| 240 | + self.pageInfo.totalItems = result.totalElements; | |
| 241 | + self.pageInfo.currentPage = result.number + 1; | |
| 242 | + self.pageInfo.infos = result.content; | |
| 243 | + employeeConfigService.setCurrentPageNo(result.number + 1); | |
| 244 | + }, | |
| 245 | + function(result) { | |
| 246 | + alert("出错啦!"); | |
| 247 | + } | |
| 248 | + ); | |
| 249 | + } | |
| 250 | + }, | |
| 251 | + function(result) { | |
| 252 | + // TODO:弹出框方式以后改 | |
| 253 | + alert("出错啦!"); | |
| 254 | + } | |
| 255 | + ); | |
| 256 | + }, | |
| 257 | + function(result) { | |
| 258 | + // TODO:弹出框方式以后改 | |
| 259 | + alert("出错啦!"); | |
| 260 | + } | |
| 261 | + ); | |
| 262 | + }; | |
| 263 | + | |
| 264 | +}]); | |
| 265 | + | |
| 266 | +angular.module('ScheduleApp').controller('EmployeeConfigFormCtrl', ['EmployeeConfigService', '$stateParams', '$state', function(employeeConfigService, $stateParams, $state) { | |
| 267 | + var self = this; | |
| 268 | + | |
| 269 | + // 欲保存的busInfo信息,绑定 | |
| 270 | + self.employeeConfigForSave = {xl:{}, jsy:{}, spy:{}}; | |
| 271 | + | |
| 272 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 273 | + var id = $stateParams.id; | |
| 274 | + if (id) { | |
| 275 | + self.employeeConfigForSave.id = id; | |
| 276 | + employeeConfigService.getDetail(id).then( | |
| 277 | + function(result) { | |
| 278 | + var key; | |
| 279 | + for (key in result) { | |
| 280 | + self.employeeConfigForSave[key] = result[key]; | |
| 281 | + } | |
| 282 | + | |
| 283 | + if (!self.employeeConfigForSave.spy) { | |
| 284 | + self.employeeConfigForSave.spy = {}; | |
| 285 | + } | |
| 286 | + | |
| 287 | + }, | |
| 288 | + function(result) { | |
| 289 | + alert("出错啦!"); | |
| 290 | + } | |
| 291 | + ); | |
| 292 | + } | |
| 293 | + | |
| 294 | + // 提交方法 | |
| 295 | + self.submit = function() { | |
| 296 | + console.log(self.employeeConfigForSave); | |
| 297 | + | |
| 298 | + // 如果自对象没id值,设置成null | |
| 299 | + if (self.employeeConfigForSave.spy && !self.employeeConfigForSave.spy.id) { | |
| 300 | + self.employeeConfigForSave.spy = null; | |
| 301 | + } | |
| 302 | + | |
| 303 | + employeeConfigService.saveDetail(self.employeeConfigForSave).then( | |
| 304 | + function(result) { | |
| 305 | + // TODO:弹出框方式以后改 | |
| 306 | + if (result.status == 'SUCCESS') { | |
| 307 | + alert("保存成功!"); | |
| 308 | + $state.go("employeeConfig"); | |
| 309 | + } else { | |
| 310 | + alert("保存异常!"); | |
| 311 | + } | |
| 312 | + }, | |
| 313 | + function(result) { | |
| 314 | + // TODO:弹出框方式以后改 | |
| 315 | + alert("出错啦!"); | |
| 316 | + } | |
| 317 | + ); | |
| 318 | + }; | |
| 319 | +}]); | |
| 320 | + | |
| 321 | +angular.module('ScheduleApp').controller('EmployeeConfigDetailCtrl', ['EmployeeConfigService', '$stateParams', function(employeeConfigService, $stateParams) { | |
| 322 | + var self = this; | |
| 323 | + self.title = ""; | |
| 324 | + self.employeeConfigForDetail = {}; | |
| 325 | + self.employeeConfigForDetail.id = $stateParams.id; | |
| 326 | + | |
| 327 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 328 | + employeeConfigService.getDetail($stateParams.id).then( | |
| 329 | + function(result) { | |
| 330 | + var key; | |
| 331 | + for (key in result) { | |
| 332 | + self.employeeConfigForDetail[key] = result[key]; | |
| 333 | + } | |
| 334 | + | |
| 335 | + self.title = "驾驶员 " + self.employeeConfigForDetail.jsy.personnelName + " 配置详细信息"; | |
| 336 | + }, | |
| 337 | + function(result) { | |
| 338 | + // TODO:弹出框方式以后改 | |
| 339 | + alert("出错啦!"); | |
| 340 | + } | |
| 341 | + ); | |
| 342 | +}]); | |
| 343 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/employeeConfig/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 人员配置模块页面route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("employeeConfig", { // index页面 | |
| 13 | - url: '/employeeConfig', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html' | |
| 17 | - }, | |
| 18 | - "employeeConfig_list@employeeConfig": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'employeeConfig_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | - "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 33 | - ] | |
| 34 | - }); | |
| 35 | - }] | |
| 36 | - } | |
| 37 | - }) | |
| 38 | - .state("employeeConfig_form", { // 添加人员配置form | |
| 39 | - url: '/employeeConfig_form', | |
| 40 | - views: { | |
| 41 | - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/form.html'} | |
| 42 | - }, | |
| 43 | - resolve: { | |
| 44 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | - return $ocLazyLoad.load({ | |
| 46 | - name: 'employeeConfig_form_module', | |
| 47 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | - files: [ | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | - "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 52 | - ] | |
| 53 | - }); | |
| 54 | - }] | |
| 55 | - } | |
| 56 | - }) | |
| 57 | - .state("employeeConfig_edit", { // 修改人员配置form | |
| 58 | - url: '/employeeConfig_edit/:id', | |
| 59 | - views: { | |
| 60 | - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/edit.html'} | |
| 61 | - }, | |
| 62 | - resolve: { | |
| 63 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | - return $ocLazyLoad.load({ | |
| 65 | - name: 'employeeConfig_edit_module', | |
| 66 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | - files: [ | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | - "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 71 | - ] | |
| 72 | - }); | |
| 73 | - }] | |
| 74 | - } | |
| 75 | - }) | |
| 76 | - .state("employeeConfig_detail", { // 详细信息页面 | |
| 77 | - url: '/employeeConfig_detail/:id', | |
| 78 | - views: { | |
| 79 | - "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/detail.html'} | |
| 80 | - }, | |
| 81 | - resolve: { | |
| 82 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | - return $ocLazyLoad.load({ | |
| 84 | - name: 'employeeConfig_detail_module', | |
| 85 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | - files: [ | |
| 87 | - "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 88 | - ] | |
| 89 | - }); | |
| 90 | - }] | |
| 91 | - } | |
| 92 | - }) | |
| 93 | - | |
| 94 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 人员配置模块页面route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("employeeConfig", { // index页面 | |
| 13 | + url: '/employeeConfig', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/core/employeeConfig/index.html' | |
| 17 | + }, | |
| 18 | + "employeeConfig_list@employeeConfig": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/core/employeeConfig/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'employeeConfig_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | + "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 33 | + ] | |
| 34 | + }); | |
| 35 | + }] | |
| 36 | + } | |
| 37 | + }) | |
| 38 | + .state("employeeConfig_form", { // 添加人员配置form | |
| 39 | + url: '/employeeConfig_form', | |
| 40 | + views: { | |
| 41 | + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/form.html'} | |
| 42 | + }, | |
| 43 | + resolve: { | |
| 44 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | + return $ocLazyLoad.load({ | |
| 46 | + name: 'employeeConfig_form_module', | |
| 47 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | + files: [ | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 50 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 51 | + "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 52 | + ] | |
| 53 | + }); | |
| 54 | + }] | |
| 55 | + } | |
| 56 | + }) | |
| 57 | + .state("employeeConfig_edit", { // 修改人员配置form | |
| 58 | + url: '/employeeConfig_edit/:id', | |
| 59 | + views: { | |
| 60 | + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/edit.html'} | |
| 61 | + }, | |
| 62 | + resolve: { | |
| 63 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 64 | + return $ocLazyLoad.load({ | |
| 65 | + name: 'employeeConfig_edit_module', | |
| 66 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 67 | + files: [ | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 69 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 70 | + "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 71 | + ] | |
| 72 | + }); | |
| 73 | + }] | |
| 74 | + } | |
| 75 | + }) | |
| 76 | + .state("employeeConfig_detail", { // 详细信息页面 | |
| 77 | + url: '/employeeConfig_detail/:id', | |
| 78 | + views: { | |
| 79 | + "": {templateUrl: 'pages/scheduleApp/module/core/employeeConfig/detail.html'} | |
| 80 | + }, | |
| 81 | + resolve: { | |
| 82 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 83 | + return $ocLazyLoad.load({ | |
| 84 | + name: 'employeeConfig_detail_module', | |
| 85 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 86 | + files: [ | |
| 87 | + "pages/scheduleApp/module/core/employeeConfig/module.js" | |
| 88 | + ] | |
| 89 | + }); | |
| 90 | + }] | |
| 91 | + } | |
| 92 | + }) | |
| 93 | + | |
| 94 | + } | |
| 95 | 95 | ]); |
| 96 | 96 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/module.js
| 1 | -// 路牌管理 service controller 等写在一起 | |
| 2 | - | |
| 3 | -angular.module('ScheduleApp').factory('GuideboardManageService', ['GuideboardManageService_g', function(service) { | |
| 4 | - /** 当前的查询条件信息 */ | |
| 5 | - var currentSearchCondition = {}; | |
| 6 | - | |
| 7 | - /** 当前第几页 */ | |
| 8 | - var currentPageNo = 1; | |
| 9 | - | |
| 10 | - return { | |
| 11 | - /** | |
| 12 | - * 获取查询条件信息, | |
| 13 | - * 用于给controller用来和页面数据绑定。 | |
| 14 | - */ | |
| 15 | - getSearchCondition: function() { | |
| 16 | - return currentSearchCondition; | |
| 17 | - }, | |
| 18 | - /** | |
| 19 | - * 重置查询条件信息。 | |
| 20 | - */ | |
| 21 | - resetSearchCondition: function() { | |
| 22 | - var key; | |
| 23 | - for (key in currentSearchCondition) { | |
| 24 | - currentSearchCondition[key] = undefined; | |
| 25 | - } | |
| 26 | - }, | |
| 27 | - /** | |
| 28 | - * 设置当前页码。 | |
| 29 | - * @param cpn 从1开始,后台是从0开始的 | |
| 30 | - */ | |
| 31 | - setCurrentPageNo: function(cpn) { | |
| 32 | - currentPageNo = cpn; | |
| 33 | - }, | |
| 34 | - /** | |
| 35 | - * 组装查询参数,返回一个promise查询结果。 | |
| 36 | - * @param params 查询参数 | |
| 37 | - * @return 返回一个 promise | |
| 38 | - */ | |
| 39 | - getPage: function() { | |
| 40 | - var params = currentSearchCondition; // 查询条件 | |
| 41 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | - return service.rest.list(params).$promise; | |
| 43 | - }, | |
| 44 | - /** | |
| 45 | - * 获取明细信息。 | |
| 46 | - * @param id 车辆id | |
| 47 | - * @return 返回一个 promise | |
| 48 | - */ | |
| 49 | - getDetail: function(id) { | |
| 50 | - var params = {id: id}; | |
| 51 | - return service.rest.get(params).$promise; | |
| 52 | - }, | |
| 53 | - /** | |
| 54 | - * 保存信息。 | |
| 55 | - * @param obj 车辆详细信息 | |
| 56 | - * @return 返回一个 promise | |
| 57 | - */ | |
| 58 | - saveDetail: function(obj) { | |
| 59 | - return service.rest.save(obj).$promise; | |
| 60 | - } | |
| 61 | - }; | |
| 62 | -}]); | |
| 63 | - | |
| 64 | -angular.module('ScheduleApp').controller('GuideboardManageCtrl', ['GuideboardManageService', '$state', '$uibModal', function(guideboardManageService, $state, $uibModal) { | |
| 65 | - var self = this; | |
| 66 | - | |
| 67 | - // 切换到form状态 | |
| 68 | - self.goForm = function() { | |
| 69 | - alert("切换添加"); | |
| 70 | - }; | |
| 71 | - | |
| 72 | - // 导入excel | |
| 73 | - self.importData = function() { | |
| 74 | - // large方式弹出模态对话框 | |
| 75 | - var modalInstance = $uibModal.open({ | |
| 76 | - templateUrl: '/pages/scheduleApp/module/core/guideboardManage/dataImport.html', | |
| 77 | - size: "lg", | |
| 78 | - animation: true, | |
| 79 | - backdrop: 'static', | |
| 80 | - resolve: { | |
| 81 | - // 可以传值给controller | |
| 82 | - }, | |
| 83 | - windowClass: 'center-modal', | |
| 84 | - controller: "GuideboardManageToolsCtrl", | |
| 85 | - controllerAs: "ctrl", | |
| 86 | - bindToController: true | |
| 87 | - }); | |
| 88 | - modalInstance.result.then( | |
| 89 | - function() { | |
| 90 | - console.log("dataImport.html打开"); | |
| 91 | - }, | |
| 92 | - function() { | |
| 93 | - console.log("dataImport.html消失"); | |
| 94 | - } | |
| 95 | - ); | |
| 96 | - }; | |
| 97 | -}]); | |
| 98 | - | |
| 99 | -angular.module('ScheduleApp').controller('GuideboardManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 100 | - var self = this; | |
| 101 | - self.data = "TODO"; | |
| 102 | - | |
| 103 | - // 关闭窗口 | |
| 104 | - self.close = function() { | |
| 105 | - $modalInstance.dismiss("cancel"); | |
| 106 | - }; | |
| 107 | - | |
| 108 | - self.clearInputFile = function() { | |
| 109 | - angular.element("input[type='file']").val(null); | |
| 110 | - }; | |
| 111 | - | |
| 112 | - // 上传文件组件 | |
| 113 | - self.uploader = new FileUploader({ | |
| 114 | - url: "/gic/dataImport", | |
| 115 | - filters: [] // 用于过滤文件,比如只允许导入excel | |
| 116 | - }); | |
| 117 | - self.uploader.onAfterAddingFile = function(fileItem) | |
| 118 | - { | |
| 119 | - console.info('onAfterAddingFile', fileItem); | |
| 120 | - console.log(self.uploader.queue.length); | |
| 121 | - if (self.uploader.queue.length > 1) | |
| 122 | - self.uploader.removeFromQueue(0); | |
| 123 | - }; | |
| 124 | - self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 125 | - { | |
| 126 | - console.info('onSuccessItem', fileItem, response, status, headers); | |
| 127 | - }; | |
| 128 | - self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 129 | - { | |
| 130 | - console.info('onErrorItem', fileItem, response, status, headers); | |
| 131 | - }; | |
| 132 | - | |
| 133 | -}]); | |
| 134 | - | |
| 135 | -angular.module('ScheduleApp').controller('GuideboardManageListCtrl', ['GuideboardManageService', function(guideboardManageService) { | |
| 136 | - var self = this; | |
| 137 | - self.pageInfo = { | |
| 138 | - totalItems : 0, | |
| 139 | - currentPage : 1, | |
| 140 | - infos: [] | |
| 141 | - }; | |
| 142 | - | |
| 143 | - // 初始创建的时候,获取一次列表数据 | |
| 144 | - guideboardManageService.getPage().then( | |
| 145 | - function(result) { | |
| 146 | - self.pageInfo.totalItems = result.totalElements; | |
| 147 | - self.pageInfo.currentPage = result.number + 1; | |
| 148 | - self.pageInfo.infos = result.content; | |
| 149 | - guideboardManageService.setCurrentPageNo(result.number + 1); | |
| 150 | - }, | |
| 151 | - function(result) { | |
| 152 | - alert("出错啦!"); | |
| 153 | - } | |
| 154 | - ); | |
| 155 | - | |
| 156 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 157 | - // alert("dfdfdf"); | |
| 158 | - //}); | |
| 159 | - | |
| 160 | - // 翻页的时候调用 | |
| 161 | - self.pageChanaged = function() { | |
| 162 | - guideboardManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 163 | - guideboardManageService.getPage().then( | |
| 164 | - function(result) { | |
| 165 | - self.pageInfo.totalItems = result.totalElements; | |
| 166 | - self.pageInfo.currentPage = result.number + 1; | |
| 167 | - self.pageInfo.infos = result.content; | |
| 168 | - guideboardManageService.setCurrentPageNo(result.number + 1); | |
| 169 | - }, | |
| 170 | - function(result) { | |
| 171 | - alert("出错啦!"); | |
| 172 | - } | |
| 173 | - ); | |
| 174 | - }; | |
| 175 | - // 获取查询条件数据 | |
| 176 | - self.searchCondition = function() { | |
| 177 | - return guideboardManageService.getSearchCondition(); | |
| 178 | - }; | |
| 179 | - // 重置查询条件 | |
| 180 | - self.resetSearchCondition = function() { | |
| 181 | - guideboardManageService.resetSearchCondition(); | |
| 182 | - self.pageInfo.currentPage = 1; | |
| 183 | - self.pageChanaged(); | |
| 184 | - }; | |
| 185 | - | |
| 186 | -}]); | |
| 187 | - | |
| 188 | -angular.module('ScheduleApp').controller('GuideboardManageFormCtrl', ['GuideboardManageService', '$stateParams', '$state', function(guideboardManageService, $stateParams, $state) { | |
| 189 | - // TODO: | |
| 190 | -}]); | |
| 191 | - | |
| 192 | -angular.module('ScheduleApp').controller('GuideboardManageDetailCtrl', ['GuideboardManageService', '$stateParams', function(guideboardManageService, $stateParams) { | |
| 193 | - var self = this; | |
| 194 | - self.title = ""; | |
| 195 | - self.guideboardForDetail = {}; | |
| 196 | - self.guideboardForDetail.id = $stateParams.id; | |
| 197 | - | |
| 198 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 199 | - guideboardManageService.getDetail($stateParams.id).then( | |
| 200 | - function(result) { | |
| 201 | - var key; | |
| 202 | - for (key in result) { | |
| 203 | - self.guideboardForDetail[key] = result[key]; | |
| 204 | - } | |
| 205 | - | |
| 206 | - self.title = "路牌 " + self.guideboardForDetail.lpName + " 详细信息"; | |
| 207 | - }, | |
| 208 | - function(result) { | |
| 209 | - // TODO:弹出框方式以后改 | |
| 210 | - alert("出错啦!"); | |
| 211 | - } | |
| 212 | - ); | |
| 213 | -}]); | |
| 214 | - | |
| 215 | - | |
| 1 | +// 路牌管理 service controller 等写在一起 | |
| 2 | + | |
| 3 | +angular.module('ScheduleApp').factory('GuideboardManageService', ['GuideboardManageService_g', function(service) { | |
| 4 | + /** 当前的查询条件信息 */ | |
| 5 | + var currentSearchCondition = {}; | |
| 6 | + | |
| 7 | + /** 当前第几页 */ | |
| 8 | + var currentPageNo = 1; | |
| 9 | + | |
| 10 | + return { | |
| 11 | + /** | |
| 12 | + * 获取查询条件信息, | |
| 13 | + * 用于给controller用来和页面数据绑定。 | |
| 14 | + */ | |
| 15 | + getSearchCondition: function() { | |
| 16 | + return currentSearchCondition; | |
| 17 | + }, | |
| 18 | + /** | |
| 19 | + * 重置查询条件信息。 | |
| 20 | + */ | |
| 21 | + resetSearchCondition: function() { | |
| 22 | + var key; | |
| 23 | + for (key in currentSearchCondition) { | |
| 24 | + currentSearchCondition[key] = undefined; | |
| 25 | + } | |
| 26 | + }, | |
| 27 | + /** | |
| 28 | + * 设置当前页码。 | |
| 29 | + * @param cpn 从1开始,后台是从0开始的 | |
| 30 | + */ | |
| 31 | + setCurrentPageNo: function(cpn) { | |
| 32 | + currentPageNo = cpn; | |
| 33 | + }, | |
| 34 | + /** | |
| 35 | + * 组装查询参数,返回一个promise查询结果。 | |
| 36 | + * @param params 查询参数 | |
| 37 | + * @return 返回一个 promise | |
| 38 | + */ | |
| 39 | + getPage: function() { | |
| 40 | + var params = currentSearchCondition; // 查询条件 | |
| 41 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | + return service.rest.list(params).$promise; | |
| 43 | + }, | |
| 44 | + /** | |
| 45 | + * 获取明细信息。 | |
| 46 | + * @param id 车辆id | |
| 47 | + * @return 返回一个 promise | |
| 48 | + */ | |
| 49 | + getDetail: function(id) { | |
| 50 | + var params = {id: id}; | |
| 51 | + return service.rest.get(params).$promise; | |
| 52 | + }, | |
| 53 | + /** | |
| 54 | + * 保存信息。 | |
| 55 | + * @param obj 车辆详细信息 | |
| 56 | + * @return 返回一个 promise | |
| 57 | + */ | |
| 58 | + saveDetail: function(obj) { | |
| 59 | + return service.rest.save(obj).$promise; | |
| 60 | + } | |
| 61 | + }; | |
| 62 | +}]); | |
| 63 | + | |
| 64 | +angular.module('ScheduleApp').controller('GuideboardManageCtrl', ['GuideboardManageService', '$state', '$uibModal', function(guideboardManageService, $state, $uibModal) { | |
| 65 | + var self = this; | |
| 66 | + | |
| 67 | + // 切换到form状态 | |
| 68 | + self.goForm = function() { | |
| 69 | + alert("切换添加"); | |
| 70 | + }; | |
| 71 | + | |
| 72 | + // 导入excel | |
| 73 | + self.importData = function() { | |
| 74 | + // large方式弹出模态对话框 | |
| 75 | + var modalInstance = $uibModal.open({ | |
| 76 | + templateUrl: '/pages/scheduleApp/module/core/guideboardManage/dataImport.html', | |
| 77 | + size: "lg", | |
| 78 | + animation: true, | |
| 79 | + backdrop: 'static', | |
| 80 | + resolve: { | |
| 81 | + // 可以传值给controller | |
| 82 | + }, | |
| 83 | + windowClass: 'center-modal', | |
| 84 | + controller: "GuideboardManageToolsCtrl", | |
| 85 | + controllerAs: "ctrl", | |
| 86 | + bindToController: true | |
| 87 | + }); | |
| 88 | + modalInstance.result.then( | |
| 89 | + function() { | |
| 90 | + console.log("dataImport.html打开"); | |
| 91 | + }, | |
| 92 | + function() { | |
| 93 | + console.log("dataImport.html消失"); | |
| 94 | + } | |
| 95 | + ); | |
| 96 | + }; | |
| 97 | +}]); | |
| 98 | + | |
| 99 | +angular.module('ScheduleApp').controller('GuideboardManageToolsCtrl', ['$modalInstance', 'FileUploader', function($modalInstance, FileUploader) { | |
| 100 | + var self = this; | |
| 101 | + self.data = "TODO"; | |
| 102 | + | |
| 103 | + // 关闭窗口 | |
| 104 | + self.close = function() { | |
| 105 | + $modalInstance.dismiss("cancel"); | |
| 106 | + }; | |
| 107 | + | |
| 108 | + self.clearInputFile = function() { | |
| 109 | + angular.element("input[type='file']").val(null); | |
| 110 | + }; | |
| 111 | + | |
| 112 | + // 上传文件组件 | |
| 113 | + self.uploader = new FileUploader({ | |
| 114 | + url: "/gic/dataImport", | |
| 115 | + filters: [] // 用于过滤文件,比如只允许导入excel | |
| 116 | + }); | |
| 117 | + self.uploader.onAfterAddingFile = function(fileItem) | |
| 118 | + { | |
| 119 | + console.info('onAfterAddingFile', fileItem); | |
| 120 | + console.log(self.uploader.queue.length); | |
| 121 | + if (self.uploader.queue.length > 1) | |
| 122 | + self.uploader.removeFromQueue(0); | |
| 123 | + }; | |
| 124 | + self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 125 | + { | |
| 126 | + console.info('onSuccessItem', fileItem, response, status, headers); | |
| 127 | + }; | |
| 128 | + self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 129 | + { | |
| 130 | + console.info('onErrorItem', fileItem, response, status, headers); | |
| 131 | + }; | |
| 132 | + | |
| 133 | +}]); | |
| 134 | + | |
| 135 | +angular.module('ScheduleApp').controller('GuideboardManageListCtrl', ['GuideboardManageService', function(guideboardManageService) { | |
| 136 | + var self = this; | |
| 137 | + self.pageInfo = { | |
| 138 | + totalItems : 0, | |
| 139 | + currentPage : 1, | |
| 140 | + infos: [] | |
| 141 | + }; | |
| 142 | + | |
| 143 | + // 初始创建的时候,获取一次列表数据 | |
| 144 | + guideboardManageService.getPage().then( | |
| 145 | + function(result) { | |
| 146 | + self.pageInfo.totalItems = result.totalElements; | |
| 147 | + self.pageInfo.currentPage = result.number + 1; | |
| 148 | + self.pageInfo.infos = result.content; | |
| 149 | + guideboardManageService.setCurrentPageNo(result.number + 1); | |
| 150 | + }, | |
| 151 | + function(result) { | |
| 152 | + alert("出错啦!"); | |
| 153 | + } | |
| 154 | + ); | |
| 155 | + | |
| 156 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 157 | + // alert("dfdfdf"); | |
| 158 | + //}); | |
| 159 | + | |
| 160 | + // 翻页的时候调用 | |
| 161 | + self.pageChanaged = function() { | |
| 162 | + guideboardManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 163 | + guideboardManageService.getPage().then( | |
| 164 | + function(result) { | |
| 165 | + self.pageInfo.totalItems = result.totalElements; | |
| 166 | + self.pageInfo.currentPage = result.number + 1; | |
| 167 | + self.pageInfo.infos = result.content; | |
| 168 | + guideboardManageService.setCurrentPageNo(result.number + 1); | |
| 169 | + }, | |
| 170 | + function(result) { | |
| 171 | + alert("出错啦!"); | |
| 172 | + } | |
| 173 | + ); | |
| 174 | + }; | |
| 175 | + // 获取查询条件数据 | |
| 176 | + self.searchCondition = function() { | |
| 177 | + return guideboardManageService.getSearchCondition(); | |
| 178 | + }; | |
| 179 | + // 重置查询条件 | |
| 180 | + self.resetSearchCondition = function() { | |
| 181 | + guideboardManageService.resetSearchCondition(); | |
| 182 | + self.pageInfo.currentPage = 1; | |
| 183 | + self.pageChanaged(); | |
| 184 | + }; | |
| 185 | + | |
| 186 | +}]); | |
| 187 | + | |
| 188 | +angular.module('ScheduleApp').controller('GuideboardManageFormCtrl', ['GuideboardManageService', '$stateParams', '$state', function(guideboardManageService, $stateParams, $state) { | |
| 189 | + // TODO: | |
| 190 | +}]); | |
| 191 | + | |
| 192 | +angular.module('ScheduleApp').controller('GuideboardManageDetailCtrl', ['GuideboardManageService', '$stateParams', function(guideboardManageService, $stateParams) { | |
| 193 | + var self = this; | |
| 194 | + self.title = ""; | |
| 195 | + self.guideboardForDetail = {}; | |
| 196 | + self.guideboardForDetail.id = $stateParams.id; | |
| 197 | + | |
| 198 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 199 | + guideboardManageService.getDetail($stateParams.id).then( | |
| 200 | + function(result) { | |
| 201 | + var key; | |
| 202 | + for (key in result) { | |
| 203 | + self.guideboardForDetail[key] = result[key]; | |
| 204 | + } | |
| 205 | + | |
| 206 | + self.title = "路牌 " + self.guideboardForDetail.lpName + " 详细信息"; | |
| 207 | + }, | |
| 208 | + function(result) { | |
| 209 | + // TODO:弹出框方式以后改 | |
| 210 | + alert("出错啦!"); | |
| 211 | + } | |
| 212 | + ); | |
| 213 | +}]); | |
| 214 | + | |
| 215 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/guideboardManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 路牌管理配置所有模块页面route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("guideboardManage", { // index页面 | |
| 13 | - url: '/guideboardManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html' | |
| 17 | - }, | |
| 18 | - "guideboardManage_list@guideboardManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'guideboardManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | - "pages/scheduleApp/module/core/guideboardManage/module.js" | |
| 33 | - ] | |
| 34 | - }); | |
| 35 | - }] | |
| 36 | - } | |
| 37 | - }) | |
| 38 | - .state("guideboardManage_detail", { // 详细信息页面 | |
| 39 | - url: '/guideboardManage_detail/:id', | |
| 40 | - views: { | |
| 41 | - "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'} | |
| 42 | - }, | |
| 43 | - resolve: { | |
| 44 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | - return $ocLazyLoad.load({ | |
| 46 | - name: 'guideboardManage_detail_module', | |
| 47 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | - files: [ | |
| 49 | - "pages/scheduleApp/module/core/guideboardManage/module.js" | |
| 50 | - ] | |
| 51 | - }); | |
| 52 | - }] | |
| 53 | - } | |
| 54 | - }) | |
| 55 | - | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 路牌管理配置所有模块页面route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("guideboardManage", { // index页面 | |
| 13 | + url: '/guideboardManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/index.html' | |
| 17 | + }, | |
| 18 | + "guideboardManage_list@guideboardManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/core/guideboardManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'guideboardManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 32 | + "pages/scheduleApp/module/core/guideboardManage/module.js" | |
| 33 | + ] | |
| 34 | + }); | |
| 35 | + }] | |
| 36 | + } | |
| 37 | + }) | |
| 38 | + .state("guideboardManage_detail", { // 详细信息页面 | |
| 39 | + url: '/guideboardManage_detail/:id', | |
| 40 | + views: { | |
| 41 | + "": {templateUrl: 'pages/scheduleApp/module/core/guideboardManage/detail.html'} | |
| 42 | + }, | |
| 43 | + resolve: { | |
| 44 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 45 | + return $ocLazyLoad.load({ | |
| 46 | + name: 'guideboardManage_detail_module', | |
| 47 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 48 | + files: [ | |
| 49 | + "pages/scheduleApp/module/core/guideboardManage/module.js" | |
| 50 | + ] | |
| 51 | + }); | |
| 52 | + }] | |
| 53 | + } | |
| 54 | + }) | |
| 55 | + | |
| 56 | 56 | }]); |
| 57 | 57 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/module.js
| 1 | -// 规则配置管理 service controller 等写在一起 | |
| 2 | -angular.module('ScheduleApp').factory('RerunManageService', ['rerunManageService_g', function(service) { | |
| 3 | - /** 当前的查询条件信息 */ | |
| 4 | - var currentSearchCondition = {'isCancel_eq': false}; | |
| 5 | - | |
| 6 | - /** 当前第几页 */ | |
| 7 | - var currentPageNo = 1; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = undefined; | |
| 24 | - } | |
| 25 | - currentSearchCondition['isCancel_eq'] = false; | |
| 26 | - }, | |
| 27 | - /** | |
| 28 | - * 设置当前页码。 | |
| 29 | - * @param cpn 从1开始,后台是从0开始的 | |
| 30 | - */ | |
| 31 | - setCurrentPageNo: function(cpn) { | |
| 32 | - currentPageNo = cpn; | |
| 33 | - }, | |
| 34 | - /** | |
| 35 | - * 组装查询参数,返回一个promise查询结果。 | |
| 36 | - * @param params 查询参数 | |
| 37 | - * @return 返回一个 promise | |
| 38 | - */ | |
| 39 | - getPage: function() { | |
| 40 | - var params = currentSearchCondition; // 查询条件 | |
| 41 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | - return service.rest.list(params).$promise; | |
| 43 | - }, | |
| 44 | - /** | |
| 45 | - * 获取明细信息。 | |
| 46 | - * @param id 车辆id | |
| 47 | - * @return 返回一个 promise | |
| 48 | - */ | |
| 49 | - getDetail: function(id) { | |
| 50 | - var params = {id: id}; | |
| 51 | - return service.rest.get(params).$promise; | |
| 52 | - }, | |
| 53 | - /** | |
| 54 | - * 保存信息。 | |
| 55 | - * @param obj 车辆详细信息 | |
| 56 | - * @return 返回一个 promise | |
| 57 | - */ | |
| 58 | - saveDetail: function(obj) { | |
| 59 | - return service.rest.save(obj).$promise; | |
| 60 | - }, | |
| 61 | - /** | |
| 62 | - * 删除信息。 | |
| 63 | - * @param id 主键id | |
| 64 | - * @returns {*|Function|promise|n} | |
| 65 | - */ | |
| 66 | - deleteDetail: function(id) { | |
| 67 | - return service.rest.delete({id: id}).$promise; | |
| 68 | - } | |
| 69 | - }; | |
| 70 | - | |
| 71 | -}]); | |
| 72 | - | |
| 73 | -angular.module('ScheduleApp').controller('RerunManageCtrl', ['RerunManageService', '$state', function(rerunManageService, $state) { | |
| 74 | - var self = this; | |
| 75 | - | |
| 76 | - // 切换到form状态 | |
| 77 | - self.goForm = function() { | |
| 78 | - //alert("切换"); | |
| 79 | - $state.go("rerunManage_form"); | |
| 80 | - }; | |
| 81 | - | |
| 82 | -}]); | |
| 83 | - | |
| 84 | -angular.module('ScheduleApp').controller('RerunManageListCtrl', ['RerunManageService', function(rerunManageService) { | |
| 85 | - var self = this; | |
| 86 | - self.pageInfo = { | |
| 87 | - totalItems : 0, | |
| 88 | - currentPage : 1, | |
| 89 | - infos: [] | |
| 90 | - }; | |
| 91 | - | |
| 92 | - // 初始创建的时候,获取一次列表数据 | |
| 93 | - rerunManageService.getPage().then( | |
| 94 | - function(result) { | |
| 95 | - self.pageInfo.totalItems = result.totalElements; | |
| 96 | - self.pageInfo.currentPage = result.number + 1; | |
| 97 | - self.pageInfo.infos = result.content; | |
| 98 | - rerunManageService.setCurrentPageNo(result.number + 1); | |
| 99 | - }, | |
| 100 | - function(result) { | |
| 101 | - alert("出错啦!"); | |
| 102 | - } | |
| 103 | - ); | |
| 104 | - | |
| 105 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 106 | - // alert("dfdfdf"); | |
| 107 | - //}); | |
| 108 | - | |
| 109 | - // 翻页的时候调用 | |
| 110 | - self.pageChanaged = function() { | |
| 111 | - rerunManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 112 | - rerunManageService.getPage().then( | |
| 113 | - function(result) { | |
| 114 | - self.pageInfo.totalItems = result.totalElements; | |
| 115 | - self.pageInfo.currentPage = result.number + 1; | |
| 116 | - self.pageInfo.infos = result.content; | |
| 117 | - rerunManageService.setCurrentPageNo(result.number + 1); | |
| 118 | - }, | |
| 119 | - function(result) { | |
| 120 | - alert("出错啦!"); | |
| 121 | - } | |
| 122 | - ); | |
| 123 | - }; | |
| 124 | - // 获取查询条件数据 | |
| 125 | - self.searchCondition = function() { | |
| 126 | - return rerunManageService.getSearchCondition(); | |
| 127 | - }; | |
| 128 | - // 重置查询条件 | |
| 129 | - self.resetSearchCondition = function() { | |
| 130 | - rerunManageService.resetSearchCondition(); | |
| 131 | - self.pageInfo.currentPage = 1; | |
| 132 | - self.pageChanaged(); | |
| 133 | - }; | |
| 134 | - | |
| 135 | - // 作废/撤销 | |
| 136 | - self.toggleRerun = function(id) { | |
| 137 | - // TODO: | |
| 138 | - rerunManageService.deleteDetail(id).then( | |
| 139 | - function(result) { | |
| 140 | - if (result.message) { // 暂时这样做,之后全局拦截 | |
| 141 | - alert("失败:" + result.message); | |
| 142 | - } else { | |
| 143 | - alert("成功!"); | |
| 144 | - | |
| 145 | - rerunManageService.getPage().then( | |
| 146 | - function(result) { | |
| 147 | - self.pageInfo.totalItems = result.totalElements; | |
| 148 | - self.pageInfo.currentPage = result.number + 1; | |
| 149 | - self.pageInfo.infos = result.content; | |
| 150 | - rerunManageService.setCurrentPageNo(result.number + 1); | |
| 151 | - }, | |
| 152 | - function(result) { | |
| 153 | - alert("出错啦!"); | |
| 154 | - } | |
| 155 | - ); | |
| 156 | - } | |
| 157 | - | |
| 158 | - }, | |
| 159 | - function(result) { | |
| 160 | - alert("出错啦!" + result); | |
| 161 | - } | |
| 162 | - ); | |
| 163 | - }; | |
| 164 | - | |
| 165 | -}]); | |
| 166 | - | |
| 167 | -angular.module('ScheduleApp').controller('RerunManageFormCtrl', ['RerunManageService', '$stateParams', '$state', '$scope', function(rerunManageService, $stateParams, $state, $scope) { | |
| 168 | - var self = this; | |
| 169 | - | |
| 170 | - // 启用日期 日期控件开关 | |
| 171 | - self.qyrqOpen = false; | |
| 172 | - self.qyrq_open = function() { | |
| 173 | - self.qyrqOpen = true; | |
| 174 | - }; | |
| 175 | - | |
| 176 | - // 欲保存的busInfo信息,绑定 | |
| 177 | - self.rerunManageForSave = {rerunXl: {}, rerunTtinfo: {}, rerunLp: {}, rerunType: "dylp", useXl: {}, useLp: {}, useCarConfig: {}, useEmployeeConfig: {}}; | |
| 178 | - | |
| 179 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 180 | - var id = $stateParams.id; | |
| 181 | - if (id) { | |
| 182 | - self.rerunManageForSave.id = id; | |
| 183 | - rerunManageService.getDetail(id).then( | |
| 184 | - function(result) { | |
| 185 | - var key; | |
| 186 | - for (key in result) { | |
| 187 | - if (result[key]) { | |
| 188 | - self.rerunManageForSave[key] = result[key]; | |
| 189 | - | |
| 190 | - if (self.rerunManageForSave.rerunType == 'dylp') { | |
| 191 | - self.rerunManageForSave.useCarConfig = {}; | |
| 192 | - self.rerunManageForSave.useEmployeeConfig = {}; | |
| 193 | - } else if (self.rerunManageForSave.rerunType == 'dybc') { | |
| 194 | - self.rerunManageForSave.useXl = {}; | |
| 195 | - self.rerunManageForSave.useLp = {}; | |
| 196 | - } else { | |
| 197 | - | |
| 198 | - } | |
| 199 | - } | |
| 200 | - } | |
| 201 | - }, | |
| 202 | - function(result) { | |
| 203 | - alert("出错啦!"); | |
| 204 | - } | |
| 205 | - ); | |
| 206 | - } | |
| 207 | - | |
| 208 | - // 提交方法 | |
| 209 | - self.submit = function() { | |
| 210 | - if (self.rerunManageForSave.rerunType == 'dylp') { | |
| 211 | - delete self.rerunManageForSave.useCarConfig; | |
| 212 | - delete self.rerunManageForSave.useEmployeeConfig; | |
| 213 | - | |
| 214 | - // 关联对象只取id | |
| 215 | - self.rerunManageForSave.useXl = {id: self.rerunManageForSave.useXl.id}; | |
| 216 | - self.rerunManageForSave.useLp = {id: self.rerunManageForSave.useLp.id} | |
| 217 | - } else if (self.rerunManageForSave.rerunType == 'dybc') { | |
| 218 | - delete self.rerunManageForSave.useXl; | |
| 219 | - delete self.rerunManageForSave.useLp; | |
| 220 | - | |
| 221 | - // 关联对象只取id | |
| 222 | - self.rerunManageForSave.useCarConfig = {id: self.rerunManageForSave.useCarConfig.id}; | |
| 223 | - self.rerunManageForSave.useEmployeeConfig = {id: self.rerunManageForSave.useEmployeeConfig.id}; | |
| 224 | - } else { | |
| 225 | - return; | |
| 226 | - } | |
| 227 | - | |
| 228 | - rerunManageService.saveDetail(self.rerunManageForSave).then( | |
| 229 | - function(result) { | |
| 230 | - // TODO:弹出框方式以后改 | |
| 231 | - if (result.status == 'SUCCESS') { | |
| 232 | - alert("保存成功!"); | |
| 233 | - $state.go("rerunManage"); | |
| 234 | - } else { | |
| 235 | - alert("保存异常!"); | |
| 236 | - } | |
| 237 | - }, | |
| 238 | - function(result) { | |
| 239 | - // TODO:弹出框方式以后改 | |
| 240 | - alert("出错啦!"); | |
| 241 | - } | |
| 242 | - ); | |
| 243 | - }; | |
| 244 | -}]); | |
| 245 | - | |
| 246 | -angular.module('ScheduleApp').controller('RerunManageDetailCtrl', ['RerunManageService', '$stateParams', function(rerunManageService, $stateParams) { | |
| 247 | - var self = this; | |
| 248 | - self.title = ""; | |
| 249 | - self.rerunManageForDetail = {}; | |
| 250 | - self.rerunManageForDetail.id = $stateParams.id; | |
| 251 | - | |
| 252 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 253 | - rerunManageService.getDetail($stateParams.id).then( | |
| 254 | - function(result) { | |
| 255 | - var key; | |
| 256 | - for (key in result) { | |
| 257 | - self.rerunManageForDetail[key] = result[key]; | |
| 258 | - } | |
| 259 | - | |
| 260 | - self.title = "规则配置详细信息"; | |
| 261 | - }, | |
| 262 | - function(result) { | |
| 263 | - // TODO:弹出框方式以后改 | |
| 264 | - alert("出错啦!"); | |
| 265 | - } | |
| 266 | - ); | |
| 267 | -}]); | |
| 268 | - | |
| 269 | - | |
| 270 | - | |
| 1 | +// 规则配置管理 service controller 等写在一起 | |
| 2 | +angular.module('ScheduleApp').factory('RerunManageService', ['rerunManageService_g', function(service) { | |
| 3 | + /** 当前的查询条件信息 */ | |
| 4 | + var currentSearchCondition = {'isCancel_eq': false}; | |
| 5 | + | |
| 6 | + /** 当前第几页 */ | |
| 7 | + var currentPageNo = 1; | |
| 8 | + | |
| 9 | + return { | |
| 10 | + /** | |
| 11 | + * 获取查询条件信息, | |
| 12 | + * 用于给controller用来和页面数据绑定。 | |
| 13 | + */ | |
| 14 | + getSearchCondition: function() { | |
| 15 | + return currentSearchCondition; | |
| 16 | + }, | |
| 17 | + /** | |
| 18 | + * 重置查询条件信息。 | |
| 19 | + */ | |
| 20 | + resetSearchCondition: function() { | |
| 21 | + var key; | |
| 22 | + for (key in currentSearchCondition) { | |
| 23 | + currentSearchCondition[key] = undefined; | |
| 24 | + } | |
| 25 | + currentSearchCondition['isCancel_eq'] = false; | |
| 26 | + }, | |
| 27 | + /** | |
| 28 | + * 设置当前页码。 | |
| 29 | + * @param cpn 从1开始,后台是从0开始的 | |
| 30 | + */ | |
| 31 | + setCurrentPageNo: function(cpn) { | |
| 32 | + currentPageNo = cpn; | |
| 33 | + }, | |
| 34 | + /** | |
| 35 | + * 组装查询参数,返回一个promise查询结果。 | |
| 36 | + * @param params 查询参数 | |
| 37 | + * @return 返回一个 promise | |
| 38 | + */ | |
| 39 | + getPage: function() { | |
| 40 | + var params = currentSearchCondition; // 查询条件 | |
| 41 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 42 | + return service.rest.list(params).$promise; | |
| 43 | + }, | |
| 44 | + /** | |
| 45 | + * 获取明细信息。 | |
| 46 | + * @param id 车辆id | |
| 47 | + * @return 返回一个 promise | |
| 48 | + */ | |
| 49 | + getDetail: function(id) { | |
| 50 | + var params = {id: id}; | |
| 51 | + return service.rest.get(params).$promise; | |
| 52 | + }, | |
| 53 | + /** | |
| 54 | + * 保存信息。 | |
| 55 | + * @param obj 车辆详细信息 | |
| 56 | + * @return 返回一个 promise | |
| 57 | + */ | |
| 58 | + saveDetail: function(obj) { | |
| 59 | + return service.rest.save(obj).$promise; | |
| 60 | + }, | |
| 61 | + /** | |
| 62 | + * 删除信息。 | |
| 63 | + * @param id 主键id | |
| 64 | + * @returns {*|Function|promise|n} | |
| 65 | + */ | |
| 66 | + deleteDetail: function(id) { | |
| 67 | + return service.rest.delete({id: id}).$promise; | |
| 68 | + } | |
| 69 | + }; | |
| 70 | + | |
| 71 | +}]); | |
| 72 | + | |
| 73 | +angular.module('ScheduleApp').controller('RerunManageCtrl', ['RerunManageService', '$state', function(rerunManageService, $state) { | |
| 74 | + var self = this; | |
| 75 | + | |
| 76 | + // 切换到form状态 | |
| 77 | + self.goForm = function() { | |
| 78 | + //alert("切换"); | |
| 79 | + $state.go("rerunManage_form"); | |
| 80 | + }; | |
| 81 | + | |
| 82 | +}]); | |
| 83 | + | |
| 84 | +angular.module('ScheduleApp').controller('RerunManageListCtrl', ['RerunManageService', function(rerunManageService) { | |
| 85 | + var self = this; | |
| 86 | + self.pageInfo = { | |
| 87 | + totalItems : 0, | |
| 88 | + currentPage : 1, | |
| 89 | + infos: [] | |
| 90 | + }; | |
| 91 | + | |
| 92 | + // 初始创建的时候,获取一次列表数据 | |
| 93 | + rerunManageService.getPage().then( | |
| 94 | + function(result) { | |
| 95 | + self.pageInfo.totalItems = result.totalElements; | |
| 96 | + self.pageInfo.currentPage = result.number + 1; | |
| 97 | + self.pageInfo.infos = result.content; | |
| 98 | + rerunManageService.setCurrentPageNo(result.number + 1); | |
| 99 | + }, | |
| 100 | + function(result) { | |
| 101 | + alert("出错啦!"); | |
| 102 | + } | |
| 103 | + ); | |
| 104 | + | |
| 105 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 106 | + // alert("dfdfdf"); | |
| 107 | + //}); | |
| 108 | + | |
| 109 | + // 翻页的时候调用 | |
| 110 | + self.pageChanaged = function() { | |
| 111 | + rerunManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 112 | + rerunManageService.getPage().then( | |
| 113 | + function(result) { | |
| 114 | + self.pageInfo.totalItems = result.totalElements; | |
| 115 | + self.pageInfo.currentPage = result.number + 1; | |
| 116 | + self.pageInfo.infos = result.content; | |
| 117 | + rerunManageService.setCurrentPageNo(result.number + 1); | |
| 118 | + }, | |
| 119 | + function(result) { | |
| 120 | + alert("出错啦!"); | |
| 121 | + } | |
| 122 | + ); | |
| 123 | + }; | |
| 124 | + // 获取查询条件数据 | |
| 125 | + self.searchCondition = function() { | |
| 126 | + return rerunManageService.getSearchCondition(); | |
| 127 | + }; | |
| 128 | + // 重置查询条件 | |
| 129 | + self.resetSearchCondition = function() { | |
| 130 | + rerunManageService.resetSearchCondition(); | |
| 131 | + self.pageInfo.currentPage = 1; | |
| 132 | + self.pageChanaged(); | |
| 133 | + }; | |
| 134 | + | |
| 135 | + // 作废/撤销 | |
| 136 | + self.toggleRerun = function(id) { | |
| 137 | + // TODO: | |
| 138 | + rerunManageService.deleteDetail(id).then( | |
| 139 | + function(result) { | |
| 140 | + if (result.message) { // 暂时这样做,之后全局拦截 | |
| 141 | + alert("失败:" + result.message); | |
| 142 | + } else { | |
| 143 | + alert("成功!"); | |
| 144 | + | |
| 145 | + rerunManageService.getPage().then( | |
| 146 | + function(result) { | |
| 147 | + self.pageInfo.totalItems = result.totalElements; | |
| 148 | + self.pageInfo.currentPage = result.number + 1; | |
| 149 | + self.pageInfo.infos = result.content; | |
| 150 | + rerunManageService.setCurrentPageNo(result.number + 1); | |
| 151 | + }, | |
| 152 | + function(result) { | |
| 153 | + alert("出错啦!"); | |
| 154 | + } | |
| 155 | + ); | |
| 156 | + } | |
| 157 | + | |
| 158 | + }, | |
| 159 | + function(result) { | |
| 160 | + alert("出错啦!" + result); | |
| 161 | + } | |
| 162 | + ); | |
| 163 | + }; | |
| 164 | + | |
| 165 | +}]); | |
| 166 | + | |
| 167 | +angular.module('ScheduleApp').controller('RerunManageFormCtrl', ['RerunManageService', '$stateParams', '$state', '$scope', function(rerunManageService, $stateParams, $state, $scope) { | |
| 168 | + var self = this; | |
| 169 | + | |
| 170 | + // 启用日期 日期控件开关 | |
| 171 | + self.qyrqOpen = false; | |
| 172 | + self.qyrq_open = function() { | |
| 173 | + self.qyrqOpen = true; | |
| 174 | + }; | |
| 175 | + | |
| 176 | + // 欲保存的busInfo信息,绑定 | |
| 177 | + self.rerunManageForSave = {rerunXl: {}, rerunTtinfo: {}, rerunLp: {}, rerunType: "dylp", useXl: {}, useLp: {}, useCarConfig: {}, useEmployeeConfig: {}}; | |
| 178 | + | |
| 179 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 180 | + var id = $stateParams.id; | |
| 181 | + if (id) { | |
| 182 | + self.rerunManageForSave.id = id; | |
| 183 | + rerunManageService.getDetail(id).then( | |
| 184 | + function(result) { | |
| 185 | + var key; | |
| 186 | + for (key in result) { | |
| 187 | + if (result[key]) { | |
| 188 | + self.rerunManageForSave[key] = result[key]; | |
| 189 | + | |
| 190 | + if (self.rerunManageForSave.rerunType == 'dylp') { | |
| 191 | + self.rerunManageForSave.useCarConfig = {}; | |
| 192 | + self.rerunManageForSave.useEmployeeConfig = {}; | |
| 193 | + } else if (self.rerunManageForSave.rerunType == 'dybc') { | |
| 194 | + self.rerunManageForSave.useXl = {}; | |
| 195 | + self.rerunManageForSave.useLp = {}; | |
| 196 | + } else { | |
| 197 | + | |
| 198 | + } | |
| 199 | + } | |
| 200 | + } | |
| 201 | + }, | |
| 202 | + function(result) { | |
| 203 | + alert("出错啦!"); | |
| 204 | + } | |
| 205 | + ); | |
| 206 | + } | |
| 207 | + | |
| 208 | + // 提交方法 | |
| 209 | + self.submit = function() { | |
| 210 | + if (self.rerunManageForSave.rerunType == 'dylp') { | |
| 211 | + delete self.rerunManageForSave.useCarConfig; | |
| 212 | + delete self.rerunManageForSave.useEmployeeConfig; | |
| 213 | + | |
| 214 | + // 关联对象只取id | |
| 215 | + self.rerunManageForSave.useXl = {id: self.rerunManageForSave.useXl.id}; | |
| 216 | + self.rerunManageForSave.useLp = {id: self.rerunManageForSave.useLp.id} | |
| 217 | + } else if (self.rerunManageForSave.rerunType == 'dybc') { | |
| 218 | + delete self.rerunManageForSave.useXl; | |
| 219 | + delete self.rerunManageForSave.useLp; | |
| 220 | + | |
| 221 | + // 关联对象只取id | |
| 222 | + self.rerunManageForSave.useCarConfig = {id: self.rerunManageForSave.useCarConfig.id}; | |
| 223 | + self.rerunManageForSave.useEmployeeConfig = {id: self.rerunManageForSave.useEmployeeConfig.id}; | |
| 224 | + } else { | |
| 225 | + return; | |
| 226 | + } | |
| 227 | + | |
| 228 | + rerunManageService.saveDetail(self.rerunManageForSave).then( | |
| 229 | + function(result) { | |
| 230 | + // TODO:弹出框方式以后改 | |
| 231 | + if (result.status == 'SUCCESS') { | |
| 232 | + alert("保存成功!"); | |
| 233 | + $state.go("rerunManage"); | |
| 234 | + } else { | |
| 235 | + alert("保存异常!"); | |
| 236 | + } | |
| 237 | + }, | |
| 238 | + function(result) { | |
| 239 | + // TODO:弹出框方式以后改 | |
| 240 | + alert("出错啦!"); | |
| 241 | + } | |
| 242 | + ); | |
| 243 | + }; | |
| 244 | +}]); | |
| 245 | + | |
| 246 | +angular.module('ScheduleApp').controller('RerunManageDetailCtrl', ['RerunManageService', '$stateParams', function(rerunManageService, $stateParams) { | |
| 247 | + var self = this; | |
| 248 | + self.title = ""; | |
| 249 | + self.rerunManageForDetail = {}; | |
| 250 | + self.rerunManageForDetail.id = $stateParams.id; | |
| 251 | + | |
| 252 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 253 | + rerunManageService.getDetail($stateParams.id).then( | |
| 254 | + function(result) { | |
| 255 | + var key; | |
| 256 | + for (key in result) { | |
| 257 | + self.rerunManageForDetail[key] = result[key]; | |
| 258 | + } | |
| 259 | + | |
| 260 | + self.title = "规则配置详细信息"; | |
| 261 | + }, | |
| 262 | + function(result) { | |
| 263 | + // TODO:弹出框方式以后改 | |
| 264 | + alert("出错啦!"); | |
| 265 | + } | |
| 266 | + ); | |
| 267 | +}]); | |
| 268 | + | |
| 269 | + | |
| 270 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/rerunManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 套跑管理模块配置页面route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("rerunManage", { // index页面 | |
| 13 | - url: '/rerunManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/core/rerunManage/index.html' | |
| 17 | - }, | |
| 18 | - "rerunManage_list@rerunManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/core/rerunManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'rerunManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 32 | - ] | |
| 33 | - }); | |
| 34 | - }] | |
| 35 | - } | |
| 36 | - }) | |
| 37 | - .state("rerunManage_form", { // 添加套跑form | |
| 38 | - url: '/rerunManage_form', | |
| 39 | - views: { | |
| 40 | - "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/form.html'} | |
| 41 | - }, | |
| 42 | - resolve: { | |
| 43 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | - return $ocLazyLoad.load({ | |
| 45 | - name: 'rerunManage_form_module', | |
| 46 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | - files: [ | |
| 48 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | - "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 51 | - ] | |
| 52 | - }); | |
| 53 | - }] | |
| 54 | - } | |
| 55 | - }) | |
| 56 | - .state("rerunManage_edit", { // 修改套跑form | |
| 57 | - url: '/rerunManage_edit/:id', | |
| 58 | - views: { | |
| 59 | - "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/edit.html'} | |
| 60 | - }, | |
| 61 | - resolve: { | |
| 62 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | - return $ocLazyLoad.load({ | |
| 64 | - name: 'rerunManage_edit_module', | |
| 65 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | - files: [ | |
| 67 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | - "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 70 | - ] | |
| 71 | - }); | |
| 72 | - }] | |
| 73 | - } | |
| 74 | - }) | |
| 75 | - .state("rerunManage_detail", { // 详细信息页面 | |
| 76 | - url: '/rerunManage_detail/:id', | |
| 77 | - views: { | |
| 78 | - "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/detail.html'} | |
| 79 | - }, | |
| 80 | - resolve: { | |
| 81 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | - return $ocLazyLoad.load({ | |
| 83 | - name: 'rerunManage_detail_module', | |
| 84 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | - files: [ | |
| 86 | - "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 87 | - ] | |
| 88 | - }); | |
| 89 | - }] | |
| 90 | - } | |
| 91 | - }) | |
| 92 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 套跑管理模块配置页面route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("rerunManage", { // index页面 | |
| 13 | + url: '/rerunManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/core/rerunManage/index.html' | |
| 17 | + }, | |
| 18 | + "rerunManage_list@rerunManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/core/rerunManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'rerunManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 32 | + ] | |
| 33 | + }); | |
| 34 | + }] | |
| 35 | + } | |
| 36 | + }) | |
| 37 | + .state("rerunManage_form", { // 添加套跑form | |
| 38 | + url: '/rerunManage_form', | |
| 39 | + views: { | |
| 40 | + "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/form.html'} | |
| 41 | + }, | |
| 42 | + resolve: { | |
| 43 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | + return $ocLazyLoad.load({ | |
| 45 | + name: 'rerunManage_form_module', | |
| 46 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | + files: [ | |
| 48 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | + "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 51 | + ] | |
| 52 | + }); | |
| 53 | + }] | |
| 54 | + } | |
| 55 | + }) | |
| 56 | + .state("rerunManage_edit", { // 修改套跑form | |
| 57 | + url: '/rerunManage_edit/:id', | |
| 58 | + views: { | |
| 59 | + "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/edit.html'} | |
| 60 | + }, | |
| 61 | + resolve: { | |
| 62 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | + return $ocLazyLoad.load({ | |
| 64 | + name: 'rerunManage_edit_module', | |
| 65 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | + files: [ | |
| 67 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | + "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 70 | + ] | |
| 71 | + }); | |
| 72 | + }] | |
| 73 | + } | |
| 74 | + }) | |
| 75 | + .state("rerunManage_detail", { // 详细信息页面 | |
| 76 | + url: '/rerunManage_detail/:id', | |
| 77 | + views: { | |
| 78 | + "": {templateUrl: 'pages/scheduleApp/module/core/rerunManage/detail.html'} | |
| 79 | + }, | |
| 80 | + resolve: { | |
| 81 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | + return $ocLazyLoad.load({ | |
| 83 | + name: 'rerunManage_detail_module', | |
| 84 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | + files: [ | |
| 86 | + "pages/scheduleApp/module/core/rerunManage/module.js" | |
| 87 | + ] | |
| 88 | + }); | |
| 89 | + }] | |
| 90 | + } | |
| 91 | + }) | |
| 92 | + } | |
| 93 | 93 | ]); |
| 94 | 94 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/module.js
| 1 | -// 车辆配置管理 service controller 等写在一起 | |
| 2 | -angular.module('ScheduleApp').factory('SchedulePlanInfoManageService', ['SchedulePlanInfoManageService_g', function(service) { | |
| 3 | - /** 当前的查询条件信息 */ | |
| 4 | - var currentSearchCondition = {}; | |
| 5 | - | |
| 6 | - /** 当前第几页 */ | |
| 7 | - var currentPageNo = 1; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = undefined; | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - /** | |
| 27 | - * 设置当前页码。 | |
| 28 | - * @param cpn 从1开始,后台是从0开始的 | |
| 29 | - */ | |
| 30 | - setCurrentPageNo: function(cpn) { | |
| 31 | - currentPageNo = cpn; | |
| 32 | - }, | |
| 33 | - /** | |
| 34 | - * 组装查询参数,返回一个promise查询结果。 | |
| 35 | - * @param params 查询参数 | |
| 36 | - * @return 返回一个 promise | |
| 37 | - */ | |
| 38 | - getPage: function(spid) { | |
| 39 | - var params = currentSearchCondition; // 查询条件 | |
| 40 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | - params["schedulePlan.id_eq"] = spid; // 排班id | |
| 42 | - return service.rest.list(params).$promise; | |
| 43 | - } | |
| 44 | - | |
| 45 | - }; | |
| 46 | - | |
| 47 | -}]); | |
| 48 | - | |
| 49 | -angular.module('ScheduleApp').controller('SchedulePlanInfoManageCtrl', ['SchedulePlanInfoManageService', '$state', '$stateParams', '$scope', function(schedulePlanInfoManageService, $state, $stateParams, $scope) { | |
| 50 | - var self = this; | |
| 51 | - var spid = $stateParams.spid; // 排班规则id | |
| 52 | - var xlname = $stateParams.xlname; // 线路名字 | |
| 53 | - var ttname = $stateParams.ttname; // 时刻表名字 | |
| 54 | - var stime = $stateParams.stime; // 开始时间 | |
| 55 | - var etime = $stateParams.etime; // 结束时间 | |
| 56 | - | |
| 57 | - $scope.spid = spid; | |
| 58 | - $scope.xlname = xlname; | |
| 59 | - $scope.ttname = ttname; | |
| 60 | - $scope.stime = stime; | |
| 61 | - $scope.etime = etime; | |
| 62 | - | |
| 63 | - // 切换到form状态 | |
| 64 | - self.goForm = function() { | |
| 65 | - alert("等待生成"); | |
| 66 | - | |
| 67 | - } | |
| 68 | -}]); | |
| 69 | - | |
| 70 | -angular.module('ScheduleApp').controller('SchedulePlanInfoManageListCtrl', ['SchedulePlanInfoManageService', '$scope', function(schedulePlanInfoManageService, $scope) { | |
| 71 | - var self = this; | |
| 72 | - self.pageInfo = { | |
| 73 | - totalItems : 0, | |
| 74 | - currentPage : 1, | |
| 75 | - infos: [] | |
| 76 | - }; | |
| 77 | - | |
| 78 | - // 日期 日期控件开关 | |
| 79 | - self.scheduleDate = false; | |
| 80 | - self.scheduleDate_open = function() { | |
| 81 | - self.scheduleDate = true; | |
| 82 | - }; | |
| 83 | - | |
| 84 | - var spid = $scope.spid; | |
| 85 | - | |
| 86 | - // 初始创建的时候,获取一次列表数据 | |
| 87 | - schedulePlanInfoManageService.getPage(spid).then( | |
| 88 | - function(result) { | |
| 89 | - self.pageInfo.totalItems = result.totalElements; | |
| 90 | - self.pageInfo.currentPage = result.number + 1; | |
| 91 | - self.pageInfo.infos = result.content; | |
| 92 | - schedulePlanInfoManageService.setCurrentPageNo(result.number + 1); | |
| 93 | - }, | |
| 94 | - function(result) { | |
| 95 | - alert("出错啦!"); | |
| 96 | - } | |
| 97 | - ); | |
| 98 | - | |
| 99 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 100 | - // alert("dfdfdf"); | |
| 101 | - //}); | |
| 102 | - | |
| 103 | - // 翻页的时候调用 | |
| 104 | - self.pageChanaged = function() { | |
| 105 | - schedulePlanInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 106 | - schedulePlanInfoManageService.getPage(spid).then( | |
| 107 | - function(result) { | |
| 108 | - self.pageInfo.totalItems = result.totalElements; | |
| 109 | - self.pageInfo.currentPage = result.number + 1; | |
| 110 | - self.pageInfo.infos = result.content; | |
| 111 | - schedulePlanInfoManageService.setCurrentPageNo(result.number + 1); | |
| 112 | - }, | |
| 113 | - function(result) { | |
| 114 | - alert("出错啦!"); | |
| 115 | - } | |
| 116 | - ); | |
| 117 | - }; | |
| 118 | - // 获取查询条件数据 | |
| 119 | - self.searchCondition = function() { | |
| 120 | - return schedulePlanInfoManageService.getSearchCondition(); | |
| 121 | - }; | |
| 122 | - // 重置查询条件 | |
| 123 | - self.resetSearchCondition = function() { | |
| 124 | - return schedulePlanInfoManageService.resetSearchCondition(); | |
| 125 | - }; | |
| 126 | - | |
| 127 | - $scope.$watch( | |
| 128 | - function() { | |
| 129 | - return self.searchCondition()['scheduleDate_eq']; | |
| 130 | - }, | |
| 131 | - function(newValue, oldValue) { | |
| 132 | - if (newValue == undefined && oldValue == undefined) { | |
| 133 | - | |
| 134 | - } else { | |
| 135 | - self.pageChanaged(); | |
| 136 | - } | |
| 137 | - }); | |
| 138 | - | |
| 139 | -}]); | |
| 140 | - | |
| 141 | - | |
| 142 | - | |
| 143 | - | |
| 1 | +// 车辆配置管理 service controller 等写在一起 | |
| 2 | +angular.module('ScheduleApp').factory('SchedulePlanInfoManageService', ['SchedulePlanInfoManageService_g', function(service) { | |
| 3 | + /** 当前的查询条件信息 */ | |
| 4 | + var currentSearchCondition = {}; | |
| 5 | + | |
| 6 | + /** 当前第几页 */ | |
| 7 | + var currentPageNo = 1; | |
| 8 | + | |
| 9 | + return { | |
| 10 | + /** | |
| 11 | + * 获取查询条件信息, | |
| 12 | + * 用于给controller用来和页面数据绑定。 | |
| 13 | + */ | |
| 14 | + getSearchCondition: function() { | |
| 15 | + return currentSearchCondition; | |
| 16 | + }, | |
| 17 | + /** | |
| 18 | + * 重置查询条件信息。 | |
| 19 | + */ | |
| 20 | + resetSearchCondition: function() { | |
| 21 | + var key; | |
| 22 | + for (key in currentSearchCondition) { | |
| 23 | + currentSearchCondition[key] = undefined; | |
| 24 | + } | |
| 25 | + }, | |
| 26 | + /** | |
| 27 | + * 设置当前页码。 | |
| 28 | + * @param cpn 从1开始,后台是从0开始的 | |
| 29 | + */ | |
| 30 | + setCurrentPageNo: function(cpn) { | |
| 31 | + currentPageNo = cpn; | |
| 32 | + }, | |
| 33 | + /** | |
| 34 | + * 组装查询参数,返回一个promise查询结果。 | |
| 35 | + * @param params 查询参数 | |
| 36 | + * @return 返回一个 promise | |
| 37 | + */ | |
| 38 | + getPage: function(spid) { | |
| 39 | + var params = currentSearchCondition; // 查询条件 | |
| 40 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | + params["schedulePlan.id_eq"] = spid; // 排班id | |
| 42 | + return service.rest.list(params).$promise; | |
| 43 | + } | |
| 44 | + | |
| 45 | + }; | |
| 46 | + | |
| 47 | +}]); | |
| 48 | + | |
| 49 | +angular.module('ScheduleApp').controller('SchedulePlanInfoManageCtrl', ['SchedulePlanInfoManageService', '$state', '$stateParams', '$scope', function(schedulePlanInfoManageService, $state, $stateParams, $scope) { | |
| 50 | + var self = this; | |
| 51 | + var spid = $stateParams.spid; // 排班规则id | |
| 52 | + var xlname = $stateParams.xlname; // 线路名字 | |
| 53 | + var ttname = $stateParams.ttname; // 时刻表名字 | |
| 54 | + var stime = $stateParams.stime; // 开始时间 | |
| 55 | + var etime = $stateParams.etime; // 结束时间 | |
| 56 | + | |
| 57 | + $scope.spid = spid; | |
| 58 | + $scope.xlname = xlname; | |
| 59 | + $scope.ttname = ttname; | |
| 60 | + $scope.stime = stime; | |
| 61 | + $scope.etime = etime; | |
| 62 | + | |
| 63 | + // 切换到form状态 | |
| 64 | + self.goForm = function() { | |
| 65 | + alert("等待生成"); | |
| 66 | + | |
| 67 | + } | |
| 68 | +}]); | |
| 69 | + | |
| 70 | +angular.module('ScheduleApp').controller('SchedulePlanInfoManageListCtrl', ['SchedulePlanInfoManageService', '$scope', function(schedulePlanInfoManageService, $scope) { | |
| 71 | + var self = this; | |
| 72 | + self.pageInfo = { | |
| 73 | + totalItems : 0, | |
| 74 | + currentPage : 1, | |
| 75 | + infos: [] | |
| 76 | + }; | |
| 77 | + | |
| 78 | + // 日期 日期控件开关 | |
| 79 | + self.scheduleDate = false; | |
| 80 | + self.scheduleDate_open = function() { | |
| 81 | + self.scheduleDate = true; | |
| 82 | + }; | |
| 83 | + | |
| 84 | + var spid = $scope.spid; | |
| 85 | + | |
| 86 | + // 初始创建的时候,获取一次列表数据 | |
| 87 | + schedulePlanInfoManageService.getPage(spid).then( | |
| 88 | + function(result) { | |
| 89 | + self.pageInfo.totalItems = result.totalElements; | |
| 90 | + self.pageInfo.currentPage = result.number + 1; | |
| 91 | + self.pageInfo.infos = result.content; | |
| 92 | + schedulePlanInfoManageService.setCurrentPageNo(result.number + 1); | |
| 93 | + }, | |
| 94 | + function(result) { | |
| 95 | + alert("出错啦!"); | |
| 96 | + } | |
| 97 | + ); | |
| 98 | + | |
| 99 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 100 | + // alert("dfdfdf"); | |
| 101 | + //}); | |
| 102 | + | |
| 103 | + // 翻页的时候调用 | |
| 104 | + self.pageChanaged = function() { | |
| 105 | + schedulePlanInfoManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 106 | + schedulePlanInfoManageService.getPage(spid).then( | |
| 107 | + function(result) { | |
| 108 | + self.pageInfo.totalItems = result.totalElements; | |
| 109 | + self.pageInfo.currentPage = result.number + 1; | |
| 110 | + self.pageInfo.infos = result.content; | |
| 111 | + schedulePlanInfoManageService.setCurrentPageNo(result.number + 1); | |
| 112 | + }, | |
| 113 | + function(result) { | |
| 114 | + alert("出错啦!"); | |
| 115 | + } | |
| 116 | + ); | |
| 117 | + }; | |
| 118 | + // 获取查询条件数据 | |
| 119 | + self.searchCondition = function() { | |
| 120 | + return schedulePlanInfoManageService.getSearchCondition(); | |
| 121 | + }; | |
| 122 | + // 重置查询条件 | |
| 123 | + self.resetSearchCondition = function() { | |
| 124 | + return schedulePlanInfoManageService.resetSearchCondition(); | |
| 125 | + }; | |
| 126 | + | |
| 127 | + $scope.$watch( | |
| 128 | + function() { | |
| 129 | + return self.searchCondition()['scheduleDate_eq']; | |
| 130 | + }, | |
| 131 | + function(newValue, oldValue) { | |
| 132 | + if (newValue == undefined && oldValue == undefined) { | |
| 133 | + | |
| 134 | + } else { | |
| 135 | + self.pageChanaged(); | |
| 136 | + } | |
| 137 | + }); | |
| 138 | + | |
| 139 | +}]); | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 排班计划明细配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - // 排班计划明细管理模块 | |
| 13 | - .state("schedulePlanInfoManage", { | |
| 14 | - url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime', | |
| 15 | - views: { | |
| 16 | - "": { | |
| 17 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/index_info.html' | |
| 18 | - }, | |
| 19 | - "schedulePlanInfoManage_list@schedulePlanInfoManage": { | |
| 20 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html' | |
| 21 | - } | |
| 22 | - }, | |
| 23 | - | |
| 24 | - resolve: { | |
| 25 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 26 | - return $ocLazyLoad.load({ | |
| 27 | - name: 'schedulePlanInfoManage_module', | |
| 28 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 29 | - files: [ | |
| 30 | - "pages/scheduleApp/module/core/schedulePlanManage/info/module.js" | |
| 31 | - ] | |
| 32 | - }); | |
| 33 | - }] | |
| 34 | - } | |
| 35 | - }); | |
| 36 | - | |
| 37 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 排班计划明细配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + // 排班计划明细管理模块 | |
| 13 | + .state("schedulePlanInfoManage", { | |
| 14 | + url: '/schedulePlanInfoManage/:spid/:xlname/:ttname/:stime/:etime', | |
| 15 | + views: { | |
| 16 | + "": { | |
| 17 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/index_info.html' | |
| 18 | + }, | |
| 19 | + "schedulePlanInfoManage_list@schedulePlanInfoManage": { | |
| 20 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html' | |
| 21 | + } | |
| 22 | + }, | |
| 23 | + | |
| 24 | + resolve: { | |
| 25 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 26 | + return $ocLazyLoad.load({ | |
| 27 | + name: 'schedulePlanInfoManage_module', | |
| 28 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 29 | + files: [ | |
| 30 | + "pages/scheduleApp/module/core/schedulePlanManage/info/module.js" | |
| 31 | + ] | |
| 32 | + }); | |
| 33 | + }] | |
| 34 | + } | |
| 35 | + }); | |
| 36 | + | |
| 37 | + } | |
| 38 | 38 | ]); |
| 39 | 39 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/module.js
| 1 | -// 车辆配置管理 service controller 等写在一起 | |
| 2 | -angular.module('ScheduleApp').factory('SchedulePlanManageService', ['SchedulePlanManageService_g', function(service) { | |
| 3 | - /** 当前的查询条件信息 */ | |
| 4 | - var currentSearchCondition = {}; | |
| 5 | - | |
| 6 | - /** 当前第几页 */ | |
| 7 | - var currentPageNo = 1; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = undefined; | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - /** | |
| 27 | - * 设置当前页码。 | |
| 28 | - * @param cpn 从1开始,后台是从0开始的 | |
| 29 | - */ | |
| 30 | - setCurrentPageNo: function(cpn) { | |
| 31 | - currentPageNo = cpn; | |
| 32 | - }, | |
| 33 | - /** | |
| 34 | - * 组装查询参数,返回一个promise查询结果。 | |
| 35 | - * @param params 查询参数 | |
| 36 | - * @return 返回一个 promise | |
| 37 | - */ | |
| 38 | - getPage: function() { | |
| 39 | - var params = currentSearchCondition; // 查询条件 | |
| 40 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | - return service.rest.list(params).$promise; | |
| 42 | - }, | |
| 43 | - /** | |
| 44 | - * 保存信息。 | |
| 45 | - * @param obj 车辆详细信息 | |
| 46 | - * @return 返回一个 promise | |
| 47 | - */ | |
| 48 | - saveDetail: function(obj) { | |
| 49 | - return service.rest.save(obj).$promise; | |
| 50 | - }, | |
| 51 | - /** | |
| 52 | - * 删除信息。 | |
| 53 | - * @param id 主键id | |
| 54 | - * @returns {*|Function|promise|n} | |
| 55 | - */ | |
| 56 | - deleteDetail: function(id) { | |
| 57 | - return service.rest.delete({id: id}).$promise; | |
| 58 | - } | |
| 59 | - | |
| 60 | - }; | |
| 61 | - | |
| 62 | -}]); | |
| 63 | - | |
| 64 | -angular.module('ScheduleApp').controller('SchedulePlanManageCtrl', ['SchedulePlanManageService', '$state', function(schedulePlanManageService, $state) { | |
| 65 | - var self = this; | |
| 66 | - | |
| 67 | - // 切换到form状态 | |
| 68 | - self.goForm = function() { | |
| 69 | - $state.go("schedulePlanManage_form"); | |
| 70 | - } | |
| 71 | -}]); | |
| 72 | - | |
| 73 | -angular.module('ScheduleApp').controller('SchedulePlanManageListCtrl', ['SchedulePlanManageService', function(schedulePlanManageService) { | |
| 74 | - var self = this; | |
| 75 | - self.pageInfo = { | |
| 76 | - totalItems : 0, | |
| 77 | - currentPage : 1, | |
| 78 | - infos: [] | |
| 79 | - }; | |
| 80 | - | |
| 81 | - // 日期 日期控件开关 | |
| 82 | - self.scheduleFromTime = false; | |
| 83 | - self.scheduleFromTime_open = function() { | |
| 84 | - self.scheduleFromTime = true; | |
| 85 | - }; | |
| 86 | - self.scheduleToTime = false; | |
| 87 | - self.scheduleToTime_open = function() { | |
| 88 | - self.scheduleToTime = true; | |
| 89 | - }; | |
| 90 | - | |
| 91 | - // 初始创建的时候,获取一次列表数据 | |
| 92 | - schedulePlanManageService.getPage().then( | |
| 93 | - function(result) { | |
| 94 | - self.pageInfo.totalItems = result.totalElements; | |
| 95 | - self.pageInfo.currentPage = result.number + 1; | |
| 96 | - self.pageInfo.infos = result.content; | |
| 97 | - schedulePlanManageService.setCurrentPageNo(result.number + 1); | |
| 98 | - }, | |
| 99 | - function(result) { | |
| 100 | - alert("出错啦!"); | |
| 101 | - } | |
| 102 | - ); | |
| 103 | - | |
| 104 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 105 | - // alert("dfdfdf"); | |
| 106 | - //}); | |
| 107 | - | |
| 108 | - // 翻页的时候调用 | |
| 109 | - self.pageChanaged = function() { | |
| 110 | - schedulePlanManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 111 | - schedulePlanManageService.getPage().then( | |
| 112 | - function(result) { | |
| 113 | - self.pageInfo.totalItems = result.totalElements; | |
| 114 | - self.pageInfo.currentPage = result.number + 1; | |
| 115 | - self.pageInfo.infos = result.content; | |
| 116 | - schedulePlanManageService.setCurrentPageNo(result.number + 1); | |
| 117 | - }, | |
| 118 | - function(result) { | |
| 119 | - alert("出错啦!"); | |
| 120 | - } | |
| 121 | - ); | |
| 122 | - }; | |
| 123 | - // 获取查询条件数据 | |
| 124 | - self.searchCondition = function() { | |
| 125 | - return schedulePlanManageService.getSearchCondition(); | |
| 126 | - }; | |
| 127 | - // 重置查询条件 | |
| 128 | - self.resetSearchCondition = function() { | |
| 129 | - schedulePlanManageService.resetSearchCondition(); | |
| 130 | - self.pageInfo.currentPage = 1; | |
| 131 | - self.pageChanaged(); | |
| 132 | - }; | |
| 133 | - | |
| 134 | - // 删除排班(整个删除) | |
| 135 | - self.deletePlan = function(id) { | |
| 136 | - schedulePlanManageService.deleteDetail(id).then( | |
| 137 | - function(result) { | |
| 138 | - alert("删除成功!"); | |
| 139 | - | |
| 140 | - schedulePlanManageService.getPage().then( | |
| 141 | - function(result) { | |
| 142 | - self.pageInfo.totalItems = result.totalElements; | |
| 143 | - self.pageInfo.currentPage = result.number + 1; | |
| 144 | - self.pageInfo.infos = result.content; | |
| 145 | - schedulePlanManageService.setCurrentPageNo(result.number + 1); | |
| 146 | - }, | |
| 147 | - function(result) { | |
| 148 | - alert("出错啦!"); | |
| 149 | - } | |
| 150 | - ); | |
| 151 | - }, | |
| 152 | - function(result) { | |
| 153 | - alert("出错啦!"); | |
| 154 | - } | |
| 155 | - ); | |
| 156 | - } | |
| 157 | - | |
| 158 | -}]); | |
| 159 | - | |
| 160 | - | |
| 161 | -angular.module('ScheduleApp').controller('SchedulePlanManageFormCtrl', ['SchedulePlanManageService', '$stateParams', '$state', '$scope', function(schedulePlanManageService, $stateParams, $state, $scope) { | |
| 162 | - var self = this; | |
| 163 | - | |
| 164 | - // 开始日期 日期控件开关 | |
| 165 | - self.scheduleFromTimeOpen = false; | |
| 166 | - self.scheduleFromTime_open = function() { | |
| 167 | - self.scheduleFromTimeOpen = true; | |
| 168 | - }; | |
| 169 | - | |
| 170 | - // 结束日期 日期控件开关 | |
| 171 | - self.scheduleToTimeOpen = false; | |
| 172 | - self.scheduleToTime_open = function() { | |
| 173 | - self.scheduleToTimeOpen = true; | |
| 174 | - }; | |
| 175 | - | |
| 176 | - // 欲保存的busInfo信息,绑定 | |
| 177 | - self.schedulePlanManageForSave = {xl: {}}; | |
| 178 | - | |
| 179 | - // 提交方法 | |
| 180 | - self.submit = function() { | |
| 181 | - console.log(self.schedulePlanManageForSave); | |
| 182 | - | |
| 183 | - schedulePlanManageService.saveDetail(self.schedulePlanManageForSave).then( | |
| 184 | - function(result) { | |
| 185 | - // TODO:弹出框方式以后改 | |
| 186 | - if (result.status == 'SUCCESS') { | |
| 187 | - alert("保存成功!"); | |
| 188 | - $state.go("schedulePlanManage"); | |
| 189 | - } else { | |
| 190 | - alert("保存异常!"); | |
| 191 | - } | |
| 192 | - }, | |
| 193 | - function(result) { | |
| 194 | - // TODO:弹出框方式以后改 | |
| 195 | - alert("出错啦!"); | |
| 196 | - } | |
| 197 | - ); | |
| 198 | - }; | |
| 199 | -}]); | |
| 200 | - | |
| 1 | +// 车辆配置管理 service controller 等写在一起 | |
| 2 | +angular.module('ScheduleApp').factory('SchedulePlanManageService', ['SchedulePlanManageService_g', function(service) { | |
| 3 | + /** 当前的查询条件信息 */ | |
| 4 | + var currentSearchCondition = {}; | |
| 5 | + | |
| 6 | + /** 当前第几页 */ | |
| 7 | + var currentPageNo = 1; | |
| 8 | + | |
| 9 | + return { | |
| 10 | + /** | |
| 11 | + * 获取查询条件信息, | |
| 12 | + * 用于给controller用来和页面数据绑定。 | |
| 13 | + */ | |
| 14 | + getSearchCondition: function() { | |
| 15 | + return currentSearchCondition; | |
| 16 | + }, | |
| 17 | + /** | |
| 18 | + * 重置查询条件信息。 | |
| 19 | + */ | |
| 20 | + resetSearchCondition: function() { | |
| 21 | + var key; | |
| 22 | + for (key in currentSearchCondition) { | |
| 23 | + currentSearchCondition[key] = undefined; | |
| 24 | + } | |
| 25 | + }, | |
| 26 | + /** | |
| 27 | + * 设置当前页码。 | |
| 28 | + * @param cpn 从1开始,后台是从0开始的 | |
| 29 | + */ | |
| 30 | + setCurrentPageNo: function(cpn) { | |
| 31 | + currentPageNo = cpn; | |
| 32 | + }, | |
| 33 | + /** | |
| 34 | + * 组装查询参数,返回一个promise查询结果。 | |
| 35 | + * @param params 查询参数 | |
| 36 | + * @return 返回一个 promise | |
| 37 | + */ | |
| 38 | + getPage: function() { | |
| 39 | + var params = currentSearchCondition; // 查询条件 | |
| 40 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | + return service.rest.list(params).$promise; | |
| 42 | + }, | |
| 43 | + /** | |
| 44 | + * 保存信息。 | |
| 45 | + * @param obj 车辆详细信息 | |
| 46 | + * @return 返回一个 promise | |
| 47 | + */ | |
| 48 | + saveDetail: function(obj) { | |
| 49 | + return service.rest.save(obj).$promise; | |
| 50 | + }, | |
| 51 | + /** | |
| 52 | + * 删除信息。 | |
| 53 | + * @param id 主键id | |
| 54 | + * @returns {*|Function|promise|n} | |
| 55 | + */ | |
| 56 | + deleteDetail: function(id) { | |
| 57 | + return service.rest.delete({id: id}).$promise; | |
| 58 | + } | |
| 59 | + | |
| 60 | + }; | |
| 61 | + | |
| 62 | +}]); | |
| 63 | + | |
| 64 | +angular.module('ScheduleApp').controller('SchedulePlanManageCtrl', ['SchedulePlanManageService', '$state', function(schedulePlanManageService, $state) { | |
| 65 | + var self = this; | |
| 66 | + | |
| 67 | + // 切换到form状态 | |
| 68 | + self.goForm = function() { | |
| 69 | + $state.go("schedulePlanManage_form"); | |
| 70 | + } | |
| 71 | +}]); | |
| 72 | + | |
| 73 | +angular.module('ScheduleApp').controller('SchedulePlanManageListCtrl', ['SchedulePlanManageService', function(schedulePlanManageService) { | |
| 74 | + var self = this; | |
| 75 | + self.pageInfo = { | |
| 76 | + totalItems : 0, | |
| 77 | + currentPage : 1, | |
| 78 | + infos: [] | |
| 79 | + }; | |
| 80 | + | |
| 81 | + // 日期 日期控件开关 | |
| 82 | + self.scheduleFromTime = false; | |
| 83 | + self.scheduleFromTime_open = function() { | |
| 84 | + self.scheduleFromTime = true; | |
| 85 | + }; | |
| 86 | + self.scheduleToTime = false; | |
| 87 | + self.scheduleToTime_open = function() { | |
| 88 | + self.scheduleToTime = true; | |
| 89 | + }; | |
| 90 | + | |
| 91 | + // 初始创建的时候,获取一次列表数据 | |
| 92 | + schedulePlanManageService.getPage().then( | |
| 93 | + function(result) { | |
| 94 | + self.pageInfo.totalItems = result.totalElements; | |
| 95 | + self.pageInfo.currentPage = result.number + 1; | |
| 96 | + self.pageInfo.infos = result.content; | |
| 97 | + schedulePlanManageService.setCurrentPageNo(result.number + 1); | |
| 98 | + }, | |
| 99 | + function(result) { | |
| 100 | + alert("出错啦!"); | |
| 101 | + } | |
| 102 | + ); | |
| 103 | + | |
| 104 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 105 | + // alert("dfdfdf"); | |
| 106 | + //}); | |
| 107 | + | |
| 108 | + // 翻页的时候调用 | |
| 109 | + self.pageChanaged = function() { | |
| 110 | + schedulePlanManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 111 | + schedulePlanManageService.getPage().then( | |
| 112 | + function(result) { | |
| 113 | + self.pageInfo.totalItems = result.totalElements; | |
| 114 | + self.pageInfo.currentPage = result.number + 1; | |
| 115 | + self.pageInfo.infos = result.content; | |
| 116 | + schedulePlanManageService.setCurrentPageNo(result.number + 1); | |
| 117 | + }, | |
| 118 | + function(result) { | |
| 119 | + alert("出错啦!"); | |
| 120 | + } | |
| 121 | + ); | |
| 122 | + }; | |
| 123 | + // 获取查询条件数据 | |
| 124 | + self.searchCondition = function() { | |
| 125 | + return schedulePlanManageService.getSearchCondition(); | |
| 126 | + }; | |
| 127 | + // 重置查询条件 | |
| 128 | + self.resetSearchCondition = function() { | |
| 129 | + schedulePlanManageService.resetSearchCondition(); | |
| 130 | + self.pageInfo.currentPage = 1; | |
| 131 | + self.pageChanaged(); | |
| 132 | + }; | |
| 133 | + | |
| 134 | + // 删除排班(整个删除) | |
| 135 | + self.deletePlan = function(id) { | |
| 136 | + schedulePlanManageService.deleteDetail(id).then( | |
| 137 | + function(result) { | |
| 138 | + alert("删除成功!"); | |
| 139 | + | |
| 140 | + schedulePlanManageService.getPage().then( | |
| 141 | + function(result) { | |
| 142 | + self.pageInfo.totalItems = result.totalElements; | |
| 143 | + self.pageInfo.currentPage = result.number + 1; | |
| 144 | + self.pageInfo.infos = result.content; | |
| 145 | + schedulePlanManageService.setCurrentPageNo(result.number + 1); | |
| 146 | + }, | |
| 147 | + function(result) { | |
| 148 | + alert("出错啦!"); | |
| 149 | + } | |
| 150 | + ); | |
| 151 | + }, | |
| 152 | + function(result) { | |
| 153 | + alert("出错啦!"); | |
| 154 | + } | |
| 155 | + ); | |
| 156 | + } | |
| 157 | + | |
| 158 | +}]); | |
| 159 | + | |
| 160 | + | |
| 161 | +angular.module('ScheduleApp').controller('SchedulePlanManageFormCtrl', ['SchedulePlanManageService', '$stateParams', '$state', '$scope', function(schedulePlanManageService, $stateParams, $state, $scope) { | |
| 162 | + var self = this; | |
| 163 | + | |
| 164 | + // 开始日期 日期控件开关 | |
| 165 | + self.scheduleFromTimeOpen = false; | |
| 166 | + self.scheduleFromTime_open = function() { | |
| 167 | + self.scheduleFromTimeOpen = true; | |
| 168 | + }; | |
| 169 | + | |
| 170 | + // 结束日期 日期控件开关 | |
| 171 | + self.scheduleToTimeOpen = false; | |
| 172 | + self.scheduleToTime_open = function() { | |
| 173 | + self.scheduleToTimeOpen = true; | |
| 174 | + }; | |
| 175 | + | |
| 176 | + // 欲保存的busInfo信息,绑定 | |
| 177 | + self.schedulePlanManageForSave = {xl: {}}; | |
| 178 | + | |
| 179 | + // 提交方法 | |
| 180 | + self.submit = function() { | |
| 181 | + console.log(self.schedulePlanManageForSave); | |
| 182 | + | |
| 183 | + schedulePlanManageService.saveDetail(self.schedulePlanManageForSave).then( | |
| 184 | + function(result) { | |
| 185 | + // TODO:弹出框方式以后改 | |
| 186 | + if (result.status == 'SUCCESS') { | |
| 187 | + alert("保存成功!"); | |
| 188 | + $state.go("schedulePlanManage"); | |
| 189 | + } else { | |
| 190 | + alert("保存异常!"); | |
| 191 | + } | |
| 192 | + }, | |
| 193 | + function(result) { | |
| 194 | + // TODO:弹出框方式以后改 | |
| 195 | + alert("出错啦!"); | |
| 196 | + } | |
| 197 | + ); | |
| 198 | + }; | |
| 199 | +}]); | |
| 200 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/module.js
| 1 | -// 调度值勤日报管理 service controller 等写在一起 | |
| 2 | -// TODO:使用的global服务需要修正 | |
| 3 | -angular.module('ScheduleApp').factory('SchedulePlanReportManageService', [ | |
| 4 | - 'SchedulePlanInfoManageService_g', 'SchedulePlanManageService_g', '$q', | |
| 5 | - function(service, service2, $q) { | |
| 6 | - /** 当前的查询条件信息 */ | |
| 7 | - var currentSearchCondition = {}; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = undefined; | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - /** | |
| 27 | - * 组装查询参数,返回一个promise查询结果。 | |
| 28 | - * @param params 查询参数 | |
| 29 | - * @return 返回一个 promise | |
| 30 | - */ | |
| 31 | - getPage: function() { | |
| 32 | - var params = currentSearchCondition; // 查询条件 | |
| 33 | - | |
| 34 | - // promise | |
| 35 | - var deferred = $q.defer(); | |
| 36 | - | |
| 37 | - // 如果线路id和日期都没有,从后台获取一组参数,如果还没有,就设定死一组参数 | |
| 38 | - if (!params.xlid && !params.sdate) { | |
| 39 | - service2.tommorw.list().$promise.then( | |
| 40 | - function(result) { | |
| 41 | - if (result) { | |
| 42 | - // 线路id | |
| 43 | - params.xlid = result.xl.id; | |
| 44 | - // 时间 | |
| 45 | - var dd = new Date(); | |
| 46 | - dd.setHours(0); | |
| 47 | - dd.setMinutes(0); | |
| 48 | - dd.setSeconds(0); | |
| 49 | - dd.setMilliseconds(0); | |
| 50 | - dd.setTime(dd.getTime() + 24 * 3600 * 1000); | |
| 51 | - params.sdate = dd; | |
| 52 | - } else { | |
| 53 | - // 如果没有选中线路、日期,默认选中一个 | |
| 54 | - params.xlid = 2; | |
| 55 | - params.sdate = new Date(); | |
| 56 | - params.sdate.setTime(1472140800000); | |
| 57 | - } | |
| 58 | - | |
| 59 | - // 调用方法 | |
| 60 | - service.groupinfo.list(params).$promise.then( | |
| 61 | - function(result_internal) { | |
| 62 | - deferred.resolve(result_internal); | |
| 63 | - }, | |
| 64 | - function(result_internal_error) { | |
| 65 | - deferred.reject(result_internal_error); | |
| 66 | - } | |
| 67 | - ); | |
| 68 | - | |
| 69 | - }, | |
| 70 | - function(result_error) { | |
| 71 | - // 如果没有选中线路、日期,默认选中一个 | |
| 72 | - params.xlid = 2; | |
| 73 | - params.sdate = new Date(); | |
| 74 | - params.sdate.setTime(1472140800000); | |
| 75 | - | |
| 76 | - // 调用方法 | |
| 77 | - service.groupinfo.list(params).$promise.then( | |
| 78 | - function(result_internal) { | |
| 79 | - deferred.resolve(result_internal); | |
| 80 | - }, | |
| 81 | - function(result_internal_error) { | |
| 82 | - deferred.reject(result_internal_error); | |
| 83 | - } | |
| 84 | - ); | |
| 85 | - } | |
| 86 | - ); | |
| 87 | - } else { | |
| 88 | - // 调用方法 | |
| 89 | - service.groupinfo.list(params).$promise.then( | |
| 90 | - function(result_internal) { | |
| 91 | - deferred.resolve(result_internal); | |
| 92 | - }, | |
| 93 | - function(result_internal_error) { | |
| 94 | - deferred.reject(result_internal_error); | |
| 95 | - } | |
| 96 | - ); | |
| 97 | - } | |
| 98 | - | |
| 99 | - return deferred.promise; | |
| 100 | - | |
| 101 | - }, | |
| 102 | - /** | |
| 103 | - * 获取明细信息。 | |
| 104 | - * @param id 车辆id | |
| 105 | - * @return 返回一个 promise | |
| 106 | - */ | |
| 107 | - getDetail: function(id) { | |
| 108 | - var params = {id: id}; | |
| 109 | - return service.get(params).$promise; | |
| 110 | - }, | |
| 111 | - /** | |
| 112 | - * 保存信息。 | |
| 113 | - * @param obj 车辆详细信息 | |
| 114 | - * @return 返回一个 promise | |
| 115 | - */ | |
| 116 | - saveDetail: function(obj) { | |
| 117 | - return service.save(obj).$promise; | |
| 118 | - }, | |
| 119 | - /** | |
| 120 | - * 更新分组信息。 | |
| 121 | - * @param obj | |
| 122 | - * @returns {*|Function|promise|n} | |
| 123 | - */ | |
| 124 | - updateDetail: function(obj) { | |
| 125 | - return service.updateGroupInfo.update(obj).$promise; | |
| 126 | - } | |
| 127 | - }; | |
| 128 | - | |
| 129 | - }]); | |
| 130 | - | |
| 131 | -angular.module('ScheduleApp').controller('SchedulePlanReportManageCtrl', [ | |
| 132 | - 'SchedulePlanReportManageService', '$state', | |
| 133 | - function(schedulePlanReportManageService, $state) { | |
| 134 | - var self = this; | |
| 135 | - | |
| 136 | - // 切换到form状态 | |
| 137 | - self.goForm = function() { | |
| 138 | - alert("切换"); | |
| 139 | - } | |
| 140 | - } | |
| 141 | -]); | |
| 142 | - | |
| 143 | -angular.module('ScheduleApp').controller('SchedulePlanReportManageListCtrl', [ | |
| 144 | - 'SchedulePlanReportManageService', '$scope', '$state', | |
| 145 | - function(schedulePlanReportManageService, $scope, $state) { | |
| 146 | - | |
| 147 | - var self = this; | |
| 148 | - self.pageInfo = { | |
| 149 | - infos: [] | |
| 150 | - }; | |
| 151 | - | |
| 152 | - // 日期 日期控件开关 | |
| 153 | - self.scheduleDateOpen = false; | |
| 154 | - self.scheduleDate_open = function() { | |
| 155 | - self.scheduleDateOpen = true; | |
| 156 | - }; | |
| 157 | - | |
| 158 | - // 翻页的时候调用 | |
| 159 | - self.pageChanaged = function() { | |
| 160 | - schedulePlanReportManageService.getPage().then( | |
| 161 | - function(result) { | |
| 162 | - self.pageInfo.infos = result; | |
| 163 | - }, | |
| 164 | - function(result) { | |
| 165 | - alert("出错啦!"); | |
| 166 | - } | |
| 167 | - ); | |
| 168 | - }; | |
| 169 | - // 获取查询条件数据 | |
| 170 | - self.searchCondition = function() { | |
| 171 | - return schedulePlanReportManageService.getSearchCondition(); | |
| 172 | - }; | |
| 173 | - // 重置查询条件 | |
| 174 | - self.resetSearchCondition = function() { | |
| 175 | - return schedulePlanReportManageService.resetSearchCondition(); | |
| 176 | - }; | |
| 177 | - | |
| 178 | - // 监控条件变化,触发查询 | |
| 179 | - $scope.$watch( | |
| 180 | - function() { | |
| 181 | - return schedulePlanReportManageService.getSearchCondition(); | |
| 182 | - }, | |
| 183 | - function(newValue, oldValue) { | |
| 184 | - if (newValue) { | |
| 185 | - if (newValue.xlid && newValue.sdate) { | |
| 186 | - self.pageChanaged(); | |
| 187 | - } | |
| 188 | - } | |
| 189 | - }, | |
| 190 | - true | |
| 191 | - ); | |
| 192 | - | |
| 193 | - /** | |
| 194 | - * ui-route中param不定义在template-url后,定义在params参数对象中 | |
| 195 | - * 参数说明,type=更新方式,groupInfo=分组排班信息 | |
| 196 | - * @param type 1=替换车辆,2=修改出场班次1,3=替换分组人员(驾驶员1和售票员1) | |
| 197 | - // 有分班的话,4=修改出场班次2,5=修改分组人员(驾驶员2和售票员2) | |
| 198 | - * @param groupInfo 列表单条数据,表示每条线路,每天,每个路牌谁跑的 | |
| 199 | - */ | |
| 200 | - self.goEditForm = function(type, groupInfo) { | |
| 201 | - $state.go("schedulePlanReportManage_edit", { | |
| 202 | - type: type, | |
| 203 | - groupInfo: groupInfo | |
| 204 | - }); | |
| 205 | - }; | |
| 206 | - | |
| 207 | - | |
| 208 | - // 初始创建的时候,获取一次列表数据 | |
| 209 | - self.pageChanaged(); | |
| 210 | - | |
| 211 | - } | |
| 212 | -]); | |
| 213 | - | |
| 214 | -angular.module('ScheduleApp').controller('SchedulePlanReportManageFormCtrl', [ | |
| 215 | - 'SchedulePlanReportManageService', | |
| 216 | - '$stateParams', | |
| 217 | - '$state', | |
| 218 | - '$scope', | |
| 219 | - function(schedulePlanReportManageService, $stateParams, $state, $scope) { | |
| 220 | - var self = this; | |
| 221 | - | |
| 222 | - // 传过来的值 | |
| 223 | - var type_src = $stateParams.type; | |
| 224 | - var groupInfo_src = $stateParams.groupInfo; | |
| 225 | - | |
| 226 | - // 时间正则表达式(格式hh:mm,如:06:39) | |
| 227 | - self.time_regex = /^(([0-1]\d)|(2[0-4])):[0-5]\d$/; | |
| 228 | - | |
| 229 | - // 欲修改的groupInfo值 | |
| 230 | - self.groupInfo_src = groupInfo_src; | |
| 231 | - self.groupInfo = {}; | |
| 232 | - self.type = type_src; | |
| 233 | - angular.copy(groupInfo_src, self.groupInfo); | |
| 234 | - | |
| 235 | - // 提交方法 | |
| 236 | - self.submit = function() { | |
| 237 | - var param = { | |
| 238 | - type: self.type, | |
| 239 | - src: self.groupInfo_src, | |
| 240 | - update: self.groupInfo | |
| 241 | - }; | |
| 242 | - | |
| 243 | - //console.log($scope); | |
| 244 | - //console.log(param); | |
| 245 | - schedulePlanReportManageService.updateDetail(param).then( | |
| 246 | - function(result) { | |
| 247 | - $state.go("schedulePlanReportManage"); | |
| 248 | - }, | |
| 249 | - function(result) { | |
| 250 | - alert("出错啦!"); | |
| 251 | - } | |
| 252 | - ); | |
| 253 | - } | |
| 254 | - | |
| 255 | - } | |
| 256 | -]); | |
| 257 | - | |
| 258 | -angular.module('ScheduleApp').controller('SchedulePlanReportManageDetailCtrl', ['SchedulePlanReportManageService', '$stateParams', function(schedulePlanReportManageService, $stateParams) { | |
| 259 | - // TODO: | |
| 260 | -}]); | |
| 261 | - | |
| 262 | - | |
| 1 | +// 调度值勤日报管理 service controller 等写在一起 | |
| 2 | +// TODO:使用的global服务需要修正 | |
| 3 | +angular.module('ScheduleApp').factory('SchedulePlanReportManageService', [ | |
| 4 | + 'SchedulePlanInfoManageService_g', 'SchedulePlanManageService_g', '$q', | |
| 5 | + function(service, service2, $q) { | |
| 6 | + /** 当前的查询条件信息 */ | |
| 7 | + var currentSearchCondition = {}; | |
| 8 | + | |
| 9 | + return { | |
| 10 | + /** | |
| 11 | + * 获取查询条件信息, | |
| 12 | + * 用于给controller用来和页面数据绑定。 | |
| 13 | + */ | |
| 14 | + getSearchCondition: function() { | |
| 15 | + return currentSearchCondition; | |
| 16 | + }, | |
| 17 | + /** | |
| 18 | + * 重置查询条件信息。 | |
| 19 | + */ | |
| 20 | + resetSearchCondition: function() { | |
| 21 | + var key; | |
| 22 | + for (key in currentSearchCondition) { | |
| 23 | + currentSearchCondition[key] = undefined; | |
| 24 | + } | |
| 25 | + }, | |
| 26 | + /** | |
| 27 | + * 组装查询参数,返回一个promise查询结果。 | |
| 28 | + * @param params 查询参数 | |
| 29 | + * @return 返回一个 promise | |
| 30 | + */ | |
| 31 | + getPage: function() { | |
| 32 | + var params = currentSearchCondition; // 查询条件 | |
| 33 | + | |
| 34 | + // promise | |
| 35 | + var deferred = $q.defer(); | |
| 36 | + | |
| 37 | + // 如果线路id和日期都没有,从后台获取一组参数,如果还没有,就设定死一组参数 | |
| 38 | + if (!params.xlid && !params.sdate) { | |
| 39 | + service2.tommorw.list().$promise.then( | |
| 40 | + function(result) { | |
| 41 | + if (result) { | |
| 42 | + // 线路id | |
| 43 | + params.xlid = result.xl.id; | |
| 44 | + // 时间 | |
| 45 | + var dd = new Date(); | |
| 46 | + dd.setHours(0); | |
| 47 | + dd.setMinutes(0); | |
| 48 | + dd.setSeconds(0); | |
| 49 | + dd.setMilliseconds(0); | |
| 50 | + dd.setTime(dd.getTime() + 24 * 3600 * 1000); | |
| 51 | + params.sdate = dd; | |
| 52 | + } else { | |
| 53 | + // 如果没有选中线路、日期,默认选中一个 | |
| 54 | + params.xlid = 2; | |
| 55 | + params.sdate = new Date(); | |
| 56 | + params.sdate.setTime(1472140800000); | |
| 57 | + } | |
| 58 | + | |
| 59 | + // 调用方法 | |
| 60 | + service.groupinfo.list(params).$promise.then( | |
| 61 | + function(result_internal) { | |
| 62 | + deferred.resolve(result_internal); | |
| 63 | + }, | |
| 64 | + function(result_internal_error) { | |
| 65 | + deferred.reject(result_internal_error); | |
| 66 | + } | |
| 67 | + ); | |
| 68 | + | |
| 69 | + }, | |
| 70 | + function(result_error) { | |
| 71 | + // 如果没有选中线路、日期,默认选中一个 | |
| 72 | + params.xlid = 2; | |
| 73 | + params.sdate = new Date(); | |
| 74 | + params.sdate.setTime(1472140800000); | |
| 75 | + | |
| 76 | + // 调用方法 | |
| 77 | + service.groupinfo.list(params).$promise.then( | |
| 78 | + function(result_internal) { | |
| 79 | + deferred.resolve(result_internal); | |
| 80 | + }, | |
| 81 | + function(result_internal_error) { | |
| 82 | + deferred.reject(result_internal_error); | |
| 83 | + } | |
| 84 | + ); | |
| 85 | + } | |
| 86 | + ); | |
| 87 | + } else { | |
| 88 | + // 调用方法 | |
| 89 | + service.groupinfo.list(params).$promise.then( | |
| 90 | + function(result_internal) { | |
| 91 | + deferred.resolve(result_internal); | |
| 92 | + }, | |
| 93 | + function(result_internal_error) { | |
| 94 | + deferred.reject(result_internal_error); | |
| 95 | + } | |
| 96 | + ); | |
| 97 | + } | |
| 98 | + | |
| 99 | + return deferred.promise; | |
| 100 | + | |
| 101 | + }, | |
| 102 | + /** | |
| 103 | + * 获取明细信息。 | |
| 104 | + * @param id 车辆id | |
| 105 | + * @return 返回一个 promise | |
| 106 | + */ | |
| 107 | + getDetail: function(id) { | |
| 108 | + var params = {id: id}; | |
| 109 | + return service.get(params).$promise; | |
| 110 | + }, | |
| 111 | + /** | |
| 112 | + * 保存信息。 | |
| 113 | + * @param obj 车辆详细信息 | |
| 114 | + * @return 返回一个 promise | |
| 115 | + */ | |
| 116 | + saveDetail: function(obj) { | |
| 117 | + return service.save(obj).$promise; | |
| 118 | + }, | |
| 119 | + /** | |
| 120 | + * 更新分组信息。 | |
| 121 | + * @param obj | |
| 122 | + * @returns {*|Function|promise|n} | |
| 123 | + */ | |
| 124 | + updateDetail: function(obj) { | |
| 125 | + return service.updateGroupInfo.update(obj).$promise; | |
| 126 | + } | |
| 127 | + }; | |
| 128 | + | |
| 129 | + }]); | |
| 130 | + | |
| 131 | +angular.module('ScheduleApp').controller('SchedulePlanReportManageCtrl', [ | |
| 132 | + 'SchedulePlanReportManageService', '$state', | |
| 133 | + function(schedulePlanReportManageService, $state) { | |
| 134 | + var self = this; | |
| 135 | + | |
| 136 | + // 切换到form状态 | |
| 137 | + self.goForm = function() { | |
| 138 | + alert("切换"); | |
| 139 | + } | |
| 140 | + } | |
| 141 | +]); | |
| 142 | + | |
| 143 | +angular.module('ScheduleApp').controller('SchedulePlanReportManageListCtrl', [ | |
| 144 | + 'SchedulePlanReportManageService', '$scope', '$state', | |
| 145 | + function(schedulePlanReportManageService, $scope, $state) { | |
| 146 | + | |
| 147 | + var self = this; | |
| 148 | + self.pageInfo = { | |
| 149 | + infos: [] | |
| 150 | + }; | |
| 151 | + | |
| 152 | + // 日期 日期控件开关 | |
| 153 | + self.scheduleDateOpen = false; | |
| 154 | + self.scheduleDate_open = function() { | |
| 155 | + self.scheduleDateOpen = true; | |
| 156 | + }; | |
| 157 | + | |
| 158 | + // 翻页的时候调用 | |
| 159 | + self.pageChanaged = function() { | |
| 160 | + schedulePlanReportManageService.getPage().then( | |
| 161 | + function(result) { | |
| 162 | + self.pageInfo.infos = result; | |
| 163 | + }, | |
| 164 | + function(result) { | |
| 165 | + alert("出错啦!"); | |
| 166 | + } | |
| 167 | + ); | |
| 168 | + }; | |
| 169 | + // 获取查询条件数据 | |
| 170 | + self.searchCondition = function() { | |
| 171 | + return schedulePlanReportManageService.getSearchCondition(); | |
| 172 | + }; | |
| 173 | + // 重置查询条件 | |
| 174 | + self.resetSearchCondition = function() { | |
| 175 | + return schedulePlanReportManageService.resetSearchCondition(); | |
| 176 | + }; | |
| 177 | + | |
| 178 | + // 监控条件变化,触发查询 | |
| 179 | + $scope.$watch( | |
| 180 | + function() { | |
| 181 | + return schedulePlanReportManageService.getSearchCondition(); | |
| 182 | + }, | |
| 183 | + function(newValue, oldValue) { | |
| 184 | + if (newValue) { | |
| 185 | + if (newValue.xlid && newValue.sdate) { | |
| 186 | + self.pageChanaged(); | |
| 187 | + } | |
| 188 | + } | |
| 189 | + }, | |
| 190 | + true | |
| 191 | + ); | |
| 192 | + | |
| 193 | + /** | |
| 194 | + * ui-route中param不定义在template-url后,定义在params参数对象中 | |
| 195 | + * 参数说明,type=更新方式,groupInfo=分组排班信息 | |
| 196 | + * @param type 1=替换车辆,2=修改出场班次1,3=替换分组人员(驾驶员1和售票员1) | |
| 197 | + // 有分班的话,4=修改出场班次2,5=修改分组人员(驾驶员2和售票员2) | |
| 198 | + * @param groupInfo 列表单条数据,表示每条线路,每天,每个路牌谁跑的 | |
| 199 | + */ | |
| 200 | + self.goEditForm = function(type, groupInfo) { | |
| 201 | + $state.go("schedulePlanReportManage_edit", { | |
| 202 | + type: type, | |
| 203 | + groupInfo: groupInfo | |
| 204 | + }); | |
| 205 | + }; | |
| 206 | + | |
| 207 | + | |
| 208 | + // 初始创建的时候,获取一次列表数据 | |
| 209 | + self.pageChanaged(); | |
| 210 | + | |
| 211 | + } | |
| 212 | +]); | |
| 213 | + | |
| 214 | +angular.module('ScheduleApp').controller('SchedulePlanReportManageFormCtrl', [ | |
| 215 | + 'SchedulePlanReportManageService', | |
| 216 | + '$stateParams', | |
| 217 | + '$state', | |
| 218 | + '$scope', | |
| 219 | + function(schedulePlanReportManageService, $stateParams, $state, $scope) { | |
| 220 | + var self = this; | |
| 221 | + | |
| 222 | + // 传过来的值 | |
| 223 | + var type_src = $stateParams.type; | |
| 224 | + var groupInfo_src = $stateParams.groupInfo; | |
| 225 | + | |
| 226 | + // 时间正则表达式(格式hh:mm,如:06:39) | |
| 227 | + self.time_regex = /^(([0-1]\d)|(2[0-4])):[0-5]\d$/; | |
| 228 | + | |
| 229 | + // 欲修改的groupInfo值 | |
| 230 | + self.groupInfo_src = groupInfo_src; | |
| 231 | + self.groupInfo = {}; | |
| 232 | + self.type = type_src; | |
| 233 | + angular.copy(groupInfo_src, self.groupInfo); | |
| 234 | + | |
| 235 | + // 提交方法 | |
| 236 | + self.submit = function() { | |
| 237 | + var param = { | |
| 238 | + type: self.type, | |
| 239 | + src: self.groupInfo_src, | |
| 240 | + update: self.groupInfo | |
| 241 | + }; | |
| 242 | + | |
| 243 | + //console.log($scope); | |
| 244 | + //console.log(param); | |
| 245 | + schedulePlanReportManageService.updateDetail(param).then( | |
| 246 | + function(result) { | |
| 247 | + $state.go("schedulePlanReportManage"); | |
| 248 | + }, | |
| 249 | + function(result) { | |
| 250 | + alert("出错啦!"); | |
| 251 | + } | |
| 252 | + ); | |
| 253 | + } | |
| 254 | + | |
| 255 | + } | |
| 256 | +]); | |
| 257 | + | |
| 258 | +angular.module('ScheduleApp').controller('SchedulePlanReportManageDetailCtrl', ['SchedulePlanReportManageService', '$stateParams', function(schedulePlanReportManageService, $stateParams) { | |
| 259 | + // TODO: | |
| 260 | +}]); | |
| 261 | + | |
| 262 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 排班调度值勤日报配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("schedulePlanReportManage", { | |
| 13 | - url: '/schedulePlanReportManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/index_report.html' | |
| 17 | - }, | |
| 18 | - "schedulePlanReportManage_list@schedulePlanReportManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/list_report.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'schedulePlanManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "pages/scheduleApp/module/core/schedulePlanManage/report/module.js" | |
| 32 | - ] | |
| 33 | - }); | |
| 34 | - }] | |
| 35 | - } | |
| 36 | - }) | |
| 37 | - .state("schedulePlanReportManage_edit", { | |
| 38 | - url: '/schedulePlanReportManage_edit', | |
| 39 | - params: {type: 0, groupInfo: null}, | |
| 40 | - views: { | |
| 41 | - "": { | |
| 42 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/edit_report.html' | |
| 43 | - } | |
| 44 | - }, | |
| 45 | - | |
| 46 | - resolve: { | |
| 47 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 48 | - return $ocLazyLoad.load({ | |
| 49 | - name: 'schedulePlanReportManage_edit_module', | |
| 50 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 51 | - files: [ | |
| 52 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 53 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 54 | - "pages/scheduleApp/module/core/schedulePlanManage/report/module.js" | |
| 55 | - ] | |
| 56 | - }); | |
| 57 | - }] | |
| 58 | - } | |
| 59 | - }); | |
| 60 | - | |
| 61 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 排班调度值勤日报配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("schedulePlanReportManage", { | |
| 13 | + url: '/schedulePlanReportManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/index_report.html' | |
| 17 | + }, | |
| 18 | + "schedulePlanReportManage_list@schedulePlanReportManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/list_report.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'schedulePlanManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "pages/scheduleApp/module/core/schedulePlanManage/report/module.js" | |
| 32 | + ] | |
| 33 | + }); | |
| 34 | + }] | |
| 35 | + } | |
| 36 | + }) | |
| 37 | + .state("schedulePlanReportManage_edit", { | |
| 38 | + url: '/schedulePlanReportManage_edit', | |
| 39 | + params: {type: 0, groupInfo: null}, | |
| 40 | + views: { | |
| 41 | + "": { | |
| 42 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/report/edit_report.html' | |
| 43 | + } | |
| 44 | + }, | |
| 45 | + | |
| 46 | + resolve: { | |
| 47 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 48 | + return $ocLazyLoad.load({ | |
| 49 | + name: 'schedulePlanReportManage_edit_module', | |
| 50 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 51 | + files: [ | |
| 52 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 53 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 54 | + "pages/scheduleApp/module/core/schedulePlanManage/report/module.js" | |
| 55 | + ] | |
| 56 | + }); | |
| 57 | + }] | |
| 58 | + } | |
| 59 | + }); | |
| 60 | + | |
| 61 | + } | |
| 62 | 62 | ]); |
| 63 | 63 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 排班计划管理配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("schedulePlanManage", { // index页面 | |
| 13 | - url: '/schedulePlanManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index.html' | |
| 17 | - }, | |
| 18 | - "schedulePlanManage_list@schedulePlanManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'schedulePlanManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "pages/scheduleApp/module/core/schedulePlanManage/module.js" | |
| 32 | - ] | |
| 33 | - }); | |
| 34 | - }] | |
| 35 | - } | |
| 36 | - }) | |
| 37 | - .state("schedulePlanManage_form", { // 添加排班计划form | |
| 38 | - url: '/schedulePlanManage_form', | |
| 39 | - views: { | |
| 40 | - "": { | |
| 41 | - templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/form.html' | |
| 42 | - } | |
| 43 | - }, | |
| 44 | - | |
| 45 | - resolve: { | |
| 46 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 47 | - return $ocLazyLoad.load({ | |
| 48 | - name: 'schedulePlanManage_form_module', | |
| 49 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 50 | - files: [ | |
| 51 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 52 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 53 | - "pages/scheduleApp/module/core/schedulePlanManage/module.js" | |
| 54 | - ] | |
| 55 | - }); | |
| 56 | - }] | |
| 57 | - } | |
| 58 | - }) | |
| 59 | - | |
| 60 | - | |
| 61 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 排班计划管理配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("schedulePlanManage", { // index页面 | |
| 13 | + url: '/schedulePlanManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/index.html' | |
| 17 | + }, | |
| 18 | + "schedulePlanManage_list@schedulePlanManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'schedulePlanManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "pages/scheduleApp/module/core/schedulePlanManage/module.js" | |
| 32 | + ] | |
| 33 | + }); | |
| 34 | + }] | |
| 35 | + } | |
| 36 | + }) | |
| 37 | + .state("schedulePlanManage_form", { // 添加排班计划form | |
| 38 | + url: '/schedulePlanManage_form', | |
| 39 | + views: { | |
| 40 | + "": { | |
| 41 | + templateUrl: 'pages/scheduleApp/module/core/schedulePlanManage/form.html' | |
| 42 | + } | |
| 43 | + }, | |
| 44 | + | |
| 45 | + resolve: { | |
| 46 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 47 | + return $ocLazyLoad.load({ | |
| 48 | + name: 'schedulePlanManage_form_module', | |
| 49 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 50 | + files: [ | |
| 51 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 52 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 53 | + "pages/scheduleApp/module/core/schedulePlanManage/module.js" | |
| 54 | + ] | |
| 55 | + }); | |
| 56 | + }] | |
| 57 | + } | |
| 58 | + }) | |
| 59 | + | |
| 60 | + | |
| 61 | + } | |
| 62 | 62 | ]); |
| 63 | 63 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/module.js
| 1 | -// 规则配置管理 service controller 等写在一起 | |
| 2 | -angular.module('ScheduleApp').factory('ScheduleRuleManageService', ['ScheduleRuleManageService_g', function(service) { | |
| 3 | - /** 当前的查询条件信息 */ | |
| 4 | - var currentSearchCondition = {}; | |
| 5 | - | |
| 6 | - /** 当前第几页 */ | |
| 7 | - var currentPageNo = 1; | |
| 8 | - | |
| 9 | - return { | |
| 10 | - /** | |
| 11 | - * 获取查询条件信息, | |
| 12 | - * 用于给controller用来和页面数据绑定。 | |
| 13 | - */ | |
| 14 | - getSearchCondition: function() { | |
| 15 | - return currentSearchCondition; | |
| 16 | - }, | |
| 17 | - /** | |
| 18 | - * 重置查询条件信息。 | |
| 19 | - */ | |
| 20 | - resetSearchCondition: function() { | |
| 21 | - var key; | |
| 22 | - for (key in currentSearchCondition) { | |
| 23 | - currentSearchCondition[key] = undefined; | |
| 24 | - } | |
| 25 | - }, | |
| 26 | - /** | |
| 27 | - * 设置当前页码。 | |
| 28 | - * @param cpn 从1开始,后台是从0开始的 | |
| 29 | - */ | |
| 30 | - setCurrentPageNo: function(cpn) { | |
| 31 | - currentPageNo = cpn; | |
| 32 | - }, | |
| 33 | - /** | |
| 34 | - * 组装查询参数,返回一个promise查询结果。 | |
| 35 | - * @param params 查询参数 | |
| 36 | - * @return 返回一个 promise | |
| 37 | - */ | |
| 38 | - getPage: function() { | |
| 39 | - var params = currentSearchCondition; // 查询条件 | |
| 40 | - params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | - return service.rest.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.rest.get(params).$promise; | |
| 51 | - }, | |
| 52 | - /** | |
| 53 | - * 保存信息。 | |
| 54 | - * @param obj 车辆详细信息 | |
| 55 | - * @return 返回一个 promise | |
| 56 | - */ | |
| 57 | - saveDetail: function(obj) { | |
| 58 | - return service.rest.save(obj).$promise; | |
| 59 | - }, | |
| 60 | - /** | |
| 61 | - * 删除信息。 | |
| 62 | - * @param id 主键id | |
| 63 | - * @returns {*|Function|promise|n} | |
| 64 | - */ | |
| 65 | - deleteDetail: function(id) { | |
| 66 | - return service.rest.delete({id: id}).$promise; | |
| 67 | - } | |
| 68 | - }; | |
| 69 | - | |
| 70 | -}]); | |
| 71 | - | |
| 72 | -angular.module('ScheduleApp').controller('ScheduleRuleManageCtrl', ['ScheduleRuleManageService', '$state', function(busConfigService, $state) { | |
| 73 | - var self = this; | |
| 74 | - | |
| 75 | - // 切换到form状态 | |
| 76 | - self.goForm = function() { | |
| 77 | - //alert("切换"); | |
| 78 | - $state.go("scheduleRuleManage_form"); | |
| 79 | - }; | |
| 80 | - | |
| 81 | -}]); | |
| 82 | - | |
| 83 | -angular.module('ScheduleApp').controller('ScheduleRuleManageListCtrl', ['ScheduleRuleManageService', function(scheduleRuleManageService) { | |
| 84 | - var self = this; | |
| 85 | - self.pageInfo = { | |
| 86 | - totalItems : 0, | |
| 87 | - currentPage : 1, | |
| 88 | - infos: [] | |
| 89 | - }; | |
| 90 | - | |
| 91 | - // 初始创建的时候,获取一次列表数据 | |
| 92 | - scheduleRuleManageService.getPage().then( | |
| 93 | - function(result) { | |
| 94 | - self.pageInfo.totalItems = result.totalElements; | |
| 95 | - self.pageInfo.currentPage = result.number + 1; | |
| 96 | - self.pageInfo.infos = result.content; | |
| 97 | - scheduleRuleManageService.setCurrentPageNo(result.number + 1); | |
| 98 | - }, | |
| 99 | - function(result) { | |
| 100 | - alert("出错啦!"); | |
| 101 | - } | |
| 102 | - ); | |
| 103 | - | |
| 104 | - //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 105 | - // alert("dfdfdf"); | |
| 106 | - //}); | |
| 107 | - | |
| 108 | - // 翻页的时候调用 | |
| 109 | - self.pageChanaged = function() { | |
| 110 | - scheduleRuleManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 111 | - scheduleRuleManageService.getPage().then( | |
| 112 | - function(result) { | |
| 113 | - self.pageInfo.totalItems = result.totalElements; | |
| 114 | - self.pageInfo.currentPage = result.number + 1; | |
| 115 | - self.pageInfo.infos = result.content; | |
| 116 | - scheduleRuleManageService.setCurrentPageNo(result.number + 1); | |
| 117 | - }, | |
| 118 | - function(result) { | |
| 119 | - alert("出错啦!"); | |
| 120 | - } | |
| 121 | - ); | |
| 122 | - }; | |
| 123 | - // 获取查询条件数据 | |
| 124 | - self.searchCondition = function() { | |
| 125 | - return scheduleRuleManageService.getSearchCondition(); | |
| 126 | - }; | |
| 127 | - // 重置查询条件 | |
| 128 | - self.resetSearchCondition = function() { | |
| 129 | - scheduleRuleManageService.resetSearchCondition(); | |
| 130 | - self.pageInfo.currentPage = 1; | |
| 131 | - self.pageChanaged(); | |
| 132 | - }; | |
| 133 | - | |
| 134 | - // 删除规则 | |
| 135 | - self.deleteRule = function(id) { | |
| 136 | - scheduleRuleManageService.deleteDetail(id).then( | |
| 137 | - function(result) { | |
| 138 | - alert("删除成功!"); | |
| 139 | - | |
| 140 | - scheduleRuleManageService.getPage().then( | |
| 141 | - function(result) { | |
| 142 | - self.pageInfo.totalItems = result.totalElements; | |
| 143 | - self.pageInfo.currentPage = result.number + 1; | |
| 144 | - self.pageInfo.infos = result.content; | |
| 145 | - scheduleRuleManageService.setCurrentPageNo(result.number + 1); | |
| 146 | - }, | |
| 147 | - function(result) { | |
| 148 | - alert("出错啦!"); | |
| 149 | - } | |
| 150 | - ); | |
| 151 | - }, | |
| 152 | - function(result) { | |
| 153 | - alert("出错啦!"); | |
| 154 | - } | |
| 155 | - ); | |
| 156 | - } | |
| 157 | - | |
| 158 | -}]); | |
| 159 | - | |
| 160 | -angular.module('ScheduleApp').controller('ScheduleRuleManageFormCtrl', ['ScheduleRuleManageService', '$stateParams', '$state', '$scope', function(scheduleRuleManageService, $stateParams, $state, $scope) { | |
| 161 | - var self = this; | |
| 162 | - | |
| 163 | - // 启用日期 日期控件开关 | |
| 164 | - self.qyrqOpen = false; | |
| 165 | - self.qyrq_open = function() { | |
| 166 | - self.qyrqOpen = true; | |
| 167 | - }; | |
| 168 | - | |
| 169 | - // 欲保存的busInfo信息,绑定 | |
| 170 | - self.scheduleRuleManageForSave = {xl: {}, carConfigInfo: {}}; | |
| 171 | - | |
| 172 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 173 | - var id = $stateParams.id; | |
| 174 | - if (id) { | |
| 175 | - self.scheduleRuleManageForSave.id = id; | |
| 176 | - scheduleRuleManageService.getDetail(id).then( | |
| 177 | - function(result) { | |
| 178 | - var key; | |
| 179 | - for (key in result) { | |
| 180 | - self.scheduleRuleManageForSave[key] = result[key]; | |
| 181 | - } | |
| 182 | - }, | |
| 183 | - function(result) { | |
| 184 | - alert("出错啦!"); | |
| 185 | - } | |
| 186 | - ); | |
| 187 | - } | |
| 188 | - | |
| 189 | - // 提交方法 | |
| 190 | - self.submit = function() { | |
| 191 | - console.log(self.scheduleRuleManageForSave); | |
| 192 | - | |
| 193 | - scheduleRuleManageService.saveDetail(self.scheduleRuleManageForSave).then( | |
| 194 | - function(result) { | |
| 195 | - // TODO:弹出框方式以后改 | |
| 196 | - if (result.status == 'SUCCESS') { | |
| 197 | - alert("保存成功!"); | |
| 198 | - $state.go("scheduleRuleManage"); | |
| 199 | - } else { | |
| 200 | - alert("保存异常!"); | |
| 201 | - } | |
| 202 | - }, | |
| 203 | - function(result) { | |
| 204 | - // TODO:弹出框方式以后改 | |
| 205 | - alert("出错啦!"); | |
| 206 | - } | |
| 207 | - ); | |
| 208 | - }; | |
| 209 | -}]); | |
| 210 | - | |
| 211 | -angular.module('ScheduleApp').controller('ScheduleRuleManageDetailCtrl', ['ScheduleRuleManageService', '$stateParams', function(scheduleRuleManageService, $stateParams) { | |
| 212 | - var self = this; | |
| 213 | - self.title = ""; | |
| 214 | - self.scheduleRuleManageForDetail = {}; | |
| 215 | - self.scheduleRuleManageForDetail.id = $stateParams.id; | |
| 216 | - | |
| 217 | - // 当转向到此页面时,就获取明细信息并绑定 | |
| 218 | - scheduleRuleManageService.getDetail($stateParams.id).then( | |
| 219 | - function(result) { | |
| 220 | - var key; | |
| 221 | - for (key in result) { | |
| 222 | - self.scheduleRuleManageForDetail[key] = result[key]; | |
| 223 | - } | |
| 224 | - | |
| 225 | - self.title = "规则配置详细信息"; | |
| 226 | - }, | |
| 227 | - function(result) { | |
| 228 | - // TODO:弹出框方式以后改 | |
| 229 | - alert("出错啦!"); | |
| 230 | - } | |
| 231 | - ); | |
| 232 | -}]); | |
| 233 | - | |
| 234 | - | |
| 235 | - | |
| 1 | +// 规则配置管理 service controller 等写在一起 | |
| 2 | +angular.module('ScheduleApp').factory('ScheduleRuleManageService', ['ScheduleRuleManageService_g', function(service) { | |
| 3 | + /** 当前的查询条件信息 */ | |
| 4 | + var currentSearchCondition = {}; | |
| 5 | + | |
| 6 | + /** 当前第几页 */ | |
| 7 | + var currentPageNo = 1; | |
| 8 | + | |
| 9 | + return { | |
| 10 | + /** | |
| 11 | + * 获取查询条件信息, | |
| 12 | + * 用于给controller用来和页面数据绑定。 | |
| 13 | + */ | |
| 14 | + getSearchCondition: function() { | |
| 15 | + return currentSearchCondition; | |
| 16 | + }, | |
| 17 | + /** | |
| 18 | + * 重置查询条件信息。 | |
| 19 | + */ | |
| 20 | + resetSearchCondition: function() { | |
| 21 | + var key; | |
| 22 | + for (key in currentSearchCondition) { | |
| 23 | + currentSearchCondition[key] = undefined; | |
| 24 | + } | |
| 25 | + }, | |
| 26 | + /** | |
| 27 | + * 设置当前页码。 | |
| 28 | + * @param cpn 从1开始,后台是从0开始的 | |
| 29 | + */ | |
| 30 | + setCurrentPageNo: function(cpn) { | |
| 31 | + currentPageNo = cpn; | |
| 32 | + }, | |
| 33 | + /** | |
| 34 | + * 组装查询参数,返回一个promise查询结果。 | |
| 35 | + * @param params 查询参数 | |
| 36 | + * @return 返回一个 promise | |
| 37 | + */ | |
| 38 | + getPage: function() { | |
| 39 | + var params = currentSearchCondition; // 查询条件 | |
| 40 | + params.page = currentPageNo - 1; // 服务端页码从0开始 | |
| 41 | + return service.rest.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.rest.get(params).$promise; | |
| 51 | + }, | |
| 52 | + /** | |
| 53 | + * 保存信息。 | |
| 54 | + * @param obj 车辆详细信息 | |
| 55 | + * @return 返回一个 promise | |
| 56 | + */ | |
| 57 | + saveDetail: function(obj) { | |
| 58 | + return service.rest.save(obj).$promise; | |
| 59 | + }, | |
| 60 | + /** | |
| 61 | + * 删除信息。 | |
| 62 | + * @param id 主键id | |
| 63 | + * @returns {*|Function|promise|n} | |
| 64 | + */ | |
| 65 | + deleteDetail: function(id) { | |
| 66 | + return service.rest.delete({id: id}).$promise; | |
| 67 | + } | |
| 68 | + }; | |
| 69 | + | |
| 70 | +}]); | |
| 71 | + | |
| 72 | +angular.module('ScheduleApp').controller('ScheduleRuleManageCtrl', ['ScheduleRuleManageService', '$state', function(busConfigService, $state) { | |
| 73 | + var self = this; | |
| 74 | + | |
| 75 | + // 切换到form状态 | |
| 76 | + self.goForm = function() { | |
| 77 | + //alert("切换"); | |
| 78 | + $state.go("scheduleRuleManage_form"); | |
| 79 | + }; | |
| 80 | + | |
| 81 | +}]); | |
| 82 | + | |
| 83 | +angular.module('ScheduleApp').controller('ScheduleRuleManageListCtrl', ['ScheduleRuleManageService', function(scheduleRuleManageService) { | |
| 84 | + var self = this; | |
| 85 | + self.pageInfo = { | |
| 86 | + totalItems : 0, | |
| 87 | + currentPage : 1, | |
| 88 | + infos: [] | |
| 89 | + }; | |
| 90 | + | |
| 91 | + // 初始创建的时候,获取一次列表数据 | |
| 92 | + scheduleRuleManageService.getPage().then( | |
| 93 | + function(result) { | |
| 94 | + self.pageInfo.totalItems = result.totalElements; | |
| 95 | + self.pageInfo.currentPage = result.number + 1; | |
| 96 | + self.pageInfo.infos = result.content; | |
| 97 | + scheduleRuleManageService.setCurrentPageNo(result.number + 1); | |
| 98 | + }, | |
| 99 | + function(result) { | |
| 100 | + alert("出错啦!"); | |
| 101 | + } | |
| 102 | + ); | |
| 103 | + | |
| 104 | + //$scope.$watch("ctrl.pageInfo.currentPage", function() { | |
| 105 | + // alert("dfdfdf"); | |
| 106 | + //}); | |
| 107 | + | |
| 108 | + // 翻页的时候调用 | |
| 109 | + self.pageChanaged = function() { | |
| 110 | + scheduleRuleManageService.setCurrentPageNo(self.pageInfo.currentPage); | |
| 111 | + scheduleRuleManageService.getPage().then( | |
| 112 | + function(result) { | |
| 113 | + self.pageInfo.totalItems = result.totalElements; | |
| 114 | + self.pageInfo.currentPage = result.number + 1; | |
| 115 | + self.pageInfo.infos = result.content; | |
| 116 | + scheduleRuleManageService.setCurrentPageNo(result.number + 1); | |
| 117 | + }, | |
| 118 | + function(result) { | |
| 119 | + alert("出错啦!"); | |
| 120 | + } | |
| 121 | + ); | |
| 122 | + }; | |
| 123 | + // 获取查询条件数据 | |
| 124 | + self.searchCondition = function() { | |
| 125 | + return scheduleRuleManageService.getSearchCondition(); | |
| 126 | + }; | |
| 127 | + // 重置查询条件 | |
| 128 | + self.resetSearchCondition = function() { | |
| 129 | + scheduleRuleManageService.resetSearchCondition(); | |
| 130 | + self.pageInfo.currentPage = 1; | |
| 131 | + self.pageChanaged(); | |
| 132 | + }; | |
| 133 | + | |
| 134 | + // 删除规则 | |
| 135 | + self.deleteRule = function(id) { | |
| 136 | + scheduleRuleManageService.deleteDetail(id).then( | |
| 137 | + function(result) { | |
| 138 | + alert("删除成功!"); | |
| 139 | + | |
| 140 | + scheduleRuleManageService.getPage().then( | |
| 141 | + function(result) { | |
| 142 | + self.pageInfo.totalItems = result.totalElements; | |
| 143 | + self.pageInfo.currentPage = result.number + 1; | |
| 144 | + self.pageInfo.infos = result.content; | |
| 145 | + scheduleRuleManageService.setCurrentPageNo(result.number + 1); | |
| 146 | + }, | |
| 147 | + function(result) { | |
| 148 | + alert("出错啦!"); | |
| 149 | + } | |
| 150 | + ); | |
| 151 | + }, | |
| 152 | + function(result) { | |
| 153 | + alert("出错啦!"); | |
| 154 | + } | |
| 155 | + ); | |
| 156 | + } | |
| 157 | + | |
| 158 | +}]); | |
| 159 | + | |
| 160 | +angular.module('ScheduleApp').controller('ScheduleRuleManageFormCtrl', ['ScheduleRuleManageService', '$stateParams', '$state', '$scope', function(scheduleRuleManageService, $stateParams, $state, $scope) { | |
| 161 | + var self = this; | |
| 162 | + | |
| 163 | + // 启用日期 日期控件开关 | |
| 164 | + self.qyrqOpen = false; | |
| 165 | + self.qyrq_open = function() { | |
| 166 | + self.qyrqOpen = true; | |
| 167 | + }; | |
| 168 | + | |
| 169 | + // 欲保存的busInfo信息,绑定 | |
| 170 | + self.scheduleRuleManageForSave = {xl: {}, carConfigInfo: {}}; | |
| 171 | + | |
| 172 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | |
| 173 | + var id = $stateParams.id; | |
| 174 | + if (id) { | |
| 175 | + self.scheduleRuleManageForSave.id = id; | |
| 176 | + scheduleRuleManageService.getDetail(id).then( | |
| 177 | + function(result) { | |
| 178 | + var key; | |
| 179 | + for (key in result) { | |
| 180 | + self.scheduleRuleManageForSave[key] = result[key]; | |
| 181 | + } | |
| 182 | + }, | |
| 183 | + function(result) { | |
| 184 | + alert("出错啦!"); | |
| 185 | + } | |
| 186 | + ); | |
| 187 | + } | |
| 188 | + | |
| 189 | + // 提交方法 | |
| 190 | + self.submit = function() { | |
| 191 | + console.log(self.scheduleRuleManageForSave); | |
| 192 | + | |
| 193 | + scheduleRuleManageService.saveDetail(self.scheduleRuleManageForSave).then( | |
| 194 | + function(result) { | |
| 195 | + // TODO:弹出框方式以后改 | |
| 196 | + if (result.status == 'SUCCESS') { | |
| 197 | + alert("保存成功!"); | |
| 198 | + $state.go("scheduleRuleManage"); | |
| 199 | + } else { | |
| 200 | + alert("保存异常!"); | |
| 201 | + } | |
| 202 | + }, | |
| 203 | + function(result) { | |
| 204 | + // TODO:弹出框方式以后改 | |
| 205 | + alert("出错啦!"); | |
| 206 | + } | |
| 207 | + ); | |
| 208 | + }; | |
| 209 | +}]); | |
| 210 | + | |
| 211 | +angular.module('ScheduleApp').controller('ScheduleRuleManageDetailCtrl', ['ScheduleRuleManageService', '$stateParams', function(scheduleRuleManageService, $stateParams) { | |
| 212 | + var self = this; | |
| 213 | + self.title = ""; | |
| 214 | + self.scheduleRuleManageForDetail = {}; | |
| 215 | + self.scheduleRuleManageForDetail.id = $stateParams.id; | |
| 216 | + | |
| 217 | + // 当转向到此页面时,就获取明细信息并绑定 | |
| 218 | + scheduleRuleManageService.getDetail($stateParams.id).then( | |
| 219 | + function(result) { | |
| 220 | + var key; | |
| 221 | + for (key in result) { | |
| 222 | + self.scheduleRuleManageForDetail[key] = result[key]; | |
| 223 | + } | |
| 224 | + | |
| 225 | + self.title = "规则配置详细信息"; | |
| 226 | + }, | |
| 227 | + function(result) { | |
| 228 | + // TODO:弹出框方式以后改 | |
| 229 | + alert("出错啦!"); | |
| 230 | + } | |
| 231 | + ); | |
| 232 | +}]); | |
| 233 | + | |
| 234 | + | |
| 235 | + | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 排班规则模块配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("scheduleRuleManage", { // index页面 | |
| 13 | - url: '/scheduleRuleManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/index.html' | |
| 17 | - }, | |
| 18 | - "scheduleRuleManage_list@scheduleRuleManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'scheduleRuleManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 32 | - ] | |
| 33 | - }); | |
| 34 | - }] | |
| 35 | - } | |
| 36 | - }) | |
| 37 | - .state("scheduleRuleManage_form", { // 添加排班规则form | |
| 38 | - url: '/scheduleRuleManage_form', | |
| 39 | - views: { | |
| 40 | - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/form.html'} | |
| 41 | - }, | |
| 42 | - resolve: { | |
| 43 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | - return $ocLazyLoad.load({ | |
| 45 | - name: 'scheduleRuleManage_form_module', | |
| 46 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | - files: [ | |
| 48 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | - "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 51 | - ] | |
| 52 | - }); | |
| 53 | - }] | |
| 54 | - } | |
| 55 | - }) | |
| 56 | - .state("scheduleRuleManage_edit", { // 修改排班规则form | |
| 57 | - url: '/scheduleRuleManage_edit/:id', | |
| 58 | - views: { | |
| 59 | - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/edit.html'} | |
| 60 | - }, | |
| 61 | - resolve: { | |
| 62 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | - return $ocLazyLoad.load({ | |
| 64 | - name: 'scheduleRuleManage_edit_module', | |
| 65 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | - files: [ | |
| 67 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | - "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 70 | - ] | |
| 71 | - }); | |
| 72 | - }] | |
| 73 | - } | |
| 74 | - }) | |
| 75 | - .state("scheduleRuleManage_detail", { // 详细信息 | |
| 76 | - url: '/scheduleRuleManage_detail/:id', | |
| 77 | - views: { | |
| 78 | - "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/detail.html'} | |
| 79 | - }, | |
| 80 | - resolve: { | |
| 81 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | - return $ocLazyLoad.load({ | |
| 83 | - name: 'scheduleRuleManage_detail_module', | |
| 84 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | - files: [ | |
| 86 | - "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 87 | - ] | |
| 88 | - }); | |
| 89 | - }] | |
| 90 | - } | |
| 91 | - }) | |
| 92 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 排班规则模块配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("scheduleRuleManage", { // index页面 | |
| 13 | + url: '/scheduleRuleManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/index.html' | |
| 17 | + }, | |
| 18 | + "scheduleRuleManage_list@scheduleRuleManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'scheduleRuleManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 32 | + ] | |
| 33 | + }); | |
| 34 | + }] | |
| 35 | + } | |
| 36 | + }) | |
| 37 | + .state("scheduleRuleManage_form", { // 添加排班规则form | |
| 38 | + url: '/scheduleRuleManage_form', | |
| 39 | + views: { | |
| 40 | + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/form.html'} | |
| 41 | + }, | |
| 42 | + resolve: { | |
| 43 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | + return $ocLazyLoad.load({ | |
| 45 | + name: 'scheduleRuleManage_form_module', | |
| 46 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | + files: [ | |
| 48 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | + "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 51 | + ] | |
| 52 | + }); | |
| 53 | + }] | |
| 54 | + } | |
| 55 | + }) | |
| 56 | + .state("scheduleRuleManage_edit", { // 修改排班规则form | |
| 57 | + url: '/scheduleRuleManage_edit/:id', | |
| 58 | + views: { | |
| 59 | + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/edit.html'} | |
| 60 | + }, | |
| 61 | + resolve: { | |
| 62 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | + return $ocLazyLoad.load({ | |
| 64 | + name: 'scheduleRuleManage_edit_module', | |
| 65 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | + files: [ | |
| 67 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | + "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 70 | + ] | |
| 71 | + }); | |
| 72 | + }] | |
| 73 | + } | |
| 74 | + }) | |
| 75 | + .state("scheduleRuleManage_detail", { // 详细信息 | |
| 76 | + url: '/scheduleRuleManage_detail/:id', | |
| 77 | + views: { | |
| 78 | + "": {templateUrl: 'pages/scheduleApp/module/core/scheduleRuleManage/detail.html'} | |
| 79 | + }, | |
| 80 | + resolve: { | |
| 81 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | + return $ocLazyLoad.load({ | |
| 83 | + name: 'scheduleRuleManage_detail_module', | |
| 84 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | + files: [ | |
| 86 | + "pages/scheduleApp/module/core/scheduleRuleManage/module.js" | |
| 87 | + ] | |
| 88 | + }); | |
| 89 | + }] | |
| 90 | + } | |
| 91 | + }) | |
| 92 | + } | |
| 93 | 93 | ]); |
| 94 | 94 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/module.js
| 1 | -// 时刻表明晰管理service,包装外部定义的globalservice,并保存一定的操作状态 | |
| 2 | -angular.module('ScheduleApp').factory( | |
| 3 | - 'TtInfoDetailManageService', | |
| 4 | - [ | |
| 5 | - 'TimeTableDetailManageService_g', | |
| 6 | - function(service) { | |
| 7 | - // TODO: | |
| 8 | - | |
| 9 | - return { | |
| 10 | - importDetail: function(param) { | |
| 11 | - return service.import.do(param).$promise; | |
| 12 | - }, | |
| 13 | - /** | |
| 14 | - * 获取编辑用的时刻表明细数据。 | |
| 15 | - * @param ttid 时刻表id | |
| 16 | - */ | |
| 17 | - getEditInfo: function(xlid, ttid) { | |
| 18 | - var params = {xlid : xlid, ttid : ttid}; | |
| 19 | - return service.edit.list(params).$promise; | |
| 20 | - } | |
| 21 | - }; | |
| 22 | - } | |
| 23 | - ] | |
| 24 | -); | |
| 25 | - | |
| 26 | -// form.html控制器 | |
| 27 | -angular.module('ScheduleApp').controller( | |
| 28 | - 'TtInfoDetailManageFormCtrl', | |
| 29 | - [ | |
| 30 | - 'TtInfoDetailManageService', | |
| 31 | - 'FileUploader', | |
| 32 | - '$stateParams', | |
| 33 | - '$state', | |
| 34 | - function(service, FileUploader, $stateParams, $state) { | |
| 35 | - var self = this; | |
| 36 | - var xlid = $stateParams.xlid; | |
| 37 | - var ttid = $stateParams.ttid; | |
| 38 | - var xlname = $stateParams.xlname; | |
| 39 | - var ttname = $stateParams.ttname; | |
| 40 | - | |
| 41 | - self.title = xlname + '(' + ttname + ')' + '时刻表明细信息excel数据导入'; | |
| 42 | - | |
| 43 | - // 欲保存的表单信息,双向绑定 | |
| 44 | - self.ttInfoDetailManageForForm = { | |
| 45 | - xlid: xlid, // 线路id | |
| 46 | - ttid: ttid, // 时刻表id | |
| 47 | - xlname: xlname, // 线路名称 | |
| 48 | - ttname: ttname, // 时刻表名称 | |
| 49 | - filename: undefined, // 上传后的文件名 | |
| 50 | - sheetname: undefined, // sheet名字 | |
| 51 | - sheetvaliddesc: undefined, // sheet验证描述返回 | |
| 52 | - lineinfo: undefined, // 线路标准id | |
| 53 | - lineinfovaliddesc: undefined // 线路标准验证描述返回 | |
| 54 | - }; | |
| 55 | - self.sheetnames = [ | |
| 56 | - //{name: '工作表1'}, {name: '工作表2'} // sheet名字列表 | |
| 57 | - ]; | |
| 58 | - | |
| 59 | - //--------------- 上传文件功能 ---------------// | |
| 60 | - | |
| 61 | - self.clearInputFile = function() { | |
| 62 | - angular.element("input[type='file']").val(null); | |
| 63 | - }; | |
| 64 | - self.removeItem = function(item) { | |
| 65 | - item.remove(); | |
| 66 | - self.ttInfoDetailManageForForm.sheetname = undefined; | |
| 67 | - self.sheetnames = []; | |
| 68 | - }; | |
| 69 | - | |
| 70 | - // 上传文件组件 | |
| 71 | - self.uploader = new FileUploader({ | |
| 72 | - url: "/tidc/uploadFile", | |
| 73 | - filters: [], // 用于过滤文件,比如只允许导入excel, | |
| 74 | - formData: [ | |
| 75 | - { | |
| 76 | - xlmc: self.xlmc, | |
| 77 | - ttinfoname: self.ttinfoname | |
| 78 | - } | |
| 79 | - ] | |
| 80 | - }); | |
| 81 | - self.uploader.onAfterAddingFile = function(fileItem) | |
| 82 | - { | |
| 83 | - console.info('onAfterAddingFile', fileItem); | |
| 84 | - console.log(self.uploader.queue.length); | |
| 85 | - if (self.uploader.queue.length > 1) | |
| 86 | - self.uploader.removeFromQueue(0); | |
| 87 | - self.ttInfoDetailManageForForm.sheetname = undefined; | |
| 88 | - self.sheetnames = []; | |
| 89 | - }; | |
| 90 | - self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 91 | - { | |
| 92 | - self.sheetnames = response.sheetnames; | |
| 93 | - self.ttInfoDetailManageForForm.filename = response.fileName; | |
| 94 | - console.info('onSuccessItem', fileItem, response, status, headers); | |
| 95 | - }; | |
| 96 | - self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 97 | - { | |
| 98 | - alert("error"); | |
| 99 | - self.sheetnames = []; | |
| 100 | - console.info('onErrorItem', fileItem, response, status, headers); | |
| 101 | - }; | |
| 102 | - | |
| 103 | - | |
| 104 | - // form提交方法 | |
| 105 | - self.submit = function() { | |
| 106 | - service.importDetail(self.ttInfoDetailManageForForm).then( | |
| 107 | - function(result) { | |
| 108 | - $state.go("ttInfoManage"); | |
| 109 | - }, | |
| 110 | - function(result) { | |
| 111 | - alert("出错啦!"); | |
| 112 | - } | |
| 113 | - ); | |
| 114 | - }; | |
| 115 | - | |
| 116 | - | |
| 117 | - // TODO:edit操作暂时使用旧版本的js文件 | |
| 118 | - | |
| 119 | - | |
| 120 | - } | |
| 121 | - ] | |
| 1 | +// 时刻表明晰管理service,包装外部定义的globalservice,并保存一定的操作状态 | |
| 2 | +angular.module('ScheduleApp').factory( | |
| 3 | + 'TtInfoDetailManageService', | |
| 4 | + [ | |
| 5 | + 'TimeTableDetailManageService_g', | |
| 6 | + function(service) { | |
| 7 | + // TODO: | |
| 8 | + | |
| 9 | + return { | |
| 10 | + importDetail: function(param) { | |
| 11 | + return service.import.do(param).$promise; | |
| 12 | + }, | |
| 13 | + /** | |
| 14 | + * 获取编辑用的时刻表明细数据。 | |
| 15 | + * @param ttid 时刻表id | |
| 16 | + */ | |
| 17 | + getEditInfo: function(xlid, ttid) { | |
| 18 | + var params = {xlid : xlid, ttid : ttid}; | |
| 19 | + return service.edit.list(params).$promise; | |
| 20 | + } | |
| 21 | + }; | |
| 22 | + } | |
| 23 | + ] | |
| 24 | +); | |
| 25 | + | |
| 26 | +// form.html控制器 | |
| 27 | +angular.module('ScheduleApp').controller( | |
| 28 | + 'TtInfoDetailManageFormCtrl', | |
| 29 | + [ | |
| 30 | + 'TtInfoDetailManageService', | |
| 31 | + 'FileUploader', | |
| 32 | + '$stateParams', | |
| 33 | + '$state', | |
| 34 | + function(service, FileUploader, $stateParams, $state) { | |
| 35 | + var self = this; | |
| 36 | + var xlid = $stateParams.xlid; | |
| 37 | + var ttid = $stateParams.ttid; | |
| 38 | + var xlname = $stateParams.xlname; | |
| 39 | + var ttname = $stateParams.ttname; | |
| 40 | + | |
| 41 | + self.title = xlname + '(' + ttname + ')' + '时刻表明细信息excel数据导入'; | |
| 42 | + | |
| 43 | + // 欲保存的表单信息,双向绑定 | |
| 44 | + self.ttInfoDetailManageForForm = { | |
| 45 | + xlid: xlid, // 线路id | |
| 46 | + ttid: ttid, // 时刻表id | |
| 47 | + xlname: xlname, // 线路名称 | |
| 48 | + ttname: ttname, // 时刻表名称 | |
| 49 | + filename: undefined, // 上传后的文件名 | |
| 50 | + sheetname: undefined, // sheet名字 | |
| 51 | + sheetvaliddesc: undefined, // sheet验证描述返回 | |
| 52 | + lineinfo: undefined, // 线路标准id | |
| 53 | + lineinfovaliddesc: undefined // 线路标准验证描述返回 | |
| 54 | + }; | |
| 55 | + self.sheetnames = [ | |
| 56 | + //{name: '工作表1'}, {name: '工作表2'} // sheet名字列表 | |
| 57 | + ]; | |
| 58 | + | |
| 59 | + //--------------- 上传文件功能 ---------------// | |
| 60 | + | |
| 61 | + self.clearInputFile = function() { | |
| 62 | + angular.element("input[type='file']").val(null); | |
| 63 | + }; | |
| 64 | + self.removeItem = function(item) { | |
| 65 | + item.remove(); | |
| 66 | + self.ttInfoDetailManageForForm.sheetname = undefined; | |
| 67 | + self.sheetnames = []; | |
| 68 | + }; | |
| 69 | + | |
| 70 | + // 上传文件组件 | |
| 71 | + self.uploader = new FileUploader({ | |
| 72 | + url: "/tidc/uploadFile", | |
| 73 | + filters: [], // 用于过滤文件,比如只允许导入excel, | |
| 74 | + formData: [ | |
| 75 | + { | |
| 76 | + xlmc: self.xlmc, | |
| 77 | + ttinfoname: self.ttinfoname | |
| 78 | + } | |
| 79 | + ] | |
| 80 | + }); | |
| 81 | + self.uploader.onAfterAddingFile = function(fileItem) | |
| 82 | + { | |
| 83 | + console.info('onAfterAddingFile', fileItem); | |
| 84 | + console.log(self.uploader.queue.length); | |
| 85 | + if (self.uploader.queue.length > 1) | |
| 86 | + self.uploader.removeFromQueue(0); | |
| 87 | + self.ttInfoDetailManageForForm.sheetname = undefined; | |
| 88 | + self.sheetnames = []; | |
| 89 | + }; | |
| 90 | + self.uploader.onSuccessItem = function(fileItem, response, status, headers) | |
| 91 | + { | |
| 92 | + self.sheetnames = response.sheetnames; | |
| 93 | + self.ttInfoDetailManageForForm.filename = response.fileName; | |
| 94 | + console.info('onSuccessItem', fileItem, response, status, headers); | |
| 95 | + }; | |
| 96 | + self.uploader.onErrorItem = function(fileItem, response, status, headers) | |
| 97 | + { | |
| 98 | + alert("error"); | |
| 99 | + self.sheetnames = []; | |
| 100 | + console.info('onErrorItem', fileItem, response, status, headers); | |
| 101 | + }; | |
| 102 | + | |
| 103 | + | |
| 104 | + // form提交方法 | |
| 105 | + self.submit = function() { | |
| 106 | + service.importDetail(self.ttInfoDetailManageForForm).then( | |
| 107 | + function(result) { | |
| 108 | + $state.go("ttInfoManage"); | |
| 109 | + }, | |
| 110 | + function(result) { | |
| 111 | + alert("出错啦!"); | |
| 112 | + } | |
| 113 | + ); | |
| 114 | + }; | |
| 115 | + | |
| 116 | + | |
| 117 | + // TODO:edit操作暂时使用旧版本的js文件 | |
| 118 | + | |
| 119 | + | |
| 120 | + } | |
| 121 | + ] | |
| 122 | 122 | ); |
| 123 | 123 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 时刻表编辑管理配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("ttInfoDetailManage_form", { // 时刻表明细导入 | |
| 13 | - url: '/ttInfoDetailManage_form/:xlid/:ttid/:xlname/:ttname', | |
| 14 | - views: { | |
| 15 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/form.html'} | |
| 16 | - }, | |
| 17 | - resolve: { | |
| 18 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 19 | - return $ocLazyLoad.load({ | |
| 20 | - name: 'ttInfoDetailManage_form_module', | |
| 21 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 22 | - files: [ | |
| 23 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 24 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 25 | - "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 26 | - "pages/scheduleApp/module/core/ttInfoManage/detailedit/module.js" | |
| 27 | - ] | |
| 28 | - }); | |
| 29 | - }] | |
| 30 | - } | |
| 31 | - }) | |
| 32 | - .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑 | |
| 33 | - url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname', | |
| 34 | - views: { | |
| 35 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'} | |
| 36 | - }, | |
| 37 | - resolve: { | |
| 38 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 39 | - return $ocLazyLoad.load({ | |
| 40 | - name: 'ttInfoDetailManage_edit_module', | |
| 41 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 42 | - files: [ | |
| 43 | - "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 44 | - ] | |
| 45 | - }); | |
| 46 | - }] | |
| 47 | - } | |
| 48 | - }) | |
| 49 | - .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑 | |
| 50 | - url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname', | |
| 51 | - views: { | |
| 52 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'} | |
| 53 | - }, | |
| 54 | - resolve: { | |
| 55 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 56 | - return $ocLazyLoad.load({ | |
| 57 | - name: 'ttInfoDetailManage_detail_edit_module', | |
| 58 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 59 | - files: [ | |
| 60 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 61 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 62 | - "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 63 | - ] | |
| 64 | - }); | |
| 65 | - }] | |
| 66 | - } | |
| 67 | - }); | |
| 68 | - | |
| 69 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 时刻表编辑管理配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("ttInfoDetailManage_form", { // 时刻表明细导入 | |
| 13 | + url: '/ttInfoDetailManage_form/:xlid/:ttid/:xlname/:ttname', | |
| 14 | + views: { | |
| 15 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/form.html'} | |
| 16 | + }, | |
| 17 | + resolve: { | |
| 18 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 19 | + return $ocLazyLoad.load({ | |
| 20 | + name: 'ttInfoDetailManage_form_module', | |
| 21 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 22 | + files: [ | |
| 23 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 24 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 25 | + "assets/bower_components/angular-file-upload/dist/angular-file-upload.min.js", | |
| 26 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/module.js" | |
| 27 | + ] | |
| 28 | + }); | |
| 29 | + }] | |
| 30 | + } | |
| 31 | + }) | |
| 32 | + .state("ttInfoDetailManage_edit", { // 时刻表详细信息编辑 | |
| 33 | + url: '/ttInfoDetailManage_edit/:xlid/:ttid/:xlname/:ttname', | |
| 34 | + views: { | |
| 35 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit.html'} | |
| 36 | + }, | |
| 37 | + resolve: { | |
| 38 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 39 | + return $ocLazyLoad.load({ | |
| 40 | + name: 'ttInfoDetailManage_edit_module', | |
| 41 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 42 | + files: [ | |
| 43 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 44 | + ] | |
| 45 | + }); | |
| 46 | + }] | |
| 47 | + } | |
| 48 | + }) | |
| 49 | + .state("ttInfoDetailManage_detail_edit", { // 时刻表详细信息单元格编辑 | |
| 50 | + url: '/ttInfoDetailManage_detail_edit/:id/:xlid/:ttid/:xlname/:ttname', | |
| 51 | + views: { | |
| 52 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detailedit/edit-detail.html'} | |
| 53 | + }, | |
| 54 | + resolve: { | |
| 55 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 56 | + return $ocLazyLoad.load({ | |
| 57 | + name: 'ttInfoDetailManage_detail_edit_module', | |
| 58 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 59 | + files: [ | |
| 60 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 61 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 62 | + "pages/scheduleApp/module/core/ttInfoManage/detailedit/timeTableDetailManage_old.js" | |
| 63 | + ] | |
| 64 | + }); | |
| 65 | + }] | |
| 66 | + } | |
| 67 | + }); | |
| 68 | + | |
| 69 | + } | |
| 70 | 70 | ]); |
| 71 | 71 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/module.js
| 1 | -// 时刻表管理service,包装外部定义的globalservice,并保存一定的操作状态 | |
| 2 | -angular.module('ScheduleApp').factory( | |
| 3 | - 'TtInfoManageService', | |
| 4 | - [ | |
| 5 | - 'TimeTableManageService_g', | |
| 6 | - 'TimeTableDetailManageService_g', | |
| 7 | - function(service, dservice) { | |
| 8 | - // 当前查询的内容条件搜索对象 | |
| 9 | - var currentSearchCondition = {page: 0, 'isCancel_eq': false}; | |
| 10 | - // 当前查询返回的信息 | |
| 11 | - var currentPage = { // 后台spring data返回的格式 | |
| 12 | - totalElements: 0, | |
| 13 | - number: 0, // 后台返回的页码,spring返回从0开始 | |
| 14 | - content: [], | |
| 15 | - | |
| 16 | - uiNumber: 1 // 页面绑定的页码 | |
| 17 | - }; | |
| 18 | - | |
| 19 | - // 查询对象类 | |
| 20 | - var queryClass = service.rest; | |
| 21 | - | |
| 22 | - return { | |
| 23 | - getTtInfoQueryClass: function() { | |
| 24 | - return queryClass; | |
| 25 | - }, | |
| 26 | - getSearchCondition: function() { | |
| 27 | - currentSearchCondition.page = currentPage.uiNumber - 1; | |
| 28 | - return currentSearchCondition; | |
| 29 | - }, | |
| 30 | - getPage: function(page) { | |
| 31 | - if (page) { | |
| 32 | - currentPage.totalElements = page.totalElements; | |
| 33 | - currentPage.number = page.number; | |
| 34 | - currentPage.content = page.content; | |
| 35 | - } | |
| 36 | - return currentPage; | |
| 37 | - }, | |
| 38 | - resetStatus: function() { | |
| 39 | - currentSearchCondition = {page: 0, 'isCancel_eq': false}; | |
| 40 | - currentPage = { | |
| 41 | - totalElements: 0, | |
| 42 | - number: 0, | |
| 43 | - content: [], | |
| 44 | - uiNumber: 1 | |
| 45 | - }; | |
| 46 | - }, | |
| 47 | - /** | |
| 48 | - * 数据导出。 | |
| 49 | - * @returns {*|Function|promise|n} | |
| 50 | - */ | |
| 51 | - dataExport: function(ttinfoid) { | |
| 52 | - var param = {}; | |
| 53 | - param.type = 'dataExportExt'; | |
| 54 | - param.ttinfoid = ttinfoid; | |
| 55 | - return dservice.dataTools.dataExport(param).$promise; | |
| 56 | - } | |
| 57 | - | |
| 58 | - | |
| 59 | - | |
| 60 | - // TODO: | |
| 61 | - } | |
| 62 | - } | |
| 63 | - ] | |
| 64 | -); | |
| 65 | - | |
| 66 | -// index.html控制器 | |
| 67 | -angular.module('ScheduleApp').controller( | |
| 68 | - 'TtInfoManageIndexCtrl', | |
| 69 | - [ | |
| 70 | - '$state', | |
| 71 | - function($state) { | |
| 72 | - var self = this; | |
| 73 | - | |
| 74 | - // 切换到时刻表form界面 | |
| 75 | - self.toTtInfoManageForm = function() { | |
| 76 | - $state.go('ttInfoManage_form'); | |
| 77 | - } | |
| 78 | - } | |
| 79 | - ] | |
| 80 | -); | |
| 81 | - | |
| 82 | -// list.html控制器 | |
| 83 | -angular.module('ScheduleApp').controller( | |
| 84 | - 'TtInfoManageListCtrl', | |
| 85 | - [ | |
| 86 | - 'TtInfoManageService', | |
| 87 | - 'FileDownload_g', | |
| 88 | - function(service, fileDownload) { | |
| 89 | - var self = this; | |
| 90 | - var TtInfo = service.getTtInfoQueryClass(); | |
| 91 | - | |
| 92 | - self.page = function() { | |
| 93 | - return service.getPage(); | |
| 94 | - }; | |
| 95 | - | |
| 96 | - self.searchCondition = function() { | |
| 97 | - return service.getSearchCondition(); | |
| 98 | - }; | |
| 99 | - | |
| 100 | - self.doPage = function() { | |
| 101 | - var page = TtInfo.list(self.searchCondition(), function() { | |
| 102 | - service.getPage(page); | |
| 103 | - }); | |
| 104 | - }; | |
| 105 | - self.reset = function() { | |
| 106 | - service.resetStatus(); | |
| 107 | - var page = TtInfo.list(self.searchCondition(), function() { | |
| 108 | - service.getPage(page); | |
| 109 | - }); | |
| 110 | - }; | |
| 111 | - self.toggleTtinfo = function(id) { | |
| 112 | - TtInfo.delete({id: id}, function(result) { | |
| 113 | - if (result.message) { // 暂时这样做,之后全局拦截 | |
| 114 | - alert("失败:" + result.message); | |
| 115 | - } else { | |
| 116 | - self.doPage(); | |
| 117 | - } | |
| 118 | - }); | |
| 119 | - }; | |
| 120 | - // 导出excel | |
| 121 | - self.exportData = function(ttinfoid) { | |
| 122 | - service.dataExport(ttinfoid).then( | |
| 123 | - function(result) { | |
| 124 | - fileDownload.downloadFile(result.data, "application/octet-stream", "时刻表.xls"); | |
| 125 | - }, | |
| 126 | - function(result) { | |
| 127 | - console.log("exportData failed:" + result); | |
| 128 | - } | |
| 129 | - ); | |
| 130 | - }; | |
| 131 | - | |
| 132 | - self.doPage(); | |
| 133 | - | |
| 134 | - // 自动生成时刻表 | |
| 135 | - self.toTtInfoDetailAuto = function() { | |
| 136 | - showPjax(); | |
| 137 | - $.pjax({url: 'pages/base/timesmodel/index.html', container: pjaxContainer}); | |
| 138 | - }; | |
| 139 | - | |
| 140 | - // TODO: | |
| 141 | - } | |
| 142 | - ] | |
| 143 | -); | |
| 144 | - | |
| 145 | -// form.html控制器 | |
| 146 | -angular.module('ScheduleApp').controller( | |
| 147 | - 'TtInfoManageFormCtrl', | |
| 148 | - [ | |
| 149 | - 'TtInfoManageService', | |
| 150 | - '$stateParams', | |
| 151 | - '$state', | |
| 152 | - function(service, $stateParams, $state) { | |
| 153 | - var self = this; | |
| 154 | - var TtInfo = service.getTtInfoQueryClass(); | |
| 155 | - | |
| 156 | - // 启用日期 日期控件开关 | |
| 157 | - self.qyrqOpen = false; | |
| 158 | - self.qyrq_open = function() { | |
| 159 | - self.qyrqOpen = true; | |
| 160 | - }; | |
| 161 | - | |
| 162 | - // 欲保存的表单信息,双向绑定 | |
| 163 | - self.ttInfoManageForForm = new TtInfo; | |
| 164 | - self.ttInfoManageForForm.xl = {}; | |
| 165 | - | |
| 166 | - // 如果是修改,获取传过来的id,从后台获取一份数据,用于绑定页面form值 | |
| 167 | - var id = $stateParams.id; | |
| 168 | - if (id) { | |
| 169 | - TtInfo.get({id: id}, function(value) { | |
| 170 | - self.ttInfoManageForForm = value; | |
| 171 | - }); | |
| 172 | - } | |
| 173 | - // form提交方法 | |
| 174 | - self.submit = function() { | |
| 175 | - self.ttInfoManageForForm.$save(function() { | |
| 176 | - $state.go("ttInfoManage"); | |
| 177 | - }); | |
| 178 | - }; | |
| 179 | - } | |
| 180 | - ] | |
| 181 | -); | |
| 182 | - | |
| 183 | -// detail.html控制器 | |
| 184 | -angular.module('ScheduleApp').controller( | |
| 185 | - 'TtInfoManageDetailCtrl', | |
| 186 | - [ | |
| 187 | - 'TtInfoManageService', | |
| 188 | - '$stateParams', | |
| 189 | - function(service, $stateParams) { | |
| 190 | - var self = this; | |
| 191 | - var TtInfo = service.getTtInfoQueryClass(); | |
| 192 | - var id = $stateParams.id; | |
| 193 | - | |
| 194 | - self.title = ""; | |
| 195 | - self.ttInfoManageForDetail = {}; | |
| 196 | - | |
| 197 | - TtInfo.get({id: id}, function(value) { | |
| 198 | - self.ttInfoManageForDetail = value; | |
| 199 | - self.title = self.ttInfoManageForDetail.xl.name + | |
| 200 | - "(" + | |
| 201 | - self.ttInfoManageForDetail.name + | |
| 202 | - ")" + | |
| 203 | - "时刻表基础信息"; | |
| 204 | - }); | |
| 205 | - } | |
| 206 | - ] | |
| 1 | +// 时刻表管理service,包装外部定义的globalservice,并保存一定的操作状态 | |
| 2 | +angular.module('ScheduleApp').factory( | |
| 3 | + 'TtInfoManageService', | |
| 4 | + [ | |
| 5 | + 'TimeTableManageService_g', | |
| 6 | + 'TimeTableDetailManageService_g', | |
| 7 | + function(service, dservice) { | |
| 8 | + // 当前查询的内容条件搜索对象 | |
| 9 | + var currentSearchCondition = {page: 0, 'isCancel_eq': false}; | |
| 10 | + // 当前查询返回的信息 | |
| 11 | + var currentPage = { // 后台spring data返回的格式 | |
| 12 | + totalElements: 0, | |
| 13 | + number: 0, // 后台返回的页码,spring返回从0开始 | |
| 14 | + content: [], | |
| 15 | + | |
| 16 | + uiNumber: 1 // 页面绑定的页码 | |
| 17 | + }; | |
| 18 | + | |
| 19 | + // 查询对象类 | |
| 20 | + var queryClass = service.rest; | |
| 21 | + | |
| 22 | + return { | |
| 23 | + getTtInfoQueryClass: function() { | |
| 24 | + return queryClass; | |
| 25 | + }, | |
| 26 | + getSearchCondition: function() { | |
| 27 | + currentSearchCondition.page = currentPage.uiNumber - 1; | |
| 28 | + return currentSearchCondition; | |
| 29 | + }, | |
| 30 | + getPage: function(page) { | |
| 31 | + if (page) { | |
| 32 | + currentPage.totalElements = page.totalElements; | |
| 33 | + currentPage.number = page.number; | |
| 34 | + currentPage.content = page.content; | |
| 35 | + } | |
| 36 | + return currentPage; | |
| 37 | + }, | |
| 38 | + resetStatus: function() { | |
| 39 | + currentSearchCondition = {page: 0, 'isCancel_eq': false}; | |
| 40 | + currentPage = { | |
| 41 | + totalElements: 0, | |
| 42 | + number: 0, | |
| 43 | + content: [], | |
| 44 | + uiNumber: 1 | |
| 45 | + }; | |
| 46 | + }, | |
| 47 | + /** | |
| 48 | + * 数据导出。 | |
| 49 | + * @returns {*|Function|promise|n} | |
| 50 | + */ | |
| 51 | + dataExport: function(ttinfoid) { | |
| 52 | + var param = {}; | |
| 53 | + param.type = 'dataExportExt'; | |
| 54 | + param.ttinfoid = ttinfoid; | |
| 55 | + return dservice.dataTools.dataExport(param).$promise; | |
| 56 | + } | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + // TODO: | |
| 61 | + } | |
| 62 | + } | |
| 63 | + ] | |
| 64 | +); | |
| 65 | + | |
| 66 | +// index.html控制器 | |
| 67 | +angular.module('ScheduleApp').controller( | |
| 68 | + 'TtInfoManageIndexCtrl', | |
| 69 | + [ | |
| 70 | + '$state', | |
| 71 | + function($state) { | |
| 72 | + var self = this; | |
| 73 | + | |
| 74 | + // 切换到时刻表form界面 | |
| 75 | + self.toTtInfoManageForm = function() { | |
| 76 | + $state.go('ttInfoManage_form'); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + ] | |
| 80 | +); | |
| 81 | + | |
| 82 | +// list.html控制器 | |
| 83 | +angular.module('ScheduleApp').controller( | |
| 84 | + 'TtInfoManageListCtrl', | |
| 85 | + [ | |
| 86 | + 'TtInfoManageService', | |
| 87 | + 'FileDownload_g', | |
| 88 | + function(service, fileDownload) { | |
| 89 | + var self = this; | |
| 90 | + var TtInfo = service.getTtInfoQueryClass(); | |
| 91 | + | |
| 92 | + self.page = function() { | |
| 93 | + return service.getPage(); | |
| 94 | + }; | |
| 95 | + | |
| 96 | + self.searchCondition = function() { | |
| 97 | + return service.getSearchCondition(); | |
| 98 | + }; | |
| 99 | + | |
| 100 | + self.doPage = function() { | |
| 101 | + var page = TtInfo.list(self.searchCondition(), function() { | |
| 102 | + service.getPage(page); | |
| 103 | + }); | |
| 104 | + }; | |
| 105 | + self.reset = function() { | |
| 106 | + service.resetStatus(); | |
| 107 | + var page = TtInfo.list(self.searchCondition(), function() { | |
| 108 | + service.getPage(page); | |
| 109 | + }); | |
| 110 | + }; | |
| 111 | + self.toggleTtinfo = function(id) { | |
| 112 | + TtInfo.delete({id: id}, function(result) { | |
| 113 | + if (result.message) { // 暂时这样做,之后全局拦截 | |
| 114 | + alert("失败:" + result.message); | |
| 115 | + } else { | |
| 116 | + self.doPage(); | |
| 117 | + } | |
| 118 | + }); | |
| 119 | + }; | |
| 120 | + // 导出excel | |
| 121 | + self.exportData = function(ttinfoid) { | |
| 122 | + service.dataExport(ttinfoid).then( | |
| 123 | + function(result) { | |
| 124 | + fileDownload.downloadFile(result.data, "application/octet-stream", "时刻表.xls"); | |
| 125 | + }, | |
| 126 | + function(result) { | |
| 127 | + console.log("exportData failed:" + result); | |
| 128 | + } | |
| 129 | + ); | |
| 130 | + }; | |
| 131 | + | |
| 132 | + self.doPage(); | |
| 133 | + | |
| 134 | + // 自动生成时刻表 | |
| 135 | + self.toTtInfoDetailAuto = function() { | |
| 136 | + showPjax(); | |
| 137 | + $.pjax({url: 'pages/base/timesmodel/index.html', container: pjaxContainer}); | |
| 138 | + }; | |
| 139 | + | |
| 140 | + // TODO: | |
| 141 | + } | |
| 142 | + ] | |
| 143 | +); | |
| 144 | + | |
| 145 | +// form.html控制器 | |
| 146 | +angular.module('ScheduleApp').controller( | |
| 147 | + 'TtInfoManageFormCtrl', | |
| 148 | + [ | |
| 149 | + 'TtInfoManageService', | |
| 150 | + '$stateParams', | |
| 151 | + '$state', | |
| 152 | + function(service, $stateParams, $state) { | |
| 153 | + var self = this; | |
| 154 | + var TtInfo = service.getTtInfoQueryClass(); | |
| 155 | + | |
| 156 | + // 启用日期 日期控件开关 | |
| 157 | + self.qyrqOpen = false; | |
| 158 | + self.qyrq_open = function() { | |
| 159 | + self.qyrqOpen = true; | |
| 160 | + }; | |
| 161 | + | |
| 162 | + // 欲保存的表单信息,双向绑定 | |
| 163 | + self.ttInfoManageForForm = new TtInfo; | |
| 164 | + self.ttInfoManageForForm.xl = {}; | |
| 165 | + | |
| 166 | + // 如果是修改,获取传过来的id,从后台获取一份数据,用于绑定页面form值 | |
| 167 | + var id = $stateParams.id; | |
| 168 | + if (id) { | |
| 169 | + TtInfo.get({id: id}, function(value) { | |
| 170 | + self.ttInfoManageForForm = value; | |
| 171 | + }); | |
| 172 | + } | |
| 173 | + // form提交方法 | |
| 174 | + self.submit = function() { | |
| 175 | + self.ttInfoManageForForm.$save(function() { | |
| 176 | + $state.go("ttInfoManage"); | |
| 177 | + }); | |
| 178 | + }; | |
| 179 | + } | |
| 180 | + ] | |
| 181 | +); | |
| 182 | + | |
| 183 | +// detail.html控制器 | |
| 184 | +angular.module('ScheduleApp').controller( | |
| 185 | + 'TtInfoManageDetailCtrl', | |
| 186 | + [ | |
| 187 | + 'TtInfoManageService', | |
| 188 | + '$stateParams', | |
| 189 | + function(service, $stateParams) { | |
| 190 | + var self = this; | |
| 191 | + var TtInfo = service.getTtInfoQueryClass(); | |
| 192 | + var id = $stateParams.id; | |
| 193 | + | |
| 194 | + self.title = ""; | |
| 195 | + self.ttInfoManageForDetail = {}; | |
| 196 | + | |
| 197 | + TtInfo.get({id: id}, function(value) { | |
| 198 | + self.ttInfoManageForDetail = value; | |
| 199 | + self.title = self.ttInfoManageForDetail.xl.name + | |
| 200 | + "(" + | |
| 201 | + self.ttInfoManageForDetail.name + | |
| 202 | + ")" + | |
| 203 | + "时刻表基础信息"; | |
| 204 | + }); | |
| 205 | + } | |
| 206 | + ] | |
| 207 | 207 | ); |
| 208 | 208 | \ No newline at end of file | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/route.js
| 1 | -// ui route 配置 | |
| 2 | - | |
| 3 | -/** 时刻表管理配置route */ | |
| 4 | -ScheduleApp.config([ | |
| 5 | - '$stateProvider', | |
| 6 | - '$urlRouterProvider', | |
| 7 | - function($stateProvider, $urlRouterProvider) { | |
| 8 | - // 默认路由 | |
| 9 | - //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | - | |
| 11 | - $stateProvider | |
| 12 | - .state("ttInfoManage", { // index页面 | |
| 13 | - url: '/ttInfoManage', | |
| 14 | - views: { | |
| 15 | - "": { | |
| 16 | - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html' | |
| 17 | - }, | |
| 18 | - "ttInfoManage_list@ttInfoManage": { | |
| 19 | - templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html' | |
| 20 | - } | |
| 21 | - }, | |
| 22 | - | |
| 23 | - resolve: { | |
| 24 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | - return $ocLazyLoad.load({ | |
| 26 | - name: 'ttInfoManage_module', | |
| 27 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | - files: [ | |
| 29 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | - "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 32 | - ] | |
| 33 | - }); | |
| 34 | - }] | |
| 35 | - } | |
| 36 | - }) | |
| 37 | - .state("ttInfoManage_form", { // 添加时刻表信息form | |
| 38 | - url: '/ttInfoManage_form', | |
| 39 | - views: { | |
| 40 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'} | |
| 41 | - }, | |
| 42 | - resolve: { | |
| 43 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | - return $ocLazyLoad.load({ | |
| 45 | - name: 'ttInfoManage_form_module', | |
| 46 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | - files: [ | |
| 48 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | - "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 51 | - ] | |
| 52 | - }); | |
| 53 | - }] | |
| 54 | - } | |
| 55 | - }) | |
| 56 | - .state("ttInfoManage_edit", { // 修改时刻表信息form | |
| 57 | - url: '/ttInfoManage_edit/:id', | |
| 58 | - views: { | |
| 59 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'} | |
| 60 | - }, | |
| 61 | - resolve: { | |
| 62 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | - return $ocLazyLoad.load({ | |
| 64 | - name: 'ttInfoManage_edit_module', | |
| 65 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | - files: [ | |
| 67 | - "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | - "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | - "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 70 | - ] | |
| 71 | - }); | |
| 72 | - }] | |
| 73 | - } | |
| 74 | - }) | |
| 75 | - .state("ttInfoManage_detail", { // 时刻表详细信息 | |
| 76 | - url: '/ttInfoManage_detail/:id', | |
| 77 | - views: { | |
| 78 | - "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'} | |
| 79 | - }, | |
| 80 | - resolve: { | |
| 81 | - deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | - return $ocLazyLoad.load({ | |
| 83 | - name: 'ttInfoManage_detail_module', | |
| 84 | - insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | - files: [ | |
| 86 | - "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 87 | - ] | |
| 88 | - }); | |
| 89 | - }] | |
| 90 | - } | |
| 91 | - }); | |
| 92 | - | |
| 93 | - | |
| 94 | - } | |
| 1 | +// ui route 配置 | |
| 2 | + | |
| 3 | +/** 时刻表管理配置route */ | |
| 4 | +ScheduleApp.config([ | |
| 5 | + '$stateProvider', | |
| 6 | + '$urlRouterProvider', | |
| 7 | + function($stateProvider, $urlRouterProvider) { | |
| 8 | + // 默认路由 | |
| 9 | + //$urlRouterProvider.otherwise('/busConfig.html'); | |
| 10 | + | |
| 11 | + $stateProvider | |
| 12 | + .state("ttInfoManage", { // index页面 | |
| 13 | + url: '/ttInfoManage', | |
| 14 | + views: { | |
| 15 | + "": { | |
| 16 | + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/index.html' | |
| 17 | + }, | |
| 18 | + "ttInfoManage_list@ttInfoManage": { | |
| 19 | + templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/list.html' | |
| 20 | + } | |
| 21 | + }, | |
| 22 | + | |
| 23 | + resolve: { | |
| 24 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 25 | + return $ocLazyLoad.load({ | |
| 26 | + name: 'ttInfoManage_module', | |
| 27 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 28 | + files: [ | |
| 29 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 30 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 31 | + "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 32 | + ] | |
| 33 | + }); | |
| 34 | + }] | |
| 35 | + } | |
| 36 | + }) | |
| 37 | + .state("ttInfoManage_form", { // 添加时刻表信息form | |
| 38 | + url: '/ttInfoManage_form', | |
| 39 | + views: { | |
| 40 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/form.html'} | |
| 41 | + }, | |
| 42 | + resolve: { | |
| 43 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 44 | + return $ocLazyLoad.load({ | |
| 45 | + name: 'ttInfoManage_form_module', | |
| 46 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 47 | + files: [ | |
| 48 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 49 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 50 | + "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 51 | + ] | |
| 52 | + }); | |
| 53 | + }] | |
| 54 | + } | |
| 55 | + }) | |
| 56 | + .state("ttInfoManage_edit", { // 修改时刻表信息form | |
| 57 | + url: '/ttInfoManage_edit/:id', | |
| 58 | + views: { | |
| 59 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/edit.html'} | |
| 60 | + }, | |
| 61 | + resolve: { | |
| 62 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 63 | + return $ocLazyLoad.load({ | |
| 64 | + name: 'ttInfoManage_edit_module', | |
| 65 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 66 | + files: [ | |
| 67 | + "assets/bower_components/angular-ui-select/dist/select.min.css", | |
| 68 | + "assets/bower_components/angular-ui-select/dist/select.min.js", | |
| 69 | + "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 70 | + ] | |
| 71 | + }); | |
| 72 | + }] | |
| 73 | + } | |
| 74 | + }) | |
| 75 | + .state("ttInfoManage_detail", { // 时刻表详细信息 | |
| 76 | + url: '/ttInfoManage_detail/:id', | |
| 77 | + views: { | |
| 78 | + "": {templateUrl: 'pages/scheduleApp/module/core/ttInfoManage/detail.html'} | |
| 79 | + }, | |
| 80 | + resolve: { | |
| 81 | + deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
| 82 | + return $ocLazyLoad.load({ | |
| 83 | + name: 'ttInfoManage_detail_module', | |
| 84 | + insertBefore: '#ng_load_plugins_before', // 动态载入模块时放置的位置 | |
| 85 | + files: [ | |
| 86 | + "pages/scheduleApp/module/core/ttInfoManage/module.js" | |
| 87 | + ] | |
| 88 | + }); | |
| 89 | + }] | |
| 90 | + } | |
| 91 | + }); | |
| 92 | + | |
| 93 | + | |
| 94 | + } | |
| 95 | 95 | ]); |
| 96 | 96 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/mapmonitor/js/spatial_data.js
| ... | ... | @@ -81,20 +81,20 @@ var gb_map_spatial_data = (function () { |
| 81 | 81 | gb_map_overlay_mge._focus_station(node.data); |
| 82 | 82 | }) |
| 83 | 83 | .jstree({ |
| 84 | - 'core': { | |
| 85 | - 'data': get_st_route_tree_data() | |
| 86 | - }, | |
| 87 | - 'checkbox': { | |
| 88 | - 'keep_selected_style': false, | |
| 89 | - 'whole_node': false, | |
| 90 | - 'tie_selection': false | |
| 91 | - }, | |
| 92 | - //local storage里的key | |
| 93 | - 'state': { | |
| 94 | - 'key': 'jstree_map_station_route' | |
| 95 | - }, | |
| 96 | - 'plugins': ['checkbox', 'state'] | |
| 97 | - }); | |
| 84 | + 'core': { | |
| 85 | + 'data': get_st_route_tree_data() | |
| 86 | + }, | |
| 87 | + 'checkbox': { | |
| 88 | + 'keep_selected_style': false, | |
| 89 | + 'whole_node': false, | |
| 90 | + 'tie_selection': false | |
| 91 | + }, | |
| 92 | + //local storage里的key | |
| 93 | + 'state': { | |
| 94 | + 'key': 'jstree_map_station_route' | |
| 95 | + }, | |
| 96 | + 'plugins': ['checkbox', 'state'] | |
| 97 | + }); | |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | //停车场 |
| ... | ... | @@ -109,20 +109,20 @@ var gb_map_spatial_data = (function () { |
| 109 | 109 | gb_map_overlay_mge._focus_carpark(node.data); |
| 110 | 110 | }) |
| 111 | 111 | .jstree({ |
| 112 | - 'core': { | |
| 113 | - 'data': get_st_carpark_tree_data() | |
| 114 | - }, | |
| 115 | - 'checkbox': { | |
| 116 | - 'keep_selected_style': false, | |
| 117 | - 'whole_node': false, | |
| 118 | - 'tie_selection': false | |
| 119 | - }, | |
| 120 | - //local storage里的key | |
| 121 | - 'state': { | |
| 122 | - 'key': 'jstree_map_carpark' | |
| 123 | - }, | |
| 124 | - 'plugins': ['checkbox', 'state'] | |
| 125 | - }); | |
| 112 | + 'core': { | |
| 113 | + 'data': get_st_carpark_tree_data() | |
| 114 | + }, | |
| 115 | + 'checkbox': { | |
| 116 | + 'keep_selected_style': false, | |
| 117 | + 'whole_node': false, | |
| 118 | + 'tie_selection': false | |
| 119 | + }, | |
| 120 | + //local storage里的key | |
| 121 | + 'state': { | |
| 122 | + 'key': 'jstree_map_carpark' | |
| 123 | + }, | |
| 124 | + 'plugins': ['checkbox', 'state'] | |
| 125 | + }); | |
| 126 | 126 | |
| 127 | 127 | refresh(); |
| 128 | 128 | }); |
| ... | ... | @@ -262,7 +262,7 @@ var gb_map_spatial_data = (function () { |
| 262 | 262 | }); |
| 263 | 263 | return list; |
| 264 | 264 | } |
| 265 | - | |
| 265 | + | |
| 266 | 266 | function gteCheckedCarpark() { |
| 267 | 267 | var list = []; |
| 268 | 268 | var chs = $('.carpark-panel', cont).jstree(true).get_checked(true); | ... | ... |