fase()实时数据

car_1
王熙朝 2024-06-18 20:54:09 +08:00
parent f1fe1a348a
commit dbf878c819
7 changed files with 425 additions and 5 deletions

View File

@ -51,3 +51,33 @@ export function delCar(carId) {
method: 'delete'
})
}
export function read() {
return request({
url: '/rule/car/read',
method: 'post'
})
}
export function open() {
return request({
// url: 'http://129.211.23.219:9100/manage/open/JAV0VJUJYOTOK9KSY/1',
url: 'rule/car/open',
method: 'post'
})
}
export function close() {
return request({
// url: 'http://129.211.23.219:9100/mange/close/JAV0VJUJYOTOK9KSY/1',
url: 'rule/car/close',
method: 'post'
})
}
// 9100

View File

@ -26,6 +26,7 @@ export function selectFenceGroupsById(carId) {
})
}
// 将坐标传输给电子围栏
export function getSel(data) {
return request({
url: '/rule/map/getSel',
@ -34,3 +35,26 @@ export function getSel(data) {
})
}
//删除电子围栏
export function deleteFence(fenceId) {
return request({
url: '/rule/map/deleteFence/' + fenceId,
method: 'post'
})
}
//查看详情
export function queryFence(fenceId) {
return request({
url: '/rule/map/queryFence/' + fenceId,
method: 'post'
})
}
// 修改围栏状态
export function updateFence(fenceId) {
return request({
url: '/rule/map/updateFence/' + fenceId,
method: 'post'
})
}

View File

@ -156,6 +156,11 @@
<el-button type="text" @click="fence(scope.row.carId)"></el-button>
</span>
</el-table-column>
<el-table-column label="查看实时坐标">
<span slot-scope="scope">
<el-button type="text" @click="realTime(scope.row.vin)"></el-button>
</span>
</el-table-column>
</el-table>
<pagination
@ -283,6 +288,10 @@ export default {
fence(carId) {
this.$router.push({path: '/client/sever/fence',query:{carId:carId}})
},
realTime(vim) {
this.$router.push({path: '/client/sever/random',query:{vim:vim}})
},
/** 查询车辆信息列表 */
getList() {
this.loading = true;

View File

@ -18,9 +18,16 @@
</span>
</el-table-column>
<el-table-column prop="polygonPoints" label="坐标"></el-table-column>
<el-table-column label="删除">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<span slot-scope="scope">
<el-button type="text">删除</el-button>
<span v-if="scope.row.staut === 'Y'">
<el-button type="text" icon="el-icon-edit" @click="query(scope.row.fenceId)"></el-button>
</span>
<span v-if="scope.row.staut === 'N'">
<el-button type="text" icon="el-icon-edit" @click="query(scope.row.fenceId)"></el-button>
</span>
<br>
<el-button size="mini" icon="el-icon-delete" type="text" @click="del(scope.row.fenceId)"></el-button>
</span>
</el-table-column>
</el-table>
@ -28,7 +35,7 @@
</template>
<script>
import {selectFenceGroups, selectFenceGroupsById} from "@/api/goods/map";
import {selectFenceGroupsById, deleteFence, updateFence} from "@/api/goods/map";
// jsjsjson,
// import from ',
export default {
@ -48,15 +55,30 @@ export default {
watch: {},
// ",
methods: {
//
getInfo() {
selectFenceGroupsById(this.carId).then(res => {
this.fenceGroups = res.data
console.log(res.data)
})
},
//
del(fenceId) {
deleteFence(fenceId).then(res => {
this.$message.success(res.data)
this.getInfo()
})
},
//
add(groupsId) {
alert(groupsId)
this.$router.push({path:'/client/sever/map',query:{groupsId:groupsId}})
},
//
query(fenceId) {
updateFence(fenceId).then(res => {
this.$message.success(res.data)
this.getInfo()
})
}
},
// - 访this",

View File

@ -5,6 +5,7 @@
<el-button type="primary" @click="deleRectangle"></el-button>
<el-button type="primary" @click="sel"></el-button>
<div id="amapContainer"></div>
<!-- <div id="container"></div>-->
</div>
</template>
@ -60,7 +61,7 @@ export default {
this.map = new this.AMap.Map("amapContainer", {
center: [116.409753, 39.921925],
zoom: 14,
mapStyle: "amap://styles/darkblue",
// mapStyle: "amap://styles/darkblue",
pitch: 80,
rotation: -15,
viewMode: '3D',//3D,

View File

@ -0,0 +1,218 @@
<template>
<div>
<el-descriptions title="垂直带边框列表" direction="vertical" :column="4" :model="VehicleInfo" border>
<el-descriptions-item label="vin">{{VehicleInfo.vin}}</el-descriptions-item>
<el-descriptions-item label="时间">{{VehicleInfo.time}}</el-descriptions-item>
<el-descriptions-item label="经度">{{VehicleInfo.longitude}}</el-descriptions-item>
<el-descriptions-item label="纬度">{{VehicleInfo.latitude}}</el-descriptions-item>
<el-descriptions-item label="车速">{{VehicleInfo.speed}}</el-descriptions-item>
<el-descriptions-item label="总里程">{{VehicleInfo.totalMileage}}</el-descriptions-item>
<el-descriptions-item label="总电压">{{VehicleInfo.totalVoltage}}</el-descriptions-item>
<el-descriptions-item label="总电流">{{VehicleInfo.totalCurrent}}</el-descriptions-item>
<!-- <el-descriptions-item label="绝缘电阻">{{VehicleInfo.insulationResistance}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="档位">{{VehicleInfo.gears}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="加速踏板行程值">{{VehicleInfo.acceleratorPedal}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="制动踏板行程值">{{VehicleInfo.brakePedal}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="燃料消耗率">{{VehicleInfo.fuelConsumptionRate}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="电机控制器温度">{{VehicleInfo.MotorControllerTemperature}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="电机转速">{{VehicleInfo.motorSpeed}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="电机转矩">{{VehicleInfo.motorTorque}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="电机温度">{{VehicleInfo.motorTemperature}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="电机电压">{{VehicleInfo.motorVoltage}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="电机电流">{{VehicleInfo.motorCurrent}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="动力电池剩余电量SOC">{{VehicleInfo.remainingPower}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="当前状态允许的最大反馈功率">{{VehicleInfo.maximumFeedbackPower}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="当前状态允许最大放电功率">{{VehicleInfo.maximumDischargePower}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="BMS自检计数器">{{VehicleInfo.selfTestCounter}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="动力电池充放电电流">{{VehicleInfo.batteryChargeOrDischargeCurrent}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="动力电池负载端总电压V3">{{VehicleInfo.totalVoltageV3}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="单次最大电压">{{VehicleInfo.maximumVoltage}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="单体电池最低电压">{{VehicleInfo.minimumBatteryVoltage}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="单体电池最高温度">{{VehicleInfo.maximumBatteryTemperature}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="单体电池最低温度">{{VehicleInfo.minimumBatteryTemperature}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="动力电池可用容量">{{VehicleInfo.usableBatteryCapacity}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="车辆状态">{{VehicleInfo.vehicleStatus}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="充电状态">{{VehicleInfo.chargeStatus}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="运行状态">{{VehicleInfo.operationalStatus}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="SOC">{{VehicleInfo.soc}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="可充电储能装置工作状态">{{VehicleInfo.energyStorageDeviceWorkingStatus}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="驱动电机状态">{{VehicleInfo.driveMotorStatus}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="定位是否有效">{{VehicleInfo.positioningIsOrNotEffective}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="EAS">{{VehicleInfo.eas}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="PTC">{{VehicleInfo.ptc}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="EPS">{{VehicleInfo.eps}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="ABS">{{VehicleInfo.abs}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="MCU">{{VehicleInfo.mcu}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="动力电池加热状态">{{VehicleInfo.batteryHeatingStatus}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="动力电池当前状态">{{VehicleInfo.batteryCurrentStatus}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="动力电池保温状态">{{VehicleInfo.batteryInsulationStatus}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="DCDC">{{VehicleInfo.dcdc}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="CHG">{{VehicleInfo.chg}}</el-descriptions-item>-->
<!-- <el-descriptions-item label="校验位">{{VehicleInfo.checkDigit}}</el-descriptions-item>-->
</el-descriptions>
{{vim}}
</div>
</template>
<script>
import { read, open, close } from "@/api/goods/car";
// jsjsjson,
// import from ',
export default {
// import使"
components: {},
props: {},
data() {
// "
return {
VehicleInfo: {
// vin
vin: '',
//
time: '',
//
longitude: '',
//
latitude: '',
//
speed: '',
//
totalMileage: '',
//
totalVoltage: '',
//
totalCurrent: '',
//
insulationResistance: '',
//
gears: '',
//
acceleratorPedal: '',
//
brakePedal: '',
//
fuelConsumptionRate: '',
//
MotorControllerTemperature: '',
//
motorSpeed: '',
//
motorTorque: '',
//
motorTemperature: '',
//
motorVoltage: '',
//
motorCurrent: '',
// SOC
remainingPower: '',
//
maximumFeedbackPower: '',
//
maximumDischargePower: '',
// BMS
selfTestCounter: '',
//
batteryChargeOrDischargeCurrent: '',
// V3
totalVoltageV3: '',
//
maximumVoltage: '',
//
minimumBatteryVoltage: '',
//
maximumBatteryTemperature: '',
//
minimumBatteryTemperature: '',
//
usableBatteryCapacity: '',
//
vehicleStatus: '',
//
chargeStatus: '',
//
operationalStatus: '',
// SOC
soc: '',
//
energyStorageDeviceWorkingStatus: '',
//
driveMotorStatus: '',
//
positioningIsOrNotEffective: '',
// EAS
eas: '',
// PTC
ptc: '',
// EPS
eps: '',
// ABS
abs: '',
// MCU
mcu: '',
//
batteryHeatingStatus: '',
//
batteryCurrentStatus: '',
//
batteryInsulationStatus: '',
// DCDC
dcdc: '',
// CHG
chg: '',
//
checkDigit: '',
},
vim: this.$route.query.vim
}
},
// data",
computed: {},
// data",
watch: {},
// ",
methods: {
open() {
open().then(res =>{
console.log(res)
})
}
},
// - 访this",
created() {
this.open()
this.timer = setInterval(() => {
read().then(res => {
this.VehicleInfo = res.data
})
},2000)
},
// - 访DOM",
mounted() {
},
beforeCreate() {
}, // - ",
beforeMount() {
}, // - ",
beforeUpdate() {
}, // - ",
updated() {
}, // - ",
beforeDestroy() {
if (this.timer) {
close().then(res => {
console.log(res)
})
clearInterval(this.timer)
}
}, // - ",
destroyed() {
}, // - ",
activated() {
} // keep-alive",
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,116 @@
<!--<template>-->
<!-- <div class="container">-->
<!-- <div class="title">实时轨迹</div>-->
<!-- {{vin}}-->
<!-- <div id="map" style="width: 100%; height: 500px;"></div>-->
<!-- <br>-->
<!-- <br>-->
<!-- <div class="title">单体电池最低电压</div>-->
<!-- <div class="value">{{ data.lowestVoltage }}</div>-->
<!-- </div>-->
<!--</template>-->
<!--<script>-->
<!--import { redisList } from "@/api/fence/fence";-->
<!--export default {-->
<!-- data() {-->
<!-- return {-->
<!-- map: null,-->
<!-- polyline: null,-->
<!-- carMarker: null,-->
<!-- vin: this.$route.params.vin,-->
<!-- intervalId: null,-->
<!-- data: {},-->
<!-- lastPosition: null, // -->
<!-- };-->
<!-- },-->
<!-- created() {-->
<!-- this.intervalId = setInterval(this.fetchData, 1000);-->
<!-- this.fetchData();-->
<!-- },-->
<!-- methods: {-->
<!-- fetchData() {-->
<!-- console.log(this.vin);-->
<!-- redisList(this.vin)-->
<!-- .then(res => {-->
<!-- console.log("res:{}", res);-->
<!-- this.data = res.data;-->
<!-- this.updateTrajectory();-->
<!-- })-->
<!-- .catch(err => {-->
<!-- console.error("Error fetching data:", err);-->
<!-- });-->
<!-- },-->
<!-- initMap() {-->
<!-- this.map = new AMap.Map('map', {-->
<!-- center: [116.397428, 39.90923],-->
<!-- zoom: 13,-->
<!-- });-->
<!-- this.polyline = new AMap.Polyline({-->
<!-- map: this.map,-->
<!-- path: [],-->
<!-- strokeColor: "#FF0000",-->
<!-- strokeWeight: 5,-->
<!-- });-->
<!-- const carIcon = new AMap.Icon({-->
<!-- size: new AMap.Size(40, 50),-->
<!-- image: 'https://webapi.amap.com/images/car.png',-->
<!-- imageSize: new AMap.Size(30, 15)-->
<!-- });-->
<!-- this.carMarker = new AMap.Marker({-->
<!-- icon: carIcon,-->
<!-- offset: new AMap.Pixel(-20, -25),-->
<!-- autoRotation: true,-->
<!-- });-->
<!-- this.carMarker.setMap(this.map);-->
<!-- },-->
<!-- updateTrajectory() {-->
<!-- if (this.data.latitude && this.data.longitude) {-->
<!-- const newPoint = [this.data.longitude, this.data.latitude];-->
<!-- const path = this.polyline.getPath();-->
<!-- path.push(newPoint);-->
<!-- this.polyline.setPath(path);-->
<!-- this.map.setCenter(newPoint);-->
<!-- // -->
<!-- if (this.lastPosition) {-->
<!-- const angle = this.calculateAngle(this.lastPosition)-->
<!-- this.calculateAngle(this.lastPosition, newPoint);-->
<!-- this.carMarker.setAngle(angle);-->
<!-- }-->
<!-- this.carMarker.setPosition(newPoint);-->
<!-- this.lastPosition = newPoint; // -->
<!-- } else {-->
<!-- console.error('Invalid latitude or longitude data:', this.data);-->
<!-- }-->
<!-- },-->
<!-- calculateAngle(start, end) {-->
<!-- const [startLng, startLat] = start;-->
<!-- const [endLng, endLat] = end;-->
<!-- const deltaLng = endLng - startLng;-->
<!-- const deltaLat = endLat - startLat;-->
<!-- const angle = Math.atan2(deltaLat, deltaLng) * (180 / Math.PI);-->
<!-- return angle;-->
<!-- }-->
<!-- },-->
<!-- mounted() {-->
<!-- this.initMap();-->
<!-- },-->
<!-- beforeDestroy() {-->
<!-- if (this.intervalId) {-->
<!-- clearInterval(this.intervalId);-->
<!-- }-->
<!-- if (this.map) {-->
<!-- this.map.destroy();-->
<!-- }-->
<!-- },-->
<!--};-->
<!--</script>-->