Skip to content

Commit

Permalink
🐛 fix: type == "update" not show formItem
Browse files Browse the repository at this point in the history
  • Loading branch information
eternallycyf committed Apr 29, 2024
1 parent 3e2adde commit 3d57a22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const UpdateControl = React.forwardRef<any, IUpdateControlProps>((props, ref) =>
return (
<Fragment key={random.getUUID()}>
{((nextValues as any[]) || []).map((item: any, index: number) => (
<Col span={item?.['col'] ?? 0} key={index}>
<Col span={item?.['col'] == undefined ? 24 : item?.['col'] || 0} key={index}>
<Form.Item
labelAlign="right"
label={item?.label}
Expand Down
19 changes: 9 additions & 10 deletions packages/ims-view-pc/src/core/helpers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,15 @@ export const getFieldComp: FieldCompType = ({

if (!FieldComp) return null;

return (
<Form.Item
key={name || random.getUUID()}
name={name}
label={label ?? ''}
{...(formProps?.itemProps as any)}
>
<FieldComp {...formProps} />
</Form.Item>
);
if (form) {
return (
<Form.Item name={name} label={label ?? ''} {...(formProps?.itemProps as any)}>
<FieldComp {...formProps} />
</Form.Item>
);
} else {
return <FieldComp {...formProps} />;
}
};

export const renderFormItem = (item: any, index?: number) => {
Expand Down

0 comments on commit 3d57a22

Please sign in to comment.