import React from 'react'; import { Modal, Spin } from 'antd'; import Draggable from 'react-draggable'; import XBaseLayout, { XBaseLayoutProps } from '../base/XBaseLayout'; import { default as Mobile } from "./modal/index"; export interface XModalProps extends XBaseLayoutProps { /** * 标题 */ title?: string; iconType?: string; /** * 是否可见 */ visible?: boolean; closable?: boolean; /** * 是否点击蒙板关闭 */ maskClosable?: boolean; /** * 是否可以拖动 */ draggable?: boolean; /** * cancel按钮的文字 */ onOK?: (callback: (boolean: any) => void) => void; /** * ok按钮的文字 */ okText?: React.ReactNode; /** * cancel按钮的文字 */ cancelText?: string; /** * footer底部的展示 */ footer?: ((footer: React.ReactNode[], modal: XModal) => React.ReactNode | React.ReactNode[]) | React.ReactNode[]; /** * cancel按钮点击事件 */ onCancel?: () => undefined | boolean; modalRender?: (modal: any) => React.ReactNode; content?: React.ReactNode | ((modal: any) => React.ReactNode); showFooter?: boolean; loading?: boolean; Enabled?: boolean; destroyOnClose?: boolean; style?: object; bodyStyle?: object; zIndex: number; afterOpenChange?: (open: boolean) => void; } /** * 模态弹出框架,弹出后不能操控其他要素 * @name 模态框 * @groupName 弹出 */ export default class XModal extends XBaseLayout { static ComponentName: string; static Mobile: typeof Mobile; static Modal: typeof Modal; static Spin: typeof Spin; static Draggable: typeof Draggable; static ModalShowMobile(title: React.ReactNode, okfun?: () => boolean | Promise | void, content?: React.ReactNode, footer?: ((footer: React.ReactNode[], modal: { handleOk: () => void; handleCancel: () => void; Close: () => void; }) => React.ReactNode) | React.ReactNode[], height?: string, showBorder?: boolean): { handleOk: () => Promise; handleCancel: () => void; Close: () => void; }; static ShowMobileModal(title: React.ReactNode, okfun?: () => boolean | Promise | void, content?: React.ReactNode, footer?: ((footer: React.ReactNode[], modal: { handleOk: () => void; handleCancel: () => void; Close: () => void; }) => React.ReactNode) | React.ReactNode[], height?: string, showBorder?: boolean): { handleOk: () => Promise; handleCancel: () => void; Close: () => void; }; static defaultProps: { title: string; width: string; visible: boolean; closable: boolean; maskClosable: boolean; draggable: boolean; onOK: any; onCancel: any; okText: string; cancelText: string; footer: any; showFooter: boolean; loading: boolean; Enabled: boolean; destroyOnClose: boolean; style: any; bodyStyle: any; zIndex: any; lazyChildren: boolean; styleType: string; hasBox: boolean; showBorder: any; overflow: string; boxStyle: {}; height: string; grid: number[]; gridSpan: number[]; parent: string; pureRender: boolean; dataSourceUrl: string; filterData: {}; mustHasFilter: boolean; }; static ConfirmMobile(title?: string, okfun?: () => void | boolean | Promise, content?: any, callback?: (confirm: any) => void): Promise; static Confirm(title?: string, okfun?: () => void | boolean | Promise, content?: any, cancelFun?: () => void, afterOpenChange?: (open: boolean) => void): Promise; static MadalInfo(text: any, content: any, width: any, height: any): { destroy: () => void; update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void; }; static Info(text: any, content: any, width: any, height: any): { destroy: () => void; update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void; }; static Loading(content?: any, showIcon?: boolean): { destroy: () => void; update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void; }; static Show(title: string, content?: React.ReactNode, okfun?: () => boolean | Promise | void, onCancel?: () => undefined | boolean, width?: string, height?: string, footer?: ((footer: React.ReactNode[], modal: XModal) => React.ReactNode | React.ReactNode[]) | React.ReactNode[], draggable?: boolean, style?: { top: number; }, zIndex?: number): Promise; static ModalShow(title: string, okfun?: () => boolean | Promise | void, content?: React.ReactNode | ((modal: XModal) => React.ReactNode), width?: string, height?: string, footer?: ((footer: React.ReactNode[], modal: XModal) => React.ReactNode | React.ReactNode[]) | React.ReactNode[], draggable?: boolean, style?: { top: number; }, onCancel?: () => undefined | boolean, zIndex?: number, afterOpenChange?: (open: boolean) => void): Promise; constructor(props: XModalProps); /** * 打开模态对话框 */ Show(): void; /** * 关闭模态对话框 */ Close(): void; handleCancel: () => void; /** * 点击确认按钮 */ handleOk: () => void; private OKCallback; onStart: (event: any, uiData: any) => void; draggleRef?: any; render(): React.JSX.Element; }