From fe1570e63bf624919fd0c5a5a5eb23092468f3b9 Mon Sep 17 00:00:00 2001 From: koko1108 Date: Thu, 16 Oct 2025 11:28:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E7=94=A2=E8=A8=AD=E5=AE=9A:=20?= =?UTF-8?q?=E5=8C=AF=E5=87=BAexcel=20API=E4=B8=B2=E6=8E=A5=20=E8=AA=BF?= =?UTF-8?q?=E6=95=B4=E5=A0=B1=E8=A1=A8=E7=AE=A1=E7=90=86=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=AF=84=E5=9C=8D=20=E4=BF=AE=E6=94=B9=E4=BB=8A=E6=97=A5?= =?UTF-8?q?=E7=94=9F=E7=94=A2=E7=9B=AE=E6=A8=99UI=20=E6=BA=AB=E5=BA=A6=20-?= =?UTF-8?q?=20=E7=B3=96=E5=BA=A6=E3=80=81=E5=86=B7=E8=97=8F=E6=BA=AB?= =?UTF-8?q?=E5=BA=A6=20=E6=96=B0=E5=A2=9E=20=E4=B8=80=E5=B0=8F=E6=99=82?= =?UTF-8?q?=E3=80=81=E5=9B=9B=E5=B0=8F=E6=99=82=E3=80=81=E5=85=AB=E5=B0=8F?= =?UTF-8?q?=E6=99=82=20=E8=A8=AD=E5=AE=9A=20=E5=91=8A=E8=AD=A6=E5=B0=8F?= =?UTF-8?q?=E9=A1=9E=E7=AF=A9=E9=81=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/productSetting/api.js | 1 + src/apis/productSetting/index.js | 27 +++- src/apis/report/index.js | 30 +++-- .../AlertQuery/AlertSearchTypesButton.vue | 2 +- .../components/AlertSetting/AlertSubList.vue | 18 ++- src/views/dashboard/Dashboard.vue | 15 ++- .../components/DashboardFrozenTemp.vue | 40 ++++-- .../components/DashboardImmediateTemp.vue | 90 ++++++++----- .../components/DashboardMoreModal.vue | 122 ++++++++++++++++++ .../dashboard/components/DashboardTarget.vue | 6 +- .../dashboardForgeCards/CookingPotCard.vue | 5 +- .../components/InventorySettingAddModal.vue | 1 + .../components/InventorySettingTable.vue | 31 ++++- .../reportManagement/ReportManagement.vue | 45 +++---- 14 files changed, 340 insertions(+), 93 deletions(-) create mode 100644 src/views/dashboard/components/DashboardMoreModal.vue diff --git a/src/apis/productSetting/api.js b/src/apis/productSetting/api.js index faf2dfe..a43716d 100644 --- a/src/apis/productSetting/api.js +++ b/src/apis/productSetting/api.js @@ -5,3 +5,4 @@ export const POST_SETTING_TYPE_API = `/SituationRoom/SetProduct`; export const GET_SETTING_INVENTORY_API = `/SituationRoom/GetInventory`; export const POST_SETTING_INVENTORY_API = `/SituationRoom/SaveInventory`; export const GET_SETTING_INVENTORY_LOG_API = `/SituationRoom/GetInventoryLog`; +export const GET_SETTING_INVENTORY_EXPORT_API = `/api/report/Inventory`; diff --git a/src/apis/productSetting/index.js b/src/apis/productSetting/index.js index 5930409..6606986 100644 --- a/src/apis/productSetting/index.js +++ b/src/apis/productSetting/index.js @@ -1,4 +1,4 @@ -import instance from "@/util/request"; +import instance, { fileInstance } from "@/util/request"; import apihandler from "@/util/apihandler"; import { POST_CHANGE_GROUP_VALUE_API, @@ -7,7 +7,9 @@ import { GET_SETTING_INVENTORY_API, POST_SETTING_INVENTORY_API, GET_SETTING_INVENTORY_LOG_API, + GET_SETTING_INVENTORY_EXPORT_API, } from "./api"; +import downloadExcel from "@/util/downloadExcel"; export const postChangeGroupValue = async (data) => { const res = await instance.post(POST_CHANGE_GROUP_VALUE_API, data); @@ -72,3 +74,26 @@ export const getSettingInventoryLog = async ({ start_time, end_time }) => { isSuccess: false, }); }; + +export const getInventoryExportData = async ({ start_date, end_date }) => { + const res = await fileInstance.get( + GET_SETTING_INVENTORY_EXPORT_API, + { + params: { + start_date, + end_date, + }, + responseType: "blob", + } + ); + + return apihandler( + res.code, + res, + { + msg: res.msg, + code: res.code, + }, + downloadExcel + ); +}; diff --git a/src/apis/report/index.js b/src/apis/report/index.js index 93b0e1c..0eb6579 100644 --- a/src/apis/report/index.js +++ b/src/apis/report/index.js @@ -12,10 +12,11 @@ import instance, { fileInstance } from "@/util/request"; import apihandler from "@/util/apihandler"; import downloadExcel from "@/util/downloadExcel"; -export const getElectricMeterLog = async ({ start_date }) => { +export const getElectricMeterLog = async ({ start_date, end_date }) => { const res = await instance.get(GET_ELECTRIC_METER_API, { params: { start_date, + end_date, }, }); @@ -26,10 +27,14 @@ export const getElectricMeterLog = async ({ start_date }) => { }); }; -export const getRefrigerationRoomTemperatureLog = async ({ start_date }) => { +export const getRefrigerationRoomTemperatureLog = async ({ + start_date, + end_date, +}) => { const res = await instance.get(GET_REFRIGERATION_ROOM_TEMPERATURE_API, { params: { start_date, + end_date, }, }); return apihandler(res.code, res.data, { @@ -39,10 +44,11 @@ export const getRefrigerationRoomTemperatureLog = async ({ start_date }) => { }); }; -export const getSipLog = async ({ start_date }) => { +export const getSipLog = async ({ start_date, end_date }) => { const res = await instance.get(GET_SIP_API, { params: { start_date, + end_date, }, }); return apihandler(res.code, res.data, { @@ -52,10 +58,11 @@ export const getSipLog = async ({ start_date }) => { }); }; -export const getCipLog = async ({ start_date }) => { +export const getCipLog = async ({ start_date, end_date }) => { const res = await instance.get(GET_CIP_API, { params: { start_date, + end_date, }, }); return apihandler(res.code, res.data, { @@ -65,10 +72,11 @@ export const getCipLog = async ({ start_date }) => { }); }; -export const exportElectricMeterLog = async ({ start_date }) => { +export const exportElectricMeterLog = async ({ start_date, end_date }) => { const res = await fileInstance.get(EXPORT_ELECTRIC_METER_API, { params: { start_date, + end_date, }, responseType: "blob", }); @@ -84,12 +92,16 @@ export const exportElectricMeterLog = async ({ start_date }) => { ); }; -export const exportRefrigerationRoomTemperatureLog = async ({ start_date }) => { +export const exportRefrigerationRoomTemperatureLog = async ({ + start_date, + end_date, +}) => { const res = await fileInstance.get( EXPORT_REFRIGERATION_ROOM_TEMPERATURE_API, { params: { start_date, + end_date, }, responseType: "blob", } @@ -106,10 +118,11 @@ export const exportRefrigerationRoomTemperatureLog = async ({ start_date }) => { ); }; -export const exportSipLog = async ({ start_date }) => { +export const exportSipLog = async ({ start_date, end_date }) => { const res = await fileInstance.get(EXPORT_SIP_API, { params: { start_date, + end_date, }, responseType: "blob", }); @@ -124,10 +137,11 @@ export const exportSipLog = async ({ start_date }) => { ); }; -export const exportCipLog = async ({ start_date }) => { +export const exportCipLog = async ({ start_date, end_date }) => { const res = await fileInstance.get(EXPORT_CIP_API, { params: { start_date, + end_date, }, responseType: "blob", }); diff --git a/src/views/alert/components/AlertQuery/AlertSearchTypesButton.vue b/src/views/alert/components/AlertQuery/AlertSearchTypesButton.vue index 5760493..81803d6 100644 --- a/src/views/alert/components/AlertQuery/AlertSearchTypesButton.vue +++ b/src/views/alert/components/AlertQuery/AlertSearchTypesButton.vue @@ -68,7 +68,7 @@ watch(searchParams, (newValue) => { {{ checkedItem.length === store.subSys.length ? "取消全選" : "全選" }} { - const res = await getAlertSubList(); - const subSystems = res.data.history_Main_Systems.flatMap((mainSystem) => { - return mainSystem.history_Sub_systems.map((subSystem, index) => ({ +const updateSubSystemsFromStore = () => { + const subSystems = store.subSys + .filter(subSystem => subSystem.is_alarm === 1) + .map(subSystem => ({ title: subSystem.full_name, key: subSystem.sub_system_tag, active: searchParams.value?.subSys_id ? searchParams.value.subSys_id === subSystem.sub_system_tag : subSystem.sub_system_tag == "DP", })); - }); setItems(subSystems); }; onMounted(() => { - getSubSystems(); + updateSubSystemsFromStore(); }); +watch(() => store.subSys, () => { + updateSubSystemsFromStore(); +}, { deep: true }); + watch(selectedBtn, (newValue) => { if (newValue) { diff --git a/src/views/dashboard/Dashboard.vue b/src/views/dashboard/Dashboard.vue index 24d16e9..15f5f01 100644 --- a/src/views/dashboard/Dashboard.vue +++ b/src/views/dashboard/Dashboard.vue @@ -9,6 +9,7 @@ import DashboardElectricity from "./components/DashboardElectricity.vue"; import DashboardAlert from "./components/DashboardAlert.vue"; import DashboardForgeOptionButton from "./components/DashboardForgeOptionButton.vue"; import DashboardForgeOptionCard from "./components/DashboardForgeOptionCard.vue"; +import DashboardMoreModal from "./components/DashboardMoreModal.vue"; import { getDashboardInit, getDashboardOptionRealTimeData, @@ -106,6 +107,13 @@ const getCompany = async () => { companyOptions.value = res.data.map((d) => ({ ...d, key: d.id })); }; +const currentIntervalType = ref(""); + +const openModal = (type) => { + currentIntervalType.value = type; + dashboard_more.showModal(); +}; + // 開始定時器 const startInterval = (option) => { // 清除之前的定時器 @@ -155,6 +163,7 @@ onUnmounted(() => {