From 9c44b5fe3cdd159587a0a7270a2b3a98eccd9b13 Mon Sep 17 00:00:00 2001 From: mairuiming Date: Thu, 18 Dec 2025 14:03:39 +0800 Subject: [PATCH] 1 1 --- src/App.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index daaafc8..a0aa18e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -271,6 +271,25 @@ export default function App() { } setBatchModalVisible(true); }; + + const restoreBaseBufferDaysFromSnapshot = (snapshot: any) => { + const candidates: any[] = [ + snapshot?.bufferManagement?.baseDays, + snapshot?.baseBufferDays, + snapshot?.baseBuferDays, + snapshot?.baseDays, + snapshot?.bufferManagement?.baseBuferDays, + ]; + for (const c of candidates) { + const n = typeof c === 'number' + ? c + : (typeof c === 'string' ? parseFloat(c) : NaN); + if (Number.isFinite(n)) { + setBaseBufferDays(Math.max(0, Math.ceil(n))); + return; + } + } + }; // 根据货期记录ID读取节点详情并还原流程数据 const loadProcessDataFromDeliveryRecord = async (deliveryRecordId: string) => {