diff --git a/.env b/.env index 5957fa8..5d7a2d7 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -VITE_FILE_API_BASEURL = "https://192.168.0.206:8500" \ No newline at end of file +VITE_FILE_API_BASEURL = ".." \ No newline at end of file diff --git a/public/build.jpg b/public/build.jpg deleted file mode 100644 index 37f250a..0000000 Binary files a/public/build.jpg and /dev/null differ diff --git a/public/config.json b/public/config.json index c47a853..8b50faa 100644 --- a/public/config.json +++ b/public/config.json @@ -1,4 +1,3 @@ { - "systemName": "關渡醫院中央監控", "is3D": true } diff --git a/src/components/dashboard/dashboardAlert.vue b/src/components/dashboard/dashboardAlert.vue index ec8be4b..effc953 100644 --- a/src/components/dashboard/dashboardAlert.vue +++ b/src/components/dashboard/dashboardAlert.vue @@ -1,22 +1,19 @@ - user_icon + user_icon {{ props.userName }} @@ -173,17 +177,31 @@ watch( diff --git a/src/stores/useElecDemandStore.js b/src/stores/useElecDemandStore.js index d234f43..eb575c3 100644 --- a/src/stores/useElecDemandStore.js +++ b/src/stores/useElecDemandStore.js @@ -13,7 +13,7 @@ const useElecDemandStore = defineStore("elecDemand", () => { window.requirejs(["baja!"], (baja) => { let eleclist = []; baja.Ord.make( - `local:|foxs:4918|station:|neql:EMS:kw|bql:select slotPath,parent.displayName,name,out` + `local:|foxs:|station:|neql:EMS:kw|bql:select slotPath,parent.displayName,name,out` ).get({ cursor: { before: () => {}, @@ -40,7 +40,7 @@ const useElecDemandStore = defineStore("elecDemand", () => { const subscribeToHistory = (item, index) => { const slotPath = item.slotPath; - const ordString = `local:|foxs:4918|station:|${slotPath}`; + const ordString = `local:|foxs:|station:|${slotPath}`; // @ts-ignore window.require && diff --git a/src/stores/useElecTotalMeterStore.js b/src/stores/useElecTotalMeterStore.js index ec60291..c36623c 100644 --- a/src/stores/useElecTotalMeterStore.js +++ b/src/stores/useElecTotalMeterStore.js @@ -18,7 +18,7 @@ const useElecStore = defineStore("elecData", () => { console.log("進入 bajaSubscriber 準備執行用電價 BQL 訂閱"); // 定義BQL 查詢 - const price_kwhBql = `local:|foxs:4918|station:|neql:EMS:parameter|bql:select slotPath,parent.displayName,displayName,NumericInterval.historyConfig.id,out`; + const price_kwhBql = `local:|foxs:|station:|neql:EMS:parameter|bql:select slotPath,parent.displayName,displayName,NumericInterval.historyConfig.id,out`; // 執行查詢 let pricelist = []; @@ -45,7 +45,7 @@ const useElecStore = defineStore("elecData", () => { console.log("進入 bajaSubscriber 準備執行用電度數 BQL 訂閱"); // 定義BQL 查詢 - const Total_kwhBql = `local:|foxs:4918|station:|neql:EMS:Total_kwh|bql:select slotPath,parent.displayName,displayName,NumericInterval.historyConfig.id,out`; + const Total_kwhBql = `local:|foxs:|station:|neql:EMS:Total_kwh|bql:select slotPath,parent.displayName,displayName,NumericInterval.historyConfig.id,out`; // 執行各電表的 BQL 查詢 let eleclist = []; @@ -85,7 +85,7 @@ const useElecStore = defineStore("elecData", () => { .endOf("day") .format("YYYY-MM-DDTHH:mm:ss.000+08:00"); - const ordString = `local:|foxs:4918|history:${id}?period=timerange;start=${startTime};end=${endTime}|bql:history:HistoryRollup.rollup(baja:RelTime '3600000')`; //每小时一个rollup + const ordString = `local:|foxs:|history:${id}?period=timerange;start=${startTime};end=${endTime}|bql:history:HistoryRollup.rollup(baja:RelTime '3600000')`; //每小时一个rollup console.log(ordString); // @ts-ignore window.require && diff --git a/src/stores/useWeatherDataStore.js b/src/stores/useWeatherDataStore.js index a905aeb..e3f3bf7 100644 --- a/src/stores/useWeatherDataStore.js +++ b/src/stores/useWeatherDataStore.js @@ -5,6 +5,7 @@ import { imagesWeatherNight, orderWeather, } from "@/constants"; +import dayjs from "dayjs"; const useWeatherDataStore = defineStore("weatherData", () => { const weatherStateText = ref("N/A"); @@ -13,7 +14,8 @@ const useWeatherDataStore = defineStore("weatherData", () => { const temperature = ref("N/A"); const humidity = ref("N/A"); const actualNighttime = ref(false); - const dateTime = ref("N/A"); + const dateTime = ref(dayjs().format("YYYY-MM-DD HH:mm:ss")); + const intervalId = ref(null); const subscribers = ref([]); const subscribeToWeather = () => { @@ -89,22 +91,32 @@ const useWeatherDataStore = defineStore("weatherData", () => { }; const updateTime = () => { - const date = new Date(); - window.require && - window.requirejs(["baja!"], (baja) => { - const bAbsTime = baja.AbsTime.make({ jsDate: date }); - bAbsTime - .toDateTimeString() - .then((dateTimeStr) => { - dateTime.value = dateTimeStr; - }) - .catch((error) => { - console.error("轉換時間字串失敗:", error); - }); - }); + dateTime.value = dayjs().format("YYYY-MM-DD HH:mm:ss"); + // const date = new Date(); + // window.require && + // window.requirejs(["baja!"], (baja) => { + // const bAbsTime = baja.AbsTime.make({ jsDate: date }); + // bAbsTime + // .toDateTimeString() + // .then((dateTimeStr) => { + // dateTime.value = dateTimeStr; + // }) + // .catch((error) => { + // console.error("轉換時間字串失敗:", error); + // }); + // }); }; - const clearAllSubscriber = () => { + const startUpdateTimeInterval = () => { // 新增啟動 interval 的方法 + intervalId.value = setInterval(updateTime, 1000); + }; + + const stopUpdateTimeInterval = () => { // 新增清除 interval 的方法 + clearInterval(intervalId.value); + intervalId.value = null; + }; + + const clearAllSubscriber = () => { subscribers.value.forEach((subscriber) => { subscriber.detach("changed"); }); @@ -119,9 +131,12 @@ const useWeatherDataStore = defineStore("weatherData", () => { humidity, actualNighttime, dateTime, + intervalId, // 暴露 intervalId subscribeToWeather, updateTime, clearAllSubscriber, + startUpdateTimeInterval, // 暴露啟動 interval 的方法 + stopUpdateTimeInterval, }; }); diff --git a/src/style.css b/src/style.css index 5fa03aa..bcd1bc8 100644 --- a/src/style.css +++ b/src/style.css @@ -7,3 +7,7 @@ a { color: #69b0cf; } +a:hover, +a:active { + color: #69b0cf96; +} diff --git a/src/views/dashboard/DashboardPage.vue b/src/views/dashboard/DashboardPage.vue index 37bed6c..1b296c9 100644 --- a/src/views/dashboard/DashboardPage.vue +++ b/src/views/dashboard/DashboardPage.vue @@ -250,7 +250,7 @@ onUnmounted(() => { - +