foggy-data-viewer 1.0.1-beta.20 → 1.0.1-beta.22
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/README.md +5 -5
- package/dist/api/listPreset.d.ts +49 -0
- package/dist/components/DataTable.vue.d.ts +2 -0
- package/dist/components/DataTableWithSearch.vue.d.ts +34 -19
- package/dist/components/QueryPanel.vue.d.ts +6 -0
- package/dist/components/list-preset/ListPresetManager.vue.d.ts +100 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3530 -2486
- package/dist/index.umd +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +63 -0
- package/package.json +31 -29
- package/src/App.vue +0 -472
- package/src/api/savedQuery.ts +0 -137
- package/src/api/viewer.ts +0 -236
- package/src/components/DataTable.test.ts +0 -816
- package/src/components/DataTable.vue +0 -1011
- package/src/components/DataTableWithSearch.test.ts +0 -1030
- package/src/components/DataTableWithSearch.vue +0 -682
- package/src/components/DataViewer.vue +0 -311
- package/src/components/QueryPanel.vue +0 -358
- package/src/components/SearchToolbar.test.ts +0 -570
- package/src/components/SearchToolbar.vue +0 -434
- package/src/components/composables/globalQueryHooks.ts +0 -86
- package/src/components/composables/hookRegistry.test.ts +0 -232
- package/src/components/composables/hookRegistry.ts +0 -106
- package/src/components/composables/index.ts +0 -8
- package/src/components/composables/useQueryState.ts +0 -126
- package/src/components/composables/useTableQuery.test.ts +0 -557
- package/src/components/composables/useTableQuery.ts +0 -206
- package/src/components/composables/useTableSelection.test.ts +0 -248
- package/src/components/composables/useTableSelection.ts +0 -44
- package/src/components/composables/useTableSummary.test.ts +0 -341
- package/src/components/composables/useTableSummary.ts +0 -129
- package/src/components/filters/BoolFilter.vue +0 -103
- package/src/components/filters/DateRangeFilter.vue +0 -194
- package/src/components/filters/NumberRangeFilter.vue +0 -160
- package/src/components/filters/SelectFilter.vue +0 -576
- package/src/components/filters/TextFilter.vue +0 -233
- package/src/components/filters/index.ts +0 -5
- package/src/components/saved-query/OptionManagerDialog.vue +0 -98
- package/src/components/saved-query/QueryListDialog.vue +0 -397
- package/src/components/saved-query/SaveQueryDialog.vue +0 -761
- package/src/components/saved-query/SavedQueryManager.vue +0 -123
- package/src/components/saved-query/index.ts +0 -4
- package/src/examples/EnhancedTableExample.vue +0 -136
- package/src/examples/GeneratedTableExample.vue +0 -238
- package/src/index.ts +0 -103
- package/src/main.ts +0 -17
- package/src/types/index.ts +0 -412
- package/src/utils/README.md +0 -140
- package/src/utils/schemaHelper.test.ts +0 -215
- package/src/utils/schemaHelper.ts +0 -107
- package/src/vite-env.d.ts +0 -12
package/README.md
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ColumnViewSetting, ListPresetDef, ListPresetVisibility, QueryConditionPreset } from '@/types';
|
|
2
|
+
export interface ListPresetScope {
|
|
3
|
+
userId: string;
|
|
4
|
+
model: string;
|
|
5
|
+
businessKey?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SaveListPresetRequest {
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
columns: string[];
|
|
11
|
+
columnSettings?: ColumnViewSetting[];
|
|
12
|
+
query?: QueryConditionPreset;
|
|
13
|
+
pageSize?: number;
|
|
14
|
+
visibility?: ListPresetVisibility;
|
|
15
|
+
isDefault?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type UpdateListPresetRequest = Partial<SaveListPresetRequest>;
|
|
18
|
+
/**
|
|
19
|
+
* 查询当前用户在指定 model/businessKey 下的自定义列表方案。
|
|
20
|
+
*/
|
|
21
|
+
export declare function listPresets(scope: ListPresetScope): Promise<ListPresetDef[]>;
|
|
22
|
+
/**
|
|
23
|
+
* 查询当前用户在指定 model/businessKey 下的默认自定义列表。
|
|
24
|
+
*/
|
|
25
|
+
export declare function getDefaultListPreset(scope: ListPresetScope): Promise<ListPresetDef | null>;
|
|
26
|
+
/**
|
|
27
|
+
* 保存新的自定义列表方案。
|
|
28
|
+
*/
|
|
29
|
+
export declare function createListPreset(scope: ListPresetScope, request: SaveListPresetRequest): Promise<ListPresetDef>;
|
|
30
|
+
/**
|
|
31
|
+
* 获取单个自定义列表详情。
|
|
32
|
+
*/
|
|
33
|
+
export declare function getListPreset(userId: string, presetId: string): Promise<ListPresetDef>;
|
|
34
|
+
/**
|
|
35
|
+
* 更新自定义列表方案。
|
|
36
|
+
*/
|
|
37
|
+
export declare function updateListPreset(userId: string, presetId: string, request: UpdateListPresetRequest): Promise<ListPresetDef>;
|
|
38
|
+
/**
|
|
39
|
+
* 删除自定义列表方案。
|
|
40
|
+
*/
|
|
41
|
+
export declare function deleteListPreset(userId: string, presetId: string): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* 将某个自定义列表设为默认方案。
|
|
44
|
+
*/
|
|
45
|
+
export declare function setDefaultListPreset(userId: string, presetId: string): Promise<ListPresetDef>;
|
|
46
|
+
/**
|
|
47
|
+
* 清除当前 model/businessKey 下的默认方案。
|
|
48
|
+
*/
|
|
49
|
+
export declare function clearDefaultListPreset(scope: ListPresetScope): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EnhancedColumnSchema, SliceRequestDef, FilterOption, TableSchema, FetchDataParams, FetchDataResult, OrderRequestDef, QueryHooks, MemberQueryRequest, MemberQueryResponse, CellCopyConfig, QueryMode } from '@/types';
|
|
2
|
-
import type { QuerySchema } from './QueryPanel.vue';
|
|
1
|
+
import type { EnhancedColumnSchema, SliceRequestDef, FilterOption, TableSchema, FetchDataParams, FetchDataResult, OrderRequestDef, QueryHooks, MemberQueryRequest, MemberQueryResponse, CellCopyConfig, QueryMode, ListViewState, ListPresetConfig } from '@/types';
|
|
2
|
+
import type { QueryPanelExpose, QuerySchema } from './QueryPanel.vue';
|
|
3
3
|
/**
|
|
4
4
|
* DataTableWithSearch 组件
|
|
5
5
|
*
|
|
@@ -58,6 +58,8 @@ interface Props {
|
|
|
58
58
|
filterMemberLoader?: (request: MemberQueryRequest) => Promise<MemberQueryResponse>;
|
|
59
59
|
/** 启用保存查询功能 */
|
|
60
60
|
enableSavedQuery?: boolean;
|
|
61
|
+
/** 自定义列表配置 */
|
|
62
|
+
listPreset?: boolean | ListPresetConfig;
|
|
61
63
|
}
|
|
62
64
|
interface SearchToolbarExpose {
|
|
63
65
|
clearFilters: () => void;
|
|
@@ -71,31 +73,48 @@ interface DataTableExpose {
|
|
|
71
73
|
getSelectedCount: () => number;
|
|
72
74
|
clearSelection: () => void;
|
|
73
75
|
}
|
|
74
|
-
declare
|
|
76
|
+
declare function searchQueryPanel(): void;
|
|
77
|
+
declare function resetQueryPanel(): void;
|
|
78
|
+
declare function getListViewState(): ListViewState;
|
|
79
|
+
declare function applyListViewState(state: ListViewState, options?: {
|
|
80
|
+
reload?: boolean;
|
|
81
|
+
}): void;
|
|
82
|
+
declare function resetListViewState(options?: {
|
|
83
|
+
reload?: boolean;
|
|
84
|
+
}): void;
|
|
85
|
+
declare var __VLS_28: {}, __VLS_33: {}, __VLS_38: {}, __VLS_40: {}, __VLS_42: {
|
|
75
86
|
row: Record<string, unknown>;
|
|
76
87
|
column: EnhancedColumnSchema;
|
|
77
88
|
value: unknown;
|
|
78
|
-
},
|
|
89
|
+
}, __VLS_45: string, __VLS_46: any;
|
|
79
90
|
type __VLS_Slots = {} & {
|
|
80
|
-
[K in NonNullable<typeof
|
|
91
|
+
[K in NonNullable<typeof __VLS_45>]?: (props: typeof __VLS_46) => any;
|
|
81
92
|
} & {
|
|
82
93
|
toolbar?: (props: typeof __VLS_28) => any;
|
|
83
94
|
} & {
|
|
84
|
-
|
|
95
|
+
'toolbar-right'?: (props: typeof __VLS_33) => any;
|
|
85
96
|
} & {
|
|
86
|
-
|
|
97
|
+
footer?: (props: typeof __VLS_38) => any;
|
|
87
98
|
} & {
|
|
88
|
-
|
|
99
|
+
empty?: (props: typeof __VLS_40) => any;
|
|
100
|
+
} & {
|
|
101
|
+
'row-actions'?: (props: typeof __VLS_42) => any;
|
|
89
102
|
};
|
|
90
103
|
declare const __VLS_component: import("vue").DefineComponent<Props, {
|
|
91
104
|
/** 获取 SearchToolbar 实例 */
|
|
92
105
|
getSearchToolbar: () => SearchToolbarExpose;
|
|
106
|
+
/** 获取 QueryPanel 实例 */
|
|
107
|
+
getQueryPanel: () => QueryPanelExpose;
|
|
93
108
|
/** 获取 DataTable 实例 */
|
|
94
109
|
getDataTable: () => DataTableExpose;
|
|
95
110
|
/** 清空搜索工具栏筛选 */
|
|
96
111
|
clearSearchFilters: () => void;
|
|
97
112
|
/** 清空表头筛选 */
|
|
98
113
|
clearTableFilters: () => void;
|
|
114
|
+
/** 触发 QueryPanel 查询,提交当前表单值 */
|
|
115
|
+
searchQueryPanel: typeof searchQueryPanel;
|
|
116
|
+
/** 重置 QueryPanel 并刷新筛选 */
|
|
117
|
+
resetQueryPanel: typeof resetQueryPanel;
|
|
99
118
|
/** 清空所有筛选 */
|
|
100
119
|
clearAllFilters: () => void;
|
|
101
120
|
/** 获取合并后的筛选条件 */
|
|
@@ -132,18 +151,14 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {
|
|
|
132
151
|
clearSelection: () => void;
|
|
133
152
|
/** 获取 useTableQuery 实例(高级用法) */
|
|
134
153
|
getQuery: () => import("./composables/useTableQuery").UseTableQueryReturn;
|
|
154
|
+
/** 获取当前列表视图状态(用于保存自定义列表) */
|
|
155
|
+
getListViewState: typeof getListViewState;
|
|
156
|
+
/** 应用列表视图状态(用于加载自定义列表) */
|
|
157
|
+
applyListViewState: typeof applyListViewState;
|
|
158
|
+
/** 重置列表视图状态 */
|
|
159
|
+
resetListViewState: typeof resetListViewState;
|
|
135
160
|
/** 获取当前查询状态(用于保存查询) */
|
|
136
|
-
getQueryState:
|
|
137
|
-
columns: string[];
|
|
138
|
-
slice: {
|
|
139
|
-
field: string;
|
|
140
|
-
op: string;
|
|
141
|
-
value?: unknown;
|
|
142
|
-
link?: 1 | 2;
|
|
143
|
-
children?: /*elided*/ any[];
|
|
144
|
-
}[];
|
|
145
|
-
orderBy: OrderRequestDef[];
|
|
146
|
-
};
|
|
161
|
+
getQueryState: typeof getListViewState;
|
|
147
162
|
/** 应用查询状态(用于加载保存的查询) */
|
|
148
163
|
applyQueryState: (state: {
|
|
149
164
|
columns: string[];
|
|
@@ -16,6 +16,7 @@ export interface QueryFieldSchema {
|
|
|
16
16
|
defaultValue?: unknown;
|
|
17
17
|
columnRef?: string;
|
|
18
18
|
dictId?: string;
|
|
19
|
+
/** 远程成员查询使用的展示/lookup 字段,如 customer$caption */
|
|
19
20
|
lookupRef?: string;
|
|
20
21
|
order?: number;
|
|
21
22
|
span?: number;
|
|
@@ -42,6 +43,11 @@ export interface QuerySchema {
|
|
|
42
43
|
defaultExpanded?: boolean;
|
|
43
44
|
layout?: QueryPanelLayoutSchema;
|
|
44
45
|
}
|
|
46
|
+
export interface QueryPanelExpose {
|
|
47
|
+
search: () => void;
|
|
48
|
+
reset: () => void;
|
|
49
|
+
getSlices: () => SliceRequestDef[];
|
|
50
|
+
}
|
|
45
51
|
interface Props {
|
|
46
52
|
/** 查询 Schema */
|
|
47
53
|
schema: QuerySchema;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { EnhancedColumnSchema, ListPresetConfig, ListPresetDef, ListPresetVisibility, ListViewState } from '@/types';
|
|
2
|
+
interface Props {
|
|
3
|
+
config: ListPresetConfig;
|
|
4
|
+
getState: () => ListViewState;
|
|
5
|
+
applyState: (state: ListViewState) => void;
|
|
6
|
+
reload?: () => void | Promise<void>;
|
|
7
|
+
availableColumns?: EnhancedColumnSchema[];
|
|
8
|
+
}
|
|
9
|
+
declare const form: import("vue").Ref<{
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
visibility: ListPresetVisibility;
|
|
13
|
+
isDefault: boolean;
|
|
14
|
+
saveQueryConditions: boolean;
|
|
15
|
+
}, {
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
visibility: ListPresetVisibility;
|
|
19
|
+
isDefault: boolean;
|
|
20
|
+
saveQueryConditions: boolean;
|
|
21
|
+
} | {
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
visibility: ListPresetVisibility;
|
|
25
|
+
isDefault: boolean;
|
|
26
|
+
saveQueryConditions: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
declare function openDialog(): void;
|
|
29
|
+
declare function syncColumnDraftFromState(): void;
|
|
30
|
+
declare function loadPresets(): Promise<void>;
|
|
31
|
+
declare function applyPreset(preset: ListPresetDef): Promise<void>;
|
|
32
|
+
declare function startEditPreset(preset: ListPresetDef): void;
|
|
33
|
+
declare function cancelEdit(): void;
|
|
34
|
+
declare function saveCurrentPreset(): Promise<void>;
|
|
35
|
+
declare function overwritePreset(preset: ListPresetDef): Promise<void>;
|
|
36
|
+
declare const _default: import("vue").DefineComponent<Props, {
|
|
37
|
+
applyPreset: typeof applyPreset;
|
|
38
|
+
cancelEdit: typeof cancelEdit;
|
|
39
|
+
loadPresets: typeof loadPresets;
|
|
40
|
+
openDialog: typeof openDialog;
|
|
41
|
+
overwritePreset: typeof overwritePreset;
|
|
42
|
+
saveCurrentPreset: typeof saveCurrentPreset;
|
|
43
|
+
startEditPreset: typeof startEditPreset;
|
|
44
|
+
setDraft: (draft: Partial<typeof form.value>) => void;
|
|
45
|
+
getDraft: () => {
|
|
46
|
+
title: string;
|
|
47
|
+
description: string;
|
|
48
|
+
visibility: ListPresetVisibility;
|
|
49
|
+
isDefault: boolean;
|
|
50
|
+
saveQueryConditions: boolean;
|
|
51
|
+
};
|
|
52
|
+
getPresets: () => {
|
|
53
|
+
id: string;
|
|
54
|
+
model: string;
|
|
55
|
+
businessKey?: string;
|
|
56
|
+
title: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
columns: string[];
|
|
59
|
+
columnSettings?: {
|
|
60
|
+
name: string;
|
|
61
|
+
visible: boolean;
|
|
62
|
+
width?: number;
|
|
63
|
+
minWidth?: number;
|
|
64
|
+
fixed?: "left" | "right";
|
|
65
|
+
order: number;
|
|
66
|
+
}[];
|
|
67
|
+
query: {
|
|
68
|
+
slice: {
|
|
69
|
+
field: string;
|
|
70
|
+
op: string;
|
|
71
|
+
value?: unknown;
|
|
72
|
+
link?: 1 | 2;
|
|
73
|
+
children?: /*elided*/ any[];
|
|
74
|
+
}[];
|
|
75
|
+
orderBy: {
|
|
76
|
+
field: string;
|
|
77
|
+
order: "asc" | "desc";
|
|
78
|
+
}[];
|
|
79
|
+
};
|
|
80
|
+
pageSize?: number;
|
|
81
|
+
visibility: ListPresetVisibility;
|
|
82
|
+
ownerId: string;
|
|
83
|
+
ownerDeptId?: string;
|
|
84
|
+
ownerTenantId?: string;
|
|
85
|
+
isDefault?: boolean;
|
|
86
|
+
version: 1;
|
|
87
|
+
createdAt: string;
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
}[];
|
|
90
|
+
getColumnDraft: () => {
|
|
91
|
+
name: string;
|
|
92
|
+
title?: string;
|
|
93
|
+
visible: boolean;
|
|
94
|
+
width?: number;
|
|
95
|
+
minWidth?: number;
|
|
96
|
+
fixed?: "left" | "right";
|
|
97
|
+
}[];
|
|
98
|
+
syncColumnDraftFromState: typeof syncColumnDraftFromState;
|
|
99
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
100
|
+
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { default as DataViewer } from './components/DataViewer.vue';
|
|
|
6
6
|
export { default as SearchToolbar } from './components/SearchToolbar.vue';
|
|
7
7
|
export { default as DataTableWithSearch } from './components/DataTableWithSearch.vue';
|
|
8
8
|
export { default as QueryPanel } from './components/QueryPanel.vue';
|
|
9
|
+
export { default as ListPresetManager } from './components/list-preset/ListPresetManager.vue';
|
|
10
|
+
export type { QueryFieldSchema, QueryPanelLayoutSchema, QueryPanelExpose, QuerySchema } from './components/QueryPanel.vue';
|
|
9
11
|
export * from './components/filters';
|
|
10
12
|
export * from './components/saved-query';
|
|
11
13
|
export * from './components/composables';
|
|
@@ -14,4 +16,6 @@ export { createQuery, fetchQueryMeta, fetchQueryData, fetchFilterOptions, fetchQ
|
|
|
14
16
|
export type { QueryPayload, CreateQueryRequest, CreateQueryResponse } from './api/viewer';
|
|
15
17
|
export { saveQuery, listSavedQueries, getSavedQuery, updateSavedQuery, deleteSavedQuery, applySavedQuery } from './api/savedQuery';
|
|
16
18
|
export type { SavedQueryDef, SaveQueryRequest, QueryVisibility } from './api/savedQuery';
|
|
17
|
-
export
|
|
19
|
+
export { listPresets, getDefaultListPreset, createListPreset, getListPreset, updateListPreset, deleteListPreset, setDefaultListPreset, clearDefaultListPreset } from './api/listPreset';
|
|
20
|
+
export type { ListPresetScope, SaveListPresetRequest, UpdateListPresetRequest } from './api/listPreset';
|
|
21
|
+
export type { ColumnSchema, EnhancedColumnSchema, TableConfig, TableSchema, CellCopyConfig, QueryMode, ColumnCustomization, QueryMetaResponse, ViewerQueryRequest, ViewerDataResponse, SliceRequestDef, OrderRequestDef, FilterOption, FetchDataParams, FetchDataResult, FetchDataFn, DictItem, PaginationState, SortState, QueryHooks, QueryHookContext, QueryTrigger, QueryHookName, BeforeQueryHookFn, AfterQueryHookFn, ErrorQueryHookFn, MaybePromise, ListPresetVisibility, ListPresetPlacement, ListPresetConfig, ColumnViewSetting, QueryConditionPreset, ListViewState, ListPresetDef, FrontendMeta, FieldMeta, FieldCategory, MemberLookupMeta, UiHintsMeta, DefaultsMeta, CapabilitiesMeta, ParamsMeta, MemberQueryRequest, MemberOption, MemberQueryResponse } from './types';
|