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

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 +10 -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 +18 -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 +2735 -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,2735 @@
1
+ /*!
2
+ * Gx Design Pro
3
+ * Version: 0.2.0-beta.139
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 x, watch as q, cloneVNode as tt, reactive as lt, toRaw as ce, computed as T, createVNode as d, Fragment as we, isVNode as le, mergeProps as Q, h as bt, onBeforeUnmount as Gt, onMounted as at, nextTick as nt, watchEffect as pt, unref as F, onActivated as yt, getCurrentInstance as Qt, onUnmounted as Ct, onDeactivated as St, onUpdated as Ut, toRef as V, Teleport as Jt, isRef as _e } from "vue";
13
+ import { UpOutlined as Zt, DownOutlined as el, InfoCircleOutlined as tl, FullscreenExitOutlined as ll, FullscreenOutlined as al, ReloadOutlined as nl, CopyOutlined as ol } from "@ant-design/icons-vue";
14
+ import { useProAppContext as xt } from "@gx-design-vue/pro-app";
15
+ import { useBreakpoint as ot, useMemo as Ne, tryOnUnmounted as il, onMountedOrActivated as sl } from "@gx-design-vue/pro-hooks";
16
+ import { useProStyle as it, unit as pe, useProConfigContext as rl } 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 Tt, getPrefixCls as wt, keysOf as $t, isDeepEqualReact as qe, compareArray as ul, runFunction as cl, getSortIndex as dl, isFunction as Me, handleCurrentPage as fl, getRandomNumber as Rt, deepMerge as ye, forInObject as vl, arrayRepeat as ml, isString as Pt, handleShowIndex as hl, getSlot as ft, convertValueBoolean as Ge, getSlotsProps as gl, handleEmptyField as bl, getTextWidth as pl, getSlotVNode as yl, useDeepMerge as Cl } from "@gx-design-vue/pro-utils";
18
+ import { useDebounceFn as Sl, useEventListener as vt, isClient as xl, useElementBounding as Tl, useFullscreen as Ft, useElementSize as He, useScroll as wl, useResizeObserver as $l, useWindowSize as Rl } from "@vueuse/core";
19
+ import { DatePicker as It, Input as We, TimePicker as Pl, TreeSelect as Fl, Select as Il, InputNumber as Qe, Button as mt, Spin as At, Tooltip as $e, Empty as Bt, theme as Al, Pagination as Bl, Table as Nl, message as zl } from "ant-design-vue";
20
+ import { omit as ze, cloneDeep as Nt, pick as Dl } from "lodash-es";
21
+ import { tableProps as Ol } from "ant-design-vue/es/table/Table";
22
+ import "ant-design-vue/es/_util/props-util";
23
+ import { warning as El } from "ant-design-vue/es/vc-util/warning";
24
+ import Z from "dayjs";
25
+ import { useContext as zt } from "@gx-design-vue/context";
26
+ import { TinyColor as ht } from "@ctrl/tinycolor";
27
+ const Ll = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered", "loading"], Dt = {
28
+ ...ze(Ol(), Ll),
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: jl, useInjectContext: st } = zt("pro-table"), he = {
53
+ ...Dt,
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
+ }, Hl = /* @__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: n
336
+ }) {
337
+ const l = x([]), a = x(e.loading ?? !1), o = x("init"), r = Sl(e.fetch, e.debounceTime || 10);
338
+ return q([() => e.fetch, () => e.manual], () => {
339
+ if (o.value !== "init" && a.value) return;
340
+ const u = e.manual ?? !1;
341
+ e.fetch && !u && (a.value = !0, r().then((b) => {
342
+ l.value = Nt(b), o.value = "success";
343
+ }).catch((b) => {
344
+ console.error(b), o.value = "error";
345
+ }).finally(() => {
346
+ a.value = !1;
347
+ }));
348
+ }, {
349
+ immediate: !0
350
+ }), () => {
351
+ const u = n.default?.();
352
+ return tt(J(u) ? u[0] : u, {
353
+ options: l.value,
354
+ notFoundContent: e.notFoundContent?.(a.value)
355
+ });
356
+ };
357
+ }
358
+ });
359
+ function Wl(e, n) {
360
+ const l = lt({});
361
+ function a() {
362
+ Object.assign(l, ae(ce(e)));
363
+ const r = n.find((u) => u.valueType === "dateRange");
364
+ r && o(r.name || "", e[r.rangeStartName || "start"] ? [
365
+ e[r.rangeStartName || "start"],
366
+ e[r.rangeEndName || "end"]
367
+ ] : []);
368
+ }
369
+ q(() => e, () => {
370
+ a();
371
+ }, { deep: !0, immediate: !0 });
372
+ function o(r, u) {
373
+ l[r] = u;
374
+ }
375
+ return {
376
+ formState: l,
377
+ resetFormState: a,
378
+ changeFormState: o
379
+ };
380
+ }
381
+ const Yl = (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
+ }), Ue = [
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, n) {
497
+ return typeof n == "function" ? n(Z(e)) : Z(e).format(n);
498
+ }
499
+ function Ae(e, n) {
500
+ return n ? "YYYY-MM-DD HH:mm:ss" : e ?? "YYYY-MM-DD";
501
+ }
502
+ const gt = (e, n, l = "string") => {
503
+ if (J(e)) {
504
+ const [a, o] = e;
505
+ let r, u;
506
+ if (Array.isArray(n) ? (r = n[0], u = n[1]) : typeof n == "object" && n.type === "mask" ? (r = n.format, u = n.format) : (r = n, u = n), l === "string") {
507
+ const b = a ? me(a, r) : "", f = o ? me(o, u) : "";
508
+ return [b, f];
509
+ }
510
+ return [Z(a), Z(o)];
511
+ }
512
+ };
513
+ function Ml(e) {
514
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
515
+ }
516
+ const {
517
+ MonthPicker: ql,
518
+ RangePicker: Kl,
519
+ YearPicker: kl,
520
+ WeekPicker: Vl,
521
+ QuarterPicker: Xl
522
+ } = It;
523
+ function _l(e) {
524
+ let n = e.reduce((l, a) => a.order !== void 0 ? Math.max(l, a.order) : l, 0);
525
+ return e.forEach((l) => {
526
+ l.order === void 0 && (n += 1, l.order = n);
527
+ }), e.sort((l, a) => l.order - a.order), e;
528
+ }
529
+ const Gl = {
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
+ }, Ql = /* @__PURE__ */ ge({
544
+ name: "ProTableForm",
545
+ inheritAttrs: !1,
546
+ props: Gl,
547
+ setup(e, {
548
+ slots: n,
549
+ expose: l
550
+ }) {
551
+ const {
552
+ wrapSSR: a,
553
+ hashId: o
554
+ } = it("ProTableForm", [Yl], e.prefixCls), r = xt(), u = ot(), {
555
+ formAutoRequest: b,
556
+ formConfig: f,
557
+ formActions: $,
558
+ screenWidth: v,
559
+ styles: C,
560
+ classNames: m
561
+ } = st(), {
562
+ formState: i,
563
+ resetFormState: w,
564
+ changeFormState: h
565
+ } = Wl(e.defaultFormSearch, e.formCols), O = x(pe(f.value?.gap || 16)), I = T(() => {
566
+ if (f.value?.breakpoint && ne(f.value.breakpoint) && Object.keys(f.value.breakpoint).length)
567
+ return f.value?.breakpoint;
568
+ }), B = x(f.value?.collapsed ?? f.value?.defaultCollapsed), N = T(() => De($.value?.reset) ? $.value?.reset : !b.value), L = T(() => I.value ? k(I.value, v.value) : H(f.value?.span, u.value)), K = T(() => f.value?.label);
569
+ q(() => f.value?.collapsed, (t) => {
570
+ B.value = t;
571
+ });
572
+ function k(t, s) {
573
+ let y = 4;
574
+ const g = Object.keys(t).map((S) => Number(S)).filter((S) => !Number.isNaN(S)).sort((S, c) => c - S);
575
+ for (let S = 0; S < g.length; S += 1) {
576
+ const c = g[S];
577
+ if (t[c] && s >= c) {
578
+ y = t[c];
579
+ break;
580
+ }
581
+ }
582
+ return y;
583
+ }
584
+ function H(t, s) {
585
+ let y = 4;
586
+ for (let g = 0; g < Ue.length; g += 1) {
587
+ const S = Ue[g].value;
588
+ if (s[S]) {
589
+ y = t?.[S] || (e.modalScroll ? 3 : Ue[g].span);
590
+ break;
591
+ }
592
+ }
593
+ return y;
594
+ }
595
+ const A = (t) => {
596
+ B.value = t;
597
+ }, X = (t, s, y) => (t + 1) % s === 0 ? {
598
+ ...y,
599
+ marginRight: pe(0)
600
+ } : {
601
+ ...y,
602
+ marginRight: O.value
603
+ }, E = () => {
604
+ const t = Nt(i), s = e.formCols.find((S) => S.valueType === "text") || "", y = e.formCols.find((S) => S.valueType === "dateRange") || "", g = e.formCols.find((S) => S.valueType === "treeSelect");
605
+ return s && (t[s.name] = i[s.name] || s.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((S) => S[g.valueKey === "text" ? "label" : "value"]).join() : ""), g?.name && J(t[g?.name]) && (t[g.name] = t[g.name].length ? t[g.name].map((S) => S[g.valueKey === "text" ? "label" : "value"]) : "")), t;
606
+ }, W = (t = !1, s) => {
607
+ (b.value || t) && e.onSearch?.(E(), t ? s ? "reset" : "submit" : void 0);
608
+ }, Y = (t, s, y) => {
609
+ const g = i[s.name || ""];
610
+ switch (s.valueType) {
611
+ case "text":
612
+ h(s.name || "", t || "");
613
+ break;
614
+ case "number":
615
+ h(s.name || "", t || void 0);
616
+ break;
617
+ case "numberRange":
618
+ Ce(y?.key) && g && (g[y.key] = t, h(s.name || "", g || []));
619
+ break;
620
+ case "select":
621
+ h(s.name || "", t ?? void 0);
622
+ break;
623
+ case "treeSelect":
624
+ h(s.name || "", t ?? (s.field?.treeCheckable || s.field?.multiple ? [] : null));
625
+ break;
626
+ case "date":
627
+ h(s.name || "", t ? me(t, Ae(s.valueFormat, s.showTime)) : null);
628
+ break;
629
+ case "dateWeek":
630
+ h(s.name || "", t ? me(t, "YYYY-wo") : null);
631
+ break;
632
+ case "dateMonth":
633
+ h(s.name || "", t ? me(t, "YYYY-MM") : null);
634
+ break;
635
+ case "dateQuarter":
636
+ h(s.name || "", t ? me(t, "YYYY-QQ") : null);
637
+ break;
638
+ case "dateYear":
639
+ h(s.name || "", t ? me(t, "YYYY") : null);
640
+ break;
641
+ case "dateRange":
642
+ h(s.name || "", t && J(t) && t.length === 2 ? gt(t, Ae(s.valueFormat, s.showTime)) : null);
643
+ break;
644
+ case "time":
645
+ h(s.name || "", t ? me(t, s.valueFormat || "HH:mm:ss") : null);
646
+ break;
647
+ }
648
+ s.valueType === "treeSelect" || s.valueType, W();
649
+ }, M = (t = !0) => {
650
+ w(), W(!0, t);
651
+ };
652
+ l({
653
+ getFormSearch: () => E(),
654
+ resetForm: M
655
+ });
656
+ const ee = () => {
657
+ const t = r?.emptyText?.value;
658
+ if (t) {
659
+ const s = le(t), y = s ? bt(t) : Tt(t || []);
660
+ return d("div", {
661
+ class: D(`${e.prefixCls}-search-empty-text`, o.value)
662
+ }, [s ? y : J(y) ? y.map((g) => tt(g)) : void 0]);
663
+ }
664
+ }, se = () => (!b.value || N.value) && d("div", {
665
+ class: D(`${e.prefixCls}-search-buttons ${o.value}`, m.value?.searchButtons),
666
+ style: C.value?.searchButtons
667
+ }, [N.value && d(mt, {
668
+ key: "reset",
669
+ onClick: () => M()
670
+ }, {
671
+ default: () => [$.value?.resetText || "重置"]
672
+ }), !b.value && d(mt, {
673
+ key: "submit",
674
+ loading: e.loading,
675
+ type: "primary",
676
+ onClick: () => W(!0)
677
+ }, {
678
+ default: () => [$.value?.searchText || "查询"]
679
+ })]), re = ({
680
+ formItemStyle: t = {},
681
+ collapsed: s,
682
+ collapseRender: y = !0
683
+ }) => d("div", {
684
+ style: {
685
+ ...t,
686
+ ...C.value?.searchControl
687
+ },
688
+ class: D(`${e.prefixCls}-search-control ${o.value}`, m.value?.searchControl)
689
+ }, [d("div", {
690
+ class: D(`${e.prefixCls}-search-control-content ${o.value}`, m.value?.searchContent)
691
+ }, [se(), f.value?.collapseRender !== !1 && y && d(we, null, [typeof f.value?.collapseRender == "function" ? f.value?.collapseRender(s) : d("span", {
692
+ class: D(`${e.prefixCls}-search-control-text ${o.value}`, m.value?.searchText),
693
+ style: C.value?.searchText,
694
+ onClick: () => A(!s)
695
+ }, [s ? "收起" : "展开", s ? d(Zt, null, null) : d(el, null, null)])])])]);
696
+ function be(t) {
697
+ return t === void 0 ? void 0 : t ? d(At, {
698
+ size: "small",
699
+ indicator: r?.indicator?.value
700
+ }, null) : ee();
701
+ }
702
+ function de(t, s) {
703
+ return d(Hl, Q(t.request, {
704
+ loading: t.loading,
705
+ notFoundContent: be
706
+ }), Ml(s) ? s : {
707
+ default: () => [s]
708
+ });
709
+ }
710
+ const Re = (t) => {
711
+ let s;
712
+ const y = b.value ? We.Search : We, g = ze(t.field || {}, "rules");
713
+ let S = null;
714
+ switch (t.valueType) {
715
+ case "text":
716
+ s = 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
+ s = d(Qe, 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
+ s = d(We.Group, {
739
+ compact: !0,
740
+ class: D(o.value, `${e.prefixCls}-search-input-compact`)
741
+ }, {
742
+ default: () => [d(Qe, {
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(Qe, {
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
+ S = d(Il, 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
+ S = d(Fl, 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
+ s = d(It, 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
+ s = d(Vl, 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
+ s = d(ql, 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
+ s = d(Xl, 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
+ s = d(kl, 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
+ s = d(Kl, Q({
855
+ style: {
856
+ width: "100%"
857
+ },
858
+ value: i[t.name] && J(i[t.name]) && i[t.name]?.length === 2 ? gt(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
+ s = d(Pl, 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) && (s = t.request ? de(t, S) : S), s;
882
+ }, oe = ({
883
+ formItemStyle: t = {},
884
+ item: s
885
+ }) => {
886
+ const y = le(s) ? s.props?.label : s.label, g = (le(s) ? s.props?.labelWidth : s.labelWidth) || K.value?.width, S = (le(s) ? s.props?.labelAlign : s.labelAlign) || K.value?.align;
887
+ return d("div", {
888
+ class: D(`${e.prefixCls}-search-item`, o.value, m.value?.searchItem),
889
+ style: {
890
+ ...t,
891
+ gap: K.value?.gap ? pe(K.value?.gap) : void 0,
892
+ ...C.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`, S && `${e.prefixCls}-search-item-label-${S}`),
896
+ style: {
897
+ width: g ? pe(g) : void 0
898
+ }
899
+ }, [y]), d("div", {
900
+ class: D(`${e.prefixCls}-search-item-children`)
901
+ }, [le(s) ? s : Re(s)])]);
902
+ }, Pe = () => {
903
+ let t = n.default?.() || [];
904
+ t.length === 1 && t[0].type === "template" && (t = t[0]?.children || []);
905
+ const s = _l([...e.formCols, ...t.map((g) => ({
906
+ ...g,
907
+ order: g.props?.order || void 0
908
+ }))]), y = {
909
+ width: `calc((100% - (${L.value - 1} * ${O.value})) / ${L.value})`
910
+ };
911
+ return s.map((g, S) => {
912
+ const c = X(S, L.value, y);
913
+ return s.length < L.value || B.value ? d(we, null, [oe({
914
+ formItemStyle: c,
915
+ item: g
916
+ }), S === s.length - 1 && re({
917
+ formItemStyle: {
918
+ flex: 1,
919
+ justifyContent: "flex-end"
920
+ },
921
+ collapsed: B.value,
922
+ collapseRender: !!B.value
923
+ })]) : d(we, null, [S < L.value - 1 && oe({
924
+ formItemStyle: c,
925
+ item: g
926
+ }), S === L.value - 1 && (L.value - 1 === 0 || s.length === L.value) && oe({
927
+ formItemStyle: c,
928
+ item: g
929
+ }), S === L.value - 1 && s.length >= L.value && re({
930
+ formItemStyle: {
931
+ flex: 1,
932
+ justifyContent: "flex-end"
933
+ },
934
+ collapsed: !1,
935
+ collapseRender: s.length !== L.value
936
+ })]);
937
+ });
938
+ };
939
+ return () => {
940
+ const t = e.cardBordered && `${e.prefixCls}-search-border`;
941
+ return a(d("div", {
942
+ class: D(m.value?.search, o.value, `${e.prefixCls}-search`, t, o.value, f.value?.className),
943
+ style: C.value?.search
944
+ }, [Pe()]));
945
+ };
946
+ }
947
+ }), { useInjectContext: Ot, provideContext: Ul } = zt("scrollbar"), Te = 4, Jl = {
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
+ }, Zl = ({ move: e, size: n, bar: l }) => ({
969
+ [l.size]: n,
970
+ transform: `translate${l.axis}(${e}%)`
971
+ }), ea = {
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
+ }, et = /* @__PURE__ */ ge({
985
+ props: ea,
986
+ setup(e) {
987
+ const {
988
+ tableHeaderHeight: n,
989
+ hashId: l,
990
+ wrapElement: a,
991
+ scrollbarElement: o,
992
+ className: r
993
+ } = Ot(), u = x(), b = x(), f = x({}), $ = x(!1);
994
+ let v = !1, C = !1, m = 0, i = 0, w = xl ? document.onselectstart : null;
995
+ const h = T(() => Jl[e.vertical ? "vertical" : "horizontal"]), O = T(() => Zl({
996
+ size: e.size,
997
+ move: e.move,
998
+ bar: h.value
999
+ })), I = 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 / a.value[h.value.scrollSize] / e.ratio / b.value[h.value.offset]
1004
+ )), B = (E) => {
1005
+ if (E.stopPropagation(), E.ctrlKey || [1, 2].includes(E.button)) return;
1006
+ window.getSelection()?.removeAllRanges(), L(E);
1007
+ const W = E.currentTarget;
1008
+ W && (f.value[h.value.axis] = W[h.value.offset] - (E[h.value.client] - W.getBoundingClientRect()[h.value.direction]));
1009
+ }, N = (E) => {
1010
+ if (!b.value || !u.value || !a.value) return;
1011
+ const W = Math.abs(E.target.getBoundingClientRect()[h.value.direction] - E[h.value.client]), Y = b.value[h.value.offset] / 2, M = (W - Y) * 100 * I.value / u.value[h.value.offset];
1012
+ a.value[h.value.scroll] = M * a.value[h.value.scrollSize] / 100;
1013
+ };
1014
+ function L(E) {
1015
+ a.value && (E.stopImmediatePropagation(), v = !0, m = a.value.scrollHeight, i = a.value.scrollWidth, document.addEventListener("mousemove", K), document.addEventListener("mouseup", k), w = document.onselectstart, document.onselectstart = () => !1);
1016
+ }
1017
+ function K(E) {
1018
+ if (!a.value || !u.value || !b.value || v === !1) return;
1019
+ const W = f.value[h.value.axis];
1020
+ if (!W) return;
1021
+ const Y = (u.value.getBoundingClientRect()[h.value.direction] - E[h.value.client]) * -1, M = b.value[h.value.offset] - W, ee = (Y - M) * 100 * I.value / u.value[h.value.offset];
1022
+ h.value.scroll === "scrollLeft" ? a.value[h.value.scroll] = ee * i / 100 : a.value[h.value.scroll] = ee * m / 100;
1023
+ }
1024
+ function k() {
1025
+ v = !1, f.value[h.value.axis] = 0, document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", k), X(), C && ($.value = !1);
1026
+ }
1027
+ const H = () => {
1028
+ C = !1, $.value = !!e.size;
1029
+ }, A = () => {
1030
+ C = !0, $.value = v;
1031
+ };
1032
+ Gt(() => {
1033
+ X(), document.removeEventListener("mouseup", k);
1034
+ });
1035
+ function X() {
1036
+ document.onselectstart !== w && (document.onselectstart = w);
1037
+ }
1038
+ return vt(o, "mousemove", H), vt(o, "mouseleave", A), () => {
1039
+ const E = h.value.key === "vertical" ? {
1040
+ height: `calc(100% - ${pe(n.value + 1)})`,
1041
+ top: pe(n.value + 1)
1042
+ } : {};
1043
+ return d("div", {
1044
+ ref: u,
1045
+ style: {
1046
+ ...e.barStyle,
1047
+ ...E
1048
+ },
1049
+ class: [`${r}-bar`, "is-" + h.value.key, l.value],
1050
+ onMousedown: N
1051
+ }, [d("div", {
1052
+ ref: b,
1053
+ class: `${r}-thumb ${l.value}`,
1054
+ style: O.value,
1055
+ onMousedown: B
1056
+ }, null)]);
1057
+ };
1058
+ }
1059
+ });
1060
+ et.inheritAttrs = !1;
1061
+ const ta = {
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
+ }, la = /* @__PURE__ */ ge({
1078
+ inheritAttrs: !1,
1079
+ props: ta,
1080
+ setup(e, {
1081
+ expose: n
1082
+ }) {
1083
+ const l = Ot(), a = x(0), o = x(0), r = x(""), u = x(""), b = x(1), f = x(1), $ = (C) => {
1084
+ if (C) {
1085
+ const m = C.offsetHeight - Te, i = C.offsetWidth - Te;
1086
+ o.value = C.scrollTop * 100 / m * b.value, a.value = C.scrollLeft * 100 / i * f.value;
1087
+ }
1088
+ }, v = () => {
1089
+ const C = l?.wrapElement;
1090
+ if (!C?.value) return;
1091
+ const m = C.value.offsetHeight - Te, i = C.value.offsetWidth - Te, w = m ** 2 / C.value.scrollHeight, h = i ** 2 / C.value.scrollWidth, O = Math.max(w, e.minSize), I = Math.max(h, e.minSize);
1092
+ b.value = w / (m - w) / (O / (m - O)), f.value = h / (i - h) / (I / (i - I)), u.value = O + Te < m ? `${O}px` : "", r.value = I + Te < i ? `${I}px` : "";
1093
+ };
1094
+ return at(() => {
1095
+ nt(() => {
1096
+ v();
1097
+ });
1098
+ }), n({
1099
+ update: v,
1100
+ handleScroll: $
1101
+ }), () => d(we, null, [d(et, {
1102
+ move: a.value,
1103
+ barStyle: e.barStyle.x,
1104
+ ratio: f.value,
1105
+ size: r.value,
1106
+ always: e.always
1107
+ }, null), d(et, {
1108
+ move: o.value,
1109
+ barStyle: e.barStyle.y,
1110
+ ratio: b.value,
1111
+ size: u.value,
1112
+ vertical: !0,
1113
+ always: e.always
1114
+ }, null)]);
1115
+ }
1116
+ }), aa = (e) => ({
1117
+ [`${e.componentCls}`]: {
1118
+ lineHeight: 1,
1119
+ "&-with-after": {
1120
+ paddingBottom: e.margin
1121
+ },
1122
+ "&-container": {
1123
+ display: "flex",
1124
+ alignItems: "center",
1125
+ justifyContent: "space-between",
1126
+ gap: e.padding,
1127
+ paddingBottom: e.padding,
1128
+ "&-mobile": {
1129
+ flexDirection: "column",
1130
+ flexWrap: "wrap",
1131
+ alignItems: "flex-start",
1132
+ [`${e.componentCls}-left`]: {
1133
+ flexWrap: "wrap",
1134
+ maxWidth: "100%"
1135
+ },
1136
+ [`${e.componentCls}-right`]: {
1137
+ width: "100%"
1138
+ }
1139
+ }
1140
+ },
1141
+ "&-title": {
1142
+ display: "flex",
1143
+ alignItems: "center",
1144
+ justifyContent: "flex-start",
1145
+ color: e.colorTextHeading,
1146
+ fontWeight: "500",
1147
+ fontSize: e.fontSizeLG
1148
+ },
1149
+ "&-left": {
1150
+ display: "flex",
1151
+ flexWrap: "wrap",
1152
+ alignItems: "center",
1153
+ gap: e.marginXS,
1154
+ justifyContent: "flex-start",
1155
+ [`${e.antCls}-tabs`]: {
1156
+ width: "100%"
1157
+ },
1158
+ "&-has-tabs": {
1159
+ overflow: "hidden"
1160
+ }
1161
+ },
1162
+ "&-right": {
1163
+ flex: 1,
1164
+ display: "flex",
1165
+ flexWrap: "wrap",
1166
+ justifyContent: "flex-end",
1167
+ gap: e.marginSM,
1168
+ [`${e.componentCls}-actions`]: {
1169
+ display: "flex",
1170
+ alignItems: "center",
1171
+ gap: e.marginXS
1172
+ }
1173
+ },
1174
+ "&-setting-items": {
1175
+ display: "flex",
1176
+ gap: e.marginSM,
1177
+ lineHeight: "32px",
1178
+ alignItems: "center"
1179
+ },
1180
+ "&-setting-item": {
1181
+ color: e.colorIconHover,
1182
+ fontSize: e.fontSizeLG,
1183
+ cursor: "pointer",
1184
+ "> span": { display: "block", width: "100%", height: "100%" },
1185
+ "&:hover": {
1186
+ color: e.colorPrimary
1187
+ }
1188
+ }
1189
+ }
1190
+ });
1191
+ function na(e) {
1192
+ if (le(e))
1193
+ return e;
1194
+ if (e) {
1195
+ const n = e, {
1196
+ icon: l,
1197
+ tooltip: a,
1198
+ onClick: o,
1199
+ key: r
1200
+ } = n;
1201
+ return l && a ? d($e, {
1202
+ title: a,
1203
+ key: r
1204
+ }, {
1205
+ default: () => [d("span", {
1206
+ key: r,
1207
+ onClick: () => {
1208
+ o && o(r);
1209
+ }
1210
+ }, [l])]
1211
+ }) : l;
1212
+ }
1213
+ return null;
1214
+ }
1215
+ const Et = /* @__PURE__ */ ge({
1216
+ props: {
1217
+ actions: [Array],
1218
+ settings: [Array],
1219
+ prefixCls: String,
1220
+ headerTitle: he.headerTitle,
1221
+ listToolAfter: he.listToolAfter,
1222
+ headerTitleTip: he.headerTitleTip,
1223
+ titleTipText: he.titleTipText,
1224
+ actionsPlacement: String
1225
+ },
1226
+ setup(e) {
1227
+ const {
1228
+ wrapSSR: n,
1229
+ hashId: l
1230
+ } = it("ListToolBar", [aa], e.prefixCls), a = x(), {
1231
+ height: o
1232
+ } = Tl(a), r = ot(), {
1233
+ isMobile: u,
1234
+ tableListToolsHeight: b,
1235
+ classNames: f,
1236
+ styles: $
1237
+ } = st();
1238
+ pt(() => {
1239
+ b.value = o.value || 0;
1240
+ });
1241
+ const v = T(() => !!(e.headerTitleTip || e.headerTitle)), C = Ne(() => {
1242
+ if (!Array.isArray(e.actions) || e.actions?.length < 1)
1243
+ return {
1244
+ left: null,
1245
+ right: null
1246
+ };
1247
+ const I = e.actions.filter((N) => le(N)).filter((N) => (N?.props?.placement || e.actionsPlacement) === "left"), B = e.actions.filter((N) => le(N)).filter((N) => (N?.props?.placement || e.actionsPlacement) === "right");
1248
+ return {
1249
+ left: I.length ? d("div", {
1250
+ class: `${e.prefixCls}-actions ${l.value}`
1251
+ }, [I]) : null,
1252
+ right: B.length ? d("div", {
1253
+ class: `${e.prefixCls}-actions ${l.value}`
1254
+ }, [B]) : null
1255
+ };
1256
+ }, [() => e.actions, () => e.actionsPlacement]), m = T(() => !!(e.headerTitleTip || e.headerTitle || C.value.left)), i = T(() => !!(e.settings?.length || C.value.right)), w = Ne(() => {
1257
+ if (!m.value && i.value)
1258
+ return d("div", {
1259
+ class: `${e.prefixCls}-left ${l.value}`
1260
+ }, null);
1261
+ const I = C.value.left, B = D(`${e.prefixCls}-left ${l.value}`, f.value?.toolbarLeft), N = $.value?.toolbarLeft;
1262
+ return v.value ? d("div", {
1263
+ class: B,
1264
+ style: N
1265
+ }, [d("div", {
1266
+ class: `${e.prefixCls}-title ${l.value}`
1267
+ }, [e.headerTitle, e.headerTitleTip && d($e, {
1268
+ title: e.titleTipText
1269
+ }, {
1270
+ default: () => [De(e.headerTitleTip) && e.headerTitleTip ? d(tl, null, null) : e.headerTitleTip]
1271
+ })]), I]) : d("div", {
1272
+ class: B,
1273
+ style: N
1274
+ }, [I]);
1275
+ }, [() => m.value, () => i.value, () => v.value, () => e.prefixCls, () => e.headerTitle, () => e.titleTipText, () => e.headerTitleTip]), h = Ne(() => {
1276
+ if (!i.value) return null;
1277
+ const I = C.value.right;
1278
+ return d("div", {
1279
+ class: D(`${e.prefixCls}-right ${l.value}`, f.value?.toolbarRight),
1280
+ style: {
1281
+ alignItems: r.value.lg ? "center" : "flex-end",
1282
+ flexDirection: r.value.lg ? "row" : "column",
1283
+ ...$.value?.toolbarRight || {}
1284
+ }
1285
+ }, [I, e.settings?.length ? d("div", {
1286
+ class: D(`${e.prefixCls}-setting-items`, l.value)
1287
+ }, [e.settings.map((B, N) => {
1288
+ const L = na(B);
1289
+ return d("div", {
1290
+ key: N,
1291
+ class: D(`${e.prefixCls}-setting-item`, l.value)
1292
+ }, [L]);
1293
+ })]) : null]);
1294
+ }, [() => r.value, () => i.value, () => e.prefixCls, () => v.value, () => C.value, () => e.settings]), O = Ne(() => {
1295
+ if (!i.value && !m.value) return null;
1296
+ const I = {
1297
+ [`${l.value}`]: !0,
1298
+ [`${e.prefixCls}-container`]: !0,
1299
+ [`${e.prefixCls}-container-mobile`]: u.value
1300
+ };
1301
+ return d("div", {
1302
+ class: I
1303
+ }, [w.value, h.value]);
1304
+ }, [() => u.value, () => m.value, () => i.value, () => w.value, () => e.prefixCls, () => h.value]);
1305
+ return () => n(d("div", {
1306
+ ref: a,
1307
+ class: D(`${e.prefixCls} ${l.value}`, e.listToolAfter && `${e.prefixCls}-with-after`, f.value?.toolbar),
1308
+ style: $.value?.toolbar
1309
+ }, [O.value, e.listToolAfter && d("div", {
1310
+ class: D(`${e.prefixCls}-after ${l.value}`, f.value?.toolbarAfter),
1311
+ style: $.value?.toolbarAfter
1312
+ }, [e.listToolAfter])]));
1313
+ }
1314
+ });
1315
+ Et.inheritAttrs = !1;
1316
+ const Lt = /* @__PURE__ */ ge({
1317
+ setup() {
1318
+ const {
1319
+ isFullscreen: e
1320
+ } = Ft();
1321
+ return () => e.value ? d($e, {
1322
+ title: "退出全屏"
1323
+ }, {
1324
+ default: () => [d(ll, null, null)]
1325
+ }) : d($e, {
1326
+ title: "全屏"
1327
+ }, {
1328
+ default: () => [d(al, null, null)]
1329
+ });
1330
+ }
1331
+ });
1332
+ function oa() {
1333
+ return {
1334
+ reload: {
1335
+ text: "刷新",
1336
+ icon: d(nl, null, null)
1337
+ },
1338
+ fullScreen: {
1339
+ text: "全屏",
1340
+ icon: d(Lt, null, null)
1341
+ }
1342
+ };
1343
+ }
1344
+ function ia(e, n) {
1345
+ return $t(e).filter((l) => l).map((l) => {
1346
+ const a = e[l];
1347
+ if (!a)
1348
+ return null;
1349
+ let o = a === !0 ? n[l] : () => a?.();
1350
+ if (typeof o != "function" && (o = () => {
1351
+ }), l === "fullScreen")
1352
+ return d("span", {
1353
+ key: l,
1354
+ onClick: o
1355
+ }, [d(Lt, null, null)]);
1356
+ const r = oa()[l];
1357
+ return r ? d("span", {
1358
+ key: l,
1359
+ onClick: o
1360
+ }, [d($e, {
1361
+ title: r.text
1362
+ }, {
1363
+ default: () => [r.icon]
1364
+ })]) : null;
1365
+ }).filter((l) => l);
1366
+ }
1367
+ const sa = {
1368
+ options: [Boolean, Object, Array],
1369
+ actionsPlacement: [String],
1370
+ headerTitle: [Function, Boolean, Object, Array, String],
1371
+ listToolAfter: [Function, Boolean, Object, Array, String],
1372
+ headerTitleTip: [Function, Boolean, Object, String],
1373
+ titleTipText: [String],
1374
+ actionsRender: [Array]
1375
+ }, ra = /* @__PURE__ */ ge({
1376
+ props: sa,
1377
+ inheritAttrs: !1,
1378
+ setup(e) {
1379
+ const n = wt({
1380
+ suffixCls: "table-list-toolbar",
1381
+ isPor: !0
1382
+ }), {
1383
+ action: l
1384
+ } = st(), a = Ne(() => e.options === !1 ? [] : ia({
1385
+ reload: () => l?.reload(),
1386
+ fullScreen: () => l?.toggle()
1387
+ }, ne(e.options) ? e.options : {}), [() => e.options]);
1388
+ return () => {
1389
+ const o = e.actionsRender || [];
1390
+ return d(Et, {
1391
+ prefixCls: n,
1392
+ actions: o,
1393
+ actionsPlacement: e.actionsPlacement,
1394
+ settings: F(a),
1395
+ headerTitle: e.headerTitle,
1396
+ listToolAfter: e.listToolAfter,
1397
+ headerTitleTip: e.headerTitleTip,
1398
+ titleTipText: e.titleTipText
1399
+ }, null);
1400
+ };
1401
+ }
1402
+ });
1403
+ function ua(e) {
1404
+ return Qt();
1405
+ }
1406
+ function ca(e, n = !0, l) {
1407
+ ua() ? yt(e, l) : n ? e() : nt(e);
1408
+ }
1409
+ function da({ scroll: e, columns: n, breakpoint: l, draggable: a, autoScroll: o, neverScroll: r }) {
1410
+ const u = x([]);
1411
+ q([
1412
+ () => e.value,
1413
+ () => n.value,
1414
+ () => l.value,
1415
+ () => a.value,
1416
+ () => l.value,
1417
+ () => o.value,
1418
+ () => r.value
1419
+ ], () => {
1420
+ const m = $(ce(n.value));
1421
+ qe(m, ce(u.value)) || (u.value = ae(m));
1422
+ }, {
1423
+ deep: !0,
1424
+ immediate: !0
1425
+ });
1426
+ const b = T(() => f(F(u)));
1427
+ function f(m) {
1428
+ return m.sort((i, w) => ul(i, w, "order", 0));
1429
+ }
1430
+ function $(m) {
1431
+ return ae(m).map((i, w) => {
1432
+ if (i.dataIndex === "action" || w === m.length - 1 ? i.resizable = !1 : i.resizable = De(i.resizable) ? i.resizable : !!(Ce(i.width) && F(a)), !i.width || F(r))
1433
+ return i;
1434
+ if (i.dataIndex === "action" && F(o))
1435
+ if (F(e)?.x || !F(l))
1436
+ i.width = i.width || 100, i.fixed = "right";
1437
+ else {
1438
+ const h = F(n).find((O) => O.dataIndex === i.dataIndex);
1439
+ i.width = h?.width || "", i.fixed = h?.fixed;
1440
+ }
1441
+ return i;
1442
+ });
1443
+ }
1444
+ function v(m, i) {
1445
+ u.value = u.value.map((w) => (w.uuid === i.uuid && (w.width = m), w));
1446
+ }
1447
+ function C(m) {
1448
+ if (m.length <= 0) {
1449
+ u.value = [];
1450
+ return;
1451
+ }
1452
+ qe($(m), ce(u.value)) || (u.value = $(m));
1453
+ }
1454
+ return {
1455
+ breakpoint: l,
1456
+ proColumns: b,
1457
+ setColumns: C,
1458
+ resizeColumnWidth: v
1459
+ };
1460
+ }
1461
+ function fa(e, n) {
1462
+ const l = T(() => n), a = x(), o = x(e);
1463
+ function r() {
1464
+ a.value && (clearTimeout(a.value), a.value = null);
1465
+ }
1466
+ async function u(...b) {
1467
+ return l.value === 0 || l.value === void 0 ? o.value(...b) : (r(), new Promise(async (f) => {
1468
+ b[0]?.immediate ? f(await o.value(...b)) : a.value = setTimeout(async () => {
1469
+ f(await o.value(...b));
1470
+ }, l.value);
1471
+ }));
1472
+ }
1473
+ return il(r), {
1474
+ cancel: r,
1475
+ run: u
1476
+ };
1477
+ }
1478
+ function va(e) {
1479
+ const n = T(() => e.rowKey), l = T(() => e.polling), a = T(() => e.debounceTime), o = T(() => e.dataSource), r = T(() => e.autoRequest);
1480
+ return {
1481
+ rowKey: n,
1482
+ polling: l,
1483
+ request: e.request,
1484
+ postData: e.postData,
1485
+ debounceTime: a,
1486
+ dataSource: o,
1487
+ autoRequest: r
1488
+ };
1489
+ }
1490
+ function ma({ rowKey: e, autoRequest: n, polling: l, request: a, postData: o, dataSource: r, waitRequest: u, debounceTime: b }, { params: f, columns: $, setLoading: v, setColumns: C, removeRowKeys: m, syncSelectedRows: i, defaultFormSearch: w, setPagination: h, pageInfo: O, onRequestError: I, onBeforeSearchSubmit: B, hasCustomRender: N }, L) {
1491
+ const K = x(""), k = x(!1), H = x(!1), A = x([]), X = x(), E = x(null), W = (t = !1) => {
1492
+ (k.value || t) && v(!1), de(!1);
1493
+ }, Y = async (t = {}) => {
1494
+ const { pagination: s = {}, filters: y = {}, sorter: g = {}, removeKeys: S = [], isPolling: c = !1, extra: fe } = t;
1495
+ if (!a || !Me(a))
1496
+ return r.value || [];
1497
+ c ? de(!0) : v(!0), s && h(s);
1498
+ try {
1499
+ S.length && m(S);
1500
+ const U = ne(g) ? Object.keys(g).length ? [g] : [] : g;
1501
+ C(F($).map((Se) => {
1502
+ const xe = U.find((ie) => (ie?.columnKey || ie?.field) === Se.dataIndex);
1503
+ return {
1504
+ ...Se,
1505
+ sortOrder: xe?.order
1506
+ };
1507
+ }));
1508
+ let Fe = {
1509
+ ...ce(O),
1510
+ current: fl(ce(O), S.length),
1511
+ ...F(w),
1512
+ ...F(f),
1513
+ ...t.params
1514
+ };
1515
+ B && Me(B) && (Fe = await B({
1516
+ params: Fe,
1517
+ sorter: U,
1518
+ filter: y,
1519
+ extra: fe
1520
+ }));
1521
+ let ve = [];
1522
+ const ue = `table_request_${Rt().uuid(10)}`;
1523
+ K.value = ue;
1524
+ const Ie = await a?.({
1525
+ params: ae(ce(Fe)),
1526
+ sorter: U,
1527
+ filter: y,
1528
+ extra: fe
1529
+ });
1530
+ if (K.value !== ue)
1531
+ return [];
1532
+ if (Ie) {
1533
+ const { success: Se = !0, data: xe = [] } = Ie;
1534
+ if (!Se)
1535
+ return [];
1536
+ ve = typeof o == "function" ? await o?.(xe) : xe, i(ve);
1537
+ const ie = Ie.total || ve?.length || 0;
1538
+ ie !== O.total && h({
1539
+ total: ie
1540
+ });
1541
+ const Ke = F(A).map((ke) => ze(ke, "sortIndex"));
1542
+ return qe(ve, Ke) ? F(A) : (oe(ve), ve);
1543
+ } else
1544
+ return [];
1545
+ } catch (U) {
1546
+ if (I === void 0)
1547
+ throw new Error(U);
1548
+ A.value === void 0 && oe([]), I(U);
1549
+ } finally {
1550
+ W(!0);
1551
+ }
1552
+ return [];
1553
+ }, M = fa(async (t = {}) => {
1554
+ if (X.value && clearTimeout(X.value), !a)
1555
+ return;
1556
+ const s = new AbortController();
1557
+ E.value = s;
1558
+ try {
1559
+ const y = await Promise.race([
1560
+ Y(t),
1561
+ new Promise((S, c) => {
1562
+ E.value?.signal?.addEventListener?.("abort", () => {
1563
+ c("aborted"), M.cancel(), W();
1564
+ });
1565
+ })
1566
+ ]);
1567
+ if (s.signal.aborted)
1568
+ return;
1569
+ const g = cl(l.value, y);
1570
+ return g && !k.value && (X.value = setTimeout(() => {
1571
+ M.run({ ...t, isPolling: g });
1572
+ }, Math.max(g, 2e3))), y;
1573
+ } catch (y) {
1574
+ if (y === "aborted")
1575
+ return;
1576
+ throw y;
1577
+ }
1578
+ }, b.value || 30), ee = () => {
1579
+ E.value?.abort(), M.cancel(), W();
1580
+ };
1581
+ at(() => {
1582
+ k.value = !1;
1583
+ }), yt(() => {
1584
+ k.value = !1;
1585
+ }), Ct(() => {
1586
+ ee(), k.value = !0, clearTimeout(X.value);
1587
+ }), St(() => {
1588
+ ee(), k.value = !0, clearTimeout(X.value);
1589
+ }), q(() => l.value, () => {
1590
+ u.value || (l.value ? M.run({ isPolling: !0 }) : clearTimeout(X.value));
1591
+ }, { immediate: !0 }), q(() => u.value, () => {
1592
+ u.value ? v(!0) : M.run({ isPolling: !1 });
1593
+ }, { immediate: !0 }), q(() => r.value, () => {
1594
+ r.value && oe(r.value || []);
1595
+ }, { deep: !0, immediate: !0 }), q(() => f.value, () => {
1596
+ u.value || n.value && (h({ current: 1 }), se());
1597
+ }, { deep: !0, immediate: !0 }), q(() => w.value, (t, s) => {
1598
+ u.value || qe(t, s) || (h({ current: 1 }), se());
1599
+ }, { deep: !0, immediate: !0 });
1600
+ function se() {
1601
+ a ? l.value || (ee(), M.run({ isPolling: !1 })) : oe(r.value || []);
1602
+ }
1603
+ const re = T(() => {
1604
+ if (N.value)
1605
+ return F(A);
1606
+ const t = $.value.filter((s) => s.show || s.show === void 0);
1607
+ return !F(A) || !t || t.length === 0 ? [] : F(A);
1608
+ }), be = T(() => F(A).some((t) => J(t.children) && t.children.length > 0));
1609
+ function de(t) {
1610
+ H.value = t;
1611
+ }
1612
+ function Re(t, s = {}, y = {}, g) {
1613
+ ee(), M.run({ pagination: t, filters: s, sorter: y, extra: g, isPolling: !1 });
1614
+ }
1615
+ function oe(t) {
1616
+ const s = dl(ae(t), ce(O));
1617
+ if (A.value = s, !a || !Me(a)) {
1618
+ const y = s.length || 0;
1619
+ y !== O.total && h({
1620
+ total: y
1621
+ });
1622
+ }
1623
+ }
1624
+ return {
1625
+ dataSource: re,
1626
+ isTreeDataRef: be,
1627
+ setTableDataList: oe,
1628
+ operateTableDataRow: (t) => {
1629
+ const { key: s, row: y, value: g, type: S = "update" } = t, c = s ?? e.value, fe = y?.[c] ?? g;
1630
+ switch (!y && S !== "delete" && console.warn("row is required"), S) {
1631
+ case "update":
1632
+ c && fe && y && (A.value = A.value.map((U) => fe === U[c] ? ye(U, y) : U));
1633
+ break;
1634
+ case "push":
1635
+ y && A.value.push(y);
1636
+ break;
1637
+ case "unshift":
1638
+ y && A.value.unshift(y);
1639
+ break;
1640
+ case "delete":
1641
+ c && (A.value = A.value.filter((U) => g !== U[c]));
1642
+ break;
1643
+ }
1644
+ },
1645
+ handleTableChange: Re,
1646
+ run: async (t) => {
1647
+ u.value || (a ? await M.run({ ...t, isPolling: !1 }) : L("reload"));
1648
+ }
1649
+ };
1650
+ }
1651
+ function ha(e) {
1652
+ const n = x(l(e.loading.value));
1653
+ q(() => e.loading.value, (o) => {
1654
+ n.value = l(o, n.value);
1655
+ });
1656
+ function l(o, r = !1) {
1657
+ return De(o) ? o : ne(o) ? o?.spinning ?? r : r;
1658
+ }
1659
+ function a(o) {
1660
+ n.value = o;
1661
+ }
1662
+ return [n, a];
1663
+ }
1664
+ const Ye = {
1665
+ current: 1,
1666
+ pageSize: 10,
1667
+ size: "default",
1668
+ showQuickJumper: !0,
1669
+ showSizeChanger: !0,
1670
+ pageSizeOptions: ["10", "20", "50", "100"]
1671
+ };
1672
+ function ga({
1673
+ pagination: e,
1674
+ pageItemRender: n
1675
+ }) {
1676
+ const l = x({
1677
+ ...Ye
1678
+ }), a = lt({
1679
+ current: Ye.current,
1680
+ pageSize: Ye.pageSize,
1681
+ total: 0
1682
+ });
1683
+ q(() => e.value, () => {
1684
+ if (e.value === !1) {
1685
+ l.value = !1;
1686
+ return;
1687
+ }
1688
+ const r = Me(n) ? {
1689
+ itemRender: ({
1690
+ page: b,
1691
+ type: f,
1692
+ originalElement: $
1693
+ }) => n ? n({
1694
+ page: b,
1695
+ type: f,
1696
+ originalElement: $
1697
+ }) : null
1698
+ } : null, u = {
1699
+ ...Ye,
1700
+ ...e.value || {},
1701
+ ...r || {}
1702
+ };
1703
+ e.value?.showTotal || (u.showTotal = (b) => `共${b < u.pageSize ? 1 : Math.ceil(b / (u.pageSize || 10))}页 ${b}条记录`), l.value = ae(u), vl(a, (b) => {
1704
+ Ce(u[b]) && (a[b] = u[b]);
1705
+ });
1706
+ }, {
1707
+ deep: 1,
1708
+ immediate: !0
1709
+ });
1710
+ function o(r) {
1711
+ l.value = ye(F(l), r);
1712
+ for (const u in a)
1713
+ r[u] && Ce(r[u]) && (a[u] = r[u]);
1714
+ }
1715
+ return {
1716
+ paginationInfo: l,
1717
+ requestPagination: a,
1718
+ setPagination: o
1719
+ };
1720
+ }
1721
+ function ba(e, n) {
1722
+ const l = x([]), a = x([]);
1723
+ q(() => n.value?.selectedRows, (v) => {
1724
+ a.value = ae(v || []);
1725
+ }, {
1726
+ deep: !0,
1727
+ immediate: !0
1728
+ }), q(() => n.value?.selectedRowKeys, (v) => {
1729
+ l.value = ml([...v || []]);
1730
+ }, {
1731
+ deep: !0,
1732
+ immediate: !0
1733
+ });
1734
+ const o = (v, C) => {
1735
+ const m = n.value?.type || "checkbox";
1736
+ e.value && (C ? v?.[e.value] && m === "checkbox" ? (l.value.push(v[e.value]), a.value.push(v)) : (l.value = [v[e.value]], a.value = [v]) : (l.value = l.value.filter((i) => i !== v[e.value]), a.value = a.value.filter((i) => i[e.value] !== v[e.value])));
1737
+ }, r = () => {
1738
+ n.value && n.value?.onChange?.(l.value, a.value);
1739
+ };
1740
+ return {
1741
+ selectedKeys: l,
1742
+ selectedItems: a,
1743
+ selectRowKey: o,
1744
+ selectAllRowKey: (v, C, m) => {
1745
+ e.value && (v ? C.map((i) => (l.value.every((w) => w !== i?.[e.value]) && i?.[e.value] && (l.value.push(i[e.value]), a.value.push(i)), i)) : m.map((i) => (l.value.includes(i?.[e.value]) && (l.value = l.value.filter((w) => w !== i[e.value]), a.value = a.value.filter((w) => w[e.value] !== i[e.value])), i)));
1746
+ },
1747
+ removeRowKeys: (v) => {
1748
+ l.value = l.value.filter((C) => !v.includes(C)), a.value = a.value.filter((C) => !v.includes(C?.[e.value || ""])), r();
1749
+ },
1750
+ changeRowKey: r,
1751
+ syncSelectedRows: (v) => {
1752
+ if (e.value && l.value.length !== a.value.length) {
1753
+ const C = a.value.map((i) => i[e.value]), m = l.value.filter((i) => !C.includes(i));
1754
+ v.forEach((i) => {
1755
+ m.includes(i[e.value]) && a.value.push(ae(i));
1756
+ });
1757
+ }
1758
+ },
1759
+ clearAllRowKeys: () => {
1760
+ l.value = [], a.value = [], r();
1761
+ }
1762
+ };
1763
+ }
1764
+ function pa(e) {
1765
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
1766
+ }
1767
+ function ya(e, n, l, a) {
1768
+ if (!n) return e;
1769
+ let o = e;
1770
+ if (ne(n)) {
1771
+ const r = n.node === "a" ? "span" : n.node;
1772
+ return d(r, Q(n?.attr || {}, {
1773
+ class: n.class,
1774
+ onClick: n.click
1775
+ }), pa(e) ? e : {
1776
+ default: () => [e]
1777
+ });
1778
+ }
1779
+ switch (n) {
1780
+ case "link":
1781
+ o = d("span", {
1782
+ class: [`${l}-a`, a]
1783
+ }, [e]);
1784
+ break;
1785
+ case "time":
1786
+ o = Z(e).format("HH:mm:ss");
1787
+ break;
1788
+ case "dateMonth":
1789
+ o = `${Z(e).month() + 1}月`;
1790
+ break;
1791
+ case "date":
1792
+ o = Z(e).format("YYYY-MM-DD");
1793
+ break;
1794
+ case "dateTime":
1795
+ o = Z(e).format("YYYY-MM-DD HH:mm:ss");
1796
+ break;
1797
+ }
1798
+ return o;
1799
+ }
1800
+ function Ca(e, n) {
1801
+ const l = n && n.current || 1, a = n && n.pageSize || 10;
1802
+ return e.filter((o, r) => r < l * a && r >= a * (l - 1));
1803
+ }
1804
+ function Sa(e) {
1805
+ const n = document.createElement("textarea");
1806
+ n.style.position = "absolute", n.style.opacity = "0", n.value = e, document.body.appendChild(n), n.select(), document.execCommand("copy"), document.body.removeChild(n);
1807
+ }
1808
+ function Be(e, n) {
1809
+ let l = null, a = null;
1810
+ function o() {
1811
+ l && l.disconnect(), a && a.disconnect();
1812
+ }
1813
+ function r(f) {
1814
+ f && (l = new ResizeObserver(() => {
1815
+ n(f);
1816
+ }), l.observe(f), n(f));
1817
+ }
1818
+ function u() {
1819
+ return typeof e == "string" ? document.querySelector(e) : e();
1820
+ }
1821
+ const b = u();
1822
+ return b ? (r(b), o) : (a = new MutationObserver(() => {
1823
+ const f = u();
1824
+ f && (a.disconnect(), r(f));
1825
+ }), a.observe(document.body, {
1826
+ childList: !0,
1827
+ subtree: !0
1828
+ }), o);
1829
+ }
1830
+ function xa({ fitPage: e, hashId: n, scroll: l, baseClassName: a }) {
1831
+ const o = x(), r = x(), u = x(), b = x(), f = x(), $ = x(), v = x(0);
1832
+ let C, m, i, w;
1833
+ sl(() => {
1834
+ C = Be(() => r.value?.querySelector(".ant-pagination"), (H) => {
1835
+ H && (u.value = H);
1836
+ }), i = Be(() => r.value?.querySelector(".ant-table-header"), (H) => {
1837
+ H && (b.value = H);
1838
+ }), w = Be(() => r.value?.querySelector(".ant-table-body>table"), (H) => {
1839
+ H && ($.value = H);
1840
+ });
1841
+ }), q(() => l.value, (H) => {
1842
+ m && m(), H.y ? m = Be(() => r.value?.querySelector(".ant-table-body"), (A) => {
1843
+ A && (f.value = A);
1844
+ }) : H.x && (m = Be(() => r.value?.querySelector(".ant-table-content"), (A) => {
1845
+ A && (f.value = A);
1846
+ }));
1847
+ }, { immediate: !0 });
1848
+ const { height: h } = He(r), { height: O } = He(b), { height: I } = He($), { height: B } = He(u), N = T(() => !r.value || !e.value ? 0 : h.value - O.value - v.value - B.value), L = T(() => N.value && e.value ? I.value <= N.value : !1);
1849
+ q([
1850
+ () => f.value,
1851
+ () => N.value
1852
+ ], () => {
1853
+ f.value && e.value && f.value.setAttribute("style", `height: ${N.value}px;`);
1854
+ }), wl(f, {
1855
+ onScroll: () => {
1856
+ f.value && o.value?.handleScroll(f.value);
1857
+ }
1858
+ });
1859
+ const K = () => {
1860
+ o.value?.update();
1861
+ };
1862
+ $l(f, K), at(() => {
1863
+ nt(() => {
1864
+ K();
1865
+ });
1866
+ }), Ut(() => K());
1867
+ function k() {
1868
+ C && C(), m && m(), i && i(), w && w();
1869
+ }
1870
+ return Ct(() => {
1871
+ k();
1872
+ }), St(() => {
1873
+ k && k();
1874
+ }), Ul({
1875
+ className: `${a}-scroll`,
1876
+ hashId: n,
1877
+ tableHeaderHeight: O,
1878
+ scrollbarElement: r,
1879
+ wrapElement: f
1880
+ }), {
1881
+ barRef: o,
1882
+ tableCardEl: r,
1883
+ tableScrollEl: f,
1884
+ tableOverHidden: L,
1885
+ tableScrollYHeight: N,
1886
+ tableListToolsHeight: v
1887
+ };
1888
+ }
1889
+ function Ta(e) {
1890
+ const n = {};
1891
+ return e.forEach((l) => {
1892
+ let a = l.initialValue;
1893
+ const o = ["select", "number"], r = ["date", "time", "dateRange"], u = ["treeSelect", "numberRange"];
1894
+ l.valueType ? !a && o.includes(l.valueType) ? a = void 0 : !a && r.includes(l.valueType) ? a = null : !a && u.includes(l.valueType) ? a = [] : a || (a = "") : a || (a = ""), l.name === "dateRange" ? (n[l.rangeStartName || "start"] = a ? a[0] : null, n[l.rangeEndName || "end"] = a ? a[1] : null) : l.name && (n[l.name] = a);
1895
+ }), n;
1896
+ }
1897
+ function wa({ searchMap: e, columns: n }) {
1898
+ const l = x([]), a = x({});
1899
+ function o(r) {
1900
+ r.forEach((b) => {
1901
+ 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);
1902
+ });
1903
+ const u = Ta(r);
1904
+ a.value = { ...a.value, ...u };
1905
+ }
1906
+ return q(() => e.value, () => {
1907
+ const r = [];
1908
+ e.value?.forEach((u) => r.push(u)), o(r);
1909
+ }, { deep: !0, immediate: !0 }), q(() => n.value, () => {
1910
+ const r = [];
1911
+ n.value && n.value?.length && n.value.forEach((u) => {
1912
+ u.searchConfig && r.push(u.searchConfig);
1913
+ }), o(r);
1914
+ }, { deep: !0, immediate: !0 }), { formCols: l, defaultFormSearch: a };
1915
+ }
1916
+ function $a({ scroll: e, columns: n, autoScroll: l, modalScroll: a, neverScroll: o, rowSelection: r, screens: u, innerWidth: b, scrollBreakpoint: f }) {
1917
+ const $ = T(() => f.value ? Ce(f.value) ? b.value > f.value : Pt(f.value) ? u.value?.[f.value] : u.value?.xl : u.value?.xl), v = T(() => {
1918
+ let m = 0;
1919
+ const i = F(r) ? 60 : 0, w = 150, h = ae(F(n));
1920
+ h.forEach((B) => {
1921
+ m += Number.parseInt(String(B.width)) || 0;
1922
+ });
1923
+ const I = h.filter((B) => !Reflect.has(B, "width")).length;
1924
+ return I !== 0 && (m += I * w), i && (m += i), m;
1925
+ });
1926
+ return { proScroll: T(() => o.value ? {} : e.value && $t(e.value).length ? F(e) : a.value ? {
1927
+ y: e.value?.y || (u.value?.xl ? 400 : 235)
1928
+ } : l.value ? $.value ? {} : De($.value) ? { x: v.value } : {} : {}), breakpoint: $ };
1929
+ }
1930
+ function Ra(e) {
1931
+ const n = x(e.size.value || "middle");
1932
+ q(() => e.size.value, (a) => n.value = a);
1933
+ function l(a) {
1934
+ n.value = a || n.value;
1935
+ }
1936
+ return [n, l];
1937
+ }
1938
+ const Pa = (e) => ({
1939
+ [e.componentCls]: {
1940
+ [`${e.componentCls}-list`]: {
1941
+ clear: "both",
1942
+ maxWidth: "100%",
1943
+ [`${e.componentCls}-pagination${e.antCls}-pagination`]: {
1944
+ marginTop: e.margin
1945
+ },
1946
+ [`${e.componentCls}-pagination`]: {
1947
+ display: "flex",
1948
+ flexWrap: "wrap",
1949
+ rowGap: e.paddingXS,
1950
+ "> *": {
1951
+ flex: "none"
1952
+ },
1953
+ "&-left": {
1954
+ justifyContent: "flex-start"
1955
+ },
1956
+ "&-center": {
1957
+ justifyContent: "center"
1958
+ },
1959
+ "&-right": {
1960
+ justifyContent: "flex-end"
1961
+ }
1962
+ }
1963
+ }
1964
+ }
1965
+ }), Je = () => ({
1966
+ scrollbarWidth: "none",
1967
+ "&::-webkit-scrollbar": {
1968
+ width: 0,
1969
+ height: 0
1970
+ }
1971
+ }), Fa = (e) => {
1972
+ const n = new ht(e.colorText).setAlpha(0.2).toRgbString(), l = new ht(e.colorText).setAlpha(0.4).toRgbString();
1973
+ return {
1974
+ [e.componentCls]: {
1975
+ [`${e.antCls}-table-container`]: {
1976
+ position: "relative"
1977
+ },
1978
+ [`${e.componentCls}-scroll`]: {
1979
+ "&-bar": {
1980
+ position: "absolute",
1981
+ right: 2,
1982
+ bottom: 2,
1983
+ zIndex: 9999,
1984
+ borderRadius: e.borderRadius - 2,
1985
+ "&.is-vertical": {
1986
+ top: 2,
1987
+ width: 6,
1988
+ "& > div": {
1989
+ width: "100%"
1990
+ }
1991
+ },
1992
+ "&.is-horizontal": {
1993
+ left: 2,
1994
+ height: 6,
1995
+ "& > div": {
1996
+ height: "100%"
1997
+ }
1998
+ }
1999
+ },
2000
+ "&-thumb": {
2001
+ position: "relative",
2002
+ display: "block",
2003
+ width: 0,
2004
+ height: 0,
2005
+ cursor: "pointer",
2006
+ opacity: 1,
2007
+ backgroundColor: n,
2008
+ borderRadius: "inherit",
2009
+ transition: ".3s background-color",
2010
+ "&:hover": {
2011
+ opacity: 1,
2012
+ backgroundColor: l
2013
+ }
2014
+ }
2015
+ },
2016
+ [`${e.antCls}-table-content`]: Je(),
2017
+ [`${e.antCls}-table-body`]: Je(),
2018
+ [`${e.antCls}-table-empty`]: {
2019
+ [`${e.antCls}-table-content`]: Je()
2020
+ }
2021
+ }
2022
+ };
2023
+ }, Ia = (e) => {
2024
+ const n = `${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`;
2025
+ return {
2026
+ [e.componentCls]: {
2027
+ [`&${e.componentCls}-full-page`]: {
2028
+ flex: 1,
2029
+ height: "100%",
2030
+ overflow: "hidden",
2031
+ [`${e.componentCls}-content`]: {
2032
+ display: "flex",
2033
+ flexDirection: "column",
2034
+ height: "100%",
2035
+ overflow: "hidden",
2036
+ [`${e.componentCls}-card`]: {
2037
+ position: "relative",
2038
+ flex: 1,
2039
+ overflow: "hidden",
2040
+ [`${e.componentCls}-overflow-hidden`]: {
2041
+ [`${e.antCls}-table${e.antCls}-table-bordered>${e.antCls}-table-container`]: {
2042
+ borderBlockEnd: n,
2043
+ [`${e.antCls}-table-body`]: {
2044
+ borderInlineEnd: n
2045
+ },
2046
+ [`${e.antCls}-table-row`]: {
2047
+ [`${e.antCls}-table-cell`]: {
2048
+ "&:last-child": {
2049
+ borderRightWidth: 0
2050
+ }
2051
+ }
2052
+ }
2053
+ }
2054
+ },
2055
+ [`${e.componentCls}-list`]: {
2056
+ overflow: "auto"
2057
+ }
2058
+ }
2059
+ }
2060
+ }
2061
+ }
2062
+ };
2063
+ }, Aa = (e) => ({
2064
+ [e.componentCls]: {
2065
+ [`${e.componentCls}-card`]: {
2066
+ [`${e.antCls}-table-pagination${e.antCls}-pagination`]: {
2067
+ margin: 0,
2068
+ marginTop: e.margin
2069
+ }
2070
+ },
2071
+ [`${e.antCls}-table`]: {
2072
+ [`${e.antCls}-table-cell-ellipsis`]: {
2073
+ overflow: "unset",
2074
+ whiteSpace: "unset"
2075
+ }
2076
+ },
2077
+ "&-empty-text": {
2078
+ display: "flex",
2079
+ flexDirection: "column",
2080
+ alignItems: "center",
2081
+ justifyContent: "center",
2082
+ marginBlock: e.marginXL
2083
+ },
2084
+ "&-table-tree": {
2085
+ [`${e.antCls}-table-row-cell-ellipsis`]: {
2086
+ overflow: "hidden",
2087
+ textOverflow: "ellipsis",
2088
+ whiteSpace: "nowrap",
2089
+ [`${e.antCls}-table-column-title`]: {
2090
+ overflow: "hidden",
2091
+ textOverflow: "ellipsis",
2092
+ whiteSpace: "nowrap"
2093
+ }
2094
+ }
2095
+ },
2096
+ "&-full-screen": {
2097
+ [`${e.componentCls}-content`]: {
2098
+ height: "100% !important",
2099
+ padding: 24,
2100
+ backgroundColor: e.colorWhite,
2101
+ boxShadow: "0 4px 8px #0003, 0 6px 20px #00000030 !important"
2102
+ }
2103
+ },
2104
+ "&-no-scroll": {
2105
+ [`${e.antCls}-table`]: {
2106
+ table: {
2107
+ width: "100% !important",
2108
+ minWidth: "unset"
2109
+ }
2110
+ },
2111
+ [`${e.antCls}-table-ping-right:not(${e.antCls}-table-has-fix-right)`]: {
2112
+ [`${e.antCls}-table-container::after`]: {
2113
+ boxShadow: "none"
2114
+ }
2115
+ },
2116
+ [`${e.antCls}-table-bordered ${e.antCls}-table-fixed-left ${e.antCls}-table-thead > tr > th`]: {
2117
+ "&:last-child": {
2118
+ borderRight: 0
2119
+ }
2120
+ },
2121
+ [`${e.antCls}-table-bordered ${e.antCls}-table-fixed-left ${e.antCls}-table-tbody > tr > td`]: {
2122
+ "&:last-child": {
2123
+ borderRight: 0
2124
+ }
2125
+ }
2126
+ },
2127
+ "&-card-border": {
2128
+ paddingInline: e.paddingMD,
2129
+ paddingBlock: e.paddingMD,
2130
+ border: `${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,
2131
+ borderRadius: e.borderRadiusLG,
2132
+ backgroundColor: e.colorBgContainer,
2133
+ [`${e.antCls}-table-wrapper ${e.antCls}-table-pagination${e.antCls}-pagination`]: {
2134
+ marginBottom: 0
2135
+ }
2136
+ },
2137
+ [`${e.componentCls}-copyable`]: {
2138
+ display: "flex",
2139
+ alignItems: "center",
2140
+ [`${e.componentCls}-copyable-icon`]: {
2141
+ marginLeft: 8,
2142
+ color: e.colorPrimary,
2143
+ cursor: "pointer"
2144
+ }
2145
+ },
2146
+ [`${e.componentCls}-ellipsis`]: {
2147
+ overflow: "hidden",
2148
+ textOverflow: "ellipsis",
2149
+ display: "-webkit-box",
2150
+ "-webkit-box-orient": "vertical",
2151
+ "word-break": "break-word"
2152
+ },
2153
+ [`${e.componentCls}-action-size`]: {
2154
+ display: "inline-block"
2155
+ },
2156
+ [`${e.componentCls}-action-columns`]: {
2157
+ display: "inline-block",
2158
+ [`${e.antCls}-popover-inner-content`]: {
2159
+ padding: "8px 0 8px 16px"
2160
+ },
2161
+ [`${e.antCls}-tree ${e.antCls}-tree-switcher-noop`]: {
2162
+ display: "none"
2163
+ },
2164
+ [`${e.antCls}-tree > ${e.antCls}-tree-treenode`]: {
2165
+ width: "100%",
2166
+ alignItems: "center",
2167
+ "&:first-child": {
2168
+ paddingTop: 0
2169
+ },
2170
+ "&:last-child": {
2171
+ paddingBottom: 4
2172
+ },
2173
+ "&:hover": {
2174
+ backgroundColor: "#e6f7ff",
2175
+ [`${e.componentCls}-action-columns-list-item-actions`]: {
2176
+ display: "block"
2177
+ }
2178
+ }
2179
+ },
2180
+ [`${e.antCls}-tree ${e.antCls}-tree-node-content-wrapper`]: {
2181
+ flex: "1",
2182
+ "&:hover": {
2183
+ backgroundColor: "transparent"
2184
+ }
2185
+ },
2186
+ "&-popover-title": {
2187
+ display: "flex",
2188
+ alignItems: "center",
2189
+ justifyContent: "space-between",
2190
+ "&-check": {
2191
+ marginRight: 8
2192
+ },
2193
+ [`${e.antCls}-btn-sm`]: {
2194
+ padding: 0
2195
+ }
2196
+ },
2197
+ "&-list-group": {
2198
+ marginTop: 6,
2199
+ marginBottom: 6,
2200
+ fontSize: 12,
2201
+ color: "rgba(0, 0, 0, 0.45)"
2202
+ },
2203
+ "$-list-item": {
2204
+ display: "flex",
2205
+ alignItems: "center",
2206
+ justifyContent: "space-between",
2207
+ "&-actions": {
2208
+ display: "block",
2209
+ float: "right",
2210
+ cursor: "pointer",
2211
+ "> span + span": {
2212
+ marginLeft: 8
2213
+ },
2214
+ "&-disabled": {
2215
+ action: {
2216
+ color: "rgba(0, 0, 0, 0.25)"
2217
+ }
2218
+ },
2219
+ anticon: {
2220
+ color: e.colorPrimary
2221
+ }
2222
+ }
2223
+ }
2224
+ },
2225
+ [`${e.antCls}-tooltip-inner`]: {
2226
+ a: {
2227
+ color: e.colorWhite
2228
+ }
2229
+ }
2230
+ }
2231
+ });
2232
+ function Ba(e) {
2233
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !le(e);
2234
+ }
2235
+ const Na = Bt.PRESENTED_IMAGE_SIMPLE, za = {
2236
+ reload: !0,
2237
+ fullScreen: !0
2238
+ }, Da = Al.useToken, Ze = /* @__PURE__ */ ge({
2239
+ name: "GProTable",
2240
+ inheritAttrs: !1,
2241
+ props: he,
2242
+ emits: ["reset", "reload", "submit", "sizeChange", "expandedRowsChange", "expand", "change", "requestError", "columnsStateChange", "loadingChange"],
2243
+ slots: Object,
2244
+ setup(e, {
2245
+ emit: n,
2246
+ slots: l,
2247
+ expose: a
2248
+ }) {
2249
+ const o = wt({
2250
+ suffixCls: "table",
2251
+ isPor: !0
2252
+ }), {
2253
+ wrapSSR: r,
2254
+ hashId: u
2255
+ } = it("ProBaseTable", [Aa, Fa, Ia, Pa], o), {
2256
+ token: b
2257
+ } = Da(), f = rl(), $ = ot(), {
2258
+ width: v
2259
+ } = Rl(), C = x(!1), m = xt(), i = x(), w = x(), h = x(e.waitRequest);
2260
+ pt(() => h.value = e.waitRequest);
2261
+ const {
2262
+ toggle: O,
2263
+ isFullscreen: I
2264
+ } = Ft(i), B = T(() => !$.value.xl), N = T(() => (e.virtualScroll && El(!e.scroll?.y, "参数scroll的Y值不能为空!"), !!(e.scroll?.y && e.virtualScroll))), L = T(() => {
2265
+ if (e.form === !1) return !1;
2266
+ const p = {
2267
+ actions: {
2268
+ resetReload: !0
2269
+ },
2270
+ resetText: "重置",
2271
+ searchText: "查询"
2272
+ };
2273
+ return ne(e.form) ? ye(p, e.form) : p;
2274
+ }), K = T(() => L.value === !1 ? {} : L.value), k = T(() => K.value?.autoRequest ?? e.autoRequest), H = T(() => K.value?.actions), A = T(() => {
2275
+ const p = e.columns.filter((R) => R.key || R.dataIndex).map((R) => {
2276
+ const P = R.key || R.dataIndex;
2277
+ return R.key = P, R.dataIndex = P, R.align = R.align || e.align, R.uuid = R.uuid || Rt().uuid(15), R;
2278
+ });
2279
+ return hl(p, {
2280
+ align: e.align || "left",
2281
+ showIndex: e.showIndex ?? !1
2282
+ });
2283
+ }), [X, E] = ha({
2284
+ loading: V(e, "loading")
2285
+ }), [W, Y] = Ra({
2286
+ size: V(e, "size")
2287
+ }), {
2288
+ paginationInfo: M,
2289
+ requestPagination: ee,
2290
+ setPagination: se
2291
+ } = ga({
2292
+ pagination: V(e, "pagination"),
2293
+ pageItemRender: ft({
2294
+ slots: l,
2295
+ props: e,
2296
+ key: "pageItemRender"
2297
+ })
2298
+ }), {
2299
+ proScroll: re,
2300
+ breakpoint: be
2301
+ } = $a({
2302
+ scroll: V(e, "scroll"),
2303
+ autoScroll: V(e, "autoScroll"),
2304
+ modalScroll: V(e, "modalScroll"),
2305
+ neverScroll: V(e, "neverScroll"),
2306
+ rowSelection: V(e, "rowSelection"),
2307
+ scrollBreakpoint: V(e, "scrollBreakpoint"),
2308
+ innerWidth: v,
2309
+ columns: A,
2310
+ screens: $
2311
+ }), {
2312
+ proColumns: de,
2313
+ setColumns: Re,
2314
+ resizeColumnWidth: oe
2315
+ } = da({
2316
+ draggable: V(e, "draggable"),
2317
+ neverScroll: V(e, "neverScroll"),
2318
+ autoScroll: V(e, "autoScroll"),
2319
+ breakpoint: be,
2320
+ scroll: re,
2321
+ columns: A
2322
+ }), {
2323
+ formCols: Pe,
2324
+ defaultFormSearch: t
2325
+ } = wa({
2326
+ searchMap: V(e, "searchMap"),
2327
+ columns: A
2328
+ }), {
2329
+ selectedKeys: s,
2330
+ selectedItems: y,
2331
+ changeRowKey: g,
2332
+ selectRowKey: S,
2333
+ selectAllRowKey: c,
2334
+ syncSelectedRows: fe,
2335
+ removeRowKeys: U,
2336
+ clearAllRowKeys: Fe
2337
+ } = ba(V(e, "rowKey"), V(e, "rowSelection")), ve = va(e), {
2338
+ run: ue,
2339
+ setTableDataList: Ie,
2340
+ operateTableDataRow: Se,
2341
+ isTreeDataRef: xe,
2342
+ dataSource: ie,
2343
+ handleTableChange: Ke
2344
+ } = ma({
2345
+ ...ve,
2346
+ waitRequest: h
2347
+ }, {
2348
+ loading: X,
2349
+ pageInfo: ee,
2350
+ setPagination: se,
2351
+ removeRowKeys: U,
2352
+ syncSelectedRows: fe,
2353
+ setLoading: E,
2354
+ setColumns: Re,
2355
+ columns: de,
2356
+ defaultFormSearch: t,
2357
+ params: V(e, "params"),
2358
+ onRequestError: e.onRequestError,
2359
+ onBeforeSearchSubmit: e.onBeforeSearchSubmit,
2360
+ hasCustomRender: T(() => Ge(e.customRender || l?.customRender))
2361
+ }, n), {
2362
+ tableCardEl: ke,
2363
+ tableScrollYHeight: Oe,
2364
+ tableListToolsHeight: jt,
2365
+ tableScrollEl: rt,
2366
+ tableOverHidden: Ht,
2367
+ barRef: Wt
2368
+ } = xa({
2369
+ hashId: u,
2370
+ scroll: re,
2371
+ baseClassName: o,
2372
+ fitPage: V(e, "fitPage")
2373
+ }), Yt = T(() => {
2374
+ const p = Oe.value && e.fitPage ? {
2375
+ y: Oe.value
2376
+ } : {};
2377
+ return {
2378
+ size: F(W),
2379
+ scroll: {
2380
+ ...F(re),
2381
+ ...p
2382
+ },
2383
+ dataSource: F(ie),
2384
+ pagination: F(M),
2385
+ virtualScroll: N.value,
2386
+ columns: F(de).filter((R) => R.show || R.show === void 0)
2387
+ };
2388
+ }), ut = T(() => {
2389
+ const p = ne(e.loading) ? ze(e.loading, "spinning") : {};
2390
+ return !p.indicator && m?.indicator?.value && (p.indicator = m?.indicator?.value), {
2391
+ spinning: e.showLoading ? Ge(X.value) : !1,
2392
+ ...p
2393
+ };
2394
+ }), Mt = T(() => {
2395
+ let p;
2396
+ const R = e.direction === "rtl" ? "bottomLeft" : "right", P = F(M)?.position;
2397
+ if (P !== null && Array.isArray(P)) {
2398
+ const z = P.find((te) => te.includes("top")), j = P.find((te) => te.includes("bottom")), _ = P.every((te) => `${te}` == "none");
2399
+ !z && !j && !_ && (p = R), z && (p = z.toLowerCase().replace("top", "")), j && (p = j.toLowerCase().replace("bottom", ""));
2400
+ } else
2401
+ p = R;
2402
+ return p;
2403
+ });
2404
+ ca(() => {
2405
+ C.value ? e.keepAliveReload && ue({
2406
+ params: e.params
2407
+ }) : C.value = !0;
2408
+ });
2409
+ const qt = async (p, R) => {
2410
+ if (k.value) {
2411
+ ue({
2412
+ params: p
2413
+ });
2414
+ return;
2415
+ }
2416
+ R === "reset" ? (n("reset", p), e.request && H.value?.resetReload && ue({
2417
+ params: p
2418
+ })) : e.request && (n("submit", p), ue({
2419
+ params: p
2420
+ }));
2421
+ }, Ve = (p, R, P, z) => {
2422
+ Ke(p, R, P, z), n("change", p, R, P, z);
2423
+ }, Kt = (p) => {
2424
+ n("expandedRowsChange", p);
2425
+ }, kt = (p, R) => {
2426
+ n("expand", p, R);
2427
+ }, Vt = (p, R) => oe(p, R), Xt = (p, R, P) => {
2428
+ let z = p;
2429
+ if (R) {
2430
+ 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 && Pt(j) && G > 0 ? pl(j, {
2431
+ cssObject: {
2432
+ fontSize: "14px",
2433
+ lineHeight: "22px",
2434
+ fontFamily: f?.token?.value?.fontFamily || b?.value?.fontFamily,
2435
+ ..._?.targetStyle || {}
2436
+ }
2437
+ }) : 0, Le = document.querySelector(`.${o} .ant-table-tbody`), je = d("div", {
2438
+ class: `${o}-ellipsis-text`
2439
+ }, [p]), dt = () => P.tooltip === !1 || ne(P.tooltip) && Ee < G && G > 0 ? je : d($e, Q({
2440
+ title: p,
2441
+ getPopupContainer: (Xe) => Le ?? Xe?.parentNode?.parentNode
2442
+ }, ne(P.tooltip) ? P.tooltip : {}, {
2443
+ destroyTooltipOnHide: !0
2444
+ }), Ba(je) ? je : {
2445
+ default: () => [je]
2446
+ });
2447
+ if (z = d("div", {
2448
+ class: D(`${o}-ellipsis`, _?.class),
2449
+ style: {
2450
+ "-webkit-line-clamp": te
2451
+ }
2452
+ }, [dt()]), P.copyable) {
2453
+ const Xe = typeof P.copyText == "function" ? P.copyText?.(P) : P.copyText || j;
2454
+ z = d("div", {
2455
+ class: `${o}-copyable`
2456
+ }, [d("div", {
2457
+ class: D(`${o}-ellipsis`, _?.class),
2458
+ style: {
2459
+ "-webkit-line-clamp": te
2460
+ }
2461
+ }, [dt()]), d(ol, {
2462
+ class: `${o}-copyable-icon`,
2463
+ onClick: () => {
2464
+ Sa(Xe), zl.success("复制成功");
2465
+ }
2466
+ }, null)]);
2467
+ }
2468
+ }
2469
+ return z;
2470
+ };
2471
+ function ct() {
2472
+ const p = yl({
2473
+ slots: l,
2474
+ props: e,
2475
+ key: "emptyText"
2476
+ });
2477
+ if (p !== !1 && m?.emptyText?.value !== !1) {
2478
+ const P = e.emptyTextProps?.extraProps || {}, z = p || m?.emptyText?.value, j = le(z), _ = j ? bt(z, P) : Tt(J(z) ? z : [z]);
2479
+ return d("div", {
2480
+ class: D(`${o}-empty-text`, u.value, e.emptyTextProps?.class),
2481
+ style: e.emptyTextProps?.style
2482
+ }, [j ? _ : J(_) && _.length ? _.map((te) => tt(te, P)) : d(Bt, {
2483
+ image: Na
2484
+ }, null)]);
2485
+ }
2486
+ return null;
2487
+ }
2488
+ const _t = () => {
2489
+ const p = ft({
2490
+ slots: l,
2491
+ props: e,
2492
+ key: "customRender"
2493
+ });
2494
+ if (p) {
2495
+ if (ie.value?.length) {
2496
+ const R = ae(F(ie));
2497
+ return p?.({
2498
+ dataSource: R,
2499
+ currentData: Ca(R, M.value)
2500
+ });
2501
+ }
2502
+ return ct();
2503
+ }
2504
+ return d(we, null, null);
2505
+ };
2506
+ return jl({
2507
+ tableSize: W,
2508
+ columns: de,
2509
+ cacheColumns: A,
2510
+ isMobile: B,
2511
+ formConfig: K,
2512
+ formAutoRequest: k,
2513
+ formActions: H,
2514
+ screenWidth: v,
2515
+ tableListToolsHeight: jt,
2516
+ styles: V(e, "styles"),
2517
+ classNames: V(e, "classNames"),
2518
+ action: {
2519
+ setTableSize: Y,
2520
+ reload: (p) => ue(p),
2521
+ toggle: O
2522
+ },
2523
+ setPagination: se
2524
+ }), a({
2525
+ formRef: () => ({
2526
+ getFormSearch: () => ({
2527
+ ...F(t),
2528
+ ...w.value?.getFormSearch(),
2529
+ ...e.params
2530
+ }),
2531
+ getFormInnerState: () => w.value?.getFormSearch() || {},
2532
+ restFormState: (p) => {
2533
+ h.value = !0, p && p?.(), w.value?.resetForm(!1), h.value = !1;
2534
+ }
2535
+ }),
2536
+ actionRef: () => ({
2537
+ loading: X,
2538
+ dataSource: ie,
2539
+ pageInfo: ee,
2540
+ pagination: M.value,
2541
+ selectedKeys: T(() => s.value),
2542
+ selectedItems: T(() => y.value),
2543
+ rowsSelection: {
2544
+ clear: Fe,
2545
+ select: S,
2546
+ remove: U,
2547
+ sync: fe,
2548
+ selectAll: c
2549
+ },
2550
+ reload: ue,
2551
+ getLoadingStatus: () => F(X),
2552
+ reloadAndReset: async (p) => {
2553
+ h.value = !0, se({
2554
+ current: 1,
2555
+ pageSize: ee?.pageSize || 10
2556
+ }), p && p?.callBack && (p.wait ? await p.callBack() : p.callBack()), w.value?.resetForm(!0), h.value = !1;
2557
+ },
2558
+ setPageInfo: Ve,
2559
+ setTableDataList: Ie,
2560
+ setPagination: se,
2561
+ operateTableDataRow: Se,
2562
+ setLoading: E
2563
+ })
2564
+ }), () => {
2565
+ const p = Ge(e.customRender || l.customRender), R = l.actions?.() || e.actionProps?.actions, P = gl({
2566
+ slots: l,
2567
+ props: e,
2568
+ keys: ["headerTitle", "headerTitleTip", "listToolAfter"],
2569
+ render: !0
2570
+ });
2571
+ return r(d("div", {
2572
+ ref: i,
2573
+ class: D(o, u.value, e.class, e.classNames?.root, [{
2574
+ [`${o}-no-scroll`]: !Object.keys(F(re) || {}).length,
2575
+ [`${o}-table-tree`]: xe.value,
2576
+ [`${o}-full-page`]: e.fitPage,
2577
+ [`${o}-full-screen`]: I.value
2578
+ }]),
2579
+ style: {
2580
+ ...e.style,
2581
+ ...e.styles?.root || {}
2582
+ }
2583
+ }, [d("div", {
2584
+ class: D(`${o}-content`, u.value, e.classNames?.content),
2585
+ style: e.styles?.content
2586
+ }, [(Pe.value.length > 0 || !!l.form) && e.form !== !1 && d(Ql, {
2587
+ ref: w,
2588
+ modalScroll: e.modalScroll,
2589
+ cardBordered: e.cardBordered,
2590
+ formCols: Pe.value,
2591
+ prefixCls: o,
2592
+ loading: F(X),
2593
+ onSearch: qt,
2594
+ defaultFormSearch: t.value
2595
+ }, {
2596
+ default: l.form ? () => l.form?.() : null
2597
+ }), d("div", {
2598
+ ref: ke,
2599
+ class: D(e.classNames?.card, u.value, `${o}-card`, e.cardBordered && `${o}-card-border`),
2600
+ style: e.styles?.card
2601
+ }, [d(ra, {
2602
+ options: e.options ? {
2603
+ ...za,
2604
+ ...ne(e.options) ? e.options : {}
2605
+ } : !1,
2606
+ titleTipText: e.titleTipText,
2607
+ actionsPlacement: e.actionProps?.placement,
2608
+ actionsRender: R,
2609
+ headerTitle: P.headerTitle,
2610
+ listToolAfter: P.listToolAfter,
2611
+ headerTitleTip: P.headerTitleTip
2612
+ }, null), p ? d(At, ut.value, {
2613
+ default: () => [d("div", {
2614
+ class: D(`${o}-list ${u.value}`, e.classNames?.list),
2615
+ style: e.styles?.list
2616
+ }, [d("div", {
2617
+ class: D(`${o}-list-content`, u.value, e.classNames?.listContent),
2618
+ style: {
2619
+ ...e.styles?.listContent || {},
2620
+ height: Oe.value ? pe(Oe.value) : e.styles?.listContent?.height
2621
+ }
2622
+ }, [_t()]), e.pagination !== !1 && ie.value?.length > 0 && d(Bl, Q(ce(F(M)), {
2623
+ class: D(u.value, `${o}-pagination`, `${o}-pagination-${Mt.value}`, e.classNames?.pagination),
2624
+ style: e.styles?.pagination,
2625
+ onChange: (z, j) => Ve({
2626
+ current: z,
2627
+ pageSize: j
2628
+ })
2629
+ }), null)])]
2630
+ }) : d(we, null, [d(Nl, Q(Dl(e, Object.keys(Dt)), Yt.value, {
2631
+ style: e.styles?.table,
2632
+ class: D(e.classNames?.table, u.value, Ht.value && `${o}-overflow-hidden`),
2633
+ loading: ut.value,
2634
+ rowKey: (z) => z[e.rowKey],
2635
+ transformCellText: (z) => {
2636
+ e.transformCellText && typeof e.transformCellText && e.transformCellText?.(z);
2637
+ const {
2638
+ column: j
2639
+ } = z;
2640
+ if (!j) return z.text;
2641
+ const _ = j?.key || j?.dataIndex;
2642
+ let te = !0, G = z.text;
2643
+ if (J(G))
2644
+ if (G.length === 0 || G.length === 1 && !le(G[0])) {
2645
+ G = G?.[0];
2646
+ const Ee = bl(G, j?.columnEmptyText || e?.columnEmptyText || "");
2647
+ te = Ee.success, G = ya(Ee.value, j?.valueType || e.columns?.find((Le) => (Le.key || Le.dataIndex) === _)?.valueType, o, u.value);
2648
+ } else G[0]?.type === "template" && (G = G[0]?.children);
2649
+ return j?.ellipsis ? Xt(G, te, j) : G;
2650
+ },
2651
+ rowSelection: e.rowSelection ? {
2652
+ ...ze(e.rowSelection, ["onSelect", "onSelectAll", "onChange", "selectedRowKeys"]),
2653
+ selectedRowKeys: s.value || [],
2654
+ onSelect: S,
2655
+ onSelectAll: c,
2656
+ onChange: g
2657
+ } : void 0,
2658
+ onChange: Ve,
2659
+ onExpandedRowsChange: Kt,
2660
+ onExpand: kt,
2661
+ onResizeColumn: (z, j) => Vt(z, j)
2662
+ }), {
2663
+ ...l,
2664
+ emptyText: () => ct()
2665
+ }), rt.value && !p && d(Jt, {
2666
+ to: rt.value
2667
+ }, {
2668
+ default: () => [d(la, {
2669
+ ref: Wt
2670
+ }, null)]
2671
+ })])])])]));
2672
+ };
2673
+ }
2674
+ });
2675
+ Ze.install = (e) => (e.component(Ze.name, Ze), e);
2676
+ function Qa(e, n) {
2677
+ function l() {
2678
+ const v = {
2679
+ params: {},
2680
+ searchMap: []
2681
+ };
2682
+ if (n?.state) {
2683
+ if (_e(n.state) && ne(n.state.value))
2684
+ return ye(v, ae(n.state.value));
2685
+ if (ne(n.state) && !_e(n.state))
2686
+ return ye(v, ae(n.state));
2687
+ }
2688
+ return v;
2689
+ }
2690
+ const a = lt(ye(l(), {
2691
+ request: n?.request
2692
+ }));
2693
+ n?.state && q(() => n.state && _e(n.state) ? n.state.value : n.state, () => {
2694
+ f();
2695
+ }, { deep: !0 });
2696
+ const o = T(() => e.value ? e.value.actionRef() : {}), r = T(() => e.value ? e.value.formRef() : {}), u = T(() => ({
2697
+ ...o.value.pageInfo || {},
2698
+ ...r.value.getFormSearch?.() || {}
2699
+ })), b = x(!!o.value.loading?.value);
2700
+ q(() => o.value.loading?.value, (v) => {
2701
+ b.value = !!v;
2702
+ }), q(b, (v) => {
2703
+ o.value?.setLoading?.(!!v);
2704
+ });
2705
+ function f() {
2706
+ Cl(a, l());
2707
+ }
2708
+ function $(v, C) {
2709
+ a.searchMap && (a.searchMap = ae(a.searchMap).map((m) => m.name === v ? ye(m, C) : m));
2710
+ }
2711
+ return {
2712
+ formRef: r,
2713
+ actionRef: o,
2714
+ tableState: a,
2715
+ requestSearch: u,
2716
+ loading: b,
2717
+ dataSource: T(() => o?.value?.dataSource?.value || []),
2718
+ selectedKeys: T(() => o?.value?.selectedKeys?.value || []),
2719
+ selectedItems: T(() => o?.value?.selectedItems?.value || []),
2720
+ rowsSelection: o?.value?.rowsSelection,
2721
+ setTableDataList: (v) => o.value?.setTableDataList?.(v),
2722
+ reloadAndReset: (v) => o.value?.reloadAndReset?.(v),
2723
+ setPageInfo: (v, C, m, i) => o.value?.setPageInfo?.(v, C, m, i),
2724
+ setPagination: (v) => o.value?.setPagination?.(v),
2725
+ setLoading: (v) => b.value = v,
2726
+ operateTableDataRow: (v) => o.value?.operateTableDataRow?.(v),
2727
+ reload: (v) => o.value?.reload?.(v),
2728
+ updateSearchMap: $
2729
+ };
2730
+ }
2731
+ export {
2732
+ Ze as GProTable,
2733
+ he as proTableProps,
2734
+ Qa as useTable
2735
+ };