import type { AxiosRequestConfig } from '@qqt-product/api';
import type { Ref, ComputedRef, PropType, ExtractPropTypes, SetupContext, ComponentInternalInstance } from 'vue';
import type { VxeGridProps, VxeTablePropTypes, VxeTableDefines, VxeTableDataRow, VxeTableConstructor, VxeTablePrivateMethods, VxeGridConstructor, VxeGridDefines, VxeTableProDefines } from 'vxe-table';
import type { Decimal } from 'decimal.js';
import { FlowViewModalProps } from '../../flow-view/src/flow-view-modal-types';
import { Extend } from '../../select-modal';
import { FileDataType } from '../../upload-file/src/upload-file-types';
import type { CascaderProps } from 'ant-design-vue';
export type { Extend };
export interface ResponseType {
    code: number;
    message: string;
    result: RecordString;
    success: boolean;
    timestamp: number;
}
export interface UserInfo {
    elsAccount: string;
    subAccount: string;
    serivceUrl: string;
    [key: string]: unknown;
}
export interface CurrentRow {
    templateNumber: string;
    templateVersion: number;
    templateAccount: string;
    busAccount: string;
    elsAccount: string;
    [key: string]: unknown;
}
export interface DictCodeItem {
    title: string;
    value: string;
    [key: string]: unknown;
}
export type Role = string;
export declare function roleValidator(pattern: string): boolean;
export type GroupType = 'head' | 'item';
export type Pattern = 'vertical' | 'tab' | 'master';
export declare function patternValidator(pattern: string): boolean;
export interface Icon {
    type: string;
    size: number;
    color?: string;
}
export interface PageButtonPayload {
    tableData: RecordString[];
    pageData: Ref<RecordString>;
    fileData?: RecordString[];
}
export interface PageButtonArgs {
    url: string;
    [key: string]: unknown;
}
export interface PageButtonArgsFunctionType {
    (pageData: RecordString): PageButtonArgs;
}
export interface PageButton {
    title: string;
    i18nKey?: string;
    key: string | symbol;
    args: PageButtonArgs | PageButtonArgsFunctionType;
    authorityCode?: string;
    attrs?: RecordString;
    icon?: Icon;
    emit?: boolean;
    emitKey?: string;
    showMessage?: boolean;
    checkBefore?: boolean;
    confirm?: {
        title: string;
        content: string;
    };
    dropdown?: boolean;
    isExistFrozenSource?: boolean;
    isExistFrozenSourceUrl?: string;
    isExistFrozenSourceParams?: (pageData: RecordString) => RecordString;
    disabled?: (pageData: RecordString) => boolean;
    handleBefore?: (args: ExposeWithPageButtons) => Promise<ExposeWithPageButtons>;
    handleAfter?: (args: ExposeWithPageButtons) => Promise<ExposeWithPageButtons>;
    callback?: (payload: PageButtonPayload) => void;
}
export interface PageUploadButton extends Omit<PageButton, 'args'> {
    args?: {
        url?: string;
        [key: string]: unknown;
    };
}
export interface PageButtonWithGroupCode extends PageButton {
    groupCode: string;
    itemInfo?: RecordString[];
}
export interface PageButtonUploadType extends PageButton {
    groupCode: string;
    itemInfo?: RecordString[];
    onConfirmBeforeUpload?: (formData: FileDataType) => boolean;
}
export interface FormDataType extends FileDataType {
    [key: string]: unknown;
}
export interface PageButtonDeleteRow extends PageButton {
    groupCode: string;
    ids?: string[];
}
export interface PageDownLoadButton extends Omit<PageButton, 'args'> {
    args?: {
        url?: string;
        role?: string;
        [key: string]: unknown;
    };
}
export interface PageButtonDownLoad extends PageDownLoadButton {
    groupCode: string;
    ids?: string[];
}
export interface ExposeWithPageDeleteFileRows {
    pageData: Ref<RecordString>;
    rows?: RecordString[];
}
export interface PageDeleteFileRowButton extends Omit<PageButton, 'handleBefore' | 'handleAfter' | 'args'> {
    args?: {
        url?: string;
        role?: string;
        [key: string]: unknown;
    };
    handleBefore?: (args: ExposeWithPageDeleteFileRows) => Promise<ExposeWithPageDeleteFileRows>;
    handleAfter?: (args: ExposeWithPageDeleteFileRows) => Promise<ExposeWithPageDeleteFileRows>;
}
export interface PageButtonDeleteFileRow extends Omit<PageButton, 'args'> {
    args?: {
        url?: string;
        role?: string;
        [key: string]: unknown;
    };
    groupCode: string;
    ids: string[];
    attachmentIds?: string[];
    rows: RecordString[];
}
export type ValidateStatus = 'success' | 'fail' | 'unset';
export interface ValidateResult {
    result: {
        groupCode: string;
        status: ValidateStatus;
    };
    button: PageButton;
}
export interface LinkClickCallbackParams {
    row: RecordString;
    routerInfo: {
        path?: string;
        query?: RecordString;
    };
}
export type PageButtonPosition = 'top' | 'bottom';
export declare function pageButtonPositionValidator(mode: string): boolean;
export type RecordString = Record<string, any>;
export type OmitEditConfigVxeGridProps = Omit<VxeGridProps, 'editConfig'>;
export type OmitBeforeEditMethodEditConfig = Omit<VxeTablePropTypes.EditConfig, 'beforeEditMethod'>;
/**
 * Vxe 表格事件类型
 * start
 */
