feat:完善功能

This commit is contained in:
zjc
2025-02-23 12:52:09 +08:00
parent 2d881eae08
commit 7e822f1c66
9 changed files with 82 additions and 126 deletions

View File

@@ -5,7 +5,7 @@
<div class="flex">
<div class="list-box">
<title2 title="车船" />
<el-input v-model="value" clearable placeholder="设备号/设备名称SIM卡号">
<el-input v-model="keyword" clearable placeholder="设备号/设备名称SIM卡号">
<template #suffix>
<img src="@/assets/images/search-icon-1.png" alt="" />
</template>
@@ -41,6 +41,8 @@
</template>
<script setup>
import { getGpsListApi } from '@/api/scenic'
import closeIcon from '@/assets/images/close.png'
import carIcon from '@/assets/images/car.png'
import shipIcon from '@/assets/images/ship.png'
@@ -55,10 +57,13 @@
import { useMap } from '@/hooks/map'
let modelValue = defineModel()
const { map, marker, initMap, addMarker } = useMap()
let props = defineProps({
scenicSpotId: {
type: String,
default: ''
},
carList: {
type: Array,
default: () => []
@@ -68,10 +73,13 @@
default: () => []
}
})
let modelValue = defineModel()
let lat = ref('')
let lng = ref('')
let value = ref('')
let scenicSpotId = ref('')
let keyword = ref('')
let status = ref('')
let active = ref(0)
let current = ref('')
let scenicChange = null
@@ -214,7 +222,7 @@
const setHtml = (data) => {
let html = `<div class='marker-box'>
<p class='marker-title'> ${data?.license_number} </p>
<div class='marker-header'>
<div class='marker-header'>
<span class='marker-sim'> ${data?.imei} </span>
<div class='marker-tag'> <div></div> ${data.status} ${data.status_time_desc}</div>
</div>
@@ -270,10 +278,20 @@
active.value = index
}
const getGpsList = async () => {
let res = await getGpsListApi({
scenicSpotId: scenicSpotId.value,
keyword: keyword.value,
status: status.value
})
}
onMounted(() => {
scenicChange = PubSub.subscribe('scenicChange', (msg, data) => {
scenicSpotId.value = data.scenicSpotId
lat.value = data.lat
lng.value = data.lng
getGpsList()
})
})
onUnmounted(() => {