|
@@ -1,4 +1,4 @@
|
|
-import { onMounted, defineComponent } from 'vue';
|
|
|
|
|
|
+import { onMounted, defineComponent,onUnmounted } from 'vue';
|
|
import MessageCard from './MessageCard';
|
|
import MessageCard from './MessageCard';
|
|
import './index.scss';
|
|
import './index.scss';
|
|
import {
|
|
import {
|
|
@@ -17,6 +17,7 @@ export default defineComponent({
|
|
const commonStore = useCommonStore();
|
|
const commonStore = useCommonStore();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const markerStore = useMarkerStore();
|
|
const markerStore = useMarkerStore();
|
|
|
|
+ var ss = null;
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
commonStore.getGlobalDict('zhdd_incident_level');
|
|
commonStore.getGlobalDict('zhdd_incident_level');
|
|
@@ -29,7 +30,7 @@ export default defineComponent({
|
|
level: 1,
|
|
level: 1,
|
|
})
|
|
})
|
|
|
|
|
|
- setInterval(async () => {
|
|
|
|
|
|
+ ss = setInterval(async () => {
|
|
if ((store.incidents.data ?? []).length > 0) {
|
|
if ((store.incidents.data ?? []).length > 0) {
|
|
var item = store.incidents.data![0];
|
|
var item = store.incidents.data![0];
|
|
markerStore.currentIncident = item;
|
|
markerStore.currentIncident = item;
|
|
@@ -42,6 +43,10 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ onUnmounted(() => {
|
|
|
|
+ clearInterval(ss);
|
|
|
|
+ });
|
|
return () => (
|
|
return () => (
|
|
<div class="home-page-container">
|
|
<div class="home-page-container">
|
|
<MessageCard />
|
|
<MessageCard />
|