表单设计器

This commit is contained in:
dengqichen 2025-10-24 01:18:29 +08:00
parent 374a74e4ab
commit e63ca34702
4 changed files with 34 additions and 17 deletions

View File

@ -688,11 +688,14 @@ const FormDesigner: React.FC<FormDesignerProps> = ({
open={previewVisible}
onCancel={() => setPreviewVisible(false)}
width={formConfig.formWidth || 600}
bodyStyle={{
maxHeight: 'calc(100vh - 200px)',
overflowY: 'auto',
overflowX: 'hidden',
padding: 0,
styles={{
body: {
maxHeight: '60vh',
minHeight: '300px',
overflowY: 'auto',
overflowX: 'hidden',
padding: 0,
}
}}
footer={
<div style={{ textAlign: 'center' }}>

View File

@ -117,6 +117,7 @@ const FieldRenderer: React.FC<FieldRendererProps> = ({
);
case 'textarea':
console.log('📝 [FieldRenderer] 渲染 textarearows:', field.rows, 'field:', field.name);
return (
<TextArea
rows={field.rows || 4}

View File

@ -134,17 +134,9 @@ const PropertyPanel: React.FC<PropertyPanelProps> = ({
key !== 'predefinedCascadeDataSource') {
(updatedField as any)[key] = changedValues[key];
// 🐛 调试:打印验证规则和联动规则的更新
if (key === 'validationRules') {
console.log('💾 [PropertyPanel] 验证规则已更新:', changedValues[key]);
}
if (key === 'linkageRules') {
console.log('💾 [PropertyPanel] 联动规则已更新:', changedValues[key]);
}
}
});
console.log('🔄 [PropertyPanel] 字段配置更新完成:', updatedField);
onFieldChange(updatedField);
}
};

View File

@ -176,7 +176,7 @@
}
/* 确保所有表单组件高度一致 */
.ant-form-item .ant-input,
.ant-form-item .ant-input:not(textarea),
.ant-form-item .ant-input-number,
.ant-form-item .ant-input-number-input-wrap,
.ant-form-item .ant-select-selector,
@ -185,6 +185,12 @@
height: 32px !important;
}
/* textarea 使用 auto 高度以支持多行 */
.ant-form-item textarea.ant-input {
height: auto !important;
min-height: auto !important;
}
.ant-form-item .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
height: 32px !important;
display: flex;
@ -201,7 +207,7 @@
}
/* 中等尺寸 */
.ant-form-middle .ant-input,
.ant-form-middle .ant-input:not(textarea),
.ant-form-middle .ant-input-number,
.ant-form-middle .ant-input-number-input-wrap,
.ant-form-middle .ant-select-selector,
@ -210,12 +216,17 @@
height: 32px !important;
}
.ant-form-middle textarea.ant-input {
height: auto !important;
min-height: auto !important;
}
.ant-form-middle .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
height: 32px !important;
}
/* 大尺寸 */
.ant-form-large .ant-input,
.ant-form-large .ant-input:not(textarea),
.ant-form-large .ant-input-number,
.ant-form-large .ant-input-number-input-wrap,
.ant-form-large .ant-select-selector,
@ -224,12 +235,17 @@
height: 40px !important;
}
.ant-form-large textarea.ant-input {
height: auto !important;
min-height: auto !important;
}
.ant-form-large .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
height: 40px !important;
}
/* 小尺寸 */
.ant-form-small .ant-input,
.ant-form-small .ant-input:not(textarea),
.ant-form-small .ant-input-number,
.ant-form-small .ant-input-number-input-wrap,
.ant-form-small .ant-select-selector,
@ -238,6 +254,11 @@
height: 24px !important;
}
.ant-form-small textarea.ant-input {
height: auto !important;
min-height: auto !important;
}
.ant-form-small .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
height: 24px !important;
}