five-cloud-ui/src/views/couplet/VehicleDetection/index.vue

166 lines
4.9 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div>
<h1>车辆监控页面</h1>
<!-- 列表-->
<el-table :data="vehicleList" style="width: 100%" border>
<el-table-column label="车辆id" width="90" align="center">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.vehicleId }}</span>
</template>
</el-table-column>
<el-table-column label="车辆类型" width="90" align="center">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.vehicleTypeName }}</span>
</template>
</el-table-column>
<el-table-column label="电机厂商" width="150" align="center">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.motorManufacturer }}</span>
</template>
</el-table-column>
<el-table-column label="电池厂商" width="150" align="center">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.batteryManufacturer }}</span>
</template>
</el-table-column>
<el-table-column label="电机编号" width="180" align="center">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.motorNumber }}</span>
</template>
</el-table-column>
<el-table-column label="电池编号" width="180" align="center">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.batteryNumber }}</span>
</template>
</el-table-column>
<el-table-column label="vin码" width="180" align="center">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.vin }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="vin码" width="180" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <span style="margin-left: 10px">{{ scope.row.vin }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="车辆状态" width="120" align="center">
<template slot-scope="scope">
<span style="margin-left: 10px" v-if="1==scope.row.vehicleState">
<el-tag type="success">在线</el-tag>
</span>
<span style="margin-left: 10px" v-if="0==scope.row.vehicleState">
<el-tag type="danger">离线</el-tag>
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="findByVehicle(scope.row.vin)"></el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
//这里可以导入其他文件比如组件工具js第三方插件jsjson文件图片文件等等,
//例如import 《组件名称》 from '《组件路径》,
import {getVehicleTypes} from "@/api/couplet/vehicle";
import {detectionList} from "@/api/couplet/VehicleDetection";
export default {
//import引入的组件需要注入到对象中才能使用"
components: {},
props: {},
data() {
//这里存放数据"
return {
//车辆列表
vehicleList: [],
//总页数
total: 0,
//车辆类型
vehicleTypes: [],
//对话框的参数
formLabelWidth: '120px',
dialogEdit: false,
dialogInsert: false,
// 弹出层标题
title: ""
};
},
//计算属性 类似于data概念",
computed: {},
//监控data中的数据变化",
watch: {},
//方法集合",
methods: {
//获取车辆列表
getVehicleList() {
detectionList().then(
res => {
this.vehicleList = res.data;
}
)
},
//分页
handleSizeChange(val) {
this.vehicleListParams.pageSize = val;
this.getVehicleList();
},
handleCurrentChange(val) {
this.vehicleListParams.pageNum = val;
this.getVehicleList();
},
//获取车辆类型
getVehicleTypes() {
getVehicleTypes().then(
res => {
this.vehicleTypes = res.data;
}
)
},
findByVehicle(vin){
}
},
//生命周期 - 创建完成可以访问当前this实例",
created() {
//获取车辆列表
this.getVehicleList ()
//获取车辆类型
this.getVehicleTypes()
},
//生命周期 - 挂载完成可以访问DOM元素",
mounted() {
},
beforeCreate() {
}, //生命周期 - 创建之前",
beforeMount() {
}, //生命周期 - 挂载之前",
beforeUpdate() {
}, //生命周期 - 更新之前",
updated() {
}, //生命周期 - 更新之后",
beforeDestroy() {
}, //生命周期 - 销毁之前",
destroyed() {
}, //生命周期 - 销毁完成",
activated() {
} //如果页面有keep-alive缓存功能这个函数会触发",
};
</script>
<style scoped>
</style>