|
@@ -155,6 +155,7 @@ import { Modal } from 'ant-design-vue'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import type { VehicleInfo, VehicleResponse } from './types'
|
|
|
import { mqttInstants, InitMqtt } from '../../utils/mqtt'
|
|
|
+import { debounce } from 'lodash'
|
|
|
|
|
|
const route = useRoute()
|
|
|
const ccmNo = route.params.ccmNo || '5'
|
|
@@ -403,13 +404,13 @@ const editInfo = (params: { licensePlate?: string; arriveNum?: string | number }
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-const onMessage = (msg: Record<string, string>) => {
|
|
|
+const onMessage = debounce((msg: Record<string, string>) => {
|
|
|
const { car, position } = msg
|
|
|
console.log('接收到了onMessage消息 = ', msg)
|
|
|
if (!car || Number(positionNo) !== Number(position)) return
|
|
|
arriveNo.value = position
|
|
|
getVehicleInfo(car)
|
|
|
-}
|
|
|
+}, 10000)
|
|
|
|
|
|
onMounted(() => {
|
|
|
getCars()
|