Files
xzlz_GjWeb/src/views/home/layout/streetInfo.vue

354 lines
7.9 KiB
Vue
Raw Normal View History

2025-07-23 17:45:51 +08:00
<template>
2025-07-23 19:15:31 +08:00
<div class="dialogBox" :style="`left:${elLeft}px;top:${elTop}px`" draggable="true" ref="dialogBoxYpfx"
@dragstart="dragstart($event)" @dragend="dragend($event)">
2025-07-23 17:45:51 +08:00
<div class="title">
2025-07-23 19:15:31 +08:00
<span class="mc">{{ props.data.cph }}</span>
2025-07-23 17:45:51 +08:00
<span @click="close" class="close">
2025-07-23 19:15:31 +08:00
<el-icon>
<Close />
</el-icon>
2025-07-23 17:45:51 +08:00
</span>
</div>
<div class="info-Big-Box noScollLine">
2025-07-23 19:15:31 +08:00
<div class="card">
<div class="card-cnt">
<div class="leftImg">
<el-image style="width: 100%" :src="props.data.image" :hide-on-click-modal="true" close-on-press-escape
fit="cover" lazy>
</el-image>
</div>
<div class="rightInfo">
<div>
<span class="zjhm">驾驶员</span>{{ props.data.cljsy }}
</div>
<div>
<span class="zjhm">车牌号</span>{{ props.data.cph }}
</div>
<div>
<span class="zjhm">行驶路线</span>{{ props.data.xlmc }}
</div>
<div>
<span class="zjhm">乘车人数</span>{{ props.data.ccrs ? props.data.ccrs : 0 }}
</div>
<div>
<span class="zjhm">重点人员</span>{{ props.data.zdrs ? props.data.zdrs : 0 }}
</div>
<div>
<span class="zjhm">途中乘车人数</span>{{ props.data.ztscrs ? props.data.ztscrs : 0 }}
</div>
</div>
2025-07-23 17:45:51 +08:00
</div>
2025-07-23 19:15:31 +08:00
<div class="address">
<img class="addImg" src="@/assets/images/dingwei.png" />
<span>{{ props.data.xlmc }}</span>
2025-07-23 17:45:51 +08:00
</div>
2025-07-23 19:15:31 +08:00
</div>
2025-07-23 17:45:51 +08:00
2025-07-23 19:15:31 +08:00
</div>
2025-07-23 17:45:51 +08:00
2025-07-23 19:15:31 +08:00
<!-- 视频播放区域 -->
<div v-if="showVideo" class="video-container">
<video ref="videoPlayer" class="video-player" controls autoplay muted :src="videoSrc">
您的浏览器不支持视频播放
</video>
2025-07-23 17:45:51 +08:00
</div>
2025-07-23 19:15:31 +08:00
2025-07-23 17:45:51 +08:00
<el-popover placement="bottom" :visible="visible" :width="476" :append-to-body="false">
2025-07-23 19:15:31 +08:00
<template #reference>
<div class="btnBox">
<button class="dp-default small" @click="onClickclgj">车辆轨迹</button>
<button class="dp-default small" @click="onClickSpsd">{{showVideo.value?"关闭视频":"视频播放"}}</button>
</div>
</template>
2025-07-23 17:45:51 +08:00
</el-popover>
</div>
</template>
<script setup>
import Axios from "axios";
2025-07-23 19:15:31 +08:00
import { qcckPost, qcckGet } from "@/api/qcckApi.js";
2025-07-23 17:45:51 +08:00
import { ref, onMounted, onUnmounted, defineProps, getCurrentInstance, watch } from "vue";
import { timeValidate } from "@/utils/time.js";
import emitter from "@/utils/eventBus.js";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
import { all } from "ol/events/condition";
const { proxy } = getCurrentInstance();
const props = defineProps({
data: {
type: Object,
default: {}
}
});
const visible = ref(false);
const dialogBoxYpfx = ref();
2025-07-23 19:15:31 +08:00
const videoPlayer = ref();
const showVideo = ref(false);
const videoSrc = ref('');
2025-07-23 17:45:51 +08:00
const initWidth = ref(0); //父元素宽度
const initHeight = ref(0); //父元素高度
const startClientX = ref(0); //元素拖拽前距离浏览器X轴位置
const startClientY = ref(0); //元素拖拽前距离浏览器Y轴位置
const elLeft = ref(400); //元素左偏移量
const elTop = ref(120); //元素右偏移量
watch(
() => props.data,
(val) => {
2025-07-23 19:15:31 +08:00
console.log(val, 'val');
2025-07-23 17:45:51 +08:00
visible.value = false;
2025-07-23 19:15:31 +08:00
}, {
immediate: true,
deep: true
}
2025-07-23 17:45:51 +08:00
);
onMounted(() => {
initBodySize();
});
2025-07-23 19:15:31 +08:00
const onClickSpsd = () => {
if (showVideo.value) {
videoPlayer.value.pause();
videoPlayer.value.currentTime = 0;
} else {
videoSrc.value = props.data.videoUrl || '/static/sample.mp4';
}
showVideo.value = !showVideo.value
};
2025-07-23 17:45:51 +08:00
2025-07-23 19:15:31 +08:00
const onClickclgj = () => {
let row = props.data.zb
if (row && row.length > 0) {
emitter.emit("setMapCenter", {
location: [row[0][0], row[0][1]],
zoomLevel: 12
});
emitter.emit("drawLineAnimation", {
type: "solid",
coords: row,
isclear: true,
flag: "lx"
});
}
}
2025-07-23 17:45:51 +08:00
//初始化
const initBodySize = () => {
initWidth.value = dialogBoxYpfx.value.clientWidth;
initHeight.value = dialogBoxYpfx.value.clientHeight;
};
//拖拽开始
const dragstart = (e) => {
startClientX.value = e.clientX;
startClientY.value = e.clientY;
};
//拖拽结束
const dragend = (e) => {
let x = e.clientX - startClientX.value;
let y = e.clientY - startClientY.value;
elLeft.value += x;
elTop.value += y;
};
//关闭弹窗
function close() {
visible.value = false;
2025-07-23 19:15:31 +08:00
emitter.emit("showJzInfo", false);
emitter.emit("deletePointArea", "lx");
2025-07-23 17:45:51 +08:00
}
</script>
<style lang="scss" scoped>
@import "@/assets/css/homeScreen.scss";
2025-07-23 19:15:31 +08:00
2025-07-23 17:45:51 +08:00
.dialogBox {
position: absolute;
padding: 0;
width: 484px !important;
2025-07-23 19:15:31 +08:00
.video-container {
margin: 10px auto;
border-radius: 4px;
overflow: hidden;
text-align: center; // 容器居中对齐
.video-player {
width: 100%;
max-width: 400px; // 设置最大宽度
height: 200px;
display: block;
margin: 0 auto; // 水平居中
}
}
2025-07-23 17:45:51 +08:00
.title {
border-bottom: 1px solid #275288;
margin-bottom: 6px;
2025-07-23 19:15:31 +08:00
2025-07-23 17:45:51 +08:00
.mc {
margin-left: 10px;
}
}
2025-07-23 19:15:31 +08:00
2025-07-23 17:45:51 +08:00
.info-Big-Box {
max-height: 70vh;
overflow: hidden;
overflow: auto;
padding: 4px 10px;
box-sizing: border-box;
}
2025-07-23 19:15:31 +08:00
.card {
padding: 10px 10px 4px 10px;
box-sizing: border-box;
border-top: 2px solid #00bfff;
line-height: 20px;
font-size: 14px;
background: #052955;
.card-cnt {
display: flex;
background: rgba(255, 255, 255, 0.05);
margin-bottom: 4px;
.leftImg {
width: 180px;
margin-right: 10px;
}
.rightInfo {
flex: 1;
.title {
width: 100%;
color: #0095FF;
line-height: 28px;
margin-right: 20px;
}
.status {
padding: 1px 6px;
border-radius: 4px;
background: #FF3A3A;
color: #fff;
}
.zjhm {
line-height: 27px;
color: #7CBFFF;
margin-right: 10px;
font-size: 16px;
}
.textflex {
display: flex;
justify-content: space-between;
}
.text {
font-size: 12px;
color: #6585af;
.info {
color: #fff;
}
}
.newinfo {
color: yellow;
}
}
2025-07-23 17:45:51 +08:00
}
2025-07-23 19:15:31 +08:00
.address {
justify-content: space-between;
margin-top: 4px;
padding-top: 6px;
box-sizing: border-box;
border-top: 1px solid #3b3737;
2025-07-23 17:45:51 +08:00
color: #fff;
2025-07-23 19:15:31 +08:00
.addImg {
margin-right: 4px;
vertical-align: text-top;
}
2025-07-23 17:45:51 +08:00
}
2025-07-23 19:15:31 +08:00
.phtos {
height: 110px;
padding-top: 10px;
box-sizing: border-box;
2025-07-23 17:45:51 +08:00
display: flex;
flex-wrap: wrap;
2025-07-23 19:15:31 +08:00
align-items: center;
justify-content: center;
width: 100%;
border-top: 1px dashed #3d3d3d;
margin-top: 6px;
box-sizing: border-box;
::v-deep .el-carousel {
width: 100%;
height: 100%;
.el-carousel__container {
height: 72%;
2025-07-23 17:45:51 +08:00
}
2025-07-23 19:15:31 +08:00
.el-carousel__item {
height: 100%;
display: flex;
justify-content: space-between;
2025-07-23 17:45:51 +08:00
}
}
2025-07-23 19:15:31 +08:00
img {
width: 60px;
height: 70px;
}
2025-07-23 17:45:51 +08:00
}
}
}
2025-07-23 19:15:31 +08:00
.all-dialog .dialogBox>.btnBox {
2025-07-23 17:45:51 +08:00
padding-top: 0;
padding-bottom: 0;
}
2025-07-23 19:15:31 +08:00
.timeBox {
2025-07-23 17:45:51 +08:00
width: 100%;
display: flex;
align-items: center;
2025-07-23 19:15:31 +08:00
.time1 {
2025-07-23 17:45:51 +08:00
margin: 0 10px;
text-align: center;
color: #fff;
}
}
2025-07-23 19:15:31 +08:00
::v-deep .el-collapse {
2025-07-23 17:45:51 +08:00
width: 100%;
2025-07-23 19:15:31 +08:00
--el-collapse-header-height: auto;
--el-collapse-header-bg-color: transparent;
--el-collapse-border-color: transparent;
2025-07-23 17:45:51 +08:00
}
2025-07-23 19:15:31 +08:00
::v-deep .el-collapse-item__header {
2025-07-23 17:45:51 +08:00
color: #00bfff;
}
2025-07-23 19:15:31 +08:00
::v-deep .el-collapse-item__wrap {
background-color: transparent;
2025-07-23 17:45:51 +08:00
}
2025-07-23 19:15:31 +08:00
2025-07-23 17:45:51 +08:00
::v-deep .el-collapse-item__content {
color: #fff;
padding-bottom: 0;
}
2025-07-23 19:15:31 +08:00
.null {
2025-07-23 17:45:51 +08:00
text-align: center;
}
2025-07-23 19:15:31 +08:00
</style>