Commit cbca77675c225dff2eba3c1347105d99facba141
1 parent
7c8138e8
新增公告功能
Showing
27 changed files
with
3127 additions
and
39 deletions
src/main/java/com/bsth/common/Constants.java
| ... | ... | @@ -46,6 +46,7 @@ public class Constants { |
| 46 | 46 | public static final String STATION_AND_SECTION_COUNT = "/station/updateStationAndSectionCode"; |
| 47 | 47 | |
| 48 | 48 | public static final String OUT_URL = "/out/**"; |
| 49 | + public static final String NOTICE_URL = "/notice/**"; | |
| 49 | 50 | /** |
| 50 | 51 | * 解除调度指令和班次的外键约束 |
| 51 | 52 | */ | ... | ... |
src/main/java/com/bsth/controller/realcontrol/NoticeController.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.alibaba.fastjson.JSONArray; | |
| 5 | +import com.alibaba.fastjson.JSONObject; | |
| 6 | +import com.bsth.common.ResponseCode; | |
| 7 | +import com.bsth.controller.BaseController; | |
| 8 | +import com.bsth.data.BasicData; | |
| 9 | +import com.bsth.data.notice.NoticeService; | |
| 10 | +import com.bsth.data.notice.entity.Notice; | |
| 11 | +import com.bsth.util.SignUtils; | |
| 12 | +import org.slf4j.Logger; | |
| 13 | +import org.slf4j.LoggerFactory; | |
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 15 | +import org.springframework.beans.propertyeditors.CustomDateEditor; | |
| 16 | +import org.springframework.web.bind.WebDataBinder; | |
| 17 | +import org.springframework.web.bind.annotation.*; | |
| 18 | +import org.springframework.web.context.request.WebRequest; | |
| 19 | +import java.text.DateFormat; | |
| 20 | +import java.text.SimpleDateFormat; | |
| 21 | +import java.util.Date; | |
| 22 | +import java.util.HashMap; | |
| 23 | +import java.util.Map; | |
| 24 | + | |
| 25 | +/** | |
| 26 | + * 公告 | |
| 27 | + */ | |
| 28 | +@RestController | |
| 29 | +@RequestMapping("/notice") | |
| 30 | +public class NoticeController extends BaseController<Notice, Long>{ | |
| 31 | + | |
| 32 | + Logger log = LoggerFactory.getLogger(this.getClass()); | |
| 33 | + | |
| 34 | + | |
| 35 | + @Autowired | |
| 36 | + NoticeService noticeService; | |
| 37 | + | |
| 38 | + @InitBinder | |
| 39 | + public void initBinder(WebDataBinder binder, WebRequest request) { | |
| 40 | + //转换日期 注意这里的转化要和传进来的字符串的格式一直 如2015-9-9 就应该为yyyy-MM-dd | |
| 41 | + DateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 42 | + binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));// CustomDateEditor为自定义日期编辑器 | |
| 43 | + } | |
| 44 | + | |
| 45 | + | |
| 46 | + @RequestMapping(value = "/findList", method = RequestMethod.GET) | |
| 47 | + public Map<String, Object> findList(@RequestParam Map<String, String> map) { | |
| 48 | + return noticeService.findList(map); | |
| 49 | + } | |
| 50 | + | |
| 51 | + @RequestMapping(value = "/{id}", method = RequestMethod.GET) | |
| 52 | + public Notice findById(@PathVariable("id") Long id) { | |
| 53 | + Notice notice = noticeService.findById(id); | |
| 54 | + return notice; | |
| 55 | + } | |
| 56 | + | |
| 57 | + @RequestMapping(value = "/delete", method = RequestMethod.POST) | |
| 58 | + public Map<String, Object> deleteInfo(Notice t) { | |
| 59 | + Map<String, Object> map = new HashMap<>(); | |
| 60 | + try{ | |
| 61 | + noticeService.deleteInfo(t); | |
| 62 | + map.put("status", ResponseCode.SUCCESS); | |
| 63 | + } catch (Exception e) { | |
| 64 | + log.error(e.toString(), e); | |
| 65 | + map.put("status", ResponseCode.ERROR); | |
| 66 | + } | |
| 67 | + return map; | |
| 68 | + } | |
| 69 | + | |
| 70 | + | |
| 71 | + @RequestMapping(method = RequestMethod.POST) | |
| 72 | + public Map<String, Object> save(Notice t) { | |
| 73 | + Map<String, Object> map = new HashMap<>(); | |
| 74 | + try{ | |
| 75 | + t.setNOTICE_XLNAME(BasicData.lineCode2NameMap.get(t.getNOTICE_XL())); | |
| 76 | + t.setNOTICE_STATIONNAME(BasicData.stationCode2NameMap.get(t.getNOTICE_XL()+"_"+t.getNOTICE_XSFX()+"_"+t.getNOTICE_STATION())); | |
| 77 | + t.setCREATE_BY(t.getNOTICE_BBR()); | |
| 78 | + t.setUPDATE_BY(t.getNOTICE_BBR()); | |
| 79 | + noticeService.save(t); | |
| 80 | + map.put("status", ResponseCode.SUCCESS); | |
| 81 | + } catch (Exception e) { | |
| 82 | + log.error(e.toString(), e); | |
| 83 | + map.put("status", ResponseCode.ERROR); | |
| 84 | + } | |
| 85 | + return map; | |
| 86 | + } | |
| 87 | + | |
| 88 | + @RequestMapping(value = "/getNotice", method = RequestMethod.POST) | |
| 89 | + public Map<String, Object> getNotice(@RequestBody JSONObject jsonObject) { | |
| 90 | + Map<String, Object> map = new HashMap<>(); | |
| 91 | + Map<String, String> params = new HashMap<>(); | |
| 92 | + try{ | |
| 93 | + if(!SignUtils.validation(Long.parseLong(jsonObject.getString("timestamp")),jsonObject.getString("sign"))){ | |
| 94 | + map.put("status", "验证失败"); | |
| 95 | + return map; | |
| 96 | + } | |
| 97 | + StringBuffer stations=new StringBuffer(); | |
| 98 | + StringBuffer lineCodes=new StringBuffer(); | |
| 99 | + JSONArray jsonArray = jsonObject.getJSONArray("stations"); | |
| 100 | + for (int i = 0; i < jsonArray.size(); i++) { | |
| 101 | + JSONObject line=jsonArray.getJSONObject(i); | |
| 102 | + String lineCode = line.get("lineCode").toString(); | |
| 103 | + String stationCode = line.get("stationCode").toString(); | |
| 104 | + stations.append(stationCode+","); | |
| 105 | + lineCodes.append(lineCode+","); | |
| 106 | + } | |
| 107 | + params.put("stations",stations.toString().substring(0,stations.toString().length()-1)); | |
| 108 | + params.put("lineCodes",lineCodes.toString().substring(0,lineCodes.toString().length()-1)); | |
| 109 | + return noticeService.getNotice(params); | |
| 110 | + } catch (Exception e) { | |
| 111 | + log.error(e.toString(), e); | |
| 112 | + map.put("status", ResponseCode.ERROR); | |
| 113 | + return map; | |
| 114 | + } | |
| 115 | + } | |
| 116 | + | |
| 117 | +} | ... | ... |
src/main/java/com/bsth/data/notice/NoticeService.java
0 → 100644
| 1 | +package com.bsth.data.notice; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.bsth.data.notice.entity.Notice; | |
| 5 | +import com.bsth.service.BaseService; | |
| 6 | + | |
| 7 | +import java.util.Map; | |
| 8 | + | |
| 9 | +public interface NoticeService extends BaseService<Notice, Long>{ | |
| 10 | + | |
| 11 | + Map<String, Object> findList(Map<String, String> map); | |
| 12 | + | |
| 13 | + Map<String, Object> deleteInfo( Notice t); | |
| 14 | + | |
| 15 | + Map<String, Object> getNotice(Map<String, String> map); | |
| 16 | +} | ... | ... |
src/main/java/com/bsth/data/notice/NoticeServiceImpl.java
0 → 100644
| 1 | +package com.bsth.data.notice; | |
| 2 | + | |
| 3 | +import com.bsth.common.ResponseCode; | |
| 4 | +import com.bsth.data.gpsdata_v2.cache.GeoCacheData; | |
| 5 | +import com.bsth.data.gpsdata_v2.entity.StationRoute; | |
| 6 | +import com.bsth.data.notice.entity.*; | |
| 7 | +import com.bsth.service.impl.BaseServiceImpl; | |
| 8 | +import com.google.common.collect.ArrayListMultimap; | |
| 9 | +import com.google.common.collect.ListMultimap; | |
| 10 | +import com.google.common.collect.Multimaps; | |
| 11 | +import org.slf4j.Logger; | |
| 12 | +import org.slf4j.LoggerFactory; | |
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 14 | +import org.springframework.dao.DataIntegrityViolationException; | |
| 15 | +import org.springframework.jdbc.core.BeanPropertyRowMapper; | |
| 16 | +import org.springframework.jdbc.core.JdbcTemplate; | |
| 17 | +import org.springframework.stereotype.Service; | |
| 18 | +import java.text.SimpleDateFormat; | |
| 19 | +import java.util.*; | |
| 20 | + | |
| 21 | +@Service | |
| 22 | +public class NoticeServiceImpl extends BaseServiceImpl<Notice, Long> implements NoticeService { | |
| 23 | + | |
| 24 | + Logger log = LoggerFactory.getLogger(this.getClass()); | |
| 25 | + | |
| 26 | + @Autowired | |
| 27 | + JdbcTemplate jdbcTemplate; | |
| 28 | + | |
| 29 | + @Override | |
| 30 | + public Map<String, Object> findList(Map<String, String> map) { | |
| 31 | + Map<String, Object> rs = new HashMap(); | |
| 32 | + try { | |
| 33 | + | |
| 34 | + String lineCodes = map.get("lineCodes") == null ? "" : map.get("lineCodes"); | |
| 35 | + Date startDate = new Date(); | |
| 36 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 37 | + String time = sdf.format(startDate); | |
| 38 | + String sql = "select * from bsth_t_notice where NOTICE_TIME >=\""+time+"\" and (NOTICE_XL in("+lineCodes+") "+" or NOTICE_QY is not null) and STATUS !=2 "; | |
| 39 | + List<Notice> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(Notice.class)); | |
| 40 | + for (Notice notice : list) { | |
| 41 | + notice.setNOTICE_TFSJ(TFSJ.getDescription(notice.getNOTICE_TFSJ())); | |
| 42 | + notice.setNOTICE_SJYX(SJYX.getDescription(notice.getNOTICE_SJYX())); | |
| 43 | + notice.setNOTICE_QY(QY.getDescription(notice.getNOTICE_QY())); | |
| 44 | + notice.setNOTICE_GG(GG.getDescription(notice.getNOTICE_GG())); | |
| 45 | + } | |
| 46 | + rs.put("status", ResponseCode.SUCCESS); | |
| 47 | + rs.put("list", list); | |
| 48 | + } | |
| 49 | + catch (Exception e){ | |
| 50 | + log.error("", e); | |
| 51 | + rs.put("status", ResponseCode.ERROR); | |
| 52 | + rs.put("msg", e.getMessage()); | |
| 53 | + } | |
| 54 | + return rs; | |
| 55 | + } | |
| 56 | + | |
| 57 | + @Override | |
| 58 | + public Map<String, Object> getNotice(Map<String, String> map) { | |
| 59 | + Map<String, Object> rs = new HashMap(); | |
| 60 | + ListMultimap<String, String> result = Multimaps.synchronizedListMultimap(ArrayListMultimap.create()); | |
| 61 | + try { | |
| 62 | + | |
| 63 | + String stations = map.get("stations") == null ? "" : map.get("stations"); | |
| 64 | + String lineCodes = map.get("lineCodes") == null ? "" : map.get("lineCodes"); | |
| 65 | + Date startDate = new Date(); | |
| 66 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
| 67 | + String time = sdf.format(startDate); | |
| 68 | + String sql = "select * from bsth_t_notice where NOTICE_TIME >=\""+time+"\" and (NOTICE_XL in("+lineCodes+") "+" or NOTICE_QY is not null) and STATUS !=2"; | |
| 69 | + List<Notice> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(Notice.class)); | |
| 70 | + for (Notice notice : list) { | |
| 71 | + if(notice.getNOTICE_TYPE()==1){ | |
| 72 | + StringBuffer sb=new StringBuffer(); | |
| 73 | + List<StationRoute> stationRoutes=GeoCacheData.getStationRoute(notice.getNOTICE_XL(),Integer.parseInt(notice.getNOTICE_XSFX())); | |
| 74 | + /*申港3路开往鸿音路南芦公路方向,临时改道不经过鸿音路两港大道站点,请乘客合理安排出行。*/ | |
| 75 | + sb.append(notice.getNOTICE_XLNAME()+"开往"+stationRoutes.get(stationRoutes.size()-1).getName()+"方向,"); | |
| 76 | + sb.append("由于"+ TFSJ.getDescription(notice.getNOTICE_TFSJ())); | |
| 77 | + if("1".equals(notice.getNOTICE_SJYX())){ | |
| 78 | + sb.append("不经过"+notice.getNOTICE_STATIONNAME()+"站点"); | |
| 79 | + }else if("2".equals(notice.getNOTICE_SJYX())){ | |
| 80 | + sb.append("可能出现"+ SJYX.getDescription(notice.getNOTICE_SJYX())); | |
| 81 | + } | |
| 82 | + sb.append(",请乘客合理安排出行。"); | |
| 83 | + result.put(notice.getNOTICE_XL(),sb.toString()); | |
| 84 | + }else if(notice.getNOTICE_TYPE()==2){ | |
| 85 | + result.put("area", GG.getDescription(notice.getNOTICE_GG())); | |
| 86 | + } | |
| 87 | + | |
| 88 | + } | |
| 89 | + rs.put("status", ResponseCode.SUCCESS); | |
| 90 | + Map m=result.asMap(); | |
| 91 | + List list1=new ArrayList(); | |
| 92 | + Set<String> keys=m.keySet(); | |
| 93 | + for (String key : keys) { | |
| 94 | + Map m2=new HashMap(); | |
| 95 | + m2.put("lineId",key); | |
| 96 | + m2.put("msg",m.get(key)); | |
| 97 | + list1.add(m2); | |
| 98 | + } | |
| 99 | + | |
| 100 | + rs.put("notice", list1); | |
| 101 | + } | |
| 102 | + catch (Exception e){ | |
| 103 | + log.error("", e); | |
| 104 | + rs.put("status", ResponseCode.ERROR); | |
| 105 | + rs.put("msg", e.getMessage()); | |
| 106 | + } | |
| 107 | + return rs; | |
| 108 | + } | |
| 109 | + @Override | |
| 110 | + public Map<String, Object> deleteInfo(Notice rr) { | |
| 111 | + Map<String, Object> map = new HashMap<>(); | |
| 112 | + try{ | |
| 113 | + Long id = rr.getID(); | |
| 114 | + String bbr = rr.getNOTICE_BBR(); | |
| 115 | + | |
| 116 | + jdbcTemplate.update("UPDATE bsth_t_notice SET STATUS = 2,NOTICE_BBR = ? WHERE ID = ? ",bbr,id); | |
| 117 | + map.put("status", ResponseCode.SUCCESS); | |
| 118 | + }catch(DataIntegrityViolationException de){ | |
| 119 | + map.put("status", ResponseCode.ERROR); | |
| 120 | + map.put("msg", "“完整性约束”校验失败,请检查要删除的对象是否存在外键约束"); | |
| 121 | + } | |
| 122 | + return map; | |
| 123 | + } | |
| 124 | +} | ... | ... |
src/main/java/com/bsth/data/notice/entity/GG.java
0 → 100644
| 1 | +package com.bsth.data.notice.entity; | |
| 2 | + | |
| 3 | +public enum GG { | |
| 4 | + GG1("0", "雨天路滑,安全出行。"), | |
| 5 | + GG2("1", "高峰时段,道路拥堵,请乘客合理安排出行。"), | |
| 6 | + GG3("2", "请先下后上,注意乘车安全。"); | |
| 7 | + | |
| 8 | + private String code; | |
| 9 | + private String description; | |
| 10 | + | |
| 11 | + GG(String code, String description) { | |
| 12 | + this.code = code; | |
| 13 | + this.description = description; | |
| 14 | + } | |
| 15 | + | |
| 16 | + | |
| 17 | + public static String getDescription(String number){ | |
| 18 | + String description =""; | |
| 19 | + for (GG e : GG.values()) { | |
| 20 | + if(e.code.equals(number)){ | |
| 21 | + return e.description; | |
| 22 | + } | |
| 23 | + } | |
| 24 | + return description; | |
| 25 | + } | |
| 26 | + | |
| 27 | +} | ... | ... |
src/main/java/com/bsth/data/notice/entity/Notice.java
0 → 100644
| 1 | +package com.bsth.data.notice.entity; | |
| 2 | + | |
| 3 | +import javax.persistence.*; | |
| 4 | +import java.text.DateFormat; | |
| 5 | +import java.text.SimpleDateFormat; | |
| 6 | +import java.util.Date; | |
| 7 | + | |
| 8 | + | |
| 9 | +@Entity | |
| 10 | +@Table(name = "bsth_t_notice") | |
| 11 | +public class Notice { | |
| 12 | + | |
| 13 | + @Id | |
| 14 | + @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 15 | + private long ID; | |
| 16 | + | |
| 17 | + /** 类型,1:突发事件,2:区域公告 */ | |
| 18 | + private Integer NOTICE_TYPE; | |
| 19 | + /** 时间*/ | |
| 20 | + private Date NOTICE_DATE; | |
| 21 | + /** 时间*/ | |
| 22 | + private Date NOTICE_TIME; | |
| 23 | + /** 报备人*/ | |
| 24 | + private String NOTICE_BBR; | |
| 25 | + /** 线路编码 */ | |
| 26 | + private String NOTICE_XL; | |
| 27 | + /** 线路名*/ | |
| 28 | + private String NOTICE_XLNAME; | |
| 29 | + /** 行驶方向*/ | |
| 30 | + private String NOTICE_XSFX; | |
| 31 | + /** 站点*/ | |
| 32 | + private String NOTICE_STATION; | |
| 33 | + /** 站点名*/ | |
| 34 | + private String NOTICE_STATIONNAME; | |
| 35 | + /** 突发事件*/ | |
| 36 | + private String NOTICE_TFSJ; | |
| 37 | + /** 事件影响*/ | |
| 38 | + private String NOTICE_SJYX; | |
| 39 | + /** 区域*/ | |
| 40 | + private String NOTICE_QY; | |
| 41 | + /** 公告*/ | |
| 42 | + private String NOTICE_GG; | |
| 43 | + | |
| 44 | + | |
| 45 | + /** 访问接口时使用的状态码 操作类型,0:新增;1:修改;2:删除 */ | |
| 46 | + private String STATUS; | |
| 47 | + /** 创建人*/ | |
| 48 | + private String CREATE_BY; | |
| 49 | + /** 创建时间 */ | |
| 50 | + @Column(updatable = false, name = "CREATE_DATE", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | |
| 51 | + private Date CREATE_DATE; | |
| 52 | + /** 修改人*/ | |
| 53 | + private String UPDATE_BY; | |
| 54 | + /** 修改时间*/ | |
| 55 | + @Column(name = "UPDATE_DATE", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") | |
| 56 | + private Date UPDATE_DATE; | |
| 57 | + | |
| 58 | + public long getID() { | |
| 59 | + return ID; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setID(long ID) { | |
| 63 | + this.ID = ID; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public Integer getNOTICE_TYPE() { | |
| 67 | + return NOTICE_TYPE; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setNOTICE_TYPE(Integer NOTICE_TYPE) { | |
| 71 | + this.NOTICE_TYPE = NOTICE_TYPE; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public Date getNOTICE_DATE() { | |
| 75 | + return NOTICE_DATE; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setNOTICE_DATE(Date NOTICE_DATE) { | |
| 79 | + this.NOTICE_DATE = NOTICE_DATE; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public Date getNOTICE_TIME() { | |
| 83 | + return NOTICE_TIME; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void setNOTICE_TIME(Date NOTICE_TIME) { | |
| 87 | + this.NOTICE_TIME = NOTICE_TIME; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public String getNOTICE_BBR() { | |
| 91 | + return NOTICE_BBR; | |
| 92 | + } | |
| 93 | + | |
| 94 | + public void setNOTICE_BBR(String NOTICE_BBR) { | |
| 95 | + this.NOTICE_BBR = NOTICE_BBR; | |
| 96 | + } | |
| 97 | + | |
| 98 | + public String getNOTICE_XL() { | |
| 99 | + return NOTICE_XL; | |
| 100 | + } | |
| 101 | + | |
| 102 | + public void setNOTICE_XL(String NOTICE_XL) { | |
| 103 | + this.NOTICE_XL = NOTICE_XL; | |
| 104 | + } | |
| 105 | + | |
| 106 | + public String getNOTICE_XLNAME() { | |
| 107 | + return NOTICE_XLNAME; | |
| 108 | + } | |
| 109 | + | |
| 110 | + public void setNOTICE_XLNAME(String NOTICE_XLNAME) { | |
| 111 | + this.NOTICE_XLNAME = NOTICE_XLNAME; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public String getNOTICE_XSFX() { | |
| 115 | + return NOTICE_XSFX; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public void setNOTICE_XSFX(String NOTICE_XSFX) { | |
| 119 | + this.NOTICE_XSFX = NOTICE_XSFX; | |
| 120 | + } | |
| 121 | + | |
| 122 | + public String getNOTICE_STATION() { | |
| 123 | + return NOTICE_STATION; | |
| 124 | + } | |
| 125 | + | |
| 126 | + public void setNOTICE_STATION(String NOTICE_STATION) { | |
| 127 | + this.NOTICE_STATION = NOTICE_STATION; | |
| 128 | + } | |
| 129 | + | |
| 130 | + public String getNOTICE_STATIONNAME() { | |
| 131 | + return NOTICE_STATIONNAME; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public void setNOTICE_STATIONNAME(String NOTICE_STATIONNAME) { | |
| 135 | + this.NOTICE_STATIONNAME = NOTICE_STATIONNAME; | |
| 136 | + } | |
| 137 | + | |
| 138 | + public String getNOTICE_TFSJ() { | |
| 139 | + return NOTICE_TFSJ; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public void setNOTICE_TFSJ(String NOTICE_TFSJ) { | |
| 143 | + this.NOTICE_TFSJ = NOTICE_TFSJ; | |
| 144 | + } | |
| 145 | + | |
| 146 | + public String getNOTICE_SJYX() { | |
| 147 | + return NOTICE_SJYX; | |
| 148 | + } | |
| 149 | + | |
| 150 | + public void setNOTICE_SJYX(String NOTICE_SJYX) { | |
| 151 | + this.NOTICE_SJYX = NOTICE_SJYX; | |
| 152 | + } | |
| 153 | + | |
| 154 | + public String getNOTICE_QY() { | |
| 155 | + return NOTICE_QY; | |
| 156 | + } | |
| 157 | + | |
| 158 | + public void setNOTICE_QY(String NOTICE_QY) { | |
| 159 | + this.NOTICE_QY = NOTICE_QY; | |
| 160 | + } | |
| 161 | + | |
| 162 | + public String getNOTICE_GG() { | |
| 163 | + return NOTICE_GG; | |
| 164 | + } | |
| 165 | + | |
| 166 | + public void setNOTICE_GG(String NOTICE_GG) { | |
| 167 | + this.NOTICE_GG = NOTICE_GG; | |
| 168 | + } | |
| 169 | + | |
| 170 | + public String getSTATUS() { | |
| 171 | + return STATUS; | |
| 172 | + } | |
| 173 | + | |
| 174 | + public void setSTATUS(String STATUS) { | |
| 175 | + this.STATUS = STATUS; | |
| 176 | + } | |
| 177 | + | |
| 178 | + public String getCREATE_BY() { | |
| 179 | + return CREATE_BY; | |
| 180 | + } | |
| 181 | + | |
| 182 | + public void setCREATE_BY(String CREATE_BY) { | |
| 183 | + this.CREATE_BY = CREATE_BY; | |
| 184 | + } | |
| 185 | + | |
| 186 | + public Date getCREATE_DATE() { | |
| 187 | + return CREATE_DATE; | |
| 188 | + } | |
| 189 | + | |
| 190 | + public void setCREATE_DATE(Date CREATE_DATE) { | |
| 191 | + this.CREATE_DATE = CREATE_DATE; | |
| 192 | + } | |
| 193 | + | |
| 194 | + public String getUPDATE_BY() { | |
| 195 | + return UPDATE_BY; | |
| 196 | + } | |
| 197 | + | |
| 198 | + public void setUPDATE_BY(String UPDATE_BY) { | |
| 199 | + this.UPDATE_BY = UPDATE_BY; | |
| 200 | + } | |
| 201 | + | |
| 202 | + public Date getUPDATE_DATE() { | |
| 203 | + return UPDATE_DATE; | |
| 204 | + } | |
| 205 | + | |
| 206 | + public void setUPDATE_DATE(Date UPDATE_DATE) { | |
| 207 | + this.UPDATE_DATE = UPDATE_DATE; | |
| 208 | + } | |
| 209 | +} | ... | ... |
src/main/java/com/bsth/data/notice/entity/QY.java
0 → 100644
| 1 | +package com.bsth.data.notice.entity; | |
| 2 | + | |
| 3 | +public enum QY { | |
| 4 | + QY0("0", "全部"), | |
| 5 | + QY1("1", "区域1"), | |
| 6 | + QY2("2", "区域2"), | |
| 7 | + QY3("3", "区域3"); | |
| 8 | + | |
| 9 | + private String code; | |
| 10 | + private String description; | |
| 11 | + | |
| 12 | + QY(String code, String description) { | |
| 13 | + this.code = code; | |
| 14 | + this.description = description; | |
| 15 | + } | |
| 16 | + | |
| 17 | + | |
| 18 | + public static String getDescription(String number){ | |
| 19 | + String description =""; | |
| 20 | + for (QY e : QY.values()) { | |
| 21 | + if(e.code.equals(number)){ | |
| 22 | + return e.description; | |
| 23 | + } | |
| 24 | + } | |
| 25 | + return description; | |
| 26 | + } | |
| 27 | + | |
| 28 | +} | ... | ... |
src/main/java/com/bsth/data/notice/entity/SJYX.java
0 → 100644
| 1 | +package com.bsth.data.notice.entity; | |
| 2 | + | |
| 3 | +public enum SJYX { | |
| 4 | + ZDHD("1", "临时改道"), | |
| 5 | + ELTQ("2", "班次延误"); | |
| 6 | + | |
| 7 | + private String code; | |
| 8 | + private String description; | |
| 9 | + | |
| 10 | + SJYX(String code, String description) { | |
| 11 | + this.code = code; | |
| 12 | + this.description = description; | |
| 13 | + } | |
| 14 | + | |
| 15 | + | |
| 16 | + public static String getDescription(String number){ | |
| 17 | + String description =""; | |
| 18 | + for (SJYX e : SJYX.values()) { | |
| 19 | + if(e.code.equals(number)){ | |
| 20 | + return e.description; | |
| 21 | + } | |
| 22 | + } | |
| 23 | + return description; | |
| 24 | + } | |
| 25 | + | |
| 26 | +} | ... | ... |
src/main/java/com/bsth/data/notice/entity/TFSJ.java
0 → 100644
| 1 | +package com.bsth.data.notice.entity; | |
| 2 | + | |
| 3 | +public enum TFSJ { | |
| 4 | + ZDHD("1", "重大活动"), | |
| 5 | + ELTQ("2", "恶劣天气"), | |
| 6 | + JTSG("3", "交通事故"), | |
| 7 | + DLYD("4", "道路拥堵"); | |
| 8 | + | |
| 9 | + private String code; | |
| 10 | + private String description; | |
| 11 | + | |
| 12 | + TFSJ(String code, String description) { | |
| 13 | + this.code = code; | |
| 14 | + this.description = description; | |
| 15 | + } | |
| 16 | + | |
| 17 | + | |
| 18 | + public static String getDescription(String number){ | |
| 19 | + String description =""; | |
| 20 | + for (TFSJ e : TFSJ.values()) { | |
| 21 | + if(e.code.equals(number)){ | |
| 22 | + return e.description; | |
| 23 | + } | |
| 24 | + } | |
| 25 | + return description; | |
| 26 | + } | |
| 27 | + | |
| 28 | +} | ... | ... |
src/main/java/com/bsth/data/notice/repository/NoticeRepository.java
0 → 100644
| 1 | +package com.bsth.data.notice.repository; | |
| 2 | + | |
| 3 | +import com.bsth.data.notice.entity.Notice; | |
| 4 | +import com.bsth.repository.BaseRepository; | |
| 5 | +import org.springframework.stereotype.Repository; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * | |
| 9 | + * @Interface: NoticeRepository(站点公告Repository数据持久层接口) | |
| 10 | + * | |
| 11 | + * @Author YM | |
| 12 | + * | |
| 13 | + * @Date 2024-11-07 | |
| 14 | + * | |
| 15 | + * @Version 公交调度系统BS版 0.1 | |
| 16 | + * | |
| 17 | + */ | |
| 18 | + | |
| 19 | +@Repository | |
| 20 | +public interface NoticeRepository extends BaseRepository<Notice, Long> { | |
| 21 | + | |
| 22 | +} | ... | ... |
src/main/java/com/bsth/data/zndd/OutEntrance.java
| ... | ... | @@ -11,6 +11,7 @@ import com.bsth.entity.zndd.StationPeopleLogger; |
| 11 | 11 | import com.bsth.entity.zndd.StationSignsLogger; |
| 12 | 12 | import com.bsth.service.schedule.utils.Md5Util; |
| 13 | 13 | import com.bsth.util.HttpClientUtils; |
| 14 | +import com.bsth.util.SignUtils; | |
| 14 | 15 | import com.bsth.websocket.handler.SendUtils; |
| 15 | 16 | import com.fasterxml.jackson.databind.ObjectMapper; |
| 16 | 17 | import org.slf4j.Logger; |
| ... | ... | @@ -25,7 +26,6 @@ import java.time.format.DateTimeFormatter; |
| 25 | 26 | import java.util.*; |
| 26 | 27 | import java.util.concurrent.ConcurrentHashMap; |
| 27 | 28 | import java.util.concurrent.ConcurrentMap; |
| 28 | -import java.util.stream.Collectors; | |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * 对外接口 |
| ... | ... | @@ -56,16 +56,12 @@ public class OutEntrance { |
| 56 | 56 | @Autowired |
| 57 | 57 | carMonitor carMonitor; |
| 58 | 58 | |
| 59 | - private static final String PASSWORD="e126853c7f6f43b4857fa8dfe3b28b5d90be9e68"; | |
| 60 | - | |
| 61 | - | |
| 62 | - | |
| 63 | 59 | //调度屏小程序接口。 |
| 64 | 60 | @RequestMapping(value = "/OutCar", method = RequestMethod.POST) |
| 65 | 61 | public Map OutCarOutCar(@RequestParam Map m,@RequestBody StationSignsLogger ssLogger) { |
| 66 | 62 | Map rtn = new HashMap<>(); |
| 67 | 63 | try { |
| 68 | - if(!validation(ssLogger.getTimestamp(),ssLogger.getSign())){ | |
| 64 | + if(!SignUtils.validation(ssLogger.getTimestamp(),ssLogger.getSign())){ | |
| 69 | 65 | rtn.put("status", "验证失败"); |
| 70 | 66 | return rtn; |
| 71 | 67 | } |
| ... | ... | @@ -96,19 +92,24 @@ public class OutEntrance { |
| 96 | 92 | }else { |
| 97 | 93 | //筛选方向 |
| 98 | 94 | List<ScheduleRealInfo> rs = dayOfSchedule.findByLineCode(ssLogger.getLineCode()); |
| 99 | - //排序 | |
| 100 | - Collections.sort(rs,new ScheduleComparator.FCSJ()); | |
| 101 | - SimpleDateFormat sdf= new SimpleDateFormat("HH:ss"); | |
| 102 | - String sjtext = ""; | |
| 103 | - LocalTime t1 = LocalTime.parse(sdf.format(new Date()), DateTimeFormatter.ofPattern("HH:mm")); | |
| 104 | - for (ScheduleRealInfo sr:rs) { | |
| 105 | - LocalTime t2 = LocalTime.parse(sr.getFcsj(), DateTimeFormatter.ofPattern("HH:mm")); | |
| 106 | - //判断上下行 | |
| 107 | - if(t1.isAfter(t2)){ | |
| 108 | - sjtext = sr.getFcsj(); | |
| 95 | + if(rs.size()>0){ | |
| 96 | + //排序 | |
| 97 | + Collections.sort(rs,new ScheduleComparator.FCSJ()); | |
| 98 | + SimpleDateFormat sdf= new SimpleDateFormat("HH:ss"); | |
| 99 | + String sjtext = ""; | |
| 100 | + LocalTime t1 = LocalTime.parse(sdf.format(new Date()), DateTimeFormatter.ofPattern("HH:mm")); | |
| 101 | + for (ScheduleRealInfo sr:rs) { | |
| 102 | + LocalTime t2 = LocalTime.parse(sr.getFcsj(), DateTimeFormatter.ofPattern("HH:mm")); | |
| 103 | + //判断上下行 | |
| 104 | + if(t1.isAfter(t2)){ | |
| 105 | + sjtext = sr.getFcsj(); | |
| 106 | + } | |
| 109 | 107 | } |
| 108 | + rtn.put("message","车辆预计"+sjtext+"发车,请耐心等待"); | |
| 109 | + }else { | |
| 110 | + rtn.put("message","当日运营已结束"); | |
| 110 | 111 | } |
| 111 | - rtn.put("message","车辆预计"+sjtext+"发车,请耐心等待"); | |
| 112 | + | |
| 112 | 113 | } |
| 113 | 114 | |
| 114 | 115 | rtn.put("status",ResponseCode.SUCCESS); |
| ... | ... | @@ -121,10 +122,12 @@ public class OutEntrance { |
| 121 | 122 | |
| 122 | 123 | |
| 123 | 124 | @RequestMapping(value = "/klyj", method = RequestMethod.POST) |
| 124 | - public void klyj(@RequestBody JSONObject jsonObject) { | |
| 125 | + public Map klyj(@RequestBody JSONObject jsonObject) { | |
| 126 | + Map rtn = new HashMap<>(); | |
| 125 | 127 | try { |
| 126 | - if(!validation(Long.parseLong(jsonObject.getString("timestamp")),jsonObject.getString("sign"))){ | |
| 127 | - return ; | |
| 128 | + if(!SignUtils.validation(Long.parseLong(jsonObject.getString("timestamp")),jsonObject.getString("sign"))){ | |
| 129 | + rtn.put("status", "验证失败"); | |
| 130 | + return rtn; | |
| 128 | 131 | } |
| 129 | 132 | String num=jsonObject.getString("num"); |
| 130 | 133 | String image=jsonObject.getString("image"); |
| ... | ... | @@ -172,13 +175,18 @@ public class OutEntrance { |
| 172 | 175 | m.put("sch",schedule); |
| 173 | 176 | m.put("uuid",AutomaticSch.UUID()); |
| 174 | 177 | m.put("rq",localTime.format(dateTimeFormatter)); //检测到时间 |
| 178 | + m.put("ids",AutomaticSch.UUID()); | |
| 179 | + m.put("type","KLYJ"); | |
| 175 | 180 | sendUtils.klyj(m); |
| 176 | 181 | } |
| 177 | 182 | |
| 178 | 183 | } |
| 184 | + rtn.put("status",ResponseCode.SUCCESS); | |
| 179 | 185 | } catch (Exception e) { |
| 180 | - e.printStackTrace(); | |
| 186 | + rtn.put("status", ResponseCode.ERROR); | |
| 187 | + logger.error("",e); | |
| 181 | 188 | } |
| 189 | + return rtn; | |
| 182 | 190 | } |
| 183 | 191 | |
| 184 | 192 | /* |
| ... | ... | @@ -233,8 +241,8 @@ public class OutEntrance { |
| 233 | 241 | |
| 234 | 242 | /** |
| 235 | 243 | * 保存base64图片 |
| 236 | - * @param base64Str base64文件 | |
| 237 | - * @param 上传地址(示例:D:\\1.png) | |
| 244 | + * @param base base64文件 | |
| 245 | + * @param (示例:D:\\1.png) | |
| 238 | 246 | * @return |
| 239 | 247 | */ |
| 240 | 248 | public String uploadBase64Img(String base) throws Exception { |
| ... | ... | @@ -320,15 +328,5 @@ public class OutEntrance { |
| 320 | 328 | return traffic.get("trafficStatus").toString(); |
| 321 | 329 | } |
| 322 | 330 | |
| 323 | - public boolean validation(long timestamp,String sign){ | |
| 324 | - String md5String=Md5Util.getMd5(timestamp+PASSWORD); | |
| 325 | - if(!md5String.equals(sign)){ | |
| 326 | - return false; | |
| 327 | - } | |
| 328 | - if(System.currentTimeMillis()-timestamp>60*1000){ | |
| 329 | - return false; | |
| 330 | - } | |
| 331 | - return true; | |
| 332 | - } | |
| 333 | 331 | |
| 334 | 332 | } | ... | ... |
src/main/java/com/bsth/filter/BaseFilter.java
| ... | ... | @@ -20,7 +20,7 @@ public abstract class BaseFilter implements Filter { |
| 20 | 20 | Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, |
| 21 | 21 | Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS, Constants.UP_RFID_URL, |
| 22 | 22 | Constants.STATION_AND_SECTION_COUNT, Constants.ACTUATOR_MANAGEMENT_HEALTH, Constants.VEHICLE_DATA_SYNC_URL, |
| 23 | - Constants.FILE_AUTH,Constants.OUT_URL}; | |
| 23 | + Constants.FILE_AUTH,Constants.OUT_URL,Constants.NOTICE_URL}; | |
| 24 | 24 | |
| 25 | 25 | @Override |
| 26 | 26 | public void destroy() { | ... | ... |
src/main/java/com/bsth/security/WebSecurityConfig.java
| ... | ... | @@ -39,7 +39,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { |
| 39 | 39 | // 白名单 |
| 40 | 40 | web.ignoring().antMatchers(Constants.LOGIN_PAGE, Constants.LOGIN, Constants.ORIGINAL_LOGIN_PAGE, Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.CAPTCHA, |
| 41 | 41 | Constants.SERVICE_INTERFACE, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, |
| 42 | - Constants.UP_RFID_URL, Constants.STATION_AND_SECTION_COUNT, Constants.FILE_AUTH,Constants.OUT_URL); | |
| 42 | + Constants.UP_RFID_URL, Constants.STATION_AND_SECTION_COUNT, Constants.FILE_AUTH,Constants.OUT_URL,Constants.NOTICE_URL); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | @Override | ... | ... |
src/main/java/com/bsth/security/filter/LoginInterceptor.java
| ... | ... | @@ -35,7 +35,7 @@ public class LoginInterceptor implements Filter { |
| 35 | 35 | private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.ORIGINAL_LOGIN_PAGE, Constants.SERVICE_INTERFACE, |
| 36 | 36 | Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.LOGIN, |
| 37 | 37 | Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.UP_RFID_URL, |
| 38 | - Constants.STATION_AND_SECTION_COUNT, Constants.VEHICLE_DATA_SYNC_URL, Constants.FILE_AUTH ,Constants.OUT_URL}; | |
| 38 | + Constants.STATION_AND_SECTION_COUNT, Constants.VEHICLE_DATA_SYNC_URL, Constants.FILE_AUTH ,Constants.OUT_URL,Constants.NOTICE_URL}; | |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | @Override | ... | ... |
src/main/java/com/bsth/util/SignUtils.java
0 → 100644
| 1 | +package com.bsth.util; | |
| 2 | + | |
| 3 | +import com.bsth.service.schedule.utils.Md5Util; | |
| 4 | + | |
| 5 | +public class SignUtils { | |
| 6 | + | |
| 7 | + private static final String PASSWORD="e126853c7f6f43b4857fa8dfe3b28b5d90be9e68"; | |
| 8 | + public static boolean validation(long timestamp,String sign){ | |
| 9 | + String md5String= Md5Util.getMd5(timestamp+PASSWORD); | |
| 10 | + if(!md5String.equals(sign)){ | |
| 11 | + return false; | |
| 12 | + } | |
| 13 | + if(System.currentTimeMillis()-timestamp>60*1000){ | |
| 14 | + return false; | |
| 15 | + } | |
| 16 | + return true; | |
| 17 | + } | |
| 18 | +} | ... | ... |
src/main/resources/static/pages/permission/authorize_all/user_auth.html
| ... | ... | @@ -88,6 +88,7 @@ |
| 88 | 88 | <ul class="uk-list uk-list-large uk-list-divider"> |
| 89 | 89 | <li><label><input class="uk-checkbox" type="checkbox" data-event="report_register"> 报备登记</label></li> |
| 90 | 90 | <li><label><input class="uk-checkbox" type="checkbox" data-event="form_report_register"> 报备登记报表</label></li> |
| 91 | + <li><label><input class="uk-checkbox" type="checkbox" data-event="station_notice"> 站牌公告</label></li> | |
| 91 | 92 | </ul> |
| 92 | 93 | </div> |
| 93 | 94 | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/station_notice/add.html
0 → 100644
| 1 | +<div class="uk-modal" id="notice_add_mobal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 600px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>添加公告</h2> | |
| 6 | + </div> | |
| 7 | + <div class="uk-form uk-form-horizontal" id="report_register_form"> | |
| 8 | + <form id="add_head_table"> | |
| 9 | + <input type="hidden" name="NOTICE_BBR" id="NOTICE_BBR" value=""> | |
| 10 | + <input type="hidden" name="NOTICE_XLNAME" id="NOTICE_XLNAME" value=""> | |
| 11 | + | |
| 12 | + <!-- 报备时间 --> | |
| 13 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 14 | + <div class="uk-form-row"> | |
| 15 | + <label class="uk-form-label"> | |
| 16 | + 报备时间: | |
| 17 | + </label> | |
| 18 | + <div class="uk-form-controls"> | |
| 19 | + <input type="text" class="form-control" name="NOTICE_DATE" id="NOTICE_DATE" readonly="readonly"> | |
| 20 | + </div> | |
| 21 | + </div> | |
| 22 | + </div> | |
| 23 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 24 | + <div class="uk-form-row"> | |
| 25 | + <label class="uk-form-label"> | |
| 26 | + 公告截止: | |
| 27 | + </label> | |
| 28 | + <div class="uk-form-controls"> | |
| 29 | + <input class="form-control" type="text" name="NOTICE_TIME" id="NOTICE_TIME"> | |
| 30 | + </div> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + <!-- 类型 --> | |
| 34 | + <div class="uk-grid uk-width-2-3 uk-container-center" hidden> | |
| 35 | + <div class="uk-form-row"> | |
| 36 | + <label class="uk-form-label"> | |
| 37 | + 类型: | |
| 38 | + </label> | |
| 39 | + <div class="uk-form-controls"> | |
| 40 | + <select class="form-control typeSelect" name="NOTICE_TYPE" id="NOTICE_TYPE"> | |
| 41 | + <option value="1">突发事件</option> | |
| 42 | + <option value="2">区域公告</option> | |
| 43 | + </select> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + </form> | |
| 48 | + | |
| 49 | + <!-- 突发事件--> | |
| 50 | + <form id="add_emergency_table" class="c_register_form" style="display:none; margin-top: 35px;"> | |
| 51 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 52 | + <div class="uk-form-row"> | |
| 53 | + <label class="uk-form-label"> | |
| 54 | + 线路: | |
| 55 | + </label> | |
| 56 | + <div class="uk-form-controls"> | |
| 57 | + <select class="form-control lineSelect" name="NOTICE_XL" id="NOTICE_XL"> | |
| 58 | + </select> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 63 | + <div class="uk-form-row"> | |
| 64 | + <label class="uk-form-label"> | |
| 65 | + 方向: | |
| 66 | + </label> | |
| 67 | + <div class="uk-form-controls"> | |
| 68 | + <select class="form-control typeSelect" name="NOTICE_XSFX" id="NOTICE_XSFX" > | |
| 69 | + <option value="0">上行</option> | |
| 70 | + <option value="1">下行</option> | |
| 71 | + </select> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 76 | + <div class="uk-form-row"> | |
| 77 | + <label class="uk-form-label"> | |
| 78 | + 突发事件: | |
| 79 | + </label> | |
| 80 | + <div class="uk-form-controls"> | |
| 81 | + <select class="form-control typeSelect" name="NOTICE_TFSJ" id="NOTICE_TFSJ" > | |
| 82 | + <option value="1">重大活动</option> | |
| 83 | + <option value="2">恶劣天气</option> | |
| 84 | + <option value="3">交通事故</option> | |
| 85 | + <option value="3">道路拥堵</option> | |
| 86 | + </select> | |
| 87 | + </div> | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 91 | + <div class="uk-form-row"> | |
| 92 | + <label class="uk-form-label"> | |
| 93 | + 事件影响: | |
| 94 | + </label> | |
| 95 | + <div class="uk-form-controls"> | |
| 96 | + <select class="form-control typeSelect" name="NOTICE_SJYX" id="NOTICE_SJYX" > | |
| 97 | + <option value="1">临时改道</option> | |
| 98 | + <option value="2">班次延误</option> | |
| 99 | + </select> | |
| 100 | + </div> | |
| 101 | + </div> | |
| 102 | + </div> | |
| 103 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 104 | + <div class="uk-form-row"> | |
| 105 | + <label class="uk-form-label"> | |
| 106 | + 影响站点: | |
| 107 | + </label> | |
| 108 | + <div class="uk-form-controls"> | |
| 109 | + <select class="form-control lineSelect" name="NOTICE_STATION" id="NOTICE_STATION" > | |
| 110 | + </select> | |
| 111 | + </div> | |
| 112 | + </div> | |
| 113 | + </div> | |
| 114 | + <div class="uk-modal-footer uk-text-right"> | |
| 115 | + <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> | |
| 116 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 117 | + <button type="submit" class="uk-button uk-button-primary submitBtn"><i class="uk-icon-check"></i> 保存</button> | |
| 118 | + </div> | |
| 119 | + </form> | |
| 120 | + <!-- 区域公告--> | |
| 121 | + <form id="add_regional_table" class="c_register_form" style="display:none; margin-top: 35px;"> | |
| 122 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 123 | + <div class="uk-form-row"> | |
| 124 | + <label class="uk-form-label"> | |
| 125 | + 区域: | |
| 126 | + </label> | |
| 127 | + <div class="uk-form-controls"> | |
| 128 | + <select class="form-control lineSelect" name="NOTICE_QY" id="NOTICE_QY"> | |
| 129 | + <option value='0'>全部</option> | |
| 130 | + <option value='1'>区域1</option> | |
| 131 | + <option value='2'>区域2</option> | |
| 132 | + <option value='3'>区域3</option> | |
| 133 | + </select> | |
| 134 | + </div> | |
| 135 | + </div> | |
| 136 | + </div> | |
| 137 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 138 | + <div class="uk-form-row"> | |
| 139 | + <label class="uk-form-label"> | |
| 140 | + 公告信息: | |
| 141 | + </label> | |
| 142 | + <div class="uk-form-controls"> | |
| 143 | + <select class="form-control typeSelect" name="NOTICE_GG" id="NOTICE_GG" style="max-width: 220px"> | |
| 144 | + <option value="0">雨天路滑,安全出行。</option> | |
| 145 | + <option value="1">高峰时段,道路拥堵,请乘客合理安排出行。</option> | |
| 146 | + <option value="2">请先下后上,注意乘车安全。</option> | |
| 147 | + </select> | |
| 148 | + </div> | |
| 149 | + </div> | |
| 150 | + </div> | |
| 151 | + <div class="uk-modal-footer uk-text-right"> | |
| 152 | + <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> | |
| 153 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 154 | + <button type="submit" class="uk-button uk-button-primary submitBtn"><i class="uk-icon-check"></i> 保存</button> | |
| 155 | + </div> | |
| 156 | + </form> | |
| 157 | + </div> | |
| 158 | + </div> | |
| 159 | + | |
| 160 | + <script> | |
| 161 | + (function () { | |
| 162 | + var modal = '#notice_add_mobal'; | |
| 163 | + var tableActive = '',formActive = ''; | |
| 164 | + var NOTICE_TYPE, | |
| 165 | + lineList = {}, | |
| 166 | + user = {}; | |
| 167 | + var stationRoutes = []; | |
| 168 | + //加载站点 | |
| 169 | + $("#NOTICE_XL").on("change", function(){ | |
| 170 | + var lineCode = $(this).val(); | |
| 171 | + var direction = $('#NOTICE_XSFX').val(); | |
| 172 | + loadStation(lineCode,direction); | |
| 173 | + | |
| 174 | + }); | |
| 175 | + $("#NOTICE_XSFX").on("change", function(){ | |
| 176 | + var lineCode = $('#NOTICE_XL').val(); | |
| 177 | + var direction = $(this).val(); | |
| 178 | + loadStation(lineCode,direction); | |
| 179 | + }); | |
| 180 | + | |
| 181 | + $(modal).on('init', function (e, data) { | |
| 182 | + $('#NOTICE_DATE').datetimepicker({ | |
| 183 | + format : 'YYYY-MM-DD HH:mm:ss', | |
| 184 | + locale : 'zh-cn' | |
| 185 | + }); | |
| 186 | + $("#NOTICE_TIME").datetimepicker({ | |
| 187 | + format : 'YYYY-MM-DD HH:mm:ss', | |
| 188 | + locale : 'zh-cn' | |
| 189 | + }); | |
| 190 | + var dateTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss'); | |
| 191 | + var d = new Date(); | |
| 192 | + d.setTime(d.getTime() + 1*1000*60*60*24); | |
| 193 | + var dateTime2 = moment(d).format('YYYY-MM-DD HH:mm:ss'); | |
| 194 | + $('#NOTICE_DATE').val(dateTime); | |
| 195 | + $("#NOTICE_TIME").val(dateTime2); | |
| 196 | + tableActive = "add_"+data.tableActive; | |
| 197 | + var typeInt = 1; | |
| 198 | + if (tableActive == 'add_emergency_table') { | |
| 199 | + typeInt = 1; | |
| 200 | + } else if (tableActive == 'add_regional_table') { | |
| 201 | + typeInt = 2; | |
| 202 | + } else { | |
| 203 | + UIkit.modal(modal).hide(); | |
| 204 | + notify_err('您所选的数据有问题,请重新选择!'); | |
| 205 | + return; | |
| 206 | + } | |
| 207 | + $('#NOTICE_TYPE').val(typeInt); | |
| 208 | + document.getElementById(tableActive).style.display = ""; | |
| 209 | + user = data.user; | |
| 210 | + $('#NOTICE_BBR').val(user.userName+'/'+user.name); | |
| 211 | + //加载线路 | |
| 212 | + lineList = data.lineList; | |
| 213 | + var options = ''; | |
| 214 | + $.each(lineList, function (i,line) { | |
| 215 | + options += '<option value='+line.lineCode+'>'+line.name+'</option>'; | |
| 216 | + }); | |
| 217 | + $('#NOTICE_XL').html(options); | |
| 218 | + // 模拟change给公司分公司赋值 | |
| 219 | + $('#NOTICE_XL').trigger("change"); | |
| 220 | + changeType(tableActive); | |
| 221 | + | |
| 222 | + $('#NOTICE_TYPE').on('change',function () { | |
| 223 | + document.getElementById(tableActive).style.display = "none"; | |
| 224 | + NOTICE_TYPE = this.value; | |
| 225 | + if (NOTICE_TYPE == 1) { | |
| 226 | + tableActive = 'add_emergency_table'; | |
| 227 | + } else if (NOTICE_TYPE == 2) { | |
| 228 | + tableActive = 'add_regional_table'; | |
| 229 | + } | |
| 230 | + document.getElementById(tableActive).style.display = ""; | |
| 231 | + changeType(tableActive); | |
| 232 | + }); | |
| 233 | + }); | |
| 234 | + | |
| 235 | + function loadStation(lineCode,direction){ | |
| 236 | + //站点路由 | |
| 237 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(lineCode).sort(function (a, b) { | |
| 238 | + return a.stationRouteCode - b.stationRouteCode; | |
| 239 | + }), 'directions')[direction]; | |
| 240 | + var options = ''; | |
| 241 | + $.each(stationRoutes, function (i,station) { | |
| 242 | + options += '<option value='+station.stationCode+'>'+station.stationName+'</option>'; | |
| 243 | + }); | |
| 244 | + $('#NOTICE_STATION').html(options); | |
| 245 | + // 模拟change给公司分公司赋值 | |
| 246 | + $('#NOTICE_STATION').trigger("change"); | |
| 247 | + } | |
| 248 | + function changeType(tableActiveStr) { | |
| 249 | + formActive = $('#'+tableActiveStr); | |
| 250 | + //校验不过 | |
| 251 | + formActive.on('err.field.fv', function () { | |
| 252 | + $('#submitChildTaskBtn', modal).removeClass('disabled').removeAttr('disabled'); | |
| 253 | + }); | |
| 254 | + | |
| 255 | + //校验 | |
| 256 | + formActive.formValidation({framework: 'uikit', locale: 'zh_CN'}); | |
| 257 | + //提交 | |
| 258 | + formActive.on('success.form.fv', function (e) { | |
| 259 | + e.preventDefault(); | |
| 260 | + var headData = $('#add_head_table').serializeJSON(); | |
| 261 | + var bodyData = $(formActive).serializeJSON(); | |
| 262 | + var params = {}; | |
| 263 | + Object.assign(params,headData,bodyData); | |
| 264 | + params.STATUS = 0; | |
| 265 | + gb_common.$post('/notice/', params, function (rs) { | |
| 266 | + if(rs.status == 'SUCCESS'){ | |
| 267 | + UIkit.modal(modal).hide(); | |
| 268 | + notify_succ('新增成功!'); | |
| 269 | + manageJs.refreshDate(); | |
| 270 | + } else | |
| 271 | + notify_err('新增失败!'); | |
| 272 | + | |
| 273 | + }); | |
| 274 | + }); | |
| 275 | + } | |
| 276 | + | |
| 277 | + //submit | |
| 278 | + $('.submitBtn', modal).on('click', function () { | |
| 279 | + $(this).addClass('disabled').attr('disabled', 'disabled'); | |
| 280 | + formActive.data('valid', false); | |
| 281 | + formActive.formValidation('validate'); | |
| 282 | + }); | |
| 283 | + })(); | |
| 284 | + </script> | |
| 285 | +</div> | |
| 0 | 286 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/station_notice/css/main.css
0 → 100644
| 1 | + | |
| 2 | +.report-register-table1 dl dt:nth-of-type(1), .report-register-table1 dl dd:nth-of-type(1) { | |
| 3 | + width: 2%; | |
| 4 | +} | |
| 5 | +.report-register-table1 dl dt:nth-of-type(2), .report-register-table1 dl dd:nth-of-type(2) { | |
| 6 | + width: 4%; | |
| 7 | +} | |
| 8 | +.report-register-table1 dl dt:nth-of-type(3), .report-register-table1 dl dd:nth-of-type(3) { | |
| 9 | + width: 7%; | |
| 10 | +} | |
| 11 | +.report-register-table1 dl dt:nth-of-type(4), .report-register-table1 dl dd:nth-of-type(4) { | |
| 12 | + width: 7%; | |
| 13 | +} | |
| 14 | +.report-register-table1 dl dt:nth-of-type(5), .report-register-table1 dl dd:nth-of-type(5) { | |
| 15 | + width: 7%; | |
| 16 | +} | |
| 17 | +.report-register-table1 dl dt:nth-of-type(6), .report-register-table1 dl dd:nth-of-type(6) { | |
| 18 | + width: 7%; | |
| 19 | +} | |
| 20 | +.report-register-table1 dl dt:nth-of-type(7), .report-register-table1 dl dd:nth-of-type(7) { | |
| 21 | + width: 10%; | |
| 22 | +} | |
| 23 | +.report-register-table1 dl dt:nth-of-type(8), .report-register-table1 dl dd:nth-of-type(8) { | |
| 24 | + width: 7%; | |
| 25 | +} | |
| 26 | +.report-register-table1 dl dt:nth-of-type(9), .report-register-table1 dl dd:nth-of-type(9) { | |
| 27 | + width: 7%; | |
| 28 | +} | |
| 29 | +.report-register-table1 dl dt:nth-of-type(10), .report-register-table1 dl dd:nth-of-type(10) { | |
| 30 | + width: 7%; | |
| 31 | +} | |
| 32 | +.report-register-table1 dl dt:nth-of-type(11), .report-register-table1 dl dd:nth-of-type(11) { | |
| 33 | + width: 7%; | |
| 34 | +} | |
| 35 | +.report-register-table1 dl dt:nth-of-type(12), .report-register-table1 dl dd:nth-of-type(12) { | |
| 36 | + width: 7%; | |
| 37 | +} | |
| 38 | +.report-register-table1 dl dt:nth-of-type(13), .report-register-table1 dl dd:nth-of-type(13) { | |
| 39 | + width: 7%; | |
| 40 | +} | |
| 41 | +.report-register-table1 dl dt:nth-of-type(14), .report-register-table1 dl dd:nth-of-type(14) { | |
| 42 | + width: 7%; | |
| 43 | +} | |
| 44 | +.report-register-table1 dl dt:nth-of-type(15), .report-register-table1 dl dd:nth-of-type(15) { | |
| 45 | + width: 7%; | |
| 46 | +} | |
| 47 | +.report-register-table1 dl dt:nth-of-type(16), .report-register-table1 dl dd:nth-of-type(16) { | |
| 48 | + width: 7%; | |
| 49 | +} | |
| 50 | +.report-register-table1 dl dt:nth-of-type(17), .report-register-table1 dl dd:nth-of-type(17) { | |
| 51 | + width: 7%; | |
| 52 | +} | |
| 53 | +.report-register-table1 dl dt:nth-of-type(18), .report-register-table1 dl dd:nth-of-type(18) { | |
| 54 | + width: 7%; | |
| 55 | +} | |
| 56 | + | |
| 57 | + | |
| 58 | +.report-register-table2 dl dt:nth-of-type(1), .report-register-table2 dl dd:nth-of-type(1) { | |
| 59 | + width: 2%; | |
| 60 | +} | |
| 61 | +.report-register-table2 dl dt:nth-of-type(2), .report-register-table2 dl dd:nth-of-type(2) { | |
| 62 | + width: 4%; | |
| 63 | +} | |
| 64 | +.report-register-table2 dl dt:nth-of-type(3), .report-register-table2 dl dd:nth-of-type(3) { | |
| 65 | + width: 7%; | |
| 66 | +} | |
| 67 | +.report-register-table2 dl dt:nth-of-type(4), .report-register-table2 dl dd:nth-of-type(4) { | |
| 68 | + width: 7%; | |
| 69 | +} | |
| 70 | +.report-register-table2 dl dt:nth-of-type(5), .report-register-table2 dl dd:nth-of-type(5) { | |
| 71 | + width: 7%; | |
| 72 | +} | |
| 73 | +.report-register-table2 dl dt:nth-of-type(6), .report-register-table2 dl dd:nth-of-type(6) { | |
| 74 | + width: 7%; | |
| 75 | +} | |
| 76 | +.report-register-table2 dl dt:nth-of-type(7), .report-register-table2 dl dd:nth-of-type(7) { | |
| 77 | + width: 7%; | |
| 78 | +} | |
| 79 | +.report-register-table2 dl dt:nth-of-type(8), .report-register-table2 dl dd:nth-of-type(8) { | |
| 80 | + width: 7%; | |
| 81 | +} | |
| 82 | +.report-register-table2 dl dt:nth-of-type(9), .report-register-table2 dl dd:nth-of-type(9) { | |
| 83 | + width: 7%; | |
| 84 | +} | |
| 85 | +.report-register-table2 dl dt:nth-of-type(10), .report-register-table2 dl dd:nth-of-type(10) { | |
| 86 | + width: 7%; | |
| 87 | +} | |
| 88 | +.report-register-table2 dl dt:nth-of-type(11), .report-register-table2 dl dd:nth-of-type(11) { | |
| 89 | + width: 7%; | |
| 90 | +} | |
| 91 | + | |
| 92 | +.report-register-table3 dl dt:nth-of-type(1), .report-register-table3 dl dd:nth-of-type(1) { | |
| 93 | + width: 2%; | |
| 94 | +} | |
| 95 | +.report-register-table3 dl dt:nth-of-type(2), .report-register-table3 dl dd:nth-of-type(2) { | |
| 96 | + width: 4%; | |
| 97 | +} | |
| 98 | +.report-register-table3 dl dt:nth-of-type(3), .report-register-table3 dl dd:nth-of-type(3) { | |
| 99 | + width: 7%; | |
| 100 | +} | |
| 101 | +.report-register-table3 dl dt:nth-of-type(4), .report-register-table3 dl dd:nth-of-type(4) { | |
| 102 | + width: 7%; | |
| 103 | +} | |
| 104 | +.report-register-table3 dl dt:nth-of-type(5), .report-register-table3 dl dd:nth-of-type(5) { | |
| 105 | + width: 12%; | |
| 106 | +} | |
| 107 | +.report-register-table3 dl dt:nth-of-type(6), .report-register-table3 dl dd:nth-of-type(6) { | |
| 108 | + width: 7%; | |
| 109 | +} | |
| 110 | +.report-register-table3 dl dt:nth-of-type(7), .report-register-table3 dl dd:nth-of-type(7) { | |
| 111 | + width: 7%; | |
| 112 | +} | |
| 113 | +.report-register-table3 dl dt:nth-of-type(8), .report-register-table3 dl dd:nth-of-type(8) { | |
| 114 | + width: 7%; | |
| 115 | +} | |
| 116 | +.report-register-table3 dl dt:nth-of-type(9), .report-register-table3 dl dd:nth-of-type(9) { | |
| 117 | + width: 7%; | |
| 118 | +} | |
| 119 | +.report-register-table3 dl dt:nth-of-type(10), .report-register-table3 dl dd:nth-of-type(10) { | |
| 120 | + width: 7%; | |
| 121 | +} | |
| 122 | + | |
| 123 | +.report-register-table4 dl dt:nth-of-type(1), .report-register-table4 dl dd:nth-of-type(1) { | |
| 124 | + width: 2%; | |
| 125 | +} | |
| 126 | +.report-register-table4 dl dt:nth-of-type(2), .report-register-table4 dl dd:nth-of-type(2) { | |
| 127 | + width: 4%; | |
| 128 | +} | |
| 129 | +.report-register-table4 dl dt:nth-of-type(3), .report-register-table4 dl dd:nth-of-type(3) { | |
| 130 | + width: 7%; | |
| 131 | +} | |
| 132 | +.report-register-table4 dl dt:nth-of-type(4), .report-register-table4 dl dd:nth-of-type(4) { | |
| 133 | + width: 7%; | |
| 134 | +} | |
| 135 | +.report-register-table4 dl dt:nth-of-type(5), .report-register-table4 dl dd:nth-of-type(5) { | |
| 136 | + width: 7%; | |
| 137 | +} | |
| 138 | +.report-register-table4 dl dt:nth-of-type(6), .report-register-table4 dl dd:nth-of-type(6) { | |
| 139 | + width: 7%; | |
| 140 | +} | |
| 141 | +.report-register-table4 dl dt:nth-of-type(7), .report-register-table4 dl dd:nth-of-type(7) { | |
| 142 | + width: 7%; | |
| 143 | +} | |
| 144 | +.report-register-table4 dl dt:nth-of-type(8), .report-register-table4 dl dd:nth-of-type(8) { | |
| 145 | + width: 9%; | |
| 146 | +} | |
| 147 | +.report-register-table4 dl dt:nth-of-type(9), .report-register-table4 dl dd:nth-of-type(9) { | |
| 148 | + width: 12%; | |
| 149 | +} | |
| 150 | +.report-register-table4 dl dt:nth-of-type(10), .report-register-table4 dl dd:nth-of-type(10) { | |
| 151 | + width: 7%; | |
| 152 | +} | |
| 153 | +.report-register-table4 dl dt:nth-of-type(11), .report-register-table4 dl dd:nth-of-type(11) { | |
| 154 | + width: 7%; | |
| 155 | +} | |
| 156 | +.report-register-table4 dl dt:nth-of-type(12), .report-register-table4 dl dd:nth-of-type(12) { | |
| 157 | + width: 20%; | |
| 158 | +} | |
| 159 | +.report-register-table4 dl dt:nth-of-type(13), .report-register-table4 dl dd:nth-of-type(13) { | |
| 160 | + width: 7%; | |
| 161 | +} | |
| 162 | +.report-register-table4 dl dt:nth-of-type(14), .report-register-table4 dl dd:nth-of-type(14) { | |
| 163 | + width: 7%; | |
| 164 | +} | |
| 165 | +.report-register-table4 dl dt:nth-of-type(15), .report-register-table4 dl dd:nth-of-type(15) { | |
| 166 | + width: 7%; | |
| 167 | +} | |
| 168 | +.report-register-table4 dl dt:nth-of-type(16), .report-register-table4 dl dd:nth-of-type(16) { | |
| 169 | + width: 7%; | |
| 170 | +} | |
| 171 | +.report-register-table4 dl dt:nth-of-type(17), .report-register-table4 dl dd:nth-of-type(17) { | |
| 172 | + width: 7%; | |
| 173 | +} | |
| 174 | + | |
| 175 | + | |
| 176 | +.report-register-table5 dl dt:nth-of-type(1), .report-register-table5 dl dd:nth-of-type(1) { | |
| 177 | + width: 2%; | |
| 178 | +} | |
| 179 | +.report-register-table5 dl dt:nth-of-type(2), .report-register-table5 dl dd:nth-of-type(2) { | |
| 180 | + width: 4%; | |
| 181 | +} | |
| 182 | +.report-register-table5 dl dt:nth-of-type(3), .report-register-table5 dl dd:nth-of-type(3) { | |
| 183 | + width: 7%; | |
| 184 | +} | |
| 185 | +.report-register-table5 dl dt:nth-of-type(4), .report-register-table5 dl dd:nth-of-type(4) { | |
| 186 | + width: 7%; | |
| 187 | +} | |
| 188 | +.report-register-table5 dl dt:nth-of-type(5), .report-register-table5 dl dd:nth-of-type(5) { | |
| 189 | + width: 7%; | |
| 190 | +} | |
| 191 | + | |
| 192 | + | |
| 193 | +.report-register-table6 dl dt:nth-of-type(1), .report-register-table6 dl dd:nth-of-type(1) { | |
| 194 | + width: 2%; | |
| 195 | +} | |
| 196 | +.report-register-table6 dl dt:nth-of-type(2), .report-register-table6 dl dd:nth-of-type(2) { | |
| 197 | + width: 4%; | |
| 198 | +} | |
| 199 | +.report-register-table6 dl dt:nth-of-type(3), .report-register-table6 dl dd:nth-of-type(3) { | |
| 200 | + width: 7%; | |
| 201 | +} | |
| 202 | +.report-register-table6 dl dt:nth-of-type(4), .report-register-table6 dl dd:nth-of-type(4) { | |
| 203 | + width: 7%; | |
| 204 | +} | |
| 205 | +.report-register-table6 dl dt:nth-of-type(5), .report-register-table6 dl dd:nth-of-type(5) { | |
| 206 | + width: 7%; | |
| 207 | +} | |
| 208 | +.report-register-table6 dl dt:nth-of-type(6), .report-register-table6 dl dd:nth-of-type(6) { | |
| 209 | + width: 7%; | |
| 210 | +} | |
| 211 | +.form-control { | |
| 212 | + display: block; | |
| 213 | + width: 100%; | |
| 214 | + height: 34px; | |
| 215 | + padding: 6px 12px; | |
| 216 | + font-size: 14px; | |
| 217 | + line-height: 1.42857; | |
| 218 | + color: #555555; | |
| 219 | + background-color: #fff; | |
| 220 | + background-image: none; | |
| 221 | + border: 1px solid #c2cad8; | |
| 222 | + border-radius: 4px; | |
| 223 | + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); | |
| 224 | + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); | |
| 225 | + -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; | |
| 226 | + -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; | |
| 227 | + transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; } | |
| 0 | 228 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/station_notice/list.html
0 → 100644
| 1 | +<div class="uk-modal ct_move_modal" id="report-register-modal"> | |
| 2 | + <!-- editable --> | |
| 3 | + <!--<link href="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet" type="text/css" />--> | |
| 4 | + <!-- Bootstrap style --> | |
| 5 | + <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
| 6 | + <!-- select2 下拉框插件 --> | |
| 7 | + <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" | |
| 8 | + rel="stylesheet" type="text/css" /> | |
| 9 | + <link | |
| 10 | + href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" | |
| 11 | + rel="stylesheet" type="text/css" /> | |
| 12 | + <style> | |
| 13 | + /*ul.navigation_bar:before {*/ | |
| 14 | + /*content: "报备类型";*/ | |
| 15 | + /*position: absolute;*/ | |
| 16 | + /*top: -9px;*/ | |
| 17 | + /*font-size: 12px;*/ | |
| 18 | + /*background: white;*/ | |
| 19 | + /*padding: 0 4px;*/ | |
| 20 | + /*color: #7d7b7b;*/ | |
| 21 | + /*left: 10px;*/ | |
| 22 | + /*}*/ | |
| 23 | + </style> | |
| 24 | + <div class="uk-modal-dialog" style="width: 1800px;"> | |
| 25 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 26 | + <div class="uk-modal-header"> | |
| 27 | + <h2>报备登记报表</h2> | |
| 28 | + </div> | |
| 29 | + | |
| 30 | + | |
| 31 | + <div style="padding-left: 12px;margin: 10px 0"> | |
| 32 | + <ul class="uk-subnav uk-subnav-pill navigation_bar"> | |
| 33 | + <li id="first_last_late" class="uk-active"><a>首末班误点</a></li> | |
| 34 | + <li id="large_interval"><a>大间隔</a></li> | |
| 35 | + <li id="emergency"><a>突发事件</a></li> | |
| 36 | + <li id="detour"><a>绕改道</a></li> | |
| 37 | +<!-- <li id="accident"><a>事故</a></li> --> | |
| 38 | + <li id="rests"><a>其他</a></li> | |
| 39 | +<!-- <li id="consult"><a>咨询</a></li> --> | |
| 40 | + </ul> | |
| 41 | + </div> | |
| 42 | + | |
| 43 | + <div class="uk-panel uk-panel-box uk-panel-box-primary" style="margin: 10px 0;"> | |
| 44 | + <!--<form class="uk-form search-form">--> | |
| 45 | + <!--<fieldset data-uk-margin>--> | |
| 46 | + <span class="horizontal-field">线路</span> | |
| 47 | + <select name="line" id="line" style="width: 180px;"></select> | |
| 48 | + <span class="horizontal-field">时间</span> | |
| 49 | + <input class=" horizontal-field" type="text" id="date1" style="width: 180px;"/> - | |
| 50 | + <input class="horizontal-field" type="text" id="date2" style="width: 180px;"/> | |
| 51 | + | |
| 52 | + <button class="uk-button horizontal-field" id="query">检索</button> | |
| 53 | + <button class="uk-button horizontal-field" id="export">导出</button> | |
| 54 | + <!--</fieldset>--> | |
| 55 | + <!--</form>--> | |
| 56 | + </div> | |
| 57 | + | |
| 58 | + <div class="ct_table_wrap" style="height: 510px"> | |
| 59 | + <!-- 首末班误点--> | |
| 60 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table active" id="first_last_late_table"> | |
| 61 | + <thead > | |
| 62 | + <tr role="row"> | |
| 63 | + <th width="2%">序号</th> | |
| 64 | + <th width="5%">报备时间</th> | |
| 65 | + <th width="5%">报备人</th> | |
| 66 | + <th width="5%">公司</th> | |
| 67 | + <th width="5%">分公司</th> | |
| 68 | + <th width="7%">线路</th> | |
| 69 | + <th width="7%">延误站点</th> | |
| 70 | + <th width="5%">延误时间</th> | |
| 71 | + <th width="10%">首末班延误原因</th> | |
| 72 | + </tr> | |
| 73 | + </thead> | |
| 74 | + <tbody class="table_body"> | |
| 75 | + </tbody> | |
| 76 | + </table> | |
| 77 | + <!-- 大间隔--> | |
| 78 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="large_interval_table"> | |
| 79 | + <thead > | |
| 80 | + <tr role="row"> | |
| 81 | + <th width="2%">序号</th> | |
| 82 | + <th width="5%">报备时间</th> | |
| 83 | + <th width="5%">报备人</th> | |
| 84 | + <th width="5%">公司</th> | |
| 85 | + <th width="5%">分公司</th> | |
| 86 | + <th width="7%">线路</th> | |
| 87 | + <th width="7%">路段</th> | |
| 88 | + <th width="7%">行驶方向</th> | |
| 89 | + <th width="7%">站点</th> | |
| 90 | + <th width="7%">大间隔时间</th> | |
| 91 | + <th width="7%">大间隔原因</th> | |
| 92 | + </tr> | |
| 93 | + </thead> | |
| 94 | + <tbody class="table_body"> | |
| 95 | + </tbody> | |
| 96 | + </table> | |
| 97 | + <!-- 突发事件--> | |
| 98 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="emergency_table"> | |
| 99 | + <thead > | |
| 100 | + <tr role="row"> | |
| 101 | + <th width="2%">序号</th> | |
| 102 | + <th width="5%">报备时间</th> | |
| 103 | + <th width="5%">报备人</th> | |
| 104 | + <th width="5%">公司</th> | |
| 105 | + <th width="5%">分公司</th> | |
| 106 | + <th width="7%">影响线路</th> | |
| 107 | + <th width="7%">重大活动货突发事件</th> | |
| 108 | + <th width="7%">影响时间</th> | |
| 109 | + <th width="7%">影响班次数</th> | |
| 110 | + <th width="7%">调整措施</th> | |
| 111 | + </tr> | |
| 112 | + </thead> | |
| 113 | + <tbody class="table_body"> | |
| 114 | + </tbody> | |
| 115 | + </table> | |
| 116 | + <!-- 事故--> | |
| 117 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="accident_table"> | |
| 118 | + <thead > | |
| 119 | + <tr role="row"> | |
| 120 | + <th width="2%">序号</th> | |
| 121 | + <th width="5%">报备时间</th> | |
| 122 | + <th width="5%">报备人</th> | |
| 123 | + <th width="5%">公司</th> | |
| 124 | + <th width="5%">分公司</th> | |
| 125 | + <th width="5%">线路</th> | |
| 126 | + <th width="5%">车辆自编号</th> | |
| 127 | + <th width="5%">驾驶员</th> | |
| 128 | + <th width="5%">事故发生时间</th> | |
| 129 | + <th width="5%">事故发生地点</th> | |
| 130 | + <th width="5%">行驶方向</th> | |
| 131 | + <th width="5%">事故对象</th> | |
| 132 | + <th width="5%">对象车牌号</th> | |
| 133 | + <th width="5%">事故概况</th> | |
| 134 | + <th width="5%">受伤人数</th> | |
| 135 | + <th width="5%">死亡人数</th> | |
| 136 | + <th width="5%">报告人</th> | |
| 137 | + <th width="5%">报告人电话</th> | |
| 138 | + <th width="5%">备注</th> | |
| 139 | + </tr> | |
| 140 | + </thead> | |
| 141 | + <tbody class="table_body"> | |
| 142 | + </tbody> | |
| 143 | + </table> | |
| 144 | + <!-- 绕改道--> | |
| 145 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="detour_table"> | |
| 146 | + <thead class=""> | |
| 147 | + <tr role="row"> | |
| 148 | + <th width="2%">序号</th> | |
| 149 | + <th width="5%">报备时间</th> | |
| 150 | + <th width="5%">报备人</th> | |
| 151 | + <th width="5%">公司</th> | |
| 152 | + <th width="5%">分公司</th> | |
| 153 | + <th width="5%">线路</th> | |
| 154 | + <th width="5%">路段</th> | |
| 155 | + <th width="5%">行驶方向</th> | |
| 156 | + <th width="5%">跳站</th> | |
| 157 | + <th width="7%">原因</th> | |
| 158 | + </tr> | |
| 159 | + </thead> | |
| 160 | + <tbody class="table_body"> | |
| 161 | + </tbody> | |
| 162 | + </table> | |
| 163 | + <!-- 其他--> | |
| 164 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="rests_table"> | |
| 165 | + <tr role="row"> | |
| 166 | + <th width="2%">序号</th> | |
| 167 | + <th width="5%">报备时间</th> | |
| 168 | + <th width="5%">报备人</th> | |
| 169 | + <th width="5%">公司</th> | |
| 170 | + <th width="5%">分公司</th> | |
| 171 | + <th width="7%">线路</th> | |
| 172 | + <th width="7%">报备内容</th> | |
| 173 | + </tr> | |
| 174 | + </thead> | |
| 175 | + <tbody class="table_body"> | |
| 176 | + </tbody> | |
| 177 | + </table> | |
| 178 | + <!-- 咨询--> | |
| 179 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="consult_table"> | |
| 180 | + <thead > | |
| 181 | + <tr role="row"> | |
| 182 | + <th width="2%">序号</th> | |
| 183 | + <th width="5%">报备时间</th> | |
| 184 | + <th width="5%">报备人</th> | |
| 185 | + <th width="5%">公司</th> | |
| 186 | + <th width="5%">分公司</th> | |
| 187 | + <th width="7%">线路</th> | |
| 188 | + <th width="7%">班线名称</th> | |
| 189 | + <th width="7%">内容</th> | |
| 190 | + </tr> | |
| 191 | + </thead> | |
| 192 | + <tbody class="table_body"> | |
| 193 | + </tbody> | |
| 194 | + </table> | |
| 195 | + </div> | |
| 196 | + | |
| 197 | + <div class="load-panel"> | |
| 198 | + <i class="uk-icon-spinner uk-icon-spin"></i> | |
| 199 | + 正在加载数据 | |
| 200 | + </div> | |
| 201 | + </div> | |
| 202 | + | |
| 203 | + <script id="first_last_late_table_body_list" type="text/html"> | |
| 204 | + {{each data.list as obj i}} | |
| 205 | + {{if obj.status == 2}} | |
| 206 | + <tr style="background-color: #ff5f78"> | |
| 207 | + {{else}} | |
| 208 | + <tr> | |
| 209 | + {{/if}} | |
| 210 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 211 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 212 | + <td style="vertical-align: middle;">{{obj.report_BBR}}</td> | |
| 213 | + <td style="vertical-align: middle;">{{obj.report_GSNAME}}</td> | |
| 214 | + <td style="vertical-align: middle;">{{obj.report_FGSNAME}}</td> | |
| 215 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 216 | + <td style="vertical-align: middle;">{{obj.report_STATION}}</td> | |
| 217 | + <td style="vertical-align: middle;">{{obj.report_YWSJ}}</td> | |
| 218 | + <td style="vertical-align: middle;">{{obj.report_SMBWD}}</td> | |
| 219 | + </tr> | |
| 220 | + {{/each}} | |
| 221 | + </script> | |
| 222 | + <script id="large_interval_table_body_list" type="text/html"> | |
| 223 | + {{each data.list as obj i}} | |
| 224 | + {{if obj.status == 2}} | |
| 225 | + <tr style="background-color: #ff5f78"> | |
| 226 | + {{else}} | |
| 227 | + <tr> | |
| 228 | + {{/if}} | |
| 229 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 230 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 231 | + <td style="vertical-align: middle;">{{obj.report_BBR}}</td> | |
| 232 | + <td style="vertical-align: middle;">{{obj.report_GSNAME}}</td> | |
| 233 | + <td style="vertical-align: middle;">{{obj.report_FGSNAME}}</td> | |
| 234 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 235 | + <td style="vertical-align: middle;">{{obj.report_ROAD}}</td> | |
| 236 | + <td style="vertical-align: middle;">{{obj.report_XSFX}}</td> | |
| 237 | + <td style="vertical-align: middle;">{{obj.report_STATION}}</td> | |
| 238 | + <td style="vertical-align: middle;">{{obj.report_DJGSJ}}</td> | |
| 239 | + <td style="vertical-align: middle;">{{obj.report_DJGYY}}</td> | |
| 240 | + </tr> | |
| 241 | + {{/each}} | |
| 242 | + </script> | |
| 243 | + <script id="emergency_table_body_list" type="text/html"> | |
| 244 | + {{each data.list as obj i}} | |
| 245 | + {{if obj.status == 2}} | |
| 246 | + <tr style="background-color: #ff5f78"> | |
| 247 | + {{else}} | |
| 248 | + <tr> | |
| 249 | + {{/if}} | |
| 250 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 251 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 252 | + <td style="vertical-align: middle;">{{obj.report_BBR}}</td> | |
| 253 | + <td style="vertical-align: middle;">{{obj.report_GSNAME}}</td> | |
| 254 | + <td style="vertical-align: middle;">{{obj.report_FGSNAME}}</td> | |
| 255 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 256 | + <td style="vertical-align: middle;">{{obj.report_TFSJ}}</td> | |
| 257 | + <td style="vertical-align: middle;">{{obj.report_YXSJ}}</td> | |
| 258 | + <td style="vertical-align: middle;">{{obj.report_YXBC}}</td> | |
| 259 | + <td style="vertical-align: middle;">{{obj.report_TZCS}}</td> | |
| 260 | + </tr> | |
| 261 | + {{/each}} | |
| 262 | + </script> | |
| 263 | + <script id="accident_table_body_list" type="text/html"> | |
| 264 | + {{each data.list as obj i}} | |
| 265 | + {{if obj.status == 2}} | |
| 266 | + <tr style="background-color: #ff5f78"> | |
| 267 | + {{else}} | |
| 268 | + <tr> | |
| 269 | + {{/if}} | |
| 270 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 271 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 272 | + <td style="vertical-align: middle;">{{obj.report_BBR}}</td> | |
| 273 | + <td style="vertical-align: middle;">{{obj.report_GSNAME}}</td> | |
| 274 | + <td style="vertical-align: middle;">{{obj.report_FGSNAME}}</td> | |
| 275 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 276 | + <td style="vertical-align: middle;">{{obj.report_ZBH}}</td> | |
| 277 | + <td style="vertical-align: middle;">{{obj.report_JSY}}</td> | |
| 278 | + <td style="vertical-align: middle;">{{obj.report_SGSJ}}</td> | |
| 279 | + <td style="vertical-align: middle;">{{obj.report_SGDD}}</td> | |
| 280 | + <td style="vertical-align: middle;">{{obj.report_XSFX}}</td> | |
| 281 | + <td style="vertical-align: middle;">{{obj.report_SGDX}}</td> | |
| 282 | + <td style="vertical-align: middle;">{{obj.report_DXPZH}}</td> | |
| 283 | + <td style="vertical-align: middle;">{{obj.report_SGGK}}</td> | |
| 284 | + <td style="vertical-align: middle;">{{obj.report_SSRS}}</td> | |
| 285 | + <td style="vertical-align: middle;">{{obj.report_SWRS}}</td> | |
| 286 | + <td style="vertical-align: middle;">{{obj.report_BGR}}</td> | |
| 287 | + <td style="vertical-align: middle;">{{obj.report_BGRDH}}</td> | |
| 288 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 289 | + </tr> | |
| 290 | + {{/each}} | |
| 291 | + </script> | |
| 292 | + <script id="detour_table_body_list" type="text/html"> | |
| 293 | + {{each data.list as obj i}} | |
| 294 | + {{if obj.status == 2}} | |
| 295 | + <tr style="background-color: #ff5f78"> | |
| 296 | + {{else}} | |
| 297 | + <tr> | |
| 298 | + {{/if}} | |
| 299 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 300 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 301 | + <td style="vertical-align: middle;">{{obj.report_BBR}}</td> | |
| 302 | + <td style="vertical-align: middle;">{{obj.report_GSNAME}}</td> | |
| 303 | + <td style="vertical-align: middle;">{{obj.report_FGSNAME}}</td> | |
| 304 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 305 | + <td style="vertical-align: middle;">{{obj.report_ROAD}}</td> | |
| 306 | + <td style="vertical-align: middle;">{{obj.report_XSFX}}</td> | |
| 307 | + <td style="vertical-align: middle;">{{obj.report_SGGK}}</td> | |
| 308 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 309 | + </tr> | |
| 310 | + {{/each}} | |
| 311 | + </script> | |
| 312 | + <script id="rests_table_body_list" type="text/html"> | |
| 313 | + {{each data.list as obj i}} | |
| 314 | + {{if obj.status == 2}} | |
| 315 | + <tr style="background-color: #ff5f78"> | |
| 316 | + {{else}} | |
| 317 | + <tr> | |
| 318 | + {{/if}} | |
| 319 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 320 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 321 | + <td style="vertical-align: middle;">{{obj.report_BBR}}</td> | |
| 322 | + <td style="vertical-align: middle;">{{obj.report_GSNAME}}</td> | |
| 323 | + <td style="vertical-align: middle;">{{obj.report_FGSNAME}}</td> | |
| 324 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 325 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 326 | + </tr> | |
| 327 | + {{/each}} | |
| 328 | + </script> | |
| 329 | + <script id="consult_table_body_list" type="text/html"> | |
| 330 | + {{each data.list as obj i}} | |
| 331 | + {{if obj.status == 2}} | |
| 332 | + <tr style="background-color: #ff5f78"> | |
| 333 | + {{else}} | |
| 334 | + <tr> | |
| 335 | + {{/if}} | |
| 336 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 337 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 338 | + <td style="vertical-align: middle;">{{obj.report_BBR}}</td> | |
| 339 | + <td style="vertical-align: middle;">{{obj.report_GSNAME}}</td> | |
| 340 | + <td style="vertical-align: middle;">{{obj.report_FGSNAME}}</td> | |
| 341 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 342 | + <td style="vertical-align: middle;">{{obj.report_STATION}}</td> | |
| 343 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 344 | + </tr> | |
| 345 | + {{/each}} | |
| 346 | + </script> | |
| 347 | + | |
| 348 | + | |
| 349 | + <!-- common js --> | |
| 350 | + <script src="/assets/js/common.js"></script> | |
| 351 | + <!-- select2 下拉框 --> | |
| 352 | + <script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | |
| 353 | + <!-- moment.js 日期处理类库 --> | |
| 354 | + <script src="/assets/plugins/moment-with-locales.js" data-exclude=1></script> | |
| 355 | + <!-- 日期控件 --> | |
| 356 | + <script src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | |
| 357 | + <!-- bootstrap --> | |
| 358 | + <script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" data-exclude=1></script> | |
| 359 | + <!--<script src="/metronic_v4.5.4/plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>--> | |
| 360 | + <!-- editable.js --> | |
| 361 | + <!--<script src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script>--> | |
| 362 | + <script> | |
| 363 | + var manageJs = (function () { | |
| 364 | + $('#export').attr('disabled', "true"); | |
| 365 | + | |
| 366 | + var modal = '#report-register-modal'; | |
| 367 | + var activeDiv='first_last_late_table'; | |
| 368 | + var lineList = gb_data_basic.activeLines; | |
| 369 | + var loading=false; | |
| 370 | + | |
| 371 | + var line = $("#line").val(); | |
| 372 | + var date1 = $("#date1").val(); | |
| 373 | + var date2 = $("#date2").val(); | |
| 374 | + var dataType = $("#dataType").val(); | |
| 375 | + var lineName = $('#line option:selected').text(); | |
| 376 | + | |
| 377 | + $(modal).on('init', function (e,data) { | |
| 378 | + | |
| 379 | + $("#date1").datetimepicker({ | |
| 380 | + format : 'YYYY-MM-DD', | |
| 381 | + locale : 'zh-cn' | |
| 382 | + }); | |
| 383 | + $("#date2").datetimepicker({ | |
| 384 | + format : 'YYYY-MM-DD', | |
| 385 | + locale : 'zh-cn' | |
| 386 | + }); | |
| 387 | + $('#date1').val(moment(new Date()).format('YYYY-MM-DD')); | |
| 388 | + $('#date2').val(moment(new Date()).format('YYYY-MM-DD')); | |
| 389 | + var data = []; | |
| 390 | + $.get('/user/companyData', function(result){ | |
| 391 | + for(var i = 0; i < result.length; i++){ | |
| 392 | + var companyCode = result[i].companyCode; | |
| 393 | + var children = result[i].children; | |
| 394 | + for(var j = 0; j < children.length; j++){ | |
| 395 | + var code = children[j].code; | |
| 396 | + for(var k=0;k < lineList.length;k++ ){ | |
| 397 | + if(lineList[k]["brancheCompany"]==code && lineList[k]["company"]==companyCode){ | |
| 398 | + data.push({id: lineList[k]["lineCode"], text: lineList[k]["name"]}); | |
| 399 | + } | |
| 400 | + } | |
| 401 | + } | |
| 402 | + } | |
| 403 | + initPinYinSelect2('#line',data,''); | |
| 404 | + | |
| 405 | + }); | |
| 406 | + | |
| 407 | + //滚动条 | |
| 408 | + $('.report-register-table-wrap', modal).perfectScrollbar(); | |
| 409 | + }); | |
| 410 | + | |
| 411 | + $("#query").on("click",function(){ | |
| 412 | + if(loading) | |
| 413 | + return; | |
| 414 | + $('.load-panel', modal).show(); | |
| 415 | + loading=true; | |
| 416 | + line = $("#line").val(); | |
| 417 | + date1 = $("#date1").val(); | |
| 418 | + date2 = $("#date2").val(); | |
| 419 | + if(line == null || line == '' || line.length == 0){ | |
| 420 | + $('.load-panel', modal).hide(); | |
| 421 | + loading=false; | |
| 422 | + layer.msg("请选择线路"); | |
| 423 | + return; | |
| 424 | + } | |
| 425 | + if(date1 == null || date1.trim().length == 0 || date2 == null || date2.trim().length == 0){ | |
| 426 | + $('.load-panel', modal).hide(); | |
| 427 | + loading=false; | |
| 428 | + layer.msg("请选择时间"); | |
| 429 | + return; | |
| 430 | + } else if(date1 > date2){ | |
| 431 | + $('.load-panel', modal).hide(); | |
| 432 | + loading=false; | |
| 433 | + layer.msg("时间区间不正确,第二个时间不能大于第一个时间"); | |
| 434 | + return; | |
| 435 | + } | |
| 436 | + var type = "query"; | |
| 437 | + gb_common.$get("/reportRegister/findList", {lineCodes:line,date1:date1,date2:date2,type:type}, function (data) { | |
| 438 | + if (data.status == "SUCCESS") { | |
| 439 | + var list = data.list; | |
| 440 | + var tableList1 = [], tableList2 = [], tableList3 = [], tableList4 = [], tableList5 = [], | |
| 441 | + tableList6 = [], tableList7 = []; | |
| 442 | + $.each(list, function (i, rr) { | |
| 443 | + rr.report_DATE = formatDate(new Date(rr.report_DATE)); | |
| 444 | + if (rr.report_TYPE == 1) { | |
| 445 | + tableList1.push(rr); | |
| 446 | + } else if (rr.report_TYPE == 2) { | |
| 447 | + tableList2.push(rr); | |
| 448 | + } else if (rr.report_TYPE == 3) { | |
| 449 | + tableList3.push(rr); | |
| 450 | + } else if (rr.report_TYPE == 4) { | |
| 451 | + tableList4.push(rr); | |
| 452 | + } else if (rr.report_TYPE == 5) { | |
| 453 | + tableList5.push(rr); | |
| 454 | + } else if (rr.report_TYPE == 6) { | |
| 455 | + tableList6.push(rr); | |
| 456 | + } else if (rr.report_TYPE == 7) { | |
| 457 | + tableList7.push(rr); | |
| 458 | + } | |
| 459 | + }); | |
| 460 | + var htmlStr = template('first_last_late_table_body_list', {'data':{'list': tableList1,'line':lineList}}); | |
| 461 | + $('#first_last_late_table .table_body', modal).html(htmlStr); | |
| 462 | + htmlStr = template('large_interval_table_body_list', {'data':{'list': tableList2,'line':lineList}}); | |
| 463 | + $('#large_interval_table .table_body', modal).html(htmlStr); | |
| 464 | + htmlStr = template('emergency_table_body_list', {'data':{'list': tableList3,'line':lineList}}); | |
| 465 | + $('#emergency_table .table_body', modal).html(htmlStr); | |
| 466 | + htmlStr = template('accident_table_body_list', {'data':{'list': tableList4,'line':lineList}}); | |
| 467 | + $('#accident_table .table_body', modal).html(htmlStr); | |
| 468 | + htmlStr = template('detour_table_body_list', {'data':{'list': tableList7,'line':lineList}}); | |
| 469 | + $('#detour_table .table_body', modal).html(htmlStr); | |
| 470 | + htmlStr = template('rests_table_body_list', {'data':{'list': tableList5,'line':lineList}}); | |
| 471 | + $('#rests_table .table_body', modal).html(htmlStr); | |
| 472 | + htmlStr = template('consult_table_body_list', {'data':{'list': tableList6,'line':lineList}}); | |
| 473 | + $('#consult_table .table_body', modal).html(htmlStr); | |
| 474 | + $('.load-panel', modal).hide(); | |
| 475 | + loading=false; | |
| 476 | + if(list.length == 0) | |
| 477 | + $("#export").attr('disabled',"true"); | |
| 478 | + else | |
| 479 | + $("#export").removeAttr("disabled"); | |
| 480 | + } | |
| 481 | + }); | |
| 482 | + }); | |
| 483 | + | |
| 484 | + $("#export").on("click",function(){ | |
| 485 | + line = $("#line").val(); | |
| 486 | + date1 = $("#date1").val(); | |
| 487 | + date2 = $("#date2").val(); | |
| 488 | + var dateTime=''; | |
| 489 | + if (date1 == date2) { | |
| 490 | + dateTime = moment(date1).format("YYYYMMDD"); | |
| 491 | + } else { | |
| 492 | + dateTime = moment(date1).format("YYYYMMDD") | |
| 493 | + +"-"+moment(date2).format("YYYYMMDD"); | |
| 494 | + } | |
| 495 | + if(date1 == null || date1.trim().length == 0 || date2 == null || date2.trim().length == 0){ | |
| 496 | + layer.msg("请选择时间"); | |
| 497 | + return; | |
| 498 | + } else if(date1 > date2){ | |
| 499 | + layer.msg("时间区间不正确,第二个时间不能大于第一个时间"); | |
| 500 | + return; | |
| 501 | + } | |
| 502 | + lineName = $('#line option:selected').text(); | |
| 503 | + var type = "export"; | |
| 504 | + gb_common.$get("/reportRegister/findList", {lineCodes:line,lineName:lineName,date1:date1,date2:date2,type:type}, function (data) { | |
| 505 | + if (data.status == "SUCCESS") { | |
| 506 | + window.open("/downloadFile/download?fileName=" | |
| 507 | + +dateTime+"_"+lineName+"_报备登记"); | |
| 508 | + } | |
| 509 | + }); | |
| 510 | + }); | |
| 511 | + | |
| 512 | + | |
| 513 | + $(modal).on('click', '.navigation_bar li', function () { | |
| 514 | + $(this).parent().find('li.uk-active').removeClass('uk-active'); | |
| 515 | + $(this).addClass('uk-active'); | |
| 516 | + var typeName = $(this).attr('id'); | |
| 517 | + var oldActiveDivId = $("#"+typeName+"_table").parent().find('.active'); | |
| 518 | + var oldActiveDiv = document.getElementById(oldActiveDivId.attr('id')); | |
| 519 | + oldActiveDiv.style.display = "none"; | |
| 520 | + oldActiveDivId.removeClass("active"); | |
| 521 | + | |
| 522 | + activeDiv = typeName+"_table"; | |
| 523 | + $("#"+typeName+"_table").addClass("active"); | |
| 524 | + var activeTable = document.getElementById(typeName+"_table"); | |
| 525 | + activeTable.style.display = ""; | |
| 526 | + }); | |
| 527 | + | |
| 528 | + var formatDate = function(now) { | |
| 529 | + var year=now.getFullYear(); | |
| 530 | + var month=now.getMonth()+1; | |
| 531 | + var date=now.getDate(); | |
| 532 | + var hour=now.getHours(); | |
| 533 | + var minute=now.getMinutes(); | |
| 534 | + var second=now.getSeconds(); | |
| 535 | + return year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second; | |
| 536 | + }; | |
| 537 | + | |
| 538 | + })(); | |
| 539 | + </script> | |
| 540 | +</div> | |
| 0 | 541 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/station_notice/list2.html
0 → 100644
| 1 | +<style type="text/css"> | |
| 2 | + .table-bordered { | |
| 3 | + border: 1px solid; } | |
| 4 | + .table-bordered > thead > tr > th, | |
| 5 | + .table-bordered > thead > tr > td, | |
| 6 | + .table-bordered > tbody > tr > th, | |
| 7 | + .table-bordered > tbody > tr > td, | |
| 8 | + .table-bordered > tfoot > tr > th, | |
| 9 | + .table-bordered > tfoot > tr > td { | |
| 10 | + border: 1px solid; } | |
| 11 | + .table-bordered > thead > tr > th, | |
| 12 | + .table-bordered > thead > tr > td { | |
| 13 | + border-bottom-width: 2px; } | |
| 14 | + | |
| 15 | + .table > tbody + tbody { | |
| 16 | + border-top: 1px solid; } | |
| 17 | +</style> | |
| 18 | + | |
| 19 | +<div class="page-head"> | |
| 20 | + <div class="page-title"> | |
| 21 | + <h1>报备登记报表</h1> | |
| 22 | + </div> | |
| 23 | +</div> | |
| 24 | + | |
| 25 | +<div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="portlet light porttlet-fit bordered"> | |
| 28 | + <div class="portlet-title"> | |
| 29 | + <form id="history" class="form-inline" action=""> | |
| 30 | + <div style="display: inline-block;"> | |
| 31 | + <span class="item-label" style="width: 80px;">线路: </span> | |
| 32 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 35 | + <span class="item-label" style="width: 80px;">时间: </span> | |
| 36 | + <input class="form-control" type="text" id="date1" style="width: 180px;"/> - | |
| 37 | + <input class="form-control" type="text" id="date2" style="width: 180px;"/> | |
| 38 | + </div> | |
| 39 | + <div style="display: inline-block;margin-left: 15px"> | |
| 40 | + <span class="item-label" style="width: 140px;">类型: </span> | |
| 41 | + <select class="form-control" name="code" id="code" style="width: 180px;"> | |
| 42 | + <!--<option value="0">所有类型</option>--> | |
| 43 | + <option value="1">首末班误点</option> | |
| 44 | + <option value="2">大间隔</option> | |
| 45 | + <option value="3">突发事件</option> | |
| 46 | +<!-- <option value="4">事故</option> --> | |
| 47 | + <option value="5">其他</option> | |
| 48 | +<!-- <option value="6">咨询</option> --> | |
| 49 | + </select> | |
| 50 | + </div> | |
| 51 | + <div class="form-group"> | |
| 52 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | |
| 53 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | |
| 54 | + </div> | |
| 55 | + </form> | |
| 56 | + </div> | |
| 57 | + <div class="portlet-body"> | |
| 58 | + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;"> | |
| 59 | + <table class="table table-bordered table-hover table-checkable" id="forms"> | |
| 60 | + | |
| 61 | + </table> | |
| 62 | + </div> | |
| 63 | + </div> | |
| 64 | + </div> | |
| 65 | + </div> | |
| 66 | + | |
| 67 | + <script> | |
| 68 | + $(function(){ | |
| 69 | + $('#export').attr('disabled', "true"); | |
| 70 | + | |
| 71 | + // 关闭左侧栏 | |
| 72 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 73 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 74 | + | |
| 75 | + $("#date").datetimepicker({ | |
| 76 | + format : 'YYYY-MM-DD', | |
| 77 | + locale : 'zh-cn' | |
| 78 | + }); | |
| 79 | + | |
| 80 | + $.get('/report/lineList',function(xlList){ | |
| 81 | + var data = []; | |
| 82 | + $.get('/user/companyData', function(result){ | |
| 83 | + for(var i = 0; i < result.length; i++){ | |
| 84 | + var companyCode = result[i].companyCode; | |
| 85 | + var children = result[i].children; | |
| 86 | + for(var j = 0; j < children.length; j++){ | |
| 87 | + var code = children[j].code; | |
| 88 | + for(var k=0;k < xlList.length;k++ ){ | |
| 89 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | |
| 90 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | |
| 91 | + } | |
| 92 | + } | |
| 93 | + } | |
| 94 | + } | |
| 95 | + initPinYinSelect2('#line',data,''); | |
| 96 | + | |
| 97 | + }); | |
| 98 | + }); | |
| 99 | + | |
| 100 | + | |
| 101 | + $('#code').select2({ | |
| 102 | + ajax: { | |
| 103 | + url: '/realSchedule/sreachVehic', | |
| 104 | + dataType: 'json', | |
| 105 | + delay: 150, | |
| 106 | + data: function(params){ | |
| 107 | + return{nbbm: params.term}; | |
| 108 | + }, | |
| 109 | + processResults: function (data) { | |
| 110 | + return { | |
| 111 | + results: data | |
| 112 | + }; | |
| 113 | + }, | |
| 114 | + cache: true | |
| 115 | + }, | |
| 116 | + templateResult: function(repo){ | |
| 117 | + if (repo.loading) return repo.text; | |
| 118 | + var h = '<span>'+repo.text+'</span>'; | |
| 119 | + h += (repo.lineName?' <span class="select2-desc">'+repo.lineName+'</span>':''); | |
| 120 | + return h; | |
| 121 | + }, | |
| 122 | + escapeMarkup: function (markup) { return markup; }, | |
| 123 | + minimumInputLength: 1, | |
| 124 | + templateSelection: function(repo){ | |
| 125 | + return repo.text; | |
| 126 | + }, | |
| 127 | + language: { | |
| 128 | + noResults: function(){ | |
| 129 | + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>'; | |
| 130 | + }, | |
| 131 | + inputTooShort : function(e) { | |
| 132 | + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>'; | |
| 133 | + }, | |
| 134 | + searching : function() { | |
| 135 | + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>'; | |
| 136 | + } | |
| 137 | + } | |
| 138 | + }); | |
| 139 | + | |
| 140 | + var line = $("#line").val(); | |
| 141 | + var date = $("#date").val(); | |
| 142 | + var code = $("#code").val(); | |
| 143 | + var lineName = $('#line option:selected').text(); | |
| 144 | + $("#query").on("click",function(){ | |
| 145 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | |
| 146 | + layer.msg("请选择时间"); | |
| 147 | + return; | |
| 148 | + } | |
| 149 | + line = $("#line").val(); | |
| 150 | + date = $("#date").val(); | |
| 151 | + code = $("#code").val(); | |
| 152 | + lineName = $('#line option:selected').text(); | |
| 153 | + var type = "query"; | |
| 154 | + $(".hidden").removeClass("hidden"); | |
| 155 | + var i = layer.load(2); | |
| 156 | + $get('/realSchedule/wxsb',{line:line,date:date,code:code,type:type},function(result){ | |
| 157 | + // 把数据填充到模版中 | |
| 158 | + var tbodyHtml = template('list_repair',{list:result}); | |
| 159 | + // 把渲染好的模版html文本追加到表格中 | |
| 160 | + $('#forms tbody').html(tbodyHtml); | |
| 161 | + layer.close(i); | |
| 162 | + | |
| 163 | + if(result.length == 0) | |
| 164 | + $("#export").attr('disabled',"true"); | |
| 165 | + else | |
| 166 | + $("#export").removeAttr("disabled"); | |
| 167 | + | |
| 168 | + }); | |
| 169 | + }); | |
| 170 | + | |
| 171 | + $("#export").on("click",function(){ | |
| 172 | + var type = "export"; | |
| 173 | + var i = layer.load(2); | |
| 174 | + $get('/realSchedule/wxsb', {line:line,date:date,code:code,type:type}, function(result){ | |
| 175 | + window.open("/downloadFile/download?fileName=" | |
| 176 | + +moment(date).format("YYYYMMDD") | |
| 177 | + +"-"+lineName+"-维修上报记录"); | |
| 178 | + layer.close(i); | |
| 179 | + }); | |
| 180 | + }); | |
| 181 | + | |
| 182 | + }); | |
| 183 | + </script> | |
| 184 | + <script type="text/html" id="table1"> | |
| 185 | + <thead> | |
| 186 | + <tr> | |
| 187 | + <th width="4%">序号</th> | |
| 188 | + <th width="5%">报备时间</th> | |
| 189 | + <th width="7%">线路</th> | |
| 190 | + <th width="7%">延误站点</th> | |
| 191 | + <th width="5%">延误时间</th> | |
| 192 | + <th width="10%">首末班延误原因</th> | |
| 193 | + </tr> | |
| 194 | + </thead> | |
| 195 | + <tbody> | |
| 196 | + {{each data.list as obj i}} | |
| 197 | + <tr> | |
| 198 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 199 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 200 | + <td style="vertical-align: middle;display:none">{{obj.report_BBR}}</td> | |
| 201 | + <td style="vertical-align: middle;display:none">{{obj.report_GS}}</td> | |
| 202 | + <td style="vertical-align: middle;display:none">{{obj.report_FGS}}</td> | |
| 203 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 204 | + <td style="vertical-align: middle;">{{obj.report_STATION}}</td> | |
| 205 | + <td style="vertical-align: middle;">{{obj.report_YWSJ}}</td> | |
| 206 | + <td style="vertical-align: middle;">{{obj.report_SMBWD}}</td> | |
| 207 | + </tr> | |
| 208 | + {{/each}} | |
| 209 | + {{if list.length == 0}} | |
| 210 | + <tr> | |
| 211 | + <td colspan="8"><h6 class="muted">没有找到相关数据</h6></td> | |
| 212 | + </tr> | |
| 213 | + {{/if}} | |
| 214 | + </tbody> | |
| 215 | + </script> | |
| 216 | + <script type="text/html" id="table2"> | |
| 217 | + <thead> | |
| 218 | + <tr> | |
| 219 | + <th width="4%">序号</th> | |
| 220 | + <th width="5%">报备时间</th> | |
| 221 | + <th width="7%">线路</th> | |
| 222 | + <th width="7%">路段</th> | |
| 223 | + <th width="7%">行驶方向</th> | |
| 224 | + <th width="7%">站点</th> | |
| 225 | + <th width="7%">大间隔时间</th> | |
| 226 | + <th width="7%">大间隔原因</th> | |
| 227 | + </tr> | |
| 228 | + </thead> | |
| 229 | + <tbody> | |
| 230 | + {{each list as obj i}} | |
| 231 | + <tr> | |
| 232 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 233 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 234 | + <td style="vertical-align: middle;display:none">{{obj.report_BBR}}</td> | |
| 235 | + <td style="vertical-align: middle;display:none">{{obj.report_GS}}</td> | |
| 236 | + <td style="vertical-align: middle;display:none">{{obj.report_FGS}}</td> | |
| 237 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 238 | + <td style="vertical-align: middle;">{{obj.report_ROAD}}</td> | |
| 239 | + <td style="vertical-align: middle;">{{obj.report_XSFX}}</td> | |
| 240 | + <td style="vertical-align: middle;">{{obj.report_STATION}}</td> | |
| 241 | + <td style="vertical-align: middle;">{{obj.report_DJGSJ}}</td> | |
| 242 | + <td style="vertical-align: middle;">{{obj.report_DJGYY}}</td> | |
| 243 | + </tr> | |
| 244 | + {{/each}} | |
| 245 | + {{if list.length == 0}} | |
| 246 | + <tr> | |
| 247 | + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td> | |
| 248 | + </tr> | |
| 249 | + {{/if}} | |
| 250 | + </tbody> | |
| 251 | + </script> | |
| 252 | + <script type="text/html" id="table3"> | |
| 253 | + <thead> | |
| 254 | + <tr> | |
| 255 | + <th width="4%">序号</th> | |
| 256 | + <th width="5%">报备时间</th> | |
| 257 | + <th width="7%">影响线路</th> | |
| 258 | + <th width="7%">重大活动货突发事件</th> | |
| 259 | + <th width="7%">影响时间</th> | |
| 260 | + <th width="7%">影响班次数</th> | |
| 261 | + <th width="7%">调整措施</th> | |
| 262 | + </tr> | |
| 263 | + </thead> | |
| 264 | + <tbody> | |
| 265 | + {{each list as obj i}} | |
| 266 | + <tr> | |
| 267 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 268 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 269 | + <td style="vertical-align: middle;display:none">{{obj.report_BBR}}</td> | |
| 270 | + <td style="vertical-align: middle;display:none">{{obj.report_GS}}</td> | |
| 271 | + <td style="vertical-align: middle;display:none">{{obj.report_FGS}}</td> | |
| 272 | + <td style="vertical-align: middle;display:none">{{obj.report_XLNAME}}</td> | |
| 273 | + <td style="vertical-align: middle;">{{obj.report_TFSJ}}</td> | |
| 274 | + <td style="vertical-align: middle;">{{obj.report_YXSJ}}</td> | |
| 275 | + <td style="vertical-align: middle;">{{obj.report_YXBC}}</td> | |
| 276 | + <td style="vertical-align: middle;">{{obj.report_TZCS}}</td> | |
| 277 | + </tr> | |
| 278 | + {{/each}} | |
| 279 | + {{if list.length == 0}} | |
| 280 | + <tr> | |
| 281 | + <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td> | |
| 282 | + </tr> | |
| 283 | + {{/if}} | |
| 284 | + </tbody> | |
| 285 | + </script> | |
| 286 | + <script type="text/html" id="table4"> | |
| 287 | + <thead> | |
| 288 | + <tr> | |
| 289 | + <th width="3%">序号</th> | |
| 290 | + <th width="5%">报备时间</th> | |
| 291 | + <th width="7%">线路</th> | |
| 292 | + <th width="7%">车辆自编号</th> | |
| 293 | + <th width="7%">驾驶员</th> | |
| 294 | + <th width="7%">事故发生时间</th> | |
| 295 | + <th width="7%">事故发生地点</th> | |
| 296 | + <th width="7%">行驶方向</th> | |
| 297 | + <th width="7%">事故对象</th> | |
| 298 | + <th width="7%">对象车牌号</th> | |
| 299 | + <th width="7%">事故概况</th> | |
| 300 | + <th width="7%">受伤人数</th> | |
| 301 | + <th width="7%">死亡人数</th> | |
| 302 | + <th width="7%">报告人</th> | |
| 303 | + <th width="7%">报告人电话</th> | |
| 304 | + <th width="7%">备注</th> | |
| 305 | + </tr> | |
| 306 | + </thead> | |
| 307 | + <tbody> | |
| 308 | + {{each list as obj i}} | |
| 309 | + <tr> | |
| 310 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 311 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 312 | + <td style="vertical-align: middle;display:none">{{obj.report_BBR}}</td> | |
| 313 | + <td style="vertical-align: middle;display:none">{{obj.report_GS}}</td> | |
| 314 | + <td style="vertical-align: middle;display:none">{{obj.report_FGS}}</td> | |
| 315 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 316 | + <td style="vertical-align: middle;">{{obj.report_ZBH}}</td> | |
| 317 | + <td style="vertical-align: middle;">{{obj.report_JSY}}</td> | |
| 318 | + <td style="vertical-align: middle;">{{obj.report_SGSJ}}</td> | |
| 319 | + <td style="vertical-align: middle;">{{obj.report_SGDD}}</td> | |
| 320 | + <td style="vertical-align: middle;">{{obj.report_XSFX}}</td> | |
| 321 | + <td style="vertical-align: middle;">{{obj.report_SGDX}}</td> | |
| 322 | + <td style="vertical-align: middle;">{{obj.report_DXPZH}}</td> | |
| 323 | + <td style="vertical-align: middle;">{{obj.report_SGGK}}</td> | |
| 324 | + <td style="vertical-align: middle;">{{obj.report_SSRS}}</td> | |
| 325 | + <td style="vertical-align: middle;">{{obj.report_SWRS}}</td> | |
| 326 | + <td style="vertical-align: middle;">{{obj.report_BGR}}</td> | |
| 327 | + <td style="vertical-align: middle;">{{obj.report_BGRDH}}</td> | |
| 328 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 329 | + </tr> | |
| 330 | + {{/each}} | |
| 331 | + {{if list.length == 0}} | |
| 332 | + <tr> | |
| 333 | + <td colspan="16"><h6 class="muted">没有找到相关数据</h6></td> | |
| 334 | + </tr> | |
| 335 | + {{/if}} | |
| 336 | + </tbody> | |
| 337 | + </script> | |
| 338 | + <script type="text/html" id="table5"> | |
| 339 | + <thead> | |
| 340 | + <tr> | |
| 341 | + <th width="4%">序号</th> | |
| 342 | + <th width="5%">报备时间</th> | |
| 343 | + <th width="7%">线路</th> | |
| 344 | + <th width="7%">报备内容</th> | |
| 345 | + </tr> | |
| 346 | + </thead> | |
| 347 | + <tbody> | |
| 348 | + {{each list as obj i}} | |
| 349 | + <tr> | |
| 350 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 351 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 352 | + <td style="vertical-align: middle;display:none">{{obj.report_BBR}}</td> | |
| 353 | + <td style="vertical-align: middle;display:none">{{obj.report_GS}}</td> | |
| 354 | + <td style="vertical-align: middle;display:none">{{obj.report_FGS}}</td> | |
| 355 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 356 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 357 | + </tr> | |
| 358 | + {{/each}} | |
| 359 | + {{if list.length == 0}} | |
| 360 | + <tr> | |
| 361 | + <td colspan="4"><h6 class="muted">没有找到相关数据</h6></td> | |
| 362 | + </tr> | |
| 363 | + {{/if}} | |
| 364 | + </tbody> | |
| 365 | + </script> | |
| 366 | + <script type="text/html" id="table6"> | |
| 367 | + <thead> | |
| 368 | + <tr> | |
| 369 | + <th width="4%">序号</th> | |
| 370 | + <th width="5%">报备时间</th> | |
| 371 | + <th width="7%">线路</th> | |
| 372 | + <th width="7%">班线名称</th> | |
| 373 | + <th width="7%">内容</th> | |
| 374 | + </tr> | |
| 375 | + </thead> | |
| 376 | + <tbody> | |
| 377 | + {{each list as obj i}} | |
| 378 | + <tr> | |
| 379 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 380 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 381 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 382 | + <td style="vertical-align: middle;">{{obj.report_STATION}}</td> | |
| 383 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 384 | + </tr> | |
| 385 | + {{/each}} | |
| 386 | + {{if list.length == 0}} | |
| 387 | + <tr> | |
| 388 | + <td colspan="5"><h6 class="muted">没有找到相关数据</h6></td> | |
| 389 | + </tr> | |
| 390 | + {{/if}} | |
| 391 | + </tbody> | |
| 392 | + </script> | |
| 393 | + | |
| 394 | + <script> | |
| 395 | + (function () { | |
| 396 | + $('#export').attr('disabled', "true"); | |
| 397 | + | |
| 398 | + // 关闭左侧栏 | |
| 399 | + if (!$('body').hasClass('page-sidebar-closed')) | |
| 400 | + $('.menu-toggler.sidebar-toggler').click(); | |
| 401 | + | |
| 402 | + $("#date1").datetimepicker({ | |
| 403 | + format : 'YYYY-MM-DD', | |
| 404 | + locale : 'zh-cn' | |
| 405 | + }); | |
| 406 | + $("#date2").datetimepicker({ | |
| 407 | + format : 'YYYY-MM-DD', | |
| 408 | + locale : 'zh-cn' | |
| 409 | + }); | |
| 410 | + | |
| 411 | + $.get('/report/lineList',function(xlList){ | |
| 412 | + var data = []; | |
| 413 | + $.get('/user/companyData', function(result){ | |
| 414 | + for(var i = 0; i < result.length; i++){ | |
| 415 | + var companyCode = result[i].companyCode; | |
| 416 | + var children = result[i].children; | |
| 417 | + for(var j = 0; j < children.length; j++){ | |
| 418 | + var code = children[j].code; | |
| 419 | + for(var k=0;k < xlList.length;k++ ){ | |
| 420 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | |
| 421 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | |
| 422 | + } | |
| 423 | + } | |
| 424 | + } | |
| 425 | + } | |
| 426 | + initPinYinSelect2('#line',data,''); | |
| 427 | + | |
| 428 | + }); | |
| 429 | + }); | |
| 430 | + var line = $("#line").val(); | |
| 431 | + var date1 = $("#date1").val(); | |
| 432 | + var date2 = $("#date2").val(); | |
| 433 | + var dataType = $("#dataType").val(); | |
| 434 | + var lineName = $('#line option:selected').text(); | |
| 435 | + $("#query").on("click",function(){ | |
| 436 | + line = $("#line").val(); | |
| 437 | + date1 = $("#date1").val(); | |
| 438 | + date2 = $("#date2").val(); | |
| 439 | + if(date1 == null || date1.trim().length == 0 || date2 == null || date2.trim().length == 0){ | |
| 440 | + layer.msg("请选择时间"); | |
| 441 | + return; | |
| 442 | + } else if(date1 > date2){ | |
| 443 | + layer.msg("时间区间不正确,第二个时间不能大于第一个时间"); | |
| 444 | + return; | |
| 445 | + } | |
| 446 | + dataType = $("#dataType").val(); | |
| 447 | + lineName = $('#line option:selected').text(); | |
| 448 | + var type = "query"; | |
| 449 | + $(".hidden").removeClass("hidden"); | |
| 450 | + var i = layer.load(2); | |
| 451 | + $get('/realSchedule/wxsb',{line:line,date:date,dataType:dataType,type:type},function(result){ | |
| 452 | + // 把数据填充到模版中 | |
| 453 | + var tbodyHtml = template('list_repair',{list:result}); | |
| 454 | + // 把渲染好的模版html文本追加到表格中 | |
| 455 | + $('#forms tbody').html(tbodyHtml); | |
| 456 | + layer.close(i); | |
| 457 | + | |
| 458 | + if(result.length == 0) | |
| 459 | + $("#export").attr('disabled',"true"); | |
| 460 | + else | |
| 461 | + $("#export").removeAttr("disabled"); | |
| 462 | + | |
| 463 | + }); | |
| 464 | + }); | |
| 465 | + | |
| 466 | + $("#export").on("click",function(){ | |
| 467 | + var type = "export"; | |
| 468 | + var i = layer.load(2); | |
| 469 | + $get('/realSchedule/wxsb', {line:line,date:date,code:code,type:type}, function(result){ | |
| 470 | + window.open("/downloadFile/download?fileName=" | |
| 471 | + +moment(date).format("YYYYMMDD") | |
| 472 | + +"-"+lineName+"-维修上报记录"); | |
| 473 | + layer.close(i); | |
| 474 | + }); | |
| 475 | + }); | |
| 476 | + | |
| 477 | + })(); | |
| 478 | + | |
| 479 | + </script> | |
| 480 | +</div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/station_notice/manage.html
0 → 100644
| 1 | +<div class="uk-modal ct_move_modal" id="notice-modal"> | |
| 2 | + | |
| 3 | + <!-- editable --> | |
| 4 | + <!--<link href="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet" type="text/css" />--> | |
| 5 | + <!-- Bootstrap style --> | |
| 6 | + <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
| 7 | + <!-- select2 下拉框插件 --> | |
| 8 | + <!--<link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />--> | |
| 9 | + <!--<link href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />--> | |
| 10 | + | |
| 11 | + <style> | |
| 12 | + .lineSelect{ | |
| 13 | + width:174px !important | |
| 14 | + } | |
| 15 | + | |
| 16 | + /*ul.navigation_bar:before { | |
| 17 | + content: "报备类型"; | |
| 18 | + position: absolute; | |
| 19 | + top: -9px; | |
| 20 | + font-size: 12px; | |
| 21 | + background: white; | |
| 22 | + padding: 0 4px; | |
| 23 | + color: #7d7b7b; | |
| 24 | + left: 10px; | |
| 25 | + }*/ | |
| 26 | + </style> | |
| 27 | + <div class="uk-modal-dialog" style="width: 1800px;"> | |
| 28 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 29 | + <div class="uk-modal-header"> | |
| 30 | + <h2>站牌公告</h2> | |
| 31 | + </div> | |
| 32 | + | |
| 33 | + | |
| 34 | + <div style="padding-left: 12px;margin: 10px 0"> | |
| 35 | + <ul class="uk-subnav uk-subnav-pill navigation_bar"> | |
| 36 | + <li id="emergency" class="uk-active"><a>线路公告</a></li> | |
| 37 | + <li id="regional"><a>区域公告</a></li> | |
| 38 | + </ul> | |
| 39 | + </div> | |
| 40 | + | |
| 41 | + <div style="padding-left: 12px;margin: 10px 0"> | |
| 42 | + <div class=" uk-subnav-pill management_bar" > | |
| 43 | + <button class="uk-button uk-button-primary" id="add">添加</button> | |
| 44 | + <button class="uk-button uk-button-danger" id="update">修改</button> | |
| 45 | + <button class="uk-button uk-button-danger" id="delete">删除</button> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + | |
| 49 | + <div class="ct_table_wrap" style="height: 510px"> | |
| 50 | + <!-- 突发事件--> | |
| 51 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table active" id="emergency_table"> | |
| 52 | + <thead class=""> | |
| 53 | + <tr role="row"> | |
| 54 | + <!--<th width="2%"><input type="radio" name="checkItems"></th>--> | |
| 55 | + <th width="2%">#</th> | |
| 56 | + <th width="2%">序号</th> | |
| 57 | + <th width="5%">报备时间</th> | |
| 58 | + <th width="5%">报备人</th> | |
| 59 | + <th width="5%">截止时间</th> | |
| 60 | + <th width="8%">影响线路</th> | |
| 61 | + <th width="4%">方向</th> | |
| 62 | + <th width="8%">突发事件</th> | |
| 63 | + <th width="8%">事件影响</th> | |
| 64 | + <th width="8%">影响站点</th> | |
| 65 | + </tr> | |
| 66 | + </thead> | |
| 67 | + <tbody class="table_body"> | |
| 68 | + </tbody> | |
| 69 | + </table> | |
| 70 | + <!-- 绕改道--> | |
| 71 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="regional_table"> | |
| 72 | + <thead class=""> | |
| 73 | + <tr role="row"> | |
| 74 | + <!--<th width="2%"><input type="radio" name="checkItems"></th>--> | |
| 75 | + <th width="2%">#</th> | |
| 76 | + <th width="2%">序号</th> | |
| 77 | + <th width="5%">报备时间</th> | |
| 78 | + <th width="5%">报备人</th> | |
| 79 | + <th width="5%">截止时间</th> | |
| 80 | + <th width="5%">公告区域</th> | |
| 81 | + <th width="20%">公告信息</th> | |
| 82 | + </tr> | |
| 83 | + </thead> | |
| 84 | + <tbody class="table_body"> | |
| 85 | + </tbody> | |
| 86 | + </table> | |
| 87 | + </div> | |
| 88 | + | |
| 89 | + <div class="load-panel"> | |
| 90 | + <i class="uk-icon-spinner uk-icon-spin"></i> | |
| 91 | + 正在加载数据 | |
| 92 | + </div> | |
| 93 | + </div> | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + <script id="emergency_table_body" type="text/html"> | |
| 98 | + {{each data.list as obj i}} | |
| 99 | + {{if obj.status == 2}} | |
| 100 | + <tr style="background-color: #ff5f78"> | |
| 101 | + <td style="vertical-align: middle;"> | |
| 102 | + <!--<input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.report_XL}}">--> | |
| 103 | + </td> | |
| 104 | + {{else}} | |
| 105 | + <tr> | |
| 106 | + <td style="vertical-align: middle;"> | |
| 107 | + <input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.notice_XL}}"> | |
| 108 | + </td> | |
| 109 | + {{/if}} | |
| 110 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 111 | + <td style="vertical-align: middle;">{{obj.notice_DATE}}</td> | |
| 112 | + <td style="vertical-align: middle;">{{obj.notice_BBR}}</td> | |
| 113 | + <td style="vertical-align: middle;">{{obj.notice_TIME}}</td> | |
| 114 | + <td style="vertical-align: middle;">{{obj.notice_XLNAME}}</td> | |
| 115 | + <td style="vertical-align: middle;">{{obj.notice_XSFX}}</td> | |
| 116 | + <td style="vertical-align: middle;">{{obj.notice_TFSJ}}</td> | |
| 117 | + <td style="vertical-align: middle;">{{obj.notice_SJYX}}</td> | |
| 118 | + <td style="vertical-align: middle;">{{obj.notice_STATIONNAME}}</td> | |
| 119 | + </tr> | |
| 120 | + {{/each}} | |
| 121 | + </script> | |
| 122 | + <script id="regional_table_body" type="text/html"> | |
| 123 | + {{each data.list as obj i}} | |
| 124 | + | |
| 125 | + {{if obj.status == 2}} | |
| 126 | + <tr style="background-color: #ff5f78"> | |
| 127 | + <td style="vertical-align: middle;"> | |
| 128 | + <!--<input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.report_XL}}">--> | |
| 129 | + </td> | |
| 130 | + {{else}} | |
| 131 | + <tr> | |
| 132 | + <td style="vertical-align: middle;"> | |
| 133 | + <input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.notice_XL}}"> | |
| 134 | + </td> | |
| 135 | + {{/if}} | |
| 136 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 137 | + <td style="vertical-align: middle;">{{obj.notice_DATE}}</td> | |
| 138 | + <td style="vertical-align: middle">{{obj.notice_BBR}}</td> | |
| 139 | + <td style="vertical-align: middle">{{obj.notice_TIME}}</td> | |
| 140 | + <td style="vertical-align: middle">{{obj.notice_QY}}</td> | |
| 141 | + <td style="vertical-align: middle">{{obj.notice_GG}}</td> | |
| 142 | + </tr> | |
| 143 | + {{/each}} | |
| 144 | + </script> | |
| 145 | + | |
| 146 | + | |
| 147 | + <!-- common js --> | |
| 148 | + <!--<script src="/assets/js/common.js"></script>--> | |
| 149 | + <!--<!– select2 下拉框 –>--> | |
| 150 | + <!--<script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script>--> | |
| 151 | + <!-- moment.js 日期处理类库 --> | |
| 152 | + <script src="/assets/plugins/moment-with-locales.js" data-exclude=1></script> | |
| 153 | + <!-- 日期控件 --> | |
| 154 | + <script src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | |
| 155 | + <!-- bootstrap --> | |
| 156 | + <script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" data-exclude=1></script> | |
| 157 | + <!--<script src="/metronic_v4.5.4/plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>--> | |
| 158 | + <!-- editable.js --> | |
| 159 | + <!--<script src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script>--> | |
| 160 | + <script> | |
| 161 | + var manageJs = (function () { | |
| 162 | + var modal = '#notice-modal'; | |
| 163 | + var editType = false;//编辑状态,修改过东西 | |
| 164 | + var lineCodes ='',// 选择的线路 | |
| 165 | + companyMap = {}, | |
| 166 | + user = {};//当前用户信息 | |
| 167 | + var activeDiv='emergency_table'; | |
| 168 | + var lineList = gb_data_basic.activeLines; | |
| 169 | + | |
| 170 | + //当前用户信息 | |
| 171 | + gb_common.$get('/user/currentUser', null,function (data) { | |
| 172 | + user = data; | |
| 173 | + }); | |
| 174 | + | |
| 175 | + $(modal).on('init', function (e,data) { | |
| 176 | + // 遍历出所有需要查询的线路 | |
| 177 | + lineCodes = ''; | |
| 178 | + $.each(lineList, function (i, g) { | |
| 179 | + lineCodes += '"'+g.lineCode + '",'; | |
| 180 | + }); | |
| 181 | + console.log(lineCodes); | |
| 182 | + refreshDate(); | |
| 183 | + //滚动条 | |
| 184 | + $('.report-register-table-wrap', modal).perfectScrollbar(); | |
| 185 | + }); | |
| 186 | + | |
| 187 | + var refreshDate = function() { | |
| 188 | + console.log("222"); | |
| 189 | + $('.load-panel', modal).show(); | |
| 190 | + loading=true; | |
| 191 | + gb_common.$get("/notice/findList", {lineCodes: lineCodes.substring(0, lineCodes.length - 1)}, function (data) { | |
| 192 | + if (data.status == "SUCCESS") { | |
| 193 | + var list = data.list; | |
| 194 | + var tableList1 = [], tableList2 = []; | |
| 195 | + $.each(list, function (i, rr) { | |
| 196 | + console.log(rr); | |
| 197 | + rr.notice_DATE = formatDate(new Date(rr.notice_DATE)); | |
| 198 | + rr.notice_TIME = formatDate(new Date(rr.notice_TIME)); | |
| 199 | + if (rr.notice_TYPE == 1) { | |
| 200 | + rr.notice_XSFX=rr.notice_XSFX==0?'上行':'下行'; | |
| 201 | + tableList1.push(rr); | |
| 202 | + } else if (rr.notice_TYPE == 2) { | |
| 203 | + tableList2.push(rr); | |
| 204 | + } | |
| 205 | + }); | |
| 206 | + console.log(tableList1); | |
| 207 | + console.log(tableList2); | |
| 208 | + var htmlStr = template('emergency_table_body', {'data':{'list': tableList1,'line':lineList}}); | |
| 209 | + $('#emergency_table .table_body', modal).html(htmlStr); | |
| 210 | + htmlStr = template('regional_table_body', {'data':{'list': tableList2,'line':lineList}}); | |
| 211 | + $('#regional_table .table_body', modal).html(htmlStr); | |
| 212 | + $('.load-panel', modal).hide(); | |
| 213 | + loading=false; | |
| 214 | + } | |
| 215 | + }); | |
| 216 | + }; | |
| 217 | + | |
| 218 | + | |
| 219 | + $("#add", modal).on('click', function () { | |
| 220 | + var activeDivId = $('.ct_table_wrap .active').attr('id'); | |
| 221 | + open_modal('/real_control_v2/fragments/north/nav/station_notice/add.html', {'tableActive' : activeDivId,'companyMap':companyMap,'lineList':lineList,'user':user}, { | |
| 222 | + bgclose: false, | |
| 223 | + modal: false | |
| 224 | + }); | |
| 225 | + }); | |
| 226 | + $("#update", modal).on('click', function () { | |
| 227 | + var activeDivId = $('.ct_table_wrap .active').attr('id'); | |
| 228 | + var id = $("#"+activeDivId+" .table_body input[name='idRadio']:checked", modal).val(); | |
| 229 | + if(id){ | |
| 230 | + gb_common.$get('/notice/' + id,null, function (rs) { | |
| 231 | + // 全转换为大写 | |
| 232 | + var rr = nameTo_(rs); | |
| 233 | + open_modal('/real_control_v2/fragments/north/nav/station_notice/update.html', {'tableActive' : activeDivId,'lineList':lineList,'user':user,'rr':rr}, { | |
| 234 | + bgclose: false, | |
| 235 | + modal: false | |
| 236 | + }); | |
| 237 | + }); | |
| 238 | + } else { | |
| 239 | + notify_succ('当前类型没有选中!'); | |
| 240 | + } | |
| 241 | + }); | |
| 242 | + $("#delete").on('click', function () { | |
| 243 | + var activeDivId = $('.ct_table_wrap .active').attr('id'); | |
| 244 | + var id = $("#"+activeDivId+" .table_body input[name='idRadio']:checked", modal).val(); | |
| 245 | + if(id){ | |
| 246 | + alt_confirm('确实要删除这个公告吗?', function () { | |
| 247 | + gb_common.$post('/notice/delete',{ID:id,NOTICE_BBR:user.userName+'/'+user.name}, function (rs) { | |
| 248 | + manageJs.refreshDate(); | |
| 249 | + notify_succ('删除成功!'); | |
| 250 | + }); | |
| 251 | + }, '确定删除'); | |
| 252 | + } else { | |
| 253 | + notify_succ('当前类型没有选中!'); | |
| 254 | + } | |
| 255 | + }); | |
| 256 | + | |
| 257 | + | |
| 258 | + $(modal).on('click', '.navigation_bar li', function () { | |
| 259 | + $(this).parent().find('li.uk-active').removeClass('uk-active'); | |
| 260 | + $(this).addClass('uk-active'); | |
| 261 | + var typeName = $(this).attr('id'); | |
| 262 | + var oldActiveDivId = $("#"+typeName+"_table").parent().find('.active'); | |
| 263 | + var oldActiveDiv = document.getElementById(oldActiveDivId.attr('id')); | |
| 264 | + oldActiveDiv.style.display = "none"; | |
| 265 | + oldActiveDivId.removeClass("active"); | |
| 266 | + | |
| 267 | + activeDiv = typeName+"_table"; | |
| 268 | + $("#"+typeName+"_table").addClass("active"); | |
| 269 | + var activeTable = document.getElementById(typeName+"_table"); | |
| 270 | + activeTable.style.display = ""; | |
| 271 | + }); | |
| 272 | + | |
| 273 | + var formatDate = function(now) { | |
| 274 | + var year=now.getFullYear(); | |
| 275 | + var month=now.getMonth()+1; | |
| 276 | + var date=now.getDate(); | |
| 277 | + var hour=now.getHours(); | |
| 278 | + var minute=now.getMinutes(); | |
| 279 | + var second=now.getSeconds(); | |
| 280 | + return year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second; | |
| 281 | + }; | |
| 282 | + | |
| 283 | + function nameTo_(object) { | |
| 284 | + for (var i in object) { | |
| 285 | + if (object.hasOwnProperty(i)) { | |
| 286 | + var temp = object[i]; | |
| 287 | + var oldI = i; | |
| 288 | + temp = object[i.toUpperCase()] = object[i]; | |
| 289 | + delete object[oldI]; | |
| 290 | + if (typeof temp === 'object' || Object.prototype.toString.call(temp) === '[object Array]') { | |
| 291 | + nameTo_(temp); | |
| 292 | + } | |
| 293 | + } | |
| 294 | + } | |
| 295 | + return object; | |
| 296 | + } | |
| 297 | + | |
| 298 | + return{ | |
| 299 | + refreshDate:refreshDate | |
| 300 | + } | |
| 301 | + })(); | |
| 302 | + </script> | |
| 303 | +</div> | |
| 0 | 304 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/station_notice/mould/manage2.html
0 → 100644
| 1 | +<div class="uk-modal ct_move_modal" id="report-register-modal"> | |
| 2 | + | |
| 3 | + <!-- editable --> | |
| 4 | + <!--<link href="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet" type="text/css" />--> | |
| 5 | + <!-- Bootstrap style --> | |
| 6 | + <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
| 7 | + <!-- select2 下拉框插件 --> | |
| 8 | + <!--<link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />--> | |
| 9 | + <!--<link href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />--> | |
| 10 | + | |
| 11 | + <style> | |
| 12 | + .lineSelect{ | |
| 13 | + width:174px !important | |
| 14 | + } | |
| 15 | + | |
| 16 | + /*ul.navigation_bar:before { | |
| 17 | + content: "报备类型"; | |
| 18 | + position: absolute; | |
| 19 | + top: -9px; | |
| 20 | + font-size: 12px; | |
| 21 | + background: white; | |
| 22 | + padding: 0 4px; | |
| 23 | + color: #7d7b7b; | |
| 24 | + left: 10px; | |
| 25 | + }*/ | |
| 26 | + </style> | |
| 27 | + <div class="uk-modal-dialog" style="width: 1800px;"> | |
| 28 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 29 | + <div class="uk-modal-header"> | |
| 30 | + <h2>站牌公告</h2> | |
| 31 | + </div> | |
| 32 | + | |
| 33 | + | |
| 34 | + <div style="padding-left: 12px;margin: 10px 0"> | |
| 35 | + <ul class="uk-subnav uk-subnav-pill navigation_bar"> | |
| 36 | + <li id="emergency" class="uk-active"><a>突发事件</a></li> | |
| 37 | + <li id="regional"><a>区域公告</a></li> | |
| 38 | + </ul> | |
| 39 | + </div> | |
| 40 | + | |
| 41 | + <div style="padding-left: 12px;margin: 10px 0"> | |
| 42 | + <div class=" uk-subnav-pill management_bar" > | |
| 43 | + <button class="uk-button uk-button-primary" id="add">添加</button> | |
| 44 | + <button class="uk-button uk-button-danger" id="update">修改</button> | |
| 45 | + <button class="uk-button uk-button-danger" id="delete">删除</button> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + | |
| 49 | + <div class="ct_table_wrap" style="height: 510px"> | |
| 50 | + <!-- 突发事件--> | |
| 51 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table active" id="emergency_table"> | |
| 52 | + <thead class=""> | |
| 53 | + <tr role="row"> | |
| 54 | + <!--<th width="2%"><input type="radio" name="checkItems"></th>--> | |
| 55 | + <th width="2%">#</th> | |
| 56 | + <th width="2%">序号</th> | |
| 57 | + <th width="5%">报备时间</th> | |
| 58 | + <th width="8%">影响线路</th> | |
| 59 | + <th width="4%">方向</th> | |
| 60 | + <th width="8%">突发事件</th> | |
| 61 | + <th width="8%">产生影响</th> | |
| 62 | + <th width="8%">影响站点</th> | |
| 63 | + </tr> | |
| 64 | + </thead> | |
| 65 | + <tbody class="table_body"> | |
| 66 | + </tbody> | |
| 67 | + </table> | |
| 68 | + <!-- 绕改道--> | |
| 69 | + <table class="table table-striped table-bordered table-hover table-checkable report-register-table" style="display:none" id="regional_table"> | |
| 70 | + <thead class=""> | |
| 71 | + <tr role="row"> | |
| 72 | + <!--<th width="2%"><input type="radio" name="checkItems"></th>--> | |
| 73 | + <th width="2%">#</th> | |
| 74 | + <th width="2%">序号</th> | |
| 75 | + <th width="5%">报备时间</th> | |
| 76 | + <th width="5%">公告区域</th> | |
| 77 | + <th width="20%">公告信息</th> | |
| 78 | + </tr> | |
| 79 | + </thead> | |
| 80 | + <tbody class="table_body"> | |
| 81 | + </tbody> | |
| 82 | + </table> | |
| 83 | + </div> | |
| 84 | + | |
| 85 | + <div class="load-panel"> | |
| 86 | + <i class="uk-icon-spinner uk-icon-spin"></i> | |
| 87 | + 正在加载数据 | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + <script id="emergency_table_body" type="text/html"> | |
| 94 | + {{each data.list as obj i}} | |
| 95 | + {{if obj.status == 2}} | |
| 96 | + <tr style="background-color: #ff5f78"> | |
| 97 | + <td style="vertical-align: middle;"> | |
| 98 | + <!--<input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.report_XL}}">--> | |
| 99 | + </td> | |
| 100 | + {{else}} | |
| 101 | + <tr> | |
| 102 | + <td style="vertical-align: middle;"> | |
| 103 | + <input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.report_XL}}"> | |
| 104 | + </td> | |
| 105 | + {{/if}} | |
| 106 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 107 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 108 | + <td style="vertical-align: middle;display:none">{{obj.report_BBR}}</td> | |
| 109 | + <td style="vertical-align: middle;display:none">{{obj.report_GS}}</td> | |
| 110 | + <td style="vertical-align: middle;display:none">{{obj.report_FGS}}</td> | |
| 111 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 112 | + <td style="vertical-align: middle;">{{obj.report_TFSJ}}</td> | |
| 113 | + <td style="vertical-align: middle;">{{obj.report_YXSJ}}</td> | |
| 114 | + <td style="vertical-align: middle;">{{obj.report_YXBC}}</td> | |
| 115 | + <td style="vertical-align: middle;">{{obj.report_TZCS}}</td> | |
| 116 | + </tr> | |
| 117 | + {{/each}} | |
| 118 | + </script> | |
| 119 | + <script id="regional_table_body" type="text/html"> | |
| 120 | + {{each data.list as obj i}} | |
| 121 | + | |
| 122 | + {{if obj.status == 2}} | |
| 123 | + <tr style="background-color: #ff5f78"> | |
| 124 | + <td style="vertical-align: middle;"> | |
| 125 | + <!--<input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.report_XL}}">--> | |
| 126 | + </td> | |
| 127 | + {{else}} | |
| 128 | + <tr> | |
| 129 | + <td style="vertical-align: middle;"> | |
| 130 | + <input type="radio" class="group-checkable icheck" name="idRadio" value="{{obj.id}}" data-lineCode="{{obj.report_XL}}"> | |
| 131 | + </td> | |
| 132 | + {{/if}} | |
| 133 | + <td style="vertical-align: middle;">{{i + 1}}</td> | |
| 134 | + <td style="vertical-align: middle;">{{obj.report_DATE}}</td> | |
| 135 | + <td style="vertical-align: middle;display:none">{{obj.report_BBR}}</td> | |
| 136 | + <td style="vertical-align: middle;display:none">{{obj.report_GS}}</td> | |
| 137 | + <td style="vertical-align: middle;display:none">{{obj.report_FGS}}</td> | |
| 138 | + <td style="vertical-align: middle;">{{obj.report_XLNAME}}</td> | |
| 139 | + <td style="vertical-align: middle;">{{obj.report_ROAD}}</td> | |
| 140 | + <td style="vertical-align: middle;">{{obj.report_XSFX}}</td> | |
| 141 | + <td style="vertical-align: middle;">{{obj.report_SGGK}}</td> | |
| 142 | + <td style="vertical-align: middle;">{{obj.report_BZ}}</td> | |
| 143 | + </tr> | |
| 144 | + {{/each}} | |
| 145 | + </script> | |
| 146 | + | |
| 147 | + | |
| 148 | + <!-- common js --> | |
| 149 | + <!--<script src="/assets/js/common.js"></script>--> | |
| 150 | + <!--<!– select2 下拉框 –>--> | |
| 151 | + <!--<script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script>--> | |
| 152 | + <!-- moment.js 日期处理类库 --> | |
| 153 | + <script src="/assets/plugins/moment-with-locales.js" data-exclude=1></script> | |
| 154 | + <!-- 日期控件 --> | |
| 155 | + <script src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | |
| 156 | + <!-- bootstrap --> | |
| 157 | + <script src="/metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js" data-exclude=1></script> | |
| 158 | + <!--<script src="/metronic_v4.5.4/plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>--> | |
| 159 | + <!-- editable.js --> | |
| 160 | + <!--<script src="/metronic_v4.5.4/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.min.js"></script>--> | |
| 161 | + <script> | |
| 162 | + var manageJs = (function () { | |
| 163 | + var modal = '#report-register-modal'; | |
| 164 | + var editType = false;//编辑状态,修改过东西 | |
| 165 | + var lineCodes ='',// 选择的线路 | |
| 166 | + companyMap = {}, | |
| 167 | + user = {};//当前用户信息 | |
| 168 | + var activeDiv='emergency_table'; | |
| 169 | + var lineList = gb_data_basic.activeLines; | |
| 170 | + | |
| 171 | + //当前用户信息 | |
| 172 | + gb_common.$get('/user/currentUser', null,function (data) { | |
| 173 | + user = data; | |
| 174 | + }); | |
| 175 | + | |
| 176 | + $(modal).on('init', function (e,data) { | |
| 177 | + // get请求获取公司 | |
| 178 | + /*gb_common.$get("/user/companyData",null,function(result){ | |
| 179 | + var len_ = lineList.length; | |
| 180 | + if(len_>0) { | |
| 181 | + // 遍历线路对应的公司 | |
| 182 | + for(var i = 0; i < result.length; i++){ | |
| 183 | + var companyCode = result[i].companyCode; | |
| 184 | + var children = result[i].children; | |
| 185 | + for(var j = 0; j < children.length; j++){ | |
| 186 | + var code = children[j].code; | |
| 187 | + for(var k=0;k < lineList.length;k++ ){ | |
| 188 | + if(lineList[k].brancheCompany==code && lineList[k].company==companyCode){ | |
| 189 | + companyMap[lineList[k].lineCode] = companyCode+":"+code+"-"+result[i].companyName+":"+result[i].children[j].name; | |
| 190 | + } | |
| 191 | + } | |
| 192 | + } | |
| 193 | + } | |
| 194 | + | |
| 195 | + | |
| 196 | + // initPinYinSelect2($('.lineSelect'), paramsD, function (selector) { | |
| 197 | + // selector.select2("val", ""); | |
| 198 | + // }); | |
| 199 | + } | |
| 200 | + });*/ | |
| 201 | + // 遍历出所有需要查询的线路 | |
| 202 | + lineCodes = ''; | |
| 203 | + $.each(lineList, function (i, g) { | |
| 204 | + lineCodes += '"'+g.lineCode + '",'; | |
| 205 | + }); | |
| 206 | + | |
| 207 | + refreshDate(); | |
| 208 | + //滚动条 | |
| 209 | + $('.report-register-table-wrap', modal).perfectScrollbar(); | |
| 210 | + }); | |
| 211 | + | |
| 212 | + var refreshDate = function() { | |
| 213 | + | |
| 214 | + $('.load-panel', modal).show(); | |
| 215 | + loading=true; | |
| 216 | + gb_common.$get("/reportRegister/findList", {lineCodes: lineCodes.substring(0, lineCodes.length - 1)}, function (data) { | |
| 217 | + if (data.status == "SUCCESS") { | |
| 218 | + var list = data.list; | |
| 219 | + var tableList1 = [], tableList2 = []; | |
| 220 | + $.each(list, function (i, rr) { | |
| 221 | + rr.report_DATE = formatDate(new Date(rr.report_DATE)); | |
| 222 | + if (rr.report_TYPE == 1) { | |
| 223 | + tableList1.push(rr); | |
| 224 | + } else if (rr.report_TYPE == 2) { | |
| 225 | + tableList2.push(rr); | |
| 226 | + } | |
| 227 | + }); | |
| 228 | + var htmlStr = template('emergency_table_body', {'data':{'list': tableList1,'line':lineList}}); | |
| 229 | + $('#emergency_table .table_body', modal).html(htmlStr); | |
| 230 | + htmlStr = template('regional_table_body', {'data':{'list': tableList2,'line':lineList}}); | |
| 231 | + $('#regional_table .table_body', modal).html(htmlStr); | |
| 232 | + $('.load-panel', modal).hide(); | |
| 233 | + loading=false; | |
| 234 | + } | |
| 235 | + }); | |
| 236 | + }; | |
| 237 | + | |
| 238 | + | |
| 239 | + $("#add", modal).on('click', function () { | |
| 240 | + var activeDivId = $('.ct_table_wrap .active').attr('id'); | |
| 241 | + open_modal('/real_control_v2/fragments/north/nav/station_notice/add.html', {'tableActive' : activeDivId,'companyMap':companyMap,'lineList':lineList,'user':user}, { | |
| 242 | + bgclose: false, | |
| 243 | + modal: false | |
| 244 | + }); | |
| 245 | + }); | |
| 246 | + $("#update", modal).on('click', function () { | |
| 247 | + var activeDivId = $('.ct_table_wrap .active').attr('id'); | |
| 248 | + var id = $("#"+activeDivId+" .table_body input[name='idRadio']:checked", modal).val(); | |
| 249 | + if(id){ | |
| 250 | + gb_common.$get('/reportRegister/' + id,null, function (rs) { | |
| 251 | + // 全转换为大写 | |
| 252 | + var rr = nameTo_(rs); | |
| 253 | + open_modal('/real_control_v2/fragments/north/nav/report_register/update.html', {'tableActive' : activeDivId,'companyMap':companyMap,'lineList':lineList,'user':user,'rr':rr}, { | |
| 254 | + bgclose: false, | |
| 255 | + modal: false | |
| 256 | + }); | |
| 257 | + }); | |
| 258 | + } else { | |
| 259 | + notify_succ('当前类型没有选中!'); | |
| 260 | + } | |
| 261 | + }); | |
| 262 | + $("#delete").on('click', function () { | |
| 263 | + var activeDivId = $('.ct_table_wrap .active').attr('id'); | |
| 264 | + var id = $("#"+activeDivId+" .table_body input[name='idRadio']:checked", modal).val(); | |
| 265 | + if(id){ | |
| 266 | + alt_confirm('确实要删除这个报备登记吗?', function () { | |
| 267 | + // gb_common.$del('/reportRegister/' + id, function (rs) { | |
| 268 | + gb_common.$post('/reportRegister/delete',{ID:id,REPORT_BBR:user.userName+'/'+user.name}, function (rs) { | |
| 269 | + manageJs.refreshDate(); | |
| 270 | + notify_succ('删除成功!'); | |
| 271 | + if(rs.status2.CODE == '0') | |
| 272 | + notify_succ('同步到服务热线系统成功!'); | |
| 273 | + else | |
| 274 | + notify_err('同步到服务热线系统失败!'); | |
| 275 | + }); | |
| 276 | + }, '确定删除'); | |
| 277 | + } else { | |
| 278 | + notify_succ('当前类型没有选中!'); | |
| 279 | + } | |
| 280 | + }); | |
| 281 | + | |
| 282 | + | |
| 283 | + $(modal).on('click', '.navigation_bar li', function () { | |
| 284 | + $(this).parent().find('li.uk-active').removeClass('uk-active'); | |
| 285 | + $(this).addClass('uk-active'); | |
| 286 | + var typeName = $(this).attr('id'); | |
| 287 | + var oldActiveDivId = $("#"+typeName+"_table").parent().find('.active'); | |
| 288 | + var oldActiveDiv = document.getElementById(oldActiveDivId.attr('id')); | |
| 289 | + oldActiveDiv.style.display = "none"; | |
| 290 | + oldActiveDivId.removeClass("active"); | |
| 291 | + | |
| 292 | + activeDiv = typeName+"_table"; | |
| 293 | + $("#"+typeName+"_table").addClass("active"); | |
| 294 | + var activeTable = document.getElementById(typeName+"_table"); | |
| 295 | + activeTable.style.display = ""; | |
| 296 | + }); | |
| 297 | + | |
| 298 | + var formatDate = function(now) { | |
| 299 | + var year=now.getFullYear(); | |
| 300 | + var month=now.getMonth()+1; | |
| 301 | + var date=now.getDate(); | |
| 302 | + var hour=now.getHours(); | |
| 303 | + var minute=now.getMinutes(); | |
| 304 | + var second=now.getSeconds(); | |
| 305 | + return year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second; | |
| 306 | + }; | |
| 307 | + | |
| 308 | + function nameTo_(object) { | |
| 309 | + for (var i in object) { | |
| 310 | + if (object.hasOwnProperty(i)) { | |
| 311 | + var temp = object[i]; | |
| 312 | + var oldI = i; | |
| 313 | + temp = object[i.toUpperCase()] = object[i]; | |
| 314 | + delete object[oldI]; | |
| 315 | + if (typeof temp === 'object' || Object.prototype.toString.call(temp) === '[object Array]') { | |
| 316 | + nameTo_(temp); | |
| 317 | + } | |
| 318 | + } | |
| 319 | + } | |
| 320 | + return object; | |
| 321 | + } | |
| 322 | + | |
| 323 | + return{ | |
| 324 | + refreshDate:refreshDate | |
| 325 | + } | |
| 326 | + })(); | |
| 327 | + </script> | |
| 328 | +</div> | |
| 0 | 329 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/station_notice/mould/report_register.xls
0 → 100644
No preview for this file type
src/main/resources/static/real_control_v2/fragments/north/nav/station_notice/update.html
0 → 100644
| 1 | +<div class="uk-modal" id="notice_update_mobal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 600px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>修改公告</h2> | |
| 6 | + </div> | |
| 7 | + <div class="uk-form uk-form-horizontal" id="report_register_form"> | |
| 8 | + <form id="add_head_table"> | |
| 9 | + <input type="hidden" name="ID" id="ID"> | |
| 10 | + <input type="hidden" name="NOTICE_BBR" id="NOTICE_BBR" value=""> | |
| 11 | + <input type="hidden" name="NOTICE_XLNAME" id="NOTICE_XLNAME" value=""> | |
| 12 | + | |
| 13 | + <!-- 报备时间 --> | |
| 14 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 15 | + <div class="uk-form-row"> | |
| 16 | + <label class="uk-form-label"> | |
| 17 | + 报备时间: | |
| 18 | + </label> | |
| 19 | + <div class="uk-form-controls"> | |
| 20 | + <input type="text" class="form-control" name="NOTICE_DATE" id="NOTICE_DATE" readonly="readonly"> | |
| 21 | + </div> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 25 | + <div class="uk-form-row"> | |
| 26 | + <label class="uk-form-label"> | |
| 27 | + 公告截止: | |
| 28 | + </label> | |
| 29 | + <div class="uk-form-controls"> | |
| 30 | + <input class="form-control" type="text" name="NOTICE_TIME" id="NOTICE_TIME"> | |
| 31 | + </div> | |
| 32 | + </div> | |
| 33 | + </div> | |
| 34 | + <!-- 类型 --> | |
| 35 | + <div class="uk-grid uk-width-2-3 uk-container-center" hidden> | |
| 36 | + <div class="uk-form-row"> | |
| 37 | + <label class="uk-form-label"> | |
| 38 | + 类型: | |
| 39 | + </label> | |
| 40 | + <div class="uk-form-controls"> | |
| 41 | + <select class="form-control typeSelect" name="NOTICE_TYPE" id="NOTICE_TYPE"> | |
| 42 | + <option value="1">突发事件</option> | |
| 43 | + <option value="2">区域公告</option> | |
| 44 | + </select> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + </form> | |
| 49 | + <!-- 突发事件--> | |
| 50 | + <form id="add_emergency_table" class="c_register_form" style="display:none; margin-top: 35px;"> | |
| 51 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 52 | + <div class="uk-form-row"> | |
| 53 | + <label class="uk-form-label"> | |
| 54 | + 线路: | |
| 55 | + </label> | |
| 56 | + <div class="uk-form-controls"> | |
| 57 | + <select class="form-control lineSelect" name="NOTICE_XL" id="NOTICE_XL"> | |
| 58 | + </select> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + </div> | |
| 62 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 63 | + <div class="uk-form-row"> | |
| 64 | + <label class="uk-form-label"> | |
| 65 | + 方向: | |
| 66 | + </label> | |
| 67 | + <div class="uk-form-controls"> | |
| 68 | + <select class="form-control typeSelect" name="NOTICE_XSFX" id="NOTICE_XSFX" > | |
| 69 | + <option value="0">上行</option> | |
| 70 | + <option value="1">下行</option> | |
| 71 | + </select> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 76 | + <div class="uk-form-row"> | |
| 77 | + <label class="uk-form-label"> | |
| 78 | + 突发事件: | |
| 79 | + </label> | |
| 80 | + <div class="uk-form-controls"> | |
| 81 | + <select class="form-control typeSelect" name="NOTICE_TFSJ" id="NOTICE_TFSJ" > | |
| 82 | + <option value="1">重大活动</option> | |
| 83 | + <option value="2">恶劣天气</option> | |
| 84 | + <option value="3">交通事故</option> | |
| 85 | + <option value="3">道路拥堵</option> | |
| 86 | + </select> | |
| 87 | + </div> | |
| 88 | + </div> | |
| 89 | + </div> | |
| 90 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 91 | + <div class="uk-form-row"> | |
| 92 | + <label class="uk-form-label"> | |
| 93 | + 事件影响: | |
| 94 | + </label> | |
| 95 | + <div class="uk-form-controls"> | |
| 96 | + <select class="form-control typeSelect" name="NOTICE_SJYX" id="NOTICE_SJYX" > | |
| 97 | + <option value="1">临时改道</option> | |
| 98 | + <option value="2">班次延误</option> | |
| 99 | + </select> | |
| 100 | + </div> | |
| 101 | + </div> | |
| 102 | + </div> | |
| 103 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 104 | + <div class="uk-form-row"> | |
| 105 | + <label class="uk-form-label"> | |
| 106 | + 影响站点: | |
| 107 | + </label> | |
| 108 | + <div class="uk-form-controls"> | |
| 109 | + <select class="form-control lineSelect" name="NOTICE_STATION" id="NOTICE_STATION" > | |
| 110 | + </select> | |
| 111 | + </div> | |
| 112 | + </div> | |
| 113 | + </div> | |
| 114 | + <div class="uk-modal-footer uk-text-right"> | |
| 115 | + <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> | |
| 116 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 117 | + <button type="submit" class="uk-button uk-button-primary submitBtn"><i class="uk-icon-check"></i> 保存</button> | |
| 118 | + </div> | |
| 119 | + </form> | |
| 120 | + <!-- 区域公告--> | |
| 121 | + <form id="add_regional_table" class="c_register_form" style="display:none; margin-top: 35px;"> | |
| 122 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 123 | + <div class="uk-form-row"> | |
| 124 | + <label class="uk-form-label"> | |
| 125 | + 区域: | |
| 126 | + </label> | |
| 127 | + <div class="uk-form-controls"> | |
| 128 | + <select class="form-control lineSelect" name="NOTICE_QY" id="NOTICE_QY"> | |
| 129 | + <option value='0'>全部</option> | |
| 130 | + <option value='1'>区域1</option> | |
| 131 | + <option value='2'>区域2</option> | |
| 132 | + <option value='3'>区域3</option> | |
| 133 | + </select> | |
| 134 | + </div> | |
| 135 | + </div> | |
| 136 | + </div> | |
| 137 | + <div class="uk-grid uk-width-2-3 uk-container-center"> | |
| 138 | + <div class="uk-form-row"> | |
| 139 | + <label class="uk-form-label"> | |
| 140 | + 公告信息: | |
| 141 | + </label> | |
| 142 | + <div class="uk-form-controls"> | |
| 143 | + <select class="form-control typeSelect" name="NOTICE_GG" id="NOTICE_GG" style="max-width: 220px"> | |
| 144 | + <option value="0">雨天路滑,安全出行。</option> | |
| 145 | + <option value="1">高峰时段,道路拥堵,请乘客合理安排出行。</option> | |
| 146 | + <option value="2">请先下后上,注意乘车安全。</option> | |
| 147 | + </select> | |
| 148 | + </div> | |
| 149 | + </div> | |
| 150 | + </div> | |
| 151 | + <div class="uk-modal-footer uk-text-right"> | |
| 152 | + <span class="bind_gas_station_panel" style="position: absolute;left: 30px;text-decoration: underline;"></span> | |
| 153 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 154 | + <button type="submit" class="uk-button uk-button-primary submitBtn"><i class="uk-icon-check"></i> 保存</button> | |
| 155 | + </div> | |
| 156 | + </form> | |
| 157 | + </div> | |
| 158 | + </div> | |
| 159 | + | |
| 160 | + <script> | |
| 161 | + (function () { | |
| 162 | + var modal = '#notice_update_mobal'; | |
| 163 | + var tableActive = '',formActive = ''; | |
| 164 | + var NOTICE_TYPE, | |
| 165 | + lineList = {}, | |
| 166 | + user = {},rr={}; | |
| 167 | + //加载站点 | |
| 168 | + $("#NOTICE_XL").on("change", function(){ | |
| 169 | + var lineCode = $(this).val(); | |
| 170 | + var direction = $('#NOTICE_XSFX').val(); | |
| 171 | + loadStation(lineCode,direction); | |
| 172 | + | |
| 173 | + }); | |
| 174 | + $("#NOTICE_XSFX").on("change", function(){ | |
| 175 | + var lineCode = $('#NOTICE_XL').val(); | |
| 176 | + var direction = $(this).val(); | |
| 177 | + loadStation(lineCode,direction); | |
| 178 | + }); | |
| 179 | + | |
| 180 | + $(modal).on('init', function (e, data) { | |
| 181 | + $('#NOTICE_DATE').datetimepicker({ | |
| 182 | + format : 'YYYY-MM-DD HH:mm:ss', | |
| 183 | + locale : 'zh-cn' | |
| 184 | + }); | |
| 185 | + $("#NOTICE_TIME").datetimepicker({ | |
| 186 | + format : 'YYYY-MM-DD HH:mm:ss', | |
| 187 | + locale : 'zh-cn' | |
| 188 | + }); | |
| 189 | + tableActive = "add_"+data.tableActive; | |
| 190 | + rr = data.rr; | |
| 191 | + var typeInt = 1; | |
| 192 | + if (tableActive == 'add_emergency_table') { | |
| 193 | + typeInt = 1; | |
| 194 | + } else if (tableActive == 'add_regional_table') { | |
| 195 | + typeInt = 2; | |
| 196 | + } else { | |
| 197 | + UIkit.modal(modal).hide(); | |
| 198 | + notify_err('您所选的数据有问题,请重新选择!'); | |
| 199 | + return; | |
| 200 | + } | |
| 201 | + $('#NOTICE_TYPE').val(typeInt); | |
| 202 | + if(typeInt != rr.NOTICE_TYPE ) { | |
| 203 | + UIkit.modal(modal).hide(); | |
| 204 | + notify_err('您所选的数据有问题,请重新选择!'); | |
| 205 | + return; | |
| 206 | + } | |
| 207 | + document.getElementById(tableActive).style.display = ""; | |
| 208 | + | |
| 209 | + // 先给input赋值 | |
| 210 | + $('input,select', modal).each(function () { | |
| 211 | + var domName = $(this).attr('name'); | |
| 212 | + if(domName == 'NOTICE_DATE'){ | |
| 213 | + $('#NOTICE_DATE').val(moment(new Date(rr[domName])).format('YYYY-MM-DD HH:mm:ss')); | |
| 214 | + }else if(domName == 'NOTICE_TIME'){ | |
| 215 | + $('#NOTICE_TIME').val(moment(new Date(rr[domName])).format('YYYY-MM-DD HH:mm:ss')); | |
| 216 | + }else{ | |
| 217 | + $(this).val(rr[domName]); | |
| 218 | + } | |
| 219 | + }); | |
| 220 | + lineList = data.lineList; | |
| 221 | + user = data.user; | |
| 222 | + $('#NOTICE_BBR').val(user.userName+'/'+user.name); | |
| 223 | + var options = ''; | |
| 224 | + if(rr.NOTICE_XL!=undefined){ | |
| 225 | + $.each(lineList, function (i,line) { | |
| 226 | + if(line.lineCode == rr.NOTICE_XL) | |
| 227 | + options += '<option value='+line.lineCode+' selected = "selected" >'+line.name+'</option>'; | |
| 228 | + else | |
| 229 | + options += '<option value='+line.lineCode+'>'+line.name+'</option>'; | |
| 230 | + }); | |
| 231 | + $('#NOTICE_XL').html(options); | |
| 232 | + $('#NOTICE_XL').trigger("change"); | |
| 233 | + } | |
| 234 | + changeType(tableActive); | |
| 235 | + $('#NOTICE_TYPE').on('change',function () { | |
| 236 | + document.getElementById(tableActive).style.display = "none"; | |
| 237 | + NOTICE_TYPE = this.value; | |
| 238 | + if (NOTICE_TYPE == 1) { | |
| 239 | + tableActive = 'add_emergency_table'; | |
| 240 | + } else if (NOTICE_TYPE == 2) { | |
| 241 | + tableActive = 'add_regional_table'; | |
| 242 | + } | |
| 243 | + document.getElementById(tableActive).style.display = ""; | |
| 244 | + changeType(tableActive); | |
| 245 | + }); | |
| 246 | + }); | |
| 247 | + function loadStation(lineCode,direction){ | |
| 248 | + //站点路由 | |
| 249 | + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(lineCode).sort(function (a, b) { | |
| 250 | + return a.stationRouteCode - b.stationRouteCode; | |
| 251 | + }), 'directions')[direction]; | |
| 252 | + var options = ''; | |
| 253 | + $.each(stationRoutes, function (i,station) { | |
| 254 | + if(station.stationCode == rr.NOTICE_STATION) | |
| 255 | + options += '<option value='+station.stationCode+' selected = "selected" >'+station.stationName+'</option>'; | |
| 256 | + else | |
| 257 | + options += '<option value='+station.stationCode+'>'+station.stationName+'</option>'; | |
| 258 | + }); | |
| 259 | + $('#NOTICE_STATION').html(options); | |
| 260 | + // 模拟change给公司分公司赋值 | |
| 261 | + $('#NOTICE_STATION').trigger("change"); | |
| 262 | + } | |
| 263 | + | |
| 264 | + function changeType(tableActiveStr) { | |
| 265 | + formActive = $('#'+tableActiveStr); | |
| 266 | + //校验不过 | |
| 267 | + formActive.on('err.field.fv', function () { | |
| 268 | + $('#submitChildTaskBtn', modal).removeClass('disabled').removeAttr('disabled'); | |
| 269 | + }); | |
| 270 | + | |
| 271 | + //校验 | |
| 272 | + formActive.formValidation({framework: 'uikit', locale: 'zh_CN'}); | |
| 273 | + //提交 | |
| 274 | + formActive.on('success.form.fv', function (e) { | |
| 275 | + e.preventDefault(); | |
| 276 | + var headData = $('#add_head_table').serializeJSON(); | |
| 277 | + var bodyData = $(formActive).serializeJSON(); | |
| 278 | + var params = {}; | |
| 279 | + Object.assign(params,headData,bodyData); | |
| 280 | + params.STATUS = '1'; | |
| 281 | + gb_common.$post('/notice/', params, function (rs) { | |
| 282 | + if(rs.status == 'SUCCESS'){ | |
| 283 | + // $('#history-sch-maintain-modal').trigger('refresh', {'tableActive' : tableActive,'companyMap':companyMap,'lineList':lineList,'user':user}); | |
| 284 | + UIkit.modal(modal).hide(); | |
| 285 | + notify_succ('修改成功!'); | |
| 286 | + manageJs.refreshDate(); | |
| 287 | + } else | |
| 288 | + notify_err('修改失败!'); | |
| 289 | + }); | |
| 290 | + }); | |
| 291 | + } | |
| 292 | + | |
| 293 | + //submit | |
| 294 | + $('.submitBtn', modal).on('click', function () { | |
| 295 | + $(this).addClass('disabled').attr('disabled', 'disabled'); | |
| 296 | + formActive.data('valid', false); | |
| 297 | + formActive.formValidation('validate'); | |
| 298 | + }); | |
| 299 | + })(); | |
| 300 | + </script> | |
| 301 | +</div> | |
| 0 | 302 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/js/data/json/north_toolbar.json
src/main/resources/static/real_control_v2/js/north/toolbar.js
| ... | ... | @@ -260,6 +260,9 @@ var gb_northToolbar = (function () { |
| 260 | 260 | sch_edit_qjgz: function () { |
| 261 | 261 | open_modal('/real_control_v2/zndd/qjgz/list.html', {}, modal_opts); |
| 262 | 262 | }, |
| 263 | + station_notice: function () { | |
| 264 | + open_modal('/real_control_v2/fragments/north/nav/station_notice/manage.html', {}, modal_opts); | |
| 265 | + }, | |
| 263 | 266 | }; |
| 264 | 267 | |
| 265 | 268 | return { | ... | ... |
src/main/resources/static/real_control_v2/js/stationcf/stationcf.js
| ... | ... | @@ -47,11 +47,11 @@ var gb_stationcf = (function () { |
| 47 | 47 | //layer.full(index);//全屏 |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | - /* var close = true; //关闭弹出框的时候不弹出 | |
| 50 | + var close = true; //关闭弹出框的时候不弹出 | |
| 51 | 51 | $wrap.on('click', '.multi_plat_msg_pops .msg-times', function () { |
| 52 | 52 | $(this).parent().parent().remove(); |
| 53 | - /!*if (close) close = false*!/ | |
| 54 | - });*/ | |
| 53 | + /*if (close) close = false*/ | |
| 54 | + }); | |
| 55 | 55 | $wrap.on('click', '.images', function () { |
| 56 | 56 | debugger |
| 57 | 57 | var image = $(this).data('image'); | ... | ... |