Commit 0960e5ee66f933498795865469153e63cbcceb75

Authored by 潘钊
1 parent 303a3846

update...

src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_data_basic.js deleted 100644 → 0
1   -/* 基础数据管理模块 */
2   -
3   -var gb_data_basic = (function () {
4   -
5   - var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs;
6   - var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs"
7   - , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) {
8   - stationRoutes = routes;
9   - lineCode2NameAll = code2Name;
10   - lineInformations = informations;
11   - nbbm2deviceMap = nbbm2device;
12   - device2nbbmMap = gb_common.inverse(nbbm2deviceMap);
13   - allPersonnel = all_personnel;
14   - svgAttrs = svgAttrMap;
15   - //gb_main_ep.emitLater('data-basic');
16   - });
17   -
18   - var storage = window.localStorage;
19   - //激活的线路
20   - var activeLines = JSON.parse(storage.getItem('lineControlItems'));
21   - //lineCode to line object
22   - var codeToLine = {};
23   - //lineCode idx string
24   - var line_idx = (function () {
25   - var str = '';
26   - for (var i = 0, item; item = activeLines[i++];) {
27   - str += (',' + item.lineCode);
28   - codeToLine[item.lineCode] = item;
29   - }
30   - return str.substr(1);
31   - })();
32   -
33   - //站点路由
34   - gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) {
35   - var list = rs.list;//JSON.parse(rs.list);
36   - var routeData = gb_common.groupBy(list, 'lineCode');
37   - //排序
38   - for (var lineCode in routeData) {
39   - routeData[lineCode].sort(stationRouteSort);
40   - }
41   - ep.emit('stationRoutes', routeData);
42   - });
43   -
44   - //线路标准信息
45   - gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) {
46   - var informations = {};
47   - $.each(rs, function () {
48   - informations[this.line.lineCode] = this;
49   - delete this['line'];
50   - });
51   - ep.emit('lineInformations', informations);
52   - });
53   -
54   - //人员信息
55   - loadAllPersonnel(function (data) {
56   - ep.emit('all_personnel', data);
57   - });
58   - function loadAllPersonnel(cb) {
59   - $.get('/personnel/all_py', function (rs) {
60   - //转换成自动补全组件需要的数据
61   - var data = [], code;
62   - for(var i =0, p; p = rs[i++];){
63   - code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId'];
64   - data.push({
65   - value: code + '/' + p.name,
66   - fullChars: p.fullChars.toUpperCase(),
67   - camelChars: p.camelChars.toUpperCase()
68   - });
69   - }
70   - cb && cb(data);
71   - });
72   - }
73   -
74   - var carparks = {};
75   - //停车场数据
76   - gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) {
77   - rs.list.sort(function (a, b) {
78   - return a.parkName.localeCompare(b.parkName);
79   - });
80   - $.each(rs.list, function () {
81   - carparks[this.parkCode] = this;
82   - });
83   - });
84   -
85   - //车辆数据
86   - var carsArray;
87   - $.get('/basic/cars?t=' + Math.random(), function (rs) {
88   - carsArray = rs;
89   - });
90   -
91   - var getCarparkByCode = function (code) {
92   - return carparks[code];
93   - };
94   -
95   - //line code to name
96   - $.get('/basic/lineCode2Name', function (rs) {
97   - ep.emit('lineCode2Name', rs);
98   - });
99   -
100   - //nbbm to device id
101   - $.get('/basic/nbbm2deviceId', function (rs) {
102   - ep.emit('nbbm2deviceId', rs);
103   - });
104   - //nbbm to 车牌号
105   - var nbbm2PlateMap;
106   - $.get('/basic/nbbm2PlateNo', function (rs) {
107   - nbbm2PlateMap = rs;
108   - });
109   -
110   - //模拟图属性数据
111   - gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) {
112   - var data = {};
113   - $.each(rs.list, function () {
114   - this.hideStations = JSON.parse(this.hideStations);
115   - this.nicknames = JSON.parse(this.nicknames);
116   - data[this.lineCode] = this;
117   - });
118   - ep.emit('svg_attrs', data);
119   - });
120   -
121   - //站点和停车场历时、公里对照数据
122   - var stat_park_data;
123   - var load_stat_park_data = function () {
124   - $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) {
125   - stat_park_data = rs;
126   - });
127   - }
128   - load_stat_park_data();
129   -
130   - function findLineByCodes(codeArr) {
131   - var rs = [];
132   - $.each(codeArr, function () {
133   - rs.push(codeToLine[this]);
134   - });
135   - return rs;
136   - }
137   -
138   - var findCodeByLinename = function (name) {
139   - for (var code in lineCode2NameAll) {
140   - if (name == lineCode2NameAll[code])
141   - return code;
142   - }
143   -
144   - return null;
145   - };
146   -
147   - var getLineInformation = function (lineCode) {
148   - return lineInformations[lineCode];
149   - };
150   -
151   - var stationRouteSort = function (a, b) {
152   - return a.stationRouteCode - b.stationRouteCode;
153   - };
154   -
155   - return {
156   - activeLines: activeLines,
157   - line_idx: line_idx,
158   - codeToLine: codeToLine,
159   - nbbm2deviceMap: function () {
160   - return nbbm2deviceMap;
161   - },
162   - device2nbbmMap: function () {
163   - return device2nbbmMap;
164   - },
165   - getLineInformation: getLineInformation,
166   - allInformations: function () {
167   - return lineInformations;
168   - },
169   - stationRoutes: function (lineCode) {
170   - return stationRoutes[lineCode]
171   - },
172   - findLineByCodes: findLineByCodes,
173   - lineCode2NameAll: function () {
174   - return lineCode2NameAll
175   - },
176   - allPersonnel: function () {
177   - return allPersonnel;
178   - },
179   - findCodeByLinename: findCodeByLinename,
180   - getCarparkByCode: getCarparkByCode,
181   - getSvgAttr: function (lineCode) {
182   - return svgAttrs[lineCode];
183   - },
184   - setSvgAttr: function (attr) {
185   - attr.hideStations = JSON.parse(attr.hideStations);
186   - attr.nicknames = JSON.parse(attr.nicknames);
187   - svgAttrs[attr.lineCode] = attr;
188   - },
189   - //是否是环线
190   - isLoopLine: function (lineCode) {
191   - var data = gb_common.groupBy(stationRoutes[lineCode], 'directions');
192   - //下行只有2个站点
193   - var len = data[0].length;
194   - if (len > 0 && data[1].length == 2) {
195   - var first = data[0][0],
196   - end = data[0][len - 1];
197   -
198   - /*if(first.stationName != end.stationName)
199   - return false;*/
200   -
201   - var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx}
202   - , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx};
203   -
204   - //并且上行起终点距离200米内
205   - if (geolib.getDistance(fPoint, ePoint) < 200) {
206   - return true;
207   - }
208   - }
209   -
210   - return false;
211   - },
212   - //刷新员工信息
213   - refreshAllPersonnel: function (cb) {
214   - loadAllPersonnel(function (data) {
215   - allPersonnel = data;
216   - cb && cb();
217   - });
218   - },
219   - nbbm2PlateMap: function () {
220   - return nbbm2PlateMap;
221   - },
222   - carsArray: function () {
223   - return carsArray;
224   - },
225   - simpleParksArray: function () {
226   - var map = {};
227   - for(var code in carparks)
228   - map[code] = carparks[code].parkName;
229   - return map;
230   - },
231   - remarksMapps: function () {
232   - return remarksMapps;
233   - },
234   - get_stat_park_data: function () {
235   - return stat_park_data;
236   - },
237   - reload_stat_park_data: function () {
238   - load_stat_park_data();
239   - }
240   - };
241   -})();
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_data_gps.js deleted 100644 → 0
1   -/* gps 数据管理模块 */
2   -
3   -var gb_data_gps = (function () {
4   -
5   - //fixed time refresh delay
6   - var delay = 1000 * 7;
7   - //deviceId ——> gps
8   - var realData = {};
9   - //refresh after callback
10   - var refreshEventCallbacks = [];
11   - //register callback function
12   - var registerCallback = function (cb) {
13   - if (cb)
14   - refreshEventCallbacks.push(cb);
15   - };
16   -
17   - var refresh = function (cb) {
18   - $.ajax({
19   - url: '/gps/real/line',
20   - data: {lineCodes: gb_data_basic.line_idx},
21   - dataType: 'json',
22   - success: function (rs) {
23   - //用定时的gps来检测session断开
24   - if(rs.status && rs.status==407){
25   - location.href = '/login.html';
26   - return;
27   - }
28   - refreshData(rs);
29   - cb();
30   - },
31   - error: function (xr, t) {
32   - notify_err('刷新GPS失败,稍后重试' + t);
33   - cb();
34   - }
35   - });
36   - };
37   -
38   - var refreshData = function (rs) {
39   - var old, addArr = [],
40   - upArr = [],
41   - upDownChange = [];
42   -
43   - var schArray;
44   - $.each(rs, function () {
45   - old = realData[this.deviceId];
46   - if (old) {
47   - if (this.timestamp > old.timestamp) {
48   - if (old.upDown != this.upDown)
49   - upDownChange.push(this);
50   - else
51   - upArr.push(this);
52   - }
53   -
54   - } else
55   - addArr.push(this);
56   -
57   - /* //班次信息
58   - if (this.schId) {
59   - schArray = gb_schedule_table.findScheduleByLine(this.lineId);
60   - if (schArray)
61   - this.sch = schArray[this.schId];
62   - }*/
63   -
64   - //时间格式化
65   - this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss');
66   - realData[this.deviceId] = this;
67   - });
68   -
69   - //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length);
70   - //CCCallFuncN
71   - $.each(refreshEventCallbacks, function (i, cb) {
72   - cb(addArr, upArr, upDownChange);
73   - });
74   -
75   - };
76   -
77   - var startFixedTime;
78   - var fixedTimeRefresh = function () {
79   - if (startFixedTime)
80   - return;
81   - startFixedTime = true;
82   -
83   - (function () {
84   - var f = arguments.callee;
85   - refresh(function () {
86   - setTimeout(f, delay);
87   - });
88   - })();
89   - };
90   -
91   - var gpsByLineCode = function (lineCode) {
92   - var rs = [];
93   - for (var device in realData) {
94   - if (realData[device].lineId == lineCode)
95   - rs.push(realData[device]);
96   - }
97   - return rs;
98   - };
99   -
100   - var findOne = function (deviceId) {
101   - return realData[deviceId];
102   - };
103   -
104   - var findGpsByNbbm = function (nbbm) {
105   - return realData[gb_data_basic.nbbm2deviceMap()[nbbm]];
106   - };
107   -
108   - /**
109   - * 设备掉线事件
110   - */
111   - var deviceOffline = function (gps) {
112   - $.each(offlineCallbacks, function (i, cb) {
113   - cb(gps);
114   - });
115   - };
116   -
117   - //注册掉线事件回调函数
118   - var offlineCallbacks = [];
119   - var registerOfflineCb = function (cb) {
120   - if (cb)
121   - offlineCallbacks.push(cb);
122   - };
123   -
124   - return {
125   - fixedTimeRefresh: fixedTimeRefresh,
126   - registerCallback: registerCallback,
127   - allGps: realData,
128   - gpsByLineCode: gpsByLineCode,
129   - findOne: findOne,
130   - findGpsByNbbm: findGpsByNbbm,
131   - deviceOffline: deviceOffline,
132   - registerOfflineCb: registerOfflineCb
133   - };
134   -})();
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_wrap.html deleted 100644 → 0
1   -<!DOCTYPE html>
2   -<html lang="zh-cn">
3   -
4   -<head>
5   - <meta charset="UTF-8">
6   - <title>地图监控 v2.0</title>
7   - <!-- uikit core style-->
8   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" />
9   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" />
10   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" />
11   - <link rel="stylesheet"
12   - href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" />
13   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" />
14   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" />
15   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" />
16   -
17   - <!-- main style -->
18   - <link rel="stylesheet" href="/real_control_v2/css/main.css" />
19   - <!-- north style -->
20   - <link rel="stylesheet" href="/real_control_v2/css/north.css" />
21   - <!-- home style -->
22   - <link rel="stylesheet" href="/real_control_v2/css/home.css" />
23   -
24   - <!-- js tree -->
25   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" />
26   -
27   - <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" />
28   - <!-- perfect-scrollbar style -->
29   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" />
30   - <!-- layer 3.0.3 -->
31   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" />
32   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" />
33   -
34   - <!-- flatpickr -->
35   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" >
36   - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" >
37   -
38   - <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" />
39   -</head>
40   -
41   -<body>
42   -<div class="main-container" style="height: 100%;">
43   -</div>
44   -
45   -<!-- 地图相关 -->
46   -<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
47   -<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script>
48   -<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script>
49   -<script src="/assets/js/TransGPS.js" merge="plugins"></script>
50   -<!-- 高德 -->
51   -<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script>
52   -<!-- jquery -->
53   -<script src="/real_control_v2/assets/js/jquery.min.js"></script>
54   -<!-- jquery actual -->
55   -<script src="/real_control_v2/assets/js/jquery.actual.min.js" ></script>
56   -<!-- moment.js 日期处理类库 -->
57   -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>
58   -<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script>
59   -
60   -<!-- flatpickr -->
61   -<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js"></script>
62   -<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js"></script>
63   -
64   -<!-- perfect-scrollbar -->
65   -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script>
66   -<!-- common js -->
67   -<script src="/real_control_v2/js/common.js"></script>
68   -<!-- art-template 模版引擎 -->
69   -<script src="/assets/plugins/template.js" ></script>
70   -<!-- d3 -->
71   -<script src="/assets/js/d3.min.js"></script>
72   -<!-- EventProxy -->
73   -<script src="/assets/js/eventproxy.js"></script>
74   -<!-- uikit core -->
75   -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" ></script>
76   -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" ></script>
77   -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script>
78   -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script>
79   -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" ></script>
80   -<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" ></script>
81   -
82   -<!-- js tree -->
83   -<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" ></script>
84   -<!-- layer 3.0.3 -->
85   -<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js"></script>
86   -
87   -<!-- 模态框扩展 -->
88   -<script src="/real_control_v2/js/modal_extend.js" ></script>
89   -
90   -<script src="/real_control_v2/mapmonitor/alone_page/alone_data_basic.js" ></script>
91   -<script src="/real_control_v2/mapmonitor/alone_page/alone_data_gps.js" ></script>
92   -<script src="/real_control_v2/js/utils/ct_table.js" ></script>
93   -<!-- jquery.serializejson JSON序列化插件 -->
94   -<script src="/assets/plugins/jquery.serializejson.js" ></script>
95   -<script>
96   - (function () {
97   - gb_data_gps.fixedTimeRefresh();
98   - //嵌入地图页面
99   - $('.main-container').load('/real_control_v2/mapmonitor/real.html', function () {
100   - $('.map-system-msg.flex-left').remove();
101   - });
102   - })();
103   -</script>
104   -</body>
105   -
106   -</html>
src/main/resources/static/real_control_v2/mapmonitor/real.html
... ... @@ -7,7 +7,7 @@
7 7  
8 8 <div class="map-system-msg flex-left">
9 9 <a class="z-depth-2 old_map" href="/pages/mapmonitor/alone/wrap.html" target="_blank"></a>
10   - <a class="z-depth-2 now_map" href="/real_control_v2/mapmonitor/alone_page/alone_wrap.html" target="_blank">
  10 + <a class="z-depth-2 now_map" href="/real_control_v2/alone_page/map/alone_wrap.html" target="_blank">
11 11 <i class="uk-icon-send-o"></i>
12 12 </a>
13 13 </div>
... ...