修改设备类型选择

master
夜笙歌 2 years ago
parent 7562fb8fee
commit 82e1c27683

@ -1,11 +1,26 @@
import request from '@/utils/request'
// 查询轮胎基础信息列表
export function listBaseCar(query) {
return request({
url: '/basecar/car/list',
url: '/carqueue/carqueue/carQueuelist',
method: 'get',
params: query
})
}
export function getInfoById(query) {
return request({
url: '/basetyre/fireset/' + query,
method: 'get',
isNoLang:true
})
}
export function setAttributes(query) {
return request({
url: '/basetyre/fireset',
method: 'post',
data: query
})
}

@ -2,44 +2,10 @@
import request from '@/utils/request'
// 查询轮胎基础信息列表
export function listTest(query) {
export function getTrack(query) {
return request({
url: '/basetyre/CollectMachineGps/list',
method: 'get',
params: query
})
}
// 查询轮胎基础信息详细
export function getTest(id) {
return request({
url: '/test/test/' + id,
method: 'get'
})
}
// 新增轮胎基础信息
export function addTest(data) {
return request({
url: '/test/test',
url: '/basetyre/BaseCarGpsRecord/CarHistoricalLocus',
method: 'post',
data: data
})
}
// 修改轮胎基础信息
export function updateTest(data) {
return request({
url: '/test/test',
method: 'put',
data: data
})
}
// 删除轮胎基础信息
export function delTest(id) {
return request({
url: '/test/test/' + id,
method: 'delete'
data: query
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -22,7 +22,7 @@
/>
</el-form-item>
<el-form-item :label="t('baseDevice.baseDevice.deviceType')" prop="deviceType">
<el-select v-model="queryParams.deviceType" :placeholder="t('common.PleaseSelect')" class="m-2">
<el-select clearable v-model="queryParams.deviceType" :placeholder="t('common.PleaseSelect')" class="m-2">
<el-option
v-for="item in options"
:key="item.value"
@ -241,7 +241,7 @@ const queryParams = ref({
companyCode: undefined,
internetThingsNo: undefined,
simCode: undefined,
deviceType: 0,
deviceType: null,
state: 0,
activeTime: undefined,
lastRunTime: undefined,

@ -1,51 +1,40 @@
<template>
<div>
<el-form style="margin-top: 24px" ref="postRef" :label-width=" locale ? '250px':'300px'" :model="form" :rules="rules">
<el-form ref="postRef" :label-width=" locale ? '250px':'300px'" :model="form" :rules="rules"
style="margin-top: 24px">
<el-form-item v-if="false" prop="id">
<el-input v-model="form.id"/>
</el-form-item>
<el-form-item label="第一轴高气压阀值" prop="internationalization1">
<el-input-number v-model="form.internationalization1" :step="5" />
<el-form-item label="选择车辆" prop="internationalization8">
<el-cascader
:options="options"
:props="{ multiple: true, checkStrictly: true,value:'id',label:'title',children:'baseCarList', }"
clearable
@change="cascaderChange"></el-cascader>
</el-form-item>
<el-form-item label="第一轴高气压阀值" prop="z1PressureHigh;">
<el-input-number v-model="form.z1PressureHigh" :min="0" :step="5"/>
</el-form-item>
<el-form-item label="第一轴低气压阀值" prop="internationalization2">
<el-input-number v-model="form.internationalization2" :step="5" />
<el-form-item label="第一轴低气压阀值" prop="z1PressureLow">
<el-input-number v-model="form.z1PressureLow" :min="0" :step="5"/>
</el-form-item>
<el-form-item label="其他轴高气压阀值" prop="internationalization3">
<el-input-number v-model="form.internationalization3" :step="5" />
<el-form-item label="其他轴高气压阀值" prop="zPressureHigh">
<el-input-number v-model="form.zPressureHigh" :min="0" :step="5"/>
</el-form-item>
<el-form-item label="其他轴低气压阀值" prop="internationalization4">
<el-input-number v-model="form.internationalization4" :step="5" />
<el-form-item label="其他轴低气压阀值" prop="zPressureLow">
<el-input-number v-model="form.zPressureLow" :min="0" :step="5"/>
</el-form-item>
<el-form-item label="高温阀值" prop="internationalization5">
<el-input-number v-model="form.internationalization5" :step="5" />
<el-form-item label="高温阀值" prop="temperatureHigh">
<el-input-number v-model="form.temperatureHigh" :min="0" :step="5"/>
</el-form-item>
<el-form-item label="设置生效时间" prop="internationalization6">
<el-date-picker
v-model="form.internationalization6"
type="date"
placeholder="选择日期"
type="date"
/>
</el-form-item>
<el-form-item label="失败无限定时推送" prop="internationalization7">
<el-switch v-model="form.internationalization7" />
</el-form-item>
<el-form-item label="选择车辆" prop="internationalization8">
<el-select
filterable
:remote-method="remoteMethod"
v-model="form.internationalization8"
class="m-2"
placeholder="请选择车辆" >
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button icon="Search" type="primary" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery">{{ t('option.reset') }}</el-button>
@ -56,7 +45,7 @@
<script name="Test" setup>
import {listBaseCar} from "@/api/realTimeMonitoring/alarmSendingSettings";
import {listBaseCar, setAttributes, getInfoById} from "@/api/realTimeMonitoring/alarmSendingSettings";
import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie";
@ -67,48 +56,82 @@ const {t} = useI18n();
const locale = (Cookies.get('language') || 'zhCn') === 'zhCn'
const {proxy} = getCurrentInstance();
const ids = ref([])
const axleTotals = ref([])
const deviceIds = ref([])
const remoteMethod = (e) => {
console.log(form.value.internationalization8)
}
const options = ref([
{
value: 'Option1',
label: 'Option1',
},
{
value: 'Option2',
label: 'Option2',
},
{
value: 'Option3',
label: 'Option3',
},
{
value: 'Option4',
label: 'Option4',
},
{
value: 'Option5',
label: 'Option5',
},
])
const options = ref([])
const form = ref({
internationalization1:10,
internationalization2:10,
internationalization3:10,
internationalization4:10,
internationalization5:10,
z1PressureHigh: 0,
z1PressureLow: 0,
zPressureHigh: 0,
zPressureLow: 0,
temperatureHigh: 0,
internationalization6: parseTime(new Date(), '{y}-{m}-{d}'),
internationalization7: true,
internationalization8: '',
})
const setDisabled = (arr) => {
arr.forEach(e => {
if (e.baseCarList) {
e.disabled = true
setDisabled(e.baseCarList)
}
})
}
listBaseCar().then(e => {
options.value = e.rows.map(val => {
return {
label: val.carLicense,
value: val.id,
let res = JSON.stringify(e.rows)
let newObj = JSON.parse(res.replace(/"carLicense":/g, '"title":'))
setDisabled(newObj)
options.value = newObj
})
const cascaderChange = (e) => {
let lastIds = ids.value || []
let nowIds = e.map(val => val.at(-1))
let nowClick = nowIds.filter(val => !(lastIds.includes(val)))?.[0]
ids.value = e.map(val => val.at(-1))
if (!nowClick) return
getInfoById(nowClick)
.then(val => {
console.log(val)
})
}
const handleQuery = (e) => {
let axleTotalsChange = []
let deviceIdsChange = []
let list = []
if (ids.value.length === 0) return
let recursion = (arr) => {
arr.forEach(val => {
list.push(val)
if (val.baseCarList?.[0]) {
recursion(val.baseCarList)
}
})
}
recursion(options.value)
ids.value.forEach(v => {
let filer = list.find(res => res.id === v)
axleTotalsChange.push(filer.axleTotal)
deviceIdsChange.push(filer.deviceId)
})
axleTotals.value = axleTotalsChange
deviceIds.value = deviceIdsChange
setAttributes({
carIds: ids.value,
axleTotals: axleTotals.value,
deviceIds: deviceIds.value,
z1PressureHigh: form.value.z1PressureHigh,
z1PressureLow: form.value.z1PressureLow,
zPressureHigh: form.value.zPressureHigh,
zPressureLow: form.value.zPressureLow,
temperatureHigh: form.value.temperatureHigh,
}).then(val => {
console.log(val)
})
}
</script>

@ -41,14 +41,14 @@
<div v-if="tyreDataList.includes(`${index+1}-1-1`)"
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].currentTextureDepth }}
<div class="icon1" />{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-1`))[0].temperature }}
</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 class="icon2" />{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-1`))[0].pressure }}
</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
@ -57,14 +57,14 @@
<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 class="icon1" />{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-2`))[0].temperature }}
</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 class="icon2" />{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-1-2`))[0].pressure }}
</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>
<img sizes="100% 100%" src="@/assets/images/zhou.png"
@ -75,14 +75,14 @@
<div v-if="tyreDataList.includes(`${index+1}-2-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}-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 class="icon1" />{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-2`))[0].temperature }}
</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 class="icon2" />{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-2`))[0].pressure }}
</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
@ -91,14 +91,14 @@
<div v-if="tyreDataList.includes(`${index+1}-2-1`)"
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].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 class="icon1" />{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-1`))[0].temperature }}
</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 class="icon2" />{{ tyreList.filter(e => e.tyrePositionS === (`${index + 1}-2-1`))[0].pressure }}
</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>
@ -356,15 +356,15 @@ const tableChange = async (e) => {
pageId.value = e.id
const {data: info} = await getCarGpsList({id: pageId.value})
cardInfo.value = {
carLicense: info[0].carLicense
carLicense: info.carLicense
}
let TireRow1 = info[0].cartype?.split('T')[1]?.split('|').filter(e => e !== '') || []
let TireRow1 = info.cartype?.split('T')[1]?.split('|').filter(e => e !== '') || []
let title = []
TireRow1.forEach((res) => {
title.push(parseInt(res.split('-')[1]))
})
TireRow.value = title
let tyreListData = info[0].tyreList.map(e => {
let tyreListData = info.tyreList.map(e => {
return {
...e,
tyrePositionS: e.tyrePosition?.split('-')[0] + '-' + e.tyrePosition?.split('-')[1] + '-' + e.tyrePosition?.split('-')[2]
@ -376,7 +376,7 @@ const tableChange = async (e) => {
let timeOut = () => {
setTimeout(() => {
if (map) {
setMarker(info[0])
setMarker(info)
clearTimeout(timeOut)
}
}, 1000)
@ -532,4 +532,28 @@ onBeforeUnmount(() => {
.el-descriptions__label {
width: 170px;
}
.icon1{
margin-left: 5px;
display: inline-block;
vertical-align: top;
margin-top: 3px;
width: 30px;
height: 30px;
margin-right: 6px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-image: url('@/assets/images/temperature.png')
}
.icon2{
margin-left: 5px;
display: inline-block;
vertical-align: top;
margin-top: 3px;
width: 30px;
height: 30px;
margin-right: 6px;
background-repeat: no-repeat;
background-size: 100% 100%;
background-image: url('@/assets/images/pressure.png')
}
</style>

@ -12,14 +12,15 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="时间" prop="internationalization3">
<el-form-item label="时间" prop="dateRange">
<el-date-picker
v-model="queryParams.internationalization3"
end-placeholder="结束时间"
range-separator="到"
start-placeholder="开始时间"
type="datetimerange"
/>
v-model="dateRange"
end-placeholder="结束日期"
range-separator="-"
start-placeholder="开始日期"
type="daterange"
value-format="YYYY-MM-DD"
></el-date-picker>
</el-form-item>
<el-form-item label=" ">
<el-button icon="Search" type="primary" @click="handleQuery">{{ t('option.search') }}</el-button>
@ -32,7 +33,7 @@
</template>
<script setup>
import AMapLoader from '@amap/amap-jsapi-loader';
import {addTest, delTest, getTest, listTest, updateTest} from "@/api/realTimeMonitoring/historicalRoute";
import {getTrack} from "@/api/realTimeMonitoring/historicalRoute";
import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie";
@ -41,14 +42,14 @@ const {t} = useI18n();
const locale = (Cookies.get('language') || 'zhCn') === 'zhCn'
const {proxy} = getCurrentInstance();
const queryParams = ref({})
const dateRange = ref([])
let map = null
let polyline = null
let passedPolyline = null
let polylinePath = ref([])
let mouseTool = null
let path = [[116.390969, 39.911592], [116.391496, 39.909008], [116.389264, 39.909765], [116.38802, 39.911016]]
let marketPath = [116.390669, 39.911147]
AMapLoader.load({
key: "ba8fb8d8bae1b280b93406d5959d492f", // WebKey load
// version: "1.4.15", //
@ -66,19 +67,6 @@ AMapLoader.load({
center: [116.397428, 39.90923], //
});
// let marker = new AMap.Marker({
// position: marketPath,
// anchor: 'bottom-center',
// offset: new AMap.Pixel(0, 0)
// });
// marker.setTitle('markertitle');
// marker.setLabel({
// direction: 'top',
// offset: new AMap.Pixel(0, -10), //
// content: "" + AMap.GeometryUtil.isPointInRing(marketPath,path),
// });
// marker.setMap(map);
//
map.addControl(new AMap.ToolBar({position: 'LT'}));
@ -92,17 +80,23 @@ AMapLoader.load({
map.addControl(new AMap.MapType());
}).catch(e => {
console.log(e);
})
const handleQuery = () => {
polyline ? map.remove([polyline]) : ''
getTrack(proxy.addDateRange(queryParams.value, dateRange.value)).then(e => {
polylinePath.value = e.data.map(val => [val.longitude + (Math.random()), val.latitude + (Math.random())])
polyline = new AMap.Polyline({
strokeColor: '#00BBFF', // 线-
path: [[116.478935, 39.997761], [103.85094, 35.987496]],
path: polylinePath.value,
strokeWeight: 6 // 线
})
map.add(polyline);
map.setFitView()
}).catch(e => {
console.log(e);
})
}
</script>
<style>
#container3 {

Loading…
Cancel
Save