@gx-design-vue/pro-table 0.2.0-beta.14 → 0.2.0-beta.141

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.
Files changed (59) hide show
  1. package/dist/ProTable.d.ts +293 -823
  2. package/dist/_utils/ant-design-vue/index.d.ts +4 -2
  3. package/dist/_utils/ant-design-vue/input/typings.d.ts +1 -0
  4. package/dist/_utils/ant-design-vue/table/props.d.ts +37 -2
  5. package/dist/_utils/ant-design-vue/table/typings.d.ts +6 -5
  6. package/dist/_utils/ant-design-vue/tooltip/typings.d.ts +1 -0
  7. package/dist/_utils/index.d.ts +1 -1
  8. package/dist/components/Form/components/RequestSelect.d.ts +39 -0
  9. package/dist/components/Form/{useForm.d.ts → hooks/useForm.d.ts} +2 -2
  10. package/dist/components/Form/index.d.ts +19 -28
  11. package/dist/components/Form/style.d.ts +1 -1
  12. package/dist/components/Form/utils/config.d.ts +5 -0
  13. package/dist/components/Form/utils/dateFormat.d.ts +20 -0
  14. package/dist/components/ListToolBar/index.d.ts +32 -39
  15. package/dist/components/ListToolBar/style.d.ts +1 -1
  16. package/dist/components/ScrollBar/Bar/index.d.ts +44 -0
  17. package/dist/components/ScrollBar/Bar/props.d.ts +21 -0
  18. package/dist/components/ScrollBar/Thumb/index.d.ts +35 -0
  19. package/dist/components/ScrollBar/Thumb/props.d.ts +16 -0
  20. package/dist/components/ScrollBar/context.d.ts +11 -0
  21. package/dist/components/ScrollBar/util.d.ts +29 -0
  22. package/dist/components/ToolBar/FullscreenIcon.d.ts +1 -1
  23. package/dist/components/ToolBar/index.d.ts +24 -25
  24. package/dist/context/TableContext.d.ts +19 -17
  25. package/dist/hooks/tryOnActivated.d.ts +2 -0
  26. package/dist/hooks/useColumns.d.ts +18 -0
  27. package/dist/hooks/useDebounceFn.d.ts +2 -2
  28. package/dist/hooks/useFetchData.d.ts +24 -17
  29. package/dist/hooks/useLoading.d.ts +5 -8
  30. package/dist/hooks/usePagination.d.ts +7 -6
  31. package/dist/hooks/useRowSelection.d.ts +11 -8
  32. package/dist/hooks/useScrollArea.d.ts +15 -0
  33. package/dist/hooks/useTable.d.ts +57 -11
  34. package/dist/hooks/useTableForm.d.ts +72 -10
  35. package/dist/hooks/useTableScroll.d.ts +14 -20
  36. package/dist/hooks/useTableSize.d.ts +4 -7
  37. package/dist/index.d.ts +8 -7
  38. package/dist/pro-table.js +2739 -0
  39. package/dist/pro-table.umd.cjs +12 -0
  40. package/dist/props.d.ts +129 -390
  41. package/dist/{components/ColumnSetting/style.d.ts → style/fit-page.d.ts} +2 -2
  42. package/dist/style/index.d.ts +6 -0
  43. package/dist/{style.d.ts → style/list.d.ts} +2 -2
  44. package/dist/style/scroll.d.ts +3 -0
  45. package/dist/types/ColumnTypings.d.ts +54 -16
  46. package/dist/types/SlotsTypings.d.ts +47 -9
  47. package/dist/types/TableTypings.d.ts +171 -80
  48. package/dist/utils/utils.d.ts +5 -1
  49. package/package.json +33 -52
  50. package/volar.d.ts +3 -3
  51. package/dist/components/ColumnSetting/hooks/useRefFunction/index.d.ts +0 -1
  52. package/dist/components/ColumnSetting/index.d.ts +0 -35
  53. package/dist/components/ToolBar/DensityIcon.d.ts +0 -3
  54. package/dist/hooks/useColumnSetting.d.ts +0 -31
  55. package/dist/hooks/useColums.d.ts +0 -24
  56. package/dist/pro-table.mjs +0 -34948
  57. package/dist/pro-table.umd.js +0 -327
  58. package/dist/typing.d.ts +0 -1
  59. package/dist/utils/config.d.ts +0 -1
