@aspire-ui/element-component-pro 1.0.1 → 1.0.2

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.
@@ -1,5 +1,477 @@
1
- import { defineComponent as W, useSlots as te, computed as w, h as ce, ref as g, onMounted as fe, onUnmounted as ue, watch as oe, unref as ee } from "vue";
2
- const de = /* @__PURE__ */ W({
1
+ import { reactive as De, defineComponent as Z, h as ne, useSlots as ye, ref as M, computed as B, onMounted as xe, nextTick as $e, onUnmounted as Re, watch as ae, unref as we } from "vue";
2
+ import { MessageBox as ze } from "element-ui";
3
+ const be = De({});
4
+ function Fe() {
5
+ return {
6
+ getSetting: (l) => l === void 0 ? { ...be } : { ...be[l] ?? {} },
7
+ setSetting: (l, t) => {
8
+ const n = be[l];
9
+ be[l] = n ? { ...n, ...t } : { ...t };
10
+ }
11
+ };
12
+ }
13
+ const Ee = /* @__PURE__ */ Z({
14
+ __name: "ProTable",
15
+ props: {
16
+ columns: null,
17
+ dataSource: null,
18
+ api: null,
19
+ rowKey: { default: "id" },
20
+ title: null,
21
+ titleHelpMessage: null,
22
+ bordered: { type: Boolean, default: !1 },
23
+ striped: { type: Boolean, default: !0 },
24
+ size: { default: "medium" },
25
+ loading: { type: Boolean, default: !1 },
26
+ maxHeight: null,
27
+ height: null,
28
+ ellipsis: { type: Boolean, default: !0 },
29
+ showIndexColumn: { type: Boolean, default: !0 },
30
+ indexColumnProps: null,
31
+ actionColumn: null,
32
+ rowSelection: null,
33
+ clearSelectOnPageChange: { type: Boolean, default: !1 },
34
+ pagination: { type: [Boolean, Object], default: () => ({ pageSize: 10, pageSizes: [10, 20, 50, 100] }) },
35
+ tableSetting: { default: () => ({ redo: !0 }) },
36
+ fetchSetting: { default: () => ({
37
+ pageField: "page",
38
+ sizeField: "pageSize",
39
+ listField: "list",
40
+ totalField: "total"
41
+ }) },
42
+ beforeFetch: null,
43
+ afterFetch: null,
44
+ immediate: { type: Boolean, default: !0 },
45
+ searchInfo: null,
46
+ defaultSort: null,
47
+ tableProps: null,
48
+ rowClassName: null,
49
+ spanMethod: null,
50
+ treeProps: null,
51
+ defaultExpandAll: { type: Boolean },
52
+ expandRowKeys: null,
53
+ lazy: { type: Boolean },
54
+ load: null
55
+ },
56
+ emits: ["register", "fetch-success", "fetch-error", "selection-change", "row-click", "row-dblclick", "sort-change", "expand-change"],
57
+ setup(A, { expose: e, emit: l }) {
58
+ const t = A, n = Z({
59
+ name: "EcpProTableDefaultCellRenderer",
60
+ props: {
61
+ column: { type: Object, required: !0 },
62
+ record: { type: Object, required: !0 },
63
+ index: { type: Number, required: !0 },
64
+ value: { required: !1 }
65
+ },
66
+ setup(o) {
67
+ return () => {
68
+ var u, m;
69
+ const a = o.column;
70
+ if (a != null && a.customRender) {
71
+ const F = a.customRender({ text: o.value, record: o.record, index: o.index });
72
+ return typeof F == "string" || typeof F == "number" ? ne("span", String(F)) : F;
73
+ }
74
+ if (a != null && a.valueEnum) {
75
+ const F = ((m = (u = a.valueEnum) == null ? void 0 : u[o.value]) == null ? void 0 : m.text) ?? o.value;
76
+ return ne("span", F == null ? "" : String(F));
77
+ }
78
+ return ne("span", o.value == null ? "" : String(o.value));
79
+ };
80
+ }
81
+ }), i = Z({
82
+ name: "EcpProTableBodyCellRenderer",
83
+ props: {
84
+ slotRender: { type: Function, required: !0 },
85
+ column: { type: Object, required: !0 },
86
+ record: { type: Object, required: !0 },
87
+ index: { type: Number, required: !0 },
88
+ value: { required: !1 },
89
+ customRender: { type: Function, required: !1 },
90
+ valueEnum: { type: Object, required: !1 }
91
+ },
92
+ setup(o) {
93
+ return () => {
94
+ const a = o.slotRender, u = a == null ? void 0 : a({ column: o.column, record: o.record, index: o.index, value: o.value });
95
+ if ((($) => $ == null ? [] : Array.isArray($) ? $.filter((I) => I != null && I !== !1 && !I.isComment) : [$])(u).length > 0)
96
+ return u;
97
+ const S = { ...o.column };
98
+ return o.customRender && (S.customRender = o.customRender), o.valueEnum && (S.valueEnum = o.valueEnum), ne(n, { props: { column: S, record: o.record, index: o.index, value: o.value } });
99
+ };
100
+ }
101
+ }), P = ye(), z = M(), s = M(), v = M(0), h = M(t.loading ?? !1), c = M([]), b = M({}), k = M([]), p = M({}), y = M([]), R = M(null), x = M({
102
+ page: 1,
103
+ pageSize: t.pagination && typeof t.pagination == "object" ? t.pagination.pageSize ?? 10 : 10,
104
+ pageSizes: t.pagination && typeof t.pagination == "object" ? t.pagination.pageSizes ?? [10, 20, 50, 100] : [10, 20, 50, 100],
105
+ total: 0
106
+ }), { getSetting: f } = Fe(), d = B(() => ({ ...f("ProTable"), ...t, ...p.value })), O = B(() => !!d.value.title || !!P.tableTitle || !!P.toolbar), j = B(() => R.value !== null ? R.value : !!t.pagination && typeof t.pagination == "object"), D = B(() => d.value.rowKey || "id"), H = B(() => new Set(y.value.map((o) => o[D.value]))), ee = B(
107
+ () => k.value.filter((o) => !o.hideInTable && !o.defaultHidden)
108
+ ), re = B(() => {
109
+ var a, u;
110
+ let o = 0;
111
+ return d.value.rowSelection && (o += Number(d.value.rowSelection.width) || 48), d.value.showIndexColumn && (o += Number((a = d.value.indexColumnProps) == null ? void 0 : a.width) || 60), d.value.actionColumn && (o += Number((u = d.value.actionColumn) == null ? void 0 : u.width) || 150), o;
112
+ }), L = (o) => typeof o == "number" && o > 0, J = B(() => ee.value.filter((a) => Y(a) && L(a.width)).reduce((a, u) => a + (typeof u.width == "number" ? u.width : 0), 0)), Q = B(() => ee.value.filter((a) => Y(a) && typeof a.width == "string").reduce((a, u) => a + (Number(ie(u)) || 80), 0)), W = (o) => o == null ? null : typeof o == "number" ? o : parseInt(String(o).replace(/px$/i, ""), 10) || null, ie = (o) => {
113
+ const a = o.width;
114
+ if (L(a) && J.value > 0 && v.value > 0 && typeof a == "number") {
115
+ const u = v.value - re.value - Q.value;
116
+ let m = Math.floor(u * a / J.value);
117
+ const F = W(o.minWidth) ?? 60, S = W(o.maxWidth);
118
+ return m = Math.max(F, m), S != null && (m = Math.min(S, m)), m;
119
+ }
120
+ if (typeof a == "string") {
121
+ const u = W(a) ?? 80, m = W(o.minWidth), F = W(o.maxWidth);
122
+ let S = u;
123
+ return m != null && (S = Math.max(m, S)), F != null && (S = Math.min(F, S)), S;
124
+ }
125
+ return o.width;
126
+ }, Y = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, V = B(() => {
127
+ var a;
128
+ const o = (a = d.value.rowSelection) == null ? void 0 : a.getCheckboxProps;
129
+ return o ? c.value.filter((u) => {
130
+ var m;
131
+ return !((m = o(u)) != null && m.disabled);
132
+ }) : c.value;
133
+ }), ce = B(() => V.value.length > 0), ue = B(() => V.value.length === 0 ? !1 : V.value.every((o) => H.value.has(o[D.value]))), de = B(() => {
134
+ const o = V.value.filter((a) => H.value.has(a[D.value])).length;
135
+ return o > 0 && o < V.value.length;
136
+ }), fe = (o) => H.value.has(o[D.value]), pe = (o) => {
137
+ var a, u, m;
138
+ return ((m = (u = (a = d.value.rowSelection) == null ? void 0 : a.getCheckboxProps) == null ? void 0 : u.call(a, o)) == null ? void 0 : m.disabled) ?? !1;
139
+ }, me = (o) => {
140
+ var a, u, m;
141
+ return ((m = (u = (a = d.value.rowSelection) == null ? void 0 : a.getRadioProps) == null ? void 0 : u.call(a, o)) == null ? void 0 : m.disabled) ?? !1;
142
+ }, K = () => {
143
+ const o = y.value.map((a) => a[D.value]);
144
+ l("selection-change", { keys: o, rows: y.value });
145
+ }, ve = (o, a) => {
146
+ const u = o[D.value];
147
+ a ? y.value = [...y.value.filter((m) => m[D.value] !== u), o] : y.value = y.value.filter((m) => m[D.value] !== u), K();
148
+ }, he = (o) => {
149
+ y.value = [o], K();
150
+ }, te = (o) => {
151
+ if (o) {
152
+ const a = new Set(y.value.map((m) => m[D.value])), u = V.value.filter((m) => !a.has(m[D.value]));
153
+ y.value = [...y.value, ...u];
154
+ } else {
155
+ const a = new Set(c.value.map((u) => u[D.value]));
156
+ y.value = y.value.filter((u) => !a.has(u[D.value]));
157
+ }
158
+ K();
159
+ }, q = async (o) => {
160
+ if (!t.api) {
161
+ if (t.dataSource)
162
+ return;
163
+ c.value = [];
164
+ return;
165
+ }
166
+ h.value = !0;
167
+ try {
168
+ const a = d.value.fetchSetting ?? {}, u = a.pageField ?? "page", m = a.sizeField ?? "pageSize", F = a.listField ?? "list", S = a.totalField ?? "total", $ = {
169
+ [u]: (o == null ? void 0 : o.page) ?? x.value.page,
170
+ [m]: (o == null ? void 0 : o.pageSize) ?? x.value.pageSize,
171
+ ...t.searchInfo,
172
+ ...o == null ? void 0 : o.searchInfo
173
+ };
174
+ (o == null ? void 0 : o.page) != null && (x.value.page = o.page), (o == null ? void 0 : o.pageSize) != null && (x.value.pageSize = o.pageSize);
175
+ const I = t.beforeFetch ? t.beforeFetch($) : $, _e = await t.api(I);
176
+ b.value = _e || {};
177
+ const ge = t.afterFetch ? t.afterFetch(_e) : _e, Ce = ge[F] ?? ge.items ?? ge.list ?? [], Se = ge[S] ?? 0;
178
+ c.value = Ce, x.value.total = Se, l("fetch-success", { items: Ce, total: Se });
179
+ } catch (a) {
180
+ l("fetch-error", a);
181
+ } finally {
182
+ h.value = !1;
183
+ }
184
+ }, oe = () => q(void 0), r = (o) => {
185
+ d.value.clearSelectOnPageChange && (y.value = []), x.value.pageSize = o, x.value.page = 1, q(void 0);
186
+ }, g = (o) => {
187
+ d.value.clearSelectOnPageChange && (y.value = []), x.value.page = o, q(void 0);
188
+ }, C = (o, a, u) => l("row-click", o, u), w = (o, a, u) => l("row-dblclick", o, u), _ = ({ prop: o, order: a }) => l("sort-change", { prop: o, order: a }), T = (o, a) => l("expand-change", o, a), E = (o) => c.value.findIndex((a) => a[D.value] === o), N = {
189
+ setProps: (o) => {
190
+ p.value = { ...p.value, ...o };
191
+ },
192
+ reload: (o) => q(o),
193
+ redoHeight: () => {
194
+ var o, a;
195
+ (a = (o = z.value) == null ? void 0 : o.doLayout) == null || a.call(o);
196
+ },
197
+ setLoading: (o) => {
198
+ h.value = o;
199
+ },
200
+ getDataSource: () => c.value,
201
+ getRawDataSource: () => b.value,
202
+ setTableData: (o) => {
203
+ c.value = o ?? [];
204
+ },
205
+ getColumns: () => k.value,
206
+ setColumns: (o) => {
207
+ if (Array.isArray(o) && o.length > 0 && typeof o[0] == "string") {
208
+ const a = o, u = (t.columns ?? []).filter((F) => a.includes(F.key ?? F.dataIndex)), m = a.map((F) => u.find((S) => (S.key ?? S.dataIndex) === F)).filter(Boolean);
209
+ m.length && (k.value = m);
210
+ } else
211
+ k.value = o ?? [];
212
+ },
213
+ setPagination: (o) => {
214
+ o != null && o.page && (x.value.page = o.page), o != null && o.pageSize && (x.value.pageSize = o.pageSize), (o == null ? void 0 : o.total) !== void 0 && (x.value.total = o.total);
215
+ },
216
+ getSelectRowKeys: () => y.value.map((o) => o[D.value]),
217
+ getSelectRows: () => y.value,
218
+ clearSelectedRowKeys: () => {
219
+ y.value = [], K();
220
+ },
221
+ setSelectedRowKeys: (o) => {
222
+ const a = new Set(o), u = c.value.filter((m) => a.has(m[D.value]));
223
+ o.forEach((m) => {
224
+ u.some((F) => F[D.value] === m) || u.push({ [D.value]: m });
225
+ }), y.value = u, K();
226
+ },
227
+ deleteSelectRowByKey: (o) => {
228
+ y.value = y.value.filter((a) => a[D.value] !== o), K();
229
+ },
230
+ updateTableData: (o, a, u) => {
231
+ o < 0 || o >= c.value.length || (c.value = [...c.value], c.value[o] = { ...c.value[o], [a]: u });
232
+ },
233
+ updateTableDataRecord: (o, a) => {
234
+ const u = E(o);
235
+ if (!(u < 0))
236
+ return c.value = [...c.value], c.value[u] = { ...c.value[u], ...a }, c.value[u];
237
+ },
238
+ deleteTableDataRecord: (o) => {
239
+ const a = Array.isArray(o) ? o : [o], u = new Set(a);
240
+ c.value = c.value.filter((m) => !u.has(m[D.value]));
241
+ },
242
+ insertTableDataRecord: (o, a) => {
243
+ const u = [...c.value];
244
+ return a == null || a >= u.length ? u.push(o) : u.splice(a, 0, o), c.value = u, o;
245
+ },
246
+ getPaginationRef: () => j.value ? { page: x.value.page, pageSize: Number(x.value.pageSize) || 10, total: x.value.total } : !1,
247
+ getShowPagination: () => j.value,
248
+ setShowPagination: (o) => {
249
+ R.value = o;
250
+ },
251
+ getRowSelection: () => d.value.rowSelection,
252
+ expandAll: () => {
253
+ var m;
254
+ const o = ((m = d.value.treeProps) == null ? void 0 : m.children) ?? "children", a = (F) => {
255
+ const S = [];
256
+ return F.forEach(($) => {
257
+ S.push($);
258
+ const I = $[o];
259
+ Array.isArray(I) && I.length > 0 && S.push(...a(I));
260
+ }), S;
261
+ };
262
+ a(c.value).forEach((F) => {
263
+ var S, $;
264
+ return ($ = (S = z.value) == null ? void 0 : S.toggleRowExpansion) == null ? void 0 : $.call(S, F, !0);
265
+ });
266
+ },
267
+ collapseAll: () => {
268
+ var m;
269
+ const o = ((m = d.value.treeProps) == null ? void 0 : m.children) ?? "children", a = (F) => {
270
+ const S = [];
271
+ return F.forEach(($) => {
272
+ S.push($);
273
+ const I = $[o];
274
+ Array.isArray(I) && I.length > 0 && S.push(...a(I));
275
+ }), S;
276
+ };
277
+ a(c.value).forEach((F) => {
278
+ var S, $;
279
+ return ($ = (S = z.value) == null ? void 0 : S.toggleRowExpansion) == null ? void 0 : $.call(S, F, !1);
280
+ });
281
+ }
282
+ };
283
+ e(N);
284
+ const G = () => {
285
+ k.value = [...t.columns ?? []];
286
+ }, Pe = () => {
287
+ t.api && d.value.immediate !== !1 ? q(void 0) : t.dataSource && (c.value = [...t.dataSource], !t.api && t.pagination !== !1 && (x.value.total = t.dataSource.length));
288
+ }, le = () => {
289
+ s.value && (v.value = s.value.offsetWidth || 0);
290
+ };
291
+ let U = null, X = null;
292
+ return xe(() => {
293
+ G(), l("register", N), Pe(), typeof window < "u" && (window.addEventListener("resize", le), U = new ResizeObserver(le), $e(() => {
294
+ le(), X = s.value, X && (U == null || U.observe(X));
295
+ }));
296
+ }), Re(() => {
297
+ typeof window < "u" && (window.removeEventListener("resize", le), U && X && (U.unobserve(X), X = null));
298
+ }), ae(() => t.columns, G, { deep: !0 }), ae(() => t.dataSource, () => {
299
+ !t.api && t.dataSource && (c.value = [...t.dataSource]);
300
+ }, { deep: !0 }), ae(() => t.loading, (o) => {
301
+ h.value = o ?? !1;
302
+ }), { __sfc: !0, DefaultCellRenderer: n, BodyCellRenderer: i, props: t, emit: l, slots: P, tableRef: z, tableWrapRef: s, containerWidth: v, loading: h, innerData: c, rawDataSource: b, innerColumns: k, innerProps: p, selectedRows: y, showPaginationRef: R, pagination: x, getComponentSetting: f, effectiveProps: d, showTitleBar: O, showPagination: j, rowKeyField: D, selectedKeysSet: H, displayColumns: ee, fixedColumnsWidth: re, isRatioWidth: L, totalRatio: J, fixedDataColumnsWidth: Q, parseWidthPx: W, getColumnWidth: ie, shouldShowColumn: Y, selectableRows: V, hasSelectableRows: ce, isAllCurrentPageSelected: ue, isIndeterminate: de, isRowSelected: fe, getCheckboxDisabled: pe, getRadioDisabled: me, emitSelectionChange: K, handleCheckboxChange: ve, handleRadioSelect: he, handleSelectAll: te, fetchData: q, handleReload: oe, handleSizeChange: r, handleCurrentChange: g, handleRowClick: C, handleRowDblclick: w, handleSortChange: _, handleExpandChange: T, findRowIndex: E, tableAction: N, syncColumns: G, loadData: Pe, updateContainerWidth: le, resizeObserver: U, observedEl: X };
303
+ }
304
+ });
305
+ function se(A, e, l, t, n, i, P, z) {
306
+ var s = typeof A == "function" ? A.options : A;
307
+ e && (s.render = e, s.staticRenderFns = l, s._compiled = !0), t && (s.functional = !0), i && (s._scopeId = "data-v-" + i);
308
+ var v;
309
+ if (P ? (v = function(b) {
310
+ b = b || // cached call
311
+ this.$vnode && this.$vnode.ssrContext || // stateful
312
+ this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !b && typeof __VUE_SSR_CONTEXT__ < "u" && (b = __VUE_SSR_CONTEXT__), n && n.call(this, b), b && b._registeredComponents && b._registeredComponents.add(P);
313
+ }, s._ssrRegister = v) : n && (v = z ? function() {
314
+ n.call(
315
+ this,
316
+ (s.functional ? this.parent : this).$root.$options.shadowRoot
317
+ );
318
+ } : n), v)
319
+ if (s.functional) {
320
+ s._injectStyles = v;
321
+ var h = s.render;
322
+ s.render = function(k, p) {
323
+ return v.call(p), h(k, p);
324
+ };
325
+ } else {
326
+ var c = s.beforeCreate;
327
+ s.beforeCreate = c ? [].concat(c, v) : [v];
328
+ }
329
+ return {
330
+ exports: A,
331
+ options: s
332
+ };
333
+ }
334
+ var Ie = function() {
335
+ var n, i, P, z;
336
+ var e = this, l = e._self._c, t = e._self._setupProxy;
337
+ return l("div", { staticClass: "ecp-pro-table" }, [t.showTitleBar ? l("div", { staticClass: "ecp-pro-table__header" }, [l("div", { staticClass: "ecp-pro-table__title-wrapper" }, [l("span", { staticClass: "ecp-pro-table__title" }, [e._v(e._s(t.effectiveProps.title))]), t.effectiveProps.titleHelpMessage ? l("el-tooltip", { staticClass: "ecp-pro-table__help", attrs: { placement: "top" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.titleHelpMessage) ? l("span", e._l(t.effectiveProps.titleHelpMessage, function(s, v) {
338
+ return l("div", { key: v }, [e._v(e._s(s))]);
339
+ }), 0) : l("span", [e._v(e._s(t.effectiveProps.titleHelpMessage))])]), l("i", { staticClass: "el-icon-question" })], 2) : e._e()], 1), l("div", { staticClass: "ecp-pro-table__toolbar" }, [e._t("tableTitle"), e._t("toolbar"), e._t("toolbar-right", function() {
340
+ var s;
341
+ return [((s = t.effectiveProps.tableSetting) == null ? void 0 : s.redo) !== !1 ? l("el-button", { attrs: { type: "text", icon: "el-icon-refresh", size: "small" }, on: { click: t.handleReload } }, [e._v(" 刷新 ")]) : e._e()];
342
+ })], 2)]) : e._e(), l("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], ref: "tableWrapRef", staticClass: "ecp-pro-table__body" }, [l("el-table", e._b({ ref: "tableRef", attrs: { data: t.innerData, "row-key": t.effectiveProps.rowKey, border: t.effectiveProps.bordered, stripe: t.effectiveProps.striped, size: t.effectiveProps.size, "max-height": t.effectiveProps.maxHeight, height: t.effectiveProps.height, "default-sort": t.effectiveProps.defaultSort, "span-method": t.effectiveProps.spanMethod, "tree-props": t.effectiveProps.treeProps, "default-expand-all": t.effectiveProps.defaultExpandAll, "expand-row-keys": t.effectiveProps.expandRowKeys || [], lazy: t.effectiveProps.lazy, load: t.effectiveProps.load, "row-class-name": t.effectiveProps.rowClassName }, on: { "row-click": t.handleRowClick, "row-dblclick": t.handleRowDblclick, "sort-change": t.handleSortChange, "expand-change": t.handleExpandChange } }, "el-table", t.effectiveProps.tableProps, !1), [t.effectiveProps.rowSelection ? l("el-table-column", { attrs: { width: t.effectiveProps.rowSelection.width || 48, fixed: t.effectiveProps.rowSelection.fixed, align: "center" }, scopedSlots: e._u([{ key: "header", fn: function(s) {
343
+ return [t.effectiveProps.rowSelection.type !== "radio" ? l("el-checkbox", { attrs: { value: t.isAllCurrentPageSelected, indeterminate: t.isIndeterminate, disabled: !t.hasSelectableRows }, on: { change: t.handleSelectAll } }) : l("span")];
344
+ } }, { key: "default", fn: function(s) {
345
+ var v;
346
+ return [t.effectiveProps.rowSelection.type !== "radio" ? l("el-checkbox", { attrs: { value: t.isRowSelected(s.row), disabled: t.getCheckboxDisabled(s.row) }, on: { change: (h) => t.handleCheckboxChange(s.row, h) }, nativeOn: { click: function(h) {
347
+ h.stopPropagation();
348
+ } } }) : l("el-radio", { attrs: { value: (v = t.selectedRows[0]) == null ? void 0 : v[t.rowKeyField], label: s.row[t.rowKeyField], disabled: t.getRadioDisabled(s.row) }, on: { change: function(h) {
349
+ return t.handleRadioSelect(s.row);
350
+ } }, nativeOn: { click: function(h) {
351
+ h.stopPropagation();
352
+ } } }, [l("span")])];
353
+ } }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? l("el-table-column", { attrs: { type: "index", label: ((n = t.effectiveProps.indexColumnProps) == null ? void 0 : n.title) || "序号", width: ((i = t.effectiveProps.indexColumnProps) == null ? void 0 : i.width) || 60, fixed: (P = t.effectiveProps.indexColumnProps) == null ? void 0 : P.fixed, align: ((z = t.effectiveProps.indexColumnProps) == null ? void 0 : z.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(s) {
354
+ return [t.shouldShowColumn(s) ? l("el-table-column", { key: s.dataIndex || s.key || s.title, attrs: { prop: s.dataIndex, label: s.title, width: t.getColumnWidth(s), "min-width": t.isRatioWidth(s.width) ? void 0 : s.minWidth, fixed: s.fixed, align: s.align || "left", sortable: s.sortable, formatter: s.formatter, "show-overflow-tooltip": s.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(v) {
355
+ return [s.dataIndex && e.$scopedSlots[`header-${s.dataIndex}`] ? e._t(`header-${s.dataIndex}`, null, { column: s }) : e.$scopedSlots.headerCell ? e._t("headerCell", null, { column: s }) : [l("span", [e._v(e._s(s.title))]), s.helpMessage ? l("el-tooltip", { staticClass: "ecp-pro-table__col-help", attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(s.helpMessage) ? l("span", e._l(s.helpMessage, function(h, c) {
356
+ return l("div", { key: c }, [e._v(e._s(h))]);
357
+ }), 0) : l("span", [e._v(e._s(s.helpMessage))])]), l("i", { staticClass: "el-icon-question" })], 2) : e._e()]];
358
+ } }, { key: "default", fn: function(v) {
359
+ return [s.dataIndex && e.$scopedSlots[s.dataIndex] ? e._t(s.dataIndex, null, { row: v.row, column: s, index: v.$index, value: v.row[s.dataIndex] }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: s, record: v.row, index: v.$index, value: v.row[s.dataIndex], "custom-render": s.customRender, "value-enum": s.valueEnum } }) : l(t.DefaultCellRenderer, { attrs: { column: s, record: v.row, index: v.$index, value: v.row[s.dataIndex] } })];
360
+ } }], null, !0) }) : e._e()];
361
+ }), t.effectiveProps.actionColumn ? l("el-table-column", { attrs: { label: t.effectiveProps.actionColumn.title || "操作", width: t.effectiveProps.actionColumn.width || 150, fixed: t.effectiveProps.actionColumn.fixed || "right", align: t.effectiveProps.actionColumn.align || "center" }, scopedSlots: e._u([{ key: "default", fn: function(s) {
362
+ return [e.$scopedSlots.action ? e._t("action", null, { record: s.row, column: t.effectiveProps.actionColumn, index: s.$index }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: s.row, index: s.$index, value: void 0, "custom-render": t.effectiveProps.actionColumn.customRender, "value-enum": t.effectiveProps.actionColumn.valueEnum } }) : e._e()];
363
+ } }], null, !0) }) : e._e()], 2)], 1), t.showPagination ? l("div", { staticClass: "ecp-pro-table__pagination" }, [l("el-pagination", e._b({ attrs: { "current-page": t.pagination.page, "page-sizes": t.pagination.pageSizes, "page-size": t.pagination.pageSize, total: t.pagination.total, layout: (t.effectiveProps.pagination && typeof t.effectiveProps.pagination == "object" ? t.effectiveProps.pagination.layout : null) || "total, sizes, prev, pager, next, jumper" }, on: { "size-change": t.handleSizeChange, "current-change": t.handleCurrentChange } }, "el-pagination", t.effectiveProps.pagination && typeof t.effectiveProps.pagination == "object" && t.effectiveProps.pagination.props || {}, !1))], 1) : e._e()]);
364
+ }, Oe = [], Le = /* @__PURE__ */ se(
365
+ Ee,
366
+ Ie,
367
+ Oe,
368
+ !1,
369
+ null,
370
+ "c5638c20",
371
+ null,
372
+ null
373
+ );
374
+ const Be = Le.exports, We = /* @__PURE__ */ Z({
375
+ __name: "TableAction",
376
+ props: {
377
+ actions: { default: () => [] },
378
+ dropDownActions: { default: () => [] },
379
+ stopButtonPropagation: { type: Boolean, default: !1 }
380
+ },
381
+ setup(A) {
382
+ const e = A, l = (h) => h ? typeof h == "string" ? { content: h } : h : {}, t = (h) => h.type ? h.type : h.color === "error" ? "danger" : h.color === "success" ? "success" : h.color === "warning" ? "warning" : "text", n = (h) => h.filter((c) => {
383
+ const { ifShow: b } = c;
384
+ return typeof b == "boolean" ? b : typeof b == "function" ? b(c) : !0;
385
+ }), i = B(() => n(e.actions || [])), P = B(() => n(e.dropDownActions || []));
386
+ return { __sfc: !0, props: e, normalizeTooltip: l, getButtonType: t, filterVisible: n, visibleActions: i, visibleDropDownActions: P, handleClick: (h, c) => {
387
+ var b;
388
+ e.stopButtonPropagation && c.stopPropagation(), (b = h.onClick) == null || b.call(h, c);
389
+ }, handlePopConfirm: (h, c, b) => {
390
+ var k, p, y, R;
391
+ e.stopButtonPropagation && b.stopPropagation(), h.popConfirm && (c === "confirm" ? (p = (k = h.popConfirm).confirm) == null || p.call(k) : (R = (y = h.popConfirm).cancel) == null || R.call(y));
392
+ }, handleDropdownCommand: (h) => {
393
+ var k;
394
+ const c = Number(h), b = P.value[c];
395
+ if (!(!b || b.disabled)) {
396
+ if (b.popConfirm) {
397
+ const p = b.popConfirm.title, y = b.popConfirm.okText || "确定", R = b.popConfirm.cancelText || "取消";
398
+ ze.confirm(p, "提示", {
399
+ confirmButtonText: y,
400
+ cancelButtonText: R,
401
+ type: "warning"
402
+ }).then(() => {
403
+ var x, f;
404
+ return (f = (x = b.popConfirm) == null ? void 0 : x.confirm) == null ? void 0 : f.call(x);
405
+ }).catch(() => {
406
+ var x, f;
407
+ return (f = (x = b.popConfirm) == null ? void 0 : x.cancel) == null ? void 0 : f.call(x);
408
+ });
409
+ return;
410
+ }
411
+ (k = b.onClick) == null || k.call(b, {});
412
+ }
413
+ } };
414
+ }
415
+ });
416
+ var Ve = function() {
417
+ var e = this, l = e._self._c, t = e._self._setupProxy;
418
+ return l("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(n, i) {
419
+ return l("span", { key: `action-${i}`, staticClass: "ecp-table-action__item" }, [n.popConfirm ? l("el-popconfirm", { attrs: { title: n.popConfirm.title, "confirm-button-text": n.popConfirm.okText || "确定", "cancel-button-text": n.popConfirm.cancelText || "取消" }, on: { confirm: (P) => t.handlePopConfirm(n, "confirm", P), cancel: (P) => t.handlePopConfirm(n, "cancel", P) } }, [l("span", { attrs: { slot: "reference" }, slot: "reference" }, [l(n.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", n.tooltip ? t.normalizeTooltip(n.tooltip) : {}, !1), [l("el-button", e._b({ attrs: { type: t.getButtonType(n), size: "small", disabled: n.disabled }, on: { click: (P) => t.handleClick(n, P) } }, "el-button", n.props, !1), [n.icon ? l("i", { class: ["ecp-table-action__icon", n.icon] }) : e._e(), l("span", [e._v(e._s(n.label))])])], 1)], 1)]) : l(n.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", n.tooltip ? t.normalizeTooltip(n.tooltip) : {}, !1), [l("el-button", e._b({ attrs: { type: t.getButtonType(n), size: "small", disabled: n.disabled }, on: { click: (P) => t.handleClick(n, P) } }, "el-button", n.props, !1), [n.icon ? l("i", { class: ["ecp-table-action__icon", n.icon] }) : e._e(), l("span", [e._v(e._s(n.label))])])], 1), n.divider ? l("el-divider", { attrs: { direction: "vertical" } }) : e._e()], 1);
420
+ }), t.visibleDropDownActions.length ? l("el-dropdown", { attrs: { trigger: "click" }, on: { command: t.handleDropdownCommand } }, [l("span", { staticClass: "ecp-table-action__more" }, [l("el-button", { attrs: { type: "text", size: "small" } }, [e._v(" 更多"), l("i", { staticClass: "el-icon-arrow-down el-icon--right" })])], 1), l("el-dropdown-menu", { attrs: { slot: "dropdown" }, slot: "dropdown" }, e._l(t.visibleDropDownActions, function(n, i) {
421
+ return l("el-dropdown-item", { key: `dropdown-${i}`, attrs: { command: i, disabled: n.disabled, divided: !!n.divider } }, [l("span", { staticClass: "ecp-table-action__dropdown-item" }, [n.icon ? l("i", { class: ["ecp-table-action__icon", n.icon] }) : e._e(), l("span", [e._v(e._s(n.label))])])]);
422
+ }), 1)], 1) : e._e()], 2);
423
+ }, Ke = [], qe = /* @__PURE__ */ se(
424
+ We,
425
+ Ve,
426
+ Ke,
427
+ !1,
428
+ null,
429
+ "1b2d6c42",
430
+ null,
431
+ null
432
+ );
433
+ const Ae = qe.exports;
434
+ function st(A) {
435
+ const e = M(null), l = () => {
436
+ const i = we(e);
437
+ if (!i)
438
+ throw new Error("ProTable instance has not been registered");
439
+ return i;
440
+ };
441
+ return [(i) => {
442
+ e.value = i;
443
+ }, {
444
+ setProps: (i) => l().setProps(i),
445
+ reload: (i) => l().reload(i),
446
+ setLoading: (i) => l().setLoading(i),
447
+ getDataSource: () => l().getDataSource(),
448
+ getRawDataSource: () => l().getRawDataSource(),
449
+ setTableData: (i) => l().setTableData(i),
450
+ getColumns: () => l().getColumns(),
451
+ setColumns: (i) => l().setColumns(i),
452
+ setPagination: (i) => l().setPagination(i),
453
+ getSelectRowKeys: () => l().getSelectRowKeys(),
454
+ getSelectRows: () => l().getSelectRows(),
455
+ clearSelectedRowKeys: () => l().clearSelectedRowKeys(),
456
+ setSelectedRowKeys: (i) => l().setSelectedRowKeys(i),
457
+ deleteSelectRowByKey: (i) => l().deleteSelectRowByKey(i),
458
+ updateTableDataRecord: (i, P) => l().updateTableDataRecord(i, P),
459
+ deleteTableDataRecord: (i) => l().deleteTableDataRecord(i),
460
+ insertTableDataRecord: (i, P) => l().insertTableDataRecord(i, P),
461
+ getPaginationRef: () => l().getPaginationRef(),
462
+ getShowPagination: () => l().getShowPagination(),
463
+ setShowPagination: (i) => l().setShowPagination(i),
464
+ expandAll: () => {
465
+ var i, P;
466
+ return (P = (i = l()).expandAll) == null ? void 0 : P.call(i);
467
+ },
468
+ collapseAll: () => {
469
+ var i, P;
470
+ return (P = (i = l()).collapseAll) == null ? void 0 : P.call(i);
471
+ }
472
+ }];
473
+ }
474
+ const Ne = /* @__PURE__ */ Z({
3
475
  __name: "ProFormItem",
4
476
  props: {
5
477
  schema: null,
@@ -8,125 +480,96 @@ const de = /* @__PURE__ */ W({
8
480
  autoPlaceholder: { type: Boolean },
9
481
  formActionType: null
10
482
  },
11
- setup(_) {
12
- const e = _, l = te(), t = w(() => ({
483
+ setup(A) {
484
+ const e = A, l = ye(), t = B(() => ({
13
485
  schema: e.schema,
14
486
  values: e.formModel,
15
487
  model: e.formModel,
16
488
  field: e.schema.field
17
- })), s = w(() => {
18
- const c = e.schema.ifShow;
19
- return c === void 0 ? !0 : typeof c == "boolean" ? c : c(t.value);
20
- }), b = w(() => {
21
- const c = e.schema.show;
22
- return c === void 0 ? !0 : typeof c == "boolean" ? c : c(t.value);
23
- }), P = w(() => {
489
+ })), n = B(() => {
490
+ const p = e.schema.ifShow;
491
+ return p === void 0 ? !0 : typeof p == "boolean" ? p : p(t.value);
492
+ }), i = B(() => {
493
+ const p = e.schema.show;
494
+ return p === void 0 ? !0 : typeof p == "boolean" ? p : p(t.value);
495
+ }), P = B(() => {
24
496
  if (e.formDisabled)
25
497
  return !0;
26
- const c = e.schema.dynamicDisabled;
27
- return c === void 0 ? !1 : typeof c == "boolean" ? c : c(t.value);
28
- }), C = w(() => {
29
- const c = e.schema.dynamicRules;
30
- return c ? Array.isArray(c) ? c : c(t.value) : e.schema.rules;
31
- }), p = w(() => {
32
- const c = e.schema.componentProps;
33
- if (!c)
498
+ const p = e.schema.dynamicDisabled;
499
+ return p === void 0 ? !1 : typeof p == "boolean" ? p : p(t.value);
500
+ }), z = B(() => {
501
+ const p = e.schema.dynamicRules;
502
+ return p ? Array.isArray(p) ? p : p(t.value) : e.schema.rules;
503
+ }), s = B(() => {
504
+ const p = e.schema.componentProps;
505
+ if (!p)
34
506
  return { props: {}, listeners: {} };
35
- const d = typeof c == "function" ? c({
507
+ const y = typeof p == "function" ? p({
36
508
  ...t.value,
37
509
  formActionType: e.formActionType
38
- }) : { ...c }, R = {}, S = {};
39
- for (const [n, u] of Object.entries(d))
40
- if (n.length > 2 && /^on[A-Za-z]/.test(n) && typeof u == "function") {
41
- const x = n.slice(2).charAt(0).toLowerCase() + n.slice(3);
42
- S[x] = u;
510
+ }) : { ...p }, R = {}, x = {};
511
+ for (const [f, d] of Object.entries(y))
512
+ if (f.length > 2 && /^on[A-Za-z]/.test(f) && typeof d == "function") {
513
+ const O = f.slice(2).charAt(0).toLowerCase() + f.slice(3);
514
+ x[O] = d;
43
515
  } else
44
- R[n] = u;
45
- return { props: R, listeners: S };
46
- }), m = w(() => p.value.props), M = w(() => p.value.listeners), v = w(() => !!l.default), y = (c) => {
47
- const d = c == null ? void 0 : c.options;
48
- return Array.isArray(d) ? d : void 0;
49
- }, F = w(() => {
50
- const c = e.schema.render;
51
- return c ? {
516
+ R[f] = d;
517
+ return { props: R, listeners: x };
518
+ }), v = B(() => s.value.props), h = B(() => s.value.listeners), c = B(() => !!l.default), b = (p) => {
519
+ const y = p == null ? void 0 : p.options;
520
+ return Array.isArray(y) ? y : void 0;
521
+ }, k = B(() => {
522
+ const p = e.schema.render;
523
+ return p ? {
52
524
  render() {
53
- const d = c(t.value);
54
- return Array.isArray(d) ? ce("span", d) : d;
525
+ const y = p(t.value);
526
+ return Array.isArray(y) ? ne("span", y) : y;
55
527
  }
56
528
  } : null;
57
529
  });
58
- return { __sfc: !0, props: e, slots: l, renderParams: t, shouldRender: s, shouldShow: b, effectiveDisabled: P, effectiveRules: C, effectiveComponentPropsAndListeners: p, effectiveComponentProps: m, effectiveComponentListeners: M, hasSlot: v, getOptions: y, renderComponent: F };
530
+ return { __sfc: !0, props: e, slots: l, renderParams: t, shouldRender: n, shouldShow: i, effectiveDisabled: P, effectiveRules: z, effectiveComponentPropsAndListeners: s, effectiveComponentProps: v, effectiveComponentListeners: h, hasSlot: c, getOptions: b, renderComponent: k };
59
531
  }
60
532
  });
61
- function z(_, e, l, t, s, b, P, C) {
62
- var p = typeof _ == "function" ? _.options : _;
63
- e && (p.render = e, p.staticRenderFns = l, p._compiled = !0), t && (p.functional = !0), b && (p._scopeId = "data-v-" + b);
64
- var m;
65
- if (P ? (m = function(y) {
66
- y = y || // cached call
67
- this.$vnode && this.$vnode.ssrContext || // stateful
68
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !y && typeof __VUE_SSR_CONTEXT__ < "u" && (y = __VUE_SSR_CONTEXT__), s && s.call(this, y), y && y._registeredComponents && y._registeredComponents.add(P);
69
- }, p._ssrRegister = m) : s && (m = C ? function() {
70
- s.call(
71
- this,
72
- (p.functional ? this.parent : this).$root.$options.shadowRoot
73
- );
74
- } : s), m)
75
- if (p.functional) {
76
- p._injectStyles = m;
77
- var M = p.render;
78
- p.render = function(F, c) {
79
- return m.call(c), M(F, c);
80
- };
81
- } else {
82
- var v = p.beforeCreate;
83
- p.beforeCreate = v ? [].concat(v, m) : [m];
84
- }
85
- return {
86
- exports: _,
87
- options: p
88
- };
89
- }
90
- var me = function() {
533
+ var je = function() {
91
534
  var e = this, l = e._self._c, t = e._self._setupProxy;
92
- return t.shouldRender ? l("el-form-item", { directives: [{ name: "show", rawName: "v-show", value: t.shouldShow, expression: "shouldShow" }], attrs: { prop: e.schema.field, required: e.schema.required, rules: t.effectiveRules } }, [l("template", { slot: "label" }, [l("span", [e._v(e._s(e.schema.label))]), e.schema.helpMessage ? l("el-tooltip", e._b({ attrs: { placement: "top", effect: "light" } }, "el-tooltip", e.schema.helpComponentProps || {}, !1), [l("template", { slot: "content" }, [Array.isArray(e.schema.helpMessage) ? e._l(e.schema.helpMessage, function(s, b) {
93
- return l("div", { key: b, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(s) + " ")]);
94
- }) : l("span", [e._v(e._s(e.schema.helpMessage))])], 2), l("i", { staticClass: "el-icon-question ecp-pro-form-item__help-icon" })], 2) : e._e()], 1), e.schema.render ? [l(t.renderComponent, { tag: "component" })] : t.hasSlot ? e._t("default", null, { model: e.formModel, schema: e.schema, field: e.schema.field, values: e.formModel }) : [e.schema.component === "input" || !e.schema.component ? l("el-input", e._g(e._b({ attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请输入${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(s) {
95
- e.$set(e.formModel, e.schema.field, s);
96
- }, expression: "formModel[schema.field]" } }, "el-input", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "input-number" ? l("el-input-number", e._g(e._b({ attrs: { placeholder: e.schema.placeholder, disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(s) {
97
- e.$set(e.formModel, e.schema.field, s);
98
- }, expression: "formModel[schema.field]" } }, "el-input-number", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "select" ? l("el-select", e._g(e._b({ staticClass: "ecp-pro-form-item__select", attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(s) {
99
- e.$set(e.formModel, e.schema.field, s);
100
- }, expression: "formModel[schema.field]" } }, "el-select", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(s) {
101
- return l("el-option", { key: String(s.value), attrs: { label: s.label, value: s.value } });
102
- }), 1) : e.schema.component === "date-picker" ? l("el-date-picker", e._g(e._b({ attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(s) {
103
- e.$set(e.formModel, e.schema.field, s);
104
- }, expression: "formModel[schema.field]" } }, "el-date-picker", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "date-range" ? l("el-date-picker", e._g(e._b({ attrs: { type: "daterange", "range-separator": "至", "start-placeholder": "开始日期", "end-placeholder": "结束日期", "value-format": "yyyy-MM-dd", disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(s) {
105
- e.$set(e.formModel, e.schema.field, s);
106
- }, expression: "formModel[schema.field]" } }, "el-date-picker", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "switch" ? l("el-switch", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(s) {
107
- e.$set(e.formModel, e.schema.field, s);
108
- }, expression: "formModel[schema.field]" } }, "el-switch", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "cascader" ? l("el-cascader", e._g(e._b({ attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(s) {
109
- e.$set(e.formModel, e.schema.field, s);
110
- }, expression: "formModel[schema.field]" } }, "el-cascader", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "checkbox" ? l("el-checkbox-group", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(s) {
111
- e.$set(e.formModel, e.schema.field, s);
112
- }, expression: "formModel[schema.field]" } }, "el-checkbox-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(s) {
113
- return l("el-checkbox", { key: String(s.value), attrs: { label: s.value } }, [e._v(" " + e._s(s.label) + " ")]);
114
- }), 1) : e.schema.component === "radio" ? l("el-radio-group", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(s) {
115
- e.$set(e.formModel, e.schema.field, s);
116
- }, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(s) {
117
- return l("el-radio", { key: String(s.value), attrs: { label: s.value } }, [e._v(" " + e._s(s.label) + " ")]);
535
+ return t.shouldRender ? l("el-form-item", { directives: [{ name: "show", rawName: "v-show", value: t.shouldShow, expression: "shouldShow" }], attrs: { prop: e.schema.field, required: e.schema.required, rules: t.effectiveRules } }, [l("template", { slot: "label" }, [l("span", [e._v(e._s(e.schema.label))]), e.schema.helpMessage ? l("el-tooltip", e._b({ attrs: { placement: "top", effect: "light" } }, "el-tooltip", e.schema.helpComponentProps || {}, !1), [l("template", { slot: "content" }, [Array.isArray(e.schema.helpMessage) ? e._l(e.schema.helpMessage, function(n, i) {
536
+ return l("div", { key: i, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(n) + " ")]);
537
+ }) : l("span", [e._v(e._s(e.schema.helpMessage))])], 2), l("i", { staticClass: "el-icon-question ecp-pro-form-item__help-icon" })], 2) : e._e()], 1), e.schema.render ? [l(t.renderComponent, { tag: "component" })] : t.hasSlot ? e._t("default", null, { model: e.formModel, schema: e.schema, field: e.schema.field, values: e.formModel }) : [e.schema.component === "input" || !e.schema.component ? l("el-input", e._g(e._b({ attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请输入${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
538
+ e.$set(e.formModel, e.schema.field, n);
539
+ }, expression: "formModel[schema.field]" } }, "el-input", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "input-number" ? l("el-input-number", e._g(e._b({ attrs: { placeholder: e.schema.placeholder, disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
540
+ e.$set(e.formModel, e.schema.field, n);
541
+ }, expression: "formModel[schema.field]" } }, "el-input-number", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "select" ? l("el-select", e._g(e._b({ staticClass: "ecp-pro-form-item__select", attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
542
+ e.$set(e.formModel, e.schema.field, n);
543
+ }, expression: "formModel[schema.field]" } }, "el-select", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(n) {
544
+ return l("el-option", { key: String(n.value), attrs: { label: n.label, value: n.value } });
545
+ }), 1) : e.schema.component === "date-picker" ? l("el-date-picker", e._g(e._b({ attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
546
+ e.$set(e.formModel, e.schema.field, n);
547
+ }, expression: "formModel[schema.field]" } }, "el-date-picker", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "date-range" ? l("el-date-picker", e._g(e._b({ attrs: { type: "daterange", "range-separator": "至", "start-placeholder": "开始日期", "end-placeholder": "结束日期", "value-format": "yyyy-MM-dd", disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
548
+ e.$set(e.formModel, e.schema.field, n);
549
+ }, expression: "formModel[schema.field]" } }, "el-date-picker", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "switch" ? l("el-switch", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
550
+ e.$set(e.formModel, e.schema.field, n);
551
+ }, expression: "formModel[schema.field]" } }, "el-switch", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "cascader" ? l("el-cascader", e._g(e._b({ attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
552
+ e.$set(e.formModel, e.schema.field, n);
553
+ }, expression: "formModel[schema.field]" } }, "el-cascader", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "checkbox" ? l("el-checkbox-group", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
554
+ e.$set(e.formModel, e.schema.field, n);
555
+ }, expression: "formModel[schema.field]" } }, "el-checkbox-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(n) {
556
+ return l("el-checkbox", { key: String(n.value), attrs: { label: n.value } }, [e._v(" " + e._s(n.label) + " ")]);
557
+ }), 1) : e.schema.component === "radio" ? l("el-radio-group", e._g(e._b({ attrs: { disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(n) {
558
+ e.$set(e.formModel, e.schema.field, n);
559
+ }, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(n) {
560
+ return l("el-radio", { key: String(n.value), attrs: { label: n.value } }, [e._v(" " + e._s(n.label) + " ")]);
118
561
  }), 1) : e._e()]], 2) : e._e();
119
- }, pe = [], ve = /* @__PURE__ */ z(
120
- de,
121
- me,
122
- pe,
562
+ }, He = [], Ge = /* @__PURE__ */ se(
563
+ Ne,
564
+ je,
565
+ He,
123
566
  !1,
124
567
  null,
125
568
  "cfc968c5",
126
569
  null,
127
570
  null
128
571
  );
129
- const se = ve.exports, he = /* @__PURE__ */ W({
572
+ const ke = Ge.exports, Ue = /* @__PURE__ */ Z({
130
573
  __name: "FormActions",
131
574
  props: {
132
575
  showActionButtonGroup: { type: Boolean, default: !0 },
@@ -143,28 +586,28 @@ const se = ve.exports, he = /* @__PURE__ */ W({
143
586
  actionColOptions: null
144
587
  },
145
588
  emits: ["submit", "reset", "toggle"],
146
- setup(_) {
589
+ setup(A) {
147
590
  return { __sfc: !0 };
148
591
  }
149
592
  });
150
- var _e = function() {
593
+ var Xe = function() {
151
594
  var e = this, l = e._self._c;
152
595
  return e._self._setupProxy, l("div", { staticClass: "ecp-form-actions" }, [e._t("submitBefore"), e.showSubmitButton ? l("el-button", { attrs: { type: "primary", icon: e.submitButtonIcon, loading: e.submitLoading }, on: { click: function(t) {
153
596
  return e.$emit("submit");
154
597
  } } }, [e._v(" " + e._s(e.submitButtonText) + " ")]) : e._e(), e._t("resetBefore"), e.showResetButton ? l("el-button", { attrs: { icon: e.resetButtonIcon }, on: { click: function(t) {
155
598
  return e.$emit("reset");
156
599
  } } }, [e._v(" " + e._s(e.resetButtonText) + " ")]) : e._e(), e._t("actions")], 2);
157
- }, be = [], ye = /* @__PURE__ */ z(
158
- he,
159
- _e,
160
- be,
600
+ }, Ze = [], Je = /* @__PURE__ */ se(
601
+ Ue,
602
+ Xe,
603
+ Ze,
161
604
  !1,
162
605
  null,
163
606
  "489c88d2",
164
607
  null,
165
608
  null
166
609
  );
167
- const le = ye.exports, we = /* @__PURE__ */ W({
610
+ const Te = Je.exports, Qe = /* @__PURE__ */ Z({
168
611
  __name: "ProForm",
169
612
  props: {
170
613
  schemas: null,
@@ -194,251 +637,253 @@ const le = ye.exports, we = /* @__PURE__ */ W({
194
637
  formListeners: null
195
638
  },
196
639
  emits: ["submit", "reset", "register"],
197
- setup(_, { expose: e, emit: l }) {
198
- const t = _, s = te(), b = g(), P = g(), C = g(!1), p = g(!0), m = g({}), M = g({}), v = g([]), y = g({}), F = { xl: 1920, lg: 1200, md: 992, sm: 768 }, c = (o, a, f) => {
199
- const i = f ?? (typeof window < "u" ? window.innerWidth : 1920), r = o ?? {}, h = a ?? {}, B = h.span ?? 8;
200
- return i >= F.xl ? r.xl ?? h.xl ?? r.lg ?? h.lg ?? r.md ?? h.md ?? r.sm ?? h.sm ?? r.xs ?? h.xs ?? r.span ?? B : i >= F.lg ? r.lg ?? h.lg ?? r.md ?? h.md ?? r.sm ?? h.sm ?? r.xs ?? h.xs ?? r.span ?? B : i >= F.md ? r.md ?? h.md ?? r.sm ?? h.sm ?? r.xs ?? h.xs ?? r.span ?? B : i >= F.sm ? r.sm ?? h.sm ?? r.xs ?? h.xs ?? r.span ?? B : r.xs ?? h.xs ?? r.span ?? B;
201
- }, d = w(() => ({ ...t, ...y.value })), R = w(() => d.value.actionColOptions ?? { span: 24 }), S = g(typeof window < "u" ? window.innerWidth : 1920), n = (o, a, f, i) => {
202
- let r = 24, h = 1, B = 0;
203
- for (const $ of o) {
204
- const D = c($.colProps, a, i);
205
- if (D > r) {
206
- if (h++, h > f)
640
+ setup(A, { expose: e, emit: l }) {
641
+ const t = A, n = ye(), i = M(), P = M(), z = M(!1), s = M(!0), v = M({}), h = M({}), c = M([]), b = M({}), k = { xl: 1920, lg: 1200, md: 992, sm: 768 }, p = (r, g, C) => {
642
+ const w = C ?? (typeof window < "u" ? window.innerWidth : 1920), _ = r ?? {}, T = g ?? {}, E = T.span ?? 8;
643
+ return w >= k.xl ? _.xl ?? T.xl ?? _.lg ?? T.lg ?? _.md ?? T.md ?? _.sm ?? T.sm ?? _.xs ?? T.xs ?? _.span ?? E : w >= k.lg ? _.lg ?? T.lg ?? _.md ?? T.md ?? _.sm ?? T.sm ?? _.xs ?? T.xs ?? _.span ?? E : w >= k.md ? _.md ?? T.md ?? _.sm ?? T.sm ?? _.xs ?? T.xs ?? _.span ?? E : w >= k.sm ? _.sm ?? T.sm ?? _.xs ?? T.xs ?? _.span ?? E : _.xs ?? T.xs ?? _.span ?? E;
644
+ }, { getSetting: y } = Fe(), R = B(() => ({ ...y("ProForm"), ...t, ...b.value })), x = B(() => R.value.actionColOptions ?? { span: 24 }), f = M(typeof window < "u" ? window.innerWidth : 1920), d = (r, g, C, w) => {
645
+ let _ = 24, T = 1, E = 0;
646
+ for (const N of r) {
647
+ const G = p(N.colProps, g, w);
648
+ if (G > _) {
649
+ if (T++, T > C)
207
650
  break;
208
- r = 24 - D;
651
+ _ = 24 - G;
209
652
  } else
210
- r -= D;
211
- B++;
653
+ _ -= G;
654
+ E++;
212
655
  }
213
- return B;
214
- }, u = w(() => {
215
- const o = v.value.filter((r) => T(r));
216
- if (!d.value.showAdvancedButton)
656
+ return E;
657
+ }, O = B(() => {
658
+ const r = c.value.filter((_) => H(_));
659
+ if (!R.value.showAdvancedButton)
217
660
  return !1;
218
- const a = d.value.alwaysShowLines ?? 1, f = d.value.baseColProps, i = n(o, f, a, S.value);
219
- return console.log(o.length, i), o.length > i;
220
- }), x = w(() => d.value.formListeners ?? {}), k = w(() => {
221
- const o = v.value.filter((r) => T(r));
222
- if (!d.value.showAdvancedButton || !p.value)
223
- return o;
224
- const a = d.value.alwaysShowLines ?? 1, f = d.value.baseColProps, i = n(o, f, a, S.value);
225
- return o.slice(0, i);
226
- }), T = (o) => {
227
- let a = !0, f = !0;
228
- return typeof o.ifShow == "function" && (a = o.ifShow({ schema: o, values: m.value, model: m.value, field: o.field })), typeof o.ifShow == "boolean" && (a = o.ifShow), typeof o.show == "function" && (f = o.show({ schema: o, values: m.value, model: m.value, field: o.field })), typeof o.show == "boolean" && (f = o.show), a && f;
229
- }, ae = (o) => o.colProps ?? d.value.baseColProps ?? {}, re = (o) => o.slot || o.field, A = () => {
230
- const o = {}, a = {}, f = d.value.initialValues ?? t.initialValues;
231
- v.value.forEach((i) => {
232
- var r;
233
- o[i.field] = i.defaultValue ?? (f == null ? void 0 : f[i.field]), (r = i.rules) != null && r.length && (a[i.field] = i.rules);
234
- }), m.value = { ...m.value, ...o }, M.value = a;
235
- }, N = (o) => {
236
- const a = { ...o };
237
- return v.value.forEach((f) => {
238
- const i = f.ifShow;
239
- if (i === void 0)
661
+ const g = R.value.alwaysShowLines ?? 1, C = R.value.baseColProps, w = d(r, C, g, f.value);
662
+ return console.log(r.length, w), r.length > w;
663
+ }), j = B(() => R.value.formListeners ?? {}), D = B(() => {
664
+ const r = c.value.filter((_) => H(_));
665
+ if (!R.value.showAdvancedButton || !s.value)
666
+ return r;
667
+ const g = R.value.alwaysShowLines ?? 1, C = R.value.baseColProps, w = d(r, C, g, f.value);
668
+ return r.slice(0, w);
669
+ }), H = (r) => {
670
+ let g = !0, C = !0;
671
+ return typeof r.ifShow == "function" && (g = r.ifShow({ schema: r, values: v.value, model: v.value, field: r.field })), typeof r.ifShow == "boolean" && (g = r.ifShow), typeof r.show == "function" && (C = r.show({ schema: r, values: v.value, model: v.value, field: r.field })), typeof r.show == "boolean" && (C = r.show), g && C;
672
+ }, ee = (r) => r.colProps ?? R.value.baseColProps ?? {}, re = (r) => r.slot || r.field, L = () => {
673
+ const r = {}, g = {}, C = R.value.initialValues ?? t.initialValues;
674
+ c.value.forEach((w) => {
675
+ var _;
676
+ r[w.field] = w.defaultValue ?? (C == null ? void 0 : C[w.field]), (_ = w.rules) != null && _.length && (g[w.field] = w.rules);
677
+ }), v.value = { ...v.value, ...r }, h.value = g;
678
+ }, J = (r) => {
679
+ const g = { ...r };
680
+ return c.value.forEach((C) => {
681
+ const w = C.ifShow;
682
+ if (w === void 0)
240
683
  return;
241
- (typeof i == "boolean" ? i : i({ schema: f, values: o, model: o, field: f.field })) || delete a[f.field];
242
- }), a;
243
- }, V = (o) => {
244
- const a = N(o), f = y.value.fieldMapToTime;
245
- if (!(f != null && f.length))
246
- return a;
247
- const i = { ...a };
248
- return f.forEach(([r, [h, B]]) => {
249
- const $ = i[r];
250
- Array.isArray($) && $.length === 2 && (delete i[r], i[h] = $[0], i[B] = $[1]);
251
- }), i;
252
- }, L = async () => {
253
- var o;
684
+ (typeof w == "boolean" ? w : w({ schema: C, values: r, model: r, field: C.field })) || delete g[C.field];
685
+ }), g;
686
+ }, Q = (r) => {
687
+ const g = J(r), C = b.value.fieldMapToTime;
688
+ if (!(C != null && C.length))
689
+ return g;
690
+ const w = { ...g };
691
+ return C.forEach(([_, [T, E]]) => {
692
+ const N = w[_];
693
+ Array.isArray(N) && N.length === 2 && (delete w[_], w[T] = N[0], w[E] = N[1]);
694
+ }), w;
695
+ }, W = async () => {
696
+ var r;
254
697
  try {
255
- await ((o = b.value) == null ? void 0 : o.validate()), d.value.submitFunc ? await d.value.submitFunc() : (C.value = !0, l("submit", V({ ...m.value })));
256
- } catch (a) {
257
- console.error("Form validation failed:", a);
698
+ await ((r = i.value) == null ? void 0 : r.validate()), R.value.submitFunc ? await R.value.submitFunc() : (z.value = !0, l("submit", Q({ ...v.value })));
699
+ } catch (g) {
700
+ console.error("Form validation failed:", g);
258
701
  } finally {
259
- C.value = !1;
702
+ z.value = !1;
260
703
  }
261
704
  }, ie = async () => {
262
- var o;
263
- d.value.resetFunc ? await d.value.resetFunc() : ((o = b.value) == null || o.resetFields(), A(), l("reset"), d.value.submitOnReset && await L());
264
- }, q = (o) => (m.value = { ...m.value, ...o }, Promise.resolve()), G = () => V({ ...m.value }), U = async () => {
265
- var o;
266
- (o = b.value) == null || o.resetFields(), A();
267
- }, X = (o) => {
268
- var a;
269
- return ((a = b.value) == null ? void 0 : a.validate(o)) ?? Promise.resolve();
270
- }, H = (o) => b.value ? o != null && o.length ? Promise.all(o.map((a) => new Promise((f, i) => {
271
- b.value.validateField(a, (r) => r ? f(void 0) : i(new Error("Validation failed")));
272
- }))) : b.value.validate() : Promise.resolve(), K = async (o, a) => {
273
- var i;
274
- const f = (i = P.value) == null ? void 0 : i.querySelector(`[data-field="${o}"]`);
275
- return f && f.scrollIntoView({ behavior: (a == null ? void 0 : a.behavior) ?? "smooth", block: (a == null ? void 0 : a.block) ?? "nearest" }), Promise.resolve();
276
- }, Z = (o) => {
277
- var a;
278
- (a = b.value) == null || a.clearValidate(o);
279
- }, j = async (o) => {
280
- (Array.isArray(o) ? o : [o]).forEach((f) => {
281
- const i = v.value.findIndex((r) => r.field === f.field);
282
- i >= 0 && (v.value[i] = { ...v.value[i], ...f });
705
+ var r;
706
+ R.value.resetFunc ? await R.value.resetFunc() : ((r = i.value) == null || r.resetFields(), L(), l("reset"), R.value.submitOnReset && await W());
707
+ }, Y = (r) => (v.value = { ...v.value, ...r }, Promise.resolve()), V = () => Q({ ...v.value }), ce = async () => {
708
+ var r;
709
+ (r = i.value) == null || r.resetFields(), L();
710
+ }, ue = (r) => {
711
+ var g;
712
+ return ((g = i.value) == null ? void 0 : g.validate(r)) ?? Promise.resolve();
713
+ }, de = (r) => i.value ? r != null && r.length ? Promise.all(r.map((g) => new Promise((C, w) => {
714
+ i.value.validateField(g, (_) => _ ? C(void 0) : w(new Error("Validation failed")));
715
+ }))) : i.value.validate() : Promise.resolve(), fe = async (r, g) => {
716
+ var w;
717
+ const C = (w = P.value) == null ? void 0 : w.querySelector(`[data-field="${r}"]`);
718
+ return C && C.scrollIntoView({ behavior: (g == null ? void 0 : g.behavior) ?? "smooth", block: (g == null ? void 0 : g.block) ?? "nearest" }), Promise.resolve();
719
+ }, pe = (r) => {
720
+ var g;
721
+ (g = i.value) == null || g.clearValidate(r);
722
+ }, me = async (r) => {
723
+ (Array.isArray(r) ? r : [r]).forEach((C) => {
724
+ const w = c.value.findIndex((_) => _.field === C.field);
725
+ w >= 0 && (c.value[w] = { ...c.value[w], ...C });
283
726
  });
284
- }, J = async (o, a, f) => {
285
- if (f)
286
- v.value.unshift(o);
287
- else if (a) {
288
- const i = v.value.findIndex((r) => r.field === a);
289
- v.value.splice(i + 1, 0, o);
727
+ }, K = async (r, g, C) => {
728
+ if (C)
729
+ c.value.unshift(r);
730
+ else if (g) {
731
+ const w = c.value.findIndex((_) => _.field === g);
732
+ c.value.splice(w + 1, 0, r);
290
733
  } else
291
- v.value.push(o);
292
- A();
293
- }, Q = async (o) => {
294
- const a = Array.isArray(o) ? o : [o];
295
- v.value = v.value.filter((f) => !a.includes(f.field));
296
- }, Y = async (o) => {
297
- if (y.value = { ...y.value, ...o }, o.schemas) {
298
- v.value = [...o.schemas];
734
+ c.value.push(r);
735
+ L();
736
+ }, ve = async (r) => {
737
+ const g = Array.isArray(r) ? r : [r];
738
+ c.value = c.value.filter((C) => !g.includes(C.field));
739
+ }, he = async (r) => {
740
+ if (b.value = { ...b.value, ...r }, r.schemas) {
741
+ c.value = [...r.schemas];
299
742
  debugger;
300
- A();
743
+ L();
301
744
  }
302
- }, I = {
303
- getFieldsValue: G,
304
- setFieldsValue: q,
305
- resetFields: U,
306
- validate: X,
307
- validateFields: H,
308
- submit: L,
309
- scrollToField: K,
310
- clearValidate: Z,
311
- updateSchema: j,
312
- appendSchemaByField: J,
313
- removeSchemaByField: Q,
314
- setProps: Y
745
+ }, te = {
746
+ getFieldsValue: V,
747
+ setFieldsValue: Y,
748
+ resetFields: ce,
749
+ validate: ue,
750
+ validateFields: de,
751
+ submit: W,
752
+ scrollToField: fe,
753
+ clearValidate: pe,
754
+ updateSchema: me,
755
+ appendSchemaByField: K,
756
+ removeSchemaByField: ve,
757
+ setProps: he
315
758
  };
316
- e(I);
317
- const O = () => {
318
- v.value = [...t.schemas ?? []], A();
319
- }, E = () => {
320
- typeof window < "u" && (S.value = window.innerWidth);
759
+ e(te);
760
+ const q = () => {
761
+ c.value = [...t.schemas ?? []], L();
762
+ }, oe = () => {
763
+ typeof window < "u" && (f.value = window.innerWidth);
321
764
  };
322
- return fe(() => {
323
- O(), l("register", I), typeof window < "u" && window.addEventListener("resize", E);
324
- }), ue(() => {
325
- typeof window < "u" && window.removeEventListener("resize", E);
326
- }), oe(() => [t.schemas, t.initialValues], O, { deep: !0 }), { __sfc: !0, props: t, emit: l, slots: s, formRef: b, formWrapRef: P, submitLoading: C, collapsed: p, formModel: m, formRules: M, innerSchemas: v, innerProps: y, BREAKPOINTS: F, getEffectiveSpan: c, effectiveProps: d, effectiveActionColOptions: R, windowWidth: S, getVisibleSchemaCount: n, hasMoreFields: u, formListeners: x, displaySchemas: k, shouldShow: T, getColProps: ae, getSlotName: re, initForm: A, filterByIfShow: N, processFieldMapToTime: V, handleSubmit: L, handleReset: ie, setFieldsValue: q, getFieldsValue: G, resetFields: U, validate: X, validateFields: H, scrollToField: K, clearValidate: Z, updateSchema: j, appendSchemaByField: J, removeSchemaByField: Q, setProps: Y, formActionRef: I, syncSchemas: O, handleResize: E, ProFormItem: se, FormActions: le };
765
+ return xe(() => {
766
+ q(), l("register", te), typeof window < "u" && window.addEventListener("resize", oe);
767
+ }), Re(() => {
768
+ typeof window < "u" && window.removeEventListener("resize", oe);
769
+ }), ae(() => [t.schemas, t.initialValues], q, { deep: !0 }), { __sfc: !0, props: t, emit: l, slots: n, formRef: i, formWrapRef: P, submitLoading: z, collapsed: s, formModel: v, formRules: h, innerSchemas: c, innerProps: b, BREAKPOINTS: k, getEffectiveSpan: p, getComponentSetting: y, effectiveProps: R, effectiveActionColOptions: x, windowWidth: f, getVisibleSchemaCount: d, hasMoreFields: O, formListeners: j, displaySchemas: D, shouldShow: H, getColProps: ee, getSlotName: re, initForm: L, filterByIfShow: J, processFieldMapToTime: Q, handleSubmit: W, handleReset: ie, setFieldsValue: Y, getFieldsValue: V, resetFields: ce, validate: ue, validateFields: de, scrollToField: fe, clearValidate: pe, updateSchema: me, appendSchemaByField: K, removeSchemaByField: ve, setProps: he, formActionRef: te, syncSchemas: q, handleResize: oe, ProFormItem: ke, FormActions: Te };
327
770
  }
328
771
  });
329
- var Pe = function() {
772
+ var Ye = function() {
330
773
  var e = this, l = e._self._c, t = e._self._setupProxy;
331
- return l("div", { ref: "formWrapRef", staticClass: "ecp-pro-form" }, [l("el-form", e._g(e._b({ ref: "formRef", staticClass: "ecp-pro-form", attrs: { model: t.formModel, rules: t.formRules, "label-width": t.effectiveProps.labelWidth, "label-position": t.effectiveProps.labelPosition, size: t.effectiveProps.size, disabled: t.effectiveProps.disabled } }, "el-form", e.$attrs, !1), t.formListeners), [e._t("formHeader"), l("el-row", { style: t.effectiveProps.baseRowStyle, attrs: { gutter: t.effectiveProps.gutter } }, [e._l(t.displaySchemas, function(s) {
332
- var b, P;
333
- return [t.shouldShow(s) ? l("el-col", e._b({ key: s.field, attrs: { offset: ((b = s.colProps) == null ? void 0 : b.offset) ?? ((P = t.effectiveProps.baseColProps) == null ? void 0 : P.offset) ?? 0, "data-field": s.field } }, "el-col", t.getColProps(s), !1), [l(t.ProFormItem, { attrs: { schema: s, "form-model": t.formModel, "form-disabled": t.effectiveProps.disabled, "auto-placeholder": t.effectiveProps.autoSetPlaceholder, "form-action-type": t.formActionRef } }, [t.slots[t.getSlotName(s)] ? [e._t(t.getSlotName(s), null, { model: t.formModel, schema: s, field: s.field, values: t.formModel })] : e._e()], 2)], 1) : e._e()];
334
- }), t.effectiveProps.showActionButtonGroup ? l("el-col", e._b({ staticClass: "ecp-pro-form_col" }, "el-col", t.hasMoreFields ? { span: 24 } : t.effectiveProps.actionColOptions || { span: 6 }, !1), [l(t.FormActions, { attrs: { "show-action-button-group": t.effectiveProps.showActionButtonGroup, "show-submit-button": t.effectiveProps.showSubmitButton, "show-reset-button": t.effectiveProps.showResetButton, "submit-button-text": t.effectiveProps.submitButtonText, "reset-button-text": t.effectiveProps.resetButtonText, "submit-button-icon": t.effectiveProps.submitButtonIcon, "reset-button-icon": t.effectiveProps.resetButtonIcon, "submit-loading": t.submitLoading, "show-advanced-button": t.effectiveProps.showAdvancedButton, "has-more-fields": t.hasMoreFields, collapsed: t.collapsed, "action-col-options": t.effectiveActionColOptions }, on: { submit: t.handleSubmit, reset: t.handleReset, toggle: function(s) {
774
+ return l("div", { ref: "formWrapRef", staticClass: "ecp-pro-form" }, [l("el-form", e._g(e._b({ ref: "formRef", staticClass: "ecp-pro-form", attrs: { model: t.formModel, rules: t.formRules, "label-width": t.effectiveProps.labelWidth, "label-position": t.effectiveProps.labelPosition, size: t.effectiveProps.size, disabled: t.effectiveProps.disabled } }, "el-form", e.$attrs, !1), t.formListeners), [e._t("formHeader"), l("el-row", { style: t.effectiveProps.baseRowStyle, attrs: { gutter: t.effectiveProps.gutter } }, [e._l(t.displaySchemas, function(n) {
775
+ var i, P;
776
+ return [t.shouldShow(n) ? l("el-col", e._b({ key: n.field, attrs: { offset: ((i = n.colProps) == null ? void 0 : i.offset) ?? ((P = t.effectiveProps.baseColProps) == null ? void 0 : P.offset) ?? 0, "data-field": n.field } }, "el-col", t.getColProps(n), !1), [l(t.ProFormItem, { attrs: { schema: n, "form-model": t.formModel, "form-disabled": t.effectiveProps.disabled, "auto-placeholder": t.effectiveProps.autoSetPlaceholder, "form-action-type": t.formActionRef } }, [t.slots[t.getSlotName(n)] ? [e._t(t.getSlotName(n), null, { model: t.formModel, schema: n, field: n.field, values: t.formModel })] : e._e()], 2)], 1) : e._e()];
777
+ }), t.effectiveProps.showActionButtonGroup ? l("el-col", e._b({ staticClass: "ecp-pro-form_col" }, "el-col", t.hasMoreFields ? { span: 24 } : t.effectiveProps.actionColOptions || { span: 6 }, !1), [l(t.FormActions, { attrs: { "show-action-button-group": t.effectiveProps.showActionButtonGroup, "show-submit-button": t.effectiveProps.showSubmitButton, "show-reset-button": t.effectiveProps.showResetButton, "submit-button-text": t.effectiveProps.submitButtonText, "reset-button-text": t.effectiveProps.resetButtonText, "submit-button-icon": t.effectiveProps.submitButtonIcon, "reset-button-icon": t.effectiveProps.resetButtonIcon, "submit-loading": t.submitLoading, "show-advanced-button": t.effectiveProps.showAdvancedButton, "has-more-fields": t.hasMoreFields, collapsed: t.collapsed, "action-col-options": t.effectiveActionColOptions }, on: { submit: t.handleSubmit, reset: t.handleReset, toggle: function(n) {
335
778
  t.collapsed = !t.collapsed;
336
- } } }, [l("template", { slot: "submitBefore" }, [e._t("submitBefore")], 2), l("template", { slot: "resetBefore" }, [e._t("resetBefore")], 2), l("template", { slot: "advanceBefore" }, [e._t("advanceBefore")], 2), l("template", { slot: "advanceAfter" }, [e._t("advanceAfter")], 2), l("template", { slot: "actions" }, [e._t("actions")], 2)], 2)], 1) : e._e()], 2), t.effectiveProps.showAdvancedButton && t.hasMoreFields ? l("el-button", { staticClass: "ecp-form-actions__advance", attrs: { type: "text" }, on: { click: function(s) {
779
+ } } }, [l("template", { slot: "submitBefore" }, [e._t("submitBefore")], 2), l("template", { slot: "resetBefore" }, [e._t("resetBefore")], 2), l("template", { slot: "advanceBefore" }, [e._t("advanceBefore")], 2), l("template", { slot: "advanceAfter" }, [e._t("advanceAfter")], 2), l("template", { slot: "actions" }, [e._t("actions")], 2)], 2)], 1) : e._e()], 2), t.effectiveProps.showAdvancedButton && t.hasMoreFields ? l("el-button", { staticClass: "ecp-form-actions__advance", attrs: { type: "text" }, on: { click: function(n) {
337
780
  t.collapsed = !t.collapsed;
338
781
  } } }, [l("i", { staticClass: "el-icon-d-arrow-left", class: t.collapsed ? "down" : "up" }), e._v(" " + e._s(t.collapsed ? "展开" : "收起") + " ")]) : e._e(), e._t("formFooter")], 2)], 1);
339
- }, ge = [], Fe = /* @__PURE__ */ z(
340
- we,
341
- Pe,
342
- ge,
782
+ }, et = [], tt = /* @__PURE__ */ se(
783
+ Qe,
784
+ Ye,
785
+ et,
343
786
  !1,
344
787
  null,
345
- "af9453ad",
788
+ "140fc052",
346
789
  null,
347
790
  null
348
791
  );
349
- const ne = Fe.exports;
350
- function xe(_) {
351
- const e = g(null), l = g(_ ? ee(_) : void 0), t = () => _ ? ee(_) : void 0, s = (n) => {
352
- e.value = n;
353
- const u = t();
792
+ const Me = tt.exports;
793
+ function rt(A) {
794
+ const e = M(null), l = M(A ? we(A) : void 0), t = () => A ? we(A) : void 0, n = (f) => {
795
+ e.value = f;
796
+ const d = t();
354
797
  debugger;
355
- u && Object.keys(u).length > 0 && n.setProps(u);
798
+ d && Object.keys(d).length > 0 && f.setProps(d);
356
799
  };
357
- return _ && oe(
800
+ return A && ae(
358
801
  () => t(),
359
- (n) => {
360
- l.value = n, n && e.value && e.value.setProps(n);
802
+ (f) => {
803
+ l.value = f, f && e.value && e.value.setProps(f);
361
804
  },
362
805
  { deep: !0 }
363
- ), [s, {
364
- register: s,
806
+ ), [n, {
807
+ register: n,
365
808
  formAction: e,
366
809
  getFieldsValue: () => {
367
- var n;
368
- return ((n = e.value) == null ? void 0 : n.getFieldsValue()) ?? {};
810
+ var f;
811
+ return ((f = e.value) == null ? void 0 : f.getFieldsValue()) ?? {};
369
812
  },
370
- setFieldsValue: async (n) => {
371
- var u;
372
- await ((u = e.value) == null ? void 0 : u.setFieldsValue(n));
813
+ setFieldsValue: async (f) => {
814
+ var d;
815
+ await ((d = e.value) == null ? void 0 : d.setFieldsValue(f));
373
816
  },
374
817
  resetFields: async () => {
375
- var n;
376
- await ((n = e.value) == null ? void 0 : n.resetFields());
818
+ var f;
819
+ await ((f = e.value) == null ? void 0 : f.resetFields());
377
820
  },
378
- validate: (n) => {
379
- var u;
380
- return ((u = e.value) == null ? void 0 : u.validate(n)) ?? Promise.resolve();
821
+ validate: (f) => {
822
+ var d;
823
+ return ((d = e.value) == null ? void 0 : d.validate(f)) ?? Promise.resolve();
381
824
  },
382
- validateFields: (n) => {
383
- var u;
384
- return ((u = e.value) == null ? void 0 : u.validateFields(n)) ?? Promise.resolve();
825
+ validateFields: (f) => {
826
+ var d;
827
+ return ((d = e.value) == null ? void 0 : d.validateFields(f)) ?? Promise.resolve();
385
828
  },
386
829
  submit: () => {
387
- var n;
388
- return ((n = e.value) == null ? void 0 : n.submit()) ?? Promise.resolve();
830
+ var f;
831
+ return ((f = e.value) == null ? void 0 : f.submit()) ?? Promise.resolve();
389
832
  },
390
- scrollToField: (n, u) => {
391
- var x;
392
- return ((x = e.value) == null ? void 0 : x.scrollToField(n, u)) ?? Promise.resolve();
833
+ scrollToField: (f, d) => {
834
+ var O;
835
+ return ((O = e.value) == null ? void 0 : O.scrollToField(f, d)) ?? Promise.resolve();
393
836
  },
394
- clearValidate: (n) => {
395
- var u;
396
- (u = e.value) == null || u.clearValidate(n);
837
+ clearValidate: (f) => {
838
+ var d;
839
+ (d = e.value) == null || d.clearValidate(f);
397
840
  },
398
- updateSchema: (n) => {
399
- var u;
400
- return ((u = e.value) == null ? void 0 : u.updateSchema(n)) ?? Promise.resolve();
841
+ updateSchema: (f) => {
842
+ var d;
843
+ return ((d = e.value) == null ? void 0 : d.updateSchema(f)) ?? Promise.resolve();
401
844
  },
402
- appendSchemaByField: (n, u, x) => {
403
- var k;
404
- return ((k = e.value) == null ? void 0 : k.appendSchemaByField(n, u, x)) ?? Promise.resolve();
845
+ appendSchemaByField: (f, d, O) => {
846
+ var j;
847
+ return ((j = e.value) == null ? void 0 : j.appendSchemaByField(f, d, O)) ?? Promise.resolve();
405
848
  },
406
- removeSchemaByField: (n) => {
407
- var u;
408
- return ((u = e.value) == null ? void 0 : u.removeSchemaByField(n)) ?? Promise.resolve();
849
+ removeSchemaByField: (f) => {
850
+ var d;
851
+ return ((d = e.value) == null ? void 0 : d.removeSchemaByField(f)) ?? Promise.resolve();
409
852
  },
410
- setProps: async (n) => {
411
- var u;
412
- l.value = { ...l.value, ...n }, await ((u = e.value) == null ? void 0 : u.setProps(n));
853
+ setProps: async (f) => {
854
+ var d;
855
+ l.value = { ...l.value, ...f }, await ((d = e.value) == null ? void 0 : d.setProps(f));
413
856
  }
414
857
  }];
415
858
  }
416
- const Be = [
417
- // { name: 'ProTable', component: ProTable },
418
- { name: "ProForm", component: ne },
419
- { name: "ProFormItem", component: se },
420
- { name: "FormActions", component: le }
421
- // { name: 'ProCard', component: ProCard },
422
- // { name: 'ProDescriptions', component: ProDescriptions },
859
+ const ot = [
860
+ { name: "ProTable", component: Be },
861
+ { name: "TableAction", component: Ae },
862
+ { name: "ProForm", component: Me },
863
+ { name: "ProFormItem", component: ke },
864
+ { name: "FormActions", component: Te }
423
865
  ];
424
- function Ce(_) {
425
- Be.forEach(({ name: e, component: l }) => {
426
- _.component(e, l);
866
+ function lt(A) {
867
+ ot.forEach(({ name: e, component: l }) => {
868
+ A.component(e, l);
427
869
  });
428
870
  }
429
- const Me = {
430
- install: Ce,
431
- // ProTable,
432
- ProForm: ne
433
- // ProCard,
434
- // ProDescriptions,
871
+ const it = {
872
+ install: lt,
873
+ ProTable: Be,
874
+ ProForm: Me,
875
+ TableAction: Ae
435
876
  };
436
877
  export {
437
- le as FormActions,
438
- ne as ProForm,
439
- se as ProFormItem,
440
- Me as default,
441
- Ce as install,
442
- xe as useForm
878
+ Te as FormActions,
879
+ Me as ProForm,
880
+ ke as ProFormItem,
881
+ Be as ProTable,
882
+ Ae as TableAction,
883
+ it as default,
884
+ lt as install,
885
+ Fe as useComponentSetting,
886
+ rt as useForm,
887
+ st as useProTable
443
888
  };
444
889
  //# sourceMappingURL=element-component-pro.es.js.map