@gx-design-vue/pro-table 0.2.0-beta.44 → 0.2.0-beta.45
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.
|
@@ -11,7 +11,7 @@ declare const ListToolBar: import("vue").DefineComponent<{
|
|
|
11
11
|
type: PropType<import("../../types/SlotsTypings").ToolBarBtnRender>;
|
|
12
12
|
default: () => undefined;
|
|
13
13
|
};
|
|
14
|
-
settings: PropType<
|
|
14
|
+
settings: PropType<VueNode[]>;
|
|
15
15
|
titleTip: {
|
|
16
16
|
type: PropType<import("../../types/SlotsTypings").TitleTipRender>;
|
|
17
17
|
default: () => undefined;
|
|
@@ -34,7 +34,7 @@ declare const ListToolBar: import("vue").DefineComponent<{
|
|
|
34
34
|
type: PropType<import("../../types/SlotsTypings").ToolBarBtnRender>;
|
|
35
35
|
default: () => undefined;
|
|
36
36
|
};
|
|
37
|
-
settings: PropType<
|
|
37
|
+
settings: PropType<VueNode[]>;
|
|
38
38
|
titleTip: {
|
|
39
39
|
type: PropType<import("../../types/SlotsTypings").TitleTipRender>;
|
|
40
40
|
default: () => undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const FullScreenIcon: import("vue").DefineComponent<{}, () =>
|
|
1
|
+
declare const FullScreenIcon: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
2
|
export default FullScreenIcon;
|
|
@@ -18,7 +18,7 @@ declare const ToolbarRender: import("vue").DefineComponent<{
|
|
|
18
18
|
titleTipText: PropType<string | undefined>;
|
|
19
19
|
toolBarBtn: PropType<import("../../types/SlotsTypings").ToolBarBtnRender>;
|
|
20
20
|
headerTitle: PropType<import("../../types/SlotsTypings").HeaderTitleRender>;
|
|
21
|
-
}, () =>
|
|
21
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
22
|
options: PropType<boolean | OptionConfig | undefined>;
|
|
23
23
|
titleTip: PropType<import("../../types/SlotsTypings").TitleTipRender>;
|
|
24
24
|
settingExtra: PropType<import("../../types/SlotsTypings").SettingExtraRender>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { RecordType, VueNode } from '@gx-design-vue/pro-utils';
|
|
2
|
+
import type { DefaultRecordType } from '../typing';
|
|
3
|
+
import type { ColumnType } from '../_utils';
|
|
4
|
+
/**
|
|
5
|
+
* @param text 文本框
|
|
6
|
+
* @param date 日期 YYYY-MM-DD
|
|
7
|
+
* @param dateMonth 月选择器
|
|
8
|
+
* @param dateRange 日期范围 YYYY-MM-DD[]
|
|
9
|
+
* @param time: 时间 HH:mm:ss
|
|
10
|
+
* @param select 下拉选择器
|
|
11
|
+
*/
|
|
12
|
+
export type ProFieldValueType = 'text' | 'date' | 'select' | 'treeSelect' | 'dateMonth' | 'dateRange' | 'time';
|
|
13
|
+
/**
|
|
14
|
+
* @param text 文本框
|
|
15
|
+
* @param date 日期 YYYY-MM-DD
|
|
16
|
+
* @param dateMonth 月选择器
|
|
17
|
+
* @param dateRange 日期范围 YYYY-MM-DD[]
|
|
18
|
+
* @param time: 时间 HH:mm:ss
|
|
19
|
+
* @param select 下拉选择器
|
|
20
|
+
*/
|
|
21
|
+
export type ProFieldValueFormat = 'YYYY-MM-DD' | 'YYYY-MM' | 'YYYY-MM-DD HH:mm:ss' | 'HH:mm:ss';
|
|
22
|
+
export type ProSchemaValueEnumType = {
|
|
23
|
+
/** @name 演示的文案 */
|
|
24
|
+
text: VueNode | JSX.Element;
|
|
25
|
+
/** @name 演示的value值 */
|
|
26
|
+
value: any;
|
|
27
|
+
/** @name 是否禁用 */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
};
|
|
30
|
+
type ProSchemaValueType<ValueType> = (ValueType | ProFieldValueType);
|
|
31
|
+
export type ProSearchMap<ValueType = 'text'> = {
|
|
32
|
+
name?: string;
|
|
33
|
+
/** 选择如何渲染相应的模式 */
|
|
34
|
+
valueType?: ProSchemaValueType<ValueType>;
|
|
35
|
+
/** valueType为date|dateMonth|dateRange|time生效 */
|
|
36
|
+
valueFormat?: ProFieldValueFormat;
|
|
37
|
+
placeholder?: string | string[];
|
|
38
|
+
/** valueType为select生效 */
|
|
39
|
+
allowClear?: boolean;
|
|
40
|
+
/** valueType为select生效 */
|
|
41
|
+
showSearch?: boolean;
|
|
42
|
+
/** valueType为date生效 */
|
|
43
|
+
showToday?: boolean;
|
|
44
|
+
/** valueType为dateRange生效 */
|
|
45
|
+
rangeStartName?: string;
|
|
46
|
+
/** valueType为dateRange生效 */
|
|
47
|
+
rangeEndName?: string;
|
|
48
|
+
/** valueType为time生效 */
|
|
49
|
+
use12Hours?: boolean;
|
|
50
|
+
/** valueType为select生效 */
|
|
51
|
+
loading?: boolean;
|
|
52
|
+
/** valueType为date、dateRange生效 */
|
|
53
|
+
showTime?: RecordType | boolean;
|
|
54
|
+
/** 搜索表单的默认值 */
|
|
55
|
+
initialValue?: any;
|
|
56
|
+
/** 针对select、treeselect取值的key */
|
|
57
|
+
valueKey?: string;
|
|
58
|
+
/** 表单的属性值(ant-design)*/
|
|
59
|
+
field?: RecordType;
|
|
60
|
+
/**
|
|
61
|
+
* 支持 object 和Map,Map 是支持其他基础类型作为 key
|
|
62
|
+
*
|
|
63
|
+
* @name 映射值的类型
|
|
64
|
+
*/
|
|
65
|
+
valueEnum?: ProSchemaValueEnumType[];
|
|
66
|
+
};
|
|
67
|
+
export type ProColumnType<RecordType = DefaultRecordType> = ColumnType<RecordType> & {
|
|
68
|
+
children?: ProColumnsType<RecordType>;
|
|
69
|
+
uuid?: string | number;
|
|
70
|
+
/** 不在列表中显示 */
|
|
71
|
+
show?: boolean;
|
|
72
|
+
/** 列表顺序值 */
|
|
73
|
+
order?: number;
|
|
74
|
+
/** 不在配置工具中显示 */
|
|
75
|
+
hideInSetting?: boolean;
|
|
76
|
+
/** 表单搜索配置 */
|
|
77
|
+
searchConfig?: ProSearchMap;
|
|
78
|
+
/** 是否拷贝 */
|
|
79
|
+
copyable?: boolean;
|
|
80
|
+
/** 值为空时,默认取值 */
|
|
81
|
+
columnEmptyText?: string;
|
|
82
|
+
valueType?: ProColumnsValueType;
|
|
83
|
+
};
|
|
84
|
+
export type ProColumnsType<RecordType = DefaultRecordType> = (ProColumnType<RecordType>)[];
|
|
85
|
+
export type ProColumnsValueType = 'text' | 'link' | 'time' | 'dateMonth' | 'dateTime' | {
|
|
86
|
+
node?: string;
|
|
87
|
+
class?: string;
|
|
88
|
+
attr?: string;
|
|
89
|
+
click?: () => void;
|
|
90
|
+
};
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { ComputedRef, CSSProperties } from 'vue';
|
|
2
|
+
import type { RecordType, WithFalse, CustomRender, VueNode, SizeType, Breakpoint } from '@gx-design-vue/pro-utils';
|
|
3
|
+
import type { ProSearchMap, ProColumnType, ProColumnsType } from './ColumnTypings';
|
|
4
|
+
import type { DefaultRecordType } from '../typing';
|
|
5
|
+
import type { HeaderTitleRender, ToolBarBtnRender, CustomizeRender, TitleTipRender, OptionsExtraRender, SettingExtraRender, PageItemRender } from './SlotsTypings';
|
|
6
|
+
import type { FilterValue, SorterResult, TableCurrentDataSource, TableRowSelection, TablePaginationConfig, TableProps } from '../_utils';
|
|
7
|
+
import type { ColumnSettingProps } from '../components/ColumnSetting';
|
|
8
|
+
import type { ColumnsState, ColumnsStateType } from '../hooks/useColumnSetting';
|
|
9
|
+
export type ProTabelFeachParams = {
|
|
10
|
+
params?: any;
|
|
11
|
+
filters?: Record<string, FilterValue | null>;
|
|
12
|
+
sorter?: SorterResult | SorterResult[];
|
|
13
|
+
pagination?: ProTablePagination;
|
|
14
|
+
removeKeys?: (string | number)[];
|
|
15
|
+
immediate?: boolean;
|
|
16
|
+
isPolling?: boolean;
|
|
17
|
+
showLoading?: boolean;
|
|
18
|
+
extra?: TableCurrentDataSource;
|
|
19
|
+
};
|
|
20
|
+
export type TablePaginationPosition = 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
|
|
21
|
+
export type ProFieldEmptyText = string | false;
|
|
22
|
+
export type ProTableRowSelection<T = any> = Omit<TableRowSelection<T>, 'selectedRowKeys'> & {
|
|
23
|
+
selectedRowKeys?: (string | number)[];
|
|
24
|
+
};
|
|
25
|
+
export interface ProTablePaginationConfig extends Omit<TablePaginationConfig, 'position'> {
|
|
26
|
+
total?: number;
|
|
27
|
+
position?: TablePaginationPosition[];
|
|
28
|
+
}
|
|
29
|
+
export type ProTablePagination = ProTablePaginationConfig | false;
|
|
30
|
+
export type RequestData<T = any> = {
|
|
31
|
+
data: T[] | undefined;
|
|
32
|
+
success: boolean;
|
|
33
|
+
total: number;
|
|
34
|
+
} & RecordType;
|
|
35
|
+
export type RequsetConfig<T = {
|
|
36
|
+
pageSize?: number;
|
|
37
|
+
pageNum?: number;
|
|
38
|
+
}> = {
|
|
39
|
+
params: {
|
|
40
|
+
pageSize?: number;
|
|
41
|
+
pageNum?: number;
|
|
42
|
+
} & T;
|
|
43
|
+
sort: SorterResult | SorterResult[];
|
|
44
|
+
filter: Record<string, FilterValue | null>;
|
|
45
|
+
extra: TableCurrentDataSource;
|
|
46
|
+
};
|
|
47
|
+
export type RequsetFunction<T = any, D = {
|
|
48
|
+
pageSize?: number;
|
|
49
|
+
pageNum?: number;
|
|
50
|
+
}> = (params: RequsetConfig<D>['params'], sort: RequsetConfig<D>['sort'], filter: RequsetConfig<D>['filter']) => Promise<Partial<RequestData<T>>>;
|
|
51
|
+
export type ColConfig = Partial<Record<Breakpoint, number>>;
|
|
52
|
+
export type SearchConfig = {
|
|
53
|
+
searchText?: string;
|
|
54
|
+
resetText?: string;
|
|
55
|
+
className?: string;
|
|
56
|
+
defaultCollapsed?: boolean;
|
|
57
|
+
showSearch?: boolean;
|
|
58
|
+
showReset?: boolean;
|
|
59
|
+
collapseRender?: WithFalse<(collapsed?: boolean) => CustomRender>;
|
|
60
|
+
span?: ColConfig;
|
|
61
|
+
};
|
|
62
|
+
export interface OptionConfig {
|
|
63
|
+
reload?: (() => VueNode | JSX.Element) | boolean;
|
|
64
|
+
density?: boolean;
|
|
65
|
+
setting?: boolean | ColumnSettingProps;
|
|
66
|
+
fullScreen?: (() => VueNode | JSX.Element) | boolean | (() => Promise<void>);
|
|
67
|
+
}
|
|
68
|
+
/** action表格实例 */
|
|
69
|
+
export interface ProCoreActionType {
|
|
70
|
+
/** @name loadingStatus */
|
|
71
|
+
getLoadingStatus?: () => boolean;
|
|
72
|
+
dataSource?: any;
|
|
73
|
+
pageParams?: RecordType | boolean;
|
|
74
|
+
selectedKey?: (string | number)[];
|
|
75
|
+
selectedItem?: RecordType[];
|
|
76
|
+
/** @name 刷新 */
|
|
77
|
+
reload?: (info?: ProTabelFeachParams) => void;
|
|
78
|
+
/** @name 刷新并清空表单,重置为第一页 */
|
|
79
|
+
reloadAndRest?: (callBack?: () => void) => void;
|
|
80
|
+
/** @name 设置翻页*/
|
|
81
|
+
setPagination?: (pagination: ProTablePaginationConfig) => void;
|
|
82
|
+
/** @name 设置翻页、排序、筛选、并且reload */
|
|
83
|
+
setPageAndReload?: (pagination: ProTablePaginationConfig, filters?: Record<string, FilterValue | null>, sorter?: SorterResult | SorterResult[], extra?: TableCurrentDataSource) => void;
|
|
84
|
+
/** @name 更新TableData属性值 */
|
|
85
|
+
reSetDataList?: (data: RecordType[]) => void;
|
|
86
|
+
/** @name 更新TableData属性值 */
|
|
87
|
+
changeDataValue?: ({ key, params, type }: {
|
|
88
|
+
key?: string;
|
|
89
|
+
params: RecordType;
|
|
90
|
+
type?: 'update' | 'add' | 'delete';
|
|
91
|
+
}) => void;
|
|
92
|
+
/** @name 改变loading状态 */
|
|
93
|
+
loadingOperation?: (loading: boolean) => void;
|
|
94
|
+
}
|
|
95
|
+
/** form查询表单实例 */
|
|
96
|
+
export interface ProCoreFormType {
|
|
97
|
+
/** @name 获取表格-表单请求参数 */
|
|
98
|
+
getTableFormState?: () => RecordType;
|
|
99
|
+
/** @name 获取表格-内部表单参数 */
|
|
100
|
+
getFormState?: () => RecordType;
|
|
101
|
+
/** @name 重置内部表单组件参数 */
|
|
102
|
+
restForm?: (callBack?: () => void) => void;
|
|
103
|
+
}
|
|
104
|
+
export interface ProTableRef {
|
|
105
|
+
loading: ComputedRef<boolean>;
|
|
106
|
+
formRef: () => ProCoreFormType;
|
|
107
|
+
actionRef: () => ProCoreActionType;
|
|
108
|
+
}
|
|
109
|
+
export type ProTableProps<RecordType extends DefaultRecordType = DefaultRecordType> = Omit<TableProps<RecordType>, 'columns'> & Partial<{
|
|
110
|
+
tableClassName: string;
|
|
111
|
+
tableStyle: CSSProperties;
|
|
112
|
+
rowKey: string;
|
|
113
|
+
titleTipText: string;
|
|
114
|
+
autoScroll: boolean;
|
|
115
|
+
columnEmptyText: ProFieldEmptyText;
|
|
116
|
+
showLoading: boolean;
|
|
117
|
+
neverScroll: boolean;
|
|
118
|
+
modalScroll: boolean;
|
|
119
|
+
scrollBreakpoint: Breakpoint | number;
|
|
120
|
+
draggabled: boolean;
|
|
121
|
+
bordered: boolean;
|
|
122
|
+
showIndex: boolean;
|
|
123
|
+
virtualScroll: boolean;
|
|
124
|
+
size: SizeType;
|
|
125
|
+
align: ProColumnType['align'];
|
|
126
|
+
options: OptionConfig | boolean;
|
|
127
|
+
rowSelection: ProTableRowSelection;
|
|
128
|
+
columns: ProColumnsType<RecordType>;
|
|
129
|
+
columnsState: ColumnsStateType;
|
|
130
|
+
waitRequest: boolean;
|
|
131
|
+
polling: number;
|
|
132
|
+
debounceTime: number;
|
|
133
|
+
request: RequsetFunction<RecordType>;
|
|
134
|
+
params: Record<string, any>;
|
|
135
|
+
postData: (data: any[]) => any;
|
|
136
|
+
pagination: ProTablePagination;
|
|
137
|
+
search: SearchConfig | boolean;
|
|
138
|
+
searchMap: ProSearchMap[];
|
|
139
|
+
onReset: (params?: Partial<Record<string, any>>) => any;
|
|
140
|
+
onReload: (params?: Partial<Record<string, any>>) => any;
|
|
141
|
+
onSubmit: (params?: Partial<Record<string, any>>) => any;
|
|
142
|
+
onSizeChange: (size: string) => any;
|
|
143
|
+
onLoadingChange: (loading: boolean) => any;
|
|
144
|
+
onRequestError: (e: Error) => void;
|
|
145
|
+
onBeforeSearchSubmit: RequsetFunction<RecordType>;
|
|
146
|
+
onColumnsStateChange: (data: ColumnsState[]) => void;
|
|
147
|
+
titleTip: TitleTipRender;
|
|
148
|
+
headerTitle: HeaderTitleRender;
|
|
149
|
+
toolBarBtn: ToolBarBtnRender;
|
|
150
|
+
customRender: CustomizeRender;
|
|
151
|
+
optionsExtra: OptionsExtraRender;
|
|
152
|
+
settingExtra: SettingExtraRender;
|
|
153
|
+
pageItemRender: PageItemRender;
|
|
154
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gx-design-vue/pro-table",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.45",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite",
|
|
6
6
|
"build": "vite build",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@vueuse/core": "^9.10.0",
|
|
29
|
-
"@gx-design-vue/pro-utils": "^0.2.0-beta.
|
|
30
|
-
"@gx-design-vue/pro-hooks": "^0.2.0-beta.
|
|
31
|
-
"@gx-design-vue/pro-provider": "^0.1.0-beta.
|
|
32
|
-
"@gx-design-vue/pro-app": "^0.1.0-beta.
|
|
29
|
+
"@gx-design-vue/pro-utils": "^0.2.0-beta.25",
|
|
30
|
+
"@gx-design-vue/pro-hooks": "^0.2.0-beta.18",
|
|
31
|
+
"@gx-design-vue/pro-provider": "^0.1.0-beta.49",
|
|
32
|
+
"@gx-design-vue/pro-app": "^0.1.0-beta.10",
|
|
33
33
|
"ant-design-vue": "^4.1.2",
|
|
34
34
|
"dayjs": "^1.11.0",
|
|
35
35
|
"lodash-es": "^4.17.21",
|