From f72802ff8037bb5dc8f0671d5e26a6523aa79c0c Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期六, 29 三月 2025 10:01:08 +0800
Subject: [PATCH] #修改 1. 添加批次编码自动生成
---
rsf-admin/src/page/components/TreeSelectInput.jsx | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/rsf-admin/src/page/components/TreeSelectInput.jsx b/rsf-admin/src/page/components/TreeSelectInput.jsx
index 4140b94..2c51cc5 100644
--- a/rsf-admin/src/page/components/TreeSelectInput.jsx
+++ b/rsf-admin/src/page/components/TreeSelectInput.jsx
@@ -5,7 +5,7 @@
import * as Common from '@/utils/common';
import { useFormContext } from 'react-hook-form';
-const TreeSelectInput = ({ resource, label, source = 'parentId', value, isTranslate = false, ...rest }) => {
+const TreeSelectInput = ({ resource, required, onChange, label, source = 'parentId', value, isTranslate = false, ...rest }) => {
const translate = useTranslate();
const { setValue } = useFormContext();
const [filter, setFilter] = React.useState("");
@@ -14,7 +14,7 @@
const [proxyVal, setProxyVal] = React.useState('');
const record = useRecordContext()
- const val = value || record[source];
+ const val = value || record?.[source];
useEffect(() => {
const http = async (resource) => {
@@ -38,10 +38,11 @@
shouldValidate: true,
shouldDirty: true,
});
+ onChange(event)
};
return (
- <FormControl fullWidth>
+ <FormControl fullWidth required={required}>
<InputLabel>{translate(label)}</InputLabel>
<Select
value={proxyVal || ''}
--
Gitblit v1.9.1