车辆管理更新
parent
9b54ce9b7a
commit
0a843231d8
|
@ -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) {
|
||||
|
|
|
@ -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
|
@ -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>-->
|
||||
|
@ -25,7 +25,7 @@
|
|||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data(){
|
||||
data() {
|
||||
return {
|
||||
map: null,
|
||||
marker: null,
|
||||
|
@ -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;
|
||||
setTimeout(() =>{
|
||||
mounted() {
|
||||
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');
|
||||
methods: {
|
||||
send() {
|
||||
// 发送消息
|
||||
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
|
||||
if (len !== 0){
|
||||
lastArr = this.lineArr[len-1];
|
||||
const len = this.lineArr.length
|
||||
if (len !== 0) {
|
||||
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],
|
||||
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",
|
||||
position: [116.478935, 39.997761],
|
||||
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.map.setCenter(e.target.getPosition(),true)
|
||||
});
|
||||
this.map.setFitView();
|
||||
this.passedPolyline.setPath(e.passedPath)
|
||||
this.map.setCenter(e.target.getPosition(), true)
|
||||
})
|
||||
this.map.setFitView()
|
||||
},
|
||||
|
||||
//开始动画
|
||||
startAnimation(){
|
||||
// 开始动画
|
||||
startAnimation() {
|
||||
this.marker.setPosition(this.arr)
|
||||
this.marker.on('moving', (e) => {
|
||||
this.passedPolyline.setPath(e.passedPath);
|
||||
this.map.setCenter(e.target.getPosition(),true)
|
||||
});
|
||||
this.passedPolyline.setPath(e.passedPath)
|
||||
this.map.setCenter(e.target.getPosition(), true)
|
||||
})
|
||||
|
||||
this.marker.moveAlong(this.lineArr,
|
||||
{
|
||||
|
@ -124,23 +123,22 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
//暂停
|
||||
// 暂停
|
||||
pauseAnimation() {
|
||||
this.marker.pauseMove();
|
||||
this.marker.pauseMove()
|
||||
},
|
||||
|
||||
//继续
|
||||
// 继续
|
||||
resumeAnimation() {
|
||||
this.marker.resumeMove();
|
||||
this.marker.resumeMove()
|
||||
},
|
||||
|
||||
//停止
|
||||
// 停止
|
||||
stopAnimation() {
|
||||
this.marker.stopMove();
|
||||
},
|
||||
this.marker.stopMove()
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue