Compare commits

..

No commits in common. "983ca0810659dec68b94082b7b5dee37a8fdab55" and "431e3cbc375bd46b806fae3226a39f3665c9d8c1" have entirely different histories.

2 changed files with 51 additions and 50 deletions

View File

@ -27,7 +27,7 @@ const FormItemsRenderer = ({
collapse = false,
useAutoGenerateRequired = true,
initialValues,
}) => {
}) => {
const form = Form.useFormInstance();
// 获取表单值,优先使用 initialValues
@ -297,14 +297,7 @@ const FormItemsRenderer = ({
return (
option.customizeRender
? (renderFormControl(option))
: (
<Form.Item
key={option.name || index}
noStyle
shouldUpdate={option.shouldUpdate ?? option?.componentProps?.shouldUpdate}
dependencies={option.dependencies || option?.componentProps?.dependencies}
>
{() => {
: (() => {
// 支持动态计算 hidden
const hidden = typeof option.hidden === "function"
? option.hidden(getFormValues())
@ -315,6 +308,13 @@ const FormItemsRenderer = ({
return (
<Col key={option.name || index} span={itemSpan} style={style}>
<Form.Item
noStyle
shouldUpdate={option.shouldUpdate ?? option?.componentProps?.shouldUpdate}
dependencies={option.dependencies || option?.componentProps?.dependencies}
>
{() => {
return (
<Form.Item
name={option.name}
label={renderLabel(option)}
@ -325,11 +325,12 @@ const FormItemsRenderer = ({
>
{renderFormControl(option)}
</Form.Item>
</Col>
);
}}
</Form.Item>
)
</Col>
);
})()
);
}

View File

@ -1,7 +1,7 @@
{
"name": "zy-react-library",
"private": false,
"version": "1.0.27",
"version": "1.0.26",
"type": "module",
"description": "",
"author": "LiuJiaNan",