@done-coding/admin-core 0.1.1-alpha.3 → 0.1.1-alpha.5
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/es/components/form/FormDatePicker.vue.mjs +7 -0
- package/es/components/form/FormDatePicker.vue2.mjs +50 -0
- package/es/components/form/index.mjs +19 -19
- package/es/components/form/utils.mjs +82 -61
- package/es/components/misc/ActionButton.vue.mjs +52 -0
- package/es/components/misc/ActionButton.vue2.mjs +4 -0
- package/es/components/misc/ActionButtonDanger.vue.mjs +32 -0
- package/es/components/misc/ActionButtonDanger.vue2.mjs +4 -0
- package/es/components/misc/ActionButtonWarn.vue.mjs +32 -0
- package/es/components/misc/ActionButtonWarn.vue2.mjs +4 -0
- package/es/components/misc/index.mjs +21 -9
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +146 -149
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +127 -93
- package/es/components/table/ToolbarButtons.vue.mjs +49 -0
- package/es/components/table/ToolbarButtons.vue2.mjs +4 -0
- package/es/index.mjs +104 -97
- package/es/style.css +1 -1
- package/es/utils/export.mjs +7 -7
- package/package.json +2 -2
- package/types/components/form/{FormDateTimeRange.vue.d.ts → FormDatePicker.vue.d.ts} +2 -2
- package/types/components/form/index.d.ts +2 -2
- package/types/components/form/utils.d.ts +3 -1
- package/types/components/misc/ActionButton.vue.d.ts +24 -0
- package/types/components/misc/ActionButtonDanger.vue.d.ts +19 -0
- package/types/components/misc/ActionButtonWarn.vue.d.ts +19 -0
- package/types/components/misc/index.d.ts +4 -1
- package/types/components/table/TableToolbar.vue.d.ts +49 -15
- package/types/components/table/ToolbarButtons.vue.d.ts +19 -0
- package/types/components/table/types.d.ts +40 -16
- package/types/utils/export.d.ts +8 -1
- package/es/components/form/FormDateTimeRange.vue.mjs +0 -46
- package/es/components/form/FormDateTimeRange.vue2.mjs +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@done-coding/admin-core",
|
|
3
|
-
"version": "0.1.1-alpha.
|
|
3
|
+
"version": "0.1.1-alpha.5",
|
|
4
4
|
"description": "后台管理核心",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"node": ">=18.0.0",
|
|
78
78
|
"pnpm": ">=9.0.0"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "b7bfd3786b4d39be001b5ffc51285ff22dce36f4"
|
|
81
81
|
}
|
|
@@ -4,13 +4,13 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
4
4
|
modelValue: import('vue').PropType<[Date, Date] | null>;
|
|
5
5
|
swiftOptions: {
|
|
6
6
|
type: globalThis.PropType<DateTimeRangeSwiftOption[]>;
|
|
7
|
-
default: () =>
|
|
7
|
+
default: () => DateTimeRangeSwiftOption[];
|
|
8
8
|
};
|
|
9
9
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
10
10
|
modelValue: import('vue').PropType<[Date, Date] | null>;
|
|
11
11
|
swiftOptions: {
|
|
12
12
|
type: globalThis.PropType<DateTimeRangeSwiftOption[]>;
|
|
13
|
-
default: () =>
|
|
13
|
+
default: () => DateTimeRangeSwiftOption[];
|
|
14
14
|
};
|
|
15
15
|
}>> & Readonly<{}>, {
|
|
16
16
|
swiftOptions: DateTimeRangeSwiftOption[];
|
|
@@ -7,9 +7,9 @@ import { default as FormTree } from './FormTree.vue';
|
|
|
7
7
|
import { default as FormSearch } from './FormSearch.vue';
|
|
8
8
|
import { default as FormVerifyImage } from './FormVerifyImage.vue';
|
|
9
9
|
import { default as FormVerifyCode } from './FormVerifyCode.vue';
|
|
10
|
-
import { default as
|
|
10
|
+
import { default as FormDatePicker } from './FormDatePicker.vue';
|
|
11
11
|
|
|
12
12
|
export * from './types';
|
|
13
13
|
export * from './utils';
|
|
14
|
-
export { FormMain, FormSelect, FormSearch, FormRadioGroup, FormRadio, FormTree, FormVerifyImage, FormVerifyCode,
|
|
14
|
+
export { FormMain, FormSelect, FormSearch, FormRadioGroup, FormRadio, FormTree, FormVerifyImage, FormVerifyCode, FormDatePicker, };
|
|
15
15
|
export declare const formInstall: Plugin;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { FormItemConfig, FormItemConfigList, ExtractFormStringifyFromObject, FormItemConfigSwiftOptions } from './types';
|
|
1
|
+
import { DateTimeRangeSwiftOption, FormItemConfig, FormItemConfigList, ExtractFormStringifyFromObject, FormItemConfigSwiftOptions } from './types';
|
|
2
2
|
|
|
3
|
+
/** 获取日期选择器默认快捷选项:今日、昨日、近7日 */
|
|
4
|
+
export declare const getDatePickerSwiftOptions: () => DateTimeRangeSwiftOption[];
|
|
3
5
|
/**
|
|
4
6
|
* 生成表单数据
|
|
5
7
|
*/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: <T>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
3
|
+
readonly onConfirm?: ((data: T) => any) | undefined;
|
|
4
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & ({
|
|
5
|
+
data: T;
|
|
6
|
+
type?: "primary" | "danger" | "info" | "warning" | "success";
|
|
7
|
+
/** Popconfirm 标题 */
|
|
8
|
+
tipContent: string | ((data: T) => string);
|
|
9
|
+
} & {
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
}), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
12
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
13
|
+
attrs: any;
|
|
14
|
+
slots: ReturnType<() => {
|
|
15
|
+
default?(_: {}): any;
|
|
16
|
+
}>;
|
|
17
|
+
emit: (evt: "confirm", data: T) => void;
|
|
18
|
+
}>) => import('vue').VNode & {
|
|
19
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_Prettify<T> = {
|
|
23
|
+
[K in keyof T]: T[K];
|
|
24
|
+
} & {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: <T>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
3
|
+
readonly onConfirm?: ((data: T) => any) | undefined;
|
|
4
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & ({
|
|
5
|
+
data: T;
|
|
6
|
+
tipContent: string | ((data: T) => string);
|
|
7
|
+
} & {
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
}), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
10
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
11
|
+
attrs: any;
|
|
12
|
+
slots: ReturnType<() => {
|
|
13
|
+
default?(_: {}): any;
|
|
14
|
+
}>;
|
|
15
|
+
emit: (evt: "confirm", data: T) => void;
|
|
16
|
+
}>) => import('vue').VNode & {
|
|
17
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const _default: <T>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
2
|
+
props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
|
|
3
|
+
readonly onConfirm?: ((data: T) => any) | undefined;
|
|
4
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & ({
|
|
5
|
+
data: T;
|
|
6
|
+
tipContent: string | ((data: T) => string);
|
|
7
|
+
} & {
|
|
8
|
+
visible?: boolean;
|
|
9
|
+
}), keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
|
|
10
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
11
|
+
attrs: any;
|
|
12
|
+
slots: ReturnType<() => {
|
|
13
|
+
default?(_: {}): any;
|
|
14
|
+
}>;
|
|
15
|
+
emit: (evt: "confirm", data: T) => void;
|
|
16
|
+
}>) => import('vue').VNode & {
|
|
17
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Plugin } from 'vue';
|
|
2
2
|
import { default as TriggerAutoImport } from './TriggerAutoImport.vue';
|
|
3
3
|
import { default as AutoRefresh } from './AutoRefresh.vue';
|
|
4
|
+
import { default as ActionButton } from './ActionButton.vue';
|
|
5
|
+
import { default as ActionButtonDanger } from './ActionButtonDanger.vue';
|
|
6
|
+
import { default as ActionButtonWarn } from './ActionButtonWarn.vue';
|
|
4
7
|
|
|
5
|
-
export { TriggerAutoImport, AutoRefresh };
|
|
8
|
+
export { TriggerAutoImport, AutoRefresh, ActionButton, ActionButtonDanger, ActionButtonWarn, };
|
|
6
9
|
export declare const miscInstall: Plugin;
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { ExportType, TableExportContext, TableMainInstance
|
|
1
|
+
import { ExportType, TableExportContext, TableMainInstance } from './types';
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
4
4
|
isAutoRefresh: import('vue').PropType<boolean>;
|
|
5
|
+
pageSize: {
|
|
6
|
+
type: globalThis.PropType<number>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
5
9
|
loading: {
|
|
6
10
|
type: globalThis.PropType<boolean>;
|
|
7
11
|
required: true;
|
|
8
12
|
};
|
|
9
|
-
|
|
10
|
-
type: globalThis.PropType<
|
|
11
|
-
default:
|
|
13
|
+
showRefresh: {
|
|
14
|
+
type: globalThis.PropType<boolean>;
|
|
15
|
+
default: boolean;
|
|
12
16
|
};
|
|
13
|
-
|
|
14
|
-
type: globalThis.PropType<
|
|
15
|
-
default:
|
|
17
|
+
showAutoRefresh: {
|
|
18
|
+
type: globalThis.PropType<boolean>;
|
|
19
|
+
default: boolean;
|
|
16
20
|
};
|
|
17
21
|
refreshInterval: {
|
|
18
22
|
type: globalThis.PropType<number>;
|
|
@@ -25,6 +29,15 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
25
29
|
exportFn: {
|
|
26
30
|
type: globalThis.PropType<(type: ExportType) => Promise<unknown>>;
|
|
27
31
|
};
|
|
32
|
+
exportColumns: {
|
|
33
|
+
type: globalThis.PropType<import('../../utils').ExportColumnConfig[]>;
|
|
34
|
+
};
|
|
35
|
+
leftExtraButtons: {
|
|
36
|
+
type: globalThis.PropType<import('./types').ToolbarButtonConfig<Record<string, any>>[]>;
|
|
37
|
+
};
|
|
38
|
+
rightExtraButtons: {
|
|
39
|
+
type: globalThis.PropType<import('./types').ToolbarButtonConfig<Record<string, any>>[]>;
|
|
40
|
+
};
|
|
28
41
|
tableExpose: {
|
|
29
42
|
type: globalThis.PropType<TableMainInstance>;
|
|
30
43
|
required: true;
|
|
@@ -33,19 +46,27 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
33
46
|
type: globalThis.PropType<TableExportContext>;
|
|
34
47
|
required: true;
|
|
35
48
|
};
|
|
49
|
+
currentPage: {
|
|
50
|
+
type: globalThis.PropType<number>;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
36
53
|
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
37
54
|
isAutoRefresh: import('vue').PropType<boolean>;
|
|
55
|
+
pageSize: {
|
|
56
|
+
type: globalThis.PropType<number>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
38
59
|
loading: {
|
|
39
60
|
type: globalThis.PropType<boolean>;
|
|
40
61
|
required: true;
|
|
41
62
|
};
|
|
42
|
-
|
|
43
|
-
type: globalThis.PropType<
|
|
44
|
-
default:
|
|
63
|
+
showRefresh: {
|
|
64
|
+
type: globalThis.PropType<boolean>;
|
|
65
|
+
default: boolean;
|
|
45
66
|
};
|
|
46
|
-
|
|
47
|
-
type: globalThis.PropType<
|
|
48
|
-
default:
|
|
67
|
+
showAutoRefresh: {
|
|
68
|
+
type: globalThis.PropType<boolean>;
|
|
69
|
+
default: boolean;
|
|
49
70
|
};
|
|
50
71
|
refreshInterval: {
|
|
51
72
|
type: globalThis.PropType<number>;
|
|
@@ -58,6 +79,15 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
58
79
|
exportFn: {
|
|
59
80
|
type: globalThis.PropType<(type: ExportType) => Promise<unknown>>;
|
|
60
81
|
};
|
|
82
|
+
exportColumns: {
|
|
83
|
+
type: globalThis.PropType<import('../../utils').ExportColumnConfig[]>;
|
|
84
|
+
};
|
|
85
|
+
leftExtraButtons: {
|
|
86
|
+
type: globalThis.PropType<import('./types').ToolbarButtonConfig<Record<string, any>>[]>;
|
|
87
|
+
};
|
|
88
|
+
rightExtraButtons: {
|
|
89
|
+
type: globalThis.PropType<import('./types').ToolbarButtonConfig<Record<string, any>>[]>;
|
|
90
|
+
};
|
|
61
91
|
tableExpose: {
|
|
62
92
|
type: globalThis.PropType<TableMainInstance>;
|
|
63
93
|
required: true;
|
|
@@ -66,9 +96,13 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
66
96
|
type: globalThis.PropType<TableExportContext>;
|
|
67
97
|
required: true;
|
|
68
98
|
};
|
|
99
|
+
currentPage: {
|
|
100
|
+
type: globalThis.PropType<number>;
|
|
101
|
+
required: true;
|
|
102
|
+
};
|
|
69
103
|
}>> & Readonly<{}>, {
|
|
70
|
-
|
|
71
|
-
|
|
104
|
+
showRefresh: boolean;
|
|
105
|
+
showAutoRefresh: boolean;
|
|
72
106
|
refreshInterval: number;
|
|
73
107
|
exportByFe: boolean;
|
|
74
108
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ToolbarButtonConfig, ToolbarButtonContext } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
buttons?: ToolbarButtonConfig[];
|
|
5
|
+
ctx: ToolbarButtonContext;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
7
|
+
buttons?: ToolbarButtonConfig[];
|
|
8
|
+
ctx: ToolbarButtonContext;
|
|
9
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ElTableColumn as ETC, TableInstance, TableProps } from 'element-plus';
|
|
2
2
|
import { APP_API_LIST_MODEL_KEY_CONFIG, BuildListParams } from '../../config';
|
|
3
3
|
import { DotToObject, UnionToIntersection } from '../../types';
|
|
4
|
+
import { ExportColumnConfig } from '../../utils';
|
|
4
5
|
import { ExtractPropTypes, VNode } from 'vue';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -26,10 +27,6 @@ export interface TableMainInstance {
|
|
|
26
27
|
}
|
|
27
28
|
/** 导出类型 */
|
|
28
29
|
export type ExportType = "selected" | "current" | "all";
|
|
29
|
-
/** toolbar 左侧功能 */
|
|
30
|
-
export type TableToolbarLeftFeature = "export";
|
|
31
|
-
/** toolbar 右侧功能 */
|
|
32
|
-
export type TableToolbarRightFeature = "refresh" | "autoRefresh";
|
|
33
30
|
/** TableMain 传给 toolbar 的导出上下文 */
|
|
34
31
|
export interface TableExportContext {
|
|
35
32
|
/** 可导出列 */
|
|
@@ -47,20 +44,41 @@ export interface TableExportContext {
|
|
|
47
44
|
/** 是否包含 selection 列 */
|
|
48
45
|
hasSelection: boolean;
|
|
49
46
|
}
|
|
47
|
+
/** toolbar 按钮渲染上下文 */
|
|
48
|
+
export interface ToolbarButtonContext<T extends Record<string, any> = Record<string, any>> {
|
|
49
|
+
/** TableMain expose */
|
|
50
|
+
tableExpose: TableMainInstance;
|
|
51
|
+
/** 表格是否加载中 */
|
|
52
|
+
loading: boolean;
|
|
53
|
+
/** 导出上下文 */
|
|
54
|
+
exportContext: TableExportContext;
|
|
55
|
+
/** 当前选中行数据 */
|
|
56
|
+
selectedList: T[];
|
|
57
|
+
/** 分页信息 */
|
|
58
|
+
pagination: {
|
|
59
|
+
currentPage: number;
|
|
60
|
+
pageSize: number;
|
|
61
|
+
total: number;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** toolbar 额外按钮配置 */
|
|
65
|
+
export interface ToolbarButtonConfig<T extends Record<string, any> = Record<string, any>> {
|
|
66
|
+
key: string;
|
|
67
|
+
/** ElButton props,与 actionButtonProps 二选一 */
|
|
68
|
+
props?: (ctx: ToolbarButtonContext<T>) => Record<string, any>;
|
|
69
|
+
/** ActionButton props(含 data/tipContent),与 props 二选一 */
|
|
70
|
+
actionButtonProps?: (ctx: ToolbarButtonContext<T>) => Record<string, any>;
|
|
71
|
+
/** 按钮文字。btnRender 优先 */
|
|
72
|
+
label?: string;
|
|
73
|
+
/** 按钮内容 render,优先级高于 label */
|
|
74
|
+
btnRender?: (ctx: ToolbarButtonContext<T>) => VNode[];
|
|
75
|
+
}
|
|
50
76
|
/** toolbar 可配置项(通过 TableMain 的 toolbar prop 传入) */
|
|
51
77
|
export interface TableToolbarConfig {
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*/
|
|
57
|
-
leftFeatures?: TableToolbarLeftFeature[];
|
|
58
|
-
/**
|
|
59
|
-
* 右侧功能列表。
|
|
60
|
-
* - undefined(默认):显示所有右侧功能
|
|
61
|
-
* - [](空数组):不渲染右侧功能
|
|
62
|
-
*/
|
|
63
|
-
rightFeatures?: TableToolbarRightFeature[];
|
|
78
|
+
/** 是否显示刷新按钮,默认 true */
|
|
79
|
+
showRefresh?: boolean;
|
|
80
|
+
/** 是否显示自动刷新开关,默认 true */
|
|
81
|
+
showAutoRefresh?: boolean;
|
|
64
82
|
/** 自动刷新默认间隔(秒),默认 30 */
|
|
65
83
|
refreshInterval?: number;
|
|
66
84
|
/**
|
|
@@ -71,6 +89,12 @@ export interface TableToolbarConfig {
|
|
|
71
89
|
exportByFe?: boolean;
|
|
72
90
|
/** 导出方法。传入导出类型,返回 Promise。exportByFe 为 false 时必传 */
|
|
73
91
|
exportFn?: (type: ExportType) => Promise<unknown>;
|
|
92
|
+
/** 导出列配置。不传则不显示导出按钮。支持 valueMap 自定义取值 */
|
|
93
|
+
exportColumns?: ExportColumnConfig[];
|
|
94
|
+
/** 左侧额外按钮 */
|
|
95
|
+
leftExtraButtons?: ToolbarButtonConfig[];
|
|
96
|
+
/** 右侧额外按钮 */
|
|
97
|
+
rightExtraButtons?: ToolbarButtonConfig[];
|
|
74
98
|
}
|
|
75
99
|
/** 表格列默认作用域 */
|
|
76
100
|
export interface TableColumnDefaultScope<T extends Record<string, any>, F extends Record<string, any>> {
|
package/types/utils/export.d.ts
CHANGED
|
@@ -6,9 +6,16 @@ export declare const OPERATE_COLUMN_PROP = "OPERATE";
|
|
|
6
6
|
export declare const EXPORT_MAX_LIMIT = 10000;
|
|
7
7
|
/** 导出列:从 ElTableColumnProps 中提取 prop、label、type */
|
|
8
8
|
export type ExportColumn = Pick<ElTableColumnProps, "prop" | "label" | "type">;
|
|
9
|
+
/** 导出列配置:支持 valueMap 自定义取值 */
|
|
10
|
+
export interface ExportColumnConfig {
|
|
11
|
+
prop: string;
|
|
12
|
+
label: string;
|
|
13
|
+
/** 自定义取值,不传则取 row[prop] */
|
|
14
|
+
valueMap?: (row: Record<string, any>) => unknown;
|
|
15
|
+
}
|
|
9
16
|
/** 导出参数 */
|
|
10
17
|
export interface ExportOptions {
|
|
11
|
-
columns:
|
|
18
|
+
columns: ExportColumnConfig[];
|
|
12
19
|
list: Record<string, any>[];
|
|
13
20
|
filename?: string;
|
|
14
21
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ElDatePicker as d, ElButton as c } from "element-plus/es";
|
|
2
|
-
import "element-plus/es/components/base/style/css";
|
|
3
|
-
import "element-plus/es/components/button/style/css";
|
|
4
|
-
import "element-plus/es/components/date-picker/style/css";
|
|
5
|
-
import { defineComponent as p, useModel as f, useAttrs as k, openBlock as o, createElementBlock as r, createVNode as V, mergeProps as _, unref as g, Fragment as y, renderList as B, createBlock as C, withCtx as D, createTextVNode as E, toDisplayString as v, mergeModels as w } from "vue";
|
|
6
|
-
const x = { class: "form-date-time-range" }, N = /* @__PURE__ */ p({
|
|
7
|
-
name: "FormDateTimeRange",
|
|
8
|
-
inheritAttrs: !1,
|
|
9
|
-
__name: "FormDateTimeRange",
|
|
10
|
-
props: /* @__PURE__ */ w({
|
|
11
|
-
swiftOptions: { default: () => [] }
|
|
12
|
-
}, {
|
|
13
|
-
modelValue: { default: null },
|
|
14
|
-
modelModifiers: {}
|
|
15
|
-
}),
|
|
16
|
-
emits: ["update:modelValue"],
|
|
17
|
-
setup(l) {
|
|
18
|
-
const t = f(l, "modelValue"), m = k(), i = (n) => {
|
|
19
|
-
t.value = n.set();
|
|
20
|
-
};
|
|
21
|
-
return (n, a) => {
|
|
22
|
-
const s = d, u = c;
|
|
23
|
-
return o(), r("span", x, [
|
|
24
|
-
V(s, _({
|
|
25
|
-
modelValue: t.value,
|
|
26
|
-
"onUpdate:modelValue": a[0] || (a[0] = (e) => t.value = e),
|
|
27
|
-
type: "datetimerange"
|
|
28
|
-
}, g(m)), null, 16, ["modelValue"]),
|
|
29
|
-
(o(!0), r(y, null, B(l.swiftOptions, (e) => (o(), C(u, {
|
|
30
|
-
key: e.key,
|
|
31
|
-
type: "primary",
|
|
32
|
-
link: "",
|
|
33
|
-
onClick: (h) => i(e)
|
|
34
|
-
}, {
|
|
35
|
-
default: D(() => [
|
|
36
|
-
E(v(e.key), 1)
|
|
37
|
-
]),
|
|
38
|
-
_: 2
|
|
39
|
-
}, 1032, ["onClick"]))), 128))
|
|
40
|
-
]);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
export {
|
|
45
|
-
N as default
|
|
46
|
-
};
|