Commit b2765c8a7f4c03e825ef8ef4c55f7da5a7cb7799

Authored by lizhuojun
1 parent 49745251

新增免登录线调页面

Showing 56 changed files with 9386 additions and 0 deletions
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> &nbsp;发送</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> &nbsp;发送</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> &nbsp;发送</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 + &nbsp;&nbsp;
  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 + &nbsp;
  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>&nbsp;&nbsp;<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 + &nbsp;
  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
  1 +[
  2 + {
  3 + "id": 3,
  4 + "text": "车载设备",
  5 + "children": [
  6 + {
  7 + "id": 3.4,
  8 + "text": "轨迹回放",
  9 + "event": "gps_play_back"
  10 + }
  11 + ]
  12 + }
  13 +]
0 14 \ No newline at end of file
... ...
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 +});
... ...
src/main/resources/static/real_control_v3/js/websocket/sch_websocket.js 0 → 100644
  1 +var gb_sch_websocket = (function () {
  2 +
  3 + var temps;
  4 + $.get('/real_control_v3/fragments/line_schedule/sys_mailbox.html', function (dom) {
  5 + temps = gb_common.compileTempByDom(dom);
  6 + });
  7 +
  8 + var schSock = null;
  9 + var recInterval = null;
  10 + var reConnSpace = 1500;//重连间隔
  11 + var reConnCount; //重连次数
  12 + var maxReConn = 6; //最多重连次数
  13 + var new_conn = function () {
  14 + schSock = new SockJS('/freeLogin/sockjs/realcontrol');
  15 + schSock.onopen = function (e) {
  16 + if(reConnCount && reConnCount > 1){
  17 + gb_schedule_table.refreshAll();
  18 + console.log('重新连接,刷新班次');
  19 + }
  20 + reConnCount = 1;
  21 + clearInterval(recInterval);
  22 + console.log('webSocket[realcontrol] onopen');
  23 + $('body>.north').removeClass('scok-colse');
  24 + setTimeout(regListen, 500);
  25 + };
  26 +
  27 + //接收消息
  28 + schSock.onmessage = function (e) {
  29 + try {
  30 + var jsonMsg = $.parseJSON(e.data);
  31 + msgHandle[jsonMsg.fn](jsonMsg);
  32 + } catch (e) {
  33 + console.log(e, e.data);
  34 + }
  35 + };
  36 +
  37 + //断开
  38 + schSock.onclose = function (e) {
  39 + console.log('和服务器连接断开....', e);
  40 + $('body>.north').addClass('scok-colse');
  41 + //1.5秒后重新连接
  42 + recInterval = setTimeout(function () {
  43 + reConnCount++;
  44 + if(reConnCount > maxReConn){
  45 + $('body>.north').addClass('re_conn_error');
  46 + clearInterval(recInterval);
  47 + return;
  48 + }
  49 + new_conn();
  50 + }, reConnSpace * reConnCount);
  51 + };
  52 + };
  53 +
  54 + //初始化websocket连接
  55 + new_conn();
  56 +
  57 + function regListen() {
  58 + //注册线路监听
  59 + var data = {
  60 + operCode: 'register_line',
  61 + idx: gb_data_basic.line_idx
  62 + };
  63 + schSock.send(JSON.stringify(data));
  64 + console.log('regListen....', data);
  65 + }
  66 +
  67 + /**
  68 + * 计算未处理消息
  69 + */
  70 + var calcUntreated = function (lineCode) {
  71 + var size = $('li.line_schedule[data-id=' + lineCode + '] .sys-mailbox .sys-mail-item').length;
  72 + $('#badge_untreated_num_' + lineCode).text(size);
  73 + };
  74 +
  75 + var calcUntreatedAll = function () {
  76 + $('#main-tab-content li.line_schedule').each(function () {
  77 + calcUntreated($(this).data('id'));
  78 + });
  79 + };
  80 +
  81 +
  82 + //80协议上报
  83 + var report80 = function (msg) {
  84 + msg.dateStr = moment(msg.timestamp).format('HH:mm');
  85 + msg.text = gb_common.reqCode80[msg.data.requestCode];
  86 + if (!msg.text)
  87 + msg.text = '(未知的请求码 ' + msg.data.requestCode + ')';
  88 +
  89 + var $item = $(temps['sys-note-80-temp'](msg));
  90 + findMailBox(msg.data.lineId).prepend($item);
  91 + //tts
  92 + var ttsMsg = $item.find('.uk-panel-title').text();
  93 + gb_tts.speak(ttsMsg, msg.data.lineId);
  94 +
  95 + calcUntreated(msg.data.lineId);
  96 + };
  97 +
  98 + var safeDriv = function (msg) {
  99 + gb_safe_driv.pop(msg.t);
  100 + };
  101 +
  102 + /**
  103 + * 自动误点调整
  104 + * @param msg
  105 + */
  106 + var autoWdtz = function (msg) {
  107 + var schId = msg.id;
  108 + var minute = msg.minute;
  109 + var lineCode = msg.lineCode;
  110 + gb_schedule_table.showLateBadge(lineCode, schId, minute);
  111 + if(msg['cancelId']){
  112 + gb_schedule_table.cancelLateBadge(lineCode, msg['cancelId']);
  113 + }
  114 + };
  115 +
  116 + var waitRemoves = [];
  117 + //车辆发出
  118 + var faChe = function (msg) {
  119 + gb_schedule_table.updateSchedule(msg.t);
  120 + msg.domId = 'fache_' + msg.t.id + '_' + parseInt(Math.random() * 10000);
  121 +
  122 + var $item = $(temps['sys-note-42-temp'](msg));
  123 + findMailBox(msg.t.xlBm).prepend($item);
  124 + waitRemoves.push({
  125 + t: currentSecond(),
  126 + dom: msg.domId
  127 + });
  128 +
  129 + //tts
  130 + var ttsMsg = $item.find('.title').text();
  131 + gb_tts.speak(ttsMsg, msg.t.xlBm);
  132 + gb_schedule_table.calc_yfwf_num(msg.t.xlBm);
  133 +
  134 + calcUntreated(msg.t.xlBm);
  135 + };
  136 +
  137 + //到达终点
  138 + var zhongDian = function (msg) {
  139 + gb_schedule_table.updateSchedule(msg.t);
  140 + gb_schedule_table.updateSchedule(msg.nt);
  141 + msg.domId = 'zhongDian_' + msg.t.id + '_' + parseInt(Math.random() * 10000);
  142 +
  143 + var $item = $(temps['sys-note-42_1-temp'](msg));
  144 + findMailBox(msg.t.xlBm).prepend($item);
  145 + waitRemoves.push({
  146 + t: currentSecond(),
  147 + dom: msg.domId
  148 + });
  149 + //tts
  150 + var ttsMsg = $item.find('.title').text();
  151 + gb_tts.speak(ttsMsg, msg.t.xlBm);
  152 +
  153 + calcUntreated(msg.t.xlBm);
  154 + //更新路牌公里统计面板
  155 + gb_schedule_table.showLpMileageTipBySch(msg.t);
  156 + };
  157 +
  158 + //服务器通知刷新班次
  159 + var refreshSch = function (msg) {
  160 + gb_schedule_table.updateSchedule(msg.ts);
  161 + /*//重新计算应发未发
  162 + var idx={};
  163 + $.each(msg.ts, function(i, t){
  164 + if(idx[t.xlBm])
  165 + return true;
  166 + gb_schedule_table.calc_yfwf_num(t.xlBm);
  167 + idx[t.xlBm]=1;
  168 + });*/
  169 + };
  170 +
  171 + //80消息确认
  172 + var d80Confirm = function (msg) {
  173 + $('.sys-mailbox .sys-note-80[data-id=' + msg.id + ']').remove();
  174 + //重新计算未读消息
  175 + calcUntreated(msg.lineId);
  176 + //重新计算应发未发
  177 + gb_schedule_table.calc_yfwf_num(msg.lineId);
  178 + };
  179 +
  180 + //指令状态改变
  181 + var directiveStatus = function (msg) {
  182 + gb_schedule_table.updateSchedule(msg.t);
  183 + };
  184 +
  185 + //班次信号状态
  186 + var signalState = function (msg) {
  187 + gb_signal_state.put(msg.data);
  188 + };
  189 +
  190 + var msgHandle = {
  191 + report80: report80,
  192 + faChe: faChe,
  193 + zhongDian: zhongDian,
  194 + refreshSch: refreshSch,
  195 + d80Confirm: d80Confirm,
  196 + directive: directiveStatus,
  197 + signal_state: signalState,
  198 + deviceOffline: deviceOffline,
  199 + safeDriv: safeDriv,
  200 + auto_wdtz: autoWdtz
  201 + };
  202 +
  203 + function currentSecond() {
  204 + return Date.parse(new Date()) / 1000;
  205 + }
  206 +
  207 + var mailBoxs = {};
  208 +
  209 + function findMailBox(lineCode) {
  210 + if (mailBoxs[lineCode])
  211 + return mailBoxs[lineCode];
  212 +
  213 + var mbox = $('li.line_schedule[data-id=' + lineCode + ']').find('div.sys-mailbox');
  214 + mailBoxs[lineCode] = mbox;
  215 + return mbox;
  216 + }
  217 +
  218 +
  219 + //42确定
  220 + $(document).on('click', '.sys-mailbox .sys-note-42 .uk-button-primary', function (e) {
  221 + e.stopPropagation();
  222 + $(this).parents('.sys-note-42').remove();
  223 + var size = $(this).parents('.sys-mailbox').find('.sys-mail-item').length
  224 + , lineCode = $(this).data('line');
  225 +
  226 + $('#badge_untreated_num_' + lineCode).text(size);
  227 + });
  228 +
  229 + //42消息点击
  230 + $(document).on('click', '.sys-mailbox .sys-note-42', function () {
  231 + var lineCode = $(this).parents('li.line_schedule').data('id')
  232 + , id = $(this).data('id');
  233 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  234 + var dl = gb_schedule_table.scroToDl(sch);
  235 + //高亮
  236 + gb_schedule_table.reset_drag_active_all(dl);
  237 + dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click');
  238 + });
  239 +
  240 + //80消息点击
  241 + $(document).on('click', '.sys-mailbox .sys-note-80', function () {
  242 + var lineCode = $(this).parents('li.line_schedule').data('id')
  243 + , id = $(this).data('schid');
  244 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  245 + var dl = gb_schedule_table.scroToDl(sch);
  246 + //高亮
  247 + gb_schedule_table.reset_drag_active_all(dl);
  248 + dl.addClass('relevance-active intimity').find('dd:eq(5)').trigger('click');
  249 + });
  250 +
  251 + //80同意
  252 + $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button-primary', function (e) {
  253 + e.stopPropagation();
  254 + $(this).attr('disabled', 'disabled');
  255 + var panel = $(this).parents('.sys-note-80')
  256 + , id = panel.data('id');
  257 +
  258 + reply80({id: id, reply: 0});
  259 + return false;
  260 + });
  261 +
  262 + //80不同意
  263 + $(document).on('click', '.sys-mailbox .sys-note-80 .uk-button.reject', function (e) {
  264 + e.stopPropagation();
  265 + $(this).attr('disabled', 'disabled');
  266 + var panel = $(this).parents('.sys-note-80')
  267 + , id = panel.data('id');
  268 +
  269 + reply80({id: id, reply: -1});
  270 + return false;
  271 + });
  272 +
  273 + var reply80 = function (data, cb) {
  274 + gb_common.$post('/directive/reply80', data, function (rs) {
  275 + if (rs.msg)
  276 + notify_succ(rs.msg);
  277 + cb && cb();
  278 + });
  279 + };
  280 +
  281 +
  282 + //定时到离站信使清理掉
  283 + !function () {
  284 + var f = arguments.callee,
  285 + ct = Date.parse(new Date()) / 1000,
  286 + item, elem;
  287 + try {
  288 + for (var i = 0; i < 1000; i++) {
  289 + if (waitRemoves.length == 0)
  290 + break;
  291 + item = waitRemoves[0];
  292 + if (ct - item.t >= 30) {
  293 + waitRemoves.shift();
  294 + elem = $('#' + item.dom);
  295 + if (elem)
  296 + elem.remove();
  297 + }
  298 + }
  299 + } catch (e) {
  300 + console.log(e);
  301 + }
  302 +
  303 + //计算未读消息
  304 + calcUntreatedAll();
  305 + setTimeout(f, 5000);
  306 + }();
  307 +
  308 + /**
  309 + * 设备掉线
  310 + * @param msg
  311 + */
  312 + function deviceOffline(msg) {
  313 + gb_data_gps.deviceOffline(msg.gps);
  314 + }
  315 +
  316 + /**
  317 + * 信号撤销
  318 + */
  319 + $(document).on('click','.sys-note-42 .cancel_link', function () {
  320 + var id = $(this).data('id'),
  321 + lineCode = $(this).data('line');
  322 +
  323 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  324 + if(!sch)
  325 + return;
  326 +
  327 + var confirmBtn = $(this).parent().find('.uk-button-primary');
  328 + var type = $(this).data('type');
  329 + var fun = type==1?gb_schedule_context_menu.cxzx:gb_schedule_context_menu.cxsf;
  330 +
  331 + fun(sch, function () {
  332 + confirmBtn.trigger('click');
  333 + });
  334 + });
  335 +
  336 + /**
  337 + * 到站信号修改
  338 + */
  339 + $(document).on('click', '.sys-note-42 .edit_link', function () {
  340 + var id = $(this).data('id'),
  341 + lineCode = $(this).data('line');
  342 +
  343 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  344 + if(!sch)
  345 + return;
  346 +
  347 + var nextSch = gb_schedule_table.getNextSch(sch);
  348 + gb_schedule_context_menu.dftz(nextSch);
  349 + });
  350 +
  351 + /**
  352 + * 信使 sys-note-80 编辑
  353 + */
  354 + $(document).on('click', '.sys-note-80 .edit_link', function () {
  355 + var id = $(this).data('id'),
  356 + lineCode = $(this).data('line');
  357 +
  358 + var sch = gb_schedule_table.findScheduleByLine(lineCode)[id];
  359 + if(!sch)
  360 + return;
  361 +
  362 + gb_schedule_context_menu.fcxxwt(sch);
  363 + });
  364 +
  365 + return {
  366 + sock: function () {
  367 + return schSock;
  368 + }
  369 + };
  370 +})();
... ...
src/main/resources/static/real_control_v3/main.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" 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/accordion.gradient.min.css" merge="plugins"/>
  14 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" merge="plugins"/>
  15 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" merge="plugins"/>
  16 +
  17 + <!-- main style -->
  18 + <link rel="stylesheet" href="/real_control_v2/css/main.css" />
  19 + <!-- north style -->
  20 + <link rel="stylesheet" href="/real_control_v2/css/north.css" merge="custom_style"/>
  21 + <!-- home style -->
  22 + <link rel="stylesheet" href="/real_control_v2/css/home.css" merge="custom_style"/>
  23 + <!-- line style -->
  24 + <link rel="stylesheet" href="/real_control_v2/css/line_schedule.css" merge="custom_style"/>
  25 + <link rel="stylesheet" href="/real_control_v2/css/line_schedule_table.css" merge="custom_style"/>
  26 +
  27 + <link rel="stylesheet" href="/real_control_v2/css/sch_autocomp_result.css" merge="custom_style"/>
  28 + <!-- custom table -->
  29 + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" merge="custom_style"/>
  30 + <!-- jquery contextMenu style -->
  31 + <link rel="stylesheet" href="/real_control_v2/assets/css/jquery.contextMenu.min.css" merge="plugins"/>
  32 + <!-- formvalidation style -->
  33 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/formvalidation/formValidation.min.css" merge="plugins"/>
  34 + <!-- js tree -->
  35 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" merge="plugins"/>
  36 + <!-- tooltip css-->
  37 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.css" merge="plugins"/>
  38 + <link rel="stylesheet" href="/real_control_v2/css/pace.css" merge="plugins"/>
  39 +
  40 + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" merge="custom_style"/>
  41 + <!-- perfect-scrollbar style -->
  42 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" merge="plugins"/>
  43 + <!-- layer 3.0.3 -->
  44 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" merge="plugins"/>
  45 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" merge="plugins"/>
  46 +
  47 + <!-- flatpickr -->
  48 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" merge="plugins">
  49 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" merge="plugins">
  50 +</head>
  51 +
  52 +<body>
  53 +<div class="north uk-width-1-1 uk-panel-box">
  54 + <div class="uk-grid uk-grid-match">
  55 + <div class="uk-width-4-10">
  56 + <div class="uk-panel">
  57 + <h2 class="north-logo">
  58 + <i class="uk-icon-life-ring"></i> 嘉定公交线路调度
  59 + </h2>
  60 + </div>
  61 + </div>
  62 + <div class="uk-width-6-10">
  63 + <div class="uk-panel uk-width north-toolbar"></div>
  64 + </div>
  65 + </div>
  66 + <div class="north-tabs"></div>
  67 +</div>
  68 +
  69 +<div class="main-container">
  70 + <div class="load-panel">
  71 + <i class="uk-icon-spinner uk-icon-spin"></i>
  72 + 正在加载数据
  73 + </div>
  74 +</div>
  75 +
  76 +<script>
  77 +/* var gb_beforeunload_fun = function (e) {
  78 + var confirmationMessage = "\o/";
  79 + (e || window.event).returnValue = confirmationMessage;
  80 + return confirmationMessage;
  81 + }
  82 + window.addEventListener("beforeunload", gb_beforeunload_fun);*/
  83 +
  84 + delete window.exports;
  85 + delete window.module;
  86 +
  87 + var ipcMain;
  88 + //是否处于electron环境下
  89 + var isElectron = (function () {
  90 + try {
  91 + if (process.versions.electron)
  92 + return true;
  93 + else
  94 + return false;
  95 + }
  96 + catch (e) {
  97 + return false;
  98 + }
  99 + })();
  100 +
  101 + if (isElectron) {
  102 + var link = document.createElement("link");
  103 + link.type = "text/css";
  104 + link.rel = "stylesheet";
  105 + link.href = "/real_control_v2/css/electron.css";
  106 + document.getElementsByTagName("head")[0].appendChild(link);
  107 +
  108 + ipcMain = require('electron').ipcRenderer;
  109 + }
  110 +</script>
  111 +
  112 +<!-- 地图相关 -->
  113 +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
  114 +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script>
  115 +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script>
  116 +<script src="/assets/js/TransGPS.js" merge="plugins"></script>
  117 +<!-- 高德 -->
  118 +<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script>
  119 +<!-- jquery -->
  120 +<script src="/real_control_v2/assets/js/jquery.min.js"></script>
  121 +<!-- jquery actual -->
  122 +<script src="/real_control_v2/assets/js/jquery.actual.min.js" merge="plugins"></script>
  123 +<!-- jquery.serializejson JSON序列化插件 -->
  124 +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script>
  125 +<!-- moment.js 日期处理类库 -->
  126 +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>
  127 +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script>
  128 +
  129 +<!-- flatpickr -->
  130 +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" merge="plugins"></script>
  131 +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" merge="plugins"></script>
  132 +
  133 +<!-- perfect-scrollbar -->
  134 +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" merge="plugins"></script>
  135 +<!-- common js -->
  136 +<script src="/real_control_v2/js/common.js"></script>
  137 +<!-- art-template 模版引擎 -->
  138 +<script src="/assets/plugins/template.js" merge="plugins"></script>
  139 +<!-- d3 -->
  140 +<script src="/assets/js/d3.min.js"></script>
  141 +<!-- EventProxy -->
  142 +<script src="/assets/js/eventproxy.js"></script>
  143 +<!-- main js -->
  144 +<script src="/real_control_v3/js/main.js"></script>
  145 +<!-- uikit core -->
  146 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" merge="uikit_js"></script>
  147 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" merge="uikit_js"></script>
  148 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/pagination.min.js" merge="uikit_js"></script>
  149 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js" merge="uikit_js"></script>
  150 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js" merge="uikit_js"></script>
  151 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" merge="uikit_js"></script>
  152 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/timepicker.min.js" merge="uikit_js"></script>
  153 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/lightbox.min.js" merge="uikit_js"></script>
  154 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" merge="uikit_js"></script>
  155 +
  156 +
  157 +<!-- jquery contextMenu -->
  158 +<script src="/real_control_v2/assets/js/jquery.contextMenu.min.js" merge="plugins"></script>
  159 +<script src="/real_control_v2/assets/js/jquery.ui.position.min.js" merge="plugins"></script>
  160 +<!-- formvalidation- -->
  161 +<script src="/real_control_v2/assets/plugins/formvalidation/formValidation.min.js" merge="plugins"></script>
  162 +<script src="/real_control_v2/assets/plugins/formvalidation/zh_CN.js" merge="plugins"></script>
  163 +<script src="/real_control_v2/assets/plugins/formvalidation/uikit.min.js" merge="plugins"></script>
  164 +<!-- js tree -->
  165 +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" merge="plugins"></script>
  166 +<!-- simple pinyin -->
  167 +<script src="/assets/plugins/pinyin.js" merge="plugins"></script>
  168 +<!-- qtip -->
  169 +<script src="/real_control_v2/assets/plugins/qtip/jquery.qtip.min.js" merge="plugins"></script>
  170 +<!-- layer 3.0.3 -->
  171 +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js" merge="plugins"></script>
  172 +
  173 +<!-- 数据 -->
  174 +<script src="/real_control_v3/js/data/data_basic.js" merge="custom_js"></script>
  175 +<script src="/real_control_v3/js/data/data_gps.js" merge="custom_js"></script>
  176 +<script src="/real_control_v3/js/data/gps_abnormal.js" merge="custom_js"></script>
  177 +<!-- 线路模拟图 -->
  178 +<script src="/real_control_v2/js/utils/svg_chart.js" merge="custom_js"></script>
  179 +<script src="/real_control_v2/js/utils/svg_data_convert.js" merge="custom_js"></script>
  180 +<script src="/real_control_v2/js/utils/svg_chart_tooltip.js" merge="custom_js"></script>
  181 +<script src="/real_control_v2/js/utils/svg_chart_map.js" merge="custom_js"></script>
  182 +
  183 +<!-- custom table js -->
  184 +<script src="/real_control_v2/js/utils/ct_table.js" merge="custom_js"></script>
  185 +<!-- north js -->
  186 +<script src="/real_control_v3/js/north/toolbar.js" merge="custom_js"></script>
  187 +<script src="/real_control_v2/js/north/tabs.js" merge="custom_js"></script>
  188 +<script src="/real_control_v2/js/north/second_timer.js" merge="custom_js"></script>
  189 +<!-- home js -->
  190 +<script src="/real_control_v3/js/home/layout.js" merge="custom_js"></script>
  191 +<script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script>
  192 +<!--<script src="/real_control_v2/js/home/context_menu.js" merge="custom_js"></script>-->
  193 +<!-- line schedule js -->
  194 +<script src="/real_control_v2/js/line_schedule/legend.js" merge="custom_js"></script>
  195 +<script src="/real_control_v3/js/line_schedule/layout.js" merge="custom_js"></script>
  196 +<script src="/real_control_v3/js/line_schedule/sch_table.js" merge="custom_js"></script>
  197 +<!--<script src="/real_control_v3/js/line_schedule/context_menu.js" merge="custom_js"></script>-->
  198 +<script src="/real_control_v3/js/line_schedule/dbclick.js" merge="custom_js"></script>
  199 +<script src="/real_control_v2/js/line_schedule/search.js" merge="custom_js"></script>
  200 +<script src="/real_control_v2/js/line_schedule/badge_tooltip.js" merge="custom_js"></script>
  201 +<script src="/real_control_v2/js/line_schedule/mileage_count.js" merge="custom_js"></script>
  202 +
  203 +
  204 +<!-- websocket -->
  205 +<script src="/real_control_v2/assets/plugins/sockjs-client/sockjs.min.js"></script>
  206 +<script src="/real_control_v3/js/websocket/sch_websocket.js" merge="custom_js"></script>
  207 +<!-- tts -->
  208 +<script src="/real_control_v2/js/utils/tts.js" merge="custom_js"></script>
  209 +
  210 +<!-- echart -->
  211 +<script src="/real_control_v2/assets/echarts-3/echarts.js" merge="plugins"></script>
  212 +<!-- Geolib -->
  213 +<script src="/real_control_v2/geolib/geolib.js" merge="plugins"></script>
  214 +
  215 +<script src="/real_control_v2/js/signal_state/signal_state.js" merge="custom_js"></script>
  216 +<script src="/real_control_v3/js/utils/dispatch_pattern.js" merge="custom_js"></script>
  217 +
  218 +<!-- 处理表单片段嵌入问题 -->
  219 +<script src="/real_control_v2/js/forms/form_embed.js" merge="custom_js"></script>
  220 +<!-- 模态框扩展 -->
  221 +<script src="/real_control_v2/js/modal_extend.js" merge="custom_js"></script>
  222 +
  223 +<!-- #### 安全驾驶 start ### -->
  224 +<div class="safe_driv_pop_wrap" ></div>
  225 +<script id="safe_driv_item-temp" type="text/html">
  226 + <div class="safe_driv_pop uk-animation-slide-bottom" data-nbbm="{{clzbh}}" data-type="{{yczltype}}" data-title="{{clzbh}} {{timeStr}} {{ycztText}}" data-url="{{url}}">
  227 + <div>
  228 + <span class="title">异常&nbsp;{{clzbh}}</span>
  229 + <span class="text"> {{timeStr}} 出现违规驾驶({{ycztText}})</span>
  230 + <span class="desc">--安全驾驶监管平台</span>
  231 + </div>
  232 + </div>
  233 +</script>
  234 +
  235 +</body>
  236 +
  237 +</html>
