vue-ace-admin-ui
Version:
Production-ready Vue 3 component library for admin systems. Enhanced Ant Design Vue components with TypeScript support, auto-loading, smart forms, and advanced tables. Works seamlessly with vue-ace-admin
238 lines (199 loc) • 7.25 kB
TypeScript
import { App } from 'vue';
import { ComponentOptionsMixin } from 'vue';
import { ComponentProvideOptions } from 'vue';
import { ComputedRef } from 'vue';
import { DefineComponent } from 'vue';
import { PublicProps } from 'vue';
import { Ref } from 'vue';
import { UnwrapRefSimple } from '@vue/reactivity';
import { VNode } from 'vue';
declare const __VLS_component: DefineComponent<ProButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ProButtonProps> & Readonly<{}>, {
autoLoading: boolean;
enableConfirm: boolean;
popConfig: ConfirmProps;
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
declare const __VLS_component_2: DefineComponent<ProTableProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ProTableProps> & Readonly<{}>, {
isZebra: "even" | "odd" | "none";
useCardWrapper: boolean;
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
declare const __VLS_component_3: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
"update:modelValue": (value: Record<string, unknown>) => any;
} & {
reset: () => any;
submit: (val: Record<string, any>) => any;
"update:modelValue": (val: Record<string, any>) => any;
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
onReset?: () => any;
onSubmit?: (val: Record<string, any>) => any;
"onUpdate:modelValue"?: (val: Record<string, any>) => any;
}>, {
fields: SearchField[];
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
declare type __VLS_Props = ProSearchFormProps;
declare type __VLS_PublicProps = {
modelValue?: Record<string, unknown>;
} & __VLS_Props;
declare function __VLS_template(): {
attrs: Partial<{}>;
slots: Partial<Record<string, (_: any) => any>> & Partial<Record<string, (_: any) => any>>;
refs: {};
rootEl: any;
};
declare function __VLS_template_2(): {
attrs: Partial<{}>;
slots: Readonly<TableSlotsType> & TableSlotsType;
refs: {};
rootEl: any;
};
declare function __VLS_template_3(): {
attrs: Partial<{}>;
slots: Readonly<{
actions?: (ctx: {
formState: Record<string, unknown>;
handleSubmit: () => void;
handleReset: () => void;
}) => unknown;
}> & {
actions?: (ctx: {
formState: Record<string, unknown>;
handleSubmit: () => void;
handleReset: () => void;
}) => unknown;
};
refs: {};
rootEl: HTMLDivElement;
};
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
declare type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};
declare type __VLS_WithTemplateSlots_2<T, S> = T & {
new (): {
$slots: S;
};
};
declare type __VLS_WithTemplateSlots_3<T, S> = T & {
new (): {
$slots: S;
};
};
/**
* 确认弹窗属性配置
*/
export declare interface ConfirmProps {
title?: string | VNode;
description?: string | VNode;
okText?: string;
cancelText?: string;
}
declare const _default: {
install(app: App): void;
};
export default _default;
export declare const errorMessage: (msg: string) => Promise<void>;
export declare const infoMessage: (msg: string) => Promise<void>;
declare type ListRequestFnType<ItemType, FilterOption> = ((params?: FilterOption) => Promise<ListResponse<ItemType>>) | ComputedRef<(params?: FilterOption) => Promise<ListResponse<ItemType>>>;
export declare interface ListResponse<ItemType> {
data: ItemType[];
total: number;
[key: string]: any;
}
export declare const message: (msg: string) => Promise<void>;
declare interface MessageConfig {
GET_DATA_IF_FAILED?: string;
GET_DATA_IF_SUCCEED?: string;
EXPORT_DATA_IF_FAILED?: string;
EXPORT_DATA_IF_SUCCEED?: string;
}
export declare type MessageType = 'success' | 'warning' | 'error' | 'info';
export declare const ProButton: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
/**
* ProButton 组件属性定义(只包含扩展属性)
*/
export declare interface ProButtonProps {
/** 是否自动显示 loading 状态 */
autoLoading?: boolean;
/** 是否启用确认弹窗 */
enableConfirm?: boolean;
/** 确认弹窗配置 */
popConfig?: ConfirmProps;
/** 点击事件处理函数 */
onClick?: (event: MouseEvent) => void | Promise<unknown>;
}
export declare const ProSearchForm: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
/**
* ProSearchForm 组件属性
*/
export declare interface ProSearchFormProps {
/** 字段配置数组 */
fields: SearchField[];
/** 默认值(非受控模式) */
defaultValues?: Record<string, any>;
/** 表单数据(受控模式) */
modelValue?: Record<string, any>;
}
export declare const ProTable: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
/**
* 表格数据类型
*/
export declare interface ProTableData {
text: any;
record: any;
index: number;
column: any;
}
/**
* ProTable 组件属性定义(只包含扩展属性)
*/
export declare interface ProTableProps {
/** 斑马纹模式 */
isZebra?: 'even' | 'odd' | 'none';
/** 是否使用卡片包装 */
useCardWrapper?: boolean;
}
/**
* 单个字段配置
*/
export declare interface SearchField {
/** 字段名(对应 model key) */
name: string;
/** 字段标签 */
label: string;
/** 表单项组件类型(如 'a-input', 'a-select') */
component?: string;
/** 组件属性 */
props?: Record<string, any>;
}
export declare function showMessage(msg: string, type?: MessageType): Promise<void>;
/**
* 表格插槽类型
*/
declare type TableSlotsType = {
toolbar?(): VNode;
[key: string]: any;
};
export declare function useList<ItemType extends object, FilterOption extends object>(props: UseListProps<ItemType, FilterOption>): {
dataSource: Ref< UnwrapRefSimple<ItemType>[], ItemType[] | UnwrapRefSimple<ItemType>[]>;
loading: Ref<boolean, boolean>;
reset: () => Promise<void>;
curPage: Ref<number, number>;
pageSize: Ref<number, number>;
total: Ref<number, number>;
loadData: (page?: number) => Promise<void>;
};
export declare interface UseListOptions {
requestSuccess?: () => void;
requestError?: () => void;
message?: MessageConfig;
}
export declare interface UseListProps<ItemType, FilterOption> {
listRequestFn: ListRequestFnType<ItemType, FilterOption>;
filterOption?: Ref<FilterOption>;
options?: UseListOptions;
}
export declare const warningMessage: (msg: string) => Promise<void>;
export { }