11
This commit is contained in:
parent
5a634b8ca4
commit
0746100243
|
@ -197,14 +197,17 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async getAreas() {
|
async getAreas() {
|
||||||
if (!this.areaId) return
|
// 如果没有 areaId,直接初始化地图
|
||||||
|
if (!this.areaId) {
|
||||||
|
this.initAMap();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 有 areaId 时获取区域信息
|
||||||
getArea(this.areaId).then(response => {
|
getArea(this.areaId).then(response => {
|
||||||
|
|
||||||
console.log(response, 'responseresponse');
|
console.log(response, 'responseresponse');
|
||||||
this.area = response.data;
|
this.area = response.data;
|
||||||
|
|
||||||
|
|
||||||
listParking({ areaId: this.area.areaId }).then(response => {
|
listParking({ areaId: this.area.areaId }).then(response => {
|
||||||
let list = response.rows;
|
let list = response.rows;
|
||||||
console.log(list, 'listlistlist');
|
console.log(list, 'listlistlist');
|
||||||
|
@ -291,22 +294,28 @@ export default {
|
||||||
this.removeAllMarker()
|
this.removeAllMarker()
|
||||||
if (this.currentLng != null && this.currentLat != null) {
|
if (this.currentLng != null && this.currentLat != null) {
|
||||||
this.updateTrackData()
|
this.updateTrackData()
|
||||||
this.addArea(JSON.parse(this.area.boundaryStr) || []);
|
|
||||||
//停车区
|
// 只有在有区域信息时才添加区域和停车场
|
||||||
this.parkingList.forEach(parking => {
|
if(this.area) {
|
||||||
this.addParking(JSON.parse(parking.boundaryStr) || [], parking.parkingName, parking.longitude, parking.latitude);
|
this.addArea(JSON.parse(this.area.boundaryStr) || []);
|
||||||
this.addMarker2(parking, "https://lxnapi.ccttiot.com/FqcYf6ecsnbC0OT6YYAF5npgu-kh", parking.parkingName, "#1890ff");
|
//停车区
|
||||||
});
|
this.parkingList.forEach(parking => {
|
||||||
//禁停区
|
this.addParking(JSON.parse(parking.boundaryStr) || [], parking.parkingName, parking.longitude, parking.latitude);
|
||||||
this.noParkingList.forEach(noparking => {
|
this.addMarker2(parking, "https://lxnapi.ccttiot.com/FqcYf6ecsnbC0OT6YYAF5npgu-kh", parking.parkingName, "#1890ff");
|
||||||
this.addNoParking(JSON.parse(noparking.boundaryStr) || []);
|
});
|
||||||
this.addMarker2(noparking, "https://lxnapi.ccttiot.com/FjKE5PWbnEnZUq3k-wVIvV4lv8Ab", noparking.parkingName, "#ff4444");
|
//禁停区
|
||||||
});
|
this.noParkingList.forEach(noparking => {
|
||||||
//禁行区
|
this.addNoParking(JSON.parse(noparking.boundaryStr) || []);
|
||||||
this.noridingList.forEach(noriding => {
|
this.addMarker2(noparking, "https://lxnapi.ccttiot.com/FjKE5PWbnEnZUq3k-wVIvV4lv8Ab", noparking.parkingName, "#ff4444");
|
||||||
this.addNoriding(JSON.parse(noriding.boundaryStr) || [], noriding.parkingName, noriding.longitude, noriding.latitude);
|
});
|
||||||
this.addMarker2(noriding, "https://lxnapi.ccttiot.com/FmX1diEPPbFYe1vcUfKp6qbKzzh2", noriding.parkingName, "#ffcc00");
|
//禁行区
|
||||||
});
|
this.noridingList.forEach(noriding => {
|
||||||
|
this.addNoriding(JSON.parse(noriding.boundaryStr) || [], noriding.parkingName, noriding.longitude, noriding.latitude);
|
||||||
|
this.addMarker2(noriding, "https://lxnapi.ccttiot.com/FmX1diEPPbFYe1vcUfKp6qbKzzh2", noriding.parkingName, "#ffcc00");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 无论是否有区域信息都添加设备标记
|
||||||
this.addMarker(this.currentLng, this.currentLat, this.deviceSn, this.deviceInfo.status, this.deviceInfo.onlineStatus)
|
this.addMarker(this.currentLng, this.currentLat, this.deviceSn, this.deviceInfo.status, this.deviceInfo.onlineStatus)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -44,8 +44,8 @@
|
||||||
<div class="info-row">
|
<div class="info-row">
|
||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<span class="label">电门:</span>
|
<span class="label">电门:</span>
|
||||||
<el-tag :type="deviceInfo.powerStatus === '1' ? 'success' : 'danger'" size="small">
|
<el-tag :type="deviceInfo.quality === '1' ? 'success' : 'danger'" size="small">
|
||||||
{{ deviceInfo.powerStatus === '1' ? '开' : '关' }}
|
{{ deviceInfo.quality === '1' ? '开' : '关' }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<!-- <span class="value">{{ deviceInfo.quality || '-' }}</span> -->
|
<!-- <span class="value">{{ deviceInfo.quality || '-' }}</span> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user