... ...
src/main/resources/static/real_control_v3/mapmonitor/fragments/map_config.html 0 → 100644
  1 +<div>
  2 + <script id="map-config-form-temp" type="text/html">
  3 + <form class="uk-form uk-form-stacked">
  4 + <div class="uk-form-row">
  5 + <span class="uk-form-label">图层</span>
  6 + <div class="uk-form-controls">
  7 + <label><input type="radio" value="baidu" name="map_type" {{if map_type=='baidu'}}checked{{/if}}> 百度</label>
  8 + <label><input type="radio" value="gaode" name="map_type" {{if map_type=='gaode'}}checked{{/if}}> 高德</label>
  9 + <label><input type="checkbox" name="traffic" {{if traffic}}checked{{/if}}> 实时路况</label>
  10 + </div>
  11 + </div>
  12 +
  13 + <div class="uk-form-row">
  14 + <span class="uk-form-label">空间数据</span>
  15 + <div class="uk-form-controls">
  16 + <label><input type="checkbox" name="spatial_data_station" {{if spatialData.station}}checked{{/if}}> 站点</label>
  17 + <label><input type="checkbox" name="spatial_electronicFence" {{if spatialData.electronicFence}}checked{{/if}}> 电子围栏</label>
  18 + <label><input type="checkbox" name="spatial_data_carPark" {{if spatialData.carPark}}checked{{/if}}> 停车场</label>
  19 + </div>
  20 + </div>
  21 +
  22 + <div class="uk-form-row">
  23 + <span class="uk-form-label">车辆图标</span>
  24 + <div class="uk-form-controls">
  25 + <label><input name="carIcon_angle" type="checkbox" {{if carIcon.angle}}checked{{/if}}> 标示角度</label>
  26 + <!--<label><input class="disabled" disabled type="checkbox" {{if carIcon.converge}}checked{{/if}}> 聚合</label>-->
  27 + </div>
  28 + </div>
  29 + <div class="uk-form-row">
  30 + <span class="uk-form-label">异常警报</span>
  31 + <div class="uk-form-controls">
  32 + <label><input type="checkbox" {{if abnormalPrint.speeding}}checked{{/if}}> 超速</label>
  33 + <label><input type="checkbox" {{if abnormalPrint.outBounds}}checked{{/if}}> 越界</label>
  34 + <label><input type="checkbox" {{if abnormalPrint.largeMargin}}checked{{/if}}> 大间隔</label>
  35 + </div>
  36 + </div>
  37 + <div class="uk-form-row">
  38 + <span class="uk-form-label">车辆颜色</span>
  39 + <div class="uk-form-controls">
  40 + <div class="color_block">
  41 + 上行
  42 + <div class="sp-placeholder">
  43 + <div class="sp-placeholder-color" data-name="carIcon.color.up" style="background: {{carIcon.color.up}}"></div>
  44 + </div>
  45 + </div>
  46 +
  47 + <div class="color_block">
  48 + 下行
  49 + <div class="sp-placeholder">
  50 + <div class="sp-placeholder-color" data-name="carIcon.color.down" style="background: {{carIcon.color.down}}"></div>
  51 + </div>
  52 + </div>
  53 +
  54 + <div class="color_block">
  55 + 非营运
  56 + <div class="sp-placeholder">
  57 + <div class="sp-placeholder-color" data-name="carIcon.color.nonOperation" style="background: {{carIcon.color.nonOperation}}"></div>
  58 + </div>
  59 + </div>
  60 + </div>
  61 + </div>
  62 +
  63 + <div class="uk-form-row">
  64 + <span class="uk-form-label">路段颜色</span>
  65 + <div class="uk-form-controls">
  66 + <div class="color_block">
  67 + 上行
  68 + <div class="sp-placeholder">
  69 + <div class="sp-placeholder-color" data-name="section.color.up" style="background: {{section.color.up}}"></div>
  70 + </div>
  71 + </div>
  72 +
  73 + <div class="color_block">
  74 + 下行
  75 + <div class="sp-placeholder">
  76 + <div class="sp-placeholder-color" data-name="section.color.down" style="background: {{section.color.down}}"></div>
  77 + </div>
  78 + </div>
  79 + </div>
  80 + </div>
  81 + </form>
  82 + </script>
  83 +</div>
  84 +<!-- 1111 -->
0 85 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/fragments/map_infowindow.html 0 → 100644
  1 +<div>
  2 + <script id="map-win-gps-detail-temp" type="text/html">
  3 + <div class="gps_info_win" style="width: 200px;">
  4 + <h4>{{nbbm}}</h4>
  5 + <h5>
  6 + {{lineName}}
  7 + </h5>
  8 + <h5>
  9 + {{if stationName!=null}}
  10 + {{stationName}} 站
  11 + {{else}}
  12 + 未知站点
  13 + {{/if}}
  14 + </h5>
  15 + <p>设备状态:
  16 + {{if valid==1}}
  17 + invalid(-1
  18 + {{else if abnormalStatus=='outBounds'}}
  19 + 越界
  20 + {{else if abnormalStatus=='overspeed'}}
  21 + 超速
  22 + {{else if abnormalStatus=='gps-offline'}}
  23 + GPS掉线
  24 + {{else if abnormalStatus=='offline'}}
  25 + 离线
  26 + {{else}}
  27 + .
  28 + {{/if}}
  29 + </p>
  30 + <p>设备号:{{deviceId}}</p>
  31 + <p>速度:{{speed>99?'..':speed}}</p>
  32 + <p>角度:{{direction}}</p>
  33 + <p>经度:{{lon}}</p>
  34 + <p>纬度:{{lat}}</p>
  35 +
  36 + <p class="date-str">{{dateStr}}</p>
  37 + <hr>
  38 + {{if expectStopTime!=null}}
  39 + <a href="javascript:;" style="color: #07D;margin-right: 7px;">预计 {{expectStopTime}} 分钟到达终点</a>
  40 + {{/if}}
  41 + <a href="javascript:;" style="float: left;" onclick="javascript:window.open('http://180.166.5.82:9005/transport_server/dvr_monitor1.jsp?userid=4&deviceid={{deviceId}}');">DVR</a>
  42 + <a href="javascript:;" style="float: right;" onclick="javascript:gb_map_play_back.initParams('{{deviceId}}', '{{nbbm}}');">轨迹回放</a>
  43 + </div>
  44 + </script>
  45 +
  46 + <script id="map-win-station-detail-temp" type="text/html">
  47 + <div class="gps_info_win">
  48 + <h4>{{stationName}}</h4>
  49 + <p>站点编码: {{stationCode}}</p>
  50 + <p>站点类型:
  51 + {{if stationMark=='B'}}
  52 + 起点站
  53 + {{else if stationMark=='E'}}
  54 + 终点站
  55 + {{else if stationMark=='Z'}}
  56 + 中途站
  57 + {{/if}}
  58 + </p>
  59 + <p>
  60 + 经度: {{lon}}
  61 + </p>
  62 + <p>纬度: {{lat}}</p>
  63 + {{if distances > 0}}
  64 + <p>到站距离: {{distances}} 公里</p>
  65 + {{/if}}
  66 + <p>
  67 + 电子围栏类型:
  68 + {{if shapesType=='r'}}
  69 + 圆形
  70 + {{else if shapesType=='d'}}
  71 + 多边形
  72 + {{/if}}
  73 + </p>
  74 + <p>
  75 + {{if shapesType=='r'}}
  76 + 半径:{{radius}}
  77 + {{else if shapesType=='d'}}
  78 + 面积:{{_polygonArea}} 平方米
  79 + {{/if}}
  80 + </p>
  81 + </div>
  82 + </script>
  83 +
  84 + <script id="map-win-carpark-detail-temp" type="text/html">
  85 + <div class="gps_info_win">
  86 + <h4>{{parkName}}</h4>
  87 + <p>停车场编码: {{parkCode}}</p>
  88 + <p>面积:{{area}}</p>
  89 + <p>
  90 + {{if shapesType=='r'}}
  91 + 电子围栏半径:{{radius}}
  92 + {{else if shapesType=='d'}}
  93 + 电子围栏面积:{{_polygonArea}} 平方米
  94 + {{/if}}
  95 + </p>
  96 + </div>
  97 + </script>
  98 +</div>
0 99 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/fragments/playback/before_form.html 0 → 100644
  1 +<div class="uk-alert uk-alert-success">开始~结束时间最大间隔24小时</div>
  2 +<div style="width: 68%;margin: auto;" id="playback_before_form">
  3 + <form class="uk-form uk-form-horizontal" style="margin-bottom: 0 !important;">
  4 + <div class="uk-grid">
  5 + <div class="uk-width-1-1">
  6 + <div class="uk-form-row">
  7 + <label class="uk-form-label">车辆编码</label>
  8 + <div class="uk-form-controls">
  9 + <div class="uk-autocomplete uk-form autocomplete-nbbm">
  10 + <input name="nbbm" required/>
  11 + </div>
  12 + </div>
  13 + </div>
  14 + </div>
  15 + </div>
  16 + <div class="uk-grid">
  17 + <div class="uk-width-2-3">
  18 + <div class="uk-form-row">
  19 + <label class="uk-form-label">开始时间</label>
  20 + <div class="uk-form-controls">
  21 + <input name="sDate" type="date" required/>
  22 + </div>
  23 + </div>
  24 + </div>
  25 + <div class="uk-width-1-3" style="padding-left: 15px;">
  26 + <div class="uk-form-row">
  27 + <div class="uk-form-controls" style="margin-left: 0;">
  28 + <input name="sTime" type="time" required/>
  29 + </div>
  30 + </div>
  31 + </div>
  32 + </div>
  33 + <div class="uk-grid">
  34 + <div class="uk-width-2-3">
  35 + <div class="uk-form-row">
  36 + <label class="uk-form-label">结束时间</label>
  37 + <div class="uk-form-controls">
  38 + <input name="eDate" type="date" required/>
  39 + </div>
  40 + </div>
  41 + </div>
  42 + <div class="uk-width-1-3" style="padding-left: 15px;">
  43 + <div class="uk-form-row">
  44 + <div class="uk-form-controls" style="margin-left: 0;">
  45 + <input name="eTime" type="time" required/>
  46 + </div>
  47 + </div>
  48 + </div>
  49 + </div>
  50 +
  51 + <div style="text-align: center;margin-top: 25px;">
  52 + <button class="uk-button uk-button-large uk-button-primary" type="submit"><i
  53 + class="uk-icon-play-circle"> </i> 开始回放
  54 + </button>
  55 + </div>
  56 + <i class="uk-icon-spinner uk-icon-spin"
  57 + style="font-size: 18px;color: rgb(213, 31, 31);position: absolute;bottom: 25px;left: calc(50% + 70px);display: none;"></i>
  58 + </form>
  59 +
  60 + <script>
  61 + (function () {
  62 + $('#playback_before_form').on('init_form', function (e, data) {
  63 + //车辆 autocomplete
  64 + $.get('/freeLogin/basic/cars', function (rs) {
  65 + gb_common.carAutocomplete($('#playback_before_form .autocomplete-nbbm'), rs);
  66 + });
  67 +
  68 + if (data.nbbm)
  69 + $('[name=nbbm]', this).val(data.nbbm);
  70 + //默认时间
  71 + var m = moment()
  72 + , rq = 'YYYY-MM-DD', sj = 'HH:mm';
  73 + $('[name=eDate]', this).val(m.format(rq));
  74 + $('[name=eTime]', this).val(m.format('HH:mm'));
  75 + $('[name=sDate]', this).val(m.subtract(2, 'hour').format(rq));
  76 + $('[name=sTime]', this).val(m.format(sj));
  77 + });
  78 +
  79 + var ONE_DAY = 1000 * 60 * 60 * 24;
  80 + var f = $('form', '#playback_before_form').formValidation({
  81 + framework: 'uikit',
  82 + locale: 'zh_CN'
  83 + });
  84 + f.on('success.form.fv', function (e) {
  85 + e.preventDefault();
  86 + disabledBtn();
  87 + var data = $(this).serializeJSON();
  88 +
  89 + //校验时间间隔
  90 + var fs = 'YYYY-MM-DDHH:mm';
  91 + var st = moment(data.sDate + data.sTime, fs).format('X');
  92 + var et = moment(data.eDate + data.eTime, fs).format('X');
  93 +
  94 + if (et < st)
  95 + return abortSubmit('结束时间小于开始时间???');
  96 + else if ((et - st) > ONE_DAY)
  97 + return abortSubmit('时间间隔不能超过24小时!');
  98 + else if (et == st)
  99 + return abortSubmit('一点时间间隔都不给???');
  100 +
  101 + $('#playback_before_form i.uk-icon-spinner').show();
  102 + $.ajax({
  103 + url: '/gps/gpsHistory/multiple',
  104 + traditional: true,
  105 + data: {nbbmArray: [data.nbbm], st: st, et: et},
  106 + success: function (rs) {
  107 + if (!rs || rs.length == 0)
  108 + return abortSubmit('失败,服务器没有返回轨迹数据!');
  109 +
  110 + //排序
  111 + rs.sort(function (a, b) {
  112 + return a.timestamp - b.timestamp;
  113 + });
  114 + //格式化时间
  115 + $.each(rs, function () {
  116 + var mom = moment(this.timestamp);
  117 + this.timeStr = mom.format('HH:mm.ss');
  118 + this.timeStr2 = mom.format('YYYY-MM-DD HH:mm.ss');
  119 + });
  120 +
  121 + //获取路段信息
  122 + if (!rs[0] || !rs[0].lineId)
  123 + return notify_err('首个点位无效....');
  124 +
  125 + jsQueryRoads(rs[0].lineId, function (roads) {
  126 + //gps关联到路段
  127 + matchRoad(rs, roads);
  128 +
  129 + var f = $('#playback_before_form');
  130 + var fileName = $('[name=nbbm]', f).val() + '轨迹数据'
  131 + + $('[name=sDate]', f).val() + $('[name=sTime]', f).val() + '至'
  132 + + $('[name=eDate]', f).val() + $('[name=eTime]', f).val() + '.xls';
  133 +
  134 + $('#playback_before_form').parents('.uk-modal').trigger('show_play_body', {
  135 + gpsList: rs,
  136 + roads: roads,
  137 + lineCode: rs[0].lineId,
  138 + fileName: fileName.replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),'')
  139 + });
  140 + });
  141 + }
  142 + });
  143 + });
  144 +
  145 + function abortSubmit(t) {
  146 + $('#playback_before_form i.uk-icon-spinner').hide();
  147 + notify_err(t);
  148 + $('form button[type=submit]', '#playback_before_form').removeClass('disabled').removeAttr('disabled');
  149 + }
  150 +
  151 + function disabledBtn() {
  152 + $('form button[type=submit]', '#playback_before_form').addClass('disabled').attr('disabled', 'disabled');
  153 + }
  154 +
  155 + function jsQueryRoads(lineCode, cb) {
  156 + gb_common.$get('/gps/findRoadSpeed', {lineCode: lineCode}, function (rs) {
  157 + //处理路段坐标集合
  158 + var roads = rs.roads;
  159 + var cds, coordArray, array;
  160 +
  161 + for (var i = 0, road; road = roads[i++];) {
  162 + cds = road['GROAD_VECTOR'];
  163 + cds = cds.substring(11, cds.length - 1);
  164 + coordArray = cds.split(',');
  165 +
  166 + array = [];
  167 +
  168 + for (var j = 0, cd; cd = coordArray[j++];) {
  169 + var cdArray = cd.split(' ');
  170 +
  171 + //wgs84 to baidu
  172 + var bdCd = TransGPS.wgsToBD(parseFloat(cdArray[1]), parseFloat(cdArray[0]));
  173 + array.push({
  174 + longitude: bdCd.lng,
  175 + latitude: bdCd.lat
  176 + });
  177 + }
  178 + road.coords = array;
  179 + }
  180 + cb && cb(roads);
  181 + });
  182 + }
  183 +
  184 +
  185 + function matchRoad(gpsArray, roads) {
  186 + var rs;
  187 + $.each(gpsArray, function () {
  188 + rs = gpsMatchRoad(this, roads);
  189 + this.road = rs.road;
  190 + this.minDistance = rs.min;
  191 + });
  192 + }
  193 +
  194 + function gpsMatchRoad(gps, roads) {
  195 + var point = {latitude: gps.bd_lat, longitude: gps.bd_lon};
  196 +
  197 + var min, road;
  198 + $.each(roads, function () {
  199 +
  200 + var len = this.coords.length;
  201 + for (var i = 0; i < len - 1; i++) {
  202 + //点到线的距离
  203 + var distance = geolib.getDistanceFromLine(point, this.coords[i], this.coords[i + 1]);
  204 + if (min > distance || min == null) {
  205 + min = distance;
  206 + road = this;
  207 + }
  208 + }
  209 + });
  210 +
  211 + return {road: road, min: min};
  212 + }
  213 + })();
  214 + </script>
  215 +</div>
0 216 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/fragments/playback/main.html 0 → 100644
  1 +<div class="uk-modal ct-form-modal" id="map-playback-modal">
  2 + <div class="uk-modal-dialog" style="position: relative !important;margin: 50px auto !important;left: 0px !important;top: 0px !important;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <h1>轨迹回放</h1>
  5 + <div class="pb_modal_body"></div>
  6 + </div>
  7 + <script>
  8 + (function () {
  9 + var modal = '#map-playback-modal';
  10 +
  11 + $(modal).on('show_form', function (e, data) {
  12 + $('.pb_modal_body', modal).load('/real_control_v2/mapmonitor/fragments/playback/before_form.html', function () {
  13 + $('#playback_before_form', modal).trigger('init_form', data);
  14 + });
  15 + });
  16 +
  17 + //show播放界面
  18 + $(modal).on('show_play_body', function (e, data) {
  19 + $('.pb_modal_body', modal).empty();
  20 + $('.uk-modal-dialog', modal).addClass('play-back-run-modal').one('transitionend', function () {
  21 + //最小宽度
  22 + $(this).css('min-width', '1280px');
  23 + });
  24 + $('.pb_modal_body', modal).load('/real_control_v2/mapmonitor/fragments/playback/run.html', function () {
  25 + $('#playback_run_body', modal).trigger('init', data);
  26 + });
  27 + });
  28 + })();
  29 + </script>
  30 +</div>
