import React from 'react'; import { DetailField, DetailFieldConfig, DetailFieldProps, IDetailField } from '../../detail/common'; import { Display } from '../common'; import { FieldConfigs } from '..'; import { IDetailItem } from '../../../steps/detail'; import InterfaceHelper, { InterfaceConfig } from '../../../util/interface'; /** * 子表单配置项 * - withConfig: 拓展配置 * - * - enable: 是否开启 * - * - dataField: (序列化)数据 * - * - configField: (序列化)配置 */ export interface ImportSubformFieldConfig extends DetailFieldConfig { type: 'import_subform'; configFrom?: ImportSubformConfigFromData | ImportSubformConfigFromInterface; } interface ImportSubformConfigFromData { type: 'data'; dataField?: string; configField?: string; } interface ImportSubformConfigFromInterface { type: 'interface'; interface?: InterfaceConfig; } export interface IImportSubformField { children: React.ReactNode[]; } interface IImportSubformFieldState { didMount: boolean; fields: FieldConfigs[]; formData: { status: 'normal' | 'error' | 'loading'; message?: string; }[]; } export default class ImportSubformFieldDisplay extends DetailField implements IDetailField { getALLComponents: (type: any) => typeof Display; requestConfig: string; value: string; formFields: Array | null>; formFieldsMounted: Array; interfaceHelper: InterfaceHelper; constructor(props: DetailFieldProps); getFullpath(field: string, path?: string): string; didMount: () => Promise; set: (value: any) => Promise; handleMount: (formFieldIndex: number) => Promise; getConfigData: () => void; componentDidMount(): void; componentDidUpdate(): void; handleValueSet: (formFieldIndex: number, path: string, value: any) => Promise; handleValueUnset: (formFieldIndex: number, path: string) => Promise; handleValueListAppend: (formFieldIndex: number, path: string, value: any) => Promise; handleValueListSplice: (formFieldIndex: number, path: string, index: number, count: number) => Promise; renderComponent: (props: IImportSubformField) => JSX.Element; /** * 表单项组件 - UI渲染方法 * 各UI库需重写该方法 * @param props */ renderItemComponent: (props: IDetailItem) => JSX.Element; render: () => JSX.Element; } export {};