diff --git a/src/views/centralScreen/centralScreenD.vue b/src/views/centralScreen/centralScreenD.vue index d8d83e9..86358a4 100644 --- a/src/views/centralScreen/centralScreenD.vue +++ b/src/views/centralScreen/centralScreenD.vue @@ -40,6 +40,7 @@
日累计 - {{ 0 }} + {{ dayInfo?.dayCount || 0 }}
周累计 - {{ 0 }} + {{ dayInfo?.weekCount || 0 }}
月累计 - {{ 0 }} + {{ dayInfo?.monthCount || 0 }}
@@ -113,7 +113,7 @@ import PublicTitle from '/@/components/publicTitle.vue'; import Dialog from '/@/components/dialog/Dialog.vue'; import { Vue3SeamlessScroll } from 'vue3-seamless-scroll'; - import { getMonitorList } from '/@/views/centralScreen/centralScreen.api.ts'; + import { getMonitorList, monitorTotalApi } from '/@/views/centralScreen/centralScreen.api.ts'; import { Map } from '/@/assets/mapUtils/map.ts'; import { caching, useSession } from '/@/hooks/autoRefresh/caching.ts'; import { DataType } from '/@/utils/settings.ts'; @@ -136,6 +136,10 @@ type: Boolean, default: () => false, }, + socketData: { + type: Object, + default: () => {}, + }, }); const { themeType } = useTheme(); const emit = defineEmits(['emit-view-detail']); @@ -156,10 +160,30 @@ address: '', dataValue: '', }); + const dayInfo = ref({}); onMounted(() => { getScrollList(); + // 如果为庆阳应急中心,需调用统计接口 + if (props.setInter) { + interval.value = setInterval(() => { + getScrollList(); + }, 30000); + getStatic(); + } }); + function getStatic() { + monitorTotalApi({ orgCodeList: userStore.getCenterInfo?.serviceScope }) + .then((res: any) => { + if (res.code === 200) { + dayInfo.value = res?.result; + } + }) + .catch((e) => { + console.log(e); + }); + } + /** * @desc open员工信息 */ @@ -184,18 +208,21 @@ const interval = ref(null); const nowDate = ref(dayjs()); - onMounted(() => { - if (props.setInter) { - interval.value = setInterval(() => { - getScrollList(); - }, 30000); - } - }); onUnmounted(() => { interval.value && clearInterval(interval.value); }); + watch( + () => props.socketData, + (v) => { + console.log(v); + if (props.setInter) { + getStatic(); + } + getScrollList(); + } + ); async function getScrollList() { try { let orgCodeList = userStore.getCenterInfo?.serviceScope;