修改跳转

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

@ -10,16 +10,16 @@
<p>线路<span>{{ cardInfo.line }}</span></p> <p>线路<span>{{ cardInfo.line }}</span></p>
</el-card> </el-card>
<h2>实时位置</h2> <h2>实时位置</h2>
<div class="container1" id="container"></div> <div id="container" class="container1"></div>
<!-- <div style="width: 25%;text-align: center;margin-top: 14px">--> <!-- <div style="width: 25%;text-align: center;margin-top: 14px">-->
<!-- <img height="70" src="@/assets/images/tyre.png" style="" width="70"/>--> <!-- <img height="70" src="@/assets/images/tyre.png" style="" width="70"/>-->
<!-- <div style="width: 100%;font-size: 12px;white-space:nowrap">轮胎详情</div>--> <!-- <div style="width: 100%;font-size: 12px;white-space:nowrap">轮胎详情</div>-->
<!-- </div>--> <!-- </div>-->
</el-col> </el-col>
<el-col :offset="1" :span="11"> <el-col :offset="1" :span="11">
<div style="width: 100%;text-align: center"> <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: 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>
<div v-for="(item,index) in 5" key="index" style="margin-bottom: 18px"> <div v-for="(item,index) in 5" key="index" style="margin-bottom: 18px">
<div <div
@ -41,16 +41,16 @@
<el-col :offset="1" :span="5"> <el-col :offset="1" :span="5">
<el-tabs <el-tabs
v-model="tabsName" v-model="tabsName"
type="card"
style="margin:24px 0 0 0" style="margin:24px 0 0 0"
type="card"
@tab-click="resetQuery" @tab-click="resetQuery"
> >
<el-tab-pane label="有车载设备车辆" name="有车载设备车辆"> <el-tab-pane label="有车载设备车辆" name="有车载设备车辆">
<el-form ref="queryRef" :inline="true" :model="queryParams" <el-form ref="queryRef" :inline="true" :model="queryParams"
label-width="60px"> label-width="60px">
<el-form-item label="车队" prop="carLicense"> <el-form-item label="车队" prop="carQueueId">
<el-input <el-input
v-model="queryParams.params1" v-model="queryParams.carQueueId"
clearable clearable
style="width: 200px" style="width: 200px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -58,7 +58,7 @@
</el-form-item> </el-form-item>
<el-form-item label="车牌号" prop="carLicense"> <el-form-item label="车牌号" prop="carLicense">
<el-input <el-input
v-model="queryParams.params2" v-model="queryParams.carLicense"
clearable clearable
style="width: 200px" style="width: 200px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
@ -71,59 +71,36 @@
</el-form> </el-form>
<el-table <el-table
:data="tableData"
ref="tableRef1" 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" :data="tableData"
ref="tableRef"
:show-header="false" :show-header="false"
highlight-current-row highlight-current-row
style="width: 100%" style="width: 100%"
@current-change="tableChange" @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> </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-tab-pane>
</el-tabs> </el-tabs>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script setup> <script setup>
import {listBaseCar,getCarGpsList} 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'
@ -133,11 +110,28 @@ const {proxy} = getCurrentInstance();
const {t} = useI18n(); const {t} = useI18n();
const tableRef1 = ref() 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]) tableRef1.value.setCurrentRow(tableData.value[0])
}) tableChange(list[0].id)
const tableChange = (e) => { }
console.log(e)
const tableChange = async (e) => {
const {data:info} = await getCarGpsList({id:e.id})
console.log(info)
cardInfo.value = {
carLicense:info[0].carLicense
}
} }
const cardInfo = ref({ const cardInfo = ref({
@ -145,42 +139,33 @@ const cardInfo = ref({
No: '123', No: '123',
type: '2', type: '2',
line: '3', line: '3',
carLicense:''
}) })
const tabsName = ref('有车载设备车辆') const tabsName = ref('有车载设备车辆')
const queryParams = ref({ const queryParams = ref({
params1: '', pageNum: 1,
params2: '', pageSize: 10,
carQueueId: '',
carLicense: '',
}) })
const tableData = ref([ const tableData = ref([])
{
params3: '1233'
},
{
params3: '1233'
},
{
params3: '1233'
},
{
params3: '1233'
},
{
params3: '1233'
},
])
/** 搜索按钮操作 */ /** 搜索按钮操作 */
function handleQuery() { function handleQuery() {
queryParams.value.pageNum = 1; queryParams.value.pageNum = 1;
// getList(); getList();
} }
/** 重置按钮操作 */ /** 重置按钮操作 */
const resetQuery = () => { const resetQuery = () => {
queryParams.value = { queryParams.value = {
params1: '', pageNum: 1,
params2: '', pageSize: 10,
carQueueId: '',
carLicense: '',
} }
handleQuery(); handleQuery();
tableRef1.value.setCurrentRow() tableRef1.value.setCurrentRow()
@ -210,7 +195,7 @@ AMapLoader.load({
}).catch(e => { }).catch(e => {
console.log(e); console.log(e);
}) })
getList()
</script> </script>
<style> <style>
.container1 { .container1 {
@ -227,7 +212,7 @@ AMapLoader.load({
} }
.el-tabs__item { .el-tabs__item {
width: 50%; width: 100%;
text-align: center; text-align: center;
} }

@ -10,6 +10,7 @@ import AMapLoader from '@amap/amap-jsapi-loader';
import { getCarGpsList, listBasetyre } from '@/api/realTimeMonitoring/vehicleMonitoring' import { getCarGpsList, listBasetyre } from '@/api/realTimeMonitoring/vehicleMonitoring'
import { parseTime } from "@/utils/ruoyi"; import { parseTime } from "@/utils/ruoyi";
const {proxy} = getCurrentInstance();
let map = null let map = null
const treeData = ref([]) const treeData = ref([])
const markers = ref([]) const markers = ref([])
@ -26,6 +27,7 @@ const treeClick = (data) => {
} }
} }
window.$tab = proxy.$tab
const setMarker = async (data, zoom) => { const setMarker = async (data, zoom) => {
const { data: markerArr } = await getCarGpsList(data) const { data: markerArr } = await getCarGpsList(data)
markerArr.forEach((e, index) => { markerArr.forEach((e, index) => {
@ -38,7 +40,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){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> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="form" inline label-width="80px"> <el-form :model="form" inline label-width="80px">
@ -114,7 +115,7 @@
</template> </template>
<script name="basetyre" setup> <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 {Search} from '@element-plus/icons-vue'
import {useI18n} from 'vue-i18n'; import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie"; import Cookies from "js-cookie";

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

Loading…
Cancel
Save