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