From 9feadeb69d30606803b193291eff7a729c189a34 Mon Sep 17 00:00:00 2001 From: LiaoYijun Date: Wed, 23 Jul 2025 16:07:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=B7=E6=A0=BC=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E5=82=A8=E5=AD=98=E5=88=B0=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Products/Index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/stores/Products/Index.js b/src/stores/Products/Index.js index cb90470..7da1344 100644 --- a/src/stores/Products/Index.js +++ b/src/stores/Products/Index.js @@ -367,7 +367,7 @@ export const useProductsStore = create( } else { mergedList = quotationList.map(prevQuotation => { if (prevQuotation.key === formValues.key) { - const changedList = [] + const changedObject = {} for (const [key, value] of Object.entries(formValues)) { if (key === 'use_dates' || key === 'id' || key === 'key') continue @@ -375,9 +375,7 @@ export const useProductsStore = create( const hasChanged = preValue !== value if (hasChanged) { - changedList.push({ - [key]: preValue, - }) + changedObject[key] = value } } @@ -393,7 +391,7 @@ export const useProductsStore = create( use_dates_start: formValues.use_dates_start, use_dates_end: formValues.use_dates_end, weekdays: formValues.weekdays, - lastedit_changed: JSON.stringify(changedList, null, 2) + lastedit_changed: changedObject } } else { return prevQuotation