修改轮胎GPS

master
夜笙歌 2 years ago
parent 237d85a5e9
commit 5eaf0cf456

@ -4,42 +4,17 @@ import request from '@/utils/request'
// 查询轮胎基础信息列表
export function listTest(query) {
return request({
url: '/test/test/list',
url: '/basetyre/tyredetail/tyreavg',
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',
method: 'post',
data: data
})
}
// 修改轮胎基础信息
export function updateTest(data) {
return request({
url: '/test/test',
method: 'put',
data: data
})
}
// 删除轮胎基础信息
export function delTest(id) {
// 查询轮胎基础信息列表
export function getChartData(query) {
return request({
url: '/test/test/' + id,
method: 'delete'
url: '/basetyre/tyre_historical_records/report',
method: 'get',
params: query
})
}

@ -3,50 +3,23 @@
<!-- 搜索栏-->
<el-form v-show="showSearch" ref="queryRef" :inline="true" :label-width=" locale ? '90px':'140px'"
:model="queryParams">
<el-form-item label="车牌号" prop="internationalization1">
<el-form-item label="外胎号" prop="outerTireNumber">
<el-input
v-model="queryParams.internationalization1"
:placeholder=" t('common.pleaseEnter') + '车牌号'"
v-model="queryParams.outerTireNumber"
:placeholder="t('common.pleaseEnter') + '外胎号'"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="轮胎号" prop="internationalization2">
<el-input
v-model="queryParams.internationalization2"
:placeholder="t('common.pleaseEnter') + '轮胎号'"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="接收机" prop="internationalization3">
<el-input
v-model="queryParams.internationalization3"
:placeholder="t('common.pleaseEnter') + '接收机'"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="传感器" prop="internationalization4">
<el-input
v-model="queryParams.internationalization4"
:placeholder="t('common.pleaseEnter') + '传感器'"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="GPS时间" prop="internationalization5">
<el-form-item label="GPS时间" prop="time">
<el-date-picker
v-model="dateRange"
value-format="YYYY-MM-DD"
type="daterange"
end-placeholder="结束日期"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
type="daterange"
value-format="YYYY-MM-DD"
/>
</el-form-item>
<el-form-item label=" ">
@ -71,44 +44,20 @@
</el-row>
<!-- 表格主体-->
<el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="postList" @row-click="rowClick">
<el-table-column align="center" fixed type="selection" width="55"/>
<el-table-column align="center" label="序号" prop="internationalization1"
width="150"/>
<el-table-column align="center" label="轮胎编号" prop="internationalization2"
width="150"/>
<el-table-column align="center" label="轮胎位置" prop="internationalization3"
width="150"/>
<el-table-column align="center" label="胎压传感器ID" prop="internationalization4"
width="150"/>
<el-table-column align="center" label="GPS时间" prop="internationalization5"
width="150"/>
<el-table-column align="center" label="接收机ID" prop="internationalization6"
width="150"/>
<el-table-column align="center" label="传感器电池电压" prop="internationalization7"
width="150"/>
<el-table-column align="center" label="压力值" prop="internationalization8"
width="150"/>
<el-table-column align="center" label="温度值" prop="internationalization9"
width="150"/>
<el-table-column align="center" label="是否低电压" prop="internationalization10"
width="150"/>
<el-table-column align="center" label="是否60分钟未收到数据" prop="internationalization11"
width="180"/>
<el-table-column align="center" label="传感器是否运行" prop="internationalization12"
width="150"/>
<el-table-column align="center" label="是否气压高" prop="internationalization13"
width="150"/>
<el-table-column align="center" label="是否气压低" prop="internationalization14"
width="150"/>
<el-table-column align="center" label="是否温度高" prop="internationalization15"
width="150"/>
<el-table-column align="center" label="气压状态" prop="internationalization16"
width="150"/>
<el-table-column align="center" label="纬度" prop="internationalization17"
width="150"/>
<el-table-column align="center" label="经度" prop="internationalization18"
width="150"/>
width="55"/>
<el-table-column align="center" label="外胎号" prop="outerTireNumber"
/>
<el-table-column align="center" label="传感器ID" prop="sensorid"
/>
<el-table-column align="center" label="平均压力" prop="avgpressvalue"
/>
<el-table-column align="center" label="平均温度" prop="avgtemperaturevalue"
/>
<el-table-column align="center" label="平均速度" prop="avgspeed"
/>
</el-table>
<!-- 分页-->
@ -119,12 +68,15 @@
:total="total"
@pagination="getList"
/>
<el-dialog v-model="dialogTableVisible" @opened="dialogOpened">
<temp ref="tempRef" width='900px'/>
</el-dialog>
</div>
</template>
<script name="Test" setup>
import {addTest, delTest, getTest, listTest, updateTest} from "@/api/GPS/tyre";
import {listTest,getChartData} from "@/api/GPS/tyre";
import Temp from '@/views/dashboard/Temp'
import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie";
@ -143,23 +95,52 @@ const showSearch = ref(true);
//
const total = ref(0);
const dateRange = ref([]);
//
const dialogTableVisible = ref(false)
const tempRef = ref();
const outerTireNumberNow = ref('')
//
const queryParams = ref({
pageNum: 1,
pageSize: 10,
internationalization1: undefined,
internationalization2: undefined,
outerTireNumber: undefined,
internationalization3: undefined,
internationalization4: undefined,
internationalization5: undefined,
})
const rowClick = (e) => {
outerTireNumberNow.value = e.outerTireNumber
dialogTableVisible.value = true
}
const dialogOpened = ()=>{
console.log(tempRef)
getChartData({outerTireNumber:outerTireNumberNow.value}).then(val=>{
console.log(val)
tempRef.value.setData(val.data);
})
}
/** 查询岗位列表 */
function getList() {
loading.value = true;
listTest(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
let str = queryParams.value.outerTireNumber || ''
str = str.replace(',',' ')
str = str.replace('',' ')
str = str.replace('、',' ')
let dataRow = str.split(' ')
let data = dataRow?.filter(e=>!!e) || []
let params= {
outerTireNumbers:data?.toString(),
// params:{
// beginTime:dateRange.value?.[0],
// endTime:dateRange.value?.[1],
// }
}
listTest(proxy.addDateRange(params, dateRange.value)).then(response => {
postList.value = response.rows;
total.value = response.total;
}).finally(() => {
@ -167,12 +148,6 @@ function getList() {
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;

@ -178,6 +178,7 @@ export default defineComponent({
myChart.setOption(state.option)
}
const setData = (e) => {
console.log(e)
let X = e.TPList.map(v => v.time)
let Y1 = []
let Y2 = e.TPList.map(v => v.temperature)

@ -28,15 +28,15 @@ export default defineConfig(({mode, command}) => {
},
// vite 相关配置
server: {
port: 81,
port: 80,
host: true,
// https:true,
// open: true,
proxy: {
'/dev-api': {
target: 'https://ticptest.tercelo.com/dev-api',
// target: 'https://ticptest.tercelo.com/dev-api',
// target: 'http://47.94.93.46/dev-api',
// target: 'http://10.11.41.249:8080',
target: 'http://10.11.41.249:8080',
// target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')

Loading…
Cancel
Save