From ae77c8d3ac49d25bee0d8c06ad54d980759d87a2 Mon Sep 17 00:00:00 2001 From: mairuiming Date: Mon, 27 Oct 2025 17:59:03 +0800 Subject: [PATCH] 1 1 --- src/App.tsx | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index c705984..82dade6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2225,6 +2225,39 @@ export default function App() { const data = await executeSecondaryProcessQuery(packId, packType); setSecondaryProcessResults(data); + // 处理二次工艺填充到标签7的逻辑 + if (data && data.length > 0) { + const label7Options = labelOptions['标签7'] || []; + const matchingProcessValues: string[] = []; + + data.forEach((record: any) => { + if (record.costs_type && record.costs_type.trim() !== '') { + const processValue = record.costs_type.trim(); + const matchingOption = label7Options.find(option => + option.value === processValue || option.label === processValue + ); + + if (matchingOption && !matchingProcessValues.includes(processValue)) { + matchingProcessValues.push(processValue); + } + } + }); + + if (matchingProcessValues.length > 0) { + setSelectedLabels(prev => ({ + ...prev, + '标签7': matchingProcessValues + })); + + if (bitable.ui.showToast) { + await bitable.ui.showToast({ + toastType: 'success', + message: `已将 ${matchingProcessValues.length} 个二次工艺填充到标签7: ${matchingProcessValues.join(', ')}` + }); + } + } + } + if (bitable.ui.showToast) { await bitable.ui.showToast({ toastType: 'success',