车辆详情-车辆点位

main
许宏杰 9 months ago
parent a9d297d1a2
commit 8324759ae0

@ -24,7 +24,7 @@
<!-- 插件 --> <!-- 插件 -->
<script <script
src="./lib/mars3d/plugins/dom-to-image.js" src="./lib/mars3d/plugins/html2canvas.min.js"
type="text/javascript" type="text/javascript"
></script> ></script>
<script <script

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

@ -87,15 +87,14 @@
.car-point { .car-point {
cursor: pointer; cursor: pointer;
width: 220px; width: 210px;
height: 100px; height: 100px;
background: url("../images/car.png"); background: url("../images/car.png");
background-size: 100% 100%; background-size: 100% 100%;
div { .car-name {
position: relative; position: relative;
top: 2px; top: 2px;
width: 100%;
padding-left: 30px; padding-left: 30px;
padding-right: 10px; padding-right: 10px;
font-size: 14px; font-size: 14px;
@ -105,3 +104,47 @@
text-overflow: ellipsis; /* 显示省略号 */ text-overflow: ellipsis; /* 显示省略号 */
} }
} }
.video-dialog {
background-color: transparent;
width: 833px;
height: 482px;
.el-dialog__header {
padding: 0;
}
.el-dialog__body {
height: 100%;
padding: 15px 10px;
background: url("../images/dialog.jpg");
background-size: 100% 100%;
}
.el-dialog__headerbtn {
display: none;
}
}
//
.carPopup {
.mars3d-popup-tip-container {
display: none;
}
.mars3d-popup-content {
margin: 0;
& > div:first-child {
height: 0 !important;
}
.mars3d-template-content {
margin-top: 0;
& > div:first-child {
margin: 0;
}
}
}
.diy-popup {
height: 430px;
width: 260px;
background: url("../images/diy-popup.png");
background-size: 100% 100%;
}
}

