@gx-design-vue/pro-table 0.2.0-beta.9 → 0.2.0-beta.91

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