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

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 +18 -15
  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 +2836 -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 +115 -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,2836 @@
1
+ import { isObject as J, cloneDeep as ie, isArray as ue, isBoolean as se, classNames as Se, filterEmpty as Bt, getPrefixCls as ut, getRandomNumber as at, genColumnKey as Rt, isDeepEqualReact as Ve, compareArray as al, isNumber as Qe, runFunction as nl, convertValueBoolean as Ie, getSortIndex as ul, isFunction as Ae, handleCurrentPage as il, getSlot as Ft, arrayRepeat as sl, isString as It, handleShowIndex as ol, hanndleEmptyField as rl, getTextWidth as cl, getSlotVNode as Fe } from "@gx-design-vue/pro-utils";
2
+ import { reactive as we, isReactive as dl, watch as q, computed as w, ref as j, toRaw as Be, watchEffect as Ye, defineComponent as he, createVNode as c, Fragment as _e, nextTick as Ot, isVNode as Z, mergeProps as _, h as kt, cloneVNode as it, unref as C, createTextVNode as Ke, renderSlot as fl, onActivated as hl, getCurrentInstance as ml, onUnmounted as vl, onDeactivated as gl, onMounted as yl, toRef as ce } from "vue";
3
+ import { tableProps as bl } from "ant-design-vue/es/table/Table";
4
+ import { omit as qe, pick as xt } from "lodash-es";
5
+ import "ant-design-vue/es/_util/props-util";
6
+ import { warning as Cl } from "ant-design-vue/es/vc-util/warning";
7
+ import { UpOutlined as xl, DownOutlined as Sl, SettingOutlined as Pt, VerticalAlignTopOutlined as wl, VerticalAlignMiddleOutlined as pl, VerticalAlignBottomOutlined as Tl, InfoCircleOutlined as $l, ColumnHeightOutlined as Bl, FullscreenExitOutlined as Rl, FullscreenOutlined as Fl, ReloadOutlined as Il, CopyOutlined as Ol } from "@ant-design/icons-vue";
8
+ import { useProAppContext as jt } from "@gx-design-vue/pro-app";
9
+ import { useContext as kl, useProStyle as Xe, unit as St } from "@gx-design-vue/pro-provider";
10
+ import { useFullscreen as Nt, useWindowSize as Pl } from "@vueuse/core";
11
+ import { Grid as st, Space as xe, Button as wt, Input as pt, TimePicker as jl, DatePicker as Et, TreeSelect as Nl, Spin as nt, Select as El, Popover as Dl, Checkbox as Ml, Tooltip as fe, Tree as Al, Dropdown as Kl, Menu as He, Pagination as zl, Table as Yl, message as Ll, Empty as Wl } from "ant-design-vue";
12
+ import X from "dayjs";
13
+ import { useMemo as Ge, tryOnUnmounted as Hl } from "@gx-design-vue/pro-hooks";
14
+ function Ua(e, l) {
15
+ var x, S, f, b;
16
+ function a() {
17
+ return l != null && l.state && J(l == null ? void 0 : l.state) ? ie(Be(l == null ? void 0 : l.state)) : {};
18
+ }
19
+ const o = we({
20
+ params: ((x = l == null ? void 0 : l.state) == null ? void 0 : x.params) || {},
21
+ // @ts-ignore
22
+ request: async (...u) => {
23
+ var n;
24
+ return l != null && l.request ? await ((n = l == null ? void 0 : l.request) == null ? void 0 : n.call(l, ...u)) : void 0;
25
+ }
26
+ });
27
+ l != null && l.state && (dl(l.state) ? q(() => l == null ? void 0 : l.state, () => {
28
+ Object.assign(o, a());
29
+ }, { deep: !0, immediate: !0 }) : Object.assign(o, a()));
30
+ const s = 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 = s.value) == null ? void 0 : u.pageState) || {},
40
+ ...((r = (n = i.value) == null ? void 0 : n.getFormState) == null ? void 0 : r.call(n)) || {}
41
+ };
42
+ }), m = j(!!((f = (S = s.value) == null ? void 0 : S.loading) != null && f.value));
43
+ return q(() => {
44
+ var u, n;
45
+ return (n = (u = s.value) == null ? void 0 : u.loading) == null ? void 0 : n.value;
46
+ }, (u) => {
47
+ m.value = !!u;
48
+ }), q(m, (u) => {
49
+ var n, r;
50
+ (r = (n = s.value) == null ? void 0 : n.setLoading) == null || r.call(n, !!u);
51
+ }), {
52
+ formRef: i,
53
+ actionRef: s,
54
+ tableState: o,
55
+ requestParams: d,
56
+ loading: m,
57
+ dataSource: w(() => {
58
+ var u, n;
59
+ return ((n = (u = s == null ? void 0 : s.value) == null ? void 0 : u.dataSource) == null ? void 0 : n.value) || [];
60
+ }),
61
+ selectedKeys: w(() => {
62
+ var u, n;
63
+ return ((n = (u = s == null ? void 0 : s.value) == null ? void 0 : u.selectedKeys) == null ? void 0 : n.value) || [];
64
+ }),
65
+ selectedItems: w(() => {
66
+ var u, n;
67
+ return ((n = (u = s == null ? void 0 : s.value) == null ? void 0 : u.selectedItems) == null ? void 0 : n.value) || [];
68
+ }),
69
+ rowsSelection: (b = s == null ? void 0 : s.value) == null ? void 0 : b.rowsSelection,
70
+ mutate: (u) => {
71
+ var n, r;
72
+ return (r = (n = s.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 = s.value) == null ? void 0 : n.reloadAndReset) == null ? void 0 : r.call(n, u);
77
+ },
78
+ setPageAndReload: (u, n, r, y) => {
79
+ var T, O;
80
+ return (O = (T = s.value) == null ? void 0 : T.setPageAndReload) == null ? void 0 : O.call(T, u, n, r, y);
81
+ },
82
+ setPagination: (u) => {
83
+ var n, r;
84
+ return (r = (n = s.value) == null ? void 0 : n.setPagination) == null ? void 0 : r.call(n, u);
85
+ },
86
+ setLoading: (u) => m.value = u,
87
+ setData: (u) => {
88
+ var n, r;
89
+ return (r = (n = s.value) == null ? void 0 : n.setData) == null ? void 0 : r.call(n, u);
90
+ },
91
+ reload: (u) => {
92
+ var n, r;
93
+ return (r = (n = s.value) == null ? void 0 : n.reload) == null ? void 0 : r.call(n, u);
94
+ }
95
+ };
96
+ }
97
+ const Vl = ["rowKey", "rowSelection", "columns", "pagination", "size", "bordered", "loading"], Dt = {
98
+ ...qe(bl(), Vl),
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
+ }, de = {
119
+ ...Dt,
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: Gl, useInjectContext: me } = kl("pro-table");
392
+ function Ce(e, l) {
393
+ return typeof l == "function" ? l(X(e)) : X(e).format(l);
394
+ }
395
+ function Me(e, l) {
396
+ return l ? "YYYY-MM-DD HH:mm:ss" : e ?? "YYYY-MM-DD";
397
+ }
398
+ const Tt = (e, l, a = "string") => {
399
+ if (ue(e)) {
400
+ const [o, s] = e;
401
+ let i, d;
402
+ if (Array.isArray(l) ? (i = l[0], d = l[1]) : typeof l == "object" && l.type === "mask" ? (i = l.format, d = l.format) : (i = l, d = l), a === "string") {
403
+ const m = o ? Ce(o, i) : "", x = s ? Ce(s, d) : "";
404
+ return [m, x];
405
+ }
406
+ return [X(o), X(s)];
407
+ }
408
+ }, Ql = (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 _l(e, l) {
476
+ const a = we({});
477
+ function o() {
478
+ Object.keys(e).forEach((d) => {
479
+ s(d, e[d]);
480
+ });
481
+ const i = l.find((d) => d.valueType === "dateRange");
482
+ i && s(i.name || "", e[i.rangeStartName || "start"] ? [
483
+ e[i.rangeStartName || "start"],
484
+ e[i.rangeEndName || "end"]
485
+ ] : []);
486
+ }
487
+ Ye(() => {
488
+ o();
489
+ });
490
+ function s(i, d) {
491
+ a[i] = d;
492
+ }
493
+ return {
494
+ formState: a,
495
+ resetFormState: o,
496
+ changeFormState: s
497
+ };
498
+ }
499
+ const {
500
+ useBreakpoint: ql
501
+ } = st, {
502
+ MonthPicker: Xl,
503
+ RangePicker: Ul,
504
+ YearPicker: Jl,
505
+ WeekPicker: Zl,
506
+ QuarterPicker: ea
507
+ } = Et, Je = [{
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
+ }], Mt = /* @__PURE__ */ he({
526
+ name: "ProTableForm",
527
+ props: {
528
+ modal: de.modalScroll,
529
+ searchMap: {
530
+ type: Array,
531
+ default: () => []
532
+ },
533
+ loading: de.loading,
534
+ cardBordered: de.cardBordered,
535
+ prefixCls: String,
536
+ defaultParams: Object,
537
+ onSearch: Function
538
+ },
539
+ setup(e, {
540
+ slots: l,
541
+ expose: a
542
+ }) {
543
+ const {
544
+ wrapSSR: o,
545
+ hashId: s
546
+ } = Xe("ProTableForm", [Ql], e.prefixCls), i = jt(), d = ql(), {
547
+ manualSearch: m,
548
+ searchConfig: x,
549
+ searchActions: S
550
+ } = me(), {
551
+ formState: f,
552
+ resetFormState: b,
553
+ changeFormState: u
554
+ } = _l(e.defaultParams || {}, e.searchMap || []), n = j(!1), r = w(() => {
555
+ var t, g;
556
+ return se((t = S.value) == null ? void 0 : t.reset) ? (g = S.value) == null ? void 0 : g.reset : m.value;
557
+ }), y = w(() => {
558
+ var t;
559
+ return O((t = x.value) == null ? void 0 : t.span);
560
+ }), T = w(() => {
561
+ var t;
562
+ return (t = x.value) == null ? void 0 : t.label;
563
+ });
564
+ q(() => {
565
+ var t;
566
+ return (t = x.value) == null ? void 0 : t.defaultCollapsed;
567
+ }, (t) => {
568
+ n.value = n.value || !!t;
569
+ });
570
+ function O(t) {
571
+ let g = 4;
572
+ for (let F = 0; F < Je.length; F += 1) {
573
+ const p = Je[F].value;
574
+ if (d.value[p]) {
575
+ g = (t == null ? void 0 : t[p]) || (e.modal ? 3 : Je[F].span);
576
+ break;
577
+ }
578
+ }
579
+ return g;
580
+ }
581
+ const R = (t) => {
582
+ n.value = t;
583
+ }, A = (t, g, F) => (t + 1) % g === 0 ? {
584
+ ...F,
585
+ marginRight: 0
586
+ } : {
587
+ ...F,
588
+ marginRight: "2%"
589
+ }, V = () => {
590
+ const t = ie(f), g = e.searchMap.find((P) => P.valueType === "text") || "", F = e.searchMap.find((P) => P.valueType === "dateRange") || "", p = e.searchMap.find((P) => P.valueType === "treeSelect");
591
+ return g && (t[g.name] = f[g.name] || g.initialValue || ""), F && (t[F.rangeStartName || "start"] = t[F.name] ? t[F.name][0] : "", t[F.rangeEndName || "end"] = t[F.name] ? t[F.name][1] : "", delete t[F.name]), p && (p != null && p.name && ue(f[p == null ? void 0 : p.name]) && (t[p.name] = f[p.name].length ? f[p.name].map((P) => P[p.valueKey === "text" ? "label" : "value"]).join() : ""), p != null && p.name && ue(t[p == null ? void 0 : p.name]) && (t[p.name] = t[p.name].length ? t[p.name].map((P) => P[p.valueKey === "text" ? "label" : "value"]) : "")), t;
592
+ }, L = (t = !1, g) => {
593
+ Ot(() => {
594
+ var F;
595
+ (m.value || t) && ((F = e.onSearch) == null || F.call(e, V(), t ? g ? "reset" : "submit" : void 0));
596
+ });
597
+ }, W = (t, g) => {
598
+ var F, p;
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 ?? ((F = g.field) != null && F.treeCheckable || (p = g.field) != null && p.multiple ? [] : null));
608
+ break;
609
+ case "date":
610
+ u(g.name || "", t ? Ce(t, Me(g.valueFormat, g.showTime)) : null);
611
+ break;
612
+ case "dateWeek":
613
+ u(g.name || "", t ? Ce(t, "YYYY-wo") : null);
614
+ break;
615
+ case "dateMonth":
616
+ u(g.name || "", t ? Ce(t, "YYYY-MM") : null);
617
+ break;
618
+ case "dateQuarter":
619
+ u(g.name || "", t ? Ce(t, "YYYY-QQ") : null);
620
+ break;
621
+ case "dateYear":
622
+ u(g.name || "", t ? Ce(t, "YYYY") : null);
623
+ break;
624
+ case "dateRange":
625
+ u(g.name || "", t && ue(t) && t.length === 2 ? Tt(t, Me(g.valueFormat, g.showTime)) : null);
626
+ break;
627
+ case "time":
628
+ u(g.name || "", t ? Ce(t, g.valueFormat || "HH:mm:ss") : null);
629
+ break;
630
+ }
631
+ g.valueType === "treeSelect" || g.valueType, L();
632
+ }, K = (t = !0) => {
633
+ b(), L(!0, t);
634
+ };
635
+ a({
636
+ getFormState: () => V(),
637
+ resetForm: K
638
+ });
639
+ const G = () => {
640
+ var g;
641
+ const t = (g = i == null ? void 0 : i.emptyText) == null ? void 0 : g.value;
642
+ if (t) {
643
+ const F = Z(t), p = F ? kt(t) : Bt(t || []);
644
+ return c("div", {
645
+ class: Se(`${e.prefixCls}-search-empty-text`, s.value)
646
+ }, [F ? p : ue(p) ? p.map((P) => it(P)) : void 0]);
647
+ }
648
+ }, H = () => (m.value || r.value) && c(xe, null, {
649
+ default: () => [r.value && c(wt, {
650
+ onClick: () => K()
651
+ }, {
652
+ default: () => {
653
+ var t;
654
+ return [((t = S.value) == null ? void 0 : t.resetText) || "重置"];
655
+ }
656
+ }), m.value && c(wt, {
657
+ loading: e.loading,
658
+ type: "primary",
659
+ onClick: () => L(!0)
660
+ }, {
661
+ default: () => {
662
+ var t;
663
+ return [((t = S.value) == null ? void 0 : t.searchText) || "查询"];
664
+ }
665
+ })]
666
+ }), oe = ({
667
+ formItemStyle: t,
668
+ advanced: g,
669
+ showAdvanced: F = !0
670
+ }) => c("div", {
671
+ style: t,
672
+ class: `${e.prefixCls}-search-collapse-button ${s.value}`
673
+ }, [c(xe, {
674
+ size: 16
675
+ }, {
676
+ default: () => {
677
+ var p, P;
678
+ return [H(), F && c("span", {
679
+ class: `${e.prefixCls}-a ${s.value}`,
680
+ onClick: () => R(!g)
681
+ }, [g ? "收起" : "展开", (p = x.value) != null && p.collapseRender ? (P = x.value) == null ? void 0 : P.collapseRender(g) : g ? c(xl, null, null) : c(Sl, null, null)])];
682
+ }
683
+ })]), le = (t) => {
684
+ var p, P, I, N;
685
+ let g;
686
+ const F = m.value ? pt : pt.Search;
687
+ switch (t.valueType) {
688
+ case "text":
689
+ g = c(F, _({
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: (v) => W(v.target.value, t),
697
+ onSearch: (v) => L()
698
+ }, t.field || {}), null);
699
+ break;
700
+ case "select":
701
+ g = c(El, _({
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: (v) => v && v.parentNode ? v.parentNode : v,
711
+ notFoundContent: t.loading === void 0 ? void 0 : t.loading ? c(nt, {
712
+ size: "small",
713
+ indicator: (p = i == null ? void 0 : i.indicator) == null ? void 0 : p.value
714
+ }, null) : G(),
715
+ onChange: (v) => W(v, t),
716
+ options: t.loading ? [] : (P = t == null ? void 0 : t.valueEnum) == null ? void 0 : P.map((v) => ({
717
+ label: v.text,
718
+ value: v.value
719
+ }))
720
+ }, t.field || {}), null);
721
+ break;
722
+ case "treeSelect":
723
+ g = c(Nl, _({
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: (v) => v && v.parentNode ? v.parentNode : v,
732
+ notFoundContent: t.loading === void 0 ? void 0 : t.loading ? c(nt, {
733
+ size: "small",
734
+ indicator: (I = i == null ? void 0 : i.indicator) == null ? void 0 : I.value
735
+ }, null) : G(),
736
+ onChange: (v) => W(v, t)
737
+ }, t.field || {}), null);
738
+ break;
739
+ case "date":
740
+ g = c(Et, _({
741
+ style: {
742
+ width: "100%"
743
+ },
744
+ value: f[t.name] ? X(f[t.name]) : void 0,
745
+ getPopupContainer: (v) => v && v.parentNode ? v.parentNode : v,
746
+ placeholder: t.placeholder || "请选择",
747
+ allowClear: t.allowClear ?? !0,
748
+ format: Me(t.valueFormat, t.showTime),
749
+ showTime: t.showTime,
750
+ showToday: t.showToday || !0,
751
+ onChange: (v) => W(v, t)
752
+ }, t.field || {}), null);
753
+ break;
754
+ case "dateWeek":
755
+ g = c(Zl, _({
756
+ style: {
757
+ width: "100%"
758
+ },
759
+ value: f[t.name] ? X(f[t.name], t.valueFormat || "YYYY-wo") : void 0,
760
+ getPopupContainer: (v) => v && v.parentNode ? v.parentNode : v,
761
+ allowClear: t.allowClear ?? !0,
762
+ placeholder: t.placeholder || "请选择",
763
+ onChange: (v) => W(v, t)
764
+ }, t.field || {}), null);
765
+ break;
766
+ case "dateMonth":
767
+ g = c(Xl, _({
768
+ style: {
769
+ width: "100%"
770
+ },
771
+ value: f[t.name] ? X(f[t.name], t.valueFormat || "YYYY-MM") : void 0,
772
+ getPopupContainer: (v) => v && v.parentNode ? v.parentNode : v,
773
+ allowClear: t.allowClear ?? !0,
774
+ placeholder: t.placeholder || "请选择",
775
+ onChange: (v) => W(v, t)
776
+ }, t.field || {}), null);
777
+ break;
778
+ case "dateQuarter":
779
+ g = c(ea, _({
780
+ style: {
781
+ width: "100%"
782
+ },
783
+ value: f[t.name] ? X(f[t.name], t.valueFormat || "YYYY-QQ") : void 0,
784
+ getPopupContainer: (v) => v && v.parentNode ? v.parentNode : v,
785
+ allowClear: t.allowClear ?? !0,
786
+ placeholder: t.placeholder || "请选择",
787
+ onChange: (v) => W(v, t)
788
+ }, t.field || {}), null);
789
+ break;
790
+ case "dateYear":
791
+ g = c(Jl, _({
792
+ style: {
793
+ width: "100%"
794
+ },
795
+ value: f[t.name] ? X(f[t.name], t.valueFormat || "YYYY") : void 0,
796
+ getPopupContainer: (v) => v && v.parentNode ? v.parentNode : v,
797
+ allowClear: t.allowClear ?? !0,
798
+ placeholder: t.placeholder || "请选择",
799
+ onChange: (v) => W(v, t)
800
+ }, t.field || {}), null);
801
+ break;
802
+ case "dateRange":
803
+ g = c(Ul, _({
804
+ style: {
805
+ width: "100%"
806
+ },
807
+ value: f[t.name] && ue(f[t.name]) && ((N = f[t.name]) == null ? void 0 : N.length) === 2 ? Tt(f[t.name], Me(t.valueFormat, t.showTime), "dayjs") : void 0,
808
+ getPopupContainer: (v) => v && v.parentNode ? v.parentNode : v,
809
+ placeholder: t.placeholder || ["开始日期", "结束日期"],
810
+ format: Me(t.valueFormat, t.showTime),
811
+ showTime: t.showTime,
812
+ onChange: (v) => W(v, t)
813
+ }, t.field || {}), null);
814
+ break;
815
+ case "time":
816
+ g = c(jl, _({
817
+ style: {
818
+ width: "100%"
819
+ },
820
+ value: f[t.name] ? X(f[t.name], t.valueFormat || "HH:mm:ss") : void 0,
821
+ getPopupContainer: (v) => v && v.parentNode ? v.parentNode : v,
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: (v) => W(v, t)
827
+ }, t.field || {}), null);
828
+ break;
829
+ }
830
+ return g;
831
+ }, re = ({
832
+ formItemStyle: t = {},
833
+ item: g
834
+ }) => {
835
+ var I, N, v, z, ve, pe, Te, ee;
836
+ const F = Z(g) ? (I = g.props) == null ? void 0 : I.label : g.label, p = (Z(g) ? (N = g.props) == null ? void 0 : N.labelWidth : g.labelWidth) || ((v = T.value) == null ? void 0 : v.width), P = (Z(g) ? (z = g.props) == null ? void 0 : z.labelAlign : g.labelAlign) || ((ve = T.value) == null ? void 0 : ve.align);
837
+ return c("div", {
838
+ class: `${e.prefixCls}-search-item`,
839
+ style: {
840
+ ...t,
841
+ gap: (pe = T.value) != null && pe.gap ? St((Te = T.value) == null ? void 0 : Te.gap) : void 0
842
+ }
843
+ }, [F && c("div", {
844
+ class: Se(`${e.prefixCls}-search-item-label`, ((ee = T.value) == null ? void 0 : ee.colon) === !1 && `${e.prefixCls}-search-item-label-no-colon`, P && `${e.prefixCls}-search-item-label-${P}`),
845
+ style: {
846
+ width: p ? St(p) : void 0
847
+ }
848
+ }, [F]), c("div", {
849
+ class: Se(`${e.prefixCls}-search-item-children`)
850
+ }, [Z(g) ? g : le(g)])]);
851
+ }, Oe = () => {
852
+ var F;
853
+ const t = [...e.searchMap, ...((F = l.default) == null ? void 0 : F.call(l)) || []], g = {
854
+ width: `${(100 - (y.value - 1) * 2) / y.value}%`
855
+ };
856
+ return t.map((p, P) => {
857
+ const I = A(P, y.value, g);
858
+ return t.length < y.value || n.value ? c(_e, null, [re({
859
+ formItemStyle: I,
860
+ item: p
861
+ }), P === t.length - 1 && oe({
862
+ formItemStyle: {
863
+ flex: 1,
864
+ justifyContent: "flex-end"
865
+ },
866
+ advanced: n.value,
867
+ showAdvanced: n.value
868
+ })]) : c(_e, null, [P < y.value - 1 && re({
869
+ formItemStyle: I,
870
+ item: p
871
+ }), P === y.value - 1 && (y.value - 1 === 0 || t.length === y.value) && re({
872
+ formItemStyle: I,
873
+ item: p
874
+ }), P === y.value - 1 && t.length >= y.value && oe({
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 o(c("div", {
888
+ class: Se(s.value, `${e.prefixCls}-search`, t, s.value, (g = x.value) == null ? void 0 : g.className)
889
+ }, [Oe()]));
890
+ };
891
+ }
892
+ });
893
+ Mt.inheritAttrs = !1;
894
+ const ze = (e) => {
895
+ const l = j(null);
896
+ return l.value = e, (...a) => {
897
+ var o;
898
+ return (o = l.value) == null ? void 0 : o.call(l, ...a);
899
+ };
900
+ }, ta = (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
+ }), Ze = ({
983
+ title: e,
984
+ show: l,
985
+ treeKey: a,
986
+ fixed: o
987
+ }, {
988
+ slots: s
989
+ }) => {
990
+ const {
991
+ cacheColumns: i,
992
+ settingsAction: d
993
+ } = me();
994
+ return l ? c(fe, {
995
+ title: e
996
+ }, {
997
+ default: () => {
998
+ var m;
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((T) => T.uuid === a)) == 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: o
1010
+ }
1011
+ };
1012
+ d == null || d.setColumnsMap(u, "fixed");
1013
+ }
1014
+ }, [(m = s.default) == null ? void 0 : m.call(s)])];
1015
+ }
1016
+ }) : null;
1017
+ }, la = /* @__PURE__ */ he({
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: l
1029
+ } = me(), a = w(() => {
1030
+ var s, i;
1031
+ return ((i = (s = C(l)) == null ? void 0 : s.find((d) => d.uuid === e.treeKey)) == null ? void 0 : i.key) || "";
1032
+ }), o = w(() => a.value === "action" && e.autoScroll);
1033
+ return () => {
1034
+ const s = c("span", {
1035
+ class: [`${e.className}-list-item-option`, e.hashId]
1036
+ }, [c(Ze, {
1037
+ treeKey: e.treeKey || "",
1038
+ fixed: "left",
1039
+ title: "固定在列首",
1040
+ show: e.fixed !== "left" && !o.value
1041
+ }, {
1042
+ default: () => [c(wl, null, null)]
1043
+ }), c(Ze, {
1044
+ treeKey: e.treeKey || "",
1045
+ fixed: void 0,
1046
+ title: "不固定",
1047
+ show: !!e.fixed && !o.value
1048
+ }, {
1049
+ default: () => [c(pl, null, null)]
1050
+ }), c(Ze, {
1051
+ treeKey: e.treeKey || "",
1052
+ fixed: "right",
1053
+ title: "固定在列尾",
1054
+ show: e.fixed !== "right"
1055
+ }, {
1056
+ default: () => [c(Tl, 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]), s]);
1064
+ };
1065
+ }
1066
+ }), et = /* @__PURE__ */ he({
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 l = j(at().uuid(15)), a = w(() => e.list && e.list.length > 0), o = j([]), s = j([]), {
1082
+ cacheColumns: i,
1083
+ slots: d,
1084
+ settingsAction: m
1085
+ } = me(), x = (u, n) => u.map(({
1086
+ key: r,
1087
+ children: y,
1088
+ uuid: T,
1089
+ ...O
1090
+ }) => {
1091
+ var L;
1092
+ const R = (m == null ? void 0 : m.columnsMap[r || "null"]) || {
1093
+ show: !0
1094
+ };
1095
+ let A = !1;
1096
+ R.show !== !1 && (n == null ? void 0 : n.show) !== !1 && !y && (A = !0);
1097
+ const V = {
1098
+ key: T || "",
1099
+ ...qe(O, ["dataIndex"]),
1100
+ checked: A,
1101
+ selectable: !1,
1102
+ disabled: R.disable === !0,
1103
+ disableCheckbox: typeof R.disable == "boolean" ? R.disable : (L = R.disable) == null ? void 0 : L.checkbox,
1104
+ isLeaf: !0
1105
+ };
1106
+ return y && (V.children = x(y, R)), V;
1107
+ });
1108
+ Ye(() => {
1109
+ const u = x(e.list || []);
1110
+ o.value = u, s.value = u.filter((n) => n.checked).map((n) => n.key), (m == null ? void 0 : m.operationType.value) === "fixed" && (l.value = at().uuid(15));
1111
+ });
1112
+ const S = ze((u, n, r) => {
1113
+ var K, G;
1114
+ const y = ((K = C(i).find((H) => H.uuid === u)) == null ? void 0 : K.key) || "", T = ((G = C(i).find((H) => H.uuid === n)) == null ? void 0 : G.key) || "", O = {
1115
+ ...m == null ? void 0 : m.columnsMap
1116
+ }, R = [...m.sortKeyColumns.value], A = R.findIndex((H) => H === y), V = R.findIndex((H) => H === T), L = r > A;
1117
+ if (A < 0)
1118
+ return;
1119
+ const W = R[A];
1120
+ R.splice(A, 1), r === 0 ? R.unshift(W) : R.splice(L ? V : V + 1, 0, W), R.forEach((H, oe) => {
1121
+ O[H] = {
1122
+ ...O[H] || {},
1123
+ order: oe
1124
+ };
1125
+ }), m == null || m.setColumnsMap(O, "drop"), m == null || m.setSortKeyColumns(R);
1126
+ }), f = ze((u) => {
1127
+ var R;
1128
+ const n = u.node.key, r = ((R = C(i).find((A) => A.uuid === n)) == null ? void 0 : R.key) || "", T = {
1129
+ ...(m == null ? void 0 : m.columnsMap[r]) || {}
1130
+ };
1131
+ T.show = u.checked;
1132
+ const O = {
1133
+ ...m == null ? void 0 : m.columnsMap,
1134
+ [r]: T
1135
+ };
1136
+ m == null || m.setColumnsMap(O, "show");
1137
+ }), b = (u) => {
1138
+ const n = C(i).find((r) => r.uuid === u.key);
1139
+ return u.title || fl(d, "headerCell", {
1140
+ title: n.title,
1141
+ column: n
1142
+ }, () => [n.title]);
1143
+ };
1144
+ return () => {
1145
+ var u, n;
1146
+ return a.value ? c(_e, null, [e.showTitle && c("span", {
1147
+ class: [`${e.className}-list-title`, e.hashId]
1148
+ }, [e.title]), c(Al, {
1149
+ key: l.value,
1150
+ draggable: e.draggable && !!((u = o.value) != null && u.length) && ((n = o.value) == null ? void 0 : n.length) > 1,
1151
+ checkable: e.checkable,
1152
+ blockNode: !0,
1153
+ showLine: !1,
1154
+ checkedKeys: s.value,
1155
+ height: 280,
1156
+ onDrop: (r) => {
1157
+ const y = r.node.key, T = r.dragNode.key, {
1158
+ dropPosition: O,
1159
+ dropToGap: R
1160
+ } = r, A = O === -1 || !R ? O + 1 : O;
1161
+ S(T, y, A);
1162
+ },
1163
+ onCheck: (r, y) => f(y),
1164
+ treeData: o.value
1165
+ }, {
1166
+ title: (r) => {
1167
+ var T;
1168
+ const y = {
1169
+ ...r,
1170
+ children: void 0,
1171
+ title: b(r),
1172
+ autoScroll: (T = m == null ? void 0 : m.autoScroll) == null ? void 0 : T.value
1173
+ };
1174
+ return c(la, _({
1175
+ hashId: e.hashId,
1176
+ className: e.className
1177
+ }, y, {
1178
+ treeKey: y.key
1179
+ }), null);
1180
+ }
1181
+ })]) : null;
1182
+ };
1183
+ }
1184
+ }), aa = /* @__PURE__ */ he({
1185
+ props: {
1186
+ hashId: String,
1187
+ className: String,
1188
+ draggable: Boolean,
1189
+ checkable: Boolean
1190
+ },
1191
+ setup(e) {
1192
+ const {
1193
+ columns: l
1194
+ } = me(), a = j([]), o = j([]), s = j([]), i = j([]);
1195
+ q(() => l.value, (x) => {
1196
+ a.value = [], o.value = [], s.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
+ o.value.push(S);
1206
+ return;
1207
+ }
1208
+ if (f === "right") {
1209
+ a.value.push(S);
1210
+ return;
1211
+ }
1212
+ s.value.push(S);
1213
+ });
1214
+ }, {
1215
+ immediate: !0
1216
+ });
1217
+ const d = w(() => a.value && a.value.length > 0), m = w(() => o.value && o.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 || m.value
1223
+ }
1224
+ }, [c(et, {
1225
+ title: "固定在左侧",
1226
+ list: o.value,
1227
+ keys: i.value,
1228
+ hashId: e.hashId,
1229
+ draggable: e.draggable,
1230
+ checkable: e.checkable,
1231
+ className: e.className
1232
+ }, null), c(et, {
1233
+ list: s.value,
1234
+ keys: i.value,
1235
+ hashId: e.hashId,
1236
+ draggable: e.draggable,
1237
+ checkable: e.checkable,
1238
+ title: "不固定",
1239
+ showTitle: m.value || d.value,
1240
+ className: e.className
1241
+ }, null), c(et, {
1242
+ title: "固定在右侧",
1243
+ list: a.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
+ }), na = /* @__PURE__ */ he({
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 l = ut({
1266
+ suffixCls: "table-column-setting",
1267
+ isPor: !0
1268
+ }), {
1269
+ wrapSSR: a,
1270
+ hashId: o
1271
+ } = Xe("ColumnSetting", [ta], l), {
1272
+ columns: s,
1273
+ settingsAction: i
1274
+ } = me(), d = ze((b = !0) => {
1275
+ const u = {}, n = (r) => {
1276
+ r.forEach(({
1277
+ key: y,
1278
+ fixed: T,
1279
+ index: O,
1280
+ children: R
1281
+ }) => {
1282
+ const A = Rt(y, O);
1283
+ A && (u[A] = {
1284
+ show: b,
1285
+ fixed: T
1286
+ }), R && n(R);
1287
+ });
1288
+ };
1289
+ n(s.value), i == null || i.setColumnsMap(u, "show");
1290
+ }), m = ze((b) => {
1291
+ b.target.checked ? d() : d(!1);
1292
+ }), x = ze(() => {
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 !== s.value.length);
1298
+ return () => a(c(Dl, {
1299
+ arrowPointAtCenter: !0,
1300
+ title: c("div", {
1301
+ class: [`${l}-title`, o.value]
1302
+ }, [c(Ml, {
1303
+ indeterminate: f.value,
1304
+ checked: C(S).length === 0 && C(S).length !== s.value.length,
1305
+ onChange: (b) => m(b)
1306
+ }, {
1307
+ default: () => [Ke("列展示")]
1308
+ }), e.checkedReset ? c("a", {
1309
+ onClick: x,
1310
+ class: [`${l}-action-rest-button`, o.value]
1311
+ }, [Ke("重置")]) : null, e != null && e.extra ? c(xe, {
1312
+ size: 12,
1313
+ align: "center"
1314
+ }, {
1315
+ default: () => [e.extra]
1316
+ }) : null]),
1317
+ overlayClassName: `${l}-overlay ${o.value}`,
1318
+ trigger: "click",
1319
+ placement: "bottomRight",
1320
+ content: c(aa, {
1321
+ hashId: o.value,
1322
+ checkable: e.checkable ?? !0,
1323
+ draggable: e.draggable ?? !0,
1324
+ className: l
1325
+ }, null)
1326
+ }, {
1327
+ default: () => [c(fe, {
1328
+ title: "列设置"
1329
+ }, {
1330
+ default: () => [c(Pt, null, null)]
1331
+ })]
1332
+ }));
1333
+ }
1334
+ }), ua = (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 $t(e) {
1377
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Z(e);
1378
+ }
1379
+ const {
1380
+ useBreakpoint: ia
1381
+ } = st;
1382
+ function sa(e) {
1383
+ if (Z(e))
1384
+ return e;
1385
+ if (e) {
1386
+ const l = e, {
1387
+ icon: a,
1388
+ tooltip: o,
1389
+ onClick: s,
1390
+ key: i
1391
+ } = l;
1392
+ return a && o ? c(fe, {
1393
+ title: o
1394
+ }, {
1395
+ default: () => [c("span", {
1396
+ key: i,
1397
+ onClick: () => {
1398
+ s && s(i);
1399
+ }
1400
+ }, [a])]
1401
+ }) : a;
1402
+ }
1403
+ return null;
1404
+ }
1405
+ const At = /* @__PURE__ */ he({
1406
+ props: {
1407
+ actions: de.toolBarBtn,
1408
+ settings: [Array],
1409
+ titleTip: de.titleTip,
1410
+ prefixCls: String,
1411
+ headerTitle: de.headerTitle,
1412
+ titleTipText: de.titleTipText,
1413
+ optionsExtra: de.optionsExtra
1414
+ },
1415
+ setup(e) {
1416
+ const {
1417
+ wrapSSR: l,
1418
+ hashId: a
1419
+ } = Xe("ListToolBar", [ua], e.prefixCls), o = ia(), {
1420
+ isMobile: s
1421
+ } = me(), 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
+ }), m = 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(xe, {
1431
+ align: "center"
1432
+ }, $t(u = e.actions.map((r, y) => Z(r) ? it(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 = Ge(() => !i.value && d.value ? c("div", {
1441
+ class: `${e.prefixCls}-left ${a.value}`
1442
+ }, null) : m.value ? c(xe, {
1443
+ class: `${e.prefixCls}-left ${a.value}`
1444
+ }, {
1445
+ default: () => [c("div", {
1446
+ class: `${e.prefixCls}-title ${a.value}`
1447
+ }, [e.headerTitle, e.titleTip && c(fe, {
1448
+ title: e.titleTipText
1449
+ }, {
1450
+ default: () => [se(e.titleTip) && e.titleTip ? c($l, null, null) : e.titleTip]
1451
+ })]), x.value && c("div", {
1452
+ class: `${e.prefixCls}-actions ${a.value}`
1453
+ }, [x.value])]
1454
+ }) : c(xe, {
1455
+ class: `${e.prefixCls}-left ${a.value}`
1456
+ }, {
1457
+ default: () => [x.value && c("div", {
1458
+ class: `${e.prefixCls}-actions`
1459
+ }, [x.value])]
1460
+ }), [() => i.value, () => d.value, () => m.value, () => e.prefixCls, () => e.headerTitle, () => e.titleTipText, () => e.titleTip]), f = Ge(() => {
1461
+ let u;
1462
+ return d.value ? c(xe, {
1463
+ size: 16,
1464
+ class: `${e.prefixCls}-right ${a.value}`,
1465
+ align: o.value.lg ? "center" : "end",
1466
+ direction: o.value.lg ? "horizontal" : "vertical"
1467
+ }, {
1468
+ default: () => {
1469
+ var n;
1470
+ return [e.optionsExtra, (n = e.settings) != null && n.length ? c(xe, {
1471
+ size: 12,
1472
+ align: "center",
1473
+ class: `${e.prefixCls}-setting-items`
1474
+ }, $t(u = e.settings.map((r, y) => {
1475
+ const T = sa(r);
1476
+ return c("div", {
1477
+ key: y,
1478
+ class: `${e.prefixCls}-setting-item`
1479
+ }, [T]);
1480
+ })) ? u : {
1481
+ default: () => [u]
1482
+ }) : null];
1483
+ }
1484
+ }) : null;
1485
+ }, [() => o.value, () => d.value, () => e.prefixCls, () => m.value, () => x.value, () => e.settings]), b = Ge(() => {
1486
+ if (!d.value && !i.value) return null;
1487
+ const u = {
1488
+ [`${a.value}`]: !0,
1489
+ [`${e.prefixCls}-container`]: !0,
1490
+ [`${e.prefixCls}-container-mobile`]: s.value
1491
+ };
1492
+ return c("div", {
1493
+ class: u
1494
+ }, [S.value, f.value]);
1495
+ }, [() => s.value, () => i.value, () => d.value, () => S.value, () => e.prefixCls, () => f.value]);
1496
+ return () => l(c("div", {
1497
+ class: `${e.prefixCls} ${a.value}`
1498
+ }, [b.value]));
1499
+ }
1500
+ });
1501
+ At.inheritAttrs = !1;
1502
+ const oa = () => {
1503
+ const {
1504
+ action: e,
1505
+ tableSize: l
1506
+ } = me();
1507
+ return c(Kl, {
1508
+ overlay: c(He, {
1509
+ selectedKeys: [l.value],
1510
+ onClick: ({
1511
+ key: a
1512
+ }) => {
1513
+ var o;
1514
+ (o = e.setTableSize) == null || o.call(e, a);
1515
+ },
1516
+ style: {
1517
+ width: 80
1518
+ }
1519
+ }, {
1520
+ default: () => [c(He.Item, {
1521
+ key: "large"
1522
+ }, {
1523
+ default: () => [Ke("默认")]
1524
+ }), c(He.Item, {
1525
+ key: "middle"
1526
+ }, {
1527
+ default: () => [Ke("中等")]
1528
+ }), c(He.Item, {
1529
+ key: "small"
1530
+ }, {
1531
+ default: () => [Ke("紧凑")]
1532
+ })]
1533
+ }),
1534
+ trigger: ["click"]
1535
+ }, {
1536
+ default: () => [c(fe, {
1537
+ title: "表格密度"
1538
+ }, {
1539
+ default: () => [c(Bl, null, null)]
1540
+ })]
1541
+ });
1542
+ }, Kt = /* @__PURE__ */ he({
1543
+ setup() {
1544
+ const {
1545
+ isFullscreen: e
1546
+ } = Nt();
1547
+ return () => e.value ? c(fe, {
1548
+ title: "退出全屏"
1549
+ }, {
1550
+ default: () => [c(Rl, null, null)]
1551
+ }) : c(fe, {
1552
+ title: "全屏"
1553
+ }, {
1554
+ default: () => [c(Fl, null, null)]
1555
+ });
1556
+ }
1557
+ });
1558
+ function ra() {
1559
+ return {
1560
+ reload: {
1561
+ text: "刷新",
1562
+ icon: c(Il, null, null)
1563
+ },
1564
+ density: {
1565
+ text: "表格密度",
1566
+ icon: c(oa, null, null)
1567
+ },
1568
+ setting: {
1569
+ text: "列设置",
1570
+ icon: c(Pt, null, null)
1571
+ },
1572
+ fullScreen: {
1573
+ text: "全屏",
1574
+ icon: c(Kt, null, null)
1575
+ }
1576
+ };
1577
+ }
1578
+ function ca(e, l) {
1579
+ return Object.keys(e).filter((a) => a).map((a) => {
1580
+ const o = e[a];
1581
+ if (!o)
1582
+ return null;
1583
+ let s = o === !0 ? l[a] : () => o == null ? void 0 : o();
1584
+ if (typeof s != "function" && (s = () => {
1585
+ }), a === "setting")
1586
+ return c(na, _(e[a], {
1587
+ key: a
1588
+ }), null);
1589
+ if (a === "fullScreen")
1590
+ return c("span", {
1591
+ key: a,
1592
+ onClick: s
1593
+ }, [c(Kt, null, null)]);
1594
+ const i = ra()[a];
1595
+ return i ? c("span", {
1596
+ key: a,
1597
+ onClick: s
1598
+ }, [c(fe, {
1599
+ title: i.text
1600
+ }, {
1601
+ default: () => [i.icon]
1602
+ })]) : null;
1603
+ }).filter((a) => a);
1604
+ }
1605
+ const da = {
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
+ }, fa = /* @__PURE__ */ he({
1614
+ props: da,
1615
+ inheritAttrs: !1,
1616
+ setup(e) {
1617
+ const l = ut({
1618
+ suffixCls: "table-list-toolbar",
1619
+ isPor: !0
1620
+ }), {
1621
+ action: a
1622
+ } = me(), o = Ge(() => {
1623
+ var d;
1624
+ const s = {
1625
+ reload: () => a == null ? void 0 : a.reload(),
1626
+ density: !0,
1627
+ setting: !0,
1628
+ fullScreen: () => a == null ? void 0 : a.toggle()
1629
+ };
1630
+ if (e.options === !1 || ((d = Object.keys(e.options)) == null ? void 0 : d.length) === 0) return [];
1631
+ const i = {
1632
+ ...s,
1633
+ ...e.options
1634
+ };
1635
+ return i.setting !== !1 && e.settingExtra && (i.setting = {}, i.setting.extra = e.settingExtra), ca(i, {
1636
+ ...s
1637
+ });
1638
+ }, [() => a, () => e.options]);
1639
+ return () => {
1640
+ const s = e.toolBarBtn || [];
1641
+ return c(At, {
1642
+ prefixCls: l,
1643
+ optionsExtra: e.optionsExtra,
1644
+ headerTitle: e.headerTitle,
1645
+ actions: s,
1646
+ settings: C(o),
1647
+ titleTip: e.titleTip,
1648
+ titleTipText: e.titleTipText
1649
+ }, null);
1650
+ };
1651
+ }
1652
+ });
1653
+ function ha(e) {
1654
+ return ml();
1655
+ }
1656
+ function ma(e, l = !0, a) {
1657
+ ha() ? hl(e, a) : l ? e() : Ot(e);
1658
+ }
1659
+ function va({ columns: e, columnsState: l, changeColumns: a }) {
1660
+ const o = j(void 0), s = we({}), i = we({}), d = we({}), m = j([]);
1661
+ q(() => e.value, () => {
1662
+ var b;
1663
+ (b = C(e)) == null || b.forEach(({ show: u, key: n, fixed: r }, y) => {
1664
+ const T = Rt(n, y);
1665
+ T && (d[T] = { 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 }), Ye(() => {
1670
+ var b;
1671
+ const f = {
1672
+ ...(b = C(l)) == null ? void 0 : b.value,
1673
+ ...C(d)
1674
+ };
1675
+ Object.assign(s, f), Object.assign(i, f);
1676
+ });
1677
+ function x(f, b) {
1678
+ o.value = b, Object.assign(s, f), a == null || a(s, b === "fixed");
1679
+ }
1680
+ function S(f) {
1681
+ m.value = f;
1682
+ }
1683
+ return {
1684
+ columnsMap: s,
1685
+ operationType: o,
1686
+ setColumnsMap: x,
1687
+ sortKeyColumns: m,
1688
+ cacheColumnsMap: i,
1689
+ setSortKeyColumns: S
1690
+ };
1691
+ }
1692
+ function ga(e) {
1693
+ const l = w(() => e.draggabled), a = w(() => e.neverScroll), o = w(() => e.autoScroll);
1694
+ return {
1695
+ draggabled: l,
1696
+ neverScroll: a,
1697
+ autoScroll: o
1698
+ };
1699
+ }
1700
+ function ya({ scroll: e, columns: l, breakpoint: a, draggabled: o, autoScroll: s, neverScroll: i }) {
1701
+ const d = j([]), m = j([]);
1702
+ q([
1703
+ () => e.value,
1704
+ () => l.value,
1705
+ () => a.value,
1706
+ () => o.value,
1707
+ () => a.value,
1708
+ () => s.value,
1709
+ () => i.value
1710
+ ], () => {
1711
+ const r = f(Be(l.value));
1712
+ Ve(r, Be(d.value)) || (d.value = ie(r)), Ve(r, Be(m.value)) || (m.value = ie(r));
1713
+ }, {
1714
+ deep: !0,
1715
+ immediate: !0
1716
+ });
1717
+ const x = w(() => {
1718
+ const r = S(C(d).filter((O) => O.fixed === "left")), y = S(C(d).filter((O) => O.fixed !== "left" && O.fixed !== "right")), T = S(C(d).filter((O) => O.fixed === "right"));
1719
+ return [
1720
+ ...r,
1721
+ ...y,
1722
+ ...T
1723
+ ];
1724
+ });
1725
+ function S(r) {
1726
+ return r.sort((y, T) => al(y, T, "order", 0));
1727
+ }
1728
+ function f(r) {
1729
+ return ie(r).map((y, T) => {
1730
+ var O;
1731
+ if (y.dataIndex === "action" || T === r.length - 1 ? y.resizable = !1 : y.resizable = se(y.resizable) ? y.resizable : !!(Qe(y.width) && C(o)), !y.width || C(i))
1732
+ return y;
1733
+ if (y.dataIndex === "action" && C(s))
1734
+ if ((O = C(e)) != null && O.x || !C(a))
1735
+ y.width = y.width || 100, y.fixed = "right";
1736
+ else {
1737
+ const R = C(l).find((A) => A.dataIndex === y.dataIndex);
1738
+ y.width = (R == null ? void 0 : R.width) || "", y.fixed = R == null ? void 0 : R.fixed;
1739
+ }
1740
+ return y;
1741
+ });
1742
+ }
1743
+ function b(r, y) {
1744
+ d.value = d.value.map((T) => (T.uuid === y.uuid && (T.width = r), T));
1745
+ }
1746
+ function u(r) {
1747
+ if (r.length <= 0) {
1748
+ d.value = [];
1749
+ return;
1750
+ }
1751
+ Ve(f(r), Be(d.value)) || (d.value = f(r));
1752
+ }
1753
+ function n(r) {
1754
+ u(ie(Be(l.value)).map((y) => {
1755
+ var O, R, A;
1756
+ const T = y.key ? {
1757
+ show: (O = r[y.key]) == null ? void 0 : O.show,
1758
+ fixed: (R = r[y.key]) == null ? void 0 : R.fixed,
1759
+ order: (A = r[y.key]) == null ? void 0 : A.order
1760
+ } : {};
1761
+ return { ...y, ...T };
1762
+ }));
1763
+ }
1764
+ return {
1765
+ breakpoint: a,
1766
+ proColumns: x,
1767
+ cacheProColumns: m,
1768
+ setColumns: u,
1769
+ changeColumns: n,
1770
+ resizeColumnWidth: b
1771
+ };
1772
+ }
1773
+ function ba(e, l) {
1774
+ const a = w(() => l || 0), o = j(), s = j(e);
1775
+ function i() {
1776
+ o.value && clearTimeout(o.value);
1777
+ }
1778
+ async function d(...m) {
1779
+ return a.value === 0 || a.value === void 0 ? s.value(...m) : (i(), new Promise(async (x) => {
1780
+ var S;
1781
+ (S = m[0]) != null && S.immediate ? x(await s.value(...m)) : o.value = setTimeout(async () => {
1782
+ x(await s.value(...m));
1783
+ }, a.value);
1784
+ }));
1785
+ }
1786
+ return Hl(i), {
1787
+ cancel: i,
1788
+ run: d
1789
+ };
1790
+ }
1791
+ function Ca(e) {
1792
+ const l = w(() => e.polling), a = w(() => e.debounceTime), o = w(() => e.dataSource);
1793
+ return {
1794
+ polling: l,
1795
+ request: e.request,
1796
+ postData: e.postData,
1797
+ debounceTime: a,
1798
+ dataSource: o
1799
+ };
1800
+ }
1801
+ function xa({ polling: e, request: l, postData: a, dataSource: o, waitRequest: s, debounceTime: i }, { search: d, columns: m, loading: x, setLoading: S, setColumns: f, removeRowKeys: b, syncSelectedRows: u, formParamsRef: n, setPagination: r, paginationInfo: y, onBeforeSearchSubmit: T, hasCustomRender: O }, R) {
1802
+ const A = j(), V = j(!0), L = j(!1), W = j(!1), K = j([]), G = j(), H = w(() => {
1803
+ var I;
1804
+ return J(d.value) ? ((I = d.value) == null ? void 0 : I.type) === "button" : !!d.value;
1805
+ }), oe = async (I = {}) => {
1806
+ var Te;
1807
+ const { pagination: N, filters: v = {}, sorter: z = {}, removeKeys: ve = [], isPolling: pe = !1 } = I;
1808
+ if (!l || !Ae(l) || C(s) && x.value || L.value)
1809
+ return o.value || [];
1810
+ if (L.value = !0, !pe || C(s) || V.value ? S(!0) : g(!0), C(s)) {
1811
+ V.value = !1, L.value = !1;
1812
+ return;
1813
+ }
1814
+ N && r(N);
1815
+ try {
1816
+ let ee = {};
1817
+ if (se(N) && !N || se(y))
1818
+ ee = {};
1819
+ else {
1820
+ const { current: Y = 1, pageSize: ye = 10, total: U } = C(y) || {};
1821
+ ee.pageNum = il({ current: Y, pageSize: ye, total: U }, ve.length), ve.length && b(ve), ee.pageSize = ye;
1822
+ }
1823
+ const Le = J(z) ? [z] : z;
1824
+ Le.forEach((Y) => {
1825
+ const ye = (Y == null ? void 0 : Y.columnKey) || (Y == null ? void 0 : Y.field);
1826
+ Y && (Y != null && Y.order) ? f(C(m).map((U) => (U.dataIndex === ye ? U.sortOrder = Y == null ? void 0 : Y.order : U.sortOrder = null, U))) : Y && f(C(m).map((U) => (U.dataIndex === ye && (U.sortOrder = null), U)));
1827
+ });
1828
+ let ke = {
1829
+ ...ee || {},
1830
+ ...I.params,
1831
+ ...n
1832
+ };
1833
+ T && Ae(T) && (ke = await T(ke, z, v));
1834
+ let te = [];
1835
+ const ge = await (l == null ? void 0 : l(ke, Le, v));
1836
+ if (L.value = !1, ge && (ge != null && ge.success)) {
1837
+ te = ge.data || [], a && Ae(a) && (te = await (a == null ? void 0 : a(te))), u(te);
1838
+ const Y = ge.total || (te == null ? void 0 : te.length) || 0;
1839
+ return Y !== ((Te = C(y)) == null ? void 0 : Te.total) && r({
1840
+ total: Y || 0
1841
+ }), p(te), te;
1842
+ } else
1843
+ return [];
1844
+ } catch (ee) {
1845
+ K.value === void 0 && p([]), R("requestError", ee);
1846
+ } finally {
1847
+ V.value = !1, S(!1);
1848
+ }
1849
+ return [];
1850
+ }, le = ba(async (I) => {
1851
+ G.value && clearTimeout(G.value);
1852
+ const N = await oe(I), v = nl(e.value, N);
1853
+ return v && !A.value && (G.value = setTimeout(() => {
1854
+ le.run({ ...I, isPolling: v });
1855
+ }, Math.max(v, 2e3))), N;
1856
+ }, i.value || 10);
1857
+ vl(() => {
1858
+ A.value = !0, clearTimeout(G.value);
1859
+ }), gl(() => {
1860
+ A.value = !0, clearTimeout(G.value);
1861
+ }), q(() => e.value, () => {
1862
+ e.value ? le.run({ isPolling: !0 }) : clearTimeout(G.value);
1863
+ }, { immediate: !0 }), q([() => s.value, () => o.value], () => {
1864
+ re();
1865
+ }, { deep: !0, immediate: !0 }), q([() => n], () => {
1866
+ H.value || re();
1867
+ }, {
1868
+ deep: !0,
1869
+ immediate: !0
1870
+ });
1871
+ function re() {
1872
+ Ie(l) ? (!V.value || !e.value) && le.run({ isPolling: !1 }) : p(o.value || []);
1873
+ }
1874
+ const Oe = w(() => {
1875
+ if (O.value)
1876
+ return C(K);
1877
+ const I = m.value.filter((N) => N.show || N.show === void 0);
1878
+ return !C(K) || !I || I.length === 0 ? [] : C(K);
1879
+ }), t = w(() => C(K).some((I) => ue(I.children) && I.children.length > 0));
1880
+ function g(I) {
1881
+ W.value = I;
1882
+ }
1883
+ function F(I, N, v, z) {
1884
+ le.run({ pagination: I, filters: N, sorter: v, extra: z, isPolling: !1 }), R("change", I, N, v, z);
1885
+ }
1886
+ function p(I) {
1887
+ var v;
1888
+ const N = ul(ie(I), C(y.value));
1889
+ if (!Ve(N, K.value) && (K.value = N, !l || !Ae(l))) {
1890
+ const z = N.length || 0;
1891
+ z !== ((v = C(y)) == null ? void 0 : v.total) && r({
1892
+ total: z
1893
+ });
1894
+ }
1895
+ }
1896
+ function P({ key: I, record: N, type: v = "update" }) {
1897
+ switch (v) {
1898
+ case "update":
1899
+ K.value = K.value.map((z) => I && N[I] === z[I] ? { ...z, ...N } : z);
1900
+ break;
1901
+ case "push":
1902
+ K.value.push(N);
1903
+ break;
1904
+ case "unshift":
1905
+ K.value.unshift(N);
1906
+ break;
1907
+ case "delete":
1908
+ K.value = K.value.filter((z) => I ? I && N[I] !== z[I] : !0);
1909
+ break;
1910
+ }
1911
+ }
1912
+ return {
1913
+ dataSource: Oe,
1914
+ isTreeDataRef: t,
1915
+ reSetDataList: p,
1916
+ changeDataValue: P,
1917
+ handleTableChange: F,
1918
+ reload: async (I) => {
1919
+ Ie(l) ? await le.run({ ...I, isPolling: !1 }) : R("reload");
1920
+ }
1921
+ };
1922
+ }
1923
+ function Sa({ emit: e, loading: l }) {
1924
+ var i;
1925
+ const a = j(se(l.value) ? l.value : J(l.value) ? (i = l.value) == null ? void 0 : i.spinning : !1);
1926
+ q(() => l.value, (d) => {
1927
+ a.value = se(d) ? d : J(d) ? d == null ? void 0 : d.spinning : a.value;
1928
+ });
1929
+ const o = w(() => a.value);
1930
+ function s(d) {
1931
+ a.value = d, e("loadingChange", !0);
1932
+ }
1933
+ return { loadingComputed: o, loading: a, setLoading: s };
1934
+ }
1935
+ function wa({
1936
+ slots: e,
1937
+ props: l,
1938
+ pagination: a
1939
+ }) {
1940
+ const o = we({}), s = j();
1941
+ q(() => a.value, () => {
1942
+ var S;
1943
+ if (se(a.value) && !a.value) {
1944
+ s.value = !1;
1945
+ return;
1946
+ }
1947
+ const d = Ft(e, C(l), "pageItemRender"), m = Ae(d) ? {
1948
+ itemRender: ({
1949
+ page: f,
1950
+ type: b,
1951
+ originalElement: u
1952
+ }) => d ? d({
1953
+ page: f,
1954
+ type: b,
1955
+ originalElement: u
1956
+ }) : null
1957
+ } : null, x = {
1958
+ current: 1,
1959
+ pageSize: 10,
1960
+ size: "default",
1961
+ showQuickJumper: !0,
1962
+ showSizeChanger: !0,
1963
+ pageSizeOptions: ["10", "20", "50", "100"],
1964
+ ...a.value || {},
1965
+ ...m || {}
1966
+ };
1967
+ (S = a.value) != null && S.showTotal || (x.showTotal = (f) => `共${f < x.pageSize ? 1 : Math.ceil(f / (x.pageSize || 10))}页 ${f}条记录`), s.value = x, Object.assign(o, {
1968
+ pageNum: x.current,
1969
+ pageSize: x.pageSize
1970
+ });
1971
+ }, {
1972
+ deep: 1,
1973
+ immediate: !0
1974
+ });
1975
+ function i(d) {
1976
+ if (J(s.value) && J(d)) {
1977
+ const m = {};
1978
+ Object.keys(d).forEach((x) => {
1979
+ Object.prototype.hasOwnProperty.call(d, x) && s.value[x] === d[x] || (m[x] = d[x]);
1980
+ }), Object.keys(m).length > 0 && (Object.assign(s.value, m), pa(m) && Object.assign(o, m));
1981
+ }
1982
+ }
1983
+ return {
1984
+ paginationInfo: s,
1985
+ requestPagination: o,
1986
+ setPagination: i
1987
+ };
1988
+ }
1989
+ function pa(e) {
1990
+ if (typeof e != "object" || e === null)
1991
+ return !1;
1992
+ const l = Object.keys(e);
1993
+ return l.length === 2 && l.includes("pageNum") && l.includes("pageSize");
1994
+ }
1995
+ function Ta(e, l) {
1996
+ const a = j([]), o = j([]);
1997
+ q(() => {
1998
+ var f;
1999
+ return (f = l.value) == null ? void 0 : f.selectedRowKeys;
2000
+ }, (f) => {
2001
+ a.value = sl([...f || []]);
2002
+ }, {
2003
+ deep: !0,
2004
+ immediate: !0
2005
+ });
2006
+ const s = (f, b) => {
2007
+ e.value && (b ? f != null && f[e.value] && (a.value.push(f[e.value]), o.value.push(f)) : (a.value = a.value.filter((u) => u !== f[e.value]), o.value = o.value.filter((u) => u[e.value] !== f[e.value])));
2008
+ }, i = () => {
2009
+ var f, b;
2010
+ l.value && ((b = (f = l.value) == null ? void 0 : f.onChange) == null || b.call(f, a.value, o.value));
2011
+ };
2012
+ return {
2013
+ selectedKeys: a,
2014
+ selectedItems: o,
2015
+ selectRowKey: s,
2016
+ selectAllRowKey: (f, b, u) => {
2017
+ e.value && (f ? b.map((n) => (a.value.every((r) => r !== (n == null ? void 0 : n[e.value])) && n != null && n[e.value] && (a.value.push(n[e.value]), o.value.push(n)), n)) : u.map((n) => (a.value.includes(n == null ? void 0 : n[e.value]) && (a.value = a.value.filter((r) => r !== n[e.value]), o.value = o.value.filter((r) => r[e.value] !== n[e.value])), n)));
2018
+ },
2019
+ removeRowKeys: (f) => {
2020
+ a.value = a.value.filter((b) => !f.includes(b)), o.value = o.value.filter((b) => !f.includes(b == null ? void 0 : b[e.value || ""])), i();
2021
+ },
2022
+ changeRowKey: i,
2023
+ syncSelectedRows: (f) => {
2024
+ if (e.value && a.value.length !== o.value.length) {
2025
+ const b = o.value.map((n) => n[e.value]), u = a.value.filter((n) => !b.includes(n));
2026
+ f.forEach((n) => {
2027
+ u.includes(n[e.value]) && o.value.push(ie(n));
2028
+ });
2029
+ }
2030
+ },
2031
+ clearAllRowKeys: () => {
2032
+ a.value = [], o.value = [], i();
2033
+ }
2034
+ };
2035
+ }
2036
+ function $a(e) {
2037
+ const l = {};
2038
+ return e.forEach((a) => {
2039
+ let o = a.initialValue;
2040
+ const s = ["select"], i = ["date", "time", "dateRange"];
2041
+ !o && s.includes(a.valueType) ? o = void 0 : !o && i.includes(a.valueType) ? o = null : o || (o = ""), a.name === "dateRange" ? (l[a.rangeStartName || "start"] = o ? o[0] : null, l[a.rangeEndName || "end"] = o ? o[1] : null) : a.name && (l[a.name] = o);
2042
+ }), l;
2043
+ }
2044
+ function Ba({ searchMap: e, params: l, columns: a, setPagination: o }) {
2045
+ const s = we({}), i = we({}), d = j([]), m = (S) => {
2046
+ var b, u;
2047
+ const f = [];
2048
+ if ((S === "all" || S === "searchMap") && ((b = e.value) == null || b.forEach((n) => f.push(n)), f.forEach((n) => {
2049
+ d.value.some((r) => r.name === n.name) ? d.value = d.value.map((r) => r.name === n.name ? {
2050
+ ...r,
2051
+ ...n
2052
+ } : r) : d.value.push(n);
2053
+ })), (S === "all" || S === "columns") && ((u = a.value) != null && u.length) && (a.value && a.value.forEach((n) => {
2054
+ n.searchConfig && f.push(n.searchConfig);
2055
+ }), f.forEach((n) => {
2056
+ d.value.some((r) => r.name === n.name) ? d.value = d.value.map((r) => r.name === n.name ? {
2057
+ ...r,
2058
+ ...n
2059
+ } : r) : d.value.push(n);
2060
+ })), S === "all" || S === "searchMap" || S === "columns") {
2061
+ o({ current: 1 });
2062
+ const n = $a(f);
2063
+ Object.assign(i, { ...n });
2064
+ for (const r in n)
2065
+ s[r] || (s[r] = n[r]);
2066
+ }
2067
+ (S === "all" || S === "params") && (o({ current: 1 }), Object.assign(s, l.value));
2068
+ };
2069
+ yl(() => {
2070
+ m("all");
2071
+ }), q(() => l.value, () => {
2072
+ m("params");
2073
+ }, { deep: !0 }), q(() => e.value, () => {
2074
+ m("searchMap");
2075
+ }, { deep: !0 }), q(() => a.value, () => {
2076
+ m("columns");
2077
+ }, { deep: !0 });
2078
+ function x(S) {
2079
+ o({ current: 1 }), Object.assign(s, S);
2080
+ }
2081
+ return { formDataRef: d, formParamsRef: s, defaultParamsRef: i, setFormParams: x };
2082
+ }
2083
+ function Ra(e) {
2084
+ const l = w(() => e.scroll), a = w(() => e.autoScroll), o = w(() => e.modalScroll), s = w(() => e.neverScroll), i = w(() => e.rowSelection), d = w(() => e.scrollBreakpoint);
2085
+ return {
2086
+ scroll: l,
2087
+ neverScroll: s,
2088
+ rowSelection: i,
2089
+ autoScroll: a,
2090
+ modalScroll: o,
2091
+ scrollBreakpoint: d
2092
+ };
2093
+ }
2094
+ function Fa({ scroll: e, columns: l, autoScroll: a, modalScroll: o, neverScroll: s, rowSelection: i, screens: d, innerWidth: m, scrollBreakpoint: x }) {
2095
+ const S = w(() => {
2096
+ var u, n, r;
2097
+ return C(x) ? Qe(C(x)) ? m.value > C(x) : It(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;
2098
+ }), f = w(() => {
2099
+ let u = 0;
2100
+ const n = C(i) ? 60 : 0, r = 150, y = ie(C(l));
2101
+ y.forEach((R) => {
2102
+ u += Number.parseInt(String(R.width)) || 0;
2103
+ });
2104
+ const O = y.filter((R) => !Reflect.has(R, "width")).length;
2105
+ return O !== 0 && (u += O * r), n && (u += n), u;
2106
+ });
2107
+ return { proScroll: w(() => {
2108
+ var u, n;
2109
+ return C(s) ? {} : C(e) && Object.keys(C(e)).length ? C(e) : C(o) ? {
2110
+ y: ((u = C(e)) == null ? void 0 : u.y) || ((n = d.value) != null && n.xl ? 400 : 235)
2111
+ } : C(a) ? S.value ? {} : se(S.value) ? { x: C(f) } : {} : {};
2112
+ }), breakpoint: S };
2113
+ }
2114
+ function Ia({ size: e, emit: l }) {
2115
+ const a = j("middle");
2116
+ Ye(() => {
2117
+ a.value = e.value;
2118
+ });
2119
+ function o(s) {
2120
+ a.value = s, l("sizeChange", s);
2121
+ }
2122
+ return { sizeRef: a, setTableSize: o };
2123
+ }
2124
+ const tt = {
2125
+ "&::-webkit-scrollbar": {
2126
+ width: 4,
2127
+ height: 4
2128
+ },
2129
+ "&::-webkit-scrollbar-thumb": {
2130
+ backgroundColor: "#d2d4d6",
2131
+ borderRadius: 2
2132
+ },
2133
+ "&::-webkit-scrollbar-track": {
2134
+ backgroundColor: "transparent",
2135
+ borderRadius: 2
2136
+ }
2137
+ }, Oa = (e) => {
2138
+ const l = `${e.antCls}-table`;
2139
+ return {
2140
+ [e.componentCls]: {
2141
+ "&-a": {
2142
+ cursor: "pointer",
2143
+ color: e.colorPrimary,
2144
+ "&:hover": {
2145
+ color: e.colorPrimaryHover
2146
+ }
2147
+ },
2148
+ [`${l}`]: {
2149
+ [`${l}-cell-ellipsis`]: {
2150
+ overflow: "unset",
2151
+ whiteSpace: "unset"
2152
+ }
2153
+ },
2154
+ "&-empty-text": {
2155
+ display: "flex",
2156
+ flexDirection: "column",
2157
+ alignItems: "center",
2158
+ justifyContent: "center"
2159
+ },
2160
+ "&-table-tree": {
2161
+ [`${e.antCls}-table-row-cell-ellipsis`]: {
2162
+ overflow: "hidden",
2163
+ textOverflow: "ellipsis",
2164
+ whiteSpace: "nowrap",
2165
+ [`${e.antCls}-table-column-title`]: {
2166
+ overflow: "hidden",
2167
+ textOverflow: "ellipsis",
2168
+ whiteSpace: "nowrap"
2169
+ }
2170
+ }
2171
+ },
2172
+ "&-full-screen": {
2173
+ [`${e.componentCls}-content`]: {
2174
+ height: "100% !important",
2175
+ padding: 24,
2176
+ backgroundColor: e.colorWhite,
2177
+ boxShadow: "0 4px 8px #0003, 0 6px 20px #00000030 !important"
2178
+ }
2179
+ },
2180
+ "&-no-scroll": {
2181
+ [`${e.antCls}-table`]: {
2182
+ table: {
2183
+ width: "100% !important",
2184
+ minWidth: "unset"
2185
+ }
2186
+ },
2187
+ [`${e.antCls}-table-ping-right:not(${e.antCls}-table-has-fix-right)`]: {
2188
+ [`${e.antCls}-table-container::after`]: {
2189
+ boxShadow: "none"
2190
+ }
2191
+ },
2192
+ [`${e.antCls}-table-bordered ${e.antCls}-table-fixed-left ${e.antCls}-table-thead > tr > th`]: {
2193
+ "&:last-child": {
2194
+ borderRight: 0
2195
+ }
2196
+ },
2197
+ [`${e.antCls}-table-bordered ${e.antCls}-table-fixed-left ${e.antCls}-table-tbody > tr > td`]: {
2198
+ "&:last-child": {
2199
+ borderRight: 0
2200
+ }
2201
+ }
2202
+ },
2203
+ "&-wrapper": {
2204
+ clear: "both",
2205
+ maxWidth: "100%",
2206
+ [`${e.componentCls}-pagination${e.antCls}-pagination`]: {
2207
+ margin: `${e.margin}px 0`
2208
+ },
2209
+ [`${e.componentCls}-pagination`]: {
2210
+ display: "flex",
2211
+ flexWrap: "wrap",
2212
+ rowGap: e.paddingXS,
2213
+ "> *": {
2214
+ flex: "none"
2215
+ },
2216
+ "&-left": {
2217
+ justifyContent: "flex-start"
2218
+ },
2219
+ "&-center": {
2220
+ justifyContent: "center"
2221
+ },
2222
+ "&-right": {
2223
+ justifyContent: "flex-end"
2224
+ }
2225
+ }
2226
+ },
2227
+ "&-card-border": {
2228
+ paddingInline: e.paddingLG,
2229
+ paddingBlock: e.paddingLG,
2230
+ border: `${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,
2231
+ borderRadius: e.borderRadius,
2232
+ marginBottom: 20
2233
+ },
2234
+ [`${e.componentCls}-copyable`]: {
2235
+ display: "flex",
2236
+ alignItems: "center",
2237
+ [`${e.componentCls}-copyable-icon`]: {
2238
+ marginLeft: 8,
2239
+ color: e.colorPrimary,
2240
+ cursor: "pointer"
2241
+ }
2242
+ },
2243
+ [`${e.componentCls}-ellipsis`]: {
2244
+ overflow: "hidden",
2245
+ textOverflow: "ellipsis",
2246
+ display: "-webkit-box",
2247
+ "-webkit-box-orient": "vertical",
2248
+ "word-break": "break-word"
2249
+ },
2250
+ [`${e.componentCls}-action-size`]: {
2251
+ display: "inline-block"
2252
+ },
2253
+ [`${e.componentCls}-action-columns`]: {
2254
+ display: "inline-block",
2255
+ [`${e.antCls}-popover-inner-content`]: {
2256
+ padding: "8px 0 8px 16px"
2257
+ },
2258
+ [`${e.antCls}-tree ${e.antCls}-tree-switcher-noop`]: {
2259
+ display: "none"
2260
+ },
2261
+ [`${e.antCls}-tree > ${e.antCls}-tree-treenode`]: {
2262
+ width: "100%",
2263
+ alignItems: "center",
2264
+ "&:first-child": {
2265
+ paddingTop: 0
2266
+ },
2267
+ "&:last-child": {
2268
+ paddingBottom: 4
2269
+ },
2270
+ "&:hover": {
2271
+ backgroundColor: "#e6f7ff",
2272
+ [`${e.componentCls}-action-columns-list-item-actions`]: {
2273
+ display: "block"
2274
+ }
2275
+ }
2276
+ },
2277
+ [`${e.antCls}-tree ${e.antCls}-tree-node-content-wrapper`]: {
2278
+ flex: "1",
2279
+ "&:hover": {
2280
+ backgroundColor: "transparent"
2281
+ }
2282
+ },
2283
+ "&-popover-title": {
2284
+ display: "flex",
2285
+ alignItems: "center",
2286
+ justifyContent: "space-between",
2287
+ "&-check": {
2288
+ marginRight: 8
2289
+ },
2290
+ [`${e.antCls}-btn-sm`]: {
2291
+ padding: 0
2292
+ }
2293
+ },
2294
+ "&-list-group": {
2295
+ marginTop: 6,
2296
+ marginBottom: 6,
2297
+ fontSize: 12,
2298
+ color: "rgba(0, 0, 0, 0.45)"
2299
+ },
2300
+ "$-list-item": {
2301
+ display: "flex",
2302
+ alignItems: "center",
2303
+ justifyContent: "space-between",
2304
+ "&-actions": {
2305
+ display: "block",
2306
+ float: "right",
2307
+ cursor: "pointer",
2308
+ "> span + span": {
2309
+ marginLeft: 8
2310
+ },
2311
+ "&-disabled": {
2312
+ action: {
2313
+ color: "rgba(0, 0, 0, 0.25)"
2314
+ }
2315
+ },
2316
+ anticon: {
2317
+ color: e.colorPrimary
2318
+ }
2319
+ }
2320
+ }
2321
+ },
2322
+ // ant-class
2323
+ [`${e.antCls}-tooltip-inner`]: {
2324
+ a: {
2325
+ color: e.colorWhite
2326
+ }
2327
+ },
2328
+ [`${e.antCls}-table-content`]: tt,
2329
+ [`${e.antCls}-table-body`]: tt,
2330
+ [`${e.antCls}-table-empty`]: {
2331
+ [`${e.antCls}-table-content`]: tt
2332
+ }
2333
+ }
2334
+ };
2335
+ };
2336
+ function ka(e) {
2337
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Z(e);
2338
+ }
2339
+ function Pa(e, l, a, o) {
2340
+ if (!l) return e;
2341
+ let s = e;
2342
+ if (J(l)) {
2343
+ const i = l.node === "a" ? "span" : l.node;
2344
+ return c(i, _((l == null ? void 0 : l.attr) || {}, {
2345
+ class: [l.class, l.node === "a" ? `${a}-a` : ""],
2346
+ onClick: l.click
2347
+ }), ka(e) ? e : {
2348
+ default: () => [e]
2349
+ });
2350
+ }
2351
+ switch (l) {
2352
+ case "link":
2353
+ s = c("span", {
2354
+ class: [`${a}-a`, o]
2355
+ }, [e]);
2356
+ break;
2357
+ case "time":
2358
+ s = X(e).format("HH:mm:ss");
2359
+ break;
2360
+ case "dateMonth":
2361
+ s = `${X(e).month() + 1}月`;
2362
+ break;
2363
+ case "date":
2364
+ s = X(e).format("YYYY-MM-DD");
2365
+ break;
2366
+ case "dateTime":
2367
+ s = X(e).format("YYYY-MM-DD HH:mm:ss");
2368
+ break;
2369
+ }
2370
+ return s;
2371
+ }
2372
+ function ja(e, l) {
2373
+ const a = l && l.current || 1, o = l && l.pageSize || 10;
2374
+ return e.filter((s, i) => i < a * o && i >= o * (a - 1));
2375
+ }
2376
+ function Na(e) {
2377
+ const l = document.createElement("textarea");
2378
+ l.style.position = "absolute", l.style.opacity = "0", l.value = e, document.body.appendChild(l), l.select(), document.execCommand("copy"), document.body.removeChild(l);
2379
+ }
2380
+ function Ea(e) {
2381
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Z(e);
2382
+ }
2383
+ const {
2384
+ useBreakpoint: Da
2385
+ } = st, Ma = {
2386
+ reload: !0,
2387
+ density: !0,
2388
+ setting: !0,
2389
+ fullScreen: !0
2390
+ }, lt = /* @__PURE__ */ he({
2391
+ name: "GProTable",
2392
+ inheritAttrs: !1,
2393
+ props: de,
2394
+ emits: ["reset", "reload", "submit", "sizeChange", "expandedRowsChange", "expand", "change", "requestError", "beforeSearchSubmit", "columnsStateChange", "loadingChange"],
2395
+ slots: Object,
2396
+ setup(e, {
2397
+ emit: l,
2398
+ slots: a,
2399
+ attrs: o,
2400
+ expose: s
2401
+ }) {
2402
+ const i = ut({
2403
+ suffixCls: "table",
2404
+ isPor: !0
2405
+ }), {
2406
+ wrapSSR: d,
2407
+ hashId: m
2408
+ } = Xe("ProBaseTable", [Oa], i), x = Da(), {
2409
+ width: S
2410
+ } = Pl(), f = j(!1), b = jt(), u = j(), n = j(), r = j(e.waitRequest);
2411
+ Ye(() => r.value = e.waitRequest);
2412
+ const {
2413
+ toggle: y,
2414
+ isFullscreen: T
2415
+ } = Nt(u), O = w(() => ({
2416
+ ...e
2417
+ })), R = w(() => !x.value.xl), A = w(() => {
2418
+ var h, $;
2419
+ return e.virtualScroll && Cl(!((h = e.scroll) != null && h.y), "参数scroll的Y值不能为空!"), !!(($ = e.scroll) != null && $.y && e.virtualScroll);
2420
+ }), V = w(() => e.search === !1 ? !1 : J(e.search) ? e.search : {
2421
+ type: "auto",
2422
+ resetText: "重置",
2423
+ searchText: "查询"
2424
+ }), L = w(() => V.value === !1 ? {} : V.value), W = w(() => {
2425
+ var h;
2426
+ return ((h = L.value) == null ? void 0 : h.type) === "button";
2427
+ }), K = w(() => {
2428
+ var h;
2429
+ return (h = L.value) == null ? void 0 : h.actions;
2430
+ }), G = w(() => {
2431
+ const h = (e.columns || []).filter(($) => $.key || $.dataIndex).map(($) => ({
2432
+ ...$,
2433
+ key: $.key || $.dataIndex,
2434
+ align: $.align || e.align,
2435
+ uuid: at().uuid(15)
2436
+ }));
2437
+ return ol(h, {
2438
+ align: e.align || "left",
2439
+ showIndex: e.showIndex || !1
2440
+ });
2441
+ }), {
2442
+ loadingComputed: H,
2443
+ loading: oe,
2444
+ setLoading: le
2445
+ } = Sa({
2446
+ emit: l,
2447
+ loading: ce(e, "loading")
2448
+ }), {
2449
+ sizeRef: re,
2450
+ setTableSize: Oe
2451
+ } = Ia({
2452
+ emit: l,
2453
+ size: ce(e, "size")
2454
+ }), {
2455
+ paginationInfo: t,
2456
+ requestPagination: g,
2457
+ setPagination: F
2458
+ } = wa({
2459
+ slots: a,
2460
+ props: O,
2461
+ pagination: ce(e, "pagination")
2462
+ }), p = Ra(e), {
2463
+ proScroll: P,
2464
+ breakpoint: I
2465
+ } = Fa({
2466
+ ...p,
2467
+ innerWidth: S,
2468
+ columns: G,
2469
+ screens: x
2470
+ }), N = ga(e), {
2471
+ proColumns: v,
2472
+ cacheProColumns: z,
2473
+ setColumns: ve,
2474
+ changeColumns: pe,
2475
+ resizeColumnWidth: Te
2476
+ } = ya({
2477
+ ...N,
2478
+ breakpoint: I,
2479
+ scroll: P,
2480
+ columns: G
2481
+ }), {
2482
+ columnsMap: ee,
2483
+ operationType: Le,
2484
+ setColumnsMap: ke,
2485
+ sortKeyColumns: te,
2486
+ cacheColumnsMap: ge,
2487
+ setSortKeyColumns: Y
2488
+ } = va({
2489
+ columns: z,
2490
+ columnsState: ce(e, "columnsState"),
2491
+ changeColumns: pe
2492
+ }), {
2493
+ formDataRef: ye,
2494
+ formParamsRef: U,
2495
+ defaultParamsRef: zt,
2496
+ setFormParams: Ue
2497
+ } = Ba({
2498
+ searchMap: ce(e, "searchMap"),
2499
+ params: ce(e, "params"),
2500
+ columns: G,
2501
+ setPagination: F
2502
+ }), {
2503
+ selectedKeys: ot,
2504
+ selectedItems: Yt,
2505
+ changeRowKey: Lt,
2506
+ selectRowKey: rt,
2507
+ selectAllRowKey: ct,
2508
+ syncSelectedRows: dt,
2509
+ removeRowKeys: ft,
2510
+ clearAllRowKeys: Wt
2511
+ } = Ta(ce(e, "rowKey"), ce(e, "rowSelection")), Ht = Ca(e), {
2512
+ reload: Pe,
2513
+ reSetDataList: Vt,
2514
+ changeDataValue: Gt,
2515
+ isTreeDataRef: Qt,
2516
+ dataSource: je,
2517
+ handleTableChange: ht
2518
+ } = xa({
2519
+ ...Ht,
2520
+ waitRequest: r
2521
+ }, {
2522
+ loading: H,
2523
+ paginationInfo: t,
2524
+ setPagination: F,
2525
+ removeRowKeys: ft,
2526
+ syncSelectedRows: dt,
2527
+ setLoading: le,
2528
+ setColumns: ve,
2529
+ search: V,
2530
+ columns: v,
2531
+ formParamsRef: U,
2532
+ onBeforeSearchSubmit: e.onBeforeSearchSubmit,
2533
+ hasCustomRender: w(() => Ie(e.customRender || (a == null ? void 0 : a.customRender)))
2534
+ }, l), Ne = w(() => e.options ? {
2535
+ ...Ma,
2536
+ ...J(e.options) ? e.options : {}
2537
+ } : !1), _t = w(() => ({
2538
+ size: C(re),
2539
+ scroll: C(P),
2540
+ dataSource: C(je),
2541
+ pagination: C(t),
2542
+ virtualScroll: A.value,
2543
+ columns: C(v).filter((h) => h.show || h.show === void 0)
2544
+ })), mt = w(() => {
2545
+ var $, B;
2546
+ const h = J(e.loading) ? qe(e.loading, "spinning") : {};
2547
+ return !h.indicator && (($ = b == null ? void 0 : b.indicator) != null && $.value) && (h.indicator = (B = b == null ? void 0 : b.indicator) == null ? void 0 : B.value), {
2548
+ spinning: e.showLoading ? Ie(oe.value) : !1,
2549
+ ...h
2550
+ };
2551
+ }), vt = w(() => {
2552
+ var E;
2553
+ let h;
2554
+ const $ = C(O).direction === "rtl" ? "bottomLeft" : "right", B = (E = C(t)) == null ? void 0 : E.position;
2555
+ if (B !== null && Array.isArray(B)) {
2556
+ const k = B.find((M) => M.includes("top")), Q = B.find((M) => M.includes("bottom")), ae = B.every((M) => `${M}` == "none");
2557
+ !k && !Q && !ae && (h = $), k && (h = k.toLowerCase().replace("top", "")), Q && (h = Q.toLowerCase().replace("bottom", ""));
2558
+ } else
2559
+ h = $;
2560
+ return h;
2561
+ });
2562
+ ma(() => {
2563
+ f.value && e.keepAliveReload ? Pe() : f.value = !0;
2564
+ });
2565
+ const gt = async (h, $) => {
2566
+ var B;
2567
+ W.value ? (B = K.value) != null && B.reload && $ ? (Ue(h), await Pe()) : Ue(h) : (Ue({
2568
+ ...e.params || {},
2569
+ ...h
2570
+ }), await Pe());
2571
+ }, qt = async (h, $) => {
2572
+ $ === "reset" ? (l("reset", h), e.request && await gt(h, $)) : e.request ? (l("submit", h), await gt(h, $)) : l("submit", h);
2573
+ }, yt = (h, $, B, E) => {
2574
+ F(xt(h, ["current", "pageSize"])), ht(h, $, B, E);
2575
+ }, Xt = (h, $) => {
2576
+ var B;
2577
+ F({
2578
+ current: h,
2579
+ pageSize: $
2580
+ }), ht({
2581
+ current: h,
2582
+ pageSize: $,
2583
+ total: t.value && ((B = t.value) == null ? void 0 : B.total) || 0
2584
+ }, {}, {});
2585
+ }, Ut = (h) => {
2586
+ l("expandedRowsChange", h);
2587
+ }, Jt = (h, $) => {
2588
+ l("expand", h, $);
2589
+ }, Zt = (h, $) => Te(h, $), el = (h, $, B) => {
2590
+ var k, Q, ae;
2591
+ let E = h;
2592
+ if ($) {
2593
+ const M = ue(h) ? typeof ((k = h == null ? void 0 : h[0]) == null ? void 0 : k.children) == "string" ? (Q = h == null ? void 0 : h[0]) == null ? void 0 : Q.children : "" : h.toString(), D = B.tooltip === !1 ? {} : B.tooltip, be = B.tooltip === !1 ? 1 : Qe(D == null ? void 0 : D.hiddenLine) && (D == null ? void 0 : D.hiddenLine) > 0 ? D == null ? void 0 : D.hiddenLine : 1, ne = B.tooltip === !1 ? 0 : Qe(D == null ? void 0 : D.width) ? D == null ? void 0 : D.width : 0, Re = B.tooltip !== !1 && It(M) && ne > 0 ? cl(M, {
2594
+ cssObject: D == null ? void 0 : D.targetStyle
2595
+ }) : 0, We = document.querySelector(`.${i} .ant-table-tbody`), $e = c("div", {
2596
+ class: `${i}-ellipsis-text`
2597
+ }, [h]), Ee = () => B.tooltip === !1 || J(B.tooltip) && Re < ne && ne > 0 ? $e : c(fe, _({
2598
+ title: h,
2599
+ getPopupContainer: (De) => {
2600
+ var Ct;
2601
+ return We ?? ((Ct = De == null ? void 0 : De.parentNode) == null ? void 0 : Ct.parentNode);
2602
+ }
2603
+ }, J(B.tooltip) ? B.tooltip : {}, {
2604
+ destroyTooltipOnHide: !0
2605
+ }), Ea($e) ? $e : {
2606
+ default: () => [$e]
2607
+ });
2608
+ if (E = c("div", {
2609
+ class: `${i}-ellipsis ${(D == null ? void 0 : D.class) ?? ""}`,
2610
+ style: {
2611
+ "-webkit-line-clamp": be
2612
+ }
2613
+ }, [Ee()]), B.copyable) {
2614
+ const De = typeof B.copyText == "function" ? (ae = B.copyText) == null ? void 0 : ae.call(B, B) : B.copyText || M;
2615
+ E = c("div", {
2616
+ class: `${i}-copyable`
2617
+ }, [c("div", {
2618
+ class: `${i}-ellipsis ${(D == null ? void 0 : D.class) ?? ""}`,
2619
+ style: {
2620
+ "-webkit-line-clamp": be
2621
+ }
2622
+ }, [Ee()]), c(Ol, {
2623
+ class: `${i}-copyable-icon`,
2624
+ onClick: () => {
2625
+ Na(De), Ll.success("复制成功");
2626
+ }
2627
+ }, null)]);
2628
+ }
2629
+ }
2630
+ return E;
2631
+ };
2632
+ function bt() {
2633
+ var B, E, k, Q, ae;
2634
+ const h = Fe(a, e, "emptyText");
2635
+ if (h !== !1 && ((B = b == null ? void 0 : b.emptyText) == null ? void 0 : B.value) !== !1) {
2636
+ const M = ((E = e.emptyTextProps) == null ? void 0 : E.extraProps) || {}, D = h || ((k = b == null ? void 0 : b.emptyText) == null ? void 0 : k.value), be = Z(D), ne = be ? kt(D, M) : Bt(D || []);
2637
+ return c("div", {
2638
+ class: Se(`${i}-empty-text`, m.value, (Q = e.emptyTextProps) == null ? void 0 : Q.class),
2639
+ style: (ae = e.emptyTextProps) == null ? void 0 : ae.style
2640
+ }, [be ? ne : ue(ne) ? ne.map((Re) => it(Re, M)) : c(Wl, null, null)]);
2641
+ }
2642
+ return null;
2643
+ }
2644
+ const tl = () => {
2645
+ var $;
2646
+ const h = Ft(a, e, "customRender");
2647
+ if (h) {
2648
+ if (($ = je.value) != null && $.length) {
2649
+ const B = ie(C(je));
2650
+ return h == null ? void 0 : h({
2651
+ dataSource: B,
2652
+ currentData: ja(B, t.value)
2653
+ });
2654
+ }
2655
+ return bt();
2656
+ }
2657
+ return c(_e, null, null);
2658
+ }, ll = (h) => {
2659
+ var k, Q;
2660
+ const $ = Fe(a, e, "headerTitle"), B = Fe(a, e, "titleTip"), E = Fe(a, e, "toolBarBtn");
2661
+ return c(fa, {
2662
+ headerTitle: $,
2663
+ titleTip: B,
2664
+ titleTipText: e.titleTipText,
2665
+ options: se(Ne.value) ? Ne.value : {
2666
+ ...Ne.value,
2667
+ setting: h ? !1 : (k = Ne.value) == null ? void 0 : k.setting,
2668
+ density: h ? !1 : (Q = Ne.value) == null ? void 0 : Q.density
2669
+ },
2670
+ settingExtra: Fe(a, e, "settingExtra"),
2671
+ optionsExtra: Fe(a, e, "optionsExtra"),
2672
+ toolBarBtn: E
2673
+ }, null);
2674
+ };
2675
+ return Gl({
2676
+ tableSize: re,
2677
+ columns: v,
2678
+ cacheColumns: G,
2679
+ isMobile: R,
2680
+ searchConfig: L,
2681
+ manualSearch: W,
2682
+ searchActions: K,
2683
+ action: {
2684
+ setTableSize: Oe,
2685
+ reload: (h) => Pe(h),
2686
+ toggle: y
2687
+ },
2688
+ settingsAction: {
2689
+ autoScroll: ce(e, "autoScroll"),
2690
+ columnsMap: ee,
2691
+ operationType: Le,
2692
+ setColumnsMap: ke,
2693
+ sortKeyColumns: te,
2694
+ cacheColumnsMap: ge,
2695
+ setSortKeyColumns: Y
2696
+ },
2697
+ setPagination: F,
2698
+ changeColumns: pe,
2699
+ slots: a
2700
+ }), s({
2701
+ formRef: () => ({
2702
+ getFormState: () => C(U),
2703
+ getFormInnerState: () => {
2704
+ var h;
2705
+ return ((h = n.value) == null ? void 0 : h.getFormState()) || {};
2706
+ },
2707
+ restFormState: (h) => {
2708
+ var $;
2709
+ r.value = !0, h && (h == null || h()), ($ = n.value) == null || $.resetForm(!1), r.value = !1;
2710
+ }
2711
+ }),
2712
+ actionRef: () => ({
2713
+ loading: oe,
2714
+ dataSource: je,
2715
+ pageState: g,
2716
+ pagination: t.value,
2717
+ selectedKeys: w(() => ot.value),
2718
+ selectedItems: w(() => Yt.value),
2719
+ rowsSelection: {
2720
+ clear: Wt,
2721
+ select: rt,
2722
+ remove: ft,
2723
+ sync: dt,
2724
+ selectAll: ct
2725
+ },
2726
+ reload: Pe,
2727
+ getLoadingStatus: () => C(H),
2728
+ reloadAndReset: async (h) => {
2729
+ var $, B, E;
2730
+ r.value = !0, F({
2731
+ current: 1,
2732
+ pageSize: (g == null ? void 0 : g.pageSize) || 10
2733
+ }), h != null && h.callBack && (h != null && h.wait ? await (($ = h == null ? void 0 : h.callBack) == null ? void 0 : $.call(h)) : (B = h == null ? void 0 : h.callBack) == null || B.call(h)), (E = n.value) == null || E.resetForm(!1), r.value = !1;
2734
+ },
2735
+ reSetDataList: Vt,
2736
+ setPageAndReload: yt,
2737
+ setPagination: F,
2738
+ setData: Gt,
2739
+ setLoading: le
2740
+ })
2741
+ }), () => {
2742
+ var $, B;
2743
+ const h = Ie(e.customRender || a.customRender);
2744
+ return d(c("div", {
2745
+ ref: u,
2746
+ class: Se([{
2747
+ [`${m.value}`]: !0,
2748
+ [`${i}`]: !0,
2749
+ [`${o.class}`]: o.class,
2750
+ [`${i}-no-scroll`]: !Object.keys(C(P) || {}).length,
2751
+ [`${i}-table-tree`]: Qt.value,
2752
+ [`${i}-full-screen`]: T.value
2753
+ }]),
2754
+ style: o.style
2755
+ }, [c("div", {
2756
+ class: [`${i}-content`, m.value]
2757
+ }, [(ye.value.length > 0 || Ie(a.search)) && e.search !== !1 && c(Mt, {
2758
+ ref: n,
2759
+ modal: e.modalScroll,
2760
+ cardBordered: e.cardBordered,
2761
+ searchMap: ye.value,
2762
+ prefixCls: i,
2763
+ loading: !!C(H),
2764
+ onSearch: qt,
2765
+ defaultParams: zt
2766
+ }, {
2767
+ default: a.search ? () => {
2768
+ var E;
2769
+ return (E = a.search) == null ? void 0 : E.call(a);
2770
+ } : null
2771
+ }), c("div", {
2772
+ class: Se(m.value, `${i}-card`, e.cardBordered && `${i}-card-border`)
2773
+ }, [ll(h), h ? c(nt, mt.value, {
2774
+ default: () => {
2775
+ var E, k, Q;
2776
+ return [c("div", {
2777
+ class: `${i}-wrapper ${m.value}`
2778
+ }, [c("div", {
2779
+ class: Se(`${i}-list`, m.value, (E = e.tableProps) == null ? void 0 : E.class),
2780
+ style: (k = e.tableProps) == null ? void 0 : k.style
2781
+ }, [tl()]), e.pagination !== !1 && ((Q = je.value) == null ? void 0 : Q.length) > 0 && c(zl, _({
2782
+ class: {
2783
+ [`${i}-pagination ${m.value}`]: !0,
2784
+ [`${i}-pagination-${vt.value} ${m.value}`]: !!vt.value
2785
+ }
2786
+ }, Be(C(t)), {
2787
+ onChange: Xt
2788
+ }), null)])];
2789
+ }
2790
+ }) : c(Yl, _(xt(e, Object.keys(Dt)), _t.value, {
2791
+ style: ($ = e.tableProps) == null ? void 0 : $.style,
2792
+ class: (B = e.tableProps) == null ? void 0 : B.class,
2793
+ loading: mt.value,
2794
+ rowKey: (E) => E[e.rowKey],
2795
+ transformCellText: (E) => {
2796
+ var D, be, ne, Re, We;
2797
+ e.transformCellText && typeof e.transformCellText && ((D = e.transformCellText) == null || D.call(e, E));
2798
+ const {
2799
+ column: k
2800
+ } = E;
2801
+ if (!k) return E.text;
2802
+ const Q = (k == null ? void 0 : k.key) || (k == null ? void 0 : k.dataIndex);
2803
+ let ae = !0, M = E.text;
2804
+ if (ue(M))
2805
+ if (M.length === 0 || M.length === 1 && !Z(M[0])) {
2806
+ M = M == null ? void 0 : M[0];
2807
+ const $e = rl(M, (k == null ? void 0 : k.columnEmptyText) || (e == null ? void 0 : e.columnEmptyText) || "");
2808
+ ae = $e.success, M = Pa($e.value, (k == null ? void 0 : k.valueType) || ((ne = (be = e.columns) == null ? void 0 : be.find((Ee) => (Ee.key || Ee.dataIndex) === Q)) == null ? void 0 : ne.valueType), i, m.value);
2809
+ } else ((Re = M[0]) == null ? void 0 : Re.type) === "template" && (M = (We = M[0]) == null ? void 0 : We.children);
2810
+ return k != null && k.ellipsis ? el(M, ae, k) : M;
2811
+ },
2812
+ rowSelection: e.rowSelection ? {
2813
+ ...qe(e.rowSelection, ["onSelect", "onSelectAll", "onChange", "selectedRowKeys"]),
2814
+ selectedRowKeys: ot.value,
2815
+ onSelect: rt,
2816
+ onSelectAll: ct,
2817
+ onChange: Lt
2818
+ } : void 0,
2819
+ onChange: yt,
2820
+ onExpandedRowsChange: Ut,
2821
+ onExpand: Jt,
2822
+ onResizeColumn: (E, k) => Zt(E, k)
2823
+ }), {
2824
+ ...a,
2825
+ emptyText: () => bt()
2826
+ })])])]));
2827
+ };
2828
+ }
2829
+ });
2830
+ lt.install = (e) => (e.component(lt.name, lt), e);
2831
+ export {
2832
+ lt as GProTable,
2833
+ lt as default,
2834
+ de as proTableProps,
2835
+ Ua as useTable
2836
+ };