From 8e2b5e1e2cd2f6708b5892d29a944f81870e224a Mon Sep 17 00:00:00 2001 From: ko1234 Date: Fri, 24 Jan 2025 10:43:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=85=A5=E5=B8=B3=E8=99=9F=E7=B4=80?= =?UTF-8?q?=E9=8C=84cookie=20|=20table=E7=9A=84=E9=81=8E=E6=BF=BE=E7=AF=A9?= =?UTF-8?q?=E9=81=B8=E5=8F=AF=E4=BB=A5=E8=BC=B8=E5=85=A5=E9=97=9C=E9=8D=B5?= =?UTF-8?q?=E5=AD=97=20|=20=E8=83=BD=E6=BA=90=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=83=BD=E6=BA=90=E5=88=86=E6=9E=90=E3=80=81?= =?UTF-8?q?=E8=83=BD=E8=99=9F=E5=A0=B1=E8=A1=A8=20|=20=E5=B8=B3=E8=99=9F?= =?UTF-8?q?=E7=AE=A1=E7=90=86:=E9=81=8E=E6=BF=BEwebUser=E3=80=81admin=20|?= =?UTF-8?q?=20=E5=91=8A=E8=AD=A6=E8=A8=AD=E5=AE=9A:=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AD=A6=E7=A4=BA=E6=99=82=E9=96=93=20|=20=E8=A8=AD=E5=82=99?= =?UTF-8?q?=E7=AE=A1=E7=90=86:=20iot=E6=AC=84=E4=BD=8D=E9=A0=90=E8=A8=AD?= =?UTF-8?q?=E3=80=81tag=5Fname=E5=8F=AA=E6=9C=89=E5=9C=A8webUser=E6=99=82?= =?UTF-8?q?=E9=A1=AF=E7=A4=BA=E3=80=81=E7=B3=BB=E7=B5=B1=E9=A1=9E=E5=88=A5?= =?UTF-8?q?=E5=92=8C=E8=A8=AD=E5=82=99=E9=A1=9E=E5=88=A5=E7=9A=84=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=99=82=E5=A6=82=E6=9E=9C=E6=B2=92=E6=9C=89subSys=5F?= =?UTF-8?q?id=E6=99=82=E8=A1=A8=E6=A0=BC=E6=B8=85=E7=A9=BA=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E8=A8=AD=E5=82=99=E6=8C=89=E9=88=95=E4=B9=9F=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=8C=89=E3=80=81=E6=A8=93=E5=B1=A42d=E5=9C=96?= =?UTF-8?q?=E6=9B=B4=E6=96=B0bug=E4=BF=AE=E6=AD=A3=20|=20=E7=B3=BB?= =?UTF-8?q?=E7=B5=B1=E7=9B=A3=E6=8E=A7:=20=E7=B3=BB=E7=B5=B1=E5=B0=8F?= =?UTF-8?q?=E5=8D=A1=E7=9A=84desktop=E8=A6=81=E6=A0=B9=E6=93=9Aori=5Fdevic?= =?UTF-8?q?e=5Fname=E5=88=86=E9=A1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/alert/api.js | 4 + src/apis/alert/index.js | 34 +++ src/apis/asset/api.js | 2 + src/apis/asset/index.js | 14 +- src/apis/energy/api.js | 6 +- src/apis/energy/index.js | 22 +- src/apis/history/index.js | 10 +- src/apis/login/index.js | 4 + src/components/customUI/DateGroup.vue | 2 +- src/components/customUI/Table.vue | 58 ++-- src/components/navbar/NavbarItem.vue | 46 ++- src/config/cn.json | 29 +- src/config/tw.json | 41 ++- src/config/us.json | 29 +- src/router/index.js | 12 +- src/stores/useUserInfoStore.js | 1 + src/views/AssetManagement/AssetManagement.vue | 36 +++ .../components/AssetMainList.vue | 1 - .../AssetManagement/components/AssetTable.vue | 3 +- .../components/AssetTableAddModal.vue | 2 +- .../components/AssetTableModalLeftInfo.vue | 38 ++- .../components/AssetTableModalLeftInfoIoT.vue | 1 + .../components/AssetTableModalRightInfo.vue | 65 +++-- .../accountManagement/components/Account.vue | 11 +- .../AlertSetting/AlertOutliersTable.vue | 29 +- .../AlertOutliersTableAddModal.vue | 11 +- .../components/AlertSetting/AlertSetting.vue | 21 +- .../AlertSetting/AlertTimeTable.vue | 110 +++++++ ...meModal.vue => AlertTimeTableAddModal.vue} | 269 ++++++++++-------- .../energyManagement/EnergyManagement.vue | 75 ++--- .../{ => EnergyChart}/BillingDegreeChart.vue | 0 .../{ => EnergyChart}/CarbonEmissionChart.vue | 0 .../{ => EnergyChart}/CarbonEmissionModal.vue | 0 .../{ => EnergyChart}/ElecConsumption.vue | 0 .../components/EnergyChart/EnergyChart.vue | 54 ++++ .../ImmediateDemandChart.vue | 0 .../ImmediateDemandModal.vue | 0 .../{ => EnergyChart}/IntervalBillChart.vue | 0 .../MonthlyElecBillChart.vue | 0 .../{ => EnergyChart}/UsageInformation.vue | 0 .../EnergyHistoryTable/EnergyActionButton.vue | 127 +++++++++ .../EnergyHistoryTable/EnergyDataCahrt.vue | 157 ++++++++++ .../EnergyHistoryTable/EnergyDataTable.vue | 170 +++++++++++ .../EnergyHistoryTable/EnergyHistoryTable.vue | 37 +++ .../EnergyHistoryTable/EnergySearch.vue | 245 ++++++++++++++++ .../EnergyHistoryTable/EnergySearchTime.vue | 116 ++++++++ .../EnergyHistoryTable/EnergySidebar.vue | 261 +++++++++++++++++ .../components/EnergyReport/EnergyReport.vue | 23 ++ .../EnergyReport/EnergyReportSearch.vue | 186 ++++++++++++ .../EnergyReport/EnergyReportTable.vue | 33 +++ .../EnergyReport/EnergyReportTimeRange.vue | 129 +++++++++ .../history/components/HistorySidebar.vue | 4 +- .../system/components/SystemInfoModal.vue | 2 +- .../components/SystemInfoModalDesktop.vue | 99 ++++--- 54 files changed, 2294 insertions(+), 335 deletions(-) create mode 100644 src/views/alert/components/AlertSetting/AlertTimeTable.vue rename src/views/alert/components/AlertSetting/{AlertOutliersTimeModal.vue => AlertTimeTableAddModal.vue} (57%) rename src/views/energyManagement/components/{ => EnergyChart}/BillingDegreeChart.vue (100%) rename src/views/energyManagement/components/{ => EnergyChart}/CarbonEmissionChart.vue (100%) rename src/views/energyManagement/components/{ => EnergyChart}/CarbonEmissionModal.vue (100%) rename src/views/energyManagement/components/{ => EnergyChart}/ElecConsumption.vue (100%) create mode 100644 src/views/energyManagement/components/EnergyChart/EnergyChart.vue rename src/views/energyManagement/components/{ => EnergyChart}/ImmediateDemandChart.vue (100%) rename src/views/energyManagement/components/{ => EnergyChart}/ImmediateDemandModal.vue (100%) rename src/views/energyManagement/components/{ => EnergyChart}/IntervalBillChart.vue (100%) rename src/views/energyManagement/components/{ => EnergyChart}/MonthlyElecBillChart.vue (100%) rename src/views/energyManagement/components/{ => EnergyChart}/UsageInformation.vue (100%) create mode 100644 src/views/energyManagement/components/EnergyHistoryTable/EnergyActionButton.vue create mode 100644 src/views/energyManagement/components/EnergyHistoryTable/EnergyDataCahrt.vue create mode 100644 src/views/energyManagement/components/EnergyHistoryTable/EnergyDataTable.vue create mode 100644 src/views/energyManagement/components/EnergyHistoryTable/EnergyHistoryTable.vue create mode 100644 src/views/energyManagement/components/EnergyHistoryTable/EnergySearch.vue create mode 100644 src/views/energyManagement/components/EnergyHistoryTable/EnergySearchTime.vue create mode 100644 src/views/energyManagement/components/EnergyHistoryTable/EnergySidebar.vue create mode 100644 src/views/energyManagement/components/EnergyReport/EnergyReport.vue create mode 100644 src/views/energyManagement/components/EnergyReport/EnergyReportSearch.vue create mode 100644 src/views/energyManagement/components/EnergyReport/EnergyReportTable.vue create mode 100644 src/views/energyManagement/components/EnergyReport/EnergyReportTimeRange.vue diff --git a/src/apis/alert/api.js b/src/apis/alert/api.js index fc0507b..6794093 100644 --- a/src/apis/alert/api.js +++ b/src/apis/alert/api.js @@ -14,3 +14,7 @@ export const GET_OUTLIERS_LIST_API = `api/Alarm/GetAlarmSetting`; export const GET_OUTLIERS_DEVLIST_API = `api/Alarm/GetDevList`; // 取得設備 export const GET_OUTLIERS_POINTS_API = `api/Alarm/GetAlarmPoints`; // 取得點位 export const POST_OUTLIERS_SETTING_API = `api/Alarm/SaveAlarmSetting`; // 新增與修改 + +export const GET_ALERT_SCHEDULE_LIST_API = `api/Alarm/GetAlarmSchedule`; +export const POST_ALERT_SCHEDULE = `api/Alarm/SaveAlarmSchedule`; +export const DELETE_ALERT_SCHEDULE = `api/Alarm/DeleteAlarmSchedule`; \ No newline at end of file diff --git a/src/apis/alert/index.js b/src/apis/alert/index.js index e30d42b..2c96364 100644 --- a/src/apis/alert/index.js +++ b/src/apis/alert/index.js @@ -12,6 +12,9 @@ import { POST_ALERT_MEMBER, DELETE_ALERT_MEMBER, GET_NOTICE_LIST_API, + GET_ALERT_SCHEDULE_LIST_API, + POST_ALERT_SCHEDULE, + DELETE_ALERT_SCHEDULE, } from "./api"; import instance from "@/util/request"; import apihandler from "@/util/apihandler"; @@ -156,3 +159,34 @@ export const postOutliersSetting = async (data) => { code: res.code, }); }; + +export const getAlarmScheduleList = async () => { + const res = await instance.post(GET_ALERT_SCHEDULE_LIST_API, {}); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; + +export const postAlertSchedule = async (data) => { + const res = await instance.post(POST_ALERT_SCHEDULE, data); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; + +export const deleteAlarmSchedule = async (id) => { + try { + const res = await instance.post(DELETE_ALERT_SCHEDULE, { id }); + return { + isSuccess: res.code === "0000", + msg: res.msg || "刪除成功", + }; + } catch (error) { + console.error("API request failed", error); + return { isSuccess: false, msg: "API request failed" }; + } +}; \ No newline at end of file diff --git a/src/apis/asset/api.js b/src/apis/asset/api.js index ef087ed..ed19b27 100644 --- a/src/apis/asset/api.js +++ b/src/apis/asset/api.js @@ -24,3 +24,5 @@ export const GET_ASSET_IOT_SCHEMA_API = `/AssetManage/GetResponseSchema`; export const GET_ASSET_DEPARTMENT_API = `/AssetManage/GetDepartment`; export const POST_ASSET_DEPARTMENT_API = `/AssetManage/SaveDepartment`; export const DELETE_ASSET_DEPARTMENT_API = `/AssetManage/DeleteDepartment`; + +export const GET_ASSET_ELECTYPE_API = `/AssetManage/GetElecType`; diff --git a/src/apis/asset/index.js b/src/apis/asset/index.js index 32bf4a6..7307466 100644 --- a/src/apis/asset/index.js +++ b/src/apis/asset/index.js @@ -18,6 +18,7 @@ import { GET_ASSET_DEPARTMENT_API, POST_ASSET_DEPARTMENT_API, DELETE_ASSET_DEPARTMENT_API, + GET_ASSET_ELECTYPE_API, } from "./api"; import instance from "@/util/request"; import apihandler from "@/util/apihandler"; @@ -203,8 +204,8 @@ export const getAssetSubPoint = async (sub_system_tag) => { }); }; -export const getIOTSchema = async (sub_system_tag, points) => { - const res = await instance.post(GET_ASSET_IOT_SCHEMA_API, {}); +export const getIOTSchema = async (variable_id) => { + const res = await instance.post(GET_ASSET_IOT_SCHEMA_API, {variable_id}); return apihandler(res.code, res.data, { msg: res.msg, @@ -241,3 +242,12 @@ export const deleteDepartmentItem = async (id) => { code: res.code, }); }; + +export const getElecTypeList = async () => { + const res = await instance.post(GET_ASSET_ELECTYPE_API, {}); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; \ No newline at end of file diff --git a/src/apis/energy/api.js b/src/apis/energy/api.js index e22b872..5931055 100644 --- a/src/apis/energy/api.js +++ b/src/apis/energy/api.js @@ -1,3 +1,7 @@ export const GET_REALTIME_DIST_API = `/api/Energe/GetRealTimeDistribution`; export const GET_ELECUSE_DAY_API = `/api/Energe/GetElecUseDay`; -export const GET_TAI_POWER_API = `/api/Energe/GetTaipower`; \ No newline at end of file +export const GET_TAI_POWER_API = `/api/Energe/GetTaipower`; + +export const GET_SIDEBAR_API = `/api/Energe/GetEnergySideBar`; +export const GET_SEARCH_API = `/api/Energe/GetFilter`; + diff --git a/src/apis/energy/index.js b/src/apis/energy/index.js index afb6dc9..927e72b 100644 --- a/src/apis/energy/index.js +++ b/src/apis/energy/index.js @@ -2,6 +2,8 @@ import { GET_REALTIME_DIST_API, GET_ELECUSE_DAY_API, GET_TAI_POWER_API, + GET_SIDEBAR_API, + GET_SEARCH_API, } from "./api"; import instance from "@/util/request"; import apihandler from "@/util/apihandler"; @@ -31,4 +33,22 @@ export const getTaipower = async () => { msg: res.msg, code: res.code, }); -}; \ No newline at end of file +}; + +export const getEnergySideBar = async () => { + const res = await instance.post(GET_SIDEBAR_API); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; + +export const getEnergySearch = async (type) => { + const res = await instance.post(GET_SEARCH_API, { type }); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; diff --git a/src/apis/history/index.js b/src/apis/history/index.js index ed3a412..922bd7c 100644 --- a/src/apis/history/index.js +++ b/src/apis/history/index.js @@ -12,9 +12,15 @@ import instance, { fileInstance } from "@/util/request"; import apihandler from "@/util/apiHandler"; import downloadExcel from "@/util/downloadExcel"; -export const getHistorySideBar = async (sub_system_tag) => { +export const getHistorySideBar = async ({ + sub_system_tag, + department_id, + elec_type_id, +}) => { const res = await instance.post(GET_HISTORY_SIDEBAR_API, { sub_system_tag, + department_id, + elec_type_id, }); return apihandler(res.code, res.data, { @@ -42,6 +48,7 @@ export const getHistoryData = async ({ End_time, Device_list, Points, + table_type, }) => { /* { @@ -62,6 +69,7 @@ export const getHistoryData = async ({ Device_list: Array.isArray(Device_list) ? Device_list : [Device_list], Points: Array.isArray(Points) ? Points : [Points], Type: parseInt(Type), + table_type: parseInt(table_type), }); return apihandler(res.code, res.data, { diff --git a/src/apis/login/index.js b/src/apis/login/index.js index 8c01c49..2bb6498 100644 --- a/src/apis/login/index.js +++ b/src/apis/login/index.js @@ -13,6 +13,10 @@ export async function Login({ account, password }) { document.cookie = `JWT-Authorization=${res.data.token}; Max-Age=${ 24 * 60 * 60 * 1000 }`; + // 設定 user_name Cookie + document.cookie = `user_name=${res.data.user_name}; Max-Age=${ + 24 * 60 * 60 * 1000 + }`; } return apihandler(res.code, res.data, { diff --git a/src/components/customUI/DateGroup.vue b/src/components/customUI/DateGroup.vue index de479dc..91e2263 100644 --- a/src/components/customUI/DateGroup.vue +++ b/src/components/customUI/DateGroup.vue @@ -118,6 +118,6 @@ const curWidth = computed(() => { diff --git a/src/components/customUI/Table.vue b/src/components/customUI/Table.vue index 1d609b6..2eafb68 100644 --- a/src/components/customUI/Table.vue +++ b/src/components/customUI/Table.vue @@ -51,7 +51,7 @@ watch( ); const updateDataSource = (data) => { - console.log("update", data); + // console.log("update", data); currentDataSource.value = data; }; provide("current_table_data", { @@ -62,6 +62,7 @@ const sortRule = ref({}); const filterColumn = ref({}); const filterItems = ref({}); const selectedFilterItem = ref({}); +const searchQuery = ref(""); const toggleFilterModal = (key) => { let newFilter = Object.assign(filterColumn.value); @@ -136,7 +137,10 @@ const form = ref(null); const onFilter = (key, reset = false) => { const formData = new FormData(form.value); - reset && formData.delete(key); + if (reset) { + formData.delete(key); + searchQuery.value = ""; + } for (let [name, value] of formData) { console.log(name, value); } @@ -232,22 +236,38 @@ watch( " @click="() => toggleFilterModal(column.key)" /> -
+
- + +
+ +
/**資料框**/ .content-box { - @apply border border-info p-1 relative mb-4 bg-transparent ; + @apply border border-info p-1 relative mb-4 bg-transparent; } .content-box .table { diff --git a/src/components/navbar/NavbarItem.vue b/src/components/navbar/NavbarItem.vue index bad7390..7a88fba 100644 --- a/src/components/navbar/NavbarItem.vue +++ b/src/components/navbar/NavbarItem.vue @@ -2,6 +2,7 @@ import { onMounted, ref, watch, computed } from "vue"; import { AUTHPAGES } from "@/constant"; import { getAuth, getAllSysSidebar } from "@/apis/building"; +import { getEnergySideBar } from "@/apis/energy"; import useBuildingStore from "@/stores/useBuildingStore"; import useUserInfoStore from "@/stores/useUserInfoStore"; import { useI18n } from "vue-i18n"; @@ -13,6 +14,8 @@ const store = useUserInfoStore(); const buildingStore = useBuildingStore(); const route = useRoute(); const openKeys = ref([]); // 追蹤當前打開的子菜單 +const menu_array = ref([]); +const currentAuthCode = ref(""); const iniFroList = async () => { const res = await getAuth(locale.value); @@ -37,9 +40,19 @@ const open = ref(false); const getSubMonitorPage = async (building) => { const res = await getAllSysSidebar(); buildingStore.mainSubSys = res.data.history_Main_Systems; + menu_array.value = res.data.history_Main_Systems; }; -const showDrawer = () => { - getSubMonitorPage(); +const getSubEnergyPage = async () => { + const res = await getEnergySideBar(); + menu_array.value = res.data; +}; +const showDrawer = (authCode) => { + if (authCode === "PF1") { + getSubMonitorPage(); + } else if (authCode === "PF2") { + getSubEnergyPage(); + } + currentAuthCode.value = authCode; open.value = true; }; const onClose = () => { @@ -89,14 +102,19 @@ onMounted(() => {
  • @@ -178,8 +200,8 @@ onMounted(() => { @apply bg-transparent lg:w-[95px] w-full mb-5 lg:mb-0; } -.menu-box .btn-group span{ - @apply text-2xl ms-2 lg:ms-0 lg:text-sm; +.menu-box .btn-group span { + @apply text-2xl ms-2 lg:ms-0 lg:text-sm; } .menu-box > li { diff --git a/src/config/cn.json b/src/config/cn.json index f421975..f9859e3 100644 --- a/src/config/cn.json +++ b/src/config/cn.json @@ -82,7 +82,23 @@ "total_elec_cost": "总电费", "carbon_equivalent": "碳排当量", "edit_carbon_emission": "编辑碳排放系数", - "carbon_emission_coefficient": "碳排放系数" + "carbon_emission_coefficient": "碳排放系数", + "electricity_classification": "用电分类", + "electricity_price": "电费每度单价", + "floor": "楼层", + "maximum": "最大值", + "maximum_time": "最大值时间", + "minimum": "最小值", + "minimum_time": "最小值时间", + "average_value": "平均值", + "start_value": "起始值(kWh)", + "end_value": "截止值(kWh)", + "difference": "差值(kWh)", + "power_consumption": "用电量(kWh)", + "ranking": "排名", + "subtotal": "小计", + "unit_price": "单价", + "total_amount": "金额总计" }, "alarm": { "title": "显示警告", @@ -152,7 +168,16 @@ "choose": "选择", "day_time": "星期/时间", "click_time_period": "请用滑鼠点击时间段", - "clear": "清空" + "clear": "清空", + "sunday": "星期日", + "monday": "星期一", + "tuesday": "星期二", + "wednesday": "星期三", + "thursday": "星期四", + "friday": "星期五", + "saturday": "星期六", + "schedule_name": "时段名称", + "schedule_content": "时段内容" }, "operation": { "title": "运维管理", diff --git a/src/config/tw.json b/src/config/tw.json index d8abc25..08b9175 100644 --- a/src/config/tw.json +++ b/src/config/tw.json @@ -13,7 +13,7 @@ "upload": { "title": "選擇一個文件或拖放到這裡", "description": "檔案不超過 10MB", - "formats": "檔案格式" + "formats": "檔案格式" }, "dashboard": { "yesterday_today": "昨天/今天", @@ -82,7 +82,23 @@ "total_elec_cost": "總電費", "carbon_equivalent": "碳排當量", "edit_carbon_emission": "編輯碳排放係數", - "carbon_emission_coefficient":"碳排放係數" + "carbon_emission_coefficient": "碳排放係數", + "electricity_classification": "用電分類", + "electricity_price": "電費每度單價", + "floor": "樓層", + "maximum": "最大值", + "maximum_time": "最大值時間", + "minimum": "最小值", + "minimum_time": "最小值時間", + "average_value": "平均值", + "start_value": "起始值(kWh)", + "end_value": "截止值(kWh)", + "difference": "差值(kWh)", + "power_consumption": "用電量(kWh)", + "ranking": "排名", + "subtotal": "小計", + "unit_price": "單價", + "total_amount": "金額總計" }, "alarm": { "title": "顯示警告", @@ -150,9 +166,18 @@ "notify_items": "通知項目", "notify_list": "通知名單", "choose": "選擇", - "day_time":"星期/時間", - "click_time_period":"請用滑鼠點擊時間段", - "clear":"清空" + "day_time": "星期/時間", + "click_time_period": "請用滑鼠點擊時間段", + "clear": "清空", + "sunday": "星期日", + "monday": "星期一", + "tuesday": "星期二", + "wednesday": "星期三", + "thursday": "星期四", + "friday": "星期五", + "saturday": "星期六", + "schedule_name": "時段名稱", + "schedule_content": "時段內容" }, "operation": { "title": "運維管理", @@ -298,10 +323,10 @@ "download": "下載", "confirm": "確認", "restore": "復原", - "stop_edit":"停止修改", - "start_edit":"開始修改" + "stop_edit": "停止修改", + "start_edit": "開始修改" }, - "msg":{ + "msg": { "sure_to_delete": "是否確認刪除該項目?", "sure_to_delete_permanent": "是否確認永久刪除該項目?", "delete_success": "刪除成功", diff --git a/src/config/us.json b/src/config/us.json index 21ec1e6..c87a74b 100644 --- a/src/config/us.json +++ b/src/config/us.json @@ -82,7 +82,23 @@ "total_elec_cost": "Total Elec. Cost", "carbon_equivalent": "Carbon Equivalent", "edit_carbon_emission": "Edit carbon emission coefficient", - "carbon_emission_coefficient": "Carbon emission coefficient" + "carbon_emission_coefficient": "Carbon emission coefficient", + "electricity_classification": "Electricity Classification", + "electricity_price": "Electricity charge per unit price", + "floor": "Floor", + "maximum": "Maximum", + "maximum_time": "Maximum time", + "minimum": "Minimum value", + "minimum_time": "Minimum time", + "average_value": "Average value", + "start_value": "Start value (kWh)", + "end_value": "End value (kWh)", + "difference": "Difference (kWh)", + "power_consumption": "Power consumption (kWh)", + "ranking": "Ranking", + "subtotal": "Subtotal", + "unit_price": "Unit price", + "total_amount": "Total amount" }, "alarm": { "title": "Warning", @@ -152,7 +168,16 @@ "choose": "Choose", "day_time": "Week/Time", "click_time_period": "Please click the time period with your mouse", - "clear": "Clear" + "clear": "Clear", + "sunday": "Sunday", + "monday": "Monday", + "tuesday": "Tuesday", + "wednesday": "Wednesday", + "thursday": "Thursday", + "friday": "Friday", + "saturday": "Saturday", + "schedule_name": "Time period name", + "schedule_content": "Time period content" }, "operation": { "title": "Operation And Maintenance Management", diff --git a/src/router/index.js b/src/router/index.js index 759b37e..a545930 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -80,7 +80,7 @@ const router = createRouter({ component: ProductSetting, }, { - path: "/energyManagement", + path: "/energyManagement/:main_system_id/:sub_system_id/:type", name: "energyManagement", component: EnergyManagement, }, @@ -99,10 +99,13 @@ router.beforeEach(async (to, from, next) => { const authRequired = !publicPages.includes(to.path); const auth = useUserInfoStore(); const token = useGetCookie("JWT-Authorization"); + const user_name = useGetCookie("user_name"); if (to.path === "/logout") { - document.cookie = "JWT-Authorization="; + document.cookie = "JWT-Authorization=; Max-Age=0"; + document.cookie = "user_name=; Max-Age=0"; auth.user.token = ""; + auth.user.user_name = ""; window.location.reload(); next({ path: "/login" }); } @@ -111,10 +114,13 @@ router.beforeEach(async (to, from, next) => { auth.user.token = ""; next({ path: "/login" }); } else if (!authRequired) { - document.cookie = "JWT-Authorization="; + document.cookie = "JWT-Authorization=; Max-Age=0"; + document.cookie = "user_name=; Max-Age=0"; auth.user.token = ""; + auth.user.user_name = ""; } else { auth.user.token = token; + auth.user.user_name = user_name; } next(); }); diff --git a/src/stores/useUserInfoStore.js b/src/stores/useUserInfoStore.js index 27ef6dd..b552ade 100644 --- a/src/stores/useUserInfoStore.js +++ b/src/stores/useUserInfoStore.js @@ -5,6 +5,7 @@ const useUserInfoStore = defineStore("userInfo", () => { const user = ref({ token: "", expires: 0, + user_name:"", }); const auth_page = ref([]); diff --git a/src/views/AssetManagement/AssetManagement.vue b/src/views/AssetManagement/AssetManagement.vue index ef9cf35..bea656f 100644 --- a/src/views/AssetManagement/AssetManagement.vue +++ b/src/views/AssetManagement/AssetManagement.vue @@ -1,7 +1,43 @@