From aa5f6bcb48d7267bddd168e9979a5b0061cbd259 Mon Sep 17 00:00:00 2001 From: tikkhun Date: Tue, 27 Jan 2026 15:10:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(DictItemModal):=20=E4=B8=BA=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=AD=97=E6=AE=B5=E6=B7=BB=E5=8A=A0=20trim=20?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 防止用户输入前后空格导致数据不一致问题 --- src/pages/Dict/components/DictItemModal.tsx | 26 +++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/pages/Dict/components/DictItemModal.tsx b/src/pages/Dict/components/DictItemModal.tsx index 0db2eef..5a39990 100644 --- a/src/pages/Dict/components/DictItemModal.tsx +++ b/src/pages/Dict/components/DictItemModal.tsx @@ -66,6 +66,7 @@ const DictItemModal: React.FC = ({ label="名称" name="name" rules={[{ required: true, message: '请输入名称' }]} + normalize={(value) => (value || '').trim()} > @@ -73,19 +74,36 @@ const DictItemModal: React.FC = ({ label="标题" name="title" rules={[{ required: true, message: '请输入标题' }]} + normalize={(value) => (value || '').trim()} > - + (value || '').trim()} + > - + (value || '').trim()} + > - + (value || '').trim()} + > - + (value || '').trim()} + >