... ...
src/main/resources/static/real_control_v3/mapmonitor/fragments/playback/run.html 0 → 100644
  1 +<div id="playback_run_body">
  2 + <div class="map_wrap"></div>
  3 + <!-- 日志输出 -->
  4 + <div class="pb_log_panel uk-animation-slide-left" style="overflow-y: auto;">
  5 + <div class="ct_table" style="height: calc(100% - 30px);">
  6 + <div class="ct_table_head">
  7 + <dl>
  8 + <dt>时间</dt>
  9 + <dt>速度</dt>
  10 + <dt>路段</dt>
  11 + <dt>状态</dt>
  12 + </dl>
  13 + </div>
  14 + <div class="ct_table_body">
  15 + </div>
  16 + </div>
  17 + </div>
  18 +
  19 + <!-- 进出站输出 -->
  20 + <div class="pb_inout_station_panel uk-animation-slide-left" style="overflow-y: auto;">
  21 + <div class="ct_table" style="height: calc(100% - 30px);">
  22 + <div class="ct_table_head">
  23 + <dl>
  24 + <dt>时间</dt>
  25 + <dt>站点</dt>
  26 + <dt>动作</dt>
  27 + </dl>
  28 + </div>
  29 + <div class="ct_table_body">
  30 + </div>
  31 + </div>
  32 + </div>
  33 + <div class="pb_footer_tools uk-animation-slide-bottom" onselectstart="return false;" style="-moz-user-select:none;">
  34 + <span class="ui-slider-tip">08:30.50</span>
  35 + <div class="uk-progress uk-progress-small uk-progress-success uk-progress-striped">
  36 + <div class="uk-progress-bar" style="width: 0;"></div>
  37 + </div>
  38 +
  39 + <div class="pb_tools_icon">
  40 + <div class="uk-button-group">
  41 + <a class="uk-button play-btn" data-type="play"><i class="uk-icon-play"></i> <span class="text">播放</span></a>
  42 + </div>
  43 + </div>
  44 +
  45 + <div class="pb_tools_icon">
  46 + <div class="uk-button-dropdown" data-uk-dropdown="{mode:'hover', pos:'top-left'}">
  47 + <button class="uk-button" id="speedIconBtn"><i class="uk-icon-close"> </i> <span class="text">1</span> <i class="uk-icon-caret-down"></i></button>
  48 + <div class="uk-dropdown uk-dropdown-bottom uk-dropdown-small"
  49 + style="top: 30px; left: 0px;min-width: auto;">
  50 + <ul class="uk-nav uk-nav-dropdown pb_dropdown_tool play_speed_list uk-dropdown-close">
  51 + <li><a data-value="30" href="javascript:;">1秒30帧</a></li>
  52 + <li><a data-value="20" href="javascript:;">1秒20帧</a></li>
  53 + <li><a data-value="10" href="javascript:;">1秒10帧</a></li>
  54 + <li><a data-value="7" href="javascript:;">1秒7帧</a></li>
  55 + <li><a data-value="5" href="javascript:;">1秒5帧</a></li>
  56 + <li><a data-value="1" href="javascript:;">1秒1帧</a></li>
  57 + </ul>
  58 + </div>
  59 + </div>
  60 + </div>
  61 +
  62 + <div class="pb_tools_icon">
  63 + <button class="uk-button" disabled><i class="uk-icon-map-signs"></i> 电子围栏 <i class="uk-icon-caret-down"></i> </button>
  64 + </div>
  65 +
  66 + <div class="pb_tools_icon">
  67 + <a class="uk-button" id="exportExcelBtn" data-uk-tooltip title="导出轨迹"><i
  68 + class="uk-icon-file-excel-o"></i></a>
  69 + </div>
  70 + </div>
  71 +
  72 + <script>
  73 + (function () {
  74 +
  75 + var logTemp = template.compile('{{each list as gps i}}<dl data-code="{{gps.road.ROAD_CODE}}">' +
  76 + '<dd>{{gps.timeStr}}</dd>' +
  77 + '<dd>{{gps.speed}}</dd>' +
  78 + '<dd>{{gps.road.ROAD_NAME}}</dd><dd>正常</dd></dl>{{/each}}');
  79 +
  80 +
  81 + var _body = '#playback_run_body'
  82 + , map, gpsArray, roads, marker, width, trailArray = [], trailPolyline;
  83 +
  84 + var upRoutePos = [], downRoutePos = [];
  85 + var storage = window.localStorage;
  86 + var lineCode;
  87 +
  88 + //进度条
  89 + var progress = $('.pb_footer_tools .uk-progress', _body);
  90 + var bar = $('.uk-progress-bar', progress);
  91 + var step;
  92 + var prsTip = $('.ui-slider-tip', _body);
  93 + progress.mousemove(function (e) {
  94 + var x = e.offsetX;
  95 + var i = parseInt(x / step);
  96 + var time = moment(gpsArray[i].timestamp).format('HH:mm.ss');
  97 +
  98 + prsTip.text(time).css('left', x - 11).css('visibility', 'visible');
  99 + }).mouseout(function () {
  100 + prsTip.css('visibility', 'hidden')
  101 + }).on('click', function (e) {
  102 + var x = e.offsetX;
  103 + goto(parseInt(x / step));
  104 + });
  105 +
  106 + $(_body).on('init', function (e, data) {
  107 + roads = data.roads;
  108 + lineCode = data.lineCode;
  109 +
  110 + setTimeout(function () {
  111 + initMap(data.gpsList);
  112 + len = gpsArray.length;
  113 + step = progress.width() / gpsArray.length;
  114 + }, 600);
  115 +
  116 + //导出的文件名
  117 + $('#exportExcelBtn').attr('download', data.fileName);
  118 + });
  119 +
  120 + $('.pb_tools_icon a.uk-button', _body).on('click', function () {
  121 + var type = $(this).attr('data-type');
  122 + switch (type) {
  123 + case 'play':
  124 + play();
  125 + break;
  126 + case 'pause':
  127 + pause();
  128 + break;
  129 + /*case 'fast_forward':
  130 + goto(index + 10);
  131 + break;
  132 + case 'rewind':
  133 + goto(index - 10);
  134 + break;
  135 + case 'stop':
  136 + pause();
  137 + break;*/
  138 + }
  139 + });
  140 +
  141 + //导出excel
  142 + $('#exportExcelBtn', _body).on('click', function () {
  143 + var base64Str = gb_map_play_back.listToExcel(gpsArray);
  144 + $(this).attr('href', base64Str);
  145 + });
  146 +
  147 + function goto(ei) {
  148 + if (ei < 0 || ei >= len)
  149 + return;
  150 +
  151 + bar.css('width', ei * step);
  152 + var gps = gpsArray[ei];
  153 + //重新定位marker
  154 + try {
  155 + drawLine(gps.direction);
  156 + } catch (e) {
  157 + console.log(e);
  158 + }
  159 + var point = new BMap.Point(gps.bd_lon, gps.bd_lat);
  160 + marker.setPosition(point);
  161 + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  162 +
  163 + //重新填充轨迹线,更新日志面板
  164 + trailArray = [];
  165 + var logs = [];
  166 + for (var i = 0; i <= ei; i++) {
  167 + trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
  168 + try {
  169 + if (i > 0 && logs[logs.length - 1].road.ROAD_CODE == gpsArray[i].road.ROAD_CODE)
  170 + logs.pop();
  171 + }
  172 + catch (e) {
  173 + }
  174 +
  175 + if (gpsArray[i].road)
  176 + logs.push(gpsArray[i]);
  177 + }
  178 + trailPolyline.setPath(trailArray);
  179 +
  180 + index = ei;
  181 + map.panTo(marker.getPosition());
  182 + //更新日志面板
  183 + logPanel.empty().html(logTemp({list: logs}));
  184 + logWrap.scrollTop(logWrap[0].scrollHeight);
  185 +
  186 + //重新填充进出站数据
  187 + $('.pb_inout_station_panel .ct_table_body', _body).html('');
  188 + for (var i = 0; i <= ei; i++) {
  189 + inoutStationWrite(gpsArray[i]);
  190 + }
  191 + inoutWrap.scrollTop(inoutWrap[0].scrollHeight);
  192 + }
  193 +
  194 + //播放
  195 + function play() {
  196 + $('.play-btn', _body)
  197 + .attr('data-type', 'pause')
  198 + .find('i')
  199 + .removeClass('uk-icon-play')
  200 + .addClass('uk-icon-pause')
  201 + .next().text('暂停');
  202 + pauseFlag = false;
  203 + progress.addClass('uk-active');
  204 + run();
  205 +
  206 + //定时居中
  207 + fixedToCenter();
  208 + }
  209 +
  210 + var toCenterTimer;
  211 + var markerIsVisible;
  212 + function fixedToCenter() {
  213 + toCenterTimer = setInterval(function () {
  214 + var markerIsVisible = BMapLib.GeoUtils.isPointInRect(marker.point,map.getBounds());
  215 + if(!markerIsVisible)
  216 + map.panTo(marker.getPosition());
  217 + }, 400);
  218 + }
  219 +
  220 + //暂停
  221 + var pauseFlag;
  222 +
  223 + function pause() {
  224 + $('.play-btn', _body)
  225 + .attr('data-type', 'play')
  226 + .find('i')
  227 + .removeClass('uk-icon-pause')
  228 + .addClass('uk-icon-play')
  229 + .next().text('播放');
  230 + pauseFlag = true;
  231 + progress.removeClass('uk-active');
  232 + clearInterval(toCenterTimer);
  233 + }
  234 +
  235 + var index = 1;
  236 + var len;
  237 + var defaultRunSpeed = 1000;
  238 + var runSpeed = defaultRunSpeed;
  239 + function run() {
  240 + //暂停
  241 + if (pauseFlag) {
  242 + pauseFlag = false;
  243 + return
  244 + }
  245 + //结束
  246 + if (index >= len) {
  247 + bar.css('width', '100%');
  248 + pause();
  249 + return;
  250 + }
  251 +
  252 + //marker 移动
  253 + var gps = gpsArray[index];
  254 +
  255 + //线路走向
  256 + if (gps.direction != gpsArray[index - 1].direction || index == 1)
  257 + drawLine(gps.direction);
  258 +
  259 + var point = new BMap.Point(gps.bd_lon, gps.bd_lat);
  260 + marker.setPosition(point);
  261 + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  262 +
  263 + //轨迹线
  264 + trailArray.push(point);
  265 + trailPolyline.setPath(trailArray);
  266 +
  267 + //进度条
  268 + bar.css('width', step * index);
  269 +
  270 + //日志输出
  271 + logWrite(gps, gpsArray[index - 1]);
  272 + //到离站输出
  273 + inoutStationWrite(gps);
  274 +
  275 + index++;
  276 + setTimeout(run, runSpeed);
  277 + }
  278 +
  279 + //初始化地图
  280 + function initMap(data) {
  281 + gpsArray = data;
  282 + var firstPoint = new BMap.Point(data[0].bd_lon, data[0].bd_lat);
  283 + map = new BMap.Map($('.map_wrap', _body)[0]);
  284 + map.centerAndZoom(firstPoint, 17);
  285 + map.enableScrollWheelZoom();
  286 +
  287 + //创建车辆marker
  288 + marker = new BMap.Marker(firstPoint);
  289 + width = gb_map_imap.calcGpsMarkerWidth(data[0].nbbm);
  290 + //渲染icon
  291 + marker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(data[0], width), new BMap.Size(width, 75)));
  292 + marker.disableMassClear();
  293 + map.addOverlay(marker);
  294 +
  295 + //线路图层 数据
  296 + var routeCache = JSON.parse(storage.getItem(lineCode + '_route'));
  297 + upRoutePos = initRoutePosData(routeCache.up_bd);
  298 + downRoutePos = initRoutePosData(routeCache.down_bd);
  299 +
  300 + trailArray.push(firstPoint);
  301 + drawTrailLine();
  302 + //输出第一个点
  303 + logWrite(data[0], null);
  304 + }
  305 +
  306 + function drawTrailLine() {
  307 + trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 3, strokeColor: 'black'});
  308 + map.addOverlay(trailPolyline);
  309 + }
  310 +
  311 + function initRoutePosData(routeStr) {
  312 + var array = [], temps;
  313 + $.each(routeStr, function (i, item) {
  314 + var pos = [];
  315 + $.each(item.split(','), function () {
  316 + temps = this.split(' ');
  317 + pos.push(new BMap.Point(temps[0], temps[1]));
  318 + });
  319 + array.push(pos);
  320 + });
  321 + return array;
  322 + }
  323 +
  324 + function drawLine(updown) {
  325 + map.clearOverlays();
  326 +
  327 + var pos = updown == 0 ? upRoutePos : downRoutePos;
  328 + $.each(pos, function () {
  329 + map.addOverlay(new BMap.Polyline(this, {strokeWeight: 12, strokeColor: 'rgba(0, 0, 255, 0.6)'}));
  330 + });
  331 +
  332 + drawTrailLine();
  333 + }
  334 +
  335 + //日志输出
  336 + var logWrap = $('.pb_log_panel', _body);
  337 + var logPanel = $('.pb_log_panel .ct_table_body', _body);
  338 + gb_ct_table.fixedHead(logWrap);
  339 +
  340 + function logWrite(gps, prve) {
  341 + if (!gps.road || !gps.road.ROAD_CODE)
  342 + return;
  343 +
  344 + var code = gps.road.ROAD_CODE;
  345 + if (!prve || code != prve.road.ROAD_CODE) {
  346 + logPanel.append('<dl data-code="' + code + '" ><dd>' + gps.timeStr + '</dd><dd>' + gps.speed + '</dd><dd>' + gps.road.ROAD_NAME + '</dd><dd>正常</dd></dl>');
  347 + }
  348 + else {
  349 + var dds = logPanel.find('dl[data-code=' + code + ']').last().find('dd');
  350 + $(dds[0]).text(gps.timeStr);
  351 + $(dds[1]).text(gps.speed);
  352 + }
  353 +
  354 + logWrap.scrollTop(logWrap[0].scrollHeight);
  355 + }
  356 +
  357 +
  358 + var inoutWrap = $('.pb_inout_station_panel', _body);
  359 + gb_ct_table.fixedHead(inoutWrap);
  360 + //进出站数据输出
  361 + function inoutStationWrite(gps) {
  362 + if (gps.inout_stop == -1)
  363 + return;
  364 +
  365 + var inoutInfo = gps['inout_stop_info'];
  366 + var htmlStr = '<dl>' +
  367 + '<dd>' + gps.timeStr + '</dd>' +
  368 + '<dd>' + inoutInfo.stopName + '</dd>' +
  369 + '<dd>' + (inoutInfo.inOut == 1 ? '出站' : '进站') + '</dd>' +
  370 + '</dl>';
  371 +
  372 + $('.pb_inout_station_panel .ct_table_body', _body).append(htmlStr);
  373 +
  374 + //滚动条
  375 + inoutWrap.scrollTop(inoutWrap[0].scrollHeight);
  376 + }
  377 +
  378 +
  379 +
  380 + //播放速度
  381 + $('.play_speed_list li a', _body).on('click', function () {
  382 + var speed = $(this).data('value');
  383 + runSpeed = defaultRunSpeed / speed;
  384 + $('#speedIconBtn .text', _body).text(speed);
  385 + });
  386 + })();
  387 + </script>
  388 +</div>
