@dazhicheng/ui 1.6.46 → 1.6.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/dist/components/tt-custom-export-modal/index.d.ts +8 -0
- package/dist/components/tt-custom-export-modal/index.js +21 -0
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.d.ts +37 -0
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue.js +322 -0
- package/dist/components/tt-custom-export-modal/src/TtCustomExportModal.vue2.js +4 -0
- package/dist/components/tt-custom-export-modal/src/api.d.ts +57 -0
- package/dist/components/tt-custom-export-modal/src/api.js +44 -0
- package/dist/components/tt-custom-export-modal/src/assets/search.svg.js +8 -0
- package/dist/components/tt-custom-export-modal/src/assets/star.svg.js +7 -0
- package/dist/components/tt-custom-export-modal/src/assets/trash.svg.js +11 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.d.ts +275 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue.js +7 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldGridSection.vue2.js +321 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue.d.ts +28 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue.js +65 -0
- package/dist/components/tt-custom-export-modal/src/components/FieldToolbarSection.vue2.js +4 -0
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue.d.ts +31 -0
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue.js +152 -0
- package/dist/components/tt-custom-export-modal/src/components/TemplateManagerSection.vue2.js +4 -0
- package/dist/components/tt-custom-export-modal/src/types/index.d.ts +74 -0
- package/dist/components/tt-custom-export-modal/src/types/report.d.ts +129 -0
- package/dist/components/tt-panel-select/src/index.vue.d.ts +2 -0
- package/dist/components/tt-panel-select/src/index.vue.js +53 -49
- package/dist/components/tt-table/index.js +5 -4
- package/dist/components/tt-table/src/TableForm.vue.d.ts +143 -0
- package/dist/components/tt-table/src/TableForm.vue.js +223 -198
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.d.ts +11 -0
- package/dist/components/tt-table/src/components/TableToolbarTools.vue.js +33 -25
- package/dist/components/tt-table/src/hooks/useTableForm.js +13 -12
- package/dist/components/tt-table/src/props.d.ts +5 -0
- package/dist/components/tt-table/src/props.js +4 -0
- package/dist/components/tt-table/src/toolProps.d.ts +5 -0
- package/dist/components/tt-table/src/toolProps.js +5 -0
- package/dist/components/tt-table/src/types/table.d.ts +2 -0
- package/dist/components/tt-table/src/types/tableForm.d.ts +6 -0
- package/dist/components/tt-table/src/types/tableTools.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +102 -99
- package/dist/packages/utils/src/calc.js +26 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { ReportAPI } from '../types';
|
|
2
|
+
/** 左侧展示搜索结果;右侧始终展示完整的已选字段和导出顺序。 */
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** 左侧搜索后的字段;只影响显示,不作为右侧排序的数据源。 */
|
|
5
|
+
filteredFields: ReportAPI.ExportFieldCO[];
|
|
6
|
+
/** 当前业务全部字段数量,不随搜索结果变化。 */
|
|
7
|
+
totalFieldCount: number;
|
|
8
|
+
/** 父组件保存的已选编码,用于快速判断左侧 checkbox 是否勾选。 */
|
|
9
|
+
selectedCodeSet: Set<string>;
|
|
10
|
+
/** 父组件按导出顺序生成的字段对象;右侧列表直接使用此顺序。 */
|
|
11
|
+
selectedFields: ReportAPI.ExportFieldCO[];
|
|
12
|
+
};
|
|
13
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
toggleField: (field: ReportAPI.ExportFieldCO) => any;
|
|
15
|
+
reorder: (codes: string[]) => any;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
onToggleField?: ((field: ReportAPI.ExportFieldCO) => any) | undefined;
|
|
18
|
+
onReorder?: ((codes: string[]) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
20
|
+
optionsScrollbar: ({
|
|
21
|
+
$: import('vue').ComponentInternalInstance;
|
|
22
|
+
$data: {};
|
|
23
|
+
$props: {
|
|
24
|
+
readonly distance?: number | undefined;
|
|
25
|
+
readonly height?: number | string | undefined;
|
|
26
|
+
readonly maxHeight?: number | string | undefined;
|
|
27
|
+
readonly native?: boolean | undefined;
|
|
28
|
+
readonly wrapStyle?: import('vue').StyleValue;
|
|
29
|
+
readonly wrapClass?: import('element-plus/es/utils/typescript.mjs').ClassValue;
|
|
30
|
+
readonly viewClass?: import('element-plus/es/utils/typescript.mjs').ClassValue;
|
|
31
|
+
readonly viewStyle?: import('vue').StyleValue;
|
|
32
|
+
readonly noresize?: boolean | undefined;
|
|
33
|
+
readonly tag?: (keyof HTMLElementTagNameMap | (string & {})) | undefined;
|
|
34
|
+
readonly always?: boolean | undefined;
|
|
35
|
+
readonly minSize?: number | undefined;
|
|
36
|
+
readonly tabindex?: number | string | undefined;
|
|
37
|
+
readonly id?: string | undefined;
|
|
38
|
+
readonly role?: string | undefined;
|
|
39
|
+
readonly ariaLabel?: string | undefined;
|
|
40
|
+
readonly ariaOrientation?: "horizontal" | "vertical" | "undefined" | undefined;
|
|
41
|
+
readonly onScroll?: ((args_0: {
|
|
42
|
+
scrollTop: number;
|
|
43
|
+
scrollLeft: number;
|
|
44
|
+
}) => any) | undefined | undefined;
|
|
45
|
+
readonly "onEnd-reached"?: ((direction: import('element-plus').ScrollbarDirection) => any) | undefined | undefined;
|
|
46
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
47
|
+
$attrs: import('vue').Attrs;
|
|
48
|
+
$refs: {
|
|
49
|
+
[x: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
$slots: Readonly<{
|
|
52
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
55
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
56
|
+
$host: Element | null;
|
|
57
|
+
$emit: ((event: "scroll", args_0: {
|
|
58
|
+
scrollTop: number;
|
|
59
|
+
scrollLeft: number;
|
|
60
|
+
}) => void) & ((event: "end-reached", direction: import('element-plus').ScrollbarDirection) => void);
|
|
61
|
+
$el: any;
|
|
62
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('element-plus').ScrollbarProps> & Readonly<{
|
|
63
|
+
onScroll?: ((args_0: {
|
|
64
|
+
scrollTop: number;
|
|
65
|
+
scrollLeft: number;
|
|
66
|
+
}) => any) | undefined;
|
|
67
|
+
"onEnd-reached"?: ((direction: import('element-plus').ScrollbarDirection) => any) | undefined;
|
|
68
|
+
}>, {
|
|
69
|
+
wrapRef: import('vue').Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
|
|
70
|
+
update: () => void;
|
|
71
|
+
scrollTo: {
|
|
72
|
+
(xCord: number, yCord?: number): void;
|
|
73
|
+
(options: ScrollToOptions): void;
|
|
74
|
+
};
|
|
75
|
+
setScrollTop: (value: number) => void;
|
|
76
|
+
setScrollLeft: (value: number) => void;
|
|
77
|
+
handleScroll: () => void;
|
|
78
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
79
|
+
scroll: (args_0: {
|
|
80
|
+
scrollTop: number;
|
|
81
|
+
scrollLeft: number;
|
|
82
|
+
}) => void;
|
|
83
|
+
"end-reached": (direction: import('element-plus').ScrollbarDirection) => void;
|
|
84
|
+
}, string, {
|
|
85
|
+
tabindex: number | string;
|
|
86
|
+
height: number | string;
|
|
87
|
+
maxHeight: number | string;
|
|
88
|
+
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
89
|
+
distance: number;
|
|
90
|
+
wrapStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
91
|
+
wrapClass: string | false | Record<string, any> | import('element-plus/es/utils/typescript.mjs').ClassValue[] | null;
|
|
92
|
+
viewClass: string | false | Record<string, any> | import('element-plus/es/utils/typescript.mjs').ClassValue[] | null;
|
|
93
|
+
viewStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
94
|
+
minSize: number;
|
|
95
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
96
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
97
|
+
created?: (() => void) | (() => void)[];
|
|
98
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
99
|
+
mounted?: (() => void) | (() => void)[];
|
|
100
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
101
|
+
updated?: (() => void) | (() => void)[];
|
|
102
|
+
activated?: (() => void) | (() => void)[];
|
|
103
|
+
deactivated?: (() => void) | (() => void)[];
|
|
104
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
105
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
106
|
+
destroyed?: (() => void) | (() => void)[];
|
|
107
|
+
unmounted?: (() => void) | (() => void)[];
|
|
108
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
109
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
110
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
111
|
+
};
|
|
112
|
+
$forceUpdate: () => void;
|
|
113
|
+
$nextTick: typeof import('vue').nextTick;
|
|
114
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
115
|
+
} & Readonly<{
|
|
116
|
+
tabindex: number | string;
|
|
117
|
+
height: number | string;
|
|
118
|
+
maxHeight: number | string;
|
|
119
|
+
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
120
|
+
distance: number;
|
|
121
|
+
wrapStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
122
|
+
wrapClass: string | false | Record<string, any> | import('element-plus/es/utils/typescript.mjs').ClassValue[] | null;
|
|
123
|
+
viewClass: string | false | Record<string, any> | import('element-plus/es/utils/typescript.mjs').ClassValue[] | null;
|
|
124
|
+
viewStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
125
|
+
minSize: number;
|
|
126
|
+
}> & Omit<Readonly<import('element-plus').ScrollbarProps> & Readonly<{
|
|
127
|
+
onScroll?: ((args_0: {
|
|
128
|
+
scrollTop: number;
|
|
129
|
+
scrollLeft: number;
|
|
130
|
+
}) => any) | undefined;
|
|
131
|
+
"onEnd-reached"?: ((direction: import('element-plus').ScrollbarDirection) => any) | undefined;
|
|
132
|
+
}>, "height" | "tabindex" | "tag" | "handleScroll" | "maxHeight" | "scrollTo" | "update" | "distance" | "wrapStyle" | "wrapClass" | "viewClass" | "viewStyle" | "minSize" | "wrapRef" | "setScrollTop" | "setScrollLeft"> & {
|
|
133
|
+
wrapRef: HTMLDivElement | undefined;
|
|
134
|
+
update: () => void;
|
|
135
|
+
scrollTo: {
|
|
136
|
+
(xCord: number, yCord?: number): void;
|
|
137
|
+
(options: ScrollToOptions): void;
|
|
138
|
+
};
|
|
139
|
+
setScrollTop: (value: number) => void;
|
|
140
|
+
setScrollLeft: (value: number) => void;
|
|
141
|
+
handleScroll: () => void;
|
|
142
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
143
|
+
$slots: {
|
|
144
|
+
default?: (props: {}) => any;
|
|
145
|
+
};
|
|
146
|
+
}) | null;
|
|
147
|
+
selectedScrollbar: ({
|
|
148
|
+
$: import('vue').ComponentInternalInstance;
|
|
149
|
+
$data: {};
|
|
150
|
+
$props: {
|
|
151
|
+
readonly distance?: number | undefined;
|
|
152
|
+
readonly height?: number | string | undefined;
|
|
153
|
+
readonly maxHeight?: number | string | undefined;
|
|
154
|
+
readonly native?: boolean | undefined;
|
|
155
|
+
readonly wrapStyle?: import('vue').StyleValue;
|
|
156
|
+
readonly wrapClass?: import('element-plus/es/utils/typescript.mjs').ClassValue;
|
|
157
|
+
readonly viewClass?: import('element-plus/es/utils/typescript.mjs').ClassValue;
|
|
158
|
+
readonly viewStyle?: import('vue').StyleValue;
|
|
159
|
+
readonly noresize?: boolean | undefined;
|
|
160
|
+
readonly tag?: (keyof HTMLElementTagNameMap | (string & {})) | undefined;
|
|
161
|
+
readonly always?: boolean | undefined;
|
|
162
|
+
readonly minSize?: number | undefined;
|
|
163
|
+
readonly tabindex?: number | string | undefined;
|
|
164
|
+
readonly id?: string | undefined;
|
|
165
|
+
readonly role?: string | undefined;
|
|
166
|
+
readonly ariaLabel?: string | undefined;
|
|
167
|
+
readonly ariaOrientation?: "horizontal" | "vertical" | "undefined" | undefined;
|
|
168
|
+
readonly onScroll?: ((args_0: {
|
|
169
|
+
scrollTop: number;
|
|
170
|
+
scrollLeft: number;
|
|
171
|
+
}) => any) | undefined | undefined;
|
|
172
|
+
readonly "onEnd-reached"?: ((direction: import('element-plus').ScrollbarDirection) => any) | undefined | undefined;
|
|
173
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
174
|
+
$attrs: import('vue').Attrs;
|
|
175
|
+
$refs: {
|
|
176
|
+
[x: string]: unknown;
|
|
177
|
+
};
|
|
178
|
+
$slots: Readonly<{
|
|
179
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
180
|
+
}>;
|
|
181
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
182
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
183
|
+
$host: Element | null;
|
|
184
|
+
$emit: ((event: "scroll", args_0: {
|
|
185
|
+
scrollTop: number;
|
|
186
|
+
scrollLeft: number;
|
|
187
|
+
}) => void) & ((event: "end-reached", direction: import('element-plus').ScrollbarDirection) => void);
|
|
188
|
+
$el: any;
|
|
189
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('element-plus').ScrollbarProps> & Readonly<{
|
|
190
|
+
onScroll?: ((args_0: {
|
|
191
|
+
scrollTop: number;
|
|
192
|
+
scrollLeft: number;
|
|
193
|
+
}) => any) | undefined;
|
|
194
|
+
"onEnd-reached"?: ((direction: import('element-plus').ScrollbarDirection) => any) | undefined;
|
|
195
|
+
}>, {
|
|
196
|
+
wrapRef: import('vue').Ref<HTMLDivElement | undefined, HTMLDivElement | undefined>;
|
|
197
|
+
update: () => void;
|
|
198
|
+
scrollTo: {
|
|
199
|
+
(xCord: number, yCord?: number): void;
|
|
200
|
+
(options: ScrollToOptions): void;
|
|
201
|
+
};
|
|
202
|
+
setScrollTop: (value: number) => void;
|
|
203
|
+
setScrollLeft: (value: number) => void;
|
|
204
|
+
handleScroll: () => void;
|
|
205
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
206
|
+
scroll: (args_0: {
|
|
207
|
+
scrollTop: number;
|
|
208
|
+
scrollLeft: number;
|
|
209
|
+
}) => void;
|
|
210
|
+
"end-reached": (direction: import('element-plus').ScrollbarDirection) => void;
|
|
211
|
+
}, string, {
|
|
212
|
+
tabindex: number | string;
|
|
213
|
+
height: number | string;
|
|
214
|
+
maxHeight: number | string;
|
|
215
|
+
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
216
|
+
distance: number;
|
|
217
|
+
wrapStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
218
|
+
wrapClass: string | false | Record<string, any> | import('element-plus/es/utils/typescript.mjs').ClassValue[] | null;
|
|
219
|
+
viewClass: string | false | Record<string, any> | import('element-plus/es/utils/typescript.mjs').ClassValue[] | null;
|
|
220
|
+
viewStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
221
|
+
minSize: number;
|
|
222
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
223
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
224
|
+
created?: (() => void) | (() => void)[];
|
|
225
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
226
|
+
mounted?: (() => void) | (() => void)[];
|
|
227
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
228
|
+
updated?: (() => void) | (() => void)[];
|
|
229
|
+
activated?: (() => void) | (() => void)[];
|
|
230
|
+
deactivated?: (() => void) | (() => void)[];
|
|
231
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
232
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
233
|
+
destroyed?: (() => void) | (() => void)[];
|
|
234
|
+
unmounted?: (() => void) | (() => void)[];
|
|
235
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
236
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
237
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
238
|
+
};
|
|
239
|
+
$forceUpdate: () => void;
|
|
240
|
+
$nextTick: typeof import('vue').nextTick;
|
|
241
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
242
|
+
} & Readonly<{
|
|
243
|
+
tabindex: number | string;
|
|
244
|
+
height: number | string;
|
|
245
|
+
maxHeight: number | string;
|
|
246
|
+
tag: keyof HTMLElementTagNameMap | (string & {});
|
|
247
|
+
distance: number;
|
|
248
|
+
wrapStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
249
|
+
wrapClass: string | false | Record<string, any> | import('element-plus/es/utils/typescript.mjs').ClassValue[] | null;
|
|
250
|
+
viewClass: string | false | Record<string, any> | import('element-plus/es/utils/typescript.mjs').ClassValue[] | null;
|
|
251
|
+
viewStyle: string | false | import('vue').CSSProperties | import('vue').StyleValue[] | null;
|
|
252
|
+
minSize: number;
|
|
253
|
+
}> & Omit<Readonly<import('element-plus').ScrollbarProps> & Readonly<{
|
|
254
|
+
onScroll?: ((args_0: {
|
|
255
|
+
scrollTop: number;
|
|
256
|
+
scrollLeft: number;
|
|
257
|
+
}) => any) | undefined;
|
|
258
|
+
"onEnd-reached"?: ((direction: import('element-plus').ScrollbarDirection) => any) | undefined;
|
|
259
|
+
}>, "height" | "tabindex" | "tag" | "handleScroll" | "maxHeight" | "scrollTo" | "update" | "distance" | "wrapStyle" | "wrapClass" | "viewClass" | "viewStyle" | "minSize" | "wrapRef" | "setScrollTop" | "setScrollLeft"> & {
|
|
260
|
+
wrapRef: HTMLDivElement | undefined;
|
|
261
|
+
update: () => void;
|
|
262
|
+
scrollTo: {
|
|
263
|
+
(xCord: number, yCord?: number): void;
|
|
264
|
+
(options: ScrollToOptions): void;
|
|
265
|
+
};
|
|
266
|
+
setScrollTop: (value: number) => void;
|
|
267
|
+
setScrollLeft: (value: number) => void;
|
|
268
|
+
handleScroll: () => void;
|
|
269
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
270
|
+
$slots: {
|
|
271
|
+
default?: (props: {}) => any;
|
|
272
|
+
};
|
|
273
|
+
}) | null;
|
|
274
|
+
}, HTMLDivElement>;
|
|
275
|
+
export default _default;
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { defineComponent as Se, ref as S, computed as m, watch as ee, onBeforeUnmount as xe, createElementBlock as x, openBlock as u, createElementVNode as a, createVNode as r, unref as l, withCtx as c, createTextVNode as k, toDisplayString as _, createBlock as B, createCommentVNode as T, normalizeStyle as te, Fragment as $, renderList as le, normalizeClass as be, withKeys as oe, withModifiers as ie } from "vue";
|
|
2
|
+
import { useMediaQuery as se, useRafFn as Ce, useEventListener as ye } from "@vueuse/core";
|
|
3
|
+
import { ElTag as V, ElScrollbar as ae, ElCheckbox as Ee } from "element-plus";
|
|
4
|
+
import { List as we, Finished as ke, DCaret as Te, Top as Me, Close as Ne } from "@element-plus/icons-vue";
|
|
5
|
+
import _e from "sortablejs";
|
|
6
|
+
import "axios";
|
|
7
|
+
import { isElement as Be, isNullOrUnDef as re } from "../../../../packages/utils/src/is.js";
|
|
8
|
+
import "dayjs";
|
|
9
|
+
import "numeral";
|
|
10
|
+
import "xe-utils";
|
|
11
|
+
import "dayjs/plugin/utc";
|
|
12
|
+
import "dayjs/plugin/timezone";
|
|
13
|
+
import { subtract as f, add as s, multiply as b, divide as K } from "../../../../packages/utils/src/calc.js";
|
|
14
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/aes.js";
|
|
15
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/enc-utf8.js";
|
|
16
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/mode-ecb.js";
|
|
17
|
+
import "../../../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/pad-pkcs7.js";
|
|
18
|
+
import "lodash-es";
|
|
19
|
+
import { TtButton as L } from "../../../tt-button/index.js";
|
|
20
|
+
import { TtEmpty as de } from "../../../tt-empty/index.js";
|
|
21
|
+
import { TtText as ne } from "../../../tt-text/index.js";
|
|
22
|
+
const Re = { class: "ExportFields" }, De = {
|
|
23
|
+
class: "ExportFields-panel",
|
|
24
|
+
"aria-label": "全部字段"
|
|
25
|
+
}, ze = { class: "ExportFields-header" }, Ie = { class: "ExportFields-heading" }, qe = {
|
|
26
|
+
class: "ExportFields-panel ExportFields-picked",
|
|
27
|
+
"aria-label": "导出顺序"
|
|
28
|
+
}, $e = { class: "ExportFields-header" }, Ve = { class: "ExportFields-heading" }, Ke = ["data-field-code"], Le = { class: "ExportFields-number" }, Oe = { class: "ExportFields-actions" }, ce = 54, ue = 11, O = 40, R = 13, nt = /* @__PURE__ */ Se({
|
|
29
|
+
name: "FieldGridSection",
|
|
30
|
+
__name: "FieldGridSection",
|
|
31
|
+
props: {
|
|
32
|
+
filteredFields: {},
|
|
33
|
+
totalFieldCount: {},
|
|
34
|
+
selectedCodeSet: {},
|
|
35
|
+
selectedFields: {}
|
|
36
|
+
},
|
|
37
|
+
emits: ["toggleField", "reorder"],
|
|
38
|
+
setup(v, { emit: pe }) {
|
|
39
|
+
const d = v, D = pe;
|
|
40
|
+
let p, M;
|
|
41
|
+
const U = S(), z = S(), I = S(0), C = S(0), F = S(!1), G = S(), h = { x: 0, y: 0 }, me = se("(max-width: 1000px)"), fe = se("(max-width: 420px)"), { pause: W, resume: ve } = Ce(
|
|
42
|
+
({ delta: i }) => {
|
|
43
|
+
var w;
|
|
44
|
+
const t = (w = z.value) == null ? void 0 : w.wrapRef;
|
|
45
|
+
if (!t) return;
|
|
46
|
+
const e = t.getBoundingClientRect();
|
|
47
|
+
if (h.x < e.left || h.x > e.right) return;
|
|
48
|
+
const o = f(h.y, e.top), E = f(e.bottom, h.y), g = Math.abs(o) < 80 ? -1 : Math.abs(E) < 80 ? 1 : 0;
|
|
49
|
+
g && (t.scrollTop = s(t.scrollTop, b(g, Math.min(i, 32), 0.75)));
|
|
50
|
+
},
|
|
51
|
+
{ immediate: !1 }
|
|
52
|
+
);
|
|
53
|
+
ye("pointermove", (i) => {
|
|
54
|
+
h.x = i.clientX, h.y = i.clientY;
|
|
55
|
+
});
|
|
56
|
+
const y = m(() => fe.value ? 1 : me.value ? 2 : 3), P = m(() => Math.ceil(K(d.filteredFields.length, y.value))), Q = m(() => A(I.value, P.value)), X = m(() => b(Q.value, y.value)), Y = m(
|
|
57
|
+
() => d.filteredFields.slice(X.value, s(X.value, b(ue, y.value)))
|
|
58
|
+
), q = m(
|
|
59
|
+
() => A(C.value, d.selectedFields.length, O, R)
|
|
60
|
+
), n = m(() => F.value ? 0 : q.value), j = m(
|
|
61
|
+
() => F.value ? d.selectedFields : d.selectedFields.slice(n.value, s(n.value, R))
|
|
62
|
+
);
|
|
63
|
+
function A(i, t, e = ce, o = ue) {
|
|
64
|
+
return Math.max(0, Math.min(f(Math.floor(K(i, e)), 2), f(t, o)));
|
|
65
|
+
}
|
|
66
|
+
function H(i, t, e, o = ce) {
|
|
67
|
+
return {
|
|
68
|
+
paddingTop: `${s(10, b(i, o))}px`,
|
|
69
|
+
paddingBottom: `${s(10, b(Math.max(0, f(e, s(i, t))), o))}px`
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function N(i, t) {
|
|
73
|
+
if (i === t || t < 0 || t >= d.selectedFields.length) return;
|
|
74
|
+
const e = d.selectedFields.map((o) => o.fieldCode).filter((o) => !!o);
|
|
75
|
+
e.splice(t, 0, ...e.splice(i, 1)), D("reorder", e);
|
|
76
|
+
}
|
|
77
|
+
function J(i) {
|
|
78
|
+
i !== M && (p == null || p.destroy(), p = void 0, M = void 0, Be(i) && (M = i, p = _e.create(M, {
|
|
79
|
+
animation: 180,
|
|
80
|
+
// 只允许从手柄发起拖动,点击置顶、移除或选中文本不会误触拖拽。
|
|
81
|
+
handle: ".ExportFields-drag",
|
|
82
|
+
draggable: ".ExportFields-selected-row",
|
|
83
|
+
ghostClass: "ExportFields-ghost",
|
|
84
|
+
// 使用指针拖拽,避免浏览器原生滚动与动画帧滚动同时生效。
|
|
85
|
+
forceFallback: !0,
|
|
86
|
+
fallbackOnBody: !0,
|
|
87
|
+
scroll: !1,
|
|
88
|
+
onChoose(t) {
|
|
89
|
+
p == null || p.option("animation", d.selectedFields.length > R ? 0 : 180), G.value = t.item.dataset.fieldCode, F.value = !0;
|
|
90
|
+
},
|
|
91
|
+
onStart() {
|
|
92
|
+
ve();
|
|
93
|
+
},
|
|
94
|
+
onUnchoose() {
|
|
95
|
+
W(), F.value = !1;
|
|
96
|
+
},
|
|
97
|
+
onEnd(t) {
|
|
98
|
+
W();
|
|
99
|
+
const { oldIndex: e, newIndex: o, item: E, from: g } = t;
|
|
100
|
+
if (F.value = !1, re(e) || re(o)) return;
|
|
101
|
+
const w = d.selectedFields.findIndex((he) => he.fieldCode === E.dataset.fieldCode), Z = g.children.length === d.selectedFields.length ? 0 : n.value, ge = s(Z, o);
|
|
102
|
+
g.removeChild(E);
|
|
103
|
+
const Fe = f(w, Z);
|
|
104
|
+
g.insertBefore(E, g.children[Fe] ?? null), N(w, ge);
|
|
105
|
+
}
|
|
106
|
+
})));
|
|
107
|
+
}
|
|
108
|
+
return ee([() => d.filteredFields, y], () => {
|
|
109
|
+
var i;
|
|
110
|
+
I.value = 0, (i = U.value) == null || i.setScrollTop(0);
|
|
111
|
+
}), ee(
|
|
112
|
+
() => d.selectedFields.length,
|
|
113
|
+
() => {
|
|
114
|
+
var t;
|
|
115
|
+
const i = Math.max(0, f(s(20, b(d.selectedFields.length, O)), 340));
|
|
116
|
+
C.value = Math.min(C.value, i), (t = z.value) == null || t.setScrollTop(C.value);
|
|
117
|
+
}
|
|
118
|
+
), xe(() => {
|
|
119
|
+
J(null);
|
|
120
|
+
}), (i, t) => (u(), x("div", Re, [
|
|
121
|
+
a("section", De, [
|
|
122
|
+
a("header", ze, [
|
|
123
|
+
a("div", Ie, [
|
|
124
|
+
r(l(we)),
|
|
125
|
+
t[2] || (t[2] = a("strong", null, "全部字段", -1)),
|
|
126
|
+
r(l(V), {
|
|
127
|
+
size: "small",
|
|
128
|
+
type: "info",
|
|
129
|
+
round: ""
|
|
130
|
+
}, {
|
|
131
|
+
default: c(() => [
|
|
132
|
+
k(_(v.totalFieldCount), 1)
|
|
133
|
+
]),
|
|
134
|
+
_: 1
|
|
135
|
+
})
|
|
136
|
+
]),
|
|
137
|
+
t[3] || (t[3] = a("span", null, "勾选添加到导出列表", -1))
|
|
138
|
+
]),
|
|
139
|
+
r(l(ae), {
|
|
140
|
+
ref_key: "optionsScrollbar",
|
|
141
|
+
ref: U,
|
|
142
|
+
height: "340px",
|
|
143
|
+
onScroll: t[0] || (t[0] = ({ scrollTop: e }) => {
|
|
144
|
+
I.value = e;
|
|
145
|
+
})
|
|
146
|
+
}, {
|
|
147
|
+
default: c(() => [
|
|
148
|
+
a("div", {
|
|
149
|
+
class: "ExportFields-options",
|
|
150
|
+
style: te(
|
|
151
|
+
H(Q.value, Math.ceil(l(K)(Y.value.length, y.value)), P.value)
|
|
152
|
+
)
|
|
153
|
+
}, [
|
|
154
|
+
(u(!0), x($, null, le(Y.value, (e) => (u(), x("div", {
|
|
155
|
+
key: e.fieldCode,
|
|
156
|
+
class: be(["ExportFields-option", { "is-selected": v.selectedCodeSet.has(e.fieldCode || "") }])
|
|
157
|
+
}, [
|
|
158
|
+
r(l(Ee), {
|
|
159
|
+
"model-value": v.selectedCodeSet.has(e.fieldCode || ""),
|
|
160
|
+
disabled: e.requiredSelected,
|
|
161
|
+
"aria-label": e.fieldName,
|
|
162
|
+
onChange: () => {
|
|
163
|
+
D("toggleField", e);
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
default: c(() => [
|
|
167
|
+
r(l(ne), {
|
|
168
|
+
class: "ExportFields-name",
|
|
169
|
+
"tool-tip-line": 2
|
|
170
|
+
}, {
|
|
171
|
+
default: c(() => [
|
|
172
|
+
k(_(e.fieldName), 1)
|
|
173
|
+
]),
|
|
174
|
+
_: 2
|
|
175
|
+
}, 1024)
|
|
176
|
+
]),
|
|
177
|
+
_: 2
|
|
178
|
+
}, 1032, ["model-value", "disabled", "aria-label", "onChange"]),
|
|
179
|
+
e.requiredSelected ? (u(), B(l(V), {
|
|
180
|
+
key: 0,
|
|
181
|
+
type: "info",
|
|
182
|
+
size: "small",
|
|
183
|
+
effect: "plain"
|
|
184
|
+
}, {
|
|
185
|
+
default: c(() => [...t[4] || (t[4] = [
|
|
186
|
+
k("必选", -1)
|
|
187
|
+
])]),
|
|
188
|
+
_: 1
|
|
189
|
+
})) : T("", !0)
|
|
190
|
+
], 2))), 128))
|
|
191
|
+
], 4),
|
|
192
|
+
v.filteredFields.length ? T("", !0) : (u(), B(l(de), {
|
|
193
|
+
key: 0,
|
|
194
|
+
description: "未找到匹配的字段",
|
|
195
|
+
"image-size": 64
|
|
196
|
+
}))
|
|
197
|
+
]),
|
|
198
|
+
_: 1
|
|
199
|
+
}, 512)
|
|
200
|
+
]),
|
|
201
|
+
a("section", qe, [
|
|
202
|
+
a("header", $e, [
|
|
203
|
+
a("div", Ve, [
|
|
204
|
+
r(l(ke)),
|
|
205
|
+
t[5] || (t[5] = a("strong", null, "导出顺序", -1))
|
|
206
|
+
]),
|
|
207
|
+
t[6] || (t[6] = a("span", null, "拖拽调整列顺序", -1))
|
|
208
|
+
]),
|
|
209
|
+
r(l(ae), {
|
|
210
|
+
ref_key: "selectedScrollbar",
|
|
211
|
+
ref: z,
|
|
212
|
+
height: "340px",
|
|
213
|
+
onScroll: t[1] || (t[1] = ({ scrollTop: e }) => {
|
|
214
|
+
C.value = e;
|
|
215
|
+
})
|
|
216
|
+
}, {
|
|
217
|
+
default: c(() => [
|
|
218
|
+
a("ol", {
|
|
219
|
+
ref: J,
|
|
220
|
+
class: "ExportFields-selected-list",
|
|
221
|
+
"aria-label": "导出字段顺序",
|
|
222
|
+
style: te(H(n.value, j.value.length, v.selectedFields.length, O))
|
|
223
|
+
}, [
|
|
224
|
+
(u(!0), x($, null, le(j.value, (e, o) => (u(), x("li", {
|
|
225
|
+
key: e.fieldCode,
|
|
226
|
+
class: "ExportFields-selected-row",
|
|
227
|
+
"data-field-code": e.fieldCode
|
|
228
|
+
}, [
|
|
229
|
+
!F.value || e.fieldCode === G.value || o >= q.value && o < l(s)(q.value, R) ? (u(), x($, { key: 0 }, [
|
|
230
|
+
r(l(L), {
|
|
231
|
+
text: "",
|
|
232
|
+
class: "ExportFields-drag",
|
|
233
|
+
title: "拖拽排序,也可使用上下方向键",
|
|
234
|
+
"aria-label": `移动${e.fieldName},使用上下方向键排序`,
|
|
235
|
+
onKeydown: [
|
|
236
|
+
oe(ie(
|
|
237
|
+
() => {
|
|
238
|
+
N(l(s)(n.value, o), l(f)(l(s)(n.value, o), 1));
|
|
239
|
+
},
|
|
240
|
+
["prevent"]
|
|
241
|
+
), ["up"]),
|
|
242
|
+
oe(ie(
|
|
243
|
+
() => {
|
|
244
|
+
N(l(s)(n.value, o), l(s)(n.value, o, 1));
|
|
245
|
+
},
|
|
246
|
+
["prevent"]
|
|
247
|
+
), ["down"])
|
|
248
|
+
]
|
|
249
|
+
}, {
|
|
250
|
+
default: c(() => [
|
|
251
|
+
r(l(Te))
|
|
252
|
+
]),
|
|
253
|
+
_: 1
|
|
254
|
+
}, 8, ["aria-label", "onKeydown"]),
|
|
255
|
+
a("span", Le, _(l(s)(n.value, o, 1)), 1),
|
|
256
|
+
r(l(ne), { class: "ExportFields-name" }, {
|
|
257
|
+
default: c(() => [
|
|
258
|
+
k(_(e.fieldName), 1)
|
|
259
|
+
]),
|
|
260
|
+
_: 2
|
|
261
|
+
}, 1024),
|
|
262
|
+
e.requiredSelected ? (u(), B(l(V), {
|
|
263
|
+
key: 0,
|
|
264
|
+
type: "info",
|
|
265
|
+
size: "small",
|
|
266
|
+
effect: "plain"
|
|
267
|
+
}, {
|
|
268
|
+
default: c(() => [...t[7] || (t[7] = [
|
|
269
|
+
k("必选", -1)
|
|
270
|
+
])]),
|
|
271
|
+
_: 1
|
|
272
|
+
})) : T("", !0),
|
|
273
|
+
a("div", Oe, [
|
|
274
|
+
r(l(L), {
|
|
275
|
+
text: "",
|
|
276
|
+
type: "primary",
|
|
277
|
+
disabled: l(s)(n.value, o) === 0,
|
|
278
|
+
title: l(s)(n.value, o) === 0 ? "已在顶部" : "置顶",
|
|
279
|
+
"aria-label": `置顶${e.fieldName}`,
|
|
280
|
+
onClick: () => {
|
|
281
|
+
N(l(s)(n.value, o), 0);
|
|
282
|
+
}
|
|
283
|
+
}, {
|
|
284
|
+
default: c(() => [
|
|
285
|
+
r(l(Me))
|
|
286
|
+
]),
|
|
287
|
+
_: 1
|
|
288
|
+
}, 8, ["disabled", "title", "aria-label", "onClick"]),
|
|
289
|
+
r(l(L), {
|
|
290
|
+
text: "",
|
|
291
|
+
disabled: e.requiredSelected,
|
|
292
|
+
"aria-label": `移除${e.fieldName}`,
|
|
293
|
+
title: e.requiredSelected ? "必选字段不可移除" : "移除",
|
|
294
|
+
onClick: () => {
|
|
295
|
+
D("toggleField", e);
|
|
296
|
+
}
|
|
297
|
+
}, {
|
|
298
|
+
default: c(() => [
|
|
299
|
+
r(l(Ne))
|
|
300
|
+
]),
|
|
301
|
+
_: 1
|
|
302
|
+
}, 8, ["disabled", "aria-label", "title", "onClick"])
|
|
303
|
+
])
|
|
304
|
+
], 64)) : T("", !0)
|
|
305
|
+
], 8, Ke))), 128))
|
|
306
|
+
], 4),
|
|
307
|
+
v.selectedFields.length ? T("", !0) : (u(), B(l(de), {
|
|
308
|
+
key: 0,
|
|
309
|
+
description: "从左侧勾选需要导出的字段",
|
|
310
|
+
"image-size": 64
|
|
311
|
+
}))
|
|
312
|
+
]),
|
|
313
|
+
_: 1
|
|
314
|
+
}, 512)
|
|
315
|
+
])
|
|
316
|
+
]));
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
export {
|
|
320
|
+
nt as default
|
|
321
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 父组件计算批量按钮状态;本组件不持有字段数组,也不直接修改勾选。
|
|
3
|
+
*/
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/** 当前搜索结果是否全部选中,决定全选按钮显示的操作文案。 */
|
|
6
|
+
isAllSelected?: boolean;
|
|
7
|
+
/** 业务页面提供了非空 listColumns 时,才展示“按列表字段勾选”。 */
|
|
8
|
+
hasListColumns?: boolean;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = {
|
|
11
|
+
"keyword"?: string;
|
|
12
|
+
} & __VLS_Props;
|
|
13
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
"update:keyword": (value: string) => any;
|
|
15
|
+
} & {
|
|
16
|
+
clearAll: () => any;
|
|
17
|
+
toggleSelectAll: () => any;
|
|
18
|
+
selectByListColumns: () => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
onClearAll?: (() => any) | undefined;
|
|
21
|
+
"onUpdate:keyword"?: ((value: string) => any) | undefined;
|
|
22
|
+
onToggleSelectAll?: (() => any) | undefined;
|
|
23
|
+
onSelectByListColumns?: (() => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
isAllSelected: boolean;
|
|
26
|
+
hasListColumns: boolean;
|
|
27
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
28
|
+
export default _default;
|