@gx-design-vue/pro-table 0.2.0-beta.10 → 0.2.0-beta.101

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