@aspire-ui/element-component-pro 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { reactive as et, defineComponent as ne, h as de, useSlots as he, ref as
|
|
1
|
+
import { reactive as et, defineComponent as ne, h as de, useSlots as he, ref as D, computed as w, onMounted as me, nextTick as Le, onUnmounted as Be, watch as U, unref as pe } from "vue";
|
|
2
2
|
import { MessageBox as tt } from "element-ui";
|
|
3
|
-
const
|
|
3
|
+
const fe = et({});
|
|
4
4
|
function Te(s, e) {
|
|
5
5
|
if (!e)
|
|
6
6
|
return s;
|
|
@@ -22,13 +22,13 @@ function Oe(s) {
|
|
|
22
22
|
}
|
|
23
23
|
function Re() {
|
|
24
24
|
return {
|
|
25
|
-
getSetting: (t) => JSON.parse(JSON.stringify(t === void 0 ?
|
|
25
|
+
getSetting: (t) => JSON.parse(JSON.stringify(t === void 0 ? fe : fe[t] ?? {})),
|
|
26
26
|
setSetting: (t, o) => {
|
|
27
|
-
const r =
|
|
28
|
-
r ?
|
|
27
|
+
const r = fe[t];
|
|
28
|
+
r ? fe[t] = Te({ ...r }, o) : fe[t] = { ...o };
|
|
29
29
|
},
|
|
30
30
|
mergeSettings: (t, o) => {
|
|
31
|
-
const r =
|
|
31
|
+
const r = fe[t] ?? {};
|
|
32
32
|
return Te({ ...r }, o);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
@@ -70,7 +70,7 @@ const je = ne({
|
|
|
70
70
|
setup(s) {
|
|
71
71
|
return () => {
|
|
72
72
|
const e = s.slotRender, n = e == null ? void 0 : e({ column: s.column, record: s.record, index: s.index, value: s.value });
|
|
73
|
-
if (((a) => a == null ? [] : Array.isArray(a) ? a.filter((
|
|
73
|
+
if (((a) => a == null ? [] : Array.isArray(a) ? a.filter((f) => f != null && f !== !1 && !f.isComment) : [a])(n).length > 0)
|
|
74
74
|
return n;
|
|
75
75
|
const r = { ...s.column };
|
|
76
76
|
return s.customRender && (r.customRender = s.customRender), s.valueEnum && (r.valueEnum = s.valueEnum), de(je, { props: { column: r, record: s.record, index: s.index, value: s.value } });
|
|
@@ -88,29 +88,29 @@ const je = ne({
|
|
|
88
88
|
return { __sfc: !0, props: e, $scopedSlots: n, shouldShowColumn: (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, DefaultCellRenderer: je, BodyCellRenderer: qe };
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
function
|
|
91
|
+
function se(s, e, n, t, o, r, a, f) {
|
|
92
92
|
var m = typeof s == "function" ? s.options : s;
|
|
93
93
|
e && (m.render = e, m.staticRenderFns = n, m._compiled = !0), t && (m.functional = !0), r && (m._scopeId = "data-v-" + r);
|
|
94
|
-
var
|
|
95
|
-
if (a ? (
|
|
96
|
-
|
|
94
|
+
var _;
|
|
95
|
+
if (a ? (_ = function(x) {
|
|
96
|
+
x = x || // cached call
|
|
97
97
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
98
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
99
|
-
}, m._ssrRegister =
|
|
98
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !x && typeof __VUE_SSR_CONTEXT__ < "u" && (x = __VUE_SSR_CONTEXT__), o && o.call(this, x), x && x._registeredComponents && x._registeredComponents.add(a);
|
|
99
|
+
}, m._ssrRegister = _) : o && (_ = f ? function() {
|
|
100
100
|
o.call(
|
|
101
101
|
this,
|
|
102
102
|
(m.functional ? this.parent : this).$root.$options.shadowRoot
|
|
103
103
|
);
|
|
104
|
-
} : o),
|
|
104
|
+
} : o), _)
|
|
105
105
|
if (m.functional) {
|
|
106
|
-
m._injectStyles =
|
|
107
|
-
var
|
|
108
|
-
m.render = function(
|
|
109
|
-
return
|
|
106
|
+
m._injectStyles = _;
|
|
107
|
+
var z = m.render;
|
|
108
|
+
m.render = function(p, v) {
|
|
109
|
+
return _.call(v), z(p, v);
|
|
110
110
|
};
|
|
111
111
|
} else {
|
|
112
|
-
var
|
|
113
|
-
m.beforeCreate =
|
|
112
|
+
var S = m.beforeCreate;
|
|
113
|
+
m.beforeCreate = S ? [].concat(S, _) : [_];
|
|
114
114
|
}
|
|
115
115
|
return {
|
|
116
116
|
exports: s,
|
|
@@ -130,7 +130,7 @@ var ot = function() {
|
|
|
130
130
|
}), 0) : n("span", [e._v(e._s(e.column.helpMessage))])];
|
|
131
131
|
}, proxy: !0 }], null, !1, 347236738) }, [n("i", { staticClass: "el-icon-question" })]) : e._e()]];
|
|
132
132
|
}, proxy: !0 }], null, !0) });
|
|
133
|
-
}, lt = [], at = /* @__PURE__ */
|
|
133
|
+
}, lt = [], at = /* @__PURE__ */ se(
|
|
134
134
|
nt,
|
|
135
135
|
ot,
|
|
136
136
|
lt,
|
|
@@ -185,269 +185,279 @@ const st = at.exports, rt = /* @__PURE__ */ ne({
|
|
|
185
185
|
},
|
|
186
186
|
emits: ["register", "fetch-success", "fetch-error", "selection-change", "row-click", "row-dblclick", "sort-change", "expand-change"],
|
|
187
187
|
setup(s, { expose: e, emit: n }) {
|
|
188
|
-
const t = s, o = he(), r =
|
|
188
|
+
const t = s, o = he(), r = D(), a = D(), f = D(0), m = D(t.loading ?? !1), _ = D([]), z = w(() => {
|
|
189
|
+
const l = _.value;
|
|
190
|
+
if (!l.length)
|
|
191
|
+
return l;
|
|
192
|
+
const { page: c, pageSize: g } = E.value, C = (c - 1) * g;
|
|
193
|
+
return l.slice(C, C + g);
|
|
194
|
+
}), S = D({}), x = D([]), p = D({}), v = D([]), B = D(null), { mergeSettings: V } = Re(), F = w(() => V("ProTable", { ...t, ...p.value })), A = w(() => {
|
|
189
195
|
const l = F.value.pagination;
|
|
190
196
|
return l && typeof l == "object" ? {
|
|
191
197
|
pageSize: l.pageSize ?? 10,
|
|
192
198
|
pageSizes: l.pageSizes ?? [10, 20, 50, 100]
|
|
193
199
|
} : { pageSize: 10, pageSizes: [10, 20, 50, 100] };
|
|
194
|
-
}),
|
|
200
|
+
}), E = D({
|
|
195
201
|
page: 1,
|
|
196
|
-
pageSize:
|
|
197
|
-
pageSizes:
|
|
202
|
+
pageSize: A.value.pageSize,
|
|
203
|
+
pageSizes: A.value.pageSizes,
|
|
198
204
|
total: 0
|
|
199
|
-
}),
|
|
200
|
-
() =>
|
|
201
|
-
),
|
|
202
|
-
const l = /* @__PURE__ */ new Map(),
|
|
203
|
-
for (const
|
|
204
|
-
|
|
205
|
+
}), I = w(() => !!F.value.title || !!o.tableTitle || !!o.toolbar), k = w(() => B.value !== null ? B.value : !!t.pagination && typeof t.pagination == "object"), u = w(() => F.value.pagination && typeof F.value.pagination == "object" ? !!F.value.pagination.small : !1), W = w(() => F.value.pagination && typeof F.value.pagination == "object" ? !!F.value.pagination.background : !1), y = w(() => F.value.rowKey || "id"), j = w(() => new Set(v.value.map((l) => l[y.value]))), q = w(
|
|
206
|
+
() => x.value.filter((l) => !l.hideInTable && !l.defaultHidden)
|
|
207
|
+
), X = w(() => {
|
|
208
|
+
const l = /* @__PURE__ */ new Map(), c = (g) => {
|
|
209
|
+
for (const C of g)
|
|
210
|
+
C.children && C.children.length > 0 ? c(C.children) : C.id && l.set(C.id, C);
|
|
205
211
|
};
|
|
206
|
-
return
|
|
207
|
-
}),
|
|
208
|
-
var
|
|
212
|
+
return c(q.value), l;
|
|
213
|
+
}), G = w(() => Array.from(X.value.values())), ee = w(() => {
|
|
214
|
+
var c, g;
|
|
209
215
|
let l = 0;
|
|
210
|
-
return F.value.rowSelection && (l += Number(F.value.rowSelection.width) || 48), F.value.showIndexColumn && (l += Number((
|
|
211
|
-
}),
|
|
216
|
+
return F.value.rowSelection && (l += Number(F.value.rowSelection.width) || 48), F.value.showIndexColumn && (l += Number((c = F.value.indexColumnProps) == null ? void 0 : c.width) || 60), F.value.actionColumn && (l += Number((g = F.value.actionColumn) == null ? void 0 : g.width) || 150), l;
|
|
217
|
+
}), Z = (l) => typeof l == "number" && l > 0, Y = w(() => G.value.filter((c) => O(c) && Z(c.width)).reduce((c, g) => c + (typeof g.width == "number" ? g.width : 0), 0)), te = w(() => G.value.filter((c) => O(c) && typeof c.width == "string").reduce((c, g) => c + (Number(b(g)) || 80), 0)), J = (l) => l == null ? null : typeof l == "number" ? l : parseInt(String(l).replace(/px$/i, ""), 10) || null, le = (l) => {
|
|
212
218
|
if (!F.value.spanMethod)
|
|
213
219
|
return [1, 1];
|
|
214
|
-
const
|
|
220
|
+
const c = X.value.get(l.column.id);
|
|
215
221
|
return F.value.spanMethod({
|
|
216
222
|
...l,
|
|
217
|
-
column: { ...
|
|
223
|
+
column: { ...c, dataIndex: l.column.property, title: l.column.label }
|
|
218
224
|
});
|
|
219
|
-
},
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
222
|
-
const g =
|
|
223
|
-
let
|
|
224
|
-
const
|
|
225
|
-
return
|
|
225
|
+
}, b = (l) => {
|
|
226
|
+
const c = l.width;
|
|
227
|
+
if (Z(c) && Y.value > 0 && f.value > 0 && typeof c == "number") {
|
|
228
|
+
const g = f.value - ee.value - te.value;
|
|
229
|
+
let C = Math.floor(g * c / Y.value);
|
|
230
|
+
const H = J(l.minWidth) ?? 60, N = J(l.maxWidth);
|
|
231
|
+
return C = Math.max(H, C), N != null && (C = Math.min(N, C)), C;
|
|
226
232
|
}
|
|
227
|
-
if (typeof
|
|
228
|
-
const g =
|
|
229
|
-
let
|
|
230
|
-
return
|
|
233
|
+
if (typeof c == "string") {
|
|
234
|
+
const g = J(c) ?? 80, C = J(l.minWidth), H = J(l.maxWidth);
|
|
235
|
+
let N = g;
|
|
236
|
+
return C != null && (N = Math.max(C, N)), H != null && (N = Math.min(H, N)), N;
|
|
231
237
|
}
|
|
232
238
|
return l.minWidth;
|
|
233
|
-
},
|
|
234
|
-
var
|
|
235
|
-
const l = (
|
|
236
|
-
return l ?
|
|
237
|
-
var
|
|
238
|
-
return !((
|
|
239
|
-
}) :
|
|
240
|
-
}),
|
|
241
|
-
const l =
|
|
242
|
-
return l > 0 && l <
|
|
243
|
-
}),
|
|
244
|
-
var
|
|
245
|
-
return ((
|
|
246
|
-
},
|
|
247
|
-
var
|
|
248
|
-
return ((
|
|
249
|
-
},
|
|
250
|
-
const l =
|
|
251
|
-
n("selection-change", { keys: l, rows:
|
|
252
|
-
},
|
|
253
|
-
const g = l[
|
|
254
|
-
|
|
255
|
-
}, _e = (l) => {
|
|
256
|
-
c.value = [l], H();
|
|
239
|
+
}, O = (l) => l.ifShow === !1 ? !1 : typeof l.ifShow == "function" ? l.ifShow({ column: l }) : !0, $ = w(() => {
|
|
240
|
+
var c;
|
|
241
|
+
const l = (c = F.value.rowSelection) == null ? void 0 : c.getCheckboxProps;
|
|
242
|
+
return l ? z.value.filter((g) => {
|
|
243
|
+
var C;
|
|
244
|
+
return !((C = l(g)) != null && C.disabled);
|
|
245
|
+
}) : z.value;
|
|
246
|
+
}), i = w(() => $.value.length > 0), h = w(() => $.value.length === 0 ? !1 : $.value.every((l) => j.value.has(l[y.value]))), M = w(() => {
|
|
247
|
+
const l = $.value.filter((c) => j.value.has(c[y.value])).length;
|
|
248
|
+
return l > 0 && l < $.value.length;
|
|
249
|
+
}), K = (l) => j.value.has(l[y.value]), L = (l) => {
|
|
250
|
+
var c, g, C;
|
|
251
|
+
return ((C = (g = (c = F.value.rowSelection) == null ? void 0 : c.getCheckboxProps) == null ? void 0 : g.call(c, l)) == null ? void 0 : C.disabled) ?? !1;
|
|
252
|
+
}, Q = (l) => {
|
|
253
|
+
var c, g, C;
|
|
254
|
+
return ((C = (g = (c = F.value.rowSelection) == null ? void 0 : c.getRadioProps) == null ? void 0 : g.call(c, l)) == null ? void 0 : C.disabled) ?? !1;
|
|
255
|
+
}, ae = () => {
|
|
256
|
+
const l = v.value.map((c) => c[y.value]);
|
|
257
|
+
n("selection-change", { keys: l, rows: v.value });
|
|
258
|
+
}, _e = (l, c) => {
|
|
259
|
+
const g = l[y.value];
|
|
260
|
+
c ? v.value = [...v.value.filter((C) => C[y.value] !== g), l] : v.value = v.value.filter((C) => C[y.value] !== g), ae();
|
|
257
261
|
}, ge = (l) => {
|
|
262
|
+
v.value = [l], ae();
|
|
263
|
+
}, be = (l) => {
|
|
258
264
|
if (l) {
|
|
259
|
-
const
|
|
260
|
-
|
|
265
|
+
const c = new Set(v.value.map((C) => C[y.value])), g = $.value.filter((C) => !c.has(C[y.value]));
|
|
266
|
+
v.value = [...v.value, ...g];
|
|
261
267
|
} else {
|
|
262
|
-
const
|
|
263
|
-
|
|
268
|
+
const c = new Set(z.value.map((g) => g[y.value]));
|
|
269
|
+
v.value = v.value.filter((g) => !c.has(g[y.value]));
|
|
264
270
|
}
|
|
265
|
-
|
|
266
|
-
},
|
|
271
|
+
ae();
|
|
272
|
+
}, re = async (l) => {
|
|
267
273
|
if (!t.api) {
|
|
268
274
|
if (t.dataSource)
|
|
269
275
|
return;
|
|
270
|
-
|
|
276
|
+
_.value = [];
|
|
271
277
|
return;
|
|
272
278
|
}
|
|
273
279
|
m.value = !0;
|
|
274
280
|
try {
|
|
275
|
-
const
|
|
276
|
-
[g]: (l == null ? void 0 : l.page) ??
|
|
277
|
-
[
|
|
281
|
+
const c = F.value.fetchSetting ?? {}, g = c.pageField ?? "page", C = c.sizeField ?? "pageSize", H = c.listField ?? "list", N = c.totalField ?? "total", oe = {
|
|
282
|
+
[g]: (l == null ? void 0 : l.page) ?? E.value.page,
|
|
283
|
+
[C]: (l == null ? void 0 : l.pageSize) ?? E.value.pageSize,
|
|
278
284
|
...t.searchInfo,
|
|
279
285
|
...l == null ? void 0 : l.searchInfo
|
|
280
286
|
};
|
|
281
|
-
(l == null ? void 0 : l.page) != null && (
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
const Fe = t.afterFetch ? t.afterFetch($e) : $e, ze = Fe[
|
|
285
|
-
|
|
286
|
-
} catch (
|
|
287
|
-
n("fetch-error",
|
|
287
|
+
(l == null ? void 0 : l.page) != null && (E.value.page = l.page), (l == null ? void 0 : l.pageSize) != null && (E.value.pageSize = l.pageSize);
|
|
288
|
+
const ie = t.beforeFetch ? t.beforeFetch(oe) : oe, $e = await t.api(ie);
|
|
289
|
+
S.value = $e || {};
|
|
290
|
+
const Fe = t.afterFetch ? t.afterFetch($e) : $e, ze = Fe[H] ?? Fe.items ?? Fe.list ?? [], Ee = Fe[N] ?? 0;
|
|
291
|
+
_.value = ze, E.value.total = Ee, n("fetch-success", { items: ze, total: Ee });
|
|
292
|
+
} catch (c) {
|
|
293
|
+
_.value = [], n("fetch-error", c);
|
|
288
294
|
} finally {
|
|
289
295
|
m.value = !1;
|
|
290
296
|
}
|
|
291
|
-
},
|
|
292
|
-
F.value.clearSelectOnPageChange && (
|
|
293
|
-
},
|
|
294
|
-
F.value.clearSelectOnPageChange && (
|
|
295
|
-
},
|
|
297
|
+
}, ye = () => re(void 0), we = (l) => {
|
|
298
|
+
F.value.clearSelectOnPageChange && (v.value = []), E.value.pageSize = l, E.value.page = 1, re(void 0);
|
|
299
|
+
}, Ce = (l) => {
|
|
300
|
+
F.value.clearSelectOnPageChange && (v.value = []), E.value.page = l, re(void 0);
|
|
301
|
+
}, xe = (l, c, g) => n("row-click", l, g), Pe = (l, c, g) => n("row-dblclick", l, g), Se = ({ prop: l, order: c }) => n("sort-change", { prop: l, order: c }), ve = (l, c) => n("expand-change", l, c), ce = {
|
|
296
302
|
setProps: (l) => {
|
|
297
|
-
|
|
303
|
+
p.value = { ...p.value, ...l };
|
|
298
304
|
},
|
|
299
|
-
reload: (l) =>
|
|
305
|
+
reload: (l) => re(l),
|
|
300
306
|
redoHeight: () => {
|
|
301
|
-
var l,
|
|
302
|
-
(
|
|
307
|
+
var l, c;
|
|
308
|
+
(c = (l = r.value) == null ? void 0 : l.doLayout) == null || c.call(l);
|
|
303
309
|
},
|
|
304
310
|
setLoading: (l) => {
|
|
305
311
|
m.value = l;
|
|
306
312
|
},
|
|
307
|
-
|
|
308
|
-
|
|
313
|
+
/** 返回全量数据(API 模式为服务端返回的当前页数据,本地模式为原始全量数据) */
|
|
314
|
+
getDataSource: () => _.value,
|
|
315
|
+
getRawDataSource: () => S.value,
|
|
316
|
+
/** 设置本地全量数据,同时同步 total */
|
|
309
317
|
setTableData: (l) => {
|
|
310
|
-
|
|
318
|
+
_.value = l ?? [], t.pagination !== !1 && (E.value.total = (l ?? []).length);
|
|
311
319
|
},
|
|
312
|
-
getColumns: () =>
|
|
320
|
+
getColumns: () => x.value,
|
|
313
321
|
setColumns: (l) => {
|
|
314
322
|
if (Array.isArray(l) && l.length > 0 && typeof l[0] == "string") {
|
|
315
|
-
const
|
|
316
|
-
|
|
323
|
+
const c = l, g = (t.columns ?? []).filter((H) => c.includes(H.key ?? H.dataIndex)), C = c.map((H) => g.find((N) => (N.key ?? N.dataIndex) === H)).filter(Boolean);
|
|
324
|
+
C.length && (x.value = C);
|
|
317
325
|
} else
|
|
318
|
-
|
|
326
|
+
x.value = l ?? [];
|
|
319
327
|
},
|
|
320
328
|
setPagination: (l) => {
|
|
321
|
-
l != null && l.page && (
|
|
329
|
+
l != null && l.page && (E.value.page = l.page), l != null && l.pageSize && (E.value.pageSize = l.pageSize), (l == null ? void 0 : l.total) !== void 0 && (E.value.total = l.total);
|
|
322
330
|
},
|
|
323
|
-
getSelectRowKeys: () =>
|
|
324
|
-
getSelectRows: () =>
|
|
331
|
+
getSelectRowKeys: () => v.value.map((l) => l[y.value]),
|
|
332
|
+
getSelectRows: () => v.value,
|
|
325
333
|
clearSelectedRowKeys: () => {
|
|
326
|
-
|
|
334
|
+
v.value = [], ae();
|
|
327
335
|
},
|
|
328
336
|
setSelectedRowKeys: (l) => {
|
|
329
|
-
const
|
|
330
|
-
l.forEach((
|
|
331
|
-
g.some((
|
|
332
|
-
}),
|
|
337
|
+
const c = new Set(l), g = _.value.filter((C) => c.has(C[y.value]));
|
|
338
|
+
l.forEach((C) => {
|
|
339
|
+
g.some((H) => H[y.value] === C) || g.push({ [y.value]: C });
|
|
340
|
+
}), v.value = g, ae();
|
|
333
341
|
},
|
|
334
342
|
deleteSelectRowByKey: (l) => {
|
|
335
|
-
|
|
343
|
+
v.value = v.value.filter((c) => c[y.value] !== l), ae();
|
|
336
344
|
},
|
|
337
|
-
|
|
338
|
-
|
|
345
|
+
/** index 为当前页索引,自动转换为全量索引 */
|
|
346
|
+
updateTableData: (l, c, g) => {
|
|
347
|
+
const { page: C, pageSize: H } = E.value, N = (C - 1) * H + l;
|
|
348
|
+
N < 0 || N >= _.value.length || (_.value = [..._.value], _.value[N] = { ..._.value[N], [c]: g });
|
|
339
349
|
},
|
|
340
|
-
updateTableDataRecord: (l,
|
|
341
|
-
const g =
|
|
350
|
+
updateTableDataRecord: (l, c) => {
|
|
351
|
+
const g = _.value.findIndex((C) => C[y.value] === l);
|
|
342
352
|
if (!(g < 0))
|
|
343
|
-
return
|
|
353
|
+
return _.value = [..._.value], _.value[g] = { ..._.value[g], ...c }, _.value[g];
|
|
344
354
|
},
|
|
345
355
|
deleteTableDataRecord: (l) => {
|
|
346
|
-
const
|
|
347
|
-
|
|
356
|
+
const c = Array.isArray(l) ? l : [l], g = new Set(c);
|
|
357
|
+
_.value = _.value.filter((C) => !g.has(C[y.value])), t.pagination !== !1 && (E.value.total = _.value.length);
|
|
348
358
|
},
|
|
349
|
-
insertTableDataRecord: (l,
|
|
350
|
-
const g = [...
|
|
351
|
-
return
|
|
359
|
+
insertTableDataRecord: (l, c) => {
|
|
360
|
+
const g = [..._.value];
|
|
361
|
+
return c == null || c >= g.length ? g.push(l) : g.splice(c, 0, l), _.value = g, t.pagination !== !1 && (E.value.total = _.value.length), l;
|
|
352
362
|
},
|
|
353
|
-
getPaginationRef: () =>
|
|
354
|
-
getShowPagination: () =>
|
|
363
|
+
getPaginationRef: () => k.value ? { page: E.value.page, pageSize: Number(E.value.pageSize) || 10, total: E.value.total } : !1,
|
|
364
|
+
getShowPagination: () => k.value,
|
|
355
365
|
setShowPagination: (l) => {
|
|
356
|
-
|
|
366
|
+
B.value = l;
|
|
357
367
|
},
|
|
358
368
|
getRowSelection: () => F.value.rowSelection,
|
|
359
369
|
expandAll: () => {
|
|
360
|
-
var
|
|
361
|
-
const l = ((
|
|
362
|
-
const
|
|
363
|
-
return
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
Array.isArray(
|
|
367
|
-
}),
|
|
370
|
+
var C;
|
|
371
|
+
const l = ((C = F.value.treeProps) == null ? void 0 : C.children) ?? "children", c = (H) => {
|
|
372
|
+
const N = [];
|
|
373
|
+
return H.forEach((oe) => {
|
|
374
|
+
N.push(oe);
|
|
375
|
+
const ie = oe[l];
|
|
376
|
+
Array.isArray(ie) && ie.length > 0 && N.push(...c(ie));
|
|
377
|
+
}), N;
|
|
368
378
|
};
|
|
369
|
-
|
|
370
|
-
var
|
|
371
|
-
return (
|
|
379
|
+
c(_.value).forEach((H) => {
|
|
380
|
+
var N, oe;
|
|
381
|
+
return (oe = (N = r.value) == null ? void 0 : N.toggleRowExpansion) == null ? void 0 : oe.call(N, H, !0);
|
|
372
382
|
});
|
|
373
383
|
},
|
|
374
384
|
collapseAll: () => {
|
|
375
|
-
var
|
|
376
|
-
const l = ((
|
|
377
|
-
const
|
|
378
|
-
return
|
|
379
|
-
|
|
380
|
-
const
|
|
381
|
-
Array.isArray(
|
|
382
|
-
}),
|
|
385
|
+
var C;
|
|
386
|
+
const l = ((C = F.value.treeProps) == null ? void 0 : C.children) ?? "children", c = (H) => {
|
|
387
|
+
const N = [];
|
|
388
|
+
return H.forEach((oe) => {
|
|
389
|
+
N.push(oe);
|
|
390
|
+
const ie = oe[l];
|
|
391
|
+
Array.isArray(ie) && ie.length > 0 && N.push(...c(ie));
|
|
392
|
+
}), N;
|
|
383
393
|
};
|
|
384
|
-
|
|
385
|
-
var
|
|
386
|
-
return (
|
|
394
|
+
c(_.value).forEach((H) => {
|
|
395
|
+
var N, oe;
|
|
396
|
+
return (oe = (N = r.value) == null ? void 0 : N.toggleRowExpansion) == null ? void 0 : oe.call(N, H, !1);
|
|
387
397
|
});
|
|
388
398
|
}
|
|
389
399
|
};
|
|
390
400
|
e(ce);
|
|
391
401
|
const ue = () => {
|
|
392
|
-
const l = (
|
|
393
|
-
const
|
|
402
|
+
const l = (c, g = "") => c.map((C, H) => {
|
|
403
|
+
const N = `${g}-${H}`;
|
|
394
404
|
return {
|
|
395
|
-
...
|
|
396
|
-
id:
|
|
397
|
-
children:
|
|
405
|
+
...C,
|
|
406
|
+
id: C.id || N,
|
|
407
|
+
children: C.children ? l(C.children, N) : void 0
|
|
398
408
|
};
|
|
399
409
|
});
|
|
400
|
-
|
|
401
|
-
},
|
|
402
|
-
t.api && F.value.immediate !== !1 ?
|
|
403
|
-
},
|
|
404
|
-
a.value && (
|
|
410
|
+
x.value = l(t.columns ?? []);
|
|
411
|
+
}, d = () => {
|
|
412
|
+
t.api && F.value.immediate !== !1 ? re(void 0) : t.dataSource && (_.value = [...t.dataSource], !t.api && t.pagination !== !1 && (E.value.total = t.dataSource.length));
|
|
413
|
+
}, P = () => {
|
|
414
|
+
a.value && (f.value = a.value.offsetWidth || 0);
|
|
405
415
|
};
|
|
406
|
-
let
|
|
407
|
-
return
|
|
408
|
-
ue(), n("register", ce),
|
|
409
|
-
|
|
416
|
+
let R = null, T = null;
|
|
417
|
+
return me(() => {
|
|
418
|
+
ue(), n("register", ce), d(), typeof window < "u" && (window.addEventListener("resize", P), R = new ResizeObserver(P), Le(() => {
|
|
419
|
+
P(), T = a.value, T && (R == null || R.observe(T));
|
|
410
420
|
}));
|
|
411
421
|
}), Be(() => {
|
|
412
|
-
typeof window < "u" && (window.removeEventListener("resize",
|
|
413
|
-
}),
|
|
414
|
-
!t.api && t.dataSource && (
|
|
415
|
-
}, { deep: !0 }),
|
|
422
|
+
typeof window < "u" && (window.removeEventListener("resize", P), R && T && (R.unobserve(T), T = null));
|
|
423
|
+
}), U(() => t.columns, ue, { deep: !0 }), U(() => t.dataSource, () => {
|
|
424
|
+
!t.api && t.dataSource && (_.value = [...t.dataSource], t.pagination !== !1 && (E.value.total = t.dataSource.length));
|
|
425
|
+
}, { deep: !0 }), U(() => t.loading, (l) => {
|
|
416
426
|
m.value = l ?? !1;
|
|
417
|
-
}), { __sfc: !0, props: t, emit: n, slots: o, tableRef: r, tableWrapRef: a, containerWidth:
|
|
427
|
+
}), { __sfc: !0, props: t, emit: n, slots: o, tableRef: r, tableWrapRef: a, containerWidth: f, loading: m, localFullData: _, innerData: z, rawDataSource: S, innerColumns: x, innerProps: p, selectedRows: v, showPaginationRef: B, mergeSettings: V, effectiveProps: F, defaultPagination: A, pagination: E, showTitleBar: I, showPagination: k, paginationSmall: u, paginationBackground: W, rowKeyField: y, selectedKeysSet: j, displayColumns: q, flatColumnsMap: X, allFlatColumns: G, fixedColumnsWidth: ee, isRatioWidth: Z, totalRatio: Y, fixedDataColumnsWidth: te, parseWidthPx: J, spanMethodAdapter: le, getColumnWidth: b, shouldShowColumn: O, selectableRows: $, hasSelectableRows: i, isAllCurrentPageSelected: h, isIndeterminate: M, isRowSelected: K, getCheckboxDisabled: L, getRadioDisabled: Q, emitSelectionChange: ae, handleCheckboxChange: _e, handleRadioSelect: ge, handleSelectAll: be, fetchData: re, handleReload: ye, handleSizeChange: we, handleCurrentChange: Ce, handleRowClick: xe, handleRowDblclick: Pe, handleSortChange: Se, handleExpandChange: ve, tableAction: ce, syncColumns: ue, loadData: d, updateContainerWidth: P, resizeObserver: R, observedEl: T, TableColumnGroup: st, BodyCellRenderer: qe };
|
|
418
428
|
}
|
|
419
429
|
});
|
|
420
430
|
var it = function() {
|
|
421
|
-
var o, r, a,
|
|
431
|
+
var o, r, a, f;
|
|
422
432
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
423
|
-
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(m,
|
|
424
|
-
return n("div", { key:
|
|
433
|
+
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(m, _) {
|
|
434
|
+
return n("div", { key: _ }, [e._v(e._s(m))]);
|
|
425
435
|
}), 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() {
|
|
426
436
|
var m;
|
|
427
437
|
return [((m = t.effectiveProps.tableSetting) == null ? void 0 : m.redo) !== !1 ? n("el-button", { attrs: { type: "text", icon: "el-icon-refresh", size: "small" }, on: { click: t.handleReload } }, [e._v(" 刷新 ")]) : e._e()];
|
|
428
438
|
})], 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.spanMethodAdapter, "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(m) {
|
|
429
439
|
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")];
|
|
430
440
|
} }, { key: "default", fn: function(m) {
|
|
431
|
-
var
|
|
432
|
-
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isRowSelected(m.row), disabled: t.getCheckboxDisabled(m.row) }, on: { change: (
|
|
433
|
-
|
|
434
|
-
} } }) : n("el-radio", { attrs: { value: (
|
|
441
|
+
var _;
|
|
442
|
+
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isRowSelected(m.row), disabled: t.getCheckboxDisabled(m.row) }, on: { change: (z) => t.handleCheckboxChange(m.row, z) }, nativeOn: { click: function(z) {
|
|
443
|
+
z.stopPropagation();
|
|
444
|
+
} } }) : n("el-radio", { attrs: { value: (_ = t.selectedRows[0]) == null ? void 0 : _[t.rowKeyField], label: m.row[t.rowKeyField], disabled: t.getRadioDisabled(m.row) }, on: { change: function(z) {
|
|
435
445
|
return t.handleRadioSelect(m.row);
|
|
436
|
-
} }, nativeOn: { click: function(
|
|
437
|
-
|
|
446
|
+
} }, nativeOn: { click: function(z) {
|
|
447
|
+
z.stopPropagation();
|
|
438
448
|
} } }, [n("span")])];
|
|
439
|
-
} }], 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: ((r = t.effectiveProps.indexColumnProps) == null ? void 0 : r.width) || 60, fixed: (a = t.effectiveProps.indexColumnProps) == null ? void 0 : a.fixed, align: ((
|
|
449
|
+
} }], 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: ((r = t.effectiveProps.indexColumnProps) == null ? void 0 : r.width) || 60, fixed: (a = t.effectiveProps.indexColumnProps) == null ? void 0 : a.fixed, align: ((f = t.effectiveProps.indexColumnProps) == null ? void 0 : f.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(m) {
|
|
440
450
|
return [t.shouldShowColumn(m) ? n(t.TableColumnGroup, { key: m.key || m.dataIndex || m.title, attrs: { column: m, "effective-props": t.effectiveProps, "get-column-width": t.getColumnWidth } }) : e._e()];
|
|
441
451
|
}), 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(m) {
|
|
442
452
|
return [e.$scopedSlots.action ? e._t("action", null, { record: m.row, column: t.effectiveProps.actionColumn, index: m.$index }) : e.$scopedSlots.bodyCell ? n(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: m.row, index: m.$index, value: void 0, "custom-render": t.effectiveProps.actionColumn.customRender, "value-enum": t.effectiveProps.actionColumn.valueEnum } }) : e._e()];
|
|
443
453
|
} }], null, !0) }) : e._e()], 2)], 1), t.showPagination ? n("div", { staticClass: "ecp-pro-table__pagination" }, [n("el-pagination", e._b({ attrs: { "current-page": t.pagination.page, "page-sizes": t.pagination.pageSizes, "page-size": t.pagination.pageSize, total: t.pagination.total, small: t.paginationSmall, background: t.paginationBackground, layout: (t.effectiveProps.pagination && typeof t.effectiveProps.pagination == "object" ? t.effectiveProps.pagination.layout : null) || "total, sizes, prev, pager, next, jumper" }, on: { "size-change": t.handleSizeChange, "current-change": t.handleCurrentChange } }, "el-pagination", t.effectiveProps.pagination && typeof t.effectiveProps.pagination == "object" && t.effectiveProps.pagination.props || {}, !1))], 1) : e._e()]);
|
|
444
|
-
}, ct = [], ut = /* @__PURE__ */
|
|
454
|
+
}, ct = [], ut = /* @__PURE__ */ se(
|
|
445
455
|
rt,
|
|
446
456
|
it,
|
|
447
457
|
ct,
|
|
448
458
|
!1,
|
|
449
459
|
null,
|
|
450
|
-
"
|
|
460
|
+
"ffeb78c4",
|
|
451
461
|
null,
|
|
452
462
|
null
|
|
453
463
|
);
|
|
@@ -477,42 +487,42 @@ const He = ut.exports, Ne = (s) => Array.isArray(s) ? s.length > 0 : s != null &
|
|
|
477
487
|
stopButtonPropagation: { type: Boolean, default: !1 }
|
|
478
488
|
},
|
|
479
489
|
setup(s) {
|
|
480
|
-
const e = s, n = (
|
|
481
|
-
const { ifShow: B } =
|
|
482
|
-
return typeof B == "boolean" ? B : typeof B == "function" ? B(
|
|
483
|
-
}), r =
|
|
490
|
+
const e = s, n = (p) => De(p) || {}, t = (p) => p.type ? p.type : p.color === "error" ? "danger" : p.color === "success" ? "success" : p.color === "warning" ? "warning" : "text", o = (p) => p.filter((v) => {
|
|
491
|
+
const { ifShow: B } = v;
|
|
492
|
+
return typeof B == "boolean" ? B : typeof B == "function" ? B(v) : !0;
|
|
493
|
+
}), r = w(() => o(e.actions || [])), a = w(() => o(e.dropDownActions || [])), f = (p, v) => {
|
|
484
494
|
var B;
|
|
485
|
-
e.stopButtonPropagation &&
|
|
486
|
-
}, m = (
|
|
487
|
-
p
|
|
488
|
-
},
|
|
489
|
-
var
|
|
490
|
-
e.stopButtonPropagation && B.stopPropagation(),
|
|
495
|
+
e.stopButtonPropagation && v.stopPropagation(), (B = p.onClick) == null || B.call(p, v);
|
|
496
|
+
}, m = (p, v) => {
|
|
497
|
+
f(p, v);
|
|
498
|
+
}, _ = (p, v, B) => {
|
|
499
|
+
var V, F, A, E;
|
|
500
|
+
e.stopButtonPropagation && B.stopPropagation(), p.popConfirm && (v === "confirm" ? (F = (V = p.popConfirm).confirm) == null || F.call(V) : (E = (A = p.popConfirm).cancel) == null || E.call(A));
|
|
491
501
|
};
|
|
492
|
-
return { __sfc: !0, props: e, normalizeTooltip: n, getButtonType: t, filterVisible: o, visibleActions: r, visibleDropDownActions: a, handleClick:
|
|
493
|
-
|
|
494
|
-
}, handlePopConfirmCancel: (
|
|
495
|
-
|
|
496
|
-
}, handleDropdownCommand: (
|
|
497
|
-
var
|
|
498
|
-
const
|
|
502
|
+
return { __sfc: !0, props: e, normalizeTooltip: n, getButtonType: t, filterVisible: o, visibleActions: r, visibleDropDownActions: a, handleClick: f, handleActionClick: m, handlePopConfirm: _, handlePopConfirmConfirm: (p, v) => {
|
|
503
|
+
_(p, "confirm", v);
|
|
504
|
+
}, handlePopConfirmCancel: (p, v) => {
|
|
505
|
+
_(p, "cancel", v);
|
|
506
|
+
}, handleDropdownCommand: (p) => {
|
|
507
|
+
var V;
|
|
508
|
+
const v = Number(p), B = a.value[v];
|
|
499
509
|
if (!(!B || B.disabled)) {
|
|
500
510
|
if (B.popConfirm) {
|
|
501
|
-
const
|
|
502
|
-
tt.confirm(
|
|
503
|
-
confirmButtonText:
|
|
504
|
-
cancelButtonText:
|
|
511
|
+
const F = B.popConfirm.title, A = B.popConfirm.okText || "确定", E = B.popConfirm.cancelText || "取消";
|
|
512
|
+
tt.confirm(F, "提示", {
|
|
513
|
+
confirmButtonText: A,
|
|
514
|
+
cancelButtonText: E,
|
|
505
515
|
type: "warning"
|
|
506
516
|
}).then(() => {
|
|
507
|
-
var I,
|
|
508
|
-
return (
|
|
517
|
+
var I, k;
|
|
518
|
+
return (k = (I = B.popConfirm) == null ? void 0 : I.confirm) == null ? void 0 : k.call(I);
|
|
509
519
|
}).catch(() => {
|
|
510
|
-
var I,
|
|
511
|
-
return (
|
|
520
|
+
var I, k;
|
|
521
|
+
return (k = (I = B.popConfirm) == null ? void 0 : I.cancel) == null ? void 0 : k.call(I);
|
|
512
522
|
});
|
|
513
523
|
return;
|
|
514
524
|
}
|
|
515
|
-
(
|
|
525
|
+
(V = B.onClick) == null || V.call(B, {});
|
|
516
526
|
}
|
|
517
527
|
} };
|
|
518
528
|
}
|
|
@@ -532,7 +542,7 @@ var ft = function() {
|
|
|
532
542
|
}), t.visibleDropDownActions.length ? n("el-dropdown", { attrs: { trigger: "click" }, on: { command: t.handleDropdownCommand } }, [n("span", { staticClass: "ecp-table-action__more" }, [n("el-button", { attrs: { type: "text", size: "small" } }, [e._v(" 更多"), n("i", { staticClass: "el-icon-arrow-down el-icon--right" })])], 1), n("el-dropdown-menu", { attrs: { slot: "dropdown" }, slot: "dropdown" }, e._l(t.visibleDropDownActions, function(o, r) {
|
|
533
543
|
return n("el-dropdown-item", { key: `dropdown-${r}`, attrs: { command: r, disabled: o.disabled, divided: !!o.divider } }, [n("span", { staticClass: "ecp-table-action__dropdown-item" }, [o.icon ? n("i", { class: ["ecp-table-action__icon", o.icon] }) : e._e(), n("span", [e._v(e._s(o.label))])])]);
|
|
534
544
|
}), 1)], 1) : e._e()], 2);
|
|
535
|
-
}, pt = [], mt = /* @__PURE__ */
|
|
545
|
+
}, pt = [], mt = /* @__PURE__ */ se(
|
|
536
546
|
dt,
|
|
537
547
|
ft,
|
|
538
548
|
pt,
|
|
@@ -544,17 +554,17 @@ var ft = function() {
|
|
|
544
554
|
);
|
|
545
555
|
const Ge = mt.exports;
|
|
546
556
|
function un(s) {
|
|
547
|
-
const e =
|
|
548
|
-
const a =
|
|
557
|
+
const e = D(null), n = () => s ? pe(s) : void 0, t = () => {
|
|
558
|
+
const a = pe(e);
|
|
549
559
|
if (!a)
|
|
550
560
|
throw new Error("ProTable instance has not been registered");
|
|
551
561
|
return a;
|
|
552
562
|
}, o = (a) => {
|
|
553
563
|
e.value = a;
|
|
554
|
-
const
|
|
555
|
-
|
|
564
|
+
const f = n();
|
|
565
|
+
f && Object.keys(f).length > 0 && a.setProps(f);
|
|
556
566
|
};
|
|
557
|
-
return s &&
|
|
567
|
+
return s && U(
|
|
558
568
|
() => n(),
|
|
559
569
|
(a) => {
|
|
560
570
|
a && e.value && e.value.setProps(a);
|
|
@@ -576,21 +586,21 @@ function un(s) {
|
|
|
576
586
|
clearSelectedRowKeys: () => t().clearSelectedRowKeys(),
|
|
577
587
|
setSelectedRowKeys: (a) => t().setSelectedRowKeys(a),
|
|
578
588
|
deleteSelectRowByKey: (a) => t().deleteSelectRowByKey(a),
|
|
579
|
-
updateTableData: (a,
|
|
580
|
-
updateTableDataRecord: (a,
|
|
589
|
+
updateTableData: (a, f, m) => t().updateTableData(a, f, m),
|
|
590
|
+
updateTableDataRecord: (a, f) => t().updateTableDataRecord(a, f),
|
|
581
591
|
deleteTableDataRecord: (a) => t().deleteTableDataRecord(a),
|
|
582
|
-
insertTableDataRecord: (a,
|
|
592
|
+
insertTableDataRecord: (a, f) => t().insertTableDataRecord(a, f),
|
|
583
593
|
getPaginationRef: () => t().getPaginationRef(),
|
|
584
594
|
getShowPagination: () => t().getShowPagination(),
|
|
585
595
|
setShowPagination: (a) => t().setShowPagination(a),
|
|
586
596
|
getRowSelection: () => t().getRowSelection(),
|
|
587
597
|
expandAll: () => {
|
|
588
|
-
var a,
|
|
589
|
-
return (
|
|
598
|
+
var a, f;
|
|
599
|
+
return (f = (a = t()).expandAll) == null ? void 0 : f.call(a);
|
|
590
600
|
},
|
|
591
601
|
collapseAll: () => {
|
|
592
|
-
var a,
|
|
593
|
-
return (
|
|
602
|
+
var a, f;
|
|
603
|
+
return (f = (a = t()).collapseAll) == null ? void 0 : f.call(a);
|
|
594
604
|
}
|
|
595
605
|
}];
|
|
596
606
|
}
|
|
@@ -611,20 +621,20 @@ const vt = /* @__PURE__ */ ne({
|
|
|
611
621
|
},
|
|
612
622
|
emits: ["input", "change"],
|
|
613
623
|
setup(s, { expose: e }) {
|
|
614
|
-
const n = s, t =
|
|
615
|
-
n.lazy &&
|
|
616
|
-
},
|
|
624
|
+
const n = s, t = D(!1), o = D([]), r = D([]), a = (S) => S == null ? "null" : JSON.stringify(f(S)), f = (S) => Array.isArray(S) ? S.map(f) : S !== null && typeof S == "object" ? Object.keys(S).sort().reduce((x, p) => (x[p] = f(S[p]), x), {}) : S, m = D(a(n.params ?? null)), _ = (S) => {
|
|
625
|
+
n.lazy && S && (a(n.params ?? null) !== m.value || o.value.length === 0) && z();
|
|
626
|
+
}, z = async () => {
|
|
617
627
|
if (n.api) {
|
|
618
628
|
t.value = !0;
|
|
619
629
|
try {
|
|
620
|
-
const
|
|
621
|
-
r.value =
|
|
622
|
-
const
|
|
623
|
-
o.value =
|
|
624
|
-
const
|
|
630
|
+
const S = await n.api(n.params), x = Array.isArray(S) ? S : (S == null ? void 0 : S.list) ?? (S == null ? void 0 : S.data) ?? [];
|
|
631
|
+
r.value = x;
|
|
632
|
+
const p = n.labelField ?? "label", v = n.valueField ?? "value";
|
|
633
|
+
o.value = x.map((B) => {
|
|
634
|
+
const V = B;
|
|
625
635
|
return {
|
|
626
|
-
label: String(
|
|
627
|
-
value:
|
|
636
|
+
label: String(V[p] ?? V.label ?? ""),
|
|
637
|
+
value: V[v] ?? V.value
|
|
628
638
|
};
|
|
629
639
|
}), m.value = a(n.params ?? null);
|
|
630
640
|
} finally {
|
|
@@ -636,18 +646,18 @@ const vt = /* @__PURE__ */ ne({
|
|
|
636
646
|
options: o,
|
|
637
647
|
rawOptions: r,
|
|
638
648
|
loading: t,
|
|
639
|
-
fetchOptions:
|
|
640
|
-
}),
|
|
641
|
-
n.lazy ||
|
|
642
|
-
}),
|
|
649
|
+
fetchOptions: z
|
|
650
|
+
}), me(() => {
|
|
651
|
+
n.lazy || z();
|
|
652
|
+
}), U(
|
|
643
653
|
() => n.api,
|
|
644
654
|
() => {
|
|
645
|
-
n.lazy ? (o.value = [], r.value = []) :
|
|
655
|
+
n.lazy ? (o.value = [], r.value = []) : z();
|
|
646
656
|
},
|
|
647
657
|
{ deep: !0 }
|
|
648
|
-
),
|
|
649
|
-
a(n.params ?? null) !== m.value && (n.lazy ? (o.value = [], r.value = []) :
|
|
650
|
-
}, { deep: !0 }), { __sfc: !0, props: n, loading: t, options: o, rawOptions: r, sortStringify: a, sortKeys:
|
|
658
|
+
), U(() => n.params, () => {
|
|
659
|
+
a(n.params ?? null) !== m.value && (n.lazy ? (o.value = [], r.value = []) : z());
|
|
660
|
+
}, { deep: !0 }), { __sfc: !0, props: n, loading: t, options: o, rawOptions: r, sortStringify: a, sortKeys: f, lastFetchedParamsKey: m, onVisibleChange: _, fetchOptions: z };
|
|
651
661
|
}
|
|
652
662
|
});
|
|
653
663
|
var ht = function() {
|
|
@@ -659,7 +669,7 @@ var ht = function() {
|
|
|
659
669
|
}, "visible-change": t.onVisibleChange } }, "el-select", { ...e.$attrs, value: e.value, placeholder: e.placeholder, disabled: e.disabled, loading: t.loading, clearable: e.clearable, filterable: e.filterable, multiple: e.multiple }, !1), e._l(t.options, function(o) {
|
|
660
670
|
return n("el-option", { key: String(o.value), attrs: { label: o.label, value: o.value } });
|
|
661
671
|
}), 1);
|
|
662
|
-
}, _t = [], gt = /* @__PURE__ */
|
|
672
|
+
}, _t = [], gt = /* @__PURE__ */ se(
|
|
663
673
|
vt,
|
|
664
674
|
ht,
|
|
665
675
|
_t,
|
|
@@ -697,18 +707,18 @@ function yt(s, e, n) {
|
|
|
697
707
|
let o = t ? s.slice(1) : s;
|
|
698
708
|
const r = o.indexOf(".");
|
|
699
709
|
if (r === -1) {
|
|
700
|
-
const
|
|
701
|
-
return o =
|
|
710
|
+
const z = Math.max(0, e);
|
|
711
|
+
return o = z > 0 ? o.slice(0, z) : o, t ? "-" + o : o;
|
|
702
712
|
}
|
|
703
713
|
let a = o.slice(0, r);
|
|
704
714
|
e > 0 && (a = a.slice(0, e));
|
|
705
|
-
const
|
|
715
|
+
const f = o.slice(r + 1), m = f === "" && o.endsWith(".");
|
|
706
716
|
if (n <= 0)
|
|
707
717
|
return t ? "-" + a : a;
|
|
708
718
|
if (m)
|
|
709
719
|
return (t ? "-" : "") + a + ".";
|
|
710
|
-
const
|
|
711
|
-
return (t ? "-" : "") + a + "." +
|
|
720
|
+
const _ = f.slice(0, n);
|
|
721
|
+
return (t ? "-" : "") + a + "." + _;
|
|
712
722
|
}
|
|
713
723
|
function wt(s, e) {
|
|
714
724
|
const n = Math.pow(10, s) - 1;
|
|
@@ -752,8 +762,8 @@ function xt(s, e) {
|
|
|
752
762
|
function Ke(s, e) {
|
|
753
763
|
if (Number.isNaN(s) || !Number.isFinite(s))
|
|
754
764
|
return "";
|
|
755
|
-
const n = s.toFixed(Math.max(0, e)), t = n.startsWith("-"), o = t ? n.slice(1) : n, [r, a] = o.split("."),
|
|
756
|
-
return e <= 0 || a === void 0 ? (t ? "-" : "") +
|
|
765
|
+
const n = s.toFixed(Math.max(0, e)), t = n.startsWith("-"), o = t ? n.slice(1) : n, [r, a] = o.split("."), f = r.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
766
|
+
return e <= 0 || a === void 0 ? (t ? "-" : "") + f : (t ? "-" : "") + f + "." + a;
|
|
757
767
|
}
|
|
758
768
|
function Pt(s, e) {
|
|
759
769
|
if (Number.isNaN(s) || !Number.isFinite(s))
|
|
@@ -774,83 +784,83 @@ const St = /* @__PURE__ */ ne({
|
|
|
774
784
|
},
|
|
775
785
|
emits: ["input"],
|
|
776
786
|
setup(s, { emit: e }) {
|
|
777
|
-
const n = s, t =
|
|
778
|
-
function p
|
|
779
|
-
if (
|
|
787
|
+
const n = s, t = D(!1), o = D(""), r = () => Math.max(0, Math.floor(n.integerDigits ?? 6)), a = () => Math.max(0, Math.floor(n.decimalPlaces ?? 6));
|
|
788
|
+
function f(p) {
|
|
789
|
+
if (p == null || p === "")
|
|
780
790
|
return null;
|
|
781
|
-
if (typeof
|
|
782
|
-
return Number.isFinite(
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
791
|
+
if (typeof p == "number")
|
|
792
|
+
return Number.isFinite(p) ? p : null;
|
|
793
|
+
const v = Ae(String(p));
|
|
794
|
+
if (v === "" || v === "-")
|
|
785
795
|
return null;
|
|
786
|
-
const B = Number(
|
|
796
|
+
const B = Number(v);
|
|
787
797
|
return Number.isFinite(B) ? B : null;
|
|
788
798
|
}
|
|
789
799
|
function m() {
|
|
790
800
|
if (t.value)
|
|
791
801
|
return;
|
|
792
|
-
const
|
|
793
|
-
if (
|
|
802
|
+
const p = f(n.value);
|
|
803
|
+
if (p === null) {
|
|
794
804
|
o.value = "";
|
|
795
805
|
return;
|
|
796
806
|
}
|
|
797
807
|
o.value = Ke(
|
|
798
|
-
ke(
|
|
808
|
+
ke(p, r(), a(), n.rounding),
|
|
799
809
|
a()
|
|
800
810
|
);
|
|
801
811
|
}
|
|
802
|
-
|
|
812
|
+
U(
|
|
803
813
|
() => [n.value, n.integerDigits, n.decimalPlaces, n.rounding],
|
|
804
814
|
() => m(),
|
|
805
815
|
{ immediate: !0, deep: !0 }
|
|
806
816
|
);
|
|
807
|
-
function
|
|
808
|
-
e("input", xt(
|
|
817
|
+
function _(p) {
|
|
818
|
+
e("input", xt(p, a()));
|
|
809
819
|
}
|
|
810
|
-
function
|
|
811
|
-
let
|
|
812
|
-
if (n.inputLimit !== !1 && (
|
|
820
|
+
function z(p) {
|
|
821
|
+
let v = Ve(p);
|
|
822
|
+
if (n.inputLimit !== !1 && (v = yt(v, r(), a())), o.value = v, v === "" || v === "-")
|
|
813
823
|
return;
|
|
814
|
-
const B = Number(
|
|
824
|
+
const B = Number(v);
|
|
815
825
|
if (!Number.isFinite(B))
|
|
816
826
|
return;
|
|
817
|
-
const
|
|
818
|
-
|
|
827
|
+
const V = ke(B, r(), a(), n.rounding);
|
|
828
|
+
_(V);
|
|
819
829
|
}
|
|
820
|
-
function
|
|
830
|
+
function S() {
|
|
821
831
|
t.value = !0;
|
|
822
|
-
const
|
|
823
|
-
if (
|
|
832
|
+
const p = Ae(o.value), v = f(p === "" ? n.value : p);
|
|
833
|
+
if (v === null) {
|
|
824
834
|
o.value = "";
|
|
825
835
|
return;
|
|
826
836
|
}
|
|
827
837
|
o.value = Pt(
|
|
828
|
-
ke(
|
|
838
|
+
ke(v, r(), a(), n.rounding),
|
|
829
839
|
a()
|
|
830
840
|
);
|
|
831
841
|
}
|
|
832
|
-
function
|
|
842
|
+
function x() {
|
|
833
843
|
t.value = !1;
|
|
834
|
-
const
|
|
835
|
-
if (
|
|
844
|
+
const p = Ae(o.value);
|
|
845
|
+
if (p === "" || p === "-") {
|
|
836
846
|
o.value = "", e("input", void 0);
|
|
837
847
|
return;
|
|
838
848
|
}
|
|
839
|
-
const
|
|
840
|
-
if (!Number.isFinite(
|
|
849
|
+
const v = Number(Ve(p));
|
|
850
|
+
if (!Number.isFinite(v)) {
|
|
841
851
|
o.value = "", e("input", void 0);
|
|
842
852
|
return;
|
|
843
853
|
}
|
|
844
|
-
const B = ke(
|
|
845
|
-
o.value = Ke(B, a()),
|
|
854
|
+
const B = ke(v, r(), a(), n.rounding);
|
|
855
|
+
o.value = Ke(B, a()), _(B);
|
|
846
856
|
}
|
|
847
|
-
return { __sfc: !0, props: n, emit: e, focused: t, displayText: o, intN: r, decM: a, parseExternalToNumber:
|
|
857
|
+
return { __sfc: !0, props: n, emit: e, focused: t, displayText: o, intN: r, decM: a, parseExternalToNumber: f, syncDisplayFromValue: m, emitStoredValue: _, onInput: z, onFocus: S, onBlur: x };
|
|
848
858
|
}
|
|
849
859
|
});
|
|
850
860
|
var Ft = function() {
|
|
851
861
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
852
862
|
return n("el-input", e._b({ attrs: { value: t.displayText, placeholder: e.placeholder, disabled: e.disabled }, on: { input: t.onInput, focus: t.onFocus, blur: t.onBlur } }, "el-input", e.$attrs, !1));
|
|
853
|
-
}, kt = [], Bt = /* @__PURE__ */
|
|
863
|
+
}, kt = [], Bt = /* @__PURE__ */ se(
|
|
854
864
|
St,
|
|
855
865
|
Ft,
|
|
856
866
|
kt,
|
|
@@ -878,86 +888,86 @@ const Me = Bt.exports, Rt = /* @__PURE__ */ ne({
|
|
|
878
888
|
},
|
|
879
889
|
emits: ["input"],
|
|
880
890
|
setup(s, { emit: e }) {
|
|
881
|
-
const n = s, t =
|
|
891
|
+
const n = s, t = D(), o = D(), r = D(!1), a = D(!1), f = D(""), m = D([]), _ = D({}), z = w(() => ({
|
|
882
892
|
label: n.labelField,
|
|
883
893
|
children: n.childrenField
|
|
884
894
|
}));
|
|
885
|
-
function
|
|
886
|
-
const j = n.labelField ?? "label",
|
|
887
|
-
return
|
|
895
|
+
function S(y) {
|
|
896
|
+
const j = n.labelField ?? "label", q = n.valueField ?? "value", X = n.childrenField ?? "children", G = y[X], ee = {};
|
|
897
|
+
return ee[n.labelField ?? "label"] = y[j] ?? y.label, ee[n.valueField ?? "value"] = y[q] ?? y.value, Array.isArray(G) && G.length && (ee[n.childrenField ?? "children"] = G.map((Z) => S(Z))), ee;
|
|
888
898
|
}
|
|
889
|
-
function
|
|
890
|
-
const
|
|
891
|
-
for (const
|
|
892
|
-
const
|
|
893
|
-
|
|
894
|
-
const
|
|
895
|
-
Array.isArray(
|
|
899
|
+
function x(y, j = "") {
|
|
900
|
+
const q = {}, X = n.labelField ?? "label", G = n.valueField ?? "value", ee = n.childrenField ?? "children";
|
|
901
|
+
for (const Z of y) {
|
|
902
|
+
const Y = String(Z[X] ?? Z.label ?? ""), te = Z[G] ?? Z.value;
|
|
903
|
+
te != null && (q[String(te)] = j ? j + " / " + Y : Y);
|
|
904
|
+
const J = Z[ee] ?? Z.children;
|
|
905
|
+
Array.isArray(J) && J.length && Object.assign(q, x(J, Y));
|
|
896
906
|
}
|
|
897
|
-
return
|
|
907
|
+
return q;
|
|
898
908
|
}
|
|
899
|
-
function
|
|
900
|
-
const
|
|
901
|
-
return Array.isArray(
|
|
909
|
+
function p() {
|
|
910
|
+
const y = n.treeData;
|
|
911
|
+
return Array.isArray(y) && y.length > 0;
|
|
902
912
|
}
|
|
903
|
-
function
|
|
904
|
-
m.value =
|
|
913
|
+
function v(y) {
|
|
914
|
+
m.value = y, _.value = x(y);
|
|
905
915
|
}
|
|
906
916
|
function B() {
|
|
907
|
-
const
|
|
908
|
-
if (!Array.isArray(
|
|
917
|
+
const y = n.treeData;
|
|
918
|
+
if (!Array.isArray(y) || y.length === 0)
|
|
909
919
|
return;
|
|
910
|
-
const j =
|
|
911
|
-
|
|
920
|
+
const j = y.map((q) => S(q));
|
|
921
|
+
v(j);
|
|
912
922
|
}
|
|
913
|
-
const
|
|
914
|
-
if (!
|
|
923
|
+
const V = w(() => n.value == null || n.value === "" ? "" : _.value[String(n.value)] ?? String(n.value)), F = (y, j) => {
|
|
924
|
+
if (!y)
|
|
915
925
|
return !0;
|
|
916
|
-
const
|
|
917
|
-
return String(j[
|
|
926
|
+
const q = n.labelField ?? "label";
|
|
927
|
+
return String(j[q] ?? j.label ?? "").toLowerCase().includes(y.toLowerCase());
|
|
918
928
|
};
|
|
919
|
-
|
|
929
|
+
U(f, (y) => {
|
|
920
930
|
var j;
|
|
921
|
-
(j = o.value) == null || j.filter(
|
|
931
|
+
(j = o.value) == null || j.filter(y);
|
|
922
932
|
});
|
|
923
|
-
let
|
|
924
|
-
function
|
|
925
|
-
n.disabled || (r.value = !0, n.lazy && !
|
|
926
|
-
|
|
927
|
-
t.value && !t.value.contains(
|
|
928
|
-
}, document.addEventListener("click",
|
|
933
|
+
let A = null;
|
|
934
|
+
function E() {
|
|
935
|
+
n.disabled || (r.value = !0, n.lazy && !p() && W(), Le(() => {
|
|
936
|
+
A = (y) => {
|
|
937
|
+
t.value && !t.value.contains(y.target) && I();
|
|
938
|
+
}, document.addEventListener("click", A);
|
|
929
939
|
}));
|
|
930
940
|
}
|
|
931
941
|
function I() {
|
|
932
|
-
r.value = !1,
|
|
942
|
+
r.value = !1, f.value = "", A && (document.removeEventListener("click", A), A = null);
|
|
933
943
|
}
|
|
934
|
-
function
|
|
944
|
+
function k() {
|
|
935
945
|
e("input", void 0);
|
|
936
946
|
}
|
|
937
|
-
function
|
|
938
|
-
const j = n.valueField ?? "value",
|
|
939
|
-
e("input",
|
|
947
|
+
function u(y) {
|
|
948
|
+
const j = n.valueField ?? "value", q = y[j] ?? y.value;
|
|
949
|
+
e("input", q), I();
|
|
940
950
|
}
|
|
941
|
-
async function
|
|
942
|
-
if (!(!n.api ||
|
|
951
|
+
async function W() {
|
|
952
|
+
if (!(!n.api || p())) {
|
|
943
953
|
a.value = !0;
|
|
944
954
|
try {
|
|
945
|
-
const
|
|
946
|
-
m.value = j.map((
|
|
955
|
+
const y = await n.api(n.params), j = Array.isArray(y) ? y : (y == null ? void 0 : y.list) ?? (y == null ? void 0 : y.data) ?? [];
|
|
956
|
+
m.value = j.map((q) => S(q)), _.value = x(m.value);
|
|
947
957
|
} finally {
|
|
948
958
|
a.value = !1;
|
|
949
959
|
}
|
|
950
960
|
}
|
|
951
961
|
}
|
|
952
|
-
return
|
|
953
|
-
|
|
954
|
-
}),
|
|
955
|
-
|
|
956
|
-
}, { deep: !0 }),
|
|
957
|
-
|
|
958
|
-
}, { deep: !0 }),
|
|
959
|
-
|
|
960
|
-
}, { deep: !0 }), { __sfc: !0, props: n, emit: e, rootRef: t, treeRef: o, dropdownVisible: r, loading: a, filterText:
|
|
962
|
+
return me(() => {
|
|
963
|
+
p() ? B() : n.lazy || W();
|
|
964
|
+
}), U(() => n.treeData, () => {
|
|
965
|
+
p() ? B() : (m.value = [], _.value = {}, !n.lazy && n.api && W());
|
|
966
|
+
}, { deep: !0 }), U(() => n.api, () => {
|
|
967
|
+
p() || (n.lazy ? (m.value = [], _.value = {}) : W());
|
|
968
|
+
}, { deep: !0 }), U(() => n.params, () => {
|
|
969
|
+
p() || (n.lazy ? (m.value = [], _.value = {}) : W());
|
|
970
|
+
}, { deep: !0 }), { __sfc: !0, props: n, emit: e, rootRef: t, treeRef: o, dropdownVisible: r, loading: a, filterText: f, treeData: m, flatLabelMap: _, treeProps: z, normalizeNode: S, buildFlatLabelMap: x, hasTreeDataProp: p, applyTreeData: v, syncFromTreeDataProp: B, displayText: V, filterNodeMethod: F, clickOutsideHandler: A, openDropdown: E, closeDropdown: I, clearValue: k, onNodeClick: u, fetchData: W };
|
|
961
971
|
}
|
|
962
972
|
});
|
|
963
973
|
var Mt = function() {
|
|
@@ -967,7 +977,7 @@ var Mt = function() {
|
|
|
967
977
|
} }, model: { value: t.filterText, callback: function(o) {
|
|
968
978
|
t.filterText = o;
|
|
969
979
|
}, expression: "filterText" } })], 1) : e._e(), n("el-tree", { directives: [{ name: "show", rawName: "v-show", value: !t.loading, expression: "!loading" }], ref: "treeRef", attrs: { data: t.treeData, props: t.treeProps, "node-key": e.valueField, "filter-node-method": e.filterable ? t.filterNodeMethod : void 0, "highlight-current": !0, "default-expand-all": "" }, on: { "node-click": t.onNodeClick } }), t.loading ? n("div", { staticClass: "ecp-tree-select__loading" }, [n("i", { staticClass: "el-icon-loading" }), e._v(" 加载中... ")]) : e._e()], 1)])], 1);
|
|
970
|
-
}, $t = [], At = /* @__PURE__ */
|
|
980
|
+
}, $t = [], At = /* @__PURE__ */ se(
|
|
971
981
|
Rt,
|
|
972
982
|
Mt,
|
|
973
983
|
$t,
|
|
@@ -1004,73 +1014,73 @@ const Tt = At.exports, Dt = /* @__PURE__ */ ne({
|
|
|
1004
1014
|
"cascader",
|
|
1005
1015
|
"checkbox",
|
|
1006
1016
|
"radio"
|
|
1007
|
-
]), t =
|
|
1008
|
-
|
|
1009
|
-
var
|
|
1010
|
-
e.schema.component === "api-select" && ((
|
|
1017
|
+
]), t = D(null);
|
|
1018
|
+
me(() => {
|
|
1019
|
+
var u;
|
|
1020
|
+
e.schema.component === "api-select" && ((u = e.registerFieldInstance) == null || u.call(e, e.schema.field, t.value));
|
|
1011
1021
|
}), Be(() => {
|
|
1012
|
-
var
|
|
1013
|
-
e.schema.component === "api-select" && ((
|
|
1022
|
+
var u;
|
|
1023
|
+
e.schema.component === "api-select" && ((u = e.registerFieldInstance) == null || u.call(e, e.schema.field, null));
|
|
1014
1024
|
});
|
|
1015
|
-
const o = he(), r =
|
|
1025
|
+
const o = he(), r = w(() => ({
|
|
1016
1026
|
schema: e.schema,
|
|
1017
1027
|
values: e.formModel,
|
|
1018
1028
|
model: e.formModel,
|
|
1019
1029
|
field: e.schema.field
|
|
1020
|
-
})), a =
|
|
1021
|
-
const
|
|
1022
|
-
return
|
|
1023
|
-
}),
|
|
1024
|
-
const
|
|
1025
|
-
return
|
|
1026
|
-
}), m =
|
|
1030
|
+
})), a = w(() => {
|
|
1031
|
+
const u = e.schema.ifShow;
|
|
1032
|
+
return u === void 0 ? !0 : typeof u == "boolean" ? u : u(r.value);
|
|
1033
|
+
}), f = w(() => {
|
|
1034
|
+
const u = e.schema.show;
|
|
1035
|
+
return u === void 0 ? !0 : typeof u == "boolean" ? u : u(r.value);
|
|
1036
|
+
}), m = w(() => {
|
|
1027
1037
|
if (e.formDisabled)
|
|
1028
1038
|
return !0;
|
|
1029
|
-
const
|
|
1030
|
-
return
|
|
1031
|
-
}),
|
|
1032
|
-
const
|
|
1033
|
-
return
|
|
1034
|
-
}),
|
|
1035
|
-
const
|
|
1036
|
-
if (!
|
|
1039
|
+
const u = e.schema.dynamicDisabled;
|
|
1040
|
+
return u === void 0 ? !1 : typeof u == "boolean" ? u : u(r.value);
|
|
1041
|
+
}), _ = w(() => {
|
|
1042
|
+
const u = e.schema.dynamicRules;
|
|
1043
|
+
return u ? Array.isArray(u) ? u : u(r.value) : e.schema.rules;
|
|
1044
|
+
}), z = w(() => {
|
|
1045
|
+
const u = e.schema.componentProps;
|
|
1046
|
+
if (!u)
|
|
1037
1047
|
return { props: {}, listeners: {} };
|
|
1038
|
-
const
|
|
1048
|
+
const W = typeof u == "function" ? u({
|
|
1039
1049
|
...r.value,
|
|
1040
1050
|
formActionType: e.formActionType
|
|
1041
|
-
}) : { ...
|
|
1042
|
-
for (const [
|
|
1043
|
-
if (
|
|
1044
|
-
const
|
|
1045
|
-
j[
|
|
1051
|
+
}) : { ...u }, y = {}, j = {};
|
|
1052
|
+
for (const [q, X] of Object.entries(W))
|
|
1053
|
+
if (q.length > 2 && /^on[A-Za-z]/.test(q) && typeof X == "function") {
|
|
1054
|
+
const G = q.slice(2).charAt(0).toLowerCase() + q.slice(3);
|
|
1055
|
+
j[G] = X;
|
|
1046
1056
|
} else
|
|
1047
|
-
|
|
1048
|
-
return { props:
|
|
1049
|
-
}),
|
|
1050
|
-
const
|
|
1051
|
-
if (!
|
|
1057
|
+
y[q] = X;
|
|
1058
|
+
return { props: y, listeners: j };
|
|
1059
|
+
}), S = w(() => z.value.props), x = w(() => z.value.listeners), p = w(() => e.schema.colon ?? e.colon ?? !1), v = w(() => {
|
|
1060
|
+
const u = e.schema.tooltip;
|
|
1061
|
+
if (!u)
|
|
1052
1062
|
return null;
|
|
1053
|
-
const
|
|
1054
|
-
return De(
|
|
1055
|
-
}), B =
|
|
1056
|
-
const
|
|
1057
|
-
return Array.isArray(
|
|
1058
|
-
},
|
|
1059
|
-
const
|
|
1060
|
-
return
|
|
1061
|
-
}), I = (
|
|
1062
|
-
var
|
|
1063
|
-
(
|
|
1064
|
-
},
|
|
1065
|
-
const
|
|
1066
|
-
return
|
|
1063
|
+
const W = typeof u == "function" ? u(r.value) : u;
|
|
1064
|
+
return De(W, e.formModel[e.schema.field]);
|
|
1065
|
+
}), B = w(() => v.value ? "el-tooltip" : "span"), V = w(() => v.value || {}), F = w(() => !!o.default), A = (u) => {
|
|
1066
|
+
const W = u == null ? void 0 : u.options;
|
|
1067
|
+
return Array.isArray(W) ? W : void 0;
|
|
1068
|
+
}, E = w(() => {
|
|
1069
|
+
const u = e.schema.component;
|
|
1070
|
+
return u == null ? null : typeof u == "string" ? n.has(u) ? null : e.customComponents && e.customComponents[u] || u : u;
|
|
1071
|
+
}), I = (u) => {
|
|
1072
|
+
var W;
|
|
1073
|
+
(W = e.onFieldChange) == null || W.call(e, e.schema.field, u);
|
|
1074
|
+
}, k = w(() => {
|
|
1075
|
+
const u = e.schema.render;
|
|
1076
|
+
return u ? {
|
|
1067
1077
|
render() {
|
|
1068
|
-
const
|
|
1069
|
-
return Array.isArray(
|
|
1078
|
+
const W = u(r.value);
|
|
1079
|
+
return Array.isArray(W) ? de("span", W) : W;
|
|
1070
1080
|
}
|
|
1071
1081
|
} : null;
|
|
1072
1082
|
});
|
|
1073
|
-
return { __sfc: !0, BUILT_IN_COMPONENTS: n, props: e, apiSelectRef: t, slots: o, renderParams: r, shouldRender: a, shouldShow:
|
|
1083
|
+
return { __sfc: !0, BUILT_IN_COMPONENTS: n, props: e, apiSelectRef: t, slots: o, renderParams: r, shouldRender: a, shouldShow: f, effectiveDisabled: m, effectiveRules: _, effectiveComponentPropsAndListeners: z, effectiveComponentProps: S, effectiveComponentListeners: x, showColon: p, normalizedTooltip: v, fieldWrapperComponent: B, fieldWrapperProps: V, hasSlot: F, getOptions: A, resolvedCustomComponent: E, setFieldValue: I, renderComponent: k, ApiSelect: bt, FormattedNumberInput: Me, TreeSelect: Tt };
|
|
1074
1084
|
}
|
|
1075
1085
|
});
|
|
1076
1086
|
var zt = function() {
|
|
@@ -1102,7 +1112,7 @@ var zt = function() {
|
|
|
1102
1112
|
}, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(o) {
|
|
1103
1113
|
return n("el-radio", { key: String(o.value), attrs: { label: o.value } }, [e._v(" " + e._s(o.label) + " ")]);
|
|
1104
1114
|
}), 1) : e._e()], 1)]], 2) : e._e();
|
|
1105
|
-
}, Et = [], Ot = /* @__PURE__ */
|
|
1115
|
+
}, Et = [], Ot = /* @__PURE__ */ se(
|
|
1106
1116
|
Dt,
|
|
1107
1117
|
zt,
|
|
1108
1118
|
Et,
|
|
@@ -1140,7 +1150,7 @@ var It = function() {
|
|
|
1140
1150
|
} } }, [e._v(" " + e._s(e.submitButtonText) + " ")]) : e._e(), e._t("resetBefore"), e.showResetButton ? n("el-button", { attrs: { icon: e.resetButtonIcon }, on: { click: function(t) {
|
|
1141
1151
|
return e.$emit("reset");
|
|
1142
1152
|
} } }, [e._v(" " + e._s(e.resetButtonText) + " ")]) : e._e(), e._t("actions")], 2);
|
|
1143
|
-
}, Vt = [], Wt = /* @__PURE__ */
|
|
1153
|
+
}, Vt = [], Wt = /* @__PURE__ */ se(
|
|
1144
1154
|
Nt,
|
|
1145
1155
|
It,
|
|
1146
1156
|
Vt,
|
|
@@ -1184,155 +1194,155 @@ const Ue = Wt.exports, Kt = /* @__PURE__ */ ne({
|
|
|
1184
1194
|
},
|
|
1185
1195
|
emits: ["submit", "reset", "register", "update:modelValue"],
|
|
1186
1196
|
setup(s, { expose: e, emit: n }) {
|
|
1187
|
-
const t = s, o = he(), r =
|
|
1188
|
-
const T =
|
|
1189
|
-
return T >=
|
|
1190
|
-
}, { getSetting:
|
|
1191
|
-
...
|
|
1192
|
-
...
|
|
1193
|
-
...
|
|
1194
|
-
})),
|
|
1195
|
-
let l = 24,
|
|
1196
|
-
for (const
|
|
1197
|
-
const
|
|
1198
|
-
if (
|
|
1199
|
-
if (
|
|
1197
|
+
const t = s, o = he(), r = D(), a = D(), f = D(!1), m = D(!0), _ = D({}), z = D({}), S = D([]), x = D({}), p = D(/* @__PURE__ */ new Map()), v = { xl: 1920, lg: 1200, md: 992, sm: 768 }, B = (d, P, R) => {
|
|
1198
|
+
const T = R ?? (typeof window < "u" ? window.innerWidth : 1920), l = d ?? {}, c = P ?? {}, g = c.span ?? 8;
|
|
1199
|
+
return T >= v.xl ? l.xl ?? c.xl ?? l.lg ?? c.lg ?? l.md ?? c.md ?? l.sm ?? c.sm ?? l.xs ?? c.xs ?? l.span ?? g : T >= v.lg ? l.lg ?? c.lg ?? l.md ?? c.md ?? l.sm ?? c.sm ?? l.xs ?? c.xs ?? l.span ?? g : T >= v.md ? l.md ?? c.md ?? l.sm ?? c.sm ?? l.xs ?? c.xs ?? l.span ?? g : T >= v.sm ? l.sm ?? c.sm ?? l.xs ?? c.xs ?? l.span ?? g : l.xs ?? c.xs ?? l.span ?? g;
|
|
1200
|
+
}, { getSetting: V } = Re(), F = w(() => ({ ...V("ProForm"), ...t, ...x.value })), A = w(() => F.value.modelValue), E = w(() => A.value !== void 0), I = w(() => E.value ? A.value ?? {} : _.value), k = w(() => ({
|
|
1201
|
+
...V("ProForm").components ?? {},
|
|
1202
|
+
...F.value.components ?? {},
|
|
1203
|
+
...x.value.components ?? {}
|
|
1204
|
+
})), u = w(() => F.value.actionColOptions ?? { span: 24 }), W = D(typeof window < "u" ? window.innerWidth : 1920), y = (d, P, R, T) => {
|
|
1205
|
+
let l = 24, c = 1, g = 0;
|
|
1206
|
+
for (const C of d) {
|
|
1207
|
+
const H = B(C.colProps, P, T);
|
|
1208
|
+
if (H > l) {
|
|
1209
|
+
if (c++, c > R)
|
|
1200
1210
|
break;
|
|
1201
|
-
l = 24 -
|
|
1211
|
+
l = 24 - H;
|
|
1202
1212
|
} else
|
|
1203
|
-
l -=
|
|
1213
|
+
l -= H;
|
|
1204
1214
|
g++;
|
|
1205
1215
|
}
|
|
1206
1216
|
return g;
|
|
1207
|
-
}, j =
|
|
1208
|
-
const
|
|
1209
|
-
if (!
|
|
1217
|
+
}, j = w(() => {
|
|
1218
|
+
const d = S.value.filter((l) => G(l));
|
|
1219
|
+
if (!F.value.showAdvancedButton)
|
|
1210
1220
|
return !1;
|
|
1211
|
-
const
|
|
1212
|
-
return
|
|
1213
|
-
}),
|
|
1214
|
-
const
|
|
1215
|
-
if (!
|
|
1216
|
-
return
|
|
1217
|
-
const
|
|
1218
|
-
return
|
|
1219
|
-
}),
|
|
1220
|
-
let
|
|
1221
|
-
return typeof
|
|
1222
|
-
},
|
|
1223
|
-
const
|
|
1224
|
-
return
|
|
1225
|
-
if (!(
|
|
1221
|
+
const P = F.value.alwaysShowLines ?? 1, R = F.value.baseColProps, T = y(d, R, P, W.value);
|
|
1222
|
+
return d.length > T;
|
|
1223
|
+
}), q = w(() => F.value.formListeners ?? {}), X = w(() => {
|
|
1224
|
+
const d = S.value.filter((l) => G(l));
|
|
1225
|
+
if (!F.value.showAdvancedButton || !m.value)
|
|
1226
|
+
return d;
|
|
1227
|
+
const P = F.value.alwaysShowLines ?? 1, R = F.value.baseColProps, T = y(d, R, P, W.value);
|
|
1228
|
+
return d.slice(0, T);
|
|
1229
|
+
}), G = (d) => {
|
|
1230
|
+
let P = !0, R = !0;
|
|
1231
|
+
return typeof d.ifShow == "function" && (P = d.ifShow({ schema: d, values: I.value, model: I.value, field: d.field })), typeof d.ifShow == "boolean" && (P = d.ifShow), typeof d.show == "function" && (R = d.show({ schema: d, values: I.value, model: I.value, field: d.field })), typeof d.show == "boolean" && (R = d.show), P && R;
|
|
1232
|
+
}, ee = (d) => d.colProps ?? F.value.baseColProps ?? {}, Z = (d) => d.slot || d.field, Y = (d, P = !0) => {
|
|
1233
|
+
const R = P ? { ...d ?? {} } : {}, T = F.value.initialValues ?? t.initialValues;
|
|
1234
|
+
return S.value.forEach((l) => {
|
|
1235
|
+
if (!(P && Object.prototype.hasOwnProperty.call(R, l.field))) {
|
|
1226
1236
|
if (l.defaultValue !== void 0) {
|
|
1227
|
-
|
|
1237
|
+
R[l.field] = l.defaultValue;
|
|
1228
1238
|
return;
|
|
1229
1239
|
}
|
|
1230
|
-
T && Object.prototype.hasOwnProperty.call(T, l.field) && (
|
|
1240
|
+
T && Object.prototype.hasOwnProperty.call(T, l.field) && (R[l.field] = T[l.field]);
|
|
1231
1241
|
}
|
|
1232
|
-
}),
|
|
1233
|
-
},
|
|
1234
|
-
|
|
1235
|
-
},
|
|
1236
|
-
const
|
|
1237
|
-
return
|
|
1238
|
-
},
|
|
1239
|
-
const
|
|
1240
|
-
|
|
1241
|
-
var
|
|
1242
|
-
(
|
|
1243
|
-
}),
|
|
1244
|
-
},
|
|
1245
|
-
const
|
|
1246
|
-
return
|
|
1247
|
-
const T =
|
|
1242
|
+
}), R;
|
|
1243
|
+
}, te = (d, P = !0) => {
|
|
1244
|
+
_.value = d, P && n("update:modelValue", d);
|
|
1245
|
+
}, J = (d) => {
|
|
1246
|
+
const P = Y({ ...I.value, ...d });
|
|
1247
|
+
return te(P), P;
|
|
1248
|
+
}, le = () => {
|
|
1249
|
+
const d = {};
|
|
1250
|
+
S.value.forEach((P) => {
|
|
1251
|
+
var R;
|
|
1252
|
+
(R = P.rules) != null && R.length && (d[P.field] = P.rules);
|
|
1253
|
+
}), te(Y(I.value), !1), z.value = d;
|
|
1254
|
+
}, b = (d) => {
|
|
1255
|
+
const P = { ...d };
|
|
1256
|
+
return S.value.forEach((R) => {
|
|
1257
|
+
const T = R.ifShow;
|
|
1248
1258
|
if (T === void 0)
|
|
1249
1259
|
return;
|
|
1250
|
-
(typeof T == "boolean" ? T : T({ schema:
|
|
1251
|
-
}),
|
|
1252
|
-
},
|
|
1253
|
-
const
|
|
1254
|
-
if (!(
|
|
1255
|
-
return
|
|
1256
|
-
const T = { ...
|
|
1257
|
-
return
|
|
1258
|
-
const
|
|
1259
|
-
Array.isArray(
|
|
1260
|
+
(typeof T == "boolean" ? T : T({ schema: R, values: d, model: d, field: R.field })) || delete P[R.field];
|
|
1261
|
+
}), P;
|
|
1262
|
+
}, O = (d) => {
|
|
1263
|
+
const P = b(d), R = x.value.fieldMapToTime;
|
|
1264
|
+
if (!(R != null && R.length))
|
|
1265
|
+
return P;
|
|
1266
|
+
const T = { ...P };
|
|
1267
|
+
return R.forEach(([l, [c, g]]) => {
|
|
1268
|
+
const C = T[l];
|
|
1269
|
+
Array.isArray(C) && C.length === 2 && (delete T[l], T[c] = C[0], T[g] = C[1]);
|
|
1260
1270
|
}), T;
|
|
1261
|
-
},
|
|
1262
|
-
var
|
|
1271
|
+
}, $ = async () => {
|
|
1272
|
+
var d;
|
|
1263
1273
|
try {
|
|
1264
|
-
await ((
|
|
1265
|
-
} catch (
|
|
1266
|
-
console.error("Form validation failed:",
|
|
1274
|
+
await ((d = r.value) == null ? void 0 : d.validate()), F.value.submitFunc ? await F.value.submitFunc() : (f.value = !0, n("submit", O({ ...I.value })));
|
|
1275
|
+
} catch (P) {
|
|
1276
|
+
console.error("Form validation failed:", P);
|
|
1267
1277
|
} finally {
|
|
1268
|
-
|
|
1278
|
+
f.value = !1;
|
|
1269
1279
|
}
|
|
1270
1280
|
}, i = async () => {
|
|
1271
|
-
var
|
|
1272
|
-
|
|
1273
|
-
},
|
|
1274
|
-
var
|
|
1275
|
-
(
|
|
1276
|
-
},
|
|
1277
|
-
|
|
1278
|
-
},
|
|
1279
|
-
var
|
|
1280
|
-
return ((
|
|
1281
|
-
},
|
|
1282
|
-
r.value.validateField(
|
|
1283
|
-
}))) : r.value.validate() : Promise.resolve(), _e = async (
|
|
1281
|
+
var d;
|
|
1282
|
+
F.value.resetFunc ? await F.value.resetFunc() : ((d = r.value) == null || d.resetFields(), le(), n("reset"), F.value.submitOnReset && await $());
|
|
1283
|
+
}, h = (d) => (J(d), Promise.resolve()), M = () => O({ ...I.value }), K = async () => {
|
|
1284
|
+
var d;
|
|
1285
|
+
(d = r.value) == null || d.resetFields(), te(Y(void 0, !1));
|
|
1286
|
+
}, L = (d, P) => {
|
|
1287
|
+
J({ [d]: P });
|
|
1288
|
+
}, Q = (d) => {
|
|
1289
|
+
var P;
|
|
1290
|
+
return ((P = r.value) == null ? void 0 : P.validate(d)) ?? Promise.resolve();
|
|
1291
|
+
}, ae = (d) => r.value ? d != null && d.length ? Promise.all(d.map((P) => new Promise((R, T) => {
|
|
1292
|
+
r.value.validateField(P, (l) => l ? R(void 0) : T(new Error("Validation failed")));
|
|
1293
|
+
}))) : r.value.validate() : Promise.resolve(), _e = async (d, P) => {
|
|
1284
1294
|
var T;
|
|
1285
|
-
const
|
|
1286
|
-
return
|
|
1287
|
-
}, ge = (
|
|
1288
|
-
var
|
|
1289
|
-
(
|
|
1290
|
-
},
|
|
1291
|
-
(Array.isArray(
|
|
1292
|
-
const T =
|
|
1293
|
-
T >= 0 && (
|
|
1295
|
+
const R = (T = a.value) == null ? void 0 : T.querySelector(`[data-field="${d}"]`);
|
|
1296
|
+
return R && R.scrollIntoView({ behavior: (P == null ? void 0 : P.behavior) ?? "smooth", block: (P == null ? void 0 : P.block) ?? "nearest" }), Promise.resolve();
|
|
1297
|
+
}, ge = (d) => {
|
|
1298
|
+
var P;
|
|
1299
|
+
(P = r.value) == null || P.clearValidate(d);
|
|
1300
|
+
}, be = async (d) => {
|
|
1301
|
+
(Array.isArray(d) ? d : [d]).forEach((R) => {
|
|
1302
|
+
const T = S.value.findIndex((l) => l.field === R.field);
|
|
1303
|
+
T >= 0 && (S.value[T] = { ...S.value[T], ...R });
|
|
1294
1304
|
});
|
|
1295
|
-
},
|
|
1296
|
-
if (
|
|
1297
|
-
|
|
1298
|
-
else if (
|
|
1299
|
-
const T =
|
|
1300
|
-
|
|
1305
|
+
}, re = async (d, P, R) => {
|
|
1306
|
+
if (R)
|
|
1307
|
+
S.value.unshift(d);
|
|
1308
|
+
else if (P) {
|
|
1309
|
+
const T = S.value.findIndex((l) => l.field === P);
|
|
1310
|
+
S.value.splice(T + 1, 0, d);
|
|
1301
1311
|
} else
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
}, ye = async (
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1307
|
-
}, we = async (
|
|
1308
|
-
|
|
1309
|
-
}, Ce = (
|
|
1310
|
-
|
|
1311
|
-
}, xe = (
|
|
1312
|
-
function Pe(
|
|
1313
|
-
const
|
|
1314
|
-
if (!
|
|
1312
|
+
S.value.push(d);
|
|
1313
|
+
le();
|
|
1314
|
+
}, ye = async (d) => {
|
|
1315
|
+
const P = Array.isArray(d) ? d : [d];
|
|
1316
|
+
S.value = S.value.filter((R) => !P.includes(R.field));
|
|
1317
|
+
}, we = async (d) => {
|
|
1318
|
+
x.value = { ...x.value, ...d }, d.schemas && (S.value = [...d.schemas], le());
|
|
1319
|
+
}, Ce = (d, P) => {
|
|
1320
|
+
P ? p.value.set(d, P) : p.value.delete(d);
|
|
1321
|
+
}, xe = (d) => p.value.get(d) ?? null;
|
|
1322
|
+
function Pe(d, P = !1) {
|
|
1323
|
+
const R = p.value.get(d);
|
|
1324
|
+
if (!R)
|
|
1315
1325
|
return [];
|
|
1316
|
-
const T =
|
|
1317
|
-
return
|
|
1326
|
+
const T = R;
|
|
1327
|
+
return P ? (T == null ? void 0 : T.rawOptions) ?? [] : (T == null ? void 0 : T.options) ?? [];
|
|
1318
1328
|
}
|
|
1319
|
-
const Se = (
|
|
1320
|
-
const
|
|
1321
|
-
if (!
|
|
1329
|
+
const Se = (d) => {
|
|
1330
|
+
const P = p.value.get(d);
|
|
1331
|
+
if (!P)
|
|
1322
1332
|
return !1;
|
|
1323
|
-
const
|
|
1324
|
-
return (
|
|
1325
|
-
},
|
|
1326
|
-
getFieldsValue:
|
|
1327
|
-
setFieldsValue:
|
|
1328
|
-
resetFields:
|
|
1329
|
-
validate:
|
|
1330
|
-
validateFields:
|
|
1331
|
-
submit:
|
|
1333
|
+
const R = P;
|
|
1334
|
+
return (R == null ? void 0 : R.loading) ?? !1;
|
|
1335
|
+
}, ve = {
|
|
1336
|
+
getFieldsValue: M,
|
|
1337
|
+
setFieldsValue: h,
|
|
1338
|
+
resetFields: K,
|
|
1339
|
+
validate: Q,
|
|
1340
|
+
validateFields: ae,
|
|
1341
|
+
submit: $,
|
|
1332
1342
|
scrollToField: _e,
|
|
1333
1343
|
clearValidate: ge,
|
|
1334
|
-
updateSchema:
|
|
1335
|
-
appendSchemaByField:
|
|
1344
|
+
updateSchema: be,
|
|
1345
|
+
appendSchemaByField: re,
|
|
1336
1346
|
removeSchemaByField: ye,
|
|
1337
1347
|
setProps: we,
|
|
1338
1348
|
getComponentInstance: xe,
|
|
@@ -1340,21 +1350,21 @@ const Ue = Wt.exports, Kt = /* @__PURE__ */ ne({
|
|
|
1340
1350
|
isFieldLoading: Se
|
|
1341
1351
|
};
|
|
1342
1352
|
e({
|
|
1343
|
-
...
|
|
1353
|
+
...ve,
|
|
1344
1354
|
registerFieldInstance: Ce
|
|
1345
1355
|
});
|
|
1346
1356
|
const ce = () => {
|
|
1347
|
-
|
|
1357
|
+
S.value = [...t.schemas ?? []], le();
|
|
1348
1358
|
}, ue = () => {
|
|
1349
|
-
typeof window < "u" && (
|
|
1359
|
+
typeof window < "u" && (W.value = window.innerWidth);
|
|
1350
1360
|
};
|
|
1351
|
-
return
|
|
1352
|
-
ce(), n("register",
|
|
1361
|
+
return me(() => {
|
|
1362
|
+
ce(), n("register", ve), typeof window < "u" && window.addEventListener("resize", ue);
|
|
1353
1363
|
}), Be(() => {
|
|
1354
1364
|
typeof window < "u" && window.removeEventListener("resize", ue);
|
|
1355
|
-
}),
|
|
1356
|
-
!
|
|
1357
|
-
}, { deep: !0, immediate: !0 }),
|
|
1365
|
+
}), U(() => A.value, (d) => {
|
|
1366
|
+
!E.value || d === void 0 || te(Y(d), !1);
|
|
1367
|
+
}, { deep: !0, immediate: !0 }), U(() => [t.schemas, t.initialValues], ce, { deep: !0 }), { __sfc: !0, props: t, emit: n, slots: o, formRef: r, formWrapRef: a, submitLoading: f, collapsed: m, formModel: _, formRules: z, innerSchemas: S, innerProps: x, fieldInstanceMap: p, BREAKPOINTS: v, getEffectiveSpan: B, getComponentSetting: V, effectiveProps: F, controlledModelValue: A, isControlled: E, currentFormModel: I, formCustomComponents: k, effectiveActionColOptions: u, windowWidth: W, getVisibleSchemaCount: y, hasMoreFields: j, formListeners: q, displaySchemas: X, shouldShow: G, getColProps: ee, getSlotName: Z, resolveSchemaModel: Y, applyFormModel: te, updateFormModel: J, initForm: le, filterByIfShow: b, processFieldMapToTime: O, handleSubmit: $, handleReset: i, setFieldsValue: h, getFieldsValue: M, resetFields: K, handleFieldChange: L, validate: Q, validateFields: ae, scrollToField: _e, clearValidate: ge, updateSchema: be, appendSchemaByField: re, removeSchemaByField: ye, setProps: we, registerFieldInstance: Ce, getComponentInstance: xe, getFieldOptions: Pe, isFieldLoading: Se, formActionRef: ve, syncSchemas: ce, handleResize: ue, ProFormItem: Je, FormActions: Ue };
|
|
1358
1368
|
}
|
|
1359
1369
|
});
|
|
1360
1370
|
var Lt = function() {
|
|
@@ -1367,7 +1377,7 @@ var Lt = function() {
|
|
|
1367
1377
|
} } }, [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) {
|
|
1368
1378
|
t.collapsed = !t.collapsed;
|
|
1369
1379
|
} } }, [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);
|
|
1370
|
-
}, jt = [], qt = /* @__PURE__ */
|
|
1380
|
+
}, jt = [], qt = /* @__PURE__ */ se(
|
|
1371
1381
|
Kt,
|
|
1372
1382
|
Lt,
|
|
1373
1383
|
jt,
|
|
@@ -1379,81 +1389,81 @@ var Lt = function() {
|
|
|
1379
1389
|
);
|
|
1380
1390
|
const Xe = qt.exports;
|
|
1381
1391
|
function dn(s) {
|
|
1382
|
-
const e =
|
|
1383
|
-
e.value =
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1392
|
+
const e = D(null), n = D(s ? pe(s) : void 0), t = () => s ? pe(s) : void 0, o = (k) => {
|
|
1393
|
+
e.value = k;
|
|
1394
|
+
const u = t();
|
|
1395
|
+
u && Object.keys(u).length > 0 && k.setProps(u);
|
|
1386
1396
|
};
|
|
1387
|
-
s &&
|
|
1397
|
+
s && U(
|
|
1388
1398
|
() => t(),
|
|
1389
|
-
(
|
|
1390
|
-
n.value =
|
|
1399
|
+
(k) => {
|
|
1400
|
+
n.value = k, k && e.value && e.value.setProps(k);
|
|
1391
1401
|
},
|
|
1392
1402
|
{ deep: !0 }
|
|
1393
1403
|
);
|
|
1394
1404
|
const r = () => {
|
|
1395
|
-
var
|
|
1396
|
-
return ((
|
|
1397
|
-
}, a = async (
|
|
1398
|
-
var
|
|
1399
|
-
await ((
|
|
1400
|
-
},
|
|
1401
|
-
var
|
|
1402
|
-
await ((
|
|
1403
|
-
}, m = (
|
|
1404
|
-
var
|
|
1405
|
-
return ((
|
|
1406
|
-
},
|
|
1407
|
-
var
|
|
1408
|
-
return ((
|
|
1409
|
-
},
|
|
1410
|
-
var
|
|
1411
|
-
return ((
|
|
1412
|
-
},
|
|
1413
|
-
var
|
|
1414
|
-
return ((
|
|
1415
|
-
},
|
|
1416
|
-
var
|
|
1417
|
-
(
|
|
1418
|
-
},
|
|
1419
|
-
var
|
|
1420
|
-
return ((
|
|
1421
|
-
},
|
|
1422
|
-
var
|
|
1423
|
-
return ((
|
|
1424
|
-
}, B = (
|
|
1425
|
-
var
|
|
1426
|
-
return ((
|
|
1427
|
-
},
|
|
1428
|
-
var
|
|
1429
|
-
n.value = { ...n.value, ...
|
|
1430
|
-
},
|
|
1431
|
-
var
|
|
1432
|
-
return ((
|
|
1405
|
+
var k;
|
|
1406
|
+
return ((k = e.value) == null ? void 0 : k.getFieldsValue()) ?? {};
|
|
1407
|
+
}, a = async (k) => {
|
|
1408
|
+
var u;
|
|
1409
|
+
await ((u = e.value) == null ? void 0 : u.setFieldsValue(k));
|
|
1410
|
+
}, f = async () => {
|
|
1411
|
+
var k;
|
|
1412
|
+
await ((k = e.value) == null ? void 0 : k.resetFields());
|
|
1413
|
+
}, m = (k) => {
|
|
1414
|
+
var u;
|
|
1415
|
+
return ((u = e.value) == null ? void 0 : u.validate(k)) ?? Promise.resolve();
|
|
1416
|
+
}, _ = (k) => {
|
|
1417
|
+
var u;
|
|
1418
|
+
return ((u = e.value) == null ? void 0 : u.validateFields(k)) ?? Promise.resolve();
|
|
1419
|
+
}, z = () => {
|
|
1420
|
+
var k;
|
|
1421
|
+
return ((k = e.value) == null ? void 0 : k.submit()) ?? Promise.resolve();
|
|
1422
|
+
}, S = (k, u) => {
|
|
1423
|
+
var W;
|
|
1424
|
+
return ((W = e.value) == null ? void 0 : W.scrollToField(k, u)) ?? Promise.resolve();
|
|
1425
|
+
}, x = (k) => {
|
|
1426
|
+
var u;
|
|
1427
|
+
(u = e.value) == null || u.clearValidate(k);
|
|
1428
|
+
}, p = (k) => {
|
|
1429
|
+
var u;
|
|
1430
|
+
return ((u = e.value) == null ? void 0 : u.updateSchema(k)) ?? Promise.resolve();
|
|
1431
|
+
}, v = (k, u, W) => {
|
|
1432
|
+
var y;
|
|
1433
|
+
return ((y = e.value) == null ? void 0 : y.appendSchemaByField(k, u, W)) ?? Promise.resolve();
|
|
1434
|
+
}, B = (k) => {
|
|
1435
|
+
var u;
|
|
1436
|
+
return ((u = e.value) == null ? void 0 : u.removeSchemaByField(k)) ?? Promise.resolve();
|
|
1437
|
+
}, V = async (k) => {
|
|
1438
|
+
var u;
|
|
1439
|
+
n.value = { ...n.value, ...k }, await ((u = e.value) == null ? void 0 : u.setProps(k));
|
|
1440
|
+
}, F = (k) => {
|
|
1441
|
+
var u;
|
|
1442
|
+
return ((u = e.value) == null ? void 0 : u.getComponentInstance(k)) ?? null;
|
|
1433
1443
|
};
|
|
1434
|
-
function
|
|
1435
|
-
return e.value ?
|
|
1444
|
+
function A(k, u = !1) {
|
|
1445
|
+
return e.value ? u ? e.value.getFieldOptions(k, !0) : e.value.getFieldOptions(k) : [];
|
|
1436
1446
|
}
|
|
1437
1447
|
return [o, {
|
|
1438
1448
|
register: o,
|
|
1439
1449
|
formAction: e,
|
|
1440
1450
|
getFieldsValue: r,
|
|
1441
1451
|
setFieldsValue: a,
|
|
1442
|
-
resetFields:
|
|
1452
|
+
resetFields: f,
|
|
1443
1453
|
validate: m,
|
|
1444
|
-
validateFields:
|
|
1445
|
-
submit:
|
|
1446
|
-
scrollToField:
|
|
1447
|
-
clearValidate:
|
|
1448
|
-
updateSchema:
|
|
1449
|
-
appendSchemaByField:
|
|
1454
|
+
validateFields: _,
|
|
1455
|
+
submit: z,
|
|
1456
|
+
scrollToField: S,
|
|
1457
|
+
clearValidate: x,
|
|
1458
|
+
updateSchema: p,
|
|
1459
|
+
appendSchemaByField: v,
|
|
1450
1460
|
removeSchemaByField: B,
|
|
1451
|
-
setProps:
|
|
1452
|
-
getComponentInstance:
|
|
1453
|
-
getFieldOptions:
|
|
1454
|
-
isFieldLoading: (
|
|
1455
|
-
var
|
|
1456
|
-
return ((
|
|
1461
|
+
setProps: V,
|
|
1462
|
+
getComponentInstance: F,
|
|
1463
|
+
getFieldOptions: A,
|
|
1464
|
+
isFieldLoading: (k) => {
|
|
1465
|
+
var u;
|
|
1466
|
+
return ((u = e.value) == null ? void 0 : u.isFieldLoading(k)) ?? !1;
|
|
1457
1467
|
}
|
|
1458
1468
|
}];
|
|
1459
1469
|
}
|
|
@@ -1473,7 +1483,7 @@ const Ht = /* @__PURE__ */ ne({
|
|
|
1473
1483
|
},
|
|
1474
1484
|
emits: ["register"],
|
|
1475
1485
|
setup(s, { expose: e, emit: n }) {
|
|
1476
|
-
const t = s, o =
|
|
1486
|
+
const t = s, o = D({}), r = D({}), a = D([]), f = D(typeof window < "u" ? window.innerWidth : 1920), m = D(!0), _ = ne({
|
|
1477
1487
|
name: "EcpDescriptionValueRenderer",
|
|
1478
1488
|
props: {
|
|
1479
1489
|
schema: { type: Object, required: !0 },
|
|
@@ -1481,97 +1491,97 @@ const Ht = /* @__PURE__ */ ne({
|
|
|
1481
1491
|
record: { type: Object, required: !0 },
|
|
1482
1492
|
emptyText: { type: String, default: "-" }
|
|
1483
1493
|
},
|
|
1484
|
-
setup(
|
|
1494
|
+
setup(b) {
|
|
1485
1495
|
return () => {
|
|
1486
|
-
const
|
|
1487
|
-
const
|
|
1488
|
-
return
|
|
1496
|
+
const O = b.schema, $ = b.record, i = b.value, h = (M) => {
|
|
1497
|
+
const K = z(O, M === b.emptyText ? i : M, $), L = de("span", M);
|
|
1498
|
+
return K ? de("el-tooltip", { props: K }, [L]) : L;
|
|
1489
1499
|
};
|
|
1490
|
-
if (
|
|
1491
|
-
const
|
|
1492
|
-
return
|
|
1500
|
+
if (O.render) {
|
|
1501
|
+
const M = O.render(i, $);
|
|
1502
|
+
return M == null || M === "" ? h(b.emptyText) : typeof M == "string" || typeof M == "number" ? h(String(M)) : M;
|
|
1493
1503
|
}
|
|
1494
|
-
return Array.isArray(i) ?
|
|
1504
|
+
return Array.isArray(i) ? h(i.length ? i.join(", ") : b.emptyText) : i == null || i === "" ? h(b.emptyText) : h(typeof i == "object" ? JSON.stringify(i) : String(i));
|
|
1495
1505
|
};
|
|
1496
1506
|
}
|
|
1497
|
-
}),
|
|
1498
|
-
const i =
|
|
1507
|
+
}), z = (b, O, $) => {
|
|
1508
|
+
const i = b.tooltip;
|
|
1499
1509
|
if (!i)
|
|
1500
1510
|
return null;
|
|
1501
|
-
const
|
|
1502
|
-
return De(
|
|
1503
|
-
}, { mergeSettings:
|
|
1504
|
-
if (typeof
|
|
1505
|
-
return Math.max(1,
|
|
1506
|
-
const
|
|
1507
|
-
return
|
|
1508
|
-
}, B =
|
|
1509
|
-
...
|
|
1510
|
-
dataIndex:
|
|
1511
|
-
}))),
|
|
1512
|
-
const
|
|
1513
|
-
let
|
|
1511
|
+
const h = typeof i == "function" ? i({ value: O, record: $, schema: b }) : i;
|
|
1512
|
+
return De(h, O);
|
|
1513
|
+
}, { mergeSettings: S } = Re(), x = w(() => S("ProDescriptions", { ...t, ...o.value })), p = { xxl: 1920, xl: 1200, lg: 992, md: 768, sm: 576 }, v = (b, O) => {
|
|
1514
|
+
if (typeof b == "number")
|
|
1515
|
+
return Math.max(1, b);
|
|
1516
|
+
const $ = b ?? {};
|
|
1517
|
+
return O >= p.xxl ? $.xxl ?? $.xl ?? $.lg ?? $.md ?? $.sm ?? $.xs ?? 3 : O >= p.xl ? $.xl ?? $.lg ?? $.md ?? $.sm ?? $.xs ?? 3 : O >= p.lg ? $.lg ?? $.md ?? $.sm ?? $.xs ?? 3 : O >= p.md ? $.md ?? $.sm ?? $.xs ?? 3 : O >= p.sm ? $.sm ?? $.xs ?? 2 : $.xs ?? 1;
|
|
1518
|
+
}, B = w(() => v(x.value.column, f.value)), V = w(() => x.value.data ?? r.value ?? {}), F = w(() => (a.value.length ? a.value : x.value.schema ?? []).filter((b) => b.dataIndex || b.field ? typeof b.show == "function" ? b.show(V.value) : b.show !== !1 : !1).map((b) => ({
|
|
1519
|
+
...b,
|
|
1520
|
+
dataIndex: b.dataIndex || b.field || ""
|
|
1521
|
+
}))), A = w(() => {
|
|
1522
|
+
const b = [];
|
|
1523
|
+
let O = { items: [] }, $ = 0;
|
|
1514
1524
|
const i = B.value;
|
|
1515
|
-
return
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1518
|
-
const
|
|
1519
|
-
|
|
1520
|
-
}),
|
|
1521
|
-
}),
|
|
1522
|
-
var
|
|
1525
|
+
return F.value.forEach((h, M) => {
|
|
1526
|
+
const K = F.value.length - M, L = Math.max(1, Math.min(h.span ?? 1, i)), Q = K === 1 ? i - $ || i : L;
|
|
1527
|
+
$ + Q > i && (b.push(O), O = { items: [] }, $ = 0);
|
|
1528
|
+
const ae = K === 1 && $ < i ? Math.max(1, i - $) : Q;
|
|
1529
|
+
O.items.push({ ...h, _span: ae }), $ += ae, $ >= i && (b.push(O), O = { items: [] }, $ = 0);
|
|
1530
|
+
}), O.items.length > 0 && b.push(O), b;
|
|
1531
|
+
}), E = w(() => {
|
|
1532
|
+
var O;
|
|
1523
1533
|
if (!I.value || m.value)
|
|
1524
|
-
return
|
|
1525
|
-
const
|
|
1526
|
-
return
|
|
1527
|
-
}), I =
|
|
1528
|
-
var
|
|
1529
|
-
const
|
|
1530
|
-
return !!
|
|
1531
|
-
}),
|
|
1532
|
-
var
|
|
1534
|
+
return A.value;
|
|
1535
|
+
const b = Math.max(1, ((O = x.value.collapseOptions) == null ? void 0 : O.visibleRows) ?? 1);
|
|
1536
|
+
return A.value.slice(0, b);
|
|
1537
|
+
}), I = w(() => {
|
|
1538
|
+
var O, $;
|
|
1539
|
+
const b = Math.max(1, ((O = x.value.collapseOptions) == null ? void 0 : O.visibleRows) ?? 1);
|
|
1540
|
+
return !!x.value.useCollapse && !!(($ = x.value.collapseOptions) != null && $.canExpand) && A.value.length > b;
|
|
1541
|
+
}), k = w(() => !!x.value.title || !!x.value.helpMessage || I.value), u = w(() => {
|
|
1542
|
+
var b, O;
|
|
1533
1543
|
return {
|
|
1534
|
-
expand: ((
|
|
1535
|
-
collapse: ((
|
|
1544
|
+
expand: ((b = x.value.collapseOptions) == null ? void 0 : b.expandButtonText) ?? "展开",
|
|
1545
|
+
collapse: ((O = x.value.collapseOptions) == null ? void 0 : O.collapseButtonText) ?? "收起"
|
|
1536
1546
|
};
|
|
1537
|
-
}),
|
|
1547
|
+
}), W = w(() => ({
|
|
1538
1548
|
gridTemplateColumns: `repeat(${B.value}, minmax(0, 1fr))`
|
|
1539
|
-
})),
|
|
1540
|
-
gridColumn: `span ${
|
|
1541
|
-
}), j = (
|
|
1542
|
-
minWidth:
|
|
1543
|
-
...
|
|
1544
|
-
}),
|
|
1545
|
-
minWidth:
|
|
1546
|
-
...
|
|
1547
|
-
}),
|
|
1548
|
-
a.value = [...
|
|
1549
|
-
},
|
|
1550
|
-
r.value = { ...
|
|
1551
|
-
},
|
|
1552
|
-
o.value = { ...o.value, ...
|
|
1553
|
-
},
|
|
1554
|
-
r.value = { ...r.value, ...
|
|
1555
|
-
},
|
|
1556
|
-
setProps:
|
|
1557
|
-
setData:
|
|
1558
|
-
getData:
|
|
1549
|
+
})), y = (b) => ({
|
|
1550
|
+
gridColumn: `span ${b._span}`
|
|
1551
|
+
}), j = (b) => ({
|
|
1552
|
+
minWidth: b.labelMinWidth ? `${b.labelMinWidth}px` : void 0,
|
|
1553
|
+
...b.labelStyle ?? {}
|
|
1554
|
+
}), q = (b) => ({
|
|
1555
|
+
minWidth: b.contentMinWidth ? `${b.contentMinWidth}px` : void 0,
|
|
1556
|
+
...b.contentStyle ?? {}
|
|
1557
|
+
}), X = (b) => V.value[b.dataIndex], G = () => {
|
|
1558
|
+
a.value = [...x.value.schema ?? []];
|
|
1559
|
+
}, ee = () => {
|
|
1560
|
+
r.value = { ...x.value.data ?? {} };
|
|
1561
|
+
}, Z = async (b) => {
|
|
1562
|
+
o.value = { ...o.value, ...b }, b.schema && (a.value = [...b.schema]), b.data && (r.value = { ...b.data });
|
|
1563
|
+
}, Y = async (b) => {
|
|
1564
|
+
r.value = { ...r.value, ...b }, o.value = { ...o.value, data: r.value };
|
|
1565
|
+
}, te = () => ({ ...x.value.data ?? r.value ?? {} }), J = {
|
|
1566
|
+
setProps: Z,
|
|
1567
|
+
setData: Y,
|
|
1568
|
+
getData: te
|
|
1559
1569
|
};
|
|
1560
|
-
e(
|
|
1561
|
-
const
|
|
1562
|
-
typeof window < "u" && (
|
|
1570
|
+
e(J);
|
|
1571
|
+
const le = () => {
|
|
1572
|
+
typeof window < "u" && (f.value = window.innerWidth);
|
|
1563
1573
|
};
|
|
1564
|
-
return
|
|
1565
|
-
var
|
|
1566
|
-
|
|
1574
|
+
return me(() => {
|
|
1575
|
+
var b;
|
|
1576
|
+
G(), ee(), m.value = ((b = x.value.collapseOptions) == null ? void 0 : b.defaultExpand) !== !1, n("register", J), typeof window < "u" && window.addEventListener("resize", le);
|
|
1567
1577
|
}), Be(() => {
|
|
1568
|
-
typeof window < "u" && window.removeEventListener("resize",
|
|
1569
|
-
}),
|
|
1570
|
-
var
|
|
1571
|
-
return (
|
|
1572
|
-
}, (
|
|
1573
|
-
|
|
1574
|
-
}), { __sfc: !0, props: t, emit: n, innerProps: o, innerData: r, innerSchema: a, windowWidth:
|
|
1578
|
+
typeof window < "u" && window.removeEventListener("resize", le);
|
|
1579
|
+
}), U(() => x.value.schema, G, { deep: !0 }), U(() => x.value.data, ee, { deep: !0 }), U(() => {
|
|
1580
|
+
var b;
|
|
1581
|
+
return (b = x.value.collapseOptions) == null ? void 0 : b.defaultExpand;
|
|
1582
|
+
}, (b) => {
|
|
1583
|
+
b !== void 0 && (m.value = b);
|
|
1584
|
+
}), { __sfc: !0, props: t, emit: n, innerProps: o, innerData: r, innerSchema: a, windowWidth: f, expanded: m, DescriptionValueRenderer: _, normalizeTooltip: z, mergeSettings: S, effectiveProps: x, breakpoints: p, resolveColumn: v, currentColumn: B, effectiveData: V, visibleSchema: F, normalizedRows: A, renderedRows: E, showCollapseButton: I, showHeader: k, collapseButtonText: u, bodyStyle: W, getItemStyle: y, getLabelStyle: j, getContentStyle: q, getItemValue: X, syncSchema: G, syncData: ee, setProps: Z, setData: Y, getData: te, descriptionAction: J, updateWindowWidth: le };
|
|
1575
1585
|
}
|
|
1576
1586
|
});
|
|
1577
1587
|
var Gt = function() {
|
|
@@ -1587,11 +1597,11 @@ var Gt = function() {
|
|
|
1587
1597
|
`is-${t.effectiveProps.size}`,
|
|
1588
1598
|
{ "is-bordered": t.effectiveProps.bordered, "is-collapsed": t.showCollapseButton && !t.expanded }
|
|
1589
1599
|
], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(r, a) {
|
|
1590
|
-
return [e._l(r.items, function(
|
|
1591
|
-
return [n("div", { key: `${a}-${
|
|
1600
|
+
return [e._l(r.items, function(f) {
|
|
1601
|
+
return [n("div", { key: `${a}-${f.dataIndex || f.field}`, staticClass: "ecp-pro-descriptions__item", style: t.getItemStyle(f) }, [n("div", { staticClass: "ecp-pro-descriptions__label", style: t.getLabelStyle(f) }, [e._v(" " + e._s(f.label) + " ")]), n("div", { staticClass: "ecp-pro-descriptions__content", style: t.getContentStyle(f) }, [e.$scopedSlots[f.slot || f.dataIndex] ? e._t(f.slot || f.dataIndex, null, { value: t.getItemValue(f), record: t.effectiveData, schema: f }) : n(t.DescriptionValueRenderer, { attrs: { schema: f, value: t.getItemValue(f), record: t.effectiveData, "empty-text": t.effectiveProps.emptyText || "-" } })], 2)])];
|
|
1592
1602
|
})];
|
|
1593
1603
|
})], 2)]);
|
|
1594
|
-
}, Jt = [], Ut = /* @__PURE__ */
|
|
1604
|
+
}, Jt = [], Ut = /* @__PURE__ */ se(
|
|
1595
1605
|
Ht,
|
|
1596
1606
|
Gt,
|
|
1597
1607
|
Jt,
|
|
@@ -1603,17 +1613,17 @@ var Gt = function() {
|
|
|
1603
1613
|
);
|
|
1604
1614
|
const Ze = Ut.exports;
|
|
1605
1615
|
function fn(s) {
|
|
1606
|
-
const e =
|
|
1607
|
-
const a =
|
|
1616
|
+
const e = D(null), n = () => s ? pe(s) : void 0, t = () => {
|
|
1617
|
+
const a = pe(e);
|
|
1608
1618
|
if (!a)
|
|
1609
1619
|
throw new Error("ProDescriptions instance has not been registered");
|
|
1610
1620
|
return a;
|
|
1611
1621
|
}, o = (a) => {
|
|
1612
1622
|
e.value = a;
|
|
1613
|
-
const
|
|
1614
|
-
|
|
1623
|
+
const f = n();
|
|
1624
|
+
f && Object.keys(f).length > 0 && a.setProps(f);
|
|
1615
1625
|
};
|
|
1616
|
-
return s &&
|
|
1626
|
+
return s && U(
|
|
1617
1627
|
() => n(),
|
|
1618
1628
|
(a) => {
|
|
1619
1629
|
a && e.value && e.value.setProps(a);
|
|
@@ -1647,32 +1657,32 @@ const Xt = /* @__PURE__ */ ne({
|
|
|
1647
1657
|
},
|
|
1648
1658
|
emits: ["update:expanded", "change", "collapse", "expand"],
|
|
1649
1659
|
setup(s, { expose: e, emit: n }) {
|
|
1650
|
-
const t = s, o = he(), { mergeSettings: r } = Re(), a =
|
|
1651
|
-
const
|
|
1652
|
-
return delete
|
|
1653
|
-
...
|
|
1654
|
-
class:
|
|
1660
|
+
const t = s, o = he(), { mergeSettings: r } = Re(), a = D(t.expanded ?? t.defaultExpand), f = w(() => r("CollapseContainer", { ...t })), m = w(() => f.value.canExpand ?? f.value.canExpan ?? !0), _ = w(() => f.value.expanded !== void 0), z = w(() => _.value ? !!f.value.expanded : a.value), S = w(() => !!o.title || !!o.action || !!f.value.title || !!f.value.helpMessage || m.value), x = w(() => m.value), p = w(() => {
|
|
1661
|
+
const A = f.value.wrapperProps ?? {}, E = A.class, I = A.style, k = { ...A };
|
|
1662
|
+
return delete k.class, delete k.style, {
|
|
1663
|
+
...k,
|
|
1664
|
+
class: E,
|
|
1655
1665
|
style: I
|
|
1656
1666
|
};
|
|
1657
|
-
}),
|
|
1658
|
-
!
|
|
1667
|
+
}), v = () => {
|
|
1668
|
+
!f.value.triggerWindowResize || typeof window > "u" || window.setTimeout(() => {
|
|
1659
1669
|
window.dispatchEvent(new Event("resize"));
|
|
1660
1670
|
}, 220);
|
|
1661
|
-
}, B = (
|
|
1662
|
-
|
|
1671
|
+
}, B = (A) => {
|
|
1672
|
+
_.value || (a.value = A), n("update:expanded", A), n("change", A), n(A ? "expand" : "collapse"), v();
|
|
1673
|
+
}, V = () => {
|
|
1674
|
+
m.value && B(!z.value);
|
|
1663
1675
|
}, F = () => {
|
|
1664
|
-
|
|
1665
|
-
}, N = () => {
|
|
1666
|
-
C.value && F();
|
|
1676
|
+
x.value && V();
|
|
1667
1677
|
};
|
|
1668
|
-
return
|
|
1669
|
-
|
|
1670
|
-
}),
|
|
1671
|
-
t.expanded === void 0 && (a.value =
|
|
1678
|
+
return U(() => t.expanded, (A) => {
|
|
1679
|
+
A !== void 0 && (a.value = A);
|
|
1680
|
+
}), U(() => t.defaultExpand, (A) => {
|
|
1681
|
+
t.expanded === void 0 && (a.value = A);
|
|
1672
1682
|
}), e({
|
|
1673
1683
|
setExpanded: B,
|
|
1674
|
-
toggleExpand:
|
|
1675
|
-
}), { __sfc: !0, props: t, emit: n, slots: o, mergeSettings: r, innerExpanded: a, effectiveProps:
|
|
1684
|
+
toggleExpand: V
|
|
1685
|
+
}), { __sfc: !0, props: t, emit: n, slots: o, mergeSettings: r, innerExpanded: a, effectiveProps: f, resolvedCanExpan: m, isControlled: _, mergedExpanded: z, showHeader: S, canToggleByHeader: x, wrapperProps: p, triggerWindowResize: v, setExpanded: B, toggleExpand: V, handleHeaderClick: F };
|
|
1676
1686
|
}
|
|
1677
1687
|
});
|
|
1678
1688
|
var Zt = function() {
|
|
@@ -1690,7 +1700,7 @@ var Zt = function() {
|
|
|
1690
1700
|
} } }, [e._t("action"), t.resolvedCanExpan ? n("el-button", { staticClass: "ecp-collapse-container__toggle", attrs: { type: "text" }, on: { click: function(o) {
|
|
1691
1701
|
return o.stopPropagation(), t.toggleExpand.apply(null, arguments);
|
|
1692
1702
|
} } }, [e._v(" " + e._s(t.mergedExpanded ? t.effectiveProps.collapseButtonText : t.effectiveProps.expandButtonText) + " "), n("i", { staticClass: "el-icon-arrow-down", class: { "is-expanded": t.mergedExpanded } })]) : e._e()], 2) : e._e()]) : e._e(), n("el-collapse-transition", [n("div", { directives: [{ name: "show", rawName: "v-show", value: t.mergedExpanded, expression: "mergedExpanded" }], staticClass: "ecp-collapse-container__body", class: t.effectiveProps.contentClass, style: t.effectiveProps.contentStyle }, [e._t("default")], 2)])], 1);
|
|
1693
|
-
}, Qt = [], Yt = /* @__PURE__ */
|
|
1703
|
+
}, Qt = [], Yt = /* @__PURE__ */ se(
|
|
1694
1704
|
Xt,
|
|
1695
1705
|
Zt,
|
|
1696
1706
|
Qt,
|
|
@@ -1730,7 +1740,7 @@ const Qe = Yt.exports, en = {
|
|
|
1730
1740
|
},
|
|
1731
1741
|
emits: ["update:modelValue"],
|
|
1732
1742
|
setup(s, { expose: e, emit: n }) {
|
|
1733
|
-
const t = s, o =
|
|
1743
|
+
const t = s, o = D(null), r = () => t.competitorsKey ?? "competitors", a = () => t.competitorNameKey ?? "name", f = w(() => t.fixedRows.length > 0 ? !0 : t.showFirstColumn !== !1), m = w(() => "left"), _ = w(() => {
|
|
1734
1744
|
const i = t.actionColumn;
|
|
1735
1745
|
return {
|
|
1736
1746
|
width: (i == null ? void 0 : i.width) ?? t.actionWidth,
|
|
@@ -1739,177 +1749,177 @@ const Qe = Yt.exports, en = {
|
|
|
1739
1749
|
fixed: (i == null ? void 0 : i.fixed) === void 0 ? "right" : i.fixed
|
|
1740
1750
|
};
|
|
1741
1751
|
});
|
|
1742
|
-
function
|
|
1752
|
+
function z(i) {
|
|
1743
1753
|
return i._type === "fixed" ? `f-${i.rowKey}` : `c-${i._index}`;
|
|
1744
1754
|
}
|
|
1745
|
-
const
|
|
1755
|
+
const S = w(() => {
|
|
1746
1756
|
const i = [];
|
|
1747
|
-
t.fixedRows.forEach((
|
|
1757
|
+
t.fixedRows.forEach((K) => {
|
|
1748
1758
|
i.push({
|
|
1749
1759
|
_type: "fixed",
|
|
1750
|
-
rowKey:
|
|
1751
|
-
rowLabel:
|
|
1760
|
+
rowKey: K.rowKey,
|
|
1761
|
+
rowLabel: K.label
|
|
1752
1762
|
});
|
|
1753
1763
|
});
|
|
1754
|
-
const
|
|
1755
|
-
return ((
|
|
1756
|
-
i.push({ _type: "competitor", _index:
|
|
1764
|
+
const h = t.modelValue;
|
|
1765
|
+
return ((h && typeof h == "object" ? h[r()] : void 0) ?? []).forEach((K, L) => {
|
|
1766
|
+
i.push({ _type: "competitor", _index: L });
|
|
1757
1767
|
}), i;
|
|
1758
|
-
}),
|
|
1768
|
+
}), x = w(() => {
|
|
1759
1769
|
const i = t.modelValue;
|
|
1760
1770
|
return ((i && typeof i == "object" ? i[r()] : void 0) ?? []).length > t.minCompetitors;
|
|
1761
1771
|
});
|
|
1762
|
-
function
|
|
1772
|
+
function p() {
|
|
1763
1773
|
const i = t.modelValue;
|
|
1764
1774
|
return !i || typeof i != "object" ? {} : JSON.parse(JSON.stringify(i));
|
|
1765
1775
|
}
|
|
1766
|
-
function
|
|
1767
|
-
const
|
|
1768
|
-
if (!
|
|
1769
|
-
const
|
|
1770
|
-
for (const
|
|
1771
|
-
|
|
1772
|
-
return
|
|
1776
|
+
function v(i) {
|
|
1777
|
+
const h = t.modelValue;
|
|
1778
|
+
if (!h || typeof h != "object") {
|
|
1779
|
+
const L = {};
|
|
1780
|
+
for (const Q of t.columns)
|
|
1781
|
+
L[Q.key] = "";
|
|
1782
|
+
return L;
|
|
1773
1783
|
}
|
|
1774
|
-
const
|
|
1775
|
-
if (
|
|
1776
|
-
return
|
|
1777
|
-
const
|
|
1778
|
-
for (const
|
|
1779
|
-
|
|
1780
|
-
return
|
|
1784
|
+
const M = h[i];
|
|
1785
|
+
if (M && typeof M == "object" && !Array.isArray(M))
|
|
1786
|
+
return M;
|
|
1787
|
+
const K = {};
|
|
1788
|
+
for (const L of t.columns)
|
|
1789
|
+
K[L.key] = "";
|
|
1790
|
+
return K;
|
|
1781
1791
|
}
|
|
1782
1792
|
function B(i) {
|
|
1783
1793
|
n("update:modelValue", i);
|
|
1784
1794
|
}
|
|
1785
|
-
function
|
|
1786
|
-
return
|
|
1795
|
+
function V(i, h) {
|
|
1796
|
+
return v(i)[h] ?? "";
|
|
1787
1797
|
}
|
|
1788
|
-
function
|
|
1789
|
-
const
|
|
1790
|
-
|
|
1798
|
+
function F(i, h, M) {
|
|
1799
|
+
const K = p(), L = { ...K[i] || {} };
|
|
1800
|
+
L[h] = M, K[i] = L, B(K);
|
|
1791
1801
|
}
|
|
1792
|
-
function
|
|
1802
|
+
function A() {
|
|
1793
1803
|
const i = t.modelValue;
|
|
1794
1804
|
if (!i || typeof i != "object")
|
|
1795
1805
|
return [];
|
|
1796
|
-
const
|
|
1797
|
-
return Array.isArray(
|
|
1806
|
+
const h = i[r()];
|
|
1807
|
+
return Array.isArray(h) ? h : [];
|
|
1798
1808
|
}
|
|
1799
|
-
function
|
|
1800
|
-
const
|
|
1801
|
-
return
|
|
1809
|
+
function E(i) {
|
|
1810
|
+
const h = A()[i], M = a();
|
|
1811
|
+
return h ? String(h[M] ?? "") : "";
|
|
1802
1812
|
}
|
|
1803
|
-
function I(i,
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1813
|
+
function I(i, h) {
|
|
1814
|
+
const M = p(), K = [...A()], L = { ...K[i] || {} };
|
|
1815
|
+
L[a()] = h, K[i] = L, M[r()] = K, B(M);
|
|
1806
1816
|
}
|
|
1807
|
-
function
|
|
1808
|
-
const
|
|
1809
|
-
return
|
|
1817
|
+
function k(i, h) {
|
|
1818
|
+
const M = A()[i];
|
|
1819
|
+
return M ? M[h] ?? "" : "";
|
|
1810
1820
|
}
|
|
1811
|
-
function
|
|
1812
|
-
const
|
|
1813
|
-
|
|
1821
|
+
function u(i, h, M) {
|
|
1822
|
+
const K = p(), L = [...A()], Q = { ...L[i] || {} };
|
|
1823
|
+
Q[h] = M, L[i] = Q, K[r()] = L, B(K);
|
|
1814
1824
|
}
|
|
1815
|
-
function
|
|
1816
|
-
return i._type === "fixed" ?
|
|
1825
|
+
function W(i, h) {
|
|
1826
|
+
return i._type === "fixed" ? V(i.rowKey, h.key) : k(i._index, h.key);
|
|
1817
1827
|
}
|
|
1818
|
-
function
|
|
1819
|
-
i._type === "fixed" ?
|
|
1828
|
+
function y(i, h, M) {
|
|
1829
|
+
i._type === "fixed" ? F(i.rowKey, h.key, M) : u(i._index, h.key, M);
|
|
1820
1830
|
}
|
|
1821
|
-
function j(i,
|
|
1822
|
-
return (
|
|
1831
|
+
function j(i, h) {
|
|
1832
|
+
return (M) => y(i.row, h, M);
|
|
1823
1833
|
}
|
|
1824
|
-
function
|
|
1834
|
+
function q() {
|
|
1825
1835
|
const i = { [a()]: "" };
|
|
1826
|
-
for (const
|
|
1827
|
-
i[
|
|
1836
|
+
for (const h of t.columns)
|
|
1837
|
+
i[h.key] = "";
|
|
1828
1838
|
return i;
|
|
1829
1839
|
}
|
|
1830
|
-
function
|
|
1831
|
-
const i =
|
|
1832
|
-
|
|
1840
|
+
function X() {
|
|
1841
|
+
const i = p(), h = [...A()];
|
|
1842
|
+
h.push(q()), i[r()] = h, B(i);
|
|
1833
1843
|
}
|
|
1834
|
-
function
|
|
1835
|
-
if (!
|
|
1844
|
+
function G(i) {
|
|
1845
|
+
if (!x.value)
|
|
1836
1846
|
return;
|
|
1837
|
-
const
|
|
1838
|
-
|
|
1847
|
+
const h = p(), M = [...A()];
|
|
1848
|
+
M.splice(i, 1), h[r()] = M, B(h);
|
|
1839
1849
|
}
|
|
1840
|
-
function
|
|
1841
|
-
return `${i}.${
|
|
1850
|
+
function ee(i, h) {
|
|
1851
|
+
return `${i}.${h}`;
|
|
1842
1852
|
}
|
|
1843
|
-
function
|
|
1853
|
+
function Z(i) {
|
|
1844
1854
|
return `${r()}.${i}.${a()}`;
|
|
1845
1855
|
}
|
|
1846
|
-
function
|
|
1847
|
-
return `${r()}.${i}.${
|
|
1856
|
+
function Y(i, h) {
|
|
1857
|
+
return `${r()}.${i}.${h}`;
|
|
1848
1858
|
}
|
|
1849
|
-
function
|
|
1859
|
+
function te(i) {
|
|
1850
1860
|
return i.component === "formatted-number" ? Me : "el-input";
|
|
1851
1861
|
}
|
|
1852
|
-
function
|
|
1853
|
-
const
|
|
1862
|
+
function J(i) {
|
|
1863
|
+
const h = i.componentProps || {};
|
|
1854
1864
|
return i.component === "formatted-number" ? {
|
|
1855
1865
|
integerDigits: 5,
|
|
1856
1866
|
decimalPlaces: 6,
|
|
1857
1867
|
rounding: "round",
|
|
1858
1868
|
inputLimit: !0,
|
|
1859
|
-
...
|
|
1860
|
-
} : { ...
|
|
1869
|
+
...h
|
|
1870
|
+
} : { ...h };
|
|
1861
1871
|
}
|
|
1862
|
-
function
|
|
1863
|
-
const
|
|
1864
|
-
if (
|
|
1872
|
+
function le(i) {
|
|
1873
|
+
const h = i.row;
|
|
1874
|
+
if (h._type === "fixed")
|
|
1865
1875
|
return {
|
|
1866
|
-
row:
|
|
1876
|
+
row: h,
|
|
1867
1877
|
rowType: "fixed",
|
|
1868
|
-
rowKey:
|
|
1869
|
-
rowLabel:
|
|
1878
|
+
rowKey: h.rowKey,
|
|
1879
|
+
rowLabel: h.rowLabel
|
|
1870
1880
|
};
|
|
1871
|
-
const
|
|
1881
|
+
const M = h._index;
|
|
1872
1882
|
return {
|
|
1873
|
-
row:
|
|
1883
|
+
row: h,
|
|
1874
1884
|
rowType: "competitor",
|
|
1875
|
-
rowIndex:
|
|
1876
|
-
value:
|
|
1877
|
-
updateValue: (
|
|
1885
|
+
rowIndex: M,
|
|
1886
|
+
value: E(M),
|
|
1887
|
+
updateValue: (K) => I(M, K)
|
|
1878
1888
|
};
|
|
1879
1889
|
}
|
|
1880
|
-
const
|
|
1881
|
-
const i = {},
|
|
1882
|
-
for (const
|
|
1883
|
-
for (const
|
|
1884
|
-
|
|
1885
|
-
return
|
|
1886
|
-
i[`${r()}.${
|
|
1887
|
-
for (const
|
|
1888
|
-
|
|
1890
|
+
const b = w(() => {
|
|
1891
|
+
const i = {}, h = (K) => [{ required: !0, message: `请输入${K}`, trigger: "blur" }];
|
|
1892
|
+
for (const K of t.fixedRows)
|
|
1893
|
+
for (const L of t.columns)
|
|
1894
|
+
L.rules ? i[`${K.rowKey}.${L.key}`] = L.rules : L.required && (i[`${K.rowKey}.${L.key}`] = h(L.title));
|
|
1895
|
+
return A().forEach((K, L) => {
|
|
1896
|
+
i[`${r()}.${L}.${a()}`] = h("友商名称");
|
|
1897
|
+
for (const Q of t.columns)
|
|
1898
|
+
Q.rules ? i[`${r()}.${L}.${Q.key}`] = Q.rules : Q.required && (i[`${r()}.${L}.${Q.key}`] = h(Q.title));
|
|
1889
1899
|
}), { ...i, ...t.rules || {} };
|
|
1890
1900
|
});
|
|
1891
|
-
function
|
|
1901
|
+
function O() {
|
|
1892
1902
|
return new Promise((i) => {
|
|
1893
|
-
const
|
|
1894
|
-
if (!
|
|
1903
|
+
const h = o.value;
|
|
1904
|
+
if (!h || typeof h.validate != "function") {
|
|
1895
1905
|
i(!0);
|
|
1896
1906
|
return;
|
|
1897
1907
|
}
|
|
1898
|
-
|
|
1899
|
-
i(
|
|
1908
|
+
h.validate((M) => {
|
|
1909
|
+
i(M);
|
|
1900
1910
|
});
|
|
1901
1911
|
});
|
|
1902
1912
|
}
|
|
1903
|
-
function
|
|
1904
|
-
var
|
|
1905
|
-
(
|
|
1913
|
+
function $(i) {
|
|
1914
|
+
var h, M;
|
|
1915
|
+
(M = (h = o.value) == null ? void 0 : h.clearValidate) == null || M.call(h, i);
|
|
1906
1916
|
}
|
|
1907
1917
|
return e({
|
|
1908
|
-
validate:
|
|
1909
|
-
clearValidate:
|
|
1910
|
-
addCompetitor:
|
|
1911
|
-
removeCompetitor:
|
|
1912
|
-
}), { __sfc: !0, props: t, emit: n, formRef: o, ck: r, nk: a, showFirstColumnComputed:
|
|
1918
|
+
validate: O,
|
|
1919
|
+
clearValidate: $,
|
|
1920
|
+
addCompetitor: X,
|
|
1921
|
+
removeCompetitor: G
|
|
1922
|
+
}), { __sfc: !0, props: t, emit: n, formRef: o, ck: r, nk: a, showFirstColumnComputed: f, firstColumnFixed: m, actionColumnBind: _, rowKeyFn: z, tableRows: S, canDeleteCompetitor: x, cloneModel: p, ensureFixedBlock: v, emitNext: B, getFixedMetric: V, setFixedMetric: F, competitorList: A, getCompetitorName: E, setCompetitorName: I, getCompetitorMetric: k, setCompetitorMetric: u, getCellValue: W, setCellValue: y, slotUpdateHandler: j, emptyCompetitorRow: q, addCompetitor: X, removeCompetitor: G, fixedMetricProp: ee, competitorNameProp: Z, competitorMetricProp: Y, cellComponent: te, cellBind: J, firstColumnScope: le, mergedRules: b, validate: O, clearValidate: $ };
|
|
1913
1923
|
}
|
|
1914
1924
|
});
|
|
1915
1925
|
var nn = function() {
|
|
@@ -1948,7 +1958,7 @@ var nn = function() {
|
|
|
1948
1958
|
} } }, [e._v(" 删除 ")]) : n("el-button", { staticClass: "ecp-pro-table-form__del-btn", attrs: { type: "text", disabled: "" } }, [e._v(" 删除 ")])];
|
|
1949
1959
|
}, { row: o.row, canDelete: t.canDeleteCompetitor, addCompetitor: t.addCompetitor, removeCompetitor: t.removeCompetitor })];
|
|
1950
1960
|
} }], null, !0) }, "el-table-column", t.actionColumnBind, !1)) : e._e()], 2)], 1)], 1);
|
|
1951
|
-
}, on = [], ln = /* @__PURE__ */
|
|
1961
|
+
}, on = [], ln = /* @__PURE__ */ se(
|
|
1952
1962
|
tn,
|
|
1953
1963
|
nn,
|
|
1954
1964
|
on,
|