From f0bcc3aaa31f9658cbed0ef4bcc5b6de486fd903 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 26 三月 2025 12:32:19 +0800
Subject: [PATCH] 物料上级分组不显示问题修复

---
 rsf-admin/src/page/components/StatusSelectInput.jsx |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/rsf-admin/src/page/components/StatusSelectInput.jsx b/rsf-admin/src/page/components/StatusSelectInput.jsx
index 46f787c..11031ca 100644
--- a/rsf-admin/src/page/components/StatusSelectInput.jsx
+++ b/rsf-admin/src/page/components/StatusSelectInput.jsx
@@ -5,20 +5,21 @@
 } from 'react-admin';
 
 const StatusSelectInput = (props) => {
+    const { require = true, defaultValue = 1, ...rest } = props
     const translate = useTranslate();
 
     return (
         <SelectInput
             label={translate('common.field.status')}
             source="status"
-            validate={[required()]}
+            validate={[require && required()]}
             choices={[
                 { id: '1', name: 'common.enums.statusTrue' },
                 { id: '0', name: 'common.enums.statusFalse' },
             ]}
-            defaultValue={1}
+            defaultValue={defaultValue}
             helperText={false}
-            {...props}
+            {...rest}
         />
     )
 }

--
Gitblit v1.9.1