diff --git a/.env.development b/.env.development index 8988210..6da8916 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -VITE_API_BASEURL = "https://ibms-cvilux-demo-api.production.mjmtech.com.tw" +VITE_API_BASEURL = "https://ibms-cvilux-api.production.mjmtech.com.tw" VITE_FILE_API_BASEURL = "https://cgems.cvilux-group.com:8088" VITE_MQTT_BASEURL = "wss://mqttwss.mjm-staging.developers-homelab.net" VITE_FORGE_BASEURL = "https://cgems.cvilux-group.com:8088/dist" \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index bbcdcfb..ee05952 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,6 +9,7 @@ import AlertManagement from "@/views/alert/AlertManagement.vue"; import ProductSetting from "@/views/productSetting/ProductSetting.vue"; import EnergyManagement from "@/views/energyManagement/EnergyManagement.vue"; import SettingManagement from "@/views/setting/SettingManagement.vue"; +import HeadquartersManagement from "@/views/headquarters/HeadquartersManagement.vue"; import Login from "@/views/login/Login.vue"; import useUserInfoStore from "@/stores/useUserInfoStore"; import useGetCookie from "@/hooks/useGetCookie"; @@ -90,6 +91,11 @@ const router = createRouter({ name: "setting", component: SettingManagement, }, + { + path: "/headquarters", + name: "headquarters", + component: HeadquartersManagement, + }, { path: "/mytestfile/mjm", name: "mytestfile", @@ -101,7 +107,7 @@ const router = createRouter({ router.beforeEach(async (to, from, next) => { console.log("route", to, location, document.cookie); // redirect to login page if not logged in and trying to access a restricted page - const publicPages = ["/login", "/"]; + const publicPages = ["/login", "/", "/headquarters"]; const authRequired = !publicPages.includes(to.path); const auth = useUserInfoStore(); const token = useGetCookie("JWT-Authorization"); @@ -110,7 +116,7 @@ router.beforeEach(async (to, from, next) => { if ((authRequired && !token) || to.path === "/") { auth.user.token = ""; next({ path: "/login" }); - } else if (!authRequired) { + } else if (!authRequired && (to.path === "/login" || to.path === "/")) { document.cookie = "JWT-Authorization=; Max-Age=0"; document.cookie = "user_name=; Max-Age=0"; auth.user.token = ""; diff --git a/src/views/headquarters/HeadquartersManagement.vue b/src/views/headquarters/HeadquartersManagement.vue new file mode 100644 index 0000000..8b37a85 --- /dev/null +++ b/src/views/headquarters/HeadquartersManagement.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/src/views/headquarters/components/ElecCompare.vue b/src/views/headquarters/components/ElecCompare.vue new file mode 100644 index 0000000..19f7fef --- /dev/null +++ b/src/views/headquarters/components/ElecCompare.vue @@ -0,0 +1,305 @@ + + + + + diff --git a/src/views/headquarters/components/ElecRank.vue b/src/views/headquarters/components/ElecRank.vue new file mode 100644 index 0000000..232de2a --- /dev/null +++ b/src/views/headquarters/components/ElecRank.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/src/views/headquarters/components/ElecTrends.vue b/src/views/headquarters/components/ElecTrends.vue new file mode 100644 index 0000000..f16c67d --- /dev/null +++ b/src/views/headquarters/components/ElecTrends.vue @@ -0,0 +1,226 @@ + + + + + \ No newline at end of file diff --git a/src/views/headquarters/components/SysProgress.vue b/src/views/headquarters/components/SysProgress.vue new file mode 100644 index 0000000..f66fa8b --- /dev/null +++ b/src/views/headquarters/components/SysProgress.vue @@ -0,0 +1,143 @@ + + + + +