修改单车监控界面

master
夜笙歌 2 years ago
parent b083c4d153
commit dd1392813b

@ -8,6 +8,7 @@ export function listBaseCar(query) {
params: query params: query
}) })
} }
// 查询列表 // 查询列表
export function getCarGpsList(query) { export function getCarGpsList(query) {
return request({ return request({
@ -17,3 +18,12 @@ export function getCarGpsList(query) {
}) })
} }
// 查询轮胎信息
export function getTyreList(query) {
return request({
url: '/basetyre/tyre/' + query,
method: 'get',
isNoLang: true,
})
}

@ -45,10 +45,10 @@ service.interceptors.request.use(config => {
...(config.params || {}), ...(config.params || {}),
lang lang
}); });
url = url.slice(0, -1);
} else { } else {
url = config.url url = config.url
} }
url = url.slice(0, -1);
config.params = {}; config.params = {};
config.url = url; config.url = url;
} }

@ -1,5 +1,5 @@
<template> <template>
<div :class="className" :style="{height:height,width:width}" id="myChart"/> <div id="myChart" :class="className" :style="{height:height,width:width}"/>
</template> </template>
<script> <script>

@ -119,7 +119,11 @@
<el-table-column :label="t('baseDevice.baseDevice.internetThingsNo')" align="center" prop="internetThingsNo" <el-table-column :label="t('baseDevice.baseDevice.internetThingsNo')" align="center" prop="internetThingsNo"
width="150"/> width="150"/>
<el-table-column :label="t('baseDevice.baseDevice.deviceType')" align="center" prop="deviceType" <el-table-column :label="t('baseDevice.baseDevice.deviceType')" align="center" prop="deviceType"
/> >
<template #default="scope">
{{ scope.row.state === 0? 'GPS接收机' : '胎压传感器' }}
</template>
</el-table-column>
<el-table-column :label="t('baseDevice.baseDevice.state')" align="center" prop="state" <el-table-column :label="t('baseDevice.baseDevice.state')" align="center" prop="state"
> >
<template #default="scope"> <template #default="scope">
@ -135,25 +139,6 @@
width="150"/> width="150"/>
<el-table-column :label="t('common.createTime')" align="center" prop="createTime" width="160"/> <el-table-column :label="t('common.createTime')" align="center" prop="createTime" width="160"/>
<el-table-column :label="t('common.createBy')" align="center" prop="createBy"/> <el-table-column :label="t('common.createBy')" align="center" prop="createBy"/>
<el-table-column :label="t('option.option')" align="center" class-name="small-padding fixed-width" fixed="right"
width="160">
<template #default="scope">
<el-button
v-hasPermi="['basedevice:basedevice:edit']"
icon="Edit"
type="text"
@click="handleUpdate(scope.row)"
>{{ t('option.edit') }}
</el-button>
<el-button
v-hasPermi="['basedevice:basedevice:remove']"
icon="Delete"
type="text"
@click="handleDelete(scope.row)"
>{{ t('option.remove') }}
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<!-- 分页--> <!-- 分页-->
@ -213,11 +198,11 @@ const locale = (Cookies.get('language') || 'zhCn') === 'zhCn'
const {proxy} = getCurrentInstance(); const {proxy} = getCurrentInstance();
const options = [ const options = [
{ {
value: 'Option1', value: '0',
label: 'GPS接收机', label: 'GPS接收机',
}, },
{ {
value: 'Option2', value: '1',
label: '胎压传感器', label: '胎压传感器',
}, },
] ]

