@aspire-ui/element-component-pro 1.0.4 → 1.0.6

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 $e, defineComponent as ee, h as ce, useSlots as Pe, ref as k, computed as R, onMounted as we, nextTick as Fe, onUnmounted as Re, watch as U, unref as ye } from "vue";
2
- import { MessageBox as ze } from "element-ui";
3
- const ge = $e({});
4
- function Be() {
1
+ import { reactive as ze, defineComponent as ae, h as oe, useSlots as Pe, ref as k, computed as x, onMounted as pe, nextTick as Be, onUnmounted as xe, watch as U, unref as ue } from "vue";
2
+ import { MessageBox as Ee } from "element-ui";
3
+ const we = ze({});
4
+ function Se() {
5
5
  return {
6
- getSetting: (l) => l === void 0 ? { ...ge } : { ...ge[l] ?? {} },
6
+ getSetting: (l) => l === void 0 ? { ...we } : { ...we[l] ?? {} },
7
7
  setSetting: (l, t) => {
8
- const a = ge[l];
9
- ge[l] = a ? { ...a, ...t } : { ...t };
8
+ const a = we[l];
9
+ we[l] = a ? { ...a, ...t } : { ...t };
10
10
  }
11
11
  };
12
12
  }
13
- const Ee = /* @__PURE__ */ ee({
13
+ const Ie = /* @__PURE__ */ ae({
14
14
  __name: "ProTable",
15
15
  props: {
16
16
  columns: null,
@@ -54,8 +54,8 @@ const Ee = /* @__PURE__ */ ee({
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(x, { expose: e, emit: l }) {
58
- const t = x, a = ee({
57
+ setup(S, { expose: e, emit: l }) {
58
+ const t = S, a = ae({
59
59
  name: "EcpProTableDefaultCellRenderer",
60
60
  props: {
61
61
  column: { type: Object, required: !0 },
@@ -65,20 +65,20 @@ const Ee = /* @__PURE__ */ ee({
65
65
  },
66
66
  setup(o) {
67
67
  return () => {
68
- var f, b;
69
- const n = o.column;
70
- if (n != null && n.customRender) {
71
- const T = n.customRender({ text: o.value, record: o.record, index: o.index });
72
- return typeof T == "string" || typeof T == "number" ? ce("span", String(T)) : T;
68
+ var f, C;
69
+ const s = o.column;
70
+ if (s != null && s.customRender) {
71
+ const I = s.customRender({ text: o.value, record: o.record, index: o.index });
72
+ return typeof I == "string" || typeof I == "number" ? oe("span", String(I)) : I;
73
73
  }
74
- if (n != null && n.valueEnum) {
75
- const T = ((b = (f = n.valueEnum) == null ? void 0 : f[o.value]) == null ? void 0 : b.text) ?? o.value;
76
- return ce("span", T == null ? "" : String(T));
74
+ if (s != null && s.valueEnum) {
75
+ const I = ((C = (f = s.valueEnum) == null ? void 0 : f[o.value]) == null ? void 0 : C.text) ?? o.value;
76
+ return oe("span", I == null ? "" : String(I));
77
77
  }
78
- return ce("span", o.value == null ? "" : String(o.value));
78
+ return oe("span", o.value == null ? "" : String(o.value));
79
79
  };
80
80
  }
81
- }), y = ee({
81
+ }), h = ae({
82
82
  name: "EcpProTableBodyCellRenderer",
83
83
  props: {
84
84
  slotRender: { type: Function, required: !0 },
@@ -91,351 +91,351 @@ const Ee = /* @__PURE__ */ ee({
91
91
  },
92
92
  setup(o) {
93
93
  return () => {
94
- const n = o.slotRender, f = n == null ? void 0 : n({ column: o.column, record: o.record, index: o.index, value: o.value });
95
- if (((V) => V == null ? [] : Array.isArray(V) ? V.filter((G) => G != null && G !== !1 && !G.isComment) : [V])(f).length > 0)
94
+ const s = o.slotRender, f = s == null ? void 0 : s({ column: o.column, record: o.record, index: o.index, value: o.value });
95
+ if (((H) => H == null ? [] : Array.isArray(H) ? H.filter((ee) => ee != null && ee !== !1 && !ee.isComment) : [H])(f).length > 0)
96
96
  return f;
97
- const F = { ...o.column };
98
- return o.customRender && (F.customRender = o.customRender), o.valueEnum && (F.valueEnum = o.valueEnum), ce(a, { props: { column: F, record: o.record, index: o.index, value: o.value } });
97
+ const M = { ...o.column };
98
+ return o.customRender && (M.customRender = o.customRender), o.valueEnum && (M.valueEnum = o.valueEnum), oe(a, { props: { column: M, record: o.record, index: o.index, value: o.value } });
99
99
  };
100
100
  }
101
- }), r = Pe(), P = k(), s = k(), p = k(0), $ = k(t.loading ?? !1), u = k([]), D = k({}), h = k([]), B = k({}), m = k([]), A = k(null), c = k({
101
+ }), n = Pe(), m = k(), r = k(), y = k(0), E = k(t.loading ?? !1), c = k([]), D = k({}), b = k([]), T = k({}), _ = k([]), A = k(null), u = k({
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: v } = Be(), d = R(() => ({ ...v("ProTable"), ...t, ...B.value })), z = R(() => !!d.value.title || !!r.tableTitle || !!r.toolbar), I = R(() => A.value !== null ? A.value : !!t.pagination && typeof t.pagination == "object"), M = R(() => d.value.rowKey || "id"), N = R(() => new Set(m.value.map((o) => o[M.value]))), g = R(
107
- () => h.value.filter((o) => !o.hideInTable && !o.defaultHidden)
108
- ), L = R(() => {
109
- var n, f;
106
+ }), { getSetting: p } = Se(), d = x(() => ({ ...p("ProTable"), ...t, ...T.value })), O = x(() => !!d.value.title || !!n.tableTitle || !!n.toolbar), V = x(() => A.value !== null ? A.value : !!t.pagination && typeof t.pagination == "object"), $ = x(() => d.value.rowKey || "id"), q = x(() => new Set(_.value.map((o) => o[$.value]))), F = x(
107
+ () => b.value.filter((o) => !o.hideInTable && !o.defaultHidden)
108
+ ), L = x(() => {
109
+ var s, f;
110
110
  let o = 0;
111
- return d.value.rowSelection && (o += Number(d.value.rowSelection.width) || 48), d.value.showIndexColumn && (o += Number((n = d.value.indexColumnProps) == null ? void 0 : n.width) || 60), d.value.actionColumn && (o += Number((f = d.value.actionColumn) == null ? void 0 : f.width) || 150), o;
112
- }), O = (o) => typeof o == "number" && o > 0, W = R(() => g.value.filter((n) => Y(n) && O(n.width)).reduce((n, f) => n + (typeof f.width == "number" ? f.width : 0), 0)), X = R(() => g.value.filter((n) => Y(n) && typeof n.width == "string").reduce((n, f) => n + (Number(q(f)) || 80), 0)), K = (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 (O(n) && W.value > 0 && p.value > 0 && typeof n == "number") {
115
- const f = p.value - L.value - X.value;
116
- let b = Math.floor(f * n / W.value);
117
- const T = K(o.minWidth) ?? 60, F = K(o.maxWidth);
118
- return b = Math.max(T, b), F != null && (b = Math.min(F, b)), b;
111
+ return d.value.rowSelection && (o += Number(d.value.rowSelection.width) || 48), d.value.showIndexColumn && (o += Number((s = d.value.indexColumnProps) == null ? void 0 : s.width) || 60), d.value.actionColumn && (o += Number((f = d.value.actionColumn) == null ? void 0 : f.width) || 150), o;
112
+ }), K = (o) => typeof o == "number" && o > 0, X = x(() => F.value.filter((s) => J(s) && K(s.width)).reduce((s, f) => s + (typeof f.width == "number" ? f.width : 0), 0)), Q = x(() => F.value.filter((s) => J(s) && typeof s.width == "string").reduce((s, f) => s + (Number(N(f)) || 80), 0)), G = (o) => o == null ? null : typeof o == "number" ? o : parseInt(String(o).replace(/px$/i, ""), 10) || null, N = (o) => {
113
+ const s = o.width;
114
+ if (K(s) && X.value > 0 && y.value > 0 && typeof s == "number") {
115
+ const f = y.value - L.value - Q.value;
116
+ let C = Math.floor(f * s / X.value);
117
+ const I = G(o.minWidth) ?? 60, M = G(o.maxWidth);
118
+ return C = Math.max(I, C), M != null && (C = Math.min(M, C)), C;
119
119
  }
120
- if (typeof n == "string") {
121
- const f = K(n) ?? 80, b = K(o.minWidth), T = K(o.maxWidth);
122
- let F = f;
123
- return b != null && (F = Math.max(b, F)), T != null && (F = Math.min(T, F)), F;
120
+ if (typeof s == "string") {
121
+ const f = G(s) ?? 80, C = G(o.minWidth), I = G(o.maxWidth);
122
+ let M = f;
123
+ return C != null && (M = Math.max(C, M)), I != null && (M = Math.min(I, M)), M;
124
124
  }
125
125
  return o.width;
126
- }, Y = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, j = R(() => {
127
- var n;
128
- const o = (n = d.value.rowSelection) == null ? void 0 : n.getCheckboxProps;
129
- return o ? u.value.filter((f) => {
130
- var b;
131
- return !((b = o(f)) != null && b.disabled);
132
- }) : u.value;
133
- }), te = R(() => j.value.length > 0), ue = R(() => j.value.length === 0 ? !1 : j.value.every((o) => N.value.has(o[M.value]))), de = R(() => {
134
- const o = j.value.filter((n) => N.value.has(n[M.value])).length;
126
+ }, J = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, j = x(() => {
127
+ var s;
128
+ const o = (s = d.value.rowSelection) == null ? void 0 : s.getCheckboxProps;
129
+ return o ? c.value.filter((f) => {
130
+ var C;
131
+ return !((C = o(f)) != null && C.disabled);
132
+ }) : c.value;
133
+ }), Z = x(() => j.value.length > 0), v = x(() => j.value.length === 0 ? !1 : j.value.every((o) => q.value.has(o[$.value]))), z = x(() => {
134
+ const o = j.value.filter((s) => q.value.has(s[$.value])).length;
135
135
  return o > 0 && o < j.value.length;
136
- }), fe = (o) => N.value.has(o[M.value]), pe = (o) => {
137
- var n, f, b;
138
- return ((b = (f = (n = d.value.rowSelection) == null ? void 0 : n.getCheckboxProps) == null ? void 0 : f.call(n, o)) == null ? void 0 : b.disabled) ?? !1;
139
- }, ve = (o) => {
140
- var n, f, b;
141
- return ((b = (f = (n = d.value.rowSelection) == null ? void 0 : n.getRadioProps) == null ? void 0 : f.call(n, o)) == null ? void 0 : b.disabled) ?? !1;
142
- }, Z = () => {
143
- const o = m.value.map((n) => n[M.value]);
144
- l("selection-change", { keys: o, rows: m.value });
145
- }, me = (o, n) => {
146
- const f = o[M.value];
147
- n ? m.value = [...m.value.filter((b) => b[M.value] !== f), o] : m.value = m.value.filter((b) => b[M.value] !== f), Z();
148
- }, he = (o) => {
149
- m.value = [o], Z();
150
- }, be = (o) => {
136
+ }), B = (o) => q.value.has(o[$.value]), W = (o) => {
137
+ var s, f, C;
138
+ return ((C = (f = (s = d.value.rowSelection) == null ? void 0 : s.getCheckboxProps) == null ? void 0 : f.call(s, o)) == null ? void 0 : C.disabled) ?? !1;
139
+ }, Y = (o) => {
140
+ var s, f, C;
141
+ return ((C = (f = (s = d.value.rowSelection) == null ? void 0 : s.getRadioProps) == null ? void 0 : f.call(s, o)) == null ? void 0 : C.disabled) ?? !1;
142
+ }, te = () => {
143
+ const o = _.value.map((s) => s[$.value]);
144
+ l("selection-change", { keys: o, rows: _.value });
145
+ }, se = (o, s) => {
146
+ const f = o[$.value];
147
+ s ? _.value = [..._.value.filter((C) => C[$.value] !== f), o] : _.value = _.value.filter((C) => C[$.value] !== f), te();
148
+ }, de = (o) => {
149
+ _.value = [o], te();
150
+ }, re = (o) => {
151
151
  if (o) {
152
- const n = new Set(m.value.map((b) => b[M.value])), f = j.value.filter((b) => !n.has(b[M.value]));
153
- m.value = [...m.value, ...f];
152
+ const s = new Set(_.value.map((C) => C[$.value])), f = j.value.filter((C) => !s.has(C[$.value]));
153
+ _.value = [..._.value, ...f];
154
154
  } else {
155
- const n = new Set(u.value.map((f) => f[M.value]));
156
- m.value = m.value.filter((f) => !n.has(f[M.value]));
155
+ const s = new Set(c.value.map((f) => f[$.value]));
156
+ _.value = _.value.filter((f) => !s.has(f[$.value]));
157
157
  }
158
- Z();
159
- }, J = async (o) => {
158
+ te();
159
+ }, le = async (o) => {
160
160
  if (!t.api) {
161
161
  if (t.dataSource)
162
162
  return;
163
- u.value = [];
163
+ c.value = [];
164
164
  return;
165
165
  }
166
- $.value = !0;
166
+ E.value = !0;
167
167
  try {
168
- const n = d.value.fetchSetting ?? {}, f = n.pageField ?? "page", b = n.sizeField ?? "pageSize", T = n.listField ?? "list", F = n.totalField ?? "total", V = {
169
- [f]: (o == null ? void 0 : o.page) ?? c.value.page,
170
- [b]: (o == null ? void 0 : o.pageSize) ?? c.value.pageSize,
168
+ const s = d.value.fetchSetting ?? {}, f = s.pageField ?? "page", C = s.sizeField ?? "pageSize", I = s.listField ?? "list", M = s.totalField ?? "total", H = {
169
+ [f]: (o == null ? void 0 : o.page) ?? u.value.page,
170
+ [C]: (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 && (c.value.page = o.page), (o == null ? void 0 : o.pageSize) != null && (c.value.pageSize = o.pageSize);
175
- const G = t.beforeFetch ? t.beforeFetch(V) : V, Ce = await t.api(G);
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 ee = t.beforeFetch ? t.beforeFetch(H) : H, Ce = await t.api(ee);
176
176
  D.value = Ce || {};
177
- const _e = t.afterFetch ? t.afterFetch(Ce) : Ce, Se = _e[T] ?? _e.items ?? _e.list ?? [], xe = _e[F] ?? 0;
178
- u.value = Se, c.value.total = xe, l("fetch-success", { items: Se, total: xe });
179
- } catch (n) {
180
- l("fetch-error", n);
177
+ const ye = t.afterFetch ? t.afterFetch(Ce) : Ce, Fe = ye[I] ?? ye.items ?? ye.list ?? [], Re = ye[M] ?? 0;
178
+ c.value = Fe, u.value.total = Re, l("fetch-success", { items: Fe, total: Re });
179
+ } catch (s) {
180
+ l("fetch-error", s);
181
181
  } finally {
182
- $.value = !1;
182
+ E.value = !1;
183
183
  }
184
- }, se = () => J(void 0), re = (o) => {
185
- d.value.clearSelectOnPageChange && (m.value = []), c.value.pageSize = o, c.value.page = 1, J(void 0);
186
- }, i = (o) => {
187
- d.value.clearSelectOnPageChange && (m.value = []), c.value.page = o, J(void 0);
188
- }, _ = (o, n, f) => l("row-click", o, f), S = (o, n, f) => l("row-dblclick", o, f), C = ({ prop: o, order: n }) => l("sort-change", { prop: o, order: n }), w = (o, n) => l("expand-change", o, n), E = (o) => u.value.findIndex((n) => n[M.value] === o), H = {
184
+ }, ve = () => le(void 0), me = (o) => {
185
+ d.value.clearSelectOnPageChange && (_.value = []), u.value.pageSize = o, u.value.page = 1, le(void 0);
186
+ }, he = (o) => {
187
+ d.value.clearSelectOnPageChange && (_.value = []), u.value.page = o, le(void 0);
188
+ }, _e = (o, s, f) => l("row-click", o, f), be = (o, s, f) => l("row-dblclick", o, f), ge = ({ prop: o, order: s }) => l("sort-change", { prop: o, order: s }), fe = (o, s) => l("expand-change", o, s), ce = (o) => c.value.findIndex((s) => s[$.value] === o), ie = {
189
189
  setProps: (o) => {
190
- B.value = { ...B.value, ...o };
190
+ T.value = { ...T.value, ...o };
191
191
  },
192
- reload: (o) => J(o),
192
+ reload: (o) => le(o),
193
193
  redoHeight: () => {
194
- var o, n;
195
- (n = (o = P.value) == null ? void 0 : o.doLayout) == null || n.call(o);
194
+ var o, s;
195
+ (s = (o = m.value) == null ? void 0 : o.doLayout) == null || s.call(o);
196
196
  },
197
197
  setLoading: (o) => {
198
- $.value = o;
198
+ E.value = o;
199
199
  },
200
- getDataSource: () => u.value,
200
+ getDataSource: () => c.value,
201
201
  getRawDataSource: () => D.value,
202
202
  setTableData: (o) => {
203
- u.value = o ?? [];
203
+ c.value = o ?? [];
204
204
  },
205
- getColumns: () => h.value,
205
+ getColumns: () => b.value,
206
206
  setColumns: (o) => {
207
207
  if (Array.isArray(o) && o.length > 0 && typeof o[0] == "string") {
208
- const n = o, f = (t.columns ?? []).filter((T) => n.includes(T.key ?? T.dataIndex)), b = n.map((T) => f.find((F) => (F.key ?? F.dataIndex) === T)).filter(Boolean);
209
- b.length && (h.value = b);
208
+ const s = o, f = (t.columns ?? []).filter((I) => s.includes(I.key ?? I.dataIndex)), C = s.map((I) => f.find((M) => (M.key ?? M.dataIndex) === I)).filter(Boolean);
209
+ C.length && (b.value = C);
210
210
  } else
211
- h.value = o ?? [];
211
+ b.value = o ?? [];
212
212
  },
213
213
  setPagination: (o) => {
214
- o != null && o.page && (c.value.page = o.page), o != null && o.pageSize && (c.value.pageSize = o.pageSize), (o == null ? void 0 : o.total) !== void 0 && (c.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: () => m.value.map((o) => o[M.value]),
217
- getSelectRows: () => m.value,
216
+ getSelectRowKeys: () => _.value.map((o) => o[$.value]),
217
+ getSelectRows: () => _.value,
218
218
  clearSelectedRowKeys: () => {
219
- m.value = [], Z();
219
+ _.value = [], te();
220
220
  },
221
221
  setSelectedRowKeys: (o) => {
222
- const n = new Set(o), f = u.value.filter((b) => n.has(b[M.value]));
223
- o.forEach((b) => {
224
- f.some((T) => T[M.value] === b) || f.push({ [M.value]: b });
225
- }), m.value = f, Z();
222
+ const s = new Set(o), f = c.value.filter((C) => s.has(C[$.value]));
223
+ o.forEach((C) => {
224
+ f.some((I) => I[$.value] === C) || f.push({ [$.value]: C });
225
+ }), _.value = f, te();
226
226
  },
227
227
  deleteSelectRowByKey: (o) => {
228
- m.value = m.value.filter((n) => n[M.value] !== o), Z();
228
+ _.value = _.value.filter((s) => s[$.value] !== o), te();
229
229
  },
230
- updateTableData: (o, n, f) => {
231
- o < 0 || o >= u.value.length || (u.value = [...u.value], u.value[o] = { ...u.value[o], [n]: f });
230
+ updateTableData: (o, s, f) => {
231
+ o < 0 || o >= c.value.length || (c.value = [...c.value], c.value[o] = { ...c.value[o], [s]: f });
232
232
  },
233
- updateTableDataRecord: (o, n) => {
234
- const f = E(o);
233
+ updateTableDataRecord: (o, s) => {
234
+ const f = ce(o);
235
235
  if (!(f < 0))
236
- return u.value = [...u.value], u.value[f] = { ...u.value[f], ...n }, u.value[f];
236
+ return c.value = [...c.value], c.value[f] = { ...c.value[f], ...s }, c.value[f];
237
237
  },
238
238
  deleteTableDataRecord: (o) => {
239
- const n = Array.isArray(o) ? o : [o], f = new Set(n);
240
- u.value = u.value.filter((b) => !f.has(b[M.value]));
239
+ const s = Array.isArray(o) ? o : [o], f = new Set(s);
240
+ c.value = c.value.filter((C) => !f.has(C[$.value]));
241
241
  },
242
- insertTableDataRecord: (o, n) => {
243
- const f = [...u.value];
244
- return n == null || n >= f.length ? f.push(o) : f.splice(n, 0, o), u.value = f, o;
242
+ insertTableDataRecord: (o, s) => {
243
+ const f = [...c.value];
244
+ return s == null || s >= f.length ? f.push(o) : f.splice(s, 0, o), c.value = f, o;
245
245
  },
246
- getPaginationRef: () => I.value ? { page: c.value.page, pageSize: Number(c.value.pageSize) || 10, total: c.value.total } : !1,
247
- getShowPagination: () => I.value,
246
+ getPaginationRef: () => V.value ? { page: u.value.page, pageSize: Number(u.value.pageSize) || 10, total: u.value.total } : !1,
247
+ getShowPagination: () => V.value,
248
248
  setShowPagination: (o) => {
249
249
  A.value = o;
250
250
  },
251
251
  getRowSelection: () => d.value.rowSelection,
252
252
  expandAll: () => {
253
- var b;
254
- const o = ((b = d.value.treeProps) == null ? void 0 : b.children) ?? "children", n = (T) => {
255
- const F = [];
256
- return T.forEach((V) => {
257
- F.push(V);
258
- const G = V[o];
259
- Array.isArray(G) && G.length > 0 && F.push(...n(G));
260
- }), F;
253
+ var C;
254
+ const o = ((C = d.value.treeProps) == null ? void 0 : C.children) ?? "children", s = (I) => {
255
+ const M = [];
256
+ return I.forEach((H) => {
257
+ M.push(H);
258
+ const ee = H[o];
259
+ Array.isArray(ee) && ee.length > 0 && M.push(...s(ee));
260
+ }), M;
261
261
  };
262
- n(u.value).forEach((T) => {
263
- var F, V;
264
- return (V = (F = P.value) == null ? void 0 : F.toggleRowExpansion) == null ? void 0 : V.call(F, T, !0);
262
+ s(c.value).forEach((I) => {
263
+ var M, H;
264
+ return (H = (M = m.value) == null ? void 0 : M.toggleRowExpansion) == null ? void 0 : H.call(M, I, !0);
265
265
  });
266
266
  },
267
267
  collapseAll: () => {
268
- var b;
269
- const o = ((b = d.value.treeProps) == null ? void 0 : b.children) ?? "children", n = (T) => {
270
- const F = [];
271
- return T.forEach((V) => {
272
- F.push(V);
273
- const G = V[o];
274
- Array.isArray(G) && G.length > 0 && F.push(...n(G));
275
- }), F;
268
+ var C;
269
+ const o = ((C = d.value.treeProps) == null ? void 0 : C.children) ?? "children", s = (I) => {
270
+ const M = [];
271
+ return I.forEach((H) => {
272
+ M.push(H);
273
+ const ee = H[o];
274
+ Array.isArray(ee) && ee.length > 0 && M.push(...s(ee));
275
+ }), M;
276
276
  };
277
- n(u.value).forEach((T) => {
278
- var F, V;
279
- return (V = (F = P.value) == null ? void 0 : F.toggleRowExpansion) == null ? void 0 : V.call(F, T, !1);
277
+ s(c.value).forEach((I) => {
278
+ var M, H;
279
+ return (H = (M = m.value) == null ? void 0 : M.toggleRowExpansion) == null ? void 0 : H.call(M, I, !1);
280
280
  });
281
281
  }
282
282
  };
283
- e(H);
284
- const Q = () => {
285
- h.value = [...t.columns ?? []];
286
- }, ne = () => {
287
- t.api && d.value.immediate !== !1 ? J(void 0) : t.dataSource && (u.value = [...t.dataSource], !t.api && t.pagination !== !1 && (c.value.total = t.dataSource.length));
288
- }, ie = () => {
289
- s.value && (p.value = s.value.offsetWidth || 0);
283
+ e(ie);
284
+ const i = () => {
285
+ b.value = [...t.columns ?? []];
286
+ }, g = () => {
287
+ t.api && d.value.immediate !== !1 ? le(void 0) : t.dataSource && (c.value = [...t.dataSource], !t.api && t.pagination !== !1 && (u.value.total = t.dataSource.length));
288
+ }, P = () => {
289
+ r.value && (y.value = r.value.offsetWidth || 0);
290
290
  };
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));
291
+ let R = null, w = null;
292
+ return pe(() => {
293
+ i(), l("register", ie), g(), typeof window < "u" && (window.addEventListener("resize", P), R = new ResizeObserver(P), Be(() => {
294
+ P(), w = r.value, w && (R == null || R.observe(w));
295
295
  }));
296
- }), Re(() => {
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
- !t.api && t.dataSource && (u.value = [...t.dataSource]);
296
+ }), xe(() => {
297
+ typeof window < "u" && (window.removeEventListener("resize", P), R && w && (R.unobserve(w), w = null));
298
+ }), U(() => t.columns, i, { deep: !0 }), U(() => t.dataSource, () => {
299
+ !t.api && t.dataSource && (c.value = [...t.dataSource]);
300
300
  }, { deep: !0 }), U(() => t.loading, (o) => {
301
- $.value = o ?? !1;
302
- }), { __sfc: !0, DefaultCellRenderer: a, BodyCellRenderer: y, props: t, emit: l, slots: r, tableRef: P, tableWrapRef: s, containerWidth: p, loading: $, innerData: u, rawDataSource: D, innerColumns: h, innerProps: B, selectedRows: m, showPaginationRef: A, pagination: c, getComponentSetting: v, effectiveProps: d, showTitleBar: z, showPagination: I, rowKeyField: M, selectedKeysSet: N, displayColumns: g, fixedColumnsWidth: L, isRatioWidth: O, totalRatio: W, fixedDataColumnsWidth: X, parseWidthPx: K, 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: C, handleExpandChange: w, findRowIndex: E, tableAction: H, syncColumns: Q, loadData: ne, updateContainerWidth: ie, resizeObserver: le, observedEl: oe };
301
+ E.value = o ?? !1;
302
+ }), { __sfc: !0, DefaultCellRenderer: a, BodyCellRenderer: h, props: t, emit: l, slots: n, tableRef: m, tableWrapRef: r, containerWidth: y, loading: E, innerData: c, rawDataSource: D, innerColumns: b, innerProps: T, selectedRows: _, showPaginationRef: A, pagination: u, getComponentSetting: p, effectiveProps: d, showTitleBar: O, showPagination: V, rowKeyField: $, selectedKeysSet: q, displayColumns: F, fixedColumnsWidth: L, isRatioWidth: K, totalRatio: X, fixedDataColumnsWidth: Q, parseWidthPx: G, getColumnWidth: N, shouldShowColumn: J, selectableRows: j, hasSelectableRows: Z, isAllCurrentPageSelected: v, isIndeterminate: z, isRowSelected: B, getCheckboxDisabled: W, getRadioDisabled: Y, emitSelectionChange: te, handleCheckboxChange: se, handleRadioSelect: de, handleSelectAll: re, fetchData: le, handleReload: ve, handleSizeChange: me, handleCurrentChange: he, handleRowClick: _e, handleRowDblclick: be, handleSortChange: ge, handleExpandChange: fe, findRowIndex: ce, tableAction: ie, syncColumns: i, loadData: g, updateContainerWidth: P, resizeObserver: R, observedEl: w };
303
303
  }
304
304
  });
305
- function ae(x, e, l, t, a, y, r, P) {
306
- var s = typeof x == "function" ? x.options : x;
307
- e && (s.render = e, s.staticRenderFns = l, s._compiled = !0), t && (s.functional = !0), y && (s._scopeId = "data-v-" + y);
308
- var p;
309
- if (r ? (p = function(D) {
305
+ function ne(S, e, l, t, a, h, n, m) {
306
+ var r = typeof S == "function" ? S.options : S;
307
+ e && (r.render = e, r.staticRenderFns = l, r._compiled = !0), t && (r.functional = !0), h && (r._scopeId = "data-v-" + h);
308
+ var y;
309
+ if (n ? (y = function(D) {
310
310
  D = D || // cached call
311
311
  this.$vnode && this.$vnode.ssrContext || // stateful
312
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !D && typeof __VUE_SSR_CONTEXT__ < "u" && (D = __VUE_SSR_CONTEXT__), a && a.call(this, D), D && D._registeredComponents && D._registeredComponents.add(r);
313
- }, s._ssrRegister = p) : a && (p = P ? function() {
312
+ this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !D && typeof __VUE_SSR_CONTEXT__ < "u" && (D = __VUE_SSR_CONTEXT__), a && a.call(this, D), D && D._registeredComponents && D._registeredComponents.add(n);
313
+ }, r._ssrRegister = y) : a && (y = m ? function() {
314
314
  a.call(
315
315
  this,
316
- (s.functional ? this.parent : this).$root.$options.shadowRoot
316
+ (r.functional ? this.parent : this).$root.$options.shadowRoot
317
317
  );
318
- } : a), p)
319
- if (s.functional) {
320
- s._injectStyles = p;
321
- var $ = s.render;
322
- s.render = function(h, B) {
323
- return p.call(B), $(h, B);
318
+ } : a), y)
319
+ if (r.functional) {
320
+ r._injectStyles = y;
321
+ var E = r.render;
322
+ r.render = function(b, T) {
323
+ return y.call(T), E(b, T);
324
324
  };
325
325
  } else {
326
- var u = s.beforeCreate;
327
- s.beforeCreate = u ? [].concat(u, p) : [p];
326
+ var c = r.beforeCreate;
327
+ r.beforeCreate = c ? [].concat(c, y) : [y];
328
328
  }
329
329
  return {
330
- exports: x,
331
- options: s
330
+ exports: S,
331
+ options: r
332
332
  };
333
333
  }
334
- var Ie = function() {
335
- var a, y, r, P;
334
+ var Oe = function() {
335
+ var a, h, n, m;
336
336
  var e = this, l = e._self._c, t = e._self._setupProxy;
337
- return l("div", { staticClass: "ecp-pro-table" }, [t.showTitleBar ? l("div", { staticClass: "ecp-pro-table__header" }, [l("div", { staticClass: "ecp-pro-table__title-wrapper" }, [l("span", { staticClass: "ecp-pro-table__title" }, [e._v(e._s(t.effectiveProps.title))]), t.effectiveProps.titleHelpMessage ? l("el-tooltip", { staticClass: "ecp-pro-table__help", attrs: { placement: "top" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.titleHelpMessage) ? l("span", e._l(t.effectiveProps.titleHelpMessage, function(s, p) {
338
- return l("div", { key: p }, [e._v(e._s(s))]);
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(r, y) {
338
+ return l("div", { key: y }, [e._v(e._s(r))]);
339
339
  }), 0) : l("span", [e._v(e._s(t.effectiveProps.titleHelpMessage))])]), l("i", { staticClass: "el-icon-question" })], 2) : e._e()], 1), l("div", { staticClass: "ecp-pro-table__toolbar" }, [e._t("tableTitle"), e._t("toolbar"), e._t("toolbar-right", function() {
340
- var s;
341
- return [((s = t.effectiveProps.tableSetting) == null ? void 0 : s.redo) !== !1 ? l("el-button", { attrs: { type: "text", icon: "el-icon-refresh", size: "small" }, on: { click: t.handleReload } }, [e._v(" 刷新 ")]) : e._e()];
342
- })], 2)]) : e._e(), l("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], ref: "tableWrapRef", staticClass: "ecp-pro-table__body" }, [l("el-table", e._b({ ref: "tableRef", attrs: { data: t.innerData, "row-key": t.effectiveProps.rowKey, border: t.effectiveProps.bordered, stripe: t.effectiveProps.striped, size: t.effectiveProps.size, "max-height": t.effectiveProps.maxHeight, height: t.effectiveProps.height, "default-sort": t.effectiveProps.defaultSort, "span-method": t.effectiveProps.spanMethod, "tree-props": t.effectiveProps.treeProps, "default-expand-all": t.effectiveProps.defaultExpandAll, "expand-row-keys": t.effectiveProps.expandRowKeys || [], lazy: t.effectiveProps.lazy, load: t.effectiveProps.load, "row-class-name": t.effectiveProps.rowClassName }, on: { "row-click": t.handleRowClick, "row-dblclick": t.handleRowDblclick, "sort-change": t.handleSortChange, "expand-change": t.handleExpandChange } }, "el-table", t.effectiveProps.tableProps, !1), [t.effectiveProps.rowSelection ? l("el-table-column", { attrs: { width: t.effectiveProps.rowSelection.width || 48, fixed: t.effectiveProps.rowSelection.fixed, align: "center" }, scopedSlots: e._u([{ key: "header", fn: function(s) {
340
+ var r;
341
+ return [((r = t.effectiveProps.tableSetting) == null ? void 0 : r.redo) !== !1 ? l("el-button", { attrs: { type: "text", icon: "el-icon-refresh", size: "small" }, on: { click: t.handleReload } }, [e._v(" 刷新 ")]) : e._e()];
342
+ })], 2)]) : e._e(), l("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], ref: "tableWrapRef", staticClass: "ecp-pro-table__body" }, [l("el-table", e._b({ ref: "tableRef", attrs: { data: t.innerData, "row-key": t.effectiveProps.rowKey, border: t.effectiveProps.bordered, stripe: t.effectiveProps.striped, size: t.effectiveProps.size, "max-height": t.effectiveProps.maxHeight, height: t.effectiveProps.height, "default-sort": t.effectiveProps.defaultSort, "span-method": t.effectiveProps.spanMethod, "tree-props": t.effectiveProps.treeProps, "default-expand-all": t.effectiveProps.defaultExpandAll, "expand-row-keys": t.effectiveProps.expandRowKeys || [], lazy: t.effectiveProps.lazy, load: t.effectiveProps.load, "row-class-name": t.effectiveProps.rowClassName }, on: { "row-click": t.handleRowClick, "row-dblclick": t.handleRowDblclick, "sort-change": t.handleSortChange, "expand-change": t.handleExpandChange } }, "el-table", t.effectiveProps.tableProps, !1), [t.effectiveProps.rowSelection ? l("el-table-column", { attrs: { width: t.effectiveProps.rowSelection.width || 48, fixed: t.effectiveProps.rowSelection.fixed, align: "center" }, scopedSlots: e._u([{ key: "header", fn: function(r) {
343
343
  return [t.effectiveProps.rowSelection.type !== "radio" ? l("el-checkbox", { attrs: { value: t.isAllCurrentPageSelected, indeterminate: t.isIndeterminate, disabled: !t.hasSelectableRows }, on: { change: t.handleSelectAll } }) : l("span")];
344
- } }, { key: "default", fn: function(s) {
345
- var p;
346
- return [t.effectiveProps.rowSelection.type !== "radio" ? l("el-checkbox", { attrs: { value: t.isRowSelected(s.row), disabled: t.getCheckboxDisabled(s.row) }, on: { change: ($) => t.handleCheckboxChange(s.row, $) }, nativeOn: { click: function($) {
347
- $.stopPropagation();
348
- } } }) : l("el-radio", { attrs: { value: (p = t.selectedRows[0]) == null ? void 0 : p[t.rowKeyField], label: s.row[t.rowKeyField], disabled: t.getRadioDisabled(s.row) }, on: { change: function($) {
349
- return t.handleRadioSelect(s.row);
350
- } }, nativeOn: { click: function($) {
351
- $.stopPropagation();
344
+ } }, { key: "default", fn: function(r) {
345
+ var y;
346
+ return [t.effectiveProps.rowSelection.type !== "radio" ? l("el-checkbox", { attrs: { value: t.isRowSelected(r.row), disabled: t.getCheckboxDisabled(r.row) }, on: { change: (E) => t.handleCheckboxChange(r.row, E) }, nativeOn: { click: function(E) {
347
+ E.stopPropagation();
348
+ } } }) : l("el-radio", { attrs: { value: (y = t.selectedRows[0]) == null ? void 0 : y[t.rowKeyField], label: r.row[t.rowKeyField], disabled: t.getRadioDisabled(r.row) }, on: { change: function(E) {
349
+ return t.handleRadioSelect(r.row);
350
+ } }, nativeOn: { click: function(E) {
351
+ E.stopPropagation();
352
352
  } } }, [l("span")])];
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: ((P = t.effectiveProps.indexColumnProps) == null ? void 0 : P.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(s) {
354
- return [t.shouldShowColumn(s) ? l("el-table-column", { key: s.dataIndex || s.key || s.title, attrs: { prop: s.dataIndex, label: s.title, width: t.getColumnWidth(s), "min-width": t.isRatioWidth(s.width) ? void 0 : s.minWidth, fixed: s.fixed, align: s.align || "left", sortable: s.sortable, formatter: s.formatter, "show-overflow-tooltip": s.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(p) {
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($, u) {
356
- return l("div", { key: u }, [e._v(e._s($))]);
357
- }), 0) : l("span", [e._v(e._s(s.helpMessage))])]), l("i", { staticClass: "el-icon-question" })], 2) : e._e()]];
358
- } }, { key: "default", fn: function(p) {
359
- return [s.dataIndex && e.$scopedSlots[s.dataIndex] ? e._t(s.dataIndex, null, { row: p.row, column: s, index: p.$index, value: p.row[s.dataIndex] }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: s, record: p.row, index: p.$index, value: p.row[s.dataIndex], "custom-render": s.customRender, "value-enum": s.valueEnum } }) : l(t.DefaultCellRenderer, { attrs: { column: s, record: p.row, index: p.$index, value: p.row[s.dataIndex] } })];
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: ((h = t.effectiveProps.indexColumnProps) == null ? void 0 : h.width) || 60, fixed: (n = t.effectiveProps.indexColumnProps) == null ? void 0 : n.fixed, align: ((m = t.effectiveProps.indexColumnProps) == null ? void 0 : m.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(r) {
354
+ return [t.shouldShowColumn(r) ? l("el-table-column", { key: r.dataIndex || r.key || r.title, attrs: { prop: r.dataIndex, label: r.title, width: t.getColumnWidth(r), "min-width": t.isRatioWidth(r.width) ? void 0 : r.minWidth, fixed: r.fixed, align: r.align || "left", sortable: r.sortable, formatter: r.formatter, "show-overflow-tooltip": r.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(y) {
355
+ return [r.dataIndex && e.$scopedSlots[`header-${r.dataIndex}`] ? e._t(`header-${r.dataIndex}`, null, { column: r }) : e.$scopedSlots.headerCell ? e._t("headerCell", null, { column: r }) : [l("span", [e._v(e._s(r.title))]), r.helpMessage ? l("el-tooltip", { staticClass: "ecp-pro-table__col-help", attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(r.helpMessage) ? l("span", e._l(r.helpMessage, function(E, c) {
356
+ return l("div", { key: c }, [e._v(e._s(E))]);
357
+ }), 0) : l("span", [e._v(e._s(r.helpMessage))])]), l("i", { staticClass: "el-icon-question" })], 2) : e._e()]];
358
+ } }, { key: "default", fn: function(y) {
359
+ return [r.dataIndex && e.$scopedSlots[r.dataIndex] ? e._t(r.dataIndex, null, { row: y.row, column: r, index: y.$index, value: y.row[r.dataIndex] }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: r, record: y.row, index: y.$index, value: y.row[r.dataIndex], "custom-render": r.customRender, "value-enum": r.valueEnum } }) : l(t.DefaultCellRenderer, { attrs: { column: r, record: y.row, index: y.$index, value: y.row[r.dataIndex] } })];
360
360
  } }], null, !0) }) : e._e()];
361
- }), t.effectiveProps.actionColumn ? l("el-table-column", { attrs: { label: t.effectiveProps.actionColumn.title || "操作", width: t.effectiveProps.actionColumn.width || 150, fixed: t.effectiveProps.actionColumn.fixed || "right", align: t.effectiveProps.actionColumn.align || "center" }, scopedSlots: e._u([{ key: "default", fn: function(s) {
362
- return [e.$scopedSlots.action ? e._t("action", null, { record: s.row, column: t.effectiveProps.actionColumn, index: s.$index }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: s.row, index: s.$index, value: void 0, "custom-render": t.effectiveProps.actionColumn.customRender, "value-enum": t.effectiveProps.actionColumn.valueEnum } }) : e._e()];
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(r) {
362
+ return [e.$scopedSlots.action ? e._t("action", null, { record: r.row, column: t.effectiveProps.actionColumn, index: r.$index }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: r.row, index: r.$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
- }, Le = [], Oe = /* @__PURE__ */ ae(
365
- Ee,
364
+ }, Ve = [], Le = /* @__PURE__ */ ne(
366
365
  Ie,
367
- Le,
366
+ Oe,
367
+ Ve,
368
368
  !1,
369
369
  null,
370
370
  "c5638c20",
371
371
  null,
372
372
  null
373
373
  );
374
- const Ae = Oe.exports, Ve = /* @__PURE__ */ ee({
374
+ const Ae = Le.exports, We = /* @__PURE__ */ ae({
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(x) {
382
- const e = x, 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((B) => {
383
- const { ifShow: m } = B;
384
- return typeof m == "boolean" ? m : typeof m == "function" ? m(B) : !0;
385
- }), y = R(() => a(e.actions || [])), r = R(() => a(e.dropDownActions || [])), P = (h, B) => {
386
- var m;
387
- e.stopButtonPropagation && B.stopPropagation(), (m = h.onClick) == null || m.call(h, B);
388
- }, s = (h, B) => {
389
- P(h, B);
390
- }, p = (h, B, m) => {
391
- var A, c, v, d;
392
- e.stopButtonPropagation && m.stopPropagation(), h.popConfirm && (B === "confirm" ? (c = (A = h.popConfirm).confirm) == null || c.call(A) : (d = (v = h.popConfirm).cancel) == null || d.call(v));
381
+ setup(S) {
382
+ const e = S, l = (b) => b ? typeof b == "string" ? { content: b } : b : {}, t = (b) => b.type ? b.type : b.color === "error" ? "danger" : b.color === "success" ? "success" : b.color === "warning" ? "warning" : "text", a = (b) => b.filter((T) => {
383
+ const { ifShow: _ } = T;
384
+ return typeof _ == "boolean" ? _ : typeof _ == "function" ? _(T) : !0;
385
+ }), h = x(() => a(e.actions || [])), n = x(() => a(e.dropDownActions || [])), m = (b, T) => {
386
+ var _;
387
+ e.stopButtonPropagation && T.stopPropagation(), (_ = b.onClick) == null || _.call(b, T);
388
+ }, r = (b, T) => {
389
+ m(b, T);
390
+ }, y = (b, T, _) => {
391
+ var A, u, p, d;
392
+ e.stopButtonPropagation && _.stopPropagation(), b.popConfirm && (T === "confirm" ? (u = (A = b.popConfirm).confirm) == null || u.call(A) : (d = (p = b.popConfirm).cancel) == null || d.call(p));
393
393
  };
394
- return { __sfc: !0, props: e, normalizeTooltip: l, getButtonType: t, filterVisible: a, visibleActions: y, visibleDropDownActions: r, handleClick: P, handleActionClick: s, handlePopConfirm: p, handlePopConfirmConfirm: (h, B) => {
395
- p(h, "confirm", B);
396
- }, handlePopConfirmCancel: (h, B) => {
397
- p(h, "cancel", B);
398
- }, handleDropdownCommand: (h) => {
394
+ return { __sfc: !0, props: e, normalizeTooltip: l, getButtonType: t, filterVisible: a, visibleActions: h, visibleDropDownActions: n, handleClick: m, handleActionClick: r, handlePopConfirm: y, handlePopConfirmConfirm: (b, T) => {
395
+ y(b, "confirm", T);
396
+ }, handlePopConfirmCancel: (b, T) => {
397
+ y(b, "cancel", T);
398
+ }, handleDropdownCommand: (b) => {
399
399
  var A;
400
- const B = Number(h), m = r.value[B];
401
- if (!(!m || m.disabled)) {
402
- if (m.popConfirm) {
403
- const c = m.popConfirm.title, v = m.popConfirm.okText || "确定", d = m.popConfirm.cancelText || "取消";
404
- ze.confirm(c, "提示", {
405
- confirmButtonText: v,
400
+ const T = Number(b), _ = n.value[T];
401
+ if (!(!_ || _.disabled)) {
402
+ if (_.popConfirm) {
403
+ const u = _.popConfirm.title, p = _.popConfirm.okText || "确定", d = _.popConfirm.cancelText || "取消";
404
+ Ee.confirm(u, "提示", {
405
+ confirmButtonText: p,
406
406
  cancelButtonText: d,
407
407
  type: "warning"
408
408
  }).then(() => {
409
- var z, I;
410
- return (I = (z = m.popConfirm) == null ? void 0 : z.confirm) == null ? void 0 : I.call(z);
409
+ var O, V;
410
+ return (V = (O = _.popConfirm) == null ? void 0 : O.confirm) == null ? void 0 : V.call(O);
411
411
  }).catch(() => {
412
- var z, I;
413
- return (I = (z = m.popConfirm) == null ? void 0 : z.cancel) == null ? void 0 : I.call(z);
412
+ var O, V;
413
+ return (V = (O = _.popConfirm) == null ? void 0 : O.cancel) == null ? void 0 : V.call(O);
414
414
  });
415
415
  return;
416
416
  }
417
- (A = m.onClick) == null || A.call(m, {});
417
+ (A = _.onClick) == null || A.call(_, {});
418
418
  }
419
419
  } };
420
420
  }
421
421
  });
422
422
  var Ke = function() {
423
423
  var e = this, l = e._self._c, t = e._self._setupProxy;
424
- return l("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(a, y) {
425
- 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: function(r) {
426
- return t.handlePopConfirmConfirm(a, r);
427
- }, cancel: function(r) {
428
- return t.handlePopConfirmCancel(a, r);
429
- } } }, [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: function(r) {
430
- return t.handleActionClick(a, r);
431
- } } }, "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: function(r) {
432
- return t.handleActionClick(a, r);
424
+ return l("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(a, h) {
425
+ return l("span", { key: `action-${h}`, 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: function(n) {
426
+ return t.handlePopConfirmConfirm(a, n);
427
+ }, cancel: function(n) {
428
+ return t.handlePopConfirmCancel(a, n);
429
+ } } }, [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: function(n) {
430
+ return t.handleActionClick(a, n);
431
+ } } }, "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: function(n) {
432
+ return t.handleActionClick(a, n);
433
433
  } } }, "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);
434
- }), 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) {
435
- 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))])])]);
434
+ }), 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, h) {
435
+ return l("el-dropdown-item", { key: `dropdown-${h}`, attrs: { command: h, 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))])])]);
436
436
  }), 1)], 1) : e._e()], 2);
437
- }, Ne = [], We = /* @__PURE__ */ ae(
438
- Ve,
437
+ }, Ne = [], qe = /* @__PURE__ */ ne(
438
+ We,
439
439
  Ke,
440
440
  Ne,
441
441
  !1,
@@ -444,59 +444,59 @@ var Ke = function() {
444
444
  null,
445
445
  null
446
446
  );
447
- const ke = We.exports;
448
- function ht(x) {
449
- const e = k(null), l = () => x ? ye(x) : void 0, t = () => {
450
- const r = ye(e);
451
- if (!r)
447
+ const ke = qe.exports;
448
+ function wt(S) {
449
+ const e = k(null), l = () => S ? ue(S) : void 0, t = () => {
450
+ const n = ue(e);
451
+ if (!n)
452
452
  throw new Error("ProTable instance has not been registered");
453
- return r;
454
- }, a = (r) => {
455
- e.value = r;
456
- const P = l();
457
- P && Object.keys(P).length > 0 && r.setProps(P);
453
+ return n;
454
+ }, a = (n) => {
455
+ e.value = n;
456
+ const m = l();
457
+ m && Object.keys(m).length > 0 && n.setProps(m);
458
458
  };
459
- return x && U(
459
+ return S && U(
460
460
  () => l(),
461
- (r) => {
462
- r && e.value && e.value.setProps(r);
461
+ (n) => {
462
+ n && e.value && e.value.setProps(n);
463
463
  },
464
464
  { deep: !0 }
465
465
  ), [a, {
466
- setProps: (r) => t().setProps(r),
467
- reload: (r) => t().reload(r),
466
+ setProps: (n) => t().setProps(n),
467
+ reload: (n) => t().reload(n),
468
468
  redoHeight: () => t().redoHeight(),
469
- setLoading: (r) => t().setLoading(r),
469
+ setLoading: (n) => t().setLoading(n),
470
470
  getDataSource: () => t().getDataSource(),
471
471
  getRawDataSource: () => t().getRawDataSource(),
472
- setTableData: (r) => t().setTableData(r),
472
+ setTableData: (n) => t().setTableData(n),
473
473
  getColumns: () => t().getColumns(),
474
- setColumns: (r) => t().setColumns(r),
475
- setPagination: (r) => t().setPagination(r),
474
+ setColumns: (n) => t().setColumns(n),
475
+ setPagination: (n) => t().setPagination(n),
476
476
  getSelectRowKeys: () => t().getSelectRowKeys(),
477
477
  getSelectRows: () => t().getSelectRows(),
478
478
  clearSelectedRowKeys: () => t().clearSelectedRowKeys(),
479
- setSelectedRowKeys: (r) => t().setSelectedRowKeys(r),
480
- deleteSelectRowByKey: (r) => t().deleteSelectRowByKey(r),
481
- updateTableData: (r, P, s) => t().updateTableData(r, P, s),
482
- updateTableDataRecord: (r, P) => t().updateTableDataRecord(r, P),
483
- deleteTableDataRecord: (r) => t().deleteTableDataRecord(r),
484
- insertTableDataRecord: (r, P) => t().insertTableDataRecord(r, P),
479
+ setSelectedRowKeys: (n) => t().setSelectedRowKeys(n),
480
+ deleteSelectRowByKey: (n) => t().deleteSelectRowByKey(n),
481
+ updateTableData: (n, m, r) => t().updateTableData(n, m, r),
482
+ updateTableDataRecord: (n, m) => t().updateTableDataRecord(n, m),
483
+ deleteTableDataRecord: (n) => t().deleteTableDataRecord(n),
484
+ insertTableDataRecord: (n, m) => t().insertTableDataRecord(n, m),
485
485
  getPaginationRef: () => t().getPaginationRef(),
486
486
  getShowPagination: () => t().getShowPagination(),
487
- setShowPagination: (r) => t().setShowPagination(r),
487
+ setShowPagination: (n) => t().setShowPagination(n),
488
488
  getRowSelection: () => t().getRowSelection(),
489
489
  expandAll: () => {
490
- var r, P;
491
- return (P = (r = t()).expandAll) == null ? void 0 : P.call(r);
490
+ var n, m;
491
+ return (m = (n = t()).expandAll) == null ? void 0 : m.call(n);
492
492
  },
493
493
  collapseAll: () => {
494
- var r, P;
495
- return (P = (r = t()).collapseAll) == null ? void 0 : P.call(r);
494
+ var n, m;
495
+ return (m = (n = t()).collapseAll) == null ? void 0 : m.call(n);
496
496
  }
497
497
  }];
498
498
  }
499
- const qe = /* @__PURE__ */ ee({
499
+ const je = /* @__PURE__ */ ae({
500
500
  __name: "ApiSelect",
501
501
  props: {
502
502
  value: null,
@@ -512,19 +512,19 @@ const qe = /* @__PURE__ */ ee({
512
512
  multiple: { type: Boolean }
513
513
  },
514
514
  emits: ["input"],
515
- setup(x) {
516
- const e = x, l = k(!1), t = k([]), a = (r) => {
517
- e.lazy && r && y();
518
- }, y = async () => {
515
+ setup(S) {
516
+ const e = S, l = k(!1), t = k([]), a = (n) => {
517
+ e.lazy && n && h();
518
+ }, h = async () => {
519
519
  if (e.api) {
520
520
  l.value = !0;
521
521
  try {
522
- const r = await e.api(e.params), P = Array.isArray(r) ? r : (r == null ? void 0 : r.list) ?? (r == null ? void 0 : r.data) ?? [], s = e.labelField ?? "label", p = e.valueField ?? "value";
523
- t.value = P.map(($) => {
524
- const u = $;
522
+ const n = await e.api(e.params), m = Array.isArray(n) ? n : (n == null ? void 0 : n.list) ?? (n == null ? void 0 : n.data) ?? [], r = e.labelField ?? "label", y = e.valueField ?? "value";
523
+ t.value = m.map((E) => {
524
+ const c = E;
525
525
  return {
526
- label: String(u[s] ?? u.label ?? ""),
527
- value: u[p] ?? u.value
526
+ label: String(c[r] ?? c.label ?? ""),
527
+ value: c[y] ?? c.value
528
528
  };
529
529
  });
530
530
  } finally {
@@ -532,37 +532,37 @@ const qe = /* @__PURE__ */ ee({
532
532
  }
533
533
  }
534
534
  };
535
- return we(() => {
536
- e.lazy || y();
535
+ return pe(() => {
536
+ e.lazy || h();
537
537
  }), U(
538
538
  () => e.api,
539
539
  () => {
540
- e.lazy ? t.value = [] : y();
540
+ e.lazy ? t.value = [] : h();
541
541
  },
542
542
  { deep: !0 }
543
543
  ), U(() => e.params, () => {
544
- e.lazy ? t.value = [] : y();
545
- }, { deep: !0 }), { __sfc: !0, props: e, loading: l, options: t, onVisibleChange: a, fetchOptions: y };
544
+ e.lazy ? t.value = [] : h();
545
+ }, { deep: !0 }), { __sfc: !0, props: e, loading: l, options: t, onVisibleChange: a, fetchOptions: h };
546
546
  }
547
547
  });
548
- var je = function() {
548
+ var He = function() {
549
549
  var e = this, l = e._self._c, t = e._self._setupProxy;
550
550
  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) {
551
551
  return e.$emit("input", a);
552
552
  }, "visible-change": t.onVisibleChange } }, "el-select", e.$attrs, !1), e._l(t.options, function(a) {
553
553
  return l("el-option", { key: String(a.value), attrs: { label: a.label, value: a.value } });
554
554
  }), 1);
555
- }, He = [], Ge = /* @__PURE__ */ ae(
556
- qe,
555
+ }, Ge = [], Ue = /* @__PURE__ */ ne(
557
556
  je,
558
557
  He,
558
+ Ge,
559
559
  !1,
560
560
  null,
561
561
  null,
562
562
  null,
563
563
  null
564
564
  );
565
- const Ue = Ge.exports, Xe = /* @__PURE__ */ ee({
565
+ const Xe = Ue.exports, Je = /* @__PURE__ */ ae({
566
566
  __name: "TreeSelect",
567
567
  props: {
568
568
  value: null,
@@ -579,87 +579,87 @@ const Ue = Ge.exports, Xe = /* @__PURE__ */ ee({
579
579
  clearable: { type: Boolean }
580
580
  },
581
581
  emits: ["input"],
582
- setup(x, { emit: e }) {
583
- const l = x, t = k(), a = k(), y = k(!1), r = k(!1), P = k(""), s = k([]), p = k({}), $ = R(() => ({
582
+ setup(S, { emit: e }) {
583
+ const l = S, t = k(), a = k(), h = k(!1), n = k(!1), m = k(""), r = k([]), y = k({}), E = x(() => ({
584
584
  label: l.labelField,
585
585
  children: l.childrenField
586
586
  }));
587
- function u(g) {
588
- const L = l.labelField ?? "label", O = l.valueField ?? "value", W = l.childrenField ?? "children", X = g[W], K = {};
589
- return K[l.labelField ?? "label"] = g[L] ?? g.label, K[l.valueField ?? "value"] = g[O] ?? g.value, Array.isArray(X) && X.length && (K[l.childrenField ?? "children"] = X.map((q) => u(q))), K;
587
+ function c(F) {
588
+ const L = l.labelField ?? "label", K = l.valueField ?? "value", X = l.childrenField ?? "children", Q = F[X], G = {};
589
+ return G[l.labelField ?? "label"] = F[L] ?? F.label, G[l.valueField ?? "value"] = F[K] ?? F.value, Array.isArray(Q) && Q.length && (G[l.childrenField ?? "children"] = Q.map((N) => c(N))), G;
590
590
  }
591
- function D(g, L = "") {
592
- const O = {}, W = l.labelField ?? "label", X = l.valueField ?? "value", K = l.childrenField ?? "children";
593
- for (const q of g) {
594
- const Y = String(q[W] ?? q.label ?? ""), j = q[X] ?? q.value;
595
- j != null && (O[String(j)] = L ? L + " / " + Y : Y);
596
- const te = q[K] ?? q.children;
597
- Array.isArray(te) && te.length && Object.assign(O, D(te, Y));
591
+ function D(F, L = "") {
592
+ const K = {}, X = l.labelField ?? "label", Q = l.valueField ?? "value", G = l.childrenField ?? "children";
593
+ for (const N of F) {
594
+ const J = String(N[X] ?? N.label ?? ""), j = N[Q] ?? N.value;
595
+ j != null && (K[String(j)] = L ? L + " / " + J : J);
596
+ const Z = N[G] ?? N.children;
597
+ Array.isArray(Z) && Z.length && Object.assign(K, D(Z, J));
598
598
  }
599
- return O;
599
+ return K;
600
600
  }
601
- function h() {
602
- const g = l.treeData;
603
- return Array.isArray(g) && g.length > 0;
601
+ function b() {
602
+ const F = l.treeData;
603
+ return Array.isArray(F) && F.length > 0;
604
604
  }
605
- function B(g) {
606
- s.value = g, p.value = D(g);
605
+ function T(F) {
606
+ r.value = F, y.value = D(F);
607
607
  }
608
- function m() {
609
- const g = l.treeData;
610
- if (!Array.isArray(g) || g.length === 0)
608
+ function _() {
609
+ const F = l.treeData;
610
+ if (!Array.isArray(F) || F.length === 0)
611
611
  return;
612
- const L = g.map((O) => u(O));
613
- B(L);
612
+ const L = F.map((K) => c(K));
613
+ T(L);
614
614
  }
615
- const A = R(() => l.value == null || l.value === "" ? "" : p.value[String(l.value)] ?? String(l.value)), c = (g, L) => {
616
- if (!g)
615
+ const A = x(() => l.value == null || l.value === "" ? "" : y.value[String(l.value)] ?? String(l.value)), u = (F, L) => {
616
+ if (!F)
617
617
  return !0;
618
- const O = l.labelField ?? "label";
619
- return String(L[O] ?? L.label ?? "").toLowerCase().includes(g.toLowerCase());
618
+ const K = l.labelField ?? "label";
619
+ return String(L[K] ?? L.label ?? "").toLowerCase().includes(F.toLowerCase());
620
620
  };
621
- U(P, (g) => {
621
+ U(m, (F) => {
622
622
  var L;
623
- (L = a.value) == null || L.filter(g);
623
+ (L = a.value) == null || L.filter(F);
624
624
  });
625
- let v = null;
625
+ let p = null;
626
626
  function d() {
627
- l.disabled || (y.value = !0, l.lazy && !h() && N(), Fe(() => {
628
- v = (g) => {
629
- t.value && !t.value.contains(g.target) && z();
630
- }, document.addEventListener("click", v);
627
+ l.disabled || (h.value = !0, l.lazy && !b() && q(), Be(() => {
628
+ p = (F) => {
629
+ t.value && !t.value.contains(F.target) && O();
630
+ }, document.addEventListener("click", p);
631
631
  }));
632
632
  }
633
- function z() {
634
- y.value = !1, P.value = "", v && (document.removeEventListener("click", v), v = null);
633
+ function O() {
634
+ h.value = !1, m.value = "", p && (document.removeEventListener("click", p), p = null);
635
635
  }
636
- function I() {
636
+ function V() {
637
637
  e("input", void 0);
638
638
  }
639
- function M(g) {
640
- const L = l.valueField ?? "value", O = g[L] ?? g.value;
641
- e("input", O), z();
639
+ function $(F) {
640
+ const L = l.valueField ?? "value", K = F[L] ?? F.value;
641
+ e("input", K), O();
642
642
  }
643
- async function N() {
644
- if (!(!l.api || h())) {
645
- r.value = !0;
643
+ async function q() {
644
+ if (!(!l.api || b())) {
645
+ n.value = !0;
646
646
  try {
647
- const g = await l.api(l.params), L = Array.isArray(g) ? g : (g == null ? void 0 : g.list) ?? (g == null ? void 0 : g.data) ?? [];
648
- s.value = L.map((O) => u(O)), p.value = D(s.value);
647
+ const F = await l.api(l.params), L = Array.isArray(F) ? F : (F == null ? void 0 : F.list) ?? (F == null ? void 0 : F.data) ?? [];
648
+ r.value = L.map((K) => c(K)), y.value = D(r.value);
649
649
  } finally {
650
- r.value = !1;
650
+ n.value = !1;
651
651
  }
652
652
  }
653
653
  }
654
- return we(() => {
655
- h() ? m() : l.lazy || N();
654
+ return pe(() => {
655
+ b() ? _() : l.lazy || q();
656
656
  }), U(() => l.treeData, () => {
657
- h() ? m() : (s.value = [], p.value = {}, !l.lazy && l.api && N());
657
+ b() ? _() : (r.value = [], y.value = {}, !l.lazy && l.api && q());
658
658
  }, { deep: !0 }), U(() => l.api, () => {
659
- h() || (l.lazy ? (s.value = [], p.value = {}) : N());
659
+ b() || (l.lazy ? (r.value = [], y.value = {}) : q());
660
660
  }, { deep: !0 }), U(() => l.params, () => {
661
- h() || (l.lazy ? (s.value = [], p.value = {}) : N());
662
- }, { deep: !0 }), { __sfc: !0, props: l, emit: e, rootRef: t, treeRef: a, dropdownVisible: y, loading: r, filterText: P, treeData: s, flatLabelMap: p, treeProps: $, normalizeNode: u, buildFlatLabelMap: D, hasTreeDataProp: h, applyTreeData: B, syncFromTreeDataProp: m, displayText: A, filterNodeMethod: c, clickOutsideHandler: v, openDropdown: d, closeDropdown: z, clearValue: I, onNodeClick: M, fetchData: N };
661
+ b() || (l.lazy ? (r.value = [], y.value = {}) : q());
662
+ }, { deep: !0 }), { __sfc: !0, props: l, emit: e, rootRef: t, treeRef: a, dropdownVisible: h, loading: n, filterText: m, treeData: r, flatLabelMap: y, treeProps: E, normalizeNode: c, buildFlatLabelMap: D, hasTreeDataProp: b, applyTreeData: T, syncFromTreeDataProp: _, displayText: A, filterNodeMethod: u, clickOutsideHandler: p, openDropdown: d, closeDropdown: O, clearValue: V, onNodeClick: $, fetchData: q };
663
663
  }
664
664
  });
665
665
  var Ze = function() {
@@ -669,17 +669,17 @@ var Ze = function() {
669
669
  } }, model: { value: t.filterText, callback: function(a) {
670
670
  t.filterText = a;
671
671
  }, 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);
672
- }, Je = [], Qe = /* @__PURE__ */ ae(
673
- Xe,
674
- Ze,
672
+ }, Qe = [], Ye = /* @__PURE__ */ ne(
675
673
  Je,
674
+ Ze,
675
+ Qe,
676
676
  !1,
677
677
  null,
678
678
  "f30bba11",
679
679
  null,
680
680
  null
681
681
  );
682
- const Ye = Qe.exports, et = /* @__PURE__ */ ee({
682
+ const et = Ye.exports, tt = /* @__PURE__ */ ae({
683
683
  __name: "ProFormItem",
684
684
  props: {
685
685
  schema: null,
@@ -687,10 +687,11 @@ const Ye = Qe.exports, et = /* @__PURE__ */ ee({
687
687
  formDisabled: { type: Boolean },
688
688
  autoPlaceholder: { type: Boolean },
689
689
  formActionType: null,
690
+ onFieldChange: null,
690
691
  customComponents: null
691
692
  },
692
- setup(x) {
693
- const e = x, l = /* @__PURE__ */ new Set([
693
+ setup(S) {
694
+ const e = S, l = /* @__PURE__ */ new Set([
694
695
  "input",
695
696
  "select",
696
697
  "api-select",
@@ -702,64 +703,65 @@ const Ye = Qe.exports, et = /* @__PURE__ */ ee({
702
703
  "cascader",
703
704
  "checkbox",
704
705
  "radio"
705
- ]), t = Pe(), a = R(() => ({
706
+ ]), t = Pe(), a = x(() => ({
706
707
  schema: e.schema,
707
708
  values: e.formModel,
708
709
  model: e.formModel,
709
710
  field: e.schema.field
710
- })), y = R(() => {
711
- const c = e.schema.ifShow;
712
- return c === void 0 ? !0 : typeof c == "boolean" ? c : c(a.value);
713
- }), r = R(() => {
714
- const c = e.schema.show;
715
- return c === void 0 ? !0 : typeof c == "boolean" ? c : c(a.value);
716
- }), P = R(() => {
711
+ })), h = x(() => {
712
+ const u = e.schema.ifShow;
713
+ return u === void 0 ? !0 : typeof u == "boolean" ? u : u(a.value);
714
+ }), n = x(() => {
715
+ const u = e.schema.show;
716
+ return u === void 0 ? !0 : typeof u == "boolean" ? u : u(a.value);
717
+ }), m = x(() => {
717
718
  if (e.formDisabled)
718
719
  return !0;
719
- const c = e.schema.dynamicDisabled;
720
- return c === void 0 ? !1 : typeof c == "boolean" ? c : c(a.value);
721
- }), s = R(() => {
722
- const c = e.schema.dynamicRules;
723
- return c ? Array.isArray(c) ? c : c(a.value) : e.schema.rules;
724
- }), p = R(() => {
725
- const c = e.schema.componentProps;
726
- if (!c)
720
+ const u = e.schema.dynamicDisabled;
721
+ return u === void 0 ? !1 : typeof u == "boolean" ? u : u(a.value);
722
+ }), r = x(() => {
723
+ const u = e.schema.dynamicRules;
724
+ return u ? Array.isArray(u) ? u : u(a.value) : e.schema.rules;
725
+ }), y = x(() => {
726
+ const u = e.schema.componentProps;
727
+ if (!u)
727
728
  return { props: {}, listeners: {} };
728
- const v = typeof c == "function" ? c({
729
+ const p = typeof u == "function" ? u({
729
730
  ...a.value,
730
731
  formActionType: e.formActionType
731
- }) : { ...c }, d = {}, z = {};
732
- for (const [I, M] of Object.entries(v))
733
- if (I.length > 2 && /^on[A-Za-z]/.test(I) && typeof M == "function") {
734
- const N = I.slice(2).charAt(0).toLowerCase() + I.slice(3);
735
- z[N] = M;
732
+ }) : { ...u }, d = {}, O = {};
733
+ for (const [V, $] of Object.entries(p))
734
+ if (V.length > 2 && /^on[A-Za-z]/.test(V) && typeof $ == "function") {
735
+ const q = V.slice(2).charAt(0).toLowerCase() + V.slice(3);
736
+ O[q] = $;
736
737
  } else
737
- d[I] = M;
738
- return { props: d, listeners: z };
739
- }), $ = R(() => p.value.props), u = R(() => p.value.listeners), D = R(() => !!t.default), h = (c) => {
740
- const v = c == null ? void 0 : c.options;
741
- return Array.isArray(v) ? v : void 0;
742
- }, B = R(() => {
743
- const c = e.schema.component;
744
- return c == null ? null : typeof c == "string" ? l.has(c) ? null : e.customComponents && e.customComponents[c] || c : c;
745
- }), m = (c) => {
746
- e.formModel[e.schema.field] = c;
747
- }, A = R(() => {
748
- const c = e.schema.render;
749
- return c ? {
738
+ d[V] = $;
739
+ return { props: d, listeners: O };
740
+ }), E = x(() => y.value.props), c = x(() => y.value.listeners), D = x(() => !!t.default), b = (u) => {
741
+ const p = u == null ? void 0 : u.options;
742
+ return Array.isArray(p) ? p : void 0;
743
+ }, T = x(() => {
744
+ const u = e.schema.component;
745
+ return u == null ? null : typeof u == "string" ? l.has(u) ? null : e.customComponents && e.customComponents[u] || u : u;
746
+ }), _ = (u) => {
747
+ var p;
748
+ (p = e.onFieldChange) == null || p.call(e, e.schema.field, u);
749
+ }, A = x(() => {
750
+ const u = e.schema.render;
751
+ return u ? {
750
752
  render() {
751
- const v = c(a.value);
752
- return Array.isArray(v) ? ce("span", v) : v;
753
+ const p = u(a.value);
754
+ return Array.isArray(p) ? oe("span", p) : p;
753
755
  }
754
756
  } : null;
755
757
  });
756
- return { __sfc: !0, BUILT_IN_COMPONENTS: l, props: e, slots: t, renderParams: a, shouldRender: y, shouldShow: r, effectiveDisabled: P, effectiveRules: s, effectiveComponentPropsAndListeners: p, effectiveComponentProps: $, effectiveComponentListeners: u, hasSlot: D, getOptions: h, resolvedCustomComponent: B, setFieldValue: m, renderComponent: A, ApiSelect: Ue, TreeSelect: Ye };
758
+ return { __sfc: !0, BUILT_IN_COMPONENTS: l, props: e, slots: t, renderParams: a, shouldRender: h, shouldShow: n, effectiveDisabled: m, effectiveRules: r, effectiveComponentPropsAndListeners: y, effectiveComponentProps: E, effectiveComponentListeners: c, hasSlot: D, getOptions: b, resolvedCustomComponent: T, setFieldValue: _, renderComponent: A, ApiSelect: Xe, TreeSelect: et };
757
759
  }
758
760
  });
759
- var tt = function() {
761
+ var lt = function() {
760
762
  var e = this, l = e._self._c, t = e._self._setupProxy;
761
- 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, "label-width": e.schema.labelWidth } }, [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) {
762
- return l("div", { key: y, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(a) + " ")]);
763
+ 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, "label-width": e.schema.labelWidth } }, [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, h) {
764
+ return l("div", { key: h, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(a) + " ")]);
763
765
  }) : 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) {
764
766
  e.$set(e.formModel, e.schema.field, a);
765
767
  }, 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) {
@@ -785,17 +787,17 @@ var tt = function() {
785
787
  }, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(a) {
786
788
  return l("el-radio", { key: String(a.value), attrs: { label: a.value } }, [e._v(" " + e._s(a.label) + " ")]);
787
789
  }), 1) : e._e()]], 2) : e._e();
788
- }, lt = [], ot = /* @__PURE__ */ ae(
789
- et,
790
+ }, ot = [], at = /* @__PURE__ */ ne(
790
791
  tt,
791
792
  lt,
793
+ ot,
792
794
  !1,
793
795
  null,
794
- "2227d67d",
796
+ "84880e9d",
795
797
  null,
796
798
  null
797
799
  );
798
- const Te = ot.exports, at = /* @__PURE__ */ ee({
800
+ const De = at.exports, nt = /* @__PURE__ */ ae({
799
801
  __name: "FormActions",
800
802
  props: {
801
803
  showActionButtonGroup: { type: Boolean, default: !0 },
@@ -812,31 +814,32 @@ const Te = ot.exports, at = /* @__PURE__ */ ee({
812
814
  actionColOptions: null
813
815
  },
814
816
  emits: ["submit", "reset", "toggle"],
815
- setup(x) {
817
+ setup(S) {
816
818
  return { __sfc: !0 };
817
819
  }
818
820
  });
819
- var nt = function() {
821
+ var st = function() {
820
822
  var e = this, l = e._self._c;
821
823
  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) {
822
824
  return e.$emit("submit");
823
825
  } } }, [e._v(" " + e._s(e.submitButtonText) + " ")]) : e._e(), e._t("resetBefore"), e.showResetButton ? l("el-button", { attrs: { icon: e.resetButtonIcon }, on: { click: function(t) {
824
826
  return e.$emit("reset");
825
827
  } } }, [e._v(" " + e._s(e.resetButtonText) + " ")]) : e._e(), e._t("actions")], 2);
826
- }, st = [], rt = /* @__PURE__ */ ae(
827
- at,
828
+ }, rt = [], it = /* @__PURE__ */ ne(
828
829
  nt,
829
830
  st,
831
+ rt,
830
832
  !1,
831
833
  null,
832
834
  "489c88d2",
833
835
  null,
834
836
  null
835
837
  );
836
- const De = rt.exports, it = /* @__PURE__ */ ee({
838
+ const Te = it.exports, ct = /* @__PURE__ */ ae({
837
839
  __name: "ProForm",
838
840
  props: {
839
841
  schemas: null,
842
+ modelValue: null,
840
843
  initialValues: null,
841
844
  labelWidth: { default: "120px" },
842
845
  labelPosition: { default: "right" },
@@ -863,253 +866,436 @@ const De = rt.exports, it = /* @__PURE__ */ ee({
863
866
  formListeners: null,
864
867
  components: null
865
868
  },
866
- emits: ["submit", "reset", "register"],
867
- setup(x, { expose: e, emit: l }) {
868
- const t = x, a = Pe(), y = k(), r = k(), P = k(!1), s = k(!0), p = k({}), $ = k({}), u = k([]), D = k({}), h = { xl: 1920, lg: 1200, md: 992, sm: 768 }, B = (i, _, S) => {
869
- const C = S ?? (typeof window < "u" ? window.innerWidth : 1920), w = i ?? {}, E = _ ?? {}, H = E.span ?? 8;
870
- return C >= h.xl ? w.xl ?? E.xl ?? w.lg ?? E.lg ?? w.md ?? E.md ?? w.sm ?? E.sm ?? w.xs ?? E.xs ?? w.span ?? H : C >= h.lg ? w.lg ?? E.lg ?? w.md ?? E.md ?? w.sm ?? E.sm ?? w.xs ?? E.xs ?? w.span ?? H : C >= h.md ? w.md ?? E.md ?? w.sm ?? E.sm ?? w.xs ?? E.xs ?? w.span ?? H : C >= h.sm ? w.sm ?? E.sm ?? w.xs ?? E.xs ?? w.span ?? H : w.xs ?? E.xs ?? w.span ?? H;
871
- }, { getSetting: m } = Be(), A = R(() => ({ ...m("ProForm"), ...t, ...D.value })), c = R(() => ({
872
- ...m("ProForm").components ?? {},
873
- ...t.components ?? {},
869
+ emits: ["submit", "reset", "register", "update:modelValue"],
870
+ setup(S, { expose: e, emit: l }) {
871
+ const t = S, a = Pe(), h = k(), n = k(), m = k(!1), r = k(!0), y = k({}), E = k({}), c = k([]), D = k({}), b = { xl: 1920, lg: 1200, md: 992, sm: 768 }, T = (i, g, P) => {
872
+ const R = P ?? (typeof window < "u" ? window.innerWidth : 1920), w = i ?? {}, o = g ?? {}, s = o.span ?? 8;
873
+ return R >= b.xl ? w.xl ?? o.xl ?? w.lg ?? o.lg ?? w.md ?? o.md ?? w.sm ?? o.sm ?? w.xs ?? o.xs ?? w.span ?? s : R >= b.lg ? w.lg ?? o.lg ?? w.md ?? o.md ?? w.sm ?? o.sm ?? w.xs ?? o.xs ?? w.span ?? s : R >= b.md ? w.md ?? o.md ?? w.sm ?? o.sm ?? w.xs ?? o.xs ?? w.span ?? s : R >= b.sm ? w.sm ?? o.sm ?? w.xs ?? o.xs ?? w.span ?? s : w.xs ?? o.xs ?? w.span ?? s;
874
+ }, { getSetting: _ } = Se(), A = x(() => ({ ..._("ProForm"), ...t, ...D.value })), u = x(() => A.value.modelValue), p = x(() => u.value !== void 0), d = x(() => p.value ? u.value ?? {} : y.value), O = x(() => ({
875
+ ..._("ProForm").components ?? {},
876
+ ...A.value.components ?? {},
874
877
  ...D.value.components ?? {}
875
- })), v = R(() => A.value.actionColOptions ?? { span: 24 }), d = k(typeof window < "u" ? window.innerWidth : 1920), z = (i, _, S, C) => {
876
- let w = 24, E = 1, H = 0;
877
- for (const Q of i) {
878
- const ne = B(Q.colProps, _, C);
879
- if (ne > w) {
880
- if (E++, E > S)
878
+ })), V = x(() => A.value.actionColOptions ?? { span: 24 }), $ = k(typeof window < "u" ? window.innerWidth : 1920), q = (i, g, P, R) => {
879
+ let w = 24, o = 1, s = 0;
880
+ for (const f of i) {
881
+ const C = T(f.colProps, g, R);
882
+ if (C > w) {
883
+ if (o++, o > P)
881
884
  break;
882
- w = 24 - ne;
885
+ w = 24 - C;
883
886
  } else
884
- w -= ne;
885
- H++;
887
+ w -= C;
888
+ s++;
886
889
  }
887
- return H;
888
- }, I = R(() => {
889
- const i = u.value.filter((w) => g(w));
890
+ return s;
891
+ }, F = x(() => {
892
+ const i = c.value.filter((w) => X(w));
890
893
  if (!A.value.showAdvancedButton)
891
894
  return !1;
892
- const _ = A.value.alwaysShowLines ?? 1, S = A.value.baseColProps, C = z(i, S, _, d.value);
893
- return console.log(i.length, C), i.length > C;
894
- }), M = R(() => A.value.formListeners ?? {}), N = R(() => {
895
- const i = u.value.filter((w) => g(w));
896
- if (!A.value.showAdvancedButton || !s.value)
895
+ const g = A.value.alwaysShowLines ?? 1, P = A.value.baseColProps, R = q(i, P, g, $.value);
896
+ return i.length > R;
897
+ }), L = x(() => A.value.formListeners ?? {}), K = x(() => {
898
+ const i = c.value.filter((w) => X(w));
899
+ if (!A.value.showAdvancedButton || !r.value)
897
900
  return i;
898
- const _ = A.value.alwaysShowLines ?? 1, S = A.value.baseColProps, C = z(i, S, _, d.value);
899
- return i.slice(0, C);
900
- }), g = (i) => {
901
- let _ = !0, S = !0;
902
- return typeof i.ifShow == "function" && (_ = i.ifShow({ schema: i, values: p.value, model: p.value, field: i.field })), typeof i.ifShow == "boolean" && (_ = i.ifShow), typeof i.show == "function" && (S = i.show({ schema: i, values: p.value, model: p.value, field: i.field })), typeof i.show == "boolean" && (S = i.show), _ && S;
903
- }, L = (i) => i.colProps ?? A.value.baseColProps ?? {}, O = (i) => i.slot || i.field, W = () => {
904
- const i = {}, _ = {}, S = A.value.initialValues ?? t.initialValues;
905
- u.value.forEach((C) => {
906
- var w;
907
- i[C.field] = C.defaultValue ?? (S == null ? void 0 : S[C.field]), (w = C.rules) != null && w.length && (_[C.field] = C.rules);
908
- }), p.value = { ...p.value, ...i }, $.value = _;
909
- }, X = (i) => {
910
- const _ = { ...i };
911
- return u.value.forEach((S) => {
912
- const C = S.ifShow;
913
- if (C === void 0)
901
+ const g = A.value.alwaysShowLines ?? 1, P = A.value.baseColProps, R = q(i, P, g, $.value);
902
+ return i.slice(0, R);
903
+ }), X = (i) => {
904
+ let g = !0, P = !0;
905
+ return typeof i.ifShow == "function" && (g = i.ifShow({ schema: i, values: d.value, model: d.value, field: i.field })), typeof i.ifShow == "boolean" && (g = i.ifShow), typeof i.show == "function" && (P = i.show({ schema: i, values: d.value, model: d.value, field: i.field })), typeof i.show == "boolean" && (P = i.show), g && P;
906
+ }, Q = (i) => i.colProps ?? A.value.baseColProps ?? {}, G = (i) => i.slot || i.field, N = (i, g = !0) => {
907
+ const P = g ? { ...i ?? {} } : {}, R = A.value.initialValues ?? t.initialValues;
908
+ return c.value.forEach((w) => {
909
+ if (!(g && Object.prototype.hasOwnProperty.call(P, w.field))) {
910
+ if (w.defaultValue !== void 0) {
911
+ P[w.field] = w.defaultValue;
912
+ return;
913
+ }
914
+ R && Object.prototype.hasOwnProperty.call(R, w.field) && (P[w.field] = R[w.field]);
915
+ }
916
+ }), P;
917
+ }, J = (i, g = !0) => {
918
+ y.value = i, g && l("update:modelValue", i);
919
+ }, j = (i) => {
920
+ const g = N({ ...d.value, ...i });
921
+ return J(g), g;
922
+ }, Z = () => {
923
+ const i = {};
924
+ c.value.forEach((g) => {
925
+ var P;
926
+ (P = g.rules) != null && P.length && (i[g.field] = g.rules);
927
+ }), J(N(d.value), !1), E.value = i;
928
+ }, v = (i) => {
929
+ const g = { ...i };
930
+ return c.value.forEach((P) => {
931
+ const R = P.ifShow;
932
+ if (R === void 0)
914
933
  return;
915
- (typeof C == "boolean" ? C : C({ schema: S, values: i, model: i, field: S.field })) || delete _[S.field];
916
- }), _;
917
- }, K = (i) => {
918
- const _ = X(i), S = D.value.fieldMapToTime;
919
- if (!(S != null && S.length))
920
- return _;
921
- const C = { ..._ };
922
- return S.forEach(([w, [E, H]]) => {
923
- const Q = C[w];
924
- Array.isArray(Q) && Q.length === 2 && (delete C[w], C[E] = Q[0], C[H] = Q[1]);
925
- }), C;
926
- }, q = async () => {
934
+ (typeof R == "boolean" ? R : R({ schema: P, values: i, model: i, field: P.field })) || delete g[P.field];
935
+ }), g;
936
+ }, z = (i) => {
937
+ const g = v(i), P = D.value.fieldMapToTime;
938
+ if (!(P != null && P.length))
939
+ return g;
940
+ const R = { ...g };
941
+ return P.forEach(([w, [o, s]]) => {
942
+ const f = R[w];
943
+ Array.isArray(f) && f.length === 2 && (delete R[w], R[o] = f[0], R[s] = f[1]);
944
+ }), R;
945
+ }, B = async () => {
927
946
  var i;
928
947
  try {
929
- await ((i = y.value) == null ? void 0 : i.validate()), A.value.submitFunc ? await A.value.submitFunc() : (P.value = !0, l("submit", K({ ...p.value })));
930
- } catch (_) {
931
- console.error("Form validation failed:", _);
948
+ await ((i = h.value) == null ? void 0 : i.validate()), A.value.submitFunc ? await A.value.submitFunc() : (m.value = !0, l("submit", z({ ...d.value })));
949
+ } catch (g) {
950
+ console.error("Form validation failed:", g);
932
951
  } finally {
933
- P.value = !1;
952
+ m.value = !1;
934
953
  }
935
- }, Y = async () => {
954
+ }, W = async () => {
936
955
  var i;
937
- A.value.resetFunc ? await A.value.resetFunc() : ((i = y.value) == null || i.resetFields(), W(), l("reset"), A.value.submitOnReset && await q());
938
- }, j = (i) => (p.value = { ...p.value, ...i }, Promise.resolve()), te = () => K({ ...p.value }), ue = async () => {
956
+ A.value.resetFunc ? await A.value.resetFunc() : ((i = h.value) == null || i.resetFields(), Z(), l("reset"), A.value.submitOnReset && await B());
957
+ }, Y = (i) => (j(i), Promise.resolve()), te = () => z({ ...d.value }), se = async () => {
939
958
  var i;
940
- (i = y.value) == null || i.resetFields(), W();
941
- }, de = (i) => {
942
- var _;
943
- return ((_ = y.value) == null ? void 0 : _.validate(i)) ?? Promise.resolve();
944
- }, fe = (i) => y.value ? i != null && i.length ? Promise.all(i.map((_) => new Promise((S, C) => {
945
- y.value.validateField(_, (w) => w ? S(void 0) : C(new Error("Validation failed")));
946
- }))) : y.value.validate() : Promise.resolve(), pe = async (i, _) => {
947
- var C;
948
- const S = (C = r.value) == null ? void 0 : C.querySelector(`[data-field="${i}"]`);
949
- return S && S.scrollIntoView({ behavior: (_ == null ? void 0 : _.behavior) ?? "smooth", block: (_ == null ? void 0 : _.block) ?? "nearest" }), Promise.resolve();
950
- }, ve = (i) => {
951
- var _;
952
- (_ = y.value) == null || _.clearValidate(i);
953
- }, Z = async (i) => {
954
- (Array.isArray(i) ? i : [i]).forEach((S) => {
955
- const C = u.value.findIndex((w) => w.field === S.field);
956
- C >= 0 && (u.value[C] = { ...u.value[C], ...S });
959
+ (i = h.value) == null || i.resetFields(), J(N(void 0, !1));
960
+ }, de = (i, g) => {
961
+ j({ [i]: g });
962
+ }, re = (i) => {
963
+ var g;
964
+ return ((g = h.value) == null ? void 0 : g.validate(i)) ?? Promise.resolve();
965
+ }, le = (i) => h.value ? i != null && i.length ? Promise.all(i.map((g) => new Promise((P, R) => {
966
+ h.value.validateField(g, (w) => w ? P(void 0) : R(new Error("Validation failed")));
967
+ }))) : h.value.validate() : Promise.resolve(), ve = async (i, g) => {
968
+ var R;
969
+ const P = (R = n.value) == null ? void 0 : R.querySelector(`[data-field="${i}"]`);
970
+ return P && P.scrollIntoView({ behavior: (g == null ? void 0 : g.behavior) ?? "smooth", block: (g == null ? void 0 : g.block) ?? "nearest" }), Promise.resolve();
971
+ }, me = (i) => {
972
+ var g;
973
+ (g = h.value) == null || g.clearValidate(i);
974
+ }, he = async (i) => {
975
+ (Array.isArray(i) ? i : [i]).forEach((P) => {
976
+ const R = c.value.findIndex((w) => w.field === P.field);
977
+ R >= 0 && (c.value[R] = { ...c.value[R], ...P });
957
978
  });
958
- }, me = async (i, _, S) => {
959
- if (S)
960
- u.value.unshift(i);
961
- else if (_) {
962
- const C = u.value.findIndex((w) => w.field === _);
963
- u.value.splice(C + 1, 0, i);
979
+ }, _e = async (i, g, P) => {
980
+ if (P)
981
+ c.value.unshift(i);
982
+ else if (g) {
983
+ const R = c.value.findIndex((w) => w.field === g);
984
+ c.value.splice(R + 1, 0, i);
964
985
  } else
965
- u.value.push(i);
966
- W();
967
- }, he = async (i) => {
968
- const _ = Array.isArray(i) ? i : [i];
969
- u.value = u.value.filter((S) => !_.includes(S.field));
986
+ c.value.push(i);
987
+ Z();
970
988
  }, be = async (i) => {
971
- D.value = { ...D.value, ...i }, i.schemas && (u.value = [...i.schemas], W());
972
- }, J = {
989
+ const g = Array.isArray(i) ? i : [i];
990
+ c.value = c.value.filter((P) => !g.includes(P.field));
991
+ }, ge = async (i) => {
992
+ D.value = { ...D.value, ...i }, i.schemas && (c.value = [...i.schemas], Z());
993
+ }, fe = {
973
994
  getFieldsValue: te,
974
- setFieldsValue: j,
975
- resetFields: ue,
976
- validate: de,
977
- validateFields: fe,
978
- submit: q,
979
- scrollToField: pe,
980
- clearValidate: ve,
981
- updateSchema: Z,
982
- appendSchemaByField: me,
983
- removeSchemaByField: he,
984
- setProps: be
995
+ setFieldsValue: Y,
996
+ resetFields: se,
997
+ validate: re,
998
+ validateFields: le,
999
+ submit: B,
1000
+ scrollToField: ve,
1001
+ clearValidate: me,
1002
+ updateSchema: he,
1003
+ appendSchemaByField: _e,
1004
+ removeSchemaByField: be,
1005
+ setProps: ge
985
1006
  };
986
- e(J);
987
- const se = () => {
988
- u.value = [...t.schemas ?? []], W();
989
- }, re = () => {
990
- typeof window < "u" && (d.value = window.innerWidth);
1007
+ e(fe);
1008
+ const ce = () => {
1009
+ c.value = [...t.schemas ?? []], Z();
1010
+ }, ie = () => {
1011
+ typeof window < "u" && ($.value = window.innerWidth);
991
1012
  };
992
- return we(() => {
993
- se(), l("register", J), typeof window < "u" && window.addEventListener("resize", re);
994
- }), Re(() => {
995
- typeof window < "u" && window.removeEventListener("resize", re);
996
- }), U(() => [t.schemas, t.initialValues], se, { deep: !0 }), { __sfc: !0, props: t, emit: l, slots: a, formRef: y, formWrapRef: r, submitLoading: P, collapsed: s, formModel: p, formRules: $, innerSchemas: u, innerProps: D, BREAKPOINTS: h, getEffectiveSpan: B, getComponentSetting: m, effectiveProps: A, formCustomComponents: c, effectiveActionColOptions: v, windowWidth: d, getVisibleSchemaCount: z, hasMoreFields: I, formListeners: M, displaySchemas: N, shouldShow: g, getColProps: L, getSlotName: O, initForm: W, filterByIfShow: X, processFieldMapToTime: K, 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 };
1013
+ return pe(() => {
1014
+ ce(), l("register", fe), typeof window < "u" && window.addEventListener("resize", ie);
1015
+ }), xe(() => {
1016
+ typeof window < "u" && window.removeEventListener("resize", ie);
1017
+ }), U(() => u.value, (i) => {
1018
+ !p.value || i === void 0 || J(N(i), !1);
1019
+ }, { deep: !0, immediate: !0 }), U(() => [t.schemas, t.initialValues], ce, { deep: !0 }), { __sfc: !0, props: t, emit: l, slots: a, formRef: h, formWrapRef: n, submitLoading: m, collapsed: r, formModel: y, formRules: E, innerSchemas: c, innerProps: D, BREAKPOINTS: b, getEffectiveSpan: T, getComponentSetting: _, effectiveProps: A, controlledModelValue: u, isControlled: p, currentFormModel: d, formCustomComponents: O, effectiveActionColOptions: V, windowWidth: $, getVisibleSchemaCount: q, hasMoreFields: F, formListeners: L, displaySchemas: K, shouldShow: X, getColProps: Q, getSlotName: G, resolveSchemaModel: N, applyFormModel: J, updateFormModel: j, initForm: Z, filterByIfShow: v, processFieldMapToTime: z, handleSubmit: B, handleReset: W, setFieldsValue: Y, getFieldsValue: te, resetFields: se, handleFieldChange: de, validate: re, validateFields: le, scrollToField: ve, clearValidate: me, updateSchema: he, appendSchemaByField: _e, removeSchemaByField: be, setProps: ge, formActionRef: fe, syncSchemas: ce, handleResize: ie, ProFormItem: De, FormActions: Te };
997
1020
  }
998
1021
  });
999
- var ct = function() {
1022
+ var ut = function() {
1000
1023
  var e = this, l = e._self._c, t = e._self._setupProxy;
1001
- 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) {
1002
- var y, r;
1003
- 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()];
1024
+ 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.currentFormModel, 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) {
1025
+ var h, n;
1026
+ return [t.shouldShow(a) ? l("el-col", e._b({ key: a.field, attrs: { offset: ((h = a.colProps) == null ? void 0 : h.offset) ?? ((n = t.effectiveProps.baseColProps) == null ? void 0 : n.offset) ?? 0, "data-field": a.field } }, "el-col", t.getColProps(a), !1), [l(t.ProFormItem, { attrs: { schema: a, "form-model": t.currentFormModel, "form-disabled": t.effectiveProps.disabled, "auto-placeholder": t.effectiveProps.autoSetPlaceholder, "form-action-type": t.formActionRef, "custom-components": t.formCustomComponents, "on-field-change": t.handleFieldChange } }, [t.slots[t.getSlotName(a)] ? [e._t(t.getSlotName(a), null, { model: t.currentFormModel, schema: a, field: a.field, values: t.currentFormModel })] : e._e()], 2)], 1) : e._e()];
1004
1027
  }), 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) {
1005
1028
  t.collapsed = !t.collapsed;
1006
1029
  } } }, [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) {
1007
1030
  t.collapsed = !t.collapsed;
1008
1031
  } } }, [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);
1009
- }, ut = [], dt = /* @__PURE__ */ ae(
1010
- it,
1032
+ }, dt = [], ft = /* @__PURE__ */ ne(
1011
1033
  ct,
1012
1034
  ut,
1035
+ dt,
1013
1036
  !1,
1014
1037
  null,
1015
- "4ee1cb87",
1038
+ "6171d80d",
1016
1039
  null,
1017
1040
  null
1018
1041
  );
1019
- const Me = dt.exports;
1020
- function bt(x) {
1021
- const e = k(null), l = k(x ? ye(x) : void 0), t = () => x ? ye(x) : void 0, a = (v) => {
1022
- e.value = v;
1042
+ const Me = ft.exports;
1043
+ function Ct(S) {
1044
+ const e = k(null), l = k(S ? ue(S) : void 0), t = () => S ? ue(S) : void 0, a = (p) => {
1045
+ e.value = p;
1023
1046
  const d = t();
1024
- d && Object.keys(d).length > 0 && v.setProps(d);
1047
+ d && Object.keys(d).length > 0 && p.setProps(d);
1025
1048
  };
1026
- return x && U(
1049
+ return S && U(
1027
1050
  () => t(),
1028
- (v) => {
1029
- l.value = v, v && e.value && e.value.setProps(v);
1051
+ (p) => {
1052
+ l.value = p, p && e.value && e.value.setProps(p);
1030
1053
  },
1031
1054
  { deep: !0 }
1032
1055
  ), [a, {
1033
1056
  register: a,
1034
1057
  formAction: e,
1035
1058
  getFieldsValue: () => {
1036
- var v;
1037
- return ((v = e.value) == null ? void 0 : v.getFieldsValue()) ?? {};
1059
+ var p;
1060
+ return ((p = e.value) == null ? void 0 : p.getFieldsValue()) ?? {};
1038
1061
  },
1039
- setFieldsValue: async (v) => {
1062
+ setFieldsValue: async (p) => {
1040
1063
  var d;
1041
- await ((d = e.value) == null ? void 0 : d.setFieldsValue(v));
1064
+ await ((d = e.value) == null ? void 0 : d.setFieldsValue(p));
1042
1065
  },
1043
1066
  resetFields: async () => {
1044
- var v;
1045
- await ((v = e.value) == null ? void 0 : v.resetFields());
1067
+ var p;
1068
+ await ((p = e.value) == null ? void 0 : p.resetFields());
1046
1069
  },
1047
- validate: (v) => {
1070
+ validate: (p) => {
1048
1071
  var d;
1049
- return ((d = e.value) == null ? void 0 : d.validate(v)) ?? Promise.resolve();
1072
+ return ((d = e.value) == null ? void 0 : d.validate(p)) ?? Promise.resolve();
1050
1073
  },
1051
- validateFields: (v) => {
1074
+ validateFields: (p) => {
1052
1075
  var d;
1053
- return ((d = e.value) == null ? void 0 : d.validateFields(v)) ?? Promise.resolve();
1076
+ return ((d = e.value) == null ? void 0 : d.validateFields(p)) ?? Promise.resolve();
1054
1077
  },
1055
1078
  submit: () => {
1056
- var v;
1057
- return ((v = e.value) == null ? void 0 : v.submit()) ?? Promise.resolve();
1079
+ var p;
1080
+ return ((p = e.value) == null ? void 0 : p.submit()) ?? Promise.resolve();
1058
1081
  },
1059
- scrollToField: (v, d) => {
1060
- var z;
1061
- return ((z = e.value) == null ? void 0 : z.scrollToField(v, d)) ?? Promise.resolve();
1082
+ scrollToField: (p, d) => {
1083
+ var O;
1084
+ return ((O = e.value) == null ? void 0 : O.scrollToField(p, d)) ?? Promise.resolve();
1062
1085
  },
1063
- clearValidate: (v) => {
1086
+ clearValidate: (p) => {
1064
1087
  var d;
1065
- (d = e.value) == null || d.clearValidate(v);
1088
+ (d = e.value) == null || d.clearValidate(p);
1066
1089
  },
1067
- updateSchema: (v) => {
1090
+ updateSchema: (p) => {
1068
1091
  var d;
1069
- return ((d = e.value) == null ? void 0 : d.updateSchema(v)) ?? Promise.resolve();
1092
+ return ((d = e.value) == null ? void 0 : d.updateSchema(p)) ?? Promise.resolve();
1070
1093
  },
1071
- appendSchemaByField: (v, d, z) => {
1072
- var I;
1073
- return ((I = e.value) == null ? void 0 : I.appendSchemaByField(v, d, z)) ?? Promise.resolve();
1094
+ appendSchemaByField: (p, d, O) => {
1095
+ var V;
1096
+ return ((V = e.value) == null ? void 0 : V.appendSchemaByField(p, d, O)) ?? Promise.resolve();
1074
1097
  },
1075
- removeSchemaByField: (v) => {
1098
+ removeSchemaByField: (p) => {
1076
1099
  var d;
1077
- return ((d = e.value) == null ? void 0 : d.removeSchemaByField(v)) ?? Promise.resolve();
1100
+ return ((d = e.value) == null ? void 0 : d.removeSchemaByField(p)) ?? Promise.resolve();
1078
1101
  },
1079
- setProps: async (v) => {
1102
+ setProps: async (p) => {
1080
1103
  var d;
1081
- l.value = { ...l.value, ...v }, await ((d = e.value) == null ? void 0 : d.setProps(v));
1104
+ l.value = { ...l.value, ...p }, await ((d = e.value) == null ? void 0 : d.setProps(p));
1082
1105
  }
1083
1106
  }];
1084
1107
  }
1085
- const ft = [
1108
+ const pt = /* @__PURE__ */ ae({
1109
+ __name: "ProDescriptions",
1110
+ props: {
1111
+ title: null,
1112
+ helpMessage: null,
1113
+ size: { default: "medium" },
1114
+ bordered: { type: Boolean, default: !0 },
1115
+ column: { default: () => ({ xxl: 4, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }) },
1116
+ schema: { default: () => [] },
1117
+ data: { default: () => ({}) },
1118
+ emptyText: { default: "-" },
1119
+ useCollapse: { type: Boolean, default: !1 },
1120
+ collapseOptions: { default: () => ({ canExpand: !1, defaultExpand: !0, expandButtonText: "展开", collapseButtonText: "收起", visibleRows: 1 }) }
1121
+ },
1122
+ emits: ["register"],
1123
+ setup(S, { expose: e, emit: l }) {
1124
+ const t = S, a = k({}), h = k({}), n = k([]), m = k(typeof window < "u" ? window.innerWidth : 1920), r = k(!0), y = ae({
1125
+ name: "EcpDescriptionValueRenderer",
1126
+ props: {
1127
+ schema: { type: Object, required: !0 },
1128
+ value: { required: !1 },
1129
+ record: { type: Object, required: !0 },
1130
+ emptyText: { type: String, default: "-" }
1131
+ },
1132
+ setup(v) {
1133
+ return () => {
1134
+ const z = v.schema, B = v.record, W = v.value;
1135
+ if (z.render) {
1136
+ const Y = z.render(W, B);
1137
+ return Y == null || Y === "" ? oe("span", v.emptyText) : typeof Y == "string" || typeof Y == "number" ? oe("span", String(Y)) : Y;
1138
+ }
1139
+ return Array.isArray(W) ? oe("span", W.length ? W.join(", ") : v.emptyText) : W == null || W === "" ? oe("span", v.emptyText) : typeof W == "object" ? oe("span", JSON.stringify(W)) : oe("span", String(W));
1140
+ };
1141
+ }
1142
+ }), { getSetting: E } = Se(), c = x(() => ({ ...E("ProDescriptions"), ...t, ...a.value })), D = { xxl: 1920, xl: 1200, lg: 992, md: 768, sm: 576 }, b = (v, z) => {
1143
+ if (typeof v == "number")
1144
+ return Math.max(1, v);
1145
+ const B = v ?? {};
1146
+ return z >= D.xxl ? B.xxl ?? B.xl ?? B.lg ?? B.md ?? B.sm ?? B.xs ?? 3 : z >= D.xl ? B.xl ?? B.lg ?? B.md ?? B.sm ?? B.xs ?? 3 : z >= D.lg ? B.lg ?? B.md ?? B.sm ?? B.xs ?? 3 : z >= D.md ? B.md ?? B.sm ?? B.xs ?? 3 : z >= D.sm ? B.sm ?? B.xs ?? 2 : B.xs ?? 1;
1147
+ }, T = x(() => b(c.value.column, m.value)), _ = x(() => c.value.data ?? h.value ?? {}), A = x(() => (n.value.length ? n.value : c.value.schema ?? []).filter((v) => v.dataIndex || v.field ? typeof v.show == "function" ? v.show(_.value) : v.show !== !1 : !1).map((v) => ({
1148
+ ...v,
1149
+ dataIndex: v.dataIndex || v.field || ""
1150
+ }))), u = x(() => {
1151
+ const v = [];
1152
+ let z = { items: [] }, B = 0;
1153
+ const W = T.value;
1154
+ return A.value.forEach((Y, te) => {
1155
+ const se = A.value.length - te, de = Math.max(1, Math.min(Y.span ?? 1, W)), re = se === 1 ? W - B || W : de;
1156
+ B + re > W && (v.push(z), z = { items: [] }, B = 0);
1157
+ const le = se === 1 && B < W ? Math.max(1, W - B) : re;
1158
+ z.items.push({ ...Y, _span: le }), B += le, B >= W && (v.push(z), z = { items: [] }, B = 0);
1159
+ }), z.items.length > 0 && v.push(z), v;
1160
+ }), p = x(() => {
1161
+ var z;
1162
+ if (!d.value || r.value)
1163
+ return u.value;
1164
+ const v = Math.max(1, ((z = c.value.collapseOptions) == null ? void 0 : z.visibleRows) ?? 1);
1165
+ return u.value.slice(0, v);
1166
+ }), d = x(() => {
1167
+ var z, B;
1168
+ const v = Math.max(1, ((z = c.value.collapseOptions) == null ? void 0 : z.visibleRows) ?? 1);
1169
+ return !!c.value.useCollapse && !!((B = c.value.collapseOptions) != null && B.canExpand) && u.value.length > v;
1170
+ }), O = x(() => !!c.value.title || !!c.value.helpMessage || d.value), V = x(() => {
1171
+ var v, z;
1172
+ return {
1173
+ expand: ((v = c.value.collapseOptions) == null ? void 0 : v.expandButtonText) ?? "展开",
1174
+ collapse: ((z = c.value.collapseOptions) == null ? void 0 : z.collapseButtonText) ?? "收起"
1175
+ };
1176
+ }), $ = x(() => ({
1177
+ gridTemplateColumns: `repeat(${T.value}, minmax(0, 1fr))`
1178
+ })), q = (v) => ({
1179
+ gridColumn: `span ${v._span}`
1180
+ }), F = (v) => ({
1181
+ minWidth: v.labelMinWidth ? `${v.labelMinWidth}px` : void 0,
1182
+ ...v.labelStyle ?? {}
1183
+ }), L = (v) => ({
1184
+ minWidth: v.contentMinWidth ? `${v.contentMinWidth}px` : void 0,
1185
+ ...v.contentStyle ?? {}
1186
+ }), K = (v) => _.value[v.dataIndex], X = () => {
1187
+ n.value = [...c.value.schema ?? []];
1188
+ }, Q = () => {
1189
+ h.value = { ...c.value.data ?? {} };
1190
+ }, G = async (v) => {
1191
+ a.value = { ...a.value, ...v }, v.schema && (n.value = [...v.schema]), v.data && (h.value = { ...v.data });
1192
+ }, N = async (v) => {
1193
+ h.value = { ...h.value, ...v }, a.value = { ...a.value, data: h.value };
1194
+ }, J = () => ({ ...c.value.data ?? h.value ?? {} }), j = {
1195
+ setProps: G,
1196
+ setData: N,
1197
+ getData: J
1198
+ };
1199
+ e(j);
1200
+ const Z = () => {
1201
+ typeof window < "u" && (m.value = window.innerWidth);
1202
+ };
1203
+ return pe(() => {
1204
+ var v;
1205
+ X(), Q(), r.value = ((v = c.value.collapseOptions) == null ? void 0 : v.defaultExpand) !== !1, l("register", j), typeof window < "u" && window.addEventListener("resize", Z);
1206
+ }), xe(() => {
1207
+ typeof window < "u" && window.removeEventListener("resize", Z);
1208
+ }), U(() => c.value.schema, X, { deep: !0 }), U(() => c.value.data, Q, { deep: !0 }), U(() => {
1209
+ var v;
1210
+ return (v = c.value.collapseOptions) == null ? void 0 : v.defaultExpand;
1211
+ }, (v) => {
1212
+ v !== void 0 && (r.value = v);
1213
+ }), { __sfc: !0, props: t, emit: l, innerProps: a, innerData: h, innerSchema: n, windowWidth: m, expanded: r, DescriptionValueRenderer: y, getSetting: E, effectiveProps: c, breakpoints: D, resolveColumn: b, currentColumn: T, effectiveData: _, visibleSchema: A, normalizedRows: u, renderedRows: p, showCollapseButton: d, showHeader: O, collapseButtonText: V, bodyStyle: $, getItemStyle: q, getLabelStyle: F, getContentStyle: L, getItemValue: K, syncSchema: X, syncData: Q, setProps: G, setData: N, getData: J, descriptionAction: j, updateWindowWidth: Z };
1214
+ }
1215
+ });
1216
+ var vt = function() {
1217
+ var a;
1218
+ var e = this, l = e._self._c, t = e._self._setupProxy;
1219
+ return l("div", { staticClass: "ecp-pro-descriptions" }, [t.showHeader ? l("div", { staticClass: "ecp-pro-descriptions__header" }, [l("div", { staticClass: "ecp-pro-descriptions__title-wrap" }, [t.effectiveProps.title ? l("span", { staticClass: "ecp-pro-descriptions__title" }, [e._v(e._s(t.effectiveProps.title))]) : e._e(), t.effectiveProps.helpMessage ? l("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.helpMessage) ? l("span", e._l(t.effectiveProps.helpMessage, function(h, n) {
1220
+ return l("div", { key: n }, [e._v(e._s(h))]);
1221
+ }), 0) : l("span", [e._v(e._s(t.effectiveProps.helpMessage))])]), l("i", { staticClass: "el-icon-question ecp-pro-descriptions__help" })], 2) : e._e(), (a = t.effectiveProps.collapseOptions) != null && a.helpMessage ? l("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [l("template", { slot: "content" }, [Array.isArray(t.effectiveProps.collapseOptions.helpMessage) ? l("span", e._l(t.effectiveProps.collapseOptions.helpMessage, function(h, n) {
1222
+ return l("div", { key: `collapse-${n}` }, [e._v(e._s(h))]);
1223
+ }), 0) : l("span", [e._v(e._s(t.effectiveProps.collapseOptions.helpMessage))])]), l("i", { staticClass: "el-icon-info ecp-pro-descriptions__help" })], 2) : e._e()], 1), t.showCollapseButton ? l("el-button", { staticClass: "ecp-pro-descriptions__toggle", attrs: { type: "text" }, on: { click: function(h) {
1224
+ t.expanded = !t.expanded;
1225
+ } } }, [e._v(" " + e._s(t.expanded ? t.collapseButtonText.collapse : t.collapseButtonText.expand) + " "), l("i", { staticClass: "el-icon-arrow-down", class: t.expanded ? "is-expanded" : "" })]) : e._e()], 1) : e._e(), l("div", e._b({ staticClass: "ecp-pro-descriptions__body", class: [
1226
+ `is-${t.effectiveProps.size}`,
1227
+ { "is-bordered": t.effectiveProps.bordered, "is-collapsed": t.showCollapseButton && !t.expanded }
1228
+ ], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(h, n) {
1229
+ return [e._l(h.items, function(m) {
1230
+ return [l("div", { key: `${n}-${m.dataIndex || m.field}`, staticClass: "ecp-pro-descriptions__item", style: t.getItemStyle(m) }, [l("div", { staticClass: "ecp-pro-descriptions__label", style: t.getLabelStyle(m) }, [e._v(" " + e._s(m.label) + " ")]), l("div", { staticClass: "ecp-pro-descriptions__content", style: t.getContentStyle(m) }, [e.$scopedSlots[m.slot || m.dataIndex] ? e._t(m.slot || m.dataIndex, null, { value: t.getItemValue(m), record: t.effectiveData, schema: m }) : l(t.DescriptionValueRenderer, { attrs: { schema: m, value: t.getItemValue(m), record: t.effectiveData, "empty-text": t.effectiveProps.emptyText || "-" } })], 2)])];
1231
+ })];
1232
+ })], 2)]);
1233
+ }, mt = [], ht = /* @__PURE__ */ ne(
1234
+ pt,
1235
+ vt,
1236
+ mt,
1237
+ !1,
1238
+ null,
1239
+ "31a2b882",
1240
+ null,
1241
+ null
1242
+ );
1243
+ const $e = ht.exports;
1244
+ function Pt(S) {
1245
+ const e = k(null), l = () => S ? ue(S) : void 0, t = () => {
1246
+ const n = ue(e);
1247
+ if (!n)
1248
+ throw new Error("ProDescriptions instance has not been registered");
1249
+ return n;
1250
+ }, a = (n) => {
1251
+ e.value = n;
1252
+ const m = l();
1253
+ m && Object.keys(m).length > 0 && n.setProps(m);
1254
+ };
1255
+ return S && U(
1256
+ () => l(),
1257
+ (n) => {
1258
+ n && e.value && e.value.setProps(n);
1259
+ },
1260
+ { deep: !0 }
1261
+ ), [a, {
1262
+ setProps: (n) => t().setProps(n),
1263
+ setData: (n) => t().setData(n),
1264
+ getData: () => t().getData()
1265
+ }];
1266
+ }
1267
+ const _t = [
1086
1268
  { name: "ProTable", component: Ae },
1087
1269
  { name: "TableAction", component: ke },
1088
1270
  { name: "ProForm", component: Me },
1089
- { name: "ProFormItem", component: Te },
1090
- { name: "FormActions", component: De }
1271
+ { name: "ProFormItem", component: De },
1272
+ { name: "FormActions", component: Te },
1273
+ { name: "ProDescriptions", component: $e }
1091
1274
  ];
1092
- function pt(x) {
1093
- ft.forEach(({ name: e, component: l }) => {
1094
- x.component(e, l);
1275
+ function bt(S) {
1276
+ _t.forEach(({ name: e, component: l }) => {
1277
+ S.component(e, l);
1095
1278
  });
1096
1279
  }
1097
- const _t = {
1098
- install: pt,
1280
+ const xt = {
1281
+ install: bt,
1099
1282
  ProTable: Ae,
1100
1283
  ProForm: Me,
1284
+ ProDescriptions: $e,
1101
1285
  TableAction: ke
1102
1286
  };
1103
1287
  export {
1104
- De as FormActions,
1288
+ Te as FormActions,
1289
+ $e as ProDescriptions,
1105
1290
  Me as ProForm,
1106
- Te as ProFormItem,
1291
+ De as ProFormItem,
1107
1292
  Ae as ProTable,
1108
1293
  ke as TableAction,
1109
- _t as default,
1110
- pt as install,
1111
- Be as useComponentSetting,
1112
- bt as useForm,
1113
- ht as useProTable
1294
+ xt as default,
1295
+ bt as install,
1296
+ Se as useComponentSetting,
1297
+ Pt as useDescription,
1298
+ Ct as useForm,
1299
+ wt as useProTable
1114
1300
  };
1115
1301
  //# sourceMappingURL=element-component-pro.es.js.map