easy-ep-ui 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +172 -0
- package/README.md +29 -14
- package/dist/easy-ep-ui.js +1 -1
- package/dist/style.css +1 -1
- package/es/charts/BaseBar/index.d.ts +2 -0
- package/es/charts/BaseBar/src/index.vue.d.ts +45 -0
- package/es/charts/BaseLine/index.d.ts +2 -0
- package/es/charts/BaseLine/src/index.vue.d.ts +47 -0
- package/es/charts/BasePie/index.d.ts +2 -0
- package/es/charts/BasePie/src/index.vue.d.ts +41 -0
- package/es/charts/BaseRadar/index.d.ts +2 -0
- package/es/charts/BaseRadar/src/index.vue.d.ts +47 -0
- package/es/charts/config.d.ts +32 -0
- package/es/charts/index.d.ts +8 -0
- package/es/charts/useChart.d.ts +21 -0
- package/es/components/ee-dept-cascader/index.d.ts +2 -0
- package/es/components/ee-dept-cascader/src/index.vue.d.ts +26 -0
- package/es/components/ee-dept-cascader/type.d.ts +39 -0
- package/es/components/ee-dict-select/src/index.vue.d.ts +20 -17
- package/es/components/ee-dict-select/type.d.ts +54 -0
- package/es/components/ee-form-dialog/src/index.vue.d.ts +110 -8
- package/es/components/ee-form-table/src/components/FormAuto.vue.d.ts +115 -0
- package/es/components/ee-form-table/src/components/FormDrawer.vue.d.ts +311 -0
- package/es/components/ee-form-table/src/components/SearchArea.vue.d.ts +39 -0
- package/es/components/ee-form-table/src/components/TableToolbar.vue.d.ts +43 -0
- package/es/components/ee-form-table/src/constants.d.ts +31 -0
- package/es/components/ee-form-table/src/hooks/useAuth.d.ts +14 -0
- package/es/components/ee-form-table/src/hooks/useCrud.d.ts +41 -0
- package/es/components/ee-form-table/src/hooks/useDict.d.ts +12 -0
- package/es/components/ee-form-table/src/hooks/useExport.d.ts +34 -0
- package/es/components/ee-form-table/src/hooks/useForm.d.ts +33 -0
- package/es/components/ee-form-table/src/hooks/usePagination.d.ts +22 -0
- package/es/components/ee-form-table/src/hooks/useSearch.d.ts +39 -0
- package/es/components/ee-form-table/src/hooks/useTable.d.ts +49 -0
- package/es/components/ee-form-table/src/index.vue.d.ts +1090 -533
- package/es/components/ee-form-table/types.d.ts +238 -0
- package/es/components/ee-remote-select/index.d.ts +2 -0
- package/es/components/ee-remote-select/src/index.vue.d.ts +30 -0
- package/es/components/ee-remote-select/type.d.ts +53 -0
- package/es/components/ee-role-select/index.d.ts +2 -0
- package/es/components/ee-role-select/src/index.vue.d.ts +29 -0
- package/es/components/ee-role-select/type.d.ts +44 -0
- package/es/components/ee-search-bar/src/index.vue.d.ts +82 -10
- package/es/components/ee-status-tag/src/index.vue.d.ts +1 -1
- package/es/components/ee-user-select/index.d.ts +2 -0
- package/es/components/ee-user-select/src/index.vue.d.ts +29 -0
- package/es/components/ee-user-select/type.d.ts +46 -0
- package/es/hooks/index.d.ts +4 -0
- package/es/hooks/useRemoteSelectPagination.d.ts +68 -0
- package/es/hooks/useSelectEcho.d.ts +27 -0
- package/es/index.d.ts +51 -2
- package/es/index.mjs +3135 -345
- package/es/locale/en.d.ts +3 -0
- package/es/locale/index.d.ts +86 -0
- package/es/locale/useLocale.d.ts +13 -0
- package/es/locale/zh-cn.d.ts +3 -0
- package/es/style.css +1 -1
- package/es/utils/types.d.ts +39 -0
- package/lib/charts/BaseBar/index.d.ts +2 -0
- package/lib/charts/BaseBar/src/index.vue.d.ts +45 -0
- package/lib/charts/BaseLine/index.d.ts +2 -0
- package/lib/charts/BaseLine/src/index.vue.d.ts +47 -0
- package/lib/charts/BasePie/index.d.ts +2 -0
- package/lib/charts/BasePie/src/index.vue.d.ts +41 -0
- package/lib/charts/BaseRadar/index.d.ts +2 -0
- package/lib/charts/BaseRadar/src/index.vue.d.ts +47 -0
- package/lib/charts/config.d.ts +32 -0
- package/lib/charts/index.d.ts +8 -0
- package/lib/charts/useChart.d.ts +21 -0
- package/lib/components/ee-dept-cascader/index.d.ts +2 -0
- package/lib/components/ee-dept-cascader/src/index.vue.d.ts +26 -0
- package/lib/components/ee-dept-cascader/type.d.ts +39 -0
- package/lib/components/ee-dict-select/src/index.vue.d.ts +20 -17
- package/lib/components/ee-dict-select/type.d.ts +54 -0
- package/lib/components/ee-form-dialog/src/index.vue.d.ts +110 -8
- package/lib/components/ee-form-table/src/components/FormAuto.vue.d.ts +115 -0
- package/lib/components/ee-form-table/src/components/FormDrawer.vue.d.ts +311 -0
- package/lib/components/ee-form-table/src/components/SearchArea.vue.d.ts +39 -0
- package/lib/components/ee-form-table/src/components/TableToolbar.vue.d.ts +43 -0
- package/lib/components/ee-form-table/src/constants.d.ts +31 -0
- package/lib/components/ee-form-table/src/hooks/useAuth.d.ts +14 -0
- package/lib/components/ee-form-table/src/hooks/useCrud.d.ts +41 -0
- package/lib/components/ee-form-table/src/hooks/useDict.d.ts +12 -0
- package/lib/components/ee-form-table/src/hooks/useExport.d.ts +34 -0
- package/lib/components/ee-form-table/src/hooks/useForm.d.ts +33 -0
- package/lib/components/ee-form-table/src/hooks/usePagination.d.ts +22 -0
- package/lib/components/ee-form-table/src/hooks/useSearch.d.ts +39 -0
- package/lib/components/ee-form-table/src/hooks/useTable.d.ts +49 -0
- package/lib/components/ee-form-table/src/index.vue.d.ts +1090 -533
- package/lib/components/ee-form-table/types.d.ts +238 -0
- package/lib/components/ee-remote-select/index.d.ts +2 -0
- package/lib/components/ee-remote-select/src/index.vue.d.ts +30 -0
- package/lib/components/ee-remote-select/type.d.ts +53 -0
- package/lib/components/ee-role-select/index.d.ts +2 -0
- package/lib/components/ee-role-select/src/index.vue.d.ts +29 -0
- package/lib/components/ee-role-select/type.d.ts +44 -0
- package/lib/components/ee-search-bar/src/index.vue.d.ts +82 -10
- package/lib/components/ee-status-tag/src/index.vue.d.ts +1 -1
- package/lib/components/ee-user-select/index.d.ts +2 -0
- package/lib/components/ee-user-select/src/index.vue.d.ts +29 -0
- package/lib/components/ee-user-select/type.d.ts +46 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/useRemoteSelectPagination.d.ts +68 -0
- package/lib/hooks/useSelectEcho.d.ts +27 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +51 -2
- package/lib/locale/en.d.ts +3 -0
- package/lib/locale/index.d.ts +86 -0
- package/lib/locale/useLocale.d.ts +13 -0
- package/lib/locale/zh-cn.d.ts +3 -0
- package/lib/style.css +1 -1
- package/lib/utils/types.d.ts +39 -0
- package/package.json +9 -5
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ToolbarConfig } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
show: boolean;
|
|
4
|
+
toolbarCfg: ToolbarConfig;
|
|
5
|
+
size?: 'large' | 'default' | 'small';
|
|
6
|
+
refreshing?: boolean;
|
|
7
|
+
deps: {
|
|
8
|
+
authPass: (auth?: string) => boolean;
|
|
9
|
+
selectionCount: number;
|
|
10
|
+
showColumnSetting: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare function __VLS_template(): {
|
|
14
|
+
attrs: Partial<{}>;
|
|
15
|
+
slots: {
|
|
16
|
+
'toolbar-right'?(_: {}): any;
|
|
17
|
+
};
|
|
18
|
+
refs: {};
|
|
19
|
+
rootEl: any;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
23
|
+
add: () => any;
|
|
24
|
+
"batch-delete": () => any;
|
|
25
|
+
import: () => any;
|
|
26
|
+
export: () => any;
|
|
27
|
+
refresh: () => any;
|
|
28
|
+
"column-setting": () => any;
|
|
29
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
30
|
+
onAdd?: (() => any) | undefined;
|
|
31
|
+
"onBatch-delete"?: (() => any) | undefined;
|
|
32
|
+
onImport?: (() => any) | undefined;
|
|
33
|
+
onExport?: (() => any) | undefined;
|
|
34
|
+
onRefresh?: (() => any) | undefined;
|
|
35
|
+
"onColumn-setting"?: (() => any) | undefined;
|
|
36
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
|
+
export default _default;
|
|
39
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SearchConfig, PaginationConfig, ActionConfig, ToolbarConfig, DrawerConfig, TableColumn } from '../types';
|
|
2
|
+
/** 默认行唯一标识字段名 */
|
|
3
|
+
export declare const DEFAULT_ROW_KEY = "id";
|
|
4
|
+
/** 默认空数据提示文字(兜底,locale 优先) */
|
|
5
|
+
export declare const DEFAULT_EMPTY_TEXT = "";
|
|
6
|
+
/** 每页条数选项 */
|
|
7
|
+
export declare const DEFAULT_PAGE_SIZES: number[];
|
|
8
|
+
/** 分页布局字符串 */
|
|
9
|
+
export declare const DEFAULT_PAGINATION_LAYOUT = "total, sizes, prev, pager, next, jumper";
|
|
10
|
+
/** 搜索区域默认配置 */
|
|
11
|
+
export declare const DEFAULT_SEARCH_CONFIG: SearchConfig;
|
|
12
|
+
/** 搜索区域隐藏时的空配置 */
|
|
13
|
+
export declare const SEARCH_CONFIG_HIDDEN: SearchConfig;
|
|
14
|
+
/** 分页默认配置 */
|
|
15
|
+
export declare const DEFAULT_PAGINATION_CONFIG: PaginationConfig;
|
|
16
|
+
/** 分页隐藏时的空配置 */
|
|
17
|
+
export declare const PAGINATION_CONFIG_HIDDEN: PaginationConfig;
|
|
18
|
+
/** 操作列默认配置 */
|
|
19
|
+
export declare const DEFAULT_ACTION_CONFIG: ActionConfig;
|
|
20
|
+
/** 操作列隐藏时的空配置 */
|
|
21
|
+
export declare const ACTION_CONFIG_HIDDEN: ActionConfig;
|
|
22
|
+
/** 工具栏默认配置 */
|
|
23
|
+
export declare const DEFAULT_TOOLBAR_CONFIG: ToolbarConfig;
|
|
24
|
+
/** 工具栏隐藏时的空配置 */
|
|
25
|
+
export declare const TOOLBAR_CONFIG_HIDDEN: ToolbarConfig;
|
|
26
|
+
/** 表单抽屉/弹窗默认配置 */
|
|
27
|
+
export declare const DEFAULT_DRAWER_CONFIG: DrawerConfig;
|
|
28
|
+
/** el-table 透传时需要跳过的属性名列表 */
|
|
29
|
+
export declare const OMIT_TABLE_ATTRS: string[];
|
|
30
|
+
/** el-table-column 透传时需要跳过的属性名列表 */
|
|
31
|
+
export declare const OMIT_COLUMN_ATTRS: (keyof TableColumn)[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* @param props.authChecker - 外部传入的权限判断函数,接收 auth 标识返回 boolean
|
|
4
|
+
* @param props.authMode - 权限不足时的处理模式:hide 隐藏 / disabled 禁用
|
|
5
|
+
* @returns authPass - 判断指定 auth 是否有权限的函数
|
|
6
|
+
* @returns authEnabled - 是否启用了权限检查
|
|
7
|
+
*/
|
|
8
|
+
export declare function useAuth(props: {
|
|
9
|
+
authChecker?: (auth: string) => boolean;
|
|
10
|
+
authMode?: 'hide' | 'disabled';
|
|
11
|
+
}): {
|
|
12
|
+
authPass: (auth?: string) => boolean;
|
|
13
|
+
authEnabled: ComputedRef<boolean>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import { CrudConfig } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.crudConfig - CRUD 接口配置(list/add/edit/delete/batchDelete)
|
|
5
|
+
* @param props.rowKey - 数据行唯一标识字段名,默认为 id
|
|
6
|
+
* @param deps.searchParams - 搜索参数字典(响应式对象)
|
|
7
|
+
* @param deps.getActiveSearchParams - 获取当前有效的搜索参数
|
|
8
|
+
* @param deps.pageState - 分页状态(current / pageSize / total)
|
|
9
|
+
* @param deps.resetPage - 重置到第一页的函数
|
|
10
|
+
* @param deps.setTotal - 设置总记录数的函数
|
|
11
|
+
* @param deps.selection - 选中的行数据列表(Ref)
|
|
12
|
+
* @param deps.emit - 对外触发事件的函数
|
|
13
|
+
* @param deps.t - 国际化翻译函数,接收 (section, key, args?) 返回本地化文字
|
|
14
|
+
*/
|
|
15
|
+
export declare function useCrud(props: {
|
|
16
|
+
crudConfig?: CrudConfig;
|
|
17
|
+
rowKey?: string;
|
|
18
|
+
}, deps: {
|
|
19
|
+
searchParams: Record<string, unknown>;
|
|
20
|
+
getActiveSearchParams: () => Record<string, unknown>;
|
|
21
|
+
pageState: {
|
|
22
|
+
current: number;
|
|
23
|
+
pageSize: number;
|
|
24
|
+
total: number;
|
|
25
|
+
};
|
|
26
|
+
resetPage: () => void;
|
|
27
|
+
setTotal: (total: number) => void;
|
|
28
|
+
selection: Ref<Record<string, unknown>[]>;
|
|
29
|
+
emit: (event: string, ...args: unknown[]) => void;
|
|
30
|
+
t: (section: string, key: string, args?: Record<string, string | number>) => string;
|
|
31
|
+
}): {
|
|
32
|
+
internalData: Ref<Record<string, unknown>[], Record<string, unknown>[]>;
|
|
33
|
+
loadingState: Ref<boolean, boolean>;
|
|
34
|
+
hasCrud: ComputedRef<boolean>;
|
|
35
|
+
fetchData: () => Promise<void>;
|
|
36
|
+
refreshTable: () => Promise<void>;
|
|
37
|
+
doDelete: (row: Record<string, unknown>) => Promise<void>;
|
|
38
|
+
handleDelete: (row: Record<string, unknown>, confirmDelete: boolean, confirmTitle?: string, confirmMessage?: string) => Promise<void>;
|
|
39
|
+
doBatchDelete: (ids: (string | number)[]) => Promise<void>;
|
|
40
|
+
handleBatchDelete: () => Promise<void>;
|
|
41
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DictOption } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* @param props.dictMap - 字典映射表,如 { statusDict: [{ value: 1, label: '启用' }, ...] }
|
|
4
|
+
* @returns resolvedDict - 合并内联 options 和字典映射的解析函数
|
|
5
|
+
* @returns dictLabel - 根据字段值和字典 key 获取显示文本
|
|
6
|
+
*/
|
|
7
|
+
export declare function useDict(props: {
|
|
8
|
+
dictMap?: Record<string, DictOption[]>;
|
|
9
|
+
}): {
|
|
10
|
+
resolvedDict: (options?: DictOption[], dictKey?: string) => DictOption[];
|
|
11
|
+
dictLabel: (dictKey: string | undefined, value: unknown) => string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { ExportConfig, TableColumn } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.exportConfig - 导出配置(模式、文件名、忽略列等)
|
|
5
|
+
* @param props.columns - 原始列配置(用于字典映射)
|
|
6
|
+
* @param deps.visibleColumns - 当前可见列列表
|
|
7
|
+
* @param deps.getActiveSearchParams - 获取当前搜索参数
|
|
8
|
+
* @param deps.dictLabel - 字典值转文本函数
|
|
9
|
+
* @param deps.setLoading - 设置加载状态
|
|
10
|
+
* @param deps.getCurrentData - 获取当前数据列表的函数
|
|
11
|
+
* @param deps.t - 国际化翻译函数,接收 (section, key, args?) 返回本地化文字
|
|
12
|
+
*/
|
|
13
|
+
export declare function useExport(props: {
|
|
14
|
+
exportConfig?: ExportConfig;
|
|
15
|
+
columns: TableColumn[];
|
|
16
|
+
crudConfig?: {
|
|
17
|
+
api?: {
|
|
18
|
+
list?: Function;
|
|
19
|
+
};
|
|
20
|
+
baseParams?: Record<string, unknown>;
|
|
21
|
+
} | null;
|
|
22
|
+
}, deps: {
|
|
23
|
+
visibleColumns: ComputedRef<TableColumn[]>;
|
|
24
|
+
getActiveSearchParams: () => Record<string, unknown>;
|
|
25
|
+
dictLabel: (dictKey: string | undefined, value: unknown) => string;
|
|
26
|
+
internalData: ComputedRef<Record<string, unknown>[]> | Ref<Record<string, unknown>[]> | Record<string, unknown>[];
|
|
27
|
+
fetchData: () => Promise<void>;
|
|
28
|
+
setLoading: (v: boolean) => void;
|
|
29
|
+
getCurrentData: () => Record<string, unknown>[];
|
|
30
|
+
t: (section: string, key: string, args?: Record<string, string | number>) => string;
|
|
31
|
+
}): {
|
|
32
|
+
handleExport: () => Promise<void>;
|
|
33
|
+
exporting: Ref<boolean, boolean>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ref } from 'vue';
|
|
2
|
+
import { DrawerConfig } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.drawerConfig - 抽屉/弹窗的外观配置
|
|
5
|
+
* @param props.rowKey - 数据行的唯一键(用于编辑时取 ID)
|
|
6
|
+
* @returns formVisible - 表单是否显示
|
|
7
|
+
* @returns formMode - 表单模式:add | edit | view
|
|
8
|
+
* @returns editingRow - 当前编辑的行数据(新增时为 null)
|
|
9
|
+
* @returns formData - 表单绑定的数据对象
|
|
10
|
+
* @returns saving - 是否正在保存(加载状态)
|
|
11
|
+
* @returns drawerMode - 展示模式:drawer / dialog
|
|
12
|
+
* @returns drawerCfg - 合并默认值后的配置
|
|
13
|
+
* @returns openAdd - 打开新增表单
|
|
14
|
+
* @returns openEdit - 打开编辑表单
|
|
15
|
+
* @returns openView - 打开查看表单
|
|
16
|
+
* @returns closeForm - 关闭表单
|
|
17
|
+
*/
|
|
18
|
+
export declare function useForm(props: {
|
|
19
|
+
drawerConfig?: DrawerConfig;
|
|
20
|
+
rowKey?: string;
|
|
21
|
+
}): {
|
|
22
|
+
formVisible: ReturnType<typeof ref<boolean>>;
|
|
23
|
+
formMode: ReturnType<typeof ref<'add' | 'edit' | 'view'>>;
|
|
24
|
+
editingRow: ReturnType<typeof ref<Record<string, unknown> | null>>;
|
|
25
|
+
formData: ReturnType<typeof ref<Record<string, unknown>>>;
|
|
26
|
+
saving: ReturnType<typeof ref<boolean>>;
|
|
27
|
+
drawerMode: string;
|
|
28
|
+
drawerCfg: DrawerConfig;
|
|
29
|
+
openAdd: () => void;
|
|
30
|
+
openEdit: (row: Record<string, unknown>) => void;
|
|
31
|
+
openView: (row: Record<string, unknown>) => void;
|
|
32
|
+
closeForm: () => void;
|
|
33
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { PaginationConfig } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.pagination - 分页配置(boolean 或 PaginationConfig 对象)
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePagination(props: {
|
|
7
|
+
pagination?: PaginationConfig | boolean;
|
|
8
|
+
}): {
|
|
9
|
+
pageState: {
|
|
10
|
+
current: number;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
total: number;
|
|
13
|
+
};
|
|
14
|
+
paginationCfg: ComputedRef<PaginationConfig>;
|
|
15
|
+
showPagination: ComputedRef<boolean>;
|
|
16
|
+
pageSizesComputed: ComputedRef<number[]>;
|
|
17
|
+
paginationLayoutComputed: ComputedRef<string>;
|
|
18
|
+
paginationBgComputed: ComputedRef<boolean>;
|
|
19
|
+
setPage: (page: number) => void;
|
|
20
|
+
setPageSize: (size: number) => void;
|
|
21
|
+
resetPage: () => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { TableColumn, SearchConfig, ColumnSearchItem } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.columns - 表格列配置(从中提取 search.enable = true 的字段)
|
|
5
|
+
* @param props.searchConfig - 搜索区域配置(列数、折叠行数等)
|
|
6
|
+
*/
|
|
7
|
+
export declare function useSearch(props: {
|
|
8
|
+
columns: TableColumn[];
|
|
9
|
+
searchConfig?: SearchConfig | boolean;
|
|
10
|
+
}): {
|
|
11
|
+
searchExpanded: import('vue').Ref<boolean, boolean>;
|
|
12
|
+
searchParams: Record<string, unknown>;
|
|
13
|
+
searchCfg: ComputedRef<SearchConfig>;
|
|
14
|
+
showSearch: ComputedRef<boolean | undefined>;
|
|
15
|
+
searchCols: ComputedRef<number>;
|
|
16
|
+
allSearchFields: ComputedRef<(ColumnSearchItem & {
|
|
17
|
+
prop: string;
|
|
18
|
+
label: string;
|
|
19
|
+
field: string;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
dictKey?: string;
|
|
22
|
+
props: Record<string, unknown>;
|
|
23
|
+
})[]>;
|
|
24
|
+
visibleSearchFields: ComputedRef<(ColumnSearchItem & {
|
|
25
|
+
prop: string;
|
|
26
|
+
label: string;
|
|
27
|
+
field: string;
|
|
28
|
+
placeholder: string;
|
|
29
|
+
dictKey?: string;
|
|
30
|
+
props: Record<string, unknown>;
|
|
31
|
+
})[]>;
|
|
32
|
+
showFoldBtn: ComputedRef<boolean>;
|
|
33
|
+
actionColSpan: ComputedRef<number>;
|
|
34
|
+
initSearchParams: () => void;
|
|
35
|
+
getDefaultSearchParams: () => Record<string, unknown>;
|
|
36
|
+
getActiveSearchParams: () => Record<string, unknown>;
|
|
37
|
+
resetSearchParams: () => void;
|
|
38
|
+
toggleFold: () => void;
|
|
39
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { TableColumn, SelectionConfig, ColumnSettingConfig, AutoHeightConfig } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @param props.columns - 表格列配置
|
|
5
|
+
* @param props.selectionConfig - 选择列配置
|
|
6
|
+
* @param props.columnSetting - 列设置配置
|
|
7
|
+
* @param props.rowKey - 数据行唯一标识字段名
|
|
8
|
+
* @param props.tableHeight - 固定表格高度
|
|
9
|
+
* @param props.tableMaxHeight - 表格最大高度
|
|
10
|
+
* @param props.autoHeight - 自适应高度配置
|
|
11
|
+
* @param deps.authPass - 权限判断函数(用于按权限过滤列)
|
|
12
|
+
*/
|
|
13
|
+
export declare function useTable(props: {
|
|
14
|
+
columns: TableColumn[];
|
|
15
|
+
data?: Record<string, unknown>[];
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
selectionConfig?: SelectionConfig;
|
|
18
|
+
columnSetting?: ColumnSettingConfig;
|
|
19
|
+
rowKey?: string;
|
|
20
|
+
tableHeight?: string | number;
|
|
21
|
+
tableMaxHeight?: string | number;
|
|
22
|
+
autoHeight?: AutoHeightConfig | boolean;
|
|
23
|
+
stripe?: boolean;
|
|
24
|
+
border?: boolean;
|
|
25
|
+
highlightCurrentRow?: boolean;
|
|
26
|
+
size?: string;
|
|
27
|
+
}, deps: {
|
|
28
|
+
authPass: (auth?: string) => boolean;
|
|
29
|
+
}): {
|
|
30
|
+
tableRef: import('vue').Ref<any, any>;
|
|
31
|
+
selection: import('vue').Ref<Record<string, unknown>[], Record<string, unknown>[]>;
|
|
32
|
+
singleSelection: import('vue').Ref<string | number | null, string | number | null>;
|
|
33
|
+
columnSettingVisible: import('vue').Ref<boolean, boolean>;
|
|
34
|
+
checkedColumns: import('vue').Ref<string[], string[]>;
|
|
35
|
+
selectionCfg: ComputedRef<SelectionConfig>;
|
|
36
|
+
columnSettingCfg: ComputedRef<ColumnSettingConfig>;
|
|
37
|
+
showColumnSetting: ComputedRef<boolean | undefined>;
|
|
38
|
+
allColumns: ComputedRef<TableColumn[]>;
|
|
39
|
+
visibleColumns: ComputedRef<TableColumn[]>;
|
|
40
|
+
tableComputedHeight: ComputedRef<string | number | undefined>;
|
|
41
|
+
tableMaxHeightProp: ComputedRef<string | number | undefined>;
|
|
42
|
+
tableWrapperStyle: ComputedRef<{
|
|
43
|
+
minHeight: string;
|
|
44
|
+
} | {
|
|
45
|
+
minHeight?: undefined;
|
|
46
|
+
}>;
|
|
47
|
+
handleSelectionChange: (val: Record<string, unknown>[]) => void;
|
|
48
|
+
handleSingleSelect: (row: Record<string, unknown>) => void;
|
|
49
|
+
};
|