@ -66,19 +66,30 @@
margin-left: 20px; margin-left: 20px;
} }
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { .h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: inherit; font-family: inherit;
font-weight: 500; font-weight: 500;
line-height: 1.1; line-height: 1.1;
color: inherit; color: inherit;
} }
.el-message-box__status + .el-message-box__message{ .el-message-box__status + .el-message-box__message {
word-break: break-word; word-break: break-word;
} }
.el-dialog:not(.is-fullscreen) { .el-dialog:not(.is-fullscreen) {
margin-top: 6vh !important; margin-top: 18vh !important;
} }
.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body { .el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body {
@ -89,7 +100,8 @@
} }
.el-table { .el-table {
.el-table__header-wrapper, .el-table__fixed-header-wrapper { .el-table__header-wrapper,
.el-table__fixed-header-wrapper {
th { th {
word-break: break-word; word-break: break-word;
background-color: #f8f8f9; background-color: #f8f8f9;
@ -112,7 +124,7 @@
color: #6379bb; color: #6379bb;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
margin: 8px 10px 25px 10px; margin: 8px 10px 25px 10px;
padding-bottom: 5px padding-bottom: 5px;
} }
/** 表格布局 **/ /** 表格布局 **/
@ -128,7 +140,7 @@
.tree-border { .tree-border {
margin-top: 5px; margin-top: 5px;
border: 1px solid #e5e6e7; border: 1px solid #e5e6e7;
background: #FFFFFF none; background: #ffffff none;
border-radius: 4px; border-radius: 4px;
} }
@ -153,12 +165,14 @@
} }
/** 表格更多操作下拉样式 */ /** 表格更多操作下拉样式 */
.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine { .el-table .el-dropdown-link,
.el-table .el-dropdown-selfdefine {
cursor: pointer; cursor: pointer;
margin-left: 5px; margin-left: 5px;
} }
.el-table .el-dropdown, .el-icon-arrow-down { .el-table .el-dropdown,
.el-icon-arrow-down {
font-size: 12px; font-size: 12px;
} }
@ -209,22 +223,22 @@
/* button color */ /* button color */
.el-button--cyan.is-active, .el-button--cyan.is-active,
.el-button--cyan:active { .el-button--cyan:active {
background: #20B2AA; background: #20b2aa;
border-color: #20B2AA; border-color: #20b2aa;
color: #FFFFFF; color: #ffffff;
} }
.el-button--cyan:focus, .el-button--cyan:focus,
.el-button--cyan:hover { .el-button--cyan:hover {
background: #48D1CC; background: #48d1cc;
border-color: #48D1CC; border-color: #48d1cc;
color: #FFFFFF; color: #ffffff;
} }
.el-button--cyan { .el-button--cyan {
background-color: #20B2AA; background-color: #20b2aa;
border-color: #20B2AA; border-color: #20b2aa;
color: #FFFFFF; color: #ffffff;
} }
/* text color */ /* text color */
@ -280,7 +294,7 @@
/* 拖拽列样式 */ /* 拖拽列样式 */
.sortable-ghost { .sortable-ghost {
opacity: .8; opacity: 0.8;
color: #fff !important; color: #fff !important;
background: #42b983 !important; background: #42b983 !important;
} }

@ -0,0 +1,190 @@
<template>
<div class="container">
<div class="carousel">
<div @click="scroll(-1)" class="scroll-btn left">
<i class="el-icon-arrow-left"></i>
</div>
<div class="items-wrapper" ref="itemsWrapper">
<div v-for="(item, index) in items" :key="index" class="item">
<img src="" class="video-src" alt="" />
<div class="video-data">
<div class="video-name">视频名称</div>
<img
@click="dialogVisible = true"
class="video-icon"
src="../assets/images/zoom.png"
alt=""
/>
</div>
</div>
</div>
<div @click="scroll(1)" class="scroll-btn right">
<i class="el-icon-arrow-right"></i>
</div>
</div>
<el-dialog
custom-class="video-dialog"
:visible.sync="dialogVisible"
append-to-body
:modal="false"
>
<div class="video-dialog-top">
<div class="video-name-data">001号线_01_早送_守押001_苏E</div>
<div class="dialog-close" @click="dialogVisible = false">
<img src="../assets/images/dialog-close.png" alt="" />
收起
</div>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
dialogVisible: false,
items: [
"Item 1",
"Item 2",
"Item 3",
"Item 4",
"Item 5",
"Item 6",
"Item 7",
"Item 8",
"Item 9",
"Item 10",
],
};
},
methods: {
scroll(direction) {
const itemsWrapper = this.$refs.itemsWrapper;
if (itemsWrapper) {
const scrollAmount = itemsWrapper.clientWidth / 5; //
itemsWrapper.scrollLeft += direction * scrollAmount;
}
},
},
};
</script>
<style lang="scss" scoped>
.container {
overflow: hidden;
}
.carousel {
display: flex;
align-items: center;
position: relative;
overflow: hidden;
}
.scroll-btn {
position: absolute;
top: 50%;
z-index: 10;
transform: translateY(-50%);
background-color: #fff;
font-size: 14px;
opacity: 0.3;
border: none;
outline: none;
cursor: pointer;
padding: 9px 4px;
}
.scroll-btn:hover {
opacity: 0.5;
}
.left {
left: 0;
}
.right {
right: 0;
}
.items-wrapper {
width: 800px;
display: flex;
overflow: hidden;
scroll-behavior: smooth; /* 可以平滑滚动 */
}
.item {
position: relative;
flex: 0 0 calc(100% / 6); /* 每行显示5个格子 */
height: 140px;
margin-right: 10px;
.video-src {
display: block;
height: 100%;
width: 100%;
}
.video-data {
position: absolute;
bottom: 0;
height: 32px;
width: 100%;
background: rgba(0, 52, 101, 0.9);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10px;
.video-name {
font-size: 14px;
color: #ffffff;
}
.video-icon {
cursor: pointer;
height: 14px;
width: 14px;
transition: transform 0.3s ease;
}
.video-icon:hover {
transform: scale(1.2);
}
}
}
/* CSS */
.items-wrapper {
// overflow-y: scroll; /* */
scrollbar-width: thin; /* 滚动条宽度,可以是 auto, thin 或 none */
}
/* Webkit浏览器特有样式 */
.video-dialog-top {
height: 40px;
background: rgba(0, 52, 101, 0.9);
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
padding: 0 10px;
.video-name-data {
font-size: 16px;
color: #ffffff;
}
.dialog-close {
font-size: 14px;
color: #fff;
display: flex;
align-items: center;
img {
margin-right: 6px;
display: inline-block;
height: 14px;
width: 14px;
}
}
}
</style>

