UNPKG

yhui-yuanhuan

Version:

A Component Library for Vue 3 based on element-plus

195 lines (194 loc) 6.48 kB
import { type Component } from 'vue'; import { type ElDialog, ElForm, ElPagination, ElTable, ElTableColumn } from 'element-plus'; import { type IConfirmParam } from '../../dialog'; import { type Page } from '../../types'; import type { EntityBase } from '../../types'; type permission = { add?: string; edit?: string; del?: string; }; type HideOptions = 'search' | 'page' | 'searchButton' | 'resetButton' | 'addButton' | 'viewButton' | 'editButton' | 'deleteButton' | 'settingButton' | 'actionsColumn' | 'searching' | 'setting'; declare function __VLS_template(): { search?(_: {}): any; searchButtons?(_: {}): any; action?(_: { row: any; }): any; action?(_: { row: any; }): any; }; declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{ actionsColumnProps?: InstanceType<typeof ElTableColumn>["$props"]; api?: { del?: () => Promise<any>; }; components?: { View?: Component; Edit?: Component; }; dialogProps?: InstanceType<typeof ElDialog>["$props"]; EntityClass?: typeof EntityBase; hideList?: HideOptions[]; /** * @description 组件id,用于存储配置,如列顺序 */ id: string; /** 增删改查跳转新页面需要传递 */ router?: { push: (...args: any) => any; }; pages?: { /** RouteRecordRaw['name'] */ view?: string; /** RouteRecordRaw['name'] */ add?: string; /** RouteRecordRaw['name'] */ edit?: string; }; pageParam?: Required<Page>; pageProps?: InstanceType<typeof ElPagination>["$props"]; permissions?: permission; permissionValidate?: (name?: string) => boolean; search?: (param: Required<Page>, fromPage?: boolean) => Promise<any>; searchDefault?: () => Record<string, any>; searchFormProps?: InstanceType<typeof ElForm>["$props"]; searchParam?: Record<string, any>; searchResultKey?: string; searchResultTotalKey?: string; searchSetting?: Partial<{ searchIcon: Component | undefined; searchText: string; resetIcon: Component | undefined; resetText: string; }>; settingStorageKey?: string; tableData?: any; tableProps?: InstanceType<typeof ElTable>["$props"]; /** 不折叠操作按钮 */ unfoldActions?: boolean; }>, { hideList: () => never[]; id: () => "table-only-one"; pageParam: () => { page: number; size: number; total: number; }; permissionValidate: () => true; searchDefault: () => {}; searchParam: () => {}; searchResultKey: string; searchResultTotalKey: string; }>, { actionRow: import("vue").Ref<any>; doSearch: () => Promise<void>; tableRef: import("vue").Ref<any>; searchFormRef: import("vue").Ref<any>; }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { "update:pageParam": (p: Required<Page>) => void; "update:searchParam": (p: Record<string, any>) => void; "update:tableData": (p: any) => void; confirm: (p: Required<IConfirmParam<any>>) => void; }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{ actionsColumnProps?: InstanceType<typeof ElTableColumn>["$props"]; api?: { del?: () => Promise<any>; }; components?: { View?: Component; Edit?: Component; }; dialogProps?: InstanceType<typeof ElDialog>["$props"]; EntityClass?: typeof EntityBase; hideList?: HideOptions[]; /** * @description 组件id,用于存储配置,如列顺序 */ id: string; /** 增删改查跳转新页面需要传递 */ router?: { push: (...args: any) => any; }; pages?: { /** RouteRecordRaw['name'] */ view?: string; /** RouteRecordRaw['name'] */ add?: string; /** RouteRecordRaw['name'] */ edit?: string; }; pageParam?: Required<Page>; pageProps?: InstanceType<typeof ElPagination>["$props"]; permissions?: permission; permissionValidate?: (name?: string) => boolean; search?: (param: Required<Page>, fromPage?: boolean) => Promise<any>; searchDefault?: () => Record<string, any>; searchFormProps?: InstanceType<typeof ElForm>["$props"]; searchParam?: Record<string, any>; searchResultKey?: string; searchResultTotalKey?: string; searchSetting?: Partial<{ searchIcon: Component | undefined; searchText: string; resetIcon: Component | undefined; resetText: string; }>; settingStorageKey?: string; tableData?: any; tableProps?: InstanceType<typeof ElTable>["$props"]; /** 不折叠操作按钮 */ unfoldActions?: boolean; }>, { hideList: () => never[]; id: () => "table-only-one"; pageParam: () => { page: number; size: number; total: number; }; permissionValidate: () => true; searchDefault: () => {}; searchParam: () => {}; searchResultKey: string; searchResultTotalKey: string; }>>> & { onConfirm?: ((p: Required<IConfirmParam<any>>) => any) | undefined; "onUpdate:pageParam"?: ((p: Required<Page>) => any) | undefined; "onUpdate:searchParam"?: ((p: Record<string, any>) => any) | undefined; "onUpdate:tableData"?: ((p: any) => any) | undefined; }, { id: string; hideList: HideOptions[]; pageParam: Required<Page>; permissionValidate: (name?: string) => boolean; searchDefault: () => Record<string, any>; searchParam: Record<string, any>; searchResultKey: string; searchResultTotalKey: string; }, {}>; declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>; export default _default; type __VLS_WithDefaults<P, D> = { [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & { default: D[K]; }> : P[K]; }; type __VLS_Prettify<T> = { [K in keyof T]: T[K]; } & {}; type __VLS_WithTemplateSlots<T, S> = T & { new (): { $slots: S; }; }; type __VLS_NonUndefinedable<T> = T extends undefined ? never : T; type __VLS_TypePropsToOption<T> = { [K in keyof T]-?: {} extends Pick<T, K> ? { type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>; } : { type: import('vue').PropType<T[K]>; required: true; }; };