mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 14:39:25 +08:00
Merge branch 'next' into develop
This commit is contained in:
commit
2dbce800d5
@ -1095,5 +1095,6 @@
|
||||
"Font Weight": "字体粗细",
|
||||
"Font Style": "字体样式",
|
||||
"Italic": "斜体",
|
||||
"Response record":"响应结果记录"
|
||||
"Response record":"响应结果记录",
|
||||
"Colon":"冒号"
|
||||
}
|
||||
|
@ -50,19 +50,20 @@ const FormComponent: React.FC<FormProps> = (props) => {
|
||||
labelAlign = 'left',
|
||||
labelWidth = 120,
|
||||
labelWrap = true,
|
||||
colon = true,
|
||||
} = cardItemSchema?.['x-component-props'] || {};
|
||||
const { isMobileLayout } = useMobileLayout();
|
||||
const newSchema = useMemo(
|
||||
() => (isMobileLayout ? transformMultiColumnToSingleColumn(fieldSchema) : fieldSchema),
|
||||
[fieldSchema, isMobileLayout],
|
||||
);
|
||||
|
||||
return (
|
||||
<FieldContext.Provider value={undefined}>
|
||||
<FormContext.Provider value={form}>
|
||||
<FormLayout
|
||||
layout={layout}
|
||||
{...others}
|
||||
colon={colon}
|
||||
labelAlign={labelAlign}
|
||||
labelWidth={layout === 'horizontal' ? labelWidth : null}
|
||||
labelWrap={labelWrap}
|
||||
|
@ -107,20 +107,30 @@ export const SchemaSettingsLayoutItem = function LayoutItem() {
|
||||
},
|
||||
},
|
||||
},
|
||||
colon: {
|
||||
type: 'boolean',
|
||||
'x-content': t('Colon'),
|
||||
required: true,
|
||||
default: fieldSchema?.['x-component-props']?.colon !== false,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Checkbox',
|
||||
},
|
||||
},
|
||||
} as ISchema
|
||||
}
|
||||
onSubmit={({ layout, labelAlign, labelWidth, labelWrap }) => {
|
||||
onSubmit={({ layout, labelAlign, labelWidth, labelWrap, colon }) => {
|
||||
const componentProps = fieldSchema['x-component-props'] || {};
|
||||
componentProps.layout = layout;
|
||||
componentProps.labelAlign = labelAlign;
|
||||
componentProps.labelWidth = layout === 'horizontal' ? labelWidth : null;
|
||||
componentProps.labelWrap = labelWrap;
|
||||
componentProps.colon = colon;
|
||||
fieldSchema['x-component-props'] = componentProps;
|
||||
field.componentProps.layout = layout;
|
||||
field.componentProps.labelAlign = labelAlign;
|
||||
field.componentProps.labelWidth = labelWidth;
|
||||
field.componentProps.labelWrap = labelWrap;
|
||||
field.componentProps.colon = colon;
|
||||
dn.emit('patch', {
|
||||
schema: {
|
||||
['x-uid']: fieldSchema['x-uid'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user