Commit 848bdb4c4eef3a199c74ee75c2ac0052455ab0a8
1 parent
d0b4cee7
update...
Showing
11 changed files
with
711 additions
and
26 deletions
src/main/resources/static/real_control_v2/alone_page/home/alone_data_basic.js
0 → 100644
| 1 | +/* 基础数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_basic = (function () { | |
| 4 | + | |
| 5 | + var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | |
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | |
| 7 | + , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | |
| 8 | + stationRoutes = routes; | |
| 9 | + lineCode2NameAll = code2Name; | |
| 10 | + lineInformations = informations; | |
| 11 | + nbbm2deviceMap = nbbm2device; | |
| 12 | + device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | |
| 13 | + allPersonnel = all_personnel; | |
| 14 | + svgAttrs = svgAttrMap; | |
| 15 | + | |
| 16 | + res_load_ep.emitLater('data-basic'); | |
| 17 | + }); | |
| 18 | + | |
| 19 | + var storage = window.localStorage; | |
| 20 | + //激活的线路 | |
| 21 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 22 | + //lineCode to line object | |
| 23 | + var codeToLine = {}; | |
| 24 | + //lineCode idx string | |
| 25 | + var line_idx = (function () { | |
| 26 | + var str = ''; | |
| 27 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 28 | + str += (',' + item.lineCode); | |
| 29 | + codeToLine[item.lineCode] = item; | |
| 30 | + } | |
| 31 | + return str.substr(1); | |
| 32 | + })(); | |
| 33 | + | |
| 34 | + //站点路由 | |
| 35 | + gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 36 | + var list = rs.list;//JSON.parse(rs.list); | |
| 37 | + var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 38 | + //排序 | |
| 39 | + for (var lineCode in routeData) { | |
| 40 | + routeData[lineCode].sort(stationRouteSort); | |
| 41 | + } | |
| 42 | + ep.emit('stationRoutes', routeData); | |
| 43 | + }); | |
| 44 | + | |
| 45 | + //线路标准信息 | |
| 46 | + gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 47 | + var informations = {}; | |
| 48 | + $.each(rs, function () { | |
| 49 | + informations[this.line.lineCode] = this; | |
| 50 | + delete this['line']; | |
| 51 | + }); | |
| 52 | + ep.emit('lineInformations', informations); | |
| 53 | + }); | |
| 54 | + | |
| 55 | + //人员信息 | |
| 56 | + loadAllPersonnel(function (data) { | |
| 57 | + ep.emit('all_personnel', data); | |
| 58 | + }); | |
| 59 | + function loadAllPersonnel(cb) { | |
| 60 | + $.get('/personnel/all_py', function (rs) { | |
| 61 | + //转换成自动补全组件需要的数据 | |
| 62 | + var data = [], code; | |
| 63 | + for(var i =0, p; p = rs[i++];){ | |
| 64 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 65 | + data.push({ | |
| 66 | + value: code + '/' + p.name, | |
| 67 | + fullChars: p.fullChars.toUpperCase(), | |
| 68 | + camelChars: p.camelChars.toUpperCase() | |
| 69 | + }); | |
| 70 | + } | |
| 71 | + cb && cb(data); | |
| 72 | + }); | |
| 73 | + } | |
| 74 | + | |
| 75 | + var carparks = {}; | |
| 76 | + //停车场数据 | |
| 77 | + gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | |
| 78 | + rs.list.sort(function (a, b) { | |
| 79 | + return a.parkName.localeCompare(b.parkName); | |
| 80 | + }); | |
| 81 | + $.each(rs.list, function () { | |
| 82 | + carparks[this.parkCode] = this; | |
| 83 | + }); | |
| 84 | + }); | |
| 85 | + | |
| 86 | + //车辆数据 | |
| 87 | + var carsArray; | |
| 88 | + $.get('/basic/cars?t=' + Math.random(), function (rs) { | |
| 89 | + carsArray = rs; | |
| 90 | + }); | |
| 91 | + | |
| 92 | + var getCarparkByCode = function (code) { | |
| 93 | + return carparks[code]; | |
| 94 | + }; | |
| 95 | + | |
| 96 | + //line code to name | |
| 97 | + $.get('/basic/lineCode2Name', function (rs) { | |
| 98 | + ep.emit('lineCode2Name', rs); | |
| 99 | + }); | |
| 100 | + | |
| 101 | + //nbbm to device id | |
| 102 | + $.get('/basic/nbbm2deviceId', function (rs) { | |
| 103 | + ep.emit('nbbm2deviceId', rs); | |
| 104 | + }); | |
| 105 | + //nbbm to 车牌号 | |
| 106 | + var nbbm2PlateMap; | |
| 107 | + $.get('/basic/nbbm2PlateNo', function (rs) { | |
| 108 | + nbbm2PlateMap = rs; | |
| 109 | + }); | |
| 110 | + | |
| 111 | + //模拟图属性数据 | |
| 112 | + gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 113 | + var data = {}; | |
| 114 | + $.each(rs.list, function () { | |
| 115 | + this.hideStations = JSON.parse(this.hideStations); | |
| 116 | + this.nicknames = JSON.parse(this.nicknames); | |
| 117 | + data[this.lineCode] = this; | |
| 118 | + }); | |
| 119 | + ep.emit('svg_attrs', data); | |
| 120 | + }); | |
| 121 | + | |
| 122 | + //站点和停车场历时、公里对照数据 | |
| 123 | + var stat_park_data; | |
| 124 | + var load_stat_park_data = function () { | |
| 125 | + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 126 | + stat_park_data = rs; | |
| 127 | + }); | |
| 128 | + } | |
| 129 | + load_stat_park_data(); | |
| 130 | + | |
| 131 | + function findLineByCodes(codeArr) { | |
| 132 | + var rs = []; | |
| 133 | + $.each(codeArr, function () { | |
| 134 | + rs.push(codeToLine[this]); | |
| 135 | + }); | |
| 136 | + return rs; | |
| 137 | + } | |
| 138 | + | |
| 139 | + var findCodeByLinename = function (name) { | |
| 140 | + for (var code in lineCode2NameAll) { | |
| 141 | + if (name == lineCode2NameAll[code]) | |
| 142 | + return code; | |
| 143 | + } | |
| 144 | + | |
| 145 | + return null; | |
| 146 | + }; | |
| 147 | + | |
| 148 | + var getLineInformation = function (lineCode) { | |
| 149 | + return lineInformations[lineCode]; | |
| 150 | + }; | |
| 151 | + | |
| 152 | + var stationRouteSort = function (a, b) { | |
| 153 | + return a.stationRouteCode - b.stationRouteCode; | |
| 154 | + }; | |
| 155 | + | |
| 156 | + /** | |
| 157 | + * 常用的备注补全列表 | |
| 158 | + */ | |
| 159 | + var remarksArray = ['保养', '故障', '肇事', '加油', '维修', '援外', '路阻' | |
| 160 | + , '故障(离合器坏)', '故障,(方向盘坏)', '故障(排挡坏)', '故障(门坏)', '故障(雨刮器坏)','故障(刹车坏)', '故障(气打不上)' | |
| 161 | + ,'故障(整车无电)', '故障(故障灯常亮)', '故障(警报灯亮)', '故障(玻璃坏)', '故障(反光镜坏)', '故障(发电机坏)', '故障(漏防冻液)' | |
| 162 | + , '故障(漏水)','故障(轮胎坏)', '故障(无动力)', '故障(喷机油)', '故障(水温高)', '保养(一级保养)' | |
| 163 | + , '保养(二级保养)', '保养(三级保养)', '换车出场', '临加进场', '临加出场']; | |
| 164 | + var remarksMapps = []; | |
| 165 | + $.each(remarksArray, function (i, t) { | |
| 166 | + remarksMapps.push({ | |
| 167 | + value: t, | |
| 168 | + fullChars: pinyin.getFullChars(t).toUpperCase(), | |
| 169 | + camelChars: pinyin.getCamelChars(t) | |
| 170 | + }); | |
| 171 | + }); | |
| 172 | + | |
| 173 | + //文件载入完毕 | |
| 174 | + res_load_ep.emitLater('load_data_basic'); | |
| 175 | + | |
| 176 | + return { | |
| 177 | + activeLines: activeLines, | |
| 178 | + line_idx: line_idx, | |
| 179 | + codeToLine: codeToLine, | |
| 180 | + nbbm2deviceMap: function () { | |
| 181 | + return nbbm2deviceMap; | |
| 182 | + }, | |
| 183 | + device2nbbmMap: function () { | |
| 184 | + return device2nbbmMap; | |
| 185 | + }, | |
| 186 | + getLineInformation: getLineInformation, | |
| 187 | + allInformations: function () { | |
| 188 | + return lineInformations; | |
| 189 | + }, | |
| 190 | + stationRoutes: function (lineCode) { | |
| 191 | + return stationRoutes[lineCode] | |
| 192 | + }, | |
| 193 | + findLineByCodes: findLineByCodes, | |
| 194 | + lineCode2NameAll: function () { | |
| 195 | + return lineCode2NameAll | |
| 196 | + }, | |
| 197 | + allPersonnel: function () { | |
| 198 | + return allPersonnel; | |
| 199 | + }, | |
| 200 | + findCodeByLinename: findCodeByLinename, | |
| 201 | + getCarparkByCode: getCarparkByCode, | |
| 202 | + getSvgAttr: function (lineCode) { | |
| 203 | + return svgAttrs[lineCode]; | |
| 204 | + }, | |
| 205 | + setSvgAttr: function (attr) { | |
| 206 | + attr.hideStations = JSON.parse(attr.hideStations); | |
| 207 | + attr.nicknames = JSON.parse(attr.nicknames); | |
| 208 | + svgAttrs[attr.lineCode] = attr; | |
| 209 | + }, | |
| 210 | + //是否是环线 | |
| 211 | + isLoopLine: function (lineCode) { | |
| 212 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 213 | + //下行只有2个站点 | |
| 214 | + var len = data[0].length; | |
| 215 | + if (len > 0 && data[1].length == 2) { | |
| 216 | + var first = data[0][0], | |
| 217 | + end = data[0][len - 1]; | |
| 218 | + | |
| 219 | + /*if(first.stationName != end.stationName) | |
| 220 | + return false;*/ | |
| 221 | + | |
| 222 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 223 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 224 | + | |
| 225 | + //并且上行起终点距离200米内 | |
| 226 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 227 | + return true; | |
| 228 | + } | |
| 229 | + } | |
| 230 | + | |
| 231 | + return false; | |
| 232 | + }, | |
| 233 | + //刷新员工信息 | |
| 234 | + refreshAllPersonnel: function (cb) { | |
| 235 | + loadAllPersonnel(function (data) { | |
| 236 | + allPersonnel = data; | |
| 237 | + cb && cb(); | |
| 238 | + }); | |
| 239 | + }, | |
| 240 | + nbbm2PlateMap: function () { | |
| 241 | + return nbbm2PlateMap; | |
| 242 | + }, | |
| 243 | + carsArray: function () { | |
| 244 | + return carsArray; | |
| 245 | + }, | |
| 246 | + simpleParksArray: function () { | |
| 247 | + var map = {}; | |
| 248 | + for(var code in carparks) | |
| 249 | + map[code] = carparks[code].parkName; | |
| 250 | + return map; | |
| 251 | + }, | |
| 252 | + remarksMapps: function () { | |
| 253 | + return remarksMapps; | |
| 254 | + }, | |
| 255 | + get_stat_park_data: function () { | |
| 256 | + return stat_park_data; | |
| 257 | + }, | |
| 258 | + reload_stat_park_data: function () { | |
| 259 | + load_stat_park_data(); | |
| 260 | + } | |
| 261 | + }; | |
| 262 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/alone_page/home/alone_data_gps.js
0 → 100644
| 1 | +/* gps 数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_gps = (function () { | |
| 4 | + | |
| 5 | + //fixed time refresh delay | |
| 6 | + var delay = 1000 * 7; | |
| 7 | + //deviceId ——> gps | |
| 8 | + var realData = {}; | |
| 9 | + //refresh after callback | |
| 10 | + var refreshEventCallbacks = []; | |
| 11 | + //register callback function | |
| 12 | + var registerCallback = function (cb) { | |
| 13 | + if (cb) | |
| 14 | + refreshEventCallbacks.push(cb); | |
| 15 | + }; | |
| 16 | + | |
| 17 | + var refresh = function (cb) { | |
| 18 | + $.ajax({ | |
| 19 | + url: '/gps/real/line', | |
| 20 | + data: {lineCodes: gb_data_basic.line_idx}, | |
| 21 | + dataType: 'json', | |
| 22 | + success: function (rs) { | |
| 23 | + //用定时的gps来检测session断开 | |
| 24 | + if(rs.status && rs.status==407){ | |
| 25 | + location.href = '/login.html'; | |
| 26 | + return; | |
| 27 | + } | |
| 28 | + refreshData(rs); | |
| 29 | + cb(); | |
| 30 | + }, | |
| 31 | + error: function (xr, t) { | |
| 32 | + notify_err('刷新GPS失败,稍后重试' + t); | |
| 33 | + cb(); | |
| 34 | + } | |
| 35 | + }); | |
| 36 | + }; | |
| 37 | + | |
| 38 | + var refreshData = function (rs) { | |
| 39 | + var old, addArr = [], | |
| 40 | + upArr = [], | |
| 41 | + upDownChange = []; | |
| 42 | + | |
| 43 | + var schArray; | |
| 44 | + $.each(rs, function () { | |
| 45 | + old = realData[this.deviceId]; | |
| 46 | + if (old) { | |
| 47 | + if (this.timestamp > old.timestamp) { | |
| 48 | + if (old.upDown != this.upDown) | |
| 49 | + upDownChange.push(this); | |
| 50 | + else | |
| 51 | + upArr.push(this); | |
| 52 | + } | |
| 53 | + | |
| 54 | + } else | |
| 55 | + addArr.push(this); | |
| 56 | + | |
| 57 | + //班次信息 | |
| 58 | + /*if (this.schId) { | |
| 59 | + schArray = gb_schedule_table.findScheduleByLine(this.lineId); | |
| 60 | + if (schArray) | |
| 61 | + this.sch = schArray[this.schId]; | |
| 62 | + }*/ | |
| 63 | + | |
| 64 | + //时间格式化 | |
| 65 | + this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss'); | |
| 66 | + realData[this.deviceId] = this; | |
| 67 | + }); | |
| 68 | + | |
| 69 | + //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length); | |
| 70 | + //CCCallFuncN | |
| 71 | + $.each(refreshEventCallbacks, function (i, cb) { | |
| 72 | + cb(addArr, upArr, upDownChange); | |
| 73 | + }); | |
| 74 | + | |
| 75 | + }; | |
| 76 | + | |
| 77 | + var startFixedTime; | |
| 78 | + var fixedTimeRefresh = function () { | |
| 79 | + if (startFixedTime) | |
| 80 | + return; | |
| 81 | + startFixedTime = true; | |
| 82 | + | |
| 83 | + (function () { | |
| 84 | + var f = arguments.callee; | |
| 85 | + refresh(function () { | |
| 86 | + setTimeout(f, delay); | |
| 87 | + }); | |
| 88 | + })(); | |
| 89 | + }; | |
| 90 | + | |
| 91 | + var gpsByLineCode = function (lineCode) { | |
| 92 | + var rs = []; | |
| 93 | + for (var device in realData) { | |
| 94 | + if (realData[device].lineId == lineCode) | |
| 95 | + rs.push(realData[device]); | |
| 96 | + } | |
| 97 | + return rs; | |
| 98 | + }; | |
| 99 | + | |
| 100 | + var findOne = function (deviceId) { | |
| 101 | + return realData[deviceId]; | |
| 102 | + }; | |
| 103 | + | |
| 104 | + var findGpsByNbbm = function (nbbm) { | |
| 105 | + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 106 | + }; | |
| 107 | + | |
| 108 | + /** | |
| 109 | + * 设备掉线事件 | |
| 110 | + */ | |
| 111 | + var deviceOffline = function (gps) { | |
| 112 | + $.each(offlineCallbacks, function (i, cb) { | |
| 113 | + cb(gps); | |
| 114 | + }); | |
| 115 | + }; | |
| 116 | + | |
| 117 | + //注册掉线事件回调函数 | |
| 118 | + var offlineCallbacks = []; | |
| 119 | + var registerOfflineCb = function (cb) { | |
| 120 | + if (cb) | |
| 121 | + offlineCallbacks.push(cb); | |
| 122 | + }; | |
| 123 | + | |
| 124 | + return { | |
| 125 | + fixedTimeRefresh: fixedTimeRefresh, | |
| 126 | + registerCallback: registerCallback, | |
| 127 | + allGps: realData, | |
| 128 | + gpsByLineCode: gpsByLineCode, | |
| 129 | + findOne: findOne, | |
| 130 | + findGpsByNbbm: findGpsByNbbm, | |
| 131 | + deviceOffline: deviceOffline, | |
| 132 | + registerOfflineCb: registerOfflineCb | |
| 133 | + }; | |
| 134 | +})(); | ... | ... |
src/main/resources/static/real_control_v2/alone_page/home/home_wrap.html
0 → 100644
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh-cn"> | |
| 3 | + | |
| 4 | +<head> | |
| 5 | + <meta charset="UTF-8"> | |
| 6 | + <title>主页模拟图</title> | |
| 7 | + <!-- uikit core style--> | |
| 8 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" /> | |
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" merge="plugins"/> | |
| 10 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" merge="plugins"/> | |
| 11 | + <link rel="stylesheet" | |
| 12 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | |
| 13 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" merge="plugins"/> | |
| 14 | + | |
| 15 | + <!-- main style --> | |
| 16 | + <link rel="stylesheet" href="/real_control_v2/css/main.css" /> | |
| 17 | + <!-- home style --> | |
| 18 | + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | |
| 19 | + | |
| 20 | + <!-- custom table --> | |
| 21 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | |
| 22 | + <!-- jquery contextMenu style --> | |
| 23 | + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" merge="plugins"/> | |
| 24 | + <!-- formvalidation style --> | |
| 25 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css" merge="plugins"/> | |
| 26 | + <!-- js tree --> | |
| 27 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/> | |
| 28 | + <!-- tooltip css--> | |
| 29 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css" merge="plugins"/> | |
| 30 | + <link rel="stylesheet" href="/real_control_v2/css/pace.css" merge="plugins"/> | |
| 31 | + | |
| 32 | + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/> | |
| 33 | + <!-- perfect-scrollbar style --> | |
| 34 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/> | |
| 35 | + <!-- layer 3.0.3 --> | |
| 36 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | |
| 37 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | |
| 38 | + | |
| 39 | + | |
| 40 | + <style> | |
| 41 | + .main-container{ | |
| 42 | + height: 100% !important; | |
| 43 | + } | |
| 44 | + | |
| 45 | + #main-tab-content{ | |
| 46 | + padding: 0 !important; | |
| 47 | + } | |
| 48 | + | |
| 49 | + .home-panel{ | |
| 50 | + | |
| 51 | + } | |
| 52 | + | |
| 53 | + #home-main-content{ | |
| 54 | + padding: 0 !important; | |
| 55 | + } | |
| 56 | + | |
| 57 | + #main-tab-content>.home-panel>#home-main-content{ | |
| 58 | + overflow: inherit; | |
| 59 | + } | |
| 60 | + </style> | |
| 61 | +</head> | |
| 62 | + | |
| 63 | +<body> | |
| 64 | +<!--<div class="main-container" style="height: 100%;"> | |
| 65 | +</div>--> | |
| 66 | +<div class="main-container"> | |
| 67 | + <ul id="main-tab-content"> | |
| 68 | + <li class="home-panel"></li> | |
| 69 | + </ul> | |
| 70 | +</div> | |
| 71 | + | |
| 72 | + | |
| 73 | +<!-- 地图相关 --> | |
| 74 | +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 75 | +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 76 | +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 77 | +<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 78 | +<!-- jquery --> | |
| 79 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 80 | +<!-- jquery actual --> | |
| 81 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | |
| 82 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 83 | +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | |
| 84 | +<!-- moment.js 日期处理类库 --> | |
| 85 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 86 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 87 | + | |
| 88 | +<!-- flatpickr --> | |
| 89 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | |
| 90 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | |
| 91 | + | |
| 92 | +<!-- perfect-scrollbar --> | |
| 93 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | |
| 94 | +<!-- common js --> | |
| 95 | +<script src="/real_control_v2/js/common.js"></script> | |
| 96 | +<!-- art-template 模版引擎 --> | |
| 97 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | |
| 98 | +<!-- d3 --> | |
| 99 | +<script src="/assets/js/d3.min.js"></script> | |
| 100 | +<!-- EventProxy --> | |
| 101 | +<script src="/assets/js/eventproxy.js"></script> | |
| 102 | + | |
| 103 | +<script> | |
| 104 | + | |
| 105 | + | |
| 106 | + var res_load_ep = EventProxy.create('load_home_layout', 'load_home_line_panel', 'load_data_basic', 'data-basic', function () { | |
| 107 | + //加载主页 | |
| 108 | + gb_home_layout.layout(function () { | |
| 109 | + gb_home_line_panel.init(function () { | |
| 110 | + //gps自刷新 | |
| 111 | + gb_data_gps.fixedTimeRefresh(); | |
| 112 | + | |
| 113 | + $('.uk-icon-send-o.home_alone_page').remove(); | |
| 114 | + }); | |
| 115 | + }); | |
| 116 | + }); | |
| 117 | + | |
| 118 | + function connectArr(arr, separator, transFun) { | |
| 119 | + var rs = ''; | |
| 120 | + $.each(arr, function (i, item) { | |
| 121 | + if (transFun) | |
| 122 | + item = transFun(item); | |
| 123 | + rs += (separator + item); | |
| 124 | + }); | |
| 125 | + return rs.substr(separator.length); | |
| 126 | + } | |
| 127 | + | |
| 128 | + var isArray = function (obj) { | |
| 129 | + return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 130 | + }; | |
| 131 | + | |
| 132 | + var gb_form_validation_opts = { | |
| 133 | + framework: 'uikit', | |
| 134 | + locale: 'zh_CN', | |
| 135 | + icon: { | |
| 136 | + valid: 'uk-icon-check', | |
| 137 | + invalid: 'uk-icon-times', | |
| 138 | + validating: 'uk-icon-refresh' | |
| 139 | + } | |
| 140 | + }; | |
| 141 | + | |
| 142 | +</script> | |
| 143 | + | |
| 144 | +<!-- uikit core --> | |
| 145 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | |
| 146 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | |
| 147 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js" merge="uikit_js"></script> | |
| 148 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | |
| 149 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | |
| 150 | + | |
| 151 | + | |
| 152 | +<!-- jquery contextMenu --> | |
| 153 | +<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js" merge="plugins"></script> | |
| 154 | +<script src="/real_control_v2/assets/js/jquery.ui.position.min.js" merge="plugins"></script> | |
| 155 | +<!-- formvalidation- --> | |
| 156 | +<script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js" merge="plugins"></script> | |
| 157 | +<script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js" merge="plugins"></script> | |
| 158 | +<script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js" merge="plugins"></script> | |
| 159 | +<!-- js tree --> | |
| 160 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | |
| 161 | +<!-- simple pinyin --> | |
| 162 | +<script src="/assets/plugins/pinyin.js" merge="plugins"></script> | |
| 163 | +<!-- qtip --> | |
| 164 | +<script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js" merge="plugins"></script> | |
| 165 | +<!-- layer 3.0.3 --> | |
| 166 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | |
| 167 | + | |
| 168 | +<!-- 数据 --> | |
| 169 | +<script src="/real_control_v2/alone_page/home/alone_data_basic.js" merge="custom_js"></script> | |
| 170 | +<script src="/real_control_v2/alone_page/home/alone_data_gps.js" merge="custom_js"></script> | |
| 171 | +<script src="/real_control_v2/js/data/gps_abnormal.js" merge="custom_js"></script> | |
| 172 | +<!-- 线路模拟图 --> | |
| 173 | +<script src="/real_control_v2/js/utils/svg_chart.js" merge="custom_js"></script> | |
| 174 | +<script src="/real_control_v2/js/utils/svg_data_convert.js" merge="custom_js"></script> | |
| 175 | +<script src="/real_control_v2/js/utils/svg_chart_tooltip.js" merge="custom_js"></script> | |
| 176 | +<script src="/real_control_v2/js/utils/svg_chart_map.js" merge="custom_js"></script> | |
| 177 | + | |
| 178 | +<!-- custom table js --> | |
| 179 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | |
| 180 | +<!-- home js --> | |
| 181 | +<script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script> | |
| 182 | +<script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script> | |
| 183 | +<script src="/real_control_v2/js/home/context_menu.js" merge="custom_js"></script> | |
| 184 | + | |
| 185 | + | |
| 186 | +<!-- 模态框扩展 --> | |
| 187 | +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | |
| 188 | + | |
| 189 | +</body> | |
| 190 | + | |
| 191 | +</html> | ... | ... |
src/main/resources/static/real_control_v2/alone_page/home/wrap.html deleted
100644 → 0
src/main/resources/static/real_control_v2/css/main.css
| ... | ... | @@ -1582,8 +1582,16 @@ ul.left_tabs_lg li{ |
| 1582 | 1582 | color: #929292; |
| 1583 | 1583 | } |
| 1584 | 1584 | |
| 1585 | -#all-devices-modal .search-form input{ | |
| 1586 | - width: 160px; | |
| 1585 | +#all-devices-modal .search-form input[type=text]{ | |
| 1586 | + width: 100px; | |
| 1587 | +} | |
| 1588 | + | |
| 1589 | +#all-devices-modal .auto-refresh{ | |
| 1590 | + vertical-align: middle;margin-left: 5px;color: grey; | |
| 1591 | +} | |
| 1592 | + | |
| 1593 | +#all-devices-modal .auto-refresh.active{ | |
| 1594 | + color: #405dff; | |
| 1587 | 1595 | } |
| 1588 | 1596 | |
| 1589 | 1597 | #all-devices-modal .uk-margin-small-top { | ... | ... |
src/main/resources/static/real_control_v2/css/north.css
| ... | ... | @@ -490,4 +490,14 @@ |
| 490 | 490 | .ct-badge.ct-badge-LSBCTZ:hover{ |
| 491 | 491 | background: red; |
| 492 | 492 | color: #fff; |
| 493 | +} | |
| 494 | + | |
| 495 | +span.sm-red{ | |
| 496 | + font-size: 12px; | |
| 497 | + color: #ff5454; | |
| 498 | +} | |
| 499 | + | |
| 500 | +span.sm-grey{ | |
| 501 | + font-size: 12px; | |
| 502 | + color: grey; | |
| 493 | 503 | } |
| 494 | 504 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v2/fragments/home/layout.html
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | {{/each}} |
| 15 | 15 | </ul> |
| 16 | 16 | <div class="home-rb-explain-icon "> |
| 17 | - <a href="/real_control_v2/mapmonitor/alone_page/alone_wrap.html" target="_blank"> | |
| 17 | + <a href="/real_control_v2/alone_page/home/home_wrap.html" target="_blank"> | |
| 18 | 18 | <i class="uk-icon-send-o home_alone_page uk-icon-hover" ></i> |
| 19 | 19 | </a> |
| 20 | 20 | | ... | ... |
src/main/resources/static/real_control_v2/fragments/north/nav/all_devices.html
| ... | ... | @@ -7,19 +7,13 @@ |
| 7 | 7 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> |
| 8 | 8 | <form class="uk-form search-form"> |
| 9 | 9 | <fieldset data-uk-margin> |
| 10 | - <!--<legend> | |
| 11 | - 数据检索 | |
| 12 | - <!– <div class="legend-tools"> | |
| 13 | - <a class="uk-icon-small uk-icon-hover uk-icon-file-excel-o" data-uk-tooltip title="导出excel"></a> | |
| 14 | - </div> –> | |
| 15 | - </legend>--> | |
| 16 | 10 | <span class="horizontal-field">线路</span> |
| 17 | 11 | <div class="uk-autocomplete uk-form autocomplete-line" > |
| 18 | 12 | <input type="text" name="lineId" placeholder="线路"> |
| 19 | 13 | </div> |
| 20 | 14 | <span class="horizontal-field">车辆</span> |
| 21 | 15 | <div class="uk-autocomplete uk-form autocomplete-cars" > |
| 22 | - <input type="text" name="nbbm" placeholder="车辆自编号"> | |
| 16 | + <input type="text" name="nbbm" placeholder="自编号"> | |
| 23 | 17 | </div> |
| 24 | 18 | <span class="horizontal-field">设备号</span> |
| 25 | 19 | <div class="uk-autocomplete uk-form autocomplete-device" > |
| ... | ... | @@ -35,9 +29,23 @@ |
| 35 | 29 | </div> |
| 36 | 30 | <span class="horizontal-field">程序版本</span> |
| 37 | 31 | <div class="uk-autocomplete uk-form " > |
| 38 | - <input type="text" name="version" placeholder="程序版本" style="width: 110px;"> | |
| 32 | + <input type="text" name="version" placeholder="版本号" style="width: 60px;"> | |
| 39 | 33 | </div> |
| 40 | - <button class="uk-button">检索</button> | |
| 34 | + <span class="horizontal-field">状态</span> | |
| 35 | + <div class="uk-autocomplete uk-form " > | |
| 36 | + <select name="abnormalStatus"> | |
| 37 | + <option value="">全部</option> | |
| 38 | + <option value="outBounds">越界</option> | |
| 39 | + <option value="overspeed">超速</option> | |
| 40 | + <option value="offline">离线</option> | |
| 41 | + <option value="gps-offline">gps 0,0</option> | |
| 42 | + </select> | |
| 43 | + </div> | |
| 44 | + <button class="uk-button search-btn" title="只支持后模糊">检索</button> | |
| 45 | + <label class="auto-refresh" > | |
| 46 | + <input type="checkbox" value="1" name="schCBox" class="i-cbox"> | |
| 47 | + 自动刷新 | |
| 48 | + </label> | |
| 41 | 49 | </fieldset> |
| 42 | 50 | </form> |
| 43 | 51 | </div> |
| ... | ... | @@ -49,10 +57,10 @@ |
| 49 | 57 | <th style="width: 14%;">站点</th> |
| 50 | 58 | <th style="width: 11%;">车辆</th> |
| 51 | 59 | <th style="width: 11%;">设备号</th> |
| 52 | - <th style="width: 9%;">速度</th> | |
| 53 | 60 | <th style="width: 9%;">走向/营运</th> |
| 54 | 61 | <th style="width: 10%;">程序版本</th> |
| 55 | 62 | <th>最后GPS时间</th> |
| 63 | + <th style="width: 9%;">状态</th> | |
| 56 | 64 | <th style="width: 8%;">来源</th> |
| 57 | 65 | </tr> |
| 58 | 66 | </thead> |
| ... | ... | @@ -72,17 +80,31 @@ |
| 72 | 80 | <td>{{gps.stationName}}</td> |
| 73 | 81 | <td>{{gps.nbbm}}</td> |
| 74 | 82 | <td>{{gps.deviceId}}</td> |
| 75 | - <td>{{gps.speed}}</td> | |
| 76 | 83 | <td>{{gps.upDown}}/{{gps.state}}</td> |
| 77 | 84 | <td>{{gps.version}}</td> |
| 78 | 85 | <td>{{gps.timeStr}}</td> |
| 79 | 86 | <td> |
| 87 | + {{if gps.valid==1}} | |
| 88 | + <span class="sm-red">invalid(-1</span> | |
| 89 | + {{else if gps.abnormalStatus=='outBounds'}} | |
| 90 | + <span class="sm-red" title="越界距离(米) {{gps.outOfBoundDistance}}">越界</span> | |
| 91 | + {{else if gps.abnormalStatus=='overspeed'}} | |
| 92 | + <span class="sm-red">超速({{gps.speed}})</span> | |
| 93 | + {{else if gps.abnormalStatus=='gps-offline'}} | |
| 94 | + <span class="sm-red">GPS (0,0)</span> | |
| 95 | + {{else if gps.abnormalStatus=='offline'}} | |
| 96 | + <span>离线</span> | |
| 97 | + {{else}} | |
| 98 | + ... | |
| 99 | + {{/if}} | |
| 100 | + </td> | |
| 101 | + <td> | |
| 80 | 102 | {{if gps.source==1}} |
| 81 | 103 | <span style="color: #1e1ef5;" title="已切换至新网关">网关</span> |
| 82 | 104 | {{else if gps.source==0}} |
| 83 | 105 | <span style="color: #8e8e8e;" title="转接的数据,无法下发指令">转发</span> |
| 84 | 106 | {{else}} |
| 85 | - <span>未知</span> | |
| 107 | + <span class="sm-grey">未知</span> | |
| 86 | 108 | {{/if}} |
| 87 | 109 | </td> |
| 88 | 110 | </tr> |
| ... | ... | @@ -148,7 +170,7 @@ |
| 148 | 170 | query(); |
| 149 | 171 | }); |
| 150 | 172 | |
| 151 | - var query = function() { | |
| 173 | + var query = function(cb) { | |
| 152 | 174 | var data = form.serializeJSON(); |
| 153 | 175 | data.page = page; |
| 154 | 176 | data.size = pageSize; |
| ... | ... | @@ -173,9 +195,75 @@ |
| 173 | 195 | //pagination |
| 174 | 196 | if (resetPagination) |
| 175 | 197 | pagination(rs.totalPages + 1, rs.page); |
| 198 | + | |
| 199 | + cb && cb(); | |
| 176 | 200 | }) |
| 177 | 201 | }; |
| 178 | 202 | |
| 203 | + /** | |
| 204 | + * 自动刷新 | |
| 205 | + */ | |
| 206 | + $('.auto-refresh', modal).on('click', function () { | |
| 207 | + var checked = $('input[type=checkbox]',this)[0].checked, | |
| 208 | + $sub_btn = $('.search-btn', form); | |
| 209 | + if(checked){ | |
| 210 | + $(this).addClass('active'); | |
| 211 | + $sub_btn.attr('disabled', 'disabled'); | |
| 212 | + auto_refresh.start(); | |
| 213 | + } | |
| 214 | + else{ | |
| 215 | + $(this).removeClass('active'); | |
| 216 | + $sub_btn.removeAttr('disabled'); | |
| 217 | + auto_refresh.stop(); | |
| 218 | + } | |
| 219 | + }); | |
| 220 | + | |
| 221 | + var auto_refresh = (function () { | |
| 222 | + var timer=null; | |
| 223 | + var span = $('.auto-refresh', modal).append('<span class="no"></span>').find('span.no'); | |
| 224 | + var space = 10; | |
| 225 | + var start = function () { | |
| 226 | + | |
| 227 | + (function () { | |
| 228 | + var f = arguments.callee; | |
| 229 | + run(); | |
| 230 | + if(space == 0){ | |
| 231 | + space = 10; | |
| 232 | + | |
| 233 | + resetPagination = true; | |
| 234 | + page=0; | |
| 235 | + query(function () { | |
| 236 | + timer = setTimeout(f, 1000); | |
| 237 | + }); | |
| 238 | + } | |
| 239 | + else{ | |
| 240 | + timer = setTimeout(f, 1000); | |
| 241 | + } | |
| 242 | + })(); | |
| 243 | + }; | |
| 244 | + | |
| 245 | + var stop = function () { | |
| 246 | + clearTimeout(timer); | |
| 247 | + timer = null; | |
| 248 | + space = 10; | |
| 249 | + span.text(''); | |
| 250 | + }; | |
| 251 | + | |
| 252 | + var run = function () { | |
| 253 | + space --; | |
| 254 | + span.text(space); | |
| 255 | + }; | |
| 256 | + | |
| 257 | + | |
| 258 | + return { | |
| 259 | + start: start, | |
| 260 | + stop: stop | |
| 261 | + } | |
| 262 | + })(); | |
| 263 | + | |
| 264 | + //注册 destroy | |
| 265 | + $(modal).on('ct-destroy', auto_refresh.stop); | |
| 266 | + | |
| 179 | 267 | var state_up_0 = function(device) { |
| 180 | 268 | var nbbm = gb_data_basic.device2nbbmMap()[device]; |
| 181 | 269 | stateChange(nbbm, 0, 0); | ... | ... |
src/main/resources/static/real_control_v2/js/home/layout.js
| ... | ... | @@ -72,14 +72,6 @@ var gb_home_layout = (function () { |
| 72 | 72 | }); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - //.home-rb-explain-icon .home_alone_page | |
| 76 | - /** | |
| 77 | - * 单屏打开主页 | |
| 78 | - */ | |
| 79 | - $('.home-rb-explain-icon .home_alone_page').on('click', function () { | |
| 80 | - | |
| 81 | - }); | |
| 82 | - | |
| 83 | 75 | //click svg edit icon |
| 84 | 76 | $(document).on('click', '.home-svg-edit-icon', function () { |
| 85 | 77 | open_modal('/real_control_v2/fragments/home/svg_edit.html', {lineCode: $(this).data('line-code')}); | ... | ... |
src/main/resources/static/real_control_v2/js/modal_extend.js
| ... | ... | @@ -4,7 +4,7 @@ $(document).on('hide.uk.modal', '.uk-modal', function () { |
| 4 | 4 | if($('.uk-modal-dialog', this).hasClass('uk-modal-dialog-lightbox')){ |
| 5 | 5 | return; |
| 6 | 6 | } |
| 7 | - $(this).remove(); | |
| 7 | + $(this).trigger('ct-destroy').remove(); | |
| 8 | 8 | }); |
| 9 | 9 | |
| 10 | 10 | $(document).on('show.uk.modal', '.uk-modal.ct_move_modal', function () { | ... | ... |
src/main/resources/static/real_control_v2/js/utils/svg_chart_tooltip.js
| ... | ... | @@ -108,7 +108,7 @@ var gb_svg_tooltip = (function () { |
| 108 | 108 | api.set({ |
| 109 | 109 | 'hide.event': false, |
| 110 | 110 | 'content.button': 'Close', |
| 111 | - 'content.title': 'GPS正常', | |
| 111 | + 'content.title': '...', | |
| 112 | 112 | 'position.my': 'top center', |
| 113 | 113 | 'position.at': 'bottom center' |
| 114 | 114 | }); | ... | ... |