Commit 824d47db authored by ninglx's avatar ninglx

大屏场景使用mapbox改造优化基本完成 (灯态待新数据结构接入联调

parent 384e9a5c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
......@@ -10,39 +9,70 @@
<link href="/cdn/libs/normalize/normalize.css" rel="stylesheet" />
<link href="/cdn/libs/element-ui/element-ui.css" rel="stylesheet" />
<!-- <link href="/cdn/libs/example/styles/jsDemo.css" rel="stylesheet" type="text/css" media="all" /> -->
<link href="/cdn/libs/mapbox-gl/mapbox-gl.css" rel="stylesheet" />
<link href="/cdn/libs/threebox/threebox.css" rel="stylesheet" />
<link rel="stylesheet" href="/cdn/libs/Cesium/Widgets/widgets.css" />
<link href="/cdn/libs/Cesium/Widgets/widgets.css" rel="stylesheet" />
<script src="./config.js"></script>
<script src="/cdn/libs/vue/vue.js"></script>
<script src="/cdn/libs/element-ui/element-ui.js"></script>
<script src="/cdn/libs/echarts/echarts.min.js"></script>
<script src="/cdn/libs/st-dao/st-dao.js"></script>
<script src="/cdn/libs/mapbox-gl/mapbox-gl.js" type="text/javascript"></script>
<script src="/cdn/libs/threebox/threebox.js" type="text/javascript"></script>
<script
src="/cdn/libs/mapbox-gl/mapbox-gl.js"
type="text/javascript"
></script>
<script
src="/cdn/libs/threebox/threebox.js"
type="text/javascript"
></script>
<script src="/cdn/libs/cesium/Cesium.js" type="text/javascript"></script>
<script src="/cdn/libs/turf/turf.min.js" type="text/javascript"></script>
<script src="/cdn/libs/flvjs/flv.min.js" type="text/javascript"></script>
<script src='/cdn/libs/reconnecting-websocket/reconnecting-websocket.js' type="text/javascript"></script>
<script
src="/cdn/libs/reconnecting-websocket/reconnecting-websocket.js"
type="text/javascript"
></script>
<script src="./config.js"></script>
<style>
#app,body,html {
height: 100%;
width: 100%;
overflow: hidden;
}
#app,
body,
html {
height: 100%;
width: 100%;
overflow: hidden;
}
.mapboxgl-popup-content {
background: transparent !important;
box-shadow: none !important;
padding: 0 !important;
}
.mapboxgl-popup-tip {
display: none !important;
}
.mapboxgl-popup-close-button {
font-size: 26px;
color: white;
}
.vehicleDetailPopup .mapboxgl-popup-close-button {
right: 14px;
top: 18px;
}
</style>
</head>
</head>
<body style="background-color: #0a1a29">
<body style="background-color: #0a1a29">
<noscript>
<strong>We're sorry but app doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
<strong
>We're sorry but app doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file
</body>
</html>
......@@ -38,7 +38,7 @@ export default {
},
methods: {
async init() {
await this.$store.dispatch("QUERY_MENU");
// await this.$store.dispatch("QUERY_MENU");
this.isInit = true;
},
},
......
<template>
<div class="map_main">
<div :id="mapId" style="height: 100%;width:100%;"></div>
</div>
</template>
<script>
let map;
// Point MultiPoint LineString MultiLineString Polygon MultiPolygon
export default {
name: "wMap",
props: ["mapId"],
components: {},
data() {
return {};
},
mounted() {},
methods: {
initMap(option) {
let options = Object.assign(
{},
{
container: this.mapId,
style: map_config.MAP_STYLE,
center: map_config.MAP_CENTER,
zoom: map_config.MAP_ZOOM,
maxZoom: map_config.MAX_ZOOM,
pitch: map_config.MAP_PITCH,
},
option
);
map = new mapboxgl.Map(options);
return map;
},
destroyMap() {
map?.remove;
map = null;
},
},
computed: {},
beforeDestroy() {},
};
</script>
<style scoped>
.map_main {
height: 100%;
width: 100%;
position: relative;
background-color: #040d1c
}
</style>
<style>
.mapboxgl-ctrl-attrib {
display: none;
}
</style>
......@@ -2,33 +2,33 @@ export default {
vehicleTypes: {
0: '未知',
1: '小客车',
// 2: '大货车',
2: '大货车',
3: '大巴车',
4: '行人',
// 5: '自行车',
5: '自行车',
6: '电动车',
7: '中巴车',
// 8: '危化车',
8: '危化车',
// 9: '以撒物',
10: '小货车',
11: '中货车',
// 12: '救护车',
12: '救护车',
// 13: '消防车',
// 14: '机动摩托车',
// 15: '小巴车',
// 150: '外卖车',
// 151: '外卖车(美团)',
// 152: '外卖车(饿了么)',
// 153: '外卖车(肯德基)',
// 154: '外卖车(麦当劳)',
// 160: '快递车',
14: '机动摩托车',
15: '小巴车',
150: '外卖车',
151: '外卖车(美团)',
152: '外卖车(饿了么)',
153: '外卖车(肯德基)',
154: '外卖车(麦当劳)',
160: '快递车',
// 161: '快递车(京东)',
// 162: '快递车(顺丰)',
// 163: '快递车(申通)',
// 164: '快递车(圆通)',
// 165: '快递车(中通)',
// 166: '快递车(韵达)',
// 170: '货车-车轴型为11',
170: '货车-车轴型为11',
// 171: '货车-车轴型为12',
// 172: '货车-车轴型为15',
// 173: '货车-车轴型为122',
......@@ -76,10 +76,8 @@ export default {
'银色':'#c1c4ca',
'黄色':'#ffd400',
'蓝色':'#1e41be',
'棕色':'#804000',
'灰色':'#77787b',
},
lightModelDict: {
// 0: 杆色
......@@ -126,5 +124,48 @@ export default {
8:'能见度小于0.1公里 浓雾 能见度极差',
9:'能见度不足100米',
}
},
carTypeGlbMap:{
0:'0',
1:'0',
2:'2',
3:'3',
4:'4',
5:'5',
6:'6',
7:'7',
8:'8',
9:'0',
10:'10',
11:'11',
12:'12',
13:'0',
14:'14',
150:'14',
151:'14',
152:'14',
153:'14',
154:'14',
160:'11',
161:'11',
162:'11',
163:'11',
164:'11',
165:'11',
166:'11',
170:'170',
171:'170',
172:'170',
173:'170',
174:'170',
175:'170',
176:'170',
177:'170',
178:'170',
179:'170',
180:'170',
181:'170',
182:'170',
183:'170',
}
}
......@@ -7,23 +7,9 @@ export default {
weather: require('../../assets/images/holo/qxjcy.png'),
camera: require('../../assets/images/holo/spxj.png'),
sign: require('../../assets/images/holo/xhj.png'),
mobile: require('../../assets/images/sc/mobileEquip.png'),
homeCamera: require('../../assets/images/sc/crossCamera.png'),
mobileEquip: require('../../assets/images/sc/mobileEquip.png'),
// light11: require('../../assets/images/sc/leftRed.png'),
// light12: require('../../assets/images/sc/leftYellow.png'),
// light13: require('../../assets/images/sc/leftGreen.png'),
// light21: require('../../assets/images/sc/sRed.png'),
// light22: require('../../assets/images/sc/sYellow.png'),
// light23: require('../../assets/images/sc/sGreen.png'),
// light31: require('../../assets/images/sc/rightRed.png'),
// light32: require('../../assets/images/sc/rightYellow.png'),
// light33: require('../../assets/images/sc/rightGreen.png'),
// light41: require('../../assets/images/sc/backRed.png'),
// light42: require('../../assets/images/sc/backYellow.png'),
// light43: require('../../assets/images/sc/backGreen.png'),
light11: require('../../assets/images/sc/rightRed.png'),
light12: require('../../assets/images/sc/rightYellow.png'),
light13: require('../../assets/images/sc/rightGreen.png'),
......@@ -35,10 +21,25 @@ export default {
light33: require('../../assets/images/sc/leftGreen.png'),
light41: require('../../assets/images/sc/backRed.png'),
light42: require('../../assets/images/sc/backYellow.png'),
light43: require('../../assets/images/sc/backGreen.png'), // light
// 1hong 2huang 3lv
// 1zuo 2zhi 3you
// light11: require(''), // 左转红色
// light12: require(''), // 左转黄
light43: require('../../assets/images/sc/backGreen.png'),
car0: require('../../assets/images/holo/carPic/car0.png'),
car1: require('../../assets/images/holo/carPic/car1.png'),
car3: require('../../assets/images/holo/carPic/car3.png'),
car4: require('../../assets/images/holo/carPic/car4.png'),
car5: require('../../assets/images/holo/carPic/car5.png'),
car6: require('../../assets/images/holo/carPic/car6.png'),
car7: require('../../assets/images/holo/carPic/car7.png'),
car10: require('../../assets/images/holo/carPic/car10.png'),
car14: require('../../assets/images/holo/carPic/car14.png'),
license0: require('../../assets/images/license/0.png'),
license1: require('../../assets/images/license/1.png'),
license2: require('../../assets/images/license/2.png'),
license3: require('../../assets/images/license/3.png'),
license4: require('../../assets/images/license/4.png'),
license5: require('../../assets/images/license/5.png'),
license6: require('../../assets/images/license/6.png'),
license9: require('../../assets/images/license/9.png'),
license11: require('../../assets/images/license/11.png'),
license12: require('../../assets/images/license/12.png'),
},
}
......@@ -9,7 +9,8 @@ export const dictPlateColor = () => fetch('/design/config/dictionary/byCondition
// 交通参与者类型
export const dictTrafficActor = () => fetch('/design/config/dictionary/byCondition', {"catalogId": "21F5FDB7B45343BDB54BABD2243299FC"}, 'POST')
// 路口
export const dictCrossInfo = () => fetch('/develop/sgw/dbInterface/gisc/t_base_cross_info/findByPage/F2B722217C05', {"pageSize": 10}, 'POST')
// export const dictCrossInfo = () => fetch('/develop/sgw/dbInterface/gisc/t_base_cross_info/findByPage/F2B722217C05', {"pageSize": 10}, 'POST')
export const dictCrossInfo = () => fetch('/holo/base-cross-info/list', {}, 'GET')
// 拥堵程度
export const dictCrowdDeep = () => fetch('/design/config/dictionary/byCondition', {"catalogId": "D9C0EBCF2BFA4B4994ACA0D48BC13563"}, 'POST')
// 所有权
......
......@@ -2,7 +2,7 @@ import Vuex from "vuex";
import app from "./modules/app";
import dataset from "./modules/dataset";
import menudata from "./modules/menudata";
import dicts from './modules/dict'
Vue.use(Vuex);
......@@ -10,7 +10,8 @@ const store = new Vuex.Store({
modules: {
app,
dataset,
menudata
menudata,
dicts
},
getters: {
menu: state => state.app.menu,
......
import * as dictApi from "../../dao/dict";
const dicts = {
// state子属性 key值命名来自dao/dict.js 中的方法名 以便策略模式请求
state: {
CarType: [],
CarColor: [],
PlateColor: [],
TrafficActor: [],
CrowdDeep: [],
Owner: [],
Nature: [],
IfLocal: [],
EventType: [],
CrossInfo: [],
Direction: [],
Visibility: [],
CrossType: [],
TrafficStatus:[]
},
actions: {
// 查询字典是否存在 并 请求 存储 vuex
async QUERY_DICT({ state }, typeParam) {
if (!state[typeParam.type].length) {
let res = await dictApi[`dict${typeParam.type}`]();
if (typeParam.type === "CrossInfo") {
for (let i = 0; i < res.content.length; i++) {
res.content[i].code = res.content[i].id;
}
}
state[typeParam.type] = res.content;
}
// return state[typeParam.type]
},
},
};
export default dicts;
import {baseUrl} from "@/config/baseUrl";
function Async(url = "", data = {}, type = "GET", params = {}) {
console.log(url,data,type,params)
// console.log(url,data,type,params)
let authorization = "";
this.url = url;
......
This diff is collapsed.
let ResponseCarTrack;
// let protobuf = require("protobufjs");
// protobuf.load("../wj-manage-web/RealtimeCarInfo.proto", function (event, root) {
// ResponseCarTrack = root.lookupType("com.wanji.holo.proto.RealtimeCarTrack");
// });
// readyState: 0-正在连接 1-已经连接 2-连接正在关闭 3-已关闭或没连接成功
function onError(e, data) {
// console.log("ws error...", e, data);
}
function onClose(e, data) {
// console.log("ws close...", e, data);
}
// { url: '', name: '', callback: '' }
export function initWs(data) {
if (typeof WebSocket === undefined) {
console.error("您的浏览器不支持socket");
} else {
// console.log("init...", data);
let currentSocket = new ReconnectingWebSocket(data.url);
// 监听socket连接open
// currentSocket.onopen = (e) => onOpen(e, data)
// 监听socket错误信息
currentSocket.onerror = (e) => onError(e, data);
// 断开连接
currentSocket.onclose = (e) => onClose(e, data);
// 接收消息
currentSocket.onmessage = (res) => {
// protobuf 解压数据
// if (data.name === "callCar") {
// let reader = new FileReader();
// reader.onload = (e) => {
// let buf = new Uint8Array(e.target.result);
// let responseCarTrack = ResponseCarTrack.decode(buf);
// data.callback(responseCarTrack.carInfo);
// };
// reader.readAsArrayBuffer(res.data);
// } else {
if (res.data.startsWith("[") || res.data.startsWith("{")) {
data.callback(JSON.parse(res.data));
}
// }
};
return {
name: data.name,
url: data.url,
ws: currentSocket,
};
}
}
......@@ -63,11 +63,10 @@ export default {
.vehicleDetail {
background-image: url("../../../assets/images/sc/redBack.png");
font-size: 12PX;
position: absolute;
position: relative;
width: 348PX;
height: 254PX;
padding: 2PX 16PX 6PX 120PX;
background-size: 100% 100%;
background-repeat: no-repeat;
......
......@@ -59,7 +59,7 @@ export default {
.vehicleDetail {
background-image: url("../../../assets/images/sc/originBack.png");
font-size: 12PX;
position: absolute;
position: relative;
width: 348PX;
height: 254PX;
padding: 115PX 16PX 6PX 16PX;
......
......@@ -77,11 +77,6 @@ export default {
::v-deep .content {
margin: 0
}
::v-deep .msg-card-content {
}
.top-left {
position: absolute;
left: -1px;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment