deploy-ease-platform/frontend/src/components/FormDesigner/renderers/strategies/DateStrategy.tsx
2025-11-03 22:38:26 +08:00

29 lines
679 B
TypeScript

/**
* Date 字段渲染策略
*/
import React from 'react';
import { DatePicker } from 'antd';
import { BaseFieldStrategy } from './BaseFieldStrategy';
import type { FieldRenderContext } from '../IFieldRenderStrategy';
export class DateStrategy extends BaseFieldStrategy {
supportsReadonly = false;
render(context: FieldRenderContext): React.ReactNode {
const { field, value, onChange } = context;
const disabledProps = this.getDisabledProps(context);
return (
<DatePicker
style={{ width: '100%' }}
placeholder={field.placeholder}
{...disabledProps}
value={value}
onChange={onChange}
/>
);
}
}