Commit b2765c8a7f4c03e825ef8ef4c55f7da5a7cb7799
1 parent
49745251
新增免登录线调页面
Showing
32 changed files
with
4614 additions
and
0 deletions
Too many changes to show.
To preserve performance only 32 of 56 files are displayed.
src/main/resources/static/real_control_v3/alone_page/home/alone_data_basic.js
0 → 100644
| 1 | +/* 基础数据管理模块 */ | |
| 2 | + | |
| 3 | +var gb_data_basic = (function () { | |
| 4 | + | |
| 5 | + var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs; | |
| 6 | + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs" | |
| 7 | + , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) { | |
| 8 | + stationRoutes = routes; | |
| 9 | + lineCode2NameAll = code2Name; | |
| 10 | + lineInformations = informations; | |
| 11 | + nbbm2deviceMap = nbbm2device; | |
| 12 | + device2nbbmMap = gb_common.inverse(nbbm2deviceMap); | |
| 13 | + allPersonnel = all_personnel; | |
| 14 | + svgAttrs = svgAttrMap; | |
| 15 | + | |
| 16 | + res_load_ep.emitLater('data-basic'); | |
| 17 | + }); | |
| 18 | + | |
| 19 | + var storage = window.localStorage; | |
| 20 | + //激活的线路 | |
| 21 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 22 | + //lineCode to line object | |
| 23 | + var codeToLine = {}; | |
| 24 | + //lineCode idx string | |
| 25 | + var line_idx = (function () { | |
| 26 | + var str = ''; | |
| 27 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 28 | + str += (',' + item.lineCode); | |
| 29 | + codeToLine[item.lineCode] = item; | |
| 30 | + } | |
| 31 | + return str.substr(1); | |
| 32 | + })(); | |
| 33 | + | |
| 34 | + //站点路由 | |
| 35 | + gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 36 | + var list = rs.list;//JSON.parse(rs.list); | |
| 37 | + var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 38 | + //排序 | |
| 39 | + for (var lineCode in routeData) { | |
| 40 | + routeData[lineCode].sort(stationRouteSort); | |
| 41 | + } | |
| 42 | + ep.emit('stationRoutes', routeData); | |
| 43 | + }); | |
| 44 | + | |
| 45 | + //线路标准信息 | |
| 46 | + /*gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 47 | + var informations = {}; | |
| 48 | + $.each(rs, function () { | |
| 49 | + informations[this.line.lineCode] = this; | |
| 50 | + delete this['line']; | |
| 51 | + }); | |
| 52 | + ep.emit('lineInformations', informations); | |
| 53 | + });*/ | |
| 54 | + ep.emit('lineInformations', {}); | |
| 55 | + | |
| 56 | + //人员信息 | |
| 57 | + ep.emit('all_personnel', {}); | |
| 58 | + /*loadAllPersonnel(function (data) { | |
| 59 | + ep.emit('all_personnel', data); | |
| 60 | + }); | |
| 61 | + function loadAllPersonnel(cb) { | |
| 62 | + $.get('/personnel/all_py', function (rs) { | |
| 63 | + //转换成自动补全组件需要的数据 | |
| 64 | + var data = [], code; | |
| 65 | + for(var i =0, p; p = rs[i++];){ | |
| 66 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 67 | + data.push({ | |
| 68 | + value: code + '/' + p.name, | |
| 69 | + fullChars: p.fullChars.toUpperCase(), | |
| 70 | + camelChars: p.camelChars.toUpperCase() | |
| 71 | + }); | |
| 72 | + } | |
| 73 | + cb && cb(data); | |
| 74 | + }); | |
| 75 | + }*/ | |
| 76 | + | |
| 77 | + var carparks = {}; | |
| 78 | + //停车场数据 | |
| 79 | +/* gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | |
| 80 | + rs.list.sort(function (a, b) { | |
| 81 | + return a.parkName.localeCompare(b.parkName); | |
| 82 | + }); | |
| 83 | + $.each(rs.list, function () { | |
| 84 | + carparks[this.parkCode] = this; | |
| 85 | + }); | |
| 86 | + });*/ | |
| 87 | + | |
| 88 | + //车辆数据 | |
| 89 | + var carsArray; | |
| 90 | + /*$.get('/basic/cars?t=' + Math.random(), function (rs) { | |
| 91 | + carsArray = rs; | |
| 92 | + });*/ | |
| 93 | + | |
| 94 | + var getCarparkByCode = function (code) { | |
| 95 | + return carparks[code]; | |
| 96 | + }; | |
| 97 | + | |
| 98 | + //line code to name | |
| 99 | + $.get('/freeLogin/basic/lineCode2Name', function (rs) { | |
| 100 | + ep.emit('lineCode2Name', rs); | |
| 101 | + }); | |
| 102 | + | |
| 103 | + //nbbm to device id | |
| 104 | + $.get('freeLogin/basic/nbbm2deviceId', function (rs) { | |
| 105 | + ep.emit('nbbm2deviceId', rs); | |
| 106 | + }); | |
| 107 | + //nbbm to 车牌号 | |
| 108 | + var nbbm2PlateMap; | |
| 109 | + $.get('/freeLogin/basic/nbbm2PlateNo', function (rs) { | |
| 110 | + nbbm2PlateMap = rs; | |
| 111 | + }); | |
| 112 | + | |
| 113 | + //模拟图属性数据 | |
| 114 | + gb_common.$get('/freeLogin/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 115 | + var data = {}; | |
| 116 | + $.each(rs.list, function () { | |
| 117 | + this.hideStations = JSON.parse(this.hideStations); | |
| 118 | + this.nicknames = JSON.parse(this.nicknames); | |
| 119 | + data[this.lineCode] = this; | |
| 120 | + }); | |
| 121 | + ep.emit('svg_attrs', data); | |
| 122 | + }); | |
| 123 | + | |
| 124 | + //站点和停车场历时、公里对照数据 | |
| 125 | + var stat_park_data; | |
| 126 | + /*var load_stat_park_data = function () { | |
| 127 | + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 128 | + stat_park_data = rs; | |
| 129 | + }); | |
| 130 | + } | |
| 131 | + load_stat_park_data();*/ | |
| 132 | + | |
| 133 | + function findLineByCodes(codeArr) { | |
| 134 | + var rs = []; | |
| 135 | + $.each(codeArr, function () { | |
| 136 | + rs.push(codeToLine[this]); | |
| 137 | + }); | |
| 138 | + return rs; | |
| 139 | + } | |
| 140 | + | |
| 141 | + var findCodeByLinename = function (name) { | |
| 142 | + for (var code in lineCode2NameAll) { | |
| 143 | + if (name == lineCode2NameAll[code]) | |
| 144 | + return code; | |
| 145 | + } | |
| 146 | + | |
| 147 | + return null; | |
| 148 | + }; | |
| 149 | + | |
| 150 | + var getLineInformation = function (lineCode) { | |
| 151 | + return lineInformations[lineCode]; | |
| 152 | + }; | |
| 153 | + | |
| 154 | + var stationRouteSort = function (a, b) { | |
| 155 | + return a.stationRouteCode - b.stationRouteCode; | |
| 156 | + }; | |
| 157 | + | |
| 158 | + /** | |
| 159 | + * 常用的备注补全列表 | |
| 160 | + */ | |
| 161 | + var remarksArray = ['保养', '故障', '肇事', '加油', '维修', '援外', '路阻' | |
| 162 | + , '故障(离合器坏)', '故障,(方向盘坏)', '故障(排挡坏)', '故障(门坏)', '故障(雨刮器坏)','故障(刹车坏)', '故障(气打不上)' | |
| 163 | + ,'故障(整车无电)', '故障(故障灯常亮)', '故障(警报灯亮)', '故障(玻璃坏)', '故障(反光镜坏)', '故障(发电机坏)', '故障(漏防冻液)' | |
| 164 | + , '故障(漏水)','故障(轮胎坏)', '故障(无动力)', '故障(喷机油)', '故障(水温高)', '保养(一级保养)' | |
| 165 | + , '保养(二级保养)', '保养(三级保养)', '换车出场', '临加进场', '临加出场']; | |
| 166 | + var remarksMapps = []; | |
| 167 | + $.each(remarksArray, function (i, t) { | |
| 168 | + remarksMapps.push({ | |
| 169 | + value: t, | |
| 170 | + fullChars: pinyin.getFullChars(t).toUpperCase(), | |
| 171 | + camelChars: pinyin.getCamelChars(t) | |
| 172 | + }); | |
| 173 | + }); | |
| 174 | + | |
| 175 | + //文件载入完毕 | |
| 176 | + res_load_ep.emitLater('load_data_basic'); | |
| 177 | + | |
| 178 | + return { | |
| 179 | + activeLines: activeLines, | |
| 180 | + line_idx: line_idx, | |
| 181 | + codeToLine: codeToLine, | |
| 182 | + nbbm2deviceMap: function () { | |
| 183 | + return nbbm2deviceMap; | |
| 184 | + }, | |
| 185 | + device2nbbmMap: function () { | |
| 186 | + return device2nbbmMap; | |
| 187 | + }, | |
| 188 | + getLineInformation: getLineInformation, | |
| 189 | + allInformations: function () { | |
| 190 | + return lineInformations; | |
| 191 | + }, | |
| 192 | + stationRoutes: function (lineCode) { | |
| 193 | + return stationRoutes[lineCode] | |
| 194 | + }, | |
| 195 | + findLineByCodes: findLineByCodes, | |
| 196 | + lineCode2NameAll: function () { | |
| 197 | + return lineCode2NameAll | |
| 198 | + }, | |
| 199 | + allPersonnel: function () { | |
| 200 | + return allPersonnel; | |
| 201 | + }, | |
| 202 | + findCodeByLinename: findCodeByLinename, | |
| 203 | + getCarparkByCode: getCarparkByCode, | |
| 204 | + getSvgAttr: function (lineCode) { | |
| 205 | + return svgAttrs[lineCode]; | |
| 206 | + }, | |
| 207 | + setSvgAttr: function (attr) { | |
| 208 | + attr.hideStations = JSON.parse(attr.hideStations); | |
| 209 | + attr.nicknames = JSON.parse(attr.nicknames); | |
| 210 | + svgAttrs[attr.lineCode] = attr; | |
| 211 | + }, | |
| 212 | + //是否是环线 | |
| 213 | + isLoopLine: function (lineCode) { | |
| 214 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 215 | + //下行只有2个站点 | |
| 216 | + var len = data[0].length; | |
| 217 | + if (len > 0 && data[1].length == 2) { | |
| 218 | + var first = data[0][0], | |
| 219 | + end = data[0][len - 1]; | |
| 220 | + | |
| 221 | + /*if(first.stationName != end.stationName) | |
| 222 | + return false;*/ | |
| 223 | + | |
| 224 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 225 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 226 | + | |
| 227 | + //并且上行起终点距离200米内 | |
| 228 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 229 | + return true; | |
| 230 | + } | |
| 231 | + } | |
| 232 | + | |
| 233 | + return false; | |
| 234 | + }, | |
| 235 | + //刷新员工信息 | |
| 236 | + refreshAllPersonnel: function (cb) { | |
| 237 | + loadAllPersonnel(function (data) { | |
| 238 | + allPersonnel = data; | |
| 239 | + cb && cb(); | |
| 240 | + }); | |
| 241 | + }, | |
| 242 | + nbbm2PlateMap: function () { | |
| 243 | + return nbbm2PlateMap; | |
| 244 | + }, | |
| 245 | + carsArray: function () { | |
| 246 | + return carsArray; | |
| 247 | + }, | |
| 248 | + simpleParksArray: function () { | |
| 249 | + var map = {}; | |
| 250 | + for(var code in carparks) | |
| 251 | + map[code] = carparks[code].parkName; | |
| 252 | + return map; | |
| 253 | + }, | |
| 254 | + remarksMapps: function () { | |
| 255 | + return remarksMapps; | |
| 256 | + }, | |
| 257 | + get_stat_park_data: function () { | |
| 258 | + return stat_park_data; | |
| 259 | + }, | |
| 260 | + reload_stat_park_data: function () { | |
| 261 | + load_stat_park_data(); | |
| 262 | + } | |
| 263 | + }; | |
| 264 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/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: '/freeLogin/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.gpsList, 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_v3/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 | + list-style: none; | |
| 48 | + } | |
| 49 | + | |
| 50 | + .home-panel{ | |
| 51 | + | |
| 52 | + } | |
| 53 | + | |
| 54 | + #home-main-content{ | |
| 55 | + padding: 0 !important; | |
| 56 | + } | |
| 57 | + | |
| 58 | + #main-tab-content>.home-panel>#home-main-content{ | |
| 59 | + overflow: inherit !important; | |
| 60 | + } | |
| 61 | + </style> | |
| 62 | +</head> | |
| 63 | + | |
| 64 | +<body> | |
| 65 | +<!--<div class="main-container" style="height: 100%;"> | |
| 66 | +</div>--> | |
| 67 | +<div class="main-container"> | |
| 68 | + <ul id="main-tab-content"> | |
| 69 | + <li class="home-panel"></li> | |
| 70 | + </ul> | |
| 71 | +</div> | |
| 72 | + | |
| 73 | + | |
| 74 | +<!-- 地图相关 --> | |
| 75 | +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 76 | +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 77 | +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 78 | +<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 79 | +<!-- jquery --> | |
| 80 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 81 | +<!-- jquery actual --> | |
| 82 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | |
| 83 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 84 | +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | |
| 85 | +<!-- moment.js 日期处理类库 --> | |
| 86 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 87 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 88 | + | |
| 89 | +<!-- flatpickr --> | |
| 90 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | |
| 91 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | |
| 92 | + | |
| 93 | +<!-- perfect-scrollbar --> | |
| 94 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | |
| 95 | +<!-- common js --> | |
| 96 | +<script src="/real_control_v2/js/common.js"></script> | |
| 97 | +<!-- art-template 模版引擎 --> | |
| 98 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | |
| 99 | +<!-- d3 --> | |
| 100 | +<script src="/assets/js/d3.min.js"></script> | |
| 101 | +<!-- EventProxy --> | |
| 102 | +<script src="/assets/js/eventproxy.js"></script> | |
| 103 | +<!-- Geolib --> | |
| 104 | +<script src="/real_control_v2/geolib/geolib.js" merge="plugins"></script> | |
| 105 | + | |
| 106 | +<script> | |
| 107 | + | |
| 108 | + | |
| 109 | + var res_load_ep = EventProxy.create('load_home_layout', 'load_home_line_panel', 'load_data_basic', 'data-basic', function () { | |
| 110 | + //加载主页 | |
| 111 | + gb_home_layout.layout(function () { | |
| 112 | + gb_home_line_panel.init(function () { | |
| 113 | + //gps自刷新 | |
| 114 | + gb_data_gps.fixedTimeRefresh(); | |
| 115 | + | |
| 116 | + $('.uk-icon-send-o.home_alone_page').remove(); | |
| 117 | + }); | |
| 118 | + }); | |
| 119 | + }); | |
| 120 | + | |
| 121 | + function connectArr(arr, separator, transFun) { | |
| 122 | + var rs = ''; | |
| 123 | + $.each(arr, function (i, item) { | |
| 124 | + if (transFun) | |
| 125 | + item = transFun(item); | |
| 126 | + rs += (separator + item); | |
| 127 | + }); | |
| 128 | + return rs.substr(separator.length); | |
| 129 | + } | |
| 130 | + | |
| 131 | + var isArray = function (obj) { | |
| 132 | + return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 133 | + }; | |
| 134 | + | |
| 135 | + var gb_form_validation_opts = { | |
| 136 | + framework: 'uikit', | |
| 137 | + locale: 'zh_CN', | |
| 138 | + icon: { | |
| 139 | + valid: 'uk-icon-check', | |
| 140 | + invalid: 'uk-icon-times', | |
| 141 | + validating: 'uk-icon-refresh' | |
| 142 | + } | |
| 143 | + }; | |
| 144 | + | |
| 145 | +</script> | |
| 146 | + | |
| 147 | +<!-- uikit core --> | |
| 148 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | |
| 149 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | |
| 150 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js" merge="uikit_js"></script> | |
| 151 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | |
| 152 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | |
| 153 | + | |
| 154 | + | |
| 155 | +<!-- jquery contextMenu --> | |
| 156 | +<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js" merge="plugins"></script> | |
| 157 | +<script src="/real_control_v2/assets/js/jquery.ui.position.min.js" merge="plugins"></script> | |
| 158 | +<!-- formvalidation- --> | |
| 159 | +<script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js" merge="plugins"></script> | |
| 160 | +<script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js" merge="plugins"></script> | |
| 161 | +<script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js" merge="plugins"></script> | |
| 162 | +<!-- js tree --> | |
| 163 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | |
| 164 | +<!-- simple pinyin --> | |
| 165 | +<script src="/assets/plugins/pinyin.js" merge="plugins"></script> | |
| 166 | +<!-- qtip --> | |
| 167 | +<script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js" merge="plugins"></script> | |
| 168 | +<!-- layer 3.0.3 --> | |
| 169 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | |
| 170 | + | |
| 171 | +<!-- 数据 --> | |
| 172 | +<script src="/real_control_v3/alone_page/home/alone_data_basic.js" merge="custom_js"></script> | |
| 173 | +<script src="/real_control_v3/alone_page/home/alone_data_gps.js" merge="custom_js"></script> | |
| 174 | +<script src="/real_control_v3/js/data/gps_abnormal.js" merge="custom_js"></script> | |
| 175 | +<!-- 线路模拟图 --> | |
| 176 | +<script src="/real_control_v2/js/utils/svg_chart.js" merge="custom_js"></script> | |
| 177 | +<script src="/real_control_v2/js/utils/svg_data_convert.js" merge="custom_js"></script> | |
| 178 | +<script src="/real_control_v2/js/utils/svg_chart_tooltip.js" merge="custom_js"></script> | |
| 179 | +<script src="/real_control_v2/js/utils/svg_chart_map.js" merge="custom_js"></script> | |
| 180 | + | |
| 181 | +<!-- custom table js --> | |
| 182 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | |
| 183 | +<!-- home js --> | |
| 184 | +<script src="/real_control_v3/js/home/layout.js" merge="custom_js"></script> | |
| 185 | +<script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script> | |
| 186 | +<!--<script src="/real_control_v2/js/home/context_menu.js" merge="custom_js"></script>--> | |
| 187 | + | |
| 188 | + | |
| 189 | +<!-- 模态框扩展 --> | |
| 190 | +<script src="/real_control_v/js/modal_extend.js" merge="custom_js"></script> | |
| 191 | + | |
| 192 | +</body> | |
| 193 | + | |
| 194 | +</html> | ... | ... |
src/main/resources/static/real_control_v3/alone_page/map/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('/freeLogin/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('/freeLogin/basic/all_personnel_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('/freeLogin/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('/freeLogin/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('/freeLogin/basic/lineCode2Name', function (rs) { | |
| 98 | + ep.emit('lineCode2Name', rs); | |
| 99 | + }); | |
| 100 | + | |
| 101 | + //nbbm to device id | |
| 102 | + $.get('/freeLogin/basic/nbbm2deviceId', function (rs) { | |
| 103 | + ep.emit('nbbm2deviceId', rs); | |
| 104 | + }); | |
| 105 | + //nbbm to 车牌号 | |
| 106 | + var nbbm2PlateMap; | |
| 107 | + $.get('/freeLogin/basic/nbbm2PlateNo', function (rs) { | |
| 108 | + nbbm2PlateMap = rs; | |
| 109 | + }); | |
| 110 | + | |
| 111 | + //模拟图属性数据 | |
| 112 | + gb_common.$get('/freeLogin/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('/freeLogin/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 | + return { | |
| 157 | + activeLines: activeLines, | |
| 158 | + line_idx: line_idx, | |
| 159 | + codeToLine: codeToLine, | |
| 160 | + nbbm2deviceMap: function () { | |
| 161 | + return nbbm2deviceMap; | |
| 162 | + }, | |
| 163 | + device2nbbmMap: function () { | |
| 164 | + return device2nbbmMap; | |
| 165 | + }, | |
| 166 | + getLineInformation: getLineInformation, | |
| 167 | + allInformations: function () { | |
| 168 | + return lineInformations; | |
| 169 | + }, | |
| 170 | + stationRoutes: function (lineCode) { | |
| 171 | + return stationRoutes[lineCode] | |
| 172 | + }, | |
| 173 | + findLineByCodes: findLineByCodes, | |
| 174 | + lineCode2NameAll: function () { | |
| 175 | + return lineCode2NameAll | |
| 176 | + }, | |
| 177 | + allPersonnel: function () { | |
| 178 | + return allPersonnel; | |
| 179 | + }, | |
| 180 | + findCodeByLinename: findCodeByLinename, | |
| 181 | + getCarparkByCode: getCarparkByCode, | |
| 182 | + getSvgAttr: function (lineCode) { | |
| 183 | + return svgAttrs[lineCode]; | |
| 184 | + }, | |
| 185 | + setSvgAttr: function (attr) { | |
| 186 | + attr.hideStations = JSON.parse(attr.hideStations); | |
| 187 | + attr.nicknames = JSON.parse(attr.nicknames); | |
| 188 | + svgAttrs[attr.lineCode] = attr; | |
| 189 | + }, | |
| 190 | + //是否是环线 | |
| 191 | + isLoopLine: function (lineCode) { | |
| 192 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 193 | + //下行只有2个站点 | |
| 194 | + var len = data[0].length; | |
| 195 | + if (len > 0 && data[1].length == 2) { | |
| 196 | + var first = data[0][0], | |
| 197 | + end = data[0][len - 1]; | |
| 198 | + | |
| 199 | + /*if(first.stationName != end.stationName) | |
| 200 | + return false;*/ | |
| 201 | + | |
| 202 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 203 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 204 | + | |
| 205 | + //并且上行起终点距离200米内 | |
| 206 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 207 | + return true; | |
| 208 | + } | |
| 209 | + } | |
| 210 | + | |
| 211 | + return false; | |
| 212 | + }, | |
| 213 | + //刷新员工信息 | |
| 214 | + refreshAllPersonnel: function (cb) { | |
| 215 | + loadAllPersonnel(function (data) { | |
| 216 | + allPersonnel = data; | |
| 217 | + cb && cb(); | |
| 218 | + }); | |
| 219 | + }, | |
| 220 | + nbbm2PlateMap: function () { | |
| 221 | + return nbbm2PlateMap; | |
| 222 | + }, | |
| 223 | + carsArray: function () { | |
| 224 | + return carsArray; | |
| 225 | + }, | |
| 226 | + simpleParksArray: function () { | |
| 227 | + var map = {}; | |
| 228 | + for(var code in carparks) | |
| 229 | + map[code] = carparks[code].parkName; | |
| 230 | + return map; | |
| 231 | + }, | |
| 232 | + remarksMapps: function () { | |
| 233 | + return remarksMapps; | |
| 234 | + }, | |
| 235 | + get_stat_park_data: function () { | |
| 236 | + return stat_park_data; | |
| 237 | + }, | |
| 238 | + reload_stat_park_data: function () { | |
| 239 | + load_stat_park_data(); | |
| 240 | + } | |
| 241 | + }; | |
| 242 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/alone_page/map/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: '/freeLogin/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.gpsList, 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, rs.overspeedList); | |
| 73 | + }); | |
| 74 | + | |
| 75 | + //超速数据回调 | |
| 76 | + //console.log('超速,,,', rs.overspeedList); | |
| 77 | + | |
| 78 | + }; | |
| 79 | + | |
| 80 | + var startFixedTime; | |
| 81 | + var fixedTimeRefresh = function () { | |
| 82 | + if (startFixedTime) | |
| 83 | + return; | |
| 84 | + startFixedTime = true; | |
| 85 | + | |
| 86 | + (function () { | |
| 87 | + var f = arguments.callee; | |
| 88 | + refresh(function () { | |
| 89 | + setTimeout(f, delay); | |
| 90 | + }); | |
| 91 | + })(); | |
| 92 | + }; | |
| 93 | + | |
| 94 | + var gpsByLineCode = function (lineCode) { | |
| 95 | + var rs = []; | |
| 96 | + for (var device in realData) { | |
| 97 | + if (realData[device].lineId == lineCode) | |
| 98 | + rs.push(realData[device]); | |
| 99 | + } | |
| 100 | + return rs; | |
| 101 | + }; | |
| 102 | + | |
| 103 | + var findOne = function (deviceId) { | |
| 104 | + return realData[deviceId]; | |
| 105 | + }; | |
| 106 | + | |
| 107 | + var findGpsByNbbm = function (nbbm) { | |
| 108 | + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 109 | + }; | |
| 110 | + | |
| 111 | + /** | |
| 112 | + * 设备掉线事件 | |
| 113 | + */ | |
| 114 | + var deviceOffline = function (gps) { | |
| 115 | + $.each(offlineCallbacks, function (i, cb) { | |
| 116 | + cb(gps); | |
| 117 | + }); | |
| 118 | + }; | |
| 119 | + | |
| 120 | + //注册掉线事件回调函数 | |
| 121 | + var offlineCallbacks = []; | |
| 122 | + var registerOfflineCb = function (cb) { | |
| 123 | + if (cb) | |
| 124 | + offlineCallbacks.push(cb); | |
| 125 | + }; | |
| 126 | + | |
| 127 | + return { | |
| 128 | + fixedTimeRefresh: fixedTimeRefresh, | |
| 129 | + registerCallback: registerCallback, | |
| 130 | + allGps: realData, | |
| 131 | + gpsByLineCode: gpsByLineCode, | |
| 132 | + findOne: findOne, | |
| 133 | + findGpsByNbbm: findGpsByNbbm, | |
| 134 | + deviceOffline: deviceOffline, | |
| 135 | + registerOfflineCb: registerOfflineCb | |
| 136 | + }; | |
| 137 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/alone_page/map/alone_wrap.html
0 → 100644
| 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 | + merge="plugins"/> | |
| 11 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" | |
| 12 | + merge="plugins"/> | |
| 13 | + <link rel="stylesheet" | |
| 14 | + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" merge="plugins"/> | |
| 15 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" | |
| 16 | + merge="plugins"/> | |
| 17 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" | |
| 18 | + merge="plugins"/> | |
| 19 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" | |
| 20 | + merge="plugins"/> | |
| 21 | + | |
| 22 | + <!-- main style --> | |
| 23 | + <link rel="stylesheet" href="/real_control_v2/css/main.css"/> | |
| 24 | + <!-- north style --> | |
| 25 | + <link rel="stylesheet" href="/real_control_v2/css/north.css" merge="custom_style"/> | |
| 26 | + <!-- home style --> | |
| 27 | + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/> | |
| 28 | + | |
| 29 | + <!-- js tree --> | |
| 30 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.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" | |
| 35 | + merge="plugins"/> | |
| 36 | + <!-- layer 3.0.3 --> | |
| 37 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/> | |
| 38 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/> | |
| 39 | + | |
| 40 | + <!-- flatpickr --> | |
| 41 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" merge="plugins"/> | |
| 42 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" merge="plugins"/> | |
| 43 | + | |
| 44 | + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/> | |
| 45 | + | |
| 46 | + <style> | |
| 47 | + .main-container .map-panel{ | |
| 48 | + position: absolute; | |
| 49 | + top:0; | |
| 50 | + left: 0; | |
| 51 | + width: 20px; | |
| 52 | + z-index: 999; | |
| 53 | + height: 20px; | |
| 54 | + } | |
| 55 | + </style> | |
| 56 | +</head> | |
| 57 | + | |
| 58 | +<body> | |
| 59 | +<div class="main-container" style="height: 100%;"> | |
| 60 | + <span style="position: absolute;left: calc(50% - 35px);top: calc(45% - 35px);">加载中...</span> | |
| 61 | +</div> | |
| 62 | +<!-- 地图相关 --> | |
| 63 | +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script> | |
| 64 | +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script> | |
| 65 | +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script> | |
| 66 | +<script src="/assets/js/TransGPS.js" merge="plugins"></script> | |
| 67 | +<!-- 高德 --> | |
| 68 | +<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script> | |
| 69 | +<!-- jquery --> | |
| 70 | +<script src="/real_control_v2/assets/js/jquery.min.js"></script> | |
| 71 | +<!-- jquery actual --> | |
| 72 | +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script> | |
| 73 | +<!-- moment.js 日期处理类库 --> | |
| 74 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | |
| 75 | +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script> | |
| 76 | + | |
| 77 | +<!-- flatpickr --> | |
| 78 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script> | |
| 79 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script> | |
| 80 | + | |
| 81 | +<!-- perfect-scrollbar --> | |
| 82 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script> | |
| 83 | +<!-- common js --> | |
| 84 | +<script src="/real_control_v2/js/common.js"></script> | |
| 85 | +<!-- art-template 模版引擎 --> | |
| 86 | +<script src="/assets/plugins/template.js" merge="plugins"></script> | |
| 87 | +<!-- d3 --> | |
| 88 | +<script src="/assets/js/d3.min.js"></script> | |
| 89 | +<!-- EventProxy --> | |
| 90 | +<script src="/assets/js/eventproxy.js"></script> | |
| 91 | +<!-- uikit core --> | |
| 92 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script> | |
| 93 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script> | |
| 94 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script> | |
| 95 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js" merge="uikit_js"></script> | |
| 96 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" merge="uikit_js"></script> | |
| 97 | +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script> | |
| 98 | + | |
| 99 | +<!-- js tree --> | |
| 100 | +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script> | |
| 101 | +<!-- layer 3.0.3 --> | |
| 102 | +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script> | |
| 103 | + | |
| 104 | +<!-- 模态框扩展 --> | |
| 105 | +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script> | |
| 106 | + | |
| 107 | +<script src="/real_control_v3/alone_page/map/alone_data_basic.js" merge="custom_js"></script> | |
| 108 | +<script src="/real_control_v3/alone_page/map/alone_data_gps.js" merge="custom_js"></script> | |
| 109 | +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script> | |
| 110 | +<!-- jquery.serializejson JSON序列化插件 --> | |
| 111 | +<script src="/assets/plugins/jquery.serializejson.js" merge="uikit_js"></script> | |
| 112 | + | |
| 113 | +<script src="/assets/plugins/pinyin.js" merge="plugins"></script> | |
| 114 | +</body> | |
| 115 | +<script> | |
| 116 | + gb_data_gps.fixedTimeRefresh(); | |
| 117 | + var res_load_ep = EventProxy.create('data-basic', function () { | |
| 118 | + | |
| 119 | + //嵌入地图页面 | |
| 120 | + $('.main-container').load('/real_control_v3/mapmonitor/real.html', function () { | |
| 121 | + $('.map-system-msg.flex-left').remove(); | |
| 122 | + | |
| 123 | + $(this).append('<span class="map-panel"></span>');//判断里有JS判定这个容器是否显示 | |
| 124 | + }); | |
| 125 | + }); | |
| 126 | + | |
| 127 | + var isArray = function (obj) { | |
| 128 | + return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 129 | + }; | |
| 130 | +</script> | |
| 131 | +</html> | ... | ... |
src/main/resources/static/real_control_v3/fragments/home/c0_a3.html
0 → 100644
| 1 | +<div class="uk-modal" id="home-c0a3-modal"> | |
| 2 | + <div class="uk-modal-dialog"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>B-91071 设备参数</h2></div> | |
| 6 | + | |
| 7 | + <div class="modal-loading"> | |
| 8 | + <div class="uk-modal-spinner"></div> | |
| 9 | + <div class="text">正在下发指令...</div> | |
| 10 | + </div> | |
| 11 | + | |
| 12 | + | |
| 13 | + <div id="c0a3_detail_panel" style="display: none;"> | |
| 14 | + <table class="uk-table uk-table-striped uk-table-hover"> | |
| 15 | + <tr> | |
| 16 | + <th>设备编号:</th> | |
| 17 | + <td>559L0018</td> | |
| 18 | + </tr> | |
| 19 | + <tr> | |
| 20 | + <th>网关IP地址:</th> | |
| 21 | + <td>222.68.12.48</td> | |
| 22 | + </tr> | |
| 23 | + <tr> | |
| 24 | + <th>网关端口:</th> | |
| 25 | + <td>30020</td> | |
| 26 | + </tr> | |
| 27 | + <tr> | |
| 28 | + <th>定时定距上报模式:</th> | |
| 29 | + <td>0</td> | |
| 30 | + </tr> | |
| 31 | + <tr> | |
| 32 | + <th>定时上报时间间隔:</th> | |
| 33 | + <td>0</td> | |
| 34 | + </tr> | |
| 35 | + <tr> | |
| 36 | + <th>定距上报距离间隔:</th> | |
| 37 | + <td>0</td> | |
| 38 | + </tr> | |
| 39 | + <tr> | |
| 40 | + <th>非线路状态超速阀门:</th> | |
| 41 | + <td>0</td> | |
| 42 | + </tr> | |
| 43 | + <tr> | |
| 44 | + <th>预警阀门:</th> | |
| 45 | + <td>0</td> | |
| 46 | + </tr> | |
| 47 | + <tr> | |
| 48 | + <th>pos机IP地址:</th> | |
| 49 | + <td>192.168.2.52</td> | |
| 50 | + </tr> | |
| 51 | + <tr> | |
| 52 | + <th>pos机端口:</th> | |
| 53 | + <td>8090</td> | |
| 54 | + </tr> | |
| 55 | + <tr> | |
| 56 | + <th>延迟机关时间:</th> | |
| 57 | + <td>0</td> | |
| 58 | + </tr> | |
| 59 | + <tr> | |
| 60 | + <th>中门视频切换到码表界面速度阀门:</th> | |
| 61 | + <td>0</td> | |
| 62 | + </tr> | |
| 63 | + <tr> | |
| 64 | + <th>码表界面切换到中门视频速度阀门:</th> | |
| 65 | + <td>0</td> | |
| 66 | + </tr> | |
| 67 | + <tr> | |
| 68 | + <th>对比度:</th> | |
| 69 | + <td>0</td> | |
| 70 | + </tr> | |
| 71 | + <tr> | |
| 72 | + <th>亮度:</th> | |
| 73 | + <td>0</td> | |
| 74 | + </tr> | |
| 75 | + <tr> | |
| 76 | + <th>饱和度:</th> | |
| 77 | + <td>0</td> | |
| 78 | + </tr> | |
| 79 | + </table> | |
| 80 | + </div> | |
| 81 | + </div> | |
| 82 | + <script> | |
| 83 | + (function() { | |
| 84 | + var modal = '#home-c0a3-modal'; | |
| 85 | + $(modal).on('init', function(e, data) { | |
| 86 | + e.stopPropagation(); | |
| 87 | + console.log('data', data); | |
| 88 | + $.post('/directive/c0a4', {nbbm: data.nbbm}); | |
| 89 | + | |
| 90 | + setTimeout(function() { | |
| 91 | + $('.modal-loading .text', modal).text('等待设备响应数据...'); | |
| 92 | + }, 1500); | |
| 93 | + | |
| 94 | + setTimeout(function() { | |
| 95 | + //$('.modal-loading .text', modal).text('等待设备响应数据...'); | |
| 96 | + $('.modal-loading', modal).remove(); | |
| 97 | + | |
| 98 | + $('#c0a3_detail_panel').show(); | |
| 99 | + }, 4500); | |
| 100 | + }); | |
| 101 | + })(); | |
| 102 | + </script> | |
| 103 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/home/context_menu.html
0 → 100644
| 1 | +<div> | |
| 2 | + <!-- send phrase--> | |
| 3 | + <script id="home-send-phrase-temp" type="text/html"> | |
| 4 | + <div class="uk-modal" id="send-phrase-modal"> | |
| 5 | + <div class="uk-modal-dialog"> | |
| 6 | + | |
| 7 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 8 | + <div class="uk-modal-header"> | |
| 9 | + <h2>向 {{nbbm}} 发送消息短语</h2></div> | |
| 10 | + <form class="uk-form"> | |
| 11 | + <input type="hidden" value="{{nbbm}}" name="nbbm" /> | |
| 12 | + <div class="uk-form-row"> | |
| 13 | + <select style="width: 170px;" class="common_phrase_sel"> | |
| 14 | + </select> | |
| 15 | + <div class="tools" > | |
| 16 | + <span data-uk-tooltip title="添加到常用短语" class="add_frequent_phrases"> | |
| 17 | + <i class="uk-icon-plus"></i> | |
| 18 | + </span> | |
| 19 | + <span data-uk-tooltip title="删除这条常用短语" class="minus_frequent_phrases"> | |
| 20 | + <i class="uk-icon-minus"></i> | |
| 21 | + </span> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + <div class="uk-form-row"> | |
| 25 | + <textarea cols="30" rows="5" name="text" data-fv-notempty data-fv-stringlength="true" data-fv-stringlength-max="50" placeholder="输入短语,不要超过50 个字符" style="margin: 0px; width: 100%; height: 110px;"></textarea> | |
| 26 | + </div> | |
| 27 | + <div class="uk-modal-footer uk-text-right"> | |
| 28 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 29 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 发送</button> | |
| 30 | + </div> | |
| 31 | + </form> | |
| 32 | + </div> | |
| 33 | + </div> | |
| 34 | + </script> | |
| 35 | + | |
| 36 | + <script id="home-send-phrase-multi-temp" type="text/html"> | |
| 37 | + <div class="uk-modal" id="send-phrase-multi-modal"> | |
| 38 | + <div class="uk-modal-dialog" style="width: 730px;"> | |
| 39 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 40 | + <div class="uk-modal-header"> | |
| 41 | + <h2>群发消息短语</h2></div> | |
| 42 | + | |
| 43 | + <div class="uk-grid ct-modal-body send-multi-grid"> | |
| 44 | + <div class="uk-width-2-6"> | |
| 45 | + <div class="device-tree"></div> | |
| 46 | + </div> | |
| 47 | + <div class="uk-width-4-6" style="border-left: 1px solid #dddddd;"> | |
| 48 | + <form class="uk-form fixed-tool"> | |
| 49 | + <div class="uk-form-row"> | |
| 50 | + <select style="width: 170px;" class="common_phrase_sel"> | |
| 51 | + </select> | |
| 52 | + <div class="tools" > | |
| 53 | + <span data-uk-tooltip title="添加到常用短语" class="add_frequent_phrases"> | |
| 54 | + <i class="uk-icon-plus"></i> | |
| 55 | + </span> | |
| 56 | + <span data-uk-tooltip title="删除这条常用短语" class="minus_frequent_phrases"> | |
| 57 | + <i class="uk-icon-minus"></i> | |
| 58 | + </span> | |
| 59 | + </div> | |
| 60 | + </div> | |
| 61 | + <br /> | |
| 62 | + <div class="uk-form-row"> | |
| 63 | + <textarea cols="30" rows="5" name="text" data-fv-notempty data-fv-stringlength="true" data-fv-stringlength-max="50" placeholder="输入短语,不要超过50 个字符" style="margin: 0px; width: 100%; height: 110px;"></textarea> | |
| 64 | + </div> | |
| 65 | + <div class="uk-modal-footer uk-text-right"> | |
| 66 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 67 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 发送</button> | |
| 68 | + </div> | |
| 69 | + </form> | |
| 70 | + </div> | |
| 71 | + </div> | |
| 72 | + </div> | |
| 73 | + </div> | |
| 74 | + </script> | |
| 75 | + | |
| 76 | + | |
| 77 | + <script id="show-multi-send-anim-temp" type="text/html"> | |
| 78 | + <div class="uk-modal" id="show-multi-send-modal"> | |
| 79 | + <div class="uk-modal-dialog" > | |
| 80 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 81 | + <h2 class="modal-title"><i class="uk-icon-spinner uk-icon-spin"></i> 正在发送...</h2> | |
| 82 | + <div class="uk-panel uk-panel-box">{{text}}</div> | |
| 83 | + <ul class="uk-list uk-list-line"> | |
| 84 | + {{each array as nbbm i}} | |
| 85 | + <li data-nbbm="{{nbbm}}"> | |
| 86 | + <span class="text-lg">{{nbbm}}</span> | |
| 87 | + <span class="text-grey wait-send">等待推送</span> | |
| 88 | + </li> | |
| 89 | + {{/each}} | |
| 90 | + </ul> | |
| 91 | + </div> | |
| 92 | + </div> | |
| 93 | + </script> | |
| 94 | + | |
| 95 | + <script id="line-change-modal-temp" type="text/html"> | |
| 96 | + <div class="uk-modal" id="line-change-modal"> | |
| 97 | + <div class="uk-modal-dialog"> | |
| 98 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 99 | + | |
| 100 | + <form class="uk-form fv-form"> | |
| 101 | + <input type="hidden" name="nbbm" value="{{nbbm}}" /> | |
| 102 | + <fieldset data-uk-margin> | |
| 103 | + <strong style="color: red;font-size: 16px;">{{nbbm}}</strong> 切换至线路 | |
| 104 | + | |
| 105 | + <div class="uk-autocomplete uk-form" id="uk-autocomplete-line"> | |
| 106 | + <input type="text" placeholder="搜索线路" name="line" /> | |
| 107 | + </div> | |
| 108 | + | |
| 109 | + <label style="margin-left: 15px;font-size: 12px;color: grey;"> | |
| 110 | + <input type="checkbox" style="vertical-align: middle" checked disabled> 强制刷新线路文件! | |
| 111 | + </label> | |
| 112 | + </fieldset> | |
| 113 | + | |
| 114 | + <div class="uk-modal-footer uk-text-right"> | |
| 115 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 116 | + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-send"></i> 发送</button> | |
| 117 | + </div> | |
| 118 | + </form> | |
| 119 | + </div> | |
| 120 | + </div> | |
| 121 | +</script> | |
| 122 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/home/layout.html
0 → 100644
| 1 | +<div> | |
| 2 | + <!-- home tab template --> | |
| 3 | + <script id="home-layout-tab-temp" type="text/html"> | |
| 4 | + <ul id="home-main-content" class="uk-switcher"> | |
| 5 | + {{each tabs as t i}} | |
| 6 | + <li {{if i==0}}class="uk-active"{{/if}} >{{t}}</li> | |
| 7 | + {{/each}} | |
| 8 | + </ul> | |
| 9 | + | |
| 10 | + <div class="home-panel-footer"> | |
| 11 | + <ul class="uk-subnav uk-subnav-pill" data-uk-switcher="{connect:'#home-main-content', swiping: false}"> | |
| 12 | + {{each tabs as t i}} | |
| 13 | + <li {{if i==0}}class="uk-active"{{/if}}><a> {{t}}</a></li> | |
| 14 | + {{/each}} | |
| 15 | + </ul> | |
| 16 | + <div class="home-rb-explain-icon "> | |
| 17 | + <a href="/real_control_v2/alone_page/home/home_wrap.html" target="_blank"> | |
| 18 | + <i class="uk-icon-send-o home_alone_page uk-icon-hover" ></i> | |
| 19 | + </a> | |
| 20 | + | |
| 21 | + <i class="uk-icon-question-circle uk-icon-hover"></i> | |
| 22 | + </div> | |
| 23 | + </div> | |
| 24 | + </script> | |
| 25 | + | |
| 26 | + <!-- home line template --> | |
| 27 | + <script id="home-layout-line-temp" type="text/html"> | |
| 28 | + {{each list as line i}} | |
| 29 | + <div class="uk-grid home-line-card" data-line-code="{{line.lineCode}}"> | |
| 30 | + <div class="uk-width-medium-1-5 data-wrap up" id="home_{{line.lineCode}}_0"></div> | |
| 31 | + <div class="uk-width-medium-3-5 svg-chart-wrap"> | |
| 32 | + <div class="home-svg-edit-icon" data-line-code="{{line.lineCode}}"></div> | |
| 33 | + <div class="top-center-big-text"> | |
| 34 | + {{line.name}} | |
| 35 | + </div> | |
| 36 | + </div> | |
| 37 | + <div class="uk-width-medium-1-5 data-wrap down" id="home_{{line.lineCode}}_1"></div> | |
| 38 | + </div> | |
| 39 | + {{/each}} | |
| 40 | + </script> | |
| 41 | + | |
| 42 | + <script id="home-rb-explain-help-temp" type="text/html"> | |
| 43 | + <ul class="uk-list"> | |
| 44 | + <li>场外车辆,距离线路超过100米即为越界</li> | |
| 45 | + <li>超速以线路标准限速为准,为空则默认60</li> | |
| 46 | + <li>有任务时,连续2分钟无信号即为掉线</li> | |
| 47 | + <li>无任务时,连续10分钟无信号则已离线</li> | |
| 48 | + </ul> | |
| 49 | + </script> | |
| 50 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/home/line_panel.html
0 → 100644
| 1 | +<div> | |
| 2 | + <script id="home-gps-table-temp" type="text/html"> | |
| 3 | + <div class="data-title"> | |
| 4 | + <span class="data-title-text">发往{{title}} ( <span class="no-badge">0</span> )</span> | |
| 5 | + </div> | |
| 6 | + <div class="data-body"> | |
| 7 | + <div class="ct_table_wrap"> | |
| 8 | + <div class="ct_table home-gps-table"> | |
| 9 | + <div class="ct_table_head"> | |
| 10 | + <dl> | |
| 11 | + <dt>车辆编码</dt> | |
| 12 | + <dt>路牌</dt> | |
| 13 | + <dt>速度</dt> | |
| 14 | + <dt>终点</dt> | |
| 15 | + <dt>状态</dt> | |
| 16 | + <dt>当前站点</dt> | |
| 17 | + <dt>终点站</dt> | |
| 18 | + <dt>计划到达</dt> | |
| 19 | + <dt>驾驶员</dt> | |
| 20 | + </dl> | |
| 21 | + </div> | |
| 22 | + <div class="ct_table_body"></div> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + </script> | |
| 27 | + | |
| 28 | + <script id="home-gps-tbody-temp" type="text/html"> | |
| 29 | + <dl id="home_gps_{{deviceId}}" data-device-id="{{deviceId}}" {{if abnormalStatus=='offline'}}class="offline"{{/if}}> | |
| 30 | + <dd title="{{nbbm}}"><a>{{nbbm}}</a></dd> | |
| 31 | + <dd></dd> | |
| 32 | + <dd>{{speed>99?'..':speed}}</dd> | |
| 33 | + <dd>{{expectStopTime}}</dd> | |
| 34 | + <dd> | |
| 35 | + {{if abnormalStatus != null}} | |
| 36 | + {{if abnormalStatus == 'outBounds'}} | |
| 37 | + <span class="signal-state-outbounds">越界</span> | |
| 38 | + {{else if abnormalStatus == 'overspeed'}} | |
| 39 | + <span class="signal-state-speed-limit">超速</span> | |
| 40 | + {{/if}} | |
| 41 | + {{/if}} | |
| 42 | + | |
| 43 | + {{if instation == 2}} | |
| 44 | + <i class="uk-icon-product-hunt carpark-icon"></i> | |
| 45 | + {{/if}} | |
| 46 | + </dd> | |
| 47 | + <dd title="{{stationName}}">{{stationName}}</dd> | |
| 48 | + <dd></dd> | |
| 49 | + <dd></dd> | |
| 50 | + <dd></dd> | |
| 51 | + </dl> | |
| 52 | + </script> | |
| 53 | + | |
| 54 | + <script id="home-gps-abnormal-temp" type="text/html"> | |
| 55 | + {{if abnormalStatus != null}} | |
| 56 | + {{if abnormalStatus == 'outBounds'}} | |
| 57 | + <span class="signal-state-outbounds">越界</span> | |
| 58 | + {{else if abnormalStatus == 'overspeed'}} | |
| 59 | + <span class="signal-state-speed-limit">超速</span> | |
| 60 | + {{/if}} | |
| 61 | + {{/if}} | |
| 62 | + | |
| 63 | + {{if instation == 2}} | |
| 64 | + <i class="uk-icon-product-hunt carpark-icon"></i> | |
| 65 | + {{/if}} | |
| 66 | + </script> | |
| 67 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/home/svg_edit.html
0 → 100644
| 1 | +<div class="uk-modal" id="home-svg-edit-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 930px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + <div class="uk-modal-header"> | |
| 5 | + <h2>主页模拟图数据编辑</h2></div> | |
| 6 | + | |
| 7 | + <div class="svg-edit-panel-wrap station-list-wrap"> | |
| 8 | + <span class="title-badge">站点缩略</span> | |
| 9 | + </div> | |
| 10 | + | |
| 11 | + | |
| 12 | + <div class="svg-edit-panel-wrap" style="margin-left: 25px;"> | |
| 13 | + <span class="title-badge">站点重命名</span> | |
| 14 | + <div style="height: 100%;"> | |
| 15 | + <div style="height: calc(100% - 25px);overflow: auto;"> | |
| 16 | + <form class="uk-form rename-list-form"> | |
| 17 | + </form> | |
| 18 | + </div> | |
| 19 | + | |
| 20 | + <div class="rename-tools" style="height: 21px;"> | |
| 21 | + <a class="uk-icon-small uk-icon-hover uk-icon-plus add"></a> | |
| 22 | + <a class="uk-icon-small uk-icon-hover uk-icon-minus minus"></a> | |
| 23 | + </div> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + | |
| 27 | + | |
| 28 | + <div class="uk-modal-footer uk-text-right"> | |
| 29 | + <button type="button" class="uk-button uk-modal-close">取消</button> | |
| 30 | + <button type="button" class="uk-button uk-button-primary submitBtn"><i class="uk-icon-check"></i> 保存 | |
| 31 | + </button> | |
| 32 | + </div> | |
| 33 | + </div> | |
| 34 | + | |
| 35 | + <script id="svg-edit-station-list-temp" type="text/html"> | |
| 36 | + <div class="station-list up"> | |
| 37 | + {{each list[0] as s i}} | |
| 38 | + <div class="station-item" data-code="{{s.stationCode}}">{{s.stationName}}</div> | |
| 39 | + {{/each}} | |
| 40 | + </div> | |
| 41 | + | |
| 42 | + <div class="station-list down" style="margin-left: 8px;"> | |
| 43 | + {{each list[1] as s i}} | |
| 44 | + <div class="station-item" data-code="{{s.stationCode}}">{{s.stationName}}</div> | |
| 45 | + {{/each}} | |
| 46 | + </div> | |
| 47 | + </script> | |
| 48 | + | |
| 49 | + <script id="svg-edit-rename-item-temp" type="text/html"> | |
| 50 | + <div class="rename-item-panel"> | |
| 51 | + <input type="checkbox"> | |
| 52 | + <select name="renames[{{no}}][name]"> | |
| 53 | + {{each names as n i}} | |
| 54 | + <option value="{{n}}">{{n}}</option> | |
| 55 | + {{/each}} | |
| 56 | + </select> | |
| 57 | + <i class="uk-icon-arrows-h"></i> | |
| 58 | + <input type="text" value="{{names[0]}}" name="renames[{{no}}][nickname]"> | |
| 59 | + </div> | |
| 60 | + </script> | |
| 61 | + | |
| 62 | + <script> | |
| 63 | + (function () { | |
| 64 | + var modal = '#home-svg-edit-modal', | |
| 65 | + lineCode, names = [], no = 0; | |
| 66 | + | |
| 67 | + $(modal).on('init', function (e, data) { | |
| 68 | + e.stopPropagation(); | |
| 69 | + lineCode = data.lineCode; | |
| 70 | + var allStationList = gb_data_basic.stationRoutes(lineCode); | |
| 71 | + //站点路由 | |
| 72 | + var routeArray = gb_common.groupBy(allStationList, 'directions'); | |
| 73 | + //下行倒序 | |
| 74 | + routeArray[1].sort(function (a, b) { | |
| 75 | + return b.stationRouteCode - a.stationRouteCode; | |
| 76 | + }); | |
| 77 | + $('.station-list-wrap', modal).append(template('svg-edit-station-list-temp', {list: routeArray})); | |
| 78 | + | |
| 79 | + $('.station-item', modal).on('click', function () { | |
| 80 | + if ($(this).hasClass('disable')) { | |
| 81 | + $(this).removeClass('disable'); | |
| 82 | + } | |
| 83 | + else | |
| 84 | + $(this).addClass('disable'); | |
| 85 | + }); | |
| 86 | + | |
| 87 | + //上下行所有的站点名称 | |
| 88 | + var nameMap = {}; | |
| 89 | + $.each(allStationList, function () { | |
| 90 | + nameMap[this.stationName] = 1; | |
| 91 | + }); | |
| 92 | + names = gb_common.get_keys(nameMap).sort(function (a, b) { | |
| 93 | + return a.localeCompare(b); | |
| 94 | + }); | |
| 95 | + | |
| 96 | + //获取配置信息 | |
| 97 | + var svgAttr = gb_data_basic.getSvgAttr(lineCode); | |
| 98 | + if(svgAttr){ | |
| 99 | + var hideStations = svgAttr.hideStations; | |
| 100 | + //disable | |
| 101 | + $('.station-list-wrap .station-item', modal).each(function () { | |
| 102 | + var code = $(this).data('code'); | |
| 103 | + if (hideStations.indexOf(code) != -1) { | |
| 104 | + $(this).addClass('disable'); | |
| 105 | + } | |
| 106 | + }); | |
| 107 | + //rename items | |
| 108 | + var nicknames = svgAttr.nicknames; | |
| 109 | + for (var n in nicknames) { | |
| 110 | + addRenameItem(function ($e) { | |
| 111 | + $e.find('select').val(n); | |
| 112 | + $e.find('input[type=text]').val(nicknames[n]); | |
| 113 | + }); | |
| 114 | + } | |
| 115 | + } | |
| 116 | + }); | |
| 117 | + | |
| 118 | + var addRenameItem = function (cb) { | |
| 119 | + var htmlStr = template('svg-edit-rename-item-temp', {names: names, no: no}); | |
| 120 | + var $e = $(htmlStr); | |
| 121 | + $('.rename-list-form', modal).append($e); | |
| 122 | + no++; | |
| 123 | + cb && cb($e); | |
| 124 | + }; | |
| 125 | + | |
| 126 | + //add rename item | |
| 127 | + $('.rename-tools .add', modal).on('click', function () { | |
| 128 | + addRenameItem(); | |
| 129 | + }); | |
| 130 | + | |
| 131 | + //remove rename item | |
| 132 | + $('.rename-tools .minus', modal).on('click', function () { | |
| 133 | + $('.rename-item-panel.active', modal).remove(); | |
| 134 | + }); | |
| 135 | + | |
| 136 | + //check | |
| 137 | + $(modal).on('click', '.rename-item-panel input[type=checkbox]', function () { | |
| 138 | + if ($(this)[0].checked) { | |
| 139 | + $(this).parent().addClass('active'); | |
| 140 | + } | |
| 141 | + else { | |
| 142 | + $(this).parent().removeClass('active'); | |
| 143 | + } | |
| 144 | + }); | |
| 145 | + | |
| 146 | + //select | |
| 147 | + $(modal).on('change', '.rename-item-panel select', function () { | |
| 148 | + $(this).nextAll('input').val($(this).val()); | |
| 149 | + }); | |
| 150 | + | |
| 151 | + | |
| 152 | + //提交 | |
| 153 | + $(modal).on('click', '.submitBtn', function () { | |
| 154 | + //重命名数据 | |
| 155 | + var tempData = $('.rename-list-form', modal).serializeJSON().renames; | |
| 156 | + var renameData = {}; | |
| 157 | + $.each(gb_common.get_vals(tempData), function () { | |
| 158 | + if (!$.trim(this.nickname) || this.name == this.nickname) | |
| 159 | + return true; | |
| 160 | + renameData[this.name] = this.nickname; | |
| 161 | + }); | |
| 162 | + | |
| 163 | + //被禁选的站点 | |
| 164 | + var disableStation = []; | |
| 165 | + $('.station-list-wrap .station-item.disable', modal).each(function () { | |
| 166 | + disableStation.push($(this).data('code')); | |
| 167 | + }); | |
| 168 | + | |
| 169 | + var data = { | |
| 170 | + lineCode: lineCode, | |
| 171 | + hideStations: disableStation, | |
| 172 | + nicknames: renameData | |
| 173 | + }; | |
| 174 | + | |
| 175 | + gb_common.$post('/freeLogin/realSchedule/svgAttr', {jsonStr: JSON.stringify(data)}, function (rs) { | |
| 176 | + if (rs.t) { | |
| 177 | + gb_data_basic.setSvgAttr(rs.t); | |
| 178 | + //重新绘制模拟图 | |
| 179 | + var lineCode = rs.t.lineCode; | |
| 180 | + //主页 | |
| 181 | + var wrap = $('#home-main-content .home-line-card[data-line-code='+lineCode+'] .svg-chart-wrap'); | |
| 182 | + wrap.find('svg.line-chart').remove(); | |
| 183 | + gb_svg_chart.draw_line(lineCode, wrap, true); | |
| 184 | + //电子路单界面 | |
| 185 | + wrap = $('#main-tab-content .line_schedule[data-id='+lineCode+'] .footer-chart .svg-wrap'); | |
| 186 | + wrap.find('svg.line-chart').remove(); | |
| 187 | + gb_svg_chart.draw_line(lineCode, wrap, true); | |
| 188 | + UIkit.modal(modal).hide(); | |
| 189 | + } | |
| 190 | + }); | |
| 191 | + }); | |
| 192 | + })(); | |
| 193 | + </script> | |
| 194 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/home/tooltip.html
0 → 100644
| 1 | +<div> | |
| 2 | + <script id="tooltip_gps_temp" type="text/html"> | |
| 3 | + <div class="tooltip" data-id="{{deviceId}}"> | |
| 4 | + <div class="tooltip-container"> | |
| 5 | + | |
| 6 | + <div class="cont-text-panel home_svg_tips"> | |
| 7 | + <div class="title"> | |
| 8 | + <a href="javascript:;" data-for="station" class="tip_modal"> | |
| 9 | + {{nbbm}} | |
| 10 | + {{if abnormalStatus == 'outBounds'}} | |
| 11 | + <span class="abnormal-text">越界</span> | |
| 12 | + {{else if abnormalStatus == 'overspeed'}} | |
| 13 | + <span class="abnormal-text">超速</span> | |
| 14 | + {{else if abnormalStatus == 'gps-offline'}} | |
| 15 | + <span class="abnormal-text">GPS掉线</span> | |
| 16 | + {{else if abnormalStatus == 'offline'}} | |
| 17 | + <span class="abnormal-text">已离线</span> | |
| 18 | + {{/if}} | |
| 19 | + </a> | |
| 20 | + </div> | |
| 21 | + <div> | |
| 22 | + <span class="field">车牌号:</span>{{plateNo}} | |
| 23 | + </div> | |
| 24 | + <div title="{{stationName}}"> | |
| 25 | + <span class="field">站点:</span>{{stationName}} | |
| 26 | + </div> | |
| 27 | + <!-- <div> | |
| 28 | + {{lineName}} -{{if upDown==0}}上行{{else}}下行{{/if}} | |
| 29 | + </div> --> | |
| 30 | + <div> | |
| 31 | + <span class="field">设备:</span>{{deviceId}} | |
| 32 | + </div> | |
| 33 | + <!--<div> | |
| 34 | + <span class="field">坐标:</span>{{lon}} {{lat}} | |
| 35 | + </div>--> | |
| 36 | + {{if sch!=null}} | |
| 37 | + <div> | |
| 38 | + <span class="field">驾驶员:</span>{{sch.jGh}}/{{sch.jName}} | |
| 39 | + </div> | |
| 40 | + {{if sch.sGh!=null && sch.sGh!=""}} | |
| 41 | + <div> | |
| 42 | + <span class="field">售票员:</span>{{sch.sGh}}/{{sch.sName}} | |
| 43 | + </div> | |
| 44 | + {{/if}} | |
| 45 | + {{/if}} | |
| 46 | + <div> | |
| 47 | + <span class="field">速度:</span>{{speed>99?'..':speed}}</div> | |
| 48 | + <div> | |
| 49 | + <span class="field">时间:</span>{{dateStr}}</div> | |
| 50 | + {{if expectStopTime!=null}} | |
| 51 | + <div> | |
| 52 | + 预计 {{expectStopTime}} 分钟到达终点</div> | |
| 53 | + {{/if}} | |
| 54 | + </div> | |
| 55 | + | |
| 56 | + <div class="tip_map_wrap"></div> | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + </script> | |
| 60 | + | |
| 61 | + <script id="tooltip_multi_gps_temp" type="text/html"> | |
| 62 | + <div class="multi-tooltip-wrap"> | |
| 63 | + {{each list as gps i}} | |
| 64 | + <div class="tooltip multi-tooltip" > | |
| 65 | + <div class="tooltip-container"> | |
| 66 | + <div class="title"> | |
| 67 | + <a href="javascript:;" data-for="station" class="tip_modal"> | |
| 68 | + {{gps.nbbm}} | |
| 69 | + </a> | |
| 70 | + </div> | |
| 71 | + <div> | |
| 72 | + <span class="field">车牌号:</span>{{gps.plateNo}} | |
| 73 | + </div> | |
| 74 | + <div> | |
| 75 | + <span class="field">站点:</span>{{gps.stationName}} | |
| 76 | + </div> | |
| 77 | + <div> | |
| 78 | + <span class="field">设备:</span>{{gps.deviceId}} | |
| 79 | + </div> | |
| 80 | + <div style="color: #747272;"> | |
| 81 | + {{gps.dateStr}} | |
| 82 | + </div> | |
| 83 | + </div> | |
| 84 | + </div> | |
| 85 | + {{/each}} | |
| 86 | + </div> | |
| 87 | + <div class="tip_map_wrap multi"></div> | |
| 88 | + </script> | |
| 89 | + | |
| 90 | + | |
| 91 | + <script id="tooltip_multi_gps_cont_temp" type="text/html"> | |
| 92 | + <div class="tooltip-container"> | |
| 93 | + <div class="title"> | |
| 94 | + <a href="javascript:;" data-for="station" class="tip_modal"> | |
| 95 | + {{nbbm}} | |
| 96 | + </a> | |
| 97 | + </div> | |
| 98 | + <div> | |
| 99 | + <span class="field">站点:</span>{{stationName}} | |
| 100 | + </div> | |
| 101 | + <div> | |
| 102 | + <span class="field">设备:</span>{{deviceId}} | |
| 103 | + </div> | |
| 104 | + <div style="color: #747272;"> | |
| 105 | + {{gps.dateStr}} | |
| 106 | + </div> | |
| 107 | + </div> | |
| 108 | + </script> | |
| 109 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/line_schedule/badge_tooltip.html
0 → 100644
| 1 | +<div> | |
| 2 | + <script id="sch-table-task-tootip-temp" type="text/html"> | |
| 3 | + <div class="tl-tip-panel"> | |
| 4 | + <div class="tip_task_list"> | |
| 5 | + <dl> | |
| 6 | + <dt>操作</dt> | |
| 7 | + <dt>类型</dt> | |
| 8 | + <dt>里程</dt> | |
| 9 | + <dt>起点</dt> | |
| 10 | + <dt>终点</dt> | |
| 11 | + <dt>备注</dt> | |
| 12 | + </dl> | |
| 13 | + {{each tasks as t i}} | |
| 14 | + <dl class="{{t.mileageType}} {{if t.destroy}}destroy{{/if}} {{if t.type1=='临加'}}temp_add{{/if}}"> | |
| 15 | + <dd><a data-line="{{sch.xlBm}}" data-id="{{t.id}}" data-schid="{{sch.id}}" class="tip_task_edit_link">编辑</a></dd> | |
| 16 | + <dd> | |
| 17 | + {{if t.mileageType=="service"}} | |
| 18 | + 营运 | |
| 19 | + {{else if t.mileageType=="empty"}} | |
| 20 | + 空驶 | |
| 21 | + {{/if}} | |
| 22 | + {{if t.destroy}} | |
| 23 | + <span>(烂班)</span> | |
| 24 | + {{else if t.type2==2}} | |
| 25 | + <span>(进场)</span> | |
| 26 | + {{else if t.type2==3}} | |
| 27 | + <span>(出场)</span> | |
| 28 | + {{else if t.type1=='临加'}} | |
| 29 | + <span>(临加)</span> | |
| 30 | + {{/if}} | |
| 31 | + </dd> | |
| 32 | + <dd> | |
| 33 | + {{t.mileage}} | |
| 34 | + </dd> | |
| 35 | + <dd title="{{t.startStationName}}">{{t.startStationName}}</dd> | |
| 36 | + <dd title="{{t.endStationName}}">{{t.endStationName}}</dd> | |
| 37 | + <dd title="{{t.remarks}}">{{t.remarks}}</dd> | |
| 38 | + </dl> | |
| 39 | + {{/each}} | |
| 40 | + <dl class="tip_task_count_dl {{if sch.c_t_mileage_status==-1}}c_task_error{{/if}}" > | |
| 41 | + <dd><i class="uk-icon-plus badge_tip_add_icon" data-line="{{sch.xlBm}}" data-schid="{{sch.id}}"></i></dd> | |
| 42 | + <dd> | |
| 43 | + <span>计划:{{sch.jhlcOrig}}</span> | |
| 44 | + <span>营运+烂班:{{serviceCount}}</span> | |
| 45 | + <span>空驶:{{emptyCount}}</span> | |
| 46 | + </dd> | |
| 47 | + </dl> | |
| 48 | + </div> | |
| 49 | + </div> | |
| 50 | + </script> | |
| 51 | + | |
| 52 | + | |
| 53 | + <script id="sch-table-region-tootip-temp" type="text/html"> | |
| 54 | + <div class="tl-tip-panel"> | |
| 55 | + <div style="font-size: 13px;"> | |
| 56 | + 由 {{qdzName}} 发往 {{zdzName}} | |
| 57 | + </div> | |
| 58 | + </div> | |
| 59 | + </script> | |
| 60 | + | |
| 61 | + <script id="sch-table-out-tootip-temp" type="text/html"> | |
| 62 | + <div class="tl-tip-panel"> | |
| 63 | + <div style="font-size: 13px;"> | |
| 64 | + {{qdzName}} 出场至 {{zdzName}} | |
| 65 | + </div> | |
| 66 | + </div> | |
| 67 | + </script> | |
| 68 | + | |
| 69 | + <script id="sch-table-in-tootip-temp" type="text/html"> | |
| 70 | + <div class="tl-tip-panel"> | |
| 71 | + <div style="font-size: 13px;"> | |
| 72 | + 进 {{zdzName}} | |
| 73 | + </div> | |
| 74 | + </div> | |
| 75 | + </script> | |
| 76 | + | |
| 77 | + <script id="sch-table-ldks-tootip-temp" type="text/html"> | |
| 78 | + <div class="tl-tip-panel"> | |
| 79 | + <div style="font-size: 13px;"> | |
| 80 | + {{qdzName}} 空驶至 {{zdzName}} | |
| 81 | + </div> | |
| 82 | + </div> | |
| 83 | + </script> | |
| 84 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/line_schedule/car_info_all.html
0 → 100644
| 1 | +<div class="uk-modal ct_move_modal" id="sch_car_info_all-modal"> | |
| 2 | + <div class="uk-modal-dialog" style="width: 1080px;"> | |
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | |
| 4 | + | |
| 5 | + <div class="uk-modal-header"> | |
| 6 | + <h2><span class="line_name_span"></span> -全部车辆</h2></div> | |
| 7 | + | |
| 8 | + <table class="uk-table uk-table-hover" style="table-layout: fixed;"> | |
| 9 | + <thead> | |
| 10 | + <tr> | |
| 11 | + <th style="width: 10%;">车辆</th> | |
| 12 | + <th style="width: 10%;">设备号</th> | |
| 13 | + <th style="width: 16%;">位置</th> | |
| 14 | + <th style="width: 14%;">车载线路编码</th> | |
| 15 | + <th style="width: 13%;">当前执行任务</th> | |
| 16 | + <th style="width: 7%;">状态</th> | |
| 17 | + <th style="width: 19%">最后gps时间</th> | |
| 18 | + <th>请求出场</th> | |
| 19 | + </tr> | |
| 20 | + </thead> | |
| 21 | + <tbody> | |
| 22 | + </tbody> | |
| 23 | + </table> | |
| 24 | + </div> | |
| 25 | + | |
| 26 | + <script id="sch_car_info_all-temp" type="text/html"> | |
| 27 | + {{each list as obj i}} | |
| 28 | + <tr data-nbbm="{{obj.nbbm}}"> | |
| 29 | + <td>{{obj.nbbm}}</td> | |
| 30 | + <td>{{obj.device}}</td> | |
| 31 | + <td>{{obj.loc}}</td> | |
| 32 | + <td>{{obj.lineCodeRealStr}}</td> | |
| 33 | + <td><a class="exec_sch_link" data-id="{{obj.schId}}">{{obj.exec}}</a></td> | |
| 34 | + <td><a class="{{if obj.status!='在线'}}grey_link{{/if}}">{{obj.status}}</a></td> | |
| 35 | + <td class="{{if obj.status!='在线'}}grey_link{{/if}}"> | |
| 36 | + {{obj.timeStr}} | |
| 37 | + | |
| 38 | + {{if obj.formNow!=null}} | |
| 39 | + <small>({{obj.formNow}})</small> | |
| 40 | + {{/if}} | |
| 41 | + </td> | |
| 42 | + <td>{{obj.qqccTimeStr}}</td> | |
| 43 | + </tr> | |
| 44 | + {{/each}} | |
| 45 | + </script> | |
| 46 | + <script> | |
| 47 | + (function () { | |
| 48 | + var modal = '#sch_car_info_all-modal', lineCode, nbbm; | |
| 49 | + | |
| 50 | + $(modal).on('init', function(e, data) { | |
| 51 | + e.stopPropagation(); | |
| 52 | + lineCode = data.lineCode; | |
| 53 | + nbbm = data.nbbm; | |
| 54 | + | |
| 55 | + $('.line_name_span', modal).html(gb_data_basic.lineCode2NameAll()[lineCode]); | |
| 56 | + jsDoQuery(function () { | |
| 57 | + var $cell = $('tr[data-nbbm='+nbbm+']', modal); | |
| 58 | + //定位到行 | |
| 59 | + $(modal).animate({ | |
| 60 | + scrollTop: $cell.offset().top - $(modal).offset().top + $(modal).scrollTop() | |
| 61 | + }, 500, function () { | |
| 62 | + $cell.addClass('ct_active'); | |
| 63 | + }); | |
| 64 | + timer = setTimeout(fixedRefreshData, t + 500); | |
| 65 | + }); | |
| 66 | + }); | |
| 67 | + | |
| 68 | + var timer, t = 12*1000; | |
| 69 | + var fixedRefreshData = function () { | |
| 70 | + (function () { | |
| 71 | + var f = arguments.callee; | |
| 72 | + jsDoQuery(function () { | |
| 73 | + timer = setTimeout(f, t); | |
| 74 | + }); | |
| 75 | + })(); | |
| 76 | + }; | |
| 77 | + | |
| 78 | + $(modal).on('hide.uk.modal', function () { | |
| 79 | + clearTimeout(timer); | |
| 80 | + timer = null; | |
| 81 | + }); | |
| 82 | + | |
| 83 | + var jsDoQuery = function (cb) { | |
| 84 | + gb_common.$get('/freeLogin/gps/allCarsByLine', {lineCode: lineCode}, function (rs) { | |
| 85 | + $.each(rs.list, function () { | |
| 86 | + if(this['lineCodeReal']) | |
| 87 | + this['lineCodeRealStr'] = this['lineCodeReal'] + '/' + gb_data_basic.lineCode2NameAll()[this['lineCodeReal']]; | |
| 88 | + else | |
| 89 | + this['lineCodeRealStr'] = ''; | |
| 90 | + if(this['gpsTs']){ | |
| 91 | + this['timeStr'] = moment(this['gpsTs']).format('MM/DD HH:mm:ss'); | |
| 92 | + this['formNow'] = moment(this['gpsTs']).fromNow(); | |
| 93 | + } | |
| 94 | + if(this['qqcc']) | |
| 95 | + this['qqccTimeStr'] = moment(this['qqcc']).format('HH:mm'); | |
| 96 | + }); | |
| 97 | + | |
| 98 | + rs.list.sort(function (a, b) { | |
| 99 | + if(!a.nbbm) | |
| 100 | + return -1; | |
| 101 | + if(!b.nbbm) | |
| 102 | + return 1; | |
| 103 | + return a.nbbm.localeCompare(b.nbbm); | |
| 104 | + }); | |
| 105 | + var htmlStr = template('sch_car_info_all-temp', {list: rs.list}); | |
| 106 | + | |
| 107 | + $('table>tbody', modal).html(htmlStr); | |
| 108 | + | |
| 109 | + cb && cb(); | |
| 110 | + }); | |
| 111 | + }; | |
| 112 | + | |
| 113 | + $(modal).on('click', 'a.exec_sch_link', function () { | |
| 114 | + var id = $(this).data('id'); | |
| 115 | + if(!id) | |
| 116 | + return; | |
| 117 | + gb_schedule_table.scroToDl({id: id, xlBm:lineCode}); | |
| 118 | + }); | |
| 119 | + })(); | |
| 120 | + </script> | |
| 121 | +</div> | |
| 0 | 122 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v3/fragments/line_schedule/layout.html
0 → 100644
| 1 | +<div> | |
| 2 | + <!-- line schedule tab body layout template --> | |
| 3 | + <script id="cont-line-layout-temp" type="text/html"> | |
| 4 | + <div class="uk-grid top-container"> | |
| 5 | + <div class="uk-width-5-6 uk-grid schedule-wrap"> | |
| 6 | + <div class="uk-width-1-2"> | |
| 7 | + <div class="card-panel"></div> | |
| 8 | + </div> | |
| 9 | + | |
| 10 | + <div class="uk-width-1-2"> | |
| 11 | + <div class="card-panel"></div> | |
| 12 | + </div> | |
| 13 | + </div> | |
| 14 | + <div class="uk-width-1-6" style="height: calc(100% - 1px);position: relative;"> | |
| 15 | + <div class="card-panel sys-mailbox" style="overflow: auto;"> | |
| 16 | + </div> | |
| 17 | + <div class="mileage_elec_panel"> | |
| 18 | + </div> | |
| 19 | + </div> | |
| 20 | + </div> | |
| 21 | + | |
| 22 | + <div class="footer-chart"> | |
| 23 | + <div class="card-panel"> | |
| 24 | + <div class="svg-wrap"></div> | |
| 25 | + </div> | |
| 26 | + </div> | |
| 27 | + </script> | |
| 28 | + | |
| 29 | + <script id="sch-table-top-help-temp" type="text/html"> | |
| 30 | + <div class="tl-tip-panel"> | |
| 31 | + <div class="ct_title"> | |
| 32 | + 图例 | |
| 33 | + </div> | |
| 34 | + <div style="display: inline-block;width: calc(100% - 50px)"> | |
| 35 | + <span class="tl-wd">误点</span> | |
| 36 | + <span class="tl-zzzx">正在执行</span> | |
| 37 | + <span class="tl-qrlb"></span> | |
| 38 | + <span class="tl-yzx">已执行</span> | |
| 39 | + <span class="tl-xxfc">消息发出</span> | |
| 40 | + <span class="tl-xxsd">消息收到</span> | |
| 41 | + <span class="tl-xxrd">消息阅读</span> | |
| 42 | + </div> | |
| 43 | + </div> | |
| 44 | + </script> | |
| 45 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/line_schedule/sch_table.html
0 → 100644
| 1 | +<div> | |
| 2 | + <script id="line-schedule-table-temp" type="text/html"> | |
| 3 | + <div class="schedule-wrap {{if dir==0}}up{{else}}down{{/if}}"> | |
| 4 | + <h3 class="header-title"> | |
| 5 | + {{if dir==0}} | |
| 6 | + {{line.startStationName}} | |
| 7 | + {{else}} | |
| 8 | + {{line.endStationName}} | |
| 9 | + {{/if}} | |
| 10 | + <i class="uk-icon-question-circle uk-icon-hover"></i> | |
| 11 | + <div class="fixed_legend"> | |
| 12 | + <div> | |
| 13 | + <span class="tl-xxfc">消息发出</span> | |
| 14 | + <span class="tl-xxsd">消息收到</span> | |
| 15 | + <span class="tl-xxrd">消息阅读</span> | |
| 16 | + | |
| 17 | + <span class="tl-wd">误点</span> | |
| 18 | + <span class="tl-zzzx">正在执行</span> | |
| 19 | + <span class="tl-qrlb"></span> | |
| 20 | + <span class="tl-yzx">已执行</span> | |
| 21 | + <a> | |
| 22 | + <i class="uk-icon-angle-double-up fixed_legend_close"></i> | |
| 23 | + </a> | |
| 24 | + </div> | |
| 25 | + </div> | |
| 26 | + <i class="uk-icon-eye uk-icon-hover ct_eye_icon"></i> | |
| 27 | + <div class="search_sch_panel"> | |
| 28 | + <form class="uk-form" onsubmit="javascript:return false;"> | |
| 29 | + <div class="uk-autocomplete sch-search-autocom"> | |
| 30 | + <div class="uk-form-icon"> | |
| 31 | + <i class="uk-icon-search"></i> | |
| 32 | + <input type="text" placeholder="搜索"> | |
| 33 | + <i class="cancel uk-icon-times-circle" data-uk-tooltip="{pos:'right'}" title="取消过滤"></i> | |
| 34 | + </div> | |
| 35 | + </div> | |
| 36 | + </form> | |
| 37 | + </div> | |
| 38 | + </h3> | |
| 39 | + <div class="schedule-body"> | |
| 40 | + <div class="ct_table_wrap"> | |
| 41 | + <div class="ct_table line-schedule-table"> | |
| 42 | + <div class="ct_table_head"> | |
| 43 | + <dl> | |
| 44 | + <dt>序号</dt> | |
| 45 | + <dt>路牌</dt> | |
| 46 | + <dt>车辆</dt> | |
| 47 | + <dt>应到</dt> | |
| 48 | + <dt>实到</dt> | |
| 49 | + <dt sort-field>计发</dt> | |
| 50 | + <dt sort-field>待发</dt> | |
| 51 | + <dt>实发</dt> | |
| 52 | + <dt>原因</dt> | |
| 53 | + </dl> | |
| 54 | + </div> | |
| 55 | + <div class="ct_table_body"> | |
| 56 | + {{each list as sch i}} | |
| 57 | + <dl data-id="{{sch.id}}"> | |
| 58 | + <dd class="seq_no">{{i + 1}}</dd> | |
| 59 | + <dd class="lpName"><a>{{sch.lpName}}</a></dd> | |
| 60 | + <dd data-nbbm="{{sch.clZbh}}" | |
| 61 | + class="{{if sch.directiveState == 60}}tl-xxfc{{else if sch.directiveState == 100}}tl-xxsd{{else if sch.directiveState == 200}}tl-xxrd{{/if}}"> | |
| 62 | + {{sch.clZbh}} | |
| 63 | + </dd> | |
| 64 | + <dd>{{sch.qdzArrDatejh}}</dd> | |
| 65 | + <dd>{{sch.qdzArrDatesj}}</dd> | |
| 66 | + <dd data-sort-val={{sch.fcsjT}}> | |
| 67 | + {{sch.fcsj}} | |
| 68 | + {{if sch.bcType == "out"}} | |
| 69 | + <span class="uk-badge uk-badge-success out">出场</span> | |
| 70 | + {{else if sch.bcType == "in"}} | |
| 71 | + <span class="uk-badge uk-badge-warning in">进场</span> | |
| 72 | + {{else if sch.bcType == "venting"}} | |
| 73 | + <span class="uk-badge uk-badge-danger">直放</span> | |
| 74 | + {{else if sch.bcType == "major"}} | |
| 75 | + <span class="uk-badge uk-badge-danger">放站</span> | |
| 76 | + {{else if sch.bcType == "region"}} | |
| 77 | + <span class="uk-badge sch_region">区间</span> | |
| 78 | + {{else if sch.bcType == "ldks"}} | |
| 79 | + <span class="uk-badge sch_ldks">空驶</span> | |
| 80 | + {{/if}} | |
| 81 | + {{if sch.sflj}} | |
| 82 | + <span class="uk-badge uk-badge-danger">临加</span> | |
| 83 | + {{/if}} | |
| 84 | + {{if sch.cTasks.length > 0}} | |
| 85 | + <span class="uk-badge uk-badge-notification c_task {{if sch.c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{sch.cTasks.length}}</span> | |
| 86 | + {{/if}} | |
| 87 | + </dd> | |
| 88 | + <dd data-sort-val={{sch.dfsjT}} dbclick-val="{{sch.dfsj}}"> | |
| 89 | + {{sch.dfsj}} | |
| 90 | + {{if sch.late2}} | |
| 91 | + <span class="late-badge">?+{{sch.lateMinute}}</span> | |
| 92 | + {{/if}} | |
| 93 | + </dd> | |
| 94 | + <dd data-uk-observe class=" | |
| 95 | + {{if sch.status==-1}} | |
| 96 | + tl-qrlb | |
| 97 | + {{else if sch.status==2}} | |
| 98 | + tl-yzx | |
| 99 | + {{else if sch.status==1}} | |
| 100 | + tl-zzzx | |
| 101 | + {{else if sch.status == 0 && sch.late}} | |
| 102 | + tl-wd | |
| 103 | + {{/if}} fcsjActualCell"> | |
| 104 | + {{sch.fcsjActual}}<span class="fcsj-diff">{{sch.fcsj_diff}}</span> | |
| 105 | + </dd> | |
| 106 | + <dd data-uk-observe> | |
| 107 | + <span title="{{sch.remarks}}" | |
| 108 | + data-uk-tooltip="{pos:'top-left'}">{{sch.remarks}}</span> | |
| 109 | + </dd> | |
| 110 | + </dl> | |
| 111 | + {{/each}} | |
| 112 | + </div> | |
| 113 | + </div> | |
| 114 | + </div> | |
| 115 | + </div> | |
| 116 | + </div> | |
| 117 | + </script> | |
| 118 | + | |
| 119 | + <script id="line-schedule-fcsj-temp" type="text/html"> | |
| 120 | + <dd data-sort-val={{fcsjT}}> | |
| 121 | + {{fcsj}} | |
| 122 | + {{if bcType == "out"}} | |
| 123 | + <span class="uk-badge uk-badge-success out">出场</span> | |
| 124 | + {{else if bcType == "in"}} | |
| 125 | + <span class="uk-badge uk-badge-warning in">进场</span> | |
| 126 | + {{else if bcType == "venting"}} | |
| 127 | + <span class="uk-badge uk-badge-danger">直放</span> | |
| 128 | + {{else if bcType == "major"}} | |
| 129 | + <span class="uk-badge uk-badge-danger">放站</span> | |
| 130 | + {{else if bcType == "region"}} | |
| 131 | + <span class="uk-badge sch_region">区间</span> | |
| 132 | + {{else if bcType == "ldks"}} | |
| 133 | + <span class="uk-badge sch_ldks">空驶</span> | |
| 134 | + {{/if}} | |
| 135 | + {{if sflj}} | |
| 136 | + <span class="uk-badge uk-badge-danger">临加</span> | |
| 137 | + {{/if}} | |
| 138 | + {{if cTasks.length > 0}} | |
| 139 | + <span class="uk-badge uk-badge-notification c_task {{if c_t_mileage_status==-1}}c_task_mileage_error{{/if}}">{{cTasks.length}}</span> | |
| 140 | + {{/if}} | |
| 141 | + </dd> | |
| 142 | + </script> | |
| 143 | + | |
| 144 | + <script id="line-schedule-sfsj-temp" type="text/html"> | |
| 145 | + <dd data-uk-observe class=" | |
| 146 | + {{if status==-1}} | |
| 147 | + tl-qrlb | |
| 148 | + {{else if status==2}} | |
| 149 | + tl-yzx | |
| 150 | + {{else if status==1}} | |
| 151 | + tl-zzzx | |
| 152 | + {{else if status == 0 && late}} | |
| 153 | + tl-wd | |
| 154 | + {{/if}} fcsjActualCell"> | |
| 155 | + {{fcsjActual}}<span class="fcsj-diff">{{fcsj_diff}}</span> | |
| 156 | + </dd> | |
| 157 | + </script> | |
| 158 | + | |
| 159 | + <script id="line-schedule-nbbm-temp" type="text/html"> | |
| 160 | + <dd data-nbbm="{{clZbh}}" | |
| 161 | + class="{{if directiveState == 60}}tl-xxfc{{else if directiveState == 100}}tl-xxsd{{else if directiveState == 200}}tl-xxrd{{/if}}"> | |
| 162 | + {{clZbh}} | |
| 163 | + </dd> | |
| 164 | + </script> | |
| 165 | + | |
| 166 | + <script id="sfsj_sch-detail-temp" type="text/html"> | |
| 167 | + <ul class="sfsj-sch-detail"> | |
| 168 | + <li><span>路牌:</span>{{lpName}}</li> | |
| 169 | + <li><span>车辆:</span>{{clZbh}}</li> | |
| 170 | + <li><span>计发:</span>{{fcsj}}</li> | |
| 171 | + <li><span>实发:</span>{{fcsjActual}}</li> | |
| 172 | + <li><span>计达:</span>{{zdsj}}</li> | |
| 173 | + <li><span>实达:</span>{{zdsjActual}}</li> | |
| 174 | + <li><span>驾驶员:</span>{{jGh}}/{{jName}}</li> | |
| 175 | + <li><span>售票员:</span>{{sGh}}/{{sName}}</li> | |
| 176 | + <li><span>终点站:</span>{{zdzName}}</li> | |
| 177 | + </ul> | |
| 178 | + </script> | |
| 179 | + | |
| 180 | + <script id="last-sch-sunken-temp" type="text/html"> | |
| 181 | + <div class="last-sch-sunken"> | |
| 182 | + <span class="_badge">{{zdsj}}/{{zdsjActual}}</span> | |
| 183 | + </div> | |
| 184 | + </script> | |
| 185 | + | |
| 186 | + <script id="sch-lp-mileage-tip-temp" type="text/html"> | |
| 187 | + {{each data as obj i}} | |
| 188 | + {{if i > 0}}<hr>{{/if}} | |
| 189 | + | |
| 190 | + <h5 class="_title"> <span class="lp_name">{{lpName}}</span> <a>{{obj.key}}</a></h5> | |
| 191 | + <div class="LD_item"> | |
| 192 | + <span>营运:<a>{{obj.serviceMileage}}</a></span> | |
| 193 | + <span>烂班:<a>{{obj.destroyMileage}}</a></span> | |
| 194 | + <span>空驶:<a>{{obj.emptyMileage}}</a></span> | |
| 195 | + </div> | |
| 196 | + {{/each}} | |
| 197 | + </script> | |
| 198 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/line_schedule/sys_mailbox.html
0 → 100644
| 1 | +<div> | |
| 2 | + <script id="sys-note-80-temp" type="text/html"> | |
| 3 | + <div class="uk-width-medium-1-1 sys-note-80 sys-mail-item" data-id={{id}} data-schid="{{schId}}"> | |
| 4 | + <div class="uk-panel uk-panel-box uk-panel-box-primary"> | |
| 5 | + <h4 class="uk-panel-title">{{data.nbbm}} {{text}}</h4> | |
| 6 | + <code>{{dateStr}}</code> | |
| 7 | + <div class="uk-button-group"> | |
| 8 | + <button class="uk-button uk-button-mini uk-button-primary">同意</button> | |
| 9 | + <button class="uk-button uk-button-mini reject">不同意</button> | |
| 10 | + <a class="edit_link" data-id="{{schId}}" data-line="{{data.lineId}}" >编辑</a> | |
| 11 | + </div> | |
| 12 | + </div> | |
| 13 | + </div> | |
| 14 | + </script> | |
| 15 | + | |
| 16 | + <script id="sys-note-42-temp" type="text/html"> | |
| 17 | + <div class="uk-width-medium-1-1 sys-note-42 sys-mail-item" id="{{domId}}" data-id="{{t.id}}"> | |
| 18 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | |
| 19 | + <h5 class="title"> | |
| 20 | + {{t.fcsjActual}} {{t.clZbh}} 已由 {{t.qdzName}} 发出,执行班次 {{t.dfsj}} | |
| 21 | + </h5> | |
| 22 | + <code>{{t.fcsjActual}}</code> | |
| 23 | + <div class="uk-button-group"> | |
| 24 | + <a class="uk-button uk-button-mini uk-button-primary" data-line="{{t.xlBm}}">确定</a> | |
| 25 | + <a class="cancel_link" data-id="{{t.id}}" data-line="{{t.xlBm}}"><i class="uk-icon-remove"></i> 撤销</a> | |
| 26 | + </div> | |
| 27 | + </div> | |
| 28 | + </script> | |
| 29 | + | |
| 30 | + <script id="sys-note-42_1-temp" type="text/html"> | |
| 31 | + <div class="uk-width-medium-1-1 sys-note-42 sys-mail-item" id="{{domId}}" data-id="{{t.id}}"> | |
| 32 | + <div class="uk-panel uk-panel-box uk-panel-box-secondary"> | |
| 33 | + <h5 class="title"> | |
| 34 | + {{t.zdsjActual}} {{t.clZbh}} 到达 {{t.zdzName}};已完成 {{finish}} 个班次; | |
| 35 | + {{if nt != null}} | |
| 36 | + 下一发车时间 {{nt.dfsj}};由{{nt.qdzName}} 发往 {{nt.zdzName}};应到{{nt.zdsj}} | |
| 37 | + {{else}} | |
| 38 | + 已完成当日所有班次。 | |
| 39 | + {{/if}} | |
| 40 | + </h5> | |
| 41 | + <code>{{t.zdsjActual}}</code> | |
| 42 | + <div class="uk-button-group"> | |
| 43 | + <a class="uk-button uk-button-mini uk-button-primary" data-line="{{t.xlBm}}">确定</a> | |
| 44 | + <a class="edit_link" data-type="1" data-id="{{t.id}}" data-line="{{t.xlBm}}">编辑</a> | |
| 45 | + <a class="cancel_link" data-type="1" data-id="{{t.id}}" data-line="{{t.xlBm}}"><i class="uk-icon-remove"></i> 撤销</a> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + </div> | |
| 49 | + </script> | |
| 50 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/north/tabs.html
0 → 100644
| 1 | +<div> | |
| 2 | + <script id="north-tabs-temp" type="text/html"> | |
| 3 | + <ul class="uk-tab" data-uk-switcher="{connect:'#main-tab-content', swiping: false}" > | |
| 4 | + <li class="uk-active" ><a>主页</a></li> | |
| 5 | + <li id="north_tabs_map_btn"><a>地图</a></li> | |
| 6 | + {{each list as line i}} | |
| 7 | + <li class="tab-line {{line.destroy==1?'destroy':''}}" data-code="{{line.lineCode}}"><a>{{line.name}}(<span id="badge_untreated_num_{{line.lineCode}}">0</span>, <span id="badge_yfwf_num_{{line.lineCode}}">0</span>)</a></li> | |
| 8 | + {{/each}} | |
| 9 | + </ul> | |
| 10 | + </script> | |
| 11 | + | |
| 12 | + <script id="north-tab-content-temp" type="text/html"> | |
| 13 | + <ul id="main-tab-content" class="uk-switcher uk-margin " > | |
| 14 | + <li class="uk-active home-panel">主页</li> | |
| 15 | + <li class="map-panel">地图未渲染</li> | |
| 16 | + {{each list as line i}} | |
| 17 | + <li class="line_schedule" data-id="{{line.lineCode}}">{{line.name}} 未渲染</li> | |
| 18 | + {{/each}} | |
| 19 | + </ul> | |
| 20 | + </script> | |
| 21 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/fragments/north/toolbar.html
0 → 100644
| 1 | +<div> | |
| 2 | + <script id="north-toolbar-temp" type="text/html"> | |
| 3 | + <div class="uk-margin" id="north_toolbar_panel"> | |
| 4 | + <nav class="uk-navbar"> | |
| 5 | + <!--<a class="uk-navbar-brand" id="navbar_user_detail_link" title="点击切换账号">--> | |
| 6 | + <!--<span><i class="uk-icon-user"></i> <span id="north_toolbar_user">{{user.userName}}</span></span><i class="uk-icon-ellipsis-v"></i>--> | |
| 7 | + <!--</a>--> | |
| 8 | + <ul class="uk-navbar-nav"> | |
| 9 | + {{each list as obj i}} | |
| 10 | + <li class="uk-parent " data-uk-dropdown="{{if obj.columns}}{pos:'top-right'}{{/if}}" aria-haspopup="true" aria-expanded="false"> | |
| 11 | + <a>{{obj.text}} <i class="uk-icon-caret-down"></i></a> | |
| 12 | + {{if obj.children != null}} | |
| 13 | + <div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" style="top: 40px; left: 0px;"> | |
| 14 | + <ul class="uk-nav uk-nav-navbar uk-dropdown-close"> | |
| 15 | + {{each obj.children as c j}} | |
| 16 | + {{if c.header}} | |
| 17 | + <li class="uk-nav-header">{{c.text}}</li> | |
| 18 | + | |
| 19 | + {{else if c.divider}} | |
| 20 | + <li class="uk-nav-divider"></li> | |
| 21 | + {{else}} | |
| 22 | + <li class="event"><a data-event="{{c.event}}">{{c.text}}</a></li> | |
| 23 | + {{/if}} | |
| 24 | + {{/each}} | |
| 25 | + </ul> | |
| 26 | + </div> | |
| 27 | + {{else if obj.columns}} | |
| 28 | + <div class="uk-dropdown {{obj.clazz}}"> | |
| 29 | + <div class="uk-grid uk-dropdown-grid"> | |
| 30 | + {{each obj.grid as cls s}} | |
| 31 | + <div class="{{obj.cls_class}}"> | |
| 32 | + <ul class="uk-nav uk-nav-dropdown uk-panel uk-dropdown-close"> | |
| 33 | + {{each cls as c z}} | |
| 34 | + {{if c.header}} | |
| 35 | + <li class="uk-nav-header">{{c.text}}</li> | |
| 36 | + | |
| 37 | + {{else if c.divider}} | |
| 38 | + <li class="uk-nav-divider"></li> | |
| 39 | + {{else}} | |
| 40 | + <li class="event"> | |
| 41 | + <a data-event="{{c.event}}"> | |
| 42 | + {{if c.icon != null}} | |
| 43 | + <i class="{{c.icon}}"></i> | |
| 44 | + {{/if}} | |
| 45 | + {{c.text}}</a> | |
| 46 | + </li> | |
| 47 | + {{/if}} | |
| 48 | + {{/each}} | |
| 49 | + </ul> | |
| 50 | + </div> | |
| 51 | + {{/each}} | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + {{/if}} | |
| 55 | + </li> | |
| 56 | + {{/each}} | |
| 57 | + </ul> | |
| 58 | + <a class="uk-navbar-brand op-beijingtime-time" > | |
| 59 | + <span></span> | |
| 60 | + </a> | |
| 61 | + <div class="uk-navbar-content uk-navbar-flip uk-hidden-small" style="padding-left: 0;"> | |
| 62 | + <div class="uk-button-group"> | |
| 63 | + <button class="uk-button uk-button-danger exit-system">退出线调</button> | |
| 64 | + </div> | |
| 65 | + </div> | |
| 66 | + </nav> | |
| 67 | + </div> | |
| 68 | + </script> | |
| 69 | + | |
| 70 | + <script id="north-toolbar-electron-temp" type="text/html"> | |
| 71 | + <div class="uk-margin" id="north_toolbar_panel"> | |
| 72 | + <nav class="uk-navbar"> | |
| 73 | + <a class="uk-navbar-brand" > | |
| 74 | + <span><i class="uk-icon-user"></i> <span id="north_toolbar_user">{{user.userName}}</span>,在线</span><i class="uk-icon-ellipsis-v"></i> | |
| 75 | + </a> | |
| 76 | + <ul class="uk-navbar-nav"> | |
| 77 | + {{each list as obj i}} | |
| 78 | + <li class="uk-parent " data-uk-dropdown="{{if obj.columns}}{pos:'top-right'}{{/if}}" aria-haspopup="true" aria-expanded="false"> | |
| 79 | + <a>{{obj.text}} <i class="uk-icon-caret-down"></i></a> | |
| 80 | + {{if obj.children != null}} | |
| 81 | + <div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" style="top: 40px; left: 0px;"> | |
| 82 | + <ul class="uk-nav uk-nav-navbar uk-dropdown-close"> | |
| 83 | + {{each obj.children as c j}} | |
| 84 | + {{if c.header}} | |
| 85 | + <li class="uk-nav-header">{{c.text}}</li> | |
| 86 | + | |
| 87 | + {{else if c.divider}} | |
| 88 | + <li class="uk-nav-divider"></li> | |
| 89 | + {{else}} | |
| 90 | + <li class="event"><a data-event="{{c.event}}">{{c.text}}</a></li> | |
| 91 | + {{/if}} | |
| 92 | + {{/each}} | |
| 93 | + </ul> | |
| 94 | + </div> | |
| 95 | + {{else if obj.columns}} | |
| 96 | + <div class="uk-dropdown {{obj.clazz}}"> | |
| 97 | + <div class="uk-grid uk-dropdown-grid"> | |
| 98 | + {{each obj.grid as cls s}} | |
| 99 | + <div class="{{obj.cls_class}}"> | |
| 100 | + <ul class="uk-nav uk-nav-dropdown uk-panel uk-dropdown-close"> | |
| 101 | + {{each cls as c z}} | |
| 102 | + {{if c.header}} | |
| 103 | + <li class="uk-nav-header">{{c.text}}</li> | |
| 104 | + | |
| 105 | + {{else if c.divider}} | |
| 106 | + <li class="uk-nav-divider"></li> | |
| 107 | + {{else}} | |
| 108 | + <li class="event"> | |
| 109 | + <a data-event="{{c.event}}"> | |
| 110 | + {{if c.icon != null}} | |
| 111 | + <i class="{{c.icon}}"></i> | |
| 112 | + {{/if}} | |
| 113 | + {{c.text}}</a> | |
| 114 | + </li> | |
| 115 | + {{/if}} | |
| 116 | + {{/each}} | |
| 117 | + </ul> | |
| 118 | + </div> | |
| 119 | + {{/each}} | |
| 120 | + </div> | |
| 121 | + </div> | |
| 122 | + {{/if}} | |
| 123 | + </li> | |
| 124 | + {{/each}} | |
| 125 | + </ul> | |
| 126 | + <div class="uk-navbar-content uk-navbar-flip uk-hidden-small" style="padding-left: 0;"> | |
| 127 | + <div class="icon-item" id="mnavbarIconBtnMIN" data-uk-tooltip="{pos:'bottom'}" title="最小化"> | |
| 128 | + <img src="/real_control_v2/assets/imgs/icon/minus.png"> | |
| 129 | + </div> | |
| 130 | + | |
| 131 | + <div class="icon-item" id="mnavbarIconBtnCLOSE" data-uk-tooltip="{pos:'bottom'}" title="退出系统"> | |
| 132 | + <img src="/real_control_v2/assets/imgs/icon/remove.png"> | |
| 133 | + </div> | |
| 134 | + </div> | |
| 135 | + </nav> | |
| 136 | + </div> | |
| 137 | + </script> | |
| 138 | +</div> | ... | ... |
src/main/resources/static/real_control_v3/js/data/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 | + 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 | + if(!activeLines){ | |
| 26 | + var modal = UIkit.modal.blockUI("请选择线路"); | |
| 27 | + window.location.href = '/pages/control/lineallot_v3/iframe_wrap.html'; | |
| 28 | + } | |
| 29 | + var str = ''; | |
| 30 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 31 | + str += (',' + item.lineCode); | |
| 32 | + codeToLine[item.lineCode] = item; | |
| 33 | + } | |
| 34 | + return str.substr(1); | |
| 35 | + })(); | |
| 36 | + | |
| 37 | + //站点路由 | |
| 38 | + gb_common.$get('/freeLogin/stationroute/multiLine', {lineIds: line_idx}, function (rs) { | |
| 39 | + var list = rs.list;//JSON.parse(rs.list); | |
| 40 | + var routeData = gb_common.groupBy(list, 'lineCode'); | |
| 41 | + //排序 | |
| 42 | + for (var lineCode in routeData) { | |
| 43 | + routeData[lineCode].sort(stationRouteSort); | |
| 44 | + } | |
| 45 | + ep.emit('stationRoutes', routeData); | |
| 46 | + }); | |
| 47 | + | |
| 48 | + //线路标准信息 | |
| 49 | + gb_common.$get('/freeLogin/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) { | |
| 50 | + var informations = {}; | |
| 51 | + $.each(rs, function () { | |
| 52 | + informations[this.line.lineCode] = this; | |
| 53 | + delete this['line']; | |
| 54 | + }); | |
| 55 | + ep.emit('lineInformations', informations); | |
| 56 | + }); | |
| 57 | + | |
| 58 | + //人员信息 | |
| 59 | + loadAllPersonnel(function (data) { | |
| 60 | + ep.emit('all_personnel', data); | |
| 61 | + }); | |
| 62 | + function loadAllPersonnel(cb) { | |
| 63 | + $.get('/freeLogin/basic/all_personnel_py', function (rs) { | |
| 64 | + //转换成自动补全组件需要的数据 | |
| 65 | + var data = [], code; | |
| 66 | + for(var i =0, p; p = rs[i++];){ | |
| 67 | + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId']; | |
| 68 | + data.push({ | |
| 69 | + value: code + '/' + p.name, | |
| 70 | + fullChars: p.fullChars.toUpperCase(), | |
| 71 | + camelChars: p.camelChars.toUpperCase() | |
| 72 | + }); | |
| 73 | + } | |
| 74 | + cb && cb(data); | |
| 75 | + }); | |
| 76 | + } | |
| 77 | + | |
| 78 | + var carparks = {}; | |
| 79 | + //停车场数据 | |
| 80 | + gb_common.$get('/freeLogin/realMap/carParkSpatialData', {}, function (rs) { | |
| 81 | + rs.list.sort(function (a, b) { | |
| 82 | + return a.parkName.localeCompare(b.parkName); | |
| 83 | + }); | |
| 84 | + $.each(rs.list, function () { | |
| 85 | + carparks[this.parkCode] = this; | |
| 86 | + }); | |
| 87 | + }); | |
| 88 | + | |
| 89 | + //车辆数据 | |
| 90 | + var carsArray; | |
| 91 | + $.get('/freeLogin/basic/cars?t=' + Math.random(), function (rs) { | |
| 92 | + carsArray = rs; | |
| 93 | + }); | |
| 94 | + | |
| 95 | + var getCarparkByCode = function (code) { | |
| 96 | + return carparks[code]; | |
| 97 | + }; | |
| 98 | + | |
| 99 | + //line code to name | |
| 100 | + $.get('/freeLogin/basic/lineCode2Name', function (rs) { | |
| 101 | + ep.emit('lineCode2Name', rs); | |
| 102 | + }); | |
| 103 | + | |
| 104 | + //nbbm to device id | |
| 105 | + $.get('/freeLogin/basic/nbbm2deviceId', function (rs) { | |
| 106 | + ep.emit('nbbm2deviceId', rs); | |
| 107 | + }); | |
| 108 | + //nbbm to 车牌号 | |
| 109 | + var nbbm2PlateMap; | |
| 110 | + $.get('/freeLogin/basic/nbbm2PlateNo', function (rs) { | |
| 111 | + nbbm2PlateMap = rs; | |
| 112 | + }); | |
| 113 | + | |
| 114 | + //模拟图属性数据 | |
| 115 | + gb_common.$get('/freeLogin/realSchedule/svgAttr', {idx: line_idx}, function (rs) { | |
| 116 | + var data = {}; | |
| 117 | + $.each(rs.list, function () { | |
| 118 | + this.hideStations = JSON.parse(this.hideStations); | |
| 119 | + this.nicknames = JSON.parse(this.nicknames); | |
| 120 | + data[this.lineCode] = this; | |
| 121 | + }); | |
| 122 | + ep.emit('svg_attrs', data); | |
| 123 | + }); | |
| 124 | + | |
| 125 | + //站点和停车场历时、公里对照数据 | |
| 126 | + var stat_park_data; | |
| 127 | + var load_stat_park_data = function () { | |
| 128 | + $.get('/freeLogin/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | |
| 129 | + stat_park_data = rs; | |
| 130 | + }); | |
| 131 | + } | |
| 132 | + load_stat_park_data(); | |
| 133 | + | |
| 134 | + function findLineByCodes(codeArr) { | |
| 135 | + var rs = []; | |
| 136 | + $.each(codeArr, function () { | |
| 137 | + rs.push(codeToLine[this]); | |
| 138 | + }); | |
| 139 | + return rs; | |
| 140 | + } | |
| 141 | + | |
| 142 | + var findCodeByLinename = function (name) { | |
| 143 | + for (var code in lineCode2NameAll) { | |
| 144 | + if (name == lineCode2NameAll[code]) | |
| 145 | + return code; | |
| 146 | + } | |
| 147 | + | |
| 148 | + return null; | |
| 149 | + }; | |
| 150 | + | |
| 151 | + var getLineInformation = function (lineCode) { | |
| 152 | + return lineInformations[lineCode]; | |
| 153 | + }; | |
| 154 | + | |
| 155 | + var stationRouteSort = function (a, b) { | |
| 156 | + return a.stationRouteCode - b.stationRouteCode; | |
| 157 | + }; | |
| 158 | + | |
| 159 | + /** | |
| 160 | + * 常用的备注补全列表 | |
| 161 | + */ | |
| 162 | + var remarksArray = ['保养', '故障', '肇事', '加油', '维修', '援外', '路阻' | |
| 163 | + , '故障(离合器坏)', '故障,(方向盘坏)', '故障(排挡坏)', '故障(门坏)', '故障(雨刮器坏)','故障(刹车坏)', '故障(气打不上)' | |
| 164 | + ,'故障(整车无电)', '故障(故障灯常亮)', '故障(警报灯亮)', '故障(玻璃坏)', '故障(反光镜坏)', '故障(发电机坏)', '故障(漏防冻液)' | |
| 165 | + , '故障(漏水)','故障(轮胎坏)', '故障(无动力)', '故障(喷机油)', '故障(水温高)', '保养(一级保养)' | |
| 166 | + , '保养(二级保养)', '保养(三级保养)', '换车出场', '临加进场', '临加出场']; | |
| 167 | + var remarksMapps = []; | |
| 168 | + $.each(remarksArray, function (i, t) { | |
| 169 | + remarksMapps.push({ | |
| 170 | + value: t, | |
| 171 | + fullChars: pinyin.getFullChars(t).toUpperCase(), | |
| 172 | + camelChars: pinyin.getCamelChars(t) | |
| 173 | + }); | |
| 174 | + }); | |
| 175 | + | |
| 176 | + //文件载入完毕 | |
| 177 | + res_load_ep.emitLater('load_data_basic'); | |
| 178 | + | |
| 179 | + return { | |
| 180 | + activeLines: activeLines, | |
| 181 | + line_idx: line_idx, | |
| 182 | + codeToLine: codeToLine, | |
| 183 | + nbbm2deviceMap: function () { | |
| 184 | + return nbbm2deviceMap; | |
| 185 | + }, | |
| 186 | + device2nbbmMap: function () { | |
| 187 | + return device2nbbmMap; | |
| 188 | + }, | |
| 189 | + getLineInformation: getLineInformation, | |
| 190 | + allInformations: function () { | |
| 191 | + return lineInformations; | |
| 192 | + }, | |
| 193 | + stationRoutes: function (lineCode) { | |
| 194 | + return stationRoutes[lineCode] | |
| 195 | + }, | |
| 196 | + findLineByCodes: findLineByCodes, | |
| 197 | + lineCode2NameAll: function () { | |
| 198 | + return lineCode2NameAll | |
| 199 | + }, | |
| 200 | + allPersonnel: function () { | |
| 201 | + return allPersonnel; | |
| 202 | + }, | |
| 203 | + findCodeByLinename: findCodeByLinename, | |
| 204 | + getCarparkByCode: getCarparkByCode, | |
| 205 | + getSvgAttr: function (lineCode) { | |
| 206 | + return svgAttrs[lineCode]; | |
| 207 | + }, | |
| 208 | + setSvgAttr: function (attr) { | |
| 209 | + attr.hideStations = JSON.parse(attr.hideStations); | |
| 210 | + attr.nicknames = JSON.parse(attr.nicknames); | |
| 211 | + svgAttrs[attr.lineCode] = attr; | |
| 212 | + }, | |
| 213 | + //是否是环线 | |
| 214 | + isLoopLine: function (lineCode) { | |
| 215 | + if(!stationRoutes[lineCode]) | |
| 216 | + return false; | |
| 217 | + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions'); | |
| 218 | + //下行只有2个站点 | |
| 219 | + var len = data[0].length; | |
| 220 | + if (len > 0 && data[1].length == 2) { | |
| 221 | + var first = data[0][0], | |
| 222 | + end = data[0][len - 1]; | |
| 223 | + | |
| 224 | + /*if(first.stationName != end.stationName) | |
| 225 | + return false;*/ | |
| 226 | + | |
| 227 | + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx} | |
| 228 | + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx}; | |
| 229 | + | |
| 230 | + //并且上行起终点距离200米内 | |
| 231 | + if (geolib.getDistance(fPoint, ePoint) < 200) { | |
| 232 | + return true; | |
| 233 | + } | |
| 234 | + } | |
| 235 | + | |
| 236 | + return false; | |
| 237 | + }, | |
| 238 | + //刷新员工信息 | |
| 239 | + refreshAllPersonnel: function (cb) { | |
| 240 | + loadAllPersonnel(function (data) { | |
| 241 | + allPersonnel = data; | |
| 242 | + cb && cb(); | |
| 243 | + }); | |
| 244 | + }, | |
| 245 | + nbbm2PlateMap: function () { | |
| 246 | + return nbbm2PlateMap; | |
| 247 | + }, | |
| 248 | + carsArray: function () { | |
| 249 | + return carsArray; | |
| 250 | + }, | |
| 251 | + simpleParksArray: function () { | |
| 252 | + var map = {}; | |
| 253 | + for(var code in carparks) | |
| 254 | + map[code] = carparks[code].parkName; | |
| 255 | + return map; | |
| 256 | + }, | |
| 257 | + remarksMapps: function () { | |
| 258 | + return remarksMapps; | |
| 259 | + }, | |
| 260 | + get_stat_park_data: function () { | |
| 261 | + return stat_park_data; | |
| 262 | + }, | |
| 263 | + reload_stat_park_data: function () { | |
| 264 | + load_stat_park_data(); | |
| 265 | + } | |
| 266 | + }; | |
| 267 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/js/data/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: '/freeLogin/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.gpsList, 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, rs.overspeedList); | |
| 73 | + }); | |
| 74 | + | |
| 75 | + //超速数据回调 | |
| 76 | + //console.log('超速,,,', rs.overspeedList); | |
| 77 | + | |
| 78 | + }; | |
| 79 | + | |
| 80 | + var startFixedTime; | |
| 81 | + var fixedTimeRefresh = function () { | |
| 82 | + if (startFixedTime) | |
| 83 | + return; | |
| 84 | + startFixedTime = true; | |
| 85 | + | |
| 86 | + (function () { | |
| 87 | + var f = arguments.callee; | |
| 88 | + refresh(function () { | |
| 89 | + setTimeout(f, delay); | |
| 90 | + }); | |
| 91 | + })(); | |
| 92 | + }; | |
| 93 | + | |
| 94 | + var gpsByLineCode = function (lineCode) { | |
| 95 | + var rs = []; | |
| 96 | + for (var device in realData) { | |
| 97 | + if (realData[device].lineId == lineCode) | |
| 98 | + rs.push(realData[device]); | |
| 99 | + } | |
| 100 | + return rs; | |
| 101 | + }; | |
| 102 | + | |
| 103 | + var findOne = function (deviceId) { | |
| 104 | + return realData[deviceId]; | |
| 105 | + }; | |
| 106 | + | |
| 107 | + var findGpsByNbbm = function (nbbm) { | |
| 108 | + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]]; | |
| 109 | + }; | |
| 110 | + | |
| 111 | + /** | |
| 112 | + * 设备掉线事件 | |
| 113 | + */ | |
| 114 | + var deviceOffline = function (gps) { | |
| 115 | + $.each(offlineCallbacks, function (i, cb) { | |
| 116 | + cb(gps); | |
| 117 | + }); | |
| 118 | + }; | |
| 119 | + | |
| 120 | + //注册掉线事件回调函数 | |
| 121 | + var offlineCallbacks = []; | |
| 122 | + var registerOfflineCb = function (cb) { | |
| 123 | + if (cb) | |
| 124 | + offlineCallbacks.push(cb); | |
| 125 | + }; | |
| 126 | + | |
| 127 | + return { | |
| 128 | + fixedTimeRefresh: fixedTimeRefresh, | |
| 129 | + registerCallback: registerCallback, | |
| 130 | + allGps: realData, | |
| 131 | + gpsByLineCode: gpsByLineCode, | |
| 132 | + findOne: findOne, | |
| 133 | + findGpsByNbbm: findGpsByNbbm, | |
| 134 | + deviceOffline: deviceOffline, | |
| 135 | + registerOfflineCb: registerOfflineCb | |
| 136 | + }; | |
| 137 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/js/data/data_line_config.js
0 → 100644
| 1 | +/** | |
| 2 | + * 线路配置信息 | |
| 3 | + * @type {{}} | |
| 4 | + */ | |
| 5 | +var gb_data_line_config = (function () { | |
| 6 | + | |
| 7 | + var lineConfigMap; | |
| 8 | + | |
| 9 | + var storage = window.localStorage; | |
| 10 | + var activeLines = JSON.parse(storage.getItem('lineControlItems')); | |
| 11 | + var line_idx = (function () { | |
| 12 | + var str = ''; | |
| 13 | + for (var i = 0, item; item = activeLines[i++];) { | |
| 14 | + str += (',' + item.lineCode); | |
| 15 | + } | |
| 16 | + return str.substr(1); | |
| 17 | + })(); | |
| 18 | + | |
| 19 | + gb_common.$get('/freeLogin/lineConfig/findByIdx', {idx: line_idx}, function (rs) { | |
| 20 | + lineConfigMap = {}; | |
| 21 | + $.each(rs.list, function () { | |
| 22 | + lineConfigMap[this.line.lineCode] = this; | |
| 23 | + }); | |
| 24 | + | |
| 25 | + console.log('lineConfigMap', lineConfigMap); | |
| 26 | + }); | |
| 27 | + | |
| 28 | + return { | |
| 29 | + get: function (lineCode) { | |
| 30 | + return lineConfigMap[lineCode]; | |
| 31 | + } | |
| 32 | + }; | |
| 33 | +})(); | |
| 0 | 34 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v3/js/data/gps_abnormal.js
0 → 100644
| 1 | +/** gps 信号异常状态,无效 | 越界 | 超速 | |
| 2 | + * | |
| 3 | + * | |
| 4 | + * ########### 这个文件被废弃 ############## | |
| 5 | + * | |
| 6 | + * 前端计算略微有点卡顿, 交由后端计算 | |
| 7 | + * */ | |
| 8 | + | |
| 9 | +var gb_gps_abnormal = (function () { | |
| 10 | + | |
| 11 | + //按线路分组的路段数据 | |
| 12 | + var allRoads; | |
| 13 | + | |
| 14 | + //gps无效 | |
| 15 | + var gpsInvalid = function (gps) { | |
| 16 | + return gps.lat == 0 || gps.lon == 0; | |
| 17 | + }; | |
| 18 | + | |
| 19 | + //越界 | |
| 20 | + var threshold = 120; | |
| 21 | + var gpsOutOfBounds = function (gps) { | |
| 22 | + //进场班次不管 | |
| 23 | + if (gps.sch && gps.sch.bcType == 'in') | |
| 24 | + return; | |
| 25 | + | |
| 26 | + var roads = allRoads[gps.lineId + '_' + gps.upDown]; | |
| 27 | + if (!roads) | |
| 28 | + return; | |
| 29 | + | |
| 30 | + //最短距离 | |
| 31 | + var min, distance; | |
| 32 | + $.each(roads, function () { | |
| 33 | + distance = minDistanceFromRoad(this.pos, gps); | |
| 34 | + if (!min || min > distance) | |
| 35 | + min = distance; | |
| 36 | + }); | |
| 37 | + | |
| 38 | + //越界阈值 120米 | |
| 39 | + if (min > threshold) { | |
| 40 | + gps.abnormal = 'outBounds'; | |
| 41 | + gps.outBoundsDistance = min; | |
| 42 | + return true; | |
| 43 | + } | |
| 44 | + }; | |
| 45 | + | |
| 46 | + | |
| 47 | + //线路限速数据 | |
| 48 | + var lineSpeedLimit = {}; | |
| 49 | + //超速 | |
| 50 | + var overspeed = function (gps) { | |
| 51 | + | |
| 52 | + }; | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 初始化数据 | |
| 56 | + */ | |
| 57 | + var initData = function () { | |
| 58 | + //获取线路路段数据 | |
| 59 | + gb_common.$get('/freeLogin/realMap/multiSectionRoute', {codeIdx: gb_data_basic.line_idx}, function (rs) { | |
| 60 | + var list = []; | |
| 61 | + $.each(rs.section, function () { | |
| 62 | + list.push({ | |
| 63 | + line: this['LINE_CODE'], | |
| 64 | + updown: this['DIRECTIONS'], | |
| 65 | + pos: parseCoords(this['GSECTION_VECTOR']), | |
| 66 | + route_code: this['SECTIONROUTE_CODE'], | |
| 67 | + code: this['SECTION_CODE'], | |
| 68 | + name: this['SECTION_NAME'] | |
| 69 | + }); | |
| 70 | + }); | |
| 71 | + //按线路_走向 分组数据 | |
| 72 | + allRoads = groupByLineAndUpdown(list); | |
| 73 | + }); | |
| 74 | + | |
| 75 | + //线路限速数据 | |
| 76 | + var infos = gb_data_basic.allInformations(); | |
| 77 | + for (var lineCode in infos) { | |
| 78 | + lineSpeedLimit[lineCode] = infos[lineCode].speedLimit == null ? 70 : infos[lineCode].speedLimit; | |
| 79 | + } | |
| 80 | + | |
| 81 | + console.log('lineSpeedLimit', lineSpeedLimit); | |
| 82 | + }; | |
| 83 | + | |
| 84 | + function minDistanceFromRoad(pos, gps) { | |
| 85 | + var distance, min; | |
| 86 | + var len = pos.length - 1; | |
| 87 | + for (var i = 0; i < len; i++) { | |
| 88 | + distance = geolib.getDistanceFromLine({ | |
| 89 | + latitude: gps.lat, | |
| 90 | + longitude: gps.lon | |
| 91 | + }, pos[i], pos[i + 1]); | |
| 92 | + | |
| 93 | + if (!min || min > distance) | |
| 94 | + min = distance; | |
| 95 | + | |
| 96 | + if (distance <= threshold) | |
| 97 | + return threshold; | |
| 98 | + } | |
| 99 | + | |
| 100 | + return min; | |
| 101 | + } | |
| 102 | + | |
| 103 | + function groupByLineAndUpdown(list) { | |
| 104 | + var rs = {}, | |
| 105 | + key; | |
| 106 | + $.each(list, function () { | |
| 107 | + key = this.line + '_' + this.updown; | |
| 108 | + if (!rs[key]) | |
| 109 | + rs[key] = []; | |
| 110 | + | |
| 111 | + rs[key].push(this); | |
| 112 | + }); | |
| 113 | + | |
| 114 | + return rs; | |
| 115 | + } | |
| 116 | + | |
| 117 | + function parseCoords(str) { | |
| 118 | + var array = str.substr(11, str.length - 2).split(','), rs = [], temps; | |
| 119 | + $.each(array, function (i, coords) { | |
| 120 | + temps = coords.split(' '); | |
| 121 | + rs.push({ | |
| 122 | + latitude: parseFloat(temps[1]), | |
| 123 | + longitude: parseFloat(temps[0]) | |
| 124 | + }); | |
| 125 | + }); | |
| 126 | + | |
| 127 | + return rs; | |
| 128 | + } | |
| 129 | + | |
| 130 | + return { | |
| 131 | + initData: initData, | |
| 132 | + check: function (gps) { | |
| 133 | + if (!allRoads || gps.instation == 2) { | |
| 134 | + return; | |
| 135 | + } | |
| 136 | + | |
| 137 | + //越界判定 | |
| 138 | + gpsOutOfBounds(gps); | |
| 139 | + } | |
| 140 | + } | |
| 141 | +})(); | |
| 0 | 142 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v3/js/data/json/north_toolbar.json
0 → 100644
src/main/resources/static/real_control_v3/js/forms/wrap.html
0 → 100644
| 1 | +<html> | |
| 2 | +<head> | |
| 3 | + <!-- Bootstrap style --> | |
| 4 | + <link href="/metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/> | |
| 5 | + <!-- METRONIC style --> | |
| 6 | + <link href="/metronic_v4.5.4/layout4/css/themes/light.min.css" rel="stylesheet" type="text/css" id="style_color"/> | |
| 7 | + <link href="/metronic_v4.5.4/css/components.css" rel="stylesheet" type="text/css"/> | |
| 8 | + <link href="/metronic_v4.5.4/css/plugins.css" rel="stylesheet" type="text/css"/> | |
| 9 | + <link href="/metronic_v4.5.4/layout4/css/layout.min.css" rel="stylesheet" type="text/css"/> | |
| 10 | + <!-- select2 下拉框插件 --> | |
| 11 | + <link href="/metronic_v4.5.4/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css"/> | |
| 12 | + <link href="/metronic_v4.5.4/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css"/> | |
| 13 | + <!-- iCheck 单选框和复选框 --> | |
| 14 | + <link href="/metronic_v4.5.4/plugins/icheck/skins/all.css" rel="stylesheet" type="text/css"/> | |
| 15 | + <!-- 日期控件 --> | |
| 16 | + <link href="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/css/bootstrap-datetimepicker.min.css" | |
| 17 | + rel="stylesheet" type="text/css"/> | |
| 18 | + <!-- layer 弹层 插件 --> | |
| 19 | + <link href="/assets/plugins/layer-v2.4/layer/skin/layer.css" | |
| 20 | + rel="stylesheet" type="text/css" /> | |
| 21 | + | |
| 22 | + <!-- jQuery --> | |
| 23 | + <script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | |
| 24 | + <script src="/assets/plugins/pinyin.js"></script> | |
| 25 | + <!-- select2 下拉框 --> | |
| 26 | + <script src="/metronic_v4.5.4/plugins/select2/js/select2.full.min.js"></script> | |
| 27 | + <!-- moment.js 日期处理类库 --> | |
| 28 | + <script src="/assets/plugins/moment-with-locales.js"></script> | |
| 29 | + <!-- 日期控件 --> | |
| 30 | + <script src="/metronic_v4.5.4/plugins/bootstrap-datetimepicker-2/js/bootstrap-datetimepicker.min.js"></script> | |
| 31 | + <!-- art-template 模版引擎 --> | |
| 32 | + <script src="/assets/plugins/template.js"></script> | |
| 33 | + <script src="/pages/forms/statement/js/jquery.PrintArea.js"></script> | |
| 34 | + <!-- layer 弹层 --> | |
| 35 | + <script src="/assets/plugins/layer-v2.4/layer/layer.js" ></script> | |
| 36 | + | |
| 37 | + <style> | |
| 38 | + body{ | |
| 39 | + background: #fff; | |
| 40 | + } | |
| 41 | + .form-page-content>.page-head{ | |
| 42 | + display: none !important; | |
| 43 | + } | |
| 44 | + | |
| 45 | + .form-page-content .portlet{ | |
| 46 | + margin-bottom: 0px !important; | |
| 47 | + } | |
| 48 | + | |
| 49 | + .row{ | |
| 50 | + margin-left: 0 !important; | |
| 51 | + margin-right: 0 !important; | |
| 52 | + } | |
| 53 | + | |
| 54 | + .row .col-md-12{ | |
| 55 | + padding-left: 0 !important; | |
| 56 | + } | |
| 57 | + | |
| 58 | + .portlet{ | |
| 59 | + padding-top: 0 !important; | |
| 60 | + padding-left: 0 !important; | |
| 61 | + } | |
| 62 | + | |
| 63 | + .form-page-content .portlet>.portlet-title{ | |
| 64 | + position: fixed; | |
| 65 | + width: 100%; | |
| 66 | + background: #ffffff; | |
| 67 | + z-index: 9; | |
| 68 | + padding-top: 12px; | |
| 69 | + margin-top: -2px; | |
| 70 | + box-shadow: 0px 4px 2px 0 rgba(225, 225, 225, 0.2), 0px 4px 9px 0 rgba(139, 135, 135, 0.19); | |
| 71 | + border-bottom: 1px solid #dbdbdb; | |
| 72 | + } | |
| 73 | + | |
| 74 | + .form-page-content .portlet.light .portlet-body{ | |
| 75 | + padding-top: 8px; | |
| 76 | + margin-top: 55px; | |
| 77 | + } | |
| 78 | + </style> | |
| 79 | +</head> | |
| 80 | +<body> | |
| 81 | + | |
| 82 | +<div class="form-page-content"> | |
| 83 | +</div> | |
| 84 | + | |
| 85 | +<script> | |
| 86 | + (function () { | |
| 87 | + var storage = window.localStorage; | |
| 88 | + var key = 'real_control_form_embed_pageUrl'; | |
| 89 | + //加载表单片段 | |
| 90 | + var pageUrl = storage.getItem(key); | |
| 91 | + if (!pageUrl) { | |
| 92 | + alert('失败,缺少片段路径!'); | |
| 93 | + return; | |
| 94 | + } | |
| 95 | + storage.removeItem(key); | |
| 96 | + $('.form-page-content').load(pageUrl, function () { | |
| 97 | + //限制日期 | |
| 98 | + var d = moment(top.gb_second_timer.now()), | |
| 99 | + f='YYYY-MM-DD'; | |
| 100 | + //ed=d.format(f), | |
| 101 | + //sd=d.subtract(3, 'days').format(f); | |
| 102 | + | |
| 103 | + try{ | |
| 104 | + $('#date', '.form-page-content').data('DateTimePicker') | |
| 105 | + .defaultDate(d.format(f)); | |
| 106 | + //.maxDate(ed).minDate(sd); | |
| 107 | + }catch (e){ | |
| 108 | + console.log(e); | |
| 109 | + } | |
| 110 | + | |
| 111 | + if($("#ddrbBody").length > 0){ | |
| 112 | + $("#ddrbBody").height("620px"); | |
| 113 | + } | |
| 114 | + | |
| 115 | + //去掉公司和分公司选项 | |
| 116 | + var company = $('select[name=company]', '.form-page-content'); | |
| 117 | + var subCompany = $('select[name=subCompany]', '.form-page-content'); | |
| 118 | + if(company.length > 0){ | |
| 119 | + company.parent().remove(); | |
| 120 | + } | |
| 121 | + if(subCompany.length > 0){ | |
| 122 | + subCompany.parent().remove(); | |
| 123 | + } | |
| 124 | + | |
| 125 | + //重新构造线路下拉框 | |
| 126 | + //var lineSelect = $('select[name=line]', '.form-page-content'); | |
| 127 | + //lineSelect.select2('destory').html(''); | |
| 128 | + //initPinYinSelect2(lineSelect); | |
| 129 | + }); | |
| 130 | + | |
| 131 | + //iframe 自适应高度 | |
| 132 | +/* var iframeHeight; | |
| 133 | + var ifm = top.document.getElementById("formFragmentModalIframe"); | |
| 134 | + | |
| 135 | + function changeFrameHeight() { | |
| 136 | + iframeHeight = $('.form-page-content').height() | |
| 137 | + ifm.height = iframeHeight + 'px'; | |
| 138 | + } | |
| 139 | + | |
| 140 | + document.body.onload = function () { | |
| 141 | + setTimeout(changeFrameHeight, 500); | |
| 142 | + }; | |
| 143 | + //定时重置iframe高度,在片段内容不可控的情况下。 这是目前能想到的最好办法了 | |
| 144 | + window.setInterval(function () { | |
| 145 | + var h = $('.form-page-content').height(); | |
| 146 | + if (iframeHeight != h) | |
| 147 | + ifm.height = h + 'px'; | |
| 148 | + }, 600);*/ | |
| 149 | + | |
| 150 | + })(); | |
| 151 | + | |
| 152 | + function initPinYinSelect2(selector, data, cb) { | |
| 153 | + //过滤线路选择框数据 | |
| 154 | + /*if(selector === '#line'){ | |
| 155 | + var idx = ',' + top.gb_data_basic.line_idx + ','; | |
| 156 | + var newData = []; | |
| 157 | + $.each(data, function () { | |
| 158 | + if(idx.indexOf(',' + this.id + ',') != -1) | |
| 159 | + newData.push(this); | |
| 160 | + }); | |
| 161 | + data = newData; | |
| 162 | + }*/ | |
| 163 | + | |
| 164 | + if(selector === '#line'){ | |
| 165 | + //写死线路下拉框 | |
| 166 | + data = []; | |
| 167 | + $.each(top.gb_data_basic.activeLines, function () { | |
| 168 | + data.push({ | |
| 169 | + id: this.lineCode, | |
| 170 | + text: this.name | |
| 171 | + }); | |
| 172 | + }); | |
| 173 | + } | |
| 174 | + $.each(data, function () { | |
| 175 | + this.fullChars = pinyin.getFullChars(this.text).toUpperCase(); | |
| 176 | + this.camelChars = pinyin.getCamelChars(this.text); | |
| 177 | + }); | |
| 178 | + | |
| 179 | + $.fn.select2.amd.require(['select2/compat/matcher'], function (oldMatcher) { | |
| 180 | + $(selector).select2({ | |
| 181 | + data: data, | |
| 182 | + matcher: oldMatcher(function (term, text, item) { | |
| 183 | + if (!item.id) | |
| 184 | + return; | |
| 185 | + var upTerm = term.toUpperCase(); | |
| 186 | + if (item.fullChars.indexOf(upTerm) != -1 | |
| 187 | + || item.camelChars.indexOf(upTerm) != -1) | |
| 188 | + return true; | |
| 189 | + | |
| 190 | + return text.indexOf(term) != -1; | |
| 191 | + }) | |
| 192 | + }); | |
| 193 | + | |
| 194 | + cb && cb($(selector)); | |
| 195 | + | |
| 196 | + if(selector === '#line') { | |
| 197 | + setTimeout(function () { | |
| 198 | + $('#line', '.form-page-content').trigger('change'); | |
| 199 | + }, 500); | |
| 200 | + } | |
| 201 | + }); | |
| 202 | + | |
| 203 | + return $(selector); | |
| 204 | + } | |
| 205 | + | |
| 206 | + var $get = top.gb_common.$get; | |
| 207 | + var $post = top.gb_common.$post; | |
| 208 | +</script> | |
| 209 | +</body> | |
| 210 | +</html> | |
| 0 | 211 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v3/js/home/layout.js
0 → 100644
| 1 | +/* home js */ | |
| 2 | + | |
| 3 | +var gb_home_layout = (function () { | |
| 4 | + | |
| 5 | + var temps; | |
| 6 | + | |
| 7 | + var layout = function (cb) { | |
| 8 | + //footer line name tabs | |
| 9 | + var codeArray = gb_data_basic.line_idx.split(','), | |
| 10 | + tabsArray = [], | |
| 11 | + len = codeArray.length; | |
| 12 | + for (var i = 0; i < len;) { | |
| 13 | + tabsArray.push(connectArr(codeArray.slice(i, i += 3), ',', function (item) { | |
| 14 | + return gb_data_basic.codeToLine[item].name; | |
| 15 | + })); | |
| 16 | + } | |
| 17 | + //load template | |
| 18 | + $.get('/real_control_v3/fragments/home/layout.html', function (dom) { | |
| 19 | + temps = gb_common.compileTempByDom(dom); | |
| 20 | + | |
| 21 | + var htmlStr = temps['home-layout-tab-temp']({ | |
| 22 | + tabs: tabsArray | |
| 23 | + }); | |
| 24 | + $('#main-tab-content li.home-panel').html(htmlStr); | |
| 25 | + | |
| 26 | + //render line panel | |
| 27 | + var i = 0, | |
| 28 | + data, renderFun = temps['home-layout-line-temp']; | |
| 29 | + $('ul#home-main-content li').each(function () { | |
| 30 | + data = gb_data_basic.findLineByCodes(codeArray.slice(i, i += 3)); | |
| 31 | + | |
| 32 | + $(this).html(renderFun({list: data})); | |
| 33 | + if (i > len) | |
| 34 | + return false; | |
| 35 | + }); | |
| 36 | + | |
| 37 | + initRbDxplain(); | |
| 38 | + cb && cb(); | |
| 39 | + }); | |
| 40 | + }; | |
| 41 | + | |
| 42 | + //右下角说明icon | |
| 43 | + function initRbDxplain() { | |
| 44 | + $(document).on('mouseenter', '.home-rb-explain-icon>.uk-icon-question-circle', function() { | |
| 45 | + $(this).qtip({ | |
| 46 | + show: { | |
| 47 | + ready: true, | |
| 48 | + delay: 0 | |
| 49 | + }, | |
| 50 | + content: { | |
| 51 | + text: function() { | |
| 52 | + return temps['home-rb-explain-help-temp']({}); | |
| 53 | + } | |
| 54 | + }, | |
| 55 | + position: { | |
| 56 | + viewport: $(window) | |
| 57 | + }, | |
| 58 | + style: { | |
| 59 | + classes: 'qtip-jtools qtip-home-rb' | |
| 60 | + }, | |
| 61 | + hide: { | |
| 62 | + fixed: true, | |
| 63 | + delay: 300 | |
| 64 | + }, | |
| 65 | + events: { | |
| 66 | + hidden: function(event, api) { | |
| 67 | + //destroy dom | |
| 68 | + $(this).qtip('destroy', true); | |
| 69 | + } | |
| 70 | + } | |
| 71 | + }); | |
| 72 | + }); | |
| 73 | + } | |
| 74 | + | |
| 75 | + //click svg edit icon | |
| 76 | + $(document).on('click', '.home-svg-edit-icon', function () { | |
| 77 | + open_modal('/real_control_v3/fragments/home/svg_edit.html', {lineCode: $(this).data('line-code')}); | |
| 78 | + }); | |
| 79 | + | |
| 80 | + //tab 切换事件 | |
| 81 | + $(document).on('show.uk.switcher', '.home-panel-footer>ul.uk-subnav' , function (event, area) { | |
| 82 | + gb_svg_chart.refreshByVisible(); | |
| 83 | + }); | |
| 84 | + | |
| 85 | + //文件载入完毕 | |
| 86 | + res_load_ep.emitLater('load_home_layout'); | |
| 87 | + | |
| 88 | + return { | |
| 89 | + layout: layout | |
| 90 | + }; | |
| 91 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/js/line_schedule/dbclick.js
0 → 100644
| 1 | +/** schedule table double click event */ | |
| 2 | +var gb_schedule_table_dbclick = (function() { | |
| 3 | + | |
| 4 | + //待发调整 | |
| 5 | + var dftzHandler = function(input) { | |
| 6 | + var val = $(input).val(), | |
| 7 | + $dd = $(input).parent(), | |
| 8 | + id = $(input).parents('dl').data('id'); | |
| 9 | + | |
| 10 | + if (val == '' || $dd.attr('dbclick-val') == val) { | |
| 11 | + var lineCode = $(input).parents('li.line_schedule').data('id'); | |
| 12 | + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 13 | + var dfHtmlStr = $dd.attr('dbclick-val') + (sch.late2?'<span class="late-badge">?+'+sch.lateMinute+'</span>':''); | |
| 14 | + $dd.html(dfHtmlStr); | |
| 15 | + return; | |
| 16 | + } | |
| 17 | + else { | |
| 18 | + gb_common.$post('/realSchedule/outgoAdjust', { | |
| 19 | + id: id, | |
| 20 | + dfsj: val, | |
| 21 | + remarks: '', | |
| 22 | + opType: '0' | |
| 23 | + }, function(rs) { | |
| 24 | + if(rs.flag && rs.flag==4008){ | |
| 25 | + notify_err('已发出的班次不能调整待发'); | |
| 26 | + gb_schedule_table.updateSchedule(rs.t); | |
| 27 | + return; | |
| 28 | + } | |
| 29 | + gb_schedule_table.updateSchedule(rs.ts); | |
| 30 | + notify_succ('待发调整成功!'); | |
| 31 | + //重新计算应发未发 | |
| 32 | + gb_schedule_table.calc_yfwf_num(rs.ts[0].xlBm); | |
| 33 | + }); | |
| 34 | + } | |
| 35 | + } | |
| 36 | + | |
| 37 | + var dbclick_opts = { | |
| 38 | + 'dfsj': { | |
| 39 | + inputType: 'time', | |
| 40 | + submit: dftzHandler | |
| 41 | + } | |
| 42 | + }; | |
| 43 | + | |
| 44 | + //var input = ; | |
| 45 | + var init = function(tbody) { | |
| 46 | + //console.log('gb_schedule_table_dbclick.init...'); | |
| 47 | + $('.line-schedule-table .ct_table_body dd[dbclick]').dblclick(function() { | |
| 48 | + //console.log('dblclick...') | |
| 49 | + var val = $(this).attr('dbclick-val'), | |
| 50 | + type = $(this).attr('dbclick-type'); | |
| 51 | + | |
| 52 | + $(this).html('<input required opts_type="' + type + '" type="' + dbclick_opts[type].inputType + '" class="db-input" value="' + val + '">'); | |
| 53 | + | |
| 54 | + //console.log($('input', this)); | |
| 55 | + var $input = $('input', this); | |
| 56 | + $input.focus().on('keyup', inputKeyup) | |
| 57 | + .on('blur', function() { | |
| 58 | + dbclick_opts[type].submit($input); | |
| 59 | + }); | |
| 60 | + }); | |
| 61 | + } | |
| 62 | + | |
| 63 | + var inputKeyup = function(e) { | |
| 64 | + if (e && e.keyCode == 13) { | |
| 65 | + var type = $(this).attr('opts_type'); | |
| 66 | + dbclick_opts[type].submit(this); | |
| 67 | + } | |
| 68 | + } | |
| 69 | + | |
| 70 | + $.contextMenu({ | |
| 71 | + selector: '.line_schedule .ct_table_body input.db-input', | |
| 72 | + className: 'schedule-ct-menu-input', | |
| 73 | + callback: function(key, options) { | |
| 74 | + //callbackHandler[key] && callbackHandler[key](); | |
| 75 | + //if(key == 'cancel') | |
| 76 | + }, | |
| 77 | + items: { | |
| 78 | + 'cancel': { | |
| 79 | + name: '取消', | |
| 80 | + icon: "delete" | |
| 81 | + } | |
| 82 | + } | |
| 83 | + }); | |
| 84 | + | |
| 85 | + var sfsjCellClick = function (elem) { | |
| 86 | + // elem.dblclick(function () { | |
| 87 | + // | |
| 88 | + // var id = $(this).parent().data('id'), | |
| 89 | + // lineCode = $(this).parents('li.line_schedule').data('id'); | |
| 90 | + // | |
| 91 | + // var sch = gb_schedule_table.findScheduleByLine(lineCode)[id]; | |
| 92 | + // gb_schedule_context_menu.fcxxwt(sch); | |
| 93 | + // }); | |
| 94 | + }; | |
| 95 | + | |
| 96 | + var carCellClick = function (elem) { | |
| 97 | + elem.dblclick(function () { | |
| 98 | + var nbbm = $(this).data('nbbm'); | |
| 99 | + var lineCode = $('.north-tabs>ul>li.tab-line.uk-active').data('code'); | |
| 100 | + | |
| 101 | + open_modal('/real_control_v3/fragments/line_schedule/car_info_all.html', {nbbm:nbbm,lineCode:lineCode}); | |
| 102 | + }); | |
| 103 | + }; | |
| 104 | + | |
| 105 | + return { | |
| 106 | + init: init, | |
| 107 | + sfsjCellClick:sfsjCellClick, | |
| 108 | + carCellClick: carCellClick | |
| 109 | + }; | |
| 110 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/js/line_schedule/layout.js
0 → 100644
| 1 | +/** 单线路调度 布局 */ | |
| 2 | +var gb_line_layout = (function() { | |
| 3 | + | |
| 4 | + var temps; | |
| 5 | + | |
| 6 | + var layout = function(cb) { | |
| 7 | + $.get('/real_control_v3/fragments/line_schedule/layout.html', function(dom) { | |
| 8 | + temps = gb_common.compileTempByDom(dom); | |
| 9 | + | |
| 10 | + var htmlStr = temps['cont-line-layout-temp']({}); | |
| 11 | + | |
| 12 | + $('#main-tab-content .line_schedule').each(function(){ | |
| 13 | + $(this).html(htmlStr); | |
| 14 | + | |
| 15 | + var lineCode=$(this).data('id') | |
| 16 | + ,svgWrap=$('.footer-chart .svg-wrap', this); | |
| 17 | + gb_svg_chart.draw_line(lineCode, svgWrap, true); | |
| 18 | + }); | |
| 19 | + | |
| 20 | + cb && cb(); | |
| 21 | + }); | |
| 22 | + }; | |
| 23 | + | |
| 24 | + //图例icon tootip | |
| 25 | + $(document).on('mouseenter', '.schedule-wrap .header-title i.uk-icon-question-circle', function() { | |
| 26 | + $(this).qtip({ | |
| 27 | + show: { | |
| 28 | + ready: true, | |
| 29 | + delay: 300 | |
| 30 | + }, | |
| 31 | + content: { | |
| 32 | + text: function() { | |
| 33 | + return temps['sch-table-top-help-temp']({}); | |
| 34 | + } | |
| 35 | + }, | |
| 36 | + position: { | |
| 37 | + viewport: $(window) | |
| 38 | + }, | |
| 39 | + style: { | |
| 40 | + classes: 'qtip-light qtip-rounded qtip-shadow sch-tl-tip' | |
| 41 | + }, | |
| 42 | + hide: { | |
| 43 | + fixed: true, | |
| 44 | + delay: 300 | |
| 45 | + }, | |
| 46 | + events: { | |
| 47 | + hidden: function(event, api) { | |
| 48 | + //destroy dom | |
| 49 | + $(this).qtip('destroy', true); | |
| 50 | + } | |
| 51 | + } | |
| 52 | + }); | |
| 53 | + }); | |
| 54 | + | |
| 55 | + return { | |
| 56 | + layout: layout | |
| 57 | + }; | |
| 58 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/js/line_schedule/sch_table.js
0 → 100644
| 1 | +/** schedule table */ | |
| 2 | + | |
| 3 | +var gb_schedule_table = (function () { | |
| 4 | + | |
| 5 | + var temps; | |
| 6 | + //线路分组的班次数据 | |
| 7 | + var line2Schedule = {}; | |
| 8 | + //车辆应发未发车辆数 | |
| 9 | + var car_yfwf_map = {}; | |
| 10 | + | |
| 11 | + var bcTypeOrderMap = { | |
| 12 | + 'out':0, | |
| 13 | + 'normal':1, | |
| 14 | + 'region':2, | |
| 15 | + 'major':3, | |
| 16 | + 'venting':4, | |
| 17 | + 'ldks':5, | |
| 18 | + 'in':6 | |
| 19 | + }; | |
| 20 | + var typeOrder = function (type) { | |
| 21 | + return bcTypeOrderMap[type]?bcTypeOrderMap[type]:0; | |
| 22 | + }; | |
| 23 | + var schedule_sort = function (s1, s2) { | |
| 24 | + var diff = s1['fcsjT'] - s2['fcsjT']; | |
| 25 | + return diff!=0?diff:typeOrder(s1['bcType'])-typeOrder(s2['bcType']); | |
| 26 | + }; | |
| 27 | + | |
| 28 | + var show = function (cb) { | |
| 29 | + //从服务器获取班次数据 | |
| 30 | + $.get('/freeLogin/realSchedule/lines', { | |
| 31 | + lines: gb_data_basic.line_idx | |
| 32 | + }, function (rs) { | |
| 33 | + for (var lineCode in rs) { | |
| 34 | + line2Schedule[lineCode] = {}; | |
| 35 | + | |
| 36 | + //排序 | |
| 37 | + rs[lineCode].sort(schedule_sort); | |
| 38 | + //calc shift | |
| 39 | + $.each(rs[lineCode], function () { | |
| 40 | + if(this.status==-1) | |
| 41 | + clearActualTime(this); | |
| 42 | + calc_sch_real_shift(this); | |
| 43 | + line2Schedule[lineCode][this.id] = this; | |
| 44 | + //子任务公里是否与计划平 | |
| 45 | + this.c_t_mileage_status = calcCTaskMileageStatus(this); | |
| 46 | + }); | |
| 47 | + //计算应发未发 | |
| 48 | + calc_yfwf_num(lineCode); | |
| 49 | + } | |
| 50 | + ep.emit('data', rs); | |
| 51 | + }); | |
| 52 | + | |
| 53 | + //加载班次表格渲染模板 | |
| 54 | + $.get('/real_control_v3/fragments/line_schedule/sch_table.html', function (dom) { | |
| 55 | + ep.emit('temp', gb_common.compileTempByDom(dom, { | |
| 56 | + compress: true | |
| 57 | + })); | |
| 58 | + }); | |
| 59 | + | |
| 60 | + var ep = EventProxy.create("data", "temp", function (data, temp) { | |
| 61 | + temps = temp; | |
| 62 | + var lineCode, dirData, htmlStr; | |
| 63 | + $('#main-tab-content .line_schedule').each(function () { | |
| 64 | + lineCode = $(this).data('id'); | |
| 65 | + if (arrayIsNull(data[lineCode])) | |
| 66 | + return true; | |
| 67 | + dirData = gb_common.groupBy(data[lineCode], 'xlDir'); | |
| 68 | + for (var upDown in dirData) { | |
| 69 | + htmlStr = temps['line-schedule-table-temp']({ | |
| 70 | + dir: upDown, | |
| 71 | + line: gb_data_basic.codeToLine[lineCode], | |
| 72 | + list: dirData[upDown] | |
| 73 | + }); | |
| 74 | + | |
| 75 | + $('.schedule-wrap .card-panel:eq(' + upDown + ')', this) | |
| 76 | + .html(htmlStr); | |
| 77 | + } | |
| 78 | + | |
| 79 | + //标记路牌最后一个班次 | |
| 80 | + markerLastByLine(lineCode); | |
| 81 | + //初始化图例相关,dbclick 不能代理事件 | |
| 82 | + //gb_sch_legend.init(this); | |
| 83 | + }); | |
| 84 | + //初始化图例 | |
| 85 | + gb_sch_legend.init(); | |
| 86 | + var content = $('.line_schedule .ct_table_wrap'); | |
| 87 | + //初始化滚动条 | |
| 88 | + content.perfectScrollbar({suppressScrollX: true}); | |
| 89 | + //fixed table head | |
| 90 | + gb_ct_table.fixedHead(content); | |
| 91 | + //enable sort | |
| 92 | + gb_ct_table.enableSort($('.ct_table', content), reset_seq_no, gb_schedule_table_dbclick.init); | |
| 93 | + //dbclick event | |
| 94 | + gb_schedule_table_dbclick.init(); | |
| 95 | + //双击实发 | |
| 96 | + //gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell')); | |
| 97 | + //双击车辆 | |
| 98 | + gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]')); | |
| 99 | + //搜索框初始化 | |
| 100 | + gb_sch_search.init(); | |
| 101 | + | |
| 102 | + //监听gps车辆信息 | |
| 103 | + gb_data_gps.registerCallback(renderCarRemark); | |
| 104 | + cb && cb(); | |
| 105 | + }); | |
| 106 | + }; | |
| 107 | + | |
| 108 | + var renderCarRemark = function () { | |
| 109 | + try{ | |
| 110 | + var $activeTab = $('.north-tabs>ul>li.tab-line.uk-active');//.data('code'); | |
| 111 | + if($activeTab.length==0) | |
| 112 | + return; | |
| 113 | + var lineCode = $activeTab.data('code'); | |
| 114 | + var array = gb_common.get_vals(line2Schedule[lineCode]); | |
| 115 | + var nbbms = {}; | |
| 116 | + for(var i=0,sch;sch=array[i++];){ | |
| 117 | + nbbms[sch.clZbh]=1; | |
| 118 | + } | |
| 119 | + | |
| 120 | + var $activeWrap = $('#main-tab-content .line_schedule.uk-active .schedule-wrap .schedule-body'); | |
| 121 | + var gps, e; | |
| 122 | + for(var nbbm in nbbms){ | |
| 123 | + gps = gb_data_gps.findGpsByNbbm(nbbm); | |
| 124 | + e = $('.ct_table_body dl>dd[data-nbbm='+nbbm+']', $activeWrap); | |
| 125 | + $('i', e).remove(); | |
| 126 | + | |
| 127 | + if(gps && gps['planCode']!=lineCode && gps.remark) | |
| 128 | + $(e).append('<i class="uk-icon-exclamation-circle" data-uk-tooltip title="'+gps.remark+'"></i>'); | |
| 129 | + } | |
| 130 | + }catch (e){ | |
| 131 | + console.log(e); | |
| 132 | + } | |
| 133 | + }; | |
| 134 | + | |
| 135 | + /** | |
| 136 | + * 计算子任务公里是否和计划平 | |
| 137 | + * @param sch | |
| 138 | + */ | |
| 139 | + var calcCTaskMileageStatus = function (sch) { | |
| 140 | + if(!sch.cTasks || sch.cTasks.length==0) | |
| 141 | + return 0; | |
| 142 | + var sum = 0; | |
| 143 | + $.each(sch.cTasks, function () { | |
| 144 | + if (this.mileageType == 'service') { | |
| 145 | + sum = gb_common.accAdd(sum, this.mileage); | |
| 146 | + } | |
| 147 | + }); | |
| 148 | + | |
| 149 | + if (sum != sch.jhlcOrig) { | |
| 150 | + return -1; | |
| 151 | + } | |
| 152 | + return 0; | |
| 153 | + }; | |
| 154 | + | |
| 155 | + | |
| 156 | + //重置序号 | |
| 157 | + var reset_seq_no = function (dls) { | |
| 158 | + dls.each(function (i, dl) { | |
| 159 | + $('dd:eq(0)', dl).text(i + 1); | |
| 160 | + }); | |
| 161 | + }; | |
| 162 | + | |
| 163 | + //计算实发时间差值 | |
| 164 | + var calc_sch_real_shift = function (sch) { | |
| 165 | + if (sch['fcsjActualTime']){ | |
| 166 | + var diff = sch['fcsjActualTime'] - sch['dfsjT'], fcsj_diff; | |
| 167 | + fcsj_diff = parseInt(diff / 60000, 10); | |
| 168 | + if(diff % 60000 != 0){ | |
| 169 | + /*if(fcsj_diff > 0) | |
| 170 | + fcsj_diff ++; | |
| 171 | + else */if(fcsj_diff < 0) | |
| 172 | + fcsj_diff --; | |
| 173 | + } | |
| 174 | + | |
| 175 | + if(fcsj_diff > 0) | |
| 176 | + sch.fcsj_diff = '( +' + fcsj_diff + ' )'; | |
| 177 | + else if (fcsj_diff < 0) | |
| 178 | + sch.fcsj_diff = '( ' + fcsj_diff + ' )'; | |
| 179 | + else | |
| 180 | + sch.fcsj_diff = ''; | |
| 181 | + } | |
| 182 | + }; | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + function arrayIsNull(array) { | |
| 187 | + return !array || array.length == 0; | |
| 188 | + } | |
| 189 | + | |
| 190 | + var findScheduleByLine = function (lineCode) { | |
| 191 | + return line2Schedule[lineCode]; | |
| 192 | + }; | |
| 193 | + | |
| 194 | + //新增一个班次,附带更新的班次 | |
| 195 | + var insertSchedule = function (sch, upArr) { | |
| 196 | + var xls = {}; | |
| 197 | + xls[sch.xlBm] = 1; | |
| 198 | + line2Schedule[sch.xlBm][sch.id] = sch; | |
| 199 | + //update | |
| 200 | + if (isArray(upArr)) { | |
| 201 | + $.each(upArr, function () { | |
| 202 | + line2Schedule[this.xlBm][this.id] = this; | |
| 203 | + xls[this.xlBm] = 1; | |
| 204 | + }); | |
| 205 | + } | |
| 206 | + | |
| 207 | + //重新渲染表格 | |
| 208 | + for(var xlBm in xls){ | |
| 209 | + reRenderTable(sch.xlBm); | |
| 210 | + } | |
| 211 | + //定位到新添加的班次 | |
| 212 | + scroToDl(sch); | |
| 213 | + }; | |
| 214 | + | |
| 215 | + /** | |
| 216 | + * 重新渲染表格 | |
| 217 | + */ | |
| 218 | + var reRenderTable = function (lineCode) { | |
| 219 | + var data = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), | |
| 220 | + dirData = gb_common.groupBy(data, 'xlDir'), | |
| 221 | + tabCont = $('li.line_schedule[data-id=' + lineCode + ']'), | |
| 222 | + htmlStr; | |
| 223 | + | |
| 224 | + if($.isEmptyObject(dirData)){ | |
| 225 | + $('.schedule-wrap .card-panel', tabCont).html(''); | |
| 226 | + } | |
| 227 | + else { | |
| 228 | + for (var upDown in dirData) { | |
| 229 | + htmlStr = temps['line-schedule-table-temp']({ | |
| 230 | + dir: upDown, | |
| 231 | + line: gb_data_basic.codeToLine[lineCode], | |
| 232 | + list: dirData[upDown] | |
| 233 | + }); | |
| 234 | + $('.schedule-wrap .card-panel:eq(' + upDown + ')', tabCont).html(htmlStr); | |
| 235 | + } | |
| 236 | + //图例相关 | |
| 237 | + gb_sch_legend.init(tabCont); | |
| 238 | + //标记末班 | |
| 239 | + markerLastByLine(lineCode); | |
| 240 | + //计算应发未发 | |
| 241 | + calc_yfwf_num(lineCode); | |
| 242 | + //重新固定表头 | |
| 243 | + gb_ct_table.fixedHead($('.schedule-wrap .ct_table_wrap', tabCont)); | |
| 244 | + | |
| 245 | + //重新初始化排序 | |
| 246 | + gb_ct_table.enableSort($('.ct_table', tabCont), reset_seq_no, gb_schedule_table_dbclick.init); | |
| 247 | + //重新初始化双击待发调整 | |
| 248 | + gb_schedule_table_dbclick.init(); | |
| 249 | + //重新初始化双击实发发车信息微调 | |
| 250 | + gb_schedule_table_dbclick.sfsjCellClick($('dd.fcsjActualCell', tabCont)); | |
| 251 | + //重新初始化双击车辆 | |
| 252 | + gb_schedule_table_dbclick.carCellClick($('.ct_table_body dd[data-nbbm]')); | |
| 253 | + //滚动条 | |
| 254 | + $('.schedule-wrap .ct_table_wrap', tabCont).perfectScrollbar({suppressScrollX: true}); | |
| 255 | + | |
| 256 | + //搜索模板初始化 | |
| 257 | + gb_sch_search.init(); | |
| 258 | + } | |
| 259 | + }; | |
| 260 | + | |
| 261 | + | |
| 262 | + /** | |
| 263 | + * 重新从服务器加载数据,并刷新表格 | |
| 264 | + * @param lineCode | |
| 265 | + */ | |
| 266 | + var reLoadAndRefresh = function (lineCode) { | |
| 267 | + $.get('/freeLogin/realSchedule/lines', { | |
| 268 | + lines: lineCode + ',' | |
| 269 | + }, function (rs) { | |
| 270 | + if(!rs || $.isEmptyObject(rs)){ | |
| 271 | + line2Schedule[lineCode] = {}; | |
| 272 | + } | |
| 273 | + else{ | |
| 274 | + //排序 | |
| 275 | + rs[lineCode].sort(schedule_sort); | |
| 276 | + line2Schedule[lineCode] = {}; | |
| 277 | + //calc shift | |
| 278 | + $.each(rs[lineCode], function () { | |
| 279 | + calc_sch_real_shift(this); | |
| 280 | + line2Schedule[lineCode][this.id] = this; | |
| 281 | + }); | |
| 282 | + } | |
| 283 | + //计算应发未发 | |
| 284 | + calc_yfwf_num(lineCode); | |
| 285 | + //重新渲染 | |
| 286 | + reRenderTable(lineCode); | |
| 287 | + }); | |
| 288 | + }; | |
| 289 | + | |
| 290 | + //删除一个班次 | |
| 291 | + var deheteSchedule = function (sch) { | |
| 292 | + sch = line2Schedule[sch.xlBm][sch.id]; | |
| 293 | + if (sch) { | |
| 294 | + var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'), | |
| 295 | + dls = dl.parent().find('dl'); | |
| 296 | + delete line2Schedule[sch.xlBm][sch.id]; | |
| 297 | + dl.remove(); | |
| 298 | + reset_seq_no(dls); | |
| 299 | + calc_yfwf_num(sch.xlBm); | |
| 300 | + } | |
| 301 | + }; | |
| 302 | + | |
| 303 | + /** | |
| 304 | + * 更新班次 | |
| 305 | + * @param schArr | |
| 306 | + */ | |
| 307 | + var updateSchedule = function (schArr) { | |
| 308 | + | |
| 309 | + if (!isArray(schArr)) | |
| 310 | + schArr = [schArr]; | |
| 311 | + | |
| 312 | + //var tMaps = {}; | |
| 313 | + $.each(schArr, function () { | |
| 314 | + try { | |
| 315 | + if(this.status==-1) | |
| 316 | + clearActualTime(this); | |
| 317 | + //子任务公里是否与计划平 | |
| 318 | + this.c_t_mileage_status = calcCTaskMileageStatus(this); | |
| 319 | + line2Schedule[this.xlBm][this.id] = this; | |
| 320 | + updateDom(this); | |
| 321 | + }catch(e){} | |
| 322 | + }); | |
| 323 | + | |
| 324 | + /* //重新标记末班 | |
| 325 | + var ts=[]; | |
| 326 | + for(var k in tMaps){ | |
| 327 | + ts = k.split('_'); | |
| 328 | + markerLastByNbbm(ts[0], ts[1]); | |
| 329 | + }*/ | |
| 330 | + }; | |
| 331 | + | |
| 332 | + | |
| 333 | + /** | |
| 334 | + * 更新班次 -只更新数据,不更新dom | |
| 335 | + * @param schArr | |
| 336 | + */ | |
| 337 | + var updateData = function (schArr) { | |
| 338 | + if (!isArray(schArr)) | |
| 339 | + schArr = [schArr]; | |
| 340 | + $.each(schArr, function () { | |
| 341 | + if(this.status==-1) | |
| 342 | + clearActualTime(this); | |
| 343 | + line2Schedule[this.xlBm][this.id] = this; | |
| 344 | + }); | |
| 345 | + }; | |
| 346 | + | |
| 347 | + //update dom | |
| 348 | + var updateDom = function (sch) { | |
| 349 | + if (!sch) return; | |
| 350 | + var dl = $('li.line_schedule[data-id=' + sch.xlBm + '] .ct_table_body dl[data-id=' + sch.id + ']'); | |
| 351 | + var dds = $('dd', dl); | |
| 352 | + $(dds[1]).find('a').text(sch.lpName); | |
| 353 | + | |
| 354 | + //车辆自编号 | |
| 355 | + var $newDds2 = $(temps['line-schedule-nbbm-temp'](sch)); | |
| 356 | + $(dds[2]).replaceWith($newDds2); | |
| 357 | + //车辆双击 | |
| 358 | + gb_schedule_table_dbclick.carCellClick($newDds2); | |
| 359 | + $(dds[3]).text(sch.qdzArrDatejh ? sch.qdzArrDatejh : ''); | |
| 360 | + $(dds[4]).text(sch.qdzArrDatesj ? sch.qdzArrDatesj : ''); | |
| 361 | + | |
| 362 | + //计发时间 | |
| 363 | + $(dds[5]).replaceWith(temps['line-schedule-fcsj-temp'](sch)); | |
| 364 | + //待发时间 | |
| 365 | + var dfHtmlStr = sch.dfsj + (sch.late2?'<span class="late-badge">?+'+sch.lateMinute+'</span>':''); | |
| 366 | + $(dds[6]).attr('data-sort-val', sch.dfsjT).html(dfHtmlStr); | |
| 367 | + | |
| 368 | + //实发时间 | |
| 369 | + calc_sch_real_shift(sch); | |
| 370 | + var sfsjDd = $(temps['line-schedule-sfsj-temp'](sch)); | |
| 371 | + //双击 | |
| 372 | + gb_schedule_table_dbclick.sfsjCellClick(sfsjDd); | |
| 373 | + $(dds[7]).replaceWith(sfsjDd); | |
| 374 | + if (sch.remarks) | |
| 375 | + $(dds[8]).html('<span title="' + sch.remarks + '" data-uk-tooltip="{pos:\'top-left\'}">' + sch.remarks + '</span>'); | |
| 376 | + else | |
| 377 | + $(dds[8]).html(''); | |
| 378 | + | |
| 379 | + //信号状态标记 | |
| 380 | + gb_signal_state.marker_sch(sch); | |
| 381 | + //班次是车辆的最后一班 | |
| 382 | + if (dl.hasClass('dl-last-sch')) | |
| 383 | + markerLastSch([sch]); | |
| 384 | + | |
| 385 | + renderCarRemark(); | |
| 386 | + }; | |
| 387 | + | |
| 388 | + //单击实发单元格显示详细信息 | |
| 389 | + $(document).on('click', 'dd.fcsjActualCell', function () { | |
| 390 | + var that = this; | |
| 391 | + $(that).qtip({ | |
| 392 | + show: true, | |
| 393 | + content: { | |
| 394 | + text: function (e) { | |
| 395 | + var lineCode = $(that).parents('li.line_schedule').data('id') | |
| 396 | + , id = $(that).parents('dl').data('id') | |
| 397 | + , sch = line2Schedule[lineCode][id]; | |
| 398 | + return temps['sfsj_sch-detail-temp'](sch); | |
| 399 | + } | |
| 400 | + } | |
| 401 | + , style: { | |
| 402 | + classes: 'qtip-dark qtip-rounded qtip-shadow' | |
| 403 | + }, | |
| 404 | + hide: { | |
| 405 | + fixed: true, | |
| 406 | + delay: 300 | |
| 407 | + }, | |
| 408 | + position: { | |
| 409 | + target: that, | |
| 410 | + my: 'center left', | |
| 411 | + at: 'center right' | |
| 412 | + }, | |
| 413 | + events: { | |
| 414 | + hidden: function (event, api) { | |
| 415 | + $(this).qtip('destroy', true); | |
| 416 | + } | |
| 417 | + } | |
| 418 | + }); | |
| 419 | + }); | |
| 420 | + | |
| 421 | + //拖拽选中... | |
| 422 | + var seq_nos = '.line-schedule-table .ct_table_body>dl>dd.seq_no'; | |
| 423 | + var drag_strat; | |
| 424 | + $(document).on('mousedown', seq_nos, function (e) { | |
| 425 | + if (e.button != 0) return; | |
| 426 | + var dl = $(this).parent(); | |
| 427 | + if (dl.hasClass('drag-active')) | |
| 428 | + dl.removeClass('drag-active'); | |
| 429 | + else | |
| 430 | + dl.addClass('drag-active'); | |
| 431 | + | |
| 432 | + drag_strat = parseInt($(this).text()) - 1; | |
| 433 | + }).on('mouseup', function () { | |
| 434 | + drag_strat = null; | |
| 435 | + }).on('mouseover', seq_nos, function () { | |
| 436 | + if (drag_strat != null) { | |
| 437 | + var e = parseInt($(this).text()), | |
| 438 | + dls = $(this).parents('.ct_table_body').find('dl'); | |
| 439 | + | |
| 440 | + reset_drag_active_all(this); | |
| 441 | + //向上选中 | |
| 442 | + if (e <= drag_strat) { | |
| 443 | + for (var i = drag_strat; i > e - 2; i--) | |
| 444 | + $(dls[i]).addClass('drag-active'); | |
| 445 | + } | |
| 446 | + //向下选中 | |
| 447 | + else { | |
| 448 | + for (var j = drag_strat; j < e; j++) | |
| 449 | + $(dls[j]).addClass('drag-active'); | |
| 450 | + } | |
| 451 | + } | |
| 452 | + }).on('click', seq_nos, function () { | |
| 453 | + reset_relevance_active(this); | |
| 454 | + }); | |
| 455 | + //非seq_no 单元格点击 | |
| 456 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class!=seq_no][class!=lpName]', function () { | |
| 457 | + reset_drag_active_all(this); | |
| 458 | + //选中相关班次 | |
| 459 | + var id = $(this).parent().data('id'), | |
| 460 | + contWrap = $(this).parents('li.line_schedule'), | |
| 461 | + lineCode = contWrap.data('id'), | |
| 462 | + sch = line2Schedule[lineCode][id], | |
| 463 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { | |
| 464 | + return item.clZbh == sch.clZbh; | |
| 465 | + }).sort(schedule_sort), | |
| 466 | + nextSch, tempDL; | |
| 467 | + | |
| 468 | + getDl(sch).addClass('intimity'); | |
| 469 | + $.each(schArr, function (i) { | |
| 470 | + tempDL = $('dl[data-id=' + this.id + ']', contWrap); | |
| 471 | + tempDL.addClass('relevance-active'); | |
| 472 | + if (i < schArr.length - 1 && this.id == id) { | |
| 473 | + nextSch = schArr[i + 1]; | |
| 474 | + } | |
| 475 | + }); | |
| 476 | + | |
| 477 | + if (nextSch) { | |
| 478 | + $('dl[data-id=' + nextSch.id + ']', contWrap).addClass('intimity'); | |
| 479 | + /*if (nextSch.xlDir == sch.xlDir) | |
| 480 | + return;*/ | |
| 481 | + //滚动到下一个班次 | |
| 482 | + if(nextSch.xlDir != sch.xlDir) | |
| 483 | + scroToDl(nextSch); | |
| 484 | + | |
| 485 | + } | |
| 486 | + | |
| 487 | + //如果有打开轨迹回放 | |
| 488 | + if($('.layui-layer.play_back-layer').is(':visible')){ | |
| 489 | + gb_map_play_back.setParam(sch); | |
| 490 | + } | |
| 491 | + }); | |
| 492 | + | |
| 493 | + //路牌点击 | |
| 494 | + $(document).on('click', '.line-schedule-table .ct_table_body dl dd[class=lpName]', function () { | |
| 495 | + reset_drag_active_all(this); | |
| 496 | + //选中路牌下相关班次 | |
| 497 | + var id = $(this).parent().data('id'), | |
| 498 | + contWrap = $(this).parents('li.line_schedule'), | |
| 499 | + lineCode = contWrap.data('id'), | |
| 500 | + sch = line2Schedule[lineCode][id], | |
| 501 | + schArr = gb_common.get_vals(line2Schedule[lineCode]).filter(function (item) { | |
| 502 | + return item.lpName == sch.lpName; | |
| 503 | + }).sort(schedule_sort); | |
| 504 | + $.each(schArr, function (i) { | |
| 505 | + $('dl[data-id=' + this.id + ']', contWrap).addClass('relevance-active intimity'); | |
| 506 | + }); | |
| 507 | + | |
| 508 | + //notify_succ('高亮路牌 ' + sch.lpName); | |
| 509 | + showLpMileageTip(lineCode, sch.lpName, schArr); | |
| 510 | + }); | |
| 511 | + | |
| 512 | + var showLpMileageTipBySch = function (sch) { | |
| 513 | + if(!$('.mileage_elec_panel', $('.line_schedule[data-id='+sch.xlBm+']')).is(':visible')) | |
| 514 | + return; | |
| 515 | + | |
| 516 | + var schArr = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (item) { | |
| 517 | + return item.lpName == sch.lpName; | |
| 518 | + }).sort(schedule_sort); | |
| 519 | + | |
| 520 | + showLpMileageTip(sch.xlBm, sch.lpName, schArr); | |
| 521 | + }; | |
| 522 | + /** | |
| 523 | + * 弹出路牌公里统计tip | |
| 524 | + * @param lineCode | |
| 525 | + * @param lpName | |
| 526 | + * @param array | |
| 527 | + */ | |
| 528 | + var showLpMileageTip = function (lineCode, lpName, array) { | |
| 529 | + var wrap = $('.line_schedule[data-id='+lineCode+']'); | |
| 530 | + //按驾驶员&车辆分组统计 | |
| 531 | + var data=mileageTipGroupData(array); | |
| 532 | + //统计公里 | |
| 533 | + var list=[]; | |
| 534 | + for(var key in data){ | |
| 535 | + list.push({ | |
| 536 | + key : key, | |
| 537 | + serviceMileage: gb_sch_mileage_count.serviceMileage(data[key]), | |
| 538 | + destroyMileage: gb_sch_mileage_count.destroyMileage(data[key]), | |
| 539 | + emptyMileage: gb_sch_mileage_count.emptyMileage(data[key]) | |
| 540 | + }) | |
| 541 | + } | |
| 542 | + var htmlStr = temps['sch-lp-mileage-tip-temp']({data: list, lpName:lpName}); | |
| 543 | + $('.mileage_elec_panel', wrap).html(htmlStr).addClass('uk-animation-slide-bottom').show() | |
| 544 | + .one('animationEnd', function () { | |
| 545 | + $(this).removeClass('uk-animation-slide-bottom'); | |
| 546 | + }); | |
| 547 | + }; | |
| 548 | + | |
| 549 | + /** | |
| 550 | + * 分组数据,处理子任务里的中途换车 | |
| 551 | + * @param array | |
| 552 | + */ | |
| 553 | + var mileageTipGroupData = function (arr) { | |
| 554 | + var list = JSON.parse(JSON.stringify(arr)); | |
| 555 | + var cts; | |
| 556 | + var zthcArray=[]; | |
| 557 | + var sch; | |
| 558 | + for(var i=0,len=list.length;i<len;i++){ | |
| 559 | + sch = list[i]; | |
| 560 | + cts = sch['cTasks']; | |
| 561 | + if(!cts || cts.length==0) | |
| 562 | + continue; | |
| 563 | + | |
| 564 | + sch['cTasks'] = []; | |
| 565 | + //有子任务 | |
| 566 | + for(var j=0,ct;ct=cts[j++];){ | |
| 567 | + if(!ct.nbbm || ct.nbbm==sch.clZbh){ | |
| 568 | + sch['cTasks'].push(ct); | |
| 569 | + continue; | |
| 570 | + } | |
| 571 | + | |
| 572 | + zthcArray.push(cloneByCTask(sch, ct)); | |
| 573 | + } | |
| 574 | + } | |
| 575 | + | |
| 576 | + if(zthcArray.length > 0) | |
| 577 | + list = list.concat(zthcArray); | |
| 578 | + | |
| 579 | + var data={},key; | |
| 580 | + for(var i=0,len=list.length;i<len;i++){ | |
| 581 | + key = list[i].clZbh+'/'+list[i].jGh+'('+list[i].jName+')'; | |
| 582 | + if(!data[key]) | |
| 583 | + data[key] = []; | |
| 584 | + data[key].push(list[i]); | |
| 585 | + } | |
| 586 | + return data; | |
| 587 | + }; | |
| 588 | + | |
| 589 | + var cloneByCTask = function (sch, ct) { | |
| 590 | + var newObj = JSON.parse(JSON.stringify(sch)); | |
| 591 | + newObj['cTasks']=[]; | |
| 592 | + newObj.clZbh = ct.nbbm; | |
| 593 | + newObj.fcsjActual = ct.startDate; | |
| 594 | + newObj.zdsjActual = ct.endDate; | |
| 595 | + newObj.jhlc = ct.mileage; | |
| 596 | + newObj.jhlcOrig = ct.mileage; | |
| 597 | + | |
| 598 | + if(ct.type2=='1') | |
| 599 | + newObj.bcType='normal'; | |
| 600 | + else if(ct.type2=='2'){ | |
| 601 | + newObj.bcType='in'; | |
| 602 | + }else if(ct.type2=='3') | |
| 603 | + newObj.bcType='out'; | |
| 604 | + | |
| 605 | + return newObj; | |
| 606 | + }; | |
| 607 | + | |
| 608 | + //头部点击去掉选中光标 | |
| 609 | + $(document).on('click', '.header-title', function () { | |
| 610 | + reset_drag_active_all(this); | |
| 611 | + }); | |
| 612 | + | |
| 613 | + var scroToDl = function (sch) { | |
| 614 | + var dl = getDl(sch), | |
| 615 | + cont = dl.parents('.ct_table_wrap'), | |
| 616 | + diff = cont.height() / 2; | |
| 617 | + cont.animate({ | |
| 618 | + scrollTop: dl.offset().top - cont.offset().top + cont.scrollTop() - diff | |
| 619 | + }, 500); | |
| 620 | + | |
| 621 | + return dl; | |
| 622 | + }; | |
| 623 | + | |
| 624 | + var getDl = function (sch) { | |
| 625 | + return $('dl[data-id=' + sch.id + ']', $('.line_schedule[data-id=' + sch.xlBm + ']')); | |
| 626 | + }; | |
| 627 | + | |
| 628 | + var reset_drag_active_all = function (dd) { | |
| 629 | + $(dd).parents('.schedule-wrap').find('dl.drag-active').removeClass('drag-active'); | |
| 630 | + reset_relevance_active(dd); | |
| 631 | + | |
| 632 | + $('.mileage_elec_panel', $(dd).parents('.top-container')).hide().remove('uk-animation-slide-bottom'); | |
| 633 | + }; | |
| 634 | + | |
| 635 | + var reset_relevance_active = function (dd) { | |
| 636 | + $(dd).parents('.uk-grid.schedule-wrap').find('.relevance-active').removeClass('relevance-active intimity'); | |
| 637 | + }; | |
| 638 | + | |
| 639 | + | |
| 640 | + //计算应发未发数量 car_yfwf_map | |
| 641 | + var calc_yfwf_num = function (lineCode) { | |
| 642 | + | |
| 643 | + var schArr = gb_common.get_vals(line2Schedule[lineCode]).sort(schedule_sort), | |
| 644 | + yfwf_num = 0, | |
| 645 | + t = new Date().valueOf(); | |
| 646 | + | |
| 647 | + var carYfwfMap = {}, nbbm; | |
| 648 | + $.each(schArr, function () { | |
| 649 | + /*if (this.dfsjT > t) | |
| 650 | + return false;*/ | |
| 651 | + | |
| 652 | + if (this.dfsjT < t && | |
| 653 | + this.fcsjActual == null && this.fcsjActualTime == null && this.status != -1) { | |
| 654 | + yfwf_num++; | |
| 655 | + nbbm = this.clZbh; | |
| 656 | + if (carYfwfMap[nbbm]) | |
| 657 | + carYfwfMap[nbbm]++; | |
| 658 | + else | |
| 659 | + carYfwfMap[nbbm] = 1; | |
| 660 | + } | |
| 661 | + }); | |
| 662 | + car_yfwf_map[lineCode] = carYfwfMap; | |
| 663 | + | |
| 664 | + $('#badge_yfwf_num_' + lineCode).text(yfwf_num); | |
| 665 | + }; | |
| 666 | + | |
| 667 | + //标记终点时间 -线路 | |
| 668 | + var markerLastByLine = function (lineCode) { | |
| 669 | + var data = gb_common.groupBy(gb_common.get_vals(line2Schedule[lineCode]).filter(schDestroyFilter), 'lpName'); | |
| 670 | + | |
| 671 | + var array, lastSch, dl; | |
| 672 | + for (var nbbm in data) { | |
| 673 | + array = data[nbbm].sort(schedule_sort); | |
| 674 | + markerLastSch(array); | |
| 675 | + } | |
| 676 | + }; | |
| 677 | + | |
| 678 | + //标记终点时间 -车辆 | |
| 679 | + var markerLastByNbbm = function (lineCode, nbbm) { | |
| 680 | + var array = gb_common.get_vals(line2Schedule[lineCode]).filter(function (a) { | |
| 681 | + return a.clZbh == nbbm && a.status != -1; | |
| 682 | + }).sort(schedule_sort); | |
| 683 | + | |
| 684 | + removeMarkers(lineCode, array); | |
| 685 | + markerLastSch(array); | |
| 686 | + }; | |
| 687 | + | |
| 688 | + var markerLastSch = function (array) { | |
| 689 | + var lastSch = array[array.length - 1]; | |
| 690 | + | |
| 691 | + if (!lastSch.jhlc) | |
| 692 | + return; | |
| 693 | + | |
| 694 | + var dl = getDl(lastSch); | |
| 695 | + dl.addClass('dl-last-sch'); | |
| 696 | + | |
| 697 | + $('dd.fcsjActualCell', dl).append(temps['last-sch-sunken-temp'](lastSch)); | |
| 698 | + }; | |
| 699 | + | |
| 700 | + //清除线路下指定班次的 末班标记 | |
| 701 | + var removeMarkers = function (lineCode, array) { | |
| 702 | + var idx = []; | |
| 703 | + $.each(array, function () { | |
| 704 | + idx.push(this.id); | |
| 705 | + }); | |
| 706 | + | |
| 707 | + $('dl.dl-last-sch', 'li.line_schedule[data-id=' + lineCode + ']').each(function () { | |
| 708 | + if ($(this).hasClass('dl-last-sch') && idx.indexOf($(this).data('id'))) { | |
| 709 | + $(this).removeClass('dl-last-sch').find('.last-sch-sunken').remove(); | |
| 710 | + } | |
| 711 | + }); | |
| 712 | + }; | |
| 713 | + | |
| 714 | + var schDestroyFilter = function (a) { | |
| 715 | + return a.status != -1; | |
| 716 | + }; | |
| 717 | + | |
| 718 | + /* 下一个班次 */ | |
| 719 | + var getNextSch = function (sch) { | |
| 720 | + var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) { | |
| 721 | + return a.clZbh == sch.clZbh; | |
| 722 | + }).sort(schedule_sort); | |
| 723 | + | |
| 724 | + for (var i = 0, item; item = array[i++];) { | |
| 725 | + if (array[i].id == sch.id) { | |
| 726 | + return i < array.length ? array[i + 1] : null; | |
| 727 | + } | |
| 728 | + } | |
| 729 | + }; | |
| 730 | + | |
| 731 | + /* 下一个班次普通班次 */ | |
| 732 | + var getNextNormalSch = function (sch) { | |
| 733 | + | |
| 734 | + var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) { | |
| 735 | + return a.clZbh == sch.clZbh && a.bcType=='normal'; | |
| 736 | + }).sort(schedule_sort); | |
| 737 | + | |
| 738 | + for (var i = 0; i < array.length; i++) { | |
| 739 | + if (array[i].id == sch.id) { | |
| 740 | + return i < array.length ? array[i + 1] : null; | |
| 741 | + } | |
| 742 | + } | |
| 743 | + }; | |
| 744 | + | |
| 745 | + /** 添加备注信息 */ | |
| 746 | + var addRemarks = function (list, remarks) { | |
| 747 | + //if(!list || list) | |
| 748 | + var i = 0, sch; | |
| 749 | + | |
| 750 | + (function () { | |
| 751 | + var f = arguments.callee; | |
| 752 | + if(i >= list.length){ | |
| 753 | + return; | |
| 754 | + } | |
| 755 | + sch = list[i]; | |
| 756 | + gb_common.$post('/realSchedule/addRemarks', {id: sch.id, remarks: remarks}, function (rs) { | |
| 757 | + if(rs.t){ | |
| 758 | + sch = rs.t; | |
| 759 | + line2Schedule[sch.xlBm][sch.id] = sch; | |
| 760 | + updateDom(sch); | |
| 761 | + i++; | |
| 762 | + f(); | |
| 763 | + } | |
| 764 | + }); | |
| 765 | + })(); | |
| 766 | + }; | |
| 767 | + | |
| 768 | + /** | |
| 769 | + * 显示误点停靠时间标记 | |
| 770 | + * @param id | |
| 771 | + * @param minute | |
| 772 | + */ | |
| 773 | + var showLateBadge = function (lineCode, id, minute) { | |
| 774 | + var dfCell = cancelLateBadge(lineCode, id); | |
| 775 | + $(dfCell).append('<span class="late-badge">?+5</span>'); | |
| 776 | + }; | |
| 777 | + | |
| 778 | + /** | |
| 779 | + * 取消误点标记 | |
| 780 | + * @param lineCode | |
| 781 | + * @param id | |
| 782 | + */ | |
| 783 | + var cancelLateBadge = function (lineCode, id) { | |
| 784 | + var $dl = getDl({id: id, xlBm: lineCode}); | |
| 785 | + var dfCell = $dl.find('dd')[6]; | |
| 786 | + $('.late-badge',dfCell).remove(); | |
| 787 | + return dfCell; | |
| 788 | + }; | |
| 789 | + | |
| 790 | + | |
| 791 | + /** | |
| 792 | + * 刷新页面的所有线路班次 | |
| 793 | + */ | |
| 794 | + var refreshAll = function () { | |
| 795 | + show(); | |
| 796 | + }; | |
| 797 | + | |
| 798 | + /** | |
| 799 | + * 获取线路下营运的车辆 | |
| 800 | + */ | |
| 801 | + var findNbbmByLineCode = function (lineCode) { | |
| 802 | + try{ | |
| 803 | + return gb_common.get_keys(gb_common.extractNbbm(gb_common.get_vals(line2Schedule[lineCode]))); | |
| 804 | + }catch (e){ | |
| 805 | + return []; | |
| 806 | + } | |
| 807 | + }; | |
| 808 | + | |
| 809 | + var clearActualTime = function (sch) { | |
| 810 | + try{ | |
| 811 | + sch.fcsjActual=null; | |
| 812 | + sch.fcsjActualTime=null; | |
| 813 | + sch.zdsjActual=null; | |
| 814 | + sch.zdsjActualTime=null; | |
| 815 | + }catch (e){ | |
| 816 | + console.log(e); | |
| 817 | + } | |
| 818 | + }; | |
| 819 | + | |
| 820 | + return { | |
| 821 | + show: show, | |
| 822 | + findScheduleByLine: findScheduleByLine, | |
| 823 | + updateSchedule: updateSchedule, | |
| 824 | + updateData: updateData, | |
| 825 | + deheteSchedule: deheteSchedule, | |
| 826 | + insertSchedule: insertSchedule, | |
| 827 | + schedule_sort: schedule_sort, | |
| 828 | + calc_yfwf_num: calc_yfwf_num, | |
| 829 | + car_yfwf_map: function (lineCode) { | |
| 830 | + return car_yfwf_map[lineCode]; | |
| 831 | + }, | |
| 832 | + scroToDl: scroToDl, | |
| 833 | + reset_drag_active_all: reset_drag_active_all, | |
| 834 | + getDl: getDl, | |
| 835 | + getNextSch: getNextSch, | |
| 836 | + addRemarks: addRemarks, | |
| 837 | + reLoadAndRefresh: reLoadAndRefresh, | |
| 838 | + showLateBadge: showLateBadge, | |
| 839 | + cancelLateBadge: cancelLateBadge, | |
| 840 | + refreshAll: refreshAll, | |
| 841 | + getNextNormalSch: getNextNormalSch, | |
| 842 | + findNbbmByLineCode:findNbbmByLineCode, | |
| 843 | + showLpMileageTipBySch: showLpMileageTipBySch, | |
| 844 | + renderCarRemark: renderCarRemark | |
| 845 | + }; | |
| 846 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/js/main.js
0 → 100644
| 1 | +/* main js */ | |
| 2 | +var gb_main_ep = new EventProxy(), | |
| 3 | + res_load_ep = EventProxy.create('load_data_basic', 'load_tab', 'load_home_layout', 'load_home_line_panel', function () { | |
| 4 | + var eq = gb_main_ep; | |
| 5 | + // basic data end | |
| 6 | + eq.once('data-basic', g_emit('tab')); | |
| 7 | + // tabs | |
| 8 | + eq.once('tab', function () { | |
| 9 | + gb_tabs.init( | |
| 10 | + g_emit('home-layout') | |
| 11 | + ); | |
| 12 | + }); | |
| 13 | + //home layout | |
| 14 | + eq.once('home-layout', function () { | |
| 15 | + gb_home_layout.layout( | |
| 16 | + g_emit('home-line-panel') | |
| 17 | + ); | |
| 18 | + }); | |
| 19 | + //home line panel | |
| 20 | + eq.once('home-line-panel', function () { | |
| 21 | + gb_home_line_panel.init(g_emit('gps-time-refresh')); | |
| 22 | + }); | |
| 23 | + | |
| 24 | + //start fixed time refresh gps | |
| 25 | + eq.once('gps-time-refresh', function () { | |
| 26 | + gb_data_gps.fixedTimeRefresh(); | |
| 27 | + g_emit('line-schedule-layout')(); | |
| 28 | + }); | |
| 29 | + | |
| 30 | + //line schedule layout | |
| 31 | + eq.once('line-schedule-layout', function () { | |
| 32 | + gb_line_layout.layout(g_emit('render-sch-table')); | |
| 33 | + }); | |
| 34 | + | |
| 35 | + //render schedule table | |
| 36 | + eq.once('render-sch-table', function () { | |
| 37 | + gb_schedule_table.show(function () { | |
| 38 | + //加载信号状态 | |
| 39 | + gb_signal_state.init(); | |
| 40 | + }); | |
| 41 | + | |
| 42 | + //初始化gps异常判定 | |
| 43 | + gb_gps_abnormal.initData(); | |
| 44 | + | |
| 45 | + setTimeout(function () { | |
| 46 | + //嵌入地图页面 | |
| 47 | + $('li.map-panel', '#main-tab-content').load('/real_control_v3/mapmonitor/real.html'); | |
| 48 | + }, 1000); | |
| 49 | + //弹出更新说明 | |
| 50 | + //showUpdateDescription(); | |
| 51 | + }); | |
| 52 | + | |
| 53 | + function g_emit(id) { | |
| 54 | + console.log('g_emit [' + id + ']'); | |
| 55 | + return function () { | |
| 56 | + console.log('eq.emitLater(' + id + ')'); | |
| 57 | + return eq.emitLater(id); | |
| 58 | + }; | |
| 59 | + } | |
| 60 | + }); | |
| 61 | + | |
| 62 | +$(document).on('click', '.ct-bottom-drawer-close', function () { | |
| 63 | + $(this).parents('.ct-bottom-drawer').removeClass('open'); | |
| 64 | +}); | |
| 65 | + | |
| 66 | +function connectArr(arr, separator, transFun) { | |
| 67 | + var rs = ''; | |
| 68 | + $.each(arr, function (i, item) { | |
| 69 | + if (transFun) | |
| 70 | + item = transFun(item); | |
| 71 | + rs += (separator + item); | |
| 72 | + }); | |
| 73 | + return rs.substr(separator.length); | |
| 74 | +} | |
| 75 | + | |
| 76 | +var gb_form_validation_opts = { | |
| 77 | + framework: 'uikit', | |
| 78 | + locale: 'zh_CN', | |
| 79 | + icon: { | |
| 80 | + valid: 'uk-icon-check', | |
| 81 | + invalid: 'uk-icon-times', | |
| 82 | + validating: 'uk-icon-refresh' | |
| 83 | + } | |
| 84 | +}; | |
| 85 | + | |
| 86 | + | |
| 87 | +var notify_wait = function (t) { | |
| 88 | + UIkit.notify("<i class='uk-icon-spinner uk-icon-spin'></i> " + t, { | |
| 89 | + status: 'info' | |
| 90 | + }); | |
| 91 | +}; | |
| 92 | + | |
| 93 | +var notify_succ = function (t) { | |
| 94 | + UIkit.notify("<i class='uk-icon-check'></i> " + t, { | |
| 95 | + status: 'success' | |
| 96 | + }); | |
| 97 | +}; | |
| 98 | + | |
| 99 | +var notify_err = function (t) { | |
| 100 | + UIkit.notify("<i class='uk-icon-times'></i> " + t, { | |
| 101 | + status: 'danger' | |
| 102 | + }); | |
| 103 | +}; | |
| 104 | + | |
| 105 | +var alt_confirm = function (content, succ, okBtn, noCenter) { | |
| 106 | + var modalEl = UIkit.modal.confirm(content, function () { | |
| 107 | + succ && succ(); | |
| 108 | + modalEl.hide(); | |
| 109 | + }, { | |
| 110 | + labels: { | |
| 111 | + Ok: okBtn, | |
| 112 | + Cancel: '取消' | |
| 113 | + } | |
| 114 | + , center: !noCenter | |
| 115 | + }); | |
| 116 | +}; | |
| 117 | + | |
| 118 | +var show_wait_modal = function (text) { | |
| 119 | + var modalHtml = | |
| 120 | + '<div class="uk-modal" id="gb_wait_modal">' + | |
| 121 | + ' <div class="uk-modal-dialog">' + | |
| 122 | + ' <div class="uk-modal-spinner"></div>' + | |
| 123 | + ' <div class="wait-modal-text">' + text + '</div>' + | |
| 124 | + ' </div>' + | |
| 125 | + '</div>'; | |
| 126 | + | |
| 127 | + $(document.body).append(modalHtml); | |
| 128 | + return UIkit.modal('#gb_wait_modal', { | |
| 129 | + bgclose: false, | |
| 130 | + modal: false | |
| 131 | + }).show(); | |
| 132 | +}; | |
| 133 | + | |
| 134 | +var hide_wait_modal = function () { | |
| 135 | + UIkit.modal('#gb_wait_modal').hide(); | |
| 136 | +}; | |
| 137 | + | |
| 138 | + | |
| 139 | +var isArray = function (obj) { | |
| 140 | + return Object.prototype.toString.call(obj) === '[object Array]'; | |
| 141 | +}; | |
| 142 | + | |
| 143 | +var notify_err_form = function (t, form) { | |
| 144 | + $('.uk-alert-danger', form).remove(); | |
| 145 | + $('.uk-modal-footer', form).before('<div class="uk-alert uk-alert-danger" data-uk-alert="">' + | |
| 146 | + '<a href="" class="uk-alert-close uk-close"></a>' + | |
| 147 | + '<p>' + t + '</p>' + | |
| 148 | + '</div>'); | |
| 149 | + | |
| 150 | + enable_submit_btn(form); | |
| 151 | +}; | |
| 152 | + | |
| 153 | +var enable_submit_btn = function (form) { | |
| 154 | + var subBtn = $('button[type=submit]', form); | |
| 155 | + if (subBtn) { | |
| 156 | + subBtn.removeClass('disabled').removeAttr('disabled'); | |
| 157 | + } | |
| 158 | +}; | |
| 159 | + | |
| 160 | +var disabled_submit_btn = function (form) { | |
| 161 | + var subBtn = $('button[type=submit]', form); | |
| 162 | + if (subBtn) { | |
| 163 | + subBtn.addClass('disabled').attr('disabled', 'disabled'); | |
| 164 | + } | |
| 165 | +}; | |
| 166 | + | |
| 167 | + | |
| 168 | +function showUpdateDescription() { | |
| 169 | + //更新说明 | |
| 170 | + var updateDescription = { | |
| 171 | + date: '2017-11-25_中午', | |
| 172 | + text: '<h5>1、修复这个版本的一个问题,这个问题导致首站和第二站重叠的时候无法发车。</h5><h5>2、修复455路因 昌邑路民生路 和 昌邑路苗圃路 站点顺序颠倒引发的上下行跳动问题。</h5><h5>3、放宽对中途站的检测机制,如果仍然有线路出现上下行乱跳的问题,及时上报管理员。</h5>' | |
| 173 | + }; | |
| 174 | + | |
| 175 | + var storage = window.localStorage | |
| 176 | + , key = 'update_' + updateDescription.date; | |
| 177 | + var text = storage.getItem(key); | |
| 178 | + if (!text) { | |
| 179 | + var modal = '<div class="uk-modal" id="update-description-modal">' + | |
| 180 | + ' <div class="uk-modal-dialog">' + | |
| 181 | + ' <a class="uk-modal-close uk-close"></a>' + | |
| 182 | + ' <div class="uk-modal-header">' + | |
| 183 | + ' <h2>' + updateDescription.date + ' 更新说明</h2></div>' + updateDescription.text + | |
| 184 | + ' </div>'; | |
| 185 | + | |
| 186 | + show_modal('#update-description-modal', modal); | |
| 187 | + storage.setItem(key, updateDescription.text); | |
| 188 | + } | |
| 189 | +} | |
| 0 | 190 | \ No newline at end of file | ... | ... |
src/main/resources/static/real_control_v3/js/north/toolbar.js
0 → 100644
| 1 | +/* main.html north toolbar js */ | |
| 2 | + | |
| 3 | +var gb_northToolbar = (function () { | |
| 4 | + | |
| 5 | + var modal_opts = {center: true, bgclose: false}; | |
| 6 | + var currentUser; | |
| 7 | + | |
| 8 | + var init = function () { | |
| 9 | + $.get('/real_control_v3/fragments/north/toolbar.html', function (temp) { | |
| 10 | + ep.emit("template", temp); | |
| 11 | + }); | |
| 12 | + | |
| 13 | + $.get('/real_control_v3/js/data/json/north_toolbar.json', function (data) { | |
| 14 | + ep.emit("data", data); | |
| 15 | + }); | |
| 16 | + | |
| 17 | + //查询线调权限信息 | |
| 18 | + $.get('/freeLogin/realControAuthority/findByCurrentUser', {userId: 0}, function (rs) { | |
| 19 | + ep.emit("xd_auth", rs); | |
| 20 | + }); | |
| 21 | + | |
| 22 | + var xd_auth;//线调权限 | |
| 23 | + var ep = EventProxy.create("template", "data", 'xd_auth', function (temp, data, auth) { | |
| 24 | + var tempId = '#north-toolbar-temp'; | |
| 25 | + xd_auth = auth; | |
| 26 | + currentUser = {}; | |
| 27 | + var t = $(tempId, temp).html() | |
| 28 | + , htmlStr = template.render(t)({list: data, user: currentUser}); | |
| 29 | + $('.north .north-toolbar').html(htmlStr); | |
| 30 | + | |
| 31 | + //exit | |
| 32 | + $('.north .north-toolbar .exit-system').on('click', function () { | |
| 33 | + //关闭websocket 连接 | |
| 34 | + gb_sch_websocket.sock().close(1000, '退出线调'); | |
| 35 | + window.location.href = '/pages/control/lineallot_v3/iframe_wrap.html'; | |
| 36 | + }); | |
| 37 | + | |
| 38 | + //过滤菜单 | |
| 39 | + var excludes=[]; | |
| 40 | + if(xd_auth.excludeMenus) | |
| 41 | + excludes=xd_auth.excludeMenus.split(','); | |
| 42 | + if(excludes.length>0){ | |
| 43 | + $('li.event', '#north_toolbar_panel').each(function () { | |
| 44 | + if(excludes.indexOf($('a', this).data('event'))!=-1) | |
| 45 | + $(this).remove(); | |
| 46 | + }); | |
| 47 | + } | |
| 48 | + }); | |
| 49 | + }; | |
| 50 | + | |
| 51 | + init(); | |
| 52 | + $(document).on('click', '#north_toolbar_panel li.event a', function () { | |
| 53 | + var event = $(this).data('event'); | |
| 54 | + handler[event] && handler[event](); | |
| 55 | + }); | |
| 56 | + | |
| 57 | + //electron环境 | |
| 58 | + if(isElectron){ | |
| 59 | + tempId = '#north-toolbar-electron-temp'; | |
| 60 | + //最小化 | |
| 61 | + $(document).on('click', '#mnavbarIconBtnMIN', function () { | |
| 62 | + ipcMain.send('webPageMainWindowMinimize'); | |
| 63 | + }); | |
| 64 | + //关闭 | |
| 65 | + $(document).on('click', '#mnavbarIconBtnCLOSE', function () { | |
| 66 | + ipcMain.send('webPageMainWindowClose'); | |
| 67 | + }); | |
| 68 | + } | |
| 69 | + | |
| 70 | + var handler = { | |
| 71 | + gps_play_back: function () { | |
| 72 | + gb_map_play_back.initParams(); | |
| 73 | + } | |
| 74 | + }; | |
| 75 | + | |
| 76 | + return { | |
| 77 | + user: function () { | |
| 78 | + return currentUser; | |
| 79 | + }, | |
| 80 | + init: init | |
| 81 | + } | |
| 82 | +})(); | ... | ... |
src/main/resources/static/real_control_v3/js/utils/dispatch_pattern.js
0 → 100644
| 1 | +/** 调度模式 */ | |
| 2 | + | |
| 3 | +//主调和监控模式 | |
| 4 | +var operationMode = window.localStorage.getItem('operationMode'); | |
| 5 | +var gb_dp_initHttpIntercept = function () { | |
| 6 | + $(document).off('ajaxSend', interceptPOST); | |
| 7 | + $('body>.north').removeClass('monitor main'); | |
| 8 | + if (operationMode == 0) { | |
| 9 | + $('body>.north').addClass('monitor'); | |
| 10 | + $(document).on('ajaxSend', interceptPOST); | |
| 11 | + } | |
| 12 | + else | |
| 13 | + $('body>.north').addClass('main'); | |
| 14 | + | |
| 15 | +}; | |
| 16 | + | |
| 17 | +gb_dp_initHttpIntercept(); | |
| 18 | +//gb_delay_write_log(); | |
| 19 | + | |
| 20 | +//拦截POST请求 | |
| 21 | +function interceptPOST(e, xhr, t) { | |
| 22 | + if (t && (t.method == 'POST' || t.type == 'POST')) { | |
| 23 | + xhr.abort(); | |
| 24 | + notify_err('监控模式!'); | |
| 25 | + } | |
| 26 | +} | |
| 27 | + | |
| 28 | +//全局 ajaxError 事件 | |
| 29 | +$(document).ajaxError(function (event, jqxhr) { | |
| 30 | + if (jqxhr.status == 403) { | |
| 31 | + UIkit.modal.alert('<span style="color: red;">访问被拒绝,你没有这个权限!</span>', {labels: {Ok: '确定'}}); | |
| 32 | + } | |
| 33 | +}); | ... | ... |