element-plus-suite 0.0.3 → 0.0.4
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/README.md +86 -1
- package/dist/form-pro/component-map.d.ts +32 -0
- package/dist/form-pro/index.d.ts +2 -0
- package/dist/form-pro/index.vue.d.ts +70 -0
- package/dist/form-pro/types.d.ts +123 -0
- package/dist/form-pro/utils.d.ts +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +816 -226
- package/dist/table-pro/composables/use-table-merge.d.ts +2 -2
- package/dist/table-pro/composables/use-table-request.d.ts +1 -0
- package/dist/table-pro/index.d.ts +1 -1
- package/dist/table-pro/index.vue.d.ts +19 -1
- package/dist/table-pro/types.d.ts +33 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,206 +1,712 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import { ElTableColumn as
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import { h as g, defineComponent as ge, shallowRef as E, reactive as Z, watch as O, computed as b, onBeforeUnmount as be, isVNode as ze, nextTick as Te, useSlots as Ae, onMounted as Ie, withDirectives as Be } from "vue";
|
|
2
|
+
import { ElMention as Le, ElTransfer as De, ElTreeSelect as Ue, ElSwitch as We, ElSlider as Ne, ElRate as Ke, ElInputTag as $e, ElCascader as Ge, ElAutocomplete as Qe, ElTimeSelect as Ye, ElTimePicker as He, ElDatePicker as Je, ElSelectV2 as Xe, ElInputNumber as Ze, ElInput as te, ElUpload as et, ElButton as ee, ElCheckbox as tt, ElCheckboxGroup as nt, ElRadio as lt, ElRadioGroup as at, ElOption as rt, ElSelect as ot, ElForm as ut, ElRow as st, ElCol as ie, ElFormItem as J, ElTableColumn as ce, ElTable as it, vLoading as ct, ElPagination as dt } from "element-plus";
|
|
3
|
+
function ft(t) {
|
|
4
|
+
return typeof t == "function" ? t() : t ?? [];
|
|
5
|
+
}
|
|
6
|
+
function X(t, n) {
|
|
7
|
+
return (r, { slots: o = {} }) => {
|
|
8
|
+
const {
|
|
9
|
+
options: d,
|
|
10
|
+
props: f = {},
|
|
11
|
+
slots: u = {},
|
|
12
|
+
...a
|
|
13
|
+
} = r, c = f.label ?? "label", p = f.value ?? "value", h = f.disabled ?? "disabled";
|
|
14
|
+
return g(
|
|
15
|
+
t,
|
|
16
|
+
a,
|
|
17
|
+
{
|
|
18
|
+
// 保留 ElSelect / ElRadioGroup / ElCheckboxGroup 自身的具名插槽。
|
|
19
|
+
...o,
|
|
20
|
+
// 自动生成选项;显式传入 default 插槽时交由调用方接管。
|
|
21
|
+
default: o.default ?? (() => ft(d).map(
|
|
22
|
+
(s) => g(
|
|
23
|
+
n,
|
|
24
|
+
{
|
|
25
|
+
label: s[c],
|
|
26
|
+
value: s[p],
|
|
27
|
+
disabled: s[h]
|
|
28
|
+
},
|
|
29
|
+
typeof s.slots == "function" ? s.slots : u[s.slots]
|
|
30
|
+
)
|
|
31
|
+
))
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function vt(t, { slots: n }) {
|
|
37
|
+
return g(te, { ...t, type: "password" }, n);
|
|
38
|
+
}
|
|
39
|
+
function pt(t, { slots: n }) {
|
|
40
|
+
const { modelValue: r, "onUpdate:modelValue": o, ...d } = t;
|
|
41
|
+
return g(
|
|
42
|
+
et,
|
|
43
|
+
{
|
|
44
|
+
...d,
|
|
45
|
+
fileList: r,
|
|
46
|
+
"onUpdate:fileList": o
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
...n,
|
|
50
|
+
// ElUpload 不会自动生成触发按钮,未自定义内容时提供默认按钮。
|
|
51
|
+
default: n.default ?? (() => g(ee, { type: "primary", plain: !0 }, () => "选择文件"))
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
const gt = {
|
|
56
|
+
input: te,
|
|
57
|
+
password: vt,
|
|
58
|
+
number: Ze,
|
|
59
|
+
select: X(ot, rt),
|
|
60
|
+
selectV2: Xe,
|
|
61
|
+
radio: X(at, lt),
|
|
62
|
+
checkbox: X(nt, tt),
|
|
63
|
+
date: Je,
|
|
64
|
+
time: He,
|
|
65
|
+
timeSelect: Ye,
|
|
66
|
+
autocomplete: Qe,
|
|
67
|
+
cascader: Ge,
|
|
68
|
+
inputTag: $e,
|
|
69
|
+
rate: Ke,
|
|
70
|
+
slider: Ne,
|
|
71
|
+
switch: We,
|
|
72
|
+
tree: Ue,
|
|
73
|
+
transfer: De,
|
|
74
|
+
upload: pt,
|
|
75
|
+
mention: Le
|
|
76
|
+
};
|
|
77
|
+
function bt(t) {
|
|
78
|
+
return t.type && typeof t.type != "string" ? t.type : gt[t.type || "input"] ?? te;
|
|
79
|
+
}
|
|
80
|
+
const ht = [
|
|
81
|
+
"key",
|
|
82
|
+
"label",
|
|
83
|
+
"type",
|
|
84
|
+
"style",
|
|
85
|
+
"rules",
|
|
86
|
+
"col",
|
|
87
|
+
"hidden",
|
|
88
|
+
"labelWidth",
|
|
89
|
+
"slot",
|
|
90
|
+
"defaultValue",
|
|
91
|
+
"formItemProps",
|
|
92
|
+
"fieldProps",
|
|
93
|
+
"children",
|
|
94
|
+
"separator"
|
|
95
|
+
];
|
|
96
|
+
function yt(t) {
|
|
97
|
+
["select", "selectV2", "cascader", "autocomplete", "tree"].includes(
|
|
98
|
+
t.type
|
|
99
|
+
);
|
|
100
|
+
const n = new Set(ht);
|
|
101
|
+
return {
|
|
102
|
+
clearable: !0,
|
|
103
|
+
...Object.fromEntries(
|
|
104
|
+
Object.entries(t).filter(([o]) => !n.has(o))
|
|
105
|
+
),
|
|
106
|
+
...t.fieldProps ?? {}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function W(t) {
|
|
110
|
+
return typeof t == "number" ? { span: t } : t ?? {};
|
|
111
|
+
}
|
|
112
|
+
function de(t, n) {
|
|
113
|
+
return {
|
|
114
|
+
span: 24,
|
|
115
|
+
...W(n.col),
|
|
116
|
+
...W(t.col)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
function I(t) {
|
|
120
|
+
const n = t.flatMap((r) => {
|
|
121
|
+
const o = r.key && !r.children?.length ? [[r.key, r.defaultValue]] : [], d = I(r.children ?? []);
|
|
122
|
+
return [...o, ...Object.entries(d)];
|
|
123
|
+
});
|
|
124
|
+
return Object.fromEntries(n);
|
|
125
|
+
}
|
|
126
|
+
function mt(t) {
|
|
127
|
+
return t != null && typeof t == "object";
|
|
128
|
+
}
|
|
129
|
+
const fe = {
|
|
130
|
+
form: {
|
|
131
|
+
submitText: "提交"
|
|
132
|
+
},
|
|
133
|
+
search: {
|
|
134
|
+
submitText: "查询"
|
|
135
|
+
}
|
|
136
|
+
}, wt = {
|
|
137
|
+
submit: !0,
|
|
138
|
+
reset: !0,
|
|
139
|
+
cancel: !1
|
|
140
|
+
};
|
|
141
|
+
function ve(t, n) {
|
|
142
|
+
return Object.fromEntries(Object.entries(t).filter(([r]) => !n.includes(r)));
|
|
143
|
+
}
|
|
144
|
+
const he = /* @__PURE__ */ ge({
|
|
145
|
+
name: "ElFormPro",
|
|
146
|
+
props: {
|
|
147
|
+
schema: {
|
|
148
|
+
type: Array,
|
|
149
|
+
default: () => []
|
|
150
|
+
},
|
|
151
|
+
modelValue: {
|
|
152
|
+
type: Object,
|
|
153
|
+
default: void 0
|
|
154
|
+
},
|
|
155
|
+
formConfig: {
|
|
156
|
+
type: Object,
|
|
157
|
+
default: () => ({})
|
|
158
|
+
},
|
|
159
|
+
/** 仅供 TablePro 的筛选表单开启折叠。 */
|
|
160
|
+
collapsible: {
|
|
161
|
+
type: Boolean,
|
|
162
|
+
default: !1
|
|
163
|
+
},
|
|
164
|
+
/** 搜索模式将默认提交文案改为“查询”,仅由 TablePro 使用。 */
|
|
165
|
+
searchMode: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: !1
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
emits: {
|
|
171
|
+
"update:modelValue": (t) => !0,
|
|
172
|
+
submit: (t) => !0,
|
|
173
|
+
reset: (t) => !0,
|
|
174
|
+
cancel: () => !0,
|
|
175
|
+
change: (t) => !0
|
|
176
|
+
},
|
|
177
|
+
setup(t, {
|
|
178
|
+
emit: n,
|
|
179
|
+
expose: r,
|
|
180
|
+
slots: o
|
|
181
|
+
}) {
|
|
182
|
+
const d = E(), f = E(typeof window > "u" ? 0 : window.innerWidth), u = E(t.collapsible && !(t.formConfig?.collapsed ?? !0)), a = Z({
|
|
183
|
+
...t.formConfig
|
|
184
|
+
});
|
|
185
|
+
O(() => t.formConfig, (e) => {
|
|
186
|
+
Object.assign(a, e);
|
|
187
|
+
}, {
|
|
188
|
+
deep: !0
|
|
189
|
+
}), O(() => t.formConfig?.collapsed, (e) => {
|
|
190
|
+
t.collapsible && (u.value = !(e ?? !0));
|
|
191
|
+
});
|
|
192
|
+
const c = Z(I(t.schema)), p = b(() => mt(t.modelValue)), h = b({
|
|
193
|
+
get: () => p.value ? t.modelValue : c,
|
|
194
|
+
set: (e) => {
|
|
195
|
+
if (p.value) {
|
|
196
|
+
n("update:modelValue", e);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
for (const l of Object.keys(c)) delete c[l];
|
|
200
|
+
Object.assign(c, e), n("update:modelValue", e);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
O(() => t.schema, (e) => {
|
|
204
|
+
if (!p.value) {
|
|
205
|
+
for (const l of Object.keys(c)) delete c[l];
|
|
206
|
+
Object.assign(c, I(e));
|
|
207
|
+
}
|
|
208
|
+
}, {
|
|
209
|
+
deep: !0
|
|
210
|
+
});
|
|
211
|
+
const s = b(() => t.schema.filter((e) => !e.hidden)), w = [{
|
|
212
|
+
key: "sm",
|
|
213
|
+
min: 768
|
|
214
|
+
}, {
|
|
215
|
+
key: "md",
|
|
216
|
+
min: 992
|
|
217
|
+
}, {
|
|
218
|
+
key: "lg",
|
|
219
|
+
min: 1200
|
|
220
|
+
}, {
|
|
221
|
+
key: "xl",
|
|
222
|
+
min: 1920
|
|
223
|
+
}], C = (e, l) => {
|
|
224
|
+
let v = e.base || e.xs || "top";
|
|
225
|
+
if (l < 768) return e.xs || v;
|
|
226
|
+
for (const y of w) {
|
|
227
|
+
if (l < y.min) break;
|
|
228
|
+
v = e[y.key] || v;
|
|
229
|
+
}
|
|
230
|
+
return v;
|
|
231
|
+
}, F = b(() => {
|
|
232
|
+
const e = a.labelPosition;
|
|
233
|
+
return typeof e == "string" ? e : C(e || {
|
|
234
|
+
base: "top",
|
|
235
|
+
md: "right"
|
|
236
|
+
}, f.value);
|
|
237
|
+
}), P = (e) => typeof e == "number" ? e : e?.span, R = (e, l) => {
|
|
238
|
+
let v = P(e.span) ?? 24;
|
|
239
|
+
for (const y of w) {
|
|
240
|
+
if (l < y.min) break;
|
|
241
|
+
const k = P(e[y.key]);
|
|
242
|
+
k !== void 0 && (v = k);
|
|
243
|
+
}
|
|
244
|
+
return Math.min(24, v);
|
|
245
|
+
}, B = (e) => R(de(e, a), f.value), z = (e, l) => {
|
|
246
|
+
const v = e % 24;
|
|
247
|
+
return v && 24 - v < l && (e += 24 - v), e + l;
|
|
248
|
+
}, L = b(() => !!o.buttons || a.buttons?.submit !== !1 || a.buttons?.reset !== !1 || a.buttons?.cancel !== void 0 && a.buttons.cancel !== !1), D = (e) => {
|
|
249
|
+
if (a.actionCol !== void 0)
|
|
250
|
+
return R(W(a.actionCol), f.value);
|
|
251
|
+
const l = e ? 24 - e : 0;
|
|
252
|
+
return l >= 4 ? l : 24;
|
|
253
|
+
}, N = (e) => {
|
|
254
|
+
const l = e * 24;
|
|
255
|
+
let v = 0, y = 0;
|
|
256
|
+
for (const k of s.value) {
|
|
257
|
+
const _ = z(v, B(k));
|
|
258
|
+
if (_ > l) break;
|
|
259
|
+
const V = L.value ? z(_, D(_)) : _;
|
|
260
|
+
if (y > 0 && V > l) break;
|
|
261
|
+
v = _, y += 1;
|
|
262
|
+
}
|
|
263
|
+
return Math.max(1, y);
|
|
264
|
+
}, j = b(() => !t.collapsible || !a.showCollapseButton ? s.value.length : a.collapseCount !== void 0 ? a.collapseCount : N(a.collapseRows ?? 1)), T = b(() => u.value ? s.value : s.value.slice(0, j.value)), x = b(() => {
|
|
265
|
+
let e = 0;
|
|
266
|
+
for (const l of T.value)
|
|
267
|
+
e = z(e, B(l));
|
|
268
|
+
return e % 24;
|
|
269
|
+
}), K = b(() => D(x.value)), $ = b(() => x.value > 0 && x.value + K.value <= 24), i = b(() => F.value === "top" && $.value), m = b(() => {
|
|
270
|
+
if (a.actionCol !== void 0)
|
|
271
|
+
return {
|
|
272
|
+
span: 24,
|
|
273
|
+
...W(a.actionCol)
|
|
274
|
+
};
|
|
275
|
+
const e = x.value, l = e ? 24 - e : 0;
|
|
276
|
+
return {
|
|
277
|
+
span: l >= 4 ? l : 24
|
|
278
|
+
};
|
|
279
|
+
}), S = b(() => {
|
|
280
|
+
const e = {
|
|
281
|
+
submit: {
|
|
282
|
+
type: "primary",
|
|
283
|
+
text: t.searchMode ? fe.search.submitText : fe.form.submitText,
|
|
284
|
+
disabled: !1,
|
|
285
|
+
loading: !1
|
|
286
|
+
},
|
|
287
|
+
reset: {
|
|
288
|
+
plain: !0,
|
|
289
|
+
text: "重置",
|
|
290
|
+
disabled: !1
|
|
291
|
+
},
|
|
292
|
+
cancel: {
|
|
293
|
+
plain: !0,
|
|
294
|
+
text: "取消",
|
|
295
|
+
disabled: !1
|
|
296
|
+
}
|
|
297
|
+
}, l = (v) => {
|
|
298
|
+
const y = a.buttons?.[v];
|
|
299
|
+
return y === !1 || y === void 0 && !wt[v] ? null : {
|
|
300
|
+
...e[v],
|
|
301
|
+
...y ?? {}
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
return {
|
|
305
|
+
submit: l("submit"),
|
|
306
|
+
reset: l("reset"),
|
|
307
|
+
cancel: l("cancel")
|
|
308
|
+
};
|
|
309
|
+
}), q = b(() => Object.values(S.value).some(Boolean)), we = b(() => {
|
|
310
|
+
const e = a.buttonAlign ?? "right";
|
|
311
|
+
return e === "start" ? "is-start" : e === "center" ? "is-center" : "is-end";
|
|
312
|
+
}), Pe = (e) => de(e, a), Se = (e, l) => {
|
|
313
|
+
const v = {
|
|
314
|
+
...h.value,
|
|
315
|
+
[e]: l
|
|
316
|
+
};
|
|
317
|
+
h.value = v, n("change", v);
|
|
318
|
+
}, ke = (e) => Array.isArray(e) ? e : e ? [e] : [], Ce = (e) => {
|
|
319
|
+
const l = [], v = (y) => {
|
|
320
|
+
for (const k of y)
|
|
321
|
+
k.hidden || (k.children?.length ? v(k.children) : l.push(k));
|
|
322
|
+
};
|
|
323
|
+
return v(e.children ?? []), l;
|
|
324
|
+
}, Ee = (e) => ke(e).some((l) => l?.required), Oe = (e) => Ce(e).some((l) => Ee(l.rules)), G = (e, l) => e ? g(ee, {
|
|
325
|
+
...ve(e, ["text"]),
|
|
326
|
+
onClick: l
|
|
327
|
+
}, () => e.text) : null, Q = (e) => {
|
|
328
|
+
const l = o[e.slot ?? e.key ?? ""];
|
|
329
|
+
if (l) return l({
|
|
330
|
+
item: e,
|
|
331
|
+
model: h.value
|
|
332
|
+
});
|
|
333
|
+
const v = bt(e);
|
|
334
|
+
if (ze(v)) return v;
|
|
335
|
+
const {
|
|
336
|
+
slots: y,
|
|
337
|
+
...k
|
|
338
|
+
} = yt(e), _ = Object.fromEntries(Object.entries(y ?? {}).flatMap(([V, A]) => {
|
|
339
|
+
const M = typeof A == "function" ? A : o[String(A)];
|
|
340
|
+
return M ? [[V, (U = {}) => M({
|
|
341
|
+
...U,
|
|
342
|
+
item: e,
|
|
343
|
+
model: h.value
|
|
344
|
+
})]] : [];
|
|
345
|
+
}));
|
|
346
|
+
return g(v, {
|
|
347
|
+
...k,
|
|
348
|
+
modelValue: e.key == null ? void 0 : h.value[e.key],
|
|
349
|
+
"onUpdate:modelValue": (V) => {
|
|
350
|
+
e.key != null && Se(e.key, V);
|
|
351
|
+
}
|
|
352
|
+
}, _);
|
|
353
|
+
}, ne = (e) => typeof e.label == "function" ? e.label() : e.label, _e = (e) => {
|
|
354
|
+
const l = F.value;
|
|
355
|
+
return g("div", {
|
|
356
|
+
class: ["el-form-item", `el-form-item--label-${l}`, "el-form-pro__group", {
|
|
357
|
+
"is-required": e.formItemProps?.required ?? Oe(e)
|
|
358
|
+
}],
|
|
359
|
+
style: e.style
|
|
360
|
+
}, [e.label ? g("div", {
|
|
361
|
+
class: "el-form-item__label",
|
|
362
|
+
style: l === "top" ? void 0 : {
|
|
363
|
+
width: e.labelWidth ?? a.labelWidth
|
|
364
|
+
}
|
|
365
|
+
}, [ne(e)]) : null, g("div", {
|
|
366
|
+
class: "el-form-item__content"
|
|
367
|
+
}, [le(e)])]);
|
|
368
|
+
}, Me = (e) => e.children?.length ? le(e) : g(J, {
|
|
369
|
+
...e.formItemProps ?? {},
|
|
370
|
+
prop: e.key,
|
|
371
|
+
rules: e.rules,
|
|
372
|
+
labelWidth: e.labelWidth ?? a.labelWidth,
|
|
373
|
+
class: [e.formItemProps?.class, "el-form-pro__child"],
|
|
374
|
+
style: e.style
|
|
375
|
+
}, {
|
|
376
|
+
default: () => Q(e)
|
|
377
|
+
}), le = (e) => e.children?.length ? g("div", {
|
|
378
|
+
class: "el-form-pro__children"
|
|
379
|
+
}, e.children.filter((l) => !l.hidden).flatMap((l, v) => {
|
|
380
|
+
const y = g("div", {
|
|
381
|
+
class: "el-form-pro__child-wrapper",
|
|
382
|
+
key: l.key
|
|
383
|
+
}, [Me(l)]);
|
|
384
|
+
return v === 0 ? [y] : [g("span", {
|
|
385
|
+
class: "el-form-pro__separator"
|
|
386
|
+
}, e.separator ?? ""), y];
|
|
387
|
+
})) : Q(e), ae = async () => {
|
|
388
|
+
t.collapsible && (u.value = !0), await Te(), d.value?.$el?.querySelector(".is-error")?.scrollIntoView({
|
|
389
|
+
behavior: "smooth",
|
|
390
|
+
block: "center"
|
|
391
|
+
});
|
|
392
|
+
}, re = (...e) => d.value?.validate(...e), Fe = (...e) => d.value?.validateField(...e), oe = async () => {
|
|
393
|
+
try {
|
|
394
|
+
await re(), n("submit", h.value);
|
|
395
|
+
} catch {
|
|
396
|
+
ae();
|
|
397
|
+
}
|
|
398
|
+
}, Re = (e) => {
|
|
399
|
+
const l = I(t.schema), v = e == null ? null : new Set(Array.isArray(e) ? e : [e]), y = {}, k = (_, V = !1, A = !1) => {
|
|
400
|
+
for (const M of _) {
|
|
401
|
+
const U = V || v === null || v.has(M.key);
|
|
402
|
+
M.children?.length ? k(M.children, U, !0) : A && U && M.key != null && (y[M.key] = l[M.key]);
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
return k(t.schema), y;
|
|
406
|
+
}, ue = (...e) => {
|
|
407
|
+
d.value?.resetFields(...e);
|
|
408
|
+
const l = Re(e[0]);
|
|
409
|
+
return Object.keys(l).length && (h.value = {
|
|
410
|
+
...h.value,
|
|
411
|
+
...l
|
|
412
|
+
}), {
|
|
413
|
+
...h.value,
|
|
414
|
+
...l
|
|
415
|
+
};
|
|
416
|
+
}, je = () => {
|
|
417
|
+
const e = ue();
|
|
418
|
+
n("reset", e);
|
|
419
|
+
}, xe = () => n("cancel"), qe = (e) => {
|
|
420
|
+
Object.assign(a, e);
|
|
421
|
+
}, Ve = () => h.value, Y = () => {
|
|
422
|
+
d.value?.$el, typeof window < "u" && (f.value = window.innerWidth);
|
|
423
|
+
}, H = typeof ResizeObserver > "u" ? null : new ResizeObserver(Y);
|
|
424
|
+
O(() => d.value?.$el, (e) => {
|
|
425
|
+
H?.disconnect(), e && H?.observe(e), Y();
|
|
426
|
+
}, {
|
|
427
|
+
flush: "post"
|
|
428
|
+
});
|
|
429
|
+
const se = () => {
|
|
430
|
+
typeof window < "u" && (f.value = window.innerWidth), Y();
|
|
431
|
+
};
|
|
432
|
+
return typeof window < "u" && window.addEventListener("resize", se), be(() => {
|
|
433
|
+
H?.disconnect(), typeof window < "u" && window.removeEventListener("resize", se);
|
|
434
|
+
}), r({
|
|
435
|
+
validate: (...e) => re(...e),
|
|
436
|
+
validateField: (...e) => Fe(...e),
|
|
437
|
+
resetFields: (...e) => {
|
|
438
|
+
ue(...e);
|
|
439
|
+
},
|
|
440
|
+
clearValidate: (...e) => {
|
|
441
|
+
d.value?.clearValidate(...e);
|
|
442
|
+
},
|
|
443
|
+
scrollToError: ae,
|
|
444
|
+
setState: qe,
|
|
445
|
+
getValues: Ve
|
|
446
|
+
}), () => {
|
|
447
|
+
const e = {
|
|
448
|
+
...ve(a, ["buttonAlign", "buttons", "row", "col", "showCollapseButton", "collapseRows", "collapseCount", "collapsed", "actionCol"])
|
|
449
|
+
};
|
|
450
|
+
return g(ut, {
|
|
451
|
+
...e,
|
|
452
|
+
class: ["el-form-pro", e.class].filter(Boolean),
|
|
453
|
+
labelPosition: F.value,
|
|
454
|
+
ref: d,
|
|
455
|
+
model: h.value,
|
|
456
|
+
onSubmit: (l) => {
|
|
457
|
+
l.preventDefault(), oe();
|
|
458
|
+
}
|
|
459
|
+
}, {
|
|
460
|
+
default: () => [g(st, {
|
|
461
|
+
gutter: 18,
|
|
462
|
+
...a.row ?? {}
|
|
463
|
+
}, {
|
|
464
|
+
default: () => [...T.value.map((l) => g(ie, {
|
|
465
|
+
...Pe(l),
|
|
466
|
+
key: l.key ?? l.children?.[0]?.key
|
|
467
|
+
}, {
|
|
468
|
+
default: () => l.children?.length ? _e(l) : g(J, {
|
|
469
|
+
...l.formItemProps ?? {},
|
|
470
|
+
label: typeof l.label == "function" ? void 0 : l.label,
|
|
471
|
+
labelWidth: l.labelWidth ?? a.labelWidth,
|
|
472
|
+
prop: l.key,
|
|
473
|
+
rules: l.rules,
|
|
474
|
+
class: l.formItemProps?.class,
|
|
475
|
+
style: l.style
|
|
476
|
+
}, {
|
|
477
|
+
...typeof l.label == "function" ? {
|
|
478
|
+
label: () => ne(l)
|
|
479
|
+
} : {},
|
|
480
|
+
default: () => Q(l)
|
|
481
|
+
})
|
|
482
|
+
})), q.value && s.value.length ? g(ie, m.value, {
|
|
483
|
+
default: () => g(J, null, {
|
|
484
|
+
...i.value ? {
|
|
485
|
+
label: () => g("label", {
|
|
486
|
+
class: "el-form-pro__actions-label"
|
|
487
|
+
})
|
|
488
|
+
} : {},
|
|
489
|
+
default: () => g("div", {
|
|
490
|
+
class: ["el-form-pro__actions", we.value]
|
|
491
|
+
}, [o.buttons ? o.buttons() : [G(S.value.submit, () => {
|
|
492
|
+
oe();
|
|
493
|
+
}), G(S.value.reset, je), G(S.value.cancel, xe)], t.collapsible && a.showCollapseButton && s.value.length > j.value ? g(ee, {
|
|
494
|
+
type: "primary",
|
|
495
|
+
link: !0,
|
|
496
|
+
onClick: () => {
|
|
497
|
+
u.value = !u.value;
|
|
498
|
+
}
|
|
499
|
+
}, () => u.value ? "收起" : "展开") : null])
|
|
500
|
+
})
|
|
501
|
+
}) : null]
|
|
502
|
+
})]
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
function ye(t, n) {
|
|
508
|
+
return t.flatMap((r) => {
|
|
5
509
|
if (r.visible === !1) return [];
|
|
6
510
|
const {
|
|
7
|
-
visible:
|
|
8
|
-
slot:
|
|
9
|
-
headerSlot:
|
|
10
|
-
render:
|
|
11
|
-
headerRender:
|
|
12
|
-
autoMerge:
|
|
13
|
-
children:
|
|
14
|
-
...
|
|
15
|
-
} = r,
|
|
16
|
-
if (
|
|
17
|
-
row:
|
|
18
|
-
column:
|
|
19
|
-
$index:
|
|
20
|
-
})),
|
|
21
|
-
column:
|
|
22
|
-
$index:
|
|
23
|
-
store:
|
|
24
|
-
_self:
|
|
25
|
-
})),
|
|
26
|
-
const
|
|
27
|
-
default: () =>
|
|
511
|
+
visible: o,
|
|
512
|
+
slot: d,
|
|
513
|
+
headerSlot: f,
|
|
514
|
+
render: u,
|
|
515
|
+
headerRender: a,
|
|
516
|
+
autoMerge: c,
|
|
517
|
+
children: p,
|
|
518
|
+
...h
|
|
519
|
+
} = r, s = { ...h }, w = {}, C = d ? n[d] : void 0, F = f ? n[f] : void 0;
|
|
520
|
+
if (C ? w.default = C : u && (w.default = (P) => u({
|
|
521
|
+
row: P.row,
|
|
522
|
+
column: P.column,
|
|
523
|
+
$index: P.$index
|
|
524
|
+
})), F ? w.header = F : a && (w.header = (P) => a({
|
|
525
|
+
column: P.column,
|
|
526
|
+
$index: P.$index,
|
|
527
|
+
store: P.store,
|
|
528
|
+
_self: P._self
|
|
529
|
+
})), p?.length) {
|
|
530
|
+
const P = {
|
|
531
|
+
default: () => ye(p, n)
|
|
28
532
|
};
|
|
29
|
-
return
|
|
533
|
+
return w.header && (P.header = w.header), [g(ce, s, P)];
|
|
30
534
|
}
|
|
31
535
|
return [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Object.keys(
|
|
536
|
+
g(
|
|
537
|
+
ce,
|
|
538
|
+
s,
|
|
539
|
+
Object.keys(w).length ? w : void 0
|
|
36
540
|
)
|
|
37
541
|
];
|
|
38
542
|
});
|
|
39
543
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
544
|
+
function pe(t) {
|
|
545
|
+
return t.prop ?? t.property;
|
|
42
546
|
}
|
|
43
|
-
function
|
|
44
|
-
if (
|
|
45
|
-
const r =
|
|
46
|
-
if (Object.prototype.hasOwnProperty.call(r,
|
|
47
|
-
return r[
|
|
48
|
-
if (!
|
|
49
|
-
let
|
|
50
|
-
for (const
|
|
51
|
-
if (
|
|
52
|
-
|
|
547
|
+
function Pt(t, n) {
|
|
548
|
+
if (t === null || typeof t != "object") return;
|
|
549
|
+
const r = t;
|
|
550
|
+
if (Object.prototype.hasOwnProperty.call(r, n))
|
|
551
|
+
return r[n];
|
|
552
|
+
if (!n.includes(".")) return;
|
|
553
|
+
let o = r;
|
|
554
|
+
for (const d of n.split(".")) {
|
|
555
|
+
if (o === null || typeof o != "object") return;
|
|
556
|
+
o = o[d];
|
|
53
557
|
}
|
|
54
|
-
return
|
|
558
|
+
return o;
|
|
55
559
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
560
|
+
function me(t) {
|
|
561
|
+
return t.flatMap((n) => n.visible === !1 ? [] : n.children?.length ? me(n.children) : [n]);
|
|
58
562
|
}
|
|
59
|
-
function
|
|
60
|
-
const r =
|
|
61
|
-
for (const
|
|
62
|
-
const
|
|
63
|
-
|
|
563
|
+
function St(t, n = []) {
|
|
564
|
+
const r = me(t), o = /* @__PURE__ */ new Map();
|
|
565
|
+
for (const a of r) {
|
|
566
|
+
const c = pe(a);
|
|
567
|
+
c && !o.has(c) && o.set(c, a);
|
|
64
568
|
}
|
|
65
|
-
const
|
|
66
|
-
!
|
|
67
|
-
key:
|
|
68
|
-
getValue: (
|
|
569
|
+
const d = /* @__PURE__ */ new Set(), f = [], u = (a) => {
|
|
570
|
+
!a || d.has(a) || !o.has(a) || (d.add(a), f.push({
|
|
571
|
+
key: a,
|
|
572
|
+
getValue: (c) => Pt(c, a)
|
|
69
573
|
}));
|
|
70
574
|
};
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
}),
|
|
575
|
+
return n.forEach(u), r.forEach((a) => {
|
|
576
|
+
a.autoMerge && u(pe(a));
|
|
577
|
+
}), f;
|
|
74
578
|
}
|
|
75
|
-
function
|
|
76
|
-
const r =
|
|
77
|
-
|
|
579
|
+
function kt(t, n) {
|
|
580
|
+
const r = t.length, o = new Map(
|
|
581
|
+
n.map((u) => [u.key, Array.from({ length: r }, () => 1)])
|
|
78
582
|
);
|
|
79
|
-
if (!r || !
|
|
80
|
-
const
|
|
81
|
-
for (let
|
|
82
|
-
let
|
|
83
|
-
for (let
|
|
84
|
-
const
|
|
85
|
-
if (!
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
for (let
|
|
89
|
-
|
|
90
|
-
|
|
583
|
+
if (!r || !n.length) return o;
|
|
584
|
+
const d = t.map((u) => n.map((a) => a.getValue(u))), f = n.map(() => 0);
|
|
585
|
+
for (let u = 1; u <= r; u += 1) {
|
|
586
|
+
let a = !0;
|
|
587
|
+
for (let c = 0; c < n.length; c += 1) {
|
|
588
|
+
const p = u < r && a && d[u][c] === d[u - 1][c];
|
|
589
|
+
if (!p) {
|
|
590
|
+
const h = o.get(n[c].key), s = f[c], w = u - s;
|
|
591
|
+
h[s] = w;
|
|
592
|
+
for (let C = s + 1; C < u; C += 1)
|
|
593
|
+
h[C] = 0;
|
|
594
|
+
f[c] = u;
|
|
91
595
|
}
|
|
92
|
-
|
|
596
|
+
a = p;
|
|
93
597
|
}
|
|
94
598
|
}
|
|
95
|
-
return
|
|
599
|
+
return o;
|
|
96
600
|
}
|
|
97
|
-
function
|
|
98
|
-
return
|
|
601
|
+
function Ct(t, n = "children") {
|
|
602
|
+
return t.some((r) => {
|
|
99
603
|
if (r === null || typeof r != "object") return !1;
|
|
100
|
-
const
|
|
101
|
-
return Array.isArray(
|
|
604
|
+
const o = r[n];
|
|
605
|
+
return Array.isArray(o) && o.length > 0;
|
|
102
606
|
});
|
|
103
607
|
}
|
|
104
|
-
function
|
|
105
|
-
const
|
|
106
|
-
() =>
|
|
107
|
-
), r =
|
|
108
|
-
if (!
|
|
608
|
+
function Et(t) {
|
|
609
|
+
const n = b(
|
|
610
|
+
() => St(t.columns(), t.mergeFields())
|
|
611
|
+
), r = b(() => n.value.length ? t.tableRef.value?.store?.states?.data?.value ?? t.data.value : t.data.value), o = b(() => {
|
|
612
|
+
if (!n.value.length || t.lazy())
|
|
109
613
|
return /* @__PURE__ */ new Map();
|
|
110
|
-
const
|
|
111
|
-
return
|
|
614
|
+
const f = t.treeProps()?.children ?? "children", u = r.value;
|
|
615
|
+
return Ct(u, f) ? /* @__PURE__ */ new Map() : kt(u, n.value);
|
|
112
616
|
});
|
|
113
617
|
return {
|
|
114
|
-
spanMethod:
|
|
115
|
-
const
|
|
116
|
-
return
|
|
117
|
-
const
|
|
118
|
-
if (
|
|
119
|
-
const
|
|
120
|
-
if (!(
|
|
121
|
-
return { rowspan:
|
|
122
|
-
} :
|
|
618
|
+
spanMethod: b(() => {
|
|
619
|
+
const f = t.userSpanMethod();
|
|
620
|
+
return n.value.length ? (u) => {
|
|
621
|
+
const a = f?.(u);
|
|
622
|
+
if (a !== void 0) return a;
|
|
623
|
+
const c = u.column.property, p = c ? o.value.get(c)?.[u.rowIndex] : void 0;
|
|
624
|
+
if (!(p === void 0 || p === 1))
|
|
625
|
+
return { rowspan: p, colspan: 1 };
|
|
626
|
+
} : f;
|
|
123
627
|
}),
|
|
124
|
-
spanMap:
|
|
628
|
+
spanMap: o
|
|
125
629
|
};
|
|
126
630
|
}
|
|
127
|
-
const
|
|
631
|
+
const Ot = {
|
|
128
632
|
page: 1,
|
|
129
633
|
pageSize: 20,
|
|
130
634
|
pageSizes: [10, 20, 50, 100],
|
|
635
|
+
pagerCount: 5,
|
|
131
636
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
132
637
|
background: !0
|
|
133
638
|
};
|
|
134
|
-
function
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
...
|
|
639
|
+
function _t(t) {
|
|
640
|
+
return t === !1 ? null : {
|
|
641
|
+
...Ot,
|
|
642
|
+
...t === !0 ? {} : t ?? {}
|
|
138
643
|
};
|
|
139
644
|
}
|
|
140
|
-
function
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
() =>
|
|
144
|
-
(
|
|
145
|
-
|
|
645
|
+
function Mt(t) {
|
|
646
|
+
const n = b(() => _t(t())), r = E(n.value?.page ?? 1), o = E(n.value?.pageSize ?? 20);
|
|
647
|
+
O(
|
|
648
|
+
() => n.value?.page,
|
|
649
|
+
(a) => {
|
|
650
|
+
a !== void 0 && (r.value = a);
|
|
146
651
|
}
|
|
147
|
-
),
|
|
148
|
-
() =>
|
|
149
|
-
(
|
|
150
|
-
|
|
652
|
+
), O(
|
|
653
|
+
() => n.value?.pageSize,
|
|
654
|
+
(a) => {
|
|
655
|
+
a !== void 0 && (o.value = a);
|
|
151
656
|
}
|
|
152
657
|
);
|
|
153
|
-
const
|
|
154
|
-
() =>
|
|
155
|
-
),
|
|
156
|
-
() =>
|
|
658
|
+
const d = b(
|
|
659
|
+
() => n.value ? r.value : null
|
|
660
|
+
), f = b(
|
|
661
|
+
() => n.value ? o.value : null
|
|
157
662
|
);
|
|
158
|
-
function
|
|
159
|
-
|
|
663
|
+
function u(a) {
|
|
664
|
+
o.value = a, r.value = 1;
|
|
160
665
|
}
|
|
161
666
|
return {
|
|
162
667
|
// 模板直接依赖这个布尔值,避免访问可能为 null 的配置。
|
|
163
|
-
enabled:
|
|
164
|
-
config:
|
|
668
|
+
enabled: b(() => n.value != null),
|
|
669
|
+
config: n,
|
|
165
670
|
currentPage: r,
|
|
166
|
-
pageSize:
|
|
167
|
-
requestPage:
|
|
168
|
-
requestPageSize:
|
|
169
|
-
setPageSize:
|
|
671
|
+
pageSize: o,
|
|
672
|
+
requestPage: d,
|
|
673
|
+
requestPageSize: f,
|
|
674
|
+
setPageSize: u
|
|
170
675
|
};
|
|
171
676
|
}
|
|
172
|
-
function
|
|
173
|
-
const
|
|
174
|
-
let r = null,
|
|
175
|
-
async function
|
|
176
|
-
const
|
|
177
|
-
if (!
|
|
677
|
+
function Ft(t) {
|
|
678
|
+
const n = E(!1);
|
|
679
|
+
let r = null, o = 0;
|
|
680
|
+
async function d() {
|
|
681
|
+
const u = t.request();
|
|
682
|
+
if (!u) return;
|
|
178
683
|
r?.abort(), r = new AbortController();
|
|
179
|
-
const
|
|
180
|
-
|
|
684
|
+
const a = ++o, c = r;
|
|
685
|
+
n.value = !0;
|
|
181
686
|
try {
|
|
182
|
-
const
|
|
183
|
-
page:
|
|
184
|
-
pageSize:
|
|
185
|
-
|
|
687
|
+
const p = await u({
|
|
688
|
+
page: t.page(),
|
|
689
|
+
pageSize: t.pageSize(),
|
|
690
|
+
query: t.query(),
|
|
691
|
+
signal: c.signal
|
|
186
692
|
});
|
|
187
|
-
if (
|
|
693
|
+
if (c.signal.aborted || a !== o)
|
|
188
694
|
return;
|
|
189
|
-
|
|
190
|
-
} catch (
|
|
191
|
-
if (
|
|
695
|
+
t.onData?.(p), t.onLoaded?.(p);
|
|
696
|
+
} catch (p) {
|
|
697
|
+
if (c.signal.aborted || a !== o)
|
|
192
698
|
return;
|
|
193
|
-
|
|
699
|
+
t.onError?.(p);
|
|
194
700
|
} finally {
|
|
195
|
-
|
|
701
|
+
a === o && (n.value = !1);
|
|
196
702
|
}
|
|
197
703
|
}
|
|
198
|
-
function
|
|
199
|
-
r?.abort(),
|
|
704
|
+
function f() {
|
|
705
|
+
r?.abort(), o += 1, n.value = !1;
|
|
200
706
|
}
|
|
201
|
-
return
|
|
707
|
+
return be(f), { loading: n, load: d, cancel: f };
|
|
202
708
|
}
|
|
203
|
-
const
|
|
709
|
+
const Rt = /* @__PURE__ */ ge({
|
|
204
710
|
name: "ElTablePro",
|
|
205
711
|
inheritAttrs: !1,
|
|
206
712
|
props: {
|
|
@@ -220,6 +726,14 @@ const J = /* @__PURE__ */ C({
|
|
|
220
726
|
type: Array,
|
|
221
727
|
default: () => []
|
|
222
728
|
},
|
|
729
|
+
query: {
|
|
730
|
+
type: Object,
|
|
731
|
+
default: void 0
|
|
732
|
+
},
|
|
733
|
+
filter: {
|
|
734
|
+
type: Object,
|
|
735
|
+
default: void 0
|
|
736
|
+
},
|
|
223
737
|
data: {
|
|
224
738
|
type: Array,
|
|
225
739
|
default: () => []
|
|
@@ -230,111 +744,187 @@ const J = /* @__PURE__ */ C({
|
|
|
230
744
|
}
|
|
231
745
|
},
|
|
232
746
|
emits: {
|
|
233
|
-
loaded: (
|
|
234
|
-
error: (
|
|
747
|
+
loaded: (t) => !0,
|
|
748
|
+
error: (t) => !0
|
|
235
749
|
},
|
|
236
|
-
setup(
|
|
237
|
-
attrs:
|
|
750
|
+
setup(t, {
|
|
751
|
+
attrs: n,
|
|
238
752
|
emit: r,
|
|
239
|
-
expose:
|
|
753
|
+
expose: o
|
|
240
754
|
}) {
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
755
|
+
const d = Ae(), f = E(null), u = E([]), a = E(0), c = b(() => ({
|
|
756
|
+
...I(t.filter?.schema ?? []),
|
|
757
|
+
...t.filter?.defaultValue ?? {},
|
|
758
|
+
...t.filter?.model ?? {}
|
|
759
|
+
})), p = Z({
|
|
760
|
+
...c.value
|
|
761
|
+
}), h = E({
|
|
762
|
+
...c.value,
|
|
763
|
+
...t.query ?? {}
|
|
764
|
+
});
|
|
765
|
+
O(() => t.query, (i) => {
|
|
766
|
+
h.value = {
|
|
767
|
+
...c.value,
|
|
768
|
+
...i ?? {}
|
|
769
|
+
}, t.request && R();
|
|
770
|
+
}, {
|
|
771
|
+
deep: !0
|
|
772
|
+
}), O(() => t.filter?.model, (i) => {
|
|
773
|
+
for (const m of Object.keys(p)) delete p[m];
|
|
774
|
+
Object.assign(p, c.value, i ?? {});
|
|
775
|
+
}, {
|
|
776
|
+
deep: !0
|
|
777
|
+
});
|
|
778
|
+
const s = Mt(() => t.pagination);
|
|
779
|
+
let w = !1;
|
|
780
|
+
function C(i) {
|
|
781
|
+
i !== s.currentPage.value && (s.enabled.value && (w = !0), s.currentPage.value = i);
|
|
782
|
+
}
|
|
783
|
+
const F = b(() => {
|
|
784
|
+
const i = t.rowKey;
|
|
785
|
+
return typeof i == "function" ? (m) => String(i(m)) : i;
|
|
244
786
|
}), {
|
|
245
|
-
loading:
|
|
246
|
-
load:
|
|
247
|
-
cancel:
|
|
248
|
-
} =
|
|
249
|
-
request: () =>
|
|
250
|
-
page: () =>
|
|
251
|
-
pageSize: () =>
|
|
787
|
+
loading: P,
|
|
788
|
+
load: R,
|
|
789
|
+
cancel: B
|
|
790
|
+
} = Ft({
|
|
791
|
+
request: () => t.request,
|
|
792
|
+
page: () => s.requestPage.value,
|
|
793
|
+
pageSize: () => s.requestPageSize.value,
|
|
794
|
+
query: () => h.value,
|
|
252
795
|
onData: (i) => {
|
|
253
|
-
|
|
796
|
+
u.value = i.data, a.value = i.total;
|
|
254
797
|
},
|
|
255
798
|
onLoaded: (i) => r("loaded", i),
|
|
256
799
|
onError: (i) => r("error", i)
|
|
257
|
-
}),
|
|
258
|
-
if (
|
|
259
|
-
if (!
|
|
260
|
-
if (!
|
|
261
|
-
const i = (
|
|
262
|
-
return
|
|
263
|
-
}),
|
|
264
|
-
spanMethod:
|
|
265
|
-
} =
|
|
266
|
-
tableRef:
|
|
267
|
-
columns: () =>
|
|
268
|
-
data:
|
|
269
|
-
mergeFields: () =>
|
|
270
|
-
userSpanMethod: () =>
|
|
271
|
-
treeProps: () =>
|
|
272
|
-
lazy: () => !!
|
|
800
|
+
}), z = b(() => P.value), L = b(() => {
|
|
801
|
+
if (t.request) return u.value;
|
|
802
|
+
if (!t.data) return [];
|
|
803
|
+
if (!s.config.value) return t.data;
|
|
804
|
+
const i = (s.currentPage.value - 1) * s.pageSize.value;
|
|
805
|
+
return t.data.slice(i, i + s.pageSize.value);
|
|
806
|
+
}), D = b(() => t.request ? a.value : t.data?.length ?? 0), {
|
|
807
|
+
spanMethod: N
|
|
808
|
+
} = Et({
|
|
809
|
+
tableRef: f,
|
|
810
|
+
columns: () => t.columns,
|
|
811
|
+
data: L,
|
|
812
|
+
mergeFields: () => t.mergeFields,
|
|
813
|
+
userSpanMethod: () => n.spanMethod,
|
|
814
|
+
treeProps: () => n.treeProps,
|
|
815
|
+
lazy: () => !!n.lazy
|
|
273
816
|
});
|
|
274
|
-
async function
|
|
275
|
-
i?.page !== void 0 && (
|
|
817
|
+
async function j(i) {
|
|
818
|
+
i?.page !== void 0 && C(i.page), await R();
|
|
276
819
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
820
|
+
async function T() {
|
|
821
|
+
h.value = {
|
|
822
|
+
...p
|
|
823
|
+
}, C(1), await R();
|
|
824
|
+
}
|
|
825
|
+
async function x() {
|
|
826
|
+
const i = {
|
|
827
|
+
...c.value
|
|
828
|
+
};
|
|
829
|
+
for (const m of Object.keys(p))
|
|
830
|
+
delete p[m];
|
|
831
|
+
Object.assign(p, i), h.value = {
|
|
832
|
+
...i
|
|
833
|
+
}, C(1), await R();
|
|
834
|
+
}
|
|
835
|
+
O(() => t.request, (i) => {
|
|
836
|
+
u.value = [], a.value = 0, i ? j() : B();
|
|
837
|
+
}), O(() => [s.requestPage.value, s.requestPageSize.value], () => {
|
|
838
|
+
if (w) {
|
|
839
|
+
w = !1;
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
t.request && j();
|
|
281
843
|
});
|
|
282
|
-
const
|
|
283
|
-
get(i,
|
|
284
|
-
if (
|
|
285
|
-
|
|
286
|
-
if (
|
|
287
|
-
const
|
|
288
|
-
|
|
844
|
+
const K = new Proxy({}, {
|
|
845
|
+
get(i, m) {
|
|
846
|
+
if (m === "reload") return j;
|
|
847
|
+
if (m === "search") return T;
|
|
848
|
+
if (m === "resetFilter") return x;
|
|
849
|
+
const S = f.value;
|
|
850
|
+
if (!S) return;
|
|
851
|
+
const q = S[m];
|
|
852
|
+
return typeof q == "function" ? q.bind(S) : q;
|
|
289
853
|
},
|
|
290
|
-
has(i,
|
|
291
|
-
return
|
|
854
|
+
has(i, m) {
|
|
855
|
+
return m === "reload" || m === "search" || m === "resetFilter" ? !0 : f.value != null && m in f.value;
|
|
292
856
|
}
|
|
293
857
|
});
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
})
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
858
|
+
o(K), Ie(() => {
|
|
859
|
+
t.request && j();
|
|
860
|
+
});
|
|
861
|
+
const $ = () => Object.fromEntries(Object.entries(d).filter(([i]) => i.startsWith("filter-")).map(([i, m]) => [i.slice(7), m]));
|
|
862
|
+
return () => {
|
|
863
|
+
const i = t.filter ? g(he, {
|
|
864
|
+
schema: t.filter.schema,
|
|
865
|
+
modelValue: p,
|
|
866
|
+
collapsible: !0,
|
|
867
|
+
searchMode: !0,
|
|
868
|
+
formConfig: {
|
|
869
|
+
// 筛选表单开启折叠按钮时,默认按一行折叠。
|
|
870
|
+
...t.filter.formConfig?.showCollapseButton ? {
|
|
871
|
+
collapseRows: 1
|
|
872
|
+
} : {},
|
|
873
|
+
...t.filter.formConfig ?? {}
|
|
874
|
+
},
|
|
875
|
+
"onUpdate:modelValue": (S) => {
|
|
876
|
+
for (const q of Object.keys(p)) delete p[q];
|
|
877
|
+
Object.assign(p, S);
|
|
878
|
+
},
|
|
879
|
+
onSubmit: () => {
|
|
880
|
+
T();
|
|
881
|
+
},
|
|
882
|
+
onReset: () => {
|
|
883
|
+
x();
|
|
884
|
+
}
|
|
885
|
+
}, $()) : null, m = g(it, {
|
|
886
|
+
...n,
|
|
887
|
+
ref: f,
|
|
888
|
+
data: L.value,
|
|
889
|
+
rowKey: F.value,
|
|
890
|
+
spanMethod: N.value
|
|
303
891
|
}, {
|
|
304
|
-
default: () =>
|
|
305
|
-
empty:
|
|
306
|
-
append:
|
|
892
|
+
default: () => ye(t.columns, d),
|
|
893
|
+
empty: d.empty,
|
|
894
|
+
append: d.append
|
|
307
895
|
});
|
|
308
|
-
return
|
|
896
|
+
return g("div", {
|
|
309
897
|
class: "el-table-pro"
|
|
310
|
-
}, [
|
|
311
|
-
currentPage:
|
|
312
|
-
pageSize:
|
|
313
|
-
total:
|
|
314
|
-
pageSizes: [...
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
898
|
+
}, [i, Be(m, [[ct, z.value]]), s.enabled.value ? g(dt, {
|
|
899
|
+
currentPage: s.currentPage.value,
|
|
900
|
+
pageSize: s.pageSize.value,
|
|
901
|
+
total: D.value,
|
|
902
|
+
pageSizes: [...s.config.value?.pageSizes ?? []],
|
|
903
|
+
pagerCount: s.config.value?.pagerCount,
|
|
904
|
+
layout: s.config.value?.layout,
|
|
905
|
+
background: s.config.value?.background,
|
|
906
|
+
"onUpdate:currentPage": (S) => {
|
|
907
|
+
s.currentPage.value = S;
|
|
319
908
|
},
|
|
320
|
-
"onUpdate:pageSize": (
|
|
321
|
-
|
|
909
|
+
"onUpdate:pageSize": (S) => {
|
|
910
|
+
s.setPageSize(S);
|
|
322
911
|
}
|
|
323
912
|
}) : null]);
|
|
324
913
|
};
|
|
325
914
|
}
|
|
326
|
-
}),
|
|
327
|
-
function
|
|
328
|
-
|
|
329
|
-
const r =
|
|
330
|
-
r &&
|
|
915
|
+
}), jt = [he, Rt];
|
|
916
|
+
function xt(t) {
|
|
917
|
+
jt.forEach((n) => {
|
|
918
|
+
const r = n.name;
|
|
919
|
+
r && t.component(r, n);
|
|
331
920
|
});
|
|
332
921
|
}
|
|
333
|
-
const
|
|
922
|
+
const Tt = { install: xt };
|
|
334
923
|
export {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
924
|
+
he as ElFormPro,
|
|
925
|
+
Rt as ElTablePro,
|
|
926
|
+
Ot as TABLE_PRO_DEFAULT_PAGINATION,
|
|
927
|
+
Tt as default,
|
|
928
|
+
xt as install,
|
|
929
|
+
_t as normalizePagination
|
|
340
930
|
};
|