Commit 3fa2c6423c878cc9c4b89c20f19d82f2b53425bd

Authored by 潘钊
2 parents c72a260e def2f247

Merge branch 'minhang' of http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

src/main/java/com/bsth/data/gpsdata/arrival/precondition/InPreconditionHandler.java
1   -package com.bsth.data.gpsdata.arrival.precondition;
2   -
3   -import com.bsth.data.gpsdata.GpsEntity;
4   -import org.springframework.stereotype.Component;
5   -
6   -/**
7   - * 进站(前置电子围栏)
8   - * Created by panzhao on 2017/9/23.
9   - */
10   -@Component
11   -public class InPreconditionHandler {
12   -
13   - /**
14   - * 进站动作是否有通过前置围栏
15   - * @param gps
16   - * @param prev
17   - * @return
18   - */
19   - public boolean isPass(GpsEntity gps, GpsEntity prev){
20   - return false;
21   - }
22   -}
  1 +package com.bsth.data.gpsdata.arrival.precondition;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import org.springframework.stereotype.Component;
  5 +
  6 +/**
  7 + * 进站(前置电子围栏)
  8 + * Created by panzhao on 2017/9/23.
  9 + */
  10 +@Component
  11 +public class InPreconditionHandler {
  12 +
  13 + /**
  14 + * 进站动作是否有通过前置围栏
  15 + * @param gps
  16 + * @param prev
  17 + * @return
  18 + */
  19 + public boolean isPass(GpsEntity gps, GpsEntity prev){
  20 + return false;
  21 + }
  22 +}
... ...
src/main/java/com/bsth/data/gpsdata/arrival/precondition/entity/PreconditionGeo.java
1   -package com.bsth.data.gpsdata.arrival.precondition.entity;
2   -
3   -import com.bsth.util.Geo.Polygon;
4   -
5   -/**
6   - * 前置围栏 -地理坐标
7   - * Created by panzhao on 2017/9/23.
8   - */
9   -public class PreconditionGeo {
10   -
11   - private String name;
12   -
13   - /**
14   - * 前置约束的站点编码
15   - */
16   - private String stationCode;
17   -
18   - /**
19   - * 线路编码
20   - */
21   - private String lineCode;
22   -
23   - /**
24   - * 上下行
25   - */
26   - private int upDown;
27   -
28   - /**
29   - * 多边形坐标
30   - */
31   - private String coords;
32   -
33   - private com.bsth.util.Geo.Polygon polygon;
34   -
35   - private Integer order;
36   -
37   - public String getName() {
38   - return name;
39   - }
40   -
41   - public void setName(String name) {
42   - this.name = name;
43   - }
44   -
45   - public String getStationCode() {
46   - return stationCode;
47   - }
48   -
49   - public void setStationCode(String stationCode) {
50   - this.stationCode = stationCode;
51   - }
52   -
53   - public String getLineCode() {
54   - return lineCode;
55   - }
56   -
57   - public void setLineCode(String lineCode) {
58   - this.lineCode = lineCode;
59   - }
60   -
61   - public int getUpDown() {
62   - return upDown;
63   - }
64   -
65   - public void setUpDown(int upDown) {
66   - this.upDown = upDown;
67   - }
68   -
69   - public String getCoords() {
70   - return coords;
71   - }
72   -
73   - public void setCoords(String coords) {
74   - this.coords = coords;
75   - }
76   -
77   - public Integer getOrder() {
78   - return order;
79   - }
80   -
81   - public void setOrder(Integer order) {
82   - this.order = order;
83   - }
84   -
85   - public Polygon getPolygon() {
86   - return polygon;
87   - }
88   -
89   - public void setPolygon(Polygon polygon) {
90   - this.polygon = polygon;
91   - }
92   -}
  1 +package com.bsth.data.gpsdata.arrival.precondition.entity;
  2 +
  3 +import com.bsth.util.Geo.Polygon;
  4 +
  5 +/**
  6 + * 前置围栏 -地理坐标
  7 + * Created by panzhao on 2017/9/23.
  8 + */
  9 +public class PreconditionGeo {
  10 +
  11 + private String name;
  12 +
  13 + /**
  14 + * 前置约束的站点编码
  15 + */
  16 + private String stationCode;
  17 +
  18 + /**
  19 + * 线路编码
  20 + */
  21 + private String lineCode;
  22 +
  23 + /**
  24 + * 上下行
  25 + */
  26 + private int upDown;
  27 +
  28 + /**
  29 + * 多边形坐标
  30 + */
  31 + private String coords;
  32 +
  33 + private com.bsth.util.Geo.Polygon polygon;
  34 +
  35 + private Integer order;
  36 +
  37 + public String getName() {
  38 + return name;
  39 + }
  40 +
  41 + public void setName(String name) {
  42 + this.name = name;
  43 + }
  44 +
  45 + public String getStationCode() {
  46 + return stationCode;
  47 + }
  48 +
  49 + public void setStationCode(String stationCode) {
  50 + this.stationCode = stationCode;
  51 + }
  52 +
  53 + public String getLineCode() {
  54 + return lineCode;
  55 + }
  56 +
  57 + public void setLineCode(String lineCode) {
  58 + this.lineCode = lineCode;
  59 + }
  60 +
  61 + public int getUpDown() {
  62 + return upDown;
  63 + }
  64 +
  65 + public void setUpDown(int upDown) {
  66 + this.upDown = upDown;
  67 + }
  68 +
  69 + public String getCoords() {
  70 + return coords;
  71 + }
  72 +
  73 + public void setCoords(String coords) {
  74 + this.coords = coords;
  75 + }
  76 +
  77 + public Integer getOrder() {
  78 + return order;
  79 + }
  80 +
  81 + public void setOrder(Integer order) {
  82 + this.order = order;
  83 + }
  84 +
  85 + public Polygon getPolygon() {
  86 + return polygon;
  87 + }
  88 +
  89 + public void setPolygon(Polygon polygon) {
  90 + this.polygon = polygon;
  91 + }
  92 +}
