Commit 1af3434357cf877afc2d1d6b8519030dd23384df
Merge branch 'minhang' into pudong
Showing
50 changed files
with
2231 additions
and
610 deletions
src/main/java/com/bsth/controller/oil/DlbController.java
| @@ -2,6 +2,7 @@ package com.bsth.controller.oil; | @@ -2,6 +2,7 @@ package com.bsth.controller.oil; | ||
| 2 | 2 | ||
| 3 | import java.text.SimpleDateFormat; | 3 | import java.text.SimpleDateFormat; |
| 4 | import java.util.ArrayList; | 4 | import java.util.ArrayList; |
| 5 | +import java.util.Date; | ||
| 5 | import java.util.HashMap; | 6 | import java.util.HashMap; |
| 6 | import java.util.Iterator; | 7 | import java.util.Iterator; |
| 7 | import java.util.List; | 8 | import java.util.List; |
| @@ -194,4 +195,30 @@ public class DlbController extends BaseController<Dlb, Integer>{ | @@ -194,4 +195,30 @@ public class DlbController extends BaseController<Dlb, Integer>{ | ||
| 194 | 195 | ||
| 195 | } | 196 | } |
| 196 | 197 | ||
| 198 | + | ||
| 199 | + @RequestMapping(value = "/checkJsy",method = RequestMethod.GET) | ||
| 200 | + public String checkJsy(@RequestParam Map<String, Object> map){ | ||
| 201 | + String list=service.checkJsy(map); | ||
| 202 | + return list; | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + @RequestMapping(value = "/deleteIds", method = RequestMethod.POST) | ||
| 206 | + public Map<String, Object> deleteIds(@RequestParam Map<String, Object> map) { | ||
| 207 | + Map<String, Object> maps=new HashMap<String, Object>(); | ||
| 208 | + try { | ||
| 209 | + maps= service.deleteIds(map); | ||
| 210 | + } catch (Exception e) { | ||
| 211 | + // TODO Auto-generated catch block | ||
| 212 | + e.printStackTrace(); | ||
| 213 | + } | ||
| 214 | + return maps; | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + @RequestMapping(value = "/saveDlb",method = RequestMethod.POST) | ||
| 218 | + public Map<String, Object> saveDlb(Dlb t){ | ||
| 219 | +// SysUser user = SecurityUtils.getCurrentUser(); | ||
| 220 | + t.setCreatetime(new Date()); | ||
| 221 | +// Ylb t=new Ylb(); | ||
| 222 | + return service.saveDlb(t); | ||
| 223 | + } | ||
| 197 | } | 224 | } |
src/main/java/com/bsth/controller/oil/YlbController.java
| @@ -209,8 +209,8 @@ public class YlbController extends BaseController<Ylb, Integer>{ | @@ -209,8 +209,8 @@ public class YlbController extends BaseController<Ylb, Integer>{ | ||
| 209 | return maps; | 209 | return maps; |
| 210 | } | 210 | } |
| 211 | @RequestMapping(value="/oilListMonth") | 211 | @RequestMapping(value="/oilListMonth") |
| 212 | - public List<Ylb> oilListMonth(@RequestParam String line,@RequestParam String date,@RequestParam String type){ | ||
| 213 | - return yblService.oilListMonth(line, date, type); | 212 | + public List<Ylb> oilListMonth(@RequestParam Map<String, Object> map){ |
| 213 | + return yblService.oilListMonth(map); | ||
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | @RequestMapping(value = "/checkJsy",method = RequestMethod.GET) | 216 | @RequestMapping(value = "/checkJsy",method = RequestMethod.GET) |
src/main/java/com/bsth/controller/realcontrol/FrequentPhrasesController.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol; | ||
| 2 | + | ||
| 3 | +import com.bsth.controller.BaseController; | ||
| 4 | +import com.bsth.entity.realcontrol.FrequentPhrases; | ||
| 5 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 6 | +import org.springframework.web.bind.annotation.RestController; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * Created by panzhao on 2017/9/17. | ||
| 10 | + */ | ||
| 11 | +@RestController | ||
| 12 | +@RequestMapping("frequent_phrases") | ||
| 13 | +public class FrequentPhrasesController extends BaseController<FrequentPhrases, Integer>{ | ||
| 14 | + | ||
| 15 | +} |
src/main/java/com/bsth/entity/realcontrol/FrequentPhrases.java
0 → 100644
| 1 | +package com.bsth.entity.realcontrol; | ||
| 2 | + | ||
| 3 | +import javax.persistence.Entity; | ||
| 4 | +import javax.persistence.GeneratedValue; | ||
| 5 | +import javax.persistence.Id; | ||
| 6 | +import javax.persistence.Table; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 常用短语 | ||
| 10 | + * Created by panzhao on 2017/9/17. | ||
| 11 | + */ | ||
| 12 | +@Entity | ||
| 13 | +@Table(name = "bsth_c_s_frequent_phrases") | ||
| 14 | +public class FrequentPhrases { | ||
| 15 | + | ||
| 16 | + @Id | ||
| 17 | + @GeneratedValue | ||
| 18 | + private Integer id; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 用户名 | ||
| 22 | + */ | ||
| 23 | + private String userName; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 短语 | ||
| 27 | + */ | ||
| 28 | + private String text; | ||
| 29 | + | ||
| 30 | + public Integer getId() { | ||
| 31 | + return id; | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + public void setId(Integer id) { | ||
| 35 | + this.id = id; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + public String getUserName() { | ||
| 39 | + return userName; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + public void setUserName(String userName) { | ||
| 43 | + this.userName = userName; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + public String getText() { | ||
| 47 | + return text; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public void setText(String text) { | ||
| 51 | + this.text = text; | ||
| 52 | + } | ||
| 53 | +} |
src/main/java/com/bsth/repository/realcontrol/FrequentPhrasesRepository.java
0 → 100644
| 1 | +package com.bsth.repository.realcontrol; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.realcontrol.FrequentPhrases; | ||
| 4 | +import com.bsth.repository.BaseRepository; | ||
| 5 | +import org.springframework.stereotype.Repository; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Created by panzhao on 2017/9/17. | ||
| 9 | + */ | ||
| 10 | +@Repository | ||
| 11 | +public interface FrequentPhrasesRepository extends BaseRepository<FrequentPhrases, Integer> { | ||
| 12 | +} |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -994,7 +994,7 @@ public class GpsServiceImpl implements GpsService { | @@ -994,7 +994,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 994 | fv = f.get(obj).toString(); | 994 | fv = f.get(obj).toString(); |
| 995 | v = map.get(f.getName()).toString(); | 995 | v = map.get(f.getName()).toString(); |
| 996 | 996 | ||
| 997 | - if(!fv.startsWith(v) && !fv.endsWith(v)) | 997 | + if(!fv.startsWith(v)/* && !fv.endsWith(v)*/) |
| 998 | return false; | 998 | return false; |
| 999 | } | 999 | } |
| 1000 | } catch (Exception e) { | 1000 | } catch (Exception e) { |
src/main/java/com/bsth/service/oil/DlbService.java
| @@ -20,4 +20,12 @@ public interface DlbService extends BaseService<Dlb, Integer>{ | @@ -20,4 +20,12 @@ public interface DlbService extends BaseService<Dlb, Integer>{ | ||
| 20 | Map<String, Object> saveDlbList(Map<String, Object> map) throws Exception; | 20 | Map<String, Object> saveDlbList(Map<String, Object> map) throws Exception; |
| 21 | 21 | ||
| 22 | String obtainDsq() throws Exception; | 22 | String obtainDsq() throws Exception; |
| 23 | + | ||
| 24 | + String checkJsy(Map<String, Object> map); | ||
| 25 | + | ||
| 26 | + Map<String, Object> saveDlb(Dlb t); | ||
| 27 | + | ||
| 28 | + Map<String, Object> deleteIds(Map<String, Object> map) throws Exception; | ||
| 29 | + | ||
| 30 | + | ||
| 23 | } | 31 | } |
src/main/java/com/bsth/service/oil/YlbService.java
| @@ -19,7 +19,7 @@ public interface YlbService extends BaseService<Ylb, Integer>{ | @@ -19,7 +19,7 @@ public interface YlbService extends BaseService<Ylb, Integer>{ | ||
| 19 | 19 | ||
| 20 | Map<String, Object> sumYlb(Map<String, Object> map); | 20 | Map<String, Object> sumYlb(Map<String, Object> map); |
| 21 | String checkJsy(Map<String, Object> map); | 21 | String checkJsy(Map<String, Object> map); |
| 22 | - List<Ylb> oilListMonth(String line,String date,String type); | 22 | + List<Ylb> oilListMonth(Map<String, Object> map); |
| 23 | List<Ylb> listYlb(Map<String, Object> map); | 23 | List<Ylb> listYlb(Map<String, Object> map); |
| 24 | StringBuffer checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int lx); | 24 | StringBuffer checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int lx); |
| 25 | 25 |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| @@ -1032,6 +1032,87 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -1032,6 +1032,87 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 1032 | 1032 | ||
| 1033 | return lists; | 1033 | return lists; |
| 1034 | } | 1034 | } |
| 1035 | + | ||
| 1036 | + | ||
| 1037 | + @Override | ||
| 1038 | + public String checkJsy(Map<String, Object> map) { | ||
| 1039 | + // TODO Auto-generated method stub | ||
| 1040 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1041 | + String rq=map.get("date").toString(); | ||
| 1042 | + String nbbm=map.get("nbbm").toString(); | ||
| 1043 | + String jsy =map.get("jsy").toString(); | ||
| 1044 | + String xlbm=map.get("xlbm").toString(); | ||
| 1045 | + List<Dlb> list= repository.queryListDlb(rq, nbbm, jsy, xlbm); | ||
| 1046 | + String type="1"; | ||
| 1047 | + if(list.size()>0){ | ||
| 1048 | + type="0"; | ||
| 1049 | + } | ||
| 1050 | + return type; | ||
| 1051 | + } | ||
| 1052 | + | ||
| 1053 | + @Override | ||
| 1054 | + public Map<String, Object> saveDlb(Dlb t) { | ||
| 1055 | + // TODO Auto-generated method stub | ||
| 1056 | + Map<String, Object> map = new HashMap<>(); | ||
| 1057 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1058 | + String rq=sdf.format(t.getRq()); | ||
| 1059 | + String gsdm=t.getSsgsdm(); | ||
| 1060 | + String fgsdm=t.getFgsdm(); | ||
| 1061 | + String xlbm=t.getXlbm(); | ||
| 1062 | + String jhsj=t.getJhsj(); | ||
| 1063 | + String jsy=t.getJsy(); | ||
| 1064 | + String nbbm=t.getNbbm(); | ||
| 1065 | + int sfkt=t.getSfkt(); | ||
| 1066 | + t.setCreatetime(new Date()); | ||
| 1067 | + String[] jhsjStr = jhsj.split(":"); | ||
| 1068 | + long fcsjL= Long.parseLong(jhsjStr[0])*60+Long.parseLong(jhsjStr[1]); | ||
| 1069 | + List<Dlb> list=this.listOrderBy(rq, gsdm, fgsdm, xlbm, nbbm, "jhsj"); | ||
| 1070 | +// repository.obtainYl(rq, gsdm, fgsdm, xlbm, nbbm, "jhsj"); | ||
| 1071 | + int jcsx=1; | ||
| 1072 | + if(list.size()>0){ | ||
| 1073 | + for (int i = 0; i < list.size(); i++) { | ||
| 1074 | + Dlb y=list.get(i); | ||
| 1075 | + String[] fcsjStr = y.getJhsj().split(":"); | ||
| 1076 | + long fcsj=Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 1077 | + if(fcsjL>fcsj){ | ||
| 1078 | + jcsx=jcsx+y.getJcsx(); | ||
| 1079 | + }else{ | ||
| 1080 | + y.setJcsx(y.getJcsx()+1); | ||
| 1081 | + repository.save(y); | ||
| 1082 | + } | ||
| 1083 | + } | ||
| 1084 | + | ||
| 1085 | + } | ||
| 1086 | + t.setJcsx(jcsx); | ||
| 1087 | + repository.save(t); | ||
| 1088 | + map.put("status", ResponseCode.SUCCESS); | ||
| 1089 | + map.put("t", t); | ||
| 1090 | + return map; | ||
| 1091 | + } | ||
| 1092 | + | ||
| 1093 | + @Transactional | ||
| 1094 | + @Override | ||
| 1095 | + public Map<String, Object> deleteIds(Map<String, Object> map) throws Exception{ | ||
| 1096 | + // TODO Auto-generated method stub | ||
| 1097 | + Map<String, Object> maps = new HashMap<>(); | ||
| 1098 | + try{ | ||
| 1099 | + String json =StringEscapeUtils.unescapeHtml4(map.get("ids").toString()); | ||
| 1100 | + JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 1101 | + JSONObject jsonObject; | ||
| 1102 | + for (int x = 0; x < jsonArray.size(); x++) { | ||
| 1103 | + jsonObject=jsonArray.getJSONObject(x); | ||
| 1104 | + Integer id =jsonObject.getInteger("id"); | ||
| 1105 | + repository.delete(id); | ||
| 1106 | + } | ||
| 1107 | + maps.put("status", ResponseCode.SUCCESS); | ||
| 1108 | + } catch (Exception e) { | ||
| 1109 | + maps.put("status", ResponseCode.ERROR); | ||
| 1110 | + logger.error("save erro.", e); | ||
| 1111 | + throw e; | ||
| 1112 | + } | ||
| 1113 | + return maps; | ||
| 1114 | + } | ||
| 1115 | + | ||
| 1035 | } | 1116 | } |
| 1036 | 1117 | ||
| 1037 | class NbbmJcsxMap implements Comparator<Map<String, Object>>{ | 1118 | class NbbmJcsxMap implements Comparator<Map<String, Object>>{ |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -977,17 +977,24 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -977,17 +977,24 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 977 | 977 | ||
| 978 | 978 | ||
| 979 | @Override | 979 | @Override |
| 980 | - public List<Ylb> oilListMonth(String line, String date, String type) { | 980 | + public List<Ylb> oilListMonth(Map<String, Object> map) { |
| 981 | + String type=map.get("type").toString(); | ||
| 982 | + String date=map.get("date").toString().trim(); | ||
| 983 | + String gsdm=map.get("gsdm").toString(); | ||
| 984 | + String fgsdm=map.get("fgsdm").toString(); | ||
| 981 | String date2=date.substring(0, 8)+"01"; | 985 | String date2=date.substring(0, 8)+"01"; |
| 982 | String lineStr=""; | 986 | String lineStr=""; |
| 987 | + String line =map.get("line").toString().trim(); | ||
| 983 | if(line !=null && !line.equals("")){ | 988 | if(line !=null && !line.equals("")){ |
| 984 | lineStr =" and xlbm= '"+ line +"'"; | 989 | lineStr =" and xlbm= '"+ line +"'"; |
| 990 | + }else{ | ||
| 991 | + lineStr =" and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"' "; | ||
| 985 | } | 992 | } |
| 986 | String sql="select a.nbbm,a.rq,a.jzyl from (" + | 993 | String sql="select a.nbbm,a.rq,a.jzyl from (" + |
| 987 | " select x.nbbm,max(x.rq) as rq,max(x.jcsx) as jcsx from " | 994 | " select x.nbbm,max(x.rq) as rq,max(x.jcsx) as jcsx from " |
| 988 | + "(select nbbm,rq,max(jcsx) as jcsx from bsth_c_ylb where rq between '" | 995 | + "(select nbbm,rq,max(jcsx) as jcsx from bsth_c_ylb where rq between '" |
| 989 | + date2 +"' and '" + date+"' "+lineStr | 996 | + date2 +"' and '" + date+"' "+lineStr |
| 990 | - + "group by nbbm,rq) x group by x.nbbm ) b" | 997 | + + " group by nbbm,rq) x group by x.nbbm ) b" |
| 991 | + " left join (select nbbm,rq,jzyl,jcsx FROM bsth_c_ylb " | 998 | + " left join (select nbbm,rq,jzyl,jcsx FROM bsth_c_ylb " |
| 992 | + " where rq between '" | 999 | + " where rq between '" |
| 993 | + date2 +"' and '" + date+"' "+lineStr | 1000 | + date2 +"' and '" + date+"' "+lineStr |
src/main/java/com/bsth/service/realcontrol/FrequentPhrasesService.java
0 → 100644
src/main/java/com/bsth/service/realcontrol/impl/FrequentPhrasesServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.realcontrol.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.realcontrol.FrequentPhrases; | ||
| 4 | +import com.bsth.security.util.SecurityUtils; | ||
| 5 | +import com.bsth.service.impl.BaseServiceImpl; | ||
| 6 | +import com.bsth.service.realcontrol.FrequentPhrasesService; | ||
| 7 | +import org.springframework.stereotype.Service; | ||
| 8 | + | ||
| 9 | +import java.util.Map; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * Created by panzhao on 2017/9/17. | ||
| 13 | + */ | ||
| 14 | +@Service | ||
| 15 | +public class FrequentPhrasesServiceImpl extends BaseServiceImpl<FrequentPhrases, Integer> implements FrequentPhrasesService { | ||
| 16 | + | ||
| 17 | + @Override | ||
| 18 | + public Map<String, Object> save(FrequentPhrases fp) { | ||
| 19 | + fp.setUserName(SecurityUtils.getCurrentUser().getUserName()); | ||
| 20 | + return super.save(fp); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + public Iterable<FrequentPhrases> list(Map<String, Object> map) { | ||
| 25 | + map.put("userName_eq", SecurityUtils.getCurrentUser().getUserName()); | ||
| 26 | + return super.list(map); | ||
| 27 | + } | ||
| 28 | +} |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -226,6 +226,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -226,6 +226,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 226 | 226 | ||
| 227 | ScheduleRealInfo schedule = dayOfSchedule.get(id); | 227 | ScheduleRealInfo schedule = dayOfSchedule.get(id); |
| 228 | 228 | ||
| 229 | + if(schedule.getStatus() > 0){ | ||
| 230 | + map.put("status", ResponseCode.SUCCESS); | ||
| 231 | + map.put("flag", "4008"); | ||
| 232 | + map.put("t", schedule); | ||
| 233 | + return map; | ||
| 234 | + } | ||
| 235 | + | ||
| 229 | LineConfig config = lineConfigData.get(schedule.getXlBm()); | 236 | LineConfig config = lineConfigData.get(schedule.getXlBm()); |
| 230 | //小于线路开始运营时间,则默认跨过24点 | 237 | //小于线路开始运营时间,则默认跨过24点 |
| 231 | if (dfsj.compareTo(config.getStartOpt()) < 0) { | 238 | if (dfsj.compareTo(config.getStartOpt()) < 0) { |
| @@ -2775,25 +2782,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2775,25 +2782,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2775 | } | 2782 | } |
| 2776 | for (int i = 0; i < newList.size(); i++) { | 2783 | for (int i = 0; i < newList.size(); i++) { |
| 2777 | ScheduleRealInfo t1 = newList.get(i); | 2784 | ScheduleRealInfo t1 = newList.get(i); |
| 2778 | - String reamrks1=t1.getRemarks()==null?"":t1.getRemarks(); | ||
| 2779 | - if(reamrks1.length()>5){ | ||
| 2780 | - t1.setRemarks(reamrks1.substring(0, 5)); | ||
| 2781 | - t1.setRemark(reamrks1); | ||
| 2782 | - } | ||
| 2783 | for (int j = 0; j < list.size(); j++) { | 2785 | for (int j = 0; j < list.size(); j++) { |
| 2784 | ScheduleRealInfo t2 = list.get(j); | 2786 | ScheduleRealInfo t2 = list.get(j); |
| 2785 | - String reamrks2=t2.getRemarks()==null?"":t2.getRemarks(); | ||
| 2786 | - if(reamrks2.length()>5){ | ||
| 2787 | - t2.setRemarks(reamrks2.substring(0, 5)); | ||
| 2788 | - t2.setRemark(reamrks2); | ||
| 2789 | - }else{ | ||
| 2790 | - t2.setRemark(reamrks2); | ||
| 2791 | - } | ||
| 2792 | if (t1.getId() == t2.getId()) { | 2787 | if (t1.getId() == t2.getId()) { |
| 2793 | t1 = t2; | 2788 | t1 = t2; |
| 2794 | } | 2789 | } |
| 2795 | } | 2790 | } |
| 2796 | } | 2791 | } |
| 2792 | + | ||
| 2793 | + for (int i = 0; i < newList.size(); i++) { | ||
| 2794 | + ScheduleRealInfo t1=newList.get(i); | ||
| 2795 | + String reamrks1=t1.getRemarks()==null?"":t1.getRemarks(); | ||
| 2796 | + if(reamrks1.length()>4){ | ||
| 2797 | + t1.setRemarks(reamrks1.substring(0,4)); | ||
| 2798 | + t1.setRemark(reamrks1); | ||
| 2799 | + }else{ | ||
| 2800 | + t1.setRemark(reamrks1); | ||
| 2801 | + } | ||
| 2802 | + } | ||
| 2797 | return newList; | 2803 | return newList; |
| 2798 | } | 2804 | } |
| 2799 | 2805 | ||
| @@ -2973,28 +2979,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2973,28 +2979,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2973 | yesterdayDataList.get(x).put("totalKilometers", zlc); | 2979 | yesterdayDataList.get(x).put("totalKilometers", zlc); |
| 2974 | 2980 | ||
| 2975 | } | 2981 | } |
| 2976 | - List<Map<String, Object>> yesterdayDataLists = new ArrayList<Map<String, Object>>(); | 2982 | + /* List<Map<String, Object>> yesterdayDataLists = new ArrayList<Map<String, Object>>(); |
| 2977 | 2983 | ||
| 2978 | for (int i = 0; i < yesterdayDataList.size(); i++) { | 2984 | for (int i = 0; i < yesterdayDataList.size(); i++) { |
| 2979 | Map<String, Object> map=yesterdayDataList.get(i); | 2985 | Map<String, Object> map=yesterdayDataList.get(i); |
| 2980 | Double zlc=map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString()); | 2986 | Double zlc=map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString()); |
| 2981 | - if(zlc>0){ | 2987 | +// if(zlc>0){ |
| 2982 | yesterdayDataLists.add(map); | 2988 | yesterdayDataLists.add(map); |
| 2983 | - } | ||
| 2984 | - } | 2989 | +// } |
| 2990 | + }*/ | ||
| 2985 | //增加顺序号 | 2991 | //增加顺序号 |
| 2986 | - for (int i = 0; i < yesterdayDataLists.size(); i++) { | 2992 | + for (int i = 0; i < yesterdayDataList.size(); i++) { |
| 2987 | if (i == 0) { | 2993 | if (i == 0) { |
| 2988 | - yesterdayDataLists.get(i).put("seqNumber", 1); | 2994 | + yesterdayDataList.get(i).put("seqNumber", 1); |
| 2989 | } else { | 2995 | } else { |
| 2990 | - if (yesterdayDataLists.get(i - 1).get("clZbh").equals(yesterdayDataLists.get(i).get("clZbh"))) { | ||
| 2991 | - yesterdayDataLists.get(i).put("seqNumber", 1 + (int) yesterdayDataLists.get(i - 1).get("seqNumber")); | 2996 | + if (yesterdayDataList.get(i - 1).get("clZbh").equals(yesterdayDataList.get(i).get("clZbh"))) { |
| 2997 | + yesterdayDataList.get(i).put("seqNumber", 1 + (int) yesterdayDataList.get(i - 1).get("seqNumber")); | ||
| 2992 | } else { | 2998 | } else { |
| 2993 | - yesterdayDataLists.get(i).put("seqNumber", 1); | 2999 | + yesterdayDataList.get(i).put("seqNumber", 1); |
| 2994 | } | 3000 | } |
| 2995 | } | 3001 | } |
| 2996 | } | 3002 | } |
| 2997 | - return yesterdayDataLists; | 3003 | + return yesterdayDataList; |
| 2998 | } | 3004 | } |
| 2999 | 3005 | ||
| 3000 | /** | 3006 | /** |
src/main/java/com/bsth/service/traffic/impl/YgcBasicDataServiceImpl.java
| @@ -81,6 +81,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ | @@ -81,6 +81,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ | ||
| 81 | flag = "success"; | 81 | flag = "success"; |
| 82 | }catch (Exception e){ | 82 | }catch (Exception e){ |
| 83 | e.printStackTrace(); | 83 | e.printStackTrace(); |
| 84 | + logger.error("updateYgcBasicData:",e); | ||
| 84 | } | 85 | } |
| 85 | finally { | 86 | finally { |
| 86 | // 删除文件 | 87 | // 删除文件 |
src/main/resources/fatso/handle_real_ctl.js
| @@ -11,32 +11,34 @@ var fs = require('fs') | @@ -11,32 +11,34 @@ var fs = require('fs') | ||
| 11 | 11 | ||
| 12 | var platform = process.platform; | 12 | var platform = process.platform; |
| 13 | var iswin = platform=='win32'; | 13 | var iswin = platform=='win32'; |
| 14 | -var separator = platform=='win32'?'\\':'/'; | 14 | +var sp = platform=='win32'?'\\':'/'; |
| 15 | //不参与的目录 | 15 | //不参与的目录 |
| 16 | var pName = 'bsth_control' | 16 | var pName = 'bsth_control' |
| 17 | , path = process.cwd() | 17 | , path = process.cwd() |
| 18 | //根目录 | 18 | //根目录 |
| 19 | - , root = path.substr(0, path.indexOf(separator + 'src'+separator+'main')) | ||
| 20 | - , workspace = root.substr(0, root.lastIndexOf(separator + pName)) | 19 | + , root = path.substr(0, path.indexOf(sp + 'src'+sp+'main')) |
| 20 | + , workspace = root.substr(0, root.lastIndexOf(sp + pName)) | ||
| 21 | //临时目录 | 21 | //临时目录 |
| 22 | - , dest = (workspace + separator + pName + '@fatso_copy')//.replace(/\//g, '\\') | ||
| 23 | - , _static = separator + 'src'+separator+'main'+separator+'resources'+separator+'static'; | 22 | + , dest = (workspace + sp + pName + '@fatso_copy')//.replace(/\//g, '\\') |
| 23 | + , _static = sp + 'src'+sp+'main'+sp+'resources'+sp+'static'; | ||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | -var mainFile = dest + _static + separator + 'real_control_v2'+separator+'main.html'; | ||
| 27 | -var mapFile = dest + _static + separator + 'real_control_v2'+separator+'mapmonitor'+separator+'real.html'; | 26 | +var mainFile = dest + _static + sp + 'real_control_v2'+sp+'main.html'; |
| 27 | +var aloneMapWrapFile = dest + _static + sp + 'real_control_v2'+sp+'alone_page'+sp+'map'+sp+'alone_wrap.html'; | ||
| 28 | +var mapFile = dest + _static + sp + 'real_control_v2'+sp+'mapmonitor'+sp+'real.html'; | ||
| 28 | var realCtl = { | 29 | var realCtl = { |
| 29 | /** | 30 | /** |
| 30 | * 处理线调首页 | 31 | * 处理线调首页 |
| 31 | */ | 32 | */ |
| 32 | handleMain: function (cb) { | 33 | handleMain: function (cb) { |
| 33 | - //读取文件 | ||
| 34 | - var data = fs.readFileSync(mainFile, 'utf-8') | ||
| 35 | - , $ = cheerio.load(data); | ||
| 36 | - | 34 | + //处理main.html |
| 35 | + var data = fs.readFileSync(mainFile, 'utf-8'), | ||
| 36 | + $ = cheerio.load(data); | ||
| 37 | handleCss($, function () { | 37 | handleCss($, function () { |
| 38 | handleJs($, mainFile, cb); | 38 | handleJs($, mainFile, cb); |
| 39 | }); | 39 | }); |
| 40 | + | ||
| 41 | + | ||
| 40 | }, | 42 | }, |
| 41 | /** | 43 | /** |
| 42 | * 处理地图模块 | 44 | * 处理地图模块 |
| @@ -50,6 +52,17 @@ var realCtl = { | @@ -50,6 +52,17 @@ var realCtl = { | ||
| 50 | handleCss($, function () { | 52 | handleCss($, function () { |
| 51 | handleJs($, mapFile, cb); | 53 | handleJs($, mapFile, cb); |
| 52 | }); | 54 | }); |
| 55 | + }, | ||
| 56 | + /** | ||
| 57 | + * 处理单屏地图页面 | ||
| 58 | + * @param cb | ||
| 59 | + */ | ||
| 60 | + handleAlonePage: function (cb) { | ||
| 61 | + var data = fs.readFileSync(aloneMapWrapFile, 'utf-8'); | ||
| 62 | + var $ = cheerio.load(data); | ||
| 63 | + handleCss($, function () { | ||
| 64 | + handleJs($, aloneMapWrapFile, cb); | ||
| 65 | + }); | ||
| 53 | } | 66 | } |
| 54 | }; | 67 | }; |
| 55 | 68 | ||
| @@ -84,7 +97,7 @@ var handleCss = function ($, cb) { | @@ -84,7 +97,7 @@ var handleCss = function ($, cb) { | ||
| 84 | var data = out.styles; | 97 | var data = out.styles; |
| 85 | var fName = (k + '_' + md5(data)) + '.css'; | 98 | var fName = (k + '_' + md5(data)) + '.css'; |
| 86 | //写入 assets css 目录下 | 99 | //写入 assets css 目录下 |
| 87 | - var descFile = dest + _static + separator + 'real_control_v2'+separator+'assets'+separator+'css' + separator + fName; | 100 | + var descFile = dest + _static + sp + 'real_control_v2'+sp+'assets'+sp+'css' + sp + fName; |
| 88 | fs.open(descFile, 'a', function (err, fd) { | 101 | fs.open(descFile, 'a', function (err, fd) { |
| 89 | 102 | ||
| 90 | fs.write(fd, data, function () { | 103 | fs.write(fd, data, function () { |
| @@ -138,7 +151,7 @@ var handleJs = function ($, file, cb) { | @@ -138,7 +151,7 @@ var handleJs = function ($, file, cb) { | ||
| 138 | var data = result.code; | 151 | var data = result.code; |
| 139 | var fName = (k + '_' + md5(data)) + '.js'; | 152 | var fName = (k + '_' + md5(data)) + '.js'; |
| 140 | //写入 assets js 目录下 | 153 | //写入 assets js 目录下 |
| 141 | - var descFile = dest + _static + separator + 'real_control_v2'+separator+'assets'+separator+'js' + separator + fName; | 154 | + var descFile = dest + _static + sp + 'real_control_v2'+sp+'assets'+sp+'js' + sp + fName; |
| 142 | fs.open(descFile, 'a', function (err, fd) { | 155 | fs.open(descFile, 'a', function (err, fd) { |
| 143 | 156 | ||
| 144 | fs.write(fd, data, function () { | 157 | fs.write(fd, data, function () { |
src/main/resources/fatso/parse.js
| @@ -64,7 +64,7 @@ function write(file, text){ | @@ -64,7 +64,7 @@ function write(file, text){ | ||
| 64 | console.log(err.toString().red); | 64 | console.log(err.toString().red); |
| 65 | process.exit(); | 65 | process.exit(); |
| 66 | } | 66 | } |
| 67 | - console.log(file.green); | 67 | + //console.log(file.green); |
| 68 | }); | 68 | }); |
| 69 | } | 69 | } |
| 70 | 70 |
src/main/resources/fatso/start.js
| @@ -14,19 +14,19 @@ var fs = require('fs') | @@ -14,19 +14,19 @@ var fs = require('fs') | ||
| 14 | 14 | ||
| 15 | var platform = process.platform; | 15 | var platform = process.platform; |
| 16 | var iswin = platform=='win32'; | 16 | var iswin = platform=='win32'; |
| 17 | -var separator = platform=='win32'?'\\':'/'; | 17 | +var sp = platform=='win32'?'\\':'/'; |
| 18 | //不参与的目录 | 18 | //不参与的目录 |
| 19 | -var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission'+separator+'authorize_all', 'summary'] | 19 | +var excludes = ['scheduleApp', 'trafficManage', 'control', 'permission'+sp+'authorize_all', 'summary', 'report'+sp+'oil'] |
| 20 | ,ep = new EventProxy() | 20 | ,ep = new EventProxy() |
| 21 | ,pName = 'bsth_control' | 21 | ,pName = 'bsth_control' |
| 22 | ,path = process.cwd() | 22 | ,path = process.cwd() |
| 23 | //根目录 | 23 | //根目录 |
| 24 | - ,root = path.substr(0, path.indexOf(separator + 'src'+separator+'main')) | ||
| 25 | - ,workspace = root.substr(0, root.lastIndexOf(separator + pName)) | 24 | + ,root = path.substr(0, path.indexOf(sp + 'src'+sp+'main')) |
| 25 | + ,workspace = root.substr(0, root.lastIndexOf(sp + pName)) | ||
| 26 | //临时目录 | 26 | //临时目录 |
| 27 | - ,dest = (workspace + separator + pName+'@fatso_copy') | ||
| 28 | - ,_static = separator + 'src'+separator+'main'+separator+'resources'+separator+'static' | ||
| 29 | - ,_pages = dest + _static + separator + 'pages'; | 27 | + ,dest = (workspace + sp + pName+'@fatso_copy') |
| 28 | + ,_static = sp + 'src'+sp+'main'+sp+'resources'+sp+'static' | ||
| 29 | + ,_pages = dest + _static + sp + 'pages'; | ||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | //创建临时目录 | 32 | //创建临时目录 |
| @@ -45,7 +45,7 @@ ep.tail('mvn-clean',function(){ | @@ -45,7 +45,7 @@ ep.tail('mvn-clean',function(){ | ||
| 45 | //ep.emit('copy-project'); | 45 | //ep.emit('copy-project'); |
| 46 | //清理target | 46 | //清理target |
| 47 | logInfo('mvn clean...'); | 47 | logInfo('mvn clean...'); |
| 48 | - cProcess = child_process.exec("mvn clean",{cwd: workspace + separator + pName},function(error){ | 48 | + cProcess = child_process.exec("mvn clean",{cwd: workspace + sp + pName},function(error){ |
| 49 | if(error) | 49 | if(error) |
| 50 | logError(error); | 50 | logError(error); |
| 51 | 51 | ||
| @@ -88,7 +88,7 @@ ep.tail('minifier-js', function(){ | @@ -88,7 +88,7 @@ ep.tail('minifier-js', function(){ | ||
| 88 | //再处理首页 | 88 | //再处理首页 |
| 89 | ep.emit('handle-index', function(){ | 89 | ep.emit('handle-index', function(){ |
| 90 | //递归处理片段 | 90 | //递归处理片段 |
| 91 | - walk(dest + _static + separator + 'pages', function(item){ | 91 | + walk(dest + _static + sp + 'pages', function(item){ |
| 92 | ep.emit('handle-fragment', item); | 92 | ep.emit('handle-fragment', item); |
| 93 | }, | 93 | }, |
| 94 | function(){ | 94 | function(){ |
| @@ -96,7 +96,10 @@ ep.tail('minifier-js', function(){ | @@ -96,7 +96,10 @@ ep.tail('minifier-js', function(){ | ||
| 96 | handle_real_ctl.handleMain(function () { | 96 | handle_real_ctl.handleMain(function () { |
| 97 | //处理线调地图 | 97 | //处理线调地图 |
| 98 | handle_real_ctl.handleMap(function () { | 98 | handle_real_ctl.handleMap(function () { |
| 99 | - ep.emit('package-jar'); | 99 | + //处理单屏页面 |
| 100 | + handle_real_ctl.handleAlonePage(function () { | ||
| 101 | + ep.emit('package-jar'); | ||
| 102 | + }); | ||
| 100 | }); | 103 | }); |
| 101 | }); | 104 | }); |
| 102 | }); | 105 | }); |
| @@ -112,7 +115,7 @@ ep.tail('package-jar', function(file){ | @@ -112,7 +115,7 @@ ep.tail('package-jar', function(file){ | ||
| 112 | 115 | ||
| 113 | logSuccess('mvn package success'); | 116 | logSuccess('mvn package success'); |
| 114 | 117 | ||
| 115 | - console.log(('成功打包在 ' + dest + separator + 'target 目录下').cyan); | 118 | + console.log(('成功打包在 ' + dest + sp + 'target 目录下').cyan); |
| 116 | }); | 119 | }); |
| 117 | 120 | ||
| 118 | output(cProcess); | 121 | output(cProcess); |
| @@ -122,7 +125,7 @@ ep.tail('package-jar', function(file){ | @@ -122,7 +125,7 @@ ep.tail('package-jar', function(file){ | ||
| 122 | ep.tail('handle-fragment', function(file){ | 125 | ep.tail('handle-fragment', function(file){ |
| 123 | //要排除的文件 | 126 | //要排除的文件 |
| 124 | for(var i = 0, ex; ex = excludes[i++];){ | 127 | for(var i = 0, ex; ex = excludes[i++];){ |
| 125 | - if(file.indexOf(_pages + separator + ex) != -1) | 128 | + if(file.indexOf(_pages + sp + ex) != -1) |
| 126 | return false; | 129 | return false; |
| 127 | } | 130 | } |
| 128 | handleJavascript(file, function(mini, $){ | 131 | handleJavascript(file, function(mini, $){ |
| @@ -139,12 +142,12 @@ ep.tail('handle-fragment', function(file){ | @@ -139,12 +142,12 @@ ep.tail('handle-fragment', function(file){ | ||
| 139 | 142 | ||
| 140 | //处理首页 | 143 | //处理首页 |
| 141 | ep.tail('handle-index', function(cb){ | 144 | ep.tail('handle-index', function(cb){ |
| 142 | - var index = dest + _static + separator + 'index.html'; | 145 | + var index = dest + _static + sp + 'index.html'; |
| 143 | handleJavascript(index, function(mini, $){ | 146 | handleJavascript(index, function(mini, $){ |
| 144 | var jsMiniText = mini.inside + mini.outside; | 147 | var jsMiniText = mini.inside + mini.outside; |
| 145 | 148 | ||
| 146 | var code = md5(jsMiniText); | 149 | var code = md5(jsMiniText); |
| 147 | - fs.open( dest + _static + separator + 'assets'+separator+'js' + separator + code + '.js', 'a', function(err, fd){ | 150 | + fs.open( dest + _static + sp + 'assets'+sp+'js' + sp + code + '.js', 'a', function(err, fd){ |
| 148 | if(err) | 151 | if(err) |
| 149 | logError(err); | 152 | logError(err); |
| 150 | 153 | ||
| @@ -204,7 +207,7 @@ function write(file, text){ | @@ -204,7 +207,7 @@ function write(file, text){ | ||
| 204 | console.log(err.toString().red); | 207 | console.log(err.toString().red); |
| 205 | process.exit(); | 208 | process.exit(); |
| 206 | } | 209 | } |
| 207 | - console.log(file.green); | 210 | + //console.log(file.green); |
| 208 | }); | 211 | }); |
| 209 | } | 212 | } |
| 210 | 213 | ||
| @@ -219,7 +222,7 @@ function walk(path ,handleFile, over) { | @@ -219,7 +222,7 @@ function walk(path ,handleFile, over) { | ||
| 219 | console.log('read dir error'.red); | 222 | console.log('read dir error'.red); |
| 220 | } else { | 223 | } else { |
| 221 | files.forEach(function(item) { | 224 | files.forEach(function(item) { |
| 222 | - var tmpPath = path + separator + item; | 225 | + var tmpPath = path + sp + item; |
| 223 | fs.stat(tmpPath, function(err1, stats) { | 226 | fs.stat(tmpPath, function(err1, stats) { |
| 224 | if (err1) { | 227 | if (err1) { |
| 225 | console.log('stat error'); | 228 | console.log('stat error'); |
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
| @@ -796,8 +796,8 @@ var BaseFun = function() { | @@ -796,8 +796,8 @@ var BaseFun = function() { | ||
| 796 | var allLMapBc = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap); | 796 | var allLMapBc = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap); |
| 797 | //return {'json':allLMapBc,'bxrcgs':null}; | 797 | //return {'json':allLMapBc,'bxrcgs':null}; |
| 798 | 798 | ||
| 799 | - // 第二步 纵向调整 | ||
| 800 | - baseF.evenStartDepartSpace(allLMapBc , dataMap); | 799 | + // 第二步 纵向调整 |
| 800 | + baseF.evenStartDepartSpace(allLMapBc , dataMap); | ||
| 801 | //return {'json':allLMapBc,'bxrcgs':null}; | 801 | //return {'json':allLMapBc,'bxrcgs':null}; |
| 802 | 802 | ||
| 803 | // 第三步 剔除首末班车以外的班次,并确认首末班车. | 803 | // 第三步 剔除首末班车以外的班次,并确认首末班车. |
| @@ -817,12 +817,12 @@ var BaseFun = function() { | @@ -817,12 +817,12 @@ var BaseFun = function() { | ||
| 817 | var list = baseF.getBxRcListCollection(map.bxrc); | 817 | var list = baseF.getBxRcListCollection(map.bxrc); |
| 818 | // 把班型分配到对应的具体路牌上. | 818 | // 把班型分配到对应的具体路牌上. |
| 819 | baseF.bxAlloTotLp(list,cara); | 819 | baseF.bxAlloTotLp(list,cara); |
| 820 | - //return {'json':markArray,'bxrcgs':null}; | ||
| 821 | - | ||
| 822 | - | 820 | + ////return {'json':markArray,'bxrcgs':null}; |
| 821 | + // | ||
| 822 | + // | ||
| 823 | // 第六步 抽车来满足工时. | 823 | // 第六步 抽车来满足工时. |
| 824 | var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map); | 824 | var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map); |
| 825 | - // return {'json':tempA,'bxrcgs':null}; | 825 | + //return {'json':tempA,'bxrcgs':null}; |
| 826 | // 第七步 确定吃饭时间. | 826 | // 第七步 确定吃饭时间. |
| 827 | if (map.cfdd) { // NEW,没有选择吃饭地点,不设定吃饭班次 | 827 | if (map.cfdd) { // NEW,没有选择吃饭地点,不设定吃饭班次 |
| 828 | baseF.markeEatTime(list , tempA , cara , saa , dataMap ,map); | 828 | baseF.markeEatTime(list , tempA , cara , saa , dataMap ,map); |
| @@ -1323,6 +1323,10 @@ var BaseFun = function() { | @@ -1323,6 +1323,10 @@ var BaseFun = function() { | ||
| 1323 | sslpbcA.sort(function(a,b){return a.fcint-b.fcint}); | 1323 | sslpbcA.sort(function(a,b){return a.fcint-b.fcint}); |
| 1324 | // 按照规则修改停站时间. | 1324 | // 按照规则修改停站时间. |
| 1325 | for(var r = 0 ; r < sslpbcA.length-1 ; r++) { | 1325 | for(var r = 0 ; r < sslpbcA.length-1 ; r++) { |
| 1326 | + // test | ||
| 1327 | + //if(sslpbcA[r].bcType == 'cf') { | ||
| 1328 | + // alert('cf' + sslpbcA[r-1].fcsj); | ||
| 1329 | + //} | ||
| 1326 | // 定义上一个班次的发车时间、当前班次的到达时间、发车时间. | 1330 | // 定义上一个班次的发车时间、当前班次的到达时间、发车时间. |
| 1327 | var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj), | 1331 | var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj), |
| 1328 | dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME), | 1332 | dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME), |
| @@ -1332,7 +1336,7 @@ var BaseFun = function() { | @@ -1332,7 +1336,7 @@ var BaseFun = function() { | ||
| 1332 | // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.) | 1336 | // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.) |
| 1333 | var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000); | 1337 | var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000); |
| 1334 | // 定义是否高峰 | 1338 | // 定义是否高峰 |
| 1335 | - var flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap); | 1339 | + var tt_flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap); |
| 1336 | // 获取行驶时间. | 1340 | // 获取行驶时间. |
| 1337 | var xxsj = baseF.getByDirTravelTime(dataMap.zgfsjd , dataMap.wgfsjd , dqbcfcsj, | 1341 | var xxsj = baseF.getByDirTravelTime(dataMap.zgfsjd , dataMap.wgfsjd , dqbcfcsj, |
| 1338 | dataMap.pcxssjArr , dataMap.gfxxsjArr , | 1342 | dataMap.pcxssjArr , dataMap.gfxxsjArr , |
| @@ -1340,16 +1344,28 @@ var BaseFun = function() { | @@ -1340,16 +1344,28 @@ var BaseFun = function() { | ||
| 1340 | normmintzsj = xxsj*0.1; | 1344 | normmintzsj = xxsj*0.1; |
| 1341 | normmaxtzsj = xxsj*0.15; | 1345 | normmaxtzsj = xxsj*0.15; |
| 1342 | var flag = false; | 1346 | var flag = false; |
| 1347 | + | ||
| 1343 | // 如果小于零 | 1348 | // 如果小于零 |
| 1344 | if(dxmin < 0 && sslpbcA[r].isfb ==0) { | 1349 | if(dxmin < 0 && sslpbcA[r].isfb ==0) { |
| 1345 | // 根据不同时段的停站时间.重新赋值停站时间. | 1350 | // 根据不同时段的停站时间.重新赋值停站时间. |
| 1346 | if(sslpbcA[r].bcType=='normal' && sslpbcA[r+1].bcType =='normal') | 1351 | if(sslpbcA[r].bcType=='normal' && sslpbcA[r+1].bcType =='normal') |
| 1347 | - dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag]; | 1352 | + //dxmin = tt_flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag]; |
| 1353 | + dxmin = 1; | ||
| 1348 | else | 1354 | else |
| 1349 | dxmin = 0; | 1355 | dxmin = 0; |
| 1350 | flag = true; | 1356 | flag = true; |
| 1351 | }else if(dxmin==0){ | 1357 | }else if(dxmin==0){ |
| 1352 | - dxmin = 0; | 1358 | + if (sslpbcA[r].bcType == 'cf') { // 如果是吃饭班次,停站为0 |
| 1359 | + dxmin = 0; | ||
| 1360 | + } else { | ||
| 1361 | + // 这里区分,如果下一个班次是吃饭班次,停站为0 | ||
| 1362 | + if (sslpbcA[r + 1].bcType=='cf') { | ||
| 1363 | + dxmin = 0; | ||
| 1364 | + } else { // 否则使用最小停站时间 | ||
| 1365 | + dxmin = normmintzsj; | ||
| 1366 | + } | ||
| 1367 | + } | ||
| 1368 | + | ||
| 1353 | flag = true; | 1369 | flag = true; |
| 1354 | }else { | 1370 | }else { |
| 1355 | // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间. | 1371 | // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间. |
src/main/resources/static/pages/electricity/list/add.html
0 → 100644
| 1 | +<div class="page-head"> | ||
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>进出站电量量信息编辑</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | ||
| 9 | + <li><span class="active">用电管理</span> <i class="fa fa-circle"></i></li> | ||
| 10 | + <li><a href="list.html" data-pjax>进出场电量</a> <i class="fa fa-circle"></i></li> | ||
| 11 | + <li><span class="active">进出站电量信息编辑</span></li> | ||
| 12 | +</ul> | ||
| 13 | + | ||
| 14 | +<div class="portlet light bordered"> | ||
| 15 | + <div class="portlet-title"> | ||
| 16 | + <div class="caption"> | ||
| 17 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 18 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 19 | + </div> | ||
| 20 | + </div> | ||
| 21 | + <div class="portlet-body form"> | ||
| 22 | + <form action="/addYlb" class="form-horizontal" id="ylb_add_form" > | ||
| 23 | + | ||
| 24 | + <div class="alert alert-danger display-hide"> | ||
| 25 | + <button class="close" data-close="alert"></button> | ||
| 26 | + 您的输入有误,请检查下面的输入项 | ||
| 27 | + </div> | ||
| 28 | + <input type="hidden" value="0" name="yhlx" /> | ||
| 29 | + <div class="form-body"> | ||
| 30 | + <div class="form-group"> | ||
| 31 | + <label class="col-md-3 control-label">公司</label> | ||
| 32 | + <div class="col-md-4"> | ||
| 33 | + <select class="form-control" name="ssgsdm" id="ssgsdm" ></select> | ||
| 34 | + </div> | ||
| 35 | + </div> | ||
| 36 | + <div class="form-group"> | ||
| 37 | + <label class="col-md-3 control-label">分公司</label> | ||
| 38 | + <div class="col-md-4"> | ||
| 39 | + <select class="form-control" name="fgsdm" id="fgsdm" ></select> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + <div class="form-group"> | ||
| 43 | + <label class="col-md-3 control-label">线路</label> | ||
| 44 | + <div class="col-md-4"> | ||
| 45 | + <select class="form-control" name="xlbm" id="xlbm" ></select> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + <div class="form-group"> | ||
| 49 | + <label class="col-md-3 control-label">内部编码</label> | ||
| 50 | + <div class="col-md-4"> | ||
| 51 | + <select class="form-control" name="nbbm" id="nbbm" ></select> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + <div class="form-group"> | ||
| 55 | + <label class="col-md-3 control-label">日期</label> | ||
| 56 | + <div class="col-md-4"> | ||
| 57 | + <input type="text" class="form-control" name="rq" id="date"> | ||
| 58 | + <label>跨天营运</label> | ||
| 59 | + <select id="sfkt" name="sfkt"> | ||
| 60 | + <option value="0">否</option> | ||
| 61 | + <option value="1">是</option> | ||
| 62 | + </select> | ||
| 63 | + </div> | ||
| 64 | + </div> | ||
| 65 | + <div class="form-group"> | ||
| 66 | + <label class="col-md-3 control-label">开始营运时间</label> | ||
| 67 | + <div class="col-md-4"> | ||
| 68 | + <input type="time" class="form-control" name="jhsj" > | ||
| 69 | + <span class="help-block"> 如:12:12</span> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + <div class="form-group"> | ||
| 73 | + <label class="col-md-3 control-label">驾驶员</label> | ||
| 74 | + <div class="col-md-4"> | ||
| 75 | + <select class="form-control" name="jsy" id="jsy"> </select> | ||
| 76 | + </div> | ||
| 77 | + </div> | ||
| 78 | + | ||
| 79 | + <div class="form-group"> | ||
| 80 | + <label class="col-md-3 control-label">出场里程</label> | ||
| 81 | + <div class="col-md-4"> | ||
| 82 | + <input type="text" value="0" class="form-control" name="czlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 83 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + | ||
| 87 | + <div class="form-group"> | ||
| 88 | + <label class="col-md-3 control-label">出场电量%</label> | ||
| 89 | + <div class="col-md-4"> | ||
| 90 | + <input type="text" value="100" class="form-control" name="czcd" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 91 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 92 | + </div> | ||
| 93 | + </div> | ||
| 94 | + | ||
| 95 | + <div class="form-group"> | ||
| 96 | + <label class="col-md-3 control-label">充电量</label> | ||
| 97 | + <div class="col-md-4"> | ||
| 98 | + <input type="text" value="0" class="form-control" name="cdl" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 99 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 100 | + </div> | ||
| 101 | + </div> | ||
| 102 | + | ||
| 103 | + <div class="form-group"> | ||
| 104 | + <label class="col-md-3 control-label">进场电量%</label> | ||
| 105 | + <div class="col-md-4"> | ||
| 106 | + <input type="text" value="100" class="form-control" name="jzcd" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 107 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 108 | + </div> | ||
| 109 | + </div> | ||
| 110 | + | ||
| 111 | + <div class="form-group"> | ||
| 112 | + <label class="col-md-3 control-label">耗电量</label> | ||
| 113 | + <div class="col-md-4"> | ||
| 114 | + <input type="text" value="0" class="form-control" name="hd" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 115 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + | ||
| 119 | + <div class="form-group"> | ||
| 120 | + <label class="col-md-3 control-label">尿素</label> | ||
| 121 | + <div class="col-md-4"> | ||
| 122 | + <input type="text" value="0" class="form-control" name="ns" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 123 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 124 | + </div> | ||
| 125 | + </div> | ||
| 126 | + | ||
| 127 | + <div class="form-group"> | ||
| 128 | + <label class="col-md-3 control-label">进场里程</label> | ||
| 129 | + <div class="col-md-4"> | ||
| 130 | + <input type="text" value="0" class="form-control" name="jzlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 131 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 132 | + </div> | ||
| 133 | + </div> | ||
| 134 | + <div class="form-group"> | ||
| 135 | + <label class="col-md-3 control-label">损耗原因</label> | ||
| 136 | + <div class="col-md-4"> | ||
| 137 | + <select class="form-control" name="shyy"> | ||
| 138 | + <option value='0'>请选择</option> | ||
| 139 | + <option value='1'>票务用油</option> | ||
| 140 | + <option value='2'>保养用油</option> | ||
| 141 | + <option value='3'>报废车用油</option> | ||
| 142 | + <option value='4'>其它用油</option> | ||
| 143 | + <option value='5'>人保部</option> | ||
| 144 | + <option value='6'>车队</option> | ||
| 145 | + <option value='7'>车间(高保)</option> | ||
| 146 | + <option value='8'>车间(小修)</option> | ||
| 147 | + </select> | ||
| 148 | + </div> | ||
| 149 | + </div> | ||
| 150 | + <div class="form-group"> | ||
| 151 | + <label class="col-md-3 control-label">损耗电量</label> | ||
| 152 | + <div class="col-md-4"> | ||
| 153 | + <input type="text" value="0" class="form-control" name="sh" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 154 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 155 | + </div> | ||
| 156 | + </div> | ||
| 157 | + <div class="form-group"> | ||
| 158 | + <label class="col-md-3 control-label">行驶总里程</label> | ||
| 159 | + <div class="col-md-4"> | ||
| 160 | + <input type="text" value="0" class="form-control" name="zlc" onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')" | ||
| 161 | + onafterpaste="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.')"> | ||
| 162 | + </div> | ||
| 163 | + </div> | ||
| 164 | + | ||
| 165 | + | ||
| 166 | + </div> | ||
| 167 | + <div class="form-actions"> | ||
| 168 | + <div class="row"> | ||
| 169 | + <div class="col-md-offset-3 col-md-4"> | ||
| 170 | + <button type="submit" class="btn green" ><i class="fa fa-check"></i> 提交</button> | ||
| 171 | + <a type="button" class="btn default" href="list.html" data-pjax><i class="fa fa-times"></i> 取消</a> | ||
| 172 | + </div> | ||
| 173 | + </div> | ||
| 174 | + </div> | ||
| 175 | + </form> | ||
| 176 | + <!-- END FORM--> | ||
| 177 | + </div> | ||
| 178 | +</div> | ||
| 179 | +<script> | ||
| 180 | +(function(){ | ||
| 181 | + var fage=false; | ||
| 182 | + var obj = []; | ||
| 183 | + var xlList; | ||
| 184 | + $.get('/report/lineList',function(result){ | ||
| 185 | + xlList=result; | ||
| 186 | + $.get('/user/companyData', function(result){ | ||
| 187 | + obj = result; | ||
| 188 | + var options = ''; | ||
| 189 | + for(var i = 0; i < obj.length; i++){ | ||
| 190 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 191 | + } | ||
| 192 | + $('#ssgsdm').html(options); | ||
| 193 | + | ||
| 194 | + updateCompany(); | ||
| 195 | + }); | ||
| 196 | + }); | ||
| 197 | + | ||
| 198 | + $("#ssgsdm").on("change",updateCompany); | ||
| 199 | + function updateCompany(){ | ||
| 200 | + var company = $('#ssgsdm').val(); | ||
| 201 | + var options = ''; | ||
| 202 | + for(var i = 0; i < obj.length; i++){ | ||
| 203 | + if(obj[i].companyCode == company){ | ||
| 204 | + var children = obj[i].children; | ||
| 205 | + for(var j = 0; j < children.length; j++){ | ||
| 206 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 207 | + } | ||
| 208 | + } | ||
| 209 | + } | ||
| 210 | + $('#fgsdm').html(options); | ||
| 211 | + initXl(); | ||
| 212 | + selectNbbm(); | ||
| 213 | + selectJsy(); | ||
| 214 | + } | ||
| 215 | + $("#fgsdm").on("change",initXl); | ||
| 216 | + function initXl(){ | ||
| 217 | + var data=[]; | ||
| 218 | + if(fage){ | ||
| 219 | + $("#xlbm").select2("destroy").html(''); | ||
| 220 | + } | ||
| 221 | + var fgs=$('#fgsdm').val(); | ||
| 222 | + var gs=$('#ssgsdm').val(); | ||
| 223 | + for(var i=0;i<xlList.length;i++){ | ||
| 224 | + if(gs!=""){ | ||
| 225 | + if(fgs!=""){ | ||
| 226 | + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){ | ||
| 227 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 228 | + } | ||
| 229 | + }else{ | ||
| 230 | + if(xlList[i]["gsbm"]==gs){ | ||
| 231 | + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); | ||
| 232 | + } | ||
| 233 | + } | ||
| 234 | + } | ||
| 235 | + } | ||
| 236 | + initPinYinSelect2('#xlbm',data,''); | ||
| 237 | + fage=true; | ||
| 238 | + selectNbbm(); | ||
| 239 | + selectJsy(); | ||
| 240 | + } | ||
| 241 | + $("#date").datetimepicker({ | ||
| 242 | + format : 'YYYY-MM-DD', | ||
| 243 | + locale : 'zh-cn' | ||
| 244 | + }); | ||
| 245 | + | ||
| 246 | + function selectNbbm(){ | ||
| 247 | + $('#nbbm').select2({ | ||
| 248 | + placeholder: '搜索车辆...', | ||
| 249 | + ajax: { | ||
| 250 | + url: '/report/carList', | ||
| 251 | + dataType: 'json', | ||
| 252 | + delay: 150, | ||
| 253 | + data: function(params){ | ||
| 254 | + return{nbbm: params.term, | ||
| 255 | + gsbm:$('#ssgsdm').val(), | ||
| 256 | + fgsbm:$('#fgsdm').val(), | ||
| 257 | + xlbm:"" | ||
| 258 | + }; | ||
| 259 | + }, | ||
| 260 | + processResults: function (data) { | ||
| 261 | + return { | ||
| 262 | + results: data | ||
| 263 | + }; | ||
| 264 | + }, | ||
| 265 | + cache: true | ||
| 266 | + }, | ||
| 267 | + templateResult: function(repo){ | ||
| 268 | + if (repo.loading) return repo.text; | ||
| 269 | + var h = '<span>'+repo.text+'</span>'; | ||
| 270 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | ||
| 271 | + return h; | ||
| 272 | + }, | ||
| 273 | + escapeMarkup: function (markup) { return markup; }, | ||
| 274 | + minimumInputLength: 1, | ||
| 275 | + templateSelection: function(repo){ | ||
| 276 | + return repo.text; | ||
| 277 | + }, | ||
| 278 | + language: { | ||
| 279 | + noResults: function(){ | ||
| 280 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | ||
| 281 | + }, | ||
| 282 | + inputTooShort : function(e) { | ||
| 283 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | ||
| 284 | + }, | ||
| 285 | + searching : function() { | ||
| 286 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | ||
| 287 | + } | ||
| 288 | + } | ||
| 289 | + }) | ||
| 290 | + } | ||
| 291 | + | ||
| 292 | + | ||
| 293 | + function selectJsy(){ | ||
| 294 | + $('#jsy').select2({ | ||
| 295 | + placeholder: '搜索驾驶员...', | ||
| 296 | + ajax: { | ||
| 297 | + url: '/report/userList', | ||
| 298 | + dataType: 'json', | ||
| 299 | + delay: 150, | ||
| 300 | + data: function(params){ | ||
| 301 | + return{jsy: params.term,gsbm:$('#ssgsdm').val()}; | ||
| 302 | + }, | ||
| 303 | + processResults: function (data) { | ||
| 304 | + return { | ||
| 305 | + results: data | ||
| 306 | + }; | ||
| 307 | + }, | ||
| 308 | + cache: true | ||
| 309 | + }, | ||
| 310 | + templateResult: function(repo){ | ||
| 311 | + if (repo.loading) return repo.text; | ||
| 312 | + var h = '<span>'+repo.text+'</span>'; | ||
| 313 | + return h; | ||
| 314 | + }, | ||
| 315 | + escapeMarkup: function (markup) { return markup; }, | ||
| 316 | + minimumInputLength: 1, | ||
| 317 | + templateSelection: function(repo){ | ||
| 318 | + return repo.text; | ||
| 319 | + }, | ||
| 320 | + language: { | ||
| 321 | + noResults: function(){ | ||
| 322 | + return '<span style="color:red;font-size: 12px;">没有搜索到驾驶员!</span>'; | ||
| 323 | + }, | ||
| 324 | + inputTooShort : function(e) { | ||
| 325 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入工号搜索驾驶员</span>'; | ||
| 326 | + }, | ||
| 327 | + searching : function() { | ||
| 328 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索驾驶员...</span>'; | ||
| 329 | + } | ||
| 330 | + } | ||
| 331 | + }); | ||
| 332 | + } | ||
| 333 | + $(function(){ | ||
| 334 | + /* $get('/role/all',null,function(result){ | ||
| 335 | + $.each(result,function(i,obj){ | ||
| 336 | + $("#role").append("<option value='"+obj.id+"'>"+obj.roleName+"</option>"); | ||
| 337 | + }); | ||
| 338 | + }); */ | ||
| 339 | + | ||
| 340 | + var form = $('#ylb_add_form'); | ||
| 341 | + var error = $('.alert-danger', form); | ||
| 342 | + | ||
| 343 | + //表单 validate | ||
| 344 | + form.validate({ | ||
| 345 | + errorElement : 'span', | ||
| 346 | + errorClass : 'help-block help-block-error', | ||
| 347 | + focusInvalid : false, | ||
| 348 | + rules : { | ||
| 349 | + 'xlbm' : { | ||
| 350 | + required : true, | ||
| 351 | + maxlength: 25 | ||
| 352 | + }, | ||
| 353 | + 'nbbm' : { | ||
| 354 | + required : true, | ||
| 355 | + maxlength: 25 | ||
| 356 | + }, | ||
| 357 | + 'rq' : { | ||
| 358 | + required : true, | ||
| 359 | + maxlength: 25 | ||
| 360 | + }, | ||
| 361 | + 'jsy' : { | ||
| 362 | + required : true, | ||
| 363 | + maxlength: 20 | ||
| 364 | + } | ||
| 365 | + }, | ||
| 366 | + invalidHandler : function(event, validator) { | ||
| 367 | + error.show(); | ||
| 368 | + App.scrollTo(error, -200); | ||
| 369 | + }, | ||
| 370 | + | ||
| 371 | + highlight : function(element) { | ||
| 372 | + $(element).closest('.form-group').addClass('has-error'); | ||
| 373 | + }, | ||
| 374 | + | ||
| 375 | + unhighlight : function(element) { | ||
| 376 | + $(element).closest('.form-group').removeClass('has-error'); | ||
| 377 | + }, | ||
| 378 | + | ||
| 379 | + success : function(label) { | ||
| 380 | + label.closest('.form-group').removeClass('has-error'); | ||
| 381 | + }, | ||
| 382 | + | ||
| 383 | + submitHandler : function(f) { | ||
| 384 | + var params = form.serializeJSON(); | ||
| 385 | + error.hide(); | ||
| 386 | + var nbbm=$("#nbbm").val(); | ||
| 387 | + var date=$("#date").val(); | ||
| 388 | + var jsy=$("#jsy").val(); | ||
| 389 | + var xlbm=$("#xlbm").val(); | ||
| 390 | + var map={}; | ||
| 391 | + map["nbbm"]=nbbm; | ||
| 392 | + map["date"]=date; | ||
| 393 | + map["jsy"]=jsy; | ||
| 394 | + map["xlbm"]=xlbm; | ||
| 395 | + //检查一下用户是否存在 | ||
| 396 | + $get('/dlb/checkJsy', map, function(fage){ | ||
| 397 | + if(fage=="0"){ | ||
| 398 | + layer.msg('该驾驶员当天已存在.'); | ||
| 399 | + }else{ | ||
| 400 | + $post('/dlb/saveDlb', params, function(){ | ||
| 401 | + layer.msg('添加信息成功.'); | ||
| 402 | + loadPage('list.html'); | ||
| 403 | + }); | ||
| 404 | + } | ||
| 405 | + }); | ||
| 406 | + } | ||
| 407 | + }); | ||
| 408 | + }); | ||
| 409 | +})(); | ||
| 410 | +</script> | ||
| 0 | \ No newline at end of file | 411 | \ No newline at end of file |
src/main/resources/static/pages/electricity/list/list.html
| @@ -23,6 +23,9 @@ | @@ -23,6 +23,9 @@ | ||
| 23 | <button type="button" class="btn btn-circle blue" id="saveButton"><i class="fa fa-minus-square"></i> | 23 | <button type="button" class="btn btn-circle blue" id="saveButton"><i class="fa fa-minus-square"></i> |
| 24 | 保存 | 24 | 保存 |
| 25 | </button> | 25 | </button> |
| 26 | + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加</a> | ||
| 27 | + <button type="button" class="btn btn-circle blue" id="removeButton"><i class="fa fa-trash-o"></i> 删除</button> | ||
| 28 | + | ||
| 26 | <button type="button" class="btn btn-circle blue" id="obtain"><i class="fa fa-hourglass-half"></i> | 29 | <button type="button" class="btn btn-circle blue" id="obtain"><i class="fa fa-hourglass-half"></i> |
| 27 | 获取加/存电信息 | 30 | 获取加/存电信息 |
| 28 | </button> | 31 | </button> |
| @@ -677,7 +680,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -677,7 +680,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 677 | } | 680 | } |
| 678 | 681 | ||
| 679 | 682 | ||
| 680 | - //删除 | 683 | + //删除 |
| 681 | $('#removeButton').on('click', function () { | 684 | $('#removeButton').on('click', function () { |
| 682 | var idArray = []; | 685 | var idArray = []; |
| 683 | var x=0; | 686 | var x=0; |
| @@ -697,7 +700,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -697,7 +700,7 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 697 | if(confirm('确定要删除选中的数据?')) | 700 | if(confirm('确定要删除选中的数据?')) |
| 698 | { | 701 | { |
| 699 | var i = layer.load(2); | 702 | var i = layer.load(2); |
| 700 | - $post('/ylb/deleteIds', params, function (result) { | 703 | + $post('/dlb/deleteIds', params, function (result) { |
| 701 | layer.close(i); | 704 | layer.close(i); |
| 702 | var params=getParamsList(); | 705 | var params=getParamsList(); |
| 703 | jsDoQuery(params, true); | 706 | jsDoQuery(params, true); |
| @@ -705,17 +708,6 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -705,17 +708,6 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 705 | } | 708 | } |
| 706 | } | 709 | } |
| 707 | }); | 710 | }); |
| 708 | - | ||
| 709 | - //搜索线路 | ||
| 710 | - /* $.get('/basic/lineCode2Name',function(result){ | ||
| 711 | - var data=[]; | ||
| 712 | - data.push({id: " ", text: "全部线路"}); | ||
| 713 | - for(var code in result){ | ||
| 714 | - data.push({id: code, text: result[code]}); | ||
| 715 | - } | ||
| 716 | - initPinYinSelect2('#xlbm',data,''); | ||
| 717 | - | ||
| 718 | - }) */ | ||
| 719 | 711 | ||
| 720 | 712 | ||
| 721 | $("#ylbListFgsdmId").on("change",initXl); | 713 | $("#ylbListFgsdmId").on("change",initXl); |
src/main/resources/static/pages/oil/add.html
| 1 | <div class="page-head"> | 1 | <div class="page-head"> |
| 2 | <div class="page-title"> | 2 | <div class="page-title"> |
| 3 | - <h1>进场站油量信息编辑</h1> | 3 | + <h1>进出站油量信息编辑</h1> |
| 4 | </div> | 4 | </div> |
| 5 | </div> | 5 | </div> |
| 6 | 6 | ||
| 7 | <ul class="page-breadcrumb breadcrumb"> | 7 | <ul class="page-breadcrumb breadcrumb"> |
| 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> | 8 | <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> |
| 9 | <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li> | 9 | <li><span class="active">用油管理</span> <i class="fa fa-circle"></i></li> |
| 10 | - <li><a href="list_ph.html" data-pjax>进场场油量</a> <i class="fa fa-circle"></i></li> | ||
| 11 | - <li><span class="active">进场站油量信息编辑</span></li> | 10 | + <li><a href="list_ph.html" data-pjax>进出场油量</a> <i class="fa fa-circle"></i></li> |
| 11 | + <li><span class="active">进出站油量信息编辑</span></li> | ||
| 12 | </ul> | 12 | </ul> |
| 13 | 13 | ||
| 14 | <div class="portlet light bordered"> | 14 | <div class="portlet light bordered"> |
src/main/resources/static/pages/report/oil/oilListMonth.html
| @@ -27,6 +27,14 @@ | @@ -27,6 +27,14 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form class="form-inline" action=""> | 29 | <form class="form-inline" action=""> |
| 30 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv"> | ||
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> | ||
| 37 | + </div> | ||
| 30 | <div style="display: inline-block;"> | 38 | <div style="display: inline-block;"> |
| 31 | <span class="item-label" style="width: 80px;">时间: </span> | 39 | <span class="item-label" style="width: 80px;">时间: </span> |
| 32 | <input class="form-control" type="text" id="date" style="width: 180px;"/> | 40 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| @@ -105,7 +113,7 @@ | @@ -105,7 +113,7 @@ | ||
| 105 | $("#date").val(year + "-0" + month + "-" + day); | 113 | $("#date").val(year + "-0" + month + "-" + day); |
| 106 | } | 114 | } |
| 107 | 115 | ||
| 108 | - var tempData = {}; | 116 | + /* var tempData = {}; |
| 109 | $.get('/report/lineList',function(xlList){ | 117 | $.get('/report/lineList',function(xlList){ |
| 110 | var data = []; | 118 | var data = []; |
| 111 | $.get('/user/companyData', function(result){ | 119 | $.get('/user/companyData', function(result){ |
| @@ -125,7 +133,86 @@ | @@ -125,7 +133,86 @@ | ||
| 125 | initPinYinSelect2('#line',data,''); | 133 | initPinYinSelect2('#line',data,''); |
| 126 | 134 | ||
| 127 | }); | 135 | }); |
| 136 | + }); */ | ||
| 137 | + var fage=false; | ||
| 138 | + var obj = []; | ||
| 139 | + var xlList; | ||
| 140 | + $.get('/report/lineList',function(result){ | ||
| 141 | + xlList=result; | ||
| 142 | + | ||
| 143 | + $.get('/user/companyData', function(result){ | ||
| 144 | + obj = result; | ||
| 145 | + console.log(obj); | ||
| 146 | + var options = ''; | ||
| 147 | + for(var i = 0; i < obj.length; i++){ | ||
| 148 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + if(obj.length ==0){ | ||
| 152 | + $("#gsdmDiv").css('display','none'); | ||
| 153 | + }else if(obj.length ==1){ | ||
| 154 | + $("#gsdmDiv").css('display','none'); | ||
| 155 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 156 | + $('#fgsdmDiv').css('display','none'); | ||
| 157 | + } | ||
| 158 | + $('#gsdm').html(options); | ||
| 159 | + | ||
| 160 | + updateCompany(); | ||
| 161 | + }); | ||
| 128 | }); | 162 | }); |
| 163 | + | ||
| 164 | + $("#gsdm").on("change",updateCompany); | ||
| 165 | + function updateCompany(){ | ||
| 166 | + var company = $('#gsdm').val(); | ||
| 167 | + var options = ''; | ||
| 168 | + for(var i = 0; i < obj.length; i++){ | ||
| 169 | + if(obj[i].companyCode == company){ | ||
| 170 | + var children = obj[i].children; | ||
| 171 | + for(var j = 0; j < children.length; j++){ | ||
| 172 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 173 | + } | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | + $('#fgsdm').html(options); | ||
| 177 | + | ||
| 178 | + var tempData = {}; | ||
| 179 | + $.get('/report/lineList',function(xlList){ | ||
| 180 | + var data = []; | ||
| 181 | + data.push({id: " ", text: "全部线路"}); | ||
| 182 | + $.get('/user/companyData', function(result){ | ||
| 183 | + for(var i = 0; i < result.length; i++){ | ||
| 184 | + var companyCode = result[i].companyCode; | ||
| 185 | + var children = result[i].children; | ||
| 186 | + for(var j = 0; j < children.length; j++){ | ||
| 187 | + var code = children[j].code; | ||
| 188 | + for(var k=0;k < xlList.length;k++ ){ | ||
| 189 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 190 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 191 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + } | ||
| 195 | + } | ||
| 196 | + initPinYinSelect2('#line',data,''); | ||
| 197 | + | ||
| 198 | + }); | ||
| 199 | + }); | ||
| 200 | + | ||
| 201 | + $("#line").on("change", function(){ | ||
| 202 | + if($("#line").val() == " "){ | ||
| 203 | + $("#gsdm").attr("disabled", false); | ||
| 204 | + $("#fgsdm").attr("disabled", false); | ||
| 205 | + } else { | ||
| 206 | + var temp = tempData[$("#line").val()].split(":"); | ||
| 207 | + $("#gsdm").val(temp[0]); | ||
| 208 | + updateCompany(); | ||
| 209 | + $("#fgsdm").val(temp[1]); | ||
| 210 | + $("#gsdm").attr("disabled", true); | ||
| 211 | + $("#fgsdm").attr("disabled", true); | ||
| 212 | + } | ||
| 213 | + }); | ||
| 214 | + } | ||
| 215 | + | ||
| 129 | 216 | ||
| 130 | 217 | ||
| 131 | //查询 | 218 | //查询 |
| @@ -136,7 +223,9 @@ | @@ -136,7 +223,9 @@ | ||
| 136 | } | 223 | } |
| 137 | var line = $("#line").val(); | 224 | var line = $("#line").val(); |
| 138 | var date = $("#date").val(); | 225 | var date = $("#date").val(); |
| 139 | - $get('/ylb/oilListMonth',{line:line,date:date,type:'query'},function(result){ | 226 | + var gsdm = $("#gsdm").val(); |
| 227 | + var fgsdm = $("#fgsdm").val(); | ||
| 228 | + $get('/ylb/oilListMonth',{line:line,date:date,gsdm:gsdm,fgsdm,fgsdm,type:'query'},function(result){ | ||
| 140 | // $.each(result, function(i, obj) { | 229 | // $.each(result, function(i, obj) { |
| 141 | // obj.rq = moment(obj.rq).format("DD"); | 230 | // obj.rq = moment(obj.rq).format("DD"); |
| 142 | // }); | 231 | // }); |
src/main/resources/static/pages/trafficManage/css/trafficManage.css
| @@ -68,8 +68,7 @@ | @@ -68,8 +68,7 @@ | ||
| 68 | background-color: #fff; | 68 | background-color: #fff; |
| 69 | } | 69 | } |
| 70 | .dateRange { | 70 | .dateRange { |
| 71 | - width: 30px; | ||
| 72 | - margin-right: 5px; | 71 | + width: 40px; |
| 73 | text-align: center; | 72 | text-align: center; |
| 74 | } | 73 | } |
| 75 | 74 | ||
| @@ -79,4 +78,8 @@ | @@ -79,4 +78,8 @@ | ||
| 79 | 78 | ||
| 80 | .inputCarPlate { | 79 | .inputCarPlate { |
| 81 | width: 100px; | 80 | width: 100px; |
| 81 | +} | ||
| 82 | + | ||
| 83 | +.inLine_block { | ||
| 84 | + display: inline-block; | ||
| 82 | } | 85 | } |
| 83 | \ No newline at end of file | 86 | \ No newline at end of file |
src/main/resources/static/real_control_v2/alone_page/home/alone_data_basic.js
0 → 100644
| 1 | +/* 基础数据管理模块 */ | ||
| 2 | + | ||
| 3 | +var gb_data_basic = (function () { | ||
| 4 | + | ||
| 5 | + var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | ||
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | ||
| 7 | + , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | ||
| 8 | + stationRoutes = routes; | ||
| 9 | + lineCode2NameAll = code2Name; | ||
| 10 | + lineInformations = informations; | ||
| 11 | + nbbm2deviceMap = nbbm2device; | ||
| 12 | + device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | ||
| 13 | + allPersonnel = all_personnel; | ||
| 14 | + svgAttrs = svgAttrMap; | ||
| 15 | + | ||
| 16 | + res_load_ep.emitLater('data-basic'); | ||
| 17 | + }); | ||
| 18 | + | ||
| 19 | + var storage = window.localStorage; | ||
| 20 | + //激活的线路 | ||
| 21 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | ||
| 22 | + //lineCode to line object | ||
| 23 | + var codeToLine = {}; | ||
| 24 | + //lineCode idx string | ||
| 25 | + var line_idx = (function () { | ||
| 26 | + var str = ''; | ||
| 27 | + for (var i = 0, item; item = activeLines[i++];) { | ||
| 28 | + str += (',' + item.lineCode); | ||
| 29 | + codeToLine[item.lineCode] = item; | ||
| 30 | + } | ||
| 31 | + return str.substr(1); | ||
| 32 | + })(); | ||
| 33 | + | ||
| 34 | + //站点路由 | ||
| 35 | + gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | ||
| 36 | + var list = rs.list;//JSON.parse(rs.list); | ||
| 37 | + var routeData = gb_common.groupBy(list, 'lineCode'); | ||
| 38 | + //排序 | ||
| 39 | + for (var lineCode in routeData) { | ||
| 40 | + routeData[lineCode].sort(stationRouteSort); | ||
| 41 | + } | ||
| 42 | + ep.emit('stationRoutes', routeData); | ||
| 43 | + }); | ||
| 44 | + | ||
| 45 | + //线路标准信息 | ||
| 46 | + /*gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | ||
| 47 | + var informations = {}; | ||
| 48 | + $.each(rs, function () { | ||
| 49 | + informations[this.line.lineCode] = this; | ||
| 50 | + delete this['line']; | ||
| 51 | + }); | ||
| 52 | + ep.emit('lineInformations', informations); | ||
| 53 | + });*/ | ||
| 54 | + ep.emit('lineInformations', {}); | ||
| 55 | + | ||
| 56 | + //人员信息 | ||
| 57 | + ep.emit('all_personnel', {}); | ||
| 58 | + /*loadAllPersonnel(function (data) { | ||
| 59 | + ep.emit('all_personnel', data); | ||
| 60 | + }); | ||
| 61 | + function loadAllPersonnel(cb) { | ||
| 62 | + $.get('/personnel/all_py', function (rs) { | ||
| 63 | + //转换成自动补全组件需要的数据 | ||
| 64 | + var data = [], code; | ||
| 65 | + for(var i =0, p; p = rs[i++];){ | ||
| 66 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | ||
| 67 | + data.push({ | ||
| 68 | + value: code + '/' + p.name, | ||
| 69 | + fullChars: p.fullChars.toUpperCase(), | ||
| 70 | + camelChars: p.camelChars.toUpperCase() | ||
| 71 | + }); | ||
| 72 | + } | ||
| 73 | + cb && cb(data); | ||
| 74 | + }); | ||
| 75 | + }*/ | ||
| 76 | + | ||
| 77 | + var carparks = {}; | ||
| 78 | + //停车场数据 | ||
| 79 | +/* gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | ||
| 80 | + rs.list.sort(function (a, b) { | ||
| 81 | + return a.parkName.localeCompare(b.parkName); | ||
| 82 | + }); | ||
| 83 | + $.each(rs.list, function () { | ||
| 84 | + carparks[this.parkCode] = this; | ||
| 85 | + }); | ||
| 86 | + });*/ | ||
| 87 | + | ||
| 88 | + //车辆数据 | ||
| 89 | + var carsArray; | ||
| 90 | + /*$.get('/basic/cars?t=' + Math.random(), function (rs) { | ||
| 91 | + carsArray = rs; | ||
| 92 | + });*/ | ||
| 93 | + | ||
| 94 | + var getCarparkByCode = function (code) { | ||
| 95 | + return carparks[code]; | ||
| 96 | + }; | ||
| 97 | + | ||
| 98 | + //line code to name | ||
| 99 | + $.get('/basic/lineCode2Name', function (rs) { | ||
| 100 | + ep.emit('lineCode2Name', rs); | ||
| 101 | + }); | ||
| 102 | + | ||
| 103 | + //nbbm to device id | ||
| 104 | + $.get('/basic/nbbm2deviceId', function (rs) { | ||
| 105 | + ep.emit('nbbm2deviceId', rs); | ||
| 106 | + }); | ||
| 107 | + //nbbm to 车牌号 | ||
| 108 | + var nbbm2PlateMap; | ||
| 109 | + $.get('/basic/nbbm2PlateNo', function (rs) { | ||
| 110 | + nbbm2PlateMap = rs; | ||
| 111 | + }); | ||
| 112 | + | ||
| 113 | + //模拟图属性数据 | ||
| 114 | + gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | ||
| 115 | + var data = {}; | ||
| 116 | + $.each(rs.list, function () { | ||
| 117 | + this.hideStations = JSON.parse(this.hideStations); | ||
| 118 | + this.nicknames = JSON.parse(this.nicknames); | ||
| 119 | + data[this.lineCode] = this; | ||
| 120 | + }); | ||
| 121 | + ep.emit('svg_attrs', data); | ||
| 122 | + }); | ||
| 123 | + | ||
| 124 | + //站点和停车场历时、公里对照数据 | ||
| 125 | + var stat_park_data; | ||
| 126 | + /*var load_stat_park_data = function () { | ||
| 127 | + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | ||
| 128 | + stat_park_data = rs; | ||
| 129 | + }); | ||
| 130 | + } | ||
| 131 | + load_stat_park_data();*/ | ||
| 132 | + | ||
| 133 | + function findLineByCodes(codeArr) { | ||
| 134 | + var rs = []; | ||
| 135 | + $.each(codeArr, function () { | ||
| 136 | + rs.push(codeToLine[this]); | ||
| 137 | + }); | ||
| 138 | + return rs; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + var findCodeByLinename = function (name) { | ||
| 142 | + for (var code in lineCode2NameAll) { | ||
| 143 | + if (name == lineCode2NameAll[code]) | ||
| 144 | + return code; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + return null; | ||
| 148 | + }; | ||
| 149 | + | ||
| 150 | + var getLineInformation = function (lineCode) { | ||
| 151 | + return lineInformations[lineCode]; | ||
| 152 | + }; | ||
| 153 | + | ||
| 154 | + var stationRouteSort = function (a, b) { | ||
| 155 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 156 | + }; | ||
| 157 | + | ||
| 158 | + /** | ||
| 159 | + * 常用的备注补全列表 | ||
| 160 | + */ | ||
| 161 | + var remarksArray = ['保养', '故障', '肇事', '加油', '维修', '援外', '路阻' | ||
| 162 | + , '故障(离合器坏)', '故障,(方向盘坏)', '故障(排挡坏)', '故障(门坏)', '故障(雨刮器坏)','故障(刹车坏)', '故障(气打不上)' | ||
| 163 | + ,'故障(整车无电)', '故障(故障灯常亮)', '故障(警报灯亮)', '故障(玻璃坏)', '故障(反光镜坏)', '故障(发电机坏)', '故障(漏防冻液)' | ||
| 164 | + , '故障(漏水)','故障(轮胎坏)', '故障(无动力)', '故障(喷机油)', '故障(水温高)', '保养(一级保养)' | ||
| 165 | + , '保养(二级保养)', '保养(三级保养)', '换车出场', '临加进场', '临加出场']; | ||
| 166 | + var remarksMapps = []; | ||
| 167 | + $.each(remarksArray, function (i, t) { | ||
| 168 | + remarksMapps.push({ | ||
| 169 | + value: t, | ||
| 170 | + fullChars: pinyin.getFullChars(t).toUpperCase(), | ||
| 171 | + camelChars: pinyin.getCamelChars(t) | ||
| 172 | + }); | ||
| 173 | + }); | ||
| 174 | + | ||
| 175 | + //文件载入完毕 | ||
| 176 | + res_load_ep.emitLater('load_data_basic'); | ||
| 177 | + | ||
| 178 | + return { | ||
| 179 | + activeLines: activeLines, | ||
| 180 | + line_idx: line_idx, | ||
| 181 | + codeToLine: codeToLine, | ||
| 182 | + nbbm2deviceMap: function () { | ||
| 183 | + return nbbm2deviceMap; | ||
| 184 | + }, | ||
| 185 | + device2nbbmMap: function () { | ||
| 186 | + return device2nbbmMap; | ||
| 187 | + }, | ||
| 188 | + getLineInformation: getLineInformation, | ||
| 189 | + allInformations: function () { | ||
| 190 | + return lineInformations; | ||
| 191 | + }, | ||
| 192 | + stationRoutes: function (lineCode) { | ||
| 193 | + return stationRoutes[lineCode] | ||
| 194 | + }, | ||
| 195 | + findLineByCodes: findLineByCodes, | ||
| 196 | + lineCode2NameAll: function () { | ||
| 197 | + return lineCode2NameAll | ||
| 198 | + }, | ||
| 199 | + allPersonnel: function () { | ||
| 200 | + return allPersonnel; | ||
| 201 | + }, | ||
| 202 | + findCodeByLinename: findCodeByLinename, | ||
| 203 | + getCarparkByCode: getCarparkByCode, | ||
| 204 | + getSvgAttr: function (lineCode) { | ||
| 205 | + return svgAttrs[lineCode]; | ||
| 206 | + }, | ||
| 207 | + setSvgAttr: function (attr) { | ||
| 208 | + attr.hideStations = JSON.parse(attr.hideStations); | ||
| 209 | + attr.nicknames = JSON.parse(attr.nicknames); | ||
| 210 | + svgAttrs[attr.lineCode] = attr; | ||
| 211 | + }, | ||
| 212 | + //是否是环线 | ||
| 213 | + isLoopLine: function (lineCode) { | ||
| 214 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | ||
| 215 | + //下行只有2个站点 | ||
| 216 | + var len = data[0].length; | ||
| 217 | + if (len > 0 && data[1].length == 2) { | ||
| 218 | + var first = data[0][0], | ||
| 219 | + end = data[0][len - 1]; | ||
| 220 | + | ||
| 221 | + /*if(first.stationName != end.stationName) | ||
| 222 | + return false;*/ | ||
| 223 | + | ||
| 224 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | ||
| 225 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | ||
| 226 | + | ||
| 227 | + //并且上行起终点距离200米内 | ||
| 228 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | ||
| 229 | + return true; | ||
| 230 | + } | ||
| 231 | + } | ||
| 232 | + | ||
| 233 | + return false; | ||
| 234 | + }, | ||
| 235 | + //刷新员工信息 | ||
| 236 | + refreshAllPersonnel: function (cb) { | ||
| 237 | + loadAllPersonnel(function (data) { | ||
| 238 | + allPersonnel = data; | ||
| 239 | + cb && cb(); | ||
| 240 | + }); | ||
| 241 | + }, | ||
| 242 | + nbbm2PlateMap: function () { | ||
| 243 | + return nbbm2PlateMap; | ||
| 244 | + }, | ||
| 245 | + carsArray: function () { | ||
| 246 | + return carsArray; | ||
| 247 | + }, | ||
| 248 | + simpleParksArray: function () { | ||
| 249 | + var map = {}; | ||
| 250 | + for(var code in carparks) | ||
| 251 | + map[code] = carparks[code].parkName; | ||
| 252 | + return map; | ||
| 253 | + }, | ||
| 254 | + remarksMapps: function () { | ||
| 255 | + return remarksMapps; | ||
| 256 | + }, | ||
| 257 | + get_stat_park_data: function () { | ||
| 258 | + return stat_park_data; | ||
| 259 | + }, | ||
| 260 | + reload_stat_park_data: function () { | ||
| 261 | + load_stat_park_data(); | ||
| 262 | + } | ||
| 263 | + }; | ||
| 264 | +})(); |
src/main/resources/static/real_control_v2/alone_page/home/alone_data_gps.js
0 → 100644
| 1 | +/* gps 数据管理模块 */ | ||
| 2 | + | ||
| 3 | +var gb_data_gps = (function () { | ||
| 4 | + | ||
| 5 | + //fixed time refresh delay | ||
| 6 | + var delay = 1000 * 7; | ||
| 7 | + //deviceId ——> gps | ||
| 8 | + var realData = {}; | ||
| 9 | + //refresh after callback | ||
| 10 | + var refreshEventCallbacks = []; | ||
| 11 | + //register callback function | ||
| 12 | + var registerCallback = function (cb) { | ||
| 13 | + if (cb) | ||
| 14 | + refreshEventCallbacks.push(cb); | ||
| 15 | + }; | ||
| 16 | + | ||
| 17 | + var refresh = function (cb) { | ||
| 18 | + $.ajax({ | ||
| 19 | + url: '/gps/real/line', | ||
| 20 | + data: {lineCodes: gb_data_basic.line_idx}, | ||
| 21 | + dataType: 'json', | ||
| 22 | + success: function (rs) { | ||
| 23 | + //用定时的gps来检测session断开 | ||
| 24 | + if(rs.status && rs.status==407){ | ||
| 25 | + location.href = '/login.html'; | ||
| 26 | + return; | ||
| 27 | + } | ||
| 28 | + refreshData(rs); | ||
| 29 | + cb(); | ||
| 30 | + }, | ||
| 31 | + error: function (xr, t) { | ||
| 32 | + notify_err('刷新GPS失败,稍后重试' + t); | ||
| 33 | + cb(); | ||
| 34 | + } | ||
| 35 | + }); | ||
| 36 | + }; | ||
| 37 | + | ||
| 38 | + var refreshData = function (rs) { | ||
| 39 | + var old, addArr = [], | ||
| 40 | + upArr = [], | ||
| 41 | + upDownChange = []; | ||
| 42 | + | ||
| 43 | + var schArray; | ||
| 44 | + $.each(rs, function () { | ||
| 45 | + old = realData[this.deviceId]; | ||
| 46 | + if (old) { | ||
| 47 | + if (this.timestamp > old.timestamp) { | ||
| 48 | + if (old.upDown != this.upDown) | ||
| 49 | + upDownChange.push(this); | ||
| 50 | + else | ||
| 51 | + upArr.push(this); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + } else | ||
| 55 | + addArr.push(this); | ||
| 56 | + | ||
| 57 | + //班次信息 | ||
| 58 | + /*if (this.schId) { | ||
| 59 | + schArray = gb_schedule_table.findScheduleByLine(this.lineId); | ||
| 60 | + if (schArray) | ||
| 61 | + this.sch = schArray[this.schId]; | ||
| 62 | + }*/ | ||
| 63 | + | ||
| 64 | + //时间格式化 | ||
| 65 | + this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | ||
| 66 | + realData[this.deviceId] = this; | ||
| 67 | + }); | ||
| 68 | + | ||
| 69 | + //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | ||
| 70 | + //CCCallFuncN | ||
| 71 | + $.each(refreshEventCallbacks, function (i, cb) { | ||
| 72 | + cb(addArr, upArr, upDownChange); | ||
| 73 | + }); | ||
| 74 | + | ||
| 75 | + }; | ||
| 76 | + | ||
| 77 | + var startFixedTime; | ||
| 78 | + var fixedTimeRefresh = function () { | ||
| 79 | + if (startFixedTime) | ||
| 80 | + return; | ||
| 81 | + startFixedTime = true; | ||
| 82 | + | ||
| 83 | + (function () { | ||
| 84 | + var f = arguments.callee; | ||
| 85 | + refresh(function () { | ||
| 86 | + setTimeout(f, delay); | ||
| 87 | + }); | ||
| 88 | + })(); | ||
| 89 | + }; | ||
| 90 | + | ||
| 91 | + var gpsByLineCode = function (lineCode) { | ||
| 92 | + var rs = []; | ||
| 93 | + for (var device in realData) { | ||
| 94 | + if (realData[device].lineId == lineCode) | ||
| 95 | + rs.push(realData[device]); | ||
| 96 | + } | ||
| 97 | + return rs; | ||
| 98 | + }; | ||
| 99 | + | ||
| 100 | + var findOne = function (deviceId) { | ||
| 101 | + return realData[deviceId]; | ||
| 102 | + }; | ||
| 103 | + | ||
| 104 | + var findGpsByNbbm = function (nbbm) { | ||
| 105 | + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | ||
| 106 | + }; | ||
| 107 | + | ||
| 108 | + /** | ||
| 109 | + * 设备掉线事件 | ||
| 110 | + */ | ||
| 111 | + var deviceOffline = function (gps) { | ||
| 112 | + $.each(offlineCallbacks, function (i, cb) { | ||
| 113 | + cb(gps); | ||
| 114 | + }); | ||
| 115 | + }; | ||
| 116 | + | ||
| 117 | + //注册掉线事件回调函数 | ||
| 118 | + var offlineCallbacks = []; | ||
| 119 | + var registerOfflineCb = function (cb) { | ||
| 120 | + if (cb) | ||
| 121 | + offlineCallbacks.push(cb); | ||
| 122 | + }; | ||
| 123 | + | ||
| 124 | + return { | ||
| 125 | + fixedTimeRefresh: fixedTimeRefresh, | ||
| 126 | + registerCallback: registerCallback, | ||
| 127 | + allGps: realData, | ||
| 128 | + gpsByLineCode: gpsByLineCode, | ||
| 129 | + findOne: findOne, | ||
| 130 | + findGpsByNbbm: findGpsByNbbm, | ||
| 131 | + deviceOffline: deviceOffline, | ||
| 132 | + registerOfflineCb: registerOfflineCb | ||
| 133 | + }; | ||
| 134 | +})(); |
src/main/resources/static/real_control_v2/alone_page/home/home_wrap.html
0 → 100644
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html lang="zh-cn"> | ||
| 3 | + | ||
| 4 | +<head> | ||
| 5 | + <meta charset="UTF-8"> | ||
| 6 | + <title>主页模拟图</title> | ||
| 7 | + <!-- uikit core style--> | ||
| 8 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" /> | ||
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" merge="plugins"/> | ||
| 10 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" merge="plugins"/> | ||
| 11 | + <link rel="stylesheet" | ||
| 12 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | ||
| 13 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" merge="plugins"/> | ||
| 14 | + | ||
| 15 | + <!-- main style --> | ||
| 16 | + <link rel="stylesheet" href="/real_control_v2/css/main.css" /> | ||
| 17 | + <!-- home style --> | ||
| 18 | + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | ||
| 19 | + | ||
| 20 | + <!-- custom table --> | ||
| 21 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | ||
| 22 | + <!-- jquery contextMenu style --> | ||
| 23 | + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" merge="plugins"/> | ||
| 24 | + <!-- formvalidation style --> | ||
| 25 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css" merge="plugins"/> | ||
| 26 | + <!-- js tree --> | ||
| 27 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/> | ||
| 28 | + <!-- tooltip css--> | ||
| 29 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css" merge="plugins"/> | ||
| 30 | + <link rel="stylesheet" href="/real_control_v2/css/pace.css" merge="plugins"/> | ||
| 31 | + | ||
| 32 | + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | ||
| 33 | + <!-- perfect-scrollbar style --> | ||
| 34 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | ||
| 35 | + <!-- layer 3.0.3 --> | ||
| 36 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | ||
| 37 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + <style> | ||
| 41 | + .main-container{ | ||
| 42 | + height: 100% !important; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + #main-tab-content{ | ||
| 46 | + padding: 0 !important; | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + .home-panel{ | ||
| 50 | + | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + #home-main-content{ | ||
| 54 | + padding: 0 !important; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + #main-tab-content>.home-panel>#home-main-content{ | ||
| 58 | + overflow: inherit; | ||
| 59 | + } | ||
| 60 | + </style> | ||
| 61 | +</head> | ||
| 62 | + | ||
| 63 | +<body> | ||
| 64 | +<!--<div class="main-container" style="height: 100%;"> | ||
| 65 | +</div>--> | ||
| 66 | +<div class="main-container"> | ||
| 67 | + <ul id="main-tab-content"> | ||
| 68 | + <li class="home-panel"></li> | ||
| 69 | + </ul> | ||
| 70 | +</div> | ||
| 71 | + | ||
| 72 | + | ||
| 73 | +<!-- 地图相关 --> | ||
| 74 | +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | ||
| 75 | +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | ||
| 76 | +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | ||
| 77 | +<script src="/assets/js/TransGPS.js" merge="plugins"></script> | ||
| 78 | +<!-- jquery --> | ||
| 79 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | ||
| 80 | +<!-- jquery actual --> | ||
| 81 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | ||
| 82 | +<!-- jquery.serializejson JSON序列化插件 --> | ||
| 83 | +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | ||
| 84 | +<!-- moment.js 日期处理类库 --> | ||
| 85 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | ||
| 86 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | ||
| 87 | + | ||
| 88 | +<!-- flatpickr --> | ||
| 89 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | ||
| 90 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | ||
| 91 | + | ||
| 92 | +<!-- perfect-scrollbar --> | ||
| 93 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | ||
| 94 | +<!-- common js --> | ||
| 95 | +<script src="/real_control_v2/js/common.js"></script> | ||
| 96 | +<!-- art-template 模版引擎 --> | ||
| 97 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | ||
| 98 | +<!-- d3 --> | ||
| 99 | +<script src="/assets/js/d3.min.js"></script> | ||
| 100 | +<!-- EventProxy --> | ||
| 101 | +<script src="/assets/js/eventproxy.js"></script> | ||
| 102 | + | ||
| 103 | +<script> | ||
| 104 | + | ||
| 105 | + | ||
| 106 | + var res_load_ep = EventProxy.create('load_home_layout', 'load_home_line_panel', 'load_data_basic', 'data-basic', function () { | ||
| 107 | + //加载主页 | ||
| 108 | + gb_home_layout.layout(function () { | ||
| 109 | + gb_home_line_panel.init(function () { | ||
| 110 | + //gps自刷新 | ||
| 111 | + gb_data_gps.fixedTimeRefresh(); | ||
| 112 | + | ||
| 113 | + $('.uk-icon-send-o.home_alone_page').remove(); | ||
| 114 | + }); | ||
| 115 | + }); | ||
| 116 | + }); | ||
| 117 | + | ||
| 118 | + function connectArr(arr, separator, transFun) { | ||
| 119 | + var rs = ''; | ||
| 120 | + $.each(arr, function (i, item) { | ||
| 121 | + if (transFun) | ||
| 122 | + item = transFun(item); | ||
| 123 | + rs += (separator + item); | ||
| 124 | + }); | ||
| 125 | + return rs.substr(separator.length); | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + var isArray = function (obj) { | ||
| 129 | + return Object.prototype.toString.call(obj) === '[object Array]'; | ||
| 130 | + }; | ||
| 131 | + | ||
| 132 | + var gb_form_validation_opts = { | ||
| 133 | + framework: 'uikit', | ||
| 134 | + locale: 'zh_CN', | ||
| 135 | + icon: { | ||
| 136 | + valid: 'uk-icon-check', | ||
| 137 | + invalid: 'uk-icon-times', | ||
| 138 | + validating: 'uk-icon-refresh' | ||
| 139 | + } | ||
| 140 | + }; | ||
| 141 | + | ||
| 142 | +</script> | ||
| 143 | + | ||
| 144 | +<!-- uikit core --> | ||
| 145 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | ||
| 146 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | ||
| 147 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js" merge="uikit_js"></script> | ||
| 148 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | ||
| 149 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | ||
| 150 | + | ||
| 151 | + | ||
| 152 | +<!-- jquery contextMenu --> | ||
| 153 | +<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js" merge="plugins"></script> | ||
| 154 | +<script src="/real_control_v2/assets/js/jquery.ui.position.min.js" merge="plugins"></script> | ||
| 155 | +<!-- formvalidation- --> | ||
| 156 | +<script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js" merge="plugins"></script> | ||
| 157 | +<script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js" merge="plugins"></script> | ||
| 158 | +<script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js" merge="plugins"></script> | ||
| 159 | +<!-- js tree --> | ||
| 160 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | ||
| 161 | +<!-- simple pinyin --> | ||
| 162 | +<script src="/assets/plugins/pinyin.js" merge="plugins"></script> | ||
| 163 | +<!-- qtip --> | ||
| 164 | +<script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js" merge="plugins"></script> | ||
| 165 | +<!-- layer 3.0.3 --> | ||
| 166 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | ||
| 167 | + | ||
| 168 | +<!-- 数据 --> | ||
| 169 | +<script src="/real_control_v2/alone_page/home/alone_data_basic.js" merge="custom_js"></script> | ||
| 170 | +<script src="/real_control_v2/alone_page/home/alone_data_gps.js" merge="custom_js"></script> | ||
| 171 | +<script src="/real_control_v2/js/data/gps_abnormal.js" merge="custom_js"></script> | ||
| 172 | +<!-- 线路模拟图 --> | ||
| 173 | +<script src="/real_control_v2/js/utils/svg_chart.js" merge="custom_js"></script> | ||
| 174 | +<script src="/real_control_v2/js/utils/svg_data_convert.js" merge="custom_js"></script> | ||
| 175 | +<script src="/real_control_v2/js/utils/svg_chart_tooltip.js" merge="custom_js"></script> | ||
| 176 | +<script src="/real_control_v2/js/utils/svg_chart_map.js" merge="custom_js"></script> | ||
| 177 | + | ||
| 178 | +<!-- custom table js --> | ||
| 179 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | ||
| 180 | +<!-- home js --> | ||
| 181 | +<script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script> | ||
| 182 | +<script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script> | ||
| 183 | +<script src="/real_control_v2/js/home/context_menu.js" merge="custom_js"></script> | ||
| 184 | + | ||
| 185 | + | ||
| 186 | +<!-- 模态框扩展 --> | ||
| 187 | +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | ||
| 188 | + | ||
| 189 | +</body> | ||
| 190 | + | ||
| 191 | +</html> |
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_data_basic.js renamed to src/main/resources/static/real_control_v2/alone_page/map/alone_data_basic.js
| 1 | -/* 基础数据管理模块 */ | ||
| 2 | - | ||
| 3 | -var gb_data_basic = (function () { | ||
| 4 | - | ||
| 5 | - var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | ||
| 6 | - var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | ||
| 7 | - , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | ||
| 8 | - stationRoutes = routes; | ||
| 9 | - lineCode2NameAll = code2Name; | ||
| 10 | - lineInformations = informations; | ||
| 11 | - nbbm2deviceMap = nbbm2device; | ||
| 12 | - device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | ||
| 13 | - allPersonnel = all_personnel; | ||
| 14 | - svgAttrs = svgAttrMap; | ||
| 15 | - //gb_main_ep.emitLater('data-basic'); | ||
| 16 | - }); | ||
| 17 | - | ||
| 18 | - var storage = window.localStorage; | ||
| 19 | - //激活的线路 | ||
| 20 | - var activeLines = JSON.parse(storage.getItem('lineControlItems')); | ||
| 21 | - //lineCode to line object | ||
| 22 | - var codeToLine = {}; | ||
| 23 | - //lineCode idx string | ||
| 24 | - var line_idx = (function () { | ||
| 25 | - var str = ''; | ||
| 26 | - for (var i = 0, item; item = activeLines[i++];) { | ||
| 27 | - str += (',' + item.lineCode); | ||
| 28 | - codeToLine[item.lineCode] = item; | ||
| 29 | - } | ||
| 30 | - return str.substr(1); | ||
| 31 | - })(); | ||
| 32 | - | ||
| 33 | - //站点路由 | ||
| 34 | - gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | ||
| 35 | - var list = rs.list;//JSON.parse(rs.list); | ||
| 36 | - var routeData = gb_common.groupBy(list, 'lineCode'); | ||
| 37 | - //排序 | ||
| 38 | - for (var lineCode in routeData) { | ||
| 39 | - routeData[lineCode].sort(stationRouteSort); | ||
| 40 | - } | ||
| 41 | - ep.emit('stationRoutes', routeData); | ||
| 42 | - }); | ||
| 43 | - | ||
| 44 | - //线路标准信息 | ||
| 45 | - gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | ||
| 46 | - var informations = {}; | ||
| 47 | - $.each(rs, function () { | ||
| 48 | - informations[this.line.lineCode] = this; | ||
| 49 | - delete this['line']; | ||
| 50 | - }); | ||
| 51 | - ep.emit('lineInformations', informations); | ||
| 52 | - }); | ||
| 53 | - | ||
| 54 | - //人员信息 | ||
| 55 | - loadAllPersonnel(function (data) { | ||
| 56 | - ep.emit('all_personnel', data); | ||
| 57 | - }); | ||
| 58 | - function loadAllPersonnel(cb) { | ||
| 59 | - $.get('/personnel/all_py', function (rs) { | ||
| 60 | - //转换成自动补全组件需要的数据 | ||
| 61 | - var data = [], code; | ||
| 62 | - for(var i =0, p; p = rs[i++];){ | ||
| 63 | - code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | ||
| 64 | - data.push({ | ||
| 65 | - value: code + '/' + p.name, | ||
| 66 | - fullChars: p.fullChars.toUpperCase(), | ||
| 67 | - camelChars: p.camelChars.toUpperCase() | ||
| 68 | - }); | ||
| 69 | - } | ||
| 70 | - cb && cb(data); | ||
| 71 | - }); | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - var carparks = {}; | ||
| 75 | - //停车场数据 | ||
| 76 | - gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | ||
| 77 | - rs.list.sort(function (a, b) { | ||
| 78 | - return a.parkName.localeCompare(b.parkName); | ||
| 79 | - }); | ||
| 80 | - $.each(rs.list, function () { | ||
| 81 | - carparks[this.parkCode] = this; | ||
| 82 | - }); | ||
| 83 | - }); | ||
| 84 | - | ||
| 85 | - //车辆数据 | ||
| 86 | - var carsArray; | ||
| 87 | - $.get('/basic/cars?t=' + Math.random(), function (rs) { | ||
| 88 | - carsArray = rs; | ||
| 89 | - }); | ||
| 90 | - | ||
| 91 | - var getCarparkByCode = function (code) { | ||
| 92 | - return carparks[code]; | ||
| 93 | - }; | ||
| 94 | - | ||
| 95 | - //line code to name | ||
| 96 | - $.get('/basic/lineCode2Name', function (rs) { | ||
| 97 | - ep.emit('lineCode2Name', rs); | ||
| 98 | - }); | ||
| 99 | - | ||
| 100 | - //nbbm to device id | ||
| 101 | - $.get('/basic/nbbm2deviceId', function (rs) { | ||
| 102 | - ep.emit('nbbm2deviceId', rs); | ||
| 103 | - }); | ||
| 104 | - //nbbm to 车牌号 | ||
| 105 | - var nbbm2PlateMap; | ||
| 106 | - $.get('/basic/nbbm2PlateNo', function (rs) { | ||
| 107 | - nbbm2PlateMap = rs; | ||
| 108 | - }); | ||
| 109 | - | ||
| 110 | - //模拟图属性数据 | ||
| 111 | - gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | ||
| 112 | - var data = {}; | ||
| 113 | - $.each(rs.list, function () { | ||
| 114 | - this.hideStations = JSON.parse(this.hideStations); | ||
| 115 | - this.nicknames = JSON.parse(this.nicknames); | ||
| 116 | - data[this.lineCode] = this; | ||
| 117 | - }); | ||
| 118 | - ep.emit('svg_attrs', data); | ||
| 119 | - }); | ||
| 120 | - | ||
| 121 | - //站点和停车场历时、公里对照数据 | ||
| 122 | - var stat_park_data; | ||
| 123 | - var load_stat_park_data = function () { | ||
| 124 | - $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | ||
| 125 | - stat_park_data = rs; | ||
| 126 | - }); | ||
| 127 | - } | ||
| 128 | - load_stat_park_data(); | ||
| 129 | - | ||
| 130 | - function findLineByCodes(codeArr) { | ||
| 131 | - var rs = []; | ||
| 132 | - $.each(codeArr, function () { | ||
| 133 | - rs.push(codeToLine[this]); | ||
| 134 | - }); | ||
| 135 | - return rs; | ||
| 136 | - } | ||
| 137 | - | ||
| 138 | - var findCodeByLinename = function (name) { | ||
| 139 | - for (var code in lineCode2NameAll) { | ||
| 140 | - if (name == lineCode2NameAll[code]) | ||
| 141 | - return code; | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | - return null; | ||
| 145 | - }; | ||
| 146 | - | ||
| 147 | - var getLineInformation = function (lineCode) { | ||
| 148 | - return lineInformations[lineCode]; | ||
| 149 | - }; | ||
| 150 | - | ||
| 151 | - var stationRouteSort = function (a, b) { | ||
| 152 | - return a.stationRouteCode - b.stationRouteCode; | ||
| 153 | - }; | ||
| 154 | - | ||
| 155 | - return { | ||
| 156 | - activeLines: activeLines, | ||
| 157 | - line_idx: line_idx, | ||
| 158 | - codeToLine: codeToLine, | ||
| 159 | - nbbm2deviceMap: function () { | ||
| 160 | - return nbbm2deviceMap; | ||
| 161 | - }, | ||
| 162 | - device2nbbmMap: function () { | ||
| 163 | - return device2nbbmMap; | ||
| 164 | - }, | ||
| 165 | - getLineInformation: getLineInformation, | ||
| 166 | - allInformations: function () { | ||
| 167 | - return lineInformations; | ||
| 168 | - }, | ||
| 169 | - stationRoutes: function (lineCode) { | ||
| 170 | - return stationRoutes[lineCode] | ||
| 171 | - }, | ||
| 172 | - findLineByCodes: findLineByCodes, | ||
| 173 | - lineCode2NameAll: function () { | ||
| 174 | - return lineCode2NameAll | ||
| 175 | - }, | ||
| 176 | - allPersonnel: function () { | ||
| 177 | - return allPersonnel; | ||
| 178 | - }, | ||
| 179 | - findCodeByLinename: findCodeByLinename, | ||
| 180 | - getCarparkByCode: getCarparkByCode, | ||
| 181 | - getSvgAttr: function (lineCode) { | ||
| 182 | - return svgAttrs[lineCode]; | ||
| 183 | - }, | ||
| 184 | - setSvgAttr: function (attr) { | ||
| 185 | - attr.hideStations = JSON.parse(attr.hideStations); | ||
| 186 | - attr.nicknames = JSON.parse(attr.nicknames); | ||
| 187 | - svgAttrs[attr.lineCode] = attr; | ||
| 188 | - }, | ||
| 189 | - //是否是环线 | ||
| 190 | - isLoopLine: function (lineCode) { | ||
| 191 | - var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | ||
| 192 | - //下行只有2个站点 | ||
| 193 | - var len = data[0].length; | ||
| 194 | - if (len > 0 && data[1].length == 2) { | ||
| 195 | - var first = data[0][0], | ||
| 196 | - end = data[0][len - 1]; | ||
| 197 | - | ||
| 198 | - /*if(first.stationName != end.stationName) | ||
| 199 | - return false;*/ | ||
| 200 | - | ||
| 201 | - var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | ||
| 202 | - , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | ||
| 203 | - | ||
| 204 | - //并且上行起终点距离200米内 | ||
| 205 | - if (geolib.getDistance(fPoint, ePoint) < 200) { | ||
| 206 | - return true; | ||
| 207 | - } | ||
| 208 | - } | ||
| 209 | - | ||
| 210 | - return false; | ||
| 211 | - }, | ||
| 212 | - //刷新员工信息 | ||
| 213 | - refreshAllPersonnel: function (cb) { | ||
| 214 | - loadAllPersonnel(function (data) { | ||
| 215 | - allPersonnel = data; | ||
| 216 | - cb && cb(); | ||
| 217 | - }); | ||
| 218 | - }, | ||
| 219 | - nbbm2PlateMap: function () { | ||
| 220 | - return nbbm2PlateMap; | ||
| 221 | - }, | ||
| 222 | - carsArray: function () { | ||
| 223 | - return carsArray; | ||
| 224 | - }, | ||
| 225 | - simpleParksArray: function () { | ||
| 226 | - var map = {}; | ||
| 227 | - for(var code in carparks) | ||
| 228 | - map[code] = carparks[code].parkName; | ||
| 229 | - return map; | ||
| 230 | - }, | ||
| 231 | - remarksMapps: function () { | ||
| 232 | - return remarksMapps; | ||
| 233 | - }, | ||
| 234 | - get_stat_park_data: function () { | ||
| 235 | - return stat_park_data; | ||
| 236 | - }, | ||
| 237 | - reload_stat_park_data: function () { | ||
| 238 | - load_stat_park_data(); | ||
| 239 | - } | ||
| 240 | - }; | ||
| 241 | -})(); | 1 | +/* 基础数据管理模块 */ |
| 2 | + | ||
| 3 | +var gb_data_basic = (function () { | ||
| 4 | + | ||
| 5 | + var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | ||
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | ||
| 7 | + , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | ||
| 8 | + stationRoutes = routes; | ||
| 9 | + lineCode2NameAll = code2Name; | ||
| 10 | + lineInformations = informations; | ||
| 11 | + nbbm2deviceMap = nbbm2device; | ||
| 12 | + device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | ||
| 13 | + allPersonnel = all_personnel; | ||
| 14 | + svgAttrs = svgAttrMap; | ||
| 15 | + //gb_main_ep.emitLater('data-basic'); | ||
| 16 | + }); | ||
| 17 | + | ||
| 18 | + var storage = window.localStorage; | ||
| 19 | + //激活的线路 | ||
| 20 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | ||
| 21 | + //lineCode to line object | ||
| 22 | + var codeToLine = {}; | ||
| 23 | + //lineCode idx string | ||
| 24 | + var line_idx = (function () { | ||
| 25 | + var str = ''; | ||
| 26 | + for (var i = 0, item; item = activeLines[i++];) { | ||
| 27 | + str += (',' + item.lineCode); | ||
| 28 | + codeToLine[item.lineCode] = item; | ||
| 29 | + } | ||
| 30 | + return str.substr(1); | ||
| 31 | + })(); | ||
| 32 | + | ||
| 33 | + //站点路由 | ||
| 34 | + gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | ||
| 35 | + var list = rs.list;//JSON.parse(rs.list); | ||
| 36 | + var routeData = gb_common.groupBy(list, 'lineCode'); | ||
| 37 | + //排序 | ||
| 38 | + for (var lineCode in routeData) { | ||
| 39 | + routeData[lineCode].sort(stationRouteSort); | ||
| 40 | + } | ||
| 41 | + ep.emit('stationRoutes', routeData); | ||
| 42 | + }); | ||
| 43 | + | ||
| 44 | + //线路标准信息 | ||
| 45 | + gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | ||
| 46 | + var informations = {}; | ||
| 47 | + $.each(rs, function () { | ||
| 48 | + informations[this.line.lineCode] = this; | ||
| 49 | + delete this['line']; | ||
| 50 | + }); | ||
| 51 | + ep.emit('lineInformations', informations); | ||
| 52 | + }); | ||
| 53 | + | ||
| 54 | + //人员信息 | ||
| 55 | + loadAllPersonnel(function (data) { | ||
| 56 | + ep.emit('all_personnel', data); | ||
| 57 | + }); | ||
| 58 | + function loadAllPersonnel(cb) { | ||
| 59 | + $.get('/personnel/all_py', function (rs) { | ||
| 60 | + //转换成自动补全组件需要的数据 | ||
| 61 | + var data = [], code; | ||
| 62 | + for(var i =0, p; p = rs[i++];){ | ||
| 63 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | ||
| 64 | + data.push({ | ||
| 65 | + value: code + '/' + p.name, | ||
| 66 | + fullChars: p.fullChars.toUpperCase(), | ||
| 67 | + camelChars: p.camelChars.toUpperCase() | ||
| 68 | + }); | ||
| 69 | + } | ||
| 70 | + cb && cb(data); | ||
| 71 | + }); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + var carparks = {}; | ||
| 75 | + //停车场数据 | ||
| 76 | + gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | ||
| 77 | + rs.list.sort(function (a, b) { | ||
| 78 | + return a.parkName.localeCompare(b.parkName); | ||
| 79 | + }); | ||
| 80 | + $.each(rs.list, function () { | ||
| 81 | + carparks[this.parkCode] = this; | ||
| 82 | + }); | ||
| 83 | + }); | ||
| 84 | + | ||
| 85 | + //车辆数据 | ||
| 86 | + var carsArray; | ||
| 87 | + $.get('/basic/cars?t=' + Math.random(), function (rs) { | ||
| 88 | + carsArray = rs; | ||
| 89 | + }); | ||
| 90 | + | ||
| 91 | + var getCarparkByCode = function (code) { | ||
| 92 | + return carparks[code]; | ||
| 93 | + }; | ||
| 94 | + | ||
| 95 | + //line code to name | ||
| 96 | + $.get('/basic/lineCode2Name', function (rs) { | ||
| 97 | + ep.emit('lineCode2Name', rs); | ||
| 98 | + }); | ||
| 99 | + | ||
| 100 | + //nbbm to device id | ||
| 101 | + $.get('/basic/nbbm2deviceId', function (rs) { | ||
| 102 | + ep.emit('nbbm2deviceId', rs); | ||
| 103 | + }); | ||
| 104 | + //nbbm to 车牌号 | ||
| 105 | + var nbbm2PlateMap; | ||
| 106 | + $.get('/basic/nbbm2PlateNo', function (rs) { | ||
| 107 | + nbbm2PlateMap = rs; | ||
| 108 | + }); | ||
| 109 | + | ||
| 110 | + //模拟图属性数据 | ||
| 111 | + gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | ||
| 112 | + var data = {}; | ||
| 113 | + $.each(rs.list, function () { | ||
| 114 | + this.hideStations = JSON.parse(this.hideStations); | ||
| 115 | + this.nicknames = JSON.parse(this.nicknames); | ||
| 116 | + data[this.lineCode] = this; | ||
| 117 | + }); | ||
| 118 | + ep.emit('svg_attrs', data); | ||
| 119 | + }); | ||
| 120 | + | ||
| 121 | + //站点和停车场历时、公里对照数据 | ||
| 122 | + var stat_park_data; | ||
| 123 | + var load_stat_park_data = function () { | ||
| 124 | + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | ||
| 125 | + stat_park_data = rs; | ||
| 126 | + }); | ||
| 127 | + } | ||
| 128 | + load_stat_park_data(); | ||
| 129 | + | ||
| 130 | + function findLineByCodes(codeArr) { | ||
| 131 | + var rs = []; | ||
| 132 | + $.each(codeArr, function () { | ||
| 133 | + rs.push(codeToLine[this]); | ||
| 134 | + }); | ||
| 135 | + return rs; | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + var findCodeByLinename = function (name) { | ||
| 139 | + for (var code in lineCode2NameAll) { | ||
| 140 | + if (name == lineCode2NameAll[code]) | ||
| 141 | + return code; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + return null; | ||
| 145 | + }; | ||
| 146 | + | ||
| 147 | + var getLineInformation = function (lineCode) { | ||
| 148 | + return lineInformations[lineCode]; | ||
| 149 | + }; | ||
| 150 | + | ||
| 151 | + var stationRouteSort = function (a, b) { | ||
| 152 | + return a.stationRouteCode - b.stationRouteCode; | ||
| 153 | + }; | ||
| 154 | + | ||
| 155 | + return { | ||
| 156 | + activeLines: activeLines, | ||
| 157 | + line_idx: line_idx, | ||
| 158 | + codeToLine: codeToLine, | ||
| 159 | + nbbm2deviceMap: function () { | ||
| 160 | + return nbbm2deviceMap; | ||
| 161 | + }, | ||
| 162 | + device2nbbmMap: function () { | ||
| 163 | + return device2nbbmMap; | ||
| 164 | + }, | ||
| 165 | + getLineInformation: getLineInformation, | ||
| 166 | + allInformations: function () { | ||
| 167 | + return lineInformations; | ||
| 168 | + }, | ||
| 169 | + stationRoutes: function (lineCode) { | ||
| 170 | + return stationRoutes[lineCode] | ||
| 171 | + }, | ||
| 172 | + findLineByCodes: findLineByCodes, | ||
| 173 | + lineCode2NameAll: function () { | ||
| 174 | + return lineCode2NameAll | ||
| 175 | + }, | ||
| 176 | + allPersonnel: function () { | ||
| 177 | + return allPersonnel; | ||
| 178 | + }, | ||
| 179 | + findCodeByLinename: findCodeByLinename, | ||
| 180 | + getCarparkByCode: getCarparkByCode, | ||
| 181 | + getSvgAttr: function (lineCode) { | ||
| 182 | + return svgAttrs[lineCode]; | ||
| 183 | + }, | ||
| 184 | + setSvgAttr: function (attr) { | ||
| 185 | + attr.hideStations = JSON.parse(attr.hideStations); | ||
| 186 | + attr.nicknames = JSON.parse(attr.nicknames); | ||
| 187 | + svgAttrs[attr.lineCode] = attr; | ||
| 188 | + }, | ||
| 189 | + //是否是环线 | ||
| 190 | + isLoopLine: function (lineCode) { | ||
| 191 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | ||
| 192 | + //下行只有2个站点 | ||
| 193 | + var len = data[0].length; | ||
| 194 | + if (len > 0 && data[1].length == 2) { | ||
| 195 | + var first = data[0][0], | ||
| 196 | + end = data[0][len - 1]; | ||
| 197 | + | ||
| 198 | + /*if(first.stationName != end.stationName) | ||
| 199 | + return false;*/ | ||
| 200 | + | ||
| 201 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | ||
| 202 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | ||
| 203 | + | ||
| 204 | + //并且上行起终点距离200米内 | ||
| 205 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | ||
| 206 | + return true; | ||
| 207 | + } | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + return false; | ||
| 211 | + }, | ||
| 212 | + //刷新员工信息 | ||
| 213 | + refreshAllPersonnel: function (cb) { | ||
| 214 | + loadAllPersonnel(function (data) { | ||
| 215 | + allPersonnel = data; | ||
| 216 | + cb && cb(); | ||
| 217 | + }); | ||
| 218 | + }, | ||
| 219 | + nbbm2PlateMap: function () { | ||
| 220 | + return nbbm2PlateMap; | ||
| 221 | + }, | ||
| 222 | + carsArray: function () { | ||
| 223 | + return carsArray; | ||
| 224 | + }, | ||
| 225 | + simpleParksArray: function () { | ||
| 226 | + var map = {}; | ||
| 227 | + for(var code in carparks) | ||
| 228 | + map[code] = carparks[code].parkName; | ||
| 229 | + return map; | ||
| 230 | + }, | ||
| 231 | + remarksMapps: function () { | ||
| 232 | + return remarksMapps; | ||
| 233 | + }, | ||
| 234 | + get_stat_park_data: function () { | ||
| 235 | + return stat_park_data; | ||
| 236 | + }, | ||
| 237 | + reload_stat_park_data: function () { | ||
| 238 | + load_stat_park_data(); | ||
| 239 | + } | ||
| 240 | + }; | ||
| 241 | +})(); |
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_data_gps.js renamed to src/main/resources/static/real_control_v2/alone_page/map/alone_data_gps.js
| 1 | -/* gps 数据管理模块 */ | ||
| 2 | - | ||
| 3 | -var gb_data_gps = (function () { | ||
| 4 | - | ||
| 5 | - //fixed time refresh delay | ||
| 6 | - var delay = 1000 * 7; | ||
| 7 | - //deviceId ——> gps | ||
| 8 | - var realData = {}; | ||
| 9 | - //refresh after callback | ||
| 10 | - var refreshEventCallbacks = []; | ||
| 11 | - //register callback function | ||
| 12 | - var registerCallback = function (cb) { | ||
| 13 | - if (cb) | ||
| 14 | - refreshEventCallbacks.push(cb); | ||
| 15 | - }; | ||
| 16 | - | ||
| 17 | - var refresh = function (cb) { | ||
| 18 | - $.ajax({ | ||
| 19 | - url: '/gps/real/line', | ||
| 20 | - data: {lineCodes: gb_data_basic.line_idx}, | ||
| 21 | - dataType: 'json', | ||
| 22 | - success: function (rs) { | ||
| 23 | - //用定时的gps来检测session断开 | ||
| 24 | - if(rs.status && rs.status==407){ | ||
| 25 | - location.href = '/login.html'; | ||
| 26 | - return; | ||
| 27 | - } | ||
| 28 | - refreshData(rs); | ||
| 29 | - cb(); | ||
| 30 | - }, | ||
| 31 | - error: function (xr, t) { | ||
| 32 | - notify_err('刷新GPS失败,稍后重试' + t); | ||
| 33 | - cb(); | ||
| 34 | - } | ||
| 35 | - }); | ||
| 36 | - }; | ||
| 37 | - | ||
| 38 | - var refreshData = function (rs) { | ||
| 39 | - var old, addArr = [], | ||
| 40 | - upArr = [], | ||
| 41 | - upDownChange = []; | ||
| 42 | - | ||
| 43 | - var schArray; | ||
| 44 | - $.each(rs, function () { | ||
| 45 | - old = realData[this.deviceId]; | ||
| 46 | - if (old) { | ||
| 47 | - if (this.timestamp > old.timestamp) { | ||
| 48 | - if (old.upDown != this.upDown) | ||
| 49 | - upDownChange.push(this); | ||
| 50 | - else | ||
| 51 | - upArr.push(this); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - } else | ||
| 55 | - addArr.push(this); | ||
| 56 | - | ||
| 57 | - /* //班次信息 | ||
| 58 | - if (this.schId) { | ||
| 59 | - schArray = gb_schedule_table.findScheduleByLine(this.lineId); | ||
| 60 | - if (schArray) | ||
| 61 | - this.sch = schArray[this.schId]; | ||
| 62 | - }*/ | ||
| 63 | - | ||
| 64 | - //时间格式化 | ||
| 65 | - this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | ||
| 66 | - realData[this.deviceId] = this; | ||
| 67 | - }); | ||
| 68 | - | ||
| 69 | - //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | ||
| 70 | - //CCCallFuncN | ||
| 71 | - $.each(refreshEventCallbacks, function (i, cb) { | ||
| 72 | - cb(addArr, upArr, upDownChange); | ||
| 73 | - }); | ||
| 74 | - | ||
| 75 | - }; | ||
| 76 | - | ||
| 77 | - var startFixedTime; | ||
| 78 | - var fixedTimeRefresh = function () { | ||
| 79 | - if (startFixedTime) | ||
| 80 | - return; | ||
| 81 | - startFixedTime = true; | ||
| 82 | - | ||
| 83 | - (function () { | ||
| 84 | - var f = arguments.callee; | ||
| 85 | - refresh(function () { | ||
| 86 | - setTimeout(f, delay); | ||
| 87 | - }); | ||
| 88 | - })(); | ||
| 89 | - }; | ||
| 90 | - | ||
| 91 | - var gpsByLineCode = function (lineCode) { | ||
| 92 | - var rs = []; | ||
| 93 | - for (var device in realData) { | ||
| 94 | - if (realData[device].lineId == lineCode) | ||
| 95 | - rs.push(realData[device]); | ||
| 96 | - } | ||
| 97 | - return rs; | ||
| 98 | - }; | ||
| 99 | - | ||
| 100 | - var findOne = function (deviceId) { | ||
| 101 | - return realData[deviceId]; | ||
| 102 | - }; | ||
| 103 | - | ||
| 104 | - var findGpsByNbbm = function (nbbm) { | ||
| 105 | - return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | ||
| 106 | - }; | ||
| 107 | - | ||
| 108 | - /** | ||
| 109 | - * 设备掉线事件 | ||
| 110 | - */ | ||
| 111 | - var deviceOffline = function (gps) { | ||
| 112 | - $.each(offlineCallbacks, function (i, cb) { | ||
| 113 | - cb(gps); | ||
| 114 | - }); | ||
| 115 | - }; | ||
| 116 | - | ||
| 117 | - //注册掉线事件回调函数 | ||
| 118 | - var offlineCallbacks = []; | ||
| 119 | - var registerOfflineCb = function (cb) { | ||
| 120 | - if (cb) | ||
| 121 | - offlineCallbacks.push(cb); | ||
| 122 | - }; | ||
| 123 | - | ||
| 124 | - return { | ||
| 125 | - fixedTimeRefresh: fixedTimeRefresh, | ||
| 126 | - registerCallback: registerCallback, | ||
| 127 | - allGps: realData, | ||
| 128 | - gpsByLineCode: gpsByLineCode, | ||
| 129 | - findOne: findOne, | ||
| 130 | - findGpsByNbbm: findGpsByNbbm, | ||
| 131 | - deviceOffline: deviceOffline, | ||
| 132 | - registerOfflineCb: registerOfflineCb | ||
| 133 | - }; | ||
| 134 | -})(); | 1 | +/* gps 数据管理模块 */ |
| 2 | + | ||
| 3 | +var gb_data_gps = (function () { | ||
| 4 | + | ||
| 5 | + //fixed time refresh delay | ||
| 6 | + var delay = 1000 * 7; | ||
| 7 | + //deviceId ——> gps | ||
| 8 | + var realData = {}; | ||
| 9 | + //refresh after callback | ||
| 10 | + var refreshEventCallbacks = []; | ||
| 11 | + //register callback function | ||
| 12 | + var registerCallback = function (cb) { | ||
| 13 | + if (cb) | ||
| 14 | + refreshEventCallbacks.push(cb); | ||
| 15 | + }; | ||
| 16 | + | ||
| 17 | + var refresh = function (cb) { | ||
| 18 | + $.ajax({ | ||
| 19 | + url: '/gps/real/line', | ||
| 20 | + data: {lineCodes: gb_data_basic.line_idx}, | ||
| 21 | + dataType: 'json', | ||
| 22 | + success: function (rs) { | ||
| 23 | + //用定时的gps来检测session断开 | ||
| 24 | + if(rs.status && rs.status==407){ | ||
| 25 | + location.href = '/login.html'; | ||
| 26 | + return; | ||
| 27 | + } | ||
| 28 | + refreshData(rs); | ||
| 29 | + cb(); | ||
| 30 | + }, | ||
| 31 | + error: function (xr, t) { | ||
| 32 | + notify_err('刷新GPS失败,稍后重试' + t); | ||
| 33 | + cb(); | ||
| 34 | + } | ||
| 35 | + }); | ||
| 36 | + }; | ||
| 37 | + | ||
| 38 | + var refreshData = function (rs) { | ||
| 39 | + var old, addArr = [], | ||
| 40 | + upArr = [], | ||
| 41 | + upDownChange = []; | ||
| 42 | + | ||
| 43 | + var schArray; | ||
| 44 | + $.each(rs, function () { | ||
| 45 | + old = realData[this.deviceId]; | ||
| 46 | + if (old) { | ||
| 47 | + if (this.timestamp > old.timestamp) { | ||
| 48 | + if (old.upDown != this.upDown) | ||
| 49 | + upDownChange.push(this); | ||
| 50 | + else | ||
| 51 | + upArr.push(this); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + } else | ||
| 55 | + addArr.push(this); | ||
| 56 | + | ||
| 57 | + /* //班次信息 | ||
| 58 | + if (this.schId) { | ||
| 59 | + schArray = gb_schedule_table.findScheduleByLine(this.lineId); | ||
| 60 | + if (schArray) | ||
| 61 | + this.sch = schArray[this.schId]; | ||
| 62 | + }*/ | ||
| 63 | + | ||
| 64 | + //时间格式化 | ||
| 65 | + this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | ||
| 66 | + realData[this.deviceId] = this; | ||
| 67 | + }); | ||
| 68 | + | ||
| 69 | + //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | ||
| 70 | + //CCCallFuncN | ||
| 71 | + $.each(refreshEventCallbacks, function (i, cb) { | ||
| 72 | + cb(addArr, upArr, upDownChange); | ||
| 73 | + }); | ||
| 74 | + | ||
| 75 | + }; | ||
| 76 | + | ||
| 77 | + var startFixedTime; | ||
| 78 | + var fixedTimeRefresh = function () { | ||
| 79 | + if (startFixedTime) | ||
| 80 | + return; | ||
| 81 | + startFixedTime = true; | ||
| 82 | + | ||
| 83 | + (function () { | ||
| 84 | + var f = arguments.callee; | ||
| 85 | + refresh(function () { | ||
| 86 | + setTimeout(f, delay); | ||
| 87 | + }); | ||
| 88 | + })(); | ||
| 89 | + }; | ||
| 90 | + | ||
| 91 | + var gpsByLineCode = function (lineCode) { | ||
| 92 | + var rs = []; | ||
| 93 | + for (var device in realData) { | ||
| 94 | + if (realData[device].lineId == lineCode) | ||
| 95 | + rs.push(realData[device]); | ||
| 96 | + } | ||
| 97 | + return rs; | ||
| 98 | + }; | ||
| 99 | + | ||
| 100 | + var findOne = function (deviceId) { | ||
| 101 | + return realData[deviceId]; | ||
| 102 | + }; | ||
| 103 | + | ||
| 104 | + var findGpsByNbbm = function (nbbm) { | ||
| 105 | + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | ||
| 106 | + }; | ||
| 107 | + | ||
| 108 | + /** | ||
| 109 | + * 设备掉线事件 | ||
| 110 | + */ | ||
| 111 | + var deviceOffline = function (gps) { | ||
| 112 | + $.each(offlineCallbacks, function (i, cb) { | ||
| 113 | + cb(gps); | ||
| 114 | + }); | ||
| 115 | + }; | ||
| 116 | + | ||
| 117 | + //注册掉线事件回调函数 | ||
| 118 | + var offlineCallbacks = []; | ||
| 119 | + var registerOfflineCb = function (cb) { | ||
| 120 | + if (cb) | ||
| 121 | + offlineCallbacks.push(cb); | ||
| 122 | + }; | ||
| 123 | + | ||
| 124 | + return { | ||
| 125 | + fixedTimeRefresh: fixedTimeRefresh, | ||
| 126 | + registerCallback: registerCallback, | ||
| 127 | + allGps: realData, | ||
| 128 | + gpsByLineCode: gpsByLineCode, | ||
| 129 | + findOne: findOne, | ||
| 130 | + findGpsByNbbm: findGpsByNbbm, | ||
| 131 | + deviceOffline: deviceOffline, | ||
| 132 | + registerOfflineCb: registerOfflineCb | ||
| 133 | + }; | ||
| 134 | +})(); |
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_wrap.html renamed to src/main/resources/static/real_control_v2/alone_page/map/alone_wrap.html
| 1 | -<!DOCTYPE html> | ||
| 2 | -<html lang="zh-cn"> | ||
| 3 | - | ||
| 4 | -<head> | ||
| 5 | - <meta charset="UTF-8"> | ||
| 6 | - <title>地图监控 v2.0</title> | ||
| 7 | - <!-- uikit core style--> | ||
| 8 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" /> | ||
| 9 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" /> | ||
| 10 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" /> | ||
| 11 | - <link rel="stylesheet" | ||
| 12 | - href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" /> | ||
| 13 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" /> | ||
| 14 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" /> | ||
| 15 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" /> | ||
| 16 | - | ||
| 17 | - <!-- main style --> | ||
| 18 | - <link rel="stylesheet" href="/real_control_v2/css/main.css" /> | ||
| 19 | - <!-- north style --> | ||
| 20 | - <link rel="stylesheet" href="/real_control_v2/css/north.css" /> | ||
| 21 | - <!-- home style --> | ||
| 22 | - <link rel="stylesheet" href="/real_control_v2/css/home.css" /> | ||
| 23 | - | ||
| 24 | - <!-- js tree --> | ||
| 25 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" /> | ||
| 26 | - | ||
| 27 | - <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" /> | ||
| 28 | - <!-- perfect-scrollbar style --> | ||
| 29 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" /> | ||
| 30 | - <!-- layer 3.0.3 --> | ||
| 31 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" /> | ||
| 32 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" /> | ||
| 33 | - | ||
| 34 | - <!-- flatpickr --> | ||
| 35 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" > | ||
| 36 | - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" > | ||
| 37 | - | ||
| 38 | - <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" /> | ||
| 39 | -</head> | ||
| 40 | - | ||
| 41 | -<body> | ||
| 42 | -<div class="main-container" style="height: 100%;"> | ||
| 43 | -</div> | ||
| 44 | - | ||
| 45 | -<!-- 地图相关 --> | ||
| 46 | -<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | ||
| 47 | -<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | ||
| 48 | -<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | ||
| 49 | -<script src="/assets/js/TransGPS.js" merge="plugins"></script> | ||
| 50 | -<!-- 高德 --> | ||
| 51 | -<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script> | ||
| 52 | -<!-- jquery --> | ||
| 53 | -<script src="/real_control_v2/assets/js/jquery.min.js"></script> | ||
| 54 | -<!-- jquery actual --> | ||
| 55 | -<script src="/real_control_v2/assets/js/jquery.actual.min.js" ></script> | ||
| 56 | -<!-- moment.js 日期处理类库 --> | ||
| 57 | -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | ||
| 58 | -<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | ||
| 59 | - | ||
| 60 | -<!-- flatpickr --> | ||
| 61 | -<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js"></script> | ||
| 62 | -<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js"></script> | ||
| 63 | - | ||
| 64 | -<!-- perfect-scrollbar --> | ||
| 65 | -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script> | ||
| 66 | -<!-- common js --> | ||
| 67 | -<script src="/real_control_v2/js/common.js"></script> | ||
| 68 | -<!-- art-template 模版引擎 --> | ||
| 69 | -<script src="/assets/plugins/template.js" ></script> | ||
| 70 | -<!-- d3 --> | ||
| 71 | -<script src="/assets/js/d3.min.js"></script> | ||
| 72 | -<!-- EventProxy --> | ||
| 73 | -<script src="/assets/js/eventproxy.js"></script> | ||
| 74 | -<!-- uikit core --> | ||
| 75 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" ></script> | ||
| 76 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" ></script> | ||
| 77 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script> | ||
| 78 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script> | ||
| 79 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" ></script> | ||
| 80 | -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" ></script> | ||
| 81 | - | ||
| 82 | -<!-- js tree --> | ||
| 83 | -<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" ></script> | ||
| 84 | -<!-- layer 3.0.3 --> | ||
| 85 | -<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js"></script> | ||
| 86 | - | ||
| 87 | -<!-- 模态框扩展 --> | ||
| 88 | -<script src="/real_control_v2/js/modal_extend.js" ></script> | ||
| 89 | - | ||
| 90 | -<script src="/real_control_v2/mapmonitor/alone_page/alone_data_basic.js" ></script> | ||
| 91 | -<script src="/real_control_v2/mapmonitor/alone_page/alone_data_gps.js" ></script> | ||
| 92 | -<script src="/real_control_v2/js/utils/ct_table.js" ></script> | ||
| 93 | -<!-- jquery.serializejson JSON序列化插件 --> | ||
| 94 | -<script src="/assets/plugins/jquery.serializejson.js" ></script> | ||
| 95 | -<script> | ||
| 96 | - (function () { | ||
| 97 | - gb_data_gps.fixedTimeRefresh(); | ||
| 98 | - //嵌入地图页面 | ||
| 99 | - $('.main-container').load('/real_control_v2/mapmonitor/real.html', function () { | ||
| 100 | - $('.map-system-msg.flex-left').remove(); | ||
| 101 | - }); | ||
| 102 | - })(); | ||
| 103 | -</script> | ||
| 104 | -</body> | ||
| 105 | - | ||
| 106 | -</html> | 1 | +<!DOCTYPE html> |
| 2 | +<html lang="zh-cn"> | ||
| 3 | + | ||
| 4 | +<head> | ||
| 5 | + <meta charset="UTF-8"> | ||
| 6 | + <title>地图监控 v2.0</title> | ||
| 7 | + <!-- uikit core style--> | ||
| 8 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" /> | ||
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" merge="plugins"/> | ||
| 10 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" merge="plugins"/> | ||
| 11 | + <link rel="stylesheet" | ||
| 12 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | ||
| 13 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" merge="plugins"/> | ||
| 14 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" merge="plugins"/> | ||
| 15 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" merge="plugins"/> | ||
| 16 | + | ||
| 17 | + <!-- main style --> | ||
| 18 | + <link rel="stylesheet" href="/real_control_v2/css/main.css" /> | ||
| 19 | + <!-- north style --> | ||
| 20 | + <link rel="stylesheet" href="/real_control_v2/css/north.css" merge="custom_style"/> | ||
| 21 | + <!-- home style --> | ||
| 22 | + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | ||
| 23 | + | ||
| 24 | + <!-- js tree --> | ||
| 25 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/> | ||
| 26 | + | ||
| 27 | + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | ||
| 28 | + <!-- perfect-scrollbar style --> | ||
| 29 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | ||
| 30 | + <!-- layer 3.0.3 --> | ||
| 31 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | ||
| 32 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | ||
| 33 | + | ||
| 34 | + <!-- flatpickr --> | ||
| 35 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" merge="plugins"/> | ||
| 36 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" merge="plugins"/> | ||
| 37 | + | ||
| 38 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | ||
| 39 | +</head> | ||
| 40 | + | ||
| 41 | +<body> | ||
| 42 | +<div class="main-container" style="height: 100%;"> | ||
| 43 | +</div> | ||
| 44 | + | ||
| 45 | +<!-- 地图相关 --> | ||
| 46 | +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | ||
| 47 | +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | ||
| 48 | +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | ||
| 49 | +<script src="/assets/js/TransGPS.js" merge="plugins"></script> | ||
| 50 | +<!-- 高德 --> | ||
| 51 | +<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script> | ||
| 52 | +<!-- jquery --> | ||
| 53 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | ||
| 54 | +<!-- jquery actual --> | ||
| 55 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | ||
| 56 | +<!-- moment.js 日期处理类库 --> | ||
| 57 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | ||
| 58 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | ||
| 59 | + | ||
| 60 | +<!-- flatpickr --> | ||
| 61 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | ||
| 62 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | ||
| 63 | + | ||
| 64 | +<!-- perfect-scrollbar --> | ||
| 65 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | ||
| 66 | +<!-- common js --> | ||
| 67 | +<script src="/real_control_v2/js/common.js"></script> | ||
| 68 | +<!-- art-template 模版引擎 --> | ||
| 69 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | ||
| 70 | +<!-- d3 --> | ||
| 71 | +<script src="/assets/js/d3.min.js"></script> | ||
| 72 | +<!-- EventProxy --> | ||
| 73 | +<script src="/assets/js/eventproxy.js"></script> | ||
| 74 | +<!-- uikit core --> | ||
| 75 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | ||
| 76 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | ||
| 77 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | ||
| 78 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js" merge="uikit_js"></script> | ||
| 79 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" merge="uikit_js"></script> | ||
| 80 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | ||
| 81 | + | ||
| 82 | +<!-- js tree --> | ||
| 83 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins" ></script> | ||
| 84 | +<!-- layer 3.0.3 --> | ||
| 85 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | ||
| 86 | + | ||
| 87 | +<!-- 模态框扩展 --> | ||
| 88 | +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | ||
| 89 | + | ||
| 90 | +<script src="/real_control_v2/alone_page/map/alone_data_basic.js" merge="custom_js"></script> | ||
| 91 | +<script src="/real_control_v2/alone_page/map/alone_data_gps.js" merge="custom_js"></script> | ||
| 92 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | ||
| 93 | +<!-- jquery.serializejson JSON序列化插件 --> | ||
| 94 | +<script src="/assets/plugins/jquery.serializejson.js" merge="uikit_js"></script> | ||
| 95 | +<script> | ||
| 96 | + (function () { | ||
| 97 | + gb_data_gps.fixedTimeRefresh(); | ||
| 98 | + //嵌入地图页面 | ||
| 99 | + $('.main-container').load('/real_control_v2/mapmonitor/real.html', function () { | ||
| 100 | + $('.map-system-msg.flex-left').remove(); | ||
| 101 | + }); | ||
| 102 | + })(); | ||
| 103 | +</script> | ||
| 104 | +</body> | ||
| 105 | + | ||
| 106 | +</html> |
src/main/resources/static/real_control_v2/css/home.css
| @@ -309,4 +309,20 @@ span.signal-state-speed-limit{ | @@ -309,4 +309,20 @@ span.signal-state-speed-limit{ | ||
| 309 | } | 309 | } |
| 310 | .uk-tab>li:nth-child(n+2)>a{ | 310 | .uk-tab>li:nth-child(n+2)>a{ |
| 311 | margin-left: 0 !important; | 311 | margin-left: 0 !important; |
| 312 | +} | ||
| 313 | + | ||
| 314 | +.home_alone_page{ | ||
| 315 | + cursor: pointer; | ||
| 316 | +} | ||
| 317 | + | ||
| 318 | +#send-phrase-modal .tools, | ||
| 319 | +#send-phrase-multi-modal .tools{ | ||
| 320 | + display: inline-block; | ||
| 321 | + margin-left: 5px; | ||
| 322 | +} | ||
| 323 | + | ||
| 324 | +#send-phrase-modal .tools>span, | ||
| 325 | +#send-phrase-multi-modal .tools>span{ | ||
| 326 | + cursor: pointer; | ||
| 327 | + margin-left: 12px; | ||
| 312 | } | 328 | } |
| 313 | \ No newline at end of file | 329 | \ No newline at end of file |
src/main/resources/static/real_control_v2/css/main.css
| @@ -1582,8 +1582,16 @@ ul.left_tabs_lg li{ | @@ -1582,8 +1582,16 @@ ul.left_tabs_lg li{ | ||
| 1582 | color: #929292; | 1582 | color: #929292; |
| 1583 | } | 1583 | } |
| 1584 | 1584 | ||
| 1585 | -#all-devices-modal .search-form input{ | ||
| 1586 | - width: 160px; | 1585 | +#all-devices-modal .search-form input[type=text]{ |
| 1586 | + width: 100px; | ||
| 1587 | +} | ||
| 1588 | + | ||
| 1589 | +#all-devices-modal .auto-refresh{ | ||
| 1590 | + vertical-align: middle;margin-left: 5px;color: grey; | ||
| 1591 | +} | ||
| 1592 | + | ||
| 1593 | +#all-devices-modal .auto-refresh.active{ | ||
| 1594 | + color: #405dff; | ||
| 1587 | } | 1595 | } |
| 1588 | 1596 | ||
| 1589 | #all-devices-modal .uk-margin-small-top { | 1597 | #all-devices-modal .uk-margin-small-top { |
src/main/resources/static/real_control_v2/css/north.css
| @@ -490,4 +490,14 @@ | @@ -490,4 +490,14 @@ | ||
| 490 | .ct-badge.ct-badge-LSBCTZ:hover{ | 490 | .ct-badge.ct-badge-LSBCTZ:hover{ |
| 491 | background: red; | 491 | background: red; |
| 492 | color: #fff; | 492 | color: #fff; |
| 493 | +} | ||
| 494 | + | ||
| 495 | +span.sm-red{ | ||
| 496 | + font-size: 12px; | ||
| 497 | + color: #ff5454; | ||
| 498 | +} | ||
| 499 | + | ||
| 500 | +span.sm-grey{ | ||
| 501 | + font-size: 12px; | ||
| 502 | + color: grey; | ||
| 493 | } | 503 | } |
| 494 | \ No newline at end of file | 504 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/home/context_menu.html
| @@ -11,11 +11,15 @@ | @@ -11,11 +11,15 @@ | ||
| 11 | <input type="hidden" value="{{nbbm}}" name="nbbm" /> | 11 | <input type="hidden" value="{{nbbm}}" name="nbbm" /> |
| 12 | <div class="uk-form-row"> | 12 | <div class="uk-form-row"> |
| 13 | <select style="width: 170px;" class="common_phrase_sel"> | 13 | <select style="width: 170px;" class="common_phrase_sel"> |
| 14 | - <option value="">------ 常用短语 -------</option> | ||
| 15 | - <option value="天气异常,请小心驾驶">天气异常,请小心驾驶</option> | ||
| 16 | - <option value="请适当减速慢行,保持最佳行车间距">请适当减速慢行,保持最佳行车间距</option> | ||
| 17 | - <option value="请准点执行班次任务">请准点执行班次任务</option> | ||
| 18 | </select> | 14 | </select> |
| 15 | + <div class="tools" > | ||
| 16 | + <span data-uk-tooltip title="添加到常用短语" class="add_frequent_phrases"> | ||
| 17 | + <i class="uk-icon-plus"></i> | ||
| 18 | + </span> | ||
| 19 | + <span data-uk-tooltip title="删除这条常用短语" class="minus_frequent_phrases"> | ||
| 20 | + <i class="uk-icon-minus"></i> | ||
| 21 | + </span> | ||
| 22 | + </div> | ||
| 19 | </div> | 23 | </div> |
| 20 | <div class="uk-form-row"> | 24 | <div class="uk-form-row"> |
| 21 | <textarea cols="30" rows="5" name="text" data-fv-notempty data-fv-stringlength="true" data-fv-stringlength-max="50" placeholder="输入短语,不要超过50 个字符" style="margin: 0px; width: 100%; height: 110px;"></textarea> | 25 | <textarea cols="30" rows="5" name="text" data-fv-notempty data-fv-stringlength="true" data-fv-stringlength-max="50" placeholder="输入短语,不要超过50 个字符" style="margin: 0px; width: 100%; height: 110px;"></textarea> |
| @@ -43,9 +47,16 @@ | @@ -43,9 +47,16 @@ | ||
| 43 | <div class="uk-width-4-6" style="border-left: 1px solid #dddddd;"> | 47 | <div class="uk-width-4-6" style="border-left: 1px solid #dddddd;"> |
| 44 | <form class="uk-form fixed-tool"> | 48 | <form class="uk-form fixed-tool"> |
| 45 | <div class="uk-form-row"> | 49 | <div class="uk-form-row"> |
| 46 | - <select> | ||
| 47 | - <option value="">------ 常用短语 -------</option> | ||
| 48 | - </select> | 50 | + <select style="width: 170px;" class="common_phrase_sel"> |
| 51 | + </select> | ||
| 52 | + <div class="tools" > | ||
| 53 | + <span data-uk-tooltip title="添加到常用短语" class="add_frequent_phrases"> | ||
| 54 | + <i class="uk-icon-plus"></i> | ||
| 55 | + </span> | ||
| 56 | + <span data-uk-tooltip title="删除这条常用短语" class="minus_frequent_phrases"> | ||
| 57 | + <i class="uk-icon-minus"></i> | ||
| 58 | + </span> | ||
| 59 | + </div> | ||
| 49 | </div> | 60 | </div> |
| 50 | <br /> | 61 | <br /> |
| 51 | <div class="uk-form-row"> | 62 | <div class="uk-form-row"> |
src/main/resources/static/real_control_v2/fragments/home/layout.html
| @@ -13,8 +13,12 @@ | @@ -13,8 +13,12 @@ | ||
| 13 | <li {{if i==0}}class="uk-active"{{/if}}><a> {{t}}</a></li> | 13 | <li {{if i==0}}class="uk-active"{{/if}}><a> {{t}}</a></li> |
| 14 | {{/each}} | 14 | {{/each}} |
| 15 | </ul> | 15 | </ul> |
| 16 | - <div class="home-rb-explain-icon uk-icon-hover"> | ||
| 17 | - <i class="uk-icon-question-circle"></i> | 16 | + <div class="home-rb-explain-icon "> |
| 17 | + <a href="/real_control_v2/alone_page/home/home_wrap.html" target="_blank"> | ||
| 18 | + <i class="uk-icon-send-o home_alone_page uk-icon-hover" ></i> | ||
| 19 | + </a> | ||
| 20 | + | ||
| 21 | + <i class="uk-icon-question-circle uk-icon-hover"></i> | ||
| 18 | </div> | 22 | </div> |
| 19 | </div> | 23 | </div> |
| 20 | </script> | 24 | </script> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/bc_type_major.html
| @@ -59,7 +59,7 @@ | @@ -59,7 +59,7 @@ | ||
| 59 | <script> | 59 | <script> |
| 60 | (function () { | 60 | (function () { |
| 61 | var modal = '#bctype-major-modal' | 61 | var modal = '#bctype-major-modal' |
| 62 | - , sch, stationRoutes, parentModal; | 62 | + , sch, stationRoutes, parentModal, _dfsj; |
| 63 | 63 | ||
| 64 | $('[name=sendDirective]', modal).on('click', function () { | 64 | $('[name=sendDirective]', modal).on('click', function () { |
| 65 | if ($(this)[0].checked) | 65 | if ($(this)[0].checked) |
| @@ -134,6 +134,8 @@ | @@ -134,6 +134,8 @@ | ||
| 134 | e.stopPropagation(); | 134 | e.stopPropagation(); |
| 135 | sch = data.sch; | 135 | sch = data.sch; |
| 136 | parentModal = data.parentModal; | 136 | parentModal = data.parentModal; |
| 137 | + if(data._dfsj) | ||
| 138 | + sch.dfsj = data._dfsj; | ||
| 137 | 139 | ||
| 138 | //submit | 140 | //submit |
| 139 | var f = $('form', modal).formValidation(gb_form_validation_opts); | 141 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/bc_type_venting.html
| @@ -131,6 +131,8 @@ | @@ -131,6 +131,8 @@ | ||
| 131 | e.stopPropagation(); | 131 | e.stopPropagation(); |
| 132 | sch = data.sch; | 132 | sch = data.sch; |
| 133 | parentModal = data.parentModal; | 133 | parentModal = data.parentModal; |
| 134 | + if(data._dfsj) | ||
| 135 | + sch.dfsj = data._dfsj; | ||
| 134 | 136 | ||
| 135 | //submit | 137 | //submit |
| 136 | var f = $('form', modal).formValidation(gb_form_validation_opts); | 138 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
| @@ -185,7 +185,7 @@ | @@ -185,7 +185,7 @@ | ||
| 185 | $(document.body).append(htmlStr); | 185 | $(document.body).append(htmlStr); |
| 186 | 186 | ||
| 187 | UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); | 187 | UIkit.modal(detailModal, {bgclose: true,modal:false}).show(); |
| 188 | - $(detailModal).trigger('init', {sch: sch, parentModal: modal}); | 188 | + $(detailModal).trigger('init', {sch: sch, parentModal: modal, _dfsj: $('[name=dfsj]', modal).val()}); |
| 189 | }) | 189 | }) |
| 190 | }); | 190 | }); |
| 191 | }); | 191 | }); |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_in_out.html
| @@ -169,7 +169,7 @@ | @@ -169,7 +169,7 @@ | ||
| 169 | half_form.addClass('repeat_main destroy_form'); | 169 | half_form.addClass('repeat_main destroy_form'); |
| 170 | //字典转换 | 170 | //字典转换 |
| 171 | dictionaryUtils.transformDom($('.nt-dictionary', half_form)); | 171 | dictionaryUtils.transformDom($('.nt-dictionary', half_form)); |
| 172 | - sf.after(half_form); | 172 | + inf.after(half_form); |
| 173 | 173 | ||
| 174 | 174 | ||
| 175 | //班次类型切换 | 175 | //班次类型切换 |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
| @@ -108,8 +108,8 @@ | @@ -108,8 +108,8 @@ | ||
| 108 | {{/if}} | 108 | {{/if}} |
| 109 | </dd> | 109 | </dd> |
| 110 | <dd>{{sch.clZbh}}</dd> | 110 | <dd>{{sch.clZbh}}</dd> |
| 111 | - <dd>{{sch.jGh}}/{{sch.jName}}</dd> | ||
| 112 | - <dd>{{sch.sGh}}/{{sch.sName}}</dd> | 111 | + <dd data-old="{{sch.jGh}}/{{sch.jName}}">{{sch.jGh}}/{{sch.jName}}</dd> |
| 112 | + <dd data-old="{{sch.sGh}}/{{sch.sName}}">{{sch.sGh}}/{{sch.sName}}</dd> | ||
| 113 | <dd> | 113 | <dd> |
| 114 | {{if sch.status==2}} | 114 | {{if sch.status==2}} |
| 115 | <span class="ct_zt_yzx">已执行</span> | 115 | <span class="ct_zt_yzx">已执行</span> |
| @@ -160,20 +160,26 @@ | @@ -160,20 +160,26 @@ | ||
| 160 | $('.tzrc-table-wrap', modal).perfectScrollbar('update'); | 160 | $('.tzrc-table-wrap', modal).perfectScrollbar('update'); |
| 161 | }); | 161 | }); |
| 162 | 162 | ||
| 163 | + | ||
| 164 | + writeSch2Form(sch); | ||
| 163 | $(modal).on('click', '.sch-tzrc-table .ct_table_body dl', function () { | 165 | $(modal).on('click', '.sch-tzrc-table .ct_table_body dl', function () { |
| 164 | var cbox = $('input[type=checkbox]',this)[0]; | 166 | var cbox = $('input[type=checkbox]',this)[0]; |
| 165 | //var active = $(); | 167 | //var active = $(); |
| 166 | if(!$(this).hasClass('active')){ | 168 | if(!$(this).hasClass('active')){ |
| 167 | $(this).addClass('active'); | 169 | $(this).addClass('active'); |
| 168 | cbox.checked = true; | 170 | cbox.checked = true; |
| 169 | - var lineCode = $('[name=lineSelect]', modal).val(); | ||
| 170 | - var sch = gb_schedule_table.findScheduleByLine(lineCode)[$(this).data('id')]; | ||
| 171 | - | ||
| 172 | - writeSch2Form(sch); | 171 | + //var lineCode = $('[name=lineSelect]', modal).val(); |
| 172 | + //var sch = gb_schedule_table.findScheduleByLine(lineCode)[$(this).data('id')]; | ||
| 173 | + renderCell(); | ||
| 173 | } | 174 | } |
| 174 | else{ | 175 | else{ |
| 175 | $(this).removeClass('active'); | 176 | $(this).removeClass('active'); |
| 176 | cbox.checked = false; | 177 | cbox.checked = false; |
| 178 | + //$(this).find('dd[data-old]').text() | ||
| 179 | + var $jsyCell = $($($(this).find('dd')[2])); | ||
| 180 | + var $spyCell = $($($(this).find('dd')[3])); | ||
| 181 | + $jsyCell.text($jsyCell.data('old')); | ||
| 182 | + $spyCell.text($spyCell.data('old')); | ||
| 177 | } | 183 | } |
| 178 | }); | 184 | }); |
| 179 | 185 | ||
| @@ -236,8 +242,34 @@ | @@ -236,8 +242,34 @@ | ||
| 236 | }); | 242 | }); |
| 237 | return false; | 243 | return false; |
| 238 | }); | 244 | }); |
| 245 | + | ||
| 246 | + /** | ||
| 247 | + * 驾驶员/售票员文本框改变事件 | ||
| 248 | + */ | ||
| 249 | + var renderRunFlag; | ||
| 250 | + $('input[name=jsy],input[name=spy]', modal).on('input change', function () { | ||
| 251 | + if(renderRunFlag) | ||
| 252 | + return; | ||
| 253 | + renderRunFlag = true; | ||
| 254 | + setTimeout(function () { | ||
| 255 | + renderCell(); | ||
| 256 | + renderRunFlag = false; | ||
| 257 | + }, 200); | ||
| 258 | + }); | ||
| 239 | }); | 259 | }); |
| 240 | 260 | ||
| 261 | + | ||
| 262 | + function renderCell() { | ||
| 263 | + var jsy = $('input[name=jsy]', modal).val(); | ||
| 264 | + var spy = $('input[name=spy]', modal).val(); | ||
| 265 | + $('.sch-tzrc-table .ct_table_body>dl.active').each(function () { | ||
| 266 | + var jsyCell = $(this).find('dd')[2]; | ||
| 267 | + var spyCell = $(this).find('dd')[3]; | ||
| 268 | + $(jsyCell).text(jsy); | ||
| 269 | + $(spyCell).text(spy); | ||
| 270 | + }); | ||
| 271 | + } | ||
| 272 | + | ||
| 241 | function writeSch2Form(sch) { | 273 | function writeSch2Form(sch) { |
| 242 | var f = $('.tzrc_form', modal); | 274 | var f = $('.tzrc_form', modal); |
| 243 | $('input[name=clZbh]', f).val(sch.clZbh).trigger('input'); | 275 | $('input[name=clZbh]', f).val(sch.clZbh).trigger('input'); |
src/main/resources/static/real_control_v2/fragments/north/nav/all_devices.html
| @@ -7,19 +7,13 @@ | @@ -7,19 +7,13 @@ | ||
| 7 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> | 7 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> |
| 8 | <form class="uk-form search-form"> | 8 | <form class="uk-form search-form"> |
| 9 | <fieldset data-uk-margin> | 9 | <fieldset data-uk-margin> |
| 10 | - <!--<legend> | ||
| 11 | - 数据检索 | ||
| 12 | - <!– <div class="legend-tools"> | ||
| 13 | - <a class="uk-icon-small uk-icon-hover uk-icon-file-excel-o" data-uk-tooltip title="导出excel"></a> | ||
| 14 | - </div> –> | ||
| 15 | - </legend>--> | ||
| 16 | <span class="horizontal-field">线路</span> | 10 | <span class="horizontal-field">线路</span> |
| 17 | <div class="uk-autocomplete uk-form autocomplete-line" > | 11 | <div class="uk-autocomplete uk-form autocomplete-line" > |
| 18 | <input type="text" name="lineId" placeholder="线路"> | 12 | <input type="text" name="lineId" placeholder="线路"> |
| 19 | </div> | 13 | </div> |
| 20 | <span class="horizontal-field">车辆</span> | 14 | <span class="horizontal-field">车辆</span> |
| 21 | <div class="uk-autocomplete uk-form autocomplete-cars" > | 15 | <div class="uk-autocomplete uk-form autocomplete-cars" > |
| 22 | - <input type="text" name="nbbm" placeholder="车辆自编号"> | 16 | + <input type="text" name="nbbm" placeholder="自编号"> |
| 23 | </div> | 17 | </div> |
| 24 | <span class="horizontal-field">设备号</span> | 18 | <span class="horizontal-field">设备号</span> |
| 25 | <div class="uk-autocomplete uk-form autocomplete-device" > | 19 | <div class="uk-autocomplete uk-form autocomplete-device" > |
| @@ -35,9 +29,23 @@ | @@ -35,9 +29,23 @@ | ||
| 35 | </div> | 29 | </div> |
| 36 | <span class="horizontal-field">程序版本</span> | 30 | <span class="horizontal-field">程序版本</span> |
| 37 | <div class="uk-autocomplete uk-form " > | 31 | <div class="uk-autocomplete uk-form " > |
| 38 | - <input type="text" name="version" placeholder="程序版本" style="width: 110px;"> | 32 | + <input type="text" name="version" placeholder="版本号" style="width: 60px;"> |
| 39 | </div> | 33 | </div> |
| 40 | - <button class="uk-button">检索</button> | 34 | + <span class="horizontal-field">状态</span> |
| 35 | + <div class="uk-autocomplete uk-form " > | ||
| 36 | + <select name="abnormalStatus"> | ||
| 37 | + <option value="">全部</option> | ||
| 38 | + <option value="outBounds">越界</option> | ||
| 39 | + <option value="overspeed">超速</option> | ||
| 40 | + <option value="offline">离线</option> | ||
| 41 | + <option value="gps-offline">gps 0,0</option> | ||
| 42 | + </select> | ||
| 43 | + </div> | ||
| 44 | + <button class="uk-button search-btn" title="只支持后模糊">检索</button> | ||
| 45 | + <label class="auto-refresh" > | ||
| 46 | + <input type="checkbox" value="1" name="schCBox" class="i-cbox"> | ||
| 47 | + 自动刷新 | ||
| 48 | + </label> | ||
| 41 | </fieldset> | 49 | </fieldset> |
| 42 | </form> | 50 | </form> |
| 43 | </div> | 51 | </div> |
| @@ -49,10 +57,10 @@ | @@ -49,10 +57,10 @@ | ||
| 49 | <th style="width: 14%;">站点</th> | 57 | <th style="width: 14%;">站点</th> |
| 50 | <th style="width: 11%;">车辆</th> | 58 | <th style="width: 11%;">车辆</th> |
| 51 | <th style="width: 11%;">设备号</th> | 59 | <th style="width: 11%;">设备号</th> |
| 52 | - <th style="width: 9%;">速度</th> | ||
| 53 | <th style="width: 9%;">走向/营运</th> | 60 | <th style="width: 9%;">走向/营运</th> |
| 54 | <th style="width: 10%;">程序版本</th> | 61 | <th style="width: 10%;">程序版本</th> |
| 55 | <th>最后GPS时间</th> | 62 | <th>最后GPS时间</th> |
| 63 | + <th style="width: 9%;">状态</th> | ||
| 56 | <th style="width: 8%;">来源</th> | 64 | <th style="width: 8%;">来源</th> |
| 57 | </tr> | 65 | </tr> |
| 58 | </thead> | 66 | </thead> |
| @@ -72,17 +80,31 @@ | @@ -72,17 +80,31 @@ | ||
| 72 | <td>{{gps.stationName}}</td> | 80 | <td>{{gps.stationName}}</td> |
| 73 | <td>{{gps.nbbm}}</td> | 81 | <td>{{gps.nbbm}}</td> |
| 74 | <td>{{gps.deviceId}}</td> | 82 | <td>{{gps.deviceId}}</td> |
| 75 | - <td>{{gps.speed}}</td> | ||
| 76 | <td>{{gps.upDown}}/{{gps.state}}</td> | 83 | <td>{{gps.upDown}}/{{gps.state}}</td> |
| 77 | <td>{{gps.version}}</td> | 84 | <td>{{gps.version}}</td> |
| 78 | <td>{{gps.timeStr}}</td> | 85 | <td>{{gps.timeStr}}</td> |
| 79 | <td> | 86 | <td> |
| 87 | + {{if gps.valid==1}} | ||
| 88 | + <span class="sm-red">invalid(-1</span> | ||
| 89 | + {{else if gps.abnormalStatus=='outBounds'}} | ||
| 90 | + <span class="sm-red" title="越界距离(米) {{gps.outOfBoundDistance}}">越界</span> | ||
| 91 | + {{else if gps.abnormalStatus=='overspeed'}} | ||
| 92 | + <span class="sm-red">超速({{gps.speed}})</span> | ||
| 93 | + {{else if gps.abnormalStatus=='gps-offline'}} | ||
| 94 | + <span class="sm-red">GPS (0,0)</span> | ||
| 95 | + {{else if gps.abnormalStatus=='offline'}} | ||
| 96 | + <span>离线</span> | ||
| 97 | + {{else}} | ||
| 98 | + ... | ||
| 99 | + {{/if}} | ||
| 100 | + </td> | ||
| 101 | + <td> | ||
| 80 | {{if gps.source==1}} | 102 | {{if gps.source==1}} |
| 81 | <span style="color: #1e1ef5;" title="已切换至新网关">网关</span> | 103 | <span style="color: #1e1ef5;" title="已切换至新网关">网关</span> |
| 82 | {{else if gps.source==0}} | 104 | {{else if gps.source==0}} |
| 83 | <span style="color: #8e8e8e;" title="转接的数据,无法下发指令">转发</span> | 105 | <span style="color: #8e8e8e;" title="转接的数据,无法下发指令">转发</span> |
| 84 | {{else}} | 106 | {{else}} |
| 85 | - <span>未知</span> | 107 | + <span class="sm-grey">未知</span> |
| 86 | {{/if}} | 108 | {{/if}} |
| 87 | </td> | 109 | </td> |
| 88 | </tr> | 110 | </tr> |
| @@ -148,7 +170,7 @@ | @@ -148,7 +170,7 @@ | ||
| 148 | query(); | 170 | query(); |
| 149 | }); | 171 | }); |
| 150 | 172 | ||
| 151 | - var query = function() { | 173 | + var query = function(cb) { |
| 152 | var data = form.serializeJSON(); | 174 | var data = form.serializeJSON(); |
| 153 | data.page = page; | 175 | data.page = page; |
| 154 | data.size = pageSize; | 176 | data.size = pageSize; |
| @@ -173,9 +195,75 @@ | @@ -173,9 +195,75 @@ | ||
| 173 | //pagination | 195 | //pagination |
| 174 | if (resetPagination) | 196 | if (resetPagination) |
| 175 | pagination(rs.totalPages + 1, rs.page); | 197 | pagination(rs.totalPages + 1, rs.page); |
| 198 | + | ||
| 199 | + cb && cb(); | ||
| 176 | }) | 200 | }) |
| 177 | }; | 201 | }; |
| 178 | 202 | ||
| 203 | + /** | ||
| 204 | + * 自动刷新 | ||
| 205 | + */ | ||
| 206 | + $('.auto-refresh', modal).on('click', function () { | ||
| 207 | + var checked = $('input[type=checkbox]',this)[0].checked, | ||
| 208 | + $sub_btn = $('.search-btn', form); | ||
| 209 | + if(checked){ | ||
| 210 | + $(this).addClass('active'); | ||
| 211 | + $sub_btn.attr('disabled', 'disabled'); | ||
| 212 | + auto_refresh.start(); | ||
| 213 | + } | ||
| 214 | + else{ | ||
| 215 | + $(this).removeClass('active'); | ||
| 216 | + $sub_btn.removeAttr('disabled'); | ||
| 217 | + auto_refresh.stop(); | ||
| 218 | + } | ||
| 219 | + }); | ||
| 220 | + | ||
| 221 | + var auto_refresh = (function () { | ||
| 222 | + var timer=null; | ||
| 223 | + var span = $('.auto-refresh', modal).append('<span class="no"></span>').find('span.no'); | ||
| 224 | + var space = 10; | ||
| 225 | + var start = function () { | ||
| 226 | + | ||
| 227 | + (function () { | ||
| 228 | + var f = arguments.callee; | ||
| 229 | + run(); | ||
| 230 | + if(space == 0){ | ||
| 231 | + space = 10; | ||
| 232 | + | ||
| 233 | + resetPagination = true; | ||
| 234 | + page=0; | ||
| 235 | + query(function () { | ||
| 236 | + timer = setTimeout(f, 1000); | ||
| 237 | + }); | ||
| 238 | + } | ||
| 239 | + else{ | ||
| 240 | + timer = setTimeout(f, 1000); | ||
| 241 | + } | ||
| 242 | + })(); | ||
| 243 | + }; | ||
| 244 | + | ||
| 245 | + var stop = function () { | ||
| 246 | + clearTimeout(timer); | ||
| 247 | + timer = null; | ||
| 248 | + space = 10; | ||
| 249 | + span.text(''); | ||
| 250 | + }; | ||
| 251 | + | ||
| 252 | + var run = function () { | ||
| 253 | + space --; | ||
| 254 | + span.text(space); | ||
| 255 | + }; | ||
| 256 | + | ||
| 257 | + | ||
| 258 | + return { | ||
| 259 | + start: start, | ||
| 260 | + stop: stop | ||
| 261 | + } | ||
| 262 | + })(); | ||
| 263 | + | ||
| 264 | + //注册 destroy | ||
| 265 | + $(modal).on('ct-destroy', auto_refresh.stop); | ||
| 266 | + | ||
| 179 | var state_up_0 = function(device) { | 267 | var state_up_0 = function(device) { |
| 180 | var nbbm = gb_data_basic.device2nbbmMap()[device]; | 268 | var nbbm = gb_data_basic.device2nbbmMap()[device]; |
| 181 | stateChange(nbbm, 0, 0); | 269 | stateChange(nbbm, 0, 0); |
src/main/resources/static/real_control_v2/js/home/context_menu.js
| @@ -53,6 +53,62 @@ var gb_home_context_menu = (function() { | @@ -53,6 +53,62 @@ var gb_home_context_menu = (function() { | ||
| 53 | }); | 53 | }); |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | + /** | ||
| 57 | + * 常用短语 | ||
| 58 | + * @type {{add, minus}} | ||
| 59 | + */ | ||
| 60 | + var frequent_phrases = function () { | ||
| 61 | + | ||
| 62 | + var init = function (wrap) { | ||
| 63 | + add(wrap); | ||
| 64 | + minus(wrap); | ||
| 65 | + //查询常用短语 | ||
| 66 | + $.get('/frequent_phrases/all', function (list) { | ||
| 67 | + var t = $('textarea[name=text]', wrap).val(); | ||
| 68 | + var opts = '<option value="">------ 常用短语 -------</option>'; | ||
| 69 | + for(var i=0,obj;obj=list[i++];){ | ||
| 70 | + opts += '<option value="'+obj.text+'" data-id="'+obj.id+'" '+(obj.text==t?"selected":"")+'>'+obj.text+'</option>'; | ||
| 71 | + } | ||
| 72 | + $('.common_phrase_sel', wrap).html(opts); | ||
| 73 | + }); | ||
| 74 | + }; | ||
| 75 | + | ||
| 76 | + var add = function (wrap) { | ||
| 77 | + $('.add_frequent_phrases', wrap).unbind('click').on('click', function () { | ||
| 78 | + var text = $('textarea[name=text]', wrap).val(); | ||
| 79 | + if(!$.trim(text)) | ||
| 80 | + return notify_err('请在下列文本框内输入文字'); | ||
| 81 | + | ||
| 82 | + gb_common.$post('/frequent_phrases', {text: text}, function () { | ||
| 83 | + notify_succ('添加成功!'); | ||
| 84 | + init(wrap); | ||
| 85 | + }); | ||
| 86 | + }); | ||
| 87 | + }; | ||
| 88 | + | ||
| 89 | + var minus = function (wrap) { | ||
| 90 | + $('.minus_frequent_phrases', wrap).unbind('click').on('click', function () { | ||
| 91 | + var text = $('.common_phrase_sel', wrap).val(); | ||
| 92 | + if(!$.trim(text)) | ||
| 93 | + return notify_err('请选中常用短语后再删除'); | ||
| 94 | + | ||
| 95 | + var id = $('.common_phrase_sel', wrap).find("option:selected").data('id'); | ||
| 96 | + if(!id) | ||
| 97 | + return notify_err('无法获取到索引'); | ||
| 98 | + | ||
| 99 | + gb_common.$del('/frequent_phrases/' + id, function () { | ||
| 100 | + notify_succ('删除成功!'); | ||
| 101 | + $('textarea[name=text]', wrap).val(''); | ||
| 102 | + init(wrap); | ||
| 103 | + }); | ||
| 104 | + }); | ||
| 105 | + }; | ||
| 106 | + | ||
| 107 | + return { | ||
| 108 | + init: init | ||
| 109 | + } | ||
| 110 | + }(); | ||
| 111 | + | ||
| 56 | // send phrase | 112 | // send phrase |
| 57 | var sendPhrase = function() { | 113 | var sendPhrase = function() { |
| 58 | var dom = temps['home-send-phrase-temp']({ | 114 | var dom = temps['home-send-phrase-temp']({ |
| @@ -62,10 +118,11 @@ var gb_home_context_menu = (function() { | @@ -62,10 +118,11 @@ var gb_home_context_menu = (function() { | ||
| 62 | // show modal | 118 | // show modal |
| 63 | var elem = show_modal(modal, dom); | 119 | var elem = show_modal(modal, dom); |
| 64 | 120 | ||
| 121 | + frequent_phrases.init(modal); | ||
| 65 | //form submit | 122 | //form submit |
| 66 | var f = $('form', modal).formValidation(gb_form_validation_opts); | 123 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| 67 | $('.common_phrase_sel', f).on('change', function () { | 124 | $('.common_phrase_sel', f).on('change', function () { |
| 68 | - $('[name=text]', f).text($(this).val()); | 125 | + $('[name=text]', f).val($(this).val()); |
| 69 | }); | 126 | }); |
| 70 | f.on('success.form.fv', function(e) { | 127 | f.on('success.form.fv', function(e) { |
| 71 | e.preventDefault(); | 128 | e.preventDefault(); |
| @@ -92,8 +149,13 @@ var gb_home_context_menu = (function() { | @@ -92,8 +149,13 @@ var gb_home_context_menu = (function() { | ||
| 92 | }, | 149 | }, |
| 93 | 'plugins': ['checkbox'] | 150 | 'plugins': ['checkbox'] |
| 94 | }); | 151 | }); |
| 152 | + | ||
| 153 | + frequent_phrases.init(modal); | ||
| 95 | //form submit | 154 | //form submit |
| 96 | var f = $('form', modal).formValidation(gb_form_validation_opts); | 155 | var f = $('form', modal).formValidation(gb_form_validation_opts); |
| 156 | + $('.common_phrase_sel', f).on('change', function () { | ||
| 157 | + $('[name=text]', f).val($(this).val()); | ||
| 158 | + }); | ||
| 97 | f.on('success.form.fv', function(e) { | 159 | f.on('success.form.fv', function(e) { |
| 98 | e.preventDefault(); | 160 | e.preventDefault(); |
| 99 | //tree checked node | 161 | //tree checked node |
src/main/resources/static/real_control_v2/js/home/layout.js
| @@ -41,7 +41,7 @@ var gb_home_layout = (function () { | @@ -41,7 +41,7 @@ var gb_home_layout = (function () { | ||
| 41 | 41 | ||
| 42 | //右下角说明icon | 42 | //右下角说明icon |
| 43 | function initRbDxplain() { | 43 | function initRbDxplain() { |
| 44 | - $(document).on('mouseenter', '.home-rb-explain-icon', function() { | 44 | + $(document).on('mouseenter', '.home-rb-explain-icon>.uk-icon-question-circle', function() { |
| 45 | $(this).qtip({ | 45 | $(this).qtip({ |
| 46 | show: { | 46 | show: { |
| 47 | ready: true, | 47 | ready: true, |
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
| @@ -40,6 +40,10 @@ var gb_schedule_context_menu = (function () { | @@ -40,6 +40,10 @@ var gb_schedule_context_menu = (function () { | ||
| 40 | return add_sch_doms; | 40 | return add_sch_doms; |
| 41 | }, | 41 | }, |
| 42 | dftz: function (sch) { | 42 | dftz: function (sch) { |
| 43 | + if(sch.status > 0){ | ||
| 44 | + notify_err((sch.status==1?'已发出':'已执行') + '的班次不能修改待发'); | ||
| 45 | + return; | ||
| 46 | + } | ||
| 43 | open_modal(folder + '/dftz.html', { | 47 | open_modal(folder + '/dftz.html', { |
| 44 | sch: sch | 48 | sch: sch |
| 45 | }, modal_opts); | 49 | }, modal_opts); |
src/main/resources/static/real_control_v2/js/line_schedule/dbclick.js
| @@ -21,6 +21,11 @@ var gb_schedule_table_dbclick = (function() { | @@ -21,6 +21,11 @@ var gb_schedule_table_dbclick = (function() { | ||
| 21 | remarks: '', | 21 | remarks: '', |
| 22 | opType: '0' | 22 | opType: '0' |
| 23 | }, function(rs) { | 23 | }, function(rs) { |
| 24 | + if(rs.flag && rs.flag==4008){ | ||
| 25 | + notify_err('已发出的班次不能调整待发'); | ||
| 26 | + gb_schedule_table.updateSchedule(rs.t); | ||
| 27 | + return; | ||
| 28 | + } | ||
| 24 | gb_schedule_table.updateSchedule(rs.ts); | 29 | gb_schedule_table.updateSchedule(rs.ts); |
| 25 | notify_succ('待发调整成功!'); | 30 | notify_succ('待发调整成功!'); |
| 26 | //重新计算应发未发 | 31 | //重新计算应发未发 |
src/main/resources/static/real_control_v2/js/main.js
| @@ -47,7 +47,7 @@ var gb_main_ep = new EventProxy(), | @@ -47,7 +47,7 @@ var gb_main_ep = new EventProxy(), | ||
| 47 | $('li.map-panel', '#main-tab-content').load('/real_control_v2/mapmonitor/real.html'); | 47 | $('li.map-panel', '#main-tab-content').load('/real_control_v2/mapmonitor/real.html'); |
| 48 | }, 1000); | 48 | }, 1000); |
| 49 | //弹出更新说明 | 49 | //弹出更新说明 |
| 50 | - showUpdateDescription(); | 50 | + //showUpdateDescription(); |
| 51 | }); | 51 | }); |
| 52 | 52 | ||
| 53 | function g_emit(id) { | 53 | function g_emit(id) { |
src/main/resources/static/real_control_v2/js/modal_extend.js
| @@ -4,7 +4,7 @@ $(document).on('hide.uk.modal', '.uk-modal', function () { | @@ -4,7 +4,7 @@ $(document).on('hide.uk.modal', '.uk-modal', function () { | ||
| 4 | if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-lightbox')){ | 4 | if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-lightbox')){ |
| 5 | return; | 5 | return; |
| 6 | } | 6 | } |
| 7 | - $(this).remove(); | 7 | + $(this).trigger('ct-destroy').remove(); |
| 8 | }); | 8 | }); |
| 9 | 9 | ||
| 10 | $(document).on('show.uk.modal', '.uk-modal.ct_move_modal', function () { | 10 | $(document).on('show.uk.modal', '.uk-modal.ct_move_modal', function () { |
src/main/resources/static/real_control_v2/js/north/tabs.js
| @@ -18,12 +18,12 @@ var gb_tabs = (function() { | @@ -18,12 +18,12 @@ var gb_tabs = (function() { | ||
| 18 | $('.main-container').html(tabContentHtmlStr); | 18 | $('.main-container').html(tabContentHtmlStr); |
| 19 | 19 | ||
| 20 | setTimeout(renderStyle, 4000); | 20 | setTimeout(renderStyle, 4000); |
| 21 | - /*//地图选项卡初始点击 | 21 | + //地图选项卡初始点击 |
| 22 | $('#north_tabs_map_btn').one('click', function () { | 22 | $('#north_tabs_map_btn').one('click', function () { |
| 23 | if(typeof(gb_map_overlay_mge)!="undefined"){ | 23 | if(typeof(gb_map_overlay_mge)!="undefined"){ |
| 24 | gb_map_overlay_mge.centerToRational(); | 24 | gb_map_overlay_mge.centerToRational(); |
| 25 | } | 25 | } |
| 26 | - });*/ | 26 | + }); |
| 27 | 27 | ||
| 28 | //班次选项卡第一次点击,更新滚动条高度 | 28 | //班次选项卡第一次点击,更新滚动条高度 |
| 29 | $('.north-tabs .uk-tab li.tab-line').one('click', function(e){ | 29 | $('.north-tabs .uk-tab li.tab-line').one('click', function(e){ |
src/main/resources/static/real_control_v2/js/utils/svg_chart_tooltip.js
| @@ -108,7 +108,7 @@ var gb_svg_tooltip = (function () { | @@ -108,7 +108,7 @@ var gb_svg_tooltip = (function () { | ||
| 108 | api.set({ | 108 | api.set({ |
| 109 | 'hide.event': false, | 109 | 'hide.event': false, |
| 110 | 'content.button': 'Close', | 110 | 'content.button': 'Close', |
| 111 | - 'content.title': 'GPS正常', | 111 | + 'content.title': '...', |
| 112 | 'position.my': 'top center', | 112 | 'position.my': 'top center', |
| 113 | 'position.at': 'bottom center' | 113 | 'position.at': 'bottom center' |
| 114 | }); | 114 | }); |
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_infowindow.html
| @@ -12,7 +12,21 @@ | @@ -12,7 +12,21 @@ | ||
| 12 | 未知站点 | 12 | 未知站点 |
| 13 | {{/if}} | 13 | {{/if}} |
| 14 | </h5> | 14 | </h5> |
| 15 | - <p>设备状态:正常</p> | 15 | + <p>设备状态: |
| 16 | + {{if valid==1}} | ||
| 17 | + invalid(-1 | ||
| 18 | + {{else if abnormalStatus=='outBounds'}} | ||
| 19 | + 越界 | ||
| 20 | + {{else if abnormalStatus=='overspeed'}} | ||
| 21 | + 超速 | ||
| 22 | + {{else if abnormalStatus=='gps-offline'}} | ||
| 23 | + GPS掉线 | ||
| 24 | + {{else if abnormalStatus=='offline'}} | ||
| 25 | + 离线 | ||
| 26 | + {{else}} | ||
| 27 | + . | ||
| 28 | + {{/if}} | ||
| 29 | + </p> | ||
| 16 | <p>设备号:{{deviceId}}</p> | 30 | <p>设备号:{{deviceId}}</p> |
| 17 | <p>速度:{{speed}}</p> | 31 | <p>速度:{{speed}}</p> |
| 18 | <p>角度:{{direction}}</p> | 32 | <p>角度:{{direction}}</p> |
src/main/resources/static/real_control_v2/mapmonitor/real.html
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | 7 | ||
| 8 | <div class="map-system-msg flex-left"> | 8 | <div class="map-system-msg flex-left"> |
| 9 | <a class="z-depth-2 old_map" href="/pages/mapmonitor/alone/wrap.html" target="_blank"></a> | 9 | <a class="z-depth-2 old_map" href="/pages/mapmonitor/alone/wrap.html" target="_blank"></a> |
| 10 | - <a class="z-depth-2 now_map" href="/real_control_v2/mapmonitor/alone_page/alone_wrap.html" target="_blank"> | 10 | + <a class="z-depth-2 now_map" href="/real_control_v2/alone_page/map/alone_wrap.html" target="_blank"> |
| 11 | <i class="uk-icon-send-o"></i> | 11 | <i class="uk-icon-send-o"></i> |
| 12 | </a> | 12 | </a> |
| 13 | </div> | 13 | </div> |