foggy-data-viewer 1.0.1-beta.47 → 1.0.1-beta.48
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 +4 -4
- package/dist/components/DataTable.vue.d.ts +1 -1
- package/dist/components/DataTableWithSearch.vue.d.ts +9 -0
- package/dist/components/composables/useTableQuery.d.ts +1 -0
- package/dist/components/list-preset/ListPresetConditionEditor.vue.d.ts +24 -0
- package/dist/components/list-preset/ListPresetManager.vue.d.ts +7 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3585 -3046
- package/dist/index.umd +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +13 -0
- package/dist/utils/listPreset.d.ts +32 -0
- package/docs/http-auth.md +123 -123
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Foggy Data Viewer
|
|
2
2
|
|
|
3
|
-
一个基于 Vue 3 + TypeScript + vxe-table 的企业级数据表格组件库。
|
|
4
|
-
|
|
5
|
-
HTTP 鉴权接入(beta.47 起):从公共入口导入 `configureDataViewerHttp`,在应用挂载前配置动态 `getHeaders` 和 `onUnauthorized`。允许先导入 SDK 再配置,无需 patch Axios,也无需修改 generated 文件。详见 [HTTP 接入与 TMS 迁移指南](./docs/http-auth.md)。
|
|
3
|
+
一个基于 Vue 3 + TypeScript + vxe-table 的企业级数据表格组件库。
|
|
4
|
+
|
|
5
|
+
HTTP 鉴权接入(beta.47 起):从公共入口导入 `configureDataViewerHttp`,在应用挂载前配置动态 `getHeaders` 和 `onUnauthorized`。允许先导入 SDK 再配置,无需 patch Axios,也无需修改 generated 文件。详见 [HTTP 接入与 TMS 迁移指南](./docs/http-auth.md)。
|
|
6
6
|
|
|
7
7
|
## 特性
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ HTTP 鉴权接入(beta.47 起):从公共入口导入 `configureDataViewerH
|
|
|
18
18
|
## 安装
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npm install foggy-data-viewer
|
|
21
|
+
npm install foggy-data-viewer
|
|
22
22
|
# 或
|
|
23
23
|
yarn add foggy-data-viewer
|
|
24
24
|
# 或
|
|
@@ -121,10 +121,10 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {
|
|
|
121
121
|
"onCheckbox-change"?: (rows: Record<string, unknown>[]) => any;
|
|
122
122
|
"onCheckbox-all"?: (rows: Record<string, unknown>[]) => any;
|
|
123
123
|
}>, {
|
|
124
|
+
pageSize: number;
|
|
124
125
|
backgroundLoading: boolean;
|
|
125
126
|
backgroundLoadingText: string;
|
|
126
127
|
backgroundLoadingError: string | null;
|
|
127
|
-
pageSize: number;
|
|
128
128
|
showFilters: boolean;
|
|
129
129
|
showPager: boolean;
|
|
130
130
|
localFilter: boolean;
|
|
@@ -12,6 +12,10 @@ interface Props {
|
|
|
12
12
|
schema?: TableSchema;
|
|
13
13
|
/** 数据加载函数 */
|
|
14
14
|
fetchData?: (params: FetchDataParams) => Promise<FetchDataResult>;
|
|
15
|
+
/** 业务查询所需但不一定展示的字段;不会作为用户字段保存 */
|
|
16
|
+
requiredFields?: string[];
|
|
17
|
+
/** 业务查询所需但不一定展示的运行时字段;不会作为用户字段保存 */
|
|
18
|
+
requiredRuntimeColumns?: string[];
|
|
15
19
|
/** 列配置 */
|
|
16
20
|
columns?: EnhancedColumnSchema[];
|
|
17
21
|
/** 表格数据 */
|
|
@@ -102,6 +106,7 @@ declare function resetQueryPanel(): void;
|
|
|
102
106
|
declare function getListViewState(): ListViewState;
|
|
103
107
|
declare function applyListViewState(state: ListViewState, options?: {
|
|
104
108
|
reload?: boolean;
|
|
109
|
+
validateLimits?: boolean;
|
|
105
110
|
}): void;
|
|
106
111
|
declare function resetListViewState(options?: {
|
|
107
112
|
reload?: boolean;
|
|
@@ -151,6 +156,10 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {
|
|
|
151
156
|
value?: unknown;
|
|
152
157
|
link?: 1 | 2;
|
|
153
158
|
children?: /*elided*/ any[];
|
|
159
|
+
$or?: /*elided*/ any[];
|
|
160
|
+
$and?: /*elided*/ any[];
|
|
161
|
+
$expr?: string;
|
|
162
|
+
maxDepth?: number;
|
|
154
163
|
}[];
|
|
155
164
|
/** 重置分页 */
|
|
156
165
|
resetPagination: () => void;
|
|
@@ -18,6 +18,7 @@ export interface UseTableQueryReturn {
|
|
|
18
18
|
loading: ReturnType<typeof ref<boolean>>;
|
|
19
19
|
activeTrigger: ReturnType<typeof ref<QueryTrigger | null>>;
|
|
20
20
|
lastError: ReturnType<typeof ref<Error | null>>;
|
|
21
|
+
lastOutcome: ReturnType<typeof ref<'success' | 'cancelled' | 'error' | null>>;
|
|
21
22
|
serverSummary: ReturnType<typeof ref<Record<string, unknown> | null>>;
|
|
22
23
|
currentPage: ReturnType<typeof ref<number>>;
|
|
23
24
|
currentPageSize: ReturnType<typeof ref<number>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ColumnSchema, SliceRequestDef, MemberQueryRequest, MemberQueryResponse } from '@/types';
|
|
2
|
+
interface Props {
|
|
3
|
+
modelValue?: SliceRequestDef[];
|
|
4
|
+
columns: ColumnSchema[];
|
|
5
|
+
maxConditions?: number;
|
|
6
|
+
showToolbar?: boolean;
|
|
7
|
+
pathLabel?: string;
|
|
8
|
+
/** Leaf conditions outside this recursive subtree. */
|
|
9
|
+
conditionOffset?: number;
|
|
10
|
+
qmModel?: string;
|
|
11
|
+
filterMemberLoader?: (request: MemberQueryRequest) => Promise<MemberQueryResponse>;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
|
+
"update:modelValue": (value: SliceRequestDef[]) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: (value: SliceRequestDef[]) => any;
|
|
17
|
+
}>, {
|
|
18
|
+
modelValue: SliceRequestDef[];
|
|
19
|
+
maxConditions: number;
|
|
20
|
+
showToolbar: boolean;
|
|
21
|
+
pathLabel: string;
|
|
22
|
+
conditionOffset: number;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import type { EnhancedColumnSchema, ListPresetConfig, ListPresetDef, ListPresetVisibility, ListViewState } from '@/types';
|
|
1
|
+
import type { EnhancedColumnSchema, ListPresetConfig, ListPresetDef, ListPresetVisibility, ListViewState, MemberQueryRequest, MemberQueryResponse } from '@/types';
|
|
2
2
|
interface Props {
|
|
3
3
|
config: ListPresetConfig;
|
|
4
4
|
getState: () => ListViewState;
|
|
5
5
|
applyState: (state: ListViewState, options?: {
|
|
6
6
|
reload?: boolean;
|
|
7
|
+
validateLimits?: boolean;
|
|
7
8
|
}) => void;
|
|
8
9
|
reload?: () => void | Promise<void>;
|
|
9
10
|
clearConditions?: () => void | Promise<void>;
|
|
10
11
|
availableColumns?: EnhancedColumnSchema[];
|
|
11
12
|
lockedColumns?: string[];
|
|
12
13
|
requiredRuntimeColumns?: string[];
|
|
14
|
+
filterMemberLoader?: (request: MemberQueryRequest) => Promise<MemberQueryResponse>;
|
|
13
15
|
triggerMode?: 'button' | 'none';
|
|
14
16
|
}
|
|
15
17
|
type MoveEdge = 'top' | 'bottom';
|
|
@@ -90,6 +92,10 @@ declare const _default: import("vue").DefineComponent<Props, {
|
|
|
90
92
|
value?: unknown;
|
|
91
93
|
link?: 1 | 2;
|
|
92
94
|
children?: /*elided*/ any[];
|
|
95
|
+
$or?: /*elided*/ any[];
|
|
96
|
+
$and?: /*elided*/ any[];
|
|
97
|
+
$expr?: string;
|
|
98
|
+
maxDepth?: number;
|
|
93
99
|
}[];
|
|
94
100
|
orderBy: {
|
|
95
101
|
field: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,10 +12,12 @@ export { default as PivotGrid } from './components/PivotGrid.vue';
|
|
|
12
12
|
export { default as PivotAxisPager } from './components/PivotAxisPager.vue';
|
|
13
13
|
export { default as PivotEvidencePanel } from './components/PivotEvidencePanel.vue';
|
|
14
14
|
export { default as ListPresetManager } from './components/list-preset/ListPresetManager.vue';
|
|
15
|
+
export { default as ListPresetConditionEditor } from './components/list-preset/ListPresetConditionEditor.vue';
|
|
15
16
|
export type { QueryFieldSchema, QueryPanelLayoutSchema, QueryPanelExpose, QuerySchema } from './components/QueryPanel.vue';
|
|
16
17
|
export * from './components/filters';
|
|
17
18
|
export * from './components/composables';
|
|
18
19
|
export { buildTableColumns, calculateColumnWidth } from './utils/schemaHelper';
|
|
20
|
+
export { MAX_LIST_PRESET_FIELDS, MAX_LIST_PRESET_CONDITIONS, countConditionLeaves, cloneSliceTree, getConditionFields, getListPresetFieldCount, getListPresetLimitResult, validateListPresetLimits, getUserConfigurableColumns, getDisplayColumnForCondition, getQueryFieldForColumn } from './utils/listPreset';
|
|
19
21
|
export { MONEY_VIEWER, formatViewerValue, getColumnMoneyViewer, resolveMoneyViewer, viewerSlicesToDisplay, viewerSlicesToRaw } from './utils/viewer';
|
|
20
22
|
export { buildPivotGridColumns, flattenPivotLeafNodes, validatePivotHeaderTree } from './utils/pivotHeaderTree';
|
|
21
23
|
export { buildPivotCellField, toPivotViewModel } from './utils/pivotViewModelAdapter';
|