From ab007abd72cbdb23c2c2f631a7a86d6335138318 Mon Sep 17 00:00:00 2001 From: ko1234 Date: Fri, 18 Apr 2025 09:44:29 +0800 Subject: [PATCH] =?UTF-8?q?UI=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EnergyLine.vue | 3 ++- src/components/EnergySankey.vue | 2 +- src/router/index.ts | 2 +- vite.config.ts | 5 ++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/EnergyLine.vue b/src/components/EnergyLine.vue index ce3471d..058d616 100644 --- a/src/components/EnergyLine.vue +++ b/src/components/EnergyLine.vue @@ -41,7 +41,7 @@ const data = { }, }, { - name: "偵測值", + name: "復歸值", type: "line", data: [280, 300, 290, 295, 300, 290], smooth: true, @@ -77,6 +77,7 @@ const defaultChartOption = ref({ type: "value", }, series: data.series, + color: ['#5470c6', '#91cc75', '#fac858', '#52aea1'] , }); let chartInstance = null; // 图表实例 diff --git a/src/components/EnergySankey.vue b/src/components/EnergySankey.vue index d51587e..0012265 100644 --- a/src/components/EnergySankey.vue +++ b/src/components/EnergySankey.vue @@ -25,7 +25,7 @@ const initChart = () => { focus: "adjacency", }, data: [ - { name: "總用電" }, + { name: "總用電", itemStyle: { color: '#038a77' } }, { name: "照明" }, { name: "空調" }, { name: "設備A" }, diff --git a/src/router/index.ts b/src/router/index.ts index 8f09826..8677bab 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -3,7 +3,7 @@ import type { RouteRecordRaw } from "vue-router"; const routes: Array = [ { - path: "/:catchAll(.*)", + path: "/:catchAll(.*)?", name: "Home", component: () => import("../views/Home.vue"), children: [ diff --git a/vite.config.ts b/vite.config.ts index c8997f1..c341561 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,7 +6,10 @@ import { ElementPlusResolver } from "unplugin-vue-components/resolvers"; // https://vite.dev/config/ export default defineConfig({ - base: 'https://192.168.0.206:8500/file/ibms_ems_front/', + base: + process.env.NODE_ENV === "production" + ? "https://192.168.0.206:8500/file/ibms_ems_dist/" + : "/", build: { emptyOutDir: true, },