From 11c8bd2131119902e837da41e10005b6b1316c70 Mon Sep 17 00:00:00 2001 From: liutao <790864623@qq.com> Date: Sat, 27 Jun 2026 10:54:23 +0800 Subject: [PATCH] update --- src/locales/en.ts | 54 +++++++++++++ src/locales/zh-CN.ts | 54 +++++++++++++ src/router/modules/remaining.ts | 4 +- .../dashboard1/dashboard3/index.vue | 78 ++++++++++--------- 4 files changed, 150 insertions(+), 40 deletions(-) diff --git a/src/locales/en.ts b/src/locales/en.ts index 25da35c9..5bbc6658 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -177,6 +177,60 @@ export default { } } }, + Dashboard3: { + Header: { + title: 'Device Operation Overview', + subTitle: 'IOT Real-Time Monitoring Center', + currentTime: 'Current Time: ', + lastUpdate: 'Last Updated: ', + refreshRate: 'Refresh: ', + refreshRateValue: 'Every {seconds}s' + }, + Metrics: { + total: 'Total Devices', + online: 'Online', + offline: 'Offline', + running: 'Running', + standby: 'Idle', + fault: 'Alarms' + }, + Status: { + running: 'Running', + standby: 'Idle', + fault: 'Alarm', + offline: 'Offline' + }, + AlarmBoard: { + currentDevice: 'Alarm Device', + todayAlarmDuration: 'Today Alarm Duration', + lastReportTime: 'Last Reported', + alarmPrefix: 'Alarm', + empty: 'No alarm devices' + }, + Detail: { + title: 'Device Operation Details', + carouselText: '{page} · Auto Carousel', + columns: { + deviceName: 'Device Name', + currentStatus: 'Status', + runningTime: 'Running Time (Today)', + standbyTime: 'Idle Time (Today)', + alarmTime: 'Alarm Time (Today)', + efficiency: 'Efficiency (Today)' + }, + empty: 'No device operation data' + }, + Charts: { + last24Hours: 'Last 24 Hours Operation Rate', + last7Days: 'Last 7 Days Operation Rate', + averageRate: 'Average: {value}' + }, + Time: { + minute: '{minute}m', + hour: '{hour}h', + hourMinute: '{hour}h {minute}m' + } + }, Dashboard8: { Header: { title: 'Smart Manufacturing Line Task Overview', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 1a8a9597..c6dfa782 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -177,6 +177,60 @@ export default { } } }, + Dashboard3: { + Header: { + title: '设备运行总览大屏标题', + subTitle: 'IOT 实时监控中心副标题', + currentTime: '当前时间:', + lastUpdate: '最后更新:', + refreshRate: '刷新频率:', + refreshRateValue: '{seconds} 秒刷新' + }, + Metrics: { + total: '设备总数', + online: '在线', + offline: '离线', + running: '运行', + standby: '空闲', + fault: '报警' + }, + Status: { + running: '运行', + standby: '空闲', + fault: '报警', + offline: '离线' + }, + AlarmBoard: { + currentDevice: '当前报警设备', + todayAlarmDuration: '今日累计报警时长', + lastReportTime: '最后上报时间', + alarmPrefix: '报警', + empty: '暂无报警设备' + }, + Detail: { + title: '设备运行明细', + carouselText: '{page} · 自动轮播', + columns: { + deviceName: '设备名称', + currentStatus: '当前状态', + runningTime: '运行时间(今日)', + standbyTime: '空闲时间(今日)', + alarmTime: '报警时间(今日)', + efficiency: '运行效率(今日)' + }, + empty: '暂无设备运行数据' + }, + Charts: { + last24Hours: '近 24 小时运行率趋势', + last7Days: '近 7 天运行率趋势', + averageRate: '平均运行率:{value}' + }, + Time: { + minute: '{minute}分', + hour: '{hour}小时', + hourMinute: '{hour}小时{minute}分' + } + }, Dashboard8: { Header: { title: '智能制造产线任务总览', diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index efc2f1ae..f781c3dc 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -655,10 +655,10 @@ const remainingRouter: AppRouteRecordRaw[] = [ }, { path: '/iot/report/dashboardPage/Dashboard3', - component: () => import('@/views/report/dashboardPage/dashboard3/index.vue'), + component: () => import('@/views/report/dashboardPage/dashboard1/dashboard3/index.vue'), name: 'IotReportDashboard3', meta: { - title: '设备运行总览大屏', + title: t('Dashboard3.Header.title'), hidden: true, noTagsView: true, canTo: true diff --git a/src/views/report/dashboardPage/dashboard1/dashboard3/index.vue b/src/views/report/dashboardPage/dashboard1/dashboard3/index.vue index f02dd17b..f5f90dc5 100644 --- a/src/views/report/dashboardPage/dashboard1/dashboard3/index.vue +++ b/src/views/report/dashboardPage/dashboard1/dashboard3/index.vue @@ -7,14 +7,14 @@
-
IOT 实时监控中心副标题
+
{{ t('Header.subTitle') }}
-

设备运行总览大屏标题

+

{{ t('Header.title') }}

-
当前时间:{{ currentTime }}
-
最后更新:{{ lastUpdateTime || '-' }}
+
{{ t('Header.currentTime') }}{{ currentTime }}
+
{{ t('Header.lastUpdate') }}{{ lastUpdateTime || '-' }}
- 刷新频率:15 秒刷新 + {{ t('Header.refreshRate') }}{{ t('Header.refreshRateValue', { seconds: 15 }) }} @@ -42,34 +42,34 @@
- 当前报警设备 - 今日累计报警时长 - 最后上报时间 + {{ t('AlarmBoard.currentDevice') }} + {{ t('AlarmBoard.todayAlarmDuration') }} + {{ t('AlarmBoard.lastReportTime') }}
{{ item.name }} - 报警 {{ formatMinutes(item.alarmMinutes) }} + {{ t('AlarmBoard.alarmPrefix') }} {{ formatMinutes(item.alarmMinutes) }} {{ item.lastReportTime }}
-
暂无报警设备
+
{{ t('AlarmBoard.empty') }}
-

设备运行明细

- {{ detailPageText }} · 自动轮播 +

{{ t('Detail.title') }}

+ {{ t('Detail.carouselText', { page: detailPageText }) }}
- 设备名称 - 当前状态 - 运行时间(今日) - 空闲时间(今日) - 报警时间(今日) - 运行效率(今日) + {{ t('Detail.columns.deviceName') }} + {{ t('Detail.columns.currentStatus') }} + {{ t('Detail.columns.runningTime') }} + {{ t('Detail.columns.standbyTime') }} + {{ t('Detail.columns.alarmTime') }} + {{ t('Detail.columns.efficiency') }}
{{ formatPercent(row.utilizationRate) }}
-
暂无设备运行数据
+
{{ t('Detail.empty') }}
-

近 24 小时运行率趋势

- 平均运行率:{{ formatPercent(todayAverageRate) }} +

{{ t('Charts.last24Hours') }}

+ {{ t('Charts.averageRate', { value: formatPercent(todayAverageRate) }) }}
-

近 7 天运行率趋势

- 平均运行率:{{ formatPercent(sevenDayAverageRate) }} +

{{ t('Charts.last7Days') }}

+ {{ t('Charts.averageRate', { value: formatPercent(sevenDayAverageRate) }) }}
@@ -123,6 +123,8 @@ import { OrganizationApi } from '@/api/mes/organization' defineOptions({ name: 'IotReportDashboard3' }) +const { t } = useI18n('Dashboard3') + type RunStatus = 'running' | 'standby' | 'fault' | 'offline' interface OrganizationFilterItem { @@ -168,12 +170,12 @@ let clockTimer: number | undefined let refreshTimer: number | undefined let carouselTimer: number | undefined -const statusText: Record = { - running: '运行', - standby: '空闲', - fault: '报警', - offline: '离线' -} +const statusText = computed>(() => ({ + running: t('Status.running'), + standby: t('Status.standby'), + fault: t('Status.fault'), + offline: t('Status.offline') +})) const metricValueMap = computed(() => { return overviewData.value.metrics.reduce>((acc, item) => { @@ -197,7 +199,7 @@ const summaryMap = computed(() => { const statusCards = computed(() => [ { key: 'total', - label: '设备总数', + label: t('Metrics.total'), icon: 'ep:connection', value: overviewData.value.totalDevices || @@ -207,7 +209,7 @@ const statusCards = computed(() => [ }, { key: 'online', - label: '在线', + label: t('Metrics.online'), icon: 'ep:cpu', value: Math.max(0, totalDeviceCount.value - offlineDeviceCount.value), percent: 100 - (summaryMap.value.offline || 0), @@ -215,7 +217,7 @@ const statusCards = computed(() => [ }, { key: 'offline', - label: '离线', + label: t('Metrics.offline'), icon: 'ep:link', value: offlineDeviceCount.value, percent: summaryMap.value.offline || 0, @@ -223,7 +225,7 @@ const statusCards = computed(() => [ }, { key: 'running', - label: '运行', + label: t('Metrics.running'), icon: 'ep:video-play', value: getMetricValue(['running', 'run', 'runningDevices']) ?? getRowsByStatus('running').length, percent: summaryMap.value.running || 0, @@ -231,7 +233,7 @@ const statusCards = computed(() => [ }, { key: 'standby', - label: '空闲', + label: t('Metrics.standby'), icon: 'ep:video-pause', value: getMetricValue(['standby', 'idle', 'standbyDevices']) ?? getRowsByStatus('standby').length, percent: summaryMap.value.standby || 0, @@ -239,7 +241,7 @@ const statusCards = computed(() => [ }, { key: 'fault', - label: '报警', + label: t('Metrics.fault'), icon: 'ep:bell', value: getMetricValue(['fault', 'alarm', 'faultDevices']) ?? getRowsByStatus('fault').length, percent: summaryMap.value.fault || 0, @@ -303,9 +305,9 @@ const formatMinutes = (minutes: number) => { const safeMinutes = Math.max(0, Math.round(minutes || 0)) const hours = Math.floor(safeMinutes / 60) const rest = safeMinutes % 60 - if (!hours) return `${rest}分` - if (!rest) return `${hours}小时` - return `${hours}小时${rest}分` + if (!hours) return t('Time.minute', { minute: rest }) + if (!rest) return t('Time.hour', { hour: hours }) + return t('Time.hourMinute', { hour: hours, minute: rest }) } const average = (values: number[]) => {