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) => {