0 389 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/fragments/playback_v2/main.html 0 → 100644
  1 +<div class="uk-modal" id="map-playback2-modal">
  2 + <div class="uk-modal-dialog uk-modal-dialog-blank">
  3 + <button class="uk-modal-close uk-close" type="button"></button>
  4 + <div class="uk-grid uk-flex-middle" data-uk-grid-margin>
  5 + <div class="uk-width-medium-1-10 uk-height-viewport z-depth-viewport">
  6 + <h5 style="color: #868484;text-indent: 5px;">
  7 + 线路配车
  8 + </h5>
  9 + <div class="uk-accordion cc_info_accordion" data-uk-accordion data-uk-observe>
  10 + </div>
  11 +
  12 + </div>
  13 + <div class="uk-width-medium-2-10 uk-height-viewport z-depth-viewport " style="position: relative;">
  14 + <div class="play_back_form_shade uk-animation-scale"></div>
  15 + <form class="uk-form uk-form-horizontal playBackForm">
  16 + <div class="uk-grid">
  17 + <div class="uk-width-1-1">
  18 + <div class="uk-form-row">
  19 + <label class="uk-form-label">车辆编码</label>
  20 + <div class="uk-form-controls">
  21 + <div class="uk-autocomplete uk-form autocomplete-nbbm">
  22 + <div class="uk-autocomplete uk-form autocomplete-nbbm">
  23 + <input name="nbbm" required/>
  24 + </div>
  25 + </div>
  26 + </div>
  27 + </div>
  28 + </div>
  29 + </div>
  30 + <div class="uk-grid">
  31 + <div class="uk-width-2-3">
  32 + <div class="uk-form-row">
  33 + <label class="uk-form-label">开始时间</label>
  34 + <div class="uk-form-controls">
  35 + <input name="sDate" type="date" style="width: 100%;" required/>
  36 + </div>
  37 + </div>
  38 + </div>
  39 + <div class="uk-width-1-3" style="padding-left: 15px;">
  40 + <div class="uk-form-row">
  41 + <div class="uk-form-controls" style="margin-left: 0;">
  42 + <input name="sTime" type="time" style="width: calc(100% - 28px);" required/>
  43 + </div>
  44 + </div>
  45 + </div>
  46 + </div>
  47 + <div class="uk-grid">
  48 + <div class="uk-width-2-3">
  49 + <div class="uk-form-row">
  50 + <label class="uk-form-label">结束时间</label>
  51 + <div class="uk-form-controls">
  52 + <input name="eDate" type="date" style="width: 100%;" required/>
  53 + </div>
  54 + </div>
  55 + </div>
  56 + <div class="uk-width-1-3" style="padding-left: 15px;">
  57 + <div class="uk-form-row">
  58 + <div class="uk-form-controls" style="margin-left: 0;">
  59 + <input name="eTime" type="time" style="width: calc(100% - 28px);" required/>
  60 + </div>
  61 + </div>
  62 + </div>
  63 + </div>
  64 + <div class="uk-grid">
  65 + <button class="uk-button uk-button-large uk-button-primary playBackButton" type="submit"><i
  66 + class="uk-icon-search"> </i> 搜索轨迹
  67 + </button>
  68 + </div>
  69 + </form>
  70 + <!-- 异常警报 -->
  71 + <div class="abnormal_table_wrap">
  72 + <div class="abnormal_table_panel"
  73 + style="height: calc(100% - 15px);margin-top: 15px;overflow: auto;">
  74 + <div class="ct_table abnormal_table" style="height: calc(100% - 30px);">
  75 + <div class="ct_table_head">
  76 + <dl>
  77 + <dt>异常状态</dt>
  78 + <dt>开始时间</dt>
  79 + <dt>结束时间</dt>
  80 + <dt>图像</dt>
  81 + </dl>
  82 + </div>
  83 + <div class="ct_table_body">
  84 + </div>
  85 + </div>
  86 + </div>
  87 + </div>
  88 + <!-- 路段 和 到离站信息 -->
  89 + <div class="uk-margin uk-grid other_info_table_wrap" data-uk-grid-margin>
  90 + <div class="uk-width-medium-1-1" style="padding-left: 0;">
  91 +
  92 + <ul class="uk-tab" data-uk-tab="{connect:'#real_gps_info_tab_content'}"
  93 + style="padding-left: 12px;">
  94 + <li class="uk-active"><a>行车轨迹</a></li>
  95 + <li><a>到离站信息</a></li>
  96 + </ul>
  97 +
  98 + <ul id="real_gps_info_tab_content" class="uk-switcher uk-margin"
  99 + style="height: calc(100% - 44px);margin-top: 7px;">
  100 + <li class="uk-active" style="height: 100%;">
  101 + <div class="road_table_wrap" style="height: 100%;overflow: auto;">
  102 + <div class="ct_table gps-road-info"
  103 + style="height: calc(100% - 30px);">
  104 + <div class="ct_table_head">
  105 + <dl>
  106 + <dt>时间</dt>
  107 + <dt>速度</dt>
  108 + <dt>所在路段</dt>
  109 + </dl>
  110 + </div>
  111 + <div class="ct_table_body">
  112 + </div>
  113 + </div>
  114 + </div>
  115 + </li>
  116 + <!-- 到离站数据 -->
  117 + <li style="height: 100%;">
  118 + <div class="inout_table_wrap" style="height: 100%;overflow: auto;">
  119 + <div class="ct_table" style="height: calc(100% - 30px);">
  120 + <div class="ct_table_head">
  121 + <dl>
  122 + <dt>站点</dt>
  123 + <dt>到站时间</dt>
  124 + <dt>离站时间</dt>
  125 + <dt>上客</dt>
  126 + <dt>下客</dt>
  127 + </dl>
  128 + </div>
  129 + <div class="ct_table_body">
  130 + </div>
  131 + </div>
  132 + </div>
  133 + </li>
  134 + </ul>
  135 +
  136 + </div>
  137 + </div>
  138 + </div>
  139 + <div class="uk-width-medium-7-10 uk-height-viewport map-wrap" style="padding-left: 0;position: relative;">
  140 + <div class="map-wrap-tools uk-animation-slide-top">
  141 + <div class="btns">
  142 + <span class="ct_btn play_btn"></span>
  143 + <span class="ct_btn clock"></span>
  144 + <div class="multi-items">
  145 + <form class="uk-form speed_form">
  146 + <label>
  147 + <input type="radio" name="playSpeed" value="1"> x1
  148 + </label>
  149 + <label>
  150 + <input type="radio" name="playSpeed" value="5"> x5
  151 + </label>
  152 + <label>
  153 + <input type="radio" name="playSpeed" value="10"> x10
  154 + </label>
  155 + <label>
  156 + <input type="radio" name="playSpeed" value="20"> x20
  157 + </label>
  158 + </form>
  159 + </div>
  160 + <div class="multi-items">
  161 + <form class="uk-form buffer_area_form">
  162 + <label>
  163 + <input type="checkbox" name="drawPoint"> 站点
  164 + </label>
  165 + <label>
  166 + <input type="checkbox" name="drawBuffArea"> 缓冲区
  167 + </label>
  168 + <label>
  169 + <input type="checkbox" name="stationName"> 站点名称
  170 + </label>
  171 + <label>
  172 + <div class="uk-button-dropdown" data-uk-dropdown>
  173 + <a>停车场 <i class="uk-icon-angle-down"></i></a>
  174 + <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;">
  175 + <ul class="uk-nav uk-nav-dropdown parks_list">
  176 +
  177 + </ul>
  178 + </div>
  179 + </div>
  180 + </label>
  181 + </form>
  182 + </div>
  183 + <span class="ct_btn text-panel">
  184 + <span>共约 <span class="sum_mileage"></span> 公里,<span class="count_point"></span> 个GPS点</span><br>
  185 + <a class="export-excel"><i class="uk-icon-file-excel-o"></i> 导出轨迹</a>
  186 +
  187 + <label>
  188 + <div class="uk-button-dropdown" data-uk-dropdown>
  189 + <a style="color: grey;margin-left: 12px;font-size: 12px;">线路底图 <i class="uk-icon-angle-down"></i></a>
  190 + <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;">
  191 + <ul class="uk-nav uk-nav-dropdown line_route_list">
  192 + </ul>
  193 + </div>
  194 + </div>
  195 + </label>
  196 + </span>
  197 + </div>
  198 + <div class="ct-progress-bar" >
  199 + <div class="scale"></div>
  200 + </div>
  201 + </div>
  202 + <div class="map-container"></div>
  203 + </div>
  204 + </div>
  205 + </div>
  206 +
  207 + <script id="cc_info_accordion_cont_temp" type="text/html">
  208 + {{each ccInfo as cc i}}
  209 + <h3 class="uk-accordion-title">{{cc.name}}</h3>
  210 + <div class="uk-accordion-content">
  211 + <ul class="uk-list">
  212 + {{each cc.cars as c j}}
  213 + <li>{{c}}</li>
  214 + {{/each}}
  215 + </ul>
  216 + </div>
  217 + {{/each}}
  218 + </script>
  219 +
  220 + <script id="gps_road_info_cont_temp" type="text/html">
  221 + {{each array as gps i}}
  222 + <dl data-code="{{gps.road.road_CODE}}">
  223 + <dd>{{gps.timeStr}}</dd>
  224 + <dd>{{gps.speed}}</dd>
  225 + <dd>{{gps.road.road_NAME}}</dd>
  226 + </dl>
  227 + {{/each}}
  228 + </script>
  229 +
  230 + <script id="multi_inout_info_cont_temp" type="text/html">
  231 + {{each list as item i}}
  232 + <dl data-id="{{item.id}}">
  233 + <dd>{{item.stopName}}</dd>
  234 + <dd>{{item.in_time_str}}</dd>
  235 + <dd>{{item.out_time_str}}</dd>
  236 + <dd></dd>
  237 + <dd></dd>
  238 + </dl>
  239 + {{/each}}
  240 + </script>
  241 +
  242 + <script id="inout_info_cont_temp" type="text/html">
  243 + <dl data-id="{{id}}">
  244 + <dd>{{stopName}}</dd>
  245 + <dd>{{in_time_str}}</dd>
  246 + <dd></dd>
  247 + <dd></dd>
  248 + <dd></dd>
  249 + </dl>
  250 + </script>
  251 +
  252 +
  253 + <script id="abnormal_table_cont_temp" type="text/html">
  254 + {{each array as item i}}
  255 + <dl>
  256 + <dd>
  257 + {{if item.abnormalType == 'speed'}}
  258 + 超速({{item.speed}})
  259 + {{else if item.abnormalType == 'outbound'}}
  260 + 越界
  261 + {{/if}}
  262 + </dd>
  263 + <dd>{{item.st_str}}</dd>
  264 + <dd>{{item.et_str}}</dd>
  265 + <dd></dd>
  266 + </dl>
  267 + {{/each}}
  268 + </script>
  269 +
  270 + <script id="pb_park_list_dropdown-temp" type="text/html">
  271 + {{each list as p i}}
  272 + <li data-code="{{p.parkCode}}" ><a>{{p.parkName}}</a></li>
  273 + {{if i == 0}}
  274 + <li class="uk-nav-divider"></li>
  275 + {{/if}}
  276 + {{/each}}
  277 + </script>
  278 + <script>
  279 + (function () {
  280 + var modal = '#map-playback2-modal', gpsArray;
  281 +
  282 + //modal hide remove dom
  283 + $(modal).on('hide.uk.modal', function () {
  284 + $('.map-wrap-tools .play_btn', modal).removeClass('play');
  285 + playObj.pause();
  286 + searchForm.hideShade();
  287 + });
  288 +
  289 + $(modal).on('init', function (e, data) {
  290 + //初始化地图
  291 + mapObj.initMap();
  292 +
  293 + //固定表头
  294 + gb_ct_table.fixedHead($('.road_table_wrap', modal));
  295 + gb_ct_table.fixedHead($('.inout_table_wrap', modal));
  296 + gb_ct_table.fixedHead($('.abnormal_table_panel', modal));
  297 + //线路配车
  298 + ccInfo.init();
  299 +
  300 + //表单初始值
  301 + searchForm.init(data);
  302 +
  303 + //车辆 autocomplete
  304 + $.get('/freeLogin/basic/cars', function (rs) {
  305 + gb_common.carAutocomplete($('.autocomplete-nbbm', modal), rs);
  306 + });
  307 +
  308 + //初始化线路底图下拉
  309 + var opts='';
  310 + $.each(gb_data_basic.activeLines, function () {
  311 + opts+='<li data-code="'+this.lineCode+'" data-dir="0"><a>'+this.name+'上行</a></li><li data-code="'+this.lineCode+'" data-dir="1"><a>'+this.name+'下行</a></li>';
  312 + });
  313 + $('.line_route_list', modal).html(opts);
  314 + });
  315 +
  316 + //切换线路底图
  317 + $(modal).on('click', '.line_route_list li', function () {
  318 + var code = $(this).data('code');
  319 + var updown = $(this).data('dir');
  320 + mapObj.changeLine(code, updown);
  321 + });
  322 +
  323 + /**
  324 + * 线路配车相关
  325 + */
  326 + var ccInfo = (function () {
  327 +
  328 + function init() {
  329 + $.get('/basic/ccInfo', function (rs) {
  330 + var ccInfo = [], lines = gb_data_basic.codeToLine;
  331 + for (var code in lines) {
  332 + ccInfo.push({
  333 + name: lines[code].name,
  334 + cars: carSort(rs[code])
  335 + });
  336 + }
  337 +
  338 + var htmlStr = template('cc_info_accordion_cont_temp', {ccInfo: ccInfo});
  339 + $('.cc_info_accordion', modal).html(htmlStr)
  340 + .find('.uk-list li').on('click', itemClick);
  341 + });
  342 + }
  343 +
  344 + function carSort(list) {
  345 + if (!list)
  346 + return [];
  347 + return list.sort();
  348 + }
  349 +
  350 + function itemClick() {
  351 + $(this).parent().find('li.active').removeClass('active');
  352 + $(this).addClass('active');
  353 + searchForm.setNbbm($(this).text());
  354 + }
  355 +
  356 + return {
  357 + init: init
  358 + };
  359 + })();
  360 +
  361 + /**
  362 + * 搜索表单相关
  363 + */
  364 + var searchForm = (function () {
  365 +
  366 + var f = $('.playBackForm', modal);
  367 +
  368 + var init = function (data) {
  369 + //设置初始值
  370 + if (data.nbbm)
  371 + $('[name=nbbm]', f).val(data.nbbm);
  372 + var st = moment().subtract(2, 'hour');
  373 + if (data.st)
  374 + st = moment(data.st, 'YYYY-MM-DD HH:mm');
  375 + $('[name=sDate]', f).val(st.format('YYYY-MM-DD'));
  376 + $('[name=sTime]', f).val(st.format('HH:mm'));
  377 + var et = moment();
  378 + if (data.et)
  379 + et = moment(data.et, 'YYYY-MM-DD HH:mm');
  380 + $('[name=eDate]', f).val(et.format('YYYY-MM-DD'));
  381 + $('[name=eTime]', f).val(et.format('HH:mm'));
  382 +
  383 +
  384 + /*$('[name=nbbm]', f).val('W0A-018');
  385 + $('[name=sDate]', f).val('2017-04-06');
  386 + $('[name=sTime]', f).val('04:49');
  387 +
  388 + $('[name=eDate]', f).val('2017-04-06');
  389 + $('[name=eTime]', f).val('09:49');*/
  390 + //搜索事件
  391 + $('button[type=submit]', f).on('click', search);
  392 + };
  393 +
  394 + var setNbbm = function (v) {
  395 + $('[name=nbbm]', f).val(v);
  396 + };
  397 +
  398 + var ONE_DAY = 60 * 60 * 24;
  399 + var MIN_SPACE = 60;
  400 + var search = function (e) {
  401 + e.stopPropagation();
  402 + var data = f.serializeJSON();
  403 +
  404 + //校验时间间隔
  405 + var fs = 'YYYY-MM-DDHH:mm';
  406 + var st = parseInt(moment(data.sDate + data.sTime, fs).format('X'));
  407 + var et = parseInt(moment(data.eDate + data.eTime, fs).format('X'));
  408 +
  409 + if (et < st)
  410 + notify_err('结束时间不能小于开始时间');
  411 + else if ((et - st) > ONE_DAY)
  412 + notify_err('最大间隔24小时!');
  413 + else if ((et - st) < MIN_SPACE)
  414 + notify_err('最小间隔1分钟!');
  415 + else {
  416 + show_wait_modal('搜索数据...');
  417 + $.ajax({
  418 + url: '/gps/history_v2/' + data.nbbm,
  419 + traditional: true,
  420 + data: {st: st, et: et},
  421 + success: function (rs) {
  422 + hide_wait_modal();
  423 + //重置相关对象
  424 + playObj.reset();
  425 + mapObj.reset();
  426 +
  427 + gpsArray = rs.list;
  428 + if (!gpsArray || gpsArray.length == 0) {
  429 + notify_err('没有搜索到轨迹数据!');
  430 + return;
  431 + }
  432 +
  433 + //排序
  434 + gpsArray.sort(function (a, b) {
  435 + return parseInt((a.ts - b.ts) + '' + (a.stop_no - b.stop_no));
  436 + });
  437 + //行车轨迹
  438 + trailTableObj.showInitData(gpsArray);
  439 + //到离站信息
  440 + inOutStationTableObj.showInitData(gpsArray);
  441 + //异常信息
  442 + abnormalTableObj.showInitData(rs['outboundList'], rs['speedList']);
  443 + //show 工具条
  444 + mapTools.show(rs);
  445 + //地图
  446 + mapObj.initData(rs);
  447 + //play 对象
  448 + playObj.init(rs);
  449 + //设置导出文件名称
  450 + mapTools.setExcelName();
  451 + }
  452 + });
  453 + }
  454 + return false;
  455 + };
  456 +
  457 + //遮罩
  458 + var shade = $('.play_back_form_shade', modal);
  459 + var showShade = function () {
  460 + shade.show();
  461 + };
  462 + var hideShade = function () {
  463 + shade.hide();
  464 + };
  465 +
  466 + return {
  467 + init: init,
  468 + setNbbm: setNbbm,
  469 + showShade: showShade,
  470 + hideShade: hideShade
  471 + };
  472 + })();
  473 +
  474 + /**
  475 + * 行车轨迹表格
  476 + */
  477 + var trailTableObj = (function () {
  478 +
  479 + var $tbody = $('.gps-road-info .ct_table_body', modal);
  480 + var $wrap = $('.road_table_wrap', modal);
  481 + var initFlag, gpsArray;
  482 + var showInitData = function (list) {
  483 + var array = [];
  484 + for (var i = 0, gps; gps = list[i++];) {
  485 + //格式化时间
  486 + gps.timeStr = moment(gps.timestamp).format('HH:mm.ss');
  487 + try {
  488 + if (i > 0 && array[array.length - 1].road.road_CODE == gps.road.road_CODE)
  489 + array.pop();
  490 + }
  491 + catch (e) {
  492 + }
  493 +
  494 + if (gps.road)
  495 + array.push(gps);
  496 + }
  497 +
  498 + var htmlStr = template('gps_road_info_cont_temp', {array: array});
  499 + $tbody.html(htmlStr);
  500 + initFlag = true;
  501 + gpsArray = list;
  502 + };
  503 +
  504 + var prev;
  505 + var add = function (gps, i) {
  506 + if(i == 0)
  507 + return;
  508 + if(initFlag){
  509 + //清理初始化的数据
  510 + $tbody.html('');
  511 + initFlag = false;
  512 + }
  513 + if (!gps.road)
  514 + return;
  515 + var code = gps.road.road_CODE;
  516 + if (!prev || code != prev.road.road_CODE) {
  517 + $tbody.append(template('gps_road_info_cont_temp', {array: [gps]}));
  518 + }
  519 + else{
  520 + var dds = $tbody.find('dl[data-code=' + code + ']').last().find('dd');
  521 + $(dds[0]).text(gps.timeStr);
  522 + $(dds[1]).text(gps.speed);
  523 + }
  524 + prev = gps;
  525 + $wrap.scrollTop($wrap[0].scrollHeight);
  526 + };
  527 +
  528 + return {
  529 + showInitData: showInitData,
  530 + add : add,
  531 + gpsArray : function () {
  532 + return gpsArray;
  533 + }
  534 + };
  535 + })();
  536 +
  537 + /**
  538 + * 到离站信息表格
  539 + * @type {{}}
  540 + */
  541 + var inOutStationTableObj = (function () {
  542 +
  543 + var data, f, prev, initFlag;
  544 + var $wrap = $('.inout_table_wrap', modal);
  545 + var $tbody = $('.ct_table_body', $wrap);
  546 + var showInitData = function (list) {
  547 + clear();
  548 + data = [];
  549 + $.each(list, function (i, gps) {
  550 + prev = data[data.length - 1];
  551 + if (gps['inout_stop'] == -1)
  552 + return true;
  553 + if (gps['inout_stop'] == 0 && gps['inout_stop_info']) {
  554 + //连续进站信号,取第一个
  555 + if(prev && prev['out_ts'] == null
  556 + && prev['stopName'] == gps['inout_stop_info'].stopName){
  557 + return true;
  558 + }
  559 + data.push(createIn(gps));
  560 + }
  561 + else if (gps['inout_stop'] == 1) {
  562 + f = matchOut(prev, gps);
  563 + if(f)
  564 + data.push(f);
  565 + }
  566 + });
  567 + //格式化时间
  568 + $.each(data, function (i) {
  569 + if (this.in_ts)
  570 + this.in_time_str = moment(this.in_ts).format('HH:mm.ss');
  571 + if (this.out_ts)
  572 + this.out_time_str = moment(this.out_ts).format('HH:mm.ss');
  573 + //id
  574 + this.id = 'in_out_' + i;
  575 + });
  576 + var htmlStr = template('multi_inout_info_cont_temp', {list: data});
  577 + $tbody.html(htmlStr);
  578 + initFlag = true;
  579 + len = data.length;
  580 + };
  581 +
  582 + var inoutIndex=0, len, item;
  583 + var add = function (gps, i) {
  584 + if(i == 0)
  585 + return;
  586 + if(initFlag)
  587 + clear();
  588 +
  589 + var $dl;
  590 + for(j = inoutIndex; j < len; j++){
  591 + item = data[j];
  592 + $dl = $tbody.find('dl[data-id='+item.id+']');
  593 + if(gps.ts >= item.in_ts && $dl.length==0){
  594 + $tbody.append(template('inout_info_cont_temp', item));
  595 + inoutIndex = j;
  596 + }
  597 +
  598 + if(gps.ts >= item.out_ts){
  599 + var dds = $dl.find('dd');
  600 + if($dl.length==0)
  601 + $tbody.append(template('inout_info_cont_temp', item));
  602 + else
  603 + $(dds[2]).text(item.out_time_str);
  604 + inoutIndex = j;
  605 + }
  606 + else {
  607 + break;
  608 + }
  609 + }
  610 + $wrap.scrollTop($wrap[0].scrollHeight);
  611 + };
  612 +
  613 + var clear = function () {
  614 + $tbody.html('');
  615 + initFlag = false;
  616 + };
  617 +
  618 + var createIn = function (gps) {
  619 + var info = gps['inout_stop_info'];
  620 + return {in_ts: info.ts, stopNo: info.stopNo, stopName: info.stopName}
  621 + };
  622 +
  623 + var matchOut = function (prevInfo, gps) {
  624 + var oi = gps['inout_stop_info'];
  625 + if(!oi)
  626 + return;
  627 + if(prevInfo && prevInfo.stopName == oi.stopName){
  628 + prevInfo['out_ts'] = oi.ts;
  629 + return null;
  630 + }
  631 + else {
  632 + return {out_ts: oi.ts,stopNo: oi.stopNo,stopName: oi.stopName}
  633 + }
  634 + };
  635 +
  636 + return {
  637 + showInitData: showInitData,
  638 + add: add
  639 + };
  640 + })();
  641 +
  642 + /**
  643 + * 异常信息表格
  644 + * @type {{showInitData}}
  645 + */
  646 + var abnormalTableObj = (function () {
  647 +
  648 + var showInitData = function () {
  649 + var array = [];
  650 + for(var i = 0; i < arguments.length; i ++){
  651 + array = array.concat(arguments[i]);
  652 + }
  653 + //格式化时间
  654 + $.each(array, function () {
  655 + if(this.st)
  656 + this.st_str = moment(this.st).format('HH:mm.ss');
  657 + if(this.et)
  658 + this.et_str = moment(this.et).format('HH:mm.ss');
  659 + });
  660 +
  661 + //排序
  662 + array.sort(function (a, b) {
  663 + return a.st - b.st;
  664 + });
  665 +
  666 + var htmlStr = template('abnormal_table_cont_temp', {array: array});
  667 + $('.abnormal_table .ct_table_body', modal).html(htmlStr);
  668 + };
  669 +
  670 + return {
  671 + showInitData: showInitData
  672 + }
  673 + })();
  674 +
  675 + /**
  676 + * 工具条相关
  677 + */
  678 + var mapTools = (function () {
  679 +
  680 + $('.map-wrap-tools .play_btn', modal).on('click', function () {
  681 + if($(this).hasClass('play')){
  682 + //暂停
  683 + $(this).removeClass('play');
  684 + playObj.pause();
  685 + searchForm.hideShade();
  686 + }
  687 + else {
  688 + //播放
  689 + $(this).addClass('play');
  690 + playObj.play();
  691 + playObj.fixedToCenter();
  692 + searchForm.showShade();
  693 + }
  694 + });
  695 +
  696 + //播放速度
  697 + $('.speed_form input[name=playSpeed]', modal).on('click', function () {
  698 + playObj.setConf('playSpeed', $(this).val());
  699 + });
  700 +
  701 + //空间数据
  702 + $('.buffer_area_form input[type=checkbox]', modal).on('click', function () {
  703 + playObj.setConf($(this).attr('name'), $(this)[0].checked);
  704 + mapObj.refreshOverlay();
  705 + });
  706 +
  707 + //进度条
  708 + var step, $scale = $('.ct-progress-bar .scale', modal);
  709 + var upProgressBar = function (i) {
  710 + $scale.css('width', step * (i + 1));
  711 + };
  712 +
  713 + //导出
  714 + $('.export-excel', modal).on('click', function () {
  715 + var base64Str = gb_map_play_back.listToExcel(trailTableObj.gpsArray());
  716 + $(this).attr('href', base64Str);
  717 + });
  718 +
  719 + var setExcelName = function () {
  720 + var f = $('.playBackForm', modal);
  721 + var fileName = ($('[name=nbbm]', f).val() + '轨迹数据' + $('[name=sDate]', f).val() + $('[name=sTime]', f).val() + '至' + $('[name=eDate]', f).val() + $('[name=eTime]', f).val() + '.xls').replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),'');
  722 + $('.export-excel', modal).attr('download', fileName);
  723 + };
  724 +
  725 + var gpsArray;
  726 + var show = function (rs) {
  727 + $('.map-wrap-tools').show();
  728 + $('.map-container', modal).addClass('show_tools');
  729 + //总里程
  730 + $('.text-panel .sum_mileage', modal).text(rs.sumMileage);
  731 +
  732 + var size = rs.list.length;
  733 + $('.text-panel .count_point', modal).text(size);
  734 + step = $('.ct-progress-bar', modal).width() / size;
  735 +
  736 + //console.log('stepstep', step);
  737 + };
  738 +
  739 + return {
  740 + show: show,
  741 + upProgressBar: upProgressBar,
  742 + setExcelName: setExcelName
  743 + }
  744 + })();
  745 +
  746 + /**
  747 + * 地图相关
  748 + */
  749 + var mapObj = (function () {
  750 + var map;
  751 + var initMap = function () {
  752 + //初始化地图
  753 + map = new BMap.Map($('.map-container', modal)[0]);
  754 + //中心点和缩放级别
  755 + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16);
  756 + map.enableScrollWheelZoom();
  757 + //map.setMapStyle({style:'grayscale'});
  758 + };
  759 +
  760 + var storage = window.localStorage;
  761 + var routes;//路段
  762 + var stations;//站点
  763 + var parks;//停车场
  764 + //停车场编码和Polygon对照
  765 + var parkPolygons={};
  766 +
  767 + var initData = function (rs) {
  768 + var gpsArray = rs.list;
  769 + if(!gpsArray || gpsArray.length==0)
  770 + return;
  771 + var lineCode = gpsArray[0].lineId;
  772 + //从地图模块获取站点数据
  773 + stations = gb_map_spatial_data.getStationArray(lineCode);
  774 + //停车场下拉菜单
  775 + initDropdownList(lineCode);
  776 +
  777 + //从localStorage 获取路段
  778 + routes = JSON.parse(storage.getItem(lineCode + '_route'));
  779 + routes = [routes.up_bd, routes.down_bd];
  780 + };
  781 +
  782 + /**
  783 + * 初始化停车场下拉菜单
  784 + */
  785 + var initDropdownList = function (lineCode) {
  786 + //从地图模块获取停车场数据
  787 + parks = gb_map_spatial_data.carparkArray();
  788 + //console.log('parksparks', parks);
  789 + //将线路标准停车场排在第一个
  790 + var information = gb_data_basic.getLineInformation(lineCode);
  791 + if(information){
  792 + var index;
  793 + for(var i = 0,p; p=parks[i++];){
  794 + if(p.parkCode == information.carPark){
  795 + index = i - 1;
  796 + break;
  797 + }
  798 + }
  799 + parks[index] = parks.splice(0, 1 , parks[index])[0];
  800 + }
  801 + //渲染
  802 + var htmlStr = template('pb_park_list_dropdown-temp', {list: parks});
  803 + $('.buffer_area_form .parks_list', modal).html(htmlStr);
  804 +
  805 + //停车场点击
  806 + $('.buffer_area_form .parks_list>li', modal).on('click', function () {
  807 + var code = $(this).data('code');
  808 +
  809 + if(!parkPolygons[code]){
  810 + var park;
  811 + $.each(parks, function () {
  812 + if(this.parkCode==code){park = this;return false;}
  813 + });
  814 +
  815 + transMultiWGSToBd(park);
  816 + var polygon = new BMap.Polygon(park.bdPoints, {strokeColor: 'red', strokeWeight: 1});
  817 + map.addOverlay(polygon);
  818 + parkPolygons[code] = polygon;
  819 + //中心点
  820 + var ts = park.gCenterPoint.split(' ')
  821 + ,coord = TransGPS.wgsToBD(parseFloat(ts[1]), parseFloat(ts[0]));
  822 + polygon._centerPoint = new BMap.Point(coord.lng, coord.lat);
  823 + //绘制名称label
  824 + var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "red", borderColor: "red", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
  825 + var width = park.parkName.length * 12;
  826 + var label = new BMap.Label(park.parkName, {
  827 + position:polygon._centerPoint,
  828 + offset: new BMap.Size(-(width / 2), -27)
  829 + });
  830 + label.setStyle(style);
  831 + map.addOverlay(label);
  832 + }
  833 +
  834 + //定位到polygon
  835 + var polygon=parkPolygons[code];
  836 + map.panTo(polygon._centerPoint);
  837 + });
  838 + };
  839 +
  840 +
  841 + /**
  842 + * 更新车辆位置
  843 + */
  844 + var gpsMarker;
  845 + var updateCar = function (gps) {
  846 + if(!gpsMarker){
  847 + gpsMarker = new BMap.Marker(new BMap.Point(gps.bd_lon, gps.bd_lat));
  848 + var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
  849 + gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  850 + gpsMarker.disableMassClear();//禁止marker被清除
  851 + gpsMarker.setTop(true);
  852 + map.addOverlay(gpsMarker);
  853 + //居中
  854 + map.panTo(gpsMarker.getPosition());
  855 + }
  856 + else{
  857 + gpsMarker.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat));
  858 + var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
  859 + gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  860 + }
  861 +
  862 + //更新路段底图
  863 + if(gps.upDown!=0 && gps.upDown!=1)
  864 + gps.upDown = 0;
  865 + if(gps.upDown!=roadUpdown){
  866 + switchPolyline(gps.upDown);
  867 + //清除轨迹线
  868 + trailArray = [];
  869 + }
  870 + };
  871 +
  872 + /**
  873 + * 绘制轨迹线
  874 + */
  875 + var trailArray=[], trailPolyline;
  876 + var updateTrailLine = function () {
  877 + trailArray.push(gpsMarker.getPosition());
  878 + if(!trailPolyline){
  879 + trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 3, strokeColor: '#000000'});
  880 + trailPolyline.disableMassClear();//禁止trailPolyline被清除
  881 + map.addOverlay(trailPolyline);
  882 + }
  883 + else{
  884 + trailPolyline.setPath(trailArray);
  885 + }
  886 + };
  887 +
  888 + /**
  889 + * 绘制路段底图(包括站点)
  890 + */
  891 + var roadUpdown=-100;
  892 + var switchPolyline = function (upDown) {
  893 + if(typeof(upDown) == "undefined")
  894 + upDown = roadUpdown;
  895 +
  896 + if(upDown!= 0 && upDown != 1)
  897 + upDown = 0;
  898 + map.clearOverlays();
  899 + parkPolygons = {};//清除停车场对照
  900 + //路段
  901 + drawRoadPolyline(upDown);
  902 + //站点
  903 + if(playObj.getConf().drawPoint)
  904 + drawStationPoint(upDown);
  905 + //缓冲区
  906 + if(playObj.getConf().drawBuffArea)
  907 + drawStationBfArea(upDown);
  908 + //站点名称
  909 + if(playObj.getConf().stationName)
  910 + drawStationName(upDown);
  911 + roadUpdown = upDown;
  912 + };
  913 +
  914 + /**
  915 + * 根据走向绘制路段
  916 + */
  917 + var drawRoadPolyline = function (upDown) {
  918 + var colour = gb_map_config.getConfig().section.color;
  919 + var plConfig = {strokeWeight: 12, strokeColor: upDown?colour.down:colour.up, strokeOpacity: .4}, pos;
  920 + $.each(routes[upDown], function (i, item) {
  921 + pos = [];
  922 + $.each(item.split(','), function () {
  923 + temps = this.split(' ');
  924 + pos.push(new BMap.Point(temps[0], temps[1]));
  925 + });
  926 + map.addOverlay(new BMap.Polyline(pos, plConfig));
  927 + });
  928 + };
  929 +
  930 + /**
  931 + * 根据走向绘制站点点位
  932 + */
  933 + var drawStationPoint = function (upDown) {
  934 + var array = stations[upDown], psm;
  935 + $.each(array, function () {
  936 + //坐标转换
  937 + var coord = TransGPS.wgsToBD(this.lat, this.lon);
  938 + this.bd_lat = coord.lat;
  939 + this.bd_lon = coord.lng;
  940 + psm = new BMap.Marker(new BMap.Point(this.bd_lon, this.bd_lat));
  941 + psm.setTitle(this.stationName);
  942 + map.addOverlay(psm);
  943 + psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12)));
  944 + });
  945 + };
  946 +
  947 + /**
  948 + * 为站点绘制缓冲区
  949 + */
  950 + var drawStationBfArea = function (upDown) {
  951 + var array = stations[upDown];
  952 + $.each(array, function () {
  953 + if(this.shapesType=='r')
  954 + drawCircle(new BMap.Point(this.bd_lon, this.bd_lat), this.radius);
  955 + else if(this.shapesType=='d')
  956 + drawPolygon(this);
  957 + });
  958 + };
  959 +
  960 + /**
  961 + * 绘制站点名称
  962 + */
  963 + var drawStationName = function (upDown) {
  964 + var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "black", borderColor: "black", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
  965 + var array = stations[upDown];
  966 + $.each(array, function () {
  967 + var width = this.stationName.length * 12;
  968 + var label = new BMap.Label(this.stationName, {
  969 + position:new BMap.Point(this.bd_lon, this.bd_lat),
  970 + offset: new BMap.Size(-(width / 2), -27)
  971 + });
  972 + label.setStyle(style);
  973 + map.addOverlay(label);
  974 + });
  975 + };
  976 + var drawCircle = function (point, radius) {
  977 + var circle = new BMap.Circle(point, radius);
  978 + circle.setStrokeColor('#000000');
  979 + circle.setStrokeWeight(1);
  980 + map.addOverlay(circle);
  981 + };
  982 +
  983 + var drawPolygon = function (station) {
  984 + transMultiWGSToBd(station);
  985 + var polygon = new BMap.Polygon(station.bdPoints, {strokeColor: '#000000', strokeWeight: 1});
  986 + map.addOverlay(polygon);
  987 + };
  988 +
  989 + /**
  990 + * 重置
  991 + */
  992 + var reset = function () {
  993 + if(trailPolyline)
  994 + trailPolyline.enableMassClear();
  995 + if(gpsMarker)
  996 + gpsMarker.enableMassClear();
  997 + map.clearOverlays();
  998 + roadUpdown = -100;
  999 + trailArray=[];
  1000 + trailPolyline = null;
  1001 + gpsMarker = null;
  1002 + parkPolygons = {};
  1003 + };
  1004 +
  1005 + /**
  1006 + * 居中车辆,超出边界时
  1007 + */
  1008 + var toCenterByBounds = function () {
  1009 + var markerIsVisible = BMapLib.GeoUtils.isPointInRect(gpsMarker.getPosition(),map.getBounds());
  1010 + if(!markerIsVisible)
  1011 + map.panTo(gpsMarker.getPosition());
  1012 + };
  1013 +
  1014 + /**
  1015 + * 切换线路底图
  1016 + */
  1017 + var changeLine = function (lineCode, updown) {
  1018 + //reset();
  1019 + //从地图模块获取站点数据
  1020 + stations = gb_map_spatial_data.getStationArray(lineCode);
  1021 + //从localStorage 获取路段
  1022 + routes = JSON.parse(storage.getItem(lineCode + '_route'));
  1023 + routes = [routes.up_bd, routes.down_bd];
  1024 + switchPolyline(updown);
  1025 + };
  1026 + return {
  1027 + initData: initData,
  1028 + updateCar: updateCar,
  1029 + initMap: initMap,
  1030 + updateTrailLine: updateTrailLine,
  1031 + refreshOverlay: switchPolyline,
  1032 + toCenterByBounds: toCenterByBounds,
  1033 + reset: reset,
  1034 + changeLine: changeLine
  1035 + }
  1036 + })();
  1037 +
  1038 + /**
  1039 + * 播放相关
  1040 + * @type {{}}
  1041 + */
  1042 + var playObj = (function () {
  1043 + var conf = {
  1044 + playSpeed: 1,//播放速度
  1045 + drawPoint: 1,//绘制站点
  1046 + drawBuffArea: 1 ,//缓冲区
  1047 + stationName: 0, //站点名称
  1048 + carPark: [] //停车场
  1049 + };
  1050 +
  1051 + var gpsArray;//gps点位集合
  1052 + var init = function (rs) {
  1053 + gpsArray = rs.list;
  1054 + if(!gpsArray || gpsArray.length==0)
  1055 + return;
  1056 +
  1057 + len = gpsArray.length;
  1058 + //渲染配置信息
  1059 + renderConfig();
  1060 + //播放第一个点
  1061 + run();
  1062 + };
  1063 +
  1064 + var renderConfig = function () {
  1065 + $('.speed_form [name=playSpeed][value='+conf.playSpeed+']', modal)[0].checked = true;
  1066 + $('.buffer_area_form input[type=checkbox]', modal).each(function () {
  1067 + var name = $(this).attr('name');
  1068 + $(this)[0].checked = conf[name];
  1069 + });
  1070 + };
  1071 +
  1072 + /**
  1073 + * 播放函数
  1074 + */
  1075 + var runTimer; //播放定时器
  1076 + var toCenterTimer;//居中定时器
  1077 + var index = 0; //gps下标
  1078 + var play = function () {
  1079 + if(!run())
  1080 + runTimer = setTimeout(play, 1000 / conf.playSpeed);
  1081 + };
  1082 +
  1083 + /**
  1084 + * 定时居中
  1085 + */
  1086 + var fixedToCenter = function () {
  1087 + toCenterTimer = setInterval(function () {
  1088 + mapObj.toCenterByBounds();
  1089 + }, 500);
  1090 + };
  1091 +
  1092 + var pause = function () {
  1093 + clearInterval(runTimer);
  1094 + runTimer = null;
  1095 + clearInterval(toCenterTimer);
  1096 + toCenterTimer = null;
  1097 + };
  1098 +
  1099 + var clock = $('.ct_btn.clock', modal), gps, len;
  1100 + var run = function () {
  1101 + if(index == len){
  1102 + $('.map-wrap-tools .play_btn', modal).removeClass('play');
  1103 + pause();
  1104 + notify_succ('本次轨迹回放已结束!');
  1105 + searchForm.hideShade();
  1106 + return true;
  1107 + }
  1108 + gps = gpsArray[index];
  1109 + //更新GPS点位
  1110 + mapObj.updateCar(gps);
  1111 + //绘制轨迹线
  1112 + mapObj.updateTrailLine();
  1113 + //时间文本
  1114 + clock.text(gps.timeStr);
  1115 + //输出行车轨迹
  1116 + trailTableObj.add(gps, index);
  1117 + //输出到离站信息
  1118 + inOutStationTableObj.add(gps, index);
  1119 + //进度条
  1120 + mapTools.upProgressBar(index);
  1121 + index ++;
  1122 + };
  1123 +
  1124 + /**
  1125 + * 重置
  1126 + */
  1127 + var reset = function () {
  1128 + index = 0;
  1129 + gpsArray = null;
  1130 + pause();
  1131 + };
  1132 + return {
  1133 + init: init,
  1134 + getConf: function () {
  1135 + return conf;
  1136 + },
  1137 + setConf: function (k, v) {
  1138 + conf[k] = v;
  1139 + },
  1140 + play: play,
  1141 + fixedToCenter: fixedToCenter,
  1142 + pause: pause,
  1143 + reset: reset
  1144 + }
  1145 + })();
  1146 +
  1147 + function transMultiWGSToBd(obj) {
  1148 + if(!obj._gPoints)
  1149 + return;
  1150 + var bdPoints = [],coord;
  1151 + $.each(obj._gPoints, function () {
  1152 + coord = TransGPS.wgsToBD(this.lat, this.lng);
  1153 + bdPoints.push(new BMap.Point(coord.lng, coord.lat));
  1154 + });
  1155 +
  1156 + obj.bdPoints=bdPoints;
  1157 + }
  1158 + })();
  1159 + </script>
  1160 +</div>