@@ -0,0 +1,2739 @@
1
+ /*!
2
+ * Gx Design Pro
3
+ * Version: 0.2.0-beta.140
4
+ * Author: gx12358
5
+ * Copyright (C) 2024 gx12358
6
+ * License: MIT License
7
+ * Description: Gx Design Pro Table
8
+ * Date Created: 2025-12-14
9
+ * Homepage:
10
+ * Contact: gx12358@gmail.com
11
+ */
12
+ import { defineComponent as ge, ref as w, watch as q, cloneVNode as lt, reactive as at, toRaw as ce, computed as T, createVNode as d, Fragment as we, isVNode as le, mergeProps as Q, h as pt, onBeforeUnmount as Qt, onMounted as nt, nextTick as ot, watchEffect as yt, unref as R, onActivated as Ct, getCurrentInstance as Ut, onUnmounted as St, onDeactivated as xt, onUpdated as Jt, toRef as V, Teleport as Zt, isRef as Ge } from "vue";
13
+ import { UpOutlined as el, DownOutlined as tl, InfoCircleOutlined as ll, FullscreenExitOutlined as al, FullscreenOutlined as nl, ReloadOutlined as ol, CopyOutlined as il } from "@ant-design/icons-vue";
14
+ import { useProAppContext as Tt } from "@gx-design-vue/pro-app";
15
+ import { useBreakpoint as it, useMemo as Ne, tryOnUnmounted as rl, onMountedOrActivated as sl } from "@gx-design-vue/pro-hooks";
16
+ import { useProStyle as rt, unit as pe, useProConfigContext as ul } from "@gx-design-vue/pro-provider";
17
+ import { isArray as J, cloneDeep as ae, isObject as ne, isBoolean as De, classNames as D, isNumber as Ce, filterEmpty as wt, getPrefixCls as $t, keysOf as Rt, isDeepEqualReact as qe, compareArray as cl, runFunction as dl, getSortIndex as fl, isFunction as Me, handleCurrentPage as vl, getRandomNumber as Pt, deepMerge as ye, forInObject as ml, arrayRepeat as hl, isString as Ft, handleShowIndex as gl, getSlot as vt, convertValueBoolean as Qe, getSlotsProps as bl, handleEmptyField as pl, getTextWidth as yl, getSlotVNode as Cl, useDeepMerge as Sl } from "@gx-design-vue/pro-utils";
18
+ import { useDebounceFn as xl, useEventListener as mt, isClient as Tl, useElementBounding as wl, useFullscreen as It, useElementSize as He, useScroll as $l, useResizeObserver as Rl, useWindowSize as Pl } from "@vueuse/core";
19
+ import { DatePicker as At, Input as We, TimePicker as Fl, TreeSelect as Il, Select as Al, InputNumber as Ue, Button as ht, Spin as Bt, Tooltip as $e, Empty as Nt, theme as Bl, Pagination as Nl, Table as zl, message as Dl } from "ant-design-vue";
20
+ import { omit as ze, cloneDeep as zt, pick as Ol } from "lodash-es";
21
+ import { tableProps as El } from "ant-design-vue/es/table/Table";
22
+ import "ant-design-vue/es/_util/props-util";
23
+ import { warning as Ll } from "ant-design-vue/es/vc-util/warning";
24
+ import Z from "dayjs";
25
+ import { useContext as Dt } from "@gx-design-vue/context";
26
+ import { TinyColor as gt } from "@ctrl/tinycolor";
27
+ const jl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered", "loading"], Ot = {
28
+ ...ze(El(), jl),
29
+ direction: {
30
+ type: String,
31
+ default: "ltr"
32
+ },
33
+ transformCellText: Function,
34
+ /**
35
+ * @Author gx12358
36
+ * @DateTime 2022/2/8
37
+ * @lastTime 2022/2/8
38
+ * @description 是否展示外边框和列边框
39
+ */
40
+ bordered: {
41
+ type: Boolean,
42
+ default: void 0
43
+ },
44
+ loading: {
45
+ type: [Boolean, Object],
46
+ default: void 0
47
+ },
48
+ scroll: {
49
+ type: Object,
50
+ default: void 0
51
+ }
52
+ }, { provideContext: Hl, useInjectContext: Ke } = Dt("pro-table"), he = {
53
+ ...Ot,
54
+ id: {
55
+ type: String,
56
+ default: ""
57
+ },
58
+ class: {
59
+ type: String,
60
+ default: ""
61
+ },
62
+ style: {
63
+ type: Object,
64
+ default: () => ({})
65
+ },
66
+ classNames: {
67
+ type: Object,
68
+ default: () => ({})
69
+ },
70
+ styles: {
71
+ type: Object,
72
+ default: () => ({})
73
+ },
74
+ fitPage: {
75
+ type: Boolean,
76
+ default: !1
77
+ },
78
+ rowSelection: {
79
+ type: Object,
80
+ default: void 0
81
+ },
82
+ columns: { type: Array, default: () => [] },
83
+ pagination: { type: [Object, Boolean], default: () => {
84
+ } },
85
+ rowKey: { type: String, default: "id" },
86
+ /**
87
+ * @Author gx12358
88
+ * @DateTime 2022/2/8
89
+ * @lastTime 2022/2/8
90
+ * @description 获取 dataSource 的方法
91
+ */
92
+ request: {
93
+ type: Function,
94
+ default: void 0
95
+ },
96
+ /**
97
+ * @Author gx12358
98
+ * @DateTime 2025/12/11
99
+ * @lastTime 2025/12/11
100
+ * @description 关闭参数变化后自动请求
101
+ */
102
+ autoRequest: {
103
+ type: Boolean,
104
+ default: !0
105
+ },
106
+ // 是否启用虚拟滚动
107
+ virtualScroll: Boolean,
108
+ // 用于 request 查询的额外参数,一旦变化会触发重新加载
109
+ params: {
110
+ type: Object,
111
+ default: () => ({})
112
+ },
113
+ // 等待请求时间设置
114
+ waitRequest: {
115
+ type: Boolean,
116
+ default: !1
117
+ },
118
+ // 轮训时间间隔设置
119
+ polling: Number,
120
+ // 防抖时间设置
121
+ debounceTime: {
122
+ type: Number,
123
+ default: 10
124
+ },
125
+ /**
126
+ * @Author gx12358
127
+ * @DateTime 2022/2/8
128
+ * @lastTime 2022/2/8
129
+ * @description 是否显示搜索表单,传入对象时为搜索表单的配置
130
+ */
131
+ form: {
132
+ type: [Object, Boolean]
133
+ },
134
+ searchMap: {
135
+ type: Array,
136
+ default: () => []
137
+ },
138
+ /**
139
+ * @Author gx12358
140
+ * @DateTime 2022/2/8
141
+ * @lastTime 2022/2/8
142
+ * @description 自定义表格渲染模式:默认表格展示,也可以自定义数据列表展示
143
+ */
144
+ customRender: {
145
+ type: [Function, Object, Boolean, Array],
146
+ default: () => {
147
+ }
148
+ },
149
+ emptyText: {
150
+ type: [Function, Object, Boolean, Array],
151
+ default: () => {
152
+ }
153
+ },
154
+ showLoading: {
155
+ type: Boolean,
156
+ default: !0
157
+ },
158
+ emptyTextProps: {
159
+ type: Object,
160
+ default: () => ({
161
+ style: {}
162
+ })
163
+ },
164
+ actionProps: {
165
+ type: Object,
166
+ default: () => ({
167
+ placement: "right"
168
+ })
169
+ },
170
+ /** @name listToolAfter 表格工具栏下方的内容 */
171
+ listToolAfter: {
172
+ type: [Object, Function, Boolean, String, Array],
173
+ default: () => {
174
+ }
175
+ },
176
+ /** @name headerTitle 表格标题,可自定义 */
177
+ headerTitle: {
178
+ type: [Object, Function, Boolean, String, Array],
179
+ default: () => {
180
+ }
181
+ },
182
+ /** @name headerTitleTip 标题提示的Icon,可自定义 */
183
+ headerTitleTip: {
184
+ type: [Object, Function, Boolean, String, Array],
185
+ default: () => {
186
+ }
187
+ },
188
+ /** @name titleTipText 标题提示词 */
189
+ titleTipText: {
190
+ type: String
191
+ },
192
+ /** @name options table 工具栏(reload:重新请求按钮;fullScreen:全屏按钮),设为 false 时不显示 */
193
+ options: {
194
+ type: [Object, Boolean],
195
+ default: !1
196
+ },
197
+ /** @name keepAliveReload 针对 keepalive 缓存的页面,重新进入是否请求 */
198
+ keepAliveReload: {
199
+ type: Boolean,
200
+ default: !1
201
+ },
202
+ /**
203
+ * @Author gx12358
204
+ * @DateTime 2022/2/8
205
+ * @lastTime 2022/2/8
206
+ * @description 是否展示序号栏
207
+ */
208
+ showIndex: {
209
+ type: Boolean,
210
+ default: !1
211
+ },
212
+ /**
213
+ * @Author gx12358
214
+ * @DateTime 2024/11/15
215
+ * @lastTime 2024/11/15
216
+ * @description 是否已card分割
217
+ */
218
+ cardBordered: {
219
+ type: Boolean,
220
+ default: !1
221
+ },
222
+ /**
223
+ * @Author gx12358
224
+ * @DateTime 2022/2/8
225
+ * @lastTime 2022/2/8
226
+ * @description 翻页item设置
227
+ */
228
+ pageItemRender: {
229
+ type: [Function, Object, Array],
230
+ default: () => {
231
+ }
232
+ },
233
+ /**
234
+ * @Author gx12358
235
+ * @DateTime 2022/2/8
236
+ * @lastTime 2022/2/8
237
+ * @description 表格大小
238
+ */
239
+ size: {
240
+ type: String,
241
+ default: "middle"
242
+ },
243
+ /**
244
+ * @Author gx12358
245
+ * @DateTime 2022/2/8
246
+ * @lastTime 2022/2/8
247
+ * @description 表格全局对齐方式
248
+ */
249
+ align: {
250
+ type: String,
251
+ default: "left"
252
+ },
253
+ /**
254
+ * @Author gx12358
255
+ * @DateTime 2022/2/8
256
+ * @lastTime 2022/2/8
257
+ * @description 是否列拖动
258
+ */
259
+ draggable: Boolean,
260
+ /**
261
+ * @Author gx12358
262
+ * @DateTime 2022/2/8
263
+ * @lastTime 2022/2/8
264
+ * @description 根据屏幕大小或者scrollBreakpoint或者scroll?.x是否存在判断action列是否固定
265
+ */
266
+ autoScroll: {
267
+ type: Boolean,
268
+ default: !0
269
+ },
270
+ /**
271
+ * @Author gx12358
272
+ * @DateTime 2022/2/8
273
+ * @lastTime 2022/2/8
274
+ * @description 滚动断点支持数字(屏幕宽度);也支持md、xl,xxl等
275
+ */
276
+ scrollBreakpoint: [String, Number],
277
+ /**
278
+ * @Author gx12358
279
+ * @DateTime 2022/2/8
280
+ * @lastTime 2022/2/8
281
+ * @description modalTable时,自动固定滚动高度
282
+ */
283
+ modalScroll: Boolean,
284
+ /**
285
+ * @Author gx12358
286
+ * @DateTime 2022/2/8
287
+ * @lastTime 2022/2/8
288
+ * @description 从不滚动
289
+ */
290
+ neverScroll: Boolean,
291
+ /**
292
+ * @Author gx12358
293
+ * @DateTime 2022/2/8
294
+ * @lastTime 2022/2/8
295
+ * @description 空值时的显示,不设置时显示 -, false 可以关闭此功能
296
+ */
297
+ columnEmptyText: {
298
+ type: [String, Boolean],
299
+ default: !1
300
+ },
301
+ /**
302
+ * @Author gx12358
303
+ * @DateTime 2022/2/8
304
+ * @lastTime 2022/2/8
305
+ * @description Pro-Table 的方法
306
+ */
307
+ // 对通过 request 获取的数据进行处理
308
+ postData: Function,
309
+ onReset: Function,
310
+ onReload: Function,
311
+ onSubmit: Function,
312
+ onSizeChange: Function,
313
+ onLoadingChange: Function,
314
+ onRequestError: Function,
315
+ onBeforeSearchSubmit: Function
316
+ }, Wl = /* @__PURE__ */ ge({
317
+ name: "RequestSelect",
318
+ props: {
319
+ fetch: Function,
320
+ loading: Boolean,
321
+ debounceTime: Number,
322
+ manual: {
323
+ type: Boolean,
324
+ default: void 0
325
+ },
326
+ fieldName: {
327
+ type: String,
328
+ default: "options"
329
+ },
330
+ notFoundContent: {
331
+ type: Function
332
+ }
333
+ },
334
+ setup(e, {
335
+ slots: a
336
+ }) {
337
+ const l = w([]), n = w(e.loading ?? !1), o = w("init"), s = xl(e.fetch, e.debounceTime || 10);
338
+ return q([() => e.fetch, () => e.manual], () => {
339
+ if (o.value !== "init" && n.value) return;
340
+ const u = e.manual ?? !1;
341
+ e.fetch && !u && (n.value = !0, s().then((b) => {
342
+ l.value = zt(b), o.value = "success";
343
+ }).catch((b) => {
344
+ console.error(b), o.value = "error";
345
+ }).finally(() => {
346
+ n.value = !1;
347
+ }));
348
+ }, {
349
+ immediate: !0
350
+ }), () => {
351
+ const u = a.default?.();
352
+ return lt(J(u) ? u[0] : u, {
353
+ options: l.value,
354
+ notFoundContent: e.notFoundContent?.(n.value)
355
+ });
356
+ };
357
+ }
358
+ });
359
+ function Yl(e, a) {
360
+ const l = at({});
361
+ function n() {
362
+ Object.assign(l, ae(ce(e)));
363
+ const s = a.find((u) => u.valueType === "dateRange");
364
+ s && o(s.name || "", e[s.rangeStartName || "start"] ? [
365
+ e[s.rangeStartName || "start"],
366
+ e[s.rangeEndName || "end"]
367
+ ] : []);
368
+ }
369
+ q(() => e, () => {
370
+ n();
371
+ }, { deep: !0, immediate: !0 });
372
+ function o(s, u) {
373
+ l[s] = u;
374
+ }
375
+ return {
376
+ formState: l,
377
+ resetFormState: n,
378
+ changeFormState: o
379
+ };
380
+ }
381
+ const Ml = (e) => ({
382
+ [`${e.componentCls}-search`]: {
383
+ position: "relative",
384
+ display: "flex",
385
+ flexWrap: "wrap",
386
+ alignItems: "center",
387
+ "&-border": {
388
+ paddingInline: e.paddingMD,
389
+ paddingBlock: e.paddingMD,
390
+ paddingBlockEnd: e.paddingMD - 16,
391
+ border: `${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,
392
+ borderRadius: e.borderRadiusLG,
393
+ marginBottom: e.marginLG,
394
+ backgroundColor: e.colorBgContainer
395
+ },
396
+ "&-control": {
397
+ display: "flex",
398
+ alignItems: "center",
399
+ height: e.controlHeight,
400
+ marginBottom: e.margin,
401
+ fontSize: e.fontSize,
402
+ lineHeight: e.lineHeight,
403
+ [`${e.componentCls}-search-control-content`]: {
404
+ display: "flex",
405
+ alignItems: "center",
406
+ gap: e.size
407
+ },
408
+ [`${e.componentCls}-search-control-text`]: {
409
+ cursor: "pointer",
410
+ color: e.colorLink,
411
+ transition: `color ${e.motionDurationSlow}`,
412
+ "&:hover": {
413
+ color: e.colorLinkHover
414
+ }
415
+ },
416
+ [`${e.componentCls}-search-buttons`]: {
417
+ display: "flex",
418
+ alignItems: "center",
419
+ gap: e.sizeXS
420
+ },
421
+ [`${e.componentCls}-a`]: {
422
+ flexShrink: 0
423
+ }
424
+ },
425
+ [`${e.componentCls}-search-item`]: {
426
+ display: "flex",
427
+ alignItems: "center",
428
+ marginBottom: e.margin,
429
+ [`${e.componentCls}-search-input-compact`]: {
430
+ display: "flex",
431
+ alignItems: "center",
432
+ [`${e.antCls}-input-number`]: {
433
+ flex: 1,
434
+ "&:first-child": {
435
+ borderRightWidth: 0,
436
+ "&:hover": {
437
+ borderRightWidth: 1
438
+ }
439
+ },
440
+ "&:last-child": {
441
+ borderLeftWidth: 0,
442
+ "&:hover": {
443
+ borderLeftWidth: 1
444
+ }
445
+ }
446
+ },
447
+ [`${e.antCls}-input`]: {
448
+ width: 30,
449
+ borderLeftWidth: 0,
450
+ borderRightWidth: 0,
451
+ backgroundColor: "transparent",
452
+ cursor: "default"
453
+ }
454
+ },
455
+ "&-label": {
456
+ flexShrink: 0,
457
+ "&::after": {
458
+ content: '":"',
459
+ position: "relative",
460
+ marginBlock: 0,
461
+ marginInlineStart: e.marginXXS / 2,
462
+ marginInlineEnd: e.marginXS
463
+ },
464
+ [`&${e.componentCls}-search-item-label-no-colon::after`]: {
465
+ content: '" "'
466
+ },
467
+ [`&${e.componentCls}-search-item-label-left`]: {
468
+ textAlign: "left"
469
+ },
470
+ [`&${e.componentCls}-search-item-label-center`]: {
471
+ textAlign: "center"
472
+ },
473
+ [`&${e.componentCls}-search-item-label-right`]: {
474
+ textAlign: "right"
475
+ }
476
+ },
477
+ "&-children": {
478
+ width: "100%"
479
+ }
480
+ }
481
+ },
482
+ [`${e.componentCls}-search-empty-text`]: {
483
+ display: "flex",
484
+ flexDirection: "column",
485
+ justifyContent: "center",
486
+ alignItems: "center"
487
+ }
488
+ }), Je = [
489
+ { value: "xxl", span: 4 },
490
+ { value: "xl", span: 3 },
491
+ { value: "lg", span: 2 },
492
+ { value: "md", span: 2 },
493
+ { value: "sm", span: 2 },
494
+ { value: "xs", span: 1 }
495
+ ];
496
+ function me(e, a) {
497
+ return typeof a == "function" ? a(Z(e)) : Z(e).format(a);
498
+ }
499
+ function Ae(e, a) {
500
+ return a ? "YYYY-MM-DD HH:mm:ss" : e ?? "YYYY-MM-DD";
501
+ }
502
+ const bt = (e, a, l = "string") => {
503
+ if (J(e)) {
504
+ const [n, o] = e;
505
+ let s, u;
506
+ if (Array.isArray(a) ? (s = a[0], u = a[1]) : typeof a == "object" && a.type === "mask" ? (s = a.format, u = a.format) : (s = a, u = a), l === "string") {
507
+ const b = n ? me(n, s) : "", f = o ? me(o, u) : "";
508
+ return [b, f];
509
+ }
510
+ return [Z(n), Z(o)];
511
+ }
512
+ };
513
+ function ql(e) {
514
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
515
+ }
516
+ const {
517
+ MonthPicker: Kl,
518
+ RangePicker: kl,
519
+ YearPicker: Vl,
520
+ WeekPicker: Xl,
521
+ QuarterPicker: _l
522
+ } = At;
523
+ function Gl(e) {
524
+ let a = e.reduce((l, n) => n.order !== void 0 ? Math.max(l, n.order) : l, 0);
525
+ return e.forEach((l) => {
526
+ l.order === void 0 && (a += 1, l.order = a);
527
+ }), e.sort((l, n) => l.order - n.order), e;
528
+ }
529
+ const Ql = {
530
+ modalScroll: he.modalScroll,
531
+ formCols: {
532
+ type: Array,
533
+ default: () => []
534
+ },
535
+ loading: he.loading,
536
+ cardBordered: he.cardBordered,
537
+ prefixCls: String,
538
+ defaultFormSearch: {
539
+ type: Object,
540
+ default: () => ({})
541
+ },
542
+ onSearch: Function
543
+ }, Ul = /* @__PURE__ */ ge({
544
+ name: "ProTableForm",
545
+ inheritAttrs: !1,
546
+ props: Ql,
547
+ setup(e, {
548
+ slots: a,
549
+ expose: l
550
+ }) {
551
+ const {
552
+ wrapSSR: n,
553
+ hashId: o
554
+ } = rt("ProTableForm", [Ml], e.prefixCls), s = Tt(), u = it(), {
555
+ formAutoRequest: b,
556
+ formConfig: f,
557
+ formActions: $,
558
+ screenWidth: m,
559
+ styles: S,
560
+ classNames: v
561
+ } = Ke(), {
562
+ formState: i,
563
+ resetFormState: x,
564
+ changeFormState: h
565
+ } = Yl(e.defaultFormSearch, e.formCols), E = w(pe(f.value?.gap || 16)), A = T(() => {
566
+ if (f.value?.breakpoint && ne(f.value.breakpoint) && Object.keys(f.value.breakpoint).length)
567
+ return f.value?.breakpoint;
568
+ }), F = w(f.value?.collapsed ?? f.value?.defaultCollapsed), N = T(() => De($.value?.reset) ? $.value?.reset : !b.value), L = T(() => A.value ? k(A.value, m.value) : H(f.value?.span, u.value)), K = T(() => f.value?.label);
569
+ q(() => f.value?.collapsed, (t) => {
570
+ F.value = t;
571
+ });
572
+ function k(t, r) {
573
+ let y = 4;
574
+ const g = Object.keys(t).map((C) => Number(C)).filter((C) => !Number.isNaN(C)).sort((C, c) => c - C);
575
+ for (let C = 0; C < g.length; C += 1) {
576
+ const c = g[C];
577
+ if (t[c] && r >= c) {
578
+ y = t[c];
579
+ break;
580
+ }
581
+ }
582
+ return y;
583
+ }
584
+ function H(t, r) {
585
+ let y = 4;
586
+ for (let g = 0; g < Je.length; g += 1) {
587
+ const C = Je[g].value;
588
+ if (r[C]) {
589
+ y = t?.[C] || (e.modalScroll ? 3 : Je[g].span);
590
+ break;
591
+ }
592
+ }
593
+ return y;
594
+ }
595
+ const B = (t) => {
596
+ F.value = t;
597
+ }, X = (t, r, y) => (t + 1) % r === 0 ? {
598
+ ...y,
599
+ marginRight: pe(0)
600
+ } : {
601
+ ...y,
602
+ marginRight: E.value
603
+ }, O = () => {
604
+ const t = zt(i), r = e.formCols.find((C) => C.valueType === "text") || "", y = e.formCols.find((C) => C.valueType === "dateRange") || "", g = e.formCols.find((C) => C.valueType === "treeSelect");
605
+ return r && (t[r.name] = i[r.name] || r.initialValue || ""), y && (t[y.rangeStartName || "start"] = t[y.name] ? t[y.name][0] : "", t[y.rangeEndName || "end"] = t[y.name] ? t[y.name][1] : "", delete t[y.name]), g && (g?.name && J(i[g?.name]) && (t[g.name] = i[g.name].length ? i[g.name].map((C) => C[g.valueKey === "text" ? "label" : "value"]).join() : ""), g?.name && J(t[g?.name]) && (t[g.name] = t[g.name].length ? t[g.name].map((C) => C[g.valueKey === "text" ? "label" : "value"]) : "")), t;
606
+ }, W = (t = !1, r) => {
607
+ (b.value || t) && e.onSearch?.(O(), t ? r ? "reset" : "submit" : void 0);
608
+ }, Y = (t, r, y) => {
609
+ const g = i[r.name || ""];
610
+ switch (r.valueType) {
611
+ case "text":
612
+ h(r.name || "", t || "");
613
+ break;
614
+ case "number":
615
+ h(r.name || "", t || void 0);
616
+ break;
617
+ case "numberRange":
618
+ Ce(y?.key) && g && (g[y.key] = t, h(r.name || "", g || []));
619
+ break;
620
+ case "select":
621
+ h(r.name || "", t ?? void 0);
622
+ break;
623
+ case "treeSelect":
624
+ h(r.name || "", t ?? (r.field?.treeCheckable || r.field?.multiple ? [] : null));
625
+ break;
626
+ case "date":
627
+ h(r.name || "", t ? me(t, Ae(r.valueFormat, r.showTime)) : null);
628
+ break;
629
+ case "dateWeek":
630
+ h(r.name || "", t ? me(t, "YYYY-wo") : null);
631
+ break;
632
+ case "dateMonth":
633
+ h(r.name || "", t ? me(t, "YYYY-MM") : null);
634
+ break;
635
+ case "dateQuarter":
636
+ h(r.name || "", t ? me(t, "YYYY-QQ") : null);
637
+ break;
638
+ case "dateYear":
639
+ h(r.name || "", t ? me(t, "YYYY") : null);
640
+ break;
641
+ case "dateRange":
642
+ h(r.name || "", t && J(t) && t.length === 2 ? bt(t, Ae(r.valueFormat, r.showTime)) : null);
643
+ break;
644
+ case "time":
645
+ h(r.name || "", t ? me(t, r.valueFormat || "HH:mm:ss") : null);
646
+ break;
647
+ }
648
+ r.valueType === "treeSelect" || r.valueType, W();
649
+ }, M = (t = !0) => {
650
+ x(), W(!0, t);
651
+ };
652
+ l({
653
+ getFormSearch: () => O(),
654
+ resetForm: M
655
+ });
656
+ const ee = () => {
657
+ const t = s?.emptyText?.value;
658
+ if (t) {
659
+ const r = le(t), y = r ? pt(t) : wt(t || []);
660
+ return d("div", {
661
+ class: D(`${e.prefixCls}-search-empty-text`, o.value)
662
+ }, [r ? y : J(y) ? y.map((g) => lt(g)) : void 0]);
663
+ }
664
+ }, re = () => (!b.value || N.value) && d("div", {
665
+ class: D(`${e.prefixCls}-search-buttons ${o.value}`, v.value?.searchButtons),
666
+ style: S.value?.searchButtons
667
+ }, [N.value && d(ht, {
668
+ key: "reset",
669
+ onClick: () => M()
670
+ }, {
671
+ default: () => [$.value?.resetText || "重置"]
672
+ }), !b.value && d(ht, {
673
+ key: "submit",
674
+ loading: e.loading,
675
+ type: "primary",
676
+ onClick: () => W(!0)
677
+ }, {
678
+ default: () => [$.value?.searchText || "查询"]
679
+ })]), se = ({
680
+ formItemStyle: t = {},
681
+ collapsed: r,
682
+ collapseRender: y = !0
683
+ }) => d("div", {
684
+ style: {
685
+ ...t,
686
+ ...S.value?.searchControl
687
+ },
688
+ class: D(`${e.prefixCls}-search-control ${o.value}`, v.value?.searchControl)
689
+ }, [d("div", {
690
+ class: D(`${e.prefixCls}-search-control-content ${o.value}`, v.value?.searchContent)
691
+ }, [re(), f.value?.collapseRender !== !1 && y && d(we, null, [typeof f.value?.collapseRender == "function" ? f.value?.collapseRender(r) : d("span", {
692
+ class: D(`${e.prefixCls}-search-control-text ${o.value}`, v.value?.searchText),
693
+ style: S.value?.searchText,
694
+ onClick: () => B(!r)
695
+ }, [r ? "收起" : "展开", r ? d(el, null, null) : d(tl, null, null)])])])]);
696
+ function be(t) {
697
+ return t === void 0 ? void 0 : t ? d(Bt, {
698
+ size: "small",
699
+ indicator: s?.indicator?.value
700
+ }, null) : ee();
701
+ }
702
+ function de(t, r) {
703
+ return d(Wl, Q(t.request, {
704
+ loading: t.loading,
705
+ notFoundContent: be
706
+ }), ql(r) ? r : {
707
+ default: () => [r]
708
+ });
709
+ }
710
+ const Re = (t) => {
711
+ let r;
712
+ const y = b.value ? We.Search : We, g = ze(t.field || {}, "rules");
713
+ let C = null;
714
+ switch (t.valueType) {
715
+ case "text":
716
+ r = d(y, Q({
717
+ style: {
718
+ width: "100%"
719
+ },
720
+ value: i[t.name],
721
+ placeholder: t.placeholder || "请输入",
722
+ allowClear: t.allowClear ?? !0,
723
+ onChange: (c) => Y(c.target.value, t),
724
+ onSearch: (c) => W()
725
+ }, g), null);
726
+ break;
727
+ case "number":
728
+ r = d(Ue, Q({
729
+ style: {
730
+ width: "100%"
731
+ },
732
+ value: i[t.name],
733
+ placeholder: t.placeholder || "请输入",
734
+ onChange: (c) => Y(c, t)
735
+ }, g), null);
736
+ break;
737
+ case "numberRange":
738
+ r = d(We.Group, {
739
+ compact: !0,
740
+ class: D(o.value, `${e.prefixCls}-search-input-compact`)
741
+ }, {
742
+ default: () => [d(Ue, {
743
+ value: i[t.name]?.[0],
744
+ onChange: (c) => Y(c, t, {
745
+ key: 0
746
+ }),
747
+ placeholder: J(t.placeholder) && t.placeholder?.[0] || "请输入"
748
+ }, null), d(We, {
749
+ disabled: !0,
750
+ placeholder: "~"
751
+ }, null), d(Ue, {
752
+ value: i[t.name]?.[1],
753
+ onChange: (c) => Y(c, t, {
754
+ key: 1
755
+ }),
756
+ placeholder: J(t.placeholder) && t.placeholder?.[1] || "请输入"
757
+ }, null)]
758
+ });
759
+ break;
760
+ case "select":
761
+ C = d(Al, Q({
762
+ style: {
763
+ width: "100%"
764
+ },
765
+ value: t.loading ? void 0 : i[t.name],
766
+ optionFilterProp: "label",
767
+ placeholder: t.placeholder || "请选择",
768
+ showSearch: t.showSearch,
769
+ allowClear: t.allowClear ?? !0,
770
+ getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
771
+ notFoundContent: be(t.loading),
772
+ onChange: (c) => Y(c, t),
773
+ options: t.loading ? [] : t?.valueEnum || []
774
+ }, g), null);
775
+ break;
776
+ case "treeSelect":
777
+ C = d(Il, Q({
778
+ style: {
779
+ width: "100%"
780
+ },
781
+ value: i[t.name],
782
+ placeholder: t.placeholder || "请选择",
783
+ allowClear: t.allowClear ?? !0,
784
+ treeData: t.loading ? [] : t.valueEnum || [],
785
+ getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
786
+ notFoundContent: be(t.loading),
787
+ onChange: (c) => Y(c, t)
788
+ }, g), null);
789
+ break;
790
+ case "date":
791
+ r = d(At, Q({
792
+ style: {
793
+ width: "100%"
794
+ },
795
+ value: i[t.name] ? Z(i[t.name]) : void 0,
796
+ getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
797
+ placeholder: t.placeholder || "请选择",
798
+ allowClear: t.allowClear ?? !0,
799
+ format: Ae(t.valueFormat, t.showTime),
800
+ showTime: t.showTime,
801
+ showToday: t.showToday || !0,
802
+ onChange: (c) => Y(c, t)
803
+ }, g), null);
804
+ break;
805
+ case "dateWeek":
806
+ r = d(Xl, Q({
807
+ style: {
808
+ width: "100%"
809
+ },
810
+ value: i[t.name] ? Z(i[t.name], t.valueFormat || "YYYY-wo") : void 0,
811
+ getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
812
+ allowClear: t.allowClear ?? !0,
813
+ placeholder: t.placeholder || "请选择",
814
+ onChange: (c) => Y(c, t)
815
+ }, g), null);
816
+ break;
817
+ case "dateMonth":
818
+ r = d(Kl, Q({
819
+ style: {
820
+ width: "100%"
821
+ },
822
+ value: i[t.name] ? Z(i[t.name], t.valueFormat || "YYYY-MM") : void 0,
823
+ getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
824
+ allowClear: t.allowClear ?? !0,
825
+ placeholder: t.placeholder || "请选择",
826
+ onChange: (c) => Y(c, t)
827
+ }, g), null);
828
+ break;
829
+ case "dateQuarter":
830
+ r = d(_l, Q({
831
+ style: {
832
+ width: "100%"
833
+ },
834
+ value: i[t.name] ? Z(i[t.name], t.valueFormat || "YYYY-QQ") : void 0,
835
+ getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
836
+ allowClear: t.allowClear ?? !0,
837
+ placeholder: t.placeholder || "请选择",
838
+ onChange: (c) => Y(c, t)
839
+ }, g), null);
840
+ break;
841
+ case "dateYear":
842
+ r = d(Vl, Q({
843
+ style: {
844
+ width: "100%"
845
+ },
846
+ value: i[t.name] ? Z(i[t.name], t.valueFormat || "YYYY") : void 0,
847
+ getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
848
+ allowClear: t.allowClear ?? !0,
849
+ placeholder: t.placeholder || "请选择",
850
+ onChange: (c) => Y(c, t)
851
+ }, g), null);
852
+ break;
853
+ case "dateRange":
854
+ r = d(kl, Q({
855
+ style: {
856
+ width: "100%"
857
+ },
858
+ value: i[t.name] && J(i[t.name]) && i[t.name]?.length === 2 ? bt(i[t.name], Ae(t.valueFormat, t.showTime), "dayjs") : void 0,
859
+ getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
860
+ placeholder: t.placeholder || ["开始日期", "结束日期"],
861
+ format: Ae(t.valueFormat, t.showTime),
862
+ showTime: t.showTime,
863
+ onChange: (c) => Y(c, t)
864
+ }, g), null);
865
+ break;
866
+ case "time":
867
+ r = d(Fl, Q({
868
+ style: {
869
+ width: "100%"
870
+ },
871
+ value: i[t.name] ? Z(i[t.name], t.valueFormat || "HH:mm:ss") : void 0,
872
+ getPopupContainer: (c) => c && c.parentNode ? c.parentNode : c,
873
+ placeholder: t.placeholder || "请选择",
874
+ allowClear: t.allowClear || t.allowClear === !1 ? t.allowClear : !0,
875
+ use12Hours: t.use12Hours,
876
+ format: t.valueFormat || "HH:mm:ss",
877
+ onChange: (c) => Y(c, t)
878
+ }, g), null);
879
+ break;
880
+ }
881
+ return t.valueType && ["select", "treeSelect"].includes(t.valueType) && (r = t.request ? de(t, C) : C), r;
882
+ }, oe = ({
883
+ formItemStyle: t = {},
884
+ item: r
885
+ }) => {
886
+ const y = le(r) ? r.props?.label : r.label, g = (le(r) ? r.props?.labelWidth : r.labelWidth) || K.value?.width, C = (le(r) ? r.props?.labelAlign : r.labelAlign) || K.value?.align;
887
+ return d("div", {
888
+ class: D(`${e.prefixCls}-search-item`, o.value, v.value?.searchItem),
889
+ style: {
890
+ ...t,
891
+ gap: K.value?.gap ? pe(K.value?.gap) : void 0,
892
+ ...S.value?.searchItem || {}
893
+ }
894
+ }, [y && d("div", {
895
+ class: D(`${e.prefixCls}-search-item-label`, K.value?.colon === !1 && `${e.prefixCls}-search-item-label-no-colon`, C && `${e.prefixCls}-search-item-label-${C}`),
896
+ style: {
897
+ width: g ? pe(g) : void 0
898
+ }
899
+ }, [y]), d("div", {
900
+ class: D(`${e.prefixCls}-search-item-children`)
901
+ }, [le(r) ? r : Re(r)])]);
902
+ }, Pe = () => {
903
+ let t = a.default?.() || [];
904
+ t.length === 1 && t[0].type === "template" && (t = t[0]?.children || []);
905
+ const r = Gl([...e.formCols, ...t.map((g) => ({
906
+ ...g,
907
+ order: g.props?.order || void 0
908
+ }))]), y = {
909
+ width: `calc((100% - (${L.value - 1} * ${E.value})) / ${L.value})`
910
+ };
911
+ return r.map((g, C) => {
912
+ const c = X(C, L.value, y);
913
+ return r.length < L.value || F.value ? d(we, null, [oe({
914
+ formItemStyle: c,
915
+ item: g
916
+ }), C === r.length - 1 && se({
917
+ formItemStyle: {
918
+ flex: 1,
919
+ justifyContent: "flex-end"
920
+ },
921
+ collapsed: F.value,
922
+ collapseRender: !!F.value
923
+ })]) : d(we, null, [C < L.value - 1 && oe({
924
+ formItemStyle: c,
925
+ item: g
926
+ }), C === L.value - 1 && (L.value - 1 === 0 || r.length === L.value) && oe({
927
+ formItemStyle: c,
928
+ item: g
929
+ }), C === L.value - 1 && r.length >= L.value && se({
930
+ formItemStyle: {
931
+ flex: 1,
932
+ justifyContent: "flex-end"
933
+ },
934
+ collapsed: !1,
935
+ collapseRender: r.length !== L.value
936
+ })]);
937
+ });
938
+ };
939
+ return () => {
940
+ const t = e.cardBordered && `${e.prefixCls}-search-border`;
941
+ return n(d("div", {
942
+ class: D(v.value?.search, o.value, `${e.prefixCls}-search`, t, o.value, f.value?.className),
943
+ style: S.value?.search
944
+ }, [Pe()]));
945
+ };
946
+ }
947
+ }), { useInjectContext: Et, provideContext: Jl } = Dt("scrollbar"), Te = 4, Zl = {
948
+ vertical: {
949
+ offset: "offsetHeight",
950
+ scroll: "scrollTop",
951
+ scrollSize: "scrollHeight",
952
+ size: "height",
953
+ key: "vertical",
954
+ axis: "Y",
955
+ client: "clientY",
956
+ direction: "top"
957
+ },
958
+ horizontal: {
959
+ offset: "offsetWidth",
960
+ scroll: "scrollLeft",
961
+ scrollSize: "scrollWidth",
962
+ size: "width",
963
+ key: "horizontal",
964
+ axis: "X",
965
+ client: "clientX",
966
+ direction: "left"
967
+ }
968
+ }, ea = ({ move: e, size: a, bar: l }) => ({
969
+ [l.size]: a,
970
+ transform: `translate${l.axis}(${e}%)`
971
+ }), ta = {
972
+ vertical: Boolean,
973
+ size: String,
974
+ move: Number,
975
+ ratio: {
976
+ type: Number,
977
+ required: !0
978
+ },
979
+ always: Boolean,
980
+ barStyle: {
981
+ type: [Object],
982
+ default: () => ({})
983
+ }
984
+ }, tt = /* @__PURE__ */ ge({
985
+ props: ta,
986
+ setup(e) {
987
+ const {
988
+ tableHeaderHeight: a,
989
+ hashId: l,
990
+ wrapElement: n,
991
+ scrollbarElement: o,
992
+ className: s
993
+ } = Et(), u = w(), b = w(), f = w({}), $ = w(!1);
994
+ let m = !1, S = !1, v = 0, i = 0, x = Tl ? document.onselectstart : null;
995
+ const h = T(() => Zl[e.vertical ? "vertical" : "horizontal"]), E = T(() => ea({
996
+ size: e.size,
997
+ move: e.move,
998
+ bar: h.value
999
+ })), A = T(() => (
1000
+ // offsetRatioX = original width of thumb / current width of thumb / ratioX
1001
+ // offsetRatioY = original height of thumb / current height of thumb / ratioY
1002
+ // instance height = wrap height - GAP
1003
+ u.value[h.value.offset] ** 2 / n.value[h.value.scrollSize] / e.ratio / b.value[h.value.offset]
1004
+ )), F = (O) => {
1005
+ if (O.stopPropagation(), O.ctrlKey || [1, 2].includes(O.button)) return;
1006
+ window.getSelection()?.removeAllRanges(), L(O);
1007
+ const W = O.currentTarget;
1008
+ W && (f.value[h.value.axis] = W[h.value.offset] - (O[h.value.client] - W.getBoundingClientRect()[h.value.direction]));
1009
+ }, N = (O) => {
1010
+ if (!b.value || !u.value || !n.value) return;
1011
+ const W = Math.abs(O.target.getBoundingClientRect()[h.value.direction] - O[h.value.client]), Y = b.value[h.value.offset] / 2, M = (W - Y) * 100 * A.value / u.value[h.value.offset];
1012
+ n.value[h.value.scroll] = M * n.value[h.value.scrollSize] / 100;
1013
+ };
1014
+ function L(O) {
1015
+ n.value && (O.stopImmediatePropagation(), m = !0, v = n.value.scrollHeight, i = n.value.scrollWidth, document.addEventListener("mousemove", K), document.addEventListener("mouseup", k), x = document.onselectstart, document.onselectstart = () => !1);
1016
+ }
1017
+ function K(O) {
1018
+ if (!n.value || !u.value || !b.value || m === !1) return;
1019
+ const W = f.value[h.value.axis];
1020
+ if (!W) return;
1021
+ const Y = (u.value.getBoundingClientRect()[h.value.direction] - O[h.value.client]) * -1, M = b.value[h.value.offset] - W, ee = (Y - M) * 100 * A.value / u.value[h.value.offset];
1022
+ h.value.scroll === "scrollLeft" ? n.value[h.value.scroll] = ee * i / 100 : n.value[h.value.scroll] = ee * v / 100;
1023
+ }
1024
+ function k() {
1025
+ m = !1, f.value[h.value.axis] = 0, document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", k), X(), S && ($.value = !1);
1026
+ }
1027
+ const H = () => {
1028
+ S = !1, $.value = !!e.size;
1029
+ }, B = () => {
1030
+ S = !0, $.value = m;
1031
+ };
1032
+ Qt(() => {
1033
+ X(), document.removeEventListener("mouseup", k);
1034
+ });
1035
+ function X() {
1036
+ document.onselectstart !== x && (document.onselectstart = x);
1037
+ }
1038
+ return mt(o, "mousemove", H), mt(o, "mouseleave", B), () => {
1039
+ const O = h.value.key === "vertical" ? {
1040
+ height: `calc(100% - ${pe(a.value + 1)})`,
1041
+ top: pe(a.value + 1)
1042
+ } : {};
1043
+ return d("div", {
1044
+ ref: u,
1045
+ style: {
1046
+ ...e.barStyle,
1047
+ ...O
1048
+ },
1049
+ class: [`${s}-bar`, "is-" + h.value.key, l.value],
1050
+ onMousedown: N
1051
+ }, [d("div", {
1052
+ ref: b,
1053
+ class: `${s}-thumb ${l.value}`,
1054
+ style: E.value,
1055
+ onMousedown: F
1056
+ }, null)]);
1057
+ };
1058
+ }
1059
+ });
1060
+ tt.inheritAttrs = !1;
1061
+ const la = {
1062
+ always: {
1063
+ type: Boolean,
1064
+ default: !0
1065
+ },
1066
+ minSize: {
1067
+ type: Number,
1068
+ default: 20
1069
+ },
1070
+ /**
1071
+ * @description style of bar
1072
+ */
1073
+ barStyle: {
1074
+ type: [Object],
1075
+ default: () => ({})
1076
+ }
1077
+ }, aa = /* @__PURE__ */ ge({
1078
+ inheritAttrs: !1,
1079
+ props: la,
1080
+ setup(e, {
1081
+ expose: a
1082
+ }) {
1083
+ const {
1084
+ tableScrollState: l
1085
+ } = Ke(), n = Et(), o = w(0), s = w(0), u = w(""), b = w(""), f = w(1), $ = w(1), m = (v) => {
1086
+ if (v) {
1087
+ const i = v.offsetHeight - Te, x = v.offsetWidth - Te;
1088
+ s.value = v.scrollTop * 100 / i * f.value, o.value = v.scrollLeft * 100 / x * $.value;
1089
+ }
1090
+ }, S = () => {
1091
+ const v = n?.wrapElement;
1092
+ if (!v?.value) return;
1093
+ const i = v.value.offsetHeight - Te, x = v.value.offsetWidth - Te, h = i ** 2 / v.value.scrollHeight, E = x ** 2 / v.value.scrollWidth, A = Math.max(h, e.minSize), F = Math.max(E, e.minSize);
1094
+ f.value = h / (i - h) / (A / (i - A)), $.value = E / (x - E) / (F / (x - F)), b.value = A + Te < i ? `${A}px` : "", u.value = F + Te < x ? `${F}px` : "";
1095
+ };
1096
+ return nt(() => {
1097
+ ot(() => {
1098
+ S();
1099
+ });
1100
+ }), a({
1101
+ update: S,
1102
+ handleScroll: m
1103
+ }), () => d(we, null, [d(tt, {
1104
+ move: o.value,
1105
+ barStyle: e.barStyle.x,
1106
+ ratio: $.value,
1107
+ size: u.value,
1108
+ always: e.always
1109
+ }, null), !!l.value.y && d(tt, {
1110
+ move: s.value,
1111
+ barStyle: e.barStyle.y,
1112
+ ratio: f.value,
1113
+ size: b.value,
1114
+ vertical: !0,
1115
+ always: e.always
1116
+ }, null)]);
1117
+ }
1118
+ }), na = (e) => ({
1119
+ [`${e.componentCls}`]: {
1120
+ lineHeight: 1,
1121
+ "&-with-after": {
1122
+ paddingBottom: e.margin
1123
+ },
1124
+ "&-container": {
1125
+ display: "flex",
1126
+ alignItems: "center",
1127
+ justifyContent: "space-between",
1128
+ gap: e.padding,
1129
+ paddingBottom: e.padding,
1130
+ "&-mobile": {
1131
+ flexDirection: "column",
1132
+ flexWrap: "wrap",
1133
+ alignItems: "flex-start",
1134
+ [`${e.componentCls}-left`]: {
1135
+ flexWrap: "wrap",
1136
+ maxWidth: "100%"
1137
+ },
1138
+ [`${e.componentCls}-right`]: {
1139
+ width: "100%"
1140
+ }
1141
+ }
1142
+ },
1143
+ "&-title": {
1144
+ display: "flex",
1145
+ alignItems: "center",
1146
+ justifyContent: "flex-start",
1147
+ color: e.colorTextHeading,
1148
+ fontWeight: "500",
1149
+ fontSize: e.fontSizeLG
1150
+ },
1151
+ "&-left": {
1152
+ display: "flex",
1153
+ flexWrap: "wrap",
1154
+ alignItems: "center",
1155
+ gap: e.marginXS,
1156
+ justifyContent: "flex-start",
1157
+ [`${e.antCls}-tabs`]: {
1158
+ width: "100%"
1159
+ },
1160
+ "&-has-tabs": {
1161
+ overflow: "hidden"
1162
+ }
1163
+ },
1164
+ "&-right": {
1165
+ flex: 1,
1166
+ display: "flex",
1167
+ flexWrap: "wrap",
1168
+ justifyContent: "flex-end",
1169
+ gap: e.marginSM,
1170
+ [`${e.componentCls}-actions`]: {
1171
+ display: "flex",
1172
+ alignItems: "center",
1173
+ gap: e.marginXS
1174
+ }
1175
+ },
1176
+ "&-setting-items": {
1177
+ display: "flex",
1178
+ gap: e.marginSM,
1179
+ lineHeight: "32px",
1180
+ alignItems: "center"
1181
+ },
1182
+ "&-setting-item": {
1183
+ color: e.colorIconHover,
1184
+ fontSize: e.fontSizeLG,
1185
+ cursor: "pointer",
1186
+ "> span": { display: "block", width: "100%", height: "100%" },
1187
+ "&:hover": {
1188
+ color: e.colorPrimary
1189
+ }
1190
+ }
1191
+ }
1192
+ });
1193
+ function oa(e) {
1194
+ if (le(e))
1195
+ return e;
1196
+ if (e) {
1197
+ const a = e, {
1198
+ icon: l,
1199
+ tooltip: n,
1200
+ onClick: o,
1201
+ key: s
1202
+ } = a;
1203
+ return l && n ? d($e, {
1204
+ title: n,
1205
+ key: s
1206
+ }, {
1207
+ default: () => [d("span", {
1208
+ key: s,
1209
+ onClick: () => {
1210
+ o && o(s);
1211
+ }
1212
+ }, [l])]
1213
+ }) : l;
1214
+ }
1215
+ return null;
1216
+ }
1217
+ const Lt = /* @__PURE__ */ ge({
1218
+ props: {
1219
+ actions: [Array],
1220
+ settings: [Array],
1221
+ prefixCls: String,
1222
+ headerTitle: he.headerTitle,
1223
+ listToolAfter: he.listToolAfter,
1224
+ headerTitleTip: he.headerTitleTip,
1225
+ titleTipText: he.titleTipText,
1226
+ actionsPlacement: String
1227
+ },
1228
+ setup(e) {
1229
+ const {
1230
+ wrapSSR: a,
1231
+ hashId: l
1232
+ } = rt("ListToolBar", [na], e.prefixCls), n = w(), {
1233
+ height: o
1234
+ } = wl(n), s = it(), {
1235
+ isMobile: u,
1236
+ tableListToolsHeight: b,
1237
+ classNames: f,
1238
+ styles: $
1239
+ } = Ke();
1240
+ yt(() => {
1241
+ b.value = o.value || 0;
1242
+ });
1243
+ const m = T(() => !!(e.headerTitleTip || e.headerTitle)), S = Ne(() => {
1244
+ if (!Array.isArray(e.actions) || e.actions?.length < 1)
1245
+ return {
1246
+ left: null,
1247
+ right: null
1248
+ };
1249
+ const A = e.actions.filter((N) => le(N)).filter((N) => (N?.props?.placement || e.actionsPlacement) === "left"), F = e.actions.filter((N) => le(N)).filter((N) => (N?.props?.placement || e.actionsPlacement) === "right");
1250
+ return {
1251
+ left: A.length ? d("div", {
1252
+ class: `${e.prefixCls}-actions ${l.value}`
1253
+ }, [A]) : null,
1254
+ right: F.length ? d("div", {
1255
+ class: `${e.prefixCls}-actions ${l.value}`
1256
+ }, [F]) : null
1257
+ };
1258
+ }, [() => e.actions, () => e.actionsPlacement]), v = T(() => !!(e.headerTitleTip || e.headerTitle || S.value.left)), i = T(() => !!(e.settings?.length || S.value.right)), x = Ne(() => {
1259
+ if (!v.value && i.value)
1260
+ return d("div", {
1261
+ class: `${e.prefixCls}-left ${l.value}`
1262
+ }, null);
1263
+ const A = S.value.left, F = D(`${e.prefixCls}-left ${l.value}`, f.value?.toolbarLeft), N = $.value?.toolbarLeft;
1264
+ return m.value ? d("div", {
1265
+ class: F,
1266
+ style: N
1267
+ }, [d("div", {
1268
+ class: `${e.prefixCls}-title ${l.value}`
1269
+ }, [e.headerTitle, e.headerTitleTip && d($e, {
1270
+ title: e.titleTipText
1271
+ }, {
1272
+ default: () => [De(e.headerTitleTip) && e.headerTitleTip ? d(ll, null, null) : e.headerTitleTip]
1273
+ })]), A]) : d("div", {
1274
+ class: F,
1275
+ style: N
1276
+ }, [A]);
1277
+ }, [() => v.value, () => i.value, () => m.value, () => e.prefixCls, () => e.headerTitle, () => e.titleTipText, () => e.headerTitleTip]), h = Ne(() => {
1278
+ if (!i.value) return null;
1279
+ const A = S.value.right;
1280
+ return d("div", {
1281
+ class: D(`${e.prefixCls}-right ${l.value}`, f.value?.toolbarRight),
1282
+ style: {
1283
+ alignItems: s.value.lg ? "center" : "flex-end",
1284
+ flexDirection: s.value.lg ? "row" : "column",
1285
+ ...$.value?.toolbarRight || {}
1286
+ }
1287
+ }, [A, e.settings?.length ? d("div", {
1288
+ class: D(`${e.prefixCls}-setting-items`, l.value)
1289
+ }, [e.settings.map((F, N) => {
1290
+ const L = oa(F);
1291
+ return d("div", {
1292
+ key: N,
1293
+ class: D(`${e.prefixCls}-setting-item`, l.value)
1294
+ }, [L]);
1295
+ })]) : null]);
1296
+ }, [() => s.value, () => i.value, () => e.prefixCls, () => m.value, () => S.value, () => e.settings]), E = Ne(() => {
1297
+ if (!i.value && !v.value) return null;
1298
+ const A = {
1299
+ [`${l.value}`]: !0,
1300
+ [`${e.prefixCls}-container`]: !0,
1301
+ [`${e.prefixCls}-container-mobile`]: u.value
1302
+ };
1303
+ return d("div", {
1304
+ class: A
1305
+ }, [x.value, h.value]);
1306
+ }, [() => u.value, () => v.value, () => i.value, () => x.value, () => e.prefixCls, () => h.value]);
1307
+ return () => a(d("div", {
1308
+ ref: n,
1309
+ class: D(`${e.prefixCls} ${l.value}`, e.listToolAfter && `${e.prefixCls}-with-after`, f.value?.toolbar),
1310
+ style: $.value?.toolbar
1311
+ }, [E.value, e.listToolAfter && d("div", {
1312
+ class: D(`${e.prefixCls}-after ${l.value}`, f.value?.toolbarAfter),
1313
+ style: $.value?.toolbarAfter
1314
+ }, [e.listToolAfter])]));
1315
+ }
1316
+ });
1317
+ Lt.inheritAttrs = !1;
1318
+ const jt = /* @__PURE__ */ ge({
1319
+ setup() {
1320
+ const {
1321
+ isFullscreen: e
1322
+ } = It();
1323
+ return () => e.value ? d($e, {
1324
+ title: "退出全屏"
1325
+ }, {
1326
+ default: () => [d(al, null, null)]
1327
+ }) : d($e, {
1328
+ title: "全屏"
1329
+ }, {
1330
+ default: () => [d(nl, null, null)]
1331
+ });
1332
+ }
1333
+ });
1334
+ function ia() {
1335
+ return {
1336
+ reload: {
1337
+ text: "刷新",
1338
+ icon: d(ol, null, null)
1339
+ },
1340
+ fullScreen: {
1341
+ text: "全屏",
1342
+ icon: d(jt, null, null)
1343
+ }
1344
+ };
1345
+ }
1346
+ function ra(e, a) {
1347
+ return Rt(e).filter((l) => l).map((l) => {
1348
+ const n = e[l];
1349
+ if (!n)
1350
+ return null;
1351
+ let o = n === !0 ? a[l] : () => n?.();
1352
+ if (typeof o != "function" && (o = () => {
1353
+ }), l === "fullScreen")
1354
+ return d("span", {
1355
+ key: l,
1356
+ onClick: o
1357
+ }, [d(jt, null, null)]);
1358
+ const s = ia()[l];
1359
+ return s ? d("span", {
1360
+ key: l,
1361
+ onClick: o
1362
+ }, [d($e, {
1363
+ title: s.text
1364
+ }, {
1365
+ default: () => [s.icon]
1366
+ })]) : null;
1367
+ }).filter((l) => l);
1368
+ }
1369
+ const sa = {
1370
+ options: [Boolean, Object, Array],
1371
+ actionsPlacement: [String],
1372
+ headerTitle: [Function, Boolean, Object, Array, String],
1373
+ listToolAfter: [Function, Boolean, Object, Array, String],
1374
+ headerTitleTip: [Function, Boolean, Object, String],
1375
+ titleTipText: [String],
1376
+ actionsRender: [Array]
1377
+ }, ua = /* @__PURE__ */ ge({
1378
+ props: sa,
1379
+ inheritAttrs: !1,
1380
+ setup(e) {
1381
+ const a = $t({
1382
+ suffixCls: "table-list-toolbar",
1383
+ isPor: !0
1384
+ }), {
1385
+ action: l
1386
+ } = Ke(), n = Ne(() => e.options === !1 ? [] : ra({
1387
+ reload: () => l?.reload(),
1388
+ fullScreen: () => l?.toggle()
1389
+ }, ne(e.options) ? e.options : {}), [() => e.options]);
1390
+ return () => {
1391
+ const o = e.actionsRender || [];
1392
+ return d(Lt, {
1393
+ prefixCls: a,
1394
+ actions: o,
1395
+ actionsPlacement: e.actionsPlacement,
1396
+ settings: R(n),
1397
+ headerTitle: e.headerTitle,
1398
+ listToolAfter: e.listToolAfter,
1399
+ headerTitleTip: e.headerTitleTip,
1400
+ titleTipText: e.titleTipText
1401
+ }, null);
1402
+ };
1403
+ }
1404
+ });
1405
+ function ca(e) {
1406
+ return Ut();
1407
+ }
1408
+ function da(e, a = !0, l) {
1409
+ ca() ? Ct(e, l) : a ? e() : ot(e);
1410
+ }
1411
+ function fa({ scroll: e, columns: a, breakpoint: l, draggable: n, autoScroll: o, neverScroll: s }) {
1412
+ const u = w([]);
1413
+ q([
1414
+ () => e.value,
1415
+ () => a.value,
1416
+ () => l.value,
1417
+ () => n.value,
1418
+ () => l.value,
1419
+ () => o.value,
1420
+ () => s.value
1421
+ ], () => {
1422
+ const v = $(ce(a.value));
1423
+ qe(v, ce(u.value)) || (u.value = ae(v));
1424
+ }, {
1425
+ deep: !0,
1426
+ immediate: !0
1427
+ });
1428
+ const b = T(() => f(R(u)));
1429
+ function f(v) {
1430
+ return v.sort((i, x) => cl(i, x, "order", 0));
1431
+ }
1432
+ function $(v) {
1433
+ return ae(v).map((i, x) => {
1434
+ if (i.dataIndex === "action" || x === v.length - 1 ? i.resizable = !1 : i.resizable = De(i.resizable) ? i.resizable : !!(Ce(i.width) && R(n)), !i.width || R(s))
1435
+ return i;
1436
+ if (i.dataIndex === "action" && R(o))
1437
+ if (R(e)?.x || !R(l))
1438
+ i.width = i.width || 100, i.fixed = "right";
1439
+ else {
1440
+ const h = R(a).find((E) => E.dataIndex === i.dataIndex);
1441
+ i.width = h?.width || "", i.fixed = h?.fixed;
1442
+ }
1443
+ return i;
1444
+ });
1445
+ }
1446
+ function m(v, i) {
1447
+ u.value = u.value.map((x) => (x.uuid === i.uuid && (x.width = v), x));
1448
+ }
1449
+ function S(v) {
1450
+ if (v.length <= 0) {
1451
+ u.value = [];
1452
+ return;
1453
+ }
1454
+ qe($(v), ce(u.value)) || (u.value = $(v));
1455
+ }
1456
+ return {
1457
+ breakpoint: l,
1458
+ proColumns: b,
1459
+ setColumns: S,
1460
+ resizeColumnWidth: m
1461
+ };
1462
+ }
1463
+ function va(e, a) {
1464
+ const l = T(() => a), n = w(), o = w(e);
1465
+ function s() {
1466
+ n.value && (clearTimeout(n.value), n.value = null);
1467
+ }
1468
+ async function u(...b) {
1469
+ return l.value === 0 || l.value === void 0 ? o.value(...b) : (s(), new Promise(async (f) => {
1470
+ b[0]?.immediate ? f(await o.value(...b)) : n.value = setTimeout(async () => {
1471
+ f(await o.value(...b));
1472
+ }, l.value);
1473
+ }));
1474
+ }
1475
+ return rl(s), {
1476
+ cancel: s,
1477
+ run: u
1478
+ };
1479
+ }
1480
+ function ma(e) {
1481
+ const a = T(() => e.rowKey), l = T(() => e.polling), n = T(() => e.debounceTime), o = T(() => e.dataSource), s = T(() => e.autoRequest);
1482
+ return {
1483
+ rowKey: a,
1484
+ polling: l,
1485
+ request: e.request,
1486
+ postData: e.postData,
1487
+ debounceTime: n,
1488
+ dataSource: o,
1489
+ autoRequest: s
1490
+ };
1491
+ }
1492
+ function ha({ rowKey: e, autoRequest: a, polling: l, request: n, postData: o, dataSource: s, waitRequest: u, debounceTime: b }, { params: f, columns: $, setLoading: m, setColumns: S, removeRowKeys: v, syncSelectedRows: i, defaultFormSearch: x, setPagination: h, pageInfo: E, onRequestError: A, onBeforeSearchSubmit: F, hasCustomRender: N }, L) {
1493
+ const K = w(""), k = w(!1), H = w(!1), B = w([]), X = w(), O = w(null), W = (t = !1) => {
1494
+ (k.value || t) && m(!1), de(!1);
1495
+ }, Y = async (t = {}) => {
1496
+ const { pagination: r = {}, filters: y = {}, sorter: g = {}, removeKeys: C = [], isPolling: c = !1, extra: fe } = t;
1497
+ if (!n || !Me(n))
1498
+ return s.value || [];
1499
+ c ? de(!0) : m(!0), r && h(r);
1500
+ try {
1501
+ C.length && v(C);
1502
+ const U = ne(g) ? Object.keys(g).length ? [g] : [] : g;
1503
+ S(R($).map((Se) => {
1504
+ const xe = U.find((ie) => (ie?.columnKey || ie?.field) === Se.dataIndex);
1505
+ return {
1506
+ ...Se,
1507
+ sortOrder: xe?.order
1508
+ };
1509
+ }));
1510
+ let Fe = {
1511
+ ...ce(E),
1512
+ current: vl(ce(E), C.length),
1513
+ ...R(x),
1514
+ ...R(f),
1515
+ ...t.params
1516
+ };
1517
+ F && Me(F) && (Fe = await F({
1518
+ params: Fe,
1519
+ sorter: U,
1520
+ filter: y,
1521
+ extra: fe
1522
+ }));
1523
+ let ve = [];
1524
+ const ue = `table_request_${Pt().uuid(10)}`;
1525
+ K.value = ue;
1526
+ const Ie = await n?.({
1527
+ params: ae(ce(Fe)),
1528
+ sorter: U,
1529
+ filter: y,
1530
+ extra: fe
1531
+ });
1532
+ if (K.value !== ue)
1533
+ return [];
1534
+ if (Ie) {
1535
+ const { success: Se = !0, data: xe = [] } = Ie;
1536
+ if (!Se)
1537
+ return [];
1538
+ ve = typeof o == "function" ? await o?.(xe) : xe, i(ve);
1539
+ const ie = Ie.total || ve?.length || 0;
1540
+ ie !== E.total && h({
1541
+ total: ie
1542
+ });
1543
+ const ke = R(B).map((Ve) => ze(Ve, "sortIndex"));
1544
+ return qe(ve, ke) ? R(B) : (oe(ve), ve);
1545
+ } else
1546
+ return [];
1547
+ } catch (U) {
1548
+ if (A === void 0)
1549
+ throw new Error(U);
1550
+ B.value === void 0 && oe([]), A(U);
1551
+ } finally {
1552
+ W(!0);
1553
+ }
1554
+ return [];
1555
+ }, M = va(async (t = {}) => {
1556
+ if (X.value && clearTimeout(X.value), !n)
1557
+ return;
1558
+ const r = new AbortController();
1559
+ O.value = r;
1560
+ try {
1561
+ const y = await Promise.race([
1562
+ Y(t),
1563
+ new Promise((C, c) => {
1564
+ O.value?.signal?.addEventListener?.("abort", () => {
1565
+ c("aborted"), M.cancel(), W();
1566
+ });
1567
+ })
1568
+ ]);
1569
+ if (r.signal.aborted)
1570
+ return;
1571
+ const g = dl(l.value, y);
1572
+ return g && !k.value && (X.value = setTimeout(() => {
1573
+ M.run({ ...t, isPolling: g });
1574
+ }, Math.max(g, 2e3))), y;
1575
+ } catch (y) {
1576
+ if (y === "aborted")
1577
+ return;
1578
+ throw y;
1579
+ }
1580
+ }, b.value || 30), ee = () => {
1581
+ O.value?.abort(), M.cancel(), W();
1582
+ };
1583
+ nt(() => {
1584
+ k.value = !1;
1585
+ }), Ct(() => {
1586
+ k.value = !1;
1587
+ }), St(() => {
1588
+ ee(), k.value = !0, clearTimeout(X.value);
1589
+ }), xt(() => {
1590
+ ee(), k.value = !0, clearTimeout(X.value);
1591
+ }), q(() => l.value, () => {
1592
+ u.value || (l.value ? M.run({ isPolling: !0 }) : clearTimeout(X.value));
1593
+ }, { immediate: !0 }), q(() => u.value, () => {
1594
+ u.value ? m(!0) : M.run({ isPolling: !1 });
1595
+ }, { immediate: !0 }), q(() => s.value, () => {
1596
+ s.value && oe(s.value || []);
1597
+ }, { deep: !0, immediate: !0 }), q(() => f.value, () => {
1598
+ u.value || a.value && (h({ current: 1 }), re());
1599
+ }, { deep: !0, immediate: !0 }), q(() => x.value, (t, r) => {
1600
+ u.value || qe(t, r) || (h({ current: 1 }), re());
1601
+ }, { deep: !0, immediate: !0 });
1602
+ function re() {
1603
+ n ? l.value || (ee(), M.run({ isPolling: !1 })) : oe(s.value || []);
1604
+ }
1605
+ const se = T(() => {
1606
+ if (N.value)
1607
+ return R(B);
1608
+ const t = $.value.filter((r) => r.show || r.show === void 0);
1609
+ return !R(B) || !t || t.length === 0 ? [] : R(B);
1610
+ }), be = T(() => R(B).some((t) => J(t.children) && t.children.length > 0));
1611
+ function de(t) {
1612
+ H.value = t;
1613
+ }
1614
+ function Re(t, r = {}, y = {}, g) {
1615
+ ee(), M.run({ pagination: t, filters: r, sorter: y, extra: g, isPolling: !1 });
1616
+ }
1617
+ function oe(t) {
1618
+ const r = fl(ae(t), ce(E));
1619
+ if (B.value = r, !n || !Me(n)) {
1620
+ const y = r.length || 0;
1621
+ y !== E.total && h({
1622
+ total: y
1623
+ });
1624
+ }
1625
+ }
1626
+ return {
1627
+ dataSource: se,
1628
+ isTreeDataRef: be,
1629
+ setTableDataList: oe,
1630
+ operateTableDataRow: (t) => {
1631
+ const { key: r, row: y, value: g, type: C = "update" } = t, c = r ?? e.value, fe = y?.[c] ?? g;
1632
+ switch (!y && C !== "delete" && console.warn("row is required"), C) {
1633
+ case "update":
1634
+ c && fe && y && (B.value = B.value.map((U) => fe === U[c] ? ye(U, y) : U));
1635
+ break;
1636
+ case "push":
1637
+ y && B.value.push(y);
1638
+ break;
1639
+ case "unshift":
1640
+ y && B.value.unshift(y);
1641
+ break;
1642
+ case "delete":
1643
+ c && (B.value = B.value.filter((U) => g !== U[c]));
1644
+ break;
1645
+ }
1646
+ },
1647
+ handleTableChange: Re,
1648
+ run: async (t) => {
1649
+ u.value || (n ? await M.run({ ...t, isPolling: !1 }) : L("reload"));
1650
+ }
1651
+ };
1652
+ }
1653
+ function ga(e) {
1654
+ const a = w(l(e.loading.value));
1655
+ q(() => e.loading.value, (o) => {
1656
+ a.value = l(o, a.value);
1657
+ });
1658
+ function l(o, s = !1) {
1659
+ return De(o) ? o : ne(o) ? o?.spinning ?? s : s;
1660
+ }
1661
+ function n(o) {
1662
+ a.value = o;
1663
+ }
1664
+ return [a, n];
1665
+ }
1666
+ const Ye = {
1667
+ current: 1,
1668
+ pageSize: 10,
1669
+ size: "default",
1670
+ showQuickJumper: !0,
1671
+ showSizeChanger: !0,
1672
+ pageSizeOptions: ["10", "20", "50", "100"]
1673
+ };
1674
+ function ba({
1675
+ pagination: e,
1676
+ pageItemRender: a
1677
+ }) {
1678
+ const l = w({
1679
+ ...Ye
1680
+ }), n = at({
1681
+ current: Ye.current,
1682
+ pageSize: Ye.pageSize,
1683
+ total: 0
1684
+ });
1685
+ q(() => e.value, () => {
1686
+ if (e.value === !1) {
1687
+ l.value = !1;
1688
+ return;
1689
+ }
1690
+ const s = Me(a) ? {
1691
+ itemRender: ({
1692
+ page: b,
1693
+ type: f,
1694
+ originalElement: $
1695
+ }) => a ? a({
1696
+ page: b,
1697
+ type: f,
1698
+ originalElement: $
1699
+ }) : null
1700
+ } : null, u = {
1701
+ ...Ye,
1702
+ ...e.value || {},
1703
+ ...s || {}
1704
+ };
1705
+ e.value?.showTotal || (u.showTotal = (b) => `共${b < u.pageSize ? 1 : Math.ceil(b / (u.pageSize || 10))}页 ${b}条记录`), l.value = ae(u), ml(n, (b) => {
1706
+ Ce(u[b]) && (n[b] = u[b]);
1707
+ });
1708
+ }, {
1709
+ deep: 1,
1710
+ immediate: !0
1711
+ });
1712
+ function o(s) {
1713
+ l.value = ye(R(l), s);
1714
+ for (const u in n)
1715
+ s[u] && Ce(s[u]) && (n[u] = s[u]);
1716
+ }
1717
+ return {
1718
+ paginationInfo: l,
1719
+ requestPagination: n,
1720
+ setPagination: o
1721
+ };
1722
+ }
1723
+ function pa(e, a) {
1724
+ const l = w([]), n = w([]);
1725
+ q(() => a.value?.selectedRows, (m) => {
1726
+ n.value = ae(m || []);
1727
+ }, {
1728
+ deep: !0,
1729
+ immediate: !0
1730
+ }), q(() => a.value?.selectedRowKeys, (m) => {
1731
+ l.value = hl([...m || []]);
1732
+ }, {
1733
+ deep: !0,
1734
+ immediate: !0
1735
+ });
1736
+ const o = (m, S) => {
1737
+ const v = a.value?.type || "checkbox";
1738
+ e.value && (S ? m?.[e.value] && v === "checkbox" ? (l.value.push(m[e.value]), n.value.push(m)) : (l.value = [m[e.value]], n.value = [m]) : (l.value = l.value.filter((i) => i !== m[e.value]), n.value = n.value.filter((i) => i[e.value] !== m[e.value])));
1739
+ }, s = () => {
1740
+ a.value && a.value?.onChange?.(l.value, n.value);
1741
+ };
1742
+ return {
1743
+ selectedKeys: l,
1744
+ selectedItems: n,
1745
+ selectRowKey: o,
1746
+ selectAllRowKey: (m, S, v) => {
1747
+ e.value && (m ? S.map((i) => (l.value.every((x) => x !== i?.[e.value]) && i?.[e.value] && (l.value.push(i[e.value]), n.value.push(i)), i)) : v.map((i) => (l.value.includes(i?.[e.value]) && (l.value = l.value.filter((x) => x !== i[e.value]), n.value = n.value.filter((x) => x[e.value] !== i[e.value])), i)));
1748
+ },
1749
+ removeRowKeys: (m) => {
1750
+ l.value = l.value.filter((S) => !m.includes(S)), n.value = n.value.filter((S) => !m.includes(S?.[e.value || ""])), s();
1751
+ },
1752
+ changeRowKey: s,
1753
+ syncSelectedRows: (m) => {
1754
+ if (e.value && l.value.length !== n.value.length) {
1755
+ const S = n.value.map((i) => i[e.value]), v = l.value.filter((i) => !S.includes(i));
1756
+ m.forEach((i) => {
1757
+ v.includes(i[e.value]) && n.value.push(ae(i));
1758
+ });
1759
+ }
1760
+ },
1761
+ clearAllRowKeys: () => {
1762
+ l.value = [], n.value = [], s();
1763
+ }
1764
+ };
1765
+ }
1766
+ function ya(e) {
1767
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
1768
+ }
1769
+ function Ca(e, a, l, n) {
1770
+ if (!a) return e;
1771
+ let o = e;
1772
+ if (ne(a)) {
1773
+ const s = a.node === "a" ? "span" : a.node;
1774
+ return d(s, Q(a?.attr || {}, {
1775
+ class: a.class,
1776
+ onClick: a.click
1777
+ }), ya(e) ? e : {
1778
+ default: () => [e]
1779
+ });
1780
+ }
1781
+ switch (a) {
1782
+ case "link":
1783
+ o = d("span", {
1784
+ class: [`${l}-a`, n]
1785
+ }, [e]);
1786
+ break;
1787
+ case "time":
1788
+ o = Z(e).format("HH:mm:ss");
1789
+ break;
1790
+ case "dateMonth":
1791
+ o = `${Z(e).month() + 1}月`;
1792
+ break;
1793
+ case "date":
1794
+ o = Z(e).format("YYYY-MM-DD");
1795
+ break;
1796
+ case "dateTime":
1797
+ o = Z(e).format("YYYY-MM-DD HH:mm:ss");
1798
+ break;
1799
+ }
1800
+ return o;
1801
+ }
1802
+ function Sa(e, a) {
1803
+ const l = a && a.current || 1, n = a && a.pageSize || 10;
1804
+ return e.filter((o, s) => s < l * n && s >= n * (l - 1));
1805
+ }
1806
+ function xa(e) {
1807
+ const a = document.createElement("textarea");
1808
+ a.style.position = "absolute", a.style.opacity = "0", a.value = e, document.body.appendChild(a), a.select(), document.execCommand("copy"), document.body.removeChild(a);
1809
+ }
1810
+ function Be(e, a) {
1811
+ let l = null, n = null;
1812
+ function o() {
1813
+ l && l.disconnect(), n && n.disconnect();
1814
+ }
1815
+ function s(f) {
1816
+ f && (l = new ResizeObserver(() => {
1817
+ a(f);
1818
+ }), l.observe(f), a(f));
1819
+ }
1820
+ function u() {
1821
+ return typeof e == "string" ? document.querySelector(e) : e();
1822
+ }
1823
+ const b = u();
1824
+ return b ? (s(b), o) : (n = new MutationObserver(() => {
1825
+ const f = u();
1826
+ f && (n.disconnect(), s(f));
1827
+ }), n.observe(document.body, {
1828
+ childList: !0,
1829
+ subtree: !0
1830
+ }), o);
1831
+ }
1832
+ function Ta({ fitPage: e, hashId: a, scroll: l, baseClassName: n }) {
1833
+ const o = w(), s = w(), u = w(), b = w(), f = w(), $ = w(), m = w(0);
1834
+ let S, v, i, x;
1835
+ sl(() => {
1836
+ S = Be(() => s.value?.querySelector(".ant-pagination"), (H) => {
1837
+ H && (u.value = H);
1838
+ }), i = Be(() => s.value?.querySelector(".ant-table-header"), (H) => {
1839
+ H && (b.value = H);
1840
+ }), x = Be(() => s.value?.querySelector(".ant-table-body>table"), (H) => {
1841
+ H && ($.value = H);
1842
+ });
1843
+ }), q(() => l.value, (H) => {
1844
+ v && v(), H.y ? v = Be(() => s.value?.querySelector(".ant-table-body"), (B) => {
1845
+ B && (f.value = B);
1846
+ }) : H.x && (v = Be(() => s.value?.querySelector(".ant-table-content"), (B) => {
1847
+ B && (f.value = B);
1848
+ }));
1849
+ }, { immediate: !0 });
1850
+ const { height: h } = He(s), { height: E } = He(b), { height: A } = He($), { height: F } = He(u), N = T(() => !s.value || !e.value ? 0 : h.value - E.value - m.value - F.value), L = T(() => N.value && e.value ? A.value <= N.value : !1);
1851
+ q([
1852
+ () => f.value,
1853
+ () => N.value
1854
+ ], () => {
1855
+ f.value && e.value && f.value.setAttribute("style", `height: ${N.value}px;`);
1856
+ }), $l(f, {
1857
+ onScroll: () => {
1858
+ f.value && o.value?.handleScroll(f.value);
1859
+ }
1860
+ });
1861
+ const K = () => {
1862
+ o.value?.update();
1863
+ };
1864
+ Rl(f, K), nt(() => {
1865
+ ot(() => {
1866
+ K();
1867
+ });
1868
+ }), Jt(() => K());
1869
+ function k() {
1870
+ S && S(), v && v(), i && i(), x && x();
1871
+ }
1872
+ return St(() => {
1873
+ k();
1874
+ }), xt(() => {
1875
+ k && k();
1876
+ }), Jl({
1877
+ className: `${n}-scroll`,
1878
+ hashId: a,
1879
+ tableScrollYHeight: N,
1880
+ tableHeaderHeight: E,
1881
+ scrollbarElement: s,
1882
+ wrapElement: f
1883
+ }), {
1884
+ barRef: o,
1885
+ tableCardEl: s,
1886
+ tableScrollEl: f,
1887
+ tableOverHidden: L,
1888
+ tableScrollYHeight: N,
1889
+ tableListToolsHeight: m
1890
+ };
1891
+ }
1892
+ function wa(e) {
1893
+ const a = {};
1894
+ return e.forEach((l) => {
1895
+ let n = l.initialValue;
1896
+ const o = ["select", "number"], s = ["date", "time", "dateRange"], u = ["treeSelect", "numberRange"];
1897
+ l.valueType ? !n && o.includes(l.valueType) ? n = void 0 : !n && s.includes(l.valueType) ? n = null : !n && u.includes(l.valueType) ? n = [] : n || (n = "") : n || (n = ""), l.name === "dateRange" ? (a[l.rangeStartName || "start"] = n ? n[0] : null, a[l.rangeEndName || "end"] = n ? n[1] : null) : l.name && (a[l.name] = n);
1898
+ }), a;
1899
+ }
1900
+ function $a({ searchMap: e, columns: a }) {
1901
+ const l = w([]), n = w({});
1902
+ function o(s) {
1903
+ s.forEach((b) => {
1904
+ l.value.some((f) => f.name === b.name) ? l.value = l.value.map((f) => f.name === b.name ? { ...f, ...b } : f) : l.value.push(b);
1905
+ });
1906
+ const u = wa(s);
1907
+ n.value = { ...n.value, ...u };
1908
+ }
1909
+ return q(() => e.value, () => {
1910
+ const s = [];
1911
+ e.value?.forEach((u) => s.push(u)), o(s);
1912
+ }, { deep: !0, immediate: !0 }), q(() => a.value, () => {
1913
+ const s = [];
1914
+ a.value && a.value?.length && a.value.forEach((u) => {
1915
+ u.searchConfig && s.push(u.searchConfig);
1916
+ }), o(s);
1917
+ }, { deep: !0, immediate: !0 }), { formCols: l, defaultFormSearch: n };
1918
+ }
1919
+ function Ra({ scroll: e, columns: a, autoScroll: l, modalScroll: n, neverScroll: o, rowSelection: s, screens: u, innerWidth: b, scrollBreakpoint: f }) {
1920
+ const $ = T(() => f.value ? Ce(f.value) ? b.value > f.value : Ft(f.value) ? u.value?.[f.value] : u.value?.xl : u.value?.xl), m = T(() => {
1921
+ let v = 0;
1922
+ const i = R(s) ? 60 : 0, x = 150, h = ae(R(a));
1923
+ h.forEach((F) => {
1924
+ v += Number.parseInt(String(F.width)) || 0;
1925
+ });
1926
+ const A = h.filter((F) => !Reflect.has(F, "width")).length;
1927
+ return A !== 0 && (v += A * x), i && (v += i), v;
1928
+ });
1929
+ return { proScroll: T(() => o.value ? {} : e.value && Rt(e.value).length ? R(e) : n.value ? {
1930
+ y: e.value?.y || (u.value?.xl ? 400 : 235)
1931
+ } : l.value ? $.value ? {} : De($.value) ? { x: m.value } : {} : {}), breakpoint: $ };
1932
+ }
1933
+ function Pa(e) {
1934
+ const a = w(e.size.value || "middle");
1935
+ q(() => e.size.value, (n) => a.value = n);
1936
+ function l(n) {
1937
+ a.value = n || a.value;
1938
+ }
1939
+ return [a, l];
1940
+ }
1941
+ const Fa = (e) => ({
1942
+ [e.componentCls]: {
1943
+ [`${e.componentCls}-list`]: {
1944
+ clear: "both",
1945
+ maxWidth: "100%",
1946
+ [`${e.componentCls}-pagination${e.antCls}-pagination`]: {
1947
+ marginTop: e.margin
1948
+ },
1949
+ [`${e.componentCls}-pagination`]: {
1950
+ display: "flex",
1951
+ flexWrap: "wrap",
1952
+ rowGap: e.paddingXS,
1953
+ "> *": {
1954
+ flex: "none"
1955
+ },
1956
+ "&-left": {
1957
+ justifyContent: "flex-start"
1958
+ },
1959
+ "&-center": {
1960
+ justifyContent: "center"
1961
+ },
1962
+ "&-right": {
1963
+ justifyContent: "flex-end"
1964
+ }
1965
+ }
1966
+ }
1967
+ }
1968
+ }), Ze = () => ({
1969
+ scrollbarWidth: "none",
1970
+ "&::-webkit-scrollbar": {
1971
+ width: 0,
1972
+ height: 0
1973
+ }
1974
+ }), Ia = (e) => {
1975
+ const a = new gt(e.colorText).setAlpha(0.2).toRgbString(), l = new gt(e.colorText).setAlpha(0.4).toRgbString();
1976
+ return {
1977
+ [e.componentCls]: {
1978
+ [`${e.antCls}-table-container`]: {
1979
+ position: "relative"
1980
+ },
1981
+ [`${e.componentCls}-scroll`]: {
1982
+ "&-bar": {
1983
+ position: "absolute",
1984
+ right: 2,
1985
+ bottom: 2,
1986
+ zIndex: 9999,
1987
+ borderRadius: e.borderRadius - 2,
1988
+ "&.is-vertical": {
1989
+ top: 2,
1990
+ width: 6,
1991
+ "& > div": {
1992
+ width: "100%"
1993
+ }
1994
+ },
1995
+ "&.is-horizontal": {
1996
+ left: 2,
1997
+ height: 6,
1998
+ "& > div": {
1999
+ height: "100%"
2000
+ }
2001
+ }
2002
+ },
2003
+ "&-thumb": {
2004
+ position: "relative",
2005
+ display: "block",
2006
+ width: 0,
2007
+ height: 0,
2008
+ cursor: "pointer",
2009
+ opacity: 1,
2010
+ backgroundColor: a,
2011
+ borderRadius: "inherit",
2012
+ transition: ".3s background-color",
2013
+ "&:hover": {
2014
+ opacity: 1,
2015
+ backgroundColor: l
2016
+ }
2017
+ }
2018
+ },
2019
+ [`${e.antCls}-table-content`]: Ze(),
2020
+ [`${e.antCls}-table-body`]: Ze(),
2021
+ [`${e.antCls}-table-empty`]: {
2022
+ [`${e.antCls}-table-content`]: Ze()
2023
+ }
2024
+ }
2025
+ };
2026
+ }, Aa = (e) => {
2027
+ const a = `${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`;
2028
+ return {
2029
+ [e.componentCls]: {
2030
+ [`&${e.componentCls}-full-page`]: {
2031
+ flex: 1,
2032
+ height: "100%",
2033
+ overflow: "hidden",
2034
+ [`${e.componentCls}-content`]: {
2035
+ display: "flex",
2036
+ flexDirection: "column",
2037
+ height: "100%",
2038
+ overflow: "hidden",
2039
+ [`${e.componentCls}-card`]: {
2040
+ position: "relative",
2041
+ flex: 1,
2042
+ overflow: "hidden",
2043
+ [`${e.componentCls}-overflow-hidden`]: {
2044
+ [`${e.antCls}-table${e.antCls}-table-bordered>${e.antCls}-table-container`]: {
2045
+ borderBlockEnd: a,
2046
+ [`${e.antCls}-table-body`]: {
2047
+ borderInlineEnd: a
2048
+ },
2049
+ [`${e.antCls}-table-row`]: {
2050
+ [`${e.antCls}-table-cell`]: {
2051
+ "&:last-child": {
2052
+ borderRightWidth: 0
2053
+ }
2054
+ }
2055
+ }
2056
+ }
2057
+ },
2058
+ [`${e.componentCls}-list`]: {
2059
+ overflow: "auto"
2060
+ }
2061
+ }
2062
+ }
2063
+ }
2064
+ }
2065
+ };
2066
+ }, Ba = (e) => ({
2067
+ [e.componentCls]: {
2068
+ [`${e.componentCls}-card`]: {
2069
+ [`${e.antCls}-table-pagination${e.antCls}-pagination`]: {
2070
+ margin: 0,
2071
+ marginTop: e.margin
2072
+ }
2073
+ },
2074
+ [`${e.antCls}-table`]: {
2075
+ [`${e.antCls}-table-cell-ellipsis`]: {
2076
+ overflow: "unset",
2077
+ whiteSpace: "unset"
2078
+ }
2079
+ },
2080
+ "&-empty-text": {
2081
+ display: "flex",
2082
+ flexDirection: "column",
2083
+ alignItems: "center",
2084
+ justifyContent: "center",
2085
+ marginBlock: e.marginXL
2086
+ },
2087
+ "&-table-tree": {
2088
+ [`${e.antCls}-table-row-cell-ellipsis`]: {
2089
+ overflow: "hidden",
2090
+ textOverflow: "ellipsis",
2091
+ whiteSpace: "nowrap",
2092
+ [`${e.antCls}-table-column-title`]: {
2093
+ overflow: "hidden",
2094
+ textOverflow: "ellipsis",
2095
+ whiteSpace: "nowrap"
2096
+ }
2097
+ }
2098
+ },
2099
+ "&-full-screen": {
2100
+ [`${e.componentCls}-content`]: {
2101
+ height: "100% !important",
2102
+ padding: 24,
2103
+ backgroundColor: e.colorWhite,
2104
+ boxShadow: "0 4px 8px #0003, 0 6px 20px #00000030 !important"
2105
+ }
2106
+ },
2107
+ "&-no-scroll": {
2108
+ [`${e.antCls}-table`]: {
2109
+ table: {
2110
+ width: "100% !important",
2111
+ minWidth: "unset"
2112
+ }
2113
+ },
2114
+ [`${e.antCls}-table-ping-right:not(${e.antCls}-table-has-fix-right)`]: {
2115
+ [`${e.antCls}-table-container::after`]: {
2116
+ boxShadow: "none"
2117
+ }
2118
+ },
2119
+ [`${e.antCls}-table-bordered ${e.antCls}-table-fixed-left ${e.antCls}-table-thead > tr > th`]: {
2120
+ "&:last-child": {
2121
+ borderRight: 0
2122
+ }
2123
+ },
2124
+ [`${e.antCls}-table-bordered ${e.antCls}-table-fixed-left ${e.antCls}-table-tbody > tr > td`]: {
2125
+ "&:last-child": {
2126
+ borderRight: 0
2127
+ }
2128
+ }
2129
+ },
2130
+ "&-card-border": {
2131
+ paddingInline: e.paddingMD,
2132
+ paddingBlock: e.paddingMD,
2133
+ border: `${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,
2134
+ borderRadius: e.borderRadiusLG,
2135
+ backgroundColor: e.colorBgContainer,
2136
+ [`${e.antCls}-table-wrapper ${e.antCls}-table-pagination${e.antCls}-pagination`]: {
2137
+ marginBottom: 0
2138
+ }
2139
+ },
2140
+ [`${e.componentCls}-copyable`]: {
2141
+ display: "flex",
2142
+ alignItems: "center",
2143
+ [`${e.componentCls}-copyable-icon`]: {
2144
+ marginLeft: 8,
2145
+ color: e.colorPrimary,
2146
+ cursor: "pointer"
2147
+ }
2148
+ },
2149
+ [`${e.componentCls}-ellipsis`]: {
2150
+ overflow: "hidden",
2151
+ textOverflow: "ellipsis",
2152
+ display: "-webkit-box",
2153
+ "-webkit-box-orient": "vertical",
2154
+ "word-break": "break-word"
2155
+ },
2156
+ [`${e.componentCls}-action-size`]: {
2157
+ display: "inline-block"
2158
+ },
2159
+ [`${e.componentCls}-action-columns`]: {
2160
+ display: "inline-block",
2161
+ [`${e.antCls}-popover-inner-content`]: {
2162
+ padding: "8px 0 8px 16px"
2163
+ },
2164
+ [`${e.antCls}-tree ${e.antCls}-tree-switcher-noop`]: {
2165
+ display: "none"
2166
+ },
2167
+ [`${e.antCls}-tree > ${e.antCls}-tree-treenode`]: {
2168
+ width: "100%",
2169
+ alignItems: "center",
2170
+ "&:first-child": {
2171
+ paddingTop: 0
2172
+ },
2173
+ "&:last-child": {
2174
+ paddingBottom: 4
2175
+ },
2176
+ "&:hover": {
2177
+ backgroundColor: "#e6f7ff",
2178
+ [`${e.componentCls}-action-columns-list-item-actions`]: {
2179
+ display: "block"
2180
+ }
2181
+ }
2182
+ },
2183
+ [`${e.antCls}-tree ${e.antCls}-tree-node-content-wrapper`]: {
2184
+ flex: "1",
2185
+ "&:hover": {
2186
+ backgroundColor: "transparent"
2187
+ }
2188
+ },
2189
+ "&-popover-title": {
2190
+ display: "flex",
2191
+ alignItems: "center",
2192
+ justifyContent: "space-between",
2193
+ "&-check": {
2194
+ marginRight: 8
2195
+ },
2196
+ [`${e.antCls}-btn-sm`]: {
2197
+ padding: 0
2198
+ }
2199
+ },
2200
+ "&-list-group": {
2201
+ marginTop: 6,
2202
+ marginBottom: 6,
2203
+ fontSize: 12,
2204
+ color: "rgba(0, 0, 0, 0.45)"
2205
+ },
2206
+ "$-list-item": {
2207
+ display: "flex",
2208
+ alignItems: "center",
2209
+ justifyContent: "space-between",
2210
+ "&-actions": {
2211
+ display: "block",
2212
+ float: "right",
2213
+ cursor: "pointer",
2214
+ "> span + span": {
2215
+ marginLeft: 8
2216
+ },
2217
+ "&-disabled": {
2218
+ action: {
2219
+ color: "rgba(0, 0, 0, 0.25)"
2220
+ }
2221
+ },
2222
+ anticon: {
2223
+ color: e.colorPrimary
2224
+ }
2225
+ }
2226
+ }
2227
+ },
2228
+ [`${e.antCls}-tooltip-inner`]: {
2229
+ a: {
2230
+ color: e.colorWhite
2231
+ }
2232
+ }
2233
+ }
2234
+ });
2235
+ function Na(e) {
2236
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
2237
+ }
2238
+ const za = Nt.PRESENTED_IMAGE_SIMPLE, Da = {
2239
+ reload: !0,
2240
+ fullScreen: !0
2241
+ }, Oa = Bl.useToken, et = /* @__PURE__ */ ge({
2242
+ name: "GProTable",
2243
+ inheritAttrs: !1,
2244
+ props: he,
2245
+ emits: ["reset", "reload", "submit", "sizeChange", "expandedRowsChange", "expand", "change", "requestError", "columnsStateChange", "loadingChange"],
2246
+ slots: Object,
2247
+ setup(e, {
2248
+ emit: a,
2249
+ slots: l,
2250
+ expose: n
2251
+ }) {
2252
+ const o = $t({
2253
+ suffixCls: "table",
2254
+ isPor: !0
2255
+ }), {
2256
+ wrapSSR: s,
2257
+ hashId: u
2258
+ } = rt("ProBaseTable", [Ba, Ia, Aa, Fa], o), {
2259
+ token: b
2260
+ } = Oa(), f = ul(), $ = it(), {
2261
+ width: m
2262
+ } = Pl(), S = w(!1), v = Tt(), i = w(), x = w(), h = w(e.waitRequest);
2263
+ yt(() => h.value = e.waitRequest);
2264
+ const {
2265
+ toggle: E,
2266
+ isFullscreen: A
2267
+ } = It(i), F = T(() => !$.value.xl), N = T(() => (e.virtualScroll && Ll(!e.scroll?.y, "参数scroll的Y值不能为空!"), !!(e.scroll?.y && e.virtualScroll))), L = T(() => {
2268
+ if (e.form === !1) return !1;
2269
+ const p = {
2270
+ actions: {
2271
+ resetReload: !0
2272
+ },
2273
+ resetText: "重置",
2274
+ searchText: "查询"
2275
+ };
2276
+ return ne(e.form) ? ye(p, e.form) : p;
2277
+ }), K = T(() => L.value === !1 ? {} : L.value), k = T(() => K.value?.autoRequest ?? e.autoRequest), H = T(() => K.value?.actions), B = T(() => {
2278
+ const p = e.columns.filter((I) => I.key || I.dataIndex).map((I) => {
2279
+ const P = I.key || I.dataIndex;
2280
+ return I.key = P, I.dataIndex = P, I.align = I.align || e.align, I.uuid = I.uuid || Pt().uuid(15), I;
2281
+ });
2282
+ return gl(p, {
2283
+ align: e.align || "left",
2284
+ showIndex: e.showIndex ?? !1
2285
+ });
2286
+ }), [X, O] = ga({
2287
+ loading: V(e, "loading")
2288
+ }), [W, Y] = Pa({
2289
+ size: V(e, "size")
2290
+ }), {
2291
+ paginationInfo: M,
2292
+ requestPagination: ee,
2293
+ setPagination: re
2294
+ } = ba({
2295
+ pagination: V(e, "pagination"),
2296
+ pageItemRender: vt({
2297
+ slots: l,
2298
+ props: e,
2299
+ key: "pageItemRender"
2300
+ })
2301
+ }), {
2302
+ proScroll: se,
2303
+ breakpoint: be
2304
+ } = Ra({
2305
+ scroll: V(e, "scroll"),
2306
+ autoScroll: V(e, "autoScroll"),
2307
+ modalScroll: V(e, "modalScroll"),
2308
+ neverScroll: V(e, "neverScroll"),
2309
+ rowSelection: V(e, "rowSelection"),
2310
+ scrollBreakpoint: V(e, "scrollBreakpoint"),
2311
+ innerWidth: m,
2312
+ columns: B,
2313
+ screens: $
2314
+ }), {
2315
+ proColumns: de,
2316
+ setColumns: Re,
2317
+ resizeColumnWidth: oe
2318
+ } = fa({
2319
+ draggable: V(e, "draggable"),
2320
+ neverScroll: V(e, "neverScroll"),
2321
+ autoScroll: V(e, "autoScroll"),
2322
+ breakpoint: be,
2323
+ scroll: se,
2324
+ columns: B
2325
+ }), {
2326
+ formCols: Pe,
2327
+ defaultFormSearch: t
2328
+ } = $a({
2329
+ searchMap: V(e, "searchMap"),
2330
+ columns: B
2331
+ }), {
2332
+ selectedKeys: r,
2333
+ selectedItems: y,
2334
+ changeRowKey: g,
2335
+ selectRowKey: C,
2336
+ selectAllRowKey: c,
2337
+ syncSelectedRows: fe,
2338
+ removeRowKeys: U,
2339
+ clearAllRowKeys: Fe
2340
+ } = pa(V(e, "rowKey"), V(e, "rowSelection")), ve = ma(e), {
2341
+ run: ue,
2342
+ setTableDataList: Ie,
2343
+ operateTableDataRow: Se,
2344
+ isTreeDataRef: xe,
2345
+ dataSource: ie,
2346
+ handleTableChange: ke
2347
+ } = ha({
2348
+ ...ve,
2349
+ waitRequest: h
2350
+ }, {
2351
+ loading: X,
2352
+ pageInfo: ee,
2353
+ setPagination: re,
2354
+ removeRowKeys: U,
2355
+ syncSelectedRows: fe,
2356
+ setLoading: O,
2357
+ setColumns: Re,
2358
+ columns: de,
2359
+ defaultFormSearch: t,
2360
+ params: V(e, "params"),
2361
+ onRequestError: e.onRequestError,
2362
+ onBeforeSearchSubmit: e.onBeforeSearchSubmit,
2363
+ hasCustomRender: T(() => Qe(e.customRender || l?.customRender))
2364
+ }, a), {
2365
+ tableCardEl: Ve,
2366
+ tableScrollYHeight: Oe,
2367
+ tableListToolsHeight: Ht,
2368
+ tableScrollEl: st,
2369
+ tableOverHidden: Wt,
2370
+ barRef: Yt
2371
+ } = Ta({
2372
+ hashId: u,
2373
+ scroll: se,
2374
+ baseClassName: o,
2375
+ fitPage: V(e, "fitPage")
2376
+ }), ut = T(() => {
2377
+ const p = Oe.value && e.fitPage ? {
2378
+ y: Oe.value
2379
+ } : {};
2380
+ return {
2381
+ ...R(se),
2382
+ ...p
2383
+ };
2384
+ }), Mt = T(() => ({
2385
+ size: R(W),
2386
+ scroll: R(ut),
2387
+ dataSource: R(ie),
2388
+ pagination: R(M),
2389
+ virtualScroll: N.value,
2390
+ columns: R(de).filter((p) => p.show || p.show === void 0)
2391
+ })), ct = T(() => {
2392
+ const p = ne(e.loading) ? ze(e.loading, "spinning") : {};
2393
+ return !p.indicator && v?.indicator?.value && (p.indicator = v?.indicator?.value), {
2394
+ spinning: e.showLoading ? Qe(X.value) : !1,
2395
+ ...p
2396
+ };
2397
+ }), qt = T(() => {
2398
+ let p;
2399
+ const I = e.direction === "rtl" ? "bottomLeft" : "right", P = R(M)?.position;
2400
+ if (P !== null && Array.isArray(P)) {
2401
+ const z = P.find((te) => te.includes("top")), j = P.find((te) => te.includes("bottom")), _ = P.every((te) => `${te}` == "none");
2402
+ !z && !j && !_ && (p = I), z && (p = z.toLowerCase().replace("top", "")), j && (p = j.toLowerCase().replace("bottom", ""));
2403
+ } else
2404
+ p = I;
2405
+ return p;
2406
+ });
2407
+ da(() => {
2408
+ S.value ? e.keepAliveReload && ue({
2409
+ params: e.params
2410
+ }) : S.value = !0;
2411
+ });
2412
+ const Kt = async (p, I) => {
2413
+ if (k.value) {
2414
+ ue({
2415
+ params: p
2416
+ });
2417
+ return;
2418
+ }
2419
+ I === "reset" ? (a("reset", p), e.request && H.value?.resetReload && ue({
2420
+ params: p
2421
+ })) : e.request && (a("submit", p), ue({
2422
+ params: p
2423
+ }));
2424
+ }, Xe = (p, I, P, z) => {
2425
+ ke(p, I, P, z), a("change", p, I, P, z);
2426
+ }, kt = (p) => {
2427
+ a("expandedRowsChange", p);
2428
+ }, Vt = (p, I) => {
2429
+ a("expand", p, I);
2430
+ }, Xt = (p, I) => oe(p, I), _t = (p, I, P) => {
2431
+ let z = p;
2432
+ if (I) {
2433
+ const j = J(p) ? typeof p?.[0]?.children == "string" ? p?.[0]?.children : "" : p ? p.toString() : "", _ = P.tooltip === !1 ? {} : P.tooltip, te = P.tooltip === !1 ? 1 : Ce(_?.hiddenLine) && _?.hiddenLine > 0 ? _?.hiddenLine : 1, G = P.tooltip === !1 ? 0 : Ce(_?.width) ? _?.width : 0, Ee = P.tooltip !== !1 && Ft(j) && G > 0 ? yl(j, {
2434
+ cssObject: {
2435
+ fontSize: "14px",
2436
+ lineHeight: "22px",
2437
+ fontFamily: f?.token?.value?.fontFamily || b?.value?.fontFamily,
2438
+ ..._?.targetStyle || {}
2439
+ }
2440
+ }) : 0, Le = document.querySelector(`.${o} .ant-table-tbody`), je = d("div", {
2441
+ class: `${o}-ellipsis-text`
2442
+ }, [p]), ft = () => P.tooltip === !1 || ne(P.tooltip) && Ee < G && G > 0 ? je : d($e, Q({
2443
+ title: p,
2444
+ getPopupContainer: (_e) => Le ?? _e?.parentNode?.parentNode
2445
+ }, ne(P.tooltip) ? P.tooltip : {}, {
2446
+ destroyTooltipOnHide: !0
2447
+ }), Na(je) ? je : {
2448
+ default: () => [je]
2449
+ });
2450
+ if (z = d("div", {
2451
+ class: D(`${o}-ellipsis`, _?.class),
2452
+ style: {
2453
+ "-webkit-line-clamp": te
2454
+ }
2455
+ }, [ft()]), P.copyable) {
2456
+ const _e = typeof P.copyText == "function" ? P.copyText?.(P) : P.copyText || j;
2457
+ z = d("div", {
2458
+ class: `${o}-copyable`
2459
+ }, [d("div", {
2460
+ class: D(`${o}-ellipsis`, _?.class),
2461
+ style: {
2462
+ "-webkit-line-clamp": te
2463
+ }
2464
+ }, [ft()]), d(il, {
2465
+ class: `${o}-copyable-icon`,
2466
+ onClick: () => {
2467
+ xa(_e), Dl.success("复制成功");
2468
+ }
2469
+ }, null)]);
2470
+ }
2471
+ }
2472
+ return z;
2473
+ };
2474
+ function dt() {
2475
+ const p = Cl({
2476
+ slots: l,
2477
+ props: e,
2478
+ key: "emptyText"
2479
+ });
2480
+ if (p !== !1 && v?.emptyText?.value !== !1) {
2481
+ const P = e.emptyTextProps?.extraProps || {}, z = p || v?.emptyText?.value, j = le(z), _ = j ? pt(z, P) : wt(J(z) ? z : [z]);
2482
+ return d("div", {
2483
+ class: D(`${o}-empty-text`, u.value, e.emptyTextProps?.class),
2484
+ style: e.emptyTextProps?.style
2485
+ }, [j ? _ : J(_) && _.length ? _.map((te) => lt(te, P)) : d(Nt, {
2486
+ image: za
2487
+ }, null)]);
2488
+ }
2489
+ return null;
2490
+ }
2491
+ const Gt = () => {
2492
+ const p = vt({
2493
+ slots: l,
2494
+ props: e,
2495
+ key: "customRender"
2496
+ });
2497
+ if (p) {
2498
+ if (ie.value?.length) {
2499
+ const I = ae(R(ie));
2500
+ return p?.({
2501
+ dataSource: I,
2502
+ currentData: Sa(I, M.value)
2503
+ });
2504
+ }
2505
+ return dt();
2506
+ }
2507
+ return d(we, null, null);
2508
+ };
2509
+ return Hl({
2510
+ tableScrollState: ut,
2511
+ tableSize: W,
2512
+ columns: de,
2513
+ cacheColumns: B,
2514
+ isMobile: F,
2515
+ formConfig: K,
2516
+ formAutoRequest: k,
2517
+ formActions: H,
2518
+ screenWidth: m,
2519
+ tableListToolsHeight: Ht,
2520
+ styles: V(e, "styles"),
2521
+ classNames: V(e, "classNames"),
2522
+ action: {
2523
+ setTableSize: Y,
2524
+ reload: (p) => ue(p),
2525
+ toggle: E
2526
+ },
2527
+ setPagination: re
2528
+ }), n({
2529
+ formRef: () => ({
2530
+ getFormSearch: () => ({
2531
+ ...R(t),
2532
+ ...x.value?.getFormSearch(),
2533
+ ...e.params
2534
+ }),
2535
+ getFormInnerState: () => x.value?.getFormSearch() || {},
2536
+ restFormState: (p) => {
2537
+ h.value = !0, p && p?.(), x.value?.resetForm(!1), h.value = !1;
2538
+ }
2539
+ }),
2540
+ actionRef: () => ({
2541
+ loading: X,
2542
+ dataSource: ie,
2543
+ pageInfo: ee,
2544
+ pagination: M.value,
2545
+ selectedKeys: T(() => r.value),
2546
+ selectedItems: T(() => y.value),
2547
+ rowsSelection: {
2548
+ clear: Fe,
2549
+ select: C,
2550
+ remove: U,
2551
+ sync: fe,
2552
+ selectAll: c
2553
+ },
2554
+ reload: ue,
2555
+ getLoadingStatus: () => R(X),
2556
+ reloadAndReset: async (p) => {
2557
+ h.value = !0, re({
2558
+ current: 1,
2559
+ pageSize: ee?.pageSize || 10
2560
+ }), p && p?.callBack && (p.wait ? await p.callBack() : p.callBack()), x.value?.resetForm(!0), h.value = !1;
2561
+ },
2562
+ setPageInfo: Xe,
2563
+ setTableDataList: Ie,
2564
+ setPagination: re,
2565
+ operateTableDataRow: Se,
2566
+ setLoading: O
2567
+ })
2568
+ }), () => {
2569
+ const p = Qe(e.customRender || l.customRender), I = l.actions?.() || e.actionProps?.actions, P = bl({
2570
+ slots: l,
2571
+ props: e,
2572
+ keys: ["headerTitle", "headerTitleTip", "listToolAfter"],
2573
+ render: !0
2574
+ });
2575
+ return s(d("div", {
2576
+ ref: i,
2577
+ class: D(o, u.value, e.class, e.classNames?.root, [{
2578
+ [`${o}-no-scroll`]: !Object.keys(R(se) || {}).length,
2579
+ [`${o}-table-tree`]: xe.value,
2580
+ [`${o}-full-page`]: e.fitPage,
2581
+ [`${o}-full-screen`]: A.value
2582
+ }]),
2583
+ style: {
2584
+ ...e.style,
2585
+ ...e.styles?.root || {}
2586
+ }
2587
+ }, [d("div", {
2588
+ class: D(`${o}-content`, u.value, e.classNames?.content),
2589
+ style: e.styles?.content
2590
+ }, [(Pe.value.length > 0 || !!l.form) && e.form !== !1 && d(Ul, {
2591
+ ref: x,
2592
+ modalScroll: e.modalScroll,
2593
+ cardBordered: e.cardBordered,
2594
+ formCols: Pe.value,
2595
+ prefixCls: o,
2596
+ loading: R(X),
2597
+ onSearch: Kt,
2598
+ defaultFormSearch: t.value
2599
+ }, {
2600
+ default: l.form ? () => l.form?.() : null
2601
+ }), d("div", {
2602
+ ref: Ve,
2603
+ class: D(e.classNames?.card, u.value, `${o}-card`, e.cardBordered && `${o}-card-border`),
2604
+ style: e.styles?.card
2605
+ }, [d(ua, {
2606
+ options: e.options ? {
2607
+ ...Da,
2608
+ ...ne(e.options) ? e.options : {}
2609
+ } : !1,
2610
+ titleTipText: e.titleTipText,
2611
+ actionsPlacement: e.actionProps?.placement,
2612
+ actionsRender: I,
2613
+ headerTitle: P.headerTitle,
2614
+ listToolAfter: P.listToolAfter,
2615
+ headerTitleTip: P.headerTitleTip
2616
+ }, null), p ? d(Bt, ct.value, {
2617
+ default: () => [d("div", {
2618
+ class: D(`${o}-list ${u.value}`, e.classNames?.list),
2619
+ style: e.styles?.list
2620
+ }, [d("div", {
2621
+ class: D(`${o}-list-content`, u.value, e.classNames?.listContent),
2622
+ style: {
2623
+ ...e.styles?.listContent || {},
2624
+ height: Oe.value ? pe(Oe.value) : e.styles?.listContent?.height
2625
+ }
2626
+ }, [Gt()]), e.pagination !== !1 && ie.value?.length > 0 && d(Nl, Q(ce(R(M)), {
2627
+ class: D(u.value, `${o}-pagination`, `${o}-pagination-${qt.value}`, e.classNames?.pagination),
2628
+ style: e.styles?.pagination,
2629
+ onChange: (z, j) => Xe({
2630
+ current: z,
2631
+ pageSize: j
2632
+ })
2633
+ }), null)])]
2634
+ }) : d(we, null, [d(zl, Q(Ol(e, Object.keys(Ot)), Mt.value, {
2635
+ style: e.styles?.table,
2636
+ class: D(e.classNames?.table, u.value, Wt.value && `${o}-overflow-hidden`),
2637
+ loading: ct.value,
2638
+ rowKey: (z) => z[e.rowKey],
2639
+ transformCellText: (z) => {
2640
+ e.transformCellText && typeof e.transformCellText && e.transformCellText?.(z);
2641
+ const {
2642
+ column: j
2643
+ } = z;
2644
+ if (!j) return z.text;
2645
+ const _ = j?.key || j?.dataIndex;
2646
+ let te = !0, G = z.text;
2647
+ if (J(G))
2648
+ if (G.length === 0 || G.length === 1 && !le(G[0])) {
2649
+ G = G?.[0];
2650
+ const Ee = pl(G, j?.columnEmptyText || e?.columnEmptyText || "");
2651
+ te = Ee.success, G = Ca(Ee.value, j?.valueType || e.columns?.find((Le) => (Le.key || Le.dataIndex) === _)?.valueType, o, u.value);
2652
+ } else G[0]?.type === "template" && (G = G[0]?.children);
2653
+ return j?.ellipsis ? _t(G, te, j) : G;
2654
+ },
2655
+ rowSelection: e.rowSelection ? {
2656
+ ...ze(e.rowSelection, ["onSelect", "onSelectAll", "onChange", "selectedRowKeys"]),
2657
+ selectedRowKeys: r.value || [],
2658
+ onSelect: C,
2659
+ onSelectAll: c,
2660
+ onChange: g
2661
+ } : void 0,
2662
+ onChange: Xe,
2663
+ onExpandedRowsChange: kt,
2664
+ onExpand: Vt,
2665
+ onResizeColumn: (z, j) => Xt(z, j)
2666
+ }), {
2667
+ ...l,
2668
+ emptyText: () => dt()
2669
+ }), st.value && !p && d(Zt, {
2670
+ to: st.value
2671
+ }, {
2672
+ default: () => [d(aa, {
2673
+ ref: Yt
2674
+ }, null)]
2675
+ })])])])]));
2676
+ };
2677
+ }
2678
+ });
2679
+ et.install = (e) => (e.component(et.name, et), e);
2680
+ function Ua(e, a) {
2681
+ function l() {
2682
+ const m = {
2683
+ params: {},
2684
+ searchMap: []
2685
+ };
2686
+ if (a?.state) {
2687
+ if (Ge(a.state) && ne(a.state.value))
2688
+ return ye(m, ae(a.state.value));
2689
+ if (ne(a.state) && !Ge(a.state))
2690
+ return ye(m, ae(a.state));
2691
+ }
2692
+ return m;
2693
+ }
2694
+ const n = at(ye(l(), {
2695
+ request: a?.request
2696
+ }));
2697
+ a?.state && q(() => a.state && Ge(a.state) ? a.state.value : a.state, () => {
2698
+ f();
2699
+ }, { deep: !0 });
2700
+ const o = T(() => e.value ? e.value.actionRef() : {}), s = T(() => e.value ? e.value.formRef() : {}), u = T(() => ({
2701
+ ...o.value.pageInfo || {},
2702
+ ...s.value.getFormSearch?.() || {}
2703
+ })), b = w(!!o.value.loading?.value);
2704
+ q(() => o.value.loading?.value, (m) => {
2705
+ b.value = !!m;
2706
+ }), q(b, (m) => {
2707
+ o.value?.setLoading?.(!!m);
2708
+ });
2709
+ function f() {
2710
+ Sl(n, l());
2711
+ }
2712
+ function $(m, S) {
2713
+ n.searchMap && (n.searchMap = ae(n.searchMap).map((v) => v.name === m ? ye(v, S) : v));
2714
+ }
2715
+ return {
2716
+ formRef: s,
2717
+ actionRef: o,
2718
+ tableState: n,
2719
+ requestSearch: u,
2720
+ loading: b,
2721
+ dataSource: T(() => o?.value?.dataSource?.value || []),
2722
+ selectedKeys: T(() => o?.value?.selectedKeys?.value || []),
2723
+ selectedItems: T(() => o?.value?.selectedItems?.value || []),
2724
+ rowsSelection: o?.value?.rowsSelection,
2725
+ setTableDataList: (m) => o.value?.setTableDataList?.(m),
2726
+ reloadAndReset: (m) => o.value?.reloadAndReset?.(m),
2727
+ setPageInfo: (m, S, v, i) => o.value?.setPageInfo?.(m, S, v, i),
2728
+ setPagination: (m) => o.value?.setPagination?.(m),
2729
+ setLoading: (m) => b.value = m,
2730
+ operateTableDataRow: (m) => o.value?.operateTableDataRow?.(m),
2731
+ reload: (m) => o.value?.reload?.(m),
2732
+ updateSearchMap: $
2733
+ };
2734
+ }
2735
+ export {
2736
+ et as GProTable,
2737
+ he as proTableProps,
2738
+ Ua as useTable
2739
+ };