import React__default, { ReactNode } from 'react'; type FormSectionVariant = 'plain' | 'card'; type FormSectionAccent = 'blue' | 'green'; type FormSectionIconKey = 'user' | 'calendar' | 'file' | 'device'; interface FormSectionProps { title: string; description?: string; variant?: FormSectionVariant; accent?: FormSectionAccent; icon?: React__default.ReactNode; iconKey?: FormSectionIconKey; collapsible?: boolean; defaultCollapsed?: boolean; className?: string; titleClassName?: string; contentClassName?: string; children: React__default.ReactNode; } declare function FormSection({ title, description, variant, accent, icon, iconKey, collapsible, defaultCollapsed, className, titleClassName, contentClassName, children, }: FormSectionProps): React__default.JSX.Element; /** 字段行为状态 */ type FieldBehavior = 'NORMAL' | 'READONLY' | 'DISABLED' | 'HIDDEN'; type FormEngineMode = 'submit' | 'edit' | 'readonly'; type StandardFormPageMode = FormEngineMode | 'detail' | 'process'; type FormSubmitBehavior = 'auto' | 'create' | 'update' | 'save-draft' | 'start-existing-process'; /** 校验预设模式 */ type ValidationPreset = 'phone' | 'idCard' | 'email' | 'url' | 'bankCard'; /** 校验规则 */ interface ValidationRule { required?: boolean; message?: string; min?: number; max?: number; minLength?: number; maxLength?: number; preset?: ValidationPreset; pattern?: RegExp | string; validator?: (value: any) => Promise | void; } /** 字段声明(schema 中的每个字段定义) */ interface FieldDefinition { fieldId: string; componentName: string; label: string; required?: boolean; rules?: ValidationRule[]; behavior?: FieldBehavior; placeholder?: string; tips?: string; defaultValue?: any; defaultValueType?: 'static' | 'expression'; defaultValueExpression?: string; [key: string]: any; } type DateShortcutType = 'today' | 'yesterday' | 'tomorrow' | 'currentWeek' | 'currentMonth' | 'pastDays' | 'futureDays'; interface DateShortcutConfig { type: DateShortcutType; amount?: number; format?: string; includeTime?: boolean; } type PeopleShortcutType = 'currentUser' | 'currentDepartment' | 'parentDepartment' | 'role' | 'fixed' | 'currentUserManager' | 'currentUserManager2'; interface PeopleShortcutConfig { type: PeopleShortcutType; roleId?: string; values?: any[]; } type TextShortcutType = 'currentUserName' | 'currentUserJobNumber' | 'currentDeptName' | 'uuid'; interface TextShortcutConfig { type: TextShortcutType; } interface LayoutVisibleWhen { field: string; operator: 'eq' | 'ne' | 'in' | 'notIn' | 'contains' | 'empty' | 'notEmpty' | 'between' | 'changed'; value?: any; } interface BaseLayoutNode { id: string; type: 'field' | 'section' | 'grid' | 'tabs' | 'steps'; hidden?: boolean; visibleWhen?: LayoutVisibleWhen | LayoutVisibleWhen[]; } interface FieldLayoutNode extends BaseLayoutNode { type: 'field'; fieldId: string; span?: number; className?: string; } interface SectionLayoutNode extends BaseLayoutNode { type: 'section'; title: string; description?: string; variant?: FormSectionVariant; accent?: FormSectionAccent; iconKey?: FormSectionIconKey; collapsible?: boolean; defaultCollapsed?: boolean; children: FormLayoutNode[]; } interface GridLayoutCell { key?: string; children: FormLayoutNode[]; } interface GridLayoutNode extends BaseLayoutNode { type: 'grid'; columns?: 1 | 2 | 3 | 4; gap?: number | string; columnGap?: number | string; rowGap?: number | string; columnRatios?: number[]; layoutPreset?: string; cells?: GridLayoutCell[]; children: FormLayoutNode[]; } interface TabLayoutItem { key: string; label: string; children: FormLayoutNode[]; } interface TabsLayoutNode extends BaseLayoutNode { type: 'tabs'; defaultActiveKey?: string; items: TabLayoutItem[]; } interface StepLayoutItem { key: string; title: string; description?: string; children: FormLayoutNode[]; } interface StepsLayoutNode extends BaseLayoutNode { type: 'steps'; items: StepLayoutItem[]; } type FormLayoutNode = FieldLayoutNode | SectionLayoutNode | GridLayoutNode | TabsLayoutNode | StepsLayoutNode; interface FormTemplateConfig { type?: 'standard'; defaultMode?: StandardFormPageMode; formType?: 'form' | 'process'; submitSuccessMode?: 'redirect' | 'stay' | 'continue'; enableDraft?: boolean; enableProcessPreview?: boolean; enableEdit?: boolean; enableDelete?: boolean; enableChangeRecords?: boolean; appearance?: FormAppearanceConfig; } interface FormAppearanceConfig { layout?: 'horizontal' | 'vertical' | 'inline'; variant?: 'outlined' | 'borderless' | 'filled' | 'underlined'; size?: 'small' | 'middle' | 'large'; columns?: 1 | 2 | 3 | 4; rendererSize?: 'compact' | 'default' | 'large'; gap?: number | string; maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | 'full' | number | string; requiredMark?: boolean | 'optional'; colon?: boolean; labelCol?: Record; wrapperCol?: Record; scrollToFirstError?: boolean | Record; } interface FormRuntimeConfig { version?: string; generatedAt?: string; editorVersion?: string; currentUser?: UserItem; currentDepartment?: DepartmentTreeNode; currentUserManagers?: UserItem[]; appType?: string; /** * 运行时数据查询函数(带权限控制) * 由宿主环境(app-workspace)注入,底层应调用 advancedSearch 接口 */ fetchFormData?: (params: RuntimeDataQueryParams) => Promise; [key: string]: any; } interface RuntimeDataQueryParams { formUuid: string; appType: string; filters?: Array<{ fieldId: string; operator: string; value?: any; }>; conditionLogic?: 'and' | 'or'; sort?: { field: string; order: 'asc' | 'desc'; }; fieldId?: string; deduplicate?: boolean; pageSize?: number; currentPage?: number; } interface RuntimeDataQueryResult { data: any[]; totalCount?: number; } /** 表单 Schema 定义 */ interface FormSchema { formMeta: { formUuid: string; appType: string; title: string; }; fields: FieldDefinition[]; layout?: FormLayoutNode[]; rules?: FormEffect[]; template?: FormTemplateConfig; runtime?: FormRuntimeConfig; } interface LowcodePageMeta { pageId?: string; pageCode?: string; routeKey?: string; appType: string; title: string; } type LowcodePageNodeType = 'PageSection' | 'PageGrid' | 'HeadingBlock' | 'TextBlock' | 'DataManagementList' | 'FormBlock'; interface LowcodePageNode { id: string; type: LowcodePageNodeType | string; props?: Record; children?: LowcodePageNode[]; cells?: Array<{ key?: string; children: LowcodePageNode[]; }>; } interface LowcodePageSchema { schemaKind: 'page'; pageMeta: LowcodePageMeta; nodes: LowcodePageNode[]; dataSources?: Array>; runtime?: Record; } interface RuntimeResponse { code?: number; success?: boolean; data?: T; result?: T; message?: string; error?: string; releaseControl?: { revision?: number; etag?: string; activeFormReleaseHead?: Record; }; } interface RuntimeRequestConfig { url: string; method?: string; params?: Record; data?: any; headers?: HeadersInit; responseType?: 'json' | 'blob'; } type RuntimeAuthHeadersProvider = () => HeadersInit | undefined; type RuntimeUploadProvider = 'platform' | 'oss' | 'builtin-oss'; interface RuntimeUploadOptions { uploadProvider?: RuntimeUploadProvider; storageScope?: 'app' | 'platform'; storageCode?: string; appType?: string; /** Explicit public form context. The server compares these values with the * signed guest policy claim; they are never trusted as authorization. */ policyCode?: string; routeCode?: string; formUuid?: string; formCode?: string; fieldId?: string; uploadPurpose?: 'attachment' | 'image'; imageCompression?: ImageCompressionConfig; } interface FormRuntimeApi { request: (config: RuntimeRequestConfig) => Promise | Blob>; uploadFile: (file: File, bucketName?: string, onProgress?: (percent: number) => void, options?: RuntimeUploadOptions) => Promise; uploadPublicFile: (file: File, bucketName?: string, onProgress?: (percent: number) => void) => Promise; deleteFile: (objectName: string, bucketName?: string, options?: RuntimeUploadOptions) => Promise<{ success: boolean; }>; createDownloadTicket: (bucketName: string, objectName: string, fileName?: string) => Promise; /** * Creates a protected file access ticket. * * previewPageUrl is the page URL that can be opened directly. * previewUrl is the raw file content stream URL for iframe/img/PDF viewers. */ createFileAccessTicket: (bucketName: string, objectName: string, fileName?: string, purpose?: 'download' | 'preview' | 'onlyoffice', options?: { appType?: string; }) => Promise; getUserById: (id: string) => Promise; getUserList: (params?: Record) => Promise; getDepartmentRoots: () => Promise; getDepartmentChildren: (parentId: string) => Promise; searchDepartments?: (params: DepartmentSearchParams) => Promise; getDepartmentParentDepartments: (id: string) => Promise; getDepartmentMembers: (id: string) => Promise; getDepartmentMembersPage: (id: string, params?: { page?: number; pageSize?: number; }) => Promise<{ items: any[]; total: number; page: number; pageSize: number; }>; getChinaDivisions: (parentAdcode?: string) => Promise; advancedSearch: (params: Record) => Promise; getDingTalkSignature: (url: string) => Promise; submitFormData: (payload: Record) => Promise; updateFormData: (payload: Record) => Promise; startProcessFromExistingInstance: (payload: Record) => Promise; } type FormRuntimeApiConfig = Partial & { baseUrl?: string; fetchImpl?: typeof fetch; getAuthHeaders?: RuntimeAuthHeadersProvider; }; /** 表单引擎配置 */ interface FormEngineConfig { mode: FormEngineMode; formUuid: string; appType: string; defaultUploadProvider?: RuntimeUploadProvider; formInstanceId?: string; submitBehavior?: FormSubmitBehavior; permissions?: { fieldPermissions: Record; operations: string[]; }; submit?: { beforeSubmit?: (values: Record) => Promise; afterSubmit?: (response: any) => Promise; submitSuccessMode?: 'redirect' | 'stay' | 'callback'; redirectUrl?: string; }; api?: FormRuntimeApiConfig; navigation?: { basePath?: string; }; compatibility?: { apiContracts?: 'strict' | 'legacy'; legacyFallbacks?: boolean; }; effects?: FormEffect[]; } type FormEffectConditionOperator = 'eq' | 'ne' | 'in' | 'notIn' | 'contains' | 'empty' | 'notEmpty' | 'between' | 'changed'; type FormEffectCondition = { field: string; operator: FormEffectConditionOperator; value?: any; } | { all: FormEffectCondition[]; } | { any: FormEffectCondition[]; } | { not: FormEffectCondition; }; type FormEffectAction = { field: string; action: 'show' | 'hide' | 'enable' | 'disable' | 'setValue' | 'clearValue' | 'setRequired' | 'setOptions'; value?: any; } | { target: string; targetType?: 'field' | 'layout'; action: 'show' | 'hide' | 'enable' | 'disable' | 'setValue' | 'clearValue' | 'setRequired' | 'setOptions'; value?: any; }; /** 字段联动效果 */ interface FormEffect { id?: string; name?: string; when: FormEffectCondition; then: FormEffectAction[]; } /** 基础字段组件 Props */ interface BaseFieldProps { fieldId: string; label: string; value?: any; behavior?: FieldBehavior; required?: boolean; rules?: ValidationRule[]; placeholder?: string; tips?: string; className?: string; labelClassName?: string; inputClassName?: string; tipsClassName?: string; readonlyClassName?: string; onChange?: (value: any) => void; onBlur?: (value: any) => void; } /** TextField 专用 Props */ interface TextFieldProps extends BaseFieldProps { defaultValue?: string; maxLength?: number; showCount?: boolean; allowClear?: boolean; prefix?: string; suffix?: string; autoComplete?: string; variant?: FormAppearanceConfig['variant']; size?: FormAppearanceConfig['size']; defaultShortcut?: TextShortcutConfig; defaultValueLinkage?: DefaultValueLinkageConfig; validationPresets?: ValidationPreset[]; } /** NumberField 专用 Props */ interface NumberFieldProps extends BaseFieldProps { defaultValue?: number | null; min?: number; max?: number; step?: number; precision?: number; unit?: string; unitPosition?: 'prefix' | 'suffix'; thousandSeparator?: boolean; controls?: boolean; keyboard?: boolean; stringMode?: boolean; variant?: FormAppearanceConfig['variant']; size?: FormAppearanceConfig['size']; } /** TextAreaField 专用 Props */ interface TextAreaFieldProps extends BaseFieldProps { defaultValue?: string; rows?: number; minRows?: number; maxRows?: number; autoSize?: boolean | { minRows?: number; maxRows?: number; }; maxLength?: number; showCount?: boolean; allowClear?: boolean; autoComplete?: string; variant?: FormAppearanceConfig['variant']; size?: FormAppearanceConfig['size']; defaultShortcut?: TextShortcutConfig; defaultValueLinkage?: DefaultValueLinkageConfig; } /** 选项类型 */ interface OptionItem { value: string; label: string; color?: string; disabled?: boolean; } interface FieldValueSyncConfig { targetFieldId: string; valuePath?: 'value' | 'label'; emptyValue?: any; } type OptionSourceType = 'custom' | 'linkedForm' | 'dataLinkage'; interface OptionSourceConfig { type: OptionSourceType; linkedForm?: LinkedFormOptionConfig; dataLinkage?: DataLinkageConfig; } interface LinkedFormOptionConfig { formUuid: string; formTitle?: string; fieldId: string; fieldLabel?: string; valueFieldId?: string; valueFieldLabel?: string; labelFieldId?: string; labelFieldLabel?: string; searchFieldId?: string; searchFieldLabel?: string; sortField?: string; sortOrder?: 'asc' | 'desc'; filters?: DataFilter[]; deduplicate?: boolean; pageSize?: number; remoteSearch?: boolean; remoteSearchMinChars?: number; } interface DataLinkageConfig { formUuid: string; formTitle?: string; targetFieldId: string; targetFieldLabel?: string; conditions: DataLinkageCondition[]; conditionLogic?: 'and' | 'or'; deduplicate?: boolean; } interface DataLinkageCondition { localFieldId: string; localFieldLabel?: string; localComponentName?: string; operator: 'eq' | 'ne' | 'contains' | 'gt' | 'lt' | 'gte' | 'lte'; remoteFieldId: string; remoteFieldLabel?: string; remoteComponentName?: string; } interface DataFilter { fieldId: string; fieldLabel?: string; componentName?: string; operator: 'eq' | 'ne' | 'contains' | 'gt' | 'lt' | 'gte' | 'lte' | 'in' | 'notIn' | 'empty' | 'notEmpty'; value?: any; } interface DefaultValueLinkageConfig { formUuid: string; formTitle?: string; targetFieldId: string; targetFieldLabel?: string; conditions: DataLinkageCondition[]; conditionLogic?: 'and' | 'or'; } type DateRangeRestriction = 'none' | 'todayAndAfter' | 'todayAndBefore' | 'custom'; interface DateRestrictionConfig { type: DateRangeRestriction; customStart?: string; customEnd?: string; } type UserDisplayFormat = 'name' | 'nameWithJobNumber' | 'nameWithDepartment'; /** SelectField 专用 Props */ interface SelectFieldProps extends BaseFieldProps { defaultValue?: OptionItem | null; options: OptionItem[]; allowClear?: boolean; showSearch?: boolean; optionFilterProp?: string; optionLabelProp?: string; placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight'; maxTagTextLength?: number; variant?: FormAppearanceConfig['variant']; size?: FormAppearanceConfig['size']; optionEffects?: FormEffect[]; optionSource?: OptionSourceConfig; coloredOptions?: boolean; defaultValueLinkage?: DefaultValueLinkageConfig; valueSync?: FieldValueSyncConfig[]; } /** MultiSelectField 专用 Props */ interface MultiSelectFieldProps extends BaseFieldProps { defaultValue?: OptionItem[]; options: OptionItem[]; allowClear?: boolean; showSearch?: boolean; maxCount?: number; maxTagCount?: number | 'responsive'; maxTagTextLength?: number; optionFilterProp?: string; optionLabelProp?: string; placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight'; variant?: FormAppearanceConfig['variant']; size?: FormAppearanceConfig['size']; optionEffects?: FormEffect[]; optionSource?: OptionSourceConfig; coloredOptions?: boolean; } /** RadioField 专用 Props */ interface RadioFieldProps extends BaseFieldProps { defaultValue?: OptionItem | null; options: OptionItem[]; direction?: 'horizontal' | 'vertical'; optionType?: 'default' | 'button'; buttonStyle?: 'outline' | 'solid'; size?: FormAppearanceConfig['size']; optionEffects?: FormEffect[]; optionSource?: OptionSourceConfig; coloredOptions?: boolean; } /** CheckboxField 专用 Props */ interface CheckboxFieldProps extends BaseFieldProps { defaultValue?: OptionItem[]; options: OptionItem[]; direction?: 'horizontal' | 'vertical'; maxCount?: number; optionEffects?: FormEffect[]; optionSource?: OptionSourceConfig; coloredOptions?: boolean; } /** DateField 专用 Props */ interface DateFieldProps extends BaseFieldProps { defaultValue?: string; defaultShortcut?: DateShortcutConfig; dateFormat?: string; showTime?: boolean; dateRestriction?: DateRestrictionConfig; defaultValueLinkage?: DefaultValueLinkageConfig; } /** CascadeDateField 专用 Props */ interface CascadeDateFieldProps extends BaseFieldProps { defaultValue?: { start: string; end: string; } | null; defaultShortcut?: DateShortcutConfig; dateFormat?: string; showTime?: boolean; startLabel?: string; endLabel?: string; dateRestriction?: DateRestrictionConfig; defaultValueLinkage?: DefaultValueLinkageConfig; } /** 附件项 */ interface ImageVariant { url: string; objectName?: string; bucketName?: string; width?: number; height?: number; size?: number; contentType?: string; quality?: number; } interface AttachmentImageVariants { thumb?: ImageVariant; preview?: ImageVariant; } interface AttachmentItem { url: string; name: string; id: string; uid?: string; status?: 'uploading' | 'done' | 'error'; provider?: 'platform' | 'oss'; uploadProvider?: RuntimeUploadProvider; storageScope?: 'app' | 'platform'; storageCode?: string; appType?: string; objectName?: string; bucketName?: string; originalName?: string; contentType?: string; mimeType?: string; extension?: string; thumbUrl?: string; previewUrl?: string; publicUrl?: string; downloadUrl?: string; width?: number; height?: number; variants?: AttachmentImageVariants; visibility?: 'public' | 'private'; size?: number; percent?: number; error?: string; } interface ImageCompressionVariantConfig { /** 压缩变体最大宽度,默认 thumb=320、preview=1280。 */ maxWidth?: number; /** 压缩变体最大高度,默认 thumb=320、preview=1280。 */ maxHeight?: number; /** JPEG/WebP 输出质量,取值 0-1;PNG 会忽略该值。 */ quality?: number; /** 默认 source 保持原图格式;显式 webp/png/jpeg 时需确保存储 allowedExtensions 放行。 */ format?: 'source' | 'jpeg' | 'webp' | 'png'; } interface ImageCompressionConfig { /** 设为 false 时完全跳过压缩;默认只有显式配置 imageCompression 才启用。 */ enabled?: boolean; /** 预留选项;当前默认始终保留原图 url,并附加 thumb/preview 变体。 */ preserveOriginal?: boolean; /** 小于等于该字节数的图片不生成压缩变体。 */ skipBelowBytes?: number; /** 缩略图配置;设为 false 时不生成 thumb。 */ thumb?: ImageCompressionVariantConfig | false; /** 预览图配置;设为 false 时不生成 preview。 */ preview?: ImageCompressionVariantConfig | false; } /** AttachmentField 专用 Props */ interface AttachmentFieldProps extends BaseFieldProps { defaultValue?: AttachmentItem[]; maxCount?: number; accept?: string; maxSize?: number; uploadAction?: string; bucketName?: string; /** 自定义上传提供方;oss 需配置 storageCode,builtin-oss 使用平台内置 OSS。 */ uploadProvider?: RuntimeUploadProvider; /** src/resources/storage/.json 中声明的存储 code。 */ storageCode?: string; multiple?: boolean; allowedTypes?: string[]; showPreview?: boolean; showDownload?: boolean; showFileSize?: boolean; showFileTypeBadge?: boolean; /** @deprecated Preview now opens in the runtime dialog; use ticket previewPageUrl for shareable links. */ previewPagePath?: string; mobileDownloadMode?: 'auto' | 'direct' | 'ticketRelay'; /** 图片附件的浏览器端压缩配置;非图片、GIF、SVG 会自动跳过。 */ imageCompression?: ImageCompressionConfig; } /** ImageField 专用 Props */ interface ImageFieldProps extends BaseFieldProps { defaultValue?: AttachmentItem[]; maxCount?: number; accept?: string; uploadAction?: string; bucketName?: string; /** 自定义上传提供方;oss 需配置 storageCode,builtin-oss 使用平台内置 OSS。 */ uploadProvider?: RuntimeUploadProvider; /** src/resources/storage/.json 中声明的存储 code。 */ storageCode?: string; multiple?: boolean; maxSize?: number; listType?: 'text' | 'picture' | 'picture-card'; showPreviewIcon?: boolean; showRemoveIcon?: boolean; showDownloadIcon?: boolean; /** 浏览器端压缩配置;原图 url 保留,压缩图写入 thumbUrl/previewUrl/variants。 */ imageCompression?: ImageCompressionConfig; } /** 子表单列定义 */ interface SubFormColumn { fieldId: string; label: string; componentName: string; [key: string]: any; } /** SubFormField 专用 Props */ interface SubFormFieldProps extends BaseFieldProps { defaultValue?: Record[]; columns: SubFormColumn[]; maxRows?: number; minRows?: number; } /** 用户数据源项 */ interface UserItem { id: string; name: string; value?: string; label?: string; username?: string; jobNumber?: string; avatar?: string; departments?: Array<{ id?: string; name?: string; }>; } type InitiatorSelectScope = 'all' | 'members' | 'roles'; type InitiatorSelectedApprovers = Record; interface InitiatorSelectCandidate extends UserItem { phone?: string; email?: string; } interface InitiatorSelectRequirement { nodeId: string; nodeName: string; scope: InitiatorSelectScope; approvals?: string[]; approvalNames?: string[]; multiApprove?: 'all' | 'or' | 'oneByOne'; candidateUsers?: InitiatorSelectCandidate[]; totalCandidates?: number; } /** UserSelectField 专用 Props */ interface UserSelectFieldProps extends BaseFieldProps { defaultValue?: UserItem[]; defaultShortcut?: PeopleShortcutConfig; multiple?: boolean; searchable?: boolean; dataSource?: UserItem[]; treeData?: DepartmentTreeNode[]; allowClear?: boolean; maxCount?: number; notFoundContent?: string; displayFormat?: UserDisplayFormat; defaultValueLinkage?: DefaultValueLinkageConfig; } /** 部门树节点 */ interface DepartmentTreeNode { id: string; name: string; value?: string; label?: string; key?: string; title?: string; hasChildren?: boolean; isLeaf?: boolean; path?: Array<{ id: string; name: string; }>; fullPath?: string; children?: DepartmentTreeNode[]; } type DepartmentSearchScope = 'loaded' | 'all'; interface DepartmentSearchParams { keyword: string; page?: number; pageSize?: number; includePath?: boolean; } interface DepartmentSearchResult { items: DepartmentTreeNode[]; total: number; page: number; pageSize: number; } /** DepartmentSelectField 专用 Props */ interface DepartmentSelectFieldProps extends BaseFieldProps { defaultValue?: { id: string; name: string; }[]; defaultShortcut?: PeopleShortcutConfig; multiple?: boolean; treeData?: DepartmentTreeNode[]; allowClear?: boolean; maxCount?: number; notFoundContent?: string; showSearch?: boolean; searchScope?: DepartmentSearchScope; searchMinLength?: number; searchDebounceMs?: number; showFullPath?: boolean; scopeType?: 'all' | 'specified'; specifiedDepts?: string[]; defaultValueLinkage?: DefaultValueLinkageConfig; } interface CascadeSelectFieldProps extends BaseFieldProps { defaultValue?: OptionItem[] | OptionItem[][]; options?: Array; multiple?: boolean; allowClear?: boolean; changeOnSelect?: boolean; showSearch?: boolean; fieldNames?: { label?: string; value?: string; children?: string; }; } interface AddressValue { country?: OptionItem; province?: OptionItem; city?: OptionItem; district?: OptionItem; street?: OptionItem; detail?: string; fullAddress?: string; } interface AddressFieldProps extends BaseFieldProps { defaultValue?: AddressValue; mode?: 'province-city' | 'province-city-district' | 'province-city-district-street' | 'province-city-district-street-detail'; detailPlaceholder?: string; allowClear?: boolean; } interface AssociationFormConfig { appType: string; formUuid: string; mainFieldId: string; selectorColumns?: Array; dataFilterRules?: Array<{ key: string; operator?: string; componentName?: string; value?: string | number; valueType?: 'manual' | 'currentField'; currentFieldKey?: string; }>; dataFilterConditionType?: 'AND' | 'OR'; dataFillingEnabled?: boolean; dataFillingRules?: { mainRules?: Array<{ source: string; target: string; sourceType?: string; targetType?: string; }>; }; } interface AssociationValue { label: string; value: string | number; record?: Record; } interface AssociationFormFieldProps extends BaseFieldProps { defaultValue?: AssociationValue | AssociationValue[]; associationForm?: AssociationFormConfig; multiple?: boolean; allowClear?: boolean; showSearch?: boolean; } type EditorToolbarAction = 'undo' | 'redo' | 'heading' | 'fontFamily' | 'fontSize' | 'bold' | 'italic' | 'underline' | 'strike' | 'superscript' | 'subscript' | 'color' | 'highlight' | 'bulletList' | 'orderedList' | 'taskList' | 'blockquote' | 'codeBlock' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'link' | 'image' | 'imageUrl' | 'table' | 'addColumnBefore' | 'addColumnAfter' | 'deleteColumn' | 'addRowBefore' | 'addRowAfter' | 'deleteRow' | 'toggleHeaderRow' | 'deleteTable' | 'clear'; interface EditorChoiceOption { label: string; value: string; } interface EditorFieldProps extends BaseFieldProps { defaultValue?: string; rows?: number; maxLength?: number; height?: number | string; toolbarConfig?: 'full' | 'basic' | 'minimal' | EditorToolbarAction[] | string[]; uploadBucketName?: string; maxImageSize?: number; allowedImageTypes?: string[]; fontFamilies?: EditorChoiceOption[]; fontSizes?: EditorChoiceOption[]; colorPresets?: string[]; } interface SerialNumberFieldProps extends BaseFieldProps { defaultValue?: string; serialNumberRule?: Array>; } interface LocationValue { latitude: number; longitude: number; address?: string; city?: string; district?: string; province?: string; name?: string; accuracy?: number; source?: 'browser' | 'dingTalk' | 'manual'; time?: number; } interface LocationFieldProps extends BaseFieldProps { defaultValue?: LocationValue; allowClear?: boolean; locateButtonText?: string; clearButtonText?: string; } interface SignaturePoint { x: number; y: number; t: number; } interface DigitalSignatureValue { url?: string; bucketName?: string; objectName?: string; previewUrl?: string; points?: SignaturePoint[]; timestamp?: number; hash?: string; } interface DigitalSignatureFieldProps extends BaseFieldProps { defaultValue?: DigitalSignatureValue; bucketName?: string; allowClear?: boolean; } interface JSONFieldRendererContext { fieldId: string; label: string; value: any; formattedValue: string; behavior: FieldBehavior; } interface JSONFieldEditorContext extends JSONFieldRendererContext { disabled: boolean; error?: string; onChange: (value: any) => void; onError: (error?: string) => void; } interface JSONFieldProps extends BaseFieldProps { defaultValue?: any; indent?: number; rows?: number; renderer?: (context: JSONFieldRendererContext) => ReactNode; editor?: (context: JSONFieldEditorContext) => ReactNode; } /** 流程状态 */ type ProcessStatus = 'running' | 'waiting' | 'exception' | 'completed' | 'terminated' | 'withdrawn' | 'pending' | 'cancelled'; /** 任务状态 */ type TaskStatus = 'pending' | 'approved' | 'rejected' | 'returned' | 'suspended' | 'cancelled' | 'copied' | 'waiting' | 'simulated'; /** 流程任务节点类型 */ type ProcessNodeType = 'start' | 'approval' | 'copy' | 'end' | 'system' | 'originator_return' | 'callback_wait'; /** 审批操作类型 */ type ApprovalActionType = 'agree' | 'approved' | 'rejected' | 'reject' | 'transfer' | 'return' | 'save' | 'withdraw' | 'resubmit' | 'callback'; /** 流程操作动作定义 */ interface ProcessAction { action: ApprovalActionType; name: { zh_CN: string; en_US?: string; }; text?: { zh_CN?: string; en_US?: string; }; hidden?: boolean; remark?: { popUp: boolean; required?: boolean; content?: { zh_CN: string; en_US?: string; }; }; } /** 流程任务 */ interface ProcessTask { id?: string; taskId: string; nodeId: string; nodeVisitId?: string; nodeType: ProcessNodeType; nodeName: string; title?: string; status: TaskStatus; canApprove?: boolean; assigneeId?: string; assignee?: string; assigneeName?: string; departmentName?: string; comments?: string; createdAt?: string; actionAt?: string; actions?: ProcessAction[]; isSimulated?: boolean; multiApproveMode?: 'and' | 'or' | string; } /** 流程基本信息 */ interface ProcessBasicInfo { instanceId: string; processStatus: ProcessStatus; formUuid: string; appType: string; title?: string; originatorId: string; originatorName: string; originatorDepartment?: string; createdAt: string; currentTask?: ProcessTask; isExecuting?: boolean; } /** 审批权限 */ interface ApprovalPermission { hasPermission: boolean; canUndo: boolean; isApprover: boolean; currentTasks?: ProcessTask[]; futureTasksCount?: number; details?: string; } /** 可退回节点 */ interface ReturnableNode { nodeId: string; nodeName: string; id?: string; name?: string; type?: string; } interface ReturnPolicy { resubmitMode?: string; [key: string]: any; } interface ReturnableNodeResult { nodes: ReturnableNode[]; policy?: ReturnPolicy | null; } /** 流程预览路由 */ interface ProcessRoute { nodeId: string; nodeName: string; nodeType: ProcessNodeType; assignees: Array<{ id: string; name: string; }>; } /** 流程定义 */ interface ProcessDefinition { processId: string; flowConfig?: Record>; startNodeId?: string; nodes?: Array>; definitionJson?: Record; viewJson?: Record; } /** 视图权限摘要 */ interface ViewPermissionSummary { fieldPermissions: Record; operations: string[]; actions?: string[]; can?: Record; fieldAccessPolicy?: any; hasFullAccess?: boolean; resourceType?: string; matchedGroupCodes?: string[]; } /** 表单实例数据 */ interface FormInstanceData { formInstanceId: string; formUuid: string; appType: string; title?: string; instanceTitle?: string; data: Record; creator?: { userId: string; name: string; avatar?: string; department?: string; }; createdBy?: string; createdByName?: string; createdByDepartmentId?: string; createdByDepartmentName?: string; createdAt: string; updatedAt?: string; } /** 变更记录 */ interface ChangeRecord { id: string; fieldId: string; fieldLabel: string; oldValue: any; newValue: any; operatorId: string; operatorName: string; operatedAt: string; operatorDepartmentName?: string; operationId?: string; changeType?: 'create' | 'update' | 'delete' | string; changeSource?: string; changedCount?: number; createdAt?: string; changes?: Array<{ fieldKey?: string; fieldLabel?: string; beforeValue?: any; afterValue?: any; }>; } /** 变更记录列表响应 */ interface ChangeRecordListResponse { records: ChangeRecord[]; total: number; page: number; pageSize: number; } interface ApproveParams { instanceId: string; action: 'approved' | 'rejected'; comments?: string; appType?: string; formUuid?: string; updateFormDataJson?: string; } interface TransferParams { taskId: string; newAssignee: string; reason?: string; } interface ReturnParams { taskId: string; targetNodeId: string; reason?: string; } interface WithdrawParams { instanceId: string; reason?: string; } interface SaveTaskParams { instanceId: string; formUuid: string; appType: string; updateFormDataJson: string; } interface ResubmitParams { taskId: string; formUuid: string; appType: string; updateFormDataJson: string; comments?: string; selectedApprovers?: InitiatorSelectedApprovers; initiatorSelectedApprovers?: InitiatorSelectedApprovers; } interface PreviewParams { formUuid: string; appType: string; data: Record; submissionDepartmentId?: string; selectedApprovers?: InitiatorSelectedApprovers; initiatorSelectedApprovers?: InitiatorSelectedApprovers; } interface FormDataQueryParams { formInstanceId: string; appType: string; formUuid: string; } interface FormDataDeleteParams { formInstanceId: string; appType: string; formUuid: string; } interface ChangeRecordQueryParams { formUuid: string; appType: string; formInstanceId: string; page?: number; pageSize?: number; } interface ViewPermissionQueryParams { formUuid: string; appType: string; formInstanceId?: string; } /** 状态元信息(用于 UI 渲染) */ interface StatusMeta { label: string; tone: 'brand' | 'success' | 'danger' | 'neutral' | 'warning'; } type FilePreviewType = 'image' | 'video' | 'audio' | 'pdf' | 'spreadsheet' | 'text' | 'office' | 'download'; type FilePreviewRenderMode = 'inline' | 'image-transcode' | 'image-heic' | 'pdfjs' | 'excel-basic' | 'excel-client' | 'text' | 'text-client' | 'docx-html' | 'onlyoffice' | 'office-text' | 'download'; type FilePreviewSurface = 'media' | 'document' | 'download'; type FilePreviewProvider = 'browser' | 'platform' | 'onlyoffice' | 'none'; interface FilePreviewCapability { key?: string; extension?: string; previewType?: FilePreviewType; renderMode?: FilePreviewRenderMode; previewSurface?: FilePreviewSurface; previewProvider?: FilePreviewProvider; canPreview?: boolean; canDownload?: boolean; unsupportedReason?: string; } interface FilePreviewMetadata extends FilePreviewCapability { capabilityVersion?: number; ticket?: string; appType?: string; fileName?: string; bucketName?: string; objectName?: string; size?: number; contentType?: string; downloadUrl?: string; previewUrl?: string; previewPageUrl?: string; metadataUrl?: string; imagePreviewUrl?: string; excelPreviewUrl?: string; textPreviewUrl?: string; officeTextPreviewUrl?: string; onlyofficeConfigUrl?: string; onlyofficeEnabled?: boolean; expiresIn?: number; } interface PreparedFilePreview { item: AttachmentItem; metadata: FilePreviewMetadata; direct: boolean; } type FilePreviewRequest = FormRuntimeApi['request']; interface FilePreviewCapabilityBatch { capabilityVersion?: number; onlyofficeEnabled?: boolean; items?: FilePreviewCapability[]; } interface PreviewImageItem { key: string; src: string; name: string; revokeOnClose?: boolean; } interface ApprovalTimelineProps { tasks: ProcessTask[]; className?: string; renderNode?: (task: ProcessTask, index: number) => React__default.ReactNode; showRemarks?: boolean; compactMode?: boolean; showApproverInfo?: boolean; } declare const ApprovalTimeline: React__default.FC; interface ProcessPreviewProps { open: boolean; onClose: () => void; onConfirm: () => void; routes: ProcessRoute[]; loading?: boolean; } declare const ProcessPreview: React__default.FC; export { type DepartmentSelectFieldProps as $, type ApprovalPermission as A, type ReturnParams as B, type ChangeRecordQueryParams as C, type SaveTaskParams as D, type TransferParams as E, type FieldDefinition as F, type TextFieldProps as G, type TextAreaFieldProps as H, type InitiatorSelectCandidate as I, type SelectFieldProps as J, type RadioFieldProps as K, type CheckboxFieldProps as L, type MultiSelectFieldProps as M, type NumberFieldProps as N, type OptionItem as O, type ProcessStatus as P, type DateFieldProps as Q, type RuntimeResponse as R, type StatusMeta as S, type TaskStatus as T, type CascadeDateFieldProps as U, type ValidationPreset as V, type WithdrawParams as W, type AttachmentFieldProps as X, type ImageFieldProps as Y, type SubFormFieldProps as Z, type UserSelectFieldProps as _, type FormRuntimeApi as a, type ImageVariant as a$, type CascadeSelectFieldProps as a0, type AddressFieldProps as a1, type AssociationFormFieldProps as a2, type EditorFieldProps as a3, type EditorChoiceOption as a4, type SerialNumberFieldProps as a5, type LocationFieldProps as a6, type DigitalSignatureFieldProps as a7, type JSONFieldProps as a8, type AttachmentItem as a9, type DefaultValueLinkageConfig as aA, type DepartmentSearchParams as aB, type DepartmentSearchResult as aC, type DepartmentSearchScope as aD, type DepartmentTreeNode as aE, type DigitalSignatureValue as aF, type EditorToolbarAction as aG, type FieldLayoutNode as aH, type FieldValueSyncConfig as aI, type FilePreviewCapabilityBatch as aJ, type FilePreviewProvider as aK, type FilePreviewRenderMode as aL, type FilePreviewSurface as aM, type FilePreviewType as aN, type FormEffectAction as aO, type FormEffectCondition as aP, type FormEffectConditionOperator as aQ, type FormEngineMode as aR, type FormLayoutNode as aS, FormSection as aT, type FormSectionProps as aU, type FormSubmitBehavior as aV, type FormTemplateConfig as aW, type GridLayoutCell as aX, type GridLayoutNode as aY, type ImageCompressionConfig as aZ, type ImageCompressionVariantConfig as a_, type PreparedFilePreview as aa, type FilePreviewCapability as ab, type FilePreviewMetadata as ac, type FilePreviewRequest as ad, type ProcessAction as ae, type InitiatorSelectedApprovers as af, type ReturnPolicy as ag, type ChangeRecord as ah, type StandardFormPageMode as ai, type LowcodePageSchema as aj, type AddressValue as ak, type ApprovalActionType as al, ApprovalTimeline as am, type ApprovalTimelineProps as an, type AssociationFormConfig as ao, type AssociationValue as ap, type AttachmentImageVariants as aq, type BaseFieldProps as ar, type BaseLayoutNode as as, type DataFilter as at, type DataLinkageCondition as au, type DataLinkageConfig as av, type DateRangeRestriction as aw, type DateRestrictionConfig as ax, type DateShortcutConfig as ay, type DateShortcutType as az, type FormSchema as b, type InitiatorSelectScope as b0, type JSONFieldEditorContext as b1, type JSONFieldRendererContext as b2, type LayoutVisibleWhen as b3, type LinkedFormOptionConfig as b4, type LocationValue as b5, type LowcodePageMeta as b6, type LowcodePageNode as b7, type LowcodePageNodeType as b8, type OptionSourceType as b9, type PeopleShortcutConfig as ba, type PeopleShortcutType as bb, type PreviewImageItem as bc, type ProcessNodeType as bd, ProcessPreview as be, type ProcessPreviewProps as bf, type RuntimeAuthHeadersProvider as bg, type RuntimeDataQueryParams as bh, type RuntimeDataQueryResult as bi, type RuntimeRequestConfig as bj, type RuntimeUploadOptions as bk, type RuntimeUploadProvider as bl, type SectionLayoutNode as bm, type SignaturePoint as bn, type StepLayoutItem as bo, type StepsLayoutNode as bp, type SubFormColumn as bq, type TabLayoutItem as br, type TabsLayoutNode as bs, type TextShortcutConfig as bt, type TextShortcutType as bu, type UserDisplayFormat as bv, type UserItem as bw, type FormRuntimeApiConfig as c, type FormEngineConfig as d, type FieldBehavior as e, type FormRuntimeConfig as f, type FormAppearanceConfig as g, type ValidationRule as h, type FormEffect as i, type OptionSourceConfig as j, type FormDataDeleteParams as k, type ChangeRecordListResponse as l, type FormDataQueryParams as m, type FormInstanceData as n, type InitiatorSelectRequirement as o, type ProcessBasicInfo as p, type ProcessDefinition as q, type ProcessTask as r, type ReturnableNodeResult as s, type ReturnableNode as t, type ViewPermissionQueryParams as u, type ViewPermissionSummary as v, type ApproveParams as w, type PreviewParams as x, type ProcessRoute as y, type ResubmitParams as z };