|
|
|
@ -122,7 +122,7 @@
@@ -122,7 +122,7 @@
|
|
|
|
|
import { isArray, isString } from '/@/utils/is'; |
|
|
|
|
import { useI18n } from '/@/hooks/web/useI18n'; |
|
|
|
|
import { useDebounceFn } from '@vueuse/core'; |
|
|
|
|
import { NativeEventSource, EventSourcePolyfill } from 'event-source-polyfill/src/eventsource'; |
|
|
|
|
import { EventSourcePolyfill } from 'event-source-polyfill/src/eventsource'; |
|
|
|
|
import { getAccessToken } from '/@/utils/auth'; |
|
|
|
|
|
|
|
|
|
/** 类型规范统一声明定义区域 */ |
|
|
|
@ -170,7 +170,6 @@
@@ -170,7 +170,6 @@
|
|
|
|
|
let courierUserMarkerCluster; |
|
|
|
|
let scanCourierUserCircleRange; |
|
|
|
|
let driving; |
|
|
|
|
let eventSource; |
|
|
|
|
const { t } = useI18n(); |
|
|
|
|
const emit = defineEmits(['success']); |
|
|
|
|
const userStore = useUserStore(); |
|
|
|
@ -466,8 +465,8 @@
@@ -466,8 +465,8 @@
|
|
|
|
|
orgMarkerCluster?.setData(orgPoints); |
|
|
|
|
|
|
|
|
|
// sse长轮询连接获取收样员gps位置 |
|
|
|
|
const EventSource = EventSourcePolyfill; |
|
|
|
|
eventSource = new EventSource(mapDesigner.sseUrl, { |
|
|
|
|
const eventSource = new EventSourcePolyfill(mapDesigner.sseUrl, { |
|
|
|
|
withCredentials: false, |
|
|
|
|
headers: { Authorization: `Bearer ${getAccessToken()}` } |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -492,8 +491,6 @@
@@ -492,8 +491,6 @@
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
onUnmounted(() => { |
|
|
|
|
console.log('结束'); |
|
|
|
|
eventSource.close(); |
|
|
|
|
if (map) { |
|
|
|
|
// 销毁地图实例 |
|
|
|
|
map.destroy() && map.clearEvents(); |
|
|
|
@ -502,7 +499,6 @@
@@ -502,7 +499,6 @@
|
|
|
|
|
|
|
|
|
|
/** 地图创建完成(动画关闭) */ |
|
|
|
|
function complete () { |
|
|
|
|
eventSource.close(); |
|
|
|
|
if (map) { |
|
|
|
|
map.on('complete', () => { |
|
|
|
|
setMapDataJson(mapProps.options); |
|
|
|
|