0 1161 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/fragments/playback_v3/icon/pause.png 0 → 100644

915 Bytes

src/main/resources/static/real_control_v3/mapmonitor/fragments/playback_v3/icon/pause_2.png 0 → 100644

735 Bytes

src/main/resources/static/real_control_v3/mapmonitor/fragments/playback_v3/icon/play.png 0 → 100644

1004 Bytes

src/main/resources/static/real_control_v3/mapmonitor/fragments/playback_v3/icon/play_2.png 0 → 100644

775 Bytes

src/main/resources/static/real_control_v3/mapmonitor/fragments/playback_v3/icon/play_grey.png 0 → 100644

982 Bytes

src/main/resources/static/real_control_v3/mapmonitor/fragments/playback_v3/layout.html 0 → 100644
  1 +<div class="gps-play-back-panel-v3">
  2 + <div class="left-panel"></div>
  3 + <div class="right-panel"></div>
  4 +
  5 + <script id="pbv3_park_list_dropdown-temp" type="text/html">
  6 + <div class="search-form-wrap">
  7 + <form class="uk-form uk-form-horizontal">
  8 + <fieldset>
  9 + <legend>筛选</legend>
  10 + <div class="uk-form-row">
  11 + <label class="uk-form-label">线路</label>
  12 + <div class="uk-form-controls">
  13 + <select name="lineName" style="width: 85%;">
  14 + <option value="">--请选择--</option>
  15 + {{each lineNameArray as name n}}
  16 + <option value="{{name}}">{{name}}</option>
  17 + {{/each}}
  18 + </select>
  19 + </div>
  20 + </div>
  21 + <div class="uk-form-row">
  22 + <label class="uk-form-label">设备号</label>
  23 + <div class="uk-form-controls">
  24 + <input name="deviceId">
  25 + </div>
  26 + </div>
  27 + </fieldset>
  28 + </form>
  29 + </div>
  30 + <table class="uk-table uk-table-condensed uk-table-hover no-db-select"
  31 + style="margin-top: 140px;font-size: 13px;font-family: 微软雅黑;">
  32 + {{each list as obj i}}
  33 + <tr>
  34 + <td>{{obj.nbbm}}</td>
  35 + <td>{{obj.deviceId}}</td>
  36 + <td>{{obj.lineName}}</td>
  37 + </tr>
  38 + {{/each}}
  39 + </table>
  40 + </script>
  41 + <script id="pbv3_trail_tbody-temp" type="text/html">
  42 + {{each array as obj i}}
  43 + <dl data-code="{{obj.section_code}}">
  44 + <dd>{{obj.timeStr}}</dd>
  45 + <dd>{{obj.speed}}</dd>
  46 + <dd>
  47 + {{if obj.upDown==0}}
  48 + 上行
  49 + {{else if obj.upDown==1}}
  50 + 下行
  51 + {{else}}
  52 + 未知
  53 + {{/if}}
  54 + </dd>
  55 + <dd>{{obj.section_name}}</dd>
  56 + <dd>{{obj.lineName}}</dd>
  57 + </dl>
  58 + {{/each}}
  59 + {{if array.length==0}}
  60 + <dl class="pbv3-empty">
  61 + <dd style="text-indent: 135px;">没有搜索到行车轨迹</dd>
  62 + </dl>
  63 + {{/if}}
  64 + </script>
  65 +
  66 + <script id="pbv3_inout_station_tbody-temp" type="text/html">
  67 + {{each list as item i}}
  68 + <dl data-id="{{item.id}}">
  69 + <dd>{{item.stopName}}</dd>
  70 + <dd>{{item.in_time_str}}</dd>
  71 + <dd>{{item.out_time_str}}</dd>
  72 + <dd></dd>
  73 + <dd></dd>
  74 + </dl>
  75 + {{/each}}
  76 +
  77 + {{if list.length==0}}
  78 + <dl class="pbv3-empty">
  79 + <dd style="text-align: center;">没有找到到离站信息</dd>
  80 + </dl>
  81 + {{/if}}
  82 + </script>
  83 +
  84 + <script id="pbv3_inout_info_one_temp" type="text/html">
  85 + <dl data-id="{{id}}">
  86 + <dd>{{stopName}}</dd>
  87 + <dd>{{in_time_str}}</dd>
  88 + <dd></dd>
  89 + <dd></dd>
  90 + <dd></dd>
  91 + </dl>
  92 + </script>
  93 +
  94 + <script id="pbv3_abnormal_table_temp" type="text/html">
  95 + {{each array as item i}}
  96 + <dl>
  97 + <dd>
  98 + {{if item.abnormalType == 'speed'}}
  99 + {{if item.speed>=100}}
  100 + 速度异常
  101 + {{else}}
  102 + 超速({{item.speed}})
  103 + {{/if}}
  104 + {{else if item.abnormalType == 'outbound'}}
  105 + 越界
  106 + {{/if}}
  107 + </dd>
  108 + <dd>{{item.st_str}}</dd>
  109 + <dd>{{item.et_str}}</dd>
  110 + <dd></dd>
  111 + </dl>
  112 + {{/each}}
  113 +
  114 + {{if array.length==0}}
  115 + <dl class="pbv3-empty">
  116 + <dd style="text-indent: 120px;">没有找到相关异常信息</dd>
  117 + </dl>
  118 + {{/if}}
  119 + </script>
  120 + <script id="pbv3_park_dropdown-temp" type="text/html">
  121 + <div style="text-align: center;border-bottom: 1px solid #e2e2e2;padding-bottom: 9px;margin-bottom: 9px;">
  122 + <form class="uk-form" data-uk-margin>
  123 + <div class="uk-form-icon">
  124 + <i class="uk-icon-search"></i>
  125 + <input type="text" placeholder="搜索" class="park_list_search_input">
  126 + </div>
  127 + </form>
  128 + </div>
  129 + {{each list as p i}}
  130 + <li data-code="{{p.parkCode}}" ><a>{{p.parkName}}</a></li>
  131 + {{/each}}
  132 + </script>
  133 +
  134 + <script id="pbv3_park_form_devices-temp" type="text/html">
  135 + <div class="uk-animation-slide-top dynamic_devices" >
  136 + <span>{{deviceStr}}</span>
  137 + </div>
  138 + </script>
  139 +
  140 + <script id="pbv3_park_devices_dropdown-temp" type="text/html">
  141 + {{if dcs.length==1 && dcs[0].type==1}}
  142 + <div class="dynamic_devices_dropdown style1">
  143 + <div style="text-align: center;">从车辆基础信息关联设备号</div>
  144 + </div>
  145 + {{else}}
  146 + <div class="dynamic_devices_dropdown">
  147 + <ul class="uk-list">
  148 + <li>
  149 + <div>设备号</div>
  150 + <div>启用时间</div>
  151 + <div>停用时间</div>
  152 + </li>
  153 + {{each dcs as dc i}}
  154 + <li>
  155 + <div>{{dc.device}}</div>
  156 + <div>{{dc.stStr}}</div>
  157 + <div>{{dc.etStr}}</div>
  158 + </li>
  159 + {{/each}}
  160 + </ul>
  161 + </div>
  162 + {{/if}}
  163 + </script>
  164 + <script>
  165 + (function () {
  166 + var wrap = '.gps-play-back-panel-v3';
  167 + var leftWrap = '.gps-play-back-panel-v3>div.left-panel';
  168 + var rightWrap = '.gps-play-back-panel-v3>div.right-panel';
  169 + var dir = '/real_control_v3/mapmonitor/fragments/playback_v3/';
  170 + var params;
  171 +
  172 + $(wrap).one('init', function (e, data) {
  173 + e.stopPropagation();
  174 + params = data;
  175 + if(!params)
  176 + params = {};
  177 +
  178 + //左侧dom
  179 + $(leftWrap).load(dir + 'left.html', function () {
  180 + $(leftWrap).trigger('init-left-dom', params);
  181 + });
  182 + //右侧dom
  183 + $(rightWrap).load(dir + 'right.html');
  184 + });
  185 + })();
  186 + </script>
  187 +</div>
0 188 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/fragments/playback_v3/left.html 0 → 100644
  1 +<div class="play-back-form bg-grey">
  2 + <form class="uk-form uk-form-horizontal">
  3 + <div class="uk-form-row">
  4 + <label class="uk-form-label">车辆编码</label>
  5 + <div class="uk-form-controls">
  6 + <div class="uk-autocomplete uk-form autocomplete-nbbm" style="width: calc(100% - 60px)">
  7 + <div class="uk-autocomplete uk-form autocomplete-nbbm">
  8 + <input name="nbbm" required/>
  9 + </div>
  10 + </div>
  11 + <a style="color: #009688;margin-left: 5px;" data-uk-offcanvas="{target:'#carSelectOffcanvas'}">选择</a>
  12 + </div>
  13 + </div>
  14 +
  15 + <div class="uk-form-row">
  16 + <label class="uk-form-label">开始时间</label>
  17 + <div class="uk-form-controls">
  18 + <input class="flatpickr_input" name="startTime" required/>
  19 + </div>
  20 + </div>
  21 +
  22 + <div class="uk-form-row">
  23 + <label class="uk-form-label">结束时间</label>
  24 + <div class="uk-form-controls">
  25 + <input class="flatpickr_input" name="endTime" required/>
  26 + </div>
  27 + </div>
  28 + <div style="text-align: center;margin-top: 20px;">
  29 + <button class="uk-button uk-button-large uk-button-link p_back_form_submit" type="submit"><i
  30 + class="uk-icon-search"> </i> 搜索轨迹
  31 + </button>
  32 + </div>
  33 + </form>
  34 + <div class="form-error-text">
  35 + <a href="" class="uk-close uk-close-alt"></a><span></span>
  36 + </div>
  37 +</div>
  38 +
  39 +<!-- 异常table -->
  40 +<div class="play-back-abnormal_table_wrap bg-grey">
  41 + <div class="pback_abnormal_table_panel"
  42 + style="height: 100%;overflow: auto;">
  43 + <div class="ct_table abnormal_table" style="height: calc(100% - 30px);width: 500px;background: #e6e6e6;">
  44 + <div class="ct_table_head" style="background: #e6e6e6;">
  45 + <dl>
  46 + <dt>异常信息</dt>
  47 + <dt>开始时间</dt>
  48 + <dt>结束时间</dt>
  49 + <dt>所在路段</dt>
  50 + </dl>
  51 + </div>
  52 + <div class="ct_table_body">
  53 + </div>
  54 + </div>
  55 + </div>
  56 +</div>
  57 +
  58 +<!-- 行车轨迹和到离站 -->
  59 +<div class="play-back-trail-info-wrap bg-grey">
  60 + <div class="uk-width-medium-1-1">
  61 +
  62 + <ul class="uk-subnav uk-subnav-pill" data-uk-switcher="{connect:'#playBackV3TrailCont', swiping: false}" style="padding-left: 12px;">
  63 + <li class="uk-active"><a>行车轨迹</a></li>
  64 + <li><a>到离站信息</a></li>
  65 + </ul>
  66 + <span class="sum_mileage_span"></span>
  67 +
  68 + <ul class="uk-switcher uk-margin real_gps_info_tab_content" id="playBackV3TrailCont">
  69 + <li class="uk-active" style="height: 100%;">
  70 + <div class="trail-info-wrap" >
  71 + <div class="ct_table trail-info-table" style="height: calc(100% - 30px);">
  72 + <div class="ct_table_head" style="background: #e6e6e6;">
  73 + <dl>
  74 + <dt>时间</dt>
  75 + <dt>速度</dt>
  76 + <dt>上下行</dt>
  77 + <dt>所在路段</dt>
  78 + <dt>车载线路</dt>
  79 + </dl>
  80 + </div>
  81 + <div class="ct_table_body"></div>
  82 + </div>
  83 + </div>
  84 + </li>
  85 + <!-- 到离站数据 -->
  86 + <li style="height: 100%;">
  87 + <div class="inout_table_wrap" style="height: 100%;overflow: auto;">
  88 + <div class="ct_table" style="height: calc(100% - 30px);">
  89 + <div class="ct_table_head" style="background: #e6e6e6;">
  90 + <dl>
  91 + <dt>站点</dt>
  92 + <dt>进站时间</dt>
  93 + <dt>离站时间</dt>
  94 + <dt>上客</dt>
  95 + <dt>下客</dt>
  96 + </dl>
  97 + </div>
  98 + <div class="ct_table_body">
  99 + </div>
  100 + </div>
  101 + </div>
  102 + </li>
  103 + </ul>
  104 + </div>
  105 +</div>
  106 +
  107 +<!-- 车辆选择抽屉 -->
  108 +<div id="carSelectOffcanvas" class="uk-offcanvas">
  109 + <div class="uk-offcanvas-bar">
  110 + <div class="uk-panel offcanvas-cont">
  111 + <div class="spinner">
  112 + <div class="rect1"></div>
  113 + <div class="rect2"></div>
  114 + <div class="rect3"></div>
  115 + <div class="rect4"></div>
  116 + <div class="rect5"></div>
  117 + </div>
  118 + </div>
  119 + </div>
  120 +</div>
  121 +
  122 +<script>
  123 + var gb_playback_v3_leftpanel = (function () {
  124 +
  125 + var leftWrap = '.gps-play-back-panel-v3>div.left-panel';
  126 + var f = $('.play-back-form form', leftWrap);
  127 + var params;
  128 +
  129 + $(leftWrap).one('init-left-dom', function (e, data) {
  130 + e.stopPropagation();
  131 + params = data;
  132 +
  133 + //初始化表单
  134 + initForm();
  135 +
  136 + //固定表头
  137 + gb_ct_table.fixedHead($('.trail-info-wrap', leftWrap));
  138 + gb_ct_table.fixedHead($('.pback_abnormal_table_panel', leftWrap));
  139 + gb_ct_table.fixedHead($('.inout_table_wrap', leftWrap));
  140 + //滚动条
  141 + createScrollbar();
  142 +
  143 + //show title
  144 + /*UIkit.notify("设备端自身标识为无效的GPS点位,将不会再进入回放通路", {
  145 + status: 'info'
  146 + });*/
  147 + });
  148 +
  149 + /**
  150 + * 初始化表单
  151 + */
  152 + var initForm = function () {
  153 + if (params.nbbm)
  154 + $('[name=nbbm]', f).val(params.nbbm);
  155 + var st = moment().subtract(2, 'hour');
  156 + if (params.st)
  157 + st = moment(data.st, 'YYYY-MM-DD HH:mm');
  158 + $('[name=startTime]', f).val(st.format('YYYY-MM-DD HH:mm'));
  159 + var et = moment();
  160 + if (params.et)
  161 + et = moment(data.et, 'YYYY-MM-DD HH:mm');
  162 + $('[name=endTime]', f).val(et.format('YYYY-MM-DD HH:mm'));
  163 +
  164 + //初始化 flatpickr
  165 + var sConf = $.extend(gb_common.flatpickrDateTimeConfig, {
  166 + defaultHour: st.format('HH'),
  167 + defaultMinute: st.format('mm')
  168 + });
  169 + var eConf = $.extend(gb_common.flatpickrDateTimeConfig, {
  170 + defaultHour: et.format('HH'),
  171 + defaultMinute: et.format('mm')
  172 + });
  173 + flatpickr(leftWrap + ' .flatpickr_input[name=startTime]', sConf);
  174 + flatpickr(leftWrap + ' .flatpickr_input[name=endTime]', eConf);
  175 + };
  176 +
  177 + //搜索轨迹
  178 + var ONE_DAY = 60 * 60 * 24;
  179 + var MIN_SPACE = 60;
  180 + $('button[type=submit]', f).on('click', function (e) {
  181 + e.stopPropagation();
  182 + try {
  183 + var data = f.serializeJSON();
  184 +
  185 + //校验时间间隔
  186 + var fs = 'YYYY-MM-DD HH:mm';
  187 + var st = parseInt(moment(data.startTime, fs).format('X'));
  188 + var et = parseInt(moment(data.endTime, fs).format('X'));
  189 + data.st = st;
  190 + data.et = et;
  191 +
  192 + if (!data.nbbm || !data.nbbm.trim())
  193 + notify_err('你必须输入车辆编码');
  194 + else if (!data.startTime || !data.startTime.trim())
  195 + notify_err('你必须输入开始时间');
  196 + else if (!data.endTime || !data.endTime.trim())
  197 + notify_err('你必须输入结束时间');
  198 + else if (et < st)
  199 + notify_err('结束时间不能小于开始时间!');
  200 + else if ((et - st) > ONE_DAY)
  201 + notify_err('查询范围不能超过24小时!');
  202 + else if ((et - st) < MIN_SPACE)
  203 + notify_err('最小间隔1分钟!');
  204 + else {
  205 + show_load_btn(this);
  206 + //查询数据
  207 + get_server_trail_data(data, function (rs) {
  208 + //线路名称
  209 + var code2Name = gb_data_basic.lineCode2NameAll();
  210 + $.each(rs.list, function () {
  211 + this.lineName = code2Name[this.lineId];
  212 + this.nbbm = data.nbbm;
  213 + });
  214 + //排序
  215 + rs.list.sort(function (a, b) {
  216 + return parseInt((a.ts - b.ts) + '' + (a.stop_no - b.stop_no));
  217 + });
  218 + fillTrailTable(rs.list);//填充行车轨迹表格
  219 + fillArivalStationTable(rs.list);//填充到离站表格
  220 + $('.sum_mileage_span', leftWrap).text('共约 ' + rs.sumMileage + ' 公里');
  221 + fillAbnormalTable(rs['outboundList'], rs['speedList']);//填充异常信息表格
  222 + //准备播放
  223 + rs.arrivalData = arrivalData;
  224 + $('.gps-play-back-panel-v3>div.right-panel .play-back-tools-wrap').trigger('ready-to-play', rs);
  225 +
  226 + //更新滚动条
  227 + resetScrollbar();
  228 +
  229 + /**
  230 + * 显示设备更换信息
  231 + */
  232 + var deviceStr='', fs='YYYY-MM-DD HH:mm';
  233 + for(var i=0,dc;dc=rs.dcs[i++];){
  234 + deviceStr+=dc.device + ',';
  235 + dc.stStr = dc.st>0?moment(dc.st).format(fs):'';
  236 + dc.etStr = dc.et>0?moment(dc.et).format(fs):'';
  237 + }
  238 + deviceStr=deviceStr.substr(0, deviceStr.length-1);
  239 +
  240 + $('.play-back-form>.dynamic_devices', leftWrap).remove();
  241 + $('.play-back-form>.dynamic_devices_dropdown', leftWrap).remove();
  242 + var htmlStr = template('pbv3_park_form_devices-temp', {deviceStr:deviceStr}),
  243 + htmlStr2 = template('pbv3_park_devices_dropdown-temp', {dcs:rs.dcs});
  244 + $('.play-back-form', leftWrap).append(htmlStr).append(htmlStr2);
  245 + });
  246 + }
  247 + } catch (e) {
  248 + console.log(e);
  249 + }
  250 + return false;
  251 + });
  252 +
  253 + function resetScrollbar() {
  254 + $('.pback_abnormal_table_panel', leftWrap).perfectScrollbar('destroy').perfectScrollbar().scrollTop(0);
  255 + $('.trail-info-wrap', leftWrap).perfectScrollbar('destroy').perfectScrollbar().scrollTop(0);
  256 + $('.inout_table_wrap', leftWrap).perfectScrollbar('destroy').perfectScrollbar().scrollTop(0);
  257 + }
  258 +
  259 + function destoryScrollbar() {
  260 + $('.pback_abnormal_table_panel', leftWrap).perfectScrollbar('destroy');
  261 + $('.trail-info-wrap', leftWrap).perfectScrollbar('destroy');
  262 + $('.inout_table_wrap', leftWrap).perfectScrollbar('destroy');
  263 + }
  264 +
  265 + function createScrollbar() {
  266 + $('.pback_abnormal_table_panel', leftWrap).perfectScrollbar();
  267 + $('.trail-info-wrap', leftWrap).perfectScrollbar();
  268 + $('.inout_table_wrap', leftWrap).perfectScrollbar();
  269 + }
  270 +
  271 + $('.form-error-text .uk-close', leftWrap).on('click', function (e) {
  272 + e.stopPropagation();
  273 + $('.form-error-text').removeClass('show').find('span').text('');
  274 + return false;
  275 + });
  276 +
  277 + function notify_err(t) {
  278 + $('.form-error-text', leftWrap).addClass('show').find('span').text(t);
  279 + }
  280 +
  281 + function show_load_btn(btn) {
  282 + $(btn).attr('disabled', 'disabled').html('<i class="uk-icon-spinner uk-icon-spin"> </i> ');
  283 + }
  284 +
  285 + function hide_load_btn() {
  286 + $('button[type=submit]', f).removeAttr('disabled').html('<i class="uk-icon-search"> </i> 搜索轨迹');
  287 + }
  288 +
  289 + //车辆 autocomplete
  290 + gb_common.carAutocomplete($('.autocomplete-nbbm', leftWrap), gb_data_basic.carsArray());
  291 + $('.autocomplete-nbbm', leftWrap).on('input', function () {
  292 + $('.play-back-form>.dynamic_devices', leftWrap).remove();
  293 + });
  294 +
  295 + /**
  296 + * 车辆选择抽屉显示
  297 + */
  298 + var fw = '#carSelectOffcanvas .search-form-wrap';
  299 + $('#carSelectOffcanvas').on('show.uk.offcanvas', function () {
  300 + var that = this;
  301 + $.get('/freeLogin/basic/ccInfo/lineArray', {idx: gb_data_basic.line_idx}, function (rs) {
  302 + if (!rs || rs.length == 0)
  303 + return;
  304 +
  305 + rs.sort(function (a, b) {
  306 + if (a.lineName == b.lineName)
  307 + return a.nbbm.localeCompare(b.nbbm);
  308 + return a.lineName.localeCompare(b.lineName);
  309 + });
  310 +
  311 + var lineNames = {};
  312 + $.each(rs, function () {
  313 + lineNames[this.lineName] = 1;
  314 + });
  315 +
  316 + var bodyStr = template('pbv3_park_list_dropdown-temp', {
  317 + list: rs,
  318 + lineNameArray: gb_common.get_keys(lineNames)
  319 + });
  320 + $('.offcanvas-cont', that).html(bodyStr);
  321 +
  322 + $('select[name=lineName]', fw).on('change', offcanvasTableFilter);
  323 + $('input[name=deviceId]', fw).on('input', offcanvasTableFilter);
  324 + $('.offcanvas-cont .uk-table tr').dblclick(function () {
  325 + var nbbm = $('td:eq(0)', this).text();
  326 + $('[name=nbbm]', f).val(nbbm);
  327 + $.UIkit.offcanvas.hide([force = false]);
  328 + });
  329 + });
  330 + });
  331 + var carTab = '.offcanvas-cont .uk-table';
  332 + var offcanvasTableFilter = function () {
  333 + var lineName = $('select[name=lineName]', fw).val();
  334 + var deviceId = $('input[name=deviceId]', fw).val();
  335 + $('tr', carTab).show().each(function () {
  336 + if (lineName && $('td:eq(2)', this).text() != lineName)
  337 + $(this).hide();
  338 +
  339 + if (deviceId && $('td:eq(1)', this).text().indexOf(deviceId) == -1)
  340 + $(this).hide();
  341 + });
  342 + };
  343 +
  344 +
  345 + /**
  346 + * 从服务器获取轨迹数据
  347 + * @param data
  348 + */
  349 + function get_server_trail_data(data, cb) {
  350 + $.ajax({
  351 + url: '/freeLogin/gps/history_v3/' + data.nbbm,
  352 + data: {st: data.st, et: data.et},
  353 + success: function (rs) {
  354 + $('.bg-grey', leftWrap).removeClass('bg-grey');
  355 + hide_load_btn();
  356 + if(rs.status=='ERROR'){
  357 + notify_err('异常:' + rs.msg);
  358 + }
  359 + else if(rs.status=='SUCCESS'){
  360 + if(!rs.list || rs.list.length==0){
  361 + notify_err('没有查询到历史轨迹信息');
  362 + }
  363 + cb && cb(rs);
  364 + }
  365 + },
  366 + error: function () {
  367 + hide_load_btn();
  368 + notify_err('服务器出现异常,请联系管理员!');
  369 + }
  370 + });
  371 + }
  372 +
  373 + /**
  374 + * 填充行车轨迹表格
  375 + */
  376 + function fillTrailTable(list){
  377 + var array = [];
  378 + for (var i = 0, gps; gps = list[i++];) {
  379 + //格式化时间
  380 + gps.timeStr = moment(gps.timestamp).format('HH:mm.ss');
  381 + try {
  382 + if (i > 0 && array[array.length - 1]['section_code'] == gps['section_code'])
  383 + array.pop();
  384 + }
  385 + catch (e) {
  386 + }
  387 +
  388 + if (gps['section_code'])
  389 + array.push(gps);
  390 + }
  391 +
  392 + var htmlStr = template('pbv3_trail_tbody-temp', {array: array});
  393 + $('.trail-info-table .ct_table_body', leftWrap).html(htmlStr);
  394 + }
  395 +
  396 + /**
  397 + * 填充到离站数据表格
  398 + * @param list
  399 + */
  400 + var arrivalData;
  401 + function fillArivalStationTable(list){
  402 + var data, f, prev;
  403 + var $wrap = $('.inout_table_wrap', leftWrap);
  404 + var $tbody = $('.ct_table_body', $wrap);
  405 +
  406 + data = [];
  407 + $.each(list, function (i, gps) {
  408 + prev = data[data.length - 1];
  409 + if (gps['inout_stop'] == -1)
  410 + return true;
  411 + if (gps['inout_stop'] == 0 && gps['inout_stop_info']) {
  412 + //连续进站信号,取第一个
  413 + if(prev && prev['out_ts'] == null
  414 + && prev['stopName'] == gps['inout_stop_info'].stopName){
  415 + return true;
  416 + }
  417 + data.push(createIn(gps));
  418 + }
  419 + else if (gps['inout_stop'] == 1) {
  420 + f = matchOut(prev, gps);
  421 + if(f)
  422 + data.push(f);
  423 + }
  424 + });
  425 + //格式化时间
  426 + $.each(data, function (i) {
  427 + if (this.in_ts)
  428 + this.in_time_str = moment(this.in_ts).format('HH:mm.ss');
  429 + if (this.out_ts)
  430 + this.out_time_str = moment(this.out_ts).format('HH:mm.ss');
  431 + //id
  432 + this.id = 'in_out_' + i;
  433 + });
  434 +
  435 + var htmlStr = template('pbv3_inout_station_tbody-temp', {list: data});
  436 + $tbody.html(htmlStr);
  437 + arrivalData = data;
  438 + }
  439 +
  440 + var createIn = function (gps) {
  441 + var info = gps['inout_stop_info'];
  442 + return {in_ts: info.ts, stopNo: info.stopNo, stopName: info.stopName}
  443 + };
  444 + var matchOut = function (prevInfo, gps) {
  445 + var oi = gps['inout_stop_info'];
  446 + if(!oi)
  447 + return;
  448 + if(prevInfo && prevInfo.stopName == oi.stopName){
  449 + prevInfo['out_ts'] = oi.ts;
  450 + return null;
  451 + }
  452 + else {
  453 + return {out_ts: oi.ts,stopNo: oi.stopNo,stopName: oi.stopName}
  454 + }
  455 + };
  456 +
  457 + /**
  458 + * 填充异常信息表格
  459 + */
  460 + function fillAbnormalTable(){
  461 + var array = [];
  462 + for(var i = 0; i < arguments.length; i ++){
  463 + array = array.concat(arguments[i]);
  464 + }
  465 + //格式化时间
  466 + $.each(array, function () {
  467 + if(this.st)
  468 + this.st_str = moment(this.st).format('HH:mm.ss');
  469 + if(this.et)
  470 + this.et_str = moment(this.et).format('HH:mm.ss');
  471 + });
  472 +
  473 + //排序
  474 + array.sort(function (a, b) {
  475 + return a.st - b.st;
  476 + });
  477 +
  478 + var htmlStr = template('pbv3_abnormal_table_temp', {array: array});
  479 + $('.abnormal_table .ct_table_body', leftWrap).html(htmlStr);
  480 + }
  481 +
  482 + $(leftWrap).on('mouseover', '.dynamic_devices', function () {
  483 + $('.dynamic_devices_dropdown', leftWrap).show();
  484 + }).on('mouseout', function () {
  485 + $('.dynamic_devices_dropdown', leftWrap).hide();
  486 + });
  487 +
  488 + return {
  489 + fillTrailTable: fillTrailTable,
  490 + fillArivalStationTable: fillArivalStationTable,
  491 + destoryScrollbar: destoryScrollbar,
  492 + createScrollbar: createScrollbar
  493 + }
  494 + })();
  495 +</script>
