|
@@ -51,9 +51,6 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="data-line">
|
|
<div class="data-line">
|
|
- <!-- <AlarmHistoryCard></AlarmHistoryCard>
|
|
|
|
- <FallingHistoryCard></FallingHistoryCard> -->
|
|
|
|
-
|
|
|
|
<HistoryChartCard
|
|
<HistoryChartCard
|
|
title="历史告警统计"
|
|
title="历史告警统计"
|
|
:dayStatInfo="[
|
|
:dayStatInfo="[
|
|
@@ -113,15 +110,13 @@ import PeopleDetectedCard from './components/PeopleDetectedCard/index.vue'
|
|
import DeviceLocationCard from './components/DeviceLocationCard/index.vue'
|
|
import DeviceLocationCard from './components/DeviceLocationCard/index.vue'
|
|
import DeviceAgeCard from './components/DeviceAgeCard/index.vue'
|
|
import DeviceAgeCard from './components/DeviceAgeCard/index.vue'
|
|
import ObjectDistributionCard from './components/ObjectDistributionCard/index.vue'
|
|
import ObjectDistributionCard from './components/ObjectDistributionCard/index.vue'
|
|
-// import AlarmHistoryCard from './components/AlarmHistoryCard/index.vue'
|
|
|
|
-// import FallingHistoryCard from './components/FallingHistoryCard/index.vue'
|
|
|
|
import HistoryChartCard from './components/HistoryChartCard/index.vue'
|
|
import HistoryChartCard from './components/HistoryChartCard/index.vue'
|
|
import { useUserStore } from '@/stores/user'
|
|
import { useUserStore } from '@/stores/user'
|
|
import type { TodayData } from './types'
|
|
import type { TodayData } from './types'
|
|
import { ZoomInOutlined, ZoomOutOutlined, RedoOutlined } from '@ant-design/icons-vue'
|
|
import { ZoomInOutlined, ZoomOutOutlined, RedoOutlined } from '@ant-design/icons-vue'
|
|
import { useResponsiveLayout } from '@/utils/chartManager'
|
|
import { useResponsiveLayout } from '@/utils/chartManager'
|
|
import { useDashboardPolling } from '@/hooks/useDashboardPolling'
|
|
import { useDashboardPolling } from '@/hooks/useDashboardPolling'
|
|
-import { deviceInstallPositionNameMap } from '@/const/device'
|
|
|
|
|
|
+import { useDict } from '@/hooks/useDict'
|
|
|
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
const tenantName = (userStore.userInfo.tenantName ?? '雷能技术') + ' 智慧大屏'
|
|
const tenantName = (userStore.userInfo.tenantName ?? '雷能技术') + ' 智慧大屏'
|
|
@@ -171,21 +166,38 @@ const { todayScreenData, fallHistoryData, alarmHistoryData } = useDashboardPolli
|
|
queryType: 'day',
|
|
queryType: 'day',
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+const { fetchDict: fetchDictGuardianship, dictNameMap: guardTypeNameMap } =
|
|
|
|
+ useDict('guardianship_type')
|
|
|
|
+fetchDictGuardianship()
|
|
|
|
+
|
|
|
|
+const { fetchDict: fetchDictInstallPosition, dictNameMap: installPositionNameMap } =
|
|
|
|
+ useDict('install_position')
|
|
|
|
+fetchDictInstallPosition().then(() => {
|
|
|
|
+ console.log('🚀🚀🚀 installPositionNameMap.value', installPositionNameMap.value)
|
|
|
|
+})
|
|
|
|
+
|
|
watch(
|
|
watch(
|
|
() => todayScreenData.value,
|
|
() => todayScreenData.value,
|
|
(val) => {
|
|
(val) => {
|
|
console.log('todayScreenData更新了', val)
|
|
console.log('todayScreenData更新了', val)
|
|
todayData.value = val || todayData.value
|
|
todayData.value = val || todayData.value
|
|
- todayData.value.guardList = val?.guardList ?? []
|
|
|
|
- todayData.value.ageList = val?.ageList ?? []
|
|
|
|
|
|
+ todayData.value.ageList = val?.ageList.filter((item) => item.count > 0) ?? []
|
|
todayData.value.installPositionList =
|
|
todayData.value.installPositionList =
|
|
val?.installPositionList.map((item) => ({
|
|
val?.installPositionList.map((item) => ({
|
|
...item,
|
|
...item,
|
|
name:
|
|
name:
|
|
- deviceInstallPositionNameMap[
|
|
|
|
- item.installPosition as keyof typeof deviceInstallPositionNameMap
|
|
|
|
|
|
+ installPositionNameMap.value[
|
|
|
|
+ item.installPosition as keyof typeof installPositionNameMap.value
|
|
] || '未知',
|
|
] || '未知',
|
|
- })) || []
|
|
|
|
|
|
+ names: installPositionNameMap.value,
|
|
|
|
+ })) ?? []
|
|
|
|
+ todayData.value.guardList =
|
|
|
|
+ todayData.value.guardList.map((item) => ({
|
|
|
|
+ ...item,
|
|
|
|
+ name:
|
|
|
|
+ guardTypeNameMap.value[item.guardType as keyof typeof guardTypeNameMap.value] || '未知',
|
|
|
|
+ names: guardTypeNameMap.value,
|
|
|
|
+ })) ?? []
|
|
},
|
|
},
|
|
{ immediate: true }
|
|
{ immediate: true }
|
|
)
|
|
)
|