From 6e346af68591080792a66657f325cc27b97f078b Mon Sep 17 00:00:00 2001 From: ko1234 Date: Fri, 18 Jul 2025 18:04:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A0=81=E8=88=87=E8=83=BD=E6=BA=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E8=AA=9E=E8=A8=80=E5=8C=85=20|=20=E8=A8=AD?= =?UTF-8?q?=E5=82=99=E7=AE=A1=E7=90=86=E7=9A=842d=E4=BD=8D=E7=BD=AEdebug?= =?UTF-8?q?=20|=20=E8=A8=AD=E5=82=99=E7=AE=A1=E7=90=86=E7=9A=84=E5=9C=96?= =?UTF-8?q?=E8=B3=87=E8=88=87iot=E5=85=88=E9=9A=B1=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/customUI/Input.vue | 2 +- src/components/navbar/Navbar.vue | 29 ++++++++------- src/config/cn.json | 17 ++++++--- src/config/tw.json | 13 +++++-- src/config/us.json | 17 ++++++--- src/router/index.js | 2 +- .../components/AssetSubListAddModal.vue | 10 +++--- .../components/AssetTableModalLeftInfo.vue | 4 +-- .../components/AssetTableModalRightInfo.vue | 19 +++++++--- .../dashboard/components/DashboardAlert.vue | 12 ++++--- .../components/DashboardEffectScatter.vue | 7 ++-- .../components/DashboardElectricityModal.vue | 2 +- .../components/DashboardEmissionModal.vue | 2 +- .../components/DashboardIndoorTemp.vue | 36 ++++++++++++++----- .../components/DashboardRefrigTemp.vue | 35 ++++++++++++++---- .../energyManagement/EnergyManagement.vue | 8 ++--- .../components/BillingDegreeChart.vue | 26 ++++++++------ .../components/CurrentInformation.vue | 15 ++++---- .../components/ElectricityBillChart.vue | 23 ++++++------ .../components/ImmediateDemandChart.vue | 13 ++++--- .../components/UsageInformation.vue | 8 ++--- 21 files changed, 200 insertions(+), 100 deletions(-) diff --git a/src/components/customUI/Input.vue b/src/components/customUI/Input.vue index 5930c2a..885cbe2 100644 --- a/src/components/customUI/Input.vue +++ b/src/components/customUI/Input.vue @@ -9,7 +9,7 @@ const props = defineProps({ type: String, default: "", }, - value: String, + value: Object || String, isTopLabelExist: { type: Boolean, default: true, diff --git a/src/components/navbar/Navbar.vue b/src/components/navbar/Navbar.vue index d271b3a..db2279d 100644 --- a/src/components/navbar/Navbar.vue +++ b/src/components/navbar/Navbar.vue @@ -21,7 +21,7 @@ const route = useRoute(); const authPages = ref([]); // 儲存從 API 獲取的 authPages const menu_array = ref([]); -const isDrawerOpen = ref(false); +const isDrawerOpen = ref(false); const iniFroList = async () => { try { @@ -69,7 +69,12 @@ watch(locale, () => { diff --git a/src/views/AssetManagement/components/AssetTableModalRightInfo.vue b/src/views/AssetManagement/components/AssetTableModalRightInfo.vue index cea990c..a8ed3e7 100644 --- a/src/views/AssetManagement/components/AssetTableModalRightInfo.vue +++ b/src/views/AssetManagement/components/AssetTableModalRightInfo.vue @@ -34,14 +34,25 @@ const defaultOption = (map, data = []) => { // 生成坐標數據,根據坐標值的不同設置不同顏色 const formattedData = data.map((coordinate) => { const coordString = JSON.stringify(coordinate); + + // 解析 device_coordinate 為數值陣列進行比對 + let isSelected = false; + if (formState.value.device_coordinate) { + try { + const deviceCoord = JSON.parse(formState.value.device_coordinate); + // 比對數值而非字串,避免精度問題 + isSelected = coordinate.length === deviceCoord.length && + coordinate.every((val, index) => Math.abs(val - deviceCoord[index]) < 0.001); + } catch (e) { + console.warn('解析 device_coordinate 失敗:', e); + } + } + return { name: coordString, value: coordinate, itemStyle: { - color: - coordString === formState.value.device_coordinate - ? "#0000FF" - : "#b02a02", + color: isSelected ? "#0000FF" : "#b02a02", }, }; }); diff --git a/src/views/dashboard/components/DashboardAlert.vue b/src/views/dashboard/components/DashboardAlert.vue index dcdeb5d..19fbe43 100644 --- a/src/views/dashboard/components/DashboardAlert.vue +++ b/src/views/dashboard/components/DashboardAlert.vue @@ -2,7 +2,9 @@ import dayjs from "dayjs"; import { computed, ref, onMounted } from "vue"; import { faker } from "@faker-js/faker"; // 引入 faker.js +import { useI18n } from "vue-i18n"; +const { t } = useI18n(); // 假資料 const fakeAlarmData = ref([]); @@ -36,15 +38,15 @@ const alarms = computed(() =>