表单设计器
This commit is contained in:
parent
374a74e4ab
commit
e63ca34702
@ -688,11 +688,14 @@ const FormDesigner: React.FC<FormDesignerProps> = ({
|
||||
open={previewVisible}
|
||||
onCancel={() => setPreviewVisible(false)}
|
||||
width={formConfig.formWidth || 600}
|
||||
bodyStyle={{
|
||||
maxHeight: 'calc(100vh - 200px)',
|
||||
styles={{
|
||||
body: {
|
||||
maxHeight: '60vh',
|
||||
minHeight: '300px',
|
||||
overflowY: 'auto',
|
||||
overflowX: 'hidden',
|
||||
padding: 0,
|
||||
}
|
||||
}}
|
||||
footer={
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
|
||||
@ -117,6 +117,7 @@ const FieldRenderer: React.FC<FieldRendererProps> = ({
|
||||
);
|
||||
|
||||
case 'textarea':
|
||||
console.log('📝 [FieldRenderer] 渲染 textarea,rows:', field.rows, 'field:', field.name);
|
||||
return (
|
||||
<TextArea
|
||||
rows={field.rows || 4}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user