@ -36,36 +36,69 @@
</div> </div>
<div v-for="(item,index) in TireRow" key="index" style="margin-bottom: 18px"> <div v-for="(item,index) in TireRow" key="index" style="margin-bottom: 18px">
<div <div
style="vertical-align:top;width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid #666;border-radius: 10%"> style="vertical-align:top;width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid #666;border-radius: 10%"
<div style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top" v-if="tyreDataList.includes(`${index+1}-1-1`)"> @click="getTyreInfo(`${index+1}-1-1`)">
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹深度:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-1`))[0].currentTextureDepth}}</div> <div v-if="tyreDataList.includes(`${index+1}-1-1`)"
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">轮胎编号:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-1`))[0].outerTireNumber}}</div> style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top">
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-1`))[0].pattern}}</div> <div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
花纹深度:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-1`))[0].currentTextureDepth }}
</div> </div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
轮胎编号:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-1`))[0].outerTireNumber }}
</div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
花纹:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-1`))[0].pattern }}
</div>
</div>
</div>
<div
:style="'vertical-align: top;width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid'+ (TireRow[index] === 2 ? '#666;' :'rgba(0,0,0,0);') + 'border-radius: 10%'"
@click="getTyreInfo(`${index+1}-1-2`)">
<div v-if="tyreDataList.includes(`${index+1}-1-2`)"
style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align: top">
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
花纹深度:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-2`))[0].currentTextureDepth }}
</div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
轮胎编号:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-2`))[0].outerTireNumber }}
</div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
花纹:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-2`))[0].pattern }}
</div> </div>
<div :style="'width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid'+ (TireRow[index] === 2 ? '#666;' :'rgba(0,0,0,0);') + 'border-radius: 10%'">
<div style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top" v-if="tyreDataList.includes(`${index+1}-1-2`)">
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹深度:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-2`))[0].currentTextureDepth}}</div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">轮胎编号:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-2`))[0].outerTireNumber}}</div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-1-2`))[0].pattern}}</div>
</div> </div>
</div> </div>
<img sizes="100% 100%" src="@/assets/images/zhou.png" <img sizes="100% 100%" src="@/assets/images/zhou.png"
style="width: calc(50% - 108px);height: 100px;display: inline-block;vertical-align:top"/> style="width: calc(50% - 108px);height: 100px;display: inline-block;vertical-align:top"/>
<div <div
:style="'width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid '+ (TireRow[index] === 2 ? '#666' :'rgba(0,0,0,0)') +';border-radius: 10%'"> :style="'vertical-align: top;width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid '+ (TireRow[index] === 2 ? '#666' :'rgba(0,0,0,0)') +';border-radius: 10%'"
<div style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top" v-if="tyreDataList.includes(`${index+1}-2-2`)"> @click="getTyreInfo(`${index+1}-2-2`)">
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹深度:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-2`))[0].currentTextureDepth}}</div> <div v-if="tyreDataList.includes(`${index+1}-2-2`)"
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">轮胎编号:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-2`))[0].outerTireNumber}}</div> style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top">
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-2`))[0].pattern}}</div> <div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
花纹深度:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-2`))[0].currentTextureDepth }}
</div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
轮胎编号:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-2`))[0].outerTireNumber }}
</div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
花纹:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-2`))[0].pattern }}
</div>
</div> </div>
</div> </div>
<div <div
style="width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid #666;border-radius: 10%"> style="vertical-align: top;width: 12.5%;margin: 0 12px; height: 100px;display: inline-block;border: 1px solid #666;border-radius: 10%"
<div style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top" v-if="tyreDataList.includes(`${index+1}-2-1`)"> @click="getTyreInfo(`${index+1}-2-1`)">
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹深度:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-1`))[0].currentTextureDepth}}</div> <div v-if="tyreDataList.includes(`${index+1}-2-1`)"
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">轮胎编号:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-1`))[0].outerTireNumber}}</div> style="border-radius: 10%;width:100%;height:100%;background-color:green;vertical-align:top">
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">花纹:{{tyreList.filter(e=>e.tyrePositionS === (`${index+1}-2-1`))[0].pattern}}</div> <div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
花纹深度:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-1`))[0].currentTextureDepth }}
</div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
轮胎编号:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-1`))[0].outerTireNumber }}
</div>
<div style="white-space:nowrap;width: 100%;color:#fff;font-size: 0.7vw;line-height: 33px">
花纹:{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-1`))[0].pattern }}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -120,18 +153,44 @@
</el-col> </el-col>
</el-row> </el-row>
<el-dialog v-model="open" :title="title" append-to-body width="800px">
<el-form :inline="true" ref="postRef" :label-width=" locale ? '90px':'140px'" :model="tyreInfo" :rules="rules">
<el-form-item v-if="false" prop="id">
<el-input v-model="tyreInfo.id"/>
</el-form-item>
<el-form-item :label="t('test.test.internationalization1')" prop="internationalization1">
<el-input
v-model="tyreInfo.internationalization1"
:placeholder="t('common.pleaseEnter') + t('test.test.internationalization1')"/>
</el-form-item>
<el-form-item :label="t('test.test.internationalization2')" prop="internationalization2">
<el-input
v-model="tyreInfo.internationalization2"
:placeholder="t('common.pleaseEnter') + t('test.test.internationalization2')"/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm">{{ t('option.ok') }}</el-button>
<el-button @click="cancel">{{ t('option.cancel') }}</el-button>
</div>
</template>
</el-dialog>
</div> </div>
</template> </template>
<script setup> <script setup>
import {listBaseCar, getCarGpsList} from '@/api/realTimeMonitoring/carMonitoring' import {listBaseCar, getCarGpsList, getTyreList} from '@/api/realTimeMonitoring/carMonitoring'
import AMapLoader from '@amap/amap-jsapi-loader'; import AMapLoader from '@amap/amap-jsapi-loader';
import {useI18n} from "vue-i18n"; import {useI18n} from "vue-i18n";
import {ref} from 'vue' import {ref} from 'vue'
import {useRouter} from 'vue-router'; import {useRouter} from 'vue-router';
import {parseTime} from "@/utils/ruoyi"; import {parseTime} from "@/utils/ruoyi";
import {onBeforeUnmount} from "@vue/runtime-core"; import {onBeforeUnmount} from "@vue/runtime-core";
import {addBaseDevice, updateBaseDevice} from "@/api/deviceManagement/info";
const title = '轮胎信息'
const {proxy} = getCurrentInstance(); const {proxy} = getCurrentInstance();
const $router = useRouter(); const $router = useRouter();
const {t} = useI18n(); const {t} = useI18n();
@ -140,8 +199,20 @@ const tyreList = ref([])
const tyreDataList = ref([]) const tyreDataList = ref([])
const pageId = ref('') const pageId = ref('')
const tableRef1 = ref() const tableRef1 = ref()
const open = ref(false)
let map = null let map = null
const markers = ref(null) const markers = ref(null)
const tyreInfo = ref({})
const getTyreInfo = (e) => {
let id = tyreList.value.filter(val => val.tyrePositionS === e)?.[0]?.tyreId || ''
console.log(id)
if (!id) return
open.value = true
getTyreList(id).then(e => {
console.log(e)
})
}
AMapLoader.load({ AMapLoader.load({
key: "ba8fb8d8bae1b280b93406d5959d492f", // WebKey load key: "ba8fb8d8bae1b280b93406d5959d492f", // WebKey load
@ -239,6 +310,45 @@ const queryParams = ref({
const tableData = ref([]) const tableData = ref([])
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
/** 表单重置 */
function reset() {
tyreInfo.value = {
id: null,
internetThingsNo: null,
deviceType: null,
state: null,
};
proxy.resetForm("postRef");
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["postRef"].validate(valid => {
if (valid) {
if (tyreInfo.value.id != undefined) {
// updateBaseDevice(tyreInfo.value).then(response => {
// proxy.$modal.msgSuccess(t('option.modificationSuccessful'));
open.value = false;
// getList();
// });
} else {
// addBaseDevice(tyreInfo.value).then(response => {
// proxy.$modal.msgSuccess(t('option.addedSuccessfully'));
open.value = false;
// getList();
// });
}
}
});
}
/** 搜索按钮操作 */ /** 搜索按钮操作 */
function handleQuery() { function handleQuery() {
queryParams.value.pageNum = 1; queryParams.value.pageNum = 1;

@ -41,7 +41,7 @@ const setMarker = async (data, zoom) => {
offset: new AMap.Pixel(0, 0), offset: new AMap.Pixel(0, 0),
label: { label: {
direction: 'top', direction: 'top',
content: `<div class='info'>${e.carLicense || ''} - <span style="color: ${e.state === 0 ? 'green">在线' : 'red">离线'}</span></div><div class='info' onClick='function a(i){console.log(window.$tab);window.$tab.openPage("carMonitoring"+"?id="+i,"/realTimeMonitoring") }a("${e.id}")'>监控 ${e.three || ''}</div><div class='info'>${parseTime(e.laseRuntime) || ''}</div>`, // content: `<div class='info'>${e.carLicense || ''} - <span style="color: ${e.state === 0 ? 'green">在线' : 'red">离线'}</span></div><div class='info' onClick='function a(i){window.$tab.openPage("carMonitoring"+"?id="+i,"/realTimeMonitoring") }a("${e.id}")'>监控 ${e.three || ''}</div><div class='info'>${parseTime(e.laseRuntime) || ''}</div>`, //
}, },
extData: { extData: {
id: '123' id: '123'

@ -11,26 +11,26 @@
</template> </template>
</el-input> </el-input>
</div> </div>
<div>品牌{{ tireInfo.info1 }} 规格{{ tireInfo.info2 }} 花纹{{ tireInfo.info3 }}</div> <div>品牌{{ tireInfo.brand }} 规格{{ tireInfo.size }} 花纹{{ tireInfo.pattern }}</div>
<div> <div>
<span class="yellow">使用时间&nbsp;&nbsp;</span> <span class="yellow">使用时间&nbsp;&nbsp;</span>
<span>{{ tireInfo.info4 }}&nbsp;&nbsp;</span> <span>{{ tireInfo.userTime }}&nbsp;&nbsp;</span>
<span class="yellow">最长连续报警时间&nbsp;&nbsp;</span> <span class="yellow">最长连续报警时间&nbsp;&nbsp;</span>
<span>{{ tireInfo.info5 }}&nbsp;&nbsp;</span> <span>{{ tireInfo.warringTime }}&nbsp;&nbsp;</span>
<span class="yellow">历史最高胎压&nbsp;&nbsp;</span> <span class="yellow">历史最高胎压&nbsp;&nbsp;</span>
<span>{{ tireInfo.info6 }}&nbsp;&nbsp;</span> <span>{{ tireInfo.highTemHis }}&nbsp;&nbsp;</span>
</div> </div>
<div> <div>
<span class="yellow">预计剩余里程&nbsp;&nbsp;</span> <span class="yellow">预计剩余里程&nbsp;&nbsp;</span>
<span>{{ tireInfo.info7 }}km&nbsp;&nbsp;</span> <span>{{ tireInfo.surplusMileage }}km&nbsp;&nbsp;</span>
<span class="yellow">最长连续工作时间&nbsp;&nbsp;</span> <span class="yellow">最长连续工作时间&nbsp;&nbsp;</span>
<span>{{ tireInfo.info8 }}&nbsp;&nbsp;</span> <span>{{ tireInfo.longestWorkTime }}&nbsp;&nbsp;</span>
<span class="yellow">历史最高胎温&nbsp;&nbsp;</span> <span class="yellow">历史最高胎温&nbsp;&nbsp;</span>
<span>{{ tireInfo.info9 }}&nbsp;&nbsp;</span> <span>{{ tireInfo.highPressHis }}&nbsp;&nbsp;</span>
</div> </div>
<div> <div>
<span class="yellow">报警次数&nbsp;&nbsp;</span> <span class="yellow">报警次数&nbsp;&nbsp;</span>
<span>{{ tireInfo.info10 }}&nbsp;&nbsp;</span> <span>{{ tireInfo.warringTimes }}&nbsp;&nbsp;</span>
<div v-for="item in tireInfo.war" style="display: inline-block"> <div v-for="item in tireInfo.war" style="display: inline-block">
<span>{{ item.type }}&nbsp;&nbsp;</span> <span>{{ item.type }}&nbsp;&nbsp;</span>
<span>{{ item.num }}&nbsp;&nbsp;</span> <span>{{ item.num }}&nbsp;&nbsp;</span>
@ -133,8 +133,8 @@ const outerTireNumberSearchClick = async () => {
const {data: info} = await getTyreLife({ const {data: info} = await getTyreLife({
outerTireNumber: tireInfo.value.title outerTireNumber: tireInfo.value.title
}) })
console.log(info) list.value = info.lifeList
list.value = info tireInfo.value = info.tyresLifeInfo
list.value.push({ list.value.push({
datetime: new Date().getTime(), datetime: new Date().getTime(),
description: '今日' description: '今日'
@ -148,8 +148,7 @@ const tyrePosition = (e) => {
let position = [parseFloat(arr?.[0]), parseFloat(arr?.[1]), parseFloat(arr?.[2])] let position = [parseFloat(arr?.[0]), parseFloat(arr?.[1]), parseFloat(arr?.[2])]
let Enum1 = ['左', '右'] let Enum1 = ['左', '右']
let Enum2 = ['外', '内'] let Enum2 = ['外', '内']
return `${position[0]}${Enum1[position[1] - 1]}${Enum1[position[2] - 1]}` return `${position[0]}${Enum1[position[1] - 1]}${Enum2[position[2] - 1]}`
console.log(position)
} }
const percentage = '3.33' const percentage = '3.33'
@ -158,16 +157,16 @@ const run = '3.33'
const tireInfo = ref({ const tireInfo = ref({
title: '1001', title: '1001',
info1: '品牌', brand: '',
info2: '规格', size: '',
info3: '花纹', pattern: '',
info4: '10h', userTime: '',
info5: '10h', warringTime: '',
info6: '40°C', highTemHis: '',
info7: '666', surplusMileage: '',
info8: '10h', longestWorkTime: '',
info9: '40°C', highPressHis: '',
info10: '1', warringTimes: '',
war: [ war: [
{ {
type: '高温', type: '高温',

Loading…
Cancel
Save