From 8c3e6b18f8ea34fb12a869b3bf30670ec27fc546 Mon Sep 17 00:00:00 2001 From: ko1234 Date: Mon, 11 Nov 2024 09:52:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A0=81:=20=E7=94=A8=E9=9B=BB?= =?UTF-8?q?=E6=AF=94=E8=BC=83=E4=BF=AE=E6=94=B9=20|=20=E7=B3=BB=E7=B5=B1?= =?UTF-8?q?=E7=9B=A3=E6=8E=A7=E5=85=83=E4=BB=B6=E5=8D=B8=E8=BC=89=E6=99=82?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=A8=88=E6=99=82=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/cn.json | 2 ++ src/config/tw.json | 2 ++ src/config/us.json | 2 ++ .../components/DashboardElecChart.vue | 23 ++++++++++--------- src/views/system/System.vue | 5 +++- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/config/cn.json b/src/config/cn.json index 0c74f64..aadea3c 100644 --- a/src/config/cn.json +++ b/src/config/cn.json @@ -17,6 +17,8 @@ "dashboard": { "yesterday_today": "昨天/今天", "elec_consumption_comparison": "用电量比较", + "elec_consumption_comparison_trend": "用电量比较趋势", + "electricity_consumption": "用电量", "today_electricity_consumption": "今日用电量", "yesterday_electricity_consumption": "昨天用电量", "this_last_week": "本周/上周", diff --git a/src/config/tw.json b/src/config/tw.json index d2b5056..63a1f3b 100644 --- a/src/config/tw.json +++ b/src/config/tw.json @@ -17,6 +17,8 @@ "dashboard": { "yesterday_today": "昨天/今天", "elec_consumption_comparison": "用電量比較", + "elec_consumption_comparison_trend": "用電量比較趨勢", + "electricity_consumption": "用電量", "today_electricity_consumption": "今日用電量", "yesterday_electricity_consumption": "昨天用電量", "this_last_week": "本週/上週", diff --git a/src/config/us.json b/src/config/us.json index 2409cd0..5afce41 100644 --- a/src/config/us.json +++ b/src/config/us.json @@ -35,6 +35,8 @@ "dashboard": { "yesterday_today": "Yesterday / Today's", "elec_consumption_comparison": "Electricity Consumption Comparison", + "elec_consumption_comparison_trend": "Electricity Consumption Comparison Trend", + "electricity_consumption": "electricity consumption", "today_electricity_consumption": "Today’s electricity consumption", "yesterday_electricity_consumption": "Yesterday’s electricity consumption", "this_last_week": "This Week's / Last Week's", diff --git a/src/views/dashboard/components/DashboardElecChart.vue b/src/views/dashboard/components/DashboardElecChart.vue index dce4bb9..65bfe02 100644 --- a/src/views/dashboard/components/DashboardElecChart.vue +++ b/src/views/dashboard/components/DashboardElecChart.vue @@ -2,18 +2,19 @@ import { ref, onMounted } from "vue"; import * as echarts from "echarts"; import BarChart from "@/components/chart/BarChart.vue"; - +import { useI18n } from "vue-i18n"; +const { t } = useI18n(); // 定義用電比較資料 const yesterdayTodayData = { - categories: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + categories: ["00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00"], values: [ { - name: "Today's electricity consumption", - value: [8, 8, 8, 8, 8, 15, 25, 65, 75, 60], + name: `2024.10.21 ${t("dashboard.electricity_consumption")}`, + value: [8, 8, 8, 8, 8, 15, 25, 65, 75, 60, 70, 65], }, { - name: "Yesterday's electricity consumption", - value: [10, 10, 10, 10, 10, 20, 30, 80, 90, 70], + name: `2024.10.20 ${t("dashboard.electricity_consumption")}`, + value: [10, 10, 10, 10, 10, 20, 30, 80, 90, 70, 80, 85], }, ], }; @@ -23,11 +24,11 @@ const weekComparisonData = { categories: ["Fri", "Sat", "Sun", "Mon", "Tue", "Wed", "Thu"], values: [ { - name: "This week's electricity consumption", + name: `${t("dashboard.thisweek_electricity_consumption")}`, value: [850, 200, 350, 850, 950, 950, 900], }, { - name: "Last week's electricity consumption", + name: `${t("dashboard.lastweek_electricity_consumption")}`, value: [800, 150, 300, 750, 900, 900, 800], }, ], @@ -201,17 +202,17 @@ const weekComparisonOption = generateCylinderChartOption(

{{ $t("dashboard.yesterday_today") }}
- {{ $t("dashboard.elec_consumption_comparison") }} + {{ $t("dashboard.elec_consumption_comparison_trend") }} (kWH)

- {{ $t("dashboard.today_electricity_consumption") }} + 2024.10.20 {{ $t("dashboard.electricity_consumption") }}
- {{ $t("dashboard.yesterday_electricity_consumption") }} + 2024.10.21 {{ $t("dashboard.electricity_consumption") }}
diff --git a/src/views/system/System.vue b/src/views/system/System.vue index 3ecaf2a..f8895a5 100644 --- a/src/views/system/System.vue +++ b/src/views/system/System.vue @@ -1,6 +1,6 @@