@aspire-ui/element-component-pro 1.0.27 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ProTableForm/CellEditor.vue.d.ts +8 -4
- package/dist/ProTableForm/ProTableForm.vue.d.ts +2 -0
- package/dist/ProTableForm/types.d.ts +1 -1
- package/dist/ProTableForm/useProTableForm.d.ts +2 -0
- package/dist/element-component-pro.es.js +1089 -1064
- package/dist/element-component-pro.es.js.map +1 -1
- package/dist/element-component-pro.umd.js +2 -2
- package/dist/element-component-pro.umd.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/types/index.d.ts +10 -4
- package/package.json +1 -1
- package/src/ProForm/ProForm.vue +1 -0
- package/src/ProTableForm/CellEditor.vue +65 -47
- package/src/ProTableForm/ProTableForm.vue +8 -2
- package/src/ProTableForm/types.ts +2 -4
- package/src/ProTableForm/useProTableForm.ts +25 -0
- package/src/types/index.ts +10 -4
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { reactive as nt, defineComponent as
|
|
1
|
+
import { reactive as nt, defineComponent as oe, h as he, useSlots as Ce, ref as D, computed as x, onMounted as ye, nextTick as De, onUnmounted as ke, watch as te, unref as be } from "vue";
|
|
2
2
|
import { MessageBox as lt } from "element-ui";
|
|
3
|
-
const
|
|
4
|
-
function $e(
|
|
3
|
+
const ge = nt({});
|
|
4
|
+
function $e(s, e) {
|
|
5
5
|
if (!e)
|
|
6
|
-
return
|
|
6
|
+
return s;
|
|
7
7
|
for (const n in e)
|
|
8
8
|
if (Object.prototype.hasOwnProperty.call(e, n)) {
|
|
9
|
-
const t =
|
|
10
|
-
n === "components" ?
|
|
9
|
+
const t = s[n], l = e[n];
|
|
10
|
+
n === "components" ? s[n] = { ...t, ...l } : Ve(l) ? Ve(t) ? s[n] = $e(
|
|
11
11
|
t,
|
|
12
12
|
l
|
|
13
|
-
) :
|
|
13
|
+
) : s[n] = { ...l } : s[n] = l;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return s;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
if (!
|
|
17
|
+
function Ve(s) {
|
|
18
|
+
if (!s || typeof s != "object")
|
|
19
19
|
return !1;
|
|
20
|
-
const e = Object.getPrototypeOf(
|
|
20
|
+
const e = Object.getPrototypeOf(s);
|
|
21
21
|
return e === Object.prototype || e === null;
|
|
22
22
|
}
|
|
23
23
|
function Be() {
|
|
24
24
|
return {
|
|
25
|
-
getSetting: (t) => t === void 0 ? { ...
|
|
25
|
+
getSetting: (t) => t === void 0 ? { ...ge } : { ...ge[t] ?? {} },
|
|
26
26
|
setSetting: (t, l) => {
|
|
27
|
-
const a =
|
|
28
|
-
a ?
|
|
27
|
+
const a = ge[t];
|
|
28
|
+
a ? ge[t] = $e({ ...a }, l) : ge[t] = { ...l };
|
|
29
29
|
},
|
|
30
30
|
mergeSettings: (t, l) => {
|
|
31
|
-
const a =
|
|
31
|
+
const a = ge[t] ?? {};
|
|
32
32
|
return $e({ ...a }, l);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
const je =
|
|
36
|
+
const je = oe({
|
|
37
37
|
name: "EcpProTableDefaultCellRenderer",
|
|
38
38
|
props: {
|
|
39
39
|
column: { type: Object, required: !0 },
|
|
@@ -41,22 +41,22 @@ const je = te({
|
|
|
41
41
|
index: { type: Number, required: !0 },
|
|
42
42
|
value: { required: !1 }
|
|
43
43
|
},
|
|
44
|
-
setup(
|
|
44
|
+
setup(s) {
|
|
45
45
|
return () => {
|
|
46
46
|
var n, t;
|
|
47
|
-
const e =
|
|
47
|
+
const e = s.column;
|
|
48
48
|
if (e != null && e.customRender) {
|
|
49
|
-
const l = e.customRender({ text:
|
|
50
|
-
return typeof l == "string" || typeof l == "number" ?
|
|
49
|
+
const l = e.customRender({ text: s.value, record: s.record, index: s.index });
|
|
50
|
+
return typeof l == "string" || typeof l == "number" ? he("span", String(l)) : l;
|
|
51
51
|
}
|
|
52
52
|
if (e != null && e.valueEnum) {
|
|
53
|
-
const l = ((t = (n = e.valueEnum) == null ? void 0 : n[
|
|
54
|
-
return
|
|
53
|
+
const l = ((t = (n = e.valueEnum) == null ? void 0 : n[s.value]) == null ? void 0 : t.text) ?? s.value;
|
|
54
|
+
return he("span", l == null ? "" : String(l));
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return he("span", s.value == null ? "" : String(s.value));
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
}), qe =
|
|
59
|
+
}), qe = oe({
|
|
60
60
|
name: "EcpProTableBodyCellRenderer",
|
|
61
61
|
props: {
|
|
62
62
|
slotRender: { type: Function, required: !0 },
|
|
@@ -67,54 +67,54 @@ const je = te({
|
|
|
67
67
|
customRender: { type: Function, required: !1 },
|
|
68
68
|
valueEnum: { type: Object, required: !1 }
|
|
69
69
|
},
|
|
70
|
-
setup(
|
|
70
|
+
setup(s) {
|
|
71
71
|
return () => {
|
|
72
|
-
const e =
|
|
73
|
-
if (((
|
|
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 (((r) => r == null ? [] : Array.isArray(r) ? r.filter((d) => d != null && d !== !1 && !d.isComment) : [r])(n).length > 0)
|
|
74
74
|
return n;
|
|
75
|
-
const a = { ...
|
|
76
|
-
return
|
|
75
|
+
const a = { ...s.column };
|
|
76
|
+
return s.customRender && (a.customRender = s.customRender), s.valueEnum && (a.valueEnum = s.valueEnum), he(je, { props: { column: a, record: s.record, index: s.index, value: s.value } });
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
}), ot = /* @__PURE__ */
|
|
79
|
+
}), ot = /* @__PURE__ */ oe({
|
|
80
80
|
__name: "TableColumnGroup",
|
|
81
81
|
props: {
|
|
82
82
|
column: null,
|
|
83
83
|
effectiveProps: null,
|
|
84
84
|
getColumnWidth: null
|
|
85
85
|
},
|
|
86
|
-
setup(
|
|
87
|
-
const e =
|
|
86
|
+
setup(s) {
|
|
87
|
+
const e = s, n = Ce();
|
|
88
88
|
return { __sfc: !0, props: e, $scopedSlots: n, shouldShowColumn: (l) => l.ifShow === !1 ? !1 : typeof l.ifShow == "function" ? l.ifShow({ column: l }) : !0, DefaultCellRenderer: je, BodyCellRenderer: qe };
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
function
|
|
92
|
-
var
|
|
93
|
-
e && (
|
|
91
|
+
function ie(s, e, n, t, l, a, r, d) {
|
|
92
|
+
var h = typeof s == "function" ? s.options : s;
|
|
93
|
+
e && (h.render = e, h.staticRenderFns = n, h._compiled = !0), t && (h.functional = !0), a && (h._scopeId = "data-v-" + a);
|
|
94
94
|
var v;
|
|
95
|
-
if (
|
|
96
|
-
|
|
95
|
+
if (r ? (v = function(y) {
|
|
96
|
+
y = y || // cached call
|
|
97
97
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
98
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !
|
|
99
|
-
},
|
|
98
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !y && typeof __VUE_SSR_CONTEXT__ < "u" && (y = __VUE_SSR_CONTEXT__), l && l.call(this, y), y && y._registeredComponents && y._registeredComponents.add(r);
|
|
99
|
+
}, h._ssrRegister = v) : l && (v = d ? function() {
|
|
100
100
|
l.call(
|
|
101
101
|
this,
|
|
102
|
-
(
|
|
102
|
+
(h.functional ? this.parent : this).$root.$options.shadowRoot
|
|
103
103
|
);
|
|
104
104
|
} : l), v)
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
return v.call(_),
|
|
105
|
+
if (h.functional) {
|
|
106
|
+
h._injectStyles = v;
|
|
107
|
+
var k = h.render;
|
|
108
|
+
h.render = function(p, _) {
|
|
109
|
+
return v.call(_), k(p, _);
|
|
110
110
|
};
|
|
111
111
|
} else {
|
|
112
|
-
var
|
|
113
|
-
|
|
112
|
+
var w = h.beforeCreate;
|
|
113
|
+
h.beforeCreate = w ? [].concat(w, v) : [v];
|
|
114
114
|
}
|
|
115
115
|
return {
|
|
116
|
-
exports:
|
|
117
|
-
options:
|
|
116
|
+
exports: s,
|
|
117
|
+
options: h
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
var at = function() {
|
|
@@ -130,17 +130,17 @@ var at = 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
|
-
},
|
|
133
|
+
}, rt = [], st = /* @__PURE__ */ ie(
|
|
134
134
|
ot,
|
|
135
135
|
at,
|
|
136
|
-
|
|
136
|
+
rt,
|
|
137
137
|
!1,
|
|
138
138
|
null,
|
|
139
139
|
null,
|
|
140
140
|
null,
|
|
141
141
|
null
|
|
142
142
|
);
|
|
143
|
-
const it =
|
|
143
|
+
const it = st.exports, ut = /* @__PURE__ */ oe({
|
|
144
144
|
__name: "ProTable",
|
|
145
145
|
props: {
|
|
146
146
|
columns: null,
|
|
@@ -184,272 +184,272 @@ const it = rt.exports, ut = /* @__PURE__ */ te({
|
|
|
184
184
|
load: null
|
|
185
185
|
},
|
|
186
186
|
emits: ["register", "fetch-success", "fetch-error", "selection-change", "row-click", "row-dblclick", "sort-change", "expand-change"],
|
|
187
|
-
setup(
|
|
188
|
-
const t =
|
|
187
|
+
setup(s, { expose: e, emit: n }) {
|
|
188
|
+
const t = s, l = Ce(), a = D(), r = D(), d = D(0), h = D(t.loading ?? !1), v = D([]), k = x(() => {
|
|
189
189
|
const o = v.value;
|
|
190
|
-
if (!
|
|
190
|
+
if (!R.value || !o.length)
|
|
191
191
|
return o;
|
|
192
|
-
const { page:
|
|
193
|
-
return o.slice(
|
|
194
|
-
}),
|
|
195
|
-
const o =
|
|
192
|
+
const { page: i, pageSize: P } = z.value, F = (i - 1) * P;
|
|
193
|
+
return o.slice(F, F + P);
|
|
194
|
+
}), w = D({}), y = D([]), p = D({}), _ = D([]), A = D(null), { mergeSettings: I } = Be(), S = x(() => I("ProTable", { ...t, ...p.value })), M = x(() => {
|
|
195
|
+
const o = S.value.pagination;
|
|
196
196
|
return o && typeof o == "object" ? {
|
|
197
197
|
pageSize: o.pageSize ?? 10,
|
|
198
198
|
pageSizes: o.pageSizes ?? [10, 20, 50, 100]
|
|
199
199
|
} : { pageSize: 10, pageSizes: [10, 20, 50, 100] };
|
|
200
|
-
}),
|
|
200
|
+
}), z = D({
|
|
201
201
|
page: 1,
|
|
202
|
-
pageSize:
|
|
203
|
-
pageSizes:
|
|
202
|
+
pageSize: M.value.pageSize,
|
|
203
|
+
pageSizes: M.value.pageSizes,
|
|
204
204
|
total: 0
|
|
205
|
-
}),
|
|
206
|
-
const o = /* @__PURE__ */ new Map(),
|
|
207
|
-
for (const
|
|
208
|
-
|
|
205
|
+
}), V = x(() => !!S.value.title || !!l.tableTitle || !!l.toolbar), R = x(() => A.value !== null ? A.value : !!t.pagination && typeof t.pagination == "object"), f = x(() => S.value.pagination && typeof S.value.pagination == "object" ? !!S.value.pagination.small : !1), O = x(() => S.value.pagination && typeof S.value.pagination == "object" ? !!S.value.pagination.background : !1), C = x(() => S.value.rowKey || "id"), q = x(() => new Set(_.value.map((o) => o[C.value]))), L = x(() => y.value.filter((o) => !o.hideInTable && !o.defaultHidden)), Y = x(() => {
|
|
206
|
+
const o = /* @__PURE__ */ new Map(), i = (P) => {
|
|
207
|
+
for (const F of P)
|
|
208
|
+
F.children && F.children.length > 0 ? i(F.children) : F.dataIndex && o.set(F.dataIndex, F);
|
|
209
209
|
};
|
|
210
|
-
return
|
|
211
|
-
}),
|
|
212
|
-
var
|
|
210
|
+
return i(L.value), o;
|
|
211
|
+
}), G = x(() => Array.from(Y.value.values())), ne = x(() => {
|
|
212
|
+
var i, P;
|
|
213
213
|
let o = 0;
|
|
214
|
-
return
|
|
215
|
-
}),
|
|
216
|
-
if (!
|
|
214
|
+
return S.value.rowSelection && (o += Number(S.value.rowSelection.width) || 48), S.value.showIndexColumn && (o += Number((i = S.value.indexColumnProps) == null ? void 0 : i.width) || 60), S.value.actionColumn && (o += Number((P = S.value.actionColumn) == null ? void 0 : P.width) || 150), o;
|
|
215
|
+
}), J = (o) => typeof o == "number" && o > 0, Z = x(() => G.value.filter((i) => u(i) && J(i.width)).reduce((i, P) => i + (typeof P.width == "number" ? P.width : 0), 0)), X = x(() => G.value.filter((i) => u(i) && typeof i.width == "string").reduce((i, P) => i + (Number(g(P)) || 80), 0)), E = (o) => o == null ? null : typeof o == "number" ? o : parseInt(String(o).replace(/px$/i, ""), 10) || null, W = (o) => {
|
|
216
|
+
if (!S.value.spanMethod)
|
|
217
217
|
return [1, 1];
|
|
218
|
-
const
|
|
219
|
-
return
|
|
218
|
+
const i = Y.value.get(o.column.property);
|
|
219
|
+
return S.value.spanMethod({
|
|
220
220
|
...o,
|
|
221
|
-
column:
|
|
221
|
+
column: i ? { ...i, ...o.column } : { ...o.column, dataIndex: o.column.property, title: o.column.label }
|
|
222
222
|
});
|
|
223
|
-
},
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
const
|
|
227
|
-
let
|
|
228
|
-
const
|
|
229
|
-
return
|
|
223
|
+
}, g = (o) => {
|
|
224
|
+
const i = o.width;
|
|
225
|
+
if (J(i) && Z.value > 0 && d.value > 0 && typeof i == "number") {
|
|
226
|
+
const P = d.value - ne.value - X.value;
|
|
227
|
+
let F = Math.floor(P * i / Z.value);
|
|
228
|
+
const H = E(o.minWidth) ?? 60, N = E(o.maxWidth);
|
|
229
|
+
return F = Math.max(H, F), N != null && (F = Math.min(N, F)), F;
|
|
230
230
|
}
|
|
231
|
-
if (typeof
|
|
232
|
-
const
|
|
233
|
-
let
|
|
234
|
-
return
|
|
231
|
+
if (typeof i == "string") {
|
|
232
|
+
const P = E(i) ?? 80, F = E(o.minWidth), H = E(o.maxWidth);
|
|
233
|
+
let N = P;
|
|
234
|
+
return F != null && (N = Math.max(F, N)), H != null && (N = Math.min(H, N)), N;
|
|
235
235
|
}
|
|
236
236
|
return o.minWidth;
|
|
237
|
-
},
|
|
238
|
-
var
|
|
239
|
-
const o = (
|
|
240
|
-
return o ?
|
|
241
|
-
var
|
|
242
|
-
return !((
|
|
243
|
-
}) :
|
|
244
|
-
}),
|
|
245
|
-
const o =
|
|
246
|
-
return o > 0 && o <
|
|
247
|
-
}),
|
|
248
|
-
var
|
|
249
|
-
return ((
|
|
250
|
-
},
|
|
251
|
-
var
|
|
252
|
-
return ((
|
|
253
|
-
},
|
|
254
|
-
const o = _.value.map((
|
|
237
|
+
}, u = (o) => o.ifShow === !1 ? !1 : typeof o.ifShow == "function" ? o.ifShow({ column: o }) : !0, c = x(() => {
|
|
238
|
+
var i;
|
|
239
|
+
const o = (i = S.value.rowSelection) == null ? void 0 : i.getCheckboxProps;
|
|
240
|
+
return o ? k.value.filter((P) => {
|
|
241
|
+
var F;
|
|
242
|
+
return !((F = o(P)) != null && F.disabled);
|
|
243
|
+
}) : k.value;
|
|
244
|
+
}), b = x(() => c.value.length > 0), j = x(() => c.value.length === 0 ? !1 : c.value.every((o) => q.value.has(o[C.value]))), K = x(() => {
|
|
245
|
+
const o = c.value.filter((i) => q.value.has(i[C.value])).length;
|
|
246
|
+
return o > 0 && o < c.value.length;
|
|
247
|
+
}), U = (o) => q.value.has(o[C.value]), ee = (o) => {
|
|
248
|
+
var i, P, F;
|
|
249
|
+
return ((F = (P = (i = S.value.rowSelection) == null ? void 0 : i.getCheckboxProps) == null ? void 0 : P.call(i, o)) == null ? void 0 : F.disabled) ?? !1;
|
|
250
|
+
}, se = (o) => {
|
|
251
|
+
var i, P, F;
|
|
252
|
+
return ((F = (P = (i = S.value.rowSelection) == null ? void 0 : i.getRadioProps) == null ? void 0 : P.call(i, o)) == null ? void 0 : F.disabled) ?? !1;
|
|
253
|
+
}, Q = () => {
|
|
254
|
+
const o = _.value.map((i) => i[C.value]);
|
|
255
255
|
n("selection-change", { keys: o, rows: _.value });
|
|
256
|
-
},
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
},
|
|
260
|
-
_.value = [o],
|
|
256
|
+
}, le = (o, i) => {
|
|
257
|
+
const P = o[C.value];
|
|
258
|
+
i ? _.value = [..._.value.filter((F) => F[C.value] !== P), o] : _.value = _.value.filter((F) => F[C.value] !== P), Q();
|
|
259
|
+
}, _e = (o) => {
|
|
260
|
+
_.value = [o], Q();
|
|
261
261
|
}, fe = (o) => {
|
|
262
262
|
if (o) {
|
|
263
|
-
const
|
|
264
|
-
_.value = [..._.value, ...
|
|
263
|
+
const i = new Set(_.value.map((F) => F[C.value])), P = c.value.filter((F) => !i.has(F[C.value]));
|
|
264
|
+
_.value = [..._.value, ...P];
|
|
265
265
|
} else {
|
|
266
|
-
const
|
|
267
|
-
_.value = _.value.filter((
|
|
266
|
+
const i = new Set(k.value.map((P) => P[C.value]));
|
|
267
|
+
_.value = _.value.filter((P) => !i.has(P[C.value]));
|
|
268
268
|
}
|
|
269
|
-
|
|
270
|
-
},
|
|
269
|
+
Q();
|
|
270
|
+
}, ae = async (o) => {
|
|
271
271
|
if (!t.api) {
|
|
272
272
|
if (t.dataSource)
|
|
273
273
|
return;
|
|
274
274
|
v.value = [];
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
|
-
|
|
277
|
+
h.value = !0;
|
|
278
278
|
try {
|
|
279
|
-
const
|
|
280
|
-
[
|
|
281
|
-
[
|
|
279
|
+
const i = S.value.fetchSetting ?? {}, P = i.pageField ?? "page", F = i.sizeField ?? "pageSize", H = i.listField ?? "list", N = i.totalField ?? "total", re = {
|
|
280
|
+
[P]: (o == null ? void 0 : o.page) ?? z.value.page,
|
|
281
|
+
[F]: (o == null ? void 0 : o.pageSize) ?? z.value.pageSize,
|
|
282
282
|
...t.searchInfo,
|
|
283
283
|
...o == null ? void 0 : o.searchInfo
|
|
284
284
|
};
|
|
285
|
-
(o == null ? void 0 : o.page) != null && (
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
const Re = t.afterFetch ? t.afterFetch(
|
|
289
|
-
v.value = ze,
|
|
290
|
-
} catch (
|
|
291
|
-
v.value = [], n("fetch-error",
|
|
285
|
+
(o == null ? void 0 : o.page) != null && (z.value.page = o.page), (o == null ? void 0 : o.pageSize) != null && (z.value.pageSize = o.pageSize);
|
|
286
|
+
const ce = t.beforeFetch ? t.beforeFetch(re) : re, Te = await t.api(ce);
|
|
287
|
+
w.value = Te || {};
|
|
288
|
+
const Re = t.afterFetch ? t.afterFetch(Te) : Te, ze = Re[H] ?? Re.items ?? Re.list ?? [], Ie = Re[N] ?? 0;
|
|
289
|
+
v.value = ze, z.value.total = Ie, n("fetch-success", { items: ze, total: Ie });
|
|
290
|
+
} catch (i) {
|
|
291
|
+
v.value = [], n("fetch-error", i);
|
|
292
292
|
} finally {
|
|
293
|
-
|
|
293
|
+
h.value = !1;
|
|
294
294
|
}
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
},
|
|
298
|
-
|
|
299
|
-
},
|
|
295
|
+
}, pe = () => ae(void 0), ue = (o) => {
|
|
296
|
+
S.value.clearSelectOnPageChange && (_.value = []), z.value.pageSize = o, z.value.page = 1, ae(void 0);
|
|
297
|
+
}, we = (o) => {
|
|
298
|
+
S.value.clearSelectOnPageChange && (_.value = []), z.value.page = o, ae(void 0);
|
|
299
|
+
}, de = (o, i, P) => n("row-click", o, P), Pe = (o, i, P) => n("row-dblclick", o, P), Se = ({ prop: o, order: i }) => n("sort-change", { prop: o, order: i }), xe = (o, i) => n("expand-change", o, i), me = {
|
|
300
300
|
setProps: (o) => {
|
|
301
301
|
p.value = { ...p.value, ...o };
|
|
302
302
|
},
|
|
303
|
-
reload: (o) =>
|
|
303
|
+
reload: (o) => ae(o),
|
|
304
304
|
redoHeight: () => {
|
|
305
|
-
var o,
|
|
306
|
-
(
|
|
305
|
+
var o, i;
|
|
306
|
+
(i = (o = a.value) == null ? void 0 : o.doLayout) == null || i.call(o);
|
|
307
307
|
},
|
|
308
308
|
setLoading: (o) => {
|
|
309
|
-
|
|
309
|
+
h.value = o;
|
|
310
310
|
},
|
|
311
311
|
/** 返回全量数据(API 模式为服务端返回的当前页数据,本地模式为原始全量数据) */
|
|
312
312
|
getDataSource: () => v.value,
|
|
313
|
-
getRawDataSource: () =>
|
|
313
|
+
getRawDataSource: () => w.value,
|
|
314
314
|
/** 设置本地全量数据,同时同步 total */
|
|
315
315
|
setTableData: (o) => {
|
|
316
|
-
v.value = o ?? [], t.pagination !== !1 && (
|
|
316
|
+
v.value = o ?? [], t.pagination !== !1 && (z.value.total = (o ?? []).length);
|
|
317
317
|
},
|
|
318
|
-
getColumns: () =>
|
|
318
|
+
getColumns: () => y.value,
|
|
319
319
|
setColumns: (o) => {
|
|
320
320
|
if (Array.isArray(o) && o.length > 0 && typeof o[0] == "string") {
|
|
321
|
-
const
|
|
322
|
-
|
|
321
|
+
const i = o, P = (t.columns ?? []).filter((H) => i.includes(H.key ?? H.dataIndex)), F = i.map((H) => P.find((N) => (N.key ?? N.dataIndex) === H)).filter(Boolean);
|
|
322
|
+
F.length && (y.value = F);
|
|
323
323
|
} else
|
|
324
|
-
|
|
324
|
+
y.value = o ?? [];
|
|
325
325
|
},
|
|
326
326
|
setPagination: (o) => {
|
|
327
|
-
o != null && o.page && (
|
|
327
|
+
o != null && o.page && (z.value.page = o.page), o != null && o.pageSize && (z.value.pageSize = o.pageSize), (o == null ? void 0 : o.total) !== void 0 && (z.value.total = o.total);
|
|
328
328
|
},
|
|
329
|
-
getSelectRowKeys: () => _.value.map((o) => o[
|
|
329
|
+
getSelectRowKeys: () => _.value.map((o) => o[C.value]),
|
|
330
330
|
getSelectRows: () => _.value,
|
|
331
331
|
clearSelectedRowKeys: () => {
|
|
332
|
-
_.value = [],
|
|
332
|
+
_.value = [], Q();
|
|
333
333
|
},
|
|
334
334
|
setSelectedRowKeys: (o) => {
|
|
335
|
-
const
|
|
336
|
-
o.forEach((
|
|
337
|
-
|
|
338
|
-
}), _.value =
|
|
335
|
+
const i = new Set(o), P = v.value.filter((F) => i.has(F[C.value]));
|
|
336
|
+
o.forEach((F) => {
|
|
337
|
+
P.some((H) => H[C.value] === F) || P.push({ [C.value]: F });
|
|
338
|
+
}), _.value = P, Q();
|
|
339
339
|
},
|
|
340
340
|
deleteSelectRowByKey: (o) => {
|
|
341
|
-
_.value = _.value.filter((
|
|
341
|
+
_.value = _.value.filter((i) => i[C.value] !== o), Q();
|
|
342
342
|
},
|
|
343
343
|
/** index 为当前页索引,自动转换为全量索引 */
|
|
344
|
-
updateTableData: (o,
|
|
345
|
-
const { page:
|
|
346
|
-
|
|
344
|
+
updateTableData: (o, i, P) => {
|
|
345
|
+
const { page: F, pageSize: H } = z.value, N = (F - 1) * H + o;
|
|
346
|
+
N < 0 || N >= v.value.length || (v.value = [...v.value], v.value[N] = { ...v.value[N], [i]: P });
|
|
347
347
|
},
|
|
348
|
-
updateTableDataRecord: (o,
|
|
349
|
-
const
|
|
350
|
-
if (!(
|
|
351
|
-
return v.value = [...v.value], v.value[
|
|
348
|
+
updateTableDataRecord: (o, i) => {
|
|
349
|
+
const P = v.value.findIndex((F) => F[C.value] === o);
|
|
350
|
+
if (!(P < 0))
|
|
351
|
+
return v.value = [...v.value], v.value[P] = { ...v.value[P], ...i }, v.value[P];
|
|
352
352
|
},
|
|
353
353
|
deleteTableDataRecord: (o) => {
|
|
354
|
-
const
|
|
355
|
-
v.value = v.value.filter((
|
|
354
|
+
const i = Array.isArray(o) ? o : [o], P = new Set(i);
|
|
355
|
+
v.value = v.value.filter((F) => !P.has(F[C.value])), t.pagination !== !1 && (z.value.total = v.value.length);
|
|
356
356
|
},
|
|
357
|
-
insertTableDataRecord: (o,
|
|
358
|
-
const
|
|
359
|
-
return
|
|
357
|
+
insertTableDataRecord: (o, i) => {
|
|
358
|
+
const P = [...v.value];
|
|
359
|
+
return i == null || i >= P.length ? P.push(o) : P.splice(i, 0, o), v.value = P, t.pagination !== !1 && (z.value.total = v.value.length), o;
|
|
360
360
|
},
|
|
361
|
-
getPaginationRef: () =>
|
|
362
|
-
getShowPagination: () =>
|
|
361
|
+
getPaginationRef: () => R.value ? { page: z.value.page, pageSize: Number(z.value.pageSize) || 10, total: z.value.total } : !1,
|
|
362
|
+
getShowPagination: () => R.value,
|
|
363
363
|
setShowPagination: (o) => {
|
|
364
364
|
A.value = o;
|
|
365
365
|
},
|
|
366
|
-
getRowSelection: () =>
|
|
366
|
+
getRowSelection: () => S.value.rowSelection,
|
|
367
367
|
expandAll: () => {
|
|
368
|
-
var
|
|
369
|
-
const o = ((
|
|
370
|
-
const
|
|
371
|
-
return
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
Array.isArray(
|
|
375
|
-
}),
|
|
368
|
+
var F;
|
|
369
|
+
const o = ((F = S.value.treeProps) == null ? void 0 : F.children) ?? "children", i = (H) => {
|
|
370
|
+
const N = [];
|
|
371
|
+
return H.forEach((re) => {
|
|
372
|
+
N.push(re);
|
|
373
|
+
const ce = re[o];
|
|
374
|
+
Array.isArray(ce) && ce.length > 0 && N.push(...i(ce));
|
|
375
|
+
}), N;
|
|
376
376
|
};
|
|
377
|
-
|
|
378
|
-
var
|
|
379
|
-
return (
|
|
377
|
+
i(v.value).forEach((H) => {
|
|
378
|
+
var N, re;
|
|
379
|
+
return (re = (N = a.value) == null ? void 0 : N.toggleRowExpansion) == null ? void 0 : re.call(N, H, !0);
|
|
380
380
|
});
|
|
381
381
|
},
|
|
382
382
|
collapseAll: () => {
|
|
383
|
-
var
|
|
384
|
-
const o = ((
|
|
385
|
-
const
|
|
386
|
-
return
|
|
387
|
-
|
|
388
|
-
const
|
|
389
|
-
Array.isArray(
|
|
390
|
-
}),
|
|
383
|
+
var F;
|
|
384
|
+
const o = ((F = S.value.treeProps) == null ? void 0 : F.children) ?? "children", i = (H) => {
|
|
385
|
+
const N = [];
|
|
386
|
+
return H.forEach((re) => {
|
|
387
|
+
N.push(re);
|
|
388
|
+
const ce = re[o];
|
|
389
|
+
Array.isArray(ce) && ce.length > 0 && N.push(...i(ce));
|
|
390
|
+
}), N;
|
|
391
391
|
};
|
|
392
|
-
|
|
393
|
-
var
|
|
394
|
-
return (
|
|
392
|
+
i(v.value).forEach((H) => {
|
|
393
|
+
var N, re;
|
|
394
|
+
return (re = (N = a.value) == null ? void 0 : N.toggleRowExpansion) == null ? void 0 : re.call(N, H, !1);
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
397
|
};
|
|
398
|
-
e(
|
|
399
|
-
const
|
|
400
|
-
const o = (
|
|
401
|
-
const
|
|
398
|
+
e(me);
|
|
399
|
+
const ve = () => {
|
|
400
|
+
const o = (i, P = "") => i.map((F, H) => {
|
|
401
|
+
const N = `${F.dataIndex}`;
|
|
402
402
|
return {
|
|
403
|
-
...
|
|
404
|
-
dataIndex:
|
|
405
|
-
children:
|
|
403
|
+
...F,
|
|
404
|
+
dataIndex: N,
|
|
405
|
+
children: F.children ? o(F.children, N) : void 0
|
|
406
406
|
};
|
|
407
407
|
});
|
|
408
|
-
|
|
408
|
+
y.value = o(t.columns ?? []);
|
|
409
409
|
}, m = () => {
|
|
410
|
-
t.api &&
|
|
410
|
+
t.api && S.value.immediate !== !1 ? ae(void 0) : t.dataSource && (v.value = [...t.dataSource], !t.api && t.pagination !== !1 && (z.value.total = t.dataSource.length));
|
|
411
411
|
}, B = () => {
|
|
412
|
-
|
|
412
|
+
r.value && (d.value = r.value.offsetWidth || 0);
|
|
413
413
|
};
|
|
414
|
-
let
|
|
415
|
-
return
|
|
416
|
-
|
|
417
|
-
B(), $ =
|
|
414
|
+
let T = null, $ = null;
|
|
415
|
+
return ye(() => {
|
|
416
|
+
ve(), n("register", me), m(), typeof window < "u" && (window.addEventListener("resize", B), T = new ResizeObserver(B), De(() => {
|
|
417
|
+
B(), $ = r.value, $ && (T == null || T.observe($));
|
|
418
418
|
}));
|
|
419
|
-
}),
|
|
420
|
-
typeof window < "u" && (window.removeEventListener("resize", B),
|
|
421
|
-
}),
|
|
422
|
-
!t.api && t.dataSource && (v.value = [...t.dataSource], t.pagination !== !1 && (
|
|
423
|
-
}, { deep: !0 }),
|
|
424
|
-
|
|
425
|
-
}), { __sfc: !0, props: t, emit: n, slots: l, tableRef: a, tableWrapRef:
|
|
419
|
+
}), ke(() => {
|
|
420
|
+
typeof window < "u" && (window.removeEventListener("resize", B), T && $ && (T.unobserve($), $ = null));
|
|
421
|
+
}), te(() => t.columns, ve, { deep: !0 }), te(() => t.dataSource, () => {
|
|
422
|
+
!t.api && t.dataSource && (v.value = [...t.dataSource], t.pagination !== !1 && (z.value.total = t.dataSource.length));
|
|
423
|
+
}, { deep: !0 }), te(() => t.loading, (o) => {
|
|
424
|
+
h.value = o ?? !1;
|
|
425
|
+
}), { __sfc: !0, props: t, emit: n, slots: l, tableRef: a, tableWrapRef: r, containerWidth: d, loading: h, localFullData: v, innerData: k, rawDataSource: w, innerColumns: y, innerProps: p, selectedRows: _, showPaginationRef: A, mergeSettings: I, effectiveProps: S, defaultPagination: M, pagination: z, showTitleBar: V, showPagination: R, paginationSmall: f, paginationBackground: O, rowKeyField: C, selectedKeysSet: q, displayColumns: L, flatColumnsMap: Y, allFlatColumns: G, fixedColumnsWidth: ne, isRatioWidth: J, totalRatio: Z, fixedDataColumnsWidth: X, parseWidthPx: E, spanMethodAdapter: W, getColumnWidth: g, shouldShowColumn: u, selectableRows: c, hasSelectableRows: b, isAllCurrentPageSelected: j, isIndeterminate: K, isRowSelected: U, getCheckboxDisabled: ee, getRadioDisabled: se, emitSelectionChange: Q, handleCheckboxChange: le, handleRadioSelect: _e, handleSelectAll: fe, fetchData: ae, handleReload: pe, handleSizeChange: ue, handleCurrentChange: we, handleRowClick: de, handleRowDblclick: Pe, handleSortChange: Se, handleExpandChange: xe, tableAction: me, syncColumns: ve, loadData: m, updateContainerWidth: B, resizeObserver: T, observedEl: $, TableColumnGroup: it, BodyCellRenderer: qe };
|
|
426
426
|
}
|
|
427
427
|
});
|
|
428
428
|
var ct = function() {
|
|
429
|
-
var l, a,
|
|
429
|
+
var l, a, r, d;
|
|
430
430
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
431
|
-
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(
|
|
432
|
-
return n("div", { key: v }, [e._v(e._s(
|
|
431
|
+
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(h, v) {
|
|
432
|
+
return n("div", { key: v }, [e._v(e._s(h))]);
|
|
433
433
|
}), 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() {
|
|
434
|
-
var
|
|
435
|
-
return [((
|
|
436
|
-
})], 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(
|
|
434
|
+
var h;
|
|
435
|
+
return [((h = t.effectiveProps.tableSetting) == null ? void 0 : h.redo) !== !1 ? n("el-button", { attrs: { type: "text", icon: "el-icon-refresh", size: "small" }, on: { click: t.handleReload } }, [e._v(" 刷新 ")]) : e._e()];
|
|
436
|
+
})], 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(h) {
|
|
437
437
|
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")];
|
|
438
|
-
} }, { key: "default", fn: function(
|
|
438
|
+
} }, { key: "default", fn: function(h) {
|
|
439
439
|
var v;
|
|
440
|
-
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isRowSelected(
|
|
441
|
-
|
|
442
|
-
} } }) : n("el-radio", { attrs: { value: (v = t.selectedRows[0]) == null ? void 0 : v[t.rowKeyField], label:
|
|
443
|
-
return t.handleRadioSelect(
|
|
444
|
-
} }, nativeOn: { click: function(
|
|
445
|
-
|
|
440
|
+
return [t.effectiveProps.rowSelection.type !== "radio" ? n("el-checkbox", { attrs: { value: t.isRowSelected(h.row), disabled: t.getCheckboxDisabled(h.row) }, on: { change: (k) => t.handleCheckboxChange(h.row, k) }, nativeOn: { click: function(k) {
|
|
441
|
+
k.stopPropagation();
|
|
442
|
+
} } }) : n("el-radio", { attrs: { value: (v = t.selectedRows[0]) == null ? void 0 : v[t.rowKeyField], label: h.row[t.rowKeyField], disabled: t.getRadioDisabled(h.row) }, on: { change: function(k) {
|
|
443
|
+
return t.handleRadioSelect(h.row);
|
|
444
|
+
} }, nativeOn: { click: function(k) {
|
|
445
|
+
k.stopPropagation();
|
|
446
446
|
} } }, [n("span")])];
|
|
447
|
-
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? n("el-table-column", { attrs: { type: "index", label: ((l = t.effectiveProps.indexColumnProps) == null ? void 0 : l.title) || "序号", width: ((a = t.effectiveProps.indexColumnProps) == null ? void 0 : a.width) || 60, fixed: (
|
|
448
|
-
return [t.shouldShowColumn(
|
|
449
|
-
}), 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(
|
|
450
|
-
return [e.$scopedSlots.action ? e._t("action", null, { record:
|
|
447
|
+
} }], null, !1, 983730649) }) : e._e(), t.effectiveProps.showIndexColumn ? n("el-table-column", { attrs: { type: "index", label: ((l = t.effectiveProps.indexColumnProps) == null ? void 0 : l.title) || "序号", width: ((a = t.effectiveProps.indexColumnProps) == null ? void 0 : a.width) || 60, fixed: (r = t.effectiveProps.indexColumnProps) == null ? void 0 : r.fixed, align: ((d = t.effectiveProps.indexColumnProps) == null ? void 0 : d.align) || "center" } }) : e._e(), e._l(t.displayColumns, function(h) {
|
|
448
|
+
return [t.shouldShowColumn(h) ? n(t.TableColumnGroup, { key: h.key || h.dataIndex || h.title, attrs: { column: h, "effective-props": t.effectiveProps, "get-column-width": t.getColumnWidth } }) : e._e()];
|
|
449
|
+
}), 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(h) {
|
|
450
|
+
return [e.$scopedSlots.action ? e._t("action", null, { record: h.row, column: t.effectiveProps.actionColumn, index: h.$index }) : e.$scopedSlots.bodyCell ? n(t.BodyCellRenderer, { attrs: { "slot-render": e.$scopedSlots.bodyCell, column: t.effectiveProps.actionColumn, record: h.row, index: h.$index, value: void 0, "custom-render": t.effectiveProps.actionColumn.customRender, "value-enum": t.effectiveProps.actionColumn.valueEnum } }) : e._e()];
|
|
451
451
|
} }], 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()]);
|
|
452
|
-
}, dt = [], ft = /* @__PURE__ */
|
|
452
|
+
}, dt = [], ft = /* @__PURE__ */ ie(
|
|
453
453
|
ut,
|
|
454
454
|
ct,
|
|
455
455
|
dt,
|
|
@@ -459,68 +459,68 @@ var ct = function() {
|
|
|
459
459
|
null,
|
|
460
460
|
null
|
|
461
461
|
);
|
|
462
|
-
const He = ft.exports,
|
|
463
|
-
if (!
|
|
462
|
+
const He = ft.exports, Oe = (s) => Array.isArray(s) ? s.length > 0 : s != null && String(s).trim() !== "", Ne = (s) => Array.isArray(s) ? s.map((e) => String(e)).join(", ") : s == null ? "" : typeof s == "object" ? JSON.stringify(s) : String(s), Ee = (s, e) => {
|
|
463
|
+
if (!s)
|
|
464
464
|
return null;
|
|
465
|
-
if (
|
|
465
|
+
if (s === !0)
|
|
466
466
|
return {
|
|
467
|
-
content:
|
|
467
|
+
content: Ne(e),
|
|
468
468
|
placement: "top",
|
|
469
469
|
effect: "dark",
|
|
470
|
-
disabled: !
|
|
470
|
+
disabled: !Oe(e)
|
|
471
471
|
};
|
|
472
|
-
if (typeof
|
|
472
|
+
if (typeof s == "string")
|
|
473
473
|
return {
|
|
474
|
-
content:
|
|
474
|
+
content: s,
|
|
475
475
|
placement: "top",
|
|
476
476
|
effect: "dark"
|
|
477
477
|
};
|
|
478
|
-
const n = { ...
|
|
479
|
-
return Object.prototype.hasOwnProperty.call(n, "content") || (n.content =
|
|
480
|
-
}, pt = /* @__PURE__ */
|
|
478
|
+
const n = { ...s };
|
|
479
|
+
return Object.prototype.hasOwnProperty.call(n, "content") || (n.content = Ne(e)), Object.prototype.hasOwnProperty.call(n, "placement") || (n.placement = "top"), Object.prototype.hasOwnProperty.call(n, "effect") || (n.effect = "dark"), Object.prototype.hasOwnProperty.call(n, "disabled") || (n.disabled = !Oe(n.content)), n;
|
|
480
|
+
}, pt = /* @__PURE__ */ oe({
|
|
481
481
|
__name: "TableAction",
|
|
482
482
|
props: {
|
|
483
483
|
actions: { default: () => [] },
|
|
484
484
|
dropDownActions: { default: () => [] },
|
|
485
485
|
stopButtonPropagation: { type: Boolean, default: !1 }
|
|
486
486
|
},
|
|
487
|
-
setup(
|
|
488
|
-
const e =
|
|
487
|
+
setup(s) {
|
|
488
|
+
const e = s, n = (p) => Ee(p) || {}, t = (p) => p.type ? p.type : p.color === "error" ? "danger" : p.color === "success" ? "success" : p.color === "warning" ? "warning" : "text", l = (p) => p.filter((_) => {
|
|
489
489
|
const { ifShow: A } = _;
|
|
490
490
|
return typeof A == "boolean" ? A : typeof A == "function" ? A(_) : !0;
|
|
491
|
-
}), a =
|
|
491
|
+
}), a = x(() => l(e.actions || [])), r = x(() => l(e.dropDownActions || [])), d = (p, _) => {
|
|
492
492
|
var A;
|
|
493
493
|
e.stopButtonPropagation && _.stopPropagation(), (A = p.onClick) == null || A.call(p, _);
|
|
494
|
-
},
|
|
495
|
-
|
|
494
|
+
}, h = (p, _) => {
|
|
495
|
+
d(p, _);
|
|
496
496
|
}, v = (p, _, A) => {
|
|
497
|
-
var
|
|
498
|
-
e.stopButtonPropagation && A.stopPropagation(), p.popConfirm && (_ === "confirm" ? (
|
|
497
|
+
var I, S, M, z;
|
|
498
|
+
e.stopButtonPropagation && A.stopPropagation(), p.popConfirm && (_ === "confirm" ? (S = (I = p.popConfirm).confirm) == null || S.call(I) : (z = (M = p.popConfirm).cancel) == null || z.call(M));
|
|
499
499
|
};
|
|
500
|
-
return { __sfc: !0, props: e, normalizeTooltip: n, getButtonType: t, filterVisible: l, visibleActions: a, visibleDropDownActions:
|
|
500
|
+
return { __sfc: !0, props: e, normalizeTooltip: n, getButtonType: t, filterVisible: l, visibleActions: a, visibleDropDownActions: r, handleClick: d, handleActionClick: h, handlePopConfirm: v, handlePopConfirmConfirm: (p, _) => {
|
|
501
501
|
v(p, "confirm", _);
|
|
502
502
|
}, handlePopConfirmCancel: (p, _) => {
|
|
503
503
|
v(p, "cancel", _);
|
|
504
504
|
}, handleDropdownCommand: (p) => {
|
|
505
|
-
var
|
|
506
|
-
const _ = Number(p), A =
|
|
505
|
+
var I;
|
|
506
|
+
const _ = Number(p), A = r.value[_];
|
|
507
507
|
if (!(!A || A.disabled)) {
|
|
508
508
|
if (A.popConfirm) {
|
|
509
|
-
const
|
|
510
|
-
lt.confirm(
|
|
511
|
-
confirmButtonText:
|
|
512
|
-
cancelButtonText:
|
|
509
|
+
const S = A.popConfirm.title, M = A.popConfirm.okText || "确定", z = A.popConfirm.cancelText || "取消";
|
|
510
|
+
lt.confirm(S, "提示", {
|
|
511
|
+
confirmButtonText: M,
|
|
512
|
+
cancelButtonText: z,
|
|
513
513
|
type: "warning"
|
|
514
514
|
}).then(() => {
|
|
515
|
-
var
|
|
516
|
-
return (
|
|
515
|
+
var V, R;
|
|
516
|
+
return (R = (V = A.popConfirm) == null ? void 0 : V.confirm) == null ? void 0 : R.call(V);
|
|
517
517
|
}).catch(() => {
|
|
518
|
-
var
|
|
519
|
-
return (
|
|
518
|
+
var V, R;
|
|
519
|
+
return (R = (V = A.popConfirm) == null ? void 0 : V.cancel) == null ? void 0 : R.call(V);
|
|
520
520
|
});
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
|
-
(
|
|
523
|
+
(I = A.onClick) == null || I.call(A, {});
|
|
524
524
|
}
|
|
525
525
|
} };
|
|
526
526
|
}
|
|
@@ -528,19 +528,19 @@ const He = ft.exports, Ve = (r) => Array.isArray(r) ? r.length > 0 : r != null &
|
|
|
528
528
|
var mt = function() {
|
|
529
529
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
530
530
|
return n("div", { staticClass: "ecp-table-action" }, [e._l(t.visibleActions, function(l, a) {
|
|
531
|
-
return n("span", { key: `action-${a}`, staticClass: "ecp-table-action__item" }, [l.popConfirm ? n("el-popconfirm", { attrs: { title: l.popConfirm.title, "confirm-button-text": l.popConfirm.okText || "确定", "cancel-button-text": l.popConfirm.cancelText || "取消" }, on: { confirm: function(
|
|
532
|
-
return t.handlePopConfirmConfirm(l,
|
|
533
|
-
}, cancel: function(
|
|
534
|
-
return t.handlePopConfirmCancel(l,
|
|
535
|
-
} } }, [n("span", { attrs: { slot: "reference" }, slot: "reference" }, [n(l.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", l.tooltip ? t.normalizeTooltip(l.tooltip) : {}, !1), [n("el-button", e._b({ attrs: { type: t.getButtonType(l), size: "small", disabled: l.disabled }, on: { click: function(
|
|
536
|
-
return t.handleActionClick(l,
|
|
537
|
-
} } }, "el-button", l.props, !1), [l.icon ? n("i", { class: ["ecp-table-action__icon", l.icon] }) : e._e(), n("span", [e._v(e._s(l.label))])])], 1)], 1)]) : n(l.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", l.tooltip ? t.normalizeTooltip(l.tooltip) : {}, !1), [n("el-button", e._b({ attrs: { type: t.getButtonType(l), size: "small", disabled: l.disabled }, on: { click: function(
|
|
538
|
-
return t.handleActionClick(l,
|
|
531
|
+
return n("span", { key: `action-${a}`, staticClass: "ecp-table-action__item" }, [l.popConfirm ? n("el-popconfirm", { attrs: { title: l.popConfirm.title, "confirm-button-text": l.popConfirm.okText || "确定", "cancel-button-text": l.popConfirm.cancelText || "取消" }, on: { confirm: function(r) {
|
|
532
|
+
return t.handlePopConfirmConfirm(l, r);
|
|
533
|
+
}, cancel: function(r) {
|
|
534
|
+
return t.handlePopConfirmCancel(l, r);
|
|
535
|
+
} } }, [n("span", { attrs: { slot: "reference" }, slot: "reference" }, [n(l.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", l.tooltip ? t.normalizeTooltip(l.tooltip) : {}, !1), [n("el-button", e._b({ attrs: { type: t.getButtonType(l), size: "small", disabled: l.disabled }, on: { click: function(r) {
|
|
536
|
+
return t.handleActionClick(l, r);
|
|
537
|
+
} } }, "el-button", l.props, !1), [l.icon ? n("i", { class: ["ecp-table-action__icon", l.icon] }) : e._e(), n("span", [e._v(e._s(l.label))])])], 1)], 1)]) : n(l.tooltip ? "el-tooltip" : "span", e._b({ tag: "component" }, "component", l.tooltip ? t.normalizeTooltip(l.tooltip) : {}, !1), [n("el-button", e._b({ attrs: { type: t.getButtonType(l), size: "small", disabled: l.disabled }, on: { click: function(r) {
|
|
538
|
+
return t.handleActionClick(l, r);
|
|
539
539
|
} } }, "el-button", l.props, !1), [l.icon ? n("i", { class: ["ecp-table-action__icon", l.icon] }) : e._e(), n("span", [e._v(e._s(l.label))])])], 1), l.divider ? n("el-divider", { attrs: { direction: "vertical" } }) : e._e()], 1);
|
|
540
540
|
}), 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(l, a) {
|
|
541
541
|
return n("el-dropdown-item", { key: `dropdown-${a}`, attrs: { command: a, disabled: l.disabled, divided: !!l.divider } }, [n("span", { staticClass: "ecp-table-action__dropdown-item" }, [l.icon ? n("i", { class: ["ecp-table-action__icon", l.icon] }) : e._e(), n("span", [e._v(e._s(l.label))])])]);
|
|
542
542
|
}), 1)], 1) : e._e()], 2);
|
|
543
|
-
}, vt = [], ht = /* @__PURE__ */
|
|
543
|
+
}, vt = [], ht = /* @__PURE__ */ ie(
|
|
544
544
|
pt,
|
|
545
545
|
mt,
|
|
546
546
|
vt,
|
|
@@ -551,58 +551,58 @@ var mt = function() {
|
|
|
551
551
|
null
|
|
552
552
|
);
|
|
553
553
|
const Ge = ht.exports;
|
|
554
|
-
function hn(
|
|
555
|
-
const e = D(null), n = () =>
|
|
556
|
-
const
|
|
557
|
-
if (!
|
|
554
|
+
function hn(s) {
|
|
555
|
+
const e = D(null), n = () => s ? be(s) : void 0, t = () => {
|
|
556
|
+
const r = be(e);
|
|
557
|
+
if (!r)
|
|
558
558
|
throw new Error("ProTable instance has not been registered");
|
|
559
|
-
return
|
|
560
|
-
}, l = (
|
|
561
|
-
e.value =
|
|
562
|
-
const
|
|
563
|
-
|
|
559
|
+
return r;
|
|
560
|
+
}, l = (r) => {
|
|
561
|
+
e.value = r;
|
|
562
|
+
const d = n();
|
|
563
|
+
d && Object.keys(d).length > 0 && r.setProps(d);
|
|
564
564
|
};
|
|
565
|
-
return
|
|
565
|
+
return s && te(
|
|
566
566
|
() => n(),
|
|
567
|
-
(
|
|
568
|
-
|
|
567
|
+
(r) => {
|
|
568
|
+
r && e.value && e.value.setProps(r);
|
|
569
569
|
},
|
|
570
570
|
{ deep: !0 }
|
|
571
571
|
), [l, {
|
|
572
|
-
setProps: (
|
|
573
|
-
reload: (
|
|
572
|
+
setProps: (r) => t().setProps(r),
|
|
573
|
+
reload: (r) => t().reload(r),
|
|
574
574
|
redoHeight: () => t().redoHeight(),
|
|
575
|
-
setLoading: (
|
|
575
|
+
setLoading: (r) => t().setLoading(r),
|
|
576
576
|
getDataSource: () => t().getDataSource(),
|
|
577
577
|
getRawDataSource: () => t().getRawDataSource(),
|
|
578
|
-
setTableData: (
|
|
578
|
+
setTableData: (r) => t().setTableData(r),
|
|
579
579
|
getColumns: () => t().getColumns(),
|
|
580
|
-
setColumns: (
|
|
581
|
-
setPagination: (
|
|
580
|
+
setColumns: (r) => t().setColumns(r),
|
|
581
|
+
setPagination: (r) => t().setPagination(r),
|
|
582
582
|
getSelectRowKeys: () => t().getSelectRowKeys(),
|
|
583
583
|
getSelectRows: () => t().getSelectRows(),
|
|
584
584
|
clearSelectedRowKeys: () => t().clearSelectedRowKeys(),
|
|
585
|
-
setSelectedRowKeys: (
|
|
586
|
-
deleteSelectRowByKey: (
|
|
587
|
-
updateTableData: (
|
|
588
|
-
updateTableDataRecord: (
|
|
589
|
-
deleteTableDataRecord: (
|
|
590
|
-
insertTableDataRecord: (
|
|
585
|
+
setSelectedRowKeys: (r) => t().setSelectedRowKeys(r),
|
|
586
|
+
deleteSelectRowByKey: (r) => t().deleteSelectRowByKey(r),
|
|
587
|
+
updateTableData: (r, d, h) => t().updateTableData(r, d, h),
|
|
588
|
+
updateTableDataRecord: (r, d) => t().updateTableDataRecord(r, d),
|
|
589
|
+
deleteTableDataRecord: (r) => t().deleteTableDataRecord(r),
|
|
590
|
+
insertTableDataRecord: (r, d) => t().insertTableDataRecord(r, d),
|
|
591
591
|
getPaginationRef: () => t().getPaginationRef(),
|
|
592
592
|
getShowPagination: () => t().getShowPagination(),
|
|
593
|
-
setShowPagination: (
|
|
593
|
+
setShowPagination: (r) => t().setShowPagination(r),
|
|
594
594
|
getRowSelection: () => t().getRowSelection(),
|
|
595
595
|
expandAll: () => {
|
|
596
|
-
var
|
|
597
|
-
return (
|
|
596
|
+
var r, d;
|
|
597
|
+
return (d = (r = t()).expandAll) == null ? void 0 : d.call(r);
|
|
598
598
|
},
|
|
599
599
|
collapseAll: () => {
|
|
600
|
-
var
|
|
601
|
-
return (
|
|
600
|
+
var r, d;
|
|
601
|
+
return (d = (r = t()).collapseAll) == null ? void 0 : d.call(r);
|
|
602
602
|
}
|
|
603
603
|
}];
|
|
604
604
|
}
|
|
605
|
-
const _t = /* @__PURE__ */
|
|
605
|
+
const _t = /* @__PURE__ */ oe({
|
|
606
606
|
__name: "ApiSelect",
|
|
607
607
|
props: {
|
|
608
608
|
value: null,
|
|
@@ -618,23 +618,23 @@ const _t = /* @__PURE__ */ te({
|
|
|
618
618
|
multiple: { type: Boolean }
|
|
619
619
|
},
|
|
620
620
|
emits: ["input", "change"],
|
|
621
|
-
setup(
|
|
622
|
-
const n =
|
|
623
|
-
n.lazy &&
|
|
624
|
-
},
|
|
621
|
+
setup(s, { expose: e }) {
|
|
622
|
+
const n = s, t = D(!1), l = D([]), a = D([]), r = (w) => w == null ? "null" : JSON.stringify(d(w)), d = (w) => Array.isArray(w) ? w.map(d) : w !== null && typeof w == "object" ? Object.keys(w).sort().reduce((y, p) => (y[p] = d(w[p]), y), {}) : w, h = D(r(n.params ?? null)), v = (w) => {
|
|
623
|
+
n.lazy && w && (r(n.params ?? null) !== h.value || l.value.length === 0) && k();
|
|
624
|
+
}, k = async () => {
|
|
625
625
|
if (n.api) {
|
|
626
626
|
t.value = !0;
|
|
627
627
|
try {
|
|
628
|
-
const
|
|
629
|
-
a.value =
|
|
628
|
+
const w = await n.api(n.params), y = Array.isArray(w) ? w : (w == null ? void 0 : w.list) ?? (w == null ? void 0 : w.data) ?? [];
|
|
629
|
+
a.value = y;
|
|
630
630
|
const p = n.labelField ?? "label", _ = n.valueField ?? "value";
|
|
631
|
-
l.value =
|
|
632
|
-
const
|
|
631
|
+
l.value = y.map((A) => {
|
|
632
|
+
const I = A;
|
|
633
633
|
return {
|
|
634
|
-
label: String(
|
|
635
|
-
value:
|
|
634
|
+
label: String(I[p] ?? I.label ?? ""),
|
|
635
|
+
value: I[_] ?? I.value
|
|
636
636
|
};
|
|
637
|
-
}),
|
|
637
|
+
}), h.value = r(n.params ?? null);
|
|
638
638
|
} finally {
|
|
639
639
|
t.value = !1;
|
|
640
640
|
}
|
|
@@ -644,18 +644,18 @@ const _t = /* @__PURE__ */ te({
|
|
|
644
644
|
options: l,
|
|
645
645
|
rawOptions: a,
|
|
646
646
|
loading: t,
|
|
647
|
-
fetchOptions:
|
|
648
|
-
}),
|
|
649
|
-
n.lazy ||
|
|
650
|
-
}),
|
|
647
|
+
fetchOptions: k
|
|
648
|
+
}), ye(() => {
|
|
649
|
+
n.lazy || k();
|
|
650
|
+
}), te(
|
|
651
651
|
() => n.api,
|
|
652
652
|
() => {
|
|
653
|
-
n.lazy ? (l.value = [], a.value = []) :
|
|
653
|
+
n.lazy ? (l.value = [], a.value = []) : k();
|
|
654
654
|
},
|
|
655
655
|
{ deep: !0 }
|
|
656
|
-
),
|
|
657
|
-
|
|
658
|
-
}, { deep: !0 }), { __sfc: !0, props: n, loading: t, options: l, rawOptions: a, sortStringify:
|
|
656
|
+
), te(() => n.params, () => {
|
|
657
|
+
r(n.params ?? null) !== h.value && (n.lazy ? (l.value = [], a.value = []) : k());
|
|
658
|
+
}, { deep: !0 }), { __sfc: !0, props: n, loading: t, options: l, rawOptions: a, sortStringify: r, sortKeys: d, lastFetchedParamsKey: h, onVisibleChange: v, fetchOptions: k };
|
|
659
659
|
}
|
|
660
660
|
});
|
|
661
661
|
var gt = function() {
|
|
@@ -667,7 +667,7 @@ var gt = function() {
|
|
|
667
667
|
}, "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(l) {
|
|
668
668
|
return n("el-option", { key: String(l.value), attrs: { label: l.label, value: l.value } });
|
|
669
669
|
}), 1);
|
|
670
|
-
}, bt = [], yt = /* @__PURE__ */
|
|
670
|
+
}, bt = [], yt = /* @__PURE__ */ ie(
|
|
671
671
|
_t,
|
|
672
672
|
gt,
|
|
673
673
|
bt,
|
|
@@ -678,8 +678,8 @@ var gt = function() {
|
|
|
678
678
|
null
|
|
679
679
|
);
|
|
680
680
|
const Ue = yt.exports;
|
|
681
|
-
function
|
|
682
|
-
const e =
|
|
681
|
+
function We(s) {
|
|
682
|
+
const e = s.trim();
|
|
683
683
|
if (!e)
|
|
684
684
|
return "";
|
|
685
685
|
let n = 0, t = "";
|
|
@@ -695,48 +695,48 @@ function Ne(r) {
|
|
|
695
695
|
}
|
|
696
696
|
return t;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
699
|
-
return
|
|
698
|
+
function Me(s) {
|
|
699
|
+
return s.replace(/,/g, "").trim();
|
|
700
700
|
}
|
|
701
|
-
function wt(
|
|
702
|
-
if (!
|
|
703
|
-
return
|
|
704
|
-
const t =
|
|
705
|
-
let l = t ?
|
|
701
|
+
function wt(s, e, n) {
|
|
702
|
+
if (!s || s === "-")
|
|
703
|
+
return s;
|
|
704
|
+
const t = s[0] === "-";
|
|
705
|
+
let l = t ? s.slice(1) : s;
|
|
706
706
|
const a = l.indexOf(".");
|
|
707
707
|
if (a === -1) {
|
|
708
|
-
const
|
|
709
|
-
return l =
|
|
708
|
+
const k = Math.max(0, e);
|
|
709
|
+
return l = k > 0 ? l.slice(0, k) : l, t ? "-" + l : l;
|
|
710
710
|
}
|
|
711
|
-
let
|
|
712
|
-
e > 0 && (
|
|
713
|
-
const
|
|
711
|
+
let r = l.slice(0, a);
|
|
712
|
+
e > 0 && (r = r.slice(0, e));
|
|
713
|
+
const d = l.slice(a + 1), h = d === "" && l.endsWith(".");
|
|
714
714
|
if (n <= 0)
|
|
715
|
-
return t ? "-" +
|
|
716
|
-
if (
|
|
717
|
-
return (t ? "-" : "") +
|
|
718
|
-
const v =
|
|
719
|
-
return (t ? "-" : "") +
|
|
715
|
+
return t ? "-" + r : r;
|
|
716
|
+
if (h)
|
|
717
|
+
return (t ? "-" : "") + r + ".";
|
|
718
|
+
const v = d.slice(0, n);
|
|
719
|
+
return (t ? "-" : "") + r + "." + v;
|
|
720
720
|
}
|
|
721
|
-
function
|
|
722
|
-
const n = Math.pow(10,
|
|
721
|
+
function xt(s, e) {
|
|
722
|
+
const n = Math.pow(10, s) - 1;
|
|
723
723
|
return e <= 0 ? n : n + (1 - Math.pow(10, -e));
|
|
724
724
|
}
|
|
725
|
-
function
|
|
726
|
-
const t =
|
|
727
|
-
return Math.abs(
|
|
725
|
+
function Le(s, e, n) {
|
|
726
|
+
const t = xt(e, n), l = s < 0 ? -1 : 1;
|
|
727
|
+
return Math.abs(s) <= t ? s : l * t;
|
|
728
728
|
}
|
|
729
|
-
function
|
|
729
|
+
function Ct(s, e, n) {
|
|
730
730
|
if (e <= 0)
|
|
731
731
|
switch (n) {
|
|
732
732
|
case "floor":
|
|
733
|
-
return Math.floor(
|
|
733
|
+
return Math.floor(s);
|
|
734
734
|
case "ceil":
|
|
735
|
-
return Math.ceil(
|
|
735
|
+
return Math.ceil(s);
|
|
736
736
|
default:
|
|
737
|
-
return Math.round(
|
|
737
|
+
return Math.round(s);
|
|
738
738
|
}
|
|
739
|
-
const t = Math.pow(10, e), l =
|
|
739
|
+
const t = Math.pow(10, e), l = s * t;
|
|
740
740
|
let a;
|
|
741
741
|
switch (n) {
|
|
742
742
|
case "floor":
|
|
@@ -750,26 +750,26 @@ function xt(r, e, n) {
|
|
|
750
750
|
}
|
|
751
751
|
return a / t;
|
|
752
752
|
}
|
|
753
|
-
function
|
|
754
|
-
let l =
|
|
755
|
-
return l =
|
|
753
|
+
function Fe(s, e, n, t) {
|
|
754
|
+
let l = Le(s, e, n);
|
|
755
|
+
return l = Ct(l, n, t), l = Le(l, e, n), l;
|
|
756
756
|
}
|
|
757
|
-
function Pt(
|
|
758
|
-
return Number.isNaN(
|
|
757
|
+
function Pt(s, e) {
|
|
758
|
+
return Number.isNaN(s) || !Number.isFinite(s) ? "" : s.toFixed(Math.max(0, e));
|
|
759
759
|
}
|
|
760
|
-
function
|
|
761
|
-
if (Number.isNaN(
|
|
760
|
+
function Ke(s, e) {
|
|
761
|
+
if (Number.isNaN(s) || !Number.isFinite(s))
|
|
762
762
|
return "";
|
|
763
|
-
const n =
|
|
764
|
-
return e <= 0 ||
|
|
763
|
+
const n = s.toFixed(Math.max(0, e)), t = n.startsWith("-"), l = t ? n.slice(1) : n, [a, r] = l.split("."), d = a.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
764
|
+
return e <= 0 || r === void 0 ? (t ? "-" : "") + d : (t ? "-" : "") + d + "." + r;
|
|
765
765
|
}
|
|
766
|
-
function St(
|
|
767
|
-
if (Number.isNaN(
|
|
766
|
+
function St(s, e) {
|
|
767
|
+
if (Number.isNaN(s) || !Number.isFinite(s))
|
|
768
768
|
return "";
|
|
769
|
-
let n =
|
|
769
|
+
let n = s.toFixed(Math.max(0, e));
|
|
770
770
|
return n = n.replace(/(\.\d*?)0+$/, "$1"), n = n.replace(/\.$/, ""), n;
|
|
771
771
|
}
|
|
772
|
-
const Rt = /* @__PURE__ */
|
|
772
|
+
const Rt = /* @__PURE__ */ oe({
|
|
773
773
|
__name: "FormattedNumberInput",
|
|
774
774
|
props: {
|
|
775
775
|
value: null,
|
|
@@ -781,94 +781,94 @@ const Rt = /* @__PURE__ */ te({
|
|
|
781
781
|
inputLimit: { type: Boolean, default: !0 }
|
|
782
782
|
},
|
|
783
783
|
emits: ["input"],
|
|
784
|
-
setup(
|
|
785
|
-
const n =
|
|
786
|
-
function
|
|
784
|
+
setup(s, { emit: e }) {
|
|
785
|
+
const n = s, t = D(!1), l = D(""), a = () => Math.max(0, Math.floor(n.integerDigits ?? 6)), r = () => Math.max(0, Math.floor(n.decimalPlaces ?? 6));
|
|
786
|
+
function d(p) {
|
|
787
787
|
if (p == null || p === "")
|
|
788
788
|
return null;
|
|
789
789
|
if (typeof p == "number")
|
|
790
790
|
return Number.isFinite(p) ? p : null;
|
|
791
|
-
const _ =
|
|
791
|
+
const _ = Me(String(p));
|
|
792
792
|
if (_ === "" || _ === "-")
|
|
793
793
|
return null;
|
|
794
794
|
const A = Number(_);
|
|
795
795
|
return Number.isFinite(A) ? A : null;
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function h() {
|
|
798
798
|
if (t.value)
|
|
799
799
|
return;
|
|
800
|
-
const p =
|
|
800
|
+
const p = d(n.value);
|
|
801
801
|
if (p === null) {
|
|
802
802
|
l.value = "";
|
|
803
803
|
return;
|
|
804
804
|
}
|
|
805
|
-
l.value =
|
|
806
|
-
|
|
807
|
-
|
|
805
|
+
l.value = Ke(
|
|
806
|
+
Fe(p, a(), r(), n.rounding),
|
|
807
|
+
r()
|
|
808
808
|
);
|
|
809
809
|
}
|
|
810
|
-
|
|
810
|
+
te(
|
|
811
811
|
() => [n.value, n.integerDigits, n.decimalPlaces, n.rounding],
|
|
812
|
-
() =>
|
|
812
|
+
() => h(),
|
|
813
813
|
{ immediate: !0, deep: !0 }
|
|
814
814
|
);
|
|
815
815
|
function v(p) {
|
|
816
|
-
e("input", Pt(p,
|
|
816
|
+
e("input", Pt(p, r()));
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
let _ =
|
|
820
|
-
if (n.inputLimit !== !1 && (_ = wt(_, a(),
|
|
818
|
+
function k(p) {
|
|
819
|
+
let _ = We(p);
|
|
820
|
+
if (n.inputLimit !== !1 && (_ = wt(_, a(), r())), l.value = _, _ === "" || _ === "-")
|
|
821
821
|
return;
|
|
822
822
|
const A = Number(_);
|
|
823
823
|
if (!Number.isFinite(A))
|
|
824
824
|
return;
|
|
825
|
-
const
|
|
826
|
-
v(
|
|
825
|
+
const I = Fe(A, a(), r(), n.rounding);
|
|
826
|
+
v(I);
|
|
827
827
|
}
|
|
828
|
-
function
|
|
828
|
+
function w() {
|
|
829
829
|
t.value = !0;
|
|
830
|
-
const p =
|
|
830
|
+
const p = Me(l.value), _ = d(p === "" ? n.value : p);
|
|
831
831
|
if (_ === null) {
|
|
832
832
|
l.value = "";
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
835
|
l.value = St(
|
|
836
|
-
|
|
837
|
-
|
|
836
|
+
Fe(_, a(), r(), n.rounding),
|
|
837
|
+
r()
|
|
838
838
|
);
|
|
839
839
|
}
|
|
840
|
-
function
|
|
840
|
+
function y() {
|
|
841
841
|
t.value = !1;
|
|
842
|
-
const p =
|
|
842
|
+
const p = Me(l.value);
|
|
843
843
|
if (p === "" || p === "-") {
|
|
844
844
|
l.value = "", e("input", void 0);
|
|
845
845
|
return;
|
|
846
846
|
}
|
|
847
|
-
const _ = Number(
|
|
847
|
+
const _ = Number(We(p));
|
|
848
848
|
if (!Number.isFinite(_)) {
|
|
849
849
|
l.value = "", e("input", void 0);
|
|
850
850
|
return;
|
|
851
851
|
}
|
|
852
|
-
const A =
|
|
853
|
-
l.value =
|
|
852
|
+
const A = Fe(_, a(), r(), n.rounding);
|
|
853
|
+
l.value = Ke(A, r()), v(A);
|
|
854
854
|
}
|
|
855
|
-
return { __sfc: !0, props: n, emit: e, focused: t, displayText: l, intN: a, decM:
|
|
855
|
+
return { __sfc: !0, props: n, emit: e, focused: t, displayText: l, intN: a, decM: r, parseExternalToNumber: d, syncDisplayFromValue: h, emitStoredValue: v, onInput: k, onFocus: w, onBlur: y };
|
|
856
856
|
}
|
|
857
857
|
});
|
|
858
|
-
var
|
|
858
|
+
var Ft = function() {
|
|
859
859
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
860
860
|
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));
|
|
861
|
-
},
|
|
861
|
+
}, kt = [], Bt = /* @__PURE__ */ ie(
|
|
862
862
|
Rt,
|
|
863
|
-
kt,
|
|
864
863
|
Ft,
|
|
864
|
+
kt,
|
|
865
865
|
!1,
|
|
866
866
|
null,
|
|
867
867
|
null,
|
|
868
868
|
null,
|
|
869
869
|
null
|
|
870
870
|
);
|
|
871
|
-
const Ae = Bt.exports, At = /* @__PURE__ */
|
|
871
|
+
const Ae = Bt.exports, At = /* @__PURE__ */ oe({
|
|
872
872
|
__name: "TreeSelect",
|
|
873
873
|
props: {
|
|
874
874
|
value: null,
|
|
@@ -885,107 +885,107 @@ const Ae = Bt.exports, At = /* @__PURE__ */ te({
|
|
|
885
885
|
clearable: { type: Boolean }
|
|
886
886
|
},
|
|
887
887
|
emits: ["input"],
|
|
888
|
-
setup(
|
|
889
|
-
const n =
|
|
888
|
+
setup(s, { emit: e }) {
|
|
889
|
+
const n = s, t = D(), l = D(), a = D(!1), r = D(!1), d = D(""), h = D([]), v = D({}), k = x(() => ({
|
|
890
890
|
label: n.labelField,
|
|
891
891
|
children: n.childrenField
|
|
892
892
|
}));
|
|
893
|
-
function
|
|
894
|
-
const
|
|
895
|
-
return
|
|
893
|
+
function w(C) {
|
|
894
|
+
const q = n.labelField ?? "label", L = n.valueField ?? "value", Y = n.childrenField ?? "children", G = C[Y], ne = {};
|
|
895
|
+
return ne[n.labelField ?? "label"] = C[q] ?? C.label, ne[n.valueField ?? "value"] = C[L] ?? C.value, Array.isArray(G) && G.length && (ne[n.childrenField ?? "children"] = G.map((J) => w(J))), ne;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
898
|
-
const
|
|
899
|
-
for (const
|
|
900
|
-
const
|
|
901
|
-
|
|
902
|
-
const
|
|
903
|
-
Array.isArray(
|
|
897
|
+
function y(C, q = "") {
|
|
898
|
+
const L = {}, Y = n.labelField ?? "label", G = n.valueField ?? "value", ne = n.childrenField ?? "children";
|
|
899
|
+
for (const J of C) {
|
|
900
|
+
const Z = String(J[Y] ?? J.label ?? ""), X = J[G] ?? J.value;
|
|
901
|
+
X != null && (L[String(X)] = q ? q + " / " + Z : Z);
|
|
902
|
+
const E = J[ne] ?? J.children;
|
|
903
|
+
Array.isArray(E) && E.length && Object.assign(L, y(E, Z));
|
|
904
904
|
}
|
|
905
|
-
return
|
|
905
|
+
return L;
|
|
906
906
|
}
|
|
907
907
|
function p() {
|
|
908
|
-
const
|
|
909
|
-
return Array.isArray(
|
|
908
|
+
const C = n.treeData;
|
|
909
|
+
return Array.isArray(C) && C.length > 0;
|
|
910
910
|
}
|
|
911
|
-
function _(
|
|
912
|
-
|
|
911
|
+
function _(C) {
|
|
912
|
+
h.value = C, v.value = y(C);
|
|
913
913
|
}
|
|
914
914
|
function A() {
|
|
915
|
-
const
|
|
916
|
-
if (!Array.isArray(
|
|
915
|
+
const C = n.treeData;
|
|
916
|
+
if (!Array.isArray(C) || C.length === 0)
|
|
917
917
|
return;
|
|
918
|
-
const
|
|
919
|
-
_(
|
|
918
|
+
const q = C.map((L) => w(L));
|
|
919
|
+
_(q);
|
|
920
920
|
}
|
|
921
|
-
const
|
|
922
|
-
if (!
|
|
921
|
+
const I = x(() => n.value == null || n.value === "" ? "" : v.value[String(n.value)] ?? String(n.value)), S = (C, q) => {
|
|
922
|
+
if (!C)
|
|
923
923
|
return !0;
|
|
924
|
-
const
|
|
925
|
-
return String(
|
|
924
|
+
const L = n.labelField ?? "label";
|
|
925
|
+
return String(q[L] ?? q.label ?? "").toLowerCase().includes(C.toLowerCase());
|
|
926
926
|
};
|
|
927
|
-
|
|
928
|
-
var
|
|
929
|
-
(
|
|
927
|
+
te(d, (C) => {
|
|
928
|
+
var q;
|
|
929
|
+
(q = l.value) == null || q.filter(C);
|
|
930
930
|
});
|
|
931
|
-
let
|
|
932
|
-
function
|
|
933
|
-
n.disabled || (a.value = !0, n.lazy && !p() &&
|
|
934
|
-
|
|
935
|
-
t.value && !t.value.contains(
|
|
936
|
-
}, document.addEventListener("click",
|
|
931
|
+
let M = null;
|
|
932
|
+
function z() {
|
|
933
|
+
n.disabled || (a.value = !0, n.lazy && !p() && O(), De(() => {
|
|
934
|
+
M = (C) => {
|
|
935
|
+
t.value && !t.value.contains(C.target) && V();
|
|
936
|
+
}, document.addEventListener("click", M);
|
|
937
937
|
}));
|
|
938
938
|
}
|
|
939
|
-
function
|
|
940
|
-
a.value = !1,
|
|
939
|
+
function V() {
|
|
940
|
+
a.value = !1, d.value = "", M && (document.removeEventListener("click", M), M = null);
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function R() {
|
|
943
943
|
e("input", void 0);
|
|
944
944
|
}
|
|
945
|
-
function
|
|
946
|
-
const
|
|
947
|
-
e("input",
|
|
945
|
+
function f(C) {
|
|
946
|
+
const q = n.valueField ?? "value", L = C[q] ?? C.value;
|
|
947
|
+
e("input", L), V();
|
|
948
948
|
}
|
|
949
|
-
async function
|
|
949
|
+
async function O() {
|
|
950
950
|
if (!(!n.api || p())) {
|
|
951
|
-
|
|
951
|
+
r.value = !0;
|
|
952
952
|
try {
|
|
953
|
-
const
|
|
954
|
-
|
|
953
|
+
const C = await n.api(n.params), q = Array.isArray(C) ? C : (C == null ? void 0 : C.list) ?? (C == null ? void 0 : C.data) ?? [];
|
|
954
|
+
h.value = q.map((L) => w(L)), v.value = y(h.value);
|
|
955
955
|
} finally {
|
|
956
|
-
|
|
956
|
+
r.value = !1;
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
return
|
|
961
|
-
p() ? A() : n.lazy ||
|
|
962
|
-
}),
|
|
963
|
-
p() ? A() : (
|
|
964
|
-
}, { deep: !0 }),
|
|
965
|
-
p() || (n.lazy ? (
|
|
966
|
-
}, { deep: !0 }),
|
|
967
|
-
p() || (n.lazy ? (
|
|
968
|
-
}, { deep: !0 }), { __sfc: !0, props: n, emit: e, rootRef: t, treeRef: l, dropdownVisible: a, loading:
|
|
960
|
+
return ye(() => {
|
|
961
|
+
p() ? A() : n.lazy || O();
|
|
962
|
+
}), te(() => n.treeData, () => {
|
|
963
|
+
p() ? A() : (h.value = [], v.value = {}, !n.lazy && n.api && O());
|
|
964
|
+
}, { deep: !0 }), te(() => n.api, () => {
|
|
965
|
+
p() || (n.lazy ? (h.value = [], v.value = {}) : O());
|
|
966
|
+
}, { deep: !0 }), te(() => n.params, () => {
|
|
967
|
+
p() || (n.lazy ? (h.value = [], v.value = {}) : O());
|
|
968
|
+
}, { deep: !0 }), { __sfc: !0, props: n, emit: e, rootRef: t, treeRef: l, dropdownVisible: a, loading: r, filterText: d, treeData: h, flatLabelMap: v, treeProps: k, normalizeNode: w, buildFlatLabelMap: y, hasTreeDataProp: p, applyTreeData: _, syncFromTreeDataProp: A, displayText: I, filterNodeMethod: S, clickOutsideHandler: M, openDropdown: z, closeDropdown: V, clearValue: R, onNodeClick: f, fetchData: O };
|
|
969
969
|
}
|
|
970
970
|
});
|
|
971
|
-
var
|
|
971
|
+
var Tt = function() {
|
|
972
972
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
973
973
|
return n("div", { ref: "rootRef", staticClass: "ecp-tree-select" }, [n("el-input", { staticClass: "ecp-tree-select__input", attrs: { value: t.displayText, placeholder: e.placeholder, disabled: e.disabled, clearable: e.clearable, readonly: "", "suffix-icon": "el-icon-arrow-down" }, on: { focus: t.openDropdown, clear: t.clearValue } }), n("transition", { attrs: { name: "el-zoom-in-top" } }, [n("div", { directives: [{ name: "show", rawName: "v-show", value: t.dropdownVisible, expression: "dropdownVisible" }], staticClass: "ecp-tree-select__dropdown" }, [e.filterable ? n("div", { staticClass: "ecp-tree-select__filter-inner" }, [n("el-input", { attrs: { size: "small", placeholder: "搜索节点", "prefix-icon": "el-icon-search", clearable: "" }, nativeOn: { click: function(l) {
|
|
974
974
|
l.stopPropagation();
|
|
975
975
|
} }, model: { value: t.filterText, callback: function(l) {
|
|
976
976
|
t.filterText = l;
|
|
977
977
|
}, 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);
|
|
978
|
-
},
|
|
978
|
+
}, Mt = [], $t = /* @__PURE__ */ ie(
|
|
979
979
|
At,
|
|
980
|
-
Mt,
|
|
981
980
|
Tt,
|
|
981
|
+
Mt,
|
|
982
982
|
!1,
|
|
983
983
|
null,
|
|
984
984
|
null,
|
|
985
985
|
null,
|
|
986
986
|
null
|
|
987
987
|
);
|
|
988
|
-
const Je = $t.exports, Dt = /* @__PURE__ */
|
|
988
|
+
const Je = $t.exports, Dt = /* @__PURE__ */ oe({
|
|
989
989
|
__name: "ProFormItem",
|
|
990
990
|
props: {
|
|
991
991
|
schema: null,
|
|
@@ -998,8 +998,8 @@ const Je = $t.exports, Dt = /* @__PURE__ */ te({
|
|
|
998
998
|
customComponents: null,
|
|
999
999
|
registerFieldInstance: null
|
|
1000
1000
|
},
|
|
1001
|
-
setup(
|
|
1002
|
-
const e =
|
|
1001
|
+
setup(s) {
|
|
1002
|
+
const e = s, n = /* @__PURE__ */ new Set([
|
|
1003
1003
|
"input",
|
|
1004
1004
|
"select",
|
|
1005
1005
|
"api-select",
|
|
@@ -1013,75 +1013,75 @@ const Je = $t.exports, Dt = /* @__PURE__ */ te({
|
|
|
1013
1013
|
"checkbox",
|
|
1014
1014
|
"radio"
|
|
1015
1015
|
]), t = D(null);
|
|
1016
|
-
|
|
1017
|
-
var
|
|
1018
|
-
e.schema.component === "api-select" && ((
|
|
1019
|
-
}),
|
|
1020
|
-
var
|
|
1021
|
-
e.schema.component === "api-select" && ((
|
|
1016
|
+
ye(() => {
|
|
1017
|
+
var f;
|
|
1018
|
+
e.schema.component === "api-select" && ((f = e.registerFieldInstance) == null || f.call(e, e.schema.field, t.value));
|
|
1019
|
+
}), ke(() => {
|
|
1020
|
+
var f;
|
|
1021
|
+
e.schema.component === "api-select" && ((f = e.registerFieldInstance) == null || f.call(e, e.schema.field, null));
|
|
1022
1022
|
});
|
|
1023
|
-
const l =
|
|
1023
|
+
const l = Ce(), a = x(() => ({
|
|
1024
1024
|
schema: e.schema,
|
|
1025
1025
|
values: e.formModel,
|
|
1026
1026
|
model: e.formModel,
|
|
1027
1027
|
field: e.schema.field
|
|
1028
|
-
})),
|
|
1029
|
-
const
|
|
1030
|
-
return
|
|
1031
|
-
}),
|
|
1032
|
-
const
|
|
1033
|
-
return
|
|
1034
|
-
}),
|
|
1028
|
+
})), r = x(() => {
|
|
1029
|
+
const f = e.schema.ifShow;
|
|
1030
|
+
return f === void 0 ? !0 : typeof f == "boolean" ? f : f(a.value);
|
|
1031
|
+
}), d = x(() => {
|
|
1032
|
+
const f = e.schema.show;
|
|
1033
|
+
return f === void 0 ? !0 : typeof f == "boolean" ? f : f(a.value);
|
|
1034
|
+
}), h = x(() => {
|
|
1035
1035
|
if (e.formDisabled)
|
|
1036
1036
|
return !0;
|
|
1037
|
-
const
|
|
1038
|
-
return
|
|
1039
|
-
}), v =
|
|
1040
|
-
const
|
|
1041
|
-
return
|
|
1042
|
-
}),
|
|
1043
|
-
const
|
|
1044
|
-
if (!
|
|
1037
|
+
const f = e.schema.dynamicDisabled;
|
|
1038
|
+
return f === void 0 ? !1 : typeof f == "boolean" ? f : f(a.value);
|
|
1039
|
+
}), v = x(() => {
|
|
1040
|
+
const f = e.schema.dynamicRules;
|
|
1041
|
+
return f ? Array.isArray(f) ? f : f(a.value) : e.schema.rules;
|
|
1042
|
+
}), k = x(() => {
|
|
1043
|
+
const f = e.schema.componentProps;
|
|
1044
|
+
if (!f)
|
|
1045
1045
|
return { props: {}, listeners: {} };
|
|
1046
|
-
const
|
|
1046
|
+
const O = typeof f == "function" ? f({
|
|
1047
1047
|
...a.value,
|
|
1048
1048
|
formActionType: e.formActionType
|
|
1049
|
-
}) : { ...
|
|
1050
|
-
for (const [
|
|
1051
|
-
if (
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1049
|
+
}) : { ...f }, C = {}, q = {};
|
|
1050
|
+
for (const [L, Y] of Object.entries(O))
|
|
1051
|
+
if (L.length > 2 && /^on[A-Za-z]/.test(L) && typeof Y == "function") {
|
|
1052
|
+
const G = L.slice(2).charAt(0).toLowerCase() + L.slice(3);
|
|
1053
|
+
q[G] = Y;
|
|
1054
1054
|
} else
|
|
1055
|
-
|
|
1056
|
-
return { props:
|
|
1057
|
-
}),
|
|
1058
|
-
const
|
|
1059
|
-
if (!
|
|
1055
|
+
C[L] = Y;
|
|
1056
|
+
return { props: C, listeners: q };
|
|
1057
|
+
}), w = x(() => k.value.props), y = x(() => k.value.listeners), p = x(() => e.schema.colon ?? e.colon ?? !1), _ = x(() => {
|
|
1058
|
+
const f = e.schema.tooltip;
|
|
1059
|
+
if (!f)
|
|
1060
1060
|
return null;
|
|
1061
|
-
const
|
|
1062
|
-
return
|
|
1063
|
-
}), A =
|
|
1064
|
-
const
|
|
1065
|
-
return Array.isArray(
|
|
1066
|
-
},
|
|
1067
|
-
const
|
|
1068
|
-
return
|
|
1069
|
-
}),
|
|
1070
|
-
var
|
|
1071
|
-
(
|
|
1072
|
-
},
|
|
1073
|
-
const
|
|
1074
|
-
return
|
|
1061
|
+
const O = typeof f == "function" ? f(a.value) : f;
|
|
1062
|
+
return Ee(O, e.formModel[e.schema.field]);
|
|
1063
|
+
}), A = x(() => _.value ? "el-tooltip" : "span"), I = x(() => _.value || {}), S = x(() => !!l.default), M = (f) => {
|
|
1064
|
+
const O = f == null ? void 0 : f.options;
|
|
1065
|
+
return Array.isArray(O) ? O : void 0;
|
|
1066
|
+
}, z = x(() => {
|
|
1067
|
+
const f = e.schema.component;
|
|
1068
|
+
return f == null ? null : typeof f == "string" ? n.has(f) ? null : e.customComponents && e.customComponents[f] || f : f;
|
|
1069
|
+
}), V = (f) => {
|
|
1070
|
+
var O;
|
|
1071
|
+
(O = e.onFieldChange) == null || O.call(e, e.schema.field, f);
|
|
1072
|
+
}, R = x(() => {
|
|
1073
|
+
const f = e.schema.render;
|
|
1074
|
+
return f ? {
|
|
1075
1075
|
render() {
|
|
1076
|
-
const
|
|
1077
|
-
return Array.isArray(
|
|
1076
|
+
const O = f(a.value);
|
|
1077
|
+
return Array.isArray(O) ? he("span", O) : O;
|
|
1078
1078
|
}
|
|
1079
1079
|
} : null;
|
|
1080
1080
|
});
|
|
1081
|
-
return { __sfc: !0, BUILT_IN_COMPONENTS: n, props: e, apiSelectRef: t, slots: l, renderParams: a, shouldRender:
|
|
1081
|
+
return { __sfc: !0, BUILT_IN_COMPONENTS: n, props: e, apiSelectRef: t, slots: l, renderParams: a, shouldRender: r, shouldShow: d, effectiveDisabled: h, effectiveRules: v, effectiveComponentPropsAndListeners: k, effectiveComponentProps: w, effectiveComponentListeners: y, showColon: p, normalizedTooltip: _, fieldWrapperComponent: A, fieldWrapperProps: I, hasSlot: S, getOptions: M, resolvedCustomComponent: z, setFieldValue: V, renderComponent: R, ApiSelect: Ue, FormattedNumberInput: Ae, TreeSelect: Je };
|
|
1082
1082
|
}
|
|
1083
1083
|
});
|
|
1084
|
-
var
|
|
1084
|
+
var Et = function() {
|
|
1085
1085
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1086
1086
|
return t.shouldRender ? n("el-form-item", { directives: [{ name: "show", rawName: "v-show", value: t.shouldShow, expression: "shouldShow" }], attrs: { prop: e.schema.field, required: e.schema.required, rules: t.effectiveRules, "label-width": e.schema.labelWidth } }, [n("template", { slot: "label" }, [n("span", [e._v(" " + e._s(e.schema.label)), t.showColon ? n("span", { staticClass: "ecp-pro-form-item__colon" }, [e._v(":")]) : e._e()]), e.schema.helpMessage ? n("el-tooltip", e._b({ attrs: { placement: "top", effect: "light" } }, "el-tooltip", e.schema.helpComponentProps || {}, !1), [n("template", { slot: "content" }, [Array.isArray(e.schema.helpMessage) ? e._l(e.schema.helpMessage, function(l, a) {
|
|
1087
1087
|
return n("div", { key: a, staticClass: "ecp-pro-form-item__help-item" }, [e._v(" " + e._s(l) + " ")]);
|
|
@@ -1110,17 +1110,17 @@ var zt = function() {
|
|
|
1110
1110
|
}, expression: "formModel[schema.field]" } }, "el-radio-group", t.effectiveComponentProps, !1), t.effectiveComponentListeners), e._l(t.getOptions(t.effectiveComponentProps) || [], function(l) {
|
|
1111
1111
|
return n("el-radio", { key: String(l.value), attrs: { label: l.value } }, [e._v(" " + e._s(l.label) + " ")]);
|
|
1112
1112
|
}), 1) : e._e()], 1)]], 2) : e._e();
|
|
1113
|
-
},
|
|
1113
|
+
}, zt = [], It = /* @__PURE__ */ ie(
|
|
1114
1114
|
Dt,
|
|
1115
|
-
zt,
|
|
1116
1115
|
Et,
|
|
1116
|
+
zt,
|
|
1117
1117
|
!1,
|
|
1118
1118
|
null,
|
|
1119
1119
|
null,
|
|
1120
1120
|
null,
|
|
1121
1121
|
null
|
|
1122
1122
|
);
|
|
1123
|
-
const Ze = It.exports, Vt = /* @__PURE__ */
|
|
1123
|
+
const Ze = It.exports, Vt = /* @__PURE__ */ oe({
|
|
1124
1124
|
__name: "FormActions",
|
|
1125
1125
|
props: {
|
|
1126
1126
|
showActionButtonGroup: { type: Boolean, default: !0 },
|
|
@@ -1137,7 +1137,7 @@ const Ze = It.exports, Vt = /* @__PURE__ */ te({
|
|
|
1137
1137
|
actionColOptions: null
|
|
1138
1138
|
},
|
|
1139
1139
|
emits: ["submit", "reset", "toggle"],
|
|
1140
|
-
setup(
|
|
1140
|
+
setup(s) {
|
|
1141
1141
|
return { __sfc: !0 };
|
|
1142
1142
|
}
|
|
1143
1143
|
});
|
|
@@ -1148,7 +1148,7 @@ var Ot = function() {
|
|
|
1148
1148
|
} } }, [e._v(" " + e._s(e.submitButtonText) + " ")]) : e._e(), e._t("resetBefore"), e.showResetButton ? n("el-button", { attrs: { icon: e.resetButtonIcon }, on: { click: function(t) {
|
|
1149
1149
|
return e.$emit("reset");
|
|
1150
1150
|
} } }, [e._v(" " + e._s(e.resetButtonText) + " ")]) : e._e(), e._t("actions")], 2);
|
|
1151
|
-
}, Nt = [], Wt = /* @__PURE__ */
|
|
1151
|
+
}, Nt = [], Wt = /* @__PURE__ */ ie(
|
|
1152
1152
|
Vt,
|
|
1153
1153
|
Ot,
|
|
1154
1154
|
Nt,
|
|
@@ -1158,7 +1158,7 @@ var Ot = function() {
|
|
|
1158
1158
|
null,
|
|
1159
1159
|
null
|
|
1160
1160
|
);
|
|
1161
|
-
const Xe = Wt.exports, Lt = /* @__PURE__ */
|
|
1161
|
+
const Xe = Wt.exports, Lt = /* @__PURE__ */ oe({
|
|
1162
1162
|
__name: "ProForm",
|
|
1163
1163
|
props: {
|
|
1164
1164
|
schemas: null,
|
|
@@ -1191,191 +1191,191 @@ const Xe = Wt.exports, Lt = /* @__PURE__ */ te({
|
|
|
1191
1191
|
components: null
|
|
1192
1192
|
},
|
|
1193
1193
|
emits: ["submit", "reset", "register", "update:modelValue"],
|
|
1194
|
-
setup(
|
|
1195
|
-
const t =
|
|
1196
|
-
const $ =
|
|
1197
|
-
return $ >= _.xl ? o.xl ??
|
|
1198
|
-
}, { getSetting:
|
|
1199
|
-
...
|
|
1200
|
-
...
|
|
1201
|
-
...
|
|
1202
|
-
})),
|
|
1203
|
-
let o = 24,
|
|
1204
|
-
for (const
|
|
1205
|
-
const
|
|
1206
|
-
if (
|
|
1207
|
-
if (
|
|
1194
|
+
setup(s, { expose: e, emit: n }) {
|
|
1195
|
+
const t = s, l = Ce(), a = D(), r = D(), d = D(!1), h = D(!0), v = D({}), k = D({}), w = D([]), y = D({}), p = D(/* @__PURE__ */ new Map()), _ = { xl: 1920, lg: 1200, md: 992, sm: 768 }, A = (m, B, T) => {
|
|
1196
|
+
const $ = T ?? (typeof window < "u" ? window.innerWidth : 1920), o = m ?? {}, i = B ?? {}, P = i.span ?? 8;
|
|
1197
|
+
return $ >= _.xl ? o.xl ?? i.xl ?? o.lg ?? i.lg ?? o.md ?? i.md ?? o.sm ?? i.sm ?? o.xs ?? i.xs ?? o.span ?? P : $ >= _.lg ? o.lg ?? i.lg ?? o.md ?? i.md ?? o.sm ?? i.sm ?? o.xs ?? i.xs ?? o.span ?? P : $ >= _.md ? o.md ?? i.md ?? o.sm ?? i.sm ?? o.xs ?? i.xs ?? o.span ?? P : $ >= _.sm ? o.sm ?? i.sm ?? o.xs ?? i.xs ?? o.span ?? P : o.xs ?? i.xs ?? o.span ?? P;
|
|
1198
|
+
}, { getSetting: I } = Be(), S = x(() => ({ ...I("ProForm"), ...t, ...y.value })), M = x(() => S.value.modelValue), z = x(() => M.value !== void 0), V = x(() => z.value ? M.value ?? {} : v.value), R = x(() => ({
|
|
1199
|
+
...I("ProForm").components ?? {},
|
|
1200
|
+
...S.value.components ?? {},
|
|
1201
|
+
...y.value.components ?? {}
|
|
1202
|
+
})), f = x(() => S.value.actionColOptions ?? { span: 24 }), O = D(typeof window < "u" ? window.innerWidth : 1920), C = (m, B, T, $) => {
|
|
1203
|
+
let o = 24, i = 1, P = 0;
|
|
1204
|
+
for (const F of m) {
|
|
1205
|
+
const H = A(F.colProps, B, $);
|
|
1206
|
+
if (H > o) {
|
|
1207
|
+
if (i++, i > T)
|
|
1208
1208
|
break;
|
|
1209
|
-
o = 24 -
|
|
1209
|
+
o = 24 - H;
|
|
1210
1210
|
} else
|
|
1211
|
-
o -=
|
|
1212
|
-
|
|
1211
|
+
o -= H;
|
|
1212
|
+
P++;
|
|
1213
1213
|
}
|
|
1214
|
-
return
|
|
1215
|
-
},
|
|
1216
|
-
const m =
|
|
1217
|
-
if (!
|
|
1214
|
+
return P;
|
|
1215
|
+
}, q = x(() => {
|
|
1216
|
+
const m = w.value.filter((o) => G(o));
|
|
1217
|
+
if (!S.value.showAdvancedButton)
|
|
1218
1218
|
return !1;
|
|
1219
|
-
const B =
|
|
1219
|
+
const B = S.value.alwaysShowLines ?? 1, T = S.value.baseColProps, $ = C(m, T, B, O.value);
|
|
1220
1220
|
return m.length > $;
|
|
1221
|
-
}),
|
|
1222
|
-
const m =
|
|
1223
|
-
if (!
|
|
1221
|
+
}), L = x(() => S.value.formListeners ?? {}), Y = x(() => {
|
|
1222
|
+
const m = w.value.filter((o) => G(o));
|
|
1223
|
+
if (!S.value.showAdvancedButton || !h.value)
|
|
1224
1224
|
return m;
|
|
1225
|
-
const B =
|
|
1225
|
+
const B = S.value.alwaysShowLines ?? 1, T = S.value.baseColProps, $ = C(m, T, B, O.value);
|
|
1226
1226
|
return m.slice(0, $);
|
|
1227
|
-
}),
|
|
1228
|
-
let B = !0,
|
|
1229
|
-
return typeof m.ifShow == "function" && (B = m.ifShow({ schema: m, values:
|
|
1230
|
-
},
|
|
1231
|
-
const
|
|
1232
|
-
return
|
|
1233
|
-
if (!(B && Object.prototype.hasOwnProperty.call(
|
|
1227
|
+
}), G = (m) => {
|
|
1228
|
+
let B = !0, T = !0;
|
|
1229
|
+
return typeof m.ifShow == "function" && (B = m.ifShow({ schema: m, values: V.value, model: V.value, field: m.field })), typeof m.ifShow == "boolean" && (B = m.ifShow), typeof m.show == "function" && (T = m.show({ schema: m, values: V.value, model: V.value, field: m.field })), typeof m.show == "boolean" && (T = m.show), B && T;
|
|
1230
|
+
}, ne = (m) => m.colProps ?? S.value.baseColProps ?? {}, J = (m) => m.slot || m.field, Z = (m, B = !0) => {
|
|
1231
|
+
const T = B ? { ...m ?? {} } : {}, $ = S.value.initialValues ?? t.initialValues;
|
|
1232
|
+
return w.value.forEach((o) => {
|
|
1233
|
+
if (!(B && Object.prototype.hasOwnProperty.call(T, o.field))) {
|
|
1234
1234
|
if (o.defaultValue !== void 0) {
|
|
1235
|
-
|
|
1235
|
+
T[o.field] = o.defaultValue;
|
|
1236
1236
|
return;
|
|
1237
1237
|
}
|
|
1238
|
-
$ && Object.prototype.hasOwnProperty.call($, o.field) && (
|
|
1238
|
+
$ && Object.prototype.hasOwnProperty.call($, o.field) && (T[o.field] = $[o.field]);
|
|
1239
1239
|
}
|
|
1240
|
-
}),
|
|
1241
|
-
},
|
|
1240
|
+
}), T;
|
|
1241
|
+
}, X = (m, B = !0) => {
|
|
1242
1242
|
v.value = m, B && n("update:modelValue", m);
|
|
1243
|
-
},
|
|
1244
|
-
const B =
|
|
1245
|
-
return
|
|
1246
|
-
},
|
|
1243
|
+
}, E = (m) => {
|
|
1244
|
+
const B = Z({ ...V.value, ...m });
|
|
1245
|
+
return X(B), B;
|
|
1246
|
+
}, W = () => {
|
|
1247
1247
|
const m = {};
|
|
1248
|
-
|
|
1249
|
-
var
|
|
1250
|
-
(
|
|
1251
|
-
}),
|
|
1252
|
-
},
|
|
1248
|
+
w.value.forEach((B) => {
|
|
1249
|
+
var T;
|
|
1250
|
+
(T = B.rules) != null && T.length && (m[B.field] = B.rules);
|
|
1251
|
+
}), X(Z(V.value), !1), k.value = m;
|
|
1252
|
+
}, g = (m) => {
|
|
1253
1253
|
const B = { ...m };
|
|
1254
|
-
return
|
|
1255
|
-
const $ =
|
|
1254
|
+
return w.value.forEach((T) => {
|
|
1255
|
+
const $ = T.ifShow;
|
|
1256
1256
|
if ($ === void 0)
|
|
1257
1257
|
return;
|
|
1258
|
-
(typeof $ == "boolean" ? $ : $({ schema:
|
|
1258
|
+
(typeof $ == "boolean" ? $ : $({ schema: T, values: m, model: m, field: T.field })) || delete B[T.field];
|
|
1259
1259
|
}), B;
|
|
1260
|
-
},
|
|
1261
|
-
const B =
|
|
1262
|
-
if (!(
|
|
1260
|
+
}, u = (m) => {
|
|
1261
|
+
const B = g(m), T = y.value.fieldMapToTime;
|
|
1262
|
+
if (!(T != null && T.length))
|
|
1263
1263
|
return B;
|
|
1264
1264
|
const $ = { ...B };
|
|
1265
|
-
return
|
|
1266
|
-
const
|
|
1267
|
-
Array.isArray(
|
|
1265
|
+
return T.forEach(([o, [i, P]]) => {
|
|
1266
|
+
const F = $[o];
|
|
1267
|
+
Array.isArray(F) && F.length === 2 && (delete $[o], $[i] = F[0], $[P] = F[1]);
|
|
1268
1268
|
}), $;
|
|
1269
|
-
},
|
|
1269
|
+
}, c = async () => {
|
|
1270
1270
|
var m;
|
|
1271
1271
|
try {
|
|
1272
|
-
await ((m = a.value) == null ? void 0 : m.validate()),
|
|
1272
|
+
await ((m = a.value) == null ? void 0 : m.validate()), S.value.submitFunc ? await S.value.submitFunc() : (d.value = !0, n("submit", u({ ...V.value })));
|
|
1273
1273
|
} catch (B) {
|
|
1274
1274
|
console.error("Form validation failed:", B);
|
|
1275
1275
|
} finally {
|
|
1276
|
-
|
|
1276
|
+
d.value = !1;
|
|
1277
1277
|
}
|
|
1278
|
-
},
|
|
1278
|
+
}, b = async () => {
|
|
1279
1279
|
var m;
|
|
1280
|
-
|
|
1281
|
-
},
|
|
1280
|
+
S.value.resetFunc ? await S.value.resetFunc() : ((m = a.value) == null || m.resetFields(), W(), n("reset"), S.value.submitOnReset && await c());
|
|
1281
|
+
}, j = (m) => (E(m), Promise.resolve()), K = () => u({ ...V.value }), U = async () => {
|
|
1282
1282
|
var m;
|
|
1283
|
-
(m = a.value) == null || m.resetFields(),
|
|
1284
|
-
},
|
|
1285
|
-
|
|
1286
|
-
},
|
|
1283
|
+
(m = a.value) == null || m.resetFields(), X(Z(void 0, !1));
|
|
1284
|
+
}, ee = (m, B) => {
|
|
1285
|
+
E({ [m]: B });
|
|
1286
|
+
}, se = (m) => {
|
|
1287
1287
|
var B;
|
|
1288
1288
|
return ((B = a.value) == null ? void 0 : B.validate(m)) ?? Promise.resolve();
|
|
1289
|
-
},
|
|
1290
|
-
a.value.validateField(B, (o) => o ?
|
|
1291
|
-
}))) : a.value.validate() : Promise.resolve(),
|
|
1289
|
+
}, Q = (m) => a.value ? m != null && m.length ? Promise.all(m.map((B) => new Promise((T, $) => {
|
|
1290
|
+
a.value.validateField(B, (o) => o ? T(void 0) : $(new Error("Validation failed")));
|
|
1291
|
+
}))) : a.value.validate() : Promise.resolve(), le = async (m, B) => {
|
|
1292
1292
|
var $;
|
|
1293
|
-
const
|
|
1294
|
-
return
|
|
1295
|
-
},
|
|
1293
|
+
const T = ($ = r.value) == null ? void 0 : $.querySelector(`[data-field="${m}"]`);
|
|
1294
|
+
return T && T.scrollIntoView({ behavior: (B == null ? void 0 : B.behavior) ?? "smooth", block: (B == null ? void 0 : B.block) ?? "nearest" }), Promise.resolve();
|
|
1295
|
+
}, _e = (m) => {
|
|
1296
1296
|
var B;
|
|
1297
1297
|
(B = a.value) == null || B.clearValidate(m);
|
|
1298
1298
|
}, fe = async (m) => {
|
|
1299
|
-
(Array.isArray(m) ? m : [m]).forEach((
|
|
1300
|
-
const $ =
|
|
1301
|
-
$ >= 0 && (
|
|
1302
|
-
});
|
|
1303
|
-
},
|
|
1304
|
-
if (
|
|
1305
|
-
|
|
1299
|
+
(Array.isArray(m) ? m : [m]).forEach((T) => {
|
|
1300
|
+
const $ = w.value.findIndex((o) => o.field === T.field);
|
|
1301
|
+
$ >= 0 && (w.value[$] = { ...w.value[$], ...T });
|
|
1302
|
+
}), W();
|
|
1303
|
+
}, ae = async (m, B, T) => {
|
|
1304
|
+
if (T)
|
|
1305
|
+
w.value.unshift(m);
|
|
1306
1306
|
else if (B) {
|
|
1307
|
-
const $ =
|
|
1308
|
-
|
|
1307
|
+
const $ = w.value.findIndex((o) => o.field === B);
|
|
1308
|
+
w.value.splice($ + 1, 0, m);
|
|
1309
1309
|
} else
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
},
|
|
1310
|
+
w.value.push(m);
|
|
1311
|
+
W();
|
|
1312
|
+
}, pe = async (m) => {
|
|
1313
1313
|
const B = Array.isArray(m) ? m : [m];
|
|
1314
|
-
|
|
1315
|
-
},
|
|
1316
|
-
|
|
1317
|
-
},
|
|
1314
|
+
w.value = w.value.filter((T) => !B.includes(T.field));
|
|
1315
|
+
}, ue = async (m) => {
|
|
1316
|
+
y.value = { ...y.value, ...m }, m.schemas && (w.value = [...m.schemas], W());
|
|
1317
|
+
}, we = (m, B) => {
|
|
1318
1318
|
B ? p.value.set(m, B) : p.value.delete(m);
|
|
1319
|
-
},
|
|
1319
|
+
}, de = (m) => p.value.get(m) ?? null;
|
|
1320
1320
|
function Pe(m, B = !1) {
|
|
1321
|
-
const
|
|
1322
|
-
if (!
|
|
1321
|
+
const T = p.value.get(m);
|
|
1322
|
+
if (!T)
|
|
1323
1323
|
return [];
|
|
1324
|
-
const $ =
|
|
1324
|
+
const $ = T;
|
|
1325
1325
|
return B ? ($ == null ? void 0 : $.rawOptions) ?? [] : ($ == null ? void 0 : $.options) ?? [];
|
|
1326
1326
|
}
|
|
1327
1327
|
const Se = (m) => {
|
|
1328
1328
|
const B = p.value.get(m);
|
|
1329
1329
|
if (!B)
|
|
1330
1330
|
return !1;
|
|
1331
|
-
const
|
|
1332
|
-
return (
|
|
1333
|
-
},
|
|
1334
|
-
getFieldsValue:
|
|
1335
|
-
setFieldsValue:
|
|
1336
|
-
resetFields:
|
|
1337
|
-
validate:
|
|
1338
|
-
validateFields:
|
|
1339
|
-
submit:
|
|
1340
|
-
scrollToField:
|
|
1341
|
-
clearValidate:
|
|
1331
|
+
const T = B;
|
|
1332
|
+
return (T == null ? void 0 : T.loading) ?? !1;
|
|
1333
|
+
}, xe = {
|
|
1334
|
+
getFieldsValue: K,
|
|
1335
|
+
setFieldsValue: j,
|
|
1336
|
+
resetFields: U,
|
|
1337
|
+
validate: se,
|
|
1338
|
+
validateFields: Q,
|
|
1339
|
+
submit: c,
|
|
1340
|
+
scrollToField: le,
|
|
1341
|
+
clearValidate: _e,
|
|
1342
1342
|
updateSchema: fe,
|
|
1343
|
-
appendSchemaByField:
|
|
1344
|
-
removeSchemaByField:
|
|
1345
|
-
setProps:
|
|
1346
|
-
getComponentInstance:
|
|
1343
|
+
appendSchemaByField: ae,
|
|
1344
|
+
removeSchemaByField: pe,
|
|
1345
|
+
setProps: ue,
|
|
1346
|
+
getComponentInstance: de,
|
|
1347
1347
|
getFieldOptions: Pe,
|
|
1348
1348
|
isFieldLoading: Se
|
|
1349
1349
|
};
|
|
1350
1350
|
e({
|
|
1351
|
-
...
|
|
1352
|
-
registerFieldInstance:
|
|
1351
|
+
...xe,
|
|
1352
|
+
registerFieldInstance: we
|
|
1353
1353
|
});
|
|
1354
|
-
const
|
|
1355
|
-
|
|
1356
|
-
},
|
|
1357
|
-
typeof window < "u" && (
|
|
1354
|
+
const me = () => {
|
|
1355
|
+
w.value = [...t.schemas ?? []], W();
|
|
1356
|
+
}, ve = () => {
|
|
1357
|
+
typeof window < "u" && (O.value = window.innerWidth);
|
|
1358
1358
|
};
|
|
1359
|
-
return
|
|
1360
|
-
|
|
1361
|
-
}),
|
|
1362
|
-
typeof window < "u" && window.removeEventListener("resize",
|
|
1363
|
-
}),
|
|
1364
|
-
!
|
|
1365
|
-
}, { deep: !0, immediate: !0 }),
|
|
1359
|
+
return ye(() => {
|
|
1360
|
+
me(), n("register", xe), typeof window < "u" && window.addEventListener("resize", ve);
|
|
1361
|
+
}), ke(() => {
|
|
1362
|
+
typeof window < "u" && window.removeEventListener("resize", ve);
|
|
1363
|
+
}), te(() => M.value, (m) => {
|
|
1364
|
+
!z.value || m === void 0 || X(Z(m), !1);
|
|
1365
|
+
}, { deep: !0, immediate: !0 }), te(() => [t.schemas, t.initialValues], me, { deep: !0 }), { __sfc: !0, props: t, emit: n, slots: l, formRef: a, formWrapRef: r, submitLoading: d, collapsed: h, formModel: v, formRules: k, innerSchemas: w, innerProps: y, fieldInstanceMap: p, BREAKPOINTS: _, getEffectiveSpan: A, getComponentSetting: I, effectiveProps: S, controlledModelValue: M, isControlled: z, currentFormModel: V, formCustomComponents: R, effectiveActionColOptions: f, windowWidth: O, getVisibleSchemaCount: C, hasMoreFields: q, formListeners: L, displaySchemas: Y, shouldShow: G, getColProps: ne, getSlotName: J, resolveSchemaModel: Z, applyFormModel: X, updateFormModel: E, initForm: W, filterByIfShow: g, processFieldMapToTime: u, handleSubmit: c, handleReset: b, setFieldsValue: j, getFieldsValue: K, resetFields: U, handleFieldChange: ee, validate: se, validateFields: Q, scrollToField: le, clearValidate: _e, updateSchema: fe, appendSchemaByField: ae, removeSchemaByField: pe, setProps: ue, registerFieldInstance: we, getComponentInstance: de, getFieldOptions: Pe, isFieldLoading: Se, formActionRef: xe, syncSchemas: me, handleResize: ve, ProFormItem: Ze, FormActions: Xe };
|
|
1366
1366
|
}
|
|
1367
1367
|
});
|
|
1368
1368
|
var Kt = function() {
|
|
1369
1369
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1370
1370
|
return n("div", { ref: "formWrapRef", staticClass: "ecp-pro-form" }, [n("el-form", e._g(e._b({ ref: "formRef", staticClass: "ecp-pro-form", attrs: { model: t.currentFormModel, rules: t.formRules, "label-width": t.effectiveProps.labelWidth, "label-position": t.effectiveProps.labelPosition, size: t.effectiveProps.size, disabled: t.effectiveProps.disabled } }, "el-form", e.$attrs, !1), t.formListeners), [e._t("formHeader"), n("el-row", { style: t.effectiveProps.baseRowStyle, attrs: { gutter: t.effectiveProps.gutter } }, [e._l(t.displaySchemas, function(l) {
|
|
1371
|
-
var a,
|
|
1372
|
-
return [t.shouldShow(l) ? n("el-col", e._b({ key: l.field, attrs: { offset: ((a = l.colProps) == null ? void 0 : a.offset) ?? ((
|
|
1371
|
+
var a, r;
|
|
1372
|
+
return [t.shouldShow(l) ? n("el-col", e._b({ key: l.field, attrs: { offset: ((a = l.colProps) == null ? void 0 : a.offset) ?? ((r = t.effectiveProps.baseColProps) == null ? void 0 : r.offset) ?? 0, "data-field": l.field } }, "el-col", t.getColProps(l), !1), [n(t.ProFormItem, { attrs: { schema: l, "form-model": t.currentFormModel, "form-disabled": t.effectiveProps.disabled, "auto-placeholder": t.effectiveProps.autoSetPlaceholder, "form-action-type": t.formActionRef, colon: t.effectiveProps.colon, "custom-components": t.formCustomComponents, "on-field-change": t.handleFieldChange, "register-field-instance": t.registerFieldInstance } }, [t.slots[t.getSlotName(l)] ? [e._t(t.getSlotName(l), null, { model: t.currentFormModel, schema: l, field: l.field, values: t.currentFormModel })] : e._e()], 2)], 1) : e._e()];
|
|
1373
1373
|
}), t.effectiveProps.showActionButtonGroup ? n("el-col", e._b({ staticClass: "ecp-pro-form_col" }, "el-col", t.hasMoreFields ? { span: 24 } : t.effectiveProps.actionColOptions || { span: 6 }, !1), [n(t.FormActions, { attrs: { "show-action-button-group": t.effectiveProps.showActionButtonGroup, "show-submit-button": t.effectiveProps.showSubmitButton, "show-reset-button": t.effectiveProps.showResetButton, "submit-button-text": t.effectiveProps.submitButtonText, "reset-button-text": t.effectiveProps.resetButtonText, "submit-button-icon": t.effectiveProps.submitButtonIcon, "reset-button-icon": t.effectiveProps.resetButtonIcon, "submit-loading": t.submitLoading, "show-advanced-button": t.effectiveProps.showAdvancedButton, "has-more-fields": t.hasMoreFields, collapsed: t.collapsed, "action-col-options": t.effectiveActionColOptions }, on: { submit: t.handleSubmit, reset: t.handleReset, toggle: function(l) {
|
|
1374
1374
|
t.collapsed = !t.collapsed;
|
|
1375
1375
|
} } }, [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(l) {
|
|
1376
1376
|
t.collapsed = !t.collapsed;
|
|
1377
1377
|
} } }, [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);
|
|
1378
|
-
}, jt = [], qt = /* @__PURE__ */
|
|
1378
|
+
}, jt = [], qt = /* @__PURE__ */ ie(
|
|
1379
1379
|
Lt,
|
|
1380
1380
|
Kt,
|
|
1381
1381
|
jt,
|
|
@@ -1386,86 +1386,86 @@ var Kt = function() {
|
|
|
1386
1386
|
null
|
|
1387
1387
|
);
|
|
1388
1388
|
const Qe = qt.exports;
|
|
1389
|
-
function _n(
|
|
1390
|
-
const e = D(null), n = D(
|
|
1391
|
-
e.value =
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1389
|
+
function _n(s) {
|
|
1390
|
+
const e = D(null), n = D(s ? be(s) : void 0), t = () => s ? be(s) : void 0, l = (R) => {
|
|
1391
|
+
e.value = R;
|
|
1392
|
+
const f = t();
|
|
1393
|
+
f && Object.keys(f).length > 0 && R.setProps(f);
|
|
1394
1394
|
};
|
|
1395
|
-
|
|
1395
|
+
s && te(
|
|
1396
1396
|
() => t(),
|
|
1397
|
-
(
|
|
1398
|
-
n.value =
|
|
1397
|
+
(R) => {
|
|
1398
|
+
n.value = R, R && e.value && e.value.setProps(R);
|
|
1399
1399
|
},
|
|
1400
1400
|
{ deep: !0 }
|
|
1401
1401
|
);
|
|
1402
1402
|
const a = () => {
|
|
1403
|
-
var
|
|
1404
|
-
return ((
|
|
1405
|
-
},
|
|
1406
|
-
var
|
|
1407
|
-
await ((
|
|
1408
|
-
},
|
|
1409
|
-
var
|
|
1410
|
-
await ((
|
|
1411
|
-
},
|
|
1412
|
-
var
|
|
1413
|
-
return ((
|
|
1414
|
-
}, v = (
|
|
1415
|
-
var
|
|
1416
|
-
return ((
|
|
1417
|
-
},
|
|
1418
|
-
var
|
|
1419
|
-
return ((
|
|
1420
|
-
},
|
|
1421
|
-
var
|
|
1422
|
-
return ((
|
|
1423
|
-
},
|
|
1424
|
-
var
|
|
1425
|
-
(
|
|
1426
|
-
}, p = (
|
|
1427
|
-
var
|
|
1428
|
-
return ((
|
|
1429
|
-
}, _ = (
|
|
1430
|
-
var
|
|
1431
|
-
return ((
|
|
1432
|
-
}, A = (
|
|
1433
|
-
var
|
|
1434
|
-
return ((
|
|
1435
|
-
},
|
|
1436
|
-
var
|
|
1437
|
-
n.value = { ...n.value, ...
|
|
1438
|
-
},
|
|
1439
|
-
var
|
|
1440
|
-
return ((
|
|
1403
|
+
var R;
|
|
1404
|
+
return ((R = e.value) == null ? void 0 : R.getFieldsValue()) ?? {};
|
|
1405
|
+
}, r = async (R) => {
|
|
1406
|
+
var f;
|
|
1407
|
+
await ((f = e.value) == null ? void 0 : f.setFieldsValue(R));
|
|
1408
|
+
}, d = async () => {
|
|
1409
|
+
var R;
|
|
1410
|
+
await ((R = e.value) == null ? void 0 : R.resetFields());
|
|
1411
|
+
}, h = (R) => {
|
|
1412
|
+
var f;
|
|
1413
|
+
return ((f = e.value) == null ? void 0 : f.validate(R)) ?? Promise.resolve();
|
|
1414
|
+
}, v = (R) => {
|
|
1415
|
+
var f;
|
|
1416
|
+
return ((f = e.value) == null ? void 0 : f.validateFields(R)) ?? Promise.resolve();
|
|
1417
|
+
}, k = () => {
|
|
1418
|
+
var R;
|
|
1419
|
+
return ((R = e.value) == null ? void 0 : R.submit()) ?? Promise.resolve();
|
|
1420
|
+
}, w = (R, f) => {
|
|
1421
|
+
var O;
|
|
1422
|
+
return ((O = e.value) == null ? void 0 : O.scrollToField(R, f)) ?? Promise.resolve();
|
|
1423
|
+
}, y = (R) => {
|
|
1424
|
+
var f;
|
|
1425
|
+
(f = e.value) == null || f.clearValidate(R);
|
|
1426
|
+
}, p = (R) => {
|
|
1427
|
+
var f;
|
|
1428
|
+
return ((f = e.value) == null ? void 0 : f.updateSchema(R)) ?? Promise.resolve();
|
|
1429
|
+
}, _ = (R, f, O) => {
|
|
1430
|
+
var C;
|
|
1431
|
+
return ((C = e.value) == null ? void 0 : C.appendSchemaByField(R, f, O)) ?? Promise.resolve();
|
|
1432
|
+
}, A = (R) => {
|
|
1433
|
+
var f;
|
|
1434
|
+
return ((f = e.value) == null ? void 0 : f.removeSchemaByField(R)) ?? Promise.resolve();
|
|
1435
|
+
}, I = async (R) => {
|
|
1436
|
+
var f;
|
|
1437
|
+
n.value = { ...n.value, ...R }, await ((f = e.value) == null ? void 0 : f.setProps(R));
|
|
1438
|
+
}, S = (R) => {
|
|
1439
|
+
var f;
|
|
1440
|
+
return ((f = e.value) == null ? void 0 : f.getComponentInstance(R)) ?? null;
|
|
1441
1441
|
};
|
|
1442
|
-
function
|
|
1443
|
-
return e.value ?
|
|
1442
|
+
function M(R, f = !1) {
|
|
1443
|
+
return e.value ? f ? e.value.getFieldOptions(R, !0) : e.value.getFieldOptions(R) : [];
|
|
1444
1444
|
}
|
|
1445
1445
|
return [l, {
|
|
1446
1446
|
register: l,
|
|
1447
1447
|
formAction: e,
|
|
1448
1448
|
getFieldsValue: a,
|
|
1449
|
-
setFieldsValue:
|
|
1450
|
-
resetFields:
|
|
1451
|
-
validate:
|
|
1449
|
+
setFieldsValue: r,
|
|
1450
|
+
resetFields: d,
|
|
1451
|
+
validate: h,
|
|
1452
1452
|
validateFields: v,
|
|
1453
|
-
submit:
|
|
1454
|
-
scrollToField:
|
|
1455
|
-
clearValidate:
|
|
1453
|
+
submit: k,
|
|
1454
|
+
scrollToField: w,
|
|
1455
|
+
clearValidate: y,
|
|
1456
1456
|
updateSchema: p,
|
|
1457
1457
|
appendSchemaByField: _,
|
|
1458
1458
|
removeSchemaByField: A,
|
|
1459
|
-
setProps:
|
|
1460
|
-
getComponentInstance:
|
|
1461
|
-
getFieldOptions:
|
|
1462
|
-
isFieldLoading: (
|
|
1463
|
-
var
|
|
1464
|
-
return ((
|
|
1459
|
+
setProps: I,
|
|
1460
|
+
getComponentInstance: S,
|
|
1461
|
+
getFieldOptions: M,
|
|
1462
|
+
isFieldLoading: (R) => {
|
|
1463
|
+
var f;
|
|
1464
|
+
return ((f = e.value) == null ? void 0 : f.isFieldLoading(R)) ?? !1;
|
|
1465
1465
|
}
|
|
1466
1466
|
}];
|
|
1467
1467
|
}
|
|
1468
|
-
const Ht = /* @__PURE__ */
|
|
1468
|
+
const Ht = /* @__PURE__ */ oe({
|
|
1469
1469
|
__name: "ProDescriptions",
|
|
1470
1470
|
props: {
|
|
1471
1471
|
title: null,
|
|
@@ -1480,8 +1480,8 @@ const Ht = /* @__PURE__ */ te({
|
|
|
1480
1480
|
collapseOptions: { default: () => ({ canExpand: !1, defaultExpand: !0, expandButtonText: "展开", collapseButtonText: "收起", visibleRows: 1 }) }
|
|
1481
1481
|
},
|
|
1482
1482
|
emits: ["register"],
|
|
1483
|
-
setup(
|
|
1484
|
-
const t =
|
|
1483
|
+
setup(s, { expose: e, emit: n }) {
|
|
1484
|
+
const t = s, l = D({}), a = D({}), r = D([]), d = D(typeof window < "u" ? window.innerWidth : 1920), h = D(!0), v = oe({
|
|
1485
1485
|
name: "EcpDescriptionValueRenderer",
|
|
1486
1486
|
props: {
|
|
1487
1487
|
schema: { type: Object, required: !0 },
|
|
@@ -1489,117 +1489,117 @@ const Ht = /* @__PURE__ */ te({
|
|
|
1489
1489
|
record: { type: Object, required: !0 },
|
|
1490
1490
|
emptyText: { type: String, default: "-" }
|
|
1491
1491
|
},
|
|
1492
|
-
setup(
|
|
1492
|
+
setup(g) {
|
|
1493
1493
|
return () => {
|
|
1494
|
-
const
|
|
1495
|
-
const
|
|
1496
|
-
return
|
|
1494
|
+
const u = g.schema, c = g.record, b = g.value, j = (K) => {
|
|
1495
|
+
const U = k(u, K === g.emptyText ? b : K, c), ee = he("span", K);
|
|
1496
|
+
return U ? he("el-tooltip", { props: U }, [ee]) : ee;
|
|
1497
1497
|
};
|
|
1498
|
-
if (
|
|
1499
|
-
const
|
|
1500
|
-
return
|
|
1498
|
+
if (u.render) {
|
|
1499
|
+
const K = u.render(b, c);
|
|
1500
|
+
return K == null || K === "" ? j(g.emptyText) : typeof K == "string" || typeof K == "number" ? j(String(K)) : K;
|
|
1501
1501
|
}
|
|
1502
|
-
return Array.isArray(
|
|
1502
|
+
return Array.isArray(b) ? j(b.length ? b.join(", ") : g.emptyText) : b == null || b === "" ? j(g.emptyText) : j(typeof b == "object" ? JSON.stringify(b) : String(b));
|
|
1503
1503
|
};
|
|
1504
1504
|
}
|
|
1505
|
-
}),
|
|
1506
|
-
const
|
|
1507
|
-
if (!
|
|
1505
|
+
}), k = (g, u, c) => {
|
|
1506
|
+
const b = g.tooltip;
|
|
1507
|
+
if (!b)
|
|
1508
1508
|
return null;
|
|
1509
|
-
const
|
|
1510
|
-
return
|
|
1511
|
-
}, { mergeSettings:
|
|
1512
|
-
if (typeof
|
|
1513
|
-
return Math.max(1,
|
|
1514
|
-
const
|
|
1515
|
-
return
|
|
1516
|
-
}, A =
|
|
1517
|
-
...
|
|
1518
|
-
dataIndex:
|
|
1519
|
-
}))),
|
|
1520
|
-
const
|
|
1521
|
-
let
|
|
1522
|
-
const
|
|
1523
|
-
return
|
|
1524
|
-
const
|
|
1525
|
-
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1528
|
-
}),
|
|
1529
|
-
}),
|
|
1530
|
-
var
|
|
1531
|
-
if (!
|
|
1532
|
-
return
|
|
1533
|
-
const
|
|
1534
|
-
return
|
|
1535
|
-
}),
|
|
1536
|
-
var
|
|
1537
|
-
const
|
|
1538
|
-
return !!
|
|
1539
|
-
}),
|
|
1540
|
-
var
|
|
1509
|
+
const j = typeof b == "function" ? b({ value: u, record: c, schema: g }) : b;
|
|
1510
|
+
return Ee(j, u);
|
|
1511
|
+
}, { mergeSettings: w } = Be(), y = x(() => w("ProDescriptions", { ...t, ...l.value })), p = { xxl: 1920, xl: 1200, lg: 992, md: 768, sm: 576 }, _ = (g, u) => {
|
|
1512
|
+
if (typeof g == "number")
|
|
1513
|
+
return Math.max(1, g);
|
|
1514
|
+
const c = g ?? {};
|
|
1515
|
+
return u >= p.xxl ? c.xxl ?? c.xl ?? c.lg ?? c.md ?? c.sm ?? c.xs ?? 3 : u >= p.xl ? c.xl ?? c.lg ?? c.md ?? c.sm ?? c.xs ?? 3 : u >= p.lg ? c.lg ?? c.md ?? c.sm ?? c.xs ?? 3 : u >= p.md ? c.md ?? c.sm ?? c.xs ?? 3 : u >= p.sm ? c.sm ?? c.xs ?? 2 : c.xs ?? 1;
|
|
1516
|
+
}, A = x(() => _(y.value.column, d.value)), I = x(() => y.value.data ?? a.value ?? {}), S = x(() => (r.value.length ? r.value : y.value.schema ?? []).filter((g) => g.dataIndex || g.field ? typeof g.show == "function" ? g.show(I.value) : g.show !== !1 : !1).map((g) => ({
|
|
1517
|
+
...g,
|
|
1518
|
+
dataIndex: g.dataIndex || g.field || ""
|
|
1519
|
+
}))), M = x(() => {
|
|
1520
|
+
const g = [];
|
|
1521
|
+
let u = { items: [] }, c = 0;
|
|
1522
|
+
const b = A.value;
|
|
1523
|
+
return S.value.forEach((j, K) => {
|
|
1524
|
+
const U = S.value.length - K, ee = Math.max(1, Math.min(j.span ?? 1, b)), se = U === 1 ? b - c || b : ee;
|
|
1525
|
+
c + se > b && (g.push(u), u = { items: [] }, c = 0);
|
|
1526
|
+
const Q = U === 1 && c < b ? Math.max(1, b - c) : se;
|
|
1527
|
+
u.items.push({ ...j, _span: Q }), c += Q, c >= b && (g.push(u), u = { items: [] }, c = 0);
|
|
1528
|
+
}), u.items.length > 0 && g.push(u), g;
|
|
1529
|
+
}), z = x(() => {
|
|
1530
|
+
var u;
|
|
1531
|
+
if (!V.value || h.value)
|
|
1532
|
+
return M.value;
|
|
1533
|
+
const g = Math.max(1, ((u = y.value.collapseOptions) == null ? void 0 : u.visibleRows) ?? 1);
|
|
1534
|
+
return M.value.slice(0, g);
|
|
1535
|
+
}), V = x(() => {
|
|
1536
|
+
var u, c;
|
|
1537
|
+
const g = Math.max(1, ((u = y.value.collapseOptions) == null ? void 0 : u.visibleRows) ?? 1);
|
|
1538
|
+
return !!y.value.useCollapse && !!((c = y.value.collapseOptions) != null && c.canExpand) && M.value.length > g;
|
|
1539
|
+
}), R = x(() => !!y.value.title || !!y.value.helpMessage || V.value), f = x(() => {
|
|
1540
|
+
var g, u;
|
|
1541
1541
|
return {
|
|
1542
|
-
expand: ((
|
|
1543
|
-
collapse: ((
|
|
1542
|
+
expand: ((g = y.value.collapseOptions) == null ? void 0 : g.expandButtonText) ?? "展开",
|
|
1543
|
+
collapse: ((u = y.value.collapseOptions) == null ? void 0 : u.collapseButtonText) ?? "收起"
|
|
1544
1544
|
};
|
|
1545
|
-
}),
|
|
1545
|
+
}), O = x(() => ({
|
|
1546
1546
|
gridTemplateColumns: `repeat(${A.value}, minmax(0, 1fr))`
|
|
1547
|
-
})),
|
|
1548
|
-
gridColumn: `span ${
|
|
1549
|
-
}),
|
|
1550
|
-
minWidth:
|
|
1551
|
-
...
|
|
1552
|
-
}),
|
|
1553
|
-
minWidth:
|
|
1554
|
-
...
|
|
1555
|
-
}),
|
|
1556
|
-
|
|
1557
|
-
},
|
|
1558
|
-
a.value = { ...
|
|
1559
|
-
},
|
|
1560
|
-
l.value = { ...l.value, ...
|
|
1561
|
-
},
|
|
1562
|
-
a.value = { ...a.value, ...
|
|
1563
|
-
},
|
|
1564
|
-
setProps:
|
|
1565
|
-
setData:
|
|
1566
|
-
getData:
|
|
1547
|
+
})), C = (g) => ({
|
|
1548
|
+
gridColumn: `span ${g._span}`
|
|
1549
|
+
}), q = (g) => ({
|
|
1550
|
+
minWidth: g.labelMinWidth ? `${g.labelMinWidth}px` : void 0,
|
|
1551
|
+
...g.labelStyle ?? {}
|
|
1552
|
+
}), L = (g) => ({
|
|
1553
|
+
minWidth: g.contentMinWidth ? `${g.contentMinWidth}px` : void 0,
|
|
1554
|
+
...g.contentStyle ?? {}
|
|
1555
|
+
}), Y = (g) => I.value[g.dataIndex], G = () => {
|
|
1556
|
+
r.value = [...y.value.schema ?? []];
|
|
1557
|
+
}, ne = () => {
|
|
1558
|
+
a.value = { ...y.value.data ?? {} };
|
|
1559
|
+
}, J = async (g) => {
|
|
1560
|
+
l.value = { ...l.value, ...g }, g.schema && (r.value = [...g.schema]), g.data && (a.value = { ...g.data });
|
|
1561
|
+
}, Z = async (g) => {
|
|
1562
|
+
a.value = { ...a.value, ...g }, l.value = { ...l.value, data: a.value };
|
|
1563
|
+
}, X = () => ({ ...y.value.data ?? a.value ?? {} }), E = {
|
|
1564
|
+
setProps: J,
|
|
1565
|
+
setData: Z,
|
|
1566
|
+
getData: X
|
|
1567
1567
|
};
|
|
1568
|
-
e(
|
|
1569
|
-
const
|
|
1570
|
-
typeof window < "u" && (
|
|
1568
|
+
e(E);
|
|
1569
|
+
const W = () => {
|
|
1570
|
+
typeof window < "u" && (d.value = window.innerWidth);
|
|
1571
1571
|
};
|
|
1572
|
-
return
|
|
1573
|
-
var
|
|
1574
|
-
|
|
1575
|
-
}),
|
|
1576
|
-
typeof window < "u" && window.removeEventListener("resize",
|
|
1577
|
-
}),
|
|
1578
|
-
var
|
|
1579
|
-
return (
|
|
1580
|
-
}, (
|
|
1581
|
-
|
|
1582
|
-
}), { __sfc: !0, props: t, emit: n, innerProps: l, innerData: a, innerSchema:
|
|
1572
|
+
return ye(() => {
|
|
1573
|
+
var g;
|
|
1574
|
+
G(), ne(), h.value = ((g = y.value.collapseOptions) == null ? void 0 : g.defaultExpand) !== !1, n("register", E), typeof window < "u" && window.addEventListener("resize", W);
|
|
1575
|
+
}), ke(() => {
|
|
1576
|
+
typeof window < "u" && window.removeEventListener("resize", W);
|
|
1577
|
+
}), te(() => y.value.schema, G, { deep: !0 }), te(() => y.value.data, ne, { deep: !0 }), te(() => {
|
|
1578
|
+
var g;
|
|
1579
|
+
return (g = y.value.collapseOptions) == null ? void 0 : g.defaultExpand;
|
|
1580
|
+
}, (g) => {
|
|
1581
|
+
g !== void 0 && (h.value = g);
|
|
1582
|
+
}), { __sfc: !0, props: t, emit: n, innerProps: l, innerData: a, innerSchema: r, windowWidth: d, expanded: h, DescriptionValueRenderer: v, normalizeTooltip: k, mergeSettings: w, effectiveProps: y, breakpoints: p, resolveColumn: _, currentColumn: A, effectiveData: I, visibleSchema: S, normalizedRows: M, renderedRows: z, showCollapseButton: V, showHeader: R, collapseButtonText: f, bodyStyle: O, getItemStyle: C, getLabelStyle: q, getContentStyle: L, getItemValue: Y, syncSchema: G, syncData: ne, setProps: J, setData: Z, getData: X, descriptionAction: E, updateWindowWidth: W };
|
|
1583
1583
|
}
|
|
1584
1584
|
});
|
|
1585
1585
|
var Gt = function() {
|
|
1586
1586
|
var l;
|
|
1587
1587
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1588
|
-
return n("div", { staticClass: "ecp-pro-descriptions" }, [t.showHeader ? n("div", { staticClass: "ecp-pro-descriptions__header" }, [n("div", { staticClass: "ecp-pro-descriptions__title-wrap" }, [t.effectiveProps.title ? n("span", { staticClass: "ecp-pro-descriptions__title" }, [e._v(e._s(t.effectiveProps.title))]) : e._e(), t.effectiveProps.helpMessage ? n("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [n("template", { slot: "content" }, [Array.isArray(t.effectiveProps.helpMessage) ? n("span", e._l(t.effectiveProps.helpMessage, function(a,
|
|
1589
|
-
return n("div", { key:
|
|
1590
|
-
}), 0) : n("span", [e._v(e._s(t.effectiveProps.helpMessage))])]), n("i", { staticClass: "el-icon-question ecp-pro-descriptions__help" })], 2) : e._e(), (l = t.effectiveProps.collapseOptions) != null && l.helpMessage ? n("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [n("template", { slot: "content" }, [Array.isArray(t.effectiveProps.collapseOptions.helpMessage) ? n("span", e._l(t.effectiveProps.collapseOptions.helpMessage, function(a,
|
|
1591
|
-
return n("div", { key: `collapse-${
|
|
1588
|
+
return n("div", { staticClass: "ecp-pro-descriptions" }, [t.showHeader ? n("div", { staticClass: "ecp-pro-descriptions__header" }, [n("div", { staticClass: "ecp-pro-descriptions__title-wrap" }, [t.effectiveProps.title ? n("span", { staticClass: "ecp-pro-descriptions__title" }, [e._v(e._s(t.effectiveProps.title))]) : e._e(), t.effectiveProps.helpMessage ? n("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [n("template", { slot: "content" }, [Array.isArray(t.effectiveProps.helpMessage) ? n("span", e._l(t.effectiveProps.helpMessage, function(a, r) {
|
|
1589
|
+
return n("div", { key: r }, [e._v(e._s(a))]);
|
|
1590
|
+
}), 0) : n("span", [e._v(e._s(t.effectiveProps.helpMessage))])]), n("i", { staticClass: "el-icon-question ecp-pro-descriptions__help" })], 2) : e._e(), (l = t.effectiveProps.collapseOptions) != null && l.helpMessage ? n("el-tooltip", { attrs: { placement: "top", effect: "dark" } }, [n("template", { slot: "content" }, [Array.isArray(t.effectiveProps.collapseOptions.helpMessage) ? n("span", e._l(t.effectiveProps.collapseOptions.helpMessage, function(a, r) {
|
|
1591
|
+
return n("div", { key: `collapse-${r}` }, [e._v(e._s(a))]);
|
|
1592
1592
|
}), 0) : n("span", [e._v(e._s(t.effectiveProps.collapseOptions.helpMessage))])]), n("i", { staticClass: "el-icon-info ecp-pro-descriptions__help" })], 2) : e._e()], 1), t.showCollapseButton ? n("el-button", { staticClass: "ecp-pro-descriptions__toggle", attrs: { type: "text" }, on: { click: function(a) {
|
|
1593
1593
|
t.expanded = !t.expanded;
|
|
1594
1594
|
} } }, [e._v(" " + e._s(t.expanded ? t.collapseButtonText.collapse : t.collapseButtonText.expand) + " "), n("i", { staticClass: "el-icon-arrow-down", class: t.expanded ? "is-expanded" : "" })]) : e._e()], 1) : e._e(), n("div", e._b({ staticClass: "ecp-pro-descriptions__body", class: [
|
|
1595
1595
|
`is-${t.effectiveProps.size}`,
|
|
1596
1596
|
{ "is-bordered": t.effectiveProps.bordered, "is-collapsed": t.showCollapseButton && !t.expanded }
|
|
1597
|
-
], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(a,
|
|
1598
|
-
return [e._l(a.items, function(
|
|
1599
|
-
return [n("div", { key: `${
|
|
1597
|
+
], style: t.bodyStyle }, "div", e.$attrs, !1), [e._l(t.renderedRows, function(a, r) {
|
|
1598
|
+
return [e._l(a.items, function(d) {
|
|
1599
|
+
return [n("div", { key: `${r}-${d.dataIndex || d.field}`, staticClass: "ecp-pro-descriptions__item", style: t.getItemStyle(d) }, [n("div", { staticClass: "ecp-pro-descriptions__label", style: t.getLabelStyle(d) }, [e._v(" " + e._s(d.label) + " ")]), n("div", { staticClass: "ecp-pro-descriptions__content", style: t.getContentStyle(d) }, [e.$scopedSlots[d.slot || d.dataIndex] ? e._t(d.slot || d.dataIndex, null, { value: t.getItemValue(d), record: t.effectiveData, schema: d }) : n(t.DescriptionValueRenderer, { attrs: { schema: d, value: t.getItemValue(d), record: t.effectiveData, "empty-text": t.effectiveProps.emptyText || "-" } })], 2)])];
|
|
1600
1600
|
})];
|
|
1601
1601
|
})], 2)]);
|
|
1602
|
-
}, Ut = [], Jt = /* @__PURE__ */
|
|
1602
|
+
}, Ut = [], Jt = /* @__PURE__ */ ie(
|
|
1603
1603
|
Ht,
|
|
1604
1604
|
Gt,
|
|
1605
1605
|
Ut,
|
|
@@ -1610,30 +1610,30 @@ var Gt = function() {
|
|
|
1610
1610
|
null
|
|
1611
1611
|
);
|
|
1612
1612
|
const Ye = Jt.exports;
|
|
1613
|
-
function gn(
|
|
1614
|
-
const e = D(null), n = () =>
|
|
1615
|
-
const
|
|
1616
|
-
if (!
|
|
1613
|
+
function gn(s) {
|
|
1614
|
+
const e = D(null), n = () => s ? be(s) : void 0, t = () => {
|
|
1615
|
+
const r = be(e);
|
|
1616
|
+
if (!r)
|
|
1617
1617
|
throw new Error("ProDescriptions instance has not been registered");
|
|
1618
|
-
return
|
|
1619
|
-
}, l = (
|
|
1620
|
-
e.value =
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1618
|
+
return r;
|
|
1619
|
+
}, l = (r) => {
|
|
1620
|
+
e.value = r;
|
|
1621
|
+
const d = n();
|
|
1622
|
+
d && Object.keys(d).length > 0 && r.setProps(d);
|
|
1623
1623
|
};
|
|
1624
|
-
return
|
|
1624
|
+
return s && te(
|
|
1625
1625
|
() => n(),
|
|
1626
|
-
(
|
|
1627
|
-
|
|
1626
|
+
(r) => {
|
|
1627
|
+
r && e.value && e.value.setProps(r);
|
|
1628
1628
|
},
|
|
1629
1629
|
{ deep: !0 }
|
|
1630
1630
|
), [l, {
|
|
1631
|
-
setProps: (
|
|
1632
|
-
setData: (
|
|
1631
|
+
setProps: (r) => t().setProps(r),
|
|
1632
|
+
setData: (r) => t().setData(r),
|
|
1633
1633
|
getData: () => t().getData()
|
|
1634
1634
|
}];
|
|
1635
1635
|
}
|
|
1636
|
-
const Zt = /* @__PURE__ */
|
|
1636
|
+
const Zt = /* @__PURE__ */ oe({
|
|
1637
1637
|
__name: "CollapseContainer",
|
|
1638
1638
|
props: {
|
|
1639
1639
|
title: null,
|
|
@@ -1654,33 +1654,33 @@ const Zt = /* @__PURE__ */ te({
|
|
|
1654
1654
|
contentStyle: { default: () => ({}) }
|
|
1655
1655
|
},
|
|
1656
1656
|
emits: ["update:expanded", "change", "collapse", "expand"],
|
|
1657
|
-
setup(
|
|
1658
|
-
const t =
|
|
1659
|
-
const
|
|
1660
|
-
return delete
|
|
1661
|
-
...
|
|
1662
|
-
class:
|
|
1663
|
-
style:
|
|
1657
|
+
setup(s, { expose: e, emit: n }) {
|
|
1658
|
+
const t = s, l = Ce(), { mergeSettings: a } = Be(), r = D(t.expanded ?? t.defaultExpand), d = x(() => a("CollapseContainer", { ...t })), h = x(() => d.value.canExpand ?? d.value.canExpan ?? !0), v = x(() => d.value.expanded !== void 0), k = x(() => v.value ? !!d.value.expanded : r.value), w = x(() => !!l.title || !!l.action || !!d.value.title || !!d.value.helpMessage || h.value), y = x(() => h.value), p = x(() => {
|
|
1659
|
+
const M = d.value.wrapperProps ?? {}, z = M.class, V = M.style, R = { ...M };
|
|
1660
|
+
return delete R.class, delete R.style, {
|
|
1661
|
+
...R,
|
|
1662
|
+
class: z,
|
|
1663
|
+
style: V
|
|
1664
1664
|
};
|
|
1665
1665
|
}), _ = () => {
|
|
1666
|
-
!
|
|
1666
|
+
!d.value.triggerWindowResize || typeof window > "u" || window.setTimeout(() => {
|
|
1667
1667
|
window.dispatchEvent(new Event("resize"));
|
|
1668
1668
|
}, 220);
|
|
1669
|
-
}, A = (
|
|
1670
|
-
v.value || (
|
|
1671
|
-
},
|
|
1672
|
-
|
|
1673
|
-
},
|
|
1674
|
-
|
|
1669
|
+
}, A = (M) => {
|
|
1670
|
+
v.value || (r.value = M), n("update:expanded", M), n("change", M), n(M ? "expand" : "collapse"), _();
|
|
1671
|
+
}, I = () => {
|
|
1672
|
+
h.value && A(!k.value);
|
|
1673
|
+
}, S = () => {
|
|
1674
|
+
y.value && I();
|
|
1675
1675
|
};
|
|
1676
|
-
return
|
|
1677
|
-
|
|
1678
|
-
}),
|
|
1679
|
-
t.expanded === void 0 && (
|
|
1676
|
+
return te(() => t.expanded, (M) => {
|
|
1677
|
+
M !== void 0 && (r.value = M);
|
|
1678
|
+
}), te(() => t.defaultExpand, (M) => {
|
|
1679
|
+
t.expanded === void 0 && (r.value = M);
|
|
1680
1680
|
}), e({
|
|
1681
1681
|
setExpanded: A,
|
|
1682
|
-
toggleExpand:
|
|
1683
|
-
}), { __sfc: !0, props: t, emit: n, slots: l, mergeSettings: a, innerExpanded:
|
|
1682
|
+
toggleExpand: I
|
|
1683
|
+
}), { __sfc: !0, props: t, emit: n, slots: l, mergeSettings: a, innerExpanded: r, effectiveProps: d, resolvedCanExpan: h, isControlled: v, mergedExpanded: k, showHeader: w, canToggleByHeader: y, wrapperProps: p, triggerWindowResize: _, setExpanded: A, toggleExpand: I, handleHeaderClick: S };
|
|
1684
1684
|
}
|
|
1685
1685
|
});
|
|
1686
1686
|
var Xt = function() {
|
|
@@ -1698,7 +1698,7 @@ var Xt = function() {
|
|
|
1698
1698
|
} } }, [e._t("action"), t.resolvedCanExpan ? n("el-button", { staticClass: "ecp-collapse-container__toggle", attrs: { type: "text" }, on: { click: function(l) {
|
|
1699
1699
|
return l.stopPropagation(), t.toggleExpand.apply(null, arguments);
|
|
1700
1700
|
} } }, [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);
|
|
1701
|
-
}, Qt = [], Yt = /* @__PURE__ */
|
|
1701
|
+
}, Qt = [], Yt = /* @__PURE__ */ ie(
|
|
1702
1702
|
Zt,
|
|
1703
1703
|
Xt,
|
|
1704
1704
|
Qt,
|
|
@@ -1709,276 +1709,297 @@ var Xt = function() {
|
|
|
1709
1709
|
null
|
|
1710
1710
|
);
|
|
1711
1711
|
const et = Yt.exports;
|
|
1712
|
-
function en(
|
|
1713
|
-
const { props: e, emit: n, emitAddRow: t, emitRemoveRow: l } =
|
|
1714
|
-
a.value =
|
|
1715
|
-
},
|
|
1716
|
-
function p(
|
|
1717
|
-
return `r-${
|
|
1712
|
+
function en(s) {
|
|
1713
|
+
const { props: e, emit: n, emitAddRow: t, emitRemoveRow: l } = s, a = D(null), r = (u) => {
|
|
1714
|
+
a.value = u;
|
|
1715
|
+
}, d = D(null), h = x(() => e.modelValue), v = x(() => h.value !== void 0), k = x(() => v.value ? h.value ?? [] : []), w = x(() => ({ rows: k.value })), y = x(() => k.value.map((u, c) => ({ ...u, _index: c })));
|
|
1716
|
+
function p(u) {
|
|
1717
|
+
return `r-${u._index}`;
|
|
1718
1718
|
}
|
|
1719
1719
|
function _() {
|
|
1720
|
-
return JSON.parse(JSON.stringify(
|
|
1720
|
+
return JSON.parse(JSON.stringify(k.value));
|
|
1721
1721
|
}
|
|
1722
1722
|
function A() {
|
|
1723
|
-
const
|
|
1724
|
-
for (const
|
|
1725
|
-
if (
|
|
1726
|
-
for (const
|
|
1727
|
-
|
|
1723
|
+
const u = {};
|
|
1724
|
+
for (const c of e.columns)
|
|
1725
|
+
if (c.children && c.children.length > 0)
|
|
1726
|
+
for (const b of c.children)
|
|
1727
|
+
u[b.key] = "";
|
|
1728
1728
|
else
|
|
1729
|
-
|
|
1730
|
-
return
|
|
1729
|
+
u[c.key] = "";
|
|
1730
|
+
return u;
|
|
1731
1731
|
}
|
|
1732
|
-
function
|
|
1733
|
-
n("update:modelValue",
|
|
1732
|
+
function I(u) {
|
|
1733
|
+
n("update:modelValue", u);
|
|
1734
1734
|
}
|
|
1735
|
-
function
|
|
1736
|
-
return
|
|
1735
|
+
function S(u) {
|
|
1736
|
+
return k.value[u._index] ?? {};
|
|
1737
1737
|
}
|
|
1738
|
-
function
|
|
1739
|
-
if (
|
|
1740
|
-
const
|
|
1741
|
-
return
|
|
1738
|
+
function M(u, c, b) {
|
|
1739
|
+
if (b) {
|
|
1740
|
+
const j = S(u)[c.key];
|
|
1741
|
+
return j && typeof j == "object" ? j[b] ?? "" : S(u)[b] ?? "";
|
|
1742
1742
|
}
|
|
1743
|
-
return
|
|
1743
|
+
return S(u)[c.key] ?? "";
|
|
1744
1744
|
}
|
|
1745
|
-
function
|
|
1746
|
-
const
|
|
1747
|
-
if (
|
|
1748
|
-
const
|
|
1749
|
-
if (
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1745
|
+
function z(u, c, b, j) {
|
|
1746
|
+
const K = _(), U = { ...K[u._index] };
|
|
1747
|
+
if (b) {
|
|
1748
|
+
const ee = U[c.key];
|
|
1749
|
+
if (ee && typeof ee == "object") {
|
|
1750
|
+
const se = { ...ee };
|
|
1751
|
+
se[b] = j, U[c.key] = se;
|
|
1752
1752
|
} else
|
|
1753
|
-
|
|
1753
|
+
U[b] = j;
|
|
1754
1754
|
} else
|
|
1755
|
-
|
|
1756
|
-
|
|
1755
|
+
U[c.key] = j;
|
|
1756
|
+
K[u._index] = U, I(K);
|
|
1757
1757
|
}
|
|
1758
|
-
function
|
|
1758
|
+
function V() {
|
|
1759
1759
|
t == null || t();
|
|
1760
|
-
const
|
|
1761
|
-
|
|
1760
|
+
const u = _();
|
|
1761
|
+
u.push(A()), I(u);
|
|
1762
|
+
}
|
|
1763
|
+
function R(u) {
|
|
1764
|
+
if (!C.value)
|
|
1765
|
+
return;
|
|
1766
|
+
l == null || l(u);
|
|
1767
|
+
const c = _();
|
|
1768
|
+
c.splice(u, 1), I(c);
|
|
1762
1769
|
}
|
|
1763
|
-
function
|
|
1764
|
-
|
|
1770
|
+
function f(u) {
|
|
1771
|
+
return k.value[u] ?? {};
|
|
1772
|
+
}
|
|
1773
|
+
function O(u, c) {
|
|
1774
|
+
if (u < 0 || u >= k.value.length)
|
|
1765
1775
|
return;
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
i.splice(C, 1), O(i);
|
|
1776
|
+
const b = _();
|
|
1777
|
+
b[u] = c, I(b);
|
|
1769
1778
|
}
|
|
1770
|
-
const
|
|
1771
|
-
function
|
|
1772
|
-
return
|
|
1779
|
+
const C = x(() => k.value.length > (e.minRows ?? 0));
|
|
1780
|
+
function q(u, c, b) {
|
|
1781
|
+
return b ? `rows.${u._index}.${b}` : `rows.${u._index}.${c.key}`;
|
|
1773
1782
|
}
|
|
1774
|
-
const
|
|
1775
|
-
function
|
|
1776
|
-
return JSON.stringify(
|
|
1777
|
-
if (
|
|
1778
|
-
return String(
|
|
1779
|
-
const
|
|
1783
|
+
const L = {};
|
|
1784
|
+
function Y(u) {
|
|
1785
|
+
return JSON.stringify(u.map((c) => {
|
|
1786
|
+
if (c == null || typeof c != "object")
|
|
1787
|
+
return String(c);
|
|
1788
|
+
const b = c;
|
|
1780
1789
|
return {
|
|
1781
|
-
required:
|
|
1782
|
-
type:
|
|
1783
|
-
message:
|
|
1784
|
-
pattern: String(
|
|
1785
|
-
min:
|
|
1786
|
-
max:
|
|
1787
|
-
trigger: Array.isArray(
|
|
1788
|
-
hasValidator: typeof
|
|
1789
|
-
hasAsyncValidator: typeof
|
|
1790
|
+
required: b.required,
|
|
1791
|
+
type: b.type,
|
|
1792
|
+
message: b.message,
|
|
1793
|
+
pattern: String(b.pattern ?? ""),
|
|
1794
|
+
min: b.min,
|
|
1795
|
+
max: b.max,
|
|
1796
|
+
trigger: Array.isArray(b.trigger) ? [...b.trigger] : b.trigger,
|
|
1797
|
+
hasValidator: typeof b.validator == "function",
|
|
1798
|
+
hasAsyncValidator: typeof b.asyncValidator == "function"
|
|
1790
1799
|
};
|
|
1791
1800
|
}));
|
|
1792
1801
|
}
|
|
1793
|
-
const
|
|
1794
|
-
const
|
|
1795
|
-
{ required: !0, message: `请输入${
|
|
1802
|
+
const G = x(() => {
|
|
1803
|
+
const u = (K) => [
|
|
1804
|
+
{ required: !0, message: `请输入${K}`, trigger: "change" }
|
|
1796
1805
|
];
|
|
1797
|
-
let
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1800
|
-
for (const
|
|
1801
|
-
const
|
|
1802
|
-
const
|
|
1803
|
-
let
|
|
1804
|
-
"dynamicRules" in
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1806
|
+
let c = !1;
|
|
1807
|
+
const b = {};
|
|
1808
|
+
k.value.forEach((K, U) => {
|
|
1809
|
+
for (const ee of e.columns) {
|
|
1810
|
+
const se = (Q, le, _e) => {
|
|
1811
|
+
const fe = `rows.${U}.${Q}`;
|
|
1812
|
+
let ae = [];
|
|
1813
|
+
"dynamicRules" in le && le.dynamicRules !== void 0 ? ae = typeof le.dynamicRules == "function" ? le.dynamicRules({ row: K, value: _e, column: le }) : le.dynamicRules : "rules" in le && le.rules !== void 0 ? ae = le.rules : le.required && (ae = u(le.title));
|
|
1814
|
+
const pe = Y(ae), ue = L[fe], de = (ue == null ? void 0 : ue.__sig) === pe && ue ? ue : ae;
|
|
1815
|
+
de.__sig = pe, b[fe] = de, de !== ue && (c = !0);
|
|
1807
1816
|
};
|
|
1808
|
-
if (
|
|
1809
|
-
for (const
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1817
|
+
if (ee.children && ee.children.length > 0)
|
|
1818
|
+
for (const Q of ee.children) {
|
|
1819
|
+
const le = M({ _index: U }, ee, Q.key);
|
|
1820
|
+
se(Q.key, Q, le);
|
|
1812
1821
|
}
|
|
1813
1822
|
else {
|
|
1814
|
-
const
|
|
1815
|
-
|
|
1823
|
+
const Q = M({ _index: U }, ee);
|
|
1824
|
+
se(ee.key, ee, Q);
|
|
1816
1825
|
}
|
|
1817
1826
|
}
|
|
1818
1827
|
});
|
|
1819
|
-
const
|
|
1820
|
-
for (const
|
|
1821
|
-
const
|
|
1822
|
-
|
|
1828
|
+
const j = e.rules || {};
|
|
1829
|
+
for (const K of Object.keys(j)) {
|
|
1830
|
+
const U = j[K];
|
|
1831
|
+
b[K] = U, U !== L[K] && (c = !0);
|
|
1823
1832
|
}
|
|
1824
|
-
return (
|
|
1825
|
-
delete
|
|
1826
|
-
}), Object.assign(
|
|
1833
|
+
return (c || Object.keys(b).length !== Object.keys(L).length) && (Object.keys(L).forEach((K) => {
|
|
1834
|
+
delete L[K];
|
|
1835
|
+
}), Object.assign(L, b)), L;
|
|
1827
1836
|
});
|
|
1828
|
-
function
|
|
1829
|
-
return new Promise((
|
|
1830
|
-
const
|
|
1831
|
-
if (!
|
|
1832
|
-
|
|
1837
|
+
function ne() {
|
|
1838
|
+
return new Promise((u) => {
|
|
1839
|
+
const c = d.value;
|
|
1840
|
+
if (!c || typeof c.validate != "function") {
|
|
1841
|
+
u(!0);
|
|
1833
1842
|
return;
|
|
1834
1843
|
}
|
|
1835
|
-
|
|
1844
|
+
c.validate((b) => u(b));
|
|
1836
1845
|
});
|
|
1837
1846
|
}
|
|
1838
|
-
function J(
|
|
1839
|
-
var
|
|
1840
|
-
(
|
|
1847
|
+
function J(u) {
|
|
1848
|
+
var c, b;
|
|
1849
|
+
(b = (c = d.value) == null ? void 0 : c.clearValidate) == null || b.call(c, u);
|
|
1841
1850
|
}
|
|
1842
|
-
function
|
|
1843
|
-
return
|
|
1851
|
+
function Z(u) {
|
|
1852
|
+
return u.component === "formatted-number" ? "ecp-formatted-number-input" : "el-input";
|
|
1844
1853
|
}
|
|
1845
|
-
function
|
|
1846
|
-
const
|
|
1847
|
-
for (const [
|
|
1848
|
-
/^on[A-Za-z]/.test(
|
|
1849
|
-
return
|
|
1854
|
+
function X(u) {
|
|
1855
|
+
const c = u.componentProps || {}, b = {};
|
|
1856
|
+
for (const [j, K] of Object.entries(c))
|
|
1857
|
+
/^on[A-Za-z]/.test(j) && typeof K == "function" || (b[j] = K);
|
|
1858
|
+
return u.component === "formatted-number" ? { integerDigits: 5, decimalPlaces: 6, rounding: "round", inputLimit: !0, ...b } : b;
|
|
1850
1859
|
}
|
|
1851
|
-
function
|
|
1852
|
-
return (
|
|
1860
|
+
function E(u, c, b) {
|
|
1861
|
+
return (j) => z(u.row, c, b, j);
|
|
1853
1862
|
}
|
|
1854
|
-
const
|
|
1855
|
-
const
|
|
1856
|
-
for (const
|
|
1857
|
-
if (
|
|
1858
|
-
for (const
|
|
1859
|
-
|
|
1863
|
+
const W = x(() => {
|
|
1864
|
+
const u = [];
|
|
1865
|
+
for (const c of e.columns)
|
|
1866
|
+
if (c.children && c.children.length > 0)
|
|
1867
|
+
for (const b of c.children)
|
|
1868
|
+
u.push(`${c.key}.${b.key}`);
|
|
1860
1869
|
else
|
|
1861
|
-
|
|
1862
|
-
return
|
|
1870
|
+
c.hideInTable || u.push(c.key);
|
|
1871
|
+
return u;
|
|
1863
1872
|
});
|
|
1864
1873
|
return {
|
|
1865
1874
|
// 注册
|
|
1866
|
-
register:
|
|
1875
|
+
register: r,
|
|
1867
1876
|
// el-form 绑定(formModelRef 包装了数组,满足 el-form :model Object 类型要求)
|
|
1868
|
-
formModelRef:
|
|
1869
|
-
currentModelValue:
|
|
1870
|
-
mergedRules:
|
|
1877
|
+
formModelRef: w,
|
|
1878
|
+
currentModelValue: k,
|
|
1879
|
+
mergedRules: G,
|
|
1871
1880
|
// el-table 绑定
|
|
1872
|
-
tableRows:
|
|
1881
|
+
tableRows: y,
|
|
1873
1882
|
rowKeyFn: p,
|
|
1874
1883
|
spanMethodAdapter: ({
|
|
1875
|
-
rowIndex:
|
|
1876
|
-
column:
|
|
1877
|
-
columnIndex:
|
|
1878
|
-
row:
|
|
1884
|
+
rowIndex: u,
|
|
1885
|
+
column: c,
|
|
1886
|
+
columnIndex: b,
|
|
1887
|
+
row: j
|
|
1879
1888
|
}) => {
|
|
1880
1889
|
if (!e.spanMethod)
|
|
1881
1890
|
return;
|
|
1882
|
-
const
|
|
1891
|
+
const K = W.value[b];
|
|
1883
1892
|
return e.spanMethod({
|
|
1884
|
-
row:
|
|
1885
|
-
column: { ...
|
|
1886
|
-
rowIndex:
|
|
1887
|
-
columnIndex:
|
|
1893
|
+
row: j,
|
|
1894
|
+
column: { ...c, property: K ?? c.property },
|
|
1895
|
+
rowIndex: u,
|
|
1896
|
+
columnIndex: b
|
|
1888
1897
|
});
|
|
1889
1898
|
},
|
|
1890
|
-
allLeafColumnKeys:
|
|
1899
|
+
allLeafColumnKeys: W,
|
|
1891
1900
|
// ref
|
|
1892
|
-
formRef:
|
|
1893
|
-
getFormRef: () =>
|
|
1901
|
+
formRef: d,
|
|
1902
|
+
getFormRef: () => d.value,
|
|
1894
1903
|
// 单元格渲染
|
|
1895
|
-
cellComponent:
|
|
1896
|
-
cellBind:
|
|
1897
|
-
slotUpdateHandler:
|
|
1898
|
-
getCellProp:
|
|
1904
|
+
cellComponent: Z,
|
|
1905
|
+
cellBind: X,
|
|
1906
|
+
slotUpdateHandler: E,
|
|
1907
|
+
getCellProp: q,
|
|
1899
1908
|
// 单元格值读写
|
|
1900
|
-
getCellValue:
|
|
1901
|
-
setCellValue:
|
|
1909
|
+
getCellValue: M,
|
|
1910
|
+
setCellValue: z,
|
|
1902
1911
|
// 行操作
|
|
1903
|
-
handleAddRow:
|
|
1904
|
-
handleRemoveRow:
|
|
1912
|
+
handleAddRow: V,
|
|
1913
|
+
handleRemoveRow: R,
|
|
1914
|
+
// 行读写
|
|
1915
|
+
getRow: f,
|
|
1916
|
+
setRow: O,
|
|
1905
1917
|
// el-form 实例方法
|
|
1906
|
-
validate:
|
|
1918
|
+
validate: ne,
|
|
1907
1919
|
clearValidate: J
|
|
1908
1920
|
};
|
|
1909
1921
|
}
|
|
1910
|
-
const tn = /* @__PURE__ */
|
|
1922
|
+
const tn = /* @__PURE__ */ oe({
|
|
1911
1923
|
__name: "CellEditor",
|
|
1912
1924
|
props: {
|
|
1913
1925
|
col: null,
|
|
1914
1926
|
value: null,
|
|
1915
1927
|
row: null,
|
|
1928
|
+
index: null,
|
|
1916
1929
|
size: null,
|
|
1917
1930
|
placeholder: null,
|
|
1918
|
-
|
|
1931
|
+
formActionType: null
|
|
1919
1932
|
},
|
|
1920
1933
|
emits: ["update"],
|
|
1921
|
-
setup(
|
|
1922
|
-
const n =
|
|
1923
|
-
const
|
|
1924
|
-
return Array.isArray(
|
|
1925
|
-
}), l =
|
|
1926
|
-
const
|
|
1934
|
+
setup(s, { emit: e }) {
|
|
1935
|
+
const n = s, t = x(() => {
|
|
1936
|
+
const k = (typeof n.col.componentProps == "function" ? {} : n.col.componentProps ?? {}).options;
|
|
1937
|
+
return Array.isArray(k) ? k : [];
|
|
1938
|
+
}), l = x(() => {
|
|
1939
|
+
const v = {
|
|
1927
1940
|
input: "el-input",
|
|
1928
1941
|
"input-number": "el-input-number",
|
|
1929
1942
|
"date-picker": "el-date-picker",
|
|
1930
1943
|
switch: "el-switch",
|
|
1931
1944
|
cascader: "el-cascader"
|
|
1932
1945
|
};
|
|
1933
|
-
return n.col.component === "formatted-number" ? Ae :
|
|
1934
|
-
}), a =
|
|
1935
|
-
let
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1946
|
+
return n.col.component === "formatted-number" ? Ae : v[n.col.component] || "el-input";
|
|
1947
|
+
}), a = x(() => {
|
|
1948
|
+
let v = {};
|
|
1949
|
+
if (typeof n.col.componentProps == "function") {
|
|
1950
|
+
const y = n.row ?? {}, p = n.formActionType;
|
|
1951
|
+
v = n.col.componentProps({
|
|
1952
|
+
row: y,
|
|
1953
|
+
value: n.value,
|
|
1954
|
+
index: n.index,
|
|
1955
|
+
column: n.col,
|
|
1956
|
+
formActionType: p
|
|
1957
|
+
});
|
|
1958
|
+
} else
|
|
1959
|
+
v = n.col.componentProps ?? {};
|
|
1960
|
+
const k = {}, w = {};
|
|
1961
|
+
for (const [y, p] of Object.entries(v))
|
|
1962
|
+
if (/^on[A-Za-z]/.test(y) && typeof p == "function") {
|
|
1963
|
+
const _ = y[2].toLowerCase() + y.slice(3);
|
|
1964
|
+
w[_] = p;
|
|
1965
|
+
} else
|
|
1966
|
+
k[y] = p;
|
|
1967
|
+
return { bind: k, userEvents: w };
|
|
1968
|
+
}), r = x(() => {
|
|
1969
|
+
n.value, n.row, n.formActionType;
|
|
1970
|
+
const v = { size: n.size, ...a.value.bind };
|
|
1941
1971
|
if (n.col.component === "formatted-number")
|
|
1942
|
-
return { integerDigits: 5, decimalPlaces: 6, rounding: "round", inputLimit: !0, ...
|
|
1972
|
+
return { integerDigits: 5, decimalPlaces: 6, rounding: "round", inputLimit: !0, ...v };
|
|
1943
1973
|
if (["select", "checkbox", "radio"].includes(n.col.component)) {
|
|
1944
|
-
const { options:
|
|
1945
|
-
return
|
|
1974
|
+
const { options: k, ...w } = v;
|
|
1975
|
+
return w;
|
|
1946
1976
|
}
|
|
1947
|
-
return
|
|
1948
|
-
}),
|
|
1949
|
-
|
|
1950
|
-
const
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
}
|
|
1958
|
-
return g;
|
|
1959
|
-
});
|
|
1960
|
-
return { __sfc: !0, props: n, emit: e, options: t, cellComp: l, cellBind: a, cellEvents: s, mergedEvents: (...f) => {
|
|
1961
|
-
const v = {};
|
|
1962
|
-
for (const F of f) {
|
|
1963
|
-
const g = s.value[F];
|
|
1964
|
-
v[F] = (b) => {
|
|
1965
|
-
g && g(b), e("update", F === "clear" ? void 0 : b);
|
|
1977
|
+
return v;
|
|
1978
|
+
}), d = x(() => (n.value, n.row, n.formActionType, a.value.userEvents));
|
|
1979
|
+
return { __sfc: !0, props: n, emit: e, options: t, cellComp: l, componentPropsResult: a, cellBind: r, cellEvents: d, mergedEvents: (...v) => {
|
|
1980
|
+
const k = {};
|
|
1981
|
+
for (const w of v) {
|
|
1982
|
+
const y = d.value[w];
|
|
1983
|
+
k[w] = (p) => {
|
|
1984
|
+
e("update", w === "clear" ? void 0 : p), De(() => {
|
|
1985
|
+
y && y(p);
|
|
1986
|
+
});
|
|
1966
1987
|
};
|
|
1967
1988
|
}
|
|
1968
|
-
return
|
|
1989
|
+
return k;
|
|
1969
1990
|
}, ApiSelect: Ue, TreeSelect: Je };
|
|
1970
1991
|
}
|
|
1971
1992
|
});
|
|
1972
1993
|
var nn = function() {
|
|
1973
1994
|
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
1974
|
-
return e.col.component === "select" ? n("el-select", e._g(e._b({ attrs: { value: e.value, placeholder: e.placeholder } }, "el-select", t.cellBind, !1), t.mergedEvents("change", "clear")), e._l(t.options, function(l) {
|
|
1995
|
+
return e.col.component === "select" ? n("el-select", e._g(e._b({ attrs: { value: e.value, placeholder: t.cellBind.placeholder || e.placeholder } }, "el-select", t.cellBind, !1), t.mergedEvents("change", "clear")), e._l(t.options, function(l) {
|
|
1975
1996
|
return n("el-option", { key: String(l.value), attrs: { label: l.label, value: l.value } });
|
|
1976
1997
|
}), 1) : e.col.component === "checkbox" ? n("el-checkbox-group", e._g(e._b({ attrs: { value: e.value } }, "el-checkbox-group", t.cellBind, !1), t.mergedEvents("change")), e._l(t.options, function(l) {
|
|
1977
1998
|
return n("el-checkbox", { key: String(l.value), attrs: { label: l.value } }, [e._v(e._s(l.label))]);
|
|
1978
1999
|
}), 1) : e.col.component === "radio" ? n("el-radio-group", e._g(e._b({ attrs: { value: e.value } }, "el-radio-group", t.cellBind, !1), t.mergedEvents("change")), e._l(t.options, function(l) {
|
|
1979
2000
|
return n("el-radio", { key: String(l.value), attrs: { label: l.value } }, [e._v(e._s(l.label))]);
|
|
1980
|
-
}), 1) : e.col.component === "date-range" ? n("el-date-picker", e._g(e._b({ attrs: { value: e.value, type: "daterange", "range-separator": "至", "start-placeholder": "开始日期", "end-placeholder": "结束日期", "value-format": "yyyy-MM-dd", placeholder: e.placeholder } }, "el-date-picker", t.cellBind, !1), t.mergedEvents("change"))) : e.col.component === "api-select" ? n(t.ApiSelect, e._g(e._b({ attrs: { value: e.value, placeholder: e.placeholder } }, "ApiSelect", t.cellBind, !1), t.mergedEvents("change"))) : e.col.component === "tree-select" ? n(t.TreeSelect, e._g(e._b({ attrs: { value: e.value, placeholder: e.placeholder } }, "TreeSelect", t.cellBind, !1), t.mergedEvents("change"))) : n(t.cellComp, e._g(e._b({ tag: "component", attrs: { value: e.value, placeholder: e.placeholder } }, "component", t.cellBind, !1), t.mergedEvents("input")));
|
|
1981
|
-
}, ln = [], on = /* @__PURE__ */
|
|
2001
|
+
}), 1) : e.col.component === "date-range" ? n("el-date-picker", e._g(e._b({ attrs: { value: e.value, type: "daterange", "range-separator": "至", "start-placeholder": "开始日期", "end-placeholder": "结束日期", "value-format": "yyyy-MM-dd", placeholder: t.cellBind.placeholder || e.placeholder } }, "el-date-picker", t.cellBind, !1), t.mergedEvents("change"))) : e.col.component === "api-select" ? n(t.ApiSelect, e._g(e._b({ attrs: { value: e.value, placeholder: t.cellBind.placeholder || e.placeholder } }, "ApiSelect", t.cellBind, !1), t.mergedEvents("change"))) : e.col.component === "tree-select" ? n(t.TreeSelect, e._g(e._b({ attrs: { value: e.value, placeholder: t.cellBind.placeholder || e.placeholder } }, "TreeSelect", t.cellBind, !1), t.mergedEvents("change"))) : n(t.cellComp, e._g(e._b({ tag: "component", attrs: { value: e.value, placeholder: t.cellBind.placeholder || e.placeholder } }, "component", t.cellBind, !1), t.mergedEvents("input", "change")));
|
|
2002
|
+
}, ln = [], on = /* @__PURE__ */ ie(
|
|
1982
2003
|
tn,
|
|
1983
2004
|
nn,
|
|
1984
2005
|
ln,
|
|
@@ -1988,14 +2009,14 @@ var nn = function() {
|
|
|
1988
2009
|
null,
|
|
1989
2010
|
null
|
|
1990
2011
|
);
|
|
1991
|
-
const an = on.exports,
|
|
2012
|
+
const an = on.exports, rn = {
|
|
1992
2013
|
name: "ProTableForm",
|
|
1993
2014
|
model: {
|
|
1994
2015
|
prop: "modelValue",
|
|
1995
2016
|
event: "update:modelValue"
|
|
1996
2017
|
}
|
|
1997
|
-
},
|
|
1998
|
-
...
|
|
2018
|
+
}, sn = /* @__PURE__ */ oe({
|
|
2019
|
+
...rn,
|
|
1999
2020
|
props: {
|
|
2000
2021
|
modelValue: { default: () => [] },
|
|
2001
2022
|
columns: null,
|
|
@@ -2023,87 +2044,91 @@ const an = on.exports, sn = {
|
|
|
2023
2044
|
formProps: null
|
|
2024
2045
|
},
|
|
2025
2046
|
emits: ["update:modelValue", "add-row", "remove-row", "register"],
|
|
2026
|
-
setup(
|
|
2027
|
-
const t =
|
|
2047
|
+
setup(s, { expose: e, emit: n }) {
|
|
2048
|
+
const t = s, l = oe({
|
|
2028
2049
|
name: "RenderCell",
|
|
2029
2050
|
props: {
|
|
2030
2051
|
renderFn: { type: Function, required: !0 },
|
|
2031
2052
|
renderParams: { type: Object, required: !0 }
|
|
2032
2053
|
},
|
|
2033
|
-
setup(
|
|
2054
|
+
setup(E) {
|
|
2034
2055
|
return () => {
|
|
2035
|
-
const
|
|
2036
|
-
return Array.isArray(
|
|
2056
|
+
const W = E.renderFn(E.renderParams);
|
|
2057
|
+
return Array.isArray(W), W;
|
|
2037
2058
|
};
|
|
2038
2059
|
}
|
|
2039
2060
|
});
|
|
2040
|
-
function a(
|
|
2041
|
-
const
|
|
2042
|
-
return { isText:
|
|
2061
|
+
function a(E, W, g, u) {
|
|
2062
|
+
const c = u !== void 0 ? M(W, g, u) : M(W, g), b = E.render({ row: W, value: c, column: E });
|
|
2063
|
+
return { isText: h(b), value: b };
|
|
2043
2064
|
}
|
|
2044
|
-
const
|
|
2045
|
-
function
|
|
2046
|
-
|
|
2047
|
-
const
|
|
2048
|
-
return
|
|
2065
|
+
const r = /* @__PURE__ */ new WeakMap();
|
|
2066
|
+
function d(E, W, g, u) {
|
|
2067
|
+
r.has(W) || r.set(W, /* @__PURE__ */ new Map());
|
|
2068
|
+
const c = r.get(W), b = g.key + (u ? "." + u : "");
|
|
2069
|
+
return c.has(b) || c.set(b, a(E, W, g, u)), c.get(b);
|
|
2049
2070
|
}
|
|
2050
|
-
function
|
|
2051
|
-
return
|
|
2071
|
+
function h(E) {
|
|
2072
|
+
return E === null || typeof E in { string: 1, number: 1, boolean: 1, bigint: 1, symbol: 1 };
|
|
2052
2073
|
}
|
|
2053
2074
|
const {
|
|
2054
2075
|
formModelRef: v,
|
|
2055
|
-
currentModelValue:
|
|
2056
|
-
mergedRules:
|
|
2057
|
-
tableRows:
|
|
2076
|
+
currentModelValue: k,
|
|
2077
|
+
mergedRules: w,
|
|
2078
|
+
tableRows: y,
|
|
2058
2079
|
rowKeyFn: p,
|
|
2059
2080
|
spanMethodAdapter: _,
|
|
2060
2081
|
formRef: A,
|
|
2061
|
-
slotUpdateHandler:
|
|
2062
|
-
getCellProp:
|
|
2063
|
-
getCellValue:
|
|
2064
|
-
setCellValue:
|
|
2065
|
-
handleAddRow:
|
|
2066
|
-
handleRemoveRow:
|
|
2067
|
-
|
|
2068
|
-
|
|
2082
|
+
slotUpdateHandler: I,
|
|
2083
|
+
getCellProp: S,
|
|
2084
|
+
getCellValue: M,
|
|
2085
|
+
setCellValue: z,
|
|
2086
|
+
handleAddRow: V,
|
|
2087
|
+
handleRemoveRow: R,
|
|
2088
|
+
getRow: f,
|
|
2089
|
+
setRow: O,
|
|
2090
|
+
validate: C,
|
|
2091
|
+
clearValidate: q
|
|
2069
2092
|
} = en({
|
|
2070
2093
|
props: t,
|
|
2071
2094
|
emit: n,
|
|
2072
2095
|
emitAddRow: () => n("add-row"),
|
|
2073
|
-
emitRemoveRow: (
|
|
2096
|
+
emitRemoveRow: (E) => n("remove-row", E)
|
|
2074
2097
|
});
|
|
2075
|
-
function
|
|
2076
|
-
var
|
|
2077
|
-
(
|
|
2098
|
+
function L(E, W, g) {
|
|
2099
|
+
var u;
|
|
2100
|
+
(u = t.onRowClick) == null || u.call(t, E, g);
|
|
2078
2101
|
}
|
|
2079
|
-
function
|
|
2080
|
-
var
|
|
2081
|
-
(
|
|
2102
|
+
function Y(E, W, g) {
|
|
2103
|
+
var u;
|
|
2104
|
+
(u = t.onRowDblclick) == null || u.call(t, E, g);
|
|
2082
2105
|
}
|
|
2083
|
-
function
|
|
2084
|
-
var
|
|
2085
|
-
(
|
|
2106
|
+
function G(E) {
|
|
2107
|
+
var W;
|
|
2108
|
+
(W = t.onSortChange) == null || W.call(t, E);
|
|
2086
2109
|
}
|
|
2087
|
-
function
|
|
2088
|
-
var
|
|
2089
|
-
(
|
|
2110
|
+
function ne(E, W) {
|
|
2111
|
+
var g;
|
|
2112
|
+
(g = t.onExpandChange) == null || g.call(t, E, W);
|
|
2090
2113
|
}
|
|
2091
|
-
const J =
|
|
2092
|
-
...
|
|
2093
|
-
_key:
|
|
2094
|
-
}))),
|
|
2095
|
-
validate:
|
|
2096
|
-
clearValidate:
|
|
2097
|
-
addRow:
|
|
2098
|
-
removeRow:
|
|
2099
|
-
getRows: () => [...
|
|
2100
|
-
getRowCount: () =>
|
|
2101
|
-
getTable: () =>
|
|
2102
|
-
getModelValue: () => [...
|
|
2103
|
-
setModelValue: (
|
|
2104
|
-
getFormRef: () => A.value
|
|
2114
|
+
const J = x(() => t.columns.map((E, W) => ({
|
|
2115
|
+
...E,
|
|
2116
|
+
_key: E.key || `__col-${W}`
|
|
2117
|
+
}))), Z = D(null), X = {
|
|
2118
|
+
validate: C,
|
|
2119
|
+
clearValidate: q,
|
|
2120
|
+
addRow: V,
|
|
2121
|
+
removeRow: R,
|
|
2122
|
+
getRows: () => [...k.value],
|
|
2123
|
+
getRowCount: () => k.value.length,
|
|
2124
|
+
getTable: () => Z.value,
|
|
2125
|
+
getModelValue: () => [...k.value],
|
|
2126
|
+
setModelValue: (E) => n("update:modelValue", E),
|
|
2127
|
+
getFormRef: () => A.value,
|
|
2128
|
+
getRow: f,
|
|
2129
|
+
setRow: O
|
|
2105
2130
|
};
|
|
2106
|
-
return e(
|
|
2131
|
+
return e(X), n("register", X), { __sfc: !0, RenderCell: l, execRenderOnce: a, _renderCache: r, getRender: d, isPrimitive: h, props: t, emit: n, formModelRef: v, currentModelValue: k, mergedRules: w, tableRows: y, rowKeyFn: p, spanMethodAdapter: _, formRef: A, slotUpdateHandler: I, getCellProp: S, getCellValue: M, setCellValue: z, handleAddRow: V, handleRemoveRow: R, getRow: f, setRow: O, validate: C, clearValidate: q, handleTableRowClick: L, handleTableRowDblclick: Y, handleTableSortChange: G, handleTableExpandChange: ne, flatColumns: J, tableRef: Z, action: X, CellEditor: an };
|
|
2107
2132
|
}
|
|
2108
2133
|
});
|
|
2109
2134
|
var un = function() {
|
|
@@ -2118,9 +2143,9 @@ var un = function() {
|
|
|
2118
2143
|
return [e._t(`header-${a.key}`, function() {
|
|
2119
2144
|
return [n("span", { staticClass: "ecp-pro-table-form__th-text" }, [a.required ? n("span", { staticClass: "ecp-pro-table-form__req" }, [e._v("*")]) : e._e(), e._v(e._s(a.title) + " ")])];
|
|
2120
2145
|
}, { column: a })];
|
|
2121
|
-
}, proxy: !0 }, { key: "default", fn: function(
|
|
2122
|
-
return [a.render ? [n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(
|
|
2123
|
-
return t.setCellValue(
|
|
2146
|
+
}, proxy: !0 }, { key: "default", fn: function(r) {
|
|
2147
|
+
return [a.render ? [n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(r.row, l, a.key), rules: t.mergedRules[t.getCellProp(r.row, l, a.key)] } }, [t.getRender(a, r.row, l, a.key).isText ? [n("span", [e._v(e._s(t.getRender(a, r.row, l, a.key).value))])] : [n(t.RenderCell, { attrs: { "render-fn": a.render, "render-params": { row: r.row, col: l, childKey: a.key } } })]], 2)] : a.component === "slot" && a.slotName ? [n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(r.row, l, a.key), rules: t.mergedRules[t.getCellProp(r.row, l, a.key)] } }, [e._t(`cell-${a.slotName}`, null, { column: a, row: r.row, index: r.$index, value: t.getCellValue(r.row, l, a.key), updateValue: t.slotUpdateHandler(r, l, a.key) })], 2)] : n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(r.row, l, a.key), rules: t.mergedRules[t.getCellProp(r.row, l, a.key)] } }, [n(t.CellEditor, { attrs: { col: a, value: t.getCellValue(r.row, l, a.key), row: r.row, index: r.$index, size: e.size, placeholder: l.placeholder || e.metricPlaceholder, formActionType: t.action }, on: { update: function(d) {
|
|
2148
|
+
return t.setCellValue(r.row, l, a.key, d);
|
|
2124
2149
|
} } })], 1)];
|
|
2125
2150
|
} }], null, !0) })];
|
|
2126
2151
|
})], 2) : l.hideInTable ? e._e() : n("el-table-column", { key: "leaf-" + l._key, attrs: { label: l.title, "min-width": l.minWidth || l.width || 120, width: l.width, align: l.align || "center", "header-align": l.headerAlign, fixed: l.fixed, "cell-style": l.cellStyle, "header-cell-style": l.headerCellStyle, "cell-class-name": l.cellClassName, "header-cell-class-name": l.headerCellClassName, sortable: l.sortable, resizable: l.resizable !== !1 }, scopedSlots: e._u([{ key: "header", fn: function() {
|
|
@@ -2128,13 +2153,13 @@ var un = function() {
|
|
|
2128
2153
|
return [n("span", { staticClass: "ecp-pro-table-form__th-text" }, [l.required ? n("span", { staticClass: "ecp-pro-table-form__req" }, [e._v("*")]) : e._e(), e._v(e._s(l.title) + " ")])];
|
|
2129
2154
|
}, { column: l })];
|
|
2130
2155
|
}, proxy: !0 }, { key: "default", fn: function(a) {
|
|
2131
|
-
return [l.render ? [n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(a.row, l), rules: t.mergedRules[t.getCellProp(a.row, l)] } }, [t.getRender(l, a.row, l).isText ? [n("span", [e._v(e._s(t.getRender(l, a.row, l).value))])] : [n(t.RenderCell, { attrs: { "render-fn": l.render, "render-params": { row: a.row, col: l } } })]], 2)] : l.component === "slot" && l.slotName ? [n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(a.row, l), rules: t.mergedRules[t.getCellProp(a.row, l)] } }, [e._t(`cell-${l.slotName}`, null, { column: l, row: a.row, index: a.$index, value: t.getCellValue(a.row, l), updateValue: t.slotUpdateHandler(a, l) })], 2)] : n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(a.row, l), rules: t.mergedRules[t.getCellProp(a.row, l)] } }, [n(t.CellEditor, { attrs: { col: l, value: t.getCellValue(a.row, l), row: a.row, size: e.size, placeholder: l.placeholder || e.metricPlaceholder,
|
|
2132
|
-
return t.setCellValue(a.row, l, void 0,
|
|
2156
|
+
return [l.render ? [n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(a.row, l), rules: t.mergedRules[t.getCellProp(a.row, l)] } }, [t.getRender(l, a.row, l).isText ? [n("span", [e._v(e._s(t.getRender(l, a.row, l).value))])] : [n(t.RenderCell, { attrs: { "render-fn": l.render, "render-params": { row: a.row, col: l } } })]], 2)] : l.component === "slot" && l.slotName ? [n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(a.row, l), rules: t.mergedRules[t.getCellProp(a.row, l)] } }, [e._t(`cell-${l.slotName}`, null, { column: l, row: a.row, index: a.$index, value: t.getCellValue(a.row, l), updateValue: t.slotUpdateHandler(a, l) })], 2)] : n("el-form-item", { staticClass: "ecp-pro-table-form__cell-item", attrs: { prop: t.getCellProp(a.row, l), rules: t.mergedRules[t.getCellProp(a.row, l)] } }, [n(t.CellEditor, { attrs: { col: l, value: t.getCellValue(a.row, l), row: a.row, index: a.$index, size: e.size, placeholder: l.placeholder || e.metricPlaceholder, formActionType: t.action }, on: { update: function(r) {
|
|
2157
|
+
return t.setCellValue(a.row, l, void 0, r);
|
|
2133
2158
|
} } })], 1)];
|
|
2134
2159
|
} }], null, !0) })];
|
|
2135
2160
|
}), e._t("action", null, { addRow: t.handleAddRow, removeRow: t.handleRemoveRow })], 2)], 1)], 1);
|
|
2136
|
-
}, cn = [], dn = /* @__PURE__ */
|
|
2137
|
-
|
|
2161
|
+
}, cn = [], dn = /* @__PURE__ */ ie(
|
|
2162
|
+
sn,
|
|
2138
2163
|
un,
|
|
2139
2164
|
cn,
|
|
2140
2165
|
!1,
|
|
@@ -2154,9 +2179,9 @@ const tt = dn.exports, fn = [
|
|
|
2154
2179
|
{ name: "CollapseContainer", component: et },
|
|
2155
2180
|
{ name: "ProTableForm", component: tt }
|
|
2156
2181
|
];
|
|
2157
|
-
function pn(
|
|
2182
|
+
function pn(s) {
|
|
2158
2183
|
fn.forEach(({ name: e, component: n }) => {
|
|
2159
|
-
|
|
2184
|
+
s.component(e, n);
|
|
2160
2185
|
});
|
|
2161
2186
|
}
|
|
2162
2187
|
const bn = {
|
|
@@ -2180,15 +2205,15 @@ export {
|
|
|
2180
2205
|
tt as ProTableForm,
|
|
2181
2206
|
Ge as TableAction,
|
|
2182
2207
|
wt as applyNumericInputDigitLimits,
|
|
2183
|
-
|
|
2208
|
+
Le as clampByIntegerDigits,
|
|
2184
2209
|
bn as default,
|
|
2185
|
-
|
|
2210
|
+
Ke as formatWithThousands,
|
|
2186
2211
|
pn as install,
|
|
2187
|
-
|
|
2212
|
+
Fe as normalizeNumericValue,
|
|
2188
2213
|
St as numberToEditString,
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2214
|
+
Ct as roundToDecimals,
|
|
2215
|
+
We as sanitizeNumericInput,
|
|
2216
|
+
Me as stripNumberGrouping,
|
|
2192
2217
|
Pt as toFixedDecimalString,
|
|
2193
2218
|
Be as useComponentSetting,
|
|
2194
2219
|
gn as useDescription,
|