@aspire-ui/element-component-pro 1.0.15 → 1.0.16
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/dist/ProForm/ApiSelect.vue.d.ts +1 -0
- package/dist/ProForm/ProForm.vue.d.ts +2 -5
- package/dist/ProForm/useForm.d.ts +3 -0
- package/dist/element-component-pro.es.js +559 -540
- 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 +2 -8
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +13 -9
- package/package.json +1 -1
- package/src/ProForm/ApiSelect.vue +5 -0
- package/src/ProForm/ProForm.vue +8 -5
- package/src/ProForm/useForm.ts +21 -0
- package/src/types/index.ts +15 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as Xe, defineComponent as le, h as ue, useSlots as Ae, ref as D, computed as
|
|
1
|
+
import { reactive as Xe, defineComponent as le, h as ue, useSlots as Ae, ref as D, computed as S, onMounted as me, nextTick as We, onUnmounted as Fe, watch as Y, unref as pe } from "vue";
|
|
2
2
|
import { MessageBox as Ze } from "element-ui";
|
|
3
3
|
const fe = Xe({});
|
|
4
4
|
function Me(c, e) {
|
|
@@ -7,14 +7,14 @@ function Me(c, e) {
|
|
|
7
7
|
for (const n in e)
|
|
8
8
|
if (Object.prototype.hasOwnProperty.call(e, n)) {
|
|
9
9
|
const t = c[n], o = e[n];
|
|
10
|
-
|
|
10
|
+
Oe(o) ? Oe(t) ? c[n] = Me(
|
|
11
11
|
t,
|
|
12
12
|
o
|
|
13
13
|
) : c[n] = { ...o } : c[n] = o;
|
|
14
14
|
}
|
|
15
15
|
return c;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function Oe(c) {
|
|
18
18
|
if (!c || typeof c != "object")
|
|
19
19
|
return !1;
|
|
20
20
|
const e = Object.getPrototypeOf(c);
|
|
@@ -117,74 +117,74 @@ const Qe = /* @__PURE__ */ le({
|
|
|
117
117
|
const a = l.slotRender, v = a == null ? void 0 : a({ column: l.column, record: l.record, index: l.index, value: l.value });
|
|
118
118
|
if (((Z) => Z == null ? [] : Array.isArray(Z) ? Z.filter((oe) => oe != null && oe !== !1 && !oe.isComment) : [Z])(v).length > 0)
|
|
119
119
|
return v;
|
|
120
|
-
const
|
|
121
|
-
return l.customRender && (
|
|
120
|
+
const V = { ...l.column };
|
|
121
|
+
return l.customRender && (V.customRender = l.customRender), l.valueEnum && (V.valueEnum = l.valueEnum), ue(o, { props: { column: V, record: l.record, index: l.index, value: l.value } });
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
|
-
}), r = Ae(),
|
|
125
|
-
const l =
|
|
124
|
+
}), r = Ae(), _ = D(), u = D(), g = D(0), z = D(t.loading ?? !1), y = D([]), k = D({}), p = D([]), C = D({}), b = D([]), j = D(null), { mergeSettings: N } = $e(), x = S(() => N("ProTable", { ...t, ...C.value })), q = S(() => {
|
|
125
|
+
const l = x.value.pagination;
|
|
126
126
|
return l && typeof l == "object" ? {
|
|
127
127
|
pageSize: l.pageSize ?? 10,
|
|
128
128
|
pageSizes: l.pageSizes ?? [10, 20, 50, 100]
|
|
129
129
|
} : { pageSize: 10, pageSizes: [10, 20, 50, 100] };
|
|
130
|
-
}),
|
|
130
|
+
}), A = D({
|
|
131
131
|
page: 1,
|
|
132
|
-
pageSize:
|
|
133
|
-
pageSizes:
|
|
132
|
+
pageSize: q.value.pageSize,
|
|
133
|
+
pageSizes: q.value.pageSizes,
|
|
134
134
|
total: 0
|
|
135
|
-
}),
|
|
135
|
+
}), P = S(() => !!x.value.title || !!r.tableTitle || !!r.toolbar), f = S(() => j.value !== null ? j.value : !!t.pagination && typeof t.pagination == "object"), L = S(() => x.value.pagination && typeof x.value.pagination == "object" ? !!x.value.pagination.small : !1), M = S(() => x.value.pagination && typeof x.value.pagination == "object" ? !!x.value.pagination.background : !1), T = S(() => x.value.rowKey || "id"), K = S(() => new Set(b.value.map((l) => l[T.value]))), U = S(
|
|
136
136
|
() => p.value.filter((l) => !l.hideInTable && !l.defaultHidden)
|
|
137
|
-
), H =
|
|
137
|
+
), H = S(() => {
|
|
138
138
|
var a, v;
|
|
139
139
|
let l = 0;
|
|
140
|
-
return
|
|
141
|
-
}), Q = (l) => typeof l == "number" && l > 0, G =
|
|
140
|
+
return x.value.rowSelection && (l += Number(x.value.rowSelection.width) || 48), x.value.showIndexColumn && (l += Number((a = x.value.indexColumnProps) == null ? void 0 : a.width) || 60), x.value.actionColumn && (l += Number((v = x.value.actionColumn) == null ? void 0 : v.width) || 150), l;
|
|
141
|
+
}), Q = (l) => typeof l == "number" && l > 0, G = S(() => U.value.filter((a) => ne(a) && Q(a.width)).reduce((a, v) => a + (typeof v.width == "number" ? v.width : 0), 0)), ee = S(() => U.value.filter((a) => ne(a) && typeof a.width == "string").reduce((a, v) => a + (Number(te(v)) || 80), 0)), J = (l) => l == null ? null : typeof l == "number" ? l : parseInt(String(l).replace(/px$/i, ""), 10) || null, te = (l) => {
|
|
142
142
|
const a = l.width;
|
|
143
|
-
if (Q(a) && G.value > 0 &&
|
|
144
|
-
const v =
|
|
143
|
+
if (Q(a) && G.value > 0 && g.value > 0 && typeof a == "number") {
|
|
144
|
+
const v = g.value - H.value - ee.value;
|
|
145
145
|
let F = Math.floor(v * a / G.value);
|
|
146
|
-
const E = J(l.minWidth) ?? 60,
|
|
147
|
-
return F = Math.max(E, F),
|
|
146
|
+
const E = J(l.minWidth) ?? 60, V = J(l.maxWidth);
|
|
147
|
+
return F = Math.max(E, F), V != null && (F = Math.min(V, F)), F;
|
|
148
148
|
}
|
|
149
149
|
if (typeof a == "string") {
|
|
150
150
|
const v = J(a) ?? 80, F = J(l.minWidth), E = J(l.maxWidth);
|
|
151
|
-
let
|
|
152
|
-
return F != null && (
|
|
151
|
+
let V = v;
|
|
152
|
+
return F != null && (V = Math.max(F, V)), E != null && (V = Math.min(E, V)), V;
|
|
153
153
|
}
|
|
154
154
|
return l.width;
|
|
155
|
-
}, ne = (l) => l.ifShow === !1 ? !1 : typeof l.ifShow == "function" ? l.ifShow({ column: l }) : !0,
|
|
155
|
+
}, ne = (l) => l.ifShow === !1 ? !1 : typeof l.ifShow == "function" ? l.ifShow({ column: l }) : !0, h = S(() => {
|
|
156
156
|
var a;
|
|
157
|
-
const l = (a =
|
|
157
|
+
const l = (a = x.value.rowSelection) == null ? void 0 : a.getCheckboxProps;
|
|
158
158
|
return l ? y.value.filter((v) => {
|
|
159
159
|
var F;
|
|
160
160
|
return !((F = l(v)) != null && F.disabled);
|
|
161
161
|
}) : y.value;
|
|
162
|
-
}),
|
|
163
|
-
const l =
|
|
164
|
-
return l > 0 && l <
|
|
165
|
-
}), m = (l) =>
|
|
162
|
+
}), I = S(() => h.value.length > 0), $ = S(() => h.value.length === 0 ? !1 : h.value.every((l) => K.value.has(l[T.value]))), i = S(() => {
|
|
163
|
+
const l = h.value.filter((a) => K.value.has(a[T.value])).length;
|
|
164
|
+
return l > 0 && l < h.value.length;
|
|
165
|
+
}), m = (l) => K.value.has(l[T.value]), B = (l) => {
|
|
166
166
|
var a, v, F;
|
|
167
|
-
return ((F = (v = (a =
|
|
167
|
+
return ((F = (v = (a = x.value.rowSelection) == null ? void 0 : a.getCheckboxProps) == null ? void 0 : v.call(a, l)) == null ? void 0 : F.disabled) ?? !1;
|
|
168
168
|
}, W = (l) => {
|
|
169
169
|
var a, v, F;
|
|
170
|
-
return ((F = (v = (a =
|
|
171
|
-
},
|
|
170
|
+
return ((F = (v = (a = x.value.rowSelection) == null ? void 0 : a.getRadioProps) == null ? void 0 : v.call(a, l)) == null ? void 0 : F.disabled) ?? !1;
|
|
171
|
+
}, O = () => {
|
|
172
172
|
const l = b.value.map((a) => a[T.value]);
|
|
173
173
|
n("selection-change", { keys: l, rows: b.value });
|
|
174
174
|
}, X = (l, a) => {
|
|
175
175
|
const v = l[T.value];
|
|
176
|
-
a ? b.value = [...b.value.filter((F) => F[T.value] !== v), l] : b.value = b.value.filter((F) => F[T.value] !== v),
|
|
176
|
+
a ? b.value = [...b.value.filter((F) => F[T.value] !== v), l] : b.value = b.value.filter((F) => F[T.value] !== v), O();
|
|
177
177
|
}, se = (l) => {
|
|
178
|
-
b.value = [l],
|
|
178
|
+
b.value = [l], O();
|
|
179
179
|
}, he = (l) => {
|
|
180
180
|
if (l) {
|
|
181
|
-
const a = new Set(b.value.map((F) => F[T.value])), v =
|
|
181
|
+
const a = new Set(b.value.map((F) => F[T.value])), v = h.value.filter((F) => !a.has(F[T.value]));
|
|
182
182
|
b.value = [...b.value, ...v];
|
|
183
183
|
} else {
|
|
184
184
|
const a = new Set(y.value.map((v) => v[T.value]));
|
|
185
185
|
b.value = b.value.filter((v) => !a.has(v[T.value]));
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
O();
|
|
188
188
|
}, re = async (l) => {
|
|
189
189
|
if (!t.api) {
|
|
190
190
|
if (t.dataSource)
|
|
@@ -192,39 +192,39 @@ const Qe = /* @__PURE__ */ le({
|
|
|
192
192
|
y.value = [];
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
z.value = !0;
|
|
196
196
|
try {
|
|
197
|
-
const a =
|
|
198
|
-
[v]: (l == null ? void 0 : l.page) ??
|
|
199
|
-
[F]: (l == null ? void 0 : l.pageSize) ??
|
|
197
|
+
const a = x.value.fetchSetting ?? {}, v = a.pageField ?? "page", F = a.sizeField ?? "pageSize", E = a.listField ?? "list", V = a.totalField ?? "total", Z = {
|
|
198
|
+
[v]: (l == null ? void 0 : l.page) ?? A.value.page,
|
|
199
|
+
[F]: (l == null ? void 0 : l.pageSize) ?? A.value.pageSize,
|
|
200
200
|
...t.searchInfo,
|
|
201
201
|
...l == null ? void 0 : l.searchInfo
|
|
202
202
|
};
|
|
203
|
-
(l == null ? void 0 : l.page) != null && (
|
|
203
|
+
(l == null ? void 0 : l.page) != null && (A.value.page = l.page), (l == null ? void 0 : l.pageSize) != null && (A.value.pageSize = l.pageSize);
|
|
204
204
|
const oe = t.beforeFetch ? t.beforeFetch(Z) : Z, Re = await t.api(oe);
|
|
205
205
|
k.value = Re || {};
|
|
206
|
-
const Pe = t.afterFetch ? t.afterFetch(Re) : Re, De = Pe[E] ?? Pe.items ?? Pe.list ?? [], ze = Pe[
|
|
207
|
-
y.value = De,
|
|
206
|
+
const Pe = t.afterFetch ? t.afterFetch(Re) : Re, De = Pe[E] ?? Pe.items ?? Pe.list ?? [], ze = Pe[V] ?? 0;
|
|
207
|
+
y.value = De, A.value.total = ze, n("fetch-success", { items: De, total: ze });
|
|
208
208
|
} catch (a) {
|
|
209
209
|
n("fetch-error", a);
|
|
210
210
|
} finally {
|
|
211
|
-
|
|
211
|
+
z.value = !1;
|
|
212
212
|
}
|
|
213
213
|
}, _e = () => re(void 0), be = (l) => {
|
|
214
|
-
|
|
214
|
+
x.value.clearSelectOnPageChange && (b.value = []), A.value.pageSize = l, A.value.page = 1, re(void 0);
|
|
215
215
|
}, ge = (l) => {
|
|
216
|
-
|
|
216
|
+
x.value.clearSelectOnPageChange && (b.value = []), A.value.page = l, re(void 0);
|
|
217
217
|
}, ye = (l, a, v) => n("row-click", l, v), we = (l, a, v) => n("row-dblclick", l, v), Ce = ({ prop: l, order: a }) => n("sort-change", { prop: l, order: a }), xe = (l, a) => n("expand-change", l, a), ve = (l) => y.value.findIndex((a) => a[T.value] === l), ie = {
|
|
218
218
|
setProps: (l) => {
|
|
219
|
-
|
|
219
|
+
C.value = { ...C.value, ...l };
|
|
220
220
|
},
|
|
221
221
|
reload: (l) => re(l),
|
|
222
222
|
redoHeight: () => {
|
|
223
223
|
var l, a;
|
|
224
|
-
(a = (l =
|
|
224
|
+
(a = (l = _.value) == null ? void 0 : l.doLayout) == null || a.call(l);
|
|
225
225
|
},
|
|
226
226
|
setLoading: (l) => {
|
|
227
|
-
|
|
227
|
+
z.value = l;
|
|
228
228
|
},
|
|
229
229
|
getDataSource: () => y.value,
|
|
230
230
|
getRawDataSource: () => k.value,
|
|
@@ -234,27 +234,27 @@ const Qe = /* @__PURE__ */ le({
|
|
|
234
234
|
getColumns: () => p.value,
|
|
235
235
|
setColumns: (l) => {
|
|
236
236
|
if (Array.isArray(l) && l.length > 0 && typeof l[0] == "string") {
|
|
237
|
-
const a = l, v = (t.columns ?? []).filter((E) => a.includes(E.key ?? E.dataIndex)), F = a.map((E) => v.find((
|
|
237
|
+
const a = l, v = (t.columns ?? []).filter((E) => a.includes(E.key ?? E.dataIndex)), F = a.map((E) => v.find((V) => (V.key ?? V.dataIndex) === E)).filter(Boolean);
|
|
238
238
|
F.length && (p.value = F);
|
|
239
239
|
} else
|
|
240
240
|
p.value = l ?? [];
|
|
241
241
|
},
|
|
242
242
|
setPagination: (l) => {
|
|
243
|
-
l != null && l.page && (
|
|
243
|
+
l != null && l.page && (A.value.page = l.page), l != null && l.pageSize && (A.value.pageSize = l.pageSize), (l == null ? void 0 : l.total) !== void 0 && (A.value.total = l.total);
|
|
244
244
|
},
|
|
245
245
|
getSelectRowKeys: () => b.value.map((l) => l[T.value]),
|
|
246
246
|
getSelectRows: () => b.value,
|
|
247
247
|
clearSelectedRowKeys: () => {
|
|
248
|
-
b.value = [],
|
|
248
|
+
b.value = [], O();
|
|
249
249
|
},
|
|
250
250
|
setSelectedRowKeys: (l) => {
|
|
251
251
|
const a = new Set(l), v = y.value.filter((F) => a.has(F[T.value]));
|
|
252
252
|
l.forEach((F) => {
|
|
253
253
|
v.some((E) => E[T.value] === F) || v.push({ [T.value]: F });
|
|
254
|
-
}), b.value = v,
|
|
254
|
+
}), b.value = v, O();
|
|
255
255
|
},
|
|
256
256
|
deleteSelectRowByKey: (l) => {
|
|
257
|
-
b.value = b.value.filter((a) => a[T.value] !== l),
|
|
257
|
+
b.value = b.value.filter((a) => a[T.value] !== l), O();
|
|
258
258
|
},
|
|
259
259
|
updateTableData: (l, a, v) => {
|
|
260
260
|
l < 0 || l >= y.value.length || (y.value = [...y.value], y.value[l] = { ...y.value[l], [a]: v });
|
|
@@ -272,40 +272,40 @@ const Qe = /* @__PURE__ */ le({
|
|
|
272
272
|
const v = [...y.value];
|
|
273
273
|
return a == null || a >= v.length ? v.push(l) : v.splice(a, 0, l), y.value = v, l;
|
|
274
274
|
},
|
|
275
|
-
getPaginationRef: () =>
|
|
276
|
-
getShowPagination: () =>
|
|
275
|
+
getPaginationRef: () => f.value ? { page: A.value.page, pageSize: Number(A.value.pageSize) || 10, total: A.value.total } : !1,
|
|
276
|
+
getShowPagination: () => f.value,
|
|
277
277
|
setShowPagination: (l) => {
|
|
278
278
|
j.value = l;
|
|
279
279
|
},
|
|
280
|
-
getRowSelection: () =>
|
|
280
|
+
getRowSelection: () => x.value.rowSelection,
|
|
281
281
|
expandAll: () => {
|
|
282
282
|
var F;
|
|
283
|
-
const l = ((F =
|
|
284
|
-
const
|
|
283
|
+
const l = ((F = x.value.treeProps) == null ? void 0 : F.children) ?? "children", a = (E) => {
|
|
284
|
+
const V = [];
|
|
285
285
|
return E.forEach((Z) => {
|
|
286
|
-
|
|
286
|
+
V.push(Z);
|
|
287
287
|
const oe = Z[l];
|
|
288
|
-
Array.isArray(oe) && oe.length > 0 &&
|
|
289
|
-
}),
|
|
288
|
+
Array.isArray(oe) && oe.length > 0 && V.push(...a(oe));
|
|
289
|
+
}), V;
|
|
290
290
|
};
|
|
291
291
|
a(y.value).forEach((E) => {
|
|
292
|
-
var
|
|
293
|
-
return (Z = (
|
|
292
|
+
var V, Z;
|
|
293
|
+
return (Z = (V = _.value) == null ? void 0 : V.toggleRowExpansion) == null ? void 0 : Z.call(V, E, !0);
|
|
294
294
|
});
|
|
295
295
|
},
|
|
296
296
|
collapseAll: () => {
|
|
297
297
|
var F;
|
|
298
|
-
const l = ((F =
|
|
299
|
-
const
|
|
298
|
+
const l = ((F = x.value.treeProps) == null ? void 0 : F.children) ?? "children", a = (E) => {
|
|
299
|
+
const V = [];
|
|
300
300
|
return E.forEach((Z) => {
|
|
301
|
-
|
|
301
|
+
V.push(Z);
|
|
302
302
|
const oe = Z[l];
|
|
303
|
-
Array.isArray(oe) && oe.length > 0 &&
|
|
304
|
-
}),
|
|
303
|
+
Array.isArray(oe) && oe.length > 0 && V.push(...a(oe));
|
|
304
|
+
}), V;
|
|
305
305
|
};
|
|
306
306
|
a(y.value).forEach((E) => {
|
|
307
|
-
var
|
|
308
|
-
return (Z = (
|
|
307
|
+
var V, Z;
|
|
308
|
+
return (Z = (V = _.value) == null ? void 0 : V.toggleRowExpansion) == null ? void 0 : Z.call(V, E, !1);
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
};
|
|
@@ -313,47 +313,47 @@ const Qe = /* @__PURE__ */ le({
|
|
|
313
313
|
const ce = () => {
|
|
314
314
|
p.value = [...t.columns ?? []];
|
|
315
315
|
}, de = () => {
|
|
316
|
-
t.api &&
|
|
316
|
+
t.api && x.value.immediate !== !1 ? re(void 0) : t.dataSource && (y.value = [...t.dataSource], !t.api && t.pagination !== !1 && (A.value.total = t.dataSource.length));
|
|
317
317
|
}, d = () => {
|
|
318
|
-
u.value && (
|
|
318
|
+
u.value && (g.value = u.value.offsetWidth || 0);
|
|
319
319
|
};
|
|
320
|
-
let
|
|
320
|
+
let w = null, R = null;
|
|
321
321
|
return me(() => {
|
|
322
|
-
ce(), n("register", ie), de(), typeof window < "u" && (window.addEventListener("resize", d),
|
|
323
|
-
d(),
|
|
322
|
+
ce(), n("register", ie), de(), typeof window < "u" && (window.addEventListener("resize", d), w = new ResizeObserver(d), We(() => {
|
|
323
|
+
d(), R = u.value, R && (w == null || w.observe(R));
|
|
324
324
|
}));
|
|
325
325
|
}), Fe(() => {
|
|
326
|
-
typeof window < "u" && (window.removeEventListener("resize", d),
|
|
326
|
+
typeof window < "u" && (window.removeEventListener("resize", d), w && R && (w.unobserve(R), R = null));
|
|
327
327
|
}), Y(() => t.columns, ce, { deep: !0 }), Y(() => t.dataSource, () => {
|
|
328
328
|
!t.api && t.dataSource && (y.value = [...t.dataSource]);
|
|
329
329
|
}, { deep: !0 }), Y(() => t.loading, (l) => {
|
|
330
|
-
|
|
331
|
-
}), { __sfc: !0, DefaultCellRenderer: o, BodyCellRenderer: s, props: t, emit: n, slots: r, tableRef:
|
|
330
|
+
z.value = l ?? !1;
|
|
331
|
+
}), { __sfc: !0, DefaultCellRenderer: o, BodyCellRenderer: s, props: t, emit: n, slots: r, tableRef: _, tableWrapRef: u, containerWidth: g, loading: z, innerData: y, rawDataSource: k, innerColumns: p, innerProps: C, selectedRows: b, showPaginationRef: j, mergeSettings: N, effectiveProps: x, defaultPagination: q, pagination: A, showTitleBar: P, showPagination: f, paginationSmall: L, paginationBackground: M, rowKeyField: T, selectedKeysSet: K, displayColumns: U, fixedColumnsWidth: H, isRatioWidth: Q, totalRatio: G, fixedDataColumnsWidth: ee, parseWidthPx: J, getColumnWidth: te, shouldShowColumn: ne, selectableRows: h, hasSelectableRows: I, isAllCurrentPageSelected: $, isIndeterminate: i, isRowSelected: m, getCheckboxDisabled: B, getRadioDisabled: W, emitSelectionChange: O, handleCheckboxChange: X, handleRadioSelect: se, handleSelectAll: he, fetchData: re, handleReload: _e, handleSizeChange: be, handleCurrentChange: ge, handleRowClick: ye, handleRowDblclick: we, handleSortChange: Ce, handleExpandChange: xe, findRowIndex: ve, tableAction: ie, syncColumns: ce, loadData: de, updateContainerWidth: d, resizeObserver: w, observedEl: R };
|
|
332
332
|
}
|
|
333
333
|
});
|
|
334
|
-
function ae(c, e, n, t, o, s, r,
|
|
334
|
+
function ae(c, e, n, t, o, s, r, _) {
|
|
335
335
|
var u = typeof c == "function" ? c.options : c;
|
|
336
336
|
e && (u.render = e, u.staticRenderFns = n, u._compiled = !0), t && (u.functional = !0), s && (u._scopeId = "data-v-" + s);
|
|
337
|
-
var
|
|
338
|
-
if (r ? (
|
|
337
|
+
var g;
|
|
338
|
+
if (r ? (g = function(k) {
|
|
339
339
|
k = k || // cached call
|
|
340
340
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
341
341
|
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !k && typeof __VUE_SSR_CONTEXT__ < "u" && (k = __VUE_SSR_CONTEXT__), o && o.call(this, k), k && k._registeredComponents && k._registeredComponents.add(r);
|
|
342
|
-
}, u._ssrRegister =
|
|
342
|
+
}, u._ssrRegister = g) : o && (g = _ ? function() {
|
|
343
343
|
o.call(
|
|
344
344
|
this,
|
|
345
345
|
(u.functional ? this.parent : this).$root.$options.shadowRoot
|
|
346
346
|
);
|
|
347
|
-
} : o),
|
|
347
|
+
} : o), g)
|
|
348
348
|
if (u.functional) {
|
|
349
|
-
u._injectStyles =
|
|
350
|
-
var
|
|
351
|
-
u.render = function(p,
|
|
352
|
-
return
|
|
349
|
+
u._injectStyles = g;
|
|
350
|
+
var z = u.render;
|
|
351
|
+
u.render = function(p, C) {
|
|
352
|
+
return g.call(C), z(p, C);
|
|
353
353
|
};
|
|
354
354
|
} else {
|
|
355
355
|
var y = u.beforeCreate;
|
|
356
|
-
u.beforeCreate = y ? [].concat(y,
|
|
356
|
+
u.beforeCreate = y ? [].concat(y, g) : [g];
|
|
357
357
|
}
|
|
358
358
|
return {
|
|
359
359
|
exports: c,
|
|
@@ -361,31 +361,31 @@ function ae(c, e, n, t, o, s, r, h) {
|
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
363
|
var Ye = function() {
|
|
364
|
-
var o, s, r,
|
|
364
|
+
var o, s, r, _;
|
|
365
365
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
366
|
-
return n("div", { staticClass: "ecp-pro-table" }, [t.showTitleBar ? n("div", { staticClass: "ecp-pro-table__header" }, [n("div", { staticClass: "ecp-pro-table__title-wrapper" }, [n("span", { staticClass: "ecp-pro-table__title" }, [e._v(e._s(t.effectiveProps.title))]), t.effectiveProps.titleHelpMessage ? n("el-tooltip", { staticClass: "ecp-pro-table__help", attrs: { placement: "top" } }, [n("template", { slot: "content" }, [Array.isArray(t.effectiveProps.titleHelpMessage) ? n("span", e._l(t.effectiveProps.titleHelpMessage, function(u,
|
|
367
|
-
return n("div", { key:
|
|
366
|
+
return n("div", { staticClass: "ecp-pro-table" }, [t.showTitleBar ? n("div", { staticClass: "ecp-pro-table__header" }, [n("div", { staticClass: "ecp-pro-table__title-wrapper" }, [n("span", { staticClass: "ecp-pro-table__title" }, [e._v(e._s(t.effectiveProps.title))]), t.effectiveProps.titleHelpMessage ? n("el-tooltip", { staticClass: "ecp-pro-table__help", attrs: { placement: "top" } }, [n("template", { slot: "content" }, [Array.isArray(t.effectiveProps.titleHelpMessage) ? n("span", e._l(t.effectiveProps.titleHelpMessage, function(u, g) {
|
|
367
|
+
return n("div", { key: g }, [e._v(e._s(u))]);
|
|
368
368
|
}), 0) : n("span", [e._v(e._s(t.effectiveProps.titleHelpMessage))])]), n("i", { staticClass: "el-icon-question" })], 2) : e._e()], 1), n("div", { staticClass: "ecp-pro-table__toolbar" }, [e._t("tableTitle"), e._t("toolbar"), e._t("toolbar-right", function() {
|
|
369
369
|
var u;
|
|
370
370
|
return [((u = t.effectiveProps.tableSetting) == null ? void 0 : u.redo) !== !1 ? n("el-button", { attrs: { type: "text", icon: "el-icon-refresh", size: "small" }, on: { click: t.handleReload } }, [e._v(" 刷新 ")]) : e._e()];
|
|
371
371
|
})], 2)]) : e._e(), n("div", { directives: [{ name: "loading", rawName: "v-loading", value: t.loading, expression: "loading" }], ref: "tableWrapRef", staticClass: "ecp-pro-table__body" }, [n("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 ? n("el-table-column", { attrs: { width: t.effectiveProps.rowSelection.width || 48, fixed: t.effectiveProps.rowSelection.fixed, align: "center" }, scopedSlots: e._u([{ key: "header", fn: function(u) {
|
|
372
372
|
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isAllCurrentPageSelected, indeterminate: t.isIndeterminate, disabled: !t.hasSelectableRows }, on: { change: t.handleSelectAll } }) : n("span")];
|
|
373
373
|
} }, { key: "default", fn: function(u) {
|
|
374
|
-
var
|
|
375
|
-
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isRowSelected(u.row), disabled: t.getCheckboxDisabled(u.row) }, on: { change: (
|
|
376
|
-
|
|
377
|
-
} } }) : n("el-radio", { attrs: { value: (
|
|
374
|
+
var g;
|
|
375
|
+
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isRowSelected(u.row), disabled: t.getCheckboxDisabled(u.row) }, on: { change: (z) => t.handleCheckboxChange(u.row, z) }, nativeOn: { click: function(z) {
|
|
376
|
+
z.stopPropagation();
|
|
377
|
+
} } }) : n("el-radio", { attrs: { value: (g = t.selectedRows[0]) == null ? void 0 : g[t.rowKeyField], label: u.row[t.rowKeyField], disabled: t.getRadioDisabled(u.row) }, on: { change: function(z) {
|
|
378
378
|
return t.handleRadioSelect(u.row);
|
|
379
|
-
} }, nativeOn: { click: function(
|
|
380
|
-
|
|
379
|
+
} }, nativeOn: { click: function(z) {
|
|
380
|
+
z.stopPropagation();
|
|
381
381
|
} } }, [n("span")])];
|
|
382
|
-
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? n("el-table-column", { attrs: { type: "index", label: ((o = t.effectiveProps.indexColumnProps) == null ? void 0 : o.title) || "序号", width: ((s = t.effectiveProps.indexColumnProps) == null ? void 0 : s.width) || 60, fixed: (r = t.effectiveProps.indexColumnProps) == null ? void 0 : r.fixed, align: ((
|
|
383
|
-
return [t.shouldShowColumn(u) ? n("el-table-column", { key: u.dataIndex || u.key || u.title, attrs: { prop: u.dataIndex, label: u.title, width: t.getColumnWidth(u), "min-width": t.isRatioWidth(u.width) ? void 0 : u.minWidth, fixed: u.fixed, align: u.align || "left", sortable: u.sortable, formatter: u.formatter, "show-overflow-tooltip": u.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(
|
|
384
|
-
return [u.dataIndex && e.$scopedSlots[`header-${u.dataIndex}`] ? e._t(`header-${u.dataIndex}`, null, { column: u }) : e.$scopedSlots.headerCell ? e._t("headerCell", null, { column: u }) : [n("span", [e._v(e._s(u.title))]), u.helpMessage ? n("el-tooltip", { staticClass: "ecp-pro-table__col-help", attrs: { placement: "top", effect: "dark" } }, [n("template", { slot: "content" }, [Array.isArray(u.helpMessage) ? n("span", e._l(u.helpMessage, function(
|
|
385
|
-
return n("div", { key: y }, [e._v(e._s(
|
|
382
|
+
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? n("el-table-column", { attrs: { type: "index", label: ((o = t.effectiveProps.indexColumnProps) == null ? void 0 : o.title) || "序号", width: ((s = t.effectiveProps.indexColumnProps) == null ? void 0 : s.width) || 60, fixed: (r = t.effectiveProps.indexColumnProps) == null ? void 0 : r.fixed, align: ((_ = t.effectiveProps.indexColumnProps) == null ? void 0 : _.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(u) {
|
|
383
|
+
return [t.shouldShowColumn(u) ? n("el-table-column", { key: u.dataIndex || u.key || u.title, attrs: { prop: u.dataIndex, label: u.title, width: t.getColumnWidth(u), "min-width": t.isRatioWidth(u.width) ? void 0 : u.minWidth, fixed: u.fixed, align: u.align || "left", sortable: u.sortable, formatter: u.formatter, "show-overflow-tooltip": u.ellipsis !== !1 && t.effectiveProps.ellipsis !== !1 }, scopedSlots: e._u([{ key: "header", fn: function(g) {
|
|
384
|
+
return [u.dataIndex && e.$scopedSlots[`header-${u.dataIndex}`] ? e._t(`header-${u.dataIndex}`, null, { column: u }) : e.$scopedSlots.headerCell ? e._t("headerCell", null, { column: u }) : [n("span", [e._v(e._s(u.title))]), u.helpMessage ? n("el-tooltip", { staticClass: "ecp-pro-table__col-help", attrs: { placement: "top", effect: "dark" } }, [n("template", { slot: "content" }, [Array.isArray(u.helpMessage) ? n("span", e._l(u.helpMessage, function(z, y) {
|
|
385
|
+
return n("div", { key: y }, [e._v(e._s(z))]);
|
|
386
386
|
}), 0) : n("span", [e._v(e._s(u.helpMessage))])]), n("i", { staticClass: "el-icon-question" })], 2) : e._e()]];
|
|
387
|
-
} }, { key: "default", fn: function(
|
|
388
|
-
return [u.dataIndex && e.$scopedSlots[u.dataIndex] ? e._t(u.dataIndex, null, { row:
|
|
387
|
+
} }, { key: "default", fn: function(g) {
|
|
388
|
+
return [u.dataIndex && e.$scopedSlots[u.dataIndex] ? e._t(u.dataIndex, null, { row: g.row, column: u, index: g.$index, value: g.row[u.dataIndex] }) : e.$scopedSlots.bodyCell ? n(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: u, record: g.row, index: g.$index, value: g.row[u.dataIndex], "custom-render": u.customRender, "value-enum": u.valueEnum } }) : n(t.DefaultCellRenderer, { attrs: { column: u, record: g.row, index: g.$index, value: g.row[u.dataIndex] } })];
|
|
389
389
|
} }], null, !0) }) : e._e()];
|
|
390
390
|
}), t.effectiveProps.actionColumn ? n("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(u) {
|
|
391
391
|
return [e.$scopedSlots.action ? e._t("action", null, { record: u.row, column: t.effectiveProps.actionColumn, index: u.$index }) : e.$scopedSlots.bodyCell ? n(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: u.row, index: u.$index, value: void 0, "custom-render": t.effectiveProps.actionColumn.customRender, "value-enum": t.effectiveProps.actionColumn.valueEnum } }) : e._e()];
|
|
@@ -400,7 +400,7 @@ var Ye = function() {
|
|
|
400
400
|
null,
|
|
401
401
|
null
|
|
402
402
|
);
|
|
403
|
-
const
|
|
403
|
+
const Ke = tt.exports, Ne = (c) => Array.isArray(c) ? c.length > 0 : c != null && String(c).trim() !== "", Ie = (c) => Array.isArray(c) ? c.map((e) => String(e)).join(", ") : c == null ? "" : typeof c == "object" ? JSON.stringify(c) : String(c), Te = (c, e) => {
|
|
404
404
|
if (!c)
|
|
405
405
|
return null;
|
|
406
406
|
if (c === !0)
|
|
@@ -408,7 +408,7 @@ const Le = tt.exports, Oe = (c) => Array.isArray(c) ? c.length > 0 : c != null &
|
|
|
408
408
|
content: Ie(e),
|
|
409
409
|
placement: "top",
|
|
410
410
|
effect: "dark",
|
|
411
|
-
disabled: !
|
|
411
|
+
disabled: !Ne(e)
|
|
412
412
|
};
|
|
413
413
|
if (typeof c == "string")
|
|
414
414
|
return {
|
|
@@ -417,7 +417,7 @@ const Le = tt.exports, Oe = (c) => Array.isArray(c) ? c.length > 0 : c != null &
|
|
|
417
417
|
effect: "dark"
|
|
418
418
|
};
|
|
419
419
|
const n = { ...c };
|
|
420
|
-
return Object.prototype.hasOwnProperty.call(n, "content") || (n.content = Ie(e)), Object.prototype.hasOwnProperty.call(n, "placement") || (n.placement = "top"), Object.prototype.hasOwnProperty.call(n, "effect") || (n.effect = "dark"), Object.prototype.hasOwnProperty.call(n, "disabled") || (n.disabled = !
|
|
420
|
+
return Object.prototype.hasOwnProperty.call(n, "content") || (n.content = Ie(e)), Object.prototype.hasOwnProperty.call(n, "placement") || (n.placement = "top"), Object.prototype.hasOwnProperty.call(n, "effect") || (n.effect = "dark"), Object.prototype.hasOwnProperty.call(n, "disabled") || (n.disabled = !Ne(n.content)), n;
|
|
421
421
|
}, nt = /* @__PURE__ */ le({
|
|
422
422
|
__name: "TableAction",
|
|
423
423
|
props: {
|
|
@@ -426,38 +426,38 @@ const Le = tt.exports, Oe = (c) => Array.isArray(c) ? c.length > 0 : c != null &
|
|
|
426
426
|
stopButtonPropagation: { type: Boolean, default: !1 }
|
|
427
427
|
},
|
|
428
428
|
setup(c) {
|
|
429
|
-
const e = c, n = (p) => Te(p) || {}, t = (p) => p.type ? p.type : p.color === "error" ? "danger" : p.color === "success" ? "success" : p.color === "warning" ? "warning" : "text", o = (p) => p.filter((
|
|
430
|
-
const { ifShow: b } =
|
|
431
|
-
return typeof b == "boolean" ? b : typeof b == "function" ? b(
|
|
432
|
-
}), s =
|
|
429
|
+
const e = c, n = (p) => Te(p) || {}, t = (p) => p.type ? p.type : p.color === "error" ? "danger" : p.color === "success" ? "success" : p.color === "warning" ? "warning" : "text", o = (p) => p.filter((C) => {
|
|
430
|
+
const { ifShow: b } = C;
|
|
431
|
+
return typeof b == "boolean" ? b : typeof b == "function" ? b(C) : !0;
|
|
432
|
+
}), s = S(() => o(e.actions || [])), r = S(() => o(e.dropDownActions || [])), _ = (p, C) => {
|
|
433
433
|
var b;
|
|
434
|
-
e.stopButtonPropagation &&
|
|
435
|
-
}, u = (p,
|
|
436
|
-
|
|
437
|
-
},
|
|
438
|
-
var j,
|
|
439
|
-
e.stopButtonPropagation && b.stopPropagation(), p.popConfirm && (
|
|
434
|
+
e.stopButtonPropagation && C.stopPropagation(), (b = p.onClick) == null || b.call(p, C);
|
|
435
|
+
}, u = (p, C) => {
|
|
436
|
+
_(p, C);
|
|
437
|
+
}, g = (p, C, b) => {
|
|
438
|
+
var j, N, x, q;
|
|
439
|
+
e.stopButtonPropagation && b.stopPropagation(), p.popConfirm && (C === "confirm" ? (N = (j = p.popConfirm).confirm) == null || N.call(j) : (q = (x = p.popConfirm).cancel) == null || q.call(x));
|
|
440
440
|
};
|
|
441
|
-
return { __sfc: !0, props: e, normalizeTooltip: n, getButtonType: t, filterVisible: o, visibleActions: s, visibleDropDownActions: r, handleClick:
|
|
442
|
-
|
|
443
|
-
}, handlePopConfirmCancel: (p,
|
|
444
|
-
|
|
441
|
+
return { __sfc: !0, props: e, normalizeTooltip: n, getButtonType: t, filterVisible: o, visibleActions: s, visibleDropDownActions: r, handleClick: _, handleActionClick: u, handlePopConfirm: g, handlePopConfirmConfirm: (p, C) => {
|
|
442
|
+
g(p, "confirm", C);
|
|
443
|
+
}, handlePopConfirmCancel: (p, C) => {
|
|
444
|
+
g(p, "cancel", C);
|
|
445
445
|
}, handleDropdownCommand: (p) => {
|
|
446
446
|
var j;
|
|
447
|
-
const
|
|
447
|
+
const C = Number(p), b = r.value[C];
|
|
448
448
|
if (!(!b || b.disabled)) {
|
|
449
449
|
if (b.popConfirm) {
|
|
450
|
-
const
|
|
451
|
-
Ze.confirm(
|
|
452
|
-
confirmButtonText:
|
|
453
|
-
cancelButtonText:
|
|
450
|
+
const N = b.popConfirm.title, x = b.popConfirm.okText || "确定", q = b.popConfirm.cancelText || "取消";
|
|
451
|
+
Ze.confirm(N, "提示", {
|
|
452
|
+
confirmButtonText: x,
|
|
453
|
+
cancelButtonText: q,
|
|
454
454
|
type: "warning"
|
|
455
455
|
}).then(() => {
|
|
456
|
-
var
|
|
457
|
-
return (
|
|
456
|
+
var A, P;
|
|
457
|
+
return (P = (A = b.popConfirm) == null ? void 0 : A.confirm) == null ? void 0 : P.call(A);
|
|
458
458
|
}).catch(() => {
|
|
459
|
-
var
|
|
460
|
-
return (
|
|
459
|
+
var A, P;
|
|
460
|
+
return (P = (A = b.popConfirm) == null ? void 0 : A.cancel) == null ? void 0 : P.call(A);
|
|
461
461
|
});
|
|
462
462
|
return;
|
|
463
463
|
}
|
|
@@ -500,8 +500,8 @@ function Xt(c) {
|
|
|
500
500
|
return r;
|
|
501
501
|
}, o = (r) => {
|
|
502
502
|
e.value = r;
|
|
503
|
-
const
|
|
504
|
-
|
|
503
|
+
const _ = n();
|
|
504
|
+
_ && Object.keys(_).length > 0 && r.setProps(_);
|
|
505
505
|
};
|
|
506
506
|
return c && Y(
|
|
507
507
|
() => n(),
|
|
@@ -525,21 +525,21 @@ function Xt(c) {
|
|
|
525
525
|
clearSelectedRowKeys: () => t().clearSelectedRowKeys(),
|
|
526
526
|
setSelectedRowKeys: (r) => t().setSelectedRowKeys(r),
|
|
527
527
|
deleteSelectRowByKey: (r) => t().deleteSelectRowByKey(r),
|
|
528
|
-
updateTableData: (r,
|
|
529
|
-
updateTableDataRecord: (r,
|
|
528
|
+
updateTableData: (r, _, u) => t().updateTableData(r, _, u),
|
|
529
|
+
updateTableDataRecord: (r, _) => t().updateTableDataRecord(r, _),
|
|
530
530
|
deleteTableDataRecord: (r) => t().deleteTableDataRecord(r),
|
|
531
|
-
insertTableDataRecord: (r,
|
|
531
|
+
insertTableDataRecord: (r, _) => t().insertTableDataRecord(r, _),
|
|
532
532
|
getPaginationRef: () => t().getPaginationRef(),
|
|
533
533
|
getShowPagination: () => t().getShowPagination(),
|
|
534
534
|
setShowPagination: (r) => t().setShowPagination(r),
|
|
535
535
|
getRowSelection: () => t().getRowSelection(),
|
|
536
536
|
expandAll: () => {
|
|
537
|
-
var r,
|
|
538
|
-
return (
|
|
537
|
+
var r, _;
|
|
538
|
+
return (_ = (r = t()).expandAll) == null ? void 0 : _.call(r);
|
|
539
539
|
},
|
|
540
540
|
collapseAll: () => {
|
|
541
|
-
var r,
|
|
542
|
-
return (
|
|
541
|
+
var r, _;
|
|
542
|
+
return (_ = (r = t()).collapseAll) == null ? void 0 : _.call(r);
|
|
543
543
|
}
|
|
544
544
|
}];
|
|
545
545
|
}
|
|
@@ -560,20 +560,22 @@ const rt = /* @__PURE__ */ le({
|
|
|
560
560
|
},
|
|
561
561
|
emits: ["input", "change"],
|
|
562
562
|
setup(c, { expose: e }) {
|
|
563
|
-
const n = c, t = D(!1), o = D([]), s = D(""),
|
|
564
|
-
n.lazy &&
|
|
565
|
-
},
|
|
563
|
+
const n = c, t = D(!1), o = D([]), s = D([]), r = D(""), _ = (g) => {
|
|
564
|
+
n.lazy && g && (JSON.stringify(n.params ?? {}) !== r.value || o.value.length === 0) && u();
|
|
565
|
+
}, u = async () => {
|
|
566
566
|
if (n.api) {
|
|
567
567
|
t.value = !0;
|
|
568
568
|
try {
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
|
|
569
|
+
const g = await n.api(n.params), z = Array.isArray(g) ? g : (g == null ? void 0 : g.list) ?? (g == null ? void 0 : g.data) ?? [];
|
|
570
|
+
s.value = z;
|
|
571
|
+
const y = n.labelField ?? "label", k = n.valueField ?? "value";
|
|
572
|
+
o.value = z.map((p) => {
|
|
573
|
+
const C = p;
|
|
572
574
|
return {
|
|
573
|
-
label: String(
|
|
574
|
-
value:
|
|
575
|
+
label: String(C[y] ?? C.label ?? ""),
|
|
576
|
+
value: C[k] ?? C.value
|
|
575
577
|
};
|
|
576
|
-
}),
|
|
578
|
+
}), r.value = JSON.stringify(n.params ?? {});
|
|
577
579
|
} finally {
|
|
578
580
|
t.value = !1;
|
|
579
581
|
}
|
|
@@ -581,19 +583,20 @@ const rt = /* @__PURE__ */ le({
|
|
|
581
583
|
};
|
|
582
584
|
return e({
|
|
583
585
|
options: o,
|
|
586
|
+
rawOptions: s,
|
|
584
587
|
loading: t,
|
|
585
|
-
fetchOptions:
|
|
588
|
+
fetchOptions: u
|
|
586
589
|
}), me(() => {
|
|
587
|
-
n.lazy ||
|
|
590
|
+
n.lazy || u();
|
|
588
591
|
}), Y(
|
|
589
592
|
() => n.api,
|
|
590
593
|
() => {
|
|
591
|
-
n.lazy ? o.value = [] :
|
|
594
|
+
n.lazy ? (o.value = [], s.value = []) : u();
|
|
592
595
|
},
|
|
593
596
|
{ deep: !0 }
|
|
594
597
|
), Y(() => n.params, () => {
|
|
595
|
-
n.lazy ? o.value = [] :
|
|
596
|
-
}, { deep: !0 }), { __sfc: !0, props: n, loading: t, options: o,
|
|
598
|
+
n.lazy ? (o.value = [], s.value = []) : u();
|
|
599
|
+
}, { deep: !0 }), { __sfc: !0, props: n, loading: t, options: o, rawOptions: s, cachedParams: r, onVisibleChange: _, fetchOptions: u };
|
|
597
600
|
}
|
|
598
601
|
});
|
|
599
602
|
var st = function() {
|
|
@@ -643,18 +646,18 @@ function dt(c, e, n) {
|
|
|
643
646
|
let o = t ? c.slice(1) : c;
|
|
644
647
|
const s = o.indexOf(".");
|
|
645
648
|
if (s === -1) {
|
|
646
|
-
const
|
|
647
|
-
return o =
|
|
649
|
+
const z = Math.max(0, e);
|
|
650
|
+
return o = z > 0 ? o.slice(0, z) : o, t ? "-" + o : o;
|
|
648
651
|
}
|
|
649
652
|
let r = o.slice(0, s);
|
|
650
653
|
e > 0 && (r = r.slice(0, e));
|
|
651
|
-
const
|
|
654
|
+
const _ = o.slice(s + 1), u = _ === "" && o.endsWith(".");
|
|
652
655
|
if (n <= 0)
|
|
653
656
|
return t ? "-" + r : r;
|
|
654
657
|
if (u)
|
|
655
658
|
return (t ? "-" : "") + r + ".";
|
|
656
|
-
const
|
|
657
|
-
return (t ? "-" : "") + r + "." +
|
|
659
|
+
const g = _.slice(0, n);
|
|
660
|
+
return (t ? "-" : "") + r + "." + g;
|
|
658
661
|
}
|
|
659
662
|
function ft(c, e) {
|
|
660
663
|
const n = Math.pow(10, c) - 1;
|
|
@@ -695,11 +698,11 @@ function Se(c, e, n, t) {
|
|
|
695
698
|
function mt(c, e) {
|
|
696
699
|
return Number.isNaN(c) || !Number.isFinite(c) ? "" : c.toFixed(Math.max(0, e));
|
|
697
700
|
}
|
|
698
|
-
function
|
|
701
|
+
function Le(c, e) {
|
|
699
702
|
if (Number.isNaN(c) || !Number.isFinite(c))
|
|
700
703
|
return "";
|
|
701
|
-
const n = c.toFixed(Math.max(0, e)), t = n.startsWith("-"), o = t ? n.slice(1) : n, [s, r] = o.split("."),
|
|
702
|
-
return e <= 0 || r === void 0 ? (t ? "-" : "") +
|
|
704
|
+
const n = c.toFixed(Math.max(0, e)), t = n.startsWith("-"), o = t ? n.slice(1) : n, [s, r] = o.split("."), _ = s.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
705
|
+
return e <= 0 || r === void 0 ? (t ? "-" : "") + _ : (t ? "-" : "") + _ + "." + r;
|
|
703
706
|
}
|
|
704
707
|
function vt(c, e) {
|
|
705
708
|
if (Number.isNaN(c) || !Number.isFinite(c))
|
|
@@ -721,26 +724,26 @@ const ht = /* @__PURE__ */ le({
|
|
|
721
724
|
emits: ["input"],
|
|
722
725
|
setup(c, { emit: e }) {
|
|
723
726
|
const n = c, t = D(!1), o = D(""), s = () => Math.max(0, Math.floor(n.integerDigits ?? 6)), r = () => Math.max(0, Math.floor(n.decimalPlaces ?? 6));
|
|
724
|
-
function
|
|
727
|
+
function _(p) {
|
|
725
728
|
if (p == null || p === "")
|
|
726
729
|
return null;
|
|
727
730
|
if (typeof p == "number")
|
|
728
731
|
return Number.isFinite(p) ? p : null;
|
|
729
|
-
const
|
|
730
|
-
if (
|
|
732
|
+
const C = Be(String(p));
|
|
733
|
+
if (C === "" || C === "-")
|
|
731
734
|
return null;
|
|
732
|
-
const b = Number(
|
|
735
|
+
const b = Number(C);
|
|
733
736
|
return Number.isFinite(b) ? b : null;
|
|
734
737
|
}
|
|
735
738
|
function u() {
|
|
736
739
|
if (t.value)
|
|
737
740
|
return;
|
|
738
|
-
const p =
|
|
741
|
+
const p = _(n.value);
|
|
739
742
|
if (p === null) {
|
|
740
743
|
o.value = "";
|
|
741
744
|
return;
|
|
742
745
|
}
|
|
743
|
-
o.value =
|
|
746
|
+
o.value = Le(
|
|
744
747
|
Se(p, s(), r(), n.rounding),
|
|
745
748
|
r()
|
|
746
749
|
);
|
|
@@ -750,28 +753,28 @@ const ht = /* @__PURE__ */ le({
|
|
|
750
753
|
() => u(),
|
|
751
754
|
{ immediate: !0, deep: !0 }
|
|
752
755
|
);
|
|
753
|
-
function
|
|
756
|
+
function g(p) {
|
|
754
757
|
e("input", mt(p, r()));
|
|
755
758
|
}
|
|
756
|
-
function
|
|
757
|
-
let
|
|
758
|
-
if (n.inputLimit !== !1 && (
|
|
759
|
+
function z(p) {
|
|
760
|
+
let C = Ve(p);
|
|
761
|
+
if (n.inputLimit !== !1 && (C = dt(C, s(), r())), o.value = C, C === "" || C === "-")
|
|
759
762
|
return;
|
|
760
|
-
const b = Number(
|
|
763
|
+
const b = Number(C);
|
|
761
764
|
if (!Number.isFinite(b))
|
|
762
765
|
return;
|
|
763
766
|
const j = Se(b, s(), r(), n.rounding);
|
|
764
|
-
|
|
767
|
+
g(j);
|
|
765
768
|
}
|
|
766
769
|
function y() {
|
|
767
770
|
t.value = !0;
|
|
768
|
-
const p = Be(o.value),
|
|
769
|
-
if (
|
|
771
|
+
const p = Be(o.value), C = _(p === "" ? n.value : p);
|
|
772
|
+
if (C === null) {
|
|
770
773
|
o.value = "";
|
|
771
774
|
return;
|
|
772
775
|
}
|
|
773
776
|
o.value = vt(
|
|
774
|
-
Se(
|
|
777
|
+
Se(C, s(), r(), n.rounding),
|
|
775
778
|
r()
|
|
776
779
|
);
|
|
777
780
|
}
|
|
@@ -782,15 +785,15 @@ const ht = /* @__PURE__ */ le({
|
|
|
782
785
|
o.value = "", e("input", void 0);
|
|
783
786
|
return;
|
|
784
787
|
}
|
|
785
|
-
const
|
|
786
|
-
if (!Number.isFinite(
|
|
788
|
+
const C = Number(Ve(p));
|
|
789
|
+
if (!Number.isFinite(C)) {
|
|
787
790
|
o.value = "", e("input", void 0);
|
|
788
791
|
return;
|
|
789
792
|
}
|
|
790
|
-
const b = Se(
|
|
791
|
-
o.value =
|
|
793
|
+
const b = Se(C, s(), r(), n.rounding);
|
|
794
|
+
o.value = Le(b, r()), g(b);
|
|
792
795
|
}
|
|
793
|
-
return { __sfc: !0, props: n, emit: e, focused: t, displayText: o, intN: s, decM: r, parseExternalToNumber:
|
|
796
|
+
return { __sfc: !0, props: n, emit: e, focused: t, displayText: o, intN: s, decM: r, parseExternalToNumber: _, syncDisplayFromValue: u, emitStoredValue: g, onInput: z, onFocus: y, onBlur: k };
|
|
794
797
|
}
|
|
795
798
|
});
|
|
796
799
|
var _t = function() {
|
|
@@ -824,86 +827,86 @@ const ke = gt.exports, yt = /* @__PURE__ */ le({
|
|
|
824
827
|
},
|
|
825
828
|
emits: ["input"],
|
|
826
829
|
setup(c, { emit: e }) {
|
|
827
|
-
const n = c, t = D(), o = D(), s = D(!1), r = D(!1),
|
|
830
|
+
const n = c, t = D(), o = D(), s = D(!1), r = D(!1), _ = D(""), u = D([]), g = D({}), z = S(() => ({
|
|
828
831
|
label: n.labelField,
|
|
829
832
|
children: n.childrenField
|
|
830
833
|
}));
|
|
831
|
-
function y(
|
|
832
|
-
const T = n.labelField ?? "label",
|
|
833
|
-
return Q[n.labelField ?? "label"] =
|
|
834
|
+
function y(M) {
|
|
835
|
+
const T = n.labelField ?? "label", K = n.valueField ?? "value", U = n.childrenField ?? "children", H = M[U], Q = {};
|
|
836
|
+
return Q[n.labelField ?? "label"] = M[T] ?? M.label, Q[n.valueField ?? "value"] = M[K] ?? M.value, Array.isArray(H) && H.length && (Q[n.childrenField ?? "children"] = H.map((G) => y(G))), Q;
|
|
834
837
|
}
|
|
835
|
-
function k(
|
|
836
|
-
const
|
|
837
|
-
for (const G of
|
|
838
|
+
function k(M, T = "") {
|
|
839
|
+
const K = {}, U = n.labelField ?? "label", H = n.valueField ?? "value", Q = n.childrenField ?? "children";
|
|
840
|
+
for (const G of M) {
|
|
838
841
|
const ee = String(G[U] ?? G.label ?? ""), J = G[H] ?? G.value;
|
|
839
|
-
J != null && (
|
|
842
|
+
J != null && (K[String(J)] = T ? T + " / " + ee : ee);
|
|
840
843
|
const te = G[Q] ?? G.children;
|
|
841
|
-
Array.isArray(te) && te.length && Object.assign(
|
|
844
|
+
Array.isArray(te) && te.length && Object.assign(K, k(te, ee));
|
|
842
845
|
}
|
|
843
|
-
return
|
|
846
|
+
return K;
|
|
844
847
|
}
|
|
845
848
|
function p() {
|
|
846
|
-
const
|
|
847
|
-
return Array.isArray(
|
|
849
|
+
const M = n.treeData;
|
|
850
|
+
return Array.isArray(M) && M.length > 0;
|
|
848
851
|
}
|
|
849
|
-
function
|
|
850
|
-
u.value =
|
|
852
|
+
function C(M) {
|
|
853
|
+
u.value = M, g.value = k(M);
|
|
851
854
|
}
|
|
852
855
|
function b() {
|
|
853
|
-
const
|
|
854
|
-
if (!Array.isArray(
|
|
856
|
+
const M = n.treeData;
|
|
857
|
+
if (!Array.isArray(M) || M.length === 0)
|
|
855
858
|
return;
|
|
856
|
-
const T =
|
|
857
|
-
|
|
859
|
+
const T = M.map((K) => y(K));
|
|
860
|
+
C(T);
|
|
858
861
|
}
|
|
859
|
-
const j =
|
|
860
|
-
if (!
|
|
862
|
+
const j = S(() => n.value == null || n.value === "" ? "" : g.value[String(n.value)] ?? String(n.value)), N = (M, T) => {
|
|
863
|
+
if (!M)
|
|
861
864
|
return !0;
|
|
862
|
-
const
|
|
863
|
-
return String(T[
|
|
865
|
+
const K = n.labelField ?? "label";
|
|
866
|
+
return String(T[K] ?? T.label ?? "").toLowerCase().includes(M.toLowerCase());
|
|
864
867
|
};
|
|
865
|
-
Y(
|
|
868
|
+
Y(_, (M) => {
|
|
866
869
|
var T;
|
|
867
|
-
(T = o.value) == null || T.filter(
|
|
870
|
+
(T = o.value) == null || T.filter(M);
|
|
868
871
|
});
|
|
869
|
-
let
|
|
870
|
-
function
|
|
871
|
-
n.disabled || (s.value = !0, n.lazy && !p() &&
|
|
872
|
-
|
|
873
|
-
t.value && !t.value.contains(
|
|
874
|
-
}, document.addEventListener("click",
|
|
872
|
+
let x = null;
|
|
873
|
+
function q() {
|
|
874
|
+
n.disabled || (s.value = !0, n.lazy && !p() && L(), We(() => {
|
|
875
|
+
x = (M) => {
|
|
876
|
+
t.value && !t.value.contains(M.target) && A();
|
|
877
|
+
}, document.addEventListener("click", x);
|
|
875
878
|
}));
|
|
876
879
|
}
|
|
877
|
-
function
|
|
878
|
-
s.value = !1,
|
|
880
|
+
function A() {
|
|
881
|
+
s.value = !1, _.value = "", x && (document.removeEventListener("click", x), x = null);
|
|
879
882
|
}
|
|
880
|
-
function
|
|
883
|
+
function P() {
|
|
881
884
|
e("input", void 0);
|
|
882
885
|
}
|
|
883
|
-
function
|
|
884
|
-
const T = n.valueField ?? "value",
|
|
885
|
-
e("input",
|
|
886
|
+
function f(M) {
|
|
887
|
+
const T = n.valueField ?? "value", K = M[T] ?? M.value;
|
|
888
|
+
e("input", K), A();
|
|
886
889
|
}
|
|
887
|
-
async function
|
|
890
|
+
async function L() {
|
|
888
891
|
if (!(!n.api || p())) {
|
|
889
892
|
r.value = !0;
|
|
890
893
|
try {
|
|
891
|
-
const
|
|
892
|
-
u.value = T.map((
|
|
894
|
+
const M = await n.api(n.params), T = Array.isArray(M) ? M : (M == null ? void 0 : M.list) ?? (M == null ? void 0 : M.data) ?? [];
|
|
895
|
+
u.value = T.map((K) => y(K)), g.value = k(u.value);
|
|
893
896
|
} finally {
|
|
894
897
|
r.value = !1;
|
|
895
898
|
}
|
|
896
899
|
}
|
|
897
900
|
}
|
|
898
901
|
return me(() => {
|
|
899
|
-
p() ? b() : n.lazy ||
|
|
902
|
+
p() ? b() : n.lazy || L();
|
|
900
903
|
}), Y(() => n.treeData, () => {
|
|
901
|
-
p() ? b() : (u.value = [],
|
|
904
|
+
p() ? b() : (u.value = [], g.value = {}, !n.lazy && n.api && L());
|
|
902
905
|
}, { deep: !0 }), Y(() => n.api, () => {
|
|
903
|
-
p() || (n.lazy ? (u.value = [],
|
|
906
|
+
p() || (n.lazy ? (u.value = [], g.value = {}) : L());
|
|
904
907
|
}, { deep: !0 }), Y(() => n.params, () => {
|
|
905
|
-
p() || (n.lazy ? (u.value = [],
|
|
906
|
-
}, { deep: !0 }), { __sfc: !0, props: n, emit: e, rootRef: t, treeRef: o, dropdownVisible: s, loading: r, filterText:
|
|
908
|
+
p() || (n.lazy ? (u.value = [], g.value = {}) : L());
|
|
909
|
+
}, { deep: !0 }), { __sfc: !0, props: n, emit: e, rootRef: t, treeRef: o, dropdownVisible: s, loading: r, filterText: _, treeData: u, flatLabelMap: g, treeProps: z, normalizeNode: y, buildFlatLabelMap: k, hasTreeDataProp: p, applyTreeData: C, syncFromTreeDataProp: b, displayText: j, filterNodeMethod: N, clickOutsideHandler: x, openDropdown: q, closeDropdown: A, clearValue: P, onNodeClick: f, fetchData: L };
|
|
907
910
|
}
|
|
908
911
|
});
|
|
909
912
|
var wt = function() {
|
|
@@ -952,71 +955,71 @@ const Pt = xt.exports, St = /* @__PURE__ */ le({
|
|
|
952
955
|
"radio"
|
|
953
956
|
]), t = D(null);
|
|
954
957
|
me(() => {
|
|
955
|
-
var
|
|
956
|
-
e.schema.component === "api-select" && ((
|
|
958
|
+
var f;
|
|
959
|
+
e.schema.component === "api-select" && ((f = e.registerFieldInstance) == null || f.call(e, e.schema.field, t.value));
|
|
957
960
|
}), Fe(() => {
|
|
958
|
-
var
|
|
959
|
-
e.schema.component === "api-select" && ((
|
|
961
|
+
var f;
|
|
962
|
+
e.schema.component === "api-select" && ((f = e.registerFieldInstance) == null || f.call(e, e.schema.field, null));
|
|
960
963
|
});
|
|
961
|
-
const o = Ae(), s =
|
|
964
|
+
const o = Ae(), s = S(() => ({
|
|
962
965
|
schema: e.schema,
|
|
963
966
|
values: e.formModel,
|
|
964
967
|
model: e.formModel,
|
|
965
968
|
field: e.schema.field
|
|
966
|
-
})), r =
|
|
967
|
-
const
|
|
968
|
-
return
|
|
969
|
-
}),
|
|
970
|
-
const
|
|
971
|
-
return
|
|
972
|
-
}), u =
|
|
969
|
+
})), r = S(() => {
|
|
970
|
+
const f = e.schema.ifShow;
|
|
971
|
+
return f === void 0 ? !0 : typeof f == "boolean" ? f : f(s.value);
|
|
972
|
+
}), _ = S(() => {
|
|
973
|
+
const f = e.schema.show;
|
|
974
|
+
return f === void 0 ? !0 : typeof f == "boolean" ? f : f(s.value);
|
|
975
|
+
}), u = S(() => {
|
|
973
976
|
if (e.formDisabled)
|
|
974
977
|
return !0;
|
|
975
|
-
const
|
|
976
|
-
return
|
|
977
|
-
}),
|
|
978
|
-
const
|
|
979
|
-
return
|
|
980
|
-
}),
|
|
981
|
-
const
|
|
982
|
-
if (!
|
|
978
|
+
const f = e.schema.dynamicDisabled;
|
|
979
|
+
return f === void 0 ? !1 : typeof f == "boolean" ? f : f(s.value);
|
|
980
|
+
}), g = S(() => {
|
|
981
|
+
const f = e.schema.dynamicRules;
|
|
982
|
+
return f ? Array.isArray(f) ? f : f(s.value) : e.schema.rules;
|
|
983
|
+
}), z = S(() => {
|
|
984
|
+
const f = e.schema.componentProps;
|
|
985
|
+
if (!f)
|
|
983
986
|
return { props: {}, listeners: {} };
|
|
984
|
-
const
|
|
987
|
+
const L = typeof f == "function" ? f({
|
|
985
988
|
...s.value,
|
|
986
989
|
formActionType: e.formActionType
|
|
987
|
-
}) : { ...
|
|
988
|
-
for (const [
|
|
989
|
-
if (
|
|
990
|
-
const H =
|
|
990
|
+
}) : { ...f }, M = {}, T = {};
|
|
991
|
+
for (const [K, U] of Object.entries(L))
|
|
992
|
+
if (K.length > 2 && /^on[A-Za-z]/.test(K) && typeof U == "function") {
|
|
993
|
+
const H = K.slice(2).charAt(0).toLowerCase() + K.slice(3);
|
|
991
994
|
T[H] = U;
|
|
992
995
|
} else
|
|
993
|
-
|
|
994
|
-
return { props:
|
|
995
|
-
}), y =
|
|
996
|
-
const
|
|
997
|
-
if (!
|
|
996
|
+
M[K] = U;
|
|
997
|
+
return { props: M, listeners: T };
|
|
998
|
+
}), y = S(() => z.value.props), k = S(() => z.value.listeners), p = S(() => e.schema.colon ?? e.colon ?? !1), C = S(() => {
|
|
999
|
+
const f = e.schema.tooltip;
|
|
1000
|
+
if (!f)
|
|
998
1001
|
return null;
|
|
999
|
-
const
|
|
1000
|
-
return Te(
|
|
1001
|
-
}), b =
|
|
1002
|
-
const
|
|
1003
|
-
return Array.isArray(
|
|
1004
|
-
},
|
|
1005
|
-
const
|
|
1006
|
-
return
|
|
1007
|
-
}),
|
|
1008
|
-
var
|
|
1009
|
-
(
|
|
1010
|
-
},
|
|
1011
|
-
const
|
|
1012
|
-
return
|
|
1002
|
+
const L = typeof f == "function" ? f(s.value) : f;
|
|
1003
|
+
return Te(L, e.formModel[e.schema.field]);
|
|
1004
|
+
}), b = S(() => C.value ? "el-tooltip" : "span"), j = S(() => C.value || {}), N = S(() => !!o.default), x = (f) => {
|
|
1005
|
+
const L = f == null ? void 0 : f.options;
|
|
1006
|
+
return Array.isArray(L) ? L : void 0;
|
|
1007
|
+
}, q = S(() => {
|
|
1008
|
+
const f = e.schema.component;
|
|
1009
|
+
return f == null ? null : typeof f == "string" ? n.has(f) ? null : e.customComponents && e.customComponents[f] || f : f;
|
|
1010
|
+
}), A = (f) => {
|
|
1011
|
+
var L;
|
|
1012
|
+
(L = e.onFieldChange) == null || L.call(e, e.schema.field, f);
|
|
1013
|
+
}, P = S(() => {
|
|
1014
|
+
const f = e.schema.render;
|
|
1015
|
+
return f ? {
|
|
1013
1016
|
render() {
|
|
1014
|
-
const
|
|
1015
|
-
return Array.isArray(
|
|
1017
|
+
const L = f(s.value);
|
|
1018
|
+
return Array.isArray(L) ? ue("span", L) : L;
|
|
1016
1019
|
}
|
|
1017
1020
|
} : null;
|
|
1018
1021
|
});
|
|
1019
|
-
return { __sfc: !0, BUILT_IN_COMPONENTS: n, props: e, apiSelectRef: t, slots: o, renderParams: s, shouldRender: r, shouldShow:
|
|
1022
|
+
return { __sfc: !0, BUILT_IN_COMPONENTS: n, props: e, apiSelectRef: t, slots: o, renderParams: s, shouldRender: r, shouldShow: _, effectiveDisabled: u, effectiveRules: g, effectiveComponentPropsAndListeners: z, effectiveComponentProps: y, effectiveComponentListeners: k, showColon: p, normalizedTooltip: C, fieldWrapperComponent: b, fieldWrapperProps: j, hasSlot: N, getOptions: x, resolvedCustomComponent: q, setFieldValue: A, renderComponent: P, ApiSelect: ut, FormattedNumberInput: ke, TreeSelect: Pt };
|
|
1020
1023
|
}
|
|
1021
1024
|
});
|
|
1022
1025
|
var Ft = function() {
|
|
@@ -1130,142 +1133,144 @@ const He = $t.exports, Tt = /* @__PURE__ */ le({
|
|
|
1130
1133
|
},
|
|
1131
1134
|
emits: ["submit", "reset", "register", "update:modelValue"],
|
|
1132
1135
|
setup(c, { expose: e, emit: n }) {
|
|
1133
|
-
const t = c, o = Ae(), s = D(), r = D(),
|
|
1134
|
-
const l =
|
|
1135
|
-
return l >=
|
|
1136
|
-
}, { getSetting: j } = $e(),
|
|
1136
|
+
const t = c, o = Ae(), s = D(), r = D(), _ = D(!1), u = D(!0), g = D({}), z = D({}), y = D([]), k = D({}), p = D(/* @__PURE__ */ new Map()), C = { xl: 1920, lg: 1200, md: 992, sm: 768 }, b = (d, w, R) => {
|
|
1137
|
+
const l = R ?? (typeof window < "u" ? window.innerWidth : 1920), a = d ?? {}, v = w ?? {}, F = v.span ?? 8;
|
|
1138
|
+
return l >= C.xl ? a.xl ?? v.xl ?? a.lg ?? v.lg ?? a.md ?? v.md ?? a.sm ?? v.sm ?? a.xs ?? v.xs ?? a.span ?? F : l >= C.lg ? a.lg ?? v.lg ?? a.md ?? v.md ?? a.sm ?? v.sm ?? a.xs ?? v.xs ?? a.span ?? F : l >= C.md ? a.md ?? v.md ?? a.sm ?? v.sm ?? a.xs ?? v.xs ?? a.span ?? F : l >= C.sm ? a.sm ?? v.sm ?? a.xs ?? v.xs ?? a.span ?? F : a.xs ?? v.xs ?? a.span ?? F;
|
|
1139
|
+
}, { getSetting: j } = $e(), N = S(() => ({ ...j("ProForm"), ...t, ...k.value })), x = S(() => N.value.modelValue), q = S(() => x.value !== void 0), A = S(() => q.value ? x.value ?? {} : g.value), P = S(() => ({
|
|
1137
1140
|
...j("ProForm").components ?? {},
|
|
1138
|
-
...
|
|
1141
|
+
...N.value.components ?? {},
|
|
1139
1142
|
...k.value.components ?? {}
|
|
1140
|
-
})),
|
|
1143
|
+
})), f = S(() => N.value.actionColOptions ?? { span: 24 }), L = D(typeof window < "u" ? window.innerWidth : 1920), M = (d, w, R, l) => {
|
|
1141
1144
|
let a = 24, v = 1, F = 0;
|
|
1142
1145
|
for (const E of d) {
|
|
1143
|
-
const
|
|
1144
|
-
if (
|
|
1145
|
-
if (v++, v >
|
|
1146
|
+
const V = b(E.colProps, w, l);
|
|
1147
|
+
if (V > a) {
|
|
1148
|
+
if (v++, v > R)
|
|
1146
1149
|
break;
|
|
1147
|
-
a = 24 -
|
|
1150
|
+
a = 24 - V;
|
|
1148
1151
|
} else
|
|
1149
|
-
a -=
|
|
1152
|
+
a -= V;
|
|
1150
1153
|
F++;
|
|
1151
1154
|
}
|
|
1152
1155
|
return F;
|
|
1153
|
-
}, T =
|
|
1156
|
+
}, T = S(() => {
|
|
1154
1157
|
const d = y.value.filter((a) => H(a));
|
|
1155
|
-
if (!
|
|
1158
|
+
if (!N.value.showAdvancedButton)
|
|
1156
1159
|
return !1;
|
|
1157
|
-
const
|
|
1160
|
+
const w = N.value.alwaysShowLines ?? 1, R = N.value.baseColProps, l = M(d, R, w, L.value);
|
|
1158
1161
|
return d.length > l;
|
|
1159
|
-
}),
|
|
1162
|
+
}), K = S(() => N.value.formListeners ?? {}), U = S(() => {
|
|
1160
1163
|
const d = y.value.filter((a) => H(a));
|
|
1161
|
-
if (!
|
|
1164
|
+
if (!N.value.showAdvancedButton || !u.value)
|
|
1162
1165
|
return d;
|
|
1163
|
-
const
|
|
1166
|
+
const w = N.value.alwaysShowLines ?? 1, R = N.value.baseColProps, l = M(d, R, w, L.value);
|
|
1164
1167
|
return d.slice(0, l);
|
|
1165
1168
|
}), H = (d) => {
|
|
1166
|
-
let
|
|
1167
|
-
return typeof d.ifShow == "function" && (
|
|
1168
|
-
}, Q = (d) => d.colProps ??
|
|
1169
|
-
const
|
|
1169
|
+
let w = !0, R = !0;
|
|
1170
|
+
return typeof d.ifShow == "function" && (w = d.ifShow({ schema: d, values: A.value, model: A.value, field: d.field })), typeof d.ifShow == "boolean" && (w = d.ifShow), typeof d.show == "function" && (R = d.show({ schema: d, values: A.value, model: A.value, field: d.field })), typeof d.show == "boolean" && (R = d.show), w && R;
|
|
1171
|
+
}, Q = (d) => d.colProps ?? N.value.baseColProps ?? {}, G = (d) => d.slot || d.field, ee = (d, w = !0) => {
|
|
1172
|
+
const R = w ? { ...d ?? {} } : {}, l = N.value.initialValues ?? t.initialValues;
|
|
1170
1173
|
return y.value.forEach((a) => {
|
|
1171
|
-
if (!(
|
|
1174
|
+
if (!(w && Object.prototype.hasOwnProperty.call(R, a.field))) {
|
|
1172
1175
|
if (a.defaultValue !== void 0) {
|
|
1173
|
-
|
|
1176
|
+
R[a.field] = a.defaultValue;
|
|
1174
1177
|
return;
|
|
1175
1178
|
}
|
|
1176
|
-
l && Object.prototype.hasOwnProperty.call(l, a.field) && (
|
|
1179
|
+
l && Object.prototype.hasOwnProperty.call(l, a.field) && (R[a.field] = l[a.field]);
|
|
1177
1180
|
}
|
|
1178
|
-
}),
|
|
1179
|
-
}, J = (d,
|
|
1180
|
-
|
|
1181
|
+
}), R;
|
|
1182
|
+
}, J = (d, w = !0) => {
|
|
1183
|
+
g.value = d, w && n("update:modelValue", d);
|
|
1181
1184
|
}, te = (d) => {
|
|
1182
|
-
const
|
|
1183
|
-
return J(
|
|
1185
|
+
const w = ee({ ...A.value, ...d });
|
|
1186
|
+
return J(w), w;
|
|
1184
1187
|
}, ne = () => {
|
|
1185
1188
|
const d = {};
|
|
1186
|
-
y.value.forEach((
|
|
1187
|
-
var
|
|
1188
|
-
(
|
|
1189
|
-
}), J(ee(
|
|
1190
|
-
},
|
|
1191
|
-
const
|
|
1192
|
-
return y.value.forEach((
|
|
1193
|
-
const l =
|
|
1189
|
+
y.value.forEach((w) => {
|
|
1190
|
+
var R;
|
|
1191
|
+
(R = w.rules) != null && R.length && (d[w.field] = w.rules);
|
|
1192
|
+
}), J(ee(A.value), !1), z.value = d;
|
|
1193
|
+
}, h = (d) => {
|
|
1194
|
+
const w = { ...d };
|
|
1195
|
+
return y.value.forEach((R) => {
|
|
1196
|
+
const l = R.ifShow;
|
|
1194
1197
|
if (l === void 0)
|
|
1195
1198
|
return;
|
|
1196
|
-
(typeof l == "boolean" ? l : l({ schema:
|
|
1197
|
-
}),
|
|
1198
|
-
},
|
|
1199
|
-
const
|
|
1200
|
-
if (!(
|
|
1201
|
-
return
|
|
1202
|
-
const l = { ...
|
|
1203
|
-
return
|
|
1199
|
+
(typeof l == "boolean" ? l : l({ schema: R, values: d, model: d, field: R.field })) || delete w[R.field];
|
|
1200
|
+
}), w;
|
|
1201
|
+
}, I = (d) => {
|
|
1202
|
+
const w = h(d), R = k.value.fieldMapToTime;
|
|
1203
|
+
if (!(R != null && R.length))
|
|
1204
|
+
return w;
|
|
1205
|
+
const l = { ...w };
|
|
1206
|
+
return R.forEach(([a, [v, F]]) => {
|
|
1204
1207
|
const E = l[a];
|
|
1205
1208
|
Array.isArray(E) && E.length === 2 && (delete l[a], l[v] = E[0], l[F] = E[1]);
|
|
1206
1209
|
}), l;
|
|
1207
1210
|
}, $ = async () => {
|
|
1208
1211
|
var d;
|
|
1209
1212
|
try {
|
|
1210
|
-
await ((d = s.value) == null ? void 0 : d.validate()),
|
|
1211
|
-
} catch (
|
|
1212
|
-
console.error("Form validation failed:",
|
|
1213
|
+
await ((d = s.value) == null ? void 0 : d.validate()), N.value.submitFunc ? await N.value.submitFunc() : (_.value = !0, n("submit", I({ ...A.value })));
|
|
1214
|
+
} catch (w) {
|
|
1215
|
+
console.error("Form validation failed:", w);
|
|
1213
1216
|
} finally {
|
|
1214
|
-
|
|
1217
|
+
_.value = !1;
|
|
1215
1218
|
}
|
|
1216
1219
|
}, i = async () => {
|
|
1217
1220
|
var d;
|
|
1218
|
-
|
|
1219
|
-
}, m = (d) => (te(d), Promise.resolve()), B = () =>
|
|
1221
|
+
N.value.resetFunc ? await N.value.resetFunc() : ((d = s.value) == null || d.resetFields(), ne(), n("reset"), N.value.submitOnReset && await $());
|
|
1222
|
+
}, m = (d) => (te(d), Promise.resolve()), B = () => I({ ...A.value }), W = async () => {
|
|
1220
1223
|
var d;
|
|
1221
1224
|
(d = s.value) == null || d.resetFields(), J(ee(void 0, !1));
|
|
1222
|
-
},
|
|
1223
|
-
te({ [d]:
|
|
1225
|
+
}, O = (d, w) => {
|
|
1226
|
+
te({ [d]: w });
|
|
1224
1227
|
}, X = (d) => {
|
|
1225
|
-
var
|
|
1226
|
-
return ((
|
|
1227
|
-
}, se = (d) => s.value ? d != null && d.length ? Promise.all(d.map((
|
|
1228
|
-
s.value.validateField(
|
|
1229
|
-
}))) : s.value.validate() : Promise.resolve(), he = async (d,
|
|
1228
|
+
var w;
|
|
1229
|
+
return ((w = s.value) == null ? void 0 : w.validate(d)) ?? Promise.resolve();
|
|
1230
|
+
}, se = (d) => s.value ? d != null && d.length ? Promise.all(d.map((w) => new Promise((R, l) => {
|
|
1231
|
+
s.value.validateField(w, (a) => a ? R(void 0) : l(new Error("Validation failed")));
|
|
1232
|
+
}))) : s.value.validate() : Promise.resolve(), he = async (d, w) => {
|
|
1230
1233
|
var l;
|
|
1231
|
-
const
|
|
1232
|
-
return
|
|
1234
|
+
const R = (l = r.value) == null ? void 0 : l.querySelector(`[data-field="${d}"]`);
|
|
1235
|
+
return R && R.scrollIntoView({ behavior: (w == null ? void 0 : w.behavior) ?? "smooth", block: (w == null ? void 0 : w.block) ?? "nearest" }), Promise.resolve();
|
|
1233
1236
|
}, re = (d) => {
|
|
1234
|
-
var
|
|
1235
|
-
(
|
|
1237
|
+
var w;
|
|
1238
|
+
(w = s.value) == null || w.clearValidate(d);
|
|
1236
1239
|
}, _e = async (d) => {
|
|
1237
|
-
(Array.isArray(d) ? d : [d]).forEach((
|
|
1238
|
-
const l = y.value.findIndex((a) => a.field ===
|
|
1239
|
-
l >= 0 && (y.value[l] = { ...y.value[l], ...
|
|
1240
|
+
(Array.isArray(d) ? d : [d]).forEach((R) => {
|
|
1241
|
+
const l = y.value.findIndex((a) => a.field === R.field);
|
|
1242
|
+
l >= 0 && (y.value[l] = { ...y.value[l], ...R });
|
|
1240
1243
|
});
|
|
1241
|
-
}, be = async (d,
|
|
1242
|
-
if (
|
|
1244
|
+
}, be = async (d, w, R) => {
|
|
1245
|
+
if (R)
|
|
1243
1246
|
y.value.unshift(d);
|
|
1244
|
-
else if (
|
|
1245
|
-
const l = y.value.findIndex((a) => a.field ===
|
|
1247
|
+
else if (w) {
|
|
1248
|
+
const l = y.value.findIndex((a) => a.field === w);
|
|
1246
1249
|
y.value.splice(l + 1, 0, d);
|
|
1247
1250
|
} else
|
|
1248
1251
|
y.value.push(d);
|
|
1249
1252
|
ne();
|
|
1250
1253
|
}, ge = async (d) => {
|
|
1251
|
-
const
|
|
1252
|
-
y.value = y.value.filter((
|
|
1254
|
+
const w = Array.isArray(d) ? d : [d];
|
|
1255
|
+
y.value = y.value.filter((R) => !w.includes(R.field));
|
|
1253
1256
|
}, ye = async (d) => {
|
|
1254
1257
|
k.value = { ...k.value, ...d }, d.schemas && (y.value = [...d.schemas], ne());
|
|
1255
|
-
}, we = (d,
|
|
1256
|
-
|
|
1257
|
-
}, Ce = (d) => p.value.get(d) ?? null
|
|
1258
|
-
|
|
1259
|
-
|
|
1258
|
+
}, we = (d, w) => {
|
|
1259
|
+
w ? p.value.set(d, w) : p.value.delete(d);
|
|
1260
|
+
}, Ce = (d) => p.value.get(d) ?? null;
|
|
1261
|
+
function xe(d, w = !1) {
|
|
1262
|
+
const R = p.value.get(d);
|
|
1263
|
+
if (!R)
|
|
1260
1264
|
return [];
|
|
1261
|
-
const
|
|
1262
|
-
return
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
|
|
1265
|
+
const l = R;
|
|
1266
|
+
return w ? (l == null ? void 0 : l.rawOptions) ?? [] : (l == null ? void 0 : l.options) ?? [];
|
|
1267
|
+
}
|
|
1268
|
+
const ve = (d) => {
|
|
1269
|
+
const w = p.value.get(d);
|
|
1270
|
+
if (!w)
|
|
1266
1271
|
return !1;
|
|
1267
|
-
const
|
|
1268
|
-
return (
|
|
1272
|
+
const R = w;
|
|
1273
|
+
return (R == null ? void 0 : R.loading) ?? !1;
|
|
1269
1274
|
}, ie = {
|
|
1270
1275
|
getFieldsValue: B,
|
|
1271
1276
|
setFieldsValue: m,
|
|
@@ -1290,15 +1295,15 @@ const He = $t.exports, Tt = /* @__PURE__ */ le({
|
|
|
1290
1295
|
const ce = () => {
|
|
1291
1296
|
y.value = [...t.schemas ?? []], ne();
|
|
1292
1297
|
}, de = () => {
|
|
1293
|
-
typeof window < "u" && (
|
|
1298
|
+
typeof window < "u" && (L.value = window.innerWidth);
|
|
1294
1299
|
};
|
|
1295
1300
|
return me(() => {
|
|
1296
1301
|
ce(), n("register", ie), typeof window < "u" && window.addEventListener("resize", de);
|
|
1297
1302
|
}), Fe(() => {
|
|
1298
1303
|
typeof window < "u" && window.removeEventListener("resize", de);
|
|
1299
|
-
}), Y(() =>
|
|
1300
|
-
!
|
|
1301
|
-
}, { deep: !0, immediate: !0 }), Y(() => [t.schemas, t.initialValues], ce, { deep: !0 }), { __sfc: !0, props: t, emit: n, slots: o, formRef: s, formWrapRef: r, submitLoading:
|
|
1304
|
+
}), Y(() => x.value, (d) => {
|
|
1305
|
+
!q.value || d === void 0 || J(ee(d), !1);
|
|
1306
|
+
}, { deep: !0, immediate: !0 }), Y(() => [t.schemas, t.initialValues], ce, { deep: !0 }), { __sfc: !0, props: t, emit: n, slots: o, formRef: s, formWrapRef: r, submitLoading: _, collapsed: u, formModel: g, formRules: z, innerSchemas: y, innerProps: k, fieldInstanceMap: p, BREAKPOINTS: C, getEffectiveSpan: b, getComponentSetting: j, effectiveProps: N, controlledModelValue: x, isControlled: q, currentFormModel: A, formCustomComponents: P, effectiveActionColOptions: f, windowWidth: L, getVisibleSchemaCount: M, hasMoreFields: T, formListeners: K, displaySchemas: U, shouldShow: H, getColProps: Q, getSlotName: G, resolveSchemaModel: ee, applyFormModel: J, updateFormModel: te, initForm: ne, filterByIfShow: h, processFieldMapToTime: I, handleSubmit: $, handleReset: i, setFieldsValue: m, getFieldsValue: B, resetFields: W, handleFieldChange: O, validate: X, validateFields: se, scrollToField: he, clearValidate: re, updateSchema: _e, appendSchemaByField: be, removeSchemaByField: ge, setProps: ye, registerFieldInstance: we, getComponentInstance: Ce, getFieldOptions: xe, isFieldLoading: ve, formActionRef: ie, syncSchemas: ce, handleResize: de, ProFormItem: qe, FormActions: He };
|
|
1302
1307
|
}
|
|
1303
1308
|
});
|
|
1304
1309
|
var Dt = function() {
|
|
@@ -1311,83 +1316,97 @@ var Dt = function() {
|
|
|
1311
1316
|
} } }, [n("template", { slot: "submitBefore" }, [e._t("submitBefore")], 2), n("template", { slot: "resetBefore" }, [e._t("resetBefore")], 2), n("template", { slot: "advanceBefore" }, [e._t("advanceBefore")], 2), n("template", { slot: "advanceAfter" }, [e._t("advanceAfter")], 2), n("template", { slot: "actions" }, [e._t("actions")], 2)], 2)], 1) : e._e()], 2), t.effectiveProps.showAdvancedButton && t.hasMoreFields ? n("el-button", { staticClass: "ecp-form-actions__advance", attrs: { type: "text" }, on: { click: function(o) {
|
|
1312
1317
|
t.collapsed = !t.collapsed;
|
|
1313
1318
|
} } }, [n("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);
|
|
1314
|
-
}, zt = [],
|
|
1319
|
+
}, zt = [], Ot = /* @__PURE__ */ ae(
|
|
1315
1320
|
Tt,
|
|
1316
1321
|
Dt,
|
|
1317
1322
|
zt,
|
|
1318
1323
|
!1,
|
|
1319
1324
|
null,
|
|
1320
|
-
"
|
|
1325
|
+
"80bac8be",
|
|
1321
1326
|
null,
|
|
1322
1327
|
null
|
|
1323
1328
|
);
|
|
1324
|
-
const Je =
|
|
1329
|
+
const Je = Ot.exports;
|
|
1325
1330
|
function Zt(c) {
|
|
1326
|
-
const e = D(null), n = D(c ? pe(c) : void 0), t = () => c ? pe(c) : void 0, o = (
|
|
1327
|
-
e.value =
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1331
|
+
const e = D(null), n = D(c ? pe(c) : void 0), t = () => c ? pe(c) : void 0, o = (P) => {
|
|
1332
|
+
e.value = P;
|
|
1333
|
+
const f = t();
|
|
1334
|
+
f && Object.keys(f).length > 0 && P.setProps(f);
|
|
1330
1335
|
};
|
|
1331
|
-
|
|
1336
|
+
c && Y(
|
|
1332
1337
|
() => t(),
|
|
1333
|
-
(
|
|
1334
|
-
n.value =
|
|
1338
|
+
(P) => {
|
|
1339
|
+
n.value = P, P && e.value && e.value.setProps(P);
|
|
1335
1340
|
},
|
|
1336
1341
|
{ deep: !0 }
|
|
1337
|
-
)
|
|
1342
|
+
);
|
|
1343
|
+
const s = () => {
|
|
1344
|
+
var P;
|
|
1345
|
+
return ((P = e.value) == null ? void 0 : P.getFieldsValue()) ?? {};
|
|
1346
|
+
}, r = async (P) => {
|
|
1347
|
+
var f;
|
|
1348
|
+
await ((f = e.value) == null ? void 0 : f.setFieldsValue(P));
|
|
1349
|
+
}, _ = async () => {
|
|
1350
|
+
var P;
|
|
1351
|
+
await ((P = e.value) == null ? void 0 : P.resetFields());
|
|
1352
|
+
}, u = (P) => {
|
|
1353
|
+
var f;
|
|
1354
|
+
return ((f = e.value) == null ? void 0 : f.validate(P)) ?? Promise.resolve();
|
|
1355
|
+
}, g = (P) => {
|
|
1356
|
+
var f;
|
|
1357
|
+
return ((f = e.value) == null ? void 0 : f.validateFields(P)) ?? Promise.resolve();
|
|
1358
|
+
}, z = () => {
|
|
1359
|
+
var P;
|
|
1360
|
+
return ((P = e.value) == null ? void 0 : P.submit()) ?? Promise.resolve();
|
|
1361
|
+
}, y = (P, f) => {
|
|
1362
|
+
var L;
|
|
1363
|
+
return ((L = e.value) == null ? void 0 : L.scrollToField(P, f)) ?? Promise.resolve();
|
|
1364
|
+
}, k = (P) => {
|
|
1365
|
+
var f;
|
|
1366
|
+
(f = e.value) == null || f.clearValidate(P);
|
|
1367
|
+
}, p = (P) => {
|
|
1368
|
+
var f;
|
|
1369
|
+
return ((f = e.value) == null ? void 0 : f.updateSchema(P)) ?? Promise.resolve();
|
|
1370
|
+
}, C = (P, f, L) => {
|
|
1371
|
+
var M;
|
|
1372
|
+
return ((M = e.value) == null ? void 0 : M.appendSchemaByField(P, f, L)) ?? Promise.resolve();
|
|
1373
|
+
}, b = (P) => {
|
|
1374
|
+
var f;
|
|
1375
|
+
return ((f = e.value) == null ? void 0 : f.removeSchemaByField(P)) ?? Promise.resolve();
|
|
1376
|
+
}, j = async (P) => {
|
|
1377
|
+
var f;
|
|
1378
|
+
n.value = { ...n.value, ...P }, await ((f = e.value) == null ? void 0 : f.setProps(P));
|
|
1379
|
+
}, N = (P) => {
|
|
1380
|
+
var f;
|
|
1381
|
+
return ((f = e.value) == null ? void 0 : f.getComponentInstance(P)) ?? null;
|
|
1382
|
+
};
|
|
1383
|
+
function x(P, f = !1) {
|
|
1384
|
+
return e.value ? f ? e.value.getFieldOptions(P, !0) : e.value.getFieldOptions(P) : [];
|
|
1385
|
+
}
|
|
1386
|
+
return [o, {
|
|
1338
1387
|
register: o,
|
|
1339
1388
|
formAction: e,
|
|
1340
|
-
getFieldsValue:
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
},
|
|
1356
|
-
validateFields: (f) => {
|
|
1357
|
-
var M;
|
|
1358
|
-
return ((M = e.value) == null ? void 0 : M.validateFields(f)) ?? Promise.resolve();
|
|
1359
|
-
},
|
|
1360
|
-
submit: () => {
|
|
1389
|
+
getFieldsValue: s,
|
|
1390
|
+
setFieldsValue: r,
|
|
1391
|
+
resetFields: _,
|
|
1392
|
+
validate: u,
|
|
1393
|
+
validateFields: g,
|
|
1394
|
+
submit: z,
|
|
1395
|
+
scrollToField: y,
|
|
1396
|
+
clearValidate: k,
|
|
1397
|
+
updateSchema: p,
|
|
1398
|
+
appendSchemaByField: C,
|
|
1399
|
+
removeSchemaByField: b,
|
|
1400
|
+
setProps: j,
|
|
1401
|
+
getComponentInstance: N,
|
|
1402
|
+
getFieldOptions: x,
|
|
1403
|
+
isFieldLoading: (P) => {
|
|
1361
1404
|
var f;
|
|
1362
|
-
return ((f = e.value) == null ? void 0 : f.
|
|
1363
|
-
},
|
|
1364
|
-
scrollToField: (f, M) => {
|
|
1365
|
-
var R;
|
|
1366
|
-
return ((R = e.value) == null ? void 0 : R.scrollToField(f, M)) ?? Promise.resolve();
|
|
1367
|
-
},
|
|
1368
|
-
clearValidate: (f) => {
|
|
1369
|
-
var M;
|
|
1370
|
-
(M = e.value) == null || M.clearValidate(f);
|
|
1371
|
-
},
|
|
1372
|
-
updateSchema: (f) => {
|
|
1373
|
-
var M;
|
|
1374
|
-
return ((M = e.value) == null ? void 0 : M.updateSchema(f)) ?? Promise.resolve();
|
|
1375
|
-
},
|
|
1376
|
-
appendSchemaByField: (f, M, R) => {
|
|
1377
|
-
var q;
|
|
1378
|
-
return ((q = e.value) == null ? void 0 : q.appendSchemaByField(f, M, R)) ?? Promise.resolve();
|
|
1379
|
-
},
|
|
1380
|
-
removeSchemaByField: (f) => {
|
|
1381
|
-
var M;
|
|
1382
|
-
return ((M = e.value) == null ? void 0 : M.removeSchemaByField(f)) ?? Promise.resolve();
|
|
1383
|
-
},
|
|
1384
|
-
setProps: async (f) => {
|
|
1385
|
-
var M;
|
|
1386
|
-
n.value = { ...n.value, ...f }, await ((M = e.value) == null ? void 0 : M.setProps(f));
|
|
1405
|
+
return ((f = e.value) == null ? void 0 : f.isFieldLoading(P)) ?? !1;
|
|
1387
1406
|
}
|
|
1388
1407
|
}];
|
|
1389
1408
|
}
|
|
1390
|
-
const
|
|
1409
|
+
const Nt = /* @__PURE__ */ le({
|
|
1391
1410
|
__name: "ProDescriptions",
|
|
1392
1411
|
props: {
|
|
1393
1412
|
title: null,
|
|
@@ -1403,7 +1422,7 @@ const Ot = /* @__PURE__ */ le({
|
|
|
1403
1422
|
},
|
|
1404
1423
|
emits: ["register"],
|
|
1405
1424
|
setup(c, { expose: e, emit: n }) {
|
|
1406
|
-
const t = c, o = D({}), s = D({}), r = D([]),
|
|
1425
|
+
const t = c, o = D({}), s = D({}), r = D([]), _ = D(typeof window < "u" ? window.innerWidth : 1920), u = D(!0), g = le({
|
|
1407
1426
|
name: "EcpDescriptionValueRenderer",
|
|
1408
1427
|
props: {
|
|
1409
1428
|
schema: { type: Object, required: !0 },
|
|
@@ -1411,77 +1430,77 @@ const Ot = /* @__PURE__ */ le({
|
|
|
1411
1430
|
record: { type: Object, required: !0 },
|
|
1412
1431
|
emptyText: { type: String, default: "-" }
|
|
1413
1432
|
},
|
|
1414
|
-
setup(
|
|
1433
|
+
setup(h) {
|
|
1415
1434
|
return () => {
|
|
1416
|
-
const
|
|
1417
|
-
const W =
|
|
1418
|
-
return W ? ue("el-tooltip", { props: W }, [
|
|
1435
|
+
const I = h.schema, $ = h.record, i = h.value, m = (B) => {
|
|
1436
|
+
const W = z(I, B === h.emptyText ? i : B, $), O = ue("span", B);
|
|
1437
|
+
return W ? ue("el-tooltip", { props: W }, [O]) : O;
|
|
1419
1438
|
};
|
|
1420
|
-
if (
|
|
1421
|
-
const B =
|
|
1422
|
-
return B == null || B === "" ? m(
|
|
1439
|
+
if (I.render) {
|
|
1440
|
+
const B = I.render(i, $);
|
|
1441
|
+
return B == null || B === "" ? m(h.emptyText) : typeof B == "string" || typeof B == "number" ? m(String(B)) : B;
|
|
1423
1442
|
}
|
|
1424
|
-
return Array.isArray(i) ? m(i.length ? i.join(", ") :
|
|
1443
|
+
return Array.isArray(i) ? m(i.length ? i.join(", ") : h.emptyText) : i == null || i === "" ? m(h.emptyText) : m(typeof i == "object" ? JSON.stringify(i) : String(i));
|
|
1425
1444
|
};
|
|
1426
1445
|
}
|
|
1427
|
-
}),
|
|
1428
|
-
const i =
|
|
1446
|
+
}), z = (h, I, $) => {
|
|
1447
|
+
const i = h.tooltip;
|
|
1429
1448
|
if (!i)
|
|
1430
1449
|
return null;
|
|
1431
|
-
const m = typeof i == "function" ? i({ value:
|
|
1432
|
-
return Te(m,
|
|
1433
|
-
}, { mergeSettings: y } = $e(), k =
|
|
1434
|
-
if (typeof
|
|
1435
|
-
return Math.max(1,
|
|
1436
|
-
const $ =
|
|
1437
|
-
return
|
|
1438
|
-
}, b =
|
|
1439
|
-
...
|
|
1440
|
-
dataIndex:
|
|
1441
|
-
}))),
|
|
1442
|
-
const
|
|
1443
|
-
let
|
|
1450
|
+
const m = typeof i == "function" ? i({ value: I, record: $, schema: h }) : i;
|
|
1451
|
+
return Te(m, I);
|
|
1452
|
+
}, { mergeSettings: y } = $e(), k = S(() => y("ProDescriptions", { ...t, ...o.value })), p = { xxl: 1920, xl: 1200, lg: 992, md: 768, sm: 576 }, C = (h, I) => {
|
|
1453
|
+
if (typeof h == "number")
|
|
1454
|
+
return Math.max(1, h);
|
|
1455
|
+
const $ = h ?? {};
|
|
1456
|
+
return I >= p.xxl ? $.xxl ?? $.xl ?? $.lg ?? $.md ?? $.sm ?? $.xs ?? 3 : I >= p.xl ? $.xl ?? $.lg ?? $.md ?? $.sm ?? $.xs ?? 3 : I >= p.lg ? $.lg ?? $.md ?? $.sm ?? $.xs ?? 3 : I >= p.md ? $.md ?? $.sm ?? $.xs ?? 3 : I >= p.sm ? $.sm ?? $.xs ?? 2 : $.xs ?? 1;
|
|
1457
|
+
}, b = S(() => C(k.value.column, _.value)), j = S(() => k.value.data ?? s.value ?? {}), N = S(() => (r.value.length ? r.value : k.value.schema ?? []).filter((h) => h.dataIndex || h.field ? typeof h.show == "function" ? h.show(j.value) : h.show !== !1 : !1).map((h) => ({
|
|
1458
|
+
...h,
|
|
1459
|
+
dataIndex: h.dataIndex || h.field || ""
|
|
1460
|
+
}))), x = S(() => {
|
|
1461
|
+
const h = [];
|
|
1462
|
+
let I = { items: [] }, $ = 0;
|
|
1444
1463
|
const i = b.value;
|
|
1445
|
-
return
|
|
1446
|
-
const W =
|
|
1447
|
-
$ + X > i && (
|
|
1464
|
+
return N.value.forEach((m, B) => {
|
|
1465
|
+
const W = N.value.length - B, O = Math.max(1, Math.min(m.span ?? 1, i)), X = W === 1 ? i - $ || i : O;
|
|
1466
|
+
$ + X > i && (h.push(I), I = { items: [] }, $ = 0);
|
|
1448
1467
|
const se = W === 1 && $ < i ? Math.max(1, i - $) : X;
|
|
1449
|
-
|
|
1450
|
-
}),
|
|
1451
|
-
}),
|
|
1452
|
-
var
|
|
1453
|
-
if (!
|
|
1454
|
-
return
|
|
1455
|
-
const
|
|
1456
|
-
return
|
|
1457
|
-
}),
|
|
1458
|
-
var
|
|
1459
|
-
const
|
|
1460
|
-
return !!k.value.useCollapse && !!(($ = k.value.collapseOptions) != null && $.canExpand) &&
|
|
1461
|
-
}),
|
|
1462
|
-
var
|
|
1468
|
+
I.items.push({ ...m, _span: se }), $ += se, $ >= i && (h.push(I), I = { items: [] }, $ = 0);
|
|
1469
|
+
}), I.items.length > 0 && h.push(I), h;
|
|
1470
|
+
}), q = S(() => {
|
|
1471
|
+
var I;
|
|
1472
|
+
if (!A.value || u.value)
|
|
1473
|
+
return x.value;
|
|
1474
|
+
const h = Math.max(1, ((I = k.value.collapseOptions) == null ? void 0 : I.visibleRows) ?? 1);
|
|
1475
|
+
return x.value.slice(0, h);
|
|
1476
|
+
}), A = S(() => {
|
|
1477
|
+
var I, $;
|
|
1478
|
+
const h = Math.max(1, ((I = k.value.collapseOptions) == null ? void 0 : I.visibleRows) ?? 1);
|
|
1479
|
+
return !!k.value.useCollapse && !!(($ = k.value.collapseOptions) != null && $.canExpand) && x.value.length > h;
|
|
1480
|
+
}), P = S(() => !!k.value.title || !!k.value.helpMessage || A.value), f = S(() => {
|
|
1481
|
+
var h, I;
|
|
1463
1482
|
return {
|
|
1464
|
-
expand: ((
|
|
1465
|
-
collapse: ((
|
|
1483
|
+
expand: ((h = k.value.collapseOptions) == null ? void 0 : h.expandButtonText) ?? "展开",
|
|
1484
|
+
collapse: ((I = k.value.collapseOptions) == null ? void 0 : I.collapseButtonText) ?? "收起"
|
|
1466
1485
|
};
|
|
1467
|
-
}),
|
|
1486
|
+
}), L = S(() => ({
|
|
1468
1487
|
gridTemplateColumns: `repeat(${b.value}, minmax(0, 1fr))`
|
|
1469
|
-
})),
|
|
1470
|
-
gridColumn: `span ${
|
|
1471
|
-
}), T = (
|
|
1472
|
-
minWidth:
|
|
1473
|
-
...
|
|
1474
|
-
}),
|
|
1475
|
-
minWidth:
|
|
1476
|
-
...
|
|
1477
|
-
}), U = (
|
|
1488
|
+
})), M = (h) => ({
|
|
1489
|
+
gridColumn: `span ${h._span}`
|
|
1490
|
+
}), T = (h) => ({
|
|
1491
|
+
minWidth: h.labelMinWidth ? `${h.labelMinWidth}px` : void 0,
|
|
1492
|
+
...h.labelStyle ?? {}
|
|
1493
|
+
}), K = (h) => ({
|
|
1494
|
+
minWidth: h.contentMinWidth ? `${h.contentMinWidth}px` : void 0,
|
|
1495
|
+
...h.contentStyle ?? {}
|
|
1496
|
+
}), U = (h) => j.value[h.dataIndex], H = () => {
|
|
1478
1497
|
r.value = [...k.value.schema ?? []];
|
|
1479
1498
|
}, Q = () => {
|
|
1480
1499
|
s.value = { ...k.value.data ?? {} };
|
|
1481
|
-
}, G = async (
|
|
1482
|
-
o.value = { ...o.value, ...
|
|
1483
|
-
}, ee = async (
|
|
1484
|
-
s.value = { ...s.value, ...
|
|
1500
|
+
}, G = async (h) => {
|
|
1501
|
+
o.value = { ...o.value, ...h }, h.schema && (r.value = [...h.schema]), h.data && (s.value = { ...h.data });
|
|
1502
|
+
}, ee = async (h) => {
|
|
1503
|
+
s.value = { ...s.value, ...h }, o.value = { ...o.value, data: s.value };
|
|
1485
1504
|
}, J = () => ({ ...k.value.data ?? s.value ?? {} }), te = {
|
|
1486
1505
|
setProps: G,
|
|
1487
1506
|
setData: ee,
|
|
@@ -1489,19 +1508,19 @@ const Ot = /* @__PURE__ */ le({
|
|
|
1489
1508
|
};
|
|
1490
1509
|
e(te);
|
|
1491
1510
|
const ne = () => {
|
|
1492
|
-
typeof window < "u" && (
|
|
1511
|
+
typeof window < "u" && (_.value = window.innerWidth);
|
|
1493
1512
|
};
|
|
1494
1513
|
return me(() => {
|
|
1495
|
-
var
|
|
1496
|
-
H(), Q(), u.value = ((
|
|
1514
|
+
var h;
|
|
1515
|
+
H(), Q(), u.value = ((h = k.value.collapseOptions) == null ? void 0 : h.defaultExpand) !== !1, n("register", te), typeof window < "u" && window.addEventListener("resize", ne);
|
|
1497
1516
|
}), Fe(() => {
|
|
1498
1517
|
typeof window < "u" && window.removeEventListener("resize", ne);
|
|
1499
1518
|
}), Y(() => k.value.schema, H, { deep: !0 }), Y(() => k.value.data, Q, { deep: !0 }), Y(() => {
|
|
1500
|
-
var
|
|
1501
|
-
return (
|
|
1502
|
-
}, (
|
|
1503
|
-
|
|
1504
|
-
}), { __sfc: !0, props: t, emit: n, innerProps: o, innerData: s, innerSchema: r, windowWidth:
|
|
1519
|
+
var h;
|
|
1520
|
+
return (h = k.value.collapseOptions) == null ? void 0 : h.defaultExpand;
|
|
1521
|
+
}, (h) => {
|
|
1522
|
+
h !== void 0 && (u.value = h);
|
|
1523
|
+
}), { __sfc: !0, props: t, emit: n, innerProps: o, innerData: s, innerSchema: r, windowWidth: _, expanded: u, DescriptionValueRenderer: g, normalizeTooltip: z, mergeSettings: y, effectiveProps: k, breakpoints: p, resolveColumn: C, currentColumn: b, effectiveData: j, visibleSchema: N, normalizedRows: x, renderedRows: q, showCollapseButton: A, showHeader: P, collapseButtonText: f, bodyStyle: L, getItemStyle: M, getLabelStyle: T, getContentStyle: K, getItemValue: U, syncSchema: H, syncData: Q, setProps: G, setData: ee, getData: J, descriptionAction: te, updateWindowWidth: ne };
|
|
1505
1524
|
}
|
|
1506
1525
|
});
|
|
1507
1526
|
var It = function() {
|
|
@@ -1517,12 +1536,12 @@ var It = function() {
|
|
|
1517
1536
|
`is-${t.effectiveProps.size}`,
|
|
1518
1537
|
{ "is-bordered": t.effectiveProps.bordered, "is-collapsed": t.showCollapseButton && !t.expanded }
|
|
1519
1538
|
], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(s, r) {
|
|
1520
|
-
return [e._l(s.items, function(
|
|
1521
|
-
return [n("div", { key: `${r}-${
|
|
1539
|
+
return [e._l(s.items, function(_) {
|
|
1540
|
+
return [n("div", { key: `${r}-${_.dataIndex || _.field}`, staticClass: "ecp-pro-descriptions__item", style: t.getItemStyle(_) }, [n("div", { staticClass: "ecp-pro-descriptions__label", style: t.getLabelStyle(_) }, [e._v(" " + e._s(_.label) + " ")]), n("div", { staticClass: "ecp-pro-descriptions__content", style: t.getContentStyle(_) }, [e.$scopedSlots[_.slot || _.dataIndex] ? e._t(_.slot || _.dataIndex, null, { value: t.getItemValue(_), record: t.effectiveData, schema: _ }) : n(t.DescriptionValueRenderer, { attrs: { schema: _, value: t.getItemValue(_), record: t.effectiveData, "empty-text": t.effectiveProps.emptyText || "-" } })], 2)])];
|
|
1522
1541
|
})];
|
|
1523
1542
|
})], 2)]);
|
|
1524
1543
|
}, Vt = [], Et = /* @__PURE__ */ ae(
|
|
1525
|
-
|
|
1544
|
+
Nt,
|
|
1526
1545
|
It,
|
|
1527
1546
|
Vt,
|
|
1528
1547
|
!1,
|
|
@@ -1540,8 +1559,8 @@ function Qt(c) {
|
|
|
1540
1559
|
return r;
|
|
1541
1560
|
}, o = (r) => {
|
|
1542
1561
|
e.value = r;
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1562
|
+
const _ = n();
|
|
1563
|
+
_ && Object.keys(_).length > 0 && r.setProps(_);
|
|
1545
1564
|
};
|
|
1546
1565
|
return c && Y(
|
|
1547
1566
|
() => n(),
|
|
@@ -1555,14 +1574,14 @@ function Qt(c) {
|
|
|
1555
1574
|
getData: () => t().getData()
|
|
1556
1575
|
}];
|
|
1557
1576
|
}
|
|
1558
|
-
const
|
|
1577
|
+
const Lt = {
|
|
1559
1578
|
name: "ProTableForm",
|
|
1560
1579
|
model: {
|
|
1561
1580
|
prop: "modelValue",
|
|
1562
1581
|
event: "update:modelValue"
|
|
1563
1582
|
}
|
|
1564
|
-
},
|
|
1565
|
-
...
|
|
1583
|
+
}, Wt = /* @__PURE__ */ le({
|
|
1584
|
+
...Lt,
|
|
1566
1585
|
props: {
|
|
1567
1586
|
modelValue: { default: () => ({}) },
|
|
1568
1587
|
columns: null,
|
|
@@ -1585,7 +1604,7 @@ const Wt = {
|
|
|
1585
1604
|
},
|
|
1586
1605
|
emits: ["update:modelValue"],
|
|
1587
1606
|
setup(c, { expose: e, emit: n }) {
|
|
1588
|
-
const t = c, o = D(null), s = () => t.competitorsKey ?? "competitors", r = () => t.competitorNameKey ?? "name",
|
|
1607
|
+
const t = c, o = D(null), s = () => t.competitorsKey ?? "competitors", r = () => t.competitorNameKey ?? "name", _ = S(() => t.fixedRows.length > 0 ? !0 : t.showFirstColumn !== !1), u = S(() => "left"), g = S(() => {
|
|
1589
1608
|
const i = t.actionColumn;
|
|
1590
1609
|
return {
|
|
1591
1610
|
width: (i == null ? void 0 : i.width) ?? t.actionWidth,
|
|
@@ -1594,10 +1613,10 @@ const Wt = {
|
|
|
1594
1613
|
fixed: (i == null ? void 0 : i.fixed) === void 0 ? "right" : i.fixed
|
|
1595
1614
|
};
|
|
1596
1615
|
});
|
|
1597
|
-
function
|
|
1616
|
+
function z(i) {
|
|
1598
1617
|
return i._type === "fixed" ? `f-${i.rowKey}` : `c-${i._index}`;
|
|
1599
1618
|
}
|
|
1600
|
-
const y =
|
|
1619
|
+
const y = S(() => {
|
|
1601
1620
|
const i = [];
|
|
1602
1621
|
t.fixedRows.forEach((W) => {
|
|
1603
1622
|
i.push({
|
|
@@ -1607,10 +1626,10 @@ const Wt = {
|
|
|
1607
1626
|
});
|
|
1608
1627
|
});
|
|
1609
1628
|
const m = t.modelValue;
|
|
1610
|
-
return ((m && typeof m == "object" ? m[s()] : void 0) ?? []).forEach((W,
|
|
1611
|
-
i.push({ _type: "competitor", _index:
|
|
1629
|
+
return ((m && typeof m == "object" ? m[s()] : void 0) ?? []).forEach((W, O) => {
|
|
1630
|
+
i.push({ _type: "competitor", _index: O });
|
|
1612
1631
|
}), i;
|
|
1613
|
-
}), k =
|
|
1632
|
+
}), k = S(() => {
|
|
1614
1633
|
const i = t.modelValue;
|
|
1615
1634
|
return ((i && typeof i == "object" ? i[s()] : void 0) ?? []).length > t.minCompetitors;
|
|
1616
1635
|
});
|
|
@@ -1618,78 +1637,78 @@ const Wt = {
|
|
|
1618
1637
|
const i = t.modelValue;
|
|
1619
1638
|
return !i || typeof i != "object" ? {} : JSON.parse(JSON.stringify(i));
|
|
1620
1639
|
}
|
|
1621
|
-
function
|
|
1640
|
+
function C(i) {
|
|
1622
1641
|
const m = t.modelValue;
|
|
1623
1642
|
if (!m || typeof m != "object") {
|
|
1624
|
-
const
|
|
1643
|
+
const O = {};
|
|
1625
1644
|
for (const X of t.columns)
|
|
1626
|
-
|
|
1627
|
-
return
|
|
1645
|
+
O[X.key] = "";
|
|
1646
|
+
return O;
|
|
1628
1647
|
}
|
|
1629
1648
|
const B = m[i];
|
|
1630
1649
|
if (B && typeof B == "object" && !Array.isArray(B))
|
|
1631
1650
|
return B;
|
|
1632
1651
|
const W = {};
|
|
1633
|
-
for (const
|
|
1634
|
-
W[
|
|
1652
|
+
for (const O of t.columns)
|
|
1653
|
+
W[O.key] = "";
|
|
1635
1654
|
return W;
|
|
1636
1655
|
}
|
|
1637
1656
|
function b(i) {
|
|
1638
1657
|
n("update:modelValue", i);
|
|
1639
1658
|
}
|
|
1640
1659
|
function j(i, m) {
|
|
1641
|
-
return
|
|
1660
|
+
return C(i)[m] ?? "";
|
|
1642
1661
|
}
|
|
1643
|
-
function
|
|
1644
|
-
const W = p(),
|
|
1645
|
-
|
|
1662
|
+
function N(i, m, B) {
|
|
1663
|
+
const W = p(), O = { ...W[i] || {} };
|
|
1664
|
+
O[m] = B, W[i] = O, b(W);
|
|
1646
1665
|
}
|
|
1647
|
-
function
|
|
1666
|
+
function x() {
|
|
1648
1667
|
const i = t.modelValue;
|
|
1649
1668
|
if (!i || typeof i != "object")
|
|
1650
1669
|
return [];
|
|
1651
1670
|
const m = i[s()];
|
|
1652
1671
|
return Array.isArray(m) ? m : [];
|
|
1653
1672
|
}
|
|
1654
|
-
function
|
|
1655
|
-
const m =
|
|
1673
|
+
function q(i) {
|
|
1674
|
+
const m = x()[i], B = r();
|
|
1656
1675
|
return m ? String(m[B] ?? "") : "";
|
|
1657
1676
|
}
|
|
1658
|
-
function
|
|
1659
|
-
const B = p(), W = [...
|
|
1660
|
-
|
|
1677
|
+
function A(i, m) {
|
|
1678
|
+
const B = p(), W = [...x()], O = { ...W[i] || {} };
|
|
1679
|
+
O[r()] = m, W[i] = O, B[s()] = W, b(B);
|
|
1661
1680
|
}
|
|
1662
|
-
function
|
|
1663
|
-
const B =
|
|
1681
|
+
function P(i, m) {
|
|
1682
|
+
const B = x()[i];
|
|
1664
1683
|
return B ? B[m] ?? "" : "";
|
|
1665
1684
|
}
|
|
1666
|
-
function
|
|
1667
|
-
const W = p(),
|
|
1668
|
-
X[m] = B,
|
|
1685
|
+
function f(i, m, B) {
|
|
1686
|
+
const W = p(), O = [...x()], X = { ...O[i] || {} };
|
|
1687
|
+
X[m] = B, O[i] = X, W[s()] = O, b(W);
|
|
1669
1688
|
}
|
|
1670
|
-
function
|
|
1671
|
-
return i._type === "fixed" ? j(i.rowKey, m.key) :
|
|
1689
|
+
function L(i, m) {
|
|
1690
|
+
return i._type === "fixed" ? j(i.rowKey, m.key) : P(i._index, m.key);
|
|
1672
1691
|
}
|
|
1673
|
-
function
|
|
1674
|
-
i._type === "fixed" ?
|
|
1692
|
+
function M(i, m, B) {
|
|
1693
|
+
i._type === "fixed" ? N(i.rowKey, m.key, B) : f(i._index, m.key, B);
|
|
1675
1694
|
}
|
|
1676
1695
|
function T(i, m) {
|
|
1677
|
-
return (B) =>
|
|
1696
|
+
return (B) => M(i.row, m, B);
|
|
1678
1697
|
}
|
|
1679
|
-
function
|
|
1698
|
+
function K() {
|
|
1680
1699
|
const i = { [r()]: "" };
|
|
1681
1700
|
for (const m of t.columns)
|
|
1682
1701
|
i[m.key] = "";
|
|
1683
1702
|
return i;
|
|
1684
1703
|
}
|
|
1685
1704
|
function U() {
|
|
1686
|
-
const i = p(), m = [...
|
|
1687
|
-
m.push(
|
|
1705
|
+
const i = p(), m = [...x()];
|
|
1706
|
+
m.push(K()), i[s()] = m, b(i);
|
|
1688
1707
|
}
|
|
1689
1708
|
function H(i) {
|
|
1690
1709
|
if (!k.value)
|
|
1691
1710
|
return;
|
|
1692
|
-
const m = p(), B = [...
|
|
1711
|
+
const m = p(), B = [...x()];
|
|
1693
1712
|
B.splice(i, 1), m[s()] = B, b(m);
|
|
1694
1713
|
}
|
|
1695
1714
|
function Q(i, m) {
|
|
@@ -1728,22 +1747,22 @@ const Wt = {
|
|
|
1728
1747
|
row: m,
|
|
1729
1748
|
rowType: "competitor",
|
|
1730
1749
|
rowIndex: B,
|
|
1731
|
-
value:
|
|
1732
|
-
updateValue: (W) =>
|
|
1750
|
+
value: q(B),
|
|
1751
|
+
updateValue: (W) => A(B, W)
|
|
1733
1752
|
};
|
|
1734
1753
|
}
|
|
1735
|
-
const
|
|
1754
|
+
const h = S(() => {
|
|
1736
1755
|
const i = {}, m = (W) => [{ required: !0, message: `请输入${W}`, trigger: "blur" }];
|
|
1737
1756
|
for (const W of t.fixedRows)
|
|
1738
|
-
for (const
|
|
1739
|
-
|
|
1740
|
-
return
|
|
1741
|
-
i[`${s()}.${
|
|
1757
|
+
for (const O of t.columns)
|
|
1758
|
+
O.rules ? i[`${W.rowKey}.${O.key}`] = O.rules : O.required && (i[`${W.rowKey}.${O.key}`] = m(O.title));
|
|
1759
|
+
return x().forEach((W, O) => {
|
|
1760
|
+
i[`${s()}.${O}.${r()}`] = m("友商名称");
|
|
1742
1761
|
for (const X of t.columns)
|
|
1743
|
-
X.rules ? i[`${s()}.${
|
|
1762
|
+
X.rules ? i[`${s()}.${O}.${X.key}`] = X.rules : X.required && (i[`${s()}.${O}.${X.key}`] = m(X.title));
|
|
1744
1763
|
}), { ...i, ...t.rules || {} };
|
|
1745
1764
|
});
|
|
1746
|
-
function
|
|
1765
|
+
function I() {
|
|
1747
1766
|
return new Promise((i) => {
|
|
1748
1767
|
const m = o.value;
|
|
1749
1768
|
if (!m || typeof m.validate != "function") {
|
|
@@ -1760,14 +1779,14 @@ const Wt = {
|
|
|
1760
1779
|
(B = (m = o.value) == null ? void 0 : m.clearValidate) == null || B.call(m, i);
|
|
1761
1780
|
}
|
|
1762
1781
|
return e({
|
|
1763
|
-
validate:
|
|
1782
|
+
validate: I,
|
|
1764
1783
|
clearValidate: $,
|
|
1765
1784
|
addCompetitor: U,
|
|
1766
1785
|
removeCompetitor: H
|
|
1767
|
-
}), { __sfc: !0, props: t, emit: n, formRef: o, ck: s, nk: r, showFirstColumnComputed:
|
|
1786
|
+
}), { __sfc: !0, props: t, emit: n, formRef: o, ck: s, nk: r, showFirstColumnComputed: _, firstColumnFixed: u, actionColumnBind: g, rowKeyFn: z, tableRows: y, canDeleteCompetitor: k, cloneModel: p, ensureFixedBlock: C, emitNext: b, getFixedMetric: j, setFixedMetric: N, competitorList: x, getCompetitorName: q, setCompetitorName: A, getCompetitorMetric: P, setCompetitorMetric: f, getCellValue: L, setCellValue: M, slotUpdateHandler: T, emptyCompetitorRow: K, addCompetitor: U, removeCompetitor: H, fixedMetricProp: Q, competitorNameProp: G, competitorMetricProp: ee, cellComponent: J, cellBind: te, firstColumnScope: ne, mergedRules: h, validate: I, clearValidate: $ };
|
|
1768
1787
|
}
|
|
1769
1788
|
});
|
|
1770
|
-
var
|
|
1789
|
+
var Kt = function() {
|
|
1771
1790
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1772
1791
|
return n("div", { staticClass: "ecp-pro-table-form" }, [n("el-form", { ref: "formRef", staticClass: "ecp-pro-table-form__form", attrs: { model: e.modelValue, rules: t.mergedRules, "label-width": e.labelWidth } }, [n("el-table", { staticClass: "ecp-pro-table-form__table", attrs: { data: t.tableRows, border: e.bordered, "row-key": t.rowKeyFn, "header-cell-class-name": "ecp-pro-table-form__header-cell" } }, [t.showFirstColumnComputed ? n("el-table-column", { attrs: { "min-width": e.firstColMinWidth, fixed: t.firstColumnFixed }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
1773
1792
|
return [e._t("firstColumnHeader", function() {
|
|
@@ -1804,8 +1823,8 @@ var Lt = function() {
|
|
|
1804
1823
|
}, { row: o.row, canDelete: t.canDeleteCompetitor, addCompetitor: t.addCompetitor, removeCompetitor: t.removeCompetitor })];
|
|
1805
1824
|
} }], null, !0) }, "el-table-column", t.actionColumnBind, !1)) : e._e()], 2)], 1)], 1);
|
|
1806
1825
|
}, jt = [], qt = /* @__PURE__ */ ae(
|
|
1826
|
+
Wt,
|
|
1807
1827
|
Kt,
|
|
1808
|
-
Lt,
|
|
1809
1828
|
jt,
|
|
1810
1829
|
!1,
|
|
1811
1830
|
null,
|
|
@@ -1814,7 +1833,7 @@ var Lt = function() {
|
|
|
1814
1833
|
null
|
|
1815
1834
|
);
|
|
1816
1835
|
const Ge = qt.exports, Ht = [
|
|
1817
|
-
{ name: "ProTable", component:
|
|
1836
|
+
{ name: "ProTable", component: Ke },
|
|
1818
1837
|
{ name: "TableAction", component: je },
|
|
1819
1838
|
{ name: "ProForm", component: Je },
|
|
1820
1839
|
{ name: "ProFormItem", component: qe },
|
|
@@ -1830,7 +1849,7 @@ function Jt(c) {
|
|
|
1830
1849
|
}
|
|
1831
1850
|
const Yt = {
|
|
1832
1851
|
install: Jt,
|
|
1833
|
-
ProTable:
|
|
1852
|
+
ProTable: Ke,
|
|
1834
1853
|
ProForm: Je,
|
|
1835
1854
|
ProDescriptions: Ue,
|
|
1836
1855
|
TableAction: je,
|
|
@@ -1843,13 +1862,13 @@ export {
|
|
|
1843
1862
|
Ue as ProDescriptions,
|
|
1844
1863
|
Je as ProForm,
|
|
1845
1864
|
qe as ProFormItem,
|
|
1846
|
-
|
|
1865
|
+
Ke as ProTable,
|
|
1847
1866
|
Ge as ProTableForm,
|
|
1848
1867
|
je as TableAction,
|
|
1849
1868
|
dt as applyNumericInputDigitLimits,
|
|
1850
1869
|
Ee as clampByIntegerDigits,
|
|
1851
1870
|
Yt as default,
|
|
1852
|
-
|
|
1871
|
+
Le as formatWithThousands,
|
|
1853
1872
|
Jt as install,
|
|
1854
1873
|
Se as normalizeNumericValue,
|
|
1855
1874
|
vt as numberToEditString,
|