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