0 496 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/fragments/playback_v3/right.html 0 → 100644
  1 +<div class="play-back-tools-wrap">
  2 +
  3 + <div class="top-btn-list disabled">
  4 + <a class="play"></a>
  5 + <div class="multi-items">
  6 + <form class="uk-form speed_form">
  7 + <label><input type="radio" name="playSpeed" value="1" disabled> x1</label>
  8 + <label><input type="radio" name="playSpeed" value="5" checked disabled> x5</label>
  9 + <label><input type="radio" name="playSpeed" value="10" disabled> x10</label>
  10 + <label><input type="radio" name="playSpeed" value="20" disabled> x20</label>
  11 + </form>
  12 + </div>
  13 + <div class="multi-items">
  14 + <form class="uk-form buffer_area_form">
  15 + <label>
  16 + <input type="checkbox" name="drawPoint" checked disabled> 站点
  17 + </label>
  18 + <label>
  19 + <input type="checkbox" name="drawBuffArea" checked disabled> 缓冲区
  20 + </label>
  21 + <label>
  22 + <input type="checkbox" name="stationName" disabled> 站点名称
  23 + </label>
  24 + <label>
  25 + <div class="uk-button-dropdown" data-uk-dropdown="">
  26 + <a>停车场 <i class="uk-icon-angle-down"></i></a>
  27 + <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;">
  28 + <ul class="uk-nav uk-nav-dropdown parks_list">
  29 + </ul>
  30 + </div>
  31 + </div>
  32 + </label>
  33 + <label>
  34 + <div class="uk-button-dropdown" data-uk-dropdown="">
  35 + <a title="默认跟随GPS,选择后将固定底图。每次搜索会重置">线路底图 <i class="uk-icon-angle-down"></i></a>
  36 + <div class="uk-dropdown uk-dropdown-scrollable" style="max-height: 300px;">
  37 + <ul class="uk-nav uk-nav-dropdown base_line_list">
  38 + </ul>
  39 + </div>
  40 + </div>
  41 + </label>
  42 + </form>
  43 + </div>
  44 +
  45 + <div class="uk-button-group export-btn-list">
  46 + <button class="uk-button" disabled>
  47 + <a class="export-excel"><i class="uk-icon-file-excel-o"></i> 导出轨迹</a>
  48 + </button>
  49 + <div data-uk-dropdown="{mode:'click'}">
  50 + <button class="uk-button" disabled><i class="uk-icon-caret-down"></i></button>
  51 + <div class="uk-dropdown uk-dropdown-small">
  52 + <ul class="uk-nav uk-nav-dropdown">
  53 + <li><a class="export-excel-abnormal">导出异常数据</a></li>
  54 + <!--<li><a class="export-excel-arrival">导出到离站数据</a></li>-->
  55 + </ul>
  56 + </div>
  57 + </div>
  58 + </div>
  59 +
  60 + </div>
  61 + <span class="ui-slider-tip"></span>
  62 + <span class="ui-slider-tip-fixed"></span>
  63 + <div class="ct-progress-bar" >
  64 + <div class="scale"></div>
  65 + </div>
  66 +</div>
  67 +
  68 +<div class="play-back-map-wrap"></div>
  69 +<script>
  70 +
  71 + (function () {
  72 + var rightWrap = '.gps-play-back-panel-v3>div.right-panel';
  73 + var leftWrap = '.gps-play-back-panel-v3>div.left-panel';
  74 + var progress = $('.ct-progress-bar', rightWrap);
  75 + var gpsArray;
  76 + var arrivalData;
  77 + var step;
  78 + var timeTip = $('.ui-slider-tip', rightWrap);
  79 + var scale = $('.scale', progress);
  80 + var play_before_flag;
  81 +
  82 + $('.play-back-tools-wrap', rightWrap).on('ready-to-play', function (e, data) {
  83 + e.stopPropagation();
  84 + //reset
  85 + reset();
  86 +
  87 + gpsArray = data.list;
  88 + arrivalData = data.arrivalData;
  89 + inoutLen = arrivalData.length;
  90 +
  91 + if(!gpsArray || gpsArray.length==0)
  92 + return;
  93 + step = progress.width() / gpsArray.length;
  94 + //激活工具栏
  95 + $('.top-btn-list', rightWrap).removeClass('disabled').find('[disabled]').removeAttr('disabled');
  96 + //xlPolyline.lineId=gpsArray[0].lineId;
  97 + //xlPolyline.upDown=gpsArray[0].upDown;
  98 +
  99 + /**
  100 + * 默认显示完整的地图轨迹
  101 + */
  102 + try{
  103 + play_before_goto(gpsArray.length - 1);
  104 + }catch (e){
  105 + console.log(e);
  106 + }
  107 + play_before_flag=true;
  108 + });
  109 +
  110 +
  111 + function reset() {
  112 + pause();
  113 + $('.top-btn-list .play', rightWrap).removeClass('pause');
  114 + index=0;
  115 + inoutIndex=0;
  116 + clearXlPolyline();
  117 + xlPolyline={};
  118 + scale.css('width', 0);
  119 + fixedTime.css('left', 0).css('visibility', 'hidden');
  120 + trailArray=[];
  121 + gpsMarker=null;
  122 + trailPolyline=null;
  123 + map.clearOverlays();
  124 + parkPolygons={};
  125 + autoChange=true;
  126 + }
  127 +
  128 + function replaceSymbol(s){
  129 + return s.replace(new RegExp(/-/g),'').replace(new RegExp(/:/g),'').replace(new RegExp(/ /g),'');
  130 + }
  131 +
  132 + progress.mousemove(function (e) {
  133 + if(!gpsArray || gpsArray.length==0)
  134 + return;
  135 + var x = e.offsetX; //外面板的margin-left:-3px;
  136 + var i = parseInt(x / step);
  137 + var time = moment(gpsArray[i].timestamp).format('HH:mm.ss');
  138 +
  139 + timeTip.text(time).css('left', x - 28).css('visibility', 'visible');
  140 + }).mouseout(function () {
  141 + timeTip.css('visibility', 'hidden')
  142 + }).on('click', function (e) {
  143 + var x = e.offsetX;
  144 + goto(parseInt(x / step));
  145 + });
  146 +
  147 + /***
  148 + * 地图
  149 + */
  150 + var mapWrap = $('.play-back-map-wrap', rightWrap);
  151 + setTimeout(function () {
  152 + initMap();
  153 + }, 700);
  154 +
  155 + var map;
  156 + function initMap() {
  157 + //初始化地图
  158 + map = new BMap.Map(mapWrap[0]);
  159 + //中心点和缩放级别
  160 + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 16);
  161 + map.enableScrollWheelZoom();
  162 + //map.setMapStyle({style:'googlelite'});
  163 + }
  164 +
  165 + /**
  166 + * 重置地图
  167 + */
  168 + mapWrap.on('reset-map', function (e) {
  169 + e.stopPropagation();
  170 + map.enableAutoResize();
  171 +
  172 + if(!gpsArray || gpsArray.length==0)
  173 + return;
  174 + //重新计算进度条
  175 + step = progress.width() / gpsArray.length;
  176 + scale.css('width', step * index);
  177 + if(fixedTime.css('visibility')=='visible'){
  178 + fixedTime.text(moment(gpsArray[index].timestamp).format('HH:mm.ss')).css('left', step * index - 27);
  179 + }
  180 + }).on('close', reset);
  181 +
  182 + /**
  183 + * 播放
  184 + */
  185 + $('.top-btn-list .play', rightWrap).on('click', function () {
  186 + if(toolsDisabled())
  187 + return;
  188 +
  189 + if(!$(this).hasClass('pause')){
  190 + //第一次点击播放,清除一下
  191 + if(play_before_flag){
  192 + reset();
  193 + play_before_flag = false;
  194 + }
  195 + $(this).addClass('pause');
  196 + if(index>=gpsArray.length-1){
  197 + goto(0);
  198 + }
  199 + gb_playback_v3_leftpanel.destoryScrollbar();
  200 + play();
  201 + fixedToCenter();
  202 + }
  203 + else{
  204 + gb_playback_v3_leftpanel.createScrollbar();
  205 + $(this).removeClass('pause');
  206 + pause();
  207 + }
  208 + });
  209 +
  210 + function toolsDisabled() {
  211 + return $('.top-btn-list', rightWrap).hasClass('disabled');
  212 + }
  213 +
  214 +
  215 + var pause = function () {
  216 + clearInterval(runTimer);
  217 + runTimer = null;
  218 + clearInterval(toCenterTimer);
  219 + toCenterTimer = null;
  220 + };
  221 + var runTimer
  222 + , playSpeed = parseInt($('.speed_form input[checked]').val());
  223 + var index = 0;
  224 + var play = function () {
  225 + if(!run()){
  226 + runTimer = setTimeout(play, 1000 / playSpeed);
  227 + }
  228 + };
  229 +
  230 + var fixedTime = $('.ui-slider-tip-fixed', rightWrap);
  231 + var run = function () {
  232 + if(index == gpsArray.length){
  233 + index--;
  234 + $('.top-btn-list .play', rightWrap).removeClass('pause');
  235 + pause();
  236 + notify_succ('本次轨迹回放已结束!');
  237 + gb_playback_v3_leftpanel.createScrollbar();
  238 + return true;
  239 + }
  240 +
  241 + gps = gpsArray[index];
  242 + drawCarMarker(gps);//更新GPS点位
  243 + updateTrailLine(gps, index);//行车轨迹线
  244 + updateProgress(gps, index)//进度条
  245 +
  246 + printTrailTable(gps, index);//输出轨迹信息
  247 + printArrivalTable(gps, index);//输出到离站信息
  248 + index ++;
  249 + };
  250 +
  251 + var updateProgress = function (gps, i) {
  252 + scale.css('width', step * i);//进度条
  253 + fixedTime.text(moment(gps.timestamp).format('HH:mm.ss')).css('left', step * i - 27).css('visibility', 'visible');
  254 + }
  255 +
  256 + /**
  257 + * 定时居中
  258 + */
  259 + var toCenterTimer;
  260 + var fixedToCenter = function () {
  261 + toCenterTimer = setInterval(function () {
  262 + var markerIsVisible = BMapLib.GeoUtils.isPointInRect(gpsMarker.getPosition(),map.getBounds());
  263 + if(!markerIsVisible){
  264 + map.panTo(gpsMarker.getPosition());
  265 + }
  266 + }, 500);
  267 + };
  268 +
  269 + /**
  270 + * 绘制gps
  271 + * @param gps
  272 + */
  273 + var gpsMarker;
  274 + var xlPolyline = {};
  275 + var drawCarMarker = function (gps) {
  276 + if(!gpsMarker){
  277 + gpsMarker = new BMap.Marker(new BMap.Point(gps.bd_lon, gps.bd_lat));
  278 + var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
  279 + gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  280 + gpsMarker.setTop(true);
  281 + map.addOverlay(gpsMarker);
  282 + //居中
  283 + map.panTo(gpsMarker.getPosition());
  284 + }
  285 + else{
  286 + gpsMarker.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat));
  287 + var width = gb_map_imap.calcGpsMarkerWidth(gps.nbbm);
  288 + gpsMarker.setIcon(new BMap.Icon(gb_map_imap.createCarIconRotation(gps, width), new BMap.Size(width, 75)));
  289 + }
  290 +
  291 + if(autoChange && (gps.lineId!=xlPolyline.lineId || gps.upDown!=xlPolyline.upDown)){
  292 + drawXlPolyline(gps.lineId, gps.upDown);
  293 + }
  294 + }
  295 +
  296 + var bform = $('.buffer_area_form', rightWrap);
  297 + var autoChange=true;
  298 + function drawXlPolyline(lineCode, upDown) {
  299 + if(upDown!=0 && upDown!=1){
  300 + //upDown = xlPolyline.upDown?xlPolyline.upDown:0;
  301 + return;
  302 + }
  303 +
  304 + clearXlPolyline();
  305 + //绘制路段
  306 + drawRoadPolyline(lineCode, upDown);
  307 + //绘制站点
  308 + if($('input[name=drawPoint]', bform)[0].checked)
  309 + drawStationMarkers(lineCode, upDown);
  310 + //绘制缓冲区
  311 + if($('input[name=drawBuffArea]', bform)[0].checked)
  312 + drawBuffArea(lineCode, upDown);
  313 + //绘制站点名称
  314 + if($('input[name=stationName]', bform)[0].checked)
  315 + drawNameMarkers(lineCode, upDown);
  316 +
  317 + xlPolyline.lineId = lineCode;
  318 + xlPolyline.upDown = upDown;
  319 + }
  320 +
  321 + var storage = window.localStorage;
  322 + var routes;//路段
  323 + var stations;//站点
  324 + var parks;//停车场
  325 +
  326 + function drawRoadPolyline(lineCode, upDown) {
  327 + //从localStorage获取路段
  328 + routes = JSON.parse(storage.getItem(lineCode + '_route'));
  329 + if(!routes){
  330 + var name = gb_data_basic.lineCode2NameAll()[lineCode];
  331 + notify_err("缺少" + name + "的路段信息,请选择" + name + "进入线调");
  332 + return;
  333 + }
  334 + routes = [routes['up_bd'], routes['down_bd']];
  335 + var colour = gb_map_config.getConfig().section.color;
  336 + var plConfig = {strokeWeight: 12, strokeColor: upDown?colour.down:colour.up, strokeOpacity: .4}, pos,polyline,pls=[];
  337 + $.each(routes[upDown], function (i, item) {
  338 + pos = [];
  339 + $.each(item.split(','), function () {
  340 + temps = this.split(' ');
  341 + pos.push(new BMap.Point(temps[0], temps[1]));
  342 + });
  343 + polyline = new BMap.Polyline(pos, plConfig);
  344 + map.addOverlay(polyline);
  345 + pls.push(polyline);
  346 + });
  347 + xlPolyline.polylines = pls;
  348 + }
  349 +
  350 + function drawStationMarkers(lineCode, upDown) {
  351 + if(!lineCode)return;
  352 + //从地图模块获取站点数据
  353 + stations = gb_map_spatial_data.getStationArray(lineCode);
  354 + if(!stations){
  355 + var name = gb_data_basic.lineCode2NameAll()[lineCode];
  356 + notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");
  357 + return;
  358 + }
  359 +
  360 + var array = stations[upDown], psm, zdMarkers=[];
  361 + $.each(array, function () {
  362 + //坐标转换
  363 + var coord = TransGPS.wgsToBD(this.lat, this.lon);
  364 + this.bd_lat = coord.lat;
  365 + this.bd_lon = coord.lng;
  366 + psm = new BMap.Marker(new BMap.Point(this.bd_lon, this.bd_lat));
  367 + psm.setTitle(this.stationName);
  368 + map.addOverlay(psm);
  369 + psm.setIcon(new BMap.Icon(gb_map_imap.createStationPointIcon(), new BMap.Size(12, 12)));
  370 + zdMarkers.push(psm);
  371 + });
  372 + xlPolyline.zdMarkers=zdMarkers;
  373 + }
  374 +
  375 + function drawBuffArea(lineCode, upDown) {
  376 + if(!lineCode)return;
  377 + stations = gb_map_spatial_data.getStationArray(lineCode);
  378 + if(!stations){
  379 + var name = gb_data_basic.lineCode2NameAll()[lineCode];
  380 + notify_err("缺少" + name + "的缓冲区信息,请选择" + name + "进入线调");
  381 + return;
  382 + }
  383 +
  384 + var array = stations[upDown], obj, buffs=[];
  385 + $.each(array, function () {
  386 + if(this.shapesType=='r')
  387 + obj = drawCircle(new BMap.Point(this.bd_lon, this.bd_lat), this.radius);
  388 + else if(this.shapesType=='d')
  389 + obj = drawPolygon(this);
  390 +
  391 + if(obj)
  392 + buffs.push(obj);
  393 + });
  394 +
  395 + xlPolyline.buffs = buffs;
  396 + }
  397 +
  398 + function drawNameMarkers(lineCode, upDown) {
  399 + if(!lineCode)return;
  400 + //从地图模块获取站点数据
  401 + stations = gb_map_spatial_data.getStationArray(lineCode);
  402 + if(!stations){
  403 + var name = gb_data_basic.lineCode2NameAll()[lineCode];
  404 + notify_err("缺少" + name + "的站点信息,请选择" + name + "进入线调");
  405 + return;
  406 + }
  407 +
  408 + var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "black", borderColor: "black", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
  409 + var array = stations[upDown], tMarkers=[];
  410 + $.each(array, function () {
  411 + var width = this.stationName.length * 12;
  412 + var label = new BMap.Label(this.stationName, {
  413 + position:new BMap.Point(this.bd_lon, this.bd_lat),
  414 + offset: new BMap.Size(-(width / 2), -27)
  415 + });
  416 + label.setStyle(style);
  417 + map.addOverlay(label);
  418 + tMarkers.push(label);
  419 + });
  420 +
  421 + xlPolyline.tMarkers = tMarkers;
  422 + }
  423 +
  424 + function clearXlPolyline() {
  425 + var rems = [];
  426 + //清除路段
  427 + clearOverlayArray(xlPolyline.polylines);
  428 + xlPolyline.polylines = [];
  429 + //清除站点
  430 + clearOverlayArray(xlPolyline.zdMarkers);
  431 + xlPolyline.zdMarkers = [];
  432 + //清除缓冲区
  433 + clearOverlayArray(xlPolyline.buffs);
  434 + xlPolyline.buffs = [];
  435 + //清除站点名称
  436 + clearOverlayArray(xlPolyline.tMarkers);
  437 + xlPolyline.tMarkers = [];
  438 + }
  439 +
  440 + function clearOverlayArray(array) {
  441 + if(!array || !isArray(array))
  442 + return;
  443 + $.each(array, function () {
  444 + map.removeOverlay(this);
  445 + });
  446 + }
  447 +
  448 + //更新轨迹线条
  449 + var trailArray=[], trailPolyline;
  450 + function updateTrailLine(gps, i) {
  451 + trailArray.push(gpsMarker.getPosition());
  452 + if(!trailPolyline){
  453 + trailPolyline = new BMap.Polyline(trailArray, {strokeWeight: 2, strokeColor: '#000000'});
  454 + map.addOverlay(trailPolyline);
  455 + }
  456 + else{
  457 + trailPolyline.setPath(trailArray);
  458 + }
  459 +
  460 + //最多记录4000个点位轨迹线条
  461 + if(trailArray.length > 4000)
  462 + trailArray = trailArray.slice(trailArray.length - 4000);
  463 + }
  464 +
  465 + var trailTbody = leftWrap + ' .trail-info-table .ct_table_body',
  466 + trailWrap = leftWrap + ' .trail-info-wrap' , trailPrve;
  467 + var printTrailTable = function (gps, i) {
  468 + if(i == 0)
  469 + $(trailTbody).html('');
  470 +
  471 + var code = gps['section_code'];
  472 + if (!trailPrve || code != trailPrve['section_code']) {
  473 + $(trailTbody).append(template('pbv3_trail_tbody-temp', {array: [gps]}));
  474 + }
  475 + else{
  476 + var dds = $(trailTbody).find('dl[data-code=' + code + ']').last().find('dd');
  477 + $(dds[0]).text(gps.timeStr);
  478 + $(dds[1]).text(gps.speed);
  479 + }
  480 + trailPrve = gps;
  481 + $(trailWrap).scrollTop($(trailWrap)[0].scrollHeight);
  482 + };
  483 +
  484 +
  485 + var arrivalWrap = leftWrap + ' .inout_table_wrap',
  486 + arivalTbody = arrivalWrap + ' .ct_table_body';
  487 +
  488 + var inoutIndex=0, inoutLen, _item;
  489 + var printArrivalTable = function (gps, i) {
  490 + if(inoutIndex == 0)
  491 + $(arivalTbody).html('');
  492 +
  493 + var $dl;
  494 + for(var j = inoutIndex; j < inoutLen; j++){
  495 + _item = arrivalData[j];
  496 + $dl = $(arivalTbody).find('dl[data-id='+_item.id+']');
  497 + if(gps.ts >= _item.in_ts && $dl.length==0){
  498 + $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));
  499 + inoutIndex = j;
  500 + }
  501 +
  502 + if(gps.ts >= _item.out_ts){
  503 + var dds = $dl.find('dd');
  504 + if($dl.length==0)
  505 + $(arivalTbody).append(template('pbv3_inout_info_one_temp', _item));
  506 + else
  507 + $(dds[2]).text(_item.out_time_str);
  508 + inoutIndex = j;
  509 + }
  510 + else if(!_item.out_ts && gps.ts >= _item.in_ts){
  511 + inoutIndex = j;
  512 + }
  513 + else {
  514 + break;
  515 + }
  516 + }
  517 + $(arrivalWrap).scrollTop($(arrivalWrap)[0].scrollHeight);
  518 + };
  519 +
  520 + var drawCircle = function (point, radius) {
  521 + var circle = new BMap.Circle(point, radius);
  522 + circle.setStrokeColor('#000000');
  523 + circle.setStrokeWeight(1);
  524 + map.addOverlay(circle);
  525 + return circle;
  526 + };
  527 +
  528 + var drawPolygon = function (station) {
  529 + transMultiWGSToBd(station);
  530 + var polygon = new BMap.Polygon(station.bdPoints, {strokeColor: '#000000', strokeWeight: 1});
  531 + map.addOverlay(polygon);
  532 + return polygon;
  533 + };
  534 +
  535 + var transMultiWGSToBd = function(obj) {
  536 + if(!obj._gPoints)
  537 + return;
  538 + var bdPoints = [],coord;
  539 + $.each(obj._gPoints, function () {
  540 + coord = TransGPS.wgsToBD(this.lat, this.lng);
  541 + bdPoints.push(new BMap.Point(coord.lng, coord.lat));
  542 + });
  543 +
  544 + obj.bdPoints=bdPoints;
  545 + };
  546 +
  547 + /**
  548 + * 工具栏点击事件
  549 + */
  550 + $('.buffer_area_form input', rightWrap).on('click', function () {
  551 + var name = $(this).attr('name'),
  552 + lineCode = xlPolyline.lineId,
  553 + upDown = xlPolyline.upDown;
  554 + switch (name){
  555 + case 'stationName':
  556 + //清除站点名称
  557 + clearOverlayArray(xlPolyline.tMarkers);
  558 + xlPolyline.tMarkers = [];
  559 + if(this.checked)
  560 + drawNameMarkers(lineCode, upDown);
  561 + break;
  562 + case 'drawBuffArea':
  563 + //清除缓冲区
  564 + clearOverlayArray(xlPolyline.buffs);
  565 + xlPolyline.buffs = [];
  566 + if(this.checked)
  567 + drawBuffArea(lineCode, upDown);
  568 + break;
  569 + case 'drawPoint':
  570 + //清除站点
  571 + clearOverlayArray(xlPolyline.zdMarkers);
  572 + xlPolyline.zdMarkers = [];
  573 + if(this.checked)
  574 + drawStationMarkers(lineCode, upDown);
  575 + break;
  576 + }
  577 + });
  578 +
  579 + $('.speed_form input[name=playSpeed]', rightWrap).on('click', function () {
  580 + playSpeed = parseInt($(this).val());
  581 + });
  582 +
  583 +
  584 + function goto(ei) {
  585 + if (ei < 0 || ei >= gpsArray.length)
  586 + return;
  587 +
  588 + var isrun;
  589 + if(runTimer){
  590 + pause();
  591 + isrun=true;
  592 + }
  593 +
  594 + var gps = gpsArray[ei];
  595 + updateProgress(gps, ei);
  596 + //更新gps marker
  597 + drawCarMarker(gps);
  598 + //更新轨迹线条
  599 + trailArray = [];
  600 + var i = 0;
  601 + if(ei > 1000)
  602 + i = ei - 1000;
  603 + for (; i < ei; i++)
  604 + trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
  605 + updateTrailLine(gpsArray[ei], ei);
  606 +
  607 + var subArray = gpsArray.slice(0, ei + 1);
  608 + //更新行车轨迹表格
  609 + gb_playback_v3_leftpanel.fillTrailTable(subArray);
  610 + //更新到离站表格
  611 + //重新定位 inoutIndex
  612 + $.each(arrivalData, function (i, obj) {
  613 + if(gps.ts<this.in_ts || gps.ts<this.out_ts){
  614 + inoutIndex = i;
  615 + return false;
  616 + }
  617 + });
  618 + gb_playback_v3_leftpanel.fillArivalStationTable(subArray);
  619 + //居中
  620 + map.panTo(gpsMarker.getPosition());
  621 +
  622 + index = ei + 1;
  623 + if(isrun){
  624 + play();
  625 + fixedToCenter();
  626 + }
  627 + }
  628 +
  629 + function play_before_goto(ei) {
  630 + if (ei < 0 || ei >= gpsArray.length)
  631 + return;
  632 +
  633 + var gps = gpsArray[ei];
  634 + //更新gps marker
  635 + drawCarMarker(gps);
  636 + //更新轨迹线条
  637 + trailArray = [];
  638 + var i = 0;
  639 + if(ei > 1000)
  640 + i = ei - 1000;
  641 + for (; i < ei; i++)
  642 + trailArray.push(new BMap.Point(gpsArray[i].bd_lon, gpsArray[i].bd_lat));
  643 + updateTrailLine(gpsArray[ei], ei);
  644 +
  645 + //居中
  646 + map.panTo(gpsMarker.getPosition());
  647 + }
  648 +
  649 + /**
  650 + * 初始化停车场下拉菜单
  651 + */
  652 + var parkPolygons={};
  653 + (function (lineCode) {
  654 + //从地图模块获取停车场数据
  655 + var parks = gb_map_spatial_data.carparkArray();
  656 + //渲染
  657 + var htmlStr = template('pbv3_park_dropdown-temp', {list: parks});
  658 + $('.buffer_area_form .parks_list', rightWrap).html(htmlStr);
  659 +
  660 + console.log('parksparks', parks);
  661 + //拼音映射
  662 + var searchData=[];
  663 + for(var i=0,p;p=parks[i++];){
  664 + searchData.push({
  665 + code: p.parkCode,
  666 + name: p.parkName,
  667 + fullChars: pinyin.getFullChars(p.parkName).toUpperCase(),
  668 + camelChars: pinyin.getCamelChars(p.parkName).toUpperCase()
  669 + })
  670 + }
  671 + //搜索
  672 + var listWrap = $('.buffer_area_form .parks_list', rightWrap);
  673 + $('.park_list_search_input', rightWrap).on('input', function () {
  674 + var v = $(this).val();
  675 + if(!v){
  676 + $('li', listWrap).show();
  677 + return;
  678 + }
  679 + v = v.toUpperCase();
  680 + $('li', listWrap).hide();
  681 + for(var i=0,obj;obj=searchData[i++];){
  682 + if(obj.name.indexOf(v)!=-1 || obj.fullChars.indexOf(v)!=-1 || obj.camelChars.indexOf(v)!=-1)
  683 + $('li[data-code="'+obj.code+'"]', listWrap).show();
  684 + }
  685 + });
  686 +
  687 + //停车场点击
  688 + $('.buffer_area_form .parks_list>li', rightWrap).on('click', function () {
  689 + var code = $(this).data('code');
  690 +
  691 + if(!parkPolygons[code]){
  692 + var park;
  693 + $.each(parks, function () {
  694 + if(this.parkCode==code){park = this;return false;}
  695 + });
  696 +
  697 + transMultiWGSToBd(park);
  698 + var polygon = new BMap.Polygon(park.bdPoints, {strokeColor: 'red', strokeWeight: 1});
  699 + map.addOverlay(polygon);
  700 + parkPolygons[code] = polygon;
  701 + //中心点
  702 + var ts = park.gCenterPoint.split(' ')
  703 + ,coord = TransGPS.wgsToBD(parseFloat(ts[1]), parseFloat(ts[0]));
  704 + polygon._centerPoint = new BMap.Point(coord.lng, coord.lat);
  705 + //绘制名称label
  706 + var style = {backgroundColor: "rgba(255, 255, 255, 0.69)",color : "red", borderColor: "red", fontSize : "12px", height : "16px", lineHeight : "16px", fontFamily:"微软雅黑"}
  707 + var width = park.parkName.length * 12;
  708 + var label = new BMap.Label(park.parkName, {
  709 + position:polygon._centerPoint,
  710 + offset: new BMap.Size(-(width / 2), -27)
  711 + });
  712 + label.setStyle(style);
  713 + map.addOverlay(label);
  714 + }
  715 +
  716 + //定位到polygon
  717 + var polygon=parkPolygons[code];
  718 + map.panTo(polygon._centerPoint);
  719 + });
  720 + })();
  721 +
  722 + //初始化线路地图下拉菜单
  723 + (function () {
  724 + var opts='';
  725 + $.each(gb_data_basic.activeLines, function () {
  726 + opts+='<li data-code="'+this.lineCode+'" data-dir="0"><a>'+this.name+'上行</a></li><li data-code="'+this.lineCode+'" data-dir="1"><a>'+this.name+'下行</a></li>';
  727 + });
  728 + $('.base_line_list', rightWrap).html(opts);
  729 +
  730 + //切换线路底图
  731 + $(rightWrap).on('click', '.base_line_list>li', function () {
  732 + var code = $(this).data('code');
  733 + var updown = $(this).data('dir');
  734 + autoChange = false;
  735 + drawXlPolyline(code, updown);
  736 + });
  737 + })();
  738 +
  739 +
  740 + function formData() {
  741 + var fs = 'YYYY-MM-DD HH:mm';
  742 + var f = $('.play-back-form form', leftWrap),
  743 + nbbm = $('[name=nbbm]',f).val(),
  744 + st = parseInt(moment($('[name=startTime]',f).val(), fs).format('X')),
  745 + et = parseInt(moment($('[name=endTime]',f).val(), fs).format('X'));
  746 +
  747 + return {
  748 + nbbm: nbbm,
  749 + st: st,
  750 + et: et
  751 + }
  752 + }
  753 +
  754 + //轨迹
  755 + $('.export-excel', rightWrap).on('click', function () {
  756 + var d = formData();
  757 + window.open('/freeLogin/gps/history_v3/excel/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  758 + });
  759 + //异常信息
  760 + $('.export-excel-abnormal', rightWrap).on('click', function () {
  761 + var d = formData();
  762 + window.open('/freeLogin/gps/history_v3/excel_abnormal/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  763 + });
  764 + //到离站
  765 + $('.export-excel-arrival', rightWrap).on('click', function () {
  766 + var d = formData();
  767 + window.open('/freeLogin/gps/history_v3/excel_arrival/' + d.nbbm + "?st="+d.st+"&et="+d.et);
  768 + });
  769 + })();
  770 +</script>
0 771 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/js/playback.js 0 → 100644
  1 +/* 地图模块 轨迹回放 */
  2 +
  3 +var gb_map_play_back = (function () {
  4 +
  5 + var dom;
  6 +/* $.get('/real_control_v3/mapmonitor/fragments/playback_v2/main.html', function (rs) {
  7 + dom = rs;
  8 + });*/
  9 + $.get('/real_control_v3/mapmonitor/fragments/playback_v3/layout.html', function (rs) {
  10 + dom = rs;
  11 + });
  12 +
  13 + var setParam = function (sch) {
  14 + console.log('sch', sch);
  15 + var f = $('.play-back-form form'),
  16 + st = (sch['fcsjActualTime']?sch['fcsjActualTime']:sch['dfsjT']) - 1000 * 60 * 5,
  17 + et = (sch['zdsjActualTime']?sch['zdsjActualTime']:sch['zdsjT']) + 1000 * 60 * 5,
  18 + fs = 'YYYY-MM-DD HH:mm';
  19 +
  20 + $('[name=nbbm]', f).val(sch.clZbh);
  21 + $('[name=startTime]', f).val(moment(st).format(fs));
  22 + $('[name=endTime]', f).val(moment(et).format(fs));
  23 + };
  24 +
  25 + var initParams = function (deviceId, nbbm) {
  26 + //关闭infowindow
  27 + if (deviceId)
  28 + gb_map_imap.call('closeWin', deviceId);
  29 +
  30 + //show modal
  31 + //open_modal_dom(dom, {deviceId: deviceId, nbbm: nbbm});
  32 +
  33 + var pbv3MapWrap = '.gps-play-back-panel-v3>div.right-panel .play-back-map-wrap';
  34 + var resizeFlag;
  35 + var index = layer.open({
  36 + id: 'play_back_v3_modal',
  37 + type: 1,
  38 + title: '<i class="uk-icon-play-circle"></i> 轨迹回放',
  39 + shadeClose: true,
  40 + shade: false,
  41 + moveOut: true,
  42 + maxmin: true, //开启最大化最小化按钮
  43 + area: ['1299px', '754px'],
  44 + //moveOut: true,
  45 + skin:'layui-layer-molv play_back-layer',
  46 + content: dom,
  47 + zIndex: layer.zIndex,
  48 + success: function(layero){
  49 + layer.setTop(layero);
  50 + $('.gps-play-back-panel-v3').trigger('init', {deviceId: deviceId, nbbm: nbbm});
  51 + },
  52 + end: function () {
  53 +
  54 + },
  55 + resizing: function () {
  56 + if(resizeFlag)
  57 + return;
  58 + resizeFlag = true;
  59 + setTimeout(function () {
  60 + $(pbv3MapWrap).trigger('reset-map');
  61 + resizeFlag = false;
  62 + }, 1200);
  63 + },
  64 + full: function () {
  65 + $(pbv3MapWrap).trigger('reset-map');
  66 + },
  67 + min: function () {
  68 + $(pbv3MapWrap).trigger('reset-map');
  69 + },
  70 + restore: function () {
  71 + $(pbv3MapWrap).trigger('reset-map');
  72 + },
  73 + cancel: function () {
  74 + $(pbv3MapWrap).trigger('close');
  75 + //删除所有的flatpickr元素,避免元素堆积
  76 + $('.flatpickr-calendar.showTimeInput').remove();
  77 + }
  78 + });
  79 + layer.full(index);
  80 + };
  81 +
  82 + //导出excel
  83 + var listToExcel = function (list) {
  84 + var temp = '<html>' +
  85 + ' <head> '+
  86 + ' </head>' +
  87 + ' <body>' +
  88 + ' <table border="1">' +
  89 + ' <tr><th>序号</th><th>车辆</th><th>所在道路</th><th>经度</th><th>纬度</th><th>时间</th><th>速度</th></tr>' +
  90 + ' {{each list as gps i}}' +
  91 + ' <tr><td>{{i+1}}</td><td>{{gps.nbbm}}</td><td>{{gps.section_name}}</td><td>{{gps.lon}}</td><td>{{gps.lat}}</td><td>{{gps.timeStr}}</td><td>{{gps.speed}}</td></tr>' +
  92 + ' {{/each}}' +
  93 + ' </table>' +
  94 + ' </body>' +
  95 + ' </html>';
  96 +
  97 + var rs = template.compile(temp)({list: list});
  98 +
  99 + var uri = 'data:application/vnd.ms-excel;base64,';
  100 + return uri + base64(rs);
  101 + //location.href = uri + base64(rs);
  102 + };
  103 +
  104 +
  105 + function base64(string) {
  106 + return window.btoa(unescape(encodeURIComponent(string)));
  107 + }
  108 +
  109 + return {
  110 + initParams: initParams,
  111 + listToExcel: listToExcel,
  112 + setParam: setParam
  113 + }
  114 +})();
0 115 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/js/spatial_data.js 0 → 100644
  1 +/** 空间数据 */
  2 +
  3 +var gb_map_spatial_data = (function () {
  4 +
  5 + var storage = window.localStorage;
  6 +
  7 + var activeLines = JSON.parse(storage.getItem('lineControlItems'));
  8 + var line_idx = (function () {
  9 + var str = '';
  10 + for (var i = 0, item; item = activeLines[i++];) {
  11 + str += (',' + item.lineCode);
  12 + }
  13 + return str.substr(1);
  14 + })();
  15 +
  16 + var cont = '#spatial-tree-content';
  17 + //线路站点路由数据
  18 + var lineStationArr;
  19 +
  20 + //停车场数据
  21 + var carparkArr;
  22 +
  23 + var init = function () {
  24 + //加载站点路由数据
  25 + gb_common.$get('/freeLogin/realMap/stationSpatialData', {idx: line_idx}, function (rs) {
  26 + var list = rs.list;
  27 + $.each(list, function () {
  28 + this.lat = this.gLaty;
  29 + this.lon = this.gLonx;
  30 + delete this.gLaty;
  31 + delete this.gLonx;
  32 + if(this.shapesType=='d'){
  33 + var calcRs = calcPolygonArea(this.gPolygonGrid);
  34 + this._polygonArea = calcRs._polygonArea;
  35 + this._gPoints = calcRs._gPoints;
  36 + }
  37 + });
  38 + //排序
  39 + list.sort(function (a, b) {
  40 + return a.stationRouteCode - b.stationRouteCode;
  41 + });
  42 + //按线路分组
  43 + lineStationArr = gb_common.groupBy(list, 'lineCode');
  44 + //再按上下行分组
  45 + for (var lineCode in lineStationArr) {
  46 + lineStationArr[lineCode] = gb_common.groupBy(lineStationArr[lineCode], 'directions');
  47 + }
  48 +
  49 + ep.emitLater('station');
  50 + });
  51 +
  52 + //加载停车场数据
  53 + gb_common.$get('/freeLogin/realMap/carParkSpatialData', {}, function (rs) {
  54 + carparkArr = rs.list;
  55 + $.each(carparkArr, function () {
  56 + if(this.shapesType=='d'){
  57 + var calcRs = calcPolygonArea(this.gParkPoint);
  58 + this._polygonArea = calcRs._polygonArea;
  59 + this._gPoints = calcRs._gPoints;
  60 + }
  61 + });
  62 + ep.emitLater('carpark');
  63 + });
  64 +
  65 + var ep = EventProxy.create('station', 'carpark', function () {
  66 + $(".real_spatial_panel").resizable({
  67 + maxHeight: '100%',
  68 + minHeight: 18
  69 + });
  70 +
  71 + //绘制站点路由树
  72 + $('.station-route-tree', cont)
  73 + //state插件 状态恢复完成
  74 + .on('state_ready.jstree', function () {
  75 + //绑定checkbox状态切换事件
  76 + $(this).on('check_node.jstree uncheck_node.jstree', gb_map_overlay_mge.drawStation);
  77 + })
  78 + .on('activate_node.jstree', function (e, n) {
  79 + var node = n.node;
  80 + if(node.state.checked)
  81 + gb_map_overlay_mge._focus_station(node.data);
  82 + })
  83 + .jstree({
  84 + 'core': {
  85 + 'data': get_st_route_tree_data()
  86 + },
  87 + 'checkbox': {
  88 + 'keep_selected_style': false,
  89 + 'whole_node': false,
  90 + 'tie_selection': false
  91 + },
  92 + //local storage里的key
  93 + 'state': {
  94 + 'key': 'jstree_map_station_route'
  95 + },
  96 + 'plugins': ['checkbox', 'state']
  97 + });
  98 +
  99 +
  100 + //停车场
  101 + $('.carpark-panel', cont)
  102 + .on('state_ready.jstree', function () {
  103 + //绑定checkbox状态切换事件
  104 + $(this).on('check_node.jstree uncheck_node.jstree', gb_map_overlay_mge.drawCarpark);
  105 + })
  106 + .on('activate_node.jstree', function (e, n) {
  107 + var node = n.node;
  108 + if(node.state.checked)
  109 + gb_map_overlay_mge._focus_carpark(node.data);
  110 + })
  111 + .jstree({
  112 + 'core': {
  113 + 'data': get_st_carpark_tree_data()
  114 + },
  115 + 'checkbox': {
  116 + 'keep_selected_style': false,
  117 + 'whole_node': false,
  118 + 'tie_selection': false
  119 + },
  120 + //local storage里的key
  121 + 'state': {
  122 + 'key': 'jstree_map_carpark'
  123 + },
  124 + 'plugins': ['checkbox', 'state']
  125 + });
  126 +
  127 + refresh();
  128 + });
  129 + };
  130 +
  131 + //计算多边形面积
  132 + function calcPolygonArea(polygonStr) {
  133 + var pStr = polygonStr.substring(9, polygonStr.length - 2);
  134 + var array = pStr.split(',');
  135 + var newArr=[];
  136 +
  137 + //递归去掉闭合的尾
  138 + (function () {
  139 + var f = arguments.callee;
  140 + var end=array.length - 1;
  141 + if(array.length > 1 && array[0] == array[end]){
  142 + array = array.slice(0, end);
  143 + f();
  144 + }
  145 + })();
  146 +
  147 + //去掉连续的重复点
  148 + var last;
  149 + $.each(array, function (i, str) {
  150 + if(last){
  151 + if(last != str)
  152 + newArr.push(str);
  153 + }
  154 + else
  155 + newArr.push(str);
  156 + last = str;
  157 + });
  158 +
  159 + var gPoints=[],ts;
  160 + $.each(newArr, function (i, c) {
  161 + ts=c.split(' ');
  162 + gPoints.push({
  163 + lat: parseFloat(ts[1]),
  164 + lng: parseFloat(ts[0])
  165 + });
  166 + });
  167 +
  168 + //用百度geo工具库计算面积
  169 + var _polygonArea = BMapLib.GeoUtils.getPolygonArea(gPoints);
  170 + return {_polygonArea: _polygonArea.toFixed(2), _gPoints: gPoints};
  171 + }
  172 +
  173 + var refresh = function (type, checked) {
  174 + if (!triggerElem())
  175 + return;
  176 +
  177 + if ((type == 'carPark' && checked) || (type == 'station' && !checked)) {
  178 + //显示停车场面板
  179 + $('.car-park-item', cont).addClass('uk-active');
  180 + $('li.cp-tab-btn', '.real_spatial_panel').addClass('uk-active');
  181 + $('.carpark-panel', cont).jstree(true).check_all();
  182 +
  183 + //绘制停车场
  184 + gb_map_overlay_mge.drawCarpark();
  185 + }
  186 + else {
  187 + //显示站点路由面板
  188 + $('.station-route-item', cont).addClass('uk-active');
  189 + $('li.sr-tab-btn', '.real_spatial_panel').addClass('uk-active');
  190 +
  191 + //选中相关站点路由树
  192 + var chs = gb_map_overlay_mge.getCheckedDevice();
  193 + var idx = {};
  194 + $.each(chs, function () {
  195 + idx[this.data.lineId + '_' + this.data.upDown] = 1;
  196 + });
  197 +
  198 + var treeObj = $('.station-route-tree', cont).jstree(true);
  199 + for (var id in idx) {
  200 + treeObj.check_node(treeObj.get_node(id + '_st'));
  201 + }
  202 +
  203 + //drawStation();
  204 + gb_map_overlay_mge.drawStation();
  205 + }
  206 + }
  207 +
  208 + var triggerElem = function () {
  209 + var config = gb_map_config.getConfig().spatialData;
  210 +
  211 + if(config.station || config.carPark){
  212 + showPanel();
  213 + return true;
  214 + }
  215 + hidePanel();
  216 + //gb_map_imap.call('hideAllStationMarker');
  217 + //gb_map_imap.call('hideDrawCarpark');
  218 + return false;
  219 + }
  220 +
  221 + var animationend = 'webkitAnimationEnd animationend';
  222 + var showPanel = function () {
  223 + var elem = $('.real_spatial_panel');
  224 + var config = gb_map_config.getConfig().spatialData;
  225 +
  226 + if (config.station && config.carPark) {
  227 + anim_show($('.uk-subnav', elem), 'uk-animation-scale-up');
  228 + $('.real_spatial_body', elem).addClass('show-tab');
  229 + }
  230 + else {
  231 + $('.uk-subnav', elem).hide();
  232 + $('.real_spatial_body', elem).removeClass('show-tab');
  233 + }
  234 +
  235 + $('li.uk-active', elem).removeClass('uk-active');
  236 +
  237 + if (!elem.is(":hidden"))
  238 + return;
  239 +
  240 + anim_show(elem, 'uk-animation-slide-left');
  241 + }
  242 +
  243 + var hidePanel = function () {
  244 + var elem = $('.real_spatial_panel');
  245 + elem.hide();
  246 + }
  247 +
  248 + function anim_show(e, anim) {
  249 + e.addClass(anim).show().one(animationend, function () {
  250 + $(this).removeClass(anim);
  251 + });
  252 + }
  253 +
  254 + function getCheckedStation() {
  255 + var list = [];
  256 + var chs = $('.station-route-tree', cont).jstree(true).get_checked(true);
  257 + chs = chs.filter(function (item) {
  258 + return item.data;
  259 + });
  260 + $.each(chs, function () {
  261 + list.push(this.data);
  262 + });
  263 + return list;
  264 + }
  265 +
  266 + function gteCheckedCarpark() {
  267 + var list = [];
  268 + var chs = $('.carpark-panel', cont).jstree(true).get_checked(true);
  269 + $.each(chs, function () {
  270 + list.push(this.data);
  271 + });
  272 + return list;
  273 + }
  274 +
  275 + var get_st_route_tree_data = function () {
  276 + var treeData = [];
  277 +
  278 + for (var lineCode in lineStationArr) {
  279 + name = gb_data_basic.codeToLine[lineCode].name;
  280 + treeData.push({
  281 + 'text': name,
  282 + 'open': true,
  283 + 'children': [
  284 + {
  285 + 'text': '上行',
  286 + 'children': grabs(lineStationArr[lineCode][0]),
  287 + 'id': lineCode + '_0_st'
  288 + },
  289 + {
  290 + 'text': '下行',
  291 + 'children': grabs(lineStationArr[lineCode][1]),
  292 + 'id': lineCode + '_1_st'
  293 + }
  294 + ]
  295 + })
  296 + }
  297 + return treeData;
  298 + };
  299 +
  300 + var get_st_carpark_tree_data = function () {
  301 + var treeData = [];
  302 +
  303 + $.each(carparkArr, function () {
  304 + treeData.push({
  305 + 'text': this.parkName,
  306 + 'data': this
  307 + });
  308 + });
  309 +
  310 + return treeData;
  311 + }
  312 +
  313 + var grabs = function (array) {
  314 + if (!array)
  315 + return;
  316 + var rs = [];
  317 + $.each(array, function () {
  318 + rs.push({
  319 + 'text': this.stationName,
  320 + 'data': this,
  321 + 'icon': false
  322 + });
  323 + });
  324 + return rs;
  325 + }
  326 +
  327 + return {
  328 + refresh: refresh,
  329 + init: init,
  330 + getCheckedStation:getCheckedStation,
  331 + gteCheckedCarpark: gteCheckedCarpark,
  332 + getStationArray: function (lineCode) {
  333 + return lineStationArr[lineCode];
  334 + },
  335 + carparkArray: function () {
  336 + return carparkArr;
  337 + }
  338 + };
  339 +})();
0 340 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/real.html 0 → 100644
  1 +<link href="/assets/css/TrafficControl.css" rel="stylesheet" merge="map_plugins"/>
  2 +<link rel="stylesheet" href="/real_control_v2/assets/plugins/jquery.ui/themes/base/all.css" merge="map_plugins"/>
  3 +<link rel="stylesheet" href="/real_control_v2/assets/plugins/spectrum/spectrum.css" merge="map_plugins"/>
  4 +<link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/form-advanced.gradient.min.css" merge="map_plugins"/>
  5 +<link rel="stylesheet" href="/real_control_v2/mapmonitor/css/real.css" />
  6 +<link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/progress.gradient.min.css" merge="map_plugins">
  7 +
  8 +<div class="map-system-msg flex-left">
  9 + <a class="z-depth-2 old_map" href="/pages/mapmonitor/alone/wrap.html" target="_blank"></a>
  10 + <a class="z-depth-2 now_map" href="/real_control_v3/alone_page/map/alone_wrap.html" target="_blank">
  11 + <i class="uk-icon-send-o"></i>
  12 + </a>
  13 +</div>
  14 +
  15 +<div id="real_map_container"></div>
  16 +<div class="real_right_gps_panel">
  17 + <form class="uk-form" >
  18 + <div class="uk-autocomplete uk-form ral-gps-autocom" style="width: 100%;">
  19 + <div class="uk-form-icon">
  20 + <i class="uk-icon-search"></i>
  21 + <input type="text" placeholder="搜索...">
  22 + </div>
  23 + </div>
  24 + </form>
  25 +
  26 + <div class="gps_tree_list"></div>
  27 +</div>
  28 +
  29 +<div class="real_bottom_panel">
  30 + <!--<div id="handle" class="ui-resizable-handle ui-resizable-n"></div>-->
  31 + <div class="real_br_cont map_config_wrap"></div>
  32 + <div class="telescopic">
  33 + <i class="uk-icon-angle-double-up"></i>
  34 + </div>
  35 +</div>
  36 +
  37 +<div class="real_spatial_panel">
  38 + <div class="top-right-toggle">
  39 + <ul class="uk-subnav uk-subnav-pill" data-uk-switcher="{connect:'#spatial-tree-content'}">
  40 + <li class="sr-tab-btn"><a>站点</a></li>
  41 + <li class="cp-tab-btn"><a>停车场</a></li>
  42 + </ul>
  43 + </div>
  44 + <div class="real_spatial_body">
  45 + <ul id="spatial-tree-content" class="uk-switcher">
  46 + <li class="station-route-item">
  47 + <div class="station-route-tree"></div>
  48 + </li>
  49 + <li class="car-park-item">
  50 + <div class="carpark-panel"></div>
  51 + </li>
  52 + </ul>
  53 + </div>
  54 +</div>
  55 +
  56 +
  57 +<div class="c_b_abnorm_notice"></div>
  58 +
  59 +<script id="map_abnorm_overspeed_list-temp" type="text/html">
  60 + {{each list as obj i}}
  61 + <div class="c_b_item {{obj.ets!=null?'over':''}}" data-nbbm="{{obj.nbbm}}">
  62 + {{obj.sts}} - {{obj.nbbm}} 开始超速({{obj.speed}})
  63 +
  64 + {{if obj.ets!=null}}
  65 + <span class="c_b_over"> {{obj.ets}} 结束</span>
  66 + {{/if}}
  67 + </div>
  68 + {{/each}}
  69 +</script>
  70 +
  71 +<script src="/real_control_v2/assets/js/GeoUtils_min.js" merge="map_plugins"></script>
  72 +<script src="/real_control_v2/mapmonitor/js/config.js" merge="map_custom_js"></script>
  73 +<script src="/real_control_v2/mapmonitor/js/gps_tree.js" merge="map_custom_js"></script>
  74 +<script src="/real_control_v3/mapmonitor/js/spatial_data.js" merge="map_custom_js"></script>
  75 +<script src="/real_control_v2/mapmonitor/js/map_overlay_manager.js" merge="map_custom_js"></script>
  76 +<script src="/real_control_v2/mapmonitor/js/real.js" ></script>
  77 +<script src="/real_control_v2/mapmonitor/js/map/iMap.js" merge="map_custom_js"></script>
  78 +<script src="/real_control_v2/mapmonitor/js/map/platform/baidu.js" merge="map_custom_js"></script>
  79 +<script src="/real_control_v2/mapmonitor/js/map/platform/gaode.js" merge="map_custom_js"></script>
  80 +<!-- jquery ui -->
  81 +<script src="/real_control_v2/assets/plugins/jquery.ui/core.js" merge="map_plugins"></script>
  82 +<script src="/real_control_v2/assets/plugins/jquery.ui/widget.js" merge="map_plugins"></script>
  83 +<script src="/real_control_v2/assets/plugins/jquery.ui/mouse.js" merge="map_plugins"></script>
  84 +<script src="/real_control_v2/assets/plugins/jquery.ui/resizable.js" merge="map_plugins"></script>
  85 +<!-- 颜色选择器 -->
  86 +<script src="/real_control_v2/assets/plugins/spectrum/spectrum.js" merge="map_plugins"></script>
  87 +<!-- play back -->
  88 +<script src="/real_control_v3/mapmonitor/js/playback.js" merge="map_custom_js"></script>
0 89 \ No newline at end of file
... ...
src/main/resources/static/real_control_v3/mapmonitor/real_monitor/fragments/play_back_modal.html 0 → 100644
src/main/resources/static/real_control_v3/mapmonitor/real_monitor/fragments/playback.html 0 → 100644
  1 +<div>
  2 +<script id="map_play_back_form_temp" type="text/html">
  3 +<div class="ct-form-modal">
  4 + <div class="uk-alert uk-alert-danger">
  5 + <i class="uk-icon-exclamation-circle"></i> 最多跨一天回放,请尽量小范围的查询
  6 + </div>
  7 + <form class="uk-form uk-form-horizontal" style="padding: 15px;">
  8 + <div class="uk-grid">
  9 + <div class="uk-width-1-1">
  10 + <div class="uk-form-row">
  11 + <label class="uk-form-label">车辆编码</label>
  12 + <div class="uk-form-controls">
  13 + <div class="uk-autocomplete uk-form" id="p_b_autocomp_car" style="width: 100%;">
  14 + <input type="text" name="nbbm" placeholder="车辆自编号" required>
  15 + </div>
  16 + </div>
  17 + </div>
  18 + </div>
  19 + </div>
  20 + <div class="uk-grid">
  21 + <div class="uk-width-1-1">
  22 + <div class="uk-form-row">
  23 + <label class="uk-form-label">起始时间</label>
  24 + <div class="uk-form-controls">
  25 + <input type="date" name="sDate" required >
  26 + <input type="time" name="sTime" required >
  27 + </div>
  28 + </div>
  29 + </div>
  30 + </div>
  31 + <div class="uk-grid">
  32 + <div class="uk-width-1-1">
  33 + <div class="uk-form-row">
  34 + <label class="uk-form-label">截止时间</label>
  35 + <div class="uk-form-controls">
  36 + <input type="date" name="eDate" required >
  37 + <input type="time" name="eTime" required >
  38 + </div>
  39 + </div>
  40 + </div>
  41 + </div>
  42 + <div class="b_c_submit">
  43 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-play-circle"></i> &nbsp;轨迹回放</button>
  44 + </div>
  45 + </form>
  46 +</div>
  47 +</script>
  48 +</div>
... ...
src/main/resources/static/real_control_v3/mapmonitor/real_monitor/fragments/real_monitor.html 0 → 100644
src/main/resources/static/real_control_v3/mapmonitor/real_monitor/js/gps_play_back.js 0 → 100644
  1 +var gb_map_playback = (function() {
  2 + var gb_form_validation_opts = {
  3 + framework: 'uikit',
  4 + locale: 'zh_CN'
  5 + };
  6 +
  7 + var temps;
  8 + $.get('/real_control_v2/mapmonitor/real_monitor/fragments/main.html', function(dom) {
  9 + temps= gb_common.compileTempByDom(dom);
  10 + });
  11 +
  12 + var init = function() {
  13 + var cont = '#mapRtContainer';
  14 +
  15 + var htmlStr = temps['map_play_back_form_temp']({});
  16 + $('.play_back', cont).html(htmlStr);
  17 +
  18 + var f = $('.play_back form', cont).formValidation(gb_form_validation_opts);
  19 + f.on('success.form.fv', function(e) {
  20 + e.preventDefault();
  21 + var data = $(this).serializeJSON();
  22 + console.log(data);
  23 + //查询历史gps数据
  24 + var fs = 'YYYY-MM-DDHH:mm',
  25 + st = moment(data.sDate + data.sTime, fs).format('X'),
  26 + et = moment(data.eDate + data.eTime, fs).format('X'),
  27 + nbbm = data.nbbm;
  28 + //isEnableFocus = params.enableFocus;
  29 + $.ajax({
  30 + url: '/gps/gpsHistory/multiple',
  31 + traditional: true,
  32 + data: {
  33 + nbbmArray: nbbm,
  34 + st: st,
  35 + et: et
  36 + },
  37 + success: function(rs) {
  38 + if (!rs || rs.length == 0) {
  39 + alert('服务器没有返回数据,请检查你的输入参数!');
  40 + return;
  41 + }
  42 + console.log(rs);
  43 + }
  44 + });
  45 + });
  46 +
  47 + //----------- 车辆 Autocomplete --------------
  48 + $.get('/freeLogin/basic/cars', function(rs) {
  49 + gb_common.carAutocomplete($('#p_b_autocomp_car', cont), rs);
  50 + });
  51 +
  52 + //默认值,当前时间前2小时
  53 + var m = moment(),
  54 + rq = 'YYYY-MM-DD',
  55 + sj = 'HH:mm';
  56 + $('input[name=eDate]', cont).val(m.format(rq));
  57 + $('input[name=eTime]', cont).val(m.format('HH:mm'));
  58 + $('input[name=sDate]', cont).val(m.subtract(2, 'hour').format(rq));
  59 + $('input[name=sTime]', cont).val(m.format(sj));
  60 + }
  61 +
  62 + return {
  63 + init: init
  64 + }
  65 +})();
... ...
src/main/resources/static/real_control_v3/mapmonitor/real_monitor/real.html 0 → 100644
  1 +<link href="/assets/css/TrafficControl.css" rel="stylesheet" />
  2 +<link rel="stylesheet" href="/real_control_v2/mapmonitor/real_monitor/css/real.css" />
  3 +<div id="mapContainer"></div>
  4 +<div class="map-system-msg z-depth-2">
  5 + 当前地图模块正在维护升级,请点击左侧 新窗口 按钮打开原版地图。
  6 +</div>
  7 +<nav class="uk-navbar map-lt-tools z-depth-2">
  8 + <ul class="uk-navbar-nav">
  9 + <li class="uk-parent" data-uk-dropdown>
  10 + <a><span id="curr_map_name">百度地图</span> <i class="uk-icon-caret-down"></i></a>
  11 + <div class="uk-dropdown uk-dropdown-navbar" >
  12 + <ul class="uk-nav uk-nav-navbar" id="mapTypeDrop">
  13 + <li data-id="baidu"><a>百度地图</a></li>
  14 + <li data-id="gaode"><a>高德地图</a></li>
  15 + </ul>
  16 + </div>
  17 + </li>
  18 + <li id="trafficChangeBtn"><a>路况</a></li>
  19 + <li id="openFullWindow"><a>新窗口</a></li>
  20 + </ul>
  21 +</nav>
  22 +
  23 +<div class="map_rt_wrap">
  24 + <ul class="uk-tab z-depth-2" data-uk-tab data-uk-switcher="{connect:'#mapRtContainer'}">
  25 + <li class="uk-active"><a>实时监控</a></li>
  26 + <li class="uk-disabled"><a><i class="uk-icon-search"></i> 搜索</a></li>
  27 + <li class="uk-disabled"><a><i class="uk-icon-history"></i> 回放</a></li>
  28 + <li class="uk-disabled"><a>安全行车</a></li>
  29 + </ul>
  30 + <ul id="mapRtContainer" class="uk-switcher z-depth-2">
  31 + <li class="real_monitor"></li>
  32 + <li class="search_panel">搜索</li>
  33 + <li class="play_back">轨迹回放</li>
  34 + <li>安全行车</li>
  35 + </ul>
  36 +</div>
  37 +<!-- gps信息窗口 -->
  38 +<script id="map_gps_info_win_temp" type="text/html">
  39 +<div class="gps_info_win">
  40 +<h5 style="color:#0E6AF9;">
  41 +{{if stationName!=null}}
  42 + {{stationName}}
  43 +{{else}}
  44 + 未知站点
  45 +{{/if}}
  46 +</h5>
  47 +<h4 style="margin: 5px 0 5px 0;">
  48 + <span style="color: #0E6AF9;">{{nbbm}}</span>
  49 +</h4>
  50 +<p>
  51 +营运状态:{{if state==0}}营运{{else}}非营运{{/if}}
  52 +</p>
  53 +<p>
  54 +走向:{{if upDown==0}}上行{{else if upDown==1}}下行{{else}}未知走向{{/if}}
  55 +</p>
  56 +<p>速度:{{speed}}</p>
  57 +<p>经度:{{lon}}</p>
  58 +<p>纬度:{{lat}}</p>
  59 +
  60 +<p style="color: gray;">{{fromNow}} 更新</p>
  61 +<hr>
  62 +<p>
  63 +{{if currSch!=null}}
  64 + 路牌:{{currSch.lpName}}
  65 +{{/if}}
  66 +</p>
  67 +<p class="banci-info">
  68 + {{if currSch!=null}}开往 {{currSch.zdzName}}{{/if}}
  69 +</p>
  70 +<p class="banci-info">
  71 +{{if nextSch!=null}}
  72 + 下一班{{nextSch.qdzName}} {{nextSch.fcsj}} 发车
  73 +{{/if}}
  74 +</p>
  75 +<a href="javascript:lineGroup.toPlayBack('{{nbbm}}', '{{lineId}}')" class="link_to_pback" style="color:#006600;font-size:12px;">轨迹回放</a>
  76 +</div>
  77 +</script>
  78 +<script src="/real_control_v2/mapmonitor/real_monitor/js/gps_play_back.js"></script>
  79 +<script src="/real_control_v2/mapmonitor/real_monitor/js/real.js"></script>
  80 +<script src="/real_control_v2/mapmonitor/real_monitor/js/map/iMap.js"></script>
  81 +<script src="/real_control_v2/mapmonitor/real_monitor/js/map/iMap.js"></script>
  82 +<script src="/real_control_v2/mapmonitor/real_monitor/js/map/platform/baidu.js"></script>
  83 +<script src="/real_control_v2/mapmonitor/real_monitor/js/map/platform/gaode.js"></script>
  84 +<script src="/real_control_v2/mapmonitor/real_monitor/js/gps_tree.js"></script>
... ...