iot定位设备地图弹框页面完善

This commit is contained in:
BianLzhaoMin 2024-08-06 14:23:32 +08:00
parent 01e5924e0e
commit 0be2776cf6
3 changed files with 134 additions and 161 deletions

View File

@ -202,6 +202,12 @@
color: #FFF;
opacity: 0.5;
}
/** 去除百度地图的水印和logo */
.BMap_cpyCtrl,
.anchorBL {
display: none;
}
</style>
</head>

View File

@ -7,10 +7,18 @@
width="90%"
@close="handelCloseDialog()"
>
<!-- 表单 根据日期查询设备轨迹 -->
<el-card shadow="hover">
<el-form :model="queryForm" inline>
<el-form-item label="查询日期">
<div class="device-title">
<h2>{{ deviceName }}</h2>
<span>({{ deviceType }})</span>
</div>
<div class="equipment">
定位设备编号: {{ equipmentNumber }}
</div>
<div class="equipment" v-if="false">{{ engineering }}工程</div>
<el-row :gutter="24">
<el-col :span="8">
<el-date-picker
v-model="queryForm.date"
type="daterange"
@ -20,107 +28,24 @@
style="width: 330px"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
></el-date-picker>
</el-form-item>
<el-form-item>
/>
<el-button
type="primary"
size="small"
@click="handleQuery"
>轨迹查询</el-button
style="padding: 8px 16px; margin-left: 5px"
>查询</el-button
>
</el-form-item>
</el-form>
<div>
<h2>{{ equipment }}</h2>
<div class="equipment"
>定位设备编号: {{ equipmentNumber }}</div
>
<div class="equipment">{{ engineering }}工程</div>
</div>
</el-col>
</el-row>
</el-card>
<el-row :gutter="24" class="map-container">
<el-col :span="6">
<el-tabs type="border-card" class="map-left">
<el-tab-pane label="行程">
<div class="trip-container">
<div class="left-num">1</div>
<div class="right-info">
<ul>
<li>0KM</li>
<li>22</li>
<li>5KM/h</li>
<li>0KM/h</li>
</ul>
<ul>
<li>里程</li>
<li>行驶时长</li>
<li>最大速度</li>
<li>平均速度</li>
</ul>
<div style="margin-top: 10px">
<div class="time-container">
<span class="radius-span"></span>
<span>2024-07-18 01:18:53</span>
</div>
<h3>安徽省------</h3>
</div>
<div style="margin-top: 10px">
<div class="time-container">
<span
class="radius-span"
style="
background-color: #e6a23c;
"
></span
>
<span>2024-07-18 01:18:53</span>
</div>
<h3>安徽省------</h3>
</div>
</div>
</div>
<div class="trip-container">
<div class="left-num">1</div>
<div class="right-info">
<ul>
<li>0KM</li>
<li>22</li>
<li>5KM/h</li>
<li>0KM/h</li>
</ul>
<ul>
<li>里程</li>
<li>行驶时长</li>
<li>最大速度</li>
<li>平均速度</li>
</ul>
<div style="margin-top: 10px">
<div class="time-container">
<span class="radius-span"></span>
<span>2024-07-18 01:18:53</span>
</div>
<h3>安徽省------</h3>
</div>
<div style="margin-top: 10px">
<div class="time-container">
<span
class="radius-span"
style="
background-color: #e6a23c;
"
></span
>
<span>2024-07-18 01:18:53</span>
</div>
<h3>安徽省------</h3>
</div>
</div>
</div>
<div class="trip-container">
<div
class="trip-container"
@click="handlePreviewTrip()"
>
<div class="left-num">1</div>
<div class="right-info">
<ul>
@ -169,14 +94,22 @@
<h3>安徽省------</h3>
</div>
</el-tab-pane>
<el-tab-pane label="报警">报警</el-tab-pane>
<el-tab-pane label="报警">
<div class="point-container">
<div class="time-container">
<span class="radius-span">1</span>
<span>2024-07-18 01:18:53</span>
</div>
<h3>手动触发紧急报警---------</h3>
</div>
</el-tab-pane>
</el-tabs>
</el-col>
<el-col :span="18">
<!-- 地图 -->
<div
id="container"
style="height: 500px; background-color: #bfc"
style="height: 550px; background-color: #bfc"
></div>
</el-col>
</el-row>
@ -187,12 +120,18 @@
<script>
export default {
name: 'MapDialog',
// props: {
// mapDialogVisible: {
// type: Boolean,
// default: () => false,
// },
// },
props: {
//
deviceName: {
type: String,
default: () => '',
},
//
deviceType: {
type: String,
default: () => '',
},
},
data() {
return {
dialogVisible: true,
@ -254,8 +193,31 @@ export default {
},
methods: {
load() {
this.count += 2
/** 查看行程 */
handlePreviewTrip() {
let pointList = []
if (this.linePointList.length === 0) return
for (var i = 0; i < this.linePointList.length; i++) {
pointList.push(
new BMapGL.Point(
this.linePointList[i].lng,
this.linePointList[i].lat,
),
)
}
let polyline = new BMapGL.Polyline(pointList)
// 线
polyline.setStrokeColor('#EA3323') // 线 #EA3323
// polyline.setStrokeWeight(2) // 线
let trackAni = new BMapGLLib.TrackAnimation(this.map, polyline, {
overallView: true, //
tilt: 30, // 55
duration: 5000, // 10000ms
delay: 2000, // 0ms
})
trackAni.start()
//
this.triggerMovement()
},
async handleQuery() {
console.log('🚀 ~ handleQuery ~ 查询:', this.queryForm.date)
@ -272,10 +234,6 @@ export default {
this.openMap = val
this.initMap()
},
close() {
// this.openMap = false
// this.$emit('getList')
},
//
getEquipmentInfo(params = {}) {
console.log('🚀 ~ getEquipmentInfo ~ 获取装备信息', params)
@ -295,37 +253,8 @@ export default {
this.map.enableScrollWheelZoom(true) //
this.map.setHeading(64.5) //
this.map.setTilt(73) //
//
// let pointList = []
// if (this.linePointList.length === 0) return
// for (var i = 0; i < this.linePointList.length; i++) {
// pointList.push(
// new BMapGL.Point(
// this.linePointList[i].lng,
// this.linePointList[i].lat,
// ),
// )
// }
// let polyline = new BMapGL.Polyline(pointList)
// // 线
// polyline.setStrokeColor('#EA3323') // 线 #EA3323
// // polyline.setStrokeWeight(2) // 线
// let trackAni = new BMapGLLib.TrackAnimation(
// this.map,
// polyline,
// {
// overallView: true, //
// tilt: 30, // 55
// duration: 5000, // 10000ms
// delay: 2000, // 0ms
// },
// )
// trackAni.start()
// //
// this.triggerMovement()
let marker = new BMapGL.Marker(point) //
this.map.addOverlay(marker)
})
},
//
@ -371,17 +300,31 @@ export default {
</script>
<style lang="scss" scoped>
.device-title {
display: flex;
h2 {
padding: 0;
margin: 0;
font-weight: bold;
}
span {
padding: 4px 0 0 6px;
color: rgb(9, 193, 9);
}
}
.equipment {
margin: 8px 0;
font-weight: 600;
font-size: 15px;
margin-top: 10px;
}
.map-container {
margin-top: 8px;
.map-left {
height: 500px;
height: 550px;
}
}
::v-deep .el-tabs__nav {
@ -401,13 +344,18 @@ export default {
::v-deep .el-tabs--border-card > .el-tabs__content {
padding: 0;
height: 460px;
height: 510px;
overflow: auto;
}
::v-deep .el-dialog__body {
padding: 5px 20px;
}
.trip-container {
display: flex;
margin-bottom: 3px;
cursor: pointer;
border-bottom: 1px solid #ccc;
.left-num {
width: 16px;
display: flex;
@ -419,7 +367,6 @@ export default {
.right-info {
flex: 1;
padding: 8px;
background-color: #e8eaed;
ul {
padding: 0;
margin: 0;
@ -443,15 +390,10 @@ export default {
line-height: 20px;
}
}
}
.radius-span {
margin-right: 3px;
width: 20px;
text-align: center;
border-radius: 15px;
background-color: #409eff;
color: #fff;
}
.active {
background-color: #e8eaed;
}
}
@ -462,7 +404,35 @@ h3 {
color: #000;
}
.radius-span {
margin-right: 3px;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
border-radius: 15px;
background-color: #409eff;
color: #fff;
}
.point-container {
margin: 2px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 3px;
.time-container {
display: flex;
justify-content: space-between;
align-items: center;
}
.time-container span:nth-child(2) {
flex: 1;
margin-left: 5px;
}
h3 {
padding-left: 0;
}
}
</style>

View File

@ -535,7 +535,8 @@
</el-dialog>
<MapDialog
v-if="mapDialogVisible"
ref="mapDialog"
:deviceName="deviceName"
:deviceType="deviceType"
@handelCloseDialog="handelCloseDialog"
/>
</div>
@ -644,6 +645,8 @@ export default {
//
mapDialogVisible: false,
deviceName: '',
deviceType: '',
}
},
created() {
@ -845,15 +848,9 @@ export default {
},
//
handleMap(row) {
console.log('~ handleMap ~ 地图', row)
const params = {
deviceType: row.deviceType,
}
//
// this.$refs.mapDialog.openMapDialog(true)
this.deviceName = row.specificationType
this.deviceType = row.maStatusName
this.mapDialogVisible = true
// this.$refs.mapDialog.getEquipmentInfo(params)
},
handlePush() {
this.$modal