From f4d26271a4173f766267a8b326b787a09727a0c5 Mon Sep 17 00:00:00 2001 From: ko1234 Date: Fri, 8 Aug 2025 14:32:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A0=81:=E5=B0=8F=E5=8D=A1=E4=B8=B2?= =?UTF-8?q?=E8=B3=87=E6=96=99=E3=80=81=E4=BB=8A=E6=97=A5=E7=94=9F=E7=94=A2?= =?UTF-8?q?=E7=9B=AE=E6=A8=99=E4=B8=B2api=20|=20=E5=8D=B3=E6=99=82?= =?UTF-8?q?=E5=91=8A=E8=AD=A6:=E9=A0=90=E8=A8=AD=E5=85=A8=E9=81=B8?= =?UTF-8?q?=E4=B8=A6=E6=90=9C=E5=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/dashboard/api.js | 3 +- src/apis/dashboard/index.js | 10 ++ .../components/AlertQuery/AlertQuery.vue | 29 +++- .../AlertQuery/AlertSearchTypesButton.vue | 4 +- .../components/DashboardForgeOptionCard.vue | 18 +-- .../dashboard/components/DashboardTarget.vue | 149 +++++++----------- .../dashboardForgeCards/CookingCard.vue | 77 +++++---- .../dashboardForgeCards/CookingPotCard.vue | 141 ++++++++++++----- .../dashboardForgeCards/HeaterCard.vue | 17 +- .../dashboardForgeCards/ProductionCard.vue | 15 +- .../dashboardForgeCards/RefrigerationCard.vue | 39 +++-- .../dashboardForgeCards/ValveCard.vue | 22 ++- .../dashboardForgeCards/VesselCard.vue | 51 ++++-- tailwind.config.js | 7 + 14 files changed, 336 insertions(+), 246 deletions(-) diff --git a/src/apis/dashboard/api.js b/src/apis/dashboard/api.js index bf8fe03..bc135f6 100644 --- a/src/apis/dashboard/api.js +++ b/src/apis/dashboard/api.js @@ -7,4 +7,5 @@ export const GET_DASHBOARD_ROOM_TEMP_API = `/SituationRoom/GetFormulaRoomStatusD export const GET_DASHBOARD_ENERGY_API = `/SituationRoom/GetEnergeData`; export const POST_DASHBOARD_PRODUCT_TARGET_SETTING_API = `/SituationRoom/SetTargetSetting`; export const GET_DASHBOARD_PRODUCT_TARGET_SETTING_API = `/SituationRoom/GetTargetSetting` -export const GET_DASHBOARD_PRODUCT_HISTORY_API = `/SituationRoom/GetProductionHistory` \ No newline at end of file +export const GET_DASHBOARD_PRODUCT_HISTORY_API = `/SituationRoom/GetProductionHistory`; +export const GET_DASHBOARD_PRODUCT_TASK_API = `/SituationRoom/GetProductionTask`; diff --git a/src/apis/dashboard/index.js b/src/apis/dashboard/index.js index f520e96..d4476d3 100644 --- a/src/apis/dashboard/index.js +++ b/src/apis/dashboard/index.js @@ -9,6 +9,7 @@ import { POST_DASHBOARD_PRODUCT_TARGET_SETTING_API, GET_DASHBOARD_PRODUCT_TARGET_SETTING_API, GET_DASHBOARD_PRODUCT_HISTORY_API, + GET_DASHBOARD_PRODUCT_TASK_API } from "./api"; import instance from "@/util/request"; import apihandler from "@/util/apihandler"; @@ -147,3 +148,12 @@ export const getDashboardProductRecord = async ({ start_time, end_time }) => { }); }; +export const getDashboardProductTask = async () => { + const res = await instance.get(GET_DASHBOARD_PRODUCT_TASK_API); + + return apihandler(res.code, res.data, { + msg: res.msg, + code: res.code, + }); +} + diff --git a/src/views/alert/components/AlertQuery/AlertQuery.vue b/src/views/alert/components/AlertQuery/AlertQuery.vue index 28e6631..94620a2 100644 --- a/src/views/alert/components/AlertQuery/AlertQuery.vue +++ b/src/views/alert/components/AlertQuery/AlertQuery.vue @@ -66,7 +66,7 @@ const getModalDevList = async () => { const formattedKey = d.device_number .replace(/-/g, '_') .split('_') - .slice(0, 8) + .slice(0, 8) .join('_'); return { ...d, key: formattedKey }; @@ -151,11 +151,28 @@ const openModal = async (record) => { } }; -watch(searchParams, (newValue) => { - if (newValue.system_tag) { - search(); - } -}); +watch( + () => ({ + isAck: searchParams.value.isAck, + isRecover: searchParams.value.isRecover, + Start_date: searchParams.value.start_created_at, + End_date: searchParams.value.end_created_at, + system_tag: searchParams.value.system_tag, + }), + (val) => { + // 判斷所有必要欄位都已經有值 + if ( + val.isAck !== undefined && + val.isRecover !== undefined && + val.Start_date && + val.End_date && + val.system_tag + ) { + search(); + } + }, + { immediate: true, deep: true } +); provide("alert_modal", { model_data, search, updateEditRecord }); provide("alert_table", { openModal, updateEditRecord, dataSource, search, tableLoading }); diff --git a/src/views/alert/components/AlertQuery/AlertSearchTypesButton.vue b/src/views/alert/components/AlertQuery/AlertSearchTypesButton.vue index 4580ad9..e59c263 100644 --- a/src/views/alert/components/AlertQuery/AlertSearchTypesButton.vue +++ b/src/views/alert/components/AlertQuery/AlertSearchTypesButton.vue @@ -11,7 +11,7 @@ const changeCheckedItem = () => { if (checkedItem.value.length === store.subSys.length) { changeParams({ ...searchParams.value, - system_tag: [], + system_tag: [store.subSys[0]?.main_system_tag+`_`+store.subSys[0]?.sub_system_tag], }); } else { changeParams({ @@ -53,7 +53,7 @@ watch(searchParams, (newValue) => { if (!newValue.system_tag) { changeParams({ ...newValue, - system_tag: [store.subSys[0]?.main_system_tag+`_`+store.subSys[0]?.sub_system_tag], + system_tag: store.subSys.map(({ main_system_tag, sub_system_tag }) => main_system_tag+`_`+sub_system_tag), }); } }); diff --git a/src/views/dashboard/components/DashboardForgeOptionCard.vue b/src/views/dashboard/components/DashboardForgeOptionCard.vue index 6a78923..3d4dd45 100644 --- a/src/views/dashboard/components/DashboardForgeOptionCard.vue +++ b/src/views/dashboard/components/DashboardForgeOptionCard.vue @@ -53,18 +53,6 @@ const vesselsData = computed(() => { return data.map((vessel) => ({ ...vessel, activeTab: getDeviceActiveTab(vessel.name), - SIP: [ - { - count: "1", - startTime: "08:00", - endTime: "08:30", - }, - { - count: "2", - startTime: "14:00", - endTime: "14:30", - }, - ], })); }); @@ -84,12 +72,12 @@ const cookingPotData = computed(() => { // 冷藏室資料 const refrigerationData = computed(() => { - return props.realTimeData?.refrigerationData[0] || {}; + return props.realTimeData?.refrigerationData || []; }); // 電錶資料 const meterData = computed(() => { - const data = props.realTimeData?.refrigerationData || []; + const data = props.realTimeData?.meterData || []; return data.sort((a, b) => a.name.localeCompare(b.name)); }); @@ -117,7 +105,7 @@ const valveData = computed(() => { v-for="(vessel, index) in vesselsData" :key="index" :vessel="vessel" - :tabs="tabs" + :tabs="tabs.filter(tab => tab.label !== '品檢')" /> diff --git a/src/views/dashboard/components/DashboardTarget.vue b/src/views/dashboard/components/DashboardTarget.vue index 75ffd0b..371e54e 100644 --- a/src/views/dashboard/components/DashboardTarget.vue +++ b/src/views/dashboard/components/DashboardTarget.vue @@ -1,92 +1,35 @@ @@ -144,7 +98,7 @@ onMounted(() => { />
@@ -154,27 +108,35 @@ onMounted(() => { 品名 狀態 生產進度 - 功能 + 功能 - 鍋次 - 位置 + + 鍋次 + 狀態 +
載入中...
diff --git a/src/views/dashboard/components/dashboardForgeCards/CookingCard.vue b/src/views/dashboard/components/dashboardForgeCards/CookingCard.vue index 88bd65f..1c2b51b 100644 --- a/src/views/dashboard/components/dashboardForgeCards/CookingCard.vue +++ b/src/views/dashboard/components/dashboardForgeCards/CookingCard.vue @@ -1,5 +1,6 @@