@aspire-ui/element-component-pro 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/ProForm/ProForm.vue.d.ts +1 -0
- package/dist/element-component-pro.es.js +389 -375
- package/dist/element-component-pro.es.js.map +1 -1
- package/dist/element-component-pro.umd.js +2 -2
- package/dist/element-component-pro.umd.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/ProForm/ProFormItem.vue +1 -0
- package/src/ProTable/TableAction.vue +16 -5
- package/src/types/index.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as $e, defineComponent as ee, h as ce, useSlots as
|
|
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
2
|
import { MessageBox as ze } from "element-ui";
|
|
3
3
|
const ge = $e({});
|
|
4
4
|
function Be() {
|
|
@@ -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(
|
|
58
|
-
const t =
|
|
57
|
+
setup(x, { expose: e, emit: l }) {
|
|
58
|
+
const t = x, a = ee({
|
|
59
59
|
name: "EcpProTableDefaultCellRenderer",
|
|
60
60
|
props: {
|
|
61
61
|
column: { type: Object, required: !0 },
|
|
@@ -65,15 +65,15 @@ const Ee = /* @__PURE__ */ ee({
|
|
|
65
65
|
},
|
|
66
66
|
setup(o) {
|
|
67
67
|
return () => {
|
|
68
|
-
var
|
|
68
|
+
var f, b;
|
|
69
69
|
const n = o.column;
|
|
70
70
|
if (n != null && n.customRender) {
|
|
71
|
-
const
|
|
72
|
-
return typeof
|
|
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;
|
|
73
73
|
}
|
|
74
74
|
if (n != null && n.valueEnum) {
|
|
75
|
-
const
|
|
76
|
-
return ce("span",
|
|
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));
|
|
77
77
|
}
|
|
78
78
|
return ce("span", o.value == null ? "" : String(o.value));
|
|
79
79
|
};
|
|
@@ -91,202 +91,202 @@ const Ee = /* @__PURE__ */ ee({
|
|
|
91
91
|
},
|
|
92
92
|
setup(o) {
|
|
93
93
|
return () => {
|
|
94
|
-
const n = o.slotRender,
|
|
95
|
-
if (((
|
|
96
|
-
return
|
|
97
|
-
const
|
|
98
|
-
return o.customRender && (
|
|
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)
|
|
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 } });
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
}), r =
|
|
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({
|
|
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:
|
|
107
|
-
() =>
|
|
108
|
-
),
|
|
109
|
-
var n,
|
|
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;
|
|
110
110
|
let o = 0;
|
|
111
|
-
return
|
|
112
|
-
}),
|
|
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
113
|
const n = o.width;
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
let b = Math.floor(
|
|
117
|
-
const
|
|
118
|
-
return b = Math.max(
|
|
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;
|
|
119
119
|
}
|
|
120
120
|
if (typeof n == "string") {
|
|
121
|
-
const
|
|
122
|
-
let
|
|
123
|
-
return b != null && (
|
|
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;
|
|
124
124
|
}
|
|
125
125
|
return o.width;
|
|
126
|
-
}, Y = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, j =
|
|
126
|
+
}, Y = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, j = R(() => {
|
|
127
127
|
var n;
|
|
128
|
-
const o = (n =
|
|
129
|
-
return o ?
|
|
128
|
+
const o = (n = d.value.rowSelection) == null ? void 0 : n.getCheckboxProps;
|
|
129
|
+
return o ? u.value.filter((f) => {
|
|
130
130
|
var b;
|
|
131
|
-
return !((b = o(
|
|
132
|
-
}) :
|
|
133
|
-
}), te =
|
|
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
134
|
const o = j.value.filter((n) => N.value.has(n[M.value])).length;
|
|
135
135
|
return o > 0 && o < j.value.length;
|
|
136
136
|
}), fe = (o) => N.value.has(o[M.value]), pe = (o) => {
|
|
137
|
-
var n,
|
|
138
|
-
return ((b = (
|
|
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
139
|
}, ve = (o) => {
|
|
140
|
-
var n,
|
|
141
|
-
return ((b = (
|
|
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
142
|
}, Z = () => {
|
|
143
|
-
const o =
|
|
144
|
-
l("selection-change", { keys: o, rows:
|
|
143
|
+
const o = m.value.map((n) => n[M.value]);
|
|
144
|
+
l("selection-change", { keys: o, rows: m.value });
|
|
145
145
|
}, me = (o, n) => {
|
|
146
|
-
const
|
|
147
|
-
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
148
|
}, he = (o) => {
|
|
149
|
-
|
|
149
|
+
m.value = [o], Z();
|
|
150
150
|
}, be = (o) => {
|
|
151
151
|
if (o) {
|
|
152
|
-
const n = new Set(
|
|
153
|
-
|
|
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];
|
|
154
154
|
} else {
|
|
155
|
-
const n = new Set(
|
|
156
|
-
|
|
155
|
+
const n = new Set(u.value.map((f) => f[M.value]));
|
|
156
|
+
m.value = m.value.filter((f) => !n.has(f[M.value]));
|
|
157
157
|
}
|
|
158
158
|
Z();
|
|
159
159
|
}, J = async (o) => {
|
|
160
160
|
if (!t.api) {
|
|
161
161
|
if (t.dataSource)
|
|
162
162
|
return;
|
|
163
|
-
|
|
163
|
+
u.value = [];
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
$.value = !0;
|
|
167
167
|
try {
|
|
168
|
-
const n =
|
|
169
|
-
[
|
|
170
|
-
[b]: (o == null ? void 0 : o.pageSize) ??
|
|
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,
|
|
171
171
|
...t.searchInfo,
|
|
172
172
|
...o == null ? void 0 : o.searchInfo
|
|
173
173
|
};
|
|
174
|
-
(o == null ? void 0 : o.page) != null && (
|
|
175
|
-
const G = t.beforeFetch ? t.beforeFetch(
|
|
176
|
-
|
|
177
|
-
const _e = t.afterFetch ? t.afterFetch(
|
|
178
|
-
|
|
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);
|
|
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
179
|
} catch (n) {
|
|
180
180
|
l("fetch-error", n);
|
|
181
181
|
} finally {
|
|
182
|
-
|
|
182
|
+
$.value = !1;
|
|
183
183
|
}
|
|
184
184
|
}, se = () => J(void 0), re = (o) => {
|
|
185
|
-
|
|
185
|
+
d.value.clearSelectOnPageChange && (m.value = []), c.value.pageSize = o, c.value.page = 1, J(void 0);
|
|
186
186
|
}, i = (o) => {
|
|
187
|
-
|
|
188
|
-
}, _ = (o, n,
|
|
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 = {
|
|
189
189
|
setProps: (o) => {
|
|
190
|
-
|
|
190
|
+
B.value = { ...B.value, ...o };
|
|
191
191
|
},
|
|
192
192
|
reload: (o) => J(o),
|
|
193
193
|
redoHeight: () => {
|
|
194
194
|
var o, n;
|
|
195
|
-
(n = (o =
|
|
195
|
+
(n = (o = P.value) == null ? void 0 : o.doLayout) == null || n.call(o);
|
|
196
196
|
},
|
|
197
197
|
setLoading: (o) => {
|
|
198
|
-
|
|
198
|
+
$.value = o;
|
|
199
199
|
},
|
|
200
|
-
getDataSource: () =>
|
|
201
|
-
getRawDataSource: () =>
|
|
200
|
+
getDataSource: () => u.value,
|
|
201
|
+
getRawDataSource: () => D.value,
|
|
202
202
|
setTableData: (o) => {
|
|
203
|
-
|
|
203
|
+
u.value = o ?? [];
|
|
204
204
|
},
|
|
205
|
-
getColumns: () =>
|
|
205
|
+
getColumns: () => h.value,
|
|
206
206
|
setColumns: (o) => {
|
|
207
207
|
if (Array.isArray(o) && o.length > 0 && typeof o[0] == "string") {
|
|
208
|
-
const n = o,
|
|
209
|
-
b.length && (
|
|
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);
|
|
210
210
|
} else
|
|
211
|
-
|
|
211
|
+
h.value = o ?? [];
|
|
212
212
|
},
|
|
213
213
|
setPagination: (o) => {
|
|
214
|
-
o != null && o.page && (
|
|
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);
|
|
215
215
|
},
|
|
216
|
-
getSelectRowKeys: () =>
|
|
217
|
-
getSelectRows: () =>
|
|
216
|
+
getSelectRowKeys: () => m.value.map((o) => o[M.value]),
|
|
217
|
+
getSelectRows: () => m.value,
|
|
218
218
|
clearSelectedRowKeys: () => {
|
|
219
|
-
|
|
219
|
+
m.value = [], Z();
|
|
220
220
|
},
|
|
221
221
|
setSelectedRowKeys: (o) => {
|
|
222
|
-
const n = new Set(o),
|
|
222
|
+
const n = new Set(o), f = u.value.filter((b) => n.has(b[M.value]));
|
|
223
223
|
o.forEach((b) => {
|
|
224
|
-
|
|
225
|
-
}),
|
|
224
|
+
f.some((T) => T[M.value] === b) || f.push({ [M.value]: b });
|
|
225
|
+
}), m.value = f, Z();
|
|
226
226
|
},
|
|
227
227
|
deleteSelectRowByKey: (o) => {
|
|
228
|
-
|
|
228
|
+
m.value = m.value.filter((n) => n[M.value] !== o), Z();
|
|
229
229
|
},
|
|
230
|
-
updateTableData: (o, n,
|
|
231
|
-
o < 0 || o >=
|
|
230
|
+
updateTableData: (o, n, f) => {
|
|
231
|
+
o < 0 || o >= u.value.length || (u.value = [...u.value], u.value[o] = { ...u.value[o], [n]: f });
|
|
232
232
|
},
|
|
233
233
|
updateTableDataRecord: (o, n) => {
|
|
234
|
-
const
|
|
235
|
-
if (!(
|
|
236
|
-
return
|
|
234
|
+
const f = E(o);
|
|
235
|
+
if (!(f < 0))
|
|
236
|
+
return u.value = [...u.value], u.value[f] = { ...u.value[f], ...n }, u.value[f];
|
|
237
237
|
},
|
|
238
238
|
deleteTableDataRecord: (o) => {
|
|
239
|
-
const n = Array.isArray(o) ? o : [o],
|
|
240
|
-
|
|
239
|
+
const n = Array.isArray(o) ? o : [o], f = new Set(n);
|
|
240
|
+
u.value = u.value.filter((b) => !f.has(b[M.value]));
|
|
241
241
|
},
|
|
242
242
|
insertTableDataRecord: (o, n) => {
|
|
243
|
-
const
|
|
244
|
-
return n == null || 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;
|
|
245
245
|
},
|
|
246
|
-
getPaginationRef: () =>
|
|
247
|
-
getShowPagination: () =>
|
|
246
|
+
getPaginationRef: () => I.value ? { page: c.value.page, pageSize: Number(c.value.pageSize) || 10, total: c.value.total } : !1,
|
|
247
|
+
getShowPagination: () => I.value,
|
|
248
248
|
setShowPagination: (o) => {
|
|
249
|
-
|
|
249
|
+
A.value = o;
|
|
250
250
|
},
|
|
251
|
-
getRowSelection: () =>
|
|
251
|
+
getRowSelection: () => d.value.rowSelection,
|
|
252
252
|
expandAll: () => {
|
|
253
253
|
var b;
|
|
254
|
-
const o = ((b =
|
|
255
|
-
const
|
|
256
|
-
return
|
|
257
|
-
|
|
258
|
-
const G =
|
|
259
|
-
Array.isArray(G) && G.length > 0 &&
|
|
260
|
-
}),
|
|
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;
|
|
261
261
|
};
|
|
262
|
-
n(
|
|
263
|
-
var
|
|
264
|
-
return (
|
|
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);
|
|
265
265
|
});
|
|
266
266
|
},
|
|
267
267
|
collapseAll: () => {
|
|
268
268
|
var b;
|
|
269
|
-
const o = ((b =
|
|
270
|
-
const
|
|
271
|
-
return
|
|
272
|
-
|
|
273
|
-
const G =
|
|
274
|
-
Array.isArray(G) && G.length > 0 &&
|
|
275
|
-
}),
|
|
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;
|
|
276
276
|
};
|
|
277
|
-
n(
|
|
278
|
-
var
|
|
279
|
-
return (
|
|
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);
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
};
|
|
283
283
|
e(H);
|
|
284
284
|
const Q = () => {
|
|
285
|
-
|
|
285
|
+
h.value = [...t.columns ?? []];
|
|
286
286
|
}, ne = () => {
|
|
287
|
-
t.api &&
|
|
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
288
|
}, ie = () => {
|
|
289
|
-
s.value && (
|
|
289
|
+
s.value && (p.value = s.value.offsetWidth || 0);
|
|
290
290
|
};
|
|
291
291
|
let le = null, oe = null;
|
|
292
292
|
return we(() => {
|
|
@@ -296,67 +296,67 @@ const Ee = /* @__PURE__ */ ee({
|
|
|
296
296
|
}), Re(() => {
|
|
297
297
|
typeof window < "u" && (window.removeEventListener("resize", ie), le && oe && (le.unobserve(oe), oe = null));
|
|
298
298
|
}), U(() => t.columns, Q, { deep: !0 }), U(() => t.dataSource, () => {
|
|
299
|
-
!t.api && t.dataSource && (
|
|
299
|
+
!t.api && t.dataSource && (u.value = [...t.dataSource]);
|
|
300
300
|
}, { deep: !0 }), U(() => t.loading, (o) => {
|
|
301
|
-
|
|
302
|
-
}), { __sfc: !0, DefaultCellRenderer: a, BodyCellRenderer: y, props: t, emit: l, slots: r, tableRef:
|
|
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 };
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
|
-
function ae(
|
|
306
|
-
var s = typeof
|
|
305
|
+
function ae(x, e, l, t, a, y, r, P) {
|
|
306
|
+
var s = typeof x == "function" ? x.options : x;
|
|
307
307
|
e && (s.render = e, s.staticRenderFns = l, s._compiled = !0), t && (s.functional = !0), y && (s._scopeId = "data-v-" + y);
|
|
308
|
-
var
|
|
309
|
-
if (r ? (
|
|
310
|
-
|
|
308
|
+
var p;
|
|
309
|
+
if (r ? (p = function(D) {
|
|
310
|
+
D = D || // cached call
|
|
311
311
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
312
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
313
|
-
}, s._ssrRegister =
|
|
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() {
|
|
314
314
|
a.call(
|
|
315
315
|
this,
|
|
316
316
|
(s.functional ? this.parent : this).$root.$options.shadowRoot
|
|
317
317
|
);
|
|
318
|
-
} : a),
|
|
318
|
+
} : a), p)
|
|
319
319
|
if (s.functional) {
|
|
320
|
-
s._injectStyles =
|
|
321
|
-
var
|
|
322
|
-
s.render = function(
|
|
323
|
-
return
|
|
320
|
+
s._injectStyles = p;
|
|
321
|
+
var $ = s.render;
|
|
322
|
+
s.render = function(h, B) {
|
|
323
|
+
return p.call(B), $(h, B);
|
|
324
324
|
};
|
|
325
325
|
} else {
|
|
326
|
-
var
|
|
327
|
-
s.beforeCreate =
|
|
326
|
+
var u = s.beforeCreate;
|
|
327
|
+
s.beforeCreate = u ? [].concat(u, p) : [p];
|
|
328
328
|
}
|
|
329
329
|
return {
|
|
330
|
-
exports:
|
|
330
|
+
exports: x,
|
|
331
331
|
options: s
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
334
|
var Ie = function() {
|
|
335
|
-
var a, y, r,
|
|
335
|
+
var a, y, r, P;
|
|
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,
|
|
338
|
-
return l("div", { key:
|
|
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))]);
|
|
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
340
|
var s;
|
|
341
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
342
|
})], 2)]) : e._e(), l("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], ref: "tableWrapRef", staticClass: "ecp-pro-table__body" }, [l("el-table", e._b({ ref: "tableRef", attrs: { data: t.innerData, "row-key": t.effectiveProps.rowKey, border: t.effectiveProps.bordered, stripe: t.effectiveProps.striped, size: t.effectiveProps.size, "max-height": t.effectiveProps.maxHeight, height: t.effectiveProps.height, "default-sort": t.effectiveProps.defaultSort, "span-method": t.effectiveProps.spanMethod, "tree-props": t.effectiveProps.treeProps, "default-expand-all": t.effectiveProps.defaultExpandAll, "expand-row-keys": t.effectiveProps.expandRowKeys || [], lazy: t.effectiveProps.lazy, load: t.effectiveProps.load, "row-class-name": t.effectiveProps.rowClassName }, on: { "row-click": t.handleRowClick, "row-dblclick": t.handleRowDblclick, "sort-change": t.handleSortChange, "expand-change": t.handleExpandChange } }, "el-table", t.effectiveProps.tableProps, !1), [t.effectiveProps.rowSelection ? l("el-table-column", { attrs: { width: t.effectiveProps.rowSelection.width || 48, fixed: t.effectiveProps.rowSelection.fixed, align: "center" }, scopedSlots: e._u([{ key: "header", fn: function(s) {
|
|
343
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
344
|
} }, { key: "default", fn: function(s) {
|
|
345
|
-
var
|
|
346
|
-
return [t.effectiveProps.rowSelection.type !== "radio" ? l("el-checkbox", { attrs: { value: t.isRowSelected(s.row), disabled: t.getCheckboxDisabled(s.row) }, on: { change: (
|
|
347
|
-
|
|
348
|
-
} } }) : l("el-radio", { attrs: { value: (
|
|
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
349
|
return t.handleRadioSelect(s.row);
|
|
350
|
-
} }, nativeOn: { click: function(
|
|
351
|
-
|
|
350
|
+
} }, nativeOn: { click: function($) {
|
|
351
|
+
$.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: ((
|
|
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(
|
|
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(
|
|
356
|
-
return l("div", { key:
|
|
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
357
|
}), 0) : l("span", [e._v(e._s(s.helpMessage))])]), l("i", { staticClass: "el-icon-question" })], 2) : e._e()]];
|
|
358
|
-
} }, { key: "default", fn: function(
|
|
359
|
-
return [s.dataIndex && e.$scopedSlots[s.dataIndex] ? e._t(s.dataIndex, null, { row:
|
|
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] } })];
|
|
360
360
|
} }], null, !0) }) : e._e()];
|
|
361
361
|
}), t.effectiveProps.actionColumn ? l("el-table-column", { attrs: { label: t.effectiveProps.actionColumn.title || "操作", width: t.effectiveProps.actionColumn.width || 150, fixed: t.effectiveProps.actionColumn.fixed || "right", align: t.effectiveProps.actionColumn.align || "center" }, scopedSlots: e._u([{ key: "default", fn: function(s) {
|
|
362
362
|
return [e.$scopedSlots.action ? e._t("action", null, { record: s.row, column: t.effectiveProps.actionColumn, index: s.$index }) : e.$scopedSlots.bodyCell ? l(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: s.row, index: s.$index, value: void 0, "custom-render": t.effectiveProps.actionColumn.customRender, "value-enum": t.effectiveProps.actionColumn.valueEnum } }) : e._e()];
|
|
@@ -378,37 +378,43 @@ const Ae = Oe.exports, Ve = /* @__PURE__ */ ee({
|
|
|
378
378
|
dropDownActions: { default: () => [] },
|
|
379
379
|
stopButtonPropagation: { type: Boolean, default: !1 }
|
|
380
380
|
},
|
|
381
|
-
setup(
|
|
382
|
-
const e =
|
|
383
|
-
const { ifShow: m } =
|
|
384
|
-
return typeof m == "boolean" ? m : typeof m == "function" ? m(
|
|
385
|
-
}), y =
|
|
386
|
-
return { __sfc: !0, props: e, normalizeTooltip: l, getButtonType: t, filterVisible: a, visibleActions: y, visibleDropDownActions: r, handleClick: (h, c) => {
|
|
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) => {
|
|
387
386
|
var m;
|
|
388
|
-
e.stopButtonPropagation &&
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
|
|
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));
|
|
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);
|
|
392
398
|
}, handleDropdownCommand: (h) => {
|
|
393
|
-
var
|
|
394
|
-
const
|
|
399
|
+
var A;
|
|
400
|
+
const B = Number(h), m = r.value[B];
|
|
395
401
|
if (!(!m || m.disabled)) {
|
|
396
402
|
if (m.popConfirm) {
|
|
397
|
-
const
|
|
398
|
-
ze.confirm(
|
|
399
|
-
confirmButtonText:
|
|
400
|
-
cancelButtonText:
|
|
403
|
+
const c = m.popConfirm.title, v = m.popConfirm.okText || "确定", d = m.popConfirm.cancelText || "取消";
|
|
404
|
+
ze.confirm(c, "提示", {
|
|
405
|
+
confirmButtonText: v,
|
|
406
|
+
cancelButtonText: d,
|
|
401
407
|
type: "warning"
|
|
402
408
|
}).then(() => {
|
|
403
|
-
var
|
|
404
|
-
return (
|
|
409
|
+
var z, I;
|
|
410
|
+
return (I = (z = m.popConfirm) == null ? void 0 : z.confirm) == null ? void 0 : I.call(z);
|
|
405
411
|
}).catch(() => {
|
|
406
|
-
var
|
|
407
|
-
return (
|
|
412
|
+
var z, I;
|
|
413
|
+
return (I = (z = m.popConfirm) == null ? void 0 : z.cancel) == null ? void 0 : I.call(z);
|
|
408
414
|
});
|
|
409
415
|
return;
|
|
410
416
|
}
|
|
411
|
-
(
|
|
417
|
+
(A = m.onClick) == null || A.call(m, {});
|
|
412
418
|
}
|
|
413
419
|
} };
|
|
414
420
|
}
|
|
@@ -416,7 +422,15 @@ const Ae = Oe.exports, Ve = /* @__PURE__ */ ee({
|
|
|
416
422
|
var Ke = function() {
|
|
417
423
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
418
424
|
return l("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(a, y) {
|
|
419
|
-
return l("span", { key: `action-${y}`, staticClass: "ecp-table-action__item" }, [a.popConfirm ? l("el-popconfirm", { attrs: { title: a.popConfirm.title, "confirm-button-text": a.popConfirm.okText || "确定", "cancel-button-text": a.popConfirm.cancelText || "取消" }, on: { confirm: (r)
|
|
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);
|
|
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);
|
|
420
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) {
|
|
421
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))])])]);
|
|
422
436
|
}), 1)], 1) : e._e()], 2);
|
|
@@ -426,23 +440,23 @@ var Ke = function() {
|
|
|
426
440
|
Ne,
|
|
427
441
|
!1,
|
|
428
442
|
null,
|
|
429
|
-
"
|
|
443
|
+
"f319e73a",
|
|
430
444
|
null,
|
|
431
445
|
null
|
|
432
446
|
);
|
|
433
447
|
const ke = We.exports;
|
|
434
|
-
function ht(
|
|
435
|
-
const e =
|
|
448
|
+
function ht(x) {
|
|
449
|
+
const e = k(null), l = () => x ? ye(x) : void 0, t = () => {
|
|
436
450
|
const r = ye(e);
|
|
437
451
|
if (!r)
|
|
438
452
|
throw new Error("ProTable instance has not been registered");
|
|
439
453
|
return r;
|
|
440
454
|
}, a = (r) => {
|
|
441
455
|
e.value = r;
|
|
442
|
-
const
|
|
443
|
-
|
|
456
|
+
const P = l();
|
|
457
|
+
P && Object.keys(P).length > 0 && r.setProps(P);
|
|
444
458
|
};
|
|
445
|
-
return
|
|
459
|
+
return x && U(
|
|
446
460
|
() => l(),
|
|
447
461
|
(r) => {
|
|
448
462
|
r && e.value && e.value.setProps(r);
|
|
@@ -464,21 +478,21 @@ function ht(F) {
|
|
|
464
478
|
clearSelectedRowKeys: () => t().clearSelectedRowKeys(),
|
|
465
479
|
setSelectedRowKeys: (r) => t().setSelectedRowKeys(r),
|
|
466
480
|
deleteSelectRowByKey: (r) => t().deleteSelectRowByKey(r),
|
|
467
|
-
updateTableData: (r,
|
|
468
|
-
updateTableDataRecord: (r,
|
|
481
|
+
updateTableData: (r, P, s) => t().updateTableData(r, P, s),
|
|
482
|
+
updateTableDataRecord: (r, P) => t().updateTableDataRecord(r, P),
|
|
469
483
|
deleteTableDataRecord: (r) => t().deleteTableDataRecord(r),
|
|
470
|
-
insertTableDataRecord: (r,
|
|
484
|
+
insertTableDataRecord: (r, P) => t().insertTableDataRecord(r, P),
|
|
471
485
|
getPaginationRef: () => t().getPaginationRef(),
|
|
472
486
|
getShowPagination: () => t().getShowPagination(),
|
|
473
487
|
setShowPagination: (r) => t().setShowPagination(r),
|
|
474
488
|
getRowSelection: () => t().getRowSelection(),
|
|
475
489
|
expandAll: () => {
|
|
476
|
-
var r,
|
|
477
|
-
return (
|
|
490
|
+
var r, P;
|
|
491
|
+
return (P = (r = t()).expandAll) == null ? void 0 : P.call(r);
|
|
478
492
|
},
|
|
479
493
|
collapseAll: () => {
|
|
480
|
-
var r,
|
|
481
|
-
return (
|
|
494
|
+
var r, P;
|
|
495
|
+
return (P = (r = t()).collapseAll) == null ? void 0 : P.call(r);
|
|
482
496
|
}
|
|
483
497
|
}];
|
|
484
498
|
}
|
|
@@ -498,19 +512,19 @@ const qe = /* @__PURE__ */ ee({
|
|
|
498
512
|
multiple: { type: Boolean }
|
|
499
513
|
},
|
|
500
514
|
emits: ["input"],
|
|
501
|
-
setup(
|
|
502
|
-
const e =
|
|
515
|
+
setup(x) {
|
|
516
|
+
const e = x, l = k(!1), t = k([]), a = (r) => {
|
|
503
517
|
e.lazy && r && y();
|
|
504
518
|
}, y = async () => {
|
|
505
519
|
if (e.api) {
|
|
506
520
|
l.value = !0;
|
|
507
521
|
try {
|
|
508
|
-
const r = await e.api(e.params),
|
|
509
|
-
t.value =
|
|
510
|
-
const
|
|
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 = $;
|
|
511
525
|
return {
|
|
512
|
-
label: String(
|
|
513
|
-
value:
|
|
526
|
+
label: String(u[s] ?? u.label ?? ""),
|
|
527
|
+
value: u[p] ?? u.value
|
|
514
528
|
};
|
|
515
529
|
});
|
|
516
530
|
} finally {
|
|
@@ -565,87 +579,87 @@ const Ue = Ge.exports, Xe = /* @__PURE__ */ ee({
|
|
|
565
579
|
clearable: { type: Boolean }
|
|
566
580
|
},
|
|
567
581
|
emits: ["input"],
|
|
568
|
-
setup(
|
|
569
|
-
const l =
|
|
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(() => ({
|
|
570
584
|
label: l.labelField,
|
|
571
585
|
children: l.childrenField
|
|
572
586
|
}));
|
|
573
|
-
function
|
|
574
|
-
const
|
|
575
|
-
return
|
|
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;
|
|
576
590
|
}
|
|
577
|
-
function
|
|
578
|
-
const
|
|
591
|
+
function D(g, L = "") {
|
|
592
|
+
const O = {}, W = l.labelField ?? "label", X = l.valueField ?? "value", K = l.childrenField ?? "children";
|
|
579
593
|
for (const q of g) {
|
|
580
594
|
const Y = String(q[W] ?? q.label ?? ""), j = q[X] ?? q.value;
|
|
581
|
-
j != null && (
|
|
582
|
-
const te = q[
|
|
583
|
-
Array.isArray(te) && te.length && Object.assign(
|
|
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));
|
|
584
598
|
}
|
|
585
|
-
return
|
|
599
|
+
return O;
|
|
586
600
|
}
|
|
587
|
-
function
|
|
601
|
+
function h() {
|
|
588
602
|
const g = l.treeData;
|
|
589
603
|
return Array.isArray(g) && g.length > 0;
|
|
590
604
|
}
|
|
591
|
-
function
|
|
592
|
-
s.value = g,
|
|
605
|
+
function B(g) {
|
|
606
|
+
s.value = g, p.value = D(g);
|
|
593
607
|
}
|
|
594
|
-
function
|
|
608
|
+
function m() {
|
|
595
609
|
const g = l.treeData;
|
|
596
610
|
if (!Array.isArray(g) || g.length === 0)
|
|
597
611
|
return;
|
|
598
|
-
const
|
|
599
|
-
|
|
612
|
+
const L = g.map((O) => u(O));
|
|
613
|
+
B(L);
|
|
600
614
|
}
|
|
601
|
-
const
|
|
615
|
+
const A = R(() => l.value == null || l.value === "" ? "" : p.value[String(l.value)] ?? String(l.value)), c = (g, L) => {
|
|
602
616
|
if (!g)
|
|
603
617
|
return !0;
|
|
604
|
-
const
|
|
605
|
-
return String(
|
|
618
|
+
const O = l.labelField ?? "label";
|
|
619
|
+
return String(L[O] ?? L.label ?? "").toLowerCase().includes(g.toLowerCase());
|
|
606
620
|
};
|
|
607
|
-
U(
|
|
608
|
-
var
|
|
609
|
-
(
|
|
621
|
+
U(P, (g) => {
|
|
622
|
+
var L;
|
|
623
|
+
(L = a.value) == null || L.filter(g);
|
|
610
624
|
});
|
|
611
|
-
let
|
|
612
|
-
function
|
|
613
|
-
l.disabled || (y.value = !0, l.lazy && !
|
|
614
|
-
|
|
615
|
-
t.value && !t.value.contains(g.target) &&
|
|
616
|
-
}, document.addEventListener("click",
|
|
625
|
+
let v = null;
|
|
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);
|
|
617
631
|
}));
|
|
618
632
|
}
|
|
619
|
-
function
|
|
620
|
-
y.value = !1,
|
|
633
|
+
function z() {
|
|
634
|
+
y.value = !1, P.value = "", v && (document.removeEventListener("click", v), v = null);
|
|
621
635
|
}
|
|
622
|
-
function
|
|
636
|
+
function I() {
|
|
623
637
|
e("input", void 0);
|
|
624
638
|
}
|
|
625
639
|
function M(g) {
|
|
626
|
-
const
|
|
627
|
-
e("input",
|
|
640
|
+
const L = l.valueField ?? "value", O = g[L] ?? g.value;
|
|
641
|
+
e("input", O), z();
|
|
628
642
|
}
|
|
629
643
|
async function N() {
|
|
630
|
-
if (!(!l.api ||
|
|
644
|
+
if (!(!l.api || h())) {
|
|
631
645
|
r.value = !0;
|
|
632
646
|
try {
|
|
633
|
-
const g = await l.api(l.params),
|
|
634
|
-
s.value =
|
|
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);
|
|
635
649
|
} finally {
|
|
636
650
|
r.value = !1;
|
|
637
651
|
}
|
|
638
652
|
}
|
|
639
653
|
}
|
|
640
654
|
return we(() => {
|
|
641
|
-
|
|
655
|
+
h() ? m() : l.lazy || N();
|
|
642
656
|
}), U(() => l.treeData, () => {
|
|
643
|
-
|
|
657
|
+
h() ? m() : (s.value = [], p.value = {}, !l.lazy && l.api && N());
|
|
644
658
|
}, { deep: !0 }), U(() => l.api, () => {
|
|
645
|
-
|
|
659
|
+
h() || (l.lazy ? (s.value = [], p.value = {}) : N());
|
|
646
660
|
}, { deep: !0 }), U(() => l.params, () => {
|
|
647
|
-
|
|
648
|
-
}, { deep: !0 }), { __sfc: !0, props: l, emit: e, rootRef: t, treeRef: a, dropdownVisible: y, loading: r, filterText:
|
|
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 };
|
|
649
663
|
}
|
|
650
664
|
});
|
|
651
665
|
var Ze = function() {
|
|
@@ -675,8 +689,8 @@ const Ye = Qe.exports, et = /* @__PURE__ */ ee({
|
|
|
675
689
|
formActionType: null,
|
|
676
690
|
customComponents: null
|
|
677
691
|
},
|
|
678
|
-
setup(
|
|
679
|
-
const e =
|
|
692
|
+
setup(x) {
|
|
693
|
+
const e = x, l = /* @__PURE__ */ new Set([
|
|
680
694
|
"input",
|
|
681
695
|
"select",
|
|
682
696
|
"api-select",
|
|
@@ -688,63 +702,63 @@ const Ye = Qe.exports, et = /* @__PURE__ */ ee({
|
|
|
688
702
|
"cascader",
|
|
689
703
|
"checkbox",
|
|
690
704
|
"radio"
|
|
691
|
-
]), t =
|
|
705
|
+
]), t = Pe(), a = R(() => ({
|
|
692
706
|
schema: e.schema,
|
|
693
707
|
values: e.formModel,
|
|
694
708
|
model: e.formModel,
|
|
695
709
|
field: e.schema.field
|
|
696
|
-
})), y =
|
|
697
|
-
const
|
|
698
|
-
return
|
|
699
|
-
}), r =
|
|
700
|
-
const
|
|
701
|
-
return
|
|
702
|
-
}),
|
|
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(() => {
|
|
703
717
|
if (e.formDisabled)
|
|
704
718
|
return !0;
|
|
705
|
-
const
|
|
706
|
-
return
|
|
707
|
-
}), s =
|
|
708
|
-
const
|
|
709
|
-
return
|
|
710
|
-
}),
|
|
711
|
-
const
|
|
712
|
-
if (!
|
|
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)
|
|
713
727
|
return { props: {}, listeners: {} };
|
|
714
|
-
const
|
|
728
|
+
const v = typeof c == "function" ? c({
|
|
715
729
|
...a.value,
|
|
716
730
|
formActionType: e.formActionType
|
|
717
|
-
}) : { ...
|
|
718
|
-
for (const [
|
|
719
|
-
if (
|
|
720
|
-
const N =
|
|
721
|
-
|
|
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;
|
|
722
736
|
} else
|
|
723
|
-
|
|
724
|
-
return { props:
|
|
725
|
-
}),
|
|
726
|
-
const
|
|
727
|
-
return Array.isArray(
|
|
728
|
-
},
|
|
729
|
-
const
|
|
730
|
-
return
|
|
731
|
-
}),
|
|
732
|
-
e.formModel[e.schema.field] =
|
|
733
|
-
},
|
|
734
|
-
const
|
|
735
|
-
return
|
|
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 ? {
|
|
736
750
|
render() {
|
|
737
|
-
const
|
|
738
|
-
return Array.isArray(
|
|
751
|
+
const v = c(a.value);
|
|
752
|
+
return Array.isArray(v) ? ce("span", v) : v;
|
|
739
753
|
}
|
|
740
754
|
} : null;
|
|
741
755
|
});
|
|
742
|
-
return { __sfc: !0, BUILT_IN_COMPONENTS: l, props: e, slots: t, renderParams: a, shouldRender: y, shouldShow: r, effectiveDisabled:
|
|
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 };
|
|
743
757
|
}
|
|
744
758
|
});
|
|
745
759
|
var tt = function() {
|
|
746
760
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
747
|
-
return t.shouldRender ? l("el-form-item", { directives: [{ name: "show", rawName: "v-show", value: t.shouldShow, expression: "shouldShow" }], attrs: { prop: e.schema.field, required: e.schema.required, rules: t.effectiveRules } }, [l("template", { slot: "label" }, [l("span", [e._v(e._s(e.schema.label))]), e.schema.helpMessage ? l("el-tooltip", e._b({ attrs: { placement: "top", effect: "light" } }, "el-tooltip", e.schema.helpComponentProps || {}, !1), [l("template", { slot: "content" }, [Array.isArray(e.schema.helpMessage) ? e._l(e.schema.helpMessage, function(a, y) {
|
|
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) {
|
|
748
762
|
return l("div", { key: y, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(a) + " ")]);
|
|
749
763
|
}) : l("span", [e._v(e._s(e.schema.helpMessage))])], 2), l("i", { staticClass: "el-icon-question ecp-pro-form-item__help-icon" })], 2) : e._e()], 1), e.schema.render ? [l(t.renderComponent, { tag: "component" })] : t.hasSlot ? e._t("default", null, { model: e.formModel, schema: e.schema, field: e.schema.field, values: e.formModel }) : [t.resolvedCustomComponent ? l(t.resolvedCustomComponent, e._g(e._b({ tag: "component", attrs: { value: e.formModel[e.schema.field], placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请输入${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, on: { input: t.setFieldValue } }, "component", t.effectiveComponentProps, !1), t.effectiveComponentListeners)) : e.schema.component === "input" || !e.schema.component ? l("el-input", e._g(e._b({ attrs: { placeholder: e.schema.placeholder || (e.autoPlaceholder ? `请输入${e.schema.label}` : void 0), disabled: t.effectiveDisabled }, model: { value: e.formModel[e.schema.field], callback: function(a) {
|
|
750
764
|
e.$set(e.formModel, e.schema.field, a);
|
|
@@ -777,7 +791,7 @@ var tt = function() {
|
|
|
777
791
|
lt,
|
|
778
792
|
!1,
|
|
779
793
|
null,
|
|
780
|
-
"
|
|
794
|
+
"2227d67d",
|
|
781
795
|
null,
|
|
782
796
|
null
|
|
783
797
|
);
|
|
@@ -798,7 +812,7 @@ const Te = ot.exports, at = /* @__PURE__ */ ee({
|
|
|
798
812
|
actionColOptions: null
|
|
799
813
|
},
|
|
800
814
|
emits: ["submit", "reset", "toggle"],
|
|
801
|
-
setup(
|
|
815
|
+
setup(x) {
|
|
802
816
|
return { __sfc: !0 };
|
|
803
817
|
}
|
|
804
818
|
});
|
|
@@ -850,20 +864,20 @@ const De = rt.exports, it = /* @__PURE__ */ ee({
|
|
|
850
864
|
components: null
|
|
851
865
|
},
|
|
852
866
|
emits: ["submit", "reset", "register"],
|
|
853
|
-
setup(
|
|
854
|
-
const t =
|
|
855
|
-
const
|
|
856
|
-
return
|
|
857
|
-
}, { getSetting:
|
|
858
|
-
...
|
|
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 ?? {},
|
|
859
873
|
...t.components ?? {},
|
|
860
|
-
...
|
|
861
|
-
})),
|
|
862
|
-
let w = 24,
|
|
874
|
+
...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;
|
|
863
877
|
for (const Q of i) {
|
|
864
|
-
const ne =
|
|
878
|
+
const ne = B(Q.colProps, _, C);
|
|
865
879
|
if (ne > w) {
|
|
866
|
-
if (
|
|
880
|
+
if (E++, E > S)
|
|
867
881
|
break;
|
|
868
882
|
w = 24 - ne;
|
|
869
883
|
} else
|
|
@@ -871,90 +885,90 @@ const De = rt.exports, it = /* @__PURE__ */ ee({
|
|
|
871
885
|
H++;
|
|
872
886
|
}
|
|
873
887
|
return H;
|
|
874
|
-
},
|
|
875
|
-
const i =
|
|
876
|
-
if (!
|
|
888
|
+
}, I = R(() => {
|
|
889
|
+
const i = u.value.filter((w) => g(w));
|
|
890
|
+
if (!A.value.showAdvancedButton)
|
|
877
891
|
return !1;
|
|
878
|
-
const _ =
|
|
879
|
-
return console.log(i.length,
|
|
880
|
-
}), M =
|
|
881
|
-
const i =
|
|
882
|
-
if (!
|
|
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)
|
|
883
897
|
return i;
|
|
884
|
-
const _ =
|
|
885
|
-
return i.slice(0,
|
|
898
|
+
const _ = A.value.alwaysShowLines ?? 1, S = A.value.baseColProps, C = z(i, S, _, d.value);
|
|
899
|
+
return i.slice(0, C);
|
|
886
900
|
}), g = (i) => {
|
|
887
901
|
let _ = !0, S = !0;
|
|
888
|
-
return typeof i.ifShow == "function" && (_ = i.ifShow({ schema: i, values:
|
|
889
|
-
},
|
|
890
|
-
const i = {}, _ = {}, S =
|
|
891
|
-
|
|
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) => {
|
|
892
906
|
var w;
|
|
893
|
-
i[
|
|
894
|
-
}),
|
|
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 = _;
|
|
895
909
|
}, X = (i) => {
|
|
896
910
|
const _ = { ...i };
|
|
897
|
-
return
|
|
898
|
-
const
|
|
899
|
-
if (
|
|
911
|
+
return u.value.forEach((S) => {
|
|
912
|
+
const C = S.ifShow;
|
|
913
|
+
if (C === void 0)
|
|
900
914
|
return;
|
|
901
|
-
(typeof
|
|
915
|
+
(typeof C == "boolean" ? C : C({ schema: S, values: i, model: i, field: S.field })) || delete _[S.field];
|
|
902
916
|
}), _;
|
|
903
|
-
},
|
|
904
|
-
const _ = X(i), S =
|
|
917
|
+
}, K = (i) => {
|
|
918
|
+
const _ = X(i), S = D.value.fieldMapToTime;
|
|
905
919
|
if (!(S != null && S.length))
|
|
906
920
|
return _;
|
|
907
|
-
const
|
|
908
|
-
return S.forEach(([w, [
|
|
909
|
-
const Q =
|
|
910
|
-
Array.isArray(Q) && Q.length === 2 && (delete
|
|
911
|
-
}),
|
|
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;
|
|
912
926
|
}, q = async () => {
|
|
913
927
|
var i;
|
|
914
928
|
try {
|
|
915
|
-
await ((i = y.value) == null ? void 0 : i.validate()),
|
|
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 })));
|
|
916
930
|
} catch (_) {
|
|
917
931
|
console.error("Form validation failed:", _);
|
|
918
932
|
} finally {
|
|
919
|
-
|
|
933
|
+
P.value = !1;
|
|
920
934
|
}
|
|
921
935
|
}, Y = async () => {
|
|
922
936
|
var i;
|
|
923
|
-
|
|
924
|
-
}, j = (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 () => {
|
|
925
939
|
var i;
|
|
926
940
|
(i = y.value) == null || i.resetFields(), W();
|
|
927
941
|
}, de = (i) => {
|
|
928
942
|
var _;
|
|
929
943
|
return ((_ = y.value) == null ? void 0 : _.validate(i)) ?? Promise.resolve();
|
|
930
|
-
}, fe = (i) => y.value ? i != null && i.length ? Promise.all(i.map((_) => new Promise((S,
|
|
931
|
-
y.value.validateField(_, (w) => w ? S(void 0) :
|
|
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")));
|
|
932
946
|
}))) : y.value.validate() : Promise.resolve(), pe = async (i, _) => {
|
|
933
|
-
var
|
|
934
|
-
const S = (
|
|
947
|
+
var C;
|
|
948
|
+
const S = (C = r.value) == null ? void 0 : C.querySelector(`[data-field="${i}"]`);
|
|
935
949
|
return S && S.scrollIntoView({ behavior: (_ == null ? void 0 : _.behavior) ?? "smooth", block: (_ == null ? void 0 : _.block) ?? "nearest" }), Promise.resolve();
|
|
936
950
|
}, ve = (i) => {
|
|
937
951
|
var _;
|
|
938
952
|
(_ = y.value) == null || _.clearValidate(i);
|
|
939
953
|
}, Z = async (i) => {
|
|
940
954
|
(Array.isArray(i) ? i : [i]).forEach((S) => {
|
|
941
|
-
const
|
|
942
|
-
|
|
955
|
+
const C = u.value.findIndex((w) => w.field === S.field);
|
|
956
|
+
C >= 0 && (u.value[C] = { ...u.value[C], ...S });
|
|
943
957
|
});
|
|
944
958
|
}, me = async (i, _, S) => {
|
|
945
959
|
if (S)
|
|
946
|
-
|
|
960
|
+
u.value.unshift(i);
|
|
947
961
|
else if (_) {
|
|
948
|
-
const
|
|
949
|
-
|
|
962
|
+
const C = u.value.findIndex((w) => w.field === _);
|
|
963
|
+
u.value.splice(C + 1, 0, i);
|
|
950
964
|
} else
|
|
951
|
-
|
|
965
|
+
u.value.push(i);
|
|
952
966
|
W();
|
|
953
967
|
}, he = async (i) => {
|
|
954
968
|
const _ = Array.isArray(i) ? i : [i];
|
|
955
|
-
|
|
969
|
+
u.value = u.value.filter((S) => !_.includes(S.field));
|
|
956
970
|
}, be = async (i) => {
|
|
957
|
-
|
|
971
|
+
D.value = { ...D.value, ...i }, i.schemas && (u.value = [...i.schemas], W());
|
|
958
972
|
}, J = {
|
|
959
973
|
getFieldsValue: te,
|
|
960
974
|
setFieldsValue: j,
|
|
@@ -971,15 +985,15 @@ const De = rt.exports, it = /* @__PURE__ */ ee({
|
|
|
971
985
|
};
|
|
972
986
|
e(J);
|
|
973
987
|
const se = () => {
|
|
974
|
-
|
|
988
|
+
u.value = [...t.schemas ?? []], W();
|
|
975
989
|
}, re = () => {
|
|
976
|
-
typeof window < "u" && (
|
|
990
|
+
typeof window < "u" && (d.value = window.innerWidth);
|
|
977
991
|
};
|
|
978
992
|
return we(() => {
|
|
979
993
|
se(), l("register", J), typeof window < "u" && window.addEventListener("resize", re);
|
|
980
994
|
}), Re(() => {
|
|
981
995
|
typeof window < "u" && window.removeEventListener("resize", re);
|
|
982
|
-
}), U(() => [t.schemas, t.initialValues], se, { deep: !0 }), { __sfc: !0, props: t, emit: l, slots: a, formRef: y, formWrapRef: r, submitLoading:
|
|
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 };
|
|
983
997
|
}
|
|
984
998
|
});
|
|
985
999
|
var ct = function() {
|
|
@@ -1003,68 +1017,68 @@ var ct = function() {
|
|
|
1003
1017
|
null
|
|
1004
1018
|
);
|
|
1005
1019
|
const Me = dt.exports;
|
|
1006
|
-
function bt(
|
|
1007
|
-
const e =
|
|
1008
|
-
e.value =
|
|
1009
|
-
const
|
|
1010
|
-
|
|
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;
|
|
1023
|
+
const d = t();
|
|
1024
|
+
d && Object.keys(d).length > 0 && v.setProps(d);
|
|
1011
1025
|
};
|
|
1012
|
-
return
|
|
1026
|
+
return x && U(
|
|
1013
1027
|
() => t(),
|
|
1014
|
-
(
|
|
1015
|
-
l.value =
|
|
1028
|
+
(v) => {
|
|
1029
|
+
l.value = v, v && e.value && e.value.setProps(v);
|
|
1016
1030
|
},
|
|
1017
1031
|
{ deep: !0 }
|
|
1018
1032
|
), [a, {
|
|
1019
1033
|
register: a,
|
|
1020
1034
|
formAction: e,
|
|
1021
1035
|
getFieldsValue: () => {
|
|
1022
|
-
var
|
|
1023
|
-
return ((
|
|
1036
|
+
var v;
|
|
1037
|
+
return ((v = e.value) == null ? void 0 : v.getFieldsValue()) ?? {};
|
|
1024
1038
|
},
|
|
1025
|
-
setFieldsValue: async (
|
|
1026
|
-
var
|
|
1027
|
-
await ((
|
|
1039
|
+
setFieldsValue: async (v) => {
|
|
1040
|
+
var d;
|
|
1041
|
+
await ((d = e.value) == null ? void 0 : d.setFieldsValue(v));
|
|
1028
1042
|
},
|
|
1029
1043
|
resetFields: async () => {
|
|
1030
|
-
var
|
|
1031
|
-
await ((
|
|
1044
|
+
var v;
|
|
1045
|
+
await ((v = e.value) == null ? void 0 : v.resetFields());
|
|
1032
1046
|
},
|
|
1033
|
-
validate: (
|
|
1034
|
-
var
|
|
1035
|
-
return ((
|
|
1047
|
+
validate: (v) => {
|
|
1048
|
+
var d;
|
|
1049
|
+
return ((d = e.value) == null ? void 0 : d.validate(v)) ?? Promise.resolve();
|
|
1036
1050
|
},
|
|
1037
|
-
validateFields: (
|
|
1038
|
-
var
|
|
1039
|
-
return ((
|
|
1051
|
+
validateFields: (v) => {
|
|
1052
|
+
var d;
|
|
1053
|
+
return ((d = e.value) == null ? void 0 : d.validateFields(v)) ?? Promise.resolve();
|
|
1040
1054
|
},
|
|
1041
1055
|
submit: () => {
|
|
1042
|
-
var
|
|
1043
|
-
return ((
|
|
1056
|
+
var v;
|
|
1057
|
+
return ((v = e.value) == null ? void 0 : v.submit()) ?? Promise.resolve();
|
|
1044
1058
|
},
|
|
1045
|
-
scrollToField: (
|
|
1046
|
-
var
|
|
1047
|
-
return ((
|
|
1059
|
+
scrollToField: (v, d) => {
|
|
1060
|
+
var z;
|
|
1061
|
+
return ((z = e.value) == null ? void 0 : z.scrollToField(v, d)) ?? Promise.resolve();
|
|
1048
1062
|
},
|
|
1049
|
-
clearValidate: (
|
|
1050
|
-
var
|
|
1051
|
-
(
|
|
1063
|
+
clearValidate: (v) => {
|
|
1064
|
+
var d;
|
|
1065
|
+
(d = e.value) == null || d.clearValidate(v);
|
|
1052
1066
|
},
|
|
1053
|
-
updateSchema: (
|
|
1054
|
-
var
|
|
1055
|
-
return ((
|
|
1067
|
+
updateSchema: (v) => {
|
|
1068
|
+
var d;
|
|
1069
|
+
return ((d = e.value) == null ? void 0 : d.updateSchema(v)) ?? Promise.resolve();
|
|
1056
1070
|
},
|
|
1057
|
-
appendSchemaByField: (
|
|
1058
|
-
var
|
|
1059
|
-
return ((
|
|
1071
|
+
appendSchemaByField: (v, d, z) => {
|
|
1072
|
+
var I;
|
|
1073
|
+
return ((I = e.value) == null ? void 0 : I.appendSchemaByField(v, d, z)) ?? Promise.resolve();
|
|
1060
1074
|
},
|
|
1061
|
-
removeSchemaByField: (
|
|
1062
|
-
var
|
|
1063
|
-
return ((
|
|
1075
|
+
removeSchemaByField: (v) => {
|
|
1076
|
+
var d;
|
|
1077
|
+
return ((d = e.value) == null ? void 0 : d.removeSchemaByField(v)) ?? Promise.resolve();
|
|
1064
1078
|
},
|
|
1065
|
-
setProps: async (
|
|
1066
|
-
var
|
|
1067
|
-
l.value = { ...l.value, ...
|
|
1079
|
+
setProps: async (v) => {
|
|
1080
|
+
var d;
|
|
1081
|
+
l.value = { ...l.value, ...v }, await ((d = e.value) == null ? void 0 : d.setProps(v));
|
|
1068
1082
|
}
|
|
1069
1083
|
}];
|
|
1070
1084
|
}
|
|
@@ -1075,9 +1089,9 @@ const ft = [
|
|
|
1075
1089
|
{ name: "ProFormItem", component: Te },
|
|
1076
1090
|
{ name: "FormActions", component: De }
|
|
1077
1091
|
];
|
|
1078
|
-
function pt(
|
|
1092
|
+
function pt(x) {
|
|
1079
1093
|
ft.forEach(({ name: e, component: l }) => {
|
|
1080
|
-
|
|
1094
|
+
x.component(e, l);
|
|
1081
1095
|
});
|
|
1082
1096
|
}
|
|
1083
1097
|
const _t = {
|