修改跳转

master
夜笙歌 2 years ago
parent 2db23657ae
commit d611cf40c0

@ -10,16 +10,16 @@
<p>线路<span>{{ cardInfo.line }}</span></p>
</el-card>
<h2>实时位置</h2>
<div class="container1" id="container"></div>
<!-- <div style="width: 25%;text-align: center;margin-top: 14px">-->
<!-- <img height="70" src="@/assets/images/tyre.png" style="" width="70"/>-->
<!-- <div style="width: 100%;font-size: 12px;white-space:nowrap">轮胎详情</div>-->
<!-- </div>-->
<div id="container" class="container1"></div>
<!-- <div style="width: 25%;text-align: center;margin-top: 14px">-->
<!-- <img height="70" src="@/assets/images/tyre.png" style="" width="70"/>-->
<!-- <div style="width: 100%;font-size: 12px;white-space:nowrap">轮胎详情</div>-->
<!-- </div>-->
</el-col>
<el-col :offset="1" :span="11">
<div style="width: 100%;text-align: center">
<p style="font-weight: 600;font-size: 20px;margin-top: 32px">单车监控</p>
<p style="font-weight: 600;font-size: 16px;color:#cba658">名称1 里程000.00km</p>
<p style="font-weight: 600;font-size: 16px;color:#cba658">{{ cardInfo.carLicense }} 里程000.00km</p>
</div>
<div v-for="(item,index) in 5" key="index" style="margin-bottom: 18px">
<div
@ -41,16 +41,16 @@
<el-col :offset="1" :span="5">
<el-tabs
v-model="tabsName"
type="card"
style="margin:24px 0 0 0"
type="card"
@tab-click="resetQuery"
>
<el-tab-pane label="有车载设备车辆" name="有车载设备车辆">
<el-form ref="queryRef" :inline="true" :model="queryParams"
label-width="60px">
<el-form-item label="车队" prop="carLicense">
<el-form-item label="车队" prop="carQueueId">
<el-input
v-model="queryParams.params1"
v-model="queryParams.carQueueId"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
@ -58,7 +58,7 @@
</el-form-item>
<el-form-item label="车牌号" prop="carLicense">
<el-input
v-model="queryParams.params2"
v-model="queryParams.carLicense"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
@ -71,59 +71,36 @@
</el-form>
<el-table
:data="tableData"
ref="tableRef1"
:show-header="false"
highlight-current-row
style="width: 100%"
@current-change="tableChange"
>
<el-table-column label="params3" prop="params3"/>
</el-table>
</el-tab-pane>
<el-tab-pane label="无车载设备车辆" name="无车载设备车辆">
<el-form ref="queryRef" :inline="true" :model="queryParams"
label-width="60px">
<el-form-item label="车队" prop="carLicense">
<el-input
v-model="queryParams.params1"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="车牌号" prop="carLicense">
<el-input
v-model="queryParams.params2"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label=" ">
<el-button icon="Search" type="primary" @click="handleQuery">{{ t('option.search') }}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ t('option.reset') }}</el-button>
</el-form-item>
</el-form>
<el-table
:data="tableData"
ref="tableRef"
:show-header="false"
highlight-current-row
style="width: 100%"
@current-change="tableChange"
>
<el-table-column label="params3" prop="params3"/>
<el-table-column label="label" prop="label"/>
<el-table-column label="id" prop="id" v-if="false" />
</el-table>
<pagination
v-show="total > 0"
v-model:limit="queryParams.pageSize"
v-model:page="queryParams.pageNum"
:total="total"
layout="sizes, prev, pager, next"
style="margin-bottom: 40px"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</div>
</template>
<script setup>
<script setup>
import {listBaseCar,getCarGpsList} from '@/api/realTimeMonitoring/carMonitoring'
import AMapLoader from '@amap/amap-jsapi-loader';
import {useI18n} from "vue-i18n";
import {ref} from 'vue'
@ -133,11 +110,28 @@ const {proxy} = getCurrentInstance();
const {t} = useI18n();
const tableRef1 = ref()
proxy.$nextTick(() => {
//
const total = ref(0);
const getList = async () => {
console.log(queryParams.value)
const {rows: list} = await listBaseCar(queryParams.value)
tableData.value = list.map(e => {
return {
label: e.carLicense,
id:e.id
}
})
total.value = tableData.value.length
tableRef1.value.setCurrentRow(tableData.value[0])
})
const tableChange = (e) => {
console.log(e)
tableChange(list[0].id)
}
const tableChange = async (e) => {
const {data:info} = await getCarGpsList({id:e.id})
console.log(info)
cardInfo.value = {
carLicense:info[0].carLicense
}
}
const cardInfo = ref({
@ -145,42 +139,33 @@ const cardInfo = ref({
No: '123',
type: '2',
line: '3',
carLicense:''
})
const tabsName = ref('有车载设备车辆')
const queryParams = ref({
params1: '',
params2: '',
pageNum: 1,
pageSize: 10,
carQueueId: '',
carLicense: '',
})
const tableData = ref([
{
params3: '1233'
},
{
params3: '1233'
},
{
params3: '1233'
},
{
params3: '1233'
},
{
params3: '1233'
},
])
const tableData = ref([])
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
// getList();
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryParams.value = {
params1: '',
params2: '',
pageNum: 1,
pageSize: 10,
carQueueId: '',
carLicense: '',
}
handleQuery();
tableRef1.value.setCurrentRow()
@ -210,7 +195,7 @@ AMapLoader.load({
}).catch(e => {
console.log(e);
})
getList()
</script>
<style>
.container1 {
@ -227,7 +212,7 @@ AMapLoader.load({
}
.el-tabs__item {
width: 50%;
width: 100%;
text-align: center;
}

@ -10,6 +10,7 @@ import AMapLoader from '@amap/amap-jsapi-loader';
import { getCarGpsList, listBasetyre } from '@/api/realTimeMonitoring/vehicleMonitoring'
import { parseTime } from "@/utils/ruoyi";
const {proxy} = getCurrentInstance();
let map = null
const treeData = ref([])
const markers = ref([])
@ -26,6 +27,7 @@ const treeClick = (data) => {
}
}
window.$tab = proxy.$tab
const setMarker = async (data, zoom) => {
const { data: markerArr } = await getCarGpsList(data)
markerArr.forEach((e, index) => {
@ -38,7 +40,7 @@ const setMarker = async (data, zoom) => {
offset: new AMap.Pixel(0, 0),
label: {
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){location.href = (location.origin+"/realTimeMonitoring/carMonitoring"+"?id="+i)}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){console.log(window.$tab);window.$tab.openPage("carMonitoring"+"?id="+i,"/realTimeMonitoring") }a("${e.id}")'>监控 ${e.three || ''}</div><div class='info'>${parseTime(e.laseRuntime) || ''}</div>`, //
}
});
})

@ -1,3 +1,4 @@
<template>
<div class="app-container">
<el-form :model="form" inline label-width="80px">
@ -114,7 +115,7 @@
</template>
<script name="basetyre" setup>
import {addCartype, delCartype, getCartype, listCartype, updateCartype} from "@/api/basecar/cartype";
import {getList} from "@/api/tireManagement/install";
import {Search} from '@element-plus/icons-vue'
import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie";

@ -31,8 +31,8 @@ export default defineConfig(({mode, command}) => {
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api': {
// target: 'http://10.11.41.249:8080',
target: 'http://localhost:8080',
target: 'http://10.11.41.249:8080',
// target: 'http://localhost:8080',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
}

Loading…
Cancel
Save