车辆管理更新

master
shaowenhao 2023-11-29 13:58:21 +08:00
parent 9b54ce9b7a
commit 0a843231d8
5 changed files with 1293 additions and 64 deletions

View File

@ -9,6 +9,14 @@ export function carList(data) {
data
})
}
//车辆信息列表
export function carHuiList(carVinId) {
return request({
url: 'carBase/car//list/' + carVinId,
method: 'get',
carVinId
})
}
//添加车辆信息管理
export function carAdd(data) {

View File

@ -56,7 +56,45 @@
</div>
</el-dialog>
<!--1111111111111111111111111111111111修改回显弹窗1111111111111111111111111111-->
<el-dialog title="修改车辆信息管理" :visible.sync="dialogFormVisible1">
<el-form :model="formHui">
<el-form-item label="车辆VIN" :label-width="formLabelWidth">
<el-input v-model="formHui.carVinId" autocomplete="off" />
</el-form-item>
<el-form-item label="车辆类型" :label-width="formLabelWidth">
<el-select v-model="formHui.carTypeId" placeholder="请选择车辆类型">
<el-option label="区域一" value="shanghai" />
<el-option label="区域二" value="beijing" />
</el-select>
</el-form-item>
<el-form-item label="电子围栏" :label-width="formLabelWidth">
<el-select v-model="formHui.fenceId" placeholder="请选择电子围栏">
<el-option label="区域一" value="shanghai" />
<el-option label="区域二" value="beijing" />
</el-select>
</el-form-item>
<el-form-item label="电机厂商" :label-width="formLabelWidth">
<el-input v-model="formHui.motorManufacturer" autocomplete="off" />
</el-form-item>
<el-form-item label="电池厂商" :label-width="formLabelWidth">
<el-input v-model="formHui.batteryManufacturer" autocomplete="off" />
</el-form-item>
<el-form-item label="电机编号" :label-width="formLabelWidth">
<el-input v-model="formHui.motorNumber" autocomplete="off" />
</el-form-item>
<el-form-item label="电池编号" :label-width="formLabelWidth">
<el-input v-model="formHui.batteryNumber" autocomplete="off" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addCarDialogFormVisible1"> </el-button>
</div>
</el-dialog>
</el-form>
<!--1111111111111111111111111111111111 列表展示 1111111111111111111111111111-->
<el-table :data="tableData" style="width: 100%">
<el-table-column label="车辆VIN" width="180">
@ -109,9 +147,9 @@
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size="mini" @click="handleShi(scope.$index , scope.row)">实时轨迹</el-button>
<el-button size="mini" @click="handleShi(scope.$index , scope.row.carVinId)">实时轨迹</el-button>
<!-- 修改车辆信息-->
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
<el-button size="mini" @click="handleEdit(scope.$index, scope.row.carVinId)">修改</el-button>
<!-- 删除车辆信息-->
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row.carVinId)">删除</el-button>
</template>
@ -123,7 +161,7 @@
<script>
import { carAdd, carList } from '../../api/carList/list'
import { carAdd, carDel, carExport, carHuiList, carList, carUpd } from '../../api/carList/list'
export default {
name: 'CarList',
@ -156,8 +194,20 @@ export default {
motorNumber: '',
batteryNumber: ''
},
//
formHui: {
carVinId: '',
carTypeId: '',
fenceId: '',
status: '',
motorManufacturer: '',
batteryManufacturer: '',
motorNumber: '',
batteryNumber: ''
},
tableData: [],
dialogFormVisible: false
dialogFormVisible: false,
dialogFormVisible1: false
}
},
created() {
@ -184,7 +234,7 @@ export default {
addCar() {
this.dialogFormVisible = true
},
//
//
addCarDialogFormVisible() {
carAdd().then(res => {
debugger
@ -206,13 +256,71 @@ export default {
//
delListCar() {},
//
handleShi() {},
//
handleEdit() {},
handleShi(carVinId) {
this.$router.push('src/views/allCar/operation.vue')
},
//
handleEdit(carVinId) {
this.dialogFormVisible1 = true
carHuiList(carVinId).then(res => {
if (res.data.code === 200) {
this.formHui = res.data.data
} else {
this.$message({
type: 'error',
message: '回显失败失败'
})
}
})
},
//
addCarDialogFormVisible1() {
carUpd().then(res => {
if (res.data.code === 200) {
this.$message({
type: 'success',
message: '修改成功'
})
} else {
this.$message({
type: 'error',
message: '修改失败'
})
}
})
},
//
handleDelete(carVinId) {},
handleDelete(carVinId) {
carDel(carVinId).then(res => {
if (res.data.code === 200) {
this.$message({
type: 'success',
message: '删除成功'
})
} else {
this.$message({
type: 'error',
message: '删除失败'
})
}
})
},
//
exportCar() {}
exportCar() {
carExport().then(res => {
if (res.data.code === 200) {
this.$message({
type: 'success',
message: '导出成功'
})
} else {
this.$message({
type: 'error',
message: '导出失败'
})
}
})
}
}
}
</script>

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,15 @@
<template>
<div>
<div id="container"></div>
<div id="container" />
<div class="input-card">
<h4>轨迹回放控制</h4>
<div class="input-item">
<input type="button" class="btn" value="开始动画" id="start" @click="startAnimation()"/>
<input type="button" class="btn" value="暂停动画" id="pause" @click="pauseAnimation()"/>
<input id="start" type="button" class="btn" value="开始动画" @click="startAnimation()">
<input id="pause" type="button" class="btn" value="暂停动画" @click="pauseAnimation()">
</div>
<div class="input-item">
<input type="button" class="btn" value="继续动画" id="resume" @click="resumeAnimation()"/>
<input type="button" class="btn" value="停止动画" id="stop" @click="stopAnimation()"/>
<input id="resume" type="button" class="btn" value="继续动画" @click="resumeAnimation()">
<input id="stop" type="button" class="btn" value="停止动画" @click="stopAnimation()">
</div>
<!-- <div class="input-item">-->
<!-- <el-button type="primary" round plain id="start" @click="startAnimation"></el-button>-->
@ -45,78 +45,77 @@ export default {
}
},
created() {
this.socket = new WebSocket('ws://10.100.1.8:9802/websocket/12345');
this.socket = new WebSocket('ws://10.100.1.8:9802/websocket/12345')
},
mounted() {
this.socket.onopen = this.handleOpen;
this.socket.onmessage = this.handleMessage;
this.socket.onerror = this.handleError;
this.socket.onopen = this.handleOpen
this.socket.onmessage = this.handleMessage
this.socket.onerror = this.handleError
setTimeout(() => {
this.send()
this.initAMap();
},500);
this.initAMap()
}, 500)
},
methods: {
send() {
//
this.socket.send('nihao');
this.socket.send('nihao')
},
handleOpen() {
console.log('WebSocket is open!');
console.log('WebSocket is open!')
},
//
handleMessage(event) {
let lastArr = [];
let lastArr = []
this.arr = JSON.parse(event.data)
let len = this.lineArr.length
const len = this.lineArr.length
if (len !== 0) {
lastArr = this.lineArr[len-1];
lastArr = this.lineArr[len - 1]
this.lineArr.length = 0
this.lineArr.push(lastArr)
}
console.log(this.lineArr.toString())
this.lineArr.push(this.arr); //
this.lineArr.push(this.arr) //
console.log(this.lineArr.toString())
this.startAnimation()
},
handleError(error) {
console.log("异常")
console.log('异常')
// console.error(`Error occurred: ${error}`);
},
initAMap() {
// JSAPI2.0 使
this.$AMap.plugin('AMap.MoveAnimation', () => {
this.map = new this.$AMap.Map("container", {
this.map = new this.$AMap.Map('container', {
resizeEnable: true,
center: [116.478935, 39.997761],
zoom: 17
});
});
})
})
this.marker = new this.$AMap.Marker({
map: this.map,
position: [116.478935, 39.997761],
icon: "https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png",
icon: 'https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png',
offset: new this.$AMap.Pixel(-13, -26),
autoRotation: true,
});
autoRotation: true
})
this.marker.on('moving', (e) => {
this.passedPolyline.setPath(e.passedPath);
this.passedPolyline.setPath(e.passedPath)
this.map.setCenter(e.target.getPosition(), true)
});
this.map.setFitView();
})
this.map.setFitView()
},
//
startAnimation() {
this.marker.setPosition(this.arr)
this.marker.on('moving', (e) => {
this.passedPolyline.setPath(e.passedPath);
this.passedPolyline.setPath(e.passedPath)
this.map.setCenter(e.target.getPosition(), true)
});
})
this.marker.moveAlong(this.lineArr,
{
@ -126,21 +125,20 @@ export default {
//
pauseAnimation() {
this.marker.pauseMove();
this.marker.pauseMove()
},
//
resumeAnimation() {
this.marker.resumeMove();
this.marker.resumeMove()
},
//
stopAnimation() {
this.marker.stopMove();
},
this.marker.stopMove()
}
},
}
}
</script>

View File

@ -1,7 +1,7 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">若依后台管理系统</h3>
<h3 class="title">智能车联管理系统</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"