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