@ -14,6 +14,7 @@ const whiteList = [
"/AboutView", "/AboutView",
"/HomeView", "/HomeView",
"/car", "/car",
"/carInfo",
"/nationwide", "/nationwide",
]; ];

@ -98,6 +98,12 @@ export const constantRoutes = [
name: "car", name: "car",
meta: { title: "车辆 ", icon: "dashboard", affix: true }, meta: { title: "车辆 ", icon: "dashboard", affix: true },
}, },
{
path: "/carInfo",
component: () => import("@/views/carInfo"),
name: "carInfo",
meta: { title: "车辆详情 ", icon: "dashboard", affix: true },
},
{ {
path: "/nationwide", path: "/nationwide",
component: () => import("@/views/nationwide"), component: () => import("@/views/nationwide"),

@ -33,11 +33,15 @@
{{ item }} {{ item }}
</div> </div>
</div> </div>
<!-- <div class="video-list" v-show="showVideo">
<grids></grids>
</div> -->
</div> </div>
</template> </template>
<script> <script>
import MarsMap from "@/components/mars-map"; import MarsMap from "@/components/mars-map";
// import grids from "@/components/grids.vue";
export default { export default {
data() { data() {
const basePathUrl = window.basePathUrl || ""; const basePathUrl = window.basePathUrl || "";
@ -73,6 +77,7 @@ export default {
], ],
}, },
show: false, show: false,
showVideo: true,
}; };
}, },
components: { MarsMap }, components: { MarsMap },
@ -107,10 +112,21 @@ export default {
}, },
mapLoad(map) { mapLoad(map) {
let _this = this;
this.map = map; this.map = map;
map.on(mars3d.EventType.click, function (event) {
if (!event.graphic) {
_this.graphicLayer.eachGraphic((graphic) => {
if (graphic.attr.highlight) {
_this.updateBg(graphic.attr.id, "car");
}
});
}
});
this.graphicLayer = new mars3d.layer.GraphicLayer(); this.graphicLayer = new mars3d.layer.GraphicLayer();
map.addLayer(this.graphicLayer); map.addLayer(this.graphicLayer);
this.initTilesetLayer(); this.initTilesetLayer();
if (process.env.NODE_ENV === "production") this.initTilesetLayer(); if (process.env.NODE_ENV === "production") this.initTilesetLayer();
}, },
@ -121,29 +137,55 @@ export default {
let _this = this; let _this = this;
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
const graphic = new mars3d.graphic.DivGraphic({ const graphic = new mars3d.graphic.DivGraphic({
id: "car" + i,
viewFrom: new Cesium.Cartesian3(-500, -500),
style: { style: {
html: `<div class="car-point"> html: `<div class="car${i} car-point">
<div>001号线_01_早送_守押001_苏E</div> <div class="car-name">001号线_01_早送_守押001_苏E</div>
</div>`, </div>`,
horizontalOrigin: Cesium.HorizontalOrigin.CENTER, color: "#fff",
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
// scaleByDistance: new Cesium.NearFarScalar(10000, 1.0, 500000, 0.1), distanceDisplayCondition: true,
clampToGround: true,
scaleByDistance: true, },
attr: {
index: i,
id: "car" + i,
}, },
attr: { index: i, remark: "Billboard示例" },
}); });
graphic.on(mars3d.EventType.click, function (event) {
_this.updateBg(event.target._id, "car-active");
event.target.options.attr = {
...event.target.options.attr,
...{ highlight: true },
};
_this.$router.push("/carInfo");
});
this.graphicLayer.addGraphic(graphic); this.graphicLayer.addGraphic(graphic);
} }
this.changePosition(0); this.changePosition(0);
// setInterval // setInterval
const interval = 30; // const interval = 30;
this.changePosition(interval); // this.changePosition(interval);
setInterval(() => { // setInterval(() => {
_this.changePosition(interval); // _this.changePosition(interval);
}, interval * 1000); // }, interval * 1000);
},
updateBg(id, imageName) {
const className = document.getElementsByClassName(id)[0];
className.style.background = `url( ${require(`@/assets/images/${imageName}.png`)})`;
className.style.backgroundSize = "100% 100%";
if (imageName == "car-active") {
className.style.transform = "scale(1.2)";
} else {
className.style.transform = "";
}
}, },
// //
@ -171,6 +213,8 @@ export default {
*/ */
initTilesetLayer() { initTilesetLayer() {
let _this = this; let _this = this;
this.createCar();
return;
// ; // ;
const tiles3dLayer = new mars3d.layer.TilesetLayer({ const tiles3dLayer = new mars3d.layer.TilesetLayer({
name: "姑苏区建筑物", name: "姑苏区建筑物",
@ -257,6 +301,19 @@ export default {
} }
} }
} }
.video-list {
position: absolute;
bottom: 25px;
left: 50%;
transform: translateX(-50%);
z-index: 50;
padding: 10px;
display: flex;
align-items: center;
border: 1px solid #415367;
border-radius: 10px;
background: rgba(28, 31, 34, 0.6);
}
.multiple { .multiple {
position: absolute; position: absolute;
bottom: 0; bottom: 0;

@ -0,0 +1,312 @@
<template>
<div class="map-container">
<div class="container-top">
<div class="next-stand">
<img src="../assets/images/next.png" alt="" />
<span>10.8</span>
</div>
<div class="real-time">
<img src="../assets/images/realTime.png" alt="" />
<span>5.1</span>
</div>
</div>
<mars-map @mapLoad="mapLoad" :options="options"></mars-map>
<div class="video-list">
<grids></grids>
</div>
</div>
</template>
<script>
import MarsMap from "@/components/mars-map";
import grids from "@/components/grids.vue";
import { html } from "js-beautify";
export default {
data() {
const basePathUrl = window.basePathUrl || "";
return {
graphicLayer: null,
baseUrl: basePathUrl + "lib/geoJson/tileset.json",
map: null,
options: {
scene: {
center: {
lat: 31.212805,
lng: 120.607156,
alt: 5096.4,
heading: 357.9,
pitch: -31.5,
},
},
basemaps: [
{
name: "mapbox影像图",
icon: "img/basemaps/mapboxSatellite.png",
type: "mapbox",
username: "sharealex",
styleId: "cly5i21fn00e901prgq643t4r",
token:
"pk.eyJ1Ijoic2hhcmVhbGV4IiwiYSI6ImNsaXNhZmRjbTFhbnczZmxib3h1OW05YXYifQ.PhlKv60ar3K359d8x2yBPw",
tilesize: 256,
scaleFactor: false,
show: true,
},
],
},
};
},
components: { MarsMap, grids },
beforeDestroy() {},
mounted() {},
methods: {
mapLoad(map) {
let _this = this;
this.map = map;
this.graphicLayer = new mars3d.layer.GraphicLayer();
map.addLayer(this.graphicLayer);
this.initTilesetLayer();
},
/**
* 生成车辆实时点位
*/
createCar() {
let _this = this;
for (let i = 0; i < 1; i++) {
const graphic = new mars3d.graphic.DivGraphic({
id: "car" + i,
position: [120.616912, 31.288775],
style: {
html: `<div class="car${i} car-point" style="background:url( ${require(`@/assets/images/car-active.png`)});background-size: 100% 100%;transform:scale(1.3)">
<div class="car-name">001号线_01_早送_守押001_苏E</div>
</div>`,
color: "#fff",
horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
distanceDisplayCondition: false,
clampToGround: true,
offsetX: -105,
},
attr: {
index: i,
id: "car" + i,
},
popup: [
{
type: "html",
html: `<div class="diy-popup">弹窗</div>`,
},
],
popupOptions: {
className: "carPopup",
offsetX: 300,
offsetY: -50,
closeButton: false,
},
});
graphic.openPopup();
// graphic.on(mars3d.EventType.click, function (event) {
// _this.updateBg(event.target._id, "car-active");
// event.target.options.attr = {
// ...event.target.options.attr,
// ...{ highlight: true },
// };
// });
this.graphicLayer.addGraphic(graphic);
}
const circleGraphic = new mars3d.graphic.CircleEntity({
id: `circle1`,
position: new mars3d.LngLatPoint(120.616912, 31.288775),
style: {
radius: 150,
materialType: mars3d.MaterialType.CircleWave,
materialOptions: {
color: "#FAAC51",
count: 2,
speed: 10,
},
},
});
this.graphicLayer.addGraphic(circleGraphic);
this.map.flyToPoint([120.616912, 31.288775], {
radius: 798.9,
heading: 357.9,
pitch: -31.6,
});
// this.changePosition(0);
// setInterval
// const interval = 30;
// this.changePosition(interval);
// setInterval(() => {
// _this.changePosition(interval);
// }, interval * 1000);
},
updateBg(id, imageName) {
const className = document.getElementsByClassName(id)[0];
className.style.background = `url( ${require(`@/assets/images/${imageName}.png`)})`;
className.style.backgroundSize = "100% 100%";
if (imageName == "car-active") {
className.style.transform = "scale(1.2)";
} else {
className.style.transform = "";
}
},
//
changePosition(time) {
let _this = this;
this.graphicLayer.eachGraphic((graphic) => {
if (graphic.isPrivate) {
return;
}
graphic.addDynamicPosition(_this.randomPoint(), time); // time
});
},
//
randomPoint() {
const jd = this.random(120.5265 * 1000, 120.7177 * 1000) / 1000;
const wd = this.random(31.2783 * 1000, 31.4647 * 1000) / 1000;
return Cesium.Cartesian3.fromDegrees(jd, wd);
},
random(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
},
/**
* 加载姑苏区三维图层
*/
initTilesetLayer() {
let _this = this;
// ;
let tiles3dLayer = new mars3d.layer.TilesetLayer({
name: "姑苏区建筑物",
url: this.baseUrl,
maximumScreenSpaceError: 1,
style: {
color: {
conditions: [["true", `color("rgba(42, 160, 224, 1)")`]],
},
},
});
this.map.addLayer(tiles3dLayer);
tiles3dLayer.on(mars3d.EventType.load, function (event) {
_this.createCar();
});
},
chkShadows(val) {
let _this = this;
this.map.viewer.shadows = val;
if (val) {
setTimeout(function () {
// 沿
_this.map.scene.shadowMap._lightCamera = _this.map.scene.camera;
}, 1500);
}
},
},
};
</script>
<style lang="scss" scoped>
.container-top {
position: absolute;
top: 23px;
left: 50%;
transform: translateX(-50%);
z-index: 50;
display: flex;
align-items: center;
justify-content: center;
.next-stand {
margin-right: 40px;
}
& > div {
width: 200px;
img {
height: 38px;
width: 100%;
display: block;
margin-bottom: 10px;
}
span {
display: block;
font-size: 40px;
color: #ffffff;
line-height: 51px;
letter-spacing: 1px;
text-align: center;
font-style: normal;
background: linear-gradient(270deg, #00e5ff 0%, #d8d8d8 100%);
/* 将背景限制在文字区域内 */
-webkit-background-clip: text;
background-clip: text;
/* 设置文字颜色,会被背景图像遮住 */
color: transparent;
font-family: "DIN-Regular-2";
}
}
}
.video-list {
position: absolute;
bottom: 25px;
left: 50%;
transform: translateX(-50%);
z-index: 50;
padding: 10px;
display: flex;
align-items: center;
border: 1px solid #415367;
border-radius: 10px;
background: rgba(28, 31, 34, 0.6);
}
.multiple {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
z-index: 50;
width: 880px;
height: 80px;
display: flex;
align-items: center;
justify-content: space-between;
background: url("../assets/images/multipleList.png");
background-size: 100% 100%;
padding: 0 230px;
.checkbox {
cursor: pointer;
width: 112px;
height: 32px;
line-height: 32px;
text-align: center;
font-size: 14px;
color: #ffffff;
background: linear-gradient(180deg, #072853 0%, #0079ff 100%);
// border-radius: 16px;
border: 1px solid #0084ff;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
}
.checked {
background: #fd873f;
color: #612500;
border: 0;
font-weight: bold;
border: 1px solid #f7c75d;
}
.btn-icon {
width: 15px;
height: 16px;
margin-right: 10px;
}
}
</style>
Loading…
Cancel
Save