diff --git a/src/views/screen/components/RiskStatisticsPanel.vue b/src/views/screen/components/RiskStatisticsPanel.vue index 6216185..5de6bf4 100644 --- a/src/views/screen/components/RiskStatisticsPanel.vue +++ b/src/views/screen/components/RiskStatisticsPanel.vue @@ -2,9 +2,9 @@
- 安全类 + 安全类事项 | - 工程类 + 工程类事项
@@ -49,7 +49,7 @@ import { computed, ref, watch } from 'vue' import { ElTooltip } from 'element-plus' import type { EChartsOption } from 'echarts' -type TabType = '安全类' | '工程类' +type TabType = '安全类事项' | '工程类事项' type StatusKey = 'notStarted' | 'inProgress' | 'done' | 'voided' interface ChartItem { @@ -67,12 +67,12 @@ const statusList: { key: StatusKey; label: string; color: string }[] = [ ] const defaultChart: ChartItem[] = [ - { title: '每日检查(维保类)', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, - { title: '每月检查(维保类)', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, - { title: '每年检查(维保类)', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, - { title: '每日检查(巡检类)', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, - { title: '每月检查(巡检类)', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, - { title: '每年检查(巡检类)', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } } + { title: '当日维保', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, + { title: '本月维保', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, + { title: '本年维保', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, + { title: '当日巡检', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, + { title: '本月巡检', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } }, + { title: '本年巡检', total: 6, rate: 0, status: { notStarted: 3, inProgress: 0, done: 3, voided: 0 } } ] const handleChartTitleClick = () => { @@ -80,23 +80,23 @@ const handleChartTitleClick = () => { } const tabCharts = ref>({ - 安全类: [...defaultChart], - 工程类: [...defaultChart] + 安全类事项: [...defaultChart], + 工程类事项: [...defaultChart] }) const props = defineProps<{ riskStatistics?: Record }>() -const activeTab = ref('安全类') +const activeTab = ref('安全类事项') const emit = defineEmits<{ tabChange: [tab: TabType] }>() // 监听props变化,更新图表数据 watch(() => props.riskStatistics, (newData) => { if (newData) { tabCharts.value = { - 安全类: newData['安全类'] ? JSON.parse(JSON.stringify(newData['安全类'])) : [...defaultChart], - 工程类: newData['工程类'] ? JSON.parse(JSON.stringify(newData['工程类'])) : [...defaultChart] + 安全类事项: newData['安全类事项'] ? JSON.parse(JSON.stringify(newData['安全类事项'])) : [...defaultChart], + 工程类事项: newData['工程类事项'] ? JSON.parse(JSON.stringify(newData['工程类事项'])) : [...defaultChart] } } }, { deep: true, immediate: true })