... ...
src/main/java/com/bsth/service/excep/impl/NowSpeedingServiceImpl.java
... ... @@ -129,20 +129,19 @@ public class NowSpeedingServiceImpl implements NowSpeedingService {
129 129 @Override
130 130 public PageObject<Speeding> Pagequery(Map<String, Object> map) {
131 131 String sql="select count(*) record from bsth_c_speeding_handle where 1=1 ";
132   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  132 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
133 133 Object line=map.get("line");
134 134 Object updown=map.get("updown");
135 135 Object startDate=map.get("startDate");
136 136 Object endDate=map.get("endDate");
137 137 Object times=map.get("times");
138   -
139   - if(line!=null){
  138 + if(line!=null && line != ""){
140 139 sql +=" and line like'%"+line.toString().trim()+"%'";
141 140 }
142   - if(updown!=null){
  141 + if(updown!=null && updown != ""){
143 142 sql +="and up_down like '%"+updown.toString()+"%'";
144 143 }
145   - if(startDate!=null){
  144 + if(startDate!=null && startDate != ""){
146 145 if (startDate.toString().length()>0) {
147 146 try {
148 147 Long t1 = sdf.parse(startDate.toString()+" 00:00:00").getTime();
... ... @@ -152,7 +151,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService {
152 151 }
153 152 }
154 153 }
155   - if(endDate!=null){
  154 + if(endDate!=null && endDate != ""){
156 155 if (endDate.toString().length()>0) {
157 156 try {
158 157 Long t2=sdf.parse(endDate.toString()+" 23:59:59").getTime();
... ... @@ -163,7 +162,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService {
163 162 }
164 163 }
165 164  
166   - if(times!=null && times.toString().length()>0){
  165 + if(times!=null && times.toString().length()>0 && times != ""){
167 166 sql +=" and (endTimestamp-startTimestamp) >="+Integer.valueOf(times.toString())*1000;
168 167 }
169 168  
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -33,6 +33,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading;
33 33 import com.bsth.entity.mcy_forms.Waybillday;
34 34 import com.bsth.entity.oil.Dlb;
35 35 import com.bsth.entity.oil.Ylb;
  36 +import com.bsth.entity.realcontrol.ChildTaskPlan;
36 37 import com.bsth.entity.realcontrol.ScheduleRealInfo;
37 38 import com.bsth.entity.schedule.SchedulePlanInfo;
38 39 import com.bsth.repository.LineRepository;
... ... @@ -1031,9 +1032,16 @@ public class FormsServiceImpl implements FormsService {
1031 1032  
1032 1033 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
1033 1034 for (int j = 0; j < listReal.size(); j++) {
1034   - ScheduleRealInfo s=listReal.get(j);
1035   - if(s.getXlBm().equals(line) && !lineSet.contains(s.getXlName())){
1036   - newList.add(s);
  1035 + ScheduleRealInfo s = listReal.get(j);
  1036 + if (s.getXlBm().equals(line) && !lineSet.contains(s.getXlName())) {
  1037 + Set<ChildTaskPlan> cts = s.getcTasks();
  1038 + if (cts != null && cts.size() > 0) {
  1039 + newList.add(s);
  1040 + } else {
  1041 + if (s.getZdsjActual() != null) {
  1042 + newList.add(s);
  1043 + }
  1044 + }
1037 1045 }
1038 1046 }
1039 1047  
... ... @@ -1041,12 +1049,12 @@ public class FormsServiceImpl implements FormsService {
1041 1049 int ljbc=culateMileageService.culateLjbc(newList,"");
1042 1050 double ksgl=culateMileageService.culateKsgl(newList);
1043 1051 double jccgl=culateMileageService.culateJccgl(newList);
1044   -
  1052 + double zksgl=Arith.add(ksgl, jccgl);
1045 1053 double sjgl=culateMileageService.culateSjgl(newList);
1046 1054 double ljgl=culateMileageService.culateLjgl(newList);
1047   -
  1055 + double zyygl=Arith.add(sjgl, ljgl);
1048 1056 o.setEmptMileage(String.valueOf(Arith.add(ksgl, jccgl)));
1049   - o.setXsgl(String.valueOf(Arith.add(sjgl, ljgl)));
  1057 + o.setXsgl(String.valueOf(Arith.add(zyygl, zksgl)));
1050 1058 o.setSjbc(String.valueOf(sjbc+ljbc));
1051 1059  
1052 1060 double jzl=0.0;
... ... @@ -1103,24 +1111,33 @@ public class FormsServiceImpl implements FormsService {
1103 1111 List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
1104 1112 for (int i = 0; i < list.size(); i++) {
1105 1113 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  1114 + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
1106 1115 Vehicleloading sin=list.get(i);
1107 1116 sin.setrQ(date);
1108 1117 String jsy=sin.getJgh();
1109 1118 String clzbh=sin.getClzbh();
1110 1119 for (int j = 0; j < listReal.size(); j++) {
1111   - ScheduleRealInfo s=listReal.get(j);
1112   - if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)){
  1120 + ScheduleRealInfo s = listReal.get(j);
  1121 + if (s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)) {
  1122 + Set<ChildTaskPlan> cts = s.getcTasks();
  1123 + if (cts != null && cts.size() > 0) {
  1124 + newList_.add(s);
  1125 + } else {
  1126 + if (s.getZdsjActual() != null) {
  1127 + newList_.add(s);
  1128 + }
  1129 + }
1113 1130 newList.add(s);
1114 1131 }
1115 1132 }
1116 1133  
1117 1134 int jhbc=culateMileageService.culateJhbc(newList, "");
1118   - int sjbc=culateMileageService.culateSjbc(newList, "");
1119   - int ljbc=culateMileageService.culateLjbc(newList, "");
1120   - double yygl=culateMileageService.culateSjgl(newList);
1121   - double ljgl=culateMileageService.culateLjgl(newList);
1122   - double ksgl=culateMileageService.culateKsgl(newList);
1123   - double jcgl=culateMileageService.culateJccgl(newList);
  1135 + int sjbc=culateMileageService.culateSjbc(newList_, "");
  1136 + int ljbc=culateMileageService.culateLjbc(newList_, "");
  1137 + double yygl=culateMileageService.culateSjgl(newList_);
  1138 + double ljgl=culateMileageService.culateLjgl(newList_);
  1139 + double ksgl=culateMileageService.culateKsgl(newList_);
  1140 + double jcgl=culateMileageService.culateJccgl(newList_);
1124 1141 double zyygl=Arith.add(yygl, ljgl);
1125 1142 double zksgl=Arith.add(ksgl, jcgl);
1126 1143 sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -2058,7 +2058,7 @@ public class ReportServiceImpl implements ReportService{
2058 2058 int weeks_year2 = cal.get(Calendar.WEEK_OF_YEAR);
2059 2059 Date dates2=cal.getTime();
2060 2060 String d2=simpleDateFormat.format(dates2);
2061   - String sql="select *,UNIX_TIMESTAMP(times) as ts from bsth_c_arrival_info where times >= '"+d1 +"'and "
  2061 + /*String sql="select *,UNIX_TIMESTAMP(times) as ts from bsth_c_arrival_info where times >= '"+d1 +"'and "
2062 2062 + " times <='"+d2+"' and line_id = '"+line+"' and up_down = '"+zd+"'"
2063 2063 + " order by device_id,times";
2064 2064  
... ... @@ -2073,7 +2073,30 @@ public class ReportServiceImpl implements ReportService{
2073 2073 ai.setTs(arg0.getLong("ts")*1000);
2074 2074 return ai;
2075 2075 }
2076   - });
  2076 + });*/
  2077 +
  2078 + Connection conn = null;
  2079 + PreparedStatement ps = null;
  2080 + ResultSet rs = null;
  2081 +
  2082 + String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? "
  2083 + + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts";
  2084 + try{
  2085 + conn = DBUtils_MS.getConnection();
  2086 + ps = conn.prepareStatement(sql);
  2087 + ps.setString(1, line);
  2088 + ps.setInt(2, weeks_year1);
  2089 + ps.setLong(3, date1);
  2090 + ps.setLong(4, date2);
  2091 + ps.setInt(5, zd);
  2092 + rs = ps.executeQuery();
  2093 +
  2094 + list = resultSet2Set(rs);
  2095 + }catch(Exception e){
  2096 + logger.error("", e);
  2097 + }finally {
  2098 + DBUtils_MS.close(rs, ps, conn);
  2099 + }
2077 2100  
2078 2101 } catch (ParseException e1) {
2079 2102 // TODO Auto-generated catch block
... ... @@ -2223,23 +2246,6 @@ public class ReportServiceImpl implements ReportService{
2223 2246 , (i+1));
2224 2247 }
2225 2248 inoutList.add(map1);
2226   -
2227   - /*for (int j = 0; j < listStation.size(); j++) {
2228   - map2=new HashMap<String,Object>();
2229   - StationRoute s=listStation.get(j);
2230   - List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>();
2231   - for (int j2 = 0; j2 < arrInfoList.size(); j2++) {
2232   - ArrivalInfo a=arrivalList.get(j2);
2233   - if(s.getStationCode().equals(a.getStopNo())){
2234   - arrivalList.add(a);
2235   - }
2236   - }
2237   - Map<String, String> m=this.strInOut(arrivalList,lzsj);
2238   -
2239   - map2.put(s.getStationCode()+"in", m.get("in"));
2240   - map2.put(s.getStationCode()+"out", m.get("out"));
2241   - map2.put(s.getStationCode(), m.get("type"));
2242   - }*/
2243 2249 List<String> list_nbbm=new ArrayList<String>();
2244 2250 Map<String, Object> m=new HashMap<String,Object>();
2245 2251 for (int i = 0; i < arrInfoList.size(); i++) {
... ...
src/main/resources/static/pages/base/station/js/station-list-table.js
... ... @@ -262,7 +262,6 @@
262 262 var i = layer.load(2);
263 263 // 异步请求获取表格数据
264 264 $.get('/stationroute',params,function(result){
265   - console.log(result);
266 265 // 添加序号
267 266 result.content.page = page;
268 267 // 把数据填充到模版中
... ...
src/main/resources/static/pages/control/lineallot_v2/iframe_wrap.html
1   -<!-- 线路选择 -->
  1 +<!-- 线路选择 -->
2 2 <iframe src="/pages/control/lineallot_v2/main.html?origin=real_control_iframe" frameborder="0" style="height: 100%;width: 100%;"></iframe>
3 3 \ No newline at end of file
... ...
src/main/resources/static/pages/control/lineallot_v2/main.html
1   -<!DOCTYPE html>
2   -<html lang="zh-cn">
3   -
4   -<head>
5   - <meta charset="UTF-8">
6   - <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/>
7   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css"/>
8   - <!-- flatpickr -->
9   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css">
10   - <style>
11   - html, body {
12   - height: 100%;
13   - }
14   -
15   - .ct_page {
16   - padding: 25px 15px;
17   - height: 100%;
18   - height: calc(100% - 65px);
19   - }
20   -
21   - .ct_cont {
22   - height: calc(100% - 41px);
23   - }
24   -
25   - .ct_cont > div > div.uk-card {
26   - height: 99%;
27   - }
28   -
29   - .loading {
30   - height: 100%;
31   - text-align: center;
32   - }
33   -
34   - .loading .uk-spinner {
35   - margin-top: 200px;
36   - }
37   -
38   - .loading circle {
39   - stroke: red;
40   - }
41   -
42   - .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail {
43   - opacity: 0.6 !important;
44   - padding: 0 !important;
45   - }
46   -
47   - .line_list_all_wrap {
48   - height: 200px;
49   - overflow: auto;
50   - position: relative;
51   - -webkit-user-select:none;
52   - -moz-user-select:none;
53   - -ms-user-select:none;
54   - user-select:none;
55   - }
56   -
57   - .line_list_all_wrap > .item {
58   - background: #fff;
59   - color: #666;
60   - box-shadow: 0px 3px 12px rgba(0, 0, 0, 0.08);
61   - padding: 7px 12px;
62   - border: 1px solid #ececec;
63   - display: inline-block;
64   - margin: 5px;
65   - min-width: 70px;
66   - text-align: center;
67   - cursor: default;
68   - }
69   -
70   - .line_list_all_wrap > .item.active{
71   - background: #ffe9a5;
72   - }
73   -
74   - .checked_list {
75   - padding-left: 4px;
76   - -webkit-user-select:none;
77   - -moz-user-select:none;
78   - -ms-user-select:none;
79   - user-select:none;
80   - }
81   -
82   - .checked_list > .item {
83   - color: #fbfbfb;
84   - box-shadow: 0px 3px 12px rgba(50, 197, 210, 0.3);
85   - padding: 7px 12px;
86   - border: 1px solid #ececec;
87   - display: inline-block;
88   - margin: 5px 2px;
89   - min-width: 70px;
90   - text-align: center;
91   - background: #32C5D2;
92   - cursor: move;
93   - }
94   -
95   - .company_search_wrap {
96   - width: 610px;
97   - margin-left: 6px;
98   - }
99   -
100   - .company_search_wrap select {
101   - display: inline-block;
102   - width: 128px;
103   - margin-right: 12px;
104   - }
105   -
106   - .uk-card {
107   - border: 1px solid #eeeeee;
108   - }
109   -
110   - .footer_tools_card {
111   - margin-top: 20px;
112   - padding: 20px 40px;
113   - }
114   -
115   - .footer_tools_card label {
116   - vertical-align: bottom;
117   - display: inline-block;
118   - font-size: 13px;
119   - margin-left: 13px;
120   - margin-bottom: 3px !important;
121   - }
122   -
123   - .uk-button-default{
124   - background: #e0e0e0 !important;
125   - }
126   - </style>
127   -</head>
128   -
129   -<body>
130   -<div class="loading">
131   - <div uk-spinner></div>
132   -</div>
133   -<div class="ct_page" style="display: none;">
134   - <h2 class="uk-heading-line uk-heading-bullet"><span>线调 <h5 style="display: inline-block;">-选择线路</h5></span></h2>
135   - <div class="ct_cont">
136   - <div class="allot_wrap uk-flex-center" uk-grid>
137   - <div class="uk-card uk-card-hover uk-card-body uk-width-2-3@m"
138   - style="padding-top: 20px;padding-bottom: 20px;">
139   - <div class="company_search_wrap">
140   - <select class="uk-select company_search_select"></select>
141   - <select class="uk-select fgs_search_select" disabled>
142   - <option value="">分公司搜索</option>
143   - </select>
144   - <div class="uk-inline">
145   - <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>
146   - <input class="uk-input line_search_input" style="width: 310px;" placeholder="搜索线路">
147   - </div>
148   - </div>
149   - <hr>
150   - <div class="line_list_all_wrap"></div>
151   - <hr>
152   - <div class="checked_list" uk-sortable> </div>
153   - </div>
154   -
155   - <div class="uk-card uk-card-hover uk-card-body uk-width-2-3@m footer_tools_card">
156   - <button class="uk-button uk-button-default uk-button-large" style="font-size: 16px" id="go_to_real_system_btn"><i
157   - uk-icon=" icon: sign-in" style="margin-right: 5px;" ></i>进入线路调度
158   - </button>
159   - <label class="pattern_type_label"><input class="uk-checkbox" type="checkbox" > 主调模式登录</label>
160   - <label class="new_window_open_label" title="可能会被浏览器阻止新建窗口" uk-tooltip><input class="uk-checkbox" type="checkbox"> 新窗口打开</label>
161   - </div>
162   -
163   - <div class="uk-alert-warning uk-width-2-3@m " uk-alert>
164   - <p>注意!!! 相关“设备调试人员”和“测试人员”不要以主调模式进入线调。</p>
165   - </div>
166   - </div>
167   - </div>
168   -</div>
169   -
170   -<script id="line_list_items_temp" type="text/html">
171   - {{each list as obj i}}
172   - <span class="item" data-id="{{obj.lineCode}}" data-gsbm="{{obj.company}}_{{obj.brancheCompany}}">{{obj.name}}</span>
173   - {{/each}}
174   -</script>
175   -
176   -<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
177   -<script src="/assets/plugins/uk3.0/uikit.min.js"></script>
178   -<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script>
179   -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js"></script>
180   -<!-- EventProxy -->
181   -<script src="/assets/js/eventproxy.js"></script>
182   -<!-- art-template 模版引擎 -->
183   -<script src="/assets/plugins/template.js"></script>
184   -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>
185   -<script src="/assets/plugins/pinyin.js"></script>
186   -<script>
187   - var allMapps = {};//线路搜索映射
188   - var companyData = {};
189   - var codeMapps={}; //线路编码映射
190   - //滚动条
191   - $('.line_list_all_wrap').perfectScrollbar();
192   -
193   - var ep = EventProxy.create('all_lines', 'user_author', 'company_data', function (allLines, userAuthor, company_data) {
194   - //按用户权限过滤线路
195   - var authArray = userAuthor.lineCodeStr.split(','),
196   - newArray = [];
197   - $.each(allLines, function () {
198   - if (this.lineCode && authArray.indexOf(this.lineCode) != -1) {
199   - newArray.push(this);
200   - codeMapps[this.lineCode] = this;
201   - }
202   - });
203   - //排序
204   - newArray.sort(function (a, b) {
205   - return a.name.localeCompare(b.name);
206   - });
207   - //创建线路搜索映射
208   - createLineSearchMapps(newArray);
209   -
210   - var htmlStr = template('line_list_items_temp', {list: newArray});
211   - $('.line_list_all_wrap').html(htmlStr);
212   -
213   - //过滤公司编码数据
214   - filter_company_data.filter(newArray, convert_buss_data(company_data));
215   - initCompanySelect();
216   - //更新滚动条高度
217   - setTimeout(function () {
218   - $('.line_list_all_wrap').perfectScrollbar('update');
219   - }, 1000);
220   -
221   - //登录模式
222   - changePattern(userAuthor.pattern);
223   - if(!userAuthor.pattern)
224   - $('.pattern_type_label').hide().find('input')[0].checked=false;
225   - else
226   - $('input','.pattern_type_label')[0].checked=true;
227   -
228   - $('.loading').remove();
229   - $('.ct_page').show();
230   -
231   - //默认选中上次记录
232   - var lineControlItems = window.localStorage.getItem('lineControlItems');
233   - if (lineControlItems) {
234   - var array = JSON.parse(lineControlItems);
235   - $.each(array, function (i, line) {
236   - $('.item[data-id='+line.lineCode+']','.line_list_all_wrap').trigger('click');
237   - });
238   - }
239   - });
240   -
241   - $('.pattern_type_label').on('click', function () {
242   - var checked = $('input',this)[0].checked;
243   - changePattern(checked);
244   - });
245   -
246   - function changePattern(status) {
247   - var btn = $('#go_to_real_system_btn'),
248   - def='uk-button-default',
249   - prim='uk-button-primary';
250   - if(status){
251   - btn.removeClass(def).addClass(prim);
252   - }
253   - else{
254   - btn.removeClass(prim).addClass(def);
255   - }
256   - }
257   -
258   - /**
259   - * 查询所有线路
260   - */
261   - $.get('/line/all', {destroy_eq: 0}, function (list) {
262   - ep.emit('all_lines', list);
263   - });
264   -
265   - /**用户分配的线路*/
266   - $.get('/realControAuthority/findByCurrentUser', function (t) {
267   - ep.emit('user_author', t);
268   - });
269   -
270   - /** 查询公司编码 */
271   - $.get('/business/all', function (rs) {
272   - ep.emit('company_data', rs);
273   - });
274   -
275   - //点击选择线路
276   - $('.line_list_all_wrap').on('click', 'span.item', function () {
277   - var lineCode = $(this).data('id'),
278   - name = $(this).text();
279   - if ($(this).hasClass('active')) {
280   - $(this).removeClass('active');
281   -
282   - $('.item[data-id='+lineCode+']','.checked_list').remove();
283   - }
284   - else {
285   - $(this).addClass('active');
286   - var span = $('<span data-id="'+lineCode+'" class="item uk-card uk-card-default uk-animation-slide-bottom">'+name+'</span>')
287   - .one('webkitAnimationEnd', function () {
288   - $(this).removeClass('uk-animation-slide-bottom');
289   - });
290   - $('.checked_list').append(span);
291   - }
292   - });
293   -
294   - $('.checked_list').on('click', '.item', function () {
295   - var lineCode = $(this).data('id');
296   - $('.item[data-id='+lineCode+']','.line_list_all_wrap').removeClass('active');
297   - $(this).remove();
298   - });
299   -
300   - /**
301   - * 搜索线路
302   - */
303   - function search_line_list() {
304   - var comp = $('select.company_search_select').val(),
305   - fgs = $('select.fgs_search_select').val(),
306   - gsbm = comp + '_' + fgs;
307   -
308   - if(gsbm=='_')
309   - gsbm=null;
310   - var allDoms = $('.line_list_all_wrap span.item');
311   - //线路
312   - var lineCodeArray = [];
313   - var t = $('.line_search_input').val();
314   - if(t){
315   - t = t.toUpperCase();
316   - for(var m in allMapps){
317   - if(m.indexOf(t)!=-1)
318   - lineCodeArray.push(allMapps[m]);
319   - }
320   - }
321   -
322   - //搜索
323   - var show_elems = [];
324   - for (var i=0, dom; dom = allDoms[i++];) {
325   - if(gsbm && $(dom).data('gsbm').indexOf(gsbm)==-1)
326   - continue;
327   -
328   - if(t && lineCodeArray.indexOf($(dom).data('id')+'') == -1)
329   - continue;
330   -
331   - show_elems.push($(dom));
332   - }
333   -
334   - //show
335   - allDoms.hide();
336   - for(var j=0,$dom;$dom=show_elems[j++];)
337   - $dom.show();
338   - }
339   -
340   - function createLineSearchMapps(list) {
341   - allMapps = {};
342   - var name, code;
343   - for (var i = 0, line; line = list[i++];) {
344   - name = line.name;
345   - code = line.lineCode;
346   - //拼音映射
347   - allMapps[pinyin.getCamelChars(name)] = code;
348   - allMapps[pinyin.getFullChars(name).toUpperCase()] = code;
349   - //中文映射
350   - allMapps[name] = code;
351   - }
352   - }
353   -
354   -
355   - //构建公司级联下拉框
356   - function initCompanySelect() {
357   - var opts = '<option value="">公司搜索</option>';
358   - for (var k in companyData) {
359   - opts += '<option value="' + k + '">' + companyData[k].name + '</option>';
360   - }
361   - $('select.company_search_select').html(opts);
362   - }
363   -
364   - //公司切换
365   - $('select.company_search_select').on('change', function () {
366   - var opts = '<option value="">分公司搜索</option>',
367   - t = $(this).val(),
368   - fgsSelect = $('select.fgs_search_select');
369   - if (!t) {
370   - fgsSelect.html(opts).attr('disabled', 'disabled');
371   - }
372   - else{
373   - var array = companyData[t].childs;
374   - for (var i = 0, fgs; fgs = array[i++];) {
375   - opts += '<option value="' + fgs.businessCode + '">' + fgs.businessName + '</option>';
376   - }
377   -
378   - fgsSelect.html(opts).removeAttr('disabled');
379   - }
380   - search_line_list();
381   - });
382   -
383   - //分公司切换
384   - $('select.fgs_search_select').on('change', search_line_list);
385   -
386   - //线路文本框输入
387   - var flag;
388   - $('.line_search_input').on('input', function () {
389   - if(flag)
390   - return;
391   - flag = true;
392   - setTimeout(function () {
393   - //延迟
394   - search_line_list();
395   - flag = false;
396   - }, 200);
397   - });
398   -
399   - function convert_buss_data(rs) {
400   - var baseCode;
401   - //找到跟节点
402   - $.each(rs, function () {
403   - if (this.upCode == 0) {
404   - baseCode = this.businessCode;
405   - return false;
406   - }
407   - });
408   - if (!baseCode)return;
409   - //提取二级节点
410   - var secondMap = {};
411   - $.each(rs, function () {
412   - if (this.upCode == baseCode)
413   - secondMap[this.businessCode] = {name: this.businessName, childs: []};
414   - });
415   - //分公司节点
416   - $.each(rs, function () {
417   - if (secondMap[this.upCode])
418   - secondMap[this.upCode].childs.push(this);
419   - });
420   - //排序
421   - for (var sid in secondMap)
422   - secondMap[sid].childs.sort(naturalSort);
423   - return secondMap;
424   - }
425   -
426   - var naturalSort = function (a, b) {
427   - return a.businessName.localeCompare(b.businessName);
428   - };
429   -
430   - /**
431   - * 根据用户线路权限过滤公司编码数据
432   - */
433   - var filter_company_data = (function () {
434   - var filter = function (lineArray, data) {
435   - companyData = {};
436   - var com, fCom;
437   - $.each(lineArray, function () {
438   - com = this.company;
439   - fCom = this.brancheCompany;
440   - if (!companyData[com]) {
441   - companyData[com] = {name: data[com].name, childs: []};
442   - }
443   -
444   - if (!get(fCom, companyData[com].childs)) {
445   - companyData[com].childs.push(get(fCom, data[com].childs));
446   - }
447   - });
448   - };
449   -
450   - function get(fgsCode, fgsArray) {
451   - for (var i = 0, fgs; fgs = fgsArray[i++];) {
452   - if (fgs.businessCode == fgsCode)
453   - return fgs;
454   - }
455   - return null;
456   - }
457   -
458   - return {
459   - filter: filter
460   - }
461   - })();
462   - var storage = window.localStorage;
463   - $('#go_to_real_system_btn').on('click', go_to_xd_sys);
464   - /**
465   - * 进入线调
466   - */
467   - function go_to_xd_sys() {
468   - var items = $('.checked_list .item');
469   - if(items.length==0)
470   - return UIkit.notification({message: '你还没有选择线路!', pos: 'bottom-center', status: 'danger'});
471   - $(this).attr('disabled', 'disabled');
472   -
473   - show_btn_load(this, '更新缓存数据...');
474   - (function () {
475   - var ls_line_data = [];
476   - $.each(items, function () {
477   - ls_line_data.push(codeMapps[$(this).data('id')]);
478   - });
479   - //将线路基础信息写入localStorage
480   - storage.setItem('lineControlItems', JSON.stringify(ls_line_data));
481   - //监控模式还是主调模式
482   - storage.setItem('operationMode', $('.pattern_type_label>input')[0].checked?1:0);
483   -
484   - //进入线调
485   - var eq = EventProxy.create('cache_route', 'check_line_config', function () {
486   - var newWinOpen = $('input','.new_window_open_label')[0].checked;
487   - if(!newWinOpen)
488   - top.window.location.href = "/real_control/v2";
489   - else{
490   - window.open("/real_control/v2");
491   - $('#go_to_real_system_btn').html('已经尝试打开新窗口,如看不到,可能被浏览器阻止了');
492   - }
493   - });
494   -
495   - //拼接线路编码
496   - var idx='';
497   - $.each(ls_line_data, function () {
498   - idx+=(this.lineCode + ',');
499   - });
500   - //缓存路由
501   - idx=idx.substr(0, idx.length - 1);
502   - $.get('/realMap/findRouteByLine', {idx: idx}, function (rs) {
503   - if (rs) {
504   - for(var lineCode in rs)
505   - storage.setItem(lineCode + '_route', JSON.stringify(rs[lineCode]));
506   -
507   - eq.emit('cache_route');
508   - }
509   - });
510   -
511   - //检查线路配置
512   - checkLineConfig(ls_line_data, function (rs) {
513   - if (rs.status == 0)
514   - eq.emit('check_line_config');
515   - else if (rs.status == 1){
516   - initLineConfig(rs.not, function () {
517   - eq.emit('check_line_config');
518   - });
519   - }
520   - })
521   - })();
522   - }
523   -
524   - function checkLineConfig(lsData, cb) {
525   - var lineCodeArray = [];
526   - $.each(lsData, function () {
527   - lineCodeArray.push(this.lineCode);
528   - });
529   -
530   - $.ajax({
531   - url: '/lineConfig/check',
532   - traditional: true,
533   - data: {codeArray: lineCodeArray},
534   - method: 'POST',
535   - success: cb
536   - });
537   - }
538   -
539   - function initLineConfig(arr, cb) {
540   - var i = 0;
541   - (function () {
542   - if (i >= arr.length) {
543   - cb && cb();
544   - return;
545   - }
546   - var f = arguments.callee
547   - , lineCode = arr[i];
548   -
549   - //showLoad('初始化' + lineIds[lineCode] + '配置信息...');
550   - $.post('/lineConfig/init/' + lineCode, function (rs) {
551   - if (rs == 1) {
552   - i++;
553   - f();
554   - }
555   - });
556   - })();
557   - }
558   -
559   - /**
560   - * 按钮转菊花
561   - */
562   - function show_btn_load(btn, msg) {
563   - $(btn).html('<div uk-spinner></div> ' + msg);
564   - }
565   -</script>
566   -</body>
  1 +<!DOCTYPE html>
  2 +<html lang="zh-cn">
  3 +
  4 +<head>
  5 + <meta charset="UTF-8">
  6 + <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/>
  7 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css"/>
  8 + <!-- flatpickr -->
  9 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css">
  10 + <style>
  11 + html, body {
  12 + height: 100%;
  13 + }
  14 +
  15 + .ct_page {
  16 + padding: 25px 15px;
  17 + height: 100%;
  18 + height: calc(100% - 65px);
  19 + }
  20 +
  21 + .ct_cont {
  22 + height: calc(100% - 41px);
  23 + }
  24 +
  25 + .ct_cont > div > div.uk-card {
  26 + height: 99%;
  27 + }
  28 +
  29 + .loading {
  30 + height: 100%;
  31 + text-align: center;
  32 + }
  33 +
  34 + .loading .uk-spinner {
  35 + margin-top: 200px;
  36 + }
  37 +
  38 + .loading circle {
  39 + stroke: red;
  40 + }
  41 +
  42 + .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail {
  43 + opacity: 0.6 !important;
  44 + padding: 0 !important;
  45 + }
  46 +
  47 + .line_list_all_wrap {
  48 + height: 200px;
  49 + overflow: auto;
  50 + position: relative;
  51 + -webkit-user-select:none;
  52 + -moz-user-select:none;
  53 + -ms-user-select:none;
  54 + user-select:none;
  55 + }
  56 +
  57 + .line_list_all_wrap > .item {
  58 + background: #fff;
  59 + color: #666;
  60 + box-shadow: 0px 3px 12px rgba(0, 0, 0, 0.08);
  61 + padding: 7px 12px;
  62 + border: 1px solid #ececec;
  63 + display: inline-block;
  64 + margin: 5px;
  65 + min-width: 70px;
  66 + text-align: center;
  67 + cursor: default;
  68 + }
  69 +
  70 + .line_list_all_wrap > .item.active{
  71 + background: #ffe9a5;
  72 + }
  73 +
  74 + .checked_list {
  75 + padding-left: 4px;
  76 + -webkit-user-select:none;
  77 + -moz-user-select:none;
  78 + -ms-user-select:none;
  79 + user-select:none;
  80 + }
  81 +
  82 + .checked_list > .item {
  83 + color: #fbfbfb;
  84 + box-shadow: 0px 3px 12px rgba(50, 197, 210, 0.3);
  85 + padding: 7px 12px;
  86 + border: 1px solid #ececec;
  87 + display: inline-block;
  88 + margin: 5px 2px;
  89 + min-width: 70px;
  90 + text-align: center;
  91 + background: #32C5D2;
  92 + cursor: move;
  93 + }
  94 +
  95 + .company_search_wrap {
  96 + width: 610px;
  97 + margin-left: 6px;
  98 + }
  99 +
  100 + .company_search_wrap select {
  101 + display: inline-block;
  102 + width: 128px;
  103 + margin-right: 12px;
  104 + }
  105 +
  106 + .uk-card {
  107 + border: 1px solid #eeeeee;
  108 + }
  109 +
  110 + .footer_tools_card {
  111 + margin-top: 20px;
  112 + padding: 20px 40px;
  113 + }
  114 +
  115 + .footer_tools_card label {
  116 + vertical-align: bottom;
  117 + display: inline-block;
  118 + font-size: 13px;
  119 + margin-left: 13px;
  120 + margin-bottom: 3px !important;
  121 + }
  122 +
  123 + .uk-button-default{
  124 + background: #e0e0e0 !important;
  125 + }
  126 + </style>
  127 +</head>
  128 +
  129 +<body>
  130 +<div class="loading">
  131 + <div uk-spinner></div>
  132 +</div>
  133 +<div class="ct_page" style="display: none;">
  134 + <h2 class="uk-heading-line uk-heading-bullet"><span>线调 <h5 style="display: inline-block;">-选择线路</h5></span></h2>
  135 + <div class="ct_cont">
  136 + <div class="allot_wrap uk-flex-center" uk-grid>
  137 + <div class="uk-card uk-card-hover uk-card-body uk-width-2-3@m"
  138 + style="padding-top: 20px;padding-bottom: 20px;">
  139 + <div class="company_search_wrap">
  140 + <select class="uk-select company_search_select"></select>
  141 + <select class="uk-select fgs_search_select" disabled>
  142 + <option value="">分公司搜索</option>
  143 + </select>
  144 + <div class="uk-inline">
  145 + <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>
  146 + <input class="uk-input line_search_input" style="width: 310px;" placeholder="搜索线路">
  147 + </div>
  148 + </div>
  149 + <hr>
  150 + <div class="line_list_all_wrap"></div>
  151 + <hr>
  152 + <div class="checked_list" uk-sortable> </div>
  153 + </div>
  154 +
  155 + <div class="uk-card uk-card-hover uk-card-body uk-width-2-3@m footer_tools_card">
  156 + <button class="uk-button uk-button-default uk-button-large" style="font-size: 16px" id="go_to_real_system_btn"><i
  157 + uk-icon=" icon: sign-in" style="margin-right: 5px;" ></i>进入线路调度
  158 + </button>
  159 + <label class="pattern_type_label"><input class="uk-checkbox" type="checkbox" > 主调模式登录</label>
  160 + <label class="new_window_open_label" title="可能会被浏览器阻止新建窗口" uk-tooltip><input class="uk-checkbox" type="checkbox"> 新窗口打开</label>
  161 + </div>
  162 +
  163 + <div class="uk-alert-warning uk-width-2-3@m " uk-alert>
  164 + <p>注意!!! 相关“设备调试人员”和“测试人员”不要以主调模式进入线调。</p>
  165 + </div>
  166 + </div>
  167 + </div>
  168 +</div>
  169 +
  170 +<script id="line_list_items_temp" type="text/html">
  171 + {{each list as obj i}}
  172 + <span class="item" data-id="{{obj.lineCode}}" data-gsbm="{{obj.company}}_{{obj.brancheCompany}}">{{obj.name}}</span>
  173 + {{/each}}
  174 +</script>
  175 +
  176 +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
  177 +<script src="/assets/plugins/uk3.0/uikit.min.js"></script>
  178 +<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script>
  179 +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js"></script>
  180 +<!-- EventProxy -->
  181 +<script src="/assets/js/eventproxy.js"></script>
  182 +<!-- art-template 模版引擎 -->
  183 +<script src="/assets/plugins/template.js"></script>
  184 +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>
  185 +<script src="/assets/plugins/pinyin.js"></script>
  186 +<script>
  187 + var allMapps = {};//线路搜索映射
  188 + var companyData = {};
  189 + var codeMapps={}; //线路编码映射
  190 + //滚动条
  191 + $('.line_list_all_wrap').perfectScrollbar();
  192 +
  193 + var ep = EventProxy.create('all_lines', 'user_author', 'company_data', function (allLines, userAuthor, company_data) {
  194 + //按用户权限过滤线路
  195 + var authArray = userAuthor.lineCodeStr.split(','),
  196 + newArray = [];
  197 + $.each(allLines, function () {
  198 + if (this.lineCode && authArray.indexOf(this.lineCode) != -1) {
  199 + newArray.push(this);
  200 + codeMapps[this.lineCode] = this;
  201 + }
  202 + });
  203 + //排序
  204 + newArray.sort(function (a, b) {
  205 + return a.name.localeCompare(b.name);
  206 + });
  207 + //创建线路搜索映射
  208 + createLineSearchMapps(newArray);
  209 +
  210 + var htmlStr = template('line_list_items_temp', {list: newArray});
  211 + $('.line_list_all_wrap').html(htmlStr);
  212 +
  213 + //过滤公司编码数据
  214 + filter_company_data.filter(newArray, convert_buss_data(company_data));
  215 + initCompanySelect();
  216 + //更新滚动条高度
  217 + setTimeout(function () {
  218 + $('.line_list_all_wrap').perfectScrollbar('update');
  219 + }, 1000);
  220 +
  221 + //登录模式
  222 + changePattern(userAuthor.pattern);
  223 + if(!userAuthor.pattern)
  224 + $('.pattern_type_label').hide().find('input')[0].checked=false;
  225 + else
  226 + $('input','.pattern_type_label')[0].checked=true;
  227 +
  228 + $('.loading').remove();
  229 + $('.ct_page').show();
  230 +
  231 + //默认选中上次记录
  232 + var lineControlItems = window.localStorage.getItem('lineControlItems');
  233 + if (lineControlItems) {
  234 + var array = JSON.parse(lineControlItems);
  235 + $.each(array, function (i, line) {
  236 + $('.item[data-id='+line.lineCode+']','.line_list_all_wrap').trigger('click');
  237 + });
  238 + }
  239 + });
  240 +
  241 + $('.pattern_type_label').on('click', function () {
  242 + var checked = $('input',this)[0].checked;
  243 + changePattern(checked);
  244 + });
  245 +
  246 + function changePattern(status) {
  247 + var btn = $('#go_to_real_system_btn'),
  248 + def='uk-button-default',
  249 + prim='uk-button-primary';
  250 + if(status){
  251 + btn.removeClass(def).addClass(prim);
  252 + }
  253 + else{
  254 + btn.removeClass(prim).addClass(def);
  255 + }
  256 + }
  257 +
  258 + /**
  259 + * 查询所有线路
  260 + */
  261 + $.get('/line/all', {destroy_eq: 0}, function (list) {
  262 + ep.emit('all_lines', list);
  263 + });
  264 +
  265 + /**用户分配的线路*/
  266 + $.get('/realControAuthority/findByCurrentUser', function (t) {
  267 + ep.emit('user_author', t);
  268 + });
  269 +
  270 + /** 查询公司编码 */
  271 + $.get('/business/all', function (rs) {
  272 + ep.emit('company_data', rs);
  273 + });
  274 +
  275 + //点击选择线路
  276 + $('.line_list_all_wrap').on('click', 'span.item', function () {
  277 + var lineCode = $(this).data('id'),
  278 + name = $(this).text();
  279 + if ($(this).hasClass('active')) {
  280 + $(this).removeClass('active');
  281 +
  282 + $('.item[data-id='+lineCode+']','.checked_list').remove();
  283 + }
  284 + else {
  285 + $(this).addClass('active');
  286 + var span = $('<span data-id="'+lineCode+'" class="item uk-card uk-card-default uk-animation-slide-bottom">'+name+'</span>')
  287 + .one('webkitAnimationEnd', function () {
  288 + $(this).removeClass('uk-animation-slide-bottom');
  289 + });
  290 + $('.checked_list').append(span);
  291 + }
  292 + });
  293 +
  294 + $('.checked_list').on('click', '.item', function () {
  295 + var lineCode = $(this).data('id');
  296 + $('.item[data-id='+lineCode+']','.line_list_all_wrap').removeClass('active');
  297 + $(this).remove();
  298 + });
  299 +
  300 + /**
  301 + * 搜索线路
  302 + */
  303 + function search_line_list() {
  304 + var comp = $('select.company_search_select').val(),
  305 + fgs = $('select.fgs_search_select').val(),
  306 + gsbm = comp + '_' + fgs;
  307 +
  308 + if(gsbm=='_')
  309 + gsbm=null;
  310 + var allDoms = $('.line_list_all_wrap span.item');
  311 + //线路
  312 + var lineCodeArray = [];
  313 + var t = $('.line_search_input').val();
  314 + if(t){
  315 + t = t.toUpperCase();
  316 + for(var m in allMapps){
  317 + if(m.indexOf(t)!=-1)
  318 + lineCodeArray.push(allMapps[m]);
  319 + }
  320 + }
  321 +
  322 + //搜索
  323 + var show_elems = [];
  324 + for (var i=0, dom; dom = allDoms[i++];) {
  325 + if(gsbm && $(dom).data('gsbm').indexOf(gsbm)==-1)
  326 + continue;
  327 +
  328 + if(t && lineCodeArray.indexOf($(dom).data('id')+'') == -1)
  329 + continue;
  330 +
  331 + show_elems.push($(dom));
  332 + }
  333 +
  334 + //show
  335 + allDoms.hide();
  336 + for(var j=0,$dom;$dom=show_elems[j++];)
  337 + $dom.show();
  338 + }
  339 +
  340 + function createLineSearchMapps(list) {
  341 + allMapps = {};
  342 + var name, code;
  343 + for (var i = 0, line; line = list[i++];) {
  344 + name = line.name;
  345 + code = line.lineCode;
  346 + //拼音映射
  347 + allMapps[pinyin.getCamelChars(name)] = code;
  348 + allMapps[pinyin.getFullChars(name).toUpperCase()] = code;
  349 + //中文映射
  350 + allMapps[name] = code;
  351 + }
  352 + }
  353 +
  354 +
  355 + //构建公司级联下拉框
  356 + function initCompanySelect() {
  357 + var opts = '<option value="">公司搜索</option>';
  358 + for (var k in companyData) {
  359 + opts += '<option value="' + k + '">' + companyData[k].name + '</option>';
  360 + }
  361 + $('select.company_search_select').html(opts);
  362 + }
  363 +
  364 + //公司切换
  365 + $('select.company_search_select').on('change', function () {
  366 + var opts = '<option value="">分公司搜索</option>',
  367 + t = $(this).val(),
  368 + fgsSelect = $('select.fgs_search_select');
  369 + if (!t) {
  370 + fgsSelect.html(opts).attr('disabled', 'disabled');
  371 + }
  372 + else{
  373 + var array = companyData[t].childs;
  374 + for (var i = 0, fgs; fgs = array[i++];) {
  375 + opts += '<option value="' + fgs.businessCode + '">' + fgs.businessName + '</option>';
  376 + }
  377 +
  378 + fgsSelect.html(opts).removeAttr('disabled');
  379 + }
  380 + search_line_list();
  381 + });
  382 +
  383 + //分公司切换
  384 + $('select.fgs_search_select').on('change', search_line_list);
  385 +
  386 + //线路文本框输入
  387 + var flag;
  388 + $('.line_search_input').on('input', function () {
  389 + if(flag)
  390 + return;
  391 + flag = true;
  392 + setTimeout(function () {
  393 + //延迟
  394 + search_line_list();
  395 + flag = false;
  396 + }, 200);
  397 + });
  398 +
  399 + function convert_buss_data(rs) {
  400 + var baseCode;
  401 + //找到跟节点
  402 + $.each(rs, function () {
  403 + if (this.upCode == 0) {
  404 + baseCode = this.businessCode;
  405 + return false;
  406 + }
  407 + });
  408 + if (!baseCode)return;
  409 + //提取二级节点
  410 + var secondMap = {};
  411 + $.each(rs, function () {
  412 + if (this.upCode == baseCode)
  413 + secondMap[this.businessCode] = {name: this.businessName, childs: []};
  414 + });
  415 + //分公司节点
  416 + $.each(rs, function () {
  417 + if (secondMap[this.upCode])
  418 + secondMap[this.upCode].childs.push(this);
  419 + });
  420 + //排序
  421 + for (var sid in secondMap)
  422 + secondMap[sid].childs.sort(naturalSort);
  423 + return secondMap;
  424 + }
  425 +
  426 + var naturalSort = function (a, b) {
  427 + return a.businessName.localeCompare(b.businessName);
  428 + };
  429 +
  430 + /**
  431 + * 根据用户线路权限过滤公司编码数据
  432 + */
  433 + var filter_company_data = (function () {
  434 + var filter = function (lineArray, data) {
  435 + companyData = {};
  436 + var com, fCom;
  437 + $.each(lineArray, function () {
  438 + com = this.company;
  439 + fCom = this.brancheCompany;
  440 + if (!companyData[com]) {
  441 + companyData[com] = {name: data[com].name, childs: []};
  442 + }
  443 +
  444 + if (!get(fCom, companyData[com].childs)) {
  445 + companyData[com].childs.push(get(fCom, data[com].childs));
  446 + }
  447 + });
  448 + };
  449 +
  450 + function get(fgsCode, fgsArray) {
  451 + for (var i = 0, fgs; fgs = fgsArray[i++];) {
  452 + if (fgs.businessCode == fgsCode)
  453 + return fgs;
  454 + }
  455 + return null;
  456 + }
  457 +
  458 + return {
  459 + filter: filter
  460 + }
  461 + })();
  462 + var storage = window.localStorage;
  463 + $('#go_to_real_system_btn').on('click', go_to_xd_sys);
  464 + /**
  465 + * 进入线调
  466 + */
  467 + function go_to_xd_sys() {
  468 + var items = $('.checked_list .item');
  469 + if(items.length==0)
  470 + return UIkit.notification({message: '你还没有选择线路!', pos: 'bottom-center', status: 'danger'});
  471 + $(this).attr('disabled', 'disabled');
  472 +
  473 + show_btn_load(this, '更新缓存数据...');
  474 + (function () {
  475 + var ls_line_data = [];
  476 + $.each(items, function () {
  477 + ls_line_data.push(codeMapps[$(this).data('id')]);
  478 + });
  479 + //将线路基础信息写入localStorage
  480 + storage.setItem('lineControlItems', JSON.stringify(ls_line_data));
  481 + //监控模式还是主调模式
  482 + storage.setItem('operationMode', $('.pattern_type_label>input')[0].checked?1:0);
  483 +
  484 + //进入线调
  485 + var eq = EventProxy.create('cache_route', 'check_line_config', function () {
  486 + var newWinOpen = $('input','.new_window_open_label')[0].checked;
  487 + if(!newWinOpen)
  488 + top.window.location.href = "/real_control/v2";
  489 + else{
  490 + window.open("/real_control/v2");
  491 + $('#go_to_real_system_btn').html('已经尝试打开新窗口,如看不到,可能被浏览器阻止了');
  492 + }
  493 + });
  494 +
  495 + //拼接线路编码
  496 + var idx='';
  497 + $.each(ls_line_data, function () {
  498 + idx+=(this.lineCode + ',');
  499 + });
  500 + //缓存路由
  501 + idx=idx.substr(0, idx.length - 1);
  502 + $.get('/realMap/findRouteByLine', {idx: idx}, function (rs) {
  503 + if (rs) {
  504 + for(var lineCode in rs)
  505 + storage.setItem(lineCode + '_route', JSON.stringify(rs[lineCode]));
  506 +
  507 + eq.emit('cache_route');
  508 + }
  509 + });
  510 +
  511 + //检查线路配置
  512 + checkLineConfig(ls_line_data, function (rs) {
  513 + if (rs.status == 0)
  514 + eq.emit('check_line_config');
  515 + else if (rs.status == 1){
  516 + initLineConfig(rs.not, function () {
  517 + eq.emit('check_line_config');
  518 + });
  519 + }
  520 + })
  521 + })();
  522 + }
  523 +
  524 + function checkLineConfig(lsData, cb) {
  525 + var lineCodeArray = [];
  526 + $.each(lsData, function () {
  527 + lineCodeArray.push(this.lineCode);
  528 + });
  529 +
  530 + $.ajax({
  531 + url: '/lineConfig/check',
  532 + traditional: true,
  533 + data: {codeArray: lineCodeArray},
  534 + method: 'POST',
  535 + success: cb
  536 + });
  537 + }
  538 +
  539 + function initLineConfig(arr, cb) {
  540 + var i = 0;
  541 + (function () {
  542 + if (i >= arr.length) {
  543 + cb && cb();
  544 + return;
  545 + }
  546 + var f = arguments.callee
  547 + , lineCode = arr[i];
  548 +
  549 + //showLoad('初始化' + lineIds[lineCode] + '配置信息...');
  550 + $.post('/lineConfig/init/' + lineCode, function (rs) {
  551 + if (rs == 1) {
  552 + i++;
  553 + f();
  554 + }
  555 + });
  556 + })();
  557 + }
  558 +
  559 + /**
  560 + * 按钮转菊花
  561 + */
  562 + function show_btn_load(btn, msg) {
  563 + $(btn).html('<div uk-spinner></div> ' + msg);
  564 + }
  565 +</script>
  566 +</body>
567 567 </html>
568 568 \ No newline at end of file
... ...
src/main/resources/static/pages/excep/mhspeedingList.html
... ... @@ -302,17 +302,17 @@ $(function(){
302 302 var cells = $('tr.filter')[0].cells
303 303 ,params = {}
304 304 ,name;
305   - $.each(cells, function(i, cell){
306   - var items = $('input,select', cell);
307   - for(var j = 0, item; item = items[j++];){
308   - name = $(item).attr('name');
309   - if(name){
310   - params[name] = $(item).val();
  305 + $.each(cells, function(i, cell){
  306 + var items = $('input,select', cell);
  307 + for(var j = 0, item; item = items[j++];){
  308 + name = $(item).attr('name');
  309 + if(name){
  310 + params[name] = $(item).val();
  311 + }
311 312 }
312   - }
313   - });
314   - page = num - 1;
315   - jsDoQuery(params, false);
  313 + });
  314 + page = num - 1;
  315 + jsDoQuery(params, false);
316 316 }
317 317 });
318 318 }
... ...
src/main/resources/static/pages/report/inoutstation/inoutstation.html
... ... @@ -199,7 +199,7 @@
199 199 layer.msg("请选择方向");
200 200 }else{
201 201 $get('/report/queryStrinon',{line:line,zd:zdlx},function(result){
202   - $get('/report/queryInOutStrtions',{line:line,date:date,zd:zdlx,lzsj:lzsj},function(result2){
  202 + $get('/report/queryInOutStrtion',{line:line,date:date,zd:zdlx,lzsj:lzsj},function(result2){
203 203 console.log(result2);
204 204 /* getTime(result); */
205 205 var ludan_ll_1 = template('ludan_ll_1',{list:result2,lists:result});
... ...
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/edit.html
1   -<div ng-controller="SchedulePlanInfoManageEditCtrl as ctrl">
2   - <div class="page-head">
3   - <div class="page-title">
4   - <h1>排班明细管理</h1>
5   - </div>
6   - </div>
7   -
8   - <ul class="page-breadcrumb breadcrumb">
9   - <li>
10   - <a href="/pages/home.html" data-pjax>首页</a>
11   - <i class="fa fa-circle"></i>
12   - </li>
13   - <li>
14   - <span class="active">运营计划管理</span>
15   - <i class="fa fa-circle"></i>
16   - </li>
17   - <li>
18   - <a href="javascript:" ng-click="ctrl.toPlanPage()">排班计划管理</a>
19   - <i class="fa fa-circle"></i>
20   - </li>
21   - <li>
22   - <a href="javascript:" ng-click="ctrl.toPlanInfoListPage()">排班计划管理</a>
23   - <i class="fa fa-circle"></i>
24   - </li>
25   - <li>
26   - <span class="active">修改计划班次明细</span>
27   - </li>
28   - </ul>
29   -
30   - <div class="portlet light bordered">
31   - <div class="portlet-title">
32   - <div class="caption">
33   - <i class="icon-equalizer font-red-sunglo"></i>
34   - <span class="caption-subject font-red-sunglo bold uppercase">
35   - {{ctrl.schedulePlanInfoForSave.xlName}}
36   - {{ctrl.schedulePlanInfoForSave.ttInfoName}}
37   - {{"路牌" + ctrl.schedulePlanInfoForSave.lpName}}
38   - <span ng-bind="ctrl.schedulePlanInfoForSave.scheduleDate | date: 'yyyy-MM-dd ' "></span>
39   - <span>计划班次信息</span>
40   - </span>
41   - </div>
42   - </div>
43   -
44   - <div class="portlet-body form">
45   - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
46   - <div class="form-body">
47   - <div class="form-group has-success has-feedback">
48   - <label class="col-md-2 control-label">线路*:</label>
49   - <div class="col-md-3">
50   - <input type="text" class="form-control"
51   - ng-value="ctrl.schedulePlanInfoForSave.xlName"
52   - readonly/>
53   - </div>
54   -
55   - </div>
56   - <div class="form-group has-success has-feedback">
57   - <label class="col-md-2 control-label">时刻表名称*:</label>
58   - <div class="col-md-3">
59   - <input type="text" class="form-control"
60   - ng-value="ctrl.schedulePlanInfoForSave.ttInfoName"
61   - readonly/>
62   - </div>
63   - </div>
64   - <div class="form-group has-success has-feedback">
65   - <label class="col-md-2 control-label">路牌*:</label>
66   - <div class="col-md-3">
67   - <input type="text" class="form-control"
68   - ng-value="ctrl.schedulePlanInfoForSave.lpName"
69   - readonly/>
70   - </div>
71   -
72   - </div>
73   - <div class="form-group has-success has-feedback">
74   - <label class="col-md-2 control-label">班次类型*:</label>
75   - <div class="col-md-3">
76   - <input type="text" class="form-control"
77   - ng-value="ctrl.schedulePlanInfoForSave.bcType | dict:'ScheduleType':'未知' "
78   - readonly/>
79   - </div>
80   -
81   - </div>
82   - <div class="form-group has-success has-feedback">
83   - <label class="col-md-2 control-label">发车时间*:</label>
84   - <div class="col-md-3">
85   - <input type="text" class="form-control"
86   - ng-value="ctrl.schedulePlanInfoForSave.fcsj"
87   - readonly/>
88   - </div>
89   -
90   - </div>
91   -
92   - <div class="form-group has-success has-feedback">
93   - <label class="col-md-2 control-label">方向*:</label>
94   - <div class="col-md-3">
95   - <sa-Radiogroup model="ctrl.schedulePlanInfoForSave.xlDir" dicgroup="LineTrend" name="xlDir" required disabled="true"></sa-Radiogroup>
96   - </div>
97   - <!-- 隐藏块,显示验证信息 -->
98   - <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required">
99   - 请选择线路上下行
100   - </div>
101   -
102   - </div>
103   -
104   - <div class="form-group has-success has-feedback">
105   - <label class="col-md-2 control-label">起点站*:</label>
106   - <div class="col-md-4">
107   - <sa-Select5 name="qdz"
108   - model="ctrl.schedulePlanInfoForSave"
109   - cmaps="{'qdzCode' : 'zcode', 'qdzName': 'zname'}"
110   - dcname="qdzCode"
111   - icname="zcode"
112   - dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.schedulePlanInfoForSave.xl, 'xldir': ctrl.schedulePlanInfoForSave.xlDir}, atype:'zd_tcc' } | json }}"
113   - iterobjname="item"
114   - iterobjexp="item.aname"
115   - searchph="请输拼音..."
116   - searchexp="this.aname"
117   - required >
118   - </sa-Select5>
119   - </div>
120   - <!-- 隐藏块,显示验证信息 -->
121   - <div class="alert alert-danger well-sm" ng-show="myForm.qdz.$error.required">
122   - 起点站必须选择
123   - </div>
124   - </div>
125   - <div class="form-group has-success has-feedback">
126   - <label class="col-md-2 control-label">终点站*:</label>
127   - <div class="col-md-4">
128   - <sa-Select5 name="zdz"
129   - model="ctrl.schedulePlanInfoForSave"
130   - cmaps="{'zdzCode' : 'zcode', 'zdzName': 'zname'}"
131   - dcname="zdzCode"
132   - icname="zcode"
133   - dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.schedulePlanInfoForSave.xl, 'xldir': ctrl.schedulePlanInfoForSave.xlDir}, atype:'zd_tcc' } | json }}"
134   - iterobjname="item"
135   - iterobjexp="item.aname"
136   - searchph="请输拼音..."
137   - searchexp="this.aname"
138   - required >
139   - </sa-Select5>
140   - </div>
141   - <!-- 隐藏块,显示验证信息 -->
142   - <div class="alert alert-danger well-sm" ng-show="myForm.zdz.$error.required">
143   - 终点站必须选择
144   - </div>
145   - </div>
146   -
147   - <div class="form-group has-success has-feedback">
148   - <label class="col-md-2 control-label">车辆*:</label>
149   - <div class="col-md-4">
150   - <sa-Select5 name="cl"
151   - model="ctrl.schedulePlanInfoForSave"
152   - cmaps="{'cl': 'id', 'clZbh': 'insideCode'}"
153   - dcname="cl"
154   - icname="id"
155   - dsparams="{{ {type: 'local', param: 'cl' } | json }}"
156   - iterobjname="item"
157   - iterobjexp="item.insideCode"
158   - searchph="请输拼音..."
159   - searchexp="this.insideCode"
160   - required
161   - >
162   - </sa-Select5>
163   - </div>
164   - <!-- 隐藏块,显示验证信息 -->
165   - <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
166   - 车辆必须选择
167   - </div>
168   - </div>
169   -
170   - <div class="form-group has-success has-feedback">
171   - <label class="col-md-2 control-label">驾驶员*:</label>
172   - <div class="col-md-4">
173   - <sa-Select5 name="j"
174   - model="ctrl.schedulePlanInfoForSave"
175   - cmaps="{'j' : 'id', 'jGh': 'workId', 'jName': 'name'}"
176   - dcname="j"
177   - icname="id"
178   - dsparams="{{ {type: 'local', param: 'ry' } | json }}"
179   - iterobjname="item"
180   - iterobjexp="item.name + '(' + item.workId + ')'"
181   - searchph="请输拼音..."
182   - searchexp="this.name"
183   - required
184   - >
185   - </sa-Select5>
186   - </div>
187   - <!-- 隐藏块,显示验证信息 -->
188   - <div class="alert alert-danger well-sm" ng-show="myForm.j.$error.required">
189   - 驾驶员必须选择
190   - </div>
191   - </div>
192   -
193   - <div class="form-group">
194   - <label class="col-md-2 control-label">售票员:</label>
195   - <div class="col-md-4">
196   - <sa-Select5 name="s1"
197   - model="ctrl.schedulePlanInfoForSave"
198   - cmaps="{'s' : 'id', 'sGh': 'workId', 'sName': 'name'}"
199   - dcname="s"
200   - icname="id"
201   - dsparams="{{ {type: 'local', param: 'ry' } | json }}"
202   - iterobjname="item"
203   - iterobjexp="item.name + '(' + item.workId + ')'"
204   - searchph="请输拼音..."
205   - searchexp="this.name"
206   - >
207   - </sa-Select5>
208   - </div>
209   - </div>
210   -
211   -
212   -
213   - </div>
214   -
215   - <div class="form-actions">
216   - <div class="row">
217   - <div class="col-md-offset-3 col-md-4">
218   - <button type="submit" class="btn green"
219   - ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
220   - <a type="button" class="btn default"
221   - href="javascript:" ng-click="ctrl.cancel()" ><i class="fa fa-times"></i> 取消</a>
222   - </div>
223   - </div>
224   - </div>
225   - </form>
226   -
227   - </div>
228   -
229   - </div>
230   -
231   -
232   -
233   -
234   -</div>
  1 +<div ng-controller="SchedulePlanInfoManageEditCtrl as ctrl">
  2 + <div class="page-head">
  3 + <div class="page-title">
  4 + <h1>排班明细管理</h1>
  5 + </div>
  6 + </div>
  7 +
  8 + <ul class="page-breadcrumb breadcrumb">
  9 + <li>
  10 + <a href="/pages/home.html" data-pjax>首页</a>
  11 + <i class="fa fa-circle"></i>
  12 + </li>
  13 + <li>
  14 + <span class="active">运营计划管理</span>
  15 + <i class="fa fa-circle"></i>
  16 + </li>
  17 + <li>
  18 + <a href="javascript:" ng-click="ctrl.toPlanPage()">排班计划管理</a>
  19 + <i class="fa fa-circle"></i>
  20 + </li>
  21 + <li>
  22 + <a href="javascript:" ng-click="ctrl.toPlanInfoListPage()">排班计划管理</a>
  23 + <i class="fa fa-circle"></i>
  24 + </li>
  25 + <li>
  26 + <span class="active">修改计划班次明细</span>
  27 + </li>
  28 + </ul>
  29 +
  30 + <div class="portlet light bordered">
  31 + <div class="portlet-title">
  32 + <div class="caption">
  33 + <i class="icon-equalizer font-red-sunglo"></i>
  34 + <span class="caption-subject font-red-sunglo bold uppercase">
  35 + {{ctrl.schedulePlanInfoForSave.xlName}}
  36 + {{ctrl.schedulePlanInfoForSave.ttInfoName}}
  37 + {{"路牌" + ctrl.schedulePlanInfoForSave.lpName}}
  38 + <span ng-bind="ctrl.schedulePlanInfoForSave.scheduleDate | date: 'yyyy-MM-dd ' "></span>
  39 + <span>计划班次信息</span>
  40 + </span>
  41 + </div>
  42 + </div>
  43 +
  44 + <div class="portlet-body form">
  45 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  46 + <div class="form-body">
  47 + <div class="form-group has-success has-feedback">
  48 + <label class="col-md-2 control-label">线路*:</label>
  49 + <div class="col-md-3">
  50 + <input type="text" class="form-control"
  51 + ng-value="ctrl.schedulePlanInfoForSave.xlName"
  52 + readonly/>
  53 + </div>
  54 +
  55 + </div>
  56 + <div class="form-group has-success has-feedback">
  57 + <label class="col-md-2 control-label">时刻表名称*:</label>
  58 + <div class="col-md-3">
  59 + <input type="text" class="form-control"
  60 + ng-value="ctrl.schedulePlanInfoForSave.ttInfoName"
  61 + readonly/>
  62 + </div>
  63 + </div>
  64 + <div class="form-group has-success has-feedback">
  65 + <label class="col-md-2 control-label">路牌*:</label>
  66 + <div class="col-md-3">
  67 + <input type="text" class="form-control"
  68 + ng-value="ctrl.schedulePlanInfoForSave.lpName"
  69 + readonly/>
  70 + </div>
  71 +
  72 + </div>
  73 + <div class="form-group has-success has-feedback">
  74 + <label class="col-md-2 control-label">班次类型*:</label>
  75 + <div class="col-md-3">
  76 + <input type="text" class="form-control"
  77 + ng-value="ctrl.schedulePlanInfoForSave.bcType | dict:'ScheduleType':'未知' "
  78 + readonly/>
  79 + </div>
  80 +
  81 + </div>
  82 + <div class="form-group has-success has-feedback">
  83 + <label class="col-md-2 control-label">发车时间*:</label>
  84 + <div class="col-md-3">
  85 + <input type="text" class="form-control"
  86 + ng-value="ctrl.schedulePlanInfoForSave.fcsj"
  87 + readonly/>
  88 + </div>
  89 +
  90 + </div>
  91 +
  92 + <div class="form-group has-success has-feedback">
  93 + <label class="col-md-2 control-label">方向*:</label>
  94 + <div class="col-md-3">
  95 + <sa-Radiogroup model="ctrl.schedulePlanInfoForSave.xlDir" dicgroup="LineTrend" name="xlDir" required disabled="true"></sa-Radiogroup>
  96 + </div>
  97 + <!-- 隐藏块,显示验证信息 -->
  98 + <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required">
  99 + 请选择线路上下行
  100 + </div>
  101 +
  102 + </div>
  103 +
  104 + <div class="form-group has-success has-feedback">
  105 + <label class="col-md-2 control-label">起点站*:</label>
  106 + <div class="col-md-4">
  107 + <sa-Select5 name="qdz"
  108 + model="ctrl.schedulePlanInfoForSave"
  109 + cmaps="{'qdzCode' : 'zcode', 'qdzName': 'zname'}"
  110 + dcname="qdzCode"
  111 + icname="zcode"
  112 + dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.schedulePlanInfoForSave.xl, 'xldir': ctrl.schedulePlanInfoForSave.xlDir}, atype:'zd_tcc' } | json }}"
  113 + iterobjname="item"
  114 + iterobjexp="item.aname"
  115 + searchph="请输拼音..."
  116 + searchexp="this.aname"
  117 + required >
  118 + </sa-Select5>
  119 + </div>
  120 + <!-- 隐藏块,显示验证信息 -->
  121 + <div class="alert alert-danger well-sm" ng-show="myForm.qdz.$error.required">
  122 + 起点站必须选择
  123 + </div>
  124 + </div>
  125 + <div class="form-group has-success has-feedback">
  126 + <label class="col-md-2 control-label">终点站*:</label>
  127 + <div class="col-md-4">
  128 + <sa-Select5 name="zdz"
  129 + model="ctrl.schedulePlanInfoForSave"
  130 + cmaps="{'zdzCode' : 'zcode', 'zdzName': 'zname'}"
  131 + dcname="zdzCode"
  132 + icname="zcode"
  133 + dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.schedulePlanInfoForSave.xl, 'xldir': ctrl.schedulePlanInfoForSave.xlDir}, atype:'zd_tcc' } | json }}"
  134 + iterobjname="item"
  135 + iterobjexp="item.aname"
  136 + searchph="请输拼音..."
  137 + searchexp="this.aname"
  138 + required >
  139 + </sa-Select5>
  140 + </div>
  141 + <!-- 隐藏块,显示验证信息 -->
  142 + <div class="alert alert-danger well-sm" ng-show="myForm.zdz.$error.required">
  143 + 终点站必须选择
  144 + </div>
  145 + </div>
  146 +
  147 + <div class="form-group has-success has-feedback">
  148 + <label class="col-md-2 control-label">车辆*:</label>
  149 + <div class="col-md-4">
  150 + <sa-Select5 name="cl"
  151 + model="ctrl.schedulePlanInfoForSave"
  152 + cmaps="{'cl': 'id', 'clZbh': 'insideCode'}"
  153 + dcname="cl"
  154 + icname="id"
  155 + dsparams="{{ {type: 'local', param: 'cl' } | json }}"
  156 + iterobjname="item"
  157 + iterobjexp="item.insideCode"
  158 + searchph="请输拼音..."
  159 + searchexp="this.insideCode"
  160 + required
  161 + >
  162 + </sa-Select5>
  163 + </div>
  164 + <!-- 隐藏块,显示验证信息 -->
  165 + <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
  166 + 车辆必须选择
  167 + </div>
  168 + </div>
  169 +
  170 + <div class="form-group has-success has-feedback">
  171 + <label class="col-md-2 control-label">驾驶员*:</label>
  172 + <div class="col-md-4">
  173 + <sa-Select5 name="j"
  174 + model="ctrl.schedulePlanInfoForSave"
  175 + cmaps="{'j' : 'id', 'jGh': 'workId', 'jName': 'name'}"
  176 + dcname="j"
  177 + icname="id"
  178 + dsparams="{{ {type: 'local', param: 'ry' } | json }}"
  179 + iterobjname="item"
  180 + iterobjexp="item.name + '(' + item.workId + ')'"
  181 + searchph="请输拼音..."
  182 + searchexp="this.name"
  183 + required
  184 + >
  185 + </sa-Select5>
  186 + </div>
  187 + <!-- 隐藏块,显示验证信息 -->
  188 + <div class="alert alert-danger well-sm" ng-show="myForm.j.$error.required">
  189 + 驾驶员必须选择
  190 + </div>
  191 + </div>
  192 +
  193 + <div class="form-group">
  194 + <label class="col-md-2 control-label">售票员:</label>
  195 + <div class="col-md-4">
  196 + <sa-Select5 name="s1"
  197 + model="ctrl.schedulePlanInfoForSave"
  198 + cmaps="{'s' : 'id', 'sGh': 'workId', 'sName': 'name'}"
  199 + dcname="s"
  200 + icname="id"
  201 + dsparams="{{ {type: 'local', param: 'ry' } | json }}"
  202 + iterobjname="item"
  203 + iterobjexp="item.name + '(' + item.workId + ')'"
  204 + searchph="请输拼音..."
  205 + searchexp="this.name"
  206 + >
  207 + </sa-Select5>
  208 + </div>
  209 + </div>
  210 +
  211 +
  212 +
  213 + </div>
  214 +
  215 + <div class="form-actions">
  216 + <div class="row">
  217 + <div class="col-md-offset-3 col-md-4">
  218 + <button type="submit" class="btn green"
  219 + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  220 + <a type="button" class="btn default"
  221 + href="javascript:" ng-click="ctrl.cancel()" ><i class="fa fa-times"></i> 取消</a>
  222 + </div>
  223 + </div>
  224 + </div>
  225 + </form>
  226 +
  227 + </div>
  228 +
  229 + </div>
  230 +
  231 +
  232 +
  233 +
  234 +</div>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/user_change/user_change_modal.html
1   -<div class="uk-modal ct-form-modal" id="change_user_options-modal">
2   - <div class="uk-modal-dialog">
3   - <a href="" class="uk-modal-close uk-close"></a>
4   - <h2>切换账号/模式</h2>
5   -
6   - <div class="user_info">
7   - <form class="uk-form uk-form-horizontal">
8   -
9   - <div class="uk-form-row">
10   - <label class="uk-form-label" for="form-h-it">用户名</label>
11   - <div class="uk-form-controls">
12   - <input name="userName" type="text" id="form-h-it" value="" autocomplete="off">
13   - </div>
14   - </div>
15   - <div class="uk-form-row">
16   - <label class="uk-form-label" for="form-h-ip">密码</label>
17   - <div class="uk-form-controls">
18   - <input name="password" type="password" id="form-h-ip" value="******" disabled
19   - autocomplete="off">
20   - </div>
21   - </div>
22   - <div class="uk-form-row">
23   - <label class="uk-form-label" for="form-h-s">调度模式</label>
24   - <div class="uk-form-controls">
25   - <select id="form-h-s" name="operationMode">
26   - <option value="1">主调模式</option>
27   - <option value="0">监控模式</option>
28   - </select>
29   - </div>
30   - </div>
31   - <br>
32   - <div class="uk-form-row">
33   - <button disabled class="uk-button uk-button-danger uk-button-large uk-width-1-1 confirm_btn"
34   - type="button">
35   - 确认切换
36   - </button>
37   - </div>
38   - </form>
39   - </div>
40   - </div>
41   -
42   - <script>
43   - (function () {
44   - var modal = '#change_user_options-modal',
45   - user = gb_northToolbar.user(),
46   - operationMode = window.localStorage.getItem('operationMode'),
47   - f = $('.user_info>form', modal);
48   - //用户名
49   - $('input[name=userName]', f).val(user.userName)
50   - .on('input', function () {
51   - //清除密码
52   - $('input[name=password]', f).val('').removeAttr('disabled');
53   - changeBtnStatus();
54   - });
55   -
56   - //密码
57   - $('input[name=password]', f).on('input', changeBtnStatus);
58   -
59   - //切换模式
60   - $('select[name=operationMode]', f).val(operationMode).on('change', changeBtnStatus);
61   -
62   - var confirmBtn = $('.confirm_btn', f);
63   -
64   - function changeBtnStatus() {
65   - var data = f.serializeJSON();
66   - if ((data.userName != user.userName && $.trim(data.password))
67   - || data.operationMode != operationMode)
68   - confirmBtn.removeAttr('disabled');
69   - else {
70   - confirmBtn.attr('disabled', 'disabled');
71   - if (data.userName == user.userName)
72   - $('input[name=password]', f).val('******').attr('disabled', 'disabled');
73   - }
74   - }
75   -
76   - //确认切换
77   - $('.confirm_btn', f).on('click', function () {
78   - $(this).attr('disabled', 'disabled');
79   -
80   - var data = f.serializeJSON();
81   - if (data.userName != user.userName) {
82   - //切换账号
83   - if (!$.trim(data.password))
84   - return notify_err('密码不能为空!');
85   -
86   - gb_common.$post('/user/change_user', data, function (rs) {
87   - notify_succ('切换账号成功!');
88   - gb_northToolbar.init();
89   - gb_delay_write_log();//当班调度日志
90   - });
91   - }
92   -
93   - if(data.operationMode != operationMode){
94   - window.localStorage.setItem('operationMode', data.operationMode);
95   - //切换调度模式
96   - gb_dp_initHttpIntercept();
97   - }
98   -
99   - UIkit.modal(modal).hide();
100   - });
101   - })();
102   - </script>
103   -</div>
  1 +<div class="uk-modal ct-form-modal" id="change_user_options-modal">
  2 + <div class="uk-modal-dialog">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <h2>切换账号/模式</h2>
  5 +
  6 + <div class="user_info">
  7 + <form class="uk-form uk-form-horizontal">
  8 +
  9 + <div class="uk-form-row">
  10 + <label class="uk-form-label" for="form-h-it">用户名</label>
  11 + <div class="uk-form-controls">
  12 + <input name="userName" type="text" id="form-h-it" value="" autocomplete="off">
  13 + </div>
  14 + </div>
  15 + <div class="uk-form-row">
  16 + <label class="uk-form-label" for="form-h-ip">密码</label>
  17 + <div class="uk-form-controls">
  18 + <input name="password" type="password" id="form-h-ip" value="******" disabled
  19 + autocomplete="off">
  20 + </div>
  21 + </div>
  22 + <div class="uk-form-row">
  23 + <label class="uk-form-label" for="form-h-s">调度模式</label>
  24 + <div class="uk-form-controls">
  25 + <select id="form-h-s" name="operationMode">
  26 + <option value="1">主调模式</option>
  27 + <option value="0">监控模式</option>
  28 + </select>
  29 + </div>
  30 + </div>
  31 + <br>
  32 + <div class="uk-form-row">
  33 + <button disabled class="uk-button uk-button-danger uk-button-large uk-width-1-1 confirm_btn"
  34 + type="button">
  35 + 确认切换
  36 + </button>
  37 + </div>
  38 + </form>
  39 + </div>
  40 + </div>
  41 +
  42 + <script>
  43 + (function () {
  44 + var modal = '#change_user_options-modal',
  45 + user = gb_northToolbar.user(),
  46 + operationMode = window.localStorage.getItem('operationMode'),
  47 + f = $('.user_info>form', modal);
  48 + //用户名
  49 + $('input[name=userName]', f).val(user.userName)
  50 + .on('input', function () {
  51 + //清除密码
  52 + $('input[name=password]', f).val('').removeAttr('disabled');
  53 + changeBtnStatus();
  54 + });
  55 +
  56 + //密码
  57 + $('input[name=password]', f).on('input', changeBtnStatus);
  58 +
  59 + //切换模式
  60 + $('select[name=operationMode]', f).val(operationMode).on('change', changeBtnStatus);
  61 +
  62 + var confirmBtn = $('.confirm_btn', f);
  63 +
  64 + function changeBtnStatus() {
  65 + var data = f.serializeJSON();
  66 + if ((data.userName != user.userName && $.trim(data.password))
  67 + || data.operationMode != operationMode)
  68 + confirmBtn.removeAttr('disabled');
  69 + else {
  70 + confirmBtn.attr('disabled', 'disabled');
  71 + if (data.userName == user.userName)
  72 + $('input[name=password]', f).val('******').attr('disabled', 'disabled');
  73 + }
  74 + }
  75 +
  76 + //确认切换
  77 + $('.confirm_btn', f).on('click', function () {
  78 + $(this).attr('disabled', 'disabled');
  79 +
  80 + var data = f.serializeJSON();
  81 + if (data.userName != user.userName) {
  82 + //切换账号
  83 + if (!$.trim(data.password))
  84 + return notify_err('密码不能为空!');
  85 +
  86 + gb_common.$post('/user/change_user', data, function (rs) {
  87 + notify_succ('切换账号成功!');
  88 + gb_northToolbar.init();
  89 + gb_delay_write_log();//当班调度日志
  90 + });
  91 + }
  92 +
  93 + if(data.operationMode != operationMode){
  94 + window.localStorage.setItem('operationMode', data.operationMode);
  95 + //切换调度模式
  96 + gb_dp_initHttpIntercept();
  97 + }
  98 +
  99 + UIkit.modal(modal).hide();
  100 + });
  101 + })();
  102 + </script>
  103 +</div>
... ...