export interface KeydownEventParams extends VxeGridDefines.KeydownEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface HeaderCellClickEventParams extends VxeGridDefines.HeaderCellClickEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface HeaderCellDblclickEventParams extends VxeGridDefines.HeaderCellDblclickEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface HeaderCellMenuEventParams extends VxeGridDefines.HeaderCellMenuEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface CellClickEventParams extends VxeGridDefines.CellClickEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface CellDblclickEventParams extends VxeGridDefines.CellDblclickEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface CellMenuEventParams extends VxeGridDefines.CellMenuEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface FooterCellClickEventParams extends VxeGridDefines.FooterCellClickEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface FooterCellDblclickEventParams extends VxeGridDefines.FooterCellDblclickEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface FooterCellMenuEventParams extends VxeGridDefines.FooterCellMenuEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface RadioChangeEventParams extends VxeGridDefines.FooterCellMenuEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface CheckboxChangeEventParams extends VxeGridDefines.CheckboxChangeEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface CheckboxAllEventParams extends VxeGridDefines.CheckboxAllEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface ScrollEventParams extends VxeGridDefines.ScrollEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface ZoomEventParams extends VxeGridDefines.ZoomEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface CustomEventParams extends VxeGridDefines.CustomEventParams<VxeTableDataRow> {
    groupCode: string;
}
export interface CellAreaCutParams extends VxeTableProDefines.CellAreaCutParams<VxeTableDataRow> {
    groupCode: string;
}
export interface CellAreaCopyParams extends VxeTableProDefines.CellAreaCopyParams<VxeTableDataRow> {
    groupCode: string;
}
export interface CellAreaPasteParams extends VxeTableProDefines.CellAreaPasteParams<VxeTableDataRow> {
    groupCode: string;
}
/**
 * Vxe 表格事件类型
 * end
 */
export interface FlowApprovalCallbackPayload {
    btn: PageButton;
    params: RecordString;
}
/**
 * 参数扩展
 * 该方法的返回值用来决定该单元格是否允许编辑
 */
