From f9ad37c92cd32f5b2a71a60067917ae3953b010f Mon Sep 17 00:00:00 2001 From: yang chen Date: Thu, 8 Jan 2026 10:58:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(screen):=20=E6=9B=B4=E6=96=B0=E9=A3=8E?= =?UTF-8?q?=E9=99=A9=E7=BB=9F=E8=AE=A1=E9=9D=A2=E6=9D=BF=E7=9A=84=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=92=8C=E5=9B=BE=E8=A1=A8=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将标签从"安全类"和"工程类"更新为"安全类事项"和"工程类事项" - 将图表标题从"每日检查(维保类)"等更新为"当日维保"、"本月维保"、"本年维保"等 - 更新类型定义以匹配新的标签名称 - 调整默认图表数据的标题文本 - 更新活动标签的初始值和数据映射逻辑 --- .../screen/components/RiskStatisticsPanel.vue | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) 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 })