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