import type { ButtonProps } from 'ant-design-vue/lib/button/buttonTypes'; import type { CSSProperties, VNodeChild, ComputedRef } from 'vue'; /** * @description: 弹窗对外暴露的方法 */ export interface ModalMethods { setModalProps: (props: Partial) => void; emitVisible?: (visible: boolean, uid: number) => void; redoModalHeight?: () => void; } export type RegisterFn = (modalMethods: ModalMethods, uuid?: string) => void; export interface ReturnMethods extends ModalMethods { openModal: (props?: boolean, data?: T, openOnSet?: boolean) => void; closeModal: () => void; getVisible?: ComputedRef; } export type UseModalReturnType = [RegisterFn, ReturnMethods]; export interface ReturnInnerMethods extends ModalMethods { closeModal: () => void; changeLoading: (loading: boolean) => void; changeOkLoading: (loading: boolean) => void; getVisible?: ComputedRef; redoModalHeight: () => void; } export type UseModalInnerReturnType = [RegisterFn, ReturnInnerMethods]; export interface ModalProps { minHeight?: number; height?: number; // 启用wrapper后 底部可以适当增加高度 wrapperFooterOffset?: number; draggable?: boolean; scrollTop?: boolean; // 是否可以进行全屏 canFullscreen?: boolean; defaultFullscreen?: boolean; visible?: boolean; // 温馨提醒信息 helpMessage: string | string[]; // 是否使用modalWrapper useWrapper: boolean; loading: boolean; loadingTip?: string; wrapperProps: Omit; showOkBtn: boolean; showCancelBtn: boolean; closeFunc: () => Promise; /** *指定一个在modal完全关闭时调用的函数. * @type Function */ afterClose?: () => any; /** * modal body style。如高度,填充等。 * @default {} * @type object */ bodyStyle?: CSSProperties; cancelText?: string; /** * 中心 * @default false * @type boolean */ centered?: boolean; /** * 在模态对话框的右上方是否可见一个close (x)按钮 * @default true * @type boolean */ closable?: boolean; /** * close按钮图标 */ closeIcon?: VNodeChild | JSX.Element; /** * OK 按钮 loading * @default false * @type boolean */ confirmLoading?: boolean; /** * 是否在关闭时卸载子组件 * @default false * @type boolean */ destroyOnClose?: boolean; /** * 页脚内容,当不需要默认按钮时设置为:Footer ="null" * @default OK and Cancel buttons * @type any (string | slot) */ footer?: VNodeChild | JSX.Element; /** * 返回Modal的挂载节点 * @default () => document.body * @type Function */ getContainer?: (instance: any) => HTMLElement; /** * 蒙版 * @default true * @type boolean */ mask?: boolean; /** * 点击蒙版关闭 * @default true * @type boolean */ maskClosable?: boolean; /** * 蒙版样式 * @default {} * @type object */ maskStyle?: CSSProperties; okText?: string; okType?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'; okButtonProps?: ButtonProps; cancelButtonProps?: ButtonProps; title?: VNodeChild | JSX.Element; width?: string | number; /** * 内容元素类名 * @type string */ wrapClassName?: string; /** * 层级 * @default 1000 * @type number */ zIndex?: number; } export interface ModalWrapperProps { footerOffset?: number; loading: boolean; modalHeaderHeight: number; modalFooterHeight: number; minHeight: number; height: number; visible: boolean; fullScreen: boolean; useWrapper: boolean; }