export interface BeforeEditMethodParams {
    row: VxeTableDataRow;
    rowIndex: number;
    column: VxeTableDefines.ColumnInfo<VxeTableDataRow>;
    columnIndex: number;
    $table: VxeTableConstructor<VxeTableDataRow> & VxeTablePrivateMethods<VxeTableDataRow>;
    $grid: VxeGridConstructor<VxeTableDataRow> | null | undefined;
}
export interface MixBeforeEditMethod {
    (pageData: Ref<RecordString>, params: BeforeEditMethodParams): boolean;
}
export type MixEditConfig = OmitBeforeEditMethodEditConfig & {
    beforeEditMethod?: MixBeforeEditMethod;
};
export type MixVxeGridProps = OmitEditConfigVxeGridProps & {
    editConfig?: MixEditConfig;
};
export interface GroupExtend extends RecordString {
    vxeGridConfig?: MixVxeGridProps;
}
export interface UploadPageButton extends PageButton {
    onConfirmBeforeUpload?: (formData: FileDataType) => boolean;
}
export interface Group {
    groupName: string;
    groupNameI18nKey?: string;
    groupCode: string;
    groupType: GroupType;
    sortOrder?: string;
    buttons?: PageButton[] | UploadPageButton[];
    extend?: GroupExtend;
    show?: boolean;
    shake?: boolean;
    slot?: boolean;
    master?: boolean;
    useAllConfig?: boolean;
    setMaxHeight?: boolean;
    enableTile?: '0' | '1';
    columns?: ColumnItem[];
    formFields?: FormFieldsItem[];
}
export interface HeadGroupType extends Group {
    groupType: 'head';
    formFields: FormFieldsItem[];
}
export interface ItemGroupType extends Group {
    groupType: 'item';
    columns: ColumnItem[];
}
export type GroupItem = HeadGroupType | ItemGroupType;
export type StringOrNumber = string | number;
export interface Expose {
    pageData: RecordString;
    layoutConfig: LayoutConfig;
    defaultValues: RecordString;
    uid?: number;
}
export type UsePromiseStepPayload = {
    pageData: Ref<RecordString>;
    layoutConfig: Ref<LayoutConfig>;
    defaultValues: Ref<RecordString>;
    options: Partial<EditPageLayoutProps>;
};
export interface ExposeWithPageButtons {
    pageData: Ref<RecordString>;
    layoutConfig: Ref<LayoutConfig>;
    defaultValues: Ref<RecordString>;
    cacheButton?: PageButton;
    pageButtons?: PageButton[];
    isAdd?: boolean;
    addResult?: CurrentRow;
    rows?: RecordString[];
}
export type CustomFormatItem = (groupCode: string, fieldName: string, fn: (item: FormFieldsItem | ColumnItem) => void, exclude?: string[]) => void;
export type SetItemRequired = (groupCode: string, fieldName: string, flag: boolean, exclude?: string[]) => void;
export type SetItemDisabled = (groupCode: string, fieldName: string, flag: boolean, exclude?: string[]) => void;
export type SetItemRequiredOrDisabled = (groupCode: string, fieldName: string, flag: boolean, exclude?: string[]) => void;
export interface ValuePayload {
    value: StringOrNumber;
    label?: string | string[];
    extra?: any;
    _isFill?: boolean;
    data?: RecordString[];
    pageData: RecordString;
    layoutConfig: LayoutConfig;
    userInfo?: UserInfo;
    modalData?: RecordString[];
    selectedOptions?: CascaderProps['options'];
    customFormatItem?: CustomFormatItem;
    setItemRequired?: SetItemRequired;
    setItemDisabled?: SetItemDisabled;
    setItemRequiredOrDisabled?: SetItemRequiredOrDisabled;
    Decimal?: typeof Decimal;
    topEmit?: () => void;
}
export type Payload = ValuePayload;
export type VxePayload = {
    value?: StringOrNumber;
    label?: string | string[];
    extra?: any;
    _isFill?: boolean;
    data?: RecordString[];
    pageData: RecordString;
    layoutConfig: LayoutConfig;
    userInfo?: UserInfo;
    modalData?: RecordString[];
    row: RecordString;
    idx: number;
    fileData?: RecordString[];
    customFormatItem?: CustomFormatItem;
    setItemRequired?: SetItemRequired;
    setItemDisabled?: SetItemDisabled;
    setItemRequiredOrDisabled?: SetItemRequiredOrDisabled;
    Decimal?: typeof Decimal;
    topEmit?: () => void;
    selectedOptions?: CascaderProps['options'];
};
export interface UploadExtend {
    businessType?: string;
    [key: string]: unknown;
}
export interface LadderPriceExtend {
    current?: number;
    modalConfigs?: unknown[];
}
export interface FormFieldsItem {
    groupCode: string;
    fieldType: string;
    fieldLabel: string;
    fieldName: string;
    helpText?: string;
    disabled?: boolean;
    required?: '0' | '1';
    regex?: RegExp;
    alertMsg?: string;
    options?: RecordString[];
    callback?: (ctx: ComponentInternalInstance | null, payload: Payload) => void;
    [key: string]: unknown;
}
export interface ColumnItem {
    groupCode: string;
    title: string;
    fieldLabelI18nKey?: string;
    field: string;
    fieldType?: string;
    helpText?: string;
    disabled?: boolean;
    required?: '0' | '1';
    regex?: string | RegExp;
    alertMsg?: string;
    options?: RecordString[];
    callback?: (ctx: SetupContext, payload: VxePayload) => void;
    [key: string]: unknown;
}
export interface FormFieldsItemSelectModal extends FormFieldsItem {
    extend: Extend;
}
export interface ColumnItemWithSelectModal extends ColumnItem {
    extend: Extend;
}
export interface FormFieldsItemUpload extends FormFieldsItem {
    extend: UploadExtend;
}
export interface ColumnItemWithExtend extends ColumnItem {
    extend: UploadExtend;
}
export interface FormFieldsItemWithValue extends FormFieldsItem {
    value: StringOrNumber;
    data?: RecordString[];
    _isFill?: boolean;
}
export interface ColumnItemWithValue extends ColumnItem {
    value: StringOrNumber;
    idx: number;
    row: RecordString;
    data?: RecordString[];
    _isFill?: boolean;
}
export interface ImportPropsType {
    button: PageButton;
    isEditPage: boolean;
    token: string;
}
export interface FlowPropsType extends FlowViewModalProps {
    button: PageButton;
}
export interface ComputedFormFieldsItem extends FormFieldsItem {
    customSlotProp: string;
    customSlotName: string;
}
export type BindFunctionEvent = FormFieldsItemWithValue;
export type VxeBindFunctionEvent = ColumnItemWithValue;
export type RemoteConfig = {
    editLayout?: string;
    tempRole?: string;
    examineLayout?: string;
    groups: Group[];
    formFields: FormFieldsItem[];
    itemColumns: ColumnItem[];
};
export type LayoutConfig = Omit<RemoteConfig, 'groups' | 'formFields' | 'itemColumns'> & {
    groups: GroupItem[];
};
export type LocalConfig = Partial<RemoteConfig>;
export interface DetailApiFunctionType {
    (row: CurrentRow): AxiosRequestConfig & {
        method: 'get' | 'post' | 'delete' | 'put';
    };
}
export declare const editPageLayoutProps: {
    showPageHeader: {
        type: PropType<boolean>;
        default: boolean;
    };
    showLayoutAnchor: {
        type: PropType<boolean>;
        default: boolean;
    };
    isDetail: {
        type: PropType<boolean>;
        default: boolean;
    };
    businessType: {
        type: StringConstructor;
        default: string;
    };
    role: {
        type: PropType<string>;
        default: string;
        validator: typeof roleValidator;
    };
    currentRow: {
        type: PropType<CurrentRow>;
        default(): {};
        require: boolean;
    };
    refreshMethods: {
        type: PropType<(row?: CurrentRow) => void>;
        default: null;
    };
    userInfo: {
        type: PropType<UserInfo>;
        default(): {};
    };
    token: {
        type: StringConstructor;
        default: string;
    };
    isUseLocalPattern: {
        type: PropType<boolean>;
        default: boolean;
    };
    pattern: {
        type: PropType<Pattern>;
        default: string;
        validator: typeof patternValidator;
    };
    localConfig: {
        type: PropType<Partial<RemoteConfig>>;
        default(): {};
    };
    handleAfterRemoteConfig: {
        type: PropType<(<T>(args: T) => T | Promise<T>)>;
        default: null;
    };
    detailApi: {
        type: PropType<string | DetailApiFunctionType>;
        default: string;
    };
    withoutIdDetailApi: {
        type: PropType<string>;
        default: string;
    };
    handleAfterDetailApiResponse: {
        type: PropType<(args: Expose) => void>;
        default: null;
    };
    pageButtons: {
        type: PropType<PageButton[]>;
        default: null;
    };
    pageButtonPosition: {
        type: PropType<PageButtonPosition>;
        default: string;
        validator: typeof pageButtonPositionValidator;
    };
    hasAdd: {
        type: PropType<boolean>;
        default: boolean;
    };
    isUseLocalData: {
        type: PropType<boolean>;
        default: boolean;
    };
    localData: {
        type: PropType<RecordString>;
        default(): {};
    };
    showBackIcon: {
        type: PropType<boolean>;
        default: boolean;
    };
    pageTitle: {
        type: StringConstructor;
        default: string;
    };
};
export type EditPageLayoutProps = ExtractPropTypes<typeof editPageLayoutProps>;
export interface EditPageLayoutReturnType {
    classes: ComputedRef<{
        [key: string]: string | boolean;
    }>;
}
