diff --git a/src/apis/building/index.js b/src/apis/building/index.js index 0c3579e..88a039e 100644 --- a/src/apis/building/index.js +++ b/src/apis/building/index.js @@ -39,9 +39,9 @@ export const deleteBuildings = async (building_guid) => { }); }; -export const getAuth = async (lang) => { +export const getAuth = async (build) => { const res = await instance.post(GET_AUTHPAGE_API, { - lang, + build, }); return apihandler(res.code, res.data, { msg: res.msg, @@ -50,7 +50,7 @@ export const getAuth = async (lang) => { }; export const getAllSysSidebar = async (building_guid) => { - const res = await instance.post(GET_SUBAUTHPAGE_API, {building_guid}); + const res = await instance.post(GET_SUBAUTHPAGE_API, { building_guid }); return apihandler(res.code, res.data, { msg: res.msg, code: res.code, diff --git a/src/apis/headquarters/api.js b/src/apis/headquarters/api.js new file mode 100644 index 0000000..517ce4f --- /dev/null +++ b/src/apis/headquarters/api.js @@ -0,0 +1,6 @@ +export const GET_SITES_SYSTEM_STATUS_API = `/api/monitoring/sites-system-status`; +export const GET_SITES_SYSTEM_ENERGY_COST_RANK_API = `/api/energy-manager/all-site/energy-cost-rank`; +export const GET_SITES_SYSTEM_ENERGY_COST_TREND_API = `/api/energy-manager/all-site/energy-cost-trend`; +export const GET_SITES_SYSTEM_ENERGY_COST_GROWTH_API = `/api/energy-manager/all-site/energy-cost-growth-rate`; + + diff --git a/src/apis/headquarters/index.js b/src/apis/headquarters/index.js new file mode 100644 index 0000000..8cd7485 --- /dev/null +++ b/src/apis/headquarters/index.js @@ -0,0 +1,44 @@ +import { + GET_SITES_SYSTEM_STATUS_API, + GET_SITES_SYSTEM_ENERGY_COST_RANK_API, + GET_SITES_SYSTEM_ENERGY_COST_TREND_API, + GET_SITES_SYSTEM_ENERGY_COST_GROWTH_API, +} from "./api"; +import instance from "@/util/request"; +import apihandler from "@/util/apihandler"; + +export const getSystemStatus = async (building_ids) => { + const res = await instance.post(GET_SITES_SYSTEM_STATUS_API, building_ids); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; + +export const getSystemEnergyCostRank = async (building_ids) => { + const res = await instance.post(GET_SITES_SYSTEM_ENERGY_COST_RANK_API, building_ids); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +}; + +export const getSystemEnergyCostTrend = async (building_ids) => { + const res = await instance.post(GET_SITES_SYSTEM_ENERGY_COST_TREND_API, building_ids); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +} + +export const getSystemEnergyCostGrowth = async (building_ids) => { + const res = await instance.get(GET_SITES_SYSTEM_ENERGY_COST_GROWTH_API, building_ids); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +} \ No newline at end of file diff --git a/src/components/navbar/NavbarBuilding.vue b/src/components/navbar/NavbarBuilding.vue index d36fb9d..aa1c472 100644 --- a/src/components/navbar/NavbarBuilding.vue +++ b/src/components/navbar/NavbarBuilding.vue @@ -1,9 +1,10 @@