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

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,16 +1,16 @@
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";
1
+ import { reactive as $e, defineComponent as ee, h as ce, useSlots as Ce, ref as A, computed as B, onMounted as we, nextTick as Fe, onUnmounted as Re, watch as U, unref as ye } from "vue";
2
2
  import { MessageBox as ze } from "element-ui";
3
- const be = De({});
4
- function Fe() {
3
+ const ge = $e({});
4
+ function Be() {
5
5
  return {
6
- getSetting: (l) => l === void 0 ? { ...be } : { ...be[l] ?? {} },
6
+ getSetting: (l) => l === void 0 ? { ...ge } : { ...ge[l] ?? {} },
7
7
  setSetting: (l, t) => {
8
- const n = be[l];
9
- be[l] = n ? { ...n, ...t } : { ...t };
8
+ const a = ge[l];
9
+ ge[l] = a ? { ...a, ...t } : { ...t };
10
10
  }
11
11
  };
12
12
  }
13
- const Ee = /* @__PURE__ */ Z({
13
+ const Ee = /* @__PURE__ */ ee({
14
14
  __name: "ProTable",
15
15
  props: {
16
16
  columns: null,
@@ -54,8 +54,8 @@ const Ee = /* @__PURE__ */ Z({
54
54
  load: null
55
55
  },
56
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({
57
+ setup(F, { expose: e, emit: l }) {
58
+ const t = F, a = ee({
59
59
  name: "EcpProTableDefaultCellRenderer",
60
60
  props: {
61
61
  column: { type: Object, required: !0 },
@@ -65,20 +65,20 @@ const Ee = /* @__PURE__ */ Z({
65
65
  },
66
66
  setup(o) {
67
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;
68
+ var d, b;
69
+ const n = o.column;
70
+ if (n != null && n.customRender) {
71
+ const D = n.customRender({ text: o.value, record: o.record, index: o.index });
72
+ return typeof D == "string" || typeof D == "number" ? ce("span", String(D)) : D;
73
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));
74
+ if (n != null && n.valueEnum) {
75
+ const D = ((b = (d = n.valueEnum) == null ? void 0 : d[o.value]) == null ? void 0 : b.text) ?? o.value;
76
+ return ce("span", D == null ? "" : String(D));
77
77
  }
78
- return ne("span", o.value == null ? "" : String(o.value));
78
+ return ce("span", o.value == null ? "" : String(o.value));
79
79
  };
80
80
  }
81
- }), i = Z({
81
+ }), y = ee({
82
82
  name: "EcpProTableBodyCellRenderer",
83
83
  props: {
84
84
  slotRender: { type: Function, required: !0 },
@@ -91,72 +91,72 @@ const Ee = /* @__PURE__ */ Z({
91
91
  },
92
92
  setup(o) {
93
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 } });
94
+ const n = o.slotRender, d = n == null ? void 0 : n({ column: o.column, record: o.record, index: o.index, value: o.value });
95
+ if (((L) => L == null ? [] : Array.isArray(L) ? L.filter((G) => G != null && G !== !1 && !G.isComment) : [L])(d).length > 0)
96
+ return d;
97
+ const R = { ...o.column };
98
+ return o.customRender && (R.customRender = o.customRender), o.valueEnum && (R.valueEnum = o.valueEnum), ce(a, { props: { column: R, record: o.record, index: o.index, value: o.value } });
99
99
  };
100
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({
101
+ }), r = Ce(), C = A(), s = A(), v = A(0), h = A(t.loading ?? !1), c = A([]), m = A({}), k = A([]), z = A({}), x = A([]), T = A(null), u = A({
102
102
  page: 1,
103
103
  pageSize: t.pagination && typeof t.pagination == "object" ? t.pagination.pageSize ?? 10 : 10,
104
104
  pageSizes: t.pagination && typeof t.pagination == "object" ? t.pagination.pageSizes ?? [10, 20, 50, 100] : [10, 20, 50, 100],
105
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(
106
+ }), { getSetting: f } = Be(), p = B(() => ({ ...f("ProTable"), ...t, ...z.value })), O = B(() => !!p.value.title || !!r.tableTitle || !!r.toolbar), K = B(() => T.value !== null ? T.value : !!t.pagination && typeof t.pagination == "object"), M = B(() => p.value.rowKey || "id"), N = B(() => new Set(x.value.map((o) => o[M.value]))), g = B(
107
107
  () => k.value.filter((o) => !o.hideInTable && !o.defaultHidden)
108
- ), re = B(() => {
109
- var a, u;
108
+ ), E = B(() => {
109
+ var n, d;
110
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;
111
+ return p.value.rowSelection && (o += Number(p.value.rowSelection.width) || 48), p.value.showIndexColumn && (o += Number((n = p.value.indexColumnProps) == null ? void 0 : n.width) || 60), p.value.actionColumn && (o += Number((d = p.value.actionColumn) == null ? void 0 : d.width) || 150), o;
112
+ }), I = (o) => typeof o == "number" && o > 0, W = B(() => g.value.filter((n) => Y(n) && I(n.width)).reduce((n, d) => n + (typeof d.width == "number" ? d.width : 0), 0)), X = B(() => g.value.filter((n) => Y(n) && typeof n.width == "string").reduce((n, d) => n + (Number(q(d)) || 80), 0)), V = (o) => o == null ? null : typeof o == "number" ? o : parseInt(String(o).replace(/px$/i, ""), 10) || null, q = (o) => {
113
+ const n = o.width;
114
+ if (I(n) && W.value > 0 && v.value > 0 && typeof n == "number") {
115
+ const d = v.value - E.value - X.value;
116
+ let b = Math.floor(d * n / W.value);
117
+ const D = V(o.minWidth) ?? 60, R = V(o.maxWidth);
118
+ return b = Math.max(D, b), R != null && (b = Math.min(R, b)), b;
119
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;
120
+ if (typeof n == "string") {
121
+ const d = V(n) ?? 80, b = V(o.minWidth), D = V(o.maxWidth);
122
+ let R = d;
123
+ return b != null && (R = Math.max(b, R)), D != null && (R = Math.min(D, R)), R;
124
124
  }
125
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);
126
+ }, Y = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, j = B(() => {
127
+ var n;
128
+ const o = (n = p.value.rowSelection) == null ? void 0 : n.getCheckboxProps;
129
+ return o ? c.value.filter((d) => {
130
+ var b;
131
+ return !((b = o(d)) != null && b.disabled);
132
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();
133
+ }), te = B(() => j.value.length > 0), ue = B(() => j.value.length === 0 ? !1 : j.value.every((o) => N.value.has(o[M.value]))), de = B(() => {
134
+ const o = j.value.filter((n) => N.value.has(n[M.value])).length;
135
+ return o > 0 && o < j.value.length;
136
+ }), fe = (o) => N.value.has(o[M.value]), pe = (o) => {
137
+ var n, d, b;
138
+ return ((b = (d = (n = p.value.rowSelection) == null ? void 0 : n.getCheckboxProps) == null ? void 0 : d.call(n, o)) == null ? void 0 : b.disabled) ?? !1;
139
+ }, ve = (o) => {
140
+ var n, d, b;
141
+ return ((b = (d = (n = p.value.rowSelection) == null ? void 0 : n.getRadioProps) == null ? void 0 : d.call(n, o)) == null ? void 0 : b.disabled) ?? !1;
142
+ }, Z = () => {
143
+ const o = x.value.map((n) => n[M.value]);
144
+ l("selection-change", { keys: o, rows: x.value });
145
+ }, me = (o, n) => {
146
+ const d = o[M.value];
147
+ n ? x.value = [...x.value.filter((b) => b[M.value] !== d), o] : x.value = x.value.filter((b) => b[M.value] !== d), Z();
148
148
  }, he = (o) => {
149
- y.value = [o], K();
150
- }, te = (o) => {
149
+ x.value = [o], Z();
150
+ }, be = (o) => {
151
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];
152
+ const n = new Set(x.value.map((b) => b[M.value])), d = j.value.filter((b) => !n.has(b[M.value]));
153
+ x.value = [...x.value, ...d];
154
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]));
155
+ const n = new Set(c.value.map((d) => d[M.value]));
156
+ x.value = x.value.filter((d) => !n.has(d[M.value]));
157
157
  }
158
- K();
159
- }, q = async (o) => {
158
+ Z();
159
+ }, J = async (o) => {
160
160
  if (!t.api) {
161
161
  if (t.dataSource)
162
162
  return;
@@ -165,174 +165,174 @@ const Ee = /* @__PURE__ */ Z({
165
165
  }
166
166
  h.value = !0;
167
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,
168
+ const n = p.value.fetchSetting ?? {}, d = n.pageField ?? "page", b = n.sizeField ?? "pageSize", D = n.listField ?? "list", R = n.totalField ?? "total", L = {
169
+ [d]: (o == null ? void 0 : o.page) ?? u.value.page,
170
+ [b]: (o == null ? void 0 : o.pageSize) ?? u.value.pageSize,
171
171
  ...t.searchInfo,
172
172
  ...o == null ? void 0 : o.searchInfo
173
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);
174
+ (o == null ? void 0 : o.page) != null && (u.value.page = o.page), (o == null ? void 0 : o.pageSize) != null && (u.value.pageSize = o.pageSize);
175
+ const G = t.beforeFetch ? t.beforeFetch(L) : L, Pe = await t.api(G);
176
+ m.value = Pe || {};
177
+ const _e = t.afterFetch ? t.afterFetch(Pe) : Pe, Se = _e[D] ?? _e.items ?? _e.list ?? [], xe = _e[R] ?? 0;
178
+ c.value = Se, u.value.total = xe, l("fetch-success", { items: Se, total: xe });
179
+ } catch (n) {
180
+ l("fetch-error", n);
181
181
  } finally {
182
182
  h.value = !1;
183
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 = {
184
+ }, se = () => J(void 0), re = (o) => {
185
+ p.value.clearSelectOnPageChange && (x.value = []), u.value.pageSize = o, u.value.page = 1, J(void 0);
186
+ }, i = (o) => {
187
+ p.value.clearSelectOnPageChange && (x.value = []), u.value.page = o, J(void 0);
188
+ }, _ = (o, n, d) => l("row-click", o, d), S = (o, n, d) => l("row-dblclick", o, d), P = ({ prop: o, order: n }) => l("sort-change", { prop: o, order: n }), w = (o, n) => l("expand-change", o, n), $ = (o) => c.value.findIndex((n) => n[M.value] === o), H = {
189
189
  setProps: (o) => {
190
- p.value = { ...p.value, ...o };
190
+ z.value = { ...z.value, ...o };
191
191
  },
192
- reload: (o) => q(o),
192
+ reload: (o) => J(o),
193
193
  redoHeight: () => {
194
- var o, a;
195
- (a = (o = z.value) == null ? void 0 : o.doLayout) == null || a.call(o);
194
+ var o, n;
195
+ (n = (o = C.value) == null ? void 0 : o.doLayout) == null || n.call(o);
196
196
  },
197
197
  setLoading: (o) => {
198
198
  h.value = o;
199
199
  },
200
200
  getDataSource: () => c.value,
201
- getRawDataSource: () => b.value,
201
+ getRawDataSource: () => m.value,
202
202
  setTableData: (o) => {
203
203
  c.value = o ?? [];
204
204
  },
205
205
  getColumns: () => k.value,
206
206
  setColumns: (o) => {
207
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);
208
+ const n = o, d = (t.columns ?? []).filter((D) => n.includes(D.key ?? D.dataIndex)), b = n.map((D) => d.find((R) => (R.key ?? R.dataIndex) === D)).filter(Boolean);
209
+ b.length && (k.value = b);
210
210
  } else
211
211
  k.value = o ?? [];
212
212
  },
213
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);
214
+ o != null && o.page && (u.value.page = o.page), o != null && o.pageSize && (u.value.pageSize = o.pageSize), (o == null ? void 0 : o.total) !== void 0 && (u.value.total = o.total);
215
215
  },
216
- getSelectRowKeys: () => y.value.map((o) => o[D.value]),
217
- getSelectRows: () => y.value,
216
+ getSelectRowKeys: () => x.value.map((o) => o[M.value]),
217
+ getSelectRows: () => x.value,
218
218
  clearSelectedRowKeys: () => {
219
- y.value = [], K();
219
+ x.value = [], Z();
220
220
  },
221
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();
222
+ const n = new Set(o), d = c.value.filter((b) => n.has(b[M.value]));
223
+ o.forEach((b) => {
224
+ d.some((D) => D[M.value] === b) || d.push({ [M.value]: b });
225
+ }), x.value = d, Z();
226
226
  },
227
227
  deleteSelectRowByKey: (o) => {
228
- y.value = y.value.filter((a) => a[D.value] !== o), K();
228
+ x.value = x.value.filter((n) => n[M.value] !== o), Z();
229
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 });
230
+ updateTableData: (o, n, d) => {
231
+ o < 0 || o >= c.value.length || (c.value = [...c.value], c.value[o] = { ...c.value[o], [n]: d });
232
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];
233
+ updateTableDataRecord: (o, n) => {
234
+ const d = $(o);
235
+ if (!(d < 0))
236
+ return c.value = [...c.value], c.value[d] = { ...c.value[d], ...n }, c.value[d];
237
237
  },
238
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]));
239
+ const n = Array.isArray(o) ? o : [o], d = new Set(n);
240
+ c.value = c.value.filter((b) => !d.has(b[M.value]));
241
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;
242
+ insertTableDataRecord: (o, n) => {
243
+ const d = [...c.value];
244
+ return n == null || n >= d.length ? d.push(o) : d.splice(n, 0, o), c.value = d, o;
245
245
  },
246
- getPaginationRef: () => j.value ? { page: x.value.page, pageSize: Number(x.value.pageSize) || 10, total: x.value.total } : !1,
247
- getShowPagination: () => j.value,
246
+ getPaginationRef: () => K.value ? { page: u.value.page, pageSize: Number(u.value.pageSize) || 10, total: u.value.total } : !1,
247
+ getShowPagination: () => K.value,
248
248
  setShowPagination: (o) => {
249
- R.value = o;
249
+ T.value = o;
250
250
  },
251
- getRowSelection: () => d.value.rowSelection,
251
+ getRowSelection: () => p.value.rowSelection,
252
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;
253
+ var b;
254
+ const o = ((b = p.value.treeProps) == null ? void 0 : b.children) ?? "children", n = (D) => {
255
+ const R = [];
256
+ return D.forEach((L) => {
257
+ R.push(L);
258
+ const G = L[o];
259
+ Array.isArray(G) && G.length > 0 && R.push(...n(G));
260
+ }), R;
261
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);
262
+ n(c.value).forEach((D) => {
263
+ var R, L;
264
+ return (L = (R = C.value) == null ? void 0 : R.toggleRowExpansion) == null ? void 0 : L.call(R, D, !0);
265
265
  });
266
266
  },
267
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;
268
+ var b;
269
+ const o = ((b = p.value.treeProps) == null ? void 0 : b.children) ?? "children", n = (D) => {
270
+ const R = [];
271
+ return D.forEach((L) => {
272
+ R.push(L);
273
+ const G = L[o];
274
+ Array.isArray(G) && G.length > 0 && R.push(...n(G));
275
+ }), R;
276
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);
277
+ n(c.value).forEach((D) => {
278
+ var R, L;
279
+ return (L = (R = C.value) == null ? void 0 : R.toggleRowExpansion) == null ? void 0 : L.call(R, D, !1);
280
280
  });
281
281
  }
282
282
  };
283
- e(N);
284
- const G = () => {
283
+ e(H);
284
+ const Q = () => {
285
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 = () => {
286
+ }, ne = () => {
287
+ t.api && p.value.immediate !== !1 ? J(void 0) : t.dataSource && (c.value = [...t.dataSource], !t.api && t.pagination !== !1 && (u.value.total = t.dataSource.length));
288
+ }, ie = () => {
289
289
  s.value && (v.value = s.value.offsetWidth || 0);
290
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));
291
+ let le = null, oe = null;
292
+ return we(() => {
293
+ Q(), l("register", H), ne(), typeof window < "u" && (window.addEventListener("resize", ie), le = new ResizeObserver(ie), Fe(() => {
294
+ ie(), oe = s.value, oe && (le == null || le.observe(oe));
295
295
  }));
296
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, () => {
297
+ typeof window < "u" && (window.removeEventListener("resize", ie), le && oe && (le.unobserve(oe), oe = null));
298
+ }), U(() => t.columns, Q, { deep: !0 }), U(() => t.dataSource, () => {
299
299
  !t.api && t.dataSource && (c.value = [...t.dataSource]);
300
- }, { deep: !0 }), ae(() => t.loading, (o) => {
300
+ }, { deep: !0 }), U(() => t.loading, (o) => {
301
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 };
302
+ }), { __sfc: !0, DefaultCellRenderer: a, BodyCellRenderer: y, props: t, emit: l, slots: r, tableRef: C, tableWrapRef: s, containerWidth: v, loading: h, innerData: c, rawDataSource: m, innerColumns: k, innerProps: z, selectedRows: x, showPaginationRef: T, pagination: u, getComponentSetting: f, effectiveProps: p, showTitleBar: O, showPagination: K, rowKeyField: M, selectedKeysSet: N, displayColumns: g, fixedColumnsWidth: E, isRatioWidth: I, totalRatio: W, fixedDataColumnsWidth: X, parseWidthPx: V, getColumnWidth: q, shouldShowColumn: Y, selectableRows: j, hasSelectableRows: te, isAllCurrentPageSelected: ue, isIndeterminate: de, isRowSelected: fe, getCheckboxDisabled: pe, getRadioDisabled: ve, emitSelectionChange: Z, handleCheckboxChange: me, handleRadioSelect: he, handleSelectAll: be, fetchData: J, handleReload: se, handleSizeChange: re, handleCurrentChange: i, handleRowClick: _, handleRowDblclick: S, handleSortChange: P, handleExpandChange: w, findRowIndex: $, tableAction: H, syncColumns: Q, loadData: ne, updateContainerWidth: ie, resizeObserver: le, observedEl: oe };
303
303
  }
304
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);
305
+ function ae(F, e, l, t, a, y, r, C) {
306
+ var s = typeof F == "function" ? F.options : F;
307
+ e && (s.render = e, s.staticRenderFns = l, s._compiled = !0), t && (s.functional = !0), y && (s._scopeId = "data-v-" + y);
308
308
  var v;
309
- if (P ? (v = function(b) {
310
- b = b || // cached call
309
+ if (r ? (v = function(m) {
310
+ m = m || // cached call
311
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(
312
+ this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !m && typeof __VUE_SSR_CONTEXT__ < "u" && (m = __VUE_SSR_CONTEXT__), a && a.call(this, m), m && m._registeredComponents && m._registeredComponents.add(r);
313
+ }, s._ssrRegister = v) : a && (v = C ? function() {
314
+ a.call(
315
315
  this,
316
316
  (s.functional ? this.parent : this).$root.$options.shadowRoot
317
317
  );
318
- } : n), v)
318
+ } : a), v)
319
319
  if (s.functional) {
320
320
  s._injectStyles = v;
321
321
  var h = s.render;
322
- s.render = function(k, p) {
323
- return v.call(p), h(k, p);
322
+ s.render = function(k, z) {
323
+ return v.call(z), h(k, z);
324
324
  };
325
325
  } else {
326
326
  var c = s.beforeCreate;
327
327
  s.beforeCreate = c ? [].concat(c, v) : [v];
328
328
  }
329
329
  return {
330
- exports: A,
330
+ exports: F,
331
331
  options: s
332
332
  };
333
333
  }
334
334
  var Ie = function() {
335
- var n, i, P, z;
335
+ var a, y, r, C;
336
336
  var e = this, l = e._self._c, t = e._self._setupProxy;
337
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
338
  return l("div", { key: v }, [e._v(e._s(s))]);
@@ -350,7 +350,7 @@ var Ie = function() {
350
350
  } }, nativeOn: { click: function(h) {
351
351
  h.stopPropagation();
352
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) {
353
+ } }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? l("el-table-column", { attrs: { type: "index", label: ((a = t.effectiveProps.indexColumnProps) == null ? void 0 : a.title) || "序号", width: ((y = t.effectiveProps.indexColumnProps) == null ? void 0 : y.width) || 60, fixed: (r = t.effectiveProps.indexColumnProps) == null ? void 0 : r.fixed, align: ((C = t.effectiveProps.indexColumnProps) == null ? void 0 : C.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(s) {
354
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
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
356
  return l("div", { key: c }, [e._v(e._s(h))]);
@@ -361,215 +361,427 @@ var Ie = function() {
361
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
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
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(
364
+ }, Le = [], Oe = /* @__PURE__ */ ae(
365
365
  Ee,
366
366
  Ie,
367
- Oe,
367
+ Le,
368
368
  !1,
369
369
  null,
370
370
  "c5638c20",
371
371
  null,
372
372
  null
373
373
  );
374
- const Be = Le.exports, We = /* @__PURE__ */ Z({
374
+ const Ae = Oe.exports, Ve = /* @__PURE__ */ ee({
375
375
  __name: "TableAction",
376
376
  props: {
377
377
  actions: { default: () => [] },
378
378
  dropDownActions: { default: () => [] },
379
379
  stopButtonPropagation: { type: Boolean, default: !1 }
380
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));
381
+ setup(F) {
382
+ const e = F, 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", a = (h) => h.filter((c) => {
383
+ const { ifShow: m } = c;
384
+ return typeof m == "boolean" ? m : typeof m == "function" ? m(c) : !0;
385
+ }), y = B(() => a(e.actions || [])), r = B(() => a(e.dropDownActions || []));
386
+ return { __sfc: !0, props: e, normalizeTooltip: l, getButtonType: t, filterVisible: a, visibleActions: y, visibleDropDownActions: r, handleClick: (h, c) => {
387
+ var m;
388
+ e.stopButtonPropagation && c.stopPropagation(), (m = h.onClick) == null || m.call(h, c);
389
+ }, handlePopConfirm: (h, c, m) => {
390
+ var k, z, x, T;
391
+ e.stopButtonPropagation && m.stopPropagation(), h.popConfirm && (c === "confirm" ? (z = (k = h.popConfirm).confirm) == null || z.call(k) : (T = (x = h.popConfirm).cancel) == null || T.call(x));
392
392
  }, handleDropdownCommand: (h) => {
393
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,
394
+ const c = Number(h), m = r.value[c];
395
+ if (!(!m || m.disabled)) {
396
+ if (m.popConfirm) {
397
+ const z = m.popConfirm.title, x = m.popConfirm.okText || "确定", T = m.popConfirm.cancelText || "取消";
398
+ ze.confirm(z, "提示", {
399
+ confirmButtonText: x,
400
+ cancelButtonText: T,
401
401
  type: "warning"
402
402
  }).then(() => {
403
- var x, f;
404
- return (f = (x = b.popConfirm) == null ? void 0 : x.confirm) == null ? void 0 : f.call(x);
403
+ var u, f;
404
+ return (f = (u = m.popConfirm) == null ? void 0 : u.confirm) == null ? void 0 : f.call(u);
405
405
  }).catch(() => {
406
- var x, f;
407
- return (f = (x = b.popConfirm) == null ? void 0 : x.cancel) == null ? void 0 : f.call(x);
406
+ var u, f;
407
+ return (f = (u = m.popConfirm) == null ? void 0 : u.cancel) == null ? void 0 : f.call(u);
408
408
  });
409
409
  return;
410
410
  }
411
- (k = b.onClick) == null || k.call(b, {});
411
+ (k = m.onClick) == null || k.call(m, {});
412
412
  }
413
413
  } };
414
414
  }
415
415
  });
416
- var Ve = function() {
416
+ var Ke = function() {
417
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))])])]);
418
+ return l("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(a, y) {
419
+ return l("span", { key: `action-${y}`, staticClass: "ecp-table-action__item" }, [a.popConfirm ? l("el-popconfirm", { attrs: { title: a.popConfirm.title, "confirm-button-text": a.popConfirm.okText || "确定", "cancel-button-text": a.popConfirm.cancelText || "取消" }, on: { confirm: (r) => t.handlePopConfirm(a, "confirm", r), cancel: (r) => t.handlePopConfirm(a, "cancel", r) } }, [l("span", { attrs: { slot: "reference" }, slot: "reference" }, [l(a.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", a.tooltip ? t.normalizeTooltip(a.tooltip) : {}, !1), [l("el-button", e._b({ attrs: { type: t.getButtonType(a), size: "small", disabled: a.disabled }, on: { click: (r) => t.handleClick(a, r) } }, "el-button", a.props, !1), [a.icon ? l("i", { class: ["ecp-table-action__icon", a.icon] }) : e._e(), l("span", [e._v(e._s(a.label))])])], 1)], 1)]) : l(a.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", a.tooltip ? t.normalizeTooltip(a.tooltip) : {}, !1), [l("el-button", e._b({ attrs: { type: t.getButtonType(a), size: "small", disabled: a.disabled }, on: { click: (r) => t.handleClick(a, r) } }, "el-button", a.props, !1), [a.icon ? l("i", { class: ["ecp-table-action__icon", a.icon] }) : e._e(), l("span", [e._v(e._s(a.label))])])], 1), a.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(a, y) {
421
+ return l("el-dropdown-item", { key: `dropdown-${y}`, attrs: { command: y, disabled: a.disabled, divided: !!a.divider } }, [l("span", { staticClass: "ecp-table-action__dropdown-item" }, [a.icon ? l("i", { class: ["ecp-table-action__icon", a.icon] }) : e._e(), l("span", [e._v(e._s(a.label))])])]);
422
422
  }), 1)], 1) : e._e()], 2);
423
- }, Ke = [], qe = /* @__PURE__ */ se(
424
- We,
423
+ }, Ne = [], We = /* @__PURE__ */ ae(
425
424
  Ve,
426
425
  Ke,
426
+ Ne,
427
427
  !1,
428
428
  null,
429
429
  "1b2d6c42",
430
430
  null,
431
431
  null
432
432
  );
433
- const Ae = qe.exports;
434
- function st(A) {
435
- const e = M(null), l = () => {
436
- const i = we(e);
437
- if (!i)
433
+ const ke = We.exports;
434
+ function ht(F) {
435
+ const e = A(null), l = () => F ? ye(F) : void 0, t = () => {
436
+ const r = ye(e);
437
+ if (!r)
438
438
  throw new Error("ProTable instance has not been registered");
439
- return i;
439
+ return r;
440
+ }, a = (r) => {
441
+ e.value = r;
442
+ const C = l();
443
+ C && Object.keys(C).length > 0 && r.setProps(C);
440
444
  };
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),
445
+ return F && U(
446
+ () => l(),
447
+ (r) => {
448
+ r && e.value && e.value.setProps(r);
449
+ },
450
+ { deep: !0 }
451
+ ), [a, {
452
+ setProps: (r) => t().setProps(r),
453
+ reload: (r) => t().reload(r),
454
+ redoHeight: () => t().redoHeight(),
455
+ setLoading: (r) => t().setLoading(r),
456
+ getDataSource: () => t().getDataSource(),
457
+ getRawDataSource: () => t().getRawDataSource(),
458
+ setTableData: (r) => t().setTableData(r),
459
+ getColumns: () => t().getColumns(),
460
+ setColumns: (r) => t().setColumns(r),
461
+ setPagination: (r) => t().setPagination(r),
462
+ getSelectRowKeys: () => t().getSelectRowKeys(),
463
+ getSelectRows: () => t().getSelectRows(),
464
+ clearSelectedRowKeys: () => t().clearSelectedRowKeys(),
465
+ setSelectedRowKeys: (r) => t().setSelectedRowKeys(r),
466
+ deleteSelectRowByKey: (r) => t().deleteSelectRowByKey(r),
467
+ updateTableData: (r, C, s) => t().updateTableData(r, C, s),
468
+ updateTableDataRecord: (r, C) => t().updateTableDataRecord(r, C),
469
+ deleteTableDataRecord: (r) => t().deleteTableDataRecord(r),
470
+ insertTableDataRecord: (r, C) => t().insertTableDataRecord(r, C),
471
+ getPaginationRef: () => t().getPaginationRef(),
472
+ getShowPagination: () => t().getShowPagination(),
473
+ setShowPagination: (r) => t().setShowPagination(r),
474
+ getRowSelection: () => t().getRowSelection(),
464
475
  expandAll: () => {
465
- var i, P;
466
- return (P = (i = l()).expandAll) == null ? void 0 : P.call(i);
476
+ var r, C;
477
+ return (C = (r = t()).expandAll) == null ? void 0 : C.call(r);
467
478
  },
468
479
  collapseAll: () => {
469
- var i, P;
470
- return (P = (i = l()).collapseAll) == null ? void 0 : P.call(i);
480
+ var r, C;
481
+ return (C = (r = t()).collapseAll) == null ? void 0 : C.call(r);
471
482
  }
472
483
  }];
473
484
  }
474
- const Ne = /* @__PURE__ */ Z({
485
+ const qe = /* @__PURE__ */ ee({
486
+ __name: "ApiSelect",
487
+ props: {
488
+ value: null,
489
+ api: null,
490
+ params: null,
491
+ lazy: { type: Boolean, default: !1 },
492
+ labelField: { default: "label" },
493
+ valueField: { default: "value" },
494
+ placeholder: null,
495
+ disabled: { type: Boolean },
496
+ clearable: { type: Boolean },
497
+ filterable: { type: Boolean },
498
+ multiple: { type: Boolean }
499
+ },
500
+ emits: ["input"],
501
+ setup(F) {
502
+ const e = F, l = A(!1), t = A([]), a = (r) => {
503
+ e.lazy && r && y();
504
+ }, y = async () => {
505
+ if (e.api) {
506
+ l.value = !0;
507
+ try {
508
+ const r = await e.api(e.params), C = Array.isArray(r) ? r : (r == null ? void 0 : r.list) ?? (r == null ? void 0 : r.data) ?? [], s = e.labelField ?? "label", v = e.valueField ?? "value";
509
+ t.value = C.map((h) => {
510
+ const c = h;
511
+ return {
512
+ label: String(c[s] ?? c.label ?? ""),
513
+ value: c[v] ?? c.value
514
+ };
515
+ });
516
+ } finally {
517
+ l.value = !1;
518
+ }
519
+ }
520
+ };
521
+ return we(() => {
522
+ e.lazy || y();
523
+ }), U(
524
+ () => e.api,
525
+ () => {
526
+ e.lazy ? t.value = [] : y();
527
+ },
528
+ { deep: !0 }
529
+ ), U(() => e.params, () => {
530
+ e.lazy ? t.value = [] : y();
531
+ }, { deep: !0 }), { __sfc: !0, props: e, loading: l, options: t, onVisibleChange: a, fetchOptions: y };
532
+ }
533
+ });
534
+ var je = function() {
535
+ var e = this, l = e._self._c, t = e._self._setupProxy;
536
+ return l("el-select", e._b({ attrs: { value: e.value, placeholder: e.placeholder, disabled: e.disabled, loading: t.loading, clearable: e.clearable, filterable: e.filterable, multiple: e.multiple }, on: { input: function(a) {
537
+ return e.$emit("input", a);
538
+ }, "visible-change": t.onVisibleChange } }, "el-select", e.$attrs, !1), e._l(t.options, function(a) {
539
+ return l("el-option", { key: String(a.value), attrs: { label: a.label, value: a.value } });
540
+ }), 1);
541
+ }, He = [], Ge = /* @__PURE__ */ ae(
542
+ qe,
543
+ je,
544
+ He,
545
+ !1,
546
+ null,
547
+ null,
548
+ null,
549
+ null
550
+ );
551
+ const Ue = Ge.exports, Xe = /* @__PURE__ */ ee({
552
+ __name: "TreeSelect",
553
+ props: {
554
+ value: null,
555
+ treeData: null,
556
+ api: null,
557
+ params: null,
558
+ lazy: { type: Boolean, default: !1 },
559
+ labelField: { default: "label" },
560
+ valueField: { default: "value" },
561
+ childrenField: { default: "children" },
562
+ filterable: { type: Boolean },
563
+ placeholder: null,
564
+ disabled: { type: Boolean },
565
+ clearable: { type: Boolean }
566
+ },
567
+ emits: ["input"],
568
+ setup(F, { emit: e }) {
569
+ const l = F, t = A(), a = A(), y = A(!1), r = A(!1), C = A(""), s = A([]), v = A({}), h = B(() => ({
570
+ label: l.labelField,
571
+ children: l.childrenField
572
+ }));
573
+ function c(g) {
574
+ const E = l.labelField ?? "label", I = l.valueField ?? "value", W = l.childrenField ?? "children", X = g[W], V = {};
575
+ return V[l.labelField ?? "label"] = g[E] ?? g.label, V[l.valueField ?? "value"] = g[I] ?? g.value, Array.isArray(X) && X.length && (V[l.childrenField ?? "children"] = X.map((q) => c(q))), V;
576
+ }
577
+ function m(g, E = "") {
578
+ const I = {}, W = l.labelField ?? "label", X = l.valueField ?? "value", V = l.childrenField ?? "children";
579
+ for (const q of g) {
580
+ const Y = String(q[W] ?? q.label ?? ""), j = q[X] ?? q.value;
581
+ j != null && (I[String(j)] = E ? E + " / " + Y : Y);
582
+ const te = q[V] ?? q.children;
583
+ Array.isArray(te) && te.length && Object.assign(I, m(te, Y));
584
+ }
585
+ return I;
586
+ }
587
+ function k() {
588
+ const g = l.treeData;
589
+ return Array.isArray(g) && g.length > 0;
590
+ }
591
+ function z(g) {
592
+ s.value = g, v.value = m(g);
593
+ }
594
+ function x() {
595
+ const g = l.treeData;
596
+ if (!Array.isArray(g) || g.length === 0)
597
+ return;
598
+ const E = g.map((I) => c(I));
599
+ z(E);
600
+ }
601
+ const T = B(() => l.value == null || l.value === "" ? "" : v.value[String(l.value)] ?? String(l.value)), u = (g, E) => {
602
+ if (!g)
603
+ return !0;
604
+ const I = l.labelField ?? "label";
605
+ return String(E[I] ?? E.label ?? "").toLowerCase().includes(g.toLowerCase());
606
+ };
607
+ U(C, (g) => {
608
+ var E;
609
+ (E = a.value) == null || E.filter(g);
610
+ });
611
+ let f = null;
612
+ function p() {
613
+ l.disabled || (y.value = !0, l.lazy && !k() && N(), Fe(() => {
614
+ f = (g) => {
615
+ t.value && !t.value.contains(g.target) && O();
616
+ }, document.addEventListener("click", f);
617
+ }));
618
+ }
619
+ function O() {
620
+ y.value = !1, C.value = "", f && (document.removeEventListener("click", f), f = null);
621
+ }
622
+ function K() {
623
+ e("input", void 0);
624
+ }
625
+ function M(g) {
626
+ const E = l.valueField ?? "value", I = g[E] ?? g.value;
627
+ e("input", I), O();
628
+ }
629
+ async function N() {
630
+ if (!(!l.api || k())) {
631
+ r.value = !0;
632
+ try {
633
+ const g = await l.api(l.params), E = Array.isArray(g) ? g : (g == null ? void 0 : g.list) ?? (g == null ? void 0 : g.data) ?? [];
634
+ s.value = E.map((I) => c(I)), v.value = m(s.value);
635
+ } finally {
636
+ r.value = !1;
637
+ }
638
+ }
639
+ }
640
+ return we(() => {
641
+ k() ? x() : l.lazy || N();
642
+ }), U(() => l.treeData, () => {
643
+ k() ? x() : (s.value = [], v.value = {}, !l.lazy && l.api && N());
644
+ }, { deep: !0 }), U(() => l.api, () => {
645
+ k() || (l.lazy ? (s.value = [], v.value = {}) : N());
646
+ }, { deep: !0 }), U(() => l.params, () => {
647
+ k() || (l.lazy ? (s.value = [], v.value = {}) : N());
648
+ }, { deep: !0 }), { __sfc: !0, props: l, emit: e, rootRef: t, treeRef: a, dropdownVisible: y, loading: r, filterText: C, treeData: s, flatLabelMap: v, treeProps: h, normalizeNode: c, buildFlatLabelMap: m, hasTreeDataProp: k, applyTreeData: z, syncFromTreeDataProp: x, displayText: T, filterNodeMethod: u, clickOutsideHandler: f, openDropdown: p, closeDropdown: O, clearValue: K, onNodeClick: M, fetchData: N };
649
+ }
650
+ });
651
+ var Ze = function() {
652
+ var e = this, l = e._self._c, t = e._self._setupProxy;
653
+ return l("div", { ref: "rootRef", staticClass: "ecp-tree-select" }, [l("el-input", { staticClass: "ecp-tree-select__input", attrs: { value: t.displayText, placeholder: e.placeholder, disabled: e.disabled, clearable: e.clearable, readonly: "", "suffix-icon": "el-icon-arrow-down" }, on: { focus: t.openDropdown, clear: t.clearValue } }), l("transition", { attrs: { name: "el-zoom-in-top" } }, [l("div", { directives: [{ name: "show", rawName: "v-show", value: t.dropdownVisible, expression: "dropdownVisible" }], staticClass: "ecp-tree-select__dropdown" }, [e.filterable ? l("div", { staticClass: "ecp-tree-select__filter-inner" }, [l("el-input", { attrs: { size: "small", placeholder: "搜索节点", "prefix-icon": "el-icon-search", clearable: "" }, nativeOn: { click: function(a) {
654
+ a.stopPropagation();
655
+ } }, model: { value: t.filterText, callback: function(a) {
656
+ t.filterText = a;
657
+ }, expression: "filterText" } })], 1) : e._e(), l("el-tree", { directives: [{ name: "show", rawName: "v-show", value: !t.loading, expression: "!loading" }], ref: "treeRef", attrs: { data: t.treeData, props: t.treeProps, "node-key": e.valueField, "filter-node-method": e.filterable ? t.filterNodeMethod : void 0, "highlight-current": !0, "default-expand-all": "" }, on: { "node-click": t.onNodeClick } }), t.loading ? l("div", { staticClass: "ecp-tree-select__loading" }, [l("i", { staticClass: "el-icon-loading" }), e._v(" 加载中... ")]) : e._e()], 1)])], 1);
658
+ }, Je = [], Qe = /* @__PURE__ */ ae(
659
+ Xe,
660
+ Ze,
661
+ Je,
662
+ !1,
663
+ null,
664
+ "f30bba11",
665
+ null,
666
+ null
667
+ );
668
+ const Ye = Qe.exports, et = /* @__PURE__ */ ee({
475
669
  __name: "ProFormItem",
476
670
  props: {
477
671
  schema: null,
478
672
  formModel: null,
479
673
  formDisabled: { type: Boolean },
480
674
  autoPlaceholder: { type: Boolean },
481
- formActionType: null
675
+ formActionType: null,
676
+ customComponents: null
482
677
  },
483
- setup(A) {
484
- const e = A, l = ye(), t = B(() => ({
678
+ setup(F) {
679
+ const e = F, l = /* @__PURE__ */ new Set([
680
+ "input",
681
+ "select",
682
+ "api-select",
683
+ "tree-select",
684
+ "date-picker",
685
+ "date-range",
686
+ "input-number",
687
+ "switch",
688
+ "cascader",
689
+ "checkbox",
690
+ "radio"
691
+ ]), t = Ce(), a = B(() => ({
485
692
  schema: e.schema,
486
693
  values: e.formModel,
487
694
  model: e.formModel,
488
695
  field: e.schema.field
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(() => {
696
+ })), y = B(() => {
697
+ const u = e.schema.ifShow;
698
+ return u === void 0 ? !0 : typeof u == "boolean" ? u : u(a.value);
699
+ }), r = B(() => {
700
+ const u = e.schema.show;
701
+ return u === void 0 ? !0 : typeof u == "boolean" ? u : u(a.value);
702
+ }), C = B(() => {
496
703
  if (e.formDisabled)
497
704
  return !0;
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;
705
+ const u = e.schema.dynamicDisabled;
706
+ return u === void 0 ? !1 : typeof u == "boolean" ? u : u(a.value);
503
707
  }), s = B(() => {
504
- const p = e.schema.componentProps;
505
- if (!p)
708
+ const u = e.schema.dynamicRules;
709
+ return u ? Array.isArray(u) ? u : u(a.value) : e.schema.rules;
710
+ }), v = B(() => {
711
+ const u = e.schema.componentProps;
712
+ if (!u)
506
713
  return { props: {}, listeners: {} };
507
- const y = typeof p == "function" ? p({
508
- ...t.value,
714
+ const f = typeof u == "function" ? u({
715
+ ...a.value,
509
716
  formActionType: e.formActionType
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;
717
+ }) : { ...u }, p = {}, O = {};
718
+ for (const [K, M] of Object.entries(f))
719
+ if (K.length > 2 && /^on[A-Za-z]/.test(K) && typeof M == "function") {
720
+ const N = K.slice(2).charAt(0).toLowerCase() + K.slice(3);
721
+ O[N] = M;
515
722
  } else
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 ? {
723
+ p[K] = M;
724
+ return { props: p, listeners: O };
725
+ }), h = B(() => v.value.props), c = B(() => v.value.listeners), m = B(() => !!t.default), k = (u) => {
726
+ const f = u == null ? void 0 : u.options;
727
+ return Array.isArray(f) ? f : void 0;
728
+ }, z = B(() => {
729
+ const u = e.schema.component;
730
+ return u == null ? null : typeof u == "string" ? l.has(u) ? null : e.customComponents && e.customComponents[u] || u : u;
731
+ }), x = (u) => {
732
+ e.formModel[e.schema.field] = u;
733
+ }, T = B(() => {
734
+ const u = e.schema.render;
735
+ return u ? {
524
736
  render() {
525
- const y = p(t.value);
526
- return Array.isArray(y) ? ne("span", y) : y;
737
+ const f = u(a.value);
738
+ return Array.isArray(f) ? ce("span", f) : f;
527
739
  }
528
740
  } : null;
529
741
  });
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 };
742
+ return { __sfc: !0, BUILT_IN_COMPONENTS: l, props: e, slots: t, renderParams: a, shouldRender: y, shouldShow: r, effectiveDisabled: C, effectiveRules: s, effectiveComponentPropsAndListeners: v, effectiveComponentProps: h, effectiveComponentListeners: c, hasSlot: m, getOptions: k, resolvedCustomComponent: z, setFieldValue: x, renderComponent: T, ApiSelect: Ue, TreeSelect: Ye };
531
743
  }
532
744
  });
533
- var je = function() {
745
+ var tt = function() {
534
746
  var e = this, l = e._self._c, t = e._self._setupProxy;
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) + " ")]);
747
+ 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(a, y) {
748
+ return l("div", { key: y, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(a) + " ")]);
749
+ }) : 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 }) : [t.resolvedCustomComponent ? l(t.resolvedCustomComponent, e._g(e._b({ tag: "component", attrs: { value: e.formModel[e.schema.field], placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请输入${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, on: { input: t.setFieldValue } }, "component", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : 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(a) {
750
+ e.$set(e.formModel, e.schema.field, a);
751
+ }, 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(a) {
752
+ e.$set(e.formModel, e.schema.field, a);
753
+ }, 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(a) {
754
+ e.$set(e.formModel, e.schema.field, a);
755
+ }, expression: "formModel[schema.field]" } }, "el-select", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(a) {
756
+ return l("el-option", { key: String(a.value), attrs: { label: a.label, value: a.value } });
757
+ }), 1) : e.schema.component === "api-select" ? l(t.ApiSelect, e._g(e._b({ attrs: { value: e.formModel[e.schema.field], placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, on: { input: t.setFieldValue } }, "ApiSelect", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "tree-select" ? l(t.TreeSelect, e._g(e._b({ attrs: { value: e.formModel[e.schema.field], placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请选择${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, on: { input: t.setFieldValue } }, "TreeSelect", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : 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(a) {
758
+ e.$set(e.formModel, e.schema.field, a);
759
+ }, 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(a) {
760
+ e.$set(e.formModel, e.schema.field, a);
761
+ }, 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(a) {
762
+ e.$set(e.formModel, e.schema.field, a);
763
+ }, 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(a) {
764
+ e.$set(e.formModel, e.schema.field, a);
765
+ }, 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(a) {
766
+ e.$set(e.formModel, e.schema.field, a);
767
+ }, expression: "formModel[schema.field]" } }, "el-checkbox-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(a) {
768
+ return l("el-checkbox", { key: String(a.value), attrs: { label: a.value } }, [e._v(" " + e._s(a.label) + " ")]);
769
+ }), 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(a) {
770
+ e.$set(e.formModel, e.schema.field, a);
771
+ }, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(a) {
772
+ return l("el-radio", { key: String(a.value), attrs: { label: a.value } }, [e._v(" " + e._s(a.label) + " ")]);
561
773
  }), 1) : e._e()]], 2) : e._e();
562
- }, He = [], Ge = /* @__PURE__ */ se(
563
- Ne,
564
- je,
565
- He,
774
+ }, lt = [], ot = /* @__PURE__ */ ae(
775
+ et,
776
+ tt,
777
+ lt,
566
778
  !1,
567
779
  null,
568
- "cfc968c5",
780
+ "0dcbe9b0",
569
781
  null,
570
782
  null
571
783
  );
572
- const ke = Ge.exports, Ue = /* @__PURE__ */ Z({
784
+ const Te = ot.exports, at = /* @__PURE__ */ ee({
573
785
  __name: "FormActions",
574
786
  props: {
575
787
  showActionButtonGroup: { type: Boolean, default: !0 },
@@ -586,28 +798,28 @@ const ke = Ge.exports, Ue = /* @__PURE__ */ Z({
586
798
  actionColOptions: null
587
799
  },
588
800
  emits: ["submit", "reset", "toggle"],
589
- setup(A) {
801
+ setup(F) {
590
802
  return { __sfc: !0 };
591
803
  }
592
804
  });
593
- var Xe = function() {
805
+ var nt = function() {
594
806
  var e = this, l = e._self._c;
595
807
  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) {
596
808
  return e.$emit("submit");
597
809
  } } }, [e._v(" " + e._s(e.submitButtonText) + " ")]) : e._e(), e._t("resetBefore"), e.showResetButton ? l("el-button", { attrs: { icon: e.resetButtonIcon }, on: { click: function(t) {
598
810
  return e.$emit("reset");
599
811
  } } }, [e._v(" " + e._s(e.resetButtonText) + " ")]) : e._e(), e._t("actions")], 2);
600
- }, Ze = [], Je = /* @__PURE__ */ se(
601
- Ue,
602
- Xe,
603
- Ze,
812
+ }, st = [], rt = /* @__PURE__ */ ae(
813
+ at,
814
+ nt,
815
+ st,
604
816
  !1,
605
817
  null,
606
818
  "489c88d2",
607
819
  null,
608
820
  null
609
821
  );
610
- const Te = Je.exports, Qe = /* @__PURE__ */ Z({
822
+ const De = rt.exports, it = /* @__PURE__ */ ee({
611
823
  __name: "ProForm",
612
824
  props: {
613
825
  schemas: null,
@@ -634,256 +846,256 @@ const Te = Je.exports, Qe = /* @__PURE__ */ Z({
634
846
  submitFunc: null,
635
847
  resetFunc: null,
636
848
  submitOnReset: { type: Boolean, default: !1 },
637
- formListeners: null
849
+ formListeners: null,
850
+ components: null
638
851
  },
639
852
  emits: ["submit", "reset", "register"],
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)
853
+ setup(F, { expose: e, emit: l }) {
854
+ const t = F, a = Ce(), y = A(), r = A(), C = A(!1), s = A(!0), v = A({}), h = A({}), c = A([]), m = A({}), k = { xl: 1920, lg: 1200, md: 992, sm: 768 }, z = (i, _, S) => {
855
+ const P = S ?? (typeof window < "u" ? window.innerWidth : 1920), w = i ?? {}, $ = _ ?? {}, H = $.span ?? 8;
856
+ return P >= k.xl ? w.xl ?? $.xl ?? w.lg ?? $.lg ?? w.md ?? $.md ?? w.sm ?? $.sm ?? w.xs ?? $.xs ?? w.span ?? H : P >= k.lg ? w.lg ?? $.lg ?? w.md ?? $.md ?? w.sm ?? $.sm ?? w.xs ?? $.xs ?? w.span ?? H : P >= k.md ? w.md ?? $.md ?? w.sm ?? $.sm ?? w.xs ?? $.xs ?? w.span ?? H : P >= k.sm ? w.sm ?? $.sm ?? w.xs ?? $.xs ?? w.span ?? H : w.xs ?? $.xs ?? w.span ?? H;
857
+ }, { getSetting: x } = Be(), T = B(() => ({ ...x("ProForm"), ...t, ...m.value })), u = B(() => ({
858
+ ...x("ProForm").components ?? {},
859
+ ...t.components ?? {},
860
+ ...m.value.components ?? {}
861
+ })), f = B(() => T.value.actionColOptions ?? { span: 24 }), p = A(typeof window < "u" ? window.innerWidth : 1920), O = (i, _, S, P) => {
862
+ let w = 24, $ = 1, H = 0;
863
+ for (const Q of i) {
864
+ const ne = z(Q.colProps, _, P);
865
+ if (ne > w) {
866
+ if ($++, $ > S)
650
867
  break;
651
- _ = 24 - G;
868
+ w = 24 - ne;
652
869
  } else
653
- _ -= G;
654
- E++;
870
+ w -= ne;
871
+ H++;
655
872
  }
656
- return E;
657
- }, O = B(() => {
658
- const r = c.value.filter((_) => H(_));
659
- if (!R.value.showAdvancedButton)
873
+ return H;
874
+ }, K = B(() => {
875
+ const i = c.value.filter((w) => g(w));
876
+ if (!T.value.showAdvancedButton)
660
877
  return !1;
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)
878
+ const _ = T.value.alwaysShowLines ?? 1, S = T.value.baseColProps, P = O(i, S, _, p.value);
879
+ return console.log(i.length, P), i.length > P;
880
+ }), M = B(() => T.value.formListeners ?? {}), N = B(() => {
881
+ const i = c.value.filter((w) => g(w));
882
+ if (!T.value.showAdvancedButton || !s.value)
883
+ return i;
884
+ const _ = T.value.alwaysShowLines ?? 1, S = T.value.baseColProps, P = O(i, S, _, p.value);
885
+ return i.slice(0, P);
886
+ }), g = (i) => {
887
+ let _ = !0, S = !0;
888
+ return typeof i.ifShow == "function" && (_ = i.ifShow({ schema: i, values: v.value, model: v.value, field: i.field })), typeof i.ifShow == "boolean" && (_ = i.ifShow), typeof i.show == "function" && (S = i.show({ schema: i, values: v.value, model: v.value, field: i.field })), typeof i.show == "boolean" && (S = i.show), _ && S;
889
+ }, E = (i) => i.colProps ?? T.value.baseColProps ?? {}, I = (i) => i.slot || i.field, W = () => {
890
+ const i = {}, _ = {}, S = T.value.initialValues ?? t.initialValues;
891
+ c.value.forEach((P) => {
892
+ var w;
893
+ i[P.field] = P.defaultValue ?? (S == null ? void 0 : S[P.field]), (w = P.rules) != null && w.length && (_[P.field] = P.rules);
894
+ }), v.value = { ...v.value, ...i }, h.value = _;
895
+ }, X = (i) => {
896
+ const _ = { ...i };
897
+ return c.value.forEach((S) => {
898
+ const P = S.ifShow;
899
+ if (P === void 0)
683
900
  return;
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;
901
+ (typeof P == "boolean" ? P : P({ schema: S, values: i, model: i, field: S.field })) || delete _[S.field];
902
+ }), _;
903
+ }, V = (i) => {
904
+ const _ = X(i), S = m.value.fieldMapToTime;
905
+ if (!(S != null && S.length))
906
+ return _;
907
+ const P = { ..._ };
908
+ return S.forEach(([w, [$, H]]) => {
909
+ const Q = P[w];
910
+ Array.isArray(Q) && Q.length === 2 && (delete P[w], P[$] = Q[0], P[H] = Q[1]);
911
+ }), P;
912
+ }, q = async () => {
913
+ var i;
697
914
  try {
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);
915
+ await ((i = y.value) == null ? void 0 : i.validate()), T.value.submitFunc ? await T.value.submitFunc() : (C.value = !0, l("submit", V({ ...v.value })));
916
+ } catch (_) {
917
+ console.error("Form validation failed:", _);
701
918
  } finally {
702
- z.value = !1;
919
+ C.value = !1;
703
920
  }
704
- }, ie = async () => {
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 });
921
+ }, Y = async () => {
922
+ var i;
923
+ T.value.resetFunc ? await T.value.resetFunc() : ((i = y.value) == null || i.resetFields(), W(), l("reset"), T.value.submitOnReset && await q());
924
+ }, j = (i) => (v.value = { ...v.value, ...i }, Promise.resolve()), te = () => V({ ...v.value }), ue = async () => {
925
+ var i;
926
+ (i = y.value) == null || i.resetFields(), W();
927
+ }, de = (i) => {
928
+ var _;
929
+ return ((_ = y.value) == null ? void 0 : _.validate(i)) ?? Promise.resolve();
930
+ }, fe = (i) => y.value ? i != null && i.length ? Promise.all(i.map((_) => new Promise((S, P) => {
931
+ y.value.validateField(_, (w) => w ? S(void 0) : P(new Error("Validation failed")));
932
+ }))) : y.value.validate() : Promise.resolve(), pe = async (i, _) => {
933
+ var P;
934
+ const S = (P = r.value) == null ? void 0 : P.querySelector(`[data-field="${i}"]`);
935
+ return S && S.scrollIntoView({ behavior: (_ == null ? void 0 : _.behavior) ?? "smooth", block: (_ == null ? void 0 : _.block) ?? "nearest" }), Promise.resolve();
936
+ }, ve = (i) => {
937
+ var _;
938
+ (_ = y.value) == null || _.clearValidate(i);
939
+ }, Z = async (i) => {
940
+ (Array.isArray(i) ? i : [i]).forEach((S) => {
941
+ const P = c.value.findIndex((w) => w.field === S.field);
942
+ P >= 0 && (c.value[P] = { ...c.value[P], ...S });
726
943
  });
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);
944
+ }, me = async (i, _, S) => {
945
+ if (S)
946
+ c.value.unshift(i);
947
+ else if (_) {
948
+ const P = c.value.findIndex((w) => w.field === _);
949
+ c.value.splice(P + 1, 0, i);
733
950
  } else
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];
742
- debugger;
743
- L();
744
- }
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
951
+ c.value.push(i);
952
+ W();
953
+ }, he = async (i) => {
954
+ const _ = Array.isArray(i) ? i : [i];
955
+ c.value = c.value.filter((S) => !_.includes(S.field));
956
+ }, be = async (i) => {
957
+ m.value = { ...m.value, ...i }, i.schemas && (c.value = [...i.schemas], W());
958
+ }, J = {
959
+ getFieldsValue: te,
960
+ setFieldsValue: j,
961
+ resetFields: ue,
962
+ validate: de,
963
+ validateFields: fe,
964
+ submit: q,
965
+ scrollToField: pe,
966
+ clearValidate: ve,
967
+ updateSchema: Z,
968
+ appendSchemaByField: me,
969
+ removeSchemaByField: he,
970
+ setProps: be
758
971
  };
759
- e(te);
760
- const q = () => {
761
- c.value = [...t.schemas ?? []], L();
762
- }, oe = () => {
763
- typeof window < "u" && (f.value = window.innerWidth);
972
+ e(J);
973
+ const se = () => {
974
+ c.value = [...t.schemas ?? []], W();
975
+ }, re = () => {
976
+ typeof window < "u" && (p.value = window.innerWidth);
764
977
  };
765
- return xe(() => {
766
- q(), l("register", te), typeof window < "u" && window.addEventListener("resize", oe);
978
+ return we(() => {
979
+ se(), l("register", J), typeof window < "u" && window.addEventListener("resize", re);
767
980
  }), 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 };
981
+ typeof window < "u" && window.removeEventListener("resize", re);
982
+ }), U(() => [t.schemas, t.initialValues], se, { deep: !0 }), { __sfc: !0, props: t, emit: l, slots: a, formRef: y, formWrapRef: r, submitLoading: C, collapsed: s, formModel: v, formRules: h, innerSchemas: c, innerProps: m, BREAKPOINTS: k, getEffectiveSpan: z, getComponentSetting: x, effectiveProps: T, formCustomComponents: u, effectiveActionColOptions: f, windowWidth: p, getVisibleSchemaCount: O, hasMoreFields: K, formListeners: M, displaySchemas: N, shouldShow: g, getColProps: E, getSlotName: I, initForm: W, filterByIfShow: X, processFieldMapToTime: V, handleSubmit: q, handleReset: Y, setFieldsValue: j, getFieldsValue: te, resetFields: ue, validate: de, validateFields: fe, scrollToField: pe, clearValidate: ve, updateSchema: Z, appendSchemaByField: me, removeSchemaByField: he, setProps: be, formActionRef: J, syncSchemas: se, handleResize: re, ProFormItem: Te, FormActions: De };
770
983
  }
771
984
  });
772
- var Ye = function() {
985
+ var ct = function() {
773
986
  var e = this, l = e._self._c, t = e._self._setupProxy;
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) {
987
+ 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(a) {
988
+ var y, r;
989
+ return [t.shouldShow(a) ? l("el-col", e._b({ key: a.field, attrs: { offset: ((y = a.colProps) == null ? void 0 : y.offset) ?? ((r = t.effectiveProps.baseColProps) == null ? void 0 : r.offset) ?? 0, "data-field": a.field } }, "el-col", t.getColProps(a), !1), [l(t.ProFormItem, { attrs: { schema: a, "form-model": t.formModel, "form-disabled": t.effectiveProps.disabled, "auto-placeholder": t.effectiveProps.autoSetPlaceholder, "form-action-type": t.formActionRef, "custom-components": t.formCustomComponents } }, [t.slots[t.getSlotName(a)] ? [e._t(t.getSlotName(a), null, { model: t.formModel, schema: a, field: a.field, values: t.formModel })] : e._e()], 2)], 1) : e._e()];
990
+ }), 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(a) {
778
991
  t.collapsed = !t.collapsed;
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) {
992
+ } } }, [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(a) {
780
993
  t.collapsed = !t.collapsed;
781
994
  } } }, [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);
782
- }, et = [], tt = /* @__PURE__ */ se(
783
- Qe,
784
- Ye,
785
- et,
995
+ }, ut = [], dt = /* @__PURE__ */ ae(
996
+ it,
997
+ ct,
998
+ ut,
786
999
  !1,
787
1000
  null,
788
- "140fc052",
1001
+ "4ee1cb87",
789
1002
  null,
790
1003
  null
791
1004
  );
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) => {
1005
+ const Me = dt.exports;
1006
+ function bt(F) {
1007
+ const e = A(null), l = A(F ? ye(F) : void 0), t = () => F ? ye(F) : void 0, a = (f) => {
795
1008
  e.value = f;
796
- const d = t();
797
- debugger;
798
- d && Object.keys(d).length > 0 && f.setProps(d);
1009
+ const p = t();
1010
+ p && Object.keys(p).length > 0 && f.setProps(p);
799
1011
  };
800
- return A && ae(
1012
+ return F && U(
801
1013
  () => t(),
802
1014
  (f) => {
803
1015
  l.value = f, f && e.value && e.value.setProps(f);
804
1016
  },
805
1017
  { deep: !0 }
806
- ), [n, {
807
- register: n,
1018
+ ), [a, {
1019
+ register: a,
808
1020
  formAction: e,
809
1021
  getFieldsValue: () => {
810
1022
  var f;
811
1023
  return ((f = e.value) == null ? void 0 : f.getFieldsValue()) ?? {};
812
1024
  },
813
1025
  setFieldsValue: async (f) => {
814
- var d;
815
- await ((d = e.value) == null ? void 0 : d.setFieldsValue(f));
1026
+ var p;
1027
+ await ((p = e.value) == null ? void 0 : p.setFieldsValue(f));
816
1028
  },
817
1029
  resetFields: async () => {
818
1030
  var f;
819
1031
  await ((f = e.value) == null ? void 0 : f.resetFields());
820
1032
  },
821
1033
  validate: (f) => {
822
- var d;
823
- return ((d = e.value) == null ? void 0 : d.validate(f)) ?? Promise.resolve();
1034
+ var p;
1035
+ return ((p = e.value) == null ? void 0 : p.validate(f)) ?? Promise.resolve();
824
1036
  },
825
1037
  validateFields: (f) => {
826
- var d;
827
- return ((d = e.value) == null ? void 0 : d.validateFields(f)) ?? Promise.resolve();
1038
+ var p;
1039
+ return ((p = e.value) == null ? void 0 : p.validateFields(f)) ?? Promise.resolve();
828
1040
  },
829
1041
  submit: () => {
830
1042
  var f;
831
1043
  return ((f = e.value) == null ? void 0 : f.submit()) ?? Promise.resolve();
832
1044
  },
833
- scrollToField: (f, d) => {
1045
+ scrollToField: (f, p) => {
834
1046
  var O;
835
- return ((O = e.value) == null ? void 0 : O.scrollToField(f, d)) ?? Promise.resolve();
1047
+ return ((O = e.value) == null ? void 0 : O.scrollToField(f, p)) ?? Promise.resolve();
836
1048
  },
837
1049
  clearValidate: (f) => {
838
- var d;
839
- (d = e.value) == null || d.clearValidate(f);
1050
+ var p;
1051
+ (p = e.value) == null || p.clearValidate(f);
840
1052
  },
841
1053
  updateSchema: (f) => {
842
- var d;
843
- return ((d = e.value) == null ? void 0 : d.updateSchema(f)) ?? Promise.resolve();
1054
+ var p;
1055
+ return ((p = e.value) == null ? void 0 : p.updateSchema(f)) ?? Promise.resolve();
844
1056
  },
845
- appendSchemaByField: (f, d, O) => {
846
- var j;
847
- return ((j = e.value) == null ? void 0 : j.appendSchemaByField(f, d, O)) ?? Promise.resolve();
1057
+ appendSchemaByField: (f, p, O) => {
1058
+ var K;
1059
+ return ((K = e.value) == null ? void 0 : K.appendSchemaByField(f, p, O)) ?? Promise.resolve();
848
1060
  },
849
1061
  removeSchemaByField: (f) => {
850
- var d;
851
- return ((d = e.value) == null ? void 0 : d.removeSchemaByField(f)) ?? Promise.resolve();
1062
+ var p;
1063
+ return ((p = e.value) == null ? void 0 : p.removeSchemaByField(f)) ?? Promise.resolve();
852
1064
  },
853
1065
  setProps: async (f) => {
854
- var d;
855
- l.value = { ...l.value, ...f }, await ((d = e.value) == null ? void 0 : d.setProps(f));
1066
+ var p;
1067
+ l.value = { ...l.value, ...f }, await ((p = e.value) == null ? void 0 : p.setProps(f));
856
1068
  }
857
1069
  }];
858
1070
  }
859
- const ot = [
860
- { name: "ProTable", component: Be },
861
- { name: "TableAction", component: Ae },
1071
+ const ft = [
1072
+ { name: "ProTable", component: Ae },
1073
+ { name: "TableAction", component: ke },
862
1074
  { name: "ProForm", component: Me },
863
- { name: "ProFormItem", component: ke },
864
- { name: "FormActions", component: Te }
1075
+ { name: "ProFormItem", component: Te },
1076
+ { name: "FormActions", component: De }
865
1077
  ];
866
- function lt(A) {
867
- ot.forEach(({ name: e, component: l }) => {
868
- A.component(e, l);
1078
+ function pt(F) {
1079
+ ft.forEach(({ name: e, component: l }) => {
1080
+ F.component(e, l);
869
1081
  });
870
1082
  }
871
- const it = {
872
- install: lt,
873
- ProTable: Be,
1083
+ const _t = {
1084
+ install: pt,
1085
+ ProTable: Ae,
874
1086
  ProForm: Me,
875
- TableAction: Ae
1087
+ TableAction: ke
876
1088
  };
877
1089
  export {
878
- Te as FormActions,
1090
+ De as FormActions,
879
1091
  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
1092
+ Te as ProFormItem,
1093
+ Ae as ProTable,
1094
+ ke as TableAction,
1095
+ _t as default,
1096
+ pt as install,
1097
+ Be as useComponentSetting,
1098
+ bt as useForm,
1099
+ ht as useProTable
888
1100
  };
889
1101
  //# sourceMappingURL=element-component-pro.es.js.map