foggy-data-viewer 1.0.1-beta.21 → 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 +6 -6
- package/dist/api/listPreset.d.ts +49 -0
- package/dist/components/DataTable.vue.d.ts +2 -0
- package/dist/components/DataTableWithSearch.vue.d.ts +25 -18
- package/dist/components/list-preset/ListPresetManager.vue.d.ts +100 -0
- package/dist/favicon.svg +4 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +6043 -0
- package/dist/index.umd +1 -0
- package/dist/style.css +1 -0
- 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 -1144
- package/src/components/DataTableWithSearch.vue +0 -698
- package/src/components/DataViewer.vue +0 -311
- package/src/components/QueryPanel.test.ts +0 -112
- package/src/components/QueryPanel.vue +0 -374
- 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 -110
- 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
|
@@ -110,7 +110,7 @@ function handlePageChange(page: number, pageSize: number) {
|
|
|
110
110
|
|------|------|------|
|
|
111
111
|
| **DataTable** | 基础数据表格组件(表头过滤器、分页、排序、汇总) | [见下方 API](#datatable-props) |
|
|
112
112
|
| **SearchToolbar** | 独立搜索工具栏组件(字段级快速筛选) | [完整文档](./docs/SearchToolbar.md) |
|
|
113
|
-
| **DataTableWithSearch** | 组合组件(SearchToolbar + DataTable + 属性透传,支持 queryMode 查询入口模式) | [完整文档](./docs/SearchToolbar.md#datatablewithsearch-使用) |
|
|
113
|
+
| **DataTableWithSearch** | 组合组件(SearchToolbar + DataTable + 属性透传,支持 queryMode 查询入口模式) | [完整文档](./docs/SearchToolbar.md#datatablewithsearch-使用) |
|
|
114
114
|
| **DataViewer** | 高层封装组件(集成 API 调用、元数据管理) | 待完善 |
|
|
115
115
|
|
|
116
116
|
### 工具函数
|
|
@@ -237,11 +237,11 @@ npm test
|
|
|
237
237
|
# 测试覆盖率
|
|
238
238
|
npm run test:coverage
|
|
239
239
|
|
|
240
|
-
#
|
|
241
|
-
npm run build
|
|
242
|
-
|
|
243
|
-
#
|
|
244
|
-
npm run build
|
|
240
|
+
# 构建发布包(库产物 + 类型声明 + 入口校验)
|
|
241
|
+
npm run build
|
|
242
|
+
|
|
243
|
+
# 构建内嵌应用静态资源
|
|
244
|
+
npm run build:app
|
|
245
245
|
```
|
|
246
246
|
|
|
247
247
|
## 测试
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import type { EnhancedColumnSchema, SliceRequestDef, FilterOption, TableSchema, FetchDataParams, FetchDataResult, OrderRequestDef, QueryHooks, MemberQueryRequest, MemberQueryResponse, CellCopyConfig, QueryMode } from '@/types';
|
|
1
|
+
import type { EnhancedColumnSchema, SliceRequestDef, FilterOption, TableSchema, FetchDataParams, FetchDataResult, OrderRequestDef, QueryHooks, MemberQueryRequest, MemberQueryResponse, CellCopyConfig, QueryMode, ListViewState, ListPresetConfig } from '@/types';
|
|
2
2
|
import type { QueryPanelExpose, QuerySchema } from './QueryPanel.vue';
|
|
3
3
|
/**
|
|
4
4
|
* DataTableWithSearch 组件
|
|
@@ -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;
|
|
@@ -73,21 +75,30 @@ interface DataTableExpose {
|
|
|
73
75
|
}
|
|
74
76
|
declare function searchQueryPanel(): void;
|
|
75
77
|
declare function resetQueryPanel(): void;
|
|
76
|
-
declare
|
|
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: {
|
|
77
86
|
row: Record<string, unknown>;
|
|
78
87
|
column: EnhancedColumnSchema;
|
|
79
88
|
value: unknown;
|
|
80
|
-
},
|
|
89
|
+
}, __VLS_45: string, __VLS_46: any;
|
|
81
90
|
type __VLS_Slots = {} & {
|
|
82
|
-
[K in NonNullable<typeof
|
|
91
|
+
[K in NonNullable<typeof __VLS_45>]?: (props: typeof __VLS_46) => any;
|
|
83
92
|
} & {
|
|
84
93
|
toolbar?: (props: typeof __VLS_28) => any;
|
|
85
94
|
} & {
|
|
86
|
-
|
|
95
|
+
'toolbar-right'?: (props: typeof __VLS_33) => any;
|
|
87
96
|
} & {
|
|
88
|
-
|
|
97
|
+
footer?: (props: typeof __VLS_38) => any;
|
|
89
98
|
} & {
|
|
90
|
-
|
|
99
|
+
empty?: (props: typeof __VLS_40) => any;
|
|
100
|
+
} & {
|
|
101
|
+
'row-actions'?: (props: typeof __VLS_42) => any;
|
|
91
102
|
};
|
|
92
103
|
declare const __VLS_component: import("vue").DefineComponent<Props, {
|
|
93
104
|
/** 获取 SearchToolbar 实例 */
|
|
@@ -140,18 +151,14 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {
|
|
|
140
151
|
clearSelection: () => void;
|
|
141
152
|
/** 获取 useTableQuery 实例(高级用法) */
|
|
142
153
|
getQuery: () => import("./composables/useTableQuery").UseTableQueryReturn;
|
|
154
|
+
/** 获取当前列表视图状态(用于保存自定义列表) */
|
|
155
|
+
getListViewState: typeof getListViewState;
|
|
156
|
+
/** 应用列表视图状态(用于加载自定义列表) */
|
|
157
|
+
applyListViewState: typeof applyListViewState;
|
|
158
|
+
/** 重置列表视图状态 */
|
|
159
|
+
resetListViewState: typeof resetListViewState;
|
|
143
160
|
/** 获取当前查询状态(用于保存查询) */
|
|
144
|
-
getQueryState:
|
|
145
|
-
columns: string[];
|
|
146
|
-
slice: {
|
|
147
|
-
field: string;
|
|
148
|
-
op: string;
|
|
149
|
-
value?: unknown;
|
|
150
|
-
link?: 1 | 2;
|
|
151
|
-
children?: /*elided*/ any[];
|
|
152
|
-
}[];
|
|
153
|
-
orderBy: OrderRequestDef[];
|
|
154
|
-
};
|
|
161
|
+
getQueryState: typeof getListViewState;
|
|
155
162
|
/** 应用查询状态(用于加载保存的查询) */
|
|
156
163
|
applyQueryState: (state: {
|
|
157
164
|
columns: string[];
|
|
@@ -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/favicon.svg
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ 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';
|
|
9
10
|
export type { QueryFieldSchema, QueryPanelLayoutSchema, QueryPanelExpose, QuerySchema } from './components/QueryPanel.vue';
|
|
10
11
|
export * from './components/filters';
|
|
11
12
|
export * from './components/saved-query';
|
|
@@ -15,4 +16,6 @@ export { createQuery, fetchQueryMeta, fetchQueryData, fetchFilterOptions, fetchQ
|
|
|
15
16
|
export type { QueryPayload, CreateQueryRequest, CreateQueryResponse } from './api/viewer';
|
|
16
17
|
export { saveQuery, listSavedQueries, getSavedQuery, updateSavedQuery, deleteSavedQuery, applySavedQuery } from './api/savedQuery';
|
|
17
18
|
export type { SavedQueryDef, SaveQueryRequest, QueryVisibility } from './api/savedQuery';
|
|